mixdog 0.9.166 → 0.9.167
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/scripts/audit-usage-ledger.mjs +86 -0
- package/scripts/generate-voice-runtime-manifest.mjs +22 -17
- package/scripts/memory-chunk-quality.mjs +128 -0
- package/scripts/memory-layer2-check.mjs +133 -0
- package/scripts/model-catalog-audit.mjs +6 -0
- package/scripts/native-tool-download.mjs +14 -0
- package/scripts/prepare-native-assets.mjs +2 -7
- package/scripts/tool-failures.mjs +7 -2
- package/scripts/verify-release-assets.mjs +48 -90
- package/src/defaults/skills/browser-use/SKILL.md +33 -18
- package/src/defaults/skills/computer-use/SKILL.md +16 -8
- package/src/lib/keychain-cjs.cjs +0 -1
- package/src/lib/rules-builder.cjs +4 -1
- package/src/rules/agent/40-cycle1-agent.md +21 -13
- package/src/rules/lead/01-general.md +8 -3
- package/src/rules/shared/10-tool-workflow.md +20 -11
- package/src/rules/shared/30-exploration.md +11 -4
- package/src/rules/shared/40-editing.md +2 -3
- package/src/rules/shared/50-execution.md +6 -3
- package/src/rules/shared/60-verification.md +3 -2
- package/src/rules/shared/70-delivery.md +0 -4
- package/src/runtime/agent/orchestrator/agent-runtime/agent-dispatch.mjs +51 -45
- package/src/runtime/agent/orchestrator/agent-runtime/agent-progress-watchdog.mjs +3 -4
- package/src/runtime/agent/orchestrator/agent-trace-format.mjs +44 -7
- package/src/runtime/agent/orchestrator/agent-trace.mjs +9 -0
- package/src/runtime/agent/orchestrator/config.mjs +9 -4
- package/src/runtime/agent/orchestrator/context/collect.mjs +25 -1055
- package/src/runtime/agent/orchestrator/context/deferred-tools.mjs +272 -0
- package/src/runtime/agent/orchestrator/context/role-instructions.mjs +296 -0
- package/src/runtime/agent/orchestrator/context/skill-catalog.mjs +523 -0
- package/src/runtime/agent/orchestrator/providers/account-pool.mjs +7 -2
- package/src/runtime/agent/orchestrator/providers/anthropic-sse.mjs +13 -14
- package/src/runtime/agent/orchestrator/providers/antigravity-oauth-catalog.mjs +214 -0
- package/src/runtime/agent/orchestrator/providers/antigravity-oauth-login.mjs +220 -116
- package/src/runtime/agent/orchestrator/providers/antigravity-oauth-tokens.mjs +74 -44
- package/src/runtime/agent/orchestrator/providers/antigravity-oauth.mjs +191 -29
- package/src/runtime/agent/orchestrator/providers/antigravity-request.mjs +13 -12
- package/src/runtime/agent/orchestrator/providers/cursor-wire-guards.mjs +1 -9
- package/src/runtime/agent/orchestrator/providers/cursor-wire-protobuf.mjs +5 -2
- package/src/runtime/agent/orchestrator/providers/cursor-wire.mjs +48 -25
- package/src/runtime/agent/orchestrator/providers/gemini-schema.mjs +28 -2
- package/src/runtime/agent/orchestrator/providers/gemini-stream.mjs +3 -1
- package/src/runtime/agent/orchestrator/providers/grok-oauth-tokens.mjs +1 -8
- package/src/runtime/agent/orchestrator/providers/lib/action-input-contract.mjs +32 -0
- package/src/runtime/agent/orchestrator/providers/lib/anthropic-request-utils.mjs +21 -6
- package/src/runtime/agent/orchestrator/providers/lib/grok-tool-schema.mjs +61 -13
- package/src/runtime/agent/orchestrator/providers/model-catalog-projection.mjs +6 -1
- package/src/runtime/agent/orchestrator/providers/model-catalog.mjs +123 -118
- package/src/runtime/agent/orchestrator/providers/model-pricing-rates.mjs +54 -0
- package/src/runtime/agent/orchestrator/providers/oauth-credential-probes.mjs +5 -2
- package/src/runtime/agent/orchestrator/providers/oauth-usage.mjs +34 -3
- package/src/runtime/agent/orchestrator/providers/openai-codex-endpoints.mjs +21 -0
- package/src/runtime/agent/orchestrator/providers/openai-oauth-catalog.mjs +154 -0
- package/src/runtime/agent/orchestrator/providers/openai-oauth-http-sse.mjs +2 -1
- package/src/runtime/agent/orchestrator/providers/openai-oauth-tokens.mjs +322 -0
- package/src/runtime/agent/orchestrator/providers/openai-oauth.mjs +243 -702
- package/src/runtime/agent/orchestrator/providers/openai-responses-payload.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/openai-startup-prewarm.mjs +221 -0
- package/src/runtime/agent/orchestrator/providers/openai-ws-stream.mjs +3 -2
- package/src/runtime/agent/orchestrator/providers/openai-ws.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/provider-catalog-cache.mjs +19 -0
- package/src/runtime/agent/orchestrator/providers/provider-model-identities.mjs +40 -0
- package/src/runtime/agent/orchestrator/session/agent-loop.mjs +120 -710
- package/src/runtime/agent/orchestrator/session/cache/read-cache.mjs +36 -15
- package/src/runtime/agent/orchestrator/session/cache/util.mjs +9 -0
- package/src/runtime/agent/orchestrator/session/compact/execution-tail.mjs +17 -4
- package/src/runtime/agent/orchestrator/session/compact/runner.mjs +36 -31
- package/src/runtime/agent/orchestrator/session/compact.mjs +4 -5
- package/src/runtime/agent/orchestrator/session/context-compaction-policy.mjs +6 -5
- package/src/runtime/agent/orchestrator/session/eager-dispatch.mjs +8 -6
- package/src/runtime/agent/orchestrator/session/loop/assistant-commit.mjs +121 -0
- package/src/runtime/agent/orchestrator/session/loop/compact-policy.mjs +2 -3
- package/src/runtime/agent/orchestrator/session/loop/diagnostics.mjs +74 -0
- package/src/runtime/agent/orchestrator/session/loop/fresh-context.mjs +44 -17
- package/src/runtime/agent/orchestrator/session/loop/no-tool-turn.mjs +266 -0
- package/src/runtime/agent/orchestrator/session/loop/request-boundary.mjs +111 -0
- package/src/runtime/agent/orchestrator/session/loop/request-projection.mjs +99 -0
- package/src/runtime/agent/orchestrator/session/loop/steering.mjs +91 -0
- package/src/runtime/agent/orchestrator/session/loop/usage.mjs +36 -0
- package/src/runtime/agent/orchestrator/session/manager/compaction-runner.mjs +3 -3
- package/src/runtime/agent/orchestrator/session/manager/runtime-liveness.mjs +12 -0
- package/src/runtime/agent/orchestrator/session/manager/session-lifecycle.mjs +20 -11
- package/src/runtime/agent/orchestrator/session/pre-send-compact.mjs +3 -5
- package/src/runtime/agent/orchestrator/session/send-with-recovery.mjs +9 -3
- package/src/runtime/agent/orchestrator/session/store-summary-reader.mjs +39 -0
- package/src/runtime/agent/orchestrator/session/store-transcript-cache.mjs +3 -2
- package/src/runtime/agent/orchestrator/session/tool-batch.mjs +21 -3
- package/src/runtime/agent/orchestrator/tools/builtin/arg-guard.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool.mjs +2 -3
- package/src/runtime/agent/orchestrator/tools/builtin/builtin-tools.mjs +25 -25
- package/src/runtime/agent/orchestrator/tools/builtin/git-command-tool.mjs +62 -10
- package/src/runtime/agent/orchestrator/tools/builtin/path-utils.mjs +17 -0
- package/src/runtime/agent/orchestrator/tools/builtin/read-batch.mjs +61 -4
- package/src/runtime/agent/orchestrator/tools/builtin/read-single-tool.mjs +13 -9
- package/src/runtime/agent/orchestrator/tools/builtin/read-snapshot-runtime.mjs +12 -2
- package/src/runtime/agent/orchestrator/tools/builtin/read-streaming.mjs +3 -2
- package/src/runtime/agent/orchestrator/tools/builtin/read-tool.mjs +8 -3
- package/src/runtime/agent/orchestrator/tools/builtin/runtime-capabilities.mjs +69 -6
- package/src/runtime/agent/orchestrator/tools/builtin.mjs +14 -17
- package/src/runtime/agent/orchestrator/tools/code-graph/dispatch.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/code-graph/source-access.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/code-graph-tool-defs.mjs +6 -6
- package/src/runtime/agent/orchestrator/tools/patch-tool-defs.mjs +1 -1
- package/src/runtime/bridge-discovery.mjs +8 -0
- package/src/runtime/browser-bridge/action-schema.mjs +37 -43
- package/src/runtime/browser-bridge/client.mjs +111 -99
- package/src/runtime/browser-bridge/input-fields.mjs +187 -0
- package/src/runtime/browser-bridge/tool-defs.mjs +12 -227
- package/src/runtime/computer-bridge/action-schema.mjs +2 -46
- package/src/runtime/computer-bridge/client.mjs +69 -77
- package/src/runtime/computer-bridge/core-actions.mjs +7 -5
- package/src/runtime/computer-bridge/error-recovery.mjs +41 -37
- package/src/runtime/computer-bridge/tool-defs.mjs +1 -1
- package/src/runtime/github/commands.mjs +4 -1
- package/src/runtime/github/contract.mjs +1 -1
- package/src/runtime/github/tool.mjs +2 -2
- package/src/runtime/media/adapters/antigravity-image.mjs +72 -0
- package/src/runtime/media/adapters/gemini-image.mjs +20 -11
- package/src/runtime/media/auth.mjs +12 -0
- package/src/runtime/media/catalog.mjs +30 -10
- package/src/runtime/media/jobs.mjs +4 -0
- package/src/runtime/media/lanes.mjs +40 -31
- package/src/runtime/memory/index.mjs +2 -9
- package/src/runtime/memory/lib/compact-handoff.mjs +26 -18
- package/src/runtime/memory/lib/memory-chunk-audit.mjs +41 -0
- package/src/runtime/memory/lib/memory-chunk-quality.mjs +388 -0
- package/src/runtime/memory/lib/memory-cycle1.mjs +95 -394
- package/src/runtime/memory/lib/memory-recall-scope-filter.mjs +29 -4
- package/src/runtime/memory/lib/memory-recall-store.mjs +8 -12
- package/src/runtime/memory/lib/memory-retrievers.mjs +8 -11
- package/src/runtime/memory/lib/memory.mjs +2 -0
- package/src/runtime/memory/lib/query-handlers.mjs +98 -144
- package/src/runtime/memory/lib/query-ranking.mjs +23 -9
- package/src/runtime/memory/lib/recall-format.mjs +37 -27
- package/src/runtime/memory/lib/session-ingest-runtime.mjs +14 -8
- package/src/runtime/memory/lib/session-ingest.mjs +45 -84
- package/src/runtime/memory/lib/transcript-ingest.mjs +19 -21
- package/src/runtime/memory/tool-defs.mjs +2 -2
- package/src/runtime/office/authoring/pptx-author-session.mjs +3 -7
- package/src/runtime/office/core/office-actions-batch.mjs +2 -8
- package/src/runtime/office/core/office-actions-open.mjs +124 -0
- package/src/runtime/office/core/office-actions-read.mjs +127 -0
- package/src/runtime/office/core/office-core.mjs +80 -1
- package/src/runtime/office/core/office-sessions.mjs +116 -138
- package/src/runtime/office/index.mjs +18 -271
- package/src/runtime/office/pdf/pdf-analysis.mjs +2 -2
- package/src/runtime/office/pdf/pdf-limits.mjs +2 -0
- package/src/runtime/office/tool-defs.mjs +7 -6
- package/src/runtime/shared/agent-route-config.mjs +8 -8
- package/src/runtime/shared/child-spawn-gate.mjs +10 -13
- package/src/runtime/shared/config.mjs +2 -7
- package/src/runtime/shared/env.mjs +3 -3
- package/src/runtime/shared/err-text.mjs +1 -1
- package/src/runtime/shared/extension-scopes.mjs +3 -2
- package/src/runtime/shared/heap-cap.mjs +10 -6
- package/src/runtime/shared/llm/cost.mjs +35 -10
- package/src/runtime/shared/llm/usage-accounting.mjs +11 -1
- package/src/runtime/shared/llm/usage-context.mjs +6 -0
- package/src/runtime/shared/llm/usage-ledger-import.mjs +5 -0
- package/src/runtime/shared/llm/usage-ledger-repair.mjs +109 -0
- package/src/runtime/shared/llm/usage-ledger.mjs +59 -20
- package/src/runtime/shared/llm/usage-pricing-refresh.mjs +26 -0
- package/src/runtime/shared/llm/usage-rollup.mjs +17 -15
- package/src/runtime/shared/native-asset.mjs +3 -4
- package/src/runtime/shared/object.mjs +4 -0
- package/src/runtime/shared/pg-schema-db.mjs +21 -0
- package/src/runtime/shared/plugin-metadata.mjs +3 -1
- package/src/runtime/shared/resource-admission.mjs +1 -6
- package/src/runtime/shared/schedules-db.mjs +8 -24
- package/src/runtime/shared/schema-value-error.d.mts +2 -0
- package/src/runtime/shared/schema-value-error.mjs +68 -0
- package/src/runtime/shared/singleton-owner.mjs +11 -24
- package/src/runtime/shared/staged-update.mjs +1 -10
- package/src/runtime/shared/tool-card-model.mjs +8 -5
- package/src/runtime/shared/tool-execution-contract.mjs +1 -1
- package/src/runtime/shared/tool-surface.mjs +1 -5
- package/src/runtime/shared/user-data-guard.mjs +1 -4
- package/src/runtime/shared/webhooks-db.mjs +8 -24
- package/src/runtime/web-search/index.mjs +32 -8
- package/src/runtime/web-search/tool-defs.mjs +4 -4
- package/src/session-runtime/config-lifecycle.mjs +34 -0
- package/src/session-runtime/context-status.mjs +19 -0
- package/src/session-runtime/cwd-plugins.mjs +12 -29
- package/src/session-runtime/goal-tasks.mjs +2 -2
- package/src/session-runtime/goal-tool-defs.mjs +3 -2
- package/src/session-runtime/internal-tool-executor.mjs +7 -0
- package/src/session-runtime/lifecycle-api.mjs +5 -11
- package/src/session-runtime/notification-bus.mjs +41 -0
- package/src/session-runtime/prewarm.mjs +22 -0
- package/src/session-runtime/runtime-bootstrap.mjs +90 -0
- package/src/session-runtime/runtime-core.mjs +88 -202
- package/src/session-runtime/runtime-feature-gates.mjs +37 -0
- package/src/session-runtime/session-lifecycle.mjs +5 -5
- package/src/session-runtime/session-turn-api.mjs +1 -12
- package/src/session-runtime/setup-tool/executor.mjs +13 -5
- package/src/session-runtime/setup-tool/tool-defs.mjs +52 -46
- package/src/session-runtime/tool-defs.mjs +73 -4
- package/src/session-runtime/usage-stats-api.mjs +4 -1
- package/src/session-runtime/warmup-schedulers.mjs +8 -2
- package/src/session-runtime/workflow.mjs +14 -0
- package/src/standalone/channel-session-router.mjs +3 -1
- package/src/standalone/channel-worker.mjs +18 -9
- package/src/standalone/daemon-crash-capture.mjs +534 -0
- package/src/standalone/daemon-telemetry.mjs +175 -0
- package/src/standalone/daemon.mjs +31 -21
- package/src/standalone/session-client.mjs +31 -23
- package/src/standalone/usage-dashboard-model.mjs +2 -0
- package/src/standalone/usage-stats-hours.mjs +18 -11
- package/src/standalone/usage-stats-model.mjs +39 -28
- package/src/standalone/usage-stats-period.mjs +43 -45
- package/src/tui/app/use-transcript-window.mjs +1 -1
- package/src/tui/components/StatusLine.jsx +13 -42
- package/src/tui/dist/index.mjs +256 -239
- package/src/tui/session/session-api-ext.mjs +44 -41
- package/src/tui/session/session-api.mjs +4 -0
- package/src/tui/session/tool-card-results.mjs +25 -78
- package/src/tui/session/tool-result-status.mjs +94 -1
- package/src/tui/session/turn-aggregate-cards.mjs +17 -54
- package/src/ui/statusline-format.mjs +6 -26
- package/src/workflows/default/WORKFLOW.md +5 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { usageRollupDayKey } from '../runtime/shared/llm/usage-rollup.mjs';
|
|
2
2
|
|
|
3
|
-
const VIEWS = new Set(['hour', 'day', 'week', 'month', 'all']);
|
|
3
|
+
const VIEWS = new Set(['hour', '7d', 'day', 'week', 'month', 'year', 'all', 'custom']);
|
|
4
4
|
|
|
5
5
|
function midnight(value) {
|
|
6
6
|
const date = new Date(value);
|
|
@@ -20,65 +20,63 @@ function anchorDate(anchor, now) {
|
|
|
20
20
|
return date;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
function
|
|
24
|
-
const start = midnight(date);
|
|
25
|
-
if (view !== 'hour') start.setDate(1);
|
|
26
|
-
if (view === 'week') start.setMonth(Math.floor(start.getMonth() / 3) * 3);
|
|
27
|
-
if (view === 'month') start.setMonth(0);
|
|
28
|
-
return start;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function shiftMonths(date, count) {
|
|
23
|
+
function shiftDays(date, count) {
|
|
32
24
|
const shifted = new Date(date);
|
|
33
|
-
shifted.
|
|
25
|
+
shifted.setDate(shifted.getDate() + count);
|
|
34
26
|
return shifted;
|
|
35
27
|
}
|
|
36
28
|
|
|
37
|
-
function
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
while (cursor <= end) {
|
|
42
|
-
count++;
|
|
43
|
-
cursor.setDate(cursor.getDate() + 1);
|
|
44
|
-
}
|
|
45
|
-
return count;
|
|
29
|
+
function calendarBounds(start, end, now, days) {
|
|
30
|
+
const toMs = Math.min(now, shiftDays(end, 1).getTime() - 1);
|
|
31
|
+
return { fromMs: start.getTime(), toMs, endMs: toMs,
|
|
32
|
+
startDay: usageRollupDayKey(start.getTime()), endDay: usageRollupDayKey(end.getTime()), days };
|
|
46
33
|
}
|
|
47
34
|
|
|
48
35
|
/**
|
|
49
|
-
* One owner for
|
|
50
|
-
* hour =
|
|
51
|
-
*
|
|
36
|
+
* One owner for trailing ranges and navigation.
|
|
37
|
+
* hour = 24 elapsed hours; 7d/day/week/month = 7/30/90/365 local calendar dates.
|
|
38
|
+
* Calendar ranges include today. An anchor is the final included date.
|
|
39
|
+
* year groups retained history by year; all remains a legacy API alias.
|
|
40
|
+
* Display and accounting bounds both stop at the end of the selected range.
|
|
52
41
|
*/
|
|
53
|
-
export function resolveUsageStatsPeriod({ view = 'hour', anchor, now = Date.now() } = {}) {
|
|
42
|
+
export function resolveUsageStatsPeriod({ view = 'hour', anchor, startDay, endDay, now = Date.now() } = {}) {
|
|
54
43
|
if (!VIEWS.has(view)) throw new TypeError('Unknown usage statistics view');
|
|
55
44
|
if (!Number.isFinite(now) || now <= 0) throw new TypeError('Usage period requires a valid current time');
|
|
56
45
|
const today = usageRollupDayKey(now);
|
|
57
|
-
if (view === 'all') {
|
|
46
|
+
if (view === 'year' || view === 'all') {
|
|
58
47
|
return { view, anchor: null, fromMs: 0, toMs: now, startDay: null, endDay: today,
|
|
59
48
|
days: null, previousAnchor: null, nextAnchor: null, isCurrent: true };
|
|
60
49
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
if (view === '
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
50
|
+
if (view === 'hour') {
|
|
51
|
+
const fromMs = now - 24 * 60 * 60 * 1000;
|
|
52
|
+
return { view, anchor: null, fromMs, toMs: now, endMs: now,
|
|
53
|
+
startDay: usageRollupDayKey(fromMs), endDay: today,
|
|
54
|
+
days: 1, previousAnchor: null, nextAnchor: null, isCurrent: true };
|
|
55
|
+
}
|
|
56
|
+
if (view === 'custom') {
|
|
57
|
+
if (startDay == null || endDay == null) throw new TypeError('Usage range requires a start and end date');
|
|
58
|
+
const start = anchorDate(startDay, now);
|
|
59
|
+
const end = anchorDate(endDay, now);
|
|
60
|
+
if (start > end) throw new RangeError('Usage range start must not follow its end');
|
|
61
|
+
if (end > midnight(now)) throw new RangeError('Usage range cannot include future dates');
|
|
62
|
+
const days = (Date.UTC(end.getFullYear(), end.getMonth(), end.getDate())
|
|
63
|
+
- Date.UTC(start.getFullYear(), start.getMonth(), start.getDate())) / 86400000 + 1;
|
|
64
|
+
return { view, anchor: null, ...calendarBounds(start, end, now, days),
|
|
65
|
+
previousAnchor: null, nextAnchor: null, isCurrent: endDay === today };
|
|
66
|
+
}
|
|
67
|
+
const current = midnight(now);
|
|
68
|
+
const requested = anchorDate(anchor, now);
|
|
69
|
+
const end = requested > current ? current : requested;
|
|
70
|
+
const days = view === '7d' ? 7 : view === 'day' ? 30 : view === 'week' ? 90 : 365;
|
|
71
|
+
const start = shiftDays(end, 1 - days);
|
|
72
|
+
const previous = shiftDays(start, -1);
|
|
73
|
+
const next = shiftDays(end, days);
|
|
71
74
|
return {
|
|
72
75
|
view,
|
|
73
|
-
anchor: usageRollupDayKey(
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
endDay: usageRollupDayKey(endMs),
|
|
79
|
-
days: view === 'hour' ? 0 : calendarCount(start, toMs),
|
|
80
|
-
previousAnchor: previous && previous.getFullYear() >= 1970 ? usageRollupDayKey(previous.getTime()) : null,
|
|
81
|
-
nextAnchor: view !== 'hour' && next <= current ? usageRollupDayKey(next.getTime()) : null,
|
|
82
|
-
isCurrent: start.getTime() === current.getTime(),
|
|
76
|
+
anchor: usageRollupDayKey(end.getTime()),
|
|
77
|
+
...calendarBounds(start, end, now, days),
|
|
78
|
+
previousAnchor: previous.getFullYear() >= 1970 ? usageRollupDayKey(previous.getTime()) : null,
|
|
79
|
+
nextAnchor: end < current ? usageRollupDayKey(Math.min(next.getTime(), current.getTime())) : null,
|
|
80
|
+
isCurrent: end.getTime() === current.getTime(),
|
|
83
81
|
};
|
|
84
82
|
}
|
|
@@ -27,6 +27,7 @@ import {
|
|
|
27
27
|
transcriptHarvestInputsEqual,
|
|
28
28
|
} from './transcript-window.mjs';
|
|
29
29
|
import { shouldSuppressFullyFailedToolItem } from '../transcript-tool-failures.mjs';
|
|
30
|
+
import { TUI_DEBUG } from '../session/transcript-spill.mjs';
|
|
30
31
|
|
|
31
32
|
// ── Harvest circuit breaker ────────────────────────────────────────────────
|
|
32
33
|
// The measured-height harvest is a deps-less layout effect: every
|
|
@@ -39,7 +40,6 @@ import { shouldSuppressFullyFailedToolItem } from '../transcript-tool-failures.m
|
|
|
39
40
|
// the bump (the caches keep the latest heights, the next external render
|
|
40
41
|
// consumes them) and trace the culprits for diagnosis.
|
|
41
42
|
const HARVEST_BUMP_STREAK_LIMIT = 10;
|
|
42
|
-
const TUI_DEBUG = /^(1|true|yes|on)$/i.test(String(process.env.MIXDOG_TUI_DEBUG || ''));
|
|
43
43
|
let harvestBreakerLogged = false;
|
|
44
44
|
function traceHarvestBreaker(changedKeys) {
|
|
45
45
|
// Always report the FIRST trip per process (one stderr line beats a crash);
|
|
@@ -22,6 +22,7 @@ import { useSharedTick } from '../hooks/useSharedTick.mjs';
|
|
|
22
22
|
// instant-local L2 can render the Shell segment itself instead of grafting it
|
|
23
23
|
// out of the previous full line.
|
|
24
24
|
import { shellJobsStatus } from '../../ui/statusline-segments.mjs';
|
|
25
|
+
import { formatElapsed, num, terminalColumns } from '../../ui/statusline-format.mjs';
|
|
25
26
|
|
|
26
27
|
// Loaded at RUNTIME (not bundled) so its vendored statusline-lib relative
|
|
27
28
|
// imports resolve from the real src/ui location, not the dist/ bundle dir.
|
|
@@ -138,15 +139,6 @@ function statusColors() {
|
|
|
138
139
|
};
|
|
139
140
|
}
|
|
140
141
|
|
|
141
|
-
function terminalColumns() {
|
|
142
|
-
const cols = Number(process.stdout?.columns);
|
|
143
|
-
return Number.isFinite(cols) && cols > 0 ? Math.floor(cols) : 120;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
function localNum(value) {
|
|
147
|
-
const n = Number(value);
|
|
148
|
-
return Number.isFinite(n) ? n : 0;
|
|
149
|
-
}
|
|
150
142
|
|
|
151
143
|
function localContextPct({
|
|
152
144
|
provider = '',
|
|
@@ -198,27 +190,6 @@ function localL2SpinnerFrame(now = Date.now()) {
|
|
|
198
190
|
return LOCAL_WORKER_SPINNER_FRAMES[index] || LOCAL_WORKER_SPINNER_FRAMES[0];
|
|
199
191
|
}
|
|
200
192
|
|
|
201
|
-
// Byte-identical replica of src/tui/time-format.mjs formatDuration() with
|
|
202
|
-
// DEFAULT options (no mostSignificantOnly / hideTrailingZeros), wrapped to drop
|
|
203
|
-
// sub-1s. Output shape: '' (<1s), `Xs`, `Xm Ys`, `Xh Ym Zs`, `Xd Yh Zm`. Mirrors
|
|
204
|
-
// statusline.mjs formatElapsed so instant-local L2 elapsed matches full render.
|
|
205
|
-
function localFormatElapsed(ms) {
|
|
206
|
-
if (!Number.isFinite(Number(ms))) return '';
|
|
207
|
-
const value = Math.max(0, Number(ms) || 0);
|
|
208
|
-
if (value < 60_000) {
|
|
209
|
-
if (value < 1_000) return '';
|
|
210
|
-
return `${Math.floor(value / 1000)}s`;
|
|
211
|
-
}
|
|
212
|
-
const days = Math.floor(value / 86_400_000);
|
|
213
|
-
const hours = Math.floor((value % 86_400_000) / 3_600_000);
|
|
214
|
-
const minutes = Math.floor((value % 3_600_000) / 60_000);
|
|
215
|
-
const seconds = Math.floor((value % 60_000) / 1000);
|
|
216
|
-
if (days > 0) return `${days}d ${hours}h ${minutes}m`;
|
|
217
|
-
if (hours > 0) return `${hours}h ${minutes}m ${seconds}s`;
|
|
218
|
-
if (minutes > 0) return `${minutes}m ${seconds}s`;
|
|
219
|
-
return `${seconds}s`;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
193
|
function localRunningWorkerCount(agentWorkers = [], agentJobs = []) {
|
|
223
194
|
const seen = new Set();
|
|
224
195
|
for (const worker of Array.isArray(agentWorkers) ? agentWorkers : []) {
|
|
@@ -281,7 +252,7 @@ function localStatusLineL2({
|
|
|
281
252
|
if (runningCount > 0) {
|
|
282
253
|
const label = `Running ${runningCount} Agent${runningCount === 1 ? '' : 's'}`;
|
|
283
254
|
const oldestStart = localOldestWorkerStartMs(agentWorkers, agentJobs);
|
|
284
|
-
const elapsed = oldestStart > 0 ?
|
|
255
|
+
const elapsed = oldestStart > 0 ? formatElapsed(now - oldestStart) : '';
|
|
285
256
|
l2Parts.push(`${spin} ${STATUS}${label}${RESET}${elapsedSuffix(elapsed)}`);
|
|
286
257
|
}
|
|
287
258
|
// Session-scoped like the full path: one host process owns many sessions'
|
|
@@ -298,12 +269,12 @@ function localStatusLineL2({
|
|
|
298
269
|
const tools = activeTools && typeof activeTools === 'object' ? activeTools : {};
|
|
299
270
|
const exploreInfo = tools.explore || null;
|
|
300
271
|
const searchInfo = tools.search || null;
|
|
301
|
-
if (exploreInfo &&
|
|
302
|
-
const elapsed =
|
|
272
|
+
if (exploreInfo && num(exploreInfo.count) > 0) {
|
|
273
|
+
const elapsed = num(exploreInfo.startedAt) > 0 ? formatElapsed(now - num(exploreInfo.startedAt)) : '';
|
|
303
274
|
l2Parts.push(`${spin} ${STATUS}Exploring${RESET}${elapsedSuffix(elapsed)}`);
|
|
304
275
|
}
|
|
305
|
-
if (searchInfo &&
|
|
306
|
-
const elapsed =
|
|
276
|
+
if (searchInfo && num(searchInfo.count) > 0) {
|
|
277
|
+
const elapsed = num(searchInfo.startedAt) > 0 ? formatElapsed(now - num(searchInfo.startedAt)) : '';
|
|
307
278
|
l2Parts.push(`${spin} ${STATUS}Web Searching${RESET}${elapsedSuffix(elapsed)}`);
|
|
308
279
|
}
|
|
309
280
|
return l2Parts.length ? l2Parts.join(segSep) : '';
|
|
@@ -416,13 +387,13 @@ function StatusLineView({ sessionId, clientHostPid, provider, model, effort, fas
|
|
|
416
387
|
: '';
|
|
417
388
|
const statsForSignature = stats && typeof stats === 'object' ? stats : {};
|
|
418
389
|
const statsSignature = [
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
390
|
+
num(statsForSignature.currentContextTokens),
|
|
391
|
+
num(statsForSignature.currentEstimatedContextTokens),
|
|
392
|
+
num(statsForSignature.inputTokens),
|
|
393
|
+
num(statsForSignature.latestInputTokens),
|
|
394
|
+
num(statsForSignature.promptTokens),
|
|
395
|
+
num(statsForSignature.turns),
|
|
396
|
+
num(statsForSignature.contextTokens),
|
|
426
397
|
String(statsForSignature.currentContextSource || ''),
|
|
427
398
|
].join('|');
|
|
428
399
|
const refreshMs = hasActiveStatuslineWork(line, agentWorkers, agentJobs, activeTools) ? STATUSLINE_ACTIVE_REFRESH_MS : STATUSLINE_REFRESH_MS;
|