@ashx-j/lunr 0.2.18 → 0.2.20

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.
Files changed (190) hide show
  1. package/CHANGELOG.md +31 -1
  2. package/README.md +2 -2
  3. package/dist/builtin-extensions/ashxj-tui.d.ts +2 -2
  4. package/dist/builtin-extensions/ashxj-tui.d.ts.map +1 -1
  5. package/dist/builtin-extensions/ashxj-tui.js +11 -8
  6. package/dist/builtin-extensions/ashxj-tui.js.map +1 -1
  7. package/dist/builtin-extensions/index.d.ts.map +1 -1
  8. package/dist/builtin-extensions/index.js +0 -2
  9. package/dist/builtin-extensions/index.js.map +1 -1
  10. package/dist/builtin-extensions/pi-intercom/broker/spawn.d.ts +6 -4
  11. package/dist/builtin-extensions/pi-intercom/broker/spawn.d.ts.map +1 -1
  12. package/dist/builtin-extensions/pi-intercom/broker/spawn.js +93 -49
  13. package/dist/builtin-extensions/pi-intercom/broker/spawn.js.map +1 -1
  14. package/dist/builtin-extensions/pi-intercom/index.d.ts.map +1 -1
  15. package/dist/builtin-extensions/pi-intercom/index.js +351 -351
  16. package/dist/builtin-extensions/pi-intercom/index.js.map +1 -1
  17. package/dist/builtin-extensions/pi-subagents/src/extension/index.d.ts +2 -1
  18. package/dist/builtin-extensions/pi-subagents/src/extension/index.d.ts.map +1 -1
  19. package/dist/builtin-extensions/pi-subagents/src/extension/index.js +80 -43
  20. package/dist/builtin-extensions/pi-subagents/src/extension/index.js.map +1 -1
  21. package/dist/builtin-extensions/pi-subagents/src/extension/schemas.d.ts +18 -8
  22. package/dist/builtin-extensions/pi-subagents/src/extension/schemas.d.ts.map +1 -1
  23. package/dist/builtin-extensions/pi-subagents/src/extension/schemas.js +36 -11
  24. package/dist/builtin-extensions/pi-subagents/src/extension/schemas.js.map +1 -1
  25. package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.d.ts +4 -3
  26. package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.d.ts.map +1 -1
  27. package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.js +21 -12
  28. package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.js.map +1 -1
  29. package/dist/builtin-extensions/pi-subagents/src/intercom/native-supervisor-channel.d.ts +7 -1
  30. package/dist/builtin-extensions/pi-subagents/src/intercom/native-supervisor-channel.d.ts.map +1 -1
  31. package/dist/builtin-extensions/pi-subagents/src/intercom/native-supervisor-channel.js +225 -15
  32. package/dist/builtin-extensions/pi-subagents/src/intercom/native-supervisor-channel.js.map +1 -1
  33. package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-ask.d.ts +29 -0
  34. package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-ask.d.ts.map +1 -0
  35. package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-ask.js +179 -0
  36. package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-ask.js.map +1 -0
  37. package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-questions.d.ts +89 -0
  38. package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-questions.d.ts.map +1 -0
  39. package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-questions.js +541 -0
  40. package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-questions.js.map +1 -0
  41. package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.d.ts +9 -1
  42. package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.d.ts.map +1 -1
  43. package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.js +34 -9
  44. package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.js.map +1 -1
  45. package/dist/builtin-extensions/pi-subagents/src/runs/background/async-job-tracker.d.ts.map +1 -1
  46. package/dist/builtin-extensions/pi-subagents/src/runs/background/async-job-tracker.js +1 -2
  47. package/dist/builtin-extensions/pi-subagents/src/runs/background/async-job-tracker.js.map +1 -1
  48. package/dist/builtin-extensions/pi-subagents/src/runs/background/async-resume.d.ts +2 -1
  49. package/dist/builtin-extensions/pi-subagents/src/runs/background/async-resume.d.ts.map +1 -1
  50. package/dist/builtin-extensions/pi-subagents/src/runs/background/async-resume.js +35 -8
  51. package/dist/builtin-extensions/pi-subagents/src/runs/background/async-resume.js.map +1 -1
  52. package/dist/builtin-extensions/pi-subagents/src/runs/background/notify.d.ts +1 -1
  53. package/dist/builtin-extensions/pi-subagents/src/runs/background/notify.d.ts.map +1 -1
  54. package/dist/builtin-extensions/pi-subagents/src/runs/background/notify.js +3 -3
  55. package/dist/builtin-extensions/pi-subagents/src/runs/background/notify.js.map +1 -1
  56. package/dist/builtin-extensions/pi-subagents/src/runs/background/result-watcher.d.ts +1 -0
  57. package/dist/builtin-extensions/pi-subagents/src/runs/background/result-watcher.d.ts.map +1 -1
  58. package/dist/builtin-extensions/pi-subagents/src/runs/background/result-watcher.js +54 -38
  59. package/dist/builtin-extensions/pi-subagents/src/runs/background/result-watcher.js.map +1 -1
  60. package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-wait.d.ts +3 -6
  61. package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-wait.d.ts.map +1 -1
  62. package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-wait.js +64 -5
  63. package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-wait.js.map +1 -1
  64. package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.d.ts.map +1 -1
  65. package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.js +1 -0
  66. package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.js.map +1 -1
  67. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-execution.d.ts.map +1 -1
  68. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-execution.js +21 -8
  69. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-execution.js.map +1 -1
  70. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.d.ts.map +1 -1
  71. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.js +62 -16
  72. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.js.map +1 -1
  73. package/dist/builtin-extensions/pi-subagents/src/runs/shared/acceptance.d.ts +2 -0
  74. package/dist/builtin-extensions/pi-subagents/src/runs/shared/acceptance.d.ts.map +1 -1
  75. package/dist/builtin-extensions/pi-subagents/src/runs/shared/acceptance.js +75 -18
  76. package/dist/builtin-extensions/pi-subagents/src/runs/shared/acceptance.js.map +1 -1
  77. package/dist/builtin-extensions/pi-subagents/src/runs/shared/model-fallback.d.ts +13 -1
  78. package/dist/builtin-extensions/pi-subagents/src/runs/shared/model-fallback.d.ts.map +1 -1
  79. package/dist/builtin-extensions/pi-subagents/src/runs/shared/model-fallback.js +67 -11
  80. package/dist/builtin-extensions/pi-subagents/src/runs/shared/model-fallback.js.map +1 -1
  81. package/dist/builtin-extensions/pi-subagents/src/runs/shared/pi-args.d.ts.map +1 -1
  82. package/dist/builtin-extensions/pi-subagents/src/runs/shared/pi-args.js +5 -2
  83. package/dist/builtin-extensions/pi-subagents/src/runs/shared/pi-args.js.map +1 -1
  84. package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.d.ts.map +1 -1
  85. package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.js +13 -3
  86. package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.js.map +1 -1
  87. package/dist/builtin-extensions/pi-subagents/src/shared/child-spec.d.ts +3 -0
  88. package/dist/builtin-extensions/pi-subagents/src/shared/child-spec.d.ts.map +1 -1
  89. package/dist/builtin-extensions/pi-subagents/src/shared/child-spec.js +68 -11
  90. package/dist/builtin-extensions/pi-subagents/src/shared/child-spec.js.map +1 -1
  91. package/dist/builtin-extensions/pi-subagents/src/shared/formatters.d.ts +12 -1
  92. package/dist/builtin-extensions/pi-subagents/src/shared/formatters.d.ts.map +1 -1
  93. package/dist/builtin-extensions/pi-subagents/src/shared/formatters.js +21 -2
  94. package/dist/builtin-extensions/pi-subagents/src/shared/formatters.js.map +1 -1
  95. package/dist/builtin-extensions/pi-subagents/src/shared/types.d.ts +16 -4
  96. package/dist/builtin-extensions/pi-subagents/src/shared/types.d.ts.map +1 -1
  97. package/dist/builtin-extensions/pi-subagents/src/shared/types.js +1 -1
  98. package/dist/builtin-extensions/pi-subagents/src/shared/types.js.map +1 -1
  99. package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.d.ts +2 -0
  100. package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.d.ts.map +1 -1
  101. package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.js +24 -6
  102. package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.js.map +1 -1
  103. package/dist/builtin-extensions/pi-subagents/src/tui/render.d.ts +44 -4
  104. package/dist/builtin-extensions/pi-subagents/src/tui/render.d.ts.map +1 -1
  105. package/dist/builtin-extensions/pi-subagents/src/tui/render.js +227 -133
  106. package/dist/builtin-extensions/pi-subagents/src/tui/render.js.map +1 -1
  107. package/dist/builtin-extensions/pi-subagents/src/watchdog/register-main.d.ts.map +1 -1
  108. package/dist/builtin-extensions/pi-subagents/src/watchdog/register-main.js +1 -1
  109. package/dist/builtin-extensions/pi-subagents/src/watchdog/register-main.js.map +1 -1
  110. package/dist/builtin-extensions/pi-subagents/src/watchdog/tool-actions.d.ts +2 -13
  111. package/dist/builtin-extensions/pi-subagents/src/watchdog/tool-actions.d.ts.map +1 -1
  112. package/dist/builtin-extensions/pi-subagents/src/watchdog/tool-actions.js +5 -91
  113. package/dist/builtin-extensions/pi-subagents/src/watchdog/tool-actions.js.map +1 -1
  114. package/dist/core/permissions.d.ts +1 -0
  115. package/dist/core/permissions.d.ts.map +1 -1
  116. package/dist/core/permissions.js +8 -4
  117. package/dist/core/permissions.js.map +1 -1
  118. package/dist/core/plan-mode.d.ts.map +1 -1
  119. package/dist/core/plan-mode.js +0 -5
  120. package/dist/core/plan-mode.js.map +1 -1
  121. package/dist/core/runtime-bridges.d.ts.map +1 -1
  122. package/dist/core/runtime-bridges.js +0 -2
  123. package/dist/core/runtime-bridges.js.map +1 -1
  124. package/dist/core/subagent-cancellation.d.ts +21 -0
  125. package/dist/core/subagent-cancellation.d.ts.map +1 -0
  126. package/dist/core/subagent-cancellation.js +53 -0
  127. package/dist/core/subagent-cancellation.js.map +1 -0
  128. package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  129. package/dist/modes/interactive/components/assistant-message.js +12 -18
  130. package/dist/modes/interactive/components/assistant-message.js.map +1 -1
  131. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  132. package/dist/modes/interactive/components/tool-execution.js +12 -0
  133. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  134. package/dist/modes/interactive/interactive-mode.d.ts +1 -2
  135. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  136. package/dist/modes/interactive/interactive-mode.js +29 -22
  137. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  138. package/dist/node-runtime/{agent-session-services-35WNVGMR.js → agent-session-services-75JKASCW.js} +3 -3
  139. package/dist/node-runtime/{builtin-extensions-QATGXENO.js → builtin-extensions-X4JMM4ZS.js} +3 -3
  140. package/dist/node-runtime/{chunk-XATUM2HK.js → chunk-25I2BHAA.js} +1 -1
  141. package/dist/node-runtime/{chunk-MCUNIRD5.js → chunk-46ECNOLF.js} +477 -246
  142. package/dist/node-runtime/{chunk-J26TSGDL.js → chunk-6N22HULO.js} +8 -5
  143. package/dist/node-runtime/{chunk-NI6OTSBH.js → chunk-AL2FMKKM.js} +7 -7
  144. package/dist/node-runtime/chunk-AOFXZQKA.js +24 -0
  145. package/dist/node-runtime/chunk-BBUVIEZB.js +51 -0
  146. package/dist/node-runtime/{chunk-EBF6COVM.js → chunk-ELWEXVO5.js} +7 -7
  147. package/dist/node-runtime/{chunk-R5EDISSV.js → chunk-JHYKXIMM.js} +5 -2
  148. package/dist/node-runtime/{chunk-ATGA2WLC.js → chunk-JYNNB7DU.js} +397 -34
  149. package/dist/node-runtime/{chunk-ZBV7FAHG.js → chunk-K3646JTM.js} +17 -118
  150. package/dist/node-runtime/{chunk-PNJSG3IZ.js → chunk-LTYWTR3V.js} +1 -369
  151. package/dist/node-runtime/{chunk-G4P75AIS.js → chunk-QKFMBRAL.js} +47 -54
  152. package/dist/node-runtime/cli-runtime.js +1 -1
  153. package/dist/node-runtime/{command-AAV3YRR5.js → command-RBTRL55A.js} +1 -1
  154. package/dist/node-runtime/{gateway-OAC4OBBL.js → gateway-L4ANRTVE.js} +2 -2
  155. package/dist/node-runtime/index.js +10 -9
  156. package/dist/node-runtime/{interactive-mode-2SZUO53H.js → interactive-mode-HPUNH7SV.js} +5 -4
  157. package/dist/node-runtime/{interactive-view-S6J3QHEF.js → interactive-view-ILS6TAN5.js} +1 -1
  158. package/dist/node-runtime/{lunr-cron-AUUYP4N4.js → lunr-cron-NNYTWTGF.js} +2 -2
  159. package/dist/node-runtime/main.js +8 -8
  160. package/dist/node-runtime/{pi-intercom-EEMBGQID.js → pi-intercom-DDQMRNPJ.js} +96 -76
  161. package/dist/node-runtime/{pi-subagents-7YJ3I4VE.js → pi-subagents-T5WMMLBB.js} +1040 -318
  162. package/dist/node-runtime/rpc-entry.js +8 -8
  163. package/dist/node-runtime/{runtime-bridges-3RKBDLNA.js → runtime-bridges-NJQERQ72.js} +2 -4
  164. package/dist/node-runtime/{subagent-executor-5Q5A4HJ2.js → subagent-executor-SRFC26SJ.js} +168 -249
  165. package/docs/features.md +17 -3
  166. package/docs/keybindings.md +3 -1
  167. package/docs/settings.md +1 -1
  168. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  169. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  170. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  171. package/examples/extensions/gondolin/package-lock.json +2 -2
  172. package/examples/extensions/gondolin/package.json +1 -1
  173. package/examples/extensions/sandbox/package-lock.json +2 -2
  174. package/examples/extensions/sandbox/package.json +1 -1
  175. package/examples/extensions/with-deps/package-lock.json +2 -2
  176. package/examples/extensions/with-deps/package.json +1 -1
  177. package/package.json +4 -4
  178. package/dist/builtin-extensions/lunr-settings-tools.d.ts +0 -4
  179. package/dist/builtin-extensions/lunr-settings-tools.d.ts.map +0 -1
  180. package/dist/builtin-extensions/lunr-settings-tools.js +0 -120
  181. package/dist/builtin-extensions/lunr-settings-tools.js.map +0 -1
  182. package/dist/core/settings-tools-bridge.d.ts +0 -35
  183. package/dist/core/settings-tools-bridge.d.ts.map +0 -1
  184. package/dist/core/settings-tools-bridge.js +0 -56
  185. package/dist/core/settings-tools-bridge.js.map +0 -1
  186. package/dist/modes/interactive/injected-context.d.ts +0 -2
  187. package/dist/modes/interactive/injected-context.d.ts.map +0 -1
  188. package/dist/modes/interactive/injected-context.js +0 -7
  189. package/dist/modes/interactive/injected-context.js.map +0 -1
  190. package/dist/node-runtime/chunk-3NMWLTPV.js +0 -64
package/docs/features.md CHANGED
@@ -21,10 +21,24 @@ 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
+ Collapsed subagent rows (foreground and async) are one line: status glyph, description, selected tier or explicit model, tokens, and elapsed time. Running rows keep a live spinner and clock; completed collapsed rows freeze those stats. 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.
25
+
24
26
  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
27
 
26
28
  `/goal` sets a session goal and **forces session auto** permission mode.
27
29
 
30
+ ### Questions to async children
31
+
32
+ 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.
33
+
34
+ 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.
35
+
36
+ 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.
37
+
38
+ 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.
39
+
40
+ 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.
41
+
28
42
  ## Todos, memory, and global instructions
29
43
 
30
44
  - **Todos** — lunr-todos is a full-replace list. Completed todos prune on the next user turn (no leftover `✓ N done` footer).
@@ -83,10 +97,10 @@ Without runnable adapters (enabled platform + resolvable token), `lunr gateway`
83
97
  - `/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
98
  - 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
99
  - 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) is **interactive TUI only** (grapheme reveal at ~30 FPS). Print, RPC, and gateway stay unsmoothed.
100
+ - 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
101
  - 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 tiers: every child launch selects `light`, `standard`, or `heavy`. Configure authenticated models for those routes in `/settings`; a missing, disabled, unauthenticated, or unavailable route fails closed. Per-tier thinking is optional; unset inherits the parent session.
89
- - Settings tools: `settings_load` is always available to the model. It injects four narrowly scoped tools for model tiers, model instruction subscriptions, rollback behavior, and session retention only after the model requests them.
102
+ - 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.
103
+ - 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
104
 
91
105
  ## Updates, catalogs, local models
92
106
 
@@ -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` | Cancel / abort |
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
@@ -68,7 +68,7 @@ Use `/trust` in interactive mode to save a project trust decision for future ses
68
68
  | `confirmLargeSubagentLaunches` | boolean | `true` | Ask once before aggregate launches of three or more children outside Auto mode |
69
69
  | `enableAnalytics` | boolean | `false` | Opt-in analytics data sharing. Currently only asked for during the experimental first-time setup (`PI_EXPERIMENTAL=1`) |
70
70
  | `trackingId` | string | - | Analytics tracking identifier, generated when `enableAnalytics` is turned on |
71
- | `doubleEscapeAction` | string | `"tree"` | Action for double-escape: `"tree"`, `"fork"`, or `"none"` |
71
+ | `doubleEscapeAction` | string | `"tree"` | Idle action for double-escape: `"tree"`, `"fork"`, or `"none"`. Active async subagents take priority: double-Escape requests their stop |
72
72
  | `treeFilterMode` | string | `"default"` | Default filter for `/tree`: `"default"`, `"no-tools"`, `"user-only"`, `"labeled-only"`, `"all"` |
73
73
  | `editorPaddingX` | number | `0` | Horizontal padding for input editor (0-3) |
74
74
  | `outputPad` | number | `1` | Horizontal padding for user messages, assistant messages, and thinking (0 or 1) |
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pi-extension-custom-provider",
3
- "version": "0.2.18",
3
+ "version": "0.2.19",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pi-extension-custom-provider",
9
- "version": "0.2.18",
9
+ "version": "0.2.19",
10
10
  "dependencies": {
11
11
  "@anthropic-ai/sdk": "^0.52.0"
12
12
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-extension-custom-provider-anthropic",
3
3
  "private": true,
4
- "version": "0.2.18",
4
+ "version": "0.2.19",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-extension-custom-provider-gitlab-duo",
3
3
  "private": true,
4
- "version": "0.2.18",
4
+ "version": "0.2.19",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pi-extension-gondolin",
3
- "version": "0.2.18",
3
+ "version": "0.2.19",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pi-extension-gondolin",
9
- "version": "0.2.18",
9
+ "version": "0.2.19",
10
10
  "dependencies": {
11
11
  "@earendil-works/gondolin": "0.12.0"
12
12
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-extension-gondolin",
3
3
  "private": true,
4
- "version": "0.2.18",
4
+ "version": "0.2.19",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pi-extension-sandbox",
3
- "version": "0.2.18",
3
+ "version": "0.2.19",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pi-extension-sandbox",
9
- "version": "0.2.18",
9
+ "version": "0.2.19",
10
10
  "dependencies": {
11
11
  "@anthropic-ai/sandbox-runtime": "^0.0.26"
12
12
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-extension-sandbox",
3
3
  "private": true,
4
- "version": "0.2.18",
4
+ "version": "0.2.19",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pi-extension-with-deps",
3
- "version": "0.2.18",
3
+ "version": "0.2.19",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pi-extension-with-deps",
9
- "version": "0.2.18",
9
+ "version": "0.2.19",
10
10
  "dependencies": {
11
11
  "ms": "^2.1.3"
12
12
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-extension-with-deps",
3
3
  "private": true,
4
- "version": "0.2.18",
4
+ "version": "0.2.19",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ashx-j/lunr",
3
- "version": "0.2.18",
3
+ "version": "0.2.20",
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.18",
41
- "@ashx-j/lunr-ai": "^0.2.18",
42
- "@ashx-j/lunr-tui": "^0.2.18",
40
+ "@ashx-j/lunr-agent": "^0.2.20",
41
+ "@ashx-j/lunr-ai": "^0.2.20",
42
+ "@ashx-j/lunr-tui": "^0.2.20",
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;IAC3C,sBAAsB;IACtB,wBAAwB;IACxB,mBAAmB;IACnB,4BAA4B;CACnB,CAAC;AAEX,SAAS,cAAc,GAAQ;IAC9B,MAAM,MAAM,GAAI,UAAsC,CAAC,eAAe,CAAC,CAAC;IACxE,IAAI,CAAC,MAAM;QAAE,MAAM,IAAI,KAAK,CAAC,sEAAsE,CAAC,CAAC;IACrG,OAAO,MAAM,CAAC;AAAA,CACd;AAED,SAAS,IAAI,CAAC,KAAc,EAAE,QAAgB,EAAE;IAC/C,OAAO;QACN,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,QAAQ,EAAE,EAAE,CAAC;QAC9F,OAAO,EAAE,KAAK;KACd,CAAC;AAAA,CACF;AAED,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC;IAC3B,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;IACzF,IAAI,CAAC,OAAO,CAAC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G,MAAM,CAAC;YAC7B,qBAAqB,EAAE,CAAC;YACxB,EAAE,CAAC,cAAc,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,cAAc,EAAE,EAAE,GAAG,4BAA4B,CAAC,CAAC,CAAC,CAAC,CAAC;YAC3F,OAAO,IAAI,CACV,EAAE,SAAS,EAAE,CAAC,GAAG,4BAA4B,CAAC,EAAE,aAAa,EAAE,EAC/D,4IAA4I,CAC5I,CAAC;QAAA,CACF;KACD,CAAC,CAAC;AAAA,CACH","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,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,EAAE;QACrB,MAAM,QAAQ,GAAG,OAAO,EAAE,CAAC;QAC3B,IAAI,MAAM,CAAC,OAAO,KAAK,SAAS;YAAE,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAChF,KAAK,MAAM,IAAI,IAAI,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAU,EAAE,CAAC;YAC5D,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;YAC3B,IAAI,KAAK,KAAK,SAAS;gBAAE,QAAQ,CAAC,YAAY,CAAC,IAAI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ACD,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,2 +0,0 @@
1
- export declare function buildInjectedContextLines(paths: string[]): string[];
2
- //# sourceMappingURL=injected-context.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"injected-context.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/injected-context.ts"],"names":[],"mappings":"AAAA,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAInE","sourcesContent":["export function buildInjectedContextLines(paths: string[]): string[] {\n\tconst labels = paths.map((path) => path.trim()).filter((path) => path.length > 0);\n\tif (labels.length === 0) return [];\n\treturn [\"injected context\", ...labels.map((path) => ` ${path}`)];\n}\n"]}
@@ -1,7 +0,0 @@
1
- export function buildInjectedContextLines(paths) {
2
- const labels = paths.map((path) => path.trim()).filter((path) => path.length > 0);
3
- if (labels.length === 0)
4
- return [];
5
- return ["injected context", ...labels.map((path) => ` ${path}`)];
6
- }
7
- //# sourceMappingURL=injected-context.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"injected-context.js","sourceRoot":"","sources":["../../../src/modes/interactive/injected-context.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,yBAAyB,CAAC,KAAe,EAAY;IACpE,MAAM,MAAM,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAClF,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IACnC,OAAO,CAAC,kBAAkB,EAAE,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC;AAAA,CAClE","sourcesContent":["export function buildInjectedContextLines(paths: string[]): string[] {\n\tconst labels = paths.map((path) => path.trim()).filter((path) => path.length > 0);\n\tif (labels.length === 0) return [];\n\treturn [\"injected context\", ...labels.map((path) => ` ${path}`)];\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
- };