@catalyst-cloud/cli 0.16.6 → 0.16.8
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 +8 -0
- package/dist/config.js +4 -2
- package/dist/onboard-headless.js +5 -4
- package/dist/onboard-runner-custody.js +32 -3
- package/dist/onboard-runner-telemetry.js +80 -0
- package/dist/onboard-runner.js +39 -13
- package/dist/onboard-ui.js +2 -0
- package/dist/onboard.js +8 -0
- package/package.json +1 -1
- package/skills/catalyst-github/SKILL.md +1 -1
- package/skills/catalyst-linear/SKILL.md +1 -1
- package/skills/catalyst-onboard/SKILL.md +1 -1
- package/skills/run-this-project/SKILL.md +1 -1
- package/skills/unstick/SKILL.md +1 -1
- package/skills/what-needs-me/SKILL.md +1 -1
- package/skills/what-this-repo-needs/SKILL.md +1 -1
- package/skills/whats-happening/SKILL.md +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.16.8
|
|
4
|
+
|
|
5
|
+
Setup can resume an update stopped by a local storage check. Failed access checks keep the earlier settings and report which check stopped setup.
|
|
6
|
+
|
|
7
|
+
## 0.16.7
|
|
8
|
+
|
|
9
|
+
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.
|
|
10
|
+
|
|
3
11
|
## 0.16.6
|
|
4
12
|
|
|
5
13
|
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
|
|
122
|
-
* CATALYST_SKILLS_DIR, or
|
|
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 {
|
package/dist/onboard-headless.js
CHANGED
|
@@ -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
|
|
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
|
}
|
|
@@ -7,7 +7,34 @@ import { fileURLToPath } from "node:url";
|
|
|
7
7
|
import { canonicalDarwinThoughtsJson, parseDarwinThoughtsAuthority, parseDarwinThoughtsRequest, verifyDarwinThoughtsCustodyResponse, } from "../vendor/self-host/darwin-thoughts-custody/verifier.mjs";
|
|
8
8
|
const LABEL = "dev.catalystcloud.runner.darwin-thoughts-custody";
|
|
9
9
|
const vendor = resolve(dirname(fileURLToPath(import.meta.url)), "../vendor/self-host/darwin-thoughts-custody");
|
|
10
|
-
|
|
10
|
+
class CustodyInstallError extends Error {
|
|
11
|
+
reason;
|
|
12
|
+
constructor(reason) {
|
|
13
|
+
super("darwin_thoughts_custody_install:" + reason);
|
|
14
|
+
this.reason = reason;
|
|
15
|
+
this.name = "CustodyInstallError";
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
/** Only our fixed installer errors may reach output; never forward command stderr or causes. */
|
|
19
|
+
export function darwinThoughtsInstallRefusal(error) {
|
|
20
|
+
return error instanceof CustodyInstallError ? error.reason : undefined;
|
|
21
|
+
}
|
|
22
|
+
/** Unknown exception text can contain credentials. Keep its class, and explicitly redact it. */
|
|
23
|
+
export function darwinThoughtsInstallException(error) {
|
|
24
|
+
const known = error instanceof CustodyInstallError;
|
|
25
|
+
const classes = new Set(["Error", "TypeError", "RangeError", "SyntaxError", "AbortError", "CustodyInstallError"]);
|
|
26
|
+
return { custodyErrorClass: error instanceof Error && classes.has(error.name) ? error.name : "Error",
|
|
27
|
+
custodyErrorMessage: known ? error.message : "Unclassified local storage exception; message withheld to protect credentials.",
|
|
28
|
+
custodyErrorMessageRedacted: !known };
|
|
29
|
+
}
|
|
30
|
+
function fail(reason) { throw new CustodyInstallError(reason); }
|
|
31
|
+
const VERIFIER_REFUSALS = new Set([
|
|
32
|
+
"ancestor", "ancestor_identity", "bootstrap_directory", "bootstrap_owner", "bootstrap_path",
|
|
33
|
+
"channel_identity", "cleanup", "deadline", "directory", "engine_identity", "exchange",
|
|
34
|
+
"file_owner", "git_descriptor", "git_path", "invalid", "noncanonical_json", "nonce_collision",
|
|
35
|
+
"path", "producer_refused", "signature", "size", "substituted_file", "substituted_request",
|
|
36
|
+
"unsafe_directory", "unsafe_file",
|
|
37
|
+
]);
|
|
11
38
|
function path(value) {
|
|
12
39
|
if (!isAbsolute(value) || normalize(value) !== value || value.includes("\0") ||
|
|
13
40
|
value.endsWith("/") || value === "/")
|
|
@@ -594,8 +621,10 @@ async function actualBootstrap(input) {
|
|
|
594
621
|
fail("bootstrap_cleanup_unproved");
|
|
595
622
|
id = receiveIdentity(await docker(["inspect", name]), id);
|
|
596
623
|
const started = await docker(["start", "--attach", id]);
|
|
597
|
-
if (started.code !== 0)
|
|
598
|
-
|
|
624
|
+
if (started.code !== 0) {
|
|
625
|
+
const reported = /darwin_thoughts_custody:([a-z_]+)(?![a-z_])/.exec(started.stderr)?.[1];
|
|
626
|
+
fail("bootstrap_proof_refused" + (reported && VERIFIER_REFUSALS.has(reported) ? ":" + reported : ""));
|
|
627
|
+
}
|
|
599
628
|
const value = JSON.parse(started.stdout);
|
|
600
629
|
if (typeof value.bytes !== "string" || value.bytes.length > 21848 ||
|
|
601
630
|
Buffer.from(value.bytes, "base64").toString("base64") !== value.bytes)
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { hostname } from "node:os";
|
|
2
|
+
import { loadConfig, normalizeBaseUrl } from "./config.js";
|
|
3
|
+
import { ownedFetch } from "./owned-fetch.js";
|
|
4
|
+
/** One failure event, using the existing personal login and the tenant-stamping ingest route.
|
|
5
|
+
* The short-lived export token stays in memory. Export failure never erases the setup refusal. */
|
|
6
|
+
export async function emitCustodyFailure(ctx, journal, details, parent) {
|
|
7
|
+
const cfg = loadConfig(ctx.home);
|
|
8
|
+
if (!cfg?.user || cfg.account !== (journal.account ?? journal.tenant) ||
|
|
9
|
+
cfg.user.id !== journal.membershipId || !journal.baseUrl ||
|
|
10
|
+
normalizeBaseUrl(cfg.baseUrl) !== normalizeBaseUrl(journal.baseUrl))
|
|
11
|
+
return false;
|
|
12
|
+
const expiry = cfg.auth ? Date.parse(cfg.auth.expiresAt) - ctx.now().getTime() : 0;
|
|
13
|
+
const bearer = cfg.key || (cfg.auth && expiry > 30_000 ? cfg.auth.accessToken : undefined);
|
|
14
|
+
if (!bearer || parent?.aborted)
|
|
15
|
+
return false;
|
|
16
|
+
const deadline = new AbortController();
|
|
17
|
+
const timer = setTimeout(() => deadline.abort(), 5000);
|
|
18
|
+
const signal = parent ? AbortSignal.any([parent, deadline.signal]) : deadline.signal;
|
|
19
|
+
const owner = ownedFetch(ctx.fetch, signal, { maxBodyBytes: 4096 });
|
|
20
|
+
let delivered = false;
|
|
21
|
+
try {
|
|
22
|
+
const origin = normalizeBaseUrl(cfg.baseUrl);
|
|
23
|
+
const minted = await owner.fetch(`${origin}/api/v1/telemetry/token`, {
|
|
24
|
+
method: "POST", redirect: "error", signal,
|
|
25
|
+
headers: { authorization: `Bearer ${bearer}`, "content-type": "application/json" },
|
|
26
|
+
body: JSON.stringify({ ttlSeconds: 60 }),
|
|
27
|
+
});
|
|
28
|
+
if (minted.status !== 200)
|
|
29
|
+
return false;
|
|
30
|
+
const token = await minted.json();
|
|
31
|
+
if (!token || typeof token !== "object" || !("token" in token) ||
|
|
32
|
+
typeof token.token !== "string" || !/^ctc_tel_[A-Za-z0-9._~-]{1,2048}$/.test(token.token) ||
|
|
33
|
+
!("account" in token) || token.account !== cfg.account ||
|
|
34
|
+
!("scope" in token) || token.scope !== "telemetry:write" ||
|
|
35
|
+
!("endpoint" in token) || token.endpoint !== `${origin}/api/v1/telemetry`)
|
|
36
|
+
return false;
|
|
37
|
+
const current = loadConfig(ctx.home);
|
|
38
|
+
if (!current?.user || current.account !== cfg.account || current.user.id !== cfg.user.id ||
|
|
39
|
+
normalizeBaseUrl(current.baseUrl) !== origin)
|
|
40
|
+
return false;
|
|
41
|
+
const attribute = (key, value) => ({ key,
|
|
42
|
+
value: typeof value === "boolean" ? { boolValue: value } : { stringValue: value } });
|
|
43
|
+
const attributes = [
|
|
44
|
+
attribute("catalyst.onboarding.run_id", journal.runId),
|
|
45
|
+
attribute("catalyst.onboarding.step", "runner"),
|
|
46
|
+
attribute("catalyst.onboarding.custody.failure_case", details.custodyFailureCase),
|
|
47
|
+
...Object.entries(details).filter(([key]) => key !== "custodyFailureCase").map(([key, value]) => attribute(key, value)),
|
|
48
|
+
];
|
|
49
|
+
const response = await owner.fetch(`${origin}/api/v1/telemetry/v1/logs`, {
|
|
50
|
+
method: "POST", redirect: "error", signal,
|
|
51
|
+
headers: { authorization: `Bearer ${token.token}`, "content-type": "application/json" },
|
|
52
|
+
body: JSON.stringify({ resourceLogs: [{ resource: { attributes: [
|
|
53
|
+
attribute("service.name", "catalyst-cloud.cli"), attribute("host.name", hostname()),
|
|
54
|
+
] }, scopeLogs: [{ scope: { name: "catalyst-cloud.cli.onboarding", version: journal.cli },
|
|
55
|
+
logRecords: [{ timeUnixNano: String(BigInt(ctx.now().getTime()) * 1000000n),
|
|
56
|
+
severityNumber: 17, severityText: "ERROR", eventName: "onboarding.runner.custody.refused",
|
|
57
|
+
body: { stringValue: "Setup could not verify local storage." }, attributes }] }] }] }),
|
|
58
|
+
});
|
|
59
|
+
const text = await response.text();
|
|
60
|
+
const acknowledgement = text ? JSON.parse(text) : {};
|
|
61
|
+
if (response.ok && acknowledgement && typeof acknowledgement === "object" && !Array.isArray(acknowledgement)) {
|
|
62
|
+
const partial = "partialSuccess" in acknowledgement ? acknowledgement.partialSuccess : undefined;
|
|
63
|
+
delivered = partial === undefined || !!partial && typeof partial === "object" && !Array.isArray(partial) &&
|
|
64
|
+
(!("rejectedLogRecords" in partial) || partial.rejectedLogRecords === 0 || partial.rejectedLogRecords === "0");
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
catch {
|
|
68
|
+
delivered = false;
|
|
69
|
+
}
|
|
70
|
+
finally {
|
|
71
|
+
clearTimeout(timer);
|
|
72
|
+
try {
|
|
73
|
+
await owner.settle();
|
|
74
|
+
}
|
|
75
|
+
catch {
|
|
76
|
+
delivered = false;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return delivered;
|
|
80
|
+
}
|
package/dist/onboard-runner.js
CHANGED
|
@@ -8,7 +8,8 @@ import { runnerAdmission, issueRunnerOrgKey, verifyRunnerRoutes } from "./onboar
|
|
|
8
8
|
import { verifyOnboardRoutes } from "./onboard-capabilities.js";
|
|
9
9
|
import { liveTeamKey, onboardTeamAdmission } from "./onboard-capacity.js";
|
|
10
10
|
import { runnerVmCapabilities } from "./onboard-runner-probes.js";
|
|
11
|
-
import { installDarwinThoughtsCustody } from "./onboard-runner-custody.js";
|
|
11
|
+
import { darwinThoughtsInstallException, darwinThoughtsInstallRefusal, installDarwinThoughtsCustody } from "./onboard-runner-custody.js";
|
|
12
|
+
import { emitCustodyFailure } from "./onboard-runner-telemetry.js";
|
|
12
13
|
import { canonicalDarwinThoughtsJson, parseDarwinThoughtsAuthority } from "../vendor/self-host/darwin-thoughts-custody/verifier.mjs";
|
|
13
14
|
import { readExistingOnboardJson, readOnboardTeamInventory, selectedOnboardTeam, } from "./onboard-existing.js";
|
|
14
15
|
import { onboardStateRoot, } from "./onboard.js";
|
|
@@ -200,7 +201,7 @@ export function dockerRunnerEngine(deps = {}) {
|
|
|
200
201
|
const config = rows[0]?.Config;
|
|
201
202
|
const labels = config?.Labels;
|
|
202
203
|
const dir = labels?.["com.docker.compose.project.working_dir"];
|
|
203
|
-
if (
|
|
204
|
+
if (labels?.["com.docker.compose.project"] !== RUNNER_PROJECT ||
|
|
204
205
|
labels?.["com.docker.compose.service"] !== "supervisor" || typeof dir !== "string" || !isAbsolute(dir))
|
|
205
206
|
return "unverified";
|
|
206
207
|
const inHome = relative(realpathSync(home), realpathSync(dir));
|
|
@@ -242,6 +243,18 @@ export function dockerRunnerEngine(deps = {}) {
|
|
|
242
243
|
const baseUrl = origins[0].slice("CATALYST_MIRROR_URL=".length);
|
|
243
244
|
if (!HOST_NAME.test(hostName))
|
|
244
245
|
return "unverified";
|
|
246
|
+
// The saved intent is either this exact old pin or the exact requested replacement.
|
|
247
|
+
// The latter resumes an upgrade stopped after persisting intent but before activation.
|
|
248
|
+
// Both paths require an immutable runtime pin from the same repository and identity.
|
|
249
|
+
if (config.Image !== supervisorImage &&
|
|
250
|
+
(!saved || !IMAGE_REF.test(saved.CATALYST_SUPERVISOR_IMAGE ?? "") ||
|
|
251
|
+
typeof config.Image !== "string" || !IMAGE_REF.test(config.Image) ||
|
|
252
|
+
(config.Image !== saved.CATALYST_SUPERVISOR_IMAGE && saved.CATALYST_SUPERVISOR_IMAGE !== supervisorImage) ||
|
|
253
|
+
config.Image.split("@sha256:")[0] !== supervisorImage.split("@sha256:")[0] ||
|
|
254
|
+
saved.CATALYST_SUPERVISOR_IMAGE.split("@sha256:")[0] !== supervisorImage.split("@sha256:")[0] ||
|
|
255
|
+
saved.CATALYST_HOST_NAME !== hostName ||
|
|
256
|
+
normalizeBaseUrl(saved.CATALYST_MIRROR_URL ?? "") !== normalizeBaseUrl(baseUrl)))
|
|
257
|
+
return "unverified";
|
|
245
258
|
return { dir, hostName, baseUrl: normalizeBaseUrl(baseUrl) };
|
|
246
259
|
}
|
|
247
260
|
catch {
|
|
@@ -698,6 +711,15 @@ export function onboardRunnerAdapter(input = {}) {
|
|
|
698
711
|
...want,
|
|
699
712
|
...Object.fromEntries(Object.entries(saved ?? {}).filter(([key]) => !(key in want))),
|
|
700
713
|
});
|
|
714
|
+
async function refuseCustody(ctx, journal, failureCase, message, details = {}, signal) {
|
|
715
|
+
if (signal?.aborted)
|
|
716
|
+
return waiting("interrupted", selected);
|
|
717
|
+
input.message?.(message);
|
|
718
|
+
const evidence = { custodyFailureCase: failureCase, ...details };
|
|
719
|
+
const delivered = await emitCustodyFailure(ctx, journal, evidence, signal);
|
|
720
|
+
return waiting("runner_thoughts_custody_unavailable", { ...selected, ...evidence,
|
|
721
|
+
custodyTelemetry: delivered ? "sent" : "unavailable" });
|
|
722
|
+
}
|
|
701
723
|
async function listHosts(ctx, p, signal) {
|
|
702
724
|
const read = await readExistingOnboardJson(ctx, `${ENROLLMENTS}?account=${encodeURIComponent(p.account)}`, signal);
|
|
703
725
|
return "reason" in read ? null : parseHosts(read.body);
|
|
@@ -924,8 +946,6 @@ export function onboardRunnerAdapter(input = {}) {
|
|
|
924
946
|
return false;
|
|
925
947
|
}
|
|
926
948
|
};
|
|
927
|
-
if (!writeEnv(want))
|
|
928
|
-
return { state: "failed", reason: "runner_directory_unavailable", evidence: selected };
|
|
929
949
|
for (const ref of Object.values(p.images)) {
|
|
930
950
|
if (!(await engine.imageArch(ref, signal)) && !p.info.vm) {
|
|
931
951
|
await engine.pull(ref, signal);
|
|
@@ -940,11 +960,13 @@ export function onboardRunnerAdapter(input = {}) {
|
|
|
940
960
|
const capability = await engine.vmCapabilities(p.dir, p.images.supervisor, p.baseUrl, signal);
|
|
941
961
|
if (capability !== "ready")
|
|
942
962
|
return waiting(capability, selected);
|
|
963
|
+
if (!engine.nativeThoughtsCustody)
|
|
964
|
+
return refuseCustody(ctx, journal, "capability_missing", "Setup could not verify local storage: this engine has no native storage-check capability.", {}, signal);
|
|
965
|
+
let custodyReturned = false;
|
|
943
966
|
try {
|
|
944
|
-
if (!engine.nativeThoughtsCustody)
|
|
945
|
-
return waiting("runner_thoughts_custody_unavailable", selected);
|
|
946
967
|
const result = await engine.nativeThoughtsCustody({ dir: p.dir,
|
|
947
968
|
supervisorImage: p.images.supervisor, runnerImage: p.images.runner }, signal);
|
|
969
|
+
custodyReturned = true;
|
|
948
970
|
if (signal?.aborted)
|
|
949
971
|
return waiting("interrupted", selected);
|
|
950
972
|
const values = {
|
|
@@ -952,19 +974,23 @@ export function onboardRunnerAdapter(input = {}) {
|
|
|
952
974
|
CATALYST_THOUGHTS_CUSTODY_REQUESTS_DIR: result.requestsRoot,
|
|
953
975
|
CATALYST_THOUGHTS_CUSTODY_RESPONSES_DIR: result.responsesRoot,
|
|
954
976
|
};
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
977
|
+
const custodyResultInstalled = persistedCustody(p.dir, values) === "installed";
|
|
978
|
+
const custodyAuthorityMatched = canonicalDarwinThoughtsJson(result.authority) === result.envAuthority;
|
|
979
|
+
if (!custodyResultInstalled || !custodyAuthorityMatched)
|
|
980
|
+
return refuseCustody(ctx, journal, "result_unverified", "Setup could not verify local storage: the returned installation or authority did not match.", { custodyResultInstalled, custodyAuthorityMatched }, signal);
|
|
958
981
|
writePrivate(join(p.dir, "compose.darwin-thoughts.yaml"), readFileSync(join(packageRoot(), "vendor", "self-host", "compose.darwin-thoughts.yaml"), "utf8"));
|
|
959
982
|
receivedCustody = { dir: p.dir, result };
|
|
960
983
|
want = (await desiredEnv(p, ctx));
|
|
961
|
-
if (!writeEnv(want))
|
|
962
|
-
return { state: "failed", reason: "runner_directory_unavailable", evidence: selected };
|
|
963
984
|
}
|
|
964
|
-
catch {
|
|
965
|
-
|
|
985
|
+
catch (error) {
|
|
986
|
+
const custodyReason = darwinThoughtsInstallRefusal(error);
|
|
987
|
+
const failureCase = custodyReturned ? "result_unverified" : "call_threw";
|
|
988
|
+
const details = { ...darwinThoughtsInstallException(error), ...(custodyReason ? { custodyReason } : {}) };
|
|
989
|
+
return refuseCustody(ctx, journal, failureCase, `Setup could not verify local storage: ${custodyReturned ? "recording the result failed" : "the native check threw"} (${details.custodyErrorClass}: ${details.custodyErrorMessage}).`, details, signal);
|
|
966
990
|
}
|
|
967
991
|
}
|
|
992
|
+
if (!writeEnv(want))
|
|
993
|
+
return { state: "failed", reason: "runner_directory_unavailable", evidence: selected };
|
|
968
994
|
const network = await engine.network(RUNNER_SESSION_NETWORK, signal);
|
|
969
995
|
if (network === "misshaped")
|
|
970
996
|
return waiting("runner_session_network_misshaped", selected);
|
package/dist/onboard-ui.js
CHANGED
|
@@ -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/dist/onboard.js
CHANGED
|
@@ -315,6 +315,14 @@ function normalizeStep(value, fallbackAt) {
|
|
|
315
315
|
"actor",
|
|
316
316
|
// CTC-4716: which AI accounts the workspace may add, so the step's text offers only those.
|
|
317
317
|
"aiAccountKinds",
|
|
318
|
+
"custodyFailureCase",
|
|
319
|
+
"custodyErrorClass",
|
|
320
|
+
"custodyErrorMessage",
|
|
321
|
+
"custodyErrorMessageRedacted",
|
|
322
|
+
"custodyReason",
|
|
323
|
+
"custodyResultInstalled",
|
|
324
|
+
"custodyAuthorityMatched",
|
|
325
|
+
"custodyTelemetry",
|
|
318
326
|
]) {
|
|
319
327
|
const item = evidence?.[key];
|
|
320
328
|
if (item === null ||
|
package/package.json
CHANGED
|
@@ -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.
|
|
7
|
+
<!-- vendored-from: @catalyst-cloud/catalyst-skills@0.16.8 — 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.
|
|
7
|
+
<!-- vendored-from: @catalyst-cloud/catalyst-skills@0.16.8 — 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.
|
|
7
|
+
<!-- vendored-from: @catalyst-cloud/catalyst-skills@0.16.8 — 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.
|
|
7
|
+
<!-- vendored-from: @catalyst-cloud/catalyst-skills@0.16.8 — written in this repository for customer accounts -->
|
|
8
8
|
|
|
9
9
|
# Run this project
|
|
10
10
|
|
package/skills/unstick/SKILL.md
CHANGED
|
@@ -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.
|
|
7
|
+
<!-- vendored-from: @catalyst-cloud/catalyst-skills@0.16.8 — 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.
|
|
7
|
+
<!-- vendored-from: @catalyst-cloud/catalyst-skills@0.16.8 — 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.
|
|
7
|
+
<!-- vendored-from: @catalyst-cloud/catalyst-skills@0.16.8 — 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.
|
|
7
|
+
<!-- vendored-from: @catalyst-cloud/catalyst-skills@0.16.8 — written in this repository for customer accounts -->
|
|
8
8
|
|
|
9
9
|
# What's happening
|
|
10
10
|
|