@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.
- package/README.md +18 -3
- 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/db-migrate.d.ts.map +1 -1
- package/dist/commands/deploy.d.ts.map +1 -1
- package/dist/commands/desktop.d.ts +15 -0
- package/dist/commands/desktop.d.ts.map +1 -0
- package/dist/commands/dev-runner.d.ts +4 -0
- package/dist/commands/dev-runner.d.ts.map +1 -1
- package/dist/commands/dev.d.ts.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/lake-check.d.ts.map +1 -1
- package/dist/commands/lake-cleanup.d.ts.map +1 -1
- package/dist/commands/login.d.ts.map +1 -1
- package/dist/commands/logout.d.ts.map +1 -1
- package/dist/commands/orchestrator.d.ts.map +1 -1
- package/dist/commands/profile.d.ts.map +1 -1
- package/dist/commands/rules.d.ts.map +1 -1
- package/dist/commands/scheduler.d.ts.map +1 -1
- package/dist/commands/service-account.d.ts.map +1 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/token.d.ts.map +1 -1
- package/dist/commands/typegen.d.ts.map +1 -1
- package/dist/commands/worker-group.d.ts +2 -0
- package/dist/commands/worker-group.d.ts.map +1 -1
- package/dist/commands/worker.d.ts +2 -0
- package/dist/commands/worker.d.ts.map +1 -1
- package/dist/lib/command-line.d.ts +22 -2
- package/dist/lib/command-line.d.ts.map +1 -1
- package/dist/lib/deploy-release.d.ts +3 -1
- package/dist/lib/deploy-release.d.ts.map +1 -1
- package/dist/lib/desktop.d.ts +26 -0
- package/dist/lib/desktop.d.ts.map +1 -0
- package/dist/lib/dev-messages.d.ts +43 -0
- package/dist/lib/dev-messages.d.ts.map +1 -0
- package/dist/lib/dev-supervisor.d.ts +27 -0
- package/dist/lib/dev-supervisor.d.ts.map +1 -1
- package/dist/lib/open-url.d.ts +3 -0
- package/dist/lib/open-url.d.ts.map +1 -0
- package/dist/lib/role-lifecycle.d.ts.map +1 -1
- package/dist/lib/runtime.d.ts +2 -0
- package/dist/lib/runtime.d.ts.map +1 -1
- package/dist/lib/worker-concurrency.d.ts +11 -0
- package/dist/lib/worker-concurrency.d.ts.map +1 -1
- package/dist/lib/worker-registry.d.ts +2 -0
- package/dist/lib/worker-registry.d.ts.map +1 -1
- package/dist/ui/deploy-screens.d.ts +48 -0
- package/dist/ui/deploy-screens.d.ts.map +1 -0
- package/dist/ui/index.d.ts +28 -244
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/layout.d.ts +65 -0
- package/dist/ui/layout.d.ts.map +1 -0
- package/dist/ui/live/ansi.d.ts +8 -0
- package/dist/ui/live/ansi.d.ts.map +1 -0
- package/dist/ui/live/can-run-live.d.ts +6 -0
- package/dist/ui/live/can-run-live.d.ts.map +1 -0
- package/dist/ui/live/components.d.ts +17 -0
- package/dist/ui/live/components.d.ts.map +1 -0
- package/dist/ui/live/deploy.d.ts +22 -0
- package/dist/ui/live/deploy.d.ts.map +1 -0
- package/dist/ui/live/dev.d.ts +47 -0
- package/dist/ui/live/dev.d.ts.map +1 -0
- package/dist/ui/live/prompt.d.ts +30 -0
- package/dist/ui/live/prompt.d.ts.map +1 -0
- package/dist/ui/live/session.d.ts +27 -0
- package/dist/ui/live/session.d.ts.map +1 -0
- package/dist/ui/screens.d.ts +136 -0
- package/dist/ui/screens.d.ts.map +1 -0
- package/dist/ui/theme.d.ts +58 -0
- package/dist/ui/theme.d.ts.map +1 -0
- package/package.json +19 -18
- package/src/commands/{api.tsx → api.ts} +18 -27
- package/src/commands/{app.tsx → app.ts} +14 -18
- package/src/commands/build.ts +70 -0
- package/src/commands/{check.tsx → check.ts} +27 -18
- package/src/commands/db-migrate.ts +32 -0
- package/src/commands/{deploy.tsx → deploy.ts} +109 -102
- package/src/commands/desktop.ts +71 -0
- package/src/commands/{dev-runner.tsx → dev-runner.ts} +67 -33
- package/src/commands/{init.tsx → init.ts} +19 -8
- package/src/commands/lake-check.ts +36 -0
- package/src/commands/{lake-cleanup.tsx → lake-cleanup.ts} +17 -12
- package/src/commands/{login.tsx → login.ts} +36 -30
- package/src/commands/{logout.tsx → logout.ts} +5 -5
- package/src/commands/{orchestrator.tsx → orchestrator.ts} +15 -28
- package/src/commands/{profile.tsx → profile.ts} +38 -19
- package/src/commands/{rules.tsx → rules.ts} +15 -24
- package/src/commands/{scheduler.tsx → scheduler.ts} +14 -27
- package/src/commands/{service-account.tsx → service-account.ts} +37 -39
- package/src/commands/{status.tsx → status.ts} +8 -8
- package/src/commands/{token.tsx → token.ts} +19 -20
- package/src/commands/typegen.ts +18 -0
- package/src/commands/{worker-group.tsx → worker-group.ts} +40 -29
- package/src/commands/{worker.tsx → worker.ts} +30 -22
- package/src/index.tsx +22 -1
- package/src/lib/command-line.ts +108 -57
- package/src/lib/deploy-release.ts +17 -1
- package/src/lib/desktop.ts +52 -0
- package/src/lib/dev-messages.ts +44 -0
- package/src/lib/dev-supervisor.ts +132 -12
- package/src/lib/open-url.ts +15 -0
- package/src/lib/role-lifecycle.ts +2 -3
- package/src/lib/runtime.ts +4 -0
- package/src/lib/worker-concurrency.ts +31 -0
- package/src/lib/worker-registry.ts +4 -0
- package/src/ui/README.md +54 -0
- package/src/ui/deploy-screens.ts +360 -0
- package/src/ui/index.ts +158 -0
- package/src/ui/layout.ts +245 -0
- package/src/ui/live/ansi.ts +103 -0
- package/src/ui/live/can-run-live.ts +9 -0
- package/src/ui/live/components.tsx +81 -0
- package/src/ui/live/deploy.tsx +170 -0
- package/src/ui/live/dev.tsx +522 -0
- package/src/ui/live/prompt.tsx +205 -0
- package/src/ui/live/session.ts +103 -0
- package/src/ui/screens.ts +490 -0
- package/src/ui/theme.ts +122 -0
- package/dist/lib/role-view.d.ts +0 -21
- package/dist/lib/role-view.d.ts.map +0 -1
- package/src/commands/build.tsx +0 -65
- package/src/commands/db-migrate.tsx +0 -30
- package/src/commands/lake-check.tsx +0 -33
- package/src/commands/typegen.tsx +0 -18
- package/src/lib/role-view.ts +0 -49
- package/src/ui/index.tsx +0 -1398
- /package/src/commands/{dev.tsx → dev.ts} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CliError, createInstanceApiClient, writeJson } from "@sixb/cli-core"
|
|
2
2
|
import { resolveProfile } from "../lib/profiles"
|
|
3
|
-
import {
|
|
3
|
+
import { keyValueResultView, renderStatic } from "../ui"
|
|
4
4
|
|
|
5
5
|
export interface StatusCommandOptions {
|
|
6
6
|
readonly apiUrl?: string
|
|
@@ -62,10 +62,10 @@ async function renderStatus(input: {
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
await renderStatic(
|
|
65
|
-
|
|
66
|
-
title
|
|
67
|
-
titleColor
|
|
68
|
-
items
|
|
65
|
+
keyValueResultView({
|
|
66
|
+
title: input.message ? "Authentication failed" : "Connected",
|
|
67
|
+
titleColor: input.message ? "red" : "green",
|
|
68
|
+
items: [
|
|
69
69
|
...(input.profile ? [{ label: "Profile", value: input.profile }] : []),
|
|
70
70
|
...(input.projectId ? [{ label: "Project", value: input.projectId }] : []),
|
|
71
71
|
{ label: "API", value: input.apiUrl },
|
|
@@ -73,9 +73,9 @@ async function renderStatus(input: {
|
|
|
73
73
|
label: "Authentication",
|
|
74
74
|
value: input.authenticated ? "token" : input.message ? "failed" : "not required",
|
|
75
75
|
},
|
|
76
|
-
]
|
|
77
|
-
message
|
|
78
|
-
|
|
76
|
+
],
|
|
77
|
+
message: input.message,
|
|
78
|
+
})
|
|
79
79
|
)
|
|
80
80
|
}
|
|
81
81
|
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "@sixb/client"
|
|
7
7
|
import { createCliSixbClient, unwrapSixbApiResult } from "../lib/api-client"
|
|
8
8
|
import { resolveProfileApiClientConfig } from "../lib/profile-api-client"
|
|
9
|
-
import {
|
|
9
|
+
import { keyValueResultView, renderStatic, secretResultView, tableResultView } from "../ui"
|
|
10
10
|
import {
|
|
11
11
|
assertSignedIn,
|
|
12
12
|
formatDate,
|
|
@@ -59,20 +59,19 @@ async function listTokens(options: TokenCommandOptions) {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
await renderStatic(
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
rows={result.accessTokens.map((token) => [
|
|
62
|
+
tableResultView({
|
|
63
|
+
subtitle: `${result.accessTokens.length} visible`,
|
|
64
|
+
headers: ["Name", "ID", "Status", "Groups", "Last used", "Expires"],
|
|
65
|
+
rows: result.accessTokens.map((token) => [
|
|
67
66
|
token.name,
|
|
68
67
|
token.id,
|
|
69
68
|
token.status,
|
|
70
69
|
formatGroups(token.groupIds),
|
|
71
70
|
formatDate(token.lastUsedAt),
|
|
72
71
|
formatDate(token.expiresAt),
|
|
73
|
-
])
|
|
74
|
-
emptyMessage
|
|
75
|
-
|
|
72
|
+
]),
|
|
73
|
+
emptyMessage: "No personal access tokens.",
|
|
74
|
+
})
|
|
76
75
|
)
|
|
77
76
|
}
|
|
78
77
|
|
|
@@ -104,16 +103,16 @@ async function createToken(options: TokenCommandOptions) {
|
|
|
104
103
|
}
|
|
105
104
|
|
|
106
105
|
await renderStatic(
|
|
107
|
-
|
|
108
|
-
title
|
|
109
|
-
items
|
|
106
|
+
secretResultView({
|
|
107
|
+
title: "Created personal access token",
|
|
108
|
+
items: [
|
|
110
109
|
{ label: "Name", value: result.accessToken.name },
|
|
111
110
|
{ label: "ID", value: result.accessToken.id },
|
|
112
111
|
{ label: "Expires", value: formatDate(result.accessToken.expiresAt) },
|
|
113
112
|
{ label: "Groups", value: formatGroups(result.accessToken.groupIds) },
|
|
114
|
-
]
|
|
115
|
-
secret
|
|
116
|
-
|
|
113
|
+
],
|
|
114
|
+
secret: result.tokenValue,
|
|
115
|
+
})
|
|
117
116
|
)
|
|
118
117
|
}
|
|
119
118
|
|
|
@@ -137,13 +136,13 @@ async function revokeToken(options: TokenCommandOptions) {
|
|
|
137
136
|
}
|
|
138
137
|
|
|
139
138
|
await renderStatic(
|
|
140
|
-
|
|
141
|
-
title
|
|
142
|
-
items
|
|
139
|
+
keyValueResultView({
|
|
140
|
+
title: "Revoked personal access token",
|
|
141
|
+
items: [
|
|
143
142
|
{ label: "Name", value: result.accessToken.name },
|
|
144
143
|
{ label: "ID", value: result.accessToken.id },
|
|
145
144
|
{ label: "Status", value: result.accessToken.status },
|
|
146
|
-
]
|
|
147
|
-
|
|
145
|
+
],
|
|
146
|
+
})
|
|
148
147
|
)
|
|
149
148
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { generateProjectTypes } from "../lib/typegen"
|
|
2
|
+
import { renderStatic, typegenView, withTask } from "../ui"
|
|
3
|
+
|
|
4
|
+
export interface TypegenOptions {
|
|
5
|
+
entry?: string
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export async function runTypegen(options: TypegenOptions = {}) {
|
|
9
|
+
const result = await withTask("typegen", "Generating types", () => generateProjectTypes(options))
|
|
10
|
+
await renderStatic(
|
|
11
|
+
typegenView({
|
|
12
|
+
path: result.path,
|
|
13
|
+
objectTypes: result.entries.length,
|
|
14
|
+
skipped: result.skipped,
|
|
15
|
+
written: result.written,
|
|
16
|
+
})
|
|
17
|
+
)
|
|
18
|
+
}
|
|
@@ -5,7 +5,11 @@ import { runUntilSignal, stopQuietly } from "../lib/role-lifecycle"
|
|
|
5
5
|
import { recordApiPublicOrigin, stopSixbProviders, waitForWorkerFailure } from "../lib/runtime"
|
|
6
6
|
import { assertShareableProviders } from "../lib/shareable-providers"
|
|
7
7
|
import { migrateStorageForRole } from "../lib/storage-migration"
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
resolveSubagentConcurrency,
|
|
10
|
+
resolveVectorConcurrency,
|
|
11
|
+
resolveWorkerConcurrency,
|
|
12
|
+
} from "../lib/worker-concurrency"
|
|
9
13
|
import {
|
|
10
14
|
agentRuntimeRequired,
|
|
11
15
|
assertWorkerInputs,
|
|
@@ -14,7 +18,14 @@ import {
|
|
|
14
18
|
resolveRegisteredWorkerTypes,
|
|
15
19
|
resolveWorkerTypeToStart,
|
|
16
20
|
} from "../lib/worker-registry"
|
|
17
|
-
import {
|
|
21
|
+
import {
|
|
22
|
+
printStopping,
|
|
23
|
+
renderCliError,
|
|
24
|
+
renderStatic,
|
|
25
|
+
roleView,
|
|
26
|
+
startTask,
|
|
27
|
+
workerItems,
|
|
28
|
+
} from "../ui"
|
|
18
29
|
|
|
19
30
|
export interface WorkerGroupOptions {
|
|
20
31
|
entry?: string
|
|
@@ -24,6 +35,8 @@ export interface WorkerGroupOptions {
|
|
|
24
35
|
agentTurnTimeout?: string
|
|
25
36
|
concurrency?: readonly string[]
|
|
26
37
|
vectorConcurrency?: string
|
|
38
|
+
subagentConcurrency?: string
|
|
39
|
+
subagentConcurrencyPerRun?: string
|
|
27
40
|
}
|
|
28
41
|
|
|
29
42
|
export async function runWorkerGroup(options: WorkerGroupOptions = {}) {
|
|
@@ -35,11 +48,13 @@ export async function runWorkerGroup(options: WorkerGroupOptions = {}) {
|
|
|
35
48
|
const agentTurnTimeoutMs = resolveAgentTurnTimeoutMs(options.agentTurnTimeout)
|
|
36
49
|
const workerConcurrency = resolveWorkerConcurrency(options.concurrency)
|
|
37
50
|
const vectorConcurrency = resolveVectorConcurrency(options.vectorConcurrency)
|
|
51
|
+
const subagents = resolveSubagentConcurrency({
|
|
52
|
+
perWorker: options.subagentConcurrency,
|
|
53
|
+
perRun: options.subagentConcurrencyPerRun,
|
|
54
|
+
})
|
|
38
55
|
const entry = await resolveRuntimeEntry({ entry: options.entry })
|
|
39
56
|
|
|
40
|
-
const app =
|
|
41
|
-
<LoadingView title="Starting sixb worker group" subtitle={entry} status="Loading runtime" />
|
|
42
|
-
)
|
|
57
|
+
const app = startTask("worker-group", "Loading runtime")
|
|
43
58
|
|
|
44
59
|
let sixb: LoadedSixbHost | null = null
|
|
45
60
|
let workers: QueueWorkerProcess[] = []
|
|
@@ -74,19 +89,10 @@ export async function runWorkerGroup(options: WorkerGroupOptions = {}) {
|
|
|
74
89
|
const migration = await migrateStorageForRole(sixb, {
|
|
75
90
|
role: "worker-group",
|
|
76
91
|
noMigrate: options.noMigrate,
|
|
77
|
-
onStart: () =>
|
|
78
|
-
app.rerender(
|
|
79
|
-
<LoadingView
|
|
80
|
-
title="Starting sixb worker group"
|
|
81
|
-
subtitle={entry}
|
|
82
|
-
status="Migrating storage"
|
|
83
|
-
/>
|
|
84
|
-
),
|
|
92
|
+
onStart: () => app.step("Migrating storage"),
|
|
85
93
|
})
|
|
86
94
|
|
|
87
|
-
app.
|
|
88
|
-
<LoadingView title="Starting sixb worker group" subtitle={entry} status="Starting workers" />
|
|
89
|
-
)
|
|
95
|
+
app.step("Starting workers")
|
|
90
96
|
|
|
91
97
|
const host = sixb
|
|
92
98
|
workers = workerTypes.map((workerType) =>
|
|
@@ -95,6 +101,7 @@ export async function runWorkerGroup(options: WorkerGroupOptions = {}) {
|
|
|
95
101
|
agentTurnTimeoutMs,
|
|
96
102
|
workerConcurrency,
|
|
97
103
|
vectorConcurrency,
|
|
104
|
+
...subagents,
|
|
98
105
|
})
|
|
99
106
|
)
|
|
100
107
|
await Promise.all(workers.map((worker) => worker.start()))
|
|
@@ -104,29 +111,33 @@ export async function runWorkerGroup(options: WorkerGroupOptions = {}) {
|
|
|
104
111
|
? ["No queue worker types are registered; the worker group process is idle."]
|
|
105
112
|
: []
|
|
106
113
|
|
|
107
|
-
app.
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
114
|
+
app.stop()
|
|
115
|
+
await renderStatic(
|
|
116
|
+
roleView({
|
|
117
|
+
command: "worker-group",
|
|
118
|
+
name: sixb.id,
|
|
119
|
+
items: workerItems(
|
|
120
|
+
workerTypes.map((workerType, index) => ({
|
|
121
|
+
type: workerType,
|
|
122
|
+
concurrency: workers[index]?.concurrency ?? 1,
|
|
123
|
+
}))
|
|
124
|
+
),
|
|
125
|
+
storage: migration.summary,
|
|
126
|
+
warnings,
|
|
127
|
+
})
|
|
117
128
|
)
|
|
118
129
|
|
|
119
130
|
await Promise.race([
|
|
120
131
|
runUntilSignal(async () => {
|
|
121
|
-
app.
|
|
122
|
-
|
|
132
|
+
app.stop()
|
|
133
|
+
printStopping("worker-group")
|
|
123
134
|
await stopWorkersAndProviders()
|
|
124
135
|
sixb = null
|
|
125
136
|
}),
|
|
126
137
|
...workers.map(waitForWorkerFailure),
|
|
127
138
|
])
|
|
128
139
|
} catch (error) {
|
|
129
|
-
app.
|
|
140
|
+
app.stop()
|
|
130
141
|
await stopWorkersAndProviders()
|
|
131
142
|
await renderCliError(error)
|
|
132
143
|
process.exit(1)
|
|
@@ -6,7 +6,11 @@ import { runUntilSignal, stopQuietly } from "../lib/role-lifecycle"
|
|
|
6
6
|
import { recordApiPublicOrigin, stopSixbProviders, waitForWorkerFailure } from "../lib/runtime"
|
|
7
7
|
import { assertShareableProviders } from "../lib/shareable-providers"
|
|
8
8
|
import { migrateStorageForRole } from "../lib/storage-migration"
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
resolveSingleWorkerConcurrency,
|
|
11
|
+
resolveSubagentConcurrency,
|
|
12
|
+
resolveVectorConcurrency,
|
|
13
|
+
} from "../lib/worker-concurrency"
|
|
10
14
|
import {
|
|
11
15
|
agentRuntimeRequired,
|
|
12
16
|
createWorkerForType,
|
|
@@ -14,7 +18,7 @@ import {
|
|
|
14
18
|
resolveWorkerTypeToStart,
|
|
15
19
|
unmetWorkerRequirement,
|
|
16
20
|
} from "../lib/worker-registry"
|
|
17
|
-
import {
|
|
21
|
+
import { printStopping, renderCliError, renderStatic, roleView, startTask } from "../ui"
|
|
18
22
|
|
|
19
23
|
export interface WorkerOptions {
|
|
20
24
|
entry?: string
|
|
@@ -24,6 +28,8 @@ export interface WorkerOptions {
|
|
|
24
28
|
agentTurnTimeout?: string
|
|
25
29
|
concurrency?: string
|
|
26
30
|
vectorConcurrency?: string
|
|
31
|
+
subagentConcurrency?: string
|
|
32
|
+
subagentConcurrencyPerRun?: string
|
|
27
33
|
}
|
|
28
34
|
|
|
29
35
|
export async function runWorker(options: WorkerOptions = {}) {
|
|
@@ -33,11 +39,13 @@ export async function runWorker(options: WorkerOptions = {}) {
|
|
|
33
39
|
const agentTurnTimeoutMs = resolveAgentTurnTimeoutMs(options.agentTurnTimeout)
|
|
34
40
|
const workerConcurrency = resolveSingleWorkerConcurrency(workerType, options.concurrency)
|
|
35
41
|
const vectorConcurrency = resolveVectorConcurrency(options.vectorConcurrency)
|
|
42
|
+
const subagents = resolveSubagentConcurrency({
|
|
43
|
+
perWorker: options.subagentConcurrency,
|
|
44
|
+
perRun: options.subagentConcurrencyPerRun,
|
|
45
|
+
})
|
|
36
46
|
const entry = await resolveRuntimeEntry({ entry: options.entry })
|
|
37
47
|
|
|
38
|
-
const app =
|
|
39
|
-
<LoadingView title="Starting sixb worker" subtitle={entry} status="Loading runtime" />
|
|
40
|
-
)
|
|
48
|
+
const app = startTask("worker", "Loading runtime")
|
|
41
49
|
|
|
42
50
|
let sixb: LoadedSixbHost | null = null
|
|
43
51
|
let worker: QueueWorkerProcess | null = null
|
|
@@ -64,38 +72,38 @@ export async function runWorker(options: WorkerOptions = {}) {
|
|
|
64
72
|
const migration = await migrateStorageForRole(sixb, {
|
|
65
73
|
role: "worker",
|
|
66
74
|
noMigrate: options.noMigrate,
|
|
67
|
-
onStart: () =>
|
|
68
|
-
app.rerender(
|
|
69
|
-
<LoadingView title="Starting sixb worker" subtitle={entry} status="Migrating storage" />
|
|
70
|
-
),
|
|
75
|
+
onStart: () => app.step("Migrating storage"),
|
|
71
76
|
})
|
|
72
77
|
|
|
73
|
-
app.
|
|
74
|
-
<LoadingView title="Starting sixb worker" subtitle={entry} status="Starting worker" />
|
|
75
|
-
)
|
|
78
|
+
app.step("Starting worker")
|
|
76
79
|
|
|
77
80
|
worker = createWorkerForType(sixb, workerType, {
|
|
78
81
|
agentApiBaseUrl: options.apiPublicOrigin,
|
|
79
82
|
agentTurnTimeoutMs,
|
|
80
83
|
workerConcurrency,
|
|
81
84
|
vectorConcurrency,
|
|
85
|
+
...subagents,
|
|
82
86
|
})
|
|
83
87
|
await worker.start()
|
|
84
88
|
|
|
85
89
|
const workerId = `${workerType}-worker-${sixb.id}`
|
|
86
|
-
app.
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
90
|
+
app.stop()
|
|
91
|
+
await renderStatic(
|
|
92
|
+
roleView({
|
|
93
|
+
command: `worker ${workerType}`,
|
|
94
|
+
name: sixb.id,
|
|
95
|
+
items: [
|
|
96
|
+
{ label: "worker", value: workerId },
|
|
97
|
+
{ label: "concurrency", value: String(worker.concurrency) },
|
|
98
|
+
],
|
|
99
|
+
storage: migration.summary,
|
|
100
|
+
})
|
|
93
101
|
)
|
|
94
102
|
|
|
95
103
|
await Promise.race([
|
|
96
104
|
runUntilSignal(async () => {
|
|
97
|
-
app.
|
|
98
|
-
|
|
105
|
+
app.stop()
|
|
106
|
+
printStopping("worker")
|
|
99
107
|
await stopQuietly(() => worker?.stop() ?? Promise.resolve())
|
|
100
108
|
if (sixb) {
|
|
101
109
|
await stopSixbProviders(sixb)
|
|
@@ -105,7 +113,7 @@ export async function runWorker(options: WorkerOptions = {}) {
|
|
|
105
113
|
waitForWorkerFailure(worker),
|
|
106
114
|
])
|
|
107
115
|
} catch (error) {
|
|
108
|
-
app.
|
|
116
|
+
app.stop()
|
|
109
117
|
await stopQuietly(() => worker?.stop() ?? Promise.resolve())
|
|
110
118
|
if (sixb) {
|
|
111
119
|
await stopSixbProviders(sixb)
|
package/src/index.tsx
CHANGED
|
@@ -87,6 +87,9 @@ async function main(): Promise<void> {
|
|
|
87
87
|
return
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
+
// Plain strings, no renderer: cheap enough to load for every command.
|
|
91
|
+
const { setCommandPath } = await import("./ui/layout")
|
|
92
|
+
setCommandPath(parsed.path)
|
|
90
93
|
const { options, positionals } = parsed
|
|
91
94
|
const getFlag = (name: CliOptionName) => stringOption(options, name)
|
|
92
95
|
const getFlags = (name: CliOptionName) => repeatedOption(options, name)
|
|
@@ -106,6 +109,9 @@ async function main(): Promise<void> {
|
|
|
106
109
|
agentTurnTimeout: getFlag("agent-turn-timeout"),
|
|
107
110
|
concurrency: getFlags("concurrency"),
|
|
108
111
|
vectorConcurrency: getFlag("vector-concurrency"),
|
|
112
|
+
subagentConcurrency: getFlag("subagent-concurrency"),
|
|
113
|
+
subagentConcurrencyPerRun: getFlag("subagent-concurrency-per-run"),
|
|
114
|
+
desktop: hasFlag("desktop"),
|
|
109
115
|
})
|
|
110
116
|
break
|
|
111
117
|
}
|
|
@@ -120,6 +126,8 @@ async function main(): Promise<void> {
|
|
|
120
126
|
agentTurnTimeout: getFlag("agent-turn-timeout"),
|
|
121
127
|
concurrency: getFlag("concurrency"),
|
|
122
128
|
vectorConcurrency: getFlag("vector-concurrency"),
|
|
129
|
+
subagentConcurrency: getFlag("subagent-concurrency"),
|
|
130
|
+
subagentConcurrencyPerRun: getFlag("subagent-concurrency-per-run"),
|
|
123
131
|
})
|
|
124
132
|
break
|
|
125
133
|
}
|
|
@@ -134,6 +142,8 @@ async function main(): Promise<void> {
|
|
|
134
142
|
agentTurnTimeout: getFlag("agent-turn-timeout"),
|
|
135
143
|
concurrency: getFlags("concurrency"),
|
|
136
144
|
vectorConcurrency: getFlag("vector-concurrency"),
|
|
145
|
+
subagentConcurrency: getFlag("subagent-concurrency"),
|
|
146
|
+
subagentConcurrencyPerRun: getFlag("subagent-concurrency-per-run"),
|
|
137
147
|
})
|
|
138
148
|
break
|
|
139
149
|
}
|
|
@@ -287,6 +297,15 @@ async function main(): Promise<void> {
|
|
|
287
297
|
break
|
|
288
298
|
}
|
|
289
299
|
|
|
300
|
+
case "desktop:build": {
|
|
301
|
+
const { runDesktopBuild } = await import("./commands/desktop")
|
|
302
|
+
await runDesktopBuild({
|
|
303
|
+
apiPublicOrigin: getFlag("api-public-origin"),
|
|
304
|
+
appPublicOrigin: getFlag("app-public-origin"),
|
|
305
|
+
})
|
|
306
|
+
break
|
|
307
|
+
}
|
|
308
|
+
|
|
290
309
|
case "db:prepare": {
|
|
291
310
|
const { runDbPrepare } = await import("./commands/db-prepare")
|
|
292
311
|
await runDbPrepare({ entry: getFlag("entry") })
|
|
@@ -395,9 +414,11 @@ main().catch(async (error) => {
|
|
|
395
414
|
if (wantsManagementJson(args)) {
|
|
396
415
|
process.stderr.write(`${JSON.stringify({ error: cliErrorBody(error) })}\n`)
|
|
397
416
|
} else {
|
|
398
|
-
// Loaded on demand
|
|
417
|
+
// Loaded on demand: a command that succeeds never needs it.
|
|
399
418
|
const { renderCliError, renderHelp } = await import("./ui")
|
|
400
419
|
if (error instanceof CliUsageError) await renderHelp(error.help, error.message)
|
|
420
|
+
// Backing out of a prompt is an answer, not a failure to explain.
|
|
421
|
+
else if (error instanceof Error && error.name === "PromptCancelledError") process.exit(130)
|
|
401
422
|
else await renderCliError(error)
|
|
402
423
|
}
|
|
403
424
|
process.exit(exitCode)
|