poe-code 3.0.169 → 3.0.170

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/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 isConfigObject3(value) {
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 (isConfigObject3(current) && isConfigObject3(value)) {
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 (config.mcpArgsBeforeCommand) {
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
- args.push(...config.defaultArgs);
3631
- if (!config.mcpArgsBeforeCommand) {
3823
+ if (defaultArgsPosition === "afterPrompt") {
3824
+ args.push(...config.defaultArgs);
3825
+ }
3826
+ if (mcpArgsPosition === "afterCommand") {
3632
3827
  args.push(...mcpArgs);
3633
3828
  }
3634
- args.push(...config.modes[options.mode ?? "yolo"]);
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
- args.push(...interactive.defaultArgs);
3971
+ if (interactive.defaultArgsPosition !== "beforePrompt") {
3972
+ args.push(...interactive.defaultArgs);
3973
+ }
3771
3974
  args.push(...getMcpArgs(spawnConfig, options.mcpServers));
3772
- const mode = options.mode ?? "yolo";
3773
- args.push(...spawnConfig.modes[mode]);
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 parse4(markdown) {
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 } = parse4(markdown);
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 (spawnConfig.mcpArgsBeforeCommand) {
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
- args.push(...spawnConfig.defaultArgs);
9210
- if (!spawnConfig.mcpArgsBeforeCommand) {
9431
+ if (defaultArgsPosition === "afterPrompt") {
9432
+ args.push(...spawnConfig.defaultArgs);
9433
+ }
9434
+ if (mcpArgsPosition === "afterCommand") {
9211
9435
  args.push(...mcpArgs);
9212
9436
  }
9213
- const mode = options.mode ?? "yolo";
9214
- args.push(...spawnConfig.modes[mode]);
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(mcpEnvVars).length > 0 ? { ...process.env, ...mcpEnvVars } : void 0
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 init_types2 = __esm({
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,7 +9784,7 @@ 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
- init_types2();
9787
+ init_types3();
9562
9788
  JsonRpcMessageLayer = class {
9563
9789
  input;
9564
9790
  output;
@@ -9994,7 +10220,7 @@ var init_acp_client = __esm({
9994
10220
  "packages/poe-acp-client/src/acp-client.ts"() {
9995
10221
  "use strict";
9996
10222
  init_acp_transport();
9997
- init_types2();
10223
+ init_types3();
9998
10224
  AcpClient = class {
9999
10225
  transport;
10000
10226
  clientProtocolVersion;
@@ -10646,7 +10872,7 @@ var init_src7 = __esm({
10646
10872
  "use strict";
10647
10873
  init_acp_client();
10648
10874
  init_acp_transport();
10649
- init_types2();
10875
+ init_types3();
10650
10876
  init_jsonrpc_message_layer();
10651
10877
  init_jsonrpc();
10652
10878
  init_run_report();
@@ -11238,6 +11464,7 @@ var init_src8 = __esm({
11238
11464
  "packages/agent-spawn/src/index.ts"() {
11239
11465
  "use strict";
11240
11466
  init_run_command();
11467
+ init_types2();
11241
11468
  init_configs();
11242
11469
  init_mcp();
11243
11470
  init_spawn();
@@ -13144,6 +13371,16 @@ async function createConfigurePayload(init) {
13144
13371
  });
13145
13372
  payload.reasoningEffort = reasoningEffort;
13146
13373
  }
13374
+ const extension = await adapter.extendConfigurePayload?.({
13375
+ fs: container.fs,
13376
+ env: context.env,
13377
+ httpClient: container.httpClient,
13378
+ logger: logger2,
13379
+ payload
13380
+ });
13381
+ if (extension) {
13382
+ Object.assign(payload, extension);
13383
+ }
13147
13384
  return payload;
13148
13385
  }
13149
13386
  var init_configure_payload = __esm({
@@ -13812,7 +14049,7 @@ var init_utils2 = __esm({
13812
14049
 
13813
14050
  // packages/pipeline/src/config/loader.ts
13814
14051
  import path18 from "node:path";
13815
- import { parse as parse5, stringify } from "yaml";
14052
+ import { parse as parse6, stringify } from "yaml";
13816
14053
  function asStepMode(value) {
13817
14054
  if (value === void 0 || value === null) {
13818
14055
  return "yolo";
@@ -13824,7 +14061,7 @@ function asStepMode(value) {
13824
14061
  }
13825
14062
  function parseYamlDocument(filePath, content) {
13826
14063
  try {
13827
- return parse5(content);
14064
+ return parse6(content);
13828
14065
  } catch (error2) {
13829
14066
  const message2 = error2 instanceof Error ? error2.message : String(error2);
13830
14067
  throw new Error(`Invalid pipeline step config YAML in "${filePath}": ${message2}`);
@@ -14035,7 +14272,7 @@ var init_loader = __esm({
14035
14272
  });
14036
14273
 
14037
14274
  // packages/pipeline/src/plan/parser.ts
14038
- import { parse as parse6 } from "yaml";
14275
+ import { parse as parse7 } from "yaml";
14039
14276
  function asRequiredString(value, field) {
14040
14277
  if (typeof value === "string" && value.length > 0) {
14041
14278
  return value;
@@ -14119,7 +14356,7 @@ function parseMcpConfig(value) {
14119
14356
  function parsePlan(yamlContent, options = {}) {
14120
14357
  let document;
14121
14358
  try {
14122
- document = parse6(yamlContent);
14359
+ document = parse7(yamlContent);
14123
14360
  } catch (error2) {
14124
14361
  const message2 = error2 instanceof Error ? error2.message : String(error2);
14125
14362
  throw new Error(`Invalid plan YAML: ${message2}`);
@@ -17073,7 +17310,7 @@ var init_src14 = __esm({
17073
17310
  });
17074
17311
 
17075
17312
  // packages/ralph/src/frontmatter/frontmatter.ts
17076
- import { parse as parse7, stringify as stringify2 } from "yaml";
17313
+ import { parse as parse8, stringify as stringify2 } from "yaml";
17077
17314
  function parseFrontmatter(content) {
17078
17315
  if (!content.startsWith(`${FENCE}
17079
17316
  `)) {
@@ -17093,7 +17330,7 @@ ${FENCE}
17093
17330
  }
17094
17331
  const yamlBlock = content.slice(FENCE.length + 1, closingIndex);
17095
17332
  const body = content.slice(closingIndex + FENCE.length + 2);
17096
- const parsed = parse7(yamlBlock);
17333
+ const parsed = parse8(yamlBlock);
17097
17334
  return {
17098
17335
  data: parseFrontmatterData(parsed),
17099
17336
  body
@@ -17709,7 +17946,7 @@ var init_ralph2 = __esm({
17709
17946
  });
17710
17947
 
17711
17948
  // packages/experiment-loop/src/types.ts
17712
- var init_types3 = __esm({
17949
+ var init_types4 = __esm({
17713
17950
  "packages/experiment-loop/src/types.ts"() {
17714
17951
  "use strict";
17715
17952
  }
@@ -18019,7 +18256,7 @@ var init_git = __esm({
18019
18256
  import path30 from "node:path";
18020
18257
  import { readFile as readFile5 } from "node:fs/promises";
18021
18258
  import { fileURLToPath as fileURLToPath2 } from "node:url";
18022
- import { parse as parse8 } from "yaml";
18259
+ import { parse as parse9 } from "yaml";
18023
18260
  function isRecord8(value) {
18024
18261
  return typeof value === "object" && value !== null && !Array.isArray(value);
18025
18262
  }
@@ -18035,7 +18272,7 @@ async function readOptionalFile2(fs3, filePath) {
18035
18272
  }
18036
18273
  function parseRunConfigYaml(filePath, content) {
18037
18274
  try {
18038
- return parse8(content);
18275
+ return parse9(content);
18039
18276
  } catch (error2) {
18040
18277
  const message2 = error2 instanceof Error ? error2.message : String(error2);
18041
18278
  throw new Error(`Invalid experiment run config YAML in "${filePath}": ${message2}`);
@@ -18566,7 +18803,7 @@ var init_loop = __esm({
18566
18803
  var init_src16 = __esm({
18567
18804
  "packages/experiment-loop/src/index.ts"() {
18568
18805
  "use strict";
18569
- init_types3();
18806
+ init_types4();
18570
18807
  init_frontmatter3();
18571
18808
  init_journal();
18572
18809
  init_evaluator();
@@ -18808,7 +19045,7 @@ var init_client_instance = __esm({
18808
19045
  });
18809
19046
 
18810
19047
  // packages/github-workflows/src/frontmatter.ts
18811
- import { parse as parse9 } from "yaml";
19048
+ import { parse as parse10 } from "yaml";
18812
19049
  var init_frontmatter4 = __esm({
18813
19050
  "packages/github-workflows/src/frontmatter.ts"() {
18814
19051
  "use strict";
@@ -20989,6 +21226,7 @@ function createProvider(opts) {
20989
21226
  supportsMcpSpawn: opts.supportsMcpSpawn,
20990
21227
  configurePrompts: opts.configurePrompts,
20991
21228
  postConfigureMessages: opts.postConfigureMessages,
21229
+ extendConfigurePayload: opts.extendConfigurePayload,
20992
21230
  isolatedEnv: opts.isolatedEnv,
20993
21231
  async configure(context, runOptions) {
20994
21232
  await runMutations(opts.manifest.configure, {
@@ -27708,6 +27946,10 @@ function assertSpawnSupport(label, service, providerSupportsSpawn) {
27708
27946
  throw new ValidationError(`${label} does not support spawn.`);
27709
27947
  }
27710
27948
  function assertInteractiveSupport(label, service) {
27949
+ const spawnConfig = getSpawnConfig(service);
27950
+ if (spawnConfig?.kind === "cli" && spawnConfig.interactive) {
27951
+ return;
27952
+ }
27711
27953
  if (resolveAgentId(service)) {
27712
27954
  return;
27713
27955
  }
@@ -28851,7 +29093,7 @@ var init_generate = __esm({
28851
29093
 
28852
29094
  // packages/tiny-stdio-mcp-server/src/types.ts
28853
29095
  var JSON_RPC_ERROR_CODES, ToolError;
28854
- var init_types4 = __esm({
29096
+ var init_types5 = __esm({
28855
29097
  "packages/tiny-stdio-mcp-server/src/types.ts"() {
28856
29098
  "use strict";
28857
29099
  JSON_RPC_ERROR_CODES = {
@@ -28970,7 +29212,7 @@ function formatErrorResponse(id, error2) {
28970
29212
  var init_jsonrpc2 = __esm({
28971
29213
  "packages/tiny-stdio-mcp-server/src/jsonrpc.ts"() {
28972
29214
  "use strict";
28973
- init_types4();
29215
+ init_types5();
28974
29216
  }
28975
29217
  });
28976
29218
 
@@ -29530,7 +29772,7 @@ var PROTOCOL_VERSION;
29530
29772
  var init_server = __esm({
29531
29773
  "packages/tiny-stdio-mcp-server/src/server.ts"() {
29532
29774
  "use strict";
29533
- init_types4();
29775
+ init_types5();
29534
29776
  init_jsonrpc2();
29535
29777
  init_convert();
29536
29778
  PROTOCOL_VERSION = "2025-11-25";
@@ -29581,7 +29823,7 @@ var init_src22 = __esm({
29581
29823
  init_server();
29582
29824
  init_schema2();
29583
29825
  init_content();
29584
- init_types4();
29826
+ init_types5();
29585
29827
  }
29586
29828
  });
29587
29829
 
@@ -30090,6 +30332,12 @@ var init_configs2 = __esm({
30090
30332
  configKey: "mcpServers",
30091
30333
  format: "json",
30092
30334
  shape: "standard"
30335
+ },
30336
+ goose: {
30337
+ configFile: "~/.config/goose/config.yaml",
30338
+ configKey: "extensions",
30339
+ format: "yaml",
30340
+ shape: "goose"
30093
30341
  }
30094
30342
  };
30095
30343
  supportedAgents = Object.keys(agentMcpConfigs);
@@ -30147,6 +30395,33 @@ function opencodeShape(entry) {
30147
30395
  enabled
30148
30396
  };
30149
30397
  }
30398
+ function gooseShape(entry) {
30399
+ const enabled = entry.enabled !== false;
30400
+ if (!enabled) {
30401
+ return void 0;
30402
+ }
30403
+ if (entry.config.transport === "stdio") {
30404
+ const result2 = {
30405
+ type: "stdio",
30406
+ cmd: entry.config.command
30407
+ };
30408
+ if (entry.config.args && entry.config.args.length > 0) {
30409
+ result2.args = entry.config.args;
30410
+ }
30411
+ if (entry.config.env && Object.keys(entry.config.env).length > 0) {
30412
+ result2.envs = entry.config.env;
30413
+ }
30414
+ return result2;
30415
+ }
30416
+ const result = {
30417
+ type: "http",
30418
+ url: entry.config.url
30419
+ };
30420
+ if (entry.config.headers && Object.keys(entry.config.headers).length > 0) {
30421
+ result.headers = entry.config.headers;
30422
+ }
30423
+ return result;
30424
+ }
30150
30425
  function getShapeTransformer(shape) {
30151
30426
  return shapeTransformers[shape];
30152
30427
  }
@@ -30156,26 +30431,94 @@ var init_shapes = __esm({
30156
30431
  "use strict";
30157
30432
  shapeTransformers = {
30158
30433
  standard: standardShape,
30159
- opencode: opencodeShape
30434
+ opencode: opencodeShape,
30435
+ goose: gooseShape
30160
30436
  };
30161
30437
  }
30162
30438
  });
30163
30439
 
30164
30440
  // packages/agent-mcp-config/src/apply.ts
30165
30441
  import path44 from "node:path";
30442
+ import { parse as parseYaml3, stringify as stringifyYaml2 } from "yaml";
30166
30443
  function getConfigDirectory(configPath) {
30167
30444
  return path44.dirname(configPath);
30168
30445
  }
30169
- function isConfigObject5(value) {
30446
+ function isConfigObject6(value) {
30170
30447
  return Boolean(value) && typeof value === "object" && !Array.isArray(value);
30171
30448
  }
30172
30449
  function resolveServerMap(document, configKey) {
30173
30450
  const value = document[configKey];
30174
- return isConfigObject5(value) ? value : {};
30451
+ return isConfigObject6(value) ? value : {};
30175
30452
  }
30176
30453
  function mergeServerMap(document, configKey, servers) {
30177
30454
  return { ...document, [configKey]: servers };
30178
30455
  }
30456
+ function expandHomePath(configPath, homeDir) {
30457
+ if (!configPath.startsWith("~")) {
30458
+ return configPath;
30459
+ }
30460
+ if (configPath === "~") {
30461
+ return homeDir;
30462
+ }
30463
+ if (configPath.startsWith("~/")) {
30464
+ return path44.join(homeDir, configPath.slice(2));
30465
+ }
30466
+ return path44.join(homeDir, configPath.slice(1));
30467
+ }
30468
+ function parseYamlDocument2(content) {
30469
+ if (content.trim() === "") {
30470
+ return {};
30471
+ }
30472
+ const parsed = parseYaml3(content);
30473
+ if (parsed === null || parsed === void 0) {
30474
+ return {};
30475
+ }
30476
+ if (!isConfigObject6(parsed)) {
30477
+ throw new Error("Expected YAML document to be an object.");
30478
+ }
30479
+ return parsed;
30480
+ }
30481
+ function serializeYamlDocument(document) {
30482
+ const serialized = stringifyYaml2(document);
30483
+ return serialized.endsWith("\n") ? serialized : `${serialized}
30484
+ `;
30485
+ }
30486
+ async function readYamlConfig(configPath, options) {
30487
+ const absolutePath = expandHomePath(configPath, options.homeDir);
30488
+ const existingContent = await readFileIfExists(options.fs, absolutePath);
30489
+ if (existingContent === null) {
30490
+ return {};
30491
+ }
30492
+ return parseYamlDocument2(existingContent);
30493
+ }
30494
+ async function writeYamlConfig(configPath, document, options) {
30495
+ if (options.dryRun) {
30496
+ return;
30497
+ }
30498
+ const absolutePath = expandHomePath(configPath, options.homeDir);
30499
+ const configDir = path44.dirname(absolutePath);
30500
+ await options.fs.mkdir(configDir, { recursive: true });
30501
+ await options.fs.writeFile(absolutePath, serializeYamlDocument(document), {
30502
+ encoding: "utf8"
30503
+ });
30504
+ }
30505
+ function removeServer(document, configKey, serverName) {
30506
+ const servers = resolveServerMap(document, configKey);
30507
+ if (!(serverName in servers)) {
30508
+ return { changed: false, content: document };
30509
+ }
30510
+ const nextServers = { ...servers };
30511
+ delete nextServers[serverName];
30512
+ if (Object.keys(nextServers).length === 0) {
30513
+ const nextDocument = { ...document };
30514
+ delete nextDocument[configKey];
30515
+ return { changed: true, content: nextDocument };
30516
+ }
30517
+ return {
30518
+ changed: true,
30519
+ content: mergeServerMap(document, configKey, nextServers)
30520
+ };
30521
+ }
30179
30522
  async function configure(agentId, server, options) {
30180
30523
  if (!isSupported(agentId)) {
30181
30524
  throw new UnsupportedAgentError(agentId);
@@ -30188,6 +30531,16 @@ async function configure(agentId, server, options) {
30188
30531
  await unconfigure(agentId, server.name, options);
30189
30532
  return;
30190
30533
  }
30534
+ if (config.format === "yaml") {
30535
+ const document = await readYamlConfig(configPath, options);
30536
+ const servers = resolveServerMap(document, config.configKey);
30537
+ const nextDocument = mergeServerMap(document, config.configKey, {
30538
+ ...servers,
30539
+ [server.name]: shaped
30540
+ });
30541
+ await writeYamlConfig(configPath, nextDocument, options);
30542
+ return;
30543
+ }
30191
30544
  const configDir = getConfigDirectory(configPath);
30192
30545
  await runMutations(
30193
30546
  [
@@ -30228,6 +30581,19 @@ async function unconfigure(agentId, serverName, options) {
30228
30581
  }
30229
30582
  const config = getAgentConfig(agentId);
30230
30583
  const configPath = resolveConfigPath2(config, options.platform);
30584
+ if (config.format === "yaml") {
30585
+ const document = await readYamlConfig(configPath, options);
30586
+ const { changed, content } = removeServer(
30587
+ document,
30588
+ config.configKey,
30589
+ serverName
30590
+ );
30591
+ if (!changed) {
30592
+ return;
30593
+ }
30594
+ await writeYamlConfig(configPath, content, options);
30595
+ return;
30596
+ }
30231
30597
  await runMutations(
30232
30598
  [
30233
30599
  configMutation.prune({
@@ -30483,6 +30849,10 @@ var init_configs3 = __esm({
30483
30849
  opencode: {
30484
30850
  globalSkillDir: "~/.config/opencode/skills",
30485
30851
  localSkillDir: ".opencode/skills"
30852
+ },
30853
+ goose: {
30854
+ globalSkillDir: "~/.agents/skills",
30855
+ localSkillDir: ".agents/skills"
30486
30856
  }
30487
30857
  };
30488
30858
  supportedAgents2 = Object.keys(agentSkillConfigs);
@@ -34288,7 +34658,7 @@ var init_package = __esm({
34288
34658
  "package.json"() {
34289
34659
  package_default = {
34290
34660
  name: "poe-code",
34291
- version: "3.0.169",
34661
+ version: "3.0.170",
34292
34662
  description: "CLI tool to configure Poe API for developer workflows.",
34293
34663
  type: "module",
34294
34664
  main: "./dist/index.js",