@oisincoveney/pipeline 3.5.0 → 3.6.1

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.
@@ -52,8 +52,31 @@ hooks:
52
52
  runner_command:
53
53
  environment:
54
54
  setup:
55
- - command: bun
56
- args: [install, --frozen-lockfile]
55
+ # Environment bootstrap (dependency install, toolchain pinning, codegen) is
56
+ # OWNED BY THE TARGET REPO and is REQUIRED — moka does not guess it. The
57
+ # repo's own CI already encodes the correct sequence (package manager,
58
+ # mise/asdf/nvm toolchains, generated clients), which moka cannot reliably
59
+ # reproduce. moka runs the repo's declared entrypoint here: an executable
60
+ # .moka/bootstrap.sh, or a "moka:setup" package.json script. If the repo
61
+ # declares neither, the run fails loudly rather than silently under-
62
+ # provisioning the workspace.
63
+ - command: sh
64
+ args:
65
+ - -c
66
+ - |
67
+ if [ -f .moka/bootstrap.sh ]; then
68
+ echo "moka: running repo bootstrap (.moka/bootstrap.sh)"
69
+ sh .moka/bootstrap.sh
70
+ elif [ -f package.json ] && grep -q '"moka:setup"' package.json; then
71
+ echo "moka: running repo bootstrap (npm run moka:setup)"
72
+ npm run moka:setup
73
+ else
74
+ echo "moka: repo environment bootstrap is REQUIRED but was not found." >&2
75
+ echo "Add an executable .moka/bootstrap.sh (or a 'moka:setup' package.json script)" >&2
76
+ echo "that installs dependencies and any toolchain/codegen this repo needs." >&2
77
+ echo "moka does not guess dependency/toolchain setup." >&2
78
+ exit 1
79
+ fi
57
80
  # Set up package-owned pipeline support + the opencode model registration
58
81
  # (.opencode/opencode.json, which declares the gpt-5.5-* reasoning selectors)
59
82
  # on every run, so opencode-backed agents in the pod resolve their models
@@ -232,11 +232,13 @@ function runSetupCommand(command, index, options) {
232
232
  const io = yield* RunnerCommandIoService;
233
233
  const commandIndex = index + 1;
234
234
  options.logger.info(setupCommandLog(command.command, commandIndex, "start"), "setup.command start");
235
- const exitCode = setupExitCode((yield* io.runSetupCommand(command.command, command.args, {
235
+ const result = yield* io.runSetupCommand(command.command, command.args, {
236
236
  cwd: options.worktreePath,
237
237
  env: options.env
238
- })).exitCode);
238
+ });
239
+ const exitCode = setupExitCode(result.exitCode);
239
240
  options.logger.info(setupCommandFinishLog(command, commandIndex, exitCode), "setup.command finish");
241
+ if (exitCode !== 0) options.logger.error(setupCommandOutputLog(command.command, commandIndex, result), "setup.command output");
240
242
  if (exitCode !== 0 && command.required) return yield* Effect.fail(/* @__PURE__ */ new Error(`runner setup command '${command.command}' failed with exit ${exitCode}`));
241
243
  });
242
244
  }
@@ -244,6 +246,21 @@ function setupExitCode(exitCode) {
244
246
  if (typeof exitCode === "number") return exitCode;
245
247
  return 1;
246
248
  }
249
+ const SETUP_OUTPUT_TAIL = 4e3;
250
+ function setupOutputTail(output) {
251
+ if (typeof output !== "string" || output.length === 0) return "";
252
+ return output.length > SETUP_OUTPUT_TAIL ? output.slice(-4e3) : output;
253
+ }
254
+ function setupCommandOutputLog(command, index, result) {
255
+ return {
256
+ command,
257
+ index,
258
+ phase: "setup.command",
259
+ status: "output",
260
+ stderr: setupOutputTail(result.stderr),
261
+ stdout: setupOutputTail(result.stdout)
262
+ };
263
+ }
247
264
  function setupCommandLog(command, index, status) {
248
265
  return {
249
266
  command,
package/package.json CHANGED
@@ -126,7 +126,7 @@
126
126
  "prepack": "bun run build:cli"
127
127
  },
128
128
  "type": "module",
129
- "version": "3.5.0",
129
+ "version": "3.6.1",
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",