@astrosheep/keiyaku 4.6.8 → 4.6.9

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 (253) hide show
  1. package/README.md +40 -14
  2. package/build/plugins/claude/.claude-plugin/plugin.json +1 -1
  3. package/build/plugins/claude/skills/keiyaku/SKILL.md +5 -6
  4. package/build/plugins/claude/skills/keiyaku-akuma/SKILL.md +1 -1
  5. package/build/plugins/claude/skills/keiyaku-akuma/references/automation.md +8 -8
  6. package/build/plugins/claude/skills/keiyaku-babysit/SKILL.md +1 -1
  7. package/build/plugins/claude/skills/keiyaku-bind/SKILL.md +9 -9
  8. package/build/plugins/claude/skills/keiyaku-debt/SKILL.md +91 -0
  9. package/build/plugins/claude/skills/keiyaku-workflow/SKILL.md +2 -2
  10. package/build/plugins/codex/.codex-plugin/plugin.json +1 -1
  11. package/build/plugins/codex/skills/keiyaku/SKILL.md +5 -6
  12. package/build/plugins/codex/skills/keiyaku-akuma/SKILL.md +1 -1
  13. package/build/plugins/codex/skills/keiyaku-akuma/references/automation.md +8 -8
  14. package/build/plugins/codex/skills/keiyaku-babysit/SKILL.md +1 -1
  15. package/build/plugins/codex/skills/keiyaku-bind/SKILL.md +9 -9
  16. package/build/plugins/codex/skills/keiyaku-debt/SKILL.md +91 -0
  17. package/build/plugins/codex/skills/keiyaku-workflow/SKILL.md +2 -2
  18. package/build/plugins/opencode/index.js +1 -1
  19. package/build/plugins/opencode/skills/keiyaku/SKILL.md +5 -6
  20. package/build/plugins/opencode/skills/keiyaku-akuma/SKILL.md +1 -1
  21. package/build/plugins/opencode/skills/keiyaku-akuma/references/automation.md +8 -8
  22. package/build/plugins/opencode/skills/keiyaku-babysit/SKILL.md +1 -1
  23. package/build/plugins/opencode/skills/keiyaku-bind/SKILL.md +9 -9
  24. package/build/plugins/opencode/skills/keiyaku-debt/SKILL.md +91 -0
  25. package/build/plugins/opencode/skills/keiyaku-workflow/SKILL.md +2 -2
  26. package/build/skills/keiyaku/SKILL.md +5 -6
  27. package/build/skills/keiyaku-akuma/SKILL.md +1 -1
  28. package/build/skills/keiyaku-akuma/references/automation.md +8 -8
  29. package/build/skills/keiyaku-babysit/SKILL.md +1 -1
  30. package/build/skills/keiyaku-bind/SKILL.md +9 -9
  31. package/build/skills/keiyaku-debt/SKILL.md +91 -0
  32. package/build/skills/keiyaku-workflow/SKILL.md +2 -2
  33. package/build/src/akuma/akuma-instance.d.ts +2 -0
  34. package/build/src/akuma/akuma-instance.js +10 -0
  35. package/build/src/akuma/akuma-observe.d.ts +33 -8
  36. package/build/src/akuma/akuma-observe.js +88 -64
  37. package/build/src/akuma/akuma-owner.d.ts +11 -2
  38. package/build/src/akuma/akuma-owner.js +45 -35
  39. package/build/src/akuma/akuma-selection-execution.js +9 -1
  40. package/build/src/akuma/akuma-stream.d.ts +22 -0
  41. package/build/src/akuma/akuma-stream.js +116 -0
  42. package/build/src/akuma/akuma-wait.d.ts +1 -40
  43. package/build/src/akuma/akuma-wait.js +23 -84
  44. package/build/src/akuma/akuma.d.ts +17 -11
  45. package/build/src/akuma/akuma.js +2 -0
  46. package/build/src/akuma/allowed.d.ts +7 -12
  47. package/build/src/akuma/allowed.js +13 -4
  48. package/build/src/akuma/body-supervisor.d.ts +5 -5
  49. package/build/src/akuma/body-supervisor.js +22 -20
  50. package/build/src/akuma/body.js +28 -1
  51. package/build/src/akuma/call-request.d.ts +12 -22
  52. package/build/src/akuma/heart/activity-schema.d.ts +12 -0
  53. package/build/src/akuma/heart/activity-schema.js +6 -0
  54. package/build/src/akuma/heart/index.d.ts +59 -2
  55. package/build/src/akuma/heart/index.js +87 -8
  56. package/build/src/akuma/heart/rows.js +5 -3
  57. package/build/src/akuma/heart/soul.d.ts +9 -0
  58. package/build/src/akuma/heart/soul.js +29 -0
  59. package/build/src/akuma/heart/storage.d.ts +15 -0
  60. package/build/src/akuma/heart/storage.js +55 -0
  61. package/build/src/akuma/heart/timeline.d.ts +7 -0
  62. package/build/src/akuma/heart/timeline.js +10 -0
  63. package/build/src/akuma/index.d.ts +1 -0
  64. package/build/src/akuma/projection.d.ts +25 -0
  65. package/build/src/akuma/projection.js +24 -7
  66. package/build/src/akuma/provider-recipe.d.ts +11 -0
  67. package/build/src/akuma/provider-recipe.js +23 -0
  68. package/build/src/akuma/provider.d.ts +25 -0
  69. package/build/src/akuma/provider.js +99 -7
  70. package/build/src/akuma/providers/acp/events.js +25 -2
  71. package/build/src/akuma/providers/claude/events.js +76 -10
  72. package/build/src/akuma/providers/claude/index.js +2 -5
  73. package/build/src/akuma/providers/codex-app-server/events.js +17 -2
  74. package/build/src/akuma/providers/codex-app-server/index.js +15 -9
  75. package/build/src/akuma/providers/decode.d.ts +8 -0
  76. package/build/src/akuma/providers/decode.js +21 -0
  77. package/build/src/akuma/providers/grok-build/index.js +10 -26
  78. package/build/src/akuma/providers/opencode-sdk/event-stream.d.ts +3 -3
  79. package/build/src/akuma/providers/opencode-sdk/event-stream.js +2 -25
  80. package/build/src/akuma/providers/opencode-sdk/events.d.ts +7 -43
  81. package/build/src/akuma/providers/opencode-sdk/events.js +147 -284
  82. package/build/src/akuma/providers/opencode-sdk/index.js +267 -421
  83. package/build/src/akuma/providers/opencode-sdk/native-http.d.ts +9 -0
  84. package/build/src/akuma/providers/opencode-sdk/native-http.js +69 -0
  85. package/build/src/akuma/providers/opencode-sdk/session.d.ts +42 -36
  86. package/build/src/akuma/providers/opencode-sdk/session.js +75 -82
  87. package/build/src/akuma/providers/paseo/events.d.ts +8 -0
  88. package/build/src/akuma/providers/paseo/events.js +58 -11
  89. package/build/src/akuma/providers/paseo/index.js +11 -7
  90. package/build/src/akuma/providers/pi/events.d.ts +2 -0
  91. package/build/src/akuma/providers/pi/events.js +32 -24
  92. package/build/src/akuma/providers/pi/index.js +21 -35
  93. package/build/src/akuma/request-lifecycle.d.ts +1 -2
  94. package/build/src/akuma/request-lifecycle.js +2 -8
  95. package/build/src/akuma/request-rendezvous.js +38 -55
  96. package/build/src/akuma/request-serve.d.ts +1 -1
  97. package/build/src/akuma/request-serve.js +77 -113
  98. package/build/src/akuma/selection-observation.d.ts +57 -51
  99. package/build/src/akuma/selection-observation.js +3 -3
  100. package/build/src/akuma/turn-drive.d.ts +3 -0
  101. package/build/src/akuma/turn-drive.js +26 -5
  102. package/build/src/akuma-body.js +12 -22
  103. package/build/src/cli/akuma-caller.js +10 -0
  104. package/build/src/cli/commands/akuma-grammar.js +3 -4
  105. package/build/src/cli/commands/akuma.js +13 -51
  106. package/build/src/cli/commands/contract-grammar.d.ts +7 -6
  107. package/build/src/cli/commands/contract-grammar.js +27 -32
  108. package/build/src/cli/commands/contract-help.d.ts +16 -7
  109. package/build/src/cli/commands/contract-help.js +20 -11
  110. package/build/src/cli/commands/contract.js +11 -11
  111. package/build/src/cli/commands/debt-grammar.d.ts +19 -0
  112. package/build/src/cli/commands/debt-grammar.js +323 -0
  113. package/build/src/cli/commands/debt-query.d.ts +5 -0
  114. package/build/src/cli/commands/{task-query.js → debt-query.js} +9 -9
  115. package/build/src/cli/commands/{task.d.ts → debt.d.ts} +2 -2
  116. package/build/src/cli/commands/{task.js → debt.js} +83 -143
  117. package/build/src/cli/coordinates.d.ts +1 -1
  118. package/build/src/cli/coordinates.js +1 -1
  119. package/build/src/cli/parse.d.ts +4 -4
  120. package/build/src/cli/parse.js +17 -16
  121. package/build/src/cli/render/akuma-activity.d.ts +11 -83
  122. package/build/src/cli/render/akuma-activity.js +20 -382
  123. package/build/src/cli/render/catalog.d.ts +2 -2
  124. package/build/src/cli/render/catalog.js +5 -5
  125. package/build/src/cli/render/contract.js +2 -2
  126. package/build/src/cli/render/debt.d.ts +28 -0
  127. package/build/src/cli/render/{task.js → debt.js} +51 -112
  128. package/build/src/cli/render/kanshi.js +28 -28
  129. package/build/src/cli/render/marks.d.ts +5 -5
  130. package/build/src/cli/render/marks.js +4 -10
  131. package/build/src/cli/render/nuke.js +1 -1
  132. package/build/src/cli/runtime.js +3 -3
  133. package/build/src/cli/scan.d.ts +1 -1
  134. package/build/src/cli/usage.d.ts +1 -1
  135. package/build/src/cli/usage.js +4 -4
  136. package/build/src/contract-worktree.js +3 -3
  137. package/build/src/debt/board.d.ts +160 -0
  138. package/build/src/{task → debt}/board.js +89 -89
  139. package/build/src/debt/catalog.d.ts +11 -0
  140. package/build/src/debt/catalog.js +59 -0
  141. package/build/src/{task → debt}/context.d.ts +1 -1
  142. package/build/src/{task → debt}/context.js +1 -1
  143. package/build/src/{task → debt}/created-observation.d.ts +6 -10
  144. package/build/src/{task → debt}/created-observation.js +7 -7
  145. package/build/src/debt/document.d.ts +37 -0
  146. package/build/src/{task → debt}/document.js +37 -37
  147. package/build/src/debt/identity.d.ts +21 -0
  148. package/build/src/{task → debt}/identity.js +35 -35
  149. package/build/src/debt/index.d.ts +111 -0
  150. package/build/src/debt/index.js +203 -0
  151. package/build/src/{task → debt}/input.d.ts +8 -8
  152. package/build/src/{task → debt}/input.js +21 -21
  153. package/build/src/debt/lifecycle-operations.d.ts +6 -0
  154. package/build/src/{task → debt}/lifecycle-operations.js +27 -31
  155. package/build/src/debt/mutation-result.d.ts +981 -0
  156. package/build/src/debt/mutation-result.js +109 -0
  157. package/build/src/debt/mutation.d.ts +424 -0
  158. package/build/src/debt/mutation.js +223 -0
  159. package/build/src/debt/operation-types.d.ts +71 -0
  160. package/build/src/debt/operations.d.ts +28 -0
  161. package/build/src/{task → debt}/operations.js +59 -60
  162. package/build/src/debt/query.d.ts +76 -0
  163. package/build/src/{task → debt}/query.js +55 -55
  164. package/build/src/{task → debt}/store.d.ts +13 -13
  165. package/build/src/{task → debt}/store.js +58 -49
  166. package/build/src/debt/view.d.ts +4 -0
  167. package/build/src/debt/view.js +7 -0
  168. package/build/src/identity/coordinates.d.ts +1 -1
  169. package/build/src/index.d.ts +13 -13
  170. package/build/src/index.js +9 -9
  171. package/build/src/kanshi/index.d.ts +1 -1
  172. package/build/src/kanshi/read.js +33 -33
  173. package/build/src/kanshi/report.d.ts +7 -7
  174. package/build/src/kanshi/select.js +4 -4
  175. package/build/src/library/akumas.d.ts +2 -3
  176. package/build/src/library/bind.d.ts +3 -3
  177. package/build/src/library/bind.js +5 -5
  178. package/build/src/library/contract-creation.js +5 -5
  179. package/build/src/library/contract-execution.js +4 -4
  180. package/build/src/library/contract-types.d.ts +2 -2
  181. package/build/src/library/input.d.ts +2 -2
  182. package/build/src/library/input.js +5 -5
  183. package/build/src/library/invocation.js +2 -2
  184. package/build/src/library/nuke.js +3 -3
  185. package/build/src/library/outcome.d.ts +126 -126
  186. package/build/src/library/outcome.js +3 -3
  187. package/build/src/library/selection.d.ts +1 -4
  188. package/build/src/library/selection.js +11 -62
  189. package/build/src/plugin/public.d.ts +5 -0
  190. package/build/src/plugin/runtime.js +3 -1
  191. package/build/src/runtime/proc/windows-launch.exe +0 -0
  192. package/build/src/settlement/fence.d.ts +3 -3
  193. package/build/src/settlement/fence.js +4 -4
  194. package/build/src/settlement/holder.d.ts +16 -16
  195. package/build/src/settlement/holder.js +69 -63
  196. package/build/src/settlement/settle.d.ts +5 -5
  197. package/build/src/settlement/settle.js +53 -53
  198. package/package.json +12 -6
  199. package/plugins/paseo/plugin/index.server.ts +17 -0
  200. package/plugins/paseo/plugin/paseo-plugin.json +4 -0
  201. package/plugins/paseo/plugin/server/attach.ts +52 -0
  202. package/plugins/paseo/plugin/server/keiyaku.ts +44 -0
  203. package/plugins/paseo/plugin/server/message.ts +60 -0
  204. package/plugins/paseo/plugin/server/mirror.ts +193 -0
  205. package/plugins/paseo/plugin/server/model.ts +14 -0
  206. package/plugins/paseo/plugin/server/provider.ts +276 -0
  207. package/plugins/paseo/plugin/server/sdk-worker.ts +237 -0
  208. package/plugins/paseo/plugin/server/sdk.ts +289 -0
  209. package/plugins/paseo/plugin/server/stop.ts +26 -0
  210. package/plugins/paseo/plugin/server/transport.ts +35 -0
  211. package/plugins/paseo/plugin/shared/attach-rpc.ts +10 -0
  212. package/plugins/paseo/plugin/shared/refresh-rpc.ts +6 -0
  213. package/plugins/paseo/plugin/tsconfig.json +6 -0
  214. package/skills/keiyaku/SKILL.md +5 -6
  215. package/skills/keiyaku-akuma/SKILL.md +1 -1
  216. package/skills/keiyaku-akuma/references/automation.md +8 -8
  217. package/skills/keiyaku-babysit/SKILL.md +1 -1
  218. package/skills/keiyaku-bind/SKILL.md +9 -9
  219. package/skills/keiyaku-debt/SKILL.md +91 -0
  220. package/skills/keiyaku-workflow/SKILL.md +2 -2
  221. package/build/plugins/claude/skills/keiyaku-task/SKILL.md +0 -104
  222. package/build/plugins/codex/skills/keiyaku-task/SKILL.md +0 -104
  223. package/build/plugins/opencode/skills/keiyaku-task/SKILL.md +0 -104
  224. package/build/skills/keiyaku-task/SKILL.md +0 -104
  225. package/build/src/cli/commands/task-grammar.d.ts +0 -19
  226. package/build/src/cli/commands/task-grammar.js +0 -384
  227. package/build/src/cli/commands/task-query.d.ts +0 -5
  228. package/build/src/cli/render/task.d.ts +0 -39
  229. package/build/src/task/board.d.ts +0 -168
  230. package/build/src/task/catalog.d.ts +0 -11
  231. package/build/src/task/catalog.js +0 -59
  232. package/build/src/task/compose-language.d.ts +0 -57
  233. package/build/src/task/compose-language.js +0 -364
  234. package/build/src/task/compose-parser.d.ts +0 -32
  235. package/build/src/task/compose-parser.js +0 -180
  236. package/build/src/task/compose.d.ts +0 -16
  237. package/build/src/task/compose.js +0 -189
  238. package/build/src/task/document.d.ts +0 -39
  239. package/build/src/task/identity.d.ts +0 -21
  240. package/build/src/task/index.d.ts +0 -138
  241. package/build/src/task/index.js +0 -269
  242. package/build/src/task/lifecycle-operations.d.ts +0 -6
  243. package/build/src/task/mutation-result.d.ts +0 -1726
  244. package/build/src/task/mutation-result.js +0 -198
  245. package/build/src/task/mutation.d.ts +0 -590
  246. package/build/src/task/mutation.js +0 -262
  247. package/build/src/task/operation-types.d.ts +0 -71
  248. package/build/src/task/operations.d.ts +0 -28
  249. package/build/src/task/query.d.ts +0 -76
  250. package/build/src/task/view.d.ts +0 -4
  251. package/build/src/task/view.js +0 -7
  252. package/skills/keiyaku-task/SKILL.md +0 -104
  253. /package/build/src/{task → debt}/operation-types.js +0 -0
@@ -36,24 +36,21 @@ declare const akumaObservationSchema: z.ZodObject<{
36
36
  stranded: "stranded";
37
37
  }>;
38
38
  cwd: z.ZodOptional<z.ZodString>;
39
+ provider: z.ZodOptional<z.ZodString>;
40
+ model: z.ZodOptional<z.ZodString>;
39
41
  allowed: z.ZodPipe<z.ZodArray<z.ZodEnum<{
40
- "task.add": "task.add";
41
- "task.addDocument": "task.addDocument";
42
- "task.compose": "task.compose";
43
- "task.done": "task.done";
44
- "task.drop": "task.drop";
45
- "task.hold": "task.hold";
46
- "task.resume": "task.resume";
47
- "task.start": "task.start";
48
- "task.stop": "task.stop";
49
- "task.update": "task.update";
42
+ "debt.add": "debt.add";
43
+ "debt.addDocument": "debt.addDocument";
44
+ "debt.done": "debt.done";
45
+ "debt.drop": "debt.drop";
46
+ "debt.update": "debt.update";
50
47
  "akuma.call": "akuma.call";
51
48
  "akuma.kill": "akuma.kill";
52
49
  "akuma.tell": "akuma.tell";
53
50
  "contract.audit": "contract.audit";
54
51
  "contract.deliver": "contract.deliver";
55
52
  "contract.review": "contract.review";
56
- }>>, z.ZodTransform<import("./allowed.js").AllowedActions, ("task.add" | "task.addDocument" | "task.compose" | "task.done" | "task.drop" | "task.hold" | "task.resume" | "task.start" | "task.stop" | "task.update" | "akuma.call" | "akuma.kill" | "akuma.tell" | "contract.audit" | "contract.deliver" | "contract.review")[]>>;
53
+ }>>, z.ZodTransform<import("./allowed.js").AllowedActions, ("debt.add" | "debt.addDocument" | "debt.done" | "debt.drop" | "debt.update" | "akuma.call" | "akuma.kill" | "akuma.tell" | "contract.audit" | "contract.deliver" | "contract.review")[]>>;
57
54
  timeline: z.ZodUnion<readonly [z.ZodObject<{
58
55
  reportedChanges: z.ZodReadonly<z.ZodArray<z.ZodObject<{
59
56
  sequence: z.ZodNumber;
@@ -197,6 +194,7 @@ declare const akumaObservationSchema: z.ZodObject<{
197
194
  unspecified: "unspecified";
198
195
  }>;
199
196
  path: z.ZodString;
197
+ patch: z.ZodOptional<z.ZodString>;
200
198
  diffstat: z.ZodOptional<z.ZodObject<{
201
199
  added: z.ZodNumber;
202
200
  removed: z.ZodNumber;
@@ -211,6 +209,7 @@ declare const akumaObservationSchema: z.ZodObject<{
211
209
  }, z.core.$strict>>;
212
210
  }, z.core.$strict>]>;
213
211
  state: z.ZodLiteral<"active">;
212
+ toolId: z.ZodOptional<z.ZodString>;
214
213
  truncated: z.ZodOptional<z.ZodLiteral<true>>;
215
214
  }, z.core.$strict>, z.ZodObject<{
216
215
  kind: z.ZodLiteral<"tool">;
@@ -247,6 +246,7 @@ declare const akumaObservationSchema: z.ZodObject<{
247
246
  unspecified: "unspecified";
248
247
  }>;
249
248
  path: z.ZodString;
249
+ patch: z.ZodOptional<z.ZodString>;
250
250
  diffstat: z.ZodOptional<z.ZodObject<{
251
251
  added: z.ZodNumber;
252
252
  removed: z.ZodNumber;
@@ -266,8 +266,10 @@ declare const akumaObservationSchema: z.ZodObject<{
266
266
  ok: "ok";
267
267
  }>;
268
268
  message: z.ZodOptional<z.ZodString>;
269
+ output: z.ZodOptional<z.ZodString>;
269
270
  exitCode: z.ZodOptional<z.ZodNumber>;
270
271
  }, z.core.$strict>;
272
+ toolId: z.ZodOptional<z.ZodString>;
271
273
  truncated: z.ZodOptional<z.ZodLiteral<true>>;
272
274
  }, z.core.$strict>]>;
273
275
  }, z.core.$strict>]>>>;
@@ -300,6 +302,7 @@ declare const akumaObservationSchema: z.ZodObject<{
300
302
  kind: z.ZodLiteral<"answered">;
301
303
  historyId: z.ZodString;
302
304
  answer: z.ZodString;
305
+ foldedSaidSequence: z.ZodOptional<z.ZodNumber>;
303
306
  }, z.core.$strict>, z.ZodObject<{
304
307
  kind: z.ZodLiteral<"failed">;
305
308
  historyId: z.ZodString;
@@ -405,6 +408,7 @@ declare const akumaObservationSchema: z.ZodObject<{
405
408
  unspecified: "unspecified";
406
409
  }>;
407
410
  path: z.ZodString;
411
+ patch: z.ZodOptional<z.ZodString>;
408
412
  diffstat: z.ZodOptional<z.ZodObject<{
409
413
  added: z.ZodNumber;
410
414
  removed: z.ZodNumber;
@@ -424,8 +428,10 @@ declare const akumaObservationSchema: z.ZodObject<{
424
428
  ok: "ok";
425
429
  }>;
426
430
  message: z.ZodOptional<z.ZodString>;
431
+ output: z.ZodOptional<z.ZodString>;
427
432
  exitCode: z.ZodOptional<z.ZodNumber>;
428
433
  }, z.core.$strict>;
434
+ toolId: z.ZodOptional<z.ZodString>;
429
435
  truncated: z.ZodOptional<z.ZodLiteral<true>>;
430
436
  }, z.core.$strict>]>;
431
437
  }, z.core.$strict>]>>>;
@@ -442,22 +448,18 @@ declare const akumaObservationSchema: z.ZodObject<{
442
448
  kind: z.ZodLiteral<"failed">;
443
449
  diagnostic: z.ZodString;
444
450
  }, z.core.$strict>]>;
445
- createdTasks: z.ZodUnion<readonly [z.ZodObject<{
451
+ createdDebts: z.ZodUnion<readonly [z.ZodObject<{
446
452
  kind: z.ZodLiteral<"present">;
447
453
  rows: z.ZodReadonly<z.ZodArray<z.ZodObject<{
448
- id: z.ZodPipe<z.ZodString, z.ZodTransform<`task/${string}`, string>>;
454
+ id: z.ZodPipe<z.ZodString, z.ZodTransform<`debt/${string}`, string>>;
449
455
  title: z.ZodString;
450
456
  state: z.ZodEnum<{
451
457
  open: "open";
452
- in_progress: "in_progress";
453
- on_hold: "on_hold";
454
458
  done: "done";
455
459
  drop: "drop";
456
460
  }>;
457
461
  priority: z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>;
458
462
  disposition: z.ZodEnum<{
459
- in_progress: "in_progress";
460
- on_hold: "on_hold";
461
463
  done: "done";
462
464
  drop: "drop";
463
465
  ready: "ready";
@@ -524,24 +526,21 @@ declare const akumaWaitResultSchema: z.ZodObject<{
524
526
  stranded: "stranded";
525
527
  }>;
526
528
  cwd: z.ZodOptional<z.ZodString>;
529
+ provider: z.ZodOptional<z.ZodString>;
530
+ model: z.ZodOptional<z.ZodString>;
527
531
  allowed: z.ZodPipe<z.ZodArray<z.ZodEnum<{
528
- "task.add": "task.add";
529
- "task.addDocument": "task.addDocument";
530
- "task.compose": "task.compose";
531
- "task.done": "task.done";
532
- "task.drop": "task.drop";
533
- "task.hold": "task.hold";
534
- "task.resume": "task.resume";
535
- "task.start": "task.start";
536
- "task.stop": "task.stop";
537
- "task.update": "task.update";
532
+ "debt.add": "debt.add";
533
+ "debt.addDocument": "debt.addDocument";
534
+ "debt.done": "debt.done";
535
+ "debt.drop": "debt.drop";
536
+ "debt.update": "debt.update";
538
537
  "akuma.call": "akuma.call";
539
538
  "akuma.kill": "akuma.kill";
540
539
  "akuma.tell": "akuma.tell";
541
540
  "contract.audit": "contract.audit";
542
541
  "contract.deliver": "contract.deliver";
543
542
  "contract.review": "contract.review";
544
- }>>, z.ZodTransform<import("./allowed.js").AllowedActions, ("task.add" | "task.addDocument" | "task.compose" | "task.done" | "task.drop" | "task.hold" | "task.resume" | "task.start" | "task.stop" | "task.update" | "akuma.call" | "akuma.kill" | "akuma.tell" | "contract.audit" | "contract.deliver" | "contract.review")[]>>;
543
+ }>>, z.ZodTransform<import("./allowed.js").AllowedActions, ("debt.add" | "debt.addDocument" | "debt.done" | "debt.drop" | "debt.update" | "akuma.call" | "akuma.kill" | "akuma.tell" | "contract.audit" | "contract.deliver" | "contract.review")[]>>;
545
544
  timeline: z.ZodUnion<readonly [z.ZodObject<{
546
545
  reportedChanges: z.ZodReadonly<z.ZodArray<z.ZodObject<{
547
546
  sequence: z.ZodNumber;
@@ -685,6 +684,7 @@ declare const akumaWaitResultSchema: z.ZodObject<{
685
684
  unspecified: "unspecified";
686
685
  }>;
687
686
  path: z.ZodString;
687
+ patch: z.ZodOptional<z.ZodString>;
688
688
  diffstat: z.ZodOptional<z.ZodObject<{
689
689
  added: z.ZodNumber;
690
690
  removed: z.ZodNumber;
@@ -699,6 +699,7 @@ declare const akumaWaitResultSchema: z.ZodObject<{
699
699
  }, z.core.$strict>>;
700
700
  }, z.core.$strict>]>;
701
701
  state: z.ZodLiteral<"active">;
702
+ toolId: z.ZodOptional<z.ZodString>;
702
703
  truncated: z.ZodOptional<z.ZodLiteral<true>>;
703
704
  }, z.core.$strict>, z.ZodObject<{
704
705
  kind: z.ZodLiteral<"tool">;
@@ -735,6 +736,7 @@ declare const akumaWaitResultSchema: z.ZodObject<{
735
736
  unspecified: "unspecified";
736
737
  }>;
737
738
  path: z.ZodString;
739
+ patch: z.ZodOptional<z.ZodString>;
738
740
  diffstat: z.ZodOptional<z.ZodObject<{
739
741
  added: z.ZodNumber;
740
742
  removed: z.ZodNumber;
@@ -754,8 +756,10 @@ declare const akumaWaitResultSchema: z.ZodObject<{
754
756
  ok: "ok";
755
757
  }>;
756
758
  message: z.ZodOptional<z.ZodString>;
759
+ output: z.ZodOptional<z.ZodString>;
757
760
  exitCode: z.ZodOptional<z.ZodNumber>;
758
761
  }, z.core.$strict>;
762
+ toolId: z.ZodOptional<z.ZodString>;
759
763
  truncated: z.ZodOptional<z.ZodLiteral<true>>;
760
764
  }, z.core.$strict>]>;
761
765
  }, z.core.$strict>]>>>;
@@ -788,6 +792,7 @@ declare const akumaWaitResultSchema: z.ZodObject<{
788
792
  kind: z.ZodLiteral<"answered">;
789
793
  historyId: z.ZodString;
790
794
  answer: z.ZodString;
795
+ foldedSaidSequence: z.ZodOptional<z.ZodNumber>;
791
796
  }, z.core.$strict>, z.ZodObject<{
792
797
  kind: z.ZodLiteral<"failed">;
793
798
  historyId: z.ZodString;
@@ -893,6 +898,7 @@ declare const akumaWaitResultSchema: z.ZodObject<{
893
898
  unspecified: "unspecified";
894
899
  }>;
895
900
  path: z.ZodString;
901
+ patch: z.ZodOptional<z.ZodString>;
896
902
  diffstat: z.ZodOptional<z.ZodObject<{
897
903
  added: z.ZodNumber;
898
904
  removed: z.ZodNumber;
@@ -912,8 +918,10 @@ declare const akumaWaitResultSchema: z.ZodObject<{
912
918
  ok: "ok";
913
919
  }>;
914
920
  message: z.ZodOptional<z.ZodString>;
921
+ output: z.ZodOptional<z.ZodString>;
915
922
  exitCode: z.ZodOptional<z.ZodNumber>;
916
923
  }, z.core.$strict>;
924
+ toolId: z.ZodOptional<z.ZodString>;
917
925
  truncated: z.ZodOptional<z.ZodLiteral<true>>;
918
926
  }, z.core.$strict>]>;
919
927
  }, z.core.$strict>]>>>;
@@ -930,22 +938,18 @@ declare const akumaWaitResultSchema: z.ZodObject<{
930
938
  kind: z.ZodLiteral<"failed">;
931
939
  diagnostic: z.ZodString;
932
940
  }, z.core.$strict>]>;
933
- createdTasks: z.ZodUnion<readonly [z.ZodObject<{
941
+ createdDebts: z.ZodUnion<readonly [z.ZodObject<{
934
942
  kind: z.ZodLiteral<"present">;
935
943
  rows: z.ZodReadonly<z.ZodArray<z.ZodObject<{
936
- id: z.ZodPipe<z.ZodString, z.ZodTransform<`task/${string}`, string>>;
944
+ id: z.ZodPipe<z.ZodString, z.ZodTransform<`debt/${string}`, string>>;
937
945
  title: z.ZodString;
938
946
  state: z.ZodEnum<{
939
947
  open: "open";
940
- in_progress: "in_progress";
941
- on_hold: "on_hold";
942
948
  done: "done";
943
949
  drop: "drop";
944
950
  }>;
945
951
  priority: z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>;
946
952
  disposition: z.ZodEnum<{
947
- in_progress: "in_progress";
948
- on_hold: "on_hold";
949
953
  done: "done";
950
954
  drop: "drop";
951
955
  ready: "ready";
@@ -1258,24 +1262,21 @@ export declare const selectionResultSchemas: {
1258
1262
  stranded: "stranded";
1259
1263
  }>;
1260
1264
  cwd: z.ZodOptional<z.ZodString>;
1265
+ provider: z.ZodOptional<z.ZodString>;
1266
+ model: z.ZodOptional<z.ZodString>;
1261
1267
  allowed: z.ZodPipe<z.ZodArray<z.ZodEnum<{
1262
- "task.add": "task.add";
1263
- "task.addDocument": "task.addDocument";
1264
- "task.compose": "task.compose";
1265
- "task.done": "task.done";
1266
- "task.drop": "task.drop";
1267
- "task.hold": "task.hold";
1268
- "task.resume": "task.resume";
1269
- "task.start": "task.start";
1270
- "task.stop": "task.stop";
1271
- "task.update": "task.update";
1268
+ "debt.add": "debt.add";
1269
+ "debt.addDocument": "debt.addDocument";
1270
+ "debt.done": "debt.done";
1271
+ "debt.drop": "debt.drop";
1272
+ "debt.update": "debt.update";
1272
1273
  "akuma.call": "akuma.call";
1273
1274
  "akuma.kill": "akuma.kill";
1274
1275
  "akuma.tell": "akuma.tell";
1275
1276
  "contract.audit": "contract.audit";
1276
1277
  "contract.deliver": "contract.deliver";
1277
1278
  "contract.review": "contract.review";
1278
- }>>, z.ZodTransform<import("./allowed.js").AllowedActions, ("task.add" | "task.addDocument" | "task.compose" | "task.done" | "task.drop" | "task.hold" | "task.resume" | "task.start" | "task.stop" | "task.update" | "akuma.call" | "akuma.kill" | "akuma.tell" | "contract.audit" | "contract.deliver" | "contract.review")[]>>;
1279
+ }>>, z.ZodTransform<import("./allowed.js").AllowedActions, ("debt.add" | "debt.addDocument" | "debt.done" | "debt.drop" | "debt.update" | "akuma.call" | "akuma.kill" | "akuma.tell" | "contract.audit" | "contract.deliver" | "contract.review")[]>>;
1279
1280
  timeline: z.ZodUnion<readonly [z.ZodObject<{
1280
1281
  reportedChanges: z.ZodReadonly<z.ZodArray<z.ZodObject<{
1281
1282
  sequence: z.ZodNumber;
@@ -1419,6 +1420,7 @@ export declare const selectionResultSchemas: {
1419
1420
  unspecified: "unspecified";
1420
1421
  }>;
1421
1422
  path: z.ZodString;
1423
+ patch: z.ZodOptional<z.ZodString>;
1422
1424
  diffstat: z.ZodOptional<z.ZodObject<{
1423
1425
  added: z.ZodNumber;
1424
1426
  removed: z.ZodNumber;
@@ -1433,6 +1435,7 @@ export declare const selectionResultSchemas: {
1433
1435
  }, z.core.$strict>>;
1434
1436
  }, z.core.$strict>]>;
1435
1437
  state: z.ZodLiteral<"active">;
1438
+ toolId: z.ZodOptional<z.ZodString>;
1436
1439
  truncated: z.ZodOptional<z.ZodLiteral<true>>;
1437
1440
  }, z.core.$strict>, z.ZodObject<{
1438
1441
  kind: z.ZodLiteral<"tool">;
@@ -1469,6 +1472,7 @@ export declare const selectionResultSchemas: {
1469
1472
  unspecified: "unspecified";
1470
1473
  }>;
1471
1474
  path: z.ZodString;
1475
+ patch: z.ZodOptional<z.ZodString>;
1472
1476
  diffstat: z.ZodOptional<z.ZodObject<{
1473
1477
  added: z.ZodNumber;
1474
1478
  removed: z.ZodNumber;
@@ -1488,8 +1492,10 @@ export declare const selectionResultSchemas: {
1488
1492
  ok: "ok";
1489
1493
  }>;
1490
1494
  message: z.ZodOptional<z.ZodString>;
1495
+ output: z.ZodOptional<z.ZodString>;
1491
1496
  exitCode: z.ZodOptional<z.ZodNumber>;
1492
1497
  }, z.core.$strict>;
1498
+ toolId: z.ZodOptional<z.ZodString>;
1493
1499
  truncated: z.ZodOptional<z.ZodLiteral<true>>;
1494
1500
  }, z.core.$strict>]>;
1495
1501
  }, z.core.$strict>]>>>;
@@ -1522,6 +1528,7 @@ export declare const selectionResultSchemas: {
1522
1528
  kind: z.ZodLiteral<"answered">;
1523
1529
  historyId: z.ZodString;
1524
1530
  answer: z.ZodString;
1531
+ foldedSaidSequence: z.ZodOptional<z.ZodNumber>;
1525
1532
  }, z.core.$strict>, z.ZodObject<{
1526
1533
  kind: z.ZodLiteral<"failed">;
1527
1534
  historyId: z.ZodString;
@@ -1627,6 +1634,7 @@ export declare const selectionResultSchemas: {
1627
1634
  unspecified: "unspecified";
1628
1635
  }>;
1629
1636
  path: z.ZodString;
1637
+ patch: z.ZodOptional<z.ZodString>;
1630
1638
  diffstat: z.ZodOptional<z.ZodObject<{
1631
1639
  added: z.ZodNumber;
1632
1640
  removed: z.ZodNumber;
@@ -1646,8 +1654,10 @@ export declare const selectionResultSchemas: {
1646
1654
  ok: "ok";
1647
1655
  }>;
1648
1656
  message: z.ZodOptional<z.ZodString>;
1657
+ output: z.ZodOptional<z.ZodString>;
1649
1658
  exitCode: z.ZodOptional<z.ZodNumber>;
1650
1659
  }, z.core.$strict>;
1660
+ toolId: z.ZodOptional<z.ZodString>;
1651
1661
  truncated: z.ZodOptional<z.ZodLiteral<true>>;
1652
1662
  }, z.core.$strict>]>;
1653
1663
  }, z.core.$strict>]>>>;
@@ -1664,22 +1674,18 @@ export declare const selectionResultSchemas: {
1664
1674
  kind: z.ZodLiteral<"failed">;
1665
1675
  diagnostic: z.ZodString;
1666
1676
  }, z.core.$strict>]>;
1667
- createdTasks: z.ZodUnion<readonly [z.ZodObject<{
1677
+ createdDebts: z.ZodUnion<readonly [z.ZodObject<{
1668
1678
  kind: z.ZodLiteral<"present">;
1669
1679
  rows: z.ZodReadonly<z.ZodArray<z.ZodObject<{
1670
- id: z.ZodPipe<z.ZodString, z.ZodTransform<`task/${string}`, string>>;
1680
+ id: z.ZodPipe<z.ZodString, z.ZodTransform<`debt/${string}`, string>>;
1671
1681
  title: z.ZodString;
1672
1682
  state: z.ZodEnum<{
1673
1683
  open: "open";
1674
- in_progress: "in_progress";
1675
- on_hold: "on_hold";
1676
1684
  done: "done";
1677
1685
  drop: "drop";
1678
1686
  }>;
1679
1687
  priority: z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>;
1680
1688
  disposition: z.ZodEnum<{
1681
- in_progress: "in_progress";
1682
- on_hold: "on_hold";
1683
1689
  done: "done";
1684
1690
  drop: "drop";
1685
1691
  ready: "ready";
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import { EMPTY_CREATED_TASK_OBSERVATION, createdTaskObservationSchema } from "../task/created-observation.js";
2
+ import { EMPTY_CREATED_DEBT_OBSERVATION, createdDebtObservationSchema } from "../debt/created-observation.js";
3
3
  import { akumaStatusSchema } from "./akuma.js";
4
4
  import { tellResultSchema } from "./call-initial-tell.js";
5
5
  import { NO_DISPATCH_ASSOCIATION, dispatchAssociationSchema } from "./dispatch-association.js";
@@ -16,7 +16,7 @@ const akumaObservationSchema = z
16
16
  .object({
17
17
  status: akumaStatusSchema,
18
18
  contract: dispatchAssociationSchema,
19
- createdTasks: createdTaskObservationSchema,
19
+ createdDebts: createdDebtObservationSchema,
20
20
  })
21
21
  .strict();
22
22
  const akumaUnobservedSchema = z.object({ id: akumaIdSchema, diagnostic: z.string() }).strict();
@@ -48,7 +48,7 @@ const akumaAskResultSchema = z
48
48
  .strict();
49
49
  /** Compose one native status into the canonical observation its crossing transports. */
50
50
  export function akumaObservationOf(status) {
51
- return { status, contract: NO_DISPATCH_ASSOCIATION, createdTasks: EMPTY_CREATED_TASK_OBSERVATION };
51
+ return { status, contract: NO_DISPATCH_ASSOCIATION, createdDebts: EMPTY_CREATED_DEBT_OBSERVATION };
52
52
  }
53
53
  export const selectionResultSchemas = {
54
54
  wait: akumaWaitResultSchema,
@@ -34,6 +34,9 @@ export type DriveTurnInput = Readonly<{
34
34
  admitInitialTell(input: InitialTellAdmissionRequest): Promise<CallInitialTellAdmission>;
35
35
  world: import("../world.js").WorldRoot;
36
36
  externalCommands: Readonly<Record<string, ErasedRequestCommand>>;
37
+ turnStarted: Readonly<{
38
+ emit(turnSequence: number): Promise<void>;
39
+ }>;
37
40
  now(): string;
38
41
  }>;
39
42
  export declare function driveTurn(input: DriveTurnInput): Promise<(DrivenTurn & Readonly<{
@@ -1,6 +1,7 @@
1
1
  import { abortableDelay } from "./abort.js";
2
2
  /* eslint-disable max-lines-per-function -- Turn setup and consumption each preserve one ordered lifecycle transaction. */
3
- import { appendActivity, beginTurn, bindTellsToTurn, breakBody, drainPendingTells, heartExists, readHeart, recordSession, recordTellDeliveries, recordTellReceipt, } from "./heart/index.js";
3
+ import { appendActivity, beginTurn, bindTellsToTurn, breakBody, drainPendingTells, heartExists, readHeart, recordCurrentModel, recordSession, recordTellDeliveries, recordTellReceipt, } from "./heart/index.js";
4
+ import { withoutModel } from "./provider-recipe.js";
4
5
  import { encodeAgentEvent, } from "./provider.js";
5
6
  import { akumaCallRequestCommands } from "./call-request.js";
6
7
  import { BodyRequestPump } from "./request-serve.js";
@@ -27,12 +28,20 @@ function serializeEffects() {
27
28
  return serialize;
28
29
  }
29
30
  export async function turnRecipe(paths, soul) {
30
- const latest = (await readHeart(paths)).latestSession;
31
+ const heart = await readHeart(paths);
32
+ const latest = heart.latestSession;
31
33
  const admitted = latest?.provider === soul.provider.name ? latest : undefined;
32
34
  const session = admitted?.coordinate;
35
+ // The current model is the one mutable member of the recipe and lives only
36
+ // in the Soul, so every Turn reads it freshly and no session copy, cached
37
+ // birth Soul, or stale option can re-admit a model that already moved.
38
+ const current = heart.soul?.options.model;
33
39
  return {
34
40
  cwd: soul.cwd,
35
- options: admitted?.options ?? soul.options,
41
+ options: {
42
+ ...withoutModel(admitted?.options ?? soul.options),
43
+ ...(current === undefined ? {} : { model: current }),
44
+ },
36
45
  ...(session === undefined ? {} : { session }),
37
46
  };
38
47
  }
@@ -51,7 +60,7 @@ async function failedTurnSetup(input, turnSequence, requests, cancelDrive, error
51
60
  }
52
61
  return { kind: "failed", turnSequence, diagnostic: error instanceof Error ? error.message : String(error) };
53
62
  }
54
- async function writeProviderEvent(input, active, event) {
63
+ async function writeProviderEvent(input, active, event, witness) {
55
64
  if (input.supervisor.signal.aborted)
56
65
  return;
57
66
  const at = input.now();
@@ -64,6 +73,16 @@ async function writeProviderEvent(input, active, event) {
64
73
  admittedAt: at,
65
74
  });
66
75
  }
76
+ if (event.type === "model") {
77
+ // Native model evidence is authoritative current state, not narration: it
78
+ // moves the Soul's one model and is never appended to activity.
79
+ if (witness.written && witness.model === event.model)
80
+ return;
81
+ witness.written = true;
82
+ witness.model = event.model;
83
+ await recordCurrentModel(input.paths, { bodySequence: input.bodySequence, model: event.model });
84
+ return;
85
+ }
67
86
  await appendActivity(input.paths, { turnSequence: active.turnSequence, event: encodeAgentEvent(event), at });
68
87
  }
69
88
  async function startTurnDrive(input) {
@@ -87,6 +106,7 @@ async function startTurnDrive(input) {
87
106
  boundAt: input.now(),
88
107
  });
89
108
  }
109
+ await input.turnStarted.emit(turn.sequence);
90
110
  const { world, paths, soul: parent, runtimeSpawn: spawn, externalCommands, admitInitialTell } = input;
91
111
  const commands = composeRequestCommands(akumaCallRequestCommands({ world, paths, parent, spawn, admitInitialTell }), externalCommands);
92
112
  const requests = await BodyRequestPump.open({
@@ -354,6 +374,7 @@ async function consumeTurnDrive(input, active) {
354
374
  const receiptFailure = observeFailure(pumpReceipts(writers));
355
375
  const completionFailure = observeCompletionFailure(drive);
356
376
  const iterator = drive.events[Symbol.asyncIterator]();
377
+ const witness = { written: false, model: undefined };
357
378
  let liveTells = true;
358
379
  let tellPump = null;
359
380
  const wakeups = createTurnWakeups((after) => input.supervisor.next(after));
@@ -398,7 +419,7 @@ async function consumeTurnDrive(input, active) {
398
419
  }
399
420
  if (next.event.done)
400
421
  break;
401
- await writeProviderEvent(input, active, next.event.value);
422
+ await writeProviderEvent(input, active, next.event.value, witness);
402
423
  if (next.event.value.type === "session")
403
424
  turnSession = next.event.value.coordinate;
404
425
  wakeups.event(iterator.next());
@@ -11,8 +11,8 @@ import { contractRequestCommands } from "./library/contract-operations.js";
11
11
  import { createKeiyakuHandle } from "./library/keiyaku.js";
12
12
  import { Repo } from "./library/repo.js";
13
13
  import { settings } from "./settings.js";
14
- import { Tasks } from "./task/index.js";
15
- import { taskMutationRequestCommands } from "./task/mutation.js";
14
+ import { Debts } from "./debt/index.js";
15
+ import { debtMutationRequestCommands } from "./debt/mutation.js";
16
16
  import { World } from "./world.js";
17
17
  async function contractDependencies(repoRoot, processConfiguration) {
18
18
  const repo = await Repo.at({
@@ -68,35 +68,25 @@ function contractUpstream(processConfiguration) {
68
68
  },
69
69
  };
70
70
  }
71
- const TASK_LIFECYCLE = {
72
- start: async (handle, input) => await handle.start(input),
73
- stop: async (handle, input) => await handle.stop(input),
74
- hold: async (handle, input) => await handle.hold(input),
75
- resume: async (handle, input) => await handle.resume(input),
71
+ const DEBT_LIFECYCLE = {
76
72
  done: async (handle, input) => await handle.done(input),
77
73
  drop: async (handle, input) => await handle.drop(input),
78
74
  };
79
75
  /**
80
- * The upper Body edge composes the forced-local Tasks SDK the descriptor
76
+ * The upper Body edge composes the forced-local Debts SDK the descriptor
81
77
  * execution entries consume. Each ability is one ordinary local product
82
- * operation; no generic task(request) dispatcher is introduced here.
78
+ * operation; no generic debt(request) dispatcher is introduced here.
83
79
  */
84
- function taskMutationRequestPort() {
80
+ function debtMutationRequestPort() {
85
81
  return {
86
- add: async ({ world, options }) => await Tasks.of(world).add(options),
87
- addDocument: async ({ world, document }) => await Tasks.of(world).addDocument(document),
88
- compose: async ({ world, markdown, defaultNamespace, actor, signal }) => await Tasks.of(world).compose({
89
- markdown,
90
- namespace: defaultNamespace,
91
- actor,
92
- ...(signal === undefined ? {} : { signal }),
93
- }),
94
- update: async ({ world, id, options }) => await Tasks.of(world).task({ id }).update(options),
95
- lifecycle: async ({ world, verb, id, note, signal }) => await TASK_LIFECYCLE[verb](Tasks.of(world).task({ id }), {
82
+ add: async ({ world, options }) => await Debts.of(world).add(options),
83
+ addDocument: async ({ world, document }) => await Debts.of(world).addDocument(document),
84
+ update: async ({ world, id, options }) => await Debts.of(world).debt({ id }).update(options),
85
+ lifecycle: async ({ world, verb, id, note, signal }) => await DEBT_LIFECYCLE[verb](Debts.of(world).debt({ id }), {
96
86
  ...(note === undefined ? {} : { note }),
97
87
  ...(signal === undefined ? {} : { signal }),
98
88
  }),
99
- batch: async ({ world, verb, ids, note, signal }) => await Tasks.of(world).batch({
89
+ batch: async ({ world, verb, ids, note, signal }) => await Debts.of(world).batch({
100
90
  verb,
101
91
  ids,
102
92
  ...(note === undefined ? {} : { note }),
@@ -110,7 +100,7 @@ export async function externalRequestCommandsFor(launch, processConfiguration) {
110
100
  world,
111
101
  commands: composeRequestCommands(selectionRequestCommands(selectionRequestPort(world, (message) => {
112
102
  void recordPluginDiagnostic(launch.paths, "outcome observation", message);
113
- })), contractRequestCommands(contractUpstream(processConfiguration)), taskMutationRequestCommands(taskMutationRequestPort())),
103
+ })), contractRequestCommands(contractUpstream(processConfiguration)), debtMutationRequestCommands(debtMutationRequestPort())),
114
104
  };
115
105
  }
116
106
  function bodyProcessConfiguration() {
@@ -11,6 +11,16 @@ export async function akumaCallerFromEnvironment(environment) {
11
11
  const resolved = await World.resolve({ cwd: world, repositoryRoot: world });
12
12
  return decodeAkumaCaller({ kind: "akuma", akuId: id, world: resolved.candidate });
13
13
  }
14
+ const hosts = [
15
+ { integration: "codex", id: environment.CODEX_THREAD_ID },
16
+ { integration: "pi", id: environment.PI_SESSION_ID },
17
+ { integration: "claude", id: environment.CLAUDE_CODE_SESSION_ID },
18
+ ].filter(({ id }) => id !== undefined && id !== "");
19
+ if (hosts.length > 1) {
20
+ throw new TypeError(`Ambiguous native host caller: ${hosts.map(({ integration }) => integration).join(", ")}`);
21
+ }
22
+ if (hosts[0])
23
+ return decodeAkumaCaller({ kind: "external", ...hosts[0] });
14
24
  const external = environment.KEIYAKU_EXTERNAL_CALLER;
15
25
  if (external === undefined)
16
26
  return undefined;
@@ -48,10 +48,9 @@ const AKUMA_COMMAND_SPECS = {
48
48
  details: [
49
49
  "The default mode is any; --all waits until every selected Akuma completes.",
50
50
  "An already completed member counts immediately, so repeating a selection can return at once.",
51
- "Akuma names, completed activity, and the final result stream on stderr.",
52
- "A streamed plural wait leaves stdout empty, and so does a single wait with no answer.",
53
- "Only a single selected Akuma that answered writes to stdout, exactly its answer.",
54
- "With --json nothing streams and stdout carries the result document.",
51
+ "Text prints each selected Akuma's status snapshot, then one failure fact for any Akuma it could not read.",
52
+ "An answer is part of that snapshot; wait writes no separate copy of it to stdout.",
53
+ "With --json stdout carries the result document.",
55
54
  ].join("\n"),
56
55
  },
57
56
  tell: {