@astrosheep/keiyaku 4.5.7 → 4.5.8
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 +10 -0
- package/build/integrations/marketplace/plugins/keiyaku/.claude-plugin/plugin.json +1 -1
- package/build/integrations/marketplace/plugins/keiyaku/.codex-plugin/plugin.json +1 -1
- package/build/integrations/marketplace/plugins/keiyaku/opencode.js +3 -2
- package/build/integrations/marketplace/plugins/keiyaku/package.json +1 -1
- package/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku/SKILL.md +10 -9
- package/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku-akuma/SKILL.md +22 -1
- package/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku-babysit/SKILL.md +35 -96
- package/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku-bind/SKILL.md +28 -49
- package/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku-task/SKILL.md +21 -15
- package/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku-workflow/SKILL.md +148 -89
- package/build/src/akuma/abort.d.ts +2 -1
- package/build/src/akuma/abort.js +6 -23
- package/build/src/akuma/akuma-handle.js +4 -2
- package/build/src/akuma/akuma-observe.d.ts +2 -0
- package/build/src/akuma/akuma-observe.js +1 -0
- package/build/src/akuma/akuma-product.js +9 -7
- package/build/src/akuma/akuma.d.ts +372 -9
- package/build/src/akuma/akuma.js +31 -1
- package/build/src/akuma/allowed.d.ts +1 -1
- package/build/src/akuma/allowed.js +1 -0
- package/build/src/akuma/body.d.ts +6 -4
- package/build/src/akuma/body.js +5 -3
- package/build/src/akuma/call-request.d.ts +80 -0
- package/build/src/akuma/call-request.js +211 -0
- package/build/src/akuma/heart/facts.d.ts +6 -78
- package/build/src/akuma/heart/index.d.ts +1 -1
- package/build/src/akuma/heart/request-authority.d.ts +5 -4
- package/build/src/akuma/heart/request-authority.js +20 -34
- package/build/src/akuma/heart/request-rows.js +12 -23
- package/build/src/akuma/heart/schema.d.ts +1 -1
- package/build/src/akuma/heart/schema.js +5 -13
- package/build/src/akuma/index.d.ts +1 -1
- package/build/src/akuma/index.js +1 -1
- package/build/src/akuma/projection-read.d.ts +1 -0
- package/build/src/akuma/projection-read.js +8 -1
- package/build/src/akuma/projection.d.ts +856 -137
- package/build/src/akuma/projection.js +190 -0
- package/build/src/akuma/provider.d.ts +30 -3
- package/build/src/akuma/provider.js +104 -0
- package/build/src/akuma/providers/acp/core.d.ts +2 -2
- package/build/src/akuma/providers/acp/core.js +13 -6
- package/build/src/akuma/providers/acp/index.js +5 -4
- package/build/src/akuma/providers/claude/index.d.ts +3 -3
- package/build/src/akuma/providers/claude/index.js +16 -5
- package/build/src/akuma/providers/codex-app-server/events.js +1 -1
- package/build/src/akuma/providers/codex-app-server/index.js +18 -6
- package/build/src/akuma/providers/grok-build/index.js +5 -4
- package/build/src/akuma/providers/opencode-sdk/index.js +66 -25
- package/build/src/akuma/providers/opencode-sdk/session.d.ts +3 -2
- package/build/src/akuma/providers/opencode-sdk/session.js +28 -11
- package/build/src/akuma/providers/pi/index.js +42 -14
- package/build/src/akuma/request-lifecycle.d.ts +3 -9
- package/build/src/akuma/request-lifecycle.js +4 -4
- package/build/src/akuma/request-rendezvous.d.ts +26 -0
- package/build/src/akuma/request-rendezvous.js +100 -0
- package/build/src/akuma/request-serve.d.ts +5 -65
- package/build/src/akuma/request-serve.js +81 -208
- package/build/src/akuma/request-wire.d.ts +109 -115
- package/build/src/akuma/request-wire.js +63 -318
- package/build/src/akuma/requests.d.ts +19 -47
- package/build/src/akuma/requests.js +51 -107
- package/build/src/akuma/turn-drive.d.ts +5 -3
- package/build/src/akuma/turn-drive.js +32 -10
- package/build/src/akuma-body.d.ts +7 -2
- package/build/src/akuma-body.js +68 -46
- package/build/src/cli/accepted.d.ts +1 -1
- package/build/src/cli/accepted.js +2 -2
- package/build/src/cli/commands/akuma-invoke.d.ts +2 -0
- package/build/src/cli/commands/akuma-invoke.js +17 -9
- package/build/src/cli/commands/akuma.js +7 -7
- package/build/src/cli/commands/contract-invoke.d.ts +3 -2
- package/build/src/cli/commands/contract-invoke.js +26 -19
- package/build/src/cli/commands/contract.d.ts +13 -13
- package/build/src/cli/commands/contract.js +32 -17
- package/build/src/cli/commands/install.d.ts +1 -1
- package/build/src/cli/commands/install.js +1 -1
- package/build/src/cli/commands/task-invoke.d.ts +3 -0
- package/build/src/cli/commands/task-invoke.js +23 -140
- package/build/src/cli/commands/task.js +54 -20
- package/build/src/cli/invoke.js +39 -25
- package/build/src/cli/main.js +2 -1
- package/build/src/cli/parse.d.ts +2 -2
- package/build/src/cli/parse.js +37 -22
- package/build/src/cli/render/akuma-activity.d.ts +4 -1
- package/build/src/cli/render/akuma-activity.js +45 -30
- package/build/src/cli/render/akuma-tool.d.ts +5 -1
- package/build/src/cli/render/akuma.js +5 -9
- package/build/src/cli/render/audit.js +1 -1
- package/build/src/cli/render/catalog.js +80 -21
- package/build/src/cli/render/contract-observation.d.ts +2 -0
- package/build/src/cli/render/contract-observation.js +11 -0
- package/build/src/cli/render/contract.js +25 -65
- package/build/src/cli/render/kanshi-akuma.d.ts +8 -0
- package/build/src/cli/render/kanshi-akuma.js +111 -0
- package/build/src/cli/render/kanshi.js +108 -213
- package/build/src/cli/render/receipt.d.ts +1 -2
- package/build/src/cli/render/receipt.js +76 -26
- package/build/src/cli/render/refusal.js +2 -10
- package/build/src/cli/render/region.js +5 -2
- package/build/src/cli/render/settings.d.ts +1 -1
- package/build/src/cli/render/settings.js +27 -8
- package/build/src/cli/render/task.js +22 -5
- package/build/src/cli/render/terminal.d.ts +28 -0
- package/build/src/cli/render/terminal.js +65 -0
- package/build/src/cli/result.d.ts +3 -3
- package/build/src/cli/runtime.js +3 -1
- package/build/src/cli/selectors.d.ts +2 -1
- package/build/src/cli/selectors.js +4 -3
- package/build/src/cli/square-edge.js +120 -36
- package/build/src/cli/usage.js +2 -1
- package/build/src/contract-guidance.d.ts +5 -0
- package/build/src/contract-guidance.js +121 -0
- package/build/src/contract-worktree.d.ts +0 -1
- package/build/src/contract-worktree.js +32 -83
- package/build/src/coordination/sqlite-transaction-lock.d.ts +1 -0
- package/build/src/coordination/sqlite-transaction-lock.js +5 -0
- package/build/src/core/facts/codec.d.ts +2 -0
- package/build/src/core/facts/codec.js +4 -0
- package/build/src/core/verbs/placement.d.ts +6 -1
- package/build/src/core/verbs/placement.js +5 -3
- package/build/src/dispatch/index.d.ts +0 -2
- package/build/src/dispatch/index.js +54 -55
- package/build/src/git/admission.js +2 -2
- package/build/src/git/hooks.d.ts +9 -15
- package/build/src/git/hooks.js +23 -317
- package/build/src/git/nuke.d.ts +2 -1
- package/build/src/git/nuke.js +36 -18
- package/build/src/git/private-state-seat.d.ts +12 -0
- package/build/src/git/private-state-seat.js +39 -0
- package/build/src/git/process.d.ts +6 -0
- package/build/src/git/process.js +19 -7
- package/build/src/git/read-observation.js +29 -20
- package/build/src/git/reconcile.d.ts +11 -0
- package/build/src/git/reconcile.js +64 -11
- package/build/src/git/repository.d.ts +6 -2
- package/build/src/git/repository.js +8 -0
- package/build/src/git/target-placement.d.ts +1 -0
- package/build/src/git/target-placement.js +5 -0
- package/build/src/git/tender.d.ts +1 -0
- package/build/src/git/terminal-reconcile.d.ts +1 -1
- package/build/src/git/terminal-reconcile.js +22 -20
- package/build/src/git/workspace.d.ts +14 -0
- package/build/src/git/workspace.js +44 -0
- package/build/src/kanshi/index.d.ts +1 -1
- package/build/src/kanshi/read.js +16 -16
- package/build/src/kanshi/report.d.ts +2 -2
- package/build/src/library/address.d.ts +9 -3
- package/build/src/library/address.js +3 -2
- package/build/src/library/akuma-creation.d.ts +4 -3
- package/build/src/library/akuma-creation.js +19 -13
- package/build/src/library/audit.d.ts +1 -1
- package/build/src/library/audit.js +5 -3
- package/build/src/library/catalog.d.ts +3 -1
- package/build/src/library/catalog.js +20 -6
- package/build/src/library/composition.d.ts +371 -0
- package/build/src/library/composition.js +28 -0
- package/build/src/library/configuration.js +8 -2
- package/build/src/library/continuation.js +66 -30
- package/build/src/library/contract-bind.js +10 -2
- package/build/src/library/contract-forwarding-reconciliation-result.d.ts +96 -0
- package/build/src/library/contract-forwarding-reconciliation-result.js +83 -0
- package/build/src/library/contract-forwarding-result.d.ts +6723 -0
- package/build/src/library/contract-forwarding-result.js +521 -0
- package/build/src/library/contract-forwarding.d.ts +72 -0
- package/build/src/library/contract-forwarding.js +125 -0
- package/build/src/library/contract-handle.d.ts +36 -0
- package/build/src/library/contract-handle.js +313 -0
- package/build/src/library/contract-operations.d.ts +1044 -67
- package/build/src/library/contract-operations.js +190 -118
- package/build/src/library/contract.d.ts +11 -32
- package/build/src/library/contract.js +16 -289
- package/build/src/library/fleet-result.d.ts +1454 -0
- package/build/src/library/fleet-result.js +96 -0
- package/build/src/library/fleet.d.ts +112 -54
- package/build/src/library/fleet.js +211 -71
- package/build/src/library/input.d.ts +2 -0
- package/build/src/library/input.js +4 -0
- package/build/src/library/keiyaku.d.ts +371 -20
- package/build/src/library/keiyaku.js +8 -21
- package/build/src/library/mutation.d.ts +3 -3
- package/build/src/library/mutation.js +5 -9
- package/build/src/library/nuke.d.ts +1 -1
- package/build/src/library/nuke.js +4 -3
- package/build/src/library/reconcile.d.ts +4 -0
- package/build/src/library/reconcile.js +2 -0
- package/build/src/library/refusal.d.ts +0 -9
- package/build/src/library/refusal.js +0 -7
- package/build/src/protocol/amend.js +56 -50
- package/build/src/protocol/attempt.d.ts +2 -0
- package/build/src/protocol/attempt.js +8 -1
- package/build/src/protocol/completion.js +7 -0
- package/build/src/protocol/deliver.js +6 -2
- package/build/src/protocol/operations.d.ts +4 -1
- package/build/src/protocol/operations.js +5 -2
- package/build/src/protocol/placement.d.ts +1 -0
- package/build/src/protocol/placement.js +52 -38
- package/build/src/protocol/read/observation.d.ts +1 -4
- package/build/src/protocol/read/observation.js +2 -15
- package/build/src/protocol/reintegrate.js +62 -58
- package/build/src/protocol/review.js +5 -0
- package/build/src/protocol/run.js +17 -13
- package/build/src/runtime/proc/run.d.ts +8 -0
- package/build/src/runtime/proc/run.js +27 -0
- package/build/src/runtime/proc/termination.js +26 -22
- package/build/src/runtime/proc/windows-launch.exe +0 -0
- package/build/src/settlement/holder.d.ts +2 -1
- package/build/src/settlement/holder.js +15 -4
- package/build/src/settlement/settle.js +99 -33
- package/build/src/task/board.d.ts +68 -27
- package/build/src/task/board.js +31 -1
- package/build/src/task/catalog.d.ts +4 -0
- package/build/src/task/catalog.js +23 -0
- package/build/src/task/compose-language.js +33 -7
- package/build/src/task/compose-parser.d.ts +1 -1
- package/build/src/task/compose-parser.js +1 -1
- package/build/src/task/compose.js +2 -0
- package/build/src/task/index.d.ts +12 -4
- package/build/src/task/index.js +97 -16
- package/build/src/task/mutation-result.d.ts +923 -0
- package/build/src/task/mutation-result.js +140 -0
- package/build/src/task/mutation.d.ts +552 -28
- package/build/src/task/mutation.js +304 -97
- package/build/src/task/operations.d.ts +1 -4
- package/build/src/task/operations.js +0 -6
- package/build/src/task/public.d.ts +2 -0
- package/build/src/task/public.js +1 -0
- package/build/src/workspace-place.d.ts +7 -2
- package/build/src/workspace-place.js +34 -24
- package/build/src/world.d.ts +1 -0
- package/build/src/world.js +11 -0
- package/package.json +8 -6
- package/build/src/akuma/request-execution.d.ts +0 -8
- package/build/src/akuma/request-execution.js +0 -98
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { isTaskSegment, formatTaskId, parseTaskId } from "./identity.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
const nonblankTextSchema = z.string().refine((value) => value.trim() !== "");
|
|
4
|
+
const timestampSchema = z.string().refine((value) => {
|
|
5
|
+
const parsed = Date.parse(value);
|
|
6
|
+
return Number.isFinite(parsed) && new Date(parsed).toISOString() === value;
|
|
7
|
+
}, "expected canonical UTC timestamp");
|
|
8
|
+
export const taskMutationIdSchema = z.string().transform((value, context) => {
|
|
9
|
+
try {
|
|
10
|
+
const id = formatTaskId(parseTaskId(value));
|
|
11
|
+
if (id !== value)
|
|
12
|
+
throw new Error("not canonical");
|
|
13
|
+
return id;
|
|
14
|
+
}
|
|
15
|
+
catch {
|
|
16
|
+
context.addIssue({ code: "custom", message: "expected canonical TaskId" });
|
|
17
|
+
return z.NEVER;
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
const taskIdsSchema = z.array(taskMutationIdSchema).superRefine((ids, context) => {
|
|
21
|
+
if (new Set(ids).size !== ids.length)
|
|
22
|
+
context.addIssue({ code: "custom", message: "TaskIds must be unique" });
|
|
23
|
+
});
|
|
24
|
+
const taskStateSchema = z.enum(["open", "in_progress", "on_hold", "done", "drop"]);
|
|
25
|
+
const taskPrioritySchema = z.union([z.literal(0), z.literal(1), z.literal(2), z.literal(3)]);
|
|
26
|
+
const taskRetrySchema = z
|
|
27
|
+
.object({ kind: z.literal("retry"), reason: z.enum(["busy", "concurrent-modification"]) })
|
|
28
|
+
.strict();
|
|
29
|
+
const taskViewSchema = z
|
|
30
|
+
.object({
|
|
31
|
+
id: taskMutationIdSchema,
|
|
32
|
+
namespace: z.array(z.string().refine(isTaskSegment)),
|
|
33
|
+
title: nonblankTextSchema,
|
|
34
|
+
state: taskStateSchema,
|
|
35
|
+
priority: taskPrioritySchema,
|
|
36
|
+
needs: taskIdsSchema,
|
|
37
|
+
parent: taskMutationIdSchema.nullable(),
|
|
38
|
+
supersedes: taskIdsSchema,
|
|
39
|
+
relates: taskIdsSchema,
|
|
40
|
+
note: z.string(),
|
|
41
|
+
createdBy: nonblankTextSchema.optional(),
|
|
42
|
+
createdAt: timestampSchema,
|
|
43
|
+
updatedAt: timestampSchema,
|
|
44
|
+
body: z.string(),
|
|
45
|
+
})
|
|
46
|
+
.strict()
|
|
47
|
+
.superRefine((task, context) => {
|
|
48
|
+
if (task.namespace.join("/") !== parseTaskId(task.id).namespace.join("/"))
|
|
49
|
+
context.addIssue({ code: "custom", path: ["namespace"], message: "namespace must agree with task ID" });
|
|
50
|
+
})
|
|
51
|
+
.transform(({ createdBy, ...task }) => createdBy === undefined ? task : { ...task, createdBy });
|
|
52
|
+
const compositionDiagnosticSchema = z
|
|
53
|
+
.object({ line: z.number().int().positive(), reason: z.string(), token: z.string() })
|
|
54
|
+
.strict();
|
|
55
|
+
const taskRefusalSchema = z.union([
|
|
56
|
+
z.object({ kind: z.literal("task-missing"), taskId: taskMutationIdSchema }).strict(),
|
|
57
|
+
z
|
|
58
|
+
.object({
|
|
59
|
+
kind: z.literal("invalid-lifecycle-transition"),
|
|
60
|
+
taskId: taskMutationIdSchema,
|
|
61
|
+
state: taskStateSchema,
|
|
62
|
+
verb: z.enum(["start", "stop", "hold", "resume", "done", "drop"]),
|
|
63
|
+
})
|
|
64
|
+
.strict(),
|
|
65
|
+
z.object({ kind: z.literal("invalid-graph"), diagnostic: z.string() }).strict(),
|
|
66
|
+
z.object({ kind: z.literal("invalid-namespace-context"), path: z.string() }).strict(),
|
|
67
|
+
z
|
|
68
|
+
.object({
|
|
69
|
+
kind: z.literal("relation-owned-by-other"),
|
|
70
|
+
taskId: taskMutationIdSchema,
|
|
71
|
+
related: taskMutationIdSchema,
|
|
72
|
+
declaringTask: taskMutationIdSchema,
|
|
73
|
+
})
|
|
74
|
+
.strict(),
|
|
75
|
+
z.object({ kind: z.literal("invalid-composition"), diagnostics: z.array(compositionDiagnosticSchema) }).strict(),
|
|
76
|
+
]);
|
|
77
|
+
export const taskMutationResultSchema = z.union([
|
|
78
|
+
z.object({ kind: z.literal("accepted"), value: taskViewSchema }).strict(),
|
|
79
|
+
z.object({ kind: z.literal("refused"), refusal: taskRefusalSchema }).strict(),
|
|
80
|
+
taskRetrySchema,
|
|
81
|
+
]);
|
|
82
|
+
export const taskUpdateResultSchema = z.union([
|
|
83
|
+
z
|
|
84
|
+
.object({
|
|
85
|
+
kind: z.literal("accepted"),
|
|
86
|
+
value: z.object({ task: taskViewSchema, documentDiff: z.string() }).strict(),
|
|
87
|
+
})
|
|
88
|
+
.strict(),
|
|
89
|
+
z.object({ kind: z.literal("refused"), refusal: taskRefusalSchema }).strict(),
|
|
90
|
+
taskRetrySchema,
|
|
91
|
+
]);
|
|
92
|
+
export const taskBatchResultSchema = z
|
|
93
|
+
.object({ items: z.array(z.object({ id: taskMutationIdSchema, outcome: taskMutationResultSchema }).strict()) })
|
|
94
|
+
.strict();
|
|
95
|
+
const aliasesSchema = z.array(z.object({ alias: nonblankTextSchema, taskId: taskMutationIdSchema }).strict());
|
|
96
|
+
const documentChangesSchema = z.array(z.object({ taskId: taskMutationIdSchema, kind: z.enum(["created", "updated"]), documentDiff: z.string() }).strict());
|
|
97
|
+
const compositionFactsSchema = { aliases: aliasesSchema, admissionOrder: taskIdsSchema };
|
|
98
|
+
export const taskCompositionResultSchema = z.union([
|
|
99
|
+
z
|
|
100
|
+
.object({
|
|
101
|
+
kind: z.literal("planned"),
|
|
102
|
+
...compositionFactsSchema,
|
|
103
|
+
bodies: z.array(z
|
|
104
|
+
.object({
|
|
105
|
+
taskId: taskMutationIdSchema,
|
|
106
|
+
bytes: z.number().int().nonnegative(),
|
|
107
|
+
firstLine: z.string(),
|
|
108
|
+
lastLine: z.string(),
|
|
109
|
+
})
|
|
110
|
+
.strict()),
|
|
111
|
+
})
|
|
112
|
+
.strict(),
|
|
113
|
+
z.object({ kind: z.literal("accepted"), ...compositionFactsSchema, documentChanges: documentChangesSchema }).strict(),
|
|
114
|
+
z
|
|
115
|
+
.object({
|
|
116
|
+
kind: z.literal("refused"),
|
|
117
|
+
refusal: z
|
|
118
|
+
.object({ kind: z.literal("invalid-composition"), diagnostics: z.array(compositionDiagnosticSchema) })
|
|
119
|
+
.strict(),
|
|
120
|
+
})
|
|
121
|
+
.strict(),
|
|
122
|
+
z
|
|
123
|
+
.object({
|
|
124
|
+
kind: z.literal("incomplete"),
|
|
125
|
+
...compositionFactsSchema,
|
|
126
|
+
documentChanges: documentChangesSchema,
|
|
127
|
+
stopped: z.union([taskRefusalSchema, taskRetrySchema]),
|
|
128
|
+
draft: z.string(),
|
|
129
|
+
})
|
|
130
|
+
.strict(),
|
|
131
|
+
]);
|
|
132
|
+
export const taskMutationExecutionResultSchema = z.union([
|
|
133
|
+
taskBatchResultSchema,
|
|
134
|
+
taskMutationResultSchema,
|
|
135
|
+
taskUpdateResultSchema,
|
|
136
|
+
taskCompositionResultSchema,
|
|
137
|
+
]);
|
|
138
|
+
export function isTaskMutationExecutionResult(value) {
|
|
139
|
+
return taskMutationExecutionResultSchema.safeParse(value).success;
|
|
140
|
+
}
|