@catalyst-cloud/cli 0.16.6 → 0.16.7

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.7
4
+
5
+ Setup can update an existing installation that still runs its saved, older image version. Headless setup names which key input Catalyst rejected and shows how to try a saved personal login when one is available. Installer checks leave existing skill files in place until the installer updates them.
6
+
3
7
  ## 0.16.6
4
8
 
5
9
  On macOS, setup verifies access to your workspace files before starting work and gives a repair step when that check fails.
package/dist/config.js CHANGED
@@ -118,10 +118,12 @@ export function normalizeBaseUrl(url) {
118
118
  export function apiBase(cfg) {
119
119
  return `${normalizeBaseUrl(cfg.baseUrl)}/api/v1`;
120
120
  }
121
- /** True when the Catalyst installer owns skill placement on this machine: it exports
122
- * CATALYST_SKILLS_DIR, or it wrote the machine paths file (every v1 record carries a skills role).
121
+ /** True when the Catalyst installer owns skill placement on this machine: it marks the current
122
+ * install, exports CATALYST_SKILLS_DIR, or wrote the machine paths file (every v1 record carries a skills role).
123
123
  * The CLI then never refreshes skill folders itself; the installer's own refresh does. */
124
124
  export function installerOwnsSkills(home, env = {}) {
125
+ if (env.CATALYST_INSTALL_SKILLS_OWNER === "1")
126
+ return true;
125
127
  if (env.CATALYST_SKILLS_DIR !== undefined && env.CATALYST_SKILLS_DIR !== "")
126
128
  return true;
127
129
  try {
@@ -403,14 +403,14 @@ function contractCode(code) {
403
403
  : EXIT_FAILED;
404
404
  }
405
405
  const notPersonal = (keys) => keyItem("account_key_not_personal", `This is the account's host key. Onboarding acts as a person: mint a personal key at ${keys} and supply that instead.`, keys);
406
- function loginItem(error, baseUrl) {
406
+ function loginItem(error, baseUrl, source, keyFileFlag, savedPersonalLogin) {
407
407
  const url = pages(baseUrl);
408
408
  if (error instanceof CliError && error.code === "onboard-person-required")
409
409
  return { code: EXIT_REFUSED, item: notPersonal(url.keys) };
410
410
  if (error instanceof MeError && error.kind === "http" && (error.status === 401 || error.status === 403))
411
411
  return {
412
412
  code: EXIT_WAITING,
413
- item: keyItem("account_key_rejected", `Catalyst did not accept the supplied key. Mint a personal key at ${url.keys} and supply it again.`, url.keys),
413
+ item: keyItem("account_key_rejected", `Catalyst did not accept the key from ${source === "env" ? "CATALYST_CLOUD_TOKEN" : keyFileFlag ? "the file named by --key-file" : "the file named by CATALYST_CLOUD_TOKEN_FILE"}. ${savedPersonalLogin ? `This machine has a saved personal login for ${baseUrl}. ${source === "env" ? "Unset CATALYST_CLOUD_TOKEN" : keyFileFlag ? "Remove --key-file" : "Unset CATALYST_CLOUD_TOKEN_FILE"} and run the same command to try it.` : `Mint a personal key at ${url.keys} and supply it again.`}`, url.keys),
414
414
  };
415
415
  return {
416
416
  code: EXIT_FAILED,
@@ -494,6 +494,7 @@ export async function runOnboardHeadless(args, ctx, hooks, cliVersion) {
494
494
  catch {
495
495
  saved = null;
496
496
  }
497
+ const savedPersonalLogin = Boolean(saved?.user && normalizeBaseUrl(saved.baseUrl) === baseUrl);
497
498
  const current = saved?.key === plan.key && normalizeBaseUrl(saved.baseUrl) === baseUrl;
498
499
  if (!current) {
499
500
  let me;
@@ -501,7 +502,7 @@ export async function runOnboardHeadless(args, ctx, hooks, cliVersion) {
501
502
  me = await fetchMe(baseUrl, plan.key, ctx.fetch);
502
503
  }
503
504
  catch (error) {
504
- const { item, code } = loginItem(error, baseUrl);
505
+ const { item, code } = loginItem(error, baseUrl, report.inputs.accountKey === "file" ? "file" : "env", typeof args.flags["key-file"] === "string", savedPersonalLogin);
505
506
  return early(code, item);
506
507
  }
507
508
  if (!me.user)
@@ -529,7 +530,7 @@ export async function runOnboardHeadless(args, ctx, hooks, cliVersion) {
529
530
  throw new CliError("key login failed", "key-login-failed", EXIT_FAILED);
530
531
  }
531
532
  catch (error) {
532
- const { item, code } = loginItem(error, baseUrl);
533
+ const { item, code } = loginItem(error, baseUrl, report.inputs.accountKey === "file" ? "file" : "env", typeof args.flags["key-file"] === "string", savedPersonalLogin);
533
534
  return early(code, item);
534
535
  }
535
536
  }
@@ -200,7 +200,7 @@ export function dockerRunnerEngine(deps = {}) {
200
200
  const config = rows[0]?.Config;
201
201
  const labels = config?.Labels;
202
202
  const dir = labels?.["com.docker.compose.project.working_dir"];
203
- if (config?.Image !== supervisorImage || labels?.["com.docker.compose.project"] !== RUNNER_PROJECT ||
203
+ if (labels?.["com.docker.compose.project"] !== RUNNER_PROJECT ||
204
204
  labels?.["com.docker.compose.service"] !== "supervisor" || typeof dir !== "string" || !isAbsolute(dir))
205
205
  return "unverified";
206
206
  const inHome = relative(realpathSync(home), realpathSync(dir));
@@ -242,6 +242,16 @@ export function dockerRunnerEngine(deps = {}) {
242
242
  const baseUrl = origins[0].slice("CATALYST_MIRROR_URL=".length);
243
243
  if (!HOST_NAME.test(hostName))
244
244
  return "unverified";
245
+ // A running older pin is still ours only when the self-owned Compose environment
246
+ // names that exact pinned image and the same runtime identity. Setup can then move it
247
+ // to the desired pin after the normal enrollment and custody checks.
248
+ if (config.Image !== supervisorImage &&
249
+ (!saved || !IMAGE_REF.test(saved.CATALYST_SUPERVISOR_IMAGE ?? "") ||
250
+ config.Image !== saved.CATALYST_SUPERVISOR_IMAGE ||
251
+ saved.CATALYST_SUPERVISOR_IMAGE.split("@sha256:")[0] !== supervisorImage.split("@sha256:")[0] ||
252
+ saved.CATALYST_HOST_NAME !== hostName ||
253
+ normalizeBaseUrl(saved.CATALYST_MIRROR_URL ?? "") !== normalizeBaseUrl(baseUrl)))
254
+ return "unverified";
245
255
  return { dir, hostName, baseUrl: normalizeBaseUrl(baseUrl) };
246
256
  }
247
257
  catch {
@@ -448,6 +448,8 @@ export function createClackOnboardUi(prompts, streams, deps = {}) {
448
448
  stop();
449
449
  if (abort.signal.aborted)
450
450
  return null;
451
+ if (!interactive)
452
+ return "move-on";
451
453
  const answer = await select({
452
454
  ...options,
453
455
  message: "What should setup do with this workspace's projects?",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@catalyst-cloud/cli",
3
- "version": "0.16.6",
3
+ "version": "0.16.7",
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",
@@ -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.6 — written in this repository for customer accounts -->
7
+ <!-- vendored-from: @catalyst-cloud/catalyst-skills@0.16.7 — 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.6 — written in this repository for customer accounts -->
7
+ <!-- vendored-from: @catalyst-cloud/catalyst-skills@0.16.7 — 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.6 — written in this repository for customer accounts -->
7
+ <!-- vendored-from: @catalyst-cloud/catalyst-skills@0.16.7 — 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.6 — written in this repository for customer accounts -->
7
+ <!-- vendored-from: @catalyst-cloud/catalyst-skills@0.16.7 — 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.6 — written in this repository for customer accounts -->
7
+ <!-- vendored-from: @catalyst-cloud/catalyst-skills@0.16.7 — 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.6 — written in this repository for customer accounts -->
7
+ <!-- vendored-from: @catalyst-cloud/catalyst-skills@0.16.7 — 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.6 — written in this repository for customer accounts -->
7
+ <!-- vendored-from: @catalyst-cloud/catalyst-skills@0.16.7 — 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.6 — written in this repository for customer accounts -->
7
+ <!-- vendored-from: @catalyst-cloud/catalyst-skills@0.16.7 — written in this repository for customer accounts -->
8
8
 
9
9
  # What's happening
10
10