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.
@@ -250,6 +250,7 @@ var codexSpawnConfig = {
250
250
  modelStripProviderPrefix: true,
251
251
  defaultArgs: ["--skip-git-repo-check", "--json"],
252
252
  mcpArgs: serializeCodexMcpArgs,
253
+ mcpArgsBeforeCommand: true,
253
254
  modes: {
254
255
  yolo: ["-s", "danger-full-access"],
255
256
  edit: ["-s", "workspace-write"],
@@ -415,18 +416,29 @@ function resolveCliConfig(agentId) {
415
416
  };
416
417
  }
417
418
  function buildCliArgs(config, options, stdinMode) {
418
- const args = stdinMode ? [
419
- config.promptFlag,
420
- ...stdinMode.omitPrompt ? [] : [options.prompt],
421
- ...stdinMode.extraArgs
422
- ] : [config.promptFlag, options.prompt];
419
+ const mcpArgs = getMcpArgs(config, options.mcpServers);
420
+ const args = [];
421
+ if (config.mcpArgsBeforeCommand) {
422
+ args.push(...mcpArgs);
423
+ }
424
+ if (stdinMode) {
425
+ args.push(
426
+ config.promptFlag,
427
+ ...stdinMode.omitPrompt ? [] : [options.prompt],
428
+ ...stdinMode.extraArgs
429
+ );
430
+ } else {
431
+ args.push(config.promptFlag, options.prompt);
432
+ }
423
433
  if (options.model && config.modelFlag) {
424
434
  let model = config.modelStripProviderPrefix ? stripModelNamespace(options.model) : options.model;
425
435
  if (config.modelTransform) model = config.modelTransform(model);
426
436
  args.push(config.modelFlag, model);
427
437
  }
428
438
  args.push(...config.defaultArgs);
429
- args.push(...getMcpArgs(config, options.mcpServers));
439
+ if (!config.mcpArgsBeforeCommand) {
440
+ args.push(...mcpArgs);
441
+ }
430
442
  args.push(...config.modes[options.mode ?? "yolo"]);
431
443
  if (options.args && options.args.length > 0) {
432
444
  args.push(...options.args);