@cjhyy/code-shell 0.1.7 → 0.3.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 +108 -0
- package/README.md +35 -2
- package/dist/anthropic-DJXVKFMJ.js +1 -0
- package/dist/arena/index.js +1 -1
- package/dist/arena-MRBATZFD.js +3 -0
- package/dist/chunk-2OD6VR4N.js +2 -0
- package/dist/{chunk-RP26WO4R.js → chunk-5QIVXFCT.js} +1 -1
- package/dist/{chunk-NFH3UQ3E.js → chunk-AFMP73YP.js} +1 -1
- package/dist/{chunk-XDOWC7EG.js → chunk-D3TVASD2.js} +2 -2
- package/dist/chunk-DI26OUIU.js +2 -0
- package/dist/chunk-FZXY554D.js +2 -0
- package/dist/chunk-GGVAOPI7.js +1 -0
- package/dist/chunk-GKAQH2DG.js +2 -0
- package/dist/chunk-GYNO4R7R.js +2 -0
- package/dist/{chunk-Q4O2HGWS.js → chunk-K4HILJ6G.js} +3 -3
- package/dist/chunk-M7VU4YVY.js +49 -0
- package/dist/chunk-MLCTC53I.js +1 -0
- package/dist/{chunk-HIJ2XXGX.js → chunk-OWBYLMDD.js} +1 -1
- package/dist/chunk-SKIX2M5Z.js +4 -0
- package/dist/chunk-SV7H4FKT.js +3 -0
- package/dist/{chunk-Y2NS6HPO.js → chunk-WONQHE4P.js} +41 -41
- package/dist/{chunk-WOP6MJKW.js → chunk-X2S7ASQ2.js} +1 -1
- package/dist/chunk-Z5HKHAO7.js +336 -0
- package/dist/cli/commands/builtin/plugin-commands-registration.d.ts +12 -0
- package/dist/cli/commands/builtin/plugin-handler.d.ts +6 -0
- package/dist/cli/commands/registry.d.ts +9 -2
- package/dist/cli/main.js +140 -124
- package/dist/cli/onboarding.d.ts +7 -2
- package/dist/client-base-GSFXPP2Y.js +1 -0
- package/dist/compaction-L3Y6NG4N.js +1 -0
- package/dist/context/compaction.d.ts +2 -1
- package/dist/data/static-catalogs.d.ts +25 -0
- package/dist/devtools-FBX4HVVY.js +1 -0
- package/dist/engine/engine.d.ts +45 -0
- package/dist/engine/turn-loop.d.ts +45 -0
- package/dist/hooks/events.d.ts +84 -5
- package/dist/hooks/inject.d.ts +19 -0
- package/dist/hooks/shell-runner.d.ts +45 -0
- package/dist/index.d.ts +4 -3
- package/dist/index.js +1 -1
- package/dist/llm/api-key-sanitize.d.ts +22 -0
- package/dist/llm/capabilities/index.d.ts +20 -0
- package/dist/llm/capabilities/rules.d.ts +26 -0
- package/dist/llm/capabilities/types.d.ts +108 -0
- package/dist/llm/model-pool.d.ts +7 -0
- package/dist/llm/provider-catalog.d.ts +2 -0
- package/dist/llm/provider-kinds.d.ts +1 -1
- package/dist/llm/providers/openai.d.ts +45 -0
- package/dist/llm/retry.d.ts +12 -0
- package/dist/llm/stream-watchdog.d.ts +42 -0
- package/dist/llm/types.d.ts +8 -0
- package/dist/logging/logger.d.ts +24 -2
- package/dist/logging/session-recorder.d.ts +16 -3
- package/dist/manager-4XKLZHKE.js +1 -0
- package/dist/mcp-manager-3JGHEJO3.js +1 -0
- package/dist/model-fetcher-X5W5EASG.js +1 -0
- package/dist/openai-OQ6LLN5J.js +1 -0
- package/dist/{openrouter-models-AM6M52D6.js → openrouter-models-ZT4R2AE3.js} +1 -1
- package/dist/openrouter-sync-ARMVWY7S.js +1 -0
- package/dist/plugin-handler-GJISMH5Q.js +11 -0
- package/dist/plugins/gitOps.d.ts +23 -0
- package/dist/plugins/installedPlugins.d.ts +15 -0
- package/dist/plugins/knownMarketplaces.d.ts +10 -0
- package/dist/plugins/loadPluginHooks.d.ts +52 -0
- package/dist/plugins/marketplaceManager.d.ts +49 -0
- package/dist/plugins/parseMarketplaceInput.d.ts +16 -0
- package/dist/plugins/pluginCommandHook.d.ts +54 -0
- package/dist/plugins/pluginCommandsLoader.d.ts +25 -0
- package/dist/plugins/pluginInstaller.d.ts +36 -0
- package/dist/plugins/schemas.d.ts +9 -0
- package/dist/plugins/types.d.ts +73 -2
- package/dist/plugins/varRewrite.d.ts +42 -0
- package/dist/product/index.js +1 -1
- package/dist/protocol/client.d.ts +1 -1
- package/dist/protocol/helpers.d.ts +42 -0
- package/dist/render/clearTerminal.d.ts +9 -3
- package/dist/render/components/App.d.ts +1 -0
- package/dist/render/components/Static.d.ts +23 -0
- package/dist/render/devtools.d.ts +8 -4
- package/dist/render/dom.d.ts +2 -1
- package/dist/render/frame.d.ts +1 -0
- package/dist/render/index.d.ts +10 -0
- package/dist/render/ink.d.ts +24 -2
- package/dist/render/log-update.d.ts +12 -1
- package/dist/render/selection.d.ts +1 -1
- package/dist/run/index.js +1 -1
- package/dist/{seatbelt-WBYROQT6.js → seatbelt-L54CNI2Y.js} +5 -5
- package/dist/services/index.d.ts +1 -0
- package/dist/services/memory-orchestrator.d.ts +39 -0
- package/dist/settings/schema.d.ts +168 -21
- package/dist/skills/frontmatter.d.ts +13 -0
- package/dist/skills/index.d.ts +4 -4
- package/dist/skills/scanner.d.ts +11 -21
- package/dist/tool-summary-HJX6RHG4.js +2 -0
- package/dist/tool-system/builtin/agent-notifications.d.ts +55 -0
- package/dist/tool-system/builtin/agent-registry.d.ts +35 -4
- package/dist/tool-system/builtin/agent-transcript-translator.d.ts +22 -0
- package/dist/tool-system/builtin/skill-prompt.d.ts +7 -0
- package/dist/tool-system/builtin/skill.d.ts +3 -1
- package/dist/tool-system/context.d.ts +23 -0
- package/dist/tool-system/executor.d.ts +5 -1
- package/dist/tool-system/permission.d.ts +1 -1
- package/dist/tool-system/sandbox/index.d.ts +7 -0
- package/dist/tool-system/task-guard.d.ts +30 -0
- package/dist/types.d.ts +48 -0
- package/dist/ui/components/AgentBlock.d.ts +5 -2
- package/dist/ui/components/AgentDock.d.ts +36 -0
- package/dist/ui/components/CommandInput.d.ts +12 -1
- package/dist/ui/components/MessageRow.d.ts +54 -0
- package/dist/ui/components/SpinnerWithVerb.d.ts +7 -1
- package/dist/ui/components/StatusLine.d.ts +5 -1
- package/dist/ui/components/TextInput.d.ts +9 -1
- package/dist/ui/components/VirtualMessageList.d.ts +30 -11
- package/dist/ui/dev-seed.d.ts +1 -0
- package/dist/ui/fullscreen-mode.d.ts +9 -0
- package/dist/ui/hooks/useVirtualScroll.d.ts +101 -0
- package/dist/ui/perf-probes.d.ts +22 -0
- package/dist/ui/query-guard.d.ts +35 -0
- package/dist/ui/slice-anchor.d.ts +44 -0
- package/dist/ui/store.d.ts +26 -1
- package/package.json +5 -3
- package/dist/anthropic-UBSB5AQH.js +0 -1
- package/dist/arena-OW55ZCHT.js +0 -3
- package/dist/chunk-2NS3JMNK.js +0 -1
- package/dist/chunk-B7K2OWKC.js +0 -2
- package/dist/chunk-EWWK56K6.js +0 -2
- package/dist/chunk-KCXSARAA.js +0 -1
- package/dist/chunk-NMBYBGC7.js +0 -250
- package/dist/chunk-NVAZJ5XS.js +0 -2
- package/dist/chunk-PGANL6F2.js +0 -3
- package/dist/chunk-UDPUTFQT.js +0 -2
- package/dist/chunk-W47Z7MGS.js +0 -33
- package/dist/client-base-6ZZJJYDY.js +0 -1
- package/dist/compaction-ECVQVOCT.js +0 -1
- package/dist/devtools-SGDUOOM4.js +0 -1
- package/dist/manager-C3TDN6MS.js +0 -1
- package/dist/mcp-manager-OP4XYV53.js +0 -1
- package/dist/model-fetcher-BJ64META.js +0 -1
- package/dist/openai-KEWQ54TM.js +0 -1
- package/dist/openrouter-sync-5JNBL3Z6.js +0 -1
- package/dist/plugins/loader.d.ts +0 -72
- package/dist/skills/matcher.d.ts +0 -21
- package/dist/tool-summary-5UE62VU4.js +0 -2
- package/skills-builtin/codeshell-help.md +0 -135
|
@@ -48,38 +48,47 @@ export declare const SettingsSchema: z.ZodObject<{
|
|
|
48
48
|
}, "strip", z.ZodTypeAny, {
|
|
49
49
|
provider: string;
|
|
50
50
|
name: string;
|
|
51
|
+
temperature: number;
|
|
51
52
|
maxTokens: number;
|
|
52
53
|
baseUrl: string;
|
|
53
|
-
temperature: number;
|
|
54
54
|
apiKey?: string | undefined;
|
|
55
55
|
}, {
|
|
56
56
|
provider?: string | undefined;
|
|
57
57
|
name?: string | undefined;
|
|
58
|
+
temperature?: number | undefined;
|
|
58
59
|
maxTokens?: number | undefined;
|
|
59
60
|
baseUrl?: string | undefined;
|
|
60
61
|
apiKey?: string | undefined;
|
|
61
|
-
temperature?: number | undefined;
|
|
62
62
|
}>>;
|
|
63
63
|
providers: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
64
64
|
key: z.ZodString;
|
|
65
65
|
label: z.ZodOptional<z.ZodString>;
|
|
66
|
-
kind: z.ZodEnum<["openai", "anthropic", "deepseek", "xai", "mistral", "groq", "google", "openrouter", "ollama", "custom"]>;
|
|
66
|
+
kind: z.ZodEnum<["openai", "anthropic", "deepseek", "zai", "xai", "mistral", "groq", "google", "openrouter", "ollama", "custom"]>;
|
|
67
67
|
baseUrl: z.ZodString;
|
|
68
68
|
apiKey: z.ZodOptional<z.ZodString>;
|
|
69
69
|
protocol: z.ZodOptional<z.ZodEnum<["openai-compat", "anthropic-style"]>>;
|
|
70
70
|
modelsPath: z.ZodOptional<z.ZodString>;
|
|
71
|
+
/**
|
|
72
|
+
* DeepSeek V4 thinking-mode default for this provider. "enabled"
|
|
73
|
+
* matches endpoint default; "disabled" makes V4 calls run in
|
|
74
|
+
* non-thinking mode (faster, cheaper). Ignored by every provider
|
|
75
|
+
* other than DeepSeek V4. Per-call overrides still win.
|
|
76
|
+
*/
|
|
77
|
+
thinking: z.ZodOptional<z.ZodEnum<["enabled", "disabled"]>>;
|
|
71
78
|
}, "strip", z.ZodTypeAny, {
|
|
72
|
-
kind: "anthropic" | "openai" | "
|
|
79
|
+
kind: "anthropic" | "openai" | "deepseek" | "zai" | "xai" | "mistral" | "groq" | "google" | "openrouter" | "ollama" | "custom";
|
|
73
80
|
key: string;
|
|
74
81
|
baseUrl: string;
|
|
82
|
+
thinking?: "enabled" | "disabled" | undefined;
|
|
75
83
|
label?: string | undefined;
|
|
76
84
|
apiKey?: string | undefined;
|
|
77
85
|
protocol?: "openai-compat" | "anthropic-style" | undefined;
|
|
78
86
|
modelsPath?: string | undefined;
|
|
79
87
|
}, {
|
|
80
|
-
kind: "anthropic" | "openai" | "
|
|
88
|
+
kind: "anthropic" | "openai" | "deepseek" | "zai" | "xai" | "mistral" | "groq" | "google" | "openrouter" | "ollama" | "custom";
|
|
81
89
|
key: string;
|
|
82
90
|
baseUrl: string;
|
|
91
|
+
thinking?: "enabled" | "disabled" | undefined;
|
|
83
92
|
label?: string | undefined;
|
|
84
93
|
apiKey?: string | undefined;
|
|
85
94
|
protocol?: "openai-compat" | "anthropic-style" | undefined;
|
|
@@ -102,10 +111,18 @@ export declare const SettingsSchema: z.ZodObject<{
|
|
|
102
111
|
provider: z.ZodOptional<z.ZodString>;
|
|
103
112
|
baseUrl: z.ZodOptional<z.ZodString>;
|
|
104
113
|
apiKey: z.ZodOptional<z.ZodString>;
|
|
114
|
+
/**
|
|
115
|
+
* Per-model thinking override. Wins over the provider-level
|
|
116
|
+
* setting (settings.providers[].thinking). Use this when
|
|
117
|
+
* different models under the same provider need different
|
|
118
|
+
* defaults — e.g. DeepSeek V4 Pro off (faster) but V4 Flash on.
|
|
119
|
+
*/
|
|
120
|
+
thinking: z.ZodOptional<z.ZodEnum<["enabled", "disabled"]>>;
|
|
105
121
|
}, "strip", z.ZodTypeAny, {
|
|
106
122
|
model: string;
|
|
107
123
|
key: string;
|
|
108
124
|
provider?: string | undefined;
|
|
125
|
+
thinking?: "enabled" | "disabled" | undefined;
|
|
109
126
|
baseUrl?: string | undefined;
|
|
110
127
|
label?: string | undefined;
|
|
111
128
|
apiKey?: string | undefined;
|
|
@@ -117,6 +134,7 @@ export declare const SettingsSchema: z.ZodObject<{
|
|
|
117
134
|
model: string;
|
|
118
135
|
key: string;
|
|
119
136
|
provider?: string | undefined;
|
|
137
|
+
thinking?: "enabled" | "disabled" | undefined;
|
|
120
138
|
baseUrl?: string | undefined;
|
|
121
139
|
label?: string | undefined;
|
|
122
140
|
apiKey?: string | undefined;
|
|
@@ -129,6 +147,7 @@ export declare const SettingsSchema: z.ZodObject<{
|
|
|
129
147
|
provider: string | undefined;
|
|
130
148
|
model: string;
|
|
131
149
|
key: string;
|
|
150
|
+
thinking?: "enabled" | "disabled" | undefined;
|
|
132
151
|
baseUrl?: string | undefined;
|
|
133
152
|
label?: string | undefined;
|
|
134
153
|
apiKey?: string | undefined;
|
|
@@ -139,6 +158,7 @@ export declare const SettingsSchema: z.ZodObject<{
|
|
|
139
158
|
model: string;
|
|
140
159
|
key: string;
|
|
141
160
|
provider?: string | undefined;
|
|
161
|
+
thinking?: "enabled" | "disabled" | undefined;
|
|
142
162
|
baseUrl?: string | undefined;
|
|
143
163
|
label?: string | undefined;
|
|
144
164
|
apiKey?: string | undefined;
|
|
@@ -166,21 +186,21 @@ export declare const SettingsSchema: z.ZodObject<{
|
|
|
166
186
|
argsPattern?: Record<string, string> | undefined;
|
|
167
187
|
}>, "many">>;
|
|
168
188
|
}, "strip", z.ZodTypeAny, {
|
|
189
|
+
defaultMode: "default" | "acceptEdits" | "dontAsk" | "bypassPermissions" | "auto" | "plan";
|
|
169
190
|
rules: {
|
|
170
191
|
tool: string;
|
|
171
192
|
decision: "allow" | "deny" | "ask";
|
|
172
193
|
reason?: string | undefined;
|
|
173
194
|
argsPattern?: Record<string, string> | undefined;
|
|
174
195
|
}[];
|
|
175
|
-
defaultMode: "default" | "acceptEdits" | "dontAsk" | "bypassPermissions" | "auto" | "plan";
|
|
176
196
|
}, {
|
|
197
|
+
defaultMode?: "default" | "acceptEdits" | "dontAsk" | "bypassPermissions" | "auto" | "plan" | undefined;
|
|
177
198
|
rules?: {
|
|
178
199
|
tool: string;
|
|
179
200
|
decision: "allow" | "deny" | "ask";
|
|
180
201
|
reason?: string | undefined;
|
|
181
202
|
argsPattern?: Record<string, string> | undefined;
|
|
182
203
|
}[] | undefined;
|
|
183
|
-
defaultMode?: "default" | "acceptEdits" | "dontAsk" | "bypassPermissions" | "auto" | "plan" | undefined;
|
|
184
204
|
}>>;
|
|
185
205
|
context: z.ZodDefault<z.ZodObject<{
|
|
186
206
|
maxTokens: z.ZodDefault<z.ZodNumber>;
|
|
@@ -325,6 +345,35 @@ export declare const SettingsSchema: z.ZodObject<{
|
|
|
325
345
|
deniedReads?: string[] | undefined;
|
|
326
346
|
network?: "allow" | "deny" | undefined;
|
|
327
347
|
}>>;
|
|
348
|
+
/**
|
|
349
|
+
* Shell-hook configuration. Each entry binds a HookEventName to a
|
|
350
|
+
* shell command; the command receives ctx JSON on stdin and returns
|
|
351
|
+
* a HookResult JSON on stdout (or exit 2 = deny with stderr as
|
|
352
|
+
* reason). See src/hooks/shell-runner.ts for the wire protocol.
|
|
353
|
+
*
|
|
354
|
+
* The event field is loose-typed here (z.string()) because adding
|
|
355
|
+
* new lifecycle events shouldn't force a schema bump; the runner
|
|
356
|
+
* silently ignores entries whose event isn't registered.
|
|
357
|
+
*/
|
|
358
|
+
hooks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
359
|
+
event: z.ZodString;
|
|
360
|
+
command: z.ZodString;
|
|
361
|
+
matcher: z.ZodOptional<z.ZodString>;
|
|
362
|
+
timeout_ms: z.ZodOptional<z.ZodNumber>;
|
|
363
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
364
|
+
}, "strip", z.ZodTypeAny, {
|
|
365
|
+
command: string;
|
|
366
|
+
event: string;
|
|
367
|
+
cwd?: string | undefined;
|
|
368
|
+
matcher?: string | undefined;
|
|
369
|
+
timeout_ms?: number | undefined;
|
|
370
|
+
}, {
|
|
371
|
+
command: string;
|
|
372
|
+
event: string;
|
|
373
|
+
cwd?: string | undefined;
|
|
374
|
+
matcher?: string | undefined;
|
|
375
|
+
timeout_ms?: number | undefined;
|
|
376
|
+
}>, "many">>;
|
|
328
377
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
329
378
|
agent: z.ZodDefault<z.ZodObject<{
|
|
330
379
|
preset: z.ZodDefault<z.ZodString>;
|
|
@@ -371,38 +420,47 @@ export declare const SettingsSchema: z.ZodObject<{
|
|
|
371
420
|
}, "strip", z.ZodTypeAny, {
|
|
372
421
|
provider: string;
|
|
373
422
|
name: string;
|
|
423
|
+
temperature: number;
|
|
374
424
|
maxTokens: number;
|
|
375
425
|
baseUrl: string;
|
|
376
|
-
temperature: number;
|
|
377
426
|
apiKey?: string | undefined;
|
|
378
427
|
}, {
|
|
379
428
|
provider?: string | undefined;
|
|
380
429
|
name?: string | undefined;
|
|
430
|
+
temperature?: number | undefined;
|
|
381
431
|
maxTokens?: number | undefined;
|
|
382
432
|
baseUrl?: string | undefined;
|
|
383
433
|
apiKey?: string | undefined;
|
|
384
|
-
temperature?: number | undefined;
|
|
385
434
|
}>>;
|
|
386
435
|
providers: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
387
436
|
key: z.ZodString;
|
|
388
437
|
label: z.ZodOptional<z.ZodString>;
|
|
389
|
-
kind: z.ZodEnum<["openai", "anthropic", "deepseek", "xai", "mistral", "groq", "google", "openrouter", "ollama", "custom"]>;
|
|
438
|
+
kind: z.ZodEnum<["openai", "anthropic", "deepseek", "zai", "xai", "mistral", "groq", "google", "openrouter", "ollama", "custom"]>;
|
|
390
439
|
baseUrl: z.ZodString;
|
|
391
440
|
apiKey: z.ZodOptional<z.ZodString>;
|
|
392
441
|
protocol: z.ZodOptional<z.ZodEnum<["openai-compat", "anthropic-style"]>>;
|
|
393
442
|
modelsPath: z.ZodOptional<z.ZodString>;
|
|
443
|
+
/**
|
|
444
|
+
* DeepSeek V4 thinking-mode default for this provider. "enabled"
|
|
445
|
+
* matches endpoint default; "disabled" makes V4 calls run in
|
|
446
|
+
* non-thinking mode (faster, cheaper). Ignored by every provider
|
|
447
|
+
* other than DeepSeek V4. Per-call overrides still win.
|
|
448
|
+
*/
|
|
449
|
+
thinking: z.ZodOptional<z.ZodEnum<["enabled", "disabled"]>>;
|
|
394
450
|
}, "strip", z.ZodTypeAny, {
|
|
395
|
-
kind: "anthropic" | "openai" | "
|
|
451
|
+
kind: "anthropic" | "openai" | "deepseek" | "zai" | "xai" | "mistral" | "groq" | "google" | "openrouter" | "ollama" | "custom";
|
|
396
452
|
key: string;
|
|
397
453
|
baseUrl: string;
|
|
454
|
+
thinking?: "enabled" | "disabled" | undefined;
|
|
398
455
|
label?: string | undefined;
|
|
399
456
|
apiKey?: string | undefined;
|
|
400
457
|
protocol?: "openai-compat" | "anthropic-style" | undefined;
|
|
401
458
|
modelsPath?: string | undefined;
|
|
402
459
|
}, {
|
|
403
|
-
kind: "anthropic" | "openai" | "
|
|
460
|
+
kind: "anthropic" | "openai" | "deepseek" | "zai" | "xai" | "mistral" | "groq" | "google" | "openrouter" | "ollama" | "custom";
|
|
404
461
|
key: string;
|
|
405
462
|
baseUrl: string;
|
|
463
|
+
thinking?: "enabled" | "disabled" | undefined;
|
|
406
464
|
label?: string | undefined;
|
|
407
465
|
apiKey?: string | undefined;
|
|
408
466
|
protocol?: "openai-compat" | "anthropic-style" | undefined;
|
|
@@ -425,10 +483,18 @@ export declare const SettingsSchema: z.ZodObject<{
|
|
|
425
483
|
provider: z.ZodOptional<z.ZodString>;
|
|
426
484
|
baseUrl: z.ZodOptional<z.ZodString>;
|
|
427
485
|
apiKey: z.ZodOptional<z.ZodString>;
|
|
486
|
+
/**
|
|
487
|
+
* Per-model thinking override. Wins over the provider-level
|
|
488
|
+
* setting (settings.providers[].thinking). Use this when
|
|
489
|
+
* different models under the same provider need different
|
|
490
|
+
* defaults — e.g. DeepSeek V4 Pro off (faster) but V4 Flash on.
|
|
491
|
+
*/
|
|
492
|
+
thinking: z.ZodOptional<z.ZodEnum<["enabled", "disabled"]>>;
|
|
428
493
|
}, "strip", z.ZodTypeAny, {
|
|
429
494
|
model: string;
|
|
430
495
|
key: string;
|
|
431
496
|
provider?: string | undefined;
|
|
497
|
+
thinking?: "enabled" | "disabled" | undefined;
|
|
432
498
|
baseUrl?: string | undefined;
|
|
433
499
|
label?: string | undefined;
|
|
434
500
|
apiKey?: string | undefined;
|
|
@@ -440,6 +506,7 @@ export declare const SettingsSchema: z.ZodObject<{
|
|
|
440
506
|
model: string;
|
|
441
507
|
key: string;
|
|
442
508
|
provider?: string | undefined;
|
|
509
|
+
thinking?: "enabled" | "disabled" | undefined;
|
|
443
510
|
baseUrl?: string | undefined;
|
|
444
511
|
label?: string | undefined;
|
|
445
512
|
apiKey?: string | undefined;
|
|
@@ -452,6 +519,7 @@ export declare const SettingsSchema: z.ZodObject<{
|
|
|
452
519
|
provider: string | undefined;
|
|
453
520
|
model: string;
|
|
454
521
|
key: string;
|
|
522
|
+
thinking?: "enabled" | "disabled" | undefined;
|
|
455
523
|
baseUrl?: string | undefined;
|
|
456
524
|
label?: string | undefined;
|
|
457
525
|
apiKey?: string | undefined;
|
|
@@ -462,6 +530,7 @@ export declare const SettingsSchema: z.ZodObject<{
|
|
|
462
530
|
model: string;
|
|
463
531
|
key: string;
|
|
464
532
|
provider?: string | undefined;
|
|
533
|
+
thinking?: "enabled" | "disabled" | undefined;
|
|
465
534
|
baseUrl?: string | undefined;
|
|
466
535
|
label?: string | undefined;
|
|
467
536
|
apiKey?: string | undefined;
|
|
@@ -489,21 +558,21 @@ export declare const SettingsSchema: z.ZodObject<{
|
|
|
489
558
|
argsPattern?: Record<string, string> | undefined;
|
|
490
559
|
}>, "many">>;
|
|
491
560
|
}, "strip", z.ZodTypeAny, {
|
|
561
|
+
defaultMode: "default" | "acceptEdits" | "dontAsk" | "bypassPermissions" | "auto" | "plan";
|
|
492
562
|
rules: {
|
|
493
563
|
tool: string;
|
|
494
564
|
decision: "allow" | "deny" | "ask";
|
|
495
565
|
reason?: string | undefined;
|
|
496
566
|
argsPattern?: Record<string, string> | undefined;
|
|
497
567
|
}[];
|
|
498
|
-
defaultMode: "default" | "acceptEdits" | "dontAsk" | "bypassPermissions" | "auto" | "plan";
|
|
499
568
|
}, {
|
|
569
|
+
defaultMode?: "default" | "acceptEdits" | "dontAsk" | "bypassPermissions" | "auto" | "plan" | undefined;
|
|
500
570
|
rules?: {
|
|
501
571
|
tool: string;
|
|
502
572
|
decision: "allow" | "deny" | "ask";
|
|
503
573
|
reason?: string | undefined;
|
|
504
574
|
argsPattern?: Record<string, string> | undefined;
|
|
505
575
|
}[] | undefined;
|
|
506
|
-
defaultMode?: "default" | "acceptEdits" | "dontAsk" | "bypassPermissions" | "auto" | "plan" | undefined;
|
|
507
576
|
}>>;
|
|
508
577
|
context: z.ZodDefault<z.ZodObject<{
|
|
509
578
|
maxTokens: z.ZodDefault<z.ZodNumber>;
|
|
@@ -648,6 +717,35 @@ export declare const SettingsSchema: z.ZodObject<{
|
|
|
648
717
|
deniedReads?: string[] | undefined;
|
|
649
718
|
network?: "allow" | "deny" | undefined;
|
|
650
719
|
}>>;
|
|
720
|
+
/**
|
|
721
|
+
* Shell-hook configuration. Each entry binds a HookEventName to a
|
|
722
|
+
* shell command; the command receives ctx JSON on stdin and returns
|
|
723
|
+
* a HookResult JSON on stdout (or exit 2 = deny with stderr as
|
|
724
|
+
* reason). See src/hooks/shell-runner.ts for the wire protocol.
|
|
725
|
+
*
|
|
726
|
+
* The event field is loose-typed here (z.string()) because adding
|
|
727
|
+
* new lifecycle events shouldn't force a schema bump; the runner
|
|
728
|
+
* silently ignores entries whose event isn't registered.
|
|
729
|
+
*/
|
|
730
|
+
hooks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
731
|
+
event: z.ZodString;
|
|
732
|
+
command: z.ZodString;
|
|
733
|
+
matcher: z.ZodOptional<z.ZodString>;
|
|
734
|
+
timeout_ms: z.ZodOptional<z.ZodNumber>;
|
|
735
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
736
|
+
}, "strip", z.ZodTypeAny, {
|
|
737
|
+
command: string;
|
|
738
|
+
event: string;
|
|
739
|
+
cwd?: string | undefined;
|
|
740
|
+
matcher?: string | undefined;
|
|
741
|
+
timeout_ms?: number | undefined;
|
|
742
|
+
}, {
|
|
743
|
+
command: string;
|
|
744
|
+
event: string;
|
|
745
|
+
cwd?: string | undefined;
|
|
746
|
+
matcher?: string | undefined;
|
|
747
|
+
timeout_ms?: number | undefined;
|
|
748
|
+
}>, "many">>;
|
|
651
749
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
652
750
|
agent: z.ZodDefault<z.ZodObject<{
|
|
653
751
|
preset: z.ZodDefault<z.ZodString>;
|
|
@@ -694,38 +792,47 @@ export declare const SettingsSchema: z.ZodObject<{
|
|
|
694
792
|
}, "strip", z.ZodTypeAny, {
|
|
695
793
|
provider: string;
|
|
696
794
|
name: string;
|
|
795
|
+
temperature: number;
|
|
697
796
|
maxTokens: number;
|
|
698
797
|
baseUrl: string;
|
|
699
|
-
temperature: number;
|
|
700
798
|
apiKey?: string | undefined;
|
|
701
799
|
}, {
|
|
702
800
|
provider?: string | undefined;
|
|
703
801
|
name?: string | undefined;
|
|
802
|
+
temperature?: number | undefined;
|
|
704
803
|
maxTokens?: number | undefined;
|
|
705
804
|
baseUrl?: string | undefined;
|
|
706
805
|
apiKey?: string | undefined;
|
|
707
|
-
temperature?: number | undefined;
|
|
708
806
|
}>>;
|
|
709
807
|
providers: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
710
808
|
key: z.ZodString;
|
|
711
809
|
label: z.ZodOptional<z.ZodString>;
|
|
712
|
-
kind: z.ZodEnum<["openai", "anthropic", "deepseek", "xai", "mistral", "groq", "google", "openrouter", "ollama", "custom"]>;
|
|
810
|
+
kind: z.ZodEnum<["openai", "anthropic", "deepseek", "zai", "xai", "mistral", "groq", "google", "openrouter", "ollama", "custom"]>;
|
|
713
811
|
baseUrl: z.ZodString;
|
|
714
812
|
apiKey: z.ZodOptional<z.ZodString>;
|
|
715
813
|
protocol: z.ZodOptional<z.ZodEnum<["openai-compat", "anthropic-style"]>>;
|
|
716
814
|
modelsPath: z.ZodOptional<z.ZodString>;
|
|
815
|
+
/**
|
|
816
|
+
* DeepSeek V4 thinking-mode default for this provider. "enabled"
|
|
817
|
+
* matches endpoint default; "disabled" makes V4 calls run in
|
|
818
|
+
* non-thinking mode (faster, cheaper). Ignored by every provider
|
|
819
|
+
* other than DeepSeek V4. Per-call overrides still win.
|
|
820
|
+
*/
|
|
821
|
+
thinking: z.ZodOptional<z.ZodEnum<["enabled", "disabled"]>>;
|
|
717
822
|
}, "strip", z.ZodTypeAny, {
|
|
718
|
-
kind: "anthropic" | "openai" | "
|
|
823
|
+
kind: "anthropic" | "openai" | "deepseek" | "zai" | "xai" | "mistral" | "groq" | "google" | "openrouter" | "ollama" | "custom";
|
|
719
824
|
key: string;
|
|
720
825
|
baseUrl: string;
|
|
826
|
+
thinking?: "enabled" | "disabled" | undefined;
|
|
721
827
|
label?: string | undefined;
|
|
722
828
|
apiKey?: string | undefined;
|
|
723
829
|
protocol?: "openai-compat" | "anthropic-style" | undefined;
|
|
724
830
|
modelsPath?: string | undefined;
|
|
725
831
|
}, {
|
|
726
|
-
kind: "anthropic" | "openai" | "
|
|
832
|
+
kind: "anthropic" | "openai" | "deepseek" | "zai" | "xai" | "mistral" | "groq" | "google" | "openrouter" | "ollama" | "custom";
|
|
727
833
|
key: string;
|
|
728
834
|
baseUrl: string;
|
|
835
|
+
thinking?: "enabled" | "disabled" | undefined;
|
|
729
836
|
label?: string | undefined;
|
|
730
837
|
apiKey?: string | undefined;
|
|
731
838
|
protocol?: "openai-compat" | "anthropic-style" | undefined;
|
|
@@ -748,10 +855,18 @@ export declare const SettingsSchema: z.ZodObject<{
|
|
|
748
855
|
provider: z.ZodOptional<z.ZodString>;
|
|
749
856
|
baseUrl: z.ZodOptional<z.ZodString>;
|
|
750
857
|
apiKey: z.ZodOptional<z.ZodString>;
|
|
858
|
+
/**
|
|
859
|
+
* Per-model thinking override. Wins over the provider-level
|
|
860
|
+
* setting (settings.providers[].thinking). Use this when
|
|
861
|
+
* different models under the same provider need different
|
|
862
|
+
* defaults — e.g. DeepSeek V4 Pro off (faster) but V4 Flash on.
|
|
863
|
+
*/
|
|
864
|
+
thinking: z.ZodOptional<z.ZodEnum<["enabled", "disabled"]>>;
|
|
751
865
|
}, "strip", z.ZodTypeAny, {
|
|
752
866
|
model: string;
|
|
753
867
|
key: string;
|
|
754
868
|
provider?: string | undefined;
|
|
869
|
+
thinking?: "enabled" | "disabled" | undefined;
|
|
755
870
|
baseUrl?: string | undefined;
|
|
756
871
|
label?: string | undefined;
|
|
757
872
|
apiKey?: string | undefined;
|
|
@@ -763,6 +878,7 @@ export declare const SettingsSchema: z.ZodObject<{
|
|
|
763
878
|
model: string;
|
|
764
879
|
key: string;
|
|
765
880
|
provider?: string | undefined;
|
|
881
|
+
thinking?: "enabled" | "disabled" | undefined;
|
|
766
882
|
baseUrl?: string | undefined;
|
|
767
883
|
label?: string | undefined;
|
|
768
884
|
apiKey?: string | undefined;
|
|
@@ -775,6 +891,7 @@ export declare const SettingsSchema: z.ZodObject<{
|
|
|
775
891
|
provider: string | undefined;
|
|
776
892
|
model: string;
|
|
777
893
|
key: string;
|
|
894
|
+
thinking?: "enabled" | "disabled" | undefined;
|
|
778
895
|
baseUrl?: string | undefined;
|
|
779
896
|
label?: string | undefined;
|
|
780
897
|
apiKey?: string | undefined;
|
|
@@ -785,6 +902,7 @@ export declare const SettingsSchema: z.ZodObject<{
|
|
|
785
902
|
model: string;
|
|
786
903
|
key: string;
|
|
787
904
|
provider?: string | undefined;
|
|
905
|
+
thinking?: "enabled" | "disabled" | undefined;
|
|
788
906
|
baseUrl?: string | undefined;
|
|
789
907
|
label?: string | undefined;
|
|
790
908
|
apiKey?: string | undefined;
|
|
@@ -812,21 +930,21 @@ export declare const SettingsSchema: z.ZodObject<{
|
|
|
812
930
|
argsPattern?: Record<string, string> | undefined;
|
|
813
931
|
}>, "many">>;
|
|
814
932
|
}, "strip", z.ZodTypeAny, {
|
|
933
|
+
defaultMode: "default" | "acceptEdits" | "dontAsk" | "bypassPermissions" | "auto" | "plan";
|
|
815
934
|
rules: {
|
|
816
935
|
tool: string;
|
|
817
936
|
decision: "allow" | "deny" | "ask";
|
|
818
937
|
reason?: string | undefined;
|
|
819
938
|
argsPattern?: Record<string, string> | undefined;
|
|
820
939
|
}[];
|
|
821
|
-
defaultMode: "default" | "acceptEdits" | "dontAsk" | "bypassPermissions" | "auto" | "plan";
|
|
822
940
|
}, {
|
|
941
|
+
defaultMode?: "default" | "acceptEdits" | "dontAsk" | "bypassPermissions" | "auto" | "plan" | undefined;
|
|
823
942
|
rules?: {
|
|
824
943
|
tool: string;
|
|
825
944
|
decision: "allow" | "deny" | "ask";
|
|
826
945
|
reason?: string | undefined;
|
|
827
946
|
argsPattern?: Record<string, string> | undefined;
|
|
828
947
|
}[] | undefined;
|
|
829
|
-
defaultMode?: "default" | "acceptEdits" | "dontAsk" | "bypassPermissions" | "auto" | "plan" | undefined;
|
|
830
948
|
}>>;
|
|
831
949
|
context: z.ZodDefault<z.ZodObject<{
|
|
832
950
|
maxTokens: z.ZodDefault<z.ZodNumber>;
|
|
@@ -971,6 +1089,35 @@ export declare const SettingsSchema: z.ZodObject<{
|
|
|
971
1089
|
deniedReads?: string[] | undefined;
|
|
972
1090
|
network?: "allow" | "deny" | undefined;
|
|
973
1091
|
}>>;
|
|
1092
|
+
/**
|
|
1093
|
+
* Shell-hook configuration. Each entry binds a HookEventName to a
|
|
1094
|
+
* shell command; the command receives ctx JSON on stdin and returns
|
|
1095
|
+
* a HookResult JSON on stdout (or exit 2 = deny with stderr as
|
|
1096
|
+
* reason). See src/hooks/shell-runner.ts for the wire protocol.
|
|
1097
|
+
*
|
|
1098
|
+
* The event field is loose-typed here (z.string()) because adding
|
|
1099
|
+
* new lifecycle events shouldn't force a schema bump; the runner
|
|
1100
|
+
* silently ignores entries whose event isn't registered.
|
|
1101
|
+
*/
|
|
1102
|
+
hooks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1103
|
+
event: z.ZodString;
|
|
1104
|
+
command: z.ZodString;
|
|
1105
|
+
matcher: z.ZodOptional<z.ZodString>;
|
|
1106
|
+
timeout_ms: z.ZodOptional<z.ZodNumber>;
|
|
1107
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
1108
|
+
}, "strip", z.ZodTypeAny, {
|
|
1109
|
+
command: string;
|
|
1110
|
+
event: string;
|
|
1111
|
+
cwd?: string | undefined;
|
|
1112
|
+
matcher?: string | undefined;
|
|
1113
|
+
timeout_ms?: number | undefined;
|
|
1114
|
+
}, {
|
|
1115
|
+
command: string;
|
|
1116
|
+
event: string;
|
|
1117
|
+
cwd?: string | undefined;
|
|
1118
|
+
matcher?: string | undefined;
|
|
1119
|
+
timeout_ms?: number | undefined;
|
|
1120
|
+
}>, "many">>;
|
|
974
1121
|
}, z.ZodTypeAny, "passthrough">>;
|
|
975
1122
|
export type ValidatedSettings = z.infer<typeof SettingsSchema>;
|
|
976
1123
|
export declare function validateSettings(raw: unknown): ValidatedSettings;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Frontmatter parser for SKILL.md files. Byte-compatible with Claude Code's
|
|
3
|
+
* `utils/frontmatterParser.ts` so community skill repositories can be reused
|
|
4
|
+
* without modification.
|
|
5
|
+
*/
|
|
6
|
+
export declare const FRONTMATTER_REGEX: RegExp;
|
|
7
|
+
export interface ParsedFrontmatter {
|
|
8
|
+
frontmatter: Record<string, unknown>;
|
|
9
|
+
body: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function parseFrontmatter(raw: string): ParsedFrontmatter;
|
|
12
|
+
export declare function quoteProblematicValues(frontmatterText: string): string;
|
|
13
|
+
export declare function coerceDescription(value: unknown): string;
|
package/dist/skills/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Skills
|
|
2
|
+
* Skills barrel. Phase A keeps the scanner only. Listing rendering lives in
|
|
3
|
+
* src/tool-system/builtin/skill-prompt.ts so the prompt-formatting layer can
|
|
4
|
+
* grow token-budget logic later without churn here.
|
|
3
5
|
*/
|
|
4
|
-
export { scanSkills } from "./scanner.js";
|
|
6
|
+
export { scanSkills, invalidateSkillCache } from "./scanner.js";
|
|
5
7
|
export type { SkillDefinition } from "./scanner.js";
|
|
6
|
-
export { matchSkillsByInput, matchSkillsByTool, buildSkillListing } from "./matcher.js";
|
|
7
|
-
export type { MatchResult } from "./matcher.js";
|
package/dist/skills/scanner.d.ts
CHANGED
|
@@ -1,30 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* name: skill-name
|
|
7
|
-
* description: what it does
|
|
8
|
-
* triggers:
|
|
9
|
-
* keywords: [word1, word2]
|
|
10
|
-
* tools: [ToolName]
|
|
11
|
-
* when_to_use: description of when to invoke
|
|
12
|
-
* ---
|
|
13
|
-
* <skill content>
|
|
2
|
+
* Skill scanner — discovers <base>/<name>/SKILL.md files from project + user
|
|
3
|
+
* directories AND from installed plugins. Mirrors Claude Code's
|
|
4
|
+
* `loadSkillsFromSkillsDir` (skills/loadSkillsDir.ts:407) plus plugin
|
|
5
|
+
* integration (utils/plugins/pluginLoader.ts).
|
|
14
6
|
*/
|
|
15
7
|
export interface SkillDefinition {
|
|
8
|
+
/** Directory name; authoritative regardless of frontmatter.name. */
|
|
16
9
|
name: string;
|
|
10
|
+
/** From frontmatter.description, coerced. Empty string if absent or invalid. */
|
|
17
11
|
description: string;
|
|
18
|
-
|
|
19
|
-
keywords?: string[];
|
|
20
|
-
tools?: string[];
|
|
21
|
-
intents?: string[];
|
|
22
|
-
};
|
|
23
|
-
whenToUse: string;
|
|
12
|
+
/** SKILL.md body with frontmatter stripped. */
|
|
24
13
|
content: string;
|
|
14
|
+
/** Absolute path to the SKILL.md file. */
|
|
25
15
|
filePath: string;
|
|
16
|
+
/** Where the skill was loaded from. */
|
|
17
|
+
source: "project" | "user" | "plugin";
|
|
26
18
|
}
|
|
27
|
-
/**
|
|
28
|
-
* Scan for SKILL.md files in standard locations.
|
|
29
|
-
*/
|
|
30
19
|
export declare function scanSkills(cwd: string): SkillDefinition[];
|
|
20
|
+
export declare function invalidateSkillCache(): void;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {d as d$1}from'./chunk-DI26OUIU.js';import {h,a}from'./chunk-3QP5BQ3L.js';h();var p='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.';async function d(r,a,l){if(r.length===0)return null;try{let e=[];for(let t=0;t<r.length;t++){let s=r[t],o=a[t],u=JSON.stringify(s.args).slice(0,200),c=(o?.result??o?.error??"").slice(0,300);e.push(`Tool: ${s.toolName}(${u}) \u2192 ${c}`);}return (await l(p,e.join(`
|
|
2
|
+
`)))?.trim()||null}catch(e){return d$1.warn("tool_summary.failed",{error:e.message}),null}}a(d,"generateToolUseSummary");export{d as generateToolUseSummary};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Background-agent completion notification queue.
|
|
3
|
+
*
|
|
4
|
+
* Mirrors Claude Code's `commandQueue` with `mode: 'task-notification'`. A
|
|
5
|
+
* background sub-agent that finishes (completed | failed) enqueues an item
|
|
6
|
+
* here; the UI layer subscribes and, when the main agent is idle, drains
|
|
7
|
+
* the queue and submits the formatted XML as a new user turn so the LLM
|
|
8
|
+
* sees the result. Cancellation does NOT enqueue (user explicitly stopped
|
|
9
|
+
* the agent; no follow-up needed).
|
|
10
|
+
*
|
|
11
|
+
* The result text lives only in this queue + the eventual user message —
|
|
12
|
+
* not in `asyncAgentRegistry`. Registry stays metadata-only.
|
|
13
|
+
*
|
|
14
|
+
* Process-local singleton; same lifetime contract as `asyncAgentRegistry`.
|
|
15
|
+
*/
|
|
16
|
+
export type NotificationItem = {
|
|
17
|
+
agentId: string;
|
|
18
|
+
name?: string;
|
|
19
|
+
description: string;
|
|
20
|
+
status: "completed" | "failed";
|
|
21
|
+
/** Final assistant text (completed only). */
|
|
22
|
+
finalText?: string;
|
|
23
|
+
/** Error message (failed only). */
|
|
24
|
+
error?: string;
|
|
25
|
+
enqueuedAt: number;
|
|
26
|
+
};
|
|
27
|
+
type Listener = () => void;
|
|
28
|
+
declare class NotificationQueue {
|
|
29
|
+
private items;
|
|
30
|
+
private listeners;
|
|
31
|
+
enqueue(item: NotificationItem): void;
|
|
32
|
+
subscribe: (cb: Listener) => (() => void);
|
|
33
|
+
getSnapshot: () => NotificationItem[];
|
|
34
|
+
/** Atomic: returns all items and clears in one shot. */
|
|
35
|
+
drainAll(): NotificationItem[];
|
|
36
|
+
reset(): void;
|
|
37
|
+
private notify;
|
|
38
|
+
}
|
|
39
|
+
export declare const notificationQueue: NotificationQueue;
|
|
40
|
+
/**
|
|
41
|
+
* Render a batch of completion notifications as the XML user-message
|
|
42
|
+
* body that the main agent's LLM will see. Format is stable — main
|
|
43
|
+
* agent prompts can rely on the `<background-agents-completed>` root
|
|
44
|
+
* tag as a signal that this turn is a system-injected notification,
|
|
45
|
+
* not a real user message.
|
|
46
|
+
*/
|
|
47
|
+
export declare function buildNotificationMessage(items: NotificationItem[]): string;
|
|
48
|
+
/**
|
|
49
|
+
* One-line-per-agent human summary for the chat feed. The full result
|
|
50
|
+
* body goes to the LLM via buildNotificationMessage; the user sees only
|
|
51
|
+
* this terse marker plus an optional inline error preview, and can
|
|
52
|
+
* switch to the sub-agent's dock view if they want details.
|
|
53
|
+
*/
|
|
54
|
+
export declare function buildNotificationSummary(items: NotificationItem[]): string;
|
|
55
|
+
export {};
|
|
@@ -12,23 +12,54 @@
|
|
|
12
12
|
* RunManager, not here.
|
|
13
13
|
*/
|
|
14
14
|
export type AsyncAgentStatus = "running" | "completed" | "failed" | "cancelled";
|
|
15
|
+
/**
|
|
16
|
+
* Minimal structural shape for an entry in an agent's transcript. We avoid
|
|
17
|
+
* importing the UI's `ChatEntry` here to prevent a tool-system → ui import
|
|
18
|
+
* direction. Consumers (the UI dock) widen this type via `as ChatEntry[]`
|
|
19
|
+
* at their boundary.
|
|
20
|
+
*/
|
|
21
|
+
export interface AgentTranscriptEntry {
|
|
22
|
+
id: string;
|
|
23
|
+
type: string;
|
|
24
|
+
[key: string]: unknown;
|
|
25
|
+
}
|
|
15
26
|
export interface AsyncAgentEntry {
|
|
16
27
|
agentId: string;
|
|
28
|
+
/** Short kind label shown in the dock (e.g. "Explore", "Plan"). */
|
|
29
|
+
name?: string;
|
|
17
30
|
description: string;
|
|
18
31
|
status: AsyncAgentStatus;
|
|
19
32
|
startedAt: number;
|
|
20
33
|
finishedAt?: number;
|
|
21
|
-
|
|
22
|
-
|
|
34
|
+
/** finishedAt + 30_000. Dock filters rows past this. */
|
|
35
|
+
finishedFadeAt?: number;
|
|
23
36
|
abort: () => void;
|
|
37
|
+
/** Stream events recorded by run_in_background agents for UI view-switching. */
|
|
38
|
+
transcript?: AgentTranscriptEntry[];
|
|
24
39
|
}
|
|
25
40
|
declare class AsyncAgentRegistry {
|
|
26
41
|
private agents;
|
|
42
|
+
private listeners;
|
|
43
|
+
private snapshot;
|
|
44
|
+
subscribe: (cb: () => void) => (() => void);
|
|
45
|
+
getSnapshot: () => AsyncAgentEntry[];
|
|
46
|
+
hasRunning: () => boolean;
|
|
47
|
+
private notify;
|
|
27
48
|
register(entry: AsyncAgentEntry): void;
|
|
49
|
+
appendToTranscript(agentId: string, entry: AgentTranscriptEntry): void;
|
|
50
|
+
/**
|
|
51
|
+
* Re-emit the registry change signal after callers mutate an agent's
|
|
52
|
+
* transcript array in place (patching or filtering entries). Required
|
|
53
|
+
* because `notify` rebuilds the snapshot and tells React subscribers to
|
|
54
|
+
* re-read.
|
|
55
|
+
*/
|
|
56
|
+
touchTranscript(agentId: string): void;
|
|
28
57
|
get(agentId: string): AsyncAgentEntry | undefined;
|
|
29
58
|
list(): AsyncAgentEntry[];
|
|
30
|
-
|
|
31
|
-
|
|
59
|
+
private markFinished;
|
|
60
|
+
markCompleted(agentId: string): void;
|
|
61
|
+
markFailed(agentId: string): void;
|
|
62
|
+
markCancelled(agentId: string): void;
|
|
32
63
|
cancel(agentId: string): boolean;
|
|
33
64
|
reset(): void;
|
|
34
65
|
}
|