@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
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
import { resolveModelThinkingLevel } from "@caupulican/pi-ai";
|
|
2
|
+
import { getPrivateLaneDeniedPaths } from "../autonomy/lane-private-paths.js";
|
|
3
|
+
import { createLaneToolSurface } from "../autonomy/lane-tool-surface.js";
|
|
4
|
+
import { appendLaneRecordSnapshot, getLaneRecordSnapshots } from "../autonomy/session-lane-record.js";
|
|
5
|
+
import { composeSubagentSystemPrompt } from "../autonomy/subagent-prompt.js";
|
|
6
|
+
import { AUTONOMY_TELEMETRY_EVENT_TYPES } from "../autonomy/telemetry-events.js";
|
|
7
|
+
import { registerInFlightWork } from "../reload-blockers.js";
|
|
8
|
+
import { clampLaneMaxUsd } from "./lane-model-resolver.js";
|
|
9
|
+
import { runResearch } from "./research-runner.js";
|
|
10
|
+
/** Owns autonomous research demand, scheduling, execution, persistence, and cancellation. */
|
|
11
|
+
export class ResearchLaneController {
|
|
12
|
+
_timer;
|
|
13
|
+
_isRunning = false;
|
|
14
|
+
_lastSkipReason;
|
|
15
|
+
_historySeeded = false;
|
|
16
|
+
_persistedRunCount = 0;
|
|
17
|
+
abortController = new AbortController();
|
|
18
|
+
warnedUnboundToolGrants = new Set();
|
|
19
|
+
deps;
|
|
20
|
+
lanes;
|
|
21
|
+
models;
|
|
22
|
+
constructor(deps, lanes, models) {
|
|
23
|
+
this.deps = deps;
|
|
24
|
+
this.lanes = lanes;
|
|
25
|
+
this.models = models;
|
|
26
|
+
}
|
|
27
|
+
seedHistory() {
|
|
28
|
+
if (this._historySeeded)
|
|
29
|
+
return;
|
|
30
|
+
const records = getLaneRecordSnapshots(this.deps.getSessionManager().getEntries());
|
|
31
|
+
this.lanes.ensureCounterAtLeast(records.length + 1);
|
|
32
|
+
this._persistedRunCount = records.filter((record) => record.type === "research").length;
|
|
33
|
+
this._historySeeded = true;
|
|
34
|
+
}
|
|
35
|
+
getLastSkipReason() {
|
|
36
|
+
return this._lastSkipReason;
|
|
37
|
+
}
|
|
38
|
+
abort() {
|
|
39
|
+
this.clearTimer();
|
|
40
|
+
this.abortController.abort();
|
|
41
|
+
}
|
|
42
|
+
clearTimer() {
|
|
43
|
+
if (this._timer !== undefined) {
|
|
44
|
+
clearTimeout(this._timer);
|
|
45
|
+
this._timer = undefined;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
scheduleFromIdle() {
|
|
49
|
+
if (this._isRunning || this.deps.isDisposed() || this.deps.isChildSession())
|
|
50
|
+
return;
|
|
51
|
+
const research = this.deps.getSettingsManager().getResearchLaneSettings();
|
|
52
|
+
if (!research.enabled) {
|
|
53
|
+
this._lastSkipReason = "research_lane_disabled";
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
const { mode } = this.deps.getSettingsManager().getAutonomySettings();
|
|
57
|
+
if (mode === "off") {
|
|
58
|
+
this._lastSkipReason = "autonomy_mode_off";
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
this.seedHistory();
|
|
62
|
+
if (this._persistedRunCount >= research.maxRunsPerSession) {
|
|
63
|
+
this._lastSkipReason = "max_runs_reached";
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
if (!this.buildDemand())
|
|
67
|
+
return;
|
|
68
|
+
const shipment = this.models.resolveShipment(research, "no_research_model");
|
|
69
|
+
if (!shipment.ok) {
|
|
70
|
+
this._lastSkipReason = shipment.skipReason;
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
if (!this.models.capabilityProfile(shipment.model).backgroundLanesEnabled) {
|
|
74
|
+
this._lastSkipReason = "model_research_unsupported";
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
this.clearTimer();
|
|
78
|
+
this._timer = setTimeout(() => {
|
|
79
|
+
this._timer = undefined;
|
|
80
|
+
void this.runScheduled();
|
|
81
|
+
}, research.idleDelayMs);
|
|
82
|
+
const timer = this._timer;
|
|
83
|
+
if (typeof timer === "object" && timer && "unref" in timer) {
|
|
84
|
+
const { unref } = timer;
|
|
85
|
+
unref?.call(timer);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
async runOnce(request) {
|
|
89
|
+
if (this._isRunning)
|
|
90
|
+
return { started: false, skipReason: "research_lane_already_running" };
|
|
91
|
+
if (this.deps.isDisposed())
|
|
92
|
+
return { started: false, skipReason: "session_disposed" };
|
|
93
|
+
const settings = this.deps.getSettingsManager().getResearchLaneSettings();
|
|
94
|
+
const demand = request?.query
|
|
95
|
+
? { query: request.query, context: request.context ?? "", goalId: request.goalId }
|
|
96
|
+
: this.buildDemand();
|
|
97
|
+
if (!demand)
|
|
98
|
+
return { started: false, skipReason: this._lastSkipReason ?? "no_research_demand" };
|
|
99
|
+
const shipment = this.models.resolveShipment(settings, "no_research_model");
|
|
100
|
+
if (!shipment.ok) {
|
|
101
|
+
this._lastSkipReason = shipment.skipReason;
|
|
102
|
+
return { started: false, skipReason: shipment.skipReason };
|
|
103
|
+
}
|
|
104
|
+
const { model, laneProfile } = shipment;
|
|
105
|
+
const laneCapability = this.models.capabilityProfile(model);
|
|
106
|
+
if (!laneCapability.backgroundLanesEnabled) {
|
|
107
|
+
this._lastSkipReason = "model_research_unsupported";
|
|
108
|
+
return { started: false, skipReason: "model_research_unsupported" };
|
|
109
|
+
}
|
|
110
|
+
this._isRunning = true;
|
|
111
|
+
this.seedHistory();
|
|
112
|
+
const startedRecord = this.lanes.start({ type: "research", goalId: demand.goalId });
|
|
113
|
+
this._persistedRunCount++;
|
|
114
|
+
const deregisterInFlight = registerInFlightWork(this.deps.getAgentDir(), "lane", `research:${startedRecord.laneId}`);
|
|
115
|
+
try {
|
|
116
|
+
let spentUsage;
|
|
117
|
+
const workspaceSources = await this.deps.collectWorkspaceSources({
|
|
118
|
+
query: `${demand.context}\n${demand.query}`,
|
|
119
|
+
cwd: this.deps.getCwd(),
|
|
120
|
+
maxSources: settings.maxSources,
|
|
121
|
+
});
|
|
122
|
+
const maxUsd = clampLaneMaxUsd(settings.maxUsd, this.deps.getCapabilityEnvelope()?.maxEstimatedUsd);
|
|
123
|
+
const toolSurface = createLaneToolSurface({
|
|
124
|
+
cwd: this.deps.getCwd(),
|
|
125
|
+
profile: laneProfile,
|
|
126
|
+
deniedPaths: getPrivateLaneDeniedPaths(this.deps.getCwd(), this.deps.getAgentDir()),
|
|
127
|
+
});
|
|
128
|
+
this.warnUnboundToolGrants(laneProfile, toolSurface);
|
|
129
|
+
const result = await runResearch({
|
|
130
|
+
query: demand.query,
|
|
131
|
+
context: demand.context,
|
|
132
|
+
sources: workspaceSources,
|
|
133
|
+
envelope: this.buildEnvelope(maxUsd, laneProfile, toolSurface),
|
|
134
|
+
maxUsd,
|
|
135
|
+
maxSources: settings.maxSources,
|
|
136
|
+
maxFindings: settings.maxFindings,
|
|
137
|
+
maxWallClockMs: settings.maxWallClockMs,
|
|
138
|
+
signal: this.abortController.signal,
|
|
139
|
+
complete: async ({ systemPrompt, userPrompt, signal }) => {
|
|
140
|
+
const completion = await this.deps.runIsolatedCompletion({
|
|
141
|
+
systemPrompt: composeSubagentSystemPrompt({
|
|
142
|
+
soul: laneProfile?.soul,
|
|
143
|
+
rolePrompt: systemPrompt,
|
|
144
|
+
override: settings.systemPrompt,
|
|
145
|
+
}),
|
|
146
|
+
messages: [{ role: "user", content: [{ type: "text", text: userPrompt }], timestamp: Date.now() }],
|
|
147
|
+
model,
|
|
148
|
+
thinkingLevel: resolveModelThinkingLevel(model, laneProfile?.thinking),
|
|
149
|
+
maxTokens: laneCapability.laneMaxOutputTokens,
|
|
150
|
+
tools: toolSurface.tools,
|
|
151
|
+
maxTurns: 6,
|
|
152
|
+
beforeToolCall: toolSurface.beforeToolCall,
|
|
153
|
+
signal,
|
|
154
|
+
cacheRetention: "short",
|
|
155
|
+
laneKind: "research",
|
|
156
|
+
});
|
|
157
|
+
spentUsage = completion.usage;
|
|
158
|
+
return {
|
|
159
|
+
text: completion.text,
|
|
160
|
+
costUsd: completion.usage.cost.total,
|
|
161
|
+
stopReason: String(completion.stopReason),
|
|
162
|
+
};
|
|
163
|
+
},
|
|
164
|
+
});
|
|
165
|
+
if (this.deps.isDisposed()) {
|
|
166
|
+
const record = this.lanes.complete(startedRecord.laneId, {
|
|
167
|
+
status: "canceled",
|
|
168
|
+
reasonCode: "session_disposed",
|
|
169
|
+
});
|
|
170
|
+
return { started: true, record, result };
|
|
171
|
+
}
|
|
172
|
+
let evidenceEntryId;
|
|
173
|
+
if (result.bundle)
|
|
174
|
+
evidenceEntryId = this.deps.saveEvidenceBundleSnapshot(result.bundle);
|
|
175
|
+
if (spentUsage && (spentUsage.cost.total > 0 || spentUsage.totalTokens > 0)) {
|
|
176
|
+
this.deps.addSpawnedUsage(spentUsage, {
|
|
177
|
+
label: "research-lane",
|
|
178
|
+
reportId: `research:${this.deps.getSessionId()}:${startedRecord.laneId}`,
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
const record = this.lanes.complete(startedRecord.laneId, {
|
|
182
|
+
status: result.status,
|
|
183
|
+
reasonCode: result.reasonCode,
|
|
184
|
+
costUsd: result.costUsd,
|
|
185
|
+
evidenceEntryId,
|
|
186
|
+
});
|
|
187
|
+
if (record) {
|
|
188
|
+
appendLaneRecordSnapshot(this.deps.getSessionManager(), record);
|
|
189
|
+
this.emitTerminalTelemetry(record);
|
|
190
|
+
}
|
|
191
|
+
return { started: true, record, result };
|
|
192
|
+
}
|
|
193
|
+
catch (error) {
|
|
194
|
+
const record = this.lanes.complete(startedRecord.laneId, {
|
|
195
|
+
status: "failed",
|
|
196
|
+
reasonCode: "research_lane_error",
|
|
197
|
+
});
|
|
198
|
+
if (record && !this.deps.isDisposed()) {
|
|
199
|
+
appendLaneRecordSnapshot(this.deps.getSessionManager(), record);
|
|
200
|
+
this.emitTerminalTelemetry(record);
|
|
201
|
+
}
|
|
202
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
203
|
+
this.deps.emit({ type: "warning", message: `Research lane failed: ${message}` });
|
|
204
|
+
return { started: true, record };
|
|
205
|
+
}
|
|
206
|
+
finally {
|
|
207
|
+
this._isRunning = false;
|
|
208
|
+
deregisterInFlight();
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
buildDemand() {
|
|
212
|
+
const goal = this.deps.getGoalStateSnapshot();
|
|
213
|
+
if (!goal || goal.status !== "active") {
|
|
214
|
+
this._lastSkipReason = "no_active_goal";
|
|
215
|
+
return undefined;
|
|
216
|
+
}
|
|
217
|
+
const open = goal.requirements.filter((requirement) => requirement.status === "open");
|
|
218
|
+
if (open.length === 0) {
|
|
219
|
+
this._lastSkipReason = "no_open_requirements";
|
|
220
|
+
return undefined;
|
|
221
|
+
}
|
|
222
|
+
const query = `goal:${goal.goalId} requirements:${open
|
|
223
|
+
.map((requirement) => requirement.id)
|
|
224
|
+
.sort()
|
|
225
|
+
.join(",")}`;
|
|
226
|
+
if (this.deps.getEvidenceBundleSnapshot()?.query === query) {
|
|
227
|
+
this._lastSkipReason = "recent_evidence_sufficient";
|
|
228
|
+
return undefined;
|
|
229
|
+
}
|
|
230
|
+
const context = [
|
|
231
|
+
`Goal: ${goal.userGoal}`,
|
|
232
|
+
"Open requirements:",
|
|
233
|
+
...open.slice(0, 20).map((requirement) => `- ${requirement.text}`),
|
|
234
|
+
].join("\n");
|
|
235
|
+
return { query, context, goalId: goal.goalId };
|
|
236
|
+
}
|
|
237
|
+
async runScheduled() {
|
|
238
|
+
if (this._isRunning || this.deps.isDisposed())
|
|
239
|
+
return;
|
|
240
|
+
const research = this.deps.getSettingsManager().getResearchLaneSettings();
|
|
241
|
+
const { mode } = this.deps.getSettingsManager().getAutonomySettings();
|
|
242
|
+
if (!research.enabled || mode === "off")
|
|
243
|
+
return;
|
|
244
|
+
try {
|
|
245
|
+
await this.runOnce();
|
|
246
|
+
}
|
|
247
|
+
catch (error) {
|
|
248
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
249
|
+
this.deps.emit({ type: "warning", message: `Research lane failed: ${message}` });
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
buildEnvelope(maxUsd, laneProfile, surface) {
|
|
253
|
+
return {
|
|
254
|
+
id: `research-${this.deps.getSessionId()}-${Date.now()}`,
|
|
255
|
+
profileId: laneProfile?.name,
|
|
256
|
+
capabilities: ["research.execute", "filesystem.read", "memory.query"],
|
|
257
|
+
allowedTools: [...surface.allowedTools],
|
|
258
|
+
deniedTools: [...surface.deniedTools],
|
|
259
|
+
allowedPaths: [this.deps.getCwd()],
|
|
260
|
+
deniedPaths: getPrivateLaneDeniedPaths(this.deps.getCwd(), this.deps.getAgentDir()),
|
|
261
|
+
maxEstimatedUsd: clampLaneMaxUsd(maxUsd, this.deps.getCapabilityEnvelope()?.maxEstimatedUsd),
|
|
262
|
+
createdAt: new Date().toISOString(),
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
warnUnboundToolGrants(laneProfile, surface) {
|
|
266
|
+
if (!laneProfile || surface.unboundAllowPatterns.length === 0)
|
|
267
|
+
return;
|
|
268
|
+
const warningKey = `${laneProfile.name}\0${[...surface.unboundAllowPatterns].sort().join("\0")}`;
|
|
269
|
+
if (this.warnedUnboundToolGrants.has(warningKey))
|
|
270
|
+
return;
|
|
271
|
+
this.warnedUnboundToolGrants.add(warningKey);
|
|
272
|
+
this.deps.emit({
|
|
273
|
+
type: "warning",
|
|
274
|
+
message: `Lane profile '${laneProfile.name}' grants unavailable isolated-lane tools: ${surface.unboundAllowPatterns.join(", ")}. Only classified lane tools can execute.`,
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
emitTerminalTelemetry(record) {
|
|
278
|
+
this.deps.emitAutonomyTelemetry({
|
|
279
|
+
type: AUTONOMY_TELEMETRY_EVENT_TYPES.evidenceBundle,
|
|
280
|
+
timestamp: new Date().toISOString(),
|
|
281
|
+
payload: {
|
|
282
|
+
laneId: record.laneId,
|
|
283
|
+
laneType: record.type,
|
|
284
|
+
status: record.status,
|
|
285
|
+
reasonCode: record.reasonCode ?? null,
|
|
286
|
+
costUsd: record.costUsd ?? null,
|
|
287
|
+
hasEvidence: record.evidenceEntryId !== undefined,
|
|
288
|
+
},
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
//# sourceMappingURL=research-lane-controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"research-lane-controller.js","sourceRoot":"","sources":["../../../src/core/research/research-lane-controller.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAc,MAAM,mBAAmB,CAAC;AAQ1E,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,EAAE,qBAAqB,EAAwB,MAAM,kCAAkC,CAAC;AAE/F,OAAO,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AACtG,OAAO,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAC;AAC7E,OAAO,EAAE,8BAA8B,EAA+B,MAAM,iCAAiC,CAAC;AAG9G,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAE7D,OAAO,EAAE,eAAe,EAA0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C;YACd,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,iBAAiB,WAAW,CAAC,IAAI,6CAA6C,OAAO,CAAC,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,2CAA2C;SACzK,CAAC,CAAC;IAAA,CACH;IAEO,qBAAqB,CAAC,MAAgD,EAAQ;QACrF,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC;YAC/B,IAAI,EAAE,8BAA8B,CAAC,cAAc;YACnD,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACnC,OAAO,EAAE;gBACR,MAAM,EAAE,MAAM,CAAC,MAAM;gBACrB,QAAQ,EAAE,MAAM,CAAC,IAAI;gBACrB,MAAM,EAAE,MAAM,CAAC,MAAM;gBACrB,UAAU,EAAE,MAAM,CAAC,UAAU,IAAI,IAAI;gBACrC,OAAO,EAAE,MAAM,CAAC,OAAO,IAAI,IAAI;gBAC/B,WAAW,EAAE,MAAM,CAAC,eAAe,KAAK,SAAS;aACjD;SACD,CAAC,CAAC;IAAA,CACH;CACD","sourcesContent":["import type { SessionManager } from \"@caupulican/pi-agent-core/node\";\nimport { resolveModelThinkingLevel, type Usage } from \"@caupulican/pi-ai\";\nimport type {\n\tAgentSessionEvent,\n\tIsolatedCompletionOptions,\n\tIsolatedCompletionResult,\n\tResearchLaneRunOutcome,\n} from \"../agent-session.ts\";\nimport type { CapabilityEnvelope, EvidenceBundle } from \"../autonomy/contracts.ts\";\nimport { getPrivateLaneDeniedPaths } from \"../autonomy/lane-private-paths.ts\";\nimport { createLaneToolSurface, type LaneToolSurface } from \"../autonomy/lane-tool-surface.ts\";\nimport type { LaneTracker } from \"../autonomy/lane-tracker.ts\";\nimport { appendLaneRecordSnapshot, getLaneRecordSnapshots } from \"../autonomy/session-lane-record.ts\";\nimport { composeSubagentSystemPrompt } from \"../autonomy/subagent-prompt.ts\";\nimport { AUTONOMY_TELEMETRY_EVENT_TYPES, type AutonomyTelemetryEvent } from \"../autonomy/telemetry-events.ts\";\nimport type { GoalState } from \"../goals/goal-state.ts\";\nimport type { NormalizedProfile } from \"../profile-registry.ts\";\nimport { registerInFlightWork } from \"../reload-blockers.ts\";\nimport type { SettingsManager } from \"../settings-manager.ts\";\nimport { clampLaneMaxUsd, type LaneModelResolver } from \"./lane-model-resolver.ts\";\nimport { runResearch } from \"./research-runner.ts\";\nimport type { collectWorkspaceSources } from \"./workspace-collector.ts\";\n\nexport interface ResearchLaneControllerDeps {\n\tisDisposed(): boolean;\n\tisChildSession(): boolean;\n\tgetSessionId(): string;\n\tgetCwd(): string;\n\tgetAgentDir(): string;\n\tgetSessionManager(): SessionManager;\n\tgetSettingsManager(): SettingsManager;\n\tgetCapabilityEnvelope(): CapabilityEnvelope | undefined;\n\temit(event: AgentSessionEvent): void;\n\temitAutonomyTelemetry(event: AutonomyTelemetryEvent): void;\n\tgetGoalStateSnapshot(): GoalState | undefined;\n\tgetEvidenceBundleSnapshot(): EvidenceBundle | undefined;\n\tsaveEvidenceBundleSnapshot(bundle: EvidenceBundle): string;\n\taddSpawnedUsage(\n\t\tusage: Usage,\n\t\topts: { label?: string; sourceSessionId?: string; reportId: string },\n\t): string | undefined;\n\trunIsolatedCompletion(opts: IsolatedCompletionOptions): Promise<IsolatedCompletionResult>;\n\tcollectWorkspaceSources: typeof collectWorkspaceSources;\n}\n\n/** Owns autonomous research demand, scheduling, execution, persistence, and cancellation. */\nexport class ResearchLaneController {\n\tprivate _timer: ReturnType<typeof setTimeout> | undefined;\n\tprivate _isRunning = false;\n\tprivate _lastSkipReason: string | undefined;\n\tprivate _historySeeded = false;\n\tprivate _persistedRunCount = 0;\n\tprivate readonly abortController = new AbortController();\n\tprivate readonly warnedUnboundToolGrants = new Set<string>();\n\tprivate readonly deps: ResearchLaneControllerDeps;\n\tprivate readonly lanes: LaneTracker;\n\tprivate readonly models: LaneModelResolver;\n\n\tconstructor(deps: ResearchLaneControllerDeps, lanes: LaneTracker, models: LaneModelResolver) {\n\t\tthis.deps = deps;\n\t\tthis.lanes = lanes;\n\t\tthis.models = models;\n\t}\n\n\tseedHistory(): void {\n\t\tif (this._historySeeded) return;\n\t\tconst records = getLaneRecordSnapshots(this.deps.getSessionManager().getEntries());\n\t\tthis.lanes.ensureCounterAtLeast(records.length + 1);\n\t\tthis._persistedRunCount = records.filter((record) => record.type === \"research\").length;\n\t\tthis._historySeeded = true;\n\t}\n\n\tgetLastSkipReason(): string | undefined {\n\t\treturn this._lastSkipReason;\n\t}\n\n\tabort(): void {\n\t\tthis.clearTimer();\n\t\tthis.abortController.abort();\n\t}\n\n\tclearTimer(): void {\n\t\tif (this._timer !== undefined) {\n\t\t\tclearTimeout(this._timer);\n\t\t\tthis._timer = undefined;\n\t\t}\n\t}\n\n\tscheduleFromIdle(): void {\n\t\tif (this._isRunning || this.deps.isDisposed() || this.deps.isChildSession()) return;\n\t\tconst research = this.deps.getSettingsManager().getResearchLaneSettings();\n\t\tif (!research.enabled) {\n\t\t\tthis._lastSkipReason = \"research_lane_disabled\";\n\t\t\treturn;\n\t\t}\n\t\tconst { mode } = this.deps.getSettingsManager().getAutonomySettings();\n\t\tif (mode === \"off\") {\n\t\t\tthis._lastSkipReason = \"autonomy_mode_off\";\n\t\t\treturn;\n\t\t}\n\t\tthis.seedHistory();\n\t\tif (this._persistedRunCount >= research.maxRunsPerSession) {\n\t\t\tthis._lastSkipReason = \"max_runs_reached\";\n\t\t\treturn;\n\t\t}\n\t\tif (!this.buildDemand()) return;\n\t\tconst shipment = this.models.resolveShipment(research, \"no_research_model\");\n\t\tif (!shipment.ok) {\n\t\t\tthis._lastSkipReason = shipment.skipReason;\n\t\t\treturn;\n\t\t}\n\t\tif (!this.models.capabilityProfile(shipment.model).backgroundLanesEnabled) {\n\t\t\tthis._lastSkipReason = \"model_research_unsupported\";\n\t\t\treturn;\n\t\t}\n\n\t\tthis.clearTimer();\n\t\tthis._timer = setTimeout(() => {\n\t\t\tthis._timer = undefined;\n\t\t\tvoid this.runScheduled();\n\t\t}, research.idleDelayMs);\n\t\tconst timer = this._timer;\n\t\tif (typeof timer === \"object\" && timer && \"unref\" in timer) {\n\t\t\tconst { unref } = timer as { unref?: () => void };\n\t\t\tunref?.call(timer);\n\t\t}\n\t}\n\n\tasync runOnce(request?: { query?: string; context?: string; goalId?: string }): Promise<ResearchLaneRunOutcome> {\n\t\tif (this._isRunning) return { started: false, skipReason: \"research_lane_already_running\" };\n\t\tif (this.deps.isDisposed()) return { started: false, skipReason: \"session_disposed\" };\n\n\t\tconst settings = this.deps.getSettingsManager().getResearchLaneSettings();\n\t\tconst demand = request?.query\n\t\t\t? { query: request.query, context: request.context ?? \"\", goalId: request.goalId }\n\t\t\t: this.buildDemand();\n\t\tif (!demand) return { started: false, skipReason: this._lastSkipReason ?? \"no_research_demand\" };\n\n\t\tconst shipment = this.models.resolveShipment(settings, \"no_research_model\");\n\t\tif (!shipment.ok) {\n\t\t\tthis._lastSkipReason = shipment.skipReason;\n\t\t\treturn { started: false, skipReason: shipment.skipReason };\n\t\t}\n\t\tconst { model, laneProfile } = shipment;\n\t\tconst laneCapability = this.models.capabilityProfile(model);\n\t\tif (!laneCapability.backgroundLanesEnabled) {\n\t\t\tthis._lastSkipReason = \"model_research_unsupported\";\n\t\t\treturn { started: false, skipReason: \"model_research_unsupported\" };\n\t\t}\n\n\t\tthis._isRunning = true;\n\t\tthis.seedHistory();\n\t\tconst startedRecord = this.lanes.start({ type: \"research\", goalId: demand.goalId });\n\t\tthis._persistedRunCount++;\n\t\tconst deregisterInFlight = registerInFlightWork(\n\t\t\tthis.deps.getAgentDir(),\n\t\t\t\"lane\",\n\t\t\t`research:${startedRecord.laneId}`,\n\t\t);\n\t\ttry {\n\t\t\tlet spentUsage: Usage | undefined;\n\t\t\tconst workspaceSources = await this.deps.collectWorkspaceSources({\n\t\t\t\tquery: `${demand.context}\\n${demand.query}`,\n\t\t\t\tcwd: this.deps.getCwd(),\n\t\t\t\tmaxSources: settings.maxSources,\n\t\t\t});\n\t\t\tconst maxUsd = clampLaneMaxUsd(settings.maxUsd, this.deps.getCapabilityEnvelope()?.maxEstimatedUsd);\n\t\t\tconst toolSurface = createLaneToolSurface({\n\t\t\t\tcwd: this.deps.getCwd(),\n\t\t\t\tprofile: laneProfile,\n\t\t\t\tdeniedPaths: getPrivateLaneDeniedPaths(this.deps.getCwd(), this.deps.getAgentDir()),\n\t\t\t});\n\t\t\tthis.warnUnboundToolGrants(laneProfile, toolSurface);\n\t\t\tconst result = await runResearch({\n\t\t\t\tquery: demand.query,\n\t\t\t\tcontext: demand.context,\n\t\t\t\tsources: workspaceSources,\n\t\t\t\tenvelope: this.buildEnvelope(maxUsd, laneProfile, toolSurface),\n\t\t\t\tmaxUsd,\n\t\t\t\tmaxSources: settings.maxSources,\n\t\t\t\tmaxFindings: settings.maxFindings,\n\t\t\t\tmaxWallClockMs: settings.maxWallClockMs,\n\t\t\t\tsignal: this.abortController.signal,\n\t\t\t\tcomplete: async ({ systemPrompt, userPrompt, signal }) => {\n\t\t\t\t\tconst completion = await this.deps.runIsolatedCompletion({\n\t\t\t\t\t\tsystemPrompt: composeSubagentSystemPrompt({\n\t\t\t\t\t\t\tsoul: laneProfile?.soul,\n\t\t\t\t\t\t\trolePrompt: systemPrompt,\n\t\t\t\t\t\t\toverride: settings.systemPrompt,\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tmessages: [{ role: \"user\", content: [{ type: \"text\", text: userPrompt }], timestamp: Date.now() }],\n\t\t\t\t\t\tmodel,\n\t\t\t\t\t\tthinkingLevel: resolveModelThinkingLevel(model, laneProfile?.thinking),\n\t\t\t\t\t\tmaxTokens: laneCapability.laneMaxOutputTokens,\n\t\t\t\t\t\ttools: toolSurface.tools,\n\t\t\t\t\t\tmaxTurns: 6,\n\t\t\t\t\t\tbeforeToolCall: toolSurface.beforeToolCall,\n\t\t\t\t\t\tsignal,\n\t\t\t\t\t\tcacheRetention: \"short\",\n\t\t\t\t\t\tlaneKind: \"research\",\n\t\t\t\t\t});\n\t\t\t\t\tspentUsage = completion.usage;\n\t\t\t\t\treturn {\n\t\t\t\t\t\ttext: completion.text,\n\t\t\t\t\t\tcostUsd: completion.usage.cost.total,\n\t\t\t\t\t\tstopReason: String(completion.stopReason),\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t});\n\n\t\t\tif (this.deps.isDisposed()) {\n\t\t\t\tconst record = this.lanes.complete(startedRecord.laneId, {\n\t\t\t\t\tstatus: \"canceled\",\n\t\t\t\t\treasonCode: \"session_disposed\",\n\t\t\t\t});\n\t\t\t\treturn { started: true, record, result };\n\t\t\t}\n\n\t\t\tlet evidenceEntryId: string | undefined;\n\t\t\tif (result.bundle) evidenceEntryId = this.deps.saveEvidenceBundleSnapshot(result.bundle);\n\t\t\tif (spentUsage && (spentUsage.cost.total > 0 || spentUsage.totalTokens > 0)) {\n\t\t\t\tthis.deps.addSpawnedUsage(spentUsage, {\n\t\t\t\t\tlabel: \"research-lane\",\n\t\t\t\t\treportId: `research:${this.deps.getSessionId()}:${startedRecord.laneId}`,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tconst record = this.lanes.complete(startedRecord.laneId, {\n\t\t\t\tstatus: result.status,\n\t\t\t\treasonCode: result.reasonCode,\n\t\t\t\tcostUsd: result.costUsd,\n\t\t\t\tevidenceEntryId,\n\t\t\t});\n\t\t\tif (record) {\n\t\t\t\tappendLaneRecordSnapshot(this.deps.getSessionManager(), record);\n\t\t\t\tthis.emitTerminalTelemetry(record);\n\t\t\t}\n\t\t\treturn { started: true, record, result };\n\t\t} catch (error) {\n\t\t\tconst record = this.lanes.complete(startedRecord.laneId, {\n\t\t\t\tstatus: \"failed\",\n\t\t\t\treasonCode: \"research_lane_error\",\n\t\t\t});\n\t\t\tif (record && !this.deps.isDisposed()) {\n\t\t\t\tappendLaneRecordSnapshot(this.deps.getSessionManager(), record);\n\t\t\t\tthis.emitTerminalTelemetry(record);\n\t\t\t}\n\t\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\t\tthis.deps.emit({ type: \"warning\", message: `Research lane failed: ${message}` });\n\t\t\treturn { started: true, record };\n\t\t} finally {\n\t\t\tthis._isRunning = false;\n\t\t\tderegisterInFlight();\n\t\t}\n\t}\n\n\tprivate buildDemand(): { query: string; context: string; goalId: string } | undefined {\n\t\tconst goal = this.deps.getGoalStateSnapshot();\n\t\tif (!goal || goal.status !== \"active\") {\n\t\t\tthis._lastSkipReason = \"no_active_goal\";\n\t\t\treturn undefined;\n\t\t}\n\t\tconst open = goal.requirements.filter((requirement) => requirement.status === \"open\");\n\t\tif (open.length === 0) {\n\t\t\tthis._lastSkipReason = \"no_open_requirements\";\n\t\t\treturn undefined;\n\t\t}\n\t\tconst query = `goal:${goal.goalId} requirements:${open\n\t\t\t.map((requirement) => requirement.id)\n\t\t\t.sort()\n\t\t\t.join(\",\")}`;\n\t\tif (this.deps.getEvidenceBundleSnapshot()?.query === query) {\n\t\t\tthis._lastSkipReason = \"recent_evidence_sufficient\";\n\t\t\treturn undefined;\n\t\t}\n\t\tconst context = [\n\t\t\t`Goal: ${goal.userGoal}`,\n\t\t\t\"Open requirements:\",\n\t\t\t...open.slice(0, 20).map((requirement) => `- ${requirement.text}`),\n\t\t].join(\"\\n\");\n\t\treturn { query, context, goalId: goal.goalId };\n\t}\n\n\tprivate async runScheduled(): Promise<void> {\n\t\tif (this._isRunning || this.deps.isDisposed()) return;\n\t\tconst research = this.deps.getSettingsManager().getResearchLaneSettings();\n\t\tconst { mode } = this.deps.getSettingsManager().getAutonomySettings();\n\t\tif (!research.enabled || mode === \"off\") return;\n\t\ttry {\n\t\t\tawait this.runOnce();\n\t\t} catch (error) {\n\t\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\t\tthis.deps.emit({ type: \"warning\", message: `Research lane failed: ${message}` });\n\t\t}\n\t}\n\n\tprivate buildEnvelope(\n\t\tmaxUsd: number,\n\t\tlaneProfile: NormalizedProfile | undefined,\n\t\tsurface: LaneToolSurface,\n\t): CapabilityEnvelope {\n\t\treturn {\n\t\t\tid: `research-${this.deps.getSessionId()}-${Date.now()}`,\n\t\t\tprofileId: laneProfile?.name,\n\t\t\tcapabilities: [\"research.execute\", \"filesystem.read\", \"memory.query\"],\n\t\t\tallowedTools: [...surface.allowedTools],\n\t\t\tdeniedTools: [...surface.deniedTools],\n\t\t\tallowedPaths: [this.deps.getCwd()],\n\t\t\tdeniedPaths: getPrivateLaneDeniedPaths(this.deps.getCwd(), this.deps.getAgentDir()),\n\t\t\tmaxEstimatedUsd: clampLaneMaxUsd(maxUsd, this.deps.getCapabilityEnvelope()?.maxEstimatedUsd),\n\t\t\tcreatedAt: new Date().toISOString(),\n\t\t};\n\t}\n\n\tprivate warnUnboundToolGrants(laneProfile: NormalizedProfile | undefined, surface: LaneToolSurface): void {\n\t\tif (!laneProfile || surface.unboundAllowPatterns.length === 0) return;\n\t\tconst warningKey = `${laneProfile.name}\\0${[...surface.unboundAllowPatterns].sort().join(\"\\0\")}`;\n\t\tif (this.warnedUnboundToolGrants.has(warningKey)) return;\n\t\tthis.warnedUnboundToolGrants.add(warningKey);\n\t\tthis.deps.emit({\n\t\t\ttype: \"warning\",\n\t\t\tmessage: `Lane profile '${laneProfile.name}' grants unavailable isolated-lane tools: ${surface.unboundAllowPatterns.join(\", \")}. Only classified lane tools can execute.`,\n\t\t});\n\t}\n\n\tprivate emitTerminalTelemetry(record: ReturnType<LaneTracker[\"complete\"]> & {}): void {\n\t\tthis.deps.emitAutonomyTelemetry({\n\t\t\ttype: AUTONOMY_TELEMETRY_EVENT_TYPES.evidenceBundle,\n\t\t\ttimestamp: new Date().toISOString(),\n\t\t\tpayload: {\n\t\t\t\tlaneId: record.laneId,\n\t\t\t\tlaneType: record.type,\n\t\t\t\tstatus: record.status,\n\t\t\t\treasonCode: record.reasonCode ?? null,\n\t\t\t\tcostUsd: record.costUsd ?? null,\n\t\t\t\thasEvidence: record.evidenceEntryId !== undefined,\n\t\t\t},\n\t\t});\n\t}\n}\n"]}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import type { SessionEntry, SessionManager } from "@caupulican/pi-agent-core/node";
|
|
2
2
|
import type { EvidenceBundle } from "../autonomy/contracts.ts";
|
|
3
|
+
import { type SessionSnapshotPayload } from "../session-snapshot.ts";
|
|
3
4
|
export declare const EVIDENCE_BUNDLE_CUSTOM_TYPE = "evidence_bundle";
|
|
4
|
-
export
|
|
5
|
-
version: 1;
|
|
6
|
-
bundle: EvidenceBundle;
|
|
7
|
-
}
|
|
5
|
+
export type EvidenceBundleSnapshotPayload = SessionSnapshotPayload<"bundle", EvidenceBundle>;
|
|
8
6
|
export declare function appendEvidenceBundleSnapshot(sessionManager: Pick<SessionManager, "appendCustomEntry">, bundle: EvidenceBundle): string;
|
|
9
7
|
export declare function getEvidenceBundleSnapshots(entries: readonly SessionEntry[]): EvidenceBundle[];
|
|
10
8
|
export declare function getLatestEvidenceBundleSnapshot(entries: readonly SessionEntry[]): EvidenceBundle | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-evidence-bundle.d.ts","sourceRoot":"","sources":["../../../src/core/research/session-evidence-bundle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACnF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"session-evidence-bundle.d.ts","sourceRoot":"","sources":["../../../src/core/research/session-evidence-bundle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACnF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAKN,KAAK,sBAAsB,EAC3B,MAAM,wBAAwB,CAAC;AAGhC,eAAO,MAAM,2BAA2B,oBAAoB,CAAC;AAE7D,MAAM,MAAM,6BAA6B,GAAG,sBAAsB,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;AAS7F,wBAAgB,4BAA4B,CAC3C,cAAc,EAAE,IAAI,CAAC,cAAc,EAAE,mBAAmB,CAAC,EACzD,MAAM,EAAE,cAAc,GACpB,MAAM,CAER;AAED,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,SAAS,YAAY,EAAE,GAAG,cAAc,EAAE,CAE7F;AAED,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,SAAS,YAAY,EAAE,GAAG,cAAc,GAAG,SAAS,CAE5G","sourcesContent":["import type { SessionEntry, SessionManager } from \"@caupulican/pi-agent-core/node\";\nimport type { EvidenceBundle } from \"../autonomy/contracts.ts\";\nimport {\n\tappendSessionSnapshot,\n\tgetLatestSessionSnapshot,\n\tgetSessionSnapshots,\n\ttype SessionSnapshotCodec,\n\ttype SessionSnapshotPayload,\n} from \"../session-snapshot.ts\";\nimport { cloneEvidenceBundleForStorage, isEvidenceBundle } from \"./evidence-bundle.ts\";\n\nexport const EVIDENCE_BUNDLE_CUSTOM_TYPE = \"evidence_bundle\";\n\nexport type EvidenceBundleSnapshotPayload = SessionSnapshotPayload<\"bundle\", EvidenceBundle>;\n\nconst EVIDENCE_BUNDLE_SNAPSHOT_CODEC: SessionSnapshotCodec<EvidenceBundle, \"bundle\"> = {\n\tcustomType: EVIDENCE_BUNDLE_CUSTOM_TYPE,\n\tvalueKey: \"bundle\",\n\tisValue: isEvidenceBundle,\n\tclone: cloneEvidenceBundleForStorage,\n};\n\nexport function appendEvidenceBundleSnapshot(\n\tsessionManager: Pick<SessionManager, \"appendCustomEntry\">,\n\tbundle: EvidenceBundle,\n): string {\n\treturn appendSessionSnapshot(sessionManager, EVIDENCE_BUNDLE_SNAPSHOT_CODEC, bundle);\n}\n\nexport function getEvidenceBundleSnapshots(entries: readonly SessionEntry[]): EvidenceBundle[] {\n\treturn getSessionSnapshots(entries, EVIDENCE_BUNDLE_SNAPSHOT_CODEC);\n}\n\nexport function getLatestEvidenceBundleSnapshot(entries: readonly SessionEntry[]): EvidenceBundle | undefined {\n\treturn getLatestSessionSnapshot(entries, EVIDENCE_BUNDLE_SNAPSHOT_CODEC);\n}\n"]}
|
|
@@ -1,55 +1,19 @@
|
|
|
1
|
+
import { appendSessionSnapshot, getLatestSessionSnapshot, getSessionSnapshots, } from "../session-snapshot.js";
|
|
1
2
|
import { cloneEvidenceBundleForStorage, isEvidenceBundle } from "./evidence-bundle.js";
|
|
2
3
|
export const EVIDENCE_BUNDLE_CUSTOM_TYPE = "evidence_bundle";
|
|
4
|
+
const EVIDENCE_BUNDLE_SNAPSHOT_CODEC = {
|
|
5
|
+
customType: EVIDENCE_BUNDLE_CUSTOM_TYPE,
|
|
6
|
+
valueKey: "bundle",
|
|
7
|
+
isValue: isEvidenceBundle,
|
|
8
|
+
clone: cloneEvidenceBundleForStorage,
|
|
9
|
+
};
|
|
3
10
|
export function appendEvidenceBundleSnapshot(sessionManager, bundle) {
|
|
4
|
-
|
|
5
|
-
version: 1,
|
|
6
|
-
bundle: cloneEvidenceBundleForStorage(bundle),
|
|
7
|
-
};
|
|
8
|
-
return sessionManager.appendCustomEntry(EVIDENCE_BUNDLE_CUSTOM_TYPE, payload);
|
|
9
|
-
}
|
|
10
|
-
function isPlainRecord(value) {
|
|
11
|
-
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
12
|
-
return false;
|
|
13
|
-
const prototype = Object.getPrototypeOf(value);
|
|
14
|
-
return prototype === Object.prototype || prototype === null;
|
|
11
|
+
return appendSessionSnapshot(sessionManager, EVIDENCE_BUNDLE_SNAPSHOT_CODEC, bundle);
|
|
15
12
|
}
|
|
16
13
|
export function getEvidenceBundleSnapshots(entries) {
|
|
17
|
-
|
|
18
|
-
for (const entry of entries) {
|
|
19
|
-
if (entry.type !== "custom" || entry.customType !== EVIDENCE_BUNDLE_CUSTOM_TYPE) {
|
|
20
|
-
continue;
|
|
21
|
-
}
|
|
22
|
-
const payload = entry.data;
|
|
23
|
-
if (!isPlainRecord(payload))
|
|
24
|
-
continue;
|
|
25
|
-
if (payload.version !== 1)
|
|
26
|
-
continue;
|
|
27
|
-
if (!("bundle" in payload))
|
|
28
|
-
continue;
|
|
29
|
-
const bundle = payload.bundle;
|
|
30
|
-
if (isEvidenceBundle(bundle)) {
|
|
31
|
-
bundles.push(cloneEvidenceBundleForStorage(bundle));
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
return bundles;
|
|
14
|
+
return getSessionSnapshots(entries, EVIDENCE_BUNDLE_SNAPSHOT_CODEC);
|
|
35
15
|
}
|
|
36
16
|
export function getLatestEvidenceBundleSnapshot(entries) {
|
|
37
|
-
|
|
38
|
-
const entry = entries[i];
|
|
39
|
-
if (entry.type === "custom" && entry.customType === EVIDENCE_BUNDLE_CUSTOM_TYPE) {
|
|
40
|
-
const payload = entry.data;
|
|
41
|
-
if (!isPlainRecord(payload))
|
|
42
|
-
continue;
|
|
43
|
-
if (payload.version !== 1)
|
|
44
|
-
continue;
|
|
45
|
-
if (!("bundle" in payload))
|
|
46
|
-
continue;
|
|
47
|
-
const bundle = payload.bundle;
|
|
48
|
-
if (isEvidenceBundle(bundle)) {
|
|
49
|
-
return cloneEvidenceBundleForStorage(bundle);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
return undefined;
|
|
17
|
+
return getLatestSessionSnapshot(entries, EVIDENCE_BUNDLE_SNAPSHOT_CODEC);
|
|
54
18
|
}
|
|
55
19
|
//# sourceMappingURL=session-evidence-bundle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-evidence-bundle.js","sourceRoot":"","sources":["../../../src/core/research/session-evidence-bundle.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,6BAA6B,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAEvF,MAAM,CAAC,MAAM,2BAA2B,GAAG,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"session-evidence-bundle.js","sourceRoot":"","sources":["../../../src/core/research/session-evidence-bundle.ts"],"names":[],"mappings":"AAEA,OAAO,EACN,qBAAqB,EACrB,wBAAwB,EACxB,mBAAmB,GAGnB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,6BAA6B,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAEvF,MAAM,CAAC,MAAM,2BAA2B,GAAG,iBAAiB,CAAC;AAI7D,MAAM,8BAA8B,GAAmD;IACtF,UAAU,EAAE,2BAA2B;IACvC,QAAQ,EAAE,QAAQ;IAClB,OAAO,EAAE,gBAAgB;IACzB,KAAK,EAAE,6BAA6B;CACpC,CAAC;AAEF,MAAM,UAAU,4BAA4B,CAC3C,cAAyD,EACzD,MAAsB,EACb;IACT,OAAO,qBAAqB,CAAC,cAAc,EAAE,8BAA8B,EAAE,MAAM,CAAC,CAAC;AAAA,CACrF;AAED,MAAM,UAAU,0BAA0B,CAAC,OAAgC,EAAoB;IAC9F,OAAO,mBAAmB,CAAC,OAAO,EAAE,8BAA8B,CAAC,CAAC;AAAA,CACpE;AAED,MAAM,UAAU,+BAA+B,CAAC,OAAgC,EAA8B;IAC7G,OAAO,wBAAwB,CAAC,OAAO,EAAE,8BAA8B,CAAC,CAAC;AAAA,CACzE","sourcesContent":["import type { SessionEntry, SessionManager } from \"@caupulican/pi-agent-core/node\";\nimport type { EvidenceBundle } from \"../autonomy/contracts.ts\";\nimport {\n\tappendSessionSnapshot,\n\tgetLatestSessionSnapshot,\n\tgetSessionSnapshots,\n\ttype SessionSnapshotCodec,\n\ttype SessionSnapshotPayload,\n} from \"../session-snapshot.ts\";\nimport { cloneEvidenceBundleForStorage, isEvidenceBundle } from \"./evidence-bundle.ts\";\n\nexport const EVIDENCE_BUNDLE_CUSTOM_TYPE = \"evidence_bundle\";\n\nexport type EvidenceBundleSnapshotPayload = SessionSnapshotPayload<\"bundle\", EvidenceBundle>;\n\nconst EVIDENCE_BUNDLE_SNAPSHOT_CODEC: SessionSnapshotCodec<EvidenceBundle, \"bundle\"> = {\n\tcustomType: EVIDENCE_BUNDLE_CUSTOM_TYPE,\n\tvalueKey: \"bundle\",\n\tisValue: isEvidenceBundle,\n\tclone: cloneEvidenceBundleForStorage,\n};\n\nexport function appendEvidenceBundleSnapshot(\n\tsessionManager: Pick<SessionManager, \"appendCustomEntry\">,\n\tbundle: EvidenceBundle,\n): string {\n\treturn appendSessionSnapshot(sessionManager, EVIDENCE_BUNDLE_SNAPSHOT_CODEC, bundle);\n}\n\nexport function getEvidenceBundleSnapshots(entries: readonly SessionEntry[]): EvidenceBundle[] {\n\treturn getSessionSnapshots(entries, EVIDENCE_BUNDLE_SNAPSHOT_CODEC);\n}\n\nexport function getLatestEvidenceBundleSnapshot(entries: readonly SessionEntry[]): EvidenceBundle | undefined {\n\treturn getLatestSessionSnapshot(entries, EVIDENCE_BUNDLE_SNAPSHOT_CODEC);\n}\n"]}
|