@sixb/cli 0.1.19 → 0.1.21
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 +26 -27
- package/dist/commands/api.d.ts +0 -1
- package/dist/commands/api.d.ts.map +1 -1
- package/dist/commands/app.d.ts.map +1 -1
- package/dist/commands/build.d.ts.map +1 -1
- package/dist/commands/check.d.ts.map +1 -1
- package/dist/commands/dev-runner.d.ts +12 -1
- package/dist/commands/dev-runner.d.ts.map +1 -1
- package/dist/commands/lake-check.d.ts.map +1 -1
- package/dist/commands/lake-cleanup.d.ts +2 -0
- package/dist/commands/lake-cleanup.d.ts.map +1 -1
- package/dist/commands/worker-group.d.ts +1 -0
- package/dist/commands/worker-group.d.ts.map +1 -1
- package/dist/commands/worker.d.ts +1 -0
- package/dist/commands/worker.d.ts.map +1 -1
- package/dist/lib/browser-topology.d.ts +9 -33
- package/dist/lib/browser-topology.d.ts.map +1 -1
- package/dist/lib/command-line.d.ts +8 -8
- package/dist/lib/command-line.d.ts.map +1 -1
- package/dist/lib/deploy-release.d.ts.map +1 -1
- package/dist/lib/dev-supervisor.d.ts.map +1 -1
- package/dist/lib/dev-watch.d.ts +1 -1
- package/dist/lib/dev-watch.d.ts.map +1 -1
- package/dist/lib/production-roles.d.ts +5 -10
- package/dist/lib/production-roles.d.ts.map +1 -1
- package/dist/lib/production.d.ts +1 -2
- package/dist/lib/production.d.ts.map +1 -1
- package/dist/lib/role-view.d.ts +2 -3
- package/dist/lib/role-view.d.ts.map +1 -1
- package/dist/lib/runtime.d.ts +9 -0
- package/dist/lib/runtime.d.ts.map +1 -1
- package/dist/lib/worker-concurrency.d.ts +5 -0
- package/dist/lib/worker-concurrency.d.ts.map +1 -1
- package/dist/lib/worker-registry.d.ts +1 -0
- package/dist/lib/worker-registry.d.ts.map +1 -1
- package/dist/ui/index.d.ts +16 -5
- package/dist/ui/index.d.ts.map +1 -1
- package/package.json +16 -16
- package/src/commands/api.tsx +1 -5
- package/src/commands/app.tsx +5 -7
- package/src/commands/build.tsx +14 -31
- package/src/commands/check.tsx +50 -4
- package/src/commands/dev-runner.tsx +43 -47
- package/src/commands/lake-check.tsx +15 -2
- package/src/commands/lake-cleanup.tsx +11 -0
- package/src/commands/worker-group.tsx +4 -1
- package/src/commands/worker.tsx +4 -1
- package/src/index.tsx +3 -14
- package/src/lib/browser-topology.ts +28 -135
- package/src/lib/command-line.ts +26 -18
- package/src/lib/deploy-release.ts +0 -3
- package/src/lib/dev-supervisor.ts +7 -6
- package/src/lib/dev-watch.ts +8 -8
- package/src/lib/production-roles.ts +5 -7
- package/src/lib/production.ts +3 -8
- package/src/lib/profiles.ts +1 -1
- package/src/lib/role-lifecycle.ts +2 -2
- package/src/lib/role-view.ts +2 -3
- package/src/lib/runtime.ts +19 -0
- package/src/lib/worker-concurrency.ts +11 -0
- package/src/lib/worker-registry.ts +5 -1
- package/src/ui/index.tsx +46 -19
- package/dist/commands/atlas.d.ts +0 -9
- package/dist/commands/atlas.d.ts.map +0 -1
- package/src/commands/atlas.tsx +0 -71
package/dist/ui/index.d.ts
CHANGED
|
@@ -77,13 +77,13 @@ export declare function ErrorView({ title, message, remediation, details, }: {
|
|
|
77
77
|
remediation?: string;
|
|
78
78
|
details?: readonly string[];
|
|
79
79
|
}): React.JSX.Element;
|
|
80
|
-
export declare function DevView({ name, apiUrl, apiDocsUrl, wsUrl,
|
|
80
|
+
export declare function DevView({ name, apiUrl, apiDocsUrl, wsUrl, appUrl, workers, warnings, }: {
|
|
81
81
|
name: string;
|
|
82
82
|
apiUrl: string;
|
|
83
83
|
apiDocsUrl: string;
|
|
84
84
|
wsUrl: string;
|
|
85
|
-
|
|
86
|
-
appUrl
|
|
85
|
+
/** `null` when the app could not start; a warning says why. */
|
|
86
|
+
appUrl: string | null;
|
|
87
87
|
workers?: readonly {
|
|
88
88
|
readonly type: string;
|
|
89
89
|
readonly concurrency: number;
|
|
@@ -114,7 +114,7 @@ export declare function RoleView({ title, name, serviceName, items, storage, war
|
|
|
114
114
|
storage?: string | null;
|
|
115
115
|
warnings?: readonly string[];
|
|
116
116
|
}): React.JSX.Element;
|
|
117
|
-
export declare function CheckView({ projectId, storage, timeseries, broker, queues, projectValidation, ontology, warnings, }: {
|
|
117
|
+
export declare function CheckView({ projectId, storage, timeseries, broker, queues, projectValidation, markings, ontology, warnings, }: {
|
|
118
118
|
projectId: string;
|
|
119
119
|
storage: {
|
|
120
120
|
ok: boolean;
|
|
@@ -136,6 +136,15 @@ export declare function CheckView({ projectId, storage, timeseries, broker, queu
|
|
|
136
136
|
ok: boolean;
|
|
137
137
|
message?: string;
|
|
138
138
|
};
|
|
139
|
+
/**
|
|
140
|
+
* The pipeline markings preflight: what SQL steps derive, checked against projections. A warning
|
|
141
|
+
* reports projections whose applied version adds markings the code no longer declares.
|
|
142
|
+
*/
|
|
143
|
+
markings?: {
|
|
144
|
+
ok: boolean;
|
|
145
|
+
warning?: boolean;
|
|
146
|
+
message?: string;
|
|
147
|
+
};
|
|
139
148
|
ontology?: {
|
|
140
149
|
enabled: boolean;
|
|
141
150
|
source: string;
|
|
@@ -160,9 +169,10 @@ export declare function DbMigrateView({ projectId, status, applied, }: {
|
|
|
160
169
|
/** Migration step ids this run applied, named so the output can be checked. */
|
|
161
170
|
applied?: readonly string[];
|
|
162
171
|
}): React.JSX.Element;
|
|
163
|
-
export declare function LakeCheckView({ projectId, status }: {
|
|
172
|
+
export declare function LakeCheckView({ projectId, status, warnings, }: {
|
|
164
173
|
projectId: string;
|
|
165
174
|
status: "ok";
|
|
175
|
+
warnings?: readonly string[];
|
|
166
176
|
}): React.JSX.Element;
|
|
167
177
|
export declare function DeployReleaseView({ release, configPath, }: {
|
|
168
178
|
release: DeployRelease;
|
|
@@ -230,6 +240,7 @@ export interface LakeCleanupReport {
|
|
|
230
240
|
readonly expireOlderThan: string;
|
|
231
241
|
readonly deleteOlderThan: string;
|
|
232
242
|
readonly snapshots: number;
|
|
243
|
+
readonly keptSnapshots?: number;
|
|
233
244
|
readonly oldFiles: number;
|
|
234
245
|
readonly orphanedFiles: number;
|
|
235
246
|
}
|
package/dist/ui/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ui/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,WAAW,EAEX,aAAa,EACb,YAAY,EACb,MAAM,mBAAmB,CAAA;AAE1B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAgB,KAAK,OAAO,EAAa,MAAM,qBAAqB,CAAA;AAK3E,wBAAsB,YAAY,CAAC,IAAI,EAAE,KAAK,CAAC,SAAS,iBAOvD;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,KAAK,CAAC,SAAS,0BAErD;AAED;;;GAGG;AACH,wBAAsB,cAAc,CAClC,KAAK,EAAE,OAAO,EACd,OAAO,GAAE;IAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAAO,GAC9E,OAAO,CAAC,IAAI,CAAC,CASf;AAMD,wBAAsB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAElE;AAED,oFAAoF;AACpF,wBAAsB,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAQlF;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,CAAC,IAAI,EAAE;QACZ,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;QACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;QACrB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;QAC5B,QAAQ,CAAC,KAAK,EAAE,YAAY,EAAE,CAAA;KAC/B,GAAG,IAAI,CAAA;IACR,OAAO,IAAI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AAS,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,qBAuBA;AAED,wBAAgB,QAAQ,CAAC,EACvB,IAAI,EACJ,SAAS,EACT,KAAK,EACL,QAAQ,GACT,EAAE;IACD,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAA;CAC5B,qBAgBA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sixb/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.21",
|
|
4
4
|
"description": "Command-line interface for Sixb projects",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sixb",
|
|
@@ -25,30 +25,30 @@
|
|
|
25
25
|
"build": "bun ../../scripts/build-package.ts",
|
|
26
26
|
"typecheck": "tsc --noEmit",
|
|
27
27
|
"test": "bun test",
|
|
28
|
-
"test:e2e": "bun test ./tests/build.e2e.ts && bun test ./tests/prod-roles.e2e.ts && bun test ./tests/worker-group.e2e.ts && bun test ./tests/dev-reload.e2e.ts",
|
|
28
|
+
"test:e2e": "bun test ./tests/build.e2e.ts && bun test ./tests/prod-roles.e2e.ts && bun test ./tests/worker-group.e2e.ts && bun test ./tests/dev-reload.e2e.ts && bun test ./tests/pipeline-markings.e2e.ts",
|
|
29
29
|
"prepack": "bun run build"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@sixb/agent-worker": "0.1.
|
|
33
|
-
"@sixb/app": "^0.1.
|
|
34
|
-
"@sixb/
|
|
35
|
-
"@sixb/
|
|
36
|
-
"@sixb/core": "0.1.19",
|
|
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",
|
|
37
36
|
"@sixb/cli-core": "^0.1.8",
|
|
38
|
-
"@sixb/orchestrator": "0.1.
|
|
39
|
-
"@sixb/pipeline-worker": "0.1.
|
|
40
|
-
"@sixb/projection-worker": "0.1.
|
|
41
|
-
"@sixb/rules-worker": "0.1.
|
|
42
|
-
"@sixb/server": "0.1.
|
|
43
|
-
"@sixb/sync-worker": "0.1.
|
|
44
|
-
"@sixb/workflow-worker": "0.1.
|
|
45
|
-
"create-sixb": "^0.1.
|
|
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",
|
|
46
45
|
"ink": "^6.0.0",
|
|
47
46
|
"react": "^19.0.0",
|
|
48
47
|
"react-devtools-core": "^4.19.1"
|
|
49
48
|
},
|
|
50
49
|
"devDependencies": {
|
|
51
|
-
"@sixb/deploy-ssh": "0.1.
|
|
50
|
+
"@sixb/deploy-ssh": "0.1.2",
|
|
51
|
+
"@sixb/ducklake": "0.1.9",
|
|
52
52
|
"@types/bun": "latest",
|
|
53
53
|
"@types/react": "^19.0.0",
|
|
54
54
|
"typescript": "^5.7.0"
|
package/src/commands/api.tsx
CHANGED
|
@@ -3,7 +3,7 @@ import { resolve } from "node:path"
|
|
|
3
3
|
import { createSixbServer, type SixbServer } from "@sixb/server"
|
|
4
4
|
import { apiDocsUrl, apiEventsUrl, apiUrl, resolveBrowserTopology } from "../lib/browser-topology"
|
|
5
5
|
import type { LoadedSixbHost } from "../lib/loadSixb"
|
|
6
|
-
import { builtAppOutdir,
|
|
6
|
+
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"
|
|
@@ -17,7 +17,6 @@ export interface ApiOptions {
|
|
|
17
17
|
apiPort?: string
|
|
18
18
|
apiHost?: string
|
|
19
19
|
apiPublicOrigin?: string
|
|
20
|
-
atlasPublicOrigin?: string
|
|
21
20
|
appPublicOrigin?: string
|
|
22
21
|
trustedProxies?: string
|
|
23
22
|
}
|
|
@@ -51,7 +50,6 @@ export async function runApi(options: ApiOptions = {}) {
|
|
|
51
50
|
})
|
|
52
51
|
|
|
53
52
|
const appOutdir = builtAppOutdir(loaded.buildOutdir)
|
|
54
|
-
const hasCustomApp = await hasBuiltCustomApp(appOutdir)
|
|
55
53
|
const authExperienceOutdir = resolve(appOutdir, "auth")
|
|
56
54
|
const hasAuthExperience = await stat(resolve(authExperienceOutdir, "index.html"))
|
|
57
55
|
.then(() => true)
|
|
@@ -63,9 +61,7 @@ export async function runApi(options: ApiOptions = {}) {
|
|
|
63
61
|
port: options.port,
|
|
64
62
|
apiPort: options.apiPort,
|
|
65
63
|
apiPublicOrigin: options.apiPublicOrigin,
|
|
66
|
-
atlasPublicOrigin: options.atlasPublicOrigin,
|
|
67
64
|
appPublicOrigin: options.appPublicOrigin,
|
|
68
|
-
hasCustomApp,
|
|
69
65
|
})
|
|
70
66
|
|
|
71
67
|
const trustedProxies = (options.trustedProxies ?? process.env.SIXB_TRUSTED_PROXIES ?? "")
|
package/src/commands/app.tsx
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { basename } from "node:path"
|
|
2
|
-
import { type
|
|
2
|
+
import { type CustomAppServer, createCustomApp } from "@sixb/app/server"
|
|
3
3
|
import { resolveBrowserTopology, servedUrl } from "../lib/browser-topology"
|
|
4
4
|
import {
|
|
5
5
|
builtAppOutdir,
|
|
6
|
-
|
|
6
|
+
hasBuiltApp,
|
|
7
7
|
resolveProductionPaths,
|
|
8
8
|
resolveRuntimeEntry,
|
|
9
9
|
} from "../lib/production"
|
|
@@ -31,11 +31,11 @@ export async function runApp(options: AppOptions = {}) {
|
|
|
31
31
|
status: "Starting app",
|
|
32
32
|
})
|
|
33
33
|
|
|
34
|
-
let customAppServer:
|
|
34
|
+
let customAppServer: CustomAppServer | null = null
|
|
35
35
|
|
|
36
36
|
try {
|
|
37
37
|
const appOutdir = builtAppOutdir(buildOutdir)
|
|
38
|
-
if (!(await
|
|
38
|
+
if (!(await hasBuiltApp(appOutdir))) {
|
|
39
39
|
throw new Error(
|
|
40
40
|
`[SixbCustomApp] No built app found in ${appOutdir}. Run \`sixb build\` before \`sixb app\`.`
|
|
41
41
|
)
|
|
@@ -52,7 +52,6 @@ export async function runApp(options: AppOptions = {}) {
|
|
|
52
52
|
const customApp = await createCustomApp({
|
|
53
53
|
rootDir: projectRoot,
|
|
54
54
|
apiBaseUrl: topology.apiPublicOrigin,
|
|
55
|
-
audience: "app",
|
|
56
55
|
// No authEnabled: the page asks the API whether the project uses auth, so serving the
|
|
57
56
|
// bundle never loads the project.
|
|
58
57
|
})
|
|
@@ -61,13 +60,12 @@ export async function runApp(options: AppOptions = {}) {
|
|
|
61
60
|
port: topology.appPort,
|
|
62
61
|
outdir: appOutdir,
|
|
63
62
|
apiBaseUrl: topology.apiPublicOrigin,
|
|
64
|
-
audience: "app",
|
|
65
63
|
})
|
|
66
64
|
|
|
67
65
|
app.started({
|
|
68
66
|
title: "Sixb app started",
|
|
69
67
|
name: basename(projectRoot),
|
|
70
|
-
serviceName: "
|
|
68
|
+
serviceName: "App",
|
|
71
69
|
items: [{ label: "URL", value: servedUrl(topology) }],
|
|
72
70
|
})
|
|
73
71
|
|
package/src/commands/build.tsx
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { mkdir } from "node:fs/promises"
|
|
2
2
|
import { dirname, join, resolve } from "node:path"
|
|
3
|
-
import { createCustomApp } from "@sixb/app"
|
|
4
|
-
import { buildAtlasAssets } from "@sixb/atlas"
|
|
3
|
+
import { createCustomApp } from "@sixb/app/server"
|
|
5
4
|
import { buildRuntime } from "../lib/build-runtime"
|
|
6
5
|
import { generateProjectTypes } from "../lib/typegen"
|
|
7
6
|
import { BuildView, ErrorView, renderStatic } from "../ui"
|
|
@@ -37,43 +36,27 @@ export async function runBuild(options: BuildOptions = {}) {
|
|
|
37
36
|
generatedDir: join(".sixb", "build", "app"),
|
|
38
37
|
})
|
|
39
38
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
})
|
|
39
|
+
try {
|
|
40
|
+
const appResult = await customApp.build({
|
|
41
|
+
outdir: resolve(outdir, "app"),
|
|
42
|
+
})
|
|
45
43
|
|
|
46
|
-
|
|
47
|
-
await renderStatic(
|
|
48
|
-
<ErrorView
|
|
49
|
-
title="App build failed"
|
|
50
|
-
message="Failed to build the app"
|
|
51
|
-
details={appResult.logs ?? []}
|
|
52
|
-
/>
|
|
53
|
-
)
|
|
54
|
-
process.exit(1)
|
|
55
|
-
}
|
|
56
|
-
} catch (error) {
|
|
57
|
-
// e.g. the app/globals.css Tailwind compile failed — surface the labeled
|
|
58
|
-
// message instead of an unhandled stack trace.
|
|
59
|
-
const message = error instanceof Error ? error.message : String(error)
|
|
44
|
+
if (!appResult.success) {
|
|
60
45
|
await renderStatic(
|
|
61
|
-
<ErrorView
|
|
46
|
+
<ErrorView
|
|
47
|
+
title="App build failed"
|
|
48
|
+
message="Failed to build the app"
|
|
49
|
+
details={appResult.logs ?? []}
|
|
50
|
+
/>
|
|
62
51
|
)
|
|
63
52
|
process.exit(1)
|
|
64
53
|
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
try {
|
|
68
|
-
await buildAtlasAssets({ outdir: resolve(outdir, "atlas") })
|
|
69
54
|
} catch (error) {
|
|
55
|
+
// e.g. the app/globals.css Tailwind compile failed — surface the labeled
|
|
56
|
+
// message instead of an unhandled stack trace.
|
|
70
57
|
const message = error instanceof Error ? error.message : String(error)
|
|
71
58
|
await renderStatic(
|
|
72
|
-
<ErrorView
|
|
73
|
-
title="Built-in UI build failed"
|
|
74
|
-
message="Failed to build production UI assets"
|
|
75
|
-
details={[message]}
|
|
76
|
-
/>
|
|
59
|
+
<ErrorView title="App build failed" message="Failed to build the app" details={[message]} />
|
|
77
60
|
)
|
|
78
61
|
process.exit(1)
|
|
79
62
|
}
|
package/src/commands/check.tsx
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { resolve } from "node:path"
|
|
2
|
+
import { errorMessage } from "../lib/errors"
|
|
2
3
|
import { checkRuntimeHealth } from "../lib/health"
|
|
3
|
-
import { loadSixbFromEntry } from "../lib/loadSixb"
|
|
4
|
-
import {
|
|
4
|
+
import { type LoadedSixbHost, loadSixbFromEntry } from "../lib/loadSixb"
|
|
5
|
+
import {
|
|
6
|
+
checkRuntimePipelineMarkings,
|
|
7
|
+
readAppliedMarkingNotices,
|
|
8
|
+
stopSixbProviders,
|
|
9
|
+
} from "../lib/runtime"
|
|
5
10
|
import { generateProjectTypes } from "../lib/typegen"
|
|
6
11
|
import { CheckView, renderStatic } from "../ui"
|
|
7
12
|
|
|
@@ -17,6 +22,7 @@ export async function runCheck(options: CheckOptions = {}) {
|
|
|
17
22
|
try {
|
|
18
23
|
const objectTypes = sixb.definitions.ontology.listObjectTypes()
|
|
19
24
|
const health = await checkRuntimeHealth(sixb)
|
|
25
|
+
const markings = await checkMarkings(sixb, health.storage.ok)
|
|
20
26
|
|
|
21
27
|
const projectValidation =
|
|
22
28
|
objectTypes.length > 0
|
|
@@ -31,6 +37,7 @@ export async function runCheck(options: CheckOptions = {}) {
|
|
|
31
37
|
broker={health.broker}
|
|
32
38
|
queues={health.queues}
|
|
33
39
|
projectValidation={projectValidation}
|
|
40
|
+
markings={markings}
|
|
34
41
|
ontology={{
|
|
35
42
|
enabled: true,
|
|
36
43
|
source: entry,
|
|
@@ -39,14 +46,14 @@ export async function runCheck(options: CheckOptions = {}) {
|
|
|
39
46
|
// are a different thing and counting them here read as ontology drift.
|
|
40
47
|
warnings: 0,
|
|
41
48
|
}}
|
|
42
|
-
warnings={health.warnings}
|
|
49
|
+
warnings={[...health.warnings, ...markings.warnings]}
|
|
43
50
|
/>
|
|
44
51
|
)
|
|
45
52
|
|
|
46
53
|
// A failing probe exits non-zero so `sixb check` can gate a deploy. `exitCode`, not
|
|
47
54
|
// `exit()`: `process.exit()` terminates immediately and the `finally` below never runs, so
|
|
48
55
|
// the providers this command opened were left unclosed on the one path where that matters.
|
|
49
|
-
const failed = [health.storage, health.timeseries, health.broker, health.queues].some(
|
|
56
|
+
const failed = [health.storage, health.timeseries, health.broker, health.queues, markings].some(
|
|
50
57
|
(check) => !check.ok
|
|
51
58
|
)
|
|
52
59
|
if (objectTypes.length === 0 || failed) process.exitCode = 1
|
|
@@ -67,6 +74,45 @@ export async function runCheck(options: CheckOptions = {}) {
|
|
|
67
74
|
|
|
68
75
|
const CLOSE_TIMEOUT_MS = 10_000
|
|
69
76
|
|
|
77
|
+
interface MarkingsCheck {
|
|
78
|
+
readonly ok: boolean
|
|
79
|
+
readonly warning?: boolean
|
|
80
|
+
readonly message?: string
|
|
81
|
+
readonly warnings: readonly string[]
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* The SQL preflight, then what the versions projections applied still add to the code's markings.
|
|
86
|
+
* The second is a warning, not a failure: the code is right, and only rerunning the pipeline with
|
|
87
|
+
* it deployed applies a version it allows.
|
|
88
|
+
*/
|
|
89
|
+
async function checkMarkings(sixb: LoadedSixbHost, storageOk: boolean): Promise<MarkingsCheck> {
|
|
90
|
+
try {
|
|
91
|
+
await checkRuntimePipelineMarkings(sixb)
|
|
92
|
+
} catch (error) {
|
|
93
|
+
return { ok: false, message: errorMessage(error), warnings: [] }
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// The storage row already reports an unreachable storage.
|
|
97
|
+
if (!storageOk) return { ok: true, warnings: [] }
|
|
98
|
+
|
|
99
|
+
try {
|
|
100
|
+
const notices = await readAppliedMarkingNotices(sixb)
|
|
101
|
+
if (notices.length === 0) return { ok: true, warnings: [] }
|
|
102
|
+
|
|
103
|
+
const count =
|
|
104
|
+
notices.length === 1 ? "1 projection applied" : `${notices.length} projections applied`
|
|
105
|
+
return {
|
|
106
|
+
ok: true,
|
|
107
|
+
warning: true,
|
|
108
|
+
message: `${count} a version the code does not allow`,
|
|
109
|
+
warnings: notices,
|
|
110
|
+
}
|
|
111
|
+
} catch (error) {
|
|
112
|
+
return { ok: false, message: errorMessage(error), warnings: [] }
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
70
116
|
async function settlesWithin(work: Promise<void>, timeoutMs: number): Promise<boolean> {
|
|
71
117
|
let timer: ReturnType<typeof setTimeout> | undefined
|
|
72
118
|
const timedOut = new Promise<false>((resolveTimeout) => {
|
|
@@ -1,14 +1,24 @@
|
|
|
1
1
|
import { dirname, resolve } from "node:path"
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import {
|
|
3
|
+
AppPackagesMissingError,
|
|
4
|
+
type CustomAppDevOptions,
|
|
5
|
+
type CustomAppDevServer,
|
|
6
|
+
createCustomApp,
|
|
7
|
+
} from "@sixb/app/server"
|
|
4
8
|
import { createSixbServer } from "@sixb/server"
|
|
5
9
|
import { resolveAgentTurnTimeoutMs } from "../lib/agent-turn-timeout"
|
|
6
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
apiDocsUrl,
|
|
12
|
+
apiEventsUrl,
|
|
13
|
+
apiUrl,
|
|
14
|
+
resolveBrowserTopology,
|
|
15
|
+
servedUrl,
|
|
16
|
+
} from "../lib/browser-topology"
|
|
7
17
|
import { type LoadedSixbHost, loadSixbFromEntry } from "../lib/loadSixb"
|
|
8
18
|
import { stopQuietly } from "../lib/role-lifecycle"
|
|
9
19
|
import { startSixbRuntime, stopSixbProviders } from "../lib/runtime"
|
|
10
20
|
import { generateProjectTypes } from "../lib/typegen"
|
|
11
|
-
import { resolveWorkerConcurrency } from "../lib/worker-concurrency"
|
|
21
|
+
import { resolveVectorConcurrency, resolveWorkerConcurrency } from "../lib/worker-concurrency"
|
|
12
22
|
import { DevView, LoadingView, renderCliError, renderPersistent } from "../ui"
|
|
13
23
|
|
|
14
24
|
export interface DevOptions {
|
|
@@ -18,10 +28,10 @@ export interface DevOptions {
|
|
|
18
28
|
apiPort?: string
|
|
19
29
|
apiHost?: string
|
|
20
30
|
apiPublicOrigin?: string
|
|
21
|
-
atlasPublicOrigin?: string
|
|
22
31
|
appPublicOrigin?: string
|
|
23
32
|
agentTurnTimeout?: string
|
|
24
33
|
concurrency?: readonly string[]
|
|
34
|
+
vectorConcurrency?: string
|
|
25
35
|
}
|
|
26
36
|
|
|
27
37
|
export async function runDevRuntime(options: DevOptions = {}) {
|
|
@@ -29,13 +39,13 @@ export async function runDevRuntime(options: DevOptions = {}) {
|
|
|
29
39
|
|
|
30
40
|
const agentTurnTimeoutMs = resolveAgentTurnTimeoutMs(options.agentTurnTimeout)
|
|
31
41
|
const workerConcurrency = resolveWorkerConcurrency(options.concurrency)
|
|
42
|
+
const vectorConcurrency = resolveVectorConcurrency(options.vectorConcurrency)
|
|
32
43
|
const entry = resolve(options.entry ?? "sixb.config.ts")
|
|
33
44
|
|
|
34
45
|
const app = renderPersistent(
|
|
35
46
|
<LoadingView title="Starting sixb" subtitle={entry} status="Loading runtime" />
|
|
36
47
|
)
|
|
37
48
|
|
|
38
|
-
let atlasServer: AtlasAppServer | null = null
|
|
39
49
|
let customAppServer: CustomAppDevServer | null = null
|
|
40
50
|
let sixb: LoadedSixbHost | null = null
|
|
41
51
|
let runtime: Awaited<ReturnType<typeof startSixbRuntime>> | null = null
|
|
@@ -56,8 +66,6 @@ export async function runDevRuntime(options: DevOptions = {}) {
|
|
|
56
66
|
abort.signal.throwIfAborted()
|
|
57
67
|
const projectRoot = dirname(resolve(entry))
|
|
58
68
|
|
|
59
|
-
const customAppProbe = await createCustomApp({ rootDir: projectRoot })
|
|
60
|
-
const hasCustomApp = await customAppProbe.hasRoutes()
|
|
61
69
|
const topology = resolveBrowserTopology({
|
|
62
70
|
role: "dev",
|
|
63
71
|
host: options.host,
|
|
@@ -65,21 +73,16 @@ export async function runDevRuntime(options: DevOptions = {}) {
|
|
|
65
73
|
port: options.port,
|
|
66
74
|
apiPort: options.apiPort,
|
|
67
75
|
apiPublicOrigin: options.apiPublicOrigin,
|
|
68
|
-
atlasPublicOrigin: options.atlasPublicOrigin,
|
|
69
76
|
appPublicOrigin: options.appPublicOrigin,
|
|
70
|
-
hasCustomApp,
|
|
71
77
|
})
|
|
72
78
|
const customApp = await createCustomApp({
|
|
73
79
|
rootDir: projectRoot,
|
|
74
80
|
apiBaseUrl: topology.apiPublicOrigin,
|
|
75
|
-
audience: "app",
|
|
76
81
|
authEnabled: host.auth.isEnabled(),
|
|
77
82
|
})
|
|
78
|
-
const authExperience =
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
})
|
|
82
|
-
: null
|
|
83
|
+
const authExperience = (await customApp.prepareAuthExperience()) ?? {
|
|
84
|
+
outdir: resolve(projectRoot, ".sixb", "generated", "auth"),
|
|
85
|
+
}
|
|
83
86
|
|
|
84
87
|
abort.signal.throwIfAborted()
|
|
85
88
|
const server = createSixbServer({
|
|
@@ -91,7 +94,7 @@ export async function runDevRuntime(options: DevOptions = {}) {
|
|
|
91
94
|
publicOrigin: topology.apiPublicOrigin,
|
|
92
95
|
allowedOrigins: topology.allowedBrowserOrigins,
|
|
93
96
|
},
|
|
94
|
-
|
|
97
|
+
authExperience,
|
|
95
98
|
})
|
|
96
99
|
runtimeOwnsProviders = true
|
|
97
100
|
// The runtime owns the server's lifecycle so agent turns run only while it listens.
|
|
@@ -109,34 +112,13 @@ export async function runDevRuntime(options: DevOptions = {}) {
|
|
|
109
112
|
agentApiBaseUrl: topology.apiPublicOrigin,
|
|
110
113
|
agentTurnTimeoutMs,
|
|
111
114
|
workerConcurrency,
|
|
115
|
+
vectorConcurrency,
|
|
112
116
|
})
|
|
113
117
|
abort.signal.throwIfAborted()
|
|
114
|
-
const authEnabled = host.auth.isEnabled()
|
|
115
118
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
authEnabled,
|
|
120
|
-
})
|
|
121
|
-
atlasServer = await atlas.start({
|
|
122
|
-
host: topology.host,
|
|
123
|
-
port: topology.atlasPort,
|
|
124
|
-
development: true,
|
|
125
|
-
})
|
|
126
|
-
abort.signal.throwIfAborted()
|
|
127
|
-
|
|
128
|
-
let appUrl: string | null = null
|
|
129
|
-
if (hasCustomApp) {
|
|
130
|
-
app.rerender(
|
|
131
|
-
<LoadingView title="Starting sixb" subtitle={entry} status="Starting custom app" />
|
|
132
|
-
)
|
|
133
|
-
|
|
134
|
-
customAppServer = await customApp.dev({
|
|
135
|
-
host: topology.host,
|
|
136
|
-
port: topology.appPort,
|
|
137
|
-
})
|
|
138
|
-
appUrl = topology.appPublicOrigin
|
|
139
|
-
}
|
|
119
|
+
app.rerender(<LoadingView title="Starting sixb" subtitle={entry} status="Starting app" />)
|
|
120
|
+
const devApp = await startDevApp(customApp, { host: topology.host, port: topology.appPort })
|
|
121
|
+
customAppServer = devApp.server
|
|
140
122
|
abort.signal.throwIfAborted()
|
|
141
123
|
|
|
142
124
|
app.rerender(
|
|
@@ -145,8 +127,7 @@ export async function runDevRuntime(options: DevOptions = {}) {
|
|
|
145
127
|
apiUrl={apiUrl(topology)}
|
|
146
128
|
apiDocsUrl={apiDocsUrl(topology)}
|
|
147
129
|
wsUrl={apiEventsUrl(topology)}
|
|
148
|
-
|
|
149
|
-
appUrl={appUrl}
|
|
130
|
+
appUrl={customAppServer ? servedUrl(topology) : null}
|
|
150
131
|
workers={[
|
|
151
132
|
{ type: "agent", worker: runtime.agentWorker },
|
|
152
133
|
{ type: "projection", worker: runtime.projectionWorker },
|
|
@@ -156,12 +137,12 @@ export async function runDevRuntime(options: DevOptions = {}) {
|
|
|
156
137
|
].flatMap(({ type, worker }) =>
|
|
157
138
|
worker ? [{ type, concurrency: worker.concurrency }] : []
|
|
158
139
|
)}
|
|
159
|
-
warnings={runtime.warnings}
|
|
140
|
+
warnings={devApp.warning ? [devApp.warning, ...runtime.warnings] : runtime.warnings}
|
|
160
141
|
/>
|
|
161
142
|
)
|
|
162
143
|
|
|
163
144
|
process.env.SIXB_DEV_READY = "1"
|
|
164
|
-
process.send?.({ type: "ready",
|
|
145
|
+
process.send?.({ type: "ready", watchesApp: customAppServer?.watchesSources ?? false })
|
|
165
146
|
|
|
166
147
|
await Promise.race([stopped, runtime.waitForWorkerFailure()])
|
|
167
148
|
} catch (error) {
|
|
@@ -175,10 +156,25 @@ export async function runDevRuntime(options: DevOptions = {}) {
|
|
|
175
156
|
process.env.SIXB_DEV_READY = ""
|
|
176
157
|
app.unmount()
|
|
177
158
|
await stopQuietly(() => customAppServer?.stop() ?? Promise.resolve())
|
|
178
|
-
await stopQuietly(() => atlasServer?.stop() ?? Promise.resolve())
|
|
179
159
|
await stopQuietly(() => runtime?.stop() ?? Promise.resolve())
|
|
180
160
|
if (sixb && !runtimeOwnsProviders) await stopSixbProviders(sixb)
|
|
181
161
|
process.off("SIGINT", requestShutdown)
|
|
182
162
|
process.off("SIGTERM", requestShutdown)
|
|
183
163
|
}
|
|
184
164
|
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Starts the app's dev server. A project missing the packages the app is bundled from still gets
|
|
168
|
+
* its API, with the install command as a warning; `sixb build` refuses instead.
|
|
169
|
+
*/
|
|
170
|
+
export async function startDevApp(
|
|
171
|
+
customApp: { dev(options: CustomAppDevOptions): Promise<CustomAppDevServer> },
|
|
172
|
+
options: CustomAppDevOptions
|
|
173
|
+
): Promise<{ readonly server: CustomAppDevServer | null; readonly warning?: string }> {
|
|
174
|
+
try {
|
|
175
|
+
return { server: await customApp.dev(options) }
|
|
176
|
+
} catch (error) {
|
|
177
|
+
if (!(error instanceof AppPackagesMissingError)) throw error
|
|
178
|
+
return { server: null, warning: error.message.replace("[SixbCustomApp] ", "") }
|
|
179
|
+
}
|
|
180
|
+
}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
+
import { errorMessage } from "../lib/errors"
|
|
1
2
|
import { loadSixbFromEntry } from "../lib/loadSixb"
|
|
2
3
|
import { resolveRuntimeEntry } from "../lib/production"
|
|
3
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
checkRuntimeLakeDefinitions,
|
|
6
|
+
checkRuntimePipelineMarkings,
|
|
7
|
+
readAppliedMarkingNotices,
|
|
8
|
+
stopSixbProviders,
|
|
9
|
+
} from "../lib/runtime"
|
|
4
10
|
import { LakeCheckView, renderStatic } from "../ui"
|
|
5
11
|
|
|
6
12
|
export interface LakeCheckOptions {
|
|
@@ -13,7 +19,14 @@ export async function runLakeCheck(options: LakeCheckOptions = {}) {
|
|
|
13
19
|
|
|
14
20
|
try {
|
|
15
21
|
await checkRuntimeLakeDefinitions(sixb)
|
|
16
|
-
await
|
|
22
|
+
await checkRuntimePipelineMarkings(sixb)
|
|
23
|
+
|
|
24
|
+
// The code is right; what projections applied before it is a warning until they reproject.
|
|
25
|
+
const warnings = await readAppliedMarkingNotices(sixb).catch((error: unknown) => [
|
|
26
|
+
`[SixbCLI] Could not read the dataset versions projections applied: ${errorMessage(error)}`,
|
|
27
|
+
])
|
|
28
|
+
|
|
29
|
+
await renderStatic(<LakeCheckView projectId={sixb.id} status="ok" warnings={warnings} />)
|
|
17
30
|
} finally {
|
|
18
31
|
await stopSixbProviders(sixb)
|
|
19
32
|
}
|
|
@@ -16,6 +16,7 @@ interface LakeMaintenanceOptions {
|
|
|
16
16
|
readonly dryRun?: boolean
|
|
17
17
|
readonly expireOlderThan?: string
|
|
18
18
|
readonly deleteOlderThan?: string
|
|
19
|
+
readonly protect?: readonly { readonly datasetId: string; readonly versionId: string }[]
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
export interface LakeMaintenanceReport {
|
|
@@ -23,6 +24,8 @@ export interface LakeMaintenanceReport {
|
|
|
23
24
|
readonly expireOlderThan: string
|
|
24
25
|
readonly deleteOlderThan: string
|
|
25
26
|
readonly snapshots: number
|
|
27
|
+
/** Old snapshots kept because a version they hold is still needed, when the provider says. */
|
|
28
|
+
readonly keptSnapshots?: number
|
|
26
29
|
readonly oldFiles: number
|
|
27
30
|
readonly orphanedFiles: number
|
|
28
31
|
}
|
|
@@ -43,10 +46,18 @@ export async function runLakeCleanup(options: LakeCleanupOptions = {}) {
|
|
|
43
46
|
|
|
44
47
|
const expireOlderThan = options.expireOlderThan ?? DEFAULT_RETENTION
|
|
45
48
|
const deleteOlderThan = options.deleteOlderThan ?? expireOlderThan
|
|
49
|
+
|
|
50
|
+
// Objects hold the rows of the version each projection applied, and their markings are read
|
|
51
|
+
// from it: the lake keeps those versions too. Without them, cleanup does not run.
|
|
52
|
+
const applied = await sixb.storage.ontology.sources.listActive({ projectId: sixb.projectId })
|
|
46
53
|
const report = await lakeStorage.runMaintenance({
|
|
47
54
|
dryRun: options.dryRun ?? false,
|
|
48
55
|
expireOlderThan,
|
|
49
56
|
deleteOlderThan,
|
|
57
|
+
protect: applied.map(({ datasetVersion }) => ({
|
|
58
|
+
datasetId: datasetVersion.datasetId,
|
|
59
|
+
versionId: datasetVersion.versionId,
|
|
60
|
+
})),
|
|
50
61
|
})
|
|
51
62
|
await renderStatic(<LakeCleanupView projectId={sixb.id} report={report} />)
|
|
52
63
|
} finally {
|