feat(workflow-utils): dryRun support for spawnSafe, cursorAgent, llmExtract #104

Closed
opened 2026-04-25 00:19:10 +00:00 by xiaoju · 0 comments
Owner

概述

workflow-utils 的三个副作用函数需要支持 dryRun 模式。dryRun 时:

  • 打印调用参数到 stdout(会被 log-store 记录)
  • 不实际执行任何子进程或网络调用
  • 返回 stub 成功结果

需要改的函数

1. spawnSafe

SpawnSafeOptions 加 dryRun: boolean(默认 false)。dryRun 时打印参数,返回 { ok: true, value: { code: 0, stdout: '[dryRun] skipped', stderr: '' } }

2. cursorAgent

CursorAgentOptions 加 dryRun: boolean(默认 false)。dryRun 时打印参数,返回 stub(在 cursorAgent 层短路,不走 spawnSafe)

3. llmExtract

LlmExtractOptions 加 dryRun: boolean(默认 false)。dryRun 时打印参数,返回 { ok: true, value: {} as T }

约束

  • type not interface,no optional
  • 现有调用不传 dryRun 不 break
  • pnpm run check && pnpm run build && pnpm -r run test 全过
## 概述 workflow-utils 的三个副作用函数需要支持 dryRun 模式。dryRun 时: - 打印调用参数到 stdout(会被 log-store 记录) - 不实际执行任何子进程或网络调用 - 返回 stub 成功结果 ## 需要改的函数 ### 1. spawnSafe SpawnSafeOptions 加 dryRun: boolean(默认 false)。dryRun 时打印参数,返回 { ok: true, value: { code: 0, stdout: '[dryRun] skipped', stderr: '' } } ### 2. cursorAgent CursorAgentOptions 加 dryRun: boolean(默认 false)。dryRun 时打印参数,返回 stub(在 cursorAgent 层短路,不走 spawnSafe) ### 3. llmExtract LlmExtractOptions 加 dryRun: boolean(默认 false)。dryRun 时打印参数,返回 { ok: true, value: {} as T } ## 约束 - type not interface,no optional - 现有调用不传 dryRun 不 break - pnpm run check && pnpm run build && pnpm -r run test 全过
This repo is archived. You cannot comment on issues.
No Label
1 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/nerve#104