@sejuneoh/aitop 0.37.0 → 0.38.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 +57 -0
- package/bin/aitop.mjs +4 -1
- package/package.json +1 -1
- package/src/collect.mjs +2 -1
- package/src/config.mjs +13 -1
- package/src/doctor.mjs +66 -23
- package/src/i18n.mjs +20 -0
- package/src/json.mjs +3 -1
- package/src/resume.mjs +2 -1
- package/src/sources/agy-ledger.mjs +48 -20
- package/src/sources/antigravity.mjs +172 -25
- package/src/sources/claude-ledger.mjs +8 -0
- package/src/sources/claude.mjs +16 -12
- package/src/sources/cowork.mjs +562 -0
- package/src/sources/dirs.mjs +42 -2
- package/src/sources/projects.mjs +9 -3
- package/src/summary.mjs +1 -1
- package/src/trace.mjs +6 -4
- package/src/ui/chrome.mjs +2 -0
- package/src/ui/detail.mjs +4 -2
- package/src/ui/table.mjs +4 -2
- package/src/ui/theme.mjs +2 -0
package/src/trace.mjs
CHANGED
|
@@ -385,10 +385,12 @@ export async function findTrace(query, { claudeRoots, codexRoots, agyRoot } = {}
|
|
|
385
385
|
if (!q) return { error: 'none', candidates: [] };
|
|
386
386
|
if (claudeRoots == null || codexRoots == null) {
|
|
387
387
|
const d = await import('./sources/dirs.mjs');
|
|
388
|
-
|
|
388
|
+
// Claude Desktop Cowork 세션의 기록 폴더도 함께 본다 (#304).
|
|
389
|
+
claudeRoots ??= [...d.claudeProjectRoots(), ...(await import('./sources/cowork.mjs')).coworkProjectRoots()];
|
|
389
390
|
codexRoots ??= d.codexSessionRoots();
|
|
390
391
|
}
|
|
391
|
-
|
|
392
|
+
// agy 기록 폴더: CLI 폴더와 앱 폴더 (#303). agyRoot 는 폴더 하나 또는 목록.
|
|
393
|
+
const agyDirs = agyRoot == null ? (await import('./sources/antigravity.mjs')).agyRoots().map((r) => r.dir) : [agyRoot].flat();
|
|
392
394
|
// 1) 파일 경로
|
|
393
395
|
if (/\.(jsonl|db)$/i.test(q) && existsSync(q)) {
|
|
394
396
|
const p = resolve(q);
|
|
@@ -429,8 +431,8 @@ export async function findTrace(query, { claudeRoots, codexRoots, agyRoot } = {}
|
|
|
429
431
|
}
|
|
430
432
|
}
|
|
431
433
|
// agy: conversations/<id>.db
|
|
432
|
-
for (const f of list(join(
|
|
433
|
-
if (f.endsWith('.db') && f.toLowerCase().startsWith(low)) found.push({ tool: 'agy', id: f.slice(0, -3), path: join(
|
|
434
|
+
for (const dir of agyDirs) for (const f of list(join(dir, 'conversations'))) {
|
|
435
|
+
if (f.endsWith('.db') && f.toLowerCase().startsWith(low) && !found.some((x) => x.tool === 'agy' && x.id === f.slice(0, -3))) found.push({ tool: 'agy', id: f.slice(0, -3), path: join(dir, 'conversations', f), mtime: mtimeOf(join(dir, 'conversations', f)) });
|
|
434
436
|
}
|
|
435
437
|
// 3) 이름: 최근 Claude 기록의 /rename 이름·제목. 순서: id 가 똑같은 것 > 이름이 똑같은 것 > id 앞부분 > 이름에 들어 있는 것.
|
|
436
438
|
// id 가 똑같거나 id 앞부분으로 하나가 정해지면 이름을 읽지 않는다 (최근 기록 300개를 읽는 비용을 아낀다). 이름은 많아야 한 번 읽는다.
|
package/src/ui/chrome.mjs
CHANGED
|
@@ -50,6 +50,8 @@ const LEGEND_IDS = [
|
|
|
50
50
|
['legend.stalledKey', 'legend.stalled'],
|
|
51
51
|
['member.sdk', 'legend.sdk'],
|
|
52
52
|
['session.auto', 'legend.auto'],
|
|
53
|
+
// TOOL 칸의 cowork (#304).
|
|
54
|
+
['cowork', 'legend.cowork'],
|
|
53
55
|
];
|
|
54
56
|
|
|
55
57
|
// 지금 언어의 상태 기호·열 설명. 제목 줄은 설명이 null 이다. {g} 는 팀원 경과 시간 표시(glyphs().elapsed)로 바꾼다.
|
package/src/ui/detail.mjs
CHANGED
|
@@ -319,7 +319,8 @@ export function summaryLines(s, w, frame, view) {
|
|
|
319
319
|
const cache = cacheState(s);
|
|
320
320
|
const optional = [
|
|
321
321
|
s.branch && [sep, { t: s.branch, fg: PALETTE.info }],
|
|
322
|
-
|
|
322
|
+
// Cowork(#304)는 실행 방식(local-agent)을 붙인다.
|
|
323
|
+
s.kind && [sep, { t: s.source === 'app' ? `${s.kind} · ${tr('detail.app')}` : s.tool === 'cowork' && s.entrypoint ? `${s.kind} · ${s.entrypoint}` : s.kind, fg: PALETTE.info }],
|
|
323
324
|
s.startedAt && [sep, { t: tr('detail.startedAgo', { at: hhmm(s.startedAt), ago: fmtAgo(NOW - s.startedAt) }), fg: PALETTE.info }],
|
|
324
325
|
// 캐시 남은 시간은 표의 STATUS 칸과 같은 짧은 글로, 가장 먼저 뺀다.
|
|
325
326
|
cache && [sep, { t: cache.text, fg: cache.fg, bold: cache.bold }],
|
|
@@ -487,7 +488,8 @@ export function detail(s, W, H, frame, view) {
|
|
|
487
488
|
kv(tr('detail.folder'), tilde(s.cwd));
|
|
488
489
|
if (s.branch) kv(tr('detail.branch'), s.branch);
|
|
489
490
|
kv(tr('detail.model'), s.model ?? '-');
|
|
490
|
-
|
|
491
|
+
// Antigravity 데스크톱 앱의 대화는 종류 뒤에 짧게 '앱' 을 붙인다 (#303, 표에는 열을 만들지 않는다).
|
|
492
|
+
kv(tr('detail.kind'), `${s.kind ?? '-'}${s.source === 'app' ? ` · ${tr('detail.app')}` : ''}${s.tool === 'cowork' && s.entrypoint ? ` · ${s.entrypoint}` : ''}${s.pid ? ` · pid ${s.pid}` : ''}`);
|
|
491
493
|
if (s.startedAt) kv(tr('detail.started'), tr('detail.ago', { at: clock(s.startedAt), ago: fmtAgo(NOW - s.startedAt) }));
|
|
492
494
|
|
|
493
495
|
// 합계 = 메인 + 서브 = 입력 + 출력 + 캐시 읽기 + 캐시 쓰기 가 화면에서 그대로 맞아떨어지게 보인다.
|
package/src/ui/table.mjs
CHANGED
|
@@ -211,7 +211,7 @@ export function progressSegs(r, bg) {
|
|
|
211
211
|
}
|
|
212
212
|
|
|
213
213
|
// 폭이 모자랄 때 도구 이름 대신 쓰는 짧은 이름.
|
|
214
|
-
export const TOOL_SHORT = { claude: 'cla', codex: 'cdx', gemini: 'gem' };
|
|
214
|
+
export const TOOL_SHORT = { claude: 'cla', cowork: 'cwk', codex: 'cdx', gemini: 'gem' };
|
|
215
215
|
|
|
216
216
|
// 도구 하나의 조각. level 0 은 다 보이고, 2 부터 토큰 수·미설치 글을 빼고, 3 은 이름을 줄인다.
|
|
217
217
|
function toolPart(p, level, showEnded) {
|
|
@@ -250,7 +250,9 @@ export function toolLastUsed(data, tool, now) {
|
|
|
250
250
|
// 아주 좁으면 실행 중인 도구가 숨김 표시보다 먼저 남고, 숨김 표시는 중간에서 자르지 않고 뺀다.
|
|
251
251
|
export function toolStrip(view, W) {
|
|
252
252
|
const now = view.data.at ?? Date.now();
|
|
253
|
-
|
|
253
|
+
// Cowork(#304)는 claude 와 따로 센다. 앱 폴더를 찾았거나(--doctor 점검에 있음) 세션이 있을 때만 줄에 넣는다.
|
|
254
|
+
const hasCowork = Boolean(view.data.tools?.tools?.cowork) || view.data.sessions.some((s) => s.tool === 'cowork');
|
|
255
|
+
const all = ['claude', ...(hasCowork ? ['cowork'] : []), 'codex', 'gemini'].map((tool) => {
|
|
254
256
|
const list = view.data.sessions.filter((s) => s.tool === tool);
|
|
255
257
|
const live = list.filter((s) => s.live).length;
|
|
256
258
|
const last = toolLastUsed(view.data, tool, now);
|
package/src/ui/theme.mjs
CHANGED
|
@@ -107,6 +107,8 @@ export const paletteName = (theme, colorBlind) => (colorBlind ? `${theme}-cb` :
|
|
|
107
107
|
export const THEME = pickTheme();
|
|
108
108
|
export const COLOR_BLIND = pickColorBlind();
|
|
109
109
|
export const PALETTES = { dark: DARK, light: LIGHT, 'dark-cb': DARK_CB, 'light-cb': LIGHT_CB };
|
|
110
|
+
// Claude Desktop Cowork(#304) 세션은 claude 와 같은 색이다.
|
|
111
|
+
for (const p of Object.values(PALETTES)) p.tools = { ...p.tools, cowork: p.tools.claude };
|
|
110
112
|
export const PALETTE = PALETTES[paletteName(THEME, COLOR_BLIND)];
|
|
111
113
|
|
|
112
114
|
export const hex = (h) => [1, 3, 5].map((i) => parseInt(h.slice(i, i + 2), 16)).join(';');
|