@catalyst-cloud/cli 0.16.21 → 0.16.22

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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.16.22
4
+
5
+ A self-hosted Linux machine set up over SSH now keeps updating after you log out, with no `sudo` step. Setup turns on lingering for your user by itself, and says so along with how to undo it (`loginctl disable-linger $USER`). Only when the machine does not allow that does setup name the one `sudo loginctl enable-linger $USER` command, and it says updates stop at logout until you run it. `catalyst runner auto-update status` now says whether updates keep running after you log out. For a machine you already set up, install this version and run `catalyst runner auto-update on`.
6
+
3
7
  ## 0.16.21
4
8
 
5
9
  `catalyst accounts` now leaves out removed AI accounts: ones an admin revoked, or whose paid access ended. They take no work and take no new credential, so they no longer appear as accounts to repair. The list says how many it left out, and `catalyst accounts --all` shows them, marked "removed — kept for history". Setup now names a revoked account as ended instead of asking you to turn it on. Update the Catalyst plugin's skills along with the CLI: setup's account check uses `--all`, which older CLIs do not know.
@@ -82,6 +82,21 @@ export function systemdUnits(deps, dir) {
82
82
  ].join("\n"),
83
83
  };
84
84
  }
85
+ /** A user timer runs only while this person's systemd user manager does, and without lingering that
86
+ * manager stops when they log out of a headless machine. */
87
+ function lingering(run, uid) {
88
+ return /Linger=yes/.test(run("loginctl", ["show-user", String(uid), "--property=Linger"]).stdout);
89
+ }
90
+ /** Turn lingering on for this person when it is off. On most distributions polkit lets a user in an
91
+ * active session, SSH included, do this without sudo (CTC-6264). --no-ask-password: a refusal must
92
+ * come back as an answer, never as a prompt. Returns the state read back afterwards. */
93
+ function ensureLingering(run, uid) {
94
+ if (lingering(run, uid))
95
+ return { linger: true, turnedOn: false };
96
+ run("loginctl", ["--no-ask-password", "enable-linger"]);
97
+ const linger = lingering(run, uid);
98
+ return { linger, turnedOn: linger };
99
+ }
85
100
  function writeFileAtomic(path, text) {
86
101
  mkdirSync(dirname(path), { recursive: true });
87
102
  const temp = `${path}.${process.pid}.tmp`;
@@ -103,7 +118,10 @@ export function autoUpdateStatus(deps) {
103
118
  if (!existsSync(timer))
104
119
  return { state: "off", detail: "no_timer" };
105
120
  const enabled = run("systemctl", ["--user", "is-enabled", `${AUTO_UPDATE_UNIT}.timer`]);
106
- return enabled.status === 0 ? { state: "on", detail: "timer_enabled", path: timer } : { state: "off", detail: "timer_not_enabled" };
121
+ if (enabled.status !== 0)
122
+ return { state: "off", detail: "timer_not_enabled" };
123
+ const linger = lingering(run, deps.uid ?? process.getuid?.() ?? 0);
124
+ return { state: "on", detail: linger ? "timer_enabled" : "timer_enabled_without_linger", path: timer, linger };
107
125
  }
108
126
  return { state: "unsupported", detail: `platform_${platform}` };
109
127
  }
@@ -139,13 +157,14 @@ export function enableAutoUpdate(deps, dir) {
139
157
  const enabled = run("systemctl", ["--user", "enable", "--now", `${AUTO_UPDATE_UNIT}.timer`]);
140
158
  if (enabled.status !== 0)
141
159
  return { state: "off", detail: `systemctl_enable_failed:${enabled.stderr.trim().slice(0, 160)}` };
142
- // Without lingering, a user timer stops when this person logs out of a headless machine.
143
- const linger = run("loginctl", ["show-user", String(deps.uid ?? process.getuid?.() ?? 0), "--property=Linger"]);
144
- return { state: "on", detail: /Linger=yes/.test(linger.stdout) ? "timer_enabled" : "timer_enabled_without_linger", path: paths.timer };
160
+ const { linger, turnedOn } = ensureLingering(run, deps.uid ?? process.getuid?.() ?? 0);
161
+ return { state: "on", detail: linger ? "timer_enabled" : "timer_enabled_without_linger", path: paths.timer, linger,
162
+ ...(turnedOn ? { lingerTurnedOn: true } : {}) };
145
163
  }
146
164
  return { state: "unsupported", detail: `platform_${platform}` };
147
165
  }
148
- /** Stop and remove the schedule's own files. Nothing else. */
166
+ /** Stop and remove the schedule's own files. Nothing else: on Linux it reports lingering but leaves it
167
+ * as it is, because it may have been on before setup turned it on. */
149
168
  export function disableAutoUpdate(deps) {
150
169
  const platform = deps.platform ?? process.platform;
151
170
  const run = deps.run ?? defaultRun;
@@ -164,7 +183,7 @@ export function disableAutoUpdate(deps) {
164
183
  if (existsSync(path))
165
184
  unlinkSync(path);
166
185
  run("systemctl", ["--user", "daemon-reload"]);
167
- return { state: "off", detail: "timer_removed" };
186
+ return { state: "off", detail: "timer_removed", linger: lingering(run, deps.uid ?? process.getuid?.() ?? 0) };
168
187
  }
169
188
  return { state: "unsupported", detail: `platform_${platform}` };
170
189
  }
@@ -14,12 +14,21 @@ function schedulerDeps(ctx, deps) {
14
14
  };
15
15
  }
16
16
  function statusLine(status) {
17
- if (status.state === "on")
18
- return status.detail === "timer_enabled_without_linger"
19
- ? "Automatic runner updates are on, every 15 minutes while you are logged in. To keep them running after you log out, run: sudo loginctl enable-linger $USER"
17
+ if (status.state === "on") {
18
+ if (status.linger === false)
19
+ return "Automatic runner updates are on, but they stop when you log out: this machine did not let you keep your user services running. Run this once to keep them running: sudo loginctl enable-linger $USER";
20
+ if (status.lingerTurnedOn)
21
+ return "Automatic runner updates are on: this machine checks for an approved release every 15 minutes, and keeps checking after you log out. To do that, setup turned on lingering for you, which keeps your user services running after logout. To undo it: loginctl disable-linger $USER";
22
+ return status.linger
23
+ ? "Automatic runner updates are on: this machine checks for an approved release every 15 minutes, and keeps checking after you log out."
20
24
  : "Automatic runner updates are on: this machine checks for an approved release every 15 minutes.";
21
- if (status.state === "off")
22
- return `Automatic runner updates are off (${status.detail}). Turn them on with: catalyst runner auto-update on`;
25
+ }
26
+ if (status.state === "off") {
27
+ const off = `Automatic runner updates are off (${status.detail}). Turn them on with: catalyst runner auto-update on`;
28
+ return status.linger
29
+ ? `${off}. Lingering is still on for you, which keeps your user services running after logout. If nothing else needs it: loginctl disable-linger $USER`
30
+ : off;
31
+ }
23
32
  if (status.detail === "no_systemd_user_manager")
24
33
  return "Automatic runner updates need your systemd user manager, which is not running for you. Run: sudo loginctl enable-linger $USER, then catalyst runner auto-update on";
25
34
  return `Automatic runner updates are not available on this machine (${status.detail}). Run catalyst runner update yourself.`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@catalyst-cloud/cli",
3
- "version": "0.16.21",
3
+ "version": "0.16.22",
4
4
  "description": "Set up Catalyst Cloud, check your tickets and manage your account from the command line.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -53,16 +53,16 @@
53
53
  "prepublishOnly": "node scripts/release-train-check.mjs --publish cli"
54
54
  },
55
55
  "dependencies": {
56
- "@catalyst-cloud/sdk": "0.16.6",
56
+ "@catalyst-cloud/sdk": "0.16.9",
57
57
  "@clack/prompts": "1.8.1",
58
58
  "fast-string-width": "3.0.2",
59
59
  "fast-wrap-ansi": "0.2.2",
60
60
  "smol-toml": "^1.7.1",
61
61
  "yaml": "^2.9.0",
62
- "@catalyst-cloud/sdk-replica-node": "0.16.6"
62
+ "@catalyst-cloud/sdk-replica-node": "0.16.9"
63
63
  },
64
64
  "devDependencies": {
65
- "@catalyst-cloud/schema": "0.16.5",
65
+ "@catalyst-cloud/schema": "0.16.7",
66
66
  "@types/node": "^26.3.0",
67
67
  "@vitest/coverage-v8": "^4.1.11",
68
68
  "typescript": "^7.0.2",
@@ -4,7 +4,7 @@ description: >-
4
4
  Catalyst's GitHub: show a ticket's pull request with its checks, reviews and review threads, say whether it is mergeable under this repository's policy, and explain what a PR accumulates as the ticket moves (the branch, the draft, the rewrite, the force-pushes, the labels, the queue). Use when someone asks "show me the PR", "what are the checks saying", "why hasn't it merged", "what does the queue need", "what does that label mean", or wants the branch and merge conventions Catalyst follows.
5
5
  allowed-tools: Bash(catalyst:*) Bash(npx -p @catalyst-cloud/cli catalyst:*)
6
6
  ---
7
- <!-- vendored-from: @catalyst-cloud/catalyst-skills@0.16.21 — written in this repository for customer accounts -->
7
+ <!-- vendored-from: @catalyst-cloud/catalyst-skills@0.16.22 — written in this repository for customer accounts -->
8
8
 
9
9
  # Catalyst's GitHub
10
10
 
@@ -4,7 +4,7 @@ description: >-
4
4
  Catalyst's view of Linear on the customer's own cloud account. Reads a ticket with its comments, relations, labels, linked pull requests and agent sessions inline, from the cloud API by default, with local replica reads available as an explicit opt-in, always naming the source; searches tickets, PRs, projects and initiatives; writes comments, card moves, labels and new tickets through the account's agent proxy as the app actor, with every route, stage id, label id and marker read from the account's contract. Knows what a ticket accumulates as Catalyst works it (phase-outcome comments, the document per phase, the agent session, the labels, the single blocks relation, the bookkeeping marker, the eyes acknowledgement). Use when a person says "show me the ticket", "what did Catalyst write on it", "comment on it", "move it", "label it" or "file a ticket". Not for raising a decision for a human (what-needs-me) and not for pull requests (catalyst-github).
5
5
  allowed-tools: Bash(catalyst:*) Bash(npx -p @catalyst-cloud/cli catalyst:*)
6
6
  ---
7
- <!-- vendored-from: @catalyst-cloud/catalyst-skills@0.16.21 — written in this repository for customer accounts -->
7
+ <!-- vendored-from: @catalyst-cloud/catalyst-skills@0.16.22 — written in this repository for customer accounts -->
8
8
 
9
9
  # Catalyst Linear
10
10
 
@@ -4,7 +4,7 @@ description: >-
4
4
  Set up Catalyst Cloud and say whether setup is working. Walks a person from nothing to their first ticket running, one step at a time: the coding account, the project, the integrations and connected accounts, each repository's settings file, then one real ticket moving. Also logs this machine in, reads the readiness verdict with who can fix each failure, and checks the optional local replica. Use when someone says "set me up", "onboard me", "I just signed up", "get me started", "what do I do first", "log me in", "which account is this machine on", "am I set up", "what is missing", "why does nothing happen" or "is the replica running", when a login expired, or when a skill script exits 2 saying this machine is not connected. Does every step a key can do through the catalyst CLI, hands over the exact page for the steps only a browser can do, and never claims a step it did not watch succeed.
5
5
  allowed-tools: Bash(catalyst:*) Bash(npx -p @catalyst-cloud/cli catalyst:*)
6
6
  ---
7
- <!-- vendored-from: @catalyst-cloud/catalyst-skills@0.16.21 — written in this repository for customer accounts -->
7
+ <!-- vendored-from: @catalyst-cloud/catalyst-skills@0.16.22 — written in this repository for customer accounts -->
8
8
 
9
9
  # Onboard me
10
10
 
@@ -4,7 +4,7 @@ description: >-
4
4
  Own one Catalyst Cloud project end to end until it closes. Use when the person says "run this project for me", "own this until it ships", "keep this moving", or hands you a project id or a set of tickets to drive. Subscribes to the account's event stream for the scope through the catalyst CLI, reacts to each change in the same turn, makes tickets ready and moves them to dispatch, parks what should stop, chases stalls, escalates inward, and keeps one status summary current. Writes to Linear as the app actor; never polls.
5
5
  allowed-tools: Bash(catalyst:*) Bash(npx -p @catalyst-cloud/cli catalyst:*)
6
6
  ---
7
- <!-- vendored-from: @catalyst-cloud/catalyst-skills@0.16.21 — written in this repository for customer accounts -->
7
+ <!-- vendored-from: @catalyst-cloud/catalyst-skills@0.16.22 — written in this repository for customer accounts -->
8
8
 
9
9
  # Run this project
10
10
 
@@ -4,7 +4,7 @@ description: >-
4
4
  Get a stuck Catalyst Cloud ticket moving again. Use when the person asks "why is this parked and can you release it?", "unpark this", "get things flowing again", "the outage is over, retry what failed", or hands you a ticket that is not moving. Reads why nothing runs and what holds the ticket through the catalyst CLI, decides whether the recorded cause is fixed, previews the release, releases every governor holding the ticket the right way (or one failure class across a team), and raises an ask only for what a person has to do. Never releases a cause it cannot show changed without saying so.
5
5
  allowed-tools: Bash(catalyst:*) Bash(npx -p @catalyst-cloud/cli catalyst:*)
6
6
  ---
7
- <!-- vendored-from: @catalyst-cloud/catalyst-skills@0.16.21 — written in this repository for customer accounts -->
7
+ <!-- vendored-from: @catalyst-cloud/catalyst-skills@0.16.22 — written in this repository for customer accounts -->
8
8
 
9
9
  # Unstick
10
10
 
@@ -4,7 +4,7 @@ description: >-
4
4
  The human's decision inbox on Catalyst Cloud, and the one way an agent raises a decision on their behalf. Use when the person asks "what needs me?", "what am I blocking?", or when active work is gated on a choice only they can make. Lists open asks ranked by how much open work each one holds, files an ask through the cloud's ask route with the account's own template, and records the answer so the held work releases. Never answers as the human, never duplicates an open ask.
5
5
  allowed-tools: Bash(catalyst:*) Bash(npx -p @catalyst-cloud/cli catalyst:*)
6
6
  ---
7
- <!-- vendored-from: @catalyst-cloud/catalyst-skills@0.16.21 — written in this repository for customer accounts -->
7
+ <!-- vendored-from: @catalyst-cloud/catalyst-skills@0.16.22 — written in this repository for customer accounts -->
8
8
 
9
9
  # What needs me
10
10
 
@@ -4,7 +4,7 @@ description: >-
4
4
  What environment variable names does this repository need, and where does each one come from? Scans the repository offline (no login, no network) and lists the names in three groups (build/test, deploy-only, bindings), each with where it was found, what uses it, and where a local value would come from. Never reads a value or prints one. Also checks the environment variable table in `.catalyst/catalyst.toml` offline. Use when someone asks "what does catalyst.env.json mean", "what env vars does this repo need", "why does the container need this", or before reviewing or writing the declaration.
5
5
  allowed-tools: Bash(catalyst:*) Bash(npx -p @catalyst-cloud/cli catalyst:*)
6
6
  ---
7
- <!-- vendored-from: @catalyst-cloud/catalyst-skills@0.16.21 — written in this repository for customer accounts -->
7
+ <!-- vendored-from: @catalyst-cloud/catalyst-skills@0.16.22 — written in this repository for customer accounts -->
8
8
 
9
9
  # What this repository needs
10
10
 
@@ -4,7 +4,7 @@ description: >-
4
4
  Use for "what's happening?", "what machines do we have?", "how much capacity do we have?", "where are we?", "why is that stuck?", "what closed?", "what's next?", "how does this work?", "why did it do that?", "how does it prioritise?" and "what does this setting do, where is it set?" in Catalyst Cloud, or asks for something to be done rather than known. Reads the contract via catalyst CLI. Read-only: route work/decisions, never answer as the human.
5
5
  allowed-tools: Bash(catalyst:*) Bash(npx -p @catalyst-cloud/cli catalyst:*)
6
6
  ---
7
- <!-- vendored-from: @catalyst-cloud/catalyst-skills@0.16.21 — written in this repository for customer accounts -->
7
+ <!-- vendored-from: @catalyst-cloud/catalyst-skills@0.16.22 — written in this repository for customer accounts -->
8
8
 
9
9
  # What's happening
10
10