@yukino.js/yukino 0.0.13 → 0.0.15

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.
Files changed (108) hide show
  1. package/README.md +13 -11
  2. package/dist/a2a-ANR7PFD4.js +15 -0
  3. package/dist/acp-4E7R254I.js +14 -0
  4. package/dist/{anthropic-74ALYMH2.js → anthropic-ZO73YJFY.js} +1 -1
  5. package/dist/browser/dist/index.html +44 -0
  6. package/dist/browser/dist/static/index.css +2 -0
  7. package/dist/browser/dist/static/index.js +203 -0
  8. package/dist/bwrap-LVIPV72Q.js +0 -0
  9. package/dist/chunk-3KKA6537.js +0 -0
  10. package/dist/chunk-3RH3COZW.js +365 -0
  11. package/dist/chunk-4JHZPFU6.js +67 -0
  12. package/dist/chunk-7MKA3SHV.js +0 -0
  13. package/dist/{chunk-OREDGNI6.js → chunk-B2RNOTT5.js} +1 -1
  14. package/dist/{chunk-APJAUOF6.js → chunk-C56EKYBO.js} +1 -1
  15. package/dist/{chunk-WGFROGUC.js → chunk-CKOUBYG6.js} +0 -0
  16. package/dist/{chunk-6JUOKMSJ.js → chunk-CW6G3RYM.js} +1 -1
  17. package/dist/{chunk-556TRLPT.js → chunk-CWWRUTF2.js} +1 -1
  18. package/dist/chunk-DVB57IVG.js +18 -0
  19. package/dist/chunk-ETZPOVUC.js +4 -0
  20. package/dist/chunk-F3JTT3TI.js +110 -0
  21. package/dist/chunk-FC2LG24U.js +4 -0
  22. package/dist/chunk-FNQMXCCE.js +4 -0
  23. package/dist/chunk-HWCLMDQF.js +0 -0
  24. package/dist/chunk-I74AL3PF.js +0 -0
  25. package/dist/chunk-IOMQY54U.js +967 -0
  26. package/dist/chunk-IQT2IFSO.js +4 -0
  27. package/dist/chunk-K45OXLJJ.js +16 -0
  28. package/dist/chunk-KJJYW5IY.js +0 -0
  29. package/dist/chunk-LCWNSYZU.js +0 -0
  30. package/dist/chunk-LR4ZNAAM.js +4 -0
  31. package/dist/chunk-LTMY67B2.js +5 -0
  32. package/dist/chunk-MDPSQ6L7.js +0 -0
  33. package/dist/chunk-MQAQBW7F.js +0 -0
  34. package/dist/{chunk-NEU4ER5V.js → chunk-NSNTZXFL.js} +1 -1
  35. package/dist/chunk-P6DHMU7R.js +0 -0
  36. package/dist/chunk-VCIRD267.js +0 -0
  37. package/dist/chunk-VM4YKTHC.js +0 -0
  38. package/dist/chunk-VU3JWAJR.js +0 -0
  39. package/dist/chunk-W4GMCNWF.js +0 -0
  40. package/dist/chunk-XY7ZFVZL.js +4 -0
  41. package/dist/devtools-UVGRIXO2.js +0 -0
  42. package/dist/{esm-HW2JMFYC.js → esm-2JJG3HR7.js} +1 -1
  43. package/dist/esm-7DWXO52B.js +4 -0
  44. package/dist/{esm-6L5BJ5GT.js → esm-EOOB75BT.js} +1 -1
  45. package/dist/{esm-DIYJ5HX6.js → esm-H73EL6IR.js} +1 -1
  46. package/dist/{esm-YKAO4ES6.js → esm-IBZKE3IU.js} +1 -1
  47. package/dist/esm-W4NAAZTQ.js +225 -0
  48. package/dist/{esm-RPR2GBJ2.js → esm-Y237QNPJ.js} +1 -1
  49. package/dist/getMachineId-bsd-A3UCSHLE.js +4 -0
  50. package/dist/getMachineId-bsd-E27XJQLX.js +0 -0
  51. package/dist/getMachineId-darwin-35UPAIXP.js +0 -0
  52. package/dist/getMachineId-darwin-MWJEU7OI.js +5 -0
  53. package/dist/getMachineId-linux-FNSLKUDN.js +4 -0
  54. package/dist/getMachineId-linux-MKXIYT6A.js +0 -0
  55. package/dist/getMachineId-unsupported-PKQWB2OJ.js +4 -0
  56. package/dist/getMachineId-unsupported-ZXVGGFX2.js +0 -0
  57. package/dist/getMachineId-win-3A667JT3.js +4 -0
  58. package/dist/getMachineId-win-RNVIYJG5.js +0 -0
  59. package/dist/lib/{anthropic-EQRUGP2C.js → anthropic-SQBOFRPQ.js} +4 -4
  60. package/dist/lib/{chunk-EGT7BJRD.js → chunk-AW2577J5.js} +2 -2
  61. package/dist/lib/{chunk-JYCSWXCR.js → chunk-GPJL4PLE.js} +2 -2
  62. package/dist/lib/{chunk-UBVKYJFI.js → chunk-IHVYAEY2.js} +1058 -522
  63. package/dist/lib/{chunk-CDMR25FD.js → chunk-U3OT4POQ.js} +3 -3
  64. package/dist/lib/{chunk-HUTUNNDX.js → chunk-WNGF7243.js} +0 -1
  65. package/dist/lib/{chunk-FUJDUZTH.js → chunk-WXR5HNB4.js} +1 -1
  66. package/dist/lib/{chunk-WWCSFKMR.js → chunk-XS3GONYN.js} +2 -11
  67. package/dist/lib/index.d.ts +98 -282
  68. package/dist/lib/index.js +1092 -2409
  69. package/dist/lib/{openai-B3I5WBFT.js → openai-UV4KFNQV.js} +3 -3
  70. package/dist/lib/{providers-EJ4VBHNP.js → providers-77VBEX3K.js} +2 -2
  71. package/dist/lib/{tool-filter-TURPCYFR.js → tool-filter-MLYQGWM5.js} +3 -3
  72. package/dist/{main-JEEKFCGX.js → main-653YZQHY.js} +228 -232
  73. package/dist/main.js +2 -2
  74. package/dist/node-634LOHDX.js +0 -0
  75. package/dist/{openai-7C6BVQ7M.js → openai-FKLMHNNC.js} +1 -1
  76. package/dist/providers-4IU7SUEQ.js +4 -0
  77. package/dist/seatbelt-UO7HGD4Z.js +0 -0
  78. package/dist/server-4NHV4RJL.js +4 -0
  79. package/dist/slim-Q56GHZZP.js +0 -0
  80. package/dist/{src-JBRNH4FA.js → src-DEVJGNXS.js} +1 -1
  81. package/dist/{src-X6JWWHHT.js → src-EMFESWQS.js} +1 -1
  82. package/dist/{src-R4BSSIJJ.js → src-GG4YROJH.js} +1 -1
  83. package/dist/{src-43CPCEK2.js → src-JFAO2DGP.js} +1 -1
  84. package/dist/tool-filter-LJTLMGFP.js +4 -0
  85. package/dist/turndown.es-NQ3KDXM7.js +0 -0
  86. package/package.json +22 -21
  87. package/dist/a2a-DKWMWGID.js +0 -14
  88. package/dist/acp-RL6DKS3R.js +0 -14
  89. package/dist/chunk-2LHY3FND.js +0 -67
  90. package/dist/chunk-3QL446GD.js +0 -4
  91. package/dist/chunk-6FSIG63T.js +0 -364
  92. package/dist/chunk-A5G5NTDB.js +0 -1015
  93. package/dist/chunk-A7CJPQC5.js +0 -5
  94. package/dist/chunk-AGSYLE4E.js +0 -16
  95. package/dist/chunk-CJSMVCUF.js +0 -6
  96. package/dist/chunk-CU3IISCC.js +0 -4
  97. package/dist/chunk-HMZQYFYG.js +0 -4
  98. package/dist/chunk-JFKC4VCA.js +0 -4
  99. package/dist/chunk-KCMBAHWU.js +0 -4
  100. package/dist/chunk-SCR7NDDL.js +0 -63
  101. package/dist/esm-57CJEGGK.js +0 -4
  102. package/dist/esm-YOQPBF42.js +0 -225
  103. package/dist/fe/dist/index.html +0 -21
  104. package/dist/fe/dist/static/index.css +0 -2
  105. package/dist/fe/dist/static/index.js +0 -203
  106. package/dist/providers-U23PWAHG.js +0 -4
  107. package/dist/server-EOSEQPNY.js +0 -4
  108. package/dist/tool-filter-UDSHRE5F.js +0 -4
@@ -12,8 +12,7 @@ import { JSONRPCMessage } from '@modelcontextprotocol/sdk/types.js';
12
12
  /**
13
13
  * Builds the agent card for the given base URL. Both the JSON-RPC endpoint
14
14
  * (POST /) and the HTTP+JSON/REST endpoints (/v1/...) are served from the
15
- * same origin, so both interfaces share the URL. Each binding is mirrored at
16
- * protocol version 0.3 so legacy clients interoperate via the compat layer.
15
+ * same origin, so both interfaces share the URL.
17
16
  */
18
17
  declare function buildAgentCard(url: string): AgentCard;
19
18
 
@@ -235,7 +234,7 @@ declare namespace index$y {
235
234
  export { index$y_GOAL_RECORD as GOAL_RECORD, index$y_GoalManager as GoalManager, index$y_GoalSchema as GoalSchema, type index$y_GoalState as GoalState, index$y_MAX_GOAL_TURNS as MAX_GOAL_TURNS, index$y_handleGoalCommand as handleGoalCommand };
236
235
  }
237
236
 
238
- declare function requestToolPermission(handler: PermissionRequestHandler, toolName: string, args: Record<string, unknown>, decision: Decision, toolCallId: string, signal?: AbortSignal): ReturnType<PermissionRequestHandler>;
237
+ declare function requestToolPermission(handler: PermissionRequestHandler, toolName: string, args: Record<string, unknown>, decision: Decision, toolCallId: string, signal?: AbortSignal, source?: PermissionRequestSource): ReturnType<PermissionRequestHandler>;
239
238
 
240
239
  declare const request_requestToolPermission: typeof requestToolPermission;
241
240
  declare namespace request {
@@ -282,21 +281,19 @@ declare function isSafeCommand(command: string): boolean;
282
281
  declare class PermissionChecker {
283
282
  private readonly cwd;
284
283
  private modeState;
285
- private delegated;
286
- planModeLocked: boolean;
284
+ private parent?;
287
285
  planFilePath: string;
288
286
  teammate: boolean;
289
287
  sandboxEnabled: boolean;
290
288
  sandboxAutoAllow: boolean;
291
289
  private sandbox;
292
290
  private ruleEngine;
293
- constructor(cwd: string, mode?: PermissionMode, modeSource?: () => PermissionMode);
291
+ constructor(cwd: string, mode?: PermissionMode);
294
292
  get mode(): PermissionMode;
295
293
  set mode(mode: PermissionMode);
296
- get delegatedMode(): Exclude<PermissionMode, "plan">;
297
294
  subscribeMode(listener: () => void): () => void;
298
295
  forCwd(cwd: string): PermissionChecker;
299
- forSubagent(cwd: string): PermissionChecker;
296
+ forSubagent(cwd: string, mode?: PermissionMode): PermissionChecker;
300
297
  check(toolName: string, category: "read" | "write" | "command", args: Record<string, unknown>): Decision;
301
298
  allowExtraRoot(path: string): void;
302
299
  allowAlways(toolName: string, args: Record<string, unknown>): void;
@@ -342,10 +339,15 @@ interface AgentTask {
342
339
  kind?: TaskKind;
343
340
  status: AgentTaskStatus;
344
341
  output: string;
342
+ error?: string;
343
+ transcriptPath?: string;
344
+ startedAt: number;
345
+ completedAt?: number;
345
346
  cancel: () => void;
346
347
  done: Promise<void>;
347
348
  }
348
349
  interface CreateTaskOptions {
350
+ transcriptPath?: string;
349
351
  originToolCallId?: string;
350
352
  /** ID prefix; defaults to "agent" (background subagents). Bash background tasks use "bash"; PowerShell background tasks use "ps". */
351
353
  idPrefix?: string;
@@ -367,6 +369,11 @@ declare class TaskManager {
367
369
  private notifiedTaskIds;
368
370
  private listeners;
369
371
  private pendingTaskIds;
372
+ private store?;
373
+ constructor(sessionId?: string);
374
+ useSession(sessionId: string): void;
375
+ private restore;
376
+ private persist;
370
377
  create(name: string, runner: (task: AgentTask) => Promise<string>, cancel: () => void, options?: CreateTaskOptions): AgentTask;
371
378
  get(id: string): AgentTask | undefined;
372
379
  list(): AgentTask[];
@@ -423,12 +430,17 @@ interface ToolResult {
423
430
  contentBlocks?: ToolResultContentBlock[];
424
431
  isError: boolean;
425
432
  }
426
- type PermissionRequestHandler = (toolName: string, args: Record<string, unknown>, decision: Decision, toolCallId: string, abortSignal?: AbortSignal) => Promise<"allow" | "deny" | "allowAlways">;
433
+ interface PermissionRequestSource {
434
+ agentName: string;
435
+ cwd: string;
436
+ }
437
+ type PermissionRequestHandler = (toolName: string, args: Record<string, unknown>, decision: Decision, toolCallId: string, abortSignal?: AbortSignal, source?: PermissionRequestSource) => Promise<"allow" | "deny" | "allowAlways">;
427
438
  interface ToolContext {
428
439
  cwd: string;
429
440
  goalManager?: GoalManager;
430
441
  toolCallId?: string;
431
442
  backgroundTaskId?: string;
443
+ subagentSessionId?: string;
432
444
  /**
433
445
  * Owning session, when the call runs on the main thread. Lets tools persist
434
446
  * auxiliary artifacts (e.g. a backgrounded Bash command's output) into the
@@ -451,6 +463,7 @@ interface ToolContext {
451
463
  fileHistory?: FileHistory | undefined;
452
464
  fileStateCache?: FileStateCache | undefined;
453
465
  permissionChecker?: PermissionChecker;
466
+ approvedPermissionMode?: PermissionChecker["mode"];
454
467
  onPermissionRequest?: PermissionRequestHandler;
455
468
  }
456
469
  /**
@@ -542,6 +555,7 @@ type types$1_McpLoadingMode = McpLoadingMode;
542
555
  type types$1_OpenAICompatToolSchema = OpenAICompatToolSchema;
543
556
  type types$1_OpenAIResponsesToolSchema = OpenAIResponsesToolSchema;
544
557
  type types$1_PermissionRequestHandler = PermissionRequestHandler;
558
+ type types$1_PermissionRequestSource = PermissionRequestSource;
545
559
  type types$1_ProviderToolSchema = ProviderToolSchema;
546
560
  declare const types$1_SKIP_DIRS: typeof SKIP_DIRS;
547
561
  type types$1_Tool = Tool;
@@ -554,7 +568,7 @@ type types$1_ToolSchema = ToolSchema;
554
568
  declare const types$1_isToolResultContentBlock: typeof isToolResultContentBlock;
555
569
  declare const types$1_normalizeToolResultContentBlock: typeof normalizeToolResultContentBlock;
556
570
  declare namespace types$1 {
557
- export { type types$1_AnthropicToolSchema as AnthropicToolSchema, type types$1_MCPToolLike as MCPToolLike, type types$1_McpLoadingMode as McpLoadingMode, type types$1_OpenAICompatToolSchema as OpenAICompatToolSchema, type types$1_OpenAIResponsesToolSchema as OpenAIResponsesToolSchema, type types$1_PermissionRequestHandler as PermissionRequestHandler, type types$1_ProviderToolSchema as ProviderToolSchema, types$1_SKIP_DIRS as SKIP_DIRS, type types$1_Tool as Tool, type types$1_ToolCategory as ToolCategory, type types$1_ToolContext as ToolContext, type types$1_ToolProtocol as ToolProtocol, type types$1_ToolResult as ToolResult, type types$1_ToolResultContentBlock as ToolResultContentBlock, type types$1_ToolSchema as ToolSchema, types$1_isToolResultContentBlock as isToolResultContentBlock, types$1_normalizeToolResultContentBlock as normalizeToolResultContentBlock };
571
+ export { type types$1_AnthropicToolSchema as AnthropicToolSchema, type types$1_MCPToolLike as MCPToolLike, type types$1_McpLoadingMode as McpLoadingMode, type types$1_OpenAICompatToolSchema as OpenAICompatToolSchema, type types$1_OpenAIResponsesToolSchema as OpenAIResponsesToolSchema, type types$1_PermissionRequestHandler as PermissionRequestHandler, type types$1_PermissionRequestSource as PermissionRequestSource, type types$1_ProviderToolSchema as ProviderToolSchema, types$1_SKIP_DIRS as SKIP_DIRS, type types$1_Tool as Tool, type types$1_ToolCategory as ToolCategory, type types$1_ToolContext as ToolContext, type types$1_ToolProtocol as ToolProtocol, type types$1_ToolResult as ToolResult, type types$1_ToolResultContentBlock as ToolResultContentBlock, type types$1_ToolSchema as ToolSchema, types$1_isToolResultContentBlock as isToolResultContentBlock, types$1_normalizeToolResultContentBlock as normalizeToolResultContentBlock };
558
572
  }
559
573
 
560
574
  declare function expandAtRefs(text: string, cwd: string): string;
@@ -815,7 +829,9 @@ declare function getSessionArtifactsDir(sessionId: string): string;
815
829
  declare function getSessionFilePath(cwd: string, sessionId: string): string;
816
830
  declare function newSessionId(): string;
817
831
  declare function saveMessage(cwd: string, sessionId: string, msg: SessionMessage): void;
832
+ declare function saveTranscriptMessage(filePath: string, msg: SessionMessage): void;
818
833
  declare function saveCompactBoundary(cwd: string, sessionId: string, payload: CompactBoundaryPayload): void;
834
+ declare function saveTranscriptCompactBoundary(filePath: string, payload: CompactBoundaryPayload): void;
819
835
  /** Count the non-empty lines of a session log; undefined when it doesn't exist. */
820
836
  declare function sessionLineCount(filePath: string): number | undefined;
821
837
  /**
@@ -828,6 +844,7 @@ declare function sessionLineCount(filePath: string): number | undefined;
828
844
  */
829
845
  declare function truncateSessionLines(filePath: string, keepLines: number): void;
830
846
  declare function loadSession(cwd: string, sessionId: string): SessionMessage[];
847
+ declare function loadTranscript(filePath: string): SessionMessage[];
831
848
  /**
832
849
  * Marks a session as recently active by refreshing its mtime. Session writes,
833
850
  * loads, rewinds, touches, and expiry cleanup share the same cross-process lock,
@@ -874,18 +891,21 @@ declare const index$v_getSessionArtifactsDir: typeof getSessionArtifactsDir;
874
891
  declare const index$v_getSessionFilePath: typeof getSessionFilePath;
875
892
  declare const index$v_listSessions: typeof listSessions;
876
893
  declare const index$v_loadSession: typeof loadSession;
894
+ declare const index$v_loadTranscript: typeof loadTranscript;
877
895
  declare const index$v_messageToKeptRecord: typeof messageToKeptRecord;
878
896
  declare const index$v_newSessionId: typeof newSessionId;
879
897
  declare const index$v_rebuildFromSession: typeof rebuildFromSession;
880
898
  declare const index$v_saveCompactBoundary: typeof saveCompactBoundary;
881
899
  declare const index$v_saveMessage: typeof saveMessage;
900
+ declare const index$v_saveTranscriptCompactBoundary: typeof saveTranscriptCompactBoundary;
901
+ declare const index$v_saveTranscriptMessage: typeof saveTranscriptMessage;
882
902
  declare const index$v_sessionLineCount: typeof sessionLineCount;
883
903
  declare const index$v_toolResultsToRecords: typeof toolResultsToRecords;
884
904
  declare const index$v_toolUsesToRecords: typeof toolUsesToRecords;
885
905
  declare const index$v_touchSession: typeof touchSession;
886
906
  declare const index$v_truncateSessionLines: typeof truncateSessionLines;
887
907
  declare namespace index$v {
888
- export { index$v_COMPACT_BOUNDARY as COMPACT_BOUNDARY, type index$v_CompactBoundaryPayload as CompactBoundaryPayload, type index$v_KeptMessage as KeptMessage, type index$v_RestoredMessage as RestoredMessage, type index$v_SessionInfo as SessionInfo, type index$v_SessionMessage as SessionMessage, type index$v_ToolResultRecord as ToolResultRecord, type index$v_ToolUseRecord as ToolUseRecord, index$v_cleanExpiredSessions as cleanExpiredSessions, index$v_getSessionArtifactsDir as getSessionArtifactsDir, index$v_getSessionFilePath as getSessionFilePath, index$v_listSessions as listSessions, index$v_loadSession as loadSession, index$v_messageToKeptRecord as messageToKeptRecord, index$v_newSessionId as newSessionId, index$v_rebuildFromSession as rebuildFromSession, index$v_saveCompactBoundary as saveCompactBoundary, index$v_saveMessage as saveMessage, index$v_sessionLineCount as sessionLineCount, index$v_toolResultsToRecords as toolResultsToRecords, index$v_toolUsesToRecords as toolUsesToRecords, index$v_touchSession as touchSession, index$v_truncateSessionLines as truncateSessionLines };
908
+ export { index$v_COMPACT_BOUNDARY as COMPACT_BOUNDARY, type index$v_CompactBoundaryPayload as CompactBoundaryPayload, type index$v_KeptMessage as KeptMessage, type index$v_RestoredMessage as RestoredMessage, type index$v_SessionInfo as SessionInfo, type index$v_SessionMessage as SessionMessage, type index$v_ToolResultRecord as ToolResultRecord, type index$v_ToolUseRecord as ToolUseRecord, index$v_cleanExpiredSessions as cleanExpiredSessions, index$v_getSessionArtifactsDir as getSessionArtifactsDir, index$v_getSessionFilePath as getSessionFilePath, index$v_listSessions as listSessions, index$v_loadSession as loadSession, index$v_loadTranscript as loadTranscript, index$v_messageToKeptRecord as messageToKeptRecord, index$v_newSessionId as newSessionId, index$v_rebuildFromSession as rebuildFromSession, index$v_saveCompactBoundary as saveCompactBoundary, index$v_saveMessage as saveMessage, index$v_saveTranscriptCompactBoundary as saveTranscriptCompactBoundary, index$v_saveTranscriptMessage as saveTranscriptMessage, index$v_sessionLineCount as sessionLineCount, index$v_toolResultsToRecords as toolResultsToRecords, index$v_toolUsesToRecords as toolUsesToRecords, index$v_touchSession as touchSession, index$v_truncateSessionLines as truncateSessionLines };
889
909
  }
890
910
 
891
911
  type AgentEvent = {
@@ -1052,7 +1072,7 @@ declare function createA2aRuntime(cwd: string, sessionId?: string): Promise<A2aR
1052
1072
  declare const DEFAULT_IDLE_TIMEOUT_MS: number;
1053
1073
  /**
1054
1074
  * Bridges the A2A protocol to the yukino agent loop. One runtime session is
1055
- * kept per A2A `contextId`; each `message/send` turn runs the agent until it
1075
+ * kept per A2A `contextId`; each `SendMessage` turn runs the agent until it
1056
1076
  * completes, fails, or needs a tool permission decision. Permission requests
1057
1077
  * surface as `INPUT_REQUIRED` status updates carrying a yukino
1058
1078
  * `permission-request` data part; the client answers by sending a
@@ -2202,7 +2222,7 @@ declare namespace privacy {
2202
2222
  export { privacy_scrubTelemetryPayload as scrubTelemetryPayload };
2203
2223
  }
2204
2224
 
2205
- type TelemetryMode = "a2a" | "acp" | "print" | "remote" | "teammate" | "terminal" | "unknown";
2225
+ type TelemetryMode = "a2a" | "acp" | "print" | "remote" | "terminal" | "unknown";
2206
2226
  type TelemetryObservationKind = "agent" | "generation" | "tool";
2207
2227
  type TelemetryMetricKind = "counter" | "histogram";
2208
2228
  type TelemetryAttributes = Record<string, string | number | boolean>;
@@ -2312,12 +2332,14 @@ declare namespace streamingExecutor {
2312
2332
  }
2313
2333
 
2314
2334
  interface AgentConfig {
2335
+ agentName?: string;
2315
2336
  client: LLMClient;
2316
2337
  registry: ToolRegistry;
2317
2338
  checker: PermissionChecker;
2318
2339
  conversation: ConversationManager;
2319
2340
  cwd: string;
2320
2341
  sessionId?: string;
2342
+ transcriptPath?: string;
2321
2343
  goalManager?: GoalManager;
2322
2344
  shouldContinueGoal?: () => boolean;
2323
2345
  hookEngine?: HookEngine;
@@ -2380,6 +2402,7 @@ declare class Agent {
2380
2402
  private onLoopComplete?;
2381
2403
  private compactTracking;
2382
2404
  private onPermissionRequest?;
2405
+ private agentName;
2383
2406
  private toolFilter?;
2384
2407
  private coordinatorActiveFn?;
2385
2408
  activeSkills: Map<string, string>;
@@ -2407,7 +2430,7 @@ declare class Agent {
2407
2430
  drainSteering(): string[];
2408
2431
  /** Remove a queued steering message before delivery (e.g. recalled into the editor). */
2409
2432
  removeSteering(text: string): boolean;
2410
- /** Inject drained steering messages as user messages, emitting one event each. */
2433
+ /** Inject queued steering messages as user messages, emitting one event each. */
2411
2434
  private deliverSteering;
2412
2435
  private steeringQueue;
2413
2436
  private restoreContext;
@@ -2425,7 +2448,7 @@ declare class Agent {
2425
2448
  * Persistence lives in the main loop rather than in individual frontends: both
2426
2449
  * the UI and Web share the same recording path, ensuring intermediate assistant
2427
2450
  * text and complete tool-call chains are captured for session restoration.
2428
- * Skipped when sessionId is empty (one-shot invocations, sub-agents).
2451
+ * Subagents use their own transcript path, separate from the leader's history.
2429
2452
  */
2430
2453
  private persistLastMessage;
2431
2454
  }
@@ -2458,6 +2481,7 @@ interface InteractionSummary {
2458
2481
  failedToolCalls: number;
2459
2482
  /** Uncached prompt tokens; the cached prefix is counted separately. */
2460
2483
  inputTokens: number;
2484
+ latestVersion?: string;
2461
2485
  outputTokens: number;
2462
2486
  sessionId: string;
2463
2487
  startedAt: number;
@@ -2501,6 +2525,8 @@ interface Command {
2501
2525
  handler: (ctx: CommandContext) => string;
2502
2526
  /** Skill-derived commands; excluded from the /help listing (see /skills). */
2503
2527
  isSkill?: boolean;
2528
+ /** Handler returns markdown to render richly (e.g. a table), not plain text. */
2529
+ markdown?: boolean;
2504
2530
  }
2505
2531
  declare class CommandRegistry {
2506
2532
  private commands;
@@ -3128,13 +3154,6 @@ declare const TeamMemberEntrySchema: z$1.ZodObject<{
3128
3154
  model: z$1.ZodOptional<z$1.ZodString>;
3129
3155
  joinedAt: z$1.ZodNumber;
3130
3156
  worktreePath: z$1.ZodOptional<z$1.ZodString>;
3131
- backendType: z$1.ZodEnum<{
3132
- "in-process": "in-process";
3133
- tmux: "tmux";
3134
- iterm: "iterm";
3135
- }>;
3136
- paneId: z$1.ZodOptional<z$1.ZodString>;
3137
- workerPid: z$1.ZodOptional<z$1.ZodNumber>;
3138
3157
  isActive: z$1.ZodBoolean;
3139
3158
  }, z$1.core.$strip>;
3140
3159
  type TeamMemberEntry = z$1.infer<typeof TeamMemberEntrySchema>;
@@ -3146,19 +3165,10 @@ type TeamMemberEntry = z$1.infer<typeof TeamMemberEntrySchema>;
3146
3165
  * with both sides correlated by member name.
3147
3166
  *
3148
3167
  * This file serves Leader-side cross-restart continuity: TeamManager.get()
3149
- * hydrates the roster and recreates runtime UI/stop handles for active members.
3150
- * Pane teammates read it for leader liveness (leaderPid): a teammate whose
3151
- * leader has been gone for a sustained period exits instead of polling forever.
3152
- * Teammates receive the team name, member name, and mailbox directory via
3153
- * command-line flags at spawn.
3168
+ * hydrates the roster and marks interrupted runtimes inactive.
3154
3169
  */
3155
3170
  declare const TeamFileSchema: z$1.ZodObject<{
3156
3171
  name: z$1.ZodString;
3157
- mode: z$1.ZodEnum<{
3158
- "in-process": "in-process";
3159
- tmux: "tmux";
3160
- iterm: "iterm";
3161
- }>;
3162
3172
  description: z$1.ZodOptional<z$1.ZodString>;
3163
3173
  createdAt: z$1.ZodNumber;
3164
3174
  leaderAgentId: z$1.ZodString;
@@ -3168,7 +3178,6 @@ declare const TeamFileSchema: z$1.ZodObject<{
3168
3178
  plan: "plan";
3169
3179
  bypassPermissions: "bypassPermissions";
3170
3180
  }>;
3171
- leaderPid: z$1.ZodOptional<z$1.ZodNumber>;
3172
3181
  members: z$1.ZodArray<z$1.ZodObject<{
3173
3182
  agentId: z$1.ZodString;
3174
3183
  name: z$1.ZodString;
@@ -3176,13 +3185,6 @@ declare const TeamFileSchema: z$1.ZodObject<{
3176
3185
  model: z$1.ZodOptional<z$1.ZodString>;
3177
3186
  joinedAt: z$1.ZodNumber;
3178
3187
  worktreePath: z$1.ZodOptional<z$1.ZodString>;
3179
- backendType: z$1.ZodEnum<{
3180
- "in-process": "in-process";
3181
- tmux: "tmux";
3182
- iterm: "iterm";
3183
- }>;
3184
- paneId: z$1.ZodOptional<z$1.ZodString>;
3185
- workerPid: z$1.ZodOptional<z$1.ZodNumber>;
3186
3188
  isActive: z$1.ZodBoolean;
3187
3189
  }, z$1.core.$strip>>;
3188
3190
  }, z$1.core.$strip>;
@@ -3190,7 +3192,7 @@ type TeamFile = z$1.infer<typeof TeamFileSchema>;
3190
3192
  /**
3191
3193
  * Project-scoped root directory for team data. The canonical cwd is
3192
3194
  * hashed so unrelated projects cannot restore, list, mutate, or delete each
3193
- * other's teams while pane teammates can still use a home-anchored path.
3195
+ * other's teams.
3194
3196
  */
3195
3197
  declare function teamsBaseDir(cwd: string): string;
3196
3198
  /**
@@ -3221,7 +3223,6 @@ declare function readTeamFileAtPath(path: string): TeamFile | null;
3221
3223
  * Persistence remains best-effort for the in-memory team.
3222
3224
  */
3223
3225
  declare function writeTeamFile(cwd: string, name: string, file: TeamFile, removedMembers?: string[]): void;
3224
- declare function registerTeammateProcess(configPath: string, memberName: string, pid: number): void;
3225
3226
 
3226
3227
  type teamFile_TeamFile = TeamFile;
3227
3228
  type teamFile_TeamMemberEntry = TeamMemberEntry;
@@ -3229,14 +3230,13 @@ declare const teamFile_TeamMemberEntrySchema: typeof TeamMemberEntrySchema;
3229
3230
  declare const teamFile_listTeamNames: typeof listTeamNames;
3230
3231
  declare const teamFile_readTeamFile: typeof readTeamFile;
3231
3232
  declare const teamFile_readTeamFileAtPath: typeof readTeamFileAtPath;
3232
- declare const teamFile_registerTeammateProcess: typeof registerTeammateProcess;
3233
3233
  declare const teamFile_sanitizeTeamName: typeof sanitizeTeamName;
3234
3234
  declare const teamFile_teamConfigPath: typeof teamConfigPath;
3235
3235
  declare const teamFile_teamDir: typeof teamDir;
3236
3236
  declare const teamFile_teamsBaseDir: typeof teamsBaseDir;
3237
3237
  declare const teamFile_writeTeamFile: typeof writeTeamFile;
3238
3238
  declare namespace teamFile {
3239
- export { type teamFile_TeamFile as TeamFile, type teamFile_TeamMemberEntry as TeamMemberEntry, teamFile_TeamMemberEntrySchema as TeamMemberEntrySchema, teamFile_listTeamNames as listTeamNames, teamFile_readTeamFile as readTeamFile, teamFile_readTeamFileAtPath as readTeamFileAtPath, teamFile_registerTeammateProcess as registerTeammateProcess, teamFile_sanitizeTeamName as sanitizeTeamName, teamFile_teamConfigPath as teamConfigPath, teamFile_teamDir as teamDir, teamFile_teamsBaseDir as teamsBaseDir, teamFile_writeTeamFile as writeTeamFile };
3239
+ export { type teamFile_TeamFile as TeamFile, type teamFile_TeamMemberEntry as TeamMemberEntry, teamFile_TeamMemberEntrySchema as TeamMemberEntrySchema, teamFile_listTeamNames as listTeamNames, teamFile_readTeamFile as readTeamFile, teamFile_readTeamFileAtPath as readTeamFileAtPath, teamFile_sanitizeTeamName as sanitizeTeamName, teamFile_teamConfigPath as teamConfigPath, teamFile_teamDir as teamDir, teamFile_teamsBaseDir as teamsBaseDir, teamFile_writeTeamFile as writeTeamFile };
3240
3240
  }
3241
3241
 
3242
3242
  interface AgentDefinition {
@@ -3247,7 +3247,7 @@ interface AgentDefinition {
3247
3247
  systemPromptOverride?: string;
3248
3248
  maxTurns?: number;
3249
3249
  model?: string;
3250
- permissionMode?: "plan";
3250
+ permissionMode?: PermissionMode;
3251
3251
  background?: boolean;
3252
3252
  isolation?: "worktree";
3253
3253
  initialPrompt?: string;
@@ -3285,6 +3285,9 @@ type SubagentProgressEvent = {
3285
3285
  };
3286
3286
  type AgentEventSink = (event: SubagentProgressEvent) => void;
3287
3287
  interface SubagentRunOptions {
3288
+ sessionId?: string;
3289
+ memoryContent?: string;
3290
+ agentName?: string;
3288
3291
  abortSignal?: AbortSignal;
3289
3292
  background?: boolean;
3290
3293
  onPermissionRequest?: AgentConfig["onPermissionRequest"];
@@ -3295,9 +3298,7 @@ interface SubagentRunOptions {
3295
3298
  * In-process teammate turns pass false: a teammate loop is one run per task
3296
3299
  * turn, so the turn-end stopAll() would immediately kill anything the
3297
3300
  * teammate backgrounded, and the drain disappears before any notification
3298
- * could be delivered. Teammates stay purely foreground (matching the
3299
- * subprocess teammate path); neither path exposes the Agent tool, so a
3300
- * teammate never has subagents of its own.
3301
+ * could be delivered. Teammates stay purely foreground and do not expose the Agent tool.
3301
3302
  */
3302
3303
  backgroundTasks?: boolean;
3303
3304
  }
@@ -3315,53 +3316,6 @@ declare namespace spawn {
3315
3316
  export { type spawn_AgentEventSink as AgentEventSink, spawn_SUBAGENT_INTERRUPTED_MARKER as SUBAGENT_INTERRUPTED_MARKER, type spawn_SubagentProgressEvent as SubagentProgressEvent, type spawn_SubagentRunOptions as SubagentRunOptions, spawn_spawnSubagent as spawnSubagent };
3316
3317
  }
3317
3318
 
3318
- /**
3319
- * Auto-detect the best backend for running teammates.
3320
- *
3321
- * Auto-detection logic:
3322
- * - Windows: always **in-process**.
3323
- * - Otherwise: tmux/iTerm panes when the corresponding environment is
3324
- * detected (TMUX / ITERM_SESSION_ID), else **in-process** so progress
3325
- * tracking works (agent events flow in the same process and can update
3326
- * the teammate progress UI in real time).
3327
- *
3328
- * In-process teammates share the Node.js event loop but are context-isolated.
3329
- * They communicate via the same file-based mailbox as external teammates.
3330
- */
3331
- declare function detectBackend(): TeamMode;
3332
- /**
3333
- * Detect available pane backend from the environment (TMUX /
3334
- * ITERM_SESSION_ID); falls back to in-process. Called unconditionally by
3335
- * detectBackend on non-Windows platforms.
3336
- */
3337
- declare function detectBackendFromEnv(): TeamMode;
3338
- /** Rebuilds the stable cancellation handle available for a restored tmux member. */
3339
- declare function restoreTeammateCancel(mode: TeamMode, paneId?: string): (() => void) | undefined;
3340
- interface SpawnConfig {
3341
- mode: Exclude<TeamMode, "in-process">;
3342
- command: string;
3343
- args: string[];
3344
- cwd: string;
3345
- paneId?: string;
3346
- }
3347
- declare function isProcessAlive(pid: number): boolean;
3348
- declare function isTeammateAlive(mode: TeamMode, paneId?: string, workerPid?: number): boolean;
3349
- declare function spawnTeammate(config: SpawnConfig): {
3350
- cancel: () => void;
3351
- paneId?: string;
3352
- };
3353
-
3354
- type backend_SpawnConfig = SpawnConfig;
3355
- declare const backend_detectBackend: typeof detectBackend;
3356
- declare const backend_detectBackendFromEnv: typeof detectBackendFromEnv;
3357
- declare const backend_isProcessAlive: typeof isProcessAlive;
3358
- declare const backend_isTeammateAlive: typeof isTeammateAlive;
3359
- declare const backend_restoreTeammateCancel: typeof restoreTeammateCancel;
3360
- declare const backend_spawnTeammate: typeof spawnTeammate;
3361
- declare namespace backend {
3362
- export { type backend_SpawnConfig as SpawnConfig, backend_detectBackend as detectBackend, backend_detectBackendFromEnv as detectBackendFromEnv, backend_isProcessAlive as isProcessAlive, backend_isTeammateAlive as isTeammateAlive, backend_restoreTeammateCancel as restoreTeammateCancel, backend_spawnTeammate as spawnTeammate };
3363
- }
3364
-
3365
3319
  declare function isCoordinatorTool(name: string): boolean;
3366
3320
  /**
3367
3321
  * Returns the tool-filter predicate for the Leader Agent.
@@ -3421,11 +3375,6 @@ declare const TEAMMATE_COORDINATION_TOOLS: ReadonlySet<string>;
3421
3375
  declare function isValidTeammateName(name: string): boolean;
3422
3376
  /** Text control form used by the leader's stop path and the agents dialog. */
3423
3377
  declare const SHUTDOWN_PREFIX = "[shutdown]";
3424
- /**
3425
- * Generates a request identifier. Uses a random string rather than an auto-incrementing
3426
- * sequence because requests may originate from teammates in different processes,
3427
- * where an incrementing counter would collide across process boundaries.
3428
- */
3429
3378
  declare function newRequestId(): string;
3430
3379
  /**
3431
3380
  * Shutdown request. The text carries the reason so the recipient can decide
@@ -3437,21 +3386,14 @@ declare function shutdownRequest(from: string, reason?: string): FileMailMessage
3437
3386
  declare function shutdownResponse(from: string, requestId: string, approve: boolean, reason?: string): FileMailMessage;
3438
3387
  /** Plan approval request; text contains the full plan content. */
3439
3388
  declare function planApprovalRequest(from: string, plan: string): FileMailMessage;
3440
- /** Approval result; on rejection, feedback explains what needs to change. */
3441
- declare function planApprovalResponse(from: string, requestId: string, approve: boolean, feedback?: string): FileMailMessage;
3389
+ /** Records the runtime's automatic plan approval. */
3390
+ declare function planApprovalResponse(from: string, requestId: string, feedback?: string): FileMailMessage;
3442
3391
  /**
3443
3392
  * Determines whether a message is a shutdown request.
3444
3393
  *
3445
3394
  * Both the typed protocol and the leader's plain-text stop control are accepted.
3446
3395
  */
3447
3396
  declare function isShutdownRequest(m: FileMailMessage): boolean;
3448
- /**
3449
- * Whether the response constitutes approval. When the field is absent, it is
3450
- * treated as not approved — silence is never interpreted as consent; the
3451
- * requester follows the rejection path instead (for plan approval, the
3452
- * teammate revises and resubmits).
3453
- */
3454
- declare function approved(m: FileMailMessage): boolean;
3455
3397
 
3456
3398
  declare const protocol_LEADER_NAME: typeof LEADER_NAME;
3457
3399
  declare const protocol_MSG_PLAN_APPROVAL_REQUEST: typeof MSG_PLAN_APPROVAL_REQUEST;
@@ -3461,7 +3403,6 @@ declare const protocol_MSG_SHUTDOWN_RESPONSE: typeof MSG_SHUTDOWN_RESPONSE;
3461
3403
  declare const protocol_MSG_TEXT: typeof MSG_TEXT;
3462
3404
  declare const protocol_SHUTDOWN_PREFIX: typeof SHUTDOWN_PREFIX;
3463
3405
  declare const protocol_TEAMMATE_COORDINATION_TOOLS: typeof TEAMMATE_COORDINATION_TOOLS;
3464
- declare const protocol_approved: typeof approved;
3465
3406
  declare const protocol_isShutdownRequest: typeof isShutdownRequest;
3466
3407
  declare const protocol_isValidTeammateName: typeof isValidTeammateName;
3467
3408
  declare const protocol_newRequestId: typeof newRequestId;
@@ -3470,7 +3411,7 @@ declare const protocol_planApprovalResponse: typeof planApprovalResponse;
3470
3411
  declare const protocol_shutdownRequest: typeof shutdownRequest;
3471
3412
  declare const protocol_shutdownResponse: typeof shutdownResponse;
3472
3413
  declare namespace protocol {
3473
- export { protocol_LEADER_NAME as LEADER_NAME, protocol_MSG_PLAN_APPROVAL_REQUEST as MSG_PLAN_APPROVAL_REQUEST, protocol_MSG_PLAN_APPROVAL_RESPONSE as MSG_PLAN_APPROVAL_RESPONSE, protocol_MSG_SHUTDOWN_REQUEST as MSG_SHUTDOWN_REQUEST, protocol_MSG_SHUTDOWN_RESPONSE as MSG_SHUTDOWN_RESPONSE, protocol_MSG_TEXT as MSG_TEXT, protocol_SHUTDOWN_PREFIX as SHUTDOWN_PREFIX, protocol_TEAMMATE_COORDINATION_TOOLS as TEAMMATE_COORDINATION_TOOLS, protocol_approved as approved, protocol_isShutdownRequest as isShutdownRequest, protocol_isValidTeammateName as isValidTeammateName, protocol_newRequestId as newRequestId, protocol_planApprovalRequest as planApprovalRequest, protocol_planApprovalResponse as planApprovalResponse, protocol_shutdownRequest as shutdownRequest, protocol_shutdownResponse as shutdownResponse };
3414
+ export { protocol_LEADER_NAME as LEADER_NAME, protocol_MSG_PLAN_APPROVAL_REQUEST as MSG_PLAN_APPROVAL_REQUEST, protocol_MSG_PLAN_APPROVAL_RESPONSE as MSG_PLAN_APPROVAL_RESPONSE, protocol_MSG_SHUTDOWN_REQUEST as MSG_SHUTDOWN_REQUEST, protocol_MSG_SHUTDOWN_RESPONSE as MSG_SHUTDOWN_RESPONSE, protocol_MSG_TEXT as MSG_TEXT, protocol_SHUTDOWN_PREFIX as SHUTDOWN_PREFIX, protocol_TEAMMATE_COORDINATION_TOOLS as TEAMMATE_COORDINATION_TOOLS, protocol_isShutdownRequest as isShutdownRequest, protocol_isValidTeammateName as isValidTeammateName, protocol_newRequestId as newRequestId, protocol_planApprovalRequest as planApprovalRequest, protocol_planApprovalResponse as planApprovalResponse, protocol_shutdownRequest as shutdownRequest, protocol_shutdownResponse as shutdownResponse };
3474
3415
  }
3475
3416
 
3476
3417
  /**
@@ -3600,7 +3541,6 @@ declare namespace tools$1 {
3600
3541
  export { tools$1_ListTeamsTool as ListTeamsTool, tools$1_SendMessageTool as SendMessageTool, tools$1_TeamCreateTool as TeamCreateTool, tools$1_TeamDeleteTool as TeamDeleteTool };
3601
3542
  }
3602
3543
 
3603
- type TeamMode = "in-process" | "tmux" | "iterm";
3604
3544
  type AgentEventCallback = (event: SubagentProgressEvent) => void;
3605
3545
  interface Member {
3606
3546
  name: string;
@@ -3612,17 +3552,8 @@ interface Member {
3612
3552
  stopping?: Promise<void>;
3613
3553
  mailbox: FileMailbox;
3614
3554
  uiState?: TeammateUIState;
3615
- /** Stable tmux session name, persisted so cancellation survives leader restart. */
3616
- paneId?: string;
3617
- workerPid?: number;
3618
- /** Actual backend used by this member (which can differ after fallback). */
3619
- backendType?: TeamMode;
3620
- /** Whether this is an external-process teammate (tmux/iTerm); stopOne writes the mailbox shutdown notice only for external members. */
3621
- external?: boolean;
3622
- /** Optional: permission checker for the teammate. Plan mode uses it to determine the current state; permissions are elevated in place once approval is granted. */
3623
3555
  checker?: PermissionChecker;
3624
3556
  planApprovalRequired?: boolean;
3625
- readOnlyRole?: boolean;
3626
3557
  agentId?: string;
3627
3558
  agentType?: string;
3628
3559
  model?: string;
@@ -3632,23 +3563,15 @@ interface Member {
3632
3563
  type RunAgent = (task: string, onEvent?: AgentEventCallback, abortSignal?: AbortSignal) => Promise<string>;
3633
3564
  declare class Team {
3634
3565
  name: string;
3635
- mode: TeamMode;
3636
3566
  members: Map<string, Member>;
3637
3567
  leaderMailbox: FileMailbox;
3638
3568
  private mailboxDir;
3639
3569
  private cwd;
3640
- private lastLivenessCheck;
3641
3570
  leaderAgentId: string;
3642
3571
  permissionMode: PermissionChecker["mode"];
3643
3572
  description?: string;
3644
3573
  createdAt: number;
3645
- /**
3646
- * PID of the leader process. Written to config.json so external teammates
3647
- * can detect a dead leader (they exit instead of polling forever); a
3648
- * restarted leader re-claims it when the team is restored from disk.
3649
- */
3650
- leaderPid: number;
3651
- constructor(name: string, mode: TeamMode, cwd: string);
3574
+ constructor(name: string, cwd: string);
3652
3575
  private createMember;
3653
3576
  addMember(name: string): Member;
3654
3577
  removeMember(name: string): void;
@@ -3671,38 +3594,13 @@ declare class Team {
3671
3594
  */
3672
3595
  persist(): void;
3673
3596
  static readonly IDLE_POLL_INTERVAL_MS = 500;
3674
- static readonly STOP_GRACE_MS = 2500;
3675
3597
  static readonly SHUTDOWN_PREFIX = "[shutdown]";
3676
- /**
3677
- * Spawns a teammate, dispatching by team backend mode.
3678
- * - in-process: runs the agent main loop in a background task within this process (idle-poll-continue).
3679
- * - tmux / iterm: assembles the teammate startup command and delegates to the backend to launch
3680
- * an independent worker process in a new pane / tab, communicating bidirectionally with the
3681
- * leader via the shared file-based mailbox.
3682
- * Falls back to in-process when the external backend is unavailable (tmux not installed,
3683
- * non-iTerm environment, etc.) to avoid crashes.
3684
- */
3685
- spawnTeammate(name: string, task: string, runAgent: RunAgent, checker?: PermissionChecker, providerIndex?: number, originToolCallId?: string, memberCwd?: string, role?: {
3598
+ spawnTeammate(name: string, task: string, runAgent: RunAgent, checker?: PermissionChecker, originToolCallId?: string, memberCwd?: string, role?: {
3686
3599
  agentType?: string;
3687
3600
  model?: string;
3688
3601
  planApprovalRequired?: boolean;
3689
- readOnly?: boolean;
3690
3602
  cleanup?: () => Promise<void>;
3691
- }): TeamMode;
3692
- /**
3693
- * tmux / iTerm backend: launches the teammate as an independent process in a new pane / tab.
3694
- * The teammate process connects back to the team via the same mailbox directory pointed to
3695
- * by `--team-dir`; task assignments from the leader and idle/result notifications from the
3696
- * worker all land in this directory, keeping both sides in sync.
3697
- */
3698
- private spawnExternal;
3699
- /**
3700
- * Starts an in-process teammate: runs the agent's main loop in the background,
3701
- * sends an idle notification upon completion, and then polls the mailbox for new tasks.
3702
- * Exits the loop upon receiving a shutdown message or being canceled.
3703
- * Uses the idle-poll-continue pattern: after each turn completes, reports idle and waits for the next task.
3704
- */
3705
- private spawnInProcess;
3603
+ }): void;
3706
3604
  /**
3707
3605
  * Polls the teammate's mailbox until a new message arrives.
3708
3606
  * Returns the concatenated prompt, or the shutdown message itself in the
@@ -3710,18 +3608,8 @@ declare class Team {
3710
3608
  * shutdown message from the leader is returned instead.
3711
3609
  */
3712
3610
  private waitForNextPromptOrShutdown;
3713
- /** Reads the teammate's plan file for review; returns a fallback note when empty or unreadable. */
3714
- private readPlanForReview;
3715
- /**
3716
- * Sends the teammate's completed plan to the Leader, blocks until approval is received,
3717
- * and returns the prompt to feed the model on the next turn.
3718
- *
3719
- * The teammate holds read-only permissions at this point, so no matter how long the
3720
- * wait, no damage can occur — hence no timeout is set here. Rather than timing out and
3721
- * autonomously modifying files, it is better to wait indefinitely and let the user
3722
- * drive progress from the Leader side. Returns null when the teammate has been
3723
- * deactivated; the caller should exit the main loop.
3724
- */
3611
+ /** Reads the submitted plan, falling back to the final response. */
3612
+ private readPlan;
3725
3613
  private runPlanApproval;
3726
3614
  getMember(name: string): Member | undefined;
3727
3615
  private waitForMember;
@@ -3729,63 +3617,33 @@ declare class Team {
3729
3617
  sendMessage(from: string, to: string, content: string): Promise<void>;
3730
3618
  stopMember(name: string): Promise<void>;
3731
3619
  stopAll(): Promise<void>;
3732
- /**
3733
- * Stops a single teammate: marks it inactive, updates UI state, and
3734
- * unregisters the name so SendMessage can no longer resolve it.
3735
- * External teammates get a grace window after the shutdown notice — they
3736
- * poll their mailbox every ~2 s, so waiting one poll interval lets the
3737
- * common (idle) case exit gracefully before the pane is force-killed.
3738
- * In-process teammates are stopped via cancel (abort) alone; `done` is then
3739
- * awaited so the loop has fully exited (external members have no promise).
3740
- */
3741
3620
  private stopOne;
3742
3621
  private stopMemberRuntime;
3743
3622
  listMembers(): Member[];
3744
3623
  getTeammateStates(): TeammateUIState[];
3745
- refreshExternalMembers(): void;
3746
3624
  pruneTerminatedMembers(): void;
3747
3625
  }
3748
- interface TeamManagerOptions {
3749
- /**
3750
- * Whether this manager acts as the team leader: leaders claim leaderPid on
3751
- * create/restore (persisted for teammate liveness checks), while teammate
3752
- * processes must leave it untouched. Defaults to true.
3753
- */
3754
- claimLeadership?: boolean;
3755
- }
3756
3626
  declare class TeamManager {
3757
3627
  /** Teams keyed by their canonical disk slug; Team.name remains the display name. */
3758
3628
  private teams;
3759
3629
  private cwd;
3760
- private claimLeadership;
3761
3630
  private permissionChecker?;
3762
3631
  private unsubscribePermissions?;
3763
3632
  private taskStores;
3764
3633
  private listeners;
3765
- constructor(cwd: string, opts?: TeamManagerOptions);
3634
+ constructor(cwd: string);
3766
3635
  subscribe(listener: () => void): () => void;
3767
3636
  private emitChange;
3768
3637
  setPermissionChecker(checker: PermissionChecker): void;
3769
3638
  private teamKey;
3770
3639
  private teamDir;
3771
- create(name: string, mode?: TeamMode, opts?: {
3640
+ create(name: string, opts?: {
3772
3641
  leaderAgentId?: string;
3773
3642
  description?: string;
3774
3643
  }): Team;
3775
- /**
3776
- * Checks the in-memory cache first; on miss, hydrates config.json without
3777
- * incremental member writes. Active members regain their runtime-facing UI,
3778
- * registry, and external cancellation metadata. A leader claims leadership
3779
- * with one final snapshot; teammate processes leave the file byte-identical.
3780
- */
3781
3644
  get(name: string): Team | undefined;
3782
- /**
3783
- * Loads every team found on disk into the manager. Called on leader startup
3784
- * so teams (and their leader mailboxes) survive a leader restart: external
3785
- * teammates keep running, and their notifications are drained again.
3786
- */
3787
3645
  restoreFromDisk(): void;
3788
- /** Retrieves the team's shared task store; loads from disk (tasks.json) when not cached in memory (e.g. in a teammate process). */
3646
+ /** Retrieves the team's shared task store, loading tasks.json after restoration. */
3789
3647
  getTaskStore(teamName: string): SharedTaskStore;
3790
3648
  list(): Team[];
3791
3649
  stopAll(): Promise<void>;
@@ -3814,10 +3672,8 @@ type index$m_Team = Team;
3814
3672
  declare const index$m_Team: typeof Team;
3815
3673
  type index$m_TeamManager = TeamManager;
3816
3674
  declare const index$m_TeamManager: typeof TeamManager;
3817
- type index$m_TeamManagerOptions = TeamManagerOptions;
3818
- type index$m_TeamMode = TeamMode;
3819
3675
  declare namespace index$m {
3820
- export { type index$m_AgentEventCallback as AgentEventCallback, backend as Backend, coordinator$1 as Coordinator, fileLock as FileLock, fileMailbox as FileMailbox, type index$m_Member as Member, progress$1 as Progress, protocol as Protocol, registry as Registry, type index$m_RunAgent as RunAgent, sharedTask as SharedTask, taskStop as TaskStop, taskTools as TaskTools, index$m_Team as Team, teamFile as TeamFile, index$m_TeamManager as TeamManager, type index$m_TeamManagerOptions as TeamManagerOptions, type index$m_TeamMode as TeamMode, tools$1 as Tools };
3676
+ export { type index$m_AgentEventCallback as AgentEventCallback, coordinator$1 as Coordinator, fileLock as FileLock, fileMailbox as FileMailbox, type index$m_Member as Member, progress$1 as Progress, protocol as Protocol, registry as Registry, type index$m_RunAgent as RunAgent, sharedTask as SharedTask, taskStop as TaskStop, taskTools as TaskTools, index$m_Team as Team, teamFile as TeamFile, index$m_TeamManager as TeamManager, tools$1 as Tools };
3821
3677
  }
3822
3678
 
3823
3679
  declare function countMcpTools(registry: ToolRegistry): number;
@@ -4793,7 +4649,7 @@ interface InitLoggerOptions {
4793
4649
  skipCleanup?: boolean;
4794
4650
  /**
4795
4651
  * Mirror JSONL to stdout in addition to the log file. Only safe in remote
4796
- * mode (UI owns stdout; teammates use it for IPC). Lets users watch logs
4652
+ * mode (UI owns stdout). Lets users watch logs
4797
4653
  * live or pipe them through pino-pretty.
4798
4654
  */
4799
4655
  stdout?: boolean;
@@ -5753,7 +5609,7 @@ declare namespace server {
5753
5609
  export { type server_CreateRemoteAgentOptions as CreateRemoteAgentOptions, type server_RemoteAgentHandle as RemoteAgentHandle, server_RemoteServer as RemoteServer, type server_RunCallbacks as RunCallbacks, server_createRemoteAgent as createRemoteAgent };
5754
5610
  }
5755
5611
 
5756
- type SessionState = Pick<RemoteAgentHandle, "conv" | "sessionId" | "cwd" | "fileHistory" | "fileStateCache" | "recoveryState" | "activeSkills" | "toolFilter" | "taskList" | "planFilePath" | "goalManager">;
5612
+ type SessionState = Pick<RemoteAgentHandle, "conv" | "sessionId" | "cwd" | "fileHistory" | "fileStateCache" | "recoveryState" | "activeSkills" | "toolFilter" | "taskList" | "planFilePath" | "goalManager" | "backgroundTaskManager">;
5757
5613
  declare function restoreRemoteSession(state: SessionState, sessionId: string, saved: SessionMessage[]): RestoredMessage[];
5758
5614
 
5759
5615
  declare const sessionState_restoreRemoteSession: typeof restoreRemoteSession;
@@ -5851,6 +5707,7 @@ declare namespace index$7 {
5851
5707
  }
5852
5708
 
5853
5709
  interface TeammateRunOptions {
5710
+ agentName: string;
5854
5711
  definition: AgentDefinition;
5855
5712
  modelOverride?: string;
5856
5713
  onPermissionRequest?: ToolContext["onPermissionRequest"];
@@ -5881,7 +5738,6 @@ declare class AgentTool implements Tool {
5881
5738
  * and returns the callback that runs the teammate agent's main loop.
5882
5739
  */
5883
5740
  private teamRunAgentFactory?;
5884
- private teamProviderIndex?;
5885
5741
  private spawnHandler;
5886
5742
  private forkHandler?;
5887
5743
  constructor(cwd: string, registry: ToolRegistry, spawnHandler: (def: AgentDefinition, prompt: string, bg: boolean, modelOverride?: string, cwdOverride?: string, context?: ToolContext) => Promise<string>, conversation?: ConversationManager, forkHandler?: (prompt: string, conversation: ConversationManager, registry: ToolRegistry, modelOverride?: string, context?: ToolContext) => Promise<string>, taskManager?: TaskManager);
@@ -5889,7 +5745,7 @@ declare class AgentTool implements Tool {
5889
5745
  * Sets the team manager and teammate run callback, enabling the team_name parameter
5890
5746
  * so teammates can be spawned directly through the Agent tool.
5891
5747
  */
5892
- setTeamManager(mgr: TeamManager, runAgentFactory: (registry: ToolRegistry, checker?: PermissionChecker, cwd?: string, options?: TeammateRunOptions) => RunAgent, providerIndex?: number): void;
5748
+ setTeamManager(mgr: TeamManager, runAgentFactory: (registry: ToolRegistry, checker?: PermissionChecker, cwd?: string, options?: TeammateRunOptions) => RunAgent): void;
5893
5749
  forFork(registry: ToolRegistry): AgentTool;
5894
5750
  schema(): ToolSchema;
5895
5751
  private buildDescription;
@@ -5897,8 +5753,7 @@ declare class AgentTool implements Tool {
5897
5753
  private startBackground;
5898
5754
  /**
5899
5755
  * Team-member mode: Spawns a persistent teammate in the specified team.
5900
- * Delegates to Team.spawnTeammate(), which dispatches by team backend mode
5901
- * (in-process idle-poll loop, or an external pane/tab process).
5756
+ * Runs persistently within this process.
5902
5757
  */
5903
5758
  private runAsTeammate;
5904
5759
  /**
@@ -6061,6 +5916,7 @@ declare class BashTool implements Tool {
6061
5916
  backgroundForegroundTasks(): number;
6062
5917
  schema(): ToolSchema;
6063
5918
  execute(ctx: ToolContext, args: Record<string, unknown>): Promise<ToolResult>;
5919
+ private executeCommand;
6064
5920
  /**
6065
5921
  * Spawn the command with stdout+stderr writing directly into the output
6066
5922
  * file (file-descriptor mode): output never flows through JS, so
@@ -6233,6 +6089,7 @@ declare class EditFileTool implements Tool {
6233
6089
  category: ToolCategory;
6234
6090
  schema(): ToolSchema;
6235
6091
  execute(ctx: ToolContext, args: Record<string, unknown>): Promise<ToolResult>;
6092
+ private executeMutation;
6236
6093
  }
6237
6094
 
6238
6095
  type editFile_EditFileTool = EditFileTool;
@@ -6296,6 +6153,21 @@ declare namespace exitPlanMode {
6296
6153
  export { exitPlanMode_ExitPlanModeTool as ExitPlanModeTool };
6297
6154
  }
6298
6155
 
6156
+ declare function acquireWorkspaceMutation(cwd: string, signal?: AbortSignal): Promise<() => void>;
6157
+ declare function acquireCommandExecution(cwd: string, command: string, signal?: AbortSignal): Promise<() => void>;
6158
+ declare function checkExecutionPermission(ctx: ToolContext, toolName: string, args: Record<string, unknown>): ToolResult | undefined;
6159
+ declare function withCommandExecution(ctx: ToolContext, toolName: string, args: Record<string, unknown>, command: string, run: (started: (done: Promise<void>) => void) => Promise<ToolResult>): Promise<ToolResult>;
6160
+ declare function withWorkspaceMutation(ctx: ToolContext, toolName: string, args: Record<string, unknown>, run: () => Promise<ToolResult>): Promise<ToolResult>;
6161
+
6162
+ declare const executionCoordinator_acquireCommandExecution: typeof acquireCommandExecution;
6163
+ declare const executionCoordinator_acquireWorkspaceMutation: typeof acquireWorkspaceMutation;
6164
+ declare const executionCoordinator_checkExecutionPermission: typeof checkExecutionPermission;
6165
+ declare const executionCoordinator_withCommandExecution: typeof withCommandExecution;
6166
+ declare const executionCoordinator_withWorkspaceMutation: typeof withWorkspaceMutation;
6167
+ declare namespace executionCoordinator {
6168
+ export { executionCoordinator_acquireCommandExecution as acquireCommandExecution, executionCoordinator_acquireWorkspaceMutation as acquireWorkspaceMutation, executionCoordinator_checkExecutionPermission as checkExecutionPermission, executionCoordinator_withCommandExecution as withCommandExecution, executionCoordinator_withWorkspaceMutation as withWorkspaceMutation };
6169
+ }
6170
+
6299
6171
  declare class ExitWorktreeTool implements Tool {
6300
6172
  name: string;
6301
6173
  description: string;
@@ -6497,6 +6369,7 @@ declare class PowerShellTool implements Tool {
6497
6369
  backgroundForegroundTasks(): number;
6498
6370
  schema(): ToolSchema;
6499
6371
  execute(ctx: ToolContext, args: Record<string, unknown>): Promise<ToolResult>;
6372
+ private executeCommand;
6500
6373
  /**
6501
6374
  * Spawn PowerShell with stdout+stderr writing directly into the output file
6502
6375
  * (fd mode, shared with BashTool): output never flows through JS, so
@@ -6545,12 +6418,8 @@ declare namespace searchOutput {
6545
6418
 
6546
6419
  /** Notification body budget: larger outputs stay on disk and only a preview travels in the notification. */
6547
6420
  declare const BACKGROUND_NOTIFICATION_BYTES = 30000;
6548
- /**
6549
- * A backgrounded command may fill up to 5GB before the size watchdog kills it:
6550
- * with no JS in the write path, a stuck append loop could otherwise grow the
6551
- * output file without bound. Foreground keeps the historical 10MB cap.
6552
- */
6553
- declare const BACKGROUND_MAX_OUTPUT_BYTES: number;
6421
+ /** Disk cap for foreground and background commands, independent of display limits. */
6422
+ declare const MAX_SHELL_OUTPUT_FILE_BYTES: number;
6554
6423
  declare const SIZE_WATCHDOG_INTERVAL_MS = 500;
6555
6424
  type BackgroundReason = "explicit" | "user" | "timeout";
6556
6425
  /** Terminal facts about the child process, consumed to build results and notifications. */
@@ -6563,6 +6432,7 @@ interface ShellExit {
6563
6432
  spawnError?: string;
6564
6433
  }
6565
6434
  interface CommandHandle {
6435
+ done: Promise<void>;
6566
6436
  /** Resolves the tool call: either the inline completion or an early "moved to background" message. */
6567
6437
  result: Promise<ToolResult>;
6568
6438
  /**
@@ -6587,7 +6457,7 @@ declare function openOutputFd(path: string): number;
6587
6457
  /**
6588
6458
  * Create the file that receives a command's stdout+stderr. Lives in the
6589
6459
  * session tool-results directory (the established spill location, readable by
6590
- * the model for backgrounded commands); falls back to the OS temp dir when
6460
+ * the model for large command outputs); falls back to the OS temp dir when
6591
6461
  * that directory cannot be created.
6592
6462
  */
6593
6463
  declare function createShellOutputFile(sessionId: string): {
@@ -6602,15 +6472,12 @@ declare function createShellOutputFile(sessionId: string): {
6602
6472
  */
6603
6473
  declare function formatFinalResult(prompt: string, command: string, exit: ShellExit, merged: string, truncated: boolean, timeout: number): ToolResult;
6604
6474
  /**
6605
- * Build the notification body for a finished background command from the
6606
- * output file. Small outputs are inlined and the file is deleted; large
6607
- * outputs keep the file on disk and the notification carries its path with a
6475
+ * Build a finished command's result from its output file. Small outputs are
6476
+ * inlined and the file is deleted; large outputs stay on disk with a
6608
6477
  * byte-bounded preview, so the full text stays readable via ReadFile without
6609
- * ever loading it into JS here. `annotate` is the sandbox's stderr annotator
6610
- * (sandbox violation notes); the foreground path applies it in
6611
- * settleExit, and background notifications must report identically.
6478
+ * loading it into JS. `annotate` adds sandbox violation notes to captured output.
6612
6479
  */
6613
- declare function buildBackgroundBody(prompt: string, command: string, exit: ShellExit, outputPath: string, timeout: number, annotate?: (text: string) => string): ToolResult;
6480
+ declare function buildShellResult(prompt: string, command: string, exit: ShellExit, outputPath: string, timeout: number, inlineLimit?: number, annotate?: (text: string) => string): ToolResult;
6614
6481
  declare const BackgroundableToolShape: z$1.ZodObject<{
6615
6482
  taskManager: z$1.ZodNullable<z$1.ZodInstanceOf<TaskManager>>;
6616
6483
  backgroundEnabled: z$1.ZodFunction<z$1.ZodTuple<readonly [], null>, z$1.ZodBoolean>;
@@ -6640,18 +6507,18 @@ declare function hasAnyForegroundTasks(registry: ToolRegistry): boolean;
6640
6507
  declare function backgroundAllForegroundTasks(registry: ToolRegistry): number;
6641
6508
 
6642
6509
  declare const shellBackground_BACKGROUNDABLE_TOOL_NAMES: typeof BACKGROUNDABLE_TOOL_NAMES;
6643
- declare const shellBackground_BACKGROUND_MAX_OUTPUT_BYTES: typeof BACKGROUND_MAX_OUTPUT_BYTES;
6644
6510
  declare const shellBackground_BACKGROUND_NOTIFICATION_BYTES: typeof BACKGROUND_NOTIFICATION_BYTES;
6645
6511
  type shellBackground_BackgroundReason = BackgroundReason;
6646
6512
  type shellBackground_BackgroundableTool = BackgroundableTool;
6647
6513
  type shellBackground_CommandHandle = CommandHandle;
6514
+ declare const shellBackground_MAX_SHELL_OUTPUT_FILE_BYTES: typeof MAX_SHELL_OUTPUT_FILE_BYTES;
6648
6515
  declare const shellBackground_SIZE_WATCHDOG_INTERVAL_MS: typeof SIZE_WATCHDOG_INTERVAL_MS;
6649
6516
  type shellBackground_ShellExit = ShellExit;
6650
6517
  declare const shellBackground_attachBackgroundTaskManager: typeof attachBackgroundTaskManager;
6651
6518
  declare const shellBackground_backgroundAllForegroundTasks: typeof backgroundAllForegroundTasks;
6652
6519
  declare const shellBackground_backgroundMessage: typeof backgroundMessage;
6653
6520
  declare const shellBackground_backgroundTaskName: typeof backgroundTaskName;
6654
- declare const shellBackground_buildBackgroundBody: typeof buildBackgroundBody;
6521
+ declare const shellBackground_buildShellResult: typeof buildShellResult;
6655
6522
  declare const shellBackground_createShellOutputFile: typeof createShellOutputFile;
6656
6523
  declare const shellBackground_discardFd: typeof discardFd;
6657
6524
  declare const shellBackground_formatFinalResult: typeof formatFinalResult;
@@ -6661,7 +6528,7 @@ declare const shellBackground_readOutputFile: typeof readOutputFile;
6661
6528
  declare const shellBackground_sliceUtf8Safe: typeof sliceUtf8Safe;
6662
6529
  declare const shellBackground_unlinkQuiet: typeof unlinkQuiet;
6663
6530
  declare namespace shellBackground {
6664
- export { shellBackground_BACKGROUNDABLE_TOOL_NAMES as BACKGROUNDABLE_TOOL_NAMES, shellBackground_BACKGROUND_MAX_OUTPUT_BYTES as BACKGROUND_MAX_OUTPUT_BYTES, shellBackground_BACKGROUND_NOTIFICATION_BYTES as BACKGROUND_NOTIFICATION_BYTES, 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_openOutputFd as openOutputFd, shellBackground_readOutputFile as readOutputFile, shellBackground_sliceUtf8Safe as sliceUtf8Safe, shellBackground_unlinkQuiet as unlinkQuiet };
6531
+ export { shellBackground_BACKGROUNDABLE_TOOL_NAMES as BACKGROUNDABLE_TOOL_NAMES, shellBackground_BACKGROUND_NOTIFICATION_BYTES as BACKGROUND_NOTIFICATION_BYTES, type shellBackground_BackgroundReason as BackgroundReason, type shellBackground_BackgroundableTool as BackgroundableTool, type shellBackground_CommandHandle as CommandHandle, shellBackground_MAX_SHELL_OUTPUT_FILE_BYTES as MAX_SHELL_OUTPUT_FILE_BYTES, 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_buildShellResult as buildShellResult, shellBackground_createShellOutputFile as createShellOutputFile, shellBackground_discardFd as discardFd, shellBackground_formatFinalResult as formatFinalResult, shellBackground_hasAnyForegroundTasks as hasAnyForegroundTasks, shellBackground_openOutputFd as openOutputFd, shellBackground_readOutputFile as readOutputFile, shellBackground_sliceUtf8Safe as sliceUtf8Safe, shellBackground_unlinkQuiet as unlinkQuiet };
6665
6532
  }
6666
6533
 
6667
6534
  declare const MAX_SHELL_OUTPUT_BYTES: number;
@@ -6789,6 +6656,7 @@ declare class WriteFileTool implements Tool {
6789
6656
  category: ToolCategory;
6790
6657
  schema(): ToolSchema;
6791
6658
  execute(ctx: ToolContext, args: Record<string, unknown>): Promise<ToolResult>;
6659
+ private executeMutation;
6792
6660
  }
6793
6661
 
6794
6662
  type writeFile_WriteFileTool = WriteFileTool;
@@ -6798,7 +6666,7 @@ declare namespace writeFile {
6798
6666
  }
6799
6667
 
6800
6668
  declare namespace index$4 {
6801
- export { askUser as AskUser, bash as Bash, bingSearch as BingSearch, computerUse as ComputerUse, descriptions as Descriptions, diff as Diff, editFile as EditFile, editFileDiagnostics as EditFileDiagnostics, enterWorktree as EnterWorktree, exitCodeHints as ExitCodeHints, exitPlanMode as ExitPlanMode, exitWorktree as ExitWorktree, fileMutationQueue as FileMutationQueue, fileStateCache as FileStateCache, glob as Glob, goal as Goal, grep as Grep, isDiffTool$1 as IsDiffTool, lsp as LSP, mcpCall as McpCall, powershell as PowerShell, readFile as ReadFile, registry$1 as Registry, searchOutput as SearchOutput, shellBackground as ShellBackground, shellOutput as ShellOutput, snippets as Snippets, syntheticOutput as SyntheticOutput, taskOutput as TaskOutput, toolSearch as ToolSearch, types$1 as Types, webFetch as WebFetch, webSearch as WebSearch, writeFile as WriteFile };
6669
+ export { askUser as AskUser, bash as Bash, bingSearch as BingSearch, computerUse as ComputerUse, descriptions as Descriptions, diff as Diff, editFile as EditFile, editFileDiagnostics as EditFileDiagnostics, enterWorktree as EnterWorktree, executionCoordinator as ExecutionCoordinator, exitCodeHints as ExitCodeHints, exitPlanMode as ExitPlanMode, exitWorktree as ExitWorktree, fileMutationQueue as FileMutationQueue, fileStateCache as FileStateCache, glob as Glob, goal as Goal, grep as Grep, isDiffTool$1 as IsDiffTool, lsp as LSP, mcpCall as McpCall, powershell as PowerShell, readFile as ReadFile, registry$1 as Registry, searchOutput as SearchOutput, shellBackground as ShellBackground, shellOutput as ShellOutput, snippets as Snippets, syntheticOutput as SyntheticOutput, taskOutput as TaskOutput, toolSearch as ToolSearch, types$1 as Types, webFetch as WebFetch, webSearch as WebSearch, writeFile as WriteFile };
6802
6670
  }
6803
6671
 
6804
6672
  type PackageManager = "npm" | "yarn" | "pnpm";
@@ -7076,58 +6944,6 @@ declare namespace recover$1 {
7076
6944
  export { recover$1_isTerminalGone as isTerminalGone, recover$1_record as record, recover$1_recordError as recordError, recover$1_recordExit as recordExit, recover$1_recover as recover };
7077
6945
  }
7078
6946
 
7079
- interface TeammateArgs {
7080
- teamDir: string;
7081
- teamCwd?: string;
7082
- teamName: string;
7083
- memberName: string;
7084
- initialTask: string;
7085
- permissionMode: PermissionMode;
7086
- agentType?: string;
7087
- model?: string;
7088
- /** Index into the config's providers array; defaults to `default_provider`. */
7089
- providerIndex?: number;
7090
- }
7091
- declare function parseTeammateFlags(args: string[]): TeammateArgs | null;
7092
- /**
7093
- * Assemble the teammate tool registry: file/command tools, tool search,
7094
- * worktree switching, Skills, and MCP extensions, plus team collaboration
7095
- * tools (SendMessage under the member's own name, and the shared task board).
7096
- * The task board resolves to a single tasks.json by team name, so all
7097
- * teammates operate on the same board.
7098
- *
7099
- * Agent is intentionally excluded — the call tree terminates at the teammate
7100
- * level. TeamCreate and TeamDelete are also excluded; team lifecycle
7101
- * management is the Leader's responsibility.
7102
- */
7103
- declare function buildTeammateRegistry(opts: {
7104
- sandboxConfig?: SandboxYamlConfig;
7105
- cwd: string;
7106
- teamCwd?: string;
7107
- definition?: AgentDefinition;
7108
- teamName: string;
7109
- memberName: string;
7110
- catalog: SkillCatalog;
7111
- skillHost: SkillHost;
7112
- mcpServers?: MCPServerConfig[];
7113
- lspServers?: LspServerConfig[];
7114
- /** The running teammate retains this manager and disconnects it on exit. */
7115
- mcpManager?: MCPManager;
7116
- /** Used to decide the MCP loading mode: total schema volume is weighed against the context window. */
7117
- baseUrl?: string;
7118
- /** Provider protocol; native deferred loading is Anthropic-only. */
7119
- protocol?: ProviderConfig["protocol"];
7120
- contextWindow?: number;
7121
- }): Promise<ToolRegistry>;
7122
- declare function runTeammate(args: TeammateArgs): Promise<void>;
7123
-
7124
- declare const teammate_buildTeammateRegistry: typeof buildTeammateRegistry;
7125
- declare const teammate_parseTeammateFlags: typeof parseTeammateFlags;
7126
- declare const teammate_runTeammate: typeof runTeammate;
7127
- declare namespace teammate {
7128
- export { teammate_buildTeammateRegistry as buildTeammateRegistry, teammate_parseTeammateFlags as parseTeammateFlags, teammate_runTeammate as runTeammate };
7129
- }
7130
-
7131
6947
  declare const version: string;
7132
6948
 
7133
6949
  declare const version$1_version: typeof version;
@@ -7135,4 +6951,4 @@ declare namespace version$1 {
7135
6951
  export { version$1_version as version };
7136
6952
  }
7137
6953
 
7138
- export { index$u as A2a, index$t as Acp, index$p as Agent, index$l as Bootstrap, index$k as CodeReview, index$j as Commands, index$i as Compact, index$s as Config, index$w as Conversation, index$z as FileHistory, index$y as Goal, index$h as History, index$r as Hooks, index$g as Images, index$f as LLM, index$d as LSP, index$e as Logger, index$c as MCP, index$b as Memory, index$x as Permissions, index$a as PlanFile, printMode as PrintMode, index$9 as Prompt, recover$1 as Recover, index$8 as Remote, index$7 as Sandbox, index$v as Session, index$o as Skills, index$6 as Subagent, teammate as Teammate, index$m as Teams, index$q as Telemetry, index$n as Todo, index$5 as ToolResult, index$4 as Tools, index$3 as Update, index$2 as Utils, index$1 as VSCode, version$1 as Version, index as Worktree };
6954
+ export { index$u as A2a, index$t as Acp, index$p as Agent, index$l as Bootstrap, index$k as CodeReview, index$j as Commands, index$i as Compact, index$s as Config, index$w as Conversation, index$z as FileHistory, index$y as Goal, index$h as History, index$r as Hooks, index$g as Images, index$f as LLM, index$d as LSP, index$e as Logger, index$c as MCP, index$b as Memory, index$x as Permissions, index$a as PlanFile, printMode as PrintMode, index$9 as Prompt, recover$1 as Recover, index$8 as Remote, index$7 as Sandbox, index$v as Session, index$o as Skills, index$6 as Subagent, index$m as Teams, index$q as Telemetry, index$n as Todo, index$5 as ToolResult, index$4 as Tools, index$3 as Update, index$2 as Utils, index$1 as VSCode, version$1 as Version, index as Worktree };