Files
roboomp 124e5593e9 fix(coding-agent): resolved omp docs urls
Accepted omp://docs as the embedded documentation root and mapped docs-prefixed paths to the generated documentation index.

Added regression coverage for omp://docs and omp://docs/tools/read.md resolution.

Fixes #1898
2026-06-05 03:41:51 +00:00

21 lines
776 B
TypeScript

import { describe, expect, it } from "bun:test";
import { InternalUrlRouter } from "@oh-my-pi/pi-coding-agent/internal-urls";
describe("OmpProtocolHandler", () => {
it("treats omp://docs as the documentation root", async () => {
const resource = await InternalUrlRouter.instance().resolve("omp://docs");
expect(resource.content).toContain("# Documentation");
expect(resource.content).toContain("tools/read.md");
});
it("resolves docs-prefixed documentation paths", async () => {
const router = InternalUrlRouter.instance();
const direct = await router.resolve("omp://tools/read.md");
const prefixed = await router.resolve("omp://docs/tools/read.md");
expect(prefixed.content).toBe(direct.content);
expect(prefixed.content).toContain("# read");
});
});