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
|
@@ -161,6 +161,53 @@ function resolveAgentId(input) {
|
|
|
161
161
|
return lookup.get(input.toLowerCase());
|
|
162
162
|
}
|
|
163
163
|
|
|
164
|
+
// packages/agent-spawn/src/configs/mcp.ts
|
|
165
|
+
function toJsonMcpServers(servers) {
|
|
166
|
+
const out = {};
|
|
167
|
+
for (const [name, server] of Object.entries(servers)) {
|
|
168
|
+
const mapped = { command: server.command };
|
|
169
|
+
if (server.args && server.args.length > 0) {
|
|
170
|
+
mapped.args = server.args;
|
|
171
|
+
}
|
|
172
|
+
if (server.env && Object.keys(server.env).length > 0) {
|
|
173
|
+
mapped.env = server.env;
|
|
174
|
+
}
|
|
175
|
+
out[name] = mapped;
|
|
176
|
+
}
|
|
177
|
+
return out;
|
|
178
|
+
}
|
|
179
|
+
function toTomlString(value) {
|
|
180
|
+
return JSON.stringify(value);
|
|
181
|
+
}
|
|
182
|
+
function toTomlArray(values) {
|
|
183
|
+
const serialized = values.map((value) => toTomlString(value));
|
|
184
|
+
return `[${serialized.join(", ")}]`;
|
|
185
|
+
}
|
|
186
|
+
function toTomlInlineTable(values) {
|
|
187
|
+
const parts = [];
|
|
188
|
+
for (const [key, value] of Object.entries(values)) {
|
|
189
|
+
parts.push(`${JSON.stringify(key)}=${toTomlString(value)}`);
|
|
190
|
+
}
|
|
191
|
+
return `{${parts.join(", ")}}`;
|
|
192
|
+
}
|
|
193
|
+
function serializeJsonMcpArgs(servers) {
|
|
194
|
+
return ["--mcp-config", JSON.stringify({ mcpServers: toJsonMcpServers(servers) })];
|
|
195
|
+
}
|
|
196
|
+
function serializeCodexMcpArgs(servers) {
|
|
197
|
+
const args = [];
|
|
198
|
+
for (const [name, server] of Object.entries(servers)) {
|
|
199
|
+
const prefix = `mcp_servers.${name}`;
|
|
200
|
+
args.push("-c", `${prefix}.command=${toTomlString(server.command)}`);
|
|
201
|
+
if (server.args && server.args.length > 0) {
|
|
202
|
+
args.push("-c", `${prefix}.args=${toTomlArray(server.args)}`);
|
|
203
|
+
}
|
|
204
|
+
if (server.env && Object.keys(server.env).length > 0) {
|
|
205
|
+
args.push("-c", `${prefix}.env=${toTomlInlineTable(server.env)}`);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
return args;
|
|
209
|
+
}
|
|
210
|
+
|
|
164
211
|
// packages/agent-spawn/src/configs/claude-code.ts
|
|
165
212
|
var claudeCodeSpawnConfig = {
|
|
166
213
|
kind: "cli",
|
|
@@ -176,6 +223,7 @@ var claudeCodeSpawnConfig = {
|
|
|
176
223
|
"stream-json",
|
|
177
224
|
"--verbose"
|
|
178
225
|
],
|
|
226
|
+
mcpArgs: serializeJsonMcpArgs,
|
|
179
227
|
modes: {
|
|
180
228
|
yolo: ["--dangerously-skip-permissions"],
|
|
181
229
|
edit: ["--permission-mode", "acceptEdits", "--allowedTools", "Bash,Read,Write,Edit,Glob,Grep,NotebookEdit"],
|
|
@@ -201,6 +249,7 @@ var codexSpawnConfig = {
|
|
|
201
249
|
modelFlag: "--model",
|
|
202
250
|
modelStripProviderPrefix: true,
|
|
203
251
|
defaultArgs: ["--skip-git-repo-check", "--json"],
|
|
252
|
+
mcpArgs: serializeCodexMcpArgs,
|
|
204
253
|
modes: {
|
|
205
254
|
yolo: ["-s", "danger-full-access"],
|
|
206
255
|
edit: ["-s", "workspace-write"],
|
|
@@ -254,6 +303,7 @@ var kimiSpawnConfig = {
|
|
|
254
303
|
promptFlag: "-p",
|
|
255
304
|
modelStripProviderPrefix: true,
|
|
256
305
|
defaultArgs: ["--print", "--output-format", "stream-json"],
|
|
306
|
+
mcpArgs: serializeJsonMcpArgs,
|
|
257
307
|
modes: {
|
|
258
308
|
yolo: ["--yolo"],
|
|
259
309
|
edit: [],
|
|
@@ -288,6 +338,16 @@ function getSpawnConfig(input) {
|
|
|
288
338
|
}
|
|
289
339
|
return lookup2.get(resolvedId);
|
|
290
340
|
}
|
|
341
|
+
function listMcpSupportedAgents() {
|
|
342
|
+
const supported = [];
|
|
343
|
+
for (const config of allSpawnConfigs) {
|
|
344
|
+
if (config.kind !== "cli" || typeof config.mcpArgs !== "function") {
|
|
345
|
+
continue;
|
|
346
|
+
}
|
|
347
|
+
supported.push(config.agentId);
|
|
348
|
+
}
|
|
349
|
+
return supported;
|
|
350
|
+
}
|
|
291
351
|
|
|
292
352
|
// packages/agent-spawn/src/spawn.ts
|
|
293
353
|
import { spawn as spawnChildProcess } from "node:child_process";
|
|
@@ -307,6 +367,29 @@ function resolveConfig(agentId) {
|
|
|
307
367
|
return { agentId: resolvedAgentId, binaryName, spawnConfig };
|
|
308
368
|
}
|
|
309
369
|
|
|
370
|
+
// packages/agent-spawn/src/mcp-args.ts
|
|
371
|
+
function hasMcpServers(servers) {
|
|
372
|
+
if (!servers) {
|
|
373
|
+
return false;
|
|
374
|
+
}
|
|
375
|
+
return Object.keys(servers).length > 0;
|
|
376
|
+
}
|
|
377
|
+
function getMcpArgs(config, servers) {
|
|
378
|
+
if (!hasMcpServers(servers)) {
|
|
379
|
+
return [];
|
|
380
|
+
}
|
|
381
|
+
if (!config.mcpArgs) {
|
|
382
|
+
throw new Error(formatUnsupportedMcpSpawnMessage(config.agentId));
|
|
383
|
+
}
|
|
384
|
+
return config.mcpArgs(servers);
|
|
385
|
+
}
|
|
386
|
+
function formatUnsupportedMcpSpawnMessage(agentId) {
|
|
387
|
+
const supported = listMcpSupportedAgents();
|
|
388
|
+
const supportedText = supported.length > 0 ? supported.join(", ") : "(none)";
|
|
389
|
+
return `Agent "${agentId}" does not support MCP servers at spawn time.
|
|
390
|
+
Agents with spawn-time MCP support: ${supportedText}`;
|
|
391
|
+
}
|
|
392
|
+
|
|
310
393
|
// packages/agent-spawn/src/model-utils.ts
|
|
311
394
|
function stripModelNamespace(model) {
|
|
312
395
|
const slashIndex = model.indexOf("/");
|
|
@@ -343,6 +426,7 @@ function buildCliArgs(config, options, stdinMode) {
|
|
|
343
426
|
args.push(config.modelFlag, model);
|
|
344
427
|
}
|
|
345
428
|
args.push(...config.defaultArgs);
|
|
429
|
+
args.push(...getMcpArgs(config, options.mcpServers));
|
|
346
430
|
args.push(...config.modes[options.mode ?? "yolo"]);
|
|
347
431
|
if (options.args && options.args.length > 0) {
|
|
348
432
|
args.push(...options.args);
|
|
@@ -561,7 +645,7 @@ var AGENT_PREFIX = `${chalk6.green.bold("\u2713")} agent: `;
|
|
|
561
645
|
|
|
562
646
|
// packages/design-system/src/prompts/index.ts
|
|
563
647
|
import * as clack from "@clack/prompts";
|
|
564
|
-
import { isCancel, cancel, log as log2 } from "@clack/prompts";
|
|
648
|
+
import { isCancel as isCancel2, cancel as cancel2, log as log2 } from "@clack/prompts";
|
|
565
649
|
|
|
566
650
|
// packages/design-system/src/static/spinner.ts
|
|
567
651
|
import chalk7 from "chalk";
|