mixdog 0.9.66 → 0.9.67
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/package.json +1 -1
- package/src/runtime/agent/orchestrator/session/store-summary-index.mjs +4 -0
- package/src/runtime/agent/orchestrator/session/store-summary-reader.mjs +10 -0
- package/src/runtime/channels/lib/config.mjs +7 -0
- package/src/runtime/channels/lib/status-snapshot.mjs +6 -30
- package/src/runtime/channels/lib/webhook/relay-tunnel.mjs +203 -0
- package/src/runtime/channels/lib/webhook.mjs +23 -201
- package/src/runtime/shared/config.mjs +0 -9
- package/src/runtime/shared/time-format.mjs +56 -0
- package/src/runtime/shared/tool-card-model.mjs +740 -0
- package/src/session-runtime/channel-config-api.mjs +5 -0
- package/src/session-runtime/lifecycle-api.mjs +5 -0
- package/src/session-runtime/prewarm.mjs +13 -7
- package/src/session-runtime/runtime-core.mjs +28 -9
- package/src/session-runtime/session-text.mjs +6 -0
- package/src/session-runtime/settings-api.mjs +0 -12
- package/src/standalone/channel-admin.mjs +35 -21
- package/src/tui/App.jsx +0 -15
- package/src/tui/app/channel-pickers.mjs +18 -42
- package/src/tui/app/doctor.mjs +0 -1
- package/src/tui/components/ToolExecution.jsx +47 -196
- package/src/tui/components/tool-execution/surface-detail.mjs +33 -394
- package/src/tui/components/tool-execution/text-format.mjs +27 -104
- package/src/tui/dist/index.mjs +306 -185
- package/src/tui/engine/live-share.mjs +9 -0
- package/src/tui/engine/session-api-ext.mjs +0 -10
- package/src/tui/time-format.mjs +4 -51
- package/src/runtime/channels/lib/webhook/ngrok.mjs +0 -181
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* runtime/shared/time-format.mjs — compact elapsed-time labels shared by every
|
|
3
|
+
* surface (TUI, terminal, desktop renderer). Moved verbatim from
|
|
4
|
+
* src/tui/time-format.mjs so tool-card detail rows ("Running · 12s") derive
|
|
5
|
+
* from ONE formatter; the TUI module re-exports from here.
|
|
6
|
+
*
|
|
7
|
+
* Examples:
|
|
8
|
+
* 42s
|
|
9
|
+
* 9m 23s
|
|
10
|
+
* 1h 2m 3s
|
|
11
|
+
* 1d 3h 20m
|
|
12
|
+
*/
|
|
13
|
+
export function formatDuration(ms, options = {}) {
|
|
14
|
+
if (!Number.isFinite(Number(ms))) return '';
|
|
15
|
+
const value = Math.max(0, Number(ms) || 0);
|
|
16
|
+
if (value < 60_000) {
|
|
17
|
+
if (value < 1_000) return '';
|
|
18
|
+
return `${Math.floor(value / 1000)}s`;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
let days = Math.floor(value / 86_400_000);
|
|
22
|
+
let hours = Math.floor((value % 86_400_000) / 3_600_000);
|
|
23
|
+
let minutes = Math.floor((value % 3_600_000) / 60_000);
|
|
24
|
+
const seconds = Math.floor((value % 60_000) / 1000);
|
|
25
|
+
|
|
26
|
+
if (options.mostSignificantOnly) {
|
|
27
|
+
if (days > 0) return `${days}d`;
|
|
28
|
+
if (hours > 0) return `${hours}h`;
|
|
29
|
+
if (minutes > 0) return `${minutes}m`;
|
|
30
|
+
return `${seconds}s`;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const hide = options.hideTrailingZeros;
|
|
34
|
+
if (days > 0) {
|
|
35
|
+
if (hide && hours === 0 && minutes === 0) return `${days}d`;
|
|
36
|
+
if (hide && minutes === 0) return `${days}d ${hours}h`;
|
|
37
|
+
return `${days}d ${hours}h ${minutes}m`;
|
|
38
|
+
}
|
|
39
|
+
if (hours > 0) {
|
|
40
|
+
if (hide && minutes === 0 && seconds === 0) return `${hours}h`;
|
|
41
|
+
if (hide && seconds === 0) return `${hours}h ${minutes}m`;
|
|
42
|
+
return `${hours}h ${minutes}m ${seconds}s`;
|
|
43
|
+
}
|
|
44
|
+
if (minutes > 0) {
|
|
45
|
+
if (hide && seconds === 0) return `${minutes}m`;
|
|
46
|
+
return `${minutes}m ${seconds}s`;
|
|
47
|
+
}
|
|
48
|
+
return `${seconds}s`;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function formatElapsed(ms) {
|
|
52
|
+
const n = Math.max(0, Number(ms || 0));
|
|
53
|
+
if (!Number.isFinite(n) || n <= 0) return '';
|
|
54
|
+
if (n < 1000) return '';
|
|
55
|
+
return formatDuration(n);
|
|
56
|
+
}
|