@clagentic/console 1.6.0-beta.3 → 1.6.0

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/bin/cli.js CHANGED
@@ -48,6 +48,26 @@ function openUrl(url) {
48
48
  }
49
49
 
50
50
  var args = process.argv.slice(2);
51
+
52
+ // --- `release` subcommand group (release-engineering helpers, lr-01c6) ---
53
+ // Positional subcommand, handled before flag parsing: `clagentic-console release list-betas`.
54
+ if (args[0] === "release") {
55
+ var releaseSub = args[1];
56
+ if (releaseSub === "list-betas") {
57
+ var releaseList = require("../lib/release-list");
58
+ var betasResult = releaseList.readBetasFile(process.cwd());
59
+ var betasLines = releaseList.formatBetasOutput(betasResult);
60
+ for (var bl = 0; bl < betasLines.length; bl++) {
61
+ console.log(betasLines[bl]);
62
+ }
63
+ process.exit(betasResult.ok ? 0 : 1);
64
+ } else {
65
+ console.error("Unknown release subcommand: " + (releaseSub || "(none)"));
66
+ console.error("Usage: clagentic-console release list-betas");
67
+ process.exit(1);
68
+ }
69
+ }
70
+
51
71
  var port = _isDev ? 2635 : 2633;
52
72
  var useHttps = true;
53
73
  var forceMkcert = false;
@@ -124,6 +144,7 @@ for (var i = 0; i < args.length; i++) {
124
144
  console.log(" clagentic-console --add <path> Add a project to the running daemon");
125
145
  console.log(" clagentic-console --remove <path> Remove a project from the running daemon");
126
146
  console.log(" clagentic-console --list List registered projects");
147
+ console.log(" clagentic-console release list-betas List promotable beta versions (maintainer/release-engineering)");
127
148
  console.log("");
128
149
  console.log("Options:");
129
150
  console.log(" -p, --port <port> Port to listen on (default: 2633)");
@@ -0,0 +1,87 @@
1
+ // lib/release-list.js
2
+ //
3
+ // Reads the .betas.json generated data artifact (written by the `beta` job in
4
+ // .github/workflows/release.yml, lr-01c6) and formats it for the CLI's
5
+ // `release list-betas` subcommand. Kept as its own module (not inlined in
6
+ // bin/cli.js) so the read/parse/format logic is unit-testable in isolation.
7
+
8
+ var fs = require("fs");
9
+ var path = require("path");
10
+
11
+ /**
12
+ * Reads and parses the .betas.json file at the given repo root.
13
+ *
14
+ * Returns:
15
+ * { ok: true, generatedAt: string, promotableBetas: string[] }
16
+ * { ok: false, reason: "missing" } — file does not exist
17
+ * { ok: false, reason: "invalid", error } — file exists but isn't valid JSON
18
+ * or doesn't match the expected shape
19
+ */
20
+ function readBetasFile(repoRoot) {
21
+ var betasPath = path.join(repoRoot, ".betas.json");
22
+ var raw;
23
+ try {
24
+ raw = fs.readFileSync(betasPath, "utf8");
25
+ } catch (e) {
26
+ return { ok: false, reason: "missing" };
27
+ }
28
+
29
+ var parsed;
30
+ try {
31
+ parsed = JSON.parse(raw);
32
+ } catch (e) {
33
+ return { ok: false, reason: "invalid", error: e.message };
34
+ }
35
+
36
+ if (!parsed || !Array.isArray(parsed.promotable_betas)) {
37
+ return { ok: false, reason: "invalid", error: "missing promotable_betas array" };
38
+ }
39
+
40
+ return {
41
+ ok: true,
42
+ generatedAt: parsed.generated_at || null,
43
+ promotableBetas: parsed.promotable_betas,
44
+ };
45
+ }
46
+
47
+ /**
48
+ * Formats the result of readBetasFile() into human-readable lines for the CLI.
49
+ * Returns an array of strings (one per line); caller decides how to print them.
50
+ */
51
+ function formatBetasOutput(result) {
52
+ if (!result.ok) {
53
+ if (result.reason === "missing") {
54
+ return [
55
+ "No .betas.json found in this checkout.",
56
+ "Cut a beta (workflow_dispatch type=beta on release.yml) and wait for it to publish, then try again.",
57
+ ];
58
+ }
59
+ return [
60
+ "Clagentic: Console — .betas.json is present but could not be read: " + (result.error || "unknown error"),
61
+ "Re-cut a beta to regenerate it.",
62
+ ];
63
+ }
64
+
65
+ if (result.promotableBetas.length === 0) {
66
+ return [
67
+ "No promotable betas found above the current @latest.",
68
+ "Cut a beta (workflow_dispatch type=beta on release.yml) and wait for it to publish, then try again.",
69
+ ];
70
+ }
71
+
72
+ var lines = [];
73
+ if (result.generatedAt) {
74
+ lines.push("Promotable betas (as of " + result.generatedAt + "):");
75
+ } else {
76
+ lines.push("Promotable betas:");
77
+ }
78
+ for (var i = 0; i < result.promotableBetas.length; i++) {
79
+ lines.push(" " + result.promotableBetas[i]);
80
+ }
81
+ return lines;
82
+ }
83
+
84
+ module.exports = {
85
+ readBetasFile: readBetasFile,
86
+ formatBetasOutput: formatBetasOutput,
87
+ };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.6.0-beta.3",
6
+ "version": "1.6.0",
7
7
  "description": "Self-hosted console for Claude Code and Codex. Multi-user, browser-based, persistent AI sessions.",
8
8
  "bin": {
9
9
  "clagentic-console": "./bin/cli.js"