@catalyst-cloud/cli 0.16.4 → 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,13 @@
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
+
7
+ ## 0.16.6
8
+
9
+ On macOS, setup verifies access to your workspace files before starting work and gives a repair step when that check fails.
10
+
3
11
  ## 0.16.4
4
12
 
5
13
  Setup keeps this computer's saved disk limits when it updates the service that runs your work.
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
  }
@@ -128,6 +128,7 @@ const REASONS = {
128
128
  runner_container_host_unreachable: "A container could not reach this Mac. Enable container-to-host networking in your Docker VM and allow the setup process through the Mac firewall, then run catalyst onboard --runner.",
129
129
  runner_container_network_unreachable: "A container could not reach Catalyst's health endpoint. Check the Docker VM's DNS, proxy and outbound HTTPS access, then run catalyst onboard --runner.",
130
130
  runner_engine_probe_unavailable: "Setup could not complete the container capability probe. Check Docker access and the pinned supervisor image, then run catalyst onboard --runner. Setup has not enrolled or started this machine.",
131
+ runner_thoughts_custody_unavailable: "Setup could not verify protected access to this Mac's shared work files. Keep their ownership and permissions. Check Docker access, then run catalyst onboard --runner. If the check still fails, ask Catalyst support to inspect it.",
131
132
  runner_installation_unverified: "Setup found a possible existing machine installation but could not verify its Compose files and identity. Keep its files and credentials. Run docker compose -p catalyst-host logs supervisor to check it, then run catalyst setup --runner again.",
132
133
  runner_enrollment_unavailable: "Setup could not read this workspace's runner hosts. Run catalyst onboard again to retry.",
133
134
  runner_enrolled_for_other_team: "This runner is enrolled for another Linear team. Keep using that team, or ask your administrator to revoke the old enrollment before setting up this machine for the selected team.",