/** * Internal helper for computing ancestor paths from scanner-emitted * `pathSegments` + `contentLocation` without re-introducing a `Path` service * dependency in subject modules. * * The canonical-extensions scanner already splits `contentLocation` into * `pathSegments` via the `Path` service. This helper inverts that: it derives * the platform separator from the relationship between the segments and the * original string, then joins a prefix back to a path. * * Why this exists: subject modules need `packageRoot` (the parent or * grandparent directory of `contentLocation`). They never see the `Path` * service — that lives at the live-layer construction boundary. The scanner's * `pathSegments` field carries enough structure to reconstruct any ancestor. * * Cross-platform behavior: * * - POSIX `/ws/agent_extensions/agentxm/@o/skills/x/src` → * `pathSegments = ["", "ws", "agent_extensions", "agentxm", "@o", "skills", "x", "src"]`. * Dropping the trailing `src` segment yields the package root * `/ws/agent_extensions/agentxm/@o/skills/x`. * - Windows `C:\\ws\\agent_extensions\\agentxm\\@o\\skills\\x\\src` → * `pathSegments = ["C:", "ws", "agent_extensions", "agentxm", "@o", "skills", "x", "src"]`. * `pathSegments[0]` is `"C:"` (length 2); the separator is * `contentLocation.charAt(2) = "\\"`. Joining yields * `C:\\ws\\agent_extensions\\agentxm\\@o\\skills`. */ /** * Drop the trailing `count` segments from `pathSegments` and rejoin the * remainder with the separator inferred from `contentLocation`. Returns the * empty string if all segments would be dropped. */ export declare const stripTrailingSegments: (pathSegments: ReadonlyArray, contentLocation: string, count: number) => string; export declare const canonicalAxmPackageRoot: (occ: { readonly origin: "canonical-axm" | "external-axm"; readonly pathSegments: ReadonlyArray; readonly contentLocation: string; }) => string; //# sourceMappingURL=package-root.d.ts.map