@zvada/agent-server 0.3.24 → 0.3.26

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.
Files changed (190) hide show
  1. package/CHANGELOG.md +110 -0
  2. package/README.md +3 -0
  3. package/dist/client/client.js +93 -34
  4. package/dist/core/agents/acp/acp-agent.js +91 -14
  5. package/dist/core/agents/acp/mappings.js +5 -1
  6. package/dist/core/agents/claude-code/approvals.js +2 -1
  7. package/dist/core/agents/claude-code/claude-agent.js +12 -2
  8. package/dist/core/agents/claude-code/mcp.js +9 -1
  9. package/dist/core/agents/claude-code/models.js +16 -10
  10. package/dist/core/agents/claude-code/options.js +23 -2
  11. package/dist/core/agents/claude-code/session.js +21 -1
  12. package/dist/core/agents/claude-code/tools.js +9 -4
  13. package/dist/core/agents/claude-code/turn.js +2 -0
  14. package/dist/core/agents/codex-app-server/adapter.js +2 -0
  15. package/dist/core/agents/codex-app-server/client.js +8 -5
  16. package/dist/core/agents/codex-app-server/codex-agent.js +35 -2
  17. package/dist/core/agents/codex-app-server/effort.js +13 -6
  18. package/dist/core/agents/codex-app-server/mcp.js +35 -18
  19. package/dist/core/agents/codex-app-server/models.js +10 -10
  20. package/dist/core/agents/codex-app-server/options.js +11 -2
  21. package/dist/core/agents/codex-app-server/session.js +11 -4
  22. package/dist/core/agents/codex-app-server/thread-settings.js +30 -11
  23. package/dist/core/agents/host-tools.js +493 -0
  24. package/dist/core/agents/mcp-config.js +6 -2
  25. package/dist/core/agents/scripted/scripted-agent.js +11 -4
  26. package/dist/core/agents/scripted/steps.js +5 -1
  27. package/dist/core/agents/session-agent.js +70 -2
  28. package/dist/core/agents/thinking-levels.js +8 -5
  29. package/dist/core/index.js +1 -0
  30. package/dist/core/presets.js +12 -2
  31. package/dist/core/processes/identity.js +1 -0
  32. package/dist/core/processes/lifeline.js +13 -1
  33. package/dist/core/processes/process-table.js +1 -0
  34. package/dist/core/provision/extract.js +1 -0
  35. package/dist/core/provision/pins.js +7 -16
  36. package/dist/core/provision/releases.js +25 -25
  37. package/dist/core/proxy/loopback.js +22 -4
  38. package/dist/core/runtime/agent-runtime.js +6 -3
  39. package/dist/core/runtime/turn.js +20 -10
  40. package/dist/protocol/config.js +21 -1
  41. package/dist/protocol/credentials.js +2 -1
  42. package/dist/protocol/errors.js +12 -3
  43. package/dist/protocol/model-catalog.js +58 -18
  44. package/dist/protocol/models.js +6 -27
  45. package/dist/protocol/thinking.js +22 -9
  46. package/dist/protocol/wire-api.js +2 -2
  47. package/dist/server/bin.js +6 -4
  48. package/dist/server/routes.js +3 -2
  49. package/dist/types/client/client.d.ts +6 -1
  50. package/dist/types/client/client.d.ts.map +1 -1
  51. package/dist/types/core/agents/acp/acp-agent.d.ts +15 -0
  52. package/dist/types/core/agents/acp/acp-agent.d.ts.map +1 -1
  53. package/dist/types/core/agents/acp/mappings.d.ts +5 -1
  54. package/dist/types/core/agents/acp/mappings.d.ts.map +1 -1
  55. package/dist/types/core/agents/acp/requests.d.ts +2 -0
  56. package/dist/types/core/agents/acp/requests.d.ts.map +1 -1
  57. package/dist/types/core/agents/claude-code/approvals.d.ts +2 -1
  58. package/dist/types/core/agents/claude-code/approvals.d.ts.map +1 -1
  59. package/dist/types/core/agents/claude-code/claude-agent.d.ts +1 -0
  60. package/dist/types/core/agents/claude-code/claude-agent.d.ts.map +1 -1
  61. package/dist/types/core/agents/claude-code/mcp.d.ts +8 -1
  62. package/dist/types/core/agents/claude-code/mcp.d.ts.map +1 -1
  63. package/dist/types/core/agents/claude-code/models.d.ts +9 -5
  64. package/dist/types/core/agents/claude-code/models.d.ts.map +1 -1
  65. package/dist/types/core/agents/claude-code/options.d.ts +14 -1
  66. package/dist/types/core/agents/claude-code/options.d.ts.map +1 -1
  67. package/dist/types/core/agents/claude-code/session.d.ts +2 -0
  68. package/dist/types/core/agents/claude-code/session.d.ts.map +1 -1
  69. package/dist/types/core/agents/claude-code/tools.d.ts.map +1 -1
  70. package/dist/types/core/agents/claude-code/turn.d.ts +3 -0
  71. package/dist/types/core/agents/claude-code/turn.d.ts.map +1 -1
  72. package/dist/types/core/agents/codex-app-server/adapter.d.ts.map +1 -1
  73. package/dist/types/core/agents/codex-app-server/client.d.ts +2 -0
  74. package/dist/types/core/agents/codex-app-server/client.d.ts.map +1 -1
  75. package/dist/types/core/agents/codex-app-server/codex-agent.d.ts +11 -0
  76. package/dist/types/core/agents/codex-app-server/codex-agent.d.ts.map +1 -1
  77. package/dist/types/core/agents/codex-app-server/effort.d.ts +7 -7
  78. package/dist/types/core/agents/codex-app-server/effort.d.ts.map +1 -1
  79. package/dist/types/core/agents/codex-app-server/mcp.d.ts +11 -3
  80. package/dist/types/core/agents/codex-app-server/mcp.d.ts.map +1 -1
  81. package/dist/types/core/agents/codex-app-server/models.d.ts +4 -1
  82. package/dist/types/core/agents/codex-app-server/models.d.ts.map +1 -1
  83. package/dist/types/core/agents/codex-app-server/options.d.ts +9 -2
  84. package/dist/types/core/agents/codex-app-server/options.d.ts.map +1 -1
  85. package/dist/types/core/agents/codex-app-server/requests.d.ts +2 -0
  86. package/dist/types/core/agents/codex-app-server/requests.d.ts.map +1 -1
  87. package/dist/types/core/agents/codex-app-server/session.d.ts +6 -3
  88. package/dist/types/core/agents/codex-app-server/session.d.ts.map +1 -1
  89. package/dist/types/core/agents/codex-app-server/thread-settings.d.ts.map +1 -1
  90. package/dist/types/core/agents/host-tools.d.ts +162 -0
  91. package/dist/types/core/agents/host-tools.d.ts.map +1 -0
  92. package/dist/types/core/agents/mcp-config.d.ts +11 -2
  93. package/dist/types/core/agents/mcp-config.d.ts.map +1 -1
  94. package/dist/types/core/agents/scripted/scripted-agent.d.ts.map +1 -1
  95. package/dist/types/core/agents/scripted/steps.d.ts +1 -1
  96. package/dist/types/core/agents/scripted/steps.d.ts.map +1 -1
  97. package/dist/types/core/agents/session-agent.d.ts +2 -7
  98. package/dist/types/core/agents/session-agent.d.ts.map +1 -1
  99. package/dist/types/core/agents/thinking-levels.d.ts +7 -3
  100. package/dist/types/core/agents/thinking-levels.d.ts.map +1 -1
  101. package/dist/types/core/index.d.ts +1 -0
  102. package/dist/types/core/index.d.ts.map +1 -1
  103. package/dist/types/core/presets.d.ts +11 -1
  104. package/dist/types/core/presets.d.ts.map +1 -1
  105. package/dist/types/core/processes/identity.d.ts.map +1 -1
  106. package/dist/types/core/processes/lifeline.d.ts.map +1 -1
  107. package/dist/types/core/processes/process-table.d.ts.map +1 -1
  108. package/dist/types/core/provision/extract.d.ts.map +1 -1
  109. package/dist/types/core/provision/pins.d.ts +5 -4
  110. package/dist/types/core/provision/pins.d.ts.map +1 -1
  111. package/dist/types/core/proxy/loopback.d.ts.map +1 -1
  112. package/dist/types/core/runtime/agent-runtime.d.ts +4 -1
  113. package/dist/types/core/runtime/agent-runtime.d.ts.map +1 -1
  114. package/dist/types/core/runtime/turn.d.ts +12 -7
  115. package/dist/types/core/runtime/turn.d.ts.map +1 -1
  116. package/dist/types/protocol/clis.d.ts +3 -3
  117. package/dist/types/protocol/config.d.ts +12 -19
  118. package/dist/types/protocol/config.d.ts.map +1 -1
  119. package/dist/types/protocol/conversation.d.ts +10 -42
  120. package/dist/types/protocol/conversation.d.ts.map +1 -1
  121. package/dist/types/protocol/credentials.d.ts +13 -1
  122. package/dist/types/protocol/credentials.d.ts.map +1 -1
  123. package/dist/types/protocol/errors.d.ts +6 -4
  124. package/dist/types/protocol/errors.d.ts.map +1 -1
  125. package/dist/types/protocol/execution.d.ts +2 -18
  126. package/dist/types/protocol/execution.d.ts.map +1 -1
  127. package/dist/types/protocol/lifecycle.d.ts +12 -76
  128. package/dist/types/protocol/lifecycle.d.ts.map +1 -1
  129. package/dist/types/protocol/model-catalog.d.ts.map +1 -1
  130. package/dist/types/protocol/models.d.ts +4 -42
  131. package/dist/types/protocol/models.d.ts.map +1 -1
  132. package/dist/types/protocol/thinking.d.ts +19 -19
  133. package/dist/types/protocol/thinking.d.ts.map +1 -1
  134. package/dist/types/protocol/wire-api.d.ts +32 -117
  135. package/dist/types/protocol/wire-api.d.ts.map +1 -1
  136. package/dist/types/protocol/wire.d.ts +24 -125
  137. package/dist/types/protocol/wire.d.ts.map +1 -1
  138. package/dist/types/server/routes.d.ts.map +1 -1
  139. package/docs/consuming.md +92 -12
  140. package/docs/deploy.md +8 -0
  141. package/docs/harnesses.md +88 -27
  142. package/package.json +4 -4
  143. package/src/client/client.ts +114 -44
  144. package/src/core/agents/acp/acp-agent.ts +123 -17
  145. package/src/core/agents/acp/mappings.ts +5 -1
  146. package/src/core/agents/acp/requests.ts +2 -0
  147. package/src/core/agents/claude-code/approvals.ts +2 -1
  148. package/src/core/agents/claude-code/claude-agent.ts +14 -2
  149. package/src/core/agents/claude-code/mcp.ts +11 -1
  150. package/src/core/agents/claude-code/models.ts +15 -10
  151. package/src/core/agents/claude-code/options.ts +37 -3
  152. package/src/core/agents/claude-code/session.ts +26 -1
  153. package/src/core/agents/claude-code/tools.ts +10 -4
  154. package/src/core/agents/claude-code/turn.ts +4 -0
  155. package/src/core/agents/codex-app-server/adapter.ts +2 -0
  156. package/src/core/agents/codex-app-server/client.ts +11 -5
  157. package/src/core/agents/codex-app-server/codex-agent.ts +45 -1
  158. package/src/core/agents/codex-app-server/effort.ts +15 -20
  159. package/src/core/agents/codex-app-server/mcp.ts +46 -23
  160. package/src/core/agents/codex-app-server/models.ts +10 -10
  161. package/src/core/agents/codex-app-server/options.ts +16 -2
  162. package/src/core/agents/codex-app-server/requests.ts +2 -0
  163. package/src/core/agents/codex-app-server/session.ts +19 -4
  164. package/src/core/agents/codex-app-server/thread-settings.ts +31 -11
  165. package/src/core/agents/host-tools.ts +649 -0
  166. package/src/core/agents/mcp-config.ts +15 -3
  167. package/src/core/agents/scripted/scripted-agent.ts +11 -3
  168. package/src/core/agents/scripted/steps.ts +5 -1
  169. package/src/core/agents/session-agent.ts +78 -2
  170. package/src/core/agents/thinking-levels.ts +9 -6
  171. package/src/core/index.ts +9 -0
  172. package/src/core/presets.ts +24 -3
  173. package/src/core/processes/identity.ts +1 -0
  174. package/src/core/processes/lifeline.ts +14 -1
  175. package/src/core/processes/process-table.ts +1 -0
  176. package/src/core/provision/extract.ts +1 -0
  177. package/src/core/provision/pins.ts +7 -16
  178. package/src/core/provision/releases.ts +25 -25
  179. package/src/core/proxy/loopback.ts +25 -4
  180. package/src/core/runtime/agent-runtime.ts +6 -3
  181. package/src/core/runtime/turn.ts +21 -9
  182. package/src/protocol/config.ts +22 -1
  183. package/src/protocol/credentials.ts +19 -5
  184. package/src/protocol/errors.ts +12 -3
  185. package/src/protocol/model-catalog.ts +58 -18
  186. package/src/protocol/models.ts +6 -26
  187. package/src/protocol/thinking.ts +27 -14
  188. package/src/protocol/wire-api.ts +2 -2
  189. package/src/server/bin.ts +6 -4
  190. package/src/server/routes.ts +3 -2
@@ -2,6 +2,7 @@ import { withTimeout } from "../utils/deadline.js";
2
2
  import { SessionResumeError, TurnActiveError } from "../utils/errors.js";
3
3
  import { BaseAgent, CANCEL_CONFIRM_MS, } from "./base.js";
4
4
  import { configFingerprint } from "./config-fingerprint.js";
5
+ import { withoutSecret } from "./host-tools.js";
5
6
  /**
6
7
  * The execution lifecycle the engine's own harnesses extend: one turn owns a
7
8
  * logical session from preparation through native cleanup, with steering,
@@ -9,6 +10,43 @@ import { configFingerprint } from "./config-fingerprint.js";
9
10
  * exported while its design is a Draft (LLP 0016); a product's own harness
10
11
  * extends `BaseAgent`, the public base.
11
12
  */
13
+ // @ref LLP 0018#who-can-read-the-secret — the broker publishes a request's options too
14
+ /**
15
+ * A permission request as the broker publishes it: its tool call and its
16
+ * options (a harness's own labels and ids) without the secret, and the
17
+ * option picked mapped back to the harness's own id.
18
+ */
19
+ async function permission(ask, scrub, call, rest) {
20
+ const [opts] = rest;
21
+ if (!opts)
22
+ return ask(scrub(call), ...rest);
23
+ const scrubbed = scrub(opts);
24
+ // A choice whose id held the secret gets an opaque id of its own, unique, so
25
+ // two redacted the same can never be taken for each other.
26
+ const used = new Set((scrubbed.options ?? []).flatMap((option, index) => opts.options?.[index]?.optionId === option.optionId ? [option.optionId] : []));
27
+ const opaque = (index) => {
28
+ let id = `redacted-option-${index}`;
29
+ while (used.has(id))
30
+ id += "-";
31
+ used.add(id);
32
+ return id;
33
+ };
34
+ const choices = (scrubbed.options ?? []).map((option, index) => {
35
+ const own = opts.options?.[index]?.optionId ?? option.optionId;
36
+ return {
37
+ option: own === option.optionId ? option : { ...option, optionId: opaque(index) },
38
+ own,
39
+ };
40
+ });
41
+ const native = new Map(choices.map(({ option, own }) => [option.optionId, own]));
42
+ const shown = scrubbed.options
43
+ ? { ...scrubbed, options: choices.map(({ option }) => option) }
44
+ : scrubbed;
45
+ const decision = await ask(scrub(call), shown);
46
+ if (decision.decision === "cancel" || decision.optionId === undefined)
47
+ return decision;
48
+ return { ...decision, optionId: native.get(decision.optionId) ?? decision.optionId };
49
+ }
12
50
  export class SessionAgent extends BaseAgent {
13
51
  terminated = false;
14
52
  /**
@@ -53,8 +91,33 @@ export class SessionAgent extends BaseAgent {
53
91
  try {
54
92
  // The adapter still produces its native cancellation result for an
55
93
  // already-aborted turn. It must not select a conversation or do setup.
56
- const prepared = controller.signal.aborted ? options : this.prepareSessionOptions(options);
57
- yield* this.executeTurn(input, prepared, controller);
94
+ const ready = controller.signal.aborted ? options : this.prepareSessionOptions(options);
95
+ // @ref LLP 0018#who-can-read-the-secret — the session's own secret leaves in no text
96
+ // Kept for the turn once seen: its output may still drain after the session's release.
97
+ let secret;
98
+ const scrub = (value) => {
99
+ secret ??= this.hostSecret(sessionId);
100
+ return withoutSecret(value, secret);
101
+ };
102
+ const { onWarning, onPermissionRequest, onElicitationRequest } = ready;
103
+ const prepared = {
104
+ ...ready,
105
+ ...(onWarning && { onWarning: (warning) => onWarning(scrub(warning)) }),
106
+ // What the broker puts on the stream (a request's input, its title) is the agent's text too.
107
+ ...(onPermissionRequest && {
108
+ onPermissionRequest: (call, ...rest) => permission(onPermissionRequest, scrub, call, rest),
109
+ }),
110
+ ...(onElicitationRequest && {
111
+ onElicitationRequest: (request, ...rest) => onElicitationRequest(scrub(request), ...rest),
112
+ }),
113
+ };
114
+ try {
115
+ for await (const event of this.executeTurn(input, prepared, controller))
116
+ yield scrub(event);
117
+ }
118
+ catch (error) {
119
+ throw scrub(error);
120
+ }
58
121
  }
59
122
  finally {
60
123
  this.executed.set(sessionId, options.turnId);
@@ -167,6 +230,11 @@ export class SessionAgent extends BaseAgent {
167
230
  if (turn?.turnId === options.turnId)
168
231
  turn.deliver = undefined;
169
232
  }
233
+ /** Native protocol execution; options are prepared and the session is exclusively owned. */
234
+ /** The session's host-tools secret, which no event, warning or error it lets out may hold. */
235
+ hostSecret(_sessionId) {
236
+ return undefined;
237
+ }
170
238
  prepareSessionOptions(options) {
171
239
  const boundary = configFingerprint({
172
240
  cwd: options.cwd,
@@ -1,9 +1,12 @@
1
- import { THINKING_LEVELS, isThinkingLevel } from "../../protocol/index.js";
2
- /** The values that are thinking levels, once each, lowest first. */
3
- export function knownThinkingLevels(values) {
1
+ /**
2
+ * The levels a harness lists: each non-blank string once, in the order given.
3
+ * The order is the harness's own (both CLIs list lowest first), and a name
4
+ * this build does not know is kept.
5
+ */
6
+ export function listedThinkingLevels(values) {
4
7
  const levels = new Set();
5
8
  for (const value of values)
6
- if (typeof value === "string" && isThinkingLevel(value))
9
+ if (typeof value === "string" && /\S/.test(value))
7
10
  levels.add(value);
8
- return THINKING_LEVELS.filter((level) => levels.has(level));
11
+ return [...levels];
9
12
  }
@@ -6,6 +6,7 @@ export { EventSinkError, callbackSink, CollectingSink, serialSink, teeSink, } fr
6
6
  export { BaseAgent, } from "./agents/base.js";
7
7
  export { AgentRegistry } from "./agents/registry.js";
8
8
  export { credentialsFromUrl } from "./agents/credentials.js";
9
+ export { HOST_TOOL_TIMEOUT_MS, } from "./agents/host-tools.js";
9
10
  export { INHERIT_CONFIGS, isInheritConfig, } from "./agents/inherit-config.js";
10
11
  // Native processes: each CLI in a group of its own, held by the lifeline, recorded, swept at restart.
11
12
  export { DEFAULT_GRACE_MS, NativeProcess, NativeProcesses, } from "./processes/native-processes.js";
@@ -21,6 +21,7 @@ const HARNESSES = {
21
21
  onDiagnostic: opts.onDiagnostic,
22
22
  ...opts.claudeCode,
23
23
  credentials: opts.credentials,
24
+ hostTools: opts.hostTools,
24
25
  idleTimeoutMs: opts.idleTimeoutMs,
25
26
  cancelConfirmMs: opts.cancelConfirmMs,
26
27
  cancelGraceMs: opts.cancelGraceMs,
@@ -34,6 +35,7 @@ const HARNESSES = {
34
35
  new CodexAppServerAgent({
35
36
  ...opts.codexAppServer,
36
37
  credentials: opts.credentials,
38
+ hostTools: opts.hostTools,
37
39
  idleTimeoutMs: opts.idleTimeoutMs,
38
40
  cancelConfirmMs: opts.cancelConfirmMs,
39
41
  cancelGraceMs: opts.cancelGraceMs,
@@ -47,9 +49,16 @@ const HARNESSES = {
47
49
  if (!opts.acp) {
48
50
  throw new Error("the acp harness requires CreateRegistryOptions.acp (resolveLaunch)");
49
51
  }
50
- const { idleTimeoutMs, cancelConfirmMs, cancelGraceMs } = opts;
52
+ const { idleTimeoutMs, cancelConfirmMs, cancelGraceMs, hostTools } = opts;
51
53
  return [
52
- new AcpAgent({ ...opts.acp, idleTimeoutMs, cancelConfirmMs, cancelGraceMs, processes }),
54
+ new AcpAgent({
55
+ ...opts.acp,
56
+ idleTimeoutMs,
57
+ cancelConfirmMs,
58
+ cancelGraceMs,
59
+ hostTools,
60
+ processes,
61
+ }),
53
62
  createAcpTransformer,
54
63
  ];
55
64
  },
@@ -69,6 +78,7 @@ const SAID_ONCE = {
69
78
  cancelConfirmMs: atTheTop("cancelConfirmMs"),
70
79
  cancelGraceMs: atTheTop("cancelGraceMs"),
71
80
  inheritConfig: atTheTop("inheritConfig"),
81
+ hostTools: atTheTop("hostTools"),
72
82
  processes: "the registry gives every harness its processes; say how they are owned with nativeProcesses",
73
83
  resolveCliPath: "the registry's provisioner finds each CLI; name one with provision.overrides",
74
84
  };
@@ -14,6 +14,7 @@ export function bootId() {
14
14
  : POSIX
15
15
  ? execFileSync("/usr/sbin/sysctl", ["-n", "kern.bootsessionuuid"], {
16
16
  encoding: "utf8",
17
+ env: process.env,
17
18
  stdio: ["ignore", "pipe", "ignore"],
18
19
  }).trim()
19
20
  : null;
@@ -85,6 +85,13 @@ const RESPAWN_WINDOW_MS = 1_000;
85
85
  */
86
86
  function startShell(ticks, exited, failed) {
87
87
  const args = ["-c", LIFELINE_SCRIPT, LIFELINE_NAME, ticks];
88
+ // @ref LLP 0007#the-environment-a-process-is-given — only what its script needs
89
+ // It lives as long as the engine, and any process of this user can read its
90
+ // environment (`/proc/<pid>/environ`): `PATH` finds its `sed`, `awk`, `cat`,
91
+ // `tr` and `sleep`. Nothing else of the engine's environment is given;
92
+ // Node itself adds `NODE_V8_COVERAGE` to every child when the engine runs
93
+ // with it set (Bun adds nothing).
94
+ const env = { PATH: process.env.PATH };
88
95
  const bun = globalThis.Bun;
89
96
  if (bun) {
90
97
  // @ref LLP 0007#the-lifeline — registered before the CLI gets input
@@ -96,6 +103,7 @@ function startShell(ticks, exited, failed) {
96
103
  stdout: "ignore",
97
104
  stderr: "ignore",
98
105
  detached: true,
106
+ env,
99
107
  onExit: exited,
100
108
  });
101
109
  child.unref();
@@ -110,7 +118,11 @@ function startShell(ticks, exited, failed) {
110
118
  };
111
119
  }
112
120
  // Node writes a pipe at once when it can (libuv's `uv_try_write`).
113
- const child = spawn("/bin/sh", args, { detached: true, stdio: ["pipe", "ignore", "ignore"] });
121
+ const child = spawn("/bin/sh", args, {
122
+ detached: true,
123
+ env,
124
+ stdio: ["pipe", "ignore", "ignore"],
125
+ });
114
126
  child.unref();
115
127
  child.stdin?.unref?.();
116
128
  child.stdin?.on("error", () => { });
@@ -39,6 +39,7 @@ function linuxTable() {
39
39
  function psTable() {
40
40
  const out = execFileSync("/bin/ps", ["-axo", "pid=,ppid=,pgid=,stat="], {
41
41
  encoding: "utf8",
42
+ env: process.env,
42
43
  stdio: ["ignore", "pipe", "ignore"],
43
44
  });
44
45
  const rows = [];
@@ -10,6 +10,7 @@ const EXTRACT_TIMEOUT_MS = 5 * 60_000;
10
10
  export async function extractTarGz(tgzPath, destDir) {
11
11
  await new Promise((resolve, reject) => {
12
12
  const proc = spawn("tar", ["-xzf", tgzPath, "-C", destDir], {
13
+ env: process.env,
13
14
  stdio: ["ignore", "ignore", "pipe"],
14
15
  timeout: EXTRACT_TIMEOUT_MS,
15
16
  });
@@ -14,22 +14,13 @@
14
14
  * `auto` an installed `@openai/codex` package (a lockfile's) runs instead,
15
15
  * and a `codex` on PATH only in `system` mode.
16
16
  *
17
- * After any bump, run `bun run releases:refresh` (each platform's build and
18
- * its checksums, `releases.ts`) and `bun run models:refresh` (the model
19
- * catalog, which records the versions that listed it); tests fail until both
20
- * match these pins.
17
+ * A bump is `bun run bump -- <tool>`: it writes what changed upstream, moves
18
+ * the pin, and runs both refreshes, `releases:refresh` (each platform's build
19
+ * and its checksums, `releases.ts`) and `models:refresh` (the model catalog,
20
+ * which records the versions that listed it); tests fail until both match
21
+ * these pins. The `bump-clis` skill says what to read and prove.
21
22
  */
22
23
  export const DEFAULT_PINS = {
23
- // 0.3.288 verified 2026-10-03: the paired CLI honors `--thinking-display
24
- // summarized`, so reasoning parts carry text (2.1.233 ignored the flag and
25
- // streamed token-estimate placeholders). Re-check thinking summaries on
26
- // every bump (see options.ts extraArgs).
27
- claude: "0.3.288",
28
- // 0.160.0 re-verified 2026-10-03 against generate-ts: thread/turn/item
29
- // methods, token usage, approvals, and host-managed ChatGPT auth changed
30
- // only additively since 0.153.4. Of the GPT-6 family, 0.153.4 lists only
31
- // gpt-6-astra; the rest needs 0.159 or newer.
32
- // Since 0.160 a thread has one writer: resuming it from a second process
33
- // fails until the first releases it.
34
- codex: "0.160.0",
24
+ claude: "0.3.327",
25
+ codex: "0.169.1",
35
26
  };
@@ -5,63 +5,63 @@
5
5
  */
6
6
  export const CLI_RELEASES = {
7
7
  claude: {
8
- version: "0.3.288",
9
- cli: "2.1.288",
8
+ version: "0.3.327",
9
+ cli: "2.1.327",
10
10
  builds: {
11
11
  "darwin-arm64": {
12
- integrity: "sha512-85niGScWj8sr7yqOjSfqINaKv/zB47T45o4NBq1BmpaKRYFK7grtK24LA6C7cjx1Pznp+WT68mo373fbbwFW0A==",
13
- sha256: "bbe93063f7a0879a1021b2891e5c9354e5b3b98433e32efe6750f7710afed750",
12
+ integrity: "sha512-n+tQOPqz264l12BAKBcBPBbdB/bmZ2SfyONtEXQufTU6EeCoQMPS58RSt51Cxk5sDUme1hTF0vVAqRPdhq8tFg==",
13
+ sha256: "76d48205c926c8a6978cfc2171b631bcd01e20bbadd085638bb2ec57bea91c5b",
14
14
  },
15
15
  "darwin-x64": {
16
- integrity: "sha512-hY8MQtgAi+cRedFb+qSqZzAYXIfjC+ZiXtCxKCs4OqWbqrdVZ0GKcEv4nB6MfQGs/Qr4U24cDNuO2lskBbZAWA==",
17
- sha256: "946acab03a55b60e2016e30964c48b96ef6673cb5da684383f4835da410eede0",
16
+ integrity: "sha512-u091X+eQIyqg8BIEYLWJ0o6U3BaivMcf8Im4hI3hti/NGJ6YC5sR+LLEa1RjSIKE+JoOfCxipdCNSKaEI+0d5Q==",
17
+ sha256: "1fe75c05df7be824af1ed80ff9ccdf2be991f3a2212b97e05fc9a3bff2f39ef9",
18
18
  },
19
19
  "linux-arm64": {
20
- integrity: "sha512-CCj0xau64T+Ia+X2wZgjYFSUIWfNJRWIGFbT8+jKiCzQggaBo6OSZ8hAYyME3h13JYrgpyrUTzB5YiwKaw8ZFg==",
21
- sha256: "359ab6a058fcde9741dff54979a212fd134cdf8e8cfc2f8de02bc350b9e2b9d5",
20
+ integrity: "sha512-/k6BfV+L2er67UoLUabcp0w3L1DMemJjoijdxvXDiU8w81fGfHaKWKhRuhUQFmIrMLyMyQcBKaoyUNSLWovPnw==",
21
+ sha256: "acf0ef2f9da8d5ab08f193f007e19a06cbfb608b96a2f1f758d63a92a386cff8",
22
22
  },
23
23
  "linux-x64": {
24
- integrity: "sha512-Y5M496UZKttScbzptA45NI+CMHYONnskw0aq3rJ6s+gE6L6Jy8F8UoKt0lQO11R5xTY65TIeCasjQf/bLavuNg==",
25
- sha256: "0298068b686e7fdbaf9402a7a587bb7f49c0b0e084de09f69145a0719207640c",
24
+ integrity: "sha512-oAdL7KM9UVAZlATeSjh2haeEjex1N7ZcHzWO1tY2hgyhkyLNVw/tWUhITOucxMwokBx++h2dMVjxiPJiZ5uVOQ==",
25
+ sha256: "343c744baa14bfd38286a7cb90871051f04379956da6c5b803a9e66019a76ac9",
26
26
  },
27
27
  "linux-arm64-musl": {
28
- integrity: "sha512-66MD4hzNTqrTL5MN21bSfxm/fhbnM+ERsmWHGEsJojxAWY5DXCUlDkaAYM0rxDpdvLMVt9PpRVIiWDptaiFPxA==",
29
- sha256: "6b9816b225b303dacc17acc9d83016055274498effdbce6227e62d5dbaa762b9",
28
+ integrity: "sha512-oV8/+ZixiPzEW1BStoP9FOXsHcznONaom6S2PwwIfhi5Pxa5fGuloy8TiOB9wK+03zavqt7jmzLgVPF2a2NsTA==",
29
+ sha256: "e44a59ef850788c578adaab7a6487d5d0af9c0844401da9d7263e7b41515754b",
30
30
  },
31
31
  "linux-x64-musl": {
32
- integrity: "sha512-g3HDERLfEamirfp+MJDVl1fT8YYQMILUH65jPzl+SzKLeBu26WmAXAoZFmU4dasEmKZkEnBdL0ZQy3qnDy5EXg==",
33
- sha256: "b4334268a2ce06bf984dab2d6925cc5afe9d2344fa427fc362e266da0d57a894",
32
+ integrity: "sha512-O0nDZ1gpXi83qAdd8SM0gTdjlzrqpOlW0M4W7PfHVrMXWLh9I+1tvHat+s17ehIW6A9VQIWIq4oMwq7jb708Dg==",
33
+ sha256: "d2b02e78664c1347aff8fcee045356ee044116be41d7f412721a6c50182b6d98",
34
34
  },
35
35
  "win32-arm64": {
36
- integrity: "sha512-ijVSU5Vl1L1SlEm1djPNEekxHm9FS5GOitz8kL8KLdYDspMA97bgFM4gy/+riA3qn4ERepJkjdDLE+oYMTO+UA==",
37
- sha256: "5015d2b92866232b85384ac6e5eef4ff155418a92123503e52714c29186af8c6",
36
+ integrity: "sha512-a5ju83mylDvUwvQyRt1E0TQ0ar2nzVMPeWZhjcmgpB1cNTjf+KT5jgUnLvxPOG2tyjhm8bYGysRMdgB+tVnhvw==",
37
+ sha256: "d2c3395d252007540a5662a2cfd4d8903a0beb5fa32c893cd13b81be427625a7",
38
38
  },
39
39
  "win32-x64": {
40
- integrity: "sha512-zh4yfGduDEBKUqb3BPtq/cLYwHoScqm7X5fJhmkSs0BJiSJGlb38j6FXWDvoPfe+OXNjE5onNx5HlAnDzsQzrA==",
41
- sha256: "84304f7d4b0cd0ebcbe8318695a260151b48991a6659c3366fdd5da290c0ab91",
40
+ integrity: "sha512-bf52nw4j5RCvkXI5Poj5Qf0jWvuLQ/UPFqdav86UwaGTZZ0txNV33MKBIUoCyxXV6IC1/p2BNfkwmCAZ+Uc9pw==",
41
+ sha256: "d6c8075bfb3b87f1c1254e64b6c35dadc628d21e75930ae51e47047b3f05a4a2",
42
42
  },
43
43
  },
44
44
  },
45
45
  codex: {
46
- version: "0.160.0",
46
+ version: "0.169.1",
47
47
  builds: {
48
48
  "darwin-arm64": {
49
- integrity: "sha512-aefV6cqZA2REZgR//4McyXlp7zLcTti4CI2v3j9IVgNndPBv2kCeNEcz07qeelXcwOdSFPUKb6roA48vZmDgrQ==",
49
+ integrity: "sha512-yOKvCJktlbxdETtXAidz2GcC4z/WMYPmu2plncYJtUI5AhnFIExen8n9eL/El6n9hYbzzZFf1JgyW7yHx6kwTw==",
50
50
  },
51
51
  "darwin-x64": {
52
- integrity: "sha512-ir7cdsPrb9VkqNqpTECoTiomv04xws/FQ968mHQzuL+2J5Da0Dkh2Qlxp7sguDDZJab4YpYmNjQvBVMXbTeQaQ==",
52
+ integrity: "sha512-IbHIskdPWGAXFCdGiB8CosfXXtdvMmusrQ2AdW2kFHd6aSJZ+dvgalwjpxmAytalnNM3pQgXwS/6fU1OclFv8Q==",
53
53
  },
54
54
  "linux-arm64": {
55
- integrity: "sha512-VnVdsS06YlDsL8OwaJjQ3xdqdJNG4i+eBJBV3LytddknzSaF/urijLzVg3ptkwvoj8C7Gn7iWpVE+y8WEaPiCg==",
55
+ integrity: "sha512-6vRE7ZxkngT6L5JQ9WUQ2UnztS6hqyfcQiFqvk0yhcvWsrZLJNiiDZcKzGbLfJK2sDy7tSt9uWdP1cIgMHIkaw==",
56
56
  },
57
57
  "linux-x64": {
58
- integrity: "sha512-KI/73OqGrHmR18s7ya7E1NqV6rT0y3lxr0s8S1qR2m6zU6QRF/HlR529jALLh5vjdUnsRT4Ahoxt0axb4kY99g==",
58
+ integrity: "sha512-KmlHQ/lB9jcn8Yy5z/tWCpSPsqBvI3pU+0PUPccr+pKiiU2NJSCvZcAD7s3dmIFq5ZvGYtGcSn2KdFFdaPQICg==",
59
59
  },
60
60
  "win32-arm64": {
61
- integrity: "sha512-tTvK9ZIGuj9WnYaYOAnfjJVSfPV7dKqWtDHqUPLf0Hadp6SgynTxx7S7iMXRieFeXVOI2XH76KxEHSOTOnz3zw==",
61
+ integrity: "sha512-EYXwgEdHHzwgA0nnDcK4pI98IdReB1aDebtOxcYixM1/GY2Y/76oDFYSs/u6DzA27f6Hhf5V92OwQFw/GLICUQ==",
62
62
  },
63
63
  "win32-x64": {
64
- integrity: "sha512-/gCFcuOmGlQkgGivWCtY8BNEDixh70Pue0HZOk9S8bj2vUIE1GLD9zcNB/KqqDJmn0S+lIttauLpzQnw6HOCHA==",
64
+ integrity: "sha512-fImXWqxwxqHh9+FhJWsRRFiBzgBrSeN1bYTvtGZtUKGTPzHefYAL1agmlf5XScfwY5i5pHsExfdhFekzRBbqIw==",
65
65
  },
66
66
  },
67
67
  },
@@ -35,31 +35,49 @@ async function bridge(handle, req, res) {
35
35
  }
36
36
  res.end();
37
37
  }
38
+ /**
39
+ * Bun's own `Response`. A product's process may have replaced the global one
40
+ * (Hono's Node server does, with a class of its own), and `Bun.serve` refuses
41
+ * any other ("Expected a Response object"); `fetch` still answers with Bun's.
42
+ */
43
+ async function nativeResponse() {
44
+ return (await fetch("data:,")).constructor;
45
+ }
38
46
  /**
39
47
  * Serve `handle` on 127.0.0.1, on a port of its own: with `Bun.serve` under
40
48
  * Bun, whose `node:http` says nothing of a client that left once its request
41
49
  * body was read (a stopped turn's request would run on upstream), and with
42
50
  * `node:http` under Node.
43
51
  */
44
- export function serveLoopback(handle) {
52
+ export async function serveLoopback(handle) {
45
53
  const bun = globalThis.Bun;
46
54
  if (bun) {
55
+ const Native = await nativeResponse();
56
+ const native = (response) =>
57
+ // Not `instanceof`: Hono's class sets Bun's prototype under its own.
58
+ response.constructor === Native
59
+ ? response
60
+ : new Native(response.body, {
61
+ status: response.status,
62
+ statusText: response.statusText,
63
+ headers: [...response.headers],
64
+ });
47
65
  const server = bun.serve({
48
66
  port: 0,
49
67
  hostname: "127.0.0.1",
50
68
  // A model can think longer than any idle limit between the events it streams.
51
69
  idleTimeout: 0,
52
- fetch: (request) => handle(request).catch(() => new Response(null, { status: 502 })),
70
+ fetch: (request) => handle(request).then(native, () => new Native(null, { status: 502 })),
53
71
  });
54
72
  // Nothing on it keeps the process alive.
55
73
  server.unref();
56
- return Promise.resolve({
74
+ return {
57
75
  url: `http://127.0.0.1:${server.port}`,
58
76
  // Not waited for: with a client still connected, Bun's stop can take its time.
59
77
  close: async () => {
60
78
  server.stop(true);
61
79
  },
62
- });
80
+ };
63
81
  }
64
82
  const server = createServer((req, res) => {
65
83
  bridge(handle, req, res).catch(() => {
@@ -283,11 +283,14 @@ export class AgentRuntime {
283
283
  * Cancel the session's in-flight turn. An idle session is a clean no-op ack
284
284
  * (`{confirmed: true, hadTurn: false}`); `confirmed: false` means a turn
285
285
  * existed but the harness did not acknowledge the interrupt — the agent may
286
- * still be running; `turn.ended` remains the source of truth.
286
+ * still be running; `turn.ended` remains the source of truth. A turn
287
+ * admitted but not yet on its harness answers `hadTurn: false` too (the
288
+ * harness had nothing to interrupt), and still ends `cancelled`: the turn
289
+ * keeps the cancel, and its harness begins it stopped.
287
290
  */
288
291
  async cancel(harness, sessionId) {
289
- // Unblock any harness parked on an approval before (and regardless of)
290
- // the agent-level abort.
292
+ // The turn keeps the cancel (its signal), and any harness parked on an
293
+ // approval is unblocked, before (and regardless of) the agent-level abort.
291
294
  for (const turn of this.turnsOf(sessionId))
292
295
  void turn.requestCancel();
293
296
  return await this.registry.getAgent(harness).cancel(sessionId);
@@ -53,7 +53,6 @@ export class Turn {
53
53
  request;
54
54
  inputKey;
55
55
  sink;
56
- signal;
57
56
  host;
58
57
  sessionId;
59
58
  turnId;
@@ -70,8 +69,14 @@ export class Turn {
70
69
  processor;
71
70
  /** Its durable sink failed: the turn stops, and every later write fails with it. */
72
71
  sinkFailure;
73
- /** `cancel` or `closeSession` asked it to stop. */
74
- cancelRequested = false;
72
+ /**
73
+ * Aborted when `cancel` or `closeSession` asks the turn to stop: part of
74
+ * the signal its harness is given, so a cancel that comes before the
75
+ * harness has the turn is not lost.
76
+ */
77
+ cancelled = new AbortController();
78
+ /** The caller's signal, the runtime's shutdown and the turn's own cancel, together. */
79
+ signal;
75
80
  nativeSessionId;
76
81
  /** When the turn requested a resume: whether the harness honored it. */
77
82
  resumed;
@@ -85,9 +90,9 @@ export class Turn {
85
90
  this.request = request;
86
91
  this.inputKey = inputKey;
87
92
  this.sink = sink;
88
- this.signal = signal;
89
93
  this.host = host;
90
94
  const { sessionId, turnId, config } = request;
95
+ this.signal = AbortSignal.any([signal, this.cancelled.signal]);
91
96
  this.sessionId = sessionId;
92
97
  this.turnId = turnId;
93
98
  this.harness = config.harness;
@@ -106,14 +111,19 @@ export class Turn {
106
111
  });
107
112
  this.running = Promise.resolve().then(() => this.execute());
108
113
  }
114
+ // @ref LLP 0001#d9--the-wire-is-quick-ack-json-rpc-requests-flow-one-way — a cancel before the harness has the turn
109
115
  /**
110
- * A cancel was asked for: its open requests are answered as cancelled, and
111
- * what the harness throws from now on is it stopping. Resolves once their
112
- * `*.resolved` are written.
116
+ * A cancel was asked for: the turn's signal is aborted, so a harness that
117
+ * has not begun the turn yet begins it stopped; its open requests are
118
+ * answered as cancelled; and what the harness throws from now on is it
119
+ * stopping. Resolves once their `*.resolved` are written.
113
120
  */
114
121
  requestCancel() {
115
- this.cancelRequested = true;
116
- return this.requests.cancelAll();
122
+ // Taken before the abort, which settles each request bound to the turn's
123
+ // signal and takes it out of the broker: the cancel would not wait for it.
124
+ const answered = this.requests.cancelAll();
125
+ this.cancelled.abort();
126
+ return answered;
117
127
  }
118
128
  async execute() {
119
129
  const { sessionId, turnId, input, config } = this.request;
@@ -176,7 +186,7 @@ export class Turn {
176
186
  throw this.sinkFailure;
177
187
  // A harness asked to stop throws as it stops, whatever its words say;
178
188
  // one that was not is failing.
179
- threw = this.cancelRequested || this.signal.aborted ? "cancelled" : errorInfo(error);
189
+ threw = this.signal.aborted ? "cancelled" : errorInfo(error);
180
190
  if (threw !== "cancelled") {
181
191
  await this.emit({
182
192
  type: "error",
@@ -19,7 +19,7 @@ export const PermissionModeSchema = z.enum([
19
19
  "bypass_permissions",
20
20
  ]);
21
21
  export const ReportedPermissionModeSchema = openVocabulary(PermissionModeSchema.options);
22
- /** The longest `requestTimeoutMs`: a timer's own limit, about 24.8 days. */
22
+ /** The longest `requestTimeoutMs` and the longest MCP `timeoutMs`: a timer's own limit, about 24.8 days. */
23
23
  export const MAX_REQUEST_TIMEOUT_MS = 2_147_483_647;
24
24
  /**
25
25
  * Whether a turn needs the server (default `true`). A turn fails before the
@@ -29,6 +29,23 @@ export const MAX_REQUEST_TIMEOUT_MS = 2_147_483_647;
29
29
  * agent connects its servers itself and decides.
30
30
  */
31
31
  const required = z.boolean().optional();
32
+ /**
33
+ * How long one call to one of the server's tools may run, in milliseconds,
34
+ * on any transport: past it the call fails, and the model is told it timed out.
35
+ * - Claude: the server's `timeout`. A value under 1000 is ignored, as if unset.
36
+ * Unset, a call to an HTTP or SSE server is cut at 60 s unless
37
+ * `MCP_TOOL_TIMEOUT` (ms) is in the turn's or the engine's environment; a
38
+ * call to a stdio server is not cut at 60 s (one ran 70 s), and Claude's
39
+ * own longer limits still apply.
40
+ * - Codex: the server's `tool_timeout_sec`, in whole seconds rounded up
41
+ * (1118 cuts a call at 2 s), as Codex reads a fraction back changed.
42
+ * Unset, a call is cut at 300 s.
43
+ * - An ACP agent is not given it (ACP v1 has no such field): the agent keeps
44
+ * its own limit, if it has one.
45
+ * At most `MAX_REQUEST_TIMEOUT_MS`, a timer's own limit; a larger value is refused.
46
+ * A changed value applies from the next turn of a warm session.
47
+ */
48
+ const timeoutMs = z.number().int().positive().max(MAX_REQUEST_TIMEOUT_MS).optional();
32
49
  /** Minimal external MCP server descriptor (stdio or http/sse). */
33
50
  export const McpServerConfigSchema = z.discriminatedUnion("type", [
34
51
  z.object({
@@ -37,18 +54,21 @@ export const McpServerConfigSchema = z.discriminatedUnion("type", [
37
54
  args: z.array(z.string()).optional(),
38
55
  env: z.record(z.string(), z.string()).optional(),
39
56
  required,
57
+ timeoutMs,
40
58
  }),
41
59
  z.object({
42
60
  type: z.literal("http"),
43
61
  url: z.string(),
44
62
  headers: z.record(z.string(), z.string()).optional(),
45
63
  required,
64
+ timeoutMs,
46
65
  }),
47
66
  z.object({
48
67
  type: z.literal("sse"),
49
68
  url: z.string(),
50
69
  headers: z.record(z.string(), z.string()).optional(),
51
70
  required,
71
+ timeoutMs,
52
72
  }),
53
73
  ]);
54
74
  /** Everything needed to configure a turn against a harness. */
@@ -46,8 +46,9 @@ const RUNS_ON = {
46
46
  "claude-code": ClaudeCredentialSchema,
47
47
  "codex-app-server": CodexCredentialSchema,
48
48
  };
49
- /** The credential as the kind `harness` runs on, or why that harness cannot run it. */
50
49
  export function credentialRunsOn(harness, credential) {
50
+ if (!Object.hasOwn(RUNS_ON, harness))
51
+ return { ok: false, error: `${harness} runs on no credential a product holds.` };
51
52
  const parsed = RUNS_ON[harness].safeParse(credential);
52
53
  if (parsed.success)
53
54
  return { ok: true, credential: parsed.data };
@@ -8,7 +8,9 @@ import { openVocabulary } from "./vocabulary.js";
8
8
  * unknown non-`_` values are reserved for this protocol.
9
9
  * `usage_limit` (plan/quota exhausted) and `rate_limit` (429/backoff) are
10
10
  * deliberately distinct — they need different user guidance; collapsing them
11
- * is a display choice, never a wire merge.
11
+ * is a display choice, never a wire merge. So are `resume_failed` (the
12
+ * conversation is gone: offer a fresh start) and `resume_busy` (another
13
+ * process holds it now: try again once that one has let it go).
12
14
  */
13
15
  export const ERROR_CATEGORIES = [
14
16
  "auth",
@@ -21,6 +23,7 @@ export const ERROR_CATEGORIES = [
21
23
  "invalid_request",
22
24
  "process_exit",
23
25
  "resume_failed",
26
+ "resume_busy",
24
27
  "mcp_unavailable",
25
28
  "server_restart",
26
29
  "internal",
@@ -42,6 +45,8 @@ export const ErrorInfoSchema = z.object({
42
45
  * classifier; lives in /protocol because categories are vocabulary.
43
46
  */
44
47
  const RULES = [
48
+ // Codex 0.160 and newer: another app-server holds the thread warm.
49
+ ["resume_busy", ["already has an active writer"]],
45
50
  ["resume_failed", ["no conversation found with session id", "no rollout found for thread id"]],
46
51
  ["abort", ["aborted", "aborterror", "cancelled", "canceled", "interrupted", "sigint"]],
47
52
  [
@@ -133,14 +138,18 @@ export function classifyError(error) {
133
138
  }
134
139
  return "internal";
135
140
  }
136
- /** A status code counts on its own, never inside a longer number ("240129 tokens"). */
141
+ /**
142
+ * A status code counts where it stands as a number of its own, never inside
143
+ * a longer number ("240129 tokens") or an identifier's alphanumeric run (a
144
+ * thread id's "-b401-" or "-a429-"): no letter or digit touches it.
145
+ */
137
146
  function mentions(message, needle) {
138
147
  if (!/\d$/.test(needle))
139
148
  return message.includes(needle);
140
149
  for (let at = message.indexOf(needle); at >= 0; at = message.indexOf(needle, at + 1)) {
141
150
  const before = message[at - 1] ?? "";
142
151
  const after = message[at + needle.length] ?? "";
143
- if (!/\d/.test(before) && !/\d/.test(after))
152
+ if (!/[a-z0-9]/.test(before) && !/[a-z0-9]/.test(after))
144
153
  return true;
145
154
  }
146
155
  return false;