@swifty.js/swifty 0.0.22 → 0.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agent-5T7KNC7V.js → agent-24XMR2WX.js} +1 -1
- package/dist/anthropic-7QRAPLOY.js +4 -0
- package/dist/{checker-OJFS2MZY.js → checker-3RWAYF2U.js} +1 -1
- package/dist/{chunk-HJIGA37J.js → chunk-5KXBVL2A.js} +1 -1
- package/dist/chunk-FAJYJI6T.js +389 -0
- package/dist/chunk-MWZIARZE.js +130 -0
- package/dist/{chunk-GUXBLUNR.js → chunk-NR62AA5K.js} +1 -1
- package/dist/chunk-QN27QEFS.js +4 -0
- package/dist/{chunk-LX2LK3TF.js → chunk-SIWLMWHH.js} +12 -11
- package/dist/{chunk-NEAR6YPZ.js → chunk-VQUWSKQQ.js} +21 -20
- package/dist/{chunk-NLNH3IRT.js → chunk-W37Y53LX.js} +1 -1
- package/dist/lib/agent-U42LS73D.js +9 -0
- package/dist/lib/{anthropic-GFWP3ORB.js → anthropic-RYPJDHQM.js} +6 -6
- package/dist/lib/{checker-IIXJXQCB.js → checker-6BW4222R.js} +3 -3
- package/dist/lib/{chunk-LUEP4JMF.js → chunk-2AUSNVIB.js} +8 -12
- package/dist/lib/{chunk-C7IHCJZ3.js → chunk-2QILP24G.js} +283 -12
- package/dist/lib/{chunk-6GOWRPYS.js → chunk-3LU4APFB.js} +2 -2
- package/dist/lib/{chunk-EJLGB2EJ.js → chunk-EY7HE52Q.js} +14 -7
- package/dist/lib/{chunk-7URDLWQN.js → chunk-GNI7YX6F.js} +2 -2
- package/dist/lib/{chunk-UMFNTXKA.js → chunk-OO2CLOEE.js} +38 -38
- package/dist/lib/{chunk-GNBXECZN.js → chunk-PZ42NAFA.js} +2 -3
- package/dist/lib/{chunk-RR2CZ6CY.js → chunk-XFSN4LMA.js} +94 -75
- package/dist/lib/{chunk-UHVO63Y7.js → chunk-XG6NELJH.js} +69 -38
- package/dist/lib/index.d.ts +234 -237
- package/dist/lib/index.js +212 -224
- package/dist/lib/{openai-HXRMPNB7.js → openai-VX5VBXZ4.js} +4 -4
- package/dist/main.js +197 -465
- package/dist/{openai-TVUUHRG7.js → openai-6MXNADYN.js} +15 -15
- package/dist/{server-ZTLHJWEQ.js → server-NJ2NXAOI.js} +16 -16
- package/package.json +5 -5
- package/dist/anthropic-P2R4GW6F.js +0 -4
- package/dist/chunk-L73IHJF4.js +0 -386
- package/dist/chunk-YQQVB6VB.js +0 -127
- package/dist/chunk-ZZQE743W.js +0 -4
- package/dist/lib/agent-2AGRYN3R.js +0 -9
package/dist/lib/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import Anthropic from '@anthropic-ai/sdk';
|
|
1
2
|
import z$1, { z } from 'zod';
|
|
2
3
|
import OpenAI from 'openai';
|
|
3
|
-
import Anthropic from '@anthropic-ai/sdk';
|
|
4
4
|
import { FunctionTool } from 'openai/resources/responses/responses';
|
|
5
5
|
import { Logger } from 'pino';
|
|
6
6
|
import { Transport } from '@modelcontextprotocol/sdk/shared/transport.js';
|
|
@@ -68,6 +68,212 @@ declare class RecoveryState {
|
|
|
68
68
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
69
69
|
* SOFTWARE.
|
|
70
70
|
*/
|
|
71
|
+
declare class FileStateCache {
|
|
72
|
+
private cache;
|
|
73
|
+
/** Called after a successful ReadFile to register the file as "seen". */
|
|
74
|
+
record(filePath: string, lastModifiedTimeMs: number): void;
|
|
75
|
+
/**
|
|
76
|
+
* Gate check before EditFile / WriteFile
|
|
77
|
+
*/
|
|
78
|
+
check(filePath: string): {
|
|
79
|
+
ok: true;
|
|
80
|
+
} | {
|
|
81
|
+
ok: false;
|
|
82
|
+
error: string;
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Called after a successful edit / write to keep the cache in sync
|
|
86
|
+
* with the new on-disk state
|
|
87
|
+
*/
|
|
88
|
+
update(filePath: string): void;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Copyright (c) 2026 hangtiancheng
|
|
93
|
+
*
|
|
94
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
95
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
96
|
+
* in the Software without restriction, including without limitation the rights
|
|
97
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
98
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
99
|
+
* furnished to do so, subject to the following conditions:
|
|
100
|
+
*
|
|
101
|
+
* The above copyright notice and this permission notice shall be included in
|
|
102
|
+
* all copies or substantial portions of the Software.
|
|
103
|
+
*
|
|
104
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
105
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
106
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
107
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
108
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
109
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
110
|
+
* SOFTWARE.
|
|
111
|
+
*/
|
|
112
|
+
interface Backup {
|
|
113
|
+
backupPath: string;
|
|
114
|
+
version: number;
|
|
115
|
+
time: string;
|
|
116
|
+
}
|
|
117
|
+
interface Snapshot {
|
|
118
|
+
messageIndex: number;
|
|
119
|
+
userText: string;
|
|
120
|
+
backups: Record<string, Backup>;
|
|
121
|
+
timestamp: string;
|
|
122
|
+
}
|
|
123
|
+
/** Single source of truth for a session's file-history directory layout. */
|
|
124
|
+
declare function fileHistoryDir(baseDir: string, sessionId: string): string;
|
|
125
|
+
declare class FileHistory {
|
|
126
|
+
private sessionDir;
|
|
127
|
+
/** Tracked file absolute path to version */
|
|
128
|
+
private trackedFiles;
|
|
129
|
+
private snapshots;
|
|
130
|
+
constructor(baseDir: string, sessionID: string);
|
|
131
|
+
trackEdit(path: string): void;
|
|
132
|
+
makeSnapshot(messageIndex: number, userText: string): void;
|
|
133
|
+
rewind(snapshotIndex: number): string[];
|
|
134
|
+
getSnapshots(): Snapshot[];
|
|
135
|
+
hasSnapshots(): boolean;
|
|
136
|
+
save(): void;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Copyright (c) 2026 hangtiancheng
|
|
141
|
+
*
|
|
142
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
143
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
144
|
+
* in the Software without restriction, including without limitation the rights
|
|
145
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
146
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
147
|
+
* furnished to do so, subject to the following conditions:
|
|
148
|
+
*
|
|
149
|
+
* The above copyright notice and this permission notice shall be included in
|
|
150
|
+
* all copies or substantial portions of the Software.
|
|
151
|
+
*
|
|
152
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
153
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
154
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
155
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
156
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
157
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
158
|
+
* SOFTWARE.
|
|
159
|
+
*/
|
|
160
|
+
|
|
161
|
+
type ToolCategory = "read" | "write" | "command";
|
|
162
|
+
type AnthropicToolResultContent = NonNullable<Anthropic.ToolResultBlockParam["content"]>;
|
|
163
|
+
type ToolResultContentBlock = Exclude<AnthropicToolResultContent, string>[number];
|
|
164
|
+
declare function normalizeToolResultContentBlock(value: unknown): ToolResultContentBlock | null;
|
|
165
|
+
declare function isToolResultContentBlock(value: unknown): value is ToolResultContentBlock;
|
|
166
|
+
interface ToolResult {
|
|
167
|
+
output: string;
|
|
168
|
+
contentBlocks?: ToolResultContentBlock[];
|
|
169
|
+
isError: boolean;
|
|
170
|
+
}
|
|
171
|
+
interface ToolContext {
|
|
172
|
+
workDir: string;
|
|
173
|
+
abortSignal?: AbortSignal;
|
|
174
|
+
fileHistory?: FileHistory | undefined;
|
|
175
|
+
fileStateCache?: FileStateCache | undefined;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* How MCP tools enter the context, written into ToolRegistry by mcp/strategy
|
|
179
|
+
* after connecting to the server.
|
|
180
|
+
*
|
|
181
|
+
* eager total schema size under one tenth of the context; all go into tools[],
|
|
182
|
+
* no deferral
|
|
183
|
+
* native official endpoint; tools stay in the array with defer_loading but the
|
|
184
|
+
* server does not show them to the model, and ToolSearch returns a
|
|
185
|
+
* tool_reference so the server expands the schema
|
|
186
|
+
* dispatch other endpoints support neither of the above; MCP tools never enter
|
|
187
|
+
* tools[] at all and go through McpCall
|
|
188
|
+
*
|
|
189
|
+
* Why three modes: tools render after system and before messages, so any change to
|
|
190
|
+
* the array invalidates the entire trailing conversation-history cache. In a test
|
|
191
|
+
* with twenty thousand tokens of history, appending one tool to the end of tools
|
|
192
|
+
* dropped the hit rate from 99.4% to 9.5%.
|
|
193
|
+
*/
|
|
194
|
+
type McpLoadingMode = "eager" | "native" | "dispatch";
|
|
195
|
+
/** Extra capabilities the MCP tool wrapper exposes to dispatch and routing logic. */
|
|
196
|
+
interface MCPToolLike extends Tool {
|
|
197
|
+
mcpServerName: string;
|
|
198
|
+
mcpInputSchema(): Record<string, unknown>;
|
|
199
|
+
setDeferLoading(on: boolean): void;
|
|
200
|
+
}
|
|
201
|
+
interface ToolSchema {
|
|
202
|
+
name: string;
|
|
203
|
+
parameters?: Record<string, unknown>;
|
|
204
|
+
strict?: boolean;
|
|
205
|
+
/** For OpenAI, this must be "function"; for Anthropic, it can be "custom" or null */
|
|
206
|
+
type?: "function" | "custom";
|
|
207
|
+
defer_loading?: boolean;
|
|
208
|
+
description: string;
|
|
209
|
+
/** The input schema for the tool. */
|
|
210
|
+
input_schema: {
|
|
211
|
+
type: "object";
|
|
212
|
+
properties: Record<string, object>;
|
|
213
|
+
required?: string[];
|
|
214
|
+
};
|
|
215
|
+
allowed_callers?: ("direct" | "code_execution_20250825" | "code_execution_20260120")[];
|
|
216
|
+
cache_control?: {
|
|
217
|
+
type: "ephemeral";
|
|
218
|
+
ttl?: "5m" | "1h";
|
|
219
|
+
};
|
|
220
|
+
eager_input_streaming?: boolean;
|
|
221
|
+
}
|
|
222
|
+
interface Tool {
|
|
223
|
+
name: string;
|
|
224
|
+
description: string;
|
|
225
|
+
category: ToolCategory;
|
|
226
|
+
/**
|
|
227
|
+
* Whether to defer loading. A deferred tool does not appear in the initial
|
|
228
|
+
* tool list; the model must first pull its schema out via ToolSearch before
|
|
229
|
+
* it can call it.
|
|
230
|
+
*
|
|
231
|
+
* Only MCP tools are set to true. MCP is configured per project, a single
|
|
232
|
+
* server can easily expose dozens of tools with long schemas, and stuffing
|
|
233
|
+
* all of them into the initial tool list would eat up a large chunk of the
|
|
234
|
+
* context — especially since most of those tools won't be used in a given
|
|
235
|
+
* session. Built-in tools are a fixed few dozen, a controllable count;
|
|
236
|
+
* hiding them would only force the model into an extra ToolSearch round
|
|
237
|
+
* trip, so they are never deferred and always ship their full schema.
|
|
238
|
+
*/
|
|
239
|
+
deferred?: boolean;
|
|
240
|
+
/**
|
|
241
|
+
* Whether this particular invocation can run concurrently with others,
|
|
242
|
+
* judged by actual arguments rather than just the tool category.
|
|
243
|
+
*
|
|
244
|
+
* When not implemented, falls back to category: read-only tools may run
|
|
245
|
+
* concurrently, write and command tools may not. Currently only Bash
|
|
246
|
+
* implements this — whether a command is read-only depends on the command
|
|
247
|
+
* itself (ls vs rm are both Bash but have very different safety profiles).
|
|
248
|
+
*/
|
|
249
|
+
isConcurrencySafe?(args: Record<string, unknown>): boolean;
|
|
250
|
+
schema(): ToolSchema;
|
|
251
|
+
execute(ctx: ToolContext, args: Record<string, unknown>): Promise<ToolResult>;
|
|
252
|
+
}
|
|
253
|
+
declare const SKIP_DIRS: Set<string>;
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Copyright (c) 2026 hangtiancheng
|
|
257
|
+
*
|
|
258
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
259
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
260
|
+
* in the Software without restriction, including without limitation the rights
|
|
261
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
262
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
263
|
+
* furnished to do so, subject to the following conditions:
|
|
264
|
+
*
|
|
265
|
+
* The above copyright notice and this permission notice shall be included in
|
|
266
|
+
* all copies or substantial portions of the Software.
|
|
267
|
+
*
|
|
268
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
269
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
270
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
271
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
272
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
273
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
274
|
+
* SOFTWARE.
|
|
275
|
+
*/
|
|
276
|
+
|
|
71
277
|
interface ToolUseBlock {
|
|
72
278
|
toolUseId: string;
|
|
73
279
|
toolName: string;
|
|
@@ -75,7 +281,8 @@ interface ToolUseBlock {
|
|
|
75
281
|
}
|
|
76
282
|
interface ToolResultBlock {
|
|
77
283
|
toolUseId: string;
|
|
78
|
-
content: string
|
|
284
|
+
content: string;
|
|
285
|
+
contentBlocks?: ToolResultContentBlock[];
|
|
79
286
|
isError: boolean;
|
|
80
287
|
}
|
|
81
288
|
interface ThinkingBlock {
|
|
@@ -101,7 +308,7 @@ declare class ConversationManager {
|
|
|
101
308
|
addToolUseMessage(text: string, toolUseId: string, toolName: string, args: Record<string, unknown>): void;
|
|
102
309
|
addAssistantMessageWithTools(text: string, toolUses: ToolUseBlock[]): void;
|
|
103
310
|
addAssistantFull(text: string, thinking: ThinkingBlock[], toolUses: ToolUseBlock[]): void;
|
|
104
|
-
addToolResultMessage(toolUseId: string, content: string
|
|
311
|
+
addToolResultMessage(toolUseId: string, content: string, isError: boolean, contentBlocks?: ToolResultContentBlock[]): void;
|
|
105
312
|
addToolResultsMessage(results: ToolResultBlock[]): void;
|
|
106
313
|
addSystemReminder(content: string): void;
|
|
107
314
|
/**
|
|
@@ -113,6 +320,7 @@ declare class ConversationManager {
|
|
|
113
320
|
*/
|
|
114
321
|
hasReminderContaining(marker: string): boolean;
|
|
115
322
|
injectLongTermMemory(instructions: string, memories: string, skills?: string): void;
|
|
323
|
+
appendMessages(msgs: Message[]): void;
|
|
116
324
|
len(): number;
|
|
117
325
|
truncateTo(index: number): void;
|
|
118
326
|
reset(): void;
|
|
@@ -126,54 +334,6 @@ declare class ConversationManager {
|
|
|
126
334
|
} | null;
|
|
127
335
|
}
|
|
128
336
|
|
|
129
|
-
/**
|
|
130
|
-
* Copyright (c) 2026 hangtiancheng
|
|
131
|
-
*
|
|
132
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
133
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
134
|
-
* in the Software without restriction, including without limitation the rights
|
|
135
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
136
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
137
|
-
* furnished to do so, subject to the following conditions:
|
|
138
|
-
*
|
|
139
|
-
* The above copyright notice and this permission notice shall be included in
|
|
140
|
-
* all copies or substantial portions of the Software.
|
|
141
|
-
*
|
|
142
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
143
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
144
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
145
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
146
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
147
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
148
|
-
* SOFTWARE.
|
|
149
|
-
*/
|
|
150
|
-
interface Backup {
|
|
151
|
-
backupPath: string;
|
|
152
|
-
version: number;
|
|
153
|
-
time: string;
|
|
154
|
-
}
|
|
155
|
-
interface Snapshot {
|
|
156
|
-
messageIndex: number;
|
|
157
|
-
userText: string;
|
|
158
|
-
backups: Record<string, Backup>;
|
|
159
|
-
timestamp: string;
|
|
160
|
-
}
|
|
161
|
-
/** Single source of truth for a session's file-history directory layout. */
|
|
162
|
-
declare function fileHistoryDir(baseDir: string, sessionId: string): string;
|
|
163
|
-
declare class FileHistory {
|
|
164
|
-
private sessionDir;
|
|
165
|
-
/** Tracked file absolute path to version */
|
|
166
|
-
private trackedFiles;
|
|
167
|
-
private snapshots;
|
|
168
|
-
constructor(baseDir: string, sessionID: string);
|
|
169
|
-
trackEdit(path: string): void;
|
|
170
|
-
makeSnapshot(messageIndex: number, userText: string): void;
|
|
171
|
-
rewind(snapshotIndex: number): string[];
|
|
172
|
-
getSnapshots(): Snapshot[];
|
|
173
|
-
hasSnapshots(): boolean;
|
|
174
|
-
save(): void;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
337
|
/**
|
|
178
338
|
* Copyright (c) 2026 hangtiancheng
|
|
179
339
|
*
|
|
@@ -416,158 +576,6 @@ type StreamEvent = {
|
|
|
416
576
|
usage: UsageInfo;
|
|
417
577
|
};
|
|
418
578
|
|
|
419
|
-
/**
|
|
420
|
-
* Copyright (c) 2026 hangtiancheng
|
|
421
|
-
*
|
|
422
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
423
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
424
|
-
* in the Software without restriction, including without limitation the rights
|
|
425
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
426
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
427
|
-
* furnished to do so, subject to the following conditions:
|
|
428
|
-
*
|
|
429
|
-
* The above copyright notice and this permission notice shall be included in
|
|
430
|
-
* all copies or substantial portions of the Software.
|
|
431
|
-
*
|
|
432
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
433
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
434
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
435
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
436
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
437
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
438
|
-
* SOFTWARE.
|
|
439
|
-
*/
|
|
440
|
-
declare class FileStateCache {
|
|
441
|
-
private cache;
|
|
442
|
-
/** Called after a successful ReadFile to register the file as "seen". */
|
|
443
|
-
record(filePath: string, lastModifiedTimeMs: number): void;
|
|
444
|
-
/**
|
|
445
|
-
* Gate check before EditFile / WriteFile
|
|
446
|
-
*/
|
|
447
|
-
check(filePath: string): {
|
|
448
|
-
ok: true;
|
|
449
|
-
} | {
|
|
450
|
-
ok: false;
|
|
451
|
-
error: string;
|
|
452
|
-
};
|
|
453
|
-
/**
|
|
454
|
-
* Called after a successful edit / write to keep the cache in sync
|
|
455
|
-
* with the new on-disk state
|
|
456
|
-
*/
|
|
457
|
-
update(filePath: string): void;
|
|
458
|
-
}
|
|
459
|
-
|
|
460
|
-
/**
|
|
461
|
-
* Copyright (c) 2026 hangtiancheng
|
|
462
|
-
*
|
|
463
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
464
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
465
|
-
* in the Software without restriction, including without limitation the rights
|
|
466
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
467
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
468
|
-
* furnished to do so, subject to the following conditions:
|
|
469
|
-
*
|
|
470
|
-
* The above copyright notice and this permission notice shall be included in
|
|
471
|
-
* all copies or substantial portions of the Software.
|
|
472
|
-
*
|
|
473
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
474
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
475
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
476
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
477
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
478
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
479
|
-
* SOFTWARE.
|
|
480
|
-
*/
|
|
481
|
-
|
|
482
|
-
type ToolCategory = "read" | "write" | "command";
|
|
483
|
-
interface ToolResult {
|
|
484
|
-
output: string | Record<string, unknown>[];
|
|
485
|
-
isError: boolean;
|
|
486
|
-
}
|
|
487
|
-
interface ToolContext {
|
|
488
|
-
workDir: string;
|
|
489
|
-
abortSignal?: AbortSignal;
|
|
490
|
-
fileHistory?: FileHistory | undefined;
|
|
491
|
-
fileStateCache?: FileStateCache | undefined;
|
|
492
|
-
}
|
|
493
|
-
/**
|
|
494
|
-
* How MCP tools enter the context, written into ToolRegistry by mcp/strategy
|
|
495
|
-
* after connecting to the server.
|
|
496
|
-
*
|
|
497
|
-
* eager total schema size under one tenth of the context; all go into tools[],
|
|
498
|
-
* no deferral
|
|
499
|
-
* native official endpoint; tools stay in the array with defer_loading but the
|
|
500
|
-
* server does not show them to the model, and ToolSearch returns a
|
|
501
|
-
* tool_reference so the server expands the schema
|
|
502
|
-
* dispatch other endpoints support neither of the above; MCP tools never enter
|
|
503
|
-
* tools[] at all and go through McpCall
|
|
504
|
-
*
|
|
505
|
-
* Why three modes: tools render after system and before messages, so any change to
|
|
506
|
-
* the array invalidates the entire trailing conversation-history cache. In a test
|
|
507
|
-
* with twenty thousand tokens of history, appending one tool to the end of tools
|
|
508
|
-
* dropped the hit rate from 99.4% to 9.5%.
|
|
509
|
-
*/
|
|
510
|
-
type McpLoadingMode = "eager" | "native" | "dispatch";
|
|
511
|
-
/** Extra capabilities the MCP tool wrapper exposes to dispatch and routing logic. */
|
|
512
|
-
interface MCPToolLike extends Tool {
|
|
513
|
-
mcpServerName: string;
|
|
514
|
-
mcpInputSchema(): Record<string, unknown>;
|
|
515
|
-
setDeferLoading(on: boolean): void;
|
|
516
|
-
}
|
|
517
|
-
interface ToolSchema {
|
|
518
|
-
name: string;
|
|
519
|
-
parameters?: Record<string, unknown>;
|
|
520
|
-
strict?: boolean;
|
|
521
|
-
/** For OpenAI, this must be "function"; for Anthropic, it can be "custom" or null */
|
|
522
|
-
type?: "function" | "custom";
|
|
523
|
-
defer_loading?: boolean;
|
|
524
|
-
description: string;
|
|
525
|
-
/** The input schema for the tool. */
|
|
526
|
-
input_schema: {
|
|
527
|
-
type: "object";
|
|
528
|
-
properties: Record<string, object>;
|
|
529
|
-
required?: string[];
|
|
530
|
-
};
|
|
531
|
-
allowed_callers?: ("direct" | "code_execution_20250825" | "code_execution_20260120")[];
|
|
532
|
-
cache_control?: {
|
|
533
|
-
type: "ephemeral";
|
|
534
|
-
ttl?: "5m" | "1h";
|
|
535
|
-
};
|
|
536
|
-
eager_input_streaming?: boolean;
|
|
537
|
-
}
|
|
538
|
-
interface Tool {
|
|
539
|
-
name: string;
|
|
540
|
-
description: string;
|
|
541
|
-
category: ToolCategory;
|
|
542
|
-
/**
|
|
543
|
-
* Whether to defer loading. A deferred tool does not appear in the initial
|
|
544
|
-
* tool list; the model must first pull its schema out via ToolSearch before
|
|
545
|
-
* it can call it.
|
|
546
|
-
*
|
|
547
|
-
* Only MCP tools are set to true. MCP is configured per project, a single
|
|
548
|
-
* server can easily expose dozens of tools with long schemas, and stuffing
|
|
549
|
-
* all of them into the initial tool list would eat up a large chunk of the
|
|
550
|
-
* context — especially since most of those tools won't be used in a given
|
|
551
|
-
* session. Built-in tools are a fixed few dozen, a controllable count;
|
|
552
|
-
* hiding them would only force the model into an extra ToolSearch round
|
|
553
|
-
* trip, so they are never deferred and always ship their full schema.
|
|
554
|
-
*/
|
|
555
|
-
deferred?: boolean;
|
|
556
|
-
/**
|
|
557
|
-
* Whether this particular invocation can run concurrently with others,
|
|
558
|
-
* judged by actual arguments rather than just the tool category.
|
|
559
|
-
*
|
|
560
|
-
* When not implemented, falls back to category: read-only tools may run
|
|
561
|
-
* concurrently, write and command tools may not. Currently only Bash
|
|
562
|
-
* implements this — whether a command is read-only depends on the command
|
|
563
|
-
* itself (ls vs rm are both Bash but have very different safety profiles).
|
|
564
|
-
*/
|
|
565
|
-
isConcurrencySafe?(args: Record<string, unknown>): boolean;
|
|
566
|
-
schema(): ToolSchema;
|
|
567
|
-
execute(ctx: ToolContext, args: Record<string, unknown>): Promise<ToolResult>;
|
|
568
|
-
}
|
|
569
|
-
declare const SKIP_DIRS: Set<string>;
|
|
570
|
-
|
|
571
579
|
/**
|
|
572
580
|
* Copyright (c) 2026 hangtiancheng
|
|
573
581
|
*
|
|
@@ -742,7 +750,10 @@ interface RelevantMemory {
|
|
|
742
750
|
declare class MemoryManager {
|
|
743
751
|
private userDir;
|
|
744
752
|
private projectDir;
|
|
753
|
+
private malformedFingerprints;
|
|
745
754
|
constructor(workDir: string);
|
|
755
|
+
private readMemory;
|
|
756
|
+
private scanAllMemories;
|
|
746
757
|
loadAll(): MemoryFile[];
|
|
747
758
|
getMemories(): MemoryFile[];
|
|
748
759
|
/**
|
|
@@ -763,12 +774,14 @@ declare class MemoryManager {
|
|
|
763
774
|
* alphabetically by name, truncated at MAX_ENTRYPOINT_LINES / MAX_ENTRYPOINT_BYTES.
|
|
764
775
|
*/
|
|
765
776
|
rebuildIndex(): void;
|
|
777
|
+
private writeIndex;
|
|
766
778
|
/**
|
|
767
779
|
* Scans all memory headers from both dirs, asks the LLM to select the
|
|
768
780
|
* top 5 most relevant ones for the query, and returns the full content
|
|
769
781
|
* of those files. Best-effort: selector failures return an empty array.
|
|
770
782
|
*/
|
|
771
783
|
findRelevantMemories(query: string, client: LLMClient, recentTools?: string[], alreadySurfaced?: Set<string>): Promise<RelevantMemory[]>;
|
|
784
|
+
private scanMemoryHeaders;
|
|
772
785
|
renderReminder(memories: RelevantMemory[]): string;
|
|
773
786
|
}
|
|
774
787
|
|
|
@@ -948,6 +961,7 @@ type ToolUseRecord = z$1.infer<typeof ToolUseRecordSchema>;
|
|
|
948
961
|
declare const ToolResultRecordSchema: z$1.ZodObject<{
|
|
949
962
|
tool_use_id: z$1.ZodString;
|
|
950
963
|
content: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodArray<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>]>;
|
|
964
|
+
content_blocks: z$1.ZodOptional<z$1.ZodArray<z$1.ZodUnknown>>;
|
|
951
965
|
is_error: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
952
966
|
}, z$1.core.$strip>;
|
|
953
967
|
type ToolResultRecord = z$1.infer<typeof ToolResultRecordSchema>;
|
|
@@ -964,6 +978,7 @@ declare const SessionMessageSchema: z$1.ZodObject<{
|
|
|
964
978
|
tool_results: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
|
|
965
979
|
tool_use_id: z$1.ZodString;
|
|
966
980
|
content: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodArray<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>]>;
|
|
981
|
+
content_blocks: z$1.ZodOptional<z$1.ZodArray<z$1.ZodUnknown>>;
|
|
967
982
|
is_error: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
968
983
|
}, z$1.core.$strip>>>;
|
|
969
984
|
}, z$1.core.$strip>;
|
|
@@ -979,6 +994,7 @@ declare const KeptMessageSchema: z$1.ZodObject<{
|
|
|
979
994
|
tool_results: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
|
|
980
995
|
tool_use_id: z$1.ZodString;
|
|
981
996
|
content: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodArray<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>]>;
|
|
997
|
+
content_blocks: z$1.ZodOptional<z$1.ZodArray<z$1.ZodUnknown>>;
|
|
982
998
|
is_error: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
983
999
|
}, z$1.core.$strip>>>;
|
|
984
1000
|
}, z$1.core.$strip>;
|
|
@@ -989,11 +1005,7 @@ declare function toolUsesToRecords(toolUses?: {
|
|
|
989
1005
|
toolName: string;
|
|
990
1006
|
arguments?: Record<string, unknown>;
|
|
991
1007
|
}[]): ToolUseRecord[];
|
|
992
|
-
declare function toolResultsToRecords(toolResults?:
|
|
993
|
-
toolUseId: string;
|
|
994
|
-
content: string | Record<string, unknown>[];
|
|
995
|
-
isError?: boolean;
|
|
996
|
-
}[]): ToolResultRecord[];
|
|
1008
|
+
declare function toolResultsToRecords(toolResults?: ToolResultBlock[]): ToolResultRecord[];
|
|
997
1009
|
declare const CompactBoundaryPayloadSchema: z$1.ZodObject<{
|
|
998
1010
|
summary: z$1.ZodString;
|
|
999
1011
|
keep: z$1.ZodArray<z$1.ZodObject<{
|
|
@@ -1007,6 +1019,7 @@ declare const CompactBoundaryPayloadSchema: z$1.ZodObject<{
|
|
|
1007
1019
|
tool_results: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
|
|
1008
1020
|
tool_use_id: z$1.ZodString;
|
|
1009
1021
|
content: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodArray<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>]>;
|
|
1022
|
+
content_blocks: z$1.ZodOptional<z$1.ZodArray<z$1.ZodUnknown>>;
|
|
1010
1023
|
is_error: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1011
1024
|
}, z$1.core.$strip>>>;
|
|
1012
1025
|
}, z$1.core.$strip>>;
|
|
@@ -1032,11 +1045,7 @@ interface RestoredMessage {
|
|
|
1032
1045
|
toolName: string;
|
|
1033
1046
|
arguments?: Record<string, unknown>;
|
|
1034
1047
|
}[];
|
|
1035
|
-
toolResults?:
|
|
1036
|
-
toolUseId: string;
|
|
1037
|
-
content: string | Record<string, unknown>[];
|
|
1038
|
-
isError?: boolean;
|
|
1039
|
-
}[];
|
|
1048
|
+
toolResults?: ToolResultBlock[];
|
|
1040
1049
|
}
|
|
1041
1050
|
declare function rebuildFromSession(saved: SessionMessage[]): RestoredMessage[];
|
|
1042
1051
|
declare function listSessions(workDir: string): SessionInfo[];
|
|
@@ -1088,9 +1097,8 @@ type AgentEvent = {
|
|
|
1088
1097
|
type: "tool_result";
|
|
1089
1098
|
toolName: string;
|
|
1090
1099
|
toolId: string;
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
output: string | Record<string, unknown>[];
|
|
1100
|
+
output: string;
|
|
1101
|
+
contentBlocks?: ToolResultContentBlock[];
|
|
1094
1102
|
isError: boolean;
|
|
1095
1103
|
elapsed: number;
|
|
1096
1104
|
} | {
|
|
@@ -2195,8 +2203,9 @@ declare function ensureToolPairing(messages: Message[]): Message[];
|
|
|
2195
2203
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
2196
2204
|
* SOFTWARE.
|
|
2197
2205
|
*/
|
|
2206
|
+
declare const MAX_HISTORY_ENTRIES = 200;
|
|
2198
2207
|
declare function load(dir: string): string[];
|
|
2199
|
-
declare function append(dir: string, text: string):
|
|
2208
|
+
declare function append(dir: string, text: string): string[];
|
|
2200
2209
|
|
|
2201
2210
|
type SaveClipboardImageResult = {
|
|
2202
2211
|
ok: true;
|
|
@@ -2429,11 +2438,7 @@ interface MCPTool {
|
|
|
2429
2438
|
description: string;
|
|
2430
2439
|
inputSchema: ToolSchema["input_schema"];
|
|
2431
2440
|
}
|
|
2432
|
-
|
|
2433
|
-
* text when there is no image, otherwise provider-style content blocks
|
|
2434
|
-
* (leading text block + image blocks). Oversized images are resized and
|
|
2435
|
-
* recompressed through the shared image pipeline. */
|
|
2436
|
-
declare function mcpContentToToolOutput(content: unknown[]): Promise<string | Record<string, unknown>[]>;
|
|
2441
|
+
declare function mcpContentToToolOutput(content: unknown[]): Promise<Pick<ToolResult, "output" | "contentBlocks">>;
|
|
2437
2442
|
declare class MCPClient {
|
|
2438
2443
|
name: string;
|
|
2439
2444
|
private config;
|
|
@@ -2443,14 +2448,8 @@ declare class MCPClient {
|
|
|
2443
2448
|
connect(): Promise<void>;
|
|
2444
2449
|
getInstructions(): string;
|
|
2445
2450
|
listTools(): Promise<MCPTool[]>;
|
|
2446
|
-
/** Calls a tool and
|
|
2447
|
-
|
|
2448
|
-
* Image content blocks pass through as provider-style blocks instead of
|
|
2449
|
-
* being flattened to JSON text. */
|
|
2450
|
-
callTool(name: string, args: Record<string, unknown>): Promise<{
|
|
2451
|
-
output: string | Record<string, unknown>[];
|
|
2452
|
-
isError: boolean;
|
|
2453
|
-
}>;
|
|
2451
|
+
/** Calls a tool and preserves both its text fallback and provider-native rich content. */
|
|
2452
|
+
callTool(name: string, args: Record<string, unknown>): Promise<ToolResult>;
|
|
2454
2453
|
disconnect(): Promise<void>;
|
|
2455
2454
|
}
|
|
2456
2455
|
|
|
@@ -4305,6 +4304,9 @@ declare function loadTranscript(workDir: string, teamName: string, agentId: stri
|
|
|
4305
4304
|
* SOFTWARE.
|
|
4306
4305
|
*/
|
|
4307
4306
|
|
|
4307
|
+
declare const TOOL_RESULT_PREVIEW_CHARS = 2000;
|
|
4308
|
+
declare function toDisplayPreview(content: string): string;
|
|
4309
|
+
declare function replaceToolResultContent(result: ToolResultBlock, content: string): void;
|
|
4308
4310
|
/**
|
|
4309
4311
|
* Determine whether a tool call is reading back a file under the spill
|
|
4310
4312
|
* directory. Such results are not spilled: writing the model's freshly-read
|
|
@@ -4899,12 +4901,7 @@ declare class WriteFileTool implements Tool {
|
|
|
4899
4901
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
4900
4902
|
* SOFTWARE.
|
|
4901
4903
|
*/
|
|
4902
|
-
|
|
4903
|
-
/**
|
|
4904
|
-
* Convert a ToolResultBlock content value (string or ContentBlockParam[]) to a
|
|
4905
|
-
* plain text string. Used by consumers that cannot handle structured blocks
|
|
4906
|
-
* (session persistence, TUI display, OpenAI Responses API, etc.).
|
|
4907
|
-
*/
|
|
4904
|
+
/** Convert message or legacy-session blocks to a base64-free text fallback. */
|
|
4908
4905
|
declare function contentToText(content: string | Record<string, unknown>[]): string;
|
|
4909
4906
|
declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
4910
4907
|
declare function asRecord(value: unknown): Record<string, unknown>;
|
|
@@ -5347,4 +5344,4 @@ declare class TaskUpdateTool implements Tool {
|
|
|
5347
5344
|
execute(ctx: ToolContext, args: Record<string, unknown>): Promise<ToolResult>;
|
|
5348
5345
|
}
|
|
5349
5346
|
|
|
5350
|
-
export { ASYNC_AGENT_ALLOWED_TOOLS, Agent, type AgentConfig, type AgentDefinition, type AgentEvent, type AgentEventCallback, AgentEventLogger, type AgentEventSink, type AgentProgress, AgentProgressSchema, type AgentTask, AgentTool, AnthropicClient, type AppConfig, AskUserQuestionTool, type Asker, AuthenticationError, AutoCompactTrackingState, BASH_DESCRIPTION, BUILTIN_AGENTS, type Backup, BashTool, BwrapSandbox, CHARS_PER_TOKEN, COMPACT_BOUNDARY, CUSTOM_AGENT_DISALLOWED_TOOLS, CodeReviewManager, type CodeReviewMember, type CodeReviewTeam, type Command, type CommandContext, CommandRegistry, type CommandType, CommandUsageTracker, type CommentIssue, type CommentResolution, type CompactBoundaryPayload, type CompactResult, ConfigError, type ConnectResult, ContextTooLongError, ConversationManager, type CriticAssessment, type CriticEvaluation,
|
|
5347
|
+
export { ASYNC_AGENT_ALLOWED_TOOLS, Agent, type AgentConfig, type AgentDefinition, type AgentEvent, type AgentEventCallback, AgentEventLogger, type AgentEventSink, type AgentProgress, AgentProgressSchema, type AgentTask, AgentTool, AnthropicClient, type AppConfig, AskUserQuestionTool, type Asker, AuthenticationError, AutoCompactTrackingState, BASH_DESCRIPTION, BUILTIN_AGENTS, type Backup, BashTool, BwrapSandbox, CHARS_PER_TOKEN, COMPACT_BOUNDARY, CUSTOM_AGENT_DISALLOWED_TOOLS, CodeReviewManager, type CodeReviewMember, type CodeReviewTeam, type Command, type CommandContext, CommandRegistry, type CommandType, CommandUsageTracker, type CommentIssue, type CommentResolution, type CompactBoundaryPayload, type CompactResult, ConfigError, type ConnectResult, ContextTooLongError, ConversationManager, type CriticAssessment, type CriticEvaluation, DEFAULT_EAGER_THRESHOLD_PERCENT, type Decision, type DecisionEffect, type DetectedIde, type DiffResult, EDIT_FILE_DESCRIPTION, EditFileTool, EnterWorktreeTool, type EnvironmentContext, type EventLogger, type EventName, ExitPlanModeTool, ExitWorktreeTool, FORK_QUERY_SOURCE, type FileFeedback, FileHistory, type FileMailMessage, FileMailbox, FileStateCache, GLOB_DESCRIPTION, GREP_DESCRIPTION, GlobTool, GrepTool, type HookConfig, HookConfigSchema, type HookContext, HookEngine, type HookResult, INTERRUPTED_TOOL_RESULT, type IdeAtMention, type IdeConnection, ImageTooLargeError, InstallSkillTool, type InstructionSource, type KeptMessage, type LLMClient, LLMError, ListTeamsTool, LoadSkillTool, MAX_DIMENSION_PX, MAX_HISTORY_ENTRIES, MAX_IMAGES_PER_MESSAGE, MAX_IMAGE_BYTES_PASSTHROUGH, MCPClient, MCPManager, type MCPServerConfig, type MCPTool, type MCPToolLike, MCPToolWrapper, MCP_CALL_TOOL_NAME, MCP_NAME_SEP, MCP_TOOL_PREFIX, MSG_PLAN_APPROVAL_REQUEST, MSG_PLAN_APPROVAL_RESPONSE, MSG_SHUTDOWN_REQUEST, MSG_SHUTDOWN_RESPONSE, MSG_TEXT, type MaxTokensSetter, McpCallTool, type McpLoadingMode, type Member, MemoryConsolidator, MemoryExtractor, type MemoryFile, type MemoryHeader, MemoryManager, type Message, NATIVE_TOOL_USE_BETA, NameRegistry, NetworkError, OpenAIClient, OpenAICompatClient, type OpenAIMessageParam, POWERSHELL_DESCRIPTION, PathSandbox, PermissionChecker, type PermissionMode, PowerShellTool, type PrintArgs, PromptBuilder, type ProviderConfig, ProviderConfigSchema, type Question, type QuestionOption, READ_FILE_DESCRIPTION, REJECTED_TOOL_RESULT, RateLimitError, ReadFileTool, type RecallResult, RecoveryState, type RelevantMemory, type RemoteAgentHandle, RemoteServer, type RestoredMessage, type ReviewComment, type ReviewRequest, ReviewSession, type ReviewSummary, RuleEngine, type RunAgent, type RunCallbacks, SHUTDOWN_PREFIX, SKIP_DIRS, SUBAGENT_DISALLOWED_TOOLS, type Sandbox, type SandboxConfig, type SandboxYamlConfig, type SaveClipboardImageResult, SeatbeltSandbox, type Section, SendMessageTool, type SessionInfo, type SessionMessage, type SharedTask, SharedTaskStore, type Skill, SkillCatalog, type SkillForkHost, type SkillHost, type SkillMeta, type Snapshot, type SpawnConfig, SpawnTeammateTool, type Task$1 as StoredTask, type StreamEvent, StreamingExecutor, SyntheticOutputTool, TEAMMATE_DISALLOWED_TOOLS, TOOL_RESULT_PREVIEW_CHARS, TOOL_SEARCH_TOOL_NAME, type Task, TaskCreateTool$1 as TaskCreateTool, TaskGetTool$1 as TaskGetTool, TaskList, TaskListTool$1 as TaskListTool, TaskManager, type TaskStatus, TaskStopTool, TaskStore, type TaskUpdateFields, TaskUpdateTool$1 as TaskUpdateTool, Team, TeamCreateTool, TeamDeleteTool, type TeamFile, TeamManager, type TeamMemberEntry, TeamMemberEntrySchema, type TeamMode, TaskCreateTool as TeamTaskCreateTool, TaskGetTool as TeamTaskGetTool, TaskListTool as TeamTaskListTool, TaskUpdateTool as TeamTaskUpdateTool, type TeammateUIState, TeammateUIStateSchema, type ThinkingBlock, type Tool, type ToolActivity, ToolActivitySchema, type ToolCategory, type ToolContext, ToolRegistry, type ToolResult, type ToolResultBlock, type ToolResultContentBlock, type ToolResultRecord, type ToolSchema, ToolSearchTool, type ToolUseBlock, type ToolUseRecord, type TranscriptEntry, type UsageAnchor, type UsageInfo, WRITE_FILE_DESCRIPTION, WebSocketTransport, type WorktreeResult, WriteFileTool, _resetContextWindowCache, append, applyBudget, applyMode, approved, asCriticEvaluation, asError, asErrorString, asImageMediaType, asRecord, asString, boolArg, buildAnthropicMessages, buildChatCompletionMessages, buildDiff, buildMcpToolName, buildOpenAIInput, buildPlanModeExitReminder, buildPlanModeReentryReminder, buildPlanModeReminder, buildSkillSection, buildSystemPrompt, buildTeammateRegistry, buildWorktreeNotice, cleanExpiredSessions, clipboardImageFileName, cloneRegistryForFork, closeLogger, coerceBySchema, computeCompactThreshold, computeKeepStartIndex, connectToIde, contentToText, coordinatorActive, coordinatorReminder, coordinatorToolFilter, createAgentWorktree, createChildLogger, createClient, createDefaultCodeReviewTeam, createDefaultRegistry, createModelResolver, createProgress, createRemoteAgent, createSandbox, currentContextTokens, decideAndApply, decideMode, detectBackend, detectBackendFromEnv, detectEnvironment, detectIde, discoverInstructions, doingTasksSection, ensureToolPairing, environmentSection, estimateMessages, estimateSchemaTokens, estimateTokens, evaluateRules, executingActionsSection, expandAtRefs, expandAtRefsWithImages, extractContent, fetchModelContextWindow, fileHistoryDir, filterToolsForAgent, forceCompact, forkEnabled, formatTokens, getContextWindow, getContextWindowAsync, getCurrentBranch, getCurrentPlanPath, getMaxOutputTokens, getMediaType, getNameRegistry, getOrCreatePlanPath, getSessionFilePath, handleCodeReviewCommand, hasWorktreeChanges, identitySection, initLogger, intArg, isCoordinatorTool, isCriticEvaluation, isDiffTool, isImagePath, isMcpToolLike, isObject, isOfficialAnthropicEndpoint, isPngBuffer, isRecord, isSafeCommand, isShutdownRequest, isSpillReadback, isToolResultContentBlock, listSessions, load, loadAgentDefinitions, loadConfig, loadImageAttachment, loadInstructions, loadPlan, loadSession, loadTranscript, loadUserCommands, logger, lookupModelContextWindow, manageContext, markLastUserTailForCache, markToolsForCache, maybeResizeAndDownsampleImage, mcpCallPermissionContent, mcpContentToToolOutput, mcpToolNamePrefix, measureSchemaChars, memoryAge, memoryAgeDays, memoryFreshnessText, mergeConfig, needsToolSearchBeta, newRequestId, newSessionId, normalizeToolResultContentBlock, outputEfficiencySection, parse, parsePrintFlags, parseTeammateFlags, persistLargeResult, planApprovalRequest, planApprovalResponse, planExists, quickSort, randomCompletionVerb, randomVerb, readTeamFile, readWorktreeHeadSha, rebuildFromSession, record, recordError, recordExit, recordTokens, recordToolUse, recover, removeAgentWorktree, renderBody, replaceToolResultContent, resetPlanPath, resolveAPIKey, resolveGitDir, resolveModelId, runFork, runInline, runPrintMode, runTeammate, safeJSONParse, sanitizeNameSegment, sanitizeSegment, sanitizeTeamName, saveClipboardImage, saveCompactBoundary, saveMessage, savePlan, saveTranscript, shutdownRequest, shutdownResponse, sniffMediaType, spawnSubagent, spawnTeammate, storeClipboardImage, strArg, strList, summarizeActivities, systemSection, teamConfigPath, teamDir, teamsBaseDir, toDisplayPreview, toTry, toneStyleSection, toolResultsToRecords, toolUsesToRecords, usingToolsSection, validate, version, writeTeamFile };
|