benignswarm 0.12.83 → 0.12.84

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.
@@ -7,7 +7,7 @@ import { AGENT_ORIENTATION } from "./commands/operator.js";
7
7
  import { makeOut } from "./output.js";
8
8
  import { CLI_VERSION } from "./version.js";
9
9
  import { applyEnvAliases } from "./env-aliases.js";
10
- import { warnLegacyAlias } from "./legacy-alias.js";
10
+ import { versionLine, warnLegacyAlias } from "./legacy-alias.js";
11
11
  /** b9s-admin: the operator binary. Agents use b9s, whose help never lists these. */
12
12
  async function main(argv) {
13
13
  warnLegacyAlias();
@@ -21,7 +21,7 @@ async function main(argv) {
21
21
  const p = parse(argv);
22
22
  const out = makeOut(bool(p.flags, "json"));
23
23
  if (bool(p.flags, "version")) {
24
- process.stdout.write(`b9s-admin ${CLI_VERSION}\n`);
24
+ process.stdout.write(`${versionLine(CLI_VERSION, true)}\n`);
25
25
  return 0;
26
26
  }
27
27
  if (!p.positionals[0] || bool(p.flags, "help")) {
package/dist/index.js CHANGED
@@ -30,7 +30,7 @@ import { commandLine } from "./notices.js";
30
30
  import { commandWarnings } from "./commands/hook.js";
31
31
  import { loadAgent, resolveAgentName } from "./config.js";
32
32
  import { agentNotice } from "./commands/notices.js";
33
- import { warnLegacyAlias } from "./legacy-alias.js";
33
+ import { versionLine, warnLegacyAlias } from "./legacy-alias.js";
34
34
  const COMMANDS = {
35
35
  join,
36
36
  setup,
@@ -112,7 +112,7 @@ async function main(argv) {
112
112
  const p = parse(argv);
113
113
  const out = makeOut(bool(p.flags, "json"));
114
114
  if (bool(p.flags, "version")) {
115
- process.stdout.write(`b9s ${CLI_VERSION}\n`);
115
+ process.stdout.write(`${versionLine(CLI_VERSION, false)}\n`);
116
116
  return 0;
117
117
  }
118
118
  const cmd = p.positionals[0];
@@ -5,6 +5,16 @@ import { CLI_VERSION } from "./version.js";
5
5
  export function invokedProduct(argv1 = process.argv[1]) {
6
6
  return basename(argv1 ?? "") === "bschat" || basename(argv1 ?? "") === "bschat-admin" ? "bschat-cli" : "b9s-cli";
7
7
  }
8
+ /**
9
+ * The --version line names the program that was run. Every CLI up to 0.12.82 verifies an upgrade by
10
+ * asking the legacy alias (bschat) in the npm prefix for its version and matching the alias name followed by a
11
+ * version; 0.12.83 answered with the new name, so those upgrades installed it, reported "nothing", and
12
+ * stopped before restarting watchers.
13
+ */
14
+ export function versionLine(version, admin, argv1 = process.argv[1]) {
15
+ const legacy = invokedProduct(argv1) === "bschat-cli";
16
+ return `${admin ? (legacy ? "bschat-admin" : "b9s-admin") : (legacy ? "bschat" : "b9s")} ${version}`;
17
+ }
8
18
  export function cliUserAgent(argv1 = process.argv[1]) { return `${invokedProduct(argv1)}/${CLI_VERSION}`; }
9
19
  /** Keep legacy alias messaging on stderr and at most once per alias per UTC day. */
10
20
  export function warnLegacyAlias(argv1 = process.argv[1], now = new Date(), root) {
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const CLI_VERSION = "0.12.83";
1
+ export const CLI_VERSION = "0.12.84";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "benignswarm",
3
- "version": "0.12.83",
3
+ "version": "0.12.84",
4
4
  "description": "b9s: chat, status board and evidence store for coding agents (benignswarm.org)",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {