@astrosheep/keiyaku 4.6.8 → 4.6.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -14
- package/build/plugins/claude/.claude-plugin/plugin.json +1 -1
- package/build/plugins/claude/skills/keiyaku/SKILL.md +5 -6
- package/build/plugins/claude/skills/keiyaku-akuma/SKILL.md +1 -1
- package/build/plugins/claude/skills/keiyaku-akuma/references/automation.md +8 -8
- package/build/plugins/claude/skills/keiyaku-babysit/SKILL.md +1 -1
- package/build/plugins/claude/skills/keiyaku-bind/SKILL.md +9 -9
- package/build/plugins/claude/skills/keiyaku-debt/SKILL.md +91 -0
- package/build/plugins/claude/skills/keiyaku-workflow/SKILL.md +2 -2
- package/build/plugins/codex/.codex-plugin/plugin.json +1 -1
- package/build/plugins/codex/skills/keiyaku/SKILL.md +5 -6
- package/build/plugins/codex/skills/keiyaku-akuma/SKILL.md +1 -1
- package/build/plugins/codex/skills/keiyaku-akuma/references/automation.md +8 -8
- package/build/plugins/codex/skills/keiyaku-babysit/SKILL.md +1 -1
- package/build/plugins/codex/skills/keiyaku-bind/SKILL.md +9 -9
- package/build/plugins/codex/skills/keiyaku-debt/SKILL.md +91 -0
- package/build/plugins/codex/skills/keiyaku-workflow/SKILL.md +2 -2
- package/build/plugins/opencode/index.js +1 -1
- package/build/plugins/opencode/skills/keiyaku/SKILL.md +5 -6
- package/build/plugins/opencode/skills/keiyaku-akuma/SKILL.md +1 -1
- package/build/plugins/opencode/skills/keiyaku-akuma/references/automation.md +8 -8
- package/build/plugins/opencode/skills/keiyaku-babysit/SKILL.md +1 -1
- package/build/plugins/opencode/skills/keiyaku-bind/SKILL.md +9 -9
- package/build/plugins/opencode/skills/keiyaku-debt/SKILL.md +91 -0
- package/build/plugins/opencode/skills/keiyaku-workflow/SKILL.md +2 -2
- package/build/skills/keiyaku/SKILL.md +5 -6
- package/build/skills/keiyaku-akuma/SKILL.md +1 -1
- package/build/skills/keiyaku-akuma/references/automation.md +8 -8
- package/build/skills/keiyaku-babysit/SKILL.md +1 -1
- package/build/skills/keiyaku-bind/SKILL.md +9 -9
- package/build/skills/keiyaku-debt/SKILL.md +91 -0
- package/build/skills/keiyaku-workflow/SKILL.md +2 -2
- package/build/src/akuma/akuma-instance.d.ts +2 -0
- package/build/src/akuma/akuma-instance.js +10 -0
- package/build/src/akuma/akuma-observe.d.ts +33 -8
- package/build/src/akuma/akuma-observe.js +88 -64
- package/build/src/akuma/akuma-owner.d.ts +11 -2
- package/build/src/akuma/akuma-owner.js +45 -35
- package/build/src/akuma/akuma-selection-execution.js +9 -1
- package/build/src/akuma/akuma-stream.d.ts +22 -0
- package/build/src/akuma/akuma-stream.js +116 -0
- package/build/src/akuma/akuma-wait.d.ts +1 -40
- package/build/src/akuma/akuma-wait.js +23 -84
- package/build/src/akuma/akuma.d.ts +17 -11
- package/build/src/akuma/akuma.js +2 -0
- package/build/src/akuma/allowed.d.ts +7 -12
- package/build/src/akuma/allowed.js +13 -4
- package/build/src/akuma/body-supervisor.d.ts +5 -5
- package/build/src/akuma/body-supervisor.js +22 -20
- package/build/src/akuma/body.js +28 -1
- package/build/src/akuma/call-request.d.ts +12 -22
- package/build/src/akuma/heart/activity-schema.d.ts +12 -0
- package/build/src/akuma/heart/activity-schema.js +6 -0
- package/build/src/akuma/heart/index.d.ts +59 -2
- package/build/src/akuma/heart/index.js +87 -8
- package/build/src/akuma/heart/rows.js +5 -3
- package/build/src/akuma/heart/soul.d.ts +9 -0
- package/build/src/akuma/heart/soul.js +29 -0
- package/build/src/akuma/heart/storage.d.ts +15 -0
- package/build/src/akuma/heart/storage.js +55 -0
- package/build/src/akuma/heart/timeline.d.ts +7 -0
- package/build/src/akuma/heart/timeline.js +10 -0
- package/build/src/akuma/index.d.ts +1 -0
- package/build/src/akuma/projection.d.ts +25 -0
- package/build/src/akuma/projection.js +24 -7
- package/build/src/akuma/provider-recipe.d.ts +11 -0
- package/build/src/akuma/provider-recipe.js +23 -0
- package/build/src/akuma/provider.d.ts +25 -0
- package/build/src/akuma/provider.js +99 -7
- package/build/src/akuma/providers/acp/events.js +25 -2
- package/build/src/akuma/providers/claude/events.js +76 -10
- package/build/src/akuma/providers/claude/index.js +2 -5
- package/build/src/akuma/providers/codex-app-server/events.js +17 -2
- package/build/src/akuma/providers/codex-app-server/index.js +15 -9
- package/build/src/akuma/providers/decode.d.ts +8 -0
- package/build/src/akuma/providers/decode.js +21 -0
- package/build/src/akuma/providers/grok-build/index.js +10 -26
- package/build/src/akuma/providers/opencode-sdk/event-stream.d.ts +3 -3
- package/build/src/akuma/providers/opencode-sdk/event-stream.js +2 -25
- package/build/src/akuma/providers/opencode-sdk/events.d.ts +7 -43
- package/build/src/akuma/providers/opencode-sdk/events.js +147 -284
- package/build/src/akuma/providers/opencode-sdk/index.js +267 -421
- package/build/src/akuma/providers/opencode-sdk/native-http.d.ts +9 -0
- package/build/src/akuma/providers/opencode-sdk/native-http.js +69 -0
- package/build/src/akuma/providers/opencode-sdk/session.d.ts +42 -36
- package/build/src/akuma/providers/opencode-sdk/session.js +75 -82
- package/build/src/akuma/providers/paseo/events.d.ts +8 -0
- package/build/src/akuma/providers/paseo/events.js +58 -11
- package/build/src/akuma/providers/paseo/index.js +11 -7
- package/build/src/akuma/providers/pi/events.d.ts +2 -0
- package/build/src/akuma/providers/pi/events.js +32 -24
- package/build/src/akuma/providers/pi/index.js +21 -35
- package/build/src/akuma/request-lifecycle.d.ts +1 -2
- package/build/src/akuma/request-lifecycle.js +2 -8
- package/build/src/akuma/request-rendezvous.js +38 -55
- package/build/src/akuma/request-serve.d.ts +1 -1
- package/build/src/akuma/request-serve.js +77 -113
- package/build/src/akuma/selection-observation.d.ts +57 -51
- package/build/src/akuma/selection-observation.js +3 -3
- package/build/src/akuma/turn-drive.d.ts +3 -0
- package/build/src/akuma/turn-drive.js +26 -5
- package/build/src/akuma-body.js +12 -22
- package/build/src/cli/akuma-caller.js +10 -0
- package/build/src/cli/commands/akuma-grammar.js +3 -4
- package/build/src/cli/commands/akuma.js +13 -51
- package/build/src/cli/commands/contract-grammar.d.ts +7 -6
- package/build/src/cli/commands/contract-grammar.js +27 -32
- package/build/src/cli/commands/contract-help.d.ts +16 -7
- package/build/src/cli/commands/contract-help.js +20 -11
- package/build/src/cli/commands/contract.js +11 -11
- package/build/src/cli/commands/debt-grammar.d.ts +19 -0
- package/build/src/cli/commands/debt-grammar.js +323 -0
- package/build/src/cli/commands/debt-query.d.ts +5 -0
- package/build/src/cli/commands/{task-query.js → debt-query.js} +9 -9
- package/build/src/cli/commands/{task.d.ts → debt.d.ts} +2 -2
- package/build/src/cli/commands/{task.js → debt.js} +83 -143
- package/build/src/cli/coordinates.d.ts +1 -1
- package/build/src/cli/coordinates.js +1 -1
- package/build/src/cli/parse.d.ts +4 -4
- package/build/src/cli/parse.js +17 -16
- package/build/src/cli/render/akuma-activity.d.ts +11 -83
- package/build/src/cli/render/akuma-activity.js +20 -382
- package/build/src/cli/render/catalog.d.ts +2 -2
- package/build/src/cli/render/catalog.js +5 -5
- package/build/src/cli/render/contract.js +2 -2
- package/build/src/cli/render/debt.d.ts +28 -0
- package/build/src/cli/render/{task.js → debt.js} +51 -112
- package/build/src/cli/render/kanshi.js +28 -28
- package/build/src/cli/render/marks.d.ts +5 -5
- package/build/src/cli/render/marks.js +4 -10
- package/build/src/cli/render/nuke.js +1 -1
- package/build/src/cli/runtime.js +3 -3
- package/build/src/cli/scan.d.ts +1 -1
- package/build/src/cli/usage.d.ts +1 -1
- package/build/src/cli/usage.js +4 -4
- package/build/src/contract-worktree.js +3 -3
- package/build/src/debt/board.d.ts +160 -0
- package/build/src/{task → debt}/board.js +89 -89
- package/build/src/debt/catalog.d.ts +11 -0
- package/build/src/debt/catalog.js +59 -0
- package/build/src/{task → debt}/context.d.ts +1 -1
- package/build/src/{task → debt}/context.js +1 -1
- package/build/src/{task → debt}/created-observation.d.ts +6 -10
- package/build/src/{task → debt}/created-observation.js +7 -7
- package/build/src/debt/document.d.ts +37 -0
- package/build/src/{task → debt}/document.js +37 -37
- package/build/src/debt/identity.d.ts +21 -0
- package/build/src/{task → debt}/identity.js +35 -35
- package/build/src/debt/index.d.ts +111 -0
- package/build/src/debt/index.js +203 -0
- package/build/src/{task → debt}/input.d.ts +8 -8
- package/build/src/{task → debt}/input.js +21 -21
- package/build/src/debt/lifecycle-operations.d.ts +6 -0
- package/build/src/{task → debt}/lifecycle-operations.js +27 -31
- package/build/src/debt/mutation-result.d.ts +981 -0
- package/build/src/debt/mutation-result.js +109 -0
- package/build/src/debt/mutation.d.ts +424 -0
- package/build/src/debt/mutation.js +223 -0
- package/build/src/debt/operation-types.d.ts +71 -0
- package/build/src/debt/operations.d.ts +28 -0
- package/build/src/{task → debt}/operations.js +59 -60
- package/build/src/debt/query.d.ts +76 -0
- package/build/src/{task → debt}/query.js +55 -55
- package/build/src/{task → debt}/store.d.ts +13 -13
- package/build/src/{task → debt}/store.js +58 -49
- package/build/src/debt/view.d.ts +4 -0
- package/build/src/debt/view.js +7 -0
- package/build/src/identity/coordinates.d.ts +1 -1
- package/build/src/index.d.ts +13 -13
- package/build/src/index.js +9 -9
- package/build/src/kanshi/index.d.ts +1 -1
- package/build/src/kanshi/read.js +33 -33
- package/build/src/kanshi/report.d.ts +7 -7
- package/build/src/kanshi/select.js +4 -4
- package/build/src/library/akumas.d.ts +2 -3
- package/build/src/library/bind.d.ts +3 -3
- package/build/src/library/bind.js +5 -5
- package/build/src/library/contract-creation.js +5 -5
- package/build/src/library/contract-execution.js +4 -4
- package/build/src/library/contract-types.d.ts +2 -2
- package/build/src/library/input.d.ts +2 -2
- package/build/src/library/input.js +5 -5
- package/build/src/library/invocation.js +2 -2
- package/build/src/library/nuke.js +3 -3
- package/build/src/library/outcome.d.ts +126 -126
- package/build/src/library/outcome.js +3 -3
- package/build/src/library/selection.d.ts +1 -4
- package/build/src/library/selection.js +11 -62
- package/build/src/plugin/public.d.ts +5 -0
- package/build/src/plugin/runtime.js +3 -1
- package/build/src/runtime/proc/windows-launch.exe +0 -0
- package/build/src/settlement/fence.d.ts +3 -3
- package/build/src/settlement/fence.js +4 -4
- package/build/src/settlement/holder.d.ts +16 -16
- package/build/src/settlement/holder.js +69 -63
- package/build/src/settlement/settle.d.ts +5 -5
- package/build/src/settlement/settle.js +53 -53
- package/package.json +12 -6
- package/plugins/paseo/plugin/index.server.ts +17 -0
- package/plugins/paseo/plugin/paseo-plugin.json +4 -0
- package/plugins/paseo/plugin/server/attach.ts +52 -0
- package/plugins/paseo/plugin/server/keiyaku.ts +44 -0
- package/plugins/paseo/plugin/server/message.ts +60 -0
- package/plugins/paseo/plugin/server/mirror.ts +193 -0
- package/plugins/paseo/plugin/server/model.ts +14 -0
- package/plugins/paseo/plugin/server/provider.ts +276 -0
- package/plugins/paseo/plugin/server/sdk-worker.ts +237 -0
- package/plugins/paseo/plugin/server/sdk.ts +289 -0
- package/plugins/paseo/plugin/server/stop.ts +26 -0
- package/plugins/paseo/plugin/server/transport.ts +35 -0
- package/plugins/paseo/plugin/shared/attach-rpc.ts +10 -0
- package/plugins/paseo/plugin/shared/refresh-rpc.ts +6 -0
- package/plugins/paseo/plugin/tsconfig.json +6 -0
- package/skills/keiyaku/SKILL.md +5 -6
- package/skills/keiyaku-akuma/SKILL.md +1 -1
- package/skills/keiyaku-akuma/references/automation.md +8 -8
- package/skills/keiyaku-babysit/SKILL.md +1 -1
- package/skills/keiyaku-bind/SKILL.md +9 -9
- package/skills/keiyaku-debt/SKILL.md +91 -0
- package/skills/keiyaku-workflow/SKILL.md +2 -2
- package/build/plugins/claude/skills/keiyaku-task/SKILL.md +0 -104
- package/build/plugins/codex/skills/keiyaku-task/SKILL.md +0 -104
- package/build/plugins/opencode/skills/keiyaku-task/SKILL.md +0 -104
- package/build/skills/keiyaku-task/SKILL.md +0 -104
- package/build/src/cli/commands/task-grammar.d.ts +0 -19
- package/build/src/cli/commands/task-grammar.js +0 -384
- package/build/src/cli/commands/task-query.d.ts +0 -5
- package/build/src/cli/render/task.d.ts +0 -39
- package/build/src/task/board.d.ts +0 -168
- package/build/src/task/catalog.d.ts +0 -11
- package/build/src/task/catalog.js +0 -59
- package/build/src/task/compose-language.d.ts +0 -57
- package/build/src/task/compose-language.js +0 -364
- package/build/src/task/compose-parser.d.ts +0 -32
- package/build/src/task/compose-parser.js +0 -180
- package/build/src/task/compose.d.ts +0 -16
- package/build/src/task/compose.js +0 -189
- package/build/src/task/document.d.ts +0 -39
- package/build/src/task/identity.d.ts +0 -21
- package/build/src/task/index.d.ts +0 -138
- package/build/src/task/index.js +0 -269
- package/build/src/task/lifecycle-operations.d.ts +0 -6
- package/build/src/task/mutation-result.d.ts +0 -1726
- package/build/src/task/mutation-result.js +0 -198
- package/build/src/task/mutation.d.ts +0 -590
- package/build/src/task/mutation.js +0 -262
- package/build/src/task/operation-types.d.ts +0 -71
- package/build/src/task/operations.d.ts +0 -28
- package/build/src/task/query.d.ts +0 -76
- package/build/src/task/view.d.ts +0 -4
- package/build/src/task/view.js +0 -7
- package/skills/keiyaku-task/SKILL.md +0 -104
- /package/build/src/{task → debt}/operation-types.js +0 -0
|
@@ -1,198 +0,0 @@
|
|
|
1
|
-
import { taskIdSchema as taskMutationIdSchema, taskIdsSchema, taskNamespaceSchema, parseTaskId } from "./identity.js";
|
|
2
|
-
import { taskNonblankTextSchema, taskStateSchema, taskPrioritySchema } from "./document.js";
|
|
3
|
-
import { z } from "zod";
|
|
4
|
-
export { taskIdSchema as taskMutationIdSchema } from "./identity.js";
|
|
5
|
-
function withoutUndefined(value, keys) {
|
|
6
|
-
const result = { ...value };
|
|
7
|
-
for (const key of keys) {
|
|
8
|
-
const field = result[key];
|
|
9
|
-
delete result[key];
|
|
10
|
-
if (field !== undefined)
|
|
11
|
-
result[key] = field;
|
|
12
|
-
}
|
|
13
|
-
return result;
|
|
14
|
-
}
|
|
15
|
-
const timestampSchema = z.string().refine((value) => {
|
|
16
|
-
const parsed = Date.parse(value);
|
|
17
|
-
return Number.isFinite(parsed) && new Date(parsed).toISOString() === value;
|
|
18
|
-
}, "expected canonical UTC timestamp");
|
|
19
|
-
const taskRetrySchema = z
|
|
20
|
-
.object({ kind: z.literal("retry"), reason: z.enum(["busy", "concurrent-modification"]) })
|
|
21
|
-
.strict();
|
|
22
|
-
const taskCleanupFailureSchema = z
|
|
23
|
-
.object({ kind: z.literal("lock-release-failed"), diagnostics: z.array(z.string()).readonly() })
|
|
24
|
-
.strict();
|
|
25
|
-
const taskViewSchema = z
|
|
26
|
-
.object({
|
|
27
|
-
id: taskMutationIdSchema,
|
|
28
|
-
namespace: taskNamespaceSchema,
|
|
29
|
-
title: taskNonblankTextSchema,
|
|
30
|
-
state: taskStateSchema,
|
|
31
|
-
priority: taskPrioritySchema,
|
|
32
|
-
needs: taskIdsSchema,
|
|
33
|
-
parent: taskMutationIdSchema.nullable(),
|
|
34
|
-
supersedes: taskIdsSchema,
|
|
35
|
-
relates: taskIdsSchema,
|
|
36
|
-
note: z.string(),
|
|
37
|
-
createdBy: taskNonblankTextSchema.optional(),
|
|
38
|
-
createdAt: timestampSchema,
|
|
39
|
-
updatedAt: timestampSchema,
|
|
40
|
-
body: z.string(),
|
|
41
|
-
})
|
|
42
|
-
.strict()
|
|
43
|
-
.superRefine((task, context) => {
|
|
44
|
-
if (task.namespace.join("/") !== parseTaskId(task.id).namespace.join("/"))
|
|
45
|
-
context.addIssue({ code: "custom", path: ["namespace"], message: "namespace must agree with task ID" });
|
|
46
|
-
})
|
|
47
|
-
.transform(({ createdBy, ...task }) => withoutUndefined({ ...task, createdBy }, ["createdBy"]));
|
|
48
|
-
const compositionDiagnosticSchema = z
|
|
49
|
-
.object({ line: z.number().int().positive(), reason: z.string(), token: z.string() })
|
|
50
|
-
.strict();
|
|
51
|
-
const invalidCompositionRefusalSchema = z
|
|
52
|
-
.object({ kind: z.literal("invalid-composition"), diagnostics: z.array(compositionDiagnosticSchema).readonly() })
|
|
53
|
-
.strict();
|
|
54
|
-
export const taskRefusalSchema = z.union([
|
|
55
|
-
z.object({ kind: z.literal("task-missing"), taskId: taskMutationIdSchema }).strict(),
|
|
56
|
-
z
|
|
57
|
-
.object({
|
|
58
|
-
kind: z.literal("invalid-lifecycle-transition"),
|
|
59
|
-
taskId: taskMutationIdSchema,
|
|
60
|
-
state: taskStateSchema,
|
|
61
|
-
verb: z.enum(["start", "stop", "hold", "resume", "done", "drop"]),
|
|
62
|
-
})
|
|
63
|
-
.strict(),
|
|
64
|
-
z.object({ kind: z.literal("invalid-graph"), diagnostic: z.string() }).strict(),
|
|
65
|
-
z.object({ kind: z.literal("invalid-namespace-context"), path: z.string() }).strict(),
|
|
66
|
-
z
|
|
67
|
-
.object({
|
|
68
|
-
kind: z.literal("relation-owned-by-other"),
|
|
69
|
-
taskId: taskMutationIdSchema,
|
|
70
|
-
related: taskMutationIdSchema,
|
|
71
|
-
declaringTask: taskMutationIdSchema,
|
|
72
|
-
})
|
|
73
|
-
.strict(),
|
|
74
|
-
invalidCompositionRefusalSchema,
|
|
75
|
-
]);
|
|
76
|
-
const taskRefusedResultSchema = z.object({ kind: z.literal("refused"), refusal: taskRefusalSchema }).strict();
|
|
77
|
-
export const taskMutationResultSchema = z.union([
|
|
78
|
-
z
|
|
79
|
-
.object({ kind: z.literal("accepted"), value: taskViewSchema, cleanup: taskCleanupFailureSchema.optional() })
|
|
80
|
-
.strict()
|
|
81
|
-
.transform((value) => withoutUndefined(value, ["cleanup"])),
|
|
82
|
-
taskRefusedResultSchema,
|
|
83
|
-
taskRetrySchema,
|
|
84
|
-
]);
|
|
85
|
-
export const taskUpdateResultSchema = z.union([
|
|
86
|
-
z
|
|
87
|
-
.object({
|
|
88
|
-
kind: z.literal("accepted"),
|
|
89
|
-
value: z
|
|
90
|
-
.object({
|
|
91
|
-
task: taskViewSchema,
|
|
92
|
-
documentDiff: z.string(),
|
|
93
|
-
changedFields: z
|
|
94
|
-
.array(z
|
|
95
|
-
.object({ field: z.string(), action: z.enum(["added", "replaced", "cleared", "changed", "appended"]) })
|
|
96
|
-
.strict())
|
|
97
|
-
.readonly(),
|
|
98
|
-
})
|
|
99
|
-
.strict(),
|
|
100
|
-
cleanup: taskCleanupFailureSchema.optional(),
|
|
101
|
-
})
|
|
102
|
-
.strict()
|
|
103
|
-
.transform((value) => withoutUndefined(value, ["cleanup"])),
|
|
104
|
-
taskRefusedResultSchema,
|
|
105
|
-
taskRetrySchema,
|
|
106
|
-
]);
|
|
107
|
-
export const taskBatchResultSchema = z
|
|
108
|
-
.object({
|
|
109
|
-
items: z.array(z.object({ id: taskMutationIdSchema, outcome: taskMutationResultSchema }).strict()).readonly(),
|
|
110
|
-
})
|
|
111
|
-
.strict();
|
|
112
|
-
const aliasesSchema = z
|
|
113
|
-
.array(z.object({ alias: taskNonblankTextSchema, taskId: taskMutationIdSchema }).strict())
|
|
114
|
-
.readonly();
|
|
115
|
-
const planAliasesSchema = z
|
|
116
|
-
.array(z.object({ alias: taskNonblankTextSchema, position: z.number().int().positive() }).strict())
|
|
117
|
-
.readonly();
|
|
118
|
-
const planOrderSchema = z
|
|
119
|
-
.array(z
|
|
120
|
-
.object({
|
|
121
|
-
position: z.number().int().positive(),
|
|
122
|
-
alias: taskNonblankTextSchema.optional(),
|
|
123
|
-
taskId: taskMutationIdSchema.optional(),
|
|
124
|
-
})
|
|
125
|
-
.strict())
|
|
126
|
-
.readonly();
|
|
127
|
-
const admissionsSchema = z
|
|
128
|
-
.array(z.discriminatedUnion("kind", [
|
|
129
|
-
z
|
|
130
|
-
.object({
|
|
131
|
-
kind: z.literal("new"),
|
|
132
|
-
position: z.number().int().positive(),
|
|
133
|
-
alias: taskNonblankTextSchema.optional(),
|
|
134
|
-
title: z.string(),
|
|
135
|
-
})
|
|
136
|
-
.strict(),
|
|
137
|
-
z
|
|
138
|
-
.object({
|
|
139
|
-
kind: z.literal("existing"),
|
|
140
|
-
position: z.number().int().positive(),
|
|
141
|
-
taskId: taskMutationIdSchema,
|
|
142
|
-
title: z.string(),
|
|
143
|
-
})
|
|
144
|
-
.strict(),
|
|
145
|
-
]))
|
|
146
|
-
.readonly();
|
|
147
|
-
const documentChangesSchema = z
|
|
148
|
-
.array(z.object({ taskId: taskMutationIdSchema, kind: z.enum(["created", "updated"]), documentDiff: z.string() }).strict())
|
|
149
|
-
.readonly();
|
|
150
|
-
const compositionFactsSchema = { aliases: aliasesSchema, admissionOrder: taskIdsSchema, admissions: admissionsSchema };
|
|
151
|
-
export const taskCompositionResultSchema = z.union([
|
|
152
|
-
z
|
|
153
|
-
.object({
|
|
154
|
-
kind: z.literal("planned"),
|
|
155
|
-
aliases: planAliasesSchema,
|
|
156
|
-
admissionOrder: planOrderSchema,
|
|
157
|
-
admissions: admissionsSchema,
|
|
158
|
-
bodies: z
|
|
159
|
-
.array(z
|
|
160
|
-
.object({
|
|
161
|
-
position: z.number().int().positive(),
|
|
162
|
-
title: z.string(),
|
|
163
|
-
bytes: z.number().int().nonnegative(),
|
|
164
|
-
firstLine: z.string(),
|
|
165
|
-
lastLine: z.string(),
|
|
166
|
-
})
|
|
167
|
-
.strict())
|
|
168
|
-
.readonly(),
|
|
169
|
-
})
|
|
170
|
-
.strict(),
|
|
171
|
-
z
|
|
172
|
-
.object({
|
|
173
|
-
kind: z.literal("accepted"),
|
|
174
|
-
...compositionFactsSchema,
|
|
175
|
-
documentChanges: documentChangesSchema,
|
|
176
|
-
cleanup: taskCleanupFailureSchema.optional(),
|
|
177
|
-
})
|
|
178
|
-
.strict()
|
|
179
|
-
.transform((value) => withoutUndefined(value, ["cleanup"])),
|
|
180
|
-
z.object({ kind: z.literal("refused"), refusal: invalidCompositionRefusalSchema }).strict(),
|
|
181
|
-
z
|
|
182
|
-
.object({
|
|
183
|
-
kind: z.literal("incomplete"),
|
|
184
|
-
...compositionFactsSchema,
|
|
185
|
-
documentChanges: documentChangesSchema,
|
|
186
|
-
cleanup: taskCleanupFailureSchema.optional(),
|
|
187
|
-
stopped: z.union([taskRefusalSchema, taskRetrySchema]),
|
|
188
|
-
draft: z.string(),
|
|
189
|
-
})
|
|
190
|
-
.strict()
|
|
191
|
-
.transform((value) => withoutUndefined(value, ["cleanup"])),
|
|
192
|
-
]);
|
|
193
|
-
export const taskMutationExecutionResultSchema = z.union([
|
|
194
|
-
taskBatchResultSchema,
|
|
195
|
-
taskMutationResultSchema,
|
|
196
|
-
taskUpdateResultSchema,
|
|
197
|
-
taskCompositionResultSchema,
|
|
198
|
-
]);
|