@sejuneoh/aitop 0.39.0 → 0.40.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 +2 -1
- package/bin/aitop.mjs +2 -0
- package/package.json +1 -1
- package/src/help.mjs +24 -3
- package/src/i18n.mjs +60 -0
- package/src/keys.mjs +94 -1
- package/src/sources/artifact-source.mjs +278 -0
- package/src/sources/artifacts.mjs +10 -0
- package/src/sources/claude-tracker.mjs +83 -3
- package/src/sources/claude.mjs +5 -1
- package/src/tail.mjs +18 -10
- package/src/ui/artifact-view.mjs +634 -0
- package/src/ui/chrome.mjs +4 -0
- package/src/ui/detail.mjs +18 -6
- package/src/ui.mjs +10 -0
package/src/ui/detail.mjs
CHANGED
|
@@ -251,7 +251,8 @@ function linkLabel(url, full) {
|
|
|
251
251
|
return `claude.ai/…${last.slice(-8)}`;
|
|
252
252
|
}
|
|
253
253
|
|
|
254
|
-
|
|
254
|
+
// selected: 목록에 들어가(v) 고른 줄. 들여 쓰기 자리에 ▸ 를 두고 배경을 칠해 폭은 그대로다.
|
|
255
|
+
export function artifactRow(a, w, selected = false) {
|
|
255
256
|
const textW = Math.max(1, w - width(INDENT.t));
|
|
256
257
|
const sep = { t: ' · ', fg: PALETTE.info };
|
|
257
258
|
const url = artifactLink(a.url);
|
|
@@ -275,15 +276,26 @@ export function artifactRow(a, w) {
|
|
|
275
276
|
const want = (k) => (k === 0 ? width(title) : Math.min(width(title), TITLE_MIN));
|
|
276
277
|
const rest = options.find((o, k) => textW - segsWidth(o) >= want(k)) ?? [];
|
|
277
278
|
const titleW = Math.max(1, textW - segsWidth(rest));
|
|
278
|
-
|
|
279
|
+
const row = [selected ? { t: '▸', fg: PALETTE.brand, bold: true } : INDENT, { t: truncate(title, titleW), fg: PALETTE.text, bold: true }, ...rest];
|
|
280
|
+
return selected ? fill(row, w, PALETTE.rowFocus) : row;
|
|
279
281
|
}
|
|
280
282
|
|
|
281
|
-
|
|
283
|
+
// view.focus 가 'artifacts' 면 고른 줄(view.artifactId)이 보이게 창을 옮기고, 구획 왼쪽에 ▌ 막대를 세운다 (변경 파일 목록과 같은 모양).
|
|
284
|
+
// 목록에 들어가 있지 않으면 가로줄 끝에 들어가는 키(v)를 알린다.
|
|
285
|
+
export function artifactBlock(s, w, max = ARTIFACT_LINES + 1, view = null) {
|
|
282
286
|
const list = s.artifacts ?? [];
|
|
283
287
|
if (!list.length || max < 2) return [];
|
|
284
|
-
const
|
|
288
|
+
const focused = view?.focus === 'artifacts';
|
|
289
|
+
const gutter = focused ? [{ t: glyphs().select, fg: PALETTE.brand }] : [];
|
|
290
|
+
const inner = w - segsWidth(gutter);
|
|
291
|
+
const slots = max - 1;
|
|
292
|
+
const sel = focused ? list.findIndex((a) => a.id === view.artifactId) : -1;
|
|
293
|
+
const start = sel >= slots ? sel - slots + 1 : 0;
|
|
294
|
+
const shown = list.slice(start, start + slots);
|
|
285
295
|
const more = list.length - shown.length;
|
|
286
|
-
|
|
296
|
+
const meta = [more ? `+${more}` : '', focused ? '' : 'v'].filter(Boolean).join(' · ');
|
|
297
|
+
const head = rule([{ t: tr('detail.artifacts', { n: list.length }), fg: focused ? PALETTE.brand : PALETTE.text, bold: true }], meta, inner, focused ? PALETTE.brand : PALETTE.line);
|
|
298
|
+
return [head, ...shown.map((a, k) => artifactRow(a, inner, start + k === sel))].map((r) => [...gutter, ...r]);
|
|
287
299
|
}
|
|
288
300
|
|
|
289
301
|
// 오른쪽 칸: 고친 파일이 없으면 최근 활동만, 있으면 위쪽 절반까지 변경 파일 구획(배경 띠), 파일을 열면 diff.
|
|
@@ -293,7 +305,7 @@ export function rightColumn(s, w, rows, view) {
|
|
|
293
305
|
const req = view?.showRequests ? requestBlock(s, w, Math.min(REQUEST_LINES, rows - 5)) : [];
|
|
294
306
|
if (req.length) return [...req, ...rightColumn({ ...s, waitDetail: null }, w, rows - req.length, view)];
|
|
295
307
|
// 아티팩트 구획은 diff 를 열지 않았을 때 그 아래에 둔다. 아래 구획(변경 파일·최근 활동)에 적어도 6줄을 남긴다.
|
|
296
|
-
const art = view?.focus === 'diff' ? [] : artifactBlock(s, w, Math.min(ARTIFACT_LINES + 1, rows - 6));
|
|
308
|
+
const art = view?.focus === 'diff' ? [] : artifactBlock(s, w, Math.min(ARTIFACT_LINES + 1, rows - 6), view);
|
|
297
309
|
if (art.length) return [...art, ...rightColumn({ ...s, waitDetail: null, artifacts: [] }, w, rows - art.length, view)];
|
|
298
310
|
const all = s.files ?? [];
|
|
299
311
|
const focused = view?.focus === 'files';
|
package/src/ui.mjs
CHANGED
|
@@ -6,6 +6,7 @@ import { glyphMoves, line, setNow } from './ui/draw.mjs';
|
|
|
6
6
|
import { glyphs } from './ui/glyphs.mjs';
|
|
7
7
|
import { TABLE_BOX_H, columns, emptyLines, filterSessions, groupRow, header, memberRow, sessionRow, tableBox, tableHeader, toolStrip, topCost } from './ui/table.mjs';
|
|
8
8
|
import { detail } from './ui/detail.mjs';
|
|
9
|
+
import { artifactScreen } from './ui/artifact-view.mjs';
|
|
9
10
|
import { detailOpen, footer, help } from './ui/chrome.mjs';
|
|
10
11
|
import { arrange } from './order.mjs';
|
|
11
12
|
import { callsYou } from './attention.mjs';
|
|
@@ -74,6 +75,15 @@ export function render(view, W, H) {
|
|
|
74
75
|
lines.push(footer({ ...view, showDetail: detailOpen(view, H) }, W, sessions.length));
|
|
75
76
|
return lines;
|
|
76
77
|
}
|
|
78
|
+
// 아티팩트 원본(#307)은 머리 줄과 키 줄 사이 전체를 쓴다.
|
|
79
|
+
if (view.focus === 'artifact' && view.artDoc) {
|
|
80
|
+
const s = view.data.sessions.find((x) => x.id === view.selectedId);
|
|
81
|
+
const a = s?.artifacts?.find((x) => x.id === view.artifactId) ?? null;
|
|
82
|
+
lines.push(header(view, W), ...artifactScreen(view.artDoc, a, W, Math.max(3, H - 2), view));
|
|
83
|
+
lines.length = H - 1;
|
|
84
|
+
lines.push(footer(view, W, sessions.length));
|
|
85
|
+
return lines;
|
|
86
|
+
}
|
|
77
87
|
lines.push(header(view, W), toolStrip(view, W));
|
|
78
88
|
if (!boxed) lines.push(line([], W));
|
|
79
89
|
const table = [tableHeader(c, TW)];
|