/** * 0.2.1 compatibility bridge for a phase cwd selected by one typed argument. * * This is deliberately narrower than general string interpolation: * `cwd` may be exactly `{args.X}`, and X must be declared as a * `relative-path`. Resolution is anchored to the invocation root, requires an * existing directory, and rejects lexical and symlink escapes. * * Path resolution is defense in depth, not a filesystem sandbox. The bridge * therefore stays disabled unless the host explicitly opts into the documented * `resolve-only` execution mode. A future sandbox backend may add a stronger * mode after host conformance evidence exists. */ export declare const CWD_BRIDGE_MODE_ENV = "TASKFLOW_CWD_BRIDGE_MODE"; export type CwdBridgeMode = "resolve-only"; export interface ResolvedCwdArg { argName: string; /** NFC-normalized, portable `/`-separated value used for diagnostics. */ logicalPath: string; /** Canonical existing directory below the canonical invocation root. */ absolutePath: string; } /** Persistable identity for an invocation-root directory binding. */ export interface DirectoryIdentity { canonicalPath: string; device: string; inode: string; } export declare function directoryIdentity(dir: string): DirectoryIdentity | undefined; export type CwdBridgeResult = { ok: true; value: ResolvedCwdArg; } | { ok: false; code: "TF_CWD_BRIDGE_DISABLED" | "TF_CWD_ARG_MISSING" | "TF_CWD_ARG_INVALID" | "TF_CWD_TARGET_INVALID"; message: string; }; /** Return the selected arg name only for the exact whole-placeholder form. */ export declare function cwdArgName(cwd: string | undefined): string | undefined; /** True when cwd contains interpolation syntax but is not the supported form. */ export declare function hasCwdPlaceholder(cwd: string): boolean; /** * Validate and normalize a portable relative directory selector. * * The grammar intentionally rejects host-dependent spellings (backslashes, * drive/UNC/device paths, empty/dot segments, and Windows-reserved names) so a * flow cannot mean different locations on different hosts. */ export declare function normalizeRelativePath(value: unknown): { ok: true; value: string; } | { ok: false; message: string; }; export declare function isPathWithin(root: string, candidate: string): boolean; /** Resolve one typed cwd arg under an existing invocation root, fail-closed. */ export declare function resolveCwdArg(root: string, argName: string, argValue: unknown, mode: CwdBridgeMode | undefined): CwdBridgeResult; /** Host-owned opt-in. Flow JSON and invocation args cannot select this mode. */ export declare function cwdBridgeModeFromEnv(value?: string | undefined): CwdBridgeMode | undefined; //# sourceMappingURL=cwd-bridge.d.ts.map