@nowcrew/daemon 0.6.17 → 0.6.18

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/main.js CHANGED
File without changes
@@ -37,6 +37,7 @@ const MAX_TRANSIENT_TURN_RETRIES = 2;
37
37
  const TRANSIENT_TURN_RETRY_DELAY_MS = 15_000;
38
38
  const TRANSIENT_TURN_RETRY_BACKOFF_FACTOR = 3;
39
39
  const PROCESS_TREE_STOP_TIMEOUT_MS = 1_000;
40
+ const USER_INPUT_UNAVAILABLE_MESSAGE = "NowWork cannot collect interactive user input in this headless run; ask the user in the final response instead of assuming an answer.";
40
41
  export function codexAppServerArgs(projectRootMarkers) {
41
42
  return [
42
43
  ...(projectRootMarkers === undefined
@@ -197,8 +198,9 @@ export function codexApprovalResponse(method, permission) {
197
198
  || method === "item/fileChange/requestApproval") {
198
199
  return { decision: permission === "full_access" ? "accept" : "decline" };
199
200
  }
200
- if (method === "item/tool/requestUserInput")
201
- return { answers: {} };
201
+ if (method === "item/tool/requestUserInput") {
202
+ return { error: { code: -32002, message: USER_INPUT_UNAVAILABLE_MESSAGE } };
203
+ }
202
204
  return null;
203
205
  }
204
206
  /** Translate app-server v2 notifications into the daemon's existing runtime event contract. */
@@ -321,6 +323,10 @@ class CodexRpcClient {
321
323
  error: { code: -32001, message: `NowCrew denied unsupported request ${message.method}` },
322
324
  });
323
325
  }
326
+ else if (result.error !== undefined && typeof result.error === "object" && result.error !== null) {
327
+ process.stderr.write("[codex-app-server] interactive user input is unavailable; returned a truthful RPC error\n");
328
+ this.write({ jsonrpc: "2.0", id: message.id, error: result.error });
329
+ }
324
330
  else {
325
331
  this.write({ jsonrpc: "2.0", id: message.id, result });
326
332
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nowcrew/daemon",
3
- "version": "0.6.17",
3
+ "version": "0.6.18",
4
4
  "type": "module",
5
5
  "description": "crew daemon — 运行在用户机器:拉起/管理 agent 进程,注入 crew CLI,归一化 runtime 事件",
6
6
  "license": "Apache-2.0",
@@ -16,9 +16,16 @@
16
16
  "publishConfig": {
17
17
  "access": "public"
18
18
  },
19
+ "scripts": {
20
+ "daemon": "pnpm --filter @nowcrew/cli build && tsx src/main.ts",
21
+ "build": "tsc -p tsconfig.json",
22
+ "prepublishOnly": "pnpm build && node ../scripts/daemon-release-artifact.mjs --strict-registry",
23
+ "test": "vitest run",
24
+ "typecheck": "tsc --noEmit"
25
+ },
19
26
  "dependencies": {
20
27
  "@agentclientprotocol/sdk": "1.2.1",
21
- "@nowcrew/cli": "^0.4.13",
28
+ "@nowcrew/cli": "^0.4.14",
22
29
  "cross-spawn": "^7.0.6",
23
30
  "ws": "^8",
24
31
  "yaml": "^2.8.1",
@@ -34,11 +41,5 @@
34
41
  "tsx": "^4.19.0",
35
42
  "typescript": "^5.6.0",
36
43
  "vitest": "^2.1.0"
37
- },
38
- "scripts": {
39
- "daemon": "pnpm --filter @nowcrew/cli build && tsx src/main.ts",
40
- "build": "tsc -p tsconfig.json",
41
- "test": "vitest run",
42
- "typecheck": "tsc --noEmit"
43
44
  }
44
- }
45
+ }