@stamn/stamn-plugin 0.1.0-alpha.13 → 0.1.0-alpha.15

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
@@ -4745,7 +4745,7 @@ var StamnClient = class {
4745
4745
  }
4746
4746
  };
4747
4747
 
4748
- // node_modules/.pnpm/@stamn+cli@0.1.0-alpha.4/node_modules/@stamn/cli/dist/chunk-GNL7D4HS.js
4748
+ // node_modules/.pnpm/@stamn+cli@0.1.0-alpha.5/node_modules/@stamn/cli/dist/chunk-Z2RKPU7M.js
4749
4749
  import { execSync } from "child_process";
4750
4750
  import { mkdirSync, readFileSync, writeFileSync, unlinkSync } from "fs";
4751
4751
  import { join } from "path";
@@ -4764,7 +4764,7 @@ async function handleLogin(_opts, adapter) {
4764
4764
  s2.stop("Session valid.");
4765
4765
  R2.info("Already logged in.");
4766
4766
  Gt("Run `stamn agent register` to create an agent, or `stamn agent list` to see existing ones.");
4767
- return;
4767
+ process.exit(0);
4768
4768
  } catch {
4769
4769
  s2.stop("Session expired.");
4770
4770
  R2.warn("Existing session is invalid. Re-authenticating...");
@@ -4789,6 +4789,7 @@ ${label("Code:")} ${flow.userCode}`,
4789
4789
  R2.success("Logged in successfully.");
4790
4790
  R2.info(`Config written to ${adapter.getConfigPath()}`);
4791
4791
  Gt("Now run `stamn agent register` to create or reconnect an agent.");
4792
+ process.exit(0);
4792
4793
  } catch (err) {
4793
4794
  s.stop("Failed.");
4794
4795
  Nt(`Login failed: ${err.message}`);
@@ -4828,7 +4829,7 @@ async function handleAgentRegister(opts, adapter) {
4828
4829
  adapter.writeConfig({ agentId: match.id, agentName: match.name });
4829
4830
  R2.success(`Agent "${match.name}" (${match.id}) already exists. Selected as active.`);
4830
4831
  Gt("Done!");
4831
- return;
4832
+ process.exit(0);
4832
4833
  }
4833
4834
  s.start("Registering agent...");
4834
4835
  const participant = await client.participants.create({ name });
@@ -4836,6 +4837,7 @@ async function handleAgentRegister(opts, adapter) {
4836
4837
  adapter.writeConfig({ agentId: participant.id, agentName: participant.name });
4837
4838
  R2.success(`Agent "${participant.name}" (${participant.id})`);
4838
4839
  Gt("Done!");
4840
+ process.exit(0);
4839
4841
  } catch (err) {
4840
4842
  s.stop("Failed.");
4841
4843
  Nt(`Registration failed: ${err.message}`);
@@ -4857,12 +4859,13 @@ async function handleAgentList(_opts, adapter) {
4857
4859
  s.stop(`${agents.length} agent${agents.length === 1 ? "" : "s"} found.`);
4858
4860
  if (agents.length === 0) {
4859
4861
  R2.info("No agents found. Run `stamn agent register` to create one.");
4860
- return;
4862
+ process.exit(0);
4861
4863
  }
4862
4864
  for (const agent of agents) {
4863
4865
  const active = agent.id === config.agentId ? " (active)" : "";
4864
4866
  R2.info(` ${agent.name} \u2014 ${agent.id}${active}`);
4865
4867
  }
4868
+ process.exit(0);
4866
4869
  } catch (err) {
4867
4870
  s.stop("Failed.");
4868
4871
  Nt(`Failed to list agents: ${err.message}`);
@@ -4891,6 +4894,7 @@ async function handleAgentSelect(opts, adapter) {
4891
4894
  adapter.writeConfig({ agentId: match.id, agentName: match.name });
4892
4895
  R2.success(`Active agent set to "${match.name}" (${match.id})`);
4893
4896
  Gt("Done!");
4897
+ process.exit(0);
4894
4898
  } catch (err) {
4895
4899
  s.stop("Failed.");
4896
4900
  Nt(`Failed to select agent: ${err.message}`);
@@ -4903,7 +4907,7 @@ async function handleLogout(_opts, adapter) {
4903
4907
  if (!config?.apiKey) {
4904
4908
  R2.info("Not logged in.");
4905
4909
  Gt("Nothing to do.");
4906
- return;
4910
+ process.exit(0);
4907
4911
  }
4908
4912
  const shouldContinue = await Rt({
4909
4913
  message: "This will clear your auth session. Your agents will not be deleted. Continue?"
@@ -4915,6 +4919,7 @@ async function handleLogout(_opts, adapter) {
4915
4919
  adapter.writeConfig({ apiKey: "", agentId: "", agentName: "" });
4916
4920
  R2.success("Logged out.");
4917
4921
  Gt("Run `stamn login` to authenticate again.");
4922
+ process.exit(0);
4918
4923
  }
4919
4924
  function openEditor(initial) {
4920
4925
  const editor = process.env.EDITOR || process.env.VISUAL || "vi";
@@ -4981,6 +4986,7 @@ async function handleStatus(adapter) {
4981
4986
  R2.info(`${label("Server:")} ${health.ok ? "healthy" : "unhealthy"}`);
4982
4987
  }
4983
4988
  Gt("");
4989
+ process.exit(0);
4984
4990
  }
4985
4991
  async function handleUninstall(adapter) {
4986
4992
  Wt2("Stamn Uninstall");
@@ -4995,6 +5001,7 @@ async function handleUninstall(adapter) {
4995
5001
  adapter.uninstall?.();
4996
5002
  R2.success("Removed Stamn config");
4997
5003
  Gt("Stamn config removed.");
5004
+ process.exit(0);
4998
5005
  } catch (err) {
4999
5006
  Nt(`Failed to remove config: ${err.message}`);
5000
5007
  process.exit(1);