@swifty.js/swifty 0.0.35 → 0.0.37
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/README.md +8 -8
- package/dist/{acp-A4KRKOHD.js → acp-R22FJPVN.js} +1 -1
- package/dist/{agent-VDWIGFIV.js → agent-WOWGQDBG.js} +1 -1
- package/dist/anthropic-3DXT42SN.js +4 -0
- package/dist/{chunk-4B4SGVJH.js → chunk-ENZ5LHRN.js} +23 -23
- package/dist/chunk-FOPUR6OB.js +610 -0
- package/dist/{chunk-IOLGXPUQ.js → chunk-LW273HD5.js} +1 -1
- package/dist/{chunk-TNF3EHFY.js → chunk-QBGGDF62.js} +1 -1
- package/dist/{chunk-TOM34LJB.js → chunk-R62BGTT4.js} +17 -17
- package/dist/chunk-S2VEXEVV.js +4 -0
- package/dist/{chunk-H56UQALW.js → chunk-VN7HK3YD.js} +1 -1
- package/dist/lib/{agent-TC4HSVMS.js → agent-ZSFK66FQ.js} +2 -2
- package/dist/lib/{anthropic-FKIGL7NL.js → anthropic-GD3ILYG6.js} +1 -1
- package/dist/lib/{chunk-S5VWPTME.js → chunk-5OJV33Y2.js} +37 -14
- package/dist/lib/{chunk-RUDYC7OS.js → chunk-BHSNJT6Z.js} +1 -1
- package/dist/lib/{chunk-LRN4MOQ3.js → chunk-GWZDEU27.js} +0 -5
- package/dist/lib/{chunk-ALQHMYOZ.js → chunk-LKFJIK6F.js} +0 -3
- package/dist/lib/{chunk-OJTISIYU.js → chunk-O35GIE35.js} +1 -1
- package/dist/lib/{chunk-6V7RW6HA.js → chunk-TD7Z6L4D.js} +10 -13
- package/dist/lib/index.d.ts +689 -563
- package/dist/lib/index.js +1153 -729
- package/dist/lib/{openai-ZWIYIBLC.js → openai-N6X7XUQJ.js} +1 -1
- package/dist/lib/{permissions-BW4QPZXV.js → permissions-77UJQITR.js} +1 -1
- package/dist/lib/{providers-ROWSB6ND.js → providers-WQ3UOLMF.js} +1 -1
- package/dist/lib/{tool-filter-QU4LOZII.js → tool-filter-S3ZZOXFD.js} +1 -1
- package/dist/main.js +154 -153
- package/dist/{openai-7LMX5HKW.js → openai-XMJVVTTX.js} +1 -1
- package/dist/{providers-2J4JJYQD.js → providers-NWLGMQOZ.js} +1 -1
- package/dist/{server-ZYK4L22D.js → server-TINTK5DM.js} +1 -1
- package/dist/{tool-filter-U5SSL3LR.js → tool-filter-QETBQPHL.js} +1 -1
- package/package.json +2 -2
- package/dist/anthropic-AR2Y4FBR.js +0 -4
- package/dist/chunk-F4FOFPKL.js +0 -611
- package/dist/chunk-UJGMTIYO.js +0 -4
package/dist/lib/index.d.ts
CHANGED
|
@@ -2,11 +2,9 @@ import * as acp from '@agentclientprotocol/sdk';
|
|
|
2
2
|
import { InitializeRequest, InitializeResponse, NewSessionRequest, NewSessionResponse, LoadSessionRequest, ResumeSessionRequest, ListSessionsRequest, ListSessionsResponse, PromptRequest, AgentRequestContext, PromptResponse, CancelNotification, CloseSessionRequest, AgentApp, Usage, SessionUpdate, SessionNotification, ContentBlock, StopReason, ToolKind, ToolCallLocation } from '@agentclientprotocol/sdk';
|
|
3
3
|
import z, { z as z$1 } from 'zod';
|
|
4
4
|
import Anthropic from '@anthropic-ai/sdk';
|
|
5
|
-
import { BetaToolComputerUse20251124 } from '@anthropic-ai/sdk/resources/beta/messages/messages';
|
|
6
5
|
import OpenAI from 'openai';
|
|
7
6
|
import { Logger } from 'pino';
|
|
8
7
|
import { SandboxRuntimeConfig } from '@anthropic-ai/sandbox-runtime';
|
|
9
|
-
import * as react from 'react';
|
|
10
8
|
import { Transport } from '@modelcontextprotocol/sdk/shared/transport.js';
|
|
11
9
|
import { JSONRPCMessage } from '@modelcontextprotocol/sdk/types.js';
|
|
12
10
|
|
|
@@ -37,7 +35,7 @@ interface UsageInfo {
|
|
|
37
35
|
cacheReadInputTokens: number;
|
|
38
36
|
cacheCreationInputTokens: number;
|
|
39
37
|
}
|
|
40
|
-
/**
|
|
38
|
+
/** Events emitted by an LLM stream: text/thinking deltas, tool-call lifecycle, and stream end. */
|
|
41
39
|
type StreamEvent = {
|
|
42
40
|
type: "text_delta";
|
|
43
41
|
text: string;
|
|
@@ -169,13 +167,13 @@ declare class FileHistory {
|
|
|
169
167
|
save(): void;
|
|
170
168
|
}
|
|
171
169
|
|
|
172
|
-
type index$
|
|
173
|
-
type index$
|
|
174
|
-
declare const index$
|
|
175
|
-
type index$
|
|
176
|
-
declare const index$
|
|
177
|
-
declare namespace index$
|
|
178
|
-
export { type index$
|
|
170
|
+
type index$v_Backup = Backup;
|
|
171
|
+
type index$v_FileHistory = FileHistory;
|
|
172
|
+
declare const index$v_FileHistory: typeof FileHistory;
|
|
173
|
+
type index$v_Snapshot = Snapshot;
|
|
174
|
+
declare const index$v_fileHistoryDir: typeof fileHistoryDir;
|
|
175
|
+
declare namespace index$v {
|
|
176
|
+
export { type index$v_Backup as Backup, index$v_FileHistory as FileHistory, type index$v_Snapshot as Snapshot, index$v_fileHistoryDir as fileHistoryDir };
|
|
179
177
|
}
|
|
180
178
|
|
|
181
179
|
/**
|
|
@@ -253,26 +251,120 @@ declare class PermissionChecker {
|
|
|
253
251
|
allowAlways(toolName: string, args: Record<string, unknown>): void;
|
|
254
252
|
/**
|
|
255
253
|
* Generate a human-readable description of the tool action for display in HITL confirmation dialogs.
|
|
256
|
-
* Prioritizes extracting fields defined in
|
|
254
|
+
* Prioritizes extracting fields defined in CONTENT_FIELDS (e.g., command, file_path);
|
|
257
255
|
* falls back to a key:value summary of parameters if no match is found.
|
|
258
256
|
*/
|
|
259
257
|
describeToolAction(toolName: string, args: Record<string, unknown>): string;
|
|
260
258
|
}
|
|
261
259
|
|
|
262
|
-
type index$
|
|
263
|
-
type index$
|
|
264
|
-
type index$
|
|
265
|
-
declare const index$
|
|
266
|
-
type index$
|
|
267
|
-
declare const index$
|
|
268
|
-
type index$
|
|
269
|
-
type index$
|
|
270
|
-
declare const index$
|
|
271
|
-
declare const index$
|
|
272
|
-
declare const index$
|
|
273
|
-
declare const index$
|
|
274
|
-
declare namespace index$
|
|
275
|
-
export { type index$
|
|
260
|
+
type index$u_Decision = Decision;
|
|
261
|
+
type index$u_DecisionEffect = DecisionEffect;
|
|
262
|
+
type index$u_PathSandbox = PathSandbox;
|
|
263
|
+
declare const index$u_PathSandbox: typeof PathSandbox;
|
|
264
|
+
type index$u_PermissionChecker = PermissionChecker;
|
|
265
|
+
declare const index$u_PermissionChecker: typeof PermissionChecker;
|
|
266
|
+
type index$u_PermissionMode = PermissionMode;
|
|
267
|
+
type index$u_RuleEngine = RuleEngine;
|
|
268
|
+
declare const index$u_RuleEngine: typeof RuleEngine;
|
|
269
|
+
declare const index$u_evaluateRules: typeof evaluateRules;
|
|
270
|
+
declare const index$u_extractContent: typeof extractContent;
|
|
271
|
+
declare const index$u_isSafeCommand: typeof isSafeCommand;
|
|
272
|
+
declare namespace index$u {
|
|
273
|
+
export { type index$u_Decision as Decision, type index$u_DecisionEffect as DecisionEffect, index$u_PathSandbox as PathSandbox, index$u_PermissionChecker as PermissionChecker, type index$u_PermissionMode as PermissionMode, index$u_RuleEngine as RuleEngine, index$u_evaluateRules as evaluateRules, index$u_extractContent as extractContent, index$u_isSafeCommand as isSafeCommand };
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Copyright (c) 2026 hangtiancheng
|
|
278
|
+
*
|
|
279
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
280
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
281
|
+
* in the Software without restriction, including without limitation the rights
|
|
282
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
283
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
284
|
+
* furnished to do so, subject to the following conditions:
|
|
285
|
+
*
|
|
286
|
+
* The above copyright notice and this permission notice shall be included in
|
|
287
|
+
* all copies or substantial portions of the Software.
|
|
288
|
+
*
|
|
289
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
290
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
291
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
292
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
293
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
294
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
295
|
+
* SOFTWARE.
|
|
296
|
+
*/
|
|
297
|
+
type AgentTaskStatus = "running" | "completed" | "failed" | "cancelled";
|
|
298
|
+
/**
|
|
299
|
+
* What a task wraps. Hosts use this to wait selectively: print-mode blocks on
|
|
300
|
+
* agent tasks (their results feed the final answer) but must not block on
|
|
301
|
+
* shell/js tasks, which can run indefinitely (dev servers) and are killed at
|
|
302
|
+
* exit instead. Absent kind means "agent" (the original TaskManager use).
|
|
303
|
+
*/
|
|
304
|
+
type TaskKind = "agent" | "shell" | "js";
|
|
305
|
+
interface AgentTask {
|
|
306
|
+
id: string;
|
|
307
|
+
name: string;
|
|
308
|
+
originToolCallId?: string;
|
|
309
|
+
kind?: TaskKind;
|
|
310
|
+
status: AgentTaskStatus;
|
|
311
|
+
output: string;
|
|
312
|
+
cancel: () => void;
|
|
313
|
+
done: Promise<void>;
|
|
314
|
+
}
|
|
315
|
+
interface CreateTaskOptions {
|
|
316
|
+
originToolCallId?: string;
|
|
317
|
+
/** ID prefix; defaults to "agent" (background subagents). Bash background tasks use "bash". */
|
|
318
|
+
idPrefix?: string;
|
|
319
|
+
/** Task category; defaults to "agent". */
|
|
320
|
+
kind?: TaskKind;
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* A runner failure that carries its own pre-formatted output. TaskManager
|
|
324
|
+
* stores `output` verbatim on the failed task instead of the generic
|
|
325
|
+
* `Error: <message>` wrapper, so tool-level results (e.g. a background Bash
|
|
326
|
+
* command's captured output and exit code) reach the notification intact.
|
|
327
|
+
*/
|
|
328
|
+
declare class TaskFailure extends Error {
|
|
329
|
+
readonly output: string;
|
|
330
|
+
constructor(output: string);
|
|
331
|
+
}
|
|
332
|
+
declare class TaskManager {
|
|
333
|
+
private tasks;
|
|
334
|
+
private notifiedTaskIds;
|
|
335
|
+
private listeners;
|
|
336
|
+
private nextId;
|
|
337
|
+
private pendingTaskIds;
|
|
338
|
+
create(name: string, runner: (task: AgentTask) => Promise<string>, cancel: () => void, options?: CreateTaskOptions): AgentTask;
|
|
339
|
+
get(id: string): AgentTask | undefined;
|
|
340
|
+
list(): AgentTask[];
|
|
341
|
+
subscribe(listener: (tasks: AgentTask[]) => void): () => void;
|
|
342
|
+
private emitChange;
|
|
343
|
+
hasRunning(): boolean;
|
|
344
|
+
stop(id: string): boolean;
|
|
345
|
+
stopAndWait(id: string): Promise<boolean>;
|
|
346
|
+
stopAll(): Promise<void>;
|
|
347
|
+
/**
|
|
348
|
+
* Wait for tasks to settle. An optional filter selects which tasks to wait
|
|
349
|
+
* for (e.g. print-mode waits only for agent-kind tasks: shell/js tasks may
|
|
350
|
+
* run indefinitely and are stopped, not awaited, at exit).
|
|
351
|
+
*/
|
|
352
|
+
waitAll(filter?: (task: AgentTask) => boolean): Promise<void>;
|
|
353
|
+
drainNotifications(): AgentTask[];
|
|
354
|
+
clear(): void;
|
|
355
|
+
}
|
|
356
|
+
declare function formatAgentTaskNotification(task: AgentTask): string;
|
|
357
|
+
|
|
358
|
+
type taskManager_AgentTask = AgentTask;
|
|
359
|
+
type taskManager_AgentTaskStatus = AgentTaskStatus;
|
|
360
|
+
type taskManager_TaskFailure = TaskFailure;
|
|
361
|
+
declare const taskManager_TaskFailure: typeof TaskFailure;
|
|
362
|
+
type taskManager_TaskKind = TaskKind;
|
|
363
|
+
type taskManager_TaskManager = TaskManager;
|
|
364
|
+
declare const taskManager_TaskManager: typeof TaskManager;
|
|
365
|
+
declare const taskManager_formatAgentTaskNotification: typeof formatAgentTaskNotification;
|
|
366
|
+
declare namespace taskManager {
|
|
367
|
+
export { type taskManager_AgentTask as AgentTask, type taskManager_AgentTaskStatus as AgentTaskStatus, taskManager_TaskFailure as TaskFailure, type taskManager_TaskKind as TaskKind, taskManager_TaskManager as TaskManager, taskManager_formatAgentTaskNotification as formatAgentTaskNotification };
|
|
276
368
|
}
|
|
277
369
|
|
|
278
370
|
/**
|
|
@@ -312,6 +404,22 @@ interface ToolContext {
|
|
|
312
404
|
workDir: string;
|
|
313
405
|
toolCallId?: string;
|
|
314
406
|
backgroundTaskId?: string;
|
|
407
|
+
/**
|
|
408
|
+
* Owning session, when the call runs on the main thread. Lets tools persist
|
|
409
|
+
* auxiliary artifacts (e.g. a backgrounded Bash command's output) into the
|
|
410
|
+
* session's tool-results spill directory so the model can Read them back.
|
|
411
|
+
*/
|
|
412
|
+
sessionId?: string;
|
|
413
|
+
/**
|
|
414
|
+
* Background task registry of the loop running this call. Subagent loops
|
|
415
|
+
* inject their own manager so backgrounded Bash commands notify that loop
|
|
416
|
+
* instead of the main thread; tools fall back to their host-wired default
|
|
417
|
+
* when absent. Explicit `null` disables backgrounding for this call even
|
|
418
|
+
* when the tool instance carries a host-wired manager (in-process teammate
|
|
419
|
+
* turns use this: their per-turn drain disappears at turn end, so commands
|
|
420
|
+
* backgrounded there could never deliver a notification).
|
|
421
|
+
*/
|
|
422
|
+
taskManager?: TaskManager | null;
|
|
315
423
|
abortSignal?: AbortSignal;
|
|
316
424
|
fileHistory?: FileHistory | undefined;
|
|
317
425
|
fileStateCache?: FileStateCache | undefined;
|
|
@@ -357,7 +465,6 @@ interface ToolSchema {
|
|
|
357
465
|
required?: string[];
|
|
358
466
|
[keyword: string]: unknown;
|
|
359
467
|
};
|
|
360
|
-
allowed_callers?: ("direct" | "code_execution_20250825" | "code_execution_20260120")[];
|
|
361
468
|
cache_control?: {
|
|
362
469
|
type: "ephemeral";
|
|
363
470
|
ttl?: "5m" | "1h";
|
|
@@ -365,11 +472,10 @@ interface ToolSchema {
|
|
|
365
472
|
eager_input_streaming?: boolean;
|
|
366
473
|
}
|
|
367
474
|
type ToolProtocol = "anthropic" | "openai" | "openai-compat";
|
|
368
|
-
type AnthropicToolSchema = ToolSchema | Anthropic.Tool
|
|
369
|
-
type OpenAIResponsesToolSchema = OpenAI.Responses.FunctionTool
|
|
475
|
+
type AnthropicToolSchema = ToolSchema | Anthropic.Tool;
|
|
476
|
+
type OpenAIResponsesToolSchema = OpenAI.Responses.FunctionTool;
|
|
370
477
|
type OpenAICompatToolSchema = OpenAI.ChatCompletionFunctionTool;
|
|
371
478
|
type ProviderToolSchema = ToolSchema | AnthropicToolSchema | OpenAIResponsesToolSchema | OpenAICompatToolSchema;
|
|
372
|
-
type ProviderNativeToolSchema = BetaToolComputerUse20251124 | OpenAI.Responses.ComputerTool;
|
|
373
479
|
interface Tool {
|
|
374
480
|
name: string;
|
|
375
481
|
description: string;
|
|
@@ -388,20 +494,15 @@ interface Tool {
|
|
|
388
494
|
* trip, so they are never deferred and always ship their full schema.
|
|
389
495
|
*/
|
|
390
496
|
deferred?: boolean;
|
|
391
|
-
/**
|
|
392
|
-
* Return a provider-native declaration when the protocol supports this tool
|
|
393
|
-
* natively. Returning undefined lets the registry serialize schema() as a
|
|
394
|
-
* regular custom/function tool.
|
|
395
|
-
*/
|
|
396
|
-
providerSchema?(protocol: ToolProtocol): ProviderNativeToolSchema | undefined;
|
|
397
497
|
/**
|
|
398
498
|
* Whether this particular invocation can run concurrently with others,
|
|
399
499
|
* judged by actual arguments rather than just the tool category.
|
|
400
500
|
*
|
|
401
501
|
* When not implemented, falls back to category: read-only tools may run
|
|
402
|
-
* concurrently, write and command tools may not. Currently
|
|
403
|
-
*
|
|
404
|
-
*
|
|
502
|
+
* concurrently, write and command tools may not. Currently Bash
|
|
503
|
+
* (argument-dependent: ls vs rm are both Bash but have very different safety
|
|
504
|
+
* profiles) and ComputerUse (always false — it drives a single physical
|
|
505
|
+
* screen/mouse/keyboard) implement this.
|
|
405
506
|
*/
|
|
406
507
|
isConcurrencySafe?(args: Record<string, unknown>): boolean;
|
|
407
508
|
schema(): ToolSchema;
|
|
@@ -415,7 +516,6 @@ type types_McpLoadingMode = McpLoadingMode;
|
|
|
415
516
|
type types_OpenAICompatToolSchema = OpenAICompatToolSchema;
|
|
416
517
|
type types_OpenAIResponsesToolSchema = OpenAIResponsesToolSchema;
|
|
417
518
|
type types_PermissionRequestHandler = PermissionRequestHandler;
|
|
418
|
-
type types_ProviderNativeToolSchema = ProviderNativeToolSchema;
|
|
419
519
|
type types_ProviderToolSchema = ProviderToolSchema;
|
|
420
520
|
declare const types_SKIP_DIRS: typeof SKIP_DIRS;
|
|
421
521
|
type types_Tool = Tool;
|
|
@@ -428,7 +528,7 @@ type types_ToolSchema = ToolSchema;
|
|
|
428
528
|
declare const types_isToolResultContentBlock: typeof isToolResultContentBlock;
|
|
429
529
|
declare const types_normalizeToolResultContentBlock: typeof normalizeToolResultContentBlock;
|
|
430
530
|
declare namespace types {
|
|
431
|
-
export { type types_AnthropicToolSchema as AnthropicToolSchema, type types_MCPToolLike as MCPToolLike, type types_McpLoadingMode as McpLoadingMode, type types_OpenAICompatToolSchema as OpenAICompatToolSchema, type types_OpenAIResponsesToolSchema as OpenAIResponsesToolSchema, type types_PermissionRequestHandler as PermissionRequestHandler, type
|
|
531
|
+
export { type types_AnthropicToolSchema as AnthropicToolSchema, type types_MCPToolLike as MCPToolLike, type types_McpLoadingMode as McpLoadingMode, type types_OpenAICompatToolSchema as OpenAICompatToolSchema, type types_OpenAIResponsesToolSchema as OpenAIResponsesToolSchema, type types_PermissionRequestHandler as PermissionRequestHandler, type types_ProviderToolSchema as ProviderToolSchema, types_SKIP_DIRS as SKIP_DIRS, type types_Tool as Tool, type types_ToolCategory as ToolCategory, type types_ToolContext as ToolContext, type types_ToolProtocol as ToolProtocol, type types_ToolResult as ToolResult, type types_ToolResultContentBlock as ToolResultContentBlock, type types_ToolSchema as ToolSchema, types_isToolResultContentBlock as isToolResultContentBlock, types_normalizeToolResultContentBlock as normalizeToolResultContentBlock };
|
|
432
532
|
}
|
|
433
533
|
|
|
434
534
|
/**
|
|
@@ -594,14 +694,14 @@ declare class ConversationManager {
|
|
|
594
694
|
} | null;
|
|
595
695
|
}
|
|
596
696
|
|
|
597
|
-
type index$
|
|
598
|
-
declare const index$
|
|
599
|
-
type index$
|
|
600
|
-
type index$
|
|
601
|
-
type index$
|
|
602
|
-
type index$
|
|
603
|
-
declare namespace index$
|
|
604
|
-
export { atExpand as AtExpand, index$
|
|
697
|
+
type index$t_ConversationManager = ConversationManager;
|
|
698
|
+
declare const index$t_ConversationManager: typeof ConversationManager;
|
|
699
|
+
type index$t_Message = Message;
|
|
700
|
+
type index$t_ThinkingBlock = ThinkingBlock;
|
|
701
|
+
type index$t_ToolResultBlock = ToolResultBlock;
|
|
702
|
+
type index$t_ToolUseBlock = ToolUseBlock;
|
|
703
|
+
declare namespace index$t {
|
|
704
|
+
export { atExpand as AtExpand, index$t_ConversationManager as ConversationManager, type index$t_Message as Message, pairing as Pairing, type index$t_ThinkingBlock as ThinkingBlock, type index$t_ToolResultBlock as ToolResultBlock, type index$t_ToolUseBlock as ToolUseBlock };
|
|
605
705
|
}
|
|
606
706
|
|
|
607
707
|
/**
|
|
@@ -735,31 +835,32 @@ declare function rebuildFromSession(saved: SessionMessage[]): RestoredMessage[];
|
|
|
735
835
|
declare function listSessions(workDir: string): SessionInfo[];
|
|
736
836
|
/**
|
|
737
837
|
* Cleans up expired sessions: deletes .jsonl files whose last modified time exceeds SESSION_EXPIRY_DAYS.
|
|
738
|
-
*
|
|
838
|
+
* Not currently invoked anywhere; intended to run during listSessions or on
|
|
839
|
+
* startup to prevent the session directory from growing indefinitely.
|
|
739
840
|
* Silently skips failures (best-effort).
|
|
740
841
|
*/
|
|
741
842
|
declare function cleanExpiredSessions(workDir: string): number;
|
|
742
843
|
|
|
743
|
-
declare const index$
|
|
744
|
-
type index$
|
|
745
|
-
type index$
|
|
746
|
-
type index$
|
|
747
|
-
type index$
|
|
748
|
-
type index$
|
|
749
|
-
type index$
|
|
750
|
-
type index$
|
|
751
|
-
declare const index$
|
|
752
|
-
declare const index$
|
|
753
|
-
declare const index$
|
|
754
|
-
declare const index$
|
|
755
|
-
declare const index$
|
|
756
|
-
declare const index$
|
|
757
|
-
declare const index$
|
|
758
|
-
declare const index$
|
|
759
|
-
declare const index$
|
|
760
|
-
declare const index$
|
|
761
|
-
declare namespace index$
|
|
762
|
-
export { index$
|
|
844
|
+
declare const index$s_COMPACT_BOUNDARY: typeof COMPACT_BOUNDARY;
|
|
845
|
+
type index$s_CompactBoundaryPayload = CompactBoundaryPayload;
|
|
846
|
+
type index$s_KeptMessage = KeptMessage;
|
|
847
|
+
type index$s_RestoredMessage = RestoredMessage;
|
|
848
|
+
type index$s_SessionInfo = SessionInfo;
|
|
849
|
+
type index$s_SessionMessage = SessionMessage;
|
|
850
|
+
type index$s_ToolResultRecord = ToolResultRecord;
|
|
851
|
+
type index$s_ToolUseRecord = ToolUseRecord;
|
|
852
|
+
declare const index$s_cleanExpiredSessions: typeof cleanExpiredSessions;
|
|
853
|
+
declare const index$s_getSessionFilePath: typeof getSessionFilePath;
|
|
854
|
+
declare const index$s_listSessions: typeof listSessions;
|
|
855
|
+
declare const index$s_loadSession: typeof loadSession;
|
|
856
|
+
declare const index$s_newSessionId: typeof newSessionId;
|
|
857
|
+
declare const index$s_rebuildFromSession: typeof rebuildFromSession;
|
|
858
|
+
declare const index$s_saveCompactBoundary: typeof saveCompactBoundary;
|
|
859
|
+
declare const index$s_saveMessage: typeof saveMessage;
|
|
860
|
+
declare const index$s_toolResultsToRecords: typeof toolResultsToRecords;
|
|
861
|
+
declare const index$s_toolUsesToRecords: typeof toolUsesToRecords;
|
|
862
|
+
declare namespace index$s {
|
|
863
|
+
export { index$s_COMPACT_BOUNDARY as COMPACT_BOUNDARY, type index$s_CompactBoundaryPayload as CompactBoundaryPayload, type index$s_KeptMessage as KeptMessage, type index$s_RestoredMessage as RestoredMessage, type index$s_SessionInfo as SessionInfo, type index$s_SessionMessage as SessionMessage, type index$s_ToolResultRecord as ToolResultRecord, type index$s_ToolUseRecord as ToolUseRecord, index$s_cleanExpiredSessions as cleanExpiredSessions, index$s_getSessionFilePath as getSessionFilePath, index$s_listSessions as listSessions, index$s_loadSession as loadSession, index$s_newSessionId as newSessionId, index$s_rebuildFromSession as rebuildFromSession, index$s_saveCompactBoundary as saveCompactBoundary, index$s_saveMessage as saveMessage, index$s_toolResultsToRecords as toolResultsToRecords, index$s_toolUsesToRecords as toolUsesToRecords };
|
|
763
864
|
}
|
|
764
865
|
|
|
765
866
|
/**
|
|
@@ -1048,11 +1149,11 @@ type AcpMode = {
|
|
|
1048
1149
|
declare function parseAcpMode(args: string[]): AcpMode | null;
|
|
1049
1150
|
declare function runAcp(args: string[]): Promise<void>;
|
|
1050
1151
|
|
|
1051
|
-
type index$
|
|
1052
|
-
declare const index$
|
|
1053
|
-
declare const index$
|
|
1054
|
-
declare namespace index$
|
|
1055
|
-
export { type index$
|
|
1152
|
+
type index$r_AcpMode = AcpMode;
|
|
1153
|
+
declare const index$r_parseAcpMode: typeof parseAcpMode;
|
|
1154
|
+
declare const index$r_runAcp: typeof runAcp;
|
|
1155
|
+
declare namespace index$r {
|
|
1156
|
+
export { type index$r_AcpMode as AcpMode, agent as Agent, conversion as Conversion, stdio as Stdio, websocket as Websocket, index$r_parseAcpMode as parseAcpMode, index$r_runAcp as runAcp };
|
|
1056
1157
|
}
|
|
1057
1158
|
|
|
1058
1159
|
/**
|
|
@@ -1456,41 +1557,41 @@ declare function loadConfig(path?: string, options?: {
|
|
|
1456
1557
|
allowEmptyProviders?: boolean;
|
|
1457
1558
|
}): AppConfig;
|
|
1458
1559
|
|
|
1459
|
-
type index$
|
|
1460
|
-
type index$
|
|
1461
|
-
declare const index$
|
|
1462
|
-
declare const index$
|
|
1463
|
-
declare const index$
|
|
1464
|
-
declare const index$
|
|
1465
|
-
type index$
|
|
1466
|
-
declare const index$
|
|
1467
|
-
type index$
|
|
1468
|
-
declare const index$
|
|
1469
|
-
declare const index$
|
|
1470
|
-
type index$
|
|
1471
|
-
declare const index$
|
|
1472
|
-
type index$
|
|
1473
|
-
declare const index$
|
|
1474
|
-
declare const index$
|
|
1475
|
-
type index$
|
|
1476
|
-
declare const index$
|
|
1477
|
-
declare const index$
|
|
1478
|
-
declare const index$
|
|
1479
|
-
declare const index$
|
|
1480
|
-
declare const index$
|
|
1481
|
-
declare const index$
|
|
1482
|
-
declare const index$
|
|
1483
|
-
declare const index$
|
|
1484
|
-
declare const index$
|
|
1485
|
-
declare const index$
|
|
1486
|
-
declare const index$
|
|
1487
|
-
declare const index$
|
|
1488
|
-
declare const index$
|
|
1489
|
-
declare const index$
|
|
1490
|
-
declare const index$
|
|
1491
|
-
declare const index$
|
|
1492
|
-
declare namespace index$
|
|
1493
|
-
export { type index$
|
|
1560
|
+
type index$q_AppConfig = AppConfig;
|
|
1561
|
+
type index$q_ConfigError = ConfigError;
|
|
1562
|
+
declare const index$q_ConfigError: typeof ConfigError;
|
|
1563
|
+
declare const index$q_DEFAULT_CONTEXT_WINDOW: typeof DEFAULT_CONTEXT_WINDOW;
|
|
1564
|
+
declare const index$q_DEFAULT_MAX_OUTPUT_TOKENS: typeof DEFAULT_MAX_OUTPUT_TOKENS;
|
|
1565
|
+
declare const index$q_DEFAULT_THINKING_LEVEL: typeof DEFAULT_THINKING_LEVEL;
|
|
1566
|
+
type index$q_HookConfig = HookConfig;
|
|
1567
|
+
declare const index$q_HookConfigSchema: typeof HookConfigSchema;
|
|
1568
|
+
type index$q_MCPServerConfig = MCPServerConfig;
|
|
1569
|
+
declare const index$q_MIN_THINKING_ANSWER_TOKENS: typeof MIN_THINKING_ANSWER_TOKENS;
|
|
1570
|
+
declare const index$q_MIN_THINKING_BUDGET_TOKENS: typeof MIN_THINKING_BUDGET_TOKENS;
|
|
1571
|
+
type index$q_ProviderConfig = ProviderConfig;
|
|
1572
|
+
declare const index$q_ProviderConfigSchema: typeof ProviderConfigSchema;
|
|
1573
|
+
type index$q_SandboxYamlConfig = SandboxYamlConfig;
|
|
1574
|
+
declare const index$q_THINKING_BUDGETS: typeof THINKING_BUDGETS;
|
|
1575
|
+
declare const index$q_THINKING_LEVELS: typeof THINKING_LEVELS;
|
|
1576
|
+
type index$q_ThinkingLevel = ThinkingLevel;
|
|
1577
|
+
declare const index$q_clampThinkingLevel: typeof clampThinkingLevel;
|
|
1578
|
+
declare const index$q_forkEnabled: typeof forkEnabled;
|
|
1579
|
+
declare const index$q_getContextWindow: typeof getContextWindow;
|
|
1580
|
+
declare const index$q_getMaxOutputTokens: typeof getMaxOutputTokens;
|
|
1581
|
+
declare const index$q_getSupportedThinkingLevels: typeof getSupportedThinkingLevels;
|
|
1582
|
+
declare const index$q_getThinkingLevel: typeof getThinkingLevel;
|
|
1583
|
+
declare const index$q_globalConfigPath: typeof globalConfigPath;
|
|
1584
|
+
declare const index$q_isValidThinkingLevel: typeof isValidThinkingLevel;
|
|
1585
|
+
declare const index$q_loadConfig: typeof loadConfig;
|
|
1586
|
+
declare const index$q_loadProjectMcpServers: typeof loadProjectMcpServers;
|
|
1587
|
+
declare const index$q_resolveAPIKey: typeof resolveAPIKey;
|
|
1588
|
+
declare const index$q_thinkingBudgetForLevel: typeof thinkingBudgetForLevel;
|
|
1589
|
+
declare const index$q_toAnthropicThinkingEffort: typeof toAnthropicThinkingEffort;
|
|
1590
|
+
declare const index$q_toReasoningEffort: typeof toReasoningEffort;
|
|
1591
|
+
declare const index$q_withProjectMcpServers: typeof withProjectMcpServers;
|
|
1592
|
+
declare const index$q_withProviderDefaults: typeof withProviderDefaults;
|
|
1593
|
+
declare namespace index$q {
|
|
1594
|
+
export { type index$q_AppConfig as AppConfig, index$q_ConfigError as ConfigError, index$q_DEFAULT_CONTEXT_WINDOW as DEFAULT_CONTEXT_WINDOW, index$q_DEFAULT_MAX_OUTPUT_TOKENS as DEFAULT_MAX_OUTPUT_TOKENS, index$q_DEFAULT_THINKING_LEVEL as DEFAULT_THINKING_LEVEL, type index$q_HookConfig as HookConfig, index$q_HookConfigSchema as HookConfigSchema, type index$q_MCPServerConfig as MCPServerConfig, index$q_MIN_THINKING_ANSWER_TOKENS as MIN_THINKING_ANSWER_TOKENS, index$q_MIN_THINKING_BUDGET_TOKENS as MIN_THINKING_BUDGET_TOKENS, type index$q_ProviderConfig as ProviderConfig, index$q_ProviderConfigSchema as ProviderConfigSchema, type index$q_SandboxYamlConfig as SandboxYamlConfig, index$q_THINKING_BUDGETS as THINKING_BUDGETS, index$q_THINKING_LEVELS as THINKING_LEVELS, type index$q_ThinkingLevel as ThinkingLevel, index$q_clampThinkingLevel as clampThinkingLevel, index$q_forkEnabled as forkEnabled, index$q_getContextWindow as getContextWindow, index$q_getMaxOutputTokens as getMaxOutputTokens, index$q_getSupportedThinkingLevels as getSupportedThinkingLevels, index$q_getThinkingLevel as getThinkingLevel, index$q_globalConfigPath as globalConfigPath, index$q_isValidThinkingLevel as isValidThinkingLevel, index$q_loadConfig as loadConfig, index$q_loadProjectMcpServers as loadProjectMcpServers, index$q_resolveAPIKey as resolveAPIKey, index$q_thinkingBudgetForLevel as thinkingBudgetForLevel, index$q_toAnthropicThinkingEffort as toAnthropicThinkingEffort, index$q_toReasoningEffort as toReasoningEffort, index$q_withProjectMcpServers as withProjectMcpServers, index$q_withProviderDefaults as withProviderDefaults };
|
|
1494
1595
|
}
|
|
1495
1596
|
|
|
1496
1597
|
/**
|
|
@@ -1549,15 +1650,15 @@ declare class HookEngine {
|
|
|
1549
1650
|
}
|
|
1550
1651
|
declare function validate(hooks: HookConfig[]): Error | null;
|
|
1551
1652
|
|
|
1552
|
-
type index$
|
|
1553
|
-
type index$
|
|
1554
|
-
type index$
|
|
1555
|
-
declare const index$
|
|
1556
|
-
type index$
|
|
1557
|
-
type index$
|
|
1558
|
-
declare const index$
|
|
1559
|
-
declare namespace index$
|
|
1560
|
-
export { type index$
|
|
1653
|
+
type index$p_EventName = EventName;
|
|
1654
|
+
type index$p_HookContext = HookContext;
|
|
1655
|
+
type index$p_HookEngine = HookEngine;
|
|
1656
|
+
declare const index$p_HookEngine: typeof HookEngine;
|
|
1657
|
+
type index$p_HookResult = HookResult;
|
|
1658
|
+
type index$p_HookRuntimeOptions = HookRuntimeOptions;
|
|
1659
|
+
declare const index$p_validate: typeof validate;
|
|
1660
|
+
declare namespace index$p {
|
|
1661
|
+
export { type index$p_EventName as EventName, type index$p_HookContext as HookContext, index$p_HookEngine as HookEngine, type index$p_HookResult as HookResult, type index$p_HookRuntimeOptions as HookRuntimeOptions, index$p_validate as validate };
|
|
1561
1662
|
}
|
|
1562
1663
|
|
|
1563
1664
|
/**
|
|
@@ -1684,6 +1785,7 @@ declare class AnthropicClient implements LLMClient {
|
|
|
1684
1785
|
private systemPrompt;
|
|
1685
1786
|
private maxOutputTokens;
|
|
1686
1787
|
private config;
|
|
1788
|
+
private useExplicitCustomToolType;
|
|
1687
1789
|
constructor(config: ProviderConfig, systemPrompt: string);
|
|
1688
1790
|
setSystemPrompt(prompt: string): void;
|
|
1689
1791
|
setMaxOutputTokens(maxTokens: number): void;
|
|
@@ -1771,7 +1873,6 @@ interface MemoryHeader {
|
|
|
1771
1873
|
description: string;
|
|
1772
1874
|
type: string;
|
|
1773
1875
|
}
|
|
1774
|
-
/** One memory selected for surfacing into the main conversation. */
|
|
1775
1876
|
/**
|
|
1776
1877
|
* The output of a single recall: the rendered system-reminder body and the
|
|
1777
1878
|
* selected memory file paths. Paths are only recorded as surfaced once the
|
|
@@ -1781,6 +1882,7 @@ interface RecallResult {
|
|
|
1781
1882
|
reminder: string;
|
|
1782
1883
|
paths: string[];
|
|
1783
1884
|
}
|
|
1885
|
+
/** One memory selected for surfacing into the main conversation. */
|
|
1784
1886
|
interface RelevantMemory {
|
|
1785
1887
|
path: string;
|
|
1786
1888
|
mtimeMs: number;
|
|
@@ -1795,7 +1897,9 @@ declare class MemoryManager {
|
|
|
1795
1897
|
loadAll(): MemoryFile[];
|
|
1796
1898
|
getMemories(): MemoryFile[];
|
|
1797
1899
|
/**
|
|
1798
|
-
* Builds the memory index injected into the
|
|
1900
|
+
* Builds the memory index injected into the conversation as a
|
|
1901
|
+
* system-reminder message (not the system prompt, which stays
|
|
1902
|
+
* project-independent to preserve prompt caching).
|
|
1799
1903
|
*
|
|
1800
1904
|
* This content is re-sent to the model on every conversation turn, so each additional index line
|
|
1801
1905
|
* is a recurring cost. We therefore enforce both a line-count and a byte-size cap at the output
|
|
@@ -1815,8 +1919,9 @@ declare class MemoryManager {
|
|
|
1815
1919
|
private writeIndex;
|
|
1816
1920
|
/**
|
|
1817
1921
|
* Scans all memory headers from both dirs, asks the LLM to select the
|
|
1818
|
-
* top 5 most relevant ones for the query, and returns
|
|
1819
|
-
*
|
|
1922
|
+
* top 5 most relevant ones for the query, and returns their paths (with
|
|
1923
|
+
* mtimes); the file contents are read later by renderReminder.
|
|
1924
|
+
* Best-effort: selector failures return an empty array.
|
|
1820
1925
|
*/
|
|
1821
1926
|
findRelevantMemories(query: string, client: LLMClient, recentTools?: string[], alreadySurfaced?: Set<string>): Promise<RelevantMemory[]>;
|
|
1822
1927
|
private scanMemoryHeaders;
|
|
@@ -1961,7 +2066,7 @@ declare namespace providers {
|
|
|
1961
2066
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
1962
2067
|
* SOFTWARE.
|
|
1963
2068
|
*/
|
|
1964
|
-
type TelemetryMode = "print" | "remote" | "teammate" | "
|
|
2069
|
+
type TelemetryMode = "print" | "remote" | "teammate" | "terminal" | "unknown";
|
|
1965
2070
|
type TelemetryObservationKind = "agent" | "generation" | "tool";
|
|
1966
2071
|
type TelemetryMetricKind = "counter" | "histogram";
|
|
1967
2072
|
type TelemetryAttributes = Record<string, string | number | boolean>;
|
|
@@ -1996,22 +2101,22 @@ declare function flushTelemetry(): Promise<void>;
|
|
|
1996
2101
|
declare function shutdownTelemetry(): Promise<void>;
|
|
1997
2102
|
declare function installRemoteTelemetrySignalHandlers(): void;
|
|
1998
2103
|
|
|
1999
|
-
type index$
|
|
2000
|
-
type index$
|
|
2001
|
-
type index$
|
|
2002
|
-
type index$
|
|
2003
|
-
type index$
|
|
2004
|
-
type index$
|
|
2005
|
-
type index$
|
|
2006
|
-
declare const index$
|
|
2007
|
-
declare const index$
|
|
2008
|
-
declare const index$
|
|
2009
|
-
declare const index$
|
|
2010
|
-
declare const index$
|
|
2011
|
-
declare const index$
|
|
2012
|
-
declare const index$
|
|
2013
|
-
declare namespace index$
|
|
2014
|
-
export { instrumentation as Instrumentation, providers as Providers, type index$
|
|
2104
|
+
type index$o_TelemetryAttributes = TelemetryAttributes;
|
|
2105
|
+
type index$o_TelemetryMetricKind = TelemetryMetricKind;
|
|
2106
|
+
type index$o_TelemetryMode = TelemetryMode;
|
|
2107
|
+
type index$o_TelemetryObservation = TelemetryObservation;
|
|
2108
|
+
type index$o_TelemetryObservationKind = TelemetryObservationKind;
|
|
2109
|
+
type index$o_TelemetryObservationUpdate = TelemetryObservationUpdate;
|
|
2110
|
+
type index$o_TelemetryRuntime = TelemetryRuntime;
|
|
2111
|
+
declare const index$o_captureTelemetryError: typeof captureTelemetryError;
|
|
2112
|
+
declare const index$o_flushTelemetry: typeof flushTelemetry;
|
|
2113
|
+
declare const index$o_getTelemetryRuntime: typeof getTelemetryRuntime;
|
|
2114
|
+
declare const index$o_initializeTelemetry: typeof initializeTelemetry;
|
|
2115
|
+
declare const index$o_installRemoteTelemetrySignalHandlers: typeof installRemoteTelemetrySignalHandlers;
|
|
2116
|
+
declare const index$o_setTelemetryMode: typeof setTelemetryMode;
|
|
2117
|
+
declare const index$o_shutdownTelemetry: typeof shutdownTelemetry;
|
|
2118
|
+
declare namespace index$o {
|
|
2119
|
+
export { instrumentation as Instrumentation, providers as Providers, type index$o_TelemetryAttributes as TelemetryAttributes, type index$o_TelemetryMetricKind as TelemetryMetricKind, type index$o_TelemetryMode as TelemetryMode, type index$o_TelemetryObservation as TelemetryObservation, type index$o_TelemetryObservationKind as TelemetryObservationKind, type index$o_TelemetryObservationUpdate as TelemetryObservationUpdate, type index$o_TelemetryRuntime as TelemetryRuntime, index$o_captureTelemetryError as captureTelemetryError, index$o_flushTelemetry as flushTelemetry, index$o_getTelemetryRuntime as getTelemetryRuntime, index$o_initializeTelemetry as initializeTelemetry, index$o_installRemoteTelemetrySignalHandlers as installRemoteTelemetrySignalHandlers, index$o_setTelemetryMode as setTelemetryMode, index$o_shutdownTelemetry as shutdownTelemetry };
|
|
2015
2120
|
}
|
|
2016
2121
|
|
|
2017
2122
|
/**
|
|
@@ -2144,6 +2249,14 @@ interface AgentConfig {
|
|
|
2144
2249
|
recoveryState?: RecoveryState;
|
|
2145
2250
|
maxIterations?: number;
|
|
2146
2251
|
notificationFn?: () => string[];
|
|
2252
|
+
/**
|
|
2253
|
+
* Background task registry owned by this loop. Injected into every tool
|
|
2254
|
+
* context so backgrounded Bash commands register — and later notify — here
|
|
2255
|
+
* instead of on the host-level default. Subagent runs pass their own;
|
|
2256
|
+
* explicit `null` disables backgrounding for the whole loop (in-process
|
|
2257
|
+
* teammate turns) even when tools carry a host-wired manager.
|
|
2258
|
+
*/
|
|
2259
|
+
taskManager?: TaskManager | null;
|
|
2147
2260
|
onLoopComplete?: (conversation: ConversationManager) => void;
|
|
2148
2261
|
activeSkills?: Map<string, string>;
|
|
2149
2262
|
toolFilter?: (name: string) => boolean;
|
|
@@ -2181,6 +2294,7 @@ declare class Agent {
|
|
|
2181
2294
|
private recoveryState;
|
|
2182
2295
|
private maxIterations;
|
|
2183
2296
|
private notificationFn?;
|
|
2297
|
+
private taskManager?;
|
|
2184
2298
|
private onLoopComplete?;
|
|
2185
2299
|
private compactTracking;
|
|
2186
2300
|
private onPermissionRequest?;
|
|
@@ -2210,18 +2324,18 @@ declare class Agent {
|
|
|
2210
2324
|
* Persist the most recently appended conversation message to the session log.
|
|
2211
2325
|
*
|
|
2212
2326
|
* Persistence lives in the main loop rather than in individual frontends: both
|
|
2213
|
-
* the
|
|
2327
|
+
* the UI and Web share the same recording path, ensuring intermediate assistant
|
|
2214
2328
|
* text and complete tool-call chains are captured for session restoration.
|
|
2215
2329
|
* Skipped when sessionId is empty (one-shot invocations, sub-agents).
|
|
2216
2330
|
*/
|
|
2217
2331
|
private persistLastMessage;
|
|
2218
2332
|
}
|
|
2219
2333
|
|
|
2220
|
-
type index$
|
|
2221
|
-
declare const index$
|
|
2222
|
-
type index$
|
|
2223
|
-
declare namespace index$
|
|
2224
|
-
export { index$
|
|
2334
|
+
type index$n_Agent = Agent;
|
|
2335
|
+
declare const index$n_Agent: typeof Agent;
|
|
2336
|
+
type index$n_AgentConfig = AgentConfig;
|
|
2337
|
+
declare namespace index$n {
|
|
2338
|
+
export { index$n_Agent as Agent, type index$n_AgentConfig as AgentConfig, events as Events, streamingExecutor as StreamingExecutor };
|
|
2225
2339
|
}
|
|
2226
2340
|
|
|
2227
2341
|
/**
|
|
@@ -2520,12 +2634,12 @@ interface SkillForkHost extends SkillHost {
|
|
|
2520
2634
|
snapshotParentMessages(count: number): string;
|
|
2521
2635
|
}
|
|
2522
2636
|
|
|
2523
|
-
type index$
|
|
2524
|
-
type index$
|
|
2525
|
-
type index$
|
|
2526
|
-
type index$
|
|
2527
|
-
declare namespace index$
|
|
2528
|
-
export { catalog as Catalog, executor as Executor, installTool as InstallTool, loadSkillTool as LoadSkillTool, type index$
|
|
2637
|
+
type index$m_Skill = Skill;
|
|
2638
|
+
type index$m_SkillForkHost = SkillForkHost;
|
|
2639
|
+
type index$m_SkillHost = SkillHost;
|
|
2640
|
+
type index$m_SkillMeta = SkillMeta;
|
|
2641
|
+
declare namespace index$m {
|
|
2642
|
+
export { catalog as Catalog, executor as Executor, installTool as InstallTool, loadSkillTool as LoadSkillTool, type index$m_Skill as Skill, type index$m_SkillForkHost as SkillForkHost, type index$m_SkillHost as SkillHost, type index$m_SkillMeta as SkillMeta };
|
|
2529
2643
|
}
|
|
2530
2644
|
|
|
2531
2645
|
/**
|
|
@@ -2771,11 +2885,11 @@ declare class TaskList {
|
|
|
2771
2885
|
addBlockedBy(taskId: string, blockerIds: string[]): void;
|
|
2772
2886
|
}
|
|
2773
2887
|
|
|
2774
|
-
type index$
|
|
2775
|
-
type index$
|
|
2776
|
-
declare const index$
|
|
2777
|
-
declare namespace index$
|
|
2778
|
-
export { store as Store, type index$
|
|
2888
|
+
type index$l_Task = Task;
|
|
2889
|
+
type index$l_TaskList = TaskList;
|
|
2890
|
+
declare const index$l_TaskList: typeof TaskList;
|
|
2891
|
+
declare namespace index$l {
|
|
2892
|
+
export { store as Store, type index$l_Task as Task, index$l_TaskList as TaskList, tools$1 as Tools };
|
|
2779
2893
|
}
|
|
2780
2894
|
|
|
2781
2895
|
/**
|
|
@@ -2842,7 +2956,7 @@ declare namespace toolRegistry {
|
|
|
2842
2956
|
* SOFTWARE.
|
|
2843
2957
|
*/
|
|
2844
2958
|
|
|
2845
|
-
declare namespace index$
|
|
2959
|
+
declare namespace index$k {
|
|
2846
2960
|
export { interactionSummary as InteractionSummary, toolRegistry as ToolRegistry };
|
|
2847
2961
|
}
|
|
2848
2962
|
|
|
@@ -3279,7 +3393,7 @@ declare namespace definition {
|
|
|
3279
3393
|
|
|
3280
3394
|
/**
|
|
3281
3395
|
* Marker appended to a subagent's output when its run was interrupted. Shared
|
|
3282
|
-
* with the
|
|
3396
|
+
* with the UI so restored transcripts can render interrupted Agent cards with
|
|
3283
3397
|
* the same "stopped" styling as live ones.
|
|
3284
3398
|
*/
|
|
3285
3399
|
declare const SUBAGENT_INTERRUPTED_MARKER = "[Interrupted]";
|
|
@@ -3307,6 +3421,15 @@ interface SubagentRunOptions {
|
|
|
3307
3421
|
onPermissionRequest?: AgentConfig["onPermissionRequest"];
|
|
3308
3422
|
permissionMode?: PermissionChecker["mode"];
|
|
3309
3423
|
conversation?: ConversationManager;
|
|
3424
|
+
/**
|
|
3425
|
+
* Whether this run gets a per-run background task manager (default true).
|
|
3426
|
+
* In-process teammate turns pass false: a teammate loop is one run per task
|
|
3427
|
+
* turn, so the turn-end stopAll() would immediately kill anything the
|
|
3428
|
+
* teammate backgrounded, and the drain disappears before any notification
|
|
3429
|
+
* could be delivered. Teammates stay purely foreground (matching the
|
|
3430
|
+
* subprocess teammate path); subagents they spawn themselves are unaffected.
|
|
3431
|
+
*/
|
|
3432
|
+
backgroundTasks?: boolean;
|
|
3310
3433
|
}
|
|
3311
3434
|
declare function spawnSubagent(definition: AgentDefinition, prompt: string, parentClient: LLMClient, parentRegistry: ToolRegistry, parentProvider: ProviderConfig, workDir: string, onProgress?: (p: {
|
|
3312
3435
|
turn?: number;
|
|
@@ -3348,18 +3471,20 @@ declare namespace spawn {
|
|
|
3348
3471
|
* Auto-detect the best backend for running teammates.
|
|
3349
3472
|
*
|
|
3350
3473
|
* Auto-detection logic:
|
|
3351
|
-
* -
|
|
3352
|
-
*
|
|
3353
|
-
*
|
|
3354
|
-
*
|
|
3474
|
+
* - Windows: always **in-process**.
|
|
3475
|
+
* - Otherwise: tmux/iTerm panes when the corresponding environment is
|
|
3476
|
+
* detected (TMUX / ITERM_SESSION_ID), else **in-process** so progress
|
|
3477
|
+
* tracking works (agent events flow in the same process and can update
|
|
3478
|
+
* the Spinner Tree in real time).
|
|
3355
3479
|
*
|
|
3356
3480
|
* In-process teammates share the Node.js event loop but are context-isolated.
|
|
3357
3481
|
* They communicate via the same file-based mailbox as external teammates.
|
|
3358
3482
|
*/
|
|
3359
3483
|
declare function detectBackend(): TeamMode;
|
|
3360
3484
|
/**
|
|
3361
|
-
* Detect available pane backend
|
|
3362
|
-
*
|
|
3485
|
+
* Detect available pane backend from the environment (TMUX /
|
|
3486
|
+
* ITERM_SESSION_ID); falls back to in-process. Called unconditionally by
|
|
3487
|
+
* detectBackend on non-Windows platforms.
|
|
3363
3488
|
*/
|
|
3364
3489
|
declare function detectBackendFromEnv(): TeamMode;
|
|
3365
3490
|
interface SpawnConfig {
|
|
@@ -3589,71 +3714,8 @@ declare namespace registry {
|
|
|
3589
3714
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
3590
3715
|
* SOFTWARE.
|
|
3591
3716
|
*/
|
|
3592
|
-
type AgentTaskStatus = "running" | "completed" | "failed" | "cancelled";
|
|
3593
|
-
interface AgentTask {
|
|
3594
|
-
id: string;
|
|
3595
|
-
name: string;
|
|
3596
|
-
originToolCallId?: string;
|
|
3597
|
-
status: AgentTaskStatus;
|
|
3598
|
-
output: string;
|
|
3599
|
-
cancel: () => void;
|
|
3600
|
-
done: Promise<void>;
|
|
3601
|
-
}
|
|
3602
|
-
interface CreateTaskOptions {
|
|
3603
|
-
originToolCallId?: string;
|
|
3604
|
-
}
|
|
3605
|
-
declare class TaskManager {
|
|
3606
|
-
private tasks;
|
|
3607
|
-
private notifiedTaskIds;
|
|
3608
|
-
private listeners;
|
|
3609
|
-
private nextId;
|
|
3610
|
-
create(name: string, runner: (task: AgentTask) => Promise<string>, cancel: () => void, options?: CreateTaskOptions): AgentTask;
|
|
3611
|
-
get(id: string): AgentTask | undefined;
|
|
3612
|
-
list(): AgentTask[];
|
|
3613
|
-
subscribe(listener: (tasks: AgentTask[]) => void): () => void;
|
|
3614
|
-
private emitChange;
|
|
3615
|
-
hasRunning(): boolean;
|
|
3616
|
-
stop(id: string): boolean;
|
|
3617
|
-
stopAndWait(id: string): Promise<boolean>;
|
|
3618
|
-
stopAll(): Promise<void>;
|
|
3619
|
-
waitAll(): Promise<void>;
|
|
3620
|
-
drainNotifications(): AgentTask[];
|
|
3621
|
-
clear(): void;
|
|
3622
|
-
}
|
|
3623
|
-
declare function formatAgentTaskNotification(task: AgentTask): string;
|
|
3624
3717
|
|
|
3625
|
-
|
|
3626
|
-
type taskManager_AgentTaskStatus = AgentTaskStatus;
|
|
3627
|
-
type taskManager_TaskManager = TaskManager;
|
|
3628
|
-
declare const taskManager_TaskManager: typeof TaskManager;
|
|
3629
|
-
declare const taskManager_formatAgentTaskNotification: typeof formatAgentTaskNotification;
|
|
3630
|
-
declare namespace taskManager {
|
|
3631
|
-
export { type taskManager_AgentTask as AgentTask, type taskManager_AgentTaskStatus as AgentTaskStatus, taskManager_TaskManager as TaskManager, taskManager_formatAgentTaskNotification as formatAgentTaskNotification };
|
|
3632
|
-
}
|
|
3633
|
-
|
|
3634
|
-
/**
|
|
3635
|
-
* Copyright (c) 2026 hangtiancheng
|
|
3636
|
-
*
|
|
3637
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
3638
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
3639
|
-
* in the Software without restriction, including without limitation the rights
|
|
3640
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
3641
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
3642
|
-
* furnished to do so, subject to the following conditions:
|
|
3643
|
-
*
|
|
3644
|
-
* The above copyright notice and this permission notice shall be included in
|
|
3645
|
-
* all copies or substantial portions of the Software.
|
|
3646
|
-
*
|
|
3647
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
3648
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
3649
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
3650
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
3651
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
3652
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
3653
|
-
* SOFTWARE.
|
|
3654
|
-
*/
|
|
3655
|
-
|
|
3656
|
-
/** Abort a running teammate or one-shot background Agent task. */
|
|
3718
|
+
/** Abort a running teammate or one-shot background Agent/Bash/PowerShell/JavaScript task. */
|
|
3657
3719
|
declare class TaskStopTool implements Tool {
|
|
3658
3720
|
private teamManager;
|
|
3659
3721
|
private taskManager?;
|
|
@@ -3662,7 +3724,7 @@ declare class TaskStopTool implements Tool {
|
|
|
3662
3724
|
category: ToolCategory;
|
|
3663
3725
|
constructor(teamManager: TeamManager, taskManager?: TaskManager | undefined);
|
|
3664
3726
|
schema(): ToolSchema;
|
|
3665
|
-
execute(
|
|
3727
|
+
execute(ctx: ToolContext, args: Record<string, unknown>): Promise<ToolResult>;
|
|
3666
3728
|
/** List all current teammate names for the model, so it doesn't keep retrying with a misremembered name */
|
|
3667
3729
|
private knownMembers;
|
|
3668
3730
|
}
|
|
@@ -3997,6 +4059,8 @@ declare class Team {
|
|
|
3997
4059
|
* Returns the concatenated prompt or a shutdown flag.
|
|
3998
4060
|
*/
|
|
3999
4061
|
private waitForNextPromptOrShutdown;
|
|
4062
|
+
/** Reads the teammate's plan file for review; returns a fallback note when empty or unreadable. */
|
|
4063
|
+
private readPlanForReview;
|
|
4000
4064
|
/**
|
|
4001
4065
|
* Sends the teammate's completed plan to the Lead, blocks until approval is received,
|
|
4002
4066
|
* and returns the prompt to feed the model on the next turn.
|
|
@@ -4007,7 +4071,6 @@ declare class Team {
|
|
|
4007
4071
|
* drive progress from the Lead side. Returns null when the teammate has been
|
|
4008
4072
|
* deactivated; the caller should exit the main loop.
|
|
4009
4073
|
*/
|
|
4010
|
-
private readPlanForReview;
|
|
4011
4074
|
private runPlanApproval;
|
|
4012
4075
|
getMember(name: string): Member | undefined;
|
|
4013
4076
|
sendMessage(from: string, to: string, content: string): Promise<void>;
|
|
@@ -4061,16 +4124,16 @@ declare class TeamManager {
|
|
|
4061
4124
|
drainLeads(): string[];
|
|
4062
4125
|
}
|
|
4063
4126
|
|
|
4064
|
-
type index$
|
|
4065
|
-
type index$
|
|
4066
|
-
type index$
|
|
4067
|
-
type index$
|
|
4068
|
-
declare const index$
|
|
4069
|
-
type index$
|
|
4070
|
-
declare const index$
|
|
4071
|
-
type index$
|
|
4072
|
-
declare namespace index$
|
|
4073
|
-
export { type index$
|
|
4127
|
+
type index$j_AgentEventCallback = AgentEventCallback;
|
|
4128
|
+
type index$j_Member = Member;
|
|
4129
|
+
type index$j_RunAgent = RunAgent;
|
|
4130
|
+
type index$j_Team = Team;
|
|
4131
|
+
declare const index$j_Team: typeof Team;
|
|
4132
|
+
type index$j_TeamManager = TeamManager;
|
|
4133
|
+
declare const index$j_TeamManager: typeof TeamManager;
|
|
4134
|
+
type index$j_TeamMode = TeamMode;
|
|
4135
|
+
declare namespace index$j {
|
|
4136
|
+
export { type index$j_AgentEventCallback as AgentEventCallback, backend as Backend, coordinator$1 as Coordinator, fileMailbox as FileMailbox, type index$j_Member as Member, progress as Progress, protocol as Protocol, registry as Registry, type index$j_RunAgent as RunAgent, sharedTask as SharedTask, taskStop as TaskStop, taskTools as TaskTools, index$j_Team as Team, teamFile as TeamFile, index$j_TeamManager as TeamManager, type index$j_TeamMode as TeamMode, tools as Tools, transcript as Transcript };
|
|
4074
4137
|
}
|
|
4075
4138
|
|
|
4076
4139
|
/**
|
|
@@ -4337,7 +4400,7 @@ declare namespace handler {
|
|
|
4337
4400
|
* SOFTWARE.
|
|
4338
4401
|
*/
|
|
4339
4402
|
|
|
4340
|
-
declare namespace index$
|
|
4403
|
+
declare namespace index$i {
|
|
4341
4404
|
export { handler as Handler, manager$1 as Manager, session as Session };
|
|
4342
4405
|
}
|
|
4343
4406
|
|
|
@@ -4432,7 +4495,7 @@ declare namespace usageTracker {
|
|
|
4432
4495
|
* SOFTWARE.
|
|
4433
4496
|
*/
|
|
4434
4497
|
|
|
4435
|
-
declare namespace index$
|
|
4498
|
+
declare namespace index$h {
|
|
4436
4499
|
export { commands as Commands, loader$1 as Loader, usageTracker as UsageTracker };
|
|
4437
4500
|
}
|
|
4438
4501
|
|
|
@@ -4549,7 +4612,7 @@ declare namespace prompts {
|
|
|
4549
4612
|
* SOFTWARE.
|
|
4550
4613
|
*/
|
|
4551
4614
|
|
|
4552
|
-
declare namespace index$
|
|
4615
|
+
declare namespace index$g {
|
|
4553
4616
|
export { compact as Compact, prompts as Prompts, recovery as Recovery };
|
|
4554
4617
|
}
|
|
4555
4618
|
|
|
@@ -4752,11 +4815,11 @@ declare const MAX_HISTORY_ENTRIES = 200;
|
|
|
4752
4815
|
declare function load(dir: string): string[];
|
|
4753
4816
|
declare function append(dir: string, text: string): string[];
|
|
4754
4817
|
|
|
4755
|
-
declare const index$
|
|
4756
|
-
declare const index$
|
|
4757
|
-
declare const index$
|
|
4758
|
-
declare namespace index$
|
|
4759
|
-
export { index$
|
|
4818
|
+
declare const index$f_MAX_HISTORY_ENTRIES: typeof MAX_HISTORY_ENTRIES;
|
|
4819
|
+
declare const index$f_append: typeof append;
|
|
4820
|
+
declare const index$f_load: typeof load;
|
|
4821
|
+
declare namespace index$f {
|
|
4822
|
+
export { index$f_MAX_HISTORY_ENTRIES as MAX_HISTORY_ENTRIES, index$f_append as append, index$f_load as load };
|
|
4760
4823
|
}
|
|
4761
4824
|
|
|
4762
4825
|
/**
|
|
@@ -4852,19 +4915,19 @@ declare function loadImageAttachment(absPath: string): Promise<ImageAttachment>;
|
|
|
4852
4915
|
type ResizedImage = Omit<ImageAttachment, "sourcePath">;
|
|
4853
4916
|
declare function maybeResizeAndDownsampleImage(buf: Buffer, mediaType: ImageMediaType): Promise<ResizedImage>;
|
|
4854
4917
|
|
|
4855
|
-
type index$
|
|
4856
|
-
declare const index$
|
|
4857
|
-
declare const index$
|
|
4858
|
-
declare const index$
|
|
4859
|
-
declare const index$
|
|
4860
|
-
declare const index$
|
|
4861
|
-
declare const index$
|
|
4862
|
-
declare const index$
|
|
4863
|
-
declare const index$
|
|
4864
|
-
declare const index$
|
|
4865
|
-
declare const index$
|
|
4866
|
-
declare namespace index$
|
|
4867
|
-
export { clipboard as Clipboard, index$
|
|
4918
|
+
type index$e_ImageTooLargeError = ImageTooLargeError;
|
|
4919
|
+
declare const index$e_ImageTooLargeError: typeof ImageTooLargeError;
|
|
4920
|
+
declare const index$e_MAX_DIMENSION_PX: typeof MAX_DIMENSION_PX;
|
|
4921
|
+
declare const index$e_MAX_IMAGES_PER_MESSAGE: typeof MAX_IMAGES_PER_MESSAGE;
|
|
4922
|
+
declare const index$e_MAX_IMAGE_BYTES_PASSTHROUGH: typeof MAX_IMAGE_BYTES_PASSTHROUGH;
|
|
4923
|
+
declare const index$e_asImageMediaType: typeof asImageMediaType;
|
|
4924
|
+
declare const index$e_getMediaType: typeof getMediaType;
|
|
4925
|
+
declare const index$e_isImagePath: typeof isImagePath;
|
|
4926
|
+
declare const index$e_loadImageAttachment: typeof loadImageAttachment;
|
|
4927
|
+
declare const index$e_maybeResizeAndDownsampleImage: typeof maybeResizeAndDownsampleImage;
|
|
4928
|
+
declare const index$e_sniffMediaType: typeof sniffMediaType;
|
|
4929
|
+
declare namespace index$e {
|
|
4930
|
+
export { clipboard as Clipboard, index$e_ImageTooLargeError as ImageTooLargeError, index$e_MAX_DIMENSION_PX as MAX_DIMENSION_PX, index$e_MAX_IMAGES_PER_MESSAGE as MAX_IMAGES_PER_MESSAGE, index$e_MAX_IMAGE_BYTES_PASSTHROUGH as MAX_IMAGE_BYTES_PASSTHROUGH, index$e_asImageMediaType as asImageMediaType, index$e_getMediaType as getMediaType, index$e_isImagePath as isImagePath, index$e_loadImageAttachment as loadImageAttachment, index$e_maybeResizeAndDownsampleImage as maybeResizeAndDownsampleImage, index$e_sniffMediaType as sniffMediaType };
|
|
4868
4931
|
}
|
|
4869
4932
|
|
|
4870
4933
|
/**
|
|
@@ -5011,7 +5074,7 @@ declare namespace modelResolver {
|
|
|
5011
5074
|
* SOFTWARE.
|
|
5012
5075
|
*/
|
|
5013
5076
|
|
|
5014
|
-
declare namespace index$
|
|
5077
|
+
declare namespace index$d {
|
|
5015
5078
|
export { anthropic as Anthropic, client$1 as Client, errors as Errors, events$1 as Events, modelDiscovery as ModelDiscovery, modelResolver as ModelResolver, openai as OpenAI };
|
|
5016
5079
|
}
|
|
5017
5080
|
|
|
@@ -5038,7 +5101,7 @@ declare namespace index$e {
|
|
|
5038
5101
|
*/
|
|
5039
5102
|
|
|
5040
5103
|
/** Execution mode, written into the base field of every log entry. */
|
|
5041
|
-
type LoggerMode = "
|
|
5104
|
+
type LoggerMode = "terminal" | "remote" | "teammate";
|
|
5042
5105
|
/** Options for initLogger. Named to avoid clashing with pino's LoggerOptions. */
|
|
5043
5106
|
interface InitLoggerOptions {
|
|
5044
5107
|
/** Session ID, used as the log filename and a base field. */
|
|
@@ -5053,7 +5116,7 @@ interface InitLoggerOptions {
|
|
|
5053
5116
|
skipCleanup?: boolean;
|
|
5054
5117
|
/**
|
|
5055
5118
|
* Mirror JSONL to stdout in addition to the log file. Only safe in remote
|
|
5056
|
-
* mode (
|
|
5119
|
+
* mode (UI owns stdout; teammates use it for IPC). Lets users watch logs
|
|
5057
5120
|
* live or pipe them through pino-pretty.
|
|
5058
5121
|
*/
|
|
5059
5122
|
stdout?: boolean;
|
|
@@ -5074,7 +5137,7 @@ declare function closeLogger(): void;
|
|
|
5074
5137
|
/**
|
|
5075
5138
|
* Global logger export. Modules can import and use it at file top level:
|
|
5076
5139
|
* ```ts
|
|
5077
|
-
* import { logger } from "@/logger/
|
|
5140
|
+
* import { logger } from "@/logger/index.js";
|
|
5078
5141
|
* logger.warn({ module: "app" }, "something looks off");
|
|
5079
5142
|
* ```
|
|
5080
5143
|
* Before initLogger(), calls fall back to the silent target (pre-init logs
|
|
@@ -5094,13 +5157,13 @@ declare function createChildLogger(bindings: {
|
|
|
5094
5157
|
module: string;
|
|
5095
5158
|
}): Logger;
|
|
5096
5159
|
|
|
5097
|
-
declare const index$
|
|
5098
|
-
declare const index$
|
|
5099
|
-
declare const index$
|
|
5100
|
-
declare const index$
|
|
5101
|
-
declare const index$
|
|
5102
|
-
declare namespace index$
|
|
5103
|
-
export { index$
|
|
5160
|
+
declare const index$c_closeLogger: typeof closeLogger;
|
|
5161
|
+
declare const index$c_createChildLogger: typeof createChildLogger;
|
|
5162
|
+
declare const index$c_initLogger: typeof initLogger;
|
|
5163
|
+
declare const index$c_logger: typeof logger;
|
|
5164
|
+
declare const index$c_sanitizeNameSegment: typeof sanitizeNameSegment;
|
|
5165
|
+
declare namespace index$c {
|
|
5166
|
+
export { index$c_closeLogger as closeLogger, index$c_createChildLogger as createChildLogger, index$c_initLogger as initLogger, index$c_logger as logger, index$c_sanitizeNameSegment as sanitizeNameSegment };
|
|
5104
5167
|
}
|
|
5105
5168
|
|
|
5106
5169
|
/**
|
|
@@ -5470,7 +5533,7 @@ declare namespace toolWrapper {
|
|
|
5470
5533
|
* SOFTWARE.
|
|
5471
5534
|
*/
|
|
5472
5535
|
|
|
5473
|
-
declare namespace index$
|
|
5536
|
+
declare namespace index$b {
|
|
5474
5537
|
export { client as Client, instructions$1 as Instructions, manager as Manager, strategy as Strategy, toolWrapper as ToolWrapper };
|
|
5475
5538
|
}
|
|
5476
5539
|
|
|
@@ -5676,7 +5739,7 @@ declare namespace instructions {
|
|
|
5676
5739
|
*/
|
|
5677
5740
|
/**
|
|
5678
5741
|
Memory freshness calculation and expiration reminders. Appends a prompt text
|
|
5679
|
-
to memories
|
|
5742
|
+
to memories at least 2 days old, instructing the model that the memory may be
|
|
5680
5743
|
stale and should be verified before use.
|
|
5681
5744
|
*/
|
|
5682
5745
|
declare function memoryAgeDays(mtimeMs: number): number;
|
|
@@ -5778,7 +5841,7 @@ declare namespace writtenPaths {
|
|
|
5778
5841
|
* SOFTWARE.
|
|
5779
5842
|
*/
|
|
5780
5843
|
|
|
5781
|
-
declare namespace index$
|
|
5844
|
+
declare namespace index$a {
|
|
5782
5845
|
export { consolidation as Consolidation, extractor as Extractor, instructions as Instructions, manager$2 as Manager, memoryAge$1 as MemoryAge, permissions as Permissions, writtenPaths as WrittenPaths };
|
|
5783
5846
|
}
|
|
5784
5847
|
|
|
@@ -5810,14 +5873,14 @@ declare function planExists(workDir: string): boolean;
|
|
|
5810
5873
|
declare function resetPlanPath(): void;
|
|
5811
5874
|
declare function getCurrentPlanPath(): string | null;
|
|
5812
5875
|
|
|
5813
|
-
declare const index$
|
|
5814
|
-
declare const index$
|
|
5815
|
-
declare const index$
|
|
5816
|
-
declare const index$
|
|
5817
|
-
declare const index$
|
|
5818
|
-
declare const index$
|
|
5819
|
-
declare namespace index$
|
|
5820
|
-
export { index$
|
|
5876
|
+
declare const index$9_getCurrentPlanPath: typeof getCurrentPlanPath;
|
|
5877
|
+
declare const index$9_getOrCreatePlanPath: typeof getOrCreatePlanPath;
|
|
5878
|
+
declare const index$9_loadPlan: typeof loadPlan;
|
|
5879
|
+
declare const index$9_planExists: typeof planExists;
|
|
5880
|
+
declare const index$9_resetPlanPath: typeof resetPlanPath;
|
|
5881
|
+
declare const index$9_savePlan: typeof savePlan;
|
|
5882
|
+
declare namespace index$9 {
|
|
5883
|
+
export { index$9_getCurrentPlanPath as getCurrentPlanPath, index$9_getOrCreatePlanPath as getOrCreatePlanPath, index$9_loadPlan as loadPlan, index$9_planExists as planExists, index$9_resetPlanPath as resetPlanPath, index$9_savePlan as savePlan };
|
|
5821
5884
|
}
|
|
5822
5885
|
|
|
5823
5886
|
/**
|
|
@@ -6044,7 +6107,7 @@ declare namespace planMode {
|
|
|
6044
6107
|
* SOFTWARE.
|
|
6045
6108
|
*/
|
|
6046
6109
|
|
|
6047
|
-
declare namespace index$
|
|
6110
|
+
declare namespace index$8 {
|
|
6048
6111
|
export { builder as Builder, coordinator as Coordinator, delegation as Delegation, planMode as PlanMode, sections as Sections };
|
|
6049
6112
|
}
|
|
6050
6113
|
|
|
@@ -6251,7 +6314,6 @@ interface CreateRemoteAgentOptions {
|
|
|
6251
6314
|
/**
|
|
6252
6315
|
* Initializes the full agent stack: tools, LLM client, conversation, session,
|
|
6253
6316
|
* skills, hooks, MCP servers, team management, and memory.
|
|
6254
|
-
* Replicates ALL logic from server-old.ts initAgent() + initMCPServers().
|
|
6255
6317
|
*/
|
|
6256
6318
|
declare function createRemoteAgent(opts: CreateRemoteAgentOptions): Promise<RemoteAgentHandle>;
|
|
6257
6319
|
interface RemoteServerOptions {
|
|
@@ -6363,7 +6425,7 @@ declare namespace sessionState {
|
|
|
6363
6425
|
* SOFTWARE.
|
|
6364
6426
|
*/
|
|
6365
6427
|
|
|
6366
|
-
declare namespace index$
|
|
6428
|
+
declare namespace index$7 {
|
|
6367
6429
|
export { address as Address, log as Log, server as Server, sessionState as SessionState };
|
|
6368
6430
|
}
|
|
6369
6431
|
|
|
@@ -6538,15 +6600,15 @@ interface Sandbox {
|
|
|
6538
6600
|
*/
|
|
6539
6601
|
declare function createSandbox(backend?: SandboxBackend): Promise<Sandbox | null>;
|
|
6540
6602
|
|
|
6541
|
-
type index$
|
|
6542
|
-
type index$
|
|
6543
|
-
type index$
|
|
6544
|
-
type index$
|
|
6545
|
-
type index$
|
|
6546
|
-
type index$
|
|
6547
|
-
declare const index$
|
|
6548
|
-
declare namespace index$
|
|
6549
|
-
export { bwrap as Bwrap, type index$
|
|
6603
|
+
type index$6_PreparedSandboxCommand = PreparedSandboxCommand;
|
|
6604
|
+
type index$6_Sandbox = Sandbox;
|
|
6605
|
+
type index$6_SandboxBackend = SandboxBackend;
|
|
6606
|
+
type index$6_SandboxConfig = SandboxConfig;
|
|
6607
|
+
type index$6_SandboxExecutionContext = SandboxExecutionContext;
|
|
6608
|
+
type index$6_SandboxImplementation = SandboxImplementation;
|
|
6609
|
+
declare const index$6_createSandbox: typeof createSandbox;
|
|
6610
|
+
declare namespace index$6 {
|
|
6611
|
+
export { bwrap as Bwrap, type index$6_PreparedSandboxCommand as PreparedSandboxCommand, type index$6_Sandbox as Sandbox, type index$6_SandboxBackend as SandboxBackend, type index$6_SandboxConfig as SandboxConfig, type index$6_SandboxExecutionContext as SandboxExecutionContext, type index$6_SandboxImplementation as SandboxImplementation, sandboxRuntime as SandboxRuntime, seatbelt as Seatbelt, index$6_createSandbox as createSandbox };
|
|
6550
6612
|
}
|
|
6551
6613
|
|
|
6552
6614
|
/**
|
|
@@ -6691,8 +6753,9 @@ declare const CUSTOM_AGENT_DISALLOWED_TOOLS: Set<AllTools>;
|
|
|
6691
6753
|
declare const ASYNC_AGENT_ALLOWED_TOOLS: Set<AllTools>;
|
|
6692
6754
|
/**
|
|
6693
6755
|
* Multi-layer tool filtering, applied in order:
|
|
6694
|
-
* 1. MCP tools (mcp__*) —
|
|
6695
|
-
*
|
|
6756
|
+
* 1. MCP tools (mcp__*) — exempt from layers 2-4, but still subject to
|
|
6757
|
+
* definition-level disallowedTools/tools (layers 5-6)
|
|
6758
|
+
* 2. SUBAGENT_DISALLOWED_TOOLS — Globally disallowed (prevents recursion)
|
|
6696
6759
|
* 3. CUSTOM_AGENT_DISALLOWED_TOOLS — Additional restrictions for custom Agents
|
|
6697
6760
|
* 4. ASYNC_AGENT_ALLOWED_TOOLS — Whitelist for background Agents
|
|
6698
6761
|
* 5. Definition-level disallowedTools — Blacklist
|
|
@@ -6736,7 +6799,7 @@ declare namespace toolFilter {
|
|
|
6736
6799
|
* SOFTWARE.
|
|
6737
6800
|
*/
|
|
6738
6801
|
|
|
6739
|
-
declare namespace index$
|
|
6802
|
+
declare namespace index$5 {
|
|
6740
6803
|
export { agentTool as AgentTool, definition as Definition, loader as Loader, spawn as Spawn, taskManager as TaskManager, toolFilter as ToolFilter };
|
|
6741
6804
|
}
|
|
6742
6805
|
|
|
@@ -6763,8 +6826,16 @@ declare namespace index$6 {
|
|
|
6763
6826
|
*/
|
|
6764
6827
|
|
|
6765
6828
|
declare const TOOL_RESULT_PREVIEW_CHARS = 2000;
|
|
6829
|
+
declare function spillDir(workDir: string, sessionId: string): string;
|
|
6766
6830
|
declare function toDisplayPreview(content: string): string;
|
|
6767
6831
|
declare function replaceToolResultContent(result: ToolResultBlock, content: string): void;
|
|
6832
|
+
/**
|
|
6833
|
+
* The `<persisted-output>` wrapper text. buildSpillPreview derives the inputs
|
|
6834
|
+
* from an in-memory string; tool-level producers (e.g. a backgrounded Bash
|
|
6835
|
+
* command's live output file) build the same wrapper from a stat + partial
|
|
6836
|
+
* read without ever loading the full content into JS.
|
|
6837
|
+
*/
|
|
6838
|
+
declare function buildPersistedOutputPreview(totalChars: number, preview: string, spillPath: string): string;
|
|
6768
6839
|
/**
|
|
6769
6840
|
* Determine whether a tool call is reading back a file under the spill
|
|
6770
6841
|
* directory. Such results are not spilled: writing the model's freshly-read
|
|
@@ -6790,19 +6861,22 @@ declare function isSpillReadback(toolName: string, args: Record<string, unknown>
|
|
|
6790
6861
|
declare function applyBudget(toolResults: ToolResultBlock[], workDir: string, sessionId: string, exemptIds?: Set<string>): void;
|
|
6791
6862
|
/**
|
|
6792
6863
|
* Spill an oversized tool output to disk and return the preview text. On
|
|
6793
|
-
* write failure the content is returned unchanged. Called from agent.ts
|
|
6794
|
-
* tool results enter the conversation history,
|
|
6864
|
+
* write failure the content is returned unchanged. Called from agent/index.ts
|
|
6865
|
+
* (and tools/javascript.ts) when tool results enter the conversation history,
|
|
6866
|
+
* in place of direct truncation.
|
|
6795
6867
|
*/
|
|
6796
6868
|
declare function persistLargeResult(workDir: string, sessionId: string, toolUseId: string, content: string): string;
|
|
6797
6869
|
|
|
6798
|
-
declare const index$
|
|
6799
|
-
declare const index$
|
|
6800
|
-
declare const index$
|
|
6801
|
-
declare const index$
|
|
6802
|
-
declare const index$
|
|
6803
|
-
declare const index$
|
|
6804
|
-
declare
|
|
6805
|
-
|
|
6870
|
+
declare const index$4_TOOL_RESULT_PREVIEW_CHARS: typeof TOOL_RESULT_PREVIEW_CHARS;
|
|
6871
|
+
declare const index$4_applyBudget: typeof applyBudget;
|
|
6872
|
+
declare const index$4_buildPersistedOutputPreview: typeof buildPersistedOutputPreview;
|
|
6873
|
+
declare const index$4_isSpillReadback: typeof isSpillReadback;
|
|
6874
|
+
declare const index$4_persistLargeResult: typeof persistLargeResult;
|
|
6875
|
+
declare const index$4_replaceToolResultContent: typeof replaceToolResultContent;
|
|
6876
|
+
declare const index$4_spillDir: typeof spillDir;
|
|
6877
|
+
declare const index$4_toDisplayPreview: typeof toDisplayPreview;
|
|
6878
|
+
declare namespace index$4 {
|
|
6879
|
+
export { index$4_TOOL_RESULT_PREVIEW_CHARS as TOOL_RESULT_PREVIEW_CHARS, index$4_applyBudget as applyBudget, index$4_buildPersistedOutputPreview as buildPersistedOutputPreview, index$4_isSpillReadback as isSpillReadback, index$4_persistLargeResult as persistLargeResult, index$4_replaceToolResultContent as replaceToolResultContent, index$4_spillDir as spillDir, index$4_toDisplayPreview as toDisplayPreview };
|
|
6806
6880
|
}
|
|
6807
6881
|
|
|
6808
6882
|
/**
|
|
@@ -6834,6 +6908,18 @@ declare class BashTool implements Tool {
|
|
|
6834
6908
|
sandbox: Sandbox | null;
|
|
6835
6909
|
sandboxRequired: boolean;
|
|
6836
6910
|
sandboxConfig: SandboxConfig;
|
|
6911
|
+
/**
|
|
6912
|
+
* Background task registry, injected by the host (UI / print mode / remote
|
|
6913
|
+
* server) — the same instance the Agent tool uses, so completion
|
|
6914
|
+
* notifications share one drain and TaskStop covers both. When null, Bash is
|
|
6915
|
+
* foreground-only: run_in_background disappears from the schema, timeouts
|
|
6916
|
+
* kill, and Ctrl+B is a no-op. Calls running inside a subagent loop carry
|
|
6917
|
+
* that loop's own manager in ctx.taskManager, which takes precedence.
|
|
6918
|
+
*/
|
|
6919
|
+
taskManager: TaskManager | null;
|
|
6920
|
+
/** Running foreground executions eligible for manual backgrounding (Ctrl+B). */
|
|
6921
|
+
private foreground;
|
|
6922
|
+
private nextForegroundId;
|
|
6837
6923
|
/**
|
|
6838
6924
|
* Read-only commands can run concurrently with other read-only tools;
|
|
6839
6925
|
* mutating commands must run exclusively.
|
|
@@ -6845,8 +6931,30 @@ declare class BashTool implements Tool {
|
|
|
6845
6931
|
* pipes, command chaining, and command substitution are already excluded.
|
|
6846
6932
|
*/
|
|
6847
6933
|
isConcurrencySafe(args: Record<string, unknown>): boolean;
|
|
6934
|
+
/**
|
|
6935
|
+
* The background subsystem needs a task manager and can be disabled
|
|
6936
|
+
* wholesale with SWIFTY_DISABLE_BACKGROUND_TASKS=1 (schema parameter
|
|
6937
|
+
* removed, timeouts kill, Ctrl+B becomes a no-op). Instance-level gate used
|
|
6938
|
+
* by the schema; execute() re-checks with the ctx-resolved manager.
|
|
6939
|
+
*/
|
|
6940
|
+
backgroundEnabled(): boolean;
|
|
6941
|
+
/** True while at least one foreground Bash command runs (gates the Ctrl+B handler). */
|
|
6942
|
+
hasForegroundTasks(): boolean;
|
|
6943
|
+
/**
|
|
6944
|
+
* Move every running foreground Bash command to the background (Ctrl+B).
|
|
6945
|
+
* Returns how many commands were actually backgrounded.
|
|
6946
|
+
*/
|
|
6947
|
+
backgroundForegroundTasks(): number;
|
|
6848
6948
|
schema(): ToolSchema;
|
|
6849
6949
|
execute(ctx: ToolContext, args: Record<string, unknown>): Promise<ToolResult>;
|
|
6950
|
+
/**
|
|
6951
|
+
* Spawn the command with stdout+stderr writing directly into the output
|
|
6952
|
+
* file (ccb's file-descriptor mode): output never flows through JS, so
|
|
6953
|
+
* backgrounding is a bookkeeping switch — no re-spawn, no buffer handover.
|
|
6954
|
+
* The returned handle exposes the tool-call promise plus a background()
|
|
6955
|
+
* trigger that transitions the running command into a TaskManager task.
|
|
6956
|
+
*/
|
|
6957
|
+
private startCommand;
|
|
6850
6958
|
}
|
|
6851
6959
|
|
|
6852
6960
|
type bash_BashTool = BashTool;
|
|
@@ -6916,7 +7024,6 @@ declare class ComputerUseTool implements Tool {
|
|
|
6916
7024
|
private macHelperPromise?;
|
|
6917
7025
|
constructor(options?: ComputerUseToolOptions);
|
|
6918
7026
|
isConcurrencySafe(_args: Record<string, unknown>): boolean;
|
|
6919
|
-
providerSchema(protocol: ToolProtocol): ProviderNativeToolSchema | undefined;
|
|
6920
7027
|
schema(): ToolSchema;
|
|
6921
7028
|
execute(ctx: ToolContext, args: Record<string, unknown>): Promise<ToolResult>;
|
|
6922
7029
|
/** Execute one Anthropic-style action (also the per-item path for batches). */
|
|
@@ -6969,8 +7076,28 @@ declare namespace computerUse {
|
|
|
6969
7076
|
* SOFTWARE.
|
|
6970
7077
|
*/
|
|
6971
7078
|
declare const BASH_DESCRIPTION = "Execute command in Bash; return stdout and stderr. Prefer PowerShell on Windows.\n- timeout is in seconds: default 120, maximum 600. Each call starts a fresh, independent shell in the Agent's working directory; cd, variables, functions, and options do not persist.\n- Quote paths with spaces. To change directory, use cd \"path\" && command in the same call. Separate independent commands; chain dependent commands with &&, not ;.\n- Prefer dedicated file/search tools over cat, head, tail, sed, awk, echo, or find. Scope searches to a directory, never the filesystem root. Diagnose failures rather than retrying in sleep loops.\nGit: commit or push only when requested. Destructive operations (push --force, reset --hard, checkout ., clean -f, branch -D), amending, or skipping hooks/signing require explicit authorization; never bypass permission/hook denials. Prefer new commits. When committing, include Co-Authored-By: Swifty <usr161043261@outlook.com>.";
|
|
7079
|
+
/**
|
|
7080
|
+
* Appended to the Bash schema description only when background execution is
|
|
7081
|
+
* available (a TaskManager is wired and not disabled via env), so the
|
|
7082
|
+
* run_in_background parameter and its guidance never advertise a capability
|
|
7083
|
+
* the current host cannot deliver.
|
|
7084
|
+
*/
|
|
7085
|
+
declare const BASH_BACKGROUND_DESCRIPTION = "- Set run_in_background to true to run the command in the background. The call returns a task ID immediately and the result arrives later as a task notification; do not poll or sleep waiting for it. Use this for long-running commands you do not need the result of right away. Use TaskStop with the task_id to kill a background command early. A foreground command that exceeds its timeout is moved to the background automatically instead of being killed, unless it is a bare sleep.";
|
|
6972
7086
|
declare const POWERSHELL_DESCRIPTION = "Execute command in PowerShell; return stdout and stderr. Recommended on Windows (powershell.exe); uses pwsh elsewhere.\n- timeout is in seconds: default 120, maximum 600. Each call starts a fresh, independent shell in the Agent's working directory; location, variables, and options do not persist.\n- Quote paths with spaces; use Set-Location -LiteralPath \"path\" in the same call. Separate independent commands. For dependencies, check $LASTEXITCODE for native commands and use -ErrorAction Stop for cmdlets; ; does not stop on failure. Do not assume PowerShell 7 syntax.\n- Prefer dedicated file/search tools over Get-Content, Select-String, or Write-Output. Scope recursion to a directory, not a drive root. Diagnose failures rather than retrying in Start-Sleep loops.\nGit: commit or push only when requested. Destructive operations (push --force, reset --hard, checkout ., clean -f, branch -D), amending, or skipping hooks/signing require explicit authorization; never bypass permission/hook denials. Prefer new commits. When committing, include Co-Authored-By: Swifty <usr161043261@outlook.com>.";
|
|
7087
|
+
/**
|
|
7088
|
+
* Appended to the PowerShell schema description only when background execution
|
|
7089
|
+
* is available; mirrors BASH_BACKGROUND_DESCRIPTION with PS-flavored wording.
|
|
7090
|
+
*/
|
|
7091
|
+
declare const POWERSHELL_BACKGROUND_DESCRIPTION = "- Set run_in_background to true to run the command in the background. The call returns a task ID immediately and the result arrives later as a task notification; do not poll or Start-Sleep waiting for it. Use this for long-running commands you do not need the result of right away. Use TaskStop with the task_id to kill a background command early. A foreground command that exceeds its timeout is moved to the background automatically instead of being killed, unless it is a bare Start-Sleep.";
|
|
6973
7092
|
declare const JAVASCRIPT_DESCRIPTION = "Execute JavaScript in a fresh isolated V8 context for pure computation.\n- Provide a function body and use return to produce a JSON-compatible result. Optional input is available as globalThis.input.\n- No filesystem, network, process, require, imports, timers, or host callbacks are available. Use Bash for Node.js or system operations.\n- timeout_ms defaults to 1000 (max 10000); memory_limit_mb defaults to 64 (max 256). Requires Node.js 24 or newer.";
|
|
7093
|
+
/**
|
|
7094
|
+
* Appended to the JavaScript schema description only when background execution
|
|
7095
|
+
* is available. No timeout auto-background here: timeout_ms is the isolate's
|
|
7096
|
+
* hard safety cap — V8 kills a synchronous script at the cap, and a wall-clock
|
|
7097
|
+
* deadline disposes the isolate when an evaluation is suspended on a promise —
|
|
7098
|
+
* so there is nothing left to keep running.
|
|
7099
|
+
*/
|
|
7100
|
+
declare const JAVASCRIPT_BACKGROUND_DESCRIPTION = "- Set run_in_background to true to evaluate in the background. The call returns a task ID immediately and the result arrives later as a task notification; do not poll. timeout_ms still caps the evaluation (max 10000). Use TaskStop with the task_id to abort it early.";
|
|
6974
7101
|
declare const READ_FILE_DESCRIPTION = "Read text with 1-based display line numbers, or images (png, jpg, jpeg, gif, webp) as visual content; not directories.\n- file_path is absolute or relative to the Agent's working directory. offset skips lines (0-based, default 0); limit defaults to 2000 lines, with a 50KB text output cap. Displayed line 101 starts at offset=100. Follow continuation/readback instructions for partial output.\n- Images ignore offset/limit. A successful read refreshes the file-state cache used by EditFile/WriteFile; re-read after an external-change error.";
|
|
6975
7102
|
declare const EDIT_FILE_DESCRIPTION = "Replace exact text in an existing file and return a diff. Prefer this over whole-file rewrites.\n- file_path is absolute or relative to the Agent's working directory. ReadFile is required first; stale file-state errors require a fresh read and revised edit.\n- old_string must be non-empty and unique unless replace_all=true (default false). Use enough context to disambiguate; preserve whitespace and exclude display line numbers.\n- new_string must differ from old_string; an empty string deletes the match.";
|
|
6976
7103
|
declare const WRITE_FILE_DESCRIPTION = "Write complete UTF-8 content to file_path, creating parent directories and overwriting existing content. Use for new files or complete rewrites; prefer EditFile for targeted changes.\n- file_path is absolute or relative to the Agent's working directory. Existing files require ReadFile first; re-read if the cached state is stale.\n- content includes any desired trailing newline; an empty string creates or truncates an empty file. Avoid unrelated files or unsolicited documentation.";
|
|
@@ -6978,17 +7105,20 @@ declare const GLOB_DESCRIPTION = "Find files by glob pattern (e.g. \"**/*.ts\",
|
|
|
6978
7105
|
declare const GREP_DESCRIPTION = "Search file content with a case-insensitive, line-by-line JavaScript-style regex pattern; return file:line:content with 1-based lines and working-directory-relative paths.\n- path is a file or directory, absolute or relative to the Agent's working directory (default \".\"). Escape regex backslashes in JSON. No multiline matching or general PCRE support.\n- include is an optional glob: \"*.ts\" matches names at any depth; patterns with \"/\" match working-directory-relative paths. A direct file path is searched without this filter.\n- Traversal includes dotfiles but skips fixed directories such as .git, .agents, .swifty, node_modules, dist, and __pycache__, not .gitignore rules. Binary/unreadable files are skipped; directory symlinks are not traversed.\n- At most 500 matching lines. Narrow searches; never search the filesystem root. Use ReadFile for context and this tool instead of shell grep/rg.";
|
|
6979
7106
|
declare const WEB_FETCH_DESCRIPTION = "Fetch a URL over HTTP(S) and return its content as Markdown. Use it to retrieve and analyze web pages.\n- url must be a fully-formed http or https URL; redirects are followed automatically and the final URL is reported when it differs.\n- HTML is converted to Markdown; other text formats (plain text, JSON, XML, Markdown) are returned as-is. Binary content (images, PDFs, archives) is rejected.\n- Responses over 10MB are rejected and results are truncated at 100K characters. Successful fetches are cached for 15 minutes.";
|
|
6980
7107
|
|
|
7108
|
+
declare const descriptions_BASH_BACKGROUND_DESCRIPTION: typeof BASH_BACKGROUND_DESCRIPTION;
|
|
6981
7109
|
declare const descriptions_BASH_DESCRIPTION: typeof BASH_DESCRIPTION;
|
|
6982
7110
|
declare const descriptions_EDIT_FILE_DESCRIPTION: typeof EDIT_FILE_DESCRIPTION;
|
|
6983
7111
|
declare const descriptions_GLOB_DESCRIPTION: typeof GLOB_DESCRIPTION;
|
|
6984
7112
|
declare const descriptions_GREP_DESCRIPTION: typeof GREP_DESCRIPTION;
|
|
7113
|
+
declare const descriptions_JAVASCRIPT_BACKGROUND_DESCRIPTION: typeof JAVASCRIPT_BACKGROUND_DESCRIPTION;
|
|
6985
7114
|
declare const descriptions_JAVASCRIPT_DESCRIPTION: typeof JAVASCRIPT_DESCRIPTION;
|
|
7115
|
+
declare const descriptions_POWERSHELL_BACKGROUND_DESCRIPTION: typeof POWERSHELL_BACKGROUND_DESCRIPTION;
|
|
6986
7116
|
declare const descriptions_POWERSHELL_DESCRIPTION: typeof POWERSHELL_DESCRIPTION;
|
|
6987
7117
|
declare const descriptions_READ_FILE_DESCRIPTION: typeof READ_FILE_DESCRIPTION;
|
|
6988
7118
|
declare const descriptions_WEB_FETCH_DESCRIPTION: typeof WEB_FETCH_DESCRIPTION;
|
|
6989
7119
|
declare const descriptions_WRITE_FILE_DESCRIPTION: typeof WRITE_FILE_DESCRIPTION;
|
|
6990
7120
|
declare namespace descriptions {
|
|
6991
|
-
export { descriptions_BASH_DESCRIPTION as BASH_DESCRIPTION, descriptions_EDIT_FILE_DESCRIPTION as EDIT_FILE_DESCRIPTION, descriptions_GLOB_DESCRIPTION as GLOB_DESCRIPTION, descriptions_GREP_DESCRIPTION as GREP_DESCRIPTION, descriptions_JAVASCRIPT_DESCRIPTION as JAVASCRIPT_DESCRIPTION, descriptions_POWERSHELL_DESCRIPTION as POWERSHELL_DESCRIPTION, descriptions_READ_FILE_DESCRIPTION as READ_FILE_DESCRIPTION, descriptions_WEB_FETCH_DESCRIPTION as WEB_FETCH_DESCRIPTION, descriptions_WRITE_FILE_DESCRIPTION as WRITE_FILE_DESCRIPTION };
|
|
7121
|
+
export { descriptions_BASH_BACKGROUND_DESCRIPTION as BASH_BACKGROUND_DESCRIPTION, descriptions_BASH_DESCRIPTION as BASH_DESCRIPTION, descriptions_EDIT_FILE_DESCRIPTION as EDIT_FILE_DESCRIPTION, descriptions_GLOB_DESCRIPTION as GLOB_DESCRIPTION, descriptions_GREP_DESCRIPTION as GREP_DESCRIPTION, descriptions_JAVASCRIPT_BACKGROUND_DESCRIPTION as JAVASCRIPT_BACKGROUND_DESCRIPTION, descriptions_JAVASCRIPT_DESCRIPTION as JAVASCRIPT_DESCRIPTION, descriptions_POWERSHELL_BACKGROUND_DESCRIPTION as POWERSHELL_BACKGROUND_DESCRIPTION, descriptions_POWERSHELL_DESCRIPTION as POWERSHELL_DESCRIPTION, descriptions_READ_FILE_DESCRIPTION as READ_FILE_DESCRIPTION, descriptions_WEB_FETCH_DESCRIPTION as WEB_FETCH_DESCRIPTION, descriptions_WRITE_FILE_DESCRIPTION as WRITE_FILE_DESCRIPTION };
|
|
6992
7122
|
}
|
|
6993
7123
|
|
|
6994
7124
|
/**
|
|
@@ -7107,6 +7237,47 @@ declare namespace enterWorktree {
|
|
|
7107
7237
|
export { enterWorktree_EnterWorktreeTool as EnterWorktreeTool };
|
|
7108
7238
|
}
|
|
7109
7239
|
|
|
7240
|
+
/**
|
|
7241
|
+
* Copyright (c) 2026 hangtiancheng
|
|
7242
|
+
*
|
|
7243
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7244
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
7245
|
+
* in the Software without restriction, including without limitation the rights
|
|
7246
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7247
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
7248
|
+
* furnished to do so, subject to the following conditions:
|
|
7249
|
+
*
|
|
7250
|
+
* The above copyright notice and this permission notice shall be included in
|
|
7251
|
+
* all copies or substantial portions of the Software.
|
|
7252
|
+
*
|
|
7253
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
7254
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
7255
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
7256
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
7257
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
7258
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
7259
|
+
* SOFTWARE.
|
|
7260
|
+
*/
|
|
7261
|
+
/**
|
|
7262
|
+
* Extract the base command name from a command string.
|
|
7263
|
+
* For piped commands, take the last segment: bash and PowerShell both surface
|
|
7264
|
+
* the exit code of the last command in a pipeline.
|
|
7265
|
+
*/
|
|
7266
|
+
declare function extractBaseCmd(command: string): string;
|
|
7267
|
+
/**
|
|
7268
|
+
* Return a semantic hint for a non-zero exit code, helping the LLM understand
|
|
7269
|
+
* what the code means. Command-specific hints win over generic ones; POSIX
|
|
7270
|
+
* 128+n signal exits get a fallback description. Returns empty string when
|
|
7271
|
+
* nothing is recognized.
|
|
7272
|
+
*/
|
|
7273
|
+
declare function exitCodeHint(command: string, exitCode: number): string;
|
|
7274
|
+
|
|
7275
|
+
declare const exitCodeHints_exitCodeHint: typeof exitCodeHint;
|
|
7276
|
+
declare const exitCodeHints_extractBaseCmd: typeof extractBaseCmd;
|
|
7277
|
+
declare namespace exitCodeHints {
|
|
7278
|
+
export { exitCodeHints_exitCodeHint as exitCodeHint, exitCodeHints_extractBaseCmd as extractBaseCmd };
|
|
7279
|
+
}
|
|
7280
|
+
|
|
7110
7281
|
/**
|
|
7111
7282
|
* Copyright (c) 2026 hangtiancheng
|
|
7112
7283
|
*
|
|
@@ -7331,8 +7502,35 @@ declare class JavaScriptTool implements Tool {
|
|
|
7331
7502
|
name: string;
|
|
7332
7503
|
description: string;
|
|
7333
7504
|
category: ToolCategory;
|
|
7505
|
+
/**
|
|
7506
|
+
* Background task registry, injected by the host — same contract as
|
|
7507
|
+
* BashTool.taskManager. Unlike the shell tools there is no timeout
|
|
7508
|
+
* auto-background: timeout_ms is the isolate's hard safety cap — V8 kills a
|
|
7509
|
+
* synchronous script at the cap, and a wall-clock deadline disposes the
|
|
7510
|
+
* isolate when an evaluation is suspended on a promise — so nothing is left
|
|
7511
|
+
* to keep running.
|
|
7512
|
+
*/
|
|
7513
|
+
taskManager: TaskManager | null;
|
|
7514
|
+
/** Running foreground evaluations eligible for manual backgrounding (Ctrl+B). */
|
|
7515
|
+
private foreground;
|
|
7516
|
+
private nextForegroundId;
|
|
7517
|
+
/** Instance-level background gate; see BashTool.backgroundEnabled. */
|
|
7518
|
+
backgroundEnabled(): boolean;
|
|
7519
|
+
/** True while at least one foreground evaluation runs. */
|
|
7520
|
+
hasForegroundTasks(): boolean;
|
|
7521
|
+
/** Move every running foreground evaluation to the background (Ctrl+B). */
|
|
7522
|
+
backgroundForegroundTasks(): number;
|
|
7334
7523
|
schema(): ToolSchema;
|
|
7335
7524
|
execute(ctx: ToolContext, args: Record<string, unknown>): Promise<ToolResult>;
|
|
7525
|
+
/**
|
|
7526
|
+
* Start the isolated evaluation. The returned handle mirrors the shell
|
|
7527
|
+
* tools: background() transitions the pending evaluation into a TaskManager
|
|
7528
|
+
* task — the isolate keeps running on its own thread, the tool call
|
|
7529
|
+
* resolves immediately, and completion arrives as a task notification.
|
|
7530
|
+
* While foreground, the caller's abort signal (Esc) disposes the isolate;
|
|
7531
|
+
* once backgrounded, only TaskStop or session shutdown can abort it.
|
|
7532
|
+
*/
|
|
7533
|
+
private startEvaluation;
|
|
7336
7534
|
}
|
|
7337
7535
|
|
|
7338
7536
|
type javascript_JavaScriptEvaluation = JavaScriptEvaluation;
|
|
@@ -7367,13 +7565,16 @@ declare namespace javascript {
|
|
|
7367
7565
|
* SOFTWARE.
|
|
7368
7566
|
*/
|
|
7369
7567
|
/**
|
|
7370
|
-
* Unified call entry point for MCP tools
|
|
7568
|
+
* Unified call entry point for MCP tools (dispatch mode only — see
|
|
7569
|
+
* mcp/strategy.ts for the eager/native modes, where MCP tools ship in tools[]
|
|
7570
|
+
* directly or stay there flagged with defer_loading).
|
|
7371
7571
|
*
|
|
7372
|
-
* MCP tools never enter tools[]. The model first reads the
|
|
7373
|
-
* then passes the tool name and arguments through
|
|
7374
|
-
* array byte-identical throughout the whole
|
|
7375
|
-
*
|
|
7376
|
-
*
|
|
7572
|
+
* In dispatch mode MCP tools never enter tools[]. The model first reads the
|
|
7573
|
+
* schema via ToolSearch, then passes the tool name and arguments through
|
|
7574
|
+
* McpCall. This keeps the tools array byte-identical throughout the whole
|
|
7575
|
+
* session, so the prompt cache prefix is never broken — tools render after
|
|
7576
|
+
* system and before messages, so any change to the array forces the entire
|
|
7577
|
+
* trailing history to be recomputed.
|
|
7377
7578
|
*
|
|
7378
7579
|
* The trade-off is that arguments are generated freely by the model with no schema
|
|
7379
7580
|
* constraint at the interface level, so the JSON type is occasionally wrong.
|
|
@@ -7458,8 +7659,30 @@ declare class PowerShellTool implements Tool {
|
|
|
7458
7659
|
name: string;
|
|
7459
7660
|
description: string;
|
|
7460
7661
|
category: ToolCategory;
|
|
7662
|
+
/**
|
|
7663
|
+
* Background task registry, injected by the host — same contract as
|
|
7664
|
+
* BashTool.taskManager (schema gating, timeout auto-background, Ctrl+B).
|
|
7665
|
+
* Calls running inside a subagent loop carry that loop's own manager in
|
|
7666
|
+
* ctx.taskManager, which takes precedence.
|
|
7667
|
+
*/
|
|
7668
|
+
taskManager: TaskManager | null;
|
|
7669
|
+
/** Running foreground executions eligible for manual backgrounding (Ctrl+B). */
|
|
7670
|
+
private foreground;
|
|
7671
|
+
private nextForegroundId;
|
|
7672
|
+
/** Instance-level background gate; see BashTool.backgroundEnabled. */
|
|
7673
|
+
backgroundEnabled(): boolean;
|
|
7674
|
+
/** True while at least one foreground PowerShell command runs. */
|
|
7675
|
+
hasForegroundTasks(): boolean;
|
|
7676
|
+
/** Move every running foreground command to the background (Ctrl+B). */
|
|
7677
|
+
backgroundForegroundTasks(): number;
|
|
7461
7678
|
schema(): ToolSchema;
|
|
7462
7679
|
execute(ctx: ToolContext, args: Record<string, unknown>): Promise<ToolResult>;
|
|
7680
|
+
/**
|
|
7681
|
+
* Spawn PowerShell with stdout+stderr writing directly into the output file
|
|
7682
|
+
* (fd mode, shared with BashTool): output never flows through JS, so
|
|
7683
|
+
* backgrounding is a bookkeeping switch — no re-spawn, no buffer handover.
|
|
7684
|
+
*/
|
|
7685
|
+
private startCommand;
|
|
7463
7686
|
}
|
|
7464
7687
|
|
|
7465
7688
|
type powershell_PowerShellTool = PowerShellTool;
|
|
@@ -7505,6 +7728,138 @@ declare namespace readFile {
|
|
|
7505
7728
|
export { readFile_ReadFileTool as ReadFileTool };
|
|
7506
7729
|
}
|
|
7507
7730
|
|
|
7731
|
+
/** Notification body budget: larger outputs stay on disk and only a preview travels in the notification. */
|
|
7732
|
+
declare const BACKGROUND_NOTIFICATION_CHARS = 30000;
|
|
7733
|
+
/**
|
|
7734
|
+
* ccb parity: a backgrounded command may fill up to 5GB before the size
|
|
7735
|
+
* watchdog kills it (their incident: a stuck append loop wrote 768GB with no
|
|
7736
|
+
* JS in the write path to notice). Foreground keeps the historical 10MB cap.
|
|
7737
|
+
*/
|
|
7738
|
+
declare const BACKGROUND_MAX_OUTPUT_BYTES: number;
|
|
7739
|
+
declare const SIZE_WATCHDOG_INTERVAL_MS = 500;
|
|
7740
|
+
/** Why a command moved to the background. */
|
|
7741
|
+
type BackgroundReason = "explicit" | "user" | "timeout";
|
|
7742
|
+
/** Terminal facts about the child process, consumed to build results and notifications. */
|
|
7743
|
+
interface ShellExit {
|
|
7744
|
+
code: number | null;
|
|
7745
|
+
signal: NodeJS.Signals | null;
|
|
7746
|
+
aborted: boolean;
|
|
7747
|
+
timedOut: boolean;
|
|
7748
|
+
sizeKilled: boolean;
|
|
7749
|
+
spawnError?: string;
|
|
7750
|
+
}
|
|
7751
|
+
interface CommandHandle {
|
|
7752
|
+
/** Resolves the tool call: either the inline completion or an early "moved to background" message. */
|
|
7753
|
+
result: Promise<ToolResult>;
|
|
7754
|
+
/**
|
|
7755
|
+
* Move the running command to the background. Returns the background task ID,
|
|
7756
|
+
* or null when the command already finished or backgrounding is unavailable.
|
|
7757
|
+
*/
|
|
7758
|
+
background: (reason: BackgroundReason) => string | null;
|
|
7759
|
+
}
|
|
7760
|
+
/**
|
|
7761
|
+
* Whether a command may be *automatically* backgrounded on timeout. Bare
|
|
7762
|
+
* sleeps are killed instead: backgrounding one would just hold a task slot
|
|
7763
|
+
* until session end. Explicit run_in_background and manual Ctrl+B are always
|
|
7764
|
+
* honored regardless of this gate. Only the first token is considered:
|
|
7765
|
+
* `sleep 60` should die on timeout, but `npm run build && sleep 1` is a real
|
|
7766
|
+
* workload worth keeping alive.
|
|
7767
|
+
*/
|
|
7768
|
+
declare function isAutobackgroundingAllowed(command: string, disallowed: ReadonlySet<string>): boolean;
|
|
7769
|
+
declare function backgroundTaskName(command: string): string;
|
|
7770
|
+
declare function backgroundMessage(reason: BackgroundReason, taskId: string, timeout: number): string;
|
|
7771
|
+
/** Slice buf to at most maxBytes, ending on a UTF-8 character boundary. */
|
|
7772
|
+
declare function sliceUtf8Safe(buf: Buffer, maxBytes: number): Buffer;
|
|
7773
|
+
/** Read at most maxBytes of the output file; missing files read as empty. */
|
|
7774
|
+
declare function readOutputFile(path: string, maxBytes: number): {
|
|
7775
|
+
text: string;
|
|
7776
|
+
size: number;
|
|
7777
|
+
truncated: boolean;
|
|
7778
|
+
};
|
|
7779
|
+
declare function unlinkQuiet(path: string): void;
|
|
7780
|
+
declare function discardFd(fd: number): void;
|
|
7781
|
+
declare function openOutputFd(path: string): number;
|
|
7782
|
+
/**
|
|
7783
|
+
* Create the file that receives a command's stdout+stderr. Lives in the
|
|
7784
|
+
* session tool-results directory (the established spill location, readable by
|
|
7785
|
+
* the model for backgrounded commands); falls back to the OS temp dir when
|
|
7786
|
+
* that directory cannot be created.
|
|
7787
|
+
*/
|
|
7788
|
+
declare function createShellOutputFile(workDir: string, sessionId: string): {
|
|
7789
|
+
path: string;
|
|
7790
|
+
fd: number;
|
|
7791
|
+
};
|
|
7792
|
+
/**
|
|
7793
|
+
* Build the foreground tool result from exit facts and the captured output.
|
|
7794
|
+
* Shared verbatim by the inline foreground path and the background task
|
|
7795
|
+
* notification body, so both report identically. `prompt` is the tool's shell
|
|
7796
|
+
* marker ("$ " for Bash, "PS> " for PowerShell).
|
|
7797
|
+
*/
|
|
7798
|
+
declare function formatFinalResult(prompt: string, command: string, exit: ShellExit, merged: string, truncated: boolean, timeout: number): ToolResult;
|
|
7799
|
+
/**
|
|
7800
|
+
* Build the notification body for a finished background command from the
|
|
7801
|
+
* output file. Small outputs are inlined and the file is deleted; large
|
|
7802
|
+
* outputs keep the file on disk and the notification carries its path with a
|
|
7803
|
+
* 2000-char preview, so the full text stays readable via ReadFile without ever
|
|
7804
|
+
* loading it into JS here. `annotate` is the sandbox's stderr annotator
|
|
7805
|
+
* (sandbox-runtime violation notes); the foreground path applies it in
|
|
7806
|
+
* settleExit, and background notifications must report identically.
|
|
7807
|
+
*/
|
|
7808
|
+
declare function buildBackgroundBody(prompt: string, command: string, exit: ShellExit, outputPath: string, timeout: number, annotate?: (text: string) => string): ToolResult;
|
|
7809
|
+
/** The subset of a tool instance the host wiring below needs. */
|
|
7810
|
+
interface BackgroundableTool {
|
|
7811
|
+
taskManager: TaskManager | null;
|
|
7812
|
+
backgroundEnabled(): boolean;
|
|
7813
|
+
hasForegroundTasks(): boolean;
|
|
7814
|
+
backgroundForegroundTasks(): number;
|
|
7815
|
+
}
|
|
7816
|
+
/** Tools that support background execution, in Ctrl+B priority order. */
|
|
7817
|
+
declare const BACKGROUNDABLE_TOOL_NAMES: readonly ["Bash", "PowerShell", "JavaScript"];
|
|
7818
|
+
/**
|
|
7819
|
+
* Share one background task registry across every backgroundable tool in the
|
|
7820
|
+
* registry, so run_in_background, Ctrl+B and timeout auto-background deliver
|
|
7821
|
+
* results through the same task-notification drain as background agents.
|
|
7822
|
+
*/
|
|
7823
|
+
declare function attachBackgroundTaskManager(registry: ToolRegistry, manager: TaskManager): void;
|
|
7824
|
+
/**
|
|
7825
|
+
* Whether any backgroundable tool has a running foreground task. Gates the
|
|
7826
|
+
* Ctrl+B handler: the keypress must stay inert when nothing is running, so
|
|
7827
|
+
* other components that also bind Ctrl+B (e.g. the provider-login form's
|
|
7828
|
+
* cursor-back) don't double-fire.
|
|
7829
|
+
*/
|
|
7830
|
+
declare function hasAnyForegroundTasks(registry: ToolRegistry): boolean;
|
|
7831
|
+
/**
|
|
7832
|
+
* Move every running foreground task of every backgroundable tool to the
|
|
7833
|
+
* background (the Ctrl+B action). Returns how many were backgrounded.
|
|
7834
|
+
*/
|
|
7835
|
+
declare function backgroundAllForegroundTasks(registry: ToolRegistry): number;
|
|
7836
|
+
|
|
7837
|
+
declare const shellBackground_BACKGROUNDABLE_TOOL_NAMES: typeof BACKGROUNDABLE_TOOL_NAMES;
|
|
7838
|
+
declare const shellBackground_BACKGROUND_MAX_OUTPUT_BYTES: typeof BACKGROUND_MAX_OUTPUT_BYTES;
|
|
7839
|
+
declare const shellBackground_BACKGROUND_NOTIFICATION_CHARS: typeof BACKGROUND_NOTIFICATION_CHARS;
|
|
7840
|
+
type shellBackground_BackgroundReason = BackgroundReason;
|
|
7841
|
+
type shellBackground_BackgroundableTool = BackgroundableTool;
|
|
7842
|
+
type shellBackground_CommandHandle = CommandHandle;
|
|
7843
|
+
declare const shellBackground_SIZE_WATCHDOG_INTERVAL_MS: typeof SIZE_WATCHDOG_INTERVAL_MS;
|
|
7844
|
+
type shellBackground_ShellExit = ShellExit;
|
|
7845
|
+
declare const shellBackground_attachBackgroundTaskManager: typeof attachBackgroundTaskManager;
|
|
7846
|
+
declare const shellBackground_backgroundAllForegroundTasks: typeof backgroundAllForegroundTasks;
|
|
7847
|
+
declare const shellBackground_backgroundMessage: typeof backgroundMessage;
|
|
7848
|
+
declare const shellBackground_backgroundTaskName: typeof backgroundTaskName;
|
|
7849
|
+
declare const shellBackground_buildBackgroundBody: typeof buildBackgroundBody;
|
|
7850
|
+
declare const shellBackground_createShellOutputFile: typeof createShellOutputFile;
|
|
7851
|
+
declare const shellBackground_discardFd: typeof discardFd;
|
|
7852
|
+
declare const shellBackground_formatFinalResult: typeof formatFinalResult;
|
|
7853
|
+
declare const shellBackground_hasAnyForegroundTasks: typeof hasAnyForegroundTasks;
|
|
7854
|
+
declare const shellBackground_isAutobackgroundingAllowed: typeof isAutobackgroundingAllowed;
|
|
7855
|
+
declare const shellBackground_openOutputFd: typeof openOutputFd;
|
|
7856
|
+
declare const shellBackground_readOutputFile: typeof readOutputFile;
|
|
7857
|
+
declare const shellBackground_sliceUtf8Safe: typeof sliceUtf8Safe;
|
|
7858
|
+
declare const shellBackground_unlinkQuiet: typeof unlinkQuiet;
|
|
7859
|
+
declare namespace shellBackground {
|
|
7860
|
+
export { shellBackground_BACKGROUNDABLE_TOOL_NAMES as BACKGROUNDABLE_TOOL_NAMES, shellBackground_BACKGROUND_MAX_OUTPUT_BYTES as BACKGROUND_MAX_OUTPUT_BYTES, shellBackground_BACKGROUND_NOTIFICATION_CHARS as BACKGROUND_NOTIFICATION_CHARS, type shellBackground_BackgroundReason as BackgroundReason, type shellBackground_BackgroundableTool as BackgroundableTool, type shellBackground_CommandHandle as CommandHandle, shellBackground_SIZE_WATCHDOG_INTERVAL_MS as SIZE_WATCHDOG_INTERVAL_MS, type shellBackground_ShellExit as ShellExit, shellBackground_attachBackgroundTaskManager as attachBackgroundTaskManager, shellBackground_backgroundAllForegroundTasks as backgroundAllForegroundTasks, shellBackground_backgroundMessage as backgroundMessage, shellBackground_backgroundTaskName as backgroundTaskName, shellBackground_buildBackgroundBody as buildBackgroundBody, shellBackground_createShellOutputFile as createShellOutputFile, shellBackground_discardFd as discardFd, shellBackground_formatFinalResult as formatFinalResult, shellBackground_hasAnyForegroundTasks as hasAnyForegroundTasks, shellBackground_isAutobackgroundingAllowed as isAutobackgroundingAllowed, shellBackground_openOutputFd as openOutputFd, shellBackground_readOutputFile as readOutputFile, shellBackground_sliceUtf8Safe as sliceUtf8Safe, shellBackground_unlinkQuiet as unlinkQuiet };
|
|
7861
|
+
}
|
|
7862
|
+
|
|
7508
7863
|
/**
|
|
7509
7864
|
* Copyright (c) 2026 hangtiancheng
|
|
7510
7865
|
*
|
|
@@ -7684,7 +8039,7 @@ declare namespace toolSearch {
|
|
|
7684
8039
|
* SOFTWARE.
|
|
7685
8040
|
*/
|
|
7686
8041
|
|
|
7687
|
-
declare class
|
|
8042
|
+
declare class WebFetchTool implements Tool {
|
|
7688
8043
|
name: string;
|
|
7689
8044
|
description: string;
|
|
7690
8045
|
category: ToolCategory;
|
|
@@ -7692,10 +8047,10 @@ declare class WriteFileTool implements Tool {
|
|
|
7692
8047
|
execute(ctx: ToolContext, args: Record<string, unknown>): Promise<ToolResult>;
|
|
7693
8048
|
}
|
|
7694
8049
|
|
|
7695
|
-
type
|
|
7696
|
-
declare const
|
|
7697
|
-
declare namespace
|
|
7698
|
-
export {
|
|
8050
|
+
type webFetch_WebFetchTool = WebFetchTool;
|
|
8051
|
+
declare const webFetch_WebFetchTool: typeof WebFetchTool;
|
|
8052
|
+
declare namespace webFetch {
|
|
8053
|
+
export { webFetch_WebFetchTool as WebFetchTool };
|
|
7699
8054
|
}
|
|
7700
8055
|
|
|
7701
8056
|
/**
|
|
@@ -7720,247 +8075,18 @@ declare namespace writeFile {
|
|
|
7720
8075
|
* SOFTWARE.
|
|
7721
8076
|
*/
|
|
7722
8077
|
|
|
7723
|
-
declare
|
|
7724
|
-
export { askUser as AskUser, bash as Bash, computerUse as ComputerUse, descriptions as Descriptions, diff as Diff, editFile as EditFile, enterWorktree as EnterWorktree, exitPlanMode as ExitPlanMode, exitWorktree as ExitWorktree, fileMutationQueue as FileMutationQueue, fileStateCache as FileStateCache, glob as Glob, grep as Grep, isDiffTool$1 as IsDiffTool, javascript as JavaScript, mcpCall as McpCall, powershell as PowerShell, readFile as ReadFile, registry$1 as Registry, shellOutput as ShellOutput, snippets as Snippets, syntheticOutput as SyntheticOutput, toolSearch as ToolSearch, types as Types, writeFile as WriteFile };
|
|
7725
|
-
}
|
|
7726
|
-
|
|
7727
|
-
/**
|
|
7728
|
-
* Copyright (c) 2026 hangtiancheng
|
|
7729
|
-
*
|
|
7730
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7731
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
7732
|
-
* in the Software without restriction, including without limitation the rights
|
|
7733
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7734
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
7735
|
-
* furnished to do so, subject to the following conditions:
|
|
7736
|
-
*
|
|
7737
|
-
* The above copyright notice and this permission notice shall be included in
|
|
7738
|
-
* all copies or substantial portions of the Software.
|
|
7739
|
-
*
|
|
7740
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
7741
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
7742
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
7743
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
7744
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
7745
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
7746
|
-
* SOFTWARE.
|
|
7747
|
-
*/
|
|
7748
|
-
|
|
7749
|
-
interface ThemePalette {
|
|
7750
|
-
accent: string;
|
|
7751
|
-
bashMode: string;
|
|
7752
|
-
border: string;
|
|
7753
|
-
borderAccent: string;
|
|
7754
|
-
borderMuted: string;
|
|
7755
|
-
customMessageBg: string;
|
|
7756
|
-
customMessageLabel: string;
|
|
7757
|
-
dim: string;
|
|
7758
|
-
error: string;
|
|
7759
|
-
mdCode: string;
|
|
7760
|
-
mdCodeBlock: string;
|
|
7761
|
-
mdCodeBlockBorder: string;
|
|
7762
|
-
mdHeading: string;
|
|
7763
|
-
mdHr: string;
|
|
7764
|
-
mdLink: string;
|
|
7765
|
-
mdLinkUrl: string;
|
|
7766
|
-
mdListBullet: string;
|
|
7767
|
-
mdQuote: string;
|
|
7768
|
-
mdQuoteBorder: string;
|
|
7769
|
-
muted: string;
|
|
7770
|
-
searchMatchBg: string;
|
|
7771
|
-
searchMatchText: string;
|
|
7772
|
-
selectedBg: string;
|
|
7773
|
-
success: string;
|
|
7774
|
-
syntaxComment: string;
|
|
7775
|
-
syntaxFunction: string;
|
|
7776
|
-
syntaxKeyword: string;
|
|
7777
|
-
syntaxNumber: string;
|
|
7778
|
-
syntaxOperator: string;
|
|
7779
|
-
syntaxPunctuation: string;
|
|
7780
|
-
syntaxString: string;
|
|
7781
|
-
syntaxType: string;
|
|
7782
|
-
syntaxVariable: string;
|
|
7783
|
-
text: string;
|
|
7784
|
-
thinking: string;
|
|
7785
|
-
thinkingText: string;
|
|
7786
|
-
thinkingHigh: string;
|
|
7787
|
-
thinkingLow: string;
|
|
7788
|
-
thinkingMax: string;
|
|
7789
|
-
thinkingMedium: string;
|
|
7790
|
-
thinkingMinimal: string;
|
|
7791
|
-
thinkingOff: string;
|
|
7792
|
-
thinkingXHigh: string;
|
|
7793
|
-
toolDiffAdded: string;
|
|
7794
|
-
toolDiffContext: string;
|
|
7795
|
-
toolDiffRemoved: string;
|
|
7796
|
-
toolErrorBg: string;
|
|
7797
|
-
toolOutput: string;
|
|
7798
|
-
toolPendingBg: string;
|
|
7799
|
-
toolSuccessBg: string;
|
|
7800
|
-
toolTitle: string;
|
|
7801
|
-
customMessageText: string;
|
|
7802
|
-
userMessageText: string;
|
|
7803
|
-
userMessageBg: string;
|
|
7804
|
-
warning: string;
|
|
7805
|
-
}
|
|
7806
|
-
declare const DARK_THEME: ThemePalette;
|
|
7807
|
-
declare const LIGHT_THEME: ThemePalette;
|
|
7808
|
-
declare const THEME: ThemePalette;
|
|
7809
|
-
declare function setThemeMode(mode: "dark" | "light"): void;
|
|
7810
|
-
declare function thinkingLevelColor(level: ThinkingLevel): string;
|
|
7811
|
-
type ActivityStatus = "idle" | "working" | "retry" | "compacting" | "error";
|
|
7812
|
-
/** Map an agent lifecycle state to the color used by the composer status border. */
|
|
7813
|
-
declare function activityStatusColor(status: ActivityStatus): string;
|
|
7814
|
-
declare const ICONS: {
|
|
7815
|
-
readonly active: "◉";
|
|
7816
|
-
readonly arrow: "→";
|
|
7817
|
-
readonly branch: "├─";
|
|
7818
|
-
readonly collapsed: "⊞";
|
|
7819
|
-
readonly expanded: "⊟";
|
|
7820
|
-
readonly inactive: "○";
|
|
7821
|
-
readonly lastBranch: "└─";
|
|
7822
|
-
readonly prompt: ">";
|
|
7823
|
-
readonly success: "✓";
|
|
7824
|
-
readonly tree: "│";
|
|
7825
|
-
};
|
|
7826
|
-
|
|
7827
|
-
type styles_ActivityStatus = ActivityStatus;
|
|
7828
|
-
declare const styles_DARK_THEME: typeof DARK_THEME;
|
|
7829
|
-
declare const styles_ICONS: typeof ICONS;
|
|
7830
|
-
declare const styles_LIGHT_THEME: typeof LIGHT_THEME;
|
|
7831
|
-
declare const styles_THEME: typeof THEME;
|
|
7832
|
-
type styles_ThemePalette = ThemePalette;
|
|
7833
|
-
declare const styles_activityStatusColor: typeof activityStatusColor;
|
|
7834
|
-
declare const styles_setThemeMode: typeof setThemeMode;
|
|
7835
|
-
declare const styles_thinkingLevelColor: typeof thinkingLevelColor;
|
|
7836
|
-
declare namespace styles {
|
|
7837
|
-
export { type styles_ActivityStatus as ActivityStatus, styles_DARK_THEME as DARK_THEME, styles_ICONS as ICONS, styles_LIGHT_THEME as LIGHT_THEME, styles_THEME as THEME, type styles_ThemePalette as ThemePalette, styles_activityStatusColor as activityStatusColor, styles_setThemeMode as setThemeMode, styles_thinkingLevelColor as thinkingLevelColor };
|
|
7838
|
-
}
|
|
7839
|
-
|
|
7840
|
-
/**
|
|
7841
|
-
* Copyright (c) 2026 hangtiancheng
|
|
7842
|
-
*
|
|
7843
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7844
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
7845
|
-
* in the Software without restriction, including without limitation the rights
|
|
7846
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7847
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
7848
|
-
* furnished to do so, subject to the following conditions:
|
|
7849
|
-
*
|
|
7850
|
-
* The above copyright notice and this permission notice shall be included in
|
|
7851
|
-
* all copies or substantial portions of the Software.
|
|
7852
|
-
*
|
|
7853
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
7854
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
7855
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
7856
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
7857
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
7858
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
7859
|
-
* SOFTWARE.
|
|
7860
|
-
*/
|
|
7861
|
-
interface Options {
|
|
7862
|
-
blocked: boolean;
|
|
7863
|
-
send: (message: string) => Promise<void>;
|
|
7864
|
-
onError: (error: unknown) => void;
|
|
7865
|
-
}
|
|
7866
|
-
declare function useFollowUpQueue({ blocked, send, onError }: Options): {
|
|
7867
|
-
messages: string[];
|
|
7868
|
-
enqueue: (message: string) => void;
|
|
7869
|
-
takeLast: () => string | undefined;
|
|
7870
|
-
processing: boolean;
|
|
7871
|
-
paused: boolean;
|
|
7872
|
-
};
|
|
7873
|
-
|
|
7874
|
-
declare const useFollowUpQueue$1_useFollowUpQueue: typeof useFollowUpQueue;
|
|
7875
|
-
declare namespace useFollowUpQueue$1 {
|
|
7876
|
-
export { useFollowUpQueue$1_useFollowUpQueue as useFollowUpQueue };
|
|
7877
|
-
}
|
|
7878
|
-
|
|
7879
|
-
/**
|
|
7880
|
-
* Copyright (c) 2026 hangtiancheng
|
|
7881
|
-
*
|
|
7882
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7883
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
7884
|
-
* in the Software without restriction, including without limitation the rights
|
|
7885
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7886
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
7887
|
-
* furnished to do so, subject to the following conditions:
|
|
7888
|
-
*
|
|
7889
|
-
* The above copyright notice and this permission notice shall be included in
|
|
7890
|
-
* all copies or substantial portions of the Software.
|
|
7891
|
-
*
|
|
7892
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
7893
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
7894
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
7895
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
7896
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
7897
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
7898
|
-
* SOFTWARE.
|
|
7899
|
-
*/
|
|
7900
|
-
declare function useIdeInput(workDir: string): {
|
|
7901
|
-
insertInputTextRef: react.RefObject<((text: string) => void) | null>;
|
|
7902
|
-
clearInputRef: react.RefObject<(() => void) | null>;
|
|
7903
|
-
};
|
|
7904
|
-
|
|
7905
|
-
declare const useIdeInput$1_useIdeInput: typeof useIdeInput;
|
|
7906
|
-
declare namespace useIdeInput$1 {
|
|
7907
|
-
export { useIdeInput$1_useIdeInput as useIdeInput };
|
|
7908
|
-
}
|
|
7909
|
-
|
|
7910
|
-
/**
|
|
7911
|
-
* Copyright (c) 2026 hangtiancheng
|
|
7912
|
-
*
|
|
7913
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7914
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
7915
|
-
* in the Software without restriction, including without limitation the rights
|
|
7916
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7917
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
7918
|
-
* furnished to do so, subject to the following conditions:
|
|
7919
|
-
*
|
|
7920
|
-
* The above copyright notice and this permission notice shall be included in
|
|
7921
|
-
* all copies or substantial portions of the Software.
|
|
7922
|
-
*
|
|
7923
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
7924
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
7925
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
7926
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
7927
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
7928
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
7929
|
-
* SOFTWARE.
|
|
7930
|
-
*/
|
|
7931
|
-
|
|
7932
|
-
declare function useTeammateStates(manager: TeamManager): {
|
|
8078
|
+
declare class WriteFileTool implements Tool {
|
|
7933
8079
|
name: string;
|
|
7934
|
-
|
|
7935
|
-
|
|
7936
|
-
|
|
7937
|
-
|
|
7938
|
-
|
|
7939
|
-
tokenCount: number;
|
|
7940
|
-
activeTools: {
|
|
7941
|
-
toolId: string;
|
|
7942
|
-
toolName: string;
|
|
7943
|
-
}[];
|
|
7944
|
-
recentActivities: {
|
|
7945
|
-
toolName: string;
|
|
7946
|
-
input: Record<string, unknown>;
|
|
7947
|
-
activityDescription: string;
|
|
7948
|
-
}[];
|
|
7949
|
-
lastActivity?: {
|
|
7950
|
-
toolName: string;
|
|
7951
|
-
input: Record<string, unknown>;
|
|
7952
|
-
activityDescription: string;
|
|
7953
|
-
} | undefined;
|
|
7954
|
-
};
|
|
7955
|
-
startTime: number;
|
|
7956
|
-
spinnerVerb: string;
|
|
7957
|
-
originToolCallId?: string | undefined;
|
|
7958
|
-
lastMessage?: string | undefined;
|
|
7959
|
-
}[];
|
|
8080
|
+
description: string;
|
|
8081
|
+
category: ToolCategory;
|
|
8082
|
+
schema(): ToolSchema;
|
|
8083
|
+
execute(ctx: ToolContext, args: Record<string, unknown>): Promise<ToolResult>;
|
|
8084
|
+
}
|
|
7960
8085
|
|
|
7961
|
-
|
|
7962
|
-
declare
|
|
7963
|
-
|
|
8086
|
+
type writeFile_WriteFileTool = WriteFileTool;
|
|
8087
|
+
declare const writeFile_WriteFileTool: typeof WriteFileTool;
|
|
8088
|
+
declare namespace writeFile {
|
|
8089
|
+
export { writeFile_WriteFileTool as WriteFileTool };
|
|
7964
8090
|
}
|
|
7965
8091
|
|
|
7966
8092
|
/**
|
|
@@ -7986,7 +8112,7 @@ declare namespace useTeammateStates$1 {
|
|
|
7986
8112
|
*/
|
|
7987
8113
|
|
|
7988
8114
|
declare namespace index$3 {
|
|
7989
|
-
export {
|
|
8115
|
+
export { askUser as AskUser, bash as Bash, computerUse as ComputerUse, descriptions as Descriptions, diff as Diff, editFile as EditFile, enterWorktree as EnterWorktree, exitCodeHints as ExitCodeHints, exitPlanMode as ExitPlanMode, exitWorktree as ExitWorktree, fileMutationQueue as FileMutationQueue, fileStateCache as FileStateCache, glob as Glob, grep as Grep, isDiffTool$1 as IsDiffTool, javascript as JavaScript, mcpCall as McpCall, powershell as PowerShell, readFile as ReadFile, registry$1 as Registry, shellBackground as ShellBackground, shellOutput as ShellOutput, snippets as Snippets, syntheticOutput as SyntheticOutput, toolSearch as ToolSearch, types as Types, webFetch as WebFetchTool, writeFile as WriteFile };
|
|
7990
8116
|
}
|
|
7991
8117
|
|
|
7992
8118
|
/**
|
|
@@ -8403,7 +8529,7 @@ declare function isTerminalGone(err: unknown): boolean;
|
|
|
8403
8529
|
/**
|
|
8404
8530
|
* Writes the exit marker; subsequent calls are no-ops.
|
|
8405
8531
|
*
|
|
8406
|
-
* The
|
|
8532
|
+
* The UI runs in raw mode where the `exit` event may not fire on teardown,
|
|
8407
8533
|
* so the main flow also calls this explicitly. Whichever path arrives first wins.
|
|
8408
8534
|
*/
|
|
8409
8535
|
declare function recordExit(code: number | string): void;
|
|
@@ -8524,4 +8650,4 @@ declare namespace version$1 {
|
|
|
8524
8650
|
export { version$1_version as version };
|
|
8525
8651
|
}
|
|
8526
8652
|
|
|
8527
|
-
export { index$
|
|
8653
|
+
export { index$r as Acp, index$n as Agent, index$k as Bootstrap, index$i as CodeReview, index$h as Commands, index$g as Compact, index$q as Config, index$t as Conversation, index$v as FileHistory, index$f as History, index$p as Hooks, index$e as Images, index$d as LLM, index$c as Logger, index$b as MCP, index$a as Memory, index$u as Permissions, index$9 as PlanFile, printMode as PrintMode, index$8 as Prompt, providerLogin as ProviderLogin, recover$1 as Recover, index$7 as Remote, index$6 as Sandbox, index$s as Session, index$m as Skills, index$5 as Subagent, teammate as Teammate, index$j as Teams, index$o as Telemetry, index$l as Todo, index$4 as ToolResult, index$3 as Tools, index$2 as Utils, index$1 as VSCode, version$1 as Version, index as Worktree };
|