@ycodium-ai/agent-opencode 0.2.2130 → 0.2.2155

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 (2) hide show
  1. package/dist/index.js +20 -5
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -602,7 +602,10 @@ var OPENCODE_CARD = {
602
602
  additionalProperties: true
603
603
  },
604
604
  modelConnectivity: {
605
- dialects: ["anthropic-messages", "openai-responses", "openai-chat-completions"],
605
+ // 只报绑定送得出去的那一种:下面那段配置把 `npm` 定死成 openai-compatible,后缀是
606
+ // `/chat/completions`,它打本机端点说的永远是 chat。换 `@ai-sdk/anthropic` 能说
607
+ // messages 不算——投递不换这一栏。别家的脑经宿主翻译接上。
608
+ dialects: ["openai-chat-completions"],
606
609
  acceptsExternalEndpoints: true,
607
610
  supportsNativeSubscription: true,
608
611
  // opencode 不认「地址一个变量、凭据一个变量」——它读的是
@@ -611,7 +614,8 @@ var OPENCODE_CARD = {
611
614
  // 设这个变量(`cliParse.ts` 的 `resolveOpenCodeConfigContent`),默认 `{}`。
612
615
  //
613
616
  // `npm: "@ai-sdk/openai-compatible"` 定死它说 chat-completions;换成
614
- // `@ai-sdk/anthropic` 就是 messages。代理按实际路径认方言,这一栏改了代理不用动。
617
+ // `@ai-sdk/anthropic` 就是 messages——那时后缀与 `dialects` 要跟着一起换:宿主按后缀
618
+ // 认手说的方言,兼容判定据此挑直通还是翻译。
615
619
  //
616
620
  // **还有三层压在这个变量之上**:org 远程配置、`/etc/opencode/`、macOS MDM。手没走
617
621
  // 代理时宿主会 logWarning(`provider.proxy.never-reached`)。
@@ -1526,6 +1530,11 @@ function mapPermissionDecision(reply) {
1526
1530
  }
1527
1531
  }
1528
1532
 
1533
+ // src/probe.ts
1534
+ import {
1535
+ ExecutorSpawnRefusedError as ExecutorSpawnRefusedError2
1536
+ } from "@ycodium-ai/plugin-api/executor";
1537
+
1529
1538
  // src/server.ts
1530
1539
  import * as NodeNet from "node:net";
1531
1540
  import * as NodeOS3 from "node:os";
@@ -6935,6 +6944,7 @@ var import_cross_spawn = __toESM(require_cross_spawn(), 1);
6935
6944
 
6936
6945
  // src/server.ts
6937
6946
  import {
6947
+ ExecutorSpawnRefusedError,
6938
6948
  mergeLaunchEnv,
6939
6949
  brainSlotEnvKeys
6940
6950
  } from "@ycodium-ai/plugin-api/executor";
@@ -7260,7 +7270,8 @@ async function runOpenCodeCommand(input) {
7260
7270
  async function withOneSecondRetry(run) {
7261
7271
  try {
7262
7272
  return await run();
7263
- } catch {
7273
+ } catch (error) {
7274
+ if (error instanceof ExecutorSpawnRefusedError) throw error;
7264
7275
  await new Promise((resolve2) => setTimeout(resolve2, 1e3));
7265
7276
  return await run();
7266
7277
  }
@@ -7311,7 +7322,8 @@ async function loadInventoryFromCli(input) {
7311
7322
  return command;
7312
7323
  });
7313
7324
  return parseAgentListCliOutput(result.stdout);
7314
- } catch {
7325
+ } catch (error) {
7326
+ if (error instanceof ExecutorSpawnRefusedError) throw error;
7315
7327
  return [];
7316
7328
  }
7317
7329
  };
@@ -7325,7 +7337,8 @@ async function loadInventoryFromCli(input) {
7325
7337
  return command;
7326
7338
  });
7327
7339
  return parseSkillsCliOutput(result.stdout);
7328
- } catch {
7340
+ } catch (error) {
7341
+ if (error instanceof ExecutorSpawnRefusedError) throw error;
7329
7342
  return [];
7330
7343
  }
7331
7344
  };
@@ -7424,6 +7437,7 @@ ${result.stderr}`);
7424
7437
  };
7425
7438
  }
7426
7439
  } catch (cause) {
7440
+ if (cause instanceof ExecutorSpawnRefusedError2) throw cause;
7427
7441
  return formatOpenCodeProbeError({ cause, isExternalServer: false, version });
7428
7442
  }
7429
7443
  }
@@ -7489,6 +7503,7 @@ ${result.stderr}`);
7489
7503
  ...OPENCODE_NATIVE_MODE_REPORT
7490
7504
  };
7491
7505
  } catch (cause) {
7506
+ if (cause instanceof ExecutorSpawnRefusedError2) throw cause;
7492
7507
  const mapped = formatOpenCodeProbeError({ cause, isExternalServer: isExternal, version });
7493
7508
  if (mapped.detail) {
7494
7509
  const hidden = hideGenericEffectText(mapped.detail);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ycodium-ai/agent-opencode",
3
- "version": "0.2.2130",
3
+ "version": "0.2.2155",
4
4
  "description": "OpenCode executor: OpenCode CLI via @opencode-ai/sdk/v2.",
5
5
  "keywords": [
6
6
  "ycodium",
@@ -23,7 +23,7 @@
23
23
  "@types/node": "24.12.4",
24
24
  "esbuild": "0.28.1",
25
25
  "vite-plus": "0.2.2",
26
- "@ycodium-ai/plugin-api": "0.2.2130"
26
+ "@ycodium-ai/plugin-api": "0.2.2155"
27
27
  },
28
28
  "ycodium": {
29
29
  "plugin": "./dist/index.js",