@prism-d1/cli 1.9.0 → 1.10.0
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/README.md +48 -0
- package/dist/assets/github-workflows/prism-eval-gate-kiro.yml +133 -42
- package/dist/assets/gitlab-workflows/prism-eval-gate.yml +100 -35
- package/dist/assets/kirocrew-app/README.md +12 -9
- package/dist/assets/kirocrew-app/app.json +3 -1
- package/dist/assets/kirocrew-app/assets/screenshots/page-dark.png +0 -0
- package/dist/assets/kirocrew-app/assets/screenshots/page-light.png +0 -0
- package/dist/assets/kirocrew-app/assets/screenshots/report-dark.png +0 -0
- package/dist/assets/kirocrew-app/assets/screenshots/report-light.png +0 -0
- package/dist/bin/cli.d.ts +2 -0
- package/dist/bin/cli.d.ts.map +1 -0
- package/dist/bin/cli.js +19 -0
- package/dist/bin/cli.js.map +1 -0
- package/dist/bin/prism-cli.js +12 -17
- package/dist/bin/prism-cli.js.map +1 -1
- package/dist/src/commands/_top/dashboard.d.ts +2 -0
- package/dist/src/commands/_top/dashboard.d.ts.map +1 -1
- package/dist/src/commands/_top/dashboard.js +43 -15
- package/dist/src/commands/_top/dashboard.js.map +1 -1
- package/dist/src/commands/_top/mcp.d.ts.map +1 -1
- package/dist/src/commands/_top/mcp.js +3 -15
- package/dist/src/commands/_top/mcp.js.map +1 -1
- package/dist/src/commands/_top/statusline.d.ts +13 -0
- package/dist/src/commands/_top/statusline.d.ts.map +1 -0
- package/dist/src/commands/_top/statusline.js +12 -0
- package/dist/src/commands/_top/statusline.js.map +1 -0
- package/dist/src/commands/_top/version.d.ts +2 -0
- package/dist/src/commands/_top/version.d.ts.map +1 -1
- package/dist/src/commands/_top/version.js +4 -0
- package/dist/src/commands/_top/version.js.map +1 -1
- package/dist/src/commands/assessment/deploy-cdk.js +1 -1
- package/dist/src/commands/assessment/deploy-cdk.js.map +1 -1
- package/dist/src/commands/enable/claude-code.d.ts +81 -0
- package/dist/src/commands/enable/claude-code.d.ts.map +1 -0
- package/dist/src/commands/enable/claude-code.js +381 -0
- package/dist/src/commands/enable/claude-code.js.map +1 -0
- package/dist/src/dashboard/page.d.ts +25 -0
- package/dist/src/dashboard/page.d.ts.map +1 -1
- package/dist/src/dashboard/page.js +66 -7
- package/dist/src/dashboard/page.js.map +1 -1
- package/dist/src/dashboard/setup-page.d.ts +1 -1
- package/dist/src/dashboard/setup-page.d.ts.map +1 -1
- package/dist/src/dashboard/setup-page.js +15 -2
- package/dist/src/dashboard/setup-page.js.map +1 -1
- package/dist/src/dashboard/snapshot.d.ts +31 -0
- package/dist/src/dashboard/snapshot.d.ts.map +1 -0
- package/dist/src/dashboard/snapshot.js +65 -0
- package/dist/src/dashboard/snapshot.js.map +1 -0
- package/dist/src/mcp/dashboard-process.d.ts +83 -0
- package/dist/src/mcp/dashboard-process.d.ts.map +1 -0
- package/dist/src/mcp/dashboard-process.js +184 -0
- package/dist/src/mcp/dashboard-process.js.map +1 -0
- package/dist/src/mcp/server.d.ts.map +1 -1
- package/dist/src/mcp/server.js +8 -3
- package/dist/src/mcp/server.js.map +1 -1
- package/dist/src/mcp/tools.d.ts +7 -1
- package/dist/src/mcp/tools.d.ts.map +1 -1
- package/dist/src/mcp/tools.js +100 -2
- package/dist/src/mcp/tools.js.map +1 -1
- package/dist/src/statusline/statusline.d.ts +135 -0
- package/dist/src/statusline/statusline.d.ts.map +1 -0
- package/dist/src/statusline/statusline.js +398 -0
- package/dist/src/statusline/statusline.js.map +1 -0
- package/package.json +3 -1
|
@@ -0,0 +1,398 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `prism-cli statusline`: the Claude Code status line.
|
|
3
|
+
*
|
|
4
|
+
* Claude Code runs the command on every update and writes its status JSON
|
|
5
|
+
* (https://code.claude.com/docs/en/statusline) to stdin. This prints one or
|
|
6
|
+
* two lines:
|
|
7
|
+
*
|
|
8
|
+
* PRISM <repo> · 2 high 1 med · today $34.08 · month $480
|
|
9
|
+
* session $1.20 · +156/−23 · ctx 42% · cache 91%
|
|
10
|
+
*
|
|
11
|
+
* It must be fast and never block, so it reads only two cached files: the
|
|
12
|
+
* dashboard's usage cache (~/.prism/cache/usage.json) and the newest
|
|
13
|
+
* pre-push review under .prism/results/ of the repo that contains
|
|
14
|
+
* workspace.current_dir (found by walking up for .git, no git subprocess).
|
|
15
|
+
* It never runs codeburn, git or anything else, and makes no network call.
|
|
16
|
+
*
|
|
17
|
+
* Imports are node built-ins only: every module loaded here is paid on each
|
|
18
|
+
* status line update.
|
|
19
|
+
*/
|
|
20
|
+
import { readdirSync, readFileSync, statSync } from 'node:fs';
|
|
21
|
+
import { homedir } from 'node:os';
|
|
22
|
+
import { basename, dirname, isAbsolute, join, resolve } from 'node:path';
|
|
23
|
+
import { pathToFileURL } from 'node:url';
|
|
24
|
+
/** Same values as usage-cache.ts (USAGE_CACHE_SCHEMA, USAGE_TTL_MS); a test keeps them in step. */
|
|
25
|
+
export const USAGE_SCHEMA = 'prism.usage-cache.v1';
|
|
26
|
+
export const USAGE_TTL_MS = 5 * 60_000;
|
|
27
|
+
/** Same as results.ts RESULTS_DIR. */
|
|
28
|
+
export const RESULTS_SUBDIR = join('.prism', 'results');
|
|
29
|
+
export const REVIEW_SUFFIX = '-pre-push-review.json';
|
|
30
|
+
/** How far up from current_dir to look for .git. */
|
|
31
|
+
export const MAX_WALK_UP = 40;
|
|
32
|
+
/** Result files larger than this are not parsed (a status line must stay cheap). */
|
|
33
|
+
export const MAX_RESULT_BYTES = 2 * 1024 * 1024;
|
|
34
|
+
export const MAX_USAGE_BYTES = 1024 * 1024;
|
|
35
|
+
/** Newest review files parsed when looking for the checked-out branch's; older ones are not read. */
|
|
36
|
+
export const MAX_REVIEWS_PARSED = 20;
|
|
37
|
+
/** Longest repo or branch name printed. */
|
|
38
|
+
export const MAX_NAME_CHARS = 40;
|
|
39
|
+
export const DEFAULT_COLUMNS = 120;
|
|
40
|
+
export const USAGE_HINT = 'usage: run prism-cli dashboard';
|
|
41
|
+
const SEP = ' · ';
|
|
42
|
+
// ------------------------------------------------------------ text safety
|
|
43
|
+
/**
|
|
44
|
+
* Removes C0/C1 control characters (ESC, BEL, CR, LF, DEL and 0x80-0x9f) and
|
|
45
|
+
* bidi overrides, so text from result files or paths cannot inject escape
|
|
46
|
+
* sequences into the terminal. Result files hold reviewer-model output.
|
|
47
|
+
*/
|
|
48
|
+
export function stripControl(s) {
|
|
49
|
+
// eslint-disable-next-line no-control-regex
|
|
50
|
+
return String(s ?? '').replace(/[\u0000-\u001f\u007f-\u009f\u200e\u200f\u202a-\u202e\u2066-\u2069]/g, '');
|
|
51
|
+
}
|
|
52
|
+
const clip = (s, n) => {
|
|
53
|
+
const cps = [...s];
|
|
54
|
+
return cps.length > n ? cps.slice(0, n - 1).join('') + '…' : s;
|
|
55
|
+
};
|
|
56
|
+
/** Visible width: ANSI SGR and OSC 8 sequences removed, one column per code point. */
|
|
57
|
+
export function visibleWidth(s) {
|
|
58
|
+
// eslint-disable-next-line no-control-regex
|
|
59
|
+
return [...s.replace(/\u001b\]8;;[^\u0007]*\u0007/g, '').replace(/\u001b\[[0-9;]*m/g, '')].length;
|
|
60
|
+
}
|
|
61
|
+
const num = (v) => (typeof v === 'number' && Number.isFinite(v) ? v : null);
|
|
62
|
+
const str = (v) => (typeof v === 'string' && v ? v : null);
|
|
63
|
+
/** The fields this uses from Claude Code's status JSON; null when stdin is not a JSON object. */
|
|
64
|
+
export function parseInput(raw) {
|
|
65
|
+
let j; // any: untrusted JSON, every field is checked below.
|
|
66
|
+
try {
|
|
67
|
+
j = JSON.parse(raw);
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
if (!j || typeof j !== 'object' || Array.isArray(j))
|
|
73
|
+
return null;
|
|
74
|
+
const o = (v) => (v && typeof v === 'object' ? v : {});
|
|
75
|
+
const cwd = str(o(j.workspace).current_dir) ?? str(j.cwd);
|
|
76
|
+
return {
|
|
77
|
+
cwd: cwd && isAbsolute(cwd) ? cwd : null,
|
|
78
|
+
sessionCost: num(o(j.cost).total_cost_usd),
|
|
79
|
+
linesAdded: num(o(j.cost).total_lines_added),
|
|
80
|
+
linesRemoved: num(o(j.cost).total_lines_removed),
|
|
81
|
+
ctxPct: num(o(j.context_window).used_percentage),
|
|
82
|
+
cacheHit: num(o(j.prompt_cache).hit_ratio),
|
|
83
|
+
model: str(o(j.model).display_name),
|
|
84
|
+
sessionId: str(j.session_id),
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
/** Local YYYY-MM-DD, as usage.ts localDate. */
|
|
88
|
+
function localDay(d) {
|
|
89
|
+
const p = (n) => String(n).padStart(2, '0');
|
|
90
|
+
return `${d.getFullYear()}-${p(d.getMonth() + 1)}-${p(d.getDate())}`;
|
|
91
|
+
}
|
|
92
|
+
function readSmall(file, max) {
|
|
93
|
+
try {
|
|
94
|
+
const st = statSync(file);
|
|
95
|
+
if (!st.isFile() || st.size > max)
|
|
96
|
+
return null;
|
|
97
|
+
return readFileSync(file, 'utf8');
|
|
98
|
+
}
|
|
99
|
+
catch {
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Today's spend from the dashboard's usage cache. A cache from an earlier day
|
|
105
|
+
* counts as missing, as in UsageCache.peek.
|
|
106
|
+
* shortcut: a cache younger than the TTL is taken as today's without the local
|
|
107
|
+
* date check, because the first local-time call loads the time zone (about
|
|
108
|
+
* 6 ms, an eighth of the budget). Up to 5 minutes after midnight it can show
|
|
109
|
+
* yesterday's "today"; do the check always if that matters more than 6 ms.
|
|
110
|
+
*/
|
|
111
|
+
export function readUsage(home, now) {
|
|
112
|
+
const path = join(home, '.prism', 'cache', 'usage.json');
|
|
113
|
+
const missing = { state: 'missing', path, currency: 'USD', today: null, month: null, ageMs: null };
|
|
114
|
+
const raw = readSmall(path, MAX_USAGE_BYTES);
|
|
115
|
+
if (raw === null)
|
|
116
|
+
return missing;
|
|
117
|
+
let c; // any: local JSON, checked below.
|
|
118
|
+
try {
|
|
119
|
+
c = JSON.parse(raw);
|
|
120
|
+
}
|
|
121
|
+
catch {
|
|
122
|
+
return missing;
|
|
123
|
+
}
|
|
124
|
+
const p = c?.panel;
|
|
125
|
+
if (c?.schema !== USAGE_SCHEMA || typeof c.savedAt !== 'number' || !p || (p.status !== 'ok' && p.status !== 'no-data'))
|
|
126
|
+
return missing;
|
|
127
|
+
const ageMs = Math.max(0, now.getTime() - c.savedAt);
|
|
128
|
+
const stale = ageMs >= USAGE_TTL_MS;
|
|
129
|
+
if (stale && c.day !== localDay(now))
|
|
130
|
+
return missing;
|
|
131
|
+
return {
|
|
132
|
+
state: stale ? 'stale' : 'fresh',
|
|
133
|
+
path,
|
|
134
|
+
currency: typeof p.currency === 'string' && /^[A-Z]{3}$/.test(p.currency) ? p.currency : 'USD',
|
|
135
|
+
today: num(p.today?.cost) ?? 0,
|
|
136
|
+
month: num(p.month?.cost) ?? 0,
|
|
137
|
+
ageMs,
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
/** The repo top level containing `dir` (the nearest parent with .git), and its .git path. */
|
|
141
|
+
export function findRepo(dir) {
|
|
142
|
+
let d = resolve(dir);
|
|
143
|
+
for (let i = 0; i < MAX_WALK_UP; i++) {
|
|
144
|
+
const g = join(d, '.git');
|
|
145
|
+
try {
|
|
146
|
+
statSync(g);
|
|
147
|
+
return { top: d, gitPath: g };
|
|
148
|
+
}
|
|
149
|
+
catch { /* keep walking */ }
|
|
150
|
+
const up = dirname(d);
|
|
151
|
+
if (up === d)
|
|
152
|
+
return null;
|
|
153
|
+
d = up;
|
|
154
|
+
}
|
|
155
|
+
return null;
|
|
156
|
+
}
|
|
157
|
+
/** The checked-out branch from .git/HEAD (worktrees: the gitdir file), without running git; null when detached or unreadable. */
|
|
158
|
+
export function readBranch(gitPath) {
|
|
159
|
+
let head = readSmall(join(gitPath, 'HEAD'), 4096);
|
|
160
|
+
if (head === null) {
|
|
161
|
+
const link = readSmall(gitPath, 4096);
|
|
162
|
+
const m = link && /^gitdir:\s*(.+)$/m.exec(link);
|
|
163
|
+
if (!m)
|
|
164
|
+
return null;
|
|
165
|
+
const gd = isAbsolute(m[1].trim()) ? m[1].trim() : resolve(dirname(gitPath), m[1].trim());
|
|
166
|
+
head = readSmall(join(gd, 'HEAD'), 4096);
|
|
167
|
+
}
|
|
168
|
+
const m = head && /^ref:\s*refs\/heads\/(.+)$/m.exec(head);
|
|
169
|
+
return m ? m[1].trim() : null;
|
|
170
|
+
}
|
|
171
|
+
/** `<id>-<20261112T120000000Z>-pre-push-review.json` -> the timestamp, for ordering newest first. */
|
|
172
|
+
const stampOf = (name) => /-(\d{8}T\d+Z)-pre-push-review\.json$/.exec(name)?.[1] ?? '';
|
|
173
|
+
function parseReview(file) {
|
|
174
|
+
const raw = readSmall(file, MAX_RESULT_BYTES);
|
|
175
|
+
if (raw === null)
|
|
176
|
+
return null;
|
|
177
|
+
try {
|
|
178
|
+
const r = JSON.parse(raw);
|
|
179
|
+
return r && typeof r === 'object' && r.kind === 'review' ? r : null;
|
|
180
|
+
}
|
|
181
|
+
catch {
|
|
182
|
+
return null;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* The newest pre-push review of the checked-out branch, else the newest
|
|
187
|
+
* review of any branch (flagged otherBranch). Files are ordered by the
|
|
188
|
+
* timestamp in their names, and at most MAX_REVIEWS_PARSED of them are parsed.
|
|
189
|
+
* shortcut: a branch whose last review is older than the newest 20 shows the
|
|
190
|
+
* newest review of another branch; keep a per-branch index if that matters.
|
|
191
|
+
*/
|
|
192
|
+
export function readReview(top, branch) {
|
|
193
|
+
const dir = join(top, RESULTS_SUBDIR);
|
|
194
|
+
let names;
|
|
195
|
+
try {
|
|
196
|
+
names = readdirSync(dir).filter((n) => n.endsWith(REVIEW_SUFFIX));
|
|
197
|
+
}
|
|
198
|
+
catch {
|
|
199
|
+
return null;
|
|
200
|
+
}
|
|
201
|
+
names.sort((a, b) => (stampOf(b) < stampOf(a) ? -1 : stampOf(b) > stampOf(a) ? 1 : 0));
|
|
202
|
+
let fallback = null;
|
|
203
|
+
for (const n of names.slice(0, MAX_REVIEWS_PARSED)) {
|
|
204
|
+
const file = join(dir, n);
|
|
205
|
+
const r = parseReview(file);
|
|
206
|
+
if (!r)
|
|
207
|
+
continue;
|
|
208
|
+
if (!fallback)
|
|
209
|
+
fallback = { file, r };
|
|
210
|
+
if (!branch || r.branch === branch)
|
|
211
|
+
return toReview(file, r, false);
|
|
212
|
+
}
|
|
213
|
+
return fallback ? toReview(fallback.file, fallback.r, true) : null;
|
|
214
|
+
}
|
|
215
|
+
function toReview(file, r, otherBranch) {
|
|
216
|
+
const c = { high: 0, medium: 0, low: 0 };
|
|
217
|
+
for (const f of Array.isArray(r.findings) ? r.findings : []) {
|
|
218
|
+
if (f && Object.hasOwn(c, f.severity))
|
|
219
|
+
c[f.severity]++;
|
|
220
|
+
}
|
|
221
|
+
return { file, status: stripControl(r.status), branch: typeof r.branch === 'string' ? clip(stripControl(r.branch), MAX_NAME_CHARS) : null, otherBranch, ...c };
|
|
222
|
+
}
|
|
223
|
+
const SGR = { red: '31', amber: '33', green: '32', dim: '2', bold: '1' };
|
|
224
|
+
function paint(on, code, s) {
|
|
225
|
+
return on ? `\u001b[${code}m${s}\u001b[0m` : s;
|
|
226
|
+
}
|
|
227
|
+
function link(on, file, s) {
|
|
228
|
+
// pathToFileURL percent-encodes, so the URL holds no control characters.
|
|
229
|
+
return on ? `\u001b]8;;${pathToFileURL(file).href}\u0007${s}\u001b]8;;\u0007` : s;
|
|
230
|
+
}
|
|
231
|
+
function money(n, cur) {
|
|
232
|
+
const sym = cur === 'USD' ? '$' : `${cur} `;
|
|
233
|
+
return n >= 100 ? `${sym}${Math.round(n)}` : `${sym}${n.toFixed(2)}`;
|
|
234
|
+
}
|
|
235
|
+
const seg = (priority, text, plain = text) => ({ priority, text, plain });
|
|
236
|
+
function reviewSegment(r, o) {
|
|
237
|
+
const on = o.color;
|
|
238
|
+
let text;
|
|
239
|
+
let plain;
|
|
240
|
+
if (r.status === 'error') {
|
|
241
|
+
plain = 'review failed';
|
|
242
|
+
text = paint(on, SGR.red, plain);
|
|
243
|
+
}
|
|
244
|
+
else if (r.status === 'skipped') {
|
|
245
|
+
plain = 'review skipped';
|
|
246
|
+
text = paint(on, SGR.dim, plain);
|
|
247
|
+
}
|
|
248
|
+
else if (!r.high && !r.medium && !r.low) {
|
|
249
|
+
plain = 'clean';
|
|
250
|
+
text = paint(on, SGR.green, plain);
|
|
251
|
+
}
|
|
252
|
+
else {
|
|
253
|
+
const parts = [[r.high, 'high', SGR.red], [r.medium, 'med', SGR.amber], [r.low, 'low', SGR.dim]];
|
|
254
|
+
const shown = parts.filter(([n]) => n > 0);
|
|
255
|
+
plain = shown.map(([n, w]) => `${n} ${w}`).join(' ');
|
|
256
|
+
text = shown.map(([n, w, c]) => paint(on, c, `${n} ${w}`)).join(' ');
|
|
257
|
+
}
|
|
258
|
+
if (r.otherBranch && r.branch) {
|
|
259
|
+
plain += ` (${r.branch})`;
|
|
260
|
+
text += paint(on, SGR.dim, ` (${r.branch})`);
|
|
261
|
+
}
|
|
262
|
+
return seg(1, link(o.links, r.file, text), plain);
|
|
263
|
+
}
|
|
264
|
+
/** Drops the highest-priority-number segments until the line fits `columns`. */
|
|
265
|
+
export function fit(segments, columns) {
|
|
266
|
+
const kept = [...segments];
|
|
267
|
+
const dropped = [];
|
|
268
|
+
const width = (s) => s.reduce((w, x, i) => w + visibleWidth(x.text) + (i ? SEP.length : 0), 0);
|
|
269
|
+
while (kept.length > 1 && width(kept) > columns) {
|
|
270
|
+
let worst = 0;
|
|
271
|
+
for (let i = 1; i < kept.length; i++)
|
|
272
|
+
if (kept[i].priority >= kept[worst].priority)
|
|
273
|
+
worst = i;
|
|
274
|
+
if (kept[worst].priority === 0)
|
|
275
|
+
break;
|
|
276
|
+
dropped.push(kept[worst].plain);
|
|
277
|
+
kept.splice(worst, 1);
|
|
278
|
+
}
|
|
279
|
+
return { line: kept.map((s) => s.text).join(SEP), kept, dropped };
|
|
280
|
+
}
|
|
281
|
+
export function buildModel(input, deps, o) {
|
|
282
|
+
const usage = readUsage(deps.home, deps.now);
|
|
283
|
+
const repoRef = input?.cwd ? findRepo(input.cwd) : null;
|
|
284
|
+
const branch = repoRef ? readBranch(repoRef.gitPath) : null;
|
|
285
|
+
const review = repoRef ? readReview(repoRef.top, branch) : null;
|
|
286
|
+
const repo = repoRef ? clip(stripControl(basename(repoRef.top)), MAX_NAME_CHARS) : null;
|
|
287
|
+
const on = o.color;
|
|
288
|
+
const top = [seg(0, paint(on, SGR.bold, 'PRISM') + (repo ? ` ${repo}` : ''), `PRISM${repo ? ` ${repo}` : ''}`)];
|
|
289
|
+
if (review)
|
|
290
|
+
top.push(reviewSegment(review, o));
|
|
291
|
+
if (usage.state === 'missing') {
|
|
292
|
+
top.push(seg(3, paint(on, SGR.dim, USAGE_HINT), USAGE_HINT));
|
|
293
|
+
}
|
|
294
|
+
else {
|
|
295
|
+
const stale = usage.state === 'stale';
|
|
296
|
+
const t = `today ${money(usage.today ?? 0, usage.currency)}`;
|
|
297
|
+
const m = `month ${money(usage.month ?? 0, usage.currency)}`;
|
|
298
|
+
top.push(seg(2, stale ? paint(on, SGR.dim, t) : t, t), seg(3, stale ? paint(on, SGR.dim, m) : m, m));
|
|
299
|
+
if (stale)
|
|
300
|
+
top.push(seg(4, paint(on, SGR.dim, USAGE_HINT), USAGE_HINT));
|
|
301
|
+
}
|
|
302
|
+
const rows = [fit(top, o.columns)];
|
|
303
|
+
if (o.session && input) {
|
|
304
|
+
const s = [];
|
|
305
|
+
if (input.sessionCost !== null)
|
|
306
|
+
s.push(seg(0, `session ${money(input.sessionCost, 'USD')}`));
|
|
307
|
+
if (input.linesAdded !== null || input.linesRemoved !== null) {
|
|
308
|
+
const a = `+${input.linesAdded ?? 0}`, r = `−${input.linesRemoved ?? 0}`;
|
|
309
|
+
s.push(seg(1, `${paint(on, SGR.green, a)}/${paint(on, SGR.red, r)}`, `${a}/${r}`));
|
|
310
|
+
}
|
|
311
|
+
if (input.ctxPct !== null) {
|
|
312
|
+
const pct = Math.round(input.ctxPct);
|
|
313
|
+
const t = `ctx ${pct}%`;
|
|
314
|
+
s.push(seg(2, pct >= 80 ? paint(on, SGR.red, t) : pct >= 60 ? paint(on, SGR.amber, t) : t, t));
|
|
315
|
+
}
|
|
316
|
+
if (input.cacheHit !== null)
|
|
317
|
+
s.push(seg(3, `cache ${Math.round(input.cacheHit * 100)}%`));
|
|
318
|
+
if (input.model) {
|
|
319
|
+
const t = clip(stripControl(input.model), MAX_NAME_CHARS);
|
|
320
|
+
s.push(seg(4, paint(on, SGR.dim, t), t));
|
|
321
|
+
}
|
|
322
|
+
if (s.length) {
|
|
323
|
+
// Every session segment can be dropped except the first.
|
|
324
|
+
s[0] = { ...s[0], priority: 0 };
|
|
325
|
+
rows.push(fit(s, o.columns));
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
return {
|
|
329
|
+
repo, branch: branch ? clip(stripControl(branch), MAX_NAME_CHARS) : null, review, usage, input,
|
|
330
|
+
rows: rows.map((r) => ({ segments: r.kept, dropped: r.dropped, line: r.line })),
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
// ------------------------------------------------------------ run
|
|
334
|
+
/** Reads stdin without blocking: a TTY or no data within `timeoutMs` gives ''. */
|
|
335
|
+
export function readStdin(timeoutMs, max = 256 * 1024) {
|
|
336
|
+
if (process.stdin.isTTY)
|
|
337
|
+
return Promise.resolve('');
|
|
338
|
+
return new Promise((done) => {
|
|
339
|
+
const chunks = [];
|
|
340
|
+
let size = 0;
|
|
341
|
+
let finished = false;
|
|
342
|
+
const finish = () => {
|
|
343
|
+
if (finished)
|
|
344
|
+
return;
|
|
345
|
+
finished = true;
|
|
346
|
+
clearTimeout(timer);
|
|
347
|
+
process.stdin.pause();
|
|
348
|
+
process.stdin.removeAllListeners('data');
|
|
349
|
+
done(Buffer.concat(chunks).toString('utf8'));
|
|
350
|
+
};
|
|
351
|
+
const timer = setTimeout(finish, timeoutMs);
|
|
352
|
+
process.stdin.on('data', (c) => { size += c.length; if (size <= max)
|
|
353
|
+
chunks.push(c);
|
|
354
|
+
else
|
|
355
|
+
finish(); });
|
|
356
|
+
process.stdin.on('end', finish);
|
|
357
|
+
process.stdin.on('error', finish);
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
/** One status update. Never throws: on any failure it prints "PRISM". */
|
|
361
|
+
export function runStatusline(opts, d) {
|
|
362
|
+
const t0 = performance.now();
|
|
363
|
+
try {
|
|
364
|
+
const color = !('NO_COLOR' in d.env) || d.env.NO_COLOR === '';
|
|
365
|
+
const cols = Number.parseInt(String(d.env.COLUMNS ?? ''), 10);
|
|
366
|
+
const columns = Number.isFinite(cols) && cols > 0 ? cols : DEFAULT_COLUMNS;
|
|
367
|
+
const input = d.stdin.trim() ? parseInput(d.stdin) : null;
|
|
368
|
+
if (!input && !opts.json) {
|
|
369
|
+
d.write('PRISM\n');
|
|
370
|
+
return;
|
|
371
|
+
}
|
|
372
|
+
const o = { color: opts.json ? false : color, columns, session: opts.session !== false, links: !opts.json && color };
|
|
373
|
+
const m = buildModel(input, { home: d.home, now: d.now }, o);
|
|
374
|
+
if (opts.json) {
|
|
375
|
+
d.write(JSON.stringify({
|
|
376
|
+
input: input ? 'ok' : 'missing or not JSON',
|
|
377
|
+
columns, color,
|
|
378
|
+
repo: m.repo, branch: m.branch,
|
|
379
|
+
review: m.review, usage: m.usage,
|
|
380
|
+
rows: m.rows.map((r) => ({ line: r.line, segments: r.segments.map((s) => s.plain), dropped: r.dropped })),
|
|
381
|
+
ms: Math.round((performance.now() - t0) * 100) / 100,
|
|
382
|
+
}, null, 2) + '\n');
|
|
383
|
+
return;
|
|
384
|
+
}
|
|
385
|
+
d.write(m.rows.map((r) => r.line).join('\n') + '\n');
|
|
386
|
+
}
|
|
387
|
+
catch {
|
|
388
|
+
d.write('PRISM\n');
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
/** Entry for bin/prism-cli.js's fast path and the commander action. */
|
|
392
|
+
export async function main(opts) {
|
|
393
|
+
const stdin = await readStdin(STDIN_TIMEOUT_MS);
|
|
394
|
+
runStatusline(opts, { stdin, env: process.env, home: homedir(), now: new Date(), write: (s) => process.stdout.write(s) });
|
|
395
|
+
}
|
|
396
|
+
/** Claude Code writes the JSON and closes stdin at once; this only guards a caller that leaves it open. */
|
|
397
|
+
export const STDIN_TIMEOUT_MS = 500;
|
|
398
|
+
//# sourceMappingURL=statusline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"statusline.js","sourceRoot":"","sources":["../../../src/statusline/statusline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,mGAAmG;AACnG,MAAM,CAAC,MAAM,YAAY,GAAG,sBAAsB,CAAC;AACnD,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,GAAG,MAAM,CAAC;AACvC,sCAAsC;AACtC,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;AACxD,MAAM,CAAC,MAAM,aAAa,GAAG,uBAAuB,CAAC;AACrD,oDAAoD;AACpD,MAAM,CAAC,MAAM,WAAW,GAAG,EAAE,CAAC;AAC9B,oFAAoF;AACpF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;AAChD,MAAM,CAAC,MAAM,eAAe,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ED,2GAA2G;AAC3G,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prism-d1/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.0",
|
|
4
4
|
"description": "PRISM D1 Velocity CLI — AI development lifecycle assessment tool",
|
|
5
5
|
"author": "andklee",
|
|
6
6
|
"engines": {
|
|
@@ -24,6 +24,8 @@
|
|
|
24
24
|
"scripts": {
|
|
25
25
|
"build": "npx tsc && rm -rf dist/assets && mkdir -p dist/assets/infra dist/assets/coding-agent && cp -r ../bootstrapper/metric-hooks ../bootstrapper/eval-harness ../bootstrapper/github-workflows ../bootstrapper/gitlab-workflows dist/assets/ && cp -r ../infra/bin ../infra/lib ../infra/package.json ../infra/tsconfig.json ../infra/cdk.json dist/assets/infra/ && cp -r ../coding-agent/agent.py ../coding-agent/config.py ../coding-agent/system_prompt.py ../coding-agent/requirements.txt ../coding-agent/pyproject.toml ../coding-agent/README.md ../coding-agent/tools ../coding-agent/eval ../coding-agent/deploy dist/assets/coding-agent/ && mkdir -p dist/assets/coding-agent/fixtures && cp ../sample-app/.coding-agent/fixtures/*.json dist/assets/coding-agent/fixtures/ && find dist/assets/coding-agent -name __pycache__ -type d -prune -exec rm -rf {} + && cp -r src/commands/security/pentest-cdk dist/assets/pentest-cdk && cp -r ../kirocrew-app dist/assets/kirocrew-app && rm -rf dist/assets/kirocrew-app/tests dist/assets/kirocrew-app/data && find dist/assets/kirocrew-app \\( -name __pycache__ -o -name .pytest_cache \\) -type d -prune -exec rm -rf {} +",
|
|
26
26
|
"test": "tsc -p tsconfig.test.json && node --import tsx --test test/*.test.ts",
|
|
27
|
+
"docs": "npm run build && node scripts/gen-cli-reference.mjs",
|
|
28
|
+
"docs:check": "node scripts/check-docs.mjs",
|
|
27
29
|
"prepublishOnly": "npm run build",
|
|
28
30
|
"start": "tsx bin/prism-cli.ts",
|
|
29
31
|
"dev": "tsx bin/prism-cli.ts"
|