import { type DeclarativeCreateTemplateRegistration, type DeclarativeProductResourceRegistration, type DeclarativeRouteSpaceRegistration, type DeclarativeSchemaDefinitionRegistration, type DesignCapabilityCatalogArtifact, type DesignCapabilityCatalogEntry, type ProductDeclarativeCapabilityRegistration } from "../contracts/declarative-control-http"; import { type ActionProgramDefinition, type AccessPolicy, type CompiledRouteClaim, type DeclarativeRouteOwnerIndex, type DeclarativeRouteOwnerIndexEntry, type DeclarativeRouteClaim, type DeclarativeWorkbenchCatalog, type DeclarativeWorkbenchCatalogEntry, type DomainQueryDefinition, type LegacyRouteTakeoverAuthorization, type PermissionAlternativePolicy, type Navigation, type NavigationRelease, type NavigationRuntimeBundle, type Page, type ResolvedPage, type PageRelease, type PageRuntimeBundle, type LegacyPageRuntimeBundle, type ReleaseDependency, type RevisionRef, type RouteClaim, type RouteSpace, type StableRef, type TenantScope, type Workbench, type WorkbenchRelease, type WorkbenchRuntimeBundle } from "../contracts/declarative-control"; import type { DomainCommandDefinition } from "../contracts/semantic"; export type DeclarativeControlCompilationErrorCode = "AUDIENCE_WIDER_THAN_TARGET" | "CAPABILITY_BINDING_MISMATCH" | "CAPABILITY_NOT_EDITOR_ELIGIBLE" | "COMMAND_DEFINITION_MISMATCH" | "CROSS_TENANT_REFERENCE" | "DEPENDENCY_MISSING" | "DESIGN_CATALOG_INVALID" | "HEAD_CONFLICT" | "NAV_DEPTH_EXCEEDED" | "NAV_ACTION_INPUT_INVALID" | "NAV_NODE_LIMIT_EXCEEDED" | "NAV_TARGET_UNRELEASED" | "PAGE_ENTRY_TARGET_UNRELEASED" | "PORT_TYPE_MISMATCH" | "PRODUCT_CAPABILITY_CATALOG_INVALID" | "QUERY_DEFINITION_MISMATCH" | "RENDER_DEPTH_EXCEEDED" | "RENDER_TREE_INVALID" | "RENDER_NODE_LIMIT_EXCEEDED" | "RELEASE_OPERATION_INVALID" | "RELEASE_VALIDATION_FAILED" | "REGISTRY_CONFLICT" | "REVISION_MISMATCH" | "ROUTE_CONFLICT" | "ROUTE_RESERVED" | "ROUTE_TAKEOVER_INVALID" | "SCHEMA_DEFINITION_MISMATCH" | "ROUTE_SPACE_MISSING" | "ROUTE_SPACE_MISMATCH" | "SHELL_CHROME_UNAVAILABLE" | "SHELL_REVISION_MISMATCH" | "SHELL_SURFACE_MISMATCH" | "WORKBENCH_INSTANCE_LIMIT_EXCEEDED" | "WORKBENCH_RELEASE_SET_INVALID" | "WORKBENCH_TEMPLATE_UNRELEASABLE"; export declare class DeclarativeControlCompilationError extends Error { readonly code: DeclarativeControlCompilationErrorCode; readonly path: string; constructor(code: DeclarativeControlCompilationErrorCode, path: string, message: string); } export interface DeclarativeControlCompileLimits { maxNavigationNodes: number; maxNavigationDepth: number; maxRenderNodes: number; maxRenderDepth: number; maxWorkbenchGroups: number; maxWorkbenchInstances: number; } export interface RouteSpaceRegistration { revisionRef: RevisionRef; routeSpace: RouteSpace; } export interface CapabilityPortRegistration { name: string; schemaRevisionRef: RevisionRef; } export interface DeclarativeCapabilityRegistration { runtimeContractVersion?: string; capabilityRevisionRef: RevisionRef; providerRevisionRef: RevisionRef; propertySchemaRevisionRef: RevisionRef; accessPolicy: AccessPolicy; editorEligible: boolean; inputPorts: readonly CapabilityPortRegistration[]; outputPorts: readonly CapabilityPortRegistration[]; allowedSideEffects: readonly ("network" | "storage" | "navigation" | "clipboard" | "worker" | "websocket")[]; } export interface ActionProgramRegistration { definitionRevisionRef: RevisionRef; definition: ActionProgramDefinition; } export interface DomainQueryRegistration { definitionRevisionRef: RevisionRef; definition: DomainQueryDefinition; } export interface DomainCommandRegistration { definitionRevisionRef: RevisionRef; definition: DomainCommandDefinition; } export interface ResolvePageDefaults { routeSpace: RevisionRef; shell: RevisionRef; tokens: readonly RevisionRef[]; performanceBudget: RevisionRef; observationPolicy: RevisionRef; } export interface ResolvePageInput { page: Page; pageOwnerRepo: string; defaults: ResolvePageDefaults; routeSpaces?: readonly RouteSpaceRegistration[]; productResources?: readonly DeclarativeProductResourceRegistration[]; capabilityRegistry: readonly DeclarativeCapabilityRegistration[]; domainQueryRegistry?: readonly DomainQueryRegistration[]; programRegistry?: readonly ActionProgramRegistration[]; domainCommandRegistry?: readonly DomainCommandRegistration[]; schemaRegistry?: readonly DeclarativeSchemaDefinitionRegistration[]; targetRegistry?: readonly NavigationRouteTargetRegistration[]; } export interface WorkbenchTargetRegistration { stableTargetRef: StableRef; targetRevisionRef: RevisionRef; accessPolicy: AccessPolicy; } export interface NavigationRouteTargetRegistration extends WorkbenchTargetRegistration { kind: "route"; releaseRevisionRef?: RevisionRef; surface: "studio" | "kernel"; routeClaim: CompiledRouteClaim; } export interface NavigationRegisteredMenuActionRegistration extends WorkbenchTargetRegistration { kind: "registered-menu-action"; surface: "studio" | "kernel"; applicationId: string; actionRef: string; inputSchemaRef?: string; validateInput?: (input: Record) => Record; sourceCatalogRevisionRef: RevisionRef; } export interface NavigationDomainCommandRegistration extends WorkbenchTargetRegistration { kind: "governed-domain-command"; surface: "studio" | "kernel"; inputSchemaRevisionRef: RevisionRef; resultSchemaRevisionRef?: RevisionRef; } export type NavigationTargetRegistration = NavigationRouteTargetRegistration | NavigationRegisteredMenuActionRegistration | NavigationDomainCommandRegistration; export interface CompileRouteClaimsInput { claims: readonly (RouteClaim | DeclarativeRouteClaim | ResolvedPage["routeClaims"][number] | Workbench["routeClaims"][number])[]; routeSpaces: readonly RouteSpaceRegistration[]; surface: "studio" | "kernel"; legacyRouteTakeoverAuthorizations?: readonly LegacyRouteTakeoverAuthorization[]; } export interface MaterializeRouteSpacePathInput { routeSpace: RouteSpace; applicationPath: string; parameters?: Readonly>; } export interface CompilePageRuntimeBundleInput { page: ResolvedPage; pageRevisionRef: RevisionRef; release: PageRelease; releaseRevisionRef: RevisionRef; routeSpaces: readonly RouteSpaceRegistration[]; compilerRevisionRef: RevisionRef; generation: number; limits: DeclarativeControlCompileLimits; capabilityRegistry: readonly DeclarativeCapabilityRegistration[]; domainQueryRegistry?: readonly DomainQueryRegistration[]; programRegistry?: readonly ActionProgramRegistration[]; targetRegistry?: readonly NavigationRouteTargetRegistration[]; shellRegistration: DeclarativeProductResourceRegistration; /** Exact shared Studio Page references independently verified by the authenticated catalog. */ verifiedSharedPageReferences?: readonly RevisionRef[]; } export interface CompileWorkbenchRuntimeBundleInput { capabilityRegistry?: readonly DeclarativeCapabilityRegistration[]; workbench: Workbench; workbenchRevisionRef: RevisionRef; release: WorkbenchRelease; releaseRevisionRef: RevisionRef; routeSpaces: readonly RouteSpaceRegistration[]; targetRegistry: readonly WorkbenchTargetRegistration[]; compilerRevisionRef: RevisionRef; generation: number; limits: DeclarativeControlCompileLimits; } export interface CompileNavigationRuntimeBundleInput { navigation: Navigation; navigationRevisionRef: RevisionRef; release: NavigationRelease; releaseRevisionRef: RevisionRef; targetRegistry: readonly NavigationTargetRegistration[]; /** * Exact Page and PageRelease references independently verified by the * authenticated Kernel catalog. These are the only cross-tenant references * a Kernel Navigation may retain in its immutable runtime bundle. */ verifiedKernelPageReferences?: readonly RevisionRef[]; compilerRevisionRef: RevisionRef; generation: number; limits: DeclarativeControlCompileLimits; } export declare const stableRefKey: (reference: StableRef) => string; export declare const revisionRefKey: (reference: RevisionRef) => string; export declare const sameStableRef: (left: StableRef, right: StableRef) => boolean; export declare const sameRevisionRef: (left: RevisionRef, right: RevisionRef) => boolean; /** Schema content and authority remain stable across catalog renumbering. */ export declare const sameSchemaContract: (left: RevisionRef, right: RevisionRef) => boolean; export declare const canonicalContentHash: (value: unknown) => string; /** * Names one immutable Runtime Bundle projection by its exact Release evidence. * The fixed-size digest stays below Data Server's 256-byte projection id limit * even when a governed release slot uses the maximum contract identifier size. */ export declare const declarativeRuntimeProjectionId: (resourceKind: "page" | "navigation" | "workbench", releaseSlotId: string, releaseRevisionRef: Pick) => string; /** Names the rebuildable route-owner index for one tenant environment surface. */ export declare const declarativeRouteOwnerIndexProjectionId: (tenantScope: TenantScope, environmentRef: StableRef, surface: "studio" | "kernel") => string; export declare const declarativeWorkbenchCatalogProjectionId: (tenantScope: TenantScope, environmentRef: StableRef, surface: "studio" | "kernel") => string; export declare const compileLegacyRouteTakeoverAuthorization: (input: Omit) => LegacyRouteTakeoverAuthorization; export declare const legacyRouteTakeoverAuthorizationHash: (input: Omit) => string; export declare const parseExactLegacyRouteTakeoverAuthorization: (input: unknown) => LegacyRouteTakeoverAuthorization; export declare const permissionAlternativePolicyAllows: (policyInput: PermissionAlternativePolicy, permissionCodes: ReadonlySet | readonly string[]) => boolean; export declare const compileDeclarativeRouteOwnerIndex: (input: { tenantScope: TenantScope; environmentRef: StableRef; surface: "studio" | "kernel"; generation: number; entries: readonly DeclarativeRouteOwnerIndexEntry[]; }) => DeclarativeRouteOwnerIndex; export declare const compileDeclarativeWorkbenchCatalog: (input: { tenantScope: TenantScope; environmentRef: StableRef; surface: "studio" | "kernel"; generation: number; entries: readonly DeclarativeWorkbenchCatalogEntry[]; }) => DeclarativeWorkbenchCatalog; export declare const declarativeCreateTemplateSourceHash: (document: DeclarativeCreateTemplateRegistration["document"]) => string; export declare const declarativeCreateTemplateRevisionHash: (registration: DeclarativeCreateTemplateRegistration) => string; export declare const declarativeRouteSpaceSourceHash: (routeSpace: DeclarativeRouteSpaceRegistration["routeSpace"]) => string; export declare const declarativeRouteSpaceRevisionHash: (registration: DeclarativeRouteSpaceRegistration) => string; export declare const declarativeProductResourceSourceHash: (document: DeclarativeProductResourceRegistration["document"]) => string; export declare const declarativeProductResourceRevisionHash: (registration: DeclarativeProductResourceRegistration) => string; export declare const designCapabilityCatalogArtifactHash: (input: { sourceRef: string; entries: readonly DesignCapabilityCatalogEntry[]; }) => string; export declare const compileDesignCapabilityCatalogArtifact: (input: { sourceRef: string; revision: number; entries: readonly DesignCapabilityCatalogEntry[]; }) => DesignCapabilityCatalogArtifact; /** Validate immutable product-owned capability provenance from an application release. */ export declare const parseExactProductDeclarativeCapabilityRegistration: (input: unknown) => ProductDeclarativeCapabilityRegistration; export declare const parseExactDesignCapabilityCatalogArtifact: (input: unknown) => DesignCapabilityCatalogArtifact; export declare const accessPolicyChainImplies: (policyInputs: readonly AccessPolicy[], targetInput: AccessPolicy) => boolean; export declare const compiledRouteClaimsOverlap: (leftInput: CompiledRouteClaim, rightInput: CompiledRouteClaim) => boolean; export declare const compileRouteClaims: (input: CompileRouteClaimsInput) => readonly CompiledRouteClaim[]; export type CompiledRouteMatch = { matched: boolean; normalizedPath?: string; parameters: Readonly>; }; /** * Matches an application-relative request path using only the policy frozen into * a CompiledRouteClaim. Runtime consumers must not reconstruct RouteSpace policy * from product ids or deployment configuration. */ export declare const matchCompiledRouteClaim: (claimInput: CompiledRouteClaim, pathInput: string) => CompiledRouteMatch; /** * Materializes the browser URL owned by a RouteSpace from an application-relative * compiled route. Declarations and runtime resolution remain application-relative; * only this boundary applies product bases such as /:teamId or /kernel. */ export declare const materializeRouteSpacePath: (input: MaterializeRouteSpacePathInput) => string; export declare const resolvePage: (input: ResolvePageInput) => ResolvedPage; export type LegacyCompilePageRuntimeBundleInput = Omit & { capabilityRegistry: readonly (Omit & Partial>)[]; }; /** Explicit compatibility boundary for previously persisted resolved Page documents. */ export declare const compileLegacyPageRuntimeBundle: (input: LegacyCompilePageRuntimeBundleInput) => LegacyPageRuntimeBundle; export declare const compilePageRuntimeBundle: (input: CompilePageRuntimeBundleInput) => PageRuntimeBundle; export declare const compileWorkbenchRuntimeBundle: (input: CompileWorkbenchRuntimeBundleInput) => WorkbenchRuntimeBundle; export declare const compileNavigationRuntimeBundle: (input: CompileNavigationRuntimeBundleInput) => NavigationRuntimeBundle; export declare const validateWorkbenchRuntimeSet: (bundleInputs: readonly WorkbenchRuntimeBundle[]) => readonly WorkbenchRuntimeBundle[]; export type WorkbenchEntryResolution = { status: "resolved"; bundle: WorkbenchRuntimeBundle; source: "explicit" | "default" | "first-accessible"; } | { status: "not-found"; workbenchId: string; } | { status: "forbidden"; workbenchId: string; }; export declare const resolveWorkbenchEntry: (input: { bundles: readonly WorkbenchRuntimeBundle[]; requestedWorkbenchId?: string; isAllowed: (bundle: WorkbenchRuntimeBundle) => boolean; }) => WorkbenchEntryResolution; export declare const programDependencies: (definition: ActionProgramDefinition) => ReleaseDependency[]; export declare function assertProgramRegistration(registration: ActionProgramRegistration, scope: TenantScope, surface: string, path?: string): void; //# sourceMappingURL=declarative-control-compiler.d.ts.map