@astrosheep/keiyaku 4.5.11 → 4.5.13
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/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku-workflow/SKILL.md +135 -377
- package/build/integrations/pi/keiyaku.ts +11 -116
- package/build/src/akuma/akuma-errors.d.ts +1 -0
- package/build/src/akuma/akuma-errors.js +1 -0
- package/build/src/akuma/akuma-handle.d.ts +1 -0
- package/build/src/akuma/akuma-handle.js +6 -7
- package/build/src/akuma/akuma-product.d.ts +6 -8
- package/build/src/akuma/akuma-product.js +141 -57
- package/build/src/akuma/akuma.d.ts +5 -7
- package/build/src/akuma/akuma.js +1 -22
- package/build/src/akuma/archetype.d.ts +6 -5
- package/build/src/akuma/archetype.js +137 -38
- package/build/src/akuma/body.d.ts +5 -5
- package/build/src/akuma/body.js +223 -63
- package/build/src/akuma/call-input.d.ts +4 -0
- package/build/src/akuma/call-input.js +21 -0
- package/build/src/akuma/call-request.d.ts +5 -8
- package/build/src/akuma/call-request.js +28 -73
- package/build/src/akuma/fleet-execution.d.ts +26 -0
- package/build/src/akuma/fleet-execution.js +109 -0
- package/build/src/{library/fleet-result.d.ts → akuma/fleet-observation.d.ts} +13 -57
- package/build/src/{library/fleet-result.js → akuma/fleet-observation.js} +4 -25
- package/build/src/akuma/fleet-request.d.ts +122 -0
- package/build/src/akuma/fleet-request.js +168 -0
- package/build/src/akuma/heart/facts.d.ts +23 -0
- package/build/src/akuma/heart/facts.js +7 -0
- package/build/src/akuma/heart/index.d.ts +43 -4
- package/build/src/akuma/heart/index.js +107 -7
- package/build/src/akuma/heart/request-authority.d.ts +2 -0
- package/build/src/akuma/heart/request-authority.js +28 -3
- package/build/src/akuma/heart/request-rows.d.ts +2 -0
- package/build/src/akuma/heart/request-rows.js +24 -5
- package/build/src/akuma/heart/rows.d.ts +4 -1
- package/build/src/akuma/heart/rows.js +46 -19
- package/build/src/akuma/heart/schema.d.ts +1 -1
- package/build/src/akuma/heart/schema.js +28 -6
- package/build/src/akuma/heart/storage.d.ts +1 -1
- package/build/src/akuma/heart/tells.d.ts +29 -0
- package/build/src/akuma/heart/tells.js +136 -5
- package/build/src/akuma/heart/timeline.js +9 -3
- package/build/src/akuma/projection-read.js +36 -3
- package/build/src/akuma/projection.js +3 -4
- package/build/src/akuma/provider.d.ts +4 -0
- package/build/src/akuma/provider.js +56 -3
- package/build/src/akuma/providers/claude/index.js +3 -0
- package/build/src/akuma/providers/codex-app-server/index.js +14 -12
- package/build/src/akuma/providers/pi/index.js +7 -1
- package/build/src/akuma/publication.js +65 -49
- package/build/src/akuma/request-lifecycle.d.ts +5 -4
- package/build/src/akuma/request-lifecycle.js +29 -16
- package/build/src/akuma/request-rendezvous.d.ts +15 -12
- package/build/src/akuma/request-rendezvous.js +80 -51
- package/build/src/akuma/request-serve.d.ts +1 -2
- package/build/src/akuma/request-serve.js +94 -39
- package/build/src/akuma/request-wire.d.ts +57 -26
- package/build/src/akuma/request-wire.js +64 -25
- package/build/src/akuma/turn-drive.d.ts +5 -4
- package/build/src/akuma/turn-drive.js +27 -11
- package/build/src/akuma-body.d.ts +4 -6
- package/build/src/akuma-body.js +19 -17
- package/build/src/bounded-list.d.ts +8 -0
- package/build/src/bounded-list.js +14 -0
- package/build/src/cli/accepted.d.ts +1 -1
- package/build/src/cli/accepted.js +1 -0
- package/build/src/cli/commands/akuma-invoke.js +1 -25
- package/build/src/cli/commands/contract-help.d.ts +5 -2
- package/build/src/cli/commands/contract-help.js +62 -12
- package/build/src/cli/commands/contract-invoke.d.ts +5 -0
- package/build/src/cli/commands/contract-invoke.js +26 -1
- package/build/src/cli/commands/contract.js +50 -18
- package/build/src/cli/commands/task-invoke.js +10 -2
- package/build/src/cli/commands/task-query.js +3 -4
- package/build/src/cli/coordinates.d.ts +13 -0
- package/build/src/cli/coordinates.js +38 -24
- package/build/src/cli/draft.d.ts +1 -1
- package/build/src/cli/invoke.js +14 -1
- package/build/src/cli/render/akuma-activity.d.ts +0 -1
- package/build/src/cli/render/akuma-activity.js +5 -38
- package/build/src/cli/render/akuma.js +4 -1
- package/build/src/cli/render/audit.js +4 -1
- package/build/src/cli/render/catalog.js +13 -39
- package/build/src/cli/render/contract.js +4 -14
- package/build/src/cli/render/kanshi-akuma.js +3 -8
- package/build/src/cli/render/kanshi.js +8 -34
- package/build/src/cli/render/nuke.js +7 -3
- package/build/src/cli/render/receipt.d.ts +1 -0
- package/build/src/cli/render/receipt.js +8 -0
- package/build/src/cli/render/refusal.js +4 -3
- package/build/src/cli/render/task.js +4 -37
- package/build/src/cli/render/terminal.d.ts +2 -6
- package/build/src/cli/render/terminal.js +4 -9
- package/build/src/cli/result.d.ts +2 -1
- package/build/src/contract-guidance.js +13 -3
- package/build/src/contract-worktree.d.ts +1 -0
- package/build/src/contract-worktree.js +26 -2
- package/build/src/core/facts/codec.d.ts +2 -1
- package/build/src/core/facts/codec.js +3 -0
- package/build/src/core/facts/gate.d.ts +2 -1
- package/build/src/core/facts/gate.js +63 -0
- package/build/src/core/verbs/abandon.d.ts +2 -1
- package/build/src/core/verbs/abandon.js +16 -0
- package/build/src/core/verbs/amend.d.ts +2 -1
- package/build/src/core/verbs/amend.js +20 -0
- package/build/src/core/verbs/arc.d.ts +2 -1
- package/build/src/core/verbs/arc.js +16 -0
- package/build/src/core/verbs/attestation.d.ts +2 -1
- package/build/src/core/verbs/attestation.js +16 -0
- package/build/src/core/verbs/bind.d.ts +2 -1
- package/build/src/core/verbs/bind.js +16 -0
- package/build/src/core/verbs/deliver.d.ts +2 -1
- package/build/src/core/verbs/deliver.js +16 -0
- package/build/src/core/verbs/placement.d.ts +2 -1
- package/build/src/core/verbs/placement.js +58 -1
- package/build/src/dispatch/association.d.ts +13 -0
- package/build/src/dispatch/association.js +20 -0
- package/build/src/dispatch/index.d.ts +6 -0
- package/build/src/dispatch/index.js +27 -3
- package/build/src/git/hooks.d.ts +9 -1
- package/build/src/git/hooks.js +79 -1
- package/build/src/git/nuke.d.ts +2 -1
- package/build/src/git/nuke.js +6 -11
- package/build/src/git/private-state-seat.d.ts +26 -1
- package/build/src/git/private-state-seat.js +78 -13
- package/build/src/git/process.d.ts +2 -0
- package/build/src/git/reconcile.d.ts +1 -2
- package/build/src/git/reconcile.js +0 -6
- package/build/src/git/repository.d.ts +0 -2
- package/build/src/git/repository.js +27 -25
- package/build/src/git/result-codec.d.ts +29 -0
- package/build/src/git/result-codec.js +306 -0
- package/build/src/git/target-placement.js +2 -8
- package/build/src/git/workspace.d.ts +2 -0
- package/build/src/git/workspace.js +4 -0
- package/build/src/index.d.ts +1 -0
- package/build/src/kanshi/fleet.js +1 -1
- package/build/src/kanshi/read.js +55 -28
- package/build/src/kanshi/report.d.ts +4 -3
- package/build/src/kanshi/select.js +14 -1
- package/build/src/library/address.d.ts +1 -0
- package/build/src/library/address.js +4 -7
- package/build/src/library/akuma-creation.d.ts +5 -3
- package/build/src/library/akuma-creation.js +90 -33
- package/build/src/library/audit.js +2 -1
- package/build/src/library/catalog.d.ts +10 -2
- package/build/src/library/catalog.js +65 -25
- package/build/src/library/composition.d.ts +1 -0
- package/build/src/library/composition.js +1 -0
- package/build/src/library/configuration.d.ts +4 -21
- package/build/src/library/configuration.js +2 -158
- package/build/src/library/continuation.d.ts +20 -1
- package/build/src/library/continuation.js +36 -0
- package/build/src/library/contract-bind.d.ts +1 -0
- package/build/src/library/contract-bind.js +16 -5
- package/build/src/library/contract-forwarding.d.ts +2 -2
- package/build/src/library/contract-forwarding.js +18 -4
- package/build/src/library/contract-handle.js +4 -3
- package/build/src/library/contract-operations.d.ts +5 -9
- package/build/src/library/contract-operations.js +34 -47
- package/build/src/library/contract.d.ts +11 -2
- package/build/src/library/contract.js +21 -1
- package/build/src/library/delivery.d.ts +4 -1
- package/build/src/library/delivery.js +47 -0
- package/build/src/library/fleet.d.ts +4 -136
- package/build/src/library/fleet.js +31 -315
- package/build/src/library/keiyaku.d.ts +7 -3
- package/build/src/library/keiyaku.js +1 -0
- package/build/src/library/mutation.d.ts +431 -3
- package/build/src/library/mutation.js +192 -19
- package/build/src/library/nuke.d.ts +7 -1
- package/build/src/library/nuke.js +18 -4
- package/build/src/library/reconcile.d.ts +14 -0
- package/build/src/library/reconcile.js +22 -8
- package/build/src/library/refusal.d.ts +9 -1
- package/build/src/library/refusal.js +76 -0
- package/build/src/library/region.d.ts +0 -8
- package/build/src/library/region.js +1 -29
- package/build/src/library/result-codec.d.ts +2 -0
- package/build/src/library/result-codec.js +12 -0
- package/build/src/markdown/lex.js +9 -2
- package/build/src/markdown/types.d.ts +2 -1
- package/build/src/markdown/types.js +3 -1
- package/build/src/plugin/akuma-signals.d.ts +12 -0
- package/build/src/plugin/akuma-signals.js +14 -0
- package/build/src/plugin/public.d.ts +51 -0
- package/build/src/plugin/public.js +1 -0
- package/build/src/plugin/runtime.d.ts +14 -0
- package/build/src/plugin/runtime.js +357 -0
- package/build/src/protocol/amend.js +3 -3
- package/build/src/protocol/attempt.d.ts +2 -1
- package/build/src/protocol/attempt.js +1 -1
- package/build/src/protocol/audit.d.ts +1 -1
- package/build/src/protocol/audit.js +1 -1
- package/build/src/protocol/bind.d.ts +3 -1
- package/build/src/protocol/bind.js +26 -0
- package/build/src/protocol/completion.js +0 -1
- package/build/src/protocol/deliver.d.ts +1 -1
- package/build/src/protocol/deliver.js +136 -57
- package/build/src/protocol/intent.d.ts +0 -1
- package/build/src/protocol/intent.js +0 -1
- package/build/src/protocol/operations.d.ts +9 -2
- package/build/src/protocol/operations.js +16 -1
- package/build/src/protocol/outcome.d.ts +3 -0
- package/build/src/protocol/outcome.js +17 -1
- package/build/src/protocol/placement.js +10 -3
- package/build/src/protocol/read/status.d.ts +8 -0
- package/build/src/protocol/read/status.js +49 -0
- package/build/src/protocol/reintegrate.js +10 -3
- package/build/src/protocol/result-codec.d.ts +22 -0
- package/build/src/protocol/result-codec.js +442 -0
- package/build/src/protocol/review.d.ts +1 -1
- package/build/src/protocol/review.js +81 -46
- package/build/src/protocol/run.d.ts +22 -2
- package/build/src/protocol/run.js +119 -29
- package/build/src/runtime/proc/lifecycle.js +1 -1
- package/build/src/runtime/proc/line-rpc.d.ts +7 -1
- package/build/src/runtime/proc/line-rpc.js +49 -9
- package/build/src/runtime/proc/run.d.ts +0 -1
- package/build/src/runtime/proc/run.js +1 -11
- package/build/src/runtime/proc/termination.d.ts +1 -0
- package/build/src/runtime/proc/termination.js +63 -18
- package/build/src/runtime/proc/windows-launch.exe +0 -0
- package/build/src/settings.d.ts +10 -0
- package/build/src/settings.js +88 -2
- package/build/src/settlement/result-codec.d.ts +2 -0
- package/build/src/settlement/result-codec.js +56 -0
- package/build/src/settlement/settle.d.ts +5 -12
- package/build/src/settlement/settle.js +60 -55
- package/build/src/task/board.d.ts +3 -0
- package/build/src/task/board.js +22 -4
- package/build/src/task/catalog.d.ts +13 -2
- package/build/src/task/catalog.js +59 -5
- package/build/src/task/compose.d.ts +4 -2
- package/build/src/task/compose.js +56 -30
- package/build/src/task/created-observation.d.ts +39 -0
- package/build/src/task/created-observation.js +26 -0
- package/build/src/task/identity.d.ts +6 -0
- package/build/src/task/identity.js +48 -7
- package/build/src/task/index.d.ts +4 -3
- package/build/src/task/index.js +19 -16
- package/build/src/task/input.d.ts +3 -1
- package/build/src/task/input.js +7 -4
- package/build/src/task/lifecycle-operations.d.ts +6 -0
- package/build/src/task/lifecycle-operations.js +116 -0
- package/build/src/task/mutation-result.d.ts +762 -20
- package/build/src/task/mutation-result.js +34 -9
- package/build/src/task/mutation.d.ts +4 -9
- package/build/src/task/mutation.js +17 -52
- package/build/src/task/operation-types.d.ts +114 -0
- package/build/src/task/operation-types.js +1 -0
- package/build/src/task/operations.d.ts +6 -113
- package/build/src/task/operations.js +75 -117
- package/build/src/task/query.d.ts +8 -11
- package/build/src/task/query.js +7 -14
- package/build/src/task/store.d.ts +11 -1
- package/build/src/task/store.js +169 -55
- package/build/src/task/view.d.ts +4 -0
- package/build/src/task/view.js +7 -0
- package/build/src/verification/declaration.d.ts +1 -0
- package/build/src/verification/declaration.js +18 -1
- package/build/src/verification/execution.d.ts +0 -1
- package/build/src/verification/execution.js +5 -5
- package/build/src/world.d.ts +0 -2
- package/build/src/world.js +3 -7
- package/package.json +17 -5
- package/build/src/cli/square-edge.d.ts +0 -7
- package/build/src/cli/square-edge.js +0 -159
- package/build/src/git/ref-migration.d.ts +0 -22
- package/build/src/git/ref-migration.js +0 -55
- package/build/src/library/contract-forwarding-reconciliation-result.d.ts +0 -102
- package/build/src/library/contract-forwarding-reconciliation-result.js +0 -92
- package/build/src/library/contract-forwarding-result.d.ts +0 -4270
- package/build/src/library/contract-forwarding-result.js +0 -521
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { contractId, snapshotId } from "../core/facts/types.js";
|
|
2
2
|
import { requestBodyCommand } from "../akuma/request-rendezvous.js";
|
|
3
|
-
import { eraseRequestCommand } from "../akuma/request-wire.js";
|
|
4
|
-
import { auditReportSchema, auditResultSchema,
|
|
3
|
+
import { eraseRequestCommand, } from "../akuma/request-wire.js";
|
|
4
|
+
import { auditReportSchema, auditResultSchema, deliveryResultSchema, reviewResultSchema, } from "./mutation.js";
|
|
5
|
+
import { decodeContractLiveFailure, encodeContractLiveFailure } from "./refusal.js";
|
|
5
6
|
import { isAbsolute, resolve } from "node:path";
|
|
6
7
|
import { z } from "zod";
|
|
7
8
|
const absolutePathSchema = z.string().refine((value) => isAbsolute(value) && resolve(value) === value);
|
|
@@ -85,31 +86,6 @@ const contractServiceSchema = z.union([
|
|
|
85
86
|
materializedHandoffServiceSchema,
|
|
86
87
|
reviewReferenceSchema,
|
|
87
88
|
]);
|
|
88
|
-
function decodeContractExecutionContext(value) {
|
|
89
|
-
const context = contractPayload(value);
|
|
90
|
-
if (context === null ||
|
|
91
|
-
typeof context.requester !== "string" ||
|
|
92
|
-
context.requester.trim() === "" ||
|
|
93
|
-
!isAbortSignal(context.signal) ||
|
|
94
|
-
!isContractRequestPort(context.upstream))
|
|
95
|
-
throw new Error("invalid Contract execution context");
|
|
96
|
-
return { requester: context.requester, signal: context.signal, upstream: context.upstream };
|
|
97
|
-
}
|
|
98
|
-
function isAbortSignal(value) {
|
|
99
|
-
return (value !== null &&
|
|
100
|
-
typeof value === "object" &&
|
|
101
|
-
typeof value.throwIfAborted === "function");
|
|
102
|
-
}
|
|
103
|
-
function isContractRequestPort(value) {
|
|
104
|
-
const port = contractPayload(value);
|
|
105
|
-
return (port !== null &&
|
|
106
|
-
(typeof port.audit === "function" || typeof port.deliver === "function" || typeof port.review === "function"));
|
|
107
|
-
}
|
|
108
|
-
function contractPayload(value) {
|
|
109
|
-
return value !== null && typeof value === "object" && !Array.isArray(value)
|
|
110
|
-
? value
|
|
111
|
-
: null;
|
|
112
|
-
}
|
|
113
89
|
function decodeContractRequest(action, value) {
|
|
114
90
|
const schema = action === "contract.audit"
|
|
115
91
|
? auditRequestSchema
|
|
@@ -145,11 +121,13 @@ function decodeContractReference(action, value) {
|
|
|
145
121
|
throw new Error(`malformed stored Contract service evidence for ${action}`);
|
|
146
122
|
return parsed.data;
|
|
147
123
|
}
|
|
148
|
-
async function executeContractRequest(request,
|
|
124
|
+
async function executeContractRequest(request, facts, port) {
|
|
149
125
|
if (request.action === "contract.audit") {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
126
|
+
const served = await port.audit({
|
|
127
|
+
...request,
|
|
128
|
+
requester: facts.requester,
|
|
129
|
+
signal: facts.signal,
|
|
130
|
+
});
|
|
153
131
|
if (served.auditReport === undefined)
|
|
154
132
|
throw new Error(`Contract ${request.action} completed without durable service evidence`);
|
|
155
133
|
return {
|
|
@@ -163,9 +141,11 @@ async function executeContractRequest(request, context) {
|
|
|
163
141
|
};
|
|
164
142
|
}
|
|
165
143
|
if (request.action === "contract.deliver") {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
144
|
+
const served = await port.deliver({
|
|
145
|
+
...request,
|
|
146
|
+
requester: facts.requester,
|
|
147
|
+
signal: facts.signal,
|
|
148
|
+
});
|
|
169
149
|
if ("kind" in served.result && served.result.kind === "integration-conflict-materialized") {
|
|
170
150
|
return {
|
|
171
151
|
result: served.result,
|
|
@@ -191,9 +171,11 @@ async function executeContractRequest(request, context) {
|
|
|
191
171
|
},
|
|
192
172
|
};
|
|
193
173
|
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
174
|
+
const served = await port.review({
|
|
175
|
+
...request,
|
|
176
|
+
requester: facts.requester,
|
|
177
|
+
signal: facts.signal,
|
|
178
|
+
});
|
|
197
179
|
if (served.reviewFactId === undefined)
|
|
198
180
|
throw new Error(`Contract ${request.action} completed without durable service evidence`);
|
|
199
181
|
return {
|
|
@@ -217,7 +199,7 @@ function decodedContractResult(action, value) {
|
|
|
217
199
|
throw new Error(`transport integrity: Contract ${action} returned an invalid live result`);
|
|
218
200
|
return parsed.data;
|
|
219
201
|
}
|
|
220
|
-
export function
|
|
202
|
+
export function contractRequestProtocol(action) {
|
|
221
203
|
return {
|
|
222
204
|
action,
|
|
223
205
|
encodeRequest: (request) => {
|
|
@@ -229,24 +211,29 @@ export function contractRequestCommand(action) {
|
|
|
229
211
|
decodeResult: (value) => decodedContractResult(action, value),
|
|
230
212
|
encodeFailure: encodeContractLiveFailure,
|
|
231
213
|
decodeFailure: decodeContractLiveFailure,
|
|
214
|
+
decodeReference: (reference) => decodeContractReference(action, reference),
|
|
215
|
+
isPermitted: (allowed) => allowed.includes(action),
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
export function contractRequestCommand(action, port) {
|
|
219
|
+
return {
|
|
220
|
+
completion: "service",
|
|
221
|
+
protocol: contractRequestProtocol(action),
|
|
232
222
|
encodeService: (service) => service,
|
|
233
223
|
decodeService: (service) => decodeContractService(action, service),
|
|
234
224
|
projectService: (service) => projectContractService(action, service),
|
|
235
|
-
|
|
236
|
-
isPermitted: (allowed) => allowed.includes(action),
|
|
237
|
-
decodeExecutionContext: decodeContractExecutionContext,
|
|
238
|
-
execute: executeContractRequest,
|
|
225
|
+
execute: async (request, facts) => await executeContractRequest(request, facts, port),
|
|
239
226
|
};
|
|
240
227
|
}
|
|
241
|
-
export function contractRequestCommands() {
|
|
228
|
+
export function contractRequestCommands(port) {
|
|
242
229
|
return {
|
|
243
|
-
"contract.audit": eraseRequestCommand(contractRequestCommand("contract.audit")),
|
|
244
|
-
"contract.deliver": eraseRequestCommand(contractRequestCommand("contract.deliver")),
|
|
245
|
-
"contract.review": eraseRequestCommand(contractRequestCommand("contract.review")),
|
|
230
|
+
"contract.audit": eraseRequestCommand(contractRequestCommand("contract.audit", port)),
|
|
231
|
+
"contract.deliver": eraseRequestCommand(contractRequestCommand("contract.deliver", port)),
|
|
232
|
+
"contract.review": eraseRequestCommand(contractRequestCommand("contract.review", port)),
|
|
246
233
|
};
|
|
247
234
|
}
|
|
248
235
|
export async function requestForwardedContractLive(input) {
|
|
249
|
-
const command =
|
|
236
|
+
const command = contractRequestProtocol(input.action);
|
|
250
237
|
const response = await requestBodyCommand({
|
|
251
238
|
directory: input.directory,
|
|
252
239
|
command,
|
|
@@ -4,15 +4,18 @@ import type { RegionOverlap } from "./region.js";
|
|
|
4
4
|
import { type ChangeId, type FactKind, type ContractId, type ContractState, type SnapshotId } from "../core/facts/types.js";
|
|
5
5
|
export { AuthorityCorruptionError } from "../core/facts/errors.js";
|
|
6
6
|
import { type PlacementStop, type VerificationStop, type DeliveryPreparationRefusal } from "../protocol/operations.js";
|
|
7
|
-
import type { ContractBoard, ContractDisposition, ContractGateCurrent, ContractGateReport, ContractObservation, ContractPhase, ContractRow, AfterEndpointObservation, ContractAfterEdge, ContractDependent, ContractWorkspaceObservation } from "../protocol/read/status.js";
|
|
7
|
+
import type { ContractBoard, ContractCatalogue, ContractDisposition, ContractGateCurrent, ContractGateReport, ContractObservation, ContractPhase, ContractRow, AfterEndpointObservation, ContractAfterEdge, ContractDependent, ContractWorkspaceObservation } from "../protocol/read/status.js";
|
|
8
8
|
import type { AuditReport } from "../protocol/audit.js";
|
|
9
9
|
import type { IntegrationConflictMaterialized, VerificationReuse } from "../protocol/deliver.js";
|
|
10
10
|
import type { TaskId } from "../task/identity.js";
|
|
11
|
+
import { type Repo } from "./repo.js";
|
|
11
12
|
import { type ExecutionContext } from "../akuma/requests.js";
|
|
12
13
|
import type { AuditInput } from "./audit.js";
|
|
13
14
|
import { Delivery } from "./delivery.js";
|
|
14
15
|
import { type ContinuationReport } from "./continuation.js";
|
|
15
16
|
import type { MutationResult } from "./mutation.js";
|
|
17
|
+
export { projectMutationFinality } from "./mutation.js";
|
|
18
|
+
export type { MutationFinality, MutationFinalityInput, MutationFinalitySurface, MutationPendingSurface, } from "./mutation.js";
|
|
16
19
|
export { KeiyakuHandle } from "./contract-handle.js";
|
|
17
20
|
import { KeiyakuHandle } from "./contract-handle.js";
|
|
18
21
|
import type { AbandonInput, AmendInput, AmendResult, ArcInput, BindInput, BindResult, ContractListInput, ContractObservationInput, DeliverInput, ForkBindInput, KeiyakuOfInput, LocalContractComposition, MarkdownBindInput, ReconcileReport, ReviewInput, ContractHistory, ContractHistoryEvent, Fact, Lag, TopologyEffect } from "./contract-types.js";
|
|
@@ -22,7 +25,7 @@ export { KeiyakuRefused } from "./refusal.js";
|
|
|
22
25
|
export { KeiyakuRetry, type KeiyakuRefusal, type KeiyakuRetryReason };
|
|
23
26
|
export { gatesFrom, requireBranchesToBeUpToDateFrom, SettingsError } from "./configuration.js";
|
|
24
27
|
export type { Gate, GatesFromInput, HookCommand, RequireBranchesToBeUpToDateFromInput, WorktreeHooks, } from "./configuration.js";
|
|
25
|
-
export type { AbandonInput, AmendInput, AmendResult, ArcInput, AuditInput, AuditReport, ChangeId, ContinuationReport, ContractBoard, ContractDisposition, ContractGateCurrent, ContractGateReport, ContractAfterEdge, ContractId, ContractHistory, ContractHistoryEvent, ContractDependent, ContractObservation, ContractPhase, ContractRow, ContractState, ContractWorkspaceObservation, BindInput, BindResult, ContractListInput, ContractObservationInput, DeliverInput, ForkBindInput, KeiyakuOfInput, MarkdownBindInput, ReconcileReport, ReviewInput, DeliveryPreparationRefusal, Fact, FactKind, IntegrationConflictMaterialized, Lag, LocalContractComposition, MutationResult, PlacementStop, RegionOverlap, SnapshotId, TaskId, TopologyEffect, VerificationReuse, VerificationStop, };
|
|
28
|
+
export type { AbandonInput, AmendInput, AmendResult, ArcInput, AuditInput, AuditReport, ChangeId, ContinuationReport, ContractBoard, ContractCatalogue, ContractDisposition, ContractGateCurrent, ContractGateReport, ContractAfterEdge, ContractId, ContractHistory, ContractHistoryEvent, ContractDependent, ContractObservation, ContractPhase, ContractRow, ContractState, ContractWorkspaceObservation, BindInput, BindResult, ContractListInput, ContractObservationInput, DeliverInput, ForkBindInput, KeiyakuOfInput, MarkdownBindInput, ReconcileReport, ReviewInput, DeliveryPreparationRefusal, Fact, FactKind, IntegrationConflictMaterialized, Lag, LocalContractComposition, MutationResult, PlacementStop, RegionOverlap, SnapshotId, TaskId, TopologyEffect, VerificationReuse, VerificationStop, };
|
|
26
29
|
export type { AfterEndpointObservation };
|
|
27
30
|
export type ActorId = string;
|
|
28
31
|
export type AttestationVerdict = OperationAttestationVerdict;
|
|
@@ -38,7 +41,13 @@ export type LocalContractCompositionCapture = Readonly<{
|
|
|
38
41
|
export declare function captureLocalContractComposition(input?: LocalContractComposition): LocalContractCompositionCapture;
|
|
39
42
|
export declare function keiyakuOf(input: KeiyakuOfInput, execution?: ExecutionContext, composition?: LocalContractCompositionCapture): Keiyaku;
|
|
40
43
|
export declare function listKeiyaku(input: ContractListInput): Promise<ContractBoard>;
|
|
44
|
+
/** Internal bounded catalogue composition; the public Contract board remains complete. */
|
|
45
|
+
export declare function listContractCatalogue(input: Readonly<{
|
|
46
|
+
repo: Repo;
|
|
47
|
+
limit?: number;
|
|
48
|
+
}>): Promise<ContractCatalogue>;
|
|
41
49
|
export declare function observeKeiyaku(input: ContractObservationInput): Promise<ContractObservation>;
|
|
42
50
|
export declare function bindKeiyaku(input: BindInput, execution?: ExecutionContext, composition?: LocalContractCompositionCapture): Promise<BindResult>;
|
|
51
|
+
export { parseMarkdownBindDocument } from "./contract-bind.js";
|
|
43
52
|
/** Internal CLI composition; not exported from the package root. */
|
|
44
53
|
export declare function bindFromCli(input: BindInput, execution?: ExecutionContext): Promise<BindResult>;
|
|
@@ -3,11 +3,12 @@ import { actorOption, optionalBoolean, requireInput } from "./input.js";
|
|
|
3
3
|
import { worktreeHooksOption } from "./configuration.js";
|
|
4
4
|
import { contractId, } from "../core/facts/types.js";
|
|
5
5
|
export { AuthorityCorruptionError } from "../core/facts/errors.js";
|
|
6
|
-
import { contractObservationOperation, contractsOperation, } from "../protocol/operations.js";
|
|
6
|
+
import { contractCatalogueOperation, contractObservationOperation, contractsOperation, } from "../protocol/operations.js";
|
|
7
7
|
import { withGitDecodeChannel } from "../git/read-observation.js";
|
|
8
8
|
import { scopeForRepo } from "./repo.js";
|
|
9
9
|
import { localExecutionContext } from "../akuma/requests.js";
|
|
10
10
|
import { Delivery } from "./delivery.js";
|
|
11
|
+
export { projectMutationFinality } from "./mutation.js";
|
|
11
12
|
import { bindFromCli as bindFromCliImplementation, bindKeiyaku as bindKeiyakuImplementation } from "./contract-bind.js";
|
|
12
13
|
export { KeiyakuHandle } from "./contract-handle.js";
|
|
13
14
|
import { KeiyakuHandle } from "./contract-handle.js";
|
|
@@ -44,6 +45,24 @@ export async function listKeiyaku(input) {
|
|
|
44
45
|
const scope = scopeForRepo(values.repo);
|
|
45
46
|
return withGitDecodeChannel(scope, (channel) => contractsOperation({ scope, channel }));
|
|
46
47
|
}
|
|
48
|
+
/** Internal bounded catalogue composition; the public Contract board remains complete. */
|
|
49
|
+
export async function listContractCatalogue(input) {
|
|
50
|
+
const values = requireInput(input, "Contract catalogue input");
|
|
51
|
+
for (const key of Object.keys(values)) {
|
|
52
|
+
if (key !== "repo" && key !== "limit")
|
|
53
|
+
throw new TypeError(`Contract catalogue input has unknown field: ${key}`);
|
|
54
|
+
}
|
|
55
|
+
const limit = values.limit;
|
|
56
|
+
if (limit !== undefined && typeof limit !== "number") {
|
|
57
|
+
throw new TypeError("Contract catalogue limit must be a number");
|
|
58
|
+
}
|
|
59
|
+
const scope = scopeForRepo(values.repo);
|
|
60
|
+
return withGitDecodeChannel(scope, (channel) => contractCatalogueOperation({
|
|
61
|
+
scope,
|
|
62
|
+
channel,
|
|
63
|
+
...(limit === undefined ? {} : { limit }),
|
|
64
|
+
}));
|
|
65
|
+
}
|
|
47
66
|
export async function observeKeiyaku(input) {
|
|
48
67
|
const values = requireInput(input, "Keiyaku.observe input");
|
|
49
68
|
for (const key of Object.keys(values))
|
|
@@ -64,6 +83,7 @@ export async function observeKeiyaku(input) {
|
|
|
64
83
|
export async function bindKeiyaku(input, execution = localExecutionContext(), composition = captureLocalContractComposition()) {
|
|
65
84
|
return bindKeiyakuImplementation(input, (id, scope) => new KeiyakuHandle(id, scope, execution, composition));
|
|
66
85
|
}
|
|
86
|
+
export { parseMarkdownBindDocument } from "./contract-bind.js";
|
|
67
87
|
/** Internal CLI composition; not exported from the package root. */
|
|
68
88
|
export async function bindFromCli(input, execution = localExecutionContext()) {
|
|
69
89
|
const composition = captureLocalContractComposition();
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import type { SnapshotId } from "../core/facts/types.js";
|
|
2
2
|
import type { DeliverValue as ProtocolDeliverValue } from "../protocol/deliver.js";
|
|
3
|
-
import type
|
|
3
|
+
import { type ContinuationReport } from "./continuation.js";
|
|
4
|
+
import { z } from "zod";
|
|
4
5
|
export type DeliveryValue = ProtocolDeliverValue & Readonly<{
|
|
5
6
|
continuation?: ContinuationReport;
|
|
6
7
|
}>;
|
|
8
|
+
export declare function decodeDeliveryValue(value: unknown): DeliveryValue;
|
|
9
|
+
export declare const deliveryValueSchema: z.ZodType<DeliveryValue, unknown, z.core.$ZodTypeInternals<DeliveryValue, unknown>>;
|
|
7
10
|
declare class DeliveryHandle {
|
|
8
11
|
private readonly readDiff;
|
|
9
12
|
readonly completion?: DeliveryValue["completion"];
|
|
@@ -1,3 +1,50 @@
|
|
|
1
|
+
import { decodeDeliverData } from "../core/facts/codec.js";
|
|
2
|
+
import { decodeCompletionEvidence } from "../protocol/result-codec.js";
|
|
3
|
+
import { decodeContinuationReport } from "./continuation.js";
|
|
4
|
+
import { ownerSchema } from "./result-codec.js";
|
|
5
|
+
export function decodeDeliveryValue(value) {
|
|
6
|
+
if (value === null || typeof value !== "object" || Array.isArray(value))
|
|
7
|
+
throw new Error("malformed delivery value");
|
|
8
|
+
const object = value;
|
|
9
|
+
const allowed = new Set([
|
|
10
|
+
"tenderSnapshot",
|
|
11
|
+
"integration",
|
|
12
|
+
"method",
|
|
13
|
+
"policy",
|
|
14
|
+
"completion",
|
|
15
|
+
"verification",
|
|
16
|
+
"verificationReuse",
|
|
17
|
+
"verificationSummary",
|
|
18
|
+
"placement",
|
|
19
|
+
"cleanup",
|
|
20
|
+
"leak",
|
|
21
|
+
"continuation",
|
|
22
|
+
]);
|
|
23
|
+
for (const key of Object.keys(object))
|
|
24
|
+
if (!allowed.has(key))
|
|
25
|
+
throw new Error("malformed delivery value");
|
|
26
|
+
const identity = decodeDeliverData({
|
|
27
|
+
tenderSnapshot: object.tenderSnapshot,
|
|
28
|
+
integration: object.integration,
|
|
29
|
+
method: object.method,
|
|
30
|
+
policy: object.policy,
|
|
31
|
+
});
|
|
32
|
+
const evidence = decodeCompletionEvidence({
|
|
33
|
+
...(object.completion === undefined ? {} : { completion: object.completion }),
|
|
34
|
+
...(object.verification === undefined ? {} : { verification: object.verification }),
|
|
35
|
+
...(object.verificationReuse === undefined ? {} : { verificationReuse: object.verificationReuse }),
|
|
36
|
+
...(object.verificationSummary === undefined ? {} : { verificationSummary: object.verificationSummary }),
|
|
37
|
+
...(object.placement === undefined ? {} : { placement: object.placement }),
|
|
38
|
+
...(object.cleanup === undefined ? {} : { cleanup: object.cleanup }),
|
|
39
|
+
...(object.leak === undefined ? {} : { leak: object.leak }),
|
|
40
|
+
});
|
|
41
|
+
return {
|
|
42
|
+
...identity,
|
|
43
|
+
...evidence,
|
|
44
|
+
...(object.continuation === undefined ? {} : { continuation: decodeContinuationReport(object.continuation) }),
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
export const deliveryValueSchema = ownerSchema(decodeDeliveryValue, "expected delivery value");
|
|
1
48
|
class DeliveryHandle {
|
|
2
49
|
readDiff;
|
|
3
50
|
constructor(identity, readDiff, outcomes = {}) {
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/** @architectureCompositionRoot */
|
|
2
|
+
import { type ActivityHistory, type OutcomeRow, type AkumaStatus, type InterruptReceipt } from "../akuma/index.js";
|
|
2
3
|
import { type ExecutionContext } from "../akuma/requests.js";
|
|
3
|
-
import { type
|
|
4
|
-
import type { WorldRoot } from "../world.js";
|
|
4
|
+
import { type DispatchAssociation } from "../dispatch/index.js";
|
|
5
5
|
import { type AkumaAddressInput, type AkumaSetAddressInput } from "./address.js";
|
|
6
|
-
import { type AkumaKillResult, type AkumaObservation, type AkumaObservationStage, type AkumaTellResult, type AkumaWaitResult
|
|
7
|
-
export type { AkumaKillResult, AkumaObservation, AkumaObservationStage, AkumaTellResult, AkumaUnobserved, AkumaWaitResult, CreatedTaskObservation, DispatchAssociation, } from "./fleet-result.js";
|
|
8
|
-
import { type Repo } from "./repo.js";
|
|
9
|
-
import { z } from "zod";
|
|
6
|
+
import { type AkumaKillResult, type AkumaObservation, type AkumaObservationStage, type AkumaTellResult, type AkumaWaitResult } from "../akuma/fleet-observation.js";
|
|
10
7
|
export type AkumaWaitInput = AkumaSetAddressInput & Readonly<{
|
|
11
8
|
completion?: "any" | "all";
|
|
12
9
|
timeoutMs?: number;
|
|
@@ -55,135 +52,6 @@ export type AkumaHistoryResult = Readonly<{
|
|
|
55
52
|
id: AkumaStatus["id"];
|
|
56
53
|
contract: DispatchAssociation;
|
|
57
54
|
}>;
|
|
58
|
-
type WaitExecutionInput = Readonly<{
|
|
59
|
-
path: WorldRoot;
|
|
60
|
-
ids: readonly AkumaStatus["id"][];
|
|
61
|
-
completion: "any" | "all";
|
|
62
|
-
timeoutMs?: number;
|
|
63
|
-
repo?: Repo;
|
|
64
|
-
signal?: AbortSignal;
|
|
65
|
-
}>;
|
|
66
|
-
export declare function executeWaitAkuma(input: WaitExecutionInput): Promise<AkumaWaitResult>;
|
|
67
|
-
type TellExecutionInput = Readonly<{
|
|
68
|
-
path: WorldRoot;
|
|
69
|
-
id: AkumaStatus["id"];
|
|
70
|
-
body: string;
|
|
71
|
-
tellId?: string;
|
|
72
|
-
recordedAt?: string;
|
|
73
|
-
repo?: Repo;
|
|
74
|
-
signal?: AbortSignal;
|
|
75
|
-
}>;
|
|
76
|
-
export declare function executeTellAkuma(input: TellExecutionInput): Promise<AkumaTellResult>;
|
|
77
|
-
type KillExecutionInput = Readonly<{
|
|
78
|
-
path: WorldRoot;
|
|
79
|
-
ids: readonly AkumaStatus["id"][];
|
|
80
|
-
repo?: Repo;
|
|
81
|
-
signal?: AbortSignal;
|
|
82
|
-
}>;
|
|
83
|
-
export declare function executeKillAkuma(input: KillExecutionInput): Promise<AkumaKillResult>;
|
|
84
|
-
declare const waitRequestSchema: z.ZodPipe<z.ZodObject<{
|
|
85
|
-
targets: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<import("../akuma/identity.js").AkuId, string>>>;
|
|
86
|
-
completion: z.ZodEnum<{
|
|
87
|
-
any: "any";
|
|
88
|
-
all: "all";
|
|
89
|
-
}>;
|
|
90
|
-
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
91
|
-
}, z.core.$strict>, z.ZodTransform<{
|
|
92
|
-
timeoutMs?: number;
|
|
93
|
-
targets: import("../akuma/identity.js").AkuId[];
|
|
94
|
-
completion: "any" | "all";
|
|
95
|
-
action: "akuma.wait";
|
|
96
|
-
}, {
|
|
97
|
-
targets: import("../akuma/identity.js").AkuId[];
|
|
98
|
-
completion: "any" | "all";
|
|
99
|
-
timeoutMs?: number | undefined;
|
|
100
|
-
}>>;
|
|
101
|
-
declare const tellRequestSchema: z.ZodPipe<z.ZodObject<{
|
|
102
|
-
target: z.ZodPipe<z.ZodString, z.ZodTransform<import("../akuma/identity.js").AkuId, string>>;
|
|
103
|
-
body: z.ZodString;
|
|
104
|
-
}, z.core.$strict>, z.ZodTransform<{
|
|
105
|
-
target: import("../akuma/identity.js").AkuId;
|
|
106
|
-
body: string;
|
|
107
|
-
action: "akuma.tell";
|
|
108
|
-
}, {
|
|
109
|
-
target: import("../akuma/identity.js").AkuId;
|
|
110
|
-
body: string;
|
|
111
|
-
}>>;
|
|
112
|
-
declare const killRequestSchema: z.ZodPipe<z.ZodObject<{
|
|
113
|
-
targets: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<import("../akuma/identity.js").AkuId, string>>>;
|
|
114
|
-
}, z.core.$strict>, z.ZodTransform<{
|
|
115
|
-
targets: import("../akuma/identity.js").AkuId[];
|
|
116
|
-
action: "akuma.kill";
|
|
117
|
-
}, {
|
|
118
|
-
targets: import("../akuma/identity.js").AkuId[];
|
|
119
|
-
}>>;
|
|
120
|
-
declare const waitServiceSchema: z.ZodObject<{
|
|
121
|
-
action: z.ZodLiteral<"akuma.wait">;
|
|
122
|
-
}, z.core.$strict>;
|
|
123
|
-
declare const tellServiceSchema: z.ZodObject<{
|
|
124
|
-
action: z.ZodLiteral<"akuma.tell">;
|
|
125
|
-
target: z.ZodPipe<z.ZodString, z.ZodTransform<import("../akuma/identity.js").AkuId, string>>;
|
|
126
|
-
tellId: z.ZodString;
|
|
127
|
-
}, z.core.$strict>;
|
|
128
|
-
declare const killServiceSchema: z.ZodObject<{
|
|
129
|
-
action: z.ZodLiteral<"akuma.kill">;
|
|
130
|
-
results: z.ZodArray<z.ZodObject<{
|
|
131
|
-
id: z.ZodPipe<z.ZodString, z.ZodTransform<import("../akuma/identity.js").AkuId, string>>;
|
|
132
|
-
evidence: z.ZodEnum<{
|
|
133
|
-
unavailable: "unavailable";
|
|
134
|
-
killed: "killed";
|
|
135
|
-
"already-killed": "already-killed";
|
|
136
|
-
"already-stopped": "already-stopped";
|
|
137
|
-
hung: "hung";
|
|
138
|
-
untidy: "untidy";
|
|
139
|
-
}>;
|
|
140
|
-
}, z.core.$strict>>;
|
|
141
|
-
}, z.core.$strict>;
|
|
142
|
-
type FleetRequest = (Omit<z.infer<typeof waitRequestSchema>, "targets"> & Readonly<{
|
|
143
|
-
targets: readonly AkumaStatus["id"][];
|
|
144
|
-
}>) | z.infer<typeof tellRequestSchema> | (Omit<z.infer<typeof killRequestSchema>, "targets"> & Readonly<{
|
|
145
|
-
targets: readonly AkumaStatus["id"][];
|
|
146
|
-
}>);
|
|
147
|
-
type FleetService = z.infer<typeof waitServiceSchema> | z.infer<typeof tellServiceSchema> | (Omit<z.infer<typeof killServiceSchema>, "results"> & Readonly<{
|
|
148
|
-
results: readonly Readonly<{
|
|
149
|
-
id: AkumaStatus["id"];
|
|
150
|
-
evidence: KillEvidence;
|
|
151
|
-
}>[];
|
|
152
|
-
}>);
|
|
153
|
-
export type FleetRequestPort = Readonly<{
|
|
154
|
-
wait(input: Readonly<{
|
|
155
|
-
targets: readonly AkumaStatus["id"][];
|
|
156
|
-
completion: "any" | "all";
|
|
157
|
-
timeoutMs?: number;
|
|
158
|
-
signal: AbortSignal;
|
|
159
|
-
}>): Promise<AkumaWaitResult>;
|
|
160
|
-
tell(input: Readonly<{
|
|
161
|
-
target: AkumaStatus["id"];
|
|
162
|
-
body: string;
|
|
163
|
-
tellId: string;
|
|
164
|
-
recordedAt: string;
|
|
165
|
-
signal: AbortSignal;
|
|
166
|
-
}>): Promise<AkumaTellResult>;
|
|
167
|
-
kill(input: Readonly<{
|
|
168
|
-
targets: readonly AkumaStatus["id"][];
|
|
169
|
-
signal: AbortSignal;
|
|
170
|
-
}>): Promise<AkumaKillResult | Readonly<{
|
|
171
|
-
result: unknown;
|
|
172
|
-
service: readonly Readonly<{
|
|
173
|
-
id: AkumaStatus["id"];
|
|
174
|
-
evidence: KillEvidence;
|
|
175
|
-
}>[];
|
|
176
|
-
}>>;
|
|
177
|
-
}>;
|
|
178
|
-
type FleetExecutionContext = Readonly<{
|
|
179
|
-
id: string;
|
|
180
|
-
admittedAt: string;
|
|
181
|
-
signal: AbortSignal;
|
|
182
|
-
upstream: FleetRequestPort;
|
|
183
|
-
}>;
|
|
184
|
-
/** Fleet owns its Body Request payload, live result, and durable service codecs. */
|
|
185
|
-
export declare function fleetRequestCommand(action: FleetRequest["action"]): RequestCommand<FleetRequest, unknown, FleetService, FleetService, FleetExecutionContext>;
|
|
186
|
-
export declare function fleetRequestCommands(): Readonly<Record<"akuma.wait" | "akuma.tell" | "akuma.kill", ErasedRequestCommand>>;
|
|
187
55
|
export declare function statusAkuma(input: AkumaAddressInput): Promise<AkumaObservation>;
|
|
188
56
|
export declare function waitAkuma(input: AkumaWaitInput, execution?: ExecutionContext): Promise<AkumaWaitResult>;
|
|
189
57
|
export declare function killAkuma(input: AkumaSetAddressInput, execution?: ExecutionContext): Promise<AkumaKillResult>;
|