@mutagent/cli 0.1.362 → 0.1.364

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/README.md CHANGED
@@ -474,7 +474,9 @@ does: it downloads `helix-<os>-<arch>` (macOS or Linux, x64 or arm64) from
474
474
  `https://install.mutagent.io/<channel>/`, verifies it against `checksums.txt` from
475
475
  the same origin, writes `~/.mutagent/bin/helix` with the `mutagent-helix` alias,
476
476
  and runs `helix --version`. No login is needed. Shell rc files are never changed:
477
- when the directory is not on `PATH`, the line to add is printed. When you are
477
+ when the directory is not on `PATH`, the line to add is printed. (The PATH step is
478
+ where the two differ: the curl installer also symlinks `helix` into `~/.local/bin` or
479
+ `~/bin` when one of them is already on `PATH`; this command does not.) When you are
478
480
  signed in, the CLI also records the install activation, best-effort; `--json`
479
481
  reports it as `telemetry` (`sent`, `skipped` or `failed`).
480
482
 
package/dist/bin/cli.js CHANGED
@@ -25554,6 +25554,8 @@ function delay(ms, signal) {
25554
25554
  }
25555
25555
 
25556
25556
  // src/lib/helix-native-session.ts
25557
+ var TEARDOWN_SIGNALS = ["SIGTERM", "SIGHUP"];
25558
+ var EOF_SETTLE_MS = 100;
25557
25559
  async function runNativeSession(options) {
25558
25560
  const controller = new AbortController;
25559
25561
  const inputController = new AbortController;
@@ -25615,6 +25617,24 @@ async function runNativeSession(options) {
25615
25617
  });
25616
25618
  };
25617
25619
  process.on("SIGINT", onSigint);
25620
+ const guardsEof = options.rpc && options.closeInput !== undefined;
25621
+ const parentPid = process.ppid;
25622
+ const onTeardown = (sig) => {
25623
+ detach();
25624
+ removeTeardownListeners();
25625
+ if (process.listenerCount(sig) === 0)
25626
+ process.kill(process.pid, sig);
25627
+ };
25628
+ const teardownListeners = TEARDOWN_SIGNALS.map((sig) => [sig, () => {
25629
+ onTeardown(sig);
25630
+ }]);
25631
+ const removeTeardownListeners = () => {
25632
+ for (const [sig, listener] of teardownListeners)
25633
+ process.removeListener(sig, listener);
25634
+ };
25635
+ if (guardsEof)
25636
+ for (const [sig, listener] of teardownListeners)
25637
+ process.on(sig, listener);
25618
25638
  options.signal?.addEventListener("abort", detach, { once: true });
25619
25639
  if (options.signal?.aborted)
25620
25640
  detach();
@@ -25641,10 +25661,21 @@ async function runNativeSession(options) {
25641
25661
  }
25642
25662
  if (inputController.signal.aborted || !inputState.ended)
25643
25663
  return;
25644
- if (options.closeInput === undefined) {
25664
+ const closeInput = options.closeInput;
25665
+ if (closeInput === undefined) {
25645
25666
  throw new MutagentError("NOT_SUPPORTED", "This transport cannot forward native stdin EOF.", "Use a server and image with explicit close-input support; no signal was sent.", 1);
25646
25667
  }
25647
- const closed = await options.closeInput(inputController.signal);
25668
+ await new Promise((resolve9) => {
25669
+ setTimeout(resolve9, EOF_SETTLE_MS);
25670
+ });
25671
+ if (inputController.signal.aborted)
25672
+ return;
25673
+ if (process.ppid !== parentPid) {
25674
+ notice("The parent process exited; detaching. Session " + options.reference + " keeps its input open.");
25675
+ detach();
25676
+ return;
25677
+ }
25678
+ const closed = await closeInput(inputController.signal);
25648
25679
  if (!closed.closed) {
25649
25680
  throw new MutagentError("RPC_INPUT_REJECTED", "The session did not confirm stdin closure.", "Check the session: mutagent helix session ls. No signal was sent in place of EOF.", 1);
25650
25681
  }
@@ -25718,6 +25749,7 @@ async function runNativeSession(options) {
25718
25749
  await inputTask;
25719
25750
  await interruptTask;
25720
25751
  process.removeListener("SIGINT", onSigint);
25752
+ removeTeardownListeners();
25721
25753
  if (options.rpc)
25722
25754
  input2.removeListener("end", onInputEnd);
25723
25755
  options.signal?.removeEventListener("abort", detach);
@@ -29356,4 +29388,4 @@ if (isAgentInvocation(rawArgs)) {
29356
29388
  program.parse(argvForCommander, { from: "user" });
29357
29389
  }
29358
29390
 
29359
- //# debugId=76A898BDAFE9975F64756E2164756E21
29391
+ //# debugId=B55AD472D31665B264756E2164756E21
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mutagent/cli",
3
- "version": "0.1.362",
3
+ "version": "0.1.364",
4
4
  "description": "Bun-native CLI for the MutagenT AI platform - auth, provider config, and lifecycle-tool installer for AI-native workflows",
5
5
  "type": "module",
6
6
  "bin": {