poe-code 3.0.69 → 3.0.70
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/cli/bootstrap.js +2 -2
- package/dist/cli/bootstrap.js.map +1 -1
- package/dist/cli/commands/configure-payload.js +3 -1
- package/dist/cli/commands/configure-payload.js.map +1 -1
- package/dist/cli/commands/login.js +8 -28
- package/dist/cli/commands/login.js.map +1 -1
- package/dist/cli/commands/spawn.js +86 -3
- package/dist/cli/commands/spawn.js.map +1 -1
- package/dist/cli/commands/usage.js +5 -2
- package/dist/cli/commands/usage.js.map +1 -1
- package/dist/cli/container.js +10 -1
- package/dist/cli/container.js.map +1 -1
- package/dist/cli/errors.d.ts +5 -0
- package/dist/cli/errors.js +14 -0
- package/dist/cli/errors.js.map +1 -1
- package/dist/cli/logger.js +7 -0
- package/dist/cli/logger.js.map +1 -1
- package/dist/cli/options.d.ts +5 -0
- package/dist/cli/options.js +102 -12
- package/dist/cli/options.js.map +1 -1
- package/dist/index.js +442 -130
- package/dist/index.js.map +4 -4
- package/dist/providers/claude-code.js +85 -1
- package/dist/providers/claude-code.js.map +4 -4
- package/dist/providers/codex.js +85 -1
- package/dist/providers/codex.js.map +4 -4
- package/dist/providers/kimi.js +85 -1
- package/dist/providers/kimi.js.map +4 -4
- package/dist/providers/opencode.js +85 -1
- package/dist/providers/opencode.js.map +4 -4
- package/dist/providers/spawn-options.d.ts +2 -1
- package/dist/sdk/container.js +2 -1
- package/dist/sdk/container.js.map +1 -1
- package/dist/sdk/spawn-core.d.ts +3 -1
- package/dist/sdk/spawn-core.js +1 -0
- package/dist/sdk/spawn-core.js.map +1 -1
- package/dist/sdk/spawn.js +5 -1
- package/dist/sdk/spawn.js.map +1 -1
- package/dist/sdk/types.d.ts +3 -1
- package/package.json +2 -1
|
@@ -191,6 +191,53 @@ function resolveAgentId(input) {
|
|
|
191
191
|
return lookup.get(input.toLowerCase());
|
|
192
192
|
}
|
|
193
193
|
|
|
194
|
+
// packages/agent-spawn/src/configs/mcp.ts
|
|
195
|
+
function toJsonMcpServers(servers) {
|
|
196
|
+
const out = {};
|
|
197
|
+
for (const [name, server] of Object.entries(servers)) {
|
|
198
|
+
const mapped = { command: server.command };
|
|
199
|
+
if (server.args && server.args.length > 0) {
|
|
200
|
+
mapped.args = server.args;
|
|
201
|
+
}
|
|
202
|
+
if (server.env && Object.keys(server.env).length > 0) {
|
|
203
|
+
mapped.env = server.env;
|
|
204
|
+
}
|
|
205
|
+
out[name] = mapped;
|
|
206
|
+
}
|
|
207
|
+
return out;
|
|
208
|
+
}
|
|
209
|
+
function toTomlString(value) {
|
|
210
|
+
return JSON.stringify(value);
|
|
211
|
+
}
|
|
212
|
+
function toTomlArray(values) {
|
|
213
|
+
const serialized = values.map((value) => toTomlString(value));
|
|
214
|
+
return `[${serialized.join(", ")}]`;
|
|
215
|
+
}
|
|
216
|
+
function toTomlInlineTable(values) {
|
|
217
|
+
const parts = [];
|
|
218
|
+
for (const [key, value] of Object.entries(values)) {
|
|
219
|
+
parts.push(`${JSON.stringify(key)}=${toTomlString(value)}`);
|
|
220
|
+
}
|
|
221
|
+
return `{${parts.join(", ")}}`;
|
|
222
|
+
}
|
|
223
|
+
function serializeJsonMcpArgs(servers) {
|
|
224
|
+
return ["--mcp-config", JSON.stringify({ mcpServers: toJsonMcpServers(servers) })];
|
|
225
|
+
}
|
|
226
|
+
function serializeCodexMcpArgs(servers) {
|
|
227
|
+
const args = [];
|
|
228
|
+
for (const [name, server] of Object.entries(servers)) {
|
|
229
|
+
const prefix = `mcp_servers.${name}`;
|
|
230
|
+
args.push("-c", `${prefix}.command=${toTomlString(server.command)}`);
|
|
231
|
+
if (server.args && server.args.length > 0) {
|
|
232
|
+
args.push("-c", `${prefix}.args=${toTomlArray(server.args)}`);
|
|
233
|
+
}
|
|
234
|
+
if (server.env && Object.keys(server.env).length > 0) {
|
|
235
|
+
args.push("-c", `${prefix}.env=${toTomlInlineTable(server.env)}`);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
return args;
|
|
239
|
+
}
|
|
240
|
+
|
|
194
241
|
// packages/agent-spawn/src/configs/claude-code.ts
|
|
195
242
|
var claudeCodeSpawnConfig = {
|
|
196
243
|
kind: "cli",
|
|
@@ -206,6 +253,7 @@ var claudeCodeSpawnConfig = {
|
|
|
206
253
|
"stream-json",
|
|
207
254
|
"--verbose"
|
|
208
255
|
],
|
|
256
|
+
mcpArgs: serializeJsonMcpArgs,
|
|
209
257
|
modes: {
|
|
210
258
|
yolo: ["--dangerously-skip-permissions"],
|
|
211
259
|
edit: ["--permission-mode", "acceptEdits", "--allowedTools", "Bash,Read,Write,Edit,Glob,Grep,NotebookEdit"],
|
|
@@ -231,6 +279,7 @@ var codexSpawnConfig = {
|
|
|
231
279
|
modelFlag: "--model",
|
|
232
280
|
modelStripProviderPrefix: true,
|
|
233
281
|
defaultArgs: ["--skip-git-repo-check", "--json"],
|
|
282
|
+
mcpArgs: serializeCodexMcpArgs,
|
|
234
283
|
modes: {
|
|
235
284
|
yolo: ["-s", "danger-full-access"],
|
|
236
285
|
edit: ["-s", "workspace-write"],
|
|
@@ -284,6 +333,7 @@ var kimiSpawnConfig = {
|
|
|
284
333
|
promptFlag: "-p",
|
|
285
334
|
modelStripProviderPrefix: true,
|
|
286
335
|
defaultArgs: ["--print", "--output-format", "stream-json"],
|
|
336
|
+
mcpArgs: serializeJsonMcpArgs,
|
|
287
337
|
modes: {
|
|
288
338
|
yolo: ["--yolo"],
|
|
289
339
|
edit: [],
|
|
@@ -318,6 +368,16 @@ function getSpawnConfig(input) {
|
|
|
318
368
|
}
|
|
319
369
|
return lookup2.get(resolvedId);
|
|
320
370
|
}
|
|
371
|
+
function listMcpSupportedAgents() {
|
|
372
|
+
const supported = [];
|
|
373
|
+
for (const config of allSpawnConfigs) {
|
|
374
|
+
if (config.kind !== "cli" || typeof config.mcpArgs !== "function") {
|
|
375
|
+
continue;
|
|
376
|
+
}
|
|
377
|
+
supported.push(config.agentId);
|
|
378
|
+
}
|
|
379
|
+
return supported;
|
|
380
|
+
}
|
|
321
381
|
|
|
322
382
|
// packages/agent-spawn/src/spawn.ts
|
|
323
383
|
import { spawn as spawnChildProcess } from "node:child_process";
|
|
@@ -337,6 +397,29 @@ function resolveConfig(agentId) {
|
|
|
337
397
|
return { agentId: resolvedAgentId, binaryName, spawnConfig };
|
|
338
398
|
}
|
|
339
399
|
|
|
400
|
+
// packages/agent-spawn/src/mcp-args.ts
|
|
401
|
+
function hasMcpServers(servers) {
|
|
402
|
+
if (!servers) {
|
|
403
|
+
return false;
|
|
404
|
+
}
|
|
405
|
+
return Object.keys(servers).length > 0;
|
|
406
|
+
}
|
|
407
|
+
function getMcpArgs(config, servers) {
|
|
408
|
+
if (!hasMcpServers(servers)) {
|
|
409
|
+
return [];
|
|
410
|
+
}
|
|
411
|
+
if (!config.mcpArgs) {
|
|
412
|
+
throw new Error(formatUnsupportedMcpSpawnMessage(config.agentId));
|
|
413
|
+
}
|
|
414
|
+
return config.mcpArgs(servers);
|
|
415
|
+
}
|
|
416
|
+
function formatUnsupportedMcpSpawnMessage(agentId) {
|
|
417
|
+
const supported = listMcpSupportedAgents();
|
|
418
|
+
const supportedText = supported.length > 0 ? supported.join(", ") : "(none)";
|
|
419
|
+
return `Agent "${agentId}" does not support MCP servers at spawn time.
|
|
420
|
+
Agents with spawn-time MCP support: ${supportedText}`;
|
|
421
|
+
}
|
|
422
|
+
|
|
340
423
|
// packages/agent-spawn/src/model-utils.ts
|
|
341
424
|
function stripModelNamespace(model) {
|
|
342
425
|
const slashIndex = model.indexOf("/");
|
|
@@ -373,6 +456,7 @@ function buildCliArgs(config, options, stdinMode) {
|
|
|
373
456
|
args.push(config.modelFlag, model);
|
|
374
457
|
}
|
|
375
458
|
args.push(...config.defaultArgs);
|
|
459
|
+
args.push(...getMcpArgs(config, options.mcpServers));
|
|
376
460
|
args.push(...config.modes[options.mode ?? "yolo"]);
|
|
377
461
|
if (options.args && options.args.length > 0) {
|
|
378
462
|
args.push(...options.args);
|
|
@@ -591,7 +675,7 @@ var AGENT_PREFIX = `${chalk6.green.bold("\u2713")} agent: `;
|
|
|
591
675
|
|
|
592
676
|
// packages/design-system/src/prompts/index.ts
|
|
593
677
|
import * as clack from "@clack/prompts";
|
|
594
|
-
import { isCancel, cancel, log as log2 } from "@clack/prompts";
|
|
678
|
+
import { isCancel as isCancel2, cancel as cancel2, log as log2 } from "@clack/prompts";
|
|
595
679
|
|
|
596
680
|
// packages/design-system/src/static/spinner.ts
|
|
597
681
|
import chalk7 from "chalk";
|