amsd-pipeline-workflow 0.1.8 → 0.1.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.
@@ -686,7 +686,12 @@ if (require.main === module) {
686
686
  const answer = input.tool_input || {};
687
687
  const pj = JSON.parse(fs.readFileSync(a.pipeline, 'utf8'));
688
688
  const env = JSON.parse(fs.readFileSync(pj.env, 'utf8'));
689
- const out = (result) => process.stdout.write(`${JSON.stringify({ hookSpecificOutput: { hookEventName: 'PreToolUse', permissionDecision: 'allow',
689
+ // THE HOOK'S STDOUT IS ITS JSON ONLY (B60, LIVE-AMSD-2974-10): the pipeline's Spec code runs in this process and logs with
690
+ // console.log (spec-mode-runner.js "… file(s) left its scope"); one such line ahead of the JSON and Claude Code drops the
691
+ // result. Everything else written to stdout goes to stderr; only `out` writes stdout.
692
+ const stdout = process.stdout.write.bind(process.stdout);
693
+ process.stdout.write = (chunk, ...rest) => process.stderr.write(chunk, ...rest);
694
+ const out = (result) => stdout(`${JSON.stringify({ hookSpecificOutput: { hookEventName: 'PreToolUse', permissionDecision: 'allow',
690
695
  updatedInput: { ...answer, result } } })}\n`);
691
696
  Promise.resolve().then(() => sr.withEnv(env, () => handle(event, a, answer, pj)))
692
697
  .then((r) => out(r))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "amsd-pipeline-workflow",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "The AMSD pipeline as Claude workflows. Installed by the amsd-pipeline installer: install.sh --workflows",
5
5
  "license": "UNLICENSED",
6
6
  "bin": {