@catalyst-cloud/cli 0.14.3 → 0.14.5

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/dist/onboard.js CHANGED
@@ -3,7 +3,7 @@ import { chmodSync, existsSync, lstatSync, mkdirSync, readFileSync, renameSync,
3
3
  import { createReadStream, createWriteStream } from "node:fs";
4
4
  import { createInterface } from "node:readline/promises";
5
5
  import { dirname, isAbsolute, join } from "node:path";
6
- import { parseMachinePaths, resolveCatalystPath } from "../vendor/paths/index.js";
6
+ import { parseMachinePaths, resolveCatalystPath, } from "../vendor/paths/index.js";
7
7
  import { machinePathsFile } from "../vendor/paths/node.js";
8
8
  import { CliError, UsageError } from "./errors.js";
9
9
  export const ONBOARD_STEPS = [
@@ -44,7 +44,8 @@ export function onboardStateRoot(home, env = {}) {
44
44
  try {
45
45
  const pathsFile = machinePathsFile({ env: { ...env, HOME: home } });
46
46
  const machine = pathsFile && existsSync(pathsFile)
47
- ? parseMachinePaths(JSON.parse(readFileSync(pathsFile, "utf8"))) : undefined;
47
+ ? parseMachinePaths(JSON.parse(readFileSync(pathsFile, "utf8")))
48
+ : undefined;
48
49
  if (env.CATALYST_PATHS_FILE && !machine)
49
50
  throw new CliError("the selected machine paths file is missing", "onboard-state-path", EXIT_REFUSED);
50
51
  if (env.CATALYST_STATE_DIR !== undefined || machine)
@@ -64,29 +65,66 @@ export function onboardLockPath(home, env = {}) {
64
65
  return join(onboardStateRoot(home, env), "install.lock");
65
66
  }
66
67
  export const ONBOARD_DEPENDENCIES = {
67
- "linear.workspace": ["signin"], "linear.personal": ["signin", "linear.workspace"],
68
+ "linear.workspace": ["signin"],
69
+ "linear.personal": ["signin", "linear.workspace"],
68
70
  "linear.team": ["signin", "linear.workspace", "linear.personal"],
69
- "linear.adopt": ["linear.team"], "linear.automations": ["linear.team", "linear.personal"],
70
- "github.install": ["signin"], "github.personal": ["signin"], "github.repos": ["github.install", "linear.team"],
71
- projects: ["linear.team", "github.repos"], accounts: ["signin"], settings: ["projects"],
72
- values: ["settings"], capacity: ["projects"], daemon: ["signin"],
73
- "first-ticket": ["projects", "linear.adopt", "linear.automations", "accounts", "settings", "values", "capacity", "daemon"],
71
+ "linear.adopt": ["linear.team"],
72
+ "linear.automations": ["linear.team", "linear.personal"],
73
+ "github.install": ["signin"],
74
+ "github.personal": ["signin"],
75
+ "github.repos": ["github.install", "linear.team"],
76
+ projects: ["linear.team", "github.repos"],
77
+ accounts: ["signin"],
78
+ settings: ["projects"],
79
+ values: ["settings"],
80
+ capacity: ["projects"],
81
+ daemon: ["signin"],
82
+ "first-ticket": [
83
+ "projects",
84
+ "linear.adopt",
85
+ "linear.automations",
86
+ "accounts",
87
+ "settings",
88
+ "values",
89
+ "capacity",
90
+ "daemon",
91
+ ],
74
92
  };
75
93
  const ADMIN_STEPS = new Set([
76
- "linear.workspace", "linear.adopt", "linear.automations", "github.install",
77
- "github.repos", "projects", "settings", "values", "capacity", "first-ticket",
94
+ "linear.workspace",
95
+ "linear.adopt",
96
+ "linear.automations",
97
+ "github.install",
98
+ "github.repos",
99
+ "projects",
100
+ "settings",
101
+ "values",
102
+ "capacity",
103
+ "first-ticket",
78
104
  ]);
79
105
  export const ONBOARD_TITLES = {
80
- machine: "Check this computer", cli: "Check the catalyst command", skills: "Check the Catalyst skills",
81
- legacy: "Remove earlier Catalyst installs", signin: "Sign in to Catalyst",
82
- "linear.workspace": "Connect your Linear workspace", "linear.personal": "Connect your Linear account",
83
- "linear.team": "Choose a Linear team", "linear.adopt": "Apply the Catalyst workflow",
84
- "linear.automations": "Check Linear's pull request automations", "github.install": "Install Catalyst on GitHub",
106
+ machine: "Check this computer",
107
+ cli: "Check the catalyst command",
108
+ skills: "Check the Catalyst skills",
109
+ legacy: "Remove earlier Catalyst installs",
110
+ signin: "Sign in to Catalyst",
111
+ "linear.workspace": "Connect your Linear workspace",
112
+ "linear.personal": "Connect your Linear account",
113
+ "linear.team": "Choose a Linear team",
114
+ "linear.adopt": "Apply the Catalyst workflow",
115
+ "linear.automations": "Check Linear's pull request automations",
116
+ "github.install": "Install Catalyst on GitHub",
85
117
  "github.personal": "Connect your GitHub account",
86
- "github.repos": "Choose repositories", projects: "Register your projects", accounts: "Check coding accounts",
87
- settings: "Review repository settings", values: "Import selected local values", capacity: "Check runner capacity",
88
- daemon: "Check optional local sync", housekeeping: "Schedule the daily update",
89
- "first-ticket": "Start a first ticket", ready: "Check onboarding readiness",
118
+ "github.repos": "Choose repositories",
119
+ projects: "Register your projects",
120
+ accounts: "Check coding accounts",
121
+ settings: "Review repository settings",
122
+ values: "Import selected local values",
123
+ capacity: "Check runner capacity",
124
+ daemon: "Check optional local sync",
125
+ housekeeping: "Schedule the daily update",
126
+ "first-ticket": "Start a first ticket",
127
+ ready: "Check onboarding readiness",
90
128
  };
91
129
  function isoNow(ctx, deps) {
92
130
  return (deps.now ?? ctx.now)().toISOString();
@@ -172,10 +210,36 @@ function normalizeStep(value, fallbackAt) {
172
210
  "found",
173
211
  "remaining",
174
212
  "count",
175
- "version", "account", "membershipId", "checkedAt", "project", "repository", "ticket",
176
- "cursor", "lag", "heartbeatAgeMs", "supervised", "streaming", "scheduled", "validated",
177
- "available", "phaseStarted", "linearComment", "fleetActivity", "requiredValues", "paused",
178
- "revision", "hash", "path", "provider", "scope", "checks", "passed", "team", "teamKey",
213
+ "version",
214
+ "account",
215
+ "membershipId",
216
+ "checkedAt",
217
+ "project",
218
+ "repository",
219
+ "installation",
220
+ "ticket",
221
+ "cursor",
222
+ "lag",
223
+ "heartbeatAgeMs",
224
+ "supervised",
225
+ "streaming",
226
+ "scheduled",
227
+ "validated",
228
+ "available",
229
+ "phaseStarted",
230
+ "linearComment",
231
+ "fleetActivity",
232
+ "requiredValues",
233
+ "paused",
234
+ "revision",
235
+ "hash",
236
+ "path",
237
+ "provider",
238
+ "scope",
239
+ "checks",
240
+ "passed",
241
+ "team",
242
+ "teamKey",
179
243
  ]) {
180
244
  const item = evidence?.[key];
181
245
  if (item === null ||
@@ -226,13 +290,25 @@ export function readOnboardJournal(path, cliVersion = "0.13.1", now = new Date()
226
290
  : exit,
227
291
  steps: [...deduped.values()],
228
292
  ...(typeof value.account === "string" ? { account: value.account } : {}),
229
- ...(typeof value.membershipId === "string" ? { membershipId: value.membershipId } : {}),
293
+ ...(typeof value.membershipId === "string"
294
+ ? { membershipId: value.membershipId }
295
+ : {}),
230
296
  ...(typeof value.baseUrl === "string" ? { baseUrl: value.baseUrl } : {}),
231
- ...(value.scope === "step" || value.scope === "onboarding" ? { scope: value.scope } : {}),
232
- ...(value.mode === "plan" || value.mode === "run" ? { mode: value.mode } : {}),
233
- ...(typeof value.complete === "boolean" ? { complete: value.complete } : {}),
234
- ...(typeof value.localSync === "boolean" ? { localSync: value.localSync } : {}),
235
- operations: Object.fromEntries(Object.entries(object(value.operations) ?? {}).filter(([key, v]) => ONBOARD_STEPS.includes(key) && typeof v === "string" && /^[a-zA-Z0-9_.:-]{1,160}$/.test(v))),
297
+ ...(value.scope === "step" || value.scope === "onboarding"
298
+ ? { scope: value.scope }
299
+ : {}),
300
+ ...(value.mode === "plan" || value.mode === "run"
301
+ ? { mode: value.mode }
302
+ : {}),
303
+ ...(typeof value.complete === "boolean"
304
+ ? { complete: value.complete }
305
+ : {}),
306
+ ...(typeof value.localSync === "boolean"
307
+ ? { localSync: value.localSync }
308
+ : {}),
309
+ operations: Object.fromEntries(Object.entries(object(value.operations) ?? {}).filter(([key, v]) => ONBOARD_STEPS.includes(key) &&
310
+ typeof v === "string" &&
311
+ /^[a-zA-Z0-9_.:-]{1,160}$/.test(v))),
236
312
  changes: Array.isArray(value.changes)
237
313
  ? value.changes.flatMap((change) => {
238
314
  const row = object(change);
@@ -384,7 +460,9 @@ function acquireLock(ctx, deps) {
384
460
  const handoff = ctx.env.CATALYST_INSTALL_LOCK_TOKEN;
385
461
  if (current?.pid === pid && current.token !== "" && current.token === handoff)
386
462
  return { path, owner: current };
387
- const ownerIsAlive = current ? (deps.isProcessAlive ?? defaultAlive)(current.pid) : false;
463
+ const ownerIsAlive = current
464
+ ? (deps.isProcessAlive ?? defaultAlive)(current.pid)
465
+ : false;
388
466
  if (current && ownerIsAlive)
389
467
  throw new CliError(`setup is already running (pid ${current.pid}); wait for it to finish, then run the same command`, "onboard-locked", EXIT_FAILED);
390
468
  if (!current)
@@ -421,7 +499,13 @@ function freshJournal(ctx, cliVersion, deps) {
421
499
  }
422
500
  /** A refusal before loading state must not reuse or copy an unreadable receipt. */
423
501
  export function onboardErrorJournal(ctx, cliVersion, exit) {
424
- return { ...freshJournal(ctx, cliVersion, {}), scope: "onboarding", mode: "run", exit, complete: false };
502
+ return {
503
+ ...freshJournal(ctx, cliVersion, {}),
504
+ scope: "onboarding",
505
+ mode: "run",
506
+ exit,
507
+ complete: false,
508
+ };
425
509
  }
426
510
  function planJournal(journal) {
427
511
  return {
@@ -472,14 +556,20 @@ async function confirmContinue(ctx, args, deps) {
472
556
  }
473
557
  }
474
558
  function sanitizedResult(id, result, at) {
475
- const row = normalizeStep({ id, ...result, state: result.state === "refused" ? "failed" : result.state }, at);
559
+ const row = normalizeStep({
560
+ id,
561
+ ...result,
562
+ state: result.state === "refused" ? "failed" : result.state,
563
+ }, at);
476
564
  row.at = at;
477
565
  return row;
478
566
  }
479
567
  function stepSatisfied(step) {
480
- return step?.state === "done" || (step?.state === "skipped" &&
481
- (step.id === "legacy" || step.reason === "member_scope" ||
482
- (step.id === "daemon" && step.reason === "local_sync_not_selected")));
568
+ return (step?.state === "done" ||
569
+ (step?.state === "skipped" &&
570
+ (step.id === "legacy" ||
571
+ step.reason === "member_scope" ||
572
+ (step.id === "daemon" && step.reason === "local_sync_not_selected"))));
483
573
  }
484
574
  function requireMatchingIdentity(journal, identity) {
485
575
  const account = journal.account ?? journal.tenant;
@@ -500,16 +590,23 @@ export async function cmdOnboard(args, ctx, deps = {}, cliVersion = "0.13.1") {
500
590
  throw new UsageError("onboard takes no positional arguments");
501
591
  if (args.json || args.flags.yes === true || args.flags["dry-run"] === true)
502
592
  deps = { ...deps, ui: undefined };
503
- const only = typeof args.flags.only === "string" ? args.flags.only : undefined;
593
+ const only = typeof args.flags.only === "string"
594
+ ? args.flags.only
595
+ : undefined;
504
596
  const memberScopeSkips = (id) => ADMIN_STEPS.has(id) ||
505
- (id === "linear.team" && only !== "linear.team" && typeof args.flags.team !== "string");
506
- const resume = typeof args.flags["resume-from"] === "string" ? args.flags["resume-from"] : undefined;
597
+ (id === "linear.team" &&
598
+ only !== "linear.team" &&
599
+ typeof args.flags.team !== "string");
600
+ const resume = typeof args.flags["resume-from"] === "string"
601
+ ? args.flags["resume-from"]
602
+ : undefined;
507
603
  const resumeFrom = resume === "install" ? "signin" : resume;
508
604
  for (const id of [only, resumeFrom])
509
605
  if (id && !ONBOARD_STEPS.includes(id))
510
606
  throw new UsageError(`unknown onboarding step: ${id}`);
511
607
  const statePath = onboardStatePath(ctx.home, ctx.env);
512
- let journal = readOnboardJournal(statePath, cliVersion, (deps.now ?? ctx.now)()) ?? freshJournal(ctx, cliVersion, deps);
608
+ let journal = readOnboardJournal(statePath, cliVersion, (deps.now ?? ctx.now)()) ??
609
+ freshJournal(ctx, cliVersion, deps);
513
610
  if (args.flags["dry-run"] === true) {
514
611
  if (args.json)
515
612
  ctx.stdout(JSON.stringify(planJournal(journal)));
@@ -529,7 +626,12 @@ export async function cmdOnboard(args, ctx, deps = {}, cliVersion = "0.13.1") {
529
626
  const code = error instanceof CliError ? error.exitCode : EXIT_FAILED;
530
627
  ctx.stderr("Could not verify your Catalyst membership. Setup was not changed. Sign in with the original account to resume.");
531
628
  if (args.json)
532
- ctx.stdout(JSON.stringify({ ...journal, mode: "run", exit: code, complete: false }));
629
+ ctx.stdout(JSON.stringify({
630
+ ...journal,
631
+ mode: "run",
632
+ exit: code,
633
+ complete: false,
634
+ }));
533
635
  return code;
534
636
  }
535
637
  if (deps.ui)
@@ -538,7 +640,11 @@ export async function cmdOnboard(args, ctx, deps = {}, cliVersion = "0.13.1") {
538
640
  printPlan(ctx, journal);
539
641
  const inheritedConsent = resume === "install" && Boolean(ctx.env.CATALYST_INSTALL_LOCK_TOKEN);
540
642
  let localSync = args.flags["local-sync"] === true || journal.localSync === true;
541
- const consent = inheritedConsent ? true : deps.ui ? await deps.ui.confirmPlan(localSync) : await confirmContinue(ctx, args, deps);
643
+ const consent = inheritedConsent
644
+ ? true
645
+ : deps.ui
646
+ ? await deps.ui.confirmPlan(localSync)
647
+ : await confirmContinue(ctx, args, deps);
542
648
  if (typeof consent !== "boolean")
543
649
  localSync = consent.localSync;
544
650
  if (!(typeof consent === "boolean" ? consent : consent.proceed)) {
@@ -560,23 +666,42 @@ export async function cmdOnboard(args, ctx, deps = {}, cliVersion = "0.13.1") {
560
666
  return error.exitCode;
561
667
  }
562
668
  const stop = new AbortController();
563
- const signal = AbortSignal.any([stop.signal, ...(deps.signal ? [deps.signal] : []), ...(deps.ui ? [deps.ui.signal] : [])]);
564
- const stepCtx = { ...ctx, stdout: deps.ui ? (line) => deps.ui.message(line) : args.json ? ctx.stderr : ctx.stdout,
669
+ const signal = AbortSignal.any([
670
+ stop.signal,
671
+ ...(deps.signal ? [deps.signal] : []),
672
+ ...(deps.ui ? [deps.ui.signal] : []),
673
+ ]);
674
+ const stepCtx = {
675
+ ...ctx,
676
+ stdout: deps.ui
677
+ ? (line) => deps.ui.message(line)
678
+ : args.json
679
+ ? ctx.stderr
680
+ : ctx.stdout,
565
681
  stderr: deps.ui ? (line) => deps.ui.message(line) : ctx.stderr,
566
682
  fetch: ((input, init) => ctx.fetch(input, {
567
- ...init, signal: init?.signal ? AbortSignal.any([signal, init.signal]) : signal,
568
- })) };
683
+ ...init,
684
+ signal: init?.signal ? AbortSignal.any([signal, init.signal]) : signal,
685
+ })),
686
+ };
569
687
  let current = null;
570
688
  const interrupted = () => {
571
689
  stop.abort();
572
690
  if (current)
573
- setStep(journal, { id: current, state: "failed", reason: "interrupted", at: isoNow(ctx, deps) });
691
+ setStep(journal, {
692
+ id: current,
693
+ state: "failed",
694
+ reason: "interrupted",
695
+ at: isoNow(ctx, deps),
696
+ });
574
697
  journal.exit = EXIT_WAITING;
575
698
  journal.complete = false;
576
699
  try {
577
700
  writeOnboardJournal(statePath, journal);
578
701
  }
579
- catch { /* keep the last atomic receipt */ }
702
+ catch {
703
+ /* keep the last atomic receipt */
704
+ }
580
705
  };
581
706
  const signals = ["SIGINT", "SIGTERM", "SIGHUP"];
582
707
  if (deps.bindSignals !== false)
@@ -596,13 +721,15 @@ export async function cmdOnboard(args, ctx, deps = {}, cliVersion = "0.13.1") {
596
721
  else if (only && code === 0)
597
722
  ctx.stdout(`${ONBOARD_TITLES[only]} finished. Onboarding still has other steps.`);
598
723
  else
599
- ctx.stdout(`Setup still needs ${journal.steps.filter(step => !stepSatisfied(step)).length} checks.`);
724
+ ctx.stdout(`Setup still needs ${journal.steps.filter((step) => !stepSatisfied(step)).length} checks.`);
600
725
  ctx.stdout("resume: catalyst onboard");
601
726
  }
602
727
  return code;
603
728
  };
604
729
  try {
605
- journal = readOnboardJournal(statePath, cliVersion, (deps.now ?? ctx.now)()) ?? journal;
730
+ journal =
731
+ readOnboardJournal(statePath, cliVersion, (deps.now ?? ctx.now)()) ??
732
+ journal;
606
733
  if (deps.identity)
607
734
  requireMatchingIdentity(journal, identity);
608
735
  journal.cli = cliVersion;
@@ -629,20 +756,30 @@ export async function cmdOnboard(args, ctx, deps = {}, cliVersion = "0.13.1") {
629
756
  for (const id of ONBOARD_STEPS)
630
757
  needed.add(id);
631
758
  const fromIndex = resumeFrom ? ONBOARD_STEPS.indexOf(resumeFrom) : 0;
632
- for (const id of ONBOARD_STEPS.filter(id => needed.has(id))) {
759
+ for (const id of ONBOARD_STEPS.filter((id) => needed.has(id))) {
633
760
  if (signal.aborted)
634
761
  return finish(EXIT_WAITING);
635
762
  current = id;
636
763
  deps.ui?.stepStart(id);
637
764
  // Member onboarding keeps administration outside its scope, with an explicit recorded reason.
638
765
  if (identity?.role === "member" && memberScopeSkips(id)) {
639
- setStep(journal, { id, state: "skipped", reason: "member_scope", at: isoNow(ctx, deps) });
766
+ setStep(journal, {
767
+ id,
768
+ state: "skipped",
769
+ reason: "member_scope",
770
+ at: isoNow(ctx, deps),
771
+ });
640
772
  deps.ui?.stepEnd(journalStep(journal, id));
641
773
  continue;
642
774
  }
643
- const missing = (ONBOARD_DEPENDENCIES[id] ?? []).find(parent => !stepSatisfied(journalStep(journal, parent)));
775
+ const missing = (ONBOARD_DEPENDENCIES[id] ?? []).find((parent) => !stepSatisfied(journalStep(journal, parent)));
644
776
  if (missing) {
645
- setStep(journal, { id, state: "waiting", reason: "prerequisite_not_ready", at: isoNow(ctx, deps) });
777
+ setStep(journal, {
778
+ id,
779
+ state: "waiting",
780
+ reason: "prerequisite_not_ready",
781
+ at: isoNow(ctx, deps),
782
+ });
646
783
  writeOnboardJournal(statePath, journal);
647
784
  deps.ui?.stepEnd(journalStep(journal, id));
648
785
  continue;
@@ -650,23 +787,43 @@ export async function cmdOnboard(args, ctx, deps = {}, cliVersion = "0.13.1") {
650
787
  let adapter = deps.adapters?.[id];
651
788
  // Compatibility for the initial legacy adapter, which performs its own before/after checks.
652
789
  if (!adapter && id === "legacy") {
653
- let result = deps.runStep ? { state: "pending" } : { state: "skipped", reason: "legacy_not_selected" };
654
- adapter = { check: async () => result, act: deps.runStep ? async () => result = await deps.runStep(id, stepCtx) : undefined };
790
+ let result = deps.runStep
791
+ ? { state: "pending" }
792
+ : { state: "skipped", reason: "legacy_not_selected" };
793
+ adapter = {
794
+ check: async () => result,
795
+ act: deps.runStep
796
+ ? async () => (result = await deps.runStep(id, stepCtx))
797
+ : undefined,
798
+ };
655
799
  }
656
800
  if (!adapter) {
657
- setStep(journal, { id, state: "waiting", reason: "step_not_available_in_this_release", at: isoNow(ctx, deps) });
801
+ setStep(journal, {
802
+ id,
803
+ state: "waiting",
804
+ reason: "step_not_available_in_this_release",
805
+ at: isoNow(ctx, deps),
806
+ });
658
807
  writeOnboardJournal(statePath, journal);
659
808
  deps.ui?.stepEnd(journalStep(journal, id));
660
809
  continue;
661
810
  }
662
811
  try {
663
812
  let result = await adapter.check(stepCtx, journal, signal);
664
- if (result.state === "pending" && adapter.act && (!only || id === only) && ONBOARD_STEPS.indexOf(id) >= fromIndex) {
813
+ if (result.state === "pending" &&
814
+ adapter.act &&
815
+ (!only || id === only) &&
816
+ ONBOARD_STEPS.indexOf(id) >= fromIndex) {
665
817
  if (deps.identity) {
666
818
  identity = await deps.identity(journal);
667
819
  requireMatchingIdentity(journal, identity);
668
820
  if (identity?.role === "member" && memberScopeSkips(id)) {
669
- setStep(journal, { id, state: "skipped", reason: "member_scope", at: isoNow(ctx, deps) });
821
+ setStep(journal, {
822
+ id,
823
+ state: "skipped",
824
+ reason: "member_scope",
825
+ at: isoNow(ctx, deps),
826
+ });
670
827
  writeOnboardJournal(statePath, journal);
671
828
  deps.ui?.stepEnd(journalStep(journal, id));
672
829
  continue;
@@ -688,7 +845,12 @@ export async function cmdOnboard(args, ctx, deps = {}, cliVersion = "0.13.1") {
688
845
  identity = await deps.identity(journal);
689
846
  requireMatchingIdentity(journal, identity);
690
847
  if (identity?.role === "member" && memberScopeSkips(id)) {
691
- setStep(journal, { id, state: "skipped", reason: "member_scope", at: isoNow(ctx, deps) });
848
+ setStep(journal, {
849
+ id,
850
+ state: "skipped",
851
+ reason: "member_scope",
852
+ at: isoNow(ctx, deps),
853
+ });
692
854
  writeOnboardJournal(statePath, journal);
693
855
  deps.ui?.stepEnd(journalStep(journal, id));
694
856
  continue;
@@ -704,18 +866,37 @@ export async function cmdOnboard(args, ctx, deps = {}, cliVersion = "0.13.1") {
704
866
  if (result.state === "refused")
705
867
  refused = true;
706
868
  if (result.state === "pending")
707
- result = { ...result, state: "waiting", reason: result.reason ?? "action_required" };
869
+ result = {
870
+ ...result,
871
+ state: "waiting",
872
+ reason: result.reason ?? "action_required",
873
+ };
708
874
  setStep(journal, sanitizedResult(id, result, isoNow(ctx, deps)));
709
875
  }
710
876
  catch (error) {
711
877
  if (error instanceof CliError && error.exitCode === EXIT_REFUSED)
712
878
  refused = true;
713
- const reason = signal.aborted ? "interrupted" : error instanceof CliError && /^[a-z][a-z0-9_-]{1,63}$/.test(error.code) ? error.code.replaceAll("-", "_") : "step_failed";
714
- setStep(journal, { id, state: "failed", reason, at: isoNow(ctx, deps) });
879
+ const reason = signal.aborted
880
+ ? "interrupted"
881
+ : error instanceof CliError &&
882
+ /^[a-z][a-z0-9_-]{1,63}$/.test(error.code)
883
+ ? error.code.replaceAll("-", "_")
884
+ : "step_failed";
885
+ setStep(journal, {
886
+ id,
887
+ state: "failed",
888
+ reason,
889
+ at: isoNow(ctx, deps),
890
+ });
715
891
  stepCtx.stderr(`✗ ${ONBOARD_TITLES[id]}: ${reason}. The safe reason is saved; run the same command to resume.`);
716
892
  }
717
893
  if (signal.aborted) {
718
- setStep(journal, { id, state: "failed", reason: "interrupted", at: isoNow(ctx, deps) });
894
+ setStep(journal, {
895
+ id,
896
+ state: "failed",
897
+ reason: "interrupted",
898
+ at: isoNow(ctx, deps),
899
+ });
719
900
  return finish(EXIT_WAITING);
720
901
  }
721
902
  deps.ui?.stepEnd(journalStep(journal, id));
@@ -725,8 +906,13 @@ export async function cmdOnboard(args, ctx, deps = {}, cliVersion = "0.13.1") {
725
906
  }
726
907
  current = null;
727
908
  const scope = only ? [only] : [...ONBOARD_STEPS];
728
- const code = refused ? EXIT_REFUSED : scope.some(id => journalStep(journal, id)?.state === "failed") ? EXIT_FAILED
729
- : scope.every(id => stepSatisfied(journalStep(journal, id))) ? 0 : EXIT_WAITING;
909
+ const code = refused
910
+ ? EXIT_REFUSED
911
+ : scope.some((id) => journalStep(journal, id)?.state === "failed")
912
+ ? EXIT_FAILED
913
+ : scope.every((id) => stepSatisfied(journalStep(journal, id)))
914
+ ? 0
915
+ : EXIT_WAITING;
730
916
  return finish(code);
731
917
  }
732
918
  catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@catalyst-cloud/cli",
3
- "version": "0.14.3",
3
+ "version": "0.14.5",
4
4
  "description": "Customer skill bundle for Catalyst Cloud, named from the executive's seat \u2014 get set up, see what is happening, see what needs you, run a project, unstick what is stuck \u2014 plus the catalyst CLI that reads through the Catalyst Cloud SDK, writes through the agent proxy, and connects your machine to your cloud account with one command. The skills directory is the roster; this line never counts it.",
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.14.3 — written in this repository for customer accounts -->
7
+ <!-- vendored-from: @catalyst-cloud/catalyst-skills@0.14.5 — 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 local replica when it is fresh and the origin-fresh API otherwise, 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.14.3 — written in this repository for customer accounts -->
7
+ <!-- vendored-from: @catalyst-cloud/catalyst-skills@0.14.5 — 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.14.3 — written in this repository for customer accounts -->
7
+ <!-- vendored-from: @catalyst-cloud/catalyst-skills@0.14.5 — 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.14.3 — written in this repository for customer accounts -->
7
+ <!-- vendored-from: @catalyst-cloud/catalyst-skills@0.14.5 — 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.14.3 — written in this repository for customer accounts -->
7
+ <!-- vendored-from: @catalyst-cloud/catalyst-skills@0.14.5 — 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.14.3 — written in this repository for customer accounts -->
7
+ <!-- vendored-from: @catalyst-cloud/catalyst-skills@0.14.5 — 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.14.3 — written in this repository for customer accounts -->
7
+ <!-- vendored-from: @catalyst-cloud/catalyst-skills@0.14.5 — 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?", "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.14.3 — written in this repository for customer accounts -->
7
+ <!-- vendored-from: @catalyst-cloud/catalyst-skills@0.14.5 — written in this repository for customer accounts -->
8
8
 
9
9
  # What's happening
10
10