@sixb/cli 0.2.2 → 0.2.4
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 +25 -22
- package/dist/commands/access-token-utils.d.ts.map +1 -1
- package/dist/commands/agent.d.ts +5 -0
- package/dist/commands/agent.d.ts.map +1 -1
- package/dist/commands/api.d.ts.map +1 -1
- package/dist/commands/check.d.ts.map +1 -1
- package/dist/commands/deploy.d.ts.map +1 -1
- package/dist/commands/dev-runner.d.ts.map +1 -1
- package/dist/commands/env.d.ts +6 -1
- package/dist/commands/env.d.ts.map +1 -1
- package/dist/commands/lake-cleanup.d.ts +2 -12
- package/dist/commands/lake-cleanup.d.ts.map +1 -1
- package/dist/commands/lake-rejected.d.ts +10 -0
- package/dist/commands/lake-rejected.d.ts.map +1 -0
- package/dist/commands/orchestrator.d.ts.map +1 -1
- package/dist/commands/scheduler.d.ts +2 -5
- package/dist/commands/scheduler.d.ts.map +1 -1
- package/dist/commands/worker-group.d.ts.map +1 -1
- package/dist/lib/command-line.d.ts +12 -7
- package/dist/lib/command-line.d.ts.map +1 -1
- package/dist/lib/deploy-release.d.ts +7 -1
- package/dist/lib/deploy-release.d.ts.map +1 -1
- package/dist/lib/duration.d.ts +3 -0
- package/dist/lib/duration.d.ts.map +1 -0
- package/dist/lib/loadSixb.d.ts.map +1 -1
- package/dist/lib/production-roles.d.ts +0 -4
- package/dist/lib/production-roles.d.ts.map +1 -1
- package/dist/lib/runtime.d.ts +7 -9
- package/dist/lib/runtime.d.ts.map +1 -1
- package/dist/lib/worker-concurrency.d.ts.map +1 -1
- package/dist/lib/worker-registry.d.ts +4 -1
- package/dist/lib/worker-registry.d.ts.map +1 -1
- package/dist/runner/local-runner.d.ts +1 -1
- package/dist/tui/app.d.ts.map +1 -1
- package/dist/tui/format.d.ts +20 -0
- package/dist/tui/format.d.ts.map +1 -1
- package/dist/tui/transcript.d.ts.map +1 -1
- package/dist/ui/deploy-screens.d.ts +4 -2
- package/dist/ui/deploy-screens.d.ts.map +1 -1
- package/dist/ui/env-screens.d.ts +14 -1
- package/dist/ui/env-screens.d.ts.map +1 -1
- package/dist/ui/screens.d.ts +5 -11
- package/dist/ui/screens.d.ts.map +1 -1
- package/package.json +20 -16
- package/src/commands/access-token-utils.ts +2 -20
- package/src/commands/agent.ts +54 -8
- package/src/commands/api.ts +7 -0
- package/src/commands/check.ts +75 -1
- package/src/commands/deploy.ts +15 -3
- package/src/commands/dev-runner.ts +5 -0
- package/src/commands/env.ts +99 -20
- package/src/commands/lake-cleanup.ts +25 -48
- package/src/commands/lake-rejected.ts +36 -0
- package/src/commands/orchestrator.ts +2 -7
- package/src/commands/scheduler.ts +11 -61
- package/src/commands/worker-group.ts +6 -3
- package/src/index.tsx +10 -4
- package/src/lib/command-line.ts +25 -12
- package/src/lib/deploy-release.ts +42 -2
- package/src/lib/duration.ts +11 -0
- package/src/lib/loadSixb.ts +3 -4
- package/src/lib/production-roles.ts +0 -1
- package/src/lib/runtime.ts +62 -43
- package/src/lib/shareable-providers.ts +2 -2
- package/src/lib/worker-concurrency.ts +1 -0
- package/src/lib/worker-registry.ts +36 -1
- package/src/runner/local-runner.ts +1 -1
- package/src/tui/app.tsx +2 -1
- package/src/tui/format.ts +190 -3
- package/src/tui/transcript.tsx +8 -1
- package/src/ui/deploy-screens.ts +8 -1
- package/src/ui/env-screens.ts +39 -5
- package/src/ui/screens.ts +21 -20
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import type { DeployAccessKey, DeployCheck, DeployRelease, DeployStatus } from "@sixb/core/deploy";
|
|
2
|
-
export declare function deployReleaseView({ release, configPath, }: {
|
|
2
|
+
export declare function deployReleaseView({ release, configPath, warnings, }: {
|
|
3
3
|
release: DeployRelease;
|
|
4
4
|
configPath: string;
|
|
5
|
+
warnings?: readonly string[];
|
|
5
6
|
}): string;
|
|
6
7
|
/** The plain line a finished step prints where there is no live view, and in CI logs. */
|
|
7
8
|
export declare function deployStepLine(label: string, seconds: string): string;
|
|
8
9
|
/** How a deploy ended. What was deployed, and where, opened the deploy's output already. */
|
|
9
|
-
export declare function deployCompleteView({ release, seconds, keptEnv, }: {
|
|
10
|
+
export declare function deployCompleteView({ release, seconds, keptEnv, warnings, }: {
|
|
10
11
|
release: DeployRelease;
|
|
11
12
|
seconds?: number;
|
|
12
13
|
/** The deploy couldn't update the server's `.env`, so this release runs on its current values. */
|
|
13
14
|
keptEnv?: boolean;
|
|
15
|
+
warnings?: readonly string[];
|
|
14
16
|
}): string;
|
|
15
17
|
export declare function deployStatusView({ name, location, status, }: {
|
|
16
18
|
name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy-screens.d.ts","sourceRoot":"","sources":["../../src/ui/deploy-screens.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,WAAW,EAEX,aAAa,EACb,YAAY,EACb,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"deploy-screens.d.ts","sourceRoot":"","sources":["../../src/ui/deploy-screens.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,WAAW,EAEX,aAAa,EACb,YAAY,EACb,MAAM,mBAAmB,CAAA;AAoB1B,wBAAgB,iBAAiB,CAAC,EAChC,OAAO,EACP,UAAU,EACV,QAAa,GACd,EAAE;IACD,OAAO,EAAE,aAAa,CAAA;IACtB,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAC7B,GAAG,MAAM,CAmET;AAED,yFAAyF;AACzF,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAErE;AAED,4FAA4F;AAC5F,wBAAgB,kBAAkB,CAAC,EACjC,OAAO,EACP,OAAO,EACP,OAAe,EACf,QAAa,GACd,EAAE;IACD,OAAO,EAAE,aAAa,CAAA;IACtB,OAAO,CAAC,EAAE,MAAM,CAAA;IACh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CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;SAC7B,EAAE,CAAA;KACJ,GAAG,IAAI,CAAA;CACT,GAAG,MAAM,CA8CT;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,KAAK,EACL,IAAI,GACL,EAAE;IACD,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,SAAS,eAAe,EAAE,CAAA;CACjC,GAAG,MAAM,CAcT"}
|
package/dist/ui/env-screens.d.ts
CHANGED
|
@@ -15,12 +15,25 @@ export declare function envSetView(input: {
|
|
|
15
15
|
readonly env: EnvName;
|
|
16
16
|
readonly declared: boolean;
|
|
17
17
|
}): string;
|
|
18
|
+
/** What `init` did with `sixb.env.ts`: wrote names into it, left it to the author, or had none to add. */
|
|
19
|
+
export type EnvInitConfig = {
|
|
20
|
+
readonly kind: "written";
|
|
21
|
+
readonly names: number;
|
|
22
|
+
} | {
|
|
23
|
+
readonly kind: "paste";
|
|
24
|
+
readonly names: number;
|
|
25
|
+
readonly lines: readonly string[];
|
|
26
|
+
} | {
|
|
27
|
+
readonly kind: "unchanged";
|
|
28
|
+
};
|
|
18
29
|
export declare function envInitView(input: {
|
|
30
|
+
/** Per environment: how many values were sent, and how many it had already. */
|
|
19
31
|
readonly uploaded: readonly {
|
|
20
32
|
readonly env: EnvName;
|
|
21
33
|
readonly count: number;
|
|
34
|
+
readonly already: number;
|
|
22
35
|
}[];
|
|
23
|
-
readonly
|
|
36
|
+
readonly config: EnvInitConfig;
|
|
24
37
|
}): string;
|
|
25
38
|
export interface EnvStatusRow {
|
|
26
39
|
readonly name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env-screens.d.ts","sourceRoot":"","sources":["../../src/ui/env-screens.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAI7C,wBAAgB,aAAa,CAAC,KAAK,EAAE;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;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type { LakeRetentionReport } from "@sixb/core/lake-storage";
|
|
1
2
|
import { type CliHelp } from "../lib/command-line";
|
|
2
3
|
export type KeyValueItem = {
|
|
3
4
|
label: string;
|
|
@@ -114,18 +115,11 @@ export declare function lakeCheckView({ projectId, warnings, }: {
|
|
|
114
115
|
projectId: string;
|
|
115
116
|
warnings?: readonly string[];
|
|
116
117
|
}): string;
|
|
117
|
-
export
|
|
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, }: {
|
|
118
|
+
export declare function lakeCleanupView({ projectId, keepVersionsFor, deleteFilesAfter, report, }: {
|
|
127
119
|
projectId: string;
|
|
128
|
-
|
|
120
|
+
keepVersionsFor: string;
|
|
121
|
+
deleteFilesAfter: string;
|
|
122
|
+
report: LakeRetentionReport;
|
|
129
123
|
}): string;
|
|
130
124
|
export declare function initView({ name, files, commands: next, }: {
|
|
131
125
|
name: string;
|
package/dist/ui/screens.d.ts.map
CHANGED
|
@@ -1 +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,wB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,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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sixb/cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"description": "Command-line interface for Sixb projects",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sixb",
|
|
@@ -25,33 +25,37 @@
|
|
|
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 && bun test ./tests/pipeline-markings.e2e.ts && bun test ./tests/connect-signed-out.e2e.ts && bun test ./tests/desktop-runner.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/ingest-roles.e2e.ts && bun test ./tests/dev-reload.e2e.ts && bun test ./tests/pipeline-markings.e2e.ts && bun test ./tests/run-recovery.e2e.ts && bun test ./tests/run-recovery-infra.e2e.ts && bun test ./tests/run-recovery-dev.e2e.ts && bun test ./tests/connect-signed-out.e2e.ts && bun test ./tests/desktop-runner.e2e.ts",
|
|
29
29
|
"prepack": "bun run build"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@opentui/core": "0.6.6",
|
|
33
33
|
"@opentui/react": "0.6.6",
|
|
34
|
-
"@sixb/agent": "0.2.
|
|
35
|
-
"@sixb/agent-worker": "0.2.
|
|
36
|
-
"@sixb/app": "^0.2.
|
|
37
|
-
"@sixb/client": "^0.2.
|
|
38
|
-
"@sixb/core": "0.2.
|
|
39
|
-
"@sixb/cli-core": "^0.2.
|
|
40
|
-
"@sixb/
|
|
41
|
-
"@sixb/
|
|
42
|
-
"@sixb/
|
|
43
|
-
"@sixb/
|
|
34
|
+
"@sixb/agent": "0.2.4",
|
|
35
|
+
"@sixb/agent-worker": "0.2.4",
|
|
36
|
+
"@sixb/app": "^0.2.4",
|
|
37
|
+
"@sixb/client": "^0.2.3",
|
|
38
|
+
"@sixb/core": "0.2.4",
|
|
39
|
+
"@sixb/cli-core": "^0.2.3",
|
|
40
|
+
"@sixb/lake-worker": "0.2.4",
|
|
41
|
+
"@sixb/orchestrator": "0.2.4",
|
|
42
|
+
"@sixb/pipeline-worker": "0.2.4",
|
|
43
|
+
"@sixb/projection-worker": "0.2.4",
|
|
44
|
+
"@sixb/rules-worker": "0.2.4",
|
|
44
45
|
"@sixb/sandboxes-local": "^0.2.0",
|
|
45
|
-
"@sixb/server": "0.2.
|
|
46
|
-
"@sixb/sync-worker": "0.2.
|
|
47
|
-
"@sixb/workflow-worker": "0.2.
|
|
46
|
+
"@sixb/server": "0.2.4",
|
|
47
|
+
"@sixb/sync-worker": "0.2.4",
|
|
48
|
+
"@sixb/workflow-worker": "0.2.4",
|
|
48
49
|
"create-sixb": "^0.2.0",
|
|
49
50
|
"react": "^19.2.0"
|
|
50
51
|
},
|
|
51
52
|
"devDependencies": {
|
|
52
53
|
"@sixb/deploy-ssh": "0.2.0",
|
|
53
54
|
"@sixb/desktop": "0.2.1",
|
|
54
|
-
"@sixb/ducklake": "0.2.
|
|
55
|
+
"@sixb/ducklake": "0.2.4",
|
|
56
|
+
"@sixb/pg": "0.2.4",
|
|
57
|
+
"@sixb/queues-bullmq": "0.2.3",
|
|
58
|
+
"@sixb/sqlite": "0.2.4",
|
|
55
59
|
"@types/bun": "latest",
|
|
56
60
|
"@types/react": "^19.0.0",
|
|
57
61
|
"typescript": "^5.7.0"
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { SixbApiClientConfig } from "../lib/api-client"
|
|
2
|
+
import { parseDurationMs } from "../lib/duration"
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* The API creates tokens only for a signed-in session, never for another access token, so say how
|
|
@@ -25,7 +26,7 @@ export function resolveExpiration(options: ExpirationOptions): string {
|
|
|
25
26
|
return date.toISOString()
|
|
26
27
|
}
|
|
27
28
|
|
|
28
|
-
const duration = parseDurationMs(options.expiresIn ?? "90d")
|
|
29
|
+
const duration = parseDurationMs(options.expiresIn ?? "90d", "--expires-in")
|
|
29
30
|
return new Date(Date.now() + duration).toISOString()
|
|
30
31
|
}
|
|
31
32
|
|
|
@@ -55,22 +56,3 @@ export function formatDate(value: string | undefined): string {
|
|
|
55
56
|
if (Number.isNaN(date.getTime())) return value
|
|
56
57
|
return date.toISOString().replace("T", " ").slice(0, 16)
|
|
57
58
|
}
|
|
58
|
-
|
|
59
|
-
function parseDurationMs(value: string): number {
|
|
60
|
-
const match = value.trim().match(/^(\d+)(m|h|d|w|y)$/)
|
|
61
|
-
if (!match) {
|
|
62
|
-
throw new Error("[SixbCLI] Use --expires-in like 30d, 12h, 4w, or 1y.")
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
const amount = Number(match[1])
|
|
66
|
-
const unit = match[2]
|
|
67
|
-
const multipliers = {
|
|
68
|
-
m: 60_000,
|
|
69
|
-
h: 60 * 60_000,
|
|
70
|
-
d: 24 * 60 * 60_000,
|
|
71
|
-
w: 7 * 24 * 60 * 60_000,
|
|
72
|
-
y: 365 * 24 * 60 * 60_000,
|
|
73
|
-
} as const
|
|
74
|
-
|
|
75
|
-
return amount * multipliers[unit as keyof typeof multipliers]
|
|
76
|
-
}
|
package/src/commands/agent.ts
CHANGED
|
@@ -17,7 +17,7 @@ import { type Connection, connect } from "../lib/connection"
|
|
|
17
17
|
import { errorMessage } from "../lib/errors"
|
|
18
18
|
import { thisComputer, thisComputerId } from "../runner/computer"
|
|
19
19
|
import { LocalRunner } from "../runner/local-runner"
|
|
20
|
-
import { toolLine } from "../tui/format"
|
|
20
|
+
import { askedInReply, pickedAnswer, toolLine } from "../tui/format"
|
|
21
21
|
import { liveRun, reduceLive, shownMessage } from "../tui/parts"
|
|
22
22
|
import {
|
|
23
23
|
APPROVAL_MODES,
|
|
@@ -108,6 +108,10 @@ export async function runAgent(options: {
|
|
|
108
108
|
)
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
+
// In a conversation that asked a question with choices, a number answers with that choice.
|
|
112
|
+
const last = options.thread ? await lastMessage(connection, threadId) : null
|
|
113
|
+
const sent = last ? pickedAnswer([last], text) : text
|
|
114
|
+
|
|
111
115
|
const stop = new AbortController()
|
|
112
116
|
process.once("SIGINT", () => stop.abort())
|
|
113
117
|
try {
|
|
@@ -115,7 +119,7 @@ export async function runAgent(options: {
|
|
|
115
119
|
client,
|
|
116
120
|
path: { threadId: thread.id },
|
|
117
121
|
body: {
|
|
118
|
-
text,
|
|
122
|
+
text: sent,
|
|
119
123
|
...(approvalMode ? { approvalMode } : {}),
|
|
120
124
|
timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
121
125
|
locale: Intl.DateTimeFormat().resolvedOptions().locale,
|
|
@@ -281,6 +285,10 @@ async function follow(
|
|
|
281
285
|
step(
|
|
282
286
|
`${mark} ${tone.strong(line.verb)} ${tone.muted(line.detail)}${line.note ? tone.faint(` ${line.note}`) : ""}`
|
|
283
287
|
)
|
|
288
|
+
// A question's choices are what the person answers with: they read under its line.
|
|
289
|
+
if (part.name === "ask") {
|
|
290
|
+
for (const row of line.preview ?? []) step(tone.faint(` ${row}`))
|
|
291
|
+
}
|
|
284
292
|
}
|
|
285
293
|
}
|
|
286
294
|
if (event.type === "agent.run.finished") settle("finished")
|
|
@@ -356,15 +364,28 @@ async function afterTurn(
|
|
|
356
364
|
return null
|
|
357
365
|
}
|
|
358
366
|
|
|
359
|
-
/** The
|
|
367
|
+
/** The thread's last message, as the TUI shows it. */
|
|
368
|
+
async function lastMessage(connection: Connection, threadId: string) {
|
|
369
|
+
const { data } = await listAgentThreadMessages({
|
|
370
|
+
client: connection.client,
|
|
371
|
+
path: { threadId },
|
|
372
|
+
query: { order: "desc", limit: "1" },
|
|
373
|
+
})
|
|
374
|
+
const last = data?.messages[0]
|
|
375
|
+
return last ? shownMessage(last) : null
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
/**
|
|
379
|
+
* The turn's answer: its last message's text, or as JSON. A turn that ended on a question gives
|
|
380
|
+
* the questions, each with its choices, and how to answer.
|
|
381
|
+
*/
|
|
360
382
|
async function printAnswer(connection: Connection, threadId: string, json: boolean) {
|
|
361
383
|
const { client } = connection
|
|
362
|
-
const [
|
|
363
|
-
|
|
384
|
+
const [shown, { data: runs }] = await Promise.all([
|
|
385
|
+
lastMessage(connection, threadId),
|
|
364
386
|
listAgentThreadRuns({ client, path: { threadId }, query: { order: "desc", limit: "1" } }),
|
|
365
387
|
])
|
|
366
|
-
const
|
|
367
|
-
const shown = last ? shownMessage(last) : null
|
|
388
|
+
const questions = askedInReply(shown)
|
|
368
389
|
const answer =
|
|
369
390
|
shown?.role === "assistant"
|
|
370
391
|
? shown.parts.flatMap((part) => (part.kind === "text" ? [part.text.trim()] : [])).join("\n\n")
|
|
@@ -376,15 +397,40 @@ async function printAnswer(connection: Connection, threadId: string, json: boole
|
|
|
376
397
|
|
|
377
398
|
if (json) {
|
|
378
399
|
process.stdout.write(
|
|
379
|
-
`${JSON.stringify({ threadId, runId: run?.id, status: run?.status, finishReason: run?.finishReason, text: answer })}\n`
|
|
400
|
+
`${JSON.stringify({ threadId, runId: run?.id, status: run?.status, finishReason: run?.finishReason, text: answer, ...(questions.length > 0 ? { questions } : {}) })}\n`
|
|
380
401
|
)
|
|
381
402
|
return
|
|
382
403
|
}
|
|
383
404
|
if (answer) process.stdout.write(`\n${process.stdout.isTTY ? styled(answer) : answer}\n`)
|
|
405
|
+
if (questions.length > 0) {
|
|
406
|
+
process.stdout.write(`\n${questionsText(questions)}\n`)
|
|
407
|
+
const byNumber = questions.length === 1 && (questions[0]?.choices.length ?? 0) > 0
|
|
408
|
+
step(
|
|
409
|
+
tone.faint(
|
|
410
|
+
`Answer with: sixb agent --thread ${threadId} "<answer>"${byNumber ? ", or a choice's number" : ""}`
|
|
411
|
+
)
|
|
412
|
+
)
|
|
413
|
+
}
|
|
384
414
|
if (run?.status === "failed") step(tone.fail(run.error?.message ?? "The turn failed."))
|
|
385
415
|
if (run?.status === "cancelled") step(tone.fail("The turn was stopped."))
|
|
386
416
|
}
|
|
387
417
|
|
|
418
|
+
/** The questions a turn ended on, each with its choices numbered, as plain text. */
|
|
419
|
+
export function questionsText(
|
|
420
|
+
questions: readonly { readonly question: string; readonly choices: readonly string[] }[]
|
|
421
|
+
): string {
|
|
422
|
+
return questions
|
|
423
|
+
.map((question, index) =>
|
|
424
|
+
[
|
|
425
|
+
questions.length > 1 ? `${index + 1}. ${question.question}` : question.question,
|
|
426
|
+
...question.choices.map(
|
|
427
|
+
(choice, at) => `${questions.length > 1 ? " " : " "}${at + 1}. ${choice}`
|
|
428
|
+
),
|
|
429
|
+
].join("\n")
|
|
430
|
+
)
|
|
431
|
+
.join("\n\n")
|
|
432
|
+
}
|
|
433
|
+
|
|
388
434
|
function parseApprovalMode(value: string | undefined): ApprovalMode | undefined {
|
|
389
435
|
if (value === undefined) return undefined
|
|
390
436
|
|
package/src/commands/api.ts
CHANGED
|
@@ -64,6 +64,10 @@ export async function runApi(options: ApiOptions = {}) {
|
|
|
64
64
|
port: topology.apiPort,
|
|
65
65
|
hostname: topology.apiHost,
|
|
66
66
|
quiet: true,
|
|
67
|
+
// `sixb orchestrator` owns it.
|
|
68
|
+
ontologyMaintenance: false,
|
|
69
|
+
// A lake worker owns it. Without one, changes wait where `sixb check` and the Console show.
|
|
70
|
+
ingestFlush: false,
|
|
67
71
|
browser: {
|
|
68
72
|
publicOrigin: topology.apiPublicOrigin,
|
|
69
73
|
allowedOrigins: topology.allowedBrowserOrigins,
|
|
@@ -85,6 +89,9 @@ export async function runApi(options: ApiOptions = {}) {
|
|
|
85
89
|
{ label: "events", value: apiEventsUrl(topology) },
|
|
86
90
|
],
|
|
87
91
|
storage: migration.summary,
|
|
92
|
+
warnings: [
|
|
93
|
+
"This process runs no upkeep. Keep `sixb orchestrator` running, even with no schedules: it delivers events left undelivered, purges expired records, and runs cron.",
|
|
94
|
+
],
|
|
88
95
|
})
|
|
89
96
|
)
|
|
90
97
|
|
package/src/commands/check.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { dirname, resolve } from "node:path"
|
|
2
|
+
import { getLakeRetentionRuntime, ingestStalledSince } from "@sixb/core/internal/runtime"
|
|
3
|
+
import { countLostRuns } from "@sixb/core/internal/workers"
|
|
2
4
|
import { assertDeclaredEnv } from "../lib/env-config"
|
|
3
5
|
import { errorMessage } from "../lib/errors"
|
|
4
6
|
import { checkRuntimeHealth } from "../lib/health"
|
|
@@ -59,7 +61,12 @@ export async function runCheck(options: CheckOptions = {}) {
|
|
|
59
61
|
// are a different thing and counting them here read as ontology drift.
|
|
60
62
|
warnings: 0,
|
|
61
63
|
},
|
|
62
|
-
warnings: [
|
|
64
|
+
warnings: [
|
|
65
|
+
...health.warnings,
|
|
66
|
+
...markings.warnings,
|
|
67
|
+
...(await lakeWorkerWarnings(sixb, health.storage.ok)),
|
|
68
|
+
...(await lostRunWarnings(sixb, health.storage.ok)),
|
|
69
|
+
],
|
|
63
70
|
})
|
|
64
71
|
)
|
|
65
72
|
|
|
@@ -87,6 +94,73 @@ export async function runCheck(options: CheckOptions = {}) {
|
|
|
87
94
|
|
|
88
95
|
const CLOSE_TIMEOUT_MS = 10_000
|
|
89
96
|
|
|
97
|
+
/**
|
|
98
|
+
* What storage says, since no process knows what the others run. A storage that is down or behind
|
|
99
|
+
* has its own row in this report.
|
|
100
|
+
*/
|
|
101
|
+
async function lakeWorkerWarnings(
|
|
102
|
+
sixb: LoadedSixbHost,
|
|
103
|
+
storageOk: boolean
|
|
104
|
+
): Promise<readonly string[]> {
|
|
105
|
+
if (!storageOk) return []
|
|
106
|
+
|
|
107
|
+
const [status, stalled] = await Promise.all([
|
|
108
|
+
getLakeRetentionRuntime(sixb)
|
|
109
|
+
.status()
|
|
110
|
+
.catch(() => null),
|
|
111
|
+
stalledIngestDatasets(sixb),
|
|
112
|
+
])
|
|
113
|
+
|
|
114
|
+
return [
|
|
115
|
+
...(status?.state === "no-worker"
|
|
116
|
+
? ["Lake cleanup is requested but no lake worker has run it. Run `sixb worker lake`."]
|
|
117
|
+
: []),
|
|
118
|
+
...(stalled.length > 0
|
|
119
|
+
? [
|
|
120
|
+
`Ingested changes wait and nothing writes them, in ${stalled.join(", ")}. Run \`sixb worker lake\`.`,
|
|
121
|
+
]
|
|
122
|
+
: []),
|
|
123
|
+
]
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
async function stalledIngestDatasets(sixb: LoadedSixbHost): Promise<readonly string[]> {
|
|
127
|
+
const summaries = await sixb.storage.datasetIngest
|
|
128
|
+
?.summarize({ projectId: sixb.id })
|
|
129
|
+
.catch(() => [])
|
|
130
|
+
|
|
131
|
+
return (summaries ?? [])
|
|
132
|
+
.filter(
|
|
133
|
+
(summary) => summary.pendingDeliveries > 0 && ingestStalledSince(summary, Date.now()) !== null
|
|
134
|
+
)
|
|
135
|
+
.map((summary) => summary.datasetId)
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* What the orchestrator's `runs` pass will do once it starts: runs that lost their job go on, with
|
|
140
|
+
* their side effects, so whoever is upgrading can look at them first.
|
|
141
|
+
*/
|
|
142
|
+
async function lostRunWarnings(
|
|
143
|
+
sixb: LoadedSixbHost,
|
|
144
|
+
storageOk: boolean
|
|
145
|
+
): Promise<readonly string[]> {
|
|
146
|
+
if (!storageOk) return []
|
|
147
|
+
|
|
148
|
+
const counts = await countLostRuns({
|
|
149
|
+
projectId: sixb.id,
|
|
150
|
+
storage: sixb.storage,
|
|
151
|
+
queues: sixb.queues,
|
|
152
|
+
events: sixb.events,
|
|
153
|
+
now: new Date(),
|
|
154
|
+
}).catch(() => [])
|
|
155
|
+
|
|
156
|
+
return counts.flatMap(({ primitive, goOn, end }) => [
|
|
157
|
+
...(goOn > 0
|
|
158
|
+
? [`${goOn} ${primitive} run(s) lost their job and will go on when the orchestrator starts.`]
|
|
159
|
+
: []),
|
|
160
|
+
...(end > 0 ? [`${end} ${primitive} run(s) are too old to go on and will end cancelled.`] : []),
|
|
161
|
+
])
|
|
162
|
+
}
|
|
163
|
+
|
|
90
164
|
interface MarkingsCheck {
|
|
91
165
|
readonly ok: boolean
|
|
92
166
|
readonly warning?: boolean
|
package/src/commands/deploy.ts
CHANGED
|
@@ -10,7 +10,7 @@ import type {
|
|
|
10
10
|
DeployRelease,
|
|
11
11
|
} from "@sixb/core/deploy"
|
|
12
12
|
import { loadDeployConfig } from "../lib/deploy-config"
|
|
13
|
-
import { buildDeployRelease } from "../lib/deploy-release"
|
|
13
|
+
import { buildDeployRelease, lakeWorkChecks } from "../lib/deploy-release"
|
|
14
14
|
import {
|
|
15
15
|
commitHasProjectFile,
|
|
16
16
|
deployer,
|
|
@@ -68,7 +68,13 @@ export async function runDeploy(options: DeployOptions = {}): Promise<void> {
|
|
|
68
68
|
envFromSource,
|
|
69
69
|
})
|
|
70
70
|
if (options.json) return writeJson(release)
|
|
71
|
-
await renderStatic(
|
|
71
|
+
await renderStatic(
|
|
72
|
+
deployReleaseView({
|
|
73
|
+
release,
|
|
74
|
+
configPath: relative(cwd, path) || path,
|
|
75
|
+
warnings: configWarnings(config),
|
|
76
|
+
})
|
|
77
|
+
)
|
|
72
78
|
return
|
|
73
79
|
}
|
|
74
80
|
|
|
@@ -118,6 +124,7 @@ export async function runDeploy(options: DeployOptions = {}): Promise<void> {
|
|
|
118
124
|
release,
|
|
119
125
|
seconds: (Date.now() - deployStartedAt) / 1000,
|
|
120
126
|
keptEnv: progress.state.keptEnv,
|
|
127
|
+
warnings: configWarnings(config),
|
|
121
128
|
})
|
|
122
129
|
)
|
|
123
130
|
}
|
|
@@ -130,9 +137,10 @@ export async function runDeployCheck(options: { readonly json?: boolean; readonl
|
|
|
130
137
|
envFromSource: Boolean((await loadEnvConfig(cwd))?.source),
|
|
131
138
|
})
|
|
132
139
|
const projectPath = await projectPathOf(cwd)
|
|
133
|
-
const
|
|
140
|
+
const targetChecks = await withTask("deploy check", `Checking ${location(config)}`, () =>
|
|
134
141
|
config.target.check(release, { name: config.name, projectPath })
|
|
135
142
|
)
|
|
143
|
+
const checks = [...targetChecks, ...lakeWorkChecks(config)]
|
|
136
144
|
if (options.json) writeJson(checks)
|
|
137
145
|
else
|
|
138
146
|
await renderStatic(deployChecksView({ name: config.name, location: location(config), checks }))
|
|
@@ -300,6 +308,10 @@ async function publicKeys(value: string): Promise<string[]> {
|
|
|
300
308
|
return [value]
|
|
301
309
|
}
|
|
302
310
|
|
|
311
|
+
function configWarnings(config: DeployConfig): readonly string[] {
|
|
312
|
+
return lakeWorkChecks(config).map((check) => `${check.label}: ${check.detail} ${check.remedy}`)
|
|
313
|
+
}
|
|
314
|
+
|
|
303
315
|
function blocksDeploy(check: DeployCheck): boolean {
|
|
304
316
|
return check.status === "fixable" || check.status === "manual"
|
|
305
317
|
}
|
|
@@ -113,6 +113,10 @@ export async function runDevRuntime(options: DevOptions = {}) {
|
|
|
113
113
|
port: topology.apiPort,
|
|
114
114
|
hostname: topology.apiHost,
|
|
115
115
|
quiet: true,
|
|
116
|
+
// The orchestrator this process co-hosts owns it.
|
|
117
|
+
ontologyMaintenance: false,
|
|
118
|
+
// So does the lake worker.
|
|
119
|
+
ingestFlush: false,
|
|
116
120
|
browser: {
|
|
117
121
|
publicOrigin: topology.apiPublicOrigin,
|
|
118
122
|
allowedOrigins: topology.allowedBrowserOrigins,
|
|
@@ -156,6 +160,7 @@ export async function runDevRuntime(options: DevOptions = {}) {
|
|
|
156
160
|
{ type: "pipeline", worker: runtime.pipelineWorker },
|
|
157
161
|
{ type: "workflow", worker: runtime.workflowWorker },
|
|
158
162
|
{ type: "sync", worker: runtime.syncWorker },
|
|
163
|
+
{ type: "lake", worker: runtime.lakeWorker },
|
|
159
164
|
].flatMap(({ type, worker }) => (worker ? [{ type, concurrency: worker.concurrency }] : [])),
|
|
160
165
|
warnings: devApp.warning ? [devApp.warning, ...runtime.warnings] : runtime.warnings,
|
|
161
166
|
}
|