@caupulican/pi-adaptative 0.81.39 → 0.81.41
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 +77 -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 +3 -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 +4 -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 +4 -0
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +31 -1
- 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 +25 -2
- package/dist/core/agent-paths.d.ts.map +1 -1
- package/dist/core/agent-paths.js +79 -4
- package/dist/core/agent-paths.js.map +1 -1
- package/dist/core/agent-session-contracts.d.ts +293 -0
- package/dist/core/agent-session-contracts.d.ts.map +1 -0
- package/dist/core/agent-session-contracts.js +26 -0
- package/dist/core/agent-session-contracts.js.map +1 -0
- 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 +400 -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 +74 -518
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +370 -1432
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +3 -1
- package/dist/core/auth-storage.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 +48 -9
- 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 +56 -236
- package/dist/core/background-lane-controller.d.ts.map +1 -1
- package/dist/core/background-lane-controller.js +141 -1273
- package/dist/core/background-lane-controller.js.map +1 -1
- package/dist/core/bedrock-sso-login.d.ts +16 -0
- package/dist/core/bedrock-sso-login.d.ts.map +1 -0
- package/dist/core/bedrock-sso-login.js +98 -0
- package/dist/core/bedrock-sso-login.js.map +1 -0
- 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 +13 -17
- package/dist/core/compaction-support.d.ts.map +1 -1
- package/dist/core/compaction-support.js +3 -3
- 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 +1 -1
- package/dist/core/context-pipeline.d.ts.map +1 -1
- package/dist/core/context-pipeline.js +16 -37
- package/dist/core/context-pipeline.js.map +1 -1
- package/dist/core/cost/cost-summary.d.ts.map +1 -1
- package/dist/core/cost/cost-summary.js +5 -3
- package/dist/core/cost/cost-summary.js.map +1 -1
- package/dist/core/cost/daily-usage.d.ts.map +1 -1
- package/dist/core/cost/daily-usage.js +4 -5
- package/dist/core/cost/daily-usage.js.map +1 -1
- package/dist/core/default-tool-surface.d.ts.map +1 -1
- package/dist/core/default-tool-surface.js +2 -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/extension-import-authority.d.ts +6 -0
- package/dist/core/extension-import-authority.d.ts.map +1 -0
- package/dist/core/extension-import-authority.js +10 -0
- package/dist/core/extension-import-authority.js.map +1 -0
- 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 +52 -18
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +3 -0
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +20 -5
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/stale-context.d.ts +2 -0
- package/dist/core/extensions/stale-context.d.ts.map +1 -0
- package/dist/core/extensions/stale-context.js +2 -0
- package/dist/core/extensions/stale-context.js.map +1 -0
- 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 +78 -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 +53 -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/goal-loop-controller.d.ts +14 -9
- package/dist/core/goal-loop-controller.d.ts.map +1 -1
- package/dist/core/goal-loop-controller.js +47 -75
- package/dist/core/goal-loop-controller.js.map +1 -1
- package/dist/core/goals/compact-goal-context.d.ts +11 -0
- package/dist/core/goals/compact-goal-context.d.ts.map +1 -0
- package/dist/core/goals/compact-goal-context.js +59 -0
- package/dist/core/goals/compact-goal-context.js.map +1 -0
- 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 +27 -0
- package/dist/core/goals/goal-acceptance.js.map +1 -0
- package/dist/core/goals/goal-auto-continue-controller.d.ts +28 -0
- package/dist/core/goals/goal-auto-continue-controller.d.ts.map +1 -0
- package/dist/core/goals/goal-auto-continue-controller.js +90 -0
- package/dist/core/goals/goal-auto-continue-controller.js.map +1 -0
- package/dist/core/goals/goal-continuation-controller.d.ts +2 -2
- package/dist/core/goals/goal-continuation-controller.d.ts.map +1 -1
- package/dist/core/goals/goal-continuation-controller.js +52 -11
- package/dist/core/goals/goal-continuation-controller.js.map +1 -1
- package/dist/core/goals/goal-continuation-defaults.d.ts +4 -29
- package/dist/core/goals/goal-continuation-defaults.d.ts.map +1 -1
- package/dist/core/goals/goal-continuation-defaults.js +4 -32
- package/dist/core/goals/goal-continuation-defaults.js.map +1 -1
- package/dist/core/goals/goal-continuation-prompt.d.ts +8 -18
- package/dist/core/goals/goal-continuation-prompt.d.ts.map +1 -1
- package/dist/core/goals/goal-continuation-prompt.js +9 -179
- package/dist/core/goals/goal-continuation-prompt.js.map +1 -1
- package/dist/core/goals/goal-lifecycle.d.ts +43 -0
- package/dist/core/goals/goal-lifecycle.d.ts.map +1 -0
- package/dist/core/goals/goal-lifecycle.js +102 -0
- package/dist/core/goals/goal-lifecycle.js.map +1 -0
- package/dist/core/goals/goal-record.d.ts +17 -0
- package/dist/core/goals/goal-record.d.ts.map +1 -0
- package/dist/core/goals/goal-record.js +31 -0
- package/dist/core/goals/goal-record.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-session-controller.d.ts +42 -0
- package/dist/core/goals/goal-session-controller.d.ts.map +1 -0
- package/dist/core/goals/goal-session-controller.js +128 -0
- package/dist/core/goals/goal-session-controller.js.map +1 -0
- package/dist/core/goals/goal-state.d.ts +46 -25
- package/dist/core/goals/goal-state.d.ts.map +1 -1
- package/dist/core/goals/goal-state.js +91 -24
- package/dist/core/goals/goal-state.js.map +1 -1
- package/dist/core/goals/goal-tool-core.d.ts +9 -10
- package/dist/core/goals/goal-tool-core.d.ts.map +1 -1
- package/dist/core/goals/goal-tool-core.js +60 -75
- package/dist/core/goals/goal-tool-core.js.map +1 -1
- package/dist/core/goals/session-goal-state.d.ts +20 -12
- package/dist/core/goals/session-goal-state.d.ts.map +1 -1
- package/dist/core/goals/session-goal-state.js +133 -33
- package/dist/core/goals/session-goal-state.js.map +1 -1
- package/dist/core/human-input-controller.d.ts +47 -0
- package/dist/core/human-input-controller.d.ts.map +1 -0
- package/dist/core/human-input-controller.js +181 -0
- package/dist/core/human-input-controller.js.map +1 -0
- 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/local-runtime-controller.d.ts +1 -1
- package/dist/core/local-runtime-controller.d.ts.map +1 -1
- package/dist/core/local-runtime-controller.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 +0 -19
- package/dist/core/model-capability.d.ts.map +1 -1
- package/dist/core/model-capability.js +1 -19
- package/dist/core/model-capability.js.map +1 -1
- package/dist/core/model-registry.d.ts +6 -1
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +13 -5
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver.d.ts +17 -2
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +38 -25
- 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 +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 +5 -5
- 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 +200 -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/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +20 -3
- package/dist/core/package-manager.js.map +1 -1
- 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-filter-controller.d.ts +8 -1
- package/dist/core/profile-filter-controller.d.ts.map +1 -1
- package/dist/core/profile-filter-controller.js +23 -5
- package/dist/core/profile-filter-controller.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/prompt-templates.d.ts +1 -0
- package/dist/core/prompt-templates.d.ts.map +1 -1
- package/dist/core/prompt-templates.js +18 -29
- package/dist/core/prompt-templates.js.map +1 -1
- package/dist/core/reflection-controller.d.ts +5 -5
- package/dist/core/reflection-controller.d.ts.map +1 -1
- package/dist/core/reflection-controller.js +5 -2
- 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/request-auth.d.ts +7 -0
- package/dist/core/request-auth.d.ts.map +1 -0
- package/dist/core/request-auth.js +8 -0
- package/dist/core/request-auth.js.map +1 -0
- 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 +23 -8
- 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 +233 -0
- package/dist/core/risk-classifier.js.map +1 -0
- package/dist/core/runtime-builder.d.ts +41 -23
- package/dist/core/runtime-builder.d.ts.map +1 -1
- package/dist/core/runtime-builder.js +365 -253
- 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 +68 -25
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/secrets/credential-exposure-guard.d.ts +9 -0
- package/dist/core/secrets/credential-exposure-guard.d.ts.map +1 -0
- package/dist/core/secrets/credential-exposure-guard.js +241 -0
- package/dist/core/secrets/credential-exposure-guard.js.map +1 -0
- package/dist/core/secrets/secret-dotenv.d.ts +27 -0
- package/dist/core/secrets/secret-dotenv.d.ts.map +1 -0
- package/dist/core/secrets/secret-dotenv.js +183 -0
- package/dist/core/secrets/secret-dotenv.js.map +1 -0
- package/dist/core/secrets/secret-vault-format.d.ts +112 -0
- package/dist/core/secrets/secret-vault-format.d.ts.map +1 -0
- package/dist/core/secrets/secret-vault-format.js +397 -0
- package/dist/core/secrets/secret-vault-format.js.map +1 -0
- package/dist/core/secrets/secret-vault.d.ts +72 -0
- package/dist/core/secrets/secret-vault.d.ts.map +1 -0
- package/dist/core/secrets/secret-vault.js +671 -0
- package/dist/core/secrets/secret-vault.js.map +1 -0
- package/dist/core/session-analytics.d.ts +4 -23
- package/dist/core/session-analytics.d.ts.map +1 -1
- package/dist/core/session-analytics.js +67 -70
- 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 +11 -4
- package/dist/core/session-role.d.ts.map +1 -1
- package/dist/core/session-role.js +24 -5
- 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/session-tree-navigator.d.ts +4 -6
- package/dist/core/session-tree-navigator.d.ts.map +1 -1
- package/dist/core/session-tree-navigator.js +4 -1
- package/dist/core/session-tree-navigator.js.map +1 -1
- package/dist/core/settings-manager.d.ts +10 -5
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +81 -29
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +2 -2
- package/dist/core/slash-commands.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 +86 -0
- package/dist/core/tool-capability-policy.js.map +1 -0
- package/dist/core/tool-gate-controller.d.ts.map +1 -1
- package/dist/core/tool-gate-controller.js +8 -2
- package/dist/core/tool-gate-controller.js.map +1 -1
- package/dist/core/tool-protocol-controller.d.ts +89 -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-recovery-stats.d.ts +21 -1
- package/dist/core/tool-recovery-stats.d.ts.map +1 -1
- package/dist/core/tool-recovery-stats.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/bash.d.ts +5 -0
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +59 -5
- package/dist/core/tools/bash.js.map +1 -1
- 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 +148 -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 +106 -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/git-filter.d.ts +1 -8
- package/dist/core/tools/git-filter.d.ts.map +1 -1
- package/dist/core/tools/git-filter.js +2 -63
- package/dist/core/tools/git-filter.js.map +1 -1
- package/dist/core/tools/goal.d.ts +10 -8
- package/dist/core/tools/goal.d.ts.map +1 -1
- package/dist/core/tools/goal.js +106 -28
- package/dist/core/tools/goal.js.map +1 -1
- package/dist/core/tools/index.d.ts +1 -0
- package/dist/core/tools/index.d.ts.map +1 -1
- package/dist/core/tools/index.js +1 -0
- package/dist/core/tools/index.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 +40 -0
- package/dist/core/tools/orchestration-panel.d.ts.map +1 -0
- package/dist/core/tools/orchestration-panel.js +124 -0
- package/dist/core/tools/orchestration-panel.js.map +1 -0
- package/dist/core/tools/output-accumulator.d.ts +11 -0
- package/dist/core/tools/output-accumulator.d.ts.map +1 -1
- package/dist/core/tools/output-accumulator.js +36 -3
- package/dist/core/tools/output-accumulator.js.map +1 -1
- package/dist/core/tools/python.d.ts +2 -0
- package/dist/core/tools/python.d.ts.map +1 -1
- package/dist/core/tools/python.js +3 -1
- package/dist/core/tools/python.js.map +1 -1
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +1 -1
- package/dist/core/tools/read.js.map +1 -1
- 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/search-command-guard.d.ts +14 -0
- package/dist/core/tools/search-command-guard.d.ts.map +1 -0
- package/dist/core/tools/search-command-guard.js +333 -0
- package/dist/core/tools/search-command-guard.js.map +1 -0
- package/dist/core/tools/secret-store.d.ts +38 -0
- package/dist/core/tools/secret-store.d.ts.map +1 -0
- package/dist/core/tools/secret-store.js +412 -0
- package/dist/core/tools/secret-store.js.map +1 -0
- package/dist/core/tools/shell-command-parser.d.ts +16 -0
- package/dist/core/tools/shell-command-parser.d.ts.map +1 -0
- package/dist/core/tools/shell-command-parser.js +113 -0
- package/dist/core/tools/shell-command-parser.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 +99 -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/atomic-file.d.ts +6 -2
- package/dist/core/util/atomic-file.d.ts.map +1 -1
- package/dist/core/util/atomic-file.js +4 -4
- package/dist/core/util/atomic-file.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 +15 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -3
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +149 -51
- 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/auth-dialogs-controller.d.ts +4 -0
- package/dist/modes/interactive/auth-dialogs-controller.d.ts.map +1 -1
- package/dist/modes/interactive/auth-dialogs-controller.js +60 -1
- package/dist/modes/interactive/auth-dialogs-controller.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/activity-lane.d.ts +55 -0
- package/dist/modes/interactive/components/activity-lane.d.ts.map +1 -0
- package/dist/modes/interactive/components/activity-lane.js +304 -0
- package/dist/modes/interactive/components/activity-lane.js.map +1 -0
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js +19 -10
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/expandable-text.d.ts +12 -0
- package/dist/modes/interactive/components/expandable-text.d.ts.map +1 -0
- package/dist/modes/interactive/components/expandable-text.js +17 -0
- package/dist/modes/interactive/components/expandable-text.js.map +1 -0
- package/dist/modes/interactive/components/extension-editor.d.ts +15 -1
- package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-editor.js +30 -21
- package/dist/modes/interactive/components/extension-editor.js.map +1 -1
- package/dist/modes/interactive/components/extension-input.d.ts +1 -0
- package/dist/modes/interactive/components/extension-input.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-input.js +6 -1
- package/dist/modes/interactive/components/extension-input.js.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.d.ts +2 -2
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.js +23 -14
- package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +6 -6
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts +19 -11
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +53 -20
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/components/tool-group.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-group.js +3 -0
- package/dist/modes/interactive/components/tool-group.js.map +1 -1
- package/dist/modes/interactive/components/usage-action-selector.d.ts +16 -0
- package/dist/modes/interactive/components/usage-action-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/usage-action-selector.js +46 -0
- package/dist/modes/interactive/components/usage-action-selector.js.map +1 -0
- 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 +77 -15
- package/dist/modes/interactive/extension-ui-host.js.map +1 -1
- package/dist/modes/interactive/external-editor.d.ts +15 -0
- package/dist/modes/interactive/external-editor.d.ts.map +1 -1
- package/dist/modes/interactive/external-editor.js +27 -19
- package/dist/modes/interactive/external-editor.js.map +1 -1
- package/dist/modes/interactive/history-reload-math.d.ts +6 -2
- package/dist/modes/interactive/history-reload-math.d.ts.map +1 -1
- package/dist/modes/interactive/history-reload-math.js +10 -5
- package/dist/modes/interactive/history-reload-math.js.map +1 -1
- package/dist/modes/interactive/interactive-event-controller.d.ts +74 -0
- package/dist/modes/interactive/interactive-event-controller.d.ts.map +1 -0
- package/dist/modes/interactive/interactive-event-controller.js +328 -0
- package/dist/modes/interactive/interactive-event-controller.js.map +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts +22 -24
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +245 -595
- 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/loaded-resources-view.d.ts +20 -0
- package/dist/modes/interactive/loaded-resources-view.d.ts.map +1 -0
- package/dist/modes/interactive/loaded-resources-view.js +147 -0
- package/dist/modes/interactive/loaded-resources-view.js.map +1 -0
- 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/resource-display.d.ts.map +1 -1
- package/dist/modes/interactive/resource-display.js +8 -2
- package/dist/modes/interactive/resource-display.js.map +1 -1
- package/dist/modes/interactive/resource-shell-commands.d.ts +1 -5
- package/dist/modes/interactive/resource-shell-commands.d.ts.map +1 -1
- package/dist/modes/interactive/resource-shell-commands.js +0 -5
- package/dist/modes/interactive/resource-shell-commands.js.map +1 -1
- package/dist/modes/interactive/session-flow-commands.d.ts +27 -8
- package/dist/modes/interactive/session-flow-commands.d.ts.map +1 -1
- package/dist/modes/interactive/session-flow-commands.js +150 -64
- 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/interactive/usage-commands.d.ts +34 -0
- package/dist/modes/interactive/usage-commands.d.ts.map +1 -0
- package/dist/modes/interactive/usage-commands.js +225 -0
- package/dist/modes/interactive/usage-commands.js.map +1 -0
- 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/shell.d.ts.map +1 -1
- package/dist/utils/shell.js +5 -3
- package/dist/utils/shell.js.map +1 -1
- package/dist/utils/version-check.d.ts.map +1 -1
- package/dist/utils/version-check.js +3 -1
- package/dist/utils/version-check.js.map +1 -1
- 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 +38 -0
- package/docs/UI_QUALITY_ORCHESTRATION.md +28 -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/providers.md +9 -1
- 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 +14 -0
- package/docs/ui-reference/orchestration-before.txt +13 -0
- package/docs/ui-reference/orchestration-reference.txt +16 -0
- package/docs/usage.md +22 -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 +13 -13
- 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
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { Agent,
|
|
1
|
+
import type { Agent, AgentMessage, AgentState, StreamIdleOptions, ThinkingLevel } from "@caupulican/pi-agent-core";
|
|
2
2
|
import { type CustomMessage } from "@caupulican/pi-agent-core";
|
|
3
|
-
import {
|
|
4
|
-
import type {
|
|
5
|
-
import type { CapabilityEnvelope, EvidenceBundle, LearningDecision,
|
|
6
|
-
import type { LaneRecord
|
|
3
|
+
import type { BranchSummaryEntry, CompactionResult, SessionManager } from "@caupulican/pi-agent-core/node";
|
|
4
|
+
import type { Api, ImageContent, Model, TextContent, Usage } from "@caupulican/pi-ai";
|
|
5
|
+
import type { CapabilityEnvelope, EvidenceBundle, LearningDecision, WorkerClaim, WorkerRequest } from "./autonomy/contracts.ts";
|
|
6
|
+
import type { LaneRecord } from "./autonomy/lane-tracker.ts";
|
|
7
7
|
import type { AutonomyDiagnosticSnapshot, AutonomyStatusSnapshot, GateOutcomeHistoryEntry } from "./autonomy/status.ts";
|
|
8
8
|
import type { BashResult } from "./bash-executor.ts";
|
|
9
9
|
import type { CurationTelemetrySnapshot } from "./context/brain-curator.ts";
|
|
@@ -18,30 +18,27 @@ import type { ContextGcReport } from "./context-gc.ts";
|
|
|
18
18
|
import type { SessionCostSummary } from "./cost/cost-summary.ts";
|
|
19
19
|
import type { DailyUsageTotals } from "./cost/daily-usage.ts";
|
|
20
20
|
import { type CostGuardDecision } from "./cost-guard.ts";
|
|
21
|
-
import type {
|
|
22
|
-
import type { ContextUsage,
|
|
21
|
+
import type { WorkerDelegationRequest } from "./delegation/worker-delegation-request.ts";
|
|
22
|
+
import type { ContextUsage, ExtensionRunner, ReplacedSessionContext, ToolDefinition, ToolInfo } from "./extensions/index.ts";
|
|
23
23
|
import { type ChannelProvider, GatewayRegistry, type JobSchedulerProvider } from "./gateways/channel-provider.ts";
|
|
24
|
-
import type {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
24
|
+
import type { GoalStateRevision } from "./goals/goal-lifecycle.ts";
|
|
25
|
+
import type { GoalRuntimeSnapshot, GoalRuntimeSnapshotSettings } from "./goals/goal-runtime-snapshot.ts";
|
|
26
|
+
import type { GoalState } from "./goals/goal-state.ts";
|
|
27
27
|
import type { LearningAuditRecord } from "./learning/learning-audit.ts";
|
|
28
28
|
import type { DemandSignals, ReflectionResult } from "./learning/reflection-engine.ts";
|
|
29
29
|
import { type CurationProposals } from "./learning/skill-curator.ts";
|
|
30
30
|
import type { MemoryProvider } from "./memory/memory-provider.ts";
|
|
31
31
|
import { type LaneWorkerRefusal, type ModelCapabilityProfile } from "./model-capability.ts";
|
|
32
32
|
import type { ModelRegistry } from "./model-registry.ts";
|
|
33
|
-
import { type NativeToolProbeGrade } from "./models/adaptation-store.ts";
|
|
34
33
|
import type { StoredFitnessReport } from "./models/fitness-store.ts";
|
|
35
34
|
import type { PrismLlamaCppRuntime } from "./models/llamacpp-runtime.ts";
|
|
36
|
-
import type {
|
|
35
|
+
import type { OllamaRuntime, TransformersRuntime } from "./models/local-runtime.ts";
|
|
37
36
|
import { type PromptTemplate } from "./prompt-templates.ts";
|
|
38
37
|
import type { ModelFitnessReport } from "./research/model-fitness.ts";
|
|
39
|
-
import type { ResearchRunResult } from "./research/research-runner.ts";
|
|
40
|
-
import { collectWorkspaceSources } from "./research/workspace-collector.ts";
|
|
41
38
|
import type { ResourceLoader } from "./resource-loader.ts";
|
|
42
|
-
import {
|
|
43
|
-
import type { ResourceProfileFilterSettings, SettingsManager } from "./settings-manager.ts";
|
|
39
|
+
import type { SettingsManager } from "./settings-manager.ts";
|
|
44
40
|
import { type TaskStepsState } from "./tasks/task-state.ts";
|
|
41
|
+
import { type ToolProbeReport } from "./tool-protocol-controller.ts";
|
|
45
42
|
import type { BashOperations } from "./tools/bash.ts";
|
|
46
43
|
/**
|
|
47
44
|
* Test hook: override the stream-idle bounds so a stall can be provoked in-suite without a
|
|
@@ -50,381 +47,9 @@ import type { BashOperations } from "./tools/bash.ts";
|
|
|
50
47
|
* may be set or changed at any time before the request that should observe it.
|
|
51
48
|
*/
|
|
52
49
|
export declare function setStreamIdleOptionsForTests(opts: Partial<StreamIdleOptions> | undefined): void;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
location: string;
|
|
57
|
-
content: string;
|
|
58
|
-
userMessage: string | undefined;
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Parse a skill block from message text.
|
|
62
|
-
* Returns null if the text doesn't contain a skill block.
|
|
63
|
-
*/
|
|
64
|
-
export declare function parseSkillBlock(text: string): ParsedSkillBlock | null;
|
|
65
|
-
/** Session-specific events that extend the core AgentEvent */
|
|
66
|
-
export type AgentSessionEvent = Exclude<AgentEvent, {
|
|
67
|
-
type: "agent_end";
|
|
68
|
-
}> | {
|
|
69
|
-
type: "agent_end";
|
|
70
|
-
messages: AgentMessage[];
|
|
71
|
-
willRetry: boolean;
|
|
72
|
-
} | {
|
|
73
|
-
type: "queue_update";
|
|
74
|
-
steering: readonly string[];
|
|
75
|
-
followUp: readonly string[];
|
|
76
|
-
commands: readonly string[];
|
|
77
|
-
} | {
|
|
78
|
-
type: "compaction_start";
|
|
79
|
-
reason: "manual" | "threshold" | "overflow";
|
|
80
|
-
} | {
|
|
81
|
-
type: "session_info_changed";
|
|
82
|
-
name: string | undefined;
|
|
83
|
-
} | {
|
|
84
|
-
type: "thinking_level_changed";
|
|
85
|
-
level: ThinkingLevel;
|
|
86
|
-
} | {
|
|
87
|
-
type: "warning";
|
|
88
|
-
message: string;
|
|
89
|
-
} | {
|
|
90
|
-
type: "compaction_end";
|
|
91
|
-
reason: "manual" | "threshold" | "overflow";
|
|
92
|
-
result: CompactionResult | undefined;
|
|
93
|
-
aborted: boolean;
|
|
94
|
-
willRetry: boolean;
|
|
95
|
-
errorMessage?: string;
|
|
96
|
-
/**
|
|
97
|
-
* Benign no-op explanation for auto-compaction (e.g. "nothing to compact yet"). Auto
|
|
98
|
-
* bails must never be silent: without a result, either errorMessage (real failure) or
|
|
99
|
-
* skipReason (harmless skip) is set so the UI can show why nothing changed.
|
|
100
|
-
*/
|
|
101
|
-
skipReason?: string;
|
|
102
|
-
} | {
|
|
103
|
-
type: "auto_retry_start";
|
|
104
|
-
attempt: number;
|
|
105
|
-
maxAttempts: number;
|
|
106
|
-
delayMs: number;
|
|
107
|
-
errorMessage: string;
|
|
108
|
-
} | {
|
|
109
|
-
type: "auto_retry_end";
|
|
110
|
-
success: boolean;
|
|
111
|
-
attempt: number;
|
|
112
|
-
finalError?: string;
|
|
113
|
-
} | {
|
|
114
|
-
type: "routing_start";
|
|
115
|
-
} | {
|
|
116
|
-
type: "routing_end";
|
|
117
|
-
} | {
|
|
118
|
-
type: "delegate_workers";
|
|
119
|
-
active: number;
|
|
120
|
-
queued: number;
|
|
121
|
-
running: number;
|
|
122
|
-
completedSinceFlush: number;
|
|
123
|
-
failedSinceFlush: number;
|
|
124
|
-
terminalSinceFlush: Array<{
|
|
125
|
-
laneId: string;
|
|
126
|
-
status: LaneTerminalStatus;
|
|
127
|
-
reasonCode?: string;
|
|
128
|
-
}>;
|
|
129
|
-
};
|
|
130
|
-
/** Listener function for agent session events */
|
|
131
|
-
export type AgentSessionEventListener = (event: AgentSessionEvent) => void;
|
|
132
|
-
export interface AgentSessionConfig {
|
|
133
|
-
agent: Agent;
|
|
134
|
-
sessionManager: SessionManager;
|
|
135
|
-
settingsManager: SettingsManager;
|
|
136
|
-
cwd: string;
|
|
137
|
-
/** User-level agent state directory for generated runtime artifacts. */
|
|
138
|
-
agentDir?: string;
|
|
139
|
-
/** Models to cycle through with Ctrl+P (from --models flag) */
|
|
140
|
-
scopedModels?: Array<{
|
|
141
|
-
model: Model<any>;
|
|
142
|
-
thinkingLevel?: ThinkingLevel;
|
|
143
|
-
}>;
|
|
144
|
-
/** Resource loader for skills, prompts, themes, context files, system prompt */
|
|
145
|
-
resourceLoader: ResourceLoader;
|
|
146
|
-
/** SDK custom tools registered outside extensions */
|
|
147
|
-
customTools?: ToolDefinition[];
|
|
148
|
-
/** Model registry for API key resolution and model discovery */
|
|
149
|
-
modelRegistry: ModelRegistry;
|
|
150
|
-
/** Initial active built-in tool names. Default: [read, bash, edit, write, context_audit, goal] */
|
|
151
|
-
initialActiveToolNames?: string[];
|
|
152
|
-
/** Optional allowlist of tool names. When provided, only these tool names are exposed. */
|
|
153
|
-
allowedToolNames?: string[];
|
|
154
|
-
/** Optional denylist of tool names. When provided, these tool names are not exposed. */
|
|
155
|
-
excludedToolNames?: string[];
|
|
156
|
-
/** Optional resource-profile allow/block filters for tool names. */
|
|
157
|
-
toolProfileFilter?: ResourceProfileFilterSettings;
|
|
158
|
-
/**
|
|
159
|
-
* Whether the model/thinking level came from an explicit launch flag. When false, the active
|
|
160
|
-
* profile's model/thinking is re-applied on reload() so live profile edits take effect; when
|
|
161
|
-
* true, the explicit launch-time choice is preserved.
|
|
162
|
-
*/
|
|
163
|
-
isExplicitModel?: boolean;
|
|
164
|
-
isExplicitThinking?: boolean;
|
|
165
|
-
/** True when this session is a spawned subagent/child — gates durable memory writes. */
|
|
166
|
-
isChildSession?: boolean;
|
|
167
|
-
/**
|
|
168
|
-
* Override base tools (useful for custom runtimes).
|
|
169
|
-
*
|
|
170
|
-
* These are synthesized into minimal ToolDefinitions internally so AgentSession can keep
|
|
171
|
-
* a definition-first registry even when callers provide plain AgentTool instances.
|
|
172
|
-
*/
|
|
173
|
-
baseToolsOverride?: Record<string, AgentTool>;
|
|
174
|
-
/** Mutable ref used by Agent to access the current ExtensionRunner */
|
|
175
|
-
extensionRunnerRef?: {
|
|
176
|
-
current?: ExtensionRunner;
|
|
177
|
-
};
|
|
178
|
-
/** Session start event metadata emitted when extensions bind to this runtime. */
|
|
179
|
-
sessionStartEvent?: SessionStartEvent;
|
|
180
|
-
/**
|
|
181
|
-
* Pointer-first workspace source collector for the autonomous research lane. Injected in unit
|
|
182
|
-
* tests so they don't spawn a real ripgrep child (which would escape fake timers); production
|
|
183
|
-
* defaults to the real, best-effort collector.
|
|
184
|
-
*/
|
|
185
|
-
collectWorkspaceSources?: typeof collectWorkspaceSources;
|
|
186
|
-
/**
|
|
187
|
-
* Injected fetch/spawn/exists for the local (Ollama) runtime health-check + boot used by the
|
|
188
|
-
* model router before a turn routed to a local model (see LocalRuntimeController.ensureLocalModelReady).
|
|
189
|
-
* Unit tests inject fakes so they never hit a real network/process; production defaults to the real ones.
|
|
190
|
-
*/
|
|
191
|
-
localRuntimeDeps?: LocalRuntimeDeps;
|
|
192
|
-
}
|
|
193
|
-
export interface ExtensionBindings {
|
|
194
|
-
uiContext?: ExtensionUIContext;
|
|
195
|
-
mode?: ExtensionContext["mode"];
|
|
196
|
-
commandContextActions?: ExtensionCommandContextActions;
|
|
197
|
-
abortHandler?: () => void;
|
|
198
|
-
shutdownHandler?: ShutdownHandler;
|
|
199
|
-
onError?: ExtensionErrorListener;
|
|
200
|
-
}
|
|
201
|
-
/** Options for AgentSession.prompt() */
|
|
202
|
-
export interface PromptOptions {
|
|
203
|
-
/** Whether to expand file-based prompt templates and skills (default: true). */
|
|
204
|
-
expandPromptTemplates?: boolean;
|
|
205
|
-
/** Whether slash commands should be handled before sending to the model. Defaults to expandPromptTemplates. */
|
|
206
|
-
processSlashCommands?: boolean;
|
|
207
|
-
/** Image attachments */
|
|
208
|
-
images?: ImageContent[];
|
|
209
|
-
/** When streaming, how to queue the message: "steer" (interrupt) or "followUp" (wait). Required if streaming. */
|
|
210
|
-
streamingBehavior?: "steer" | "followUp";
|
|
211
|
-
/** Source of input for extension input event handlers. Defaults to "interactive". */
|
|
212
|
-
source?: InputSource;
|
|
213
|
-
/** Internal hook used by RPC mode to observe prompt preflight acceptance or rejection. */
|
|
214
|
-
preflightResult?: (success: boolean) => void;
|
|
215
|
-
/** Whether an idle active goal should auto-inject bounded continuation prompts after this prompt settles. Default: true. */
|
|
216
|
-
autoContinueGoal?: boolean;
|
|
217
|
-
}
|
|
218
|
-
export type ToolProbeVerdict = "native" | "text-protocol" | "none";
|
|
219
|
-
export interface ToolProbeResult {
|
|
220
|
-
model: string;
|
|
221
|
-
verdict: ToolProbeVerdict;
|
|
222
|
-
variant?: TextToolProtocolVariant;
|
|
223
|
-
nativeGrade?: NativeToolProbeGrade;
|
|
224
|
-
diagnostic?: string;
|
|
225
|
-
}
|
|
226
|
-
export interface ToolProbeReport {
|
|
227
|
-
results: ToolProbeResult[];
|
|
228
|
-
table: string;
|
|
229
|
-
}
|
|
230
|
-
/** Result from cycleModel() */
|
|
231
|
-
export interface ModelCycleResult {
|
|
232
|
-
model: Model<any>;
|
|
233
|
-
thinkingLevel: ThinkingLevel;
|
|
234
|
-
/** Whether cycling through scoped models (--models flag) or all available */
|
|
235
|
-
isScoped: boolean;
|
|
236
|
-
}
|
|
237
|
-
/** Session statistics for /session command */
|
|
238
|
-
export interface CompactionGateStats {
|
|
239
|
-
gateFailures: number;
|
|
240
|
-
deterministicGapFills: number;
|
|
241
|
-
compactionsWithGateFailures: number;
|
|
242
|
-
}
|
|
243
|
-
export interface SessionStats {
|
|
244
|
-
sessionFile: string | undefined;
|
|
245
|
-
sessionId: string;
|
|
246
|
-
userMessages: number;
|
|
247
|
-
assistantMessages: number;
|
|
248
|
-
toolCalls: number;
|
|
249
|
-
toolResults: number;
|
|
250
|
-
totalMessages: number;
|
|
251
|
-
tokens: {
|
|
252
|
-
input: number;
|
|
253
|
-
output: number;
|
|
254
|
-
cacheRead: number;
|
|
255
|
-
cacheWrite: number;
|
|
256
|
-
total: number;
|
|
257
|
-
};
|
|
258
|
-
cost: number;
|
|
259
|
-
contextUsage?: ContextUsage;
|
|
260
|
-
toolArgumentValidation: ToolArgumentValidationStats;
|
|
261
|
-
compactionGates: CompactionGateStats;
|
|
262
|
-
}
|
|
263
|
-
/** customType for spawned-usage roll-up entries (Cost Aggregation, Model A). */
|
|
264
|
-
export declare const SPAWNED_USAGE_CUSTOM_TYPE = "spawned_usage";
|
|
265
|
-
/**
|
|
266
|
-
* customType for a persisted runaway-loop-backstop entry: the agent loop stopped a turn stuck
|
|
267
|
-
* repeating one identical tool-call signature. This is the session-log/telemetry sink for
|
|
268
|
-
* {@link Agent.onRunawayStop} — see `_installAgentToolHooks`.
|
|
269
|
-
*/
|
|
270
|
-
export declare const RUNAWAY_STOP_CUSTOM_TYPE = "runaway_stop";
|
|
271
|
-
/** Payload persisted for a {@link RUNAWAY_STOP_CUSTOM_TYPE} entry. */
|
|
272
|
-
export interface RunawayStopRecord {
|
|
273
|
-
signature: string;
|
|
274
|
-
repeats: number;
|
|
275
|
-
model?: string;
|
|
276
|
-
provider?: string;
|
|
277
|
-
at: string;
|
|
278
|
-
}
|
|
279
|
-
/**
|
|
280
|
-
* customType for a persisted tool-validation-escalation entry: the agent loop bounced the same
|
|
281
|
-
* tool-call validation failure enough times to escalate. This is the session-log/telemetry sink for
|
|
282
|
-
* {@link Agent.onToolValidationEscalation} — see `_installAgentToolHooks`.
|
|
283
|
-
*/
|
|
284
|
-
export declare const TOOL_VALIDATION_ESCALATION_CUSTOM_TYPE = "tool_validation_escalation";
|
|
285
|
-
/** Payload persisted for a {@link TOOL_VALIDATION_ESCALATION_CUSTOM_TYPE} entry. */
|
|
286
|
-
export interface ToolValidationEscalationRecord {
|
|
287
|
-
tool: string;
|
|
288
|
-
signature: string;
|
|
289
|
-
repeats: number;
|
|
290
|
-
model: string;
|
|
291
|
-
provider: string;
|
|
292
|
-
at: string;
|
|
293
|
-
}
|
|
294
|
-
/**
|
|
295
|
-
* A single spawned/subagent usage report, persisted as a `CustomEntry`
|
|
296
|
-
* (`customType: "spawned_usage"`). Persistence-only — does NOT enter LLM context.
|
|
297
|
-
*
|
|
298
|
-
* Single-hop invariant: each report MUST already include the reporter's own usage AND its
|
|
299
|
-
* accumulated sub-usage. A child rolls up its grandchildren, then reports once to its direct
|
|
300
|
-
* parent. Only the direct parent records the report — never a grandparent — so cost cannot be
|
|
301
|
-
* double-counted across levels.
|
|
302
|
-
*/
|
|
303
|
-
export interface SpawnedUsageReport {
|
|
304
|
-
/** Cumulative usage attributed to the spawned session (own + its own sub-usage). */
|
|
305
|
-
usage: Usage;
|
|
306
|
-
/** Human-readable source label for diagnostics (e.g. subagent name). */
|
|
307
|
-
label?: string;
|
|
308
|
-
/** Session id of the reporting child, if known. */
|
|
309
|
-
sourceSessionId?: string;
|
|
310
|
-
/** Stable id used to de-duplicate re-reports (retries, double agent_end). */
|
|
311
|
-
reportId?: string;
|
|
312
|
-
}
|
|
313
|
-
/** Aggregated spawned-usage totals derived from `spawned_usage` custom entries. */
|
|
314
|
-
export interface SpawnedUsageTotals {
|
|
315
|
-
/** Summed `usage.cost.total` across all recorded reports. */
|
|
316
|
-
cost: number;
|
|
317
|
-
/** Number of distinct reports recorded. */
|
|
318
|
-
reports: number;
|
|
319
|
-
}
|
|
320
|
-
/**
|
|
321
|
-
* Options for {@link AgentSession.runIsolatedCompletion} — an LLM call fully isolated from the main
|
|
322
|
-
* session. With no tools it is one-shot (reflection); lane callers may supply a bounded child loop.
|
|
323
|
-
*/
|
|
324
|
-
export interface IsolatedCompletionOptions {
|
|
325
|
-
/** System prompt for the isolated call. */
|
|
326
|
-
systemPrompt: string;
|
|
327
|
-
/** The isolated conversation (e.g. the reflection prompt). NOT the main session history. */
|
|
328
|
-
messages: Message[];
|
|
329
|
-
/** Model to use. Defaults to the session model; callers should pass a cheap model. */
|
|
330
|
-
model?: Model<any>;
|
|
331
|
-
/** Thinking level. Defaults to "off" to keep the call cheap. */
|
|
332
|
-
thinkingLevel?: ThinkingLevel;
|
|
333
|
-
/** Output token cap. */
|
|
334
|
-
maxTokens?: number;
|
|
335
|
-
/** Fresh tools owned by the isolated child. Omitted/empty preserves one-shot behavior. */
|
|
336
|
-
tools?: AgentTool[];
|
|
337
|
-
/** Maximum assistant turns for a tool-enabled child loop. Ignored by one-shot calls. */
|
|
338
|
-
maxTurns?: number;
|
|
339
|
-
/**
|
|
340
|
-
* Optional tool-free finalization prompt. When the bounded child loop exhausts its turns on an
|
|
341
|
-
* assistant tool-call message with no text, one final provider call receives the gathered transcript
|
|
342
|
-
* plus this prompt so useful work is not discarded solely for lacking a terminal summary.
|
|
343
|
-
*/
|
|
344
|
-
finalTextPrompt?: string;
|
|
345
|
-
/** Child-only capability/path gate. Never inherited from the foreground session. */
|
|
346
|
-
beforeToolCall?: AgentLoopConfig["beforeToolCall"];
|
|
347
|
-
/** Child-only result observer (for example, successful scoped-write accounting). */
|
|
348
|
-
afterToolCall?: AgentLoopConfig["afterToolCall"];
|
|
349
|
-
/** Abort signal. */
|
|
350
|
-
signal?: AbortSignal;
|
|
351
|
-
/**
|
|
352
|
-
* Prompt-cache retention for this isolated call. REQUIRED — the provider-level default is
|
|
353
|
-
* `"short"`, the opposite of this primitive's old implicit default, so a caller that forgot to
|
|
354
|
-
* set it would silently pay full input price forever. Pass `"none"` explicitly to preserve full
|
|
355
|
-
* isolation (no caching); callers whose `systemPrompt` is STATIC across calls (e.g. reflection,
|
|
356
|
-
* #33) should pass `"short"`/`"long"` so the provider reuses the cached prefix and bills only the
|
|
357
|
-
* variable tail.
|
|
358
|
-
*/
|
|
359
|
-
cacheRetention: CacheRetention;
|
|
360
|
-
/**
|
|
361
|
-
* Lane/caller kind (e.g. `"reflection"`, `"research"`, `"worker"`, `"fitness"`) used to derive this
|
|
362
|
-
* call's synthetic cache-affinity key (see {@link computeLaneAffinityKey}). Omitted callers fall
|
|
363
|
-
* back to {@link DEFAULT_ISOLATED_LANE_KIND} — still a stable, namespaced key, just not
|
|
364
|
-
* lane-differentiated. Never the real session id.
|
|
365
|
-
*/
|
|
366
|
-
laneKind?: string;
|
|
367
|
-
}
|
|
368
|
-
/** Fallback {@link IsolatedCompletionOptions.laneKind} for callers that do not tag their lane. */
|
|
369
|
-
export declare const DEFAULT_ISOLATED_LANE_KIND = "isolated";
|
|
370
|
-
/**
|
|
371
|
-
* Derive a STABLE synthetic cache-affinity key for an isolated completion lane. Isolated calls
|
|
372
|
-
* deliberately never carry the real session id (see reflection-controller.ts's isolation invariants —
|
|
373
|
-
* an isolated call must not entangle with the main session), which today also means every isolated
|
|
374
|
-
* call looks like a brand-new, uncorrelated session to providers with session-affinity headers /
|
|
375
|
-
* `prompt_cache_key` (anthropic.ts's `x-session-affinity`, openai-responses.ts /
|
|
376
|
-
* openai-completions.ts's `prompt_cache_key`), defeating their cache routing.
|
|
377
|
-
*
|
|
378
|
-
* This key is deterministic per `(laneKind, model, systemPrompt)` — the SAME lane calling the SAME
|
|
379
|
-
* model with the SAME (static) system prompt always gets the SAME key, so repeat calls route to the
|
|
380
|
-
* same cache-warm backend — while remaining fully synthetic: it is a salted hash, namespaced with a
|
|
381
|
-
* `lane:` prefix, and never derived from or equal to the real session id.
|
|
382
|
-
*/
|
|
383
|
-
export declare function computeLaneAffinityKey(laneKind: string, model: Model<any> | undefined, systemPrompt: string): string;
|
|
384
|
-
/** Result of an isolated completion: the text, the usage spent, and the stop reason. */
|
|
385
|
-
export interface IsolatedCompletionResult {
|
|
386
|
-
text: string;
|
|
387
|
-
usage: Usage;
|
|
388
|
-
stopReason: StopReason;
|
|
389
|
-
}
|
|
390
|
-
export interface ResearchLaneRunOutcome {
|
|
391
|
-
/** False when the pass was skipped before starting (see skipReason). */
|
|
392
|
-
started: boolean;
|
|
393
|
-
skipReason?: string;
|
|
394
|
-
/** Terminal lane record when the pass ran. */
|
|
395
|
-
record?: LaneRecord;
|
|
396
|
-
result?: ResearchRunResult;
|
|
397
|
-
}
|
|
398
|
-
export interface WorkerDelegationRunOutcome {
|
|
399
|
-
/** False when the delegation was skipped before starting (see skipReason). */
|
|
400
|
-
started: boolean;
|
|
401
|
-
skipReason?: string;
|
|
402
|
-
/** Terminal lane record when the delegation ran. */
|
|
403
|
-
record?: LaneRecord;
|
|
404
|
-
outcome?: WorkerRunOutcome;
|
|
405
|
-
}
|
|
406
|
-
export interface GoalContinuationOnceOptions {
|
|
407
|
-
maxStallTurns: number;
|
|
408
|
-
promptLimits?: GoalContinuationPromptLimits;
|
|
409
|
-
}
|
|
410
|
-
export interface GoalContinuationOnceResult {
|
|
411
|
-
submitted: boolean;
|
|
412
|
-
snapshot: GoalRuntimeSnapshot;
|
|
413
|
-
prompt?: GoalContinuationPrompt;
|
|
414
|
-
}
|
|
415
|
-
export type GoalContinuationLoopStopReason = "continuation_not_allowed" | "max_turns_reached" | "wall_clock_budget_reached" | "goal_state_not_advanced" | "goal_budget_exhausted" | "already_continuing" | "session_disposed" | "goal_tool_unavailable" | "worker_in_flight";
|
|
416
|
-
export interface GoalContinuationLoopOptions extends GoalContinuationOnceOptions {
|
|
417
|
-
maxTurns: number;
|
|
418
|
-
/** 0 or undefined disables wall-clock budget. */
|
|
419
|
-
maxWallClockMinutes?: number;
|
|
420
|
-
/** Test seam for wall-clock budget enforcement. Defaults to Date.now. */
|
|
421
|
-
now?: () => number;
|
|
422
|
-
}
|
|
423
|
-
export interface GoalContinuationLoopResult {
|
|
424
|
-
turnsSubmitted: number;
|
|
425
|
-
stopReason: GoalContinuationLoopStopReason;
|
|
426
|
-
finalSnapshot: GoalRuntimeSnapshot;
|
|
427
|
-
}
|
|
50
|
+
export * from "./agent-session-contracts.ts";
|
|
51
|
+
import type { AgentSessionConfig, AgentSessionEventListener, ExtensionBindings, GoalContinuationLoopOptions, GoalContinuationLoopResult, GoalContinuationOnceOptions, GoalContinuationOnceResult, IsolatedCompletionOptions, IsolatedCompletionResult, ModelCycleResult, PromptOptions, ResearchLaneRunOutcome, SessionStats, SpawnedUsageTotals, WorkerDelegationRunOutcome } from "./agent-session-contracts.ts";
|
|
52
|
+
export type { ToolProbeReport, ToolProbeResult, ToolProbeVerdict } from "./tool-protocol-controller.ts";
|
|
428
53
|
export declare class AgentSession {
|
|
429
54
|
readonly agent: Agent;
|
|
430
55
|
readonly sessionManager: SessionManager;
|
|
@@ -444,12 +69,8 @@ export declare class AgentSession {
|
|
|
444
69
|
* switching from a small-window model back to a large one restores the full requested set.
|
|
445
70
|
*/
|
|
446
71
|
private _requestedActiveToolNames;
|
|
447
|
-
private _compactionAbortController;
|
|
448
|
-
private _autoCompactionAbortController;
|
|
449
|
-
private _overflowRecoveryAttempted;
|
|
450
72
|
private _unboundToolGrantWarnings;
|
|
451
73
|
private _branchSummaryAbortController;
|
|
452
|
-
private _retryController;
|
|
453
74
|
private readonly _modelSelection;
|
|
454
75
|
private readonly _bash;
|
|
455
76
|
private readonly _profileFilter;
|
|
@@ -466,39 +87,26 @@ export declare class AgentSession {
|
|
|
466
87
|
private _agentDir;
|
|
467
88
|
private _collectWorkspaceSources;
|
|
468
89
|
private readonly _localRuntimeController;
|
|
469
|
-
private readonly
|
|
90
|
+
private readonly _toolProtocol;
|
|
470
91
|
private _prefixWarmer;
|
|
471
92
|
private readonly _completedPrefixWarms;
|
|
472
|
-
private readonly _repairModeSessionCounts;
|
|
473
|
-
private readonly _textProtocolParseFailures;
|
|
474
|
-
private _textProtocolParseObservedThisTurn;
|
|
475
|
-
/** Total text-protocol parse-failure events observed this session, backing the
|
|
476
|
-
* {@link TEXT_TOOL_PROTOCOL_STEER_INTERVAL} throttle on {@link _maybeInjectTextProtocolCorrectiveSteer}. */
|
|
477
|
-
private _textProtocolCorrectiveSteerCount;
|
|
478
|
-
/** Monotonic counter backing tool-probe/text-protocol-calibration spawned-usage reportIds
|
|
479
|
-
* (see {@link _nextProbeUsageReportId}); guarantees each probe/calibration completion in the
|
|
480
|
-
* session lands in the cost ledger exactly once, even across repeated /toolprobe invocations. */
|
|
481
|
-
private _toolProbeUsageReportSeq;
|
|
482
|
-
/** Anti-loop: modelKeys the evidence-gated auto-probe has already fired for THIS session (see
|
|
483
|
-
* {@link _maybeAutoProbeOnValidationEscalation}), so a burst of validation-escalation events for
|
|
484
|
-
* the same still-failing model never re-fires the probe more than once per session. */
|
|
485
|
-
private readonly _autoProbedModels;
|
|
486
|
-
private _textProtocolValidationOutcomeThisTurn;
|
|
487
93
|
/** Assembles the session's base system prompt from live session state (see
|
|
488
94
|
* system-prompt-builder.ts); owns the paired _baseSystemPromptOptions. */
|
|
489
95
|
private readonly _systemPromptBuilder;
|
|
490
96
|
/** Autonomy telemetry sink + status/diagnostic snapshots (see autonomy-telemetry.ts); owns
|
|
491
97
|
* the latest gate outcome and the bounded gate-outcome history. */
|
|
492
98
|
private readonly _autonomyTelemetry;
|
|
493
|
-
/** Goal auto-continue + research lane +
|
|
99
|
+
/** Goal auto-continue + research lane + profile-bound worker delegation + model-fitness probe (see
|
|
494
100
|
* background-lane-controller.ts); owns the lane timers/guards, the last research-lane skip
|
|
495
101
|
* reason, the live LaneTracker, and the in-flight research/worker abort controllers. */
|
|
496
102
|
private readonly _backgroundLanes;
|
|
103
|
+
private readonly _humanInput;
|
|
497
104
|
/** Plug-and-play memory subsystem (see memory-controller.ts); owns the OKF retrieval provider, the
|
|
498
105
|
* latest retrieval/prompt-inclusion reports, the reload-safe MemoryManager, the recall
|
|
499
106
|
* effectiveness tracker, and the extension-contributed pending providers. */
|
|
500
107
|
private readonly _memory;
|
|
501
108
|
private readonly _compactionSupport;
|
|
109
|
+
private readonly _compaction;
|
|
502
110
|
/** Per-turn context-shaping subsystem (see context-pipeline.ts); owns the latest
|
|
503
111
|
* audit/policy/correlation/enforcement/gc reports, the brain-curation sidecar + its skip reasons,
|
|
504
112
|
* and the tool-output artifact store. Invoked stage-by-stage from the context transform. */
|
|
@@ -528,19 +136,19 @@ export declare class AgentSession {
|
|
|
528
136
|
* used by the status report. Its parallel routed drive path delegates every turn back to
|
|
529
137
|
* {@link _runAgentPrompt} so the drive loop stays host-side. */
|
|
530
138
|
private readonly _modelRouter;
|
|
531
|
-
private readonly
|
|
139
|
+
private readonly _foregroundRecovery;
|
|
532
140
|
private readonly _failureCorpus;
|
|
533
141
|
private readonly _toolRecoveryLogger;
|
|
534
142
|
private readonly _toolRecoveryEventLogPath;
|
|
535
143
|
private _skillCuratorInstance?;
|
|
536
144
|
private _disposed;
|
|
145
|
+
private _disposeCompletion;
|
|
537
146
|
private readonly _reflectionAbort;
|
|
538
147
|
/** Native reflection engine + learning-apply/rollback path (see reflection-controller.ts); owns no
|
|
539
148
|
* session state, applies durable writes through the bundled memory tool and the session log. */
|
|
540
149
|
private readonly _reflection;
|
|
541
|
-
/**
|
|
542
|
-
|
|
543
|
-
private readonly _goalContinuation;
|
|
150
|
+
/** Durable goal lifecycle, accounting, and raw continuation loop. */
|
|
151
|
+
private readonly _goals;
|
|
544
152
|
private readonly _isChildSession;
|
|
545
153
|
private _baseToolsOverride?;
|
|
546
154
|
private _sessionStartEvent;
|
|
@@ -600,7 +208,8 @@ export declare class AgentSession {
|
|
|
600
208
|
* The ceiling is turn-cumulative: the next foreground call's projection is folded together with
|
|
601
209
|
* background/research/worker/reflection spend recorded SINCE THIS TURN BEGAN — {@link getSpawnedUsage}'s
|
|
602
210
|
* already-recorded rollup (the same read-side-deduped total the footer's SUBAGENTS line uses) minus the
|
|
603
|
-
* baseline snapshotted
|
|
211
|
+
* baseline snapshotted before a new turn enters routing in `_promptUnserialized`
|
|
212
|
+
* ({@link _costGuardTurnBaselineUsd}) — so a
|
|
604
213
|
* turn that is cheap in the foreground but has spent heavily via background lanes THIS turn still trips
|
|
605
214
|
* the warning, while a prior turn's background spend does not keep every later turn's guard stuck
|
|
606
215
|
* "over". A background lane that finishes mid-turn is attributed to whichever turn it completes in.
|
|
@@ -630,67 +239,14 @@ export declare class AgentSession {
|
|
|
630
239
|
restorePromotedSkill(name: string): boolean;
|
|
631
240
|
private _installAgentTurnRefresh;
|
|
632
241
|
private _createAgentContextSnapshot;
|
|
633
|
-
|
|
634
|
-
private _toolRepairSettings;
|
|
635
|
-
private _applyToolRepairLayerSettings;
|
|
636
|
-
private _getModelAdaptationRulesForPrompt;
|
|
637
|
-
private _textProtocolFlag;
|
|
638
|
-
private _streamForToolProbe;
|
|
639
|
-
/** Builds a reportId that uniquely identifies one probe/calibration completion within the
|
|
640
|
-
* session: the model, a caller-supplied `kind` (e.g. "read-task", "echo", or
|
|
641
|
-
* "text-protocol:<variant>"), and a monotonic sequence number. The sequence number (not
|
|
642
|
-
* wall-clock time or randomness) is what guarantees no collision even when the same model+kind
|
|
643
|
-
* is probed again later in the session (e.g. a repeated /toolprobe run), so genuine repeat spend
|
|
644
|
-
* is never silently deduped away. */
|
|
645
|
-
private _nextProbeUsageReportId;
|
|
646
|
-
private _resolveProbeStreamCountingUsage;
|
|
647
|
-
private _textProtocolCalibrationContext;
|
|
648
|
-
private _messageHasToolCallWithStringArgument;
|
|
649
|
-
private _nativeToolProbeSystemPrompt;
|
|
650
|
-
private _runNativeReadTaskProbeTrial;
|
|
651
|
-
private _runNativeEchoToolProbeTrial;
|
|
652
|
-
private _gradeNativeToolCallingForModel;
|
|
653
|
-
private _runTextProtocolTrial;
|
|
654
|
-
private _calibrateTextToolProtocolForModel;
|
|
655
|
-
private _ensureTextToolProtocolForActiveModel;
|
|
656
|
-
private _modelRef;
|
|
657
|
-
/** The persisted `/toolprobe` verdict on record for this model, if any (undefined = unprobed). */
|
|
658
|
-
private _toolProbeVerdict;
|
|
659
|
-
private _formatToolProbeReport;
|
|
660
|
-
private _storeToolProbe;
|
|
242
|
+
/** Compatibility seam retained for focused auto-probe regressions. */
|
|
661
243
|
private _probeToolCallingForModel;
|
|
662
|
-
|
|
244
|
+
/** Compatibility seam retained for focused protocol-selection doctrine regressions. */
|
|
245
|
+
private _resolveModelToolProtocol;
|
|
663
246
|
probeToolCalling(target?: string): Promise<ToolProbeReport>;
|
|
664
|
-
/**
|
|
665
|
-
* The text-protocol circuit breaker. Every parse failure (from either the
|
|
666
|
-
* live per-completion {@link Agent.onTextToolProtocolParse} callback or the post-hoc detection in
|
|
667
|
-
* {@link _recordTextToolProtocolParseOutcomeFromLastAssistant}) gets a throttled one-line
|
|
668
|
-
* corrective steer for the next turn. On the 3rd consecutive SAME-SIGNATURE failure — graded
|
|
669
|
-
* evidence a model genuinely cannot speak this dialect, not a single bad turn — the breaker also
|
|
670
|
-
* demotes the persisted tool-probe verdict to "none" so {@link _textProtocolFlag} reads false next
|
|
671
|
-
* turn and native is attempted instead of thrashing on a protocol this model has proven it can't
|
|
672
|
-
* follow.
|
|
673
|
-
*/
|
|
674
|
-
private _handleTextToolProtocolParse;
|
|
675
|
-
/**
|
|
676
|
-
* A phone model whose envelope fails to parse gets no corrective guidance today —
|
|
677
|
-
* the runaway-loop backstop only trips on repeated PARSED tool-call signatures (agent-loop.ts), so
|
|
678
|
-
* an every-turn unparseable-prose model never trips it. Inject a one-line reminder of the envelope
|
|
679
|
-
* shape as a nextTurn message, reusing {@link formatVariantEnvelope} so the reminder can never
|
|
680
|
-
* drift from the grammar the primer actually teaches. Throttled to the first failure this session
|
|
681
|
-
* and then every {@link TEXT_TOOL_PROTOCOL_STEER_INTERVAL}th after — the breaker above is what
|
|
682
|
-
* actually demotes a genuinely-failing model at the 3rd same-signature failure; this is guidance,
|
|
683
|
-
* not a second counter.
|
|
684
|
-
*/
|
|
685
|
-
private _maybeInjectTextProtocolCorrectiveSteer;
|
|
686
|
-
private _handleTextToolProtocolValidationOutcome;
|
|
687
|
-
private _recordTextToolProtocolParseOutcomeFromLastAssistant;
|
|
688
|
-
private _looksLikeTextToolProtocolAttempt;
|
|
689
|
-
private _tagModelAdaptationRuleTeaching;
|
|
690
|
-
private _repairSessionCount;
|
|
691
|
-
private _handleModelAdaptationTelemetry;
|
|
692
247
|
/** Tool-build call-site delegation to {@link ContextPipeline.getToolArtifactStore}. */
|
|
693
248
|
private _getToolArtifactStore;
|
|
249
|
+
private _getSessionImageStore;
|
|
694
250
|
/**
|
|
695
251
|
* Context-transform hot-path delegation to {@link ContextPipeline.runContextAudit}. Kept as a
|
|
696
252
|
* one-line method (not inlined) so the transform stays the single owner of the pass ordering.
|
|
@@ -779,12 +335,6 @@ export declare class AgentSession {
|
|
|
779
335
|
private _applyContextGc;
|
|
780
336
|
/** Read-only inspection of the latest context-gc report (delegates to {@link ContextPipeline.getContextGcReport}). */
|
|
781
337
|
getContextGcReport(messages?: AgentMessage[]): ContextGcReport;
|
|
782
|
-
/**
|
|
783
|
-
* Context-transform hot-path delegation to {@link ContextPipeline.estimateCurrentContextTokens}. Kept
|
|
784
|
-
* as a one-line method (not inlined) so the transform stays the single owner of the pass ordering;
|
|
785
|
-
* also feeds the per-turn cost guard.
|
|
786
|
-
*/
|
|
787
|
-
private _estimateCurrentContextTokens;
|
|
788
338
|
private _installAgentToolHooks;
|
|
789
339
|
/**
|
|
790
340
|
* The runaway-loop backstop ({@link Agent.maxStallTurns}) stopped a turn stuck repeating one
|
|
@@ -793,11 +343,6 @@ export declare class AgentSession {
|
|
|
793
343
|
* warning through the same event the context-window/compaction backstops use.
|
|
794
344
|
*/
|
|
795
345
|
private _handleRunawayStop;
|
|
796
|
-
/** Anti-loop: true when this model's persisted tool-probe verdict was written within the
|
|
797
|
-
* auto-probe freshness window ({@link AUTO_TOOL_PROBE_FRESHNESS_MS}) — covers a very recent
|
|
798
|
-
* explicit `/toolprobe` run or a fresh circuit-breaker demote from an EARLIER session, complementing
|
|
799
|
-
* the in-session {@link _autoProbedModels} latch. */
|
|
800
|
-
private _hasFreshToolProbeVerdict;
|
|
801
346
|
/**
|
|
802
347
|
* Evidence-gated native→phone auto-probe for a LOCAL/MANAGED model (never cloud — see
|
|
803
348
|
* {@link isLocalOrManagedRouterModel}) that just crossed the tool-argument-validation escalation
|
|
@@ -808,7 +353,7 @@ export declare class AgentSession {
|
|
|
808
353
|
* "native" and is never phoned) entirely OFF the hot path — fired here but never awaited by the
|
|
809
354
|
* caller, so a slow or failing probe can never block or throw the user's in-flight turn.
|
|
810
355
|
* Anti-loop: skipped when this session already auto-probed this model, or a fresh persisted
|
|
811
|
-
* verdict already exists ({@link
|
|
356
|
+
* verdict already exists (enforced by {@link ToolProtocolController}) — otherwise a model that keeps
|
|
812
357
|
* failing validation every turn would re-fire the (multi-completion) probe every single turn.
|
|
813
358
|
*/
|
|
814
359
|
private _maybeAutoProbeOnValidationEscalation;
|
|
@@ -839,7 +384,6 @@ export declare class AgentSession {
|
|
|
839
384
|
private _emit;
|
|
840
385
|
private _notifyWorkerTerminalHandoff;
|
|
841
386
|
private _emitQueueUpdate;
|
|
842
|
-
private _lastAssistantMessage;
|
|
843
387
|
/**
|
|
844
388
|
* User messages already painted to the UI by an early, synthetic `message_start` fired from
|
|
845
389
|
* `_promptUnserialized` — before the model-router judge's bounded LLM call — so the prompt
|
|
@@ -891,10 +435,12 @@ export declare class AgentSession {
|
|
|
891
435
|
* Call this when completely done with the session.
|
|
892
436
|
*/
|
|
893
437
|
dispose(): void;
|
|
438
|
+
/** Dispose synchronously-visible state, then await all session-owned asynchronous shutdowns. */
|
|
439
|
+
disposeAndWait(): Promise<void>;
|
|
894
440
|
/** Full agent state */
|
|
895
441
|
get state(): AgentState;
|
|
896
442
|
/** Current model (may be undefined if not yet selected) */
|
|
897
|
-
get model(): Model<
|
|
443
|
+
get model(): Model<Api> | undefined;
|
|
898
444
|
/** Current thinking level */
|
|
899
445
|
get thinkingLevel(): ThinkingLevel;
|
|
900
446
|
/** Whether agent is currently streaming a response */
|
|
@@ -929,7 +475,7 @@ export declare class AgentSession {
|
|
|
929
475
|
* Changes take effect on the next agent turn.
|
|
930
476
|
*
|
|
931
477
|
* artifact_retrieve is auto-activated as a companion whenever an artifact-producing tool
|
|
932
|
-
* (grep, find, or
|
|
478
|
+
* (grep, find, run_toolkit_script, or ask_question) ends up in the resulting active set and artifact_retrieve
|
|
933
479
|
* is registered (i.e. not excluded/
|
|
934
480
|
* blocked/outside an allowlist -- the registry itself is built with that same filter,
|
|
935
481
|
* so registry presence already tracks "allowed"). This is enforced here, not just in
|
|
@@ -956,12 +502,12 @@ export declare class AgentSession {
|
|
|
956
502
|
get sessionName(): string | undefined;
|
|
957
503
|
/** Scoped models for cycling (from --models flag) */
|
|
958
504
|
get scopedModels(): ReadonlyArray<{
|
|
959
|
-
model: Model<
|
|
505
|
+
model: Model<Api>;
|
|
960
506
|
thinkingLevel?: ThinkingLevel;
|
|
961
507
|
}>;
|
|
962
508
|
/** Update scoped models for cycling */
|
|
963
509
|
setScopedModels(scopedModels: Array<{
|
|
964
|
-
model: Model<
|
|
510
|
+
model: Model<Api>;
|
|
965
511
|
thinkingLevel?: ThinkingLevel;
|
|
966
512
|
}>): void;
|
|
967
513
|
/** File-based prompt templates */
|
|
@@ -976,6 +522,12 @@ export declare class AgentSession {
|
|
|
976
522
|
*/
|
|
977
523
|
private _buildSystemPromptForToolNames;
|
|
978
524
|
private _runAgentPrompt;
|
|
525
|
+
/**
|
|
526
|
+
* Re-enter an interrupted ask_question call from its durable request snapshot. Pending requests
|
|
527
|
+
* are presented again; already-checkpointed answers are replayed without asking twice. The
|
|
528
|
+
* original toolCallId is preserved so provider tool-call ordering remains valid on /resume.
|
|
529
|
+
*/
|
|
530
|
+
resumePendingHumanInput(): Promise<boolean>;
|
|
979
531
|
/**
|
|
980
532
|
* Shared {@link OllamaRuntime} for a given server, lazily created and cached by baseUrl so every
|
|
981
533
|
* caller — the router's readiness gate and any host UI's own model-lifecycle commands (e.g.
|
|
@@ -1105,7 +657,7 @@ export declare class AgentSession {
|
|
|
1105
657
|
* Abort current operation and wait for agent to become idle.
|
|
1106
658
|
*/
|
|
1107
659
|
abort(): Promise<void>;
|
|
1108
|
-
setModel(model: Model<
|
|
660
|
+
setModel(model: Model<Api>, options?: {
|
|
1109
661
|
persistSettings?: boolean;
|
|
1110
662
|
}): Promise<void>;
|
|
1111
663
|
/** Re-resolve startup profile model/thinking after allowed extension providers are bound. */
|
|
@@ -1156,7 +708,18 @@ export declare class AgentSession {
|
|
|
1156
708
|
private _checkContextWindowUsageWarning;
|
|
1157
709
|
private _checkCompaction;
|
|
1158
710
|
private _measureLiveContextTokensForCompaction;
|
|
711
|
+
/**
|
|
712
|
+
* Internal: Run auto-compaction with events.
|
|
713
|
+
*/
|
|
1159
714
|
private _runAutoCompaction;
|
|
715
|
+
/**
|
|
716
|
+
* Run one compaction attempt, retrying retryable provider failures (stream stalls,
|
|
717
|
+
* 429/5xx, network drops) with the session's retry policy. The reliability kernel
|
|
718
|
+
* classifies a stall as retryable by design (see withStreamIdleWatchdog); without this
|
|
719
|
+
* loop a single transient killed the whole compaction while ordinary turns survived the
|
|
720
|
+
* same failure via auto-retry. Caller aborts are never retried; sleepAbortable rejects
|
|
721
|
+
* with the abort reason if the signal fires mid-backoff.
|
|
722
|
+
*/
|
|
1160
723
|
private _compactWithRetry;
|
|
1161
724
|
/**
|
|
1162
725
|
* Toggle auto-compaction setting.
|
|
@@ -1202,14 +765,6 @@ export declare class AgentSession {
|
|
|
1202
765
|
* Falls back to full reload if any individual load/unload fails.
|
|
1203
766
|
*/
|
|
1204
767
|
reconcileLoadedExtensions(): Promise<void>;
|
|
1205
|
-
/**
|
|
1206
|
-
* Check if an error is retryable (transient provider/network failures). Billing/quota and auth
|
|
1207
|
-
* are terminal; context overflow is handled by compaction, not retry. The verdict comes from the
|
|
1208
|
-
* reliability kernel's classifier, fed the host-computed context-overflow flag.
|
|
1209
|
-
*/
|
|
1210
|
-
private _classifyAssistantError;
|
|
1211
|
-
private _isRetryableError;
|
|
1212
|
-
private _prepareRetry;
|
|
1213
768
|
/**
|
|
1214
769
|
* Cancel in-progress retry.
|
|
1215
770
|
*/
|
|
@@ -1270,26 +825,30 @@ export declare class AgentSession {
|
|
|
1270
825
|
*
|
|
1271
826
|
* @returns the id of the appended custom entry
|
|
1272
827
|
*/
|
|
1273
|
-
saveGoalStateSnapshot(state: GoalState): string;
|
|
828
|
+
saveGoalStateSnapshot(state: GoalState, expected?: GoalStateRevision): string;
|
|
829
|
+
/** Persist a branch-scoped tombstone and stop goal-owned execution without resurrecting old state. */
|
|
830
|
+
clearGoalStateSnapshot(state: GoalState, now: string): string;
|
|
1274
831
|
/**
|
|
1275
832
|
* Retrieve the latest valid goal state snapshot from the session log.
|
|
1276
833
|
*/
|
|
1277
834
|
getGoalStateSnapshot(): GoalState | undefined;
|
|
1278
835
|
/**
|
|
1279
|
-
* Persist one submitted continuation pass's turn/wall-clock/spend contribution onto the active
|
|
1280
|
-
* goal's durable cumulative
|
|
836
|
+
* Persist one submitted continuation pass's exact turn/wall-clock/token/spend contribution onto the active
|
|
837
|
+
* goal's durable cumulative accounting (see `GoalState.continuationTurnsUsed` et al.). This is the
|
|
1281
838
|
* "persistence dep" `GoalLoopController` calls once per pass actually submitted — it, not the
|
|
1282
|
-
* loop controller, is where
|
|
1283
|
-
*
|
|
1284
|
-
*
|
|
1285
|
-
* `record_continuation_budget` event; the pure reducer in `goal-state.ts` derives the delta.
|
|
839
|
+
* loop controller, is where usage gets attributed: it scans only assistant messages appended on
|
|
840
|
+
* the active branch after the pass's captured cursor. Compaction cannot erase or reattribute that
|
|
841
|
+
* append-only interval, and unrelated foreground turns outside the interval are excluded.
|
|
1286
842
|
* A no-op when no goal state exists (defensive — in practice this is only ever called right
|
|
1287
843
|
* after a pass the loop already confirmed was submitted against an active goal).
|
|
1288
844
|
*/
|
|
1289
845
|
recordGoalContinuationPass(pass: {
|
|
1290
846
|
turns: number;
|
|
1291
847
|
wallClockMs: number;
|
|
848
|
+
usageCursor: string | null;
|
|
1292
849
|
}): void;
|
|
850
|
+
/** Restore runtime intent without mutating persisted goal lifecycle state. */
|
|
851
|
+
restoreGoalRuntimeAfterResume(): void;
|
|
1293
852
|
/** Save native task-step state to the active session log. */
|
|
1294
853
|
saveTaskStepsStateSnapshot(state: TaskStepsState): string;
|
|
1295
854
|
/** Retrieve the latest valid native task-step state from the active session log. */
|
|
@@ -1301,9 +860,10 @@ export declare class AgentSession {
|
|
|
1301
860
|
*/
|
|
1302
861
|
saveEvidenceBundleSnapshot(bundle: EvidenceBundle): string;
|
|
1303
862
|
/**
|
|
1304
|
-
* Retrieve the latest valid evidence bundle snapshot from the
|
|
863
|
+
* Retrieve the latest valid evidence bundle snapshot from the active branch.
|
|
1305
864
|
*/
|
|
1306
865
|
getEvidenceBundleSnapshot(): EvidenceBundle | undefined;
|
|
866
|
+
/** Retrieve all valid evidence bundle snapshots from the active branch. */
|
|
1307
867
|
getEvidenceBundleSnapshots(): EvidenceBundle[];
|
|
1308
868
|
/** Live lane records tracked by this process (running and terminal). */
|
|
1309
869
|
getLaneRecords(): LaneRecord[];
|
|
@@ -1311,8 +871,8 @@ export declare class AgentSession {
|
|
|
1311
871
|
private _recordGateOutcome;
|
|
1312
872
|
/** Copies of the bounded gate-outcome history, oldest first, latest last. */
|
|
1313
873
|
getGateOutcomeHistory(): GateOutcomeHistoryEntry[];
|
|
1314
|
-
|
|
1315
|
-
|
|
874
|
+
saveWorkerClaimSnapshot(claim: WorkerClaim, request?: WorkerRequest): string;
|
|
875
|
+
getWorkerClaimSnapshots(): WorkerClaim[];
|
|
1316
876
|
saveLearningDecisionSnapshot(decision: LearningDecision): string;
|
|
1317
877
|
getLearningDecisionSnapshots(): LearningDecision[];
|
|
1318
878
|
/**
|
|
@@ -1347,14 +907,10 @@ export declare class AgentSession {
|
|
|
1347
907
|
goalId?: string;
|
|
1348
908
|
}): Promise<ResearchLaneRunOutcome>;
|
|
1349
909
|
/**
|
|
1350
|
-
* Run one bounded
|
|
910
|
+
* Run one bounded profile-bound worker delegation. Delegates to {@link BackgroundLaneController};
|
|
1351
911
|
* consumed by the `delegate` tool.
|
|
1352
912
|
*/
|
|
1353
|
-
runWorkerDelegationOnce(request:
|
|
1354
|
-
instructions: string;
|
|
1355
|
-
systemPrompt?: string;
|
|
1356
|
-
memoryRead?: boolean;
|
|
1357
|
-
}): Promise<WorkerDelegationRunOutcome>;
|
|
913
|
+
runWorkerDelegationOnce(request: WorkerDelegationRequest): Promise<WorkerDelegationRunOutcome>;
|
|
1358
914
|
/**
|
|
1359
915
|
* Probe a candidate model against the subagent contracts. Delegates to
|
|
1360
916
|
* {@link BackgroundLaneController}; probe spend is reported through spawned-usage accounting.
|
|
@@ -1378,7 +934,7 @@ export declare class AgentSession {
|
|
|
1378
934
|
* continuation. Delegates to {@link BackgroundLaneController.continueGoalLoopExclusive}, the
|
|
1379
935
|
* single-flight guard that prevents two goal loops from racing to submit prompts through the
|
|
1380
936
|
* same session (which throws "Agent is already processing" from the second submission). Do not
|
|
1381
|
-
* call `this.
|
|
937
|
+
* call `this._goals.continueLoop` directly from here — that bypasses the guard.
|
|
1382
938
|
*/
|
|
1383
939
|
continueGoalLoop(options: GoalContinuationLoopOptions): Promise<GoalContinuationLoopResult>;
|
|
1384
940
|
/**
|
|
@@ -1393,7 +949,7 @@ export declare class AgentSession {
|
|
|
1393
949
|
runReflectionPass(input: {
|
|
1394
950
|
signals: DemandSignals;
|
|
1395
951
|
recentTurnText: string;
|
|
1396
|
-
model?: Model<
|
|
952
|
+
model?: Model<Api>;
|
|
1397
953
|
thinkingLevel?: ThinkingLevel;
|
|
1398
954
|
signal?: AbortSignal;
|
|
1399
955
|
/** Stable id so a duplicate scheduling/retry of the same pass can't double-count its cost. */
|