@mozole/cli 1.4.3 → 2.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/LICENSE +16 -4
- package/README.md +85 -112
- package/dist/cli.d.ts +3 -2
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +231 -181
- package/dist/cli.js.map +1 -1
- package/dist/commands/adopt.d.ts +5 -10
- package/dist/commands/adopt.d.ts.map +1 -1
- package/dist/commands/adopt.js +49 -849
- package/dist/commands/adopt.js.map +1 -1
- package/dist/commands/doctor.d.ts +1 -7
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +69 -377
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/new.d.ts +8 -10
- package/dist/commands/new.d.ts.map +1 -1
- package/dist/commands/new.js +32 -197
- package/dist/commands/new.js.map +1 -1
- package/dist/commands/phase.d.ts +11 -0
- package/dist/commands/phase.d.ts.map +1 -0
- package/dist/commands/phase.js +106 -0
- package/dist/commands/phase.js.map +1 -0
- package/dist/commands/prototype.d.ts +6 -0
- package/dist/commands/prototype.d.ts.map +1 -0
- package/dist/commands/prototype.js +28 -0
- package/dist/commands/prototype.js.map +1 -0
- package/dist/commands/repomap.d.ts +6 -0
- package/dist/commands/repomap.d.ts.map +1 -0
- package/dist/commands/repomap.js +71 -0
- package/dist/commands/repomap.js.map +1 -0
- package/dist/commands/test.d.ts +6 -0
- package/dist/commands/test.d.ts.map +1 -0
- package/dist/commands/test.js +115 -0
- package/dist/commands/test.js.map +1 -0
- package/dist/commands/ui.d.ts +6 -41
- package/dist/commands/ui.d.ts.map +1 -1
- package/dist/commands/ui.js +132 -459
- package/dist/commands/ui.js.map +1 -1
- package/dist/commands/verify.d.ts +12 -7
- package/dist/commands/verify.d.ts.map +1 -1
- package/dist/commands/verify.js +180 -65
- package/dist/commands/verify.js.map +1 -1
- package/dist/qa/a11y.d.ts +24 -0
- package/dist/qa/a11y.d.ts.map +1 -0
- package/dist/qa/a11y.js +124 -0
- package/dist/qa/a11y.js.map +1 -0
- package/dist/qa/breakpoints.d.ts +16 -0
- package/dist/qa/breakpoints.d.ts.map +1 -0
- package/dist/qa/breakpoints.js +45 -0
- package/dist/qa/breakpoints.js.map +1 -0
- package/dist/qa/contract.d.ts +21 -0
- package/dist/qa/contract.d.ts.map +1 -0
- package/dist/qa/contract.js +116 -0
- package/dist/qa/contract.js.map +1 -0
- package/dist/qa/index.d.ts +6 -0
- package/dist/qa/index.d.ts.map +1 -0
- package/dist/qa/index.js +6 -0
- package/dist/qa/index.js.map +1 -0
- package/dist/qa/probe.d.ts +48 -0
- package/dist/qa/probe.d.ts.map +1 -0
- package/dist/qa/probe.js +206 -0
- package/dist/qa/probe.js.map +1 -0
- package/dist/qa/runner.d.ts +27 -33
- package/dist/qa/runner.d.ts.map +1 -1
- package/dist/qa/runner.js +286 -332
- package/dist/qa/runner.js.map +1 -1
- package/dist/scaffold/agents.d.ts +5 -0
- package/dist/scaffold/agents.d.ts.map +1 -0
- package/dist/scaffold/agents.js +84 -0
- package/dist/scaffold/agents.js.map +1 -0
- package/dist/scaffold/backend.d.ts +6 -8
- package/dist/scaffold/backend.d.ts.map +1 -1
- package/dist/scaffold/backend.js +318 -199
- package/dist/scaffold/backend.js.map +1 -1
- package/dist/scaffold/design.d.ts +4 -3
- package/dist/scaffold/design.d.ts.map +1 -1
- package/dist/scaffold/design.js +38 -47
- package/dist/scaffold/design.js.map +1 -1
- package/dist/scaffold/flagship.d.ts +8 -0
- package/dist/scaffold/flagship.d.ts.map +1 -0
- package/dist/scaffold/flagship.js +337 -0
- package/dist/scaffold/flagship.js.map +1 -0
- package/dist/scaffold/index.d.ts +9 -0
- package/dist/scaffold/index.d.ts.map +1 -0
- package/dist/scaffold/index.js +48 -0
- package/dist/scaffold/index.js.map +1 -0
- package/dist/scaffold/phases.d.ts +10 -0
- package/dist/scaffold/phases.d.ts.map +1 -0
- package/dist/scaffold/phases.js +165 -0
- package/dist/scaffold/phases.js.map +1 -0
- package/dist/scaffold/repomap.d.ts +6 -0
- package/dist/scaffold/repomap.d.ts.map +1 -0
- package/dist/scaffold/repomap.js +89 -0
- package/dist/scaffold/repomap.js.map +1 -0
- package/dist/scaffold/standard.d.ts +13 -0
- package/dist/scaffold/standard.d.ts.map +1 -0
- package/dist/scaffold/standard.js +371 -0
- package/dist/scaffold/standard.js.map +1 -0
- package/dist/scaffold/tokens.d.ts +3 -0
- package/dist/scaffold/tokens.d.ts.map +1 -0
- package/dist/scaffold/tokens.js +126 -0
- package/dist/scaffold/tokens.js.map +1 -0
- package/dist/server/manager.d.ts +23 -0
- package/dist/server/manager.d.ts.map +1 -0
- package/dist/server/manager.js +96 -0
- package/dist/server/manager.js.map +1 -0
- package/dist/ui/CockpitApp.d.ts +13 -0
- package/dist/ui/CockpitApp.d.ts.map +1 -0
- package/dist/ui/CockpitApp.js +292 -0
- package/dist/ui/CockpitApp.js.map +1 -0
- package/dist/utils/ai-trace.d.ts +8 -0
- package/dist/utils/ai-trace.d.ts.map +1 -0
- package/dist/utils/ai-trace.js +69 -0
- package/dist/utils/ai-trace.js.map +1 -0
- package/dist/utils/browser.d.ts +10 -0
- package/dist/utils/browser.d.ts.map +1 -0
- package/dist/utils/browser.js +127 -0
- package/dist/utils/browser.js.map +1 -0
- package/dist/utils/fs.d.ts +18 -0
- package/dist/utils/fs.d.ts.map +1 -0
- package/dist/utils/fs.js +296 -0
- package/dist/utils/fs.js.map +1 -0
- package/dist/utils/git.d.ts +9 -0
- package/dist/utils/git.d.ts.map +1 -0
- package/dist/utils/git.js +69 -0
- package/dist/utils/git.js.map +1 -0
- package/dist/utils/process.d.ts +21 -0
- package/dist/utils/process.d.ts.map +1 -0
- package/dist/utils/process.js +120 -0
- package/dist/utils/process.js.map +1 -0
- package/dist/version.d.ts +21 -36
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +21 -44
- package/dist/version.js.map +1 -1
- package/package.json +22 -38
- package/CHANGELOG.md +0 -38
- package/dist/commands/cce.d.ts +0 -7
- package/dist/commands/cce.d.ts.map +0 -1
- package/dist/commands/cce.js +0 -37
- package/dist/commands/cce.js.map +0 -1
- package/dist/commands/logs.d.ts +0 -3
- package/dist/commands/logs.d.ts.map +0 -1
- package/dist/commands/logs.js +0 -40
- package/dist/commands/logs.js.map +0 -1
- package/dist/commands/qa.d.ts +0 -12
- package/dist/commands/qa.d.ts.map +0 -1
- package/dist/commands/qa.js +0 -143
- package/dist/commands/qa.js.map +0 -1
- package/dist/commands/stats.d.ts +0 -37
- package/dist/commands/stats.d.ts.map +0 -1
- package/dist/commands/stats.js +0 -169
- package/dist/commands/stats.js.map +0 -1
- package/dist/commands/template.d.ts +0 -8
- package/dist/commands/template.d.ts.map +0 -1
- package/dist/commands/template.js +0 -392
- package/dist/commands/template.js.map +0 -1
- package/dist/config/project.d.ts +0 -54
- package/dist/config/project.d.ts.map +0 -1
- package/dist/config/project.js +0 -100
- package/dist/config/project.js.map +0 -1
- package/dist/context/cce.d.ts +0 -39
- package/dist/context/cce.d.ts.map +0 -1
- package/dist/context/cce.js +0 -455
- package/dist/context/cce.js.map +0 -1
- package/dist/governor/fingerprint.d.ts +0 -7
- package/dist/governor/fingerprint.d.ts.map +0 -1
- package/dist/governor/fingerprint.js +0 -120
- package/dist/governor/fingerprint.js.map +0 -1
- package/dist/governor/hook.d.ts +0 -13
- package/dist/governor/hook.d.ts.map +0 -1
- package/dist/governor/hook.js +0 -389
- package/dist/governor/hook.js.map +0 -1
- package/dist/governor/state.d.ts +0 -45
- package/dist/governor/state.d.ts.map +0 -1
- package/dist/governor/state.js +0 -60
- package/dist/governor/state.js.map +0 -1
- package/dist/integrations/antigravity.d.ts +0 -20
- package/dist/integrations/antigravity.d.ts.map +0 -1
- package/dist/integrations/antigravity.js +0 -153
- package/dist/integrations/antigravity.js.map +0 -1
- package/dist/output-safety.d.ts +0 -3
- package/dist/output-safety.d.ts.map +0 -1
- package/dist/output-safety.js +0 -44
- package/dist/output-safety.js.map +0 -1
- package/dist/output.d.ts +0 -5
- package/dist/output.d.ts.map +0 -1
- package/dist/output.js +0 -2
- package/dist/output.js.map +0 -1
- package/dist/platform/executable.d.ts +0 -11
- package/dist/platform/executable.d.ts.map +0 -1
- package/dist/platform/executable.js +0 -69
- package/dist/platform/executable.js.map +0 -1
- package/dist/platform/process.d.ts +0 -27
- package/dist/platform/process.d.ts.map +0 -1
- package/dist/platform/process.js +0 -189
- package/dist/platform/process.js.map +0 -1
- package/dist/progress.d.ts +0 -44
- package/dist/progress.d.ts.map +0 -1
- package/dist/progress.js +0 -123
- package/dist/progress.js.map +0 -1
- package/dist/qa/artifacts.d.ts +0 -3
- package/dist/qa/artifacts.d.ts.map +0 -1
- package/dist/qa/artifacts.js +0 -15
- package/dist/qa/artifacts.js.map +0 -1
- package/dist/qa/diff.d.ts +0 -10
- package/dist/qa/diff.d.ts.map +0 -1
- package/dist/qa/diff.js +0 -90
- package/dist/qa/diff.js.map +0 -1
- package/dist/qa/server.d.ts +0 -10
- package/dist/qa/server.d.ts.map +0 -1
- package/dist/qa/server.js +0 -127
- package/dist/qa/server.js.map +0 -1
- package/dist/scaffold/adoption.d.ts +0 -17
- package/dist/scaffold/adoption.d.ts.map +0 -1
- package/dist/scaffold/adoption.js +0 -279
- package/dist/scaffold/adoption.js.map +0 -1
- package/dist/scaffold/legacy.d.ts +0 -4
- package/dist/scaffold/legacy.d.ts.map +0 -1
- package/dist/scaffold/legacy.js +0 -139
- package/dist/scaffold/legacy.js.map +0 -1
- package/dist/scaffold/routes.d.ts +0 -3
- package/dist/scaffold/routes.d.ts.map +0 -1
- package/dist/scaffold/routes.js +0 -37
- package/dist/scaffold/routes.js.map +0 -1
- package/dist/scaffold/standalone.d.ts +0 -7
- package/dist/scaffold/standalone.d.ts.map +0 -1
- package/dist/scaffold/standalone.js +0 -374
- package/dist/scaffold/standalone.js.map +0 -1
- package/dist/scaffold/templates.d.ts +0 -9
- package/dist/scaffold/templates.d.ts.map +0 -1
- package/dist/scaffold/templates.js +0 -317
- package/dist/scaffold/templates.js.map +0 -1
- package/dist/scaffold/write.d.ts +0 -2
- package/dist/scaffold/write.d.ts.map +0 -1
- package/dist/scaffold/write.js +0 -38
- package/dist/scaffold/write.js.map +0 -1
- package/dist/telemetry/store.d.ts +0 -33
- package/dist/telemetry/store.d.ts.map +0 -1
- package/dist/telemetry/store.js +0 -75
- package/dist/telemetry/store.js.map +0 -1
- package/dist/template/servers.d.ts +0 -21
- package/dist/template/servers.d.ts.map +0 -1
- package/dist/template/servers.js +0 -193
- package/dist/template/servers.js.map +0 -1
- package/dist/template/workspace.d.ts +0 -23
- package/dist/template/workspace.d.ts.map +0 -1
- package/dist/template/workspace.js +0 -152
- package/dist/template/workspace.js.map +0 -1
- package/dist/verify/runner.d.ts +0 -16
- package/dist/verify/runner.d.ts.map +0 -1
- package/dist/verify/runner.js +0 -112
- package/dist/verify/runner.js.map +0 -1
- package/docs/agent-audit.md +0 -24
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"standard.js","sourceRoot":"","sources":["../../src/scaffold/standard.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,UAAU,2BAA2B,CAAC,WAAmB;IAC7D,MAAM,GAAG,GAAG;QACV,IAAI,EAAE,WAAW;QACjB,OAAO,EAAE,IAAI;QACb,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE;YACP,GAAG,EAAE,kBAAkB;YACvB,KAAK,EAAE,oBAAoB;YAC3B,OAAO,EAAE,cAAc;YACvB,SAAS,EAAE,sCAAsC;YACjD,MAAM,EAAE,eAAe;SACxB;QACD,YAAY,EAAE;YACZ,wBAAwB,EAAE,QAAQ;YAClC,sBAAsB,EAAE,QAAQ;YAChC,oBAAoB,EAAE,QAAQ;YAC9B,qBAAqB,EAAE,QAAQ;YAC/B,KAAK,EAAE,SAAS;YAChB,KAAK,E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;gDAMqB,KAAK;;UAE3C,OAAO;;;;;CAKhB,CACI,CAAC;IACJ,CAAC;IAED,aAAa;IACb,MAAM,WAAW,CACf,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,YAAY,CAAC,EACvD,sBAAsB,EAAE,CACzB,CAAC;IACF,MAAM,WAAW,CACf,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,YAAY,CAAC,EACvD,sBAAsB,EAAE,CACzB,CAAC;IACF,MAAM,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,CAAC,EAAE,qBAAqB,EAAE,CAAC,CAAC;IAChG,MAAM,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,WAAW,CAAC,EAAE,oBAAoB,EAAE,CAAC,CAAC;AAChG,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../src/scaffold/tokens.ts"],"names":[],"mappings":"AAGA,wBAAgB,0BAA0B,IAAI,MAAM,CAsHnD;AAED,wBAAsB,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAGvE"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { atomicWrite } from "../utils/fs.js";
|
|
3
|
+
export function generateCanonicalTokensCss() {
|
|
4
|
+
return `@import "tailwindcss";
|
|
5
|
+
|
|
6
|
+
@theme static {
|
|
7
|
+
/* Palette */
|
|
8
|
+
--color-background: #090a0f;
|
|
9
|
+
--color-foreground: #f8fafc;
|
|
10
|
+
--color-surface: #12141c;
|
|
11
|
+
--color-surface-elevated: #1a1d29;
|
|
12
|
+
--color-border: #232738;
|
|
13
|
+
--color-border-subtle: #171a26;
|
|
14
|
+
|
|
15
|
+
--color-primary: #3b82f6;
|
|
16
|
+
--color-primary-foreground: #ffffff;
|
|
17
|
+
--color-accent: #60a5fa;
|
|
18
|
+
--color-canvas-start: rgba(59, 130, 246, 0.06);
|
|
19
|
+
--color-canvas-end: rgba(9, 10, 15, 0);
|
|
20
|
+
--color-accent-foreground: #090a0f;
|
|
21
|
+
|
|
22
|
+
--color-muted: #1e2230;
|
|
23
|
+
--color-muted-foreground: #94a3b8;
|
|
24
|
+
|
|
25
|
+
--color-success: #10b981;
|
|
26
|
+
--color-warning: #f59e0b;
|
|
27
|
+
--color-danger: #ef4444;
|
|
28
|
+
|
|
29
|
+
/* Typography */
|
|
30
|
+
--font-display: "Cabinet Grotesk", "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
|
|
31
|
+
--font-body: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
|
|
32
|
+
--font-interface: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
|
|
33
|
+
--font-mono: "JetBrains Mono", ui-monospace, monospace;
|
|
34
|
+
|
|
35
|
+
--text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.8125rem);
|
|
36
|
+
--text-sm: clamp(0.875rem, 0.825rem + 0.25vw, 0.9375rem);
|
|
37
|
+
--text-base: clamp(1rem, 0.95rem + 0.25vw, 1.0625rem);
|
|
38
|
+
--text-lg: clamp(1.125rem, 1.05rem + 0.375vw, 1.25rem);
|
|
39
|
+
--text-xl: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
|
|
40
|
+
--text-2xl: clamp(1.5rem, 1.35rem + 0.75vw, 1.875rem);
|
|
41
|
+
--text-3xl: clamp(1.875rem, 1.65rem + 1.125vw, 2.25rem);
|
|
42
|
+
--text-4xl: clamp(2.25rem, 1.95rem + 1.5vw, 3rem);
|
|
43
|
+
--text-5xl: clamp(3rem, 2.5rem + 2.5vw, 4.5rem);
|
|
44
|
+
|
|
45
|
+
/* Layout */
|
|
46
|
+
--radius-xs: 4px;
|
|
47
|
+
--radius-sm: 6px;
|
|
48
|
+
--radius-md: 10px;
|
|
49
|
+
--radius-lg: 16px;
|
|
50
|
+
--radius-full: 9999px;
|
|
51
|
+
|
|
52
|
+
--spacing-container-max: 1280px;
|
|
53
|
+
--spacing-container-gutter: clamp(1rem, 0.5rem + 2.5vw, 2.5rem);
|
|
54
|
+
|
|
55
|
+
/* Shadows */
|
|
56
|
+
--shadow-solid-sm: 0 2px 0 0 rgba(0, 0, 0, 0.4);
|
|
57
|
+
--shadow-solid-md: 0 4px 0 0 rgba(0, 0, 0, 0.5);
|
|
58
|
+
--shadow-solid-lg: 0 8px 0 0 rgba(0, 0, 0, 0.6);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
@layer base {
|
|
62
|
+
*,
|
|
63
|
+
*::before,
|
|
64
|
+
*::after {
|
|
65
|
+
box-sizing: border-box;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
html {
|
|
69
|
+
font-family: var(--font-body);
|
|
70
|
+
font-size: 16px;
|
|
71
|
+
background-color: var(--color-background);
|
|
72
|
+
color: var(--color-foreground);
|
|
73
|
+
text-rendering: optimizeLegibility;
|
|
74
|
+
-webkit-font-smoothing: antialiased;
|
|
75
|
+
-moz-osx-font-smoothing: grayscale;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
body {
|
|
79
|
+
margin: 0;
|
|
80
|
+
min-height: 100vh;
|
|
81
|
+
display: flex;
|
|
82
|
+
flex-direction: column;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
h1,
|
|
86
|
+
h2,
|
|
87
|
+
h3,
|
|
88
|
+
h4,
|
|
89
|
+
h5,
|
|
90
|
+
h6 {
|
|
91
|
+
font-family: var(--font-display);
|
|
92
|
+
font-weight: 700;
|
|
93
|
+
letter-spacing: -0.02em;
|
|
94
|
+
margin: 0;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
p {
|
|
98
|
+
margin: 0;
|
|
99
|
+
line-height: 1.6;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/* Accessible focus rings */
|
|
103
|
+
:focus-visible {
|
|
104
|
+
outline: 2px solid var(--color-primary);
|
|
105
|
+
outline-offset: 2px;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/* Respect reduced motion */
|
|
109
|
+
@media (prefers-reduced-motion: reduce) {
|
|
110
|
+
*,
|
|
111
|
+
*::before,
|
|
112
|
+
*::after {
|
|
113
|
+
animation-duration: 0.01ms;
|
|
114
|
+
animation-iteration-count: 1;
|
|
115
|
+
transition-duration: 0.01ms;
|
|
116
|
+
scroll-behavior: auto;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
`;
|
|
121
|
+
}
|
|
122
|
+
export async function scaffoldTokens(projectRoot) {
|
|
123
|
+
const css = generateCanonicalTokensCss();
|
|
124
|
+
await atomicWrite(path.join(projectRoot, "src", "styles", "tokens.css"), css);
|
|
125
|
+
}
|
|
126
|
+
//# sourceMappingURL=tokens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../src/scaffold/tokens.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,UAAU,0BAA0B;IACxC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoHR,CAAC;AACF,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,WAAmB;IACtD,MAAM,GAAG,GAAG,0BAA0B,EAAE,CAAC;IACzC,MAAM,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,YAAY,CAAC,EAAE,GAAG,CAAC,CAAC;AAChF,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type ChildProcess } from "node:child_process";
|
|
2
|
+
export interface ManagedServer {
|
|
3
|
+
id: string;
|
|
4
|
+
projectName: string;
|
|
5
|
+
projectPath: string;
|
|
6
|
+
port: number;
|
|
7
|
+
process: ChildProcess;
|
|
8
|
+
url: string;
|
|
9
|
+
startTime: number;
|
|
10
|
+
recentLogs: string[];
|
|
11
|
+
}
|
|
12
|
+
export declare function findAvailablePort(startPort?: number, maxTries?: number): Promise<number>;
|
|
13
|
+
declare class ServerManager {
|
|
14
|
+
private servers;
|
|
15
|
+
startServer(projectName: string, projectPath: string): Promise<ManagedServer>;
|
|
16
|
+
stopServer(projectName: string): boolean;
|
|
17
|
+
stopAll(): void;
|
|
18
|
+
getRunningServers(): ManagedServer[];
|
|
19
|
+
getServer(projectName: string): ManagedServer | undefined;
|
|
20
|
+
}
|
|
21
|
+
export declare const serverManager: ServerManager;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../src/server/manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAS,MAAM,oBAAoB,CAAC;AAI9D,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,YAAY,CAAC;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,wBAAsB,iBAAiB,CAAC,SAAS,SAAO,EAAE,QAAQ,SAAK,GAAG,OAAO,CAAC,MAAM,CAAC,CAaxF;AAED,cAAM,aAAa;IACjB,OAAO,CAAC,OAAO,CAAoC;IAEtC,WAAW,CAAC,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IA0DnF,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO;IAUxC,OAAO,IAAI,IAAI;IAMf,iBAAiB,IAAI,aAAa,EAAE;IAIpC,SAAS,CAAC,WAAW,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS;CAIjE;AAED,eAAO,MAAM,aAAa,eAAsB,CAAC"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import net from "node:net";
|
|
3
|
+
import { terminateProcess, trackProcess } from "../utils/process.js";
|
|
4
|
+
export async function findAvailablePort(startPort = 5173, maxTries = 20) {
|
|
5
|
+
for (let p = startPort; p < startPort + maxTries; p++) {
|
|
6
|
+
const free = await new Promise((resolve) => {
|
|
7
|
+
const server = net.createServer();
|
|
8
|
+
server.once("error", () => resolve(false));
|
|
9
|
+
server.once("listening", () => {
|
|
10
|
+
server.close(() => resolve(true));
|
|
11
|
+
});
|
|
12
|
+
server.listen(p, "127.0.0.1");
|
|
13
|
+
});
|
|
14
|
+
if (free)
|
|
15
|
+
return p;
|
|
16
|
+
}
|
|
17
|
+
throw new Error(`Unable to find an open port in range ${startPort}-${startPort + maxTries}`);
|
|
18
|
+
}
|
|
19
|
+
class ServerManager {
|
|
20
|
+
servers = new Map();
|
|
21
|
+
async startServer(projectName, projectPath) {
|
|
22
|
+
const existing = this.servers.get(projectName);
|
|
23
|
+
if (existing && existing.process.exitCode === null) {
|
|
24
|
+
return existing;
|
|
25
|
+
}
|
|
26
|
+
const port = await findAvailablePort(5173);
|
|
27
|
+
const recentLogs = [];
|
|
28
|
+
const npmCmd = process.platform === "win32" ? "npm.cmd" : "npm";
|
|
29
|
+
const child = spawn(npmCmd, ["run", "dev", "--", "--port", String(port), "--strictPort"], {
|
|
30
|
+
cwd: projectPath,
|
|
31
|
+
shell: false,
|
|
32
|
+
detached: process.platform !== "win32",
|
|
33
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
34
|
+
env: { ...process.env, PORT: String(port) },
|
|
35
|
+
});
|
|
36
|
+
trackProcess(child);
|
|
37
|
+
const appendLog = (chunk) => {
|
|
38
|
+
const text = chunk.toString();
|
|
39
|
+
for (const line of text.split("\n")) {
|
|
40
|
+
if (line.trim()) {
|
|
41
|
+
recentLogs.push(line.trim());
|
|
42
|
+
if (recentLogs.length > 50)
|
|
43
|
+
recentLogs.shift();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
child.stdout?.on("data", appendLog);
|
|
48
|
+
child.stderr?.on("data", appendLog);
|
|
49
|
+
const managed = {
|
|
50
|
+
id: `${projectName}-${port}`,
|
|
51
|
+
projectName,
|
|
52
|
+
projectPath,
|
|
53
|
+
port,
|
|
54
|
+
process: child,
|
|
55
|
+
url: `http://localhost:${port}`,
|
|
56
|
+
startTime: Date.now(),
|
|
57
|
+
recentLogs,
|
|
58
|
+
};
|
|
59
|
+
child.once("close", () => {
|
|
60
|
+
if (this.servers.get(projectName) === managed)
|
|
61
|
+
this.servers.delete(projectName);
|
|
62
|
+
});
|
|
63
|
+
this.servers.set(projectName, managed);
|
|
64
|
+
await new Promise((resolve, reject) => {
|
|
65
|
+
child.once("spawn", resolve);
|
|
66
|
+
child.once("error", (error) => {
|
|
67
|
+
if (this.servers.get(projectName) === managed)
|
|
68
|
+
this.servers.delete(projectName);
|
|
69
|
+
reject(error);
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
return managed;
|
|
73
|
+
}
|
|
74
|
+
stopServer(projectName) {
|
|
75
|
+
const managed = this.servers.get(projectName);
|
|
76
|
+
if (!managed)
|
|
77
|
+
return false;
|
|
78
|
+
terminateProcess(managed.process.pid, true);
|
|
79
|
+
this.servers.delete(projectName);
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
stopAll() {
|
|
83
|
+
for (const [name] of this.servers) {
|
|
84
|
+
this.stopServer(name);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
getRunningServers() {
|
|
88
|
+
return Array.from(this.servers.values()).filter((s) => s.process.exitCode === null);
|
|
89
|
+
}
|
|
90
|
+
getServer(projectName) {
|
|
91
|
+
const s = this.servers.get(projectName);
|
|
92
|
+
return s && s.process.exitCode === null ? s : undefined;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
export const serverManager = new ServerManager();
|
|
96
|
+
//# sourceMappingURL=manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manager.js","sourceRoot":"","sources":["../../src/server/manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAarE,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,SAAS,GAAG,IAAI,EAAE,QAAQ,GAAG,EAAE;IACrE,KAAK,IAAI,CAAC,GAAG,SAAS,EAAE,CAAC,GAAG,SAAS,GAAG,QAAQ,EAAE,CAAC,EAAE,EAAE,CAAC;QACtD,MAAM,IAAI,GAAG,MAAM,IAAI,OAAO,CAAU,CAAC,OAAO,EAAE,EAAE;YAClD,MAAM,MAAM,GAAG,GAAG,CAAC,YAAY,EAAE,CAAC;YAClC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;YAC3C,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,EAAE;gBAC5B,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;YACpC,CAAC,CAAC,CAAC;YACH,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC;QAChC,CAAC,CAAC,CAAC;QACH,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
1
|
+
import React from "react";
|
|
2
|
+
import type { DiscoveredProject } from "../utils/fs.js";
|
|
3
|
+
export type CockpitTab = "overview" | "servers" | "projects" | "logs";
|
|
4
|
+
export interface CockpitProps {
|
|
5
|
+
projectRoot: string;
|
|
6
|
+
activeProject: string;
|
|
7
|
+
protoRoot?: string | null;
|
|
8
|
+
projects?: DiscoveredProject[];
|
|
9
|
+
initialTab?: CockpitTab;
|
|
10
|
+
onExit?: () => void;
|
|
11
|
+
}
|
|
12
|
+
export declare function CockpitApp({ projectRoot: initialProjectRoot, activeProject: initialActiveProject, protoRoot, projects, initialTab, onExit, }: CockpitProps): React.JSX.Element;
|
|
13
|
+
//# sourceMappingURL=CockpitApp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CockpitApp.d.ts","sourceRoot":"","sources":["../../src/ui/CockpitApp.tsx"],"names":[],"mappings":"AACA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAOhE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAGxD,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG,SAAS,GAAG,UAAU,GAAG,MAAM,CAAC;AAEtE,MAAM,WAAW,YAAY;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,QAAQ,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC/B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AASD,wBAAgB,UAAU,CAAC,EACzB,WAAW,EAAE,kBAAkB,EAC/B,aAAa,EAAE,oBAAoB,EACnC,SAAS,EACT,QAAa,EACb,UAAuB,EACvB,MAAM,GACP,EAAE,YAAY,qBAquBd"}
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text, useApp, useInput } from "ink";
|
|
3
|
+
import { useCallback, useEffect, useState } from "react";
|
|
4
|
+
import { doctorCommand } from "../commands/doctor.js";
|
|
5
|
+
import { getProjectPhaseStatus, phaseCommand } from "../commands/phase.js";
|
|
6
|
+
import { repomapCommand } from "../commands/repomap.js";
|
|
7
|
+
import { verifyCommand } from "../commands/verify.js";
|
|
8
|
+
import { PHASES } from "../scaffold/phases.js";
|
|
9
|
+
import { serverManager } from "../server/manager.js";
|
|
10
|
+
import { CLI_VERSION } from "../version.js";
|
|
11
|
+
export function CockpitApp({ projectRoot: initialProjectRoot, activeProject: initialActiveProject, protoRoot, projects = [], initialTab = "overview", onExit, }) {
|
|
12
|
+
const { exit } = useApp();
|
|
13
|
+
const [currentTab, setCurrentTab] = useState(initialTab);
|
|
14
|
+
const [activeProject, setActiveProject] = useState(initialActiveProject);
|
|
15
|
+
const [projectRoot, setProjectRoot] = useState(initialProjectRoot);
|
|
16
|
+
const [selectedProjectIndex, setSelectedProjectIndex] = useState(() => {
|
|
17
|
+
const idx = projects.findIndex((p) => p.name === initialActiveProject);
|
|
18
|
+
return idx >= 0 ? idx : 0;
|
|
19
|
+
});
|
|
20
|
+
const [currentPhase, setCurrentPhase] = useState("00");
|
|
21
|
+
const [server, setServer] = useState(() => serverManager.getServer(activeProject));
|
|
22
|
+
const [allRunningServers, setAllRunningServers] = useState(() => serverManager.getRunningServers());
|
|
23
|
+
const [logs, setLogs] = useState([
|
|
24
|
+
{
|
|
25
|
+
id: "init",
|
|
26
|
+
timestamp: new Date().toLocaleTimeString(),
|
|
27
|
+
level: "info",
|
|
28
|
+
text: `Cockpit initialized for ${activeProject}`,
|
|
29
|
+
},
|
|
30
|
+
]);
|
|
31
|
+
const [busyAction, setBusyAction] = useState(null);
|
|
32
|
+
const addLog = useCallback((text, level = "info") => {
|
|
33
|
+
const entry = {
|
|
34
|
+
id: `${Date.now()}-${Math.random()}`,
|
|
35
|
+
timestamp: new Date().toLocaleTimeString(),
|
|
36
|
+
level,
|
|
37
|
+
text,
|
|
38
|
+
};
|
|
39
|
+
setLogs((prev) => [...prev.slice(-60), entry]);
|
|
40
|
+
}, []);
|
|
41
|
+
const refreshPhase = useCallback(async (targetDir = projectRoot) => {
|
|
42
|
+
try {
|
|
43
|
+
const status = await getProjectPhaseStatus(targetDir);
|
|
44
|
+
setCurrentPhase(status.currentPhase);
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
setCurrentPhase("00");
|
|
48
|
+
}
|
|
49
|
+
}, [projectRoot]);
|
|
50
|
+
// Project switch handler
|
|
51
|
+
const switchProject = useCallback((project) => {
|
|
52
|
+
setActiveProject(project.name);
|
|
53
|
+
setProjectRoot(project.path);
|
|
54
|
+
addLog(`Switched active workspace project to: ${project.name}`, "info");
|
|
55
|
+
refreshPhase(project.path);
|
|
56
|
+
setServer(serverManager.getServer(project.name));
|
|
57
|
+
}, [addLog, refreshPhase]);
|
|
58
|
+
// Periodic poll for server states and logs
|
|
59
|
+
useEffect(() => {
|
|
60
|
+
refreshPhase();
|
|
61
|
+
const interval = setInterval(() => {
|
|
62
|
+
const srv = serverManager.getServer(activeProject);
|
|
63
|
+
setServer(srv);
|
|
64
|
+
setAllRunningServers(serverManager.getRunningServers());
|
|
65
|
+
if (srv && srv.recentLogs.length > 0) {
|
|
66
|
+
const latest = srv.recentLogs[srv.recentLogs.length - 1];
|
|
67
|
+
setLogs((prev) => {
|
|
68
|
+
if (prev.length > 0 && prev[prev.length - 1].text === latest)
|
|
69
|
+
return prev;
|
|
70
|
+
return [
|
|
71
|
+
...prev.slice(-60),
|
|
72
|
+
{
|
|
73
|
+
id: `${Date.now()}-${Math.random()}`,
|
|
74
|
+
timestamp: new Date().toLocaleTimeString(),
|
|
75
|
+
level: "info",
|
|
76
|
+
text: `[srv] ${latest}`,
|
|
77
|
+
},
|
|
78
|
+
];
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}, 1500);
|
|
82
|
+
return () => clearInterval(interval);
|
|
83
|
+
}, [activeProject, refreshPhase]);
|
|
84
|
+
// Toggle server for active project
|
|
85
|
+
const toggleServer = useCallback(async () => {
|
|
86
|
+
if (busyAction)
|
|
87
|
+
return;
|
|
88
|
+
if (server) {
|
|
89
|
+
setBusyAction("Stopping Server");
|
|
90
|
+
addLog(`Stopping dev server for ${activeProject}...`, "warn");
|
|
91
|
+
serverManager.stopServer(activeProject);
|
|
92
|
+
setServer(undefined);
|
|
93
|
+
setAllRunningServers(serverManager.getRunningServers());
|
|
94
|
+
addLog(`Dev server stopped for ${activeProject}`, "info");
|
|
95
|
+
setBusyAction(null);
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
setBusyAction("Starting Server");
|
|
99
|
+
addLog(`Starting dev server for ${activeProject}...`, "info");
|
|
100
|
+
try {
|
|
101
|
+
const newServer = await serverManager.startServer(activeProject, projectRoot);
|
|
102
|
+
setServer(newServer);
|
|
103
|
+
setAllRunningServers(serverManager.getRunningServers());
|
|
104
|
+
addLog(`Dev server online at ${newServer.url} (Port ${newServer.port}, PID ${newServer.process.pid})`, "success");
|
|
105
|
+
}
|
|
106
|
+
catch (err) {
|
|
107
|
+
addLog(`Failed to start dev server: ${err instanceof Error ? err.message : String(err)}`, "error");
|
|
108
|
+
}
|
|
109
|
+
finally {
|
|
110
|
+
setBusyAction(null);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}, [busyAction, server, activeProject, projectRoot, addLog]);
|
|
114
|
+
// Stop all running servers
|
|
115
|
+
const stopAllServers = useCallback(() => {
|
|
116
|
+
addLog("Terminating all active development servers in workspace...", "warn");
|
|
117
|
+
serverManager.stopAll();
|
|
118
|
+
setServer(undefined);
|
|
119
|
+
setAllRunningServers([]);
|
|
120
|
+
addLog("All workspace development servers stopped.", "info");
|
|
121
|
+
}, [addLog]);
|
|
122
|
+
// Verify gate
|
|
123
|
+
const runVerify = useCallback(async () => {
|
|
124
|
+
if (busyAction)
|
|
125
|
+
return;
|
|
126
|
+
setBusyAction("Verifying");
|
|
127
|
+
addLog(`Running deterministic verification on ${activeProject}...`, "info");
|
|
128
|
+
try {
|
|
129
|
+
const pass = await verifyCommand({ cwd: projectRoot });
|
|
130
|
+
if (pass) {
|
|
131
|
+
addLog(`Verification PASSED for ${activeProject}: Clean Biome, TS, Contracts.`, "success");
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
addLog(`Verification FAILED for ${activeProject}: Inspect defects above.`, "error");
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
catch (err) {
|
|
138
|
+
addLog(`Verification error: ${err instanceof Error ? err.message : String(err)}`, "error");
|
|
139
|
+
}
|
|
140
|
+
finally {
|
|
141
|
+
setBusyAction(null);
|
|
142
|
+
}
|
|
143
|
+
}, [busyAction, activeProject, projectRoot, addLog]);
|
|
144
|
+
// Phase advance
|
|
145
|
+
const advancePhase = useCallback(async () => {
|
|
146
|
+
if (busyAction)
|
|
147
|
+
return;
|
|
148
|
+
setBusyAction("Advancing Phase");
|
|
149
|
+
addLog(`Advancing ${activeProject} to next atomic phase...`, "info");
|
|
150
|
+
try {
|
|
151
|
+
await phaseCommand({ action: "next", cwd: projectRoot });
|
|
152
|
+
await refreshPhase();
|
|
153
|
+
addLog("Successfully transitioned to next phase.", "success");
|
|
154
|
+
}
|
|
155
|
+
catch (err) {
|
|
156
|
+
addLog(`Phase change failed: ${err instanceof Error ? err.message : String(err)}`, "error");
|
|
157
|
+
}
|
|
158
|
+
finally {
|
|
159
|
+
setBusyAction(null);
|
|
160
|
+
}
|
|
161
|
+
}, [busyAction, activeProject, projectRoot, refreshPhase, addLog]);
|
|
162
|
+
// Doctor
|
|
163
|
+
const runDoctor = useCallback(async () => {
|
|
164
|
+
if (busyAction)
|
|
165
|
+
return;
|
|
166
|
+
setBusyAction("Diagnosing");
|
|
167
|
+
addLog("Running system environment doctor diagnostics...", "info");
|
|
168
|
+
try {
|
|
169
|
+
await doctorCommand();
|
|
170
|
+
addLog("Doctor diagnostics completed successfully.", "success");
|
|
171
|
+
}
|
|
172
|
+
catch (err) {
|
|
173
|
+
addLog(`Doctor diagnostic error: ${err instanceof Error ? err.message : String(err)}`, "error");
|
|
174
|
+
}
|
|
175
|
+
finally {
|
|
176
|
+
setBusyAction(null);
|
|
177
|
+
}
|
|
178
|
+
}, [busyAction, addLog]);
|
|
179
|
+
// Repomap
|
|
180
|
+
const syncRepomap = useCallback(async () => {
|
|
181
|
+
if (busyAction)
|
|
182
|
+
return;
|
|
183
|
+
setBusyAction("Syncing Repomap");
|
|
184
|
+
addLog(`Synchronizing repomap index for ${activeProject}...`, "info");
|
|
185
|
+
try {
|
|
186
|
+
await repomapCommand({ action: "sync", cwd: projectRoot });
|
|
187
|
+
addLog("Repomap index synchronized with current routes and tokens.", "success");
|
|
188
|
+
}
|
|
189
|
+
catch (err) {
|
|
190
|
+
addLog(`Repomap sync error: ${err instanceof Error ? err.message : String(err)}`, "error");
|
|
191
|
+
}
|
|
192
|
+
finally {
|
|
193
|
+
setBusyAction(null);
|
|
194
|
+
}
|
|
195
|
+
}, [busyAction, activeProject, projectRoot, addLog]);
|
|
196
|
+
// Keyboard navigation
|
|
197
|
+
useInput((input, key) => {
|
|
198
|
+
if (key.escape || input === "q" || input === "Q") {
|
|
199
|
+
onExit?.();
|
|
200
|
+
exit();
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
// Tab jumping
|
|
204
|
+
if (input === "1")
|
|
205
|
+
setCurrentTab("overview");
|
|
206
|
+
else if (input === "2")
|
|
207
|
+
setCurrentTab("servers");
|
|
208
|
+
else if (input === "3")
|
|
209
|
+
setCurrentTab("projects");
|
|
210
|
+
else if (input === "4")
|
|
211
|
+
setCurrentTab("logs");
|
|
212
|
+
else if (key.tab) {
|
|
213
|
+
setCurrentTab((prev) => {
|
|
214
|
+
if (prev === "overview")
|
|
215
|
+
return "servers";
|
|
216
|
+
if (prev === "servers")
|
|
217
|
+
return "projects";
|
|
218
|
+
if (prev === "projects")
|
|
219
|
+
return "logs";
|
|
220
|
+
return "overview";
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
// Action shortcuts
|
|
224
|
+
if (input === "s" || input === "S") {
|
|
225
|
+
toggleServer();
|
|
226
|
+
}
|
|
227
|
+
else if (input === "k" || input === "K") {
|
|
228
|
+
stopAllServers();
|
|
229
|
+
}
|
|
230
|
+
else if (input === "v" || input === "V") {
|
|
231
|
+
runVerify();
|
|
232
|
+
}
|
|
233
|
+
else if (input === "p" || input === "P") {
|
|
234
|
+
advancePhase();
|
|
235
|
+
}
|
|
236
|
+
else if (input === "d" || input === "D") {
|
|
237
|
+
runDoctor();
|
|
238
|
+
}
|
|
239
|
+
else if (input === "r" || input === "R") {
|
|
240
|
+
syncRepomap();
|
|
241
|
+
}
|
|
242
|
+
else if (input === "l" || input === "L") {
|
|
243
|
+
setLogs([]);
|
|
244
|
+
}
|
|
245
|
+
// Projects tab cursor navigation
|
|
246
|
+
if (currentTab === "projects" && projects.length > 0) {
|
|
247
|
+
if (key.upArrow) {
|
|
248
|
+
setSelectedProjectIndex((prev) => (prev > 0 ? prev - 1 : projects.length - 1));
|
|
249
|
+
}
|
|
250
|
+
else if (key.downArrow) {
|
|
251
|
+
setSelectedProjectIndex((prev) => (prev < projects.length - 1 ? prev + 1 : 0));
|
|
252
|
+
}
|
|
253
|
+
else if (input === " ") {
|
|
254
|
+
const chosen = projects[selectedProjectIndex];
|
|
255
|
+
if (chosen) {
|
|
256
|
+
if (chosen.name !== activeProject) {
|
|
257
|
+
switchProject(chosen);
|
|
258
|
+
}
|
|
259
|
+
setCurrentTab("overview");
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
}, { isActive: Boolean(process.stdin.isTTY) });
|
|
264
|
+
const activePhaseNum = Number.parseInt(currentPhase, 10) || 0;
|
|
265
|
+
const progressPercent = Math.round((activePhaseNum / 10) * 100);
|
|
266
|
+
const progressBarWidth = 14;
|
|
267
|
+
const filledBlocks = Math.round((activePhaseNum / 10) * progressBarWidth);
|
|
268
|
+
const emptyBlocks = Math.max(0, progressBarWidth - filledBlocks);
|
|
269
|
+
const progressBar = `[${"█".repeat(filledBlocks)}${"░".repeat(emptyBlocks)}] ${progressPercent}%`;
|
|
270
|
+
return (_jsxs(Box, { flexDirection: "column", width: "100%", children: [_jsxs(Box, { borderStyle: "single", borderColor: "cyan", paddingX: 1, justifyContent: "space-between", children: [_jsxs(Box, { gap: 1, children: [_jsx(Text, { bold: true, color: "cyan", children: "MOZOLE COCKPIT" }), _jsxs(Text, { dimColor: true, children: ["//", " v", CLI_VERSION] })] }), _jsxs(Box, { gap: 1, children: [_jsx(Text, { dimColor: true, children: "ACTIVE PROJECT:" }), _jsx(Text, { bold: true, color: "green", children: activeProject })] }), _jsxs(Box, { gap: 1, children: [_jsx(Text, { dimColor: true, children: "SERVER:" }), server ? (_jsxs(Text, { bold: true, color: "green", children: ["\u25CF RUNNING (", server.url, ")"] })) : (_jsx(Text, { dimColor: true, children: "\u25CB STOPPED" }))] })] }), _jsxs(Box, { borderStyle: "single", borderColor: "gray", paddingX: 1, gap: 2, children: [_jsx(Text, { bold: true, color: currentTab === "overview" ? "cyan" : "gray", children: currentTab === "overview" ? "● [1] OVERVIEW & ROADMAP" : " [1] OVERVIEW & ROADMAP" }), _jsx(Text, { bold: true, color: currentTab === "servers" ? "cyan" : "gray", children: currentTab === "servers"
|
|
271
|
+
? `● [2] DEV SERVERS (${allRunningServers.length} ACTIVE)`
|
|
272
|
+
: ` [2] DEV SERVERS (${allRunningServers.length})` }), _jsx(Text, { bold: true, color: currentTab === "projects" ? "cyan" : "gray", children: currentTab === "projects"
|
|
273
|
+
? `● [3] PROJECTS (${projects.length})`
|
|
274
|
+
: ` [3] PROJECTS (${projects.length})` }), _jsx(Text, { bold: true, color: currentTab === "logs" ? "cyan" : "gray", children: currentTab === "logs" ? "● [4] LIVE LOGS" : " [4] LIVE LOGS" })] }), currentTab === "overview" && (_jsxs(Box, { flexDirection: "column", width: "100%", children: [_jsxs(Box, { flexDirection: "row", width: "100%", children: [_jsxs(Box, { flexDirection: "column", width: "52%", borderStyle: "single", borderColor: "gray", paddingX: 1, children: [_jsxs(Box, { justifyContent: "space-between", marginBottom: 1, children: [_jsx(Text, { bold: true, color: "yellow", children: "ATOMIC ROADMAP & PHASES" }), _jsx(Text, { bold: true, color: "cyan", children: progressBar })] }), PHASES.map((phase) => {
|
|
275
|
+
const pNum = Number.parseInt(phase.id, 10);
|
|
276
|
+
const isDone = pNum < activePhaseNum;
|
|
277
|
+
const isCurrent = phase.id === currentPhase;
|
|
278
|
+
if (isDone) {
|
|
279
|
+
return (_jsxs(Box, { children: [_jsxs(Text, { color: "green", children: [" [\u2713] Phase ", phase.id, ": "] }), _jsx(Text, { dimColor: true, children: phase.name })] }, phase.id));
|
|
280
|
+
}
|
|
281
|
+
if (isCurrent) {
|
|
282
|
+
return (_jsxs(Box, { children: [_jsxs(Text, { bold: true, color: "cyan", children: [" ", "[\u25BA] Phase ", phase.id, ":", " "] }), _jsx(Text, { bold: true, color: "white", children: phase.name }), _jsxs(Text, { bold: true, color: "yellow", children: [" ", "[ACTIVE]"] })] }, phase.id));
|
|
283
|
+
}
|
|
284
|
+
return (_jsx(Box, { children: _jsxs(Text, { dimColor: true, children: [" ", "[ ] Phase ", phase.id, ": ", phase.name] }) }, phase.id));
|
|
285
|
+
})] }), _jsxs(Box, { flexDirection: "column", width: "48%", children: [_jsxs(Box, { flexDirection: "column", borderStyle: "single", borderColor: "gray", paddingX: 1, children: [_jsxs(Box, { justifyContent: "space-between", children: [_jsx(Text, { bold: true, color: "yellow", children: "DEV SERVER" }), server ? (_jsx(Text, { bold: true, color: "green", children: "\u25CF ACTIVE" })) : (_jsx(Text, { dimColor: true, children: "\u25CB INACTIVE" }))] }), _jsxs(Box, { marginTop: 1, children: [_jsx(Text, { dimColor: true, children: "Port: " }), _jsxs(Text, { bold: true, children: [server ? server.port : "5173", " "] }), _jsx(Text, { dimColor: true, children: "PID: " }), _jsx(Text, { bold: true, children: server ? server.process.pid : "None" })] }), _jsxs(Box, { children: [_jsx(Text, { dimColor: true, children: "Target URL: " }), _jsx(Text, { color: server ? "cyan" : "gray", children: server ? server.url : "http://localhost:5173" })] }), _jsxs(Box, { marginTop: 1, children: [_jsx(Text, { dimColor: true, children: "Action: Press " }), _jsx(Text, { bold: true, color: "magenta", children: "[S]" }), _jsxs(Text, { dimColor: true, children: [" to ", server ? "stop" : "start", " server"] })] })] }), _jsxs(Box, { flexDirection: "column", borderStyle: "single", borderColor: "gray", paddingX: 1, children: [_jsx(Text, { bold: true, color: "yellow", children: "SYSTEM RUNTIMES & QUALITY" }), _jsxs(Box, { marginTop: 1, justifyContent: "space-between", children: [_jsx(Text, { dimColor: true, children: "Node.js Runtime" }), _jsxs(Text, { color: "green", children: [process.version, " (PASS)"] })] }), _jsxs(Box, { justifyContent: "space-between", children: [_jsx(Text, { dimColor: true, children: "Biome Code Standards" }), _jsx(Text, { color: "green", children: "Strict & Clean" })] }), _jsxs(Box, { justifyContent: "space-between", children: [_jsx(Text, { dimColor: true, children: "Design Token CSS" }), _jsx(Text, { color: "green", children: "Tailwind v4 @theme" })] }), _jsxs(Box, { justifyContent: "space-between", children: [_jsx(Text, { dimColor: true, children: "DOM Geometry Probe" }), _jsx(Text, { color: "cyan", children: "Zero-Screenshot" })] })] })] })] }), _jsxs(Box, { flexDirection: "column", borderStyle: "single", borderColor: "gray", paddingX: 1, height: 7, children: [_jsxs(Box, { justifyContent: "space-between", children: [_jsx(Text, { bold: true, color: "yellow", children: "ACTIVITY STREAM" }), busyAction ? (_jsxs(Text, { bold: true, color: "magenta", children: ["RUNNING: ", busyAction.toUpperCase(), "..."] })) : (_jsx(Text, { dimColor: true, children: "READY" }))] }), logs.slice(-4).map((log) => (_jsxs(Box, { children: [_jsxs(Text, { dimColor: true, children: ["[", log.timestamp, "] "] }), _jsxs(Text, { bold: true, color: log.level === "error" ? "red" : log.level === "success" ? "green" : "cyan", children: ["[", log.level.toUpperCase(), "]"] }), _jsxs(Text, { color: log.level === "error" ? "red" : undefined, children: [" ", log.text] })] }, log.id)))] })] })), currentTab === "servers" && (_jsxs(Box, { flexDirection: "column", width: "100%", children: [_jsxs(Box, { borderStyle: "single", borderColor: "gray", paddingX: 1, flexDirection: "column", children: [_jsxs(Box, { justifyContent: "space-between", marginBottom: 1, children: [_jsx(Text, { bold: true, color: "yellow", children: "WORKSPACE DEVELOPMENT SERVERS" }), _jsxs(Text, { dimColor: true, children: ["Total Active: ", allRunningServers.length] })] }), allRunningServers.length === 0 ? (_jsxs(Box, { paddingY: 1, children: [_jsx(Text, { dimColor: true, children: "No dev servers currently running in this workspace." }), _jsxs(Text, { children: [" ", "Press", " ", _jsx(Text, { bold: true, color: "cyan", children: "[S]" }), " ", "to start server for", " ", _jsx(Text, { bold: true, color: "green", children: activeProject }), "."] })] })) : (allRunningServers.map((srv) => (_jsxs(Box, { justifyContent: "space-between", children: [_jsxs(Box, { gap: 1, children: [_jsx(Text, { bold: true, color: "green", children: "\u25CF" }), _jsx(Text, { bold: true, children: srv.projectName }), _jsxs(Text, { dimColor: true, children: ["(", srv.url, ")"] })] }), _jsxs(Box, { gap: 2, children: [_jsxs(Text, { dimColor: true, children: ["Port: ", srv.port] }), _jsxs(Text, { dimColor: true, children: ["PID: ", srv.process.pid] }), srv.projectName === activeProject && (_jsx(Text, { bold: true, color: "cyan", children: "[ACTIVE PROJECT]" }))] })] }, srv.id)))), _jsxs(Box, { marginTop: 1, gap: 2, children: [_jsx(Text, { dimColor: true, children: "Shortcuts: " }), _jsxs(Text, { children: [_jsx(Text, { bold: true, color: "magenta", children: "[S]" }), " ", "Toggle Active Server"] }), allRunningServers.length > 0 && (_jsxs(Text, { children: [_jsx(Text, { bold: true, color: "red", children: "[K]" }), " ", "Stop All Servers"] }))] })] }), _jsxs(Box, { borderStyle: "single", borderColor: "gray", paddingX: 1, flexDirection: "column", height: 13, children: [_jsxs(Box, { justifyContent: "space-between", marginBottom: 1, children: [_jsxs(Text, { bold: true, color: "yellow", children: ["DEV SERVER LOG OUTPUT (", activeProject, ")"] }), server ? (_jsxs(Text, { bold: true, color: "green", children: ["\u25CF STREAMING (", server.port, ")"] })) : (_jsx(Text, { dimColor: true, children: "\u25CB SERVER INACTIVE" }))] }), !server || server.recentLogs.length === 0 ? (_jsx(Box, { paddingY: 1, children: _jsxs(Text, { dimColor: true, children: ["No live server logs recorded yet for ", activeProject, "."] }) })) : (server.recentLogs.slice(-10).map((l, i) => (_jsx(Text, { dimColor: !l.includes("error"), children: l }, `${i}-${l}`))))] })] })), currentTab === "projects" && (_jsx(Box, { flexDirection: "column", width: "100%", children: _jsxs(Box, { borderStyle: "single", borderColor: "gray", paddingX: 1, flexDirection: "column", children: [_jsxs(Box, { justifyContent: "space-between", marginBottom: 1, children: [_jsxs(Text, { bold: true, color: "yellow", children: ["WORKSPACE CLIENT PROJECTS (", projects.length, " DETECTED)"] }), _jsx(Text, { dimColor: true, children: "Use [\u2191] / [\u2193] to navigate, [Space] to open project" })] }), projects.length === 0 ? (_jsx(Box, { paddingY: 1, children: _jsxs(Text, { dimColor: true, children: ["No subprojects detected. Operating in standalone repository mode: ", activeProject] }) })) : (projects.map((proj, idx) => {
|
|
286
|
+
const isSelected = idx === selectedProjectIndex;
|
|
287
|
+
const isActive = proj.name === activeProject;
|
|
288
|
+
const isRunning = Boolean(serverManager.getServer(proj.name));
|
|
289
|
+
return (_jsxs(Box, { justifyContent: "space-between", children: [_jsxs(Box, { gap: 1, children: [_jsxs(Text, { bold: true, color: isSelected ? "cyan" : "gray", children: [isSelected ? "▶" : " ", " [", idx + 1, "]"] }), _jsx(Text, { bold: isSelected, color: isActive ? "green" : isSelected ? "white" : "gray", children: proj.name }), isActive && (_jsx(Text, { bold: true, color: "green", children: "[CURRENT]" }))] }), _jsxs(Box, { gap: 2, children: [_jsx(Text, { color: isRunning ? "green" : "gray", children: isRunning ? "● DEV RUNNING" : "○ OFF" }), _jsx(Text, { dimColor: true, children: proj.path })] })] }, proj.name));
|
|
290
|
+
})), _jsx(Box, { marginTop: 1, children: _jsxs(Text, { dimColor: true, children: ["Press", " ", _jsx(Text, { bold: true, color: "cyan", children: "[Space]" }), " ", "to activate selected project and load its roadmap and contracts."] }) })] }) })), currentTab === "logs" && (_jsxs(Box, { borderStyle: "single", borderColor: "gray", paddingX: 1, flexDirection: "column", height: 19, children: [_jsxs(Box, { justifyContent: "space-between", marginBottom: 1, children: [_jsx(Text, { bold: true, color: "yellow", children: "FULL CONSOLE & PROCESS LOG STREAM" }), _jsx(Text, { dimColor: true, children: "Press [L] to clear stream" })] }), logs.slice(-16).map((log) => (_jsxs(Box, { children: [_jsxs(Text, { dimColor: true, children: ["[", log.timestamp, "] "] }), _jsxs(Text, { bold: true, color: log.level === "error" ? "red" : log.level === "success" ? "green" : "cyan", children: ["[", log.level.toUpperCase(), "]"] }), _jsxs(Text, { color: log.level === "error" ? "red" : undefined, children: [" ", log.text] })] }, log.id)))] })), _jsxs(Box, { borderStyle: "single", borderColor: "cyan", paddingX: 1, justifyContent: "space-between", children: [_jsxs(Box, { gap: 1, children: [_jsxs(Text, { children: [_jsx(Text, { bold: true, color: "cyan", children: "[1-4]" }), _jsx(Text, { dimColor: true, children: " Tabs" })] }), _jsxs(Text, { children: [_jsx(Text, { bold: true, color: "cyan", children: "[Tab]" }), _jsx(Text, { dimColor: true, children: " Next Tab" })] }), currentTab === "projects" && (_jsxs(Text, { children: [_jsx(Text, { bold: true, color: "cyan", children: "[Space]" }), _jsx(Text, { dimColor: true, children: " Select" })] })), _jsxs(Text, { children: [_jsx(Text, { bold: true, color: "cyan", children: "[S]" }), _jsx(Text, { dimColor: true, children: " Server" })] }), _jsxs(Text, { children: [_jsx(Text, { bold: true, color: "cyan", children: "[V]" }), _jsx(Text, { dimColor: true, children: " Verify" })] }), _jsxs(Text, { children: [_jsx(Text, { bold: true, color: "cyan", children: "[P]" }), _jsx(Text, { dimColor: true, children: " Phase" })] }), _jsxs(Text, { children: [_jsx(Text, { bold: true, color: "cyan", children: "[D]" }), _jsx(Text, { dimColor: true, children: " Doctor" })] }), _jsxs(Text, { children: [_jsx(Text, { bold: true, color: "cyan", children: "[R]" }), _jsx(Text, { dimColor: true, children: " Repomap" })] }), _jsxs(Text, { children: [_jsx(Text, { bold: true, color: "cyan", children: "[Q]" }), _jsx(Text, { dimColor: true, children: " Quit" })] })] }), _jsx(Box, { children: busyAction ? (_jsxs(Text, { bold: true, color: "magenta", children: ["\u25CF BUSY (", busyAction, ")"] })) : (_jsx(Text, { dimColor: true, children: "READY" })) })] })] }));
|
|
291
|
+
}
|
|
292
|
+
//# sourceMappingURL=CockpitApp.js.map
|