/** * Bidirectional mapping between proxy-rule pathPatterns (e.g. `/api/auth/*`) and authoring-layout * filesystem segments (e.g. `['api', 'auth', '[...path]']`), plus deterministic specificity * ordering used by the compiler (Task 6) and decompiler (Task 7). */ /** Authoring-layout method stems (filenames `.rule.yaml` / directories `/rule.yaml`). * Shared with the compiler (Task 6) so the stem list has exactly one definition. */ export declare const METHOD_STEMS: Set; /** RFC-4122 UUID matcher. Shared between the compiler (schema-ref resolution warnings) and the * decompiler (schema-ref rewriting warnings) so there is exactly one definition. */ export declare const UUID_RE: RegExp; /** * The compiler-derived default pipeline name for a rule with no explicit `pipeline.name`: * `${segments.join('/')} ${methodStem.toUpperCase()}`. `segments` are the directory segments * between `rules/` and the method file/dir (build.ts's `dirSegments`, decompile.ts's derived * `base`); `methodStem` is the lowercase method stem (`get`, `post`, …, `any`). * * The compiler (build.ts) uses this to fill in `pipeline.name` when the manifest omits it; the * decompiler (decompile.ts) recomputes the same string to decide whether to elide `name:` from * the emitted `pipeline:` sugar. Both call sites MUST use this single definition — a drift here * silently breaks the round-trip for rule shapes not covered by the fixtures. */ export declare function defaultPipelineName(segments: string[], methodStem: string): string; /** * Filesystem segments for a pathPattern, or `null` when the pattern is inexpressible as a * directory layout (partial-segment globs, unsafe/bracket chars, reserved literal segments, * a pattern that doesn't start with `/`, etc). */ export declare function patternToRelPath(pattern: string): string[] | null; /** * Exact inverse of `patternToRelPath`: `[...anything]` and `[anything]` both become `*` in their * position; literal segments pass through unchanged. `relPathToPattern(patternToRelPath(p)!) === p` * holds for every expressible `p`. */ export declare function relPathToPattern(segments: string[]): string; /** * Stable, deterministic specificity ordering: more literal segments first; among ties, fewer * wildcards first; among ties, a later wildcard position first; then pathPattern lexicographic; * then method (methodless sorts last). Does not mutate the input array. */ export declare function sortRulesBySpecificity(rules: T[]): T[]; /** * 0-based position of each rule in the specificity sort. The compiler uses this when a manifest * has no explicit `order:`; the decompiler elides `order:` exactly when the stored value equals * the derived one. */ export declare function deriveOrders(rules: T[]): Map; /** `--path-prefix`: a literal, absolute, `.`/`..`/`*`-free path with no trailing slash. */ export declare function assertPathPrefix(prefix: string): void; /** * Prepend `prefix` to a *derived* pattern (`/echo` → `/api/hello/echo`). Explicit `pathPattern:` * manifests are never passed through here — the escape hatch means "exactly this pattern", which * is how a publish-time forwarder (`/w//*`) rides inside a prefixed set (spec 06). * * A root rule derives to `/` (e.g. `rules/get.rule.yaml`); prepending naively would yield a * trailing-slash pattern (`/api/hello/`) that CE's exact-string matcher never matches for * `GET /api/hello`, so the root case returns the bare prefix instead. */ export declare function applyPathPrefix(pattern: string, prefix?: string): string;