@astrosheep/keiyaku 4.6.7 → 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 +46 -16
- 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/plugins/pi/keiyaku.ts +0 -5
- 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-call.d.ts +2 -0
- package/build/src/akuma/akuma-call.js +8 -2
- package/build/src/akuma/akuma-instance.d.ts +14 -1
- package/build/src/akuma/akuma-instance.js +37 -7
- package/build/src/akuma/akuma-observe.d.ts +33 -8
- package/build/src/akuma/akuma-observe.js +89 -63
- package/build/src/akuma/akuma-owner.d.ts +14 -2
- package/build/src/akuma/akuma-owner.js +49 -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 +52 -16
- package/build/src/akuma/akuma.js +10 -10
- package/build/src/akuma/allowed.d.ts +7 -12
- package/build/src/akuma/allowed.js +13 -4
- package/build/src/akuma/archetype.d.ts +7 -15
- package/build/src/akuma/archetype.js +36 -35
- package/build/src/akuma/body-supervisor.d.ts +5 -5
- package/build/src/akuma/body-supervisor.js +22 -20
- package/build/src/akuma/body.d.ts +5 -3
- package/build/src/akuma/body.js +57 -8
- package/build/src/akuma/call-request.d.ts +30 -32
- package/build/src/akuma/call-request.js +10 -3
- package/build/src/akuma/caller.d.ts +39 -0
- package/build/src/akuma/caller.js +36 -0
- package/build/src/akuma/dispatch-association.d.ts +0 -1
- package/build/src/akuma/dispatch-association.js +0 -3
- 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/facts.d.ts +16 -12
- package/build/src/akuma/heart/facts.js +8 -0
- package/build/src/akuma/heart/index.d.ts +61 -9
- package/build/src/akuma/heart/index.js +89 -24
- package/build/src/akuma/heart/rows.d.ts +3 -3
- package/build/src/akuma/heart/rows.js +5 -3
- package/build/src/akuma/heart/soul.d.ts +10 -1
- package/build/src/akuma/heart/soul.js +34 -24
- package/build/src/akuma/heart/storage.d.ts +20 -0
- package/build/src/akuma/heart/storage.js +62 -3
- package/build/src/akuma/heart/timeline.d.ts +7 -0
- package/build/src/akuma/heart/timeline.js +10 -0
- package/build/src/akuma/identity.d.ts +0 -1
- package/build/src/akuma/identity.js +2 -5
- package/build/src/akuma/index.d.ts +6 -2
- package/build/src/akuma/index.js +1 -0
- package/build/src/akuma/nuke.js +6 -28
- package/build/src/akuma/projection.d.ts +25 -11
- package/build/src/akuma/projection.js +24 -7
- package/build/src/akuma/provider-recipe.d.ts +18 -6
- package/build/src/akuma/provider-recipe.js +24 -1
- package/build/src/akuma/provider.d.ts +31 -10
- package/build/src/akuma/provider.js +105 -14
- package/build/src/akuma/providers/acp/events.js +29 -19
- package/build/src/akuma/providers/acp/index.js +2 -3
- package/build/src/akuma/providers/claude/events.js +110 -69
- package/build/src/akuma/providers/claude/index.d.ts +2 -2
- package/build/src/akuma/providers/claude/index.js +4 -8
- package/build/src/akuma/providers/codex-app-server/events.js +17 -2
- package/build/src/akuma/providers/codex-app-server/index.js +17 -11
- package/build/src/akuma/providers/decode.d.ts +33 -0
- package/build/src/akuma/providers/decode.js +65 -0
- package/build/src/akuma/providers/execution-environment.d.ts +2 -1
- package/build/src/akuma/providers/execution-environment.js +3 -0
- package/build/src/akuma/providers/grok-build/index.js +16 -48
- package/build/src/akuma/providers/index.js +2 -0
- package/build/src/akuma/providers/lifecycle.d.ts +9 -0
- package/build/src/akuma/providers/lifecycle.js +10 -0
- 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 +146 -296
- package/build/src/akuma/providers/opencode-sdk/index.js +270 -431
- 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 -84
- package/build/src/akuma/providers/paseo/events.d.ts +33 -0
- package/build/src/akuma/providers/paseo/events.js +204 -0
- package/build/src/akuma/providers/paseo/index.d.ts +9 -0
- package/build/src/akuma/providers/paseo/index.js +357 -0
- package/build/src/akuma/providers/pi/events.d.ts +2 -0
- package/build/src/akuma/providers/pi/events.js +36 -38
- package/build/src/akuma/providers/pi/index.js +21 -35
- package/build/src/akuma/publication.d.ts +2 -0
- package/build/src/akuma/publication.js +5 -0
- package/build/src/akuma/request-lifecycle.d.ts +4 -2
- package/build/src/akuma/request-lifecycle.js +27 -12
- 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/requests.d.ts +3 -1
- package/build/src/akuma/requests.js +32 -0
- package/build/src/akuma/selection-observation.d.ts +129 -53
- package/build/src/akuma/selection-observation.js +3 -9
- package/build/src/akuma/turn-drive.d.ts +3 -0
- package/build/src/akuma/turn-drive.js +28 -10
- package/build/src/akuma-body.js +12 -22
- package/build/src/cli/akuma-caller.d.ts +3 -0
- package/build/src/cli/akuma-caller.js +31 -0
- package/build/src/cli/commands/akuma-grammar.js +10 -16
- package/build/src/cli/commands/akuma.js +25 -55
- package/build/src/cli/commands/contract-grammar.d.ts +9 -7
- package/build/src/cli/commands/contract-grammar.js +40 -47
- package/build/src/cli/commands/contract-help.d.ts +17 -7
- package/build/src/cli/commands/contract-help.js +50 -11
- package/build/src/cli/commands/contract.js +34 -63
- 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} +87 -164
- package/build/src/cli/coordinates.d.ts +1 -1
- package/build/src/cli/coordinates.js +1 -1
- package/build/src/cli/parse.d.ts +5 -5
- 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 +4 -7
- package/build/src/cli/render/catalog.js +5 -5
- package/build/src/cli/render/contract-history.js +3 -6
- package/build/src/cli/render/contract.js +17 -52
- package/build/src/cli/render/debt.d.ts +28 -0
- package/build/src/cli/render/{task.js → debt.js} +55 -133
- 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/render/receipt.js +3 -10
- package/build/src/cli/runtime.d.ts +1 -1
- package/build/src/cli/runtime.js +14 -20
- package/build/src/cli/scan.d.ts +1 -1
- package/build/src/cli/selectors.d.ts +3 -6
- package/build/src/cli/selectors.js +22 -53
- 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/dispatch/index.d.ts +3 -3
- package/build/src/dispatch/index.js +1 -2
- package/build/src/git/observe.d.ts +6 -2
- package/build/src/git/observe.js +6 -2
- package/build/src/identity/coordinates.d.ts +1 -1
- package/build/src/index.d.ts +17 -17
- package/build/src/index.js +11 -11
- package/build/src/kanshi/index.d.ts +2 -2
- package/build/src/kanshi/read.js +54 -39
- package/build/src/kanshi/report.d.ts +7 -7
- package/build/src/kanshi/select.js +4 -4
- package/build/src/library/address.js +2 -4
- package/build/src/library/akuma-creation.d.ts +5 -1
- package/build/src/library/akuma-creation.js +27 -47
- package/build/src/library/akumas.d.ts +7 -7
- package/build/src/library/akumas.js +13 -9
- package/build/src/library/bind.d.ts +17 -17
- package/build/src/library/bind.js +16 -12
- package/build/src/library/contract-address.d.ts +9 -0
- package/build/src/library/contract-address.js +71 -0
- package/build/src/library/contract-composition.d.ts +4 -7
- package/build/src/library/contract-composition.js +6 -18
- package/build/src/library/contract-creation.d.ts +3 -5
- package/build/src/library/contract-creation.js +24 -22
- package/build/src/library/contract-execution.js +21 -26
- package/build/src/library/contract-outcomes.d.ts +2 -14
- package/build/src/library/contract-outcomes.js +2 -13
- package/build/src/library/contract-types.d.ts +38 -4
- package/build/src/library/delivery.d.ts +0 -2
- package/build/src/library/delivery.js +2 -5
- 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/keiyaku.d.ts +0 -5
- package/build/src/library/keiyaku.js +6 -12
- package/build/src/library/nuke.js +3 -3
- package/build/src/library/outcome.d.ts +626 -625
- package/build/src/library/outcome.js +13 -3
- package/build/src/library/reconcile.js +8 -16
- package/build/src/library/refusal.d.ts +2 -2
- package/build/src/library/repo.d.ts +3 -2
- package/build/src/library/repo.js +10 -5
- package/build/src/library/selection.d.ts +5 -8
- package/build/src/library/selection.js +22 -73
- package/build/src/plugin/akuma-signals.d.ts +2 -0
- package/build/src/plugin/akuma-signals.js +4 -0
- package/build/src/plugin/public.d.ts +32 -2
- package/build/src/plugin/runtime.js +5 -3
- package/build/src/protocol/amend.js +3 -2
- package/build/src/protocol/attempt.js +3 -8
- package/build/src/protocol/bind.d.ts +2 -2
- package/build/src/protocol/bind.js +1 -1
- package/build/src/protocol/deliver.js +3 -3
- package/build/src/protocol/operations.d.ts +1 -3
- package/build/src/protocol/operations.js +0 -8
- package/build/src/protocol/outcome.d.ts +1 -2
- package/build/src/protocol/outcome.js +1 -13
- package/build/src/protocol/placement.js +3 -10
- package/build/src/protocol/read/status.js +31 -70
- package/build/src/protocol/reintegrate.js +3 -10
- package/build/src/protocol/review.js +3 -3
- package/build/src/protocol/run.d.ts +5 -1
- package/build/src/protocol/run.js +3 -3
- 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 +19 -9
- 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/plugins/pi/keiyaku.ts +57 -0
- package/skills/keiyaku/SKILL.md +43 -0
- package/skills/keiyaku-akuma/SKILL.md +130 -0
- package/skills/keiyaku-akuma/references/automation.md +269 -0
- package/skills/keiyaku-babysit/SKILL.md +65 -0
- package/skills/keiyaku-bind/SKILL.md +216 -0
- package/skills/keiyaku-bind/agents/openai.yaml +4 -0
- package/skills/keiyaku-debt/SKILL.md +91 -0
- package/skills/keiyaku-workflow/SKILL.md +129 -0
- 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/amend.d.ts +0 -12
- package/build/src/cli/commands/amend.js +0 -10
- package/build/src/cli/commands/bind.d.ts +0 -11
- package/build/src/cli/commands/bind.js +0 -23
- 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 -41
- package/build/src/dispatch/association.d.ts +0 -1
- package/build/src/dispatch/association.js +0 -1
- 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/build/src/{task → debt}/operation-types.js +0 -0
|
@@ -8,23 +8,18 @@ import type { WorldRoot } from "../world.js";
|
|
|
8
8
|
declare const akumaCallRecipeSchema: z.ZodObject<{
|
|
9
9
|
description: z.ZodOptional<z.ZodString>;
|
|
10
10
|
allowed: z.ZodPipe<z.ZodArray<z.ZodEnum<{
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"task.hold": "task.hold";
|
|
17
|
-
"task.resume": "task.resume";
|
|
18
|
-
"task.start": "task.start";
|
|
19
|
-
"task.stop": "task.stop";
|
|
20
|
-
"task.update": "task.update";
|
|
11
|
+
"debt.add": "debt.add";
|
|
12
|
+
"debt.addDocument": "debt.addDocument";
|
|
13
|
+
"debt.done": "debt.done";
|
|
14
|
+
"debt.drop": "debt.drop";
|
|
15
|
+
"debt.update": "debt.update";
|
|
21
16
|
"akuma.call": "akuma.call";
|
|
22
17
|
"akuma.kill": "akuma.kill";
|
|
23
18
|
"akuma.tell": "akuma.tell";
|
|
24
19
|
"contract.audit": "contract.audit";
|
|
25
20
|
"contract.deliver": "contract.deliver";
|
|
26
21
|
"contract.review": "contract.review";
|
|
27
|
-
}>>, z.ZodTransform<import("./allowed.js").AllowedActions, ("
|
|
22
|
+
}>>, 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")[]>>;
|
|
28
23
|
provider: z.ZodPipe<z.ZodObject<{
|
|
29
24
|
name: z.ZodString;
|
|
30
25
|
kind: z.ZodEnum<{
|
|
@@ -33,6 +28,7 @@ declare const akumaCallRecipeSchema: z.ZodObject<{
|
|
|
33
28
|
"codex-app-server": "codex-app-server";
|
|
34
29
|
"grok-build": "grok-build";
|
|
35
30
|
"opencode-sdk": "opencode-sdk";
|
|
31
|
+
paseo: "paseo";
|
|
36
32
|
pi: "pi";
|
|
37
33
|
}>;
|
|
38
34
|
executable: z.ZodOptional<z.ZodString>;
|
|
@@ -43,10 +39,10 @@ declare const akumaCallRecipeSchema: z.ZodObject<{
|
|
|
43
39
|
config?: Readonly<Record<string, unknown>>;
|
|
44
40
|
executable?: string;
|
|
45
41
|
name: string;
|
|
46
|
-
kind: "acp" | "claude-agent-sdk" | "codex-app-server" | "grok-build" | "opencode-sdk" | "pi";
|
|
42
|
+
kind: "acp" | "claude-agent-sdk" | "codex-app-server" | "grok-build" | "opencode-sdk" | "paseo" | "pi";
|
|
47
43
|
}>, {
|
|
48
44
|
name: string;
|
|
49
|
-
kind: "acp" | "claude-agent-sdk" | "codex-app-server" | "grok-build" | "opencode-sdk" | "pi";
|
|
45
|
+
kind: "acp" | "claude-agent-sdk" | "codex-app-server" | "grok-build" | "opencode-sdk" | "paseo" | "pi";
|
|
50
46
|
executable?: string | undefined;
|
|
51
47
|
config?: Record<string, unknown> | undefined;
|
|
52
48
|
env?: Record<string, string> | undefined;
|
|
@@ -60,11 +56,11 @@ declare const akumaCallRecipeSchema: z.ZodObject<{
|
|
|
60
56
|
}>>;
|
|
61
57
|
systemPrompt: z.ZodOptional<z.ZodString>;
|
|
62
58
|
systemPromptMode: z.ZodOptional<z.ZodEnum<{
|
|
63
|
-
append: "append";
|
|
64
59
|
replace: "replace";
|
|
60
|
+
append: "append";
|
|
65
61
|
}>>;
|
|
66
62
|
}, z.core.$strip>, z.ZodTransform<Readonly<{
|
|
67
|
-
systemPromptMode?: "
|
|
63
|
+
systemPromptMode?: "replace" | "append";
|
|
68
64
|
systemPrompt?: string;
|
|
69
65
|
network?: "disabled" | "enabled";
|
|
70
66
|
effort?: string;
|
|
@@ -74,7 +70,7 @@ declare const akumaCallRecipeSchema: z.ZodObject<{
|
|
|
74
70
|
effort?: string | undefined;
|
|
75
71
|
network?: "disabled" | "enabled" | undefined;
|
|
76
72
|
systemPrompt?: string | undefined;
|
|
77
|
-
systemPromptMode?: "
|
|
73
|
+
systemPromptMode?: "replace" | "append" | undefined;
|
|
78
74
|
}>>;
|
|
79
75
|
}, z.core.$strict>;
|
|
80
76
|
declare const akumaCallPayloadSchema: z.ZodObject<{
|
|
@@ -86,27 +82,24 @@ declare const akumaCallPayloadSchema: z.ZodObject<{
|
|
|
86
82
|
schemaJson: z.ZodOptional<z.ZodString>;
|
|
87
83
|
initiator: z.ZodOptional<z.ZodString>;
|
|
88
84
|
}, z.core.$strict>>;
|
|
85
|
+
birthInitiator: z.ZodOptional<z.ZodString>;
|
|
86
|
+
contractId: z.ZodOptional<z.ZodString>;
|
|
89
87
|
cwd: z.ZodOptional<z.ZodString>;
|
|
90
88
|
recipe: z.ZodObject<{
|
|
91
89
|
description: z.ZodOptional<z.ZodString>;
|
|
92
90
|
allowed: z.ZodPipe<z.ZodArray<z.ZodEnum<{
|
|
93
|
-
"
|
|
94
|
-
"
|
|
95
|
-
"
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
"task.hold": "task.hold";
|
|
99
|
-
"task.resume": "task.resume";
|
|
100
|
-
"task.start": "task.start";
|
|
101
|
-
"task.stop": "task.stop";
|
|
102
|
-
"task.update": "task.update";
|
|
91
|
+
"debt.add": "debt.add";
|
|
92
|
+
"debt.addDocument": "debt.addDocument";
|
|
93
|
+
"debt.done": "debt.done";
|
|
94
|
+
"debt.drop": "debt.drop";
|
|
95
|
+
"debt.update": "debt.update";
|
|
103
96
|
"akuma.call": "akuma.call";
|
|
104
97
|
"akuma.kill": "akuma.kill";
|
|
105
98
|
"akuma.tell": "akuma.tell";
|
|
106
99
|
"contract.audit": "contract.audit";
|
|
107
100
|
"contract.deliver": "contract.deliver";
|
|
108
101
|
"contract.review": "contract.review";
|
|
109
|
-
}>>, z.ZodTransform<import("./allowed.js").AllowedActions, ("
|
|
102
|
+
}>>, 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")[]>>;
|
|
110
103
|
provider: z.ZodPipe<z.ZodObject<{
|
|
111
104
|
name: z.ZodString;
|
|
112
105
|
kind: z.ZodEnum<{
|
|
@@ -115,6 +108,7 @@ declare const akumaCallPayloadSchema: z.ZodObject<{
|
|
|
115
108
|
"codex-app-server": "codex-app-server";
|
|
116
109
|
"grok-build": "grok-build";
|
|
117
110
|
"opencode-sdk": "opencode-sdk";
|
|
111
|
+
paseo: "paseo";
|
|
118
112
|
pi: "pi";
|
|
119
113
|
}>;
|
|
120
114
|
executable: z.ZodOptional<z.ZodString>;
|
|
@@ -125,10 +119,10 @@ declare const akumaCallPayloadSchema: z.ZodObject<{
|
|
|
125
119
|
config?: Readonly<Record<string, unknown>>;
|
|
126
120
|
executable?: string;
|
|
127
121
|
name: string;
|
|
128
|
-
kind: "acp" | "claude-agent-sdk" | "codex-app-server" | "grok-build" | "opencode-sdk" | "pi";
|
|
122
|
+
kind: "acp" | "claude-agent-sdk" | "codex-app-server" | "grok-build" | "opencode-sdk" | "paseo" | "pi";
|
|
129
123
|
}>, {
|
|
130
124
|
name: string;
|
|
131
|
-
kind: "acp" | "claude-agent-sdk" | "codex-app-server" | "grok-build" | "opencode-sdk" | "pi";
|
|
125
|
+
kind: "acp" | "claude-agent-sdk" | "codex-app-server" | "grok-build" | "opencode-sdk" | "paseo" | "pi";
|
|
132
126
|
executable?: string | undefined;
|
|
133
127
|
config?: Record<string, unknown> | undefined;
|
|
134
128
|
env?: Record<string, string> | undefined;
|
|
@@ -142,11 +136,11 @@ declare const akumaCallPayloadSchema: z.ZodObject<{
|
|
|
142
136
|
}>>;
|
|
143
137
|
systemPrompt: z.ZodOptional<z.ZodString>;
|
|
144
138
|
systemPromptMode: z.ZodOptional<z.ZodEnum<{
|
|
145
|
-
append: "append";
|
|
146
139
|
replace: "replace";
|
|
140
|
+
append: "append";
|
|
147
141
|
}>>;
|
|
148
142
|
}, z.core.$strip>, z.ZodTransform<Readonly<{
|
|
149
|
-
systemPromptMode?: "
|
|
143
|
+
systemPromptMode?: "replace" | "append";
|
|
150
144
|
systemPrompt?: string;
|
|
151
145
|
network?: "disabled" | "enabled";
|
|
152
146
|
effort?: string;
|
|
@@ -156,7 +150,7 @@ declare const akumaCallPayloadSchema: z.ZodObject<{
|
|
|
156
150
|
effort?: string | undefined;
|
|
157
151
|
network?: "disabled" | "enabled" | undefined;
|
|
158
152
|
systemPrompt?: string | undefined;
|
|
159
|
-
systemPromptMode?: "
|
|
153
|
+
systemPromptMode?: "replace" | "append" | undefined;
|
|
160
154
|
}>>;
|
|
161
155
|
}, z.core.$strict>;
|
|
162
156
|
}, z.core.$strict>;
|
|
@@ -167,6 +161,10 @@ export type AkumaCallRequest = z.infer<typeof akumaCallPayloadSchema> & Readonly
|
|
|
167
161
|
export type AkumaCallRequestChildLaunch = Readonly<{
|
|
168
162
|
paths: AkumaPaths;
|
|
169
163
|
seed: Omit<Soul, "createdAt">;
|
|
164
|
+
birthInitiator?: string;
|
|
165
|
+
completion?: Readonly<{
|
|
166
|
+
contractId?: string;
|
|
167
|
+
}>;
|
|
170
168
|
}>;
|
|
171
169
|
export type InitialTellAdmissionRequest = Readonly<{
|
|
172
170
|
id: AkuId;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { isAbsolute, resolve } from "node:path";
|
|
2
2
|
import { allowedActionsSchema } from "./allowed.js";
|
|
3
3
|
import { refuseRequest, reserveRequest } from "./heart/index.js";
|
|
4
|
-
import {
|
|
4
|
+
import { validateAkumaName } from "../identity/normalize.js";
|
|
5
|
+
import { akumaIdSchema } from "./identity.js";
|
|
5
6
|
import { callDiagnostic, executePreparedCall } from "./publication.js";
|
|
6
7
|
import { tellResultSchema } from "./call-initial-tell.js";
|
|
7
8
|
import { providerOptionsSchema, providerRecipeSchema } from "./provider-recipe.js";
|
|
@@ -11,7 +12,7 @@ import { z } from "zod";
|
|
|
11
12
|
const absolutePathSchema = z.string().refine((value) => isAbsolute(value) && resolve(value) === value);
|
|
12
13
|
const archetypeSchema = z.string().transform((value, context) => {
|
|
13
14
|
try {
|
|
14
|
-
return
|
|
15
|
+
return validateAkumaName(value);
|
|
15
16
|
}
|
|
16
17
|
catch {
|
|
17
18
|
context.addIssue({ code: "custom", message: "expected Akuma name" });
|
|
@@ -39,6 +40,8 @@ const akumaCallPayloadSchema = z
|
|
|
39
40
|
world: absolutePathSchema,
|
|
40
41
|
archetype: archetypeSchema,
|
|
41
42
|
initialTell: initialTellSchema.optional(),
|
|
43
|
+
birthInitiator: z.string().optional(),
|
|
44
|
+
contractId: z.string().optional(),
|
|
42
45
|
cwd: absolutePathSchema.optional(),
|
|
43
46
|
recipe: akumaCallRecipeSchema,
|
|
44
47
|
})
|
|
@@ -95,7 +98,11 @@ async function executeAkumaCall(request, facts, capabilities) {
|
|
|
95
98
|
refuse: async (diagnostic) => {
|
|
96
99
|
await refuseRequest(paths, facts.id, diagnostic);
|
|
97
100
|
},
|
|
98
|
-
spawn
|
|
101
|
+
spawn: async (launch) => await spawn({
|
|
102
|
+
...launch,
|
|
103
|
+
...(request.birthInitiator === undefined ? {} : { birthInitiator: request.birthInitiator }),
|
|
104
|
+
...(request.contractId === undefined ? {} : { completion: { contractId: request.contractId } }),
|
|
105
|
+
}),
|
|
99
106
|
admitInitialTell,
|
|
100
107
|
},
|
|
101
108
|
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { WorldRoot } from "../world.js";
|
|
3
|
+
import { type Soul } from "./heart/facts.js";
|
|
4
|
+
export declare const akumaCallerSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
5
|
+
kind: z.ZodLiteral<"akuma">;
|
|
6
|
+
world: z.ZodCustom<WorldRoot, WorldRoot>;
|
|
7
|
+
akuId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identity.js").AkuId, string>>;
|
|
8
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
9
|
+
kind: z.ZodLiteral<"external">;
|
|
10
|
+
integration: z.ZodString;
|
|
11
|
+
id: z.ZodString;
|
|
12
|
+
}, z.core.$strict>], "kind">;
|
|
13
|
+
export type AkumaCaller = z.infer<typeof akumaCallerSchema>;
|
|
14
|
+
export declare const akumaBirthSchema: z.ZodObject<{
|
|
15
|
+
origin: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
16
|
+
kind: z.ZodLiteral<"direct">;
|
|
17
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
18
|
+
kind: z.ZodLiteral<"request">;
|
|
19
|
+
parent: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identity.js").AkuId, string>>;
|
|
20
|
+
requestId: z.ZodString;
|
|
21
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
22
|
+
kind: z.ZodLiteral<"fork">;
|
|
23
|
+
parent: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identity.js").AkuId, string>>;
|
|
24
|
+
at: z.ZodString;
|
|
25
|
+
}, z.core.$strip>], "kind">;
|
|
26
|
+
caller: z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
27
|
+
kind: z.ZodLiteral<"akuma">;
|
|
28
|
+
world: z.ZodCustom<WorldRoot, WorldRoot>;
|
|
29
|
+
akuId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identity.js").AkuId, string>>;
|
|
30
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
31
|
+
kind: z.ZodLiteral<"external">;
|
|
32
|
+
integration: z.ZodString;
|
|
33
|
+
id: z.ZodString;
|
|
34
|
+
}, z.core.$strict>], "kind">, z.ZodObject<{
|
|
35
|
+
kind: z.ZodLiteral<"unknown">;
|
|
36
|
+
}, z.core.$strict>]>;
|
|
37
|
+
}, z.core.$strict>;
|
|
38
|
+
export declare function projectAkumaBirth(soul: Soul): z.infer<typeof akumaBirthSchema>;
|
|
39
|
+
export declare function decodeAkumaCaller(value: unknown): AkumaCaller | undefined;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { isAbsolute, resolve } from "node:path";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { akumaIdSchema } from "./identity.js";
|
|
4
|
+
import { akumaOriginSchema } from "./heart/facts.js";
|
|
5
|
+
// Stored attribution is a coordinate, not a live World capability or lookup.
|
|
6
|
+
const callerWorldSchema = z.custom((value) => typeof value === "string" && isAbsolute(value) && resolve(value) === value, "caller world must be an absolute normalized path");
|
|
7
|
+
export const akumaCallerSchema = z.discriminatedUnion("kind", [
|
|
8
|
+
z.object({ kind: z.literal("akuma"), world: callerWorldSchema, akuId: akumaIdSchema }).strict(),
|
|
9
|
+
z
|
|
10
|
+
.object({
|
|
11
|
+
kind: z.literal("external"),
|
|
12
|
+
integration: z.string().regex(/^[a-z][a-z0-9._-]{0,63}$/u),
|
|
13
|
+
id: z
|
|
14
|
+
.string()
|
|
15
|
+
.max(512)
|
|
16
|
+
.refine((value) => value.trim().length > 0 && !/[\u0000-\u001f\u007f-\u009f]/u.test(value), "external caller id must be nonblank and contain no control characters"),
|
|
17
|
+
})
|
|
18
|
+
.strict(),
|
|
19
|
+
]);
|
|
20
|
+
export const akumaBirthSchema = z
|
|
21
|
+
.object({
|
|
22
|
+
origin: akumaOriginSchema,
|
|
23
|
+
caller: z.union([akumaCallerSchema, z.object({ kind: z.literal("unknown") }).strict()]),
|
|
24
|
+
})
|
|
25
|
+
.strict();
|
|
26
|
+
export function projectAkumaBirth(soul) {
|
|
27
|
+
return { origin: soul.origin, caller: soul.caller ?? { kind: "unknown" } };
|
|
28
|
+
}
|
|
29
|
+
export function decodeAkumaCaller(value) {
|
|
30
|
+
if (value === undefined)
|
|
31
|
+
return undefined;
|
|
32
|
+
const parsed = akumaCallerSchema.safeParse(value);
|
|
33
|
+
if (!parsed.success)
|
|
34
|
+
throw new TypeError(`Invalid Akuma caller: ${parsed.error.message}`);
|
|
35
|
+
return parsed.data;
|
|
36
|
+
}
|
|
@@ -10,4 +10,3 @@ export declare const dispatchAssociationSchema: z.ZodUnion<readonly [z.ZodObject
|
|
|
10
10
|
}, z.core.$strict>]>;
|
|
11
11
|
export type DispatchAssociation = z.infer<typeof dispatchAssociationSchema>;
|
|
12
12
|
export declare const NO_DISPATCH_ASSOCIATION: DispatchAssociation;
|
|
13
|
-
export declare function parseDispatchAssociation(value: unknown): DispatchAssociation;
|
|
@@ -6,6 +6,3 @@ export const dispatchAssociationSchema = z.union([
|
|
|
6
6
|
z.object({ kind: z.literal("failed"), diagnostic: z.string() }).strict(),
|
|
7
7
|
]);
|
|
8
8
|
export const NO_DISPATCH_ASSOCIATION = { kind: "none" };
|
|
9
|
-
export function parseDispatchAssociation(value) {
|
|
10
|
-
return dispatchAssociationSchema.parse(value);
|
|
11
|
-
}
|
|
@@ -24,6 +24,7 @@ export declare const fileChangeSchema: z.ZodObject<{
|
|
|
24
24
|
added: z.ZodNumber;
|
|
25
25
|
removed: z.ZodNumber;
|
|
26
26
|
}, z.core.$strip>>;
|
|
27
|
+
patch: z.ZodOptional<z.ZodString>;
|
|
27
28
|
}, z.core.$strip>;
|
|
28
29
|
export declare const toolCallSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
29
30
|
kind: z.ZodLiteral<"run">;
|
|
@@ -57,6 +58,7 @@ export declare const toolCallSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
57
58
|
added: z.ZodNumber;
|
|
58
59
|
removed: z.ZodNumber;
|
|
59
60
|
}, z.core.$strip>>;
|
|
61
|
+
patch: z.ZodOptional<z.ZodString>;
|
|
60
62
|
}, z.core.$strip>>>;
|
|
61
63
|
}, z.core.$strip>, z.ZodObject<{
|
|
62
64
|
kind: z.ZodLiteral<"other">;
|
|
@@ -72,6 +74,7 @@ export declare const toolResultSchema: z.ZodObject<{
|
|
|
72
74
|
ok: "ok";
|
|
73
75
|
}>;
|
|
74
76
|
message: z.ZodOptional<z.ZodString>;
|
|
77
|
+
output: z.ZodOptional<z.ZodString>;
|
|
75
78
|
exitCode: z.ZodOptional<z.ZodNumber>;
|
|
76
79
|
}, z.core.$strip>;
|
|
77
80
|
declare const toolEventSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -112,6 +115,7 @@ declare const toolEventSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
112
115
|
added: z.ZodNumber;
|
|
113
116
|
removed: z.ZodNumber;
|
|
114
117
|
}, z.core.$strip>>;
|
|
118
|
+
patch: z.ZodOptional<z.ZodString>;
|
|
115
119
|
}, z.core.$strip>>>;
|
|
116
120
|
}, z.core.$strip>, z.ZodObject<{
|
|
117
121
|
kind: z.ZodLiteral<"other">;
|
|
@@ -130,6 +134,7 @@ declare const toolEventSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
130
134
|
ok: "ok";
|
|
131
135
|
}>;
|
|
132
136
|
message: z.ZodOptional<z.ZodString>;
|
|
137
|
+
output: z.ZodOptional<z.ZodString>;
|
|
133
138
|
exitCode: z.ZodOptional<z.ZodNumber>;
|
|
134
139
|
}, z.core.$strip>;
|
|
135
140
|
type: z.ZodLiteral<"tool">;
|
|
@@ -167,6 +172,7 @@ declare const toolEventSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
167
172
|
added: z.ZodNumber;
|
|
168
173
|
removed: z.ZodNumber;
|
|
169
174
|
}, z.core.$strip>>;
|
|
175
|
+
patch: z.ZodOptional<z.ZodString>;
|
|
170
176
|
}, z.core.$strip>>>;
|
|
171
177
|
}, z.core.$strip>, z.ZodObject<{
|
|
172
178
|
kind: z.ZodLiteral<"other">;
|
|
@@ -195,6 +201,9 @@ export declare const agentEventSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
195
201
|
}>>, z.ZodObject<{
|
|
196
202
|
sessionId: z.ZodString;
|
|
197
203
|
}, z.core.$strict>]>;
|
|
204
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
205
|
+
type: z.ZodLiteral<"model">;
|
|
206
|
+
model: z.ZodOptional<z.ZodString>;
|
|
198
207
|
}, z.core.$strip>, z.ZodObject<{
|
|
199
208
|
type: z.ZodLiteral<"assistant">;
|
|
200
209
|
text: z.ZodString;
|
|
@@ -241,6 +250,7 @@ export declare const agentEventSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
241
250
|
added: z.ZodNumber;
|
|
242
251
|
removed: z.ZodNumber;
|
|
243
252
|
}, z.core.$strip>>;
|
|
253
|
+
patch: z.ZodOptional<z.ZodString>;
|
|
244
254
|
}, z.core.$strip>>>;
|
|
245
255
|
}, z.core.$strip>, z.ZodObject<{
|
|
246
256
|
kind: z.ZodLiteral<"other">;
|
|
@@ -259,6 +269,7 @@ export declare const agentEventSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
259
269
|
ok: "ok";
|
|
260
270
|
}>;
|
|
261
271
|
message: z.ZodOptional<z.ZodString>;
|
|
272
|
+
output: z.ZodOptional<z.ZodString>;
|
|
262
273
|
exitCode: z.ZodOptional<z.ZodNumber>;
|
|
263
274
|
}, z.core.$strip>;
|
|
264
275
|
type: z.ZodLiteral<"tool">;
|
|
@@ -296,6 +307,7 @@ export declare const agentEventSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
296
307
|
added: z.ZodNumber;
|
|
297
308
|
removed: z.ZodNumber;
|
|
298
309
|
}, z.core.$strip>>;
|
|
310
|
+
patch: z.ZodOptional<z.ZodString>;
|
|
299
311
|
}, z.core.$strip>>>;
|
|
300
312
|
}, z.core.$strip>, z.ZodObject<{
|
|
301
313
|
kind: z.ZodLiteral<"other">;
|
|
@@ -11,6 +11,7 @@ export const fileChangeSchema = z.object({
|
|
|
11
11
|
op: z.enum(["add", "update", "delete", "unspecified"]),
|
|
12
12
|
path: text,
|
|
13
13
|
diffstat: diffstatSchema.optional(),
|
|
14
|
+
patch: text.optional(),
|
|
14
15
|
});
|
|
15
16
|
export const toolCallSchema = z.union([
|
|
16
17
|
z.object({ kind: z.literal("run"), command: text }),
|
|
@@ -33,6 +34,7 @@ export const toolCallSchema = z.union([
|
|
|
33
34
|
export const toolResultSchema = z.object({
|
|
34
35
|
status: z.enum(["ok", "error"]),
|
|
35
36
|
message: text.optional(),
|
|
37
|
+
output: text.optional(),
|
|
36
38
|
exitCode: z.number().int().safe().optional(),
|
|
37
39
|
});
|
|
38
40
|
const toolFields = { type: z.literal("tool"), id: text, name: text, call: toolCallSchema, truncated };
|
|
@@ -42,6 +44,10 @@ const toolEventSchema = z.union([
|
|
|
42
44
|
]);
|
|
43
45
|
export const agentEventSchema = z.union([
|
|
44
46
|
z.object({ type: z.literal("session"), coordinate: resumeCoordinateSchema }),
|
|
47
|
+
// One provider-neutral runtime-model observation in the shared agent-event
|
|
48
|
+
// vocabulary. Body admits it into the Soul's single current model; it is
|
|
49
|
+
// never appended to activity, so compaction cannot lose or resurrect it.
|
|
50
|
+
z.object({ type: z.literal("model"), model: text.optional() }),
|
|
45
51
|
z.object({ type: z.literal("assistant"), text, truncated }),
|
|
46
52
|
z.object({ type: z.literal("thought"), text, truncated }),
|
|
47
53
|
toolEventSchema,
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AkumaCaller } from "../caller.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { type AkuId } from "../identity.js";
|
|
2
4
|
import type { ResumeCoordinate } from "../coordinate.js";
|
|
3
5
|
import type { ProviderExecution, ProviderOptions } from "../provider-recipe.js";
|
|
4
6
|
import type { AllowedActions } from "../allowed.js";
|
|
@@ -6,17 +8,18 @@ export type { ResumeCoordinate } from "../coordinate.js";
|
|
|
6
8
|
export declare class HeartAuthorityCorruptionError extends Error {
|
|
7
9
|
constructor(message: string, options?: ErrorOptions);
|
|
8
10
|
}
|
|
9
|
-
export
|
|
10
|
-
kind: "direct"
|
|
11
|
-
}
|
|
12
|
-
kind: "request"
|
|
13
|
-
parent: AkuId
|
|
14
|
-
requestId:
|
|
15
|
-
}
|
|
16
|
-
kind: "fork"
|
|
17
|
-
parent: AkuId
|
|
18
|
-
at:
|
|
19
|
-
}>;
|
|
11
|
+
export declare const akumaOriginSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
12
|
+
kind: z.ZodLiteral<"direct">;
|
|
13
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
14
|
+
kind: z.ZodLiteral<"request">;
|
|
15
|
+
parent: z.ZodPipe<z.ZodString, z.ZodTransform<AkuId, string>>;
|
|
16
|
+
requestId: z.ZodString;
|
|
17
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
18
|
+
kind: z.ZodLiteral<"fork">;
|
|
19
|
+
parent: z.ZodPipe<z.ZodString, z.ZodTransform<AkuId, string>>;
|
|
20
|
+
at: z.ZodString;
|
|
21
|
+
}, z.core.$strip>], "kind">;
|
|
22
|
+
export type AkumaOrigin = z.infer<typeof akumaOriginSchema>;
|
|
20
23
|
export type Soul = Readonly<{
|
|
21
24
|
id: AkuId;
|
|
22
25
|
archetype: string;
|
|
@@ -25,6 +28,7 @@ export type Soul = Readonly<{
|
|
|
25
28
|
options: ProviderOptions;
|
|
26
29
|
cwd: string;
|
|
27
30
|
origin: AkumaOrigin;
|
|
31
|
+
caller?: AkumaCaller;
|
|
28
32
|
allowed: AllowedActions;
|
|
29
33
|
createdAt: string;
|
|
30
34
|
}>;
|
|
@@ -1,9 +1,17 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { akumaIdSchema } from "../identity.js";
|
|
1
3
|
export class HeartAuthorityCorruptionError extends Error {
|
|
2
4
|
constructor(message, options) {
|
|
3
5
|
super(message, options);
|
|
4
6
|
this.name = "HeartAuthorityCorruptionError";
|
|
5
7
|
}
|
|
6
8
|
}
|
|
9
|
+
const originText = z.string().refine((value) => value.trim().length > 0);
|
|
10
|
+
export const akumaOriginSchema = z.discriminatedUnion("kind", [
|
|
11
|
+
z.object({ kind: z.literal("direct") }),
|
|
12
|
+
z.object({ kind: z.literal("request"), parent: akumaIdSchema, requestId: originText }),
|
|
13
|
+
z.object({ kind: z.literal("fork"), parent: akumaIdSchema, at: originText }),
|
|
14
|
+
]);
|
|
7
15
|
export function projectTell(fact) {
|
|
8
16
|
return {
|
|
9
17
|
kind: "tell",
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import type { AkumaPaths } from "../identity.js";
|
|
2
2
|
import type { BodyEnd, BodyFact, ForkPoint, HeartSnapshot, KillFact, SealFact, SessionFact, Soul, TellDeliveryInput, TellFact, TellReceiptInput, TurnEndFact, TurnFact, TurnOutcome, TurnStartFact } from "./facts.js";
|
|
3
|
-
export type { CallFact } from "./facts.js";
|
|
4
|
-
import type { ActivityFact } from "./rows.js";
|
|
5
3
|
import type { AgentEvent } from "./activity-schema.js";
|
|
6
4
|
import { type StatusFactInput, type ActivityFactSlice } from "./timeline.js";
|
|
5
|
+
import { type HeartRead } from "./storage.js";
|
|
7
6
|
export { HeartAbsentError, HeldAkumaLeash, classifyHeartSchema, initializeHeart, isHeartAbsent, probeLeash, } from "./storage.js";
|
|
8
7
|
export { admitRequest, beginRequest, isRequestInputConflict, readNonterminalRequests, readRequest, refuseRequest, reserveRequest, serveRequest, serveUpstreamRequest, unproveRequest, voidRequest, } from "./request-authority.js";
|
|
9
8
|
export { AkumaBusyError, life, lifeAt, projectTell } from "./facts.js";
|
|
10
9
|
export { drainPendingTells } from "./tells.js";
|
|
11
|
-
export type { AkumaLife, AkumaOrigin, BodyEnd,
|
|
10
|
+
export type { AkumaLife, AkumaOrigin, BodyEnd, HeartSnapshot, KillEvidence, RequestFact, SessionFact, Soul, TellFact, TurnEndFact, TurnOutcome, } from "./facts.js";
|
|
12
11
|
export type { ResumeCoordinate } from "../coordinate.js";
|
|
13
12
|
export declare function readSoul(paths: AkumaPaths): Promise<Soul | null>;
|
|
14
13
|
export declare function heartExists(paths: AkumaPaths): Promise<boolean>;
|
|
@@ -19,13 +18,63 @@ export declare function appendActivity(paths: AkumaPaths, input: Readonly<{
|
|
|
19
18
|
event: AgentEvent;
|
|
20
19
|
at: string;
|
|
21
20
|
}>): Promise<number>;
|
|
22
|
-
|
|
23
|
-
export type { ActivityFact };
|
|
21
|
+
type ActivitySlice = ActivityFactSlice;
|
|
24
22
|
export type { TimelineFact } from "./timeline.js";
|
|
23
|
+
export type CurrentModelUpdate = "recorded" | "unchanged" | "not-current-body";
|
|
24
|
+
/**
|
|
25
|
+
* Admit one runtime-model observation from the Body that is actually running.
|
|
26
|
+
* The model is the one mutable member of an otherwise frozen recipe, so only
|
|
27
|
+
* the exact latest Running Body may move it: evidence that arrives after that
|
|
28
|
+
* Body settled, or from a superseded Body, is refused rather than applied.
|
|
29
|
+
*/
|
|
30
|
+
export declare function recordCurrentModel(paths: AkumaPaths, input: Readonly<{
|
|
31
|
+
bodySequence: number;
|
|
32
|
+
model: string | undefined;
|
|
33
|
+
}>): Promise<CurrentModelUpdate>;
|
|
25
34
|
export declare function activitySlice(paths: AkumaPaths): Promise<ActivitySlice>;
|
|
26
35
|
export declare function readStatusFacts(paths: AkumaPaths, input: StatusFactInput, signal?: AbortSignal): Promise<ActivitySlice["rows"]>;
|
|
27
|
-
/** One live observation's
|
|
36
|
+
/** One live observation's current retained timeline, or a no-change witness. */
|
|
37
|
+
export type TimelineRead = Readonly<{
|
|
38
|
+
changed: false;
|
|
39
|
+
}> | Readonly<{
|
|
40
|
+
changed: true;
|
|
41
|
+
born: boolean;
|
|
42
|
+
slice: ActivityFactSlice;
|
|
43
|
+
}>;
|
|
44
|
+
/**
|
|
45
|
+
* One operation-owned reader of the retained timeline. It keeps its read
|
|
46
|
+
* custody between observations, skips decoding when the same connection's
|
|
47
|
+
* change counter still names the observed snapshot, and renews that gate
|
|
48
|
+
* whenever a replaced Heart gives it a new connection.
|
|
49
|
+
*/
|
|
50
|
+
export declare function createTimelineReader(paths: AkumaPaths): Readonly<{
|
|
51
|
+
read(signal?: AbortSignal): Promise<TimelineRead>;
|
|
52
|
+
clear(): void;
|
|
53
|
+
}>;
|
|
54
|
+
/** One observer owns its connection and successful decoded frontier. */
|
|
28
55
|
export declare function createStatusFactReader(paths: AkumaPaths): {
|
|
56
|
+
life: (signal?: AbortSignal) => Promise<LifeSnapshot>;
|
|
57
|
+
tellOutcome: (id: string, signal?: AbortSignal) => Promise<{
|
|
58
|
+
tell: Readonly<{
|
|
59
|
+
kind: "tell";
|
|
60
|
+
sequence: number;
|
|
61
|
+
id: string;
|
|
62
|
+
body: string;
|
|
63
|
+
initiator?: string;
|
|
64
|
+
schemaJson?: string;
|
|
65
|
+
recordedAt: string;
|
|
66
|
+
state: "pending" | "told";
|
|
67
|
+
deliveries: readonly import("./facts.js").TellDelivery[];
|
|
68
|
+
binding?: import("./facts.js").TellBinding;
|
|
69
|
+
}> | null;
|
|
70
|
+
end: Readonly<{
|
|
71
|
+
kind: "turn-end";
|
|
72
|
+
sequence: number;
|
|
73
|
+
turnSequence: number;
|
|
74
|
+
outcome: TurnOutcome;
|
|
75
|
+
completedAt: string;
|
|
76
|
+
}> | undefined;
|
|
77
|
+
}>;
|
|
29
78
|
clear(): void;
|
|
30
79
|
read(input: StatusFactInput, signal?: AbortSignal): Promise<ActivitySlice["rows"]>;
|
|
31
80
|
};
|
|
@@ -33,7 +82,7 @@ type LifeSnapshot = Pick<HeartSnapshot, "soul" | "latestBody" | "latestSession"
|
|
|
33
82
|
hasPendingTell: boolean;
|
|
34
83
|
}>;
|
|
35
84
|
/** Lifecycle probes do not load narration, Tell bodies, or delivery histories. */
|
|
36
|
-
export declare function readLifeSnapshot(paths: AkumaPaths, signal?: AbortSignal): Promise<LifeSnapshot>;
|
|
85
|
+
export declare function readLifeSnapshot(paths: AkumaPaths, signal?: AbortSignal, read?: HeartRead): Promise<LifeSnapshot>;
|
|
37
86
|
export declare function recordTell(paths: AkumaPaths, tell: Omit<TellFact, "sequence" | "state" | "deliveries" | "binding">, options?: Readonly<{
|
|
38
87
|
interrupt?: boolean;
|
|
39
88
|
}>): Promise<Readonly<{
|
|
@@ -74,8 +123,6 @@ export declare function requestPause(paths: AkumaPaths, at: string, signal?: Abo
|
|
|
74
123
|
kind: "requested";
|
|
75
124
|
body: BodyFact;
|
|
76
125
|
}>>;
|
|
77
|
-
export declare function stopRequested(paths: AkumaPaths, bodySequence?: number): Promise<boolean>;
|
|
78
|
-
export declare function pauseRequested(paths: AkumaPaths, bodySequence?: number): Promise<boolean>;
|
|
79
126
|
export declare function breakBody(paths: AkumaPaths, input: Readonly<{
|
|
80
127
|
sequence: number;
|
|
81
128
|
end: Exclude<BodyEnd, "exited">;
|
|
@@ -116,6 +163,11 @@ export declare function finishBodyIfIdle(paths: AkumaPaths, input: Readonly<{
|
|
|
116
163
|
kind: "pending";
|
|
117
164
|
tells: readonly string[];
|
|
118
165
|
}>>;
|
|
166
|
+
export type BodyControlSnapshot = Pick<HeartSnapshot, "soul" | "pending" | "stop" | "pause">;
|
|
167
|
+
export declare function createBodyHeartReader(paths: AkumaPaths): {
|
|
168
|
+
clear: () => void;
|
|
169
|
+
read(): Promise<BodyControlSnapshot>;
|
|
170
|
+
};
|
|
119
171
|
export declare function readHeart(paths: AkumaPaths): Promise<HeartSnapshot>;
|
|
120
172
|
export declare function readLastAnsweredTurn(paths: AkumaPaths): Promise<TurnFact | null>;
|
|
121
173
|
export declare function readForkPoint(paths: AkumaPaths, historyId: string): Promise<ForkPoint | null>;
|