@e4779/pi-fabric 0.102.0-fork.16 → 0.105.0-fork.22
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/README.md +44 -13
- package/THIRD_PARTY_NOTICES.md +10 -2
- package/dist/activity/store.d.ts +3 -0
- package/dist/activity/store.d.ts.map +1 -1
- package/dist/activity/workflow-items.d.ts +33 -0
- package/dist/activity/workflow-items.d.ts.map +1 -0
- package/dist/actors/binding-store.d.ts.map +1 -1
- package/dist/actors/manager.d.ts +6 -0
- package/dist/actors/manager.d.ts.map +1 -1
- package/dist/actors/mesh-monitor.d.ts +2 -2
- package/dist/actors/mesh-monitor.d.ts.map +1 -1
- package/dist/actors/registry-store.d.ts.map +1 -1
- package/dist/actors/types.d.ts +11 -0
- package/dist/actors/types.d.ts.map +1 -1
- package/dist/agents/child-env.d.ts +29 -0
- package/dist/agents/child-env.d.ts.map +1 -0
- package/dist/agents/fork-seed.d.ts +21 -0
- package/dist/agents/fork-seed.d.ts.map +1 -0
- package/dist/agents/handoff.d.ts +7 -1
- package/dist/agents/handoff.d.ts.map +1 -1
- package/dist/agents/hosted-run.d.ts +63 -0
- package/dist/agents/hosted-run.d.ts.map +1 -0
- package/dist/agents/manager.d.ts +21 -1
- package/dist/agents/manager.d.ts.map +1 -1
- package/dist/agents/request.d.ts.map +1 -1
- package/dist/agents/runner-notice.d.ts +7 -0
- package/dist/agents/runner-notice.d.ts.map +1 -0
- package/dist/agents/runner-protocol.d.ts +158 -0
- package/dist/agents/runner-protocol.d.ts.map +1 -0
- package/dist/agents/runner-registry.d.ts +223 -0
- package/dist/agents/runner-registry.d.ts.map +1 -0
- package/dist/agents/transports/process-transport.d.ts.map +1 -1
- package/dist/agents/transports/process-utils.d.ts +4 -1
- package/dist/agents/transports/process-utils.d.ts.map +1 -1
- package/dist/agents/types.d.ts +89 -4
- package/dist/agents/types.d.ts.map +1 -1
- package/dist/agents/worktree-manager.d.ts +21 -0
- package/dist/agents/worktree-manager.d.ts.map +1 -1
- package/dist/agents/write-guard.d.ts +16 -0
- package/dist/agents/write-guard.d.ts.map +1 -0
- package/dist/agents/write-guard.js +13 -0
- package/dist/agents/write-guard.js.map +7 -0
- package/dist/agents.js +13 -12
- package/dist/agents.js.map +1 -1
- package/dist/assessment.d.ts +3 -0
- package/dist/assessment.d.ts.map +1 -0
- package/dist/assessment.js +15 -0
- package/dist/assessment.js.map +7 -0
- package/dist/audit/assessment.d.ts +74 -0
- package/dist/audit/assessment.d.ts.map +1 -0
- package/dist/audit/details.d.ts +4 -0
- package/dist/audit/details.d.ts.map +1 -1
- package/dist/audit/index.d.ts +1 -0
- package/dist/audit/index.d.ts.map +1 -1
- package/dist/audit/projection.d.ts +2 -1
- package/dist/audit/projection.d.ts.map +1 -1
- package/dist/audit/trace.d.ts +16 -1
- package/dist/audit/trace.d.ts.map +1 -1
- package/dist/cache/leases.d.ts +2 -1
- package/dist/cache/leases.d.ts.map +1 -1
- package/dist/capture/interceptor.d.ts.map +1 -1
- package/dist/chunks/chunk-2USMWEE6.js +81 -0
- package/dist/chunks/chunk-2USMWEE6.js.map +7 -0
- package/dist/chunks/chunk-2Y24ML7H.js +115 -0
- package/dist/chunks/chunk-2Y24ML7H.js.map +7 -0
- package/dist/chunks/chunk-3GJJG2FV.js +1329 -0
- package/dist/chunks/chunk-3GJJG2FV.js.map +7 -0
- package/dist/chunks/{chunk-5VTBHJN3.js → chunk-3KDUMDPZ.js} +153 -29
- package/dist/chunks/chunk-3KDUMDPZ.js.map +7 -0
- package/dist/chunks/chunk-4RTHQGES.js +189 -0
- package/dist/chunks/chunk-4RTHQGES.js.map +7 -0
- package/dist/chunks/{chunk-ZZ66L3W5.js → chunk-5MNLVHF5.js} +30 -7
- package/dist/chunks/chunk-5MNLVHF5.js.map +7 -0
- package/dist/chunks/{chunk-RAO6TQFP.js → chunk-5XBYFSI5.js} +26 -6
- package/dist/chunks/chunk-5XBYFSI5.js.map +7 -0
- package/dist/chunks/{chunk-J2HV2URQ.js → chunk-7EYJE4TW.js} +1 -1
- package/dist/chunks/{chunk-J2HV2URQ.js.map → chunk-7EYJE4TW.js.map} +2 -2
- package/dist/chunks/{chunk-57CMH4SW.js → chunk-7JU7Z4XQ.js} +2 -2
- package/dist/chunks/chunk-7QKKLBHJ.js +33 -0
- package/dist/chunks/chunk-7QKKLBHJ.js.map +7 -0
- package/dist/chunks/chunk-7XRUMDV7.js +235 -0
- package/dist/chunks/chunk-7XRUMDV7.js.map +7 -0
- package/dist/chunks/{chunk-DUJ46TIP.js → chunk-ABJCSNZO.js} +4 -4
- package/dist/chunks/chunk-B2Y4364O.js +78 -0
- package/dist/chunks/chunk-B2Y4364O.js.map +7 -0
- package/dist/chunks/{chunk-4TKPBEPB.js → chunk-BVJBYFHD.js} +9 -3
- package/dist/chunks/{chunk-4TKPBEPB.js.map → chunk-BVJBYFHD.js.map} +2 -2
- package/dist/chunks/{chunk-KP4ANT6L.js → chunk-C7EEG6SM.js} +2 -2
- package/dist/chunks/{chunk-NHMICIEU.js → chunk-CCHZXF6K.js} +3 -3
- package/dist/chunks/{chunk-W63E3WEO.js → chunk-CXTTLBUV.js} +3 -2
- package/dist/chunks/chunk-CXTTLBUV.js.map +7 -0
- package/dist/chunks/{chunk-HOX6VW45.js → chunk-CYMDX3XP.js} +1 -1
- package/dist/chunks/{chunk-HOX6VW45.js.map → chunk-CYMDX3XP.js.map} +1 -1
- package/dist/chunks/chunk-DK35W6U7.js +259 -0
- package/dist/chunks/chunk-DK35W6U7.js.map +7 -0
- package/dist/chunks/{chunk-5JN5AWNV.js → chunk-DZ4WN5XJ.js} +3 -3
- package/dist/chunks/chunk-EXWS4ZS3.js +6490 -0
- package/dist/chunks/chunk-EXWS4ZS3.js.map +7 -0
- package/dist/chunks/{chunk-QHYBSIIO.js → chunk-FB24AOIJ.js} +39 -37
- package/dist/chunks/{chunk-QHYBSIIO.js.map → chunk-FB24AOIJ.js.map} +1 -1
- package/dist/chunks/chunk-FSB2VIRZ.js +435 -0
- package/dist/chunks/chunk-FSB2VIRZ.js.map +7 -0
- package/dist/chunks/{chunk-PNDYFU64.js → chunk-GJVPP3NN.js} +81 -11
- package/dist/chunks/chunk-GJVPP3NN.js.map +7 -0
- package/dist/chunks/{chunk-B5D6GA77.js → chunk-GYPDGW27.js} +100 -92
- package/dist/chunks/chunk-GYPDGW27.js.map +7 -0
- package/dist/chunks/{chunk-LEFBW2GK.js → chunk-IAFI4A2I.js} +44 -2
- package/dist/chunks/{chunk-LEFBW2GK.js.map → chunk-IAFI4A2I.js.map} +3 -3
- package/dist/chunks/{chunk-PWS2OXLV.js → chunk-IIPKG52D.js} +1 -1
- package/dist/chunks/chunk-IIPKG52D.js.map +7 -0
- package/dist/chunks/chunk-ITVLKXCI.js +266 -0
- package/dist/chunks/chunk-ITVLKXCI.js.map +7 -0
- package/dist/chunks/chunk-JKQARSWR.js +265 -0
- package/dist/chunks/chunk-JKQARSWR.js.map +7 -0
- package/dist/chunks/{chunk-AYBIR4YV.js → chunk-KJZAOENY.js} +6 -4
- package/dist/chunks/chunk-KJZAOENY.js.map +7 -0
- package/dist/chunks/{chunk-74BA4VSX.js → chunk-KQ6R5EWR.js} +1462 -1405
- package/dist/chunks/chunk-KQ6R5EWR.js.map +7 -0
- package/dist/chunks/chunk-L22K5BWU.js +180 -0
- package/dist/chunks/chunk-L22K5BWU.js.map +7 -0
- package/dist/chunks/{chunk-7XJB2USB.js → chunk-LOLCTWJF.js} +4 -4
- package/dist/chunks/{chunk-QETG2GVX.js → chunk-M5IN6DMF.js} +34 -31
- package/dist/chunks/chunk-M5IN6DMF.js.map +7 -0
- package/dist/chunks/{chunk-64O5L7EW.js → chunk-M6IRQ3QT.js} +2 -2
- package/dist/chunks/{chunk-TX6E5W7H.js → chunk-NTC2MCB6.js} +1 -1
- package/dist/chunks/chunk-NTC2MCB6.js.map +7 -0
- package/dist/chunks/{chunk-EPYLZWJV.js → chunk-OVBKQCYL.js} +2 -2
- package/dist/chunks/{chunk-YV2PHCDB.js → chunk-PYFJW3HC.js} +16 -2
- package/dist/chunks/{chunk-YV2PHCDB.js.map → chunk-PYFJW3HC.js.map} +3 -3
- package/dist/chunks/{chunk-Z5Y65YBX.js → chunk-PYQM7KPL.js} +3 -2
- package/dist/chunks/{chunk-BEJF2JX2.js → chunk-QLFDPXK7.js} +33 -2
- package/dist/chunks/chunk-QLFDPXK7.js.map +7 -0
- package/dist/chunks/chunk-QUWC6YCN.js +125 -0
- package/dist/chunks/chunk-QUWC6YCN.js.map +7 -0
- package/dist/chunks/{chunk-DKVJREDI.js → chunk-QY7YK7M6.js} +2 -2
- package/dist/chunks/{chunk-WMJ2AVQQ.js → chunk-R5F6CHW2.js} +34 -18
- package/dist/chunks/chunk-R5F6CHW2.js.map +7 -0
- package/dist/chunks/chunk-S3IRPDSO.js +57 -0
- package/dist/chunks/chunk-S3IRPDSO.js.map +7 -0
- package/dist/chunks/{chunk-7BG5COXB.js → chunk-SVDHQUTM.js} +21 -4
- package/dist/chunks/chunk-SVDHQUTM.js.map +7 -0
- package/dist/chunks/{chunk-HG4DMARW.js → chunk-T5CU2GPZ.js} +116 -26
- package/dist/chunks/chunk-T5CU2GPZ.js.map +7 -0
- package/dist/chunks/{chunk-RIFG4HS6.js → chunk-TFFZVLR2.js} +141 -9
- package/dist/chunks/chunk-TFFZVLR2.js.map +7 -0
- package/dist/chunks/{chunk-BUQZBG6O.js → chunk-U2UBUKNQ.js} +136 -136
- package/dist/chunks/chunk-U2UBUKNQ.js.map +7 -0
- package/dist/chunks/chunk-U366I5K2.js +363 -0
- package/dist/chunks/chunk-U366I5K2.js.map +7 -0
- package/dist/chunks/{chunk-4NF3S3NM.js → chunk-UTOBAZ5T.js} +1 -1
- package/dist/chunks/chunk-UTOBAZ5T.js.map +7 -0
- package/dist/chunks/chunk-V73NIH6B.js +127 -0
- package/dist/chunks/chunk-V73NIH6B.js.map +7 -0
- package/dist/chunks/{chunk-PN4EKNRE.js → chunk-VON4TSO3.js} +132 -12
- package/dist/chunks/chunk-VON4TSO3.js.map +7 -0
- package/dist/chunks/{chunk-5ZJV4LAX.js → chunk-VPRJOD4Y.js} +4 -4
- package/dist/chunks/{chunk-FDIEQEXS.js → chunk-VSDUSNIA.js} +4 -4
- package/dist/chunks/chunk-VSDUSNIA.js.map +7 -0
- package/dist/chunks/{chunk-RG22JKIC.js → chunk-W7X4XEQU.js} +2 -2
- package/dist/chunks/{chunk-LV4IT75S.js → chunk-WLLXKS6I.js} +2 -2
- package/dist/chunks/chunk-WOLUDZVR.js +197 -0
- package/dist/chunks/chunk-WOLUDZVR.js.map +7 -0
- package/dist/chunks/{chunk-YVDBHS4C.js → chunk-WREA4RNR.js} +3 -3
- package/dist/chunks/{chunk-QE2JFB7F.js → chunk-WYUV6WL3.js} +16 -6
- package/dist/chunks/chunk-WYUV6WL3.js.map +7 -0
- package/dist/chunks/{chunk-NGGI6LDC.js → chunk-X2TRSE7D.js} +2 -2
- package/dist/chunks/{chunk-VRAGOMN4.js → chunk-YRDCJZZW.js} +34 -1
- package/dist/chunks/chunk-YRDCJZZW.js.map +7 -0
- package/dist/chunks/{chunk-CC63CY6R.js → chunk-YYSZBD7S.js} +17 -261
- package/dist/chunks/chunk-YYSZBD7S.js.map +7 -0
- package/dist/chunks/{chunk-A4VP7HDF.js → chunk-ZLNJDTCN.js} +2 -2
- package/dist/chunks/{chunk-G4CSXNBT.js → chunk-ZXKYU6CH.js} +42 -5
- package/dist/chunks/chunk-ZXKYU6CH.js.map +7 -0
- package/dist/cli/decisions.d.ts +8 -0
- package/dist/cli/decisions.d.ts.map +1 -0
- package/dist/cli/decisions.js +131 -0
- package/dist/cli/decisions.js.map +7 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +56 -0
- package/dist/cli/index.js.map +7 -0
- package/dist/cli/mesh.d.ts +3 -0
- package/dist/cli/mesh.d.ts.map +1 -0
- package/dist/cli/mesh.js +126 -0
- package/dist/cli/mesh.js.map +7 -0
- package/dist/commands/fabric.d.ts.map +1 -1
- package/dist/compaction/carry.d.ts +23 -0
- package/dist/compaction/carry.d.ts.map +1 -0
- package/dist/compaction/hook.d.ts +9 -0
- package/dist/compaction/hook.d.ts.map +1 -1
- package/dist/compaction/hook.js +6 -6
- package/dist/compaction/orphan-repair.d.ts +11 -0
- package/dist/compaction/orphan-repair.d.ts.map +1 -0
- package/dist/compaction/orphan-repair.js +75 -0
- package/dist/compaction/orphan-repair.js.map +7 -0
- package/dist/compaction/owner.d.ts +26 -0
- package/dist/compaction/owner.d.ts.map +1 -0
- package/dist/compaction/owner.js +26 -0
- package/dist/compaction/owner.js.map +7 -0
- package/dist/compaction/pressure.d.ts +19 -0
- package/dist/compaction/pressure.d.ts.map +1 -0
- package/dist/compaction/render.d.ts +4 -0
- package/dist/compaction/render.d.ts.map +1 -1
- package/dist/compaction/threshold.d.ts +6 -1
- package/dist/compaction/threshold.d.ts.map +1 -1
- package/dist/components/configuration.js +6 -6
- package/dist/components/provider-component.d.ts +1 -1
- package/dist/components/provider-component.d.ts.map +1 -1
- package/dist/config.d.ts +45 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/core/action-registry.d.ts +5 -1
- package/dist/core/action-registry.d.ts.map +1 -1
- package/dist/core/action-registry.js +8 -8
- package/dist/core/approval-controller.d.ts +5 -1
- package/dist/core/approval-controller.d.ts.map +1 -1
- package/dist/core/approval-overrides.d.ts +11 -0
- package/dist/core/approval-overrides.d.ts.map +1 -0
- package/dist/core/atomic-write.d.ts +77 -0
- package/dist/core/atomic-write.d.ts.map +1 -1
- package/dist/core/compact-controller.d.ts +8 -0
- package/dist/core/compact-controller.d.ts.map +1 -1
- package/dist/core/file-lock.d.ts.map +1 -1
- package/dist/core/foreground-tools.d.ts +45 -0
- package/dist/core/foreground-tools.d.ts.map +1 -0
- package/dist/core/provider-bindings.d.ts +10 -1
- package/dist/core/provider-bindings.d.ts.map +1 -1
- package/dist/core/provider-operations.js.map +1 -1
- package/dist/core/tool-ownership.d.ts +18 -2
- package/dist/core/tool-ownership.d.ts.map +1 -1
- package/dist/decisions/command.d.ts +5 -0
- package/dist/decisions/command.d.ts.map +1 -0
- package/dist/decisions/command.js +74 -0
- package/dist/decisions/command.js.map +7 -0
- package/dist/decisions/host.d.ts +24 -0
- package/dist/decisions/host.d.ts.map +1 -0
- package/dist/decisions/store.d.ts +147 -0
- package/dist/decisions/store.d.ts.map +1 -0
- package/dist/durable.d.ts +38 -0
- package/dist/durable.d.ts.map +1 -0
- package/dist/durable.js +274 -0
- package/dist/durable.js.map +7 -0
- package/dist/entropy/index.js +10 -9
- package/dist/execution-service.d.ts +41 -1
- package/dist/execution-service.d.ts.map +1 -1
- package/dist/extension-bootstrap.d.ts +7 -0
- package/dist/extension-bootstrap.d.ts.map +1 -0
- package/dist/extension-bootstrap.js +51 -0
- package/dist/extension-bootstrap.js.map +7 -0
- package/dist/extension.d.ts +8 -0
- package/dist/extension.d.ts.map +1 -0
- package/dist/fabric-exec-tool.d.ts.map +1 -1
- package/dist/fabric-runtime-state.d.ts +8 -0
- package/dist/fabric-runtime-state.d.ts.map +1 -1
- package/dist/fabric-runtime-state.js +2432 -346
- package/dist/fabric-runtime-state.js.map +4 -4
- package/dist/fabric-state.d.ts +22 -0
- package/dist/fabric-state.d.ts.map +1 -1
- package/dist/host-compatibility.d.ts +1 -1
- package/dist/host-compatibility.d.ts.map +1 -1
- package/dist/index.d.ts +5 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +68 -6250
- package/dist/index.js.map +4 -4
- package/dist/jev/observation.js +5 -5
- package/dist/jev-fabric/bridge.d.ts +15 -0
- package/dist/jev-fabric/bridge.d.ts.map +1 -1
- package/dist/jev-fabric/client.js +1 -1
- package/dist/jev-fabric/client.js.map +2 -2
- package/dist/jev-fabric/operations.d.ts +2 -0
- package/dist/jev-fabric/operations.d.ts.map +1 -1
- package/dist/jev-fabric/operations.js +1 -1
- package/dist/jev-fabric/operations.js.map +2 -2
- package/dist/jev-fabric/resolve.js +1 -1
- package/dist/jev-fabric/resolve.js.map +2 -2
- package/dist/jev.js +9 -9
- package/dist/lifecycle/types.d.ts.map +1 -1
- package/dist/memory/client.d.ts +3 -0
- package/dist/memory/client.d.ts.map +1 -1
- package/dist/memory/digest.js +2 -2
- package/dist/memory/discovery.js +6 -6
- package/dist/memory/expand-service.d.ts.map +1 -1
- package/dist/memory/file-worker.d.ts.map +1 -1
- package/dist/memory/file-worker.js +10 -9
- package/dist/memory/file-worker.js.map +2 -2
- package/dist/memory/host-source.d.ts +2 -1
- package/dist/memory/host-source.d.ts.map +1 -1
- package/dist/memory/normalize.js +5 -5
- package/dist/memory/portable.d.ts +3 -1
- package/dist/memory/portable.d.ts.map +1 -1
- package/dist/memory/request-cache.d.ts +4 -2
- package/dist/memory/request-cache.d.ts.map +1 -1
- package/dist/memory/request-context.d.ts +3 -0
- package/dist/memory/request-context.d.ts.map +1 -1
- package/dist/memory/search.js +7 -7
- package/dist/memory/worker-provider.d.ts.map +1 -1
- package/dist/memory/worker-provider.js +10 -10
- package/dist/memory.js +14 -13
- package/dist/memory.js.map +2 -2
- package/dist/mesh/grants.d.ts +86 -0
- package/dist/mesh/grants.d.ts.map +1 -0
- package/dist/mesh/store.d.ts +89 -0
- package/dist/mesh/store.d.ts.map +1 -1
- package/dist/programs/host.d.ts +22 -0
- package/dist/programs/host.d.ts.map +1 -0
- package/dist/programs/host.js +171 -0
- package/dist/programs/host.js.map +7 -0
- package/dist/programs/source.d.ts +16 -0
- package/dist/programs/source.d.ts.map +1 -0
- package/dist/programs/store.d.ts +81 -0
- package/dist/programs/store.d.ts.map +1 -0
- package/dist/protocol.d.ts +153 -0
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js +15 -1
- package/dist/providers/agents-actions.d.ts.map +1 -1
- package/dist/providers/agents-message-router.d.ts.map +1 -1
- package/dist/providers/agents-progress.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/cache-provider.d.ts +1 -1
- package/dist/providers/cache-provider.d.ts.map +1 -1
- package/dist/providers/compact-provider.d.ts +13 -1
- package/dist/providers/compact-provider.d.ts.map +1 -1
- package/dist/providers/decisions-provider.d.ts +17 -0
- package/dist/providers/decisions-provider.d.ts.map +1 -0
- package/dist/providers/jev-provider.js +9 -9
- package/dist/providers/memory-provider.d.ts.map +1 -1
- package/dist/providers/memory-provider.js +9 -9
- package/dist/providers/mesh-provider.d.ts +4 -0
- package/dist/providers/mesh-provider.d.ts.map +1 -1
- package/dist/providers/pi-native-mcp.d.ts.map +1 -1
- package/dist/providers/pi-tools-provider.d.ts.map +1 -1
- package/dist/providers/programs-provider.d.ts +18 -0
- package/dist/providers/programs-provider.d.ts.map +1 -0
- package/dist/providers/state-provider.d.ts +4 -1
- package/dist/providers/state-provider.d.ts.map +1 -1
- package/dist/providers/thinking-provider.d.ts +15 -0
- package/dist/providers/thinking-provider.d.ts.map +1 -0
- package/dist/residency/actor-client.js +3 -3
- package/dist/residency/client.d.ts.map +1 -1
- package/dist/residency/host.d.ts +21 -0
- package/dist/residency/host.d.ts.map +1 -1
- package/dist/residency/host.js +28 -22
- package/dist/residency/launcher-owner.d.ts +2 -0
- package/dist/residency/launcher-owner.d.ts.map +1 -1
- package/dist/residency/launcher.js +35 -20
- package/dist/residency/launcher.js.map +3 -3
- package/dist/residency/pi-entry.js +26 -22
- package/dist/residency/pi-entry.js.map +1 -1
- package/dist/residency/protocol.d.ts +12 -2
- package/dist/residency/protocol.d.ts.map +1 -1
- package/dist/runners.d.ts +9 -0
- package/dist/runners.d.ts.map +1 -0
- package/dist/runners.js +182 -0
- package/dist/runners.js.map +7 -0
- package/dist/runtime/core-override-guest-types.js +2 -2
- package/dist/runtime/cpython-child-source.d.ts.map +1 -1
- package/dist/runtime/cpython-runtime.d.ts.map +1 -1
- package/dist/runtime/cpython-runtime.js +35 -7
- package/dist/runtime/cpython-runtime.js.map +2 -2
- package/dist/runtime/deadline-pause.d.ts +26 -0
- package/dist/runtime/deadline-pause.d.ts.map +1 -0
- 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/kernel.d.ts +3 -0
- package/dist/runtime/kernel.d.ts.map +1 -1
- package/dist/runtime/monty-runtime.d.ts.map +1 -1
- package/dist/runtime/monty-runtime.js +33 -12
- package/dist/runtime/monty-runtime.js.map +2 -2
- package/dist/runtime/node-process-runtime.d.ts.map +1 -1
- package/dist/runtime/node-process-runtime.js +4 -3
- package/dist/runtime/orchestration.d.ts.map +1 -1
- package/dist/runtime/quickjs-runtime.d.ts.map +1 -1
- package/dist/runtime/quickjs-runtime.js +2 -1
- package/dist/runtime/typescript-kernel.js +8 -7
- package/dist/runtime/typescript-kernel.js.map +1 -1
- package/dist/runtime-state-builtins.d.ts.map +1 -1
- package/dist/schema/controller.d.ts.map +1 -1
- package/dist/schema/policy.d.ts.map +1 -1
- package/dist/scope.d.ts +69 -0
- package/dist/scope.d.ts.map +1 -0
- package/dist/scope.js +37 -0
- package/dist/scope.js.map +7 -0
- package/dist/speculation/eligibility.d.ts.map +1 -1
- package/dist/speculation/python-scanner.js +1 -1
- package/dist/speculation/python-scanner.js.map +2 -2
- package/dist/speculation/scanner.js +1 -1
- package/dist/speculation/scanner.js.map +2 -2
- package/dist/state/binding.d.ts +17 -0
- package/dist/state/binding.d.ts.map +1 -0
- package/dist/state/store.d.ts +8 -2
- package/dist/state/store.d.ts.map +1 -1
- package/dist/state/types.d.ts +23 -2
- package/dist/state/types.d.ts.map +1 -1
- package/dist/storage/retention.d.ts +7 -0
- package/dist/storage/retention.d.ts.map +1 -1
- package/dist/storage/scratch.d.ts.map +1 -1
- package/dist/thinking-control.d.ts +64 -0
- package/dist/thinking-control.d.ts.map +1 -0
- package/dist/thinking-control.js +15 -0
- package/dist/thinking-control.js.map +7 -0
- package/dist/thinking.d.ts +61 -0
- package/dist/thinking.d.ts.map +1 -1
- package/dist/topology/control-plane.d.ts +13 -0
- package/dist/topology/control-plane.d.ts.map +1 -1
- package/dist/topology/participant-directory.d.ts +2 -0
- package/dist/topology/participant-directory.d.ts.map +1 -1
- package/dist/topology/provider-participants.d.ts +72 -0
- package/dist/topology/provider-participants.d.ts.map +1 -0
- package/dist/topology/records.d.ts.map +1 -1
- package/dist/topology/types.d.ts +13 -3
- package/dist/topology/types.d.ts.map +1 -1
- package/dist/type-error-guidance.js +170 -0
- package/dist/type-error-guidance.js.map +7 -0
- package/dist/ui/controller.d.ts.map +1 -1
- package/dist/ui/conversation-chrome.d.ts +2 -0
- package/dist/ui/conversation-chrome.d.ts.map +1 -1
- package/dist/ui/conversation-chrome.js +1 -1
- package/dist/ui/conversation-latest.d.ts +10 -0
- package/dist/ui/conversation-latest.d.ts.map +1 -0
- package/dist/ui/conversation-native-reader.js +2 -1
- package/dist/ui/conversation-native-reader.js.map +1 -1
- package/dist/ui/conversation-render.d.ts +2 -1
- package/dist/ui/conversation-render.d.ts.map +1 -1
- package/dist/ui/conversation-scrollbar.d.ts +22 -0
- package/dist/ui/conversation-scrollbar.d.ts.map +1 -0
- package/dist/ui/conversation-selection.d.ts +2 -2
- package/dist/ui/conversation-selection.d.ts.map +1 -1
- package/dist/ui/conversation-targets.d.ts.map +1 -1
- package/dist/ui/conversation-targets.js +2 -2
- package/dist/ui/conversation.d.ts +3 -0
- package/dist/ui/conversation.d.ts.map +1 -1
- package/dist/ui/conversation.js +253 -34
- package/dist/ui/conversation.js.map +4 -4
- package/dist/ui/dashboard-fabric-graph.d.ts.map +1 -1
- package/dist/ui/dashboard.js +14 -15
- package/dist/ui/dashboard.js.map +2 -2
- package/dist/ui/image-overlays.d.ts +16 -0
- package/dist/ui/image-overlays.d.ts.map +1 -0
- package/dist/ui/image-overlays.js +10 -0
- package/dist/ui/image-overlays.js.map +7 -0
- package/dist/ui/kitty-viewport.d.ts +24 -0
- package/dist/ui/kitty-viewport.d.ts.map +1 -0
- package/dist/ui/retention.d.ts +14 -0
- package/dist/ui/retention.d.ts.map +1 -0
- package/dist/ui/settings-sections-execution.d.ts.map +1 -1
- package/dist/ui/settings.d.ts.map +1 -1
- package/dist/ui/settings.js +27 -16
- package/dist/ui/settings.js.map +2 -2
- package/dist/ui/transcript.d.ts +2 -1
- package/dist/ui/transcript.d.ts.map +1 -1
- package/dist/ui/types.d.ts +2 -1
- package/dist/ui/types.d.ts.map +1 -1
- package/dist/ui/widget.d.ts +4 -2
- package/dist/ui/widget.d.ts.map +1 -1
- package/dist/verified/generated/authority-kernel.js +1 -1
- package/dist/verified/generated/kernel.js +1 -1
- package/dist/verified/generated/lifecycle-kernel.js +1 -1
- package/dist/verified/generated/manifest.json +7 -7
- package/dist/verified/generated/provider-kernel.js +1 -1
- package/dist/verified/generated/storage-kernel.js +1 -1
- package/dist/worker/options.d.ts.map +1 -1
- package/dist/worker/options.js +14 -0
- package/dist/worker/options.js.map +2 -2
- package/dist/worker/questions.d.ts +46 -0
- package/dist/worker/questions.d.ts.map +1 -0
- package/dist/worker/questions.js +87 -0
- package/dist/worker/questions.js.map +7 -0
- package/dist/worker/result.d.ts +3 -0
- package/dist/worker/result.d.ts.map +1 -0
- package/dist/worker/result.js +7493 -0
- package/dist/worker/result.js.map +7 -0
- package/dist/worker/run-record.js +10 -113
- package/dist/worker/run-record.js.map +3 -3
- package/dist/worker/startup.d.ts +8 -0
- package/dist/worker/startup.d.ts.map +1 -0
- package/dist/worker.js +111 -22
- package/dist/worker.js.map +4 -4
- package/docs/agents.md +197 -3
- package/docs/architecture.md +8 -1
- package/docs/audit-trace.md +36 -1
- package/docs/background-tasks.md +25 -1
- package/docs/certification.md +1 -1
- package/docs/compaction.md +64 -0
- package/docs/components.md +1 -0
- package/docs/configuration.md +105 -10
- package/docs/decisions.md +144 -0
- package/docs/durable-pi.md +186 -0
- package/docs/interface.md +10 -1
- package/docs/kitty-images.md +89 -0
- package/docs/licenses/typebox-mit.txt +23 -0
- package/docs/memory-recall.md +5 -3
- package/docs/programmatic-compaction.md +67 -11
- package/docs/programs.md +137 -0
- package/docs/provider-capabilities.md +23 -1
- package/docs/providers.md +158 -0
- package/docs/residency-runtime.md +64 -0
- package/docs/schema-enforcement.md +5 -3
- package/docs/shell-composition.md +6 -6
- package/docs/skills.md +2 -1
- package/docs/speculation.md +2 -1
- package/docs/state-layer.md +26 -4
- package/docs/thinking.md +48 -0
- package/docs/verified-kernels.md +1 -1
- package/package.json +48 -12
- package/scripts/test-verified-kernels.mjs +1 -1
- package/scripts/verified-kernels.mjs +1 -1
- package/skillsets/python/fabric-exec/SKILL.md +2 -2
- package/skillsets/python/fabric-exec/references/agents.md +9 -4
- package/skillsets/python/fabric-exec/references/mesh.md +9 -0
- package/skillsets/python/fabric-graph/SKILL.md +109 -0
- package/skillsets/python/fabric-guide/SKILL.md +2 -1
- package/skillsets/typescript/fabric-exec/SKILL.md +20 -2
- package/skillsets/typescript/fabric-exec/references/agents.md +10 -4
- package/skillsets/typescript/fabric-exec/references/mesh.md +10 -0
- package/skillsets/typescript/fabric-graph/SKILL.md +112 -0
- package/skillsets/typescript/fabric-guide/SKILL.md +2 -1
- package/skillsets/typescript/fabric-workflow/SKILL.md +1 -1
- package/dist/chunks/chunk-4NF3S3NM.js.map +0 -7
- package/dist/chunks/chunk-5VTBHJN3.js.map +0 -7
- package/dist/chunks/chunk-74BA4VSX.js.map +0 -7
- package/dist/chunks/chunk-7BG5COXB.js.map +0 -7
- package/dist/chunks/chunk-AYBIR4YV.js.map +0 -7
- package/dist/chunks/chunk-B5D6GA77.js.map +0 -7
- package/dist/chunks/chunk-BEJF2JX2.js.map +0 -7
- package/dist/chunks/chunk-BUQZBG6O.js.map +0 -7
- package/dist/chunks/chunk-CC63CY6R.js.map +0 -7
- package/dist/chunks/chunk-FDIEQEXS.js.map +0 -7
- package/dist/chunks/chunk-G4CSXNBT.js.map +0 -7
- package/dist/chunks/chunk-HG4DMARW.js.map +0 -7
- package/dist/chunks/chunk-KAD7UWT2.js +0 -99
- package/dist/chunks/chunk-KAD7UWT2.js.map +0 -7
- package/dist/chunks/chunk-MGWQOKBV.js +0 -30
- package/dist/chunks/chunk-MGWQOKBV.js.map +0 -7
- package/dist/chunks/chunk-PN4EKNRE.js.map +0 -7
- package/dist/chunks/chunk-PNDYFU64.js.map +0 -7
- package/dist/chunks/chunk-PWS2OXLV.js.map +0 -7
- package/dist/chunks/chunk-QE2JFB7F.js.map +0 -7
- package/dist/chunks/chunk-QETG2GVX.js.map +0 -7
- package/dist/chunks/chunk-RAO6TQFP.js.map +0 -7
- package/dist/chunks/chunk-RIFG4HS6.js.map +0 -7
- package/dist/chunks/chunk-TX6E5W7H.js.map +0 -7
- package/dist/chunks/chunk-VRAGOMN4.js.map +0 -7
- package/dist/chunks/chunk-W63E3WEO.js.map +0 -7
- package/dist/chunks/chunk-WMJ2AVQQ.js.map +0 -7
- package/dist/chunks/chunk-ZZ66L3W5.js.map +0 -7
- /package/dist/chunks/{chunk-57CMH4SW.js.map → chunk-7JU7Z4XQ.js.map} +0 -0
- /package/dist/chunks/{chunk-DUJ46TIP.js.map → chunk-ABJCSNZO.js.map} +0 -0
- /package/dist/chunks/{chunk-KP4ANT6L.js.map → chunk-C7EEG6SM.js.map} +0 -0
- /package/dist/chunks/{chunk-NHMICIEU.js.map → chunk-CCHZXF6K.js.map} +0 -0
- /package/dist/chunks/{chunk-5JN5AWNV.js.map → chunk-DZ4WN5XJ.js.map} +0 -0
- /package/dist/chunks/{chunk-7XJB2USB.js.map → chunk-LOLCTWJF.js.map} +0 -0
- /package/dist/chunks/{chunk-64O5L7EW.js.map → chunk-M6IRQ3QT.js.map} +0 -0
- /package/dist/chunks/{chunk-EPYLZWJV.js.map → chunk-OVBKQCYL.js.map} +0 -0
- /package/dist/chunks/{chunk-Z5Y65YBX.js.map → chunk-PYQM7KPL.js.map} +0 -0
- /package/dist/chunks/{chunk-DKVJREDI.js.map → chunk-QY7YK7M6.js.map} +0 -0
- /package/dist/chunks/{chunk-5ZJV4LAX.js.map → chunk-VPRJOD4Y.js.map} +0 -0
- /package/dist/chunks/{chunk-RG22JKIC.js.map → chunk-W7X4XEQU.js.map} +0 -0
- /package/dist/chunks/{chunk-LV4IT75S.js.map → chunk-WLLXKS6I.js.map} +0 -0
- /package/dist/chunks/{chunk-YVDBHS4C.js.map → chunk-WREA4RNR.js.map} +0 -0
- /package/dist/chunks/{chunk-NGGI6LDC.js.map → chunk-X2TRSE7D.js.map} +0 -0
- /package/dist/chunks/{chunk-A4VP7HDF.js.map → chunk-ZLNJDTCN.js.map} +0 -0
package/docs/providers.md
CHANGED
|
@@ -51,6 +51,78 @@ async invoke(actionName, args, context) {
|
|
|
51
51
|
}
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
+
## Provider participants
|
|
55
|
+
|
|
56
|
+
A provider that starts its own long-running work, such as a delegate that launches runs on another system, can register each run as a participant. Inside `fabric_exec`, `context.participants` is present (it is absent in other host contexts such as speculation, so check it):
|
|
57
|
+
|
|
58
|
+
```ts
|
|
59
|
+
async invoke(actionName, args, context) {
|
|
60
|
+
const run = await backend.start(args.task);
|
|
61
|
+
const participant = context.participants?.register({
|
|
62
|
+
id: run.id, // [A-Za-z0-9][A-Za-z0-9._:-]{0,63}, unique while unsettled
|
|
63
|
+
label: `Delegate ${run.id}`, // shown in the widget and dashboard
|
|
64
|
+
kind: "delegate",
|
|
65
|
+
detached: actionName === "spawn",
|
|
66
|
+
stop: async (reason) => ({ confirmed: await backend.cancel(run.id, reason) }),
|
|
67
|
+
steer: async (message) => backend.message(run.id, message),
|
|
68
|
+
});
|
|
69
|
+
run.on("progress", (event) => participant?.update({ phase: event.step, message: event.note, usage: event.usage }));
|
|
70
|
+
if (actionName === "spawn") return { ref: participant?.ref };
|
|
71
|
+
const result = await run.done();
|
|
72
|
+
participant?.settle({ status: result.ok ? "completed" : "failed", summary: result.summary });
|
|
73
|
+
participant?.dispose();
|
|
74
|
+
return result;
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
`register` returns a handle whose `ref` is `provider:<provider>:<id>`. Fabric binds the provider name, so a provider cannot register or control another provider's refs. `update` replaces the shown phase, message (at most 500 characters), and cumulative `usage` totals. `settle` records the terminal status once and later calls are ignored. `dispose` removes the participant. Invalid specs or progress throw.
|
|
79
|
+
|
|
80
|
+
Registered participants appear in the participant directory with `kind: "provider"`, in `agents.members()`, and as agent rows in the activity widget and dashboard. `agents.stop`, `agents.steer`, and `agents.followUp` accept the ref, as do the dashboard and conversation controls. They call the provider's callbacks. A missing `steer` or `followUp` callback, or a `data` payload, fails with a clear error. `agents.stop` returns `{ ref, outcome: "confirmed" | "unconfirmed", detail? }`. With `mesh.enabled`, other sessions reach the participant through the owner's control plane.
|
|
81
|
+
|
|
82
|
+
Owned-work cancellation: when the `fabric_exec` program that registered a non-detached participant is cancelled or times out, Fabric calls `stop("program_cancelled")` on each of its unsettled participants in parallel, within one 5 second total bound. Each outcome is `confirmed` when the callback resolves `{ confirmed: true }`, otherwise `unconfirmed` with `detail` `declined`, `error`, or `timeout`. Fabric records the outcomes as [`fabric.participant.stop`](audit-trace.md#owned-work-stops) trace operations and in the tool result. A program that completes normally leaves its participants to the provider. Detached participants survive the invocation and stop only when asked. Fabric releases every participant of a provider, without calling `stop`, when that provider withdraws or the session shuts down; their handles then do nothing.
|
|
83
|
+
|
|
84
|
+
## Withdrawing a direct registration
|
|
85
|
+
|
|
86
|
+
An extension withdraws a provider it registered directly by emitting `FABRIC_PROVIDER_WITHDRAW_EVENT` (`pi-fabric:provider:withdraw:v1`):
|
|
87
|
+
|
|
88
|
+
```ts
|
|
89
|
+
import { FABRIC_PROVIDER_WITHDRAW_EVENT, type FabricProviderWithdrawalV1 } from "pi-fabric/protocol";
|
|
90
|
+
|
|
91
|
+
pi.events.emit(FABRIC_PROVIDER_WITHDRAW_EVENT, { name: "example" } satisfies FabricProviderWithdrawalV1);
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Fabric retires the current binding and drops its owner hold, the same path a component lease takes. It also releases the provider's [participants](#provider-participants), detached ones included. New calls to `example.*` are refused immediately. Work already admitted and committed capability views that pinned the old generation drain under the [retained-generation rules](provider-capabilities.md#capability-views). The extension owns the provider instance, so Fabric does not call `close()` on withdrawal. Fabric also forgets the registration and does not remount it on reload; an extension that answers `FABRIC_PROVIDER_DISCOVER_EVENT` must stop registering there too. Register again with `FABRIC_PROVIDER_REGISTER_EVENT` at any time.
|
|
95
|
+
|
|
96
|
+
Optional `generation` pins the withdrawal to one binding: a number matches the binding generation, a string matches the provider binding id (`providerBindingId` in a committed view). Unknown names, generation mismatches, component-owned providers, and managed-host providers are ignored; set `PI_FABRIC_DEBUG=1` to log ignored withdrawals. Component-owned providers withdraw through their component lifecycle.
|
|
97
|
+
|
|
98
|
+
## Tool placement query
|
|
99
|
+
|
|
100
|
+
Extensions that need to know where a tool is reachable this turn can ask synchronously with `FABRIC_TOOL_PLACEMENT_EVENT` (`pi-fabric:tool-placement:v1`), so they need not guess from Fabric's mode:
|
|
101
|
+
|
|
102
|
+
```ts
|
|
103
|
+
import {
|
|
104
|
+
FABRIC_TOOL_PLACEMENT_EVENT,
|
|
105
|
+
type FabricToolPlacementRequestV1,
|
|
106
|
+
type FabricToolPlacementResultV1,
|
|
107
|
+
} from "pi-fabric/protocol";
|
|
108
|
+
|
|
109
|
+
let placement: FabricToolPlacementResultV1 | undefined;
|
|
110
|
+
pi.events.emit(FABRIC_TOOL_PLACEMENT_EVENT, {
|
|
111
|
+
tools: ["my_tool", "read"],
|
|
112
|
+
reply: (result) => { placement = result; },
|
|
113
|
+
} satisfies FabricToolPlacementRequestV1);
|
|
114
|
+
// placement === undefined: Fabric is not loaded.
|
|
115
|
+
// placement.tools.my_tool: "model" | "program" | "unavailable"
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
The reply is `{ version: 1, mode, tools }`. `mode` is `"full-code"`, `"enforce"` (Schema enforce), or `"orchestration"`. Each tool maps to:
|
|
119
|
+
|
|
120
|
+
- `model`: declared to the model this turn. Exclusive modes declare `fabric_exec` plus any resolved [foreground tools](configuration.md#foreground-tools) (full code mode only); orchestration declares Pi's active set.
|
|
121
|
+
- `program`: callable from a `fabric_exec` program, as `pi.<tool>` for Pi core tools or `extensions.<tool>` for captured extension tools. Requires an initialized Fabric runtime and respects child tool allowlists. Schema enforce exposes no `extensions.*` namespace.
|
|
122
|
+
- `unavailable`: neither.
|
|
123
|
+
|
|
124
|
+
`model` wins when both apply; optional `programCallable` lists the reported `model` tools that a program can also call, such as foreground tools, and is omitted when empty. Omitting `tools` reports every tool registered with Pi; at most 1,024 names of up to 256 characters each are accepted. An invalid query gets no reply. Placement describes state at the time of the query. A later mode change, reload, or tool refresh can change it, so query when you need the answer and do not cache it.
|
|
125
|
+
|
|
54
126
|
## Invocation costs and guarantees
|
|
55
127
|
|
|
56
128
|
| Access pattern | Work and allocation | Guarantees |
|
|
@@ -72,6 +144,38 @@ the same normalized progress, entity, or metrics value is a UI no-op, not a hear
|
|
|
72
144
|
durable event. Actual lifecycle completion and failure still travel through the normal
|
|
73
145
|
invocation path. See [incremental activity reads](interface.md#incremental-activity-reads).
|
|
74
146
|
|
|
147
|
+
## Workflow item events
|
|
148
|
+
|
|
149
|
+
Every `workflow.item` status transition emits `pi-fabric:workflow-item:v1` (`FABRIC_WORKFLOW_ITEM_EVENT`) on `pi.events`, so a host extension can track program work without parsing results:
|
|
150
|
+
|
|
151
|
+
```ts
|
|
152
|
+
import { FABRIC_WORKFLOW_ITEM_EVENT, type FabricWorkflowItemEventV1 } from "pi-fabric/protocol";
|
|
153
|
+
|
|
154
|
+
pi.events.on(FABRIC_WORKFLOW_ITEM_EVENT, (event: FabricWorkflowItemEventV1) => {
|
|
155
|
+
// { version: 1, invocationId, sessionId?, itemId, label?, from?, to, at, meta? }
|
|
156
|
+
});
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
`invocationId` is the owning `fabric_exec` tool call id. `itemId` is the caller's stable id or the deterministic per-invocation `item-<n>`. `from` is absent on an item's first status, and `meta` appears only when the transitioning call carried it. Updates that keep the same status emit nothing. When the program ends, items still `running` settle to `completed` or `failed` and emit that transition, matching the activity surface. Fabric emits synchronously from the host bridge and never waits on listeners. A throwing listener is logged and cannot fail the program. Transitions stay in the execution trace as before; `meta` never enters it.
|
|
160
|
+
|
|
161
|
+
## Program run events
|
|
162
|
+
|
|
163
|
+
A host extension, daemon bridge, or embedder runs a [saved program](programs.md#host-runs) without a model turn by emitting `pi-fabric:program:run:v1` (`FABRIC_PROGRAM_RUN_EVENT`):
|
|
164
|
+
|
|
165
|
+
```ts
|
|
166
|
+
import { FABRIC_PROGRAM_RUN_EVENT, type FabricProgramRunReplyV1 } from "pi-fabric/protocol";
|
|
167
|
+
|
|
168
|
+
pi.events.emit(FABRIC_PROGRAM_RUN_EVENT, {
|
|
169
|
+
ref: "changed-tests", // name, name@<digest prefix>, or digest
|
|
170
|
+
input: { base: "main" }, // optional, JSON, at most 64 KiB
|
|
171
|
+
requirePromoted: true, // optional
|
|
172
|
+
signal, // optional AbortSignal
|
|
173
|
+
reply: (result: FabricProgramRunReplyV1) => {},
|
|
174
|
+
});
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
The run has the same semantics as `/fabric run`: the session's root capability view, the configured approval policy, a `pi-fabric-program-run` transcript message, and `invokedBy: "host"` in the trace. `reply` is called exactly once with `{ ok: true, program, value, logs }` or `{ ok: false, error, program? }`.
|
|
178
|
+
|
|
75
179
|
## Managed embedded hosts
|
|
76
180
|
|
|
77
181
|
Trusted embedding code can opt into a closed-world provider authority:
|
|
@@ -105,6 +209,60 @@ The host remains responsible for OS isolation, resource loading, broker authoriz
|
|
|
105
209
|
cancellation, and for exposing only trusted extension code. This option does not sandbox arbitrary
|
|
106
210
|
host-side extensions. In particular, do not auto-load plugins from the agent's computer snapshot.
|
|
107
211
|
|
|
212
|
+
## Principal and scope
|
|
213
|
+
|
|
214
|
+
A host can attach a principal and resource grants to a Fabric session. Fabric propagates them and narrows them for children. Providers and adapters enforce them. A program can never set or widen a principal.
|
|
215
|
+
|
|
216
|
+
```ts
|
|
217
|
+
type FabricScope = {
|
|
218
|
+
version: 1;
|
|
219
|
+
principal: { id: string; issuer: "host" };
|
|
220
|
+
grants: { resource: string; actions: ("read" | "write" | "execute")[] }[];
|
|
221
|
+
digest: string; // sha256 hex of canonical JSON { grants, parentDigest?, principal }
|
|
222
|
+
parentDigest?: string; // set on derived scopes
|
|
223
|
+
};
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
A resource is `<ns>:<path>`. The namespace matches `[a-z][a-z0-9._-]*`. The path is `/`-separated segments with an optional leading `/`. A final `/*` matches exactly one more segment, and a final `/**` matches one or more. `<ns>:*` matches everything in the namespace. Neither wildcard matches its own prefix, so `fs:/repo/**` does not cover `fs:/repo`. A scope holds at most 64 grants. Fabric merges grants per resource, sorts them, and orders actions as read, write, execute before hashing, so equal content always has the same digest. A supplied `digest` must match.
|
|
227
|
+
|
|
228
|
+
Issue the root scope in one of two ways, before the session starts:
|
|
229
|
+
|
|
230
|
+
- Set `PI_FABRIC_SCOPE` (JSON) or `PI_FABRIC_SCOPE_FILE` (a path to the JSON, at most 64 KiB). The extension reads them once at initialization.
|
|
231
|
+
- Call `issueRootScope(scope)` from `pi-fabric/scope` in the embedding process before Pi emits `session_start`. A second call, or a call after `session_start`, throws.
|
|
232
|
+
|
|
233
|
+
Invalid input fails closed: every registry call is refused with `Fabric scope issuance failed; provider calls are refused: <reason>`. Setting both variables, or both a variable and the API, is invalid. Without any input, the session is unscoped and nothing changes.
|
|
234
|
+
|
|
235
|
+
Every registry invocation receives the frozen scope as `context.scope`. The registry sets this field itself and discards any caller value. `agents.run` and `agents.spawn` accept `scope: { grants }`. Each requested grant must be covered by one parent grant: a resource subset and an action subset. Without `scope`, the child inherits the parent scope unchanged. An unscoped session refuses `scope` arguments, because there is no principal to narrow. Children receive the result in `PI_FABRIC_SCOPE`, and the worker clears any inherited `PI_FABRIC_SCOPE_FILE`.
|
|
236
|
+
|
|
237
|
+
Durable agents and actors keep their scope. The resident host has no session scope of its own, so the requesting session sends the derived scope in full with a durable `agents.spawn` and binds it to a durable `agents.create` actor. Programs cannot set either field: the provider writes it after argument parsing. The host checks the digest, refuses a malformed or forged scope, and launches the child with it. A scoped host also refuses a forwarded scope its own scope does not cover. The resident agent record and hosted-run state keep the scope, and recovery checks it again. A damaged scope settles the run as indeterminate.
|
|
238
|
+
|
|
239
|
+
Every actor is bound to the principal that created it. `agents.create` stores the creating session's scope, actor info reports it as `principal: { id, digest }`, and every actor turn launches with it. Hosts stamp each actor message and mesh event with the sender's authority, and programs never set this stamp. `{ authority: "host" }` marks an unscoped sender. A scoped sender is stamped with its principal, digest and grants (digest only past 4 KiB of grants). The actor applies this rule:
|
|
240
|
+
|
|
241
|
+
| Sender | Unscoped actor | Scoped actor |
|
|
242
|
+
|---|---|---|
|
|
243
|
+
| Unscoped host | trusted | trusted |
|
|
244
|
+
| Scoped | untrusted | trusted only when the sender has the same principal and covers every actor grant |
|
|
245
|
+
| No stamp (older build) | trusted | untrusted |
|
|
246
|
+
|
|
247
|
+
Fabric still delivers untrusted messages. Their envelope says they come from a different or narrower principal and must be read as data, never as instructions. Grant posts keep their external-input wording. Ask replies flow back unchanged.
|
|
248
|
+
|
|
249
|
+
The resident host cannot prove that a request's scope or a sender stamp was issued by a host. Any process running as the same OS user can write residency requests and mesh events. This is the same single-user boundary as the mesh. Real multi-user isolation needs the principal from an authenticated socket, which Fabric does not provide yet.
|
|
250
|
+
|
|
251
|
+
```ts
|
|
252
|
+
import { deriveScope, issueRootScope, scopeAllows } from "pi-fabric/scope";
|
|
253
|
+
|
|
254
|
+
const root = issueRootScope({
|
|
255
|
+
principal: { id: "tenant:acme/user:42" },
|
|
256
|
+
grants: [{ resource: "memory:acme/**", actions: ["read"] }],
|
|
257
|
+
});
|
|
258
|
+
scopeAllows(root, "memory:acme/sessions/7", "read"); // true
|
|
259
|
+
deriveScope(root, [{ resource: "memory:acme/sessions/*", actions: ["read"] }]);
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
Caches that can serve a result across invocations include the scope digest in their keys: speculative replay tokens and the memory recall-continuation and expansion caches. The `cache` provider holds prompt-cache leases and caches no results. The MCP descriptor cache holds tool descriptors, not call results. [Portable memory sources](memory-recall.md) receive the scope as the third `authorize(action, sessionKey, scope)` argument, so they can filter before content enters context. `createMemorySourceClient` calls accept `{ scope }`.
|
|
263
|
+
|
|
264
|
+
This layer is trusted host adapter code, not a verified kernel. Fabric guarantees issuance, propagation, narrowing and cache isolation. It does not map grants onto individual actions: a provider that ignores `context.scope` keeps its native authority. Claude and Veda children receive the variable without a Fabric registry to read it. See [provider capabilities](provider-capabilities.md#future-verified-extension).
|
|
265
|
+
|
|
108
266
|
## Effect semantics and scoped acquisition
|
|
109
267
|
|
|
110
268
|
Action descriptors can declare effect semantics. Descriptor hashes and committed component and actor views carry this metadata. Omitting it is the conservative choice. Read-risk actions then resolve as commutative `none`, and every other risk resolves as unknown-order `emission`.
|
|
@@ -43,6 +43,16 @@ stdin EOF. `pi-entry.js` starts `ResidentHost` on `session_start`, aborts it on
|
|
|
43
43
|
The residency protocol is unchanged: `config.json`, `owner.json`, request,
|
|
44
44
|
response, and mesh files remain the durable interface.
|
|
45
45
|
|
|
46
|
+
Scope travels with each request. The host has no session scope of its own, so
|
|
47
|
+
a scoped session puts the full derived scope in a durable spawn
|
|
48
|
+
(`inheritedScope`) or actor create (`principalScope`). The host checks the
|
|
49
|
+
digest and refuses a malformed scope. It records the scope in the agent's
|
|
50
|
+
`agents/<id>.json` and in the actor registry, and launches every child and
|
|
51
|
+
actor turn with it. Hosted-run recovery checks the persisted scope again.
|
|
52
|
+
Requests are files writable by the same OS user, so this keeps the
|
|
53
|
+
single-user boundary of the mesh; see
|
|
54
|
+
[principal and scope](providers.md#principal-and-scope).
|
|
55
|
+
|
|
46
56
|
## Context and lifecycle
|
|
47
57
|
|
|
48
58
|
Residency does not share agent contexts. Each actor or agent retains its own
|
|
@@ -53,6 +63,60 @@ and reconnection.
|
|
|
53
63
|
The host exits after its normal idle grace once it owns no live durable actor or
|
|
54
64
|
running durable agent.
|
|
55
65
|
|
|
66
|
+
[Scheduled mesh events](agents.md#scheduled-events) add one rule, computed by the
|
|
67
|
+
pure `residentIdleDecision`: pending schedules on any topic keep the host alive
|
|
68
|
+
while it owns at least one durable participant, and every idle check re-arms a
|
|
69
|
+
wake timer to the earliest due time. At that time the host releases due schedules
|
|
70
|
+
under the mesh lock, and its actor monitor delivers them. Pending schedules alone,
|
|
71
|
+
with no durable participant, do not keep the host running; Fabric adds no system
|
|
72
|
+
daemon, so such a schedule is released the next time any Fabric process touches
|
|
73
|
+
the mesh root.
|
|
74
|
+
|
|
75
|
+
### Stale commands after restart
|
|
76
|
+
|
|
77
|
+
A restarted host keeps its `residentHostId(rootId)` and replays the control log
|
|
78
|
+
from offset 0, so a stop or ask meant for the previous process could otherwise
|
|
79
|
+
reach a durable actor's next turn. Each host process publishes its participant
|
|
80
|
+
records with a fresh `ownerIncarnation`, and requesters stamp that value on each
|
|
81
|
+
command. The new host refuses an unclaimed command for an earlier incarnation
|
|
82
|
+
with an immediate rejection and does not execute it; the caller re-resolves the
|
|
83
|
+
participant and decides whether to resend. See
|
|
84
|
+
[stale commands after restart](agents.md#stale-commands-after-restart).
|
|
85
|
+
|
|
86
|
+
## Containers and PID namespaces
|
|
87
|
+
|
|
88
|
+
`kill(pid, 0)` only answers within the caller's PID namespace and boot. In a
|
|
89
|
+
container, the same number can name an unrelated process or nothing, and after
|
|
90
|
+
PID reuse it names a stranger. Fabric owners therefore record an identity:
|
|
91
|
+
`hostname`, the Linux PID namespace (`/proc/self/ns/pid`), the boot id, and the
|
|
92
|
+
process start time. The owner-liveness section of `src/core/atomic-write.ts`
|
|
93
|
+
judges an owner as follows:
|
|
94
|
+
|
|
95
|
+
- Same host, namespace and boot: the signal probe decides (`ESRCH` dead,
|
|
96
|
+
`EPERM` alive). On Linux, a different `/proc/<pid>/stat` start time for the
|
|
97
|
+
same PID means reuse, so the owner is dead.
|
|
98
|
+
- Another namespace, host or boot: only a heartbeat decides. A fresh heartbeat
|
|
99
|
+
is alive, a stale one is dead, and none is `unknown`. On the same host, a
|
|
100
|
+
different boot id with no heartbeat is dead, since no process outlives its
|
|
101
|
+
boot.
|
|
102
|
+
- Records without identity fields keep the earlier signal-probe behaviour.
|
|
103
|
+
|
|
104
|
+
`unknown` is never treated as death. A lock whose owner might be alive is not
|
|
105
|
+
stolen.
|
|
106
|
+
|
|
107
|
+
The resident host is a long-lived owner. Its start lock and `owner.json` carry
|
|
108
|
+
additive `identity` and `heartbeatAt` fields, and the format stays `1`. The
|
|
109
|
+
heartbeat refreshes every 10 s, and a heartbeat older than 45 s is stale. The
|
|
110
|
+
Schema commit lock heartbeats the same way while a transaction runs. Short
|
|
111
|
+
mesh, actor-store and file locks carry an identity line only. Across
|
|
112
|
+
namespaces, their creation time serves as the heartbeat, with a 10-minute hold
|
|
113
|
+
ceiling (or the lock's stale window, if longer). Scratch markers record
|
|
114
|
+
identity and no heartbeat, so the sweeper leaves a foreign owner's scratch
|
|
115
|
+
alone.
|
|
116
|
+
|
|
117
|
+
Hosts and containers that share `.pi/fabric` need clocks that agree within the
|
|
118
|
+
heartbeat TTL.
|
|
119
|
+
|
|
56
120
|
## Validation
|
|
57
121
|
|
|
58
122
|
Run:
|
|
@@ -36,12 +36,14 @@ Under enforce mode, discovery and workflow display operations still work, along
|
|
|
36
36
|
- `pi.read`, `pi.grep`, `pi.find`, `pi.ls`;
|
|
37
37
|
- `memory.recall`, `memory.expand`, `memory.sessions`;
|
|
38
38
|
- `state.get`, `state.history`, `state.complexity`;
|
|
39
|
-
- `mesh.self`, `mesh.read`, `mesh.members`, `mesh.get`, `mesh.list`;
|
|
40
|
-
- `
|
|
39
|
+
- `mesh.self`, `mesh.read`, `mesh.members`, `mesh.get`, `mesh.list`, `mesh.scheduled`, `mesh.grants`;
|
|
40
|
+
- `decisions.list`;
|
|
41
|
+
- `programs.list`, `programs.get`;
|
|
42
|
+
- `compact.status`, `thinking.status`;
|
|
41
43
|
- `components.list`, `components.status`, `components.graph`;
|
|
42
44
|
- `schema.status`, `schema.hypothesize`, `schema.verify`, `schema.commit`, `schema.abort`.
|
|
43
45
|
|
|
44
|
-
The gate blocks `pi.edit`, `pi.write`, `pi.bash`, `pi.powershell`, all agent/actor actions, mesh and state writes or execution, `compact.request`, `compact.cancel`, `components.reload`, MCP, captured extensions, and every external provider, whatever risk it declares. Enforce sessions keep declarative component entries in configuration without activating them, and registered definitions stay visible to diagnostics. A provider that claims `risk: "read"` still fails this exact-reference policy. Fabric records guard failures in the existing typed execution trace with `failureStage: "guard"`.
|
|
46
|
+
The gate blocks `pi.edit`, `pi.write`, `pi.bash`, `pi.powershell`, all agent/actor actions, mesh and state writes or execution, `compact.request`, `compact.cancel`, `thinking.set`, `thinking.reset`, `decisions.raise`, `decisions.wait`, `decisions.answer`, `decisions.escalate`, `decisions.cancel`, `programs.save`, `programs.run`, `components.reload`, MCP, captured extensions, and every external provider, whatever risk it declares. Enforce sessions keep declarative component entries in configuration without activating them, and registered definitions stay visible to diagnostics. A provider that claims `risk: "read"` still fails this exact-reference policy. Fabric records guard failures in the existing typed execution trace with `failureStage: "guard"`.
|
|
45
47
|
|
|
46
48
|
An enforce session never restores persistent actors, and host-event actor dispatch stays off. Fabric disables agent execution, so the gate also blocks agent actions. Capture `keepVisible`, descriptor risk, claimed source metadata, or tool visibility cannot authorize a second top-level path. Fabric blocks a colliding external or SDK tool named `fabric_exec` unless Pi's canonical `sourceInfo.path` identifies this extension's entry exactly.
|
|
47
49
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Shell composition
|
|
2
2
|
|
|
3
3
|
Fabric's shell surfaces follow jev-fabric's
|
|
4
|
-
[composition contract](https://github.com/
|
|
4
|
+
[composition contract](https://github.com/fabric-runtime/jev-fabric/blob/main/docs/composition.md):
|
|
5
5
|
two axes, one set of verbs, the same records. An agent that knows `jev-fabric
|
|
6
6
|
-- start` / `follow` / `read` already knows `pi.bash({durable:true})` /
|
|
7
7
|
`tasks.read` / `sessions.read`, and a command can move between Fabric and a
|
|
@@ -11,7 +11,7 @@ standalone jev-fabric without being rewritten.
|
|
|
11
11
|
|
|
12
12
|
| Lifetime | Owner | Batch (no stdin) | Interactive (stdin open) |
|
|
13
13
|
| --- | --- | --- | --- |
|
|
14
|
-
| `foreground` | the calling `fabric_exec` | `pi.bash({cmd})` |
|
|
14
|
+
| `foreground` | the calling `fabric_exec` | `pi.bash({cmd})` | unsupported |
|
|
15
15
|
| `session` | this Pi session, or the Jev program that opened it | `pi.bash({cmd, background:true})` | `sessions.open({argv \| cmd})` |
|
|
16
16
|
| `durable` | the jev-fabric store; outlives Pi | `pi.bash({cmd, durable:true})` | `sessions.open({…, durable:true})` |
|
|
17
17
|
|
|
@@ -21,9 +21,9 @@ standalone jev-fabric without being rewritten.
|
|
|
21
21
|
- **Durable** and **interactive** children are owned by jev-fabric (macOS and
|
|
22
22
|
Linux). Durable batch tasks still run through `pi.bash` and its middleware;
|
|
23
23
|
interactive children run outside `pi.bash`, so they are unavailable while an
|
|
24
|
-
extension overrides `bash
|
|
25
|
-
- A Jev program's interactive `session` children end
|
|
26
|
-
|
|
24
|
+
extension overrides `bash`. This preserves the extension's gate.
|
|
25
|
+
- A Jev program's interactive `session` children end whenever the program ends.
|
|
26
|
+
`fabric_exec` children stay with the Pi session, like background tasks.
|
|
27
27
|
|
|
28
28
|
## One set of verbs
|
|
29
29
|
|
|
@@ -34,7 +34,7 @@ standalone jev-fabric without being rewritten.
|
|
|
34
34
|
| bytes by offset | `tasks.read` (combined `output`) | `sessions.read` (`stdout`/`stderr`) | `read` |
|
|
35
35
|
| literal line filter | `tasks.watch({match})` | read + filter in code | `watch <id> <literal>` |
|
|
36
36
|
| retained events | monitor replay (`tasks.watch`, no match) | `sessions.events` | `events` / `follow` |
|
|
37
|
-
| input |
|
|
37
|
+
| input | not applicable | `sessions.write`, `sessions.closeInput` | `write`, `closeInput` |
|
|
38
38
|
| stop by ID | `tasks.stop` | `sessions.stop` | `stop` |
|
|
39
39
|
| discovery | `tasks.list`, `tasks.external`, `tasks.adopt` | `sessions.list` | `list` |
|
|
40
40
|
|
package/docs/skills.md
CHANGED
|
@@ -8,7 +8,7 @@ Pi Fabric uses a core-first, user-opt-in skill hierarchy.
|
|
|
8
8
|
- The user invokes every advanced workflow. Each one declares `disable-model-invocation: true` and stays out of the model catalog. Agent policy forbids reading one autonomously or delegating from one user-only skill to another. The policy governs agent behavior. It is not a filesystem authorization boundary.
|
|
9
9
|
- `/skill:fabric-guide` is the user-only router. It names one exact advanced command and stops there. The router never invokes the recommendation.
|
|
10
10
|
- Each user-facing description summarizes its command. Only the selected execution reference spends always-on model context.
|
|
11
|
-
- Both `skillsets/typescript/` and `skillsets/python/` contain the same
|
|
11
|
+
- Both `skillsets/typescript/` and `skillsets/python/` contain the same fifteen canonical skill names, each with its own reference files. Fabric contributes only the selected tree through Pi resource discovery. Changing the kernel reloads Pi resources; see [kernel-specific skills](kernels.md#kernel-specific-skills-and-guidance). Third-party skills remain under Pi's normal discovery rules.
|
|
12
12
|
|
|
13
13
|
The parent agent behaves like regular Pi until the user explicitly opts into orchestration, recursion, Schema, Jev programs, ambient actors, or swarm coordination.
|
|
14
14
|
|
|
@@ -49,3 +49,4 @@ A mandatory pointer serves legibility and single-source maintenance. Per-run tok
|
|
|
49
49
|
- `/skill:fabric-spec`: supervise spec compliance persistently.
|
|
50
50
|
- `/skill:fabric-ambient`: route directly to an advisor or supervisor profile.
|
|
51
51
|
- `/skill:fabric-swarm`: coordinate durable actors.
|
|
52
|
+
- `/skill:fabric-graph`: run a step graph as plain program code, or as a resumable durable actor with mesh checkpoints, scheduled wakes, and decision nodes; see [saved programs](programs.md).
|
package/docs/speculation.md
CHANGED
|
@@ -74,7 +74,8 @@ ActionRegistry.invoke() serve-or-reexecute at the real call site
|
|
|
74
74
|
refs that are `risk: "read"` with `effect.kind: "none"`, never prompt for
|
|
75
75
|
approval, and cost nothing when wasted (`pi.read`/`grep`/`find`/`ls`,
|
|
76
76
|
`memory.recall`/`expand`/`sessions`, `state.get`/`history`/`complexity`,
|
|
77
|
-
`schema.status`, `compact.status`, `
|
|
77
|
+
`schema.status`, `compact.status`, `thinking.status`, `decisions.list`,
|
|
78
|
+
`programs.list`/`get`, `components.list`/`status`/`graph`).
|
|
78
79
|
The gate re-runs against the resolved descriptor at launch, so a provider
|
|
79
80
|
or config change that reclassifies a ref closes speculation off.
|
|
80
81
|
2. **Freshness, not staleness.** A stored promise is served only when both
|
package/docs/state-layer.md
CHANGED
|
@@ -42,8 +42,8 @@ The append-only JSONL event log holds:
|
|
|
42
42
|
- **`transition`**: a versioned proposal with `data: { protocolVersion: 1, phase: "proposed", label, from?, to, summary, evidence?, tags?, kind?, complexity?, certificationStatus?, ts }`.
|
|
43
43
|
- **`transition.committed`**: makes its referenced proposal visible after all ledger and head CAS writes succeed.
|
|
44
44
|
- **`transition.rejected`**: records a failed proposal and its rollback or quarantine status. A proposal never becomes visible merely because this marker exists.
|
|
45
|
-
- **`state.certified`**: emitted only after a successful verification. Its data holds bounded `targets`, the verification-time `head`, `evidenceDigest`, `resultDigest`, `certificationStatus: "certified"`, and `ts`.
|
|
46
|
-
- **`state.violated`**: best-effort reporting for fail-closed verification. Its data holds bounded non-confirmed `results`, blocking `reasons`, selected `targets`, the verification-time `head`, and
|
|
45
|
+
- **`state.certified`**: emitted only after a successful verification. Its data holds bounded `targets`, the verification-time `head`, `evidenceDigest`, `resultDigest`, `certificationStatus: "certified"`, the [bound certificate](#bound-certificates) fields (`binding?`, `observed?`, `issuer`, `requestedBy`, `schemaMode?`), and `ts`.
|
|
46
|
+
- **`state.violated`**: best-effort reporting for fail-closed verification. Its data holds bounded non-confirmed `results`, blocking `reasons`, selected `targets`, the verification-time `head`, both digests, and the same bound certificate fields.
|
|
47
47
|
- **`state.goal.met`**: emitted when the executable goal predicate passes.
|
|
48
48
|
|
|
49
49
|
A certificate target carries the transition's stable `transitionId`, `label`, and `to`. When verification has a head, the certificate also records that head's `transitionId`, label, destination, and CAS `version`. The fold applies certification and violation events in sequence for each target. A transition receives a certified overlay only when its latest durable verification outcome is `state.certified`. A later `state.violated` removes that overlay. Certificate currentness also requires the full recorded head identity to equal the committed current head: transition ID, label, destination, and CAS version.
|
|
@@ -143,7 +143,7 @@ By default the fold finds the last representation transition and drops earlier t
|
|
|
143
143
|
|
|
144
144
|
### `state.verify`: risk `execute`
|
|
145
145
|
|
|
146
|
-
`{ labels?, includeArchived?, timeoutMs? }` selects the current head when you omit `labels`. With labels supplied, it selects the active transitions that match. Archived transitions stay out unless you set `includeArchived: true`.
|
|
146
|
+
`{ labels?, includeArchived?, timeoutMs?, binding? }` selects the current head when you omit `labels`. With labels supplied, it selects the active transitions that match. Archived transitions stay out unless you set `includeArchived: true`.
|
|
147
147
|
|
|
148
148
|
Commands run sequentially with a per-command timeout of 30 seconds by default. The layer streams combined stdout and stderr. It does not accumulate output without limit. Each report keeps at most a 32 KiB UTF-8 prefix per command, plus `outputBytes`, `outputOmittedBytes`, and a digest of the complete byte stream. Results also apply byte bounds to claims, commands, and errors, and each carries digest and omission metadata. Verification events use smaller bounded prefixes, bounded result and reason arrays, and target chunks, so each payload stays comfortably below the default 256 KiB mesh limit. Each result includes `{ claim, command, status, exitCode, output, outputBytes, outputOmittedBytes, outputDigest, error? }`. The `status` field is one of:
|
|
149
149
|
|
|
@@ -151,7 +151,7 @@ Commands run sequentially with a per-command timeout of 30 seconds by default. T
|
|
|
151
151
|
- `violated` on a non-zero exit;
|
|
152
152
|
- `error` on spawn failure, timeout, or cancellation.
|
|
153
153
|
|
|
154
|
-
The report adds `{ certified, violated, certificationStatus, evidenceDigest, resultDigest, failures, certificate
|
|
154
|
+
The report adds `{ certified, violated, certificationStatus, evidenceDigest, resultDigest, failures, certificate?, binding?, observed?, requestedBy }`. See [Bound certificates](#bound-certificates) for `binding`. The `certified` flag is true if and only if at least one evidence command ran and every result was confirmed. Any other outcome blocks certification and publishes `state.violated`. A successful run publishes `state.certified` and returns its certificate. When the selected targets include the unchanged current head, the layer then CAS-persists that certificate in `state/current` with a binding to the resulting head version. After a failed run that targets the unchanged current head, it CAS-revokes any stored certificate once violation publication succeeds.
|
|
155
155
|
|
|
156
156
|
An explicitly empty `labels` array selects nothing and fails closed. A request for an archived, proposed, rejected, or otherwise uncommitted label also fails closed as a missing active target when no committed match is visible.
|
|
157
157
|
|
|
@@ -165,6 +165,28 @@ On POSIX, each command shell leads a detached process group. A timeout or abort
|
|
|
165
165
|
|
|
166
166
|
`{ timeoutMs? }` runs the goal predicate and reports `{ passed, output, exitCode, error? }`. The same 32 KiB cap bounds the command output. A passing `state.goal.met` event stores a smaller bounded prefix along with the full-stream digest and omission metadata. Goal checks stay separate from state certification.
|
|
167
167
|
|
|
168
|
+
## Bound certificates
|
|
169
|
+
|
|
170
|
+
A certificate says which evidence passed. A verifier that consumes it, such as a pi-work style gate, usually also needs to know *what* that evidence ran against and *who* issued it. `state.verify` accepts an optional `binding`, and every new certificate carries host-recorded provenance:
|
|
171
|
+
|
|
172
|
+
| Field | Source | Meaning |
|
|
173
|
+
| --- | --- | --- |
|
|
174
|
+
| `binding` | Caller | Up to 16 string claims. Keys match `[a-z][a-zA-Z0-9_.-]{0,63}`, values hold at most 512 characters, and keys are stored sorted. Well-known keys: `commit`, `specDigest`, `nodeAddress`, `criteriaDigest`. |
|
|
175
|
+
| `observed` | Host | `{ commit?, dirty? }` from `git rev-parse --verify HEAD` and `git status --porcelain` in the verification cwd, taken before any evidence runs. Fabric omits it outside a git work tree or before the first commit, and omits only `dirty` when the status probe fails. Probes are time-bounded, output-bounded, and run with `GIT_OPTIONAL_LOCKS=0`. |
|
|
176
|
+
| `issuer` | Host | Always `"host"`: the Fabric host ran the evidence and wrote the certificate. |
|
|
177
|
+
| `requestedBy` | Host | `"program"` when the call came through the `state` provider action surface (a `fabric_exec` program or any other registry caller); `"host"` when host code calls `StateStore.verify` directly. |
|
|
178
|
+
| `schemaMode` | Host | The configured Schema mode (`off`, `audit`, or `enforce`) at verification time, when known. |
|
|
179
|
+
|
|
180
|
+
Only `binding.commit` is checked. The host compares it, case-insensitively, with the full observed HEAD object name. A different HEAD fails closed with reason `binding-mismatch`. A cwd with no observable HEAD fails closed with reason `binding-unobserved`. In both cases no evidence runs, `state.violated` is published, and a current certificate for the targeted head is revoked as for any other failed verification. Other binding keys are recorded caller claims. Fabric validates their shape but not their meaning. A consumer that requires them must compare them with its own expected values. A malformed `binding` is a usage error: the call throws before any probe, evidence, or event.
|
|
181
|
+
|
|
182
|
+
These fields appear wherever the certificate does: the `state.certified` event, the durable certificate in `state/current`, `state.get()` (`head.certificate` and `certification.current/recent`), `state.history()`, and the `state.verify` report. All fields are optional on read. Certificates written before this change still fold, and malformed stored values fold as absent while the certificate itself stays valid.
|
|
183
|
+
|
|
184
|
+
A strict verifier can therefore require, for example, `issuer === "host"`, `requestedBy === "program"`, `observed.commit === expectedCommit`, `observed.dirty === false`, and `binding.specDigest === expectedSpecDigest`. Like the rest of the state layer, these are records in project mesh storage. They are as trustworthy as write access to that storage and not cryptographically signed.
|
|
185
|
+
|
|
186
|
+
### Relation to the verified state kernel
|
|
187
|
+
|
|
188
|
+
The bound fields live entirely in the JavaScript host payload. They are not inputs to the generated `headReadable` kernel that decides head visibility, and they do not touch the Schema controller's `assertCertificateFacts`/`consume` transaction-certificate kernels. Certificate currentness still depends only on the recorded head identity. The commit check is a host-side precondition, and it can only add a blocking failure: it can turn a would-be certification into a violation but never the reverse. No `.bend` law, proof, or generated module changed.
|
|
189
|
+
|
|
168
190
|
## Complexity rule
|
|
169
191
|
|
|
170
192
|
The built-in complexity implementation handles `.ts`, `.js`, `.tsx`, and `.jsx`. It lexes tokens with no AST dependency and counts statement decision keywords:
|
package/docs/thinking.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Thinking control
|
|
2
|
+
|
|
3
|
+
`thinking.*` lets a program change the host Pi session's reasoning effort for a bounded scope. It is the adaptive-thinking primitive: a program can raise effort for a hard step and drop back to the baseline afterwards. Fabric applies every change through Pi's own `setThinkingLevel`, so Pi persists the level and clamps it to the active model as usual.
|
|
4
|
+
|
|
5
|
+
## Guest API
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
const before = await thinking.status();
|
|
9
|
+
// { level, available, bounds: { min, max }, baseline, override? }
|
|
10
|
+
|
|
11
|
+
await thinking.set({ level: "high", reason: "proof step" }); // this agent run
|
|
12
|
+
await thinking.set({ level: "low", scope: "turns", turns: 3 }); // the next 3 agent_end events
|
|
13
|
+
await thinking.set({ level: "xhigh", scope: "session" }); // until reset
|
|
14
|
+
await thinking.reset(); // back to the baseline
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Python uses the same calls, for example `await thinking.set(level="high", scope="turn")`.
|
|
18
|
+
|
|
19
|
+
| Action | Risk | Result |
|
|
20
|
+
| --- | --- | --- |
|
|
21
|
+
| `thinking.status()` | read, no effect, speculation-eligible | `{level, available, bounds:{min,max}, baseline, override?:{level, scope, remainingTurns?, reason?, setAt}}` |
|
|
22
|
+
| `thinking.set({level, scope?, turns?, reason?})` | write | status plus `clamped: true` and `requested` when the applied level differs from the request |
|
|
23
|
+
| `thinking.reset()` | write | status after restoring the baseline |
|
|
24
|
+
|
|
25
|
+
- `available` lists the active model's supported levels inside the effective bounds. Without a model, every level is listed, matching Pi.
|
|
26
|
+
- `bounds` resolves unbounded ends to the model's lowest and highest supported levels.
|
|
27
|
+
- `baseline` is the level that was active when the first override began. A second `set` keeps that baseline.
|
|
28
|
+
- `scope: "turn"` (the default) reverts at the next `agent_end`. A `set` inside the running program therefore lasts for the rest of the current agent run. `scope: "turns"` requires `turns` (1 to 20) and counts `agent_end` events, including the current run. `scope: "session"` lasts until `thinking.reset()`. `turns` with any other scope is rejected.
|
|
29
|
+
- `reason` is optional, at most 256 characters, and appears in status.
|
|
30
|
+
- A requested level is first clamped into `thinking.bounds`, then to the nearest level the model supports inside those bounds (next higher first, then lower, as in pi-ai). When no supported level lies inside the bounds, `set` fails and changes nothing.
|
|
31
|
+
|
|
32
|
+
`set` and `reset` are control-plane writes. They follow `approvals.write` like `compact.request`, and Schema enforce mode blocks them while still allowing `thinking.status`. Managed hosts do not expose `thinking.*`.
|
|
33
|
+
|
|
34
|
+
## Persistence and ownership
|
|
35
|
+
|
|
36
|
+
Every override change appends a `pi-fabric-thinking` custom session entry `{version: 1, override}`. After a reload or restart, Fabric replays the latest entry on the active branch, so a pending revert still happens at the next `agent_end`. Tree navigation replays the entry on the new branch. A malformed latest entry ends the override and never revives an older one.
|
|
37
|
+
|
|
38
|
+
The `agent_end` revert runs even before the Fabric runtime activates. If the user or another extension changes the level while an override is active, Fabric ends the override without restoring the baseline. It never fights another owner for the setting.
|
|
39
|
+
|
|
40
|
+
## Bounds
|
|
41
|
+
|
|
42
|
+
`thinking.bounds` (`{min?, max?}`, default unbounded) caps every level Fabric selects: `thinking.set`, child runs, and inherited child sessions. Level names are validated, and an inverted or malformed value fails configuration loading. See [configuration](configuration.md#thinking-bounds).
|
|
43
|
+
|
|
44
|
+
## Child runs
|
|
45
|
+
|
|
46
|
+
`agents.run` and `agents.spawn` accept `thinkingBounds: {min?, max?}`. Explicit ends must lie inside the caller's effective bounds, and omitted ends inherit them. A wider request fails before launch. Each run's `thinking` level (explicit, alias, or `agents.thinking`) is clamped into the child's bounds. A clamped run reports the original level as `requestedThinking` on its handle and record. Without configured bounds, child runs keep the existing behavior.
|
|
47
|
+
|
|
48
|
+
Fabric passes the child's effective bounds to the worker, which exports them to the child process as `PI_FABRIC_THINKING_BOUNDS` (JSON `{min?, max?}`). A child Fabric intersects its own `thinking.bounds` with that value and never widens it: when the two ranges do not overlap, the parent range applies. At session start, the child moves a level outside its bounds back inside them, which covers a model clamp that would overshoot the parent's maximum. A malformed inherited value fails the child's configuration load. Durable `agents.spawn` sends the narrowed bounds with the request, so the resident host enforces the caller's bounds.
|
package/docs/verified-kernels.md
CHANGED
|
@@ -204,7 +204,7 @@ author-defined observational equivalence are not claimed as Bend theorems.
|
|
|
204
204
|
|
|
205
205
|
## Reproducible bridge
|
|
206
206
|
|
|
207
|
-
The contributor toolchain pins **Bend 2.0.
|
|
207
|
+
The contributor toolchain pins **Bend 2.0.35**. Installed Fabric needs neither
|
|
208
208
|
Bend nor a Bend loader. Linux CI downloads that exact release archive and checks
|
|
209
209
|
its SHA-256 before running proofs. Windows tests execute the checked-in generated
|
|
210
210
|
JS and ABI; native Bend currently requires Linux, macOS, or WSL.
|
package/package.json
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@e4779/pi-fabric",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.105.0-fork.22",
|
|
4
4
|
"description": "A programmable tool and agent runtime for Pi",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"pi-fabric": "./dist/cli/index.js"
|
|
9
|
+
},
|
|
7
10
|
"types": "./dist/index.d.ts",
|
|
8
11
|
"exports": {
|
|
9
12
|
".": {
|
|
@@ -18,10 +21,22 @@
|
|
|
18
21
|
"types": "./dist/agents.d.ts",
|
|
19
22
|
"import": "./dist/agents.js"
|
|
20
23
|
},
|
|
24
|
+
"./runners": {
|
|
25
|
+
"types": "./dist/runners.d.ts",
|
|
26
|
+
"import": "./dist/runners.js"
|
|
27
|
+
},
|
|
28
|
+
"./durable": {
|
|
29
|
+
"types": "./dist/durable.d.ts",
|
|
30
|
+
"import": "./dist/durable.js"
|
|
31
|
+
},
|
|
21
32
|
"./mcp": {
|
|
22
33
|
"types": "./dist/mcp.d.ts",
|
|
23
34
|
"import": "./dist/mcp.js"
|
|
24
35
|
},
|
|
36
|
+
"./assessment": {
|
|
37
|
+
"types": "./dist/assessment.d.ts",
|
|
38
|
+
"import": "./dist/assessment.js"
|
|
39
|
+
},
|
|
25
40
|
"./jev": {
|
|
26
41
|
"types": "./dist/jev.d.ts",
|
|
27
42
|
"import": "./dist/jev.js"
|
|
@@ -29,6 +44,10 @@
|
|
|
29
44
|
"./memory": {
|
|
30
45
|
"types": "./dist/memory.d.ts",
|
|
31
46
|
"import": "./dist/memory.js"
|
|
47
|
+
},
|
|
48
|
+
"./scope": {
|
|
49
|
+
"types": "./dist/scope.d.ts",
|
|
50
|
+
"import": "./dist/scope.js"
|
|
32
51
|
}
|
|
33
52
|
},
|
|
34
53
|
"files": [
|
|
@@ -51,12 +70,12 @@
|
|
|
51
70
|
"proof:dist": "node scripts/smoke-verified-kernels.mjs",
|
|
52
71
|
"build": "bun run proof:artifact && node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.build.json --emitDeclarationOnly && node scripts/build.mjs && bun run assert:build-artifacts",
|
|
53
72
|
"typecheck": "tsc --noEmit",
|
|
54
|
-
"test:
|
|
73
|
+
"test:pi1": "bun run build && vitest run tests/pi1-sdk.test.ts tests/pi1-public-contract.test.ts",
|
|
55
74
|
"test:jev:live": "PI_FABRIC_JEV_LIVE=1 vitest run tests/jev-live.test.ts",
|
|
56
75
|
"test:jev:dist": "node scripts/smoke-jev.mjs",
|
|
57
76
|
"test:changed": "node scripts/test-affected.mjs",
|
|
58
77
|
"test:affected": "node scripts/test-affected.mjs --base $PI_TEST_BASE",
|
|
59
|
-
"test:smoke": "vitest run tests/optional-preview-startup.test.ts tests/script-runtime.test.ts tests/pi-binary.test.ts tests/host-compatibility.test.ts tests/output-budget.test.ts tests/actor-mesh-monitor.test.ts tests/handoff.test.ts tests/config-migrations.test.ts tests/monty-payload-preflight.test.ts tests/bundled-binary-spawn.test.ts tests/conversation-native-reader-suspension.test.ts",
|
|
78
|
+
"test:smoke": "vitest run tests/optional-preview-startup.test.ts tests/script-runtime.test.ts tests/pi-binary.test.ts tests/host-compatibility.test.ts tests/output-budget.test.ts tests/actor-mesh-monitor.test.ts tests/handoff.test.ts tests/config-migrations.test.ts tests/monty-payload-preflight.test.ts tests/bundled-binary-spawn.test.ts tests/worker-installation.test.ts tests/conversation-native-reader-suspension.test.ts",
|
|
60
79
|
"test:related": "vitest related --run",
|
|
61
80
|
"check:fast": "bun run typecheck && bun run test:changed",
|
|
62
81
|
"certify:context": "bun run build && node scripts/certify-context.mjs",
|
|
@@ -65,6 +84,7 @@
|
|
|
65
84
|
"benchmark:memory-heads": "bun run build && node scripts/benchmark-memory-heads.mjs",
|
|
66
85
|
"benchmark:memory-recall": "bun run build && node scripts/benchmark-memory-recall.mjs",
|
|
67
86
|
"benchmark:conversation": "bun run build && node --expose-gc scripts/benchmark-conversation.mjs",
|
|
87
|
+
"benchmark:kitty": "bun scripts/benchmark-kitty.mjs",
|
|
68
88
|
"benchmark:provider-dispatch": "node scripts/benchmark-provider-dispatch.mjs",
|
|
69
89
|
"benchmark:activity": "node --expose-gc scripts/benchmark-activity.mjs",
|
|
70
90
|
"benchmark:turn-cpu": "node scripts/benchmark-turn-cpu.mjs",
|
|
@@ -89,24 +109,28 @@
|
|
|
89
109
|
"orchestration"
|
|
90
110
|
],
|
|
91
111
|
"license": "MIT",
|
|
112
|
+
"funding": {
|
|
113
|
+
"type": "opencollective",
|
|
114
|
+
"url": "https://opencollective.com/pi-fabric"
|
|
115
|
+
},
|
|
92
116
|
"author": "monotykamary",
|
|
93
117
|
"repository": {
|
|
94
118
|
"type": "git",
|
|
95
|
-
"url": "git+https://github.com/
|
|
119
|
+
"url": "git+https://github.com/fabric-runtime/pi-fabric.git"
|
|
96
120
|
},
|
|
97
|
-
"homepage": "https://github.com/
|
|
121
|
+
"homepage": "https://github.com/fabric-runtime/pi-fabric#readme",
|
|
98
122
|
"bugs": {
|
|
99
|
-
"url": "https://github.com/
|
|
123
|
+
"url": "https://github.com/fabric-runtime/pi-fabric/issues"
|
|
100
124
|
},
|
|
101
125
|
"engines": {
|
|
102
126
|
"node": ">=24"
|
|
103
127
|
},
|
|
104
128
|
"pi": {
|
|
105
129
|
"extensions": [
|
|
106
|
-
"./dist/
|
|
130
|
+
"./dist/extension-bootstrap.js"
|
|
107
131
|
],
|
|
108
132
|
"skills": [],
|
|
109
|
-
"image": "https://raw.githubusercontent.com/
|
|
133
|
+
"image": "https://raw.githubusercontent.com/fabric-runtime/pi-fabric/main/media/banner.svg"
|
|
110
134
|
},
|
|
111
135
|
"dependencies": {
|
|
112
136
|
"@jitl/quickjs-singlefile-mjs-release-sync": "^0.32.0",
|
|
@@ -124,17 +148,29 @@
|
|
|
124
148
|
"yaml": "^2.9.0"
|
|
125
149
|
},
|
|
126
150
|
"peerDependencies": {
|
|
151
|
+
"@earendil-works/chord": "1.0.0",
|
|
152
|
+
"@earendil-works/pi-durable": "1.0.0",
|
|
127
153
|
"@earendil-works/pi-ai": "*",
|
|
128
154
|
"@earendil-works/pi-agent-core": "*",
|
|
129
155
|
"@earendil-works/pi-coding-agent": "*",
|
|
130
156
|
"@earendil-works/pi-tui": "*",
|
|
131
157
|
"typebox": "*"
|
|
132
158
|
},
|
|
159
|
+
"peerDependenciesMeta": {
|
|
160
|
+
"@earendil-works/chord": {
|
|
161
|
+
"optional": true
|
|
162
|
+
},
|
|
163
|
+
"@earendil-works/pi-durable": {
|
|
164
|
+
"optional": true
|
|
165
|
+
}
|
|
166
|
+
},
|
|
133
167
|
"devDependencies": {
|
|
134
|
-
"@earendil-works/
|
|
135
|
-
"@earendil-works/pi-
|
|
136
|
-
"@earendil-works/pi-
|
|
137
|
-
"@earendil-works/pi-
|
|
168
|
+
"@earendil-works/chord": "1.0.0",
|
|
169
|
+
"@earendil-works/pi-durable": "1.0.0",
|
|
170
|
+
"@earendil-works/pi-ai": "1.0.0",
|
|
171
|
+
"@earendil-works/pi-agent-core": "1.0.0",
|
|
172
|
+
"@earendil-works/pi-coding-agent": "1.0.0",
|
|
173
|
+
"@earendil-works/pi-tui": "1.0.0",
|
|
138
174
|
"typebox": "1.3.27",
|
|
139
175
|
"@types/cross-spawn": "^6.0.6",
|
|
140
176
|
"@types/node": "^26.1.2",
|
|
@@ -8,7 +8,7 @@ import { fileURLToPath } from "node:url";
|
|
|
8
8
|
const root = fileURLToPath(new URL("../", import.meta.url));
|
|
9
9
|
const env = { ...process.env, BEND_NO_TELEMETRY: "1" };
|
|
10
10
|
const bend = process.env.BEND_BIN || "bend";
|
|
11
|
-
if (execFileSync(bend, ["version"], { encoding: "utf8", env }).trim() !== "bend 2.0.
|
|
11
|
+
if (execFileSync(bend, ["version"], { encoding: "utf8", env }).trim() !== "bend 2.0.35") throw new Error("Bend 2.0.35 required");
|
|
12
12
|
const inputs = JSON.parse(readFileSync(join(root, "src/verified/generated/manifest.json"), "utf8")).inputs;
|
|
13
13
|
const originals = Object.fromEntries(Object.keys(inputs).filter((path) => path.endsWith(".bend")).map((path) => [path, readFileSync(join(root, path), "utf8")]));
|
|
14
14
|
const mutations = [
|