@caupulican/pi-adaptative 0.94.0 → 0.95.0
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 +55 -0
- package/dist/bundled-resources/extensions/tmux-agent-manager/README.md +32 -13
- package/dist/bundled-resources/extensions/tmux-agent-manager/index.d.ts +7 -4
- package/dist/bundled-resources/extensions/tmux-agent-manager/index.d.ts.map +1 -1
- package/dist/bundled-resources/extensions/tmux-agent-manager/index.js +173 -293
- package/dist/bundled-resources/extensions/tmux-agent-manager/index.js.map +1 -1
- package/dist/bundled-resources/extensions/tmux-agent-manager/index.ts +247 -392
- package/dist/bundled-resources/extensions/tmux-agent-manager/launch-profile.d.ts +52 -0
- package/dist/bundled-resources/extensions/tmux-agent-manager/launch-profile.d.ts.map +1 -0
- package/dist/bundled-resources/extensions/tmux-agent-manager/launch-profile.js +118 -0
- package/dist/bundled-resources/extensions/tmux-agent-manager/launch-profile.js.map +1 -0
- package/dist/bundled-resources/extensions/tmux-agent-manager/launch-profile.ts +169 -0
- package/dist/bundled-resources/extensions/tmux-agent-manager/templates/builder-validator.json +1 -1
- package/dist/bundled-resources/extensions/tmux-agent-manager/templates/provider-prompt-smoke.json +1 -1
- package/dist/bundled-resources/skills/pi-harness-learning/SKILL.md +13 -7
- package/dist/bundled-resources/skills/worker-profile-writer/SKILL.md +11 -11
- package/dist/core/agent-paths.d.ts +2 -0
- package/dist/core/agent-paths.d.ts.map +1 -1
- package/dist/core/agent-paths.js +7 -0
- package/dist/core/agent-paths.js.map +1 -1
- package/dist/core/agent-session.d.ts +11 -41
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +98 -161
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/autonomy/envelope-enforcement.d.ts +6 -1
- package/dist/core/autonomy/envelope-enforcement.d.ts.map +1 -1
- package/dist/core/autonomy/envelope-enforcement.js +26 -25
- package/dist/core/autonomy/envelope-enforcement.js.map +1 -1
- package/dist/core/autonomy/lane-private-paths.d.ts.map +1 -1
- package/dist/core/autonomy/lane-private-paths.js +2 -1
- package/dist/core/autonomy/lane-private-paths.js.map +1 -1
- package/dist/core/autonomy/lane-tool-surface.d.ts +8 -8
- package/dist/core/autonomy/lane-tool-surface.d.ts.map +1 -1
- package/dist/core/autonomy/lane-tool-surface.js +45 -30
- package/dist/core/autonomy/lane-tool-surface.js.map +1 -1
- package/dist/core/autonomy/worker-session-private-scope.d.ts +12 -0
- package/dist/core/autonomy/worker-session-private-scope.d.ts.map +1 -0
- package/dist/core/autonomy/worker-session-private-scope.js +42 -0
- package/dist/core/autonomy/worker-session-private-scope.js.map +1 -0
- package/dist/core/autonomy/worker-tool-adapter-registry.d.ts +65 -0
- package/dist/core/autonomy/worker-tool-adapter-registry.d.ts.map +1 -0
- package/dist/core/autonomy/worker-tool-adapter-registry.js +145 -0
- package/dist/core/autonomy/worker-tool-adapter-registry.js.map +1 -0
- package/dist/core/background-lane-controller.d.ts +9 -1
- package/dist/core/background-lane-controller.d.ts.map +1 -1
- package/dist/core/background-lane-controller.js +76 -6
- package/dist/core/background-lane-controller.js.map +1 -1
- package/dist/core/background-tool-task-controller.d.ts +23 -2
- package/dist/core/background-tool-task-controller.d.ts.map +1 -1
- package/dist/core/background-tool-task-controller.js +132 -17
- package/dist/core/background-tool-task-controller.js.map +1 -1
- package/dist/core/context/long-term-memory-trigger.d.ts +3 -1
- package/dist/core/context/long-term-memory-trigger.d.ts.map +1 -1
- package/dist/core/context/long-term-memory-trigger.js +1 -1
- package/dist/core/context/long-term-memory-trigger.js.map +1 -1
- package/dist/core/context/okf-memory-provider.d.ts +3 -0
- package/dist/core/context/okf-memory-provider.d.ts.map +1 -1
- package/dist/core/context/okf-memory-provider.js +66 -31
- package/dist/core/context/okf-memory-provider.js.map +1 -1
- package/dist/core/context/okf-memory.d.ts +18 -1
- package/dist/core/context/okf-memory.d.ts.map +1 -1
- package/dist/core/context/okf-memory.js +48 -0
- package/dist/core/context/okf-memory.js.map +1 -1
- package/dist/core/cost-guard-controller.d.ts +37 -0
- package/dist/core/cost-guard-controller.d.ts.map +1 -0
- package/dist/core/cost-guard-controller.js +71 -0
- package/dist/core/cost-guard-controller.js.map +1 -0
- package/dist/core/cost-guard.d.ts +9 -4
- package/dist/core/cost-guard.d.ts.map +1 -1
- package/dist/core/cost-guard.js +7 -3
- package/dist/core/cost-guard.js.map +1 -1
- package/dist/core/delegation/worker-agent-control.d.ts +4 -0
- package/dist/core/delegation/worker-agent-control.d.ts.map +1 -1
- package/dist/core/delegation/worker-agent-control.js.map +1 -1
- package/dist/core/delegation/worker-attempt-executor.d.ts +1 -1
- package/dist/core/delegation/worker-attempt-executor.d.ts.map +1 -1
- package/dist/core/delegation/worker-attempt-executor.js +0 -1
- package/dist/core/delegation/worker-attempt-executor.js.map +1 -1
- package/dist/core/delegation/worker-authority-resolver.d.ts +16 -3
- package/dist/core/delegation/worker-authority-resolver.d.ts.map +1 -1
- package/dist/core/delegation/worker-authority-resolver.js +114 -55
- package/dist/core/delegation/worker-authority-resolver.js.map +1 -1
- package/dist/core/delegation/worker-claim.d.ts +1 -2
- package/dist/core/delegation/worker-claim.d.ts.map +1 -1
- package/dist/core/delegation/worker-claim.js.map +1 -1
- package/dist/core/delegation/worker-delegation-controller.d.ts +19 -6
- package/dist/core/delegation/worker-delegation-controller.d.ts.map +1 -1
- package/dist/core/delegation/worker-delegation-controller.js +125 -40
- package/dist/core/delegation/worker-delegation-controller.js.map +1 -1
- package/dist/core/delegation/worker-delegation-request.d.ts +3 -3
- package/dist/core/delegation/worker-delegation-request.d.ts.map +1 -1
- package/dist/core/delegation/worker-delegation-request.js +13 -19
- package/dist/core/delegation/worker-delegation-request.js.map +1 -1
- package/dist/core/delegation/worker-execution-policy.d.ts +3 -2
- package/dist/core/delegation/worker-execution-policy.d.ts.map +1 -1
- package/dist/core/delegation/worker-execution-policy.js +54 -39
- package/dist/core/delegation/worker-execution-policy.js.map +1 -1
- package/dist/core/delegation/worker-fleet-limits.d.ts +3 -3
- package/dist/core/delegation/worker-fleet-limits.d.ts.map +1 -1
- package/dist/core/delegation/worker-fleet-limits.js +7 -7
- package/dist/core/delegation/worker-fleet-limits.js.map +1 -1
- package/dist/core/delegation/worker-machine-scope.d.ts +12 -0
- package/dist/core/delegation/worker-machine-scope.d.ts.map +1 -0
- package/dist/core/delegation/worker-machine-scope.js +38 -0
- package/dist/core/delegation/worker-machine-scope.js.map +1 -0
- package/dist/core/delegation/worker-notification-coordinator.d.ts +10 -0
- package/dist/core/delegation/worker-notification-coordinator.d.ts.map +1 -1
- package/dist/core/delegation/worker-notification-coordinator.js +69 -3
- package/dist/core/delegation/worker-notification-coordinator.js.map +1 -1
- package/dist/core/delegation/worker-recovery-coordinator.d.ts.map +1 -1
- package/dist/core/delegation/worker-recovery-coordinator.js +6 -1
- package/dist/core/delegation/worker-recovery-coordinator.js.map +1 -1
- package/dist/core/delegation/worker-runner.d.ts +5 -7
- package/dist/core/delegation/worker-runner.d.ts.map +1 -1
- package/dist/core/delegation/worker-runner.js +1 -4
- package/dist/core/delegation/worker-runner.js.map +1 -1
- package/dist/core/delegation/worker-write-reservation-coordinator.d.ts +3 -2
- package/dist/core/delegation/worker-write-reservation-coordinator.d.ts.map +1 -1
- package/dist/core/delegation/worker-write-reservation-coordinator.js +50 -25
- package/dist/core/delegation/worker-write-reservation-coordinator.js.map +1 -1
- package/dist/core/durable-custom-message-turn-controller.d.ts +6 -0
- package/dist/core/durable-custom-message-turn-controller.d.ts.map +1 -1
- package/dist/core/durable-custom-message-turn-controller.js +38 -15
- package/dist/core/durable-custom-message-turn-controller.js.map +1 -1
- package/dist/core/extension-binding-controller.d.ts +5 -1
- package/dist/core/extension-binding-controller.d.ts.map +1 -1
- package/dist/core/extension-binding-controller.js +15 -0
- package/dist/core/extension-binding-controller.js.map +1 -1
- package/dist/core/extensions/factory-runtime.d.ts.map +1 -1
- package/dist/core/extensions/factory-runtime.js +5 -0
- package/dist/core/extensions/factory-runtime.js.map +1 -1
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +1 -0
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +8 -4
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/foreground-terminal-handoff-controller.d.ts +31 -0
- package/dist/core/foreground-terminal-handoff-controller.d.ts.map +1 -1
- package/dist/core/foreground-terminal-handoff-controller.js +239 -55
- package/dist/core/foreground-terminal-handoff-controller.js.map +1 -1
- package/dist/core/goals/goal-session-controller.d.ts +2 -0
- package/dist/core/goals/goal-session-controller.d.ts.map +1 -1
- package/dist/core/goals/goal-session-controller.js +8 -0
- package/dist/core/goals/goal-session-controller.js.map +1 -1
- package/dist/core/goals/goal-tool-core.d.ts +5 -4
- package/dist/core/goals/goal-tool-core.d.ts.map +1 -1
- package/dist/core/goals/goal-tool-core.js +23 -19
- package/dist/core/goals/goal-tool-core.js.map +1 -1
- package/dist/core/learning/auto-learn-settings.d.ts +84 -0
- package/dist/core/learning/auto-learn-settings.d.ts.map +1 -0
- package/dist/core/learning/auto-learn-settings.js +66 -0
- package/dist/core/learning/auto-learn-settings.js.map +1 -0
- package/dist/core/learning/learning-audit.d.ts +5 -1
- package/dist/core/learning/learning-audit.d.ts.map +1 -1
- package/dist/core/learning/learning-audit.js +32 -1
- package/dist/core/learning/learning-audit.js.map +1 -1
- package/dist/core/learning/reflection-engine.d.ts +24 -0
- package/dist/core/learning/reflection-engine.d.ts.map +1 -1
- package/dist/core/learning/reflection-engine.js +104 -8
- package/dist/core/learning/reflection-engine.js.map +1 -1
- package/dist/core/local-prefix-warm-controller.d.ts +24 -0
- package/dist/core/local-prefix-warm-controller.d.ts.map +1 -0
- package/dist/core/local-prefix-warm-controller.js +79 -0
- package/dist/core/local-prefix-warm-controller.js.map +1 -0
- package/dist/core/memory/okf-project-memory-store.d.ts +28 -0
- package/dist/core/memory/okf-project-memory-store.d.ts.map +1 -0
- package/dist/core/memory/okf-project-memory-store.js +111 -0
- package/dist/core/memory/okf-project-memory-store.js.map +1 -0
- package/dist/core/memory/providers/file-store.d.ts +44 -1
- package/dist/core/memory/providers/file-store.d.ts.map +1 -1
- package/dist/core/memory/providers/file-store.js +341 -24
- package/dist/core/memory/providers/file-store.js.map +1 -1
- package/dist/core/memory/worker-memory-tools.d.ts +5 -0
- package/dist/core/memory/worker-memory-tools.d.ts.map +1 -0
- package/dist/core/memory/worker-memory-tools.js +5 -0
- package/dist/core/memory/worker-memory-tools.js.map +1 -0
- package/dist/core/memory-controller.d.ts +10 -1
- package/dist/core/memory-controller.d.ts.map +1 -1
- package/dist/core/memory-controller.js +72 -8
- package/dist/core/memory-controller.js.map +1 -1
- package/dist/core/model-capability.d.ts +7 -0
- package/dist/core/model-capability.d.ts.map +1 -1
- package/dist/core/model-capability.js +12 -0
- package/dist/core/model-capability.js.map +1 -1
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +2 -10
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-router-controller.d.ts +3 -2
- package/dist/core/model-router-controller.d.ts.map +1 -1
- package/dist/core/model-router-controller.js +3 -2
- package/dist/core/model-router-controller.js.map +1 -1
- package/dist/core/orchestration/contracts.d.ts +16 -12
- package/dist/core/orchestration/contracts.d.ts.map +1 -1
- package/dist/core/orchestration/contracts.js +2 -2
- package/dist/core/orchestration/contracts.js.map +1 -1
- package/dist/core/orchestration/lane-tool-manifests.d.ts +2 -2
- package/dist/core/orchestration/lane-tool-manifests.d.ts.map +1 -1
- package/dist/core/orchestration/lane-tool-manifests.js +6 -1
- package/dist/core/orchestration/lane-tool-manifests.js.map +1 -1
- package/dist/core/orchestration/profile-registry.d.ts.map +1 -1
- package/dist/core/orchestration/profile-registry.js +14 -0
- package/dist/core/orchestration/profile-registry.js.map +1 -1
- package/dist/core/orchestration/task-profile-writer.d.ts +7 -4
- package/dist/core/orchestration/task-profile-writer.d.ts.map +1 -1
- package/dist/core/orchestration/task-profile-writer.js +71 -59
- package/dist/core/orchestration/task-profile-writer.js.map +1 -1
- package/dist/core/orchestration/thinking-level-schema.d.ts +7 -0
- package/dist/core/orchestration/thinking-level-schema.d.ts.map +1 -0
- package/dist/core/orchestration/thinking-level-schema.js +19 -0
- package/dist/core/orchestration/thinking-level-schema.js.map +1 -0
- package/dist/core/orchestration/worker-execution-contract.d.ts.map +1 -1
- package/dist/core/orchestration/worker-execution-contract.js +12 -5
- package/dist/core/orchestration/worker-execution-contract.js.map +1 -1
- package/dist/core/provider-prompt-contracts.d.ts +1 -4
- package/dist/core/provider-prompt-contracts.d.ts.map +1 -1
- package/dist/core/provider-prompt-contracts.js +13 -29
- package/dist/core/provider-prompt-contracts.js.map +1 -1
- package/dist/core/provider-request-context-controller.d.ts +2 -0
- package/dist/core/provider-request-context-controller.d.ts.map +1 -1
- package/dist/core/provider-request-context-controller.js +10 -3
- package/dist/core/provider-request-context-controller.js.map +1 -1
- package/dist/core/reflection-controller.d.ts +63 -27
- package/dist/core/reflection-controller.d.ts.map +1 -1
- package/dist/core/reflection-controller.js +300 -132
- package/dist/core/reflection-controller.js.map +1 -1
- package/dist/core/runtime-builder.d.ts +1 -0
- package/dist/core/runtime-builder.d.ts.map +1 -1
- package/dist/core/runtime-builder.js +25 -14
- package/dist/core/runtime-builder.js.map +1 -1
- package/dist/core/secrets/credential-exposure-guard.d.ts.map +1 -1
- package/dist/core/secrets/credential-exposure-guard.js +55 -10
- package/dist/core/secrets/credential-exposure-guard.js.map +1 -1
- package/dist/core/session-role.d.ts +6 -8
- package/dist/core/session-role.d.ts.map +1 -1
- package/dist/core/session-role.js +8 -18
- package/dist/core/session-role.js.map +1 -1
- package/dist/core/settings-manager.d.ts +13 -16
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +53 -50
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/skill-vault.d.ts +15 -0
- package/dist/core/skill-vault.d.ts.map +1 -1
- package/dist/core/skill-vault.js +79 -45
- package/dist/core/skill-vault.js.map +1 -1
- package/dist/core/skills.d.ts +3 -0
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js +6 -6
- package/dist/core/skills.js.map +1 -1
- package/dist/core/system-prompt-builder.d.ts +2 -0
- package/dist/core/system-prompt-builder.d.ts.map +1 -1
- package/dist/core/system-prompt-builder.js +52 -12
- package/dist/core/system-prompt-builder.js.map +1 -1
- package/dist/core/system-prompt.js +1 -1
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tool-capability-policy.d.ts +3 -0
- package/dist/core/tool-capability-policy.d.ts.map +1 -1
- package/dist/core/tool-capability-policy.js +13 -2
- package/dist/core/tool-capability-policy.js.map +1 -1
- package/dist/core/toolkit/script-runner.d.ts +2 -1
- package/dist/core/toolkit/script-runner.d.ts.map +1 -1
- package/dist/core/toolkit/script-runner.js +10 -2
- package/dist/core/toolkit/script-runner.js.map +1 -1
- package/dist/core/tools/delegate-status.d.ts +3 -1
- package/dist/core/tools/delegate-status.d.ts.map +1 -1
- package/dist/core/tools/delegate-status.js +5 -1
- package/dist/core/tools/delegate-status.js.map +1 -1
- package/dist/core/tools/delegate.d.ts +4 -13
- package/dist/core/tools/delegate.d.ts.map +1 -1
- package/dist/core/tools/delegate.js +173 -73
- package/dist/core/tools/delegate.js.map +1 -1
- package/dist/core/tools/goal.d.ts +3 -4
- package/dist/core/tools/goal.d.ts.map +1 -1
- package/dist/core/tools/goal.js +24 -7
- package/dist/core/tools/goal.js.map +1 -1
- package/dist/core/tools/profile-writer.d.ts +2 -8
- package/dist/core/tools/profile-writer.d.ts.map +1 -1
- package/dist/core/tools/profile-writer.js +6 -18
- package/dist/core/tools/profile-writer.js.map +1 -1
- package/dist/core/tools/run-toolkit-script.d.ts +1 -1
- package/dist/core/tools/run-toolkit-script.d.ts.map +1 -1
- package/dist/core/tools/run-toolkit-script.js +2 -2
- package/dist/core/tools/run-toolkit-script.js.map +1 -1
- package/dist/core/tools/skill-audit.d.ts +28 -1
- package/dist/core/tools/skill-audit.d.ts.map +1 -1
- package/dist/core/tools/skill-audit.js +56 -12
- package/dist/core/tools/skill-audit.js.map +1 -1
- package/dist/core/tools/skill.d.ts +12 -1
- package/dist/core/tools/skill.d.ts.map +1 -1
- package/dist/core/tools/skill.js +52 -0
- package/dist/core/tools/skill.js.map +1 -1
- package/dist/core/tools/skillify.d.ts.map +1 -1
- package/dist/core/tools/skillify.js +16 -7
- package/dist/core/tools/skillify.js.map +1 -1
- package/dist/core/tools/task-steps.js +1 -1
- package/dist/core/tools/task-steps.js.map +1 -1
- package/dist/core/tools/tmux-dispatch.d.ts +4 -16
- package/dist/core/tools/tmux-dispatch.d.ts.map +1 -1
- package/dist/core/tools/tmux-dispatch.js +5 -20
- package/dist/core/tools/tmux-dispatch.js.map +1 -1
- package/dist/core/tools/tool-task.d.ts +1 -0
- package/dist/core/tools/tool-task.d.ts.map +1 -1
- package/dist/core/tools/tool-task.js +13 -8
- package/dist/core/tools/tool-task.js.map +1 -1
- package/dist/core/util/atomic-file.d.ts +2 -0
- package/dist/core/util/atomic-file.d.ts.map +1 -1
- package/dist/core/util/atomic-file.js +4 -0
- package/dist/core/util/atomic-file.js.map +1 -1
- package/dist/core/worktree-sync/codes.d.ts +1 -2
- package/dist/core/worktree-sync/codes.d.ts.map +1 -1
- package/dist/core/worktree-sync/codes.js +1 -2
- package/dist/core/worktree-sync/codes.js.map +1 -1
- package/dist/core/worktree-sync/lane-gate.d.ts +4 -8
- package/dist/core/worktree-sync/lane-gate.d.ts.map +1 -1
- package/dist/core/worktree-sync/lane-gate.js +5 -51
- package/dist/core/worktree-sync/lane-gate.js.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/modes/interactive/auto-learn-controller.d.ts +6 -7
- package/dist/modes/interactive/auto-learn-controller.d.ts.map +1 -1
- package/dist/modes/interactive/auto-learn-controller.js +32 -207
- package/dist/modes/interactive/auto-learn-controller.js.map +1 -1
- package/dist/modes/interactive/autonomy-commands.js +2 -2
- package/dist/modes/interactive/autonomy-commands.js.map +1 -1
- package/dist/modes/interactive/components/activity-lane.d.ts.map +1 -1
- package/dist/modes/interactive/components/activity-lane.js +12 -23
- package/dist/modes/interactive/components/activity-lane.js.map +1 -1
- package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-message.js +142 -1
- package/dist/modes/interactive/components/custom-message.js.map +1 -1
- package/dist/modes/interactive/components/fitness-role-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/fitness-role-selector.js +2 -2
- package/dist/modes/interactive/components/fitness-role-selector.js.map +1 -1
- package/dist/modes/interactive/components/footer.js +1 -1
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +4 -0
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +150 -73
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/report-commands.d.ts.map +1 -1
- package/dist/modes/interactive/report-commands.js +8 -4
- package/dist/modes/interactive/report-commands.js.map +1 -1
- package/dist/modes/interactive/settings-selector-flow.d.ts.map +1 -1
- package/dist/modes/interactive/settings-selector-flow.js +10 -0
- package/dist/modes/interactive/settings-selector-flow.js.map +1 -1
- package/docs/extensions.md +8 -0
- package/docs/harness-architecture.md +28 -32
- package/docs/index.md +1 -1
- package/docs/process-matrix.md +8 -6
- package/docs/resources.md +1 -1
- package/docs/settings.md +61 -51
- package/docs/tmux-agent-manager.md +47 -40
- package/docs/usage.md +1 -1
- package/docs/worker-profiles.md +8 -6
- package/docs/worktree-sync.md +26 -20
- 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/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/npm-shrinkwrap.json +12 -12
- package/package.json +4 -4
- package/dist/bundled-resources/extensions/tmux-agent-manager/dispatch-grant.d.ts +0 -133
- package/dist/bundled-resources/extensions/tmux-agent-manager/dispatch-grant.d.ts.map +0 -1
- package/dist/bundled-resources/extensions/tmux-agent-manager/dispatch-grant.js +0 -199
- package/dist/bundled-resources/extensions/tmux-agent-manager/dispatch-grant.js.map +0 -1
- package/dist/bundled-resources/extensions/tmux-agent-manager/dispatch-grant.ts +0 -312
package/dist/index.js
CHANGED
|
@@ -8,6 +8,10 @@ export { getAgentDir, VERSION } from "./config.js";
|
|
|
8
8
|
export { AgentSession, parseSkillBlock, } from "./core/agent-session.js";
|
|
9
9
|
// Auth and model registry
|
|
10
10
|
export { AuthStorage, FileAuthStorageBackend, InMemoryAuthStorageBackend, } from "./core/auth-storage.js";
|
|
11
|
+
// Copied bundled extensions resolve runtime dependencies through this public module. Bun embeds
|
|
12
|
+
// this surface; relative imports back into dist/core do not exist beside a compiled executable.
|
|
13
|
+
export { encodeWorkerSessionAllowedPaths, PI_WORKER_ALLOWED_PATHS_ENV, } from "./core/autonomy/worker-session-private-scope.js";
|
|
14
|
+
export { mapToolNamesForPlatform } from "./core/default-tool-surface.js";
|
|
11
15
|
export { createEventBus } from "./core/event-bus.js";
|
|
12
16
|
export { defineTool, ExtensionRunner, isBashToolResult, isEditToolResult, isFindToolResult, isGrepToolResult, isLsToolResult, isReadToolResult, isToolCallEventType, isWriteToolResult, wrapRegisteredTool, wrapRegisteredTools, } from "./core/extensions/index.js";
|
|
13
17
|
export { createExtensionRuntime, discoverAndLoadExtensions } from "./core/extensions/loader.js";
|
|
@@ -21,6 +25,7 @@ export * from "./core/orchestration/policy-compiler.js";
|
|
|
21
25
|
export * from "./core/orchestration/profile-registry.js";
|
|
22
26
|
export * from "./core/orchestration/profile-store.js";
|
|
23
27
|
export * from "./core/orchestration/task-runtime.js";
|
|
28
|
+
export { orchestrationThinkingLevelSchema } from "./core/orchestration/thinking-level-schema.js";
|
|
24
29
|
export { DefaultPackageManager } from "./core/package-manager.js";
|
|
25
30
|
export { PI_ORCHESTRATION_AGENT_ID_ENV } from "./core/process-identity.js";
|
|
26
31
|
export { ACTIVE_TURN_TTL_MS, AUTO_RELOAD_COORDINATOR_TTL_MS, describeReloadSession, getPendingReloadBlockers, getReloadCoordinationDir, isReloadSessionProcessAlive, } from "./core/reload-blockers.js";
|
|
@@ -38,11 +43,13 @@ export { BitwardenSecretsManagerCredentialStorage, BitwardenSecretsManagerStorag
|
|
|
38
43
|
export { CredentialManager, CredentialManagerError, CredentialStorageError, } from "./core/secrets/credential-manager.js";
|
|
39
44
|
export { CredentialMigrationSourceError, resolveCredentialMigrationSources, } from "./core/secrets/credential-migration-source.js";
|
|
40
45
|
export { createPortableGitProjectKey, resolveCredentialProject } from "./core/secrets/credential-project.js";
|
|
46
|
+
export { WORKER_FORBIDDEN_TOOLS } from "./core/session-role.js";
|
|
41
47
|
export { getDirectoryResourceProfileInfo, matchesResourceProfilePattern, SettingsManager, } from "./core/settings-manager.js";
|
|
42
48
|
export { DEFAULT_SKILL_IDLE_TIMEOUT_MS, MAX_ACTIVE_SKILL_BODY_BYTES, MAX_LOADED_SKILLS, MAX_PINNED_SKILLS, MIN_ACTIVE_SKILL_BODY_BYTES, resolveActiveSkillBodyByteLimit, SkillVaultController, } from "./core/skill-vault.js";
|
|
43
49
|
// Skills
|
|
44
50
|
export { loadSkills, loadSkillsFromDir, MAX_SKILL_FRONTMATTER_BYTES, readSkillFrontmatterFile, } from "./core/skills.js";
|
|
45
51
|
export { createSyntheticSourceInfo } from "./core/source-info.js";
|
|
52
|
+
export { POLICY_OWNED_RUNTIME_TOOL_NAMES } from "./core/tool-capability-policy.js";
|
|
46
53
|
export { AskQuestionDialog, createAskQuestionToolDefinition, } from "./core/tools/ask-question.js";
|
|
47
54
|
// Tools
|
|
48
55
|
export { createBashToolDefinition, createEditToolDefinition, createFileFailureRecoveryAuthority, createFindToolDefinition, createGrepToolDefinition, createLocalBashOperations, createLsToolDefinition, createReadToolDefinition, createSecretStoreToolDefinition, createWriteToolDefinition, DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, FileMutationIntentController, FileMutationPreflightError, formatMiddleOmissionMarker, formatSize, truncateHead, truncateKnownHeadTail, truncateLine, truncateMiddle, truncateTail, withFileMutationQueue, } from "./core/tools/index.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,0BAA0B;AAE1B,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,aAAa;AACb,OAAO,EAIN,mBAAmB,EAInB,uBAAuB,EAIvB,sBAAsB,EACtB,8BAA8B,EAC9B,OAAO,EACP,2BAA2B,EAC3B,cAAc,EAGd,YAAY,EACZ,kBAAkB,EAElB,qBAAqB,EACrB,eAAe,EACf,qBAAqB,EACrB,wBAAwB,EAExB,qBAAqB,EAErB,mBAAmB,EACnB,oBAAoB,EAOpB,cAAc,EAEd,qBAAqB,EACrB,aAAa,GAEb,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAa,SAAS,EAAE,MAAM,eAAe,CAAC;AACrD,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EACN,YAAY,EAOZ,eAAe,GAEf,MAAM,yBAAyB,CAAC;AACjC,0BAA0B;AAC1B,OAAO,EAIN,WAAW,EAEX,sBAAsB,EACtB,0BAA0B,GAE1B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,cAAc,EAA0C,MAAM,qBAAqB,CAAC;AA2F7F,OAAO,EACN,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB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A4B,GAE5B,MAAM,yCAAyC,CAAC;AACjD,kDAAkD;AAClD,OAAO,EACN,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,aAAa,EACb,SAAS,EACT,KAAK,GAEL,MAAM,oCAAoC,CAAC;AAC5C,sBAAsB;AACtB,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAqB,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC9F,kBAAkB;AAClB,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAEN,cAAc,EACd,yBAAyB,EACzB,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,GAGf,MAAM,2BAA2B,CAAC","sourcesContent":["// Core session management\n\nexport { convertToLlm } from \"@caupulican/pi-agent-core\";\n// Compaction\nexport {\n\ttype BranchPreparation,\n\ttype BranchSummaryEntry,\n\ttype BranchSummaryResult,\n\tbuildSessionContext,\n\ttype CollectEntriesResult,\n\ttype CompactionEntry,\n\ttype CompactionResult,\n\tCURRENT_SESSION_VERSION,\n\ttype CustomEntry,\n\ttype CustomMessageEntry,\n\ttype CutPointResult,\n\tcalculateContextTokens,\n\tcollectEntriesForBranchSummary,\n\tcompact,\n\tDEFAULT_COMPACTION_SETTINGS,\n\testimateTokens,\n\ttype FileEntry,\n\ttype FileOperations,\n\tfindCutPoint,\n\tfindTurnStartIndex,\n\ttype GenerateBranchSummaryOptions,\n\tgenerateBranchSummary,\n\tgenerateSummary,\n\tgetLastAssistantUsage,\n\tgetLatestCompactionEntry,\n\ttype ModelChangeEntry,\n\tmigrateSessionEntries,\n\ttype NewSessionOptions,\n\tparseSessionEntries,\n\tprepareBranchEntries,\n\ttype SessionContext,\n\ttype SessionEntry,\n\ttype SessionEntryBase,\n\ttype SessionHeader,\n\ttype SessionInfo,\n\ttype SessionInfoEntry,\n\tSessionManager,\n\ttype SessionMessageEntry,\n\tserializeConversation,\n\tshouldCompact,\n\ttype ThinkingLevelChangeEntry,\n} from \"@caupulican/pi-agent-core/node\";\nexport { type Args, parseArgs } from \"./cli/args.ts\";\n// Config paths\nexport { getAgentDir, VERSION } from \"./config.ts\";\nexport {\n\tAgentSession,\n\ttype AgentSessionConfig,\n\ttype AgentSessionEvent,\n\ttype AgentSessionEventListener,\n\ttype ModelCycleResult,\n\ttype ParsedSkillBlock,\n\ttype PromptOptions,\n\tparseSkillBlock,\n\ttype SessionStats,\n} from \"./core/agent-session.ts\";\n// Auth and model registry\nexport {\n\ttype ApiKeyCredential,\n\ttype AuthCredential,\n\ttype AuthStatus,\n\tAuthStorage,\n\ttype AuthStorageBackend,\n\tFileAuthStorageBackend,\n\tInMemoryAuthStorageBackend,\n\ttype OAuthCredential,\n} from \"./core/auth-storage.ts\";\nexport { createEventBus, type EventBus, type EventBusController } from \"./core/event-bus.ts\";\n// Extension system\nexport type {\n\tAgentEndEvent,\n\tAgentStartEvent,\n\tAgentToolResult,\n\tAgentToolUpdateCallback,\n\tAppKeybinding,\n\tAutocompleteProviderFactory,\n\tBashToolCallEvent,\n\tBeforeAgentStartEvent,\n\tBeforeAgentStartEventResult,\n\tBeforeProviderRequestEvent,\n\tBeforeProviderRequestEventResult,\n\tBuildSystemPromptOptions,\n\tCompactOptions,\n\tContextEvent,\n\tContextEventResult,\n\tContextUsage,\n\tCustomToolCallEvent,\n\tEditToolCallEvent,\n\tExecOptions,\n\tExecResult,\n\tExtension,\n\tExtensionActions,\n\tExtensionAPI,\n\tExtensionCommandContext,\n\tExtensionCommandContextActions,\n\tExtensionContext,\n\tExtensionContextActions,\n\tExtensionError,\n\tExtensionEvent,\n\tExtensionFactory,\n\tExtensionFlag,\n\tExtensionHandler,\n\tExtensionRuntime,\n\tExtensionShortcut,\n\tExtensionStorage,\n\tExtensionUIContext,\n\tExtensionUIDialogOptions,\n\tExtensionWidgetOptions,\n\tExtensionWorkRunOptions,\n\tFindToolCallEvent,\n\tGrepToolCallEvent,\n\tInputEvent,\n\tInputEventResult,\n\tInputSource,\n\tKeybindingsManager,\n\tLoadExtensionsResult,\n\tLsToolCallEvent,\n\tMessageEndEvent,\n\tMessageRenderer,\n\tMessageRenderOptions,\n\tMessageStartEvent,\n\tMessageUpdateEvent,\n\tProviderConfig,\n\tProviderModelConfig,\n\tReadToolCallEvent,\n\tRegisteredCommand,\n\tRegisteredTool,\n\tResolvedCommand,\n\tSessionBeforeCompactEvent,\n\tSessionBeforeForkEvent,\n\tSessionBeforeSwitchEvent,\n\tSessionBeforeTreeEvent,\n\tSessionCompactEvent,\n\tSessionShutdownEvent,\n\tSessionStartEvent,\n\tSessionTreeEvent,\n\tSlashCommandInfo,\n\tSlashCommandSource,\n\tSourceInfo,\n\tTerminalInputHandler,\n\tToolCallEvent,\n\tToolCallEventResult,\n\tToolDefinition,\n\tToolExecutionEndEvent,\n\tToolExecutionMode,\n\tToolExecutionStartEvent,\n\tToolExecutionUpdateEvent,\n\tToolInfo,\n\tToolRenderResultOptions,\n\tToolResultEvent,\n\tTurnEndEvent,\n\tTurnStartEvent,\n\tUserBashEvent,\n\tUserBashEventResult,\n\tWidgetPlacement,\n\tWorkingIndicatorOptions,\n\tWriteToolCallEvent,\n} from \"./core/extensions/index.ts\";\nexport {\n\tdefineTool,\n\tExtensionRunner,\n\tisBashToolResult,\n\tisEditToolResult,\n\tisFindToolResult,\n\tisGrepToolResult,\n\tisLsToolResult,\n\tisReadToolResult,\n\tisToolCallEventType,\n\tisWriteToolResult,\n\twrapRegisteredTool,\n\twrapRegisteredTools,\n} from \"./core/extensions/index.ts\";\nexport { createExtensionRuntime, discoverAndLoadExtensions } from \"./core/extensions/loader.ts\";\n// Footer data provider (git branch + extension statuses - data not otherwise available to extensions)\nexport type { ReadonlyFooterDataProvider } from \"./core/footer-data-provider.ts\";\nexport {\n\tappendRunRecord,\n\ttype ConfidenceMode,\n\ttype ConfidenceResult,\n\tcleanupImprovementSandbox,\n\tcompareMetric,\n\tcomputeMadConfidence,\n\tcreateImprovementDecisionTool,\n\tcreateImprovementLoopTool,\n\tcreateImprovementSandbox,\n\tdecideImprovement,\n\texportImprovementSandboxPatch,\n\ttype GitStatusEntry,\n\ttype ImprovementDecision,\n\ttype ImprovementDecisionInput,\n\ttype ImprovementDecisionReason,\n\ttype ImprovementDecisionResult,\n\ttype ImprovementLoopConfig,\n\ttype ImprovementLoopExec,\n\ttype ImprovementLoopInitInput,\n\ttype ImprovementLoopPaths,\n\ttype ImprovementLoopRecordInput,\n\ttype ImprovementLoopState,\n\ttype ImprovementLoopStatusInput,\n\ttype ImprovementLoopToolAction,\n\ttype ImprovementLoopToolDetails,\n\ttype ImprovementMeasurementCommandResult,\n\ttype ImprovementMeasurementResult,\n\ttype ImprovementRunRecord,\n\ttype ImprovementSandboxCleanupInput,\n\ttype ImprovementSandboxCreateInput,\n\ttype ImprovementSandboxExportInput,\n\ttype ImprovementSandboxRecord,\n\timprovementLoopPaths,\n\tinitImprovementLoop,\n\ttype LowConfidenceAction,\n\ttype MetricComparison,\n\ttype MetricDirection,\n\tmedian,\n\tmedianAbsoluteDeviation,\n\tmetricMapFromOutput,\n\ttype OwnedDiscardPlan,\n\ttype OwnedDiscardPlanInput,\n\tparseGitPorcelainStatus,\n\tparseMetricLines,\n\tplanOwnedDiscard,\n\treadImprovementLoopState,\n\treadRunRecords,\n\trecordImprovementRun,\n\trunImprovementMeasurement,\n\tselectPrimaryMetric,\n\tserializeRunRecord,\n} from \"./core/improvement-loop.ts\";\nexport { ModelRegistry } from \"./core/model-registry.ts\";\nexport * from \"./core/orchestration/capability-gateway.ts\";\nexport * from \"./core/orchestration/contracts.ts\";\nexport * from \"./core/orchestration/event-store.ts\";\nexport * from \"./core/orchestration/model-binding.ts\";\nexport * from \"./core/orchestration/policy-compiler.ts\";\nexport * from \"./core/orchestration/profile-registry.ts\";\nexport * from \"./core/orchestration/profile-store.ts\";\nexport * from \"./core/orchestration/task-runtime.ts\";\nexport type {\n\tPackageManager,\n\tPathMetadata,\n\tProgressCallback,\n\tProgressEvent,\n\tResolvedPaths,\n\tResolvedResource,\n} from \"./core/package-manager.ts\";\nexport { DefaultPackageManager } from \"./core/package-manager.ts\";\nexport { PI_ORCHESTRATION_AGENT_ID_ENV } from \"./core/process-identity.ts\";\nexport {\n\tACTIVE_TURN_TTL_MS,\n\tAUTO_RELOAD_COORDINATOR_TTL_MS,\n\tdescribeReloadSession,\n\tgetPendingReloadBlockers,\n\tgetReloadCoordinationDir,\n\tisReloadSessionProcessAlive,\n\ttype PendingReloadBlockers,\n\ttype ReloadBlockerOptions,\n\ttype ReloadSessionRecord,\n} from \"./core/reload-blockers.ts\";\nexport type { ResourceCollision, ResourceDiagnostic, ResourceLoader } from \"./core/resource-loader.ts\";\nexport { DefaultResourceLoader, loadProjectContextFiles } from \"./core/resource-loader.ts\";\nexport {\n\tmergeResourceProfileMap,\n\tmergeResourceProfileSettings,\n\tparseResourceProfileBlocks,\n\tparseResourceProfileInput,\n\tparseResourceProfileJson,\n\tstripResourceProfileBlocks,\n} from \"./core/resource-profile-blocks.ts\";\n// SDK for programmatic usage\nexport {\n\tAgentSessionRuntime,\n\ttype AgentSessionRuntimeDiagnostic,\n\ttype AgentSessionRuntimeResource,\n\ttype AgentSessionServices,\n\ttype AgentSessionSwitchOptions,\n\ttype CreateAgentSessionFromServicesOptions,\n\ttype CreateAgentSessionOptions,\n\ttype CreateAgentSessionResult,\n\ttype CreateAgentSessionRuntimeFactory,\n\ttype CreateAgentSessionRuntimeResult,\n\ttype CreateAgentSessionServicesOptions,\n\t// Factory\n\tcreateAgentSession,\n\tcreateAgentSessionFromServices,\n\tcreateAgentSessionRuntime,\n\tcreateAgentSessionServices,\n\tcreateBashTool,\n\t// Tool factories (for custom cwd)\n\tcreateCodingTools,\n\tcreateEditTool,\n\tcreateFindTool,\n\tcreateGrepTool,\n\tcreateLsTool,\n\tcreateReadOnlyTools,\n\tcreateReadTool,\n\tcreateWriteTool,\n\ttype PromptTemplate,\n\tSessionReplacementCallbackError,\n\tSessionReplacementRuntimeError,\n} from \"./core/sdk.ts\";\nexport {\n\tBitwardenCredentialStorage,\n\tBitwardenCredentialStorageError,\n\ttype BitwardenCredentialStorageErrorCode,\n\ttype BitwardenCredentialStorageOptions,\n} from \"./core/secrets/bitwarden-credential-storage.ts\";\nexport {\n\tBitwardenCredentialStorageRouter,\n\ttype BitwardenCredentialStorageRouterOptions,\n} from \"./core/secrets/bitwarden-credential-storage-router.ts\";\nexport {\n\ttype BitwardenSecretsManagerCommandRequest,\n\ttype BitwardenSecretsManagerCommandResult,\n\tBitwardenSecretsManagerCredentialStorage,\n\ttype BitwardenSecretsManagerCredentialStorageOptions,\n\tBitwardenSecretsManagerStorageError,\n} from \"./core/secrets/bitwarden-secrets-manager-storage.ts\";\nexport {\n\ttype CredentialActivationResult,\n\ttype CredentialConnectionStatus,\n\tCredentialManager,\n\tCredentialManagerError,\n\ttype CredentialManagerErrorCode,\n\ttype CredentialManagerOptions,\n\ttype CredentialMutationResult,\n\ttype CredentialProfileRecord,\n\ttype CredentialProfileStorage,\n\ttype CredentialProfileSummary,\n\ttype CredentialProjectIdentity,\n\ttype CredentialProjectResolver,\n\tCredentialStorageError,\n\ttype CredentialStorageErrorCode,\n\ttype CredentialStorageProvider,\n\ttype CredentialVariable,\n\ttype MachineCredentialSession,\n\ttype MachineCredentialSessionResolver,\n\ttype StoredCredentialProfileSummary,\n} from \"./core/secrets/credential-manager.ts\";\nexport {\n\ttype CredentialMigrationSource,\n\tCredentialMigrationSourceError,\n\ttype CredentialMigrationSourceErrorCode,\n\ttype CredentialMigrationSourceResolver,\n\tresolveCredentialMigrationSources,\n} from \"./core/secrets/credential-migration-source.ts\";\nexport { createPortableGitProjectKey, resolveCredentialProject } from \"./core/secrets/credential-project.ts\";\nexport {\n\ttype CompactionSettings,\n\ttype DirectoryResourceProfileInfo,\n\tgetDirectoryResourceProfileInfo,\n\ttype ImageSettings,\n\tmatchesResourceProfilePattern,\n\ttype PackageSource,\n\ttype ResourceProfileFilterSettings,\n\ttype ResourceProfileKind,\n\ttype ResourceProfileSettings,\n\ttype RetrySettings,\n\tSettingsManager,\n\ttype SettingsManagerCreateOptions,\n} from \"./core/settings-manager.ts\";\nexport {\n\tDEFAULT_SKILL_IDLE_TIMEOUT_MS,\n\tMAX_ACTIVE_SKILL_BODY_BYTES,\n\tMAX_LOADED_SKILLS,\n\tMAX_PINNED_SKILLS,\n\tMIN_ACTIVE_SKILL_BODY_BYTES,\n\tresolveActiveSkillBodyByteLimit,\n\ttype SkillLoadResult,\n\ttype SkillSearchResult,\n\ttype SkillSlotStatus,\n\tSkillVaultController,\n\ttype SkillVaultControllerOptions,\n\ttype SkillVaultStatus,\n} from \"./core/skill-vault.ts\";\n// Skills\nexport {\n\ttype LoadSkillsFromDirOptions,\n\ttype LoadSkillsResult,\n\tloadSkills,\n\tloadSkillsFromDir,\n\tMAX_SKILL_FRONTMATTER_BYTES,\n\treadSkillFrontmatterFile,\n\ttype Skill,\n\ttype SkillFrontmatter,\n} from \"./core/skills.ts\";\nexport { createSyntheticSourceInfo } from \"./core/source-info.ts\";\nexport {\n\ttype AskQuestion,\n\ttype AskQuestionAnswer,\n\tAskQuestionDialog,\n\ttype AskQuestionStopReason,\n\ttype AskQuestionToolDetails,\n\ttype AskQuestionToolInput,\n\ttype AskQuestionToolOptions,\n\tcreateAskQuestionToolDefinition,\n} from \"./core/tools/ask-question.ts\";\n// Tools\nexport {\n\ttype BashOperations,\n\ttype BashSpawnContext,\n\ttype BashSpawnHook,\n\ttype BashToolDetails,\n\ttype BashToolInput,\n\ttype BashToolOptions,\n\tcreateBashToolDefinition,\n\tcreateEditToolDefinition,\n\tcreateFileFailureRecoveryAuthority,\n\tcreateFindToolDefinition,\n\tcreateGrepToolDefinition,\n\tcreateLocalBashOperations,\n\tcreateLsToolDefinition,\n\tcreateReadToolDefinition,\n\tcreateSecretStoreToolDefinition,\n\tcreateWriteToolDefinition,\n\tDEFAULT_MAX_BYTES,\n\tDEFAULT_MAX_LINES,\n\ttype EditOperations,\n\ttype EditToolDetails,\n\ttype EditToolInput,\n\ttype EditToolOptions,\n\ttype FileContentReference,\n\ttype FileFailureRecoveryAuthority,\n\tFileMutationIntentController,\n\ttype FileMutationIntentControllerOptions,\n\ttype FileMutationIntentOperations,\n\ttype FileMutationKind,\n\ttype FileMutationLease,\n\ttype FileMutationPayloadReference,\n\tFileMutationPreflightError,\n\ttype FileMutationPreflightFailureReason,\n\ttype FilePathIdentity,\n\ttype FilePathInspection,\n\ttype FindOperations,\n\ttype FindToolDetails,\n\ttype FindToolInput,\n\ttype FindToolOptions,\n\tformatMiddleOmissionMarker,\n\tformatSize,\n\ttype GrepOperations,\n\ttype GrepToolDetails,\n\ttype GrepToolInput,\n\ttype GrepToolOptions,\n\ttype LsOperations,\n\ttype LsToolDetails,\n\ttype LsToolInput,\n\ttype LsToolOptions,\n\ttype ReadOperations,\n\ttype ReadToolDetails,\n\ttype ReadToolInput,\n\ttype ReadToolOptions,\n\ttype SecretStoreStatus,\n\ttype SecretStoreToolDetails,\n\ttype SecretStoreToolInput,\n\ttype SecretStoreToolOptions,\n\ttype ToolsOptions,\n\ttype TruncationOptions,\n\ttype TruncationResult,\n\ttruncateHead,\n\ttruncateKnownHeadTail,\n\ttruncateLine,\n\ttruncateMiddle,\n\ttruncateTail,\n\ttype WriteOperations,\n\ttype WriteToolDetails,\n\ttype WriteToolInput,\n\ttype WriteToolOptions,\n\twithFileMutationQueue,\n} from \"./core/tools/index.ts\";\nexport {\n\tcreateSkillVaultToolDefinition,\n\ttype SkillToolDetails,\n\ttype SkillToolInput,\n} from \"./core/tools/skill.ts\";\n// Skill-audit primitives — exported so extensions (e.g. continuous-learning) can reuse the native\n// Jaccard overlap audit via `import { runSkillAudit } from \"@caupulican/pi-adaptative\"` instead of\n// carrying a duplicate copy.\nexport {\n\tjaccard,\n\trunSkillAudit,\n\ttype SkillAuditReport,\n\ttype SkillSummary,\n\ttokenize,\n} from \"./core/tools/skill-audit.ts\";\nexport { hasProjectTrustInputs, type ProjectTrustDecision, ProjectTrustStore } from \"./core/trust-manager.ts\";\n// Main entry point\nexport { type MainOptions, main } from \"./main.ts\";\n// Run modes for programmatic SDK usage\nexport {\n\tInteractiveMode,\n\ttype InteractiveModeOptions,\n\ttype ModelInfo,\n\ttype PrintModeOptions,\n\tRpcClient,\n\ttype RpcClientOptions,\n\ttype RpcCommand,\n\ttype RpcEventListener,\n\ttype RpcResponse,\n\ttype RpcSessionState,\n\trunPrintMode,\n\trunRpcMode,\n} from \"./modes/index.ts\";\n// UI components for extensions\nexport {\n\tArminComponent,\n\tAssistantMessageComponent,\n\tBashExecutionComponent,\n\tBorderedLoader,\n\tBranchSummaryMessageComponent,\n\tCompactionSummaryMessageComponent,\n\tCustomEditor,\n\tCustomMessageComponent,\n\tDynamicBorder,\n\tExtensionEditorComponent,\n\tExtensionInputComponent,\n\tExtensionSelectorComponent,\n\tFooterComponent,\n\tkeyHint,\n\tkeyText,\n\tLoginDialogComponent,\n\tModelSelectorComponent,\n\tOAuthSelectorComponent,\n\ttype RenderDiffOptions,\n\trawKeyHint,\n\trenderDiff,\n\trenderTitleBadge,\n\trenderToolTitle,\n\tSessionSelectorComponent,\n\ttype SettingsCallbacks,\n\ttype SettingsConfig,\n\tSettingsSelectorComponent,\n\tShowImagesSelectorComponent,\n\tSkillInvocationMessageComponent,\n\tThemeSelectorComponent,\n\tThinkingSelectorComponent,\n\tTitleBadgeComponent,\n\ttype TitleBadgeOptions,\n\ttype TitleBadgeSegment,\n\ttype TitleBadgeStatus,\n\tToolExecutionComponent,\n\ttype ToolExecutionOptions,\n\tToolTitleComponent,\n\ttype ToolTitleOptions,\n\ttype ToolTitleSegment,\n\ttype ToolTitleStatus,\n\tTreeSelectorComponent,\n\ttitleBadge,\n\ttoolTitle,\n\ttruncateToVisualLines,\n\tUserMessageComponent,\n\tUserMessageSelectorComponent,\n\ttype VisualTruncateResult,\n} from \"./modes/interactive/components/index.ts\";\n// Theme utilities for custom tools and extensions\nexport {\n\tgetLanguageFromPath,\n\tgetMarkdownTheme,\n\tgetSelectListTheme,\n\tgetSettingsListTheme,\n\thighlightCode,\n\tinitTheme,\n\tTheme,\n\ttype ThemeColor,\n} from \"./modes/interactive/theme/theme.ts\";\n// Clipboard utilities\nexport { copyToClipboard } from \"./utils/clipboard.ts\";\nexport { parseFrontmatter, stripFrontmatter } from \"./utils/frontmatter.ts\";\nexport { convertToPng } from \"./utils/image-convert.ts\";\nexport { formatDimensionNote, type ResizedImage, resizeImage } from \"./utils/image-resize.ts\";\n// Shell utilities\nexport { getShellConfig } from \"./utils/shell.ts\";\nexport {\n\ttype AcquireWorkRunOptions,\n\tacquireWorkRun,\n\tassertPortablePathSegment,\n\tboundedWorkRetention,\n\tcreateWorkRunId,\n\tgetProcessWorkRun,\n\tgetWorkRoot,\n\tgetWorkRunDir,\n\tgetWorkTenantDir,\n\tPI_WORK_ROOT_ENV,\n\tpruneWorkTenant,\n\ttype WorkRetentionOptions,\n\ttype WorkRunLease,\n} from \"./utils/work-directory.ts\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,0BAA0B;AAE1B,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,aAAa;AACb,OAAO,EAIN,mBAAmB,EAInB,uBAAuB,EAIvB,sBAAsB,EACtB,8BAA8B,EAC9B,OAAO,EACP,2BAA2B,EAC3B,cAAc,EAGd,YAAY,EACZ,kBAAkB,EAElB,qBAAqB,EACrB,eAAe,EACf,qBAAqB,EACrB,wBAAwB,EAExB,qBAAqB,EAErB,mBAAmB,EACnB,oBAAoB,EAOpB,cAAc,EAEd,qBAA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AAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAEN,cAAc,EACd,yBAAyB,EACzB,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,GAGf,MAAM,2BAA2B,CAAC","sourcesContent":["// Core session management\n\nexport { convertToLlm } from \"@caupulican/pi-agent-core\";\n// Compaction\nexport {\n\ttype BranchPreparation,\n\ttype BranchSummaryEntry,\n\ttype BranchSummaryResult,\n\tbuildSessionContext,\n\ttype CollectEntriesResult,\n\ttype CompactionEntry,\n\ttype CompactionResult,\n\tCURRENT_SESSION_VERSION,\n\ttype CustomEntry,\n\ttype CustomMessageEntry,\n\ttype CutPointResult,\n\tcalculateContextTokens,\n\tcollectEntriesForBranchSummary,\n\tcompact,\n\tDEFAULT_COMPACTION_SETTINGS,\n\testimateTokens,\n\ttype FileEntry,\n\ttype FileOperations,\n\tfindCutPoint,\n\tfindTurnStartIndex,\n\ttype GenerateBranchSummaryOptions,\n\tgenerateBranchSummary,\n\tgenerateSummary,\n\tgetLastAssistantUsage,\n\tgetLatestCompactionEntry,\n\ttype ModelChangeEntry,\n\tmigrateSessionEntries,\n\ttype NewSessionOptions,\n\tparseSessionEntries,\n\tprepareBranchEntries,\n\ttype SessionContext,\n\ttype SessionEntry,\n\ttype SessionEntryBase,\n\ttype SessionHeader,\n\ttype SessionInfo,\n\ttype SessionInfoEntry,\n\tSessionManager,\n\ttype SessionMessageEntry,\n\tserializeConversation,\n\tshouldCompact,\n\ttype ThinkingLevelChangeEntry,\n} from \"@caupulican/pi-agent-core/node\";\nexport { type Args, parseArgs } from \"./cli/args.ts\";\n// Config paths\nexport { getAgentDir, VERSION } from \"./config.ts\";\nexport {\n\tAgentSession,\n\ttype AgentSessionConfig,\n\ttype AgentSessionEvent,\n\ttype AgentSessionEventListener,\n\ttype ModelCycleResult,\n\ttype ParsedSkillBlock,\n\ttype PromptOptions,\n\tparseSkillBlock,\n\ttype SessionStats,\n} from \"./core/agent-session.ts\";\n// Auth and model registry\nexport {\n\ttype ApiKeyCredential,\n\ttype AuthCredential,\n\ttype AuthStatus,\n\tAuthStorage,\n\ttype AuthStorageBackend,\n\tFileAuthStorageBackend,\n\tInMemoryAuthStorageBackend,\n\ttype OAuthCredential,\n} from \"./core/auth-storage.ts\";\n// Copied bundled extensions resolve runtime dependencies through this public module. Bun embeds\n// this surface; relative imports back into dist/core do not exist beside a compiled executable.\nexport {\n\tencodeWorkerSessionAllowedPaths,\n\tPI_WORKER_ALLOWED_PATHS_ENV,\n} from \"./core/autonomy/worker-session-private-scope.ts\";\nexport { mapToolNamesForPlatform } from \"./core/default-tool-surface.ts\";\nexport { createEventBus, type EventBus, type EventBusController } from \"./core/event-bus.ts\";\n// Extension system\nexport type {\n\tAgentEndEvent,\n\tAgentStartEvent,\n\tAgentToolResult,\n\tAgentToolUpdateCallback,\n\tAppKeybinding,\n\tAutocompleteProviderFactory,\n\tBashToolCallEvent,\n\tBeforeAgentStartEvent,\n\tBeforeAgentStartEventResult,\n\tBeforeProviderRequestEvent,\n\tBeforeProviderRequestEventResult,\n\tBuildSystemPromptOptions,\n\tCompactOptions,\n\tContextEvent,\n\tContextEventResult,\n\tContextUsage,\n\tCustomToolCallEvent,\n\tEditToolCallEvent,\n\tExecOptions,\n\tExecResult,\n\tExtension,\n\tExtensionActions,\n\tExtensionAPI,\n\tExtensionCommandContext,\n\tExtensionCommandContextActions,\n\tExtensionContext,\n\tExtensionContextActions,\n\tExtensionError,\n\tExtensionEvent,\n\tExtensionFactory,\n\tExtensionFlag,\n\tExtensionHandler,\n\tExtensionRuntime,\n\tExtensionShortcut,\n\tExtensionStorage,\n\tExtensionUIContext,\n\tExtensionUIDialogOptions,\n\tExtensionWidgetOptions,\n\tExtensionWorkRunOptions,\n\tFindToolCallEvent,\n\tGrepToolCallEvent,\n\tInputEvent,\n\tInputEventResult,\n\tInputSource,\n\tKeybindingsManager,\n\tLoadExtensionsResult,\n\tLsToolCallEvent,\n\tMessageEndEvent,\n\tMessageRenderer,\n\tMessageRenderOptions,\n\tMessageStartEvent,\n\tMessageUpdateEvent,\n\tProviderConfig,\n\tProviderModelConfig,\n\tReadToolCallEvent,\n\tRegisteredCommand,\n\tRegisteredTool,\n\tResolvedCommand,\n\tSessionBeforeCompactEvent,\n\tSessionBeforeForkEvent,\n\tSessionBeforeSwitchEvent,\n\tSessionBeforeTreeEvent,\n\tSessionCompactEvent,\n\tSessionShutdownEvent,\n\tSessionStartEvent,\n\tSessionTreeEvent,\n\tSlashCommandInfo,\n\tSlashCommandSource,\n\tSourceInfo,\n\tTerminalInputHandler,\n\tToolCallEvent,\n\tToolCallEventResult,\n\tToolDefinition,\n\tToolExecutionEndEvent,\n\tToolExecutionMode,\n\tToolExecutionStartEvent,\n\tToolExecutionUpdateEvent,\n\tToolInfo,\n\tToolRenderResultOptions,\n\tToolResultEvent,\n\tTurnEndEvent,\n\tTurnStartEvent,\n\tUserBashEvent,\n\tUserBashEventResult,\n\tWidgetPlacement,\n\tWorkingIndicatorOptions,\n\tWriteToolCallEvent,\n} from \"./core/extensions/index.ts\";\nexport {\n\tdefineTool,\n\tExtensionRunner,\n\tisBashToolResult,\n\tisEditToolResult,\n\tisFindToolResult,\n\tisGrepToolResult,\n\tisLsToolResult,\n\tisReadToolResult,\n\tisToolCallEventType,\n\tisWriteToolResult,\n\twrapRegisteredTool,\n\twrapRegisteredTools,\n} from \"./core/extensions/index.ts\";\nexport { createExtensionRuntime, discoverAndLoadExtensions } from \"./core/extensions/loader.ts\";\n// Footer data provider (git branch + extension statuses - data not otherwise available to extensions)\nexport type { ReadonlyFooterDataProvider } from \"./core/footer-data-provider.ts\";\nexport {\n\tappendRunRecord,\n\ttype ConfidenceMode,\n\ttype ConfidenceResult,\n\tcleanupImprovementSandbox,\n\tcompareMetric,\n\tcomputeMadConfidence,\n\tcreateImprovementDecisionTool,\n\tcreateImprovementLoopTool,\n\tcreateImprovementSandbox,\n\tdecideImprovement,\n\texportImprovementSandboxPatch,\n\ttype GitStatusEntry,\n\ttype ImprovementDecision,\n\ttype ImprovementDecisionInput,\n\ttype ImprovementDecisionReason,\n\ttype ImprovementDecisionResult,\n\ttype ImprovementLoopConfig,\n\ttype ImprovementLoopExec,\n\ttype ImprovementLoopInitInput,\n\ttype ImprovementLoopPaths,\n\ttype ImprovementLoopRecordInput,\n\ttype ImprovementLoopState,\n\ttype ImprovementLoopStatusInput,\n\ttype ImprovementLoopToolAction,\n\ttype ImprovementLoopToolDetails,\n\ttype ImprovementMeasurementCommandResult,\n\ttype ImprovementMeasurementResult,\n\ttype ImprovementRunRecord,\n\ttype ImprovementSandboxCleanupInput,\n\ttype ImprovementSandboxCreateInput,\n\ttype ImprovementSandboxExportInput,\n\ttype ImprovementSandboxRecord,\n\timprovementLoopPaths,\n\tinitImprovementLoop,\n\ttype LowConfidenceAction,\n\ttype MetricComparison,\n\ttype MetricDirection,\n\tmedian,\n\tmedianAbsoluteDeviation,\n\tmetricMapFromOutput,\n\ttype OwnedDiscardPlan,\n\ttype OwnedDiscardPlanInput,\n\tparseGitPorcelainStatus,\n\tparseMetricLines,\n\tplanOwnedDiscard,\n\treadImprovementLoopState,\n\treadRunRecords,\n\trecordImprovementRun,\n\trunImprovementMeasurement,\n\tselectPrimaryMetric,\n\tserializeRunRecord,\n} from \"./core/improvement-loop.ts\";\nexport { ModelRegistry } from \"./core/model-registry.ts\";\nexport * from \"./core/orchestration/capability-gateway.ts\";\nexport * from \"./core/orchestration/contracts.ts\";\nexport * from \"./core/orchestration/event-store.ts\";\nexport * from \"./core/orchestration/model-binding.ts\";\nexport * from \"./core/orchestration/policy-compiler.ts\";\nexport * from \"./core/orchestration/profile-registry.ts\";\nexport * from \"./core/orchestration/profile-store.ts\";\nexport * from \"./core/orchestration/task-runtime.ts\";\nexport { orchestrationThinkingLevelSchema } from \"./core/orchestration/thinking-level-schema.ts\";\nexport type {\n\tPackageManager,\n\tPathMetadata,\n\tProgressCallback,\n\tProgressEvent,\n\tResolvedPaths,\n\tResolvedResource,\n} from \"./core/package-manager.ts\";\nexport { DefaultPackageManager } from \"./core/package-manager.ts\";\nexport { PI_ORCHESTRATION_AGENT_ID_ENV } from \"./core/process-identity.ts\";\nexport {\n\tACTIVE_TURN_TTL_MS,\n\tAUTO_RELOAD_COORDINATOR_TTL_MS,\n\tdescribeReloadSession,\n\tgetPendingReloadBlockers,\n\tgetReloadCoordinationDir,\n\tisReloadSessionProcessAlive,\n\ttype PendingReloadBlockers,\n\ttype ReloadBlockerOptions,\n\ttype ReloadSessionRecord,\n} from \"./core/reload-blockers.ts\";\nexport type { ResourceCollision, ResourceDiagnostic, ResourceLoader } from \"./core/resource-loader.ts\";\nexport { DefaultResourceLoader, loadProjectContextFiles } from \"./core/resource-loader.ts\";\nexport {\n\tmergeResourceProfileMap,\n\tmergeResourceProfileSettings,\n\tparseResourceProfileBlocks,\n\tparseResourceProfileInput,\n\tparseResourceProfileJson,\n\tstripResourceProfileBlocks,\n} from \"./core/resource-profile-blocks.ts\";\n// SDK for programmatic usage\nexport {\n\tAgentSessionRuntime,\n\ttype AgentSessionRuntimeDiagnostic,\n\ttype AgentSessionRuntimeResource,\n\ttype AgentSessionServices,\n\ttype AgentSessionSwitchOptions,\n\ttype CreateAgentSessionFromServicesOptions,\n\ttype CreateAgentSessionOptions,\n\ttype CreateAgentSessionResult,\n\ttype CreateAgentSessionRuntimeFactory,\n\ttype CreateAgentSessionRuntimeResult,\n\ttype CreateAgentSessionServicesOptions,\n\t// Factory\n\tcreateAgentSession,\n\tcreateAgentSessionFromServices,\n\tcreateAgentSessionRuntime,\n\tcreateAgentSessionServices,\n\tcreateBashTool,\n\t// Tool factories (for custom cwd)\n\tcreateCodingTools,\n\tcreateEditTool,\n\tcreateFindTool,\n\tcreateGrepTool,\n\tcreateLsTool,\n\tcreateReadOnlyTools,\n\tcreateReadTool,\n\tcreateWriteTool,\n\ttype PromptTemplate,\n\tSessionReplacementCallbackError,\n\tSessionReplacementRuntimeError,\n} from \"./core/sdk.ts\";\nexport {\n\tBitwardenCredentialStorage,\n\tBitwardenCredentialStorageError,\n\ttype BitwardenCredentialStorageErrorCode,\n\ttype BitwardenCredentialStorageOptions,\n} from \"./core/secrets/bitwarden-credential-storage.ts\";\nexport {\n\tBitwardenCredentialStorageRouter,\n\ttype BitwardenCredentialStorageRouterOptions,\n} from \"./core/secrets/bitwarden-credential-storage-router.ts\";\nexport {\n\ttype BitwardenSecretsManagerCommandRequest,\n\ttype BitwardenSecretsManagerCommandResult,\n\tBitwardenSecretsManagerCredentialStorage,\n\ttype BitwardenSecretsManagerCredentialStorageOptions,\n\tBitwardenSecretsManagerStorageError,\n} from \"./core/secrets/bitwarden-secrets-manager-storage.ts\";\nexport {\n\ttype CredentialActivationResult,\n\ttype CredentialConnectionStatus,\n\tCredentialManager,\n\tCredentialManagerError,\n\ttype CredentialManagerErrorCode,\n\ttype CredentialManagerOptions,\n\ttype CredentialMutationResult,\n\ttype CredentialProfileRecord,\n\ttype CredentialProfileStorage,\n\ttype CredentialProfileSummary,\n\ttype CredentialProjectIdentity,\n\ttype CredentialProjectResolver,\n\tCredentialStorageError,\n\ttype CredentialStorageErrorCode,\n\ttype CredentialStorageProvider,\n\ttype CredentialVariable,\n\ttype MachineCredentialSession,\n\ttype MachineCredentialSessionResolver,\n\ttype StoredCredentialProfileSummary,\n} from \"./core/secrets/credential-manager.ts\";\nexport {\n\ttype CredentialMigrationSource,\n\tCredentialMigrationSourceError,\n\ttype CredentialMigrationSourceErrorCode,\n\ttype CredentialMigrationSourceResolver,\n\tresolveCredentialMigrationSources,\n} from \"./core/secrets/credential-migration-source.ts\";\nexport { createPortableGitProjectKey, resolveCredentialProject } from \"./core/secrets/credential-project.ts\";\nexport { WORKER_FORBIDDEN_TOOLS } from \"./core/session-role.ts\";\nexport {\n\ttype CompactionSettings,\n\ttype DirectoryResourceProfileInfo,\n\tgetDirectoryResourceProfileInfo,\n\ttype ImageSettings,\n\tmatchesResourceProfilePattern,\n\ttype PackageSource,\n\ttype ResourceProfileFilterSettings,\n\ttype ResourceProfileKind,\n\ttype ResourceProfileSettings,\n\ttype RetrySettings,\n\tSettingsManager,\n\ttype SettingsManagerCreateOptions,\n} from \"./core/settings-manager.ts\";\nexport {\n\tDEFAULT_SKILL_IDLE_TIMEOUT_MS,\n\tMAX_ACTIVE_SKILL_BODY_BYTES,\n\tMAX_LOADED_SKILLS,\n\tMAX_PINNED_SKILLS,\n\tMIN_ACTIVE_SKILL_BODY_BYTES,\n\tresolveActiveSkillBodyByteLimit,\n\ttype SkillLoadResult,\n\ttype SkillSearchResult,\n\ttype SkillSlotStatus,\n\tSkillVaultController,\n\ttype SkillVaultControllerOptions,\n\ttype SkillVaultStatus,\n} from \"./core/skill-vault.ts\";\n// Skills\nexport {\n\ttype LoadSkillsFromDirOptions,\n\ttype LoadSkillsResult,\n\tloadSkills,\n\tloadSkillsFromDir,\n\tMAX_SKILL_FRONTMATTER_BYTES,\n\treadSkillFrontmatterFile,\n\ttype Skill,\n\ttype SkillFrontmatter,\n} from \"./core/skills.ts\";\nexport { createSyntheticSourceInfo } from \"./core/source-info.ts\";\nexport { POLICY_OWNED_RUNTIME_TOOL_NAMES } from \"./core/tool-capability-policy.ts\";\nexport {\n\ttype AskQuestion,\n\ttype AskQuestionAnswer,\n\tAskQuestionDialog,\n\ttype AskQuestionStopReason,\n\ttype AskQuestionToolDetails,\n\ttype AskQuestionToolInput,\n\ttype AskQuestionToolOptions,\n\tcreateAskQuestionToolDefinition,\n} from \"./core/tools/ask-question.ts\";\n// Tools\nexport {\n\ttype BashOperations,\n\ttype BashSpawnContext,\n\ttype BashSpawnHook,\n\ttype BashToolDetails,\n\ttype BashToolInput,\n\ttype BashToolOptions,\n\tcreateBashToolDefinition,\n\tcreateEditToolDefinition,\n\tcreateFileFailureRecoveryAuthority,\n\tcreateFindToolDefinition,\n\tcreateGrepToolDefinition,\n\tcreateLocalBashOperations,\n\tcreateLsToolDefinition,\n\tcreateReadToolDefinition,\n\tcreateSecretStoreToolDefinition,\n\tcreateWriteToolDefinition,\n\tDEFAULT_MAX_BYTES,\n\tDEFAULT_MAX_LINES,\n\ttype EditOperations,\n\ttype EditToolDetails,\n\ttype EditToolInput,\n\ttype EditToolOptions,\n\ttype FileContentReference,\n\ttype FileFailureRecoveryAuthority,\n\tFileMutationIntentController,\n\ttype FileMutationIntentControllerOptions,\n\ttype FileMutationIntentOperations,\n\ttype FileMutationKind,\n\ttype FileMutationLease,\n\ttype FileMutationPayloadReference,\n\tFileMutationPreflightError,\n\ttype FileMutationPreflightFailureReason,\n\ttype FilePathIdentity,\n\ttype FilePathInspection,\n\ttype FindOperations,\n\ttype FindToolDetails,\n\ttype FindToolInput,\n\ttype FindToolOptions,\n\tformatMiddleOmissionMarker,\n\tformatSize,\n\ttype GrepOperations,\n\ttype GrepToolDetails,\n\ttype GrepToolInput,\n\ttype GrepToolOptions,\n\ttype LsOperations,\n\ttype LsToolDetails,\n\ttype LsToolInput,\n\ttype LsToolOptions,\n\ttype ReadOperations,\n\ttype ReadToolDetails,\n\ttype ReadToolInput,\n\ttype ReadToolOptions,\n\ttype SecretStoreStatus,\n\ttype SecretStoreToolDetails,\n\ttype SecretStoreToolInput,\n\ttype SecretStoreToolOptions,\n\ttype ToolsOptions,\n\ttype TruncationOptions,\n\ttype TruncationResult,\n\ttruncateHead,\n\ttruncateKnownHeadTail,\n\ttruncateLine,\n\ttruncateMiddle,\n\ttruncateTail,\n\ttype WriteOperations,\n\ttype WriteToolDetails,\n\ttype WriteToolInput,\n\ttype WriteToolOptions,\n\twithFileMutationQueue,\n} from \"./core/tools/index.ts\";\nexport {\n\tcreateSkillVaultToolDefinition,\n\ttype SkillToolDetails,\n\ttype SkillToolInput,\n} from \"./core/tools/skill.ts\";\n// Skill-audit primitives — exported so extensions (e.g. continuous-learning) can reuse the native\n// Jaccard overlap audit via `import { runSkillAudit } from \"@caupulican/pi-adaptative\"` instead of\n// carrying a duplicate copy.\nexport {\n\tjaccard,\n\trunSkillAudit,\n\ttype SkillAuditReport,\n\ttype SkillSummary,\n\ttokenize,\n} from \"./core/tools/skill-audit.ts\";\nexport { hasProjectTrustInputs, type ProjectTrustDecision, ProjectTrustStore } from \"./core/trust-manager.ts\";\n// Main entry point\nexport { type MainOptions, main } from \"./main.ts\";\n// Run modes for programmatic SDK usage\nexport {\n\tInteractiveMode,\n\ttype InteractiveModeOptions,\n\ttype ModelInfo,\n\ttype PrintModeOptions,\n\tRpcClient,\n\ttype RpcClientOptions,\n\ttype RpcCommand,\n\ttype RpcEventListener,\n\ttype RpcResponse,\n\ttype RpcSessionState,\n\trunPrintMode,\n\trunRpcMode,\n} from \"./modes/index.ts\";\n// UI components for extensions\nexport {\n\tArminComponent,\n\tAssistantMessageComponent,\n\tBashExecutionComponent,\n\tBorderedLoader,\n\tBranchSummaryMessageComponent,\n\tCompactionSummaryMessageComponent,\n\tCustomEditor,\n\tCustomMessageComponent,\n\tDynamicBorder,\n\tExtensionEditorComponent,\n\tExtensionInputComponent,\n\tExtensionSelectorComponent,\n\tFooterComponent,\n\tkeyHint,\n\tkeyText,\n\tLoginDialogComponent,\n\tModelSelectorComponent,\n\tOAuthSelectorComponent,\n\ttype RenderDiffOptions,\n\trawKeyHint,\n\trenderDiff,\n\trenderTitleBadge,\n\trenderToolTitle,\n\tSessionSelectorComponent,\n\ttype SettingsCallbacks,\n\ttype SettingsConfig,\n\tSettingsSelectorComponent,\n\tShowImagesSelectorComponent,\n\tSkillInvocationMessageComponent,\n\tThemeSelectorComponent,\n\tThinkingSelectorComponent,\n\tTitleBadgeComponent,\n\ttype TitleBadgeOptions,\n\ttype TitleBadgeSegment,\n\ttype TitleBadgeStatus,\n\tToolExecutionComponent,\n\ttype ToolExecutionOptions,\n\tToolTitleComponent,\n\ttype ToolTitleOptions,\n\ttype ToolTitleSegment,\n\ttype ToolTitleStatus,\n\tTreeSelectorComponent,\n\ttitleBadge,\n\ttoolTitle,\n\ttruncateToVisualLines,\n\tUserMessageComponent,\n\tUserMessageSelectorComponent,\n\ttype VisualTruncateResult,\n} from \"./modes/interactive/components/index.ts\";\n// Theme utilities for custom tools and extensions\nexport {\n\tgetLanguageFromPath,\n\tgetMarkdownTheme,\n\tgetSelectListTheme,\n\tgetSettingsListTheme,\n\thighlightCode,\n\tinitTheme,\n\tTheme,\n\ttype ThemeColor,\n} from \"./modes/interactive/theme/theme.ts\";\n// Clipboard utilities\nexport { copyToClipboard } from \"./utils/clipboard.ts\";\nexport { parseFrontmatter, stripFrontmatter } from \"./utils/frontmatter.ts\";\nexport { convertToPng } from \"./utils/image-convert.ts\";\nexport { formatDimensionNote, type ResizedImage, resizeImage } from \"./utils/image-resize.ts\";\n// Shell utilities\nexport { getShellConfig } from \"./utils/shell.ts\";\nexport {\n\ttype AcquireWorkRunOptions,\n\tacquireWorkRun,\n\tassertPortablePathSegment,\n\tboundedWorkRetention,\n\tcreateWorkRunId,\n\tgetProcessWorkRun,\n\tgetWorkRoot,\n\tgetWorkRunDir,\n\tgetWorkTenantDir,\n\tPI_WORK_ROOT_ENV,\n\tpruneWorkTenant,\n\ttype WorkRetentionOptions,\n\ttype WorkRunLease,\n} from \"./utils/work-directory.ts\";\n"]}
|
|
@@ -107,10 +107,11 @@ export declare class AutoLearnController {
|
|
|
107
107
|
getAutoLearnTenantDataDir(): string;
|
|
108
108
|
private getAutoLearnMessageCount;
|
|
109
109
|
private buildAutoLearnDecisionFromState;
|
|
110
|
+
/** Read-only readiness projection for the manual Auto Learn command and status report. */
|
|
111
|
+
private evaluateAutoLearn;
|
|
110
112
|
private resolveAutoLearnModelPattern;
|
|
111
113
|
private getAutoLearnSpawnTarget;
|
|
112
114
|
validateAutoLearnModelValue(value: string | undefined): string | undefined;
|
|
113
|
-
private evaluateAutoLearn;
|
|
114
115
|
private buildAutonomyAuthorityPrompt;
|
|
115
116
|
private buildAutoLearnPrompt;
|
|
116
117
|
private reserveAutoLearnRun;
|
|
@@ -124,10 +125,9 @@ export declare class AutoLearnController {
|
|
|
124
125
|
turnDigest?: string;
|
|
125
126
|
bypassReflectionCooldown?: boolean;
|
|
126
127
|
}): string;
|
|
127
|
-
private evaluateAutonomyReview;
|
|
128
128
|
/**
|
|
129
|
-
*
|
|
130
|
-
*
|
|
129
|
+
* Current-session reflection is available only to the root orchestrator. It never launches a
|
|
130
|
+
* learner process; the session provider planner owns its single-request transient cue.
|
|
131
131
|
*/
|
|
132
132
|
isNativeReflectionEnabled(): boolean;
|
|
133
133
|
/**
|
|
@@ -139,9 +139,8 @@ export declare class AutoLearnController {
|
|
|
139
139
|
* `task_steps_context` pages through). Zero model calls; a delivery failure is swallowed so this
|
|
140
140
|
* best-effort nudge can never disrupt the turn.
|
|
141
141
|
*
|
|
142
|
-
* Called from both
|
|
143
|
-
*
|
|
144
|
-
* native reflection or legacy auto-learn is enabled, without adding a new turn-boundary hook.
|
|
142
|
+
* Called from both interactive turn-boundary compatibility hooks so it runs regardless of the
|
|
143
|
+
* current-session reflection setting without adding another provider turn.
|
|
145
144
|
*/
|
|
146
145
|
private checkTaskStepsContractNudge;
|
|
147
146
|
maybeRunNativeReflection(messages: AgentMessage[]): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auto-learn-controller.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/auto-learn-controller.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAG9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAIrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"auto-learn-controller.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/auto-learn-controller.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAG9D,OAAO,KAAK,EAAE,UAAU,EAAE,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AAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAWzE;IAED,OAAO,CAAC,4BAA4B;IA8BpC,OAAO,CAAC,oBAAoB;IAiB5B,OAAO,CAAC,mBAAmB;IAgE3B,OAAO,CAAC,2BAA2B;IAkBnC,OAAO,CAAC,6BAA6B;IAgBrC,OAAO,CAAC,4BAA4B;IAqBpC,OAAO,CAAC,+BAA+B;IA8BvC,eAAe,CACd,MAAM,EAAE,MAAM,EACd,KAAK,UAAQ,EACb,OAAO,GAAE;QACR,YAAY,CAAC,EAAE,MAAM,GAAG,YAAY,CAAC;QACrC,UAAU,CAAC,EAAE,MAAM,GAAG,YAAY,CAAC;QACnC,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,wBAAwB,CAAC,EAAE,OAAO,CAAC;KAC9B,GACJ,MAAM,CAgIR;IAED;;;OAGG;IACH,yBAAyB,IAAI,OAAO,CAEnC;IAED;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,2BAA2B;IAenC,wBAAwB,CAAC,QAAQ,EAAE,YAAY,EAAE,GAAG,IAAI,CAMvD;IAED,mBAAmB,IAAI,OAAO,CAK7B;IAED,wBAAwB,CAAC,QAAQ,EAAE,YAAY,EAAE,GAAG,OAAO,CAK1D;IAED,qBAAqB,IAAI,IAAI,CAiB5B;IAED,qBAAqB,IAAI,MAAM,CAwC9B;CACD"}
|
|
@@ -15,72 +15,13 @@ import { spawn } from "child_process";
|
|
|
15
15
|
import lockfile from "proper-lockfile";
|
|
16
16
|
import { getAgentDir } from "../../config.js";
|
|
17
17
|
import { readAutoLearnSessionIdFromFile, reportCompletedAutoLearnUsageHelper } from "../../core/cost/session-usage.js";
|
|
18
|
-
import {
|
|
18
|
+
import { getAutoLearnPreset, isCurrentSessionReflectionEnabled, resolveAutoLearnSettings, } from "../../core/learning/auto-learn-settings.js";
|
|
19
19
|
import { isProcessAlive } from "../../core/process-liveness.js";
|
|
20
20
|
import { describeInFlightWorkUnit, getInFlightWorkUnits, getPendingReloadBlockers, } from "../../core/reload-blockers.js";
|
|
21
|
+
import { PI_SESSION_ROLE_ENV } from "../../core/session-role.js";
|
|
21
22
|
import { checkTaskStepsContract, INITIAL_TASK_CONTRACT_STREAK, } from "../../core/tasks/task-contract-monitor.js";
|
|
22
23
|
import { getProcessWorkRun } from "../../utils/work-directory.js";
|
|
23
24
|
import { theme } from "./theme/theme.js";
|
|
24
|
-
const AUTO_LEARN_DEFAULTS = {
|
|
25
|
-
enabled: false,
|
|
26
|
-
model: "active",
|
|
27
|
-
thinkingLevel: "low",
|
|
28
|
-
longSessionMessages: 32,
|
|
29
|
-
longSessionContextPercent: 70,
|
|
30
|
-
cooldownMinutes: 24 * 60,
|
|
31
|
-
leaseMinutes: 90,
|
|
32
|
-
maxConcurrentLearners: 1,
|
|
33
|
-
applyHighConfidence: false,
|
|
34
|
-
reflectionReview: true,
|
|
35
|
-
reflectionMinToolCalls: 12,
|
|
36
|
-
reflectionCooldownMinutes: 24 * 60,
|
|
37
|
-
complexTaskToolCalls: 12,
|
|
38
|
-
};
|
|
39
|
-
const AUTONOMY_AUTO_LEARN_PRESETS = {
|
|
40
|
-
off: { ...AUTO_LEARN_DEFAULTS, enabled: true, reflectionReview: true },
|
|
41
|
-
safe: {
|
|
42
|
-
...AUTO_LEARN_DEFAULTS,
|
|
43
|
-
enabled: true,
|
|
44
|
-
longSessionMessages: 64,
|
|
45
|
-
longSessionContextPercent: 85,
|
|
46
|
-
cooldownMinutes: 24 * 60,
|
|
47
|
-
leaseMinutes: 60,
|
|
48
|
-
maxConcurrentLearners: 1,
|
|
49
|
-
applyHighConfidence: false,
|
|
50
|
-
reflectionReview: true,
|
|
51
|
-
reflectionMinToolCalls: 12,
|
|
52
|
-
reflectionCooldownMinutes: 24 * 60,
|
|
53
|
-
complexTaskToolCalls: 12,
|
|
54
|
-
},
|
|
55
|
-
balanced: {
|
|
56
|
-
...AUTO_LEARN_DEFAULTS,
|
|
57
|
-
enabled: true,
|
|
58
|
-
longSessionMessages: 64,
|
|
59
|
-
longSessionContextPercent: 85,
|
|
60
|
-
cooldownMinutes: 24 * 60,
|
|
61
|
-
leaseMinutes: 90,
|
|
62
|
-
maxConcurrentLearners: 1,
|
|
63
|
-
applyHighConfidence: false,
|
|
64
|
-
reflectionReview: true,
|
|
65
|
-
reflectionMinToolCalls: 12,
|
|
66
|
-
reflectionCooldownMinutes: 24 * 60,
|
|
67
|
-
complexTaskToolCalls: 12,
|
|
68
|
-
},
|
|
69
|
-
full: {
|
|
70
|
-
...AUTO_LEARN_DEFAULTS,
|
|
71
|
-
enabled: true,
|
|
72
|
-
longSessionMessages: 64,
|
|
73
|
-
longSessionContextPercent: 85,
|
|
74
|
-
cooldownMinutes: 24 * 60,
|
|
75
|
-
leaseMinutes: 90,
|
|
76
|
-
maxConcurrentLearners: 1,
|
|
77
|
-
applyHighConfidence: true,
|
|
78
|
-
reflectionReview: true,
|
|
79
|
-
reflectionMinToolCalls: 12,
|
|
80
|
-
reflectionCooldownMinutes: 24 * 60,
|
|
81
|
-
complexTaskToolCalls: 12,
|
|
82
|
-
},
|
|
83
|
-
};
|
|
84
25
|
export const AUTONOMY_MODES = ["off", "safe", "balanced", "full"];
|
|
85
26
|
const AUTO_LEARN_RESERVATION_MS = 2 * 60 * 1000;
|
|
86
27
|
export const AUTO_LEARN_HISTORY_RETENTION_MS = 7 * 24 * 60 * 60 * 1000;
|
|
@@ -225,9 +166,8 @@ export class AutoLearnController {
|
|
|
225
166
|
constructor(deps) {
|
|
226
167
|
// Cheap turn-boundary task_steps contract nudge. Tracks the consecutive-violation streak
|
|
227
168
|
// across turns so `checkTaskStepsContractNudge` (invoked from the existing per-turn `agent_end`
|
|
228
|
-
// pass below) can fire exactly one advisory harness note per sustained-violation streak.
|
|
229
|
-
//
|
|
230
|
-
// auto-learn/autonomy-review pair) — see `checkTaskStepsContractNudge` for the rationale.
|
|
169
|
+
// pass below) can fire exactly one advisory harness note per sustained-violation streak. It makes
|
|
170
|
+
// no model call and remains independent of current-session reflection cue planning.
|
|
231
171
|
this._taskContractStreak = INITIAL_TASK_CONTRACT_STREAK;
|
|
232
172
|
this.deps = deps;
|
|
233
173
|
}
|
|
@@ -420,27 +360,11 @@ export class AutoLearnController {
|
|
|
420
360
|
});
|
|
421
361
|
}
|
|
422
362
|
getAutoLearnPresetForAutonomyMode(mode, current = {}) {
|
|
423
|
-
|
|
424
|
-
return { ...preset, model: current.model?.trim() || preset.model };
|
|
363
|
+
return getAutoLearnPreset(mode, current);
|
|
425
364
|
}
|
|
426
365
|
getEffectiveAutoLearnSettings() {
|
|
427
366
|
const settings = this.session.settingsManager.getAutoLearnSettings();
|
|
428
|
-
|
|
429
|
-
return {
|
|
430
|
-
enabled: settings.enabled ?? preset.enabled,
|
|
431
|
-
model: settings.model?.trim() || preset.model,
|
|
432
|
-
longSessionMessages: settings.longSessionMessages ?? preset.longSessionMessages,
|
|
433
|
-
longSessionContextPercent: settings.longSessionContextPercent ?? preset.longSessionContextPercent,
|
|
434
|
-
cooldownMinutes: settings.cooldownMinutes ?? preset.cooldownMinutes,
|
|
435
|
-
leaseMinutes: settings.leaseMinutes ?? preset.leaseMinutes,
|
|
436
|
-
maxConcurrentLearners: settings.maxConcurrentLearners ?? preset.maxConcurrentLearners,
|
|
437
|
-
applyHighConfidence: settings.applyHighConfidence ?? preset.applyHighConfidence,
|
|
438
|
-
reflectionReview: settings.reflectionReview ?? preset.reflectionReview,
|
|
439
|
-
reflectionMinToolCalls: settings.reflectionMinToolCalls ?? preset.reflectionMinToolCalls,
|
|
440
|
-
reflectionCooldownMinutes: settings.reflectionCooldownMinutes ?? preset.reflectionCooldownMinutes,
|
|
441
|
-
complexTaskToolCalls: settings.complexTaskToolCalls ?? preset.complexTaskToolCalls,
|
|
442
|
-
thinkingLevel: settings.thinkingLevel ?? preset.thinkingLevel,
|
|
443
|
-
};
|
|
367
|
+
return resolveAutoLearnSettings(this.session.settingsManager.getAutonomySettings().mode, settings);
|
|
444
368
|
}
|
|
445
369
|
getCurrentAutoLearnSettings() {
|
|
446
370
|
return this.getEffectiveAutoLearnSettings();
|
|
@@ -534,6 +458,14 @@ export class AutoLearnController {
|
|
|
534
458
|
runningCount,
|
|
535
459
|
};
|
|
536
460
|
}
|
|
461
|
+
/** Read-only readiness projection for the manual Auto Learn command and status report. */
|
|
462
|
+
evaluateAutoLearn(force = false) {
|
|
463
|
+
const settings = this.getEffectiveAutoLearnSettings();
|
|
464
|
+
return this.withAutoLearnStateLock((current) => {
|
|
465
|
+
const state = this.pruneAutoLearnHistoryFromState(current);
|
|
466
|
+
return { result: this.buildAutoLearnDecisionFromState(state, settings, force), next: state };
|
|
467
|
+
});
|
|
468
|
+
}
|
|
537
469
|
resolveAutoLearnModelPattern(settings) {
|
|
538
470
|
if (settings.model === "active") {
|
|
539
471
|
return this.session.model ? `${this.session.model.provider}/${this.session.model.id}` : undefined;
|
|
@@ -571,13 +503,6 @@ export class AutoLearnController {
|
|
|
571
503
|
return undefined;
|
|
572
504
|
return `Auto Learn model "${modelValue}" is not in configured subscription/API models; saved as manual/unverified.`;
|
|
573
505
|
}
|
|
574
|
-
evaluateAutoLearn(force = false) {
|
|
575
|
-
const settings = this.getEffectiveAutoLearnSettings();
|
|
576
|
-
return this.withAutoLearnStateLock((current) => {
|
|
577
|
-
const state = this.pruneAutoLearnHistoryFromState(current);
|
|
578
|
-
return { result: this.buildAutoLearnDecisionFromState(state, settings, force), next: state };
|
|
579
|
-
});
|
|
580
|
-
}
|
|
581
506
|
buildAutonomyAuthorityPrompt() {
|
|
582
507
|
const autonomy = this.session.settingsManager.getAutonomySettings();
|
|
583
508
|
const selfModification = this.session.settingsManager.getSelfModificationSettings();
|
|
@@ -735,6 +660,9 @@ export class AutoLearnController {
|
|
|
735
660
|
});
|
|
736
661
|
}
|
|
737
662
|
launchAutoLearn(reason, force = false, options = {}) {
|
|
663
|
+
if (options.promptKind === "reflection" || options.cooldownKind === "reflection") {
|
|
664
|
+
return "Auto Learn not started: automatic reflection runs only in the current root session; background reflection learners are disabled.";
|
|
665
|
+
}
|
|
738
666
|
const settings = this.getEffectiveAutoLearnSettings();
|
|
739
667
|
const modelPattern = this.resolveAutoLearnModelPattern(settings);
|
|
740
668
|
if (!modelPattern) {
|
|
@@ -812,6 +740,7 @@ export class AutoLearnController {
|
|
|
812
740
|
env: {
|
|
813
741
|
...process.env,
|
|
814
742
|
PI_AUTO_LEARN_CHILD: "1",
|
|
743
|
+
[PI_SESSION_ROLE_ENV]: "worker",
|
|
815
744
|
...(sourceSessionFile ? { PI_AUTO_LEARN_SOURCE_SESSION_FILE: sourceSessionFile } : {}),
|
|
816
745
|
},
|
|
817
746
|
});
|
|
@@ -858,93 +787,12 @@ export class AutoLearnController {
|
|
|
858
787
|
this.updateAutoLearnFooter();
|
|
859
788
|
return `Auto Learn started. Log: ${logPath}`;
|
|
860
789
|
}
|
|
861
|
-
evaluateAutonomyReview(messages) {
|
|
862
|
-
const settings = this.getEffectiveAutoLearnSettings();
|
|
863
|
-
const complexTaskThreshold = Math.max(1, settings.complexTaskToolCalls ?? 12);
|
|
864
|
-
const turn = analyzeReflectionTurn(messages, complexTaskThreshold);
|
|
865
|
-
const digest = turn.recentTurnText || "[No textual turn digest available.]";
|
|
866
|
-
const state = this.withAutoLearnStateLock((current) => {
|
|
867
|
-
const pruned = this.pruneAutoLearnHistoryFromState(current);
|
|
868
|
-
return { result: pruned, next: pruned };
|
|
869
|
-
});
|
|
870
|
-
const now = Date.now();
|
|
871
|
-
const tenant = this.getAutoLearnTenantKey();
|
|
872
|
-
const runningCount = Object.values(state.runs ?? {}).filter((run) => run.tenant === tenant).length;
|
|
873
|
-
const lastReflection = state.lastReflectionByTenant?.[tenant] ?? 0;
|
|
874
|
-
const cooldownMs = settings.reflectionCooldownMinutes * 60 * 1000;
|
|
875
|
-
const cooldownRemainingMs = Math.max(0, lastReflection + cooldownMs - now);
|
|
876
|
-
const messageCount = this.getAutoLearnMessageCount();
|
|
877
|
-
const contextPercent = this.session.getContextUsage()?.percent ?? null;
|
|
878
|
-
const toolCalls = turn.toolCallCount;
|
|
879
|
-
const userText = turn.userText;
|
|
880
|
-
const correctionSignal = turn.hadCorrection;
|
|
881
|
-
const behavioralSelfImprovementSignal = /\b(harness|pi|agent|autonomy|autonomous|self[- ]?improv(?:e|ement|ing)?|steer(?:ing)?|trigger(?:s)?|skill(?:s)?|code[- ]?bak(?:e|ed)|bake(?:d)? into code|not (?:automata|memory)|reference agent|hermes)\b/i.test(userText) &&
|
|
882
|
-
/\b(improve|automatic(?:ally)?|autonomous|trigger|fire|skill|steer|self[- ]?improv(?:e|ement|ing)?|code[- ]?bak(?:e|ed)|bake(?:d)?|too much|less)\b/i.test(userText);
|
|
883
|
-
const complexTaskSignal = toolCalls >= complexTaskThreshold;
|
|
884
|
-
const bypassCooldown = correctionSignal || behavioralSelfImprovementSignal || complexTaskSignal;
|
|
885
|
-
const base = { messageCount, contextPercent, cooldownRemainingMs, runningCount, toolCalls };
|
|
886
|
-
if (!settings.enabled)
|
|
887
|
-
return { ...base, shouldRun: false, reason: "disabled" };
|
|
888
|
-
if (!settings.reflectionReview)
|
|
889
|
-
return { ...base, shouldRun: false, reason: "reflection disabled" };
|
|
890
|
-
if (runningCount >= settings.maxConcurrentLearners) {
|
|
891
|
-
return {
|
|
892
|
-
...base,
|
|
893
|
-
shouldRun: false,
|
|
894
|
-
reason: `max tenant learners running (${runningCount}/${settings.maxConcurrentLearners})`,
|
|
895
|
-
};
|
|
896
|
-
}
|
|
897
|
-
if (cooldownRemainingMs > 0 && !bypassCooldown) {
|
|
898
|
-
return { ...base, shouldRun: false, reason: "reflection cooldown" };
|
|
899
|
-
}
|
|
900
|
-
if (behavioralSelfImprovementSignal) {
|
|
901
|
-
return {
|
|
902
|
-
...base,
|
|
903
|
-
shouldRun: true,
|
|
904
|
-
reason: "reflection behavioral self-improvement signal",
|
|
905
|
-
digest,
|
|
906
|
-
bypassCooldown: true,
|
|
907
|
-
};
|
|
908
|
-
}
|
|
909
|
-
if (correctionSignal) {
|
|
910
|
-
return {
|
|
911
|
-
...base,
|
|
912
|
-
shouldRun: true,
|
|
913
|
-
reason: "reflection correction signal",
|
|
914
|
-
digest,
|
|
915
|
-
bypassCooldown: true,
|
|
916
|
-
};
|
|
917
|
-
}
|
|
918
|
-
if (complexTaskSignal) {
|
|
919
|
-
return {
|
|
920
|
-
...base,
|
|
921
|
-
shouldRun: true,
|
|
922
|
-
reason: `reflection complex task learning signal (${toolCalls}/${complexTaskThreshold} tool calls)`,
|
|
923
|
-
digest,
|
|
924
|
-
bypassCooldown: true,
|
|
925
|
-
};
|
|
926
|
-
}
|
|
927
|
-
// Full autonomy expands allowed action scope for triggered reviews; it does not make every turn a review trigger.
|
|
928
|
-
if (toolCalls >= settings.reflectionMinToolCalls) {
|
|
929
|
-
return {
|
|
930
|
-
...base,
|
|
931
|
-
shouldRun: true,
|
|
932
|
-
reason: `reflection tool trigger (${toolCalls}/${settings.reflectionMinToolCalls})`,
|
|
933
|
-
digest,
|
|
934
|
-
};
|
|
935
|
-
}
|
|
936
|
-
return { ...base, shouldRun: false, reason: "reflection thresholds not met" };
|
|
937
|
-
}
|
|
938
790
|
/**
|
|
939
|
-
*
|
|
940
|
-
*
|
|
791
|
+
* Current-session reflection is available only to the root orchestrator. It never launches a
|
|
792
|
+
* learner process; the session provider planner owns its single-request transient cue.
|
|
941
793
|
*/
|
|
942
794
|
isNativeReflectionEnabled() {
|
|
943
|
-
|
|
944
|
-
return false;
|
|
945
|
-
if (process.env.PI_AUTO_LEARN_CHILD === "1")
|
|
946
|
-
return false;
|
|
947
|
-
return this.getEffectiveAutoLearnSettings().enabled;
|
|
795
|
+
return isCurrentSessionReflectionEnabled(this.getEffectiveAutoLearnSettings());
|
|
948
796
|
}
|
|
949
797
|
/**
|
|
950
798
|
* Cheap turn-boundary task_steps contract check. Reads the current task_steps snapshot,
|
|
@@ -955,9 +803,8 @@ export class AutoLearnController {
|
|
|
955
803
|
* `task_steps_context` pages through). Zero model calls; a delivery failure is swallowed so this
|
|
956
804
|
* best-effort nudge can never disrupt the turn.
|
|
957
805
|
*
|
|
958
|
-
* Called from both
|
|
959
|
-
*
|
|
960
|
-
* native reflection or legacy auto-learn is enabled, without adding a new turn-boundary hook.
|
|
806
|
+
* Called from both interactive turn-boundary compatibility hooks so it runs regardless of the
|
|
807
|
+
* current-session reflection setting without adding another provider turn.
|
|
961
808
|
*/
|
|
962
809
|
checkTaskStepsContractNudge() {
|
|
963
810
|
const state = this.session.getTaskStepsStateSnapshot();
|
|
@@ -979,36 +826,16 @@ export class AutoLearnController {
|
|
|
979
826
|
void messages;
|
|
980
827
|
}
|
|
981
828
|
maybeStartAutoLearn() {
|
|
982
|
-
//
|
|
983
|
-
// unconditionally here so the contract nudge fires every turn regardless of auto-learn settings.
|
|
829
|
+
// Preserve the deterministic task-contract monitor, but never buy an automatic learner turn.
|
|
984
830
|
this.checkTaskStepsContractNudge();
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
const decision = this.evaluateAutoLearn(false);
|
|
988
|
-
if (!decision.shouldRun) {
|
|
989
|
-
this.updateAutoLearnFooter();
|
|
990
|
-
return false;
|
|
991
|
-
}
|
|
992
|
-
const message = this.launchAutoLearn(decision.reason, false);
|
|
993
|
-
if (!message.startsWith("Auto Learn started"))
|
|
994
|
-
this.deps.ui.showStatus(message);
|
|
995
|
-
return message.startsWith("Auto Learn started");
|
|
831
|
+
this.updateAutoLearnFooter();
|
|
832
|
+
return false;
|
|
996
833
|
}
|
|
997
834
|
maybeStartAutonomyReview(messages) {
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
return false;
|
|
1003
|
-
const message = this.launchAutoLearn(decision.reason, true, {
|
|
1004
|
-
cooldownKind: "reflection",
|
|
1005
|
-
promptKind: "reflection",
|
|
1006
|
-
turnDigest: decision.digest,
|
|
1007
|
-
bypassReflectionCooldown: decision.bypassCooldown,
|
|
1008
|
-
});
|
|
1009
|
-
if (!message.startsWith("Auto Learn started"))
|
|
1010
|
-
this.deps.ui.showStatus(message);
|
|
1011
|
-
return message.startsWith("Auto Learn started");
|
|
835
|
+
// Compatibility hook for InteractiveEventHost. Completed-turn reflection is deterministic and
|
|
836
|
+
// session-owned; it never creates a background process or a second provider turn.
|
|
837
|
+
void messages;
|
|
838
|
+
return false;
|
|
1012
839
|
}
|
|
1013
840
|
updateAutoLearnFooter() {
|
|
1014
841
|
const settings = this.getEffectiveAutoLearnSettings();
|
|
@@ -1060,10 +887,8 @@ export class AutoLearnController {
|
|
|
1060
887
|
const inFlightWorkLines = inFlightWork.length
|
|
1061
888
|
? inFlightWork.map((unit) => `- ${describeInFlightWorkUnit(unit)}`).join("\n")
|
|
1062
889
|
: "- none";
|
|
1063
|
-
const
|
|
1064
|
-
|
|
1065
|
-
const reflectionCooldownText = reflectionCooldownRemainingMs > 0 ? `${Math.ceil(reflectionCooldownRemainingMs / 60000)}m remaining` : "ready";
|
|
1066
|
-
return `Auto Learn status\nEnabled: ${settings.enabled}\nModel: ${settings.model}\nNext decision: ${decision.shouldRun ? "ready" : decision.reason}\nMessages: ${decision.messageCount}/${settings.longSessionMessages}\nContext: ${contextText}/${settings.longSessionContextPercent}%\nCooldown: ${cooldownText}\nReflection review: ${settings.reflectionReview ? "enabled" : "disabled"} (tool trigger ${settings.reflectionMinToolCalls}, cooldown ${reflectionCooldownText})\nHistory retention: 7 days for internal Auto Learn prompts/logs/sessions\nRunning tenant leases: ${runs.length}/${settings.maxConcurrentLearners}\nOther tenant leases: ${otherTenantRuns}\nTenant artifact dir: ${this.getAutoLearnTenantDataDir()}\nPi auto-reload blockers: ${reloadBlockers.pending ? reloadBlockers.reason : "none"}\n${reloadBlockerLines}\nIn-process reload-gate work: ${inFlightWork.length ? `${inFlightWork.length} unit(s)` : "none"}\n${inFlightWorkLines}\nRuns:\n${runLines}`;
|
|
890
|
+
const reflectionStatus = this.isNativeReflectionEnabled() ? "enabled" : "disabled";
|
|
891
|
+
return `Auto Learn status\nEnabled: ${settings.enabled}\nModel: ${settings.model}\nNext decision: ${decision.shouldRun ? "ready" : decision.reason}\nMessages: ${decision.messageCount}/${settings.longSessionMessages}\nContext: ${contextText}/${settings.longSessionContextPercent}%\nCooldown: ${cooldownText}\nCurrent-session reflection: ${reflectionStatus} (complex trigger ${settings.complexTaskToolCalls} tool calls; automatic provider requests 0)\nHistory retention: 7 days for internal Auto Learn prompts/logs/sessions\nRunning tenant leases: ${runs.length}/${settings.maxConcurrentLearners}\nOther tenant leases: ${otherTenantRuns}\nTenant artifact dir: ${this.getAutoLearnTenantDataDir()}\nPi auto-reload blockers: ${reloadBlockers.pending ? reloadBlockers.reason : "none"}\n${reloadBlockerLines}\nIn-process reload-gate work: ${inFlightWork.length ? `${inFlightWork.length} unit(s)` : "none"}\n${inFlightWorkLines}\nRuns:\n${runLines}`;
|
|
1067
892
|
}
|
|
1068
893
|
}
|
|
1069
894
|
//# sourceMappingURL=auto-learn-controller.js.map
|