// Generated by packages/static/scripts/generate-cfc-types.ts. Do not edit by hand. // // Declaration-only mirror of the public `commonfabric/cfc` authoring surface // defined in packages/api/cfc-authoring.ts. The in-memory pattern compiler loads this // file as the type module for `commonfabric/cfc`, so it stays // declaration-only and must not emit runtime JavaScript. // // To regenerate after changing the authoring surface, run (from // packages/static): // deno task gen-cfc-types // To verify it is up to date, run: // deno task check-cfc-types export type Cfc = T & { readonly __ct_cfc__?: Meta; }; export type CfcJsonValue = | null | boolean | number | string | CfcJsonArray | CfcAtomObject; export interface CfcJsonArray extends ReadonlyArray { } export interface CfcAtomObject extends Readonly> { } export type CfcAtom = CfcJsonValue; export declare const CFC_ATOM_TYPE: { readonly Builtin: "https://commonfabric.org/cfc/atom/Builtin"; readonly Caveat: "https://commonfabric.org/cfc/atom/Caveat"; readonly InjectionSafe: "https://commonfabric.org/cfc/atom/InjectionSafe"; readonly LinkReference: "https://commonfabric.org/cfc/atom/LinkReference"; readonly Origin: "https://commonfabric.org/cfc/atom/Origin"; readonly PolicyCertified: "https://commonfabric.org/cfc/atom/PolicyCertified"; readonly PromptSlotBound: "https://commonfabric.org/cfc/atom/PromptSlotBound"; readonly PromptSlotInfluence: "https://commonfabric.org/cfc/atom/PromptSlotInfluence"; readonly Resource: "https://commonfabric.org/cfc/atom/Resource"; readonly TransformedBy: "https://commonfabric.org/cfc/atom/TransformedBy"; readonly UserSurfaceInput: "https://commonfabric.org/cfc/atom/UserSurfaceInput"; }; export declare const CFC_RUNTIME_SUBJECT = "did:web:commonfabric.org#runtime"; export declare const CFC_CONCEPT_KIND: { readonly PromptInfluence: "https://commonfabric.org/cfc/concepts/prompt-influence"; readonly PromptInjectionRiskUnscreened: "https://commonfabric.org/cfc/concepts/prompt-injection-risk-unscreened"; }; export declare const CFC_FUSE_ATOM_CLASS: { readonly ProjectionMetadataIncomplete: "CommonFabricFuseProjectionMetadataIncomplete"; readonly SymlinkTarget: "CommonFabricFuseSymlinkTarget"; readonly TopologyObservation: "FilesystemTopologyObservation"; }; export type CfcResourceAtom = CfcAtomObject & { readonly type: typeof CFC_ATOM_TYPE.Resource; readonly class: string; readonly subject: string; readonly scope?: CfcAtom; }; export type CfcCaveatAtom = CfcAtomObject & { readonly type: typeof CFC_ATOM_TYPE.Caveat; readonly kind: string; readonly source: CfcAtom; readonly by?: CfcAtom; }; export type CfcBuiltinAtom = CfcAtomObject & { readonly type: typeof CFC_ATOM_TYPE.Builtin; readonly name: string; }; export type CfcInjectionSafeAtom = CfcAtomObject & { readonly type: typeof CFC_ATOM_TYPE.InjectionSafe; }; export type CfcUserSurfaceInputAtom = CfcAtomObject & { readonly type: typeof CFC_ATOM_TYPE.UserSurfaceInput; readonly user: string; readonly surface: string; readonly valueDigest: string; }; export type CfcPromptSlotBoundAtom< Source extends CfcAtom = CfcAtom, Role extends string = string, > = CfcAtomObject & { readonly type: typeof CFC_ATOM_TYPE.PromptSlotBound; readonly source: Source; readonly role: Role; readonly kernelName: string; readonly surface: string; readonly subject?: string; readonly renderRef?: CfcAtom; readonly eventId?: string; readonly valueDigest?: string; readonly slotDigest?: string; readonly snapshotDigest?: string; readonly targetPath?: string; }; export type CfcPromptSlotRunManifest = CfcAtomObject & { readonly source?: string; readonly wishId?: string; readonly dispatchClass?: string; }; export type CfcPromptSlotInfluenceAtom = & CfcAtomObject & { readonly type: typeof CFC_ATOM_TYPE.PromptSlotInfluence; readonly version: 1; readonly role: Role; readonly kernelName: string; readonly surface: string; readonly subject?: string; readonly eventId?: string; readonly valueDigest?: string; readonly slotDigest?: string; readonly snapshotDigest?: string; readonly targetPath?: string; readonly runManifest?: CfcPromptSlotRunManifest; }; export declare const cfcAtom: { readonly resource: ( className: string, subject?: string, scope?: CfcAtom, ) => CfcResourceAtom; readonly caveat: ( kind: string, source: CfcAtom, by?: CfcAtom, ) => CfcCaveatAtom; readonly builtin: (name: string) => CfcBuiltinAtom; readonly injectionSafe: () => CfcInjectionSafeAtom; readonly userSurfaceInput: ( user: string, surface: string, valueDigest: string, ) => CfcUserSurfaceInputAtom; readonly promptSlotBound: ( source: Source, role: Role, kernelName: string, subject: string, surface: string, valueDigest: string, ) => CfcPromptSlotBoundAtom; }; export declare const CFC_CANONICAL_ALIAS_NAMES: readonly [ "Cfc", "Confidential", "Integrity", "AddIntegrity", "RepresentsCurrentUser", "AuthoredByCurrentUser", "RequiresIntegrity", "MaxConfidentiality", "OpaqueInput", "WriteAuthorizedBy", "TrustedActionWriteWithIntegrity", "TrustedActionWrite", "TrustedActionUiContract", "ExactCopy", "ProjectionPath", "ProjectionOf", "Projection", "LengthPreservedFrom", "FilteredFrom", "SubsetOf", "PermutationOf", ]; export type CfcCanonicalAliasName = typeof CFC_CANONICAL_ALIAS_NAMES[number]; export type Ref = { readonly __ct_ref_root__?: Root; readonly __ct_ref_path__?: Path; }; export type PathValue = unknown; export type RefValue = unknown; type EscapePointerSegment = Segment extends `${infer Head}~${infer Tail}` ? `${Head}~0${EscapePointerSegment}` : Segment extends `${infer Head}/${infer Tail}` ? `${Head}~1${EscapePointerSegment}` : Segment; type JoinPointerPath = Path extends readonly [] ? "" : Path extends readonly [ infer First extends string, ...infer Rest extends readonly string[], ] ? `${EscapePointerSegment}${Rest extends readonly [] ? "" : `/${JoinPointerPath}`}` : never; type CanonicalPointer = Path extends readonly [] ? "/" : `/${JoinPointerPath}`; export type Confidential = Cfc; export type Integrity = Cfc; export type AddIntegrity = Cfc; export type RepresentsCurrentUser = Cfc; export type AuthoredByCurrentUser = Cfc; export type RequiresIntegrity = Cfc; export type MaxConfidentiality = Cfc; export type ExactCopy = Cfc; export type LengthPreservedFrom = Cfc; export type FilteredFrom = Cfc; export type SubsetOf = Cfc; export type PermutationOf = Cfc; export type OpaqueInput< T, Spec extends true | { schema?: unknown; allowPassThrough?: boolean; } = true, > = Cfc; export type ProjectionPath< T, From extends string, Path extends readonly string[], > = Cfc; }; }>; export type ProjectionOf = ProjectionPath; export type Projection = SourceRef extends Ref ? ProjectionOf : never; export type WriteAuthorizedBy = Cfc; export type TrustedActionWriteWithIntegrity< T, Binding, Action extends string, Pattern extends string, Integrity extends readonly [ string, ...string[], ], > = Cfc, { uiContract: { helper: "UiAction"; action: Action; trustedPattern: Pattern; requiredEventIntegrity: Integrity; }; }>; export type TrustedActionWrite< T, Binding, Action extends string, Pattern extends string, > = TrustedActionWriteWithIntegrity; export type TrustedActionUiContract< T, Action extends string, Pattern extends string, Integrity extends readonly [ string, ...string[], ] = [ Pattern, ], > = Cfc;