poe-code 3.0.126 → 3.0.127

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.
@@ -193,6 +193,17 @@ function toTomlInlineTable(values) {
193
193
  function serializeJsonMcpArgs(servers) {
194
194
  return ["--mcp-config", JSON.stringify({ mcpServers: toJsonMcpServers(servers) })];
195
195
  }
196
+ function serializeOpenCodeMcpEnv(servers) {
197
+ const mcp = {};
198
+ for (const [name, server] of Object.entries(servers)) {
199
+ const entry = { type: "local", command: [server.command, ...server.args ?? []] };
200
+ if (server.env && Object.keys(server.env).length > 0) {
201
+ entry.environment = server.env;
202
+ }
203
+ mcp[name] = entry;
204
+ }
205
+ return { OPENCODE_CONFIG_CONTENT: JSON.stringify({ mcp }) };
206
+ }
196
207
  function serializeCodexMcpArgs(servers) {
197
208
  const args = [];
198
209
  for (const [name, server] of Object.entries(servers)) {
@@ -290,7 +301,8 @@ var openCodeSpawnConfig = {
290
301
  defaultArgs: [],
291
302
  promptFlag: "--prompt"
292
303
  },
293
- resumeCommand: (threadId, cwd) => [cwd, "--session", threadId]
304
+ resumeCommand: (threadId, cwd) => [cwd, "--session", threadId],
305
+ mcpEnv: serializeOpenCodeMcpEnv
294
306
  };
295
307
 
296
308
  // packages/agent-spawn/src/configs/kimi.ts
@@ -342,7 +354,7 @@ function getSpawnConfig(input) {
342
354
  function listMcpSupportedAgents() {
343
355
  const supported = [];
344
356
  for (const config of allSpawnConfigs) {
345
- if (config.kind !== "cli" || typeof config.mcpArgs !== "function") {
357
+ if (config.kind !== "cli" || typeof config.mcpArgs !== "function" && typeof config.mcpEnv !== "function") {
346
358
  continue;
347
359
  }
348
360
  supported.push(config.agentId);
@@ -379,9 +391,12 @@ function getMcpArgs(config, servers) {
379
391
  if (!hasMcpServers(servers)) {
380
392
  return [];
381
393
  }
382
- if (!config.mcpArgs) {
394
+ if (!config.mcpArgs && !config.mcpEnv) {
383
395
  throw new Error(formatUnsupportedMcpSpawnMessage(config.agentId));
384
396
  }
397
+ if (!config.mcpArgs) {
398
+ return [];
399
+ }
385
400
  return config.mcpArgs(servers);
386
401
  }
387
402
  function formatUnsupportedMcpSpawnMessage(agentId) {