orkestrator 2.37.0-alpha → 2.37.3-beta

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orkestrator",
3
- "version": "2.37.0-alpha",
3
+ "version": "2.37.3-beta",
4
4
  "description": "Run the Orkestrator backend service without the desktop application",
5
5
  "homepage": "https://orkestrator.dev",
6
6
  "repository": {
@@ -39,8 +39,8 @@
39
39
  "sharp": "0.35.5"
40
40
  },
41
41
  "devDependencies": {
42
- "@orkestrator/protocol": "2.37.0-alpha",
43
- "@orkestrator/toolchain": "2.37.0-alpha"
42
+ "@orkestrator/protocol": "2.37.3-beta",
43
+ "@orkestrator/toolchain": "2.37.3-beta"
44
44
  },
45
45
  "engines": {
46
46
  "bun": ">=1.4.4"
@@ -324,6 +324,7 @@ var BACKEND_LOG_AREAS = defineLogAreas({
324
324
  "instance.republish-failed": "The instance descriptor could not be republished; a later pass retries.",
325
325
  "parent.exited": "The parent process exited, so local servers are shutting down.",
326
326
  "startup.step-failed": "One part of startup failed and the backend carried on; `step` says which.",
327
+ "startup.failed": "Startup failed; the backend released what it had started and exits with code 1.",
327
328
  "startup.setup-fence-failed": "An environment's interrupted setup could not be fenced.",
328
329
  "startup.setup-adopt-failed": "An environment's pending setup could not be adopted.",
329
330
  "startup.deletion-pending": "An interrupted environment deletion stays pending. Its owning step logged the detail.",
@@ -488,6 +489,7 @@ var BRIDGE_LOG_AREAS = defineLogAreas({
488
489
  "app-server.stale-reaped": "A stale app-server left by an earlier bridge was stopped.",
489
490
  "app-server.stderr": "Metadata of an app-server stderr line, never its content.",
490
491
  "app-server.stderr-suppressed": "app-server stderr lines beyond the budget were counted, not described.",
492
+ "app-server.termination-unconfirmed": "app-server did not report an exit after SIGKILL; the restart or shutdown went on without it.",
491
493
  "approval.cancel-failed": "Cancelling a turn after an approval answer failed.",
492
494
  "approval.present-failed": "Presenting an approval threw; it is auto-declined.",
493
495
  "approval.resolved-callback-failed": "An approval resolved callback threw.",
@@ -773,6 +775,9 @@ var ENVIRONMENT_LOG_AREAS = defineLogAreas({
773
775
  "setup.record-failure-failed": "A setup failure before its first attempt could not be recorded.",
774
776
  "setup.tab-publish-failed": "The setup terminal's tab could not be published.",
775
777
  "lifecycle.failed": "Starting, rebuilding or recreating an environment failed; `operation` says which.",
778
+ "git-https-probe.failed": "Checking whether a project's GitHub remote works over HTTPS failed; `reason` says why.",
779
+ "git-https-remedy.failed": "Deciding whether to offer HTTPS after an SSH failure threw; no remedy is offered.",
780
+ "git-origin.switched-to-https": "A project's origin remote was switched from GitHub SSH to HTTPS at the user's request.",
776
781
  "tab-teardown.pending": "A tab's teardown failed and stays pending; the reconcile sweep retries.",
777
782
  "tab-reconcile.skipped": "Orphaned tab reconciliation was skipped because pane layouts are unreadable.",
778
783
  "orphan-session.reaped": "A native session no tab references was torn down.",
@@ -1045,7 +1050,34 @@ var NATIVE_AGENT_LOG_AREAS = defineLogAreas({
1045
1050
  "monitor.reconnecting": "The request monitor lost its stream and is reconnecting. Error class only.",
1046
1051
  "worker-limit.reached": "The bounded request workers are full, so the stream restarts and a snapshot reconciles.",
1047
1052
  "request.failed": "Handling a request event failed, so the stream restarts. Error class only.",
1048
- "credential-plugin.skipped": "A host OpenCode server started without the credential plugin, so its tools inherit its password; `reason` says why."
1053
+ "credential-plugin.skipped": "A host OpenCode server started without the credential plugin, so its tools inherit its password; `reason` says why.",
1054
+ "host-database.separated": "Host OpenCode uses Orkestrator's own database because the shared one has no `session` table (an OpenCode 2 database); `reason` says why.",
1055
+ "host-database.unreadable": "The shared OpenCode database could not be inspected, so host OpenCode opens it as usual. Error class only.",
1056
+ "login.opencode2-mirror-failed": "A provider sign-in change reached OpenCode 1 but could not be copied into the OpenCode 2 database; the user is told to retry. Error class only."
1057
+ }
1058
+ },
1059
+ "native-agent.opencode2": {
1060
+ description: "The OpenCode 2.x provider: its event monitor, steering, routing, host and container servers.",
1061
+ events: {
1062
+ "events.dropped": "The 2.x event stream ended or failed, so reads go to the server until it reconnects. Error class only.",
1063
+ "steer.unconfirmed": "A 2.x steer got no definite answer, so its delivery is reconciled from history. Error class only.",
1064
+ "provider.dispose-failed": "Disposing the 2.x provider of a replaced server failed. Error class only.",
1065
+ "transcript.unknown-row": "A 2.x history row of a kind the transcript does not know was dropped (a newer server). Its kind name only, once per kind.",
1066
+ "mcp.remove-failed": "Removing a closed session's Orkestrator MCP server from the 2.x server failed. Error class only.",
1067
+ "protocol.select-failed": "A workflow could not read the OpenCode line setting, so its new session takes 1.x. Error class only.",
1068
+ "host-server.ready": "A local environment's (or a coordinator conversation's) 2.x server answered `/api/info` as 2.x. Environment id, pid and whether it is a coordinator's only.",
1069
+ "coordinator-research.unavailable": "A coordinator's 2.x server could not register its research servers, so the conversation runs without them until the server restarts. Error class only.",
1070
+ "host-server.terminate-failed": "A 2.x server that did not become ready could not be stopped; its process entry is kept for shutdown. Error class only.",
1071
+ "container-server.launched": "The start script of a container environment's 2.x server was run. Container port only.",
1072
+ "container-server.ready": "A container environment's 2.x server this backend started answered `/api/info` as 2.x. Environment id only.",
1073
+ "container-server.warm-incomplete": "The first workspace request to a container's new 2.x server failed, so its plugins load on the next one. Error class only.",
1074
+ "resume-list.unavailable": "The 2.x sessions could not be listed for the resume picker, so it shows the 1.x list alone. Error class only.",
1075
+ "credential.mirrored": "A provider sign-in change was copied into the 2.x database. `outcome` (written, removed, unchanged, skipped) only; never a provider id or value.",
1076
+ "credential.server-exit-unclean": "The private 2.x server started to copy a sign-in did not stop cleanly. Error class only.",
1077
+ "user-config.mirror-failed": "The user's global OpenCode configuration could not be mirrored for a host 2.x server, which starts without it. Error class only.",
1078
+ "user-config.unreadable": "A file of the user's OpenCode configuration could not be read for the 2.x mirror. `source`, the file's name and the error code only.",
1079
+ "user-config.rejected": "Files of the user's OpenCode configuration are not a JSONC object, so the 2.x mirror leaves them out. `source` and file names only, never contents.",
1080
+ "user-config.plugins-withheld": "The user's OpenCode configuration lists plugins, which the 2.x mirror leaves out (1.x plugins do not run on 2.x). `source` only."
1049
1081
  }
1050
1082
  }
1051
1083
  });
@@ -2003,6 +2035,7 @@ var WEB_BUILD_PIPELINE_LOG_AREAS = defineLogAreas({
2003
2035
  "transcript.load-failed": "A stage transcript read failed and will retry with backoff.",
2004
2036
  "legacy.state-too-large": "Legacy pipeline state was over the limit and skipped.",
2005
2037
  "opencode-catalog.load-failed": "The cached OpenCode model list could not be loaded.",
2038
+ "model-catalog.hydrate-failed": "A node's cached model lists could not be loaded for a launcher.",
2006
2039
  "opencode-preferences.load-failed": "OpenCode model preferences could not be loaded."
2007
2040
  }
2008
2041
  }
@@ -3820,7 +3853,7 @@ function namesLimitOrLogin(text) {
3820
3853
  return NOT_A_CAPACITY_REFUSAL.test(text);
3821
3854
  }
3822
3855
 
3823
- // ../../node_modules/.bun/@agentclientprotocol+sdk@2.4.0+9d2c8fc322cd3916/node_modules/@agentclientprotocol/sdk/dist/v1/schema/index.js
3856
+ // ../../node_modules/.bun/@agentclientprotocol+sdk@2.4.0+b277ba6e31909555/node_modules/@agentclientprotocol/sdk/dist/v1/schema/index.js
3824
3857
  var AGENT_METHODS = {
3825
3858
  initialize: "initialize",
3826
3859
  authenticate: "authenticate",
@@ -9666,7 +9699,7 @@ function preprocess(fn, schema) {
9666
9699
  out: schema
9667
9700
  });
9668
9701
  }
9669
- // ../../node_modules/.bun/@agentclientprotocol+sdk@2.4.0+9d2c8fc322cd3916/node_modules/@agentclientprotocol/sdk/dist/core/schema-deserialize.js
9702
+ // ../../node_modules/.bun/@agentclientprotocol+sdk@2.4.0+b277ba6e31909555/node_modules/@agentclientprotocol/sdk/dist/core/schema-deserialize.js
9670
9703
  var skippedItem = Symbol("skippedItem");
9671
9704
  function defaultOnError(schema, fallback) {
9672
9705
  return schema.catch(fallback);
@@ -9737,7 +9770,7 @@ function wideInt() {
9737
9770
  });
9738
9771
  }
9739
9772
 
9740
- // ../../node_modules/.bun/@agentclientprotocol+sdk@2.4.0+9d2c8fc322cd3916/node_modules/@agentclientprotocol/sdk/dist/v1/schema/zod.gen.js
9773
+ // ../../node_modules/.bun/@agentclientprotocol+sdk@2.4.0+b277ba6e31909555/node_modules/@agentclientprotocol/sdk/dist/v1/schema/zod.gen.js
9741
9774
  var zRequestId = union([wideInt(), string2()]).nullable();
9742
9775
  var zSessionId = string2();
9743
9776
  var zWriteTextFileRequest = object({
@@ -11259,13 +11292,13 @@ var zCancelRequestNotification = object({
11259
11292
  })
11260
11293
  });
11261
11294
 
11262
- // ../../node_modules/.bun/@agentclientprotocol+sdk@2.4.0+9d2c8fc322cd3916/node_modules/@agentclientprotocol/sdk/dist/core/jsonrpc.js
11295
+ // ../../node_modules/.bun/@agentclientprotocol+sdk@2.4.0+b277ba6e31909555/node_modules/@agentclientprotocol/sdk/dist/core/jsonrpc.js
11263
11296
  var nullIdResponders = new WeakSet;
11264
11297
 
11265
- // ../../node_modules/.bun/@agentclientprotocol+sdk@2.4.0+9d2c8fc322cd3916/node_modules/@agentclientprotocol/sdk/dist/core/stream-limits.js
11298
+ // ../../node_modules/.bun/@agentclientprotocol+sdk@2.4.0+b277ba6e31909555/node_modules/@agentclientprotocol/sdk/dist/core/stream-limits.js
11266
11299
  var DEFAULT_MAX_MESSAGE_BYTES = 32 * 1024 * 1024;
11267
11300
 
11268
- // ../../node_modules/.bun/@agentclientprotocol+sdk@2.4.0+9d2c8fc322cd3916/node_modules/@agentclientprotocol/sdk/dist/v1/schema/guards.gen.js
11301
+ // ../../node_modules/.bun/@agentclientprotocol+sdk@2.4.0+b277ba6e31909555/node_modules/@agentclientprotocol/sdk/dist/v1/schema/guards.gen.js
11269
11302
  var zGuardCreateElicitationRequestForm = zElicitationFormMode.and(object({ mode: literal("form") })).and(object({ message: string2() }));
11270
11303
  var zGuardCreateElicitationRequestUrl = zElicitationUrlMode.and(object({ mode: literal("url") })).and(object({ message: string2() }));
11271
11304
  var zGuardCreateElicitationRequestCustom = union([zElicitationSessionScope, zElicitationRequestScope]).and(object({ message: string2() }));
@@ -11282,7 +11315,7 @@ var zGuardCreateElicitationResponseDecline = object({
11282
11315
  var zGuardCreateElicitationResponseCancel = object({
11283
11316
  action: literal("cancel")
11284
11317
  });
11285
- // ../../node_modules/.bun/@agentclientprotocol+sdk@2.4.0+9d2c8fc322cd3916/node_modules/@agentclientprotocol/sdk/dist/core/app-handlers.js
11318
+ // ../../node_modules/.bun/@agentclientprotocol+sdk@2.4.0+b277ba6e31909555/node_modules/@agentclientprotocol/sdk/dist/core/app-handlers.js
11286
11319
  function parseParams(parser, params) {
11287
11320
  if (!parser) {
11288
11321
  return params;
@@ -11293,10 +11326,10 @@ function parseParams(parser, params) {
11293
11326
  return parser.parse(params);
11294
11327
  }
11295
11328
 
11296
- // ../../node_modules/.bun/@agentclientprotocol+sdk@2.4.0+9d2c8fc322cd3916/node_modules/@agentclientprotocol/sdk/dist/core/connection-access.js
11329
+ // ../../node_modules/.bun/@agentclientprotocol+sdk@2.4.0+b277ba6e31909555/node_modules/@agentclientprotocol/sdk/dist/core/connection-access.js
11297
11330
  var connectionContextOf = Symbol("connectionContextOf");
11298
11331
 
11299
- // ../../node_modules/.bun/@agentclientprotocol+sdk@2.4.0+9d2c8fc322cd3916/node_modules/@agentclientprotocol/sdk/dist/v1/stable/acp.js
11332
+ // ../../node_modules/.bun/@agentclientprotocol+sdk@2.4.0+b277ba6e31909555/node_modules/@agentclientprotocol/sdk/dist/v1/stable/acp.js
11300
11333
  var initializedConnections = new WeakSet;
11301
11334
  function emptyObjectResponse(response) {
11302
11335
  return response ?? {};
@@ -12529,6 +12562,79 @@ function formatAcpRpcError(error, provider) {
12529
12562
  return primary ?? detail ?? "ACP request failed";
12530
12563
  }
12531
12564
 
12565
+ // ../../bridges/acp-bridge/src/acp-process-tree.ts
12566
+ import { execFile } from "node:child_process";
12567
+ import { promisify } from "node:util";
12568
+ var exec = promisify(execFile);
12569
+ async function processes() {
12570
+ if (process.platform === "win32")
12571
+ return [];
12572
+ const { stdout } = await exec("ps", ["-A", "-ww", "-o", "pid=,ppid=,lstart=,command="], {
12573
+ timeout: 2000,
12574
+ maxBuffer: 4 * 1024 * 1024
12575
+ });
12576
+ return stdout.split(`
12577
+ `).flatMap((line) => {
12578
+ const match = /^\s*(\d+)\s+(\d+)\s+(.+)$/.exec(line);
12579
+ return match ? [{ pid: Number(match[1]), parent: Number(match[2]), stamp: match[3] }] : [];
12580
+ });
12581
+ }
12582
+ async function terminateAcpProcessTree(child) {
12583
+ if (!child.pid || child.exitCode !== null || child.signalCode !== null)
12584
+ return;
12585
+ const table = await processes().catch(() => []);
12586
+ const owned = new Map;
12587
+ const parents = new Set([child.pid]);
12588
+ let changed = true;
12589
+ while (changed) {
12590
+ changed = false;
12591
+ for (const entry of table) {
12592
+ if (parents.has(entry.parent) && !parents.has(entry.pid)) {
12593
+ owned.set(entry.pid, entry);
12594
+ parents.add(entry.pid);
12595
+ changed = true;
12596
+ }
12597
+ }
12598
+ }
12599
+ const signal = (kind, table) => {
12600
+ const current = new Map(table.map((entry) => [entry.pid, entry]));
12601
+ for (const entry of Array.from(owned.values()).reverse()) {
12602
+ if (current.get(entry.pid)?.stamp !== entry.stamp)
12603
+ continue;
12604
+ try {
12605
+ process.kill(entry.pid, kind);
12606
+ } catch {}
12607
+ }
12608
+ if (child.exitCode === null && child.signalCode === null) {
12609
+ try {
12610
+ child.kill(kind);
12611
+ } catch {}
12612
+ }
12613
+ };
12614
+ const alive = (pid) => {
12615
+ try {
12616
+ process.kill(pid, 0);
12617
+ return true;
12618
+ } catch (error) {
12619
+ return error.code !== "ESRCH";
12620
+ }
12621
+ };
12622
+ const wait = async (ms) => {
12623
+ const deadline = Date.now() + ms;
12624
+ while (Date.now() < deadline) {
12625
+ if ((child.exitCode !== null || child.signalCode !== null) && !Array.from(owned.keys()).some(alive))
12626
+ return true;
12627
+ await new Promise((resolve) => setTimeout(resolve, 25));
12628
+ }
12629
+ return false;
12630
+ };
12631
+ signal("SIGTERM", table);
12632
+ if (await wait(2000))
12633
+ return;
12634
+ signal("SIGKILL", await processes().catch(() => []));
12635
+ await wait(1000);
12636
+ }
12637
+
12532
12638
  // ../../bridges/acp-bridge/src/acp-jsonl-framer.ts
12533
12639
  class JsonlLineFramer {
12534
12640
  #maxLineBytes;
@@ -13760,6 +13866,7 @@ class AcpProcess {
13760
13866
  #pending = new Map;
13761
13867
  #closed = false;
13762
13868
  #readOnlyProfile;
13869
+ #terminating;
13763
13870
  #terminationOutcome;
13764
13871
  #stdoutFramer = new JsonlLineFramer(MAX_LINE_BYTES);
13765
13872
  onUpdate = unattachedUpdate;
@@ -13945,20 +14052,8 @@ class AcpProcess {
13945
14052
  if (outcome === "rejected" || this.#terminationOutcome === undefined) {
13946
14053
  this.#terminationOutcome = outcome;
13947
14054
  }
13948
- if (this.child.exitCode !== null || this.child.signalCode !== null)
13949
- return;
13950
- const exited = new Promise((resolvePromise) => this.child.once("exit", () => resolvePromise()));
13951
- this.child.kill("SIGTERM");
13952
- const forced = setTimeout(() => {
13953
- if (this.child.exitCode === null && this.child.signalCode === null)
13954
- this.child.kill("SIGKILL");
13955
- }, 2000);
13956
- forced.unref();
13957
- await Promise.race([
13958
- exited,
13959
- new Promise((resolvePromise) => setTimeout(resolvePromise, 3000))
13960
- ]);
13961
- clearTimeout(forced);
14055
+ this.#terminating ??= terminateAcpProcessTree(this.child);
14056
+ await this.#terminating;
13962
14057
  }
13963
14058
  #write(value) {
13964
14059
  try {
@@ -16971,6 +17066,7 @@ function isArtifactServerToolCall(params, connection, recordedInput) {
16971
17066
  var WORKFLOW_RESULT_MAX_BYTES = 384 * 1024;
16972
17067
  var WORKFLOW_RESULT_MAX_PENDING_BYTES = 8 * 1024 * 1024;
16973
17068
  var WORKFLOW_RESULT_KINDS = [
17069
+ "auto-pipeline-draft",
16974
17070
  "feature-plan-state",
16975
17071
  "story-refinement",
16976
17072
  "validation-plan",
@@ -16986,6 +17082,7 @@ var WORKFLOW_RESULT_KINDS = [
16986
17082
  "graph-template"
16987
17083
  ];
16988
17084
  var WORKFLOW_RESULT_TOOL_NAMES = {
17085
+ "auto-pipeline-draft": "submit_auto_pipeline_draft",
16989
17086
  "feature-plan-state": "submit_feature_plan_state",
16990
17087
  "story-refinement": "submit_story_refinement",
16991
17088
  "validation-plan": "submit_validation_plan",
@@ -19778,7 +19875,8 @@ var SHARED_RULES = [
19778
19875
  ["auth-failed", /terminal prompts disabled|invalid username or password|bad credentials/i],
19779
19876
  ["auth-failed", /permission denied \(|permission to \S+ denied|host key verification failed/i],
19780
19877
  ["auth-failed", /gh auth login|not logged in|unauthorized|http 401|returned error: 40[13]/i],
19781
- ["network-failed", /could not resolve host|connection (?:timed out|refused|reset)/i],
19878
+ ["network-failed", /could not resolve host|(?:connection|operation) timed out/i],
19879
+ ["network-failed", /connection (?:refused|reset)/i],
19782
19880
  ["network-failed", /network is unreachable|no route to host|temporary failure in name/i],
19783
19881
  ["network-failed", /early eof|failed to connect|remote end hung up/i],
19784
19882
  ["network-failed", /unable to access ['"]?https?:\/\//i],
@@ -142,6 +142,7 @@ var BACKEND_LOG_AREAS = defineLogAreas({
142
142
  "instance.republish-failed": "The instance descriptor could not be republished; a later pass retries.",
143
143
  "parent.exited": "The parent process exited, so local servers are shutting down.",
144
144
  "startup.step-failed": "One part of startup failed and the backend carried on; `step` says which.",
145
+ "startup.failed": "Startup failed; the backend released what it had started and exits with code 1.",
145
146
  "startup.setup-fence-failed": "An environment's interrupted setup could not be fenced.",
146
147
  "startup.setup-adopt-failed": "An environment's pending setup could not be adopted.",
147
148
  "startup.deletion-pending": "An interrupted environment deletion stays pending. Its owning step logged the detail.",
@@ -306,6 +307,7 @@ var BRIDGE_LOG_AREAS = defineLogAreas({
306
307
  "app-server.stale-reaped": "A stale app-server left by an earlier bridge was stopped.",
307
308
  "app-server.stderr": "Metadata of an app-server stderr line, never its content.",
308
309
  "app-server.stderr-suppressed": "app-server stderr lines beyond the budget were counted, not described.",
310
+ "app-server.termination-unconfirmed": "app-server did not report an exit after SIGKILL; the restart or shutdown went on without it.",
309
311
  "approval.cancel-failed": "Cancelling a turn after an approval answer failed.",
310
312
  "approval.present-failed": "Presenting an approval threw; it is auto-declined.",
311
313
  "approval.resolved-callback-failed": "An approval resolved callback threw.",
@@ -591,6 +593,9 @@ var ENVIRONMENT_LOG_AREAS = defineLogAreas({
591
593
  "setup.record-failure-failed": "A setup failure before its first attempt could not be recorded.",
592
594
  "setup.tab-publish-failed": "The setup terminal's tab could not be published.",
593
595
  "lifecycle.failed": "Starting, rebuilding or recreating an environment failed; `operation` says which.",
596
+ "git-https-probe.failed": "Checking whether a project's GitHub remote works over HTTPS failed; `reason` says why.",
597
+ "git-https-remedy.failed": "Deciding whether to offer HTTPS after an SSH failure threw; no remedy is offered.",
598
+ "git-origin.switched-to-https": "A project's origin remote was switched from GitHub SSH to HTTPS at the user's request.",
594
599
  "tab-teardown.pending": "A tab's teardown failed and stays pending; the reconcile sweep retries.",
595
600
  "tab-reconcile.skipped": "Orphaned tab reconciliation was skipped because pane layouts are unreadable.",
596
601
  "orphan-session.reaped": "A native session no tab references was torn down.",
@@ -863,7 +868,34 @@ var NATIVE_AGENT_LOG_AREAS = defineLogAreas({
863
868
  "monitor.reconnecting": "The request monitor lost its stream and is reconnecting. Error class only.",
864
869
  "worker-limit.reached": "The bounded request workers are full, so the stream restarts and a snapshot reconciles.",
865
870
  "request.failed": "Handling a request event failed, so the stream restarts. Error class only.",
866
- "credential-plugin.skipped": "A host OpenCode server started without the credential plugin, so its tools inherit its password; `reason` says why."
871
+ "credential-plugin.skipped": "A host OpenCode server started without the credential plugin, so its tools inherit its password; `reason` says why.",
872
+ "host-database.separated": "Host OpenCode uses Orkestrator's own database because the shared one has no `session` table (an OpenCode 2 database); `reason` says why.",
873
+ "host-database.unreadable": "The shared OpenCode database could not be inspected, so host OpenCode opens it as usual. Error class only.",
874
+ "login.opencode2-mirror-failed": "A provider sign-in change reached OpenCode 1 but could not be copied into the OpenCode 2 database; the user is told to retry. Error class only."
875
+ }
876
+ },
877
+ "native-agent.opencode2": {
878
+ description: "The OpenCode 2.x provider: its event monitor, steering, routing, host and container servers.",
879
+ events: {
880
+ "events.dropped": "The 2.x event stream ended or failed, so reads go to the server until it reconnects. Error class only.",
881
+ "steer.unconfirmed": "A 2.x steer got no definite answer, so its delivery is reconciled from history. Error class only.",
882
+ "provider.dispose-failed": "Disposing the 2.x provider of a replaced server failed. Error class only.",
883
+ "transcript.unknown-row": "A 2.x history row of a kind the transcript does not know was dropped (a newer server). Its kind name only, once per kind.",
884
+ "mcp.remove-failed": "Removing a closed session's Orkestrator MCP server from the 2.x server failed. Error class only.",
885
+ "protocol.select-failed": "A workflow could not read the OpenCode line setting, so its new session takes 1.x. Error class only.",
886
+ "host-server.ready": "A local environment's (or a coordinator conversation's) 2.x server answered `/api/info` as 2.x. Environment id, pid and whether it is a coordinator's only.",
887
+ "coordinator-research.unavailable": "A coordinator's 2.x server could not register its research servers, so the conversation runs without them until the server restarts. Error class only.",
888
+ "host-server.terminate-failed": "A 2.x server that did not become ready could not be stopped; its process entry is kept for shutdown. Error class only.",
889
+ "container-server.launched": "The start script of a container environment's 2.x server was run. Container port only.",
890
+ "container-server.ready": "A container environment's 2.x server this backend started answered `/api/info` as 2.x. Environment id only.",
891
+ "container-server.warm-incomplete": "The first workspace request to a container's new 2.x server failed, so its plugins load on the next one. Error class only.",
892
+ "resume-list.unavailable": "The 2.x sessions could not be listed for the resume picker, so it shows the 1.x list alone. Error class only.",
893
+ "credential.mirrored": "A provider sign-in change was copied into the 2.x database. `outcome` (written, removed, unchanged, skipped) only; never a provider id or value.",
894
+ "credential.server-exit-unclean": "The private 2.x server started to copy a sign-in did not stop cleanly. Error class only.",
895
+ "user-config.mirror-failed": "The user's global OpenCode configuration could not be mirrored for a host 2.x server, which starts without it. Error class only.",
896
+ "user-config.unreadable": "A file of the user's OpenCode configuration could not be read for the 2.x mirror. `source`, the file's name and the error code only.",
897
+ "user-config.rejected": "Files of the user's OpenCode configuration are not a JSONC object, so the 2.x mirror leaves them out. `source` and file names only, never contents.",
898
+ "user-config.plugins-withheld": "The user's OpenCode configuration lists plugins, which the 2.x mirror leaves out (1.x plugins do not run on 2.x). `source` only."
867
899
  }
868
900
  }
869
901
  });
@@ -1821,6 +1853,7 @@ var WEB_BUILD_PIPELINE_LOG_AREAS = defineLogAreas({
1821
1853
  "transcript.load-failed": "A stage transcript read failed and will retry with backoff.",
1822
1854
  "legacy.state-too-large": "Legacy pipeline state was over the limit and skipped.",
1823
1855
  "opencode-catalog.load-failed": "The cached OpenCode model list could not be loaded.",
1856
+ "model-catalog.hydrate-failed": "A node's cached model lists could not be loaded for a launcher.",
1824
1857
  "opencode-preferences.load-failed": "OpenCode model preferences could not be loaded."
1825
1858
  }
1826
1859
  }
@@ -8545,7 +8578,6 @@ import {
8545
8578
  writeFile as writeFile2
8546
8579
  } from "node:fs/promises";
8547
8580
  import { isAbsolute, join as join3 } from "node:path";
8548
-
8549
8581
  // ../protocol/src/coordinator.ts
8550
8582
  var COORDINATOR_COMMAND_SANDBOX_ENV = "ORKESTRATOR_COORDINATOR_COMMAND_SANDBOX";
8551
8583
  var COORDINATOR_PROTECTED_DATA_DIR_ENV = "ORKESTRATOR_COORDINATOR_PROTECTED_DATA_DIR";
@@ -8556,6 +8588,8 @@ var COORDINATOR_CLAUDE_USER_SKILLS_DIR_ENV = "ORKESTRATOR_COORDINATOR_CLAUDE_USE
8556
8588
  var COORDINATOR_OTHER_ENVIRONMENTS_SETTING_LABEL = "Let the coordinator use environments it did not create";
8557
8589
  var COORDINATOR_ENVIRONMENT_ORIGIN_REFUSAL = `Not done: this coordinator did not create that environment, so it may not send it work. Do not retry. Use an environment this coordinator launched, or start a new one. If the user wants this coordinator to work in environments it did not create, tell them to turn on "${COORDINATOR_OTHER_ENVIRONMENTS_SETTING_LABEL}" in this project's settings, under Coordinator.`;
8558
8590
  var COORDINATOR_CONTROL_TOOL_NAMES = Object.freeze([
8591
+ "mark_topic",
8592
+ "mark_question",
8559
8593
  "ack_message",
8560
8594
  "add_ticket_comment",
8561
8595
  "address_multi_review",
@@ -12811,6 +12845,7 @@ async function retireDrainingClaudeRuntime(session, waitMs = DRAINING_RUNTIME_EX
12811
12845
  runtime.ended.then(() => true),
12812
12846
  new Promise((resolve) => {
12813
12847
  timer = setTimeout(() => resolve(false), waitMs);
12848
+ timer.unref?.();
12814
12849
  })
12815
12850
  ]);
12816
12851
  } finally {
@@ -13128,7 +13163,8 @@ var SHARED_RULES = [
13128
13163
  ["auth-failed", /terminal prompts disabled|invalid username or password|bad credentials/i],
13129
13164
  ["auth-failed", /permission denied \(|permission to \S+ denied|host key verification failed/i],
13130
13165
  ["auth-failed", /gh auth login|not logged in|unauthorized|http 401|returned error: 40[13]/i],
13131
- ["network-failed", /could not resolve host|connection (?:timed out|refused|reset)/i],
13166
+ ["network-failed", /could not resolve host|(?:connection|operation) timed out/i],
13167
+ ["network-failed", /connection (?:refused|reset)/i],
13132
13168
  ["network-failed", /network is unreachable|no route to host|temporary failure in name/i],
13133
13169
  ["network-failed", /early eof|failed to connect|remote end hung up/i],
13134
13170
  ["network-failed", /unable to access ['"]?https?:\/\//i],
@@ -18633,6 +18669,7 @@ async function readFromLiveClaude(read, timeoutMs = LIVE_CLAUDE_READ_TIMEOUT_MS)
18633
18669
  answer,
18634
18670
  new Promise((resolve) => {
18635
18671
  timer = setTimeout(() => resolve(undefined), timeoutMs);
18672
+ timer.unref?.();
18636
18673
  })
18637
18674
  ]);
18638
18675
  if (value !== undefined)
@@ -18963,6 +19000,7 @@ async function probeModels(at) {
18963
19000
  answer,
18964
19001
  new Promise((_resolve, reject) => {
18965
19002
  timer = setTimeout(() => reject(new Error("The model probe did not answer in time")), CLAUDE_MODEL_PROBE_TIMEOUT_MS);
19003
+ timer.unref?.();
18966
19004
  })
18967
19005
  ]);
18968
19006
  debugLog("[session-manager] Supported models fetched", { count: models.length });
@@ -20159,6 +20197,7 @@ async function runDiscoveryProbe(config) {
20159
20197
  }) : Promise.resolve(undefined);
20160
20198
  const timeout = new Promise((_, reject) => {
20161
20199
  timer = setTimeout(() => reject(new Error("Claude command discovery timed out")), COMMAND_PROBE_TIMEOUT_MS);
20200
+ timer.unref?.();
20162
20201
  });
20163
20202
  read.catch(() => {
20164
20203
  return;
@@ -20526,6 +20565,7 @@ import { createHash as createHash11 } from "node:crypto";
20526
20565
  var WORKFLOW_RESULT_MAX_BYTES = 384 * 1024;
20527
20566
  var WORKFLOW_RESULT_MAX_PENDING_BYTES = 8 * 1024 * 1024;
20528
20567
  var WORKFLOW_RESULT_KINDS = [
20568
+ "auto-pipeline-draft",
20529
20569
  "feature-plan-state",
20530
20570
  "story-refinement",
20531
20571
  "validation-plan",
@@ -20541,6 +20581,7 @@ var WORKFLOW_RESULT_KINDS = [
20541
20581
  "graph-template"
20542
20582
  ];
20543
20583
  var WORKFLOW_RESULT_TOOL_NAMES = {
20584
+ "auto-pipeline-draft": "submit_auto_pipeline_draft",
20544
20585
  "feature-plan-state": "submit_feature_plan_state",
20545
20586
  "story-refinement": "submit_story_refinement",
20546
20587
  "validation-plan": "submit_validation_plan",
@@ -24250,6 +24291,7 @@ async function settlesBy(work, deadline) {
24250
24291
  let timer;
24251
24292
  const expired = new Promise((resolve) => {
24252
24293
  timer = setTimeout(() => resolve(false), Math.max(0, deadline - Date.now()));
24294
+ timer.unref?.();
24253
24295
  });
24254
24296
  try {
24255
24297
  return await Promise.race([work.then(() => true), expired]);
@@ -26813,6 +26855,51 @@ function createBoundedSseWriter(write, onOverflow, limits = {}) {
26813
26855
  return attempt;
26814
26856
  };
26815
26857
  }
26858
+ function createSseConnectionClosure() {
26859
+ const waiters = new Set;
26860
+ let isClosed = false;
26861
+ let resolveClosed;
26862
+ const closed = new Promise((resolve) => {
26863
+ resolveClosed = resolve;
26864
+ });
26865
+ return {
26866
+ closed,
26867
+ get isClosed() {
26868
+ return isClosed;
26869
+ },
26870
+ get pendingWaiters() {
26871
+ return waiters.size;
26872
+ },
26873
+ close() {
26874
+ if (isClosed)
26875
+ return;
26876
+ isClosed = true;
26877
+ for (const wake of Array.from(waiters))
26878
+ wake();
26879
+ waiters.clear();
26880
+ resolveClosed();
26881
+ },
26882
+ race(write) {
26883
+ if (isClosed) {
26884
+ write.catch(() => {
26885
+ return;
26886
+ });
26887
+ return Promise.resolve();
26888
+ }
26889
+ return new Promise((resolve, reject) => {
26890
+ const wake = () => resolve();
26891
+ waiters.add(wake);
26892
+ write.then(() => {
26893
+ waiters.delete(wake);
26894
+ resolve();
26895
+ }, (error) => {
26896
+ waiters.delete(wake);
26897
+ reject(error);
26898
+ });
26899
+ });
26900
+ }
26901
+ };
26902
+ }
26816
26903
  var KEEPALIVE_INTERVAL_MS = 30000;
26817
26904
  function createEventsRouter(limits = {}) {
26818
26905
  const events = new Hono2;
@@ -26827,22 +26914,15 @@ function createEventsRouter(limits = {}) {
26827
26914
  const connectedAt = new Date().toISOString();
26828
26915
  log24.debug("sse.opened", { connectedAt });
26829
26916
  let isOpen = true;
26830
- let resolveConnectionClosed;
26831
- const connectionClosed = new Promise((resolve) => {
26832
- resolveConnectionClosed = resolve;
26833
- });
26834
- let resolveRequestAborted;
26835
- const requestAborted = new Promise((resolve) => {
26836
- resolveRequestAborted = resolve;
26837
- });
26917
+ const closure = createSseConnectionClosure();
26838
26918
  const onRequestAbort = () => {
26839
26919
  log24.debug("sse.aborted");
26840
26920
  isOpen = false;
26841
- resolveRequestAborted();
26921
+ closure.close();
26842
26922
  };
26843
26923
  if (c.req.raw.signal.aborted) {
26844
26924
  isOpen = false;
26845
- resolveRequestAborted();
26925
+ closure.close();
26846
26926
  } else {
26847
26927
  c.req.raw.signal.addEventListener("abort", onRequestAbort, { once: true });
26848
26928
  }
@@ -26851,12 +26931,12 @@ function createEventsRouter(limits = {}) {
26851
26931
  return;
26852
26932
  isOpen = false;
26853
26933
  log24.info("sse.closed", { reason });
26854
- resolveConnectionClosed();
26934
+ closure.close();
26855
26935
  };
26856
26936
  const writeFrame = createBoundedSseWriter(async (frame) => {
26857
26937
  if (!isOpen)
26858
26938
  throw new Error("SSE request aborted");
26859
- await Promise.race([stream.writeSSE(frame), requestAborted, connectionClosed]);
26939
+ await closure.race(stream.writeSSE(frame));
26860
26940
  if (!isOpen)
26861
26941
  throw new Error("SSE request aborted");
26862
26942
  }, () => closeConnection("write backlog exceeded its cap"), { maxPendingFrames, maxPendingBytes });
@@ -26968,7 +27048,7 @@ function createEventsRouter(limits = {}) {
26968
27048
  }
26969
27049
  });
26970
27050
  }, keepaliveIntervalMs);
26971
- await Promise.race([connectionClosed, requestAborted]);
27051
+ await closure.closed;
26972
27052
  } catch (error) {
26973
27053
  if (!c.req.raw.signal.aborted) {
26974
27054
  log24.warn("sse.handshake-failed", { error: formatLogError(error) });