@ashx-j/lunr-dev 0.2.40-dev.55.1 → 0.2.40-dev.59.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/builtin-extensions/lunr-browser.d.ts +1 -1
- package/dist/builtin-extensions/narumiruna-pi-goal/src/goal.js +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/attempt-usage.d.ts +5 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/attempt-usage.js +31 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/child-stream.d.ts +65 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/child-stream.js +456 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/parallel-group-status.d.ts +42 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/parallel-group-status.js +79 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/run-log.d.ts +18 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/run-log.js +43 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/runner-event-log.d.ts +3 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/runner-event-log.js +70 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/runner-single-step.d.ts +92 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/runner-single-step.js +491 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/runner-status.d.ts +64 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/runner-status.js +26 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-runner.d.ts +1 -115
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-runner.js +17 -1160
- package/dist/builtin-extensions/pi-subagents/src/tui/communication.d.ts +1 -1
- package/dist/builtin-extensions/pi-subagents/src/tui/render.js +1 -1
- package/dist/cli/config-selector.js +1 -1
- package/dist/cli/startup-ui.js +1 -1
- package/dist/core/agent-session.js +1 -1
- package/dist/core/credential-files.d.ts +3 -2
- package/dist/core/credential-files.js +10 -4
- package/dist/core/export-html/index.js +1 -1
- package/dist/core/export-html/tool-renderer.d.ts +1 -1
- package/dist/core/extensions/runner.js +1 -1
- package/dist/core/extensions/types.d.ts +1 -1
- package/dist/core/permissions.d.ts +6 -0
- package/dist/core/permissions.js +6 -0
- package/dist/core/resource-loader.d.ts +1 -1
- package/dist/core/resource-loader.js +1 -1
- package/dist/{modes/interactive → core}/theme/theme.d.ts +1 -1
- package/dist/{modes/interactive → core}/theme/theme.js +4 -4
- package/dist/core/tool-call-hooks.js +3 -2
- package/dist/gateway/agent-bridge.js +1 -1
- package/dist/gateway/setup.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/main.js +1 -1
- package/dist/modes/interactive/chat-history.js +1 -1
- package/dist/modes/interactive/components/assistant-message.js +1 -1
- package/dist/modes/interactive/components/bash-execution.js +1 -1
- package/dist/modes/interactive/components/boot-screen.js +1 -1
- package/dist/modes/interactive/components/bordered-loader.d.ts +1 -1
- package/dist/modes/interactive/components/branch-summary-message.js +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.js +1 -1
- package/dist/modes/interactive/components/config-selector.js +1 -1
- package/dist/modes/interactive/components/context-view.js +1 -1
- package/dist/modes/interactive/components/copyable-text.js +1 -1
- package/dist/modes/interactive/components/custom-entry.js +1 -1
- package/dist/modes/interactive/components/custom-message.js +1 -1
- package/dist/modes/interactive/components/diff.js +1 -1
- package/dist/modes/interactive/components/dynamic-border.js +1 -1
- package/dist/modes/interactive/components/extension-editor.js +1 -1
- package/dist/modes/interactive/components/extension-input.js +1 -1
- package/dist/modes/interactive/components/extension-selector.js +1 -1
- package/dist/modes/interactive/components/footer.js +1 -1
- package/dist/modes/interactive/components/injected-prompt-message.js +1 -1
- package/dist/modes/interactive/components/keybinding-hints.js +1 -1
- package/dist/modes/interactive/components/login-dialog.js +1 -1
- package/dist/modes/interactive/components/model-selector.js +1 -1
- package/dist/modes/interactive/components/oauth-selector.js +1 -1
- package/dist/modes/interactive/components/onboarding.js +1 -1
- package/dist/modes/interactive/components/plan-message.js +1 -1
- package/dist/modes/interactive/components/processes-selector.js +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.js +1 -1
- package/dist/modes/interactive/components/session-selector.js +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +1 -1
- package/dist/modes/interactive/components/settings-selector.js +1 -1
- package/dist/modes/interactive/components/show-images-selector.js +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.js +1 -1
- package/dist/modes/interactive/components/status-indicator.js +1 -1
- package/dist/modes/interactive/components/theme-selector.js +1 -1
- package/dist/modes/interactive/components/thinking-selector.js +1 -1
- package/dist/modes/interactive/components/thinking-tail.js +1 -1
- package/dist/modes/interactive/components/tool-execution.js +1 -1
- package/dist/modes/interactive/components/tree-selector.js +1 -1
- package/dist/modes/interactive/components/trust-selector.js +1 -1
- package/dist/modes/interactive/components/usage-view.js +1 -1
- package/dist/modes/interactive/components/user-message-selector.js +1 -1
- package/dist/modes/interactive/components/user-message.js +1 -1
- package/dist/modes/interactive/extension-dialogs.d.ts +1 -1
- package/dist/modes/interactive/extension-dialogs.js +1 -1
- package/dist/modes/interactive/extension-widgets.d.ts +1 -1
- package/dist/modes/interactive/extension-widgets.js +1 -1
- package/dist/modes/interactive/help-commands.js +1 -1
- package/dist/modes/interactive/interactive-mode.js +1 -1
- package/dist/modes/interactive/loaded-resources.js +1 -1
- package/dist/modes/interactive/login-flow.js +1 -1
- package/dist/modes/interactive/session-exit.js +1 -1
- package/dist/modes/interactive/session-naming.js +1 -1
- package/dist/modes/interactive/settings-screen.js +1 -1
- package/dist/modes/interactive/theme/theme-controller.d.ts +1 -1
- package/dist/modes/interactive/theme/theme-controller.js +1 -1
- package/dist/modes/interactive/tool-renderers/bash.js +1 -1
- package/dist/modes/interactive/tool-renderers/read.js +1 -1
- package/dist/modes/interactive/tool-renderers/render-utils.d.ts +1 -1
- package/dist/modes/interactive/tool-renderers/write.js +1 -1
- package/dist/modes/interactive/usage-commands.js +1 -1
- package/dist/modes/rpc/rpc-mode.js +1 -1
- package/dist/node-runtime/{acp-mode-CFYSYACH.js → acp-mode-5KZPFZBO.js} +2 -2
- package/dist/node-runtime/{agent-session-services-3ZHQJIKF.js → agent-session-services-UOVUJAX2.js} +8 -8
- package/dist/node-runtime/{builtin-extensions-YJ7F6GND.js → builtin-extensions-JNJRND4E.js} +3 -3
- package/dist/node-runtime/{chunk-GPNTGRL2.js → chunk-3RR3PVJB.js} +2 -2
- package/dist/node-runtime/{chunk-HVXDYQNN.js → chunk-6DVUDNS7.js} +2 -2
- package/dist/node-runtime/{chunk-5F7VOA34.js → chunk-AW6PDL4D.js} +1 -1
- package/dist/node-runtime/{chunk-VP2H4TI5.js → chunk-BJIF7GMV.js} +3 -3
- package/dist/node-runtime/{chunk-5HVA5ECB.js → chunk-BQROL43X.js} +17 -17
- package/dist/node-runtime/{chunk-BNNBTBXY.js → chunk-EJMB4PAV.js} +3 -3
- package/dist/node-runtime/{chunk-G3PARFR4.js → chunk-FCINT2KC.js} +7 -7
- package/dist/node-runtime/{chunk-KURXPCGO.js → chunk-FNS42TPZ.js} +3 -3
- package/dist/node-runtime/{chunk-N574FRFF.js → chunk-GAWWLIGY.js} +3 -3
- package/dist/node-runtime/{chunk-27QDDTTV.js → chunk-HYOPEHDE.js} +2 -2
- package/dist/node-runtime/{chunk-5JVP2JX4.js → chunk-JARNU4J4.js} +3 -3
- package/dist/node-runtime/{chunk-ITHKNPG4.js → chunk-JZK2WJ7U.js} +1 -1
- package/dist/node-runtime/{chunk-PLBYKAZC.js → chunk-KETNCBTB.js} +2 -2
- package/dist/node-runtime/{chunk-KTCZH72R.js → chunk-LGRRFSE7.js} +3 -2
- package/dist/node-runtime/{chunk-OXFD2OMR.js → chunk-LY6VVOF4.js} +3 -3
- package/dist/node-runtime/{chunk-DJB7P2V7.js → chunk-MEDBJXCC.js} +1 -1
- package/dist/node-runtime/{chunk-SV42POA3.js → chunk-PGWSMQ4K.js} +1 -1
- package/dist/node-runtime/{chunk-7LCR56AK.js → chunk-QDQAKIVU.js} +1 -1
- package/dist/node-runtime/{chunk-GNT2AURO.js → chunk-QP4I6GEW.js} +1 -1
- package/dist/node-runtime/{chunk-YDMZHLBV.js → chunk-QX5I7QEW.js} +1 -1
- package/dist/node-runtime/{chunk-BNZXW77G.js → chunk-RXDLSXEC.js} +1 -1
- package/dist/node-runtime/{chunk-U2LTTIWZ.js → chunk-RXG6DWO2.js} +1 -1
- package/dist/node-runtime/{chunk-ITVBE3HR.js → chunk-S46QLY2F.js} +10 -9
- package/dist/node-runtime/{chunk-CDILDA4F.js → chunk-U7MTVVT3.js} +2 -2
- package/dist/node-runtime/{chunk-MNYG5WLT.js → chunk-WBLSU6YV.js} +3 -3
- package/dist/node-runtime/{chunk-7LNPTBQJ.js → chunk-XPKOWSYN.js} +6 -2
- package/dist/node-runtime/{chunk-4ZEDT3YW.js → chunk-XXGJ7Z3C.js} +11 -11
- package/dist/node-runtime/{chunk-3UQ7ZNLI.js → chunk-Y7DFMHY5.js} +8 -8
- package/dist/node-runtime/{chunk-2ZI6Q6JG.js → chunk-YFXGOLZ6.js} +1 -1
- package/dist/node-runtime/cli-runtime.js +1 -1
- package/dist/node-runtime/{command-H52R5R2G.js → command-6GJNLXGD.js} +3 -3
- package/dist/node-runtime/{commands-CV2JUYHM.js → commands-2UG5F4VT.js} +6 -6
- package/dist/node-runtime/{commands-7EETGZ7V.js → commands-GSZWAQJW.js} +5 -5
- package/dist/node-runtime/{direct-tool-executor-DNZ2MS6Z.js → direct-tool-executor-WJLVHH7U.js} +6 -6
- package/dist/node-runtime/{export-html-7TEMZLK2.js → export-html-SW3CIZRJ.js} +1 -1
- package/dist/node-runtime/{extension-input-MNEKUZDZ.js → extension-input-DFQ76UJG.js} +4 -4
- package/dist/node-runtime/{extension-selector-6WJHCCQI.js → extension-selector-MWHCRWHQ.js} +4 -4
- package/dist/node-runtime/{gateway-OHPDCOOB.js → gateway-UDWVYEGX.js} +8 -8
- package/dist/node-runtime/{goal-PJ2NLX6M.js → goal-CVGA3XFI.js} +1 -1
- package/dist/node-runtime/index.js +22 -22
- package/dist/node-runtime/{init-G23PFPKF.js → init-P3RQ6EFK.js} +5 -5
- package/dist/node-runtime/{install-cli-4LUSDUPO.js → install-cli-YIIFVCFM.js} +1 -1
- package/dist/node-runtime/{interactive-mode-7GX3UJFX.js → interactive-mode-VCPSTUAW.js} +16 -16
- package/dist/node-runtime/{interactive-view-TUYWWEUV.js → interactive-view-GDP6M6UP.js} +6 -6
- package/dist/node-runtime/{lunr-cron-SV2EXYKV.js → lunr-cron-3VI5CLK3.js} +6 -6
- package/dist/node-runtime/main.js +17 -17
- package/dist/node-runtime/{mobile-commands-JQJU35OT.js → mobile-commands-HQXEYAF6.js} +5 -5
- package/dist/node-runtime/{package-manager-cli-FICMQY2Q.js → package-manager-cli-B6G22R6O.js} +9 -9
- package/dist/node-runtime/{pi-mcp-adapter-NKAL5CFR.js → pi-mcp-adapter-2OP5BBC6.js} +8 -8
- package/dist/node-runtime/{pi-prompt-template-model-63LFES2U.js → pi-prompt-template-model-UL2T2HLL.js} +2 -2
- package/dist/node-runtime/{pi-subagents-WS6OU5MG.js → pi-subagents-YVVMY4B4.js} +8 -8
- package/dist/node-runtime/{print-mode-Y363FXY4.js → print-mode-M52NLHKG.js} +9 -9
- package/dist/node-runtime/{proxy-modes-EEYRUGQL.js → proxy-modes-RD2PQ6UH.js} +6 -6
- package/dist/node-runtime/rpc-entry.js +17 -17
- package/dist/node-runtime/{rpc-mode-ENVT7AXW.js → rpc-mode-WAHP6U73.js} +4 -4
- package/dist/node-runtime/{session-selector-AF6V7DP6.js → session-selector-JABBEHK5.js} +4 -4
- package/dist/node-runtime/{setup-OHLYSWTW.js → setup-7IC2PQIB.js} +6 -6
- package/dist/node-runtime/{src-Y3S2FIS5.js → src-J6FSKIFT.js} +1 -1
- package/dist/node-runtime/{subagent-executor-LPVOWPMG.js → subagent-executor-RTGKJ35C.js} +5 -5
- package/dist/node-runtime/{theme-AY3J7JHP.js → theme-MVESIOLX.js} +1 -1
- package/dist/node-runtime/{tool-renderers-4RDKHPPB.js → tool-renderers-KL5EPAMN.js} +3 -3
- package/dist/startup/interactive-view.js +1 -1
- package/install-lock/package-lock.json +24 -24
- package/install-lock/package.json +2 -2
- package/npm-shrinkwrap.json +12 -12
- package/package.json +4 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Box, Container, Text } from "@ashx-j/lunr-tui";
|
|
2
2
|
import type { ToolRenderContext } from "../../../../core/extensions/types.ts";
|
|
3
|
-
import type { Theme } from "../../../../
|
|
3
|
+
import type { Theme } from "../../../../core/theme/theme.ts";
|
|
4
4
|
import { type SubagentCommunication } from "../intercom/communication.ts";
|
|
5
5
|
export declare function renderCommunicationBody(communication: SubagentCommunication, theme: Theme): Text;
|
|
6
6
|
export declare function renderCommunicationCard(communication: SubagentCommunication, expanded: boolean, theme: Theme): Box;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Rendering functions for subagent results
|
|
3
3
|
*/
|
|
4
4
|
import { getSubagentSpinnerDefinition } from "../../../../core/subagent-spinner.js";
|
|
5
|
-
import { getMarkdownTheme } from "../../../../
|
|
5
|
+
import { getMarkdownTheme } from "../../../../core/theme/theme.js";
|
|
6
6
|
import { keyText } from "../../../../modes/interactive/components/keybinding-hints.js";
|
|
7
7
|
import { Container, Markdown, Spacer, Text, visibleWidth } from "@ashx-j/lunr-tui";
|
|
8
8
|
import { WIDGET_KEY, } from "../shared/types.js";
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* TUI config selector for `pi config` command
|
|
3
3
|
*/
|
|
4
4
|
import { ProcessTerminal, TUI } from "@ashx-j/lunr-tui";
|
|
5
|
+
import { initTheme, stopThemeWatcher } from "../core/theme/theme.js";
|
|
5
6
|
import { ConfigSelectorComponent } from "../modes/interactive/components/config-selector.js";
|
|
6
|
-
import { initTheme, stopThemeWatcher } from "../modes/interactive/theme/theme.js";
|
|
7
7
|
/** Show TUI config selector and return when closed */
|
|
8
8
|
export async function selectConfig(options) {
|
|
9
9
|
// Initialize theme before showing TUI
|
package/dist/cli/startup-ui.js
CHANGED
|
@@ -3,9 +3,9 @@ import { getAgentDir } from "../config.js";
|
|
|
3
3
|
import { KeybindingsManager } from "../core/keybindings.js";
|
|
4
4
|
import { DefaultPackageManager } from "../core/package-manager.js";
|
|
5
5
|
import { SettingsManager } from "../core/settings-manager.js";
|
|
6
|
+
import { detectTerminalBackgroundFromEnv, detectTerminalThemeForAuto, initTheme, loadThemeFromPath, parseAutoThemeSetting, resolveThemeSetting, setRegisteredThemes, setTheme, } from "../core/theme/theme.js";
|
|
6
7
|
import { ExtensionInputComponent } from "../modes/interactive/components/extension-input.js";
|
|
7
8
|
import { ExtensionSelectorComponent } from "../modes/interactive/components/extension-selector.js";
|
|
8
|
-
import { detectTerminalBackgroundFromEnv, detectTerminalThemeForAuto, initTheme, loadThemeFromPath, parseAutoThemeSetting, resolveThemeSetting, setRegisteredThemes, setTheme, } from "../modes/interactive/theme/theme.js";
|
|
9
9
|
function loadThemes(resources) {
|
|
10
10
|
const themes = [];
|
|
11
11
|
const seen = new Set();
|
|
@@ -17,7 +17,6 @@ import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
|
17
17
|
import { basename, dirname } from "node:path";
|
|
18
18
|
import { cleanupConversationResources, cleanupSessionResources, estimateContextTokens as estimateRequestContextTokens, modelsAreEqual, resetApiProviders, streamSimple, } from "@ashx-j/lunr-ai/compat";
|
|
19
19
|
import { getAgentDir } from "../config.js";
|
|
20
|
-
import { getThemeByName, theme } from "../modes/interactive/theme/theme.js";
|
|
21
20
|
import { stripFrontmatter } from "../utils/frontmatter.js";
|
|
22
21
|
import { resolvePath } from "../utils/paths.js";
|
|
23
22
|
import { formatNoApiKeyFoundMessage, formatNoModelSelectedMessage } from "./auth-guidance.js";
|
|
@@ -41,6 +40,7 @@ import { isRetryableError, isRotationError, prepareRetry, tryRotateSubscriptionK
|
|
|
41
40
|
import { isSubagentChildProcess, resolveChildRuntimePermissionMode, SUBAGENT_CHILD_PERMISSION_ENV, } from "./subagent-permission-inherit.js";
|
|
42
41
|
import { registerSubagentWaitInterruptionOwner, } from "./subagent-wait-interruption.js";
|
|
43
42
|
import { buildSystemPrompt } from "./system-prompt.js";
|
|
43
|
+
import { getThemeByName, theme } from "./theme/theme.js";
|
|
44
44
|
import { measureStartup } from "./timings.js";
|
|
45
45
|
import { installToolCallHooks } from "./tool-call-hooks.js";
|
|
46
46
|
import { rebuildToolRegistry } from "./tool-registry.js";
|
|
@@ -21,8 +21,9 @@ export declare function credentialArgsReason(input: Record<string, unknown>, cwd
|
|
|
21
21
|
* The refusal when a bash command names a credential location as a literal word or `--opt=` value
|
|
22
22
|
* (`cat ~/.lunr/agent/auth.json`, `jq . <auth.json`), also relative to a literal `cd <dir>` before
|
|
23
23
|
* it (`cd ~/.lunr/agent && cat auth.json`). A word or value that starts with `$HOME` or `${HOME}`
|
|
24
|
-
* is read with the home directory in its place
|
|
25
|
-
* one
|
|
24
|
+
* is read with the home directory in its place, and one that starts with `$PI_CODING_AGENT_DIR`
|
|
25
|
+
* or `${PI_CODING_AGENT_DIR}` with the profile directory. Commands without one of the names
|
|
26
|
+
* return after one regex test.
|
|
26
27
|
*/
|
|
27
28
|
export declare function credentialBashReason(command: string, cwd: string): string | undefined;
|
|
28
29
|
/**
|
|
@@ -2,7 +2,7 @@ import { lstatSync } from "node:fs";
|
|
|
2
2
|
import { homedir } from "node:os";
|
|
3
3
|
import { isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
|
-
import { getAgentDir } from "../config.js";
|
|
5
|
+
import { ENV_AGENT_DIR, getAgentDir } from "../config.js";
|
|
6
6
|
import { canonicalizeTargetPath } from "../utils/paths.js";
|
|
7
7
|
import { resolveToCwd } from "./tools/path-utils.js";
|
|
8
8
|
/**
|
|
@@ -113,8 +113,9 @@ export function credentialArgsReason(input, cwd) {
|
|
|
113
113
|
* The refusal when a bash command names a credential location as a literal word or `--opt=` value
|
|
114
114
|
* (`cat ~/.lunr/agent/auth.json`, `jq . <auth.json`), also relative to a literal `cd <dir>` before
|
|
115
115
|
* it (`cd ~/.lunr/agent && cat auth.json`). A word or value that starts with `$HOME` or `${HOME}`
|
|
116
|
-
* is read with the home directory in its place
|
|
117
|
-
* one
|
|
116
|
+
* is read with the home directory in its place, and one that starts with `$PI_CODING_AGENT_DIR`
|
|
117
|
+
* or `${PI_CODING_AGENT_DIR}` with the profile directory. Commands without one of the names
|
|
118
|
+
* return after one regex test.
|
|
118
119
|
*/
|
|
119
120
|
export function credentialBashReason(command, cwd) {
|
|
120
121
|
if (!CREDENTIAL_NAME.test(command))
|
|
@@ -135,8 +136,9 @@ export function credentialBashReason(command, cwd) {
|
|
|
135
136
|
return undefined;
|
|
136
137
|
}
|
|
137
138
|
const HOME_VARIABLE = /^\$(?:HOME|\{HOME\})(?=\/|$)/;
|
|
139
|
+
const AGENT_DIR_VARIABLE = /^\$(?:PI_CODING_AGENT_DIR|\{PI_CODING_AGENT_DIR\})(?=\/|$)/;
|
|
138
140
|
function asBashPath(word) {
|
|
139
|
-
return fromMsysPath(expandHome(word));
|
|
141
|
+
return fromMsysPath(expandAgentDir(expandHome(word)));
|
|
140
142
|
}
|
|
141
143
|
/**
|
|
142
144
|
* `$HOME/x` and `${HOME}/x` with the home directory in place of the variable, as bash expands them
|
|
@@ -147,6 +149,10 @@ function asBashPath(word) {
|
|
|
147
149
|
function expandHome(word) {
|
|
148
150
|
return word.replace(HOME_VARIABLE, () => process.env.HOME || homedir());
|
|
149
151
|
}
|
|
152
|
+
/** `$PI_CODING_AGENT_DIR/x` as bash expands it: config.ts sets that variable for every lunR process. */
|
|
153
|
+
function expandAgentDir(word) {
|
|
154
|
+
return word.replace(AGENT_DIR_VARIABLE, () => process.env[ENV_AGENT_DIR] || getAgentDir());
|
|
155
|
+
}
|
|
150
156
|
/**
|
|
151
157
|
* Bash on Windows names drive `C:` as `/c` (Git Bash, MSYS2), `/cygdrive/c` (Cygwin) or `/mnt/c`
|
|
152
158
|
* (WSL), so `/c/Users/me` is `C:/Users/me` there. `/c` alone is the drive's root, not `C:`, which
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { existsSync, readFileSync, writeFileSync } from "fs";
|
|
2
2
|
import { basename, join } from "path";
|
|
3
3
|
import { APP_NAME, getExportTemplateDir } from "../../config.js";
|
|
4
|
-
import { getResolvedThemeColors, getThemeExportColors } from "../../modes/interactive/theme/theme.js";
|
|
5
4
|
import { normalizePath, resolvePath } from "../../utils/paths.js";
|
|
6
5
|
import { SessionManager } from "../session-manager.js";
|
|
6
|
+
import { getResolvedThemeColors, getThemeExportColors } from "../theme/theme.js";
|
|
7
7
|
/** Parse a color string to RGB values. Supports hex (#RRGGBB) and rgb(r,g,b) formats. */
|
|
8
8
|
function parseColor(color) {
|
|
9
9
|
const hexMatch = color.match(/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/);
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* Renders custom tool calls and results to HTML by invoking their TUI renderers
|
|
5
5
|
* and converting the ANSI output to HTML.
|
|
6
6
|
*/
|
|
7
|
-
import type { Theme } from "../../modes/interactive/theme/theme.ts";
|
|
8
7
|
import type { ToolDefinition } from "../extensions/types.ts";
|
|
8
|
+
import type { Theme } from "../theme/theme.ts";
|
|
9
9
|
export interface ToolHtmlRendererDeps {
|
|
10
10
|
/** Function to look up tool definition by name */
|
|
11
11
|
getToolDefinition: (name: string) => ToolDefinition | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Extension runner - executes extensions and manages their lifecycle.
|
|
3
3
|
*/
|
|
4
|
-
import { theme } from "
|
|
4
|
+
import { theme } from "../theme/theme.js";
|
|
5
5
|
// Extension shortcuts compete with canonical keybinding ids from keybindings.json.
|
|
6
6
|
// Only editor-global shortcuts are reserved here. Picker-specific bindings are not.
|
|
7
7
|
const RESERVED_KEYBINDINGS_FOR_EXTENSION_CONFLICTS = [
|
|
@@ -11,7 +11,6 @@ import type { AgentMessage, AgentToolResult, AgentToolUpdateCallback, ThinkingLe
|
|
|
11
11
|
import type { Api, AssistantMessageEvent, AssistantMessageEventStream, Context, ImageContent, Model, OAuthCredentials, OAuthLoginCallbacks, ProviderHeaders, RefreshModelsContext, SimpleStreamOptions, TextContent, ToolResultMessage } from "@ashx-j/lunr-ai";
|
|
12
12
|
import type { AutocompleteItem, AutocompleteProvider, Component, EditorComponent, EditorTheme, KeyId, OverlayHandle, OverlayOptions, TUI } from "@ashx-j/lunr-tui";
|
|
13
13
|
import type { Static, TSchema } from "typebox";
|
|
14
|
-
import type { Theme } from "../../modes/interactive/theme/theme.ts";
|
|
15
14
|
import type { BashResult } from "../bash-executor.ts";
|
|
16
15
|
import type { CompactionPreparation, CompactionResult } from "../compaction/index.ts";
|
|
17
16
|
import type { EventBus } from "../event-bus.ts";
|
|
@@ -24,6 +23,7 @@ import type { BranchSummaryEntry, CompactionEntry, CustomEntry, ReadonlySessionM
|
|
|
24
23
|
import type { SlashCommandInfo } from "../slash-commands.ts";
|
|
25
24
|
import type { SourceInfo } from "../source-info.ts";
|
|
26
25
|
import type { BuildSystemPromptOptions } from "../system-prompt.ts";
|
|
26
|
+
import type { Theme } from "../theme/theme.ts";
|
|
27
27
|
import type { BashOperations } from "../tools/bash.ts";
|
|
28
28
|
import type { EditToolDetails } from "../tools/edit.ts";
|
|
29
29
|
import type { BashToolDetails, BashToolInput, EditToolInput, FindToolDetails, FindToolInput, GrepToolDetails, GrepToolInput, LsToolDetails, LsToolInput, ReadToolDetails, ReadToolInput, WriteToolInput } from "../tools/index.ts";
|
|
@@ -79,6 +79,12 @@ export declare const ASK_REJECT_REASON = "The user rejected this call.";
|
|
|
79
79
|
export declare const APPROVAL_TIMEOUT_REASON = "Approval request timed out";
|
|
80
80
|
/** Tools that only update lunR's own state: auto mode doesn't review them and ask mode doesn't ask. */
|
|
81
81
|
export declare const REVIEW_FREE_TOOLS: ReadonlySet<string>;
|
|
82
|
+
/**
|
|
83
|
+
* Tools whose own run can change the permission mode (a plan approval leaves read-only mode, a
|
|
84
|
+
* finished goal restores the mode it started in). They are ordered like state-changing calls, so
|
|
85
|
+
* every later call in the same message is decided under the mode they leave behind.
|
|
86
|
+
*/
|
|
87
|
+
export declare const MODE_SWITCHING_TOOLS: ReadonlySet<string>;
|
|
82
88
|
export declare const NO_LARGE_SUBAGENT_LAUNCH_HANDLER_REASON = "Large subagent launch blocked: no approval channel available.";
|
|
83
89
|
export declare function createPermissionContext(sessionId: string, mode?: PermissionMode, allowApprovals?: boolean): void;
|
|
84
90
|
/** Initialize shared session defaults without replacing caller-owned approval policy or grants. */
|
package/dist/core/permissions.js
CHANGED
|
@@ -94,6 +94,12 @@ export const ASK_REJECT_REASON = "The user rejected this call.";
|
|
|
94
94
|
export const APPROVAL_TIMEOUT_REASON = "Approval request timed out";
|
|
95
95
|
/** Tools that only update lunR's own state: auto mode doesn't review them and ask mode doesn't ask. */
|
|
96
96
|
export const REVIEW_FREE_TOOLS = new Set(["todo", "goal_complete", "goal_blocked"]);
|
|
97
|
+
/**
|
|
98
|
+
* Tools whose own run can change the permission mode (a plan approval leaves read-only mode, a
|
|
99
|
+
* finished goal restores the mode it started in). They are ordered like state-changing calls, so
|
|
100
|
+
* every later call in the same message is decided under the mode they leave behind.
|
|
101
|
+
*/
|
|
102
|
+
export const MODE_SWITCHING_TOOLS = new Set(["present_plan", "goal_complete", "goal_blocked"]);
|
|
97
103
|
export const NO_LARGE_SUBAGENT_LAUNCH_HANDLER_REASON = "Large subagent launch blocked: no approval channel available.";
|
|
98
104
|
const LARGE_SUBAGENT_LAUNCH_ACTION = "large-subagent-launch";
|
|
99
105
|
const contexts = new Map();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type Theme } from "../modes/interactive/theme/theme.ts";
|
|
2
1
|
import type { ResourceDiagnostic } from "./diagnostics.ts";
|
|
2
|
+
import { type Theme } from "./theme/theme.ts";
|
|
3
3
|
export type { ResourceCollision, ResourceDiagnostic } from "./diagnostics.ts";
|
|
4
4
|
import { type EventBus } from "./event-bus.ts";
|
|
5
5
|
import type { InlineExtension, LoadExtensionsResult } from "./extensions/types.ts";
|
|
@@ -2,7 +2,7 @@ import { existsSync, readdirSync, readFileSync, statSync } from "node:fs";
|
|
|
2
2
|
import { dirname, join, resolve, sep } from "node:path";
|
|
3
3
|
import chalk from "chalk";
|
|
4
4
|
import { CONFIG_DIR_NAME } from "../config.js";
|
|
5
|
-
import { loadThemeFromPath } from "
|
|
5
|
+
import { loadThemeFromPath } from "./theme/theme.js";
|
|
6
6
|
import { canonicalizePath, isLocalPath, resolvePath } from "../utils/paths.js";
|
|
7
7
|
import { createEventBus } from "./event-bus.js";
|
|
8
8
|
import { clearExtensionCache, createExtensionRuntime, loadExtensionFromFactory, loadExtensionsCached, } from "./extensions/loader.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ThinkingLevel } from "@ashx-j/lunr-agent";
|
|
2
2
|
import { type EditorTheme, type MarkdownTheme, type RgbColor, type SelectListTheme, type SettingsListTheme } from "@ashx-j/lunr-tui";
|
|
3
|
-
import type { SourceInfo } from "
|
|
3
|
+
import type { SourceInfo } from "../source-info.ts";
|
|
4
4
|
export type ThemeColor = "accent" | "accent2" | "border" | "borderAccent" | "borderMuted" | "success" | "error" | "warning" | "muted" | "dim" | "text" | "white" | "thinkingText" | "userMessageText" | "customMessageText" | "customMessageLabel" | "toolTitle" | "toolOutput" | "mdHeading" | "mdLink" | "mdLinkUrl" | "mdCode" | "mdCodeBlock" | "mdCodeBlockBorder" | "mdQuote" | "mdQuoteBorder" | "mdHr" | "mdListBullet" | "toolDiffAdded" | "toolDiffRemoved" | "toolDiffContext" | "syntaxComment" | "syntaxKeyword" | "syntaxFunction" | "syntaxVariable" | "syntaxString" | "syntaxNumber" | "syntaxType" | "syntaxOperator" | "syntaxPunctuation" | "thinkingOff" | "thinkingMinimal" | "thinkingLow" | "thinkingMedium" | "thinkingHigh" | "thinkingXhigh" | "thinkingMax" | "bashMode";
|
|
5
5
|
export type ThemeBg = "selectedBg" | "userMessageBg" | "customMessageBg" | "toolPendingBg" | "toolSuccessBg" | "toolErrorBg";
|
|
6
6
|
type ColorMode = "truecolor" | "256color";
|
|
@@ -3,10 +3,10 @@ import { createRequire } from "node:module";
|
|
|
3
3
|
import * as path from "node:path";
|
|
4
4
|
import { getCapabilities, } from "@ashx-j/lunr-tui";
|
|
5
5
|
import chalk from "chalk";
|
|
6
|
-
import { getCustomThemesDir, getThemesDir } from "
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
6
|
+
import { getCustomThemesDir, getThemesDir } from "../../config.js";
|
|
7
|
+
import { closeWatcher, watchWithErrorHandler } from "../../utils/fs-watch.js";
|
|
8
|
+
import { highlight, supportsLanguage } from "../../utils/syntax-highlight.js";
|
|
9
|
+
import { globalBridge } from "../global-bridge.js";
|
|
10
10
|
// ============================================================================
|
|
11
11
|
// Types & Schema
|
|
12
12
|
// ============================================================================
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import { dirname, join } from "node:path";
|
|
8
8
|
import { getAgentDir } from "../config.js";
|
|
9
9
|
import { needsAutoReview } from "./auto-review.js";
|
|
10
|
-
import { gateToolCall } from "./permissions.js";
|
|
10
|
+
import { gateToolCall, MODE_SWITCHING_TOOLS } from "./permissions.js";
|
|
11
11
|
import { readOnlyModeBlockReason } from "./plan-mode.js";
|
|
12
12
|
import { rollbackSnapshotBeforeWrite } from "./rollback.js";
|
|
13
13
|
import { resolveToCwd } from "./tools/path-utils.js";
|
|
@@ -23,7 +23,8 @@ export function installToolCallHooks(agent, host) {
|
|
|
23
23
|
// lunr: calls read-only mode knows to change state (edit, write, mutating bash, ...) run in
|
|
24
24
|
// the order the model wrote them; other calls in the same message still run concurrently.
|
|
25
25
|
// Unknown extension tools stay concurrent; they can opt out with executionMode "sequential".
|
|
26
|
-
|
|
26
|
+
// Tools that switch the permission mode are ordered too, so later calls see the new mode.
|
|
27
|
+
agent.toolCallMutates = (toolCall, args) => MODE_SWITCHING_TOOLS.has(toolCall.name) || readOnlyModeBlockReason(toolCall.name, args) !== undefined;
|
|
27
28
|
agent.beforeToolCall = async ({ toolCall, args, assistantMessage }) => {
|
|
28
29
|
// lunr: the permission gate runs before host gates and may request approval.
|
|
29
30
|
const rules = host.permissionRules();
|
|
@@ -115,7 +115,7 @@ async function defaultSessionFactory(key, reopen) {
|
|
|
115
115
|
let created;
|
|
116
116
|
try {
|
|
117
117
|
const cwd = sessionManager.getCwd();
|
|
118
|
-
const { initTheme } = await import("../
|
|
118
|
+
const { initTheme } = await import("../core/theme/theme.js");
|
|
119
119
|
initTheme("moon", false);
|
|
120
120
|
const { ProjectTrustStore, hasTrustRequiringProjectResources } = await import("../core/trust-manager.js");
|
|
121
121
|
const projectTrusted = !hasTrustRequiringProjectResources(cwd) || new ProjectTrustStore(agentDir).get(cwd) === true;
|
package/dist/gateway/setup.js
CHANGED
|
@@ -5,7 +5,7 @@ import { readSecret } from "../cli/read-secret.js";
|
|
|
5
5
|
import { createStartupTui, showStartupInput, startStartupTui } from "../cli/startup-ui.js";
|
|
6
6
|
import { loadInstallFeatures, saveInstallFeatures } from "../core/install-features.js";
|
|
7
7
|
import { SettingsManager } from "../core/settings-manager.js";
|
|
8
|
-
import { getSelectListTheme, theme } from "../
|
|
8
|
+
import { getSelectListTheme, theme } from "../core/theme/theme.js";
|
|
9
9
|
import { loadGatewayConfig, saveGatewayConfig } from "./config.js";
|
|
10
10
|
import { createPairingStore } from "./pairing.js";
|
|
11
11
|
import { configureStartup, loadServiceSettings, startGatewayService } from "./service.js";
|
package/dist/index.d.ts
CHANGED
|
@@ -22,13 +22,13 @@ export { SessionOwnershipError } from "./core/session-ownership.ts";
|
|
|
22
22
|
export { type CompactionSettings, type DefaultProjectTrust, type ImageSettings, type PackageSource, type RetrySettings, SettingsManager, type SettingsManagerCreateOptions, type SkillTagCharacter, } from "./core/settings-manager.ts";
|
|
23
23
|
export { formatSkillsForPrompt, type LoadSkillsFromDirOptions, type LoadSkillsResult, loadSkills, loadSkillsFromDir, type Skill, type SkillFrontmatter, } from "./core/skills.ts";
|
|
24
24
|
export { createSyntheticSourceInfo } from "./core/source-info.ts";
|
|
25
|
+
export { getLanguageFromPath, getMarkdownTheme, getSelectListTheme, getSettingsListTheme, highlightCode, initTheme, Theme, type ThemeColor, } from "./core/theme/theme.ts";
|
|
25
26
|
export { type EditDiffResult, generateDiffString, generateUnifiedPatch } from "./core/tools/edit-diff.ts";
|
|
26
27
|
export { type BashOperations, type BashSpawnContext, type BashSpawnHook, type BashToolDetails, type BashToolInput, type BashToolOptions, createBashToolDefinition, createEditToolDefinition, createFindToolDefinition, createGrepToolDefinition, createLocalBashOperations, createLsToolDefinition, createReadToolDefinition, createWriteToolDefinition, DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, type EditOperations, type EditToolDetails, type EditToolInput, type EditToolOptions, type FindOperations, type FindToolDetails, type FindToolInput, type FindToolOptions, formatSize, type GrepOperations, type GrepToolDetails, type GrepToolInput, type GrepToolOptions, type LsOperations, type LsToolDetails, type LsToolInput, type LsToolOptions, type ReadOperations, type ReadToolDetails, type ReadToolInput, type ReadToolOptions, type ToolsOptions, type TruncationOptions, type TruncationResult, truncateHead, truncateLine, truncateTail, type WriteOperations, type WriteToolInput, type WriteToolOptions, withFileMutationQueue, } from "./core/tools/index.ts";
|
|
27
28
|
export { hasTrustRequiringProjectResources, type ProjectTrustDecision, ProjectTrustStore, type ProjectTrustStoreEntry, type ProjectTrustUpdate, } from "./core/trust-manager.ts";
|
|
28
29
|
export { type MainOptions, main } from "./main.ts";
|
|
29
30
|
export { InteractiveMode, type InteractiveModeOptions, type ModelInfo, type PrintModeOptions, RpcClient, type RpcClientOptions, type RpcCommand, type RpcEventListener, type RpcExtensionUIRequest, type RpcExtensionUIResponse, type RpcResponse, type RpcSessionState, runPrintMode, runRpcMode, } from "./modes/index.ts";
|
|
30
31
|
export { AssistantMessageComponent, BashExecutionComponent, BorderedLoader, BranchSummaryMessageComponent, CompactionSummaryMessageComponent, CustomEditor, CustomMessageComponent, DynamicBorder, ExtensionEditorComponent, ExtensionInputComponent, ExtensionSelectorComponent, FooterComponent, keyHint, keyText, LoginDialogComponent, ModelSelectorComponent, OAuthSelectorComponent, type RenderDiffOptions, rawKeyHint, renderDiff, SessionSelectorComponent, type SettingsCallbacks, type SettingsConfig, SettingsSelectorComponent, ShowImagesSelectorComponent, SkillInvocationMessageComponent, ThemeSelectorComponent, ThinkingSelectorComponent, ToolExecutionComponent, type ToolExecutionOptions, TreeSelectorComponent, truncateToVisualLines, UserMessageComponent, UserMessageSelectorComponent, type VisualTruncateResult, } from "./modes/interactive/components/index.ts";
|
|
31
|
-
export { getLanguageFromPath, getMarkdownTheme, getSelectListTheme, getSettingsListTheme, highlightCode, initTheme, Theme, type ThemeColor, } from "./modes/interactive/theme/theme.ts";
|
|
32
32
|
export { copyToClipboard } from "./utils/clipboard.ts";
|
|
33
33
|
export { parseFrontmatter, stripFrontmatter } from "./utils/frontmatter.ts";
|
|
34
34
|
export { convertToPng } from "./utils/image-convert.ts";
|
package/dist/index.js
CHANGED
|
@@ -27,6 +27,8 @@ export { SettingsManager, } from "./core/settings-manager.js";
|
|
|
27
27
|
// Skills
|
|
28
28
|
export { formatSkillsForPrompt, loadSkills, loadSkillsFromDir, } from "./core/skills.js";
|
|
29
29
|
export { createSyntheticSourceInfo } from "./core/source-info.js";
|
|
30
|
+
// Theme utilities for custom tools and extensions
|
|
31
|
+
export { getLanguageFromPath, getMarkdownTheme, getSelectListTheme, getSettingsListTheme, highlightCode, initTheme, Theme, } from "./core/theme/theme.js";
|
|
30
32
|
export { generateDiffString, generateUnifiedPatch } from "./core/tools/edit-diff.js";
|
|
31
33
|
// Tools
|
|
32
34
|
export { createBashToolDefinition, createEditToolDefinition, createFindToolDefinition, createGrepToolDefinition, createLocalBashOperations, createLsToolDefinition, createReadToolDefinition, createWriteToolDefinition, DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, formatSize, truncateHead, truncateLine, truncateTail, withFileMutationQueue, } from "./core/tools/index.js";
|
|
@@ -37,8 +39,6 @@ export { main } from "./main.js";
|
|
|
37
39
|
export { InteractiveMode, RpcClient, runPrintMode, runRpcMode, } from "./modes/index.js";
|
|
38
40
|
// UI components for extensions
|
|
39
41
|
export { AssistantMessageComponent, BashExecutionComponent, BorderedLoader, BranchSummaryMessageComponent, CompactionSummaryMessageComponent, CustomEditor, CustomMessageComponent, DynamicBorder, ExtensionEditorComponent, ExtensionInputComponent, ExtensionSelectorComponent, FooterComponent, keyHint, keyText, LoginDialogComponent, ModelSelectorComponent, OAuthSelectorComponent, rawKeyHint, renderDiff, SessionSelectorComponent, SettingsSelectorComponent, ShowImagesSelectorComponent, SkillInvocationMessageComponent, ThemeSelectorComponent, ThinkingSelectorComponent, ToolExecutionComponent, TreeSelectorComponent, truncateToVisualLines, UserMessageComponent, UserMessageSelectorComponent, } from "./modes/interactive/components/index.js";
|
|
40
|
-
// Theme utilities for custom tools and extensions
|
|
41
|
-
export { getLanguageFromPath, getMarkdownTheme, getSelectListTheme, getSettingsListTheme, highlightCode, initTheme, Theme, } from "./modes/interactive/theme/theme.js";
|
|
42
42
|
// Clipboard utilities
|
|
43
43
|
export { copyToClipboard } from "./utils/clipboard.js";
|
|
44
44
|
export { parseFrontmatter, stripFrontmatter } from "./utils/frontmatter.js";
|
package/dist/main.js
CHANGED
|
@@ -36,11 +36,11 @@ import { pruneOldSessions } from "./core/session-retention.js";
|
|
|
36
36
|
import { getSessionRetentionTargets, selectApprovedStartupSession } from "./core/session-startup-settings.js";
|
|
37
37
|
import { SettingsManager } from "./core/settings-manager.js";
|
|
38
38
|
import { applyInheritedSubagentPermissions } from "./core/subagent-permission-inherit.js";
|
|
39
|
+
import { initTheme, stopThemeWatcher } from "./core/theme/theme.js";
|
|
39
40
|
import { printTimings, resetTimings, time } from "./core/timings.js";
|
|
40
41
|
import { hasTrustRequiringProjectResources, ProjectTrustStore } from "./core/trust-manager.js";
|
|
41
42
|
import { runMigrations, showDeprecationWarnings } from "./migrations.js";
|
|
42
43
|
import { ACP_DISABLED_BUILTINS, ACP_SETTINGS_OVERRIDES } from "./modes/acp/policy.js";
|
|
43
|
-
import { initTheme, stopThemeWatcher } from "./modes/interactive/theme/theme.js";
|
|
44
44
|
import { markStartupMilestone } from "./startup/startup-milestones.js";
|
|
45
45
|
import { isLocalPath, normalizePath, resolvePath } from "./utils/paths.js";
|
|
46
46
|
const EXTENSION_LOAD_FAILURE_HINT = `Hint: Start without extensions using "${APP_NAME} -ne".`;
|
|
@@ -10,6 +10,7 @@ import { parseSkillBlock } from "../../core/agent-session.js";
|
|
|
10
10
|
import { CACHE_TTL_MS, collectCacheMisses, detectCacheMiss } from "../../core/cache-stats.js";
|
|
11
11
|
import { detectInjectedPrompt } from "../../core/injected-prompt.js";
|
|
12
12
|
import { sessionEntryToContextMessages } from "../../core/session-manager.js";
|
|
13
|
+
import { theme } from "../../core/theme/theme.js";
|
|
13
14
|
import { AssistantMessageComponent } from "./components/assistant-message.js";
|
|
14
15
|
import { BashExecutionComponent } from "./components/bash-execution.js";
|
|
15
16
|
import { BranchSummaryMessageComponent } from "./components/branch-summary-message.js";
|
|
@@ -21,7 +22,6 @@ import { InjectedPromptMessageComponent } from "./components/injected-prompt-mes
|
|
|
21
22
|
import { SkillInvocationMessageComponent } from "./components/skill-invocation-message.js";
|
|
22
23
|
import { ToolExecutionComponent } from "./components/tool-execution.js";
|
|
23
24
|
import { UserMessageComponent } from "./components/user-message.js";
|
|
24
|
-
import { theme } from "./theme/theme.js";
|
|
25
25
|
function isCustomSessionEntry(item) {
|
|
26
26
|
return "type" in item && item.type === "custom";
|
|
27
27
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Container, Markdown, Spacer, Text } from "@ashx-j/lunr-tui";
|
|
2
2
|
import { describeProviderError } from "../../../core/provider-error-display.js";
|
|
3
|
+
import { getMarkdownTheme, theme } from "../../../core/theme/theme.js";
|
|
3
4
|
import { copyToClipboard } from "../../../utils/clipboard.js";
|
|
4
5
|
import { sanitizeTerminalText } from "../../../utils/sanitize-terminal-text.js";
|
|
5
|
-
import { getMarkdownTheme, theme } from "../theme/theme.js";
|
|
6
6
|
import { CopyableTextBlockComponent, parseCopyableTextSegments } from "./copyable-text.js";
|
|
7
7
|
import { expandKeyText } from "./keybinding-hints.js";
|
|
8
8
|
import { formatThoughtDuration, isThinkingRunComplete, thinkingSnippet, } from "./thinking-summary.js";
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Component for displaying bash command execution with streaming output.
|
|
3
3
|
*/
|
|
4
4
|
import { Container, Loader, Spacer, Text } from "@ashx-j/lunr-tui";
|
|
5
|
+
import { theme } from "../../../core/theme/theme.js";
|
|
5
6
|
import { DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, truncateTail, } from "../../../core/tools/truncate.js";
|
|
6
7
|
import { stripAnsi } from "../../../utils/ansi.js";
|
|
7
|
-
import { theme } from "../theme/theme.js";
|
|
8
8
|
import { DynamicBorder } from "./dynamic-border.js";
|
|
9
9
|
import { keyHint, keyText } from "./keybinding-hints.js";
|
|
10
10
|
import { truncateToVisualLines } from "./visual-truncate.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { truncateToWidth, visibleWidth } from "@ashx-j/lunr-tui";
|
|
2
|
-
import { theme } from "
|
|
2
|
+
import { theme } from "../../../core/theme/theme.js";
|
|
3
3
|
/**
|
|
4
4
|
* Startup boot screen: app/version header and CLI details rows,
|
|
5
5
|
* wrapped in an accent2-bordered box that hugs the content width.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Container, type TUI } from "@ashx-j/lunr-tui";
|
|
2
|
-
import type { Theme } from "
|
|
2
|
+
import type { Theme } from "../../../core/theme/theme.ts";
|
|
3
3
|
/** Loader wrapped with borders for extension UI */
|
|
4
4
|
export declare class BorderedLoader extends Container {
|
|
5
5
|
private loader;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Box, Markdown, Spacer, Text } from "@ashx-j/lunr-tui";
|
|
2
|
-
import { getMarkdownTheme, theme } from "
|
|
2
|
+
import { getMarkdownTheme, theme } from "../../../core/theme/theme.js";
|
|
3
3
|
import { expandKeyText } from "./keybinding-hints.js";
|
|
4
4
|
/**
|
|
5
5
|
* Component that renders a branch summary message with collapsed/expanded state.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Box, Markdown, Spacer, Text } from "@ashx-j/lunr-tui";
|
|
2
|
-
import { getMarkdownTheme, theme } from "
|
|
2
|
+
import { getMarkdownTheme, theme } from "../../../core/theme/theme.js";
|
|
3
3
|
import { expandKeyText } from "./keybinding-hints.js";
|
|
4
4
|
/**
|
|
5
5
|
* Component that renders a compaction message with collapsed/expanded state.
|
|
@@ -5,8 +5,8 @@ import { homedir } from "node:os";
|
|
|
5
5
|
import { basename, dirname, join, relative, sep } from "node:path";
|
|
6
6
|
import { Container, getKeybindings, Input, matchesKey, Spacer, truncateToWidth, visibleWidth, } from "@ashx-j/lunr-tui";
|
|
7
7
|
import { CONFIG_DIR_NAME } from "../../../config.js";
|
|
8
|
+
import { theme } from "../../../core/theme/theme.js";
|
|
8
9
|
import { canonicalizePath, isLocalPath, resolvePath } from "../../../utils/paths.js";
|
|
9
|
-
import { theme } from "../theme/theme.js";
|
|
10
10
|
import { DynamicBorder } from "./dynamic-border.js";
|
|
11
11
|
import { keyHint, rawKeyHint } from "./keybinding-hints.js";
|
|
12
12
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { visibleWidth, wrapTextWithAnsi } from "@ashx-j/lunr-tui";
|
|
2
|
-
import { theme } from "
|
|
2
|
+
import { theme } from "../../../core/theme/theme.js";
|
|
3
3
|
import { formatTokens } from "./footer.js";
|
|
4
4
|
import { renderThemedBox, usageBar } from "./usage-view.js";
|
|
5
5
|
function renderRowLabel(row) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { truncateToWidth, visibleWidth, wrapTextWithAnsi } from "@ashx-j/lunr-tui";
|
|
2
|
+
import { theme } from "../../../core/theme/theme.js";
|
|
2
3
|
import { sanitizeTerminalText } from "../../../utils/sanitize-terminal-text.js";
|
|
3
|
-
import { theme } from "../theme/theme.js";
|
|
4
4
|
function sourceLines(source) {
|
|
5
5
|
const lines = [];
|
|
6
6
|
const pattern = /([^\r\n]*)(\r\n|\r|\n|$)/g;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Box, Container, Spacer, Text } from "@ashx-j/lunr-tui";
|
|
2
|
-
import { theme } from "
|
|
2
|
+
import { theme } from "../../../core/theme/theme.js";
|
|
3
3
|
/**
|
|
4
4
|
* Component that renders a custom session entry from extensions.
|
|
5
5
|
* The host owns transcript spacing; renderer output should provide only its content.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Box, Container, Markdown, Spacer, Text } from "@ashx-j/lunr-tui";
|
|
2
|
-
import { getMarkdownTheme, theme } from "
|
|
2
|
+
import { getMarkdownTheme, theme } from "../../../core/theme/theme.js";
|
|
3
3
|
/**
|
|
4
4
|
* Component that renders a custom message entry from extensions.
|
|
5
5
|
* Uses distinct styling to differentiate from user messages.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as Diff from "diff";
|
|
2
|
-
import { theme } from "
|
|
2
|
+
import { theme } from "../../../core/theme/theme.js";
|
|
3
3
|
/**
|
|
4
4
|
* Parse diff line to extract prefix, line number, and content.
|
|
5
5
|
* Format: "+123 content" or "-123 content" or " 123 content" or " ..."
|
|
@@ -7,7 +7,7 @@ import * as fs from "node:fs";
|
|
|
7
7
|
import * as os from "node:os";
|
|
8
8
|
import * as path from "node:path";
|
|
9
9
|
import { Container, Editor, getKeybindings, Spacer, Text, } from "@ashx-j/lunr-tui";
|
|
10
|
-
import { getEditorTheme, theme } from "
|
|
10
|
+
import { getEditorTheme, theme } from "../../../core/theme/theme.js";
|
|
11
11
|
import { DynamicBorder } from "./dynamic-border.js";
|
|
12
12
|
import { keyHint } from "./keybinding-hints.js";
|
|
13
13
|
export class ExtensionEditorComponent extends Container {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Simple text input component for extensions.
|
|
3
3
|
*/
|
|
4
4
|
import { Container, getKeybindings, Input, Spacer, Text } from "@ashx-j/lunr-tui";
|
|
5
|
-
import { theme } from "
|
|
5
|
+
import { theme } from "../../../core/theme/theme.js";
|
|
6
6
|
import { CountdownTimer } from "./countdown-timer.js";
|
|
7
7
|
import { DynamicBorder } from "./dynamic-border.js";
|
|
8
8
|
import { keyHint } from "./keybinding-hints.js";
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Displays a list of string options with keyboard navigation.
|
|
4
4
|
*/
|
|
5
5
|
import { Container, getKeybindings, Spacer, Text } from "@ashx-j/lunr-tui";
|
|
6
|
-
import { theme } from "
|
|
6
|
+
import { theme } from "../../../core/theme/theme.js";
|
|
7
7
|
import { CountdownTimer } from "./countdown-timer.js";
|
|
8
8
|
import { DynamicBorder } from "./dynamic-border.js";
|
|
9
9
|
import { keyHint, rawKeyHint } from "./keybinding-hints.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { isAbsolute, relative, resolve, sep } from "node:path";
|
|
2
2
|
import { truncateToWidth, visibleWidth } from "@ashx-j/lunr-tui";
|
|
3
3
|
import { areExperimentalFeaturesEnabled } from "../../../core/experimental.js";
|
|
4
|
+
import { theme } from "../../../core/theme/theme.js";
|
|
4
5
|
import { collectUsageRequests, totalRequestUsage } from "../../../core/usage-accounting.js";
|
|
5
|
-
import { theme } from "../theme/theme.js";
|
|
6
6
|
/**
|
|
7
7
|
* Sanitize text for display in a single-line status.
|
|
8
8
|
* Removes newlines, tabs, carriage returns, and other control characters.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Box, Markdown, Text } from "@ashx-j/lunr-tui";
|
|
2
2
|
import { INJECTED_PROMPT_LABELS } from "../../../core/injected-prompt.js";
|
|
3
|
-
import { getMarkdownTheme, theme } from "
|
|
3
|
+
import { getMarkdownTheme, theme } from "../../../core/theme/theme.js";
|
|
4
4
|
import { expandKeyText } from "./keybinding-hints.js";
|
|
5
5
|
/**
|
|
6
6
|
* lunr: renders an injected prompt (/research, /goal) as a collapsed
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Utilities for formatting keybinding hints in the UI.
|
|
3
3
|
*/
|
|
4
4
|
import { getKeybindings } from "@ashx-j/lunr-tui";
|
|
5
|
-
import { theme } from "
|
|
5
|
+
import { theme } from "../../../core/theme/theme.js";
|
|
6
6
|
function formatKeyPart(part, options) {
|
|
7
7
|
const displayPart = process.platform === "darwin" && part.toLowerCase() === "alt" ? "option" : part;
|
|
8
8
|
return options.capitalize ? displayPart.charAt(0).toUpperCase() + displayPart.slice(1) : displayPart;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Container, getKeybindings, Input, Spacer, Text } from "@ashx-j/lunr-tui";
|
|
2
|
+
import { theme } from "../../../core/theme/theme.js";
|
|
2
3
|
import { openBrowser } from "../../../utils/open-browser.js";
|
|
3
|
-
import { theme } from "../theme/theme.js";
|
|
4
4
|
import { DynamicBorder } from "./dynamic-border.js";
|
|
5
5
|
import { keyHint } from "./keybinding-hints.js";
|
|
6
6
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { modelsAreEqual } from "@ashx-j/lunr-ai";
|
|
2
2
|
import { Container, fuzzyFilter, getKeybindings, Input, Spacer, Text, } from "@ashx-j/lunr-tui";
|
|
3
|
+
import { theme } from "../../../core/theme/theme.js";
|
|
3
4
|
import { getModelSelectorSearchText } from "../model-search.js";
|
|
4
|
-
import { theme } from "../theme/theme.js";
|
|
5
5
|
import { DynamicBorder } from "./dynamic-border.js";
|
|
6
6
|
import { keyHint } from "./keybinding-hints.js";
|
|
7
7
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Container, fuzzyFilter, getKeybindings, Input, Spacer, TruncatedText, } from "@ashx-j/lunr-tui";
|
|
2
|
-
import { theme } from "
|
|
2
|
+
import { theme } from "../../../core/theme/theme.js";
|
|
3
3
|
import { DynamicBorder } from "./dynamic-border.js";
|
|
4
4
|
export function formatAuthSelectorProviderType(authType) {
|
|
5
5
|
return authType === "oauth" ? "subscription" : "API key";
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import { getKeybindings, visibleWidth, wrapTextWithAnsi } from "@ashx-j/lunr-tui";
|
|
7
7
|
import { LOCAL_SERVERS } from "../../../builtin-extensions/lunr-local-providers/local-servers.js";
|
|
8
8
|
import { PERMISSION_MODES } from "../../../core/permissions.js";
|
|
9
|
-
import { theme } from "
|
|
9
|
+
import { theme } from "../../../core/theme/theme.js";
|
|
10
10
|
import { keyHint, rawKeyHint } from "./keybinding-hints.js";
|
|
11
11
|
export const WELCOME_TEXT = {
|
|
12
12
|
heading: "Welcome to lunR",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Container, Markdown, Text } from "@ashx-j/lunr-tui";
|
|
2
|
-
import { getMarkdownTheme, theme } from "
|
|
2
|
+
import { getMarkdownTheme, theme } from "../../../core/theme/theme.js";
|
|
3
3
|
/** Markdown source for the live plan chat card. Full summary, no 500-char slice. */
|
|
4
4
|
export function planMessageMarkdown(summary) {
|
|
5
5
|
return summary;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Container, getKeybindings, Spacer, Text, truncateToWidth } from "@ashx-j/lunr-tui";
|
|
2
2
|
import * as processRegistry from "../../../core/process-registry.js";
|
|
3
|
-
import { theme } from "
|
|
3
|
+
import { theme } from "../../../core/theme/theme.js";
|
|
4
4
|
import { DynamicBorder } from "./dynamic-border.js";
|
|
5
5
|
import { rawKeyHint } from "./keybinding-hints.js";
|
|
6
6
|
function formatElapsed(startedAt) {
|