@oisincoveney/pipeline 3.7.0 → 3.7.2

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.
@@ -226,8 +226,8 @@ declare const configSchema: z.ZodObject<{
226
226
  policy: z.ZodOptional<z.ZodObject<{
227
227
  commands: z.ZodOptional<z.ZodEnum<{
228
228
  allow: "allow";
229
- deny: "deny";
230
229
  "trusted-only": "trusted-only";
230
+ deny: "deny";
231
231
  }>>;
232
232
  modules: z.ZodOptional<z.ZodEnum<{
233
233
  allow: "allow";
@@ -255,8 +255,8 @@ declare const configSchema: z.ZodObject<{
255
255
  global: "global";
256
256
  }>>;
257
257
  mode: z.ZodEnum<{
258
- local: "local";
259
258
  hosted: "hosted";
259
+ local: "local";
260
260
  }>;
261
261
  provider: z.ZodLiteral<"toolhive">;
262
262
  authorization_env: z.ZodDefault<z.ZodString>;
@@ -299,10 +299,10 @@ declare const configSchema: z.ZodObject<{
299
299
  }, z.core.$strict>>;
300
300
  output: z.ZodOptional<z.ZodObject<{
301
301
  format: z.ZodEnum<{
302
- json_schema: "json_schema";
303
302
  text: "text";
304
303
  json: "json";
305
304
  jsonl: "jsonl";
305
+ json_schema: "json_schema";
306
306
  }>;
307
307
  repair: z.ZodOptional<z.ZodObject<{
308
308
  enabled: z.ZodOptional<z.ZodBoolean>;
@@ -371,10 +371,10 @@ declare const configSchema: z.ZodObject<{
371
371
  disabled: "disabled";
372
372
  }>>>;
373
373
  output_formats: z.ZodOptional<z.ZodArray<z.ZodEnum<{
374
- json_schema: "json_schema";
375
374
  text: "text";
376
375
  json: "json";
377
376
  jsonl: "jsonl";
377
+ json_schema: "json_schema";
378
378
  }>>>;
379
379
  rules: z.ZodOptional<z.ZodBoolean>;
380
380
  skills: z.ZodOptional<z.ZodBoolean>;
@@ -261,6 +261,7 @@ interface RunnerHookResultDetails {
261
261
  }
262
262
  interface RunnerEventEnvelope {
263
263
  at?: string;
264
+ runId: string;
264
265
  sequence: number;
265
266
  type: string;
266
267
  }
@@ -143,6 +143,7 @@ function parseRunnerCommandPayloadWithIssues(rawPayload) {
143
143
  function mapRuntimeEventToRunnerEventRecords(event, context) {
144
144
  const record = {
145
145
  at: context.timestamp,
146
+ runId: context.runId,
146
147
  sequence: context.sequence ?? 1
147
148
  };
148
149
  return mapWorkflowRunnerEvent(event, context, record) ?? mapNodeRunnerEvent(event, record) ?? mapGateRunnerEvent(event, record) ?? mapArtifactRunnerEvent(event, record) ?? mapLogRunnerEvent(event, record) ?? throwUnhandledRuntimeEvent(event);
@@ -164,6 +165,7 @@ function mapWorkflowRunnerEvent(event, context, record) {
164
165
  source: edge.source,
165
166
  target: edge.target
166
167
  },
168
+ runId: context.runId,
167
169
  sequence: (context.sequence ?? 1) + index + 1,
168
170
  type: "workflow.edge"
169
171
  }))];
@@ -8,6 +8,7 @@ import { z } from "zod";
8
8
  */
9
9
  declare const runnerEventRecordSchema: z.ZodUnion<readonly [z.ZodObject<{
10
10
  at: z.ZodOptional<z.ZodString>;
11
+ runId: z.ZodString;
11
12
  sequence: z.ZodNumber;
12
13
  type: z.ZodEnum<{
13
14
  "workflow.planned": "workflow.planned";
@@ -30,6 +31,7 @@ declare const runnerEventRecordSchema: z.ZodUnion<readonly [z.ZodObject<{
30
31
  }, z.core.$strip>;
31
32
  }, z.core.$strip>, z.ZodObject<{
32
33
  at: z.ZodOptional<z.ZodString>;
34
+ runId: z.ZodString;
33
35
  sequence: z.ZodNumber;
34
36
  edge: z.ZodObject<{
35
37
  id: z.ZodString;
@@ -39,6 +41,7 @@ declare const runnerEventRecordSchema: z.ZodUnion<readonly [z.ZodObject<{
39
41
  type: z.ZodLiteral<"workflow.edge">;
40
42
  }, z.core.$strip>, z.ZodObject<{
41
43
  at: z.ZodOptional<z.ZodString>;
44
+ runId: z.ZodString;
42
45
  sequence: z.ZodNumber;
43
46
  node: z.ZodObject<{
44
47
  attempt: z.ZodNumber;
@@ -62,6 +65,7 @@ declare const runnerEventRecordSchema: z.ZodUnion<readonly [z.ZodObject<{
62
65
  }>;
63
66
  }, z.core.$strip>, z.ZodObject<{
64
67
  at: z.ZodOptional<z.ZodString>;
68
+ runId: z.ZodString;
65
69
  sequence: z.ZodNumber;
66
70
  gate: z.ZodObject<{
67
71
  event: z.ZodOptional<z.ZodString>;
@@ -89,6 +93,7 @@ declare const runnerEventRecordSchema: z.ZodUnion<readonly [z.ZodObject<{
89
93
  }>;
90
94
  }, z.core.$strip>, z.ZodObject<{
91
95
  at: z.ZodOptional<z.ZodString>;
96
+ runId: z.ZodString;
92
97
  sequence: z.ZodNumber;
93
98
  hookResult: z.ZodObject<{
94
99
  artifacts: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -113,6 +118,7 @@ declare const runnerEventRecordSchema: z.ZodUnion<readonly [z.ZodObject<{
113
118
  type: z.ZodLiteral<"hook.result">;
114
119
  }, z.core.$strip>, z.ZodObject<{
115
120
  at: z.ZodOptional<z.ZodString>;
121
+ runId: z.ZodString;
116
122
  sequence: z.ZodNumber;
117
123
  artifact: z.ZodObject<{
118
124
  kind: z.ZodLiteral<"artifact">;
@@ -135,6 +141,7 @@ declare const runnerEventRecordSchema: z.ZodUnion<readonly [z.ZodObject<{
135
141
  }>;
136
142
  }, z.core.$strip>, z.ZodObject<{
137
143
  at: z.ZodOptional<z.ZodString>;
144
+ runId: z.ZodString;
138
145
  sequence: z.ZodNumber;
139
146
  log: z.ZodObject<{
140
147
  attempt: z.ZodOptional<z.ZodNumber>;
@@ -160,6 +167,7 @@ declare const runnerEventRecordSchema: z.ZodUnion<readonly [z.ZodObject<{
160
167
  }>;
161
168
  }, z.core.$strip>, z.ZodObject<{
162
169
  at: z.ZodOptional<z.ZodString>;
170
+ runId: z.ZodString;
163
171
  sequence: z.ZodNumber;
164
172
  finalResult: z.ZodObject<{
165
173
  outcome: z.ZodEnum<{
@@ -178,6 +186,7 @@ declare const runnerEventRecordSchema: z.ZodUnion<readonly [z.ZodObject<{
178
186
  declare const runnerEventBatchSchema: z.ZodObject<{
179
187
  events: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
180
188
  at: z.ZodOptional<z.ZodString>;
189
+ runId: z.ZodString;
181
190
  sequence: z.ZodNumber;
182
191
  type: z.ZodEnum<{
183
192
  "workflow.planned": "workflow.planned";
@@ -200,6 +209,7 @@ declare const runnerEventBatchSchema: z.ZodObject<{
200
209
  }, z.core.$strip>;
201
210
  }, z.core.$strip>, z.ZodObject<{
202
211
  at: z.ZodOptional<z.ZodString>;
212
+ runId: z.ZodString;
203
213
  sequence: z.ZodNumber;
204
214
  edge: z.ZodObject<{
205
215
  id: z.ZodString;
@@ -209,6 +219,7 @@ declare const runnerEventBatchSchema: z.ZodObject<{
209
219
  type: z.ZodLiteral<"workflow.edge">;
210
220
  }, z.core.$strip>, z.ZodObject<{
211
221
  at: z.ZodOptional<z.ZodString>;
222
+ runId: z.ZodString;
212
223
  sequence: z.ZodNumber;
213
224
  node: z.ZodObject<{
214
225
  attempt: z.ZodNumber;
@@ -232,6 +243,7 @@ declare const runnerEventBatchSchema: z.ZodObject<{
232
243
  }>;
233
244
  }, z.core.$strip>, z.ZodObject<{
234
245
  at: z.ZodOptional<z.ZodString>;
246
+ runId: z.ZodString;
235
247
  sequence: z.ZodNumber;
236
248
  gate: z.ZodObject<{
237
249
  event: z.ZodOptional<z.ZodString>;
@@ -259,6 +271,7 @@ declare const runnerEventBatchSchema: z.ZodObject<{
259
271
  }>;
260
272
  }, z.core.$strip>, z.ZodObject<{
261
273
  at: z.ZodOptional<z.ZodString>;
274
+ runId: z.ZodString;
262
275
  sequence: z.ZodNumber;
263
276
  hookResult: z.ZodObject<{
264
277
  artifacts: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -283,6 +296,7 @@ declare const runnerEventBatchSchema: z.ZodObject<{
283
296
  type: z.ZodLiteral<"hook.result">;
284
297
  }, z.core.$strip>, z.ZodObject<{
285
298
  at: z.ZodOptional<z.ZodString>;
299
+ runId: z.ZodString;
286
300
  sequence: z.ZodNumber;
287
301
  artifact: z.ZodObject<{
288
302
  kind: z.ZodLiteral<"artifact">;
@@ -305,6 +319,7 @@ declare const runnerEventBatchSchema: z.ZodObject<{
305
319
  }>;
306
320
  }, z.core.$strip>, z.ZodObject<{
307
321
  at: z.ZodOptional<z.ZodString>;
322
+ runId: z.ZodString;
308
323
  sequence: z.ZodNumber;
309
324
  log: z.ZodObject<{
310
325
  attempt: z.ZodOptional<z.ZodNumber>;
@@ -330,6 +345,7 @@ declare const runnerEventBatchSchema: z.ZodObject<{
330
345
  }>;
331
346
  }, z.core.$strip>, z.ZodObject<{
332
347
  at: z.ZodOptional<z.ZodString>;
348
+ runId: z.ZodString;
333
349
  sequence: z.ZodNumber;
334
350
  finalResult: z.ZodObject<{
335
351
  outcome: z.ZodEnum<{
@@ -2,6 +2,7 @@ import { z } from "zod";
2
2
  //#region src/runner-event-schema.ts
3
3
  const runnerEventEnvelopeSchema = z.object({
4
4
  at: z.string().optional(),
5
+ runId: z.string().min(1),
5
6
  sequence: z.number().int().positive()
6
7
  });
7
8
  const runnerWorkflowNodeDetailsSchema = z.object({
@@ -18,6 +18,7 @@ function createRunnerEventSink(options) {
18
18
  nextSequence += 1;
19
19
  return {
20
20
  at: timestamp(options.now),
21
+ runId: options.runId,
21
22
  sequence
22
23
  };
23
24
  };
@@ -324,7 +324,18 @@ function unwrap(response) {
324
324
  return response.data;
325
325
  }
326
326
  function errorMessage(error) {
327
- return error instanceof Error ? error.message : String(error);
327
+ if (!(error instanceof Error)) return String(error);
328
+ const messages = [];
329
+ const seen = /* @__PURE__ */ new Set();
330
+ let current = error;
331
+ while (current instanceof Error && !seen.has(current)) {
332
+ seen.add(current);
333
+ const code = current.code;
334
+ const codeSuffix = typeof code === "string" ? ` (${code})` : "";
335
+ messages.push(`${current.message}${codeSuffix}`);
336
+ current = current.cause;
337
+ }
338
+ return messages.join(": ");
328
339
  }
329
340
  //#endregion
330
341
  export { createOpencodeExecutor, createOpencodeSessionRegistry };
package/package.json CHANGED
@@ -126,7 +126,7 @@
126
126
  "prepack": "bun run build:cli"
127
127
  },
128
128
  "type": "module",
129
- "version": "3.7.0",
129
+ "version": "3.7.2",
130
130
  "description": "Config-driven multi-agent pipeline runner for repository work",
131
131
  "main": "./dist/index.js",
132
132
  "types": "./dist/index.d.ts",