@ashx-j/lunr 0.2.19 → 0.2.21
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-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/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-35WNVGMR.js → agent-session-services-C743TYQE.js} +6 -5
- package/dist/node-runtime/{builtin-extensions-322XDDEM.js → builtin-extensions-JCOPAAB5.js} +3 -2
- package/dist/node-runtime/{chunk-XATUM2HK.js → chunk-25I2BHAA.js} +1 -1
- package/dist/node-runtime/{chunk-TXHKBRHZ.js → chunk-2BUAYZ7K.js} +136 -53
- package/dist/node-runtime/chunk-5ZH3ZFIZ.js +308 -0
- package/dist/node-runtime/{chunk-J26TSGDL.js → chunk-6N22HULO.js} +8 -5
- package/dist/node-runtime/chunk-A3KMVBZV.js +60 -0
- package/dist/node-runtime/{chunk-4FX25LWP.js → chunk-AWVD5IEY.js} +20 -421
- package/dist/node-runtime/{chunk-ZRCBN365.js → chunk-GB2MGFLI.js} +12 -12
- package/dist/node-runtime/chunk-LISUTZS3.js +19 -0
- package/dist/node-runtime/{chunk-PNJSG3IZ.js → chunk-LTYWTR3V.js} +1 -369
- package/dist/node-runtime/{chunk-TFBIJTM3.js → chunk-PDNXVXMD.js} +13 -13
- package/dist/node-runtime/{chunk-MCUNIRD5.js → chunk-SY2TFMLO.js} +532 -261
- package/dist/node-runtime/{chunk-HQCKFM2O.js → chunk-VGYZ3APQ.js} +3 -0
- package/dist/node-runtime/{chunk-4DJ6HEGH.js → chunk-VZR3NCM7.js} +3 -3
- package/dist/node-runtime/chunk-W3SILANP.js +24 -0
- package/dist/node-runtime/{chunk-CBGB57XT.js → chunk-WLLDXJRT.js} +10 -0
- package/dist/node-runtime/{chunk-ATGA2WLC.js → chunk-XI77KVKA.js} +399 -36
- package/dist/node-runtime/{chunk-4CSFRBCN.js → chunk-Y5KOEMBH.js} +1 -1
- package/dist/node-runtime/{chunk-AROOY4BB.js → chunk-YMEAYRBE.js} +1 -1
- package/dist/node-runtime/{command-DWUM5X3U.js → command-P4NYCJ2M.js} +1 -1
- package/dist/node-runtime/{customize-XEXL2DGQ.js → customize-LF5VST47.js} +1 -1
- package/dist/node-runtime/{gateway-UZXMFGWY.js → gateway-BM6NLOH4.js} +2 -2
- package/dist/node-runtime/index.js +16 -13
- package/dist/node-runtime/{interactive-mode-QT5IKGQ5.js → interactive-mode-EVVBA64D.js} +11 -8
- package/dist/node-runtime/{lunr-cron-QPBTKBGI.js → lunr-cron-4VHP4E4B.js} +2 -2
- package/dist/node-runtime/main.js +14 -12
- package/dist/node-runtime/{package-manager-cli-7RKSZGEN.js → package-manager-cli-N37546V5.js} +5 -4
- package/dist/node-runtime/{pi-intercom-EEMBGQID.js → pi-intercom-NV2LW6X7.js} +108 -87
- package/dist/node-runtime/{pi-subagents-7YJ3I4VE.js → pi-subagents-6MUIFNDM.js} +1262 -599
- package/dist/node-runtime/rpc-entry.js +14 -12
- package/dist/node-runtime/{runtime-bridges-3RKBDLNA.js → runtime-bridges-2VQTLPOZ.js} +3 -5
- package/dist/node-runtime/{settings-manager-GHPTUN7R.js → settings-manager-CUGAZWAB.js} +2 -1
- package/dist/node-runtime/{subagent-executor-5Q5A4HJ2.js → subagent-executor-MH4A7CCF.js} +181 -294
- package/dist/node-runtime/{update-cli-L3JIBH2U.js → update-cli-XTZMZGOL.js} +2 -1
- 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/package.json +4 -4
- 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-3NMWLTPV.js +0 -64
package/docs/features.md
CHANGED
|
@@ -21,13 +21,31 @@ Permission modes: `manual | yolo | plan | auto`. Shift+Tab (`app.mode.cycle`) cy
|
|
|
21
21
|
|
|
22
22
|
Advertised subagents always start **fresh** (no forked parent context). Default parallel concurrency / max tasks / global run cap are unlimited; an explicit `concurrency` is still honored.
|
|
23
23
|
|
|
24
|
+
Single, parallel, and chain launches run async when `async` is omitted. Set `async:false` for an immediate foreground result or use `clarify:true` for the interactive preview/editor. Continue independent work after an async launch, then yield for normal interactive completion. Use `subagent_wait` only when the same turn or skill must finish after its children. Headless sessions auto-drain current-session work. Use status for one-time inspection rather than polling or sleeping for completion.
|
|
25
|
+
|
|
26
|
+
The legacy extension config keys `asyncByDefault` and `forceTopLevelAsync` remain accepted but no longer change launch mode. Omitted `async` resolves to async, while explicit `async:false`, `clarify:true`, and internal `foregroundOnly` calls stay foreground. RPC and scheduled launches remain always async.
|
|
27
|
+
|
|
28
|
+
Collapsed subagent rows (foreground and async) are one line: status glyph, description, selected tier or explicit model, tokens, and elapsed time. Mixed async runs use the same flat child rows without an aggregate tree. Running rows keep a live spinner and clock; completed collapsed rows freeze those stats. Choose the running child spinner under `/settings` → Customize. Async launches show `subagent async` in the tool header. Completed notify cards show title and status only; the model still receives the full result text.
|
|
29
|
+
|
|
24
30
|
A launch of 3+ parallel children in one `tasks`/`chain.parallel` call, or 3+ same-turn SINGLE `subagent` calls, receives one aggregate confirmation in **manual and yolo**. Sequential work stays `chain`. Auto bypasses this confirmation, and it can be disabled independently in `/settings`.
|
|
25
31
|
|
|
26
32
|
`/goal` sets a session goal and **forces session auto** permission mode.
|
|
27
33
|
|
|
34
|
+
### Questions to async children
|
|
35
|
+
|
|
36
|
+
The parent can use `subagent_supervisor` with `action: "ask"` to ask a running async child for information it needs before the final report. The request names the run, selects one child, and includes a `reason` explaining which decision needs the answer.
|
|
37
|
+
|
|
38
|
+
Asking returns a question ID without waiting. The child receives the question at a safe turn boundary, replies from its current findings, and continues its assigned task. Answers arrive separately from the run's final result and wake an idle parent. A delivery receipt is not an answer. Questions do not change the assignment, broadcast to other children, or restart finished children.
|
|
39
|
+
|
|
40
|
+
The parent calls `subagent_supervisor({ action: "ask", id, index, reason, message })`. It must select an `index` or private `childId` when several children are running. The child answers with `contact_supervisor({ action: "reply", replyTo: questionId, message })`. If the parent's next decision must wait, `subagent_wait({ questionId })` returns the answer instead of sending a second notification. Read-only children can reply without receiving editing tools.
|
|
41
|
+
|
|
42
|
+
A child must have an active question-capable input channel. Only one question may be outstanding per child. Questions expire after ten minutes by default, and child termination, failed delivery, process replacement, or parent session replacement cancels pending questions. A wait timeout ends the wait, not the question. Existing blocking child-to-parent requests take priority to avoid mutual waiting.
|
|
43
|
+
|
|
44
|
+
The agent must ask only when the child has missing context, the answer changes a concrete next decision, and waiting for completion would block progress or risk rework. It must use available results first and batch related questions. Routine progress checks, duplicate questions, polling, and step-by-step supervision are prohibited. A follow-up is appropriate only when the answer leaves the original decision unresolved.
|
|
45
|
+
|
|
28
46
|
## Todos, memory, and global instructions
|
|
29
47
|
|
|
30
|
-
- **Todos** — lunr-todos is a full-replace list. Completed todos prune on the next user turn (no leftover `✓ N done` footer).
|
|
48
|
+
- **Todos** — lunr-todos is a full-replace list. Collapsed lists show all four active items; lists of five or more show three and a `+N more` line. Completed todos prune on the next user turn (no leftover `✓ N done` footer).
|
|
31
49
|
- **Agent memory** — durable established facts and stable preferences in `~/.lunr/simple-memory/memory.md`. `/settings` → Agent memory controls injection and the `memory_add`, `memory_remove`, and `memory_load` tools without deleting stored facts. `memoryCharCap` defaults to 5000. Behavior instructions, transient task state, transcripts, guesses, and secrets do not belong in memory.
|
|
32
50
|
- **Global instructions** — create `~/.lunr/agent/agents/AGENTS.md` yourself when you want global behavior or instructions. lunR injects it through the normal context loader; `/reload` picks up changes. The model cannot modify this user-managed file. The retired `behavior.md` file and behavior presets are no longer loaded.
|
|
33
51
|
- **Model instructions** — `/settings` can enable `~/.lunr/agent/agents/<model-name>/AGENTS.md` and choose **Both** (global then model-specific) or **Model only**. The folder name is provider-independent and filesystem-safe. Project `AGENTS.md`/`CLAUDE.md` files are unaffected, and `--no-context-files` disables all instruction files.
|
|
@@ -83,10 +101,10 @@ Without runnable adapters (enabled platform + resolvable token), `lunr gateway`
|
|
|
83
101
|
- `/fast [on|off|status]` controls `service_tier: "fast"` for OpenAI Codex subscriptions only. It persists across new sessions, gateway turns, and subagents. Paid `openai` API models do not use it.
|
|
84
102
|
- Footer plan bar prefers a 5h window and falls back to weekly (`planUsageWindow`). In Customize, Plan usage hides the whole segment while Plan bar hides only the █░ fill and keeps the percent.
|
|
85
103
|
- Click a ✻ Thought or tool card to expand/collapse that item. `app.tools.expand` is unbound. `/tree` still uses `ctrl+o` for filters.
|
|
86
|
-
- Smooth streaming (`smoothStreaming`, default off)
|
|
104
|
+
- Smooth streaming (`smoothStreaming`, default off) reveals assistant text and thinking in small character batches at about 30 FPS in the interactive TUI. The thinking preview shows the last four revealed lines. Completed thinking collapses after its reveal catches up. Message completion flushes any remaining text immediately. Print, RPC, and gateway stay unsmoothed.
|
|
87
105
|
- Image paste inserts `[image_n]` chips. Windows uses **Alt+V**; VS Code must forward it because it owns Ctrl+V and Alt+V. `/paste-image` bypasses terminal shortcuts.
|
|
88
|
-
- Model
|
|
89
|
-
- Settings
|
|
106
|
+
- Model selection: every child launch chooses exactly one of `tier: light|standard|heavy` (default) or an explicit `model: provider/id` when the user names a model. Configure tier routes in `/settings`. Optional `thinking` is only valid with an explicit model; tier launches use configured tier thinking. Direct model launches do not require tier mode. Missing, both, inherit, unavailable, or unauthenticated selections fail closed before spawn.
|
|
107
|
+
- Settings changes stay on `/settings`. The agent does not get `settings_load` or other agent-managed settings tools, and direct file-tool writes to lunR `settings.json` are blocked.
|
|
90
108
|
|
|
91
109
|
## Updates, catalogs, local models
|
|
92
110
|
|
package/docs/keybindings.md
CHANGED
|
@@ -82,13 +82,15 @@ Modifier combinations: `ctrl+shift+x`, `alt+ctrl+x`, `ctrl+shift+alt+x`, `ctrl+1
|
|
|
82
82
|
|
|
83
83
|
| Keybinding id | Default | Description |
|
|
84
84
|
|--------|---------|-------------|
|
|
85
|
-
| `app.interrupt` | `escape` |
|
|
85
|
+
| `app.interrupt` | `escape` | Abort the parent; press twice within 500ms to also stop this session's active async subagents |
|
|
86
86
|
| `app.clear` | `ctrl+c` | Clear editor |
|
|
87
87
|
| `app.exit` | `ctrl+d` | Exit (when editor empty) |
|
|
88
88
|
| `app.suspend` | `ctrl+z` (none on Windows) | Suspend to background |
|
|
89
89
|
| `app.editor.external` | `ctrl+g` | Open in external editor (`externalEditor`, `$VISUAL`, `$EDITOR`, Notepad on Windows, or `nano` elsewhere) |
|
|
90
90
|
| `app.clipboard.pasteImage` | `ctrl+v` (`alt+v` on Windows) | Paste image from clipboard; `/paste-image` needs no shortcut |
|
|
91
91
|
|
|
92
|
+
While async subagents are active, the second Escape takes priority over tree/fork navigation, even with a draft in the editor. The first Escape leaves async work running. The second requests a stop through the normal subagent control channel and waits for the runner to report its final state. Other sessions and future scheduled jobs are unaffected. Without active async work, idle double-Escape keeps the configured tree/fork behaviour.
|
|
93
|
+
|
|
92
94
|
### Sessions
|
|
93
95
|
|
|
94
96
|
| Keybinding id | Default | Description |
|
package/docs/settings.md
CHANGED
|
@@ -55,6 +55,7 @@ Use `/trust` in interactive mode to save a project trust decision for future ses
|
|
|
55
55
|
| `externalEditor` | string | `$VISUAL`, then `$EDITOR`, then Notepad on Windows or `nano` elsewhere | Command for Ctrl+G external editor; takes precedence over environment variables |
|
|
56
56
|
| `quietStartup` | boolean | `false` | Hide startup header |
|
|
57
57
|
| `smoothStreaming` | boolean | `false` | Reveal streamed responses grapheme by grapheme (~30 FPS). Interactive TUI only |
|
|
58
|
+
| `subagentSpinner` | string | `"braille"` | Foreground and async running child indicator: `"braille"`, `"orbit"`, `"snake"`, or `"sparkle"` |
|
|
58
59
|
| `thinkingCollapse` | boolean | `true` | Collapse completed thinking blocks to a short label plus the first sentence |
|
|
59
60
|
| `cacheRetention` | string | unset → `PI_CACHE_RETENTION` → `"short"` | `"none"`, `"short"`, or `"long"` prompt-cache retention |
|
|
60
61
|
| `defaultProjectTrust` | string | `"ask"` | Fallback project trust behavior: `"ask"`, `"always"`, or `"never"`. Global setting only |
|
|
@@ -68,7 +69,7 @@ Use `/trust` in interactive mode to save a project trust decision for future ses
|
|
|
68
69
|
| `confirmLargeSubagentLaunches` | boolean | `true` | Ask once before aggregate launches of three or more children outside Auto mode |
|
|
69
70
|
| `enableAnalytics` | boolean | `false` | Opt-in analytics data sharing. Currently only asked for during the experimental first-time setup (`PI_EXPERIMENTAL=1`) |
|
|
70
71
|
| `trackingId` | string | - | Analytics tracking identifier, generated when `enableAnalytics` is turned on |
|
|
71
|
-
| `doubleEscapeAction` | string | `"tree"` |
|
|
72
|
+
| `doubleEscapeAction` | string | `"tree"` | Idle action for double-escape: `"tree"`, `"fork"`, or `"none"`. Active async subagents take priority: double-Escape requests their stop |
|
|
72
73
|
| `treeFilterMode` | string | `"default"` | Default filter for `/tree`: `"default"`, `"no-tools"`, `"user-only"`, `"labeled-only"`, `"all"` |
|
|
73
74
|
| `editorPaddingX` | number | `0` | Horizontal padding for input editor (0-3) |
|
|
74
75
|
| `outputPad` | number | `1` | Horizontal padding for user messages, assistant messages, and thinking (0 or 1) |
|
|
@@ -238,7 +239,7 @@ When multiple sources specify a session directory, precedence is `--session-dir`
|
|
|
238
239
|
| `footerPlanBar` | boolean | `true` | Show the █░ fill; off keeps the percent only |
|
|
239
240
|
| `planUsageWindow` | string | `"5h"` | Preferred plan window: `"5h"` or `"weekly"`. Missing 5h falls back to weekly |
|
|
240
241
|
|
|
241
|
-
Customize these from `/settings` → Customize as well.
|
|
242
|
+
Customize these from `/settings` → Customize as well. The same menu controls `subagentSpinner` with an animated preview.
|
|
242
243
|
|
|
243
244
|
### Cron, rollback, subscriptions
|
|
244
245
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-custom-provider",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.21",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-custom-provider",
|
|
9
|
-
"version": "0.2.
|
|
9
|
+
"version": "0.2.21",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@anthropic-ai/sdk": "^0.52.0"
|
|
12
12
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-gondolin",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.21",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-gondolin",
|
|
9
|
-
"version": "0.2.
|
|
9
|
+
"version": "0.2.21",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@earendil-works/gondolin": "0.12.0"
|
|
12
12
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-sandbox",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.21",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-sandbox",
|
|
9
|
-
"version": "0.2.
|
|
9
|
+
"version": "0.2.21",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@anthropic-ai/sandbox-runtime": "^0.0.26"
|
|
12
12
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-with-deps",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.21",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-with-deps",
|
|
9
|
-
"version": "0.2.
|
|
9
|
+
"version": "0.2.21",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"ms": "^2.1.3"
|
|
12
12
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ashx-j/lunr",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.21",
|
|
4
4
|
"description": "lunR — terminal coding agent CLI with read, bash, edit, write tools and session management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"piConfig": {
|
|
@@ -37,9 +37,9 @@
|
|
|
37
37
|
"shrinkwrap": "node ../../scripts/generate-coding-agent-shrinkwrap.mjs"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@ashx-j/lunr-agent": "^0.2.
|
|
41
|
-
"@ashx-j/lunr-ai": "^0.2.
|
|
42
|
-
"@ashx-j/lunr-tui": "^0.2.
|
|
40
|
+
"@ashx-j/lunr-agent": "^0.2.21",
|
|
41
|
+
"@ashx-j/lunr-ai": "^0.2.21",
|
|
42
|
+
"@ashx-j/lunr-tui": "^0.2.21",
|
|
43
43
|
"@modelcontextprotocol/ext-apps": "1.7.4",
|
|
44
44
|
"@modelcontextprotocol/sdk": "1.30.0",
|
|
45
45
|
"@mozilla/readability": "0.6.0",
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { ExtensionAPI } from "@ashx-j/lunr";
|
|
2
|
-
export declare const DETAILED_SETTINGS_TOOL_NAMES: readonly ["settings_model_tiers", "settings_subscriptions", "settings_rollback", "settings_session_retention"];
|
|
3
|
-
export default function lunrSettingsTools(pi: ExtensionAPI): void;
|
|
4
|
-
//# sourceMappingURL=lunr-settings-tools.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lunr-settings-tools.d.ts","sourceRoot":"","sources":["../../src/builtin-extensions/lunr-settings-tools.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAMpE,eAAO,MAAM,4BAA4B,gHAK/B,CAAC;AAoBX,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,EAAE,EAAE,YAAY,GAAG,IAAI,CAkGhE","sourcesContent":["// @ts-nocheck\nimport type { ExtensionAPI } from \"@ashx-j/lunr\";\nimport { Type } from \"@sinclair/typebox\";\n\nconst SETTINGS_BRIDGE = Symbol.for(\"@lunr/settings-tools\");\nconst MODEL_TIERS_BRIDGE = Symbol.for(\"@lunr/model-tiers\");\n\nexport const DETAILED_SETTINGS_TOOL_NAMES = [\n\t\"settings_model_tiers\",\n\t\"settings_subscriptions\",\n\t\"settings_rollback\",\n\t\"settings_session_retention\",\n] as const;\n\nfunction settingsBridge(): any {\n\tconst bridge = (globalThis as Record<symbol, unknown>)[SETTINGS_BRIDGE];\n\tif (!bridge) throw new Error(\"Settings are unavailable in this runtime. Reload lunR and try again.\");\n\treturn bridge;\n}\n\nfunction text(value: unknown, guidance: string) {\n\treturn {\n\t\tcontent: [{ type: \"text\" as const, text: `${JSON.stringify(value, null, 2)}\\n\\n${guidance}` }],\n\t\tdetails: value,\n\t};\n}\n\nconst thinking = Type.Union([\n\tType.Literal(\"off\"), Type.Literal(\"minimal\"), Type.Literal(\"low\"), Type.Literal(\"medium\"),\n\tType.Literal(\"high\"), Type.Literal(\"xhigh\"), Type.Literal(\"max\"), Type.Null(),\n], { description: \"Per-tier thinking level. null inherits the parent session thinking level.\" });\n\nexport default function lunrSettingsTools(pi: ExtensionAPI): void {\n\tlet loaded = false;\n\n\tconst registerDetailedTools = () => {\n\t\tif (loaded) return;\n\t\tloaded = true;\n\n\t\tpi.registerTool({\n\t\t\tname: \"settings_model_tiers\",\n\t\t\tlabel: \"Model tiers\",\n\t\t\tdescription: \"Read or partially update light, standard, and heavy subagent model routes and their thinking levels. Models use provider/model ids. Omitted fields are unchanged.\",\n\t\t\tparameters: Type.Object({\n\t\t\t\tenabled: Type.Optional(Type.Boolean({ description: \"Enable or disable tier-based child routing.\" })),\n\t\t\t\tlight: Type.Optional(Type.String({ minLength: 1, description: \"Model route for light work.\" })),\n\t\t\t\tstandard: Type.Optional(Type.String({ minLength: 1, description: \"Model route for standard work.\" })),\n\t\t\t\theavy: Type.Optional(Type.String({ minLength: 1, description: \"Model route for heavy work.\" })),\n\t\t\t\tlightThinking: Type.Optional(thinking),\n\t\t\t\tstandardThinking: Type.Optional(thinking),\n\t\t\t\theavyThinking: Type.Optional(thinking),\n\t\t\t}, { additionalProperties: false }),\n\t\t\tasync execute(_id, params) {\n\t\t\t\tconst bridge = settingsBridge();\n\t\t\t\tif (Object.keys(params).length > 0) {\n\t\t\t\t\tbridge.setModelTiers(params);\n\t\t\t\t\t(globalThis as Record<symbol, any>)[MODEL_TIERS_BRIDGE]?.refreshToolDescription?.();\n\t\t\t\t}\n\t\t\t\treturn text(bridge.getModelTiers(), Object.keys(params).length > 0\n\t\t\t\t\t? \"Tier routes are saved and apply to the next child launch; the subagent schema guidance is refreshed now.\"\n\t\t\t\t\t: \"Pass only the fields you want to change. Child launches still validate model availability and authentication.\");\n\t\t\t},\n\t\t});\n\n\t\tpi.registerTool({\n\t\t\tname: \"settings_subscriptions\",\n\t\t\tlabel: \"Subscription management\",\n\t\t\tdescription: \"Read or update automatic management of multiple stored provider subscriptions. Omit enabled to read without changing it.\",\n\t\t\tparameters: Type.Object({ enabled: Type.Optional(Type.Boolean()) }, { additionalProperties: false }),\n\t\t\tasync execute(_id, params) {\n\t\t\t\tconst bridge = settingsBridge();\n\t\t\t\tif (params.enabled !== undefined) bridge.setAutoManageSubscriptions(params.enabled);\n\t\t\t\treturn text({ enabled: bridge.getAutoManageSubscriptions() }, params.enabled === undefined\n\t\t\t\t\t? \"Set enabled to change automatic subscription selection.\"\n\t\t\t\t\t: \"The setting is saved and applies to subsequent provider requests.\");\n\t\t\t},\n\t\t});\n\n\t\tpi.registerTool({\n\t\t\tname: \"settings_rollback\",\n\t\t\tlabel: \"Rollback\",\n\t\t\tdescription: \"Read or partially update rollback behavior: enabled, retained turns, capture strategy, and scope. Omitted fields are unchanged. Auto permission mode force-enables rollback for its current session.\",\n\t\t\tparameters: Type.Object({\n\t\t\t\tenabled: Type.Optional(Type.Boolean()),\n\t\t\t\tturns: Type.Optional(Type.Integer({ minimum: 1, maximum: 20 })),\n\t\t\t\tcapture: Type.Optional(Type.Union([Type.Literal(\"copies\"), Type.Literal(\"shadow-git\"), Type.Literal(\"hybrid\")])),\n\t\t\t\tscope: Type.Optional(Type.Union([Type.Literal(\"tools\"), Type.Literal(\"tree\")])),\n\t\t\t}, { additionalProperties: false }),\n\t\t\tasync execute(_id, params) {\n\t\t\t\tconst bridge = settingsBridge();\n\t\t\t\tif (Object.keys(params).length > 0) bridge.setRollback(params);\n\t\t\t\tconst current = bridge.getRollback();\n\t\t\t\treturn text(current, current.forcedByAuto\n\t\t\t\t\t? \"Saved settings apply normally, but rollback remains force-enabled for this Auto-mode session.\"\n\t\t\t\t\t: Object.keys(params).length > 0 ? \"Rollback settings are saved and live for subsequent tool calls.\" : \"Pass only the fields you want to change.\");\n\t\t\t},\n\t\t});\n\n\t\tpi.registerTool({\n\t\t\tname: \"settings_session_retention\",\n\t\t\tlabel: \"Session retention\",\n\t\t\tdescription: \"Read or update how many days saved sessions are retained. Set days to 0 to keep sessions forever. Cleanup applies on a later launch, not retroactively in this turn.\",\n\t\t\tparameters: Type.Object({ days: Type.Optional(Type.Integer({ minimum: 0, maximum: 36500 })) }, { additionalProperties: false }),\n\t\t\tasync execute(_id, params) {\n\t\t\t\tconst bridge = settingsBridge();\n\t\t\t\tif (params.days !== undefined) bridge.setSessionRetentionDays(params.days);\n\t\t\t\treturn text({ days: bridge.getSessionRetentionDays() }, params.days === undefined\n\t\t\t\t\t? \"Set days to change retention; 0 keeps sessions forever.\"\n\t\t\t\t\t: \"The setting is saved. Session cleanup uses it on a later launch.\");\n\t\t\t},\n\t\t});\n\t};\n\n\tpi.registerTool({\n\t\tname: \"settings_load\",\n\t\tlabel: \"Settings\",\n\t\tdescription: \"Load four narrow agent-managed settings tools for model tiers, subscription management, rollback, and session retention. Call only when the task requires inspecting or changing those settings.\",\n\t\tpromptSnippet: \"Load narrow settings controls on demand\",\n\t\tpromptGuidelines: [\"Call settings_load only when the user asks to inspect or change model tiers, subscription management, rollback, or session retention.\"],\n\t\tparameters: Type.Object({}, { additionalProperties: false }),\n\t\tasync execute() {\n\t\t\tconst alreadyLoaded = loaded;\n\t\t\tregisterDetailedTools();\n\t\t\tpi.setActiveTools([...new Set([...pi.getActiveTools(), ...DETAILED_SETTINGS_TOOL_NAMES])]);\n\t\t\treturn text(\n\t\t\t\t{ activated: [...DETAILED_SETTINGS_TOOL_NAMES], alreadyLoaded },\n\t\t\t\t\"The four tools are active for the next model step and remain active in this runtime. A new runtime starts with only settings_load visible.\",\n\t\t\t);\n\t\t},\n\t});\n}\n"]}
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import { Type } from "@sinclair/typebox";
|
|
2
|
-
const SETTINGS_BRIDGE = Symbol.for("@lunr/settings-tools");
|
|
3
|
-
const MODEL_TIERS_BRIDGE = Symbol.for("@lunr/model-tiers");
|
|
4
|
-
export const DETAILED_SETTINGS_TOOL_NAMES = [
|
|
5
|
-
"settings_model_tiers",
|
|
6
|
-
"settings_subscriptions",
|
|
7
|
-
"settings_rollback",
|
|
8
|
-
"settings_session_retention",
|
|
9
|
-
];
|
|
10
|
-
function settingsBridge() {
|
|
11
|
-
const bridge = globalThis[SETTINGS_BRIDGE];
|
|
12
|
-
if (!bridge)
|
|
13
|
-
throw new Error("Settings are unavailable in this runtime. Reload lunR and try again.");
|
|
14
|
-
return bridge;
|
|
15
|
-
}
|
|
16
|
-
function text(value, guidance) {
|
|
17
|
-
return {
|
|
18
|
-
content: [{ type: "text", text: `${JSON.stringify(value, null, 2)}\n\n${guidance}` }],
|
|
19
|
-
details: value,
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
const thinking = Type.Union([
|
|
23
|
-
Type.Literal("off"), Type.Literal("minimal"), Type.Literal("low"), Type.Literal("medium"),
|
|
24
|
-
Type.Literal("high"), Type.Literal("xhigh"), Type.Literal("max"), Type.Null(),
|
|
25
|
-
], { description: "Per-tier thinking level. null inherits the parent session thinking level." });
|
|
26
|
-
export default function lunrSettingsTools(pi) {
|
|
27
|
-
let loaded = false;
|
|
28
|
-
const registerDetailedTools = () => {
|
|
29
|
-
if (loaded)
|
|
30
|
-
return;
|
|
31
|
-
loaded = true;
|
|
32
|
-
pi.registerTool({
|
|
33
|
-
name: "settings_model_tiers",
|
|
34
|
-
label: "Model tiers",
|
|
35
|
-
description: "Read or partially update light, standard, and heavy subagent model routes and their thinking levels. Models use provider/model ids. Omitted fields are unchanged.",
|
|
36
|
-
parameters: Type.Object({
|
|
37
|
-
enabled: Type.Optional(Type.Boolean({ description: "Enable or disable tier-based child routing." })),
|
|
38
|
-
light: Type.Optional(Type.String({ minLength: 1, description: "Model route for light work." })),
|
|
39
|
-
standard: Type.Optional(Type.String({ minLength: 1, description: "Model route for standard work." })),
|
|
40
|
-
heavy: Type.Optional(Type.String({ minLength: 1, description: "Model route for heavy work." })),
|
|
41
|
-
lightThinking: Type.Optional(thinking),
|
|
42
|
-
standardThinking: Type.Optional(thinking),
|
|
43
|
-
heavyThinking: Type.Optional(thinking),
|
|
44
|
-
}, { additionalProperties: false }),
|
|
45
|
-
async execute(_id, params) {
|
|
46
|
-
const bridge = settingsBridge();
|
|
47
|
-
if (Object.keys(params).length > 0) {
|
|
48
|
-
bridge.setModelTiers(params);
|
|
49
|
-
globalThis[MODEL_TIERS_BRIDGE]?.refreshToolDescription?.();
|
|
50
|
-
}
|
|
51
|
-
return text(bridge.getModelTiers(), Object.keys(params).length > 0
|
|
52
|
-
? "Tier routes are saved and apply to the next child launch; the subagent schema guidance is refreshed now."
|
|
53
|
-
: "Pass only the fields you want to change. Child launches still validate model availability and authentication.");
|
|
54
|
-
},
|
|
55
|
-
});
|
|
56
|
-
pi.registerTool({
|
|
57
|
-
name: "settings_subscriptions",
|
|
58
|
-
label: "Subscription management",
|
|
59
|
-
description: "Read or update automatic management of multiple stored provider subscriptions. Omit enabled to read without changing it.",
|
|
60
|
-
parameters: Type.Object({ enabled: Type.Optional(Type.Boolean()) }, { additionalProperties: false }),
|
|
61
|
-
async execute(_id, params) {
|
|
62
|
-
const bridge = settingsBridge();
|
|
63
|
-
if (params.enabled !== undefined)
|
|
64
|
-
bridge.setAutoManageSubscriptions(params.enabled);
|
|
65
|
-
return text({ enabled: bridge.getAutoManageSubscriptions() }, params.enabled === undefined
|
|
66
|
-
? "Set enabled to change automatic subscription selection."
|
|
67
|
-
: "The setting is saved and applies to subsequent provider requests.");
|
|
68
|
-
},
|
|
69
|
-
});
|
|
70
|
-
pi.registerTool({
|
|
71
|
-
name: "settings_rollback",
|
|
72
|
-
label: "Rollback",
|
|
73
|
-
description: "Read or partially update rollback behavior: enabled, retained turns, capture strategy, and scope. Omitted fields are unchanged. Auto permission mode force-enables rollback for its current session.",
|
|
74
|
-
parameters: Type.Object({
|
|
75
|
-
enabled: Type.Optional(Type.Boolean()),
|
|
76
|
-
turns: Type.Optional(Type.Integer({ minimum: 1, maximum: 20 })),
|
|
77
|
-
capture: Type.Optional(Type.Union([Type.Literal("copies"), Type.Literal("shadow-git"), Type.Literal("hybrid")])),
|
|
78
|
-
scope: Type.Optional(Type.Union([Type.Literal("tools"), Type.Literal("tree")])),
|
|
79
|
-
}, { additionalProperties: false }),
|
|
80
|
-
async execute(_id, params) {
|
|
81
|
-
const bridge = settingsBridge();
|
|
82
|
-
if (Object.keys(params).length > 0)
|
|
83
|
-
bridge.setRollback(params);
|
|
84
|
-
const current = bridge.getRollback();
|
|
85
|
-
return text(current, current.forcedByAuto
|
|
86
|
-
? "Saved settings apply normally, but rollback remains force-enabled for this Auto-mode session."
|
|
87
|
-
: Object.keys(params).length > 0 ? "Rollback settings are saved and live for subsequent tool calls." : "Pass only the fields you want to change.");
|
|
88
|
-
},
|
|
89
|
-
});
|
|
90
|
-
pi.registerTool({
|
|
91
|
-
name: "settings_session_retention",
|
|
92
|
-
label: "Session retention",
|
|
93
|
-
description: "Read or update how many days saved sessions are retained. Set days to 0 to keep sessions forever. Cleanup applies on a later launch, not retroactively in this turn.",
|
|
94
|
-
parameters: Type.Object({ days: Type.Optional(Type.Integer({ minimum: 0, maximum: 36500 })) }, { additionalProperties: false }),
|
|
95
|
-
async execute(_id, params) {
|
|
96
|
-
const bridge = settingsBridge();
|
|
97
|
-
if (params.days !== undefined)
|
|
98
|
-
bridge.setSessionRetentionDays(params.days);
|
|
99
|
-
return text({ days: bridge.getSessionRetentionDays() }, params.days === undefined
|
|
100
|
-
? "Set days to change retention; 0 keeps sessions forever."
|
|
101
|
-
: "The setting is saved. Session cleanup uses it on a later launch.");
|
|
102
|
-
},
|
|
103
|
-
});
|
|
104
|
-
};
|
|
105
|
-
pi.registerTool({
|
|
106
|
-
name: "settings_load",
|
|
107
|
-
label: "Settings",
|
|
108
|
-
description: "Load four narrow agent-managed settings tools for model tiers, subscription management, rollback, and session retention. Call only when the task requires inspecting or changing those settings.",
|
|
109
|
-
promptSnippet: "Load narrow settings controls on demand",
|
|
110
|
-
promptGuidelines: ["Call settings_load only when the user asks to inspect or change model tiers, subscription management, rollback, or session retention."],
|
|
111
|
-
parameters: Type.Object({}, { additionalProperties: false }),
|
|
112
|
-
async execute() {
|
|
113
|
-
const alreadyLoaded = loaded;
|
|
114
|
-
registerDetailedTools();
|
|
115
|
-
pi.setActiveTools([...new Set([...pi.getActiveTools(), ...DETAILED_SETTINGS_TOOL_NAMES])]);
|
|
116
|
-
return text({ activated: [...DETAILED_SETTINGS_TOOL_NAMES], alreadyLoaded }, "The four tools are active for the next model step and remain active in this runtime. A new runtime starts with only settings_load visible.");
|
|
117
|
-
},
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
//# sourceMappingURL=lunr-settings-tools.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lunr-settings-tools.js","sourceRoot":"","sources":["../../src/builtin-extensions/lunr-settings-tools.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;AAC3D,MAAM,kBAAkB,GAAG,MAAM,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;AAE3D,MAAM,CAAC,MAAM,4BAA4B,GAAG;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symbol.for(\"@lunr/settings-tools\");\nconst MODEL_TIERS_BRIDGE = Symbol.for(\"@lunr/model-tiers\");\n\nexport const DETAILED_SETTINGS_TOOL_NAMES = [\n\t\"settings_model_tiers\",\n\t\"settings_subscriptions\",\n\t\"settings_rollback\",\n\t\"settings_session_retention\",\n] as const;\n\nfunction settingsBridge(): any {\n\tconst bridge = (globalThis as Record<symbol, unknown>)[SETTINGS_BRIDGE];\n\tif (!bridge) throw new Error(\"Settings are unavailable in this runtime. Reload lunR and try again.\");\n\treturn bridge;\n}\n\nfunction text(value: unknown, guidance: string) {\n\treturn {\n\t\tcontent: [{ type: \"text\" as const, text: `${JSON.stringify(value, null, 2)}\\n\\n${guidance}` }],\n\t\tdetails: value,\n\t};\n}\n\nconst thinking = Type.Union([\n\tType.Literal(\"off\"), Type.Literal(\"minimal\"), Type.Literal(\"low\"), Type.Literal(\"medium\"),\n\tType.Literal(\"high\"), Type.Literal(\"xhigh\"), Type.Literal(\"max\"), Type.Null(),\n], { description: \"Per-tier thinking level. null inherits the parent session thinking level.\" });\n\nexport default function lunrSettingsTools(pi: ExtensionAPI): void {\n\tlet loaded = false;\n\n\tconst registerDetailedTools = () => {\n\t\tif (loaded) return;\n\t\tloaded = true;\n\n\t\tpi.registerTool({\n\t\t\tname: \"settings_model_tiers\",\n\t\t\tlabel: \"Model tiers\",\n\t\t\tdescription: \"Read or partially update light, standard, and heavy subagent model routes and their thinking levels. Models use provider/model ids. Omitted fields are unchanged.\",\n\t\t\tparameters: Type.Object({\n\t\t\t\tenabled: Type.Optional(Type.Boolean({ description: \"Enable or disable tier-based child routing.\" })),\n\t\t\t\tlight: Type.Optional(Type.String({ minLength: 1, description: \"Model route for light work.\" })),\n\t\t\t\tstandard: Type.Optional(Type.String({ minLength: 1, description: \"Model route for standard work.\" })),\n\t\t\t\theavy: Type.Optional(Type.String({ minLength: 1, description: \"Model route for heavy work.\" })),\n\t\t\t\tlightThinking: Type.Optional(thinking),\n\t\t\t\tstandardThinking: Type.Optional(thinking),\n\t\t\t\theavyThinking: Type.Optional(thinking),\n\t\t\t}, { additionalProperties: false }),\n\t\t\tasync execute(_id, params) {\n\t\t\t\tconst bridge = settingsBridge();\n\t\t\t\tif (Object.keys(params).length > 0) {\n\t\t\t\t\tbridge.setModelTiers(params);\n\t\t\t\t\t(globalThis as Record<symbol, any>)[MODEL_TIERS_BRIDGE]?.refreshToolDescription?.();\n\t\t\t\t}\n\t\t\t\treturn text(bridge.getModelTiers(), Object.keys(params).length > 0\n\t\t\t\t\t? \"Tier routes are saved and apply to the next child launch; the subagent schema guidance is refreshed now.\"\n\t\t\t\t\t: \"Pass only the fields you want to change. Child launches still validate model availability and authentication.\");\n\t\t\t},\n\t\t});\n\n\t\tpi.registerTool({\n\t\t\tname: \"settings_subscriptions\",\n\t\t\tlabel: \"Subscription management\",\n\t\t\tdescription: \"Read or update automatic management of multiple stored provider subscriptions. Omit enabled to read without changing it.\",\n\t\t\tparameters: Type.Object({ enabled: Type.Optional(Type.Boolean()) }, { additionalProperties: false }),\n\t\t\tasync execute(_id, params) {\n\t\t\t\tconst bridge = settingsBridge();\n\t\t\t\tif (params.enabled !== undefined) bridge.setAutoManageSubscriptions(params.enabled);\n\t\t\t\treturn text({ enabled: bridge.getAutoManageSubscriptions() }, params.enabled === undefined\n\t\t\t\t\t? \"Set enabled to change automatic subscription selection.\"\n\t\t\t\t\t: \"The setting is saved and applies to subsequent provider requests.\");\n\t\t\t},\n\t\t});\n\n\t\tpi.registerTool({\n\t\t\tname: \"settings_rollback\",\n\t\t\tlabel: \"Rollback\",\n\t\t\tdescription: \"Read or partially update rollback behavior: enabled, retained turns, capture strategy, and scope. Omitted fields are unchanged. Auto permission mode force-enables rollback for its current session.\",\n\t\t\tparameters: Type.Object({\n\t\t\t\tenabled: Type.Optional(Type.Boolean()),\n\t\t\t\tturns: Type.Optional(Type.Integer({ minimum: 1, maximum: 20 })),\n\t\t\t\tcapture: Type.Optional(Type.Union([Type.Literal(\"copies\"), Type.Literal(\"shadow-git\"), Type.Literal(\"hybrid\")])),\n\t\t\t\tscope: Type.Optional(Type.Union([Type.Literal(\"tools\"), Type.Literal(\"tree\")])),\n\t\t\t}, { additionalProperties: false }),\n\t\t\tasync execute(_id, params) {\n\t\t\t\tconst bridge = settingsBridge();\n\t\t\t\tif (Object.keys(params).length > 0) bridge.setRollback(params);\n\t\t\t\tconst current = bridge.getRollback();\n\t\t\t\treturn text(current, current.forcedByAuto\n\t\t\t\t\t? \"Saved settings apply normally, but rollback remains force-enabled for this Auto-mode session.\"\n\t\t\t\t\t: Object.keys(params).length > 0 ? \"Rollback settings are saved and live for subsequent tool calls.\" : \"Pass only the fields you want to change.\");\n\t\t\t},\n\t\t});\n\n\t\tpi.registerTool({\n\t\t\tname: \"settings_session_retention\",\n\t\t\tlabel: \"Session retention\",\n\t\t\tdescription: \"Read or update how many days saved sessions are retained. Set days to 0 to keep sessions forever. Cleanup applies on a later launch, not retroactively in this turn.\",\n\t\t\tparameters: Type.Object({ days: Type.Optional(Type.Integer({ minimum: 0, maximum: 36500 })) }, { additionalProperties: false }),\n\t\t\tasync execute(_id, params) {\n\t\t\t\tconst bridge = settingsBridge();\n\t\t\t\tif (params.days !== undefined) bridge.setSessionRetentionDays(params.days);\n\t\t\t\treturn text({ days: bridge.getSessionRetentionDays() }, params.days === undefined\n\t\t\t\t\t? \"Set days to change retention; 0 keeps sessions forever.\"\n\t\t\t\t\t: \"The setting is saved. Session cleanup uses it on a later launch.\");\n\t\t\t},\n\t\t});\n\t};\n\n\tpi.registerTool({\n\t\tname: \"settings_load\",\n\t\tlabel: \"Settings\",\n\t\tdescription: \"Load four narrow agent-managed settings tools for model tiers, subscription management, rollback, and session retention. Call only when the task requires inspecting or changing those settings.\",\n\t\tpromptSnippet: \"Load narrow settings controls on demand\",\n\t\tpromptGuidelines: [\"Call settings_load only when the user asks to inspect or change model tiers, subscription management, rollback, or session retention.\"],\n\t\tparameters: Type.Object({}, { additionalProperties: false }),\n\t\tasync execute() {\n\t\t\tconst alreadyLoaded = loaded;\n\t\t\tregisterDetailedTools();\n\t\t\tpi.setActiveTools([...new Set([...pi.getActiveTools(), ...DETAILED_SETTINGS_TOOL_NAMES])]);\n\t\t\treturn text(\n\t\t\t\t{ activated: [...DETAILED_SETTINGS_TOOL_NAMES], alreadyLoaded },\n\t\t\t\t\"The four tools are active for the next model step and remain active in this runtime. A new runtime starts with only settings_load visible.\",\n\t\t\t);\n\t\t},\n\t});\n}\n"]}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { ThinkingLevel } from "@ashx-j/lunr-agent";
|
|
2
|
-
import type { RollbackCapture, RollbackScope, SettingsManager } from "./settings-manager.ts";
|
|
3
|
-
export declare const SETTINGS_TOOLS_BRIDGE_SYMBOL: unique symbol;
|
|
4
|
-
export interface SettingsToolsBridge {
|
|
5
|
-
getModelTiers(): Record<string, unknown>;
|
|
6
|
-
setModelTiers(update: {
|
|
7
|
-
enabled?: boolean;
|
|
8
|
-
light?: string;
|
|
9
|
-
standard?: string;
|
|
10
|
-
heavy?: string;
|
|
11
|
-
lightThinking?: ThinkingLevel | null;
|
|
12
|
-
standardThinking?: ThinkingLevel | null;
|
|
13
|
-
heavyThinking?: ThinkingLevel | null;
|
|
14
|
-
}): void;
|
|
15
|
-
getAutoManageSubscriptions(): boolean;
|
|
16
|
-
setAutoManageSubscriptions(enabled: boolean): void;
|
|
17
|
-
getRollback(): {
|
|
18
|
-
enabled: boolean;
|
|
19
|
-
turns: number;
|
|
20
|
-
capture: RollbackCapture;
|
|
21
|
-
scope: RollbackScope;
|
|
22
|
-
forcedByAuto: boolean;
|
|
23
|
-
};
|
|
24
|
-
setRollback(update: {
|
|
25
|
-
enabled?: boolean;
|
|
26
|
-
turns?: number;
|
|
27
|
-
capture?: RollbackCapture;
|
|
28
|
-
scope?: RollbackScope;
|
|
29
|
-
}): void;
|
|
30
|
-
getSessionRetentionDays(): number;
|
|
31
|
-
setSessionRetentionDays(days: number): void;
|
|
32
|
-
}
|
|
33
|
-
export declare function registerSettingsToolsBridge(settingsManager: SettingsManager, getSessionId?: () => string | undefined): void;
|
|
34
|
-
export declare function getSettingsToolsBridge(): SettingsToolsBridge | undefined;
|
|
35
|
-
//# sourceMappingURL=settings-tools-bridge.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"settings-tools-bridge.d.ts","sourceRoot":"","sources":["../../src/core/settings-tools-bridge.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAEnE,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7F,eAAO,MAAM,4BAA4B,eAAqC,CAAC;AAE/E,MAAM,WAAW,mBAAmB;IACnC,aAAa,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACzC,aAAa,CAAC,MAAM,EAAE;QACrB,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,aAAa,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;QACrC,gBAAgB,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;QACxC,aAAa,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;KACrC,GAAG,IAAI,CAAC;IACT,0BAA0B,IAAI,OAAO,CAAC;IACtC,0BAA0B,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IACnD,WAAW,IAAI;QACd,OAAO,EAAE,OAAO,CAAC;QACjB,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,eAAe,CAAC;QACzB,KAAK,EAAE,aAAa,CAAC;QACrB,YAAY,EAAE,OAAO,CAAC;KACtB,CAAC;IACF,WAAW,CAAC,MAAM,EAAE;QAAE,OAAO,CAAC,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,eAAe,CAAC;QAAC,KAAK,CAAC,EAAE,aAAa,CAAA;KAAE,GAAG,IAAI,CAAC;IACnH,uBAAuB,IAAI,MAAM,CAAC;IAClC,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5C;AA0CD,wBAAgB,2BAA2B,CAC1C,eAAe,EAAE,eAAe,EAChC,YAAY,CAAC,EAAE,MAAM,MAAM,GAAG,SAAS,GACrC,IAAI,CAIN;AAED,wBAAgB,sBAAsB,IAAI,mBAAmB,GAAG,SAAS,CAExE","sourcesContent":["import type { ThinkingLevel } from \"@ashx-j/lunr-agent\";\nimport { isRollbackSessionForceEnabled } from \"./rollback.ts\";\nimport type { RollbackCapture, RollbackScope, SettingsManager } from \"./settings-manager.ts\";\n\nexport const SETTINGS_TOOLS_BRIDGE_SYMBOL = Symbol.for(\"@lunr/settings-tools\");\n\nexport interface SettingsToolsBridge {\n\tgetModelTiers(): Record<string, unknown>;\n\tsetModelTiers(update: {\n\t\tenabled?: boolean;\n\t\tlight?: string;\n\t\tstandard?: string;\n\t\theavy?: string;\n\t\tlightThinking?: ThinkingLevel | null;\n\t\tstandardThinking?: ThinkingLevel | null;\n\t\theavyThinking?: ThinkingLevel | null;\n\t}): void;\n\tgetAutoManageSubscriptions(): boolean;\n\tsetAutoManageSubscriptions(enabled: boolean): void;\n\tgetRollback(): {\n\t\tenabled: boolean;\n\t\tturns: number;\n\t\tcapture: RollbackCapture;\n\t\tscope: RollbackScope;\n\t\tforcedByAuto: boolean;\n\t};\n\tsetRollback(update: { enabled?: boolean; turns?: number; capture?: RollbackCapture; scope?: RollbackScope }): void;\n\tgetSessionRetentionDays(): number;\n\tsetSessionRetentionDays(days: number): void;\n}\n\nlet activeSettingsManager: SettingsManager | undefined;\nlet sessionIdProvider: (() => string | undefined) | undefined;\n\nfunction manager(): SettingsManager {\n\tif (!activeSettingsManager) throw new Error(\"Settings are unavailable in this runtime. Reload lunR and try again.\");\n\treturn activeSettingsManager;\n}\n\nconst bridge: SettingsToolsBridge = {\n\tgetModelTiers: () => manager().getModelTiers() as Record<string, unknown>,\n\tsetModelTiers(update) {\n\t\tconst settings = manager();\n\t\tif (update.enabled !== undefined) settings.setModelTiersEnabled(update.enabled);\n\t\tfor (const tier of [\"light\", \"standard\", \"heavy\"] as const) {\n\t\t\tconst model = update[tier];\n\t\t\tif (model !== undefined) settings.setTierModel(tier, model);\n\t\t\tconst key = `${tier}Thinking` as const;\n\t\t\tif (update[key] !== undefined) settings.setTierThinking(tier, update[key] ?? undefined);\n\t\t}\n\t},\n\tgetAutoManageSubscriptions: () => manager().getAutoManageSubscriptions(),\n\tsetAutoManageSubscriptions: (enabled) => manager().setAutoManageSubscriptions(enabled),\n\tgetRollback: () => ({\n\t\tenabled: manager().getRollbackEnabled(),\n\t\tturns: manager().getRollbackTurns(),\n\t\tcapture: manager().getRollbackCapture(),\n\t\tscope: manager().getRollbackScope(),\n\t\tforcedByAuto: isRollbackSessionForceEnabled(sessionIdProvider?.()),\n\t}),\n\tsetRollback(update) {\n\t\tconst settings = manager();\n\t\tif (update.enabled !== undefined) settings.setRollbackEnabled(update.enabled);\n\t\tif (update.turns !== undefined) settings.setRollbackTurns(update.turns);\n\t\tif (update.capture !== undefined) settings.setRollbackCapture(update.capture);\n\t\tif (update.scope !== undefined) settings.setRollbackScope(update.scope);\n\t},\n\tgetSessionRetentionDays: () => manager().getSessionRetentionDays(),\n\tsetSessionRetentionDays: (days) => manager().setSessionRetentionDays(days),\n};\n\nexport function registerSettingsToolsBridge(\n\tsettingsManager: SettingsManager,\n\tgetSessionId?: () => string | undefined,\n): void {\n\tactiveSettingsManager = settingsManager;\n\tsessionIdProvider = getSessionId;\n\t(globalThis as Record<symbol, unknown>)[SETTINGS_TOOLS_BRIDGE_SYMBOL] = bridge;\n}\n\nexport function getSettingsToolsBridge(): SettingsToolsBridge | undefined {\n\treturn (globalThis as Record<symbol, unknown>)[SETTINGS_TOOLS_BRIDGE_SYMBOL] as SettingsToolsBridge | undefined;\n}\n"]}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { isRollbackSessionForceEnabled } from "./rollback.js";
|
|
2
|
-
export const SETTINGS_TOOLS_BRIDGE_SYMBOL = Symbol.for("@lunr/settings-tools");
|
|
3
|
-
let activeSettingsManager;
|
|
4
|
-
let sessionIdProvider;
|
|
5
|
-
function manager() {
|
|
6
|
-
if (!activeSettingsManager)
|
|
7
|
-
throw new Error("Settings are unavailable in this runtime. Reload lunR and try again.");
|
|
8
|
-
return activeSettingsManager;
|
|
9
|
-
}
|
|
10
|
-
const bridge = {
|
|
11
|
-
getModelTiers: () => manager().getModelTiers(),
|
|
12
|
-
setModelTiers(update) {
|
|
13
|
-
const settings = manager();
|
|
14
|
-
if (update.enabled !== undefined)
|
|
15
|
-
settings.setModelTiersEnabled(update.enabled);
|
|
16
|
-
for (const tier of ["light", "standard", "heavy"]) {
|
|
17
|
-
const model = update[tier];
|
|
18
|
-
if (model !== undefined)
|
|
19
|
-
settings.setTierModel(tier, model);
|
|
20
|
-
const key = `${tier}Thinking`;
|
|
21
|
-
if (update[key] !== undefined)
|
|
22
|
-
settings.setTierThinking(tier, update[key] ?? undefined);
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
getAutoManageSubscriptions: () => manager().getAutoManageSubscriptions(),
|
|
26
|
-
setAutoManageSubscriptions: (enabled) => manager().setAutoManageSubscriptions(enabled),
|
|
27
|
-
getRollback: () => ({
|
|
28
|
-
enabled: manager().getRollbackEnabled(),
|
|
29
|
-
turns: manager().getRollbackTurns(),
|
|
30
|
-
capture: manager().getRollbackCapture(),
|
|
31
|
-
scope: manager().getRollbackScope(),
|
|
32
|
-
forcedByAuto: isRollbackSessionForceEnabled(sessionIdProvider?.()),
|
|
33
|
-
}),
|
|
34
|
-
setRollback(update) {
|
|
35
|
-
const settings = manager();
|
|
36
|
-
if (update.enabled !== undefined)
|
|
37
|
-
settings.setRollbackEnabled(update.enabled);
|
|
38
|
-
if (update.turns !== undefined)
|
|
39
|
-
settings.setRollbackTurns(update.turns);
|
|
40
|
-
if (update.capture !== undefined)
|
|
41
|
-
settings.setRollbackCapture(update.capture);
|
|
42
|
-
if (update.scope !== undefined)
|
|
43
|
-
settings.setRollbackScope(update.scope);
|
|
44
|
-
},
|
|
45
|
-
getSessionRetentionDays: () => manager().getSessionRetentionDays(),
|
|
46
|
-
setSessionRetentionDays: (days) => manager().setSessionRetentionDays(days),
|
|
47
|
-
};
|
|
48
|
-
export function registerSettingsToolsBridge(settingsManager, getSessionId) {
|
|
49
|
-
activeSettingsManager = settingsManager;
|
|
50
|
-
sessionIdProvider = getSessionId;
|
|
51
|
-
globalThis[SETTINGS_TOOLS_BRIDGE_SYMBOL] = bridge;
|
|
52
|
-
}
|
|
53
|
-
export function getSettingsToolsBridge() {
|
|
54
|
-
return globalThis[SETTINGS_TOOLS_BRIDGE_SYMBOL];
|
|
55
|
-
}
|
|
56
|
-
//# sourceMappingURL=settings-tools-bridge.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"settings-tools-bridge.js","sourceRoot":"","sources":["../../src/core/settings-tools-bridge.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,6BAA6B,EAAE,MAAM,eAAe,CAAC;AAG9D,MAAM,CAAC,MAAM,4BAA4B,GAAG,MAAM,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;AA2B/E,IAAI,qBAAkD,CAAC;AACvD,IAAI,iBAAyD,CAAC;AAE9D,SAAS,OAAO,GAAoB;IACnC,IAAI,CAAC,qBAAqB;QAAE,MAAM,IAAI,KAAK,CAAC,sEAAsE,CAAC,CAAC;IACpH,OAAO,qBAAqB,CAAC;AAAA,CAC7B;AAED,MAAM,MAAM,GAAwB;IACnC,aAAa,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC,aAAa,EAA6B;IACzE,aAAa,CAAC,MAAM,EAA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AM,CAAC,OAAO,CAAC,CAAC;QAC9E,IAAI,MAAM,CAAC,KAAK,KAAK,SAAS;YAAE,QAAQ,CAAC,gBAAgB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACxE,IAAI,MAAM,CAAC,OAAO,KAAK,SAAS;YAAE,QAAQ,CAAC,kBAAkB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAC9E,IAAI,MAAM,CAAC,KAAK,KAAK,SAAS;YAAE,QAAQ,CAAC,gBAAgB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAAA,CACxE;IACD,uBAAuB,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC,uBAAuB,EAAE;IAClE,uBAAuB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,EAAE,CAAC,uBAAuB,CAAC,IAAI,CAAC;CAC1E,CAAC;AAEF,MAAM,UAAU,2BAA2B,CAC1C,eAAgC,EAChC,YAAuC,EAChC;IACP,qBAAqB,GAAG,eAAe,CAAC;IACxC,iBAAiB,GAAG,YAAY,CAAC;IAChC,UAAsC,CAAC,4BAA4B,CAAC,GAAG,MAAM,CAAC;AAAA,CAC/E;AAED,MAAM,UAAU,sBAAsB,GAAoC;IACzE,OAAQ,UAAsC,CAAC,4BAA4B,CAAoC,CAAC;AAAA,CAChH","sourcesContent":["import type { ThinkingLevel } from \"@ashx-j/lunr-agent\";\nimport { isRollbackSessionForceEnabled } from \"./rollback.ts\";\nimport type { RollbackCapture, RollbackScope, SettingsManager } from \"./settings-manager.ts\";\n\nexport const SETTINGS_TOOLS_BRIDGE_SYMBOL = Symbol.for(\"@lunr/settings-tools\");\n\nexport interface SettingsToolsBridge {\n\tgetModelTiers(): Record<string, unknown>;\n\tsetModelTiers(update: {\n\t\tenabled?: boolean;\n\t\tlight?: string;\n\t\tstandard?: string;\n\t\theavy?: string;\n\t\tlightThinking?: ThinkingLevel | null;\n\t\tstandardThinking?: ThinkingLevel | null;\n\t\theavyThinking?: ThinkingLevel | null;\n\t}): void;\n\tgetAutoManageSubscriptions(): boolean;\n\tsetAutoManageSubscriptions(enabled: boolean): void;\n\tgetRollback(): {\n\t\tenabled: boolean;\n\t\tturns: number;\n\t\tcapture: RollbackCapture;\n\t\tscope: RollbackScope;\n\t\tforcedByAuto: boolean;\n\t};\n\tsetRollback(update: { enabled?: boolean; turns?: number; capture?: RollbackCapture; scope?: RollbackScope }): void;\n\tgetSessionRetentionDays(): number;\n\tsetSessionRetentionDays(days: number): void;\n}\n\nlet activeSettingsManager: SettingsManager | undefined;\nlet sessionIdProvider: (() => string | undefined) | undefined;\n\nfunction manager(): SettingsManager {\n\tif (!activeSettingsManager) throw new Error(\"Settings are unavailable in this runtime. Reload lunR and try again.\");\n\treturn activeSettingsManager;\n}\n\nconst bridge: SettingsToolsBridge = {\n\tgetModelTiers: () => manager().getModelTiers() as Record<string, unknown>,\n\tsetModelTiers(update) {\n\t\tconst settings = manager();\n\t\tif (update.enabled !== undefined) settings.setModelTiersEnabled(update.enabled);\n\t\tfor (const tier of [\"light\", \"standard\", \"heavy\"] as const) {\n\t\t\tconst model = update[tier];\n\t\t\tif (model !== undefined) settings.setTierModel(tier, model);\n\t\t\tconst key = `${tier}Thinking` as const;\n\t\t\tif (update[key] !== undefined) settings.setTierThinking(tier, update[key] ?? undefined);\n\t\t}\n\t},\n\tgetAutoManageSubscriptions: () => manager().getAutoManageSubscriptions(),\n\tsetAutoManageSubscriptions: (enabled) => manager().setAutoManageSubscriptions(enabled),\n\tgetRollback: () => ({\n\t\tenabled: manager().getRollbackEnabled(),\n\t\tturns: manager().getRollbackTurns(),\n\t\tcapture: manager().getRollbackCapture(),\n\t\tscope: manager().getRollbackScope(),\n\t\tforcedByAuto: isRollbackSessionForceEnabled(sessionIdProvider?.()),\n\t}),\n\tsetRollback(update) {\n\t\tconst settings = manager();\n\t\tif (update.enabled !== undefined) settings.setRollbackEnabled(update.enabled);\n\t\tif (update.turns !== undefined) settings.setRollbackTurns(update.turns);\n\t\tif (update.capture !== undefined) settings.setRollbackCapture(update.capture);\n\t\tif (update.scope !== undefined) settings.setRollbackScope(update.scope);\n\t},\n\tgetSessionRetentionDays: () => manager().getSessionRetentionDays(),\n\tsetSessionRetentionDays: (days) => manager().setSessionRetentionDays(days),\n};\n\nexport function registerSettingsToolsBridge(\n\tsettingsManager: SettingsManager,\n\tgetSessionId?: () => string | undefined,\n): void {\n\tactiveSettingsManager = settingsManager;\n\tsessionIdProvider = getSessionId;\n\t(globalThis as Record<symbol, unknown>)[SETTINGS_TOOLS_BRIDGE_SYMBOL] = bridge;\n}\n\nexport function getSettingsToolsBridge(): SettingsToolsBridge | undefined {\n\treturn (globalThis as Record<symbol, unknown>)[SETTINGS_TOOLS_BRIDGE_SYMBOL] as SettingsToolsBridge | undefined;\n}\n"]}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { createRequire as __lunrRequire } from "node:module"; const require = __lunrRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
getModelTiersBridge,
|
|
4
|
-
registerModelTierBridge
|
|
5
|
-
} from "./chunk-W3CVH5RX.js";
|
|
6
|
-
import {
|
|
7
|
-
isRollbackSessionForceEnabled,
|
|
8
|
-
registerUsageServiceBridge
|
|
9
|
-
} from "./chunk-PNJSG3IZ.js";
|
|
10
|
-
import {
|
|
11
|
-
registerCustomizeBridge
|
|
12
|
-
} from "./chunk-HQCKFM2O.js";
|
|
13
|
-
import {
|
|
14
|
-
registerMemoryCapBridge
|
|
15
|
-
} from "./chunk-AY6CAJSL.js";
|
|
16
|
-
|
|
17
|
-
// packages/coding-agent/dist/core/settings-tools-bridge.js
|
|
18
|
-
var SETTINGS_TOOLS_BRIDGE_SYMBOL = /* @__PURE__ */ Symbol.for("@lunr/settings-tools"), activeSettingsManager, sessionIdProvider;
|
|
19
|
-
function manager() {
|
|
20
|
-
if (!activeSettingsManager)
|
|
21
|
-
throw new Error("Settings are unavailable in this runtime. Reload lunR and try again.");
|
|
22
|
-
return activeSettingsManager;
|
|
23
|
-
}
|
|
24
|
-
var bridge = {
|
|
25
|
-
getModelTiers: () => manager().getModelTiers(),
|
|
26
|
-
setModelTiers(update) {
|
|
27
|
-
let settings = manager();
|
|
28
|
-
update.enabled !== void 0 && settings.setModelTiersEnabled(update.enabled);
|
|
29
|
-
for (let tier of ["light", "standard", "heavy"]) {
|
|
30
|
-
let model = update[tier];
|
|
31
|
-
model !== void 0 && settings.setTierModel(tier, model);
|
|
32
|
-
let key = `${tier}Thinking`;
|
|
33
|
-
update[key] !== void 0 && settings.setTierThinking(tier, update[key] ?? void 0);
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
getAutoManageSubscriptions: () => manager().getAutoManageSubscriptions(),
|
|
37
|
-
setAutoManageSubscriptions: (enabled) => manager().setAutoManageSubscriptions(enabled),
|
|
38
|
-
getRollback: () => ({
|
|
39
|
-
enabled: manager().getRollbackEnabled(),
|
|
40
|
-
turns: manager().getRollbackTurns(),
|
|
41
|
-
capture: manager().getRollbackCapture(),
|
|
42
|
-
scope: manager().getRollbackScope(),
|
|
43
|
-
forcedByAuto: isRollbackSessionForceEnabled(sessionIdProvider?.())
|
|
44
|
-
}),
|
|
45
|
-
setRollback(update) {
|
|
46
|
-
let settings = manager();
|
|
47
|
-
update.enabled !== void 0 && settings.setRollbackEnabled(update.enabled), update.turns !== void 0 && settings.setRollbackTurns(update.turns), update.capture !== void 0 && settings.setRollbackCapture(update.capture), update.scope !== void 0 && settings.setRollbackScope(update.scope);
|
|
48
|
-
},
|
|
49
|
-
getSessionRetentionDays: () => manager().getSessionRetentionDays(),
|
|
50
|
-
setSessionRetentionDays: (days) => manager().setSessionRetentionDays(days)
|
|
51
|
-
};
|
|
52
|
-
function registerSettingsToolsBridge(settingsManager, getSessionId) {
|
|
53
|
-
activeSettingsManager = settingsManager, sessionIdProvider = getSessionId, globalThis[SETTINGS_TOOLS_BRIDGE_SYMBOL] = bridge;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// packages/coding-agent/dist/core/runtime-bridges.js
|
|
57
|
-
function bindRuntimeBridges({ session, services }) {
|
|
58
|
-
let { settingsManager, modelRuntime } = services;
|
|
59
|
-
registerModelTierBridge(settingsManager), getModelTiersBridge()?.setParentThinkingProvider(() => session.thinkingLevel), registerMemoryCapBridge(settingsManager), registerCustomizeBridge(settingsManager), registerUsageServiceBridge(modelRuntime, settingsManager), registerSettingsToolsBridge(settingsManager, () => session.sessionId);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export {
|
|
63
|
-
bindRuntimeBridges
|
|
64
|
-
};
|