@cjhyy/code-shell 0.1.0-alpha.3 → 0.1.6
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 +107 -0
- package/dist/anthropic-IBTI4WL2.cjs +10 -0
- package/dist/anthropic-PRZZKHEZ.js +10 -0
- package/dist/arena/index.cjs +7 -6
- package/dist/arena/index.js +6 -5
- package/dist/arena/model-presets.d.ts +10 -1
- package/dist/{arena-ENHBHB2W.js → arena-2LTLIXOL.js} +9 -7
- package/dist/{arena-HHDYYVHJ.cjs → arena-ADB7DRFI.cjs} +25 -23
- package/dist/{chunk-EL2RL5DG.cjs → chunk-2YW4FPFG.cjs} +2 -2
- package/dist/chunk-3OA5G4TM.js +47 -0
- package/dist/{chunk-FPFTIKEJ.js → chunk-3QO25N6E.js} +131 -173
- package/dist/chunk-3SBSUOWZ.js +447 -0
- package/dist/chunk-52LGZKT3.cjs +47 -0
- package/dist/{chunk-KOGV6PDQ.cjs → chunk-55XGPMAP.cjs} +44 -9
- package/dist/{chunk-YD7XTI7T.cjs → chunk-6QVAYW7C.cjs} +116 -28
- package/dist/{chunk-SCDKLTN3.js → chunk-6S4BJ65N.js} +5 -4
- package/dist/{chunk-ZLPJJZUW.js → chunk-76HYEPDM.js} +2 -2
- package/dist/chunk-7BI3V74Y.cjs +447 -0
- package/dist/{chunk-GZBD6QRS.cjs → chunk-7EG3V4JY.cjs} +13 -12
- package/dist/{chunk-LMEKCQX4.js → chunk-7JVTYEEC.js} +6 -6
- package/dist/{chunk-SW3L7HIM.js → chunk-7QIM3BKD.js} +2 -2
- package/dist/{chunk-5C5HIOML.js → chunk-7Y6S3OCX.js} +109 -21
- package/dist/{chunk-REFCCVDM.js → chunk-ABRRONJ7.js} +2 -2
- package/dist/{chunk-F5BS3GUC.js → chunk-BSW22MPA.js} +39 -4
- package/dist/{chunk-ZRVPCXI7.js → chunk-BXCY2FSE.js} +2 -1
- package/dist/{chunk-Y7TSCDF6.js → chunk-BZ5TNE7L.js} +347 -6
- package/dist/{chunk-X2DNIMPC.cjs → chunk-DDB6QOKJ.cjs} +32 -32
- package/dist/{chunk-C7C7ZZY4.cjs → chunk-HEKQCI7B.cjs} +10 -10
- package/dist/{chunk-JHNCK7JP.cjs → chunk-IK4EWJBP.cjs} +4 -3
- package/dist/{chunk-3CAZIWUA.cjs → chunk-ILHE7XLT.cjs} +9 -9
- package/dist/{chunk-M2QI5X3X.cjs → chunk-JMR33QVF.cjs} +2 -2
- package/dist/{chunk-TDXBHD24.js → chunk-KAQHULYN.js} +2 -2
- package/dist/chunk-KE4EQOWA.js +294 -0
- package/dist/{chunk-YAFCN7ZW.cjs → chunk-KOVYSDHZ.cjs} +15 -15
- package/dist/{chunk-IJSHQGMP.cjs → chunk-KS3RYAYL.cjs} +4 -4
- package/dist/{chunk-DI7RDLOS.js → chunk-MD32R22I.js} +7 -4
- package/dist/chunk-MV7YI4WO.cjs +293 -0
- package/dist/chunk-MY5XHADU.cjs +216 -0
- package/dist/{chunk-OP57WUWQ.cjs → chunk-NUNC3VFB.cjs} +6 -6
- package/dist/{chunk-ID6EJUHP.js → chunk-PKGRTCCY.js} +1307 -212
- package/dist/{chunk-OUC2DFA7.js → chunk-QARL3IDQ.js} +3 -3
- package/dist/{chunk-VIPLU4RY.cjs → chunk-S754JHLR.cjs} +4 -4
- package/dist/{chunk-FUOKLKR2.js → chunk-SFXHZSRF.js} +1 -1
- package/dist/{chunk-2EUAE7AY.js → chunk-SIHHIQLO.js} +2 -2
- package/dist/{chunk-SK62UVS6.js → chunk-T6VYG46N.js} +1 -1
- package/dist/{chunk-JHXNOB5G.cjs → chunk-TNLGBJYS.cjs} +6 -6
- package/dist/{chunk-3QR52LL5.cjs → chunk-TUY2T5KP.cjs} +2 -2
- package/dist/{chunk-VWFET3MG.cjs → chunk-UXOCVJJ6.cjs} +1519 -424
- package/dist/{chunk-I57ZD5IQ.js → chunk-VIAGTYYW.js} +1 -1
- package/dist/chunk-WASS5YWB.js +215 -0
- package/dist/{chunk-HOXQLX5R.cjs → chunk-WZJV6DJC.cjs} +444 -103
- package/dist/{chunk-BUJ5KYCI.cjs → chunk-YIQBXAYU.cjs} +13 -13
- package/dist/{chunk-BF4LXLQV.cjs → chunk-YKIAELDZ.cjs} +132 -174
- package/dist/{chunk-M2SVOKC6.js → chunk-ZBPSQCPU.js} +6 -6
- package/dist/cli/commands/builtin/export-md.d.ts +19 -0
- package/dist/cli/commands/builtin/init/detect.d.ts +25 -0
- package/dist/cli/commands/builtin/init/index.d.ts +19 -0
- package/dist/cli/main.cjs +2372 -1453
- package/dist/cli/main.js +2502 -1583
- package/dist/cli/migrate-models.d.ts +45 -0
- package/dist/cli/onboarding.d.ts +110 -5
- package/dist/cli/updater.d.ts +59 -4
- package/dist/client-base-HTF236ZD.cjs +9 -0
- package/dist/client-base-QKRKCOWB.js +9 -0
- package/dist/{compaction-YNWCEF7B.js → compaction-6VU2T643.js} +4 -2
- package/dist/compaction-OKUNTCA7.cjs +33 -0
- package/dist/context/compaction.d.ts +35 -3
- package/dist/context/manager.d.ts +40 -3
- package/dist/context/tool-result-storage.d.ts +96 -0
- package/dist/devtools-T2NIZBJK.cjs +6 -0
- package/dist/{devtools-IRQQPIRY.js → devtools-YXWHOVKR.js} +1 -1
- package/dist/engine/engine.d.ts +47 -0
- package/dist/engine/turn-loop.d.ts +6 -0
- package/dist/export-md-RXDW6F5W.cjs +135 -0
- package/dist/export-md-XXKZANW5.js +135 -0
- package/dist/file-history-KYPE3ECT.cjs +7 -0
- package/dist/file-history-LF4F7X26.js +7 -0
- package/dist/index.cjs +42 -22
- package/dist/index.d.ts +5 -2
- package/dist/index.js +38 -18
- package/dist/llm/client-base.d.ts +1 -1
- package/dist/llm/model-cache.d.ts +21 -0
- package/dist/llm/model-fetcher.d.ts +29 -0
- package/dist/llm/model-pool.d.ts +13 -0
- package/dist/llm/provider-catalog.d.ts +30 -0
- package/dist/llm/provider-kinds.d.ts +21 -0
- package/dist/llm/types.d.ts +8 -0
- package/dist/logging/session-recorder.d.ts +77 -0
- package/dist/manager-D65VFAPX.js +7 -0
- package/dist/manager-TTF5VHJC.cjs +7 -0
- package/dist/mcp-manager-QMKWPBZ4.js +8 -0
- package/dist/mcp-manager-Z3OKI74O.cjs +8 -0
- package/dist/memory-5LWZ6FI2.cjs +9 -0
- package/dist/{memory-EPFDBPII.js → memory-VIJLBAMQ.js} +2 -2
- package/dist/model-cache-5KIYL5SL.js +13 -0
- package/dist/model-cache-OED3IM4R.cjs +13 -0
- package/dist/model-fetcher-HKGICACL.js +8 -0
- package/dist/model-fetcher-UR6WJOQP.cjs +8 -0
- package/dist/openai-JR2WEKOF.js +10 -0
- package/dist/openai-YBTOET4O.cjs +10 -0
- package/dist/{openrouter-models-2FM3H4SQ.js → openrouter-models-H56GHBHN.js} +2 -2
- package/dist/openrouter-models-TWUFWZ5T.cjs +15 -0
- package/dist/openrouter-sync-5VMGN6C2.cjs +11 -0
- package/dist/{openrouter-sync-SO3AWEAM.js → openrouter-sync-ALEMF5IU.js} +3 -3
- package/dist/product/index.cjs +17 -15
- package/dist/product/index.js +16 -14
- package/dist/protocol/server.d.ts +3 -1
- package/dist/protocol/types.d.ts +36 -2
- package/dist/run/index.cjs +17 -15
- package/dist/run/index.js +16 -14
- package/dist/services/index.d.ts +0 -1
- package/dist/session-manager-Q22BBMD3.js +8 -0
- package/dist/session-manager-XODQVL3C.cjs +8 -0
- package/dist/settings/schema.d.ts +267 -42
- package/dist/{tool-summary-RYNR4DDB.cjs → tool-summary-63DPIS7G.cjs} +4 -4
- package/dist/{tool-summary-2RUFL5QK.js → tool-summary-NP5CDBKG.js} +2 -2
- package/dist/tool-system/builtin/ask-user.d.ts +9 -1
- package/dist/tool-system/context.d.ts +31 -2
- package/dist/tool-system/executor.d.ts +4 -0
- package/dist/tool-system/investigation-guard.d.ts +46 -0
- package/dist/types.d.ts +13 -2
- package/dist/ui/components/AskUserPrompt.d.ts +8 -1
- package/dist/ui/components/DiffLine.d.ts +33 -0
- package/dist/ui/components/ModelManager.d.ts +34 -1
- package/dist/ui/components/OnboardingPrompt.d.ts +10 -1
- package/dist/ui/components/ProviderModelFlow.d.ts +58 -0
- package/dist/ui/components/UpdateBanner.d.ts +1 -0
- package/dist/updater-I7QBW4DP.cjs +17 -0
- package/dist/updater-NVME5S3Z.js +17 -0
- package/dist/utils/semver.d.ts +1 -0
- package/dist/utils/task-sanitizer.d.ts +6 -0
- package/package.json +2 -1
- package/skills-builtin/codeshell-help.md +135 -0
- package/dist/anthropic-P5VETAFI.cjs +0 -10
- package/dist/anthropic-W2GU3D76.js +0 -10
- package/dist/chunk-75E4BBFC.js +0 -224
- package/dist/chunk-FV2ARONZ.cjs +0 -224
- package/dist/client-base-TOVE25FA.js +0 -9
- package/dist/client-base-VDDIADAC.cjs +0 -9
- package/dist/compaction-D3KV2NWY.cjs +0 -31
- package/dist/devtools-WTC3NFNE.cjs +0 -6
- package/dist/file-history-HZWO2WQ5.js +0 -7
- package/dist/file-history-UQQILIY7.cjs +0 -7
- package/dist/manager-FWLOVEEK.cjs +0 -7
- package/dist/manager-GEXJLOIS.js +0 -7
- package/dist/mcp-manager-37GQLFGX.js +0 -8
- package/dist/mcp-manager-U77NEXBY.cjs +0 -8
- package/dist/memory-ADGOWADP.cjs +0 -9
- package/dist/openai-RXU5URYI.js +0 -10
- package/dist/openai-SQW4H2K4.cjs +0 -10
- package/dist/openrouter-models-PLCWZZYE.cjs +0 -15
- package/dist/openrouter-sync-K2WK3A2A.cjs +0 -11
- package/dist/services/compact.d.ts +0 -56
- package/dist/session-manager-HRSKENKB.cjs +0 -8
- package/dist/session-manager-NEKFEHF3.js +0 -8
- package/dist/updater-J7L7R6BY.cjs +0 -185
- package/dist/updater-LDBNYCAO.js +0 -185
package/dist/run/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createRunManager
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-7QIM3BKD.js";
|
|
4
4
|
import {
|
|
5
5
|
ArtifactTracker,
|
|
6
6
|
CheckpointWriter,
|
|
@@ -15,19 +15,21 @@ import {
|
|
|
15
15
|
RunQueue,
|
|
16
16
|
VALID_TRANSITIONS,
|
|
17
17
|
createRunAskUserFn
|
|
18
|
-
} from "../chunk-
|
|
19
|
-
import "../chunk-
|
|
20
|
-
import "../chunk-
|
|
21
|
-
import "../chunk-
|
|
22
|
-
import "../chunk-
|
|
23
|
-
import "../chunk-
|
|
24
|
-
import "../chunk-
|
|
25
|
-
import "../chunk-
|
|
26
|
-
import "../chunk-
|
|
27
|
-
import "../chunk-
|
|
28
|
-
import "../chunk-
|
|
29
|
-
import "../chunk-
|
|
30
|
-
import "../chunk-
|
|
18
|
+
} from "../chunk-PKGRTCCY.js";
|
|
19
|
+
import "../chunk-BSW22MPA.js";
|
|
20
|
+
import "../chunk-3OA5G4TM.js";
|
|
21
|
+
import "../chunk-SIHHIQLO.js";
|
|
22
|
+
import "../chunk-7Y6S3OCX.js";
|
|
23
|
+
import "../chunk-VIAGTYYW.js";
|
|
24
|
+
import "../chunk-76HYEPDM.js";
|
|
25
|
+
import "../chunk-3SBSUOWZ.js";
|
|
26
|
+
import "../chunk-T6VYG46N.js";
|
|
27
|
+
import "../chunk-QARL3IDQ.js";
|
|
28
|
+
import "../chunk-BZ5TNE7L.js";
|
|
29
|
+
import "../chunk-3QO25N6E.js";
|
|
30
|
+
import "../chunk-SFXHZSRF.js";
|
|
31
|
+
import "../chunk-BXCY2FSE.js";
|
|
32
|
+
import "../chunk-MD32R22I.js";
|
|
31
33
|
export {
|
|
32
34
|
ArtifactTracker,
|
|
33
35
|
CheckpointWriter,
|
package/dist/services/index.d.ts
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* Services index — re-exports all service modules.
|
|
3
3
|
*/
|
|
4
4
|
export { analytics, trackEvent } from "./analytics.js";
|
|
5
|
-
export { compactionService, microCompact, shouldAutoCompact, buildCompactionPrompt, applyCompaction, type CompactionConfig, type CompactionResult, } from "./compact.js";
|
|
6
5
|
export { authorize, refreshToken, type OAuthConfig, type OAuthTokens } from "./oauth.js";
|
|
7
6
|
export { notify, notifyComplete, notifyError } from "./notifier.js";
|
|
8
7
|
export { diagnostics } from "./diagnostics.js";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunkNUNC3VFBcjs = require('./chunk-NUNC3VFB.cjs');
|
|
4
|
+
require('./chunk-2YW4FPFG.cjs');
|
|
5
|
+
require('./chunk-KS3RYAYL.cjs');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
exports.SessionManager = _chunkNUNC3VFBcjs.SessionManager;
|
|
@@ -22,6 +22,22 @@ export declare const SettingsSchema: z.ZodObject<{
|
|
|
22
22
|
customSystemPrompt?: string | undefined;
|
|
23
23
|
appendSystemPrompt?: string | undefined;
|
|
24
24
|
}>>;
|
|
25
|
+
/**
|
|
26
|
+
* Primary source of truth for the active model is settings.activeKey
|
|
27
|
+
* (points at models[].key). settings.model is a derived mirror of that
|
|
28
|
+
* entry kept in sync for legacy boot paths (cli/main.ts, repl.ts, etc.)
|
|
29
|
+
* which read provider/name/apiKey/baseUrl directly. Writers must update
|
|
30
|
+
* both — appendOnboardingResult does this in one shot.
|
|
31
|
+
*/
|
|
32
|
+
activeKey: z.ZodOptional<z.ZodString>;
|
|
33
|
+
/**
|
|
34
|
+
* Toggle background auto-update. When true (default), code-shell checks
|
|
35
|
+
* npm for newer versions and — if the npm global prefix is writable —
|
|
36
|
+
* installs the update in the background on process exit so the next
|
|
37
|
+
* launch picks it up.
|
|
38
|
+
* Can also be disabled via env var `DISABLE_AUTOUPDATER=1`.
|
|
39
|
+
*/
|
|
40
|
+
autoUpdates: z.ZodDefault<z.ZodBoolean>;
|
|
25
41
|
model: z.ZodDefault<z.ZodObject<{
|
|
26
42
|
provider: z.ZodDefault<z.ZodString>;
|
|
27
43
|
name: z.ZodDefault<z.ZodString>;
|
|
@@ -40,35 +56,94 @@ export declare const SettingsSchema: z.ZodObject<{
|
|
|
40
56
|
provider?: string | undefined;
|
|
41
57
|
name?: string | undefined;
|
|
42
58
|
maxTokens?: number | undefined;
|
|
43
|
-
apiKey?: string | undefined;
|
|
44
59
|
baseUrl?: string | undefined;
|
|
60
|
+
apiKey?: string | undefined;
|
|
45
61
|
temperature?: number | undefined;
|
|
46
62
|
}>>;
|
|
47
|
-
|
|
63
|
+
providers: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
48
64
|
key: z.ZodString;
|
|
49
65
|
label: z.ZodOptional<z.ZodString>;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
baseUrl: z.ZodOptional<z.ZodString>;
|
|
66
|
+
kind: z.ZodEnum<["openai", "anthropic", "deepseek", "xai", "mistral", "groq", "google", "openrouter", "ollama", "custom"]>;
|
|
67
|
+
baseUrl: z.ZodString;
|
|
53
68
|
apiKey: z.ZodOptional<z.ZodString>;
|
|
69
|
+
protocol: z.ZodOptional<z.ZodEnum<["openai-compat", "anthropic-style"]>>;
|
|
70
|
+
modelsPath: z.ZodOptional<z.ZodString>;
|
|
71
|
+
}, "strip", z.ZodTypeAny, {
|
|
72
|
+
kind: "anthropic" | "openai" | "openrouter" | "deepseek" | "ollama" | "mistral" | "custom" | "xai" | "groq" | "google";
|
|
73
|
+
key: string;
|
|
74
|
+
baseUrl: string;
|
|
75
|
+
label?: string | undefined;
|
|
76
|
+
apiKey?: string | undefined;
|
|
77
|
+
protocol?: "openai-compat" | "anthropic-style" | undefined;
|
|
78
|
+
modelsPath?: string | undefined;
|
|
79
|
+
}, {
|
|
80
|
+
kind: "anthropic" | "openai" | "openrouter" | "deepseek" | "ollama" | "mistral" | "custom" | "xai" | "groq" | "google";
|
|
81
|
+
key: string;
|
|
82
|
+
baseUrl: string;
|
|
83
|
+
label?: string | undefined;
|
|
84
|
+
apiKey?: string | undefined;
|
|
85
|
+
protocol?: "openai-compat" | "anthropic-style" | undefined;
|
|
86
|
+
modelsPath?: string | undefined;
|
|
87
|
+
}>, "many">>;
|
|
88
|
+
models: z.ZodDefault<z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
89
|
+
key: z.ZodString;
|
|
90
|
+
label: z.ZodOptional<z.ZodString>;
|
|
91
|
+
providerKey: z.ZodOptional<z.ZodString>;
|
|
92
|
+
model: z.ZodString;
|
|
54
93
|
maxOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
55
94
|
maxContextTokens: z.ZodOptional<z.ZodNumber>;
|
|
95
|
+
/**
|
|
96
|
+
* Which LLM client to use ("openai" or "anthropic"). New name —
|
|
97
|
+
* the legacy field is `provider`, which we still accept and
|
|
98
|
+
* fold into `protocol` below so old configs keep working.
|
|
99
|
+
* NOT the brand/vendor — that's providerKey above.
|
|
100
|
+
*/
|
|
101
|
+
protocol: z.ZodOptional<z.ZodString>;
|
|
102
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
103
|
+
baseUrl: z.ZodOptional<z.ZodString>;
|
|
104
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
56
105
|
}, "strip", z.ZodTypeAny, {
|
|
57
|
-
provider: string;
|
|
58
106
|
model: string;
|
|
59
107
|
key: string;
|
|
60
|
-
|
|
108
|
+
provider?: string | undefined;
|
|
61
109
|
baseUrl?: string | undefined;
|
|
62
110
|
label?: string | undefined;
|
|
111
|
+
apiKey?: string | undefined;
|
|
112
|
+
protocol?: string | undefined;
|
|
113
|
+
providerKey?: string | undefined;
|
|
63
114
|
maxOutputTokens?: number | undefined;
|
|
64
115
|
maxContextTokens?: number | undefined;
|
|
65
116
|
}, {
|
|
66
|
-
provider: string;
|
|
67
117
|
model: string;
|
|
68
118
|
key: string;
|
|
119
|
+
provider?: string | undefined;
|
|
120
|
+
baseUrl?: string | undefined;
|
|
121
|
+
label?: string | undefined;
|
|
69
122
|
apiKey?: string | undefined;
|
|
123
|
+
protocol?: string | undefined;
|
|
124
|
+
providerKey?: string | undefined;
|
|
125
|
+
maxOutputTokens?: number | undefined;
|
|
126
|
+
maxContextTokens?: number | undefined;
|
|
127
|
+
}>, {
|
|
128
|
+
protocol: string | undefined;
|
|
129
|
+
provider: string | undefined;
|
|
130
|
+
model: string;
|
|
131
|
+
key: string;
|
|
70
132
|
baseUrl?: string | undefined;
|
|
71
133
|
label?: string | undefined;
|
|
134
|
+
apiKey?: string | undefined;
|
|
135
|
+
providerKey?: string | undefined;
|
|
136
|
+
maxOutputTokens?: number | undefined;
|
|
137
|
+
maxContextTokens?: number | undefined;
|
|
138
|
+
}, {
|
|
139
|
+
model: string;
|
|
140
|
+
key: string;
|
|
141
|
+
provider?: string | undefined;
|
|
142
|
+
baseUrl?: string | undefined;
|
|
143
|
+
label?: string | undefined;
|
|
144
|
+
apiKey?: string | undefined;
|
|
145
|
+
protocol?: string | undefined;
|
|
146
|
+
providerKey?: string | undefined;
|
|
72
147
|
maxOutputTokens?: number | undefined;
|
|
73
148
|
maxContextTokens?: number | undefined;
|
|
74
149
|
}>, "many">>;
|
|
@@ -182,30 +257,30 @@ export declare const SettingsSchema: z.ZodObject<{
|
|
|
182
257
|
model: string;
|
|
183
258
|
name: string;
|
|
184
259
|
provider?: string | undefined;
|
|
185
|
-
apiKey?: string | undefined;
|
|
186
260
|
baseUrl?: string | undefined;
|
|
261
|
+
apiKey?: string | undefined;
|
|
187
262
|
}, {
|
|
188
263
|
model: string;
|
|
189
264
|
name: string;
|
|
190
265
|
provider?: string | undefined;
|
|
191
|
-
apiKey?: string | undefined;
|
|
192
266
|
baseUrl?: string | undefined;
|
|
267
|
+
apiKey?: string | undefined;
|
|
193
268
|
}>]>, "many">>;
|
|
194
269
|
}, "strip", z.ZodTypeAny, {
|
|
195
270
|
participants: (string | {
|
|
196
271
|
model: string;
|
|
197
272
|
name: string;
|
|
198
273
|
provider?: string | undefined;
|
|
199
|
-
apiKey?: string | undefined;
|
|
200
274
|
baseUrl?: string | undefined;
|
|
275
|
+
apiKey?: string | undefined;
|
|
201
276
|
})[];
|
|
202
277
|
}, {
|
|
203
278
|
participants?: (string | {
|
|
204
279
|
model: string;
|
|
205
280
|
name: string;
|
|
206
281
|
provider?: string | undefined;
|
|
207
|
-
apiKey?: string | undefined;
|
|
208
282
|
baseUrl?: string | undefined;
|
|
283
|
+
apiKey?: string | undefined;
|
|
209
284
|
})[] | undefined;
|
|
210
285
|
}>>;
|
|
211
286
|
search: z.ZodDefault<z.ZodObject<{
|
|
@@ -214,12 +289,12 @@ export declare const SettingsSchema: z.ZodObject<{
|
|
|
214
289
|
baseUrl: z.ZodOptional<z.ZodString>;
|
|
215
290
|
}, "strip", z.ZodTypeAny, {
|
|
216
291
|
provider: "serper" | "tavily" | "searxng";
|
|
217
|
-
apiKey?: string | undefined;
|
|
218
292
|
baseUrl?: string | undefined;
|
|
293
|
+
apiKey?: string | undefined;
|
|
219
294
|
}, {
|
|
220
295
|
provider?: "serper" | "tavily" | "searxng" | undefined;
|
|
221
|
-
apiKey?: string | undefined;
|
|
222
296
|
baseUrl?: string | undefined;
|
|
297
|
+
apiKey?: string | undefined;
|
|
223
298
|
}>>;
|
|
224
299
|
output: z.ZodDefault<z.ZodObject<{
|
|
225
300
|
format: z.ZodDefault<z.ZodEnum<["text", "json", "jsonl", "stream-json"]>>;
|
|
@@ -248,6 +323,22 @@ export declare const SettingsSchema: z.ZodObject<{
|
|
|
248
323
|
customSystemPrompt?: string | undefined;
|
|
249
324
|
appendSystemPrompt?: string | undefined;
|
|
250
325
|
}>>;
|
|
326
|
+
/**
|
|
327
|
+
* Primary source of truth for the active model is settings.activeKey
|
|
328
|
+
* (points at models[].key). settings.model is a derived mirror of that
|
|
329
|
+
* entry kept in sync for legacy boot paths (cli/main.ts, repl.ts, etc.)
|
|
330
|
+
* which read provider/name/apiKey/baseUrl directly. Writers must update
|
|
331
|
+
* both — appendOnboardingResult does this in one shot.
|
|
332
|
+
*/
|
|
333
|
+
activeKey: z.ZodOptional<z.ZodString>;
|
|
334
|
+
/**
|
|
335
|
+
* Toggle background auto-update. When true (default), code-shell checks
|
|
336
|
+
* npm for newer versions and — if the npm global prefix is writable —
|
|
337
|
+
* installs the update in the background on process exit so the next
|
|
338
|
+
* launch picks it up.
|
|
339
|
+
* Can also be disabled via env var `DISABLE_AUTOUPDATER=1`.
|
|
340
|
+
*/
|
|
341
|
+
autoUpdates: z.ZodDefault<z.ZodBoolean>;
|
|
251
342
|
model: z.ZodDefault<z.ZodObject<{
|
|
252
343
|
provider: z.ZodDefault<z.ZodString>;
|
|
253
344
|
name: z.ZodDefault<z.ZodString>;
|
|
@@ -266,35 +357,94 @@ export declare const SettingsSchema: z.ZodObject<{
|
|
|
266
357
|
provider?: string | undefined;
|
|
267
358
|
name?: string | undefined;
|
|
268
359
|
maxTokens?: number | undefined;
|
|
269
|
-
apiKey?: string | undefined;
|
|
270
360
|
baseUrl?: string | undefined;
|
|
361
|
+
apiKey?: string | undefined;
|
|
271
362
|
temperature?: number | undefined;
|
|
272
363
|
}>>;
|
|
273
|
-
|
|
364
|
+
providers: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
274
365
|
key: z.ZodString;
|
|
275
366
|
label: z.ZodOptional<z.ZodString>;
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
baseUrl: z.ZodOptional<z.ZodString>;
|
|
367
|
+
kind: z.ZodEnum<["openai", "anthropic", "deepseek", "xai", "mistral", "groq", "google", "openrouter", "ollama", "custom"]>;
|
|
368
|
+
baseUrl: z.ZodString;
|
|
279
369
|
apiKey: z.ZodOptional<z.ZodString>;
|
|
370
|
+
protocol: z.ZodOptional<z.ZodEnum<["openai-compat", "anthropic-style"]>>;
|
|
371
|
+
modelsPath: z.ZodOptional<z.ZodString>;
|
|
372
|
+
}, "strip", z.ZodTypeAny, {
|
|
373
|
+
kind: "anthropic" | "openai" | "openrouter" | "deepseek" | "ollama" | "mistral" | "custom" | "xai" | "groq" | "google";
|
|
374
|
+
key: string;
|
|
375
|
+
baseUrl: string;
|
|
376
|
+
label?: string | undefined;
|
|
377
|
+
apiKey?: string | undefined;
|
|
378
|
+
protocol?: "openai-compat" | "anthropic-style" | undefined;
|
|
379
|
+
modelsPath?: string | undefined;
|
|
380
|
+
}, {
|
|
381
|
+
kind: "anthropic" | "openai" | "openrouter" | "deepseek" | "ollama" | "mistral" | "custom" | "xai" | "groq" | "google";
|
|
382
|
+
key: string;
|
|
383
|
+
baseUrl: string;
|
|
384
|
+
label?: string | undefined;
|
|
385
|
+
apiKey?: string | undefined;
|
|
386
|
+
protocol?: "openai-compat" | "anthropic-style" | undefined;
|
|
387
|
+
modelsPath?: string | undefined;
|
|
388
|
+
}>, "many">>;
|
|
389
|
+
models: z.ZodDefault<z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
390
|
+
key: z.ZodString;
|
|
391
|
+
label: z.ZodOptional<z.ZodString>;
|
|
392
|
+
providerKey: z.ZodOptional<z.ZodString>;
|
|
393
|
+
model: z.ZodString;
|
|
280
394
|
maxOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
281
395
|
maxContextTokens: z.ZodOptional<z.ZodNumber>;
|
|
396
|
+
/**
|
|
397
|
+
* Which LLM client to use ("openai" or "anthropic"). New name —
|
|
398
|
+
* the legacy field is `provider`, which we still accept and
|
|
399
|
+
* fold into `protocol` below so old configs keep working.
|
|
400
|
+
* NOT the brand/vendor — that's providerKey above.
|
|
401
|
+
*/
|
|
402
|
+
protocol: z.ZodOptional<z.ZodString>;
|
|
403
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
404
|
+
baseUrl: z.ZodOptional<z.ZodString>;
|
|
405
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
282
406
|
}, "strip", z.ZodTypeAny, {
|
|
283
|
-
provider: string;
|
|
284
407
|
model: string;
|
|
285
408
|
key: string;
|
|
286
|
-
|
|
409
|
+
provider?: string | undefined;
|
|
287
410
|
baseUrl?: string | undefined;
|
|
288
411
|
label?: string | undefined;
|
|
412
|
+
apiKey?: string | undefined;
|
|
413
|
+
protocol?: string | undefined;
|
|
414
|
+
providerKey?: string | undefined;
|
|
289
415
|
maxOutputTokens?: number | undefined;
|
|
290
416
|
maxContextTokens?: number | undefined;
|
|
291
417
|
}, {
|
|
292
|
-
provider: string;
|
|
293
418
|
model: string;
|
|
294
419
|
key: string;
|
|
420
|
+
provider?: string | undefined;
|
|
421
|
+
baseUrl?: string | undefined;
|
|
422
|
+
label?: string | undefined;
|
|
423
|
+
apiKey?: string | undefined;
|
|
424
|
+
protocol?: string | undefined;
|
|
425
|
+
providerKey?: string | undefined;
|
|
426
|
+
maxOutputTokens?: number | undefined;
|
|
427
|
+
maxContextTokens?: number | undefined;
|
|
428
|
+
}>, {
|
|
429
|
+
protocol: string | undefined;
|
|
430
|
+
provider: string | undefined;
|
|
431
|
+
model: string;
|
|
432
|
+
key: string;
|
|
433
|
+
baseUrl?: string | undefined;
|
|
434
|
+
label?: string | undefined;
|
|
295
435
|
apiKey?: string | undefined;
|
|
436
|
+
providerKey?: string | undefined;
|
|
437
|
+
maxOutputTokens?: number | undefined;
|
|
438
|
+
maxContextTokens?: number | undefined;
|
|
439
|
+
}, {
|
|
440
|
+
model: string;
|
|
441
|
+
key: string;
|
|
442
|
+
provider?: string | undefined;
|
|
296
443
|
baseUrl?: string | undefined;
|
|
297
444
|
label?: string | undefined;
|
|
445
|
+
apiKey?: string | undefined;
|
|
446
|
+
protocol?: string | undefined;
|
|
447
|
+
providerKey?: string | undefined;
|
|
298
448
|
maxOutputTokens?: number | undefined;
|
|
299
449
|
maxContextTokens?: number | undefined;
|
|
300
450
|
}>, "many">>;
|
|
@@ -408,30 +558,30 @@ export declare const SettingsSchema: z.ZodObject<{
|
|
|
408
558
|
model: string;
|
|
409
559
|
name: string;
|
|
410
560
|
provider?: string | undefined;
|
|
411
|
-
apiKey?: string | undefined;
|
|
412
561
|
baseUrl?: string | undefined;
|
|
562
|
+
apiKey?: string | undefined;
|
|
413
563
|
}, {
|
|
414
564
|
model: string;
|
|
415
565
|
name: string;
|
|
416
566
|
provider?: string | undefined;
|
|
417
|
-
apiKey?: string | undefined;
|
|
418
567
|
baseUrl?: string | undefined;
|
|
568
|
+
apiKey?: string | undefined;
|
|
419
569
|
}>]>, "many">>;
|
|
420
570
|
}, "strip", z.ZodTypeAny, {
|
|
421
571
|
participants: (string | {
|
|
422
572
|
model: string;
|
|
423
573
|
name: string;
|
|
424
574
|
provider?: string | undefined;
|
|
425
|
-
apiKey?: string | undefined;
|
|
426
575
|
baseUrl?: string | undefined;
|
|
576
|
+
apiKey?: string | undefined;
|
|
427
577
|
})[];
|
|
428
578
|
}, {
|
|
429
579
|
participants?: (string | {
|
|
430
580
|
model: string;
|
|
431
581
|
name: string;
|
|
432
582
|
provider?: string | undefined;
|
|
433
|
-
apiKey?: string | undefined;
|
|
434
583
|
baseUrl?: string | undefined;
|
|
584
|
+
apiKey?: string | undefined;
|
|
435
585
|
})[] | undefined;
|
|
436
586
|
}>>;
|
|
437
587
|
search: z.ZodDefault<z.ZodObject<{
|
|
@@ -440,12 +590,12 @@ export declare const SettingsSchema: z.ZodObject<{
|
|
|
440
590
|
baseUrl: z.ZodOptional<z.ZodString>;
|
|
441
591
|
}, "strip", z.ZodTypeAny, {
|
|
442
592
|
provider: "serper" | "tavily" | "searxng";
|
|
443
|
-
apiKey?: string | undefined;
|
|
444
593
|
baseUrl?: string | undefined;
|
|
594
|
+
apiKey?: string | undefined;
|
|
445
595
|
}, {
|
|
446
596
|
provider?: "serper" | "tavily" | "searxng" | undefined;
|
|
447
|
-
apiKey?: string | undefined;
|
|
448
597
|
baseUrl?: string | undefined;
|
|
598
|
+
apiKey?: string | undefined;
|
|
449
599
|
}>>;
|
|
450
600
|
output: z.ZodDefault<z.ZodObject<{
|
|
451
601
|
format: z.ZodDefault<z.ZodEnum<["text", "json", "jsonl", "stream-json"]>>;
|
|
@@ -474,6 +624,22 @@ export declare const SettingsSchema: z.ZodObject<{
|
|
|
474
624
|
customSystemPrompt?: string | undefined;
|
|
475
625
|
appendSystemPrompt?: string | undefined;
|
|
476
626
|
}>>;
|
|
627
|
+
/**
|
|
628
|
+
* Primary source of truth for the active model is settings.activeKey
|
|
629
|
+
* (points at models[].key). settings.model is a derived mirror of that
|
|
630
|
+
* entry kept in sync for legacy boot paths (cli/main.ts, repl.ts, etc.)
|
|
631
|
+
* which read provider/name/apiKey/baseUrl directly. Writers must update
|
|
632
|
+
* both — appendOnboardingResult does this in one shot.
|
|
633
|
+
*/
|
|
634
|
+
activeKey: z.ZodOptional<z.ZodString>;
|
|
635
|
+
/**
|
|
636
|
+
* Toggle background auto-update. When true (default), code-shell checks
|
|
637
|
+
* npm for newer versions and — if the npm global prefix is writable —
|
|
638
|
+
* installs the update in the background on process exit so the next
|
|
639
|
+
* launch picks it up.
|
|
640
|
+
* Can also be disabled via env var `DISABLE_AUTOUPDATER=1`.
|
|
641
|
+
*/
|
|
642
|
+
autoUpdates: z.ZodDefault<z.ZodBoolean>;
|
|
477
643
|
model: z.ZodDefault<z.ZodObject<{
|
|
478
644
|
provider: z.ZodDefault<z.ZodString>;
|
|
479
645
|
name: z.ZodDefault<z.ZodString>;
|
|
@@ -492,35 +658,94 @@ export declare const SettingsSchema: z.ZodObject<{
|
|
|
492
658
|
provider?: string | undefined;
|
|
493
659
|
name?: string | undefined;
|
|
494
660
|
maxTokens?: number | undefined;
|
|
495
|
-
apiKey?: string | undefined;
|
|
496
661
|
baseUrl?: string | undefined;
|
|
662
|
+
apiKey?: string | undefined;
|
|
497
663
|
temperature?: number | undefined;
|
|
498
664
|
}>>;
|
|
499
|
-
|
|
665
|
+
providers: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
500
666
|
key: z.ZodString;
|
|
501
667
|
label: z.ZodOptional<z.ZodString>;
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
baseUrl: z.ZodOptional<z.ZodString>;
|
|
668
|
+
kind: z.ZodEnum<["openai", "anthropic", "deepseek", "xai", "mistral", "groq", "google", "openrouter", "ollama", "custom"]>;
|
|
669
|
+
baseUrl: z.ZodString;
|
|
505
670
|
apiKey: z.ZodOptional<z.ZodString>;
|
|
671
|
+
protocol: z.ZodOptional<z.ZodEnum<["openai-compat", "anthropic-style"]>>;
|
|
672
|
+
modelsPath: z.ZodOptional<z.ZodString>;
|
|
673
|
+
}, "strip", z.ZodTypeAny, {
|
|
674
|
+
kind: "anthropic" | "openai" | "openrouter" | "deepseek" | "ollama" | "mistral" | "custom" | "xai" | "groq" | "google";
|
|
675
|
+
key: string;
|
|
676
|
+
baseUrl: string;
|
|
677
|
+
label?: string | undefined;
|
|
678
|
+
apiKey?: string | undefined;
|
|
679
|
+
protocol?: "openai-compat" | "anthropic-style" | undefined;
|
|
680
|
+
modelsPath?: string | undefined;
|
|
681
|
+
}, {
|
|
682
|
+
kind: "anthropic" | "openai" | "openrouter" | "deepseek" | "ollama" | "mistral" | "custom" | "xai" | "groq" | "google";
|
|
683
|
+
key: string;
|
|
684
|
+
baseUrl: string;
|
|
685
|
+
label?: string | undefined;
|
|
686
|
+
apiKey?: string | undefined;
|
|
687
|
+
protocol?: "openai-compat" | "anthropic-style" | undefined;
|
|
688
|
+
modelsPath?: string | undefined;
|
|
689
|
+
}>, "many">>;
|
|
690
|
+
models: z.ZodDefault<z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
691
|
+
key: z.ZodString;
|
|
692
|
+
label: z.ZodOptional<z.ZodString>;
|
|
693
|
+
providerKey: z.ZodOptional<z.ZodString>;
|
|
694
|
+
model: z.ZodString;
|
|
506
695
|
maxOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
507
696
|
maxContextTokens: z.ZodOptional<z.ZodNumber>;
|
|
697
|
+
/**
|
|
698
|
+
* Which LLM client to use ("openai" or "anthropic"). New name —
|
|
699
|
+
* the legacy field is `provider`, which we still accept and
|
|
700
|
+
* fold into `protocol` below so old configs keep working.
|
|
701
|
+
* NOT the brand/vendor — that's providerKey above.
|
|
702
|
+
*/
|
|
703
|
+
protocol: z.ZodOptional<z.ZodString>;
|
|
704
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
705
|
+
baseUrl: z.ZodOptional<z.ZodString>;
|
|
706
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
508
707
|
}, "strip", z.ZodTypeAny, {
|
|
509
|
-
provider: string;
|
|
510
708
|
model: string;
|
|
511
709
|
key: string;
|
|
512
|
-
|
|
710
|
+
provider?: string | undefined;
|
|
513
711
|
baseUrl?: string | undefined;
|
|
514
712
|
label?: string | undefined;
|
|
713
|
+
apiKey?: string | undefined;
|
|
714
|
+
protocol?: string | undefined;
|
|
715
|
+
providerKey?: string | undefined;
|
|
515
716
|
maxOutputTokens?: number | undefined;
|
|
516
717
|
maxContextTokens?: number | undefined;
|
|
517
718
|
}, {
|
|
518
|
-
provider: string;
|
|
519
719
|
model: string;
|
|
520
720
|
key: string;
|
|
721
|
+
provider?: string | undefined;
|
|
722
|
+
baseUrl?: string | undefined;
|
|
723
|
+
label?: string | undefined;
|
|
724
|
+
apiKey?: string | undefined;
|
|
725
|
+
protocol?: string | undefined;
|
|
726
|
+
providerKey?: string | undefined;
|
|
727
|
+
maxOutputTokens?: number | undefined;
|
|
728
|
+
maxContextTokens?: number | undefined;
|
|
729
|
+
}>, {
|
|
730
|
+
protocol: string | undefined;
|
|
731
|
+
provider: string | undefined;
|
|
732
|
+
model: string;
|
|
733
|
+
key: string;
|
|
734
|
+
baseUrl?: string | undefined;
|
|
735
|
+
label?: string | undefined;
|
|
521
736
|
apiKey?: string | undefined;
|
|
737
|
+
providerKey?: string | undefined;
|
|
738
|
+
maxOutputTokens?: number | undefined;
|
|
739
|
+
maxContextTokens?: number | undefined;
|
|
740
|
+
}, {
|
|
741
|
+
model: string;
|
|
742
|
+
key: string;
|
|
743
|
+
provider?: string | undefined;
|
|
522
744
|
baseUrl?: string | undefined;
|
|
523
745
|
label?: string | undefined;
|
|
746
|
+
apiKey?: string | undefined;
|
|
747
|
+
protocol?: string | undefined;
|
|
748
|
+
providerKey?: string | undefined;
|
|
524
749
|
maxOutputTokens?: number | undefined;
|
|
525
750
|
maxContextTokens?: number | undefined;
|
|
526
751
|
}>, "many">>;
|
|
@@ -634,30 +859,30 @@ export declare const SettingsSchema: z.ZodObject<{
|
|
|
634
859
|
model: string;
|
|
635
860
|
name: string;
|
|
636
861
|
provider?: string | undefined;
|
|
637
|
-
apiKey?: string | undefined;
|
|
638
862
|
baseUrl?: string | undefined;
|
|
863
|
+
apiKey?: string | undefined;
|
|
639
864
|
}, {
|
|
640
865
|
model: string;
|
|
641
866
|
name: string;
|
|
642
867
|
provider?: string | undefined;
|
|
643
|
-
apiKey?: string | undefined;
|
|
644
868
|
baseUrl?: string | undefined;
|
|
869
|
+
apiKey?: string | undefined;
|
|
645
870
|
}>]>, "many">>;
|
|
646
871
|
}, "strip", z.ZodTypeAny, {
|
|
647
872
|
participants: (string | {
|
|
648
873
|
model: string;
|
|
649
874
|
name: string;
|
|
650
875
|
provider?: string | undefined;
|
|
651
|
-
apiKey?: string | undefined;
|
|
652
876
|
baseUrl?: string | undefined;
|
|
877
|
+
apiKey?: string | undefined;
|
|
653
878
|
})[];
|
|
654
879
|
}, {
|
|
655
880
|
participants?: (string | {
|
|
656
881
|
model: string;
|
|
657
882
|
name: string;
|
|
658
883
|
provider?: string | undefined;
|
|
659
|
-
apiKey?: string | undefined;
|
|
660
884
|
baseUrl?: string | undefined;
|
|
885
|
+
apiKey?: string | undefined;
|
|
661
886
|
})[] | undefined;
|
|
662
887
|
}>>;
|
|
663
888
|
search: z.ZodDefault<z.ZodObject<{
|
|
@@ -666,12 +891,12 @@ export declare const SettingsSchema: z.ZodObject<{
|
|
|
666
891
|
baseUrl: z.ZodOptional<z.ZodString>;
|
|
667
892
|
}, "strip", z.ZodTypeAny, {
|
|
668
893
|
provider: "serper" | "tavily" | "searxng";
|
|
669
|
-
apiKey?: string | undefined;
|
|
670
894
|
baseUrl?: string | undefined;
|
|
895
|
+
apiKey?: string | undefined;
|
|
671
896
|
}, {
|
|
672
897
|
provider?: "serper" | "tavily" | "searxng" | undefined;
|
|
673
|
-
apiKey?: string | undefined;
|
|
674
898
|
baseUrl?: string | undefined;
|
|
899
|
+
apiKey?: string | undefined;
|
|
675
900
|
}>>;
|
|
676
901
|
output: z.ZodDefault<z.ZodObject<{
|
|
677
902
|
format: z.ZodDefault<z.ZodEnum<["text", "json", "jsonl", "stream-json"]>>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkIK4EWJBPcjs = require('./chunk-IK4EWJBP.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkKS3RYAYLcjs = require('./chunk-KS3RYAYL.cjs');
|
|
7
7
|
|
|
8
8
|
// src/engine/tool-summary.ts
|
|
9
|
-
|
|
9
|
+
_chunkKS3RYAYLcjs.init_cjs_shims.call(void 0, );
|
|
10
10
|
var SUMMARY_SYSTEM_PROMPT = 'Generate a very brief (under 40 chars) summary of what these tools did. Use past tense, commit-subject style. Examples: "Read 3 config files", "Fixed import in auth.ts", "Searched for API endpoints". Respond with ONLY the summary text, nothing else.';
|
|
11
11
|
async function generateToolUseSummary(toolCalls, results, summarize) {
|
|
12
12
|
if (toolCalls.length === 0) return null;
|
|
@@ -22,7 +22,7 @@ async function generateToolUseSummary(toolCalls, results, summarize) {
|
|
|
22
22
|
const summary = await summarize(SUMMARY_SYSTEM_PROMPT, parts.join("\n"));
|
|
23
23
|
return _optionalChain([summary, 'optionalAccess', _3 => _3.trim, 'call', _4 => _4()]) || null;
|
|
24
24
|
} catch (err) {
|
|
25
|
-
|
|
25
|
+
_chunkIK4EWJBPcjs.logger.warn("tool_summary.failed", { error: err.message });
|
|
26
26
|
return null;
|
|
27
27
|
}
|
|
28
28
|
}
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Built-in AskUserQuestion tool — ask the user a question during execution.
|
|
3
3
|
*
|
|
4
|
+
* Two modes:
|
|
5
|
+
* - Plain text (no `options`): user types a free-text answer.
|
|
6
|
+
* - Multiple choice (`options` provided): user picks from a list. An
|
|
7
|
+
* implicit "Other..." entry is appended by the UI for free text.
|
|
8
|
+
*
|
|
4
9
|
* The actual prompt-the-user implementation is provided per-Engine via
|
|
5
10
|
* ToolContext.askUser. Headless mode (no UI wired up) leaves askUser
|
|
6
11
|
* undefined and the tool reports back asking the LLM to assume.
|
|
7
12
|
*/
|
|
8
13
|
import type { ToolDefinition } from "../../types.js";
|
|
9
14
|
import type { ToolContext } from "../context.js";
|
|
15
|
+
export type { AskUserFn, AskUserOptions, AskUserChoice } from "../context.js";
|
|
10
16
|
export declare const askUserToolDef: ToolDefinition;
|
|
11
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Tool execution. Forwards to ToolContext.askUser.
|
|
19
|
+
*/
|
|
12
20
|
export declare function askUserTool(args: Record<string, unknown>, ctx?: ToolContext): Promise<string>;
|