@claude-transcripts/cli 0.2.0 → 0.3.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/dist/cli.js +14 -10
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -42121,6 +42121,9 @@ function ago(ms, now) {
|
|
|
42121
42121
|
return `${m}m ago`;
|
|
42122
42122
|
return `${Math.round(m / 60)}h ago`;
|
|
42123
42123
|
}
|
|
42124
|
+
function versionLabel(version = VERSION) {
|
|
42125
|
+
return `ct@${version === DEV_VERSION ? "dev" : version}`;
|
|
42126
|
+
}
|
|
42124
42127
|
function whereLabel(t) {
|
|
42125
42128
|
const host = t.couchUrl.replace(/^https?:\/\//, "").replace(/\/.*$/, "");
|
|
42126
42129
|
return `${t.sessionsDb}@${host}`;
|
|
@@ -42131,11 +42134,12 @@ function storeState(s, now) {
|
|
|
42131
42134
|
return s.lastWriteMs > 0 ? "healthy" : "idle";
|
|
42132
42135
|
}
|
|
42133
42136
|
function renderStatusline(state, now = Date.now()) {
|
|
42137
|
+
const ct = versionLabel(state.version);
|
|
42134
42138
|
if (!state.configured)
|
|
42135
|
-
return
|
|
42139
|
+
return `\u25CB ${ct} off \xB7 no instance configured`;
|
|
42136
42140
|
const t = state.targets;
|
|
42137
42141
|
if (!t)
|
|
42138
|
-
return
|
|
42142
|
+
return `\u25CB ${ct} off \xB7 not recording this session`;
|
|
42139
42143
|
const c = state.counts;
|
|
42140
42144
|
const toolCalls = c ? Object.values(c.tools).reduce((a, b) => a + b, 0) : 0;
|
|
42141
42145
|
const counts = c ? `${c.events} ev \xB7 ${toolCalls} tools` : "0 ev";
|
|
@@ -42145,29 +42149,29 @@ function renderStatusline(state, now = Date.now()) {
|
|
|
42145
42149
|
const failing = t.lastFailureMs > t.lastWriteMs && now - t.lastWriteMs > STALL_AFTER_MS;
|
|
42146
42150
|
if (failing) {
|
|
42147
42151
|
const last = written ? `last write ${ago(t.lastWriteMs, now)}` : "no write landed";
|
|
42148
|
-
return `\u25D0 ct stalled \xB7 ${counts} \xB7 ${last} \u2192 ${whereLabel(t)}`;
|
|
42152
|
+
return `\u25D0 ${ct} stalled \xB7 ${counts} \xB7 ${last} \u2192 ${whereLabel(t)}`;
|
|
42149
42153
|
}
|
|
42150
42154
|
if (!written)
|
|
42151
|
-
return `\u25CC ct ready \xB7 ${counts} \xB7 no write yet \u2192 ${whereLabel(t)}`;
|
|
42152
|
-
return `\u25CF ct rec \xB7 ${counts} \xB7 ${ago(t.lastWriteMs, now)} \u2192 ${whereLabel(t)}`;
|
|
42155
|
+
return `\u25CC ${ct} ready \xB7 ${counts} \xB7 no write yet \u2192 ${whereLabel(t)}`;
|
|
42156
|
+
return `\u25CF ${ct} rec \xB7 ${counts} \xB7 ${ago(t.lastWriteMs, now)} \u2192 ${whereLabel(t)}`;
|
|
42153
42157
|
}
|
|
42154
42158
|
const direct = stores.find((s) => s.kind === "direct") ?? stores[0];
|
|
42155
42159
|
const headline = direct ?? { label: whereLabel(t), lastWriteMs: 0, lastFailureMs: 0 };
|
|
42156
42160
|
if (direct && storeState(direct, now) === "healthy") {
|
|
42157
|
-
return `\u25CF ct rec \xB7 ${counts} \xB7 ${ago(direct.lastWriteMs, now)} \u2192 ${direct.label}`;
|
|
42161
|
+
return `\u25CF ${ct} rec \xB7 ${counts} \xB7 ${ago(direct.lastWriteMs, now)} \u2192 ${direct.label}`;
|
|
42158
42162
|
}
|
|
42159
42163
|
const healthyMirrors = stores.filter((s) => s !== direct && storeState(s, now) === "healthy");
|
|
42160
42164
|
const first = healthyMirrors[0];
|
|
42161
42165
|
if (first) {
|
|
42162
42166
|
const more = healthyMirrors.length > 1 ? ` +${healthyMirrors.length - 1}` : "";
|
|
42163
|
-
return `\u25CF ct rec (mirror) \xB7 ${counts} \xB7 ${ago(first.lastWriteMs, now)} \u2192 ${first.label}${more}`;
|
|
42167
|
+
return `\u25CF ${ct} rec (mirror) \xB7 ${counts} \xB7 ${ago(first.lastWriteMs, now)} \u2192 ${first.label}${more}`;
|
|
42164
42168
|
}
|
|
42165
42169
|
if (stores.some((s) => storeState(s, now) === "failing")) {
|
|
42166
42170
|
const best = Math.max(...stores.map((s) => s.lastWriteMs));
|
|
42167
42171
|
const last = best > 0 ? `last write ${ago(best, now)}` : "no write landed";
|
|
42168
|
-
return `\u25D0 ct stalled \xB7 ${counts} \xB7 ${last} \u2192 ${headline.label}`;
|
|
42172
|
+
return `\u25D0 ${ct} stalled \xB7 ${counts} \xB7 ${last} \u2192 ${headline.label}`;
|
|
42169
42173
|
}
|
|
42170
|
-
return `\u25CC ct ready \xB7 ${counts} \xB7 no write yet \u2192 ${headline.label}`;
|
|
42174
|
+
return `\u25CC ${ct} ready \xB7 ${counts} \xB7 no write yet \u2192 ${headline.label}`;
|
|
42171
42175
|
}
|
|
42172
42176
|
|
|
42173
42177
|
// packages/cli/src/commands/statusline.ts
|
|
@@ -42201,7 +42205,7 @@ async function render2() {
|
|
|
42201
42205
|
process.stdout.write(`${line}
|
|
42202
42206
|
`);
|
|
42203
42207
|
} catch {
|
|
42204
|
-
process.stdout.write(`\u25CB
|
|
42208
|
+
process.stdout.write(`\u25CB ${versionLabel()} off
|
|
42205
42209
|
`);
|
|
42206
42210
|
}
|
|
42207
42211
|
return 0;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@claude-transcripts/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Claude Transcripts CLI — browse, search, back up, and administer your self-hosted Claude Code session history.",
|
|
6
6
|
"keywords": [
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"LICENSE"
|
|
35
35
|
],
|
|
36
36
|
"engines": {
|
|
37
|
-
"bun": ">=1.
|
|
37
|
+
"bun": ">=1.4.0"
|
|
38
38
|
},
|
|
39
39
|
"publishConfig": {
|
|
40
40
|
"access": "public"
|