@caupulican/pi-adaptative 0.81.39 → 0.81.40
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/CHANGELOG.md +52 -0
- package/README.md +2 -0
- package/dist/bundled-resources/extensions/tmux-agent-manager/dispatch-grant.d.ts +2 -0
- package/dist/bundled-resources/extensions/tmux-agent-manager/dispatch-grant.d.ts.map +1 -1
- package/dist/bundled-resources/extensions/tmux-agent-manager/dispatch-grant.js +2 -0
- package/dist/bundled-resources/extensions/tmux-agent-manager/dispatch-grant.js.map +1 -1
- package/dist/bundled-resources/extensions/tmux-agent-manager/dispatch-grant.ts +3 -0
- package/dist/bundled-resources/extensions/tmux-agent-manager/index.d.ts +9 -0
- package/dist/bundled-resources/extensions/tmux-agent-manager/index.d.ts.map +1 -1
- package/dist/bundled-resources/extensions/tmux-agent-manager/index.js +290 -107
- package/dist/bundled-resources/extensions/tmux-agent-manager/index.js.map +1 -1
- package/dist/bundled-resources/extensions/tmux-agent-manager/index.ts +357 -122
- package/dist/bundled-resources/skills/tool-call-repair/references/repair-catalogue.md +2 -2
- package/dist/cli/args.d.ts +2 -0
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +9 -0
- package/dist/cli/args.js.map +1 -1
- package/dist/core/agent-directory-layout.d.ts +15 -0
- package/dist/core/agent-directory-layout.d.ts.map +1 -0
- package/dist/core/agent-directory-layout.js +72 -0
- package/dist/core/agent-directory-layout.js.map +1 -0
- package/dist/core/agent-paths.d.ts +19 -2
- package/dist/core/agent-paths.d.ts.map +1 -1
- package/dist/core/agent-paths.js +67 -4
- package/dist/core/agent-paths.js.map +1 -1
- package/dist/core/agent-session-runtime.d.ts +52 -8
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +397 -79
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session-services.d.ts +1 -0
- package/dist/core/agent-session-services.d.ts.map +1 -1
- package/dist/core/agent-session-services.js +1 -0
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/agent-session.d.ts +71 -136
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +477 -1318
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/autonomy/approval-gate.d.ts +3 -2
- package/dist/core/autonomy/approval-gate.d.ts.map +1 -1
- package/dist/core/autonomy/approval-gate.js +6 -28
- package/dist/core/autonomy/approval-gate.js.map +1 -1
- package/dist/core/autonomy/bounded-completion.d.ts +1 -1
- package/dist/core/autonomy/bounded-completion.d.ts.map +1 -1
- package/dist/core/autonomy/bounded-completion.js +1 -1
- package/dist/core/autonomy/bounded-completion.js.map +1 -1
- package/dist/core/autonomy/contracts.d.ts +20 -12
- package/dist/core/autonomy/contracts.d.ts.map +1 -1
- package/dist/core/autonomy/contracts.js.map +1 -1
- package/dist/core/autonomy/foreground-envelope.d.ts +8 -2
- package/dist/core/autonomy/foreground-envelope.d.ts.map +1 -1
- package/dist/core/autonomy/foreground-envelope.js +8 -25
- package/dist/core/autonomy/foreground-envelope.js.map +1 -1
- package/dist/core/autonomy/gates.d.ts.map +1 -1
- package/dist/core/autonomy/gates.js +8 -10
- package/dist/core/autonomy/gates.js.map +1 -1
- package/dist/core/autonomy/lane-private-paths.d.ts +2 -0
- package/dist/core/autonomy/lane-private-paths.d.ts.map +1 -0
- package/dist/core/autonomy/lane-private-paths.js +16 -0
- package/dist/core/autonomy/lane-private-paths.js.map +1 -0
- package/dist/core/autonomy/lane-tool-surface.d.ts +10 -0
- package/dist/core/autonomy/lane-tool-surface.d.ts.map +1 -1
- package/dist/core/autonomy/lane-tool-surface.js +46 -8
- package/dist/core/autonomy/lane-tool-surface.js.map +1 -1
- package/dist/core/autonomy/lane-tracker.d.ts +14 -0
- package/dist/core/autonomy/lane-tracker.d.ts.map +1 -1
- package/dist/core/autonomy/lane-tracker.js +38 -0
- package/dist/core/autonomy/lane-tracker.js.map +1 -1
- package/dist/core/autonomy/risk-assessment.d.ts +1 -2
- package/dist/core/autonomy/risk-assessment.d.ts.map +1 -1
- package/dist/core/autonomy/risk-assessment.js +1 -123
- package/dist/core/autonomy/risk-assessment.js.map +1 -1
- package/dist/core/autonomy/session-lane-record.d.ts +4 -4
- package/dist/core/autonomy/session-lane-record.d.ts.map +1 -1
- package/dist/core/autonomy/session-lane-record.js +16 -29
- package/dist/core/autonomy/session-lane-record.js.map +1 -1
- package/dist/core/autonomy/telemetry-events.d.ts +1 -1
- package/dist/core/autonomy/telemetry-events.d.ts.map +1 -1
- package/dist/core/autonomy/telemetry-events.js +1 -1
- package/dist/core/autonomy/telemetry-events.js.map +1 -1
- package/dist/core/autonomy-telemetry.d.ts +7 -7
- package/dist/core/autonomy-telemetry.d.ts.map +1 -1
- package/dist/core/autonomy-telemetry.js +9 -9
- package/dist/core/autonomy-telemetry.js.map +1 -1
- package/dist/core/background-lane-controller.d.ts +54 -236
- package/dist/core/background-lane-controller.d.ts.map +1 -1
- package/dist/core/background-lane-controller.js +140 -1273
- package/dist/core/background-lane-controller.js.map +1 -1
- package/dist/core/capability-contract.d.ts +4 -0
- package/dist/core/capability-contract.d.ts.map +1 -0
- package/dist/core/capability-contract.js +28 -0
- package/dist/core/capability-contract.js.map +1 -0
- package/dist/core/compaction-controller.d.ts +90 -0
- package/dist/core/compaction-controller.d.ts.map +1 -0
- package/dist/core/compaction-controller.js +452 -0
- package/dist/core/compaction-controller.js.map +1 -0
- package/dist/core/compaction-support.d.ts +12 -11
- package/dist/core/compaction-support.d.ts.map +1 -1
- package/dist/core/compaction-support.js.map +1 -1
- package/dist/core/context/context-artifacts.d.ts +6 -2
- package/dist/core/context/context-artifacts.d.ts.map +1 -1
- package/dist/core/context/context-artifacts.js +34 -2
- package/dist/core/context/context-artifacts.js.map +1 -1
- package/dist/core/context/context-store-retention.d.ts +8 -2
- package/dist/core/context/context-store-retention.d.ts.map +1 -1
- package/dist/core/context/context-store-retention.js +158 -35
- package/dist/core/context/context-store-retention.js.map +1 -1
- package/dist/core/context/okf-memory.d.ts.map +1 -1
- package/dist/core/context/okf-memory.js +9 -11
- package/dist/core/context/okf-memory.js.map +1 -1
- package/dist/core/context/sqlite-runtime-index.d.ts.map +1 -1
- package/dist/core/context/sqlite-runtime-index.js +6 -8
- package/dist/core/context/sqlite-runtime-index.js.map +1 -1
- package/dist/core/context-gc.d.ts +3 -0
- package/dist/core/context-gc.d.ts.map +1 -1
- package/dist/core/context-gc.js +10 -5
- package/dist/core/context-gc.js.map +1 -1
- package/dist/core/context-pipeline.d.ts.map +1 -1
- package/dist/core/context-pipeline.js +9 -4
- package/dist/core/context-pipeline.js.map +1 -1
- package/dist/core/default-tool-surface.d.ts.map +1 -1
- package/dist/core/default-tool-surface.js +1 -0
- package/dist/core/default-tool-surface.js.map +1 -1
- package/dist/core/delegation/managed-lane-controller.d.ts +34 -0
- package/dist/core/delegation/managed-lane-controller.d.ts.map +1 -0
- package/dist/core/delegation/managed-lane-controller.js +217 -0
- package/dist/core/delegation/managed-lane-controller.js.map +1 -0
- package/dist/core/delegation/session-worker-claim.d.ts +44 -0
- package/dist/core/delegation/session-worker-claim.d.ts.map +1 -0
- package/dist/core/delegation/session-worker-claim.js +98 -0
- package/dist/core/delegation/session-worker-claim.js.map +1 -0
- package/dist/core/delegation/worker-actions.d.ts +7 -5
- package/dist/core/delegation/worker-actions.d.ts.map +1 -1
- package/dist/core/delegation/worker-actions.js +20 -4
- package/dist/core/delegation/worker-actions.js.map +1 -1
- package/dist/core/delegation/{worker-result.d.ts → worker-claim.d.ts} +13 -13
- package/dist/core/delegation/worker-claim.d.ts.map +1 -0
- package/dist/core/delegation/{worker-result.js → worker-claim.js} +61 -51
- package/dist/core/delegation/worker-claim.js.map +1 -0
- package/dist/core/delegation/worker-delegation-controller.d.ts +110 -0
- package/dist/core/delegation/worker-delegation-controller.d.ts.map +1 -0
- package/dist/core/delegation/worker-delegation-controller.js +861 -0
- package/dist/core/delegation/worker-delegation-controller.js.map +1 -0
- package/dist/core/delegation/worker-delegation-request.d.ts +11 -0
- package/dist/core/delegation/worker-delegation-request.d.ts.map +1 -0
- package/dist/core/delegation/worker-delegation-request.js +2 -0
- package/dist/core/delegation/worker-delegation-request.js.map +1 -0
- package/dist/core/delegation/worker-dispatch-scheduler.d.ts +40 -0
- package/dist/core/delegation/worker-dispatch-scheduler.d.ts.map +1 -0
- package/dist/core/delegation/worker-dispatch-scheduler.js +93 -0
- package/dist/core/delegation/worker-dispatch-scheduler.js.map +1 -0
- package/dist/core/delegation/worker-execution-policy.d.ts +62 -0
- package/dist/core/delegation/worker-execution-policy.d.ts.map +1 -0
- package/dist/core/delegation/worker-execution-policy.js +160 -0
- package/dist/core/delegation/worker-execution-policy.js.map +1 -0
- package/dist/core/delegation/worker-lane-projection.d.ts +14 -0
- package/dist/core/delegation/worker-lane-projection.d.ts.map +1 -0
- package/dist/core/delegation/worker-lane-projection.js +100 -0
- package/dist/core/delegation/worker-lane-projection.js.map +1 -0
- package/dist/core/delegation/worker-lifecycle.d.ts +97 -0
- package/dist/core/delegation/worker-lifecycle.d.ts.map +1 -0
- package/dist/core/delegation/worker-lifecycle.js +339 -0
- package/dist/core/delegation/worker-lifecycle.js.map +1 -0
- package/dist/core/delegation/worker-notification-coordinator.d.ts +36 -0
- package/dist/core/delegation/worker-notification-coordinator.d.ts.map +1 -0
- package/dist/core/delegation/worker-notification-coordinator.js +90 -0
- package/dist/core/delegation/worker-notification-coordinator.js.map +1 -0
- package/dist/core/delegation/worker-profile-resolver.d.ts +55 -0
- package/dist/core/delegation/worker-profile-resolver.d.ts.map +1 -0
- package/dist/core/delegation/worker-profile-resolver.js +113 -0
- package/dist/core/delegation/worker-profile-resolver.js.map +1 -0
- package/dist/core/delegation/worker-runner.d.ts +25 -14
- package/dist/core/delegation/worker-runner.d.ts.map +1 -1
- package/dist/core/delegation/worker-runner.js +122 -53
- package/dist/core/delegation/worker-runner.js.map +1 -1
- package/dist/core/delegation/worker-task-label.d.ts +3 -0
- package/dist/core/delegation/worker-task-label.d.ts.map +1 -0
- package/dist/core/delegation/worker-task-label.js +11 -0
- package/dist/core/delegation/worker-task-label.js.map +1 -0
- package/dist/core/doctor.d.ts +8 -0
- package/dist/core/doctor.d.ts.map +1 -1
- package/dist/core/doctor.js +32 -1
- package/dist/core/doctor.js.map +1 -1
- package/dist/core/extensions/index.d.ts +1 -1
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/loader.d.ts +5 -1
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +50 -15
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +6 -0
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/storage.d.ts +8 -0
- package/dist/core/extensions/storage.d.ts.map +1 -0
- package/dist/core/extensions/storage.js +28 -0
- package/dist/core/extensions/storage.js.map +1 -0
- package/dist/core/extensions/types.d.ts +70 -21
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/failure-corpus.d.ts +1 -15
- package/dist/core/failure-corpus.d.ts.map +1 -1
- package/dist/core/failure-corpus.js +9 -37
- package/dist/core/failure-corpus.js.map +1 -1
- package/dist/core/foreground-recovery-controller.d.ts +52 -0
- package/dist/core/foreground-recovery-controller.d.ts.map +1 -0
- package/dist/core/foreground-recovery-controller.js +111 -0
- package/dist/core/foreground-recovery-controller.js.map +1 -0
- package/dist/core/gateways/channel-provider.d.ts +3 -0
- package/dist/core/gateways/channel-provider.d.ts.map +1 -1
- package/dist/core/gateways/channel-provider.js +31 -6
- package/dist/core/gateways/channel-provider.js.map +1 -1
- package/dist/core/goals/goal-acceptance.d.ts +11 -0
- package/dist/core/goals/goal-acceptance.d.ts.map +1 -0
- package/dist/core/goals/goal-acceptance.js +25 -0
- package/dist/core/goals/goal-acceptance.js.map +1 -0
- package/dist/core/goals/goal-auto-continue-controller.d.ts +27 -0
- package/dist/core/goals/goal-auto-continue-controller.d.ts.map +1 -0
- package/dist/core/goals/goal-auto-continue-controller.js +93 -0
- package/dist/core/goals/goal-auto-continue-controller.js.map +1 -0
- package/dist/core/goals/goal-continuation-controller.d.ts +1 -1
- package/dist/core/goals/goal-continuation-controller.d.ts.map +1 -1
- package/dist/core/goals/goal-continuation-controller.js +10 -0
- package/dist/core/goals/goal-continuation-controller.js.map +1 -1
- package/dist/core/goals/goal-continuation-prompt.d.ts +1 -1
- package/dist/core/goals/goal-continuation-prompt.d.ts.map +1 -1
- package/dist/core/goals/goal-continuation-prompt.js +6 -6
- package/dist/core/goals/goal-continuation-prompt.js.map +1 -1
- package/dist/core/goals/goal-lifecycle.d.ts +20 -0
- package/dist/core/goals/goal-lifecycle.d.ts.map +1 -0
- package/dist/core/goals/goal-lifecycle.js +17 -0
- package/dist/core/goals/goal-lifecycle.js.map +1 -0
- package/dist/core/goals/goal-runtime-snapshot.d.ts +11 -9
- package/dist/core/goals/goal-runtime-snapshot.d.ts.map +1 -1
- package/dist/core/goals/goal-runtime-snapshot.js +10 -8
- package/dist/core/goals/goal-runtime-snapshot.js.map +1 -1
- package/dist/core/goals/goal-state.d.ts +1 -0
- package/dist/core/goals/goal-state.d.ts.map +1 -1
- package/dist/core/goals/goal-state.js +7 -10
- package/dist/core/goals/goal-state.js.map +1 -1
- package/dist/core/goals/goal-tool-core.d.ts +8 -6
- package/dist/core/goals/goal-tool-core.d.ts.map +1 -1
- package/dist/core/goals/goal-tool-core.js +11 -41
- package/dist/core/goals/goal-tool-core.js.map +1 -1
- package/dist/core/goals/session-goal-state.d.ts +2 -4
- package/dist/core/goals/session-goal-state.d.ts.map +1 -1
- package/dist/core/goals/session-goal-state.js +10 -33
- package/dist/core/goals/session-goal-state.js.map +1 -1
- package/dist/core/human-input.d.ts +100 -0
- package/dist/core/human-input.d.ts.map +1 -0
- package/dist/core/human-input.js +362 -0
- package/dist/core/human-input.js.map +1 -0
- package/dist/core/index.d.ts +9 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +9 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/{telemetry.d.ts → install-telemetry.d.ts} +1 -1
- package/dist/core/install-telemetry.d.ts.map +1 -0
- package/dist/core/{telemetry.js → install-telemetry.js} +1 -1
- package/dist/core/install-telemetry.js.map +1 -0
- package/dist/core/keybindings.d.ts +17 -1
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +24 -6
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/learning/learning-audit.d.ts +2 -4
- package/dist/core/learning/learning-audit.d.ts.map +1 -1
- package/dist/core/learning/learning-audit.js +9 -29
- package/dist/core/learning/learning-audit.js.map +1 -1
- package/dist/core/learning/learning-gate.d.ts.map +1 -1
- package/dist/core/learning/learning-gate.js +1 -6
- package/dist/core/learning/learning-gate.js.map +1 -1
- package/dist/core/learning/session-learning-decision.d.ts +2 -4
- package/dist/core/learning/session-learning-decision.d.ts.map +1 -1
- package/dist/core/learning/session-learning-decision.js +9 -29
- package/dist/core/learning/session-learning-decision.js.map +1 -1
- package/dist/core/memory-controller.d.ts.map +1 -1
- package/dist/core/memory-controller.js +4 -4
- package/dist/core/memory-controller.js.map +1 -1
- package/dist/core/model-capability.d.ts.map +1 -1
- package/dist/core/model-capability.js +1 -0
- package/dist/core/model-capability.js.map +1 -1
- package/dist/core/model-resolver.d.ts +1 -1
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +6 -9
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/model-router/intent-classifier.d.ts +1 -4
- package/dist/core/model-router/intent-classifier.d.ts.map +1 -1
- package/dist/core/model-router/intent-classifier.js +1 -156
- package/dist/core/model-router/intent-classifier.js.map +1 -1
- package/dist/core/model-router-controller.d.ts.map +1 -1
- package/dist/core/model-router-controller.js +2 -2
- package/dist/core/model-router-controller.js.map +1 -1
- package/dist/core/model-selection-controller.d.ts +4 -4
- package/dist/core/model-selection-controller.d.ts.map +1 -1
- package/dist/core/model-selection-controller.js.map +1 -1
- package/dist/core/model-tool-protocol.d.ts +23 -0
- package/dist/core/model-tool-protocol.d.ts.map +1 -0
- package/dist/core/model-tool-protocol.js +43 -0
- package/dist/core/model-tool-protocol.js.map +1 -0
- package/dist/core/models/adaptation-store.d.ts +4 -6
- package/dist/core/models/adaptation-store.d.ts.map +1 -1
- package/dist/core/models/adaptation-store.js +95 -83
- package/dist/core/models/adaptation-store.js.map +1 -1
- package/dist/core/models/fitness-store.d.ts +2 -12
- package/dist/core/models/fitness-store.d.ts.map +1 -1
- package/dist/core/models/fitness-store.js +84 -57
- package/dist/core/models/fitness-store.js.map +1 -1
- package/dist/core/models/host-state-store.d.ts +34 -0
- package/dist/core/models/host-state-store.d.ts.map +1 -0
- package/dist/core/models/host-state-store.js +86 -0
- package/dist/core/models/host-state-store.js.map +1 -0
- package/dist/core/orchestration/agent-resume.d.ts +24 -0
- package/dist/core/orchestration/agent-resume.d.ts.map +1 -0
- package/dist/core/orchestration/agent-resume.js +90 -0
- package/dist/core/orchestration/agent-resume.js.map +1 -0
- package/dist/core/orchestration/capability-gateway.d.ts +61 -0
- package/dist/core/orchestration/capability-gateway.d.ts.map +1 -0
- package/dist/core/orchestration/capability-gateway.js +152 -0
- package/dist/core/orchestration/capability-gateway.js.map +1 -0
- package/dist/core/orchestration/contracts.d.ts +343 -0
- package/dist/core/orchestration/contracts.d.ts.map +1 -0
- package/dist/core/orchestration/contracts.js +135 -0
- package/dist/core/orchestration/contracts.js.map +1 -0
- package/dist/core/orchestration/delegation-ledger.d.ts +56 -0
- package/dist/core/orchestration/delegation-ledger.d.ts.map +1 -0
- package/dist/core/orchestration/delegation-ledger.js +197 -0
- package/dist/core/orchestration/delegation-ledger.js.map +1 -0
- package/dist/core/orchestration/event-store.d.ts +83 -0
- package/dist/core/orchestration/event-store.d.ts.map +1 -0
- package/dist/core/orchestration/event-store.js +560 -0
- package/dist/core/orchestration/event-store.js.map +1 -0
- package/dist/core/orchestration/lane-tool-manifests.d.ts +9 -0
- package/dist/core/orchestration/lane-tool-manifests.d.ts.map +1 -0
- package/dist/core/orchestration/lane-tool-manifests.js +37 -0
- package/dist/core/orchestration/lane-tool-manifests.js.map +1 -0
- package/dist/core/orchestration/model-binding.d.ts +15 -0
- package/dist/core/orchestration/model-binding.d.ts.map +1 -0
- package/dist/core/orchestration/model-binding.js +29 -0
- package/dist/core/orchestration/model-binding.js.map +1 -0
- package/dist/core/orchestration/policy-compiler.d.ts +49 -0
- package/dist/core/orchestration/policy-compiler.d.ts.map +1 -0
- package/dist/core/orchestration/policy-compiler.js +191 -0
- package/dist/core/orchestration/policy-compiler.js.map +1 -0
- package/dist/core/orchestration/policy-gate.d.ts +18 -0
- package/dist/core/orchestration/policy-gate.d.ts.map +1 -0
- package/dist/core/orchestration/policy-gate.js +24 -0
- package/dist/core/orchestration/policy-gate.js.map +1 -0
- package/dist/core/orchestration/profile-registry.d.ts +51 -0
- package/dist/core/orchestration/profile-registry.d.ts.map +1 -0
- package/dist/core/orchestration/profile-registry.js +393 -0
- package/dist/core/orchestration/profile-registry.js.map +1 -0
- package/dist/core/orchestration/profile-store.d.ts +31 -0
- package/dist/core/orchestration/profile-store.d.ts.map +1 -0
- package/dist/core/orchestration/profile-store.js +136 -0
- package/dist/core/orchestration/profile-store.js.map +1 -0
- package/dist/core/orchestration/risk-budget.d.ts +9 -0
- package/dist/core/orchestration/risk-budget.d.ts.map +1 -0
- package/dist/core/orchestration/risk-budget.js +48 -0
- package/dist/core/orchestration/risk-budget.js.map +1 -0
- package/dist/core/orchestration/task-runtime.d.ts +168 -0
- package/dist/core/orchestration/task-runtime.d.ts.map +1 -0
- package/dist/core/orchestration/task-runtime.js +1600 -0
- package/dist/core/orchestration/task-runtime.js.map +1 -0
- package/dist/core/orchestration/work-state-projection.d.ts +32 -0
- package/dist/core/orchestration/work-state-projection.d.ts.map +1 -0
- package/dist/core/orchestration/work-state-projection.js +116 -0
- package/dist/core/orchestration/work-state-projection.js.map +1 -0
- package/dist/core/orchestration/worker-execution-contract.d.ts +21 -0
- package/dist/core/orchestration/worker-execution-contract.d.ts.map +1 -0
- package/dist/core/orchestration/worker-execution-contract.js +179 -0
- package/dist/core/orchestration/worker-execution-contract.js.map +1 -0
- package/dist/core/orchestration/worker-result-adapter.d.ts +21 -0
- package/dist/core/orchestration/worker-result-adapter.d.ts.map +1 -0
- package/dist/core/orchestration/worker-result-adapter.js +109 -0
- package/dist/core/orchestration/worker-result-adapter.js.map +1 -0
- package/dist/core/process-identity.d.ts +11 -0
- package/dist/core/process-identity.d.ts.map +1 -0
- package/dist/core/process-identity.js +26 -0
- package/dist/core/process-identity.js.map +1 -0
- package/dist/core/process-matrix/codes.d.ts +14 -3
- package/dist/core/process-matrix/codes.d.ts.map +1 -1
- package/dist/core/process-matrix/codes.js.map +1 -1
- package/dist/core/process-matrix/resume-launcher.d.ts +26 -0
- package/dist/core/process-matrix/resume-launcher.d.ts.map +1 -0
- package/dist/core/process-matrix/resume-launcher.js +62 -0
- package/dist/core/process-matrix/resume-launcher.js.map +1 -0
- package/dist/core/process-matrix/runtime.d.ts +37 -22
- package/dist/core/process-matrix/runtime.d.ts.map +1 -1
- package/dist/core/process-matrix/runtime.js +399 -76
- package/dist/core/process-matrix/runtime.js.map +1 -1
- package/dist/core/process-matrix/store.d.ts +5 -2
- package/dist/core/process-matrix/store.d.ts.map +1 -1
- package/dist/core/process-matrix/store.js +123 -14
- package/dist/core/process-matrix/store.js.map +1 -1
- package/dist/core/process-matrix/supervisor.d.ts +10 -7
- package/dist/core/process-matrix/supervisor.d.ts.map +1 -1
- package/dist/core/process-matrix/supervisor.js +45 -14
- package/dist/core/process-matrix/supervisor.js.map +1 -1
- package/dist/core/profile-registry.d.ts.map +1 -1
- package/dist/core/profile-registry.js +6 -8
- package/dist/core/profile-registry.js.map +1 -1
- package/dist/core/reflection-controller.d.ts +4 -4
- package/dist/core/reflection-controller.d.ts.map +1 -1
- package/dist/core/reflection-controller.js +2 -1
- package/dist/core/reflection-controller.js.map +1 -1
- package/dist/core/reload-blockers.d.ts.map +1 -1
- package/dist/core/reload-blockers.js +6 -8
- package/dist/core/reload-blockers.js.map +1 -1
- package/dist/core/research/evidence-bundle.d.ts.map +1 -1
- package/dist/core/research/evidence-bundle.js +1 -6
- package/dist/core/research/evidence-bundle.js.map +1 -1
- package/dist/core/research/lane-model-resolver.d.ts +33 -0
- package/dist/core/research/lane-model-resolver.d.ts.map +1 -0
- package/dist/core/research/lane-model-resolver.js +65 -0
- package/dist/core/research/lane-model-resolver.js.map +1 -0
- package/dist/core/research/model-fitness-controller.d.ts +38 -0
- package/dist/core/research/model-fitness-controller.d.ts.map +1 -0
- package/dist/core/research/model-fitness-controller.js +106 -0
- package/dist/core/research/model-fitness-controller.js.map +1 -0
- package/dist/core/research/model-fitness.d.ts +1 -1
- package/dist/core/research/model-fitness.d.ts.map +1 -1
- package/dist/core/research/model-fitness.js +4 -4
- package/dist/core/research/model-fitness.js.map +1 -1
- package/dist/core/research/research-gate.d.ts.map +1 -1
- package/dist/core/research/research-gate.js +7 -7
- package/dist/core/research/research-gate.js.map +1 -1
- package/dist/core/research/research-lane-controller.d.ts +62 -0
- package/dist/core/research/research-lane-controller.d.ts.map +1 -0
- package/dist/core/research/research-lane-controller.js +292 -0
- package/dist/core/research/research-lane-controller.js.map +1 -0
- package/dist/core/research/session-evidence-bundle.d.ts +2 -4
- package/dist/core/research/session-evidence-bundle.d.ts.map +1 -1
- package/dist/core/research/session-evidence-bundle.js +10 -46
- package/dist/core/research/session-evidence-bundle.js.map +1 -1
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +7 -2
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/risk-classifier.d.ts +6 -0
- package/dist/core/risk-classifier.d.ts.map +1 -0
- package/dist/core/risk-classifier.js +225 -0
- package/dist/core/risk-classifier.js.map +1 -0
- package/dist/core/runtime-builder.d.ts +26 -20
- package/dist/core/runtime-builder.d.ts.map +1 -1
- package/dist/core/runtime-builder.js +237 -178
- package/dist/core/runtime-builder.js.map +1 -1
- package/dist/core/sdk.d.ts +6 -3
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +61 -24
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-analytics.d.ts.map +1 -1
- package/dist/core/session-analytics.js +28 -1
- package/dist/core/session-analytics.js.map +1 -1
- package/dist/core/session-image-store.d.ts +33 -0
- package/dist/core/session-image-store.d.ts.map +1 -0
- package/dist/core/session-image-store.js +283 -0
- package/dist/core/session-image-store.js.map +1 -0
- package/dist/core/session-role.d.ts +6 -4
- package/dist/core/session-role.d.ts.map +1 -1
- package/dist/core/session-role.js +10 -4
- package/dist/core/session-role.js.map +1 -1
- package/dist/core/session-snapshot.d.ts +34 -0
- package/dist/core/session-snapshot.d.ts.map +1 -0
- package/dist/core/session-snapshot.js +68 -0
- package/dist/core/session-snapshot.js.map +1 -0
- package/dist/core/session-supervision-runtime.d.ts +31 -0
- package/dist/core/session-supervision-runtime.d.ts.map +1 -0
- package/dist/core/session-supervision-runtime.js +97 -0
- package/dist/core/session-supervision-runtime.js.map +1 -0
- package/dist/core/settings-manager.d.ts +9 -4
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +80 -28
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/tasks/session-task-state.d.ts +2 -4
- package/dist/core/tasks/session-task-state.d.ts.map +1 -1
- package/dist/core/tasks/session-task-state.js +10 -28
- package/dist/core/tasks/session-task-state.js.map +1 -1
- package/dist/core/tasks/task-projection.d.ts +20 -0
- package/dist/core/tasks/task-projection.d.ts.map +1 -0
- package/dist/core/tasks/task-projection.js +47 -0
- package/dist/core/tasks/task-projection.js.map +1 -0
- package/dist/core/tasks/task-state.d.ts +4 -0
- package/dist/core/tasks/task-state.d.ts.map +1 -1
- package/dist/core/tasks/task-state.js +28 -11
- package/dist/core/tasks/task-state.js.map +1 -1
- package/dist/core/tool-capability-policy.d.ts +13 -0
- package/dist/core/tool-capability-policy.d.ts.map +1 -0
- package/dist/core/tool-capability-policy.js +85 -0
- package/dist/core/tool-capability-policy.js.map +1 -0
- package/dist/core/tool-protocol-controller.d.ts +91 -0
- package/dist/core/tool-protocol-controller.d.ts.map +1 -0
- package/dist/core/tool-protocol-controller.js +512 -0
- package/dist/core/tool-protocol-controller.js.map +1 -0
- package/dist/core/tool-recovery-log-records.d.ts +2 -3
- package/dist/core/tool-recovery-log-records.d.ts.map +1 -1
- package/dist/core/tool-recovery-log-records.js +9 -35
- package/dist/core/tool-recovery-log-records.js.map +1 -1
- package/dist/core/tool-selection/tool-performance-store.d.ts +3 -7
- package/dist/core/tool-selection/tool-performance-store.d.ts.map +1 -1
- package/dist/core/tool-selection/tool-performance-store.js +97 -138
- package/dist/core/tool-selection/tool-performance-store.js.map +1 -1
- package/dist/core/tools/ask-question.d.ts +124 -0
- package/dist/core/tools/ask-question.d.ts.map +1 -0
- package/dist/core/tools/ask-question.js +693 -0
- package/dist/core/tools/ask-question.js.map +1 -0
- package/dist/core/tools/delegate-status.d.ts +31 -3
- package/dist/core/tools/delegate-status.d.ts.map +1 -1
- package/dist/core/tools/delegate-status.js +149 -29
- package/dist/core/tools/delegate-status.js.map +1 -1
- package/dist/core/tools/delegate.d.ts +15 -13
- package/dist/core/tools/delegate.d.ts.map +1 -1
- package/dist/core/tools/delegate.js +108 -23
- package/dist/core/tools/delegate.js.map +1 -1
- package/dist/core/tools/extensionify.d.ts.map +1 -1
- package/dist/core/tools/extensionify.js +1 -0
- package/dist/core/tools/extensionify.js.map +1 -1
- package/dist/core/tools/goal.d.ts +5 -5
- package/dist/core/tools/goal.d.ts.map +1 -1
- package/dist/core/tools/goal.js +10 -10
- package/dist/core/tools/goal.js.map +1 -1
- package/dist/core/tools/model-fitness.d.ts.map +1 -1
- package/dist/core/tools/model-fitness.js +2 -2
- package/dist/core/tools/model-fitness.js.map +1 -1
- package/dist/core/tools/orchestration-panel.d.ts +43 -0
- package/dist/core/tools/orchestration-panel.d.ts.map +1 -0
- package/dist/core/tools/orchestration-panel.js +168 -0
- package/dist/core/tools/orchestration-panel.js.map +1 -0
- package/dist/core/tools/run-process.d.ts +26 -0
- package/dist/core/tools/run-process.d.ts.map +1 -0
- package/dist/core/tools/run-process.js +138 -0
- package/dist/core/tools/run-process.js.map +1 -0
- package/dist/core/tools/task-steps.d.ts +2 -0
- package/dist/core/tools/task-steps.d.ts.map +1 -1
- package/dist/core/tools/task-steps.js +102 -0
- package/dist/core/tools/task-steps.js.map +1 -1
- package/dist/core/tools/tmux-dispatch.d.ts +3 -5
- package/dist/core/tools/tmux-dispatch.d.ts.map +1 -1
- package/dist/core/tools/tmux-dispatch.js +4 -4
- package/dist/core/tools/tmux-dispatch.js.map +1 -1
- package/dist/core/tools/windows-shell-engine.d.ts.map +1 -1
- package/dist/core/tools/windows-shell-engine.js +4 -6
- package/dist/core/tools/windows-shell-engine.js.map +1 -1
- package/dist/core/util/bounded-jsonl.d.ts +10 -0
- package/dist/core/util/bounded-jsonl.d.ts.map +1 -0
- package/dist/core/util/bounded-jsonl.js +75 -0
- package/dist/core/util/bounded-jsonl.js.map +1 -0
- package/dist/core/util/value-guards.d.ts +5 -0
- package/dist/core/util/value-guards.d.ts.map +1 -0
- package/dist/core/util/value-guards.js +12 -0
- package/dist/core/util/value-guards.js.map +1 -0
- package/dist/core/worktree-sync/store.d.ts +3 -3
- package/dist/core/worktree-sync/store.d.ts.map +1 -1
- package/dist/core/worktree-sync/store.js +10 -5
- package/dist/core/worktree-sync/store.js.map +1 -1
- package/dist/index.d.ts +13 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -2
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +128 -44
- package/dist/main.js.map +1 -1
- package/dist/migrations.d.ts +4 -6
- package/dist/migrations.d.ts.map +1 -1
- package/dist/migrations.js +186 -28
- package/dist/migrations.js.map +1 -1
- package/dist/modes/interactive/clipboard-input.d.ts +7 -1
- package/dist/modes/interactive/clipboard-input.d.ts.map +1 -1
- package/dist/modes/interactive/clipboard-input.js +44 -6
- package/dist/modes/interactive/clipboard-input.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +2 -2
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/config-backup.d.ts.map +1 -1
- package/dist/modes/interactive/config-backup.js +5 -4
- package/dist/modes/interactive/config-backup.js.map +1 -1
- package/dist/modes/interactive/extension-ui-host.d.ts +14 -0
- package/dist/modes/interactive/extension-ui-host.d.ts.map +1 -1
- package/dist/modes/interactive/extension-ui-host.js +76 -15
- package/dist/modes/interactive/extension-ui-host.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +3 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +63 -1
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/key-handlers.d.ts.map +1 -1
- package/dist/modes/interactive/key-handlers.js +1 -1
- package/dist/modes/interactive/key-handlers.js.map +1 -1
- package/dist/modes/interactive/profile-menu-controller.d.ts.map +1 -1
- package/dist/modes/interactive/profile-menu-controller.js +7 -7
- package/dist/modes/interactive/profile-menu-controller.js.map +1 -1
- package/dist/modes/interactive/report-commands.d.ts.map +1 -1
- package/dist/modes/interactive/report-commands.js +21 -0
- package/dist/modes/interactive/report-commands.js.map +1 -1
- package/dist/modes/interactive/session-flow-commands.d.ts +17 -2
- package/dist/modes/interactive/session-flow-commands.d.ts.map +1 -1
- package/dist/modes/interactive/session-flow-commands.js +50 -17
- package/dist/modes/interactive/session-flow-commands.js.map +1 -1
- package/dist/modes/interactive/session-io-commands.d.ts.map +1 -1
- package/dist/modes/interactive/session-io-commands.js +16 -6
- package/dist/modes/interactive/session-io-commands.js.map +1 -1
- package/dist/modes/interactive/session-replacement-errors.d.ts +7 -0
- package/dist/modes/interactive/session-replacement-errors.d.ts.map +1 -0
- package/dist/modes/interactive/session-replacement-errors.js +15 -0
- package/dist/modes/interactive/session-replacement-errors.js.map +1 -0
- package/dist/modes/interactive/startup-checks.d.ts.map +1 -1
- package/dist/modes/interactive/startup-checks.js +1 -1
- package/dist/modes/interactive/startup-checks.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +82 -23
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +15 -0
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js +138 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/utils/clipboard-image.d.ts.map +1 -1
- package/dist/utils/clipboard-image.js +2 -13
- package/dist/utils/clipboard-image.js.map +1 -1
- package/dist/utils/clipboard-native.d.ts +1 -0
- package/dist/utils/clipboard-native.d.ts.map +1 -1
- package/dist/utils/clipboard-native.js.map +1 -1
- package/dist/utils/clipboard.d.ts +1 -0
- package/dist/utils/clipboard.d.ts.map +1 -1
- package/dist/utils/clipboard.js +52 -1
- package/dist/utils/clipboard.js.map +1 -1
- package/dist/utils/platform.d.ts +3 -0
- package/dist/utils/platform.d.ts.map +1 -0
- package/dist/utils/platform.js +8 -0
- package/dist/utils/platform.js.map +1 -0
- package/dist/utils/work-directory.d.ts +11 -0
- package/dist/utils/work-directory.d.ts.map +1 -1
- package/dist/utils/work-directory.js +30 -9
- package/dist/utils/work-directory.js.map +1 -1
- package/docs/UI_POLISH_ORCHESTRATION.md +44 -0
- package/docs/UI_QUALITY_ORCHESTRATION.md +30 -0
- package/docs/docs.json +4 -0
- package/docs/extensions.md +62 -2
- package/docs/harness-architecture.md +156 -0
- package/docs/keybindings.md +11 -1
- package/docs/process-matrix.md +59 -26
- package/docs/rpc.md +45 -2
- package/docs/sessions.md +15 -0
- package/docs/settings.md +125 -11
- package/docs/task-steps.md +8 -0
- package/docs/telemetry.md +19 -0
- package/docs/tmux-agent-manager.md +10 -3
- package/docs/ui-reference/README.md +9 -0
- package/docs/ui-reference/orchestration-after.txt +7 -0
- package/docs/ui-reference/orchestration-before.txt +7 -0
- package/docs/ui-reference/orchestration-reference.txt +6 -0
- package/docs/usage.md +14 -2
- package/docs/work-directory.md +19 -8
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/question.ts +34 -245
- package/examples/extensions/questionnaire.ts +41 -407
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/npm-shrinkwrap.json +12 -12
- package/package.json +4 -4
- package/dist/core/delegation/session-worker-result.d.ts +0 -46
- package/dist/core/delegation/session-worker-result.d.ts.map +0 -1
- package/dist/core/delegation/session-worker-result.js +0 -113
- package/dist/core/delegation/session-worker-result.js.map +0 -1
- package/dist/core/delegation/worker-result.d.ts.map +0 -1
- package/dist/core/delegation/worker-result.js.map +0 -1
- package/dist/core/telemetry.d.ts.map +0 -1
- package/dist/core/telemetry.js.map +0 -1
package/docs/process-matrix.md
CHANGED
|
@@ -15,20 +15,49 @@ process breaks.
|
|
|
15
15
|
|
|
16
16
|
Every `pi` process registers exactly one entry in the matrix, keyed by `<role>-<sessionId>`, under
|
|
17
17
|
`state/process-matrix/` (see `agent-paths.ts` -- durable, survives `/reload` and crashes, not the
|
|
18
|
-
transient `work/` tree).
|
|
18
|
+
transient `work/` tree). The session ID is derived from the entry's single `AgentIdentityContract`;
|
|
19
|
+
process entries and resumable payloads do not carry parallel agent/session/lane context fields. All
|
|
20
|
+
post-registration transitions use the same per-entry lock and replace/delete only the exact process
|
|
21
|
+
generation they observed. An older same-session process therefore loses write ownership as soon as a
|
|
22
|
+
newer process registers; its late heartbeat, reconciliation, or exit hook cannot overwrite the newer
|
|
23
|
+
entry.
|
|
19
24
|
|
|
20
25
|
- **Master** (no declared parent): writes its own entry once at startup, heartbeats it on an
|
|
21
26
|
interval, and -- once, at startup -- scans the matrix for **orphaned workers**: worker entries
|
|
22
|
-
whose recorded parent pid is dead.
|
|
27
|
+
whose recorded parent pid is dead. `/new`, `/resume`, and `/fork` replace this session-owned
|
|
28
|
+
runtime, so its identity, notifications, and scan always follow the active session.
|
|
23
29
|
- **Worker** (launched with `PI_PARENT_PID` / `--parent-pid` set): self-registers its own entry
|
|
24
30
|
(the only writer of that entry during normal operation) and watches its parent's liveness on a
|
|
25
31
|
poll interval.
|
|
26
32
|
|
|
27
33
|
### Resume: a master never auto-kills what it finds
|
|
28
34
|
|
|
29
|
-
On startup, a master's orphan scan finds worker entries whose parent
|
|
30
|
-
those workers are also dead -- a worker can outlive a crashed parent --
|
|
31
|
-
|
|
35
|
+
On startup or in-process session resume, a master's orphan scan finds worker entries whose parent
|
|
36
|
+
is dead. It never assumes those workers are also dead -- a worker can outlive a crashed parent --
|
|
37
|
+
so it never kills anything. Recovery is identity-fenced:
|
|
38
|
+
|
|
39
|
+
- If the worker's recorded `parentSessionId` and `taskRef` exactly match the active session and its
|
|
40
|
+
active goal/task identity, resume restores that existing ownership without another approval. A
|
|
41
|
+
live worker is re-adopted; a dead worker with a complete resumable Pi context is relaunched as the
|
|
42
|
+
same logical agent. Terminal or still-blocked goals disable automatic recovery. This works in
|
|
43
|
+
interactive, print, and RPC modes and is the process-level counterpart to `/resume` restoring the
|
|
44
|
+
goal before supervisors start.
|
|
45
|
+
- Every foreign orphan remains owner-gated. Interactive mode offers resume/adopt/cleanup; headless
|
|
46
|
+
modes report it without writes or process actions.
|
|
47
|
+
|
|
48
|
+
When a foreign worker's own process is dead and its resumable payload contains a Pi session
|
|
49
|
+
context, the first prompt offers to resume that same logical agent. Acceptance launches the exact
|
|
50
|
+
persisted session file with its agent ID, cwd, worktree, orchestration profile, resource pointers,
|
|
51
|
+
and bounded wake task. The direct-argv launch prefers the exact persisted `sessionFile` over an ID
|
|
52
|
+
lookup, carries the stable logical-agent ID in `PI_ORCHESTRATION_AGENT_ID`, and names the latest
|
|
53
|
+
checkpoint plus bounded context pointers in the wake prompt instead of copying a second transcript.
|
|
54
|
+
The resumed process overwrites the same `<role>-<sessionId>` matrix entry. The launcher publishes its
|
|
55
|
+
PID before self-registration, and terminal persistence plus delivery acknowledgement conditionally
|
|
56
|
+
replace only the process generation they observed. A stale completion can therefore never close a
|
|
57
|
+
newer replacement. The terminal event is first persisted as an undelivered matrix handoff, then
|
|
58
|
+
delivered to the owning parent session and marked delivered. If that owner switched sessions before
|
|
59
|
+
the event arrived, the bounded handoff survives and replays on its next resume instead of being
|
|
60
|
+
injected into the wrong transcript. A still-live foreign orphan follows the adopt/cleanup flow below.
|
|
32
61
|
|
|
33
62
|
1. Ask: *"adopt worker `<entryId>` (lane `<laneKey>`)?"* Yes → this session becomes the worker's
|
|
34
63
|
new parent (an adoption grant is written into the worker's own entry).
|
|
@@ -37,16 +66,17 @@ silently repurposes anything. Instead, for each orphan, **interactively**:
|
|
|
37
66
|
killed).
|
|
38
67
|
3. If both declined: leave the entry untouched.
|
|
39
68
|
|
|
40
|
-
**Non-interactively** (print/RPC mode, or no TTY),
|
|
41
|
-
and writes nothing
|
|
42
|
-
|
|
69
|
+
**Non-interactively** (print/RPC mode, or no TTY), foreign orphans are report-only: the scan logs
|
|
70
|
+
what it found and writes nothing. Exact-session recovery remains active because it restores an
|
|
71
|
+
already-recorded authority relationship rather than claiming another session's worker.
|
|
43
72
|
|
|
44
73
|
### A worker on parent death: wind down, never vanish
|
|
45
74
|
|
|
46
75
|
A worker polls its parent's pid on `watcherPollMs`. The moment that pid is no longer alive, it:
|
|
47
76
|
|
|
48
77
|
1. Marks its own entry `winding_down` (reason `parent_lost`), then `resumable` with a payload
|
|
49
|
-
|
|
78
|
+
containing one clone of its logical-agent identity (exact Pi session/cwd/profile/lane context),
|
|
79
|
+
its stable task reference, and a bounded task summary.
|
|
50
80
|
2. Emits one steer notice into its own session.
|
|
51
81
|
3. Starts a bounded grace window (`adoptionGraceMs`), polling its own entry every
|
|
52
82
|
`watcherPollMs` for a directive a new master may have written (see above):
|
|
@@ -67,10 +97,13 @@ Cross-process, like `PI_WORKTREE_LANE`/`--worktree-lane`:
|
|
|
67
97
|
|---|---|---|
|
|
68
98
|
| `PI_PARENT_PID` | `--parent-pid <pid>` | Declares this process as a worker of `<pid>`. A malformed or non-positive value is ignored (never a crash on bad env) -- the process falls back to acting as a master. |
|
|
69
99
|
| `PI_PARENT_SESSION` | `--parent-session <id>` | The parent's sessionId, recorded alongside the pid for diagnostics/adoption. |
|
|
100
|
+
| `PI_ORCHESTRATION_AGENT_ID` | launch-only | Pins the logical agent identity across the initial process and exact-session resumes. |
|
|
101
|
+
| `PI_TASK_REF` | `--task-ref <id>` | Pins the goal/task identity used to fence automatic recovery across process generations. |
|
|
70
102
|
|
|
71
|
-
`tmux_agent_manager`'s `fire_task` sets
|
|
72
|
-
|
|
73
|
-
dispatch -- see `dispatch-grant.ts`'s
|
|
103
|
+
`tmux_agent_manager`'s `fire_task` sets the parent pid/session and logical agent ID automatically on
|
|
104
|
+
every `pi`-provider child it launches. Goal-bound launches also set `PI_TASK_REF` from `goalId`, the
|
|
105
|
+
same way lane-first dispatch threads `--worktree-lane` -- see `dispatch-grant.ts`'s
|
|
106
|
+
`LaunchProfileSource`.
|
|
74
107
|
|
|
75
108
|
## Settings
|
|
76
109
|
|
|
@@ -91,12 +124,11 @@ process-matrix entry are a sanctioned artifact, exactly like its own session tra
|
|
|
91
124
|
ceiling is untouched, and this is not a new escalation surface. A worker never writes any *other*
|
|
92
125
|
session's entry.
|
|
93
126
|
|
|
94
|
-
The
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
than assumed. Outside that one handshake, a master never writes another session's entry.
|
|
127
|
+
The narrow exceptions on the master side are identity-fenced exact-session recovery and the
|
|
128
|
+
ask-gated foreign-orphan scan. Exact recovery may restore the same recorded parent session without
|
|
129
|
+
another prompt. Claiming or cleaning up a foreign orphan still requires explicit owner approval and
|
|
130
|
+
writes only that orphan's entry. Outside those handshakes, a master never writes another session's
|
|
131
|
+
entry.
|
|
100
132
|
|
|
101
133
|
## Foreign-CLI limitation
|
|
102
134
|
|
|
@@ -110,11 +142,12 @@ cooperative boundary this system cannot structurally enforce across an arbitrary
|
|
|
110
142
|
|
|
111
143
|
- It never kills a process. Every termination is either the process's own cooperative self-exit or
|
|
112
144
|
an owner-confirmed grant the process itself later notices and applies.
|
|
113
|
-
- It does not re-attach a tmux pane or re-dispatch a lane
|
|
114
|
-
worker considers its parent
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
145
|
+
- It does not re-attach a tmux pane or re-dispatch a lane when adopting a still-live worker --
|
|
146
|
+
adoption changes who that worker considers its parent. Relaunch is reserved for a dead worker
|
|
147
|
+
with a complete persisted Pi resume context. Exact session+task recovery is automatic; every
|
|
148
|
+
mismatched or foreign identity remains owner-gated.
|
|
149
|
+
- Correctness never depends on a heartbeat or watcher tick arriving. Each master activation runs
|
|
150
|
+
the pure reconciliation pass once: a Pi worker interrupted before its own resumable write is
|
|
151
|
+
repaired from its durable logical-agent identity, closed and unrecoverable records are removed,
|
|
152
|
+
undelivered terminal handoffs are retained, and resumable/adopted/pending-terminal records remain
|
|
153
|
+
recoverable for at most 30 days before expiry.
|
package/docs/rpc.md
CHANGED
|
@@ -1063,7 +1063,7 @@ Extensions can request user interaction via `ctx.ui.select()`, `ctx.ui.confirm()
|
|
|
1063
1063
|
|
|
1064
1064
|
There are two categories of extension UI methods:
|
|
1065
1065
|
|
|
1066
|
-
- **Dialog methods** (`select`, `confirm`, `input`, `editor`): emit an `extension_ui_request` on stdout and block until the client sends back an `extension_ui_response` on stdin with the matching `id`.
|
|
1066
|
+
- **Dialog methods** (`questions`, `select`, `confirm`, `input`, `editor`): emit an `extension_ui_request` on stdout and block until the client sends back an `extension_ui_response` on stdin with the matching `id`.
|
|
1067
1067
|
- **Fire-and-forget methods** (`notify`, `setStatus`, `setWidget`, `setTitle`, `set_editor_text`): emit an `extension_ui_request` on stdout but do not expect a response. The client can display the information or ignore it.
|
|
1068
1068
|
|
|
1069
1069
|
If a dialog method includes a `timeout` field, the agent-side will auto-resolve with a default value when the timeout expires. The client does not need to track timeouts.
|
|
@@ -1084,6 +1084,33 @@ Note: `ctx.hasUI` is `true` in RPC mode because the dialog and fire-and-forget m
|
|
|
1084
1084
|
|
|
1085
1085
|
All requests have `type: "extension_ui_request"`, a unique `id`, and a `method` field.
|
|
1086
1086
|
|
|
1087
|
+
#### questions
|
|
1088
|
+
|
|
1089
|
+
Present the native structured owner-input contract. `request.questions` contains one to four questions, each with a stable `id`, heading, prompt, two to four options, and optional `multiSelect`. `acceptsImages` reports whether the routed model can receive image answer blocks.
|
|
1090
|
+
|
|
1091
|
+
```json
|
|
1092
|
+
{
|
|
1093
|
+
"type": "extension_ui_request",
|
|
1094
|
+
"id": "uuid-q",
|
|
1095
|
+
"method": "questions",
|
|
1096
|
+
"request": {
|
|
1097
|
+
"requestId": "human-input:call-1",
|
|
1098
|
+
"acceptsImages": true,
|
|
1099
|
+
"questions": [{
|
|
1100
|
+
"id": "scope",
|
|
1101
|
+
"header": "Scope",
|
|
1102
|
+
"question": "How broad should this be?",
|
|
1103
|
+
"options": [
|
|
1104
|
+
{"label": "Focused", "description": "Change only the failing workflow."},
|
|
1105
|
+
{"label": "Complete", "description": "Cover the full related surface."}
|
|
1106
|
+
]
|
|
1107
|
+
}]
|
|
1108
|
+
}
|
|
1109
|
+
}
|
|
1110
|
+
```
|
|
1111
|
+
|
|
1112
|
+
Expected response: `extension_ui_response` with an `answers` array and optional `images` array, or `cancelled: true`. Free-form answer text is not length-clamped by the protocol; Pi externalizes large values before they enter model context. Clients must not send `customArtifact`: artifact references are harness-owned. Submitted images are validated and retained in the bounded session image store before the answer checkpoint so `/resume` can restore them.
|
|
1113
|
+
|
|
1087
1114
|
#### select
|
|
1088
1115
|
|
|
1089
1116
|
Prompt the user to choose from a list. Dialog methods with a `timeout` field include the timeout in milliseconds; the agent auto-resolves with `undefined` if the client doesn't respond in time.
|
|
@@ -1227,7 +1254,23 @@ Set the text in the input editor. Fire-and-forget.
|
|
|
1227
1254
|
|
|
1228
1255
|
### Extension UI Responses (stdin)
|
|
1229
1256
|
|
|
1230
|
-
Responses are sent for dialog methods only (`select`, `confirm`, `input`, `editor`). The `id` must match the request.
|
|
1257
|
+
Responses are sent for dialog methods only (`questions`, `select`, `confirm`, `input`, `editor`). The `id` must match the request. Malformed, ambiguous, unknown, or expired responses fail closed with an `extension_ui_response` error instead of settling another request.
|
|
1258
|
+
|
|
1259
|
+
#### Structured question response
|
|
1260
|
+
|
|
1261
|
+
```json
|
|
1262
|
+
{
|
|
1263
|
+
"type": "extension_ui_response",
|
|
1264
|
+
"id": "uuid-q",
|
|
1265
|
+
"answers": [{
|
|
1266
|
+
"id": "scope",
|
|
1267
|
+
"header": "Scope",
|
|
1268
|
+
"question": "How broad should this be?",
|
|
1269
|
+
"selected": ["Focused"],
|
|
1270
|
+
"skipped": false
|
|
1271
|
+
}]
|
|
1272
|
+
}
|
|
1273
|
+
```
|
|
1231
1274
|
|
|
1232
1275
|
#### Value response (select, input, editor)
|
|
1233
1276
|
|
package/docs/sessions.md
CHANGED
|
@@ -38,6 +38,18 @@ For the JSONL file format and SessionManager API, see [Session Format](session-f
|
|
|
38
38
|
|
|
39
39
|
`/resume` opens an interactive session picker for the current project. `pi -r` opens the same picker at startup.
|
|
40
40
|
|
|
41
|
+
If the selected session contains a blocked durable goal, Pi applies the same transition as
|
|
42
|
+
`/goal resume` before restarting that session's worker and process supervisors. `pi -c`, `pi -r`, and
|
|
43
|
+
`--session` use the same startup rule. Active goals remain active; completed or cancelled goals are
|
|
44
|
+
never reopened automatically.
|
|
45
|
+
|
|
46
|
+
Session replacement has an explicit recovery boundary. Preparation failure leaves the current runtime
|
|
47
|
+
untouched. If retiring the current runtime, rebinding, or starting supervision fails, Pi completes every
|
|
48
|
+
cleanup step, cleans the candidate, and reconstructs the previous session from its durable manager. A
|
|
49
|
+
failure in an extension's post-replacement `withSession` callback is reported separately because the
|
|
50
|
+
replacement is already valid and remains active. Process shutdown uses the same draining teardown and
|
|
51
|
+
waits for an already-admitted replacement before disposing the runtime it leaves active.
|
|
52
|
+
|
|
41
53
|
In the picker you can:
|
|
42
54
|
|
|
43
55
|
- search by typing
|
|
@@ -49,6 +61,9 @@ In the picker you can:
|
|
|
49
61
|
|
|
50
62
|
When available, pi uses the `trash` CLI for deletion instead of permanently removing files.
|
|
51
63
|
|
|
64
|
+
Use `/goal resume` when you want to resume the blocked goal in the current session without switching
|
|
65
|
+
sessions.
|
|
66
|
+
|
|
52
67
|
## Naming Sessions
|
|
53
68
|
|
|
54
69
|
Use `/name <name>` to set a human-readable session name:
|
package/docs/settings.md
CHANGED
|
@@ -6,7 +6,7 @@ Pi uses JSON settings files with project settings overriding global settings. Pi
|
|
|
6
6
|
|----------|-------|
|
|
7
7
|
| `~/.pi/agent/settings.json` | Global (all projects) |
|
|
8
8
|
| `.pi/settings.json` | Project (current directory) |
|
|
9
|
-
| `~/.pi/agent/
|
|
9
|
+
| `~/.pi/agent/profiles/directories/<hash>/settings.json` | User-level per repo/directory overlay; no repo files written |
|
|
10
10
|
| `~/.pi/agent/profiles/*.json` | Reusable named profile definitions |
|
|
11
11
|
|
|
12
12
|
Edit directly or use `/settings` for common options.
|
|
@@ -148,22 +148,123 @@ Fitness applicability is intentionally split by autonomy level:
|
|
|
148
148
|
|
|
149
149
|
### Worker Delegation
|
|
150
150
|
|
|
151
|
-
Delegation
|
|
151
|
+
Delegation requires an owner-authored orchestration profile. Global profiles live at `~/.pi/agent/profiles/orchestration/<id>.json`; project profiles live at `.pi/profiles/orchestration/<id>.json` and override a global profile with the same ID. Select the foreground architect with `--orchestration-profile <id>` or `activeOrchestrationProfile`. Select a default worker with `workerDelegation.orchestrationProfile`.
|
|
152
152
|
|
|
153
|
-
The
|
|
153
|
+
The profile fixes the role, provider/model, exact thinking level, tools, resource profiles, semantic capabilities, budgets, concurrency, lease duration, and independent-verification requirement. Fixed profiles contain one model. Ordered fallback profiles contain an owner-ordered candidate list; runtime health may advance through that list but cannot invent another model or reasoning level. An architect uses role `orchestrator`, grants only `workflow.delegate`, and lists the exact worker profile IDs it may select in `dispatchProfileIds`. A dispatch outside that list is rejected before creating a model call.
|
|
154
154
|
|
|
155
|
-
|
|
155
|
+
```json
|
|
156
|
+
{
|
|
157
|
+
"schemaVersion": 1,
|
|
158
|
+
"profileId": "architect",
|
|
159
|
+
"description": "Routing-only architect",
|
|
160
|
+
"role": "orchestrator",
|
|
161
|
+
"modelPolicy": {
|
|
162
|
+
"mode": "fixed",
|
|
163
|
+
"candidates": [
|
|
164
|
+
{ "provider": "openai-codex", "modelId": "gpt-5.5", "thinkingLevel": "high" }
|
|
165
|
+
]
|
|
166
|
+
},
|
|
167
|
+
"capabilityCeiling": ["workflow.delegate"],
|
|
168
|
+
"toolNames": ["delegate", "delegate_status"],
|
|
169
|
+
"resourceProfileNames": ["architect-minimal"],
|
|
170
|
+
"dispatchProfileIds": ["worker-fast", "verifier"],
|
|
171
|
+
"budget": { "maxTokens": 16000, "maxWallClockMs": 600000, "maxCostUsd": 2, "maxToolCalls": 20 },
|
|
172
|
+
"maxConcurrent": 1,
|
|
173
|
+
"leaseTtlMs": 660000,
|
|
174
|
+
"requireIndependentVerification": false,
|
|
175
|
+
"createdAt": "2026-07-23T00:00:00.000Z",
|
|
176
|
+
"updatedAt": "2026-07-23T00:00:00.000Z"
|
|
177
|
+
}
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
```json
|
|
181
|
+
{
|
|
182
|
+
"schemaVersion": 1,
|
|
183
|
+
"profileId": "worker-fast",
|
|
184
|
+
"description": "Pinned implementation worker",
|
|
185
|
+
"role": "implementer",
|
|
186
|
+
"modelPolicy": {
|
|
187
|
+
"mode": "fixed",
|
|
188
|
+
"candidates": [
|
|
189
|
+
{ "provider": "openai", "modelId": "gpt-5-mini", "thinkingLevel": "minimal" }
|
|
190
|
+
]
|
|
191
|
+
},
|
|
192
|
+
"capabilityCeiling": ["filesystem.read", "filesystem.write", "worktree.read", "worktree.mutate"],
|
|
193
|
+
"toolNames": ["read", "grep", "find", "ls", "write", "edit"],
|
|
194
|
+
"resourceProfileNames": ["worker-minimal"],
|
|
195
|
+
"dispatchProfileIds": [],
|
|
196
|
+
"budget": { "maxTokens": 8000, "maxWallClockMs": 180000, "maxCostUsd": 0.25, "maxAttempts": 2, "maxToolCalls": 12 },
|
|
197
|
+
"maxConcurrent": 3,
|
|
198
|
+
"leaseTtlMs": 240000,
|
|
199
|
+
"requireIndependentVerification": true,
|
|
200
|
+
"verificationProfileId": "verifier",
|
|
201
|
+
"createdAt": "2026-07-23T00:00:00.000Z",
|
|
202
|
+
"updatedAt": "2026-07-23T00:00:00.000Z"
|
|
203
|
+
}
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
A profile with `requireIndependentVerification: true` must name an owner-authored
|
|
207
|
+
`verificationProfileId`. That target must have role `verifier`, cannot require another verifier, and
|
|
208
|
+
must also appear in the active architect's `dispatchProfileIds`. After a successful implementation,
|
|
209
|
+
the runtime automatically creates a separate durable verifier task. The implementation remains
|
|
210
|
+
blocked and sends no terminal parent handoff until the verifier returns a typed accepted or rejected
|
|
211
|
+
decision; only an accepted decision backed by trusted criterion-linked review evidence completes it.
|
|
156
212
|
|
|
157
|
-
|
|
213
|
+
```json
|
|
214
|
+
{
|
|
215
|
+
"schemaVersion": 1,
|
|
216
|
+
"profileId": "verifier",
|
|
217
|
+
"description": "Pinned independent test verifier",
|
|
218
|
+
"role": "verifier",
|
|
219
|
+
"modelPolicy": {
|
|
220
|
+
"mode": "fixed",
|
|
221
|
+
"candidates": [
|
|
222
|
+
{ "provider": "openai", "modelId": "gpt-5-mini", "thinkingLevel": "low" }
|
|
223
|
+
]
|
|
224
|
+
},
|
|
225
|
+
"capabilityCeiling": ["filesystem.read", "process.exec", "tests.execute"],
|
|
226
|
+
"toolNames": ["read", "grep", "find", "ls", "run_process"],
|
|
227
|
+
"resourceProfileNames": ["verifier-minimal"],
|
|
228
|
+
"dispatchProfileIds": [],
|
|
229
|
+
"executionPolicy": {
|
|
230
|
+
"allowedExecutables": ["node", "npm", "git"],
|
|
231
|
+
"allowedEnvironmentVariables": ["CI"],
|
|
232
|
+
"maxOutputBytes": 65536
|
|
233
|
+
},
|
|
234
|
+
"budget": { "maxTokens": 8000, "maxWallClockMs": 180000, "maxCostUsd": 0.25, "maxToolCalls": 12 },
|
|
235
|
+
"maxConcurrent": 2,
|
|
236
|
+
"leaseTtlMs": 240000,
|
|
237
|
+
"requireIndependentVerification": false,
|
|
238
|
+
"createdAt": "2026-07-23T00:00:00.000Z",
|
|
239
|
+
"updatedAt": "2026-07-23T00:00:00.000Z"
|
|
240
|
+
}
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
Operator and verifier profiles that grant `process.exec` or `tests.execute` must also declare `executionPolicy`. `run_process` accepts only those exact executables, passes arguments directly without a shell, exposes only baseline plus owner-listed environment variables, terminates on timeout/output overflow, and always waits for a terminal process event.
|
|
244
|
+
|
|
245
|
+
```json
|
|
246
|
+
"executionPolicy": {
|
|
247
|
+
"allowedExecutables": ["node", "npm", "git"],
|
|
248
|
+
"allowedEnvironmentVariables": ["CI"],
|
|
249
|
+
"maxOutputBytes": 65536
|
|
250
|
+
}
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
Each isolated worker gets a fresh classified surface. `delegate`, unrestricted shell, foreground memory/lifecycle tools, and opaque extension tools are not inherited. Read-only memory exists only when the selected profile grants `memory.query`, exposes `memory`, and global memory retrieval is enabled; a delegate call cannot add it. Workers are otherwise read-only unless the global write switch, non-empty path scope, profile capabilities, and profile tool list all grant `write` or `edit`.
|
|
254
|
+
|
|
255
|
+
Profiles are provider-independent: every candidate resolves through the model registry, exact model authentication, capability metadata, and the selected model's native or calibrated text-tool protocol. Worker concurrency is counted per profile under the global worker ceiling; every capacity-bound worker is durably queued and drained under both limits, while local workers also queue when they contend with a local foreground. Worker model, thinking, resource, prompt, memory, and tool authority exist only in the selected orchestration profile; delegate calls and worker settings have no parallel override fields.
|
|
256
|
+
|
|
257
|
+
**Confirmed behavior:** `delegate` returns a lane id immediately instead of waiting for the worker. `delegate_status` shows queued, running, and terminal workers and retrieves bounded terminal output by lane id. Completion records a durable terminal notification before waking the parent; undelivered in-process notifications replay after session resume. The interactive footer shows running/queued counts or the latest terminal lane. Late worker output is stored separately and is never injected into an active foreground transcript.
|
|
258
|
+
|
|
259
|
+
Worker writes use **review-after-apply** semantics: a grant-authorized direct `write`/`edit` call or structured-action fallback may mutate the scoped workspace before the parent reviews the result. Both routes pass through the same compiled execution grant, path policy, and cumulative tool budget. The parent review is therefore a post-mutation acceptance step and receives changed files, blockers, the usage report id, and `parent_review_required` for an in-scope changed result. Denied or out-of-scope actions are refused before filesystem mutation; partial application is reported as `blocked`, never clean success.
|
|
158
260
|
|
|
159
261
|
| Setting | Type | Default | Description |
|
|
160
262
|
|---------|------|---------|-------------|
|
|
161
263
|
| `workerDelegation.enabled` | boolean | `true` | Enable bounded delegation on capability-eligible models; explicit `false` is a hard off-switch |
|
|
162
|
-
| `workerDelegation.
|
|
163
|
-
| `workerDelegation.
|
|
164
|
-
| `workerDelegation.
|
|
165
|
-
| `workerDelegation.
|
|
166
|
-
| `workerDelegation.maxConcurrent` | number | `1` | Concurrent worker limit, clamped to 1-3 |
|
|
264
|
+
| `workerDelegation.orchestrationProfile` | string | - | Owner-selected default worker profile; an active architect may use only IDs in its `dispatchProfileIds` |
|
|
265
|
+
| `workerDelegation.maxUsd` | number | `0.5` | Global safety ceiling intersected with profile/foreground limits; `0` disables only this settings-level ceiling |
|
|
266
|
+
| `workerDelegation.maxWallClockMs` | number | `120000` | Global safety ceiling intersected with the profile limit; `0` disables only this settings-level ceiling |
|
|
267
|
+
| `workerDelegation.maxConcurrent` | number | `1` | Global concurrency ceiling combined with profile `maxConcurrent` |
|
|
167
268
|
| `workerDelegation.writeEnabled` | boolean | `false` | Make `write`/`edit` eligible only when `writePaths` is non-empty and the lane profile grants them |
|
|
168
269
|
| `workerDelegation.writePaths` | string[] | `[]` | Relative or absolute path roots enforced for direct child tools and structured-action fallback writes |
|
|
169
270
|
|
|
@@ -368,6 +469,19 @@ Keep `retry.provider.maxRetries` at `0` unless provider-level retries are explic
|
|
|
368
469
|
| `terminal.clearOnShrink` | boolean | `false` | Clear empty rows when content shrinks (can cause flicker) |
|
|
369
470
|
| `images.autoResize` | boolean | `true` | Resize images to 2000x2000 max |
|
|
370
471
|
| `images.blockImages` | boolean | `false` | Block all images from being sent to LLM |
|
|
472
|
+
| `images.clipboardDirectory` | string | `~/.pi/agent/state/attachments` | Store clipboard image attachments here; relative paths resolve from the active working directory |
|
|
473
|
+
|
|
474
|
+
Clipboard images use stable session numbers such as `[Image #3]`. A later prompt can refer to that number or say “look at the image” to attach the latest image from the current session again. The default directory is created only after an image is pasted, never inside the working repository. Pi recognizes and prunes only its own integrity-tagged files, with fixed 30-day, 512-file, and 512 MiB ceilings; unrelated files in a configured directory are untouched. `--no-session` keeps attachments in memory unless `images.clipboardDirectory` explicitly requests persistence.
|
|
475
|
+
|
|
476
|
+
To keep captures in an explicit location:
|
|
477
|
+
|
|
478
|
+
```json
|
|
479
|
+
{
|
|
480
|
+
"images": {
|
|
481
|
+
"clipboardDirectory": "~/Pictures/pi-captures"
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
```
|
|
371
485
|
|
|
372
486
|
### Shell
|
|
373
487
|
|
|
@@ -522,7 +636,7 @@ Reusable profile files live under `~/.pi/agent/profiles/<name>.json`. They use a
|
|
|
522
636
|
|
|
523
637
|
`resources` uses the same allow/block filter shape as `resourceProfiles`. Relative paths that start with `./` or `../` resolve from the profile file directory.
|
|
524
638
|
|
|
525
|
-
Zero-footprint repo/directory overlays live under `~/.pi/agent/
|
|
639
|
+
Zero-footprint repo/directory overlays live under `~/.pi/agent/profiles/directories/<hash>/settings.json`, where `<hash>` is derived from the nearest VCS root (or current directory when no VCS root exists). These files are user-level settings; Pi does not write `.pi/settings.json` just to remember directory profiles. Startup migrates the former root-level `resource-profiles/` layout without overwriting canonical data.
|
|
526
640
|
|
|
527
641
|
## Example
|
|
528
642
|
|
package/docs/task-steps.md
CHANGED
|
@@ -83,6 +83,14 @@ The old user-level task-steps extension also implemented detached jobs, teams, a
|
|
|
83
83
|
|
|
84
84
|
Native worker lanes emit terminal handoff notifications and retain bounded results for explicit retrieval; task steps do not poll worker processes or inspect logs to detect completion.
|
|
85
85
|
|
|
86
|
+
## Native orchestration UI
|
|
87
|
+
|
|
88
|
+
Interactive sessions render task steps, worker dispatch, and worker status through one shared orchestration panel. The compact tool result shows status and counts first; expanding tool output reveals bounded notes, evidence, changed files, blockers, and untrusted worker claims. Checklist IDs stay out of the collapsed task view.
|
|
89
|
+
|
|
90
|
+
While work is open, a host-owned panel below the editor combines the active checklist with queued or running `worker` and `tmux-worker` lanes. It updates from session and terminal-lane events, never by polling output. It disappears when no checklist item or worker is active and survives extension reloads without becoming extension-owned state.
|
|
91
|
+
|
|
92
|
+
The visual contract is deliberately restrained for a keyboard-first terminal: semantic theme colors, status glyphs that remain meaningful without color, no animation, no hard frame, bounded rows, and width-safe truncation. Extension widgets still render independently; reloading or clearing them does not remove the native orchestration panel.
|
|
93
|
+
|
|
86
94
|
## Persistence and isolation
|
|
87
95
|
|
|
88
96
|
Task state is stored only as custom entries in the active `SessionManager`. It follows normal session persistence, resume, and lifecycle behavior. Separate sessions cannot read or mutate each other's checklists, and malformed or future-version snapshots are ignored during restore.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Telemetry and durable event storage
|
|
2
|
+
|
|
3
|
+
Pi keeps authoritative state separate from diagnostic telemetry. They do not share a schema or
|
|
4
|
+
retention policy:
|
|
5
|
+
|
|
6
|
+
| Data | Location | Contract |
|
|
7
|
+
|---|---|---|
|
|
8
|
+
| Install/update ping | `https://pi.dev/api/report-install` | Anonymous version ping only when enabled. `PI_TELEMETRY=0` or offline mode disables it. |
|
|
9
|
+
| Autonomy diagnostics | Active session JSONL as redacted `autonomy-telemetry` custom entries | Bounded payloads for routes, gates, worker lifecycle, evidence, and learning decisions. Local only. |
|
|
10
|
+
| Orchestration events | `<agentDir>/state/orchestration/<session>/events/*.json` | Lossless authoritative task/runtime history with ordinals and idempotency markers. Never rotated as telemetry. |
|
|
11
|
+
| Tool recovery | `<agentDir>/state/tool-recovery-events.jsonl` | Local bounded diagnostic log: 4 MiB high-water, 3 MiB rotation target, at most 5,000 retained records. |
|
|
12
|
+
| Failure corpus | `<agentDir>/state/failure-corpus.jsonl` | Local redacted replay evidence: 512 KiB high-water, 384 KiB rotation target, at most 1,000 retained records. |
|
|
13
|
+
| Learning observations | `<agentDir>/state/learning-observations.json` | Compact counters used by the learning gate, capped at 500 keys. |
|
|
14
|
+
| Worktree audit | `<git-common-dir>/pi-worktree-sync/events.jsonl` | Repository-local bounded coordination audit: 4 MiB high-water, 3 MiB rotation target, at most 10,000 retained records. |
|
|
15
|
+
|
|
16
|
+
The three bounded JSONL logs use one lock-safe append/rotation implementation. Rotation retains the
|
|
17
|
+
newest records to a low-water byte target so a log is not rewritten on every subsequent append.
|
|
18
|
+
The orchestration event store is intentionally separate because it is durable task truth used for
|
|
19
|
+
replay and resume, not expendable telemetry.
|
|
@@ -64,6 +64,10 @@ actions manage that persistence:
|
|
|
64
64
|
An idle worker (no turn currently dispatched) does not hold this session's reload-quiesce; `/reload` is
|
|
65
65
|
never blocked merely because a persistent tmux worker exists between turns.
|
|
66
66
|
|
|
67
|
+
Running managed lanes are checkpointed at dispatch and rehydrated with the same lane identity after
|
|
68
|
+
`/reload`. A later terminal event therefore completes the existing goal binding instead of minting a
|
|
69
|
+
replacement lane or risking a duplicate dispatch.
|
|
70
|
+
|
|
67
71
|
## Approval-gated dispatch: the standing grant
|
|
68
72
|
|
|
69
73
|
A real (non-dry-run) `fire_task` or `send_followup` launch requires either a **standing grant** or a
|
|
@@ -73,7 +77,9 @@ one-shot interactive approval — never a silent launch:
|
|
|
73
77
|
(required), and optionally `goalId` (an unscoped grant covers any goal), `allowedTools`,
|
|
74
78
|
`resourceProfile`, `writePaths`, and `expiresInMinutes`. Requires interactive confirmation when a UI is
|
|
75
79
|
attached; in print/rpc/non-interactive mode, requires the `--allow-tmux-dispatch` CLI flag instead.
|
|
76
|
-
Once granted, matching launches proceed unattended
|
|
80
|
+
Once granted, matching launches proceed unattended. Team launches validate every child against the
|
|
81
|
+
grant and consume one unit of `maxLaunches` for each child process launched; a single-provider grant
|
|
82
|
+
cannot authorize a mixed-provider team.
|
|
77
83
|
- **`revoke_grant`** ends a standing grant early (defaults to whichever grant is currently active).
|
|
78
84
|
- With **no covering grant**: an interactive session is prompted for a one-shot approval; a
|
|
79
85
|
non-interactive session (no UI, no grant) is **refused** with a clear error — never launched silently.
|
|
@@ -118,8 +124,9 @@ When no worker was dispatched, the tool response's `dispatchSkipReason` explains
|
|
|
118
124
|
- `requirement_already_bound` — the requirement is already bound to a lane that is still queued/running;
|
|
119
125
|
no duplicate dispatch was attempted.
|
|
120
126
|
- `bound_lane_indeterminate` — the requirement is bound to a lane whose liveness/outcome cannot be
|
|
121
|
-
determined
|
|
122
|
-
|
|
127
|
+
determined because its durable record is missing or malformed; dispatch is refused rather than
|
|
128
|
+
risking a duplicate worker. Normal `/reload` rehydrates running managed lanes. A bound lane with a
|
|
129
|
+
confirmed terminal outcome allows a fresh dispatch normally.
|
|
123
130
|
|
|
124
131
|
## Safety
|
|
125
132
|
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Orchestration UI reference frames
|
|
2
|
+
|
|
3
|
+
Sanitized text frames used for the native orchestration UI remediation. They contain no session, repository, credential, or model data.
|
|
4
|
+
|
|
5
|
+
- `orchestration-before.txt`: prior generic tool-output hierarchy.
|
|
6
|
+
- `orchestration-reference.txt`: interaction mechanics extracted from the owner's Pi Teams/task-steps extensions: quiet idle state, compact active summary, status-first rows, and detail on demand. This is a mechanics reference, not copied source or visual identity.
|
|
7
|
+
- `orchestration-after.txt`: packaged native panel target shared by task and worker tools.
|
|
8
|
+
|
|
9
|
+
These are terminal frames, so the acceptance instrument is cell width, text hierarchy, status identity without color, and behavior under expansion. Semantic colors remain owned by Pi's dark/light theme tokens.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
[task_steps] success
|
|
2
|
+
task_steps update recorded.
|
|
3
|
+
Task steps (3 visible, 3 tracked):
|
|
4
|
+
- [>] step-1 Implement the native panel (high, implementer)
|
|
5
|
+
- [ ] step-2 Run focused tests
|
|
6
|
+
- [!] step-3 Verify worker review state
|
|
7
|
+
Reminder: a completed step has no evidence attached; attach evidence via update before treating it as verified.
|
package/docs/usage.md
CHANGED
|
@@ -30,13 +30,21 @@ The editor can be replaced temporarily by built-in UI such as `/settings` or by
|
|
|
30
30
|
| File reference | Type `@` to fuzzy-search project files |
|
|
31
31
|
| Path completion | Press Tab to complete paths |
|
|
32
32
|
| Multi-line input | Shift+Enter, or Ctrl+Enter on Windows Terminal |
|
|
33
|
-
| Images | Paste with Ctrl+V, Alt+V on Windows, or
|
|
33
|
+
| Images | Paste with Ctrl+V on Unix/macOS, Alt+V on Windows, or either on WSL; the same action pastes text when no image is present |
|
|
34
34
|
| Platform shell command | `!command` runs in PowerShell on Windows or Bash elsewhere and sends output to the model |
|
|
35
35
|
| Hidden platform shell command | `!!command` runs without sending output to the model |
|
|
36
36
|
| External editor | Ctrl+G opens `$VISUAL` or `$EDITOR` |
|
|
37
37
|
|
|
38
38
|
See [Keybindings](keybindings.md) for all shortcuts and customization.
|
|
39
39
|
|
|
40
|
+
Pasted images are stored under `~/.pi/agent/state/attachments` by default and attached to the current prompt as numbered markers. Later prompts can say `look at image #2` or `look at the image` for the latest current-session attachment. Set `images.clipboardDirectory` to use another folder; a relative folder is an explicit workspace-relative choice. Storage is bounded and Pi never writes an attachment folder into the workspace by default.
|
|
41
|
+
|
|
42
|
+
### Questions, Steps, and Workers
|
|
43
|
+
|
|
44
|
+
When an owner choice materially changes the result, the built-in `ask_question` interaction presents up to four questions together. It supports single choice, multi-select, an unrestricted multi-line custom **Other** answer, clipboard text or image paste, explicit **Skip**, configurable keyboard navigation, cancellation, and a final review before a multi-question answer is submitted. The request is checkpointed before display; `/resume` restores the original tool call, and large answers remain exact in a retrievable artifact while only a bounded projection enters prompt context. TUI and RPC hosts use the same fail-closed typed request. Image paste is refused with a visible explanation when the routed model cannot accept images instead of silently replacing it with a placeholder. Non-interactive sessions fail closed instead of inventing an answer, and worker sessions do not construct the question tool.
|
|
45
|
+
|
|
46
|
+
Native task steps and worker lanes share the same compact work panel. Steps and agents are grouped separately; durable worker task labels and owner-authored profile ids remain visible after `/resume`. Completed worker output remains untrusted until the parent verifies it through the existing result and review contracts.
|
|
47
|
+
|
|
40
48
|
## Slash Commands
|
|
41
49
|
|
|
42
50
|
Type `/` in the editor to open command completion. Extensions can register custom commands, skills are available as `/skill:name`, and prompt templates expand via `/templatename`.
|
|
@@ -64,6 +72,8 @@ Type `/` in the editor to open command completion. Extensions can register custo
|
|
|
64
72
|
| `/toolhealth` | Show tool repair diagnostics and learned standing rules |
|
|
65
73
|
| `/toolprobe [provider/model]` | Probe native/text tool-call support and persist a host-local verdict |
|
|
66
74
|
| `/toolrule-remove <model> <mode>` | Remove one learned tool repair standing rule |
|
|
75
|
+
| `/goal [status\|resume\|complete\|close\|reopen <requirement-id>\|override <text>]` | Inspect or control the durable session goal |
|
|
76
|
+
| `/goal-continue [maxTurns] [maxStallTurns] [maxMinutes]` | Continue the active goal within explicit bounds |
|
|
67
77
|
| `/task`, `/steps` | Manage the native session checklist; see [Task steps](task-steps.md) |
|
|
68
78
|
| `/quit` | Quit pi |
|
|
69
79
|
|
|
@@ -96,6 +106,8 @@ pi --fork <path|id> # Fork a session into a new session file
|
|
|
96
106
|
Useful session commands:
|
|
97
107
|
|
|
98
108
|
- `/session` shows the current session file and ID.
|
|
109
|
+
- `/resume` also resumes a blocked durable goal before that session's worker/process supervision starts;
|
|
110
|
+
`/goal resume` applies the same persisted transition in place.
|
|
99
111
|
- `/tree` navigates the in-file session tree and can summarize abandoned branches.
|
|
100
112
|
- `/fork` creates a new session from an earlier user message.
|
|
101
113
|
- `/clone` duplicates the current active branch into a new session file.
|
|
@@ -202,7 +214,7 @@ cat README.md | pi -p "Summarize this text"
|
|
|
202
214
|
| `--no-builtin-tools`, `-nbt` | Disable built-in tools but keep extension/custom tools enabled |
|
|
203
215
|
| `--no-tools`, `-nt` | Disable all tools |
|
|
204
216
|
|
|
205
|
-
Built-in tools include `read`, `edit`, `write`, `grep`, `find`, `ls`, and the uv-managed `python` tool. The agent always sees one stable `bash` tool contract. On Windows, Pi parses its supported simple-command grammar and converts it deterministically to PowerShell; unsupported shell constructs fail closed. Agent, interactive, and RPC shell calls have a 120-second wall-clock default, and Python calls default to 30 seconds. Native goal, task-step, delegation, context, and toolkit tools are activated when their capability/profile gates allow them.
|
|
217
|
+
Built-in tools include `read`, `edit`, `write`, `grep`, `find`, `ls`, `ask_question`, and the uv-managed `python` tool. The agent always sees one stable `bash` tool contract. On Windows, Pi parses its supported simple-command grammar and converts it deterministically to PowerShell; unsupported shell constructs fail closed. Agent, interactive, and RPC shell calls have a 120-second wall-clock default, and Python calls default to 30 seconds. Native goal, task-step, human-question, delegation, context, and toolkit tools are activated when their capability/profile gates allow them.
|
|
206
218
|
|
|
207
219
|
### Resource Options
|
|
208
220
|
|