@e4779/pi-fabric 0.131.4-fork.33 → 0.138.1-fork.1
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 +8 -0
- package/dist/actors/context.d.ts.map +1 -1
- package/dist/agents/clone-first-worktree.d.ts +2 -0
- package/dist/agents/clone-first-worktree.d.ts.map +1 -1
- package/dist/agents/completion-inbox.d.ts +2 -1
- package/dist/agents/completion-inbox.d.ts.map +1 -1
- package/dist/agents/handoff.d.ts.map +1 -1
- package/dist/agents/manager.d.ts.map +1 -1
- package/dist/agents/worktree-manager.d.ts +4 -1
- package/dist/agents/worktree-manager.d.ts.map +1 -1
- package/dist/agents/worktree-paths.d.ts +8 -3
- package/dist/agents/worktree-paths.d.ts.map +1 -1
- package/dist/agents.js +6 -1
- package/dist/agents.js.map +1 -1
- package/dist/async-settlement.d.ts +1 -1
- package/dist/async-settlement.d.ts.map +1 -1
- package/dist/audit/details.d.ts.map +1 -1
- package/dist/capture/catalog.d.ts +2 -0
- package/dist/capture/catalog.d.ts.map +1 -1
- package/dist/capture/interceptor.d.ts.map +1 -1
- package/dist/chunks/{chunk-7N7IC3Z2.js → chunk-2CD7HLVP.js} +3 -84
- package/dist/chunks/chunk-2CD7HLVP.js.map +7 -0
- package/dist/chunks/{chunk-7YNE4NB2.js → chunk-2MELFQCQ.js} +2 -2
- package/dist/chunks/{chunk-HSEZPCL5.js → chunk-2OC4YJOL.js} +3 -3
- package/dist/chunks/{chunk-TXCNZCZP.js → chunk-2QJ4MNS6.js} +2 -2
- package/dist/chunks/{chunk-F6A6MQ6G.js → chunk-2WPTD6BI.js} +11 -15
- package/dist/chunks/chunk-2WPTD6BI.js.map +7 -0
- package/dist/chunks/{chunk-QOEOKW2X.js → chunk-3QH6JAE3.js} +2 -2
- package/dist/chunks/chunk-4U47NCP2.js +88 -0
- package/dist/chunks/chunk-4U47NCP2.js.map +7 -0
- package/dist/chunks/{chunk-OJ4HAALD.js → chunk-5VZEAAHD.js} +10 -9
- package/dist/chunks/chunk-5VZEAAHD.js.map +7 -0
- package/dist/chunks/{chunk-LKYLD5SN.js → chunk-6HM4TX7L.js} +10 -8
- package/dist/chunks/chunk-6HM4TX7L.js.map +7 -0
- package/dist/chunks/{chunk-L6H46CPY.js → chunk-6NNL5LOG.js} +2 -2
- package/dist/chunks/{chunk-7TB7NXSL.js → chunk-7CIQQOOD.js} +11 -3
- package/dist/chunks/{chunk-7TB7NXSL.js.map → chunk-7CIQQOOD.js.map} +2 -2
- package/dist/chunks/{chunk-RWKQ5SRW.js → chunk-7ZFPVOV2.js} +2 -2
- package/dist/chunks/{chunk-PUBHBEYO.js → chunk-B2FIGOPI.js} +2 -2
- package/dist/chunks/{chunk-HRDMBGMY.js → chunk-BLT66VHH.js} +331 -22
- package/dist/chunks/chunk-BLT66VHH.js.map +7 -0
- package/dist/chunks/{chunk-4WKD3YM3.js → chunk-C3UPHOJW.js} +3 -3
- package/dist/chunks/{chunk-G2DZJ5LK.js → chunk-CB72SLHB.js} +451 -134
- package/dist/chunks/chunk-CB72SLHB.js.map +7 -0
- package/dist/chunks/{chunk-B5L3X3ID.js → chunk-CCJ6PUZJ.js} +1 -1
- package/dist/chunks/{chunk-B5L3X3ID.js.map → chunk-CCJ6PUZJ.js.map} +1 -1
- package/dist/chunks/{chunk-FK73YJKV.js → chunk-DWM63MAJ.js} +21 -9
- package/dist/chunks/chunk-DWM63MAJ.js.map +7 -0
- package/dist/chunks/{chunk-56NMRVTV.js → chunk-FFJ7TV66.js} +32 -29
- package/dist/chunks/chunk-FFJ7TV66.js.map +7 -0
- package/dist/chunks/{chunk-LRSZFYUC.js → chunk-FUMALXYQ.js} +15 -15
- package/dist/chunks/chunk-FUMALXYQ.js.map +7 -0
- package/dist/chunks/{chunk-TJZYM2SP.js → chunk-G3RQ3HUK.js} +8 -3
- package/dist/chunks/{chunk-TJZYM2SP.js.map → chunk-G3RQ3HUK.js.map} +2 -2
- package/dist/chunks/{chunk-RAA3FAYZ.js → chunk-GNPTDN6K.js} +2 -2
- package/dist/chunks/{chunk-XFOSUGLU.js → chunk-JCGEW5OQ.js} +5 -5
- package/dist/chunks/{chunk-CXYJJ3HZ.js → chunk-LJ2MG6U2.js} +3 -3
- package/dist/chunks/{chunk-3MOY6WIB.js → chunk-LRBDEAKB.js} +3 -3
- package/dist/chunks/{chunk-2RWNVCFD.js → chunk-MPFBOVOD.js} +1 -1
- package/dist/chunks/{chunk-2RWNVCFD.js.map → chunk-MPFBOVOD.js.map} +1 -1
- package/dist/chunks/{chunk-NQ7IWEIF.js → chunk-MQGRQMVM.js} +2 -2
- package/dist/chunks/{chunk-3VK6UGAN.js → chunk-O5SHIUIL.js} +6 -1
- package/dist/chunks/chunk-O5SHIUIL.js.map +7 -0
- package/dist/chunks/{chunk-U6Y6TKJL.js → chunk-OK2EKY3M.js} +15 -11
- package/dist/chunks/chunk-OK2EKY3M.js.map +7 -0
- package/dist/chunks/{chunk-DGUXJSYA.js → chunk-OR44GYXD.js} +70 -3
- package/dist/chunks/chunk-OR44GYXD.js.map +7 -0
- package/dist/chunks/{chunk-DGERP4VL.js → chunk-P4TALNLX.js} +11 -10
- package/dist/chunks/chunk-P4TALNLX.js.map +7 -0
- package/dist/chunks/{chunk-4BYS4ZLY.js → chunk-PHGPOSCP.js} +267 -71
- package/dist/chunks/chunk-PHGPOSCP.js.map +7 -0
- package/dist/chunks/{chunk-3XT5WHSG.js → chunk-QAGEWWCJ.js} +260 -59
- package/dist/chunks/chunk-QAGEWWCJ.js.map +7 -0
- package/dist/chunks/{chunk-WKFRGICG.js → chunk-RBYRHS24.js} +2 -2
- package/dist/chunks/{chunk-ZHROHNEE.js → chunk-RFNYH7S7.js} +8 -8
- package/dist/chunks/{chunk-VGRUWTMG.js → chunk-RPZJVLML.js} +472 -466
- package/dist/chunks/chunk-RPZJVLML.js.map +7 -0
- package/dist/chunks/{chunk-H57KPL3V.js → chunk-S2JWFXW5.js} +2 -2
- package/dist/chunks/{chunk-LZ2ZXOCU.js → chunk-SSB2JN3I.js} +168 -5
- package/dist/chunks/chunk-SSB2JN3I.js.map +7 -0
- package/dist/chunks/{chunk-RKJPBTBB.js → chunk-SVQ7ZHEQ.js} +33 -16
- package/dist/chunks/chunk-SVQ7ZHEQ.js.map +7 -0
- package/dist/chunks/{chunk-MPMEK3IQ.js → chunk-TV5NCPPS.js} +6 -5
- package/dist/chunks/chunk-TV5NCPPS.js.map +7 -0
- package/dist/chunks/{chunk-XOBLUZMB.js → chunk-UIVMSMSQ.js} +10 -1
- package/dist/chunks/chunk-UIVMSMSQ.js.map +7 -0
- package/dist/chunks/{chunk-QGTD3LAZ.js → chunk-UYS5VZUU.js} +9 -3
- package/dist/chunks/chunk-UYS5VZUU.js.map +7 -0
- package/dist/chunks/{chunk-HRVYXRWZ.js → chunk-V5RZK45W.js} +37 -3
- package/dist/chunks/chunk-V5RZK45W.js.map +7 -0
- package/dist/chunks/{chunk-KIFOEBYJ.js → chunk-VEXCD3RA.js} +2 -2
- package/dist/chunks/{chunk-GS67KDMV.js → chunk-VN7AE3EY.js} +2 -2
- package/dist/chunks/{chunk-HFDJWLMS.js → chunk-WFGJUVTH.js} +106 -65
- package/dist/chunks/chunk-WFGJUVTH.js.map +7 -0
- package/dist/chunks/chunk-WMULZZER.js +196 -0
- package/dist/chunks/chunk-WMULZZER.js.map +7 -0
- package/dist/chunks/{chunk-QNMQJNXE.js → chunk-X4HDI7RT.js} +14 -4
- package/dist/chunks/chunk-X4HDI7RT.js.map +7 -0
- package/dist/chunks/{chunk-MX53BRAC.js → chunk-XBAOTA4U.js} +2 -2
- package/dist/chunks/{chunk-MSDL7U6Q.js → chunk-XQCNVH3Y.js} +4 -4
- package/dist/chunks/{chunk-4PBW54I2.js → chunk-YC6NV7FK.js} +88 -54
- package/dist/chunks/chunk-YC6NV7FK.js.map +7 -0
- package/dist/chunks/{chunk-6GWDGTHC.js → chunk-YLO62DWD.js} +4 -4
- package/dist/cli/decisions.js +2 -2
- package/dist/cli/mesh.js +3 -3
- package/dist/commands/fabric-handler.d.ts.map +1 -1
- package/dist/commands/fabric-handler.js +18 -4
- package/dist/commands/fabric-handler.js.map +2 -2
- package/dist/commands/fabric.d.ts.map +1 -1
- package/dist/compaction/branch-summary.d.ts.map +1 -1
- package/dist/compaction/claim-events.js +9 -9
- package/dist/compaction/hook.d.ts.map +1 -1
- package/dist/compaction/hook.js +6 -6
- package/dist/compaction/normalize.d.ts +9 -0
- package/dist/compaction/normalize.d.ts.map +1 -1
- package/dist/compaction/owner.js +7 -7
- package/dist/compaction/projections.d.ts +18 -2
- package/dist/compaction/projections.d.ts.map +1 -1
- package/dist/compaction/qa.d.ts +3 -2
- package/dist/compaction/qa.d.ts.map +1 -1
- package/dist/compaction/render.d.ts +3 -0
- package/dist/compaction/render.d.ts.map +1 -1
- package/dist/compaction/threshold.d.ts.map +1 -1
- package/dist/compaction/user-activity.d.ts +31 -0
- package/dist/compaction/user-activity.d.ts.map +1 -0
- package/dist/components/configuration.js +4 -4
- package/dist/config.d.ts +13 -6
- package/dist/config.d.ts.map +1 -1
- package/dist/core/action-registry.d.ts +1 -1
- package/dist/core/action-registry.d.ts.map +1 -1
- package/dist/core/action-registry.js +10 -9
- package/dist/core/approval-controller.d.ts +3 -0
- package/dist/core/approval-controller.d.ts.map +1 -1
- package/dist/core/atomic-write.d.ts +1 -0
- package/dist/core/atomic-write.d.ts.map +1 -1
- package/dist/core/attached-monitors.d.ts +39 -0
- package/dist/core/attached-monitors.d.ts.map +1 -0
- package/dist/core/control-abort.d.ts +3 -0
- package/dist/core/control-abort.d.ts.map +1 -0
- package/dist/core/crash-guard.d.ts +15 -0
- package/dist/core/crash-guard.d.ts.map +1 -0
- package/dist/core/execution-guidelines.d.ts +6 -0
- package/dist/core/execution-guidelines.d.ts.map +1 -0
- package/dist/core/guidance-delivery.d.ts +19 -0
- package/dist/core/guidance-delivery.d.ts.map +1 -0
- package/dist/core/lifecycle-settlement.d.ts +9 -0
- package/dist/core/lifecycle-settlement.d.ts.map +1 -0
- package/dist/core/observation-actions.d.ts +9 -0
- package/dist/core/observation-actions.d.ts.map +1 -0
- package/dist/core/pasted-images.d.ts +12 -0
- package/dist/core/pasted-images.d.ts.map +1 -0
- package/dist/core/pasted-images.js +139 -0
- package/dist/core/pasted-images.js.map +7 -0
- package/dist/core/permission-queue.d.ts +32 -0
- package/dist/core/permission-queue.d.ts.map +1 -0
- package/dist/core/permission-queue.js +104 -0
- package/dist/core/permission-queue.js.map +7 -0
- package/dist/core/prompt-guidance.d.ts +1 -0
- package/dist/core/prompt-guidance.d.ts.map +1 -1
- package/dist/core/prompt-guidance.js +52 -3
- package/dist/core/prompt-guidance.js.map +3 -3
- package/dist/core/provider-operations.js +1 -1
- package/dist/core/shell-inbox.d.ts +1 -1
- package/dist/core/shell-inbox.d.ts.map +1 -1
- package/dist/core/shell-jobs.d.ts +28 -1
- package/dist/core/shell-jobs.d.ts.map +1 -1
- package/dist/core/shell-monitor.d.ts +1 -0
- package/dist/core/shell-monitor.d.ts.map +1 -1
- package/dist/durable/worker.js +0 -42
- package/dist/durable/worker.js.map +3 -3
- package/dist/durable-extension.d.ts +2 -2
- package/dist/durable-extension.d.ts.map +1 -1
- package/dist/durable-extension.js +215 -1
- package/dist/durable-extension.js.map +3 -3
- package/dist/entropy/index.d.ts +2 -0
- package/dist/entropy/index.d.ts.map +1 -1
- package/dist/entropy/index.js +23 -13
- package/dist/entropy/pool-store.d.ts +8 -1
- package/dist/entropy/pool-store.d.ts.map +1 -1
- package/dist/entropy/pool-worker.d.ts +18 -0
- package/dist/entropy/pool-worker.d.ts.map +1 -0
- package/dist/entropy/pool-writer.d.ts +23 -0
- package/dist/entropy/pool-writer.d.ts.map +1 -0
- package/dist/entropy/pool.d.ts +11 -0
- package/dist/entropy/pool.d.ts.map +1 -1
- package/dist/entropy/sessions.d.ts +5 -0
- package/dist/entropy/sessions.d.ts.map +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 +19 -19
- 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.map +1 -1
- package/dist/fabric-runtime-state.js +534 -261
- package/dist/fabric-runtime-state.js.map +4 -4
- package/dist/fabric-state.d.ts.map +1 -1
- package/dist/index.js +40 -30
- package/dist/index.js.map +1 -1
- package/dist/jev/client.js +2 -2
- package/dist/jev/observation.js +7 -6
- package/dist/jev.js +12 -11
- package/dist/main-agent.d.ts.map +1 -1
- package/dist/managed-host.d.ts +4 -0
- package/dist/managed-host.d.ts.map +1 -1
- package/dist/memory/discovery.js +6 -6
- package/dist/memory/expand-service.d.ts.map +1 -1
- package/dist/memory/file-worker.js +9 -8
- package/dist/memory/file-worker.js.map +1 -1
- package/dist/memory/history-paging.d.ts +9 -0
- package/dist/memory/history-paging.d.ts.map +1 -0
- package/dist/memory/history-paging.js +164 -0
- package/dist/memory/history-paging.js.map +7 -0
- package/dist/memory/index.d.ts.map +1 -1
- package/dist/memory/normalize.js +5 -5
- package/dist/memory/outline-service.d.ts +7 -0
- package/dist/memory/outline-service.d.ts.map +1 -0
- package/dist/memory/request-cache.d.ts +3 -1
- package/dist/memory/request-cache.d.ts.map +1 -1
- package/dist/memory/request-context.d.ts +1 -0
- package/dist/memory/request-context.d.ts.map +1 -1
- package/dist/memory/request-limits.d.ts +2 -0
- package/dist/memory/request-limits.d.ts.map +1 -1
- package/dist/memory/search.js +7 -6
- package/dist/memory/worker-provider.d.ts.map +1 -1
- package/dist/memory/worker-provider.js +10 -9
- package/dist/memory.d.ts +16 -1
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +64 -12
- package/dist/memory.js.map +1 -1
- package/dist/mesh/store.d.ts +2 -1
- package/dist/mesh/store.d.ts.map +1 -1
- package/dist/programs/host.js +2 -2
- package/dist/protocol.d.ts +5 -0
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js +1 -1
- package/dist/providers/agents-actions.d.ts.map +1 -1
- package/dist/providers/agents-message-router.d.ts +1 -0
- package/dist/providers/agents-message-router.d.ts.map +1 -1
- package/dist/providers/agents-provider.d.ts +2 -0
- package/dist/providers/agents-provider.d.ts.map +1 -1
- package/dist/providers/jev-provider.js +12 -11
- package/dist/providers/memory-provider.d.ts +4 -0
- package/dist/providers/memory-provider.d.ts.map +1 -1
- package/dist/providers/memory-provider.js +9 -8
- package/dist/providers/pi-read-operations.d.ts +24 -0
- package/dist/providers/pi-read-operations.d.ts.map +1 -0
- package/dist/providers/pi-tools-provider.d.ts +7 -0
- package/dist/providers/pi-tools-provider.d.ts.map +1 -1
- package/dist/providers/sessions-provider.d.ts +1 -1
- package/dist/providers/sessions-provider.d.ts.map +1 -1
- package/dist/providers/tasks-provider.d.ts +3 -1
- package/dist/providers/tasks-provider.d.ts.map +1 -1
- package/dist/residency/actor-client.js +3 -3
- package/dist/residency/client.d.ts.map +1 -1
- package/dist/residency/host.d.ts.map +1 -1
- package/dist/residency/host.js +17 -16
- package/dist/residency/launcher.js +1 -1
- package/dist/residency/pi-entry.js +17 -16
- package/dist/residency/pi-entry.js.map +1 -1
- package/dist/residency/protocol.d.ts +2 -0
- package/dist/residency/protocol.d.ts.map +1 -1
- package/dist/runtime/core-override-guest-types.js +2 -2
- package/dist/runtime/cpython-runtime.d.ts.map +1 -1
- package/dist/runtime/cpython-runtime.js +7 -6
- package/dist/runtime/cpython-runtime.js.map +2 -2
- 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.d.ts.map +1 -1
- package/dist/runtime/monty-runtime.js +7 -6
- 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 +6 -6
- package/dist/runtime/quickjs-runtime.d.ts.map +1 -1
- package/dist/runtime/quickjs-runtime.js +4 -4
- package/dist/runtime/type-checker.d.ts.map +1 -1
- package/dist/runtime/type-checker.js +1 -1
- package/dist/runtime/typescript-kernel.js +10 -10
- package/dist/runtime-state-builtins.d.ts +2 -0
- package/dist/runtime-state-builtins.d.ts.map +1 -1
- package/dist/schema/policy.d.ts.map +1 -1
- package/dist/speculation/eligibility.d.ts.map +1 -1
- package/dist/speculation/store.d.ts.map +1 -1
- package/dist/topology/participant-directory.d.ts +1 -0
- package/dist/topology/participant-directory.d.ts.map +1 -1
- package/dist/topology/peer-presence.d.ts.map +1 -1
- package/dist/topology/provider-participants.d.ts +1 -0
- package/dist/topology/provider-participants.d.ts.map +1 -1
- package/dist/type-error-guidance.js +1 -1
- package/dist/ui/code-preview-shell.d.ts +1 -0
- package/dist/ui/code-preview-shell.d.ts.map +1 -1
- package/dist/ui/controller.d.ts.map +1 -1
- package/dist/ui/conversation-chrome.d.ts.map +1 -1
- package/dist/ui/conversation-chrome.js +2 -2
- package/dist/ui/conversation-feedback.d.ts +8 -0
- package/dist/ui/conversation-feedback.d.ts.map +1 -0
- package/dist/ui/conversation-latest.d.ts.map +1 -1
- package/dist/ui/conversation-native-reader.d.ts.map +1 -1
- package/dist/ui/conversation-native-reader.js +3 -3
- package/dist/ui/conversation-native-reader.js.map +2 -2
- package/dist/ui/conversation-render.d.ts.map +1 -1
- package/dist/ui/conversation.d.ts +1 -0
- package/dist/ui/conversation.d.ts.map +1 -1
- package/dist/ui/conversation.js +139 -86
- package/dist/ui/conversation.js.map +4 -4
- package/dist/ui/core-tool-render.d.ts.map +1 -1
- package/dist/ui/dashboard-fabric-graph.d.ts.map +1 -1
- package/dist/ui/dashboard.js +47 -48
- package/dist/ui/dashboard.js.map +3 -3
- package/dist/ui/fabric-render.d.ts.map +1 -1
- package/dist/ui/format.d.ts.map +1 -1
- package/dist/ui/highlight.d.ts.map +1 -1
- package/dist/ui/permissions.d.ts +18 -0
- package/dist/ui/permissions.d.ts.map +1 -0
- package/dist/ui/permissions.js +178 -0
- package/dist/ui/permissions.js.map +7 -0
- package/dist/ui/row-balance.d.ts +1 -1
- package/dist/ui/row-balance.d.ts.map +1 -1
- package/dist/ui/settings-sections-execution.d.ts.map +1 -1
- package/dist/ui/settings-values.d.ts.map +1 -1
- package/dist/ui/settings.js +37 -31
- package/dist/ui/settings.js.map +2 -2
- package/dist/ui/shell-hang-keys.d.ts.map +1 -1
- package/dist/ui/shell-tasks.d.ts.map +1 -1
- package/dist/ui/shell-tasks.js +28 -11
- package/dist/ui/shell-tasks.js.map +2 -2
- package/dist/ui/structured.d.ts.map +1 -1
- package/dist/ui/tool-display.d.ts +18 -2
- package/dist/ui/tool-display.d.ts.map +1 -1
- package/dist/ui/truncate.d.ts +3 -0
- package/dist/ui/truncate.d.ts.map +1 -0
- package/dist/ui/widget.d.ts +7 -2
- package/dist/ui/widget.d.ts.map +1 -1
- package/dist/verified/context.d.ts +35 -0
- package/dist/verified/context.d.ts.map +1 -0
- package/dist/verified/execution.d.ts +7 -0
- package/dist/verified/execution.d.ts.map +1 -0
- package/dist/verified/generated/context.d.ts +6 -0
- package/dist/verified/generated/context.js +51 -0
- package/dist/verified/generated/execution.d.ts +5 -0
- package/dist/verified/generated/execution.js +32 -0
- package/dist/verified/generated/manifest.json +34 -3
- package/dist/verified/generated/prompt-guidance.d.ts +4 -0
- package/dist/verified/generated/prompt-guidance.js +17 -0
- package/dist/worker/recovery-watchdog.d.ts +7 -0
- package/dist/worker/recovery-watchdog.d.ts.map +1 -1
- package/dist/worker/recovery-watchdog.js +66 -4
- package/dist/worker/recovery-watchdog.js.map +2 -2
- package/dist/worker.js +22 -3
- package/dist/worker.js.map +2 -2
- package/docs/agents.md +37 -4
- package/docs/architecture.md +13 -0
- package/docs/background-tasks.md +81 -5
- package/docs/benchmarks/cli-resume-2026-11-09.json +1260 -0
- package/docs/benchmarks/interactivity-2026-11-09.json +2280 -0
- package/docs/benchmarks/resume-latency-2026-11-09.json +12105 -0
- package/docs/benchmarks/resume-startup-fix-2026-11-09.json +5452 -0
- package/docs/benchmarks/session-memory-2026-11-09.json +1320 -0
- package/docs/benchmarks/session-memory-fix-2026-11-09.json +280 -0
- package/docs/compaction.md +59 -23
- package/docs/configuration.md +53 -11
- package/docs/entropy.md +4 -1
- package/docs/history-paging.md +99 -0
- package/docs/interactivity-investigation.md +109 -0
- package/docs/interface.md +2 -2
- package/docs/jev.md +1 -1
- package/docs/memory-recall.md +42 -1
- package/docs/providers.md +24 -1
- package/docs/resume-latency-investigation.md +249 -0
- package/docs/session-memory-investigation.md +223 -0
- package/docs/verified-kernels.md +56 -0
- package/package.json +211 -211
- package/proofs/context.ts +139 -0
- package/proofs/execution.ts +48 -0
- package/proofs/index.ts +6 -0
- package/proofs/prompt-guidance.ts +38 -0
- package/scripts/verified-kernels.ts +1 -1
- package/skillsets/python/fabric-council/SKILL.md +31 -21
- package/skillsets/python/fabric-exec/SKILL.md +1 -1
- package/skillsets/python/fabric-exec/references/agents.md +2 -0
- package/skillsets/python/fabric-guide/SKILL.md +1 -0
- package/skillsets/python/fabric-memory/SKILL.md +82 -0
- package/skillsets/typescript/fabric-council/SKILL.md +26 -17
- package/skillsets/typescript/fabric-exec/SKILL.md +3 -2
- package/skillsets/typescript/fabric-exec/references/agents.md +1 -0
- package/skillsets/typescript/fabric-guide/SKILL.md +1 -0
- package/skillsets/typescript/fabric-memory/SKILL.md +87 -0
- package/dist/chunks/chunk-3VK6UGAN.js.map +0 -7
- package/dist/chunks/chunk-3XT5WHSG.js.map +0 -7
- package/dist/chunks/chunk-4BYS4ZLY.js.map +0 -7
- package/dist/chunks/chunk-4PBW54I2.js.map +0 -7
- package/dist/chunks/chunk-56NMRVTV.js.map +0 -7
- package/dist/chunks/chunk-7N7IC3Z2.js.map +0 -7
- package/dist/chunks/chunk-DGERP4VL.js.map +0 -7
- package/dist/chunks/chunk-DGUXJSYA.js.map +0 -7
- package/dist/chunks/chunk-F6A6MQ6G.js.map +0 -7
- package/dist/chunks/chunk-FK73YJKV.js.map +0 -7
- package/dist/chunks/chunk-G2DZJ5LK.js.map +0 -7
- package/dist/chunks/chunk-HFDJWLMS.js.map +0 -7
- package/dist/chunks/chunk-HRDMBGMY.js.map +0 -7
- package/dist/chunks/chunk-HRVYXRWZ.js.map +0 -7
- package/dist/chunks/chunk-LKYLD5SN.js.map +0 -7
- package/dist/chunks/chunk-LRSZFYUC.js.map +0 -7
- package/dist/chunks/chunk-LZ2ZXOCU.js.map +0 -7
- package/dist/chunks/chunk-MPMEK3IQ.js.map +0 -7
- package/dist/chunks/chunk-OJ4HAALD.js.map +0 -7
- package/dist/chunks/chunk-QGTD3LAZ.js.map +0 -7
- package/dist/chunks/chunk-QNMQJNXE.js.map +0 -7
- package/dist/chunks/chunk-RKJPBTBB.js.map +0 -7
- package/dist/chunks/chunk-U6Y6TKJL.js.map +0 -7
- package/dist/chunks/chunk-VGRUWTMG.js.map +0 -7
- package/dist/chunks/chunk-XOBLUZMB.js.map +0 -7
- package/dist/durable/openai-sse-patch.d.ts +0 -21
- package/dist/durable/openai-sse-patch.d.ts.map +0 -1
- /package/dist/chunks/{chunk-7YNE4NB2.js.map → chunk-2MELFQCQ.js.map} +0 -0
- /package/dist/chunks/{chunk-HSEZPCL5.js.map → chunk-2OC4YJOL.js.map} +0 -0
- /package/dist/chunks/{chunk-TXCNZCZP.js.map → chunk-2QJ4MNS6.js.map} +0 -0
- /package/dist/chunks/{chunk-QOEOKW2X.js.map → chunk-3QH6JAE3.js.map} +0 -0
- /package/dist/chunks/{chunk-L6H46CPY.js.map → chunk-6NNL5LOG.js.map} +0 -0
- /package/dist/chunks/{chunk-RWKQ5SRW.js.map → chunk-7ZFPVOV2.js.map} +0 -0
- /package/dist/chunks/{chunk-PUBHBEYO.js.map → chunk-B2FIGOPI.js.map} +0 -0
- /package/dist/chunks/{chunk-4WKD3YM3.js.map → chunk-C3UPHOJW.js.map} +0 -0
- /package/dist/chunks/{chunk-RAA3FAYZ.js.map → chunk-GNPTDN6K.js.map} +0 -0
- /package/dist/chunks/{chunk-XFOSUGLU.js.map → chunk-JCGEW5OQ.js.map} +0 -0
- /package/dist/chunks/{chunk-CXYJJ3HZ.js.map → chunk-LJ2MG6U2.js.map} +0 -0
- /package/dist/chunks/{chunk-3MOY6WIB.js.map → chunk-LRBDEAKB.js.map} +0 -0
- /package/dist/chunks/{chunk-NQ7IWEIF.js.map → chunk-MQGRQMVM.js.map} +0 -0
- /package/dist/chunks/{chunk-WKFRGICG.js.map → chunk-RBYRHS24.js.map} +0 -0
- /package/dist/chunks/{chunk-ZHROHNEE.js.map → chunk-RFNYH7S7.js.map} +0 -0
- /package/dist/chunks/{chunk-H57KPL3V.js.map → chunk-S2JWFXW5.js.map} +0 -0
- /package/dist/chunks/{chunk-KIFOEBYJ.js.map → chunk-VEXCD3RA.js.map} +0 -0
- /package/dist/chunks/{chunk-GS67KDMV.js.map → chunk-VN7AE3EY.js.map} +0 -0
- /package/dist/chunks/{chunk-MX53BRAC.js.map → chunk-XBAOTA4U.js.map} +0 -0
- /package/dist/chunks/{chunk-MSDL7U6Q.js.map → chunk-XQCNVH3Y.js.map} +0 -0
- /package/dist/chunks/{chunk-6GWDGTHC.js.map → chunk-YLO62DWD.js.map} +0 -0
package/proofs/index.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
// The registered kernels. Each module is proved, refused in every broken
|
|
2
2
|
// variant, cross-checked against its builders, and compiled to
|
|
3
3
|
// `src/verified/generated/<module>.js`.
|
|
4
|
+
import { promptGuidanceKernels, PROMPT_GUIDANCE_BUGS } from "./prompt-guidance.js";
|
|
4
5
|
import { actorNameKernels, ACTOR_NAME_BUGS } from "./actor-name.js";
|
|
5
6
|
import { authorityKernels, AUTHORITY_BUGS } from "./authority.js";
|
|
6
7
|
import { compactionKernels, CUT_BUGS } from "./compaction.js";
|
|
8
|
+
import { contextKernels, CONTEXT_BUGS } from "./context.js";
|
|
7
9
|
import { budgetKernels, BUDGET_BUGS } from "./budget.js";
|
|
10
|
+
import { executionKernels, EXECUTION_BUGS } from "./execution.js";
|
|
8
11
|
import { grantKernels, GRANT_BUGS } from "./grants.js";
|
|
9
12
|
import { speculationKernels, SPECULATION_BUGS } from "./speculation.js";
|
|
10
13
|
import type { Kernel } from "./kernel.js";
|
|
@@ -28,6 +31,7 @@ export interface KernelModule {
|
|
|
28
31
|
export const modules: readonly KernelModule[] = [
|
|
29
32
|
{ stem: "policy", source: "proofs/policy.ts", kernels: policyKernels as any, bugs: POLICY_BUGS },
|
|
30
33
|
{ stem: "compaction", source: "proofs/compaction.ts", kernels: compactionKernels as any, bugs: CUT_BUGS },
|
|
34
|
+
{ stem: "context", source: "proofs/context.ts", kernels: contextKernels as any, bugs: CONTEXT_BUGS },
|
|
31
35
|
{ stem: "resources", source: "proofs/resources.ts", kernels: resourceKernels as any, bugs: RESOURCE_BUGS },
|
|
32
36
|
{ stem: "lifecycle", source: "proofs/lifecycle.ts", kernels: lifecycleKernels as any, bugs: LIFECYCLE_BUGS },
|
|
33
37
|
{ stem: "storage", source: "proofs/storage.ts", kernels: storageKernels as any, bugs: STORAGE_BUGS },
|
|
@@ -37,4 +41,6 @@ export const modules: readonly KernelModule[] = [
|
|
|
37
41
|
{ stem: "speculation", source: "proofs/speculation.ts", kernels: speculationKernels as any, bugs: SPECULATION_BUGS },
|
|
38
42
|
{ stem: "actor-name", source: "proofs/actor-name.ts", kernels: actorNameKernels as any, bugs: ACTOR_NAME_BUGS },
|
|
39
43
|
{ stem: "budget", source: "proofs/budget.ts", kernels: budgetKernels as any, bugs: BUDGET_BUGS },
|
|
44
|
+
{ stem: "execution", source: "proofs/execution.ts", kernels: executionKernels as any, bugs: EXECUTION_BUGS },
|
|
45
|
+
{ stem: "prompt-guidance", source: "proofs/prompt-guidance.ts", kernels: promptGuidanceKernels as any, bugs: PROMPT_GUIDANCE_BUGS },
|
|
40
46
|
];
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// Provider-neutral routing: a provider may discard Pi's generated rules but
|
|
2
|
+
// preserve named sections or an explicitly appended prompt. No text semantics
|
|
3
|
+
// are assumed here; the adapter tests pin the exact strings and host behavior.
|
|
4
|
+
import { bool, fun } from "gdp-wired";
|
|
5
|
+
import type { Kernel } from "./kernel.js";
|
|
6
|
+
|
|
7
|
+
type PromptGuidanceBug = "drop portable rules" | "duplicate delivery" | "ignore forced prompt" | "inject while inactive" | "keep duplicate native rules";
|
|
8
|
+
|
|
9
|
+
const decision = (bug?: PromptGuidanceBug) => fun("portable prompt guidance")
|
|
10
|
+
.inputs({ active: bool, sections: bool, forced: bool })
|
|
11
|
+
.returns(({ active, sections, forced }) => ({
|
|
12
|
+
section: bug === "drop portable rules" ? active.and(active.not())
|
|
13
|
+
: bug === "inject while inactive" ? sections.and(forced.not())
|
|
14
|
+
: bug === "ignore forced prompt" ? active.and(sections)
|
|
15
|
+
: active.and(sections, forced.not()),
|
|
16
|
+
append: bug === "duplicate delivery" ? active
|
|
17
|
+
: bug === "drop portable rules" ? active.and(active.not())
|
|
18
|
+
: bug === "ignore forced prompt" ? active.and(sections.not())
|
|
19
|
+
: active.and(sections.not().or(forced)),
|
|
20
|
+
native: bug === "keep duplicate native rules" ? active.or(active.not()) : active.not(),
|
|
21
|
+
}));
|
|
22
|
+
|
|
23
|
+
export const promptGuidanceKernels = (bug?: PromptGuidanceBug): Kernel[] => {
|
|
24
|
+
const f = decision(bug);
|
|
25
|
+
return [{ id: "promptGuidance", fun: f, decisions: [
|
|
26
|
+
f.law("active guidance has exactly one portable destination and no duplicate native rules",
|
|
27
|
+
({ active }) => active, (o) => o.section.or(o.append).and(o.section.and(o.append).not(), o.native.not())),
|
|
28
|
+
f.law("inactive guidance keeps native ownership and injects nothing",
|
|
29
|
+
({ active }) => active.not(), (o) => o.native.and(o.section.not(), o.append.not())),
|
|
30
|
+
f.law("an unforced structured prompt carries guidance in its section",
|
|
31
|
+
({ active, sections, forced }) => active.and(sections, forced.not()), (o) => o.section.and(o.append.not())),
|
|
32
|
+
f.law("a forced or legacy prompt carries guidance in its append",
|
|
33
|
+
({ active, sections, forced }) => active.and(sections.not().or(forced)), (o) => o.append.and(o.section.not())),
|
|
34
|
+
] }];
|
|
35
|
+
};
|
|
36
|
+
export const PROMPT_GUIDANCE_BUGS: PromptGuidanceBug[] = [
|
|
37
|
+
"drop portable rules", "duplicate delivery", "ignore forced prompt", "inject while inactive", "keep duplicate native rules",
|
|
38
|
+
];
|
|
@@ -13,7 +13,7 @@ const root = fileURLToPath(new URL("../", import.meta.url));
|
|
|
13
13
|
const read = (path: string): string => readFileSync(resolve(root, path), "utf8");
|
|
14
14
|
const hash = (text: string): string => createHash("sha256").update(text).digest("hex");
|
|
15
15
|
const receipt = "src/verified/generated/manifest.json";
|
|
16
|
-
const stems = ["policy", "compaction", "resources", "lifecycle", "storage", "provider", "authority", "grants", "speculation", "budget", "actor-name"];
|
|
16
|
+
const stems = ["policy", "compaction", "context", "resources", "lifecycle", "storage", "provider", "authority", "grants", "speculation", "budget", "execution", "actor-name", "prompt-guidance"];
|
|
17
17
|
const sources = ["proofs/index.ts", "proofs/kernel.ts", ...stems.map((stem) => `proofs/${stem}.ts`), "scripts/verified-kernels.ts", "scripts/verified-kernel-pool.ts", "scripts/verified-kernel-worker.ts"];
|
|
18
18
|
const artifacts = stems.flatMap((stem) => [`src/verified/generated/${stem}.js`, `src/verified/generated/${stem}.d.ts`]);
|
|
19
19
|
const pinned = (): string => {
|
|
@@ -6,22 +6,21 @@ disable-model-invocation: true
|
|
|
6
6
|
|
|
7
7
|
# Fabric Council — Python
|
|
8
8
|
|
|
9
|
-
Use one Python `fabric_exec`. Pass `payloads.task`, a JSON array in `payloads.roles`, and a synthesis model key in `payloads.synthesis`; an empty `payloads.synthesis` keeps the session default. Choose 3–8 distinct non-empty roles with useful disagreements, not redundant reviewers. A role is a string or an object with `role` and optional `model` and `thinking`; a role without `model` runs on the session default. Label the outer `display` and every child.
|
|
9
|
+
Use one Python `fabric_exec`. Pass `payloads.task`, a JSON array in `payloads.roles`, and a synthesis model key in `payloads.synthesis`; an empty `payloads.synthesis` keeps the session default. Choose 3–8 distinct non-empty roles with useful disagreements, not redundant reviewers. A role is a string or an object with `role` and optional `model` and `thinking`; a role without `model` runs on the session default. Label the outer `display` and every child. Use this template only for non-sensitive work: full reports are persisted in project-shared mesh, not private session storage. Do not supply credentials, secrets, or other material that must not be shared with other project sessions; use a plain agent without mesh parking for that work. Report secret locations and remediation, never secret values. This template does not automatically sanitize reports.
|
|
10
10
|
|
|
11
11
|
```python
|
|
12
12
|
import asyncio
|
|
13
13
|
import json
|
|
14
|
-
import uuid
|
|
15
|
-
from datetime import datetime, timezone
|
|
16
14
|
|
|
17
|
-
async def ask(task, name, options=None):
|
|
15
|
+
async def ask(task, name, options=None, include_id=False):
|
|
18
16
|
request = {"task": task, "name": name, "tools": ["read", "grep", "find", "ls"]}
|
|
19
17
|
if options:
|
|
20
18
|
request.update(options)
|
|
21
19
|
result = await agents.run(request)
|
|
22
20
|
if result["status"] != "completed":
|
|
23
21
|
raise RuntimeError(result.get("error") or result["status"])
|
|
24
|
-
|
|
22
|
+
report = result["value"] if result.get("value") is not None else result["text"]
|
|
23
|
+
return {"report": report, "runId": result["id"]} if include_id else report
|
|
25
24
|
|
|
26
25
|
def text(value):
|
|
27
26
|
return value.strip() if isinstance(value, str) else ""
|
|
@@ -85,8 +84,8 @@ async def review(seat):
|
|
|
85
84
|
if seat.get("thinking"):
|
|
86
85
|
options["thinking"] = seat["thinking"]
|
|
87
86
|
try:
|
|
88
|
-
report = await ask("Act as the " + seat["role"] + " council member. Independently analyze:\n" + π.task, seat["role"], options)
|
|
89
|
-
outcome.update({"status": "completed",
|
|
87
|
+
report = await ask("Act as the " + seat["role"] + " council member. Independently analyze. Reports are persisted in project-shared mesh: never reproduce credentials, secret values, or private data; describe locations and remediation instead:\n" + π.task, seat["role"], options, include_id=True)
|
|
88
|
+
outcome.update({"status": "completed", **report})
|
|
90
89
|
except Exception as error:
|
|
91
90
|
outcome.update({"status": "failed", "error": str(error)})
|
|
92
91
|
return outcome
|
|
@@ -103,19 +102,30 @@ if not completed:
|
|
|
103
102
|
return dict(summary, status="failed", failures=failures, result=None)
|
|
104
103
|
# Park completed reports in mesh before synthesis: an audit trail that survives this
|
|
105
104
|
# program, and full-text recovery when synthesis fails or a budget runs out.
|
|
106
|
-
#
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
105
|
+
# Use a host-assigned completed agent run ID: Monty has no native clock.
|
|
106
|
+
# ifVersion=0 keeps retries create-only instead of overwriting prior reports.
|
|
107
|
+
_parked = [
|
|
108
|
+
{"role": item.get("role"), **({"model": item["model"]} if item.get("model") else {}), "report": item["report"]}
|
|
109
|
+
for item in completed
|
|
110
|
+
]
|
|
111
|
+
reports = None
|
|
112
|
+
_park_error = None
|
|
113
|
+
_reports_base = "council/" + completed[0]["runId"]
|
|
114
|
+
for _attempt in range(4):
|
|
115
|
+
_suffix = "" if _attempt == 0 else "-" + str(_attempt + 1)
|
|
116
|
+
reports_key = _reports_base + _suffix + "/reports"
|
|
117
|
+
try:
|
|
118
|
+
await mesh.put(key=reports_key, value=_parked, ifVersion=0)
|
|
119
|
+
reports = reports_key
|
|
120
|
+
break
|
|
121
|
+
except Exception as error:
|
|
122
|
+
_park_error = error
|
|
123
|
+
# Only a key collision retries with the next suffix; any other
|
|
124
|
+
# storage failure surfaces immediately as the {"error": ...} object.
|
|
125
|
+
if "compare-and-swap" not in str(error):
|
|
126
|
+
break
|
|
127
|
+
if reports is None:
|
|
128
|
+
reports = {"error": str(_park_error)}
|
|
119
129
|
if len(completed) == 1:
|
|
120
130
|
return dict(summary, status="partial", failures=failures, result=completed[0]["report"], reports=reports, synthesisSkipped="Only one role completed; another agent adds no diversity.")
|
|
121
131
|
try:
|
|
@@ -125,4 +135,4 @@ except Exception as error:
|
|
|
125
135
|
return dict(summary, status="partial", failures=failures, result=None, synthesisError=str(error), reports=reports, fallback=[{"role": item.get("role"), "status": "completed", "report": item["report"] if isinstance(reports, dict) else item["report"][:1200]} for item in completed])
|
|
126
136
|
```
|
|
127
137
|
|
|
128
|
-
Reserve at least the role count plus one agent call. Concurrency remains host-limited; usage settles afterward, not as a hard token reservation. Model keys must match a Pi registry key from `tools.models()` exactly, ignoring case; the program refuses a `models.aliases` name or a partial id, and checks every key before any agent runs. Whenever at least one seat completes, full role reports are parked to mesh under a `council/<
|
|
138
|
+
Reserve at least the role count plus one agent call. Concurrency remains host-limited; usage settles afterward, not as a hard token reservation. Model keys must match a Pi registry key from `tools.models()` exactly, ignoring case; the program refuses a `models.aliases` name or a partial id, and checks every key before any agent runs. Whenever at least one seat completes, full role reports are parked to mesh under a create-only `council/<run-id>/reports` key (using the first completed agent's host-assigned run ID, with no native clock requirement) carried by every outcome as `reports` — a key collision parks under the next suffix (`-2`, `-3`, …) rather than overwriting: `mesh.get` it for audit or to retry a budget-starved synthesis with one plain agent, and `mesh.delete` it when no longer needed; on synthesis failure the fallback result carries report heads plus that mesh key, not the full texts; the synthesis prompt still embeds every completed report, so synthesis input grows with total report size. When mesh storage itself fails, `reports` is an `{"error": ...}` object instead of a key — never pass it to `mesh.get` or `mesh.delete` — and the synthesis-failure fallback then carries the full untruncated reports. A single completed role returns its full report directly as `result` without a synthesis call. Every result lists `seats` with each role's pinned model, thinking, and status, plus `synthesisModel` when one was pinned. These are the models the program requested; keeping a run on its pinned model is the host's job. Successful synthesis returns the compact decision, coverage, seats, failures, and `reports` (the mesh key, or the storage error object when parking failed); raw reports return on synthesis failure or when one role completes and synthesis is skipped. A partial result is useful evidence with named gaps, not permission for an automatic whole-council rerun. Retry only the failed role or synthesis when needed. Do not use a council for a lookup.
|
|
@@ -34,7 +34,7 @@ r = await pi.bash(command="git status --short", settle=True)
|
|
|
34
34
|
return {"ok": r["ok"], "output": r["output"], "exitCode": r.get("exitCode")}
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
Shell nonzero exits raise unless `settle=True`; timeout, cancellation, security and approval failures still raise. Shell `timeout` is seconds. `background=True` (alias `run_in_background`) returns immediately with `ok: True`, a pid, and a live output path while the process keeps running — do not poll; `pi.read` the path when you need output, or `kill <pid>`. Nested shells that exceed `executor.shellHangMs` (default 2 minutes) auto-spill the same way. No stdin option: write content to a file first, then use its path. Do not interpolate untrusted content into shell commands.
|
|
37
|
+
Shell nonzero exits raise unless `settle=True`; timeout, cancellation, security and approval failures still raise. Shell `timeout` is seconds. `background=True` (alias `run_in_background`) returns immediately with `ok: True`, a pid, and a live output path while the process keeps running — do not poll; `pi.read` the path when you need output, or `kill <pid>`. Nested shells that exceed `executor.shellHangMs` (default 2 minutes) auto-spill the same way; `timeout` bounds the process, not that wait, so call `tasks.wait` on the task id when the program needs the result. No stdin option: write content to a file first, then use its path. Do not interpolate untrusted content into shell commands.
|
|
38
38
|
|
|
39
39
|
Use top-level `payloads` for multiline content. Only exact keys supplied in this call exist: `π.body` or `payloads["body"]`. `π` is an attribute object; `payloads` is a separate dict. For a supplied `body` key, write with `await pi.write(path="notes.txt", content=π.body)`. Edit with `await pi.edit(path="notes.txt", edits=[{"oldText": "before", "newText": "after"}])`. Coalesce independent edits from one snapshot; use `all=True` only for intentional repeated anchors.
|
|
40
40
|
|
|
@@ -43,6 +43,8 @@ return await agents.wait(id=handle["id"])
|
|
|
43
43
|
|
|
44
44
|
`agents.list(scope="local")` lists local children; lineage/project include federated participants. Peer is reserved for another root Pi session: query `await agents.peers()` first, not children. A `<fabric-peers>` transcript message is a host notice (not a user request) listing the other root sessions sharing this project's files by label and participant id, sent only when that set changes; pass a listed id to `agents.steer` to coordinate. `agents.self`, `members`, and `main` expose participant identity and capabilities. Cross-process steer/followUp/stop route through the authenticated owner and return after acknowledgment; do not publish control topics yourself. If the owner restarted, an unexecuted command fails with "targets a previous owner incarnation"; Fabric does not retry, so re-read the participant and resend only if still wanted. Prefer steering useful running children over destroying their context. Check status before steering a finished child. Provider-registered work appears as `kind="provider"` members with ids `provider:<provider>:<id>`; `agents.stop`, `steer`, and `followUp` accept those ids and call the provider (stop returns `{"ref", "outcome": "confirmed" | "unconfirmed"}`). Cancelling or timing out a program stops the non-detached provider work it started. `agents.sleep(id=...)` parks an idle hosted run in this session and `agents.wake(id=...)` resumes it; both need a runner with the `sleep` capability and return `{"id", "requested"}`. The run stays `running` with `sleeping: true` once the runner reports it. Other runners, unknown ids, and finished runs raise.
|
|
45
45
|
|
|
46
|
+
For routine coordination, select relevant peers with `peer["status"] == "running" or peer["pendingMessages"]`; do not broadcast to every connected session. Peer-to-peer `agents.steer`/`agents.followUp` is passive by default: it reaches an active run but does not wake an idle peer. Pass `triggerTurn=True` only when an idle peer must act. Child/actor feedback to Main keeps its existing wake default.
|
|
47
|
+
|
|
46
48
|
## Lifecycle subscriptions
|
|
47
49
|
|
|
48
50
|
`agents.subscribe` takes exact from/to participant ids (`main` aliases the caller's root), events, delivery (steer/followUp), explicit triggerTurn, and optional once. subscriptions/unsubscribe list and remove routes. Events include pi.input, pi.agent_start, pi.agent_end, pi.turn_end, pi.agent_settled, pi.tool_error, pi.session_compact, and runner-neutral run.completed/failed/stopped/timed_out. pi.agent_settled means no retries/queued continuations remain, not permanent termination. Subscriptions start at the current cursor; crash recovery is at-least-once, so deduplicate effects by event id.
|
|
@@ -13,6 +13,7 @@ Recommend the smallest sufficient path; do not invoke it. Core coding needs no a
|
|
|
13
13
|
| Finite discover → fan-out → verify work | `/skill:fabric-workflow` |
|
|
14
14
|
| Independent roles and synthesis, optionally one model per seat | `/skill:fabric-council` |
|
|
15
15
|
| Different models compared by a judge, or read-only references executed by one actor | `/skill:fabric-fusion` |
|
|
16
|
+
| Search past session evidence or inspect its entry structure | `/skill:fabric-memory` |
|
|
16
17
|
| Work too large for one context window | `/skill:fabric-rlm` |
|
|
17
18
|
| Evidence-gated or transactional local-file mutation | `/skill:fabric-schema` |
|
|
18
19
|
| Typed semantic judgments or a code-owned observe → judge → act loop | `/skill:fabric-jev` |
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: fabric-memory
|
|
3
|
+
description: Search past Pi sessions, inspect their entry structure, and read integrity-bound evidence with the Fabric memory provider.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Fabric memory
|
|
8
|
+
|
|
9
|
+
Use the provider for previous decisions, session history and prior failures.
|
|
10
|
+
For facts available in the current repository, inspect files or git history.
|
|
11
|
+
|
|
12
|
+
Read `<skill-dir>/../../../docs/memory-recall.md` for the provider contract;
|
|
13
|
+
translate its examples into Python dictionaries as below. Inspect exact schemas
|
|
14
|
+
with `tools.describe({"ref": "memory.recall"})` and the corresponding
|
|
15
|
+
`memory.outline`, `memory.expand`, or `memory.sessions` ref.
|
|
16
|
+
Use explicit paging loops in this kernel, not TypeScript callback helpers.
|
|
17
|
+
|
|
18
|
+
## Scope and branches
|
|
19
|
+
|
|
20
|
+
Recall defaults to the current session. Specify `scope: "project"` or
|
|
21
|
+
`scope: "global"` for past sessions, or `scope: "session:<id-or-path>"` for one.
|
|
22
|
+
Branches default to the active parent-linked path; `branches: "all"` includes
|
|
23
|
+
abandoned branches. Keep the branch mode on follow-up calls.
|
|
24
|
+
|
|
25
|
+
```python
|
|
26
|
+
result = await memory.recall({
|
|
27
|
+
"query": "release failure", "scope": "global", "pageSize": 5,
|
|
28
|
+
})
|
|
29
|
+
for hit in result["hits"]:
|
|
30
|
+
# Entry hits expand; cold session hits recall within that session.
|
|
31
|
+
print(await tools.call(hit["follow"]))
|
|
32
|
+
if result.get("next"):
|
|
33
|
+
print(await tools.call(result["next"]))
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Pass `follow` and `next` intact. Their arguments bind the source hash and
|
|
37
|
+
lineage; rebuilding a selector from a snippet drops these checks.
|
|
38
|
+
|
|
39
|
+
## Structure before text
|
|
40
|
+
|
|
41
|
+
```python
|
|
42
|
+
catalog = await memory.sessions({"scope": "project"})
|
|
43
|
+
for session in catalog.get("sessions", [])[:1]:
|
|
44
|
+
outline = await memory.outline({"session": session["file"], "role": "user"})
|
|
45
|
+
if outline["entries"]:
|
|
46
|
+
row = outline["entries"][0]
|
|
47
|
+
page = await memory.expand({
|
|
48
|
+
"session": session["file"], "indices": [row["index"]], "role": "user",
|
|
49
|
+
"expectedSourceHash": outline["sourceHash"],
|
|
50
|
+
"expectedLineageFingerprint": outline["lineageFingerprint"],
|
|
51
|
+
})
|
|
52
|
+
while True:
|
|
53
|
+
print(page["entries"])
|
|
54
|
+
if not page.get("next"):
|
|
55
|
+
break
|
|
56
|
+
page = await tools.call(page["next"])
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Outline returns at most 200 rows. `total` counts matching rows before the cap;
|
|
60
|
+
`entryCount` counts the unfiltered session. Check `truncated` and `coverage`.
|
|
61
|
+
Expand supports exact indices, entry IDs, operation addresses or an inclusive
|
|
62
|
+
`entryRange`. `before` and `after` require exactly one anchor. `role` filters
|
|
63
|
+
the resolved selection and is retained in `next.args`.
|
|
64
|
+
Expanded entries can be partial: `textRange` names the returned text interval.
|
|
65
|
+
Follow `next` and join chunks with the same entry index when full text is needed.
|
|
66
|
+
Stopping early is not evidence of the session's end.
|
|
67
|
+
|
|
68
|
+
## Shared sources and coverage
|
|
69
|
+
|
|
70
|
+
Use `memory.sessions({"source": "archive"})` for a configured source. Pass its
|
|
71
|
+
session key or displayed file into source-qualified reads; do not assume a
|
|
72
|
+
local scope includes another source. There is no filesystem fallback when
|
|
73
|
+
`source` is set. Do not combine it with `scope: "global"`.
|
|
74
|
+
|
|
75
|
+
Literal recall matches any term by default; `queryMatch: "all"` requires all
|
|
76
|
+
terms in a hot entry. `queryMode: "phrase"` and `"regex"` have different cold
|
|
77
|
+
coverage limits. A cold candidate is navigation, not full-entry evidence.
|
|
78
|
+
|
|
79
|
+
An empty result with `coverage.complete == False` is not a no-match proof.
|
|
80
|
+
Inspect reasons, narrow the search, or read the selected session directly.
|
|
81
|
+
A stale-pointer refusal means repeat discovery and use its new binding.
|
|
82
|
+
Keep projections small; do not parse session JSONL to bypass these checks.
|
|
@@ -6,7 +6,7 @@ disable-model-invocation: true
|
|
|
6
6
|
|
|
7
7
|
# Fabric Council
|
|
8
8
|
|
|
9
|
-
Use one `fabric_exec` call with bounded role fan-out. Choose three to eight roles that disagree usefully rather than duplicating one another, such as correctness, security, operability, maintainability, and requirements skepticism. Pin a model to a role when you want vendor diversity as well as role diversity.
|
|
9
|
+
Use one `fabric_exec` call with bounded role fan-out. Choose three to eight roles that disagree usefully rather than duplicating one another, such as correctness, security, operability, maintainability, and requirements skepticism. Pin a model to a role when you want vendor diversity as well as role diversity. Use this template only for non-sensitive work: full reports are persisted in project-shared mesh, not private session storage. Do not supply credentials, secrets, or other material that must not be shared with other project sessions; use a plain agent without mesh parking for that work. Report secret locations and remediation, never secret values. This template does not automatically sanitize reports.
|
|
10
10
|
|
|
11
11
|
```ts
|
|
12
12
|
type CouncilSeat = { role: string; model?: string; thinking?: FabricThinking };
|
|
@@ -74,7 +74,7 @@ const outcomes = await parallel(
|
|
|
74
74
|
const pin = seat.model ? { model: seat.model } : {};
|
|
75
75
|
try {
|
|
76
76
|
const report = await agent(
|
|
77
|
-
`Act as the ${seat.role} council member. Independently analyze this task:\n\n${π.task}`,
|
|
77
|
+
`Act as the ${seat.role} council member. Independently analyze this task. Reports are persisted in project-shared mesh: never reproduce credentials, secret values, or private data; describe locations and remediation instead:\n\n${π.task}`,
|
|
78
78
|
{
|
|
79
79
|
label: seat.role,
|
|
80
80
|
tools: ["read", "grep", "find", "ls"],
|
|
@@ -113,21 +113,30 @@ if (completed.length === 0) {
|
|
|
113
113
|
}
|
|
114
114
|
// Park completed reports in mesh before synthesis: an audit trail that survives this
|
|
115
115
|
// program, and full-text recovery when synthesis fails or a budget runs out.
|
|
116
|
-
//
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
|
|
116
|
+
// ifVersion: 0 makes each put create-only, so a same-second council moves to the
|
|
117
|
+
// next key suffix instead of overwriting an earlier run's reports.
|
|
118
|
+
const parked = completed.map((outcome) => ({
|
|
119
|
+
role: outcome.role,
|
|
120
|
+
...(outcome.model ? { model: outcome.model } : {}),
|
|
121
|
+
report: outcome.report,
|
|
122
|
+
}));
|
|
123
|
+
let reports: string | { error: string } | null = null;
|
|
124
|
+
let parkError = "";
|
|
125
|
+
const reportsBase = `council/${new Date().toISOString().slice(0, 19).replace(/[:T]/g, "-")}`;
|
|
126
|
+
for (let attempt = 0; attempt < 4 && reports === null; attempt++) {
|
|
127
|
+
const suffix = attempt === 0 ? "" : `-${attempt + 1}`;
|
|
128
|
+
const reportsKey = `${reportsBase}${suffix}/reports`;
|
|
129
|
+
try {
|
|
130
|
+
await mesh.put({ key: reportsKey, value: parked, ifVersion: 0 });
|
|
131
|
+
reports = reportsKey;
|
|
132
|
+
} catch (error) {
|
|
133
|
+
parkError = error instanceof Error ? error.message : String(error);
|
|
134
|
+
// Only a same-timestamp collision retries with the next suffix; any other
|
|
135
|
+
// storage failure surfaces immediately as the { error } object.
|
|
136
|
+
if (!parkError.includes("compare-and-swap")) break;
|
|
137
|
+
}
|
|
130
138
|
}
|
|
139
|
+
if (reports === null) reports = { error: parkError };
|
|
131
140
|
if (completed.length === 1) {
|
|
132
141
|
return {
|
|
133
142
|
status: "partial",
|
|
@@ -175,7 +184,7 @@ try {
|
|
|
175
184
|
}
|
|
176
185
|
```
|
|
177
186
|
|
|
178
|
-
Pass the task as `strings.task`, the JSON role array as `strings.roles`, and the synthesis model key as `strings.synthesis`; an empty `strings.synthesis` keeps the session default. A role is a string or `{ "role": "security", "model": "provider/id", "thinking": "high" }`, and a role without `model` runs on the session default. Model keys must match a Pi registry key from `tools.models()` exactly, ignoring case; the skill refuses a `models.aliases` name or a partial id, and checks every key before any agent runs. Every result lists `seats`, each with its role, pinned model and thinking, and status, plus `synthesisModel` when one was pinned. These are the models the skill requested; keeping a run on its pinned model is the host's job. Successful synthesis returns the compact decision, coverage, seats, failures, and `reports` (the mesh key, or the storage error object when parking failed). Whenever at least one seat completes, the full role reports are parked to mesh under a `council/<timestamp
|
|
187
|
+
Pass the task as `strings.task`, the JSON role array as `strings.roles`, and the synthesis model key as `strings.synthesis`; an empty `strings.synthesis` keeps the session default. A role is a string or `{ "role": "security", "model": "provider/id", "thinking": "high" }`, and a role without `model` runs on the session default. Model keys must match a Pi registry key from `tools.models()` exactly, ignoring case; the skill refuses a `models.aliases` name or a partial id, and checks every key before any agent runs. Every result lists `seats`, each with its role, pinned model and thinking, and status, plus `synthesisModel` when one was pinned. These are the models the skill requested; keeping a run on its pinned model is the host's job. Successful synthesis returns the compact decision, coverage, seats, failures, and `reports` (the mesh key, or the storage error object when parking failed). Whenever at least one seat completes, the full role reports are parked to mesh under a create-only `council/<timestamp>/reports` key — a same-second collision parks under the next suffix rather than overwriting — and every outcome carries it as `reports`: check `typeof reports === "string"` first, because a failed `mesh.put` yields an `{ error }` object instead of a key — never pass that to `mesh.get` or `mesh.delete`, and the synthesis-failure fallback then carries the full untruncated reports. Otherwise `mesh.get` the key for audit or to retry a budget-starved synthesis with one plain agent, and `mesh.delete` it when no longer needed. On synthesis failure the fallback result carries report heads plus that mesh key, not the full texts; the synthesis prompt still embeds every completed report, so synthesis input grows with total report size. One surviving role returns directly without spending another agent call.
|
|
179
188
|
|
|
180
189
|
Concurrent calls can overshoot an observational `tokenBudget` because usage settles afterward. Reserve at least `seats.length + 1` top-level agent calls when synthesis may run, and use a finite role set rather than relying on token accounting as a hard concurrent ceiling. A budget-exhausted synthesis loses nothing: the parked reports are complete, so re-run only the synthesis step.
|
|
181
190
|
|
|
@@ -31,9 +31,9 @@ QuickJS is isolated by default and receives static type checking; native Node/Bu
|
|
|
31
31
|
|
|
32
32
|
For `pi.edit`, entry-level `all:true` applies that replacement to every non-overlapping occurrence; top-level `all:true` applies every entry that way. Omit it for unique anchors.
|
|
33
33
|
|
|
34
|
-
Shell tools reject on an ordinary nonzero exit; pass `settle:true` to get `{ok:false,output,details:null,exitCode,error}` instead of a rejection. `background: true` (alias `run_in_background`) returns immediately with `ok: true`, `details.taskId`, a pid, and a live output path while the process keeps running. Completion notifies the owning session; do not poll. Use `tools.call({ref:'tasks.list',args:{}})`, `tasks.get` or `tasks.stop` with `{id: taskId}` (tasks is not a sandbox global), or `pi.read` the bounded log. Nested shells that exceed `executor.shellHangMs` (default 2m) auto-spill the same way. Timeout, cancellation, approval, security, and spawn failures still reject. Other Pi core tool errors reject normally.
|
|
34
|
+
Shell tools reject on an ordinary nonzero exit; pass `settle:true` to get `{ok:false,output,details:null,exitCode,error}` instead of a rejection. `background: true` (alias `run_in_background`) returns immediately with `ok: true`, `details.taskId`, a pid, and a live output path while the process keeps running. Completion notifies the owning session; do not poll. Use `tools.call({ref:'tasks.list',args:{}})`, `tasks.get` or `tasks.stop` with `{id: taskId}` (tasks is not a sandbox global), or `pi.read` the bounded log. Nested shells that exceed `executor.shellHangMs` (default 2m) auto-spill the same way; `timeout` bounds the process, not that wait, so call `tasks.wait` on the task id when the program needs the result. Timeout, cancellation, approval, security, and spawn failures still reject. Other Pi core tool errors reject normally.
|
|
35
35
|
|
|
36
|
-
Opt-in `monitor:{delivery:'wake',match:'literal',timeoutMs:300000,intervalMs:5000}` on `pi.bash`/`pi.powershell` also detaches. Delivery must explicitly be `ui` (never wakes the agent) or `wake` (coalesced line events may start an owning-agent turn). Watches expire, never auto-renew, and stop on Main interruption. Use scripts that emit meaningful changes only; no inference is used to poll. The default lifetime is 5m (maximum 30m), event interval 5s (1–60s), with at most eight monitors. See [background tasks](../../../docs/background-tasks.md).
|
|
36
|
+
Opt-in `monitor:{delivery:'wake',match:'literal',timeoutMs:300000,intervalMs:5000}` on `pi.bash`/`pi.powershell` also detaches. Delivery must explicitly be `ui` (never wakes the agent) or `wake` (coalesced line events may start an owning-agent turn). Watches expire, never auto-renew, and stop on Main interruption. With an explicit shell `timeout`, expiry ends only the watch and the process runs until that timeout; without one, expiry stops the command. Use scripts that emit meaningful changes only; no inference is used to poll. The default lifetime is 5m (maximum 30m), event interval 5s (1–60s), with at most eight monitors. See [background tasks](../../../docs/background-tasks.md).
|
|
37
37
|
|
|
38
38
|
Aliases are normalized to canonical fields before host validation. Command aliases include `cmd`/`shell`/`cmdline`/`script`/`commandLine`; pattern aliases include `query`/`regex`/`search` plus `q`/`expression`/`text` for grep and `name`/`filename`/`glob`/`include` for find. Path aliases include `file`, `file_path`, camel-case path variants, `dir`/`folder`/`directory`, and target-file variants. Edit text accepts `old`/`from`/`old_string`-style and `new`/`to`/`replacement`/`new_string`-style spellings, including inside `edits`; write content accepts `contents`/`body`/`text`/`data`/`fileContent`. `ic`/`caseInsensitive`→`ignoreCase`, `globPattern`→`glob`, `ctx`→`context`, `max`→`limit`, and `start`→`offset`.
|
|
39
39
|
|
|
@@ -68,6 +68,7 @@ All calls return promises. Fields ending in `?` are optional; `unknown` marks pr
|
|
|
68
68
|
|------|-------------|
|
|
69
69
|
| `memory.recall(args?)` | `{total,hits:MemoryRecallHit[],next:{ref:"memory.recall",args}|null,coverage:MemoryCoverage,error?}` |
|
|
70
70
|
| `memory.expand(args)` | `{session?,sourceHash?,branches?,lineageFingerprint?,entryCount?,entries:ExpandedSessionEntry[],next?:{ref:"memory.expand",args}|null,error?}` |
|
|
71
|
+
| `memory.outline(args)` | `{session?,sourceHash?,branches?,lineageFingerprint?,entryCount?,total?,truncated?,coverage?,entries,error?}`; bounded ordered entry previews |
|
|
71
72
|
| `memory.walk(args, visitor)` (TypeScript guest only) | `{visited,stopped,error?}`; guest-local paging and full-entry reassembly over `memory.expand` |
|
|
72
73
|
| `memory.sessions(args?)` | `{scope?,branches?,sessions?:SessionInfo[],error?}`; slice `result.sessions ?? []`, not the wrapper |
|
|
73
74
|
| `state.transition(args)` | `{event:FabricMeshEvent,head:unknown}` |
|
|
@@ -139,6 +139,7 @@ Every live root, one-shot/recursive agent, and persistent actor is represented i
|
|
|
139
139
|
- `agents.departed({ limit? })` returns other root sessions that are no longer live, newest first, with `status: "stopped"` (closed cleanly) or `"lost"` (lease expired) plus `sessionId`, `cwd`, `label` and `lastSeenAt`. Live discovery never includes them.
|
|
140
140
|
- `agents.main()` remains the compatibility view of the caller's root as `{ id, name: "Main", kind: "main", ... }`; the stable alias `"main"` resolves to that exact root id.
|
|
141
141
|
- `agents.switchModel({ model, provider? })` switches Main's live Pi session model in place and keeps it. The selector resolves a `models.aliases` name (string target or first-available fallback chain), then an exact `provider/id`, an exact bare id, then the closest fuzzy match across provider, id, and display name (pi-model-sort recency breaks ties); unknown selectors throw instead of switching. The result carries `{ switched, model, previous?, via? }`, where `via` is the alias name or `closest`/`recent`/`latest`, or `{ switched: false, reason: "already-active" }` for the active model. List candidates with `tools.models()` (Pi runner entries).
|
|
142
|
+
- For routine coordination, select relevant peers with `status === "running"` or `pendingMessages`; do not broadcast updates to every connected session. Peer-to-peer `steer`/`followUp` is passive by default: it reaches an active run but does not wake an idle peer. Use `triggerTurn: true` only when an idle peer must act. Child/actor feedback to Main keeps its existing wake default.
|
|
142
143
|
- `agents.peers()` remains the compatibility view of other live roots as `Peer <session-prefix>`. It is derived from `agents.members`, not maintained by a second registry.
|
|
143
144
|
- A `<fabric-peers>` message in the transcript is a host notice, not a user request: it lists the other root sessions sharing this project's files by label and participant id, and is sent only when that set changes. Treat file or git changes you did not make as possibly theirs, and pass a listed id to `agents.steer` to coordinate.
|
|
144
145
|
- `agents.status({ id })` accepts any known participant id. Local runs/actors return full local detail; remote participants return their bounded directory summary.
|
|
@@ -13,6 +13,7 @@ Recommend the smallest sufficient path; do not invoke it. Core coding needs no a
|
|
|
13
13
|
| Finite discover → fan-out → verify work | `/skill:fabric-workflow` |
|
|
14
14
|
| Independent roles and synthesis, optionally one model per seat | `/skill:fabric-council` |
|
|
15
15
|
| Different models compared by a judge, or read-only references executed by one actor | `/skill:fabric-fusion` |
|
|
16
|
+
| Search past session evidence or inspect its entry structure | `/skill:fabric-memory` |
|
|
16
17
|
| Work too large for one context window | `/skill:fabric-rlm` |
|
|
17
18
|
| Evidence-gated or transactional local-file mutation | `/skill:fabric-schema` |
|
|
18
19
|
| Typed semantic judgments or a code-owned observe → judge → act loop | `/skill:fabric-jev` |
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: fabric-memory
|
|
3
|
+
description: Search past Pi sessions, inspect their entry structure, and read integrity-bound evidence with the Fabric memory provider.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Fabric memory
|
|
8
|
+
|
|
9
|
+
Use the provider for previous decisions, session history and prior failures.
|
|
10
|
+
For facts available in the current repository, inspect files or git history.
|
|
11
|
+
|
|
12
|
+
Read `<skill-dir>/../../../docs/memory-recall.md` for the full contract.
|
|
13
|
+
Inspect exact schemas with `tools.describe({ ref: "memory.recall" })` and the
|
|
14
|
+
corresponding `memory.outline`, `memory.expand`, or `memory.sessions` ref.
|
|
15
|
+
`memory.walk` is a TypeScript guest helper, not a provider action.
|
|
16
|
+
|
|
17
|
+
## Scope and branches
|
|
18
|
+
|
|
19
|
+
Recall defaults to the current session. Specify `scope: "project"` or
|
|
20
|
+
`scope: "global"` for past sessions, or `scope: "session:<id-or-path>"` for one.
|
|
21
|
+
Branches default to the active parent-linked path; `branches: "all"` includes
|
|
22
|
+
abandoned branches. Keep the branch mode on follow-up calls.
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
const result = await memory.recall({
|
|
26
|
+
query: "release failure", scope: "global", pageSize: 5,
|
|
27
|
+
});
|
|
28
|
+
for (const hit of result.hits) {
|
|
29
|
+
// Entry hits expand; cold session hits recall within that session.
|
|
30
|
+
const evidence = await tools.call(hit.follow);
|
|
31
|
+
print(evidence);
|
|
32
|
+
}
|
|
33
|
+
if (result.next) print(await tools.call(result.next));
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Pass `follow` and `next` intact. Their arguments bind the source hash and
|
|
37
|
+
lineage; rebuilding a selector from a snippet drops these checks.
|
|
38
|
+
|
|
39
|
+
## Structure before text
|
|
40
|
+
|
|
41
|
+
```ts
|
|
42
|
+
const catalog = await memory.sessions({ scope: "project" });
|
|
43
|
+
const session = catalog.sessions?.[0]?.file;
|
|
44
|
+
if (session) {
|
|
45
|
+
const outline = await memory.outline({ session, role: "user" });
|
|
46
|
+
const first = outline.entries[0];
|
|
47
|
+
if (first) print(await memory.expand({
|
|
48
|
+
session, indices: [first.index], role: "user",
|
|
49
|
+
expectedSourceHash: outline.sourceHash,
|
|
50
|
+
expectedLineageFingerprint: outline.lineageFingerprint,
|
|
51
|
+
}));
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Outline returns at most 200 rows. `total` counts matching rows before the cap;
|
|
56
|
+
`entryCount` counts the unfiltered session. Check `truncated` and `coverage`.
|
|
57
|
+
Expand supports exact indices, entry IDs, operation addresses or an inclusive
|
|
58
|
+
`entryRange`. `before` and `after` require exactly one anchor. `role` filters
|
|
59
|
+
the resolved selection and is retained in `next.args`.
|
|
60
|
+
|
|
61
|
+
```ts
|
|
62
|
+
const catalog = await memory.sessions({ scope: "project" });
|
|
63
|
+
const session = catalog.sessions?.[0]?.file;
|
|
64
|
+
if (session) await memory.walk({ session, role: "user" }, async (entry) => {
|
|
65
|
+
print({ index: entry.index, text: entry.text });
|
|
66
|
+
});
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Walk reassembles text chunks. Returning `false` stops early; the last visited
|
|
70
|
+
index is then not evidence of the session's end.
|
|
71
|
+
|
|
72
|
+
## Shared sources and coverage
|
|
73
|
+
|
|
74
|
+
Use `memory.sessions({ source: "archive" })` for a configured source. Pass its
|
|
75
|
+
session key or displayed file into source-qualified reads; do not assume a
|
|
76
|
+
local scope includes another source. There is no filesystem fallback when
|
|
77
|
+
`source` is set. Do not combine it with `scope: "global"`.
|
|
78
|
+
|
|
79
|
+
Literal recall matches any term by default; `queryMatch: "all"` requires all
|
|
80
|
+
terms in a hot entry. `queryMode: "phrase"` and `"regex"` have different cold
|
|
81
|
+
coverage limits. A cold candidate is navigation, not full-entry evidence.
|
|
82
|
+
|
|
83
|
+
An empty result with `coverage.complete === false` is not a no-match proof.
|
|
84
|
+
Inspect reasons, narrow the search, or read the selected session directly.
|
|
85
|
+
A stale-pointer refusal means repeat discovery and use its new binding.
|
|
86
|
+
For expanded entries check `textRange.complete` and follow `next` until null.
|
|
87
|
+
Keep projections small; do not parse session JSONL to bypass these checks.
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/compaction/threshold.ts", "../../src/ui/fabric-title-hint.ts"],
|
|
4
|
-
"sourcesContent": ["import type { ExtensionContext } from \"@earendil-works/pi-coding-agent\";\nimport type { FabricConfig } from \"../config.js\";\n\nexport const modelCompactionKey = (\n model: Pick<NonNullable<ExtensionContext[\"model\"]>, \"provider\" | \"id\"> | undefined,\n): string | undefined => model ? `${model.provider}/${model.id}` : undefined;\n\n// A configured token threshold takes precedence over a ratio for the same\n// model; the settings UI keeps the maps mutually exclusive, and hand-written\n// configs resolve to the more explicit token value.\nconst configuredCompactionTokenThreshold = (\n config: FabricConfig,\n modelKey: string | undefined,\n): number | undefined =>\n modelKey === undefined ? undefined : config.compaction.tokenThresholds[modelKey];\n\nconst configuredCompactionThreshold = (\n config: FabricConfig,\n modelKey: string | undefined,\n): number | undefined =>\n modelKey === undefined ? undefined : config.compaction.thresholds[modelKey];\n\nconst runThresholdCompact = (\n context: ExtensionContext,\n): Promise<boolean> => new Promise<boolean>((resolve) => {\n context.compact({\n onComplete: () => resolve(true),\n onError: (error) => {\n if (context.hasUI) {\n context.ui.notify(`Fabric threshold compaction failed: ${error.message}`, \"warning\");\n }\n resolve(false);\n },\n });\n});\n\nexport type AutoCompactionTrigger = \"headroom\" | \"tokens\" | \"ratio\";\n\n// Headroom left in the window for the next response. `outputReserveTokens`\n// of 0 disables the trigger; unknown usage never triggers.\nexport const outputReserveBreached = (\n usage: { tokens: number | null; contextWindow: number } | undefined,\n outputReserveTokens: number,\n): boolean =>\n outputReserveTokens > 0\n && usage !== undefined\n && usage.tokens !== null\n && Number.isFinite(usage.contextWindow)\n && usage.contextWindow > 0\n && usage.contextWindow - usage.tokens < outputReserveTokens;\n\nconst autoCompactionTrigger = (\n context: ExtensionContext,\n config: FabricConfig,\n): AutoCompactionTrigger | undefined => {\n const modelKey = modelCompactionKey(context.model);\n const usage = context.getContextUsage();\n if (usage === undefined) return undefined;\n\n if (outputReserveBreached(usage, config.compaction.outputReserveTokens)) return \"headroom\";\n\n const tokenThreshold = configuredCompactionTokenThreshold(config, modelKey);\n if (tokenThreshold !== undefined) {\n return usage.tokens !== null && usage.tokens >= tokenThreshold ? \"tokens\" : undefined;\n }\n\n const threshold = configuredCompactionThreshold(config, modelKey);\n if (threshold === undefined || usage.percent === null) return undefined;\n return usage.percent / 100 >= threshold ? \"ratio\" : undefined;\n};\n\nexport const compactAtConfiguredThreshold = async (\n context: ExtensionContext,\n config: FabricConfig,\n onTrigger?: (trigger: AutoCompactionTrigger, committed: boolean) => void,\n): Promise<boolean> => {\n const trigger = autoCompactionTrigger(context, config);\n if (trigger === undefined) return false;\n const committed = await runThresholdCompact(context);\n onTrigger?.(trigger, committed);\n return committed;\n};\n", "import { fabricExecTitleHint } from \"./fabric-code-parser.js\";\nimport type { FabricKernel } from \"../runtime/kernel.js\";\n\n// The live card, activity feed and compaction share a bounded memo. Include\n// the kernel: identical source can mean different things in each language.\nconst TITLE_HINT_CACHE_MAX = 256;\nconst titleHintCache = new Map<string, string | undefined>();\n\nexport const fabricExecTitleHintCached = (\n code: string,\n kernel: FabricKernel = \"typescript\",\n): string | undefined => {\n const key = `${kernel}\\0${code}`;\n const hit = titleHintCache.get(key);\n if (hit !== undefined || titleHintCache.has(key)) return hit;\n const hint = fabricExecTitleHint(code, kernel);\n if (titleHintCache.size >= TITLE_HINT_CACHE_MAX) {\n const oldest = titleHintCache.keys().next().value;\n if (oldest !== undefined) titleHintCache.delete(oldest);\n }\n titleHintCache.set(key, hint);\n return hint;\n};\n"],
|
|
5
|
-
"mappings": ";;;;;AAGO,IAAM,qBAAqB,CAChC,UACuB,QAAQ,GAAG,MAAM,QAAQ,IAAI,MAAM,EAAE,KAAK;AAKnE,IAAM,qCAAqC,CACzC,QACA,aAEA,aAAa,SAAY,SAAY,OAAO,WAAW,gBAAgB,QAAQ;AAEjF,IAAM,gCAAgC,CACpC,QACA,aAEA,aAAa,SAAY,SAAY,OAAO,WAAW,WAAW,QAAQ;AAE5E,IAAM,sBAAsB,CAC1B,YACqB,IAAI,QAAiB,CAAC,YAAY;AACvD,UAAQ,QAAQ;AAAA,IACd,YAAY,MAAM,QAAQ,IAAI;AAAA,IAC9B,SAAS,CAAC,UAAU;AAClB,UAAI,QAAQ,OAAO;AACjB,gBAAQ,GAAG,OAAO,uCAAuC,MAAM,OAAO,IAAI,SAAS;AAAA,MACrF;AACA,cAAQ,KAAK;AAAA,IACf;AAAA,EACF,CAAC;AACH,CAAC;AAMM,IAAM,wBAAwB,CACnC,OACA,wBAEA,sBAAsB,KACnB,UAAU,UACV,MAAM,WAAW,QACjB,OAAO,SAAS,MAAM,aAAa,KACnC,MAAM,gBAAgB,KACtB,MAAM,gBAAgB,MAAM,SAAS;AAE1C,IAAM,wBAAwB,CAC5B,SACA,WACsC;AACtC,QAAM,WAAW,mBAAmB,QAAQ,KAAK;AACjD,QAAM,QAAQ,QAAQ,gBAAgB;AACtC,MAAI,UAAU,OAAW,QAAO;AAEhC,MAAI,sBAAsB,OAAO,OAAO,WAAW,mBAAmB,EAAG,QAAO;AAEhF,QAAM,iBAAiB,mCAAmC,QAAQ,QAAQ;AAC1E,MAAI,mBAAmB,QAAW;AAChC,WAAO,MAAM,WAAW,QAAQ,MAAM,UAAU,iBAAiB,WAAW;AAAA,EAC9E;AAEA,QAAM,YAAY,8BAA8B,QAAQ,QAAQ;AAChE,MAAI,cAAc,UAAa,MAAM,YAAY,KAAM,QAAO;AAC9D,SAAO,MAAM,UAAU,OAAO,YAAY,UAAU;AACtD;AAEO,IAAM,+BAA+B,OAC1C,SACA,QACA,cACqB;AACrB,QAAM,UAAU,sBAAsB,SAAS,MAAM;AACrD,MAAI,YAAY,OAAW,QAAO;AAClC,QAAM,YAAY,MAAM,oBAAoB,OAAO;AACnD,cAAY,SAAS,SAAS;AAC9B,SAAO;AACT;;;AC5EA,IAAM,uBAAuB;AAC7B,IAAM,iBAAiB,oBAAI,IAAgC;AAEpD,IAAM,4BAA4B,CACvC,MACA,SAAuB,iBACA;AACvB,QAAM,MAAM,GAAG,MAAM,KAAK,IAAI;AAC9B,QAAM,MAAM,eAAe,IAAI,GAAG;AAClC,MAAI,QAAQ,UAAa,eAAe,IAAI,GAAG,EAAG,QAAO;AACzD,QAAM,OAAO,oBAAoB,MAAM,MAAM;AAC7C,MAAI,eAAe,QAAQ,sBAAsB;AAC/C,UAAM,SAAS,eAAe,KAAK,EAAE,KAAK,EAAE;AAC5C,QAAI,WAAW,OAAW,gBAAe,OAAO,MAAM;AAAA,EACxD;AACA,iBAAe,IAAI,KAAK,IAAI;AAC5B,SAAO;AACT;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|