poe-code 3.0.169 → 3.0.171
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/bin/poe-goose.js +23 -0
- package/dist/cli/commands/configure-payload.js +10 -0
- package/dist/cli/commands/configure-payload.js.map +1 -1
- package/dist/cli/commands/experiment.js +1 -1
- package/dist/cli/commands/experiment.js.map +1 -1
- package/dist/cli/commands/pipeline.js +1 -1
- package/dist/cli/commands/pipeline.js.map +1 -1
- package/dist/cli/commands/spawn.js +4 -0
- package/dist/cli/commands/spawn.js.map +1 -1
- package/dist/cli/constants.d.ts +2 -0
- package/dist/cli/constants.js +2 -0
- package/dist/cli/constants.js.map +1 -1
- package/dist/cli/service-registry.d.ts +9 -0
- package/dist/cli/service-registry.js.map +1 -1
- package/dist/index.js +434 -91
- package/dist/index.js.map +4 -4
- package/dist/providers/claude-code.js +197 -27
- package/dist/providers/claude-code.js.map +4 -4
- package/dist/providers/codex.js +203 -33
- package/dist/providers/codex.js.map +4 -4
- package/dist/providers/create-provider.d.ts +1 -0
- package/dist/providers/create-provider.js +6 -5
- package/dist/providers/create-provider.js.map +1 -1
- package/dist/providers/goose.d.ts +16 -0
- package/dist/providers/goose.js +2514 -0
- package/dist/providers/goose.js.map +7 -0
- package/dist/providers/kimi.js +196 -26
- package/dist/providers/kimi.js.map +4 -4
- package/dist/providers/opencode.js +196 -26
- package/dist/providers/opencode.js.map +4 -4
- package/dist/providers/poe-agent.js +96 -43
- package/dist/providers/poe-agent.js.map +4 -4
- package/dist/utils/command-checks.js +4 -2
- package/dist/utils/command-checks.js.map +1 -1
- package/package.json +2 -2
- /package/dist/templates/pipeline/{steps.yaml.hbs → steps.yaml.mustache} +0 -0
package/dist/index.js
CHANGED
|
@@ -512,6 +512,28 @@ var init_kimi = __esm({
|
|
|
512
512
|
}
|
|
513
513
|
});
|
|
514
514
|
|
|
515
|
+
// packages/agent-defs/src/agents/goose.ts
|
|
516
|
+
var gooseAgent;
|
|
517
|
+
var init_goose = __esm({
|
|
518
|
+
"packages/agent-defs/src/agents/goose.ts"() {
|
|
519
|
+
"use strict";
|
|
520
|
+
gooseAgent = {
|
|
521
|
+
id: "goose",
|
|
522
|
+
name: "goose",
|
|
523
|
+
label: "Goose",
|
|
524
|
+
summary: "Block's open-source AI agent with ACP support.",
|
|
525
|
+
binaryName: "goose",
|
|
526
|
+
configPath: "~/.config/goose/config.yaml",
|
|
527
|
+
branding: {
|
|
528
|
+
colors: {
|
|
529
|
+
dark: "#FF6B35",
|
|
530
|
+
light: "#E85D26"
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
};
|
|
534
|
+
}
|
|
535
|
+
});
|
|
536
|
+
|
|
515
537
|
// packages/agent-defs/src/agents/index.ts
|
|
516
538
|
var init_agents = __esm({
|
|
517
539
|
"packages/agent-defs/src/agents/index.ts"() {
|
|
@@ -521,6 +543,7 @@ var init_agents = __esm({
|
|
|
521
543
|
init_codex();
|
|
522
544
|
init_opencode();
|
|
523
545
|
init_kimi();
|
|
546
|
+
init_goose();
|
|
524
547
|
}
|
|
525
548
|
});
|
|
526
549
|
|
|
@@ -541,7 +564,8 @@ var init_registry = __esm({
|
|
|
541
564
|
claudeDesktopAgent,
|
|
542
565
|
codexAgent,
|
|
543
566
|
openCodeAgent,
|
|
544
|
-
kimiAgent
|
|
567
|
+
kimiAgent,
|
|
568
|
+
gooseAgent
|
|
545
569
|
];
|
|
546
570
|
lookup = /* @__PURE__ */ new Map();
|
|
547
571
|
for (const agent2 of allAgents) {
|
|
@@ -1376,6 +1400,87 @@ var init_toml = __esm({
|
|
|
1376
1400
|
}
|
|
1377
1401
|
});
|
|
1378
1402
|
|
|
1403
|
+
// packages/config-mutations/src/formats/yaml.ts
|
|
1404
|
+
import { parse as parseYaml2, stringify as stringifyYaml } from "yaml";
|
|
1405
|
+
function isConfigObject3(value) {
|
|
1406
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1407
|
+
}
|
|
1408
|
+
function parse4(content) {
|
|
1409
|
+
if (!content || content.trim() === "") {
|
|
1410
|
+
return {};
|
|
1411
|
+
}
|
|
1412
|
+
const parsed = parseYaml2(content);
|
|
1413
|
+
if (parsed === null || parsed === void 0) {
|
|
1414
|
+
return {};
|
|
1415
|
+
}
|
|
1416
|
+
if (!isConfigObject3(parsed)) {
|
|
1417
|
+
throw new Error("Expected YAML object.");
|
|
1418
|
+
}
|
|
1419
|
+
return parsed;
|
|
1420
|
+
}
|
|
1421
|
+
function serialize3(obj) {
|
|
1422
|
+
const serialized = stringifyYaml(obj);
|
|
1423
|
+
return serialized.endsWith("\n") ? serialized : `${serialized}
|
|
1424
|
+
`;
|
|
1425
|
+
}
|
|
1426
|
+
function merge4(base, patch) {
|
|
1427
|
+
const result = { ...base };
|
|
1428
|
+
for (const [key, value] of Object.entries(patch)) {
|
|
1429
|
+
if (value === void 0) {
|
|
1430
|
+
continue;
|
|
1431
|
+
}
|
|
1432
|
+
const existing = result[key];
|
|
1433
|
+
if (isConfigObject3(existing) && isConfigObject3(value)) {
|
|
1434
|
+
result[key] = merge4(existing, value);
|
|
1435
|
+
continue;
|
|
1436
|
+
}
|
|
1437
|
+
result[key] = value;
|
|
1438
|
+
}
|
|
1439
|
+
return result;
|
|
1440
|
+
}
|
|
1441
|
+
function prune4(obj, shape) {
|
|
1442
|
+
let changed = false;
|
|
1443
|
+
const result = { ...obj };
|
|
1444
|
+
for (const [key, pattern] of Object.entries(shape)) {
|
|
1445
|
+
if (!(key in result)) {
|
|
1446
|
+
continue;
|
|
1447
|
+
}
|
|
1448
|
+
const current = result[key];
|
|
1449
|
+
if (isConfigObject3(pattern) && Object.keys(pattern).length === 0) {
|
|
1450
|
+
delete result[key];
|
|
1451
|
+
changed = true;
|
|
1452
|
+
continue;
|
|
1453
|
+
}
|
|
1454
|
+
if (isConfigObject3(pattern) && isConfigObject3(current)) {
|
|
1455
|
+
const { changed: childChanged, result: childResult } = prune4(current, pattern);
|
|
1456
|
+
if (childChanged) {
|
|
1457
|
+
changed = true;
|
|
1458
|
+
}
|
|
1459
|
+
if (Object.keys(childResult).length === 0) {
|
|
1460
|
+
delete result[key];
|
|
1461
|
+
} else {
|
|
1462
|
+
result[key] = childResult;
|
|
1463
|
+
}
|
|
1464
|
+
continue;
|
|
1465
|
+
}
|
|
1466
|
+
delete result[key];
|
|
1467
|
+
changed = true;
|
|
1468
|
+
}
|
|
1469
|
+
return { changed, result };
|
|
1470
|
+
}
|
|
1471
|
+
var yamlFormat;
|
|
1472
|
+
var init_yaml = __esm({
|
|
1473
|
+
"packages/config-mutations/src/formats/yaml.ts"() {
|
|
1474
|
+
"use strict";
|
|
1475
|
+
yamlFormat = {
|
|
1476
|
+
parse: parse4,
|
|
1477
|
+
serialize: serialize3,
|
|
1478
|
+
merge: merge4,
|
|
1479
|
+
prune: prune4
|
|
1480
|
+
};
|
|
1481
|
+
}
|
|
1482
|
+
});
|
|
1483
|
+
|
|
1379
1484
|
// packages/config-mutations/src/formats/index.ts
|
|
1380
1485
|
function getConfigFormat(pathOrFormat) {
|
|
1381
1486
|
if (pathOrFormat in formatRegistry) {
|
|
@@ -1407,15 +1512,20 @@ var init_formats = __esm({
|
|
|
1407
1512
|
"use strict";
|
|
1408
1513
|
init_json();
|
|
1409
1514
|
init_toml();
|
|
1515
|
+
init_yaml();
|
|
1410
1516
|
init_json();
|
|
1411
1517
|
init_toml();
|
|
1518
|
+
init_yaml();
|
|
1412
1519
|
formatRegistry = {
|
|
1413
1520
|
json: jsonFormat,
|
|
1414
|
-
toml: tomlFormat
|
|
1521
|
+
toml: tomlFormat,
|
|
1522
|
+
yaml: yamlFormat
|
|
1415
1523
|
};
|
|
1416
1524
|
extensionMap = {
|
|
1417
1525
|
".json": "json",
|
|
1418
|
-
".toml": "toml"
|
|
1526
|
+
".toml": "toml",
|
|
1527
|
+
".yaml": "yaml",
|
|
1528
|
+
".yml": "yaml"
|
|
1419
1529
|
};
|
|
1420
1530
|
}
|
|
1421
1531
|
});
|
|
@@ -1553,7 +1663,7 @@ function pruneKeysByPrefix(table, prefix) {
|
|
|
1553
1663
|
}
|
|
1554
1664
|
return result;
|
|
1555
1665
|
}
|
|
1556
|
-
function
|
|
1666
|
+
function isConfigObject4(value) {
|
|
1557
1667
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1558
1668
|
}
|
|
1559
1669
|
function mergeWithPruneByPrefix(base, patch, pruneByPrefix) {
|
|
@@ -1562,7 +1672,7 @@ function mergeWithPruneByPrefix(base, patch, pruneByPrefix) {
|
|
|
1562
1672
|
for (const [key, value] of Object.entries(patch)) {
|
|
1563
1673
|
const current = result[key];
|
|
1564
1674
|
const prefix = prefixMap[key];
|
|
1565
|
-
if (
|
|
1675
|
+
if (isConfigObject4(current) && isConfigObject4(value)) {
|
|
1566
1676
|
if (prefix) {
|
|
1567
1677
|
const pruned = pruneKeysByPrefix(current, prefix);
|
|
1568
1678
|
result[key] = { ...pruned, ...value };
|
|
@@ -3231,6 +3341,22 @@ var init_run_command = __esm({
|
|
|
3231
3341
|
}
|
|
3232
3342
|
});
|
|
3233
3343
|
|
|
3344
|
+
// packages/agent-spawn/src/types.ts
|
|
3345
|
+
function resolveModeConfig(modeConfig) {
|
|
3346
|
+
if (Array.isArray(modeConfig)) {
|
|
3347
|
+
return { args: modeConfig };
|
|
3348
|
+
}
|
|
3349
|
+
return {
|
|
3350
|
+
args: modeConfig.args ?? [],
|
|
3351
|
+
env: modeConfig.env && Object.keys(modeConfig.env).length > 0 ? modeConfig.env : void 0
|
|
3352
|
+
};
|
|
3353
|
+
}
|
|
3354
|
+
var init_types2 = __esm({
|
|
3355
|
+
"packages/agent-spawn/src/types.ts"() {
|
|
3356
|
+
"use strict";
|
|
3357
|
+
}
|
|
3358
|
+
});
|
|
3359
|
+
|
|
3234
3360
|
// packages/agent-spawn/src/configs/mcp.ts
|
|
3235
3361
|
function toJsonMcpServers(servers) {
|
|
3236
3362
|
const out = {};
|
|
@@ -3288,6 +3414,12 @@ function serializeCodexMcpArgs(servers) {
|
|
|
3288
3414
|
}
|
|
3289
3415
|
return args;
|
|
3290
3416
|
}
|
|
3417
|
+
function serializeGooseMcpArgs(servers) {
|
|
3418
|
+
return Object.values(servers).flatMap((server) => [
|
|
3419
|
+
"--with-extension",
|
|
3420
|
+
[server.command, ...server.args ?? []].join(" ")
|
|
3421
|
+
]);
|
|
3422
|
+
}
|
|
3291
3423
|
var init_mcp = __esm({
|
|
3292
3424
|
"packages/agent-spawn/src/configs/mcp.ts"() {
|
|
3293
3425
|
"use strict";
|
|
@@ -3448,6 +3580,47 @@ var init_kimi2 = __esm({
|
|
|
3448
3580
|
}
|
|
3449
3581
|
});
|
|
3450
3582
|
|
|
3583
|
+
// packages/agent-spawn/src/configs/goose.ts
|
|
3584
|
+
var gooseSpawnConfig, gooseAcpSpawnConfig;
|
|
3585
|
+
var init_goose2 = __esm({
|
|
3586
|
+
"packages/agent-spawn/src/configs/goose.ts"() {
|
|
3587
|
+
"use strict";
|
|
3588
|
+
init_mcp();
|
|
3589
|
+
gooseSpawnConfig = {
|
|
3590
|
+
kind: "cli",
|
|
3591
|
+
agentId: "goose",
|
|
3592
|
+
adapter: "native",
|
|
3593
|
+
promptFlag: "--text",
|
|
3594
|
+
modelFlag: "--model",
|
|
3595
|
+
modelStripProviderPrefix: false,
|
|
3596
|
+
defaultArgs: ["run", "--output-format", "stream-json"],
|
|
3597
|
+
defaultArgsPosition: "beforePrompt",
|
|
3598
|
+
mcpArgs: serializeGooseMcpArgs,
|
|
3599
|
+
mcpArgsPosition: "beforePrompt",
|
|
3600
|
+
modes: {
|
|
3601
|
+
yolo: { env: { GOOSE_MODE: "auto" } },
|
|
3602
|
+
edit: { env: { GOOSE_MODE: "smart_approve" } },
|
|
3603
|
+
read: { env: { GOOSE_MODE: "chat" } }
|
|
3604
|
+
},
|
|
3605
|
+
stdinMode: {
|
|
3606
|
+
omitPrompt: true,
|
|
3607
|
+
extraArgs: ["--instructions", "-"]
|
|
3608
|
+
},
|
|
3609
|
+
interactive: {
|
|
3610
|
+
defaultArgs: ["session"],
|
|
3611
|
+
defaultArgsPosition: "beforePrompt"
|
|
3612
|
+
},
|
|
3613
|
+
resumeCommand: () => ["run", "--resume", "--text", "continue"]
|
|
3614
|
+
};
|
|
3615
|
+
gooseAcpSpawnConfig = {
|
|
3616
|
+
kind: "acp",
|
|
3617
|
+
agentId: "goose",
|
|
3618
|
+
acpArgs: ["acp"],
|
|
3619
|
+
skipAuth: true
|
|
3620
|
+
};
|
|
3621
|
+
}
|
|
3622
|
+
});
|
|
3623
|
+
|
|
3451
3624
|
// packages/agent-spawn/src/configs/index.ts
|
|
3452
3625
|
function getSpawnConfig(input) {
|
|
3453
3626
|
const resolvedId = resolveAgentId(input);
|
|
@@ -3486,11 +3659,13 @@ var init_configs = __esm({
|
|
|
3486
3659
|
init_codex2();
|
|
3487
3660
|
init_opencode2();
|
|
3488
3661
|
init_kimi2();
|
|
3662
|
+
init_goose2();
|
|
3489
3663
|
allSpawnConfigs = [
|
|
3490
3664
|
claudeCodeSpawnConfig,
|
|
3491
3665
|
codexSpawnConfig,
|
|
3492
3666
|
openCodeSpawnConfig,
|
|
3493
|
-
kimiSpawnConfig
|
|
3667
|
+
kimiSpawnConfig,
|
|
3668
|
+
gooseSpawnConfig
|
|
3494
3669
|
];
|
|
3495
3670
|
lookup2 = /* @__PURE__ */ new Map();
|
|
3496
3671
|
for (const config of allSpawnConfigs) {
|
|
@@ -3499,6 +3674,7 @@ var init_configs = __esm({
|
|
|
3499
3674
|
acpLookup = /* @__PURE__ */ new Map();
|
|
3500
3675
|
acpLookup.set(openCodeAcpSpawnConfig.agentId, openCodeAcpSpawnConfig);
|
|
3501
3676
|
acpLookup.set(kimiAcpSpawnConfig.agentId, kimiAcpSpawnConfig);
|
|
3677
|
+
acpLookup.set(gooseAcpSpawnConfig.agentId, gooseAcpSpawnConfig);
|
|
3502
3678
|
}
|
|
3503
3679
|
});
|
|
3504
3680
|
|
|
@@ -3607,10 +3783,27 @@ function resolveCliConfig(agentId) {
|
|
|
3607
3783
|
spawnConfig: resolved.spawnConfig
|
|
3608
3784
|
};
|
|
3609
3785
|
}
|
|
3786
|
+
function getDefaultArgsPosition(config) {
|
|
3787
|
+
return config.defaultArgsPosition ?? "afterPrompt";
|
|
3788
|
+
}
|
|
3789
|
+
function getMcpArgsPosition(config) {
|
|
3790
|
+
if (config.mcpArgsPosition) {
|
|
3791
|
+
return config.mcpArgsPosition;
|
|
3792
|
+
}
|
|
3793
|
+
return config.mcpArgsBeforeCommand ? "beforeCommand" : "afterCommand";
|
|
3794
|
+
}
|
|
3610
3795
|
function buildCliArgs(config, options, stdinMode) {
|
|
3611
3796
|
const mcpArgs = getMcpArgs(config, options.mcpServers);
|
|
3797
|
+
const defaultArgsPosition = getDefaultArgsPosition(config);
|
|
3798
|
+
const mcpArgsPosition = getMcpArgsPosition(config);
|
|
3612
3799
|
const args = [];
|
|
3613
|
-
if (
|
|
3800
|
+
if (mcpArgsPosition === "beforeCommand") {
|
|
3801
|
+
args.push(...mcpArgs);
|
|
3802
|
+
}
|
|
3803
|
+
if (defaultArgsPosition === "beforePrompt") {
|
|
3804
|
+
args.push(...config.defaultArgs);
|
|
3805
|
+
}
|
|
3806
|
+
if (mcpArgsPosition === "beforePrompt") {
|
|
3614
3807
|
args.push(...mcpArgs);
|
|
3615
3808
|
}
|
|
3616
3809
|
if (stdinMode) {
|
|
@@ -3627,15 +3820,18 @@ function buildCliArgs(config, options, stdinMode) {
|
|
|
3627
3820
|
if (config.modelTransform) model = config.modelTransform(model);
|
|
3628
3821
|
args.push(config.modelFlag, model);
|
|
3629
3822
|
}
|
|
3630
|
-
|
|
3631
|
-
|
|
3823
|
+
if (defaultArgsPosition === "afterPrompt") {
|
|
3824
|
+
args.push(...config.defaultArgs);
|
|
3825
|
+
}
|
|
3826
|
+
if (mcpArgsPosition === "afterCommand") {
|
|
3632
3827
|
args.push(...mcpArgs);
|
|
3633
3828
|
}
|
|
3634
|
-
|
|
3829
|
+
const mode = resolveModeConfig(config.modes[options.mode ?? "yolo"]);
|
|
3830
|
+
args.push(...mode.args);
|
|
3635
3831
|
if (options.args && options.args.length > 0) {
|
|
3636
3832
|
args.push(...options.args);
|
|
3637
3833
|
}
|
|
3638
|
-
return args;
|
|
3834
|
+
return { args, env: mode.env };
|
|
3639
3835
|
}
|
|
3640
3836
|
async function spawn3(agentId, options, context) {
|
|
3641
3837
|
if (options.signal?.aborted) {
|
|
@@ -3643,7 +3839,7 @@ async function spawn3(agentId, options, context) {
|
|
|
3643
3839
|
}
|
|
3644
3840
|
const { agentId: resolvedId, binaryName, spawnConfig } = resolveCliConfig(agentId);
|
|
3645
3841
|
const stdinMode = options.useStdin && spawnConfig.stdinMode ? spawnConfig.stdinMode : void 0;
|
|
3646
|
-
const spawnArgs = buildCliArgs(spawnConfig, options, stdinMode);
|
|
3842
|
+
const { args: spawnArgs, env: modeEnv } = buildCliArgs(spawnConfig, options, stdinMode);
|
|
3647
3843
|
if (context?.dryRun) {
|
|
3648
3844
|
const rendered = [binaryName, ...spawnArgs].join(" ");
|
|
3649
3845
|
context.logger?.dryRun(rendered);
|
|
@@ -3651,7 +3847,8 @@ async function spawn3(agentId, options, context) {
|
|
|
3651
3847
|
}
|
|
3652
3848
|
const child = spawnChildProcess(binaryName, spawnArgs, {
|
|
3653
3849
|
cwd: options.cwd,
|
|
3654
|
-
stdio: [stdinMode ? "pipe" : "inherit", "pipe", "pipe"]
|
|
3850
|
+
stdio: [stdinMode ? "pipe" : "inherit", "pipe", "pipe"],
|
|
3851
|
+
...modeEnv ? { env: { ...process.env, ...modeEnv } } : {}
|
|
3655
3852
|
});
|
|
3656
3853
|
if (!child.stdout || !child.stderr) {
|
|
3657
3854
|
throw new Error(`Failed to spawn "${resolvedId}": missing stdio pipes.`);
|
|
@@ -3733,6 +3930,7 @@ var init_spawn = __esm({
|
|
|
3733
3930
|
init_resolve_config();
|
|
3734
3931
|
init_mcp_args();
|
|
3735
3932
|
init_model_utils();
|
|
3933
|
+
init_types2();
|
|
3736
3934
|
}
|
|
3737
3935
|
});
|
|
3738
3936
|
|
|
@@ -3755,6 +3953,9 @@ async function spawnInteractive(agentId, options) {
|
|
|
3755
3953
|
}
|
|
3756
3954
|
const { interactive } = spawnConfig;
|
|
3757
3955
|
const args = [];
|
|
3956
|
+
if (interactive.defaultArgsPosition === "beforePrompt") {
|
|
3957
|
+
args.push(...interactive.defaultArgs);
|
|
3958
|
+
}
|
|
3758
3959
|
if (options.prompt) {
|
|
3759
3960
|
if (interactive.promptFlag) {
|
|
3760
3961
|
args.push(interactive.promptFlag, options.prompt);
|
|
@@ -3767,16 +3968,19 @@ async function spawnInteractive(agentId, options) {
|
|
|
3767
3968
|
if (spawnConfig.modelTransform) model = spawnConfig.modelTransform(model);
|
|
3768
3969
|
args.push(spawnConfig.modelFlag, model);
|
|
3769
3970
|
}
|
|
3770
|
-
|
|
3971
|
+
if (interactive.defaultArgsPosition !== "beforePrompt") {
|
|
3972
|
+
args.push(...interactive.defaultArgs);
|
|
3973
|
+
}
|
|
3771
3974
|
args.push(...getMcpArgs(spawnConfig, options.mcpServers));
|
|
3772
|
-
const
|
|
3773
|
-
args.push(...
|
|
3975
|
+
const modeResolved = resolveModeConfig(spawnConfig.modes[options.mode ?? "yolo"]);
|
|
3976
|
+
args.push(...modeResolved.args);
|
|
3774
3977
|
if (options.args && options.args.length > 0) {
|
|
3775
3978
|
args.push(...options.args);
|
|
3776
3979
|
}
|
|
3777
3980
|
const child = spawnChildProcess2(resolved.binaryName, args, {
|
|
3778
3981
|
cwd: options.cwd,
|
|
3779
|
-
stdio: "inherit"
|
|
3982
|
+
stdio: "inherit",
|
|
3983
|
+
...modeResolved.env ? { env: { ...process.env, ...modeResolved.env } } : {}
|
|
3780
3984
|
});
|
|
3781
3985
|
return new Promise((resolve2, reject) => {
|
|
3782
3986
|
child.on("error", (error2) => {
|
|
@@ -3797,6 +4001,7 @@ var init_spawn_interactive = __esm({
|
|
|
3797
4001
|
init_resolve_config();
|
|
3798
4002
|
init_mcp_args();
|
|
3799
4003
|
init_model_utils();
|
|
4004
|
+
init_types2();
|
|
3800
4005
|
}
|
|
3801
4006
|
});
|
|
3802
4007
|
|
|
@@ -7110,7 +7315,7 @@ var init_block = __esm({
|
|
|
7110
7315
|
});
|
|
7111
7316
|
|
|
7112
7317
|
// packages/design-system/src/terminal-markdown/parser.ts
|
|
7113
|
-
function
|
|
7318
|
+
function parse5(markdown) {
|
|
7114
7319
|
const { frontmatter, children } = parseBlockDocument(markdown);
|
|
7115
7320
|
return {
|
|
7116
7321
|
...frontmatter === void 0 ? {} : { frontmatter },
|
|
@@ -7761,7 +7966,7 @@ var init_renderer = __esm({
|
|
|
7761
7966
|
|
|
7762
7967
|
// packages/design-system/src/terminal-markdown/index.ts
|
|
7763
7968
|
function renderMarkdown(markdown, options) {
|
|
7764
|
-
const { ast } =
|
|
7969
|
+
const { ast } = parse5(markdown);
|
|
7765
7970
|
return render(ast, options);
|
|
7766
7971
|
}
|
|
7767
7972
|
var init_terminal_markdown = __esm({
|
|
@@ -9176,6 +9381,15 @@ function createActivityTimeoutError2(timeoutMs) {
|
|
|
9176
9381
|
function isAcpEvent(value) {
|
|
9177
9382
|
return !!value && typeof value === "object" && "event" in value;
|
|
9178
9383
|
}
|
|
9384
|
+
function getDefaultArgsPosition2(config) {
|
|
9385
|
+
return config.defaultArgsPosition ?? "afterPrompt";
|
|
9386
|
+
}
|
|
9387
|
+
function getMcpArgsPosition2(config) {
|
|
9388
|
+
if (config.mcpArgsPosition) {
|
|
9389
|
+
return config.mcpArgsPosition;
|
|
9390
|
+
}
|
|
9391
|
+
return config.mcpArgsBeforeCommand ? "beforeCommand" : "afterCommand";
|
|
9392
|
+
}
|
|
9179
9393
|
function spawnStreaming(options) {
|
|
9180
9394
|
if (options.signal?.aborted) {
|
|
9181
9395
|
throw createAbortError2();
|
|
@@ -9192,8 +9406,16 @@ function spawnStreaming(options) {
|
|
|
9192
9406
|
}
|
|
9193
9407
|
const mcpArgs = getMcpArgs(spawnConfig, options.mcpServers);
|
|
9194
9408
|
const mcpEnvVars = getMcpEnv(spawnConfig, options.mcpServers);
|
|
9409
|
+
const defaultArgsPosition = getDefaultArgsPosition2(spawnConfig);
|
|
9410
|
+
const mcpArgsPosition = getMcpArgsPosition2(spawnConfig);
|
|
9195
9411
|
const args = [];
|
|
9196
|
-
if (
|
|
9412
|
+
if (mcpArgsPosition === "beforeCommand") {
|
|
9413
|
+
args.push(...mcpArgs);
|
|
9414
|
+
}
|
|
9415
|
+
if (defaultArgsPosition === "beforePrompt") {
|
|
9416
|
+
args.push(...spawnConfig.defaultArgs);
|
|
9417
|
+
}
|
|
9418
|
+
if (mcpArgsPosition === "beforePrompt") {
|
|
9197
9419
|
args.push(...mcpArgs);
|
|
9198
9420
|
}
|
|
9199
9421
|
args.push(spawnConfig.promptFlag);
|
|
@@ -9206,22 +9428,25 @@ function spawnStreaming(options) {
|
|
|
9206
9428
|
if (spawnConfig.modelTransform) model = spawnConfig.modelTransform(model);
|
|
9207
9429
|
args.push(spawnConfig.modelFlag, model);
|
|
9208
9430
|
}
|
|
9209
|
-
|
|
9210
|
-
|
|
9431
|
+
if (defaultArgsPosition === "afterPrompt") {
|
|
9432
|
+
args.push(...spawnConfig.defaultArgs);
|
|
9433
|
+
}
|
|
9434
|
+
if (mcpArgsPosition === "afterCommand") {
|
|
9211
9435
|
args.push(...mcpArgs);
|
|
9212
9436
|
}
|
|
9213
|
-
const
|
|
9214
|
-
args.push(...
|
|
9437
|
+
const modeResolved = resolveModeConfig(spawnConfig.modes[options.mode ?? "yolo"]);
|
|
9438
|
+
args.push(...modeResolved.args);
|
|
9215
9439
|
if (useStdin) {
|
|
9216
9440
|
args.push(...spawnConfig.stdinMode.extraArgs);
|
|
9217
9441
|
}
|
|
9218
9442
|
if (options.args && options.args.length > 0) {
|
|
9219
9443
|
args.push(...options.args);
|
|
9220
9444
|
}
|
|
9445
|
+
const envOverrides = { ...mcpEnvVars, ...modeResolved.env };
|
|
9221
9446
|
const child = spawnChildProcess3(binaryName, args, {
|
|
9222
9447
|
cwd: options.cwd,
|
|
9223
9448
|
stdio: ["pipe", "pipe", "pipe"],
|
|
9224
|
-
env: Object.keys(
|
|
9449
|
+
env: Object.keys(envOverrides).length > 0 ? { ...process.env, ...envOverrides } : void 0
|
|
9225
9450
|
});
|
|
9226
9451
|
let aborted = false;
|
|
9227
9452
|
let timedOut = false;
|
|
@@ -9292,6 +9517,7 @@ var init_spawn2 = __esm({
|
|
|
9292
9517
|
init_resolve_config();
|
|
9293
9518
|
init_mcp_args();
|
|
9294
9519
|
init_model_utils();
|
|
9520
|
+
init_types2();
|
|
9295
9521
|
}
|
|
9296
9522
|
});
|
|
9297
9523
|
|
|
@@ -9315,7 +9541,7 @@ function isAcpError(value) {
|
|
|
9315
9541
|
return value.data === void 0 || Object.prototype.hasOwnProperty.call(value, "data");
|
|
9316
9542
|
}
|
|
9317
9543
|
var ACP_ERROR_CODE_PARSE, ACP_ERROR_CODE_INVALID_REQUEST, ACP_ERROR_CODE_METHOD_NOT_FOUND, ACP_ERROR_CODE_INVALID_PARAMS, ACP_ERROR_CODE_INTERNAL, ACP_ERROR_CODE_RESOURCE_NOT_FOUND, AcpError;
|
|
9318
|
-
var
|
|
9544
|
+
var init_types3 = __esm({
|
|
9319
9545
|
"packages/poe-acp-client/src/types.ts"() {
|
|
9320
9546
|
"use strict";
|
|
9321
9547
|
ACP_ERROR_CODE_PARSE = -32700;
|
|
@@ -9558,24 +9784,19 @@ var JsonRpcMessageLayer;
|
|
|
9558
9784
|
var init_jsonrpc_message_layer = __esm({
|
|
9559
9785
|
"packages/poe-acp-client/src/jsonrpc-message-layer.ts"() {
|
|
9560
9786
|
"use strict";
|
|
9561
|
-
|
|
9787
|
+
init_types3();
|
|
9562
9788
|
JsonRpcMessageLayer = class {
|
|
9563
9789
|
input;
|
|
9564
9790
|
output;
|
|
9565
9791
|
requestHandlers = /* @__PURE__ */ new Map();
|
|
9566
9792
|
notificationHandlers = /* @__PURE__ */ new Map();
|
|
9567
9793
|
pending = /* @__PURE__ */ new Map();
|
|
9568
|
-
defaultTimeoutMs;
|
|
9569
9794
|
nextRequestId;
|
|
9570
9795
|
disposed = false;
|
|
9571
9796
|
constructor(options) {
|
|
9572
9797
|
this.input = options.input;
|
|
9573
9798
|
this.output = options.output;
|
|
9574
|
-
this.defaultTimeoutMs = options.requestTimeoutMs ?? 3e4;
|
|
9575
9799
|
this.nextRequestId = options.firstRequestId ?? 1;
|
|
9576
|
-
if (!Number.isFinite(this.defaultTimeoutMs) || this.defaultTimeoutMs < 0) {
|
|
9577
|
-
throw new Error("requestTimeoutMs must be a non-negative finite number");
|
|
9578
|
-
}
|
|
9579
9800
|
if (!Number.isFinite(this.nextRequestId)) {
|
|
9580
9801
|
throw new Error("firstRequestId must be a finite number");
|
|
9581
9802
|
}
|
|
@@ -9608,10 +9829,6 @@ var init_jsonrpc_message_layer = __esm({
|
|
|
9608
9829
|
if (this.pending.has(id)) {
|
|
9609
9830
|
throw new Error(`A request with id ${JSON.stringify(id)} is already pending`);
|
|
9610
9831
|
}
|
|
9611
|
-
const timeoutMs = options.timeoutMs ?? this.defaultTimeoutMs;
|
|
9612
|
-
if (!Number.isFinite(timeoutMs) || timeoutMs < 0) {
|
|
9613
|
-
throw new Error("timeoutMs must be a non-negative finite number");
|
|
9614
|
-
}
|
|
9615
9832
|
const request = {
|
|
9616
9833
|
jsonrpc: "2.0",
|
|
9617
9834
|
id,
|
|
@@ -9621,22 +9838,14 @@ var init_jsonrpc_message_layer = __esm({
|
|
|
9621
9838
|
request.params = params;
|
|
9622
9839
|
}
|
|
9623
9840
|
return new Promise((resolve2, reject) => {
|
|
9624
|
-
const timeout = setTimeout(() => {
|
|
9625
|
-
this.pending.delete(id);
|
|
9626
|
-
reject(
|
|
9627
|
-
new Error(`JSON-RPC request "${method}" timed out after ${timeoutMs}ms`)
|
|
9628
|
-
);
|
|
9629
|
-
}, timeoutMs);
|
|
9630
9841
|
this.pending.set(id, {
|
|
9631
9842
|
method,
|
|
9632
9843
|
resolve: resolve2,
|
|
9633
|
-
reject
|
|
9634
|
-
timeout
|
|
9844
|
+
reject
|
|
9635
9845
|
});
|
|
9636
9846
|
try {
|
|
9637
9847
|
this.sendMessage(request);
|
|
9638
9848
|
} catch (error2) {
|
|
9639
|
-
clearTimeout(timeout);
|
|
9640
9849
|
this.pending.delete(id);
|
|
9641
9850
|
reject(error2);
|
|
9642
9851
|
}
|
|
@@ -9690,9 +9899,6 @@ var init_jsonrpc_message_layer = __esm({
|
|
|
9690
9899
|
return;
|
|
9691
9900
|
}
|
|
9692
9901
|
this.pending.delete(message2.id);
|
|
9693
|
-
if (pending.timeout !== null) {
|
|
9694
|
-
clearTimeout(pending.timeout);
|
|
9695
|
-
}
|
|
9696
9902
|
if ("error" in message2) {
|
|
9697
9903
|
pending.reject(toResponseError(message2.error));
|
|
9698
9904
|
return;
|
|
@@ -9733,9 +9939,6 @@ var init_jsonrpc_message_layer = __esm({
|
|
|
9733
9939
|
}
|
|
9734
9940
|
rejectAllPending(error2) {
|
|
9735
9941
|
for (const pending of this.pending.values()) {
|
|
9736
|
-
if (pending.timeout !== null) {
|
|
9737
|
-
clearTimeout(pending.timeout);
|
|
9738
|
-
}
|
|
9739
9942
|
pending.reject(error2);
|
|
9740
9943
|
}
|
|
9741
9944
|
this.pending.clear();
|
|
@@ -9773,7 +9976,6 @@ var init_acp_transport = __esm({
|
|
|
9773
9976
|
args = [],
|
|
9774
9977
|
cwd,
|
|
9775
9978
|
env,
|
|
9776
|
-
requestTimeoutMs,
|
|
9777
9979
|
firstRequestId,
|
|
9778
9980
|
spawn: spawn9 = spawnChildProcess4
|
|
9779
9981
|
} = options;
|
|
@@ -9797,7 +9999,6 @@ var init_acp_transport = __esm({
|
|
|
9797
9999
|
this.layer = new JsonRpcMessageLayer({
|
|
9798
10000
|
input: this.child.stdout,
|
|
9799
10001
|
output: this.child.stdin,
|
|
9800
|
-
requestTimeoutMs,
|
|
9801
10002
|
firstRequestId
|
|
9802
10003
|
});
|
|
9803
10004
|
this.child.once("error", (error2) => {
|
|
@@ -9994,7 +10195,7 @@ var init_acp_client = __esm({
|
|
|
9994
10195
|
"packages/poe-acp-client/src/acp-client.ts"() {
|
|
9995
10196
|
"use strict";
|
|
9996
10197
|
init_acp_transport();
|
|
9997
|
-
|
|
10198
|
+
init_types3();
|
|
9998
10199
|
AcpClient = class {
|
|
9999
10200
|
transport;
|
|
10000
10201
|
clientProtocolVersion;
|
|
@@ -10021,7 +10222,6 @@ var init_acp_client = __esm({
|
|
|
10021
10222
|
args: options.args,
|
|
10022
10223
|
cwd: options.cwd,
|
|
10023
10224
|
env: options.env,
|
|
10024
|
-
requestTimeoutMs: options.requestTimeoutMs,
|
|
10025
10225
|
firstRequestId: options.firstRequestId,
|
|
10026
10226
|
spawn: options.spawn
|
|
10027
10227
|
});
|
|
@@ -10646,7 +10846,7 @@ var init_src7 = __esm({
|
|
|
10646
10846
|
"use strict";
|
|
10647
10847
|
init_acp_client();
|
|
10648
10848
|
init_acp_transport();
|
|
10649
|
-
|
|
10849
|
+
init_types3();
|
|
10650
10850
|
init_jsonrpc_message_layer();
|
|
10651
10851
|
init_jsonrpc();
|
|
10652
10852
|
init_run_report();
|
|
@@ -10800,7 +11000,6 @@ function spawnAcp(options) {
|
|
|
10800
11000
|
args: acpConfig.acpArgs,
|
|
10801
11001
|
cwd: options.cwd ?? process.cwd(),
|
|
10802
11002
|
env,
|
|
10803
|
-
requestTimeoutMs: 3e5,
|
|
10804
11003
|
skipAuth: acpConfig.skipAuth ?? false,
|
|
10805
11004
|
autoApprove: (options.mode ?? "yolo") === "yolo"
|
|
10806
11005
|
});
|
|
@@ -11238,6 +11437,7 @@ var init_src8 = __esm({
|
|
|
11238
11437
|
"packages/agent-spawn/src/index.ts"() {
|
|
11239
11438
|
"use strict";
|
|
11240
11439
|
init_run_command();
|
|
11440
|
+
init_types2();
|
|
11241
11441
|
init_configs();
|
|
11242
11442
|
init_mcp();
|
|
11243
11443
|
init_spawn();
|
|
@@ -13144,6 +13344,16 @@ async function createConfigurePayload(init) {
|
|
|
13144
13344
|
});
|
|
13145
13345
|
payload.reasoningEffort = reasoningEffort;
|
|
13146
13346
|
}
|
|
13347
|
+
const extension = await adapter.extendConfigurePayload?.({
|
|
13348
|
+
fs: container.fs,
|
|
13349
|
+
env: context.env,
|
|
13350
|
+
httpClient: container.httpClient,
|
|
13351
|
+
logger: logger2,
|
|
13352
|
+
payload
|
|
13353
|
+
});
|
|
13354
|
+
if (extension) {
|
|
13355
|
+
Object.assign(payload, extension);
|
|
13356
|
+
}
|
|
13147
13357
|
return payload;
|
|
13148
13358
|
}
|
|
13149
13359
|
var init_configure_payload = __esm({
|
|
@@ -13812,7 +14022,7 @@ var init_utils2 = __esm({
|
|
|
13812
14022
|
|
|
13813
14023
|
// packages/pipeline/src/config/loader.ts
|
|
13814
14024
|
import path18 from "node:path";
|
|
13815
|
-
import { parse as
|
|
14025
|
+
import { parse as parse6, stringify } from "yaml";
|
|
13816
14026
|
function asStepMode(value) {
|
|
13817
14027
|
if (value === void 0 || value === null) {
|
|
13818
14028
|
return "yolo";
|
|
@@ -13824,7 +14034,7 @@ function asStepMode(value) {
|
|
|
13824
14034
|
}
|
|
13825
14035
|
function parseYamlDocument(filePath, content) {
|
|
13826
14036
|
try {
|
|
13827
|
-
return
|
|
14037
|
+
return parse6(content);
|
|
13828
14038
|
} catch (error2) {
|
|
13829
14039
|
const message2 = error2 instanceof Error ? error2.message : String(error2);
|
|
13830
14040
|
throw new Error(`Invalid pipeline step config YAML in "${filePath}": ${message2}`);
|
|
@@ -14035,7 +14245,7 @@ var init_loader = __esm({
|
|
|
14035
14245
|
});
|
|
14036
14246
|
|
|
14037
14247
|
// packages/pipeline/src/plan/parser.ts
|
|
14038
|
-
import { parse as
|
|
14248
|
+
import { parse as parse7 } from "yaml";
|
|
14039
14249
|
function asRequiredString(value, field) {
|
|
14040
14250
|
if (typeof value === "string" && value.length > 0) {
|
|
14041
14251
|
return value;
|
|
@@ -14119,7 +14329,7 @@ function parseMcpConfig(value) {
|
|
|
14119
14329
|
function parsePlan(yamlContent, options = {}) {
|
|
14120
14330
|
let document;
|
|
14121
14331
|
try {
|
|
14122
|
-
document =
|
|
14332
|
+
document = parse7(yamlContent);
|
|
14123
14333
|
} catch (error2) {
|
|
14124
14334
|
const message2 = error2 instanceof Error ? error2.message : String(error2);
|
|
14125
14335
|
throw new Error(`Invalid plan YAML: ${message2}`);
|
|
@@ -17073,7 +17283,7 @@ var init_src14 = __esm({
|
|
|
17073
17283
|
});
|
|
17074
17284
|
|
|
17075
17285
|
// packages/ralph/src/frontmatter/frontmatter.ts
|
|
17076
|
-
import { parse as
|
|
17286
|
+
import { parse as parse8, stringify as stringify2 } from "yaml";
|
|
17077
17287
|
function parseFrontmatter(content) {
|
|
17078
17288
|
if (!content.startsWith(`${FENCE}
|
|
17079
17289
|
`)) {
|
|
@@ -17093,7 +17303,7 @@ ${FENCE}
|
|
|
17093
17303
|
}
|
|
17094
17304
|
const yamlBlock = content.slice(FENCE.length + 1, closingIndex);
|
|
17095
17305
|
const body = content.slice(closingIndex + FENCE.length + 2);
|
|
17096
|
-
const parsed =
|
|
17306
|
+
const parsed = parse8(yamlBlock);
|
|
17097
17307
|
return {
|
|
17098
17308
|
data: parseFrontmatterData(parsed),
|
|
17099
17309
|
body
|
|
@@ -17709,7 +17919,7 @@ var init_ralph2 = __esm({
|
|
|
17709
17919
|
});
|
|
17710
17920
|
|
|
17711
17921
|
// packages/experiment-loop/src/types.ts
|
|
17712
|
-
var
|
|
17922
|
+
var init_types4 = __esm({
|
|
17713
17923
|
"packages/experiment-loop/src/types.ts"() {
|
|
17714
17924
|
"use strict";
|
|
17715
17925
|
}
|
|
@@ -18019,7 +18229,7 @@ var init_git = __esm({
|
|
|
18019
18229
|
import path30 from "node:path";
|
|
18020
18230
|
import { readFile as readFile5 } from "node:fs/promises";
|
|
18021
18231
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
18022
|
-
import { parse as
|
|
18232
|
+
import { parse as parse9 } from "yaml";
|
|
18023
18233
|
function isRecord8(value) {
|
|
18024
18234
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
18025
18235
|
}
|
|
@@ -18035,7 +18245,7 @@ async function readOptionalFile2(fs3, filePath) {
|
|
|
18035
18245
|
}
|
|
18036
18246
|
function parseRunConfigYaml(filePath, content) {
|
|
18037
18247
|
try {
|
|
18038
|
-
return
|
|
18248
|
+
return parse9(content);
|
|
18039
18249
|
} catch (error2) {
|
|
18040
18250
|
const message2 = error2 instanceof Error ? error2.message : String(error2);
|
|
18041
18251
|
throw new Error(`Invalid experiment run config YAML in "${filePath}": ${message2}`);
|
|
@@ -18566,7 +18776,7 @@ var init_loop = __esm({
|
|
|
18566
18776
|
var init_src16 = __esm({
|
|
18567
18777
|
"packages/experiment-loop/src/index.ts"() {
|
|
18568
18778
|
"use strict";
|
|
18569
|
-
|
|
18779
|
+
init_types4();
|
|
18570
18780
|
init_frontmatter3();
|
|
18571
18781
|
init_journal();
|
|
18572
18782
|
init_evaluator();
|
|
@@ -18808,7 +19018,7 @@ var init_client_instance = __esm({
|
|
|
18808
19018
|
});
|
|
18809
19019
|
|
|
18810
19020
|
// packages/github-workflows/src/frontmatter.ts
|
|
18811
|
-
import { parse as
|
|
19021
|
+
import { parse as parse10 } from "yaml";
|
|
18812
19022
|
var init_frontmatter4 = __esm({
|
|
18813
19023
|
"packages/github-workflows/src/frontmatter.ts"() {
|
|
18814
19024
|
"use strict";
|
|
@@ -20939,30 +21149,30 @@ var init_service_install = __esm({
|
|
|
20939
21149
|
}
|
|
20940
21150
|
});
|
|
20941
21151
|
|
|
20942
|
-
// src/templates/py-poe-spawn/env.
|
|
21152
|
+
// src/templates/py-poe-spawn/env.mustache
|
|
20943
21153
|
var require_env = __commonJS({
|
|
20944
|
-
"src/templates/py-poe-spawn/env.
|
|
21154
|
+
"src/templates/py-poe-spawn/env.mustache"(exports, module) {
|
|
20945
21155
|
module.exports = "POE_API_KEY={{apiKey}}\nPOE_BASE_URL=https://api.poe.com/v1\nMODEL={{model}}\n";
|
|
20946
21156
|
}
|
|
20947
21157
|
});
|
|
20948
21158
|
|
|
20949
|
-
// src/templates/py-poe-spawn/main.py.
|
|
21159
|
+
// src/templates/py-poe-spawn/main.py.mustache
|
|
20950
21160
|
var require_main_py = __commonJS({
|
|
20951
|
-
"src/templates/py-poe-spawn/main.py.
|
|
21161
|
+
"src/templates/py-poe-spawn/main.py.mustache"(exports, module) {
|
|
20952
21162
|
module.exports = 'import os\nfrom openai import OpenAI\nfrom dotenv import load_dotenv\n\nload_dotenv()\n\nclient = OpenAI(\n api_key=os.getenv("POE_API_KEY"),\n base_url=os.getenv("POE_BASE_URL")\n)\n\nresponse = client.chat.completions.create(\n model=os.getenv("MODEL", "{{model}}"),\n messages=[{"role": "user", "content": "Tell me a joke"}]\n)\n\nprint(response.choices[0].message.content)\n';
|
|
20953
21163
|
}
|
|
20954
21164
|
});
|
|
20955
21165
|
|
|
20956
|
-
// src/templates/py-poe-spawn/requirements.txt.
|
|
21166
|
+
// src/templates/py-poe-spawn/requirements.txt.mustache
|
|
20957
21167
|
var require_requirements_txt = __commonJS({
|
|
20958
|
-
"src/templates/py-poe-spawn/requirements.txt.
|
|
21168
|
+
"src/templates/py-poe-spawn/requirements.txt.mustache"(exports, module) {
|
|
20959
21169
|
module.exports = "openai>=1.0.0\npython-dotenv>=1.0.0\n";
|
|
20960
21170
|
}
|
|
20961
21171
|
});
|
|
20962
21172
|
|
|
20963
|
-
// src/templates/codex/config.toml.
|
|
21173
|
+
// src/templates/codex/config.toml.mustache
|
|
20964
21174
|
var require_config_toml = __commonJS({
|
|
20965
|
-
"src/templates/codex/config.toml.
|
|
21175
|
+
"src/templates/codex/config.toml.mustache"(exports, module) {
|
|
20966
21176
|
module.exports = 'model_provider = "poe"\n\n[profiles."{{{profileName}}}"]\nmodel = "{{{model}}}"\nmodel_provider = "poe"\nmodel_reasoning_effort = "{{reasoningEffort}}"\nmodel_verbosity = "medium"\n\n[model_providers.poe]\nname = "poe"\nbase_url = "{{{baseUrl}}}"\nwire_api = "responses"\nexperimental_bearer_token = "{{apiKey}}"\nrequires_openai_auth = false\nsupports_websockets = false\n';
|
|
20967
21177
|
}
|
|
20968
21178
|
});
|
|
@@ -20989,6 +21199,7 @@ function createProvider(opts) {
|
|
|
20989
21199
|
supportsMcpSpawn: opts.supportsMcpSpawn,
|
|
20990
21200
|
configurePrompts: opts.configurePrompts,
|
|
20991
21201
|
postConfigureMessages: opts.postConfigureMessages,
|
|
21202
|
+
extendConfigurePayload: opts.extendConfigurePayload,
|
|
20992
21203
|
isolatedEnv: opts.isolatedEnv,
|
|
20993
21204
|
async configure(context, runOptions) {
|
|
20994
21205
|
await runMutations(opts.manifest.configure, {
|
|
@@ -21043,10 +21254,10 @@ var init_create_provider = __esm({
|
|
|
21043
21254
|
init_src4();
|
|
21044
21255
|
init_service_install();
|
|
21045
21256
|
templateImports = {
|
|
21046
|
-
"py-poe-spawn/env.
|
|
21047
|
-
"py-poe-spawn/main.py.
|
|
21048
|
-
"py-poe-spawn/requirements.txt.
|
|
21049
|
-
"codex/config.toml.
|
|
21257
|
+
"py-poe-spawn/env.mustache": () => Promise.resolve().then(() => __toESM(require_env(), 1)),
|
|
21258
|
+
"py-poe-spawn/main.py.mustache": () => Promise.resolve().then(() => __toESM(require_main_py(), 1)),
|
|
21259
|
+
"py-poe-spawn/requirements.txt.mustache": () => Promise.resolve().then(() => __toESM(require_requirements_txt(), 1)),
|
|
21260
|
+
"codex/config.toml.mustache": () => Promise.resolve().then(() => __toESM(require_config_toml(), 1))
|
|
21050
21261
|
};
|
|
21051
21262
|
}
|
|
21052
21263
|
});
|
|
@@ -27708,6 +27919,10 @@ function assertSpawnSupport(label, service, providerSupportsSpawn) {
|
|
|
27708
27919
|
throw new ValidationError(`${label} does not support spawn.`);
|
|
27709
27920
|
}
|
|
27710
27921
|
function assertInteractiveSupport(label, service) {
|
|
27922
|
+
const spawnConfig = getSpawnConfig(service);
|
|
27923
|
+
if (spawnConfig?.kind === "cli" && spawnConfig.interactive) {
|
|
27924
|
+
return;
|
|
27925
|
+
}
|
|
27711
27926
|
if (resolveAgentId(service)) {
|
|
27712
27927
|
return;
|
|
27713
27928
|
}
|
|
@@ -28851,7 +29066,7 @@ var init_generate = __esm({
|
|
|
28851
29066
|
|
|
28852
29067
|
// packages/tiny-stdio-mcp-server/src/types.ts
|
|
28853
29068
|
var JSON_RPC_ERROR_CODES, ToolError;
|
|
28854
|
-
var
|
|
29069
|
+
var init_types5 = __esm({
|
|
28855
29070
|
"packages/tiny-stdio-mcp-server/src/types.ts"() {
|
|
28856
29071
|
"use strict";
|
|
28857
29072
|
JSON_RPC_ERROR_CODES = {
|
|
@@ -28970,7 +29185,7 @@ function formatErrorResponse(id, error2) {
|
|
|
28970
29185
|
var init_jsonrpc2 = __esm({
|
|
28971
29186
|
"packages/tiny-stdio-mcp-server/src/jsonrpc.ts"() {
|
|
28972
29187
|
"use strict";
|
|
28973
|
-
|
|
29188
|
+
init_types5();
|
|
28974
29189
|
}
|
|
28975
29190
|
});
|
|
28976
29191
|
|
|
@@ -29530,7 +29745,7 @@ var PROTOCOL_VERSION;
|
|
|
29530
29745
|
var init_server = __esm({
|
|
29531
29746
|
"packages/tiny-stdio-mcp-server/src/server.ts"() {
|
|
29532
29747
|
"use strict";
|
|
29533
|
-
|
|
29748
|
+
init_types5();
|
|
29534
29749
|
init_jsonrpc2();
|
|
29535
29750
|
init_convert();
|
|
29536
29751
|
PROTOCOL_VERSION = "2025-11-25";
|
|
@@ -29581,7 +29796,7 @@ var init_src22 = __esm({
|
|
|
29581
29796
|
init_server();
|
|
29582
29797
|
init_schema2();
|
|
29583
29798
|
init_content();
|
|
29584
|
-
|
|
29799
|
+
init_types5();
|
|
29585
29800
|
}
|
|
29586
29801
|
});
|
|
29587
29802
|
|
|
@@ -30090,6 +30305,12 @@ var init_configs2 = __esm({
|
|
|
30090
30305
|
configKey: "mcpServers",
|
|
30091
30306
|
format: "json",
|
|
30092
30307
|
shape: "standard"
|
|
30308
|
+
},
|
|
30309
|
+
goose: {
|
|
30310
|
+
configFile: "~/.config/goose/config.yaml",
|
|
30311
|
+
configKey: "extensions",
|
|
30312
|
+
format: "yaml",
|
|
30313
|
+
shape: "goose"
|
|
30093
30314
|
}
|
|
30094
30315
|
};
|
|
30095
30316
|
supportedAgents = Object.keys(agentMcpConfigs);
|
|
@@ -30147,6 +30368,33 @@ function opencodeShape(entry) {
|
|
|
30147
30368
|
enabled
|
|
30148
30369
|
};
|
|
30149
30370
|
}
|
|
30371
|
+
function gooseShape(entry) {
|
|
30372
|
+
const enabled = entry.enabled !== false;
|
|
30373
|
+
if (!enabled) {
|
|
30374
|
+
return void 0;
|
|
30375
|
+
}
|
|
30376
|
+
if (entry.config.transport === "stdio") {
|
|
30377
|
+
const result2 = {
|
|
30378
|
+
type: "stdio",
|
|
30379
|
+
cmd: entry.config.command
|
|
30380
|
+
};
|
|
30381
|
+
if (entry.config.args && entry.config.args.length > 0) {
|
|
30382
|
+
result2.args = entry.config.args;
|
|
30383
|
+
}
|
|
30384
|
+
if (entry.config.env && Object.keys(entry.config.env).length > 0) {
|
|
30385
|
+
result2.envs = entry.config.env;
|
|
30386
|
+
}
|
|
30387
|
+
return result2;
|
|
30388
|
+
}
|
|
30389
|
+
const result = {
|
|
30390
|
+
type: "http",
|
|
30391
|
+
url: entry.config.url
|
|
30392
|
+
};
|
|
30393
|
+
if (entry.config.headers && Object.keys(entry.config.headers).length > 0) {
|
|
30394
|
+
result.headers = entry.config.headers;
|
|
30395
|
+
}
|
|
30396
|
+
return result;
|
|
30397
|
+
}
|
|
30150
30398
|
function getShapeTransformer(shape) {
|
|
30151
30399
|
return shapeTransformers[shape];
|
|
30152
30400
|
}
|
|
@@ -30156,26 +30404,94 @@ var init_shapes = __esm({
|
|
|
30156
30404
|
"use strict";
|
|
30157
30405
|
shapeTransformers = {
|
|
30158
30406
|
standard: standardShape,
|
|
30159
|
-
opencode: opencodeShape
|
|
30407
|
+
opencode: opencodeShape,
|
|
30408
|
+
goose: gooseShape
|
|
30160
30409
|
};
|
|
30161
30410
|
}
|
|
30162
30411
|
});
|
|
30163
30412
|
|
|
30164
30413
|
// packages/agent-mcp-config/src/apply.ts
|
|
30165
30414
|
import path44 from "node:path";
|
|
30415
|
+
import { parse as parseYaml3, stringify as stringifyYaml2 } from "yaml";
|
|
30166
30416
|
function getConfigDirectory(configPath) {
|
|
30167
30417
|
return path44.dirname(configPath);
|
|
30168
30418
|
}
|
|
30169
|
-
function
|
|
30419
|
+
function isConfigObject6(value) {
|
|
30170
30420
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
30171
30421
|
}
|
|
30172
30422
|
function resolveServerMap(document, configKey) {
|
|
30173
30423
|
const value = document[configKey];
|
|
30174
|
-
return
|
|
30424
|
+
return isConfigObject6(value) ? value : {};
|
|
30175
30425
|
}
|
|
30176
30426
|
function mergeServerMap(document, configKey, servers) {
|
|
30177
30427
|
return { ...document, [configKey]: servers };
|
|
30178
30428
|
}
|
|
30429
|
+
function expandHomePath(configPath, homeDir) {
|
|
30430
|
+
if (!configPath.startsWith("~")) {
|
|
30431
|
+
return configPath;
|
|
30432
|
+
}
|
|
30433
|
+
if (configPath === "~") {
|
|
30434
|
+
return homeDir;
|
|
30435
|
+
}
|
|
30436
|
+
if (configPath.startsWith("~/")) {
|
|
30437
|
+
return path44.join(homeDir, configPath.slice(2));
|
|
30438
|
+
}
|
|
30439
|
+
return path44.join(homeDir, configPath.slice(1));
|
|
30440
|
+
}
|
|
30441
|
+
function parseYamlDocument2(content) {
|
|
30442
|
+
if (content.trim() === "") {
|
|
30443
|
+
return {};
|
|
30444
|
+
}
|
|
30445
|
+
const parsed = parseYaml3(content);
|
|
30446
|
+
if (parsed === null || parsed === void 0) {
|
|
30447
|
+
return {};
|
|
30448
|
+
}
|
|
30449
|
+
if (!isConfigObject6(parsed)) {
|
|
30450
|
+
throw new Error("Expected YAML document to be an object.");
|
|
30451
|
+
}
|
|
30452
|
+
return parsed;
|
|
30453
|
+
}
|
|
30454
|
+
function serializeYamlDocument(document) {
|
|
30455
|
+
const serialized = stringifyYaml2(document);
|
|
30456
|
+
return serialized.endsWith("\n") ? serialized : `${serialized}
|
|
30457
|
+
`;
|
|
30458
|
+
}
|
|
30459
|
+
async function readYamlConfig(configPath, options) {
|
|
30460
|
+
const absolutePath = expandHomePath(configPath, options.homeDir);
|
|
30461
|
+
const existingContent = await readFileIfExists(options.fs, absolutePath);
|
|
30462
|
+
if (existingContent === null) {
|
|
30463
|
+
return {};
|
|
30464
|
+
}
|
|
30465
|
+
return parseYamlDocument2(existingContent);
|
|
30466
|
+
}
|
|
30467
|
+
async function writeYamlConfig(configPath, document, options) {
|
|
30468
|
+
if (options.dryRun) {
|
|
30469
|
+
return;
|
|
30470
|
+
}
|
|
30471
|
+
const absolutePath = expandHomePath(configPath, options.homeDir);
|
|
30472
|
+
const configDir = path44.dirname(absolutePath);
|
|
30473
|
+
await options.fs.mkdir(configDir, { recursive: true });
|
|
30474
|
+
await options.fs.writeFile(absolutePath, serializeYamlDocument(document), {
|
|
30475
|
+
encoding: "utf8"
|
|
30476
|
+
});
|
|
30477
|
+
}
|
|
30478
|
+
function removeServer(document, configKey, serverName) {
|
|
30479
|
+
const servers = resolveServerMap(document, configKey);
|
|
30480
|
+
if (!(serverName in servers)) {
|
|
30481
|
+
return { changed: false, content: document };
|
|
30482
|
+
}
|
|
30483
|
+
const nextServers = { ...servers };
|
|
30484
|
+
delete nextServers[serverName];
|
|
30485
|
+
if (Object.keys(nextServers).length === 0) {
|
|
30486
|
+
const nextDocument = { ...document };
|
|
30487
|
+
delete nextDocument[configKey];
|
|
30488
|
+
return { changed: true, content: nextDocument };
|
|
30489
|
+
}
|
|
30490
|
+
return {
|
|
30491
|
+
changed: true,
|
|
30492
|
+
content: mergeServerMap(document, configKey, nextServers)
|
|
30493
|
+
};
|
|
30494
|
+
}
|
|
30179
30495
|
async function configure(agentId, server, options) {
|
|
30180
30496
|
if (!isSupported(agentId)) {
|
|
30181
30497
|
throw new UnsupportedAgentError(agentId);
|
|
@@ -30188,6 +30504,16 @@ async function configure(agentId, server, options) {
|
|
|
30188
30504
|
await unconfigure(agentId, server.name, options);
|
|
30189
30505
|
return;
|
|
30190
30506
|
}
|
|
30507
|
+
if (config.format === "yaml") {
|
|
30508
|
+
const document = await readYamlConfig(configPath, options);
|
|
30509
|
+
const servers = resolveServerMap(document, config.configKey);
|
|
30510
|
+
const nextDocument = mergeServerMap(document, config.configKey, {
|
|
30511
|
+
...servers,
|
|
30512
|
+
[server.name]: shaped
|
|
30513
|
+
});
|
|
30514
|
+
await writeYamlConfig(configPath, nextDocument, options);
|
|
30515
|
+
return;
|
|
30516
|
+
}
|
|
30191
30517
|
const configDir = getConfigDirectory(configPath);
|
|
30192
30518
|
await runMutations(
|
|
30193
30519
|
[
|
|
@@ -30228,6 +30554,19 @@ async function unconfigure(agentId, serverName, options) {
|
|
|
30228
30554
|
}
|
|
30229
30555
|
const config = getAgentConfig(agentId);
|
|
30230
30556
|
const configPath = resolveConfigPath2(config, options.platform);
|
|
30557
|
+
if (config.format === "yaml") {
|
|
30558
|
+
const document = await readYamlConfig(configPath, options);
|
|
30559
|
+
const { changed, content } = removeServer(
|
|
30560
|
+
document,
|
|
30561
|
+
config.configKey,
|
|
30562
|
+
serverName
|
|
30563
|
+
);
|
|
30564
|
+
if (!changed) {
|
|
30565
|
+
return;
|
|
30566
|
+
}
|
|
30567
|
+
await writeYamlConfig(configPath, content, options);
|
|
30568
|
+
return;
|
|
30569
|
+
}
|
|
30231
30570
|
await runMutations(
|
|
30232
30571
|
[
|
|
30233
30572
|
configMutation.prune({
|
|
@@ -30483,6 +30822,10 @@ var init_configs3 = __esm({
|
|
|
30483
30822
|
opencode: {
|
|
30484
30823
|
globalSkillDir: "~/.config/opencode/skills",
|
|
30485
30824
|
localSkillDir: ".opencode/skills"
|
|
30825
|
+
},
|
|
30826
|
+
goose: {
|
|
30827
|
+
globalSkillDir: "~/.agents/skills",
|
|
30828
|
+
localSkillDir: ".agents/skills"
|
|
30486
30829
|
}
|
|
30487
30830
|
};
|
|
30488
30831
|
supportedAgents2 = Object.keys(agentSkillConfigs);
|
|
@@ -31618,7 +31961,7 @@ async function loadPipelineTemplates() {
|
|
|
31618
31961
|
}
|
|
31619
31962
|
const [skillPlan, steps] = await Promise.all([
|
|
31620
31963
|
readFile13(path46.join(templateRoot, "SKILL_plan.md"), "utf8"),
|
|
31621
|
-
readFile13(path46.join(templateRoot, "steps.yaml.
|
|
31964
|
+
readFile13(path46.join(templateRoot, "steps.yaml.mustache"), "utf8")
|
|
31622
31965
|
]);
|
|
31623
31966
|
pipelineTemplatesCache = { skillPlan, steps };
|
|
31624
31967
|
return pipelineTemplatesCache;
|
|
@@ -33319,7 +33662,7 @@ async function loadExperimentTemplates() {
|
|
|
33319
33662
|
}
|
|
33320
33663
|
const [skillPlan, runYaml] = await Promise.all([
|
|
33321
33664
|
readFile15(path53.join(templateRoot, "SKILL_experiment.md"), "utf8"),
|
|
33322
|
-
readFile15(path53.join(templateRoot, "run.yaml.
|
|
33665
|
+
readFile15(path53.join(templateRoot, "run.yaml.mustache"), "utf8")
|
|
33323
33666
|
]);
|
|
33324
33667
|
experimentTemplatesCache = { skillPlan, runYaml };
|
|
33325
33668
|
return experimentTemplatesCache;
|
|
@@ -34288,7 +34631,7 @@ var init_package = __esm({
|
|
|
34288
34631
|
"package.json"() {
|
|
34289
34632
|
package_default = {
|
|
34290
34633
|
name: "poe-code",
|
|
34291
|
-
version: "3.0.
|
|
34634
|
+
version: "3.0.171",
|
|
34292
34635
|
description: "CLI tool to configure Poe API for developer workflows.",
|
|
34293
34636
|
type: "module",
|
|
34294
34637
|
main: "./dist/index.js",
|
|
@@ -34325,7 +34668,7 @@ var init_package = __esm({
|
|
|
34325
34668
|
"codegen:check:python-types": "tsx scripts/generate-agent-spawn-py-types.ts --check",
|
|
34326
34669
|
"install:py-poe-spawn": "pip install -e packages/py-poe-spawn",
|
|
34327
34670
|
predev: "turbo run build --output-logs=none --log-prefix=none --verbosity=0 > /dev/null 2>&1",
|
|
34328
|
-
dev: "tsx --import ./scripts/register-
|
|
34671
|
+
dev: "tsx --import ./scripts/register-template-loader.mjs src/index.ts",
|
|
34329
34672
|
start: "node dist/bin.cjs",
|
|
34330
34673
|
"dev:bundle": "npm run build && node dist/bin.cjs",
|
|
34331
34674
|
test: "turbo run test:unit",
|