@ritualai/cli 0.7.12 → 0.7.14
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/commands/status.js +190 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/index.js +29 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/stale-bundle-warning.js +85 -0
- package/dist/lib/stale-bundle-warning.js.map +1 -0
- package/dist/lib/status-formatter.js +162 -0
- package/dist/lib/status-formatter.js.map +1 -0
- package/package.json +1 -1
- package/skills/claude-code/ritual/.ritual-bundle.json +2 -2
- package/skills/claude-code/ritual/manifest.json +7 -2
- package/skills/claude-code/ritual/references/build-flow.md +206 -9
- package/skills/claude-code/ritual/references/ui-ux-checklist.md +198 -0
- package/skills/codex/ritual/.ritual-bundle.json +2 -2
- package/skills/codex/ritual/manifest.json +7 -2
- package/skills/codex/ritual/references/build-flow.md +206 -9
- package/skills/codex/ritual/references/ui-ux-checklist.md +198 -0
- package/skills/cursor/ritual/.ritual-bundle.json +2 -2
- package/skills/cursor/ritual/manifest.json +7 -2
- package/skills/cursor/ritual/references/build-flow.md +206 -9
- package/skills/cursor/ritual/references/ui-ux-checklist.md +198 -0
- package/skills/gemini/ritual/.ritual-bundle.json +2 -2
- package/skills/gemini/ritual/manifest.json +7 -2
- package/skills/gemini/ritual/references/build-flow.md +206 -9
- package/skills/gemini/ritual/references/ui-ux-checklist.md +198 -0
- package/skills/kiro/ritual/.ritual-bundle.json +2 -2
- package/skills/kiro/ritual/manifest.json +7 -2
- package/skills/kiro/ritual/references/build-flow.md +206 -9
- package/skills/kiro/ritual/references/ui-ux-checklist.md +198 -0
- package/skills/vscode/ritual/.ritual-bundle.json +2 -2
- package/skills/vscode/ritual/manifest.json +7 -2
- package/skills/vscode/ritual/references/build-flow.md +206 -9
- package/skills/vscode/ritual/references/ui-ux-checklist.md +198 -0
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.statusCommand = statusCommand;
|
|
4
|
+
const config_1 = require("../lib/config");
|
|
5
|
+
const api_client_1 = require("../lib/api-client");
|
|
6
|
+
const project_config_1 = require("../lib/project-config");
|
|
7
|
+
const status_formatter_1 = require("../lib/status-formatter");
|
|
8
|
+
async function statusCommand(explorationIdArg, options) {
|
|
9
|
+
const token = await (0, config_1.getValidAccessToken)();
|
|
10
|
+
if (token.kind === 'not-signed-in') {
|
|
11
|
+
console.error(' ✗ Not signed in. Run `ritual login` first.');
|
|
12
|
+
process.exit(1);
|
|
13
|
+
}
|
|
14
|
+
if (token.kind === 're-auth-required') {
|
|
15
|
+
console.error(` ✗ Session expired (${token.reason}). Run \`ritual login\` to re-auth.`);
|
|
16
|
+
process.exit(1);
|
|
17
|
+
}
|
|
18
|
+
const api = new api_client_1.ApiClient({
|
|
19
|
+
issuer: token.creds.issuer,
|
|
20
|
+
accessToken: token.accessToken,
|
|
21
|
+
});
|
|
22
|
+
if (options.watch) {
|
|
23
|
+
await runWatchLoop(api, explorationIdArg);
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
await runOnce(api, explorationIdArg);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
async function runOnce(api, explorationIdArg) {
|
|
30
|
+
const inputs = await fetchStatus(api, explorationIdArg);
|
|
31
|
+
if (!inputs) {
|
|
32
|
+
// Already printed a friendly error in fetchStatus.
|
|
33
|
+
process.exit(1);
|
|
34
|
+
}
|
|
35
|
+
console.log((0, status_formatter_1.formatStatus)(inputs));
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* --watch loop. Renders the status snapshot every 5s, in-place using
|
|
39
|
+
* ANSI cursor controls. Exits on:
|
|
40
|
+
* - terminal run states (`completed` / `failed` / `cancelled`)
|
|
41
|
+
* - the user pressing Ctrl+C
|
|
42
|
+
* - 3 consecutive fetch errors (no point thrashing if the API is down)
|
|
43
|
+
*
|
|
44
|
+
* Cadence locked at 5s — short enough to feel live, polite enough not
|
|
45
|
+
* to hammer the API on a long-running poll.
|
|
46
|
+
*/
|
|
47
|
+
async function runWatchLoop(api, explorationIdArg) {
|
|
48
|
+
let lastRenderedLines = 0;
|
|
49
|
+
let consecutiveErrors = 0;
|
|
50
|
+
const POLL_MS = 5000;
|
|
51
|
+
const stop = (code) => {
|
|
52
|
+
process.stdout.write('\n');
|
|
53
|
+
process.exit(code);
|
|
54
|
+
};
|
|
55
|
+
process.on('SIGINT', () => stop(130));
|
|
56
|
+
// First render: print fresh, no clear.
|
|
57
|
+
while (true) {
|
|
58
|
+
let inputs = null;
|
|
59
|
+
try {
|
|
60
|
+
inputs = await fetchStatus(api, explorationIdArg);
|
|
61
|
+
consecutiveErrors = 0;
|
|
62
|
+
}
|
|
63
|
+
catch (err) {
|
|
64
|
+
consecutiveErrors += 1;
|
|
65
|
+
if (consecutiveErrors >= 3) {
|
|
66
|
+
console.error(`\n ✗ Repeated errors fetching status (${err.message}). Exiting watch.`);
|
|
67
|
+
process.exit(1);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
if (inputs) {
|
|
71
|
+
const rendered = (0, status_formatter_1.formatStatus)(inputs);
|
|
72
|
+
if (lastRenderedLines > 0) {
|
|
73
|
+
// Move cursor up by the previous render's line count + clear from there.
|
|
74
|
+
process.stdout.write(`\x1b[${lastRenderedLines}A\x1b[0J`);
|
|
75
|
+
}
|
|
76
|
+
process.stdout.write(rendered + '\n');
|
|
77
|
+
lastRenderedLines = rendered.split('\n').length + 1;
|
|
78
|
+
// Exit if run reached a terminal state.
|
|
79
|
+
const status = inputs.run?.status?.toLowerCase();
|
|
80
|
+
if (status === 'completed' || status === 'completed_with_errors') {
|
|
81
|
+
process.stdout.write('\n ✓ Run finished. Exiting watch.\n');
|
|
82
|
+
process.exit(0);
|
|
83
|
+
}
|
|
84
|
+
if (status === 'failed') {
|
|
85
|
+
process.stdout.write('\n ✗ Run failed. Exiting watch.\n');
|
|
86
|
+
process.exit(1);
|
|
87
|
+
}
|
|
88
|
+
if (status === 'cancelled') {
|
|
89
|
+
process.stdout.write('\n · Run cancelled. Exiting watch.\n');
|
|
90
|
+
process.exit(0);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
await sleep(POLL_MS);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
async function fetchStatus(api, explorationIdArg) {
|
|
97
|
+
let explorationId;
|
|
98
|
+
if (explorationIdArg) {
|
|
99
|
+
explorationId = explorationIdArg;
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
// Auto-resolve from .ritual/config.json.
|
|
103
|
+
const project = (0, project_config_1.loadProjectConfig)(process.cwd());
|
|
104
|
+
if (!project) {
|
|
105
|
+
console.error(' ✗ No `.ritual/config.json` in this directory. Either:\n' +
|
|
106
|
+
' ritual init — bind a workspace to this repo, OR\n' +
|
|
107
|
+
' ritual status <exploration-id> — fetch a specific exploration');
|
|
108
|
+
return null;
|
|
109
|
+
}
|
|
110
|
+
const picked = await pickCurrentExploration(api, project.workspaceId);
|
|
111
|
+
if (!picked) {
|
|
112
|
+
console.error(` ✗ No active or recent explorations found in workspace ${project.workspaceName}.`);
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
explorationId = picked;
|
|
116
|
+
}
|
|
117
|
+
// Fetch exploration shell + agentic-status + run in parallel.
|
|
118
|
+
const [exp, agenticStatus, runs] = await Promise.all([
|
|
119
|
+
api
|
|
120
|
+
.get(`/explorations/${encodeURIComponent(explorationId)}`)
|
|
121
|
+
.catch((err) => {
|
|
122
|
+
if (err.status === 404) {
|
|
123
|
+
console.error(` ✗ Exploration ${explorationId} not found.`);
|
|
124
|
+
return null;
|
|
125
|
+
}
|
|
126
|
+
throw err;
|
|
127
|
+
}),
|
|
128
|
+
api
|
|
129
|
+
.get(`/explorations/${encodeURIComponent(explorationId)}/agentic-status`)
|
|
130
|
+
.catch(() => null),
|
|
131
|
+
api
|
|
132
|
+
.get(`/agentic-runs?exploration_id=${encodeURIComponent(explorationId)}&status=running`)
|
|
133
|
+
.catch(() => []),
|
|
134
|
+
]);
|
|
135
|
+
if (!exp)
|
|
136
|
+
return null;
|
|
137
|
+
const run = runs && runs.length > 0
|
|
138
|
+
? { id: runs[0].agentic_run_id, status: runs[0].status }
|
|
139
|
+
: null;
|
|
140
|
+
return {
|
|
141
|
+
exploration: {
|
|
142
|
+
id: exp.id,
|
|
143
|
+
name: exp.name,
|
|
144
|
+
step: exp.step,
|
|
145
|
+
updatedAt: exp.updatedAt,
|
|
146
|
+
},
|
|
147
|
+
progress: agenticStatus?.progress ?? null,
|
|
148
|
+
run,
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Pick the "current" exploration for `ritual status` with no arg.
|
|
153
|
+
*
|
|
154
|
+
* Ranking:
|
|
155
|
+
* 1. Any exploration with a RUNNING agentic run → return its id.
|
|
156
|
+
* 2. Else most-recently-updated where step != COMPLETED.
|
|
157
|
+
* 3. Else most-recently-updated full stop.
|
|
158
|
+
*
|
|
159
|
+
* Multiple RUNNING runs is uncommon. For v1 we pick whichever the API
|
|
160
|
+
* returns first (most-recently-started in practice); a multi-run picker
|
|
161
|
+
* can land in MVP-2 with `ritual status --runs`.
|
|
162
|
+
*/
|
|
163
|
+
async function pickCurrentExploration(api, workspaceId) {
|
|
164
|
+
const exps = await api.get(`/explorations?workspaceId=${encodeURIComponent(workspaceId)}&withImplementationStatus=true`);
|
|
165
|
+
if (!exps || exps.length === 0)
|
|
166
|
+
return null;
|
|
167
|
+
// Probe for a RUNNING run across explorations. Sorted by updatedAt
|
|
168
|
+
// desc first so the most recently-touched exploration gets the
|
|
169
|
+
// first run-probe — usually the right answer in one call.
|
|
170
|
+
const sorted = [...exps].sort((a, b) => new Date(b.updatedAt).getTime() - new Date(a.updatedAt).getTime());
|
|
171
|
+
for (const e of sorted.slice(0, 5)) {
|
|
172
|
+
try {
|
|
173
|
+
const runs = await api.get(`/agentic-runs?exploration_id=${encodeURIComponent(e.id)}&status=running`);
|
|
174
|
+
if (runs && runs.length > 0)
|
|
175
|
+
return e.id;
|
|
176
|
+
}
|
|
177
|
+
catch {
|
|
178
|
+
// fall through — never block on a probe failure
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
// No RUNNING runs — pick most-recently-updated non-completed.
|
|
182
|
+
const nonComplete = sorted.find((e) => e.step !== 'COMPLETED');
|
|
183
|
+
if (nonComplete)
|
|
184
|
+
return nonComplete.id;
|
|
185
|
+
return sorted[0]?.id ?? null;
|
|
186
|
+
}
|
|
187
|
+
function sleep(ms) {
|
|
188
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
189
|
+
}
|
|
190
|
+
//# sourceMappingURL=status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":";;AAmCA,sCAwBC;AA3DD,0CAAoD;AACpD,kDAA8C;AAC9C,0DAA0D;AAC1D,8DAA0E;AAgCnE,KAAK,UAAU,aAAa,CAClC,gBAAoC,EACpC,OAAsB;IAEtB,MAAM,KAAK,GAAG,MAAM,IAAA,4BAAmB,GAAE,CAAC;IAC1C,IAAI,KAAK,CAAC,IAAI,KAAK,eAAe,EAAE,CAAC;QACpC,OAAO,CAAC,KAAK,CAAC,8CAA8C,CAAC,CAAC;QAC9D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC;IACD,IAAI,KAAK,CAAC,IAAI,KAAK,kBAAkB,EAAE,CAAC;QACvC,OAAO,CAAC,KAAK,CAAC,wBAAwB,KAAK,CAAC,MAAM,qCAAqC,CAAC,CAAC;QACzF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC;IAED,MAAM,GAAG,GAAG,IAAI,sBAAS,CAAC;QACzB,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM;QAC1B,WAAW,EAAE,KAAK,CAAC,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,SAAS,CAAC,CAAC,OAAO,EAAE,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE,CAC3E,CAAC;IACF,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;QACpC,IAAI,CAAC;YACJ,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,GAAG,CACzB,gCAAgC,kBAAkB,CAAC,CAAC,CAAC,EAAE,CAAC,iBAAiB,CACzE,CAAC;YACF,IAAI,IAAI,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC;gBAAE,OAAO,CAAC,CAAC,EAAE,CAAC;QAC1C,CAAC;QAAC,MAAM,CAAC;YACR,gDAAgD;QACjD,CAAC;IACF,CAAC;IAED,8DAA8D;IAC9D,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC;IAC/D,IAAI,WAAW;QAAE,OAAO,WAAW,CAAC,EAAE,CAAC;IAEvC,OAAO,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI,IAAI,CAAC;AAC9B,CAAC;AAED,SAAS,KAAK,CAAC,EAAU;IACxB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAC1D,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -8,8 +8,24 @@ const whoami_1 = require("./commands/whoami");
|
|
|
8
8
|
const refresh_1 = require("./commands/refresh");
|
|
9
9
|
const init_1 = require("./commands/init");
|
|
10
10
|
const doctor_1 = require("./commands/doctor");
|
|
11
|
+
// 2026-05-15 (PR D) — `ritual status [--watch]` instant snapshot of
|
|
12
|
+
// an in-flight agentic run. Auto-resolves the current exploration
|
|
13
|
+
// from `.ritual/config.json` so the user doesn't have to remember
|
|
14
|
+
// IDs; --watch polls every 5s and redraws in place. Paired with the
|
|
15
|
+
// SKILL Step 8 reframe ("you're unblocked; runs continue server-
|
|
16
|
+
// side") to break the mental model where users feel obligated to
|
|
17
|
+
// stare at the polling loop.
|
|
18
|
+
const status_1 = require("./commands/status");
|
|
11
19
|
const graph_1 = require("./commands/graph");
|
|
12
20
|
const package_info_1 = require("./lib/package-info");
|
|
21
|
+
// 2026-05-15 (PR C) — pre-flight one-line stderr warning when the
|
|
22
|
+
// project's SKILL bundles drift from the installed CLI. Catches the
|
|
23
|
+
// "upgraded the CLI, forgot to refresh skills" gap immediately
|
|
24
|
+
// without making the user run `ritual doctor` first. See Eiman's
|
|
25
|
+
// 2026-05-14 #319 dev-URL-leak case — fix had shipped in CLI 0.7.11
|
|
26
|
+
// but her bundle on disk was older, so the leak persisted until she
|
|
27
|
+
// happened to re-run `ritual init`.
|
|
28
|
+
const stale_bundle_warning_1 = require("./lib/stale-bundle-warning");
|
|
13
29
|
const program = new commander_1.Command();
|
|
14
30
|
program
|
|
15
31
|
.name('ritual')
|
|
@@ -53,6 +69,13 @@ program
|
|
|
53
69
|
.command('refresh')
|
|
54
70
|
.description('Force-refresh the cached access token using the stored refresh token')
|
|
55
71
|
.action(refresh_1.refreshCommand);
|
|
72
|
+
program
|
|
73
|
+
.command('status')
|
|
74
|
+
.description('Show the current agentic run status. With --watch, polls every 5s and redraws in place. ' +
|
|
75
|
+
'With no exploration ID, auto-resolves the workspace\'s currently-active run.')
|
|
76
|
+
.argument('[exploration-id]', 'Specific exploration to inspect (defaults to the current run)')
|
|
77
|
+
.option('--watch', 'Poll every 5s and redraw in place; exits on terminal state or Ctrl+C')
|
|
78
|
+
.action((explorationId, opts) => (0, status_1.statusCommand)(explorationId, { watch: opts.watch }));
|
|
56
79
|
program
|
|
57
80
|
.command('doctor')
|
|
58
81
|
.description('Sanity check the CLI environment: credentials, endpoints, detected agents')
|
|
@@ -69,6 +92,12 @@ graph
|
|
|
69
92
|
.option('--workspace <id>', 'Override the workspaceId. Default reads from .ritual/config.json (set by `ritual init`).')
|
|
70
93
|
.option('--limit <n>', 'Number of recent implementations to show (default 5, max 25)')
|
|
71
94
|
.action(graph_1.graphStatusCommand);
|
|
95
|
+
// Pre-flight: warn ONCE (best-effort, never throws) if the project's
|
|
96
|
+
// SKILL bundles drift from the installed CLI. Skipped during `init`,
|
|
97
|
+
// `doctor`, `--version`, `--help` — see stale-bundle-warning.ts for
|
|
98
|
+
// the rationale. Must run before parseAsync so the warning prints
|
|
99
|
+
// above the command output rather than interleaved.
|
|
100
|
+
(0, stale_bundle_warning_1.printStaleBundleWarning)(process.argv.slice(2));
|
|
72
101
|
program.parseAsync(process.argv).catch((err) => {
|
|
73
102
|
console.error(`\n ✗ ${err.message}\n`);
|
|
74
103
|
process.exit(1);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAEA,yCAAoC;AACpC,4CAAgD;AAChD,8CAAkD;AAClD,8CAAkD;AAClD,gDAAoD;AACpD,0CAA8C;AAC9C,8CAAkD;AAClD,4CAAsD;AACtD,qDAA4D;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAEA,yCAAoC;AACpC,4CAAgD;AAChD,8CAAkD;AAClD,8CAAkD;AAClD,gDAAoD;AACpD,0CAA8C;AAC9C,8CAAkD;AAClD,oEAAoE;AACpE,kEAAkE;AAClE,kEAAkE;AAClE,oEAAoE;AACpE,iEAAiE;AACjE,iEAAiE;AACjE,6BAA6B;AAC7B,8CAAkD;AAClD,4CAAsD;AACtD,qDAA4D;AAC5D,kEAAkE;AAClE,oEAAoE;AACpE,+DAA+D;AAC/D,iEAAiE;AACjE,oEAAoE;AACpE,oEAAoE;AACpE,oCAAoC;AACpC,qEAAqE;AAErE,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B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AAC,SAAS,GAAG,CAAC,OAAO,IAAI,CAAC,CAAC;IACxC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACjB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.printStaleBundleWarning = printStaleBundleWarning;
|
|
4
|
+
exports.shouldSkipWarning = shouldSkipWarning;
|
|
5
|
+
exports.buildWarningLine = buildWarningLine;
|
|
6
|
+
const skill_bundles_1 = require("./skill-bundles");
|
|
7
|
+
const package_info_1 = require("./package-info");
|
|
8
|
+
/**
|
|
9
|
+
* Pre-flight warning when the project's Ritual SKILL bundles drift
|
|
10
|
+
* from the installed CLI version.
|
|
11
|
+
*
|
|
12
|
+
* Why this exists (PR C, 2026-05-15): `ritual doctor` already reports
|
|
13
|
+
* drift, but users don't routinely run it. Eiman hit a CLI bug
|
|
14
|
+
* (#319 — dev URL leak in `/ritual init` output) that was already
|
|
15
|
+
* fixed in 0.7.11 — but her SKILL bundle on disk was older, so the
|
|
16
|
+
* fix only landed when she happened to re-run `ritual init`. A
|
|
17
|
+
* one-line stderr warning at every CLI entry catches the
|
|
18
|
+
* "upgraded the CLI, forgot to refresh skills" gap immediately.
|
|
19
|
+
*
|
|
20
|
+
* Design constraints:
|
|
21
|
+
* - Best-effort: never throws, never blocks. Filesystem races,
|
|
22
|
+
* unreadable manifests, missing dirs all silently no-op.
|
|
23
|
+
* - Skip during `init` (the fix command itself) and `doctor`
|
|
24
|
+
* (which already prints the same info, in more detail).
|
|
25
|
+
* - Skip during `--version` / `-V` / `--help` / `-h` — those exit
|
|
26
|
+
* immediately and a multi-line warning would feel out of place.
|
|
27
|
+
* - Single line when one bundle drifts, single summary line when
|
|
28
|
+
* multiple. Concise; the user doesn't need the doctor-style
|
|
29
|
+
* per-provider breakdown to know what to do.
|
|
30
|
+
* - Writes to stderr so it doesn't pollute scriptable stdout.
|
|
31
|
+
*
|
|
32
|
+
* The fix command is always `ritual init --skills-only` whether the
|
|
33
|
+
* bundle is stamped-and-drifted or pre-stamp-unknown — same code
|
|
34
|
+
* path, same outcome.
|
|
35
|
+
*/
|
|
36
|
+
function printStaleBundleWarning(argv) {
|
|
37
|
+
if (shouldSkipWarning(argv))
|
|
38
|
+
return;
|
|
39
|
+
let stale;
|
|
40
|
+
try {
|
|
41
|
+
const bundles = (0, skill_bundles_1.findLocalSkillBundles)(process.cwd(), (0, package_info_1.readPackageVersionSafe)());
|
|
42
|
+
stale = (0, skill_bundles_1.findStaleBundles)(bundles);
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
if (stale.length === 0)
|
|
48
|
+
return;
|
|
49
|
+
const line = buildWarningLine(stale);
|
|
50
|
+
process.stderr.write(line);
|
|
51
|
+
}
|
|
52
|
+
const SKIP_COMMANDS = new Set(['init', 'doctor']);
|
|
53
|
+
const SKIP_FLAGS = new Set(['--version', '-V', '--help', '-h']);
|
|
54
|
+
/**
|
|
55
|
+
* Skip rules — kept narrow so any new command opts in automatically:
|
|
56
|
+
* - `init` skips: the warning would print right before the user's
|
|
57
|
+
* fix command runs.
|
|
58
|
+
* - `doctor` skips: it already renders bundle drift in detail.
|
|
59
|
+
* - `--version` / `--help` skips: short-circuit invocations.
|
|
60
|
+
*
|
|
61
|
+
* Note we look at the FIRST non-flag positional only — `ritual graph
|
|
62
|
+
* status` should still warn, since that's an arbitrary subcommand
|
|
63
|
+
* that has no special relationship to skill bundles.
|
|
64
|
+
*/
|
|
65
|
+
function shouldSkipWarning(argv) {
|
|
66
|
+
for (const a of argv) {
|
|
67
|
+
if (SKIP_FLAGS.has(a))
|
|
68
|
+
return true;
|
|
69
|
+
}
|
|
70
|
+
const firstPositional = argv.find((a) => !a.startsWith('-'));
|
|
71
|
+
if (firstPositional && SKIP_COMMANDS.has(firstPositional))
|
|
72
|
+
return true;
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
function buildWarningLine(stale) {
|
|
76
|
+
if (stale.length === 1) {
|
|
77
|
+
const s = stale[0];
|
|
78
|
+
const detail = s.drift.kind === 'drift'
|
|
79
|
+
? `bundle ${s.drift.bundleVersion} vs CLI ${s.drift.cliVersion}`
|
|
80
|
+
: 'pre-0.7.11 bundle, no version stamp';
|
|
81
|
+
return `⚠ Ritual SKILL bundle is out of date (${detail}). Run \`ritual init --skills-only\` to refresh.\n\n`;
|
|
82
|
+
}
|
|
83
|
+
return `⚠ ${stale.length} Ritual SKILL bundles need refresh. Run \`ritual init --skills-only\`.\n\n`;
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=stale-bundle-warning.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stale-bundle-warning.js","sourceRoot":"","sources":["../../src/lib/stale-bundle-warning.ts"],"names":[],"mappings":";;AA+BA,0DAcC;AAgBD,8CAOC;AAED,4CAYC;AAlFD,mDAA0E;AAC1E,iDAAwD;AAExD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,SAAgB,uBAAuB,CAAC,IAAc;IACrD,IAAI,iBAAiB,CAAC,IAAI,CAAC;QAAE,OAAO;IAEpC,IAAI,KAAK,CAAC;IACV,IAAI,CAAC;QACJ,MAAM,OAAO,GAAG,IAAA,qCAAqB,EAAC,OAAO,CAAC,GAAG,EAAE,EAAE,IAAA,qCAAsB,GAAE,CAAC,CAAC;QAC/E,KAAK,GAAG,IAAA,gCAAgB,EAAC,OAAO,CAAC,CAAC;IACnC,CAAC;IAAC,MAAM,CAAC;QACR,OAAO;IACR,CAAC;IACD,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IAE/B,MAAM,IAAI,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC;IACrC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AAC5B,CAAC;AAED,MAAM,aAAa,GAAG,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isolation without HTTP / filesystem / clock mocks. The command
|
|
7
|
+
* orchestration in `commands/status.ts` does the fetching; this just
|
|
8
|
+
* turns shapes into strings.
|
|
9
|
+
*
|
|
10
|
+
* Design choices (locked in `backlog_ritual_status_and_unblocked_framing.md`):
|
|
11
|
+
*
|
|
12
|
+
* - Run line first. "RUNNING for 17m 41s" is the headline; exploration
|
|
13
|
+
* name is a footer parenthetical, not the lead.
|
|
14
|
+
* - Pace + ETA computed only when `completedQuestions >= 3` so the
|
|
15
|
+
* average doesn't get whiplashed by the first question's latency.
|
|
16
|
+
* - Activity / last-write age is the real "is it actually moving?"
|
|
17
|
+
* signal — climbing past ~3 min without `completedQuestions`
|
|
18
|
+
* advancing is actionable info, not a snapshot lie.
|
|
19
|
+
*
|
|
20
|
+
* The shape this formatter consumes is the merged view (live progress
|
|
21
|
+
* from `Exploration.agenticProgress` + run id from
|
|
22
|
+
* `GET /agentic-runs?explorationId=...&status=RUNNING&limit=1`), never
|
|
23
|
+
* the raw `AgenticJob` row whose `totalQuestions` / `progress.steps`
|
|
24
|
+
* fields can sit unwritten for entire runs (bug filed
|
|
25
|
+
* 2026-05-15 — see `backlog_ritual_status_and_unblocked_framing.md`).
|
|
26
|
+
*/
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
exports.formatStatus = formatStatus;
|
|
29
|
+
exports.humanizeDuration = humanizeDuration;
|
|
30
|
+
function formatStatus(input) {
|
|
31
|
+
const now = (input.now ?? new Date()).getTime();
|
|
32
|
+
const lines = [];
|
|
33
|
+
if (input.run && input.progress) {
|
|
34
|
+
lines.push(...formatRunSection(input.run, input.progress, input.exploration, now));
|
|
35
|
+
}
|
|
36
|
+
else if (input.progress) {
|
|
37
|
+
lines.push(...formatNoRunButProgress(input.progress, input.exploration, now));
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
lines.push(...formatNoProgress(input.exploration));
|
|
41
|
+
}
|
|
42
|
+
lines.push('');
|
|
43
|
+
lines.push(`(Exploration: ${input.exploration.name})`);
|
|
44
|
+
lines.push(` ${input.exploration.id} · step: ${input.exploration.step}`);
|
|
45
|
+
return lines.join('\n');
|
|
46
|
+
}
|
|
47
|
+
function formatRunSection(run, progress, exploration, now) {
|
|
48
|
+
const runShort = truncateId(run.id);
|
|
49
|
+
const ageSec = progress.startedAt
|
|
50
|
+
? Math.round((now - new Date(progress.startedAt).getTime()) / 1000)
|
|
51
|
+
: null;
|
|
52
|
+
const runLine = ageSec != null
|
|
53
|
+
? `Run ${runShort} · ${run.status.toUpperCase()} for ${humanizeDuration(ageSec)}`
|
|
54
|
+
: `Run ${runShort} · ${run.status.toUpperCase()}`;
|
|
55
|
+
const phaseLine = formatPhaseLine(progress);
|
|
56
|
+
const questionsLine = formatQuestionsLine(progress);
|
|
57
|
+
const activityLine = formatActivityLine(exploration.updatedAt, now);
|
|
58
|
+
const paceLine = formatPaceLine(progress, now);
|
|
59
|
+
const nextLine = formatNextLine(progress);
|
|
60
|
+
const out = [runLine, phaseLine];
|
|
61
|
+
if (questionsLine)
|
|
62
|
+
out.push(questionsLine);
|
|
63
|
+
out.push(activityLine);
|
|
64
|
+
if (paceLine)
|
|
65
|
+
out.push(paceLine);
|
|
66
|
+
if (nextLine)
|
|
67
|
+
out.push(nextLine);
|
|
68
|
+
return out;
|
|
69
|
+
}
|
|
70
|
+
function formatNoRunButProgress(progress, exploration, now) {
|
|
71
|
+
// No active run, but agenticProgress on the exploration shows past
|
|
72
|
+
// activity. Either the run completed or it never started. Either
|
|
73
|
+
// way, the last-snapshot view is what's useful.
|
|
74
|
+
const out = [`Run (no active run)`];
|
|
75
|
+
out.push(formatPhaseLine(progress));
|
|
76
|
+
const questionsLine = formatQuestionsLine(progress);
|
|
77
|
+
if (questionsLine)
|
|
78
|
+
out.push(questionsLine);
|
|
79
|
+
out.push(formatActivityLine(exploration.updatedAt, now));
|
|
80
|
+
return out;
|
|
81
|
+
}
|
|
82
|
+
function formatNoProgress(exploration) {
|
|
83
|
+
return [
|
|
84
|
+
`Run (no run started yet)`,
|
|
85
|
+
`Phase —`,
|
|
86
|
+
`Step ${exploration.step}`,
|
|
87
|
+
];
|
|
88
|
+
}
|
|
89
|
+
function formatPhaseLine(progress) {
|
|
90
|
+
const phase = progress.phase ?? '—';
|
|
91
|
+
const pct = typeof progress.percent === 'number' ? ` (${progress.percent}%)` : '';
|
|
92
|
+
return `Phase ${phase}${pct}`;
|
|
93
|
+
}
|
|
94
|
+
function formatQuestionsLine(progress) {
|
|
95
|
+
const total = progress.totalQuestions;
|
|
96
|
+
const done = progress.completedQuestions;
|
|
97
|
+
const failed = progress.failedQuestions ?? 0;
|
|
98
|
+
if (typeof total !== 'number' || typeof done !== 'number')
|
|
99
|
+
return null;
|
|
100
|
+
if (total === 0)
|
|
101
|
+
return null;
|
|
102
|
+
const failedSegment = failed > 0 ? ` · ${failed} failed` : ` · 0 failed`;
|
|
103
|
+
return `Questions ${done} / ${total}${failedSegment}`;
|
|
104
|
+
}
|
|
105
|
+
function formatActivityLine(updatedAt, now) {
|
|
106
|
+
const ageSec = Math.max(0, Math.round((now - new Date(updatedAt).getTime()) / 1000));
|
|
107
|
+
return `Activity last DB write ${humanizeDuration(ageSec)} ago`;
|
|
108
|
+
}
|
|
109
|
+
function formatPaceLine(progress, now) {
|
|
110
|
+
const done = progress.completedQuestions ?? 0;
|
|
111
|
+
const total = progress.totalQuestions ?? 0;
|
|
112
|
+
if (done < 3)
|
|
113
|
+
return `Pace warming up — check back in 30s`;
|
|
114
|
+
if (!progress.startedAt || total <= done)
|
|
115
|
+
return null;
|
|
116
|
+
const elapsedSec = (now - new Date(progress.startedAt).getTime()) / 1000;
|
|
117
|
+
if (elapsedSec <= 0)
|
|
118
|
+
return null;
|
|
119
|
+
const secPerQ = elapsedSec / done;
|
|
120
|
+
const remainingSec = Math.round(secPerQ * (total - done));
|
|
121
|
+
return `Pace ~${Math.round(secPerQ)}s/question · ETA ~${humanizeDuration(remainingSec)} remaining`;
|
|
122
|
+
}
|
|
123
|
+
function formatNextLine(progress) {
|
|
124
|
+
const phase = (progress.phase ?? '').toLowerCase();
|
|
125
|
+
const nextByPhase = {
|
|
126
|
+
discovery: 'Accepting questions',
|
|
127
|
+
accepting: 'Answering',
|
|
128
|
+
answering: 'Recommendations (auto-advances when questions are done)',
|
|
129
|
+
submitting: 'Recommendations',
|
|
130
|
+
recommendations: 'Build brief (after admin review)',
|
|
131
|
+
complete: '—',
|
|
132
|
+
failed: '—',
|
|
133
|
+
};
|
|
134
|
+
const next = nextByPhase[phase];
|
|
135
|
+
return next ? `Next ${next}` : null;
|
|
136
|
+
}
|
|
137
|
+
function humanizeDuration(seconds) {
|
|
138
|
+
if (seconds < 0)
|
|
139
|
+
seconds = 0;
|
|
140
|
+
if (seconds < 60)
|
|
141
|
+
return `${seconds}s`;
|
|
142
|
+
const m = Math.floor(seconds / 60);
|
|
143
|
+
const s = seconds % 60;
|
|
144
|
+
if (m < 60) {
|
|
145
|
+
return s === 0 ? `${m}m` : `${m}m ${s}s`;
|
|
146
|
+
}
|
|
147
|
+
const h = Math.floor(m / 60);
|
|
148
|
+
const remM = m % 60;
|
|
149
|
+
return remM === 0 ? `${h}h` : `${h}h ${remM}m`;
|
|
150
|
+
}
|
|
151
|
+
function truncateId(id) {
|
|
152
|
+
// "ba4d2b42-…" form — first 8 chars + ellipsis. Matches the agent-
|
|
153
|
+
// facing copy in the SKILL so users can pattern-match against IDs
|
|
154
|
+
// they've seen elsewhere. UUIDs slice cleanly at 8 (no trailing
|
|
155
|
+
// hyphen); for non-UUID inputs we strip a trailing dash so we
|
|
156
|
+
// don't render "r1-aaaa--…" with double hyphens.
|
|
157
|
+
if (id.length <= 8)
|
|
158
|
+
return id;
|
|
159
|
+
const head = id.slice(0, 8).replace(/-+$/, '');
|
|
160
|
+
return `${head}-…`;
|
|
161
|
+
}
|
|
162
|
+
//# sourceMappingURL=status-formatter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status-formatter.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EAAkE;IAClE,gEAAgE;IAChE,8DAA8D;IAC9D,iDAAiD;IACjD,IAAI,EAAE,CAAC,MAAM,IAAI,CAAC;QAAE,OAAO,EAAE,CAAC;IAC9B,MAAM,IAAI,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAC/C,OAAO,GAAG,IAAI,IAAI,CAAC;AACpB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ritualai/cli",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.14",
|
|
4
4
|
"description": "Ritual CLI — scaffold AI coding agent skills + register MCP servers. Connects Claude Code, Cursor, Windsurf, Kiro, Gemini CLI, VS Code/Copilot, and Codex to Ritual Cloud.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
23
|
"path": "references/build-flow.md",
|
|
24
|
-
"lines":
|
|
25
|
-
"bytes":
|
|
24
|
+
"lines": 2466,
|
|
25
|
+
"bytes": 148766
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
28
|
"path": "references/cli-output-contract.md",
|
|
@@ -53,5 +53,10 @@
|
|
|
53
53
|
"path": "references/scoring-fallback.md",
|
|
54
54
|
"lines": 126,
|
|
55
55
|
"bytes": 6494
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"path": "references/ui-ux-checklist.md",
|
|
59
|
+
"lines": 198,
|
|
60
|
+
"bytes": 12167
|
|
56
61
|
}
|
|
57
62
|
]
|