poe-code 3.0.109 → 3.0.110

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
@@ -2742,6 +2742,7 @@ var init_codex2 = __esm({
2742
2742
  modelStripProviderPrefix: true,
2743
2743
  defaultArgs: ["--skip-git-repo-check", "--json"],
2744
2744
  mcpArgs: serializeCodexMcpArgs,
2745
+ mcpArgsBeforeCommand: true,
2745
2746
  modes: {
2746
2747
  yolo: ["-s", "danger-full-access"],
2747
2748
  edit: ["-s", "workspace-write"],
@@ -2958,18 +2959,29 @@ function resolveCliConfig(agentId) {
2958
2959
  };
2959
2960
  }
2960
2961
  function buildCliArgs(config2, options, stdinMode) {
2961
- const args = stdinMode ? [
2962
- config2.promptFlag,
2963
- ...stdinMode.omitPrompt ? [] : [options.prompt],
2964
- ...stdinMode.extraArgs
2965
- ] : [config2.promptFlag, options.prompt];
2962
+ const mcpArgs = getMcpArgs(config2, options.mcpServers);
2963
+ const args = [];
2964
+ if (config2.mcpArgsBeforeCommand) {
2965
+ args.push(...mcpArgs);
2966
+ }
2967
+ if (stdinMode) {
2968
+ args.push(
2969
+ config2.promptFlag,
2970
+ ...stdinMode.omitPrompt ? [] : [options.prompt],
2971
+ ...stdinMode.extraArgs
2972
+ );
2973
+ } else {
2974
+ args.push(config2.promptFlag, options.prompt);
2975
+ }
2966
2976
  if (options.model && config2.modelFlag) {
2967
2977
  let model = config2.modelStripProviderPrefix ? stripModelNamespace(options.model) : options.model;
2968
2978
  if (config2.modelTransform) model = config2.modelTransform(model);
2969
2979
  args.push(config2.modelFlag, model);
2970
2980
  }
2971
2981
  args.push(...config2.defaultArgs);
2972
- args.push(...getMcpArgs(config2, options.mcpServers));
2982
+ if (!config2.mcpArgsBeforeCommand) {
2983
+ args.push(...mcpArgs);
2984
+ }
2973
2985
  args.push(...config2.modes[options.mode ?? "yolo"]);
2974
2986
  if (options.args && options.args.length > 0) {
2975
2987
  args.push(...options.args);
@@ -4441,7 +4453,12 @@ function spawnStreaming(options) {
4441
4453
  if (!binaryName) {
4442
4454
  throw new Error(`Agent "${agentId}" has no binaryName.`);
4443
4455
  }
4444
- const args = [spawnConfig.promptFlag];
4456
+ const mcpArgs = getMcpArgs(spawnConfig, options.mcpServers);
4457
+ const args = [];
4458
+ if (spawnConfig.mcpArgsBeforeCommand) {
4459
+ args.push(...mcpArgs);
4460
+ }
4461
+ args.push(spawnConfig.promptFlag);
4445
4462
  const useStdin = !!options.useStdin && !!spawnConfig.stdinMode;
4446
4463
  if (!useStdin || !spawnConfig.stdinMode?.omitPrompt) {
4447
4464
  args.push(options.prompt);
@@ -4452,7 +4469,9 @@ function spawnStreaming(options) {
4452
4469
  args.push(spawnConfig.modelFlag, model);
4453
4470
  }
4454
4471
  args.push(...spawnConfig.defaultArgs);
4455
- args.push(...getMcpArgs(spawnConfig, options.mcpServers));
4472
+ if (!spawnConfig.mcpArgsBeforeCommand) {
4473
+ args.push(...mcpArgs);
4474
+ }
4456
4475
  const mode = options.mode ?? "yolo";
4457
4476
  args.push(...spawnConfig.modes[mode]);
4458
4477
  if (useStdin) {
@@ -39981,7 +40000,7 @@ var init_package = __esm({
39981
40000
  "package.json"() {
39982
40001
  package_default = {
39983
40002
  name: "poe-code",
39984
- version: "3.0.109",
40003
+ version: "3.0.110",
39985
40004
  description: "CLI tool to configure Poe API for developer workflows.",
39986
40005
  type: "module",
39987
40006
  main: "./dist/index.js",