@sejuneoh/aitop 0.40.0 → 0.41.1
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 +50 -4
- package/bin/aitop.mjs +35 -7
- package/package.json +1 -1
- package/src/config.mjs +53 -0
- package/src/doctor.mjs +34 -17
- package/src/i18n.mjs +55 -4
- package/src/json.mjs +13 -1
- package/src/keys.mjs +5 -0
- package/src/notify.mjs +4 -1
- package/src/order.mjs +12 -1
- package/src/remote.mjs +372 -0
- package/src/resume.mjs +44 -1
- package/src/sources/agy-ledger.mjs +129 -27
- package/src/sources/antigravity.mjs +29 -6
- package/src/ui/detail.mjs +5 -1
- package/src/ui/table.mjs +28 -2
- package/src/ui.mjs +23 -10
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
- `y` copies a resume command, and `--report sessions` prints yesterday's sessions with cost for your standup.
|
|
23
23
|
- **No hooks, nothing sent.**
|
|
24
24
|
- Claude Code, Codex CLI and Antigravity CLI side by side, from [several history folders](#several-claude-or-codex-profiles) (`~/.claude`, `~/.claude-work`, ...).
|
|
25
|
-
- aitop only reads the logs they already write. It changes no settings and needs no network, ports or dependencies.
|
|
25
|
+
- aitop only reads the logs they already write. It changes no settings and needs no network, ports or dependencies. The one exception is the opt-in [`--remote`](#remote-hosts-and-wsl-distros), which runs your own `ssh` or `wsl.exe`.
|
|
26
26
|
|
|
27
27
|
**Contents**
|
|
28
28
|
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
- [Features](#features)
|
|
31
31
|
- [Subagents](#subagents) · [Daily and monthly reports](#daily-and-monthly-reports) · [Session report](#session-report) · [Call tree](#call-tree)
|
|
32
32
|
- [Notifications](#notifications) · [tmux status line](#tmux-status-line) · [Several Claude or Codex profiles](#several-claude-or-codex-profiles)
|
|
33
|
-
- [Resume a session elsewhere](#resume-a-session-elsewhere) · [JSON output](#json-output) · [Language](#language)
|
|
33
|
+
- [Resume a session elsewhere](#resume-a-session-elsewhere) · [Remote hosts and WSL distros](#remote-hosts-and-wsl-distros) · [JSON output](#json-output) · [Language](#language)
|
|
34
34
|
- [How it differs from similar tools](#how-it-differs-from-similar-tools) · [Install](#install) · [License](#license)
|
|
35
35
|
|
|
36
36
|
## Quick start
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
- **Tokens and cost** per session and for today / last 7 days, estimated at public API list prices. This is not your bill.
|
|
91
91
|
- **Changed files and diffs** per session and per prompt.
|
|
92
92
|
- **Artifacts** a Claude or Cowork session (or its subagents) published with the Artifact tool, with clickable links.
|
|
93
|
-
- **Read-only**: no network, no ports, no dependencies. It only reads the session logs each CLI already writes.
|
|
93
|
+
- **Read-only**: no network, no ports, no dependencies. It only reads the session logs each CLI already writes. Only [`--remote`](#remote-hosts-and-wsl-distros), when you turn it on, uses the network (through your `ssh`).
|
|
94
94
|
|
|
95
95
|
<details>
|
|
96
96
|
<summary>Details: stopped sessions, cache countdown, tool run time, context gauge, artifacts, tool line</summary>
|
|
@@ -332,7 +332,7 @@ Alerts when a session starts waiting, finishes a long turn or fills its context.
|
|
|
332
332
|
|
|
333
333
|
- The hook keeps its name (`--on-waiting`) for all kinds.
|
|
334
334
|
- It gets `AITOP_EVENT` (`waiting`, `done` or `context`) in its environment.
|
|
335
|
-
- It also gets `AITOP_TOOL`, `AITOP_PROJECT`, `AITOP_SESSION_ID`, `AITOP_CWD` and `AITOP_WAITING_FOR
|
|
335
|
+
- It also gets `AITOP_TOOL`, `AITOP_PROJECT`, `AITOP_SESSION_ID`, `AITOP_CWD` and `AITOP_WAITING_FOR`, plus `AITOP_HOST` (the [remote](#remote-hosts-and-wsl-distros) name, empty for local sessions).
|
|
336
336
|
|
|
337
337
|
**Config file and switches**
|
|
338
338
|
|
|
@@ -536,6 +536,50 @@ Continue a session elsewhere, for example when you cannot jump to its tab, as in
|
|
|
536
536
|
|
|
537
537
|
</details>
|
|
538
538
|
|
|
539
|
+
## Remote hosts and WSL distros
|
|
540
|
+
|
|
541
|
+
See sessions on machines you manage (a VM, a dev server, another WSL distro) on the same screen.
|
|
542
|
+
|
|
543
|
+
> `aitop --remote dev,me@vm2,wsl:Ubuntu-22.04`
|
|
544
|
+
>
|
|
545
|
+
> config file: `"remotes": ["dev", "wsl:Ubuntu"]`
|
|
546
|
+
|
|
547
|
+
- aitop must be installed on each remote. Every 10 seconds aitop runs `ssh -o BatchMode=yes -o ConnectTimeout=5 -T -- <host> aitop --json --no-remote` (WSL: `wsl.exe -d <distro> -- aitop --json --no-remote`) for all remotes in parallel, 20 seconds per call.
|
|
548
|
+
- Auth and host trust are left to your ssh config and agent. aitop never asks for or stores passwords or keys, and never turns off host key checking.
|
|
549
|
+
- This is the only feature that uses the network, and only when you turn it on. `--no-remote` turns off the config file list for one run.
|
|
550
|
+
- The table keeps local sessions on top. Each remote follows under its own line: `── dev · 3 sessions · 10s ago ──`, or `── dev · not connected (timed out) ──`. Sorting, grouping and waiting-first work inside each block.
|
|
551
|
+
- Waiting bell and desktop alerts include remote sessions. `--on-waiting` gets `AITOP_HOST`.
|
|
552
|
+
- `y` copies a local command that reopens the session there: `ssh -t dev 'cd /repo && claude --resume <id>'` (WSL: `wsl.exe -d Ubuntu --cd /repo -- claude --resume <id>`).
|
|
553
|
+
- `--once` and `--json` wait for all remotes before printing.
|
|
554
|
+
|
|
555
|
+
<details>
|
|
556
|
+
<summary>Details: names, errors, what is not fetched</summary>
|
|
557
|
+
|
|
558
|
+
**Names**
|
|
559
|
+
|
|
560
|
+
- An ssh host alias or `user@host` (letters, digits, `.`, `_`, `-`), or `wsl:<distro>`. Up to 16.
|
|
561
|
+
- Values starting with `-`, ports (`host:22`), spaces and shell characters are refused at start (exit 2). Put a port or jump host in an `~/.ssh/config` alias.
|
|
562
|
+
- There is no automatic WSL distro discovery; name the distro.
|
|
563
|
+
|
|
564
|
+
**Errors on the remote line**
|
|
565
|
+
|
|
566
|
+
- auth failed, unreachable, no aitop on remote (exit 127), remote aitop too old (no `--no-remote` or no `schema` in its JSON), remote aitop newer (larger `schema`), timed out, bad response (broken JSON or over 8MB). Remote error output is not shown.
|
|
567
|
+
- A short connection drop keeps the remote's last sessions (the line shows the error and how old they are) and clears them after 3 failures in a row or 60 seconds. When a remote first connects, or comes back after being cleared, sessions already waiting are not alerted.
|
|
568
|
+
- So after a long drop (once the sessions were cleared), a session that started waiting during the drop is not alerted either: it becomes part of the new baseline.
|
|
569
|
+
|
|
570
|
+
**"no aitop on remote" although it is installed**
|
|
571
|
+
|
|
572
|
+
- `ssh host aitop` runs a non-login shell, so an aitop installed with nvm, fnm or a user npm prefix may not be on its `PATH`.
|
|
573
|
+
- Fix on the remote: put the `PATH` line (for example `export NVM_DIR=...` and `. "$NVM_DIR/nvm.sh"`) at the top of `~/.bashrc`, before the "If not running interactively, return" line, or link it once: `sudo ln -s "$(command -v aitop)" /usr/local/bin/aitop` (run it in a shell where `aitop` works; for nvm, link `node` the same way).
|
|
574
|
+
|
|
575
|
+
**Not fetched**
|
|
576
|
+
|
|
577
|
+
- Diffs (the detail panel shows file stats only), artifact sources (links still work), the remote usage totals (remote cost is not added to the header) and requests (`--show-requests`).
|
|
578
|
+
- `--report` and `--line` stay local.
|
|
579
|
+
- Remote output is treated as untrusted: only known fields are kept, text is stripped of control characters, masked and cut to 200 characters, and the counts are capped (500 sessions, 200 files, 50 members per remote).
|
|
580
|
+
|
|
581
|
+
</details>
|
|
582
|
+
|
|
539
583
|
## JSON output
|
|
540
584
|
|
|
541
585
|
> `aitop --json`
|
|
@@ -545,6 +589,8 @@ Continue a session elsewhere, for example when you cannot jump to its tab, as in
|
|
|
545
589
|
- `--json` prints a snapshot as JSON and exits.
|
|
546
590
|
- For scripts, use `phaseKind`, a stable state name: `think`, `write`, `tool`, `team`, `waiting`, `idle`, `stopped`, `done`, `ended` (or `null`).
|
|
547
591
|
- `stopReason` says why a session is `stopped`: `{ "kind": "auth" }` login needed, `network` connection lost, `api` any other API error. `null` otherwise.
|
|
592
|
+
- `schema` (top level) is the JSON shape version, now `1`. It goes up only when an existing field changes meaning or shape.
|
|
593
|
+
- With [`--remote`](#remote-hosts-and-wsl-distros): each session has `host` (`null` for local) and `remoteId` (its id on that host; `id` is `<host>:<id>`), and `remotes` lists each remote as `{ name, kind, ok, error, version, schema, at }` (`[]` when off). `usage` stays local.
|
|
548
594
|
|
|
549
595
|
<details>
|
|
550
596
|
<summary>Details: text fields and where other fields are described</summary>
|
package/bin/aitop.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { readFileSync } from 'node:fs';
|
|
3
|
-
import { budgetDayOption, configJson, configPath, configText, readConfigFile, resolveConfig } from '../src/config.mjs';
|
|
3
|
+
import { budgetDayOption, configJson, configPath, configText, parseRemote, readConfigFile, remoteOption, resolveConfig } from '../src/config.mjs';
|
|
4
4
|
import { langOption, pickLang, setLang, t } from '../src/i18n.mjs';
|
|
5
5
|
import { notifyOptions } from '../src/notify.mjs';
|
|
6
6
|
import { lineOption } from '../src/line.mjs';
|
|
@@ -11,7 +11,7 @@ import { mask, setAmbiguous, stripControl } from '../src/text.mjs';
|
|
|
11
11
|
const KNOWN = new Set(['-h', '--help', '-v', '--version', '--once', '--all', '--json', '--doctor', '--bell', '--show-requests', '--print-config', '--no-bell', '--no-all', '--no-show-requests', '--debug', '--no-debug', '--color-blind', '--no-color-blind']);
|
|
12
12
|
const THEMES = ['light', 'dark'];
|
|
13
13
|
// 잘못 친 옵션에 제안할 후보. KNOWN 의 긴 옵션과, 다른 모듈이 먼저 꺼내는 값 옵션을 합친다.
|
|
14
|
-
const OPTIONS = [...[...KNOWN].filter((o) => o.startsWith('--')), '--theme', '--lang', '--notify', '--no-notify', '--on-waiting', '--no-on-waiting', '--budget-day', '--no-budget-day', '--line', '--line-width', '--report', '--by', '--days', '--months', '--since', '--plan', '--md', '--show-prompts'];
|
|
14
|
+
const OPTIONS = [...[...KNOWN].filter((o) => o.startsWith('--')), '--theme', '--lang', '--notify', '--no-notify', '--on-waiting', '--no-on-waiting', '--budget-day', '--no-budget-day', '--line', '--line-width', '--report', '--by', '--days', '--months', '--since', '--plan', '--md', '--show-prompts', '--remote', '--no-remote'];
|
|
15
15
|
const VERSION = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8')).version;
|
|
16
16
|
|
|
17
17
|
// 언어는 다른 옵션의 오류 문구보다 먼저 정한다: --lang > AITOP_LANG > 설정 파일 lang > LC_ALL > LC_MESSAGES > LANG.
|
|
@@ -50,10 +50,16 @@ if (report.error) {
|
|
|
50
50
|
process.stderr.write(`aitop: ${report.error}\n`);
|
|
51
51
|
process.exit(2);
|
|
52
52
|
}
|
|
53
|
+
// --remote <목록>, --remote=<목록>, --no-remote 는 remoteOption 이 꺼낸다 (#308). 잘못된 호스트 이름은 여기서 끝낸다.
|
|
54
|
+
const remoteOpt = remoteOption(report.rest);
|
|
55
|
+
if (remoteOpt.error) {
|
|
56
|
+
process.stderr.write(`aitop: ${remoteOpt.error}\n`);
|
|
57
|
+
process.exit(2);
|
|
58
|
+
}
|
|
53
59
|
// 사용자가 준 NO_COLOR. 아래에서 파이프 출력이면 NO_COLOR 를 켜므로 그 전에 읽어 둔다 (tmux 의 #() 는 TTY 가 아니다).
|
|
54
60
|
const userNoColor = Boolean(process.env.NO_COLOR);
|
|
55
61
|
// --theme light, --theme=light 처럼 값을 받는 옵션은 따로 꺼낸다.
|
|
56
|
-
const argv =
|
|
62
|
+
const argv = remoteOpt.rest;
|
|
57
63
|
let theme = null;
|
|
58
64
|
const rest = [];
|
|
59
65
|
for (let i = 0; i < argv.length; i++) {
|
|
@@ -75,7 +81,7 @@ const flag = (name) => {
|
|
|
75
81
|
const notifyFlag = cli.notify ? (cli.eventsSet ? cli.events : true) : notifyOptions(cliArgs, { notify: true }).notify ? undefined : false;
|
|
76
82
|
// onWaiting 은 --on-waiting 이 뒤에 오면 그 명령, --no-on-waiting 이 뒤에 오면 null(끔), 둘 다 없으면 정하지 않은 것이다.
|
|
77
83
|
const onWaitingFlag = cli.onWaiting ?? (notifyOptions(cliArgs, { onWaiting: 'x' }).onWaiting === null ? null : undefined);
|
|
78
|
-
const config = resolveConfig({ flags: { theme: THEMES.includes(theme) ? theme : undefined, colorBlind: flag('color-blind'), bell: flag('bell'), showRequests: flag('show-requests'), all: flag('all'), debug: flag('debug'), notify: notifyFlag, onWaiting: onWaitingFlag, budgetDay: budget.value, lang: langOpt.value }, file: cfgFile });
|
|
84
|
+
const config = resolveConfig({ flags: { theme: THEMES.includes(theme) ? theme : undefined, colorBlind: flag('color-blind'), bell: flag('bell'), showRequests: flag('show-requests'), all: flag('all'), debug: flag('debug'), notify: notifyFlag, onWaiting: onWaitingFlag, budgetDay: budget.value, lang: langOpt.value, remotes: remoteOpt.value }, file: cfgFile });
|
|
79
85
|
const opt = Object.fromEntries(Object.entries(config.values).map(([k, v]) => [k, v.value]));
|
|
80
86
|
// 알림은 설정 파일 값(onWaiting 은 권한 검사를 통과한 것만)을 깔고 명령줄 옵션이 덮는다.
|
|
81
87
|
const fromFile = (k) => (config.values[k].source === 'file' ? config.values[k].value : undefined);
|
|
@@ -270,7 +276,7 @@ if (args.has('--doctor')) {
|
|
|
270
276
|
// 진단은 한 번 돌고 끝나므로 Windows 의 첫 PowerShell CIM 호출을 더 오래 기다린다 (procs.mjs WIN_DOCTOR_TIMEOUT_MS).
|
|
271
277
|
const { setFirstScanTimeout, WIN_DOCTOR_TIMEOUT_MS } = await import('../src/procs.mjs');
|
|
272
278
|
setFirstScanTimeout(WIN_DOCTOR_TIMEOUT_MS);
|
|
273
|
-
const result = { ...checkTools(), config: configJson(config), log: { on: log.on, path: log.path } };
|
|
279
|
+
const result = { ...checkTools(), config: configJson(config), log: { on: log.on, path: log.path }, remotes: (opt.remotes ?? []).map((n) => parseRemote(n)?.name).filter(Boolean) };
|
|
274
280
|
await printAndExit(args.has('--json') ? JSON.stringify({ version: VERSION, ...result, tools: toolsJson(result.tools) }, null, 2) : doctorText(result, VERSION));
|
|
275
281
|
}
|
|
276
282
|
|
|
@@ -290,6 +296,16 @@ const { onKey, fixFocus } = await import('../src/keys.mjs');
|
|
|
290
296
|
const { admit, createLoading, latchReady } = await import('../src/loading.mjs');
|
|
291
297
|
const { osc52, resumeCmd } = await import('../src/resume.mjs');
|
|
292
298
|
|
|
299
|
+
// --remote (#308): 원격을 켰을 때만 remote.mjs 를 불러온다 (--report·--line 은 위에서 이미 끝났다).
|
|
300
|
+
// 폴러가 뒤에서 원격마다 aitop --json 을 부르고, refresh 가 그 마지막 결과를 로컬 세션 뒤에 붙인다.
|
|
301
|
+
let poller = null;
|
|
302
|
+
let mergeRemote = null;
|
|
303
|
+
if (opt.remotes?.length) {
|
|
304
|
+
const remote = await import('../src/remote.mjs');
|
|
305
|
+
poller = remote.createRemotePoller(remote.remoteTargets(opt.remotes));
|
|
306
|
+
mergeRemote = remote.mergeRemote;
|
|
307
|
+
}
|
|
308
|
+
|
|
293
309
|
// 요청 전체 보기는 기본으로 꺼 둔다. 켜지 않으면 상세 패널에도 --json 에도 나가지 않는다.
|
|
294
310
|
const showRequests = opt.showRequests;
|
|
295
311
|
// settings: 도움말(?)에 보이는 지금 설정 값.
|
|
@@ -328,6 +344,8 @@ const eventWatch = notifier && eventKinds.length ? createEventWatch({ doneMs: op
|
|
|
328
344
|
// 알림(벨·--notify·--on-waiting)은 화면에 올리지 않은 갱신에서도 그대로 돈다. 돌려주는 값은 화면 데이터를 바꿨는지.
|
|
329
345
|
function refresh({ throttle = false } = {}) {
|
|
330
346
|
const data = collect({ showEnded: view.showEnded, selectedId: view.selectedId, budgetBytes: once ? Infinity : TICK_BUDGET, budgetMs: once ? Infinity : TICK_MS });
|
|
347
|
+
// 원격 결과를 붙인다. 새로 붙은 원격의 세션은 응답 대기 알림의 기준선으로만 넣는다 (remote.mjs mergeRemote).
|
|
348
|
+
if (poller) mergeRemote(data, poller, waitWatch);
|
|
331
349
|
// 준비 완료를 먼저 정해, 처음 고르는 세션도 이번 갱신의 정렬을 따르게 한다.
|
|
332
350
|
if (!once) latchReady(loading, data.sessionsMore);
|
|
333
351
|
if (!data.sessions.some((s) => s.id === view.selectedId)) {
|
|
@@ -388,10 +406,13 @@ function select(id) {
|
|
|
388
406
|
}
|
|
389
407
|
|
|
390
408
|
if (once) {
|
|
409
|
+
// --once·--json 은 모든 원격이 끝날 때(원격마다 최대 20초)까지 기다린 뒤 낸다.
|
|
410
|
+
if (poller) await poller.pollAll();
|
|
391
411
|
refresh();
|
|
392
412
|
flushCache();
|
|
393
413
|
// --line 이 작업 중 수를 낼 수 있게 요약을 남긴다 (summary.mjs).
|
|
394
|
-
|
|
414
|
+
// 원격 세션(#308)은 --line 이 다루지 않으므로 요약에 넣지 않는다.
|
|
415
|
+
writeSummary(summarize(view.data.sessions.filter((s) => !s.host)));
|
|
395
416
|
const size = (v) => (Number(v) > 0 ? Math.floor(Number(v)) : 0);
|
|
396
417
|
const W = process.stdout.columns || size(process.env.COLUMNS) || 140;
|
|
397
418
|
const H = process.stdout.rows || size(process.env.LINES) || 40;
|
|
@@ -445,12 +466,14 @@ function leaveScreen() {
|
|
|
445
466
|
}
|
|
446
467
|
|
|
447
468
|
restore = () => {
|
|
469
|
+
poller?.stop();
|
|
448
470
|
notifier?.killAll();
|
|
449
471
|
leaveScreen();
|
|
450
472
|
flushCache();
|
|
451
473
|
};
|
|
452
474
|
|
|
453
475
|
function quit() {
|
|
476
|
+
poller?.stop();
|
|
454
477
|
notifier?.killAll();
|
|
455
478
|
leaveScreen();
|
|
456
479
|
flushCache();
|
|
@@ -469,6 +492,7 @@ process.on('SIGCONT', () => {
|
|
|
469
492
|
});
|
|
470
493
|
process.on('uncaughtException', (err) => {
|
|
471
494
|
debug('aitop', 'uncaughtException', err);
|
|
495
|
+
poller?.stop();
|
|
472
496
|
notifier?.killAll();
|
|
473
497
|
leaveScreen();
|
|
474
498
|
try {
|
|
@@ -534,6 +558,8 @@ const act = {
|
|
|
534
558
|
keepVisible: keepSelectionVisible,
|
|
535
559
|
// 아티팩트 원본을 뒤에서 찾은 뒤 다시 그린다 (#307).
|
|
536
560
|
redraw: () => draw(),
|
|
561
|
+
// 키 줄에 잠깐 안내를 띄운다 (원격 세션의 아티팩트 원본 막힘, #308).
|
|
562
|
+
notice: (key) => toast(key),
|
|
537
563
|
};
|
|
538
564
|
|
|
539
565
|
stdin.on('data', (key) => {
|
|
@@ -546,7 +572,7 @@ let lastFlush = 0;
|
|
|
546
572
|
const writeSummaryThrottled = createSummaryWriter();
|
|
547
573
|
function tick() {
|
|
548
574
|
const shown = refresh({ throttle: true });
|
|
549
|
-
if (loading.ready && view.data) writeSummaryThrottled(view.data.sessions);
|
|
575
|
+
if (loading.ready && view.data) writeSummaryThrottled(view.data.sessions.filter((s) => !s.host));
|
|
550
576
|
const more = lastMore;
|
|
551
577
|
if (more ? Date.now() - lastFlush > LOADING_FLUSH_MS : Date.now() - lastFlush > 15_000) {
|
|
552
578
|
flushCache();
|
|
@@ -557,3 +583,5 @@ function tick() {
|
|
|
557
583
|
}
|
|
558
584
|
|
|
559
585
|
setTimeout(tick, 30);
|
|
586
|
+
// 원격은 화면에 들어간 뒤 뒤에서 부른다. 결과는 다음 갱신(1초 안)에 붙는다.
|
|
587
|
+
poller?.start();
|
package/package.json
CHANGED
package/src/config.mjs
CHANGED
|
@@ -47,6 +47,57 @@ export function budgetDayOption(argv) {
|
|
|
47
47
|
return { value, rest, error };
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
+
// 원격(#308): SSH 호스트(별칭, user@host) 또는 wsl:<배포판>. 원격 실행은 remote.mjs 가 하고, 여기는 이름만 확인한다
|
|
51
|
+
// (remote.mjs 는 원격을 켤 때만 불러오므로 확인 규칙은 늘 불러오는 이 모듈에 둔다).
|
|
52
|
+
// ssh 인자로 들어가므로 - 로 시작하는 값(-oProxyCommand=…), 포트(:22), 공백·셸 메타 문자는 받지 않는다. 포트는 ~/.ssh/config 별칭으로 준다.
|
|
53
|
+
export const REMOTE_MAX = 16;
|
|
54
|
+
const SSH_HOST = /^([A-Za-z0-9][A-Za-z0-9._-]{0,63}@)?[A-Za-z0-9][A-Za-z0-9._-]{0,252}$/;
|
|
55
|
+
const WSL_DISTRO = /^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/;
|
|
56
|
+
// 'dev' → { name: 'dev', kind: 'ssh', target: 'dev' }, 'wsl:Ubuntu' → { name: 'wsl:Ubuntu', kind: 'wsl', target: 'Ubuntu' }. 잘못되면 null.
|
|
57
|
+
export function parseRemote(v) {
|
|
58
|
+
if (typeof v !== 'string') return null;
|
|
59
|
+
const w = /^wsl:(.*)$/i.exec(v);
|
|
60
|
+
if (w) return WSL_DISTRO.test(w[1]) ? { name: `wsl:${w[1]}`, kind: 'wsl', target: w[1] } : null;
|
|
61
|
+
return SSH_HOST.test(v) ? { name: v, kind: 'ssh', target: v } : null;
|
|
62
|
+
}
|
|
63
|
+
// 같은 원격인지 가르는 열쇠. WSL 배포판 이름은 대소문자를 가리지 않으므로(wsl.exe -d) 작은 글자로 맞춘다. ssh 호스트는 그대로.
|
|
64
|
+
export const remoteKey = (r) => (r.kind === 'wsl' ? r.name.toLowerCase() : r.name);
|
|
65
|
+
const remoteList = (v) => Array.isArray(v) && v.length > 0 && v.length <= REMOTE_MAX && v.every((x) => parseRemote(x) != null);
|
|
66
|
+
|
|
67
|
+
// argv 에서 --remote <목록>, --remote=<목록>, --no-remote 를 꺼낸다. 목록은 쉼표로 잇는다. 뒤에 준 쪽을 따른다.
|
|
68
|
+
// value: 이름 배열, null(--no-remote, 설정 파일 remotes 도 끔), undefined(주지 않음).
|
|
69
|
+
export function remoteOption(argv) {
|
|
70
|
+
let value;
|
|
71
|
+
let error = null;
|
|
72
|
+
const rest = [];
|
|
73
|
+
for (let i = 0; i < argv.length; i++) {
|
|
74
|
+
const a = argv[i];
|
|
75
|
+
if (a === '--no-remote') {
|
|
76
|
+
value = null;
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
const m = /^--remote(?:=(.*))?$/.exec(a);
|
|
80
|
+
if (!m) {
|
|
81
|
+
rest.push(a);
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
const next = argv[i + 1];
|
|
85
|
+
const raw = m[1] ?? (next == null || next.startsWith('-') ? '' : argv[++i]);
|
|
86
|
+
const list = raw.split(',').map((x) => x.trim()).filter(Boolean);
|
|
87
|
+
const bad = list.find((x) => parseRemote(x) == null);
|
|
88
|
+
if (!list.length) error ??= t('opt.remoteMissing');
|
|
89
|
+
else if (bad != null) error ??= t('opt.remoteBad', { value: JSON.stringify(stripControl(bad).slice(0, 80)) });
|
|
90
|
+
else if (list.length > REMOTE_MAX) error ??= t('opt.remoteMany', { n: REMOTE_MAX });
|
|
91
|
+
// 같은 이름을 두 번 주면 한 번만 부른다 (WSL 배포판은 대소문자 무시, 처음 적은 표기).
|
|
92
|
+
else {
|
|
93
|
+
const seen = new Map();
|
|
94
|
+
for (const r of list.map(parseRemote)) if (!seen.has(remoteKey(r))) seen.set(remoteKey(r), r.name);
|
|
95
|
+
value = [...seen.values()];
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return { value, rest, error };
|
|
99
|
+
}
|
|
100
|
+
|
|
50
101
|
const BOOL = ['true', 'false'];
|
|
51
102
|
// 기록 폴더 목록: 절대 경로(또는 ~ 로 시작) 문자열 배열, 1~16개.
|
|
52
103
|
const pathList = (v) => Array.isArray(v) && v.length > 0 && v.length <= 16 && v.every(pathLike);
|
|
@@ -88,6 +139,8 @@ export const KEYS = {
|
|
|
88
139
|
// Claude Desktop Cowork(에이전트 모드) 세션을 담은 앱 폴더 (#304, cowork.mjs findCoworkRoots). 모양은 agyApp 과 같다.
|
|
89
140
|
// AITOP_COWORK_HOME(경로 또는 off) > 설정 파일 > 기본(true, 저절로 찾음).
|
|
90
141
|
cowork: { ok: (v) => bool(v) || pathList(v), expect: 'cfg.cowork', def: true, env: ['AITOP_COWORK_HOME', coworkEnv], envProblem: true, envExpect: 'cfg.agyAppEnv' },
|
|
142
|
+
// 모아 볼 원격 (#308): SSH 호스트 또는 wsl:<배포판> 배열, 1~16개. --remote 가 덮고 --no-remote 는 끈다 (null).
|
|
143
|
+
remotes: { ok: remoteList, expect: 'cfg.remotes', def: null },
|
|
91
144
|
};
|
|
92
145
|
|
|
93
146
|
// Windows 는 XDG_CONFIG_HOME 이 없으면 %APPDATA%\aitop\config.json.
|
package/src/doctor.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { readdirSync, readFileSync, statSync, existsSync, openSync, readSync, cl
|
|
|
5
5
|
import { basename, join } from 'node:path';
|
|
6
6
|
import { homedir, platform } from 'node:os';
|
|
7
7
|
import { findProcesses, isCodex, isGemini, isAgy, canListProcesses, isAlive, isSessionAlive, processMethod } from './procs.mjs';
|
|
8
|
-
import { agyRoots } from './sources/antigravity.mjs';
|
|
8
|
+
import { agyRoots, parseTime } from './sources/antigravity.mjs';
|
|
9
9
|
import { coworkCheck } from './sources/cowork.mjs';
|
|
10
10
|
import { loadSqlite, openReadOnly } from './sqlite.mjs';
|
|
11
11
|
import { fmtAgo, pad, stripControl, width } from './text.mjs';
|
|
@@ -178,36 +178,51 @@ function gemini() {
|
|
|
178
178
|
// Antigravity CLI 와 데스크톱 앱(#303): 요약 DB 를 열어 대화 목록을 읽을 수 있는지 본다. node:sqlite 가 없으면 프로세스만 센다.
|
|
179
179
|
// path 는 CLI 폴더(예전 모양). 앱 폴더가 있으면 dirs 에 폴더마다 { path, found, records, source } 를 두고 둘째 줄부터 보인다.
|
|
180
180
|
// 앱 폴더는 있는 것만 목록에 들어오므로(findAgyRoots) 없으면 줄이 생기지 않는다. 앱 폴더에서도 conversations/ 와 요약 DB 만 본다.
|
|
181
|
+
// 마지막 사용 시각(lastAt)은 대화 기록(.db)과 -wal 가운데 가장 늦은 수정 시각이다. -wal 이 있는지는 폴더 목록으로 알아
|
|
182
|
+
// 따로 존재 확인을 하지 않는다. 앱 폴더(WSL 에서는 /mnt/c, stat 이 느리다)는 기록마다 stat 하지 않고, 요약 DB 의
|
|
183
|
+
// 가장 늦은 대화 수정 시각(last_modified_time)과 있는 -wal 의 수정 시각만 본다 (#326). 그래서 앱 폴더의 lastAt 은
|
|
184
|
+
// 앱이 요약에 적은 시각이라 기록 파일의 수정 시각과 조금 다를 수 있다. 요약 DB 를 읽지 못하면 예전처럼 기록마다 stat 한다.
|
|
181
185
|
function agy(roots = agyRoots()) {
|
|
182
186
|
const running = canListProcesses() ? findProcesses(isAgy).length : null;
|
|
183
187
|
const dirs = [];
|
|
184
|
-
const files = [];
|
|
185
188
|
for (const r of roots) {
|
|
186
189
|
const dir = join(r.dir, 'conversations');
|
|
187
|
-
const
|
|
188
|
-
|
|
189
|
-
|
|
190
|
+
const names = existsSync(dir) ? ls(dir).filter((e) => e.isFile()).map((e) => e.name) : null;
|
|
191
|
+
const dbs = names?.filter((n) => n.endsWith('.db')).map((n) => join(dir, n)) ?? [];
|
|
192
|
+
const wals = names?.filter((n) => n.endsWith('.db-wal')).map((n) => join(dir, n)) ?? [];
|
|
193
|
+
dirs.push({ path: tilde(r.dir), found: Boolean(names), records: dbs.length, source: r.source, root: r.dir, dbs, wals });
|
|
190
194
|
}
|
|
191
195
|
const path = dirs[0].path;
|
|
192
196
|
// 앱 폴더가 없으면 예전과 같은 모양 (dirs 없음).
|
|
193
|
-
const more = dirs.length > 1 ? { dirs: dirs.map(({ root, ...d }) => d) } : {};
|
|
197
|
+
const more = dirs.length > 1 ? { dirs: dirs.map(({ root, dbs, wals, ...d }) => d) } : {};
|
|
198
|
+
const records = dirs.reduce((a, d) => a + d.records, 0);
|
|
194
199
|
if (!dirs.some((d) => d.found)) return { tool: 'agy', state: 'missing', path, ...more, records: 0, lastAt: null, running, readable: null, hint: null };
|
|
195
|
-
const
|
|
196
|
-
if (!loadSqlite()) return { tool: 'agy', state: 'limited', path, ...more, records: files.length, lastAt: last?.mtime ?? null, running, readable: null, hint: null };
|
|
200
|
+
const sqlite = Boolean(loadSqlite());
|
|
197
201
|
// 기록이 있는 폴더의 요약 DB 를 모두 읽을 수 있어야 읽을 수 있다고 본다.
|
|
198
202
|
let readable = true;
|
|
203
|
+
let lastAt = null;
|
|
204
|
+
const later = (t) => {
|
|
205
|
+
if (t != null && !(lastAt >= t)) lastAt = t;
|
|
206
|
+
};
|
|
199
207
|
for (const d of dirs.filter((x) => x.found)) {
|
|
200
|
-
let
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
+
let summaryAt;
|
|
209
|
+
if (sqlite) {
|
|
210
|
+
let db;
|
|
211
|
+
try {
|
|
212
|
+
db = openReadOnly(join(d.root, 'conversation_summaries.db'));
|
|
213
|
+
summaryAt = parseTime(db.prepare('select count(*) n, max(last_modified_time) m from conversation_summaries').get()?.m);
|
|
214
|
+
} catch {
|
|
215
|
+
readable = false;
|
|
216
|
+
} finally {
|
|
217
|
+
db?.close();
|
|
218
|
+
}
|
|
208
219
|
}
|
|
220
|
+
const app = d.source === 'app' && summaryAt != null;
|
|
221
|
+
if (app) later(summaryAt);
|
|
222
|
+
later(newest(app ? d.wals : [...d.dbs, ...d.wals])?.mtime ?? null);
|
|
209
223
|
}
|
|
210
|
-
return { tool: 'agy', state: '
|
|
224
|
+
if (!sqlite) return { tool: 'agy', state: 'limited', path, ...more, records, lastAt, running, readable: null, hint: null };
|
|
225
|
+
return { tool: 'agy', state: 'ok', path, ...more, records, lastAt, running, readable, hint: null };
|
|
211
226
|
}
|
|
212
227
|
|
|
213
228
|
// Claude Desktop Cowork(#304): 앱 폴더마다 세션 목록(메타)만 본다. 기록 내용·audit.jsonl 은 읽지 않는다.
|
|
@@ -357,5 +372,7 @@ export function doctorText(result, version, now = Date.now(), lang = getLang())
|
|
|
357
372
|
const on = result.log.on;
|
|
358
373
|
out.push('', tr('doctor.debug', { mark: on ? '✓' : '○', state: pad(logWord, stateW), path: tilde(result.log.path), tail: on ? '' : tr('doctor.debugTail', null, o) }, o));
|
|
359
374
|
}
|
|
375
|
+
// --remote(#308)로 정한 원격 목록. 점검은 접속하지 않는다 (네트워크를 쓰지 않음).
|
|
376
|
+
if (result.remotes?.length) out.push('', tr('doctor.remotes', { mark: '○', list: result.remotes.join(', ') }, o));
|
|
360
377
|
return stripControl(out.join('\n'));
|
|
361
378
|
}
|
package/src/i18n.mjs
CHANGED
|
@@ -68,6 +68,10 @@ const HELP_KO = `{logo} aitop - 터미널에서 Claude Code · Codex · Antigrav
|
|
|
68
68
|
1분 안에 aitop 화면·--once·--json 이 남긴 요약이 있을 때만 보인다
|
|
69
69
|
aitop --json 세션 목록과 사용량 합계를 JSON 으로 한 번 출력한다 (--all 과 함께 쓸 수 있다)
|
|
70
70
|
세션마다 resumeCmd 에 그 세션을 이어 여는 명령을 넣는다 (예: cd /repo && claude --resume <id>, 없으면 null)
|
|
71
|
+
aitop --remote dev,me@vm2,wsl:Ubuntu-22.04 SSH 원격과 WSL 배포판의 세션을 함께 본다. 각 원격에서 aitop --json --no-remote 를
|
|
72
|
+
ssh -o BatchMode=yes(wsl.exe -d <배포판>)로 10초마다 실행한다 (원격에도 aitop 설치 필요, 한 번에 20초 제한).
|
|
73
|
+
인증은 내 ssh 설정·agent 에 맡기고 비밀번호는 묻지 않는다. 표에는 로컬 세션 아래 호스트별 '── dev · 3 세션 ──' 줄로 나뉜다.
|
|
74
|
+
원격 세션은 변경 내용(diff)·아티팩트 원본을 가져오지 않고, 비용은 헤더 합계에 더하지 않는다 (설정 파일 remotes, --no-remote 로 끔)
|
|
71
75
|
aitop --report daily [--by tool|model|project] [--days N] [--json] 최근 N일(기본·최대 30)의 날짜별 토큰·비용(API 정가 환산)을
|
|
72
76
|
도구별·모델별·프로젝트별 표로 내고 끝낸다. 최근 날짜가 위, 맨 아래는 합계. 처음 실행은 30일치 기록을 읽느라 오래 걸릴 수 있다
|
|
73
77
|
프로젝트는 작업 폴더의 마지막 이름이고, 열이 터미널 폭을 넘으면 비용이 작은 쪽을 (그 외) 로 합친다
|
|
@@ -86,14 +90,14 @@ const HELP_KO = `{logo} aitop - 터미널에서 Claude Code · Codex · Antigrav
|
|
|
86
90
|
aitop --notify=waiting,done,context 알릴 종류를 고른다 (--notify 만 주면 설정 파일 notify 배열, 없으면 waiting). done: 3분(설정 파일 doneMinutes, 응답 대기 시간 빼고) 넘게 작업하던 세션이 다음 지시를
|
|
87
91
|
기다리면 한 번. context: 컨텍스트가 90% 를 넘으면 한 번 (85% 아래로 내려가면 다시)
|
|
88
92
|
aitop --on-waiting <명령> 알릴 일이 생기면 /bin/sh -c (Windows 는 cmd.exe /c) 로 명령을 실행한다 (내 권한으로 실행, 10초 제한). 종류는 --notify 를 따른다 (--no-notify 여도)
|
|
89
|
-
세션 정보는 환경변수로만: AITOP_EVENT(waiting|done|context) AITOP_TOOL AITOP_PROJECT AITOP_SESSION_ID AITOP_CWD AITOP_WAITING_FOR
|
|
93
|
+
세션 정보는 환경변수로만: AITOP_EVENT(waiting|done|context) AITOP_TOOL AITOP_PROJECT AITOP_SESSION_ID AITOP_CWD AITOP_WAITING_FOR AITOP_HOST(원격 세션만)
|
|
90
94
|
aitop --show-requests 응답 대기 요청 전체를 상세 패널·--json 에 보인다 (AITOP_SHOW_REQUESTS=1). 비밀값 가림은 최선일 뿐이라 명령 속 비밀값이 보일 수 있다
|
|
91
95
|
aitop --budget-day <달러> 하루 예산. 헤더에 오늘 $12.30/$50 처럼 보이고, 오늘 끝 예상 비용(오늘 + 최근 속도 × 자정까지, 늘 API 환산)이
|
|
92
96
|
80% 를 넘으면 '예상 $45', 100% 를 넘으면 '예상 $60!' 로 알린다 (AITOP_BUDGET_DAY, 설정 파일 budgetDay)
|
|
93
97
|
aitop --theme light|dark 밝은 배경 / 어두운 배경 색 (없으면 COLORFGBG 로 고른다)
|
|
94
98
|
aitop --color-blind 적록 색약용 색. 응답 대기·돈·경고·diff 를 노랑·파랑 계열로 가른다 (AITOP_COLOR_BLIND=1, 설정 파일 colorBlind). --theme 과 함께 쓴다
|
|
95
99
|
aitop --lang ko|en 화면·--help·--doctor·오류 문구의 언어 (AITOP_LANG, 설정 파일 lang, 없으면 LC_ALL·LC_MESSAGES·LANG 이 ko 로 시작할 때 한국어)
|
|
96
|
-
aitop --no-bell · --no-all · --no-show-requests · --no-notify · --no-on-waiting · --no-budget-day · --no-debug · --no-color-blind 설정 파일에서 켠 값을 이번 실행만 끈다
|
|
100
|
+
aitop --no-bell · --no-all · --no-show-requests · --no-notify · --no-on-waiting · --no-budget-day · --no-debug · --no-color-blind · --no-remote 설정 파일에서 켠 값을 이번 실행만 끈다
|
|
97
101
|
aitop --debug 디버그 로그를 남긴다 (AITOP_DEBUG=1, 설정 파일 debug). 기록 형식이 바뀌어 값이 빌 때 원인 확인용
|
|
98
102
|
{logPath} (1MB 넘으면 .1 로 하나만 남김, 오류 이름·파일 이름만 쓰고 비밀값은 가림)
|
|
99
103
|
aitop --print-config 설정 값마다 값과 출처(flag/env/file/default), 설정 파일 위치를 보인다 (--json 과 함께 쓸 수 있다)
|
|
@@ -109,6 +113,7 @@ const HELP_KO = `{logo} aitop - 터미널에서 Claude Code · Codex · Antigrav
|
|
|
109
113
|
claudeDirs, codexHomes: 읽을 Claude 설정 폴더·Codex 홈 목록 (예: ["~/.claude", "~/.claude-work"], 기본 ~/.claude, ~/.codex).
|
|
110
114
|
AITOP_CLAUDE_DIRS, AITOP_CODEX_HOMES 에 경로를 : (Windows 는 ;) 로 이어 주면 설정 파일보다 먼저 쓴다.
|
|
111
115
|
설정 파일 목록이 있으면 물려받은 CLAUDE_CONFIG_DIR, CODEX_HOME 은 쓰지 않는다 (없으면 그 경로를 읽는다)
|
|
116
|
+
remotes: 모아 볼 원격 목록 (예: ["dev", "wsl:Ubuntu"]). --remote 가 덮는다
|
|
112
117
|
onWaiting 은 파일 소유자가 나이고 그룹·다른 사용자가 쓸 수 없을 때(chmod 600)만 받는다.
|
|
113
118
|
옵션 > 환경 변수 > 설정 파일 순서로 정한다. 잘못된 값은 무시하고 --doctor 에 알린다.
|
|
114
119
|
|
|
@@ -128,6 +133,10 @@ const HELP_EN = `{logo} aitop - watch Claude Code, Codex, Antigravity and Gemini
|
|
|
128
133
|
show only when the live screen, --once or --json left a summary in the last minute
|
|
129
134
|
aitop --json print the session list and usage totals as JSON once (works with --all)
|
|
130
135
|
Each session has resumeCmd, the command that reopens it (e.g. cd /repo && claude --resume <id>, null if none)
|
|
136
|
+
aitop --remote dev,me@vm2,wsl:Ubuntu-22.04 also show sessions on SSH hosts and WSL distros. Runs aitop --json --no-remote on each one
|
|
137
|
+
with ssh -o BatchMode=yes (wsl.exe -d <distro>) every 10 seconds (aitop must be installed there, 20 second limit per call).
|
|
138
|
+
Auth is left to your ssh config and agent; no password prompts. The table splits them below local sessions with '── dev · 3 sessions ──' lines.
|
|
139
|
+
Remote diffs and artifact sources are not fetched, and remote cost is not added to the header (config remotes, off with --no-remote)
|
|
131
140
|
aitop --report daily [--by tool|model|project] [--days N] [--json] print daily tokens and cost (API list price) for the last N days
|
|
132
141
|
(default and max 30) by tool, model or project, then exit. Newest day first, total at the bottom. The first run reads 30 days of logs and may take a while
|
|
133
142
|
A project is the last folder name of the working directory. Columns beyond the terminal width are merged into (others)
|
|
@@ -148,14 +157,14 @@ const HELP_EN = `{logo} aitop - watch Claude Code, Codex, Antigravity and Gemini
|
|
|
148
157
|
aitop --notify=waiting,done,context pick what to notify about (plain --notify: the config notify list, else waiting). done: once when a session that worked for
|
|
149
158
|
over 3 minutes (config doneMinutes, approval waits not counted) waits for its next instruction. context: once when context passes 90% (again after it drops below 85%)
|
|
150
159
|
aitop --on-waiting <cmd> run a command with /bin/sh -c (cmd.exe /c on Windows) when there is something to notify (runs as you, 10 second limit). Follows the --notify kinds (even with --no-notify)
|
|
151
|
-
Session info is passed only in env vars: AITOP_EVENT(waiting|done|context) AITOP_TOOL AITOP_PROJECT AITOP_SESSION_ID AITOP_CWD AITOP_WAITING_FOR
|
|
160
|
+
Session info is passed only in env vars: AITOP_EVENT(waiting|done|context) AITOP_TOOL AITOP_PROJECT AITOP_SESSION_ID AITOP_CWD AITOP_WAITING_FOR AITOP_HOST(remote sessions only)
|
|
152
161
|
aitop --show-requests show full waiting requests in the detail panel and --json (AITOP_SHOW_REQUESTS=1). Secret masking is best effort, so secrets in commands may show
|
|
153
162
|
aitop --budget-day <usd> daily budget. The header shows today $12.30/$50, and it warns when the projected end-of-day cost (today + recent rate until midnight, always API cost)
|
|
154
163
|
passes 80%, and in the warning color with ! past 100% (AITOP_BUDGET_DAY, config budgetDay)
|
|
155
164
|
aitop --theme light|dark colors for a light or dark background (picked from COLORFGBG if not set)
|
|
156
165
|
aitop --color-blind red-green color blind palette. Waiting, money, warnings and diffs use yellow and blue (AITOP_COLOR_BLIND=1, config colorBlind). Works with --theme
|
|
157
166
|
aitop --lang ko|en language for the screen, --help, --doctor and error messages (AITOP_LANG, config lang, else Korean when LC_ALL, LC_MESSAGES or LANG starts with ko)
|
|
158
|
-
aitop --no-bell · --no-all · --no-show-requests · --no-notify · --no-on-waiting · --no-budget-day · --no-debug · --no-color-blind turn off a config file setting for this run
|
|
167
|
+
aitop --no-bell · --no-all · --no-show-requests · --no-notify · --no-on-waiting · --no-budget-day · --no-debug · --no-color-blind · --no-remote turn off a config file setting for this run
|
|
159
168
|
aitop --debug write a debug log (AITOP_DEBUG=1, config debug). Useful when a log format changes and values go blank
|
|
160
169
|
{logPath} (keeps one .1 file past 1MB, writes only error and file names, masks secrets)
|
|
161
170
|
aitop --print-config show each setting with its value, source (flag/env/file/default) and the config file path (works with --json)
|
|
@@ -171,6 +180,7 @@ const HELP_EN = `{logo} aitop - watch Claude Code, Codex, Antigravity and Gemini
|
|
|
171
180
|
claudeDirs, codexHomes: Claude config folders and Codex homes to read (e.g. ["~/.claude", "~/.claude-work"], default ~/.claude, ~/.codex).
|
|
172
181
|
AITOP_CLAUDE_DIRS and AITOP_CODEX_HOMES take paths joined with : (; on Windows) and win over the config file.
|
|
173
182
|
With a config list, an inherited CLAUDE_CONFIG_DIR or CODEX_HOME is not used (without one, that path is read)
|
|
183
|
+
remotes: remote hosts to show (e.g. ["dev", "wsl:Ubuntu"]). --remote overrides it
|
|
174
184
|
onWaiting is accepted only when you own the file and no group or other user can write it (chmod 600).
|
|
175
185
|
Order: option > env var > config file. Bad values are ignored and reported by --doctor.
|
|
176
186
|
|
|
@@ -267,6 +277,9 @@ export const STRINGS = {
|
|
|
267
277
|
'opt.daysDaily': '--days 는 --report daily 와 함께 쓴다 (monthly 는 --months)',
|
|
268
278
|
'opt.monthsMonthly': '--months 는 --report monthly 와 함께 쓴다 (daily 는 --days)',
|
|
269
279
|
'opt.reportOnly': '--by, --days, --months 는 --report 와 함께 쓴다',
|
|
280
|
+
'opt.remoteMissing': '--remote 값이 없습니다 (쉼표로 이은 SSH 호스트 또는 wsl:<배포판>)',
|
|
281
|
+
'opt.remoteBad': '--remote 값 {value} 이 잘못되었습니다 (SSH 호스트 별칭·user@host 또는 wsl:<배포판>. - 로 시작하는 값·포트(:22)·공백은 받지 않는다. 포트는 ~/.ssh/config 별칭으로 준다)',
|
|
282
|
+
'opt.remoteMany': '--remote 는 {n}개까지 준다',
|
|
270
283
|
|
|
271
284
|
// 기간 리포트 (--report daily). 도구·모델 이름은 번역하지 않는다.
|
|
272
285
|
'report.title': '날짜별 사용량 · 최근 {n}일 ({from} ~ {to}) · {by} · API 정가 환산',
|
|
@@ -348,6 +361,7 @@ export const STRINGS = {
|
|
|
348
361
|
'cfg.paths': '절대 경로(또는 ~/...) 문자열 배열, 1~16개',
|
|
349
362
|
'cfg.agyApp': 'true, false 또는 절대 경로(또는 ~/...) 배열',
|
|
350
363
|
'cfg.cowork': 'true, false 또는 Claude 앱 폴더 절대 경로(또는 ~/...) 배열',
|
|
364
|
+
'cfg.remotes': 'SSH 호스트(별칭·user@host) 또는 "wsl:<배포판>" 문자열 배열, 1~16개',
|
|
351
365
|
'cfg.agyAppEnv': 'off 또는 절대 경로(또는 ~/...) 목록',
|
|
352
366
|
'cfg.masked': '설정 파일의 {key} 는 {name} 이 있어 무시합니다',
|
|
353
367
|
'cfg.file': '설정 파일: {path} ({state})',
|
|
@@ -400,6 +414,7 @@ export const STRINGS = {
|
|
|
400
414
|
'doctor.debugOn': '켬',
|
|
401
415
|
'doctor.debugOff': '꺼짐',
|
|
402
416
|
'doctor.debugTail': ' · --debug 로 켬',
|
|
417
|
+
'doctor.remotes': '{mark} 원격 {list} (점검에서는 접속하지 않는다)',
|
|
403
418
|
|
|
404
419
|
// 상태 문구 (phaseText 가 phase.msg ?? phase.kind 로 고른다). --json 의 phase 는 늘 이 한국어 표로 만든다.
|
|
405
420
|
'phase.ended': '종료',
|
|
@@ -471,6 +486,19 @@ export const STRINGS = {
|
|
|
471
486
|
'member.sdk': '-p',
|
|
472
487
|
'session.auto': '자동',
|
|
473
488
|
'group.count': '{n}개',
|
|
489
|
+
// 원격 호스트 구분 줄 (#308): '── dev · 3 세션 · 10초 전 ──', 실패하면 '── dev · 연결 안 됨 (시간 초과) ──'.
|
|
490
|
+
'remote.count': '{n} 세션',
|
|
491
|
+
'remote.secAgo': '{n}초 전',
|
|
492
|
+
'remote.minAgo': '{n}분 전',
|
|
493
|
+
'remote.pending': '연결 중…',
|
|
494
|
+
'remote.down': '연결 안 됨 ({why})',
|
|
495
|
+
'remote.err.auth': '인증 실패',
|
|
496
|
+
'remote.err.unreachable': '접속 실패',
|
|
497
|
+
'remote.err.notFound': '원격에 aitop 없음',
|
|
498
|
+
'remote.err.old': '원격 aitop 이 옛 버전',
|
|
499
|
+
'remote.err.newer': '원격 aitop 이 더 새 버전',
|
|
500
|
+
'remote.err.timeout': '시간 초과',
|
|
501
|
+
'remote.err.bad': '잘못된 응답',
|
|
474
502
|
'group.waiting': '응답 대기',
|
|
475
503
|
'group.pinned': '고정',
|
|
476
504
|
'group.noFolder': '(폴더 없음)',
|
|
@@ -512,6 +540,7 @@ export const STRINGS = {
|
|
|
512
540
|
'foot.costMode': '비용 기준',
|
|
513
541
|
'foot.copied': '이어 여는 명령을 클립보드로 보냄 (OSC 52)',
|
|
514
542
|
'foot.copyNone': '이 세션은 이어 여는 명령이 없다',
|
|
543
|
+
'foot.remoteNoSource': '원격 세션은 아티팩트 원본을 열 수 없다 (링크만)',
|
|
515
544
|
'foot.notify': '알림:{v}',
|
|
516
545
|
'foot.notifyHint': '응답 대기 알림 켜기: a',
|
|
517
546
|
'foot.notifyOn': '응답 대기 알림 켬 (이번 실행만)',
|
|
@@ -635,6 +664,8 @@ export const STRINGS = {
|
|
|
635
664
|
'detail.hidden': '비밀값이 있을 수 있는 파일이라 변경 내용을 숨겼습니다',
|
|
636
665
|
'detail.deleted': '이 파일을 삭제했습니다',
|
|
637
666
|
'detail.noHunks': '보관된 변경 내용이 없습니다',
|
|
667
|
+
'detail.remoteDiff': '원격 세션은 변경 내용 없음 (파일 통계만 받는다)',
|
|
668
|
+
'detail.host': '호스트',
|
|
638
669
|
// 소스(claude·codex)가 메인 세션의 변경에 붙이는 이름. 화면에서만 바꾼다.
|
|
639
670
|
'detail.main': '메인',
|
|
640
671
|
'detail.cut': '… {n}줄 생략',
|
|
@@ -798,6 +829,9 @@ export const STRINGS = {
|
|
|
798
829
|
'opt.daysDaily': '--days only works with --report daily (use --months for monthly)',
|
|
799
830
|
'opt.monthsMonthly': '--months only works with --report monthly (use --days for daily)',
|
|
800
831
|
'opt.reportOnly': '--by, --days and --months only work with --report',
|
|
832
|
+
'opt.remoteMissing': '--remote needs a value (SSH hosts or wsl:<distro>, joined with commas)',
|
|
833
|
+
'opt.remoteBad': 'bad --remote value {value} (an SSH host alias, user@host or wsl:<distro>. Values starting with -, ports (:22) and spaces are not accepted. Set a port with an alias in ~/.ssh/config)',
|
|
834
|
+
'opt.remoteMany': '--remote takes at most {n} hosts',
|
|
801
835
|
|
|
802
836
|
'report.title': 'Daily usage, last {n} days ({from} to {to}), {by}, API list price',
|
|
803
837
|
'report.by.tool': 'by tool',
|
|
@@ -877,6 +911,7 @@ export const STRINGS = {
|
|
|
877
911
|
'cfg.paths': 'a list of 1 to 16 absolute paths (or ~/...)',
|
|
878
912
|
'cfg.agyApp': 'true, false, or a list of absolute paths (or ~/...)',
|
|
879
913
|
'cfg.cowork': 'true, false, or a list of absolute Claude app folder paths (or ~/...)',
|
|
914
|
+
'cfg.remotes': 'a list of 1 to 16 SSH hosts (alias or user@host) or "wsl:<distro>" strings',
|
|
880
915
|
'cfg.agyAppEnv': 'off or a list of absolute paths (or ~/...)',
|
|
881
916
|
'cfg.masked': 'ignoring {key} in the config file because {name} is set',
|
|
882
917
|
'cfg.file': 'Config file: {path} ({state})',
|
|
@@ -929,6 +964,7 @@ export const STRINGS = {
|
|
|
929
964
|
'doctor.debugOn': 'on',
|
|
930
965
|
'doctor.debugOff': 'off',
|
|
931
966
|
'doctor.debugTail': ' · turn on with --debug',
|
|
967
|
+
'doctor.remotes': '{mark} remote {list} (not contacted by the check)',
|
|
932
968
|
|
|
933
969
|
'phase.ended': 'Ended',
|
|
934
970
|
'phase.done': 'Done',
|
|
@@ -993,6 +1029,18 @@ export const STRINGS = {
|
|
|
993
1029
|
'member.sdk': '-p',
|
|
994
1030
|
'session.auto': 'auto',
|
|
995
1031
|
'group.count': '{n}',
|
|
1032
|
+
'remote.count': '{n} sessions',
|
|
1033
|
+
'remote.secAgo': '{n}s ago',
|
|
1034
|
+
'remote.minAgo': '{n}m ago',
|
|
1035
|
+
'remote.pending': 'connecting…',
|
|
1036
|
+
'remote.down': 'not connected ({why})',
|
|
1037
|
+
'remote.err.auth': 'auth failed',
|
|
1038
|
+
'remote.err.unreachable': 'unreachable',
|
|
1039
|
+
'remote.err.notFound': 'no aitop on remote',
|
|
1040
|
+
'remote.err.old': 'remote aitop too old',
|
|
1041
|
+
'remote.err.newer': 'remote aitop newer',
|
|
1042
|
+
'remote.err.timeout': 'timed out',
|
|
1043
|
+
'remote.err.bad': 'bad response',
|
|
996
1044
|
'group.waiting': 'Waiting',
|
|
997
1045
|
'group.pinned': 'Pinned',
|
|
998
1046
|
'group.noFolder': '(no folder)',
|
|
@@ -1034,6 +1082,7 @@ export const STRINGS = {
|
|
|
1034
1082
|
'foot.costMode': 'cost',
|
|
1035
1083
|
'foot.copied': 'resume command sent to clipboard (OSC 52)',
|
|
1036
1084
|
'foot.copyNone': 'no resume command for this session',
|
|
1085
|
+
'foot.remoteNoSource': 'remote sessions cannot open artifact sources (link only)',
|
|
1037
1086
|
'foot.notify': 'alerts:{v}',
|
|
1038
1087
|
'foot.notifyHint': 'turn on waiting alerts: a',
|
|
1039
1088
|
'foot.notifyOn': 'waiting alerts on (this run only)',
|
|
@@ -1155,6 +1204,8 @@ export const STRINGS = {
|
|
|
1155
1204
|
'detail.hidden': 'Changes hidden because this file may hold secrets',
|
|
1156
1205
|
'detail.deleted': 'This file was deleted',
|
|
1157
1206
|
'detail.noHunks': 'No saved changes',
|
|
1207
|
+
'detail.remoteDiff': 'No changes for remote sessions (file stats only)',
|
|
1208
|
+
'detail.host': 'Host',
|
|
1158
1209
|
'detail.main': 'main',
|
|
1159
1210
|
'detail.cut': { one: '… {n} line cut', other: '… {n} lines cut' },
|
|
1160
1211
|
'detail.dropped': { one: '… {n} older change cut (over the limit)', other: '… {n} older changes cut (over the limit)' },
|