* Locate the safe_outputs_mcp_server.cjs script. The setup action copies it * into ${RUNNER_TEMP}/gh-aw/actions/ alongside this driver; fall back to * resolving via __dirname for local-execution / tests. * @returns {string}
()
| 474 | * @returns {string} |
| 475 | */ |
| 476 | function resolveMcpServerPath() { |
| 477 | const candidates = [ |
| 478 | path.join(__dirname, "safe_outputs_mcp_server.cjs"), |
| 479 | process.env.RUNNER_TEMP ? path.join(process.env.RUNNER_TEMP, "gh-aw", "actions", "safe_outputs_mcp_server.cjs") : null, |
| 480 | process.env.RUNNER_TEMP ? path.join(process.env.RUNNER_TEMP, "gh-aw", "safeoutputs", "safe_outputs_mcp_server.cjs") : null, |
| 481 | ].filter(/** @returns {p is string} */ p => typeof p === "string"); |
| 482 | for (const candidate of candidates) { |
| 483 | if (fs.existsSync(candidate)) { |
| 484 | return candidate; |
| 485 | } |
| 486 | } |
| 487 | throw new Error(`${ERR_CONFIG}: apply_samples: could not locate safe_outputs_mcp_server.cjs. Looked in: ${candidates.join(", ")}`); |
| 488 | } |
| 489 | |
| 490 | /** |
| 491 | * Return true when an MCP tool-call result carries an application-level error |