@oisincoveney/pipeline 1.27.13 → 1.27.15

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/dist/hooks.d.ts CHANGED
@@ -13,8 +13,8 @@ declare const hookResultSchema: z.ZodObject<{
13
13
  taskContext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
14
14
  }, z.core.$strict>>;
15
15
  status: z.ZodEnum<{
16
- fail: "fail";
17
16
  pass: "pass";
17
+ fail: "fail";
18
18
  skip: "skip";
19
19
  }>;
20
20
  summary: z.ZodOptional<z.ZodString>;
package/dist/index.js CHANGED
@@ -210,7 +210,7 @@ function truncateMiddle(text, maxLength) {
210
210
  function createCliProgram() {
211
211
  const configuredPipeline = loadConfiguredEntrypoints(process.env.PIPELINE_TARGET_PATH ?? process.cwd());
212
212
  const program = new Command();
213
- program.name("moka").description("Submit work to Momokaya").exitOverride();
213
+ program.name("moka").description("Submit work to Momokaya").version(readPackageVersion()).exitOverride();
214
214
  const runAction = async (descriptionParts, flags) => {
215
215
  await execute(descriptionParts.join(" "), {
216
216
  entrypoint: flags.entrypoint,
@@ -303,6 +303,11 @@ function createCliProgram() {
303
303
  } });
304
304
  return program;
305
305
  }
306
+ function readPackageVersion() {
307
+ const packageJson = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
308
+ if (typeof packageJson.version !== "string") throw new Error("Unable to read @oisincoveney/pipeline package version.");
309
+ return packageJson.version;
310
+ }
306
311
  function addMokaSubmitOptions(command) {
307
312
  return addRunnerArgoOptions(command.option("--quick", "submit the compact graph").option("--command", "treat input after -- as explicit argv").option("--schedule <path>", "approved schedule YAML to submit").option("--event-url <url>", "runner event sink URL").option("--task <text>", "task description for command-mode metadata"), { kubeconfig: true });
308
313
  }
@@ -28,6 +28,7 @@ function runPipelineFromConfig(options) {
28
28
  function runScheduledWorkflowTask(options) {
29
29
  const { dependencyOutputs, nodeId, ...runtimeOptions } = options;
30
30
  const context = createRuntimeContext(runtimeOptions);
31
+ hydrateScheduledDependencyStates(context, nodeId);
31
32
  hydrateDependencyOutputs(context, dependencyOutputs);
32
33
  recordNodeEvent(context, nodeId, {
33
34
  at: now(),
@@ -208,6 +209,57 @@ function hydrateDependencyOutputs(context, dependencyOutputs) {
208
209
  });
209
210
  }
210
211
  }
212
+ function hydrateScheduledDependencyStates(context, nodeId) {
213
+ const finishedAt = now();
214
+ for (const dependencyId of scheduledDependencyNodeIds(context, nodeId)) {
215
+ const existing = context.nodeStates.get(dependencyId);
216
+ context.nodeStates.set(dependencyId, scheduledDependencyState(dependencyId, finishedAt, existing));
217
+ }
218
+ }
219
+ function scheduledDependencyState(id, finishedAt, existing) {
220
+ return completedScheduledDependencyState(existing ?? emptyScheduledDependencyState(id), finishedAt);
221
+ }
222
+ function emptyScheduledDependencyState(id) {
223
+ return {
224
+ attempts: 0,
225
+ evidence: [],
226
+ gates: [],
227
+ id,
228
+ status: "pending"
229
+ };
230
+ }
231
+ function completedScheduledDependencyState(base, finishedAt) {
232
+ return {
233
+ ...base,
234
+ attempts: positiveAttempts(base),
235
+ evidence: dependencyEvidence(base),
236
+ exitCode: base.exitCode ?? 0,
237
+ finishedAt: base.finishedAt ?? finishedAt,
238
+ output: base.output ?? "",
239
+ status: "passed"
240
+ };
241
+ }
242
+ function positiveAttempts(state) {
243
+ return state.attempts > 0 ? state.attempts : 1;
244
+ }
245
+ function dependencyEvidence(state) {
246
+ return state.evidence.length > 0 ? state.evidence : ["dependency satisfied by scheduled workflow"];
247
+ }
248
+ function scheduledDependencyNodeIds(context, nodeId) {
249
+ const visited = /* @__PURE__ */ new Set();
250
+ const ordered = [];
251
+ const visit = (candidateId) => {
252
+ if (visited.has(candidateId)) return;
253
+ visited.add(candidateId);
254
+ const candidate = context.plan.graph.node(candidateId);
255
+ if (!candidate) return;
256
+ for (const need of candidate.needs) visit(need);
257
+ ordered.push(candidateId);
258
+ };
259
+ const node = context.plan.graph.node(nodeId);
260
+ for (const need of node?.needs ?? []) visit(need);
261
+ return ordered;
262
+ }
211
263
  function cancelledFailure() {
212
264
  return {
213
265
  evidence: ["pipeline cancelled by AbortSignal"],
package/package.json CHANGED
@@ -120,7 +120,7 @@
120
120
  "prepack": "bun run build:cli"
121
121
  },
122
122
  "type": "module",
123
- "version": "1.27.13",
123
+ "version": "1.27.15",
124
124
  "description": "Config-driven multi-agent pipeline runner for repository work",
125
125
  "main": "./dist/index.js",
126
126
  "types": "./dist/index.d.ts",