poe-code 3.0.109 → 3.0.111

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.
@@ -285,6 +285,7 @@ var codexSpawnConfig = {
285
285
  modelStripProviderPrefix: true,
286
286
  defaultArgs: ["--skip-git-repo-check", "--json"],
287
287
  mcpArgs: serializeCodexMcpArgs,
288
+ mcpArgsBeforeCommand: true,
288
289
  modes: {
289
290
  yolo: ["-s", "danger-full-access"],
290
291
  edit: ["-s", "workspace-write"],
@@ -450,18 +451,29 @@ function resolveCliConfig(agentId) {
450
451
  };
451
452
  }
452
453
  function buildCliArgs(config, options, stdinMode) {
453
- const args = stdinMode ? [
454
- config.promptFlag,
455
- ...stdinMode.omitPrompt ? [] : [options.prompt],
456
- ...stdinMode.extraArgs
457
- ] : [config.promptFlag, options.prompt];
454
+ const mcpArgs = getMcpArgs(config, options.mcpServers);
455
+ const args = [];
456
+ if (config.mcpArgsBeforeCommand) {
457
+ args.push(...mcpArgs);
458
+ }
459
+ if (stdinMode) {
460
+ args.push(
461
+ config.promptFlag,
462
+ ...stdinMode.omitPrompt ? [] : [options.prompt],
463
+ ...stdinMode.extraArgs
464
+ );
465
+ } else {
466
+ args.push(config.promptFlag, options.prompt);
467
+ }
458
468
  if (options.model && config.modelFlag) {
459
469
  let model = config.modelStripProviderPrefix ? stripModelNamespace(options.model) : options.model;
460
470
  if (config.modelTransform) model = config.modelTransform(model);
461
471
  args.push(config.modelFlag, model);
462
472
  }
463
473
  args.push(...config.defaultArgs);
464
- args.push(...getMcpArgs(config, options.mcpServers));
474
+ if (!config.mcpArgsBeforeCommand) {
475
+ args.push(...mcpArgs);
476
+ }
465
477
  args.push(...config.modes[options.mode ?? "yolo"]);
466
478
  if (options.args && options.args.length > 0) {
467
479
  args.push(...options.args);