aspectcode 0.4.0 → 1.0.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 +13 -0
- package/dist/agentsMdRenderer.d.ts +16 -0
- package/dist/agentsMdRenderer.d.ts.map +1 -0
- package/dist/agentsMdRenderer.js +137 -0
- package/dist/agentsMdRenderer.js.map +1 -0
- package/dist/auth.d.ts +31 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +385 -0
- package/dist/auth.js.map +1 -0
- package/dist/autoResolve.d.ts +41 -0
- package/dist/autoResolve.d.ts.map +1 -0
- package/dist/autoResolve.js +196 -0
- package/dist/autoResolve.js.map +1 -0
- package/dist/changeEvaluator.d.ts +56 -0
- package/dist/changeEvaluator.d.ts.map +1 -0
- package/dist/changeEvaluator.js +674 -0
- package/dist/changeEvaluator.js.map +1 -0
- package/dist/cli.d.ts +12 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +37 -17
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +50 -2
- package/dist/config.js.map +1 -1
- package/dist/dreamCycle.d.ts +57 -0
- package/dist/dreamCycle.d.ts.map +1 -0
- package/dist/dreamCycle.js +334 -0
- package/dist/dreamCycle.js.map +1 -0
- package/dist/kbBuilder.d.ts +1 -2
- package/dist/kbBuilder.d.ts.map +1 -1
- package/dist/kbBuilder.js +1 -2
- package/dist/kbBuilder.js.map +1 -1
- package/dist/main.d.ts +2 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +149 -8
- package/dist/main.js.map +1 -1
- package/dist/optimize.d.ts +13 -6
- package/dist/optimize.d.ts.map +1 -1
- package/dist/optimize.js +433 -142
- package/dist/optimize.js.map +1 -1
- package/dist/pipeline.d.ts +21 -18
- package/dist/pipeline.d.ts.map +1 -1
- package/dist/pipeline.js +1139 -162
- package/dist/pipeline.js.map +1 -1
- package/dist/preferences.d.ts +80 -0
- package/dist/preferences.d.ts.map +1 -0
- package/dist/preferences.js +238 -0
- package/dist/preferences.js.map +1 -0
- package/dist/runtimeState.d.ts +30 -0
- package/dist/runtimeState.d.ts.map +1 -0
- package/dist/runtimeState.js +39 -0
- package/dist/runtimeState.js.map +1 -0
- package/dist/scopedRules.d.ts +84 -0
- package/dist/scopedRules.d.ts.map +1 -0
- package/dist/scopedRules.js +449 -0
- package/dist/scopedRules.js.map +1 -0
- package/dist/ui/Dashboard.d.ts +4 -16
- package/dist/ui/Dashboard.d.ts.map +1 -1
- package/dist/ui/Dashboard.js +339 -141
- package/dist/ui/Dashboard.js.map +1 -1
- package/dist/ui/MemoryMap.d.ts +16 -0
- package/dist/ui/MemoryMap.d.ts.map +1 -0
- package/dist/ui/MemoryMap.js +266 -0
- package/dist/ui/MemoryMap.js.map +1 -0
- package/dist/ui/SettingsPanel.d.ts +18 -0
- package/dist/ui/SettingsPanel.d.ts.map +1 -0
- package/dist/ui/SettingsPanel.js +241 -0
- package/dist/ui/SettingsPanel.js.map +1 -0
- package/dist/ui/prompts.d.ts +7 -0
- package/dist/ui/prompts.d.ts.map +1 -1
- package/dist/ui/prompts.js +63 -0
- package/dist/ui/prompts.js.map +1 -1
- package/dist/ui/store.d.ts +154 -18
- package/dist/ui/store.d.ts.map +1 -1
- package/dist/ui/store.js +154 -24
- package/dist/ui/store.js.map +1 -1
- package/dist/ui/theme.d.ts +1 -8
- package/dist/ui/theme.d.ts.map +1 -1
- package/dist/ui/theme.js +2 -20
- package/dist/ui/theme.js.map +1 -1
- package/dist/updateChecker.d.ts +13 -0
- package/dist/updateChecker.d.ts.map +1 -0
- package/dist/updateChecker.js +66 -0
- package/dist/updateChecker.js.map +1 -0
- package/dist/usageTracker.d.ts +12 -0
- package/dist/usageTracker.d.ts.map +1 -0
- package/dist/usageTracker.js +89 -0
- package/dist/usageTracker.js.map +1 -0
- package/dist/writer.d.ts +1 -7
- package/dist/writer.d.ts.map +1 -1
- package/dist/writer.js +1 -11
- package/dist/writer.js.map +1 -1
- package/node_modules/@aspectcode/core/dist/analysis/repo.d.ts.map +1 -1
- package/node_modules/@aspectcode/core/dist/analysis/repo.js +13 -2
- package/node_modules/@aspectcode/core/dist/analysis/repo.js.map +1 -1
- package/node_modules/@aspectcode/core/dist/index.d.ts +1 -3
- package/node_modules/@aspectcode/core/dist/index.d.ts.map +1 -1
- package/node_modules/@aspectcode/core/dist/index.js +1 -3
- package/node_modules/@aspectcode/core/dist/index.js.map +1 -1
- package/node_modules/@aspectcode/core/dist/parsers/genericExtractors.d.ts +14 -0
- package/node_modules/@aspectcode/core/dist/parsers/genericExtractors.d.ts.map +1 -0
- package/node_modules/@aspectcode/core/dist/parsers/genericExtractors.js +191 -0
- package/node_modules/@aspectcode/core/dist/parsers/genericExtractors.js.map +1 -0
- package/node_modules/@aspectcode/core/dist/parsers/index.d.ts +1 -0
- package/node_modules/@aspectcode/core/dist/parsers/index.d.ts.map +1 -1
- package/node_modules/@aspectcode/core/dist/parsers/index.js +6 -1
- package/node_modules/@aspectcode/core/dist/parsers/index.js.map +1 -1
- package/node_modules/@aspectcode/core/dist/parsers/languages.d.ts +20 -0
- package/node_modules/@aspectcode/core/dist/parsers/languages.d.ts.map +1 -1
- package/node_modules/@aspectcode/core/dist/parsers/languages.js +25 -0
- package/node_modules/@aspectcode/core/dist/parsers/languages.js.map +1 -1
- package/node_modules/@aspectcode/core/dist/parsers/tsJsExtractors.d.ts.map +1 -1
- package/node_modules/@aspectcode/core/dist/parsers/tsJsExtractors.js +4 -1
- package/node_modules/@aspectcode/core/dist/parsers/tsJsExtractors.js.map +1 -1
- package/node_modules/@aspectcode/core/package.json +2 -2
- package/node_modules/@aspectcode/core/parsers/cpp.wasm +0 -0
- package/node_modules/@aspectcode/core/parsers/go.wasm +0 -0
- package/node_modules/@aspectcode/core/parsers/php.wasm +0 -0
- package/node_modules/@aspectcode/core/parsers/ruby.wasm +0 -0
- package/node_modules/@aspectcode/core/parsers/rust.wasm +0 -0
- package/node_modules/@aspectcode/emitters/dist/index.d.ts +1 -17
- package/node_modules/@aspectcode/emitters/dist/index.d.ts.map +1 -1
- package/node_modules/@aspectcode/emitters/dist/index.js +2 -89
- package/node_modules/@aspectcode/emitters/dist/index.js.map +1 -1
- package/node_modules/@aspectcode/emitters/dist/instructions/index.d.ts +0 -2
- package/node_modules/@aspectcode/emitters/dist/instructions/index.d.ts.map +1 -1
- package/node_modules/@aspectcode/emitters/dist/instructions/index.js +1 -7
- package/node_modules/@aspectcode/emitters/dist/instructions/index.js.map +1 -1
- package/node_modules/@aspectcode/emitters/dist/kb/analyzers.d.ts +0 -18
- package/node_modules/@aspectcode/emitters/dist/kb/analyzers.d.ts.map +1 -1
- package/node_modules/@aspectcode/emitters/dist/kb/analyzers.js +0 -57
- package/node_modules/@aspectcode/emitters/dist/kb/analyzers.js.map +1 -1
- package/node_modules/@aspectcode/emitters/dist/kb/conventions.d.ts +0 -18
- package/node_modules/@aspectcode/emitters/dist/kb/conventions.d.ts.map +1 -1
- package/node_modules/@aspectcode/emitters/dist/kb/conventions.js +0 -130
- package/node_modules/@aspectcode/emitters/dist/kb/conventions.js.map +1 -1
- package/node_modules/@aspectcode/emitters/dist/kb/index.d.ts +2 -4
- package/node_modules/@aspectcode/emitters/dist/kb/index.d.ts.map +1 -1
- package/node_modules/@aspectcode/emitters/dist/kb/index.js +1 -11
- package/node_modules/@aspectcode/emitters/dist/kb/index.js.map +1 -1
- package/node_modules/@aspectcode/emitters/package.json +3 -3
- package/node_modules/@aspectcode/evaluator/dist/apply.d.ts +55 -0
- package/node_modules/@aspectcode/evaluator/dist/apply.d.ts.map +1 -0
- package/node_modules/@aspectcode/evaluator/dist/apply.js +368 -0
- package/node_modules/@aspectcode/evaluator/dist/apply.js.map +1 -0
- package/node_modules/@aspectcode/evaluator/dist/diagnosis.d.ts +16 -25
- package/node_modules/@aspectcode/evaluator/dist/diagnosis.d.ts.map +1 -1
- package/node_modules/@aspectcode/evaluator/dist/diagnosis.js +115 -138
- package/node_modules/@aspectcode/evaluator/dist/diagnosis.js.map +1 -1
- package/node_modules/@aspectcode/evaluator/dist/index.d.ts +8 -43
- package/node_modules/@aspectcode/evaluator/dist/index.d.ts.map +1 -1
- package/node_modules/@aspectcode/evaluator/dist/index.js +15 -61
- package/node_modules/@aspectcode/evaluator/dist/index.js.map +1 -1
- package/node_modules/@aspectcode/evaluator/dist/judge.d.ts +32 -0
- package/node_modules/@aspectcode/evaluator/dist/judge.d.ts.map +1 -0
- package/node_modules/@aspectcode/evaluator/dist/judge.js +165 -0
- package/node_modules/@aspectcode/evaluator/dist/judge.js.map +1 -0
- package/node_modules/@aspectcode/evaluator/dist/llmUtil.d.ts +15 -0
- package/node_modules/@aspectcode/evaluator/dist/llmUtil.d.ts.map +1 -0
- package/node_modules/@aspectcode/evaluator/dist/llmUtil.js +41 -0
- package/node_modules/@aspectcode/evaluator/dist/llmUtil.js.map +1 -0
- package/node_modules/@aspectcode/evaluator/dist/probes.d.ts +20 -29
- package/node_modules/@aspectcode/evaluator/dist/probes.d.ts.map +1 -1
- package/node_modules/@aspectcode/evaluator/dist/probes.js +188 -204
- package/node_modules/@aspectcode/evaluator/dist/probes.js.map +1 -1
- package/node_modules/@aspectcode/evaluator/dist/runner.d.ts +7 -32
- package/node_modules/@aspectcode/evaluator/dist/runner.d.ts.map +1 -1
- package/node_modules/@aspectcode/evaluator/dist/runner.js +21 -146
- package/node_modules/@aspectcode/evaluator/dist/runner.js.map +1 -1
- package/node_modules/@aspectcode/evaluator/dist/types.d.ts +141 -99
- package/node_modules/@aspectcode/evaluator/dist/types.d.ts.map +1 -1
- package/node_modules/@aspectcode/evaluator/dist/types.js +10 -2
- package/node_modules/@aspectcode/evaluator/dist/types.js.map +1 -1
- package/node_modules/@aspectcode/evaluator/package.json +4 -4
- package/node_modules/@aspectcode/optimizer/dist/index.d.ts +3 -10
- package/node_modules/@aspectcode/optimizer/dist/index.d.ts.map +1 -1
- package/node_modules/@aspectcode/optimizer/dist/index.js +1 -19
- package/node_modules/@aspectcode/optimizer/dist/index.js.map +1 -1
- package/node_modules/@aspectcode/optimizer/dist/providers/anthropic.d.ts.map +1 -1
- package/node_modules/@aspectcode/optimizer/dist/providers/anthropic.js +40 -0
- package/node_modules/@aspectcode/optimizer/dist/providers/anthropic.js.map +1 -1
- package/node_modules/@aspectcode/optimizer/dist/providers/aspectcode.d.ts +9 -0
- package/node_modules/@aspectcode/optimizer/dist/providers/aspectcode.d.ts.map +1 -0
- package/node_modules/@aspectcode/optimizer/dist/providers/aspectcode.js +83 -0
- package/node_modules/@aspectcode/optimizer/dist/providers/aspectcode.js.map +1 -0
- package/node_modules/@aspectcode/optimizer/dist/providers/index.d.ts +4 -3
- package/node_modules/@aspectcode/optimizer/dist/providers/index.d.ts.map +1 -1
- package/node_modules/@aspectcode/optimizer/dist/providers/index.js +24 -10
- package/node_modules/@aspectcode/optimizer/dist/providers/index.js.map +1 -1
- package/node_modules/@aspectcode/optimizer/dist/providers/openai.d.ts.map +1 -1
- package/node_modules/@aspectcode/optimizer/dist/providers/openai.js +22 -0
- package/node_modules/@aspectcode/optimizer/dist/providers/openai.js.map +1 -1
- package/node_modules/@aspectcode/optimizer/dist/providers/retry.d.ts +14 -0
- package/node_modules/@aspectcode/optimizer/dist/providers/retry.d.ts.map +1 -1
- package/node_modules/@aspectcode/optimizer/dist/providers/retry.js +1 -0
- package/node_modules/@aspectcode/optimizer/dist/providers/retry.js.map +1 -1
- package/node_modules/@aspectcode/optimizer/dist/types.d.ts +14 -0
- package/node_modules/@aspectcode/optimizer/dist/types.d.ts.map +1 -1
- package/node_modules/@aspectcode/optimizer/dist/types.js.map +1 -1
- package/node_modules/@aspectcode/optimizer/package.json +2 -2
- package/package.json +6 -7
- package/dist/complaintProcessor.d.ts +0 -16
- package/dist/complaintProcessor.d.ts.map +0 -1
- package/dist/complaintProcessor.js +0 -134
- package/dist/complaintProcessor.js.map +0 -1
- package/node_modules/@aspectcode/emitters/dist/emitter.d.ts +0 -72
- package/node_modules/@aspectcode/emitters/dist/emitter.d.ts.map +0 -1
- package/node_modules/@aspectcode/emitters/dist/emitter.js +0 -10
- package/node_modules/@aspectcode/emitters/dist/emitter.js.map +0 -1
- package/node_modules/@aspectcode/emitters/dist/instructions/content.d.ts +0 -15
- package/node_modules/@aspectcode/emitters/dist/instructions/content.d.ts.map +0 -1
- package/node_modules/@aspectcode/emitters/dist/instructions/content.js +0 -289
- package/node_modules/@aspectcode/emitters/dist/instructions/content.js.map +0 -1
- package/node_modules/@aspectcode/emitters/dist/instructions/detection.d.ts +0 -13
- package/node_modules/@aspectcode/emitters/dist/instructions/detection.d.ts.map +0 -1
- package/node_modules/@aspectcode/emitters/dist/instructions/detection.js +0 -55
- package/node_modules/@aspectcode/emitters/dist/instructions/detection.js.map +0 -1
- package/node_modules/@aspectcode/emitters/dist/instructions/instructionsEmitter.d.ts +0 -9
- package/node_modules/@aspectcode/emitters/dist/instructions/instructionsEmitter.d.ts.map +0 -1
- package/node_modules/@aspectcode/emitters/dist/instructions/instructionsEmitter.js +0 -30
- package/node_modules/@aspectcode/emitters/dist/instructions/instructionsEmitter.js.map +0 -1
- package/node_modules/@aspectcode/emitters/dist/kb/kbEmitter.d.ts +0 -21
- package/node_modules/@aspectcode/emitters/dist/kb/kbEmitter.d.ts.map +0 -1
- package/node_modules/@aspectcode/emitters/dist/kb/kbEmitter.js +0 -125
- package/node_modules/@aspectcode/emitters/dist/kb/kbEmitter.js.map +0 -1
- package/node_modules/@aspectcode/emitters/dist/manifest.d.ts +0 -37
- package/node_modules/@aspectcode/emitters/dist/manifest.d.ts.map +0 -1
- package/node_modules/@aspectcode/emitters/dist/manifest.js +0 -50
- package/node_modules/@aspectcode/emitters/dist/manifest.js.map +0 -1
- package/node_modules/@aspectcode/emitters/dist/report.d.ts +0 -22
- package/node_modules/@aspectcode/emitters/dist/report.d.ts.map +0 -1
- package/node_modules/@aspectcode/emitters/dist/report.js +0 -3
- package/node_modules/@aspectcode/emitters/dist/report.js.map +0 -1
- package/node_modules/@aspectcode/emitters/dist/stableJson.d.ts +0 -14
- package/node_modules/@aspectcode/emitters/dist/stableJson.d.ts.map +0 -1
- package/node_modules/@aspectcode/emitters/dist/stableJson.js +0 -40
- package/node_modules/@aspectcode/emitters/dist/stableJson.js.map +0 -1
- package/node_modules/@aspectcode/emitters/dist/transaction.d.ts +0 -29
- package/node_modules/@aspectcode/emitters/dist/transaction.d.ts.map +0 -1
- package/node_modules/@aspectcode/emitters/dist/transaction.js +0 -104
- package/node_modules/@aspectcode/emitters/dist/transaction.js.map +0 -1
package/dist/ui/Dashboard.js
CHANGED
|
@@ -1,22 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Dashboard —
|
|
3
|
+
* Dashboard — ink-based CLI dashboard with memory map and real-time assessments.
|
|
4
4
|
*
|
|
5
|
-
* Layout
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* Complaint input + hints (watching/done only)
|
|
9
|
-
* Setup notes (compact single line)
|
|
10
|
-
* Status line (spinner/icon + phase + stats)
|
|
11
|
-
* Eval progress (harvest → probes → diagnosis)
|
|
12
|
-
* Token usage (after LLM generation)
|
|
13
|
-
* Summary card (after writing — sections, rules, paths)
|
|
14
|
-
* Diff summary (watch-mode: +N lines, -M lines)
|
|
15
|
-
* [Detail] (change trigger, warning, reasoning)
|
|
16
|
-
* Complaint changes (after complaint processing)
|
|
17
|
-
*
|
|
18
|
-
* Layout (compact mode):
|
|
19
|
-
* Same but no banner, no reasoning, setup only if warning.
|
|
5
|
+
* Layout:
|
|
6
|
+
* Header → Memory Map → (Working status | Eval progress) →
|
|
7
|
+
* Assessment area → Status bar
|
|
20
8
|
*/
|
|
21
9
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
22
10
|
if (k2 === undefined) k2 = k;
|
|
@@ -51,13 +39,22 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
51
39
|
return result;
|
|
52
40
|
};
|
|
53
41
|
})();
|
|
42
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
43
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
44
|
+
};
|
|
54
45
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
55
46
|
const react_1 = __importStar(require("react"));
|
|
56
47
|
const ink_1 = require("ink");
|
|
57
48
|
const theme_1 = require("./theme");
|
|
58
49
|
const store_1 = require("./store");
|
|
50
|
+
const MemoryMap_1 = __importDefault(require("./MemoryMap"));
|
|
51
|
+
const SettingsPanel_1 = __importDefault(require("./SettingsPanel"));
|
|
52
|
+
const config_1 = require("../config");
|
|
53
|
+
const usageTracker_1 = require("../usageTracker");
|
|
54
|
+
const version_1 = require("../version");
|
|
59
55
|
// ── Spinner ──────────────────────────────────────────────────
|
|
60
56
|
const FRAMES = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
|
|
57
|
+
const DREAM_FRAMES = ['✦', '◆', '✦', '◇'];
|
|
61
58
|
function useSpinner(active) {
|
|
62
59
|
const [frame, setFrame] = (0, react_1.useState)(0);
|
|
63
60
|
(0, react_1.useEffect)(() => {
|
|
@@ -68,24 +65,74 @@ function useSpinner(active) {
|
|
|
68
65
|
}, [active]);
|
|
69
66
|
return FRAMES[frame];
|
|
70
67
|
}
|
|
71
|
-
|
|
72
|
-
|
|
68
|
+
function useDreamSpinner(active) {
|
|
69
|
+
const [frame, setFrame] = (0, react_1.useState)(0);
|
|
70
|
+
(0, react_1.useEffect)(() => {
|
|
71
|
+
if (!active)
|
|
72
|
+
return;
|
|
73
|
+
const id = setInterval(() => setFrame((f) => (f + 1) % DREAM_FRAMES.length), 400);
|
|
74
|
+
return () => clearInterval(id);
|
|
75
|
+
}, [active]);
|
|
76
|
+
return DREAM_FRAMES[frame];
|
|
77
|
+
}
|
|
78
|
+
// ── Auto-clear hooks ─────────────────────────────────────────
|
|
79
|
+
function useAutoMessage(msg, clearFn, durationMs = 4000) {
|
|
80
|
+
const [visible, setVisible] = (0, react_1.useState)(msg);
|
|
81
|
+
(0, react_1.useEffect)(() => {
|
|
82
|
+
if (!msg) {
|
|
83
|
+
setVisible('');
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
setVisible(msg);
|
|
87
|
+
const id = setTimeout(() => { setVisible(''); clearFn(); }, durationMs);
|
|
88
|
+
return () => clearTimeout(id);
|
|
89
|
+
}, [msg]);
|
|
90
|
+
return visible;
|
|
91
|
+
}
|
|
92
|
+
// ── Eval phase elapsed timer ─────────────────────────────────
|
|
93
|
+
function useEvalElapsed(phase) {
|
|
94
|
+
const [startMs, setStartMs] = (0, react_1.useState)(0);
|
|
73
95
|
const [now, setNow] = (0, react_1.useState)(Date.now());
|
|
74
96
|
(0, react_1.useEffect)(() => {
|
|
75
|
-
if (
|
|
97
|
+
if (phase === 'idle' || phase === 'done') {
|
|
98
|
+
setStartMs(0);
|
|
76
99
|
return;
|
|
77
|
-
|
|
100
|
+
}
|
|
101
|
+
setStartMs(Date.now());
|
|
102
|
+
}, [phase]);
|
|
103
|
+
(0, react_1.useEffect)(() => {
|
|
104
|
+
if (!startMs)
|
|
105
|
+
return;
|
|
106
|
+
const id = setInterval(() => setNow(Date.now()), 1000);
|
|
78
107
|
return () => clearInterval(id);
|
|
79
|
-
}, [
|
|
80
|
-
|
|
81
|
-
if (finalElapsed)
|
|
82
|
-
return finalElapsed;
|
|
83
|
-
if (startMs === 0)
|
|
108
|
+
}, [startMs]);
|
|
109
|
+
if (!startMs || phase === 'idle' || phase === 'done')
|
|
84
110
|
return '';
|
|
85
|
-
|
|
111
|
+
const secs = Math.floor((now - startMs) / 1000);
|
|
112
|
+
if (secs < 1)
|
|
86
113
|
return '';
|
|
87
|
-
|
|
88
|
-
|
|
114
|
+
return `${secs}s`;
|
|
115
|
+
}
|
|
116
|
+
// ── Slow pulse for watching indicator ─────────────────────────
|
|
117
|
+
const PULSE_FRAMES = ['●', '●', '○', '○'];
|
|
118
|
+
function usePulse(active) {
|
|
119
|
+
const [frame, setFrame] = (0, react_1.useState)(0);
|
|
120
|
+
(0, react_1.useEffect)(() => {
|
|
121
|
+
if (!active)
|
|
122
|
+
return;
|
|
123
|
+
const id = setInterval(() => setFrame((f) => (f + 1) % PULSE_FRAMES.length), 1500);
|
|
124
|
+
return () => clearInterval(id);
|
|
125
|
+
}, [active]);
|
|
126
|
+
return PULSE_FRAMES[frame];
|
|
127
|
+
}
|
|
128
|
+
// ── Tick for relative timestamps ─────────────────────────────
|
|
129
|
+
function useTick(intervalMs) {
|
|
130
|
+
const [tick, setTick] = (0, react_1.useState)(0);
|
|
131
|
+
(0, react_1.useEffect)(() => {
|
|
132
|
+
const id = setInterval(() => setTick((t) => t + 1), intervalMs);
|
|
133
|
+
return () => clearInterval(id);
|
|
134
|
+
}, [intervalMs]);
|
|
135
|
+
return tick;
|
|
89
136
|
}
|
|
90
137
|
// ── Phase labels ─────────────────────────────────────────────
|
|
91
138
|
const PHASE_TEXT = {
|
|
@@ -103,151 +150,302 @@ const PHASE_TEXT = {
|
|
|
103
150
|
const WORKING = new Set([
|
|
104
151
|
'idle', 'discovering', 'analyzing', 'building-kb', 'optimizing', 'evaluating', 'writing',
|
|
105
152
|
]);
|
|
106
|
-
// ──
|
|
107
|
-
function statsText(s, liveElapsed) {
|
|
108
|
-
const parts = [];
|
|
109
|
-
if (s.fileCount > 0)
|
|
110
|
-
parts.push(`${s.fileCount} files`);
|
|
111
|
-
if (s.edgeCount > 0)
|
|
112
|
-
parts.push(`${s.edgeCount} edges`);
|
|
113
|
-
if (s.provider)
|
|
114
|
-
parts.push(s.provider);
|
|
115
|
-
const elapsed = liveElapsed || s.elapsed;
|
|
116
|
-
if (elapsed)
|
|
117
|
-
parts.push(elapsed);
|
|
118
|
-
return parts.length > 0 ? parts.join(' · ') : '';
|
|
119
|
-
}
|
|
120
|
-
function setupLine(notes) {
|
|
121
|
-
if (notes.length === 0)
|
|
122
|
-
return '';
|
|
123
|
-
return notes.join(' · ');
|
|
124
|
-
}
|
|
153
|
+
// ── Eval progress text ───────────────────────────────────────
|
|
125
154
|
function evalText(phase, s) {
|
|
155
|
+
const round = s.iteration && s.maxIterations && s.maxIterations > 1
|
|
156
|
+
? `Round ${s.iteration}/${s.maxIterations}: `
|
|
157
|
+
: '';
|
|
126
158
|
switch (phase) {
|
|
127
159
|
case 'idle': return null;
|
|
128
|
-
case '
|
|
129
|
-
return
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
case '
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
160
|
+
case 'generating-probes':
|
|
161
|
+
return `${round}Generating synthetic test scenarios…`;
|
|
162
|
+
case 'probing': {
|
|
163
|
+
const progress = s.probesPassed !== undefined && s.probesTotal !== undefined
|
|
164
|
+
? ` (${s.probesPassed}/${s.probesTotal})`
|
|
165
|
+
: '';
|
|
166
|
+
return `${round}Simulating AI responses${progress}…`;
|
|
167
|
+
}
|
|
168
|
+
case 'judging': {
|
|
169
|
+
const progress = s.judgedCount !== undefined && s.probesTotal !== undefined
|
|
170
|
+
? ` (${s.judgedCount}/${s.probesTotal})`
|
|
171
|
+
: '';
|
|
172
|
+
return `${round}Judging response quality${progress}…`;
|
|
173
|
+
}
|
|
174
|
+
case 'diagnosing': {
|
|
175
|
+
const detail = s.weakCount !== undefined && s.strongCount !== undefined
|
|
176
|
+
? ` — ${s.weakCount} gap${s.weakCount === 1 ? '' : 's'} found`
|
|
177
|
+
: '';
|
|
178
|
+
return `${round}Identifying improvements${detail}…`;
|
|
179
|
+
}
|
|
180
|
+
case 'applying': {
|
|
181
|
+
const count = s.proposedEditCount ? ` ${s.proposedEditCount}` : '';
|
|
182
|
+
return `${round}Applying${count} improvement${s.proposedEditCount === 1 ? '' : 's'} to AGENTS.md…`;
|
|
183
|
+
}
|
|
184
|
+
case 'done': {
|
|
185
|
+
const edits = s.diagnosisEdits ?? 0;
|
|
186
|
+
const rounds = s.iterationSummaries?.length ?? 0;
|
|
187
|
+
const roundNote = rounds > 1 ? ` across ${rounds} rounds` : '';
|
|
188
|
+
if (s.cancelled) {
|
|
189
|
+
return edits > 0
|
|
190
|
+
? `Cancelled — ${edits} improvement${edits === 1 ? '' : 's'} applied${roundNote}`
|
|
191
|
+
: 'Cancelled — no changes applied';
|
|
145
192
|
}
|
|
146
|
-
return
|
|
193
|
+
return edits > 0
|
|
194
|
+
? `Complete — ${edits} improvement${edits === 1 ? '' : 's'} applied${roundNote}`
|
|
195
|
+
: 'Complete — no changes needed';
|
|
196
|
+
}
|
|
147
197
|
}
|
|
148
198
|
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
return n >= 1000 ? `${(n / 1000).toFixed(1)}k` : String(n);
|
|
152
|
-
}
|
|
199
|
+
// ── Separator line ───────────────────────────────────────────
|
|
200
|
+
const SEP_CHAR = '┄';
|
|
153
201
|
// ── Component ────────────────────────────────────────────────
|
|
154
|
-
/** Phases where the complaint input and hints are shown. */
|
|
155
|
-
const INPUT_VISIBLE = new Set(['watching', 'done']);
|
|
156
|
-
/** Phases where the first-run message should be visible. */
|
|
157
|
-
const FIRST_RUN_VISIBLE = new Set(['idle', 'discovering', 'analyzing']);
|
|
158
202
|
const Dashboard = () => {
|
|
159
203
|
const [s, setS] = (0, react_1.useState)({ ...store_1.store.state });
|
|
204
|
+
const [showSettings, setShowSettings] = (0, react_1.useState)(false);
|
|
205
|
+
const [settingsUserData, setSettingsUserData] = (0, react_1.useState)({});
|
|
206
|
+
const [settingsProjectData, setSettingsProjectData] = (0, react_1.useState)({});
|
|
160
207
|
(0, react_1.useEffect)(() => {
|
|
161
208
|
const fn = () => setS({ ...store_1.store.state });
|
|
162
209
|
store_1.store.on('change', fn);
|
|
163
210
|
return () => { store_1.store.removeListener('change', fn); };
|
|
164
211
|
}, []);
|
|
165
|
-
//
|
|
166
|
-
(
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
212
|
+
// Force re-render every 10s so relative timestamps update
|
|
213
|
+
useTick(10000);
|
|
214
|
+
// ── Keyboard handling ──────────────────────────────────────
|
|
215
|
+
(0, ink_1.useInput)((input, _key) => {
|
|
216
|
+
// Settings panel handles its own input when open
|
|
217
|
+
if (showSettings)
|
|
218
|
+
return;
|
|
219
|
+
if (input === 'x') {
|
|
220
|
+
const evalPhase = store_1.store.state.evalStatus.phase;
|
|
221
|
+
if (evalPhase !== 'idle' && evalPhase !== 'done') {
|
|
222
|
+
store_1.store.cancelEval();
|
|
171
223
|
}
|
|
172
224
|
return;
|
|
173
225
|
}
|
|
174
|
-
if (
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
226
|
+
if (input === 'c') {
|
|
227
|
+
store_1.store.dismissEvalStatus();
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
231
|
+
const handler = store_1.store._onAssessmentAction;
|
|
232
|
+
if (!handler)
|
|
233
|
+
return;
|
|
234
|
+
const current = store_1.store.state.currentAssessment;
|
|
235
|
+
// Tier exhaustion actions
|
|
236
|
+
if (store_1.store.state.tierExhausted) {
|
|
237
|
+
if (input === 'u') {
|
|
238
|
+
handler({ type: 'open-pricing' });
|
|
239
|
+
return;
|
|
178
240
|
}
|
|
241
|
+
if (input === 'k') {
|
|
242
|
+
store_1.store.setLearnedMessage('Add "apiKey": "sk-..." to aspectcode.json or ASPECTCODE_LLM_KEY to .env, then restart aspectcode');
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
if (input === 'r') {
|
|
247
|
+
handler({ type: 'probe-and-refine' });
|
|
179
248
|
return;
|
|
180
249
|
}
|
|
181
|
-
if (
|
|
182
|
-
|
|
250
|
+
if (input === 'l' && !store_1.store.state.userEmail) {
|
|
251
|
+
handler({ type: 'login' });
|
|
183
252
|
return;
|
|
184
253
|
}
|
|
185
|
-
|
|
186
|
-
|
|
254
|
+
if (!current) {
|
|
255
|
+
// No active assessment — 's' opens settings
|
|
256
|
+
if (input === 's' && store_1.store.state.phase === 'watching') {
|
|
257
|
+
const root = store_1.store.state.rootPath;
|
|
258
|
+
setSettingsProjectData((0, config_1.loadConfig)(root) ?? {});
|
|
259
|
+
// User settings are loaded from store (set by pipeline on startup)
|
|
260
|
+
setSettingsUserData(store_1.store._userSettings ?? {});
|
|
261
|
+
setShowSettings(true);
|
|
262
|
+
}
|
|
187
263
|
return;
|
|
188
264
|
}
|
|
189
|
-
if (
|
|
190
|
-
|
|
265
|
+
if (current.llmRecommendation) {
|
|
266
|
+
// Space pauses/unpauses the timer
|
|
267
|
+
if (input === ' ') {
|
|
268
|
+
setTimerPaused((p) => !p);
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
// Enter accepts the LLM recommendation immediately
|
|
272
|
+
if (_key.return) {
|
|
273
|
+
handler({
|
|
274
|
+
type: current.llmRecommendation.decision === 'allow' ? 'dismiss' : 'confirm',
|
|
275
|
+
assessment: current,
|
|
276
|
+
});
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
// y = confirm (enforce rule), n = dismiss (allow / suppress)
|
|
280
|
+
if (input === 'n') {
|
|
281
|
+
handler({ type: 'dismiss', assessment: current });
|
|
282
|
+
}
|
|
283
|
+
else if (input === 'y') {
|
|
284
|
+
handler({ type: 'confirm', assessment: current });
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
else {
|
|
288
|
+
// No LLM recommendation — classic y/n/s
|
|
289
|
+
if (input === 'n') {
|
|
290
|
+
handler({ type: 'dismiss', assessment: current });
|
|
291
|
+
}
|
|
292
|
+
else if (input === 'y') {
|
|
293
|
+
if (current.suggestion) {
|
|
294
|
+
process.stderr.write(`\n Suggestion:\n ${current.suggestion}\n\n`);
|
|
295
|
+
}
|
|
296
|
+
handler({ type: 'confirm', assessment: current });
|
|
297
|
+
}
|
|
298
|
+
else if (input === 's') {
|
|
299
|
+
handler({ type: 'skip', assessment: current });
|
|
300
|
+
}
|
|
191
301
|
}
|
|
192
302
|
});
|
|
193
|
-
const compact = s.compact;
|
|
194
303
|
const working = WORKING.has(s.phase);
|
|
195
|
-
const
|
|
196
|
-
const
|
|
197
|
-
const
|
|
304
|
+
const isWatching = s.phase === 'watching';
|
|
305
|
+
const spinner = useSpinner(working || s.dreaming);
|
|
306
|
+
const dreamSpinner = useDreamSpinner(s.dreaming);
|
|
307
|
+
const pulse = usePulse(isWatching);
|
|
198
308
|
const detail = s.phaseDetail ? ` (${s.phaseDetail})` : '';
|
|
199
|
-
const setup = setupLine(s.setupNotes);
|
|
200
309
|
const evalLabel = evalText(s.evalStatus.phase, s.evalStatus);
|
|
201
310
|
const evalDone = s.evalStatus.phase === 'done';
|
|
202
311
|
const evalActive = s.evalStatus.phase !== 'idle';
|
|
203
|
-
const
|
|
204
|
-
const
|
|
205
|
-
//
|
|
206
|
-
const
|
|
207
|
-
const
|
|
208
|
-
|
|
209
|
-
|
|
312
|
+
const evalElapsed = useEvalElapsed(s.evalStatus.phase);
|
|
313
|
+
const learnedMsg = useAutoMessage(s.learnedMessage, () => store_1.store.setLearnedMessage(''));
|
|
314
|
+
// Timer for auto-resolving assessments with LLM recommendation
|
|
315
|
+
const [autoTimer, setAutoTimer] = (0, react_1.useState)(30);
|
|
316
|
+
const [timerPaused, setTimerPaused] = (0, react_1.useState)(false);
|
|
317
|
+
(0, react_1.useEffect)(() => {
|
|
318
|
+
const cur = s.currentAssessment;
|
|
319
|
+
if (!cur?.llmRecommendation) {
|
|
320
|
+
setAutoTimer(20);
|
|
321
|
+
setTimerPaused(false);
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
324
|
+
setAutoTimer(20);
|
|
325
|
+
setTimerPaused(false);
|
|
326
|
+
const interval = setInterval(() => {
|
|
327
|
+
setAutoTimer((t) => {
|
|
328
|
+
if (timerPaused)
|
|
329
|
+
return t;
|
|
330
|
+
if (t <= 1) {
|
|
331
|
+
// Auto-apply LLM decision
|
|
332
|
+
const handler = store_1.store._onAssessmentAction;
|
|
333
|
+
if (handler && cur.llmRecommendation) {
|
|
334
|
+
handler({
|
|
335
|
+
type: cur.llmRecommendation.decision === 'allow' ? 'dismiss' : 'confirm',
|
|
336
|
+
assessment: cur,
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
return 0;
|
|
340
|
+
}
|
|
341
|
+
return t - 1;
|
|
342
|
+
});
|
|
343
|
+
}, 1000);
|
|
344
|
+
return () => clearInterval(interval);
|
|
345
|
+
}, [s.currentAssessment, timerPaused]);
|
|
346
|
+
const warningMsg = useAutoMessage(s.warning, () => store_1.store.setWarning(''), 5000);
|
|
347
|
+
const changeFlash = useAutoMessage(s.lastChangeFlash, () => store_1.store.setLastChangeFlash(''));
|
|
348
|
+
const current = s.currentAssessment;
|
|
349
|
+
const queueLen = s.pendingAssessments.length;
|
|
350
|
+
// ── Build header info ──────────────────────────────────────
|
|
351
|
+
const rootLabel = s.rootPath ? s.rootPath.replace(/\\/g, '/').split('/').pop() || s.rootPath : '';
|
|
352
|
+
// ── Settings panel ────────────────────────────────────────
|
|
353
|
+
if (showSettings) {
|
|
354
|
+
return (react_1.default.createElement(SettingsPanel_1.default, { userSettings: settingsUserData, projectConfig: settingsProjectData, onSave: (user, project) => {
|
|
355
|
+
const root = s.rootPath;
|
|
356
|
+
// Save user settings to cloud
|
|
357
|
+
(0, config_1.saveUserSettings)(user);
|
|
358
|
+
// Save project settings to local file
|
|
359
|
+
if (root)
|
|
360
|
+
(0, config_1.saveConfig)(root, project);
|
|
361
|
+
// Store user settings for future reference
|
|
362
|
+
store_1.store._userSettings = user;
|
|
363
|
+
setShowSettings(false);
|
|
364
|
+
store_1.store.setLearnedMessage('Settings saved');
|
|
365
|
+
}, onCancel: () => setShowSettings(false) }));
|
|
366
|
+
}
|
|
210
367
|
return (react_1.default.createElement(ink_1.Box, { flexDirection: "column" },
|
|
211
|
-
|
|
212
|
-
react_1.default.createElement(ink_1.Text, { color: theme_1.COLORS.primary, bold: true }, (0,
|
|
213
|
-
|
|
214
|
-
react_1.default.createElement(ink_1.Text, { color: theme_1.COLORS.gray },
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
react_1.default.createElement(ink_1.Text, { color: theme_1.COLORS.
|
|
219
|
-
|
|
220
|
-
s.phase
|
|
221
|
-
s.phase === '
|
|
222
|
-
|
|
223
|
-
react_1.default.createElement(
|
|
224
|
-
react_1.default.createElement(ink_1.Box,
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
s.
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
react_1.default.createElement(ink_1.Text, { color: theme_1.COLORS.
|
|
249
|
-
s.
|
|
250
|
-
|
|
368
|
+
react_1.default.createElement(ink_1.Text, null,
|
|
369
|
+
react_1.default.createElement(ink_1.Text, { color: theme_1.COLORS.primary, bold: true }, `◆ aspect code v${(0, version_1.getVersion)()}`),
|
|
370
|
+
rootLabel ? react_1.default.createElement(ink_1.Text, { color: theme_1.COLORS.gray }, ` ${SEP_CHAR} ${rootLabel}`) : null,
|
|
371
|
+
s.activePlatform ? react_1.default.createElement(ink_1.Text, { color: theme_1.COLORS.gray }, ` ${SEP_CHAR} ${s.activePlatform}`) : null,
|
|
372
|
+
s.updateMessage ? react_1.default.createElement(ink_1.Text, { color: theme_1.COLORS.gray }, ` ${SEP_CHAR} ${s.updateMessage}`) : null),
|
|
373
|
+
working && s.phase !== 'evaluating' && (react_1.default.createElement(ink_1.Text, { color: theme_1.COLORS.primary },
|
|
374
|
+
`${spinner} ${PHASE_TEXT[s.phase]}${detail}`,
|
|
375
|
+
s.phase === 'analyzing' && s.fileCount > 0 && (react_1.default.createElement(ink_1.Text, { color: theme_1.COLORS.gray }, ` — ${s.fileCount.toLocaleString()} files, ${s.edgeCount.toLocaleString()} edges`)),
|
|
376
|
+
s.phase === 'optimizing' && s.provider && (react_1.default.createElement(ink_1.Text, { color: theme_1.COLORS.gray }, ` — ${s.provider}`)))),
|
|
377
|
+
s.isFirstRun && working && s.phase !== 'evaluating' && (react_1.default.createElement(ink_1.Text, { color: theme_1.COLORS.gray }, 'Analyzing your codebase to generate AGENTS.md')),
|
|
378
|
+
s.isFirstRun && s.phase === 'evaluating' && (react_1.default.createElement(ink_1.Text, { color: theme_1.COLORS.gray }, 'Optimizing AGENTS.md — testing with synthetic scenarios to find gaps')),
|
|
379
|
+
s.managedFiles.length > 0 && (react_1.default.createElement(ink_1.Box, { marginTop: 0 },
|
|
380
|
+
react_1.default.createElement(MemoryMap_1.default, { files: s.managedFiles, dreaming: s.dreaming, userEmail: s.userEmail }))),
|
|
381
|
+
evalActive && evalLabel && !s.evalStatus.dismissed && (react_1.default.createElement(ink_1.Box, { flexDirection: "column" },
|
|
382
|
+
react_1.default.createElement(ink_1.Text, { color: evalDone ? theme_1.COLORS.primary : theme_1.COLORS.primaryDim },
|
|
383
|
+
evalDone ? evalLabel : `${spinner} ${evalLabel}`,
|
|
384
|
+
!evalDone && evalElapsed ? react_1.default.createElement(ink_1.Text, { color: theme_1.COLORS.gray }, ` ${evalElapsed}`) : null,
|
|
385
|
+
!evalDone && !s.evalStatus.cancelled ? ' [x] cancel' : '',
|
|
386
|
+
evalDone ? ' [c] clear' : ''),
|
|
387
|
+
s.evalStatus.phase === 'judging' && s.evalStatus.probeResults && (react_1.default.createElement(react_1.default.Fragment, null, s.evalStatus.probeResults.map((pr, i) => {
|
|
388
|
+
if (pr.status === 'pending')
|
|
389
|
+
return null;
|
|
390
|
+
if (pr.status === 'strong')
|
|
391
|
+
return null; // Only show gaps, not passes
|
|
392
|
+
return react_1.default.createElement(ink_1.Text, { key: `pr-${i}`, color: theme_1.COLORS.gray }, ` ○ gap: ${pr.task}`);
|
|
393
|
+
}))),
|
|
394
|
+
s.evalStatus.phase === 'applying' && s.evalStatus.editSummaries && s.evalStatus.editSummaries.length > 0 && (react_1.default.createElement(react_1.default.Fragment, null, s.evalStatus.editSummaries.map((line, i) => (react_1.default.createElement(ink_1.Text, { key: `ae-${i}`, color: theme_1.COLORS.gray }, ` + ${line}`))))),
|
|
395
|
+
s.evalStatus.iterationSummaries && s.evalStatus.iterationSummaries.map((summary, i) => (react_1.default.createElement(ink_1.Text, { key: `iter-${i}`, color: theme_1.COLORS.gray }, `├ ${summary}`))),
|
|
396
|
+
evalDone && s.evalStatus.editSummaries && s.evalStatus.editSummaries.length > 0 && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
397
|
+
s.evalStatus.editSummaries.slice(0, 5).map((line, i, arr) => {
|
|
398
|
+
const isLast = i === arr.length - 1 && (s.evalStatus.editSummaries?.length ?? 0) <= 5;
|
|
399
|
+
return react_1.default.createElement(ink_1.Text, { key: `edit-${i}`, color: theme_1.COLORS.gray }, `${isLast ? '└' : '├'} ${line}`);
|
|
400
|
+
}),
|
|
401
|
+
s.evalStatus.editSummaries.length > 5 && (react_1.default.createElement(ink_1.Text, { color: theme_1.COLORS.gray }, `└ +${s.evalStatus.editSummaries.length - 5} more`)))))),
|
|
402
|
+
warningMsg !== '' && (react_1.default.createElement(ink_1.Text, { color: theme_1.COLORS.yellow }, `● ${warningMsg}`)),
|
|
403
|
+
isWatching && (react_1.default.createElement(ink_1.Text, { color: theme_1.COLORS.gray },
|
|
404
|
+
`${pulse} watching`,
|
|
405
|
+
s.userEmail && s.syncStatus === 'synced' && s.lastSyncAt > 0 ? (react_1.default.createElement(ink_1.Text, { color: theme_1.COLORS.gray }, ` — ☁ synced`)) : null,
|
|
406
|
+
s.userEmail && s.syncStatus === 'offline' ? (react_1.default.createElement(ink_1.Text, { color: theme_1.COLORS.yellow }, ` — ☁ offline`)) : null)),
|
|
407
|
+
s.dreaming && (react_1.default.createElement(ink_1.Text, { color: theme_1.COLORS.primary }, `${dreamSpinner} refining context…`)),
|
|
408
|
+
isWatching && !s.suggestionsDismissed && s.suggestions.length > 0 && !current && !s.dreaming && (react_1.default.createElement(ink_1.Text, { color: theme_1.COLORS.gray }, ` ✦ ${s.suggestions.length} community insight${s.suggestions.length === 1 ? '' : 's'} — will refine on next dream cycle`)),
|
|
409
|
+
!s.dreaming && current && (current.type === 'warning' || current.type === 'violation') && (react_1.default.createElement(ink_1.Box, { flexDirection: "column" },
|
|
410
|
+
react_1.default.createElement(ink_1.Box, null,
|
|
411
|
+
react_1.default.createElement(ink_1.Text, { color: current.type === 'violation' ? theme_1.COLORS.red : theme_1.COLORS.yellow }, current.type === 'violation' ? '✗ ' : '⚠ '),
|
|
412
|
+
react_1.default.createElement(ink_1.Text, { color: theme_1.COLORS.white, bold: true }, current.file)),
|
|
413
|
+
react_1.default.createElement(ink_1.Text, { color: theme_1.COLORS.gray }, ` ${current.rule} · ${current.message}`),
|
|
414
|
+
current.details ? (react_1.default.createElement(ink_1.Text, { color: theme_1.COLORS.gray }, ` ${current.details}`)) : null,
|
|
415
|
+
current.llmRecommendation ? (react_1.default.createElement(react_1.default.Fragment, null,
|
|
416
|
+
react_1.default.createElement(ink_1.Text, { color: theme_1.COLORS.gray, dimColor: true }, ` ${Math.round(current.llmRecommendation.confidence * 100)}% — ${current.llmRecommendation.reasoning}`),
|
|
417
|
+
react_1.default.createElement(ink_1.Box, null,
|
|
418
|
+
current.llmRecommendation.decision === 'deny' ? (react_1.default.createElement(ink_1.Text, null,
|
|
419
|
+
react_1.default.createElement(ink_1.Text, { color: theme_1.COLORS.primary, bold: true }, ' [enter] enforce rule'),
|
|
420
|
+
react_1.default.createElement(ink_1.Text, { color: theme_1.COLORS.gray }, ' [n] allow [space] pause timer'))) : (react_1.default.createElement(ink_1.Text, null,
|
|
421
|
+
react_1.default.createElement(ink_1.Text, { color: theme_1.COLORS.primary, bold: true }, ' [enter] allow'),
|
|
422
|
+
react_1.default.createElement(ink_1.Text, { color: theme_1.COLORS.gray }, ' [y] enforce rule [space] pause timer'))),
|
|
423
|
+
autoTimer > 0 && (react_1.default.createElement(ink_1.Text, { color: theme_1.COLORS.gray }, timerPaused ? ' (paused)' : ` (${autoTimer}s)`))))) : (react_1.default.createElement(ink_1.Box, null,
|
|
424
|
+
react_1.default.createElement(ink_1.Text, { color: theme_1.COLORS.gray }, ' [y] confirm [n] dismiss [s] skip'))),
|
|
425
|
+
react_1.default.createElement(ink_1.Box, null, queueLen > 0 && (react_1.default.createElement(ink_1.Text, { color: theme_1.COLORS.gray }, ` (1 of ${queueLen + 1})`))))),
|
|
426
|
+
!s.dreaming && !current && changeFlash !== '' && isWatching && (react_1.default.createElement(ink_1.Text, { color: theme_1.COLORS.gray }, `✓ ${changeFlash}`)),
|
|
427
|
+
learnedMsg !== '' && (react_1.default.createElement(ink_1.Text, { color: theme_1.COLORS.primary }, `● ${learnedMsg}`)),
|
|
428
|
+
isWatching && (react_1.default.createElement(ink_1.Text, { color: theme_1.COLORS.gray, dimColor: true }, (() => {
|
|
429
|
+
const stats = s.assessmentStats;
|
|
430
|
+
const parts = [];
|
|
431
|
+
parts.push(`${stats.changes} source file change${stats.changes === 1 ? '' : 's'}`);
|
|
432
|
+
if (stats.warnings > 0)
|
|
433
|
+
parts.push(`${stats.warnings} warnings`);
|
|
434
|
+
if (stats.violations > 0)
|
|
435
|
+
parts.push(`${stats.violations} violations`);
|
|
436
|
+
if (stats.autoResolved > 0)
|
|
437
|
+
parts.push(`${stats.autoResolved} auto-resolved`);
|
|
438
|
+
return parts.join(' · ');
|
|
439
|
+
})())),
|
|
440
|
+
isWatching && (react_1.default.createElement(ink_1.Text, { color: theme_1.COLORS.gray, dimColor: true }, '[r] optimize [s] settings')),
|
|
441
|
+
s.tierExhausted && (react_1.default.createElement(ink_1.Box, { flexDirection: "column", marginTop: 1 },
|
|
442
|
+
react_1.default.createElement(ink_1.Text, { color: theme_1.COLORS.red, bold: true }, `${s.userTier === 'free' ? 'Free' : 'Weekly'} limit reached (${(0, usageTracker_1.formatTokens)(s.tierTokensUsed)} / ${(0, usageTracker_1.formatTokens)(s.tierTokensCap)} tokens).`),
|
|
443
|
+
react_1.default.createElement(ink_1.Text, null, ''),
|
|
444
|
+
react_1.default.createElement(ink_1.Text, { color: theme_1.COLORS.primaryDim }, ' [u] Upgrade to Pro — $8/mo, 1M tokens/week'),
|
|
445
|
+
react_1.default.createElement(ink_1.Text, { color: theme_1.COLORS.gray, dimColor: true }, ' [k] Add your own key (restart required after adding)'))),
|
|
446
|
+
s.userTier === 'byok' ? (react_1.default.createElement(ink_1.Text, { color: theme_1.COLORS.gray, dimColor: true }, s.sessionUsage.calls > 0
|
|
447
|
+
? `${(0, usageTracker_1.formatTokens)(s.sessionUsage.inputTokens)} in · ${(0, usageTracker_1.formatTokens)(s.sessionUsage.outputTokens)} out · ${s.sessionUsage.calls} call${s.sessionUsage.calls === 1 ? '' : 's'} (BYOK)`
|
|
448
|
+
: 'BYOK — 0 calls')) : s.userTier === 'pro' ? (react_1.default.createElement(ink_1.Text, { color: s.tierTokensCap > 0 && s.tierTokensUsed / s.tierTokensCap >= 0.95 ? theme_1.COLORS.red : s.tierTokensCap > 0 && s.tierTokensUsed / s.tierTokensCap >= 0.8 ? theme_1.COLORS.yellow : theme_1.COLORS.gray, dimColor: s.tierTokensCap === 0 || s.tierTokensUsed / s.tierTokensCap < 0.8 }, `${(0, usageTracker_1.formatTokens)(s.tierTokensUsed)} / ${(0, usageTracker_1.formatTokens)(s.tierTokensCap)} weekly tokens${s.sessionUsage.calls > 0 ? ` · ${s.sessionUsage.calls} call${s.sessionUsage.calls === 1 ? '' : 's'}` : ''}${s.tierResetAt ? ` (resets ${new Date(s.tierResetAt).toLocaleDateString('en-US', { weekday: 'short', month: 'short', day: 'numeric' })})` : ''}`)) : s.tierTokensUsed >= 75000 ? (react_1.default.createElement(ink_1.Text, { color: s.tierTokensCap > 0 && s.tierTokensUsed / s.tierTokensCap >= 0.95 ? theme_1.COLORS.red : s.tierTokensCap > 0 && s.tierTokensUsed / s.tierTokensCap >= 0.8 ? theme_1.COLORS.yellow : theme_1.COLORS.gray, dimColor: s.tierTokensCap === 0 || s.tierTokensUsed / s.tierTokensCap < 0.8 }, `${(0, usageTracker_1.formatTokens)(s.tierTokensUsed)} / ${(0, usageTracker_1.formatTokens)(s.tierTokensCap)} free tokens${s.sessionUsage.calls > 0 ? ` · ${s.sessionUsage.calls} call${s.sessionUsage.calls === 1 ? '' : 's'}` : ''}`)) : (s.sessionUsage.calls > 0 ? (react_1.default.createElement(ink_1.Text, { color: theme_1.COLORS.gray, dimColor: true }, `${s.sessionUsage.calls} call${s.sessionUsage.calls === 1 ? '' : 's'}`)) : null)));
|
|
251
449
|
};
|
|
252
450
|
exports.default = Dashboard;
|
|
253
451
|
//# sourceMappingURL=Dashboard.js.map
|