@ashx-j/lunr-dev 0.2.19-dev.10.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 +36 -1
- package/README.md +2 -2
- package/dist/builtin-extensions/index.d.ts.map +1 -1
- package/dist/builtin-extensions/index.js +0 -2
- package/dist/builtin-extensions/index.js.map +1 -1
- package/dist/builtin-extensions/lunr-computer-use.d.ts.map +1 -1
- package/dist/builtin-extensions/lunr-computer-use.js +15 -14
- package/dist/builtin-extensions/lunr-computer-use.js.map +1 -1
- 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-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 +128 -57
- 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 +38 -13
- 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.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.js +2 -1
- 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/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 +71 -25
- 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/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 +46 -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 +407 -450
- 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/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/policy.d.ts.map +1 -1
- package/dist/core/computer-use/policy.js +2 -6
- package/dist/core/computer-use/policy.js.map +1 -1
- package/dist/core/computer-use/schemas.d.ts +13 -10
- package/dist/core/computer-use/schemas.d.ts.map +1 -1
- package/dist/core/computer-use/schemas.js +26 -35
- package/dist/core/computer-use/schemas.js.map +1 -1
- package/dist/core/computer-use/workflow.d.ts +16 -8
- package/dist/core/computer-use/workflow.d.ts.map +1 -1
- package/dist/core/computer-use/workflow.js +271 -260
- package/dist/core/computer-use/workflow.js.map +1 -1
- 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/permissions.d.ts +1 -0
- package/dist/core/permissions.d.ts.map +1 -1
- package/dist/core/permissions.js +8 -4
- package/dist/core/permissions.js.map +1 -1
- package/dist/core/plan-mode.d.ts.map +1 -1
- package/dist/core/plan-mode.js +0 -5
- package/dist/core/plan-mode.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/settings-manager.d.ts +4 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +11 -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/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/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 +73 -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 +44 -22
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/node-runtime/{agent-session-services-RSGP5GDN.js → agent-session-services-QANFGM2V.js} +14 -13
- package/dist/node-runtime/{builtin-extensions-7STLFW3A.js → builtin-extensions-SRCYQPZ6.js} +4 -3
- package/dist/node-runtime/{chunk-5OLJGVCB.js → chunk-3ONQTOMR.js} +2 -2
- package/dist/node-runtime/chunk-5ZH3ZFIZ.js +308 -0
- package/dist/node-runtime/{chunk-4SJWFTUP.js → chunk-7NBZ5P7I.js} +1 -1
- package/dist/node-runtime/chunk-A3KMVBZV.js +60 -0
- package/dist/node-runtime/{chunk-FLYMHKCS.js → chunk-BJ6H7DPI.js} +25 -25
- package/dist/node-runtime/{chunk-T5GM5BFH.js → chunk-BYQ2MOFI.js} +6 -6
- package/dist/node-runtime/{chunk-W7S2REEG.js → chunk-CZUBYPFP.js} +157 -74
- package/dist/node-runtime/{chunk-ZRDIMBEQ.js → chunk-D466UAID.js} +9 -6
- package/dist/node-runtime/{chunk-K72NVGUB.js → chunk-GT5F3OKM.js} +1 -1
- package/dist/node-runtime/chunk-H2BI7G7T.js +73 -0
- package/dist/node-runtime/{chunk-ISQDQIZN.js → chunk-HXJS2PJM.js} +2 -2
- package/dist/node-runtime/chunk-LISUTZS3.js +19 -0
- package/dist/node-runtime/{chunk-BKAZ6BKX.js → chunk-LOYUC2ID.js} +7 -7
- package/dist/node-runtime/{chunk-OTT6JMPU.js → chunk-LTYWTR3V.js} +1 -369
- package/dist/node-runtime/{chunk-5Q45AVQG.js → chunk-MW2XJZIK.js} +1 -1
- package/dist/node-runtime/{chunk-MUMMMTW4.js → chunk-N3PNL74S.js} +536 -265
- package/dist/node-runtime/{chunk-HQCKFM2O.js → chunk-VGYZ3APQ.js} +3 -0
- package/dist/node-runtime/{chunk-5NWQCSKR.js → chunk-VQ4UBWSA.js} +11 -1
- package/dist/node-runtime/{chunk-6SPPH4FY.js → chunk-VTGEKB7R.js} +4 -4
- package/dist/node-runtime/chunk-W3SILANP.js +24 -0
- package/dist/node-runtime/{chunk-J7QGQD45.js → chunk-WJVFOIB5.js} +1 -1
- package/dist/node-runtime/{chunk-JT6YCS5B.js → chunk-XAUQOKYK.js} +408 -45
- package/dist/node-runtime/{chunk-LCACDWHJ.js → chunk-XSRCAQK2.js} +13 -13
- package/dist/node-runtime/{chunk-TAP7QTUT.js → chunk-ZOIIMEN6.js} +24 -425
- package/dist/node-runtime/{chunk-MGSB2C3M.js → chunk-ZVSORYRM.js} +1 -1
- package/dist/node-runtime/{command-6UXQ6XZN.js → command-ZURZJDXF.js} +1 -1
- package/dist/node-runtime/{commands-LGR5VT5X.js → commands-BZGSLIP7.js} +3 -3
- package/dist/node-runtime/{customize-XEXL2DGQ.js → customize-LF5VST47.js} +1 -1
- package/dist/node-runtime/{direct-tool-executor-TDJS7TBD.js → direct-tool-executor-BSZDHIYR.js} +4 -4
- package/dist/node-runtime/{extract-IUCVZCWC.js → extract-XLQSJN4V.js} +2 -2
- package/dist/node-runtime/{gateway-3OLC4GQN.js → gateway-FWHRIBK5.js} +9 -9
- package/dist/node-runtime/{gemini-search-NCIDF7NE.js → gemini-search-U7SUMPQA.js} +1 -1
- package/dist/node-runtime/{gemini-url-context-OKIN7AIP.js → gemini-url-context-PXWCBQHK.js} +2 -2
- package/dist/node-runtime/index.js +34 -31
- package/dist/node-runtime/{init-EKE277AG.js → init-DVJUAOUO.js} +3 -3
- package/dist/node-runtime/{interactive-mode-S5M26CQ7.js → interactive-mode-BBASNWHN.js} +18 -15
- package/dist/node-runtime/lunr-computer-use-TJNDAMWM.js +135 -0
- package/dist/node-runtime/{lunr-cron-KKBOGAEF.js → lunr-cron-J64I72C6.js} +5 -5
- package/dist/node-runtime/main.js +22 -20
- package/dist/node-runtime/{package-manager-cli-C4EJOO5Q.js → package-manager-cli-VMYX4Y2S.js} +8 -7
- package/dist/node-runtime/{pi-intercom-EEMBGQID.js → pi-intercom-NV2LW6X7.js} +108 -87
- package/dist/node-runtime/{pi-mcp-adapter-DPTJGAAL.js → pi-mcp-adapter-JLB5YL2F.js} +6 -6
- package/dist/node-runtime/{pi-subagents-VKCLYIBY.js → pi-subagents-WEHV3W7H.js} +1267 -604
- package/dist/node-runtime/{pi-web-access-BV6DSZOP.js → pi-web-access-FN5YC5T6.js} +5 -5
- package/dist/node-runtime/{proxy-modes-R64LU6WZ.js → proxy-modes-OR7ISBXK.js} +7 -7
- package/dist/node-runtime/rpc-entry.js +22 -20
- package/dist/node-runtime/{runtime-bridges-UJ5WJJLN.js → runtime-bridges-2VQTLPOZ.js} +3 -5
- package/dist/node-runtime/{settings-manager-K6IPIQTI.js → settings-manager-3CCU326G.js} +3 -2
- package/dist/node-runtime/{subagent-executor-EFLTO32A.js → subagent-executor-CXKXQDHH.js} +186 -299
- package/dist/node-runtime/{update-cli-I6OVDRPL.js → update-cli-NM7B4CKL.js} +3 -2
- package/dist/node-runtime/{video-extract-ETA5RA7U.js → video-extract-OYT5WKS5.js} +2 -2
- package/dist/node-runtime/workflow-C26QCUTW.js +468 -0
- package/dist/node-runtime/{youtube-extract-SRVGNN26.js → youtube-extract-TQYKGFGS.js} +2 -2
- package/docs/computer-use.md +233 -268
- package/docs/features.md +22 -4
- package/docs/keybindings.md +3 -1
- package/docs/settings.md +3 -2
- 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/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 +24 -24
- package/install-lock/package.json +2 -2
- package/npm-shrinkwrap.json +21 -21
- package/package.json +7 -7
- 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-EH2LJQPM.js +0 -64
- package/dist/node-runtime/image-resize-6ZPBFMWW.js +0 -11
- package/dist/node-runtime/lunr-computer-use-4X3KUNF4.js +0 -206
- package/dist/node-runtime/workflow-SA34S4VX.js +0 -325
- package/dist/node-runtime/{chunk-EHMBW7FA.js → chunk-VSELYKWU.js} +3 -3
- package/dist/node-runtime/{chunk-ZSEZY3II.js → chunk-VTPM5V35.js} +0 -0
- package/dist/node-runtime/{src-GPFAU3N6.js → src-BPQFJR76.js} +3 -3
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
emitSessionShutdownEvent,
|
|
7
7
|
expandPromptTemplate,
|
|
8
8
|
formatSkillsForPrompt
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-BYQ2MOFI.js";
|
|
10
10
|
import {
|
|
11
11
|
DEFAULT_THINKING_LEVEL,
|
|
12
12
|
calculateContextTokens,
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
createLocalBashOperations,
|
|
28
28
|
createToolDefinitionFromAgentTool,
|
|
29
29
|
wrapToolDefinition
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-GT5F3OKM.js";
|
|
31
31
|
import {
|
|
32
32
|
DEFAULT_MAX_BYTES,
|
|
33
33
|
truncateTail
|
|
@@ -39,16 +39,9 @@ import {
|
|
|
39
39
|
getShellConfig,
|
|
40
40
|
sanitizeBinaryOutput
|
|
41
41
|
} from "./chunk-ZCHMJ34K.js";
|
|
42
|
-
import {
|
|
43
|
-
gateToolCall
|
|
44
|
-
} from "./chunk-ZRDIMBEQ.js";
|
|
45
|
-
import {
|
|
46
|
-
isUserInstructionsPath,
|
|
47
|
-
loadSelectedUserInstructions
|
|
48
|
-
} from "./chunk-M3LZLQW2.js";
|
|
49
42
|
import {
|
|
50
43
|
SettingsManager
|
|
51
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-VQ4UBWSA.js";
|
|
52
45
|
import {
|
|
53
46
|
require_proper_lockfile
|
|
54
47
|
} from "./chunk-URD2SLIT.js";
|
|
@@ -62,21 +55,28 @@ import {
|
|
|
62
55
|
convertToLlm
|
|
63
56
|
} from "./chunk-FVDOXRUD.js";
|
|
64
57
|
import {
|
|
65
|
-
clearPlanUsageCache
|
|
66
|
-
|
|
67
|
-
} from "./chunk-OTT6JMPU.js";
|
|
58
|
+
clearPlanUsageCache
|
|
59
|
+
} from "./chunk-LTYWTR3V.js";
|
|
68
60
|
import {
|
|
69
|
-
|
|
70
|
-
} from "./chunk-
|
|
61
|
+
gateToolCall
|
|
62
|
+
} from "./chunk-D466UAID.js";
|
|
63
|
+
import {
|
|
64
|
+
isUserInstructionsPath,
|
|
65
|
+
loadSelectedUserInstructions
|
|
66
|
+
} from "./chunk-M3LZLQW2.js";
|
|
71
67
|
import {
|
|
72
68
|
measureStartup,
|
|
73
69
|
time
|
|
74
70
|
} from "./chunk-PVCDKGR6.js";
|
|
71
|
+
import {
|
|
72
|
+
MEMORY_TOOL_NAMES
|
|
73
|
+
} from "./chunk-AY6CAJSL.js";
|
|
75
74
|
import {
|
|
76
75
|
getThemeByName,
|
|
77
76
|
theme
|
|
78
77
|
} from "./chunk-MX3GJNXJ.js";
|
|
79
78
|
import {
|
|
79
|
+
CONFIG_DIR_NAME,
|
|
80
80
|
VERSION,
|
|
81
81
|
getAgentDir,
|
|
82
82
|
getDocsPath,
|
|
@@ -91,7 +91,7 @@ import {
|
|
|
91
91
|
} from "./chunk-BRJX2PRC.js";
|
|
92
92
|
|
|
93
93
|
// packages/coding-agent/dist/core/agent-session-services.js
|
|
94
|
-
import { join as
|
|
94
|
+
import { join as join14 } from "node:path";
|
|
95
95
|
|
|
96
96
|
// packages/coding-agent/dist/core/model-runtime.js
|
|
97
97
|
import { dirname as dirname5, join as join7 } from "node:path";
|
|
@@ -2893,23 +2893,23 @@ async function refreshModelCandidatesForInit(runtime) {
|
|
|
2893
2893
|
}
|
|
2894
2894
|
|
|
2895
2895
|
// packages/coding-agent/dist/core/sdk.js
|
|
2896
|
-
import { join as
|
|
2896
|
+
import { join as join13 } from "node:path";
|
|
2897
2897
|
import { Agent } from "@ashx-j/lunr-agent";
|
|
2898
2898
|
import { clampThinkingLevel as clampThinkingLevel2 } from "@ashx-j/lunr-ai";
|
|
2899
2899
|
|
|
2900
2900
|
// packages/coding-agent/dist/core/agent-session.js
|
|
2901
|
-
import { existsSync as
|
|
2902
|
-
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";
|
|
2903
2903
|
import { clampThinkingLevel, cleanupSessionResources, getSupportedThinkingLevels, isContextOverflow, isRetryableAssistantError, modelsAreEqual, resetApiProviders, streamSimple } from "@ashx-j/lunr-ai/compat";
|
|
2904
2904
|
|
|
2905
2905
|
// packages/coding-agent/dist/utils/sleep.js
|
|
2906
2906
|
function sleep(ms, signal) {
|
|
2907
|
-
return new Promise((
|
|
2907
|
+
return new Promise((resolve4, reject) => {
|
|
2908
2908
|
if (signal?.aborted) {
|
|
2909
2909
|
reject(new Error("Aborted"));
|
|
2910
2910
|
return;
|
|
2911
2911
|
}
|
|
2912
|
-
let timeout = setTimeout(
|
|
2912
|
+
let timeout = setTimeout(resolve4, ms);
|
|
2913
2913
|
signal?.addEventListener("abort", () => {
|
|
2914
2914
|
clearTimeout(timeout), reject(new Error("Aborted"));
|
|
2915
2915
|
});
|
|
@@ -3087,6 +3087,357 @@ var ModelRegistry = class {
|
|
|
3087
3087
|
}
|
|
3088
3088
|
};
|
|
3089
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
|
+
|
|
3090
3441
|
// packages/coding-agent/dist/core/system-prompt.js
|
|
3091
3442
|
function buildSystemPrompt(options) {
|
|
3092
3443
|
let { customPrompt, modelSlug, selectedTools, appendSystemPrompt, cwd, contextFiles: providedContextFiles, skills: providedSkills } = options, promptCwd = cwd.replace(/\\/g, "/"), appendSection = appendSystemPrompt ? `
|
|
@@ -3317,14 +3668,14 @@ var THINKING_LEVELS = ["off", "minimal", "low", "medium", "high", "xhigh", "max"
|
|
|
3317
3668
|
if (permBlock)
|
|
3318
3669
|
return { block: !0, reason: permBlock.reason };
|
|
3319
3670
|
try {
|
|
3320
|
-
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 = [];
|
|
3321
3672
|
if (toolName === "edit" || toolName === "write")
|
|
3322
3673
|
argPath && pathsToSnapshot.push(argPath);
|
|
3323
3674
|
else if (toolName === "memory_add" || toolName === "memory_remove")
|
|
3324
|
-
pathsToSnapshot.push(
|
|
3675
|
+
pathsToSnapshot.push(join11(dirname7(getAgentDir()), "simple-memory", "memory.md"));
|
|
3325
3676
|
else if (toolName === "cron" && args && typeof args == "object") {
|
|
3326
3677
|
let action = String(args.action ?? "");
|
|
3327
|
-
(action === "create" || action === "update" || action === "remove") && pathsToSnapshot.push(
|
|
3678
|
+
(action === "create" || action === "update" || action === "remove") && pathsToSnapshot.push(join11(getAgentDir(), "cron", "jobs.json"));
|
|
3328
3679
|
}
|
|
3329
3680
|
for (let p of pathsToSnapshot)
|
|
3330
3681
|
rollbackSnapshotBeforeWrite(p, this.sessionId);
|
|
@@ -3406,15 +3757,15 @@ var THINKING_LEVELS = ["off", "minimal", "low", "medium", "high", "xhigh", "max"
|
|
|
3406
3757
|
});
|
|
3407
3758
|
}
|
|
3408
3759
|
_getIdleWaitPromise() {
|
|
3409
|
-
return this._idleWaitPromise || (this._idleWaitPromise = new Promise((
|
|
3410
|
-
this._resolveIdleWait =
|
|
3760
|
+
return this._idleWaitPromise || (this._idleWaitPromise = new Promise((resolve4) => {
|
|
3761
|
+
this._resolveIdleWait = resolve4;
|
|
3411
3762
|
})), this._idleWaitPromise;
|
|
3412
3763
|
}
|
|
3413
3764
|
_resolveIdleWaitIfIdle() {
|
|
3414
3765
|
if (this._isAgentRunActive || !this._resolveIdleWait)
|
|
3415
3766
|
return;
|
|
3416
|
-
let
|
|
3417
|
-
this._idleWaitPromise = void 0, this._resolveIdleWait = void 0,
|
|
3767
|
+
let resolve4 = this._resolveIdleWait;
|
|
3768
|
+
this._idleWaitPromise = void 0, this._resolveIdleWait = void 0, resolve4();
|
|
3418
3769
|
}
|
|
3419
3770
|
async _emitAgentSettled() {
|
|
3420
3771
|
this._isAgentRunActive = !1;
|
|
@@ -3894,7 +4245,7 @@ ${this._systemPromptAppend}` : prompt;
|
|
|
3894
4245
|
if (!skill)
|
|
3895
4246
|
return text;
|
|
3896
4247
|
try {
|
|
3897
|
-
let content =
|
|
4248
|
+
let content = readFileSync6(skill.filePath, "utf-8"), body = stripFrontmatter(content).trim(), skillBlock = `<skill name="${skill.name}" location="${skill.filePath}">
|
|
3898
4249
|
References are relative to ${skill.baseDir}.
|
|
3899
4250
|
|
|
3900
4251
|
${body}
|
|
@@ -4528,7 +4879,7 @@ ${args}` : skillBlock;
|
|
|
4528
4879
|
}
|
|
4529
4880
|
buildExtensionResourcePaths(entries) {
|
|
4530
4881
|
return entries.map((entry) => {
|
|
4531
|
-
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);
|
|
4532
4883
|
return {
|
|
4533
4884
|
path: entry.path,
|
|
4534
4885
|
metadata: {
|
|
@@ -5110,8 +5461,8 @@ ${command}` : command;
|
|
|
5110
5461
|
* @returns The resolved output file path.
|
|
5111
5462
|
*/
|
|
5112
5463
|
exportToJsonl(outputPath) {
|
|
5113
|
-
let filePath = resolvePath(outputPath ?? `session-${(/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-")}.jsonl`, process.cwd()), dir =
|
|
5114
|
-
|
|
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 });
|
|
5115
5466
|
let header = {
|
|
5116
5467
|
type: "session",
|
|
5117
5468
|
version: CURRENT_SESSION_VERSION,
|
|
@@ -5123,7 +5474,7 @@ ${command}` : command;
|
|
|
5123
5474
|
let linear = { ...entry, parentId: prevId };
|
|
5124
5475
|
lines.push(JSON.stringify(linear)), prevId = entry.id;
|
|
5125
5476
|
}
|
|
5126
|
-
return
|
|
5477
|
+
return writeFileSync6(filePath, `${lines.join(`
|
|
5127
5478
|
`)}
|
|
5128
5479
|
`), filePath;
|
|
5129
5480
|
}
|
|
@@ -5193,17 +5544,17 @@ function mergeProviderAttributionHeaders(model, _settingsManager, sessionId, ...
|
|
|
5193
5544
|
}
|
|
5194
5545
|
|
|
5195
5546
|
// packages/coding-agent/dist/core/agent-session-runtime.js
|
|
5196
|
-
import { copyFileSync, existsSync as
|
|
5197
|
-
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";
|
|
5198
5549
|
|
|
5199
5550
|
// packages/coding-agent/dist/core/session-cwd.js
|
|
5200
|
-
import { existsSync as
|
|
5551
|
+
import { existsSync as existsSync7 } from "node:fs";
|
|
5201
5552
|
function getMissingSessionCwdIssue(sessionManager, fallbackCwd) {
|
|
5202
5553
|
let sessionFile = sessionManager.getSessionFile();
|
|
5203
5554
|
if (!sessionFile)
|
|
5204
5555
|
return;
|
|
5205
5556
|
let sessionCwd = sessionManager.getCwd();
|
|
5206
|
-
if (!(!sessionCwd ||
|
|
5557
|
+
if (!(!sessionCwd || existsSync7(sessionCwd)))
|
|
5207
5558
|
return {
|
|
5208
5559
|
sessionFile,
|
|
5209
5560
|
sessionCwd,
|
|
@@ -5369,7 +5720,7 @@ var AgentSessionRuntime = class {
|
|
|
5369
5720
|
sessionStartEvent: { type: "session_start", reason: "fork", previousSessionFile }
|
|
5370
5721
|
})), await this.finishSessionReplacement(options?.withSession), { cancelled: !1, selectedText };
|
|
5371
5722
|
}
|
|
5372
|
-
if (!
|
|
5723
|
+
if (!existsSync8(currentSessionFile))
|
|
5373
5724
|
throw new Error("This session has not been saved yet. Wait for the first assistant response before cloning or forking it.");
|
|
5374
5725
|
let sessionManager2 = SessionManager.open(currentSessionFile, sessionDir);
|
|
5375
5726
|
if (!sessionManager2.createBranchedSession(targetLeafId))
|
|
@@ -5398,15 +5749,15 @@ var AgentSessionRuntime = class {
|
|
|
5398
5749
|
*/
|
|
5399
5750
|
async importFromJsonl(inputPath, cwdOverride) {
|
|
5400
5751
|
let resolvedPath = resolvePath(inputPath);
|
|
5401
|
-
if (!
|
|
5752
|
+
if (!existsSync8(resolvedPath))
|
|
5402
5753
|
throw new SessionImportFileNotFoundError(resolvedPath);
|
|
5403
5754
|
let sessionDir = this.session.sessionManager.getSessionDir();
|
|
5404
|
-
|
|
5405
|
-
let destinationPath =
|
|
5755
|
+
existsSync8(sessionDir) || mkdirSync7(sessionDir, { recursive: !0 });
|
|
5756
|
+
let destinationPath = join12(sessionDir, basename2(resolvedPath)), beforeResult = await this.emitBeforeSwitch("resume", destinationPath);
|
|
5406
5757
|
if (beforeResult.cancelled)
|
|
5407
5758
|
return beforeResult;
|
|
5408
5759
|
let previousSessionFile = this.session.sessionFile;
|
|
5409
|
-
|
|
5760
|
+
resolve3(destinationPath) !== resolvedPath && copyFileSync(resolvedPath, destinationPath);
|
|
5410
5761
|
let sessionManager = SessionManager.open(destinationPath, sessionDir, cwdOverride);
|
|
5411
5762
|
return assertSessionCwdExists(sessionManager, this.cwd), await this.teardownCurrent("resume", sessionManager.getSessionFile()), this.apply(await this.createRuntime({
|
|
5412
5763
|
cwd: sessionManager.getCwd(),
|
|
@@ -5433,7 +5784,7 @@ function getDefaultAgentDir() {
|
|
|
5433
5784
|
return getAgentDir();
|
|
5434
5785
|
}
|
|
5435
5786
|
async function createAgentSession(options = {}) {
|
|
5436
|
-
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));
|
|
5437
5788
|
resourceLoader || (resourceLoader = new DefaultResourceLoader({ cwd, agentDir, settingsManager }), await resourceLoader.reload(), time("resourceLoader.reload"));
|
|
5438
5789
|
let existingSession = sessionManager.buildSessionContext(), hasExistingSession = existingSession.messages.length > 0, hasThinkingEntry = sessionManager.getBranch().some((entry) => entry.type === "thinking_level_change"), model = options.model, modelFallbackMessage;
|
|
5439
5790
|
if (!model && hasExistingSession && existingSession.model) {
|
|
@@ -5572,8 +5923,8 @@ function applyExtensionFlagValues(resourceLoader, extensionFlagValues) {
|
|
|
5572
5923
|
}
|
|
5573
5924
|
async function createAgentSessionServices(options) {
|
|
5574
5925
|
let cwd = resolvePath(options.cwd), agentDir = options.agentDir ? resolvePath(options.agentDir) : getAgentDir(), modelRuntime = options.modelRuntime ?? await ModelRuntime.create({
|
|
5575
|
-
authPath:
|
|
5576
|
-
modelsPath:
|
|
5926
|
+
authPath: join14(agentDir, "auth.json"),
|
|
5927
|
+
modelsPath: join14(agentDir, "models.json")
|
|
5577
5928
|
});
|
|
5578
5929
|
time("ModelRuntime.create");
|
|
5579
5930
|
let settingsManager = options.settingsManager ?? SettingsManager.create(cwd, agentDir), resourceLoader = new DefaultResourceLoader({
|
|
@@ -5634,6 +5985,18 @@ export {
|
|
|
5634
5985
|
wrapRegisteredTool,
|
|
5635
5986
|
wrapRegisteredTools,
|
|
5636
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,
|
|
5637
6000
|
parseSkillBlock,
|
|
5638
6001
|
AgentSession,
|
|
5639
6002
|
getMissingSessionCwdIssue,
|