@sixb/cli 0.1.21 → 0.1.22

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.
Files changed (129) hide show
  1. package/README.md +18 -3
  2. package/dist/commands/api.d.ts.map +1 -1
  3. package/dist/commands/app.d.ts.map +1 -1
  4. package/dist/commands/build.d.ts.map +1 -1
  5. package/dist/commands/check.d.ts.map +1 -1
  6. package/dist/commands/db-migrate.d.ts.map +1 -1
  7. package/dist/commands/deploy.d.ts.map +1 -1
  8. package/dist/commands/desktop.d.ts +15 -0
  9. package/dist/commands/desktop.d.ts.map +1 -0
  10. package/dist/commands/dev-runner.d.ts +4 -0
  11. package/dist/commands/dev-runner.d.ts.map +1 -1
  12. package/dist/commands/dev.d.ts.map +1 -1
  13. package/dist/commands/init.d.ts.map +1 -1
  14. package/dist/commands/lake-check.d.ts.map +1 -1
  15. package/dist/commands/lake-cleanup.d.ts.map +1 -1
  16. package/dist/commands/login.d.ts.map +1 -1
  17. package/dist/commands/logout.d.ts.map +1 -1
  18. package/dist/commands/orchestrator.d.ts.map +1 -1
  19. package/dist/commands/profile.d.ts.map +1 -1
  20. package/dist/commands/rules.d.ts.map +1 -1
  21. package/dist/commands/scheduler.d.ts.map +1 -1
  22. package/dist/commands/service-account.d.ts.map +1 -1
  23. package/dist/commands/status.d.ts.map +1 -1
  24. package/dist/commands/token.d.ts.map +1 -1
  25. package/dist/commands/typegen.d.ts.map +1 -1
  26. package/dist/commands/worker-group.d.ts +2 -0
  27. package/dist/commands/worker-group.d.ts.map +1 -1
  28. package/dist/commands/worker.d.ts +2 -0
  29. package/dist/commands/worker.d.ts.map +1 -1
  30. package/dist/lib/command-line.d.ts +22 -2
  31. package/dist/lib/command-line.d.ts.map +1 -1
  32. package/dist/lib/deploy-release.d.ts +3 -1
  33. package/dist/lib/deploy-release.d.ts.map +1 -1
  34. package/dist/lib/desktop.d.ts +26 -0
  35. package/dist/lib/desktop.d.ts.map +1 -0
  36. package/dist/lib/dev-messages.d.ts +43 -0
  37. package/dist/lib/dev-messages.d.ts.map +1 -0
  38. package/dist/lib/dev-supervisor.d.ts +27 -0
  39. package/dist/lib/dev-supervisor.d.ts.map +1 -1
  40. package/dist/lib/open-url.d.ts +3 -0
  41. package/dist/lib/open-url.d.ts.map +1 -0
  42. package/dist/lib/role-lifecycle.d.ts.map +1 -1
  43. package/dist/lib/runtime.d.ts +2 -0
  44. package/dist/lib/runtime.d.ts.map +1 -1
  45. package/dist/lib/worker-concurrency.d.ts +11 -0
  46. package/dist/lib/worker-concurrency.d.ts.map +1 -1
  47. package/dist/lib/worker-registry.d.ts +2 -0
  48. package/dist/lib/worker-registry.d.ts.map +1 -1
  49. package/dist/ui/deploy-screens.d.ts +48 -0
  50. package/dist/ui/deploy-screens.d.ts.map +1 -0
  51. package/dist/ui/index.d.ts +28 -244
  52. package/dist/ui/index.d.ts.map +1 -1
  53. package/dist/ui/layout.d.ts +65 -0
  54. package/dist/ui/layout.d.ts.map +1 -0
  55. package/dist/ui/live/ansi.d.ts +8 -0
  56. package/dist/ui/live/ansi.d.ts.map +1 -0
  57. package/dist/ui/live/can-run-live.d.ts +6 -0
  58. package/dist/ui/live/can-run-live.d.ts.map +1 -0
  59. package/dist/ui/live/components.d.ts +17 -0
  60. package/dist/ui/live/components.d.ts.map +1 -0
  61. package/dist/ui/live/deploy.d.ts +22 -0
  62. package/dist/ui/live/deploy.d.ts.map +1 -0
  63. package/dist/ui/live/dev.d.ts +47 -0
  64. package/dist/ui/live/dev.d.ts.map +1 -0
  65. package/dist/ui/live/prompt.d.ts +30 -0
  66. package/dist/ui/live/prompt.d.ts.map +1 -0
  67. package/dist/ui/live/session.d.ts +27 -0
  68. package/dist/ui/live/session.d.ts.map +1 -0
  69. package/dist/ui/screens.d.ts +136 -0
  70. package/dist/ui/screens.d.ts.map +1 -0
  71. package/dist/ui/theme.d.ts +58 -0
  72. package/dist/ui/theme.d.ts.map +1 -0
  73. package/package.json +19 -18
  74. package/src/commands/{api.tsx → api.ts} +18 -27
  75. package/src/commands/{app.tsx → app.ts} +14 -18
  76. package/src/commands/build.ts +70 -0
  77. package/src/commands/{check.tsx → check.ts} +27 -18
  78. package/src/commands/db-migrate.ts +32 -0
  79. package/src/commands/{deploy.tsx → deploy.ts} +109 -102
  80. package/src/commands/desktop.ts +71 -0
  81. package/src/commands/{dev-runner.tsx → dev-runner.ts} +67 -33
  82. package/src/commands/{init.tsx → init.ts} +19 -8
  83. package/src/commands/lake-check.ts +36 -0
  84. package/src/commands/{lake-cleanup.tsx → lake-cleanup.ts} +17 -12
  85. package/src/commands/{login.tsx → login.ts} +36 -30
  86. package/src/commands/{logout.tsx → logout.ts} +5 -5
  87. package/src/commands/{orchestrator.tsx → orchestrator.ts} +15 -28
  88. package/src/commands/{profile.tsx → profile.ts} +38 -19
  89. package/src/commands/{rules.tsx → rules.ts} +15 -24
  90. package/src/commands/{scheduler.tsx → scheduler.ts} +14 -27
  91. package/src/commands/{service-account.tsx → service-account.ts} +37 -39
  92. package/src/commands/{status.tsx → status.ts} +8 -8
  93. package/src/commands/{token.tsx → token.ts} +19 -20
  94. package/src/commands/typegen.ts +18 -0
  95. package/src/commands/{worker-group.tsx → worker-group.ts} +40 -29
  96. package/src/commands/{worker.tsx → worker.ts} +30 -22
  97. package/src/index.tsx +22 -1
  98. package/src/lib/command-line.ts +108 -57
  99. package/src/lib/deploy-release.ts +17 -1
  100. package/src/lib/desktop.ts +52 -0
  101. package/src/lib/dev-messages.ts +44 -0
  102. package/src/lib/dev-supervisor.ts +132 -12
  103. package/src/lib/open-url.ts +15 -0
  104. package/src/lib/role-lifecycle.ts +2 -3
  105. package/src/lib/runtime.ts +4 -0
  106. package/src/lib/worker-concurrency.ts +31 -0
  107. package/src/lib/worker-registry.ts +4 -0
  108. package/src/ui/README.md +54 -0
  109. package/src/ui/deploy-screens.ts +360 -0
  110. package/src/ui/index.ts +158 -0
  111. package/src/ui/layout.ts +245 -0
  112. package/src/ui/live/ansi.ts +103 -0
  113. package/src/ui/live/can-run-live.ts +9 -0
  114. package/src/ui/live/components.tsx +81 -0
  115. package/src/ui/live/deploy.tsx +170 -0
  116. package/src/ui/live/dev.tsx +522 -0
  117. package/src/ui/live/prompt.tsx +205 -0
  118. package/src/ui/live/session.ts +103 -0
  119. package/src/ui/screens.ts +490 -0
  120. package/src/ui/theme.ts +122 -0
  121. package/dist/lib/role-view.d.ts +0 -21
  122. package/dist/lib/role-view.d.ts.map +0 -1
  123. package/src/commands/build.tsx +0 -65
  124. package/src/commands/db-migrate.tsx +0 -30
  125. package/src/commands/lake-check.tsx +0 -33
  126. package/src/commands/typegen.tsx +0 -18
  127. package/src/lib/role-view.ts +0 -49
  128. package/src/ui/index.tsx +0 -1398
  129. /package/src/commands/{dev.tsx → dev.ts} +0 -0
@@ -0,0 +1,136 @@
1
+ import { type CliHelp } from "../lib/command-line";
2
+ export type KeyValueItem = {
3
+ label: string;
4
+ value: string;
5
+ };
6
+ export declare function versionView(version: string): string;
7
+ export declare function helpView({ errorMessage }?: {
8
+ errorMessage?: string;
9
+ }): string;
10
+ export declare function commandHelpView({ help, errorMessage, }: {
11
+ help: CliHelp;
12
+ errorMessage?: string;
13
+ }): string;
14
+ export declare function errorView({ title, message, remediation, details, }: {
15
+ title?: string;
16
+ message: string;
17
+ /** What to do next. Rendered apart from the diagnosis, not appended to it. */
18
+ remediation?: string;
19
+ details?: readonly string[];
20
+ }): string;
21
+ export declare function keyValueResultView({ title, subtitle, items, titleColor, message, }: {
22
+ title: string;
23
+ subtitle?: string;
24
+ items: readonly KeyValueItem[];
25
+ titleColor?: "green" | "yellow" | "red";
26
+ message?: string;
27
+ }): string;
28
+ /** A list. The header names the command, which already says what the list is. */
29
+ export declare function tableResultView({ subtitle, headers, rows: cells, emptyMessage, }: {
30
+ subtitle?: string;
31
+ headers: readonly string[];
32
+ rows: readonly (readonly string[])[];
33
+ emptyMessage: string;
34
+ }): string;
35
+ export declare function secretResultView({ title, subtitle, items, secretLabel, secret, message, }: {
36
+ title: string;
37
+ subtitle?: string;
38
+ items: readonly KeyValueItem[];
39
+ secretLabel?: string;
40
+ secret: string;
41
+ message?: string;
42
+ }): string;
43
+ /**
44
+ * A long-running role, once started: what it serves, then the hint to stop it. Its logs follow
45
+ * underneath.
46
+ */
47
+ export declare function roleView({ command, name, items, storage, warnings, }: {
48
+ /** The command that started it, such as `api` or `worker-group`. */
49
+ command: string;
50
+ name: string;
51
+ items: readonly KeyValueItem[];
52
+ storage?: string | null;
53
+ warnings?: readonly string[];
54
+ }): string;
55
+ export declare function workerItems(workers: readonly {
56
+ readonly type: string;
57
+ readonly concurrency: number;
58
+ }[]): KeyValueItem[];
59
+ export declare function devView({ name, apiUrl, apiDocsUrl, wsUrl, appUrl, workers, warnings, }: {
60
+ name: string;
61
+ apiUrl: string;
62
+ apiDocsUrl: string;
63
+ wsUrl: string;
64
+ /** `null` when the app could not start; a warning says why. */
65
+ appUrl: string | null;
66
+ workers?: readonly {
67
+ readonly type: string;
68
+ readonly concurrency: number;
69
+ }[];
70
+ warnings?: readonly string[];
71
+ }): string;
72
+ interface Probe {
73
+ ok: boolean;
74
+ warning?: boolean;
75
+ message?: string;
76
+ }
77
+ export declare function checkView({ projectId, storage, timeseries, broker, queues, projectValidation, markings, ontology, warnings, }: {
78
+ projectId: string;
79
+ storage: Probe;
80
+ timeseries: Probe;
81
+ broker: Probe;
82
+ queues: Probe;
83
+ projectValidation?: Probe;
84
+ /**
85
+ * The pipeline markings preflight: what SQL steps derive, checked against projections. A warning
86
+ * reports projections whose applied version adds markings the code no longer declares.
87
+ */
88
+ markings?: Probe;
89
+ ontology?: {
90
+ enabled: boolean;
91
+ source: string;
92
+ errors: number;
93
+ warnings: number;
94
+ };
95
+ warnings: readonly string[];
96
+ }): string;
97
+ export declare function buildView({ outdir, seconds }: {
98
+ outdir: string;
99
+ seconds?: number;
100
+ }): string;
101
+ export declare function typegenView({ path, objectTypes, skipped, written, }: {
102
+ path: string;
103
+ objectTypes: number;
104
+ skipped: boolean;
105
+ written: boolean;
106
+ }): string;
107
+ export declare function dbMigrateView({ projectId, status, applied, }: {
108
+ projectId: string;
109
+ status: "migrated" | "current" | "skipped";
110
+ /** Migration step ids this run applied, named so the output can be checked. */
111
+ applied?: readonly string[];
112
+ }): string;
113
+ export declare function lakeCheckView({ projectId, warnings, }: {
114
+ projectId: string;
115
+ warnings?: readonly string[];
116
+ }): string;
117
+ export interface LakeCleanupReport {
118
+ readonly dryRun: boolean;
119
+ readonly expireOlderThan: string;
120
+ readonly deleteOlderThan: string;
121
+ readonly snapshots: number;
122
+ readonly keptSnapshots?: number;
123
+ readonly oldFiles: number;
124
+ readonly orphanedFiles: number;
125
+ }
126
+ export declare function lakeCleanupView({ projectId, report, }: {
127
+ projectId: string;
128
+ report: LakeCleanupReport;
129
+ }): string;
130
+ export declare function initView({ name, files, commands: next, }: {
131
+ name: string;
132
+ files: readonly string[];
133
+ commands: readonly string[];
134
+ }): string;
135
+ export {};
136
+ //# sourceMappingURL=screens.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"screens.d.ts","sourceRoot":"","sources":["../../src/ui/screens.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,OAAO,EAIb,MAAM,qBAAqB,CAAA;AAyB5B,MAAM,MAAM,YAAY,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAA;AAwC3D,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED,wBAAgB,QAAQ,CAAC,EAAE,YAAY,EAAE,GAAE;IAAE,YAAY,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,MAAM,CAwBjF;AAED,wBAAgB,eAAe,CAAC,EAC9B,IAAI,EACJ,YAAY,GACb,EAAE;IACD,IAAI,EAAE,OAAO,CAAA;IACb,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,GAAG,MAAM,CAQT;AAID,wBAAgB,SAAS,CA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Q,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAC7B,GAAG,MAAM,CAET;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;IACxB,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAA;IAChC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAA;IAChC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAA;IAC/B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;CAC/B;AAED,wBAAgB,eAAe,CAAC,EAC9B,SAAS,EACT,MAAM,GACP,EAAE;IACD,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,iBAAiB,CAAA;CAC1B,GAAG,MAAM,CAmBT;AAED,wBAAgB,QAAQ,CAAC,EACvB,IAAI,EACJ,KAAK,EACL,QAAQ,EAAE,IAAI,GACf,EAAE;IACD,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,SAAS,MAAM,EAAE,CAAA;IACxB,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAA;CAC5B,GAAG,MAAM,CAKT"}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * The CLI's look, shared by the printed screens and the live ones.
3
+ *
4
+ * Sixb's colors: ink and paper, one blue for a live signal, and the "water" blues the mosaic fills
5
+ * with, palest first. Body text keeps the terminal's own foreground, so every screen reads on a
6
+ * dark or a light terminal; color marks status, never content.
7
+ */
8
+ export declare const palette: {
9
+ readonly blue: "#0a84ff";
10
+ readonly water: readonly ["#a6cbfb", "#6fb0fc", "#3d95fd", "#0a84ff"];
11
+ readonly green: "#30d158";
12
+ readonly amber: "#ff9f0a";
13
+ readonly red: "#ff453a";
14
+ readonly muted: "#8b919a";
15
+ readonly faint: "#666b74";
16
+ };
17
+ export declare const glyph: {
18
+ /** The brand mark: the logo's slab, as one cell. A tile when it counts progress. */
19
+ readonly mark: "▰";
20
+ readonly tile: "▱";
21
+ readonly ok: "✓";
22
+ readonly fail: "✕";
23
+ readonly warn: "▲";
24
+ readonly live: "●";
25
+ readonly idle: "○";
26
+ readonly dot: "·";
27
+ readonly arrow: "→";
28
+ readonly prompt: "›";
29
+ readonly restart: "↻";
30
+ readonly rule: "│";
31
+ };
32
+ export declare const SPINNER_FRAMES: readonly ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"];
33
+ type ColorLevel = 0 | 1 | 2 | 3;
34
+ /**
35
+ * How much color the terminal takes: none, the 16 named colors, the 256-color cube, or 24-bit.
36
+ * `NO_COLOR` and `FORCE_COLOR` win; a pipe or a dumb terminal gets none.
37
+ */
38
+ export declare function colorLevel(stream?: {
39
+ readonly isTTY?: boolean;
40
+ }): ColorLevel;
41
+ export interface Paint {
42
+ readonly color?: string;
43
+ readonly bold?: boolean;
44
+ }
45
+ /** Styles text for this terminal; the text comes back unchanged where color is off. */
46
+ export declare function paint(text: string, style: Paint, level?: ColorLevel): string;
47
+ export declare const tone: {
48
+ readonly strong: (text: string) => string;
49
+ readonly muted: (text: string) => string;
50
+ readonly faint: (text: string) => string;
51
+ readonly blue: (text: string) => string;
52
+ readonly ok: (text: string) => string;
53
+ readonly warn: (text: string) => string;
54
+ readonly fail: (text: string) => string;
55
+ readonly url: (text: string) => string;
56
+ };
57
+ export {};
58
+ //# sourceMappingURL=theme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/ui/theme.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,OAAO;;;;;;;;CAQV,CAAA;AAEV,eAAO,MAAM,KAAK;IAChB,oFAAoF;;;;;;;;;;;;;CAa5E,CAAA;AAEV,eAAO,MAAM,cAAc,6DAA8D,CAAA;AAEzF,KAAK,UAAU,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;AAE/B;;;GAGG;AACH,wBAAgB,UAAU,CAAC,MAAM,GAAE;IAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAmB,GAAG,UAAU,CAS5F;AAsCD,MAAM,WAAW,KAAK;IACpB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CACxB;AAED,uFAAuF;AACvF,wBAAgB,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,GAAE,UAAyB,GAAG,MAAM,CAM1F;AAED,eAAO,MAAM,IAAI;4BACA,MAAM;2BACP,MAAM;2BACN,MAAM;0BACP,MAAM;wBACR,MAAM;0BACJ,MAAM;0BACN,MAAM;yBACP,MAAM;CACV,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sixb/cli",
3
- "version": "0.1.21",
3
+ "version": "0.1.22",
4
4
  "description": "Command-line interface for Sixb projects",
5
5
  "keywords": [
6
6
  "sixb",
@@ -29,25 +29,26 @@
29
29
  "prepack": "bun run build"
30
30
  },
31
31
  "dependencies": {
32
- "@sixb/agent-worker": "0.1.21",
33
- "@sixb/app": "^0.1.13",
34
- "@sixb/client": "^0.1.21",
35
- "@sixb/core": "0.1.21",
36
- "@sixb/cli-core": "^0.1.8",
37
- "@sixb/orchestrator": "0.1.21",
38
- "@sixb/pipeline-worker": "0.1.21",
39
- "@sixb/projection-worker": "0.1.21",
40
- "@sixb/rules-worker": "0.1.21",
41
- "@sixb/server": "0.1.21",
42
- "@sixb/sync-worker": "0.1.21",
43
- "@sixb/workflow-worker": "0.1.21",
44
- "create-sixb": "^0.1.5",
45
- "ink": "^6.0.0",
46
- "react": "^19.0.0",
47
- "react-devtools-core": "^4.19.1"
32
+ "@opentui/core": "0.6.6",
33
+ "@opentui/react": "0.6.6",
34
+ "@sixb/agent-worker": "0.1.22",
35
+ "@sixb/app": "^0.1.14",
36
+ "@sixb/client": "^0.1.22",
37
+ "@sixb/core": "0.1.22",
38
+ "@sixb/cli-core": "^0.1.9",
39
+ "@sixb/orchestrator": "0.1.22",
40
+ "@sixb/pipeline-worker": "0.1.22",
41
+ "@sixb/projection-worker": "0.1.22",
42
+ "@sixb/rules-worker": "0.1.22",
43
+ "@sixb/server": "0.1.22",
44
+ "@sixb/sync-worker": "0.1.22",
45
+ "@sixb/workflow-worker": "0.1.22",
46
+ "create-sixb": "^0.1.6",
47
+ "react": "^19.2.0"
48
48
  },
49
49
  "devDependencies": {
50
- "@sixb/deploy-ssh": "0.1.2",
50
+ "@sixb/deploy-ssh": "0.1.3",
51
+ "@sixb/desktop": "0.1.0",
51
52
  "@sixb/ducklake": "0.1.9",
52
53
  "@types/bun": "latest",
53
54
  "@types/react": "^19.0.0",
@@ -7,7 +7,7 @@ import { builtAppOutdir, loadProductionSixb } from "../lib/production"
7
7
  import { runUntilSignal, stopQuietly } from "../lib/role-lifecycle"
8
8
  import { stopSixbProviders } from "../lib/runtime"
9
9
  import { migrateStorageForRole } from "../lib/storage-migration"
10
- import { LoadingView, RoleView, renderCliError, renderPersistent } from "../ui"
10
+ import { printStopping, renderCliError, renderStatic, roleView, startTask } from "../ui"
11
11
 
12
12
  export interface ApiOptions {
13
13
  entry?: string
@@ -25,9 +25,7 @@ export async function runApi(options: ApiOptions = {}) {
25
25
  process.env.NODE_ENV = "production"
26
26
 
27
27
  const loaded = await loadProductionSixb({ entry: options.entry, role: "api" })
28
- const app = renderPersistent(
29
- <LoadingView title="Starting sixb api" subtitle={loaded.entry} status="Preparing runtime" />
30
- )
28
+ const app = startTask("api", "Preparing runtime")
31
29
 
32
30
  let sixb: LoadedSixbHost | null = loaded.sixb
33
31
  let server: SixbServer | null = null
@@ -39,14 +37,7 @@ export async function runApi(options: ApiOptions = {}) {
39
37
  const migration = await migrateStorageForRole(sixb, {
40
38
  role: "api",
41
39
  noMigrate: options.noMigrate,
42
- onStart: () =>
43
- app.rerender(
44
- <LoadingView
45
- title="Starting sixb api"
46
- subtitle={loaded.entry}
47
- status="Migrating storage"
48
- />
49
- ),
40
+ onStart: () => app.step("Migrating storage"),
50
41
  })
51
42
 
52
43
  const appOutdir = builtAppOutdir(loaded.buildOutdir)
@@ -82,23 +73,23 @@ export async function runApi(options: ApiOptions = {}) {
82
73
  })
83
74
  await server.start()
84
75
 
85
- app.rerender(
86
- <RoleView
87
- title="Sixb API started"
88
- name={sixb.id}
89
- serviceName="API"
90
- items={[
91
- { label: "API", value: apiUrl(topology) },
92
- { label: "API docs", value: apiDocsUrl(topology) },
93
- { label: "Events", value: apiEventsUrl(topology) },
94
- ]}
95
- storage={migration.summary}
96
- />
76
+ app.stop()
77
+ await renderStatic(
78
+ roleView({
79
+ command: "api",
80
+ name: sixb.id,
81
+ items: [
82
+ { label: "api", value: apiUrl(topology) },
83
+ { label: "docs", value: apiDocsUrl(topology) },
84
+ { label: "events", value: apiEventsUrl(topology) },
85
+ ],
86
+ storage: migration.summary,
87
+ })
97
88
  )
98
89
 
99
90
  await runUntilSignal(async () => {
100
- app.unmount()
101
- console.log("\nShutting down api...")
91
+ app.stop()
92
+ printStopping("api")
102
93
  await stopQuietly(() => server?.stop() ?? Promise.resolve())
103
94
  if (sixb) {
104
95
  await stopSixbProviders(sixb)
@@ -106,7 +97,7 @@ export async function runApi(options: ApiOptions = {}) {
106
97
  sixb = null
107
98
  })
108
99
  } catch (error) {
109
- app.unmount()
100
+ app.stop()
110
101
  await stopQuietly(() => server?.stop() ?? Promise.resolve())
111
102
  if (sixb) {
112
103
  await stopSixbProviders(sixb)
@@ -8,7 +8,7 @@ import {
8
8
  resolveRuntimeEntry,
9
9
  } from "../lib/production"
10
10
  import { runUntilSignal, stopQuietly } from "../lib/role-lifecycle"
11
- import { loadRoleView } from "../lib/role-view"
11
+ import { printStopping, renderCliError, renderStatic, roleView, startTask } from "../ui"
12
12
 
13
13
  export interface AppOptions {
14
14
  entry?: string
@@ -19,17 +19,11 @@ export interface AppOptions {
19
19
  }
20
20
 
21
21
  export async function runApp(options: AppOptions = {}) {
22
- // Before NODE_ENV changes: see loadRoleView.
23
- const view = await loadRoleView()
24
22
  process.env.NODE_ENV = "production"
25
23
 
26
24
  const entry = await resolveRuntimeEntry({ entry: options.entry })
27
25
  const { projectRoot, buildOutdir } = await resolveProductionPaths(entry)
28
- const app = view.startup({
29
- title: "Starting sixb app",
30
- subtitle: entry,
31
- status: "Starting app",
32
- })
26
+ const app = startTask("app", "Starting app")
33
27
 
34
28
  let customAppServer: CustomAppServer | null = null
35
29
 
@@ -62,22 +56,24 @@ export async function runApp(options: AppOptions = {}) {
62
56
  apiBaseUrl: topology.apiPublicOrigin,
63
57
  })
64
58
 
65
- app.started({
66
- title: "Sixb app started",
67
- name: basename(projectRoot),
68
- serviceName: "App",
69
- items: [{ label: "URL", value: servedUrl(topology) }],
70
- })
59
+ app.stop()
60
+ await renderStatic(
61
+ roleView({
62
+ command: "app",
63
+ name: basename(projectRoot),
64
+ items: [{ label: "app", value: servedUrl(topology) }],
65
+ })
66
+ )
71
67
 
72
68
  await runUntilSignal(async () => {
73
- app.unmount()
74
- console.log("\nShutting down app...")
69
+ app.stop()
70
+ printStopping("app")
75
71
  await stopQuietly(() => customAppServer?.stop() ?? Promise.resolve())
76
72
  })
77
73
  } catch (error) {
78
- app.unmount()
74
+ app.stop()
79
75
  await stopQuietly(() => customAppServer?.stop() ?? Promise.resolve())
80
- await view.error(error)
76
+ await renderCliError(error)
81
77
  process.exit(1)
82
78
  }
83
79
  }
@@ -0,0 +1,70 @@
1
+ import { mkdir } from "node:fs/promises"
2
+ import { dirname, join, resolve } from "node:path"
3
+ import { createCustomApp } from "@sixb/app/server"
4
+ import { buildRuntime } from "../lib/build-runtime"
5
+ import { generateProjectTypes } from "../lib/typegen"
6
+ import { buildView, errorView, renderStatic, withTask } from "../ui"
7
+
8
+ export interface BuildOptions {
9
+ entry?: string
10
+ outdir?: string
11
+ }
12
+
13
+ export async function runBuild(options: BuildOptions = {}) {
14
+ const entry = resolve(options.entry ?? "sixb.config.ts")
15
+ const outdir = resolve(options.outdir ?? ".sixb/dist")
16
+ const projectRoot = dirname(entry)
17
+ const startedAt = Date.now()
18
+
19
+ const failure = await withTask("build", "Generating types", async (task) => {
20
+ await generateProjectTypes({ entry })
21
+ await mkdir(outdir, { recursive: true })
22
+
23
+ task.step("Bundling runtime")
24
+ const result = await buildRuntime(entry, outdir)
25
+ if (!result.success) {
26
+ return errorView({
27
+ title: "Build failed",
28
+ message: "Compilation errors",
29
+ details: result.logs.map(String),
30
+ })
31
+ }
32
+
33
+ task.step("Building app")
34
+ const customApp = await createCustomApp({
35
+ rootDir: projectRoot,
36
+ // Keep production build inputs separate from the files watched by `sixb dev`.
37
+ // Sharing `.sixb/generated` lets this command replace the dev app's injected
38
+ // API origin and HTML bundle, causing Bun to hot-reload a same-origin client.
39
+ generatedDir: join(".sixb", "build", "app"),
40
+ })
41
+
42
+ try {
43
+ const appResult = await customApp.build({
44
+ outdir: resolve(outdir, "app"),
45
+ })
46
+ if (!appResult.success) {
47
+ return errorView({
48
+ title: "App build failed",
49
+ message: "Failed to build the app",
50
+ details: appResult.logs ?? [],
51
+ })
52
+ }
53
+ } catch (error) {
54
+ // e.g. the app/globals.css Tailwind compile failed — surface the labeled
55
+ // message instead of an unhandled stack trace.
56
+ return errorView({
57
+ title: "App build failed",
58
+ message: "Failed to build the app",
59
+ details: [error instanceof Error ? error.message : String(error)],
60
+ })
61
+ }
62
+ return null
63
+ })
64
+
65
+ if (failure) {
66
+ await renderStatic(failure)
67
+ process.exit(1)
68
+ }
69
+ await renderStatic(buildView({ outdir, seconds: (Date.now() - startedAt) / 1000 }))
70
+ }
@@ -8,7 +8,7 @@ import {
8
8
  stopSixbProviders,
9
9
  } from "../lib/runtime"
10
10
  import { generateProjectTypes } from "../lib/typegen"
11
- import { CheckView, renderStatic } from "../ui"
11
+ import { checkView, renderStatic, withTask } from "../ui"
12
12
 
13
13
  export interface CheckOptions {
14
14
  entry?: string
@@ -16,38 +16,47 @@ export interface CheckOptions {
16
16
 
17
17
  export async function runCheck(options: CheckOptions = {}) {
18
18
  const entry = resolve(options.entry ?? "sixb.config.ts")
19
- await generateProjectTypes({ entry })
20
- const sixb = await loadSixbFromEntry(entry)
19
+ const sixb = await withTask("check", "Generating types", async (task) => {
20
+ await generateProjectTypes({ entry })
21
+ task.step("Loading project")
22
+ return loadSixbFromEntry(entry)
23
+ })
21
24
 
22
25
  try {
23
26
  const objectTypes = sixb.definitions.ontology.listObjectTypes()
24
- const health = await checkRuntimeHealth(sixb)
25
- const markings = await checkMarkings(sixb, health.storage.ok)
27
+ const { health, markings } = await withTask("check", "Probing providers", async (task) => {
28
+ const health = await checkRuntimeHealth(sixb)
29
+ task.step("Checking markings")
30
+ return { health, markings: await checkMarkings(sixb, health.storage.ok) }
31
+ })
26
32
 
27
33
  const projectValidation =
28
34
  objectTypes.length > 0
29
- ? { ok: true, message: `${objectTypes.length} object type(s)` }
35
+ ? {
36
+ ok: true,
37
+ message: `${objectTypes.length} object type${objectTypes.length === 1 ? "" : "s"}`,
38
+ }
30
39
  : { ok: false, message: "No object types loaded" }
31
40
 
32
41
  await renderStatic(
33
- <CheckView
34
- projectId={sixb.id}
35
- storage={health.storage}
36
- timeseries={health.timeseries}
37
- broker={health.broker}
38
- queues={health.queues}
39
- projectValidation={projectValidation}
40
- markings={markings}
41
- ontology={{
42
+ checkView({
43
+ projectId: sixb.id,
44
+ storage: health.storage,
45
+ timeseries: health.timeseries,
46
+ broker: health.broker,
47
+ queues: health.queues,
48
+ projectValidation,
49
+ markings,
50
+ ontology: {
42
51
  enabled: true,
43
52
  source: entry,
44
53
  errors: objectTypes.length > 0 ? 0 : 1,
45
54
  // Ontology warnings, which nothing produces yet. The provider warnings below
46
55
  // are a different thing and counting them here read as ontology drift.
47
56
  warnings: 0,
48
- }}
49
- warnings={[...health.warnings, ...markings.warnings]}
50
- />
57
+ },
58
+ warnings: [...health.warnings, ...markings.warnings],
59
+ })
51
60
  )
52
61
 
53
62
  // A failing probe exits non-zero so `sixb check` can gate a deploy. `exitCode`, not
@@ -0,0 +1,32 @@
1
+ import { migrateStorage } from "@sixb/core"
2
+ import { loadSixbFromEntry } from "../lib/loadSixb"
3
+ import { resolveRuntimeEntry } from "../lib/production"
4
+ import { stopSixbProviders } from "../lib/runtime"
5
+ import { dbMigrateView, renderStatic, withTask } from "../ui"
6
+
7
+ export interface DbMigrateOptions {
8
+ entry?: string
9
+ }
10
+
11
+ export async function runDbMigrate(options: DbMigrateOptions = {}) {
12
+ const entry = await resolveRuntimeEntry({ entry: options.entry })
13
+ const sixb = await withTask("db migrate", "Loading project", () => loadSixbFromEntry(entry))
14
+
15
+ try {
16
+ const result = await withTask("db migrate", "Migrating storage", () =>
17
+ migrateStorage(sixb.storage, {
18
+ projectId: sixb.id,
19
+ ontology: sixb.definitions.ontology,
20
+ })
21
+ )
22
+ await renderStatic(
23
+ dbMigrateView({
24
+ projectId: sixb.id,
25
+ status: result.status,
26
+ applied: result.reports.flatMap((report) => report.applied),
27
+ })
28
+ )
29
+ } finally {
30
+ await stopSixbProviders(sixb)
31
+ }
32
+ }