pi-fabric 0.130.2 → 0.131.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/activity/store.d.ts +2 -1
- package/dist/activity/store.d.ts.map +1 -1
- package/dist/actors/directory.d.ts.map +1 -1
- package/dist/actors/global-registry.d.ts.map +1 -1
- package/dist/actors/manager.d.ts +4 -3
- package/dist/actors/manager.d.ts.map +1 -1
- package/dist/actors/mesh-monitor.d.ts +2 -0
- package/dist/actors/mesh-monitor.d.ts.map +1 -1
- package/dist/actors/name-policy.d.ts +3 -0
- package/dist/actors/name-policy.d.ts.map +1 -0
- package/dist/actors/registry-store.d.ts +1 -1
- package/dist/actors/registry-store.d.ts.map +1 -1
- package/dist/agents/agent-files.d.ts +8 -0
- package/dist/agents/agent-files.d.ts.map +1 -1
- package/dist/agents/agent-files.js +48 -3
- package/dist/agents/agent-files.js.map +2 -2
- package/dist/agents/child-skills.d.ts +60 -0
- package/dist/agents/child-skills.d.ts.map +1 -0
- package/dist/agents/child-skills.js +94 -0
- package/dist/agents/child-skills.js.map +7 -0
- package/dist/agents/clone-first-worktree.d.ts +6 -0
- package/dist/agents/clone-first-worktree.d.ts.map +1 -1
- package/dist/agents/cow-clone.d.ts.map +1 -1
- package/dist/agents/handoff.d.ts +12 -2
- package/dist/agents/handoff.d.ts.map +1 -1
- package/dist/agents/manager.d.ts +4 -1
- package/dist/agents/manager.d.ts.map +1 -1
- package/dist/agents/model-pin-guard.d.ts +27 -0
- package/dist/agents/model-pin-guard.d.ts.map +1 -0
- package/dist/agents/model-pin-guard.js +86 -0
- package/dist/agents/model-pin-guard.js.map +7 -0
- package/dist/agents/model-pin.d.ts +25 -0
- package/dist/agents/model-pin.d.ts.map +1 -0
- package/dist/agents/provider-bridge.d.ts +5 -4
- package/dist/agents/provider-bridge.d.ts.map +1 -1
- package/dist/agents/provider-bridge.js +32 -4
- package/dist/agents/provider-bridge.js.map +3 -3
- package/dist/agents/request.d.ts.map +1 -1
- package/dist/agents/service-schema.d.ts.map +1 -1
- package/dist/agents/types.d.ts +25 -0
- package/dist/agents/types.d.ts.map +1 -1
- package/dist/agents/worktree-manager.d.ts.map +1 -1
- package/dist/agents.js +6 -5
- package/dist/agents.js.map +2 -2
- package/dist/audit/details.d.ts +4 -0
- package/dist/audit/details.d.ts.map +1 -1
- package/dist/chunks/{chunk-SBAROA4Y.js → chunk-2RWNVCFD.js} +17 -1
- package/dist/chunks/{chunk-SBAROA4Y.js.map → chunk-2RWNVCFD.js.map} +2 -2
- package/dist/chunks/{chunk-6O6UWMBO.js → chunk-36XQFTEN.js} +2 -2
- package/dist/chunks/chunk-3PKZSIRA.js +1312 -0
- package/dist/chunks/chunk-3PKZSIRA.js.map +7 -0
- package/dist/chunks/{chunk-JJXUOXI5.js → chunk-4KX6BIPL.js} +17 -2
- package/dist/chunks/chunk-4KX6BIPL.js.map +7 -0
- package/dist/chunks/{chunk-EYHTTMSM.js → chunk-4PBW54I2.js} +5 -5
- package/dist/chunks/{chunk-WTIF3MIM.js → chunk-56NMRVTV.js} +8 -8
- package/dist/chunks/{chunk-WQFG7ZVC.js → chunk-5BOTHX47.js} +48 -13
- package/dist/chunks/chunk-5BOTHX47.js.map +7 -0
- package/dist/chunks/chunk-5QJFDKPN.js +179 -0
- package/dist/chunks/chunk-5QJFDKPN.js.map +7 -0
- package/dist/chunks/chunk-6HO2IUQ5.js +104 -0
- package/dist/chunks/chunk-6HO2IUQ5.js.map +7 -0
- package/dist/chunks/{chunk-NF6W327N.js → chunk-7CIES6X2.js} +9 -2
- package/dist/chunks/chunk-7CIES6X2.js.map +7 -0
- package/dist/chunks/{chunk-KDX3762L.js → chunk-DGERP4VL.js} +4 -4
- package/dist/chunks/{chunk-K3ZWBUUL.js → chunk-IOGDTIGN.js} +13 -13
- package/dist/chunks/chunk-IOGDTIGN.js.map +7 -0
- package/dist/chunks/{chunk-UXIBKMUM.js → chunk-KIFOEBYJ.js} +4 -4
- package/dist/chunks/{chunk-D5224P2R.js → chunk-LKYLD5SN.js} +7 -7
- package/dist/chunks/chunk-NENQZCGW.js +45 -0
- package/dist/chunks/chunk-NENQZCGW.js.map +7 -0
- package/dist/chunks/{chunk-YTYLKL3Z.js → chunk-OJ4HAALD.js} +8 -8
- package/dist/chunks/{chunk-TBB7F7WS.js → chunk-PQVUMJ5J.js} +84 -18
- package/dist/chunks/chunk-PQVUMJ5J.js.map +7 -0
- package/dist/chunks/chunk-UD7LFV43.js +28 -0
- package/dist/chunks/chunk-UD7LFV43.js.map +7 -0
- package/dist/chunks/{chunk-CH2QMORW.js → chunk-UFMYN5TA.js} +2 -2
- package/dist/chunks/chunk-V4OW2ULC.js +422 -0
- package/dist/chunks/chunk-V4OW2ULC.js.map +7 -0
- package/dist/chunks/{chunk-6C2DMTQC.js → chunk-VNWQIGQL.js} +552 -145
- package/dist/chunks/chunk-VNWQIGQL.js.map +7 -0
- package/dist/chunks/{chunk-OA5SJT2T.js → chunk-WGMCNCP6.js} +183 -82
- package/dist/chunks/chunk-WGMCNCP6.js.map +7 -0
- package/dist/chunks/{chunk-HAHRJMWY.js → chunk-WWTGWGH7.js} +6 -6
- package/dist/chunks/{chunk-F4HL6KJR.js → chunk-X7QETPBC.js} +7 -7
- package/dist/chunks/{chunk-SSRSCT2M.js → chunk-XFOSUGLU.js} +4 -4
- package/dist/chunks/{chunk-4VGB6HMU.js → chunk-ZFWICFNJ.js} +23 -18
- package/dist/chunks/{chunk-4VGB6HMU.js.map → chunk-ZFWICFNJ.js.map} +2 -2
- package/dist/commands/fabric-handler.d.ts.map +1 -1
- package/dist/commands/fabric-handler.js +43 -7
- package/dist/commands/fabric-handler.js.map +2 -2
- package/dist/compaction/claim-events.js +2 -2
- package/dist/components/configuration.js +3 -3
- package/dist/config.d.ts +9 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/core/action-registry.js +4 -4
- package/dist/core/model-aliases.d.ts +22 -0
- package/dist/core/model-aliases.d.ts.map +1 -0
- package/dist/core/model-resolution.d.ts +41 -20
- package/dist/core/model-resolution.d.ts.map +1 -1
- package/dist/core/prompt-guidance.js +9 -4
- package/dist/core/prompt-guidance.js.map +2 -2
- package/dist/core/system-guidance.d.ts.map +1 -1
- package/dist/decisions/command.d.ts +2 -1
- package/dist/decisions/command.d.ts.map +1 -1
- package/dist/decisions/command.js +31 -11
- package/dist/decisions/command.js.map +2 -2
- package/dist/decisions/events.js +2 -1
- package/dist/decisions/events.js.map +1 -1
- package/dist/decisions/host.d.ts +8 -0
- package/dist/decisions/host.d.ts.map +1 -1
- package/dist/decisions/render.d.ts +44 -0
- package/dist/decisions/render.d.ts.map +1 -0
- package/dist/durable/agent.d.ts +6 -0
- package/dist/durable/agent.d.ts.map +1 -1
- package/dist/durable/worker-host.d.ts.map +1 -1
- package/dist/durable/worker-host.js +7 -1283
- package/dist/durable/worker-host.js.map +4 -4
- package/dist/durable/worker-options.d.ts +2 -0
- package/dist/durable/worker-options.d.ts.map +1 -1
- package/dist/durable/worker-role-seed.d.ts +82 -0
- package/dist/durable/worker-role-seed.d.ts.map +1 -0
- package/dist/durable/worker.js +10 -1
- package/dist/durable/worker.js.map +2 -2
- package/dist/durable-extension.d.ts +1 -1
- package/dist/durable-extension.js +1 -1
- package/dist/durable-extension.js.map +1 -1
- package/dist/durable-host.d.ts +8 -0
- package/dist/durable-host.d.ts.map +1 -0
- package/dist/durable-host.js +20 -0
- package/dist/durable-host.js.map +7 -0
- package/dist/entropy/index.js +1 -1
- package/dist/execution-service.d.ts.map +1 -1
- package/dist/extension-bootstrap.d.ts.map +1 -1
- package/dist/extension-bootstrap.js +16 -16
- package/dist/extension.d.ts.map +1 -1
- package/dist/fabric-exec-tool.d.ts.map +1 -1
- package/dist/fabric-runtime-state.d.ts +2 -0
- package/dist/fabric-runtime-state.d.ts.map +1 -1
- package/dist/fabric-runtime-state.js +203 -124
- package/dist/fabric-runtime-state.js.map +2 -2
- package/dist/fabric-state.d.ts +26 -1
- package/dist/fabric-state.d.ts.map +1 -1
- package/dist/index.js +20 -16
- package/dist/index.js.map +1 -1
- package/dist/jev/client.js +2 -2
- package/dist/jev/observation.js +3 -3
- package/dist/jev.js +7 -7
- package/dist/protocol.d.ts +84 -0
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js +5 -1
- package/dist/providers/agents-actions.d.ts.map +1 -1
- package/dist/providers/agents-provider.d.ts +3 -0
- package/dist/providers/agents-provider.d.ts.map +1 -1
- package/dist/providers/jev-provider.js +7 -7
- package/dist/residency/host.d.ts.map +1 -1
- package/dist/residency/host.js +13 -10
- package/dist/residency/pi-entry.js +13 -10
- package/dist/residency/pi-entry.js.map +1 -1
- package/dist/runtime/core-override-guest-types.js +2 -2
- package/dist/runtime/cpython-runtime.js +3 -3
- package/dist/runtime/exec-journal.js +3 -3
- package/dist/runtime/guest-types.d.ts +1 -1
- package/dist/runtime/guest-types.d.ts.map +1 -1
- package/dist/runtime/guest-types.js +1 -1
- package/dist/runtime/monty-runtime.js +6 -6
- package/dist/runtime/node-process-runtime.js +5 -5
- package/dist/runtime/quickjs-runtime.js +3 -3
- package/dist/runtime/typescript-kernel.js +11 -11
- package/dist/storage/retention.d.ts.map +1 -1
- package/dist/type-error-guidance.js +1 -1
- package/dist/ui/conversation-chrome.js +2 -2
- package/dist/ui/conversation.js +10 -10
- package/dist/ui/dashboard.d.ts.map +1 -1
- package/dist/ui/dashboard.js +14 -12
- package/dist/ui/dashboard.js.map +2 -2
- package/dist/ui/settings-sections-presentation.d.ts.map +1 -1
- package/dist/ui/settings.js +12 -9
- package/dist/ui/settings.js.map +2 -2
- package/dist/ui/widget.d.ts.map +1 -1
- package/dist/verified/generated/actor-name.d.ts +4 -0
- package/dist/verified/generated/actor-name.js +17 -0
- package/dist/verified/generated/manifest.json +11 -3
- package/dist/worker/options.d.ts.map +1 -1
- package/dist/worker/options.js +20 -0
- package/dist/worker/options.js.map +2 -2
- package/dist/worker.js +57 -8
- package/dist/worker.js.map +2 -2
- package/docs/actor-name-policy-handoff.md +5 -0
- package/docs/agents.md +64 -5
- package/docs/audit-trace.md +2 -1
- package/docs/components.md +1 -1
- package/docs/configuration.md +7 -4
- package/docs/decisions.md +47 -2
- package/docs/durable-pi.md +162 -2
- package/docs/interface.md +1 -1
- package/docs/providers.md +1 -1
- package/docs/verified-kernels.md +1 -0
- package/package.json +5 -1
- package/proofs/actor-name.ts +27 -0
- package/proofs/index.ts +2 -0
- package/scripts/verified-kernels.ts +1 -1
- package/skillsets/python/fabric-exec/references/agents.md +6 -4
- package/skillsets/typescript/fabric-exec/references/agents.md +6 -3
- package/dist/chunks/chunk-6C2DMTQC.js.map +0 -7
- package/dist/chunks/chunk-JJXUOXI5.js.map +0 -7
- package/dist/chunks/chunk-K3ZWBUUL.js.map +0 -7
- package/dist/chunks/chunk-KJZAOENY.js +0 -212
- package/dist/chunks/chunk-KJZAOENY.js.map +0 -7
- package/dist/chunks/chunk-NF6W327N.js.map +0 -7
- package/dist/chunks/chunk-OA5SJT2T.js.map +0 -7
- package/dist/chunks/chunk-TBB7F7WS.js.map +0 -7
- package/dist/chunks/chunk-WQFG7ZVC.js.map +0 -7
- package/dist/chunks/chunk-ZLNJDTCN.js +0 -226
- package/dist/chunks/chunk-ZLNJDTCN.js.map +0 -7
- /package/dist/chunks/{chunk-6O6UWMBO.js.map → chunk-36XQFTEN.js.map} +0 -0
- /package/dist/chunks/{chunk-EYHTTMSM.js.map → chunk-4PBW54I2.js.map} +0 -0
- /package/dist/chunks/{chunk-WTIF3MIM.js.map → chunk-56NMRVTV.js.map} +0 -0
- /package/dist/chunks/{chunk-KDX3762L.js.map → chunk-DGERP4VL.js.map} +0 -0
- /package/dist/chunks/{chunk-UXIBKMUM.js.map → chunk-KIFOEBYJ.js.map} +0 -0
- /package/dist/chunks/{chunk-D5224P2R.js.map → chunk-LKYLD5SN.js.map} +0 -0
- /package/dist/chunks/{chunk-YTYLKL3Z.js.map → chunk-OJ4HAALD.js.map} +0 -0
- /package/dist/chunks/{chunk-CH2QMORW.js.map → chunk-UFMYN5TA.js.map} +0 -0
- /package/dist/chunks/{chunk-HAHRJMWY.js.map → chunk-WWTGWGH7.js.map} +0 -0
- /package/dist/chunks/{chunk-F4HL6KJR.js.map → chunk-X7QETPBC.js.map} +0 -0
- /package/dist/chunks/{chunk-SSRSCT2M.js.map → chunk-XFOSUGLU.js.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/components/model-guidance.ts", "../../src/protocol.ts"],
|
|
4
|
-
"sourcesContent": ["import { stableJsonHash } from \"../core/stable-hash.js\";\nimport type {\n FabricModelGuidance,\n FabricModelGuidanceInfo,\n FabricModelGuidancePlacement,\n FabricModelGuidanceTarget,\n} from \"./types.js\";\n\nexport const FABRIC_EXECUTION_GUIDANCE_SLOT = \"fabric.execution\";\nexport const MAX_FABRIC_MODEL_GUIDANCE_PER_COMPONENT = 64;\nexport const MAX_FABRIC_MODEL_GUIDANCE_CONTENT_CHARS = 32_000;\nexport const MAX_FABRIC_MODEL_GUIDANCE_TOTAL_CHARS = 64_000;\nexport const MAX_FABRIC_MODEL_GUIDANCE_REGISTRATIONS = 1_024;\nexport const MAX_FABRIC_MODEL_GUIDANCE_SNAPSHOT_CHARS = 1_000_000;\n\nconst MAX_LABEL_CHARS = 128;\nconst MAX_SLOT_CHARS = 128;\nconst MAX_MODEL_PATTERNS = 32;\nconst MAX_MODEL_PATTERN_CHARS = 256;\nconst CONTROL_CHARACTER = /[\\u0000-\\u001f\\u007f]/;\nconst REGEX_CHARACTER = /[\\\\^$+.[\\]{}()|]/;\n\nexport interface NormalizedFabricModelGuidance {\n label: string;\n models: string[];\n content: string;\n targets: FabricModelGuidanceTarget[];\n placement: FabricModelGuidancePlacement;\n slot?: string;\n}\n\nexport interface FabricOwnedModelGuidance extends NormalizedFabricModelGuidance {\n componentId: string;\n component: string;\n revision: number;\n}\n\nconst compareStableText = (left: string, right: string): number =>\n left < right ? -1 : left > right ? 1 : 0;\n\nexport const compareFabricOwnedModelGuidance = (\n left: FabricOwnedModelGuidance,\n right: FabricOwnedModelGuidance,\n): number =>\n compareStableText(left.componentId, right.componentId) ||\n compareStableText(left.label, right.label);\n\nexport interface FabricGuidanceDefaultSlot {\n slot: string;\n content: string;\n}\n\nexport interface FabricResolvedModelGuidance {\n slotText: string;\n appendText: string;\n digest: string;\n sources: Array<{\n componentId: string;\n component: string;\n label: string;\n placement: FabricModelGuidancePlacement;\n slot?: string;\n contentHash: string;\n }>;\n}\n\nconst guidanceError = (message: string): Error =>\n new Error(`Invalid Fabric model guidance: ${message}`);\n\nconst normalizedIdentifier = (value: unknown, field: \"label\" | \"slot\", max: number): string => {\n if (typeof value !== \"string\") throw guidanceError(`${field} must be a string`);\n const normalized = value.trim();\n if (!normalized) throw guidanceError(`${field} must not be empty`);\n if (normalized.length > max) throw guidanceError(`${field} exceeds ${max} characters`);\n if (CONTROL_CHARACTER.test(normalized)) {\n throw guidanceError(`${field} must not contain control characters`);\n }\n return normalized;\n};\n\nconst normalizeTargets = (\n targets: readonly FabricModelGuidanceTarget[] | undefined,\n): FabricModelGuidanceTarget[] => {\n if (targets === undefined) return [\"main\", \"participant\"];\n if (!Array.isArray(targets) || targets.length === 0) {\n throw guidanceError(\"targets must contain main and/or participant\");\n }\n const normalized: FabricModelGuidanceTarget[] = [];\n for (const target of targets) {\n if (target !== \"main\" && target !== \"participant\") {\n throw guidanceError(`unsupported target ${String(target)}`);\n }\n if (!normalized.includes(target)) normalized.push(target);\n }\n return normalized;\n};\n\nexport const normalizeFabricModelGuidance = (\n guidance: FabricModelGuidance,\n): NormalizedFabricModelGuidance => {\n if (!guidance || typeof guidance !== \"object\" || Array.isArray(guidance)) {\n throw guidanceError(\"registration must be an object\");\n }\n const label = normalizedIdentifier(guidance.label, \"label\", MAX_LABEL_CHARS);\n if (!Array.isArray(guidance.models) || guidance.models.length === 0) {\n throw guidanceError(`${label} must select at least one provider/model pattern`);\n }\n if (guidance.models.length > MAX_MODEL_PATTERNS) {\n throw guidanceError(`${label} selects more than ${MAX_MODEL_PATTERNS} model patterns`);\n }\n const models: string[] = [];\n for (const candidate of guidance.models) {\n if (typeof candidate !== \"string\") {\n throw guidanceError(`${label} model patterns must be strings`);\n }\n const pattern = candidate.trim();\n if (!pattern || pattern.length > MAX_MODEL_PATTERN_CHARS || !pattern.includes(\"/\")) {\n throw guidanceError(\n `${label} model pattern ${JSON.stringify(candidate)} must be a provider/model glob of at most ${MAX_MODEL_PATTERN_CHARS} characters`,\n );\n }\n if (CONTROL_CHARACTER.test(pattern)) {\n throw guidanceError(`${label} model patterns must not contain control characters`);\n }\n if (!models.includes(pattern)) models.push(pattern);\n }\n if (typeof guidance.content !== \"string\" || !guidance.content.trim()) {\n throw guidanceError(`${label} content must be a non-empty string`);\n }\n const content = guidance.content.trim();\n if (content.length > MAX_FABRIC_MODEL_GUIDANCE_CONTENT_CHARS) {\n throw guidanceError(\n `${label} content exceeds ${MAX_FABRIC_MODEL_GUIDANCE_CONTENT_CHARS} characters`,\n );\n }\n const placement = guidance.placement ?? \"append\";\n if (placement !== \"append\" && placement !== \"replace\") {\n throw guidanceError(`${label} placement must be append or replace`);\n }\n const slot = guidance.slot === undefined\n ? undefined\n : normalizedIdentifier(guidance.slot, \"slot\", MAX_SLOT_CHARS);\n if (placement === \"replace\" && !slot) {\n throw guidanceError(`${label} replacement guidance requires a slot`);\n }\n if (placement === \"append\" && slot) {\n throw guidanceError(`${label} append guidance must not declare a slot`);\n }\n return {\n label,\n models,\n content,\n targets: normalizeTargets(guidance.targets),\n placement,\n ...(slot ? { slot } : {}),\n };\n};\n\nexport const parseFabricOwnedModelGuidance = (value: unknown): FabricOwnedModelGuidance[] => {\n if (!Array.isArray(value) || value.length > MAX_FABRIC_MODEL_GUIDANCE_REGISTRATIONS) return [];\n try {\n const parsed = value.map((candidate) => {\n if (!candidate || typeof candidate !== \"object\" || Array.isArray(candidate)) {\n throw guidanceError(\"serialized owner must be an object\");\n }\n const record = candidate as Partial<FabricOwnedModelGuidance>;\n const normalized = normalizeFabricModelGuidance(record as FabricModelGuidance);\n if (\n typeof record.componentId !== \"string\" ||\n !record.componentId.trim() ||\n typeof record.component !== \"string\" ||\n !record.component.trim() ||\n !Number.isSafeInteger(record.revision) ||\n (record.revision ?? 0) < 1\n ) {\n throw guidanceError(\"serialized owner metadata is incomplete\");\n }\n return {\n ...normalized,\n componentId: record.componentId.trim(),\n component: record.component.trim(),\n revision: record.revision!,\n };\n });\n if (parsed.reduce((sum, entry) => sum + entry.content.length, 0) >\n MAX_FABRIC_MODEL_GUIDANCE_SNAPSHOT_CHARS) return [];\n return parsed;\n } catch {\n return [];\n }\n};\n\nexport const fabricModelGuidanceInfo = (\n guidance: NormalizedFabricModelGuidance,\n): FabricModelGuidanceInfo => ({\n label: guidance.label,\n models: [...guidance.models],\n targets: [...guidance.targets],\n placement: guidance.placement,\n ...(guidance.slot ? { slot: guidance.slot } : {}),\n contentChars: guidance.content.length,\n contentHash: stableJsonHash(guidance.content),\n});\n\nconst wildcardMatch = (pattern: string, value: string): boolean => {\n let expression = \"^\";\n for (const character of pattern) {\n if (character === \"*\") expression += \".*\";\n else if (character === \"?\") expression += \".\";\n else expression += REGEX_CHARACTER.test(character) ? `\\\\${character}` : character;\n }\n return new RegExp(`${expression}$`, \"u\").test(value);\n};\n\nconst fabricModelGuidanceMatches = (\n guidance: NormalizedFabricModelGuidance,\n model: string,\n target: FabricModelGuidanceTarget,\n): boolean =>\n guidance.targets.includes(target) && guidance.models.some((pattern) => wildcardMatch(pattern, model));\n\nconst sourceInfo = (guidance: FabricOwnedModelGuidance) => ({\n componentId: guidance.componentId,\n component: guidance.component,\n label: guidance.label,\n placement: guidance.placement,\n ...(guidance.slot ? { slot: guidance.slot } : {}),\n contentHash: stableJsonHash(guidance.content),\n});\n\nexport const resolveFabricModelGuidance = (\n guidance: readonly FabricOwnedModelGuidance[],\n options: {\n model?: string;\n target: FabricModelGuidanceTarget;\n defaults?: readonly FabricGuidanceDefaultSlot[];\n includeSlots?: boolean;\n },\n): FabricResolvedModelGuidance => {\n const includeSlots = options.includeSlots !== false;\n const matching = options.model\n ? guidance.filter((entry) => fabricModelGuidanceMatches(entry, options.model!, options.target))\n : [];\n const replacements = new Map<string, FabricOwnedModelGuidance[]>();\n const additions: FabricOwnedModelGuidance[] = [];\n for (const entry of matching) {\n if (entry.placement === \"append\") {\n additions.push(entry);\n continue;\n }\n if (!includeSlots || !entry.slot) continue;\n const existing = replacements.get(entry.slot) ?? [];\n existing.push(entry);\n replacements.set(entry.slot, existing);\n }\n\n const defaultSlots = options.defaults ?? [];\n const slotOrder = [\n ...defaultSlots.map((entry) => entry.slot),\n ...[...replacements.keys()]\n .filter((slot) => !defaultSlots.some((entry) => entry.slot === slot))\n .sort(compareStableText),\n ];\n const slotSections: string[] = [];\n const sources: FabricResolvedModelGuidance[\"sources\"] = [];\n if (includeSlots) {\n for (const slot of slotOrder) {\n const candidates = replacements.get(slot) ?? [];\n if (candidates.length > 1) {\n const owners = candidates\n .map((entry) => `${entry.componentId}:${entry.label}`)\n .sort(compareStableText)\n .join(\", \");\n throw new Error(\n `Fabric guidance slot ${slot} has multiple replacements for ${options.model ?? \"the current model\"}: ${owners}`,\n );\n }\n const replacement = candidates[0];\n if (replacement) {\n slotSections.push(replacement.content);\n sources.push(sourceInfo(replacement));\n continue;\n }\n const fallback = defaultSlots.find((entry) => entry.slot === slot)?.content.trim();\n if (fallback) slotSections.push(fallback);\n }\n }\n\n additions.sort(compareFabricOwnedModelGuidance);\n for (const addition of additions) sources.push(sourceInfo(addition));\n const appendSections = additions.map((entry) => entry.content);\n const slotText = slotSections.join(\"\\n\\n\");\n const appendText = appendSections.join(\"\\n\\n\");\n const resolvedChars = slotText.length + appendText.length +\n (slotText && appendText ? 2 : 0);\n if (resolvedChars > MAX_FABRIC_MODEL_GUIDANCE_TOTAL_CHARS) {\n throw new Error(\n `Resolved Fabric model guidance exceeds ${MAX_FABRIC_MODEL_GUIDANCE_TOTAL_CHARS} characters for ${options.model ?? \"the current model\"}`,\n );\n }\n return {\n slotText,\n appendText,\n sources,\n digest: stableJsonHash({\n model: options.model,\n target: options.target,\n slots: slotSections,\n additions: sources,\n }),\n };\n};\n", "import type { FabricActionPolicyHookV1 } from \"./core/action-policy-hooks.js\";\nimport type {\n BashOperations,\n BashToolOptions,\n CompactionResult,\n ExtensionContext,\n SessionBeforeCompactEvent,\n} from \"@earendil-works/pi-coding-agent\";\n\n/** Host-local opt-in on a bash ToolDefinition; never serialized into guest schemas. */\nexport const FABRIC_BASH_MIDDLEWARE = Symbol.for(\"pi-fabric:bash-middleware:v1\");\n\n/** The extension keeps standalone execution; Fabric owns local process/job lifetime. */\nexport interface FabricBashMiddlewareV1 {\n version: 1;\n options?: Omit<BashToolOptions, \"operations\">;\n /** Filter output before Fabric retains it in previews, results, or background logs. */\n wrapOperations: (operations: BashOperations) => BashOperations;\n}\n\nexport type {\n FabricCacheHoldOptions, FabricCacheHoldResult, FabricCacheLease,\n FabricCacheSample, FabricCacheObservation, FabricCacheStatus,\n} from \"./cache/types.js\";\n\n/** Host-local background shell accounting, independent of model-facing notifications. */\nexport const FABRIC_SHELL_TIMING_EVENT = \"pi-fabric:shell:timing:v1\";\n\nexport interface FabricShellTimingV1 {\n version: 1;\n sessionId: string;\n taskId: string;\n tool: \"bash\" | \"powershell\";\n /** started = handoff to background; finished includes runtime teardown. */\n phase: \"started\" | \"finished\";\n /** Synchronous observation time, not a backdated process timestamp. */\n timestamp: number;\n}\n\n/** Host-emitted on each `workflow.item` status transition; observation only. */\nexport const FABRIC_WORKFLOW_ITEM_EVENT = \"pi-fabric:workflow-item:v1\";\n\nexport type FabricWorkflowItemStatusV1 =\n | \"pending\"\n | \"running\"\n | \"completed\"\n | \"failed\"\n | \"blocked\"\n | \"stopped\";\n\nexport interface FabricWorkflowItemEventV1 {\n version: 1;\n /** The outer `fabric_exec` tool call id that owns the item. */\n invocationId: string;\n sessionId?: string;\n /** Caller-supplied stable id, or the deterministic per-invocation `item-<n>`. */\n itemId: string;\n label?: string;\n /** Absent on the item's first status. */\n from?: FabricWorkflowItemStatusV1;\n to: FabricWorkflowItemStatusV1;\n /** Synchronous observation time (epoch ms). */\n at: number;\n /** Caller-supplied plain JSON object carried by the transitioning call. */\n meta?: Record<string, unknown>;\n}\n\n/** Host-local request: run a saved program or caller-supplied code without the model, like `/fabric run`. */\nexport const FABRIC_PROGRAM_RUN_EVENT = \"pi-fabric:program:run:v1\";\n\nexport type FabricProgramRunReplyV1 =\n | { ok: true; program: string; value: unknown; logs: string[] }\n | { ok: false; error: string; program?: string };\n\ninterface FabricProgramRunRequestBaseV1 {\n /** JSON, at most 64 KiB; reaches the program as `input`. */\n input?: unknown;\n signal?: AbortSignal;\n /** Called exactly once. */\n reply: (result: FabricProgramRunReplyV1) => void;\n}\n\n/** Runs a saved program. Exactly one of `ref` or `code` is allowed. */\nexport interface FabricProgramRunByRefRequestV1 extends FabricProgramRunRequestBaseV1 {\n /** name, name@<digest prefix >= 12>, or a full digest. */\n ref: string;\n requirePromoted?: boolean;\n code?: never;\n}\n\n/**\n * Runs TypeScript program text the caller built, without saving it anywhere.\n * Fabric computes the SHA-256 of the code and records it in the trace.\n */\nexport interface FabricProgramRunByCodeRequestV1 extends FabricProgramRunRequestBaseV1 {\n /** Non-empty TypeScript, at most 65 536 characters. */\n code: string;\n ref?: never;\n requirePromoted?: never;\n}\n\nexport type FabricProgramRunRequestV1 = FabricProgramRunByRefRequestV1 | FabricProgramRunByCodeRequestV1;\n\n/** The request fields Fabric reads, once, when a program run event arrives. */\nexport type FabricProgramRunFieldV1 = \"ref\" | \"code\" | \"input\" | \"requirePromoted\" | \"signal\";\n\n/**\n * Everything a program run listener keeps of a request. Read once, at the event\n * boundary and before the listener's first await, so a caller that deletes or\n * replaces a field afterwards cannot change what runs or lose its reply.\n */\nexport interface FabricProgramRunSnapshotV1 {\n readonly ref: unknown;\n readonly code: unknown;\n /** A JSON copy of the caller's `input`, never the caller's object. */\n readonly input: unknown;\n readonly requirePromoted: unknown;\n readonly signal: unknown;\n /**\n * The first field whose getter threw when read; the handler refuses the\n * request by name instead of letting the throw escape.\n */\n readonly unreadable: FabricProgramRunFieldV1 | undefined;\n /** Calls the caller's `reply` at most once, directly, and never throws. */\n readonly respond: (result: FabricProgramRunReplyV1) => void;\n}\n\n// Stands in for input that is not JSON. It is not JSON either, so the run\n// refuses it with the error it always gave.\nconst NOT_JSON_INPUT = Symbol(\"not JSON\");\n\n/**\n * A JSON copy of `input`, so a caller that changes the input's contents after\n * emitting cannot change what runs.\n */\nconst copyProgramRunInput = (input: unknown): unknown => {\n if (input === undefined) return undefined;\n try {\n const text = JSON.stringify(input);\n if (text !== undefined) return JSON.parse(text) as unknown;\n } catch {\n // Not JSON-compatible.\n }\n return NOT_JSON_INPUT;\n};\n\n/**\n * Reads `reply` and each named field once, and never lets a getter's throw out.\n * Returns undefined when `reply` cannot be read, because nobody can be told.\n * Throws when `reply` reads as something other than a function, as the event\n * has always done for a payload without a `reply` function.\n */\nexport const snapshotFabricProgramRunRequestV1 = (value: unknown): FabricProgramRunSnapshotV1 | undefined => {\n const request = value as Record<string, unknown> | null | undefined;\n let reply: unknown;\n try {\n reply = request?.reply;\n } catch {\n return undefined;\n }\n if (typeof reply !== \"function\") throw new Error(\"Invalid Pi Fabric program run request\");\n let unreadable: FabricProgramRunFieldV1 | undefined;\n const read = (field: FabricProgramRunFieldV1): unknown => {\n try {\n return request![field];\n } catch {\n unreadable ??= field;\n return undefined;\n }\n };\n let replied = false;\n const respond = (result: FabricProgramRunReplyV1): void => {\n if (replied) return;\n replied = true;\n try {\n reply(result);\n } catch {\n // A throwing listener must not turn into an unhandled rejection.\n }\n };\n // Read the plain fields before `input`: copying `input` runs its `toJSON`\n // and getters, which must not be able to change what else the request says.\n const ref = read(\"ref\");\n // A request with `ref` is a saved-program run, as it was before `code`\n // existed: it never reads `code`, so a getter on it cannot refuse the run.\n const code = ref === undefined && unreadable === undefined ? read(\"code\") : undefined;\n const requirePromoted = read(\"requirePromoted\");\n const signal = read(\"signal\");\n const input = copyProgramRunInput(read(\"input\"));\n return Object.freeze({\n ref,\n code,\n input,\n requirePromoted,\n signal,\n unreadable,\n respond,\n });\n};\n\nexport const FABRIC_PROVIDER_REGISTER_EVENT = \"pi-fabric:provider:register:v1\";\nexport const FABRIC_PROVIDER_DISCOVER_EVENT = \"pi-fabric:provider:discover:v1\";\nexport const FABRIC_PROVIDER_WITHDRAW_EVENT = \"pi-fabric:provider:withdraw:v1\";\n\n/**\n * Withdraws a directly registered provider. `generation` pins the withdrawal\n * to one binding: a number matches the binding generation, a string matches\n * the provider binding id. A mismatch or unknown name is ignored.\n */\nexport interface FabricProviderWithdrawalV1 {\n name: string;\n generation?: number | string;\n}\n\nexport const readFabricProviderWithdrawalV1 = (\n value: unknown,\n): FabricProviderWithdrawalV1 | undefined => {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) return undefined;\n const record = value as Record<string, unknown>;\n const generation = record.generation;\n if (\n typeof record.name !== \"string\" ||\n record.name.length === 0 ||\n record.name.length > 128 ||\n (generation !== undefined &&\n !(typeof generation === \"number\" && Number.isSafeInteger(generation) && generation > 0) &&\n !(typeof generation === \"string\" && generation.length > 0 && generation.length <= 128))\n ) {\n return undefined;\n }\n return {\n name: record.name,\n ...(generation !== undefined ? { generation: generation as number | string } : {}),\n };\n};\n\nexport const FABRIC_TOOL_PLACEMENT_EVENT = \"pi-fabric:tool-placement:v1\";\nexport const MAX_FABRIC_TOOL_PLACEMENT_QUERY = 1_024;\n\n/**\n * model = declared to the model this turn; program = callable from\n * fabric_exec (pi.* / extensions.*); unavailable otherwise. model wins when\n * both apply.\n */\nexport type FabricToolPlacement = \"model\" | \"program\" | \"unavailable\";\nexport type FabricToolPlacementMode = \"full-code\" | \"enforce\" | \"orchestration\";\n\nexport interface FabricToolPlacementResultV1 {\n version: 1;\n mode: FabricToolPlacementMode;\n tools: Record<string, FabricToolPlacement>;\n /** `model` tools a program can also call (foreground tools); omitted when empty. */\n programCallable?: string[];\n}\n\n/** Host-local synchronous query; omitted `tools` reports every registered tool. */\nexport interface FabricToolPlacementRequestV1 {\n tools?: string[];\n reply: (result: FabricToolPlacementResultV1) => void;\n}\n\nexport const readFabricToolPlacementRequestV1 = (\n value: unknown,\n): FabricToolPlacementRequestV1 | undefined => {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) return undefined;\n const record = value as Record<string, unknown>;\n const tools = record.tools;\n if (\n typeof record.reply !== \"function\" ||\n (tools !== undefined && (\n !Array.isArray(tools) ||\n tools.length > MAX_FABRIC_TOOL_PLACEMENT_QUERY ||\n tools.some((name) => typeof name !== \"string\" || name.length === 0 || name.length > 256)\n ))\n ) {\n return undefined;\n }\n return value as FabricToolPlacementRequestV1;\n};\n/** Asks trace-context listeners for the W3C trace context of a child about to launch. */\nexport const FABRIC_CHILD_TRACE_CONTEXT_EVENT = \"pi-fabric:child-trace-context:v1\";\nexport type {\n FabricChildTraceContextRequestV1,\n FabricTraceContextV1,\n} from \"./agents/trace-context.js\";\n\n/**\n * Host-local compaction ownership. One extension at a time may claim\n * compaction from Fabric: Fabric's compactor, threshold trigger and threshold\n * deferral stand down, and `compact.*` program calls route to the owner.\n * `/tree` branch summaries stay with Fabric unless the claim sets\n * `branchSummary`. Fabric drops the claim on withdrawal, when `signal`\n * aborts, and at its own `session_shutdown` (reload, session switch, quit).\n * Fabric loads its claim code on the first message, so the reply may come\n * after `emit` returns.\n */\nexport const FABRIC_COMPACTION_OWNER_EVENT = \"pi-fabric:compaction-owner:v1\";\n\nexport type FabricCompactionOwnerRequestFieldV1 = \"reason\" | \"instructions\" | \"preserve\" | \"requestedBy\" | \"seed\";\nexport type FabricCompactionOwnerCarryFieldV1 = \"items\" | \"add\" | \"remove\" | \"clear\";\nexport type FabricCompactionOwnerActionNameV1 = \"request\" | \"status\" | \"pressure\" | \"carry\" | \"cancel\";\n\nexport interface FabricCompactionOwnerIdentityV1 {\n /** 1-128 characters, no control characters or surrounding whitespace. */\n name: string;\n /** 1-64 characters, same rules. */\n version: string;\n}\n\n/** Validated `compact.request` arguments; only declared fields ever appear. */\nexport interface FabricCompactionOwnerRequestV1 {\n reason?: string;\n instructions?: string;\n preserve?: string[];\n requestedBy?: string;\n /**\n * Text to send after the owner's compaction commits. Send it as Fabric\n * does: a labelled custom message that starts a turn, not a user message.\n */\n seed?: string;\n}\n\n/** Validated `compact.carry` arguments; an empty object reads the list. */\nexport interface FabricCompactionOwnerCarryUpdateV1 {\n items?: string[];\n add?: string[];\n remove?: string[];\n clear?: boolean;\n}\n\nexport interface FabricCompactionOwnerCarryResultV1 {\n items: string[];\n}\n\n/** The owner's own ladder, reported beside Fabric's pressure band. */\nexport interface FabricCompactionOwnerPressureV1 {\n /** 1-64 characters. */\n stage: string;\n /** At most 16 named finite numbers (names 1-64 characters). */\n thresholds?: Record<string, number>;\n}\n\ntype FabricCompactionOwnerResult<T> = T | Promise<T>;\n\n/** Passed to every owner handler. */\nexport interface FabricCompactionOwnerCallV1 {\n /** The invoking session's extension context, when Fabric has one. */\n context: ExtensionContext | undefined;\n /**\n * Aborts when the calling program is cancelled or the handler runs longer\n * than 30 seconds. Fabric has already failed the program call by then,\n * naming the owner and the action; stop the work.\n */\n signal: AbortSignal;\n}\n\n/**\n * Supported `compact.*` actions. An absent action, or a request/carry field\n * absent from `fields`, fails the program call with an error naming the owner.\n * Every handler receives `{ context, signal }` (`FabricCompactionOwnerCallV1`).\n */\nexport interface FabricCompactionOwnerActionsV1 {\n request?: {\n fields: readonly FabricCompactionOwnerRequestFieldV1[];\n handler: (request: FabricCompactionOwnerRequestV1, call: FabricCompactionOwnerCallV1) => unknown;\n };\n /** Result: JSON, at most 16 KiB; reported as `ownerStatus`. */\n status?: { handler: (call: FabricCompactionOwnerCallV1) => unknown };\n pressure?: {\n handler: (call: FabricCompactionOwnerCallV1) => FabricCompactionOwnerResult<FabricCompactionOwnerPressureV1>;\n };\n carry?: {\n fields: readonly FabricCompactionOwnerCarryFieldV1[];\n handler: (\n update: FabricCompactionOwnerCarryUpdateV1,\n call: FabricCompactionOwnerCallV1,\n ) => FabricCompactionOwnerResult<FabricCompactionOwnerCarryResultV1>;\n };\n cancel?: { handler: (call: FabricCompactionOwnerCallV1) => unknown };\n}\n\nexport type FabricCompactionFallbackResultV1 =\n | { ok: true; compaction: CompactionResult }\n | { ok: false; reason: string };\n\nexport interface FabricCompactionFallbackOptionsV1 {\n /** Carry-forward items to render; omitted renders Fabric's stored list. */\n carry?: readonly string[];\n}\n\n/** Returned to the claimant only; the token is the withdrawal credential. */\nexport interface FabricCompactionOwnerHandleV1 {\n readonly token: string;\n /** False once the claim is withdrawn or cleared. */\n readonly active: boolean;\n /** Releases the claim and restores Fabric's engine; false when no longer held. */\n withdraw(): boolean;\n /**\n * Fabric's deterministic summary (summary compiler plus its enrichers) for\n * the given `session_before_compact` event. Return `{ compaction }` from\n * the owner's own handler when its model summary fails.\n */\n fallback(\n event: SessionBeforeCompactEvent,\n context?: ExtensionContext,\n options?: FabricCompactionFallbackOptionsV1,\n ): FabricCompactionFallbackResultV1;\n}\n\nexport type FabricCompactionOwnerClaimResultV1 =\n | {\n ok: true;\n handle: FabricCompactionOwnerHandleV1;\n /**\n * Fabric's carry-forward items when the claim was made, as a frozen copy.\n * Under the claim `compact.carry` goes to the owner, so this is the list\n * the owner takes over. Absent when Fabric has not started the session\n * yet (the owner's `session_start` ran before Fabric's).\n */\n carry?: readonly string[];\n }\n | { ok: false; error: string; holder?: FabricCompactionOwnerIdentityV1 };\n\nexport interface FabricCompactionOwnerClaimV1 {\n version: 1;\n type: \"claim\";\n owner: FabricCompactionOwnerIdentityV1;\n actions: FabricCompactionOwnerActionsV1;\n /** Also take `/tree` branch summaries. Omitted or false: Fabric keeps them. */\n branchSummary?: boolean;\n /** Aborting releases the claim; bind it to the owner's own lifetime. */\n signal?: AbortSignal;\n /**\n * Called once, possibly after `emit` returns. Wait with a timeout, abort\n * `signal` when giving up, and withdraw a grant that arrives late.\n */\n reply: (result: FabricCompactionOwnerClaimResultV1) => void;\n}\n\nexport type FabricCompactionOwnerWithdrawResultV1 =\n | { ok: true }\n | { ok: false; error: string };\n\nexport interface FabricCompactionOwnerWithdrawV1 {\n version: 1;\n type: \"withdraw\";\n /** The token from the claim handle; any other token is refused. */\n token: string;\n reply?: (result: FabricCompactionOwnerWithdrawResultV1) => void;\n}\n\nexport type FabricCompactionOwnerMessageV1 =\n | FabricCompactionOwnerClaimV1\n | FabricCompactionOwnerWithdrawV1;\nexport const FABRIC_HOST_POLICY_EVENT = \"pi-fabric:host-policy:v1\";\nexport const MAX_FABRIC_HOST_POLICY_NAMES = 256;\n\n/** Every policy field this build enforces. A request naming any other field is refused. */\nexport const FABRIC_HOST_POLICY_FIELDS = [\"owner\", \"reason\", \"deniedTools\", \"deniedProviders\", \"allowedRefs\"] as const;\nexport type FabricHostPolicyField = (typeof FABRIC_HOST_POLICY_FIELDS)[number];\n\n/**\n * The one restriction an embedding host (for example a delegate worker runner)\n * places on this Fabric instance. The host sends it before the instance runs\n * anything; Fabric seals it on the first program or provider call, so it\n * cannot be replaced, widened or added to afterwards.\n *\n * - `deniedTools`: Pi core and captured extension tool names refused through\n * `pi.*` and `extensions.*`.\n * - `deniedProviders`: Fabric providers refused entirely.\n * - `allowedRefs`: exact `provider.action` refs, or `provider.*`, that the\n * host allows outside `pi.*` and `extensions.*`. Those providers do not\n * replay Pi `tool_call` hooks. Without an entry, only Fabric's fixed set of\n * built-in read-only actions is allowed; a provider's own `risk` label never\n * grants anything.\n *\n * Any policy also refuses native executors, which bypass tool hooks.\n */\nexport interface FabricHostPolicyV1 {\n owner: string;\n reason: string;\n deniedTools?: string[];\n deniedProviders?: string[];\n allowedRefs?: string[];\n}\n\n/** `accepted: true` means the policy is in force and will be sealed unchanged. */\nexport type FabricHostPolicyReplyV1 =\n | { version: 1; accepted: true; digest: string; enforced: FabricHostPolicyField[] }\n | { version: 1; accepted: false; reason: string };\n\n/** Host-local synchronous request; Fabric replies before `emit` returns. */\nexport interface FabricHostPolicyRequestV1 {\n policy: FabricHostPolicyV1;\n reply: (reply: FabricHostPolicyReplyV1) => void;\n}\n\nconst HOST_POLICY_FIELD_SET: ReadonlySet<string> = new Set(FABRIC_HOST_POLICY_FIELDS);\nconst HOST_POLICY_REF = /^[a-z][a-z0-9_-]*\\.(?:\\*|[^\\s*]+(?:\\.\\*)?)$/;\n// Same rule as the registry's provider names, so an entry that can never name\n// a provider (\"MCP\", \"mcp \") is refused instead of acknowledged and ignored.\nconst HOST_POLICY_PROVIDER = /^[a-z][a-z0-9_-]*$/;\n// Tool names as model APIs accept them: letters, digits, `_` and `-`.\nconst HOST_POLICY_TOOL = /^[A-Za-z0-9_-]+$/;\n\nconst boundedNames = (value: unknown, pattern?: RegExp): value is string[] =>\n Array.isArray(value) &&\n value.length <= MAX_FABRIC_HOST_POLICY_NAMES &&\n value.every((name) => typeof name === \"string\" && name.length > 0 && name.length <= 256 && (!pattern || pattern.test(name)));\n\nconst boundedLabel = (value: unknown): value is string =>\n typeof value === \"string\" && value.length > 0 && value.length <= 1_024;\n\n/**\n * Copies named fields only. A request without a reply function is ignored.\n * A malformed policy, or one with a field this build does not enforce, is\n * refused whole with a reason and never partially applied.\n */\nexport const readFabricHostPolicyRequestV1 = (\n value: unknown,\n):\n | { ok: true; request: FabricHostPolicyRequestV1 }\n | { ok: false; reason: string; reply: FabricHostPolicyRequestV1[\"reply\"] }\n | undefined => {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) return undefined;\n const record = value as Record<string, unknown>;\n if (typeof record.reply !== \"function\") return undefined;\n const reply = record.reply as FabricHostPolicyRequestV1[\"reply\"];\n const refuse = (reason: string) => ({ ok: false as const, reason, reply });\n const raw = record.policy;\n if (typeof raw !== \"object\" || raw === null || Array.isArray(raw)) return refuse(\"policy must be an object\");\n const policy = raw as Record<string, unknown>;\n const unknown = Object.keys(policy).filter((key) => !HOST_POLICY_FIELD_SET.has(key));\n if (unknown.length > 0) return refuse(`unsupported policy fields: ${unknown.slice(0, 8).join(\", \")}`);\n if (!boundedLabel(policy.owner) || !boundedLabel(policy.reason)) return refuse(\"owner and reason must be non-empty strings of at most 1024 characters\");\n if (policy.deniedTools !== undefined && !boundedNames(policy.deniedTools, HOST_POLICY_TOOL)) return refuse(\"deniedTools must be a list of tool names (letters, digits, _ and -)\");\n if (policy.deniedProviders !== undefined && !boundedNames(policy.deniedProviders, HOST_POLICY_PROVIDER)) return refuse(\"deniedProviders must be a list of provider names (lowercase letters, digits, _ and -, starting with a letter)\");\n if (policy.allowedRefs !== undefined && !boundedNames(policy.allowedRefs, HOST_POLICY_REF)) return refuse(\"allowedRefs must be a list of provider.action or provider.* refs\");\n return {\n ok: true,\n request: {\n policy: {\n owner: policy.owner,\n reason: policy.reason,\n ...(policy.deniedTools ? { deniedTools: [...policy.deniedTools] } : {}),\n ...(policy.deniedProviders ? { deniedProviders: [...policy.deniedProviders] } : {}),\n ...(policy.allowedRefs ? { allowedRefs: [...policy.allowedRefs] } : {}),\n },\n reply,\n },\n };\n};\n\nexport const FABRIC_COMPONENT_REGISTER_EVENT = \"pi-fabric:component:register:v1\";\nexport const FABRIC_COMPONENT_DISCOVER_EVENT = \"pi-fabric:component:discover:v1\";\nexport const FABRIC_PREWALK_REQUEST_EVENT = \"pi-fabric:prewalk:request:v1\";\n\nexport type FabricPrewalkRequestResultV1 =\n | { ok: true }\n | { ok: false; error: string };\n\n/** Host-local request used by queue extensions that need an acknowledged prewalk arm. */\nexport interface FabricPrewalkRequestV1 {\n version: 1;\n context: ExtensionContext;\n claim: () => boolean;\n respond: (result: FabricPrewalkRequestResultV1) => void;\n}\n\nexport const readFabricPrewalkRequestV1 = (\n value: unknown,\n): FabricPrewalkRequestV1 | undefined => {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) return undefined;\n const record = value as Record<string, unknown>;\n if (\n record.version !== 1 ||\n typeof record.context !== \"object\" ||\n record.context === null ||\n typeof record.claim !== \"function\" ||\n typeof record.respond !== \"function\"\n ) {\n return undefined;\n }\n return value as FabricPrewalkRequestV1;\n};\n\nexport const FABRIC_PEER_CARDS_EVENT = \"pi-fabric:peers:cards:v1\";\nexport const FABRIC_PEER_AWAIT_SETTLE_EVENT = \"pi-fabric:peer:await-settle:v1\";\n\n/**\n * Custom session entry a root Fabric session appends once the project mesh\n * mints its peer label, and again only if the label changes. Headless hosts\n * read it with Pi's RPC `get_entries`: unlike the `fabric-label` footer status,\n * it is structured, outlives the event stream, and does not depend on\n * `ui.sessionLabel.footer`.\n */\nexport const FABRIC_PEER_ENTRY_TYPE = \"pi-fabric-peer\";\n\n/**\n * Generation of the project-wide label counter. Raising it restarts numbering\n * at 1 and retires every label an older generation recorded. Generation 3 is\n * the first that takes a number only at a session's first Fabric use.\n */\nexport const FABRIC_PEER_LABEL_SEQUENCE = 3;\n\nexport interface FabricPeerEntryV1 {\n version: 1;\n /** Counter generation that minted the label; a resumed session reuses only the current one. */\n sequence: number;\n /** Participant id other sessions and the mesh use for this session. */\n participantId: string;\n /** Linear-style project label (e.g. \"PQS-2\"). */\n label: string;\n}\n\n/** One root peer session on the project mesh, for pickers and status lines. */\nexport interface FabricPeerCardV1 {\n id: string;\n /** Linear-style project label (e.g. \"PQS-2\") minted by the owning host. */\n label: string;\n status: \"idle\" | \"running\";\n model?: string;\n cwd?: string;\n startedAt: number;\n updatedAt: number;\n pendingMessages: boolean;\n}\n\nexport type FabricPeerCardsResultV1 =\n | { ok: true; cards: FabricPeerCardV1[] }\n | { ok: false; error: string };\n\n/** Host-local request used by queue extensions to enumerate live peer sessions. */\nexport interface FabricPeerCardsRequestV1 {\n version: 1;\n context: ExtensionContext;\n claim: () => boolean;\n respond: (result: FabricPeerCardsResultV1) => void;\n}\n\nexport const readFabricPeerCardsRequestV1 = (\n value: unknown,\n): FabricPeerCardsRequestV1 | undefined => {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) return undefined;\n const record = value as Record<string, unknown>;\n if (\n record.version !== 1 ||\n typeof record.context !== \"object\" ||\n record.context === null ||\n typeof record.claim !== \"function\" ||\n typeof record.respond !== \"function\"\n ) {\n return undefined;\n }\n return value as FabricPeerCardsRequestV1;\n};\n\nexport interface FabricPeerSettleProgressV1 {\n waiting: Array<{ label: string; status: \"idle\" | \"running\" }>;\n}\n\nexport type FabricPeerAwaitSettleResultV1 =\n | { ok: true }\n | { ok: false; error: string };\n\n/**\n * Host-local request used by queue extensions to hold dispatch until peer\n * sessions settle. A peer counts as settled once it has been quiet\n * (status-wide) for settledForMs; peers that vanish from the mesh count as\n * settled since they can no longer conflict. Selector matches a peer label\n * (case-insensitive) or exact participant id; omitted waits on all peers.\n */\nexport interface FabricPeerAwaitSettleRequestV1 {\n version: 1;\n context: ExtensionContext;\n selector?: string;\n settledForMs?: number;\n signal?: AbortSignal;\n update?: (progress: FabricPeerSettleProgressV1) => void;\n claim: () => boolean;\n respond: (result: FabricPeerAwaitSettleResultV1) => void;\n}\n\nexport const readFabricPeerAwaitSettleRequestV1 = (\n value: unknown,\n): FabricPeerAwaitSettleRequestV1 | undefined => {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) return undefined;\n const record = value as Record<string, unknown>;\n const signal = record.signal as AbortSignal | undefined;\n if (\n record.version !== 1 ||\n typeof record.context !== \"object\" ||\n record.context === null ||\n typeof record.claim !== \"function\" ||\n typeof record.respond !== \"function\" ||\n (record.selector !== undefined && typeof record.selector !== \"string\") ||\n (record.settledForMs !== undefined && typeof record.settledForMs !== \"number\") ||\n (signal !== undefined && typeof signal.aborted !== \"boolean\") ||\n (record.update !== undefined && typeof record.update !== \"function\")\n ) {\n return undefined;\n }\n return value as FabricPeerAwaitSettleRequestV1;\n};\n\n/**\n * Host-local registration of an extension action policy hook (issue #312).\n * Fabric consults registered hooks at the fabric_exec approve stage only when\n * `approvals.policyHooks` is true. Registering under an existing `name`\n * replaces that hook. `respond`, when given, receives an `unregister`\n * function that removes only this registration.\n */\nexport const FABRIC_ACTION_POLICY_REGISTER_EVENT = \"pi-fabric:action-policy:register:v1\";\n\nexport interface FabricActionPolicyRegistrationV1 {\n version: 1;\n /** Must match `[A-Za-z0-9@][A-Za-z0-9@._/-]{0,63}`; shown in denial messages. */\n name: string;\n hook: FabricActionPolicyHookV1;\n respond?: (result: { ok: true; unregister: () => void } | { ok: false; error: string }) => void;\n}\n\nexport const readFabricActionPolicyRegistrationV1 = (\n value: unknown,\n): FabricActionPolicyRegistrationV1 | undefined => {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) return undefined;\n const record = value as Record<string, unknown>;\n if (\n record.version !== 1 ||\n typeof record.name !== \"string\" ||\n typeof record.hook !== \"function\" ||\n (record.respond !== undefined && typeof record.respond !== \"function\")\n ) {\n return undefined;\n }\n // Copy named fields: a later change to the caller's object changes nothing here.\n return {\n version: 1,\n name: record.name,\n hook: record.hook as FabricActionPolicyRegistrationV1[\"hook\"],\n ...(record.respond ? { respond: record.respond as NonNullable<FabricActionPolicyRegistrationV1[\"respond\"]> } : {}),\n };\n};\n\nexport const FABRIC_DECISIONS_CAPABILITY_EVENT = \"pi-fabric:decisions:capability:v1\";\nexport const FABRIC_DECISION_REQUEST_EVENT = \"pi-fabric:decisions:request:v1\";\n\nexport type FabricDecisionInputV1 = \"text\" | \"confirm\" | \"select\" | \"editor\";\n\nexport type FabricDecisionsCapabilityResultV1 =\n | {\n ok: true;\n available: true;\n inputs: FabricDecisionInputV1[];\n maxOptions: number;\n maxTitleChars: number;\n maxBodyChars: number;\n maxTextChars: number;\n minTimeoutMs: number;\n maxTimeoutMs: number;\n }\n | { ok: true; available: false; reason: string }\n | { ok: false; error: string };\n\n/**\n * Host-local request: does this session offer user-held durable decisions?\n * An unclaimed request means no compatible Fabric runtime is installed.\n */\nexport interface FabricDecisionsCapabilityRequestV1 {\n version: 1;\n context: ExtensionContext;\n claim: () => boolean;\n respond: (result: FabricDecisionsCapabilityResultV1) => void;\n}\n\n/** One question for a person. Fabric always holds it for `\"user\"` and never applies a default. */\nexport interface FabricDecisionQuestionV1 {\n title: string;\n body?: string;\n /** Defaults to `\"select\"` with options, else `\"text\"`. `\"confirm\"` supplies yes/no. */\n input?: FabricDecisionInputV1;\n options?: Array<{ id: string; label: string }>;\n /** Omit to wait until a person answers or cancels, or the request signal aborts. */\n timeoutMs?: number;\n}\n\nexport interface FabricDecisionAnswerV1 {\n optionId?: string;\n text?: string;\n answeredBy: string;\n via: string;\n at: number;\n}\n\n/** Only `answered` carries an answer; `cancelled` and `expired` never do. */\nexport type FabricDecisionResultV1 =\n | { ok: true; id: string; status: \"answered\"; answer: FabricDecisionAnswerV1 }\n | { ok: true; id: string; status: \"cancelled\" | \"expired\" }\n | { ok: false; error: string; id?: string };\n\n/**\n * Host-local request: raise a user-held question decision and respond once it\n * settles. Aborting `signal` cancels the decision and responds `ok: false`.\n */\nexport interface FabricDecisionRequestV1 {\n version: 1;\n context: ExtensionContext;\n question: FabricDecisionQuestionV1;\n signal?: AbortSignal;\n /**\n * Names the asking extension, for example its package name. Recorded as\n * `raisedBy.participantId: \"extension:<source>\"`. Must match\n * `[A-Za-z0-9@][A-Za-z0-9@._/-]{0,63}`; omit it to record the session.\n */\n source?: string;\n /** Called once the decision is stored, before waiting starts. */\n onRaised?: (id: string) => void;\n claim: () => boolean;\n respond: (result: FabricDecisionResultV1) => void;\n}\n\nexport const readFabricDecisionsCapabilityRequestV1 = (\n value: unknown,\n): FabricDecisionsCapabilityRequestV1 | undefined => {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) return undefined;\n const record = value as Record<string, unknown>;\n if (\n record.version !== 1 ||\n typeof record.context !== \"object\" ||\n record.context === null ||\n typeof record.claim !== \"function\" ||\n typeof record.respond !== \"function\"\n ) {\n return undefined;\n }\n return value as FabricDecisionsCapabilityRequestV1;\n};\n\nexport const readFabricDecisionRequestV1 = (\n value: unknown,\n): FabricDecisionRequestV1 | undefined => {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) return undefined;\n const record = value as Record<string, unknown>;\n const signal = record.signal as AbortSignal | undefined;\n if (\n record.version !== 1 ||\n typeof record.context !== \"object\" ||\n record.context === null ||\n typeof record.question !== \"object\" ||\n record.question === null ||\n Array.isArray(record.question) ||\n typeof record.claim !== \"function\" ||\n typeof record.respond !== \"function\" ||\n (signal !== undefined && (typeof signal !== \"object\" || signal === null || typeof signal.aborted !== \"boolean\")) ||\n (record.source !== undefined && typeof record.source !== \"string\") ||\n (record.onRaised !== undefined && typeof record.onRaised !== \"function\")\n ) {\n return undefined;\n }\n return value as FabricDecisionRequestV1;\n};\n\n/** Identifies host-side tool lifecycle events replayed for a nested Fabric call. */\nexport const FABRIC_NESTED_TOOL_CALL_ID_PREFIX = \"fabric_\";\n\n/** Discriminant for the transient details envelope on a proxied provider result. */\nexport const FABRIC_TOOL_RESULT_PROXY_KIND = \"pi-fabric.tool-result-proxy.v1\";\n\n/**\n * Host-only middleware details for non-Pi Fabric providers. `result` is the\n * exact value before maxNestedResultChars is enforced and is not persisted as\n * a separate Pi tool-result message.\n */\nexport interface FabricToolResultProxyDetailsV1 {\n kind: typeof FABRIC_TOOL_RESULT_PROXY_KIND;\n ref: string;\n result: unknown;\n}\n\nexport const readFabricToolResultProxyDetailsV1 = (\n value: unknown,\n): FabricToolResultProxyDetailsV1 | undefined => {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) return undefined;\n const record = value as Record<string, unknown>;\n if (\n record.kind !== FABRIC_TOOL_RESULT_PROXY_KIND ||\n typeof record.ref !== \"string\" ||\n !Object.prototype.hasOwnProperty.call(record, \"result\")\n ) {\n return undefined;\n }\n return record as unknown as FabricToolResultProxyDetailsV1;\n};\n\nexport type FabricRisk = \"read\" | \"write\" | \"execute\" | \"network\" | \"agent\";\nexport type FabricEffectKind = \"none\" | \"scoped\" | \"transactional\" | \"emission\";\nexport type FabricEffectOrdering = \"commutative\" | \"ordered\" | \"unknown\";\n\nexport interface FabricActionEffect {\n kind: FabricEffectKind;\n resources?: string[];\n ordering?: FabricEffectOrdering;\n}\n\n/** MCP tool annotations (Model Context Protocol ToolAnnotations), cached when a runtime surfaces them. */\nexport interface FabricToolAnnotations {\n readOnlyHint?: boolean;\n idempotentHint?: boolean;\n destructiveHint?: boolean;\n openWorldHint?: boolean;\n}\nexport type FabricActivityEntityKind =\n | \"agent\"\n | \"actor\"\n | \"tool\"\n | \"extension\"\n | \"mcp\"\n | \"mesh\"\n | \"task\"\n | \"custom\";\n\nexport type FabricInvocationActivityUpdate =\n | { type: \"progress\"; message: string }\n | { type: \"entity\"; id: string; kind: FabricActivityEntityKind; name?: string }\n | { type: \"metrics\"; tokens?: number; toolCalls?: number; cost?: number };\n\nexport interface FabricMediaBlock {\n type: \"image\";\n data: string;\n mimeType: string;\n}\n\nexport interface FabricActionDescriptor {\n name: string;\n description: string;\n inputSchema: Record<string, unknown>;\n outputSchema?: Record<string, unknown>;\n risk: FabricRisk;\n namespace?: string;\n effect?: FabricActionEffect;\n annotations?: FabricToolAnnotations;\n}\n\nexport interface FabricCapabilityActionHead {\n key: string;\n parentKey: string;\n ref: string;\n name: string;\n description: string;\n descriptorHash: string;\n risk: FabricRisk;\n namespace?: string;\n effect?: FabricActionEffect;\n}\n\nexport interface FabricCapabilityProviderHead {\n key: string;\n parentKey: string;\n name: string;\n description: string;\n descriptorHash: string;\n actions: FabricCapabilityActionHead[];\n}\n\nexport interface FabricCapabilityBindingView {\n ref: string;\n provider: string;\n providerBindingId: string;\n generation: number;\n descriptorHash: string;\n}\n\n/** Immutable issuer-owned authority, not a serializable bearer grant.\n * Another registry must resolve a fresh view; copies and released views are invalid. */\nexport interface FabricCommittedCapabilityView {\n id: string;\n /** Runtime-local digest including provider binding generations. */\n digest: string;\n /** Portable digest of exact refs and descriptor semantics across runtimes. */\n semanticDigest: string;\n bindings: Record<string, FabricCapabilityBindingView>;\n}\n\nexport interface FabricCapabilityResolution {\n satisfied: boolean;\n missing: string[];\n optionalMissing: string[];\n view?: FabricCommittedCapabilityView;\n}\n\nexport interface FabricCapabilityCatalog {\n kind: \"pi-fabric.capability-catalog\";\n version: 1;\n root: {\n key: \"capability:fabric\";\n name: \"Fabric capabilities\";\n description: string;\n descriptorHash: string;\n };\n providers: FabricCapabilityProviderHead[];\n totalActions: number;\n indexedActions: number;\n complete: boolean;\n reasons: string[];\n}\n\nexport interface FabricProviderListRequest {\n namespace?: string;\n query?: string;\n /** Optional presentation cap. Omitted means enumerate all matching descriptors. */\n limit?: number;\n}\n\n/** One named action whose arguments should be typed in guest declarations. */\nexport interface FabricNamedActionTypeSource {\n name: string;\n inputSchema: Record<string, unknown>;\n}\n\n/** One MCP server plus the tools to type for `mcp.<server>.*` guest calls. */\nexport interface FabricMcpServerTypeSource {\n server: string;\n tools: FabricNamedActionTypeSource[];\n}\n\n/**\n * One registered provider that gets a program global named after it. Its\n * actions' input schemas are its TypeScript declarations; an empty list\n * declares the global loosely (any action, one argument object).\n */\nexport interface FabricProviderTypeSource {\n provider: string;\n actions: FabricNamedActionTypeSource[];\n}\n\nexport type {\n FabricKernel,\n FabricKernelRuntime,\n FabricHostCall,\n FabricSandboxOptions,\n FabricSandboxResult,\n FabricSandboxTerminationReason,\n} from \"./runtime/kernel.js\";\nexport type { FabricPythonRuntime } from \"./config.js\";\n\n/**\n * Live descriptor snapshot the registry hands to the guest declaration\n * builder so dynamic surfaces (mcp, extensions, provider globals) get argument\n * checking before the sandbox runs. Empty/absent sections keep the loose\n * static declarations.\n */\nexport interface FabricGuestTypeSources {\n mcpServers?: FabricMcpServerTypeSource[];\n extensionTools?: FabricNamedActionTypeSource[];\n /**\n * Providers registered outside Fabric whose names can be program globals\n * (see `src/provider-globals.ts`). Each entry is exactly one global the\n * program gets, typed or loose.\n */\n providers?: FabricProviderTypeSource[];\n}\n\n/**\n * Pre-rendered `declare const` blocks replacing the loose mcp/extensions\n * declaration lines. Values are full replacement text (helpers + declare).\n * `providers` replaces nothing: it declares one new global per provider.\n */\nexport interface FabricDynamicGuestDeclarations {\n mcp?: string;\n extensions?: string;\n providers?: string;\n}\n\n/**\n * Provider-owned work (for example a delegated run) registered with Fabric's\n * participant directory under `provider:<provider>:<id>`. Non-detached\n * participants are stopped when their fabric_exec program is cancelled or\n * times out; detached ones survive until stopped, withdrawn, or shut down.\n */\nexport interface FabricParticipantSpec {\n /** Unique per provider while unsettled; `[A-Za-z0-9][A-Za-z0-9._:-]{0,63}`. */\n id: string;\n label: string;\n kind?: string;\n detached?: boolean;\n stop(reason: string): Promise<{ confirmed: boolean }>;\n steer?(message: string): Promise<void>;\n followUp?(message: string): Promise<void>;\n}\n\nexport interface FabricParticipantProgress {\n phase?: string;\n message?: string;\n /** Cumulative totals; each update replaces the previous usage. */\n usage?: { input?: number; output?: number; cacheRead?: number; cacheWrite?: number; cost?: number };\n}\n\nexport interface FabricParticipantSettlement {\n status: \"completed\" | \"failed\" | \"stopped\";\n summary?: string;\n}\n\nexport interface FabricParticipantHandle {\n readonly ref: string;\n update(progress: FabricParticipantProgress): void;\n settle(result: FabricParticipantSettlement): void;\n dispose(): void;\n}\n\nexport interface FabricInvocationParticipants {\n register(spec: FabricParticipantSpec): FabricParticipantHandle;\n}\n\n/** Host-issued principal and grants (`pi-fabric/scope`); trusted host code, not a verified kernel. */\nexport type FabricScopeAction = \"read\" | \"write\" | \"execute\";\nexport interface FabricScopeGrant {\n /** `<ns>:<path>`, `<ns>:<path>/*` (one level), `<ns>:<path>/**` (any depth) or `<ns>:*`. */\n resource: string;\n actions: FabricScopeAction[];\n}\nexport interface FabricScope {\n version: 1;\n principal: { id: string; issuer: \"host\" };\n /** At most 64, merged per resource and sorted. */\n grants: FabricScopeGrant[];\n /** sha256 hex of canonical JSON { grants, parentDigest?, principal }. */\n digest: string;\n parentDigest?: string;\n}\n/**\n * Host-stamped authority of a message's sender (actor mailbox items, mesh\n * events). \"host\" is an unscoped session; \"scope\" carries the sender's scope,\n * with grants when they fit. Absent on records written by older builds.\n */\nexport type FabricMessageSender =\n | { authority: \"host\" }\n | {\n authority: \"scope\";\n principalId: string;\n digest: string;\n grants?: FabricScopeGrant[];\n parentDigest?: string;\n };\n\nexport interface FabricInvocationContext {\n /** Host-selected result projection; never an action argument or an authority grant. */\n nativeToolResult?: boolean;\n cwd: string;\n signal: AbortSignal | undefined;\n parentToolCallId: string;\n nestedToolCallId: string;\n extensionContext: ExtensionContext;\n update(message: string): void;\n activity?(update: FabricInvocationActivityUpdate): void;\n /** Host-supplied inside fabric_exec: register provider-owned work as a participant. */\n participants?: FabricInvocationParticipants;\n /** Host-supplied inside fabric_exec so agents.handoff schedules the outer-call boundary. */\n deferHandoff?(args: Record<string, unknown>): Record<string, unknown>;\n // Out-of-band image content blocks a provider (currently only pi.read of an\n // image file) wants attached to the call audit, so the single-call render can\n // re-attach them to the fabric_exec result content for pi core's kitty image\n // preview. Bypasses the result char bound that would truncate the base64.\n // `note` is the read tool's own text output (e.g. \"Read image file [image/png]\"),\n // captured after any tool_result patch so a handoff that strips pi's\n // non-vision note has run; used as the single-call body + content text so the\n // preview shows the clean note instead of the swapped description.\n attachMedia?(blocks: FabricMediaBlock[], note?: string): void;\n // Providers call this after mutable tool_call middleware has run so live and\n // durable audit surfaces reflect the arguments actually passed to the tool.\n updateArguments?(args: Record<string, unknown>): void;\n // Ephemeral renderer-only metadata. It is exposed to live Fabric previews but\n // never projected into the durable execution trace.\n attachPreview?(preview: unknown): void;\n // Host-supplied inside fabric_exec. A provider calls this when a successful\n // nested tool result sets Pi's `terminate: true`; the outer fabric_exec\n // result then carries `terminate: true` once the program succeeds.\n requestTerminate?(): void;\n capabilityView?: FabricCommittedCapabilityView;\n /** Frozen host-issued scope; set by the registry only, absent when unscoped. */\n scope?: Readonly<FabricScope>;\n /** Advisory for ordinary calls; strict components reject concurrent conflicting effects. */\n effectPolicy?: \"advisory\" | \"strict\";\n}\n\nexport interface FabricScopedProviderResult {\n value: unknown;\n dispose(): void | Promise<void>;\n}\n\nexport interface FabricProvider {\n name: string;\n description: string;\n list(\n request: FabricProviderListRequest,\n context: FabricInvocationContext,\n ): Promise<FabricActionDescriptor[]>;\n describe(\n actionName: string,\n context: FabricInvocationContext,\n ): Promise<FabricActionDescriptor | undefined>;\n prepareArguments?(\n actionName: string,\n args: Record<string, unknown>,\n context: FabricInvocationContext,\n ): Record<string, unknown> | Promise<Record<string, unknown>>;\n invoke(\n actionName: string,\n args: Record<string, unknown>,\n context: FabricInvocationContext,\n ): Promise<unknown>;\n acquire?(\n actionName: string,\n args: Record<string, unknown>,\n context: FabricInvocationContext,\n ): Promise<FabricScopedProviderResult>;\n invocationEnded?(parentToolCallId: string): Promise<void>;\n subscribeCatalog?(listener: () => void): () => void;\n close?(): Promise<void>;\n}\n\nexport interface FabricProviderRegistration {\n version: 1;\n provider: FabricProvider;\n overwrite?: boolean;\n}\n\nexport interface FabricProviderDiscovery {\n version: 1;\n register(provider: FabricProvider, options?: { overwrite?: boolean }): void;\n}\n\nexport type {\n ComponentChangeRequest as FabricComponentChangeRequest,\n ComponentChangePlan as FabricComponentChangePlan,\n} from \"./components/control.js\";\n\nexport type {\n FabricCapabilityRequirement,\n FabricComponentChildOptions,\n FabricComponentContext,\n FabricComponentDefinition,\n FabricComponentDiscovery,\n FabricComponentDisposer,\n FabricComponentEffect,\n FabricComponentEffectConflict,\n FabricComponentEffectInfo,\n FabricComponentEffectOptions,\n FabricComponentEffectRegistration,\n FabricComponentEntry,\n FabricComponentGraph,\n FabricComponentGuarantee,\n FabricComponentHandle,\n FabricComponentInfo,\n FabricComponentProviderLease,\n FabricModelGuidance,\n FabricModelGuidanceInfo,\n FabricModelGuidancePlacement,\n FabricModelGuidanceTarget,\n FabricComponentProvision,\n FabricComponentRegistration,\n FabricComponentState,\n FabricComponentStopOptions,\n} from \"./components/types.js\";\n\nexport {\n FABRIC_EXECUTION_GUIDANCE_SLOT,\n MAX_FABRIC_MODEL_GUIDANCE_CONTENT_CHARS,\n MAX_FABRIC_MODEL_GUIDANCE_PER_COMPONENT,\n MAX_FABRIC_MODEL_GUIDANCE_REGISTRATIONS,\n MAX_FABRIC_MODEL_GUIDANCE_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,SAAO;AACT;AAGO,IAAM,oCAAoC;AAG1C,IAAM,gCAAgC;AAatC,IAAM,qCAAqC,CAChD,UAC+C;AAC/C,MAAI,OAAO,UAAU,YAAY,UAAU,QAAQ,MAAM,QAAQ,KAAK,EAAG,QAAO;AAChF,QAAM,SAAS;AACf,MACE,OAAO,SAAS,iCAChB,OAAO,OAAO,QAAQ,YACtB,CAAC,OAAO,UAAU,eAAe,KAAK,QAAQ,QAAQ,GACtD;AACA,WAAO;AAAA,EACT;AACA,SAAO;AACT;",
|
|
4
|
+
"sourcesContent": ["import { stableJsonHash } from \"../core/stable-hash.js\";\nimport type {\n FabricModelGuidance,\n FabricModelGuidanceInfo,\n FabricModelGuidancePlacement,\n FabricModelGuidanceTarget,\n} from \"./types.js\";\n\nexport const FABRIC_EXECUTION_GUIDANCE_SLOT = \"fabric.execution\";\nexport const MAX_FABRIC_MODEL_GUIDANCE_PER_COMPONENT = 64;\nexport const MAX_FABRIC_MODEL_GUIDANCE_CONTENT_CHARS = 32_000;\nexport const MAX_FABRIC_MODEL_GUIDANCE_TOTAL_CHARS = 64_000;\nexport const MAX_FABRIC_MODEL_GUIDANCE_REGISTRATIONS = 1_024;\nexport const MAX_FABRIC_MODEL_GUIDANCE_SNAPSHOT_CHARS = 1_000_000;\n\nconst MAX_LABEL_CHARS = 128;\nconst MAX_SLOT_CHARS = 128;\nconst MAX_MODEL_PATTERNS = 32;\nconst MAX_MODEL_PATTERN_CHARS = 256;\nconst CONTROL_CHARACTER = /[\\u0000-\\u001f\\u007f]/;\nconst REGEX_CHARACTER = /[\\\\^$+.[\\]{}()|]/;\n\nexport interface NormalizedFabricModelGuidance {\n label: string;\n models: string[];\n content: string;\n targets: FabricModelGuidanceTarget[];\n placement: FabricModelGuidancePlacement;\n slot?: string;\n}\n\nexport interface FabricOwnedModelGuidance extends NormalizedFabricModelGuidance {\n componentId: string;\n component: string;\n revision: number;\n}\n\nconst compareStableText = (left: string, right: string): number =>\n left < right ? -1 : left > right ? 1 : 0;\n\nexport const compareFabricOwnedModelGuidance = (\n left: FabricOwnedModelGuidance,\n right: FabricOwnedModelGuidance,\n): number =>\n compareStableText(left.componentId, right.componentId) ||\n compareStableText(left.label, right.label);\n\nexport interface FabricGuidanceDefaultSlot {\n slot: string;\n content: string;\n}\n\nexport interface FabricResolvedModelGuidance {\n slotText: string;\n appendText: string;\n digest: string;\n sources: Array<{\n componentId: string;\n component: string;\n label: string;\n placement: FabricModelGuidancePlacement;\n slot?: string;\n contentHash: string;\n }>;\n}\n\nconst guidanceError = (message: string): Error =>\n new Error(`Invalid Fabric model guidance: ${message}`);\n\nconst normalizedIdentifier = (value: unknown, field: \"label\" | \"slot\", max: number): string => {\n if (typeof value !== \"string\") throw guidanceError(`${field} must be a string`);\n const normalized = value.trim();\n if (!normalized) throw guidanceError(`${field} must not be empty`);\n if (normalized.length > max) throw guidanceError(`${field} exceeds ${max} characters`);\n if (CONTROL_CHARACTER.test(normalized)) {\n throw guidanceError(`${field} must not contain control characters`);\n }\n return normalized;\n};\n\nconst normalizeTargets = (\n targets: readonly FabricModelGuidanceTarget[] | undefined,\n): FabricModelGuidanceTarget[] => {\n if (targets === undefined) return [\"main\", \"participant\"];\n if (!Array.isArray(targets) || targets.length === 0) {\n throw guidanceError(\"targets must contain main and/or participant\");\n }\n const normalized: FabricModelGuidanceTarget[] = [];\n for (const target of targets) {\n if (target !== \"main\" && target !== \"participant\") {\n throw guidanceError(`unsupported target ${String(target)}`);\n }\n if (!normalized.includes(target)) normalized.push(target);\n }\n return normalized;\n};\n\nexport const normalizeFabricModelGuidance = (\n guidance: FabricModelGuidance,\n): NormalizedFabricModelGuidance => {\n if (!guidance || typeof guidance !== \"object\" || Array.isArray(guidance)) {\n throw guidanceError(\"registration must be an object\");\n }\n const label = normalizedIdentifier(guidance.label, \"label\", MAX_LABEL_CHARS);\n if (!Array.isArray(guidance.models) || guidance.models.length === 0) {\n throw guidanceError(`${label} must select at least one provider/model pattern`);\n }\n if (guidance.models.length > MAX_MODEL_PATTERNS) {\n throw guidanceError(`${label} selects more than ${MAX_MODEL_PATTERNS} model patterns`);\n }\n const models: string[] = [];\n for (const candidate of guidance.models) {\n if (typeof candidate !== \"string\") {\n throw guidanceError(`${label} model patterns must be strings`);\n }\n const pattern = candidate.trim();\n if (!pattern || pattern.length > MAX_MODEL_PATTERN_CHARS || !pattern.includes(\"/\")) {\n throw guidanceError(\n `${label} model pattern ${JSON.stringify(candidate)} must be a provider/model glob of at most ${MAX_MODEL_PATTERN_CHARS} characters`,\n );\n }\n if (CONTROL_CHARACTER.test(pattern)) {\n throw guidanceError(`${label} model patterns must not contain control characters`);\n }\n if (!models.includes(pattern)) models.push(pattern);\n }\n if (typeof guidance.content !== \"string\" || !guidance.content.trim()) {\n throw guidanceError(`${label} content must be a non-empty string`);\n }\n const content = guidance.content.trim();\n if (content.length > MAX_FABRIC_MODEL_GUIDANCE_CONTENT_CHARS) {\n throw guidanceError(\n `${label} content exceeds ${MAX_FABRIC_MODEL_GUIDANCE_CONTENT_CHARS} characters`,\n );\n }\n const placement = guidance.placement ?? \"append\";\n if (placement !== \"append\" && placement !== \"replace\") {\n throw guidanceError(`${label} placement must be append or replace`);\n }\n const slot = guidance.slot === undefined\n ? undefined\n : normalizedIdentifier(guidance.slot, \"slot\", MAX_SLOT_CHARS);\n if (placement === \"replace\" && !slot) {\n throw guidanceError(`${label} replacement guidance requires a slot`);\n }\n if (placement === \"append\" && slot) {\n throw guidanceError(`${label} append guidance must not declare a slot`);\n }\n return {\n label,\n models,\n content,\n targets: normalizeTargets(guidance.targets),\n placement,\n ...(slot ? { slot } : {}),\n };\n};\n\nexport const parseFabricOwnedModelGuidance = (value: unknown): FabricOwnedModelGuidance[] => {\n if (!Array.isArray(value) || value.length > MAX_FABRIC_MODEL_GUIDANCE_REGISTRATIONS) return [];\n try {\n const parsed = value.map((candidate) => {\n if (!candidate || typeof candidate !== \"object\" || Array.isArray(candidate)) {\n throw guidanceError(\"serialized owner must be an object\");\n }\n const record = candidate as Partial<FabricOwnedModelGuidance>;\n const normalized = normalizeFabricModelGuidance(record as FabricModelGuidance);\n if (\n typeof record.componentId !== \"string\" ||\n !record.componentId.trim() ||\n typeof record.component !== \"string\" ||\n !record.component.trim() ||\n !Number.isSafeInteger(record.revision) ||\n (record.revision ?? 0) < 1\n ) {\n throw guidanceError(\"serialized owner metadata is incomplete\");\n }\n return {\n ...normalized,\n componentId: record.componentId.trim(),\n component: record.component.trim(),\n revision: record.revision!,\n };\n });\n if (parsed.reduce((sum, entry) => sum + entry.content.length, 0) >\n MAX_FABRIC_MODEL_GUIDANCE_SNAPSHOT_CHARS) return [];\n return parsed;\n } catch {\n return [];\n }\n};\n\nexport const fabricModelGuidanceInfo = (\n guidance: NormalizedFabricModelGuidance,\n): FabricModelGuidanceInfo => ({\n label: guidance.label,\n models: [...guidance.models],\n targets: [...guidance.targets],\n placement: guidance.placement,\n ...(guidance.slot ? { slot: guidance.slot } : {}),\n contentChars: guidance.content.length,\n contentHash: stableJsonHash(guidance.content),\n});\n\nconst wildcardMatch = (pattern: string, value: string): boolean => {\n let expression = \"^\";\n for (const character of pattern) {\n if (character === \"*\") expression += \".*\";\n else if (character === \"?\") expression += \".\";\n else expression += REGEX_CHARACTER.test(character) ? `\\\\${character}` : character;\n }\n return new RegExp(`${expression}$`, \"u\").test(value);\n};\n\nconst fabricModelGuidanceMatches = (\n guidance: NormalizedFabricModelGuidance,\n model: string,\n target: FabricModelGuidanceTarget,\n): boolean =>\n guidance.targets.includes(target) && guidance.models.some((pattern) => wildcardMatch(pattern, model));\n\nconst sourceInfo = (guidance: FabricOwnedModelGuidance) => ({\n componentId: guidance.componentId,\n component: guidance.component,\n label: guidance.label,\n placement: guidance.placement,\n ...(guidance.slot ? { slot: guidance.slot } : {}),\n contentHash: stableJsonHash(guidance.content),\n});\n\nexport const resolveFabricModelGuidance = (\n guidance: readonly FabricOwnedModelGuidance[],\n options: {\n model?: string;\n target: FabricModelGuidanceTarget;\n defaults?: readonly FabricGuidanceDefaultSlot[];\n includeSlots?: boolean;\n },\n): FabricResolvedModelGuidance => {\n const includeSlots = options.includeSlots !== false;\n const matching = options.model\n ? guidance.filter((entry) => fabricModelGuidanceMatches(entry, options.model!, options.target))\n : [];\n const replacements = new Map<string, FabricOwnedModelGuidance[]>();\n const additions: FabricOwnedModelGuidance[] = [];\n for (const entry of matching) {\n if (entry.placement === \"append\") {\n additions.push(entry);\n continue;\n }\n if (!includeSlots || !entry.slot) continue;\n const existing = replacements.get(entry.slot) ?? [];\n existing.push(entry);\n replacements.set(entry.slot, existing);\n }\n\n const defaultSlots = options.defaults ?? [];\n const slotOrder = [\n ...defaultSlots.map((entry) => entry.slot),\n ...[...replacements.keys()]\n .filter((slot) => !defaultSlots.some((entry) => entry.slot === slot))\n .sort(compareStableText),\n ];\n const slotSections: string[] = [];\n const sources: FabricResolvedModelGuidance[\"sources\"] = [];\n if (includeSlots) {\n for (const slot of slotOrder) {\n const candidates = replacements.get(slot) ?? [];\n if (candidates.length > 1) {\n const owners = candidates\n .map((entry) => `${entry.componentId}:${entry.label}`)\n .sort(compareStableText)\n .join(\", \");\n throw new Error(\n `Fabric guidance slot ${slot} has multiple replacements for ${options.model ?? \"the current model\"}: ${owners}`,\n );\n }\n const replacement = candidates[0];\n if (replacement) {\n slotSections.push(replacement.content);\n sources.push(sourceInfo(replacement));\n continue;\n }\n const fallback = defaultSlots.find((entry) => entry.slot === slot)?.content.trim();\n if (fallback) slotSections.push(fallback);\n }\n }\n\n additions.sort(compareFabricOwnedModelGuidance);\n for (const addition of additions) sources.push(sourceInfo(addition));\n const appendSections = additions.map((entry) => entry.content);\n const slotText = slotSections.join(\"\\n\\n\");\n const appendText = appendSections.join(\"\\n\\n\");\n const resolvedChars = slotText.length + appendText.length +\n (slotText && appendText ? 2 : 0);\n if (resolvedChars > MAX_FABRIC_MODEL_GUIDANCE_TOTAL_CHARS) {\n throw new Error(\n `Resolved Fabric model guidance exceeds ${MAX_FABRIC_MODEL_GUIDANCE_TOTAL_CHARS} characters for ${options.model ?? \"the current model\"}`,\n );\n }\n return {\n slotText,\n appendText,\n sources,\n digest: stableJsonHash({\n model: options.model,\n target: options.target,\n slots: slotSections,\n additions: sources,\n }),\n };\n};\n", "import type { FabricActionPolicyHookV1 } from \"./core/action-policy-hooks.js\";\nimport type {\n BashOperations,\n BashToolOptions,\n CompactionResult,\n ExtensionContext,\n SessionBeforeCompactEvent,\n} from \"@earendil-works/pi-coding-agent\";\n\n/** Host-local opt-in on a bash ToolDefinition; never serialized into guest schemas. */\nexport const FABRIC_BASH_MIDDLEWARE = Symbol.for(\"pi-fabric:bash-middleware:v1\");\n\n/** The extension keeps standalone execution; Fabric owns local process/job lifetime. */\nexport interface FabricBashMiddlewareV1 {\n version: 1;\n options?: Omit<BashToolOptions, \"operations\">;\n /** Filter output before Fabric retains it in previews, results, or background logs. */\n wrapOperations: (operations: BashOperations) => BashOperations;\n}\n\nexport type {\n FabricCacheHoldOptions, FabricCacheHoldResult, FabricCacheLease,\n FabricCacheSample, FabricCacheObservation, FabricCacheStatus,\n} from \"./cache/types.js\";\n\n/** Host-local background shell accounting, independent of model-facing notifications. */\nexport const FABRIC_SHELL_TIMING_EVENT = \"pi-fabric:shell:timing:v1\";\n\nexport interface FabricShellTimingV1 {\n version: 1;\n sessionId: string;\n taskId: string;\n tool: \"bash\" | \"powershell\";\n /** started = handoff to background; finished includes runtime teardown. */\n phase: \"started\" | \"finished\";\n /** Synchronous observation time, not a backdated process timestamp. */\n timestamp: number;\n}\n\n/** Host-emitted on each `workflow.item` status transition; observation only. */\nexport const FABRIC_WORKFLOW_ITEM_EVENT = \"pi-fabric:workflow-item:v1\";\n\nexport type FabricWorkflowItemStatusV1 =\n | \"pending\"\n | \"running\"\n | \"completed\"\n | \"failed\"\n | \"blocked\"\n | \"stopped\";\n\nexport interface FabricWorkflowItemEventV1 {\n version: 1;\n /** The outer `fabric_exec` tool call id that owns the item. */\n invocationId: string;\n sessionId?: string;\n /** Caller-supplied stable id, or the deterministic per-invocation `item-<n>`. */\n itemId: string;\n label?: string;\n /** Absent on the item's first status. */\n from?: FabricWorkflowItemStatusV1;\n to: FabricWorkflowItemStatusV1;\n /** Synchronous observation time (epoch ms). */\n at: number;\n /** Caller-supplied plain JSON object carried by the transitioning call. */\n meta?: Record<string, unknown>;\n}\n\n/** Host-local request: run a saved program or caller-supplied code without the model, like `/fabric run`. */\nexport const FABRIC_PROGRAM_RUN_EVENT = \"pi-fabric:program:run:v1\";\n\nexport type FabricProgramRunReplyV1 =\n | { ok: true; program: string; value: unknown; logs: string[] }\n | { ok: false; error: string; program?: string };\n\ninterface FabricProgramRunRequestBaseV1 {\n /** JSON, at most 64 KiB; reaches the program as `input`. */\n input?: unknown;\n signal?: AbortSignal;\n /** Called exactly once. */\n reply: (result: FabricProgramRunReplyV1) => void;\n}\n\n/** Runs a saved program. Exactly one of `ref` or `code` is allowed. */\nexport interface FabricProgramRunByRefRequestV1 extends FabricProgramRunRequestBaseV1 {\n /** name, name@<digest prefix >= 12>, or a full digest. */\n ref: string;\n requirePromoted?: boolean;\n code?: never;\n}\n\n/**\n * Runs TypeScript program text the caller built, without saving it anywhere.\n * Fabric computes the SHA-256 of the code and records it in the trace.\n */\nexport interface FabricProgramRunByCodeRequestV1 extends FabricProgramRunRequestBaseV1 {\n /** Non-empty TypeScript, at most 65 536 characters. */\n code: string;\n ref?: never;\n requirePromoted?: never;\n}\n\nexport type FabricProgramRunRequestV1 = FabricProgramRunByRefRequestV1 | FabricProgramRunByCodeRequestV1;\n\n/** The request fields Fabric reads, once, when a program run event arrives. */\nexport type FabricProgramRunFieldV1 = \"ref\" | \"code\" | \"input\" | \"requirePromoted\" | \"signal\";\n\n/**\n * Everything a program run listener keeps of a request. Read once, at the event\n * boundary and before the listener's first await, so a caller that deletes or\n * replaces a field afterwards cannot change what runs or lose its reply.\n */\nexport interface FabricProgramRunSnapshotV1 {\n readonly ref: unknown;\n readonly code: unknown;\n /** A JSON copy of the caller's `input`, never the caller's object. */\n readonly input: unknown;\n readonly requirePromoted: unknown;\n readonly signal: unknown;\n /**\n * The first field whose getter threw when read; the handler refuses the\n * request by name instead of letting the throw escape.\n */\n readonly unreadable: FabricProgramRunFieldV1 | undefined;\n /** Calls the caller's `reply` at most once, directly, and never throws. */\n readonly respond: (result: FabricProgramRunReplyV1) => void;\n}\n\n// Stands in for input that is not JSON. It is not JSON either, so the run\n// refuses it with the error it always gave.\nconst NOT_JSON_INPUT = Symbol(\"not JSON\");\n\n/**\n * A JSON copy of `input`, so a caller that changes the input's contents after\n * emitting cannot change what runs.\n */\nconst copyProgramRunInput = (input: unknown): unknown => {\n if (input === undefined) return undefined;\n try {\n const text = JSON.stringify(input);\n if (text !== undefined) return JSON.parse(text) as unknown;\n } catch {\n // Not JSON-compatible.\n }\n return NOT_JSON_INPUT;\n};\n\n/**\n * Reads `reply` and each named field once, and never lets a getter's throw out.\n * Returns undefined when `reply` cannot be read, because nobody can be told.\n * Throws when `reply` reads as something other than a function, as the event\n * has always done for a payload without a `reply` function.\n */\nexport const snapshotFabricProgramRunRequestV1 = (value: unknown): FabricProgramRunSnapshotV1 | undefined => {\n const request = value as Record<string, unknown> | null | undefined;\n let reply: unknown;\n try {\n reply = request?.reply;\n } catch {\n return undefined;\n }\n if (typeof reply !== \"function\") throw new Error(\"Invalid Pi Fabric program run request\");\n let unreadable: FabricProgramRunFieldV1 | undefined;\n const read = (field: FabricProgramRunFieldV1): unknown => {\n try {\n return request![field];\n } catch {\n unreadable ??= field;\n return undefined;\n }\n };\n let replied = false;\n const respond = (result: FabricProgramRunReplyV1): void => {\n if (replied) return;\n replied = true;\n try {\n reply(result);\n } catch {\n // A throwing listener must not turn into an unhandled rejection.\n }\n };\n // Read the plain fields before `input`: copying `input` runs its `toJSON`\n // and getters, which must not be able to change what else the request says.\n const ref = read(\"ref\");\n // A request with `ref` is a saved-program run, as it was before `code`\n // existed: it never reads `code`, so a getter on it cannot refuse the run.\n const code = ref === undefined && unreadable === undefined ? read(\"code\") : undefined;\n const requirePromoted = read(\"requirePromoted\");\n const signal = read(\"signal\");\n const input = copyProgramRunInput(read(\"input\"));\n return Object.freeze({\n ref,\n code,\n input,\n requirePromoted,\n signal,\n unreadable,\n respond,\n });\n};\n\nexport const FABRIC_PROVIDER_REGISTER_EVENT = \"pi-fabric:provider:register:v1\";\nexport const FABRIC_PROVIDER_DISCOVER_EVENT = \"pi-fabric:provider:discover:v1\";\nexport const FABRIC_PROVIDER_WITHDRAW_EVENT = \"pi-fabric:provider:withdraw:v1\";\n\n/**\n * Withdraws a directly registered provider. `generation` pins the withdrawal\n * to one binding: a number matches the binding generation, a string matches\n * the provider binding id. A mismatch or unknown name is ignored.\n */\nexport interface FabricProviderWithdrawalV1 {\n name: string;\n generation?: number | string;\n}\n\nexport const readFabricProviderWithdrawalV1 = (\n value: unknown,\n): FabricProviderWithdrawalV1 | undefined => {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) return undefined;\n const record = value as Record<string, unknown>;\n const generation = record.generation;\n if (\n typeof record.name !== \"string\" ||\n record.name.length === 0 ||\n record.name.length > 128 ||\n (generation !== undefined &&\n !(typeof generation === \"number\" && Number.isSafeInteger(generation) && generation > 0) &&\n !(typeof generation === \"string\" && generation.length > 0 && generation.length <= 128))\n ) {\n return undefined;\n }\n return {\n name: record.name,\n ...(generation !== undefined ? { generation: generation as number | string } : {}),\n };\n};\n\nexport const FABRIC_TOOL_PLACEMENT_EVENT = \"pi-fabric:tool-placement:v1\";\nexport const MAX_FABRIC_TOOL_PLACEMENT_QUERY = 1_024;\n\n/**\n * model = declared to the model this turn; program = callable from\n * fabric_exec (pi.* / extensions.*); unavailable otherwise. model wins when\n * both apply.\n */\nexport type FabricToolPlacement = \"model\" | \"program\" | \"unavailable\";\nexport type FabricToolPlacementMode = \"full-code\" | \"enforce\" | \"orchestration\";\n\nexport interface FabricToolPlacementResultV1 {\n version: 1;\n mode: FabricToolPlacementMode;\n tools: Record<string, FabricToolPlacement>;\n /** `model` tools a program can also call (foreground tools); omitted when empty. */\n programCallable?: string[];\n}\n\n/** Host-local synchronous query; omitted `tools` reports every registered tool. */\nexport interface FabricToolPlacementRequestV1 {\n tools?: string[];\n reply: (result: FabricToolPlacementResultV1) => void;\n}\n\nexport const readFabricToolPlacementRequestV1 = (\n value: unknown,\n): FabricToolPlacementRequestV1 | undefined => {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) return undefined;\n const record = value as Record<string, unknown>;\n const tools = record.tools;\n if (\n typeof record.reply !== \"function\" ||\n (tools !== undefined && (\n !Array.isArray(tools) ||\n tools.length > MAX_FABRIC_TOOL_PLACEMENT_QUERY ||\n tools.some((name) => typeof name !== \"string\" || name.length === 0 || name.length > 256)\n ))\n ) {\n return undefined;\n }\n return value as FabricToolPlacementRequestV1;\n};\n/** Asks trace-context listeners for the W3C trace context of a child about to launch. */\nexport const FABRIC_CHILD_TRACE_CONTEXT_EVENT = \"pi-fabric:child-trace-context:v1\";\nexport type {\n FabricChildTraceContextRequestV1,\n FabricTraceContextV1,\n} from \"./agents/trace-context.js\";\n\n/**\n * Host-local compaction ownership. One extension at a time may claim\n * compaction from Fabric: Fabric's compactor, threshold trigger and threshold\n * deferral stand down, and `compact.*` program calls route to the owner.\n * `/tree` branch summaries stay with Fabric unless the claim sets\n * `branchSummary`. Fabric drops the claim on withdrawal, when `signal`\n * aborts, and at its own `session_shutdown` (reload, session switch, quit).\n * Fabric loads its claim code on the first message, so the reply may come\n * after `emit` returns.\n */\nexport const FABRIC_COMPACTION_OWNER_EVENT = \"pi-fabric:compaction-owner:v1\";\n\nexport type FabricCompactionOwnerRequestFieldV1 = \"reason\" | \"instructions\" | \"preserve\" | \"requestedBy\" | \"seed\";\nexport type FabricCompactionOwnerCarryFieldV1 = \"items\" | \"add\" | \"remove\" | \"clear\";\nexport type FabricCompactionOwnerActionNameV1 = \"request\" | \"status\" | \"pressure\" | \"carry\" | \"cancel\";\n\nexport interface FabricCompactionOwnerIdentityV1 {\n /** 1-128 characters, no control characters or surrounding whitespace. */\n name: string;\n /** 1-64 characters, same rules. */\n version: string;\n}\n\n/** Validated `compact.request` arguments; only declared fields ever appear. */\nexport interface FabricCompactionOwnerRequestV1 {\n reason?: string;\n instructions?: string;\n preserve?: string[];\n requestedBy?: string;\n /**\n * Text to send after the owner's compaction commits. Send it as Fabric\n * does: a labelled custom message that starts a turn, not a user message.\n */\n seed?: string;\n}\n\n/** Validated `compact.carry` arguments; an empty object reads the list. */\nexport interface FabricCompactionOwnerCarryUpdateV1 {\n items?: string[];\n add?: string[];\n remove?: string[];\n clear?: boolean;\n}\n\nexport interface FabricCompactionOwnerCarryResultV1 {\n items: string[];\n}\n\n/** The owner's own ladder, reported beside Fabric's pressure band. */\nexport interface FabricCompactionOwnerPressureV1 {\n /** 1-64 characters. */\n stage: string;\n /** At most 16 named finite numbers (names 1-64 characters). */\n thresholds?: Record<string, number>;\n}\n\ntype FabricCompactionOwnerResult<T> = T | Promise<T>;\n\n/** Passed to every owner handler. */\nexport interface FabricCompactionOwnerCallV1 {\n /** The invoking session's extension context, when Fabric has one. */\n context: ExtensionContext | undefined;\n /**\n * Aborts when the calling program is cancelled or the handler runs longer\n * than 30 seconds. Fabric has already failed the program call by then,\n * naming the owner and the action; stop the work.\n */\n signal: AbortSignal;\n}\n\n/**\n * Supported `compact.*` actions. An absent action, or a request/carry field\n * absent from `fields`, fails the program call with an error naming the owner.\n * Every handler receives `{ context, signal }` (`FabricCompactionOwnerCallV1`).\n */\nexport interface FabricCompactionOwnerActionsV1 {\n request?: {\n fields: readonly FabricCompactionOwnerRequestFieldV1[];\n handler: (request: FabricCompactionOwnerRequestV1, call: FabricCompactionOwnerCallV1) => unknown;\n };\n /** Result: JSON, at most 16 KiB; reported as `ownerStatus`. */\n status?: { handler: (call: FabricCompactionOwnerCallV1) => unknown };\n pressure?: {\n handler: (call: FabricCompactionOwnerCallV1) => FabricCompactionOwnerResult<FabricCompactionOwnerPressureV1>;\n };\n carry?: {\n fields: readonly FabricCompactionOwnerCarryFieldV1[];\n handler: (\n update: FabricCompactionOwnerCarryUpdateV1,\n call: FabricCompactionOwnerCallV1,\n ) => FabricCompactionOwnerResult<FabricCompactionOwnerCarryResultV1>;\n };\n cancel?: { handler: (call: FabricCompactionOwnerCallV1) => unknown };\n}\n\nexport type FabricCompactionFallbackResultV1 =\n | { ok: true; compaction: CompactionResult }\n | { ok: false; reason: string };\n\nexport interface FabricCompactionFallbackOptionsV1 {\n /** Carry-forward items to render; omitted renders Fabric's stored list. */\n carry?: readonly string[];\n}\n\n/** Returned to the claimant only; the token is the withdrawal credential. */\nexport interface FabricCompactionOwnerHandleV1 {\n readonly token: string;\n /** False once the claim is withdrawn or cleared. */\n readonly active: boolean;\n /** Releases the claim and restores Fabric's engine; false when no longer held. */\n withdraw(): boolean;\n /**\n * Fabric's deterministic summary (summary compiler plus its enrichers) for\n * the given `session_before_compact` event. Return `{ compaction }` from\n * the owner's own handler when its model summary fails.\n */\n fallback(\n event: SessionBeforeCompactEvent,\n context?: ExtensionContext,\n options?: FabricCompactionFallbackOptionsV1,\n ): FabricCompactionFallbackResultV1;\n}\n\nexport type FabricCompactionOwnerClaimResultV1 =\n | {\n ok: true;\n handle: FabricCompactionOwnerHandleV1;\n /**\n * Fabric's carry-forward items when the claim was made, as a frozen copy.\n * Under the claim `compact.carry` goes to the owner, so this is the list\n * the owner takes over. Absent when Fabric has not started the session\n * yet (the owner's `session_start` ran before Fabric's).\n */\n carry?: readonly string[];\n }\n | { ok: false; error: string; holder?: FabricCompactionOwnerIdentityV1 };\n\nexport interface FabricCompactionOwnerClaimV1 {\n version: 1;\n type: \"claim\";\n owner: FabricCompactionOwnerIdentityV1;\n actions: FabricCompactionOwnerActionsV1;\n /** Also take `/tree` branch summaries. Omitted or false: Fabric keeps them. */\n branchSummary?: boolean;\n /** Aborting releases the claim; bind it to the owner's own lifetime. */\n signal?: AbortSignal;\n /**\n * Called once, possibly after `emit` returns. Wait with a timeout, abort\n * `signal` when giving up, and withdraw a grant that arrives late.\n */\n reply: (result: FabricCompactionOwnerClaimResultV1) => void;\n}\n\nexport type FabricCompactionOwnerWithdrawResultV1 =\n | { ok: true }\n | { ok: false; error: string };\n\nexport interface FabricCompactionOwnerWithdrawV1 {\n version: 1;\n type: \"withdraw\";\n /** The token from the claim handle; any other token is refused. */\n token: string;\n reply?: (result: FabricCompactionOwnerWithdrawResultV1) => void;\n}\n\nexport type FabricCompactionOwnerMessageV1 =\n | FabricCompactionOwnerClaimV1\n | FabricCompactionOwnerWithdrawV1;\nexport const FABRIC_HOST_POLICY_EVENT = \"pi-fabric:host-policy:v1\";\nexport const MAX_FABRIC_HOST_POLICY_NAMES = 256;\n\n/** Every policy field this build enforces. A request naming any other field is refused. */\nexport const FABRIC_HOST_POLICY_FIELDS = [\"owner\", \"reason\", \"deniedTools\", \"deniedProviders\", \"allowedRefs\"] as const;\nexport type FabricHostPolicyField = (typeof FABRIC_HOST_POLICY_FIELDS)[number];\n\n/**\n * The one restriction an embedding host (for example a delegate worker runner)\n * places on this Fabric instance. The host sends it before the instance runs\n * anything; Fabric seals it on the first program or provider call, so it\n * cannot be replaced, widened or added to afterwards.\n *\n * - `deniedTools`: Pi core and captured extension tool names refused through\n * `pi.*` and `extensions.*`.\n * - `deniedProviders`: Fabric providers refused entirely.\n * - `allowedRefs`: exact `provider.action` refs, or `provider.*`, that the\n * host allows outside `pi.*` and `extensions.*`. Those providers do not\n * replay Pi `tool_call` hooks. Without an entry, only Fabric's fixed set of\n * built-in read-only actions is allowed; a provider's own `risk` label never\n * grants anything.\n *\n * Any policy also refuses native executors, which bypass tool hooks.\n */\nexport interface FabricHostPolicyV1 {\n owner: string;\n reason: string;\n deniedTools?: string[];\n deniedProviders?: string[];\n allowedRefs?: string[];\n}\n\n/** `accepted: true` means the policy is in force and will be sealed unchanged. */\nexport type FabricHostPolicyReplyV1 =\n | { version: 1; accepted: true; digest: string; enforced: FabricHostPolicyField[] }\n | { version: 1; accepted: false; reason: string };\n\n/** Host-local synchronous request; Fabric replies before `emit` returns. */\nexport interface FabricHostPolicyRequestV1 {\n policy: FabricHostPolicyV1;\n reply: (reply: FabricHostPolicyReplyV1) => void;\n}\n\nconst HOST_POLICY_FIELD_SET: ReadonlySet<string> = new Set(FABRIC_HOST_POLICY_FIELDS);\nconst HOST_POLICY_REF = /^[a-z][a-z0-9_-]*\\.(?:\\*|[^\\s*]+(?:\\.\\*)?)$/;\n// Same rule as the registry's provider names, so an entry that can never name\n// a provider (\"MCP\", \"mcp \") is refused instead of acknowledged and ignored.\nconst HOST_POLICY_PROVIDER = /^[a-z][a-z0-9_-]*$/;\n// Tool names as model APIs accept them: letters, digits, `_` and `-`.\nconst HOST_POLICY_TOOL = /^[A-Za-z0-9_-]+$/;\n\nconst boundedNames = (value: unknown, pattern?: RegExp): value is string[] =>\n Array.isArray(value) &&\n value.length <= MAX_FABRIC_HOST_POLICY_NAMES &&\n value.every((name) => typeof name === \"string\" && name.length > 0 && name.length <= 256 && (!pattern || pattern.test(name)));\n\nconst boundedLabel = (value: unknown): value is string =>\n typeof value === \"string\" && value.length > 0 && value.length <= 1_024;\n\n/**\n * Copies named fields only. A request without a reply function is ignored.\n * A malformed policy, or one with a field this build does not enforce, is\n * refused whole with a reason and never partially applied.\n */\nexport const readFabricHostPolicyRequestV1 = (\n value: unknown,\n):\n | { ok: true; request: FabricHostPolicyRequestV1 }\n | { ok: false; reason: string; reply: FabricHostPolicyRequestV1[\"reply\"] }\n | undefined => {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) return undefined;\n const record = value as Record<string, unknown>;\n if (typeof record.reply !== \"function\") return undefined;\n const reply = record.reply as FabricHostPolicyRequestV1[\"reply\"];\n const refuse = (reason: string) => ({ ok: false as const, reason, reply });\n const raw = record.policy;\n if (typeof raw !== \"object\" || raw === null || Array.isArray(raw)) return refuse(\"policy must be an object\");\n const policy = raw as Record<string, unknown>;\n const unknown = Object.keys(policy).filter((key) => !HOST_POLICY_FIELD_SET.has(key));\n if (unknown.length > 0) return refuse(`unsupported policy fields: ${unknown.slice(0, 8).join(\", \")}`);\n if (!boundedLabel(policy.owner) || !boundedLabel(policy.reason)) return refuse(\"owner and reason must be non-empty strings of at most 1024 characters\");\n if (policy.deniedTools !== undefined && !boundedNames(policy.deniedTools, HOST_POLICY_TOOL)) return refuse(\"deniedTools must be a list of tool names (letters, digits, _ and -)\");\n if (policy.deniedProviders !== undefined && !boundedNames(policy.deniedProviders, HOST_POLICY_PROVIDER)) return refuse(\"deniedProviders must be a list of provider names (lowercase letters, digits, _ and -, starting with a letter)\");\n if (policy.allowedRefs !== undefined && !boundedNames(policy.allowedRefs, HOST_POLICY_REF)) return refuse(\"allowedRefs must be a list of provider.action or provider.* refs\");\n return {\n ok: true,\n request: {\n policy: {\n owner: policy.owner,\n reason: policy.reason,\n ...(policy.deniedTools ? { deniedTools: [...policy.deniedTools] } : {}),\n ...(policy.deniedProviders ? { deniedProviders: [...policy.deniedProviders] } : {}),\n ...(policy.allowedRefs ? { allowedRefs: [...policy.allowedRefs] } : {}),\n },\n reply,\n },\n };\n};\n\nexport const FABRIC_COMPONENT_REGISTER_EVENT = \"pi-fabric:component:register:v1\";\nexport const FABRIC_COMPONENT_DISCOVER_EVENT = \"pi-fabric:component:discover:v1\";\nexport const FABRIC_PREWALK_REQUEST_EVENT = \"pi-fabric:prewalk:request:v1\";\n\nexport type FabricPrewalkRequestResultV1 =\n | { ok: true }\n | { ok: false; error: string };\n\n/** Host-local request used by queue extensions that need an acknowledged prewalk arm. */\nexport interface FabricPrewalkRequestV1 {\n version: 1;\n context: ExtensionContext;\n claim: () => boolean;\n respond: (result: FabricPrewalkRequestResultV1) => void;\n}\n\nexport const readFabricPrewalkRequestV1 = (\n value: unknown,\n): FabricPrewalkRequestV1 | undefined => {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) return undefined;\n const record = value as Record<string, unknown>;\n if (\n record.version !== 1 ||\n typeof record.context !== \"object\" ||\n record.context === null ||\n typeof record.claim !== \"function\" ||\n typeof record.respond !== \"function\"\n ) {\n return undefined;\n }\n return value as FabricPrewalkRequestV1;\n};\n\nexport const FABRIC_PEER_CARDS_EVENT = \"pi-fabric:peers:cards:v1\";\nexport const FABRIC_PEER_AWAIT_SETTLE_EVENT = \"pi-fabric:peer:await-settle:v1\";\n\n/**\n * Custom session entry a root Fabric session appends once the project mesh\n * mints its peer label, and again only if the label changes. Headless hosts\n * read it with Pi's RPC `get_entries`: unlike the `fabric-label` footer status,\n * it is structured, outlives the event stream, and does not depend on\n * `ui.sessionLabel.footer`.\n */\nexport const FABRIC_PEER_ENTRY_TYPE = \"pi-fabric-peer\";\n\n/**\n * Generation of the project-wide label counter. Raising it restarts numbering\n * at 1 and retires every label an older generation recorded. Generation 3 is\n * the first that takes a number only at a session's first Fabric use.\n */\nexport const FABRIC_PEER_LABEL_SEQUENCE = 3;\n\nexport interface FabricPeerEntryV1 {\n version: 1;\n /** Counter generation that minted the label; a resumed session reuses only the current one. */\n sequence: number;\n /** Participant id other sessions and the mesh use for this session. */\n participantId: string;\n /** Linear-style project label (e.g. \"PQS-2\"). */\n label: string;\n}\n\n/** One root peer session on the project mesh, for pickers and status lines. */\nexport interface FabricPeerCardV1 {\n id: string;\n /** Linear-style project label (e.g. \"PQS-2\") minted by the owning host. */\n label: string;\n status: \"idle\" | \"running\";\n model?: string;\n cwd?: string;\n startedAt: number;\n updatedAt: number;\n pendingMessages: boolean;\n}\n\nexport type FabricPeerCardsResultV1 =\n | { ok: true; cards: FabricPeerCardV1[] }\n | { ok: false; error: string };\n\n/** Host-local request used by queue extensions to enumerate live peer sessions. */\nexport interface FabricPeerCardsRequestV1 {\n version: 1;\n context: ExtensionContext;\n claim: () => boolean;\n respond: (result: FabricPeerCardsResultV1) => void;\n}\n\nexport const readFabricPeerCardsRequestV1 = (\n value: unknown,\n): FabricPeerCardsRequestV1 | undefined => {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) return undefined;\n const record = value as Record<string, unknown>;\n if (\n record.version !== 1 ||\n typeof record.context !== \"object\" ||\n record.context === null ||\n typeof record.claim !== \"function\" ||\n typeof record.respond !== \"function\"\n ) {\n return undefined;\n }\n return value as FabricPeerCardsRequestV1;\n};\n\nexport interface FabricPeerSettleProgressV1 {\n waiting: Array<{ label: string; status: \"idle\" | \"running\" }>;\n}\n\nexport type FabricPeerAwaitSettleResultV1 =\n | { ok: true }\n | { ok: false; error: string };\n\n/**\n * Host-local request used by queue extensions to hold dispatch until peer\n * sessions settle. A peer counts as settled once it has been quiet\n * (status-wide) for settledForMs; peers that vanish from the mesh count as\n * settled since they can no longer conflict. Selector matches a peer label\n * (case-insensitive) or exact participant id; omitted waits on all peers.\n */\nexport interface FabricPeerAwaitSettleRequestV1 {\n version: 1;\n context: ExtensionContext;\n selector?: string;\n settledForMs?: number;\n signal?: AbortSignal;\n update?: (progress: FabricPeerSettleProgressV1) => void;\n claim: () => boolean;\n respond: (result: FabricPeerAwaitSettleResultV1) => void;\n}\n\nexport const readFabricPeerAwaitSettleRequestV1 = (\n value: unknown,\n): FabricPeerAwaitSettleRequestV1 | undefined => {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) return undefined;\n const record = value as Record<string, unknown>;\n const signal = record.signal as AbortSignal | undefined;\n if (\n record.version !== 1 ||\n typeof record.context !== \"object\" ||\n record.context === null ||\n typeof record.claim !== \"function\" ||\n typeof record.respond !== \"function\" ||\n (record.selector !== undefined && typeof record.selector !== \"string\") ||\n (record.settledForMs !== undefined && typeof record.settledForMs !== \"number\") ||\n (signal !== undefined && typeof signal.aborted !== \"boolean\") ||\n (record.update !== undefined && typeof record.update !== \"function\")\n ) {\n return undefined;\n }\n return value as FabricPeerAwaitSettleRequestV1;\n};\n\n/**\n * Host-local registration of an extension action policy hook (issue #312).\n * Fabric consults registered hooks at the fabric_exec approve stage only when\n * `approvals.policyHooks` is true. Registering under an existing `name`\n * replaces that hook. `respond`, when given, receives an `unregister`\n * function that removes only this registration.\n */\nexport const FABRIC_ACTION_POLICY_REGISTER_EVENT = \"pi-fabric:action-policy:register:v1\";\n\nexport interface FabricActionPolicyRegistrationV1 {\n version: 1;\n /** Must match `[A-Za-z0-9@][A-Za-z0-9@._/-]{0,63}`; shown in denial messages. */\n name: string;\n hook: FabricActionPolicyHookV1;\n respond?: (result: { ok: true; unregister: () => void } | { ok: false; error: string }) => void;\n}\n\nexport const readFabricActionPolicyRegistrationV1 = (\n value: unknown,\n): FabricActionPolicyRegistrationV1 | undefined => {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) return undefined;\n const record = value as Record<string, unknown>;\n if (\n record.version !== 1 ||\n typeof record.name !== \"string\" ||\n typeof record.hook !== \"function\" ||\n (record.respond !== undefined && typeof record.respond !== \"function\")\n ) {\n return undefined;\n }\n // Copy named fields: a later change to the caller's object changes nothing here.\n return {\n version: 1,\n name: record.name,\n hook: record.hook as FabricActionPolicyRegistrationV1[\"hook\"],\n ...(record.respond ? { respond: record.respond as NonNullable<FabricActionPolicyRegistrationV1[\"respond\"]> } : {}),\n };\n};\n\nexport const FABRIC_DECISIONS_CAPABILITY_EVENT = \"pi-fabric:decisions:capability:v1\";\nexport const FABRIC_DECISION_REQUEST_EVENT = \"pi-fabric:decisions:request:v1\";\n\nexport type FabricDecisionInputV1 = \"text\" | \"confirm\" | \"select\" | \"editor\";\n\nexport type FabricDecisionsCapabilityResultV1 =\n | {\n ok: true;\n available: true;\n inputs: FabricDecisionInputV1[];\n maxOptions: number;\n maxTitleChars: number;\n maxBodyChars: number;\n maxTextChars: number;\n minTimeoutMs: number;\n maxTimeoutMs: number;\n }\n | { ok: true; available: false; reason: string }\n | { ok: false; error: string };\n\n/**\n * Host-local request: does this session offer user-held durable decisions?\n * An unclaimed request means no compatible Fabric runtime is installed.\n */\nexport interface FabricDecisionsCapabilityRequestV1 {\n version: 1;\n context: ExtensionContext;\n claim: () => boolean;\n respond: (result: FabricDecisionsCapabilityResultV1) => void;\n}\n\n/** One question for a person. Fabric always holds it for `\"user\"` and never applies a default. */\nexport interface FabricDecisionQuestionV1 {\n title: string;\n body?: string;\n /** Defaults to `\"select\"` with options, else `\"text\"`. `\"confirm\"` supplies yes/no. */\n input?: FabricDecisionInputV1;\n options?: Array<{ id: string; label: string }>;\n /** Omit to wait until a person answers or cancels, or the request signal aborts. */\n timeoutMs?: number;\n}\n\nexport interface FabricDecisionAnswerV1 {\n optionId?: string;\n text?: string;\n answeredBy: string;\n via: string;\n at: number;\n}\n\n/** Only `answered` carries an answer; `cancelled` and `expired` never do. */\nexport type FabricDecisionResultV1 =\n | { ok: true; id: string; status: \"answered\"; answer: FabricDecisionAnswerV1 }\n | { ok: true; id: string; status: \"cancelled\" | \"expired\" }\n | { ok: false; error: string; id?: string };\n\n/**\n * Host-local request: raise a user-held question decision and respond once it\n * settles. Aborting `signal` cancels the decision and responds `ok: false`.\n */\nexport interface FabricDecisionRequestV1 {\n version: 1;\n context: ExtensionContext;\n question: FabricDecisionQuestionV1;\n signal?: AbortSignal;\n /**\n * Names the asking extension, for example its package name. Recorded as\n * `raisedBy.participantId: \"extension:<source>\"`. Must match\n * `[A-Za-z0-9@][A-Za-z0-9@._/-]{0,63}`; omit it to record the session.\n */\n source?: string;\n /** Called once the decision is stored, before waiting starts. */\n onRaised?: (id: string) => void;\n claim: () => boolean;\n respond: (result: FabricDecisionResultV1) => void;\n}\n\nexport const readFabricDecisionsCapabilityRequestV1 = (\n value: unknown,\n): FabricDecisionsCapabilityRequestV1 | undefined => {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) return undefined;\n const record = value as Record<string, unknown>;\n if (\n record.version !== 1 ||\n typeof record.context !== \"object\" ||\n record.context === null ||\n typeof record.claim !== \"function\" ||\n typeof record.respond !== \"function\"\n ) {\n return undefined;\n }\n return value as FabricDecisionsCapabilityRequestV1;\n};\n\nexport const readFabricDecisionRequestV1 = (\n value: unknown,\n): FabricDecisionRequestV1 | undefined => {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) return undefined;\n const record = value as Record<string, unknown>;\n const signal = record.signal as AbortSignal | undefined;\n if (\n record.version !== 1 ||\n typeof record.context !== \"object\" ||\n record.context === null ||\n typeof record.question !== \"object\" ||\n record.question === null ||\n Array.isArray(record.question) ||\n typeof record.claim !== \"function\" ||\n typeof record.respond !== \"function\" ||\n (signal !== undefined && (typeof signal !== \"object\" || signal === null || typeof signal.aborted !== \"boolean\")) ||\n (record.source !== undefined && typeof record.source !== \"string\") ||\n (record.onRaised !== undefined && typeof record.onRaised !== \"function\")\n ) {\n return undefined;\n }\n return value as FabricDecisionRequestV1;\n};\n\n/**\n * Host-local registration of a question renderer: an extension that shows\n * Fabric's decisions to the person at this terminal in its own interface.\n * Fabric offers a routed child question, and the decision picked in\n * `/fabric decisions`, to registered renderers only when\n * `ui.questionRenderers` is true. Registering under an existing `name`\n * replaces that renderer in its original position. `respond`, when given,\n * receives an `unregister` function that removes only this registration.\n */\nexport const FABRIC_QUESTION_RENDERER_REGISTER_EVENT = \"pi-fabric:question-renderer:register:v1\";\n\n/** Where Fabric is about to show a decision to the person at this terminal. */\nexport type FabricQuestionRenderSurfaceV1 = \"child-question\" | \"decisions-command\";\n\n/** A copy of the stored decision. Changing it changes nothing in the store. */\nexport interface FabricQuestionDecisionV1 {\n id: string;\n kind: \"approval\" | \"question\" | \"escalation\";\n title: string;\n body?: string;\n input: FabricDecisionInputV1;\n /** Present for `select` and `confirm`; an answer must use one of these ids. */\n options?: Array<{ id: string; label: string }>;\n holder: string;\n raisedBy: { participantId: string; runId?: string; sessionId?: string };\n createdAt: number;\n /** Epoch ms after which the decision expires and `signal` aborts. */\n deadline?: number;\n}\n\nexport interface FabricQuestionRenderInputV1 {\n version: 1;\n surface: FabricQuestionRenderSurfaceV1;\n ui: ExtensionContext[\"ui\"];\n decision: FabricQuestionDecisionV1;\n /**\n * Aborts when the decision is answered, cancelled, or expires elsewhere, or\n * when the asking child run settles. Fabric then uses the stored record.\n */\n signal: AbortSignal;\n}\n\n/**\n * What a renderer reports. `decisionId` must name the decision it was handed.\n * `dismissed` means the person closed the renderer without deciding.\n */\nexport type FabricQuestionRenderResultV1 =\n | { status: \"answered\"; decisionId: string; answer: { optionId?: string; text?: string } }\n | { status: \"cancelled\"; decisionId: string }\n | { status: \"dismissed\"; decisionId: string };\n\n/**\n * Returns `undefined` to decline, so the next renderer or Fabric's own dialog\n * shows the decision. A throw, a rejection, a malformed result, a result for\n * another decision, or an answer the store refuses falls back to Fabric's own\n * dialog. Fabric writes an accepted result to the store itself.\n */\nexport type FabricQuestionRendererV1 = (\n input: FabricQuestionRenderInputV1,\n) => FabricQuestionRenderResultV1 | undefined | Promise<FabricQuestionRenderResultV1 | undefined>;\n\nexport interface FabricQuestionRendererRegistrationV1 {\n version: 1;\n /** Must match `[A-Za-z0-9@][A-Za-z0-9@._/-]{0,63}`. */\n name: string;\n render: FabricQuestionRendererV1;\n respond?: (result: { ok: true; unregister: () => void } | { ok: false; error: string }) => void;\n}\n\nexport const readFabricQuestionRendererRegistrationV1 = (\n value: unknown,\n): FabricQuestionRendererRegistrationV1 | undefined => {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) return undefined;\n const record = value as Record<string, unknown>;\n if (\n record.version !== 1 ||\n typeof record.name !== \"string\" ||\n typeof record.render !== \"function\" ||\n (record.respond !== undefined && typeof record.respond !== \"function\")\n ) {\n return undefined;\n }\n // Copy named fields: a later change to the caller's object changes nothing here.\n return {\n version: 1,\n name: record.name,\n render: record.render as FabricQuestionRendererV1,\n ...(record.respond ? { respond: record.respond as NonNullable<FabricQuestionRendererRegistrationV1[\"respond\"]> } : {}),\n };\n};\n\n/** Identifies host-side tool lifecycle events replayed for a nested Fabric call. */\nexport const FABRIC_NESTED_TOOL_CALL_ID_PREFIX = \"fabric_\";\n\n/** Discriminant for the transient details envelope on a proxied provider result. */\nexport const FABRIC_TOOL_RESULT_PROXY_KIND = \"pi-fabric.tool-result-proxy.v1\";\n\n/**\n * Host-only middleware details for non-Pi Fabric providers. `result` is the\n * exact value before maxNestedResultChars is enforced and is not persisted as\n * a separate Pi tool-result message.\n */\nexport interface FabricToolResultProxyDetailsV1 {\n kind: typeof FABRIC_TOOL_RESULT_PROXY_KIND;\n ref: string;\n result: unknown;\n}\n\nexport const readFabricToolResultProxyDetailsV1 = (\n value: unknown,\n): FabricToolResultProxyDetailsV1 | undefined => {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) return undefined;\n const record = value as Record<string, unknown>;\n if (\n record.kind !== FABRIC_TOOL_RESULT_PROXY_KIND ||\n typeof record.ref !== \"string\" ||\n !Object.prototype.hasOwnProperty.call(record, \"result\")\n ) {\n return undefined;\n }\n return record as unknown as FabricToolResultProxyDetailsV1;\n};\n\nexport type FabricRisk = \"read\" | \"write\" | \"execute\" | \"network\" | \"agent\";\nexport type FabricEffectKind = \"none\" | \"scoped\" | \"transactional\" | \"emission\";\nexport type FabricEffectOrdering = \"commutative\" | \"ordered\" | \"unknown\";\n\nexport interface FabricActionEffect {\n kind: FabricEffectKind;\n resources?: string[];\n ordering?: FabricEffectOrdering;\n}\n\n/** MCP tool annotations (Model Context Protocol ToolAnnotations), cached when a runtime surfaces them. */\nexport interface FabricToolAnnotations {\n readOnlyHint?: boolean;\n idempotentHint?: boolean;\n destructiveHint?: boolean;\n openWorldHint?: boolean;\n}\nexport type FabricActivityEntityKind =\n | \"agent\"\n | \"actor\"\n | \"tool\"\n | \"extension\"\n | \"mcp\"\n | \"mesh\"\n | \"task\"\n | \"custom\";\n\nexport type FabricInvocationActivityUpdate =\n | { type: \"progress\"; message: string }\n | { type: \"entity\"; id: string; kind: FabricActivityEntityKind; name?: string }\n | { type: \"metrics\"; tokens?: number; toolCalls?: number; cost?: number };\n\nexport interface FabricMediaBlock {\n type: \"image\";\n data: string;\n mimeType: string;\n}\n\nexport interface FabricActionDescriptor {\n name: string;\n description: string;\n inputSchema: Record<string, unknown>;\n outputSchema?: Record<string, unknown>;\n risk: FabricRisk;\n namespace?: string;\n effect?: FabricActionEffect;\n annotations?: FabricToolAnnotations;\n}\n\nexport interface FabricCapabilityActionHead {\n key: string;\n parentKey: string;\n ref: string;\n name: string;\n description: string;\n descriptorHash: string;\n risk: FabricRisk;\n namespace?: string;\n effect?: FabricActionEffect;\n}\n\nexport interface FabricCapabilityProviderHead {\n key: string;\n parentKey: string;\n name: string;\n description: string;\n descriptorHash: string;\n actions: FabricCapabilityActionHead[];\n}\n\nexport interface FabricCapabilityBindingView {\n ref: string;\n provider: string;\n providerBindingId: string;\n generation: number;\n descriptorHash: string;\n}\n\n/** Immutable issuer-owned authority, not a serializable bearer grant.\n * Another registry must resolve a fresh view; copies and released views are invalid. */\nexport interface FabricCommittedCapabilityView {\n id: string;\n /** Runtime-local digest including provider binding generations. */\n digest: string;\n /** Portable digest of exact refs and descriptor semantics across runtimes. */\n semanticDigest: string;\n bindings: Record<string, FabricCapabilityBindingView>;\n}\n\nexport interface FabricCapabilityResolution {\n satisfied: boolean;\n missing: string[];\n optionalMissing: string[];\n view?: FabricCommittedCapabilityView;\n}\n\nexport interface FabricCapabilityCatalog {\n kind: \"pi-fabric.capability-catalog\";\n version: 1;\n root: {\n key: \"capability:fabric\";\n name: \"Fabric capabilities\";\n description: string;\n descriptorHash: string;\n };\n providers: FabricCapabilityProviderHead[];\n totalActions: number;\n indexedActions: number;\n complete: boolean;\n reasons: string[];\n}\n\nexport interface FabricProviderListRequest {\n namespace?: string;\n query?: string;\n /** Optional presentation cap. Omitted means enumerate all matching descriptors. */\n limit?: number;\n}\n\n/** One named action whose arguments should be typed in guest declarations. */\nexport interface FabricNamedActionTypeSource {\n name: string;\n inputSchema: Record<string, unknown>;\n}\n\n/** One MCP server plus the tools to type for `mcp.<server>.*` guest calls. */\nexport interface FabricMcpServerTypeSource {\n server: string;\n tools: FabricNamedActionTypeSource[];\n}\n\n/**\n * One registered provider that gets a program global named after it. Its\n * actions' input schemas are its TypeScript declarations; an empty list\n * declares the global loosely (any action, one argument object).\n */\nexport interface FabricProviderTypeSource {\n provider: string;\n actions: FabricNamedActionTypeSource[];\n}\n\nexport type {\n FabricKernel,\n FabricKernelRuntime,\n FabricHostCall,\n FabricSandboxOptions,\n FabricSandboxResult,\n FabricSandboxTerminationReason,\n} from \"./runtime/kernel.js\";\nexport type { FabricPythonRuntime } from \"./config.js\";\n\n/**\n * Live descriptor snapshot the registry hands to the guest declaration\n * builder so dynamic surfaces (mcp, extensions, provider globals) get argument\n * checking before the sandbox runs. Empty/absent sections keep the loose\n * static declarations.\n */\nexport interface FabricGuestTypeSources {\n mcpServers?: FabricMcpServerTypeSource[];\n extensionTools?: FabricNamedActionTypeSource[];\n /**\n * Providers registered outside Fabric whose names can be program globals\n * (see `src/provider-globals.ts`). Each entry is exactly one global the\n * program gets, typed or loose.\n */\n providers?: FabricProviderTypeSource[];\n}\n\n/**\n * Pre-rendered `declare const` blocks replacing the loose mcp/extensions\n * declaration lines. Values are full replacement text (helpers + declare).\n * `providers` replaces nothing: it declares one new global per provider.\n */\nexport interface FabricDynamicGuestDeclarations {\n mcp?: string;\n extensions?: string;\n providers?: string;\n}\n\n/**\n * Provider-owned work (for example a delegated run) registered with Fabric's\n * participant directory under `provider:<provider>:<id>`. Non-detached\n * participants are stopped when their fabric_exec program is cancelled or\n * times out; detached ones survive until stopped, withdrawn, or shut down.\n */\nexport interface FabricParticipantSpec {\n /** Unique per provider while unsettled; `[A-Za-z0-9][A-Za-z0-9._:-]{0,63}`. */\n id: string;\n label: string;\n kind?: string;\n detached?: boolean;\n stop(reason: string): Promise<{ confirmed: boolean }>;\n steer?(message: string): Promise<void>;\n followUp?(message: string): Promise<void>;\n}\n\nexport interface FabricParticipantProgress {\n phase?: string;\n message?: string;\n /** Cumulative totals; each update replaces the previous usage. */\n usage?: { input?: number; output?: number; cacheRead?: number; cacheWrite?: number; cost?: number };\n}\n\nexport interface FabricParticipantSettlement {\n status: \"completed\" | \"failed\" | \"stopped\";\n summary?: string;\n}\n\nexport interface FabricParticipantHandle {\n readonly ref: string;\n update(progress: FabricParticipantProgress): void;\n settle(result: FabricParticipantSettlement): void;\n dispose(): void;\n}\n\nexport interface FabricInvocationParticipants {\n register(spec: FabricParticipantSpec): FabricParticipantHandle;\n}\n\n/** Host-issued principal and grants (`pi-fabric/scope`); trusted host code, not a verified kernel. */\nexport type FabricScopeAction = \"read\" | \"write\" | \"execute\";\nexport interface FabricScopeGrant {\n /** `<ns>:<path>`, `<ns>:<path>/*` (one level), `<ns>:<path>/**` (any depth) or `<ns>:*`. */\n resource: string;\n actions: FabricScopeAction[];\n}\nexport interface FabricScope {\n version: 1;\n principal: { id: string; issuer: \"host\" };\n /** At most 64, merged per resource and sorted. */\n grants: FabricScopeGrant[];\n /** sha256 hex of canonical JSON { grants, parentDigest?, principal }. */\n digest: string;\n parentDigest?: string;\n}\n/**\n * Host-stamped authority of a message's sender (actor mailbox items, mesh\n * events). \"host\" is an unscoped session; \"scope\" carries the sender's scope,\n * with grants when they fit. Absent on records written by older builds.\n */\nexport type FabricMessageSender =\n | { authority: \"host\" }\n | {\n authority: \"scope\";\n principalId: string;\n digest: string;\n grants?: FabricScopeGrant[];\n parentDigest?: string;\n };\n\nexport interface FabricInvocationContext {\n /** Host-selected result projection; never an action argument or an authority grant. */\n nativeToolResult?: boolean;\n cwd: string;\n signal: AbortSignal | undefined;\n parentToolCallId: string;\n nestedToolCallId: string;\n extensionContext: ExtensionContext;\n update(message: string): void;\n activity?(update: FabricInvocationActivityUpdate): void;\n /** Host-supplied inside fabric_exec: register provider-owned work as a participant. */\n participants?: FabricInvocationParticipants;\n /** Host-supplied inside fabric_exec so agents.handoff schedules the outer-call boundary. */\n deferHandoff?(args: Record<string, unknown>): Record<string, unknown>;\n // Out-of-band image content blocks a provider (currently only pi.read of an\n // image file) wants attached to the call audit, so the single-call render can\n // re-attach them to the fabric_exec result content for pi core's kitty image\n // preview. Bypasses the result char bound that would truncate the base64.\n // `note` is the read tool's own text output (e.g. \"Read image file [image/png]\"),\n // captured after any tool_result patch so a handoff that strips pi's\n // non-vision note has run; used as the single-call body + content text so the\n // preview shows the clean note instead of the swapped description.\n attachMedia?(blocks: FabricMediaBlock[], note?: string): void;\n // Providers call this after mutable tool_call middleware has run so live and\n // durable audit surfaces reflect the arguments actually passed to the tool.\n updateArguments?(args: Record<string, unknown>): void;\n // Ephemeral renderer-only metadata. It is exposed to live Fabric previews but\n // never projected into the durable execution trace.\n attachPreview?(preview: unknown): void;\n // Host-supplied inside fabric_exec. A provider calls this when a successful\n // nested tool result sets Pi's `terminate: true`; the outer fabric_exec\n // result then carries `terminate: true` once the program succeeds.\n requestTerminate?(): void;\n capabilityView?: FabricCommittedCapabilityView;\n /** Frozen host-issued scope; set by the registry only, absent when unscoped. */\n scope?: Readonly<FabricScope>;\n /** Advisory for ordinary calls; strict components reject concurrent conflicting effects. */\n effectPolicy?: \"advisory\" | \"strict\";\n}\n\nexport interface FabricScopedProviderResult {\n value: unknown;\n dispose(): void | Promise<void>;\n}\n\nexport interface FabricProvider {\n name: string;\n description: string;\n list(\n request: FabricProviderListRequest,\n context: FabricInvocationContext,\n ): Promise<FabricActionDescriptor[]>;\n describe(\n actionName: string,\n context: FabricInvocationContext,\n ): Promise<FabricActionDescriptor | undefined>;\n prepareArguments?(\n actionName: string,\n args: Record<string, unknown>,\n context: FabricInvocationContext,\n ): Record<string, unknown> | Promise<Record<string, unknown>>;\n invoke(\n actionName: string,\n args: Record<string, unknown>,\n context: FabricInvocationContext,\n ): Promise<unknown>;\n acquire?(\n actionName: string,\n args: Record<string, unknown>,\n context: FabricInvocationContext,\n ): Promise<FabricScopedProviderResult>;\n invocationEnded?(parentToolCallId: string): Promise<void>;\n subscribeCatalog?(listener: () => void): () => void;\n close?(): Promise<void>;\n}\n\nexport interface FabricProviderRegistration {\n version: 1;\n provider: FabricProvider;\n overwrite?: boolean;\n}\n\nexport interface FabricProviderDiscovery {\n version: 1;\n register(provider: FabricProvider, options?: { overwrite?: boolean }): void;\n}\n\nexport type {\n ComponentChangeRequest as FabricComponentChangeRequest,\n ComponentChangePlan as FabricComponentChangePlan,\n} from \"./components/control.js\";\n\nexport type {\n FabricCapabilityRequirement,\n FabricComponentChildOptions,\n FabricComponentContext,\n FabricComponentDefinition,\n FabricComponentDiscovery,\n FabricComponentDisposer,\n FabricComponentEffect,\n FabricComponentEffectConflict,\n FabricComponentEffectInfo,\n FabricComponentEffectOptions,\n FabricComponentEffectRegistration,\n FabricComponentEntry,\n FabricComponentGraph,\n FabricComponentGuarantee,\n FabricComponentHandle,\n FabricComponentInfo,\n FabricComponentProviderLease,\n FabricModelGuidance,\n FabricModelGuidanceInfo,\n FabricModelGuidancePlacement,\n FabricModelGuidanceTarget,\n FabricComponentProvision,\n FabricComponentRegistration,\n FabricComponentState,\n FabricComponentStopOptions,\n} from \"./components/types.js\";\n\nexport {\n FABRIC_EXECUTION_GUIDANCE_SLOT,\n MAX_FABRIC_MODEL_GUIDANCE_CONTENT_CHARS,\n MAX_FABRIC_MODEL_GUIDANCE_PER_COMPONENT,\n MAX_FABRIC_MODEL_GUIDANCE_REGISTRATIONS,\n MAX_FABRIC_MODEL_GUIDANCE_SNAPSHOT_CHARS,\n MAX_FABRIC_MODEL_GUIDANCE_TOTAL_CHARS,\n} from \"./components/model-guidance.js\";\n"],
|
|
5
|
+
"mappings": ";;;;;AAQO,IAAM,iCAAiC;AACvC,IAAM,0CAA0C;AAChD,IAAM,0CAA0C;AAChD,IAAM,wCAAwC;AAC9C,IAAM,0CAA0C;AAChD,IAAM,2CAA2C;AAExD,IAAM,kBAAkB;AACxB,IAAM,iBAAiB;AACvB,IAAM,qBAAqB;AAC3B,IAAM,0BAA0B;AAChC,IAAM,oBAAoB;AAC1B,IAAM,kBAAkB;AAiBxB,IAAM,oBAAoB,CAAC,MAAc,UACvC,OAAO,QAAQ,KAAK,OAAO,QAAQ,IAAI;AAElC,IAAM,kCAAkC,CAC7C,MACA,UAEA,kBAAkB,KAAK,aAAa,MAAM,WAAW,KACrD,kBAAkB,KAAK,OAAO,MAAM,KAAK;AAqB3C,IAAM,gBAAgB,CAAC,YACrB,IAAI,MAAM,kCAAkC,O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AO;AAChF,QAAM,SAAS;AACf,MACE,OAAO,SAAS,iCAChB,OAAO,OAAO,QAAQ,YACtB,CAAC,OAAO,UAAU,eAAe,KAAK,QAAQ,QAAQ,GACtD;AACA,WAAO;AAAA,EACT;AACA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PI_CORE_COMPATIBILITY_ARGUMENT_TYPE_NAMES,
|
|
3
3
|
PI_CORE_NUMERIC_FIELDS
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-7CIES6X2.js";
|
|
5
5
|
import {
|
|
6
6
|
PI_CORE_TOOL_NAMES
|
|
7
7
|
} from "./chunk-YU62DDKK.js";
|
|
@@ -284,4 +284,4 @@ var buildCoreOverrideGuestDeclarations = (sources) => {
|
|
|
284
284
|
export {
|
|
285
285
|
buildCoreOverrideGuestDeclarations
|
|
286
286
|
};
|
|
287
|
-
//# sourceMappingURL=chunk-
|
|
287
|
+
//# sourceMappingURL=chunk-36XQFTEN.js.map
|