@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.
- package/README.md +40 -14
- package/build/plugins/claude/.claude-plugin/plugin.json +1 -1
- package/build/plugins/claude/skills/keiyaku/SKILL.md +5 -6
- package/build/plugins/claude/skills/keiyaku-akuma/SKILL.md +1 -1
- package/build/plugins/claude/skills/keiyaku-akuma/references/automation.md +8 -8
- package/build/plugins/claude/skills/keiyaku-babysit/SKILL.md +1 -1
- package/build/plugins/claude/skills/keiyaku-bind/SKILL.md +9 -9
- package/build/plugins/claude/skills/keiyaku-debt/SKILL.md +91 -0
- package/build/plugins/claude/skills/keiyaku-workflow/SKILL.md +2 -2
- package/build/plugins/codex/.codex-plugin/plugin.json +1 -1
- package/build/plugins/codex/skills/keiyaku/SKILL.md +5 -6
- package/build/plugins/codex/skills/keiyaku-akuma/SKILL.md +1 -1
- package/build/plugins/codex/skills/keiyaku-akuma/references/automation.md +8 -8
- package/build/plugins/codex/skills/keiyaku-babysit/SKILL.md +1 -1
- package/build/plugins/codex/skills/keiyaku-bind/SKILL.md +9 -9
- package/build/plugins/codex/skills/keiyaku-debt/SKILL.md +91 -0
- package/build/plugins/codex/skills/keiyaku-workflow/SKILL.md +2 -2
- package/build/plugins/opencode/index.js +1 -1
- package/build/plugins/opencode/skills/keiyaku/SKILL.md +5 -6
- package/build/plugins/opencode/skills/keiyaku-akuma/SKILL.md +1 -1
- package/build/plugins/opencode/skills/keiyaku-akuma/references/automation.md +8 -8
- package/build/plugins/opencode/skills/keiyaku-babysit/SKILL.md +1 -1
- package/build/plugins/opencode/skills/keiyaku-bind/SKILL.md +9 -9
- package/build/plugins/opencode/skills/keiyaku-debt/SKILL.md +91 -0
- package/build/plugins/opencode/skills/keiyaku-workflow/SKILL.md +2 -2
- package/build/skills/keiyaku/SKILL.md +5 -6
- package/build/skills/keiyaku-akuma/SKILL.md +1 -1
- package/build/skills/keiyaku-akuma/references/automation.md +8 -8
- package/build/skills/keiyaku-babysit/SKILL.md +1 -1
- package/build/skills/keiyaku-bind/SKILL.md +9 -9
- package/build/skills/keiyaku-debt/SKILL.md +91 -0
- package/build/skills/keiyaku-workflow/SKILL.md +2 -2
- package/build/src/akuma/akuma-instance.d.ts +2 -0
- package/build/src/akuma/akuma-instance.js +10 -0
- package/build/src/akuma/akuma-observe.d.ts +33 -8
- package/build/src/akuma/akuma-observe.js +88 -64
- package/build/src/akuma/akuma-owner.d.ts +11 -2
- package/build/src/akuma/akuma-owner.js +45 -35
- package/build/src/akuma/akuma-selection-execution.js +9 -1
- package/build/src/akuma/akuma-stream.d.ts +22 -0
- package/build/src/akuma/akuma-stream.js +116 -0
- package/build/src/akuma/akuma-wait.d.ts +1 -40
- package/build/src/akuma/akuma-wait.js +23 -84
- package/build/src/akuma/akuma.d.ts +17 -11
- package/build/src/akuma/akuma.js +2 -0
- package/build/src/akuma/allowed.d.ts +7 -12
- package/build/src/akuma/allowed.js +13 -4
- package/build/src/akuma/body-supervisor.d.ts +5 -5
- package/build/src/akuma/body-supervisor.js +22 -20
- package/build/src/akuma/body.js +28 -1
- package/build/src/akuma/call-request.d.ts +12 -22
- package/build/src/akuma/heart/activity-schema.d.ts +12 -0
- package/build/src/akuma/heart/activity-schema.js +6 -0
- package/build/src/akuma/heart/index.d.ts +59 -2
- package/build/src/akuma/heart/index.js +87 -8
- package/build/src/akuma/heart/rows.js +5 -3
- package/build/src/akuma/heart/soul.d.ts +9 -0
- package/build/src/akuma/heart/soul.js +29 -0
- package/build/src/akuma/heart/storage.d.ts +15 -0
- package/build/src/akuma/heart/storage.js +55 -0
- package/build/src/akuma/heart/timeline.d.ts +7 -0
- package/build/src/akuma/heart/timeline.js +10 -0
- package/build/src/akuma/index.d.ts +1 -0
- package/build/src/akuma/projection.d.ts +25 -0
- package/build/src/akuma/projection.js +24 -7
- package/build/src/akuma/provider-recipe.d.ts +11 -0
- package/build/src/akuma/provider-recipe.js +23 -0
- package/build/src/akuma/provider.d.ts +25 -0
- package/build/src/akuma/provider.js +99 -7
- package/build/src/akuma/providers/acp/events.js +25 -2
- package/build/src/akuma/providers/claude/events.js +76 -10
- package/build/src/akuma/providers/claude/index.js +2 -5
- package/build/src/akuma/providers/codex-app-server/events.js +17 -2
- package/build/src/akuma/providers/codex-app-server/index.js +15 -9
- package/build/src/akuma/providers/decode.d.ts +8 -0
- package/build/src/akuma/providers/decode.js +21 -0
- package/build/src/akuma/providers/grok-build/index.js +10 -26
- package/build/src/akuma/providers/opencode-sdk/event-stream.d.ts +3 -3
- package/build/src/akuma/providers/opencode-sdk/event-stream.js +2 -25
- package/build/src/akuma/providers/opencode-sdk/events.d.ts +7 -43
- package/build/src/akuma/providers/opencode-sdk/events.js +147 -284
- package/build/src/akuma/providers/opencode-sdk/index.js +267 -421
- package/build/src/akuma/providers/opencode-sdk/native-http.d.ts +9 -0
- package/build/src/akuma/providers/opencode-sdk/native-http.js +69 -0
- package/build/src/akuma/providers/opencode-sdk/session.d.ts +42 -36
- package/build/src/akuma/providers/opencode-sdk/session.js +75 -82
- package/build/src/akuma/providers/paseo/events.d.ts +8 -0
- package/build/src/akuma/providers/paseo/events.js +58 -11
- package/build/src/akuma/providers/paseo/index.js +11 -7
- package/build/src/akuma/providers/pi/events.d.ts +2 -0
- package/build/src/akuma/providers/pi/events.js +32 -24
- package/build/src/akuma/providers/pi/index.js +21 -35
- package/build/src/akuma/request-lifecycle.d.ts +1 -2
- package/build/src/akuma/request-lifecycle.js +2 -8
- package/build/src/akuma/request-rendezvous.js +38 -55
- package/build/src/akuma/request-serve.d.ts +1 -1
- package/build/src/akuma/request-serve.js +77 -113
- package/build/src/akuma/selection-observation.d.ts +57 -51
- package/build/src/akuma/selection-observation.js +3 -3
- package/build/src/akuma/turn-drive.d.ts +3 -0
- package/build/src/akuma/turn-drive.js +26 -5
- package/build/src/akuma-body.js +12 -22
- package/build/src/cli/akuma-caller.js +10 -0
- package/build/src/cli/commands/akuma-grammar.js +3 -4
- package/build/src/cli/commands/akuma.js +13 -51
- package/build/src/cli/commands/contract-grammar.d.ts +7 -6
- package/build/src/cli/commands/contract-grammar.js +27 -32
- package/build/src/cli/commands/contract-help.d.ts +16 -7
- package/build/src/cli/commands/contract-help.js +20 -11
- package/build/src/cli/commands/contract.js +11 -11
- package/build/src/cli/commands/debt-grammar.d.ts +19 -0
- package/build/src/cli/commands/debt-grammar.js +323 -0
- package/build/src/cli/commands/debt-query.d.ts +5 -0
- package/build/src/cli/commands/{task-query.js → debt-query.js} +9 -9
- package/build/src/cli/commands/{task.d.ts → debt.d.ts} +2 -2
- package/build/src/cli/commands/{task.js → debt.js} +83 -143
- package/build/src/cli/coordinates.d.ts +1 -1
- package/build/src/cli/coordinates.js +1 -1
- package/build/src/cli/parse.d.ts +4 -4
- package/build/src/cli/parse.js +17 -16
- package/build/src/cli/render/akuma-activity.d.ts +11 -83
- package/build/src/cli/render/akuma-activity.js +20 -382
- package/build/src/cli/render/catalog.d.ts +2 -2
- package/build/src/cli/render/catalog.js +5 -5
- package/build/src/cli/render/contract.js +2 -2
- package/build/src/cli/render/debt.d.ts +28 -0
- package/build/src/cli/render/{task.js → debt.js} +51 -112
- package/build/src/cli/render/kanshi.js +28 -28
- package/build/src/cli/render/marks.d.ts +5 -5
- package/build/src/cli/render/marks.js +4 -10
- package/build/src/cli/render/nuke.js +1 -1
- package/build/src/cli/runtime.js +3 -3
- package/build/src/cli/scan.d.ts +1 -1
- package/build/src/cli/usage.d.ts +1 -1
- package/build/src/cli/usage.js +4 -4
- package/build/src/contract-worktree.js +3 -3
- package/build/src/debt/board.d.ts +160 -0
- package/build/src/{task → debt}/board.js +89 -89
- package/build/src/debt/catalog.d.ts +11 -0
- package/build/src/debt/catalog.js +59 -0
- package/build/src/{task → debt}/context.d.ts +1 -1
- package/build/src/{task → debt}/context.js +1 -1
- package/build/src/{task → debt}/created-observation.d.ts +6 -10
- package/build/src/{task → debt}/created-observation.js +7 -7
- package/build/src/debt/document.d.ts +37 -0
- package/build/src/{task → debt}/document.js +37 -37
- package/build/src/debt/identity.d.ts +21 -0
- package/build/src/{task → debt}/identity.js +35 -35
- package/build/src/debt/index.d.ts +111 -0
- package/build/src/debt/index.js +203 -0
- package/build/src/{task → debt}/input.d.ts +8 -8
- package/build/src/{task → debt}/input.js +21 -21
- package/build/src/debt/lifecycle-operations.d.ts +6 -0
- package/build/src/{task → debt}/lifecycle-operations.js +27 -31
- package/build/src/debt/mutation-result.d.ts +981 -0
- package/build/src/debt/mutation-result.js +109 -0
- package/build/src/debt/mutation.d.ts +424 -0
- package/build/src/debt/mutation.js +223 -0
- package/build/src/debt/operation-types.d.ts +71 -0
- package/build/src/debt/operations.d.ts +28 -0
- package/build/src/{task → debt}/operations.js +59 -60
- package/build/src/debt/query.d.ts +76 -0
- package/build/src/{task → debt}/query.js +55 -55
- package/build/src/{task → debt}/store.d.ts +13 -13
- package/build/src/{task → debt}/store.js +58 -49
- package/build/src/debt/view.d.ts +4 -0
- package/build/src/debt/view.js +7 -0
- package/build/src/identity/coordinates.d.ts +1 -1
- package/build/src/index.d.ts +13 -13
- package/build/src/index.js +9 -9
- package/build/src/kanshi/index.d.ts +1 -1
- package/build/src/kanshi/read.js +33 -33
- package/build/src/kanshi/report.d.ts +7 -7
- package/build/src/kanshi/select.js +4 -4
- package/build/src/library/akumas.d.ts +2 -3
- package/build/src/library/bind.d.ts +3 -3
- package/build/src/library/bind.js +5 -5
- package/build/src/library/contract-creation.js +5 -5
- package/build/src/library/contract-execution.js +4 -4
- package/build/src/library/contract-types.d.ts +2 -2
- package/build/src/library/input.d.ts +2 -2
- package/build/src/library/input.js +5 -5
- package/build/src/library/invocation.js +2 -2
- package/build/src/library/nuke.js +3 -3
- package/build/src/library/outcome.d.ts +126 -126
- package/build/src/library/outcome.js +3 -3
- package/build/src/library/selection.d.ts +1 -4
- package/build/src/library/selection.js +11 -62
- package/build/src/plugin/public.d.ts +5 -0
- package/build/src/plugin/runtime.js +3 -1
- package/build/src/runtime/proc/windows-launch.exe +0 -0
- package/build/src/settlement/fence.d.ts +3 -3
- package/build/src/settlement/fence.js +4 -4
- package/build/src/settlement/holder.d.ts +16 -16
- package/build/src/settlement/holder.js +69 -63
- package/build/src/settlement/settle.d.ts +5 -5
- package/build/src/settlement/settle.js +53 -53
- package/package.json +12 -6
- package/plugins/paseo/plugin/index.server.ts +17 -0
- package/plugins/paseo/plugin/paseo-plugin.json +4 -0
- package/plugins/paseo/plugin/server/attach.ts +52 -0
- package/plugins/paseo/plugin/server/keiyaku.ts +44 -0
- package/plugins/paseo/plugin/server/message.ts +60 -0
- package/plugins/paseo/plugin/server/mirror.ts +193 -0
- package/plugins/paseo/plugin/server/model.ts +14 -0
- package/plugins/paseo/plugin/server/provider.ts +276 -0
- package/plugins/paseo/plugin/server/sdk-worker.ts +237 -0
- package/plugins/paseo/plugin/server/sdk.ts +289 -0
- package/plugins/paseo/plugin/server/stop.ts +26 -0
- package/plugins/paseo/plugin/server/transport.ts +35 -0
- package/plugins/paseo/plugin/shared/attach-rpc.ts +10 -0
- package/plugins/paseo/plugin/shared/refresh-rpc.ts +6 -0
- package/plugins/paseo/plugin/tsconfig.json +6 -0
- package/skills/keiyaku/SKILL.md +5 -6
- package/skills/keiyaku-akuma/SKILL.md +1 -1
- package/skills/keiyaku-akuma/references/automation.md +8 -8
- package/skills/keiyaku-babysit/SKILL.md +1 -1
- package/skills/keiyaku-bind/SKILL.md +9 -9
- package/skills/keiyaku-debt/SKILL.md +91 -0
- package/skills/keiyaku-workflow/SKILL.md +2 -2
- package/build/plugins/claude/skills/keiyaku-task/SKILL.md +0 -104
- package/build/plugins/codex/skills/keiyaku-task/SKILL.md +0 -104
- package/build/plugins/opencode/skills/keiyaku-task/SKILL.md +0 -104
- package/build/skills/keiyaku-task/SKILL.md +0 -104
- package/build/src/cli/commands/task-grammar.d.ts +0 -19
- package/build/src/cli/commands/task-grammar.js +0 -384
- package/build/src/cli/commands/task-query.d.ts +0 -5
- package/build/src/cli/render/task.d.ts +0 -39
- package/build/src/task/board.d.ts +0 -168
- package/build/src/task/catalog.d.ts +0 -11
- package/build/src/task/catalog.js +0 -59
- package/build/src/task/compose-language.d.ts +0 -57
- package/build/src/task/compose-language.js +0 -364
- package/build/src/task/compose-parser.d.ts +0 -32
- package/build/src/task/compose-parser.js +0 -180
- package/build/src/task/compose.d.ts +0 -16
- package/build/src/task/compose.js +0 -189
- package/build/src/task/document.d.ts +0 -39
- package/build/src/task/identity.d.ts +0 -21
- package/build/src/task/index.d.ts +0 -138
- package/build/src/task/index.js +0 -269
- package/build/src/task/lifecycle-operations.d.ts +0 -6
- package/build/src/task/mutation-result.d.ts +0 -1726
- package/build/src/task/mutation-result.js +0 -198
- package/build/src/task/mutation.d.ts +0 -590
- package/build/src/task/mutation.js +0 -262
- package/build/src/task/operation-types.d.ts +0 -71
- package/build/src/task/operations.d.ts +0 -28
- package/build/src/task/query.d.ts +0 -76
- package/build/src/task/view.d.ts +0 -4
- package/build/src/task/view.js +0 -7
- package/skills/keiyaku-task/SKILL.md +0 -104
- /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
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
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, ("
|
|
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
|
-
|
|
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<`
|
|
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
|
-
"
|
|
529
|
-
"
|
|
530
|
-
"
|
|
531
|
-
"
|
|
532
|
-
"
|
|
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, ("
|
|
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
|
-
|
|
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<`
|
|
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
|
-
"
|
|
1263
|
-
"
|
|
1264
|
-
"
|
|
1265
|
-
"
|
|
1266
|
-
"
|
|
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, ("
|
|
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
|
-
|
|
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<`
|
|
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 {
|
|
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
|
-
|
|
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,
|
|
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
|
|
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:
|
|
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());
|
package/build/src/akuma-body.js
CHANGED
|
@@ -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 {
|
|
15
|
-
import {
|
|
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
|
|
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
|
|
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
|
|
78
|
+
* operation; no generic debt(request) dispatcher is introduced here.
|
|
83
79
|
*/
|
|
84
|
-
function
|
|
80
|
+
function debtMutationRequestPort() {
|
|
85
81
|
return {
|
|
86
|
-
add: async ({ world, options }) => await
|
|
87
|
-
addDocument: async ({ world, document }) => await
|
|
88
|
-
|
|
89
|
-
|
|
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
|
|
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)),
|
|
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
|
|
52
|
-
"
|
|
53
|
-
"
|
|
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: {
|