@ordewell/core 0.4.19 → 0.4.20

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.mjs CHANGED
@@ -12453,7 +12453,8 @@ function resolveArgs(manifest, ctx) {
12453
12453
  command: manifest.runner.command,
12454
12454
  args,
12455
12455
  env,
12456
- promptInArgs: manifest.runner.promptInArgs
12456
+ promptInArgs: manifest.runner.promptInArgs,
12457
+ submitPromptKey: manifest.runner.submitPromptKey === true && isInteractive(ctx)
12457
12458
  };
12458
12459
  }
12459
12460
  function parseBlockOpen(raw) {
@@ -12807,7 +12808,8 @@ var HeadlessRunner = class extends AbstractRunner {
12807
12808
  launch: await planDirectLaunch(command, args, this.launchDeps),
12808
12809
  resolvedPath,
12809
12810
  env: invocation.env,
12810
- pty
12811
+ pty,
12812
+ submitPromptKey: invocation.submitPromptKey
12811
12813
  };
12812
12814
  }
12813
12815
  async spawn(opts) {
@@ -12817,6 +12819,7 @@ var HeadlessRunner = class extends AbstractRunner {
12817
12819
  const modeStr = opts.mode === "plan" ? "plan" : "build";
12818
12820
  console.error(`[headless] Starting ${opts.runner} [${modeStr}] (${opts.modelId || "default"}) for task ${opts.taskId.slice(0, 8)}${prepared.pty ? " (PTY)" : ""}`);
12819
12821
  session.start(prepared.launch, opts.cwd, prepared.resolvedPath, prepared.env);
12822
+ if (prepared.submitPromptKey) session.write("\r");
12820
12823
  this.registerSession(id, session);
12821
12824
  return session;
12822
12825
  }
@@ -13118,6 +13121,7 @@ var TmuxRunner = class extends AbstractRunner {
13118
13121
  );
13119
13122
  invocation.env = { ...invocation.env, PATH: await this.resolvePath() };
13120
13123
  await session.start(invocation.command, invocation.args, opts.cwd, invocation.env);
13124
+ if (invocation.submitPromptKey) session.write("\r");
13121
13125
  this.registerSession(id, session);
13122
13126
  return session;
13123
13127
  }
@@ -13586,7 +13590,12 @@ var OPENCODE_MANIFEST = {
13586
13590
  OPENCODE_CONFIG_CONTENT: "{{if interactiveVariant}}{{opencodeVariantConfig}}{{/if}}"
13587
13591
  },
13588
13592
  promptInArgs: true,
13589
- requiresTty: true
13593
+ requiresTty: true,
13594
+ // `--prompt` only pre-fills the TUI's composer; it does not submit it.
13595
+ // (`opencode run` — the headless subcommand — has no such gap: its
13596
+ // message is a positional arg that runs immediately.) An unattended
13597
+ // surface driving the TUI must press Enter itself.
13598
+ submitPromptKey: true
13590
13599
  },
13591
13600
  features: {
13592
13601
  modelSelection: true,