@ashx-j/lunr-dev 0.2.16-dev.9.1 → 0.2.21-dev.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +67 -1
- package/README.md +7 -1
- package/dist/builtin-extensions/ashxj-thinking.d.ts +1 -0
- package/dist/builtin-extensions/ashxj-thinking.d.ts.map +1 -1
- package/dist/builtin-extensions/ashxj-thinking.js +44 -19
- package/dist/builtin-extensions/ashxj-thinking.js.map +1 -1
- package/dist/builtin-extensions/index.d.ts.map +1 -1
- package/dist/builtin-extensions/index.js +1 -2
- package/dist/builtin-extensions/index.js.map +1 -1
- package/dist/builtin-extensions/lunr-computer-use.d.ts +3 -0
- package/dist/builtin-extensions/lunr-computer-use.d.ts.map +1 -0
- package/dist/builtin-extensions/lunr-computer-use.js +158 -0
- package/dist/builtin-extensions/lunr-computer-use.js.map +1 -0
- package/dist/builtin-extensions/lunr-todos.d.ts +6 -5
- package/dist/builtin-extensions/lunr-todos.d.ts.map +1 -1
- package/dist/builtin-extensions/lunr-todos.js +9 -7
- package/dist/builtin-extensions/lunr-todos.js.map +1 -1
- package/dist/builtin-extensions/pi-intercom/broker/spawn.d.ts +6 -4
- package/dist/builtin-extensions/pi-intercom/broker/spawn.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-intercom/broker/spawn.js +114 -61
- package/dist/builtin-extensions/pi-intercom/broker/spawn.js.map +1 -1
- package/dist/builtin-extensions/pi-intercom/index.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-intercom/index.js +360 -351
- package/dist/builtin-extensions/pi-intercom/index.js.map +1 -1
- package/dist/builtin-extensions/pi-lsp-extension/src/index.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-lsp-extension/src/index.js +10 -3
- package/dist/builtin-extensions/pi-lsp-extension/src/index.js.map +1 -1
- package/dist/builtin-extensions/pi-lsp-extension/src/runtime.d.ts +5 -1
- package/dist/builtin-extensions/pi-lsp-extension/src/runtime.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-lsp-extension/src/runtime.js +26 -4
- package/dist/builtin-extensions/pi-lsp-extension/src/runtime.js.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/index.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/index.js +37 -27
- package/dist/builtin-extensions/pi-mcp-adapter/index.js.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/server-manager.d.ts +6 -1
- package/dist/builtin-extensions/pi-mcp-adapter/server-manager.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/server-manager.js +33 -8
- package/dist/builtin-extensions/pi-mcp-adapter/server-manager.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/fanout-child.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/fanout-child.js +2 -2
- package/dist/builtin-extensions/pi-subagents/src/extension/fanout-child.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/index.d.ts +8 -6
- package/dist/builtin-extensions/pi-subagents/src/extension/index.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/index.js +179 -79
- package/dist/builtin-extensions/pi-subagents/src/extension/index.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/schemas.d.ts +18 -8
- package/dist/builtin-extensions/pi-subagents/src/extension/schemas.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/schemas.js +44 -15
- package/dist/builtin-extensions/pi-subagents/src/extension/schemas.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.d.ts +4 -3
- package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.js +24 -14
- package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/native-supervisor-channel.d.ts +8 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/native-supervisor-channel.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/native-supervisor-channel.js +247 -18
- package/dist/builtin-extensions/pi-subagents/src/intercom/native-supervisor-channel.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/result-intercom.d.ts +1 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/result-intercom.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/result-intercom.js +1 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/result-intercom.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-ask.d.ts +29 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-ask.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-ask.js +179 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-ask.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-questions.d.ts +89 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-questions.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-questions.js +541 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-questions.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.d.ts +11 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.js +38 -12
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-job-tracker.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-job-tracker.js +3 -2
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-job-tracker.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-resume.d.ts +2 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-resume.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-resume.js +35 -8
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-resume.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/notify.d.ts +7 -3
- package/dist/builtin-extensions/pi-subagents/src/runs/background/notify.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/notify.js +26 -4
- package/dist/builtin-extensions/pi-subagents/src/runs/background/notify.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/result-watcher.d.ts +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/result-watcher.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/result-watcher.js +55 -38
- package/dist/builtin-extensions/pi-subagents/src/runs/background/result-watcher.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-runner.d.ts +100 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-runner.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-runner.js +46 -31
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-runner.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-wait.d.ts +3 -6
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-wait.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-wait.js +64 -5
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-wait.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/top-level-async.d.ts +15 -2
- package/dist/builtin-extensions/pi-subagents/src/runs/background/top-level-async.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/top-level-async.js +14 -4
- package/dist/builtin-extensions/pi-subagents/src/runs/background/top-level-async.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.d.ts +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.js +7 -3
- package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-execution.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-execution.js +21 -8
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-execution.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/execution.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/execution.js +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/execution.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/request-params.d.ts +10 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/request-params.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/request-params.js +38 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/request-params.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.d.ts +0 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.js +74 -41
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/acceptance.d.ts +2 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/acceptance.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/acceptance.js +75 -18
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/acceptance.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-tools.d.ts +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-tools.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-tools.js +2 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-tools.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/completion-guard.d.ts +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/completion-guard.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/completion-guard.js +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/completion-guard.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/model-fallback.d.ts +13 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/model-fallback.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/model-fallback.js +67 -11
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/model-fallback.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/parallel-utils.d.ts +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/parallel-utils.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/parallel-utils.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/pi-args.d.ts +3 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/pi-args.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/pi-args.js +7 -2
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/pi-args.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.js +13 -3
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/task-intent.d.ts +2 -2
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/task-intent.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/task-intent.js +5 -10
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/task-intent.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/async-guidance.d.ts +2 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/async-guidance.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/async-guidance.js +3 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/async-guidance.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/child-spec.d.ts +3 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/child-spec.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/child-spec.js +68 -11
- package/dist/builtin-extensions/pi-subagents/src/shared/child-spec.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/formatters.d.ts +12 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/formatters.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/formatters.js +21 -2
- package/dist/builtin-extensions/pi-subagents/src/shared/formatters.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/types.d.ts +21 -4
- package/dist/builtin-extensions/pi-subagents/src/shared/types.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/types.js +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/types.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/slash/delegation-adapters.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/slash/delegation-adapters.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/slash/prompt-workflows.d.ts +7 -0
- package/dist/builtin-extensions/pi-subagents/src/slash/prompt-workflows.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/slash/prompt-workflows.js +11 -7
- package/dist/builtin-extensions/pi-subagents/src/slash/prompt-workflows.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.d.ts +6 -0
- package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.js +46 -29
- package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/tui/render.d.ts +47 -4
- package/dist/builtin-extensions/pi-subagents/src/tui/render.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/tui/render.js +428 -431
- package/dist/builtin-extensions/pi-subagents/src/tui/render.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/watchdog/register-main.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/watchdog/register-main.js +1 -1
- package/dist/builtin-extensions/pi-subagents/src/watchdog/register-main.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/watchdog/tool-actions.d.ts +2 -13
- package/dist/builtin-extensions/pi-subagents/src/watchdog/tool-actions.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/watchdog/tool-actions.js +5 -91
- package/dist/builtin-extensions/pi-subagents/src/watchdog/tool-actions.js.map +1 -1
- package/dist/builtin-extensions/pi-web-access/index.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-web-access/index.js +103 -102
- package/dist/builtin-extensions/pi-web-access/index.js.map +1 -1
- package/dist/core/agent-session-services.d.ts.map +1 -1
- package/dist/core/agent-session-services.js +1 -1
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/computer-use/adapter.d.ts +23 -0
- package/dist/core/computer-use/adapter.d.ts.map +1 -0
- package/dist/core/computer-use/adapter.js +116 -0
- package/dist/core/computer-use/adapter.js.map +1 -0
- package/dist/core/computer-use/image.d.ts +26 -0
- package/dist/core/computer-use/image.d.ts.map +1 -0
- package/dist/core/computer-use/image.js +64 -0
- package/dist/core/computer-use/image.js.map +1 -0
- package/dist/core/computer-use/lease.d.ts +18 -0
- package/dist/core/computer-use/lease.d.ts.map +1 -0
- package/dist/core/computer-use/lease.js +129 -0
- package/dist/core/computer-use/lease.js.map +1 -0
- package/dist/core/computer-use/macos-runtime.d.ts +14 -0
- package/dist/core/computer-use/macos-runtime.d.ts.map +1 -0
- package/dist/core/computer-use/macos-runtime.js +148 -0
- package/dist/core/computer-use/macos-runtime.js.map +1 -0
- package/dist/core/computer-use/policy.d.ts +19 -0
- package/dist/core/computer-use/policy.d.ts.map +1 -0
- package/dist/core/computer-use/policy.js +62 -0
- package/dist/core/computer-use/policy.js.map +1 -0
- package/dist/core/computer-use/release.generated.d.ts +31 -0
- package/dist/core/computer-use/release.generated.d.ts.map +1 -0
- package/dist/core/computer-use/release.generated.js +36 -0
- package/dist/core/computer-use/release.generated.js.map +1 -0
- package/dist/core/computer-use/runtime.d.ts +13 -0
- package/dist/core/computer-use/runtime.d.ts.map +1 -0
- package/dist/core/computer-use/runtime.js +158 -0
- package/dist/core/computer-use/runtime.js.map +1 -0
- package/dist/core/computer-use/schemas.d.ts +91 -0
- package/dist/core/computer-use/schemas.d.ts.map +1 -0
- package/dist/core/computer-use/schemas.js +71 -0
- package/dist/core/computer-use/schemas.js.map +1 -0
- package/dist/core/computer-use/windows-desktop.d.ts +3 -0
- package/dist/core/computer-use/windows-desktop.d.ts.map +1 -0
- package/dist/core/computer-use/windows-desktop.js +48 -0
- package/dist/core/computer-use/windows-desktop.js.map +1 -0
- package/dist/core/computer-use/workflow.d.ts +32 -0
- package/dist/core/computer-use/workflow.d.ts.map +1 -0
- package/dist/core/computer-use/workflow.js +341 -0
- package/dist/core/computer-use/workflow.js.map +1 -0
- package/dist/core/customize.d.ts +2 -0
- package/dist/core/customize.d.ts.map +1 -1
- package/dist/core/customize.js +3 -0
- package/dist/core/customize.js.map +1 -1
- package/dist/core/keybindings.d.ts +2 -2
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +2 -2
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/model-runtime.d.ts +0 -3
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +1 -10
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +1 -1
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/permissions.d.ts +2 -1
- package/dist/core/permissions.d.ts.map +1 -1
- package/dist/core/permissions.js +31 -11
- package/dist/core/permissions.js.map +1 -1
- package/dist/core/plan-mode.d.ts.map +1 -1
- package/dist/core/plan-mode.js +9 -5
- package/dist/core/plan-mode.js.map +1 -1
- package/dist/core/rollback.d.ts.map +1 -1
- package/dist/core/rollback.js +13 -90
- package/dist/core/rollback.js.map +1 -1
- package/dist/core/runtime-bridges.d.ts.map +1 -1
- package/dist/core/runtime-bridges.js +0 -2
- package/dist/core/runtime-bridges.js.map +1 -1
- package/dist/core/session-manager.d.ts +0 -1
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +21 -79
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-manager.d.ts +10 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +30 -0
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/subagent-cancellation.d.ts +21 -0
- package/dist/core/subagent-cancellation.d.ts.map +1 -0
- package/dist/core/subagent-cancellation.js +53 -0
- package/dist/core/subagent-cancellation.js.map +1 -0
- package/dist/core/subagent-spinner-setting.d.ts +6 -0
- package/dist/core/subagent-spinner-setting.d.ts.map +1 -0
- package/dist/core/subagent-spinner-setting.js +12 -0
- package/dist/core/subagent-spinner-setting.js.map +1 -0
- package/dist/core/subagent-spinner.d.ts +4 -0
- package/dist/core/subagent-spinner.d.ts.map +1 -0
- package/dist/core/subagent-spinner.js +6 -0
- package/dist/core/subagent-spinner.js.map +1 -0
- package/dist/dev-cli.js +0 -0
- package/dist/gateway/agent-bridge.d.ts +6 -1
- package/dist/gateway/agent-bridge.d.ts.map +1 -1
- package/dist/gateway/agent-bridge.js +23 -6
- package/dist/gateway/agent-bridge.js.map +1 -1
- package/dist/gateway/cron.d.ts +1 -1
- package/dist/gateway/cron.d.ts.map +1 -1
- package/dist/gateway/cron.js +23 -7
- package/dist/gateway/cron.js.map +1 -1
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js +12 -18
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts +4 -2
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +23 -32
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/processes-selector.d.ts +2 -3
- package/dist/modes/interactive/components/processes-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/processes-selector.js +5 -10
- package/dist/modes/interactive/components/processes-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +8 -0
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +93 -1
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +12 -0
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/extension-widget-order.d.ts +8 -0
- package/dist/modes/interactive/extension-widget-order.d.ts.map +1 -0
- package/dist/modes/interactive/extension-widget-order.js +37 -0
- package/dist/modes/interactive/extension-widget-order.js.map +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +58 -26
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/thinking-level-slash.d.ts +4 -0
- package/dist/modes/interactive/thinking-level-slash.d.ts.map +1 -0
- package/dist/modes/interactive/thinking-level-slash.js +23 -0
- package/dist/modes/interactive/thinking-level-slash.js.map +1 -0
- package/dist/node-runtime/adapter-AZMY335J.js +279 -0
- package/dist/node-runtime/{agent-session-services-IFJMSX7Z.js → agent-session-services-QANFGM2V.js} +15 -11
- package/dist/node-runtime/{builtin-extensions-LYZ3BFWQ.js → builtin-extensions-SRCYQPZ6.js} +5 -3
- package/dist/node-runtime/chunk-2IDTZAG5.js +1415 -0
- package/dist/node-runtime/chunk-3ONQTOMR.js +68 -0
- package/dist/node-runtime/{chunk-TQNSPERU.js → chunk-5SQDLSZJ.js} +1 -1
- package/dist/node-runtime/chunk-5ZH3ZFIZ.js +308 -0
- package/dist/node-runtime/{chunk-PBC2Y6GS.js → chunk-6UB6NKA3.js} +29 -72
- package/dist/node-runtime/{chunk-A2KQXUJD.js → chunk-7AFOFSDY.js} +1 -1
- package/dist/node-runtime/chunk-A3KMVBZV.js +60 -0
- package/dist/node-runtime/{chunk-N77MY65L.js → chunk-BJ6H7DPI.js} +25 -25
- package/dist/node-runtime/{chunk-PGAJ5MO5.js → chunk-BYQ2MOFI.js} +6 -6
- package/dist/node-runtime/{chunk-QH42CDX3.js → chunk-CZUBYPFP.js} +234 -124
- package/dist/node-runtime/{chunk-LZAW4ZX3.js → chunk-D466UAID.js} +34 -13
- package/dist/node-runtime/{chunk-ZKMFUD3Q.js → chunk-GT5F3OKM.js} +3 -3
- package/dist/node-runtime/chunk-H2BI7G7T.js +73 -0
- package/dist/node-runtime/{chunk-5P7PZMRU.js → chunk-HRS4HMDX.js} +1 -1
- package/dist/node-runtime/{chunk-IPA627GP.js → chunk-HXJS2PJM.js} +4 -4
- package/dist/node-runtime/chunk-JZHEUQRL.js +180 -0
- package/dist/node-runtime/chunk-LISUTZS3.js +19 -0
- package/dist/node-runtime/chunk-LOYUC2ID.js +2185 -0
- package/dist/node-runtime/{chunk-2QKLKMKC.js → chunk-LTXUQJI4.js} +1 -1
- package/dist/node-runtime/{chunk-YF63P5ZT.js → chunk-LTYWTR3V.js} +1 -426
- package/dist/node-runtime/{chunk-MKKH27PH.js → chunk-LWJXTA6Z.js} +274 -2416
- package/dist/node-runtime/chunk-MW2XJZIK.js +108 -0
- package/dist/node-runtime/{chunk-CDFZEWPU.js → chunk-N3PNL74S.js} +537 -262
- package/dist/node-runtime/{chunk-4TLO4PO2.js → chunk-U6C7VTR5.js} +7 -1401
- package/dist/node-runtime/chunk-URD2SLIT.js +1019 -0
- package/dist/node-runtime/{chunk-HQCKFM2O.js → chunk-VGYZ3APQ.js} +3 -0
- package/dist/node-runtime/{chunk-AJX357CL.js → chunk-VQ4UBWSA.js} +30 -1013
- package/dist/node-runtime/{chunk-F4VQFJI2.js → chunk-VTGEKB7R.js} +2 -2
- package/dist/node-runtime/{chunk-AD6VXAO7.js → chunk-VTPM5V35.js} +5 -100
- package/dist/node-runtime/chunk-W3SILANP.js +24 -0
- package/dist/node-runtime/{chunk-WOVTOV5P.js → chunk-XAUQOKYK.js} +421 -63
- package/dist/node-runtime/{chunk-ECD5L7YI.js → chunk-XSRCAQK2.js} +390 -16
- package/dist/node-runtime/{chunk-PCGNAY2O.js → chunk-ZOIIMEN6.js} +54 -433
- package/dist/node-runtime/{chunk-EDBJNRSM.js → chunk-ZVSORYRM.js} +1 -1
- package/dist/node-runtime/cli-runtime.js +1 -1
- package/dist/node-runtime/{command-L3LAHDIH.js → command-ZURZJDXF.js} +1 -1
- package/dist/node-runtime/{commands-RL5YBW5I.js → commands-BZGSLIP7.js} +4 -2
- package/dist/node-runtime/{customize-XEXL2DGQ.js → customize-LF5VST47.js} +1 -1
- package/dist/node-runtime/{direct-tool-executor-JVDXTO7A.js → direct-tool-executor-BSZDHIYR.js} +7 -4
- package/dist/node-runtime/{export-html-KR26FOUZ.js → export-html-E4DT6ZJQ.js} +1 -1
- package/dist/node-runtime/{gateway-X2TI5X7F.js → gateway-FWHRIBK5.js} +24 -369
- package/dist/node-runtime/index.js +49 -42
- package/dist/node-runtime/{init-NJV2T55N.js → init-DVJUAOUO.js} +4 -2
- package/dist/node-runtime/{interactive-mode-KOM35YF2.js → interactive-mode-BBASNWHN.js} +23 -17
- package/dist/node-runtime/{interactive-view-U6OILKF3.js → interactive-view-N6F4KUIT.js} +3 -5
- package/dist/node-runtime/lunr-computer-use-TJNDAMWM.js +135 -0
- package/dist/node-runtime/{lunr-cron-YJ5UHYRD.js → lunr-cron-J64I72C6.js} +7 -1
- package/dist/node-runtime/main.js +25 -20
- package/dist/node-runtime/{mcp-auth-flow-QIXHW6QN.js → mcp-auth-flow-YL6RWPYG.js} +2 -1
- package/dist/node-runtime/{package-manager-cli-TZZHJCVI.js → package-manager-cli-VMYX4Y2S.js} +10 -7
- package/dist/node-runtime/{pi-intercom-EEMBGQID.js → pi-intercom-NV2LW6X7.js} +108 -87
- package/dist/node-runtime/{pi-mcp-adapter-QFB37AVN.js → pi-mcp-adapter-JLB5YL2F.js} +31 -25
- package/dist/node-runtime/{pi-subagents-7XJ4H53P.js → pi-subagents-WEHV3W7H.js} +1321 -631
- package/dist/node-runtime/{pi-web-access-DPGAVKOA.js → pi-web-access-FN5YC5T6.js} +67 -64
- package/dist/node-runtime/{proxy-modes-HEEFK4KC.js → proxy-modes-OR7ISBXK.js} +7 -4
- package/dist/node-runtime/rpc-entry.js +25 -20
- package/dist/node-runtime/runtime-3SB5ATHQ.js +21 -0
- package/dist/node-runtime/{runtime-bridges-PPHNBFWL.js → runtime-bridges-2VQTLPOZ.js} +3 -5
- package/dist/node-runtime/{session-manager-MQNBYACL.js → session-manager-QEMZBMTM.js} +3 -5
- package/dist/node-runtime/{session-selector-5AZLJS6U.js → session-selector-URVJLOTK.js} +2 -2
- package/dist/node-runtime/{settings-manager-5LF2VQWC.js → settings-manager-3CCU326G.js} +4 -1
- package/dist/node-runtime/{src-Y7JSCK64.js → src-BPQFJR76.js} +27 -7
- package/dist/node-runtime/{subagent-executor-5RNDEPIJ.js → subagent-executor-CXKXQDHH.js} +189 -284
- package/dist/node-runtime/{update-cli-A253SZ7P.js → update-cli-NM7B4CKL.js} +4 -1
- package/dist/node-runtime/workflow-C26QCUTW.js +468 -0
- package/dist/rpc.d.ts +3 -0
- package/dist/rpc.d.ts.map +1 -0
- package/dist/rpc.js +18 -0
- package/dist/rpc.js.map +1 -0
- package/dist/startup/interactive-view.d.ts.map +1 -1
- package/dist/startup/interactive-view.js +1 -2
- package/dist/startup/interactive-view.js.map +1 -1
- package/docs/computer-use.md +242 -0
- package/docs/development.md +0 -32
- package/docs/features.md +24 -6
- package/docs/interactive-startup.md +10 -3
- package/docs/keybindings.md +5 -3
- package/docs/settings.md +3 -2
- package/docs/terminal-setup.md +1 -1
- package/docs/usage.md +1 -1
- 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/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/hidden-thinking-label.ts +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/install-lock/package-lock.json +3827 -0
- package/install-lock/package.json +18 -0
- package/native/computer-use/LICENSE.md +21 -0
- package/npm-shrinkwrap.json +3808 -0
- package/package.json +16 -10
- package/dist/builtin-extensions/lunr-settings-tools.d.ts +0 -4
- package/dist/builtin-extensions/lunr-settings-tools.d.ts.map +0 -1
- package/dist/builtin-extensions/lunr-settings-tools.js +0 -120
- package/dist/builtin-extensions/lunr-settings-tools.js.map +0 -1
- package/dist/core/settings-tools-bridge.d.ts +0 -35
- package/dist/core/settings-tools-bridge.d.ts.map +0 -1
- package/dist/core/settings-tools-bridge.js +0 -56
- package/dist/core/settings-tools-bridge.js.map +0 -1
- package/dist/node-runtime/chunk-AHSTJBIB.js +0 -64
- package/dist/startup/interactive-shell.d.ts +0 -55
- package/dist/startup/interactive-shell.d.ts.map +0 -1
- package/dist/startup/interactive-shell.js +0 -264
- package/dist/startup/interactive-shell.js.map +0 -1
- package/dist/node-runtime/{chunk-YSKSB3BJ.js → chunk-CH6OL6P2.js} +2 -2
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import { createRequire as __lunrRequire } from "node:module"; const require = __lunrRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
DefaultResourceLoader,
|
|
4
|
+
ExtensionRunner,
|
|
5
|
+
createSyntheticSourceInfo,
|
|
6
|
+
emitSessionShutdownEvent,
|
|
7
|
+
expandPromptTemplate,
|
|
8
|
+
formatSkillsForPrompt
|
|
9
|
+
} from "./chunk-BYQ2MOFI.js";
|
|
2
10
|
import {
|
|
3
11
|
DEFAULT_THINKING_LEVEL,
|
|
4
12
|
calculateContextTokens,
|
|
@@ -10,15 +18,7 @@ import {
|
|
|
10
18
|
generateBranchSummary,
|
|
11
19
|
prepareCompaction,
|
|
12
20
|
shouldCompact
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import {
|
|
15
|
-
DefaultResourceLoader,
|
|
16
|
-
ExtensionRunner,
|
|
17
|
-
createSyntheticSourceInfo,
|
|
18
|
-
emitSessionShutdownEvent,
|
|
19
|
-
expandPromptTemplate,
|
|
20
|
-
formatSkillsForPrompt
|
|
21
|
-
} from "./chunk-PGAJ5MO5.js";
|
|
21
|
+
} from "./chunk-5SQDLSZJ.js";
|
|
22
22
|
import {
|
|
23
23
|
stripFrontmatter
|
|
24
24
|
} from "./chunk-QFWG2RVL.js";
|
|
@@ -27,14 +27,7 @@ import {
|
|
|
27
27
|
createLocalBashOperations,
|
|
28
28
|
createToolDefinitionFromAgentTool,
|
|
29
29
|
wrapToolDefinition
|
|
30
|
-
} from "./chunk-
|
|
31
|
-
import {
|
|
32
|
-
gateToolCall
|
|
33
|
-
} from "./chunk-LZAW4ZX3.js";
|
|
34
|
-
import {
|
|
35
|
-
isUserInstructionsPath,
|
|
36
|
-
loadSelectedUserInstructions
|
|
37
|
-
} from "./chunk-M3LZLQW2.js";
|
|
30
|
+
} from "./chunk-GT5F3OKM.js";
|
|
38
31
|
import {
|
|
39
32
|
DEFAULT_MAX_BYTES,
|
|
40
33
|
truncateTail
|
|
@@ -47,22 +40,30 @@ import {
|
|
|
47
40
|
sanitizeBinaryOutput
|
|
48
41
|
} from "./chunk-ZCHMJ34K.js";
|
|
49
42
|
import {
|
|
50
|
-
SettingsManager
|
|
43
|
+
SettingsManager
|
|
44
|
+
} from "./chunk-VQ4UBWSA.js";
|
|
45
|
+
import {
|
|
51
46
|
require_proper_lockfile
|
|
52
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-URD2SLIT.js";
|
|
53
48
|
import {
|
|
54
49
|
CURRENT_SESSION_VERSION,
|
|
55
50
|
SessionManager,
|
|
56
51
|
getDefaultSessionDir,
|
|
57
52
|
getLatestCompactionEntry
|
|
58
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-6UB6NKA3.js";
|
|
59
54
|
import {
|
|
60
55
|
convertToLlm
|
|
61
56
|
} from "./chunk-FVDOXRUD.js";
|
|
62
57
|
import {
|
|
63
|
-
clearPlanUsageCache
|
|
64
|
-
|
|
65
|
-
|
|
58
|
+
clearPlanUsageCache
|
|
59
|
+
} from "./chunk-LTYWTR3V.js";
|
|
60
|
+
import {
|
|
61
|
+
gateToolCall
|
|
62
|
+
} from "./chunk-D466UAID.js";
|
|
63
|
+
import {
|
|
64
|
+
isUserInstructionsPath,
|
|
65
|
+
loadSelectedUserInstructions
|
|
66
|
+
} from "./chunk-M3LZLQW2.js";
|
|
66
67
|
import {
|
|
67
68
|
measureStartup,
|
|
68
69
|
time
|
|
@@ -75,6 +76,7 @@ import {
|
|
|
75
76
|
theme
|
|
76
77
|
} from "./chunk-MX3GJNXJ.js";
|
|
77
78
|
import {
|
|
79
|
+
CONFIG_DIR_NAME,
|
|
78
80
|
VERSION,
|
|
79
81
|
getAgentDir,
|
|
80
82
|
getDocsPath,
|
|
@@ -89,7 +91,7 @@ import {
|
|
|
89
91
|
} from "./chunk-BRJX2PRC.js";
|
|
90
92
|
|
|
91
93
|
// packages/coding-agent/dist/core/agent-session-services.js
|
|
92
|
-
import { join as
|
|
94
|
+
import { join as join14 } from "node:path";
|
|
93
95
|
|
|
94
96
|
// packages/coding-agent/dist/core/model-runtime.js
|
|
95
97
|
import { dirname as dirname5, join as join7 } from "node:path";
|
|
@@ -2420,15 +2422,8 @@ var ModelRuntime = class _ModelRuntime {
|
|
|
2420
2422
|
this.models = createModels({ credentials, modelsStore }), this.rebuildProviders();
|
|
2421
2423
|
}
|
|
2422
2424
|
static async create(options = {}) {
|
|
2423
|
-
return _ModelRuntime.createInternal(options, !0);
|
|
2424
|
-
}
|
|
2425
|
-
/** @internal Agent-session hydration registers extension providers before the first refresh. */
|
|
2426
|
-
static async createForAgentSession(options = {}) {
|
|
2427
|
-
return _ModelRuntime.createInternal(options, !1);
|
|
2428
|
-
}
|
|
2429
|
-
static async createInternal(options, refreshOnCreate) {
|
|
2430
2425
|
let rawStore = options.credentials ?? AuthStorage.create(options.authPath), grokHomeDisabled = options.grokHome === null || options.grokHome === void 0 && options.credentials !== void 0, grokHome = grokHomeDisabled ? void 0 : options.grokHome ?? void 0, baseStore = grokHomeDisabled ? rawStore : wrapXaiGrokCliCredentials(rawStore, { grokHome }), credentials = new RuntimeCredentials(baseStore), subscriptionManager = options.subscriptions ?? (options.credentials && !options.authPath ? SubscriptionManager.inMemory(baseStore) : SubscriptionManager.create(baseStore, options.authPath ? join7(dirname5(options.authPath), "subscriptions.json") : void 0)), modelsPath = options.modelsPath === null ? void 0 : options.modelsPath ?? join7(getAgentDir(), "models.json"), config = await ModelConfig.load(modelsPath), modelsStore = options.modelsStore ?? (modelsPath ? new FileModelsStore(options.modelsStorePath ?? join7(dirname5(modelsPath), "models-store.json")) : new InMemoryCodingAgentModelsStore()), providers = builtinProviderCatalog.builtinProviders(), catalogDir = modelsPath ? dirname5(modelsPath) : options.authPath ? dirname5(options.authPath) : void 0, runtime = new _ModelRuntime(credentials, config, modelsPath, modelsStore, providers, options.allowModelNetwork ?? process.env.PI_OFFLINE === void 0, subscriptionManager, catalogDir, grokHome);
|
|
2431
|
-
return runtime.configureRadiusProviders(), runtime.rebuildProviders(),
|
|
2426
|
+
return runtime.configureRadiusProviders(), runtime.rebuildProviders(), await runtime.refresh({ allowNetwork: !1 }), runtime;
|
|
2432
2427
|
}
|
|
2433
2428
|
configureRadiusProviders() {
|
|
2434
2429
|
this.builtins.clear();
|
|
@@ -2898,23 +2893,23 @@ async function refreshModelCandidatesForInit(runtime) {
|
|
|
2898
2893
|
}
|
|
2899
2894
|
|
|
2900
2895
|
// packages/coding-agent/dist/core/sdk.js
|
|
2901
|
-
import { join as
|
|
2896
|
+
import { join as join13 } from "node:path";
|
|
2902
2897
|
import { Agent } from "@ashx-j/lunr-agent";
|
|
2903
2898
|
import { clampThinkingLevel as clampThinkingLevel2 } from "@ashx-j/lunr-ai";
|
|
2904
2899
|
|
|
2905
2900
|
// packages/coding-agent/dist/core/agent-session.js
|
|
2906
|
-
import { existsSync as
|
|
2907
|
-
import { basename, dirname as
|
|
2901
|
+
import { existsSync as existsSync6, mkdirSync as mkdirSync6, readFileSync as readFileSync6, writeFileSync as writeFileSync6 } from "node:fs";
|
|
2902
|
+
import { basename, dirname as dirname7, join as join11, resolve as resolve2 } from "node:path";
|
|
2908
2903
|
import { clampThinkingLevel, cleanupSessionResources, getSupportedThinkingLevels, isContextOverflow, isRetryableAssistantError, modelsAreEqual, resetApiProviders, streamSimple } from "@ashx-j/lunr-ai/compat";
|
|
2909
2904
|
|
|
2910
2905
|
// packages/coding-agent/dist/utils/sleep.js
|
|
2911
2906
|
function sleep(ms, signal) {
|
|
2912
|
-
return new Promise((
|
|
2907
|
+
return new Promise((resolve4, reject) => {
|
|
2913
2908
|
if (signal?.aborted) {
|
|
2914
2909
|
reject(new Error("Aborted"));
|
|
2915
2910
|
return;
|
|
2916
2911
|
}
|
|
2917
|
-
let timeout = setTimeout(
|
|
2912
|
+
let timeout = setTimeout(resolve4, ms);
|
|
2918
2913
|
signal?.addEventListener("abort", () => {
|
|
2919
2914
|
clearTimeout(timeout), reject(new Error("Aborted"));
|
|
2920
2915
|
});
|
|
@@ -3092,6 +3087,357 @@ var ModelRegistry = class {
|
|
|
3092
3087
|
}
|
|
3093
3088
|
};
|
|
3094
3089
|
|
|
3090
|
+
// packages/coding-agent/dist/core/rollback.js
|
|
3091
|
+
import { spawnSync as spawnSync2 } from "node:child_process";
|
|
3092
|
+
import { createHash as createHash3 } from "node:crypto";
|
|
3093
|
+
import { cpSync, existsSync as existsSync5, mkdirSync as mkdirSync5, readdirSync, readFileSync as readFileSync5, renameSync as renameSync4, rmSync, unlinkSync as unlinkSync4, writeFileSync as writeFileSync5 } from "node:fs";
|
|
3094
|
+
import { homedir as homedir2 } from "node:os";
|
|
3095
|
+
import { dirname as dirname6, join as join10, normalize, resolve } from "node:path";
|
|
3096
|
+
var ROLLBACK_BASE = join10(homedir2(), ".lunr", "rollback"), contexts = /* @__PURE__ */ new Map(), lastSessionId, globalSettingsManager, warningHandler;
|
|
3097
|
+
function setRollbackWarningHandler(handler) {
|
|
3098
|
+
warningHandler = handler;
|
|
3099
|
+
}
|
|
3100
|
+
function createContext(sessionId) {
|
|
3101
|
+
return {
|
|
3102
|
+
sessionId,
|
|
3103
|
+
settingsManager: globalSettingsManager,
|
|
3104
|
+
sessionForceEnabled: !1,
|
|
3105
|
+
turns: [],
|
|
3106
|
+
currentTurnIndex: -1,
|
|
3107
|
+
repoWarningShown: !1,
|
|
3108
|
+
externalModWarningShown: !1
|
|
3109
|
+
};
|
|
3110
|
+
}
|
|
3111
|
+
function getContext(sessionId) {
|
|
3112
|
+
let sid = sessionId ?? lastSessionId ?? "default", ctx = contexts.get(sid);
|
|
3113
|
+
return ctx || (ctx = createContext(sid), contexts.set(sid, ctx)), ctx;
|
|
3114
|
+
}
|
|
3115
|
+
function initRollback(sm, sid) {
|
|
3116
|
+
globalSettingsManager = sm, lastSessionId = sid, contexts.set(sid, createContext(sid));
|
|
3117
|
+
let ctx = contexts.get(sid);
|
|
3118
|
+
ctx.settingsManager = sm, loadPersistedTurns(ctx);
|
|
3119
|
+
}
|
|
3120
|
+
function isRollbackEnabled(sessionId) {
|
|
3121
|
+
let ctx = getContext(sessionId);
|
|
3122
|
+
return (ctx.settingsManager?.getRollbackEnabled() ?? !1) || ctx.sessionForceEnabled;
|
|
3123
|
+
}
|
|
3124
|
+
function isRollbackSessionForceEnabled(sessionId) {
|
|
3125
|
+
return getContext(sessionId).sessionForceEnabled;
|
|
3126
|
+
}
|
|
3127
|
+
function enableRollbackForSession(sessionId) {
|
|
3128
|
+
getContext(sessionId).sessionForceEnabled = !0;
|
|
3129
|
+
}
|
|
3130
|
+
function disableRollbackForSession(sessionId) {
|
|
3131
|
+
getContext(sessionId).sessionForceEnabled = !1;
|
|
3132
|
+
}
|
|
3133
|
+
function pruneTurns(ctx) {
|
|
3134
|
+
let maxTurns = ctx.settingsManager?.getRollbackTurns() ?? 2;
|
|
3135
|
+
for (; ctx.turns.length > maxTurns; ) {
|
|
3136
|
+
let old = ctx.turns.shift();
|
|
3137
|
+
old && cleanupTurnFiles(ctx, old);
|
|
3138
|
+
}
|
|
3139
|
+
}
|
|
3140
|
+
function beginTurn(cwd, sessionId) {
|
|
3141
|
+
let ctx = getContext(sessionId);
|
|
3142
|
+
if (!isRollbackEnabled(ctx.sessionId))
|
|
3143
|
+
return;
|
|
3144
|
+
cwd && (ctx.lastCwd = cwd), ctx.currentTurnIndex++;
|
|
3145
|
+
let turn = { turnIndex: ctx.currentTurnIndex, cwd, files: /* @__PURE__ */ new Map() };
|
|
3146
|
+
ctx.turns.push(turn), pruneTurns(ctx), cwd && ctx.settingsManager?.getRollbackScope() === "tree" && captureTreeBaseline(ctx, cwd);
|
|
3147
|
+
}
|
|
3148
|
+
function rollbackSnapshotBeforeWrite(absPath, sessionId) {
|
|
3149
|
+
let ctx = getContext(sessionId);
|
|
3150
|
+
if (!isRollbackEnabled(ctx.sessionId))
|
|
3151
|
+
return;
|
|
3152
|
+
(ctx.currentTurnIndex < 0 || ctx.turns.length === 0) && beginTurn(ctx.lastCwd, ctx.sessionId);
|
|
3153
|
+
let turn = ctx.turns[ctx.turns.length - 1];
|
|
3154
|
+
if (turn && !turn.files.has(absPath))
|
|
3155
|
+
try {
|
|
3156
|
+
let existed = existsSync5(absPath), content;
|
|
3157
|
+
existed && (content = readFileSync5(absPath)), turn.files.set(absPath, {
|
|
3158
|
+
existed,
|
|
3159
|
+
content,
|
|
3160
|
+
createdByTool: !0
|
|
3161
|
+
}), persistSnapshot(ctx, turn, absPath);
|
|
3162
|
+
} catch {
|
|
3163
|
+
}
|
|
3164
|
+
}
|
|
3165
|
+
function captureTreeBaseline(ctx, cwd) {
|
|
3166
|
+
let turn = ctx.turns[ctx.turns.length - 1];
|
|
3167
|
+
if (!turn)
|
|
3168
|
+
return;
|
|
3169
|
+
let entries = gitPorcelain(ctx, cwd);
|
|
3170
|
+
if (entries)
|
|
3171
|
+
for (let { path } of entries) {
|
|
3172
|
+
if (!path)
|
|
3173
|
+
continue;
|
|
3174
|
+
let abs = join10(cwd, path);
|
|
3175
|
+
if (!turn.files.has(abs))
|
|
3176
|
+
try {
|
|
3177
|
+
let existed = existsSync5(abs);
|
|
3178
|
+
turn.files.set(abs, {
|
|
3179
|
+
existed,
|
|
3180
|
+
content: existed ? readFileSync5(abs) : void 0,
|
|
3181
|
+
createdByTool: !1
|
|
3182
|
+
}), persistSnapshot(ctx, turn, abs);
|
|
3183
|
+
} catch {
|
|
3184
|
+
}
|
|
3185
|
+
}
|
|
3186
|
+
}
|
|
3187
|
+
function captureTreeChanges(cwd, sessionId) {
|
|
3188
|
+
let ctx = getContext(sessionId);
|
|
3189
|
+
if (!isRollbackEnabled(ctx.sessionId) || ctx.settingsManager?.getRollbackScope() !== "tree" || ctx.currentTurnIndex < 0 || ctx.turns.length === 0)
|
|
3190
|
+
return;
|
|
3191
|
+
let turn = ctx.turns[ctx.turns.length - 1];
|
|
3192
|
+
if (!turn)
|
|
3193
|
+
return;
|
|
3194
|
+
let entries = gitPorcelain(ctx, cwd);
|
|
3195
|
+
if (entries)
|
|
3196
|
+
for (let { status, path, source } of entries) {
|
|
3197
|
+
if (!path)
|
|
3198
|
+
continue;
|
|
3199
|
+
let abs = join10(cwd, path);
|
|
3200
|
+
if (!turn.files.has(abs))
|
|
3201
|
+
try {
|
|
3202
|
+
if (status === "??" || status.includes("R")) {
|
|
3203
|
+
if (turn.files.set(abs, { existed: !1, createdByTool: !1 }), persistSnapshot(ctx, turn, abs), status.includes("R") && source) {
|
|
3204
|
+
let sourceAbs = join10(cwd, source);
|
|
3205
|
+
if (!turn.files.has(sourceAbs)) {
|
|
3206
|
+
let headSrc = spawnSync2("git", ["show", `HEAD:${source}`], {
|
|
3207
|
+
cwd,
|
|
3208
|
+
timeout: 5e3,
|
|
3209
|
+
maxBuffer: 33554432
|
|
3210
|
+
});
|
|
3211
|
+
!headSrc.error && headSrc.status === 0 && headSrc.stdout && (turn.files.set(sourceAbs, {
|
|
3212
|
+
existed: !0,
|
|
3213
|
+
content: headSrc.stdout,
|
|
3214
|
+
createdByTool: !1
|
|
3215
|
+
}), persistSnapshot(ctx, turn, sourceAbs));
|
|
3216
|
+
}
|
|
3217
|
+
}
|
|
3218
|
+
} else {
|
|
3219
|
+
let head = spawnSync2("git", ["show", `HEAD:${path}`], {
|
|
3220
|
+
cwd,
|
|
3221
|
+
timeout: 5e3,
|
|
3222
|
+
maxBuffer: 33554432
|
|
3223
|
+
});
|
|
3224
|
+
if (head.error || head.status !== 0 || !head.stdout)
|
|
3225
|
+
continue;
|
|
3226
|
+
turn.files.set(abs, {
|
|
3227
|
+
existed: !0,
|
|
3228
|
+
content: head.stdout,
|
|
3229
|
+
createdByTool: !1
|
|
3230
|
+
}), persistSnapshot(ctx, turn, abs);
|
|
3231
|
+
}
|
|
3232
|
+
} catch {
|
|
3233
|
+
}
|
|
3234
|
+
}
|
|
3235
|
+
}
|
|
3236
|
+
function gitPorcelain(ctx, cwd) {
|
|
3237
|
+
try {
|
|
3238
|
+
let result = spawnSync2("git", ["status", "--porcelain", "-z"], { cwd, encoding: "utf8", timeout: 5e3 });
|
|
3239
|
+
if (result.error || result.status !== 0) {
|
|
3240
|
+
warnOnce(ctx, "Rollback tree scope: not a git repository (or git failed) \u2014 bash side-effects won't be captured.");
|
|
3241
|
+
return;
|
|
3242
|
+
}
|
|
3243
|
+
let fields = (result.stdout ?? "").split("\0").filter((f) => f.length > 0), entries = [];
|
|
3244
|
+
for (let i = 0; i < fields.length; i++) {
|
|
3245
|
+
let field = fields[i], status = field.slice(0, 2), path = field.slice(3), source;
|
|
3246
|
+
(status.includes("R") || status.includes("C")) && (source = fields[i + 1], i++), entries.push({ status, path, source });
|
|
3247
|
+
}
|
|
3248
|
+
return entries;
|
|
3249
|
+
} catch {
|
|
3250
|
+
warnOnce(ctx, "Rollback tree scope: not a git repository (or git failed) \u2014 bash side-effects won't be captured.");
|
|
3251
|
+
return;
|
|
3252
|
+
}
|
|
3253
|
+
}
|
|
3254
|
+
function warnOnce(ctx, message) {
|
|
3255
|
+
if (!ctx.repoWarningShown) {
|
|
3256
|
+
ctx.repoWarningShown = !0;
|
|
3257
|
+
try {
|
|
3258
|
+
warningHandler?.(message);
|
|
3259
|
+
} catch {
|
|
3260
|
+
}
|
|
3261
|
+
}
|
|
3262
|
+
}
|
|
3263
|
+
function persistSnapshot(ctx, turn, absPath) {
|
|
3264
|
+
try {
|
|
3265
|
+
let snap = turn.files.get(absPath);
|
|
3266
|
+
if (!snap)
|
|
3267
|
+
return;
|
|
3268
|
+
let turnDir = getTurnDir(ctx, turn.turnIndex);
|
|
3269
|
+
mkdirSync5(turnDir, { recursive: !0 });
|
|
3270
|
+
let manifestPath = join10(turnDir, "manifest.json"), manifest = readManifest(manifestPath), entry = { existed: snap.existed, createdByTool: snap.createdByTool };
|
|
3271
|
+
if (snap.content) {
|
|
3272
|
+
let snapFile = snapFileName(absPath);
|
|
3273
|
+
writeFileSync5(join10(turnDir, snapFile), snap.content), entry.snapFile = snapFile;
|
|
3274
|
+
}
|
|
3275
|
+
manifest.files[absPath] = entry, turn.cwd && (manifest.cwd = turn.cwd), writeFileSync5(manifestPath, JSON.stringify(manifest, null, 2));
|
|
3276
|
+
} catch {
|
|
3277
|
+
}
|
|
3278
|
+
}
|
|
3279
|
+
function readManifest(path) {
|
|
3280
|
+
if (!existsSync5(path))
|
|
3281
|
+
return { files: {} };
|
|
3282
|
+
try {
|
|
3283
|
+
let parsed = JSON.parse(readFileSync5(path, "utf-8"));
|
|
3284
|
+
if (parsed && typeof parsed == "object" && !Array.isArray(parsed)) {
|
|
3285
|
+
let files = parsed.files;
|
|
3286
|
+
return {
|
|
3287
|
+
cwd: typeof parsed.cwd == "string" ? parsed.cwd : void 0,
|
|
3288
|
+
files: files && typeof files == "object" && !Array.isArray(files) ? files : {}
|
|
3289
|
+
};
|
|
3290
|
+
}
|
|
3291
|
+
return { files: {} };
|
|
3292
|
+
} catch {
|
|
3293
|
+
return { files: {} };
|
|
3294
|
+
}
|
|
3295
|
+
}
|
|
3296
|
+
function loadPersistedTurns(ctx) {
|
|
3297
|
+
try {
|
|
3298
|
+
let sessionDir = join10(ROLLBACK_BASE, ctx.sessionId);
|
|
3299
|
+
if (!existsSync5(sessionDir))
|
|
3300
|
+
return;
|
|
3301
|
+
let loaded = [];
|
|
3302
|
+
for (let dirName of readdirSync(sessionDir)) {
|
|
3303
|
+
let match = /^turn-(\d+)$/.exec(dirName);
|
|
3304
|
+
if (!match)
|
|
3305
|
+
continue;
|
|
3306
|
+
let turnIndex = Number(match[1]), turnDir = join10(sessionDir, dirName), manifest = readManifest(join10(turnDir, "manifest.json")), files = /* @__PURE__ */ new Map();
|
|
3307
|
+
for (let [absPath, meta] of Object.entries(manifest.files)) {
|
|
3308
|
+
let content;
|
|
3309
|
+
if (meta.snapFile)
|
|
3310
|
+
try {
|
|
3311
|
+
content = readFileSync5(join10(turnDir, meta.snapFile));
|
|
3312
|
+
} catch {
|
|
3313
|
+
content = void 0;
|
|
3314
|
+
}
|
|
3315
|
+
files.set(absPath, { existed: meta.existed, content, createdByTool: meta.createdByTool });
|
|
3316
|
+
}
|
|
3317
|
+
loaded.push({ turnIndex, cwd: manifest.cwd, files });
|
|
3318
|
+
}
|
|
3319
|
+
loaded.sort((a, b) => a.turnIndex - b.turnIndex), ctx.turns = loaded, ctx.currentTurnIndex = loaded.length > 0 ? loaded[loaded.length - 1].turnIndex : -1, pruneTurns(ctx);
|
|
3320
|
+
} catch {
|
|
3321
|
+
}
|
|
3322
|
+
}
|
|
3323
|
+
function getTurnDir(ctx, turnIndex) {
|
|
3324
|
+
return join10(ROLLBACK_BASE, ctx.sessionId, `turn-${turnIndex}`);
|
|
3325
|
+
}
|
|
3326
|
+
function cleanupTurnFiles(ctx, turn) {
|
|
3327
|
+
try {
|
|
3328
|
+
let dir = getTurnDir(ctx, turn.turnIndex);
|
|
3329
|
+
existsSync5(dir) && rmSync(dir, { recursive: !0, force: !0 });
|
|
3330
|
+
} catch {
|
|
3331
|
+
}
|
|
3332
|
+
}
|
|
3333
|
+
function isPathUnderRoot(absPath, root) {
|
|
3334
|
+
let normRoot = normalize(root).replace(/\\$/g, ""), normPath = normalize(absPath).replace(/\\$/g, "");
|
|
3335
|
+
return process.platform === "win32" && (normRoot = normRoot.toLowerCase(), normPath = normPath.toLowerCase()), normPath === normRoot || normPath.startsWith(`${normRoot}/`) || normPath.startsWith(`${normRoot}\\`);
|
|
3336
|
+
}
|
|
3337
|
+
function isWithinAllowedRoots(absPath, turn) {
|
|
3338
|
+
return turn.cwd ? [
|
|
3339
|
+
ROLLBACK_BASE,
|
|
3340
|
+
join10(homedir2(), CONFIG_DIR_NAME),
|
|
3341
|
+
// lunr: agent settings / cron jobs.json live under the config dir
|
|
3342
|
+
// lunr: simple-memory lives next to the lunr agent dir (~/.lunr/simple-memory)
|
|
3343
|
+
join10(dirname6(getAgentDir()), "simple-memory"),
|
|
3344
|
+
resolve(turn.cwd)
|
|
3345
|
+
].some((root) => isPathUnderRoot(absPath, root)) : !0;
|
|
3346
|
+
}
|
|
3347
|
+
function warnExternalModification(ctx, message) {
|
|
3348
|
+
if (!(ctx.externalModWarningShown || !warningHandler)) {
|
|
3349
|
+
ctx.externalModWarningShown = !0;
|
|
3350
|
+
try {
|
|
3351
|
+
warningHandler(message);
|
|
3352
|
+
} catch {
|
|
3353
|
+
}
|
|
3354
|
+
}
|
|
3355
|
+
}
|
|
3356
|
+
function peekRollbackTurnsConsumed(sessionId) {
|
|
3357
|
+
let ctx = getContext(sessionId);
|
|
3358
|
+
if (!isRollbackEnabled(ctx.sessionId) || ctx.turns.length === 0)
|
|
3359
|
+
return 0;
|
|
3360
|
+
let consumed = 0;
|
|
3361
|
+
for (let i = ctx.turns.length - 1; i >= 0 && (consumed++, !(ctx.turns[i].files.size > 0)); i--)
|
|
3362
|
+
;
|
|
3363
|
+
return consumed;
|
|
3364
|
+
}
|
|
3365
|
+
function rollbackLastTurn(sessionId) {
|
|
3366
|
+
let ctx = getContext(sessionId), empty = { restored: [], deleted: [], turnsConsumed: 0 };
|
|
3367
|
+
if (!isRollbackEnabled(ctx.sessionId))
|
|
3368
|
+
return empty;
|
|
3369
|
+
let turnsConsumed = 0;
|
|
3370
|
+
for (; ctx.turns.length > 0 && ctx.turns[ctx.turns.length - 1].files.size === 0; ) {
|
|
3371
|
+
let skipped = ctx.turns.pop();
|
|
3372
|
+
skipped && (cleanupTurnFiles(ctx, skipped), turnsConsumed++);
|
|
3373
|
+
}
|
|
3374
|
+
if (ctx.turns.length === 0)
|
|
3375
|
+
return empty;
|
|
3376
|
+
turnsConsumed++;
|
|
3377
|
+
let turn = ctx.turns[ctx.turns.length - 1], capture = ctx.settingsManager?.getRollbackCapture() ?? "copies", restored = [], deleted = [];
|
|
3378
|
+
for (let [absPath, snap] of turn.files)
|
|
3379
|
+
try {
|
|
3380
|
+
if (!isWithinAllowedRoots(absPath, turn)) {
|
|
3381
|
+
warnExternalModification(ctx, `Rollback skipped ${absPath}: outside the session working directory or lunR config dir.`);
|
|
3382
|
+
continue;
|
|
3383
|
+
}
|
|
3384
|
+
if (snap.existed && snap.content) {
|
|
3385
|
+
if (!snap.createdByTool && existsSync5(absPath) && readFileSync5(absPath).equals(snap.content))
|
|
3386
|
+
continue;
|
|
3387
|
+
mkdirSync5(dirname6(absPath), { recursive: !0 }), writeFileSync5(absPath, snap.content), restored.push(absPath);
|
|
3388
|
+
} else snap.existed || (snap.createdByTool || capture === "hybrid" || capture === "shadow-git") && existsSync5(absPath) && (unlinkSync4(absPath), deleted.push(absPath));
|
|
3389
|
+
} catch {
|
|
3390
|
+
}
|
|
3391
|
+
return cleanupTurnFiles(ctx, turn), ctx.turns.pop(), { restored, deleted, turnsConsumed };
|
|
3392
|
+
}
|
|
3393
|
+
function migrateRollbackSession(oldSessionId, newSessionId) {
|
|
3394
|
+
if (oldSessionId === newSessionId)
|
|
3395
|
+
return;
|
|
3396
|
+
let ctx = contexts.get(oldSessionId);
|
|
3397
|
+
ctx && (contexts.delete(oldSessionId), ctx.sessionId = newSessionId, contexts.set(newSessionId, ctx));
|
|
3398
|
+
try {
|
|
3399
|
+
let oldDir = join10(ROLLBACK_BASE, oldSessionId), newDir = join10(ROLLBACK_BASE, newSessionId);
|
|
3400
|
+
if (existsSync5(oldDir)) {
|
|
3401
|
+
existsSync5(newDir) && rmSync(newDir, { recursive: !0, force: !0 });
|
|
3402
|
+
try {
|
|
3403
|
+
renameSync4(oldDir, newDir);
|
|
3404
|
+
} catch {
|
|
3405
|
+
cpSync(oldDir, newDir, { recursive: !0 }), rmSync(oldDir, { recursive: !0, force: !0 });
|
|
3406
|
+
}
|
|
3407
|
+
}
|
|
3408
|
+
} catch {
|
|
3409
|
+
}
|
|
3410
|
+
}
|
|
3411
|
+
function clearRollback(sessionId) {
|
|
3412
|
+
if (sessionId === void 0) {
|
|
3413
|
+
for (let ctx2 of contexts.values()) {
|
|
3414
|
+
for (let turn of ctx2.turns)
|
|
3415
|
+
cleanupTurnFiles(ctx2, turn);
|
|
3416
|
+
try {
|
|
3417
|
+
let sessionDir = join10(ROLLBACK_BASE, ctx2.sessionId);
|
|
3418
|
+
existsSync5(sessionDir) && rmSync(sessionDir, { recursive: !0, force: !0 });
|
|
3419
|
+
} catch {
|
|
3420
|
+
}
|
|
3421
|
+
}
|
|
3422
|
+
contexts.clear();
|
|
3423
|
+
return;
|
|
3424
|
+
}
|
|
3425
|
+
let ctx = contexts.get(sessionId);
|
|
3426
|
+
if (ctx) {
|
|
3427
|
+
for (let turn of ctx.turns)
|
|
3428
|
+
cleanupTurnFiles(ctx, turn);
|
|
3429
|
+
try {
|
|
3430
|
+
let sessionDir = join10(ROLLBACK_BASE, sessionId);
|
|
3431
|
+
existsSync5(sessionDir) && rmSync(sessionDir, { recursive: !0, force: !0 });
|
|
3432
|
+
} catch {
|
|
3433
|
+
}
|
|
3434
|
+
contexts.delete(sessionId);
|
|
3435
|
+
}
|
|
3436
|
+
}
|
|
3437
|
+
function snapFileName(absPath) {
|
|
3438
|
+
return `${createHash3("sha1").update(absPath).digest("hex")}.snap`;
|
|
3439
|
+
}
|
|
3440
|
+
|
|
3095
3441
|
// packages/coding-agent/dist/core/system-prompt.js
|
|
3096
3442
|
function buildSystemPrompt(options) {
|
|
3097
3443
|
let { customPrompt, modelSlug, selectedTools, appendSystemPrompt, cwd, contextFiles: providedContextFiles, skills: providedSkills } = options, promptCwd = cwd.replace(/\\/g, "/"), appendSection = appendSystemPrompt ? `
|
|
@@ -3322,14 +3668,14 @@ var THINKING_LEVELS = ["off", "minimal", "low", "medium", "high", "xhigh", "max"
|
|
|
3322
3668
|
if (permBlock)
|
|
3323
3669
|
return { block: !0, reason: permBlock.reason };
|
|
3324
3670
|
try {
|
|
3325
|
-
let toolName = toolCall.name, argPath = args && typeof args == "object" && "path" in args ?
|
|
3671
|
+
let toolName = toolCall.name, argPath = args && typeof args == "object" && "path" in args ? resolve2(this._cwd, String(args.path)) : void 0, pathsToSnapshot = [];
|
|
3326
3672
|
if (toolName === "edit" || toolName === "write")
|
|
3327
3673
|
argPath && pathsToSnapshot.push(argPath);
|
|
3328
3674
|
else if (toolName === "memory_add" || toolName === "memory_remove")
|
|
3329
|
-
pathsToSnapshot.push(
|
|
3675
|
+
pathsToSnapshot.push(join11(dirname7(getAgentDir()), "simple-memory", "memory.md"));
|
|
3330
3676
|
else if (toolName === "cron" && args && typeof args == "object") {
|
|
3331
3677
|
let action = String(args.action ?? "");
|
|
3332
|
-
(action === "create" || action === "update" || action === "remove") && pathsToSnapshot.push(
|
|
3678
|
+
(action === "create" || action === "update" || action === "remove") && pathsToSnapshot.push(join11(getAgentDir(), "cron", "jobs.json"));
|
|
3333
3679
|
}
|
|
3334
3680
|
for (let p of pathsToSnapshot)
|
|
3335
3681
|
rollbackSnapshotBeforeWrite(p, this.sessionId);
|
|
@@ -3411,15 +3757,15 @@ var THINKING_LEVELS = ["off", "minimal", "low", "medium", "high", "xhigh", "max"
|
|
|
3411
3757
|
});
|
|
3412
3758
|
}
|
|
3413
3759
|
_getIdleWaitPromise() {
|
|
3414
|
-
return this._idleWaitPromise || (this._idleWaitPromise = new Promise((
|
|
3415
|
-
this._resolveIdleWait =
|
|
3760
|
+
return this._idleWaitPromise || (this._idleWaitPromise = new Promise((resolve4) => {
|
|
3761
|
+
this._resolveIdleWait = resolve4;
|
|
3416
3762
|
})), this._idleWaitPromise;
|
|
3417
3763
|
}
|
|
3418
3764
|
_resolveIdleWaitIfIdle() {
|
|
3419
3765
|
if (this._isAgentRunActive || !this._resolveIdleWait)
|
|
3420
3766
|
return;
|
|
3421
|
-
let
|
|
3422
|
-
this._idleWaitPromise = void 0, this._resolveIdleWait = void 0,
|
|
3767
|
+
let resolve4 = this._resolveIdleWait;
|
|
3768
|
+
this._idleWaitPromise = void 0, this._resolveIdleWait = void 0, resolve4();
|
|
3423
3769
|
}
|
|
3424
3770
|
async _emitAgentSettled() {
|
|
3425
3771
|
this._isAgentRunActive = !1;
|
|
@@ -3899,7 +4245,7 @@ ${this._systemPromptAppend}` : prompt;
|
|
|
3899
4245
|
if (!skill)
|
|
3900
4246
|
return text;
|
|
3901
4247
|
try {
|
|
3902
|
-
let content =
|
|
4248
|
+
let content = readFileSync6(skill.filePath, "utf-8"), body = stripFrontmatter(content).trim(), skillBlock = `<skill name="${skill.name}" location="${skill.filePath}">
|
|
3903
4249
|
References are relative to ${skill.baseDir}.
|
|
3904
4250
|
|
|
3905
4251
|
${body}
|
|
@@ -4533,7 +4879,7 @@ ${args}` : skillBlock;
|
|
|
4533
4879
|
}
|
|
4534
4880
|
buildExtensionResourcePaths(entries) {
|
|
4535
4881
|
return entries.map((entry) => {
|
|
4536
|
-
let source = this.getExtensionSourceLabel(entry.extensionPath), baseDir = entry.extensionPath.startsWith("<") ? void 0 :
|
|
4882
|
+
let source = this.getExtensionSourceLabel(entry.extensionPath), baseDir = entry.extensionPath.startsWith("<") ? void 0 : dirname7(entry.extensionPath);
|
|
4537
4883
|
return {
|
|
4538
4884
|
path: entry.path,
|
|
4539
4885
|
metadata: {
|
|
@@ -5095,7 +5441,7 @@ ${command}` : command;
|
|
|
5095
5441
|
*/
|
|
5096
5442
|
async exportToHtml(outputPath) {
|
|
5097
5443
|
let [{ exportSessionToHtml }, { createToolHtmlRenderer }] = await Promise.all([
|
|
5098
|
-
import("./export-html-
|
|
5444
|
+
import("./export-html-E4DT6ZJQ.js"),
|
|
5099
5445
|
import("./tool-renderer-MV5O452K.js")
|
|
5100
5446
|
]), configuredThemeName = this.settingsManager.getTheme(), themeName = configuredThemeName && getThemeByName(configuredThemeName) ? configuredThemeName : void 0, toolRenderer = createToolHtmlRenderer({
|
|
5101
5447
|
getToolDefinition: (name) => this.getToolDefinition(name),
|
|
@@ -5115,8 +5461,8 @@ ${command}` : command;
|
|
|
5115
5461
|
* @returns The resolved output file path.
|
|
5116
5462
|
*/
|
|
5117
5463
|
exportToJsonl(outputPath) {
|
|
5118
|
-
let filePath = resolvePath(outputPath ?? `session-${(/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-")}.jsonl`, process.cwd()), dir =
|
|
5119
|
-
|
|
5464
|
+
let filePath = resolvePath(outputPath ?? `session-${(/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-")}.jsonl`, process.cwd()), dir = dirname7(filePath);
|
|
5465
|
+
existsSync6(dir) || mkdirSync6(dir, { recursive: !0 });
|
|
5120
5466
|
let header = {
|
|
5121
5467
|
type: "session",
|
|
5122
5468
|
version: CURRENT_SESSION_VERSION,
|
|
@@ -5128,7 +5474,7 @@ ${command}` : command;
|
|
|
5128
5474
|
let linear = { ...entry, parentId: prevId };
|
|
5129
5475
|
lines.push(JSON.stringify(linear)), prevId = entry.id;
|
|
5130
5476
|
}
|
|
5131
|
-
return
|
|
5477
|
+
return writeFileSync6(filePath, `${lines.join(`
|
|
5132
5478
|
`)}
|
|
5133
5479
|
`), filePath;
|
|
5134
5480
|
}
|
|
@@ -5198,17 +5544,17 @@ function mergeProviderAttributionHeaders(model, _settingsManager, sessionId, ...
|
|
|
5198
5544
|
}
|
|
5199
5545
|
|
|
5200
5546
|
// packages/coding-agent/dist/core/agent-session-runtime.js
|
|
5201
|
-
import { copyFileSync, existsSync as
|
|
5202
|
-
import { basename as basename2, join as
|
|
5547
|
+
import { copyFileSync, existsSync as existsSync8, mkdirSync as mkdirSync7 } from "node:fs";
|
|
5548
|
+
import { basename as basename2, join as join12, resolve as resolve3 } from "node:path";
|
|
5203
5549
|
|
|
5204
5550
|
// packages/coding-agent/dist/core/session-cwd.js
|
|
5205
|
-
import { existsSync as
|
|
5551
|
+
import { existsSync as existsSync7 } from "node:fs";
|
|
5206
5552
|
function getMissingSessionCwdIssue(sessionManager, fallbackCwd) {
|
|
5207
5553
|
let sessionFile = sessionManager.getSessionFile();
|
|
5208
5554
|
if (!sessionFile)
|
|
5209
5555
|
return;
|
|
5210
5556
|
let sessionCwd = sessionManager.getCwd();
|
|
5211
|
-
if (!(!sessionCwd ||
|
|
5557
|
+
if (!(!sessionCwd || existsSync7(sessionCwd)))
|
|
5212
5558
|
return {
|
|
5213
5559
|
sessionFile,
|
|
5214
5560
|
sessionCwd,
|
|
@@ -5374,7 +5720,7 @@ var AgentSessionRuntime = class {
|
|
|
5374
5720
|
sessionStartEvent: { type: "session_start", reason: "fork", previousSessionFile }
|
|
5375
5721
|
})), await this.finishSessionReplacement(options?.withSession), { cancelled: !1, selectedText };
|
|
5376
5722
|
}
|
|
5377
|
-
if (!
|
|
5723
|
+
if (!existsSync8(currentSessionFile))
|
|
5378
5724
|
throw new Error("This session has not been saved yet. Wait for the first assistant response before cloning or forking it.");
|
|
5379
5725
|
let sessionManager2 = SessionManager.open(currentSessionFile, sessionDir);
|
|
5380
5726
|
if (!sessionManager2.createBranchedSession(targetLeafId))
|
|
@@ -5403,15 +5749,15 @@ var AgentSessionRuntime = class {
|
|
|
5403
5749
|
*/
|
|
5404
5750
|
async importFromJsonl(inputPath, cwdOverride) {
|
|
5405
5751
|
let resolvedPath = resolvePath(inputPath);
|
|
5406
|
-
if (!
|
|
5752
|
+
if (!existsSync8(resolvedPath))
|
|
5407
5753
|
throw new SessionImportFileNotFoundError(resolvedPath);
|
|
5408
5754
|
let sessionDir = this.session.sessionManager.getSessionDir();
|
|
5409
|
-
|
|
5410
|
-
let destinationPath =
|
|
5755
|
+
existsSync8(sessionDir) || mkdirSync7(sessionDir, { recursive: !0 });
|
|
5756
|
+
let destinationPath = join12(sessionDir, basename2(resolvedPath)), beforeResult = await this.emitBeforeSwitch("resume", destinationPath);
|
|
5411
5757
|
if (beforeResult.cancelled)
|
|
5412
5758
|
return beforeResult;
|
|
5413
5759
|
let previousSessionFile = this.session.sessionFile;
|
|
5414
|
-
|
|
5760
|
+
resolve3(destinationPath) !== resolvedPath && copyFileSync(resolvedPath, destinationPath);
|
|
5415
5761
|
let sessionManager = SessionManager.open(destinationPath, sessionDir, cwdOverride);
|
|
5416
5762
|
return assertSessionCwdExists(sessionManager, this.cwd), await this.teardownCurrent("resume", sessionManager.getSessionFile()), this.apply(await this.createRuntime({
|
|
5417
5763
|
cwd: sessionManager.getCwd(),
|
|
@@ -5438,7 +5784,7 @@ function getDefaultAgentDir() {
|
|
|
5438
5784
|
return getAgentDir();
|
|
5439
5785
|
}
|
|
5440
5786
|
async function createAgentSession(options = {}) {
|
|
5441
|
-
let cwd = resolvePath(options.cwd ?? options.sessionManager?.getCwd() ?? process.cwd()), agentDir = options.agentDir ? resolvePath(options.agentDir) : getDefaultAgentDir(), resourceLoader = options.resourceLoader, authPath = options.agentDir ?
|
|
5787
|
+
let cwd = resolvePath(options.cwd ?? options.sessionManager?.getCwd() ?? process.cwd()), agentDir = options.agentDir ? resolvePath(options.agentDir) : getDefaultAgentDir(), resourceLoader = options.resourceLoader, authPath = options.agentDir ? join13(agentDir, "auth.json") : void 0, modelsPath = options.agentDir ? join13(agentDir, "models.json") : void 0, modelRuntime = options.modelRuntime ?? await ModelRuntime.create({ authPath, modelsPath }), settingsManager = options.settingsManager ?? SettingsManager.create(cwd, agentDir), sessionManager = options.sessionManager ?? SessionManager.create(cwd, getDefaultSessionDir(cwd, agentDir));
|
|
5442
5788
|
resourceLoader || (resourceLoader = new DefaultResourceLoader({ cwd, agentDir, settingsManager }), await resourceLoader.reload(), time("resourceLoader.reload"));
|
|
5443
5789
|
let existingSession = sessionManager.buildSessionContext(), hasExistingSession = existingSession.messages.length > 0, hasThinkingEntry = sessionManager.getBranch().some((entry) => entry.type === "thinking_level_change"), model = options.model, modelFallbackMessage;
|
|
5444
5790
|
if (!model && hasExistingSession && existingSession.model) {
|
|
@@ -5576,9 +5922,9 @@ function applyExtensionFlagValues(resourceLoader, extensionFlagValues) {
|
|
|
5576
5922
|
}), diagnostics;
|
|
5577
5923
|
}
|
|
5578
5924
|
async function createAgentSessionServices(options) {
|
|
5579
|
-
let cwd = resolvePath(options.cwd), agentDir = options.agentDir ? resolvePath(options.agentDir) : getAgentDir(), modelRuntime = options.modelRuntime ?? await ModelRuntime.
|
|
5580
|
-
authPath:
|
|
5581
|
-
modelsPath:
|
|
5925
|
+
let cwd = resolvePath(options.cwd), agentDir = options.agentDir ? resolvePath(options.agentDir) : getAgentDir(), modelRuntime = options.modelRuntime ?? await ModelRuntime.create({
|
|
5926
|
+
authPath: join14(agentDir, "auth.json"),
|
|
5927
|
+
modelsPath: join14(agentDir, "models.json")
|
|
5582
5928
|
});
|
|
5583
5929
|
time("ModelRuntime.create");
|
|
5584
5930
|
let settingsManager = options.settingsManager ?? SettingsManager.create(cwd, agentDir), resourceLoader = new DefaultResourceLoader({
|
|
@@ -5639,6 +5985,18 @@ export {
|
|
|
5639
5985
|
wrapRegisteredTool,
|
|
5640
5986
|
wrapRegisteredTools,
|
|
5641
5987
|
ModelRegistry,
|
|
5988
|
+
setRollbackWarningHandler,
|
|
5989
|
+
initRollback,
|
|
5990
|
+
isRollbackEnabled,
|
|
5991
|
+
isRollbackSessionForceEnabled,
|
|
5992
|
+
enableRollbackForSession,
|
|
5993
|
+
disableRollbackForSession,
|
|
5994
|
+
beginTurn,
|
|
5995
|
+
captureTreeChanges,
|
|
5996
|
+
peekRollbackTurnsConsumed,
|
|
5997
|
+
rollbackLastTurn,
|
|
5998
|
+
migrateRollbackSession,
|
|
5999
|
+
clearRollback,
|
|
5642
6000
|
parseSkillBlock,
|
|
5643
6001
|
AgentSession,
|
|
5644
6002
|
getMissingSessionCwdIssue,
|