@dirgha/code 1.20.39 → 1.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +0 -57
- package/README.md +4 -8
- package/dist/auth/keypool.js +26 -40
- package/dist/auth/keypool.js.map +1 -1
- package/dist/auth/keystore.js +11 -16
- package/dist/auth/keystore.js.map +1 -1
- package/dist/cli/config.d.ts +5 -8
- package/dist/cli/config.js +3 -24
- package/dist/cli/config.js.map +1 -1
- package/dist/cli/first-run.js +24 -40
- package/dist/cli/first-run.js.map +1 -1
- package/dist/cli/flows/wizard.js +18 -12
- package/dist/cli/flows/wizard.js.map +1 -1
- package/dist/cli/interactive.d.ts +0 -4
- package/dist/cli/interactive.js +1 -29
- package/dist/cli/interactive.js.map +1 -1
- package/dist/cli/main.js +18 -69
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/slash/fleet.js +1 -19
- package/dist/cli/slash/fleet.js.map +1 -1
- package/dist/cli/slash/models.js +2 -4
- package/dist/cli/slash/models.js.map +1 -1
- package/dist/cli/slash/paste.js +7 -4
- package/dist/cli/slash/paste.js.map +1 -1
- package/dist/cli/slash.js +10 -26
- package/dist/cli/slash.js.map +1 -1
- package/dist/cli/subcommands/audit.js +8 -28
- package/dist/cli/subcommands/audit.js.map +1 -1
- package/dist/cli/subcommands/doctor.d.ts +0 -4
- package/dist/cli/subcommands/doctor.js +21 -82
- package/dist/cli/subcommands/doctor.js.map +1 -1
- package/dist/cli/subcommands/feature-setup.js +6 -6
- package/dist/cli/subcommands/feature-setup.js.map +1 -1
- package/dist/cli/subcommands/memory.js +0 -23
- package/dist/cli/subcommands/memory.js.map +1 -1
- package/dist/cli/subcommands/telemetry.d.ts +1 -2
- package/dist/cli/subcommands/telemetry.js +34 -47
- package/dist/cli/subcommands/telemetry.js.map +1 -1
- package/dist/context/branch.d.ts +2 -2
- package/dist/context/branch.js +23 -40
- package/dist/context/branch.js.map +1 -1
- package/dist/context/compaction.js +22 -45
- package/dist/context/compaction.js.map +1 -1
- package/dist/context/git-state.js +18 -31
- package/dist/context/git-state.js.map +1 -1
- package/dist/context/knowledge.js +20 -31
- package/dist/context/knowledge.js.map +1 -1
- package/dist/context/memory.js +1 -8
- package/dist/context/memory.js.map +1 -1
- package/dist/context/mode-enforcement.js +1 -11
- package/dist/context/mode-enforcement.js.map +1 -1
- package/dist/context/mode.js +30 -67
- package/dist/context/mode.js.map +1 -1
- package/dist/context/primer.js +3 -15
- package/dist/context/primer.js.map +1 -1
- package/dist/fleet/apply-back.js +1 -5
- package/dist/fleet/apply-back.js.map +1 -1
- package/dist/fleet/cli-command.d.ts +0 -2
- package/dist/fleet/cli-command.js +1 -15
- package/dist/fleet/cli-command.js.map +1 -1
- package/dist/fleet/runner.js +2 -35
- package/dist/fleet/runner.js.map +1 -1
- package/dist/fleet/scratchpad.js +2 -1
- package/dist/fleet/scratchpad.js.map +1 -1
- package/dist/fleet/state.d.ts +0 -4
- package/dist/fleet/state.js +2 -11
- package/dist/fleet/state.js.map +1 -1
- package/dist/fleet/templates.d.ts +0 -4
- package/dist/fleet/templates.js.map +1 -1
- package/dist/fleet/types.d.ts +0 -4
- package/dist/fleet/types.js.map +1 -1
- package/dist/intelligence/failover-chain.js +1 -10
- package/dist/intelligence/failover-chain.js.map +1 -1
- package/dist/intelligence/health-monitor.d.ts +8 -8
- package/dist/intelligence/health-monitor.js +74 -105
- package/dist/intelligence/health-monitor.js.map +1 -1
- package/dist/intelligence/prices.d.ts +4 -6
- package/dist/intelligence/prices.js +10 -36
- package/dist/intelligence/prices.js.map +1 -1
- package/dist/kernel/agent-loop.js +17 -60
- package/dist/kernel/agent-loop.js.map +1 -1
- package/dist/lsp/client.js +16 -29
- package/dist/lsp/client.js.map +1 -1
- package/dist/lsp/detector.js +6 -7
- package/dist/lsp/detector.js.map +1 -1
- package/dist/mcp/client.d.ts +1 -1
- package/dist/mcp/client.js +16 -19
- package/dist/mcp/client.js.map +1 -1
- package/dist/mcp/transport.js +38 -46
- package/dist/mcp/transport.js.map +1 -1
- package/dist/providers/deepseek.js +1 -1
- package/dist/providers/deepseek.js.map +1 -1
- package/dist/providers/dispatch.js +1 -15
- package/dist/providers/dispatch.js.map +1 -1
- package/dist/providers/index.d.ts +0 -11
- package/dist/providers/index.js +2 -29
- package/dist/providers/index.js.map +1 -1
- package/dist/providers/nvidia.js +1 -1
- package/dist/providers/nvidia.js.map +1 -1
- package/dist/providers/openai-compat.js +2 -4
- package/dist/providers/openai-compat.js.map +1 -1
- package/dist/providers/openrouter.js +1 -1
- package/dist/providers/openrouter.js.map +1 -1
- package/dist/safety/audit-log.d.ts +0 -15
- package/dist/safety/audit-log.js +0 -21
- package/dist/safety/audit-log.js.map +1 -1
- package/dist/state/db.js +5 -60
- package/dist/state/db.js.map +1 -1
- package/dist/tools/browser.js +16 -24
- package/dist/tools/browser.js.map +1 -1
- package/dist/tools/checkpoint.d.ts +1 -6
- package/dist/tools/checkpoint.js +62 -79
- package/dist/tools/checkpoint.js.map +1 -1
- package/dist/tools/cron.js +3 -1
- package/dist/tools/cron.js.map +1 -1
- package/dist/tools/diff.js +21 -25
- package/dist/tools/diff.js.map +1 -1
- package/dist/tools/exec.d.ts +0 -2
- package/dist/tools/exec.js +0 -13
- package/dist/tools/exec.js.map +1 -1
- package/dist/tools/fs-edit.d.ts +5 -3
- package/dist/tools/fs-edit.js +23 -8
- package/dist/tools/fs-edit.js.map +1 -1
- package/dist/tools/fs-ls.js +8 -6
- package/dist/tools/fs-ls.js.map +1 -1
- package/dist/tools/fs-read.d.ts +1 -1
- package/dist/tools/fs-read.js +28 -37
- package/dist/tools/fs-read.js.map +1 -1
- package/dist/tools/fs-write.d.ts +1 -1
- package/dist/tools/fs-write.js +33 -33
- package/dist/tools/fs-write.js.map +1 -1
- package/dist/tools/git.js +6 -12
- package/dist/tools/git.js.map +1 -1
- package/dist/tools/index.d.ts +2 -5
- package/dist/tools/index.js +4 -7
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/multimodal.js +12 -11
- package/dist/tools/multimodal.js.map +1 -1
- package/dist/tools/rtk.js +9 -22
- package/dist/tools/rtk.js.map +1 -1
- package/dist/tools/search-glob.d.ts +1 -1
- package/dist/tools/search-glob.js +24 -42
- package/dist/tools/search-glob.js.map +1 -1
- package/dist/tools/search-grep.d.ts +1 -1
- package/dist/tools/search-grep.js +32 -56
- package/dist/tools/search-grep.js.map +1 -1
- package/dist/tools/shell.d.ts +1 -7
- package/dist/tools/shell.js +61 -114
- package/dist/tools/shell.js.map +1 -1
- package/dist/tui/ink/App.d.ts +1 -2
- package/dist/tui/ink/App.js +82 -194
- package/dist/tui/ink/App.js.map +1 -1
- package/dist/tui/ink/components/DenseToolMessage.js +8 -23
- package/dist/tui/ink/components/DenseToolMessage.js.map +1 -1
- package/dist/tui/ink/components/InputBox.js +25 -16
- package/dist/tui/ink/components/InputBox.js.map +1 -1
- package/dist/tui/ink/components/KeySetOverlay.d.ts +1 -1
- package/dist/tui/ink/components/KeySetOverlay.js +16 -18
- package/dist/tui/ink/components/KeySetOverlay.js.map +1 -1
- package/dist/tui/ink/components/Logo.d.ts +0 -20
- package/dist/tui/ink/components/Logo.js +1 -67
- package/dist/tui/ink/components/Logo.js.map +1 -1
- package/dist/tui/ink/components/ModelPicker.d.ts +2 -2
- package/dist/tui/ink/components/ModelPicker.js +26 -34
- package/dist/tui/ink/components/ModelPicker.js.map +1 -1
- package/dist/tui/ink/components/PasteCollapse.d.ts +1 -3
- package/dist/tui/ink/components/PasteCollapse.js +9 -11
- package/dist/tui/ink/components/PasteCollapse.js.map +1 -1
- package/dist/tui/ink/components/SpinnerGlyph.d.ts +4 -4
- package/dist/tui/ink/components/SpinnerGlyph.js +14 -34
- package/dist/tui/ink/components/SpinnerGlyph.js.map +1 -1
- package/dist/tui/ink/components/StatusBar.d.ts +0 -7
- package/dist/tui/ink/components/StatusBar.js +5 -11
- package/dist/tui/ink/components/StatusBar.js.map +1 -1
- package/dist/tui/ink/components/ThinkingBlock.d.ts +4 -15
- package/dist/tui/ink/components/ThinkingBlock.js +17 -34
- package/dist/tui/ink/components/ThinkingBlock.js.map +1 -1
- package/dist/tui/ink/components/ToolBox.js +13 -23
- package/dist/tui/ink/components/ToolBox.js.map +1 -1
- package/dist/tui/ink/index.js +1 -17
- package/dist/tui/ink/index.js.map +1 -1
- package/dist/tui/ink/theme-context.js +3 -6
- package/dist/tui/ink/theme-context.js.map +1 -1
- package/dist/tui/ink/use-declined-versions.js +2 -6
- package/dist/tui/ink/use-declined-versions.js.map +1 -1
- package/dist/tui/ink/use-event-projection.d.ts +0 -2
- package/dist/tui/ink/use-event-projection.js +2 -21
- package/dist/tui/ink/use-event-projection.js.map +1 -1
- package/dist/tui/ink/use-overlays.js +17 -16
- package/dist/tui/ink/use-overlays.js.map +1 -1
- package/package.json +6 -5
- package/dist/state/db-telemetry.d.ts +0 -21
- package/dist/state/db-telemetry.js +0 -116
- package/dist/state/db-telemetry.js.map +0 -1
- package/dist/telemetry/gateway-push.d.ts +0 -17
- package/dist/telemetry/gateway-push.js +0 -48
- package/dist/telemetry/gateway-push.js.map +0 -1
- package/dist/telemetry/index.d.ts +0 -9
- package/dist/telemetry/index.js +0 -9
- package/dist/telemetry/index.js.map +0 -1
- package/dist/tools/github.d.ts +0 -13
- package/dist/tools/github.js +0 -257
- package/dist/tools/github.js.map +0 -1
- package/dist/tui/ink/components/VirtualTranscript.d.ts +0 -19
- package/dist/tui/ink/components/VirtualTranscript.js +0 -31
- package/dist/tui/ink/components/VirtualTranscript.js.map +0 -1
- package/dist/tui/ink/markdown/syntax-highlight.d.ts +0 -13
- package/dist/tui/ink/markdown/syntax-highlight.js +0 -91
- package/dist/tui/ink/markdown/syntax-highlight.js.map +0 -1
- package/dist/tui/ink/use-elapsed.d.ts +0 -14
- package/dist/tui/ink/use-elapsed.js +0 -61
- package/dist/tui/ink/use-elapsed.js.map +0 -1
- package/dist/tui/ink/use-flicker-detector.d.ts +0 -12
- package/dist/tui/ink/use-flicker-detector.js +0 -37
- package/dist/tui/ink/use-flicker-detector.js.map +0 -1
- package/dist/tui/ink/use-render-metrics.d.ts +0 -14
- package/dist/tui/ink/use-render-metrics.js +0 -106
- package/dist/tui/ink/use-render-metrics.js.map +0 -1
- package/dist/tui/ink/use-transcript-scroll.d.ts +0 -19
- package/dist/tui/ink/use-transcript-scroll.js +0 -83
- package/dist/tui/ink/use-transcript-scroll.js.map +0 -1
- package/dist/utils/env.d.ts +0 -1
- package/dist/utils/env.js +0 -60
- package/dist/utils/env.js.map +0 -1
- package/dist/utils/fs.d.ts +0 -10
- package/dist/utils/fs.js +0 -37
- package/dist/utils/fs.js.map +0 -1
package/dist/tui/ink/App.js
CHANGED
|
@@ -3,7 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
* Ink root component for the dirgha TUI.
|
|
4
4
|
*
|
|
5
5
|
* Layout is a single vertical stack:
|
|
6
|
-
* 1. Logo (
|
|
6
|
+
* 1. Logo (rendered once inside <Static>, never re-renders)
|
|
7
7
|
* 2. Transcript (finalised user messages + completed turn blocks)
|
|
8
8
|
* 3. LiveTurn (the currently streaming turn, if any)
|
|
9
9
|
* 4. InputBox
|
|
@@ -15,9 +15,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
15
15
|
* focused on layout and lifecycle.
|
|
16
16
|
*/
|
|
17
17
|
import * as React from "react";
|
|
18
|
-
import { Box, Text, useApp, useInput } from "ink";
|
|
18
|
+
import { Box, Static, Text, useApp, useInput } from "ink";
|
|
19
19
|
import { randomUUID } from "node:crypto";
|
|
20
|
-
import { VirtualTranscript } from "./components/VirtualTranscript.js";
|
|
21
20
|
import { appendAudit } from "../../audit/writer.js";
|
|
22
21
|
import { maybeCompact } from "../../context/compaction.js";
|
|
23
22
|
import { contextWindowFor } from "../../intelligence/prices.js";
|
|
@@ -27,7 +26,6 @@ import { loadProjectPrimer, composeSystemPrompt, } from "../../context/primer.js
|
|
|
27
26
|
import { queryKb } from "../../context/kb-query.js";
|
|
28
27
|
import { probeGitState, renderGitState } from "../../context/git-state.js";
|
|
29
28
|
import { loadSoul } from "../../context/soul.js";
|
|
30
|
-
import { routeModel } from "../../providers/dispatch.js";
|
|
31
29
|
import { isAutoApprove, modePreamble } from "../../context/mode.js";
|
|
32
30
|
import { runAgentLoop } from "../../kernel/agent-loop.js";
|
|
33
31
|
import { createErrorClassifier } from "../../intelligence/error-classifier.js";
|
|
@@ -35,9 +33,10 @@ import { createToolExecutor } from "../../tools/exec.js";
|
|
|
35
33
|
import { createInkApprovalBus, } from "./ink-approval-bus.js";
|
|
36
34
|
import { ApprovalPrompt, } from "./components/ApprovalPrompt.js";
|
|
37
35
|
import { PRICES } from "../../intelligence/prices.js";
|
|
36
|
+
import { Logo } from "./components/Logo.js";
|
|
38
37
|
import { StatusBar } from "./components/StatusBar.js";
|
|
39
38
|
import { StreamingText } from "./components/StreamingText.js";
|
|
40
|
-
import { ThinkingBlock
|
|
39
|
+
import { ThinkingBlock } from "./components/ThinkingBlock.js";
|
|
41
40
|
import { ToolBox } from "./components/ToolBox.js";
|
|
42
41
|
import { ToolGroup } from "./components/ToolGroup.js";
|
|
43
42
|
import { InputBox } from "./components/InputBox.js";
|
|
@@ -53,25 +52,21 @@ import { getUpdateBannerVersion } from "../../cli/update-check.js";
|
|
|
53
52
|
import { AtFileComplete } from "./components/AtFileComplete.js";
|
|
54
53
|
import { SlashComplete } from "./components/SlashComplete.js";
|
|
55
54
|
import { ThemePicker } from "./components/ThemePicker.js";
|
|
56
|
-
import { ThemeProvider
|
|
55
|
+
import { ThemeProvider } from "./theme-context.js";
|
|
57
56
|
import { SpinnerContext } from "./spinner-context.js";
|
|
58
|
-
import { SpinnerGlyph } from "./components/SpinnerGlyph.js";
|
|
59
57
|
import { writeFile, mkdir, readFile } from "node:fs/promises";
|
|
60
|
-
import { readFileSync, existsSync } from "node:fs";
|
|
61
58
|
import { homedir } from "node:os";
|
|
62
59
|
import { join as pathJoin } from "node:path";
|
|
63
60
|
import { useEventProjection, } from "./use-event-projection.js";
|
|
64
61
|
import { useOverlays } from "./use-overlays.js";
|
|
65
62
|
import { useDeclinedVersions } from "./use-declined-versions.js";
|
|
66
63
|
import { useStartupHealth } from "./use-startup-health.js";
|
|
67
|
-
import { useFlickerDetector } from "./use-flicker-detector.js";
|
|
68
|
-
import { useRenderMetrics, } from "./use-render-metrics.js";
|
|
69
64
|
import { getRemoteConfig, isVersionBelowMin, } from "../../intelligence/remote-config.js";
|
|
70
65
|
import { createRequire } from "node:module";
|
|
71
66
|
// Pulled from the installed package.json so the TUI title matches the
|
|
72
67
|
// shipped binary version. Falls back to '0.0.0-dev' if the file isn't
|
|
73
68
|
// reachable (e.g. an unusual deploy layout).
|
|
74
|
-
|
|
69
|
+
const VERSION = (() => {
|
|
75
70
|
try {
|
|
76
71
|
const req = createRequire(import.meta.url);
|
|
77
72
|
const pkg = req("../../../package.json");
|
|
@@ -81,19 +76,11 @@ export const VERSION = (() => {
|
|
|
81
76
|
return "0.0.0-dev";
|
|
82
77
|
}
|
|
83
78
|
})();
|
|
84
|
-
// Cache for initialHistory — avoids sync fs I/O in the render phase
|
|
85
|
-
// on re-calls (e.g. /clear). The underlying files rarely change within
|
|
86
|
-
// a session so a single snapshot is sufficient.
|
|
87
|
-
let _cachedInitialMessages = null;
|
|
88
79
|
export function App(props) {
|
|
89
80
|
const { exit } = useApp();
|
|
90
81
|
const sessionIdRef = React.useRef(randomUUID());
|
|
91
82
|
const historyRef = React.useRef(initialHistory(props));
|
|
92
83
|
const abortRef = React.useRef(null);
|
|
93
|
-
// Stores the user-facing cancellation message so the finally block can
|
|
94
|
-
// inject it via appendLiveSync (avoids the React state-updater race
|
|
95
|
-
// where appendLive doesn't update liveItemsRef before commitLive reads it).
|
|
96
|
-
const interruptMsgRef = React.useRef(null);
|
|
97
84
|
const pendingModelRef = React.useRef(null);
|
|
98
85
|
const sessionRef = React.useRef(null);
|
|
99
86
|
React.useEffect(() => {
|
|
@@ -119,7 +106,6 @@ export function App(props) {
|
|
|
119
106
|
const [transcript, setTranscript] = React.useState([]);
|
|
120
107
|
const [input, setInput] = React.useState("");
|
|
121
108
|
const [busy, setBusy] = React.useState(false);
|
|
122
|
-
const [thinkingStreaming, setThinkingStreaming] = React.useState(false);
|
|
123
109
|
// Prompt queue: while a turn is streaming the user can still type and
|
|
124
110
|
// press Enter. Submissions land here instead of being dropped, then
|
|
125
111
|
// drain FIFO when the turn finishes (see useEffect below).
|
|
@@ -156,7 +142,7 @@ export function App(props) {
|
|
|
156
142
|
// turns. Replaces the legacy `createTuiApprovalBus` that wrote prompts
|
|
157
143
|
// direct to stdout (overdrawn by Ink) and read stdin raw (hung on
|
|
158
144
|
// Windows). See `ink-approval-bus.ts` for the full rationale.
|
|
159
|
-
const approvalBusRef = React.useRef(
|
|
145
|
+
const approvalBusRef = React.useRef();
|
|
160
146
|
if (!approvalBusRef.current) {
|
|
161
147
|
approvalBusRef.current = createInkApprovalBus(new Set(props.config.autoApproveTools));
|
|
162
148
|
}
|
|
@@ -200,18 +186,6 @@ export function App(props) {
|
|
|
200
186
|
}, [declined]);
|
|
201
187
|
// Startup health check — non-blocking, cached for 24h.
|
|
202
188
|
const healthResult = useStartupHealth();
|
|
203
|
-
// Flicker detector — compares estimated tree height to terminal rows.
|
|
204
|
-
const estimatedLineCount = (transcript.length + projection.liveItems.length) * 2 + 15;
|
|
205
|
-
const flicker = useFlickerDetector(estimatedLineCount);
|
|
206
|
-
// Render performance metrics — track frame timing, expose for StatusBar.
|
|
207
|
-
const renderMetrics = useRenderMetrics();
|
|
208
|
-
const [showRenderMetrics, setShowRenderMetrics] = React.useState(false);
|
|
209
|
-
// Alt+M toggles the render-metrics display in the StatusBar.
|
|
210
|
-
useInput((ch, key) => {
|
|
211
|
-
if (key.meta && ch === "m") {
|
|
212
|
-
setShowRenderMetrics((v) => !v);
|
|
213
|
-
}
|
|
214
|
-
});
|
|
215
189
|
// Remote config: fetch once on mount, set model default, show MOTD.
|
|
216
190
|
const [remoteConfig, setRemoteConfig] = React.useState(null);
|
|
217
191
|
const [motdShown, setMotdShown] = React.useState(false);
|
|
@@ -303,18 +277,8 @@ export function App(props) {
|
|
|
303
277
|
liveOutputTokensAccRef.current = 0;
|
|
304
278
|
setLiveOutputTokens(0);
|
|
305
279
|
setLiveDurationMs(0);
|
|
306
|
-
setThinkingStreaming(false);
|
|
307
|
-
}
|
|
308
|
-
else if (ev.type === "thinking_start") {
|
|
309
|
-
setThinkingStreaming(true);
|
|
310
|
-
}
|
|
311
|
-
else if (ev.type === "thinking_end") {
|
|
312
|
-
setThinkingStreaming(false);
|
|
313
280
|
}
|
|
314
281
|
else if (ev.type === "text_delta" || ev.type === "thinking_delta") {
|
|
315
|
-
// Approximate tokens as chars ÷ 4 — a common heuristic for English
|
|
316
|
-
// text where avg token length is ~4 characters. Not exact but keeps
|
|
317
|
-
// the tok/s rate plausible without an expensive tokenizer.
|
|
318
282
|
liveOutputTokensAccRef.current += (ev.delta?.length ?? 0) / 4;
|
|
319
283
|
}
|
|
320
284
|
else if (ev.type === "usage") {
|
|
@@ -417,7 +381,7 @@ export function App(props) {
|
|
|
417
381
|
});
|
|
418
382
|
// A new submission supersedes any pending failover prompt.
|
|
419
383
|
setPendingFailover(null);
|
|
420
|
-
if (value === "/exit" || value === "/quit"
|
|
384
|
+
if (value === "/exit" || value === "/quit") {
|
|
421
385
|
exit();
|
|
422
386
|
return;
|
|
423
387
|
}
|
|
@@ -435,36 +399,23 @@ export function App(props) {
|
|
|
435
399
|
if (value.startsWith("/model ")) {
|
|
436
400
|
const id = value.slice("/model ".length).trim();
|
|
437
401
|
if (id !== "") {
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
if (exactMatch) {
|
|
441
|
-
setCurrentModel(exactMatch.model);
|
|
402
|
+
const valid = PRICES.some((p) => p.model === id);
|
|
403
|
+
if (!valid) {
|
|
442
404
|
const note = {
|
|
443
405
|
kind: "notice",
|
|
444
406
|
id: randomUUID(),
|
|
445
|
-
text: `
|
|
407
|
+
text: `Invalid model: ${id}. Use /models to see the catalogue.`,
|
|
446
408
|
};
|
|
447
409
|
setTranscript((prev) => [...prev, note]);
|
|
448
410
|
}
|
|
449
411
|
else {
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
};
|
|
458
|
-
setTranscript((prev) => [...prev, note]);
|
|
459
|
-
}
|
|
460
|
-
else {
|
|
461
|
-
const note = {
|
|
462
|
-
kind: "notice",
|
|
463
|
-
id: randomUUID(),
|
|
464
|
-
text: `Invalid model: ${id}. Use /models to see the catalogue.`,
|
|
465
|
-
};
|
|
466
|
-
setTranscript((prev) => [...prev, note]);
|
|
467
|
-
}
|
|
412
|
+
setCurrentModel(id);
|
|
413
|
+
const note = {
|
|
414
|
+
kind: "notice",
|
|
415
|
+
id: randomUUID(),
|
|
416
|
+
text: `Model set to ${id}`,
|
|
417
|
+
};
|
|
418
|
+
setTranscript((prev) => [...prev, note]);
|
|
468
419
|
}
|
|
469
420
|
}
|
|
470
421
|
return;
|
|
@@ -554,11 +505,7 @@ export function App(props) {
|
|
|
554
505
|
exit();
|
|
555
506
|
process.exit(code);
|
|
556
507
|
},
|
|
557
|
-
getToken: () =>
|
|
558
|
-
// Token loads asynchronously after mount; return null
|
|
559
|
-
// gracefully so slash commands don't crash on first call.
|
|
560
|
-
return tokenRef.current;
|
|
561
|
-
},
|
|
508
|
+
getToken: () => tokenRef.current,
|
|
562
509
|
setToken: (newToken) => {
|
|
563
510
|
tokenRef.current = newToken;
|
|
564
511
|
},
|
|
@@ -747,10 +694,7 @@ export function App(props) {
|
|
|
747
694
|
}
|
|
748
695
|
catch (err) {
|
|
749
696
|
const msg = err instanceof Error ? err.message : String(err);
|
|
750
|
-
|
|
751
|
-
// loop that happen to contain a similar pattern. The message must start
|
|
752
|
-
// with the key name and end with "is required" to qualify.
|
|
753
|
-
const keyMatch = /^([A-Z][A-Z0-9_]+_API_KEY) is required$/.exec(msg);
|
|
697
|
+
const keyMatch = /^([A-Z][A-Z0-9_]+_API_KEY) is required/.exec(msg);
|
|
754
698
|
if (keyMatch?.[1]) {
|
|
755
699
|
setPendingKey({
|
|
756
700
|
keyName: keyMatch[1],
|
|
@@ -766,19 +710,6 @@ export function App(props) {
|
|
|
766
710
|
}
|
|
767
711
|
}
|
|
768
712
|
finally {
|
|
769
|
-
// If the turn was cancelled via ESC / Ctrl-C, inject the notice
|
|
770
|
-
// synchronously into liveItemsRef before commitLive reads it — this
|
|
771
|
-
// avoids the React-state race where appendLive's functional updater
|
|
772
|
-
// hasn't flushed to the ref yet when commitLive runs.
|
|
773
|
-
const interruptMsg = interruptMsgRef.current;
|
|
774
|
-
interruptMsgRef.current = null;
|
|
775
|
-
if (abort.signal.aborted && interruptMsg !== null) {
|
|
776
|
-
projection.appendLiveSync({
|
|
777
|
-
kind: "notice",
|
|
778
|
-
id: randomUUID(),
|
|
779
|
-
text: interruptMsg,
|
|
780
|
-
});
|
|
781
|
-
}
|
|
782
713
|
const committed = projection.commitLive();
|
|
783
714
|
if (committed.length > 0)
|
|
784
715
|
setTranscript((prev) => [...prev, ...committed]);
|
|
@@ -786,12 +717,7 @@ export function App(props) {
|
|
|
786
717
|
abortRef.current = null;
|
|
787
718
|
}
|
|
788
719
|
};
|
|
789
|
-
|
|
790
|
-
// handleSubmit always calls the current version without adding
|
|
791
|
-
// runTurn's deps to handleSubmit's dependency array.
|
|
792
|
-
React.useEffect(() => {
|
|
793
|
-
runTurnRef.current = runTurn;
|
|
794
|
-
});
|
|
720
|
+
runTurnRef.current = runTurn;
|
|
795
721
|
// Drain the prompt queue when a turn finishes. Pops the oldest queued
|
|
796
722
|
// prompt and re-submits it through handleSubmit (which transitions
|
|
797
723
|
// back into busy=true via runTurn). Guarded on `!busy` so we never
|
|
@@ -811,8 +737,6 @@ export function App(props) {
|
|
|
811
737
|
// 2. If a turn is streaming → abort it (cancels the in-flight LLM
|
|
812
738
|
// request via the AbortController plumbed through runAgentLoop).
|
|
813
739
|
// 3. If the input box has draft text → clear it.
|
|
814
|
-
// (step 3 is skipped when vimMode is on — InputBox's own handler
|
|
815
|
-
// enters NORMAL mode; clearing here would destroy the text.)
|
|
816
740
|
// Always active so Esc behaves like the user expects regardless of
|
|
817
741
|
// which surface they're looking at. The atfile overlay handles its
|
|
818
742
|
// own Esc (cancel completion) so we skip step 1 there.
|
|
@@ -824,23 +748,33 @@ export function App(props) {
|
|
|
824
748
|
return;
|
|
825
749
|
}
|
|
826
750
|
if (busy && abortRef.current !== null) {
|
|
827
|
-
interruptMsgRef.current = "Cancelled.";
|
|
828
751
|
abortRef.current.abort();
|
|
752
|
+
projection.appendLive({
|
|
753
|
+
kind: "notice",
|
|
754
|
+
id: randomUUID(),
|
|
755
|
+
text: "Cancelled.",
|
|
756
|
+
});
|
|
829
757
|
return;
|
|
830
758
|
}
|
|
831
|
-
if (input.length > 0
|
|
759
|
+
if (input.length > 0)
|
|
832
760
|
setInput("");
|
|
833
761
|
});
|
|
834
762
|
// Ctrl-C handler: if a turn is running, abort it and show "[Interrupted]"
|
|
835
763
|
// in the transcript (matching the readline path in src/cli/interactive.ts).
|
|
836
|
-
//
|
|
837
|
-
// within 1.5s) — we don't override that here.
|
|
764
|
+
// If idle, let the process exit normally via app.exit().
|
|
838
765
|
useInput((ch, key) => {
|
|
839
766
|
if (!(key.ctrl && ch === "c"))
|
|
840
767
|
return;
|
|
841
768
|
if (busy && abortRef.current !== null) {
|
|
842
|
-
interruptMsgRef.current = "[Interrupted]";
|
|
843
769
|
abortRef.current.abort();
|
|
770
|
+
projection.appendLive({
|
|
771
|
+
kind: "notice",
|
|
772
|
+
id: randomUUID(),
|
|
773
|
+
text: "[Interrupted]",
|
|
774
|
+
});
|
|
775
|
+
}
|
|
776
|
+
else {
|
|
777
|
+
exit();
|
|
844
778
|
}
|
|
845
779
|
});
|
|
846
780
|
const handleModelPick = React.useCallback((id) => {
|
|
@@ -866,7 +800,7 @@ export function App(props) {
|
|
|
866
800
|
}
|
|
867
801
|
catch (err) {
|
|
868
802
|
const msg = err instanceof Error ? err.message : String(err);
|
|
869
|
-
const m =
|
|
803
|
+
const m = /([A-Z][A-Z0-9_]+_API_KEY) is required/.exec(msg);
|
|
870
804
|
if (m?.[1]) {
|
|
871
805
|
// Open inline key entry instead of a static hint — the user can
|
|
872
806
|
// paste their key right here without leaving the REPL.
|
|
@@ -1006,18 +940,19 @@ export function App(props) {
|
|
|
1006
940
|
}
|
|
1007
941
|
})();
|
|
1008
942
|
}, [overlays]);
|
|
1009
|
-
const
|
|
943
|
+
const committedJsx = React.useMemo(() => renderTranscript(transcript), [transcript]);
|
|
944
|
+
// Gemini CLI approach: freeze committed history inside <Static>
|
|
945
|
+
// so Ink caches the output and never re-renders it. Without this,
|
|
946
|
+
// every streaming flush tick re-conciles the entire transcript
|
|
947
|
+
// against the terminal — causing visible flicker/jitter.
|
|
948
|
+
const committedStaticItems = React.useMemo(() => committedJsx.map((el, i) => ({
|
|
949
|
+
key: el?.key ?? `c-${i}`,
|
|
950
|
+
el,
|
|
951
|
+
})), [committedJsx]);
|
|
952
|
+
const liveJsx = React.useMemo(() => renderTranscript(projection.liveItems), [projection.liveItems]);
|
|
1010
953
|
const providerEntries = React.useMemo(() => buildProviderEntries(models, currentModel), [models, currentModel]);
|
|
1011
|
-
const
|
|
1012
|
-
|
|
1013
|
-
// Logo is emitted via process.stdout.write() before Ink mounts (see
|
|
1014
|
-
// tui/ink/index.ts). Keeping it out of Ink's render tree avoids the
|
|
1015
|
-
// re-emission flicker users hit when transcripts overflow the
|
|
1016
|
-
// viewport: Ink's onRender prepends `fullStaticOutput` (which includes
|
|
1017
|
-
// the logo) on every overflow redraw, repainting it on every chat
|
|
1018
|
-
// turn that fills the screen. `use-flicker-detector` already warns
|
|
1019
|
-
// when this is about to happen.
|
|
1020
|
-
return (_jsx(ThemeProvider, { activeTheme: themeName, children: _jsx(SpinnerContext.Provider, { value: spinnerCtx, children: _jsxs(Box, { flexDirection: "column", children: [_jsx(VirtualTranscript, { items: transcript, renderItem: renderTranscriptItem, autoScroll: true, inputFocus: inputFocus }), _jsx(Box, { flexDirection: "column", children: liveJsx }), busy && projection.liveItems.length === 0 && _jsx(GeneratingIndicator, { startedAtMs: turnStartRef.current, liveOutputTokens: liveOutputTokens }), pendingApproval !== null && approvalBusRef.current && (_jsx(ApprovalPrompt, { request: pendingApproval, onResolve: (decision) => {
|
|
954
|
+
const LOGO_ITEMS = React.useMemo(() => [{ key: "logo" }], []);
|
|
955
|
+
return (_jsx(ThemeProvider, { activeTheme: themeName, children: _jsx(SpinnerContext.Provider, { value: { busy, frame: 0 }, children: _jsxs(Box, { flexDirection: "column", children: [_jsx(Static, { items: LOGO_ITEMS, children: () => _jsx(Logo, { version: VERSION }, "logo") }), _jsx(Static, { items: committedStaticItems, children: ({ el }) => el }), _jsx(Box, { flexDirection: "column", children: liveJsx }), pendingApproval !== null && approvalBusRef.current && (_jsx(ApprovalPrompt, { request: pendingApproval, onResolve: (decision) => {
|
|
1021
956
|
approvalBusRef.current?.resolve(pendingApproval.id, decision);
|
|
1022
957
|
} })), pendingFailover !== null && (_jsx(ModelSwitchPrompt, { failedModel: pendingFailover.failedModel, failoverModel: pendingFailover.failoverModel, onAccept: (failover) => {
|
|
1023
958
|
const lastPrompt = pendingFailover.lastPrompt;
|
|
@@ -1072,40 +1007,28 @@ export function App(props) {
|
|
|
1072
1007
|
// Esc inside ModelPicker → back to ProviderPicker (NOT close).
|
|
1073
1008
|
setPickerStage("provider");
|
|
1074
1009
|
setPickerProvider(null);
|
|
1075
|
-
} })), overlays.active === "help" && (_jsx(HelpOverlay, { slashCommands: slashCommands, onClose: overlays.closeOverlay })), overlays.active === "theme" && (_jsx(ThemePicker, { current: themeName, onPick: handleThemePick, onCancel: overlays.closeOverlay })), pendingKey && (_jsx(KeySetOverlay, { keyName: pendingKey.keyName, onSave: handleKeySetSave, onCancel: () => setPendingKey(null) })), updateVersion !== null && (_jsx(Box, { paddingX: 1, children: _jsxs(Text, { color: "yellow", children: ["[v", updateVersion, " available \u2014 press Ctrl+U or /upgrade to upgrade]"] }) })), _jsx(StatusBar, { model: currentModel, provider: providerIdForModel(currentModel), inputTokens: projection.totals.inputTokens, outputTokens: projection.totals.outputTokens, costUsd: projection.totals.costUsd, cwd: props.cwd, busy: busy, mode: mode, contextWindow: contextWindowFor(currentModel), liveOutputTokens: liveOutputTokens, liveDurationMs: liveDurationMs
|
|
1010
|
+
} })), overlays.active === "help" && (_jsx(HelpOverlay, { slashCommands: slashCommands, onClose: overlays.closeOverlay })), overlays.active === "theme" && (_jsx(ThemePicker, { current: themeName, onPick: handleThemePick, onCancel: overlays.closeOverlay })), pendingKey && (_jsx(KeySetOverlay, { keyName: pendingKey.keyName, onSave: handleKeySetSave, onCancel: () => setPendingKey(null) })), updateVersion !== null && (_jsx(Box, { paddingX: 1, children: _jsxs(Text, { color: "yellow", children: ["[v", updateVersion, " available \u2014 press Ctrl+U or /upgrade to upgrade]"] }) })), _jsx(StatusBar, { model: currentModel, provider: providerIdForModel(currentModel), inputTokens: projection.totals.inputTokens, outputTokens: projection.totals.outputTokens, costUsd: projection.totals.costUsd, cwd: props.cwd, busy: busy, mode: mode, contextWindow: contextWindowFor(currentModel), liveOutputTokens: liveOutputTokens, liveDurationMs: liveDurationMs })] }) }) }));
|
|
1076
1011
|
}
|
|
1077
1012
|
/**
|
|
1078
1013
|
* Walk the transcript and fold consecutive `tool` items into a single
|
|
1079
|
-
* <ToolGroup>.
|
|
1080
|
-
*
|
|
1081
|
-
*
|
|
1014
|
+
* <ToolGroup>. Non-tool items render via <TranscriptRow>. The grouping
|
|
1015
|
+
* is intentionally simple — we look at adjacency, not assistant-turn
|
|
1016
|
+
* boundaries, because the projection emits tools contiguously between
|
|
1017
|
+
* `text` spans of the same turn.
|
|
1082
1018
|
*/
|
|
1083
|
-
function renderTranscript(items
|
|
1019
|
+
function renderTranscript(items) {
|
|
1084
1020
|
const out = [];
|
|
1085
1021
|
let toolBuf = [];
|
|
1086
|
-
let thinkBuf = [];
|
|
1087
1022
|
const flushTools = () => {
|
|
1088
1023
|
if (toolBuf.length === 0)
|
|
1089
1024
|
return;
|
|
1025
|
+
// Key on the stable ID of the first tool so React never unmounts/remounts
|
|
1026
|
+
// the ToolGroup subtree when the counter resets (which caused flicker).
|
|
1090
1027
|
out.push(_jsx(ToolGroup, { tools: toolBuf }, toolBuf[0].id));
|
|
1091
1028
|
toolBuf = [];
|
|
1092
1029
|
};
|
|
1093
|
-
const flushThinking = () => {
|
|
1094
|
-
if (thinkBuf.length === 0)
|
|
1095
|
-
return;
|
|
1096
|
-
if (thinkBuf.length >= 3) {
|
|
1097
|
-
out.push(_jsx(ThinkingBlockGroup, { blocks: thinkBuf }, thinkBuf[0].id));
|
|
1098
|
-
}
|
|
1099
|
-
else {
|
|
1100
|
-
for (const tb of thinkBuf) {
|
|
1101
|
-
out.push(_jsx(TranscriptRow, { item: { kind: "thinking", id: tb.id, content: tb.content }, isStreaming: thinkingStreaming }, tb.id));
|
|
1102
|
-
}
|
|
1103
|
-
}
|
|
1104
|
-
thinkBuf = [];
|
|
1105
|
-
};
|
|
1106
1030
|
for (const item of items) {
|
|
1107
1031
|
if (item.kind === "tool") {
|
|
1108
|
-
flushThinking();
|
|
1109
1032
|
toolBuf.push({
|
|
1110
1033
|
id: item.id,
|
|
1111
1034
|
name: item.name,
|
|
@@ -1118,27 +1041,20 @@ function renderTranscript(items, thinkingStreaming) {
|
|
|
1118
1041
|
});
|
|
1119
1042
|
continue;
|
|
1120
1043
|
}
|
|
1121
|
-
if (item.kind === "thinking") {
|
|
1122
|
-
flushTools();
|
|
1123
|
-
thinkBuf.push({ id: item.id, content: item.content });
|
|
1124
|
-
continue;
|
|
1125
|
-
}
|
|
1126
1044
|
flushTools();
|
|
1127
|
-
|
|
1128
|
-
out.push(_jsx(TranscriptRow, { item: item, isStreaming: thinkingStreaming }, item.id));
|
|
1045
|
+
out.push(_jsx(TranscriptRow, { item: item }, item.id));
|
|
1129
1046
|
}
|
|
1130
1047
|
flushTools();
|
|
1131
|
-
flushThinking();
|
|
1132
1048
|
return out;
|
|
1133
1049
|
}
|
|
1134
|
-
function TranscriptRow({ item,
|
|
1050
|
+
function TranscriptRow({ item, }) {
|
|
1135
1051
|
switch (item.kind) {
|
|
1136
1052
|
case "user":
|
|
1137
1053
|
return (_jsxs(Box, { gap: 2, marginBottom: 1, children: [_jsx(Text, { color: "magenta", children: "\u276F" }), _jsx(Text, { color: "white", children: item.text })] }));
|
|
1138
1054
|
case "text":
|
|
1139
1055
|
return _jsx(StreamingText, { content: item.content });
|
|
1140
1056
|
case "thinking":
|
|
1141
|
-
return _jsx(ThinkingBlock, { content: item.content
|
|
1057
|
+
return _jsx(ThinkingBlock, { content: item.content });
|
|
1142
1058
|
case "tool":
|
|
1143
1059
|
// Should not be reached — tools are folded by renderTranscript() into
|
|
1144
1060
|
// <ToolGroup>. Kept as a safety net so an unexpected tool item still
|
|
@@ -1150,23 +1066,7 @@ function TranscriptRow({ item, isStreaming = false, }) {
|
|
|
1150
1066
|
return (_jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "yellow", children: item.text }) }));
|
|
1151
1067
|
}
|
|
1152
1068
|
}
|
|
1153
|
-
function GeneratingIndicator(props) {
|
|
1154
|
-
const palette = useTheme();
|
|
1155
|
-
const [now, setNow] = React.useState(Date.now());
|
|
1156
|
-
React.useEffect(() => {
|
|
1157
|
-
const t = setInterval(() => setNow(Date.now()), 1000);
|
|
1158
|
-
return () => clearInterval(t);
|
|
1159
|
-
}, []);
|
|
1160
|
-
const elapsedSec = props.startedAtMs > 0 ? Math.round((now - props.startedAtMs) / 1000) : 0;
|
|
1161
|
-
const slow = elapsedSec >= 5 && props.liveOutputTokens === 0;
|
|
1162
|
-
const label = slow
|
|
1163
|
-
? `warming up · ${elapsedSec}s · first token can take 10–30s on free models`
|
|
1164
|
-
: `generating · ${elapsedSec}s`;
|
|
1165
|
-
return (_jsxs(Box, { gap: 1, marginBottom: 1, children: [_jsx(SpinnerGlyph, { isActive: true, color: palette.text.secondary }), _jsx(Text, { color: palette.text.secondary, dimColor: true, children: label })] }));
|
|
1166
|
-
}
|
|
1167
1069
|
function initialHistory(props) {
|
|
1168
|
-
if (_cachedInitialMessages !== null)
|
|
1169
|
-
return _cachedInitialMessages;
|
|
1170
1070
|
const base = props.initialMessages ? [...props.initialMessages] : [];
|
|
1171
1071
|
// Boot context: mode preamble + project primer (DIRGHA.md) +
|
|
1172
1072
|
// caller's --system. Without this, the Ink TUI starts with zero
|
|
@@ -1183,18 +1083,30 @@ function initialHistory(props) {
|
|
|
1183
1083
|
userSystem: props.systemPrompt,
|
|
1184
1084
|
});
|
|
1185
1085
|
base.unshift({ role: "system", content: composedSystem });
|
|
1186
|
-
_cachedInitialMessages = base;
|
|
1187
1086
|
return base;
|
|
1188
1087
|
}
|
|
1189
1088
|
function providerIdForModel(model) {
|
|
1190
|
-
//
|
|
1191
|
-
//
|
|
1192
|
-
|
|
1193
|
-
return
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1089
|
+
// Light heuristic so StatusBar has a hint without importing dispatch.
|
|
1090
|
+
// Real routing still lives in providers/dispatch.ts at run time.
|
|
1091
|
+
if (model.includes("claude"))
|
|
1092
|
+
return "anthropic";
|
|
1093
|
+
if (model.includes("gpt") || model.startsWith("o1") || model.startsWith("o3"))
|
|
1094
|
+
return "openai";
|
|
1095
|
+
if (model.includes("gemini"))
|
|
1096
|
+
return "gemini";
|
|
1097
|
+
if (model.includes("deepseek"))
|
|
1098
|
+
return "deepseek";
|
|
1099
|
+
if (model.includes("kimi") || model.includes("moonshot"))
|
|
1100
|
+
return "nvidia";
|
|
1101
|
+
if (model.includes("llama") ||
|
|
1102
|
+
model.includes("nvidia") ||
|
|
1103
|
+
model.includes("minimax"))
|
|
1104
|
+
return "nvidia";
|
|
1105
|
+
if (model.includes("fireworks"))
|
|
1106
|
+
return "fireworks";
|
|
1107
|
+
if (model.includes("/"))
|
|
1108
|
+
return "openrouter";
|
|
1109
|
+
return "local";
|
|
1198
1110
|
}
|
|
1199
1111
|
const PROVIDER_BLURB = {
|
|
1200
1112
|
anthropic: "Claude — Opus, Sonnet, Haiku",
|
|
@@ -1253,24 +1165,6 @@ const PROVIDER_LABEL = {
|
|
|
1253
1165
|
zai: "Z.AI / GLM",
|
|
1254
1166
|
local: "Local",
|
|
1255
1167
|
};
|
|
1256
|
-
/**
|
|
1257
|
-
* Synchronously check whether an env var exists in ~/.dirgha/keys.json.
|
|
1258
|
-
* Used by buildProviderEntries as a fallback when process.env doesn't
|
|
1259
|
-
* contain the key yet (race with startup hydration).
|
|
1260
|
-
*/
|
|
1261
|
-
function tryReadKeyFromStore(envVar) {
|
|
1262
|
-
try {
|
|
1263
|
-
const path = pathJoin(homedir(), ".dirgha", "keys.json");
|
|
1264
|
-
if (!existsSync(path))
|
|
1265
|
-
return false;
|
|
1266
|
-
const raw = readFileSync(path, "utf8");
|
|
1267
|
-
const store = JSON.parse(raw);
|
|
1268
|
-
return typeof store[envVar] === "string" && store[envVar].length > 0;
|
|
1269
|
-
}
|
|
1270
|
-
catch {
|
|
1271
|
-
return false;
|
|
1272
|
-
}
|
|
1273
|
-
}
|
|
1274
1168
|
/**
|
|
1275
1169
|
* Group the flat model catalogue into per-provider entries for stage 1
|
|
1276
1170
|
* of the picker. Skips providers with zero models in the catalogue.
|
|
@@ -1286,13 +1180,7 @@ function buildProviderEntries(models, currentModel) {
|
|
|
1286
1180
|
const out = [];
|
|
1287
1181
|
for (const [id, items] of buckets) {
|
|
1288
1182
|
const env = PROVIDER_ENV[id];
|
|
1289
|
-
|
|
1290
|
-
// into process.env by hydrateEnvFromKeyStore at startup, but this
|
|
1291
|
-
// synchronous fallback handles the edge case where hydration hasn't
|
|
1292
|
-
// run yet (e.g. TUI mounts before startup hydration completes).
|
|
1293
|
-
const hasKey = env
|
|
1294
|
-
? !!process.env[env] || !!tryReadKeyFromStore(env)
|
|
1295
|
-
: true; // local providers don't need keys
|
|
1183
|
+
const hasKey = env ? !!process.env[env] : true; // local providers don't need keys
|
|
1296
1184
|
out.push({
|
|
1297
1185
|
id,
|
|
1298
1186
|
label: PROVIDER_LABEL[id] ?? id,
|