import { Type } from "typebox"; export declare const WORKSPACE_ACCESS: readonly ["read-only", "read-write"]; export declare const PATH_INTENTS: readonly ["existing-file", "existing-directory", "create-file", "create-directory", "executable"]; export declare const CAPABILITY_LIFETIMES: readonly ["phase", "run", "external"]; export declare const WorkspaceAccessSchema: Type.TUnion[]>; export type WorkspaceAccess = (typeof WORKSPACE_ACCESS)[number]; export declare const PathIntentSchema: Type.TUnion[]>; export type PathIntent = (typeof PATH_INTENTS)[number]; export declare const CapabilityLifetimeSchema: Type.TUnion; }>[]>; export type CapabilityLifetime = { scope: "phase"; } | { scope: "run"; } | { scope: "external"; }; export declare const BoundCapabilityLifetimeSchema: Type.TUnion<[Type.TObject<{ scope: Type.TLiteral<"phase">; runId: Type.TString; phaseId: Type.TString; attemptId: Type.TString; }>, Type.TObject<{ scope: Type.TLiteral<"run">; runId: Type.TString; }>, Type.TObject<{ scope: Type.TLiteral<"external">; bindingId: Type.TString; providerInstanceId: Type.TOptional; }>]>; export type BoundCapabilityLifetime = { scope: "phase"; runId: string; phaseId: string; attemptId: string; } | { scope: "run"; runId: string; } | { scope: "external"; bindingId: string; providerInstanceId?: string; }; export declare const HandleRefSchema: Type.TObject<{ producerPhaseId: Type.TString; exportName: Type.TString; }>; export interface HandleRef { producerPhaseId: string; exportName: string; } export declare const RelativePathExprSchema: Type.TUnion<[Type.TObject<{ literalPath: Type.TString; argPath: Type.TOptional; segments: Type.TOptional; }>, Type.TObject<{ argPath: Type.TString; literalPath: Type.TOptional; segments: Type.TOptional; }>, Type.TObject<{ segments: Type.TArray; }>, Type.TObject<{ argSegment: Type.TString; segment: Type.TOptional; }>]>>; literalPath: Type.TOptional; argPath: Type.TOptional; }>]>; export type RelativePathExpr = { literalPath: string; } | { argPath: string; } | { segments: Array<{ segment: string; } | { argSegment: string; }>; }; export declare const PathRefSchema: Type.TUnion<[Type.TObject<{ subpath: Type.TOptional; segments: Type.TOptional; }>, Type.TObject<{ argPath: Type.TString; literalPath: Type.TOptional; segments: Type.TOptional; }>, Type.TObject<{ segments: Type.TArray; }>, Type.TObject<{ argSegment: Type.TString; segment: Type.TOptional; }>]>>; literalPath: Type.TOptional; argPath: Type.TOptional; }>]>>; access: Type.TOptional[]>>; maxLifetime: Type.TOptional; }>[]>>; intent: Type.TUnion[]>; workspace: Type.TString; handle: Type.TOptional; }>, Type.TObject<{ subpath: Type.TOptional; segments: Type.TOptional; }>, Type.TObject<{ argPath: Type.TString; literalPath: Type.TOptional; segments: Type.TOptional; }>, Type.TObject<{ segments: Type.TArray; }>, Type.TObject<{ argSegment: Type.TString; segment: Type.TOptional; }>]>>; literalPath: Type.TOptional; argPath: Type.TOptional; }>]>>; access: Type.TOptional[]>>; maxLifetime: Type.TOptional; }>[]>>; intent: Type.TUnion[]>; handle: Type.TObject<{ producerPhaseId: Type.TString; exportName: Type.TString; }>; workspace: Type.TOptional; }>]>; interface PathRefBase { subpath?: RelativePathExpr; access?: WorkspaceAccess; maxLifetime?: CapabilityLifetime; intent: PathIntent; } export type PathRef = PathRefBase & ({ workspace: string; handle?: never; } | { handle: HandleRef; workspace?: never; }); export type NormalizedPathRef = PathRef & { access: WorkspaceAccess; }; export interface ResourceVersion { identityMode: "portable" | "path-bound" | "unavailable"; contentId?: string; scopeDigest?: string; generation: number; state: "clean" | "write-pending" | "dirty-unknown"; } export interface ScopedCapability { bindingId: string; resourceDomainId: string; providerInstanceId: string; logicalWorkspaceId: string; logicalPrefix: string; physicalScopeRoot: string; access: WorkspaceAccess; version: ResourceVersion; lifetime: BoundCapabilityLifetime; } export type ResourceSchemaResult = { ok: true; value: T; } | { ok: false; errors: string[]; }; /** Normalize and validate the portable multi-segment relative-path grammar. */ export declare function normalizePortableRelativePath(input: unknown): ResourceSchemaResult; /** Normalize and validate exactly one portable path segment. */ export declare function normalizePortablePathSegment(input: unknown): ResourceSchemaResult; export declare function validateWorkspaceAccess(input: unknown): ResourceSchemaResult; export declare function validatePathIntent(input: unknown): ResourceSchemaResult; export declare function validateCapabilityLifetime(input: unknown): ResourceSchemaResult; export declare function validateBoundCapabilityLifetime(input: unknown): ResourceSchemaResult; export declare function validateRelativePathExpr(input: unknown): ResourceSchemaResult; export declare function validatePathRef(input: unknown): ResourceSchemaResult; export declare function accessAllows(maximum: WorkspaceAccess, requested: WorkspaceAccess): boolean; export declare function lifetimeRank(lifetime: CapabilityLifetime | BoundCapabilityLifetime): number; export {}; //# sourceMappingURL=schema.d.ts.map