@ericsanchezok/synergy-workbench 0.0.0-stage → 3.1.0
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/AGENTS.md +30 -0
- package/README.md +16 -2
- package/dist/agents.js +11 -0
- package/dist/cli-adapter.js +8 -0
- package/dist/component.js +65 -0
- package/dist/config-schema.js +265 -0
- package/dist/execution/activity.js +78 -0
- package/dist/execution/content.js +184 -0
- package/dist/execution/json-sections.js +231 -0
- package/dist/execution/presentation.js +79 -0
- package/dist/execution/preview.js +13 -0
- package/dist/execution/process.js +125 -0
- package/dist/execution/projection.js +327 -0
- package/dist/execution/query.js +18 -0
- package/dist/execution/routes.js +189 -0
- package/dist/execution/schema.js +322 -0
- package/dist/execution/service.js +1993 -0
- package/dist/features.js +22 -0
- package/dist/http.js +65 -0
- package/dist/performance/analysis.js +330 -0
- package/dist/performance/catalog.js +391 -0
- package/dist/performance/dashboard.js +483 -0
- package/dist/performance/error.js +15 -0
- package/dist/performance/index.js +6 -0
- package/dist/performance/inflight.js +43 -0
- package/dist/performance/projection.js +138 -0
- package/dist/performance/prompt/base.txt +38 -0
- package/dist/performance/prompt/builder.js +21 -0
- package/dist/performance/routes/performance-route.js +439 -0
- package/dist/performance/schema.js +628 -0
- package/dist/performance/timeline.js +98 -0
- package/dist/performance/trace-detail.js +91 -0
- package/dist/presentation/service.js +270 -0
- package/dist/presentation/tools/workbench-view.js +65 -0
- package/dist/presentation/tools.js +10 -0
- package/dist/project/directories.js +363 -0
- package/dist/project/git-health.js +498 -0
- package/dist/project/ide.js +66 -0
- package/dist/project/migration.js +22 -0
- package/dist/project/routes/directories.js +89 -0
- package/dist/project/routes/git.js +30 -0
- package/dist/project/routes/task-defaults.js +42 -0
- package/dist/project/session-health.js +9 -0
- package/dist/project/startup.js +28 -0
- package/dist/project/task-defaults.js +68 -0
- package/dist/project/tools/session-control.js +664 -0
- package/dist/project/tools/session-control.txt +60 -0
- package/dist/project/tools/worktree-archive.js +76 -0
- package/dist/project/tools/worktree-enter.js +175 -0
- package/dist/project/tools/worktree-leave.js +119 -0
- package/dist/project/tools/worktree-list.js +52 -0
- package/dist/project/tools.js +26 -0
- package/dist/project/vcs-branch-watcher.js +76 -0
- package/dist/project/vcs.js +114 -0
- package/dist/project/worktree-janitor.js +140 -0
- package/dist/project/worktrees.js +98 -0
- package/dist/push/bridge.js +171 -0
- package/dist/push/index.js +4 -0
- package/dist/push/routes/push.js +224 -0
- package/dist/push/service.js +93 -0
- package/dist/push/store.js +121 -0
- package/dist/push/types.js +58 -0
- package/dist/review/git.js +226 -0
- package/dist/review/routes.js +45 -0
- package/dist/review/schema.js +32 -0
- package/dist/review/state.js +79 -0
- package/dist/stats/aggregator.js +252 -0
- package/dist/stats/canonical.js +89 -0
- package/dist/stats/cli/stats.js +302 -0
- package/dist/stats/engine.js +176 -0
- package/dist/stats/index.js +5 -0
- package/dist/stats/rollup.js +460 -0
- package/dist/stats/routes/stats.js +94 -0
- package/dist/stats/routes/usage.js +83 -0
- package/dist/stats/storage.js +86 -0
- package/dist/stats/types.js +267 -0
- package/dist/worker.js +6 -0
- package/package.json +232 -4
- package/src/agents.ts +15 -0
- package/src/cli-adapter.ts +11 -0
- package/src/component.ts +73 -0
- package/src/config-schema.ts +289 -0
- package/src/execution/activity.ts +83 -0
- package/src/execution/content.ts +189 -0
- package/src/execution/json-sections.ts +230 -0
- package/src/execution/presentation.ts +91 -0
- package/src/execution/preview.ts +12 -0
- package/src/execution/process.ts +118 -0
- package/src/execution/projection.ts +330 -0
- package/src/execution/query.ts +19 -0
- package/src/execution/routes.ts +324 -0
- package/src/execution/schema.ts +336 -0
- package/src/execution/service.ts +2149 -0
- package/src/features.ts +22 -0
- package/src/http.ts +75 -0
- package/src/performance/analysis.ts +356 -0
- package/src/performance/catalog.ts +902 -0
- package/src/performance/dashboard.ts +521 -0
- package/src/performance/error.ts +32 -0
- package/src/performance/index.ts +6 -0
- package/src/performance/inflight.ts +46 -0
- package/src/performance/projection.ts +143 -0
- package/src/performance/prompt/base.txt +38 -0
- package/src/performance/prompt/builder.ts +24 -0
- package/src/performance/routes/performance-route.ts +541 -0
- package/src/performance/schema.ts +695 -0
- package/src/performance/timeline.ts +100 -0
- package/src/performance/trace-detail.ts +97 -0
- package/src/presentation/service.ts +303 -0
- package/src/presentation/tools/workbench-view.ts +75 -0
- package/src/presentation/tools.ts +11 -0
- package/src/project/directories.ts +391 -0
- package/src/project/git-health.ts +577 -0
- package/src/project/ide.ts +80 -0
- package/src/project/migration.ts +24 -0
- package/src/project/routes/directories.ts +124 -0
- package/src/project/routes/git.ts +42 -0
- package/src/project/routes/task-defaults.ts +50 -0
- package/src/project/session-health.ts +10 -0
- package/src/project/startup.ts +28 -0
- package/src/project/task-defaults.ts +70 -0
- package/src/project/tools/session-control.ts +725 -0
- package/src/project/tools/session-control.txt +60 -0
- package/src/project/tools/worktree-archive.ts +92 -0
- package/src/project/tools/worktree-enter.ts +227 -0
- package/src/project/tools/worktree-leave.ts +140 -0
- package/src/project/tools/worktree-list.ts +68 -0
- package/src/project/tools.ts +29 -0
- package/src/project/vcs-branch-watcher.ts +81 -0
- package/src/project/vcs.ts +124 -0
- package/src/project/worktree-janitor.ts +153 -0
- package/src/project/worktrees.ts +110 -0
- package/src/push/bridge.ts +182 -0
- package/src/push/index.ts +4 -0
- package/src/push/routes/push.ts +267 -0
- package/src/push/service.ts +108 -0
- package/src/push/store.ts +120 -0
- package/src/push/types.ts +67 -0
- package/src/review/git.ts +221 -0
- package/src/review/routes.ts +65 -0
- package/src/review/schema.ts +34 -0
- package/src/review/state.ts +77 -0
- package/src/stats/aggregator.ts +277 -0
- package/src/stats/canonical.ts +93 -0
- package/src/stats/cli/stats.ts +348 -0
- package/src/stats/engine.ts +197 -0
- package/src/stats/index.ts +5 -0
- package/src/stats/rollup.ts +522 -0
- package/src/stats/routes/stats.ts +107 -0
- package/src/stats/routes/usage.ts +103 -0
- package/src/stats/storage.ts +78 -0
- package/src/stats/types.ts +351 -0
- package/src/worker.ts +7 -0
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { RolloutAccounting, RolloutEvidence, RolloutSchema } from "@ericsanchezok/synergy-harness/rollout";
|
|
3
|
+
import { Usage } from "@ericsanchezok/synergy-harness/usage";
|
|
4
|
+
import { BusEvent } from "@ericsanchezok/synergy-harness/bus/bus-event";
|
|
5
|
+
import { MessageV2 } from "@ericsanchezok/synergy-harness/session/message-v2";
|
|
6
|
+
import { SessionInteraction } from "@ericsanchezok/synergy-harness/session/interaction";
|
|
7
|
+
import { CortexTypes } from "@ericsanchezok/synergy-harness/cortex/types";
|
|
8
|
+
import { ExecutionPresentation } from "./presentation.js";
|
|
9
|
+
import { ContextUsageEstimateSchema } from "@ericsanchezok/synergy-harness/context";
|
|
10
|
+
export var ExecutionSchema;
|
|
11
|
+
(function (ExecutionSchema) {
|
|
12
|
+
const Json = z.unknown().meta({ ref: "ExecutionJson" });
|
|
13
|
+
ExecutionSchema.Query = z.object({
|
|
14
|
+
mode: z.enum(["process", "records"]).default("records"),
|
|
15
|
+
order: z.enum(["time", "round", "call"]).default("time"),
|
|
16
|
+
runID: z.string().optional(),
|
|
17
|
+
session: z.string().optional(),
|
|
18
|
+
actor: z.enum(["main", "all"]).default("main"),
|
|
19
|
+
query: z.string().max(500).optional(),
|
|
20
|
+
kind: z
|
|
21
|
+
.enum([
|
|
22
|
+
"turn",
|
|
23
|
+
"input",
|
|
24
|
+
"context",
|
|
25
|
+
"reasoning",
|
|
26
|
+
"output",
|
|
27
|
+
"model",
|
|
28
|
+
"retry",
|
|
29
|
+
"tool",
|
|
30
|
+
"process",
|
|
31
|
+
"compaction",
|
|
32
|
+
"subtask",
|
|
33
|
+
])
|
|
34
|
+
.optional(),
|
|
35
|
+
status: z.enum(["running", "completed", "failed", "cancelled", "interrupted", "unknown"]).optional(),
|
|
36
|
+
kinds: z.string().max(200).optional(),
|
|
37
|
+
statuses: z.string().max(100).optional(),
|
|
38
|
+
anomalies: z.preprocess((value) => (value === "false" ? false : value), z.coerce.boolean()).default(false),
|
|
39
|
+
from: z.coerce.number().nonnegative().optional(),
|
|
40
|
+
to: z.coerce.number().nonnegative().optional(),
|
|
41
|
+
activityFrom: z.coerce.number().int().nonnegative().optional(),
|
|
42
|
+
activityTo: z.coerce.number().int().nonnegative().optional(),
|
|
43
|
+
cursor: z.string().max(4096).optional(),
|
|
44
|
+
anchor: z.string().optional(),
|
|
45
|
+
position: z.enum(["before", "after", "around"]).optional(),
|
|
46
|
+
limit: z.coerce.number().int().min(1).max(500).default(100),
|
|
47
|
+
});
|
|
48
|
+
ExecutionSchema.Node = z
|
|
49
|
+
.object({
|
|
50
|
+
id: z.string(),
|
|
51
|
+
sessionID: z.string(),
|
|
52
|
+
runID: z.string(),
|
|
53
|
+
rootRunID: z.string().nullable().optional(),
|
|
54
|
+
parentID: z.string().nullable(),
|
|
55
|
+
kind: ExecutionSchema.Query.shape.kind.unwrap(),
|
|
56
|
+
title: z.string(),
|
|
57
|
+
preview: z.string(),
|
|
58
|
+
started: z.number(),
|
|
59
|
+
ended: z.number().optional(),
|
|
60
|
+
status: ExecutionSchema.Query.shape.status.unwrap(),
|
|
61
|
+
revision: z.number(),
|
|
62
|
+
messageID: z.string().optional(),
|
|
63
|
+
tool: z.string().optional(),
|
|
64
|
+
modelID: z.string().optional(),
|
|
65
|
+
modelKind: RolloutSchema.CallRecord.shape.kind,
|
|
66
|
+
agent: z.string().optional(),
|
|
67
|
+
callID: z.string().optional(),
|
|
68
|
+
source: z.enum(["recorded", "messages"]),
|
|
69
|
+
evidenceKind: RolloutEvidence.Kind.optional(),
|
|
70
|
+
attemptIndex: z.number().int().nonnegative().optional(),
|
|
71
|
+
purpose: z.string().optional(),
|
|
72
|
+
usageRole: z.string().optional(),
|
|
73
|
+
attribution: z.enum(["known", "unassigned"]).optional(),
|
|
74
|
+
tokens: RolloutAccounting.Metric.optional(),
|
|
75
|
+
group: z
|
|
76
|
+
.object({
|
|
77
|
+
id: z.string(),
|
|
78
|
+
started: z.number().optional(),
|
|
79
|
+
callCount: z.number().int().positive().optional(),
|
|
80
|
+
memberCount: z.number(),
|
|
81
|
+
attemptCount: z.number(),
|
|
82
|
+
retryCount: z.number(),
|
|
83
|
+
anomalies: z.number(),
|
|
84
|
+
purpose: z.string().nullable(),
|
|
85
|
+
})
|
|
86
|
+
.optional(),
|
|
87
|
+
ancestors: z.array(z.object({ id: z.string(), title: z.string(), kind: ExecutionSchema.Query.shape.kind.unwrap() })).optional(),
|
|
88
|
+
activity: z
|
|
89
|
+
.object({ index: z.number(), count: z.number(), endIndex: z.number(), instruction: z.boolean() })
|
|
90
|
+
.optional(),
|
|
91
|
+
})
|
|
92
|
+
.meta({ ref: "ExecutionTrajectoryNode" });
|
|
93
|
+
ExecutionSchema.Task = z
|
|
94
|
+
.object({
|
|
95
|
+
sessionID: z.string(),
|
|
96
|
+
nodeID: z.string().nullable(),
|
|
97
|
+
parentID: z.string().nullable(),
|
|
98
|
+
title: z.string(),
|
|
99
|
+
status: z.enum([
|
|
100
|
+
"running",
|
|
101
|
+
"completed",
|
|
102
|
+
"failed",
|
|
103
|
+
"cancelled",
|
|
104
|
+
"interrupted",
|
|
105
|
+
"unknown",
|
|
106
|
+
"queued",
|
|
107
|
+
"paused",
|
|
108
|
+
"waiting",
|
|
109
|
+
]),
|
|
110
|
+
elapsedMs: z.number().nullable(),
|
|
111
|
+
elapsedActive: z.boolean(),
|
|
112
|
+
elapsedLowerBound: z.boolean(),
|
|
113
|
+
tokens: RolloutAccounting.Metric,
|
|
114
|
+
runs: z.array(z.string()),
|
|
115
|
+
interaction: SessionInteraction.Info.optional(),
|
|
116
|
+
cortex: z
|
|
117
|
+
.object({
|
|
118
|
+
taskID: CortexTypes.Task.shape.id,
|
|
119
|
+
agent: CortexTypes.Task.shape.agent,
|
|
120
|
+
status: CortexTypes.TaskStatus,
|
|
121
|
+
visibility: CortexTypes.Task.shape.visibility,
|
|
122
|
+
})
|
|
123
|
+
.optional(),
|
|
124
|
+
})
|
|
125
|
+
.meta({ ref: "ExecutionTask" });
|
|
126
|
+
ExecutionSchema.ContextQuery = z.object({
|
|
127
|
+
runID: z.string().optional(),
|
|
128
|
+
cursor: z.string().max(4096).optional(),
|
|
129
|
+
limit: z.coerce.number().int().min(1).max(100).default(30),
|
|
130
|
+
});
|
|
131
|
+
ExecutionSchema.ContextSnapshot = z
|
|
132
|
+
.object({
|
|
133
|
+
sessionID: z.string(),
|
|
134
|
+
callID: z.string(),
|
|
135
|
+
nodeID: z.string(),
|
|
136
|
+
runID: z.string(),
|
|
137
|
+
started: z.number(),
|
|
138
|
+
requestNumber: z.number().int().positive(),
|
|
139
|
+
roundNumber: z.number().int().positive(),
|
|
140
|
+
status: RolloutSchema.Status,
|
|
141
|
+
modelID: z.string(),
|
|
142
|
+
providerID: z.string(),
|
|
143
|
+
inputTokens: z.number().nonnegative().nullable(),
|
|
144
|
+
contextLimit: z.number().nonnegative().nullable(),
|
|
145
|
+
outputTokens: z.number().nonnegative().nullable(),
|
|
146
|
+
cacheHit: z.number().min(0).max(1).nullable(),
|
|
147
|
+
elapsedMs: z.number().nonnegative().nullable(),
|
|
148
|
+
retries: z.number().int().nonnegative(),
|
|
149
|
+
usage: MessageV2.Assistant.shape.contextUsage.unwrap().nullable(),
|
|
150
|
+
estimate: ContextUsageEstimateSchema.optional(),
|
|
151
|
+
compactedBefore: z.boolean(),
|
|
152
|
+
requestAvailable: z.boolean(),
|
|
153
|
+
})
|
|
154
|
+
.meta({ ref: "ExecutionContextSnapshot" });
|
|
155
|
+
ExecutionSchema.ContextHistory = z
|
|
156
|
+
.object({
|
|
157
|
+
sessionID: z.string(),
|
|
158
|
+
revision: z.number(),
|
|
159
|
+
total: z.number(),
|
|
160
|
+
items: z.array(ExecutionSchema.ContextSnapshot),
|
|
161
|
+
nextCursor: z.string().nullable(),
|
|
162
|
+
})
|
|
163
|
+
.meta({ ref: "ExecutionContextHistory" });
|
|
164
|
+
ExecutionSchema.ContextItemsQuery = ExecutionSchema.ContextQuery.extend({
|
|
165
|
+
category: MessageV2.ContextSource.shape.category.optional(),
|
|
166
|
+
query: z.string().max(500).optional(),
|
|
167
|
+
version: z.string().max(4096).optional(),
|
|
168
|
+
});
|
|
169
|
+
ExecutionSchema.ContextItem = MessageV2.ContextSource.extend({
|
|
170
|
+
id: z.string(),
|
|
171
|
+
offset: z.number().nonnegative(),
|
|
172
|
+
bytes: z.number().nonnegative(),
|
|
173
|
+
}).meta({ ref: "ExecutionContextItem" });
|
|
174
|
+
ExecutionSchema.ContextItems = z
|
|
175
|
+
.object({
|
|
176
|
+
callID: z.string(),
|
|
177
|
+
nodeID: z.string(),
|
|
178
|
+
contentVersion: z.string().nullable(),
|
|
179
|
+
status: z.enum(["available", "legacy", "unavailable"]),
|
|
180
|
+
items: z.array(ExecutionSchema.ContextItem),
|
|
181
|
+
total: z.number(),
|
|
182
|
+
nextCursor: z.string().nullable(),
|
|
183
|
+
truncated: z.boolean(),
|
|
184
|
+
})
|
|
185
|
+
.meta({ ref: "ExecutionContextItems" });
|
|
186
|
+
ExecutionSchema.Summary = z
|
|
187
|
+
.object({
|
|
188
|
+
sessionID: z.string(),
|
|
189
|
+
revision: z.number(),
|
|
190
|
+
runID: z.string().optional(),
|
|
191
|
+
computedAt: z.number(),
|
|
192
|
+
clockID: z.string(),
|
|
193
|
+
sampledAt: z.number(),
|
|
194
|
+
status: ExecutionSchema.Task.shape.status,
|
|
195
|
+
elapsedMs: z.number().nullable(),
|
|
196
|
+
elapsedActive: z.boolean(),
|
|
197
|
+
elapsedLowerBound: z.boolean(),
|
|
198
|
+
accounting: RolloutAccounting.Summary,
|
|
199
|
+
cost: ExecutionPresentation.Cost,
|
|
200
|
+
own: RolloutAccounting.Summary,
|
|
201
|
+
descendants: RolloutAccounting.Summary,
|
|
202
|
+
rates: Usage.Summary.shape.rates,
|
|
203
|
+
cache: Usage.Summary.shape.cache,
|
|
204
|
+
latency: Usage.Summary.shape.latency,
|
|
205
|
+
outcomes: Usage.Summary.shape.outcomes,
|
|
206
|
+
tools: Usage.Summary.shape.tools,
|
|
207
|
+
context: Usage.Summary.shape.context,
|
|
208
|
+
contextDistribution: MessageV2.Assistant.shape.contextUsage.unwrap().nullable(),
|
|
209
|
+
tasks: z.array(ExecutionSchema.Task),
|
|
210
|
+
rounds: z.array(z.object({
|
|
211
|
+
id: z.string(),
|
|
212
|
+
title: z.string(),
|
|
213
|
+
started: z.number(),
|
|
214
|
+
status: ExecutionSchema.Task.shape.status,
|
|
215
|
+
elapsedMs: z.number().nullable(),
|
|
216
|
+
elapsedActive: z.boolean(),
|
|
217
|
+
elapsedLowerBound: z.boolean(),
|
|
218
|
+
})),
|
|
219
|
+
coverage: z.object({
|
|
220
|
+
recorded: z.number(),
|
|
221
|
+
messages: z.number(),
|
|
222
|
+
gaps: z.number().nullable(),
|
|
223
|
+
partial: z.boolean(),
|
|
224
|
+
}),
|
|
225
|
+
lanes: z.array(z.object({
|
|
226
|
+
kind: z.enum(["input", "model", "tool"]),
|
|
227
|
+
start: z.number(),
|
|
228
|
+
end: z.number(),
|
|
229
|
+
nodes: z.array(ExecutionSchema.Node),
|
|
230
|
+
total: z.number(),
|
|
231
|
+
})),
|
|
232
|
+
activityTotal: z.number(),
|
|
233
|
+
activitySegments: z
|
|
234
|
+
.array(z.object({
|
|
235
|
+
runID: z.string().nullable(),
|
|
236
|
+
from: z.number(),
|
|
237
|
+
to: z.number(),
|
|
238
|
+
count: z.number(),
|
|
239
|
+
rounds: z.number(),
|
|
240
|
+
}))
|
|
241
|
+
.optional(),
|
|
242
|
+
humanInputs: z.number(),
|
|
243
|
+
taskInstructions: z.number(),
|
|
244
|
+
})
|
|
245
|
+
.meta({ ref: "ExecutionSummary" });
|
|
246
|
+
ExecutionSchema.Page = z
|
|
247
|
+
.object({
|
|
248
|
+
sessionID: z.string(),
|
|
249
|
+
revision: z.number(),
|
|
250
|
+
total: z.number(),
|
|
251
|
+
items: z.array(ExecutionSchema.Node),
|
|
252
|
+
nextCursor: z.string().nullable(),
|
|
253
|
+
previousCursor: z.string().nullable(),
|
|
254
|
+
})
|
|
255
|
+
.meta({ ref: "ExecutionTrajectoryPage" });
|
|
256
|
+
ExecutionSchema.Detail = z
|
|
257
|
+
.object({
|
|
258
|
+
node: ExecutionSchema.Node,
|
|
259
|
+
execution: ExecutionSchema.Summary.pick({
|
|
260
|
+
status: true,
|
|
261
|
+
elapsedMs: true,
|
|
262
|
+
elapsedActive: true,
|
|
263
|
+
elapsedLowerBound: true,
|
|
264
|
+
clockID: true,
|
|
265
|
+
sampledAt: true,
|
|
266
|
+
revision: true,
|
|
267
|
+
}).optional(),
|
|
268
|
+
record: Json.nullable(),
|
|
269
|
+
sources: z.array(z.object({ field: z.string(), artifact: RolloutSchema.ArtifactRef })),
|
|
270
|
+
definitions: Json.nullable(),
|
|
271
|
+
related: z.array(ExecutionSchema.Node),
|
|
272
|
+
})
|
|
273
|
+
.meta({ ref: "ExecutionNodeDetail" });
|
|
274
|
+
ExecutionSchema.Content = RolloutEvidence.Content;
|
|
275
|
+
ExecutionSchema.Updated = BusEvent.define("execution.updated", z.object({
|
|
276
|
+
sessionID: z.string(),
|
|
277
|
+
revision: z.number(),
|
|
278
|
+
summary: ExecutionSchema.Summary,
|
|
279
|
+
roundSummaries: z.array(ExecutionSchema.Summary),
|
|
280
|
+
contextUpserts: z.array(ExecutionSchema.ContextSnapshot).optional(),
|
|
281
|
+
previousRevision: z.number().int().nonnegative().optional(),
|
|
282
|
+
upserts: z.array(ExecutionSchema.Node),
|
|
283
|
+
processUpserts: z.array(ExecutionSchema.Node).optional(),
|
|
284
|
+
processRemoved: z.array(z.string()).optional(),
|
|
285
|
+
removed: z.array(z.string()),
|
|
286
|
+
}));
|
|
287
|
+
const ProjectionBase = z.object({
|
|
288
|
+
sessionID: z.string(),
|
|
289
|
+
revision: z.number().int().nonnegative(),
|
|
290
|
+
previousRevision: z.number().int().nonnegative(),
|
|
291
|
+
contexts: z.array(ExecutionSchema.ContextSnapshot),
|
|
292
|
+
contextTotal: z.number().int().nonnegative(),
|
|
293
|
+
});
|
|
294
|
+
ExecutionSchema.Projection = z
|
|
295
|
+
.discriminatedUnion("state", [
|
|
296
|
+
ProjectionBase.extend({ state: z.literal("root") }),
|
|
297
|
+
ProjectionBase.extend({
|
|
298
|
+
state: z.literal("preparing"),
|
|
299
|
+
progress: z.object({
|
|
300
|
+
stage: z.enum(["metadata", "messages", "parts"]),
|
|
301
|
+
prepared: z.number().int().nonnegative(),
|
|
302
|
+
total: z.number().int().nonnegative().optional(),
|
|
303
|
+
}),
|
|
304
|
+
}),
|
|
305
|
+
ProjectionBase.extend({
|
|
306
|
+
state: z.literal("failed"),
|
|
307
|
+
error: z.object({ kind: z.string(), message: z.string(), retryable: z.boolean() }),
|
|
308
|
+
}),
|
|
309
|
+
ProjectionBase.extend({
|
|
310
|
+
state: z.literal("ready"),
|
|
311
|
+
summary: ExecutionSchema.Summary,
|
|
312
|
+
detailPreviousRevision: z.number().int().nonnegative(),
|
|
313
|
+
roundSummaries: z.array(ExecutionSchema.Summary),
|
|
314
|
+
upserts: z.array(ExecutionSchema.Node),
|
|
315
|
+
processUpserts: z.array(ExecutionSchema.Node),
|
|
316
|
+
processRemoved: z.array(z.string()),
|
|
317
|
+
removed: z.array(z.string()),
|
|
318
|
+
}),
|
|
319
|
+
])
|
|
320
|
+
.meta({ ref: "ExecutionProjection" });
|
|
321
|
+
ExecutionSchema.ProjectionUpdated = BusEvent.define("execution.projection", ExecutionSchema.Projection);
|
|
322
|
+
})(ExecutionSchema || (ExecutionSchema = {}));
|