@xrkseek/harness 0.5.10 → 0.5.11

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 (191) hide show
  1. package/node_modules/@xrkseek/core-agent-loop/dist/index.d.ts +4 -3
  2. package/node_modules/@xrkseek/core-agent-loop/dist/index.d.ts.map +1 -1
  3. package/node_modules/@xrkseek/core-agent-loop/dist/index.js +22 -60
  4. package/node_modules/@xrkseek/core-agent-loop/dist/index.js.map +1 -1
  5. package/node_modules/@xrkseek/core-agent-loop/dist/settle-batch.d.ts +11 -3
  6. package/node_modules/@xrkseek/core-agent-loop/dist/settle-batch.d.ts.map +1 -1
  7. package/node_modules/@xrkseek/core-agent-loop/dist/settle-batch.js +23 -8
  8. package/node_modules/@xrkseek/core-agent-loop/dist/settle-batch.js.map +1 -1
  9. package/node_modules/@xrkseek/core-session/dist/sqlite-store.d.ts.map +1 -1
  10. package/node_modules/@xrkseek/core-session/dist/sqlite-store.js +27 -1
  11. package/node_modules/@xrkseek/core-session/dist/sqlite-store.js.map +1 -1
  12. package/node_modules/@xrkseek/core-tools/dist/index.d.ts +1 -1
  13. package/node_modules/@xrkseek/core-tools/dist/index.d.ts.map +1 -1
  14. package/node_modules/@xrkseek/core-tools/dist/index.js +1 -1
  15. package/node_modules/@xrkseek/core-tools/dist/index.js.map +1 -1
  16. package/node_modules/@xrkseek/core-tools/dist/subagent-prompt.d.ts +9 -0
  17. package/node_modules/@xrkseek/core-tools/dist/subagent-prompt.d.ts.map +1 -1
  18. package/node_modules/@xrkseek/core-tools/dist/subagent-prompt.js +45 -18
  19. package/node_modules/@xrkseek/core-tools/dist/subagent-prompt.js.map +1 -1
  20. package/node_modules/@xrkseek/exec-fs/dist/index.d.ts +9 -1
  21. package/node_modules/@xrkseek/exec-fs/dist/index.d.ts.map +1 -1
  22. package/node_modules/@xrkseek/exec-fs/dist/index.js +18 -13
  23. package/node_modules/@xrkseek/exec-fs/dist/index.js.map +1 -1
  24. package/node_modules/@xrkseek/exec-fs/dist/paths.d.ts +11 -0
  25. package/node_modules/@xrkseek/exec-fs/dist/paths.d.ts.map +1 -1
  26. package/node_modules/@xrkseek/exec-fs/dist/paths.js +40 -0
  27. package/node_modules/@xrkseek/exec-fs/dist/paths.js.map +1 -1
  28. package/node_modules/@xrkseek/exec-memory/dist/index.d.ts +2 -2
  29. package/node_modules/@xrkseek/exec-memory/dist/index.d.ts.map +1 -1
  30. package/node_modules/@xrkseek/exec-memory/dist/index.js +2 -2
  31. package/node_modules/@xrkseek/exec-memory/dist/index.js.map +1 -1
  32. package/node_modules/@xrkseek/exec-memory/dist/store.d.ts +18 -0
  33. package/node_modules/@xrkseek/exec-memory/dist/store.d.ts.map +1 -1
  34. package/node_modules/@xrkseek/exec-memory/dist/store.js +108 -7
  35. package/node_modules/@xrkseek/exec-memory/dist/store.js.map +1 -1
  36. package/node_modules/@xrkseek/exec-memory/dist/tools.d.ts.map +1 -1
  37. package/node_modules/@xrkseek/exec-memory/dist/tools.js +17 -1
  38. package/node_modules/@xrkseek/exec-memory/dist/tools.js.map +1 -1
  39. package/node_modules/@xrkseek/exec-memory/dist/write-path.d.ts +2 -0
  40. package/node_modules/@xrkseek/exec-memory/dist/write-path.d.ts.map +1 -1
  41. package/node_modules/@xrkseek/exec-memory/dist/write-path.js +28 -3
  42. package/node_modules/@xrkseek/exec-memory/dist/write-path.js.map +1 -1
  43. package/node_modules/@xrkseek/exec-sandbox/dist/resolve.d.ts +7 -4
  44. package/node_modules/@xrkseek/exec-sandbox/dist/resolve.d.ts.map +1 -1
  45. package/node_modules/@xrkseek/exec-sandbox/dist/resolve.js +4 -0
  46. package/node_modules/@xrkseek/exec-sandbox/dist/resolve.js.map +1 -1
  47. package/node_modules/@xrkseek/exec-sandbox/dist/service.d.ts +7 -0
  48. package/node_modules/@xrkseek/exec-sandbox/dist/service.d.ts.map +1 -1
  49. package/node_modules/@xrkseek/exec-sandbox/dist/service.js +18 -8
  50. package/node_modules/@xrkseek/exec-sandbox/dist/service.js.map +1 -1
  51. package/node_modules/@xrkseek/preset-harness/dist/preset.d.ts +16 -0
  52. package/node_modules/@xrkseek/preset-harness/dist/preset.d.ts.map +1 -1
  53. package/node_modules/@xrkseek/preset-harness/dist/preset.js +13 -2
  54. package/node_modules/@xrkseek/preset-harness/dist/preset.js.map +1 -1
  55. package/node_modules/@xrkseek/preset-harness/dist/tsconfig.tsbuildinfo +1 -1
  56. package/node_modules/@xrkseek/preset-minimal/dist/tsconfig.tsbuildinfo +1 -1
  57. package/node_modules/@xrkseek/preset-server/dist/preset.d.ts.map +1 -1
  58. package/node_modules/@xrkseek/preset-server/dist/preset.js +4 -1
  59. package/node_modules/@xrkseek/preset-server/dist/preset.js.map +1 -1
  60. package/node_modules/@xrkseek/preset-server/dist/tsconfig.tsbuildinfo +1 -1
  61. package/node_modules/@xrkseek/server-face/dist/adapt/index.d.ts +1 -1
  62. package/node_modules/@xrkseek/server-face/dist/adapt/index.d.ts.map +1 -1
  63. package/node_modules/@xrkseek/server-face/dist/adapt/index.js +1 -1
  64. package/node_modules/@xrkseek/server-face/dist/adapt/index.js.map +1 -1
  65. package/node_modules/@xrkseek/server-face/dist/adapt/model-route.d.ts +5 -0
  66. package/node_modules/@xrkseek/server-face/dist/adapt/model-route.d.ts.map +1 -1
  67. package/node_modules/@xrkseek/server-face/dist/adapt/model-route.js +16 -0
  68. package/node_modules/@xrkseek/server-face/dist/adapt/model-route.js.map +1 -1
  69. package/node_modules/@xrkseek/server-face/dist/adapt/subagent-notice.d.ts +32 -0
  70. package/node_modules/@xrkseek/server-face/dist/adapt/subagent-notice.d.ts.map +1 -1
  71. package/node_modules/@xrkseek/server-face/dist/adapt/subagent-notice.js +87 -0
  72. package/node_modules/@xrkseek/server-face/dist/adapt/subagent-notice.js.map +1 -1
  73. package/node_modules/@xrkseek/server-face/dist/agent-roster-store.d.ts +102 -0
  74. package/node_modules/@xrkseek/server-face/dist/agent-roster-store.d.ts.map +1 -0
  75. package/node_modules/@xrkseek/server-face/dist/agent-roster-store.js +495 -0
  76. package/node_modules/@xrkseek/server-face/dist/agent-roster-store.js.map +1 -0
  77. package/node_modules/@xrkseek/server-face/dist/agent-roster-tools.d.ts +12 -0
  78. package/node_modules/@xrkseek/server-face/dist/agent-roster-tools.d.ts.map +1 -0
  79. package/node_modules/@xrkseek/server-face/dist/agent-roster-tools.js +141 -0
  80. package/node_modules/@xrkseek/server-face/dist/agent-roster-tools.js.map +1 -0
  81. package/node_modules/@xrkseek/server-face/dist/agent-team-roles.d.ts +6 -0
  82. package/node_modules/@xrkseek/server-face/dist/agent-team-roles.d.ts.map +1 -1
  83. package/node_modules/@xrkseek/server-face/dist/agent-team-roles.js +61 -0
  84. package/node_modules/@xrkseek/server-face/dist/agent-team-roles.js.map +1 -1
  85. package/node_modules/@xrkseek/server-face/dist/capture-member-playbook.d.ts +6 -0
  86. package/node_modules/@xrkseek/server-face/dist/capture-member-playbook.d.ts.map +1 -0
  87. package/node_modules/@xrkseek/server-face/dist/capture-member-playbook.js +43 -0
  88. package/node_modules/@xrkseek/server-face/dist/capture-member-playbook.js.map +1 -0
  89. package/node_modules/@xrkseek/server-face/dist/context.d.ts +4 -0
  90. package/node_modules/@xrkseek/server-face/dist/context.d.ts.map +1 -1
  91. package/node_modules/@xrkseek/server-face/dist/dispatch.d.ts.map +1 -1
  92. package/node_modules/@xrkseek/server-face/dist/dispatch.js +19 -0
  93. package/node_modules/@xrkseek/server-face/dist/dispatch.js.map +1 -1
  94. package/node_modules/@xrkseek/server-face/dist/fork-cut.d.ts +3 -2
  95. package/node_modules/@xrkseek/server-face/dist/fork-cut.d.ts.map +1 -1
  96. package/node_modules/@xrkseek/server-face/dist/fork-cut.js +58 -20
  97. package/node_modules/@xrkseek/server-face/dist/fork-cut.js.map +1 -1
  98. package/node_modules/@xrkseek/server-face/dist/handlers/session.d.ts.map +1 -1
  99. package/node_modules/@xrkseek/server-face/dist/handlers/session.js +60 -20
  100. package/node_modules/@xrkseek/server-face/dist/handlers/session.js.map +1 -1
  101. package/node_modules/@xrkseek/server-face/dist/handlers/subagent.d.ts.map +1 -1
  102. package/node_modules/@xrkseek/server-face/dist/handlers/subagent.js +5 -0
  103. package/node_modules/@xrkseek/server-face/dist/handlers/subagent.js.map +1 -1
  104. package/node_modules/@xrkseek/server-face/dist/handlers/team.d.ts +11 -0
  105. package/node_modules/@xrkseek/server-face/dist/handlers/team.d.ts.map +1 -0
  106. package/node_modules/@xrkseek/server-face/dist/handlers/team.js +268 -0
  107. package/node_modules/@xrkseek/server-face/dist/handlers/team.js.map +1 -0
  108. package/node_modules/@xrkseek/server-face/dist/index.d.ts +4 -0
  109. package/node_modules/@xrkseek/server-face/dist/index.d.ts.map +1 -1
  110. package/node_modules/@xrkseek/server-face/dist/index.js +4 -0
  111. package/node_modules/@xrkseek/server-face/dist/index.js.map +1 -1
  112. package/node_modules/@xrkseek/server-face/dist/model-catalog.d.ts +11 -1
  113. package/node_modules/@xrkseek/server-face/dist/model-catalog.d.ts.map +1 -1
  114. package/node_modules/@xrkseek/server-face/dist/model-catalog.js +27 -1
  115. package/node_modules/@xrkseek/server-face/dist/model-catalog.js.map +1 -1
  116. package/node_modules/@xrkseek/server-face/dist/presence-tools.d.ts.map +1 -1
  117. package/node_modules/@xrkseek/server-face/dist/presence-tools.js +15 -6
  118. package/node_modules/@xrkseek/server-face/dist/presence-tools.js.map +1 -1
  119. package/node_modules/@xrkseek/server-face/dist/presets-catalog.d.ts +16 -0
  120. package/node_modules/@xrkseek/server-face/dist/presets-catalog.d.ts.map +1 -1
  121. package/node_modules/@xrkseek/server-face/dist/presets-catalog.js +5 -0
  122. package/node_modules/@xrkseek/server-face/dist/presets-catalog.js.map +1 -1
  123. package/node_modules/@xrkseek/server-face/dist/projections/units/turn-outline.d.ts +8 -2
  124. package/node_modules/@xrkseek/server-face/dist/projections/units/turn-outline.d.ts.map +1 -1
  125. package/node_modules/@xrkseek/server-face/dist/projections/units/turn-outline.js +14 -12
  126. package/node_modules/@xrkseek/server-face/dist/projections/units/turn-outline.js.map +1 -1
  127. package/node_modules/@xrkseek/server-face/dist/runtime.d.ts.map +1 -1
  128. package/node_modules/@xrkseek/server-face/dist/runtime.js +19 -0
  129. package/node_modules/@xrkseek/server-face/dist/runtime.js.map +1 -1
  130. package/node_modules/@xrkseek/server-face/dist/session-model-store.d.ts +2 -0
  131. package/node_modules/@xrkseek/server-face/dist/session-model-store.d.ts.map +1 -1
  132. package/node_modules/@xrkseek/server-face/dist/session-model-store.js +14 -0
  133. package/node_modules/@xrkseek/server-face/dist/session-model-store.js.map +1 -1
  134. package/node_modules/@xrkseek/server-face/dist/session-status.d.ts +13 -0
  135. package/node_modules/@xrkseek/server-face/dist/session-status.d.ts.map +1 -1
  136. package/node_modules/@xrkseek/server-face/dist/session-status.js +19 -2
  137. package/node_modules/@xrkseek/server-face/dist/session-status.js.map +1 -1
  138. package/node_modules/@xrkseek/server-face/dist/session-thread-publish.d.ts +17 -0
  139. package/node_modules/@xrkseek/server-face/dist/session-thread-publish.d.ts.map +1 -0
  140. package/node_modules/@xrkseek/server-face/dist/session-thread-publish.js +34 -0
  141. package/node_modules/@xrkseek/server-face/dist/session-thread-publish.js.map +1 -0
  142. package/node_modules/@xrkseek/server-face/dist/session-thread-store.d.ts +38 -0
  143. package/node_modules/@xrkseek/server-face/dist/session-thread-store.d.ts.map +1 -0
  144. package/node_modules/@xrkseek/server-face/dist/session-thread-store.js +207 -0
  145. package/node_modules/@xrkseek/server-face/dist/session-thread-store.js.map +1 -0
  146. package/node_modules/@xrkseek/server-face/dist/session-thread-tools.d.ts +12 -0
  147. package/node_modules/@xrkseek/server-face/dist/session-thread-tools.d.ts.map +1 -0
  148. package/node_modules/@xrkseek/server-face/dist/session-thread-tools.js +223 -0
  149. package/node_modules/@xrkseek/server-face/dist/session-thread-tools.js.map +1 -0
  150. package/node_modules/@xrkseek/server-face/dist/settings-document.d.ts.map +1 -1
  151. package/node_modules/@xrkseek/server-face/dist/settings-document.js +10 -11
  152. package/node_modules/@xrkseek/server-face/dist/settings-document.js.map +1 -1
  153. package/node_modules/@xrkseek/server-face/dist/settings-schemas.d.ts.map +1 -1
  154. package/node_modules/@xrkseek/server-face/dist/settings-schemas.js +5 -10
  155. package/node_modules/@xrkseek/server-face/dist/settings-schemas.js.map +1 -1
  156. package/node_modules/@xrkseek/server-face/dist/subagent-registry.d.ts +19 -0
  157. package/node_modules/@xrkseek/server-face/dist/subagent-registry.d.ts.map +1 -1
  158. package/node_modules/@xrkseek/server-face/dist/subagent-registry.js +47 -13
  159. package/node_modules/@xrkseek/server-face/dist/subagent-registry.js.map +1 -1
  160. package/node_modules/@xrkseek/server-face/dist/subagent-tools.d.ts +21 -0
  161. package/node_modules/@xrkseek/server-face/dist/subagent-tools.d.ts.map +1 -1
  162. package/node_modules/@xrkseek/server-face/dist/subagent-tools.js +148 -37
  163. package/node_modules/@xrkseek/server-face/dist/subagent-tools.js.map +1 -1
  164. package/node_modules/@xrkseek/server-face/dist/types.d.ts +9 -0
  165. package/node_modules/@xrkseek/server-face/dist/types.d.ts.map +1 -1
  166. package/node_modules/@xrkseek/server-face/dist/wire/paths.d.ts.map +1 -1
  167. package/node_modules/@xrkseek/server-face/dist/wire/paths.js +2 -0
  168. package/node_modules/@xrkseek/server-face/dist/wire/paths.js.map +1 -1
  169. package/node_modules/@xrkseek/server-face/dist/workspace-face.d.ts.map +1 -1
  170. package/node_modules/@xrkseek/server-face/dist/workspace-face.js +7 -0
  171. package/node_modules/@xrkseek/server-face/dist/workspace-face.js.map +1 -1
  172. package/node_modules/@xrkseek/server-host/dist/agent-cache.d.ts +5 -1
  173. package/node_modules/@xrkseek/server-host/dist/agent-cache.d.ts.map +1 -1
  174. package/node_modules/@xrkseek/server-host/dist/agent-cache.js +29 -3
  175. package/node_modules/@xrkseek/server-host/dist/agent-cache.js.map +1 -1
  176. package/node_modules/@xrkseek/server-host/dist/index.d.ts +21 -0
  177. package/node_modules/@xrkseek/server-host/dist/index.d.ts.map +1 -1
  178. package/node_modules/@xrkseek/server-host/dist/index.js +105 -8
  179. package/node_modules/@xrkseek/server-host/dist/index.js.map +1 -1
  180. package/node_modules/@xrkseek/server-http/dist/static.d.ts.map +1 -1
  181. package/node_modules/@xrkseek/server-http/dist/static.js +45 -5
  182. package/node_modules/@xrkseek/server-http/dist/static.js.map +1 -1
  183. package/node_modules/@xrkseek/workspace/dist/ecosystem-instructions.d.ts +8 -0
  184. package/node_modules/@xrkseek/workspace/dist/ecosystem-instructions.d.ts.map +1 -1
  185. package/node_modules/@xrkseek/workspace/dist/ecosystem-instructions.js +6 -2
  186. package/node_modules/@xrkseek/workspace/dist/ecosystem-instructions.js.map +1 -1
  187. package/node_modules/@xrkseek/workspace/dist/index.d.ts +16 -0
  188. package/node_modules/@xrkseek/workspace/dist/index.d.ts.map +1 -1
  189. package/node_modules/@xrkseek/workspace/dist/index.js +17 -8
  190. package/node_modules/@xrkseek/workspace/dist/index.js.map +1 -1
  191. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"subagent-registry.js","sourceRoot":"","sources":["../src/subagent-registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAIxD;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CACjC,IAA0D,EAC1D,MAAoB;IAEpB,MAAM,GAAG,GAAG,IAAI,EAAE,cAAc,CAAC;IACjC,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,IAAI,CAAC;QAAE,OAAO,MAAM,CAAC;IACjD,OAAO,GAAG,IAAI,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AACvD,CAAC;AAqBD;;;GAGG;AACH,MAAM,OAAO,oBAAoB;IAOZ;IANF,QAAQ,GAAG,IAAI,GAAG,EAA8B,CAAC;IACj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ools";
3
+ import type { SessionEvent } from "@xrkseek/protocol";
3
4
  import type { FaceRuntime } from "./context.js";
4
5
  import { boundChildAnswer, SUBAGENT_ANSWER_INLINE_BYTES } from "./adapt/subagent-answer-bound.js";
5
6
  export { boundChildAnswer, SUBAGENT_ANSWER_INLINE_BYTES };
@@ -21,6 +22,19 @@ export interface SubagentQuotaCaps {
21
22
  export declare function resolveSubagentQuota(runtime: FaceRuntime, sessionId: string): SubagentQuotaCaps;
22
23
  export { parseExternalAgentKind, parseExternalAgentProduct, runExternalAgentTurn, resolveExternalAgentLaunch, openExternalAgentLiveSession, supportsExternalContinuable, ExternalAgentError, ExternalAgentSessionRegistry, externalAgentHandlesPath, isChildSessionActive, startExternalContinuable, promptExternalContinuable, interruptExternalContinuable, type ExternalAgentKind, type ContinuableExternalKind, type ExternalAgentLiveSession, type ExternalAgentHandleRecord, type ExternalAgentProductConfig, type ExternalSpawn, type RunExternalAgentOptions, } from "./external-agent-runtime.js";
23
24
  export declare function subagentDepth(runtime: FaceRuntime, sessionId: string): number;
25
+ /**
26
+ * How a parent gets work back out of a child that outlived the foreground
27
+ * wait. One place on purpose: background spawn, timeout salvage and failure
28
+ * replies must not drift apart, or a parent learns the recovery verbs only
29
+ * on the happy path.
30
+ */
31
+ export declare function childResumeHint(childId: string): string;
32
+ /**
33
+ * The slice of a child's log the parent owns: seeded parent text never counts.
34
+ * One read, two projections (`lastAssistantBodyText` for the salvaged answer,
35
+ * `lastModelRetryNotice` for what its model request was doing).
36
+ */
37
+ export declare function childOwnedEvents(runtime: Pick<FaceRuntime, "store" | "subagents">, childId: string): readonly SessionEvent[];
24
38
  export interface BindSubagentToolsOptions {
25
39
  readonly runtime: FaceRuntime;
26
40
  readonly parentSessionId: string;
@@ -34,6 +48,13 @@ export interface BindSubagentToolsOptions {
34
48
  readonly externalSpawn?: ExternalSpawn;
35
49
  /** Override env for external launch resolution (tests). */
36
50
  readonly externalEnv?: NodeJS.ProcessEnv;
51
+ /**
52
+ * Foreground wait budget in ms (default {@link FOREGROUND_WAIT_MS}, 10 min).
53
+ * A child that outruns it is not discarded — its answer is salvaged and the
54
+ * parent gets the resume verbs — but the budget itself has to be raisable
55
+ * for legitimately long research children.
56
+ */
57
+ readonly foregroundWaitMs?: number;
37
58
  }
38
59
  /** Register model-facing subagent tools on a live Agent tool registry. */
39
60
  export declare function bindSubagentTools(tools: ToolRegistry, options: BindSubagentToolsOptions): void;
@@ -1 +1 @@
1
- {"version":3,"file":"subagent-tools.d.ts","sourceRoot":"","sources":["../src/subagent-tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAkB,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AAKnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,OAAO,EACL,gBAAgB,EAChB,4BAA4B,EAC7B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,4BAA4B,EAAE,CAAC;AAE1D,OAAO,EACL,2BAA2B,EAC3B,iBAAiB,EAElB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAQL,KAAK,aAAa,EACnB,MAAM,6BAA6B,CAAC;AAuCrC,OAAO,EAAE,4BAA4B,EAAE,2BAA2B,EAAE,iBAAiB,EAAE,CAAC;AAExF,wEAAwE;AACxE,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,WAAW,EACpB,SAAS,EAAE,MAAM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AM,GAChB,MAAM,CAWR;AAuGD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAOvD;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,IAAI,CAAC,WAAW,EAAE,OAAO,GAAG,WAAW,CAAC,EACjD,OAAO,EAAE,MAAM,GACd,SAAS,YAAY,EAAE,CAGzB;AAoCD,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;IAC9B,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B;;;OAGG;IACH,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IACpC,oDAAoD;IACpD,QAAQ,CAAC,aAAa,CAAC,EAAE,aAAa,CAAC;IACvC,2DAA2D;IAC3D,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACzC;;;;;OAKG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;CACpC;AA2uDD,0EAA0E;AAC1E,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,YAAY,EACnB,OAAO,EAAE,wBAAwB,GAChC,IAAI,CAkBN"}
@@ -1,13 +1,15 @@
1
1
  import { SUBAGENT_ROUTING_PROMPT_TEXT } from "@xrkseek/core-tools";
2
2
  import { listPendingAdmits, readSessionEvents, } from "@xrkseek/core-session";
3
3
  import { dispatchFaceMethod } from "./dispatch.js";
4
- import { lastAssistantBodyText } from "./adapt/subagent-notice.js";
4
+ import { formatChildOutcome, lastAssistantBodyText, lastModelRetryNotice, } from "./adapt/subagent-notice.js";
5
5
  import { boundChildAnswer, SUBAGENT_ANSWER_INLINE_BYTES, } from "./adapt/subagent-answer-bound.js";
6
6
  export { boundChildAnswer, SUBAGENT_ANSWER_INLINE_BYTES };
7
7
  import { subagentOwnedEvents } from "./subagent-registry.js";
8
8
  import { DEFAULT_MAX_ACTIVE_CHILDREN, DEFAULT_MAX_DEPTH, resolveAgentPresetProfile, } from "./presets-catalog.js";
9
9
  import { effectiveSessionAgentPreset } from "./session-agent-preset.js";
10
10
  import { resolveSessionCwd } from "./session-cwd.js";
11
+ import { canvasWorkspaceIdForSession } from "./canvas-tools.js";
12
+ import { formatRosterCatalog } from "./agent-roster-store.js";
11
13
  import { ExternalAgentError, parseExternalAgentKind, parseExternalAgentProduct, runExternalAgentTurn, supportsExternalContinuable, startExternalContinuable, isChildSessionActive, } from "./external-agent-runtime.js";
12
14
  import { createSubagentWorktree, finalizeSubagentWorktree, formatWorktreeResult, worktreeContextNote, worktreeSkippedForRemote, } from "./subagent-worktree.js";
13
15
  import { resolveSessionModelSelection, resolveSubagentModelSetting, } from "./model-catalog.js";
@@ -116,16 +118,16 @@ async function waitDrainIdle(runtime, sessionId, signal, timeoutMs = FOREGROUND_
116
118
  await raceDeadline(abortable(run(sessionId), signal), timeoutMs, sessionId);
117
119
  return;
118
120
  }
119
- const deadline = Date.now() + timeoutMs;
120
- while (runtime.drain.isActive(sessionId)) {
121
- if (signal?.aborted) {
122
- throw new DOMException("aborted", "AbortError");
123
- }
124
- if (Date.now() > deadline) {
125
- throw new Error(`subagent timed out waiting for session ${sessionId}`);
121
+ // Same deadline semantics as the hub.run branch above — one throw site, one
122
+ // message, so a caller (or a log grep) cannot tell the two paths apart.
123
+ await raceDeadline((async () => {
124
+ while (runtime.drain.isActive(sessionId)) {
125
+ if (signal?.aborted) {
126
+ throw new DOMException("aborted", "AbortError");
127
+ }
128
+ await new Promise((r) => setTimeout(r, POLL_MS));
126
129
  }
127
- await new Promise((r) => setTimeout(r, POLL_MS));
128
- }
130
+ })(), timeoutMs, sessionId);
129
131
  }
130
132
  /**
131
133
  * Reject once `timeoutMs` elapses, naming the session so the failure reads
@@ -173,6 +175,27 @@ function abortError(reason) {
173
175
  err.name = "AbortError";
174
176
  return err;
175
177
  }
178
+ /**
179
+ * How a parent gets work back out of a child that outlived the foreground
180
+ * wait. One place on purpose: background spawn, timeout salvage and failure
181
+ * replies must not drift apart, or a parent learns the recovery verbs only
182
+ * on the happy path.
183
+ */
184
+ export function childResumeHint(childId) {
185
+ return (`Child session \`${childId}\` is not gone: \`wait_agent\` keeps waiting for it, ` +
186
+ `\`session_read\` replays its history, \`session_trace\` shows its lineage, ` +
187
+ `\`list_agents\` its state, and \`followup_task\` wakes a new turn on it. Read it ` +
188
+ `before spawning a replacement so the new task does not repeat work it already did.`);
189
+ }
190
+ /**
191
+ * The slice of a child's log the parent owns: seeded parent text never counts.
192
+ * One read, two projections (`lastAssistantBodyText` for the salvaged answer,
193
+ * `lastModelRetryNotice` for what its model request was doing).
194
+ */
195
+ export function childOwnedEvents(runtime, childId) {
196
+ const link = runtime.subagents.getByChild(childId);
197
+ return subagentOwnedEvents(link, readSessionEvents(runtime.store, childId));
198
+ }
176
199
  function formatSubagentAbortReason(reason) {
177
200
  if (reason === undefined || reason === null)
178
201
  return "aborted";
@@ -326,27 +349,40 @@ function createSubagentTool(options) {
326
349
  active: quota.active,
327
350
  };
328
351
  };
352
+ const foregroundWaitMs = options.foregroundWaitMs ?? FOREGROUND_WAIT_MS;
353
+ const description = "Delegate a self-contained task to a teammate subagent (separate session, same workspace as this session unless worktree:true). " +
354
+ "Use for focused independent work — research, a scoped implementation, analysis, or read-only review — " +
355
+ "so it does not consume this conversation's context. " +
356
+ "By default the child cannot see this chat — give a complete standalone prompt (paths, goals, constraints, persona). " +
357
+ "Do not tell the child to read AGENTS.md to discover who it is; Face prepends parent/child session ids, mode, role, and cwd. " +
358
+ "Set inherit_context true to seed the child with this session's completed turns only " +
359
+ "(the current in-flight turn is excluded). " +
360
+ "By default waits for the result (one-shot, no later human messages on that child). " +
361
+ "That foreground wait is bounded (10 min by default): on expiry the child is NOT discarded — " +
362
+ "whatever answer it already wrote is salvaged into this result and the child id stays readable " +
363
+ "(session_read / followup_task), so prefer run_in_background for genuinely long work instead of retrying blind. " +
364
+ "Set run_in_background true for a continuable child (chat companion / long task) and continue via followup_task / send_message. " +
365
+ "Prefer Agent Team member_id (catalog on this tool and team_list) over restating playbook or tools; " +
366
+ "optional role (worker|researcher|reviewer|lead) is only the fallback when no member fits; " +
367
+ "optional output_schema appends an OUTPUT CONTRACT and validates the final JSON; " +
368
+ "optional task_id / task_name register the work on the Agent Teams task board. " +
369
+ "Optional provider / model / reasoning_effort pin the child's LLM (model alone keeps the parent provider). " +
370
+ "Optional runtime: omit or in-process (default Face child); acp / app-server / claude-code spawn an external subprocess. " +
371
+ "acp / app-server support run_in_background + followup_task / send_message / wait_agent / interrupt_agent on the same list surface; claude-code remains one-shot print. " +
372
+ "The child's answer is returned inline in this tool result when short. " +
373
+ "Only when the UTF-8 body exceeds ~12KB does Face spill it under ~/.xrk/spill/tool-outputs/ " +
374
+ "and replace the body with a path + head/tail preview — then read_file that path. " +
375
+ "An empty or missing tool-outputs directory means nothing spilled; the full answer is already in this result (or the session event log), not on disk.";
329
376
  return {
330
377
  name: "subagent",
331
- description: "Delegate a self-contained task to a teammate subagent (separate session, same workspace as this session unless worktree:true). " +
332
- "Use for focused independent work — research, a scoped implementation, analysis, or read-only review — " +
333
- "so it does not consume this conversation's context. " +
334
- "By default the child cannot see this chat — give a complete standalone prompt (paths, goals, constraints, persona). " +
335
- "Do not tell the child to read AGENTS.md to discover who it is; Face prepends parent/child session ids, mode, role, and cwd. " +
336
- "Set inherit_context true to seed the child with this session's completed turns only " +
337
- "(the current in-flight turn is excluded). " +
338
- "By default waits for the result (one-shot, no later human messages on that child). " +
339
- "Set run_in_background true for a continuable child (chat companion / long task) and continue via followup_task / send_message. " +
340
- "Optional role (worker|researcher|reviewer|lead) prefixes a role reminder; " +
341
- "optional output_schema appends an OUTPUT CONTRACT and validates the final JSON; " +
342
- "optional task_id / task_name register the work on the Agent Teams task board. " +
343
- "Optional provider / model / reasoning_effort pin the child's LLM (model alone keeps the parent provider). " +
344
- "Optional runtime: omit or in-process (default Face child); acp / app-server / claude-code spawn an external subprocess. " +
345
- "acp / app-server support run_in_background + followup_task / send_message / wait_agent / interrupt_agent on the same list surface; claude-code remains one-shot print. " +
346
- "The child's answer is returned inline in this tool result when short. " +
347
- "Only when the UTF-8 body exceeds ~12KB does Face spill it under ~/.xrk/spill/tool-outputs/ " +
348
- "and replace the body with a path + head/tail preview — then read_file that path. " +
349
- "An empty or missing tool-outputs directory means nothing spilled; the full answer is already in this result (or the session event log), not on disk.",
378
+ description,
379
+ dynamicSchema: () => {
380
+ const ws = canvasWorkspaceIdForSession(options.runtime, options.parentSessionId);
381
+ const catalog = formatRosterCatalog(options.runtime.agentRoster.listVisible(ws));
382
+ return {
383
+ description: `${description}\n\nPrefer member_id from this Agent Team catalog:\n${catalog}`,
384
+ };
385
+ },
350
386
  parameters: {
351
387
  type: "object",
352
388
  properties: {
@@ -365,6 +401,10 @@ function createSubagentTool(options) {
365
401
  type: "boolean",
366
402
  description: "If true, seed the child with this session's completed-turn prefix (open turn excluded). Default false. Ignored for external runtimes.",
367
403
  },
404
+ member_id: {
405
+ type: "string",
406
+ description: "Agent Team member id. Face applies that member's tools, inject, and playbook — the same three surfaces the parent already edits. Prefer this over restating those in prompt.",
407
+ },
368
408
  run_in_background: {
369
409
  type: "boolean",
370
410
  description: "If true, return the child session id immediately (continuable). Default false (wait for the child's final answer). Supported for in-process and external acp / app-server (not claude-code).",
@@ -432,10 +472,11 @@ function createSubagentTool(options) {
432
472
  isError: true,
433
473
  };
434
474
  }
435
- const prompt = String(a.prompt ?? "").trim();
436
- if (!prompt) {
475
+ const promptBare = String(a.prompt ?? "").trim();
476
+ if (!promptBare) {
437
477
  return { content: "subagent: empty prompt", isError: true };
438
478
  }
479
+ let prompt = promptBare;
439
480
  const roleRaw = a.role ?? a.agent_type;
440
481
  let spawnRole;
441
482
  if (roleRaw !== undefined && String(roleRaw).trim()) {
@@ -447,6 +488,23 @@ function createSubagentTool(options) {
447
488
  };
448
489
  }
449
490
  }
491
+ const memberId = String(a.member_id ?? "").trim();
492
+ let rosterMember;
493
+ if (memberId) {
494
+ const workspaceId = canvasWorkspaceIdForSession(options.runtime, options.parentSessionId);
495
+ rosterMember = options.runtime.agentRoster.get(workspaceId, memberId);
496
+ if (!rosterMember) {
497
+ return {
498
+ content: `subagent: unknown member_id "${memberId}" (team_list first)`,
499
+ isError: true,
500
+ };
501
+ }
502
+ prompt = `${rosterMember.playbook.trim()}\n\nTASK:\n${promptBare}`;
503
+ if (spawnRole === undefined && rosterMember.role !== "default") {
504
+ spawnRole = rosterMember.role;
505
+ }
506
+ }
507
+ const memberSpawn = memberId ? { memberId } : {};
450
508
  const schemaCoerce = coerceOutputSchema(a.output_schema);
451
509
  if (schemaCoerce.error) {
452
510
  return {
@@ -509,6 +567,10 @@ function createSubagentTool(options) {
509
567
  parentSessionId: options.parentSessionId,
510
568
  label,
511
569
  mode: "continuable",
570
+ ...memberSpawn,
571
+ ...(spawnRole && spawnRole !== "default"
572
+ ? { role: spawnRole }
573
+ : {}),
512
574
  });
513
575
  if (!created.result.ok) {
514
576
  return {
@@ -752,6 +814,9 @@ function createSubagentTool(options) {
752
814
  sessionId: options.parentSessionId,
753
815
  linkMode,
754
816
  label,
817
+ ...(spawnRole && spawnRole !== "default"
818
+ ? { role: spawnRole }
819
+ : {}),
755
820
  });
756
821
  }
757
822
  catch {
@@ -768,6 +833,10 @@ function createSubagentTool(options) {
768
833
  parentSessionId: options.parentSessionId,
769
834
  label,
770
835
  mode: linkMode,
836
+ ...memberSpawn,
837
+ ...(spawnRole && spawnRole !== "default"
838
+ ? { role: spawnRole }
839
+ : {}),
771
840
  });
772
841
  if (!created.result.ok) {
773
842
  dropIsolated();
@@ -799,6 +868,10 @@ function createSubagentTool(options) {
799
868
  parentSessionId: options.parentSessionId,
800
869
  label,
801
870
  mode: linkMode,
871
+ ...memberSpawn,
872
+ ...(spawnRole && spawnRole !== "default"
873
+ ? { role: spawnRole }
874
+ : {}),
802
875
  });
803
876
  if (!created.result.ok) {
804
877
  dropIsolated();
@@ -838,6 +911,9 @@ function createSubagentTool(options) {
838
911
  inheritContext: inherit,
839
912
  cwd: isolated?.path ?? parentCwd,
840
913
  isolatedWorktree: isolated !== null,
914
+ ...(rosterMember
915
+ ? { memberId: rosterMember.id, inject: rosterMember.inject }
916
+ : {}),
841
917
  // The human's own asks: a child that only sees the parent's paraphrase
842
918
  // drifts from what was actually authorized (Codex
843
919
  // `control/user_authorization.rs`). A forked child already carries
@@ -897,7 +973,8 @@ function createSubagentTool(options) {
897
973
  outputSchema
898
974
  ? "OUTPUT CONTRACT attached; result will be schema-checked on idle."
899
975
  : undefined,
900
- "Use followup_task to wake a new task, send_message (delivery queue|steer) to continue, wait_agent for results, interrupt_agent (takeover true to pause for human) to stop, list_agents / analytics for quota.",
976
+ childResumeHint(childId),
977
+ "Use followup_task to wake a new task, send_message (delivery queue|steer) to continue, wait_agent for results, interrupt_agent (takeover true to pause for human) to stop, analytics for quota.",
901
978
  "Keep working; do not busy-poll.",
902
979
  worktreeLine(true) || undefined,
903
980
  ]
@@ -906,18 +983,45 @@ function createSubagentTool(options) {
906
983
  };
907
984
  }
908
985
  try {
909
- await waitDrainIdle(options.runtime, childId, signal);
986
+ await waitDrainIdle(options.runtime, childId, signal, foregroundWaitMs);
910
987
  }
911
988
  catch (err) {
912
989
  const message = err instanceof Error ? err.message : String(err);
913
- await dispatchFaceMethod(options.runtime, "session.cancel", `tool-sa-c-${childId}`, { sessionId: childId }).catch(() => undefined);
990
+ const timedOut = /timed out waiting/i.test(message);
991
+ // Salvage before cancelling: `session.cancel` drops the chain, so a
992
+ // child that had already written its answer would bill the parent for
993
+ // nothing. A child that produced nothing is stuck, so it still gets
994
+ // cancelled instead of left dangling.
995
+ const owned = childOwnedEvents(options.runtime, childId);
996
+ const salvaged = lastAssistantBodyText(owned);
997
+ const retrying = timedOut
998
+ ? lastModelRetryNotice(owned)
999
+ : undefined;
1000
+ if (!salvaged) {
1001
+ await dispatchFaceMethod(options.runtime, "session.cancel", `tool-sa-c-${childId}`,
1002
+ // `parent`, not the default `user`: a parent that gave up waiting
1003
+ // is not a human hitting Stop. The old default stamped
1004
+ // turn/end `reason: user`, so every timed-out child read as "stopped
1005
+ // by the user" in the child log and in the completion notice.
1006
+ { sessionId: childId, cause: { kind: "parent" } }).catch(() => undefined);
1007
+ }
914
1008
  options.runtime.agentTeamTasks.complete(task.id, {
915
1009
  ok: false,
916
1010
  preview: message,
917
1011
  });
918
1012
  const extra = worktreeLine(false);
919
1013
  return {
920
- content: [`subagent failed: ${message}`, extra].filter(Boolean).join("\n"),
1014
+ content: [
1015
+ salvaged
1016
+ ? `${message}, but the child finished work before the wait expired — its last answer is salvaged below.`
1017
+ : `subagent failed: ${message}`,
1018
+ salvaged || undefined,
1019
+ timedOut ? childResumeHint(childId) : undefined,
1020
+ retrying,
1021
+ extra,
1022
+ ]
1023
+ .filter(Boolean)
1024
+ .join("\n"),
921
1025
  isError: true,
922
1026
  };
923
1027
  }
@@ -1003,7 +1107,8 @@ function createSubagentTool(options) {
1003
1107
  function createListAgentsTool(options) {
1004
1108
  return {
1005
1109
  name: "list_agents",
1006
- description: "List direct child subagents of this session (id, label, mode, running, model, inbox queue/steer). " +
1110
+ description: "List direct child subagents of this session (id, label, mode, running, model, inbox queue/steer, " +
1111
+ "and how each child's last turn actually ended — finished vs aborted by parent/user vs error, with idle age). " +
1007
1112
  "Prefaces with depth/active quota. Prefer `analytics` for a fuller quota snapshot.",
1008
1113
  parameters: { type: "object", properties: {} },
1009
1114
  isConcurrencySafe: () => true,
@@ -1037,7 +1142,13 @@ function createListAgentsTool(options) {
1037
1142
  ? childInboxCounts(options.runtime, id)
1038
1143
  : { queued: 0, steering: 0 };
1039
1144
  const route = e.model ? `\t${e.model}` : "";
1040
- return `${id}\t${label}\t${mode}\t${activity}${route}\tq=${inbox.queued}\tsteer=${inbox.steering}`;
1145
+ // `idle` alone reads the same for a child that finished and one the
1146
+ // parent's wait budget cut off; the outcome line is what separates
1147
+ // "delivered" from "killed".
1148
+ const outcome = id === "?" || e.kind === "diagnostic"
1149
+ ? ""
1150
+ : `\t${formatChildOutcome(readSessionEvents(options.runtime.store, id))}`;
1151
+ return `${id}\t${label}\t${mode}\t${activity}${route}${outcome}\tq=${inbox.queued}\tsteer=${inbox.steering}`;
1041
1152
  });
1042
1153
  return { content: [header, ...lines].join("\n") };
1043
1154
  },