@catalyst-cloud/cli 0.14.8 → 0.14.10
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 +9 -0
- package/dist/cli.js +14 -3
- package/dist/oauth.js +32 -0
- package/dist/onboard-workflow.js +2 -8
- package/dist/onboard.js +13 -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,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.14.10
|
|
4
|
+
|
|
5
|
+
- `catalyst onboard` refreshes its sign-in when it starts and between steps. A run started a while after signing in no longer asks for the browser sign-in again, and a long run of approvals no longer stops with "Renew your login".
|
|
6
|
+
|
|
7
|
+
## 0.14.9
|
|
8
|
+
|
|
9
|
+
- Onboarding's workflow step passes on Linear teams that have the built-in Duplicate state. Before, it waited even after the team was adopted.
|
|
10
|
+
- While an earlier setup step still waits, for example for a coding account, the readiness step waits too instead of reporting a failure.
|
|
11
|
+
|
|
3
12
|
## 0.14.8
|
|
4
13
|
|
|
5
14
|
- Onboarding on a computer with no browser, such as a Docker container, prints the Catalyst page that finishes each Linear and GitHub approval and keeps waiting, instead of stopping.
|
package/dist/cli.js
CHANGED
|
@@ -7,7 +7,10 @@ import { CONFIG_MODE, DEFAULT_BASE_URL, LEGACY_PACKAGE_NAME, PACKAGE_NAME, cliPa
|
|
|
7
7
|
import { loadContract, pickPath } from "./contract.js";
|
|
8
8
|
import { CliError, MeError, UsageError } from "./errors.js";
|
|
9
9
|
import { fetchMe } from "./transport.js";
|
|
10
|
-
import { bearerFor, deviceFlowLogin } from "./oauth.js";
|
|
10
|
+
import { bearerFor, deviceFlowLogin, refreshSessionIfShort, } from "./oauth.js";
|
|
11
|
+
const ONBOARD_SESSION_MIN_MS = 20 * 60_000;
|
|
12
|
+
// A consent step waits up to 10 minutes, so each step starts with more than that left.
|
|
13
|
+
const ONBOARD_STEP_MIN_MS = 11 * 60_000;
|
|
11
14
|
import { openBrowserChecked as defaultOpenBrowser } from "./browser.js";
|
|
12
15
|
import { cmdAccounts, cmdExplain, cmdHistory, cmdQueue, cmdRunning, } from "./execution.js";
|
|
13
16
|
import { cmdQuery } from "./query.js";
|
|
@@ -35,7 +38,7 @@ import { cmdRepo } from "./repo.js";
|
|
|
35
38
|
import { cmdLegacy } from "./legacy.js";
|
|
36
39
|
import { cmdIdentity } from "./identity.js";
|
|
37
40
|
import { cmdConnections } from "./connections.js";
|
|
38
|
-
import { cmdOnboard, onboardErrorJournal } from "./onboard.js";
|
|
41
|
+
import { cmdOnboard, onboardErrorJournal, onboardRequiredStepsWaiting, } from "./onboard.js";
|
|
39
42
|
import { createClackOnboardUi, shouldUseOnboardUi, } from "./onboard-ui.js";
|
|
40
43
|
import { createOnboardRuntime } from "./onboard-runtime.js";
|
|
41
44
|
import { savedOnboardBaseUrl } from "./onboard-next.js";
|
|
@@ -262,8 +265,16 @@ export async function main(argv, ctx = defaultCtx(), deps = {}) {
|
|
|
262
265
|
}
|
|
263
266
|
}
|
|
264
267
|
}
|
|
268
|
+
// Start with a full access token: a session saved long ago would otherwise expire part way
|
|
269
|
+
// through, or send the person back through the device sign-in. A dry run changes nothing.
|
|
270
|
+
if (args.flags["dry-run"] !== true)
|
|
271
|
+
await refreshSessionIfShort(ctx, ONBOARD_SESSION_MIN_MS);
|
|
265
272
|
try {
|
|
266
273
|
return await cmdOnboard(args, ctx, {
|
|
274
|
+
beforeStep: async () => {
|
|
275
|
+
if (args.flags["dry-run"] !== true)
|
|
276
|
+
await refreshSessionIfShort(ctx, ONBOARD_STEP_MIN_MS);
|
|
277
|
+
},
|
|
267
278
|
...createOnboardRuntime(args, ctx, {
|
|
268
279
|
ui,
|
|
269
280
|
signinTimeoutMs: deps.onboardSigninTimeoutMs,
|
|
@@ -299,7 +310,7 @@ export async function main(argv, ctx = defaultCtx(), deps = {}) {
|
|
|
299
310
|
localSync: journal?.localSync ?? args.flags["local-sync"] === true,
|
|
300
311
|
observe: observeCloudOnboarding,
|
|
301
312
|
});
|
|
302
|
-
const failed = report.checks.some((check) => check.required && check.state === "fail");
|
|
313
|
+
const failed = report.checks.some((check) => check.required && check.state === "fail") && !onboardRequiredStepsWaiting(journal);
|
|
303
314
|
return {
|
|
304
315
|
state: report.state === "complete"
|
|
305
316
|
? "done"
|
package/dist/oauth.js
CHANGED
|
@@ -358,6 +358,38 @@ export async function bearerFor(ctx, cfg, deps = {}) {
|
|
|
358
358
|
const rotated = await promise;
|
|
359
359
|
return rotated.accessToken;
|
|
360
360
|
}
|
|
361
|
+
/** A long command such as onboarding refreshes a saved OAuth session that has less than
|
|
362
|
+
* `minValidityMs` left, so it starts with a full access token instead of expiring part way.
|
|
363
|
+
* Shares bearerFor's single-flight refresh. A key config, no config or a failed refresh is left
|
|
364
|
+
* alone and returns false: the command's own sign-in check decides what happens next. */
|
|
365
|
+
export async function refreshSessionIfShort(ctx, minValidityMs, deps = {}) {
|
|
366
|
+
let cfg;
|
|
367
|
+
try {
|
|
368
|
+
cfg = loadConfig(ctx.home);
|
|
369
|
+
}
|
|
370
|
+
catch {
|
|
371
|
+
return false;
|
|
372
|
+
}
|
|
373
|
+
if (!cfg?.auth || (typeof cfg.key === "string" && cfg.key !== ""))
|
|
374
|
+
return false;
|
|
375
|
+
const msToExpiry = Date.parse(cfg.auth.expiresAt) - ctx.now().getTime();
|
|
376
|
+
if (Number.isFinite(msToExpiry) && msToExpiry > minValidityMs)
|
|
377
|
+
return false;
|
|
378
|
+
try {
|
|
379
|
+
const pending = inFlight.get(ctx.home);
|
|
380
|
+
if (pending)
|
|
381
|
+
await pending;
|
|
382
|
+
else {
|
|
383
|
+
const promise = refreshAndPersist(ctx, cfg, deps).finally(() => inFlight.delete(ctx.home));
|
|
384
|
+
inFlight.set(ctx.home, promise);
|
|
385
|
+
await promise;
|
|
386
|
+
}
|
|
387
|
+
return true;
|
|
388
|
+
}
|
|
389
|
+
catch {
|
|
390
|
+
return false;
|
|
391
|
+
}
|
|
392
|
+
}
|
|
361
393
|
async function refreshAndPersist(ctx, cfg, deps) {
|
|
362
394
|
const sleep = deps.sleep ?? defaultSleep;
|
|
363
395
|
const discovery = await fetchDiscovery(ctx, cfg.baseUrl);
|
package/dist/onboard-workflow.js
CHANGED
|
@@ -70,15 +70,9 @@ export function observeOnboardWorkflow(value, team, now) {
|
|
|
70
70
|
if (!stage ||
|
|
71
71
|
!id(stage.id) ||
|
|
72
72
|
stages.has(stage.id) ||
|
|
73
|
+
// Linear adds types such as "duplicate"; only the required slots' targets are type-checked below.
|
|
73
74
|
typeof stage.type !== "string" ||
|
|
74
|
-
|
|
75
|
-
"triage",
|
|
76
|
-
"backlog",
|
|
77
|
-
"unstarted",
|
|
78
|
-
"started",
|
|
79
|
-
"completed",
|
|
80
|
-
"canceled",
|
|
81
|
-
].includes(stage.type))
|
|
75
|
+
!/^[a-z][a-z_-]{0,39}$/.test(stage.type))
|
|
82
76
|
return null;
|
|
83
77
|
stages.set(stage.id, stage.type);
|
|
84
78
|
}
|
package/dist/onboard.js
CHANGED
|
@@ -612,6 +612,14 @@ export const ONBOARD_DEFERRED_STEPS = new Set([
|
|
|
612
612
|
"housekeeping",
|
|
613
613
|
"first-ticket",
|
|
614
614
|
]);
|
|
615
|
+
/** Readiness repeats earlier steps' checks. While a required step still waits, a failing readiness
|
|
616
|
+
* check is that same wait, so readiness waits too instead of reporting a new failure. */
|
|
617
|
+
export function onboardRequiredStepsWaiting(journal) {
|
|
618
|
+
return !!journal?.steps.some((step) => step.id !== "ready" &&
|
|
619
|
+
!ONBOARD_DEFERRED_STEPS.has(step.id) &&
|
|
620
|
+
step.state !== "failed" &&
|
|
621
|
+
!stepSatisfied(step));
|
|
622
|
+
}
|
|
615
623
|
/** A full run that exited 0 with deferred steps still open: ready for work, not complete. */
|
|
616
624
|
export function onboardReadyForWork(journal, only) {
|
|
617
625
|
return !only && journal.exit === 0 && !journal.complete;
|
|
@@ -1121,6 +1129,11 @@ export async function cmdOnboard(args, ctx, deps = {}, cliVersion = "0.13.1") {
|
|
|
1121
1129
|
needed.add(id);
|
|
1122
1130
|
const fromIndex = resumeFrom ? ONBOARD_STEPS.indexOf(resumeFrom) : 0;
|
|
1123
1131
|
for (const id of ONBOARD_STEPS.filter((id) => needed.has(id))) {
|
|
1132
|
+
if (signal.aborted)
|
|
1133
|
+
return finish(EXIT_WAITING);
|
|
1134
|
+
// No step is running while the session refreshes, so an interrupt here marks none of them.
|
|
1135
|
+
current = null;
|
|
1136
|
+
await deps.beforeStep?.(id);
|
|
1124
1137
|
if (signal.aborted)
|
|
1125
1138
|
return finish(EXIT_WAITING);
|
|
1126
1139
|
current = id;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@catalyst-cloud/cli",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.10",
|
|
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.
|
|
7
|
+
<!-- vendored-from: @catalyst-cloud/catalyst-skills@0.14.10 — 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.14.
|
|
7
|
+
<!-- vendored-from: @catalyst-cloud/catalyst-skills@0.14.10 — 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.
|
|
7
|
+
<!-- vendored-from: @catalyst-cloud/catalyst-skills@0.14.10 — 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.
|
|
7
|
+
<!-- vendored-from: @catalyst-cloud/catalyst-skills@0.14.10 — 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.14.
|
|
7
|
+
<!-- vendored-from: @catalyst-cloud/catalyst-skills@0.14.10 — 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.
|
|
7
|
+
<!-- vendored-from: @catalyst-cloud/catalyst-skills@0.14.10 — 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.
|
|
7
|
+
<!-- vendored-from: @catalyst-cloud/catalyst-skills@0.14.10 — 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.
|
|
7
|
+
<!-- vendored-from: @catalyst-cloud/catalyst-skills@0.14.10 — written in this repository for customer accounts -->
|
|
8
8
|
|
|
9
9
|
# What's happening
|
|
10
10
|
|