@sixb/cli 0.1.11 → 0.1.12
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/dist/commands/worker-group.d.ts.map +1 -1
- package/dist/commands/worker.d.ts.map +1 -1
- package/dist/lib/runtime.d.ts.map +1 -1
- package/dist/lib/worker-registry.d.ts +6 -1
- package/dist/lib/worker-registry.d.ts.map +1 -1
- package/package.json +14 -14
- package/src/commands/worker-group.tsx +2 -0
- package/src/commands/worker.tsx +8 -3
- package/src/lib/runtime.ts +5 -8
- package/src/lib/worker-registry.ts +32 -14
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker-group.d.ts","sourceRoot":"","sources":["../../src/commands/worker-group.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"worker-group.d.ts","sourceRoot":"","sources":["../../src/commands/worker-group.tsx"],"names":[],"mappings":"AAsBA,MAAM,WAAW,kBAAkB;IACjC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IAC/B,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAChC;AAED,wBAAsB,cAAc,CAAC,OAAO,GAAE,kBAAuB,iBAsGpE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../../src/commands/worker.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../../src/commands/worker.tsx"],"names":[],"mappings":"AAsBA,MAAM,WAAW,aAAa;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,wBAAsB,SAAS,CAAC,OAAO,GAAE,aAAkB,iBAoF1D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/lib/runtime.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAShD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAA;AAGzD,OAAO,EAGL,kBAAkB,EACnB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAChD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/lib/runtime.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAShD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAA;AAGzD,OAAO,EAGL,kBAAkB,EACnB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,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AkB,CAAC,CAqH7B;AAmBD,wBAAsB,cAAc,CAAC,UAAU,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAuBnF"}
|
|
@@ -46,8 +46,9 @@ export declare function resolveWorkerTypeToStart(requestedWorker?: string): Work
|
|
|
46
46
|
* Why this worker cannot be constructed with these options, or `null` when it can. Exported
|
|
47
47
|
* for `sixb worker`, which has to answer this before it migrates storage.
|
|
48
48
|
*/
|
|
49
|
-
export declare function unmetWorkerRequirement(workerType: string, options: WorkerCreationOptions): string | null;
|
|
49
|
+
export declare function unmetWorkerRequirement(workerType: string, options: WorkerCreationOptions, agentApiRequired: boolean): string | null;
|
|
50
50
|
export interface WorkerGroupInputs {
|
|
51
|
+
readonly agentApiRequired: boolean;
|
|
51
52
|
readonly workerTypes: readonly string[];
|
|
52
53
|
readonly options: WorkerCreationOptions;
|
|
53
54
|
/**
|
|
@@ -64,4 +65,8 @@ export interface WorkerGroupInputs {
|
|
|
64
65
|
*/
|
|
65
66
|
export declare function assertWorkerInputs(input: WorkerGroupInputs): void;
|
|
66
67
|
export declare function resolveRegisteredWorkerTypes(sixb: LoadedSixbHost): readonly WorkerType[];
|
|
68
|
+
/** Explicit model calls can enqueue accounting recovery without a model catalog. */
|
|
69
|
+
export declare function agentWorkerRequired(sixb: LoadedSixbHost): boolean;
|
|
70
|
+
/** Only agent execution needs a sandbox and an API origin; accounting recovery does not. */
|
|
71
|
+
export declare function agentRuntimeRequired(definitions: LoadedSixbHost["definitions"]): boolean;
|
|
67
72
|
//# sourceMappingURL=worker-registry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker-registry.d.ts","sourceRoot":"","sources":["../../src/lib/worker-registry.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAA;AAMzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAGhD,eAAO,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EAAE,CA4BxF;AAsBD,oFAAoF;AACpF,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAIjE;AAED,4FAA4F;AAC5F,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,cAAc,CAAC,aAAa,CAAC,GAAG,OAAO,CAOxF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sixb/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.12",
|
|
4
4
|
"description": "Command-line interface for Sixb projects",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sixb",
|
|
@@ -29,20 +29,20 @@
|
|
|
29
29
|
"prepack": "bun run build"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@sixb/action-worker": "0.1.
|
|
33
|
-
"@sixb/agent-worker": "0.1.
|
|
34
|
-
"@sixb/app": "^0.1.
|
|
35
|
-
"@sixb/atlas": "^0.1.
|
|
36
|
-
"@sixb/client": "^0.1.
|
|
37
|
-
"@sixb/core": "0.1.
|
|
32
|
+
"@sixb/action-worker": "0.1.12",
|
|
33
|
+
"@sixb/agent-worker": "0.1.12",
|
|
34
|
+
"@sixb/app": "^0.1.9",
|
|
35
|
+
"@sixb/atlas": "^0.1.10",
|
|
36
|
+
"@sixb/client": "^0.1.12",
|
|
37
|
+
"@sixb/core": "0.1.12",
|
|
38
38
|
"@sixb/cli-core": "^0.1.5",
|
|
39
|
-
"@sixb/orchestrator": "0.1.
|
|
40
|
-
"@sixb/pipeline-worker": "0.1.
|
|
41
|
-
"@sixb/projection-worker": "0.1.
|
|
42
|
-
"@sixb/rules-worker": "0.1.
|
|
43
|
-
"@sixb/server": "0.1.
|
|
44
|
-
"@sixb/sync-worker": "0.1.
|
|
45
|
-
"@sixb/workflow-worker": "0.1.
|
|
39
|
+
"@sixb/orchestrator": "0.1.12",
|
|
40
|
+
"@sixb/pipeline-worker": "0.1.12",
|
|
41
|
+
"@sixb/projection-worker": "0.1.12",
|
|
42
|
+
"@sixb/rules-worker": "0.1.12",
|
|
43
|
+
"@sixb/server": "0.1.12",
|
|
44
|
+
"@sixb/sync-worker": "0.1.12",
|
|
45
|
+
"@sixb/workflow-worker": "0.1.12",
|
|
46
46
|
"create-sixb": "^0.1.3",
|
|
47
47
|
"ink": "^6.0.0",
|
|
48
48
|
"react": "^19.0.0",
|
|
@@ -11,6 +11,7 @@ import { assertShareableProviders } from "../lib/shareable-providers"
|
|
|
11
11
|
import { migrateStorageForRole } from "../lib/storage-migration"
|
|
12
12
|
import { resolveWorkerConcurrency } from "../lib/worker-concurrency"
|
|
13
13
|
import {
|
|
14
|
+
agentRuntimeRequired,
|
|
14
15
|
assertWorkerInputs,
|
|
15
16
|
createWorkerForType,
|
|
16
17
|
type QueueWorkerProcess,
|
|
@@ -65,6 +66,7 @@ export async function runWorkerGroup(options: WorkerGroupOptions = {}) {
|
|
|
65
66
|
// had taken every other worker down. And before the migration, which used to run first and
|
|
66
67
|
// leave a schema behind on a command that then refused.
|
|
67
68
|
assertWorkerInputs({
|
|
69
|
+
agentApiRequired: agentRuntimeRequired(sixb.definitions),
|
|
68
70
|
workerTypes,
|
|
69
71
|
options: { agentApiBaseUrl: options.apiPublicOrigin },
|
|
70
72
|
autoSelected: requestedTypes.length === 0,
|
package/src/commands/worker.tsx
CHANGED
|
@@ -12,6 +12,7 @@ import { assertShareableProviders } from "../lib/shareable-providers"
|
|
|
12
12
|
import { migrateStorageForRole } from "../lib/storage-migration"
|
|
13
13
|
import { resolveSingleWorkerConcurrency } from "../lib/worker-concurrency"
|
|
14
14
|
import {
|
|
15
|
+
agentRuntimeRequired,
|
|
15
16
|
createWorkerForType,
|
|
16
17
|
type QueueWorkerProcess,
|
|
17
18
|
resolveWorkerTypeToStart,
|
|
@@ -50,9 +51,13 @@ export async function runWorker(options: WorkerOptions = {}) {
|
|
|
50
51
|
|
|
51
52
|
// Before the migration, which is the first thing here that changes something: this used to
|
|
52
53
|
// bring the schema up to date and then refuse to run.
|
|
53
|
-
const unmet = unmetWorkerRequirement(
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
const unmet = unmetWorkerRequirement(
|
|
55
|
+
workerType,
|
|
56
|
+
{
|
|
57
|
+
agentApiBaseUrl: options.apiPublicOrigin,
|
|
58
|
+
},
|
|
59
|
+
agentRuntimeRequired(sixb.definitions)
|
|
60
|
+
)
|
|
56
61
|
if (unmet) {
|
|
57
62
|
throw new SixbCliError(`[SixbCLI] \`sixb worker ${workerType}\` cannot start: it ${unmet}.`)
|
|
58
63
|
}
|
package/src/lib/runtime.ts
CHANGED
|
@@ -24,6 +24,7 @@ import { SyncWorker } from "@sixb/sync-worker"
|
|
|
24
24
|
import { WorkflowWorker } from "@sixb/workflow-worker"
|
|
25
25
|
import type { LoadedSixbHost } from "./loadSixb"
|
|
26
26
|
import type { WorkerConcurrency } from "./worker-registry"
|
|
27
|
+
import { agentRuntimeRequired, agentWorkerRequired } from "./worker-registry"
|
|
27
28
|
|
|
28
29
|
export function waitForWorkerFailure(worker: Worker | null | undefined): Promise<never> {
|
|
29
30
|
return new Promise<never>((_resolve, reject) => {
|
|
@@ -243,15 +244,11 @@ export async function startSixbRuntime(
|
|
|
243
244
|
await actionWorker.start()
|
|
244
245
|
}
|
|
245
246
|
|
|
246
|
-
if (
|
|
247
|
-
(sixb.definitions.models !== undefined ||
|
|
248
|
-
sixb.definitions.workflows
|
|
249
|
-
.list()
|
|
250
|
-
.some((workflow) => workflow.nodes.some((node) => node.type === "agent"))) &&
|
|
251
|
-
sixb.storage.agents
|
|
252
|
-
) {
|
|
247
|
+
if (agentWorkerRequired(sixb)) {
|
|
253
248
|
agentWorker = new AgentWorker(sixb, {
|
|
254
|
-
apiBaseUrl:
|
|
249
|
+
apiBaseUrl: agentRuntimeRequired(sixb.definitions)
|
|
250
|
+
? requireAgentApiBaseUrl(options.agentApiBaseUrl)
|
|
251
|
+
: undefined,
|
|
255
252
|
concurrency: options.workerConcurrency?.agent,
|
|
256
253
|
turnTimeoutMs: options.agentTurnTimeoutMs,
|
|
257
254
|
})
|
|
@@ -56,7 +56,10 @@ interface WorkerFactory {
|
|
|
56
56
|
* A malformed input throws instead of answering: it is one bad value rather than one
|
|
57
57
|
* unsatisfied worker, and the list of workers it took down would say nothing about it.
|
|
58
58
|
*/
|
|
59
|
-
readonly unmetRequirement?: (
|
|
59
|
+
readonly unmetRequirement?: (
|
|
60
|
+
options: WorkerCreationOptions,
|
|
61
|
+
agentApiRequired: boolean
|
|
62
|
+
) => string | null
|
|
60
63
|
}
|
|
61
64
|
|
|
62
65
|
const AGENT_ORIGIN_REQUIRED =
|
|
@@ -73,12 +76,14 @@ const workerFactories: Record<WorkerType, WorkerFactory> = {
|
|
|
73
76
|
agent: {
|
|
74
77
|
create: (sixb, options) =>
|
|
75
78
|
new AgentWorker(sixb, {
|
|
76
|
-
apiBaseUrl:
|
|
79
|
+
apiBaseUrl: agentRuntimeRequired(sixb.definitions)
|
|
80
|
+
? resolveAgentApiBaseUrl(options.agentApiBaseUrl)
|
|
81
|
+
: undefined,
|
|
77
82
|
concurrency: options.workerConcurrency?.agent,
|
|
78
83
|
turnTimeoutMs: options.agentTurnTimeoutMs,
|
|
79
84
|
}),
|
|
80
|
-
unmetRequirement: (options) =>
|
|
81
|
-
agentApiBaseUrl(options.agentApiBaseUrl) ? null : AGENT_ORIGIN_REQUIRED,
|
|
85
|
+
unmetRequirement: (options, agentApiRequired) =>
|
|
86
|
+
!agentApiRequired || agentApiBaseUrl(options.agentApiBaseUrl) ? null : AGENT_ORIGIN_REQUIRED,
|
|
82
87
|
},
|
|
83
88
|
pipeline: {
|
|
84
89
|
create: (sixb, options) =>
|
|
@@ -127,14 +132,16 @@ export function resolveWorkerTypeToStart(requestedWorker?: string): WorkerType {
|
|
|
127
132
|
*/
|
|
128
133
|
export function unmetWorkerRequirement(
|
|
129
134
|
workerType: string,
|
|
130
|
-
options: WorkerCreationOptions
|
|
135
|
+
options: WorkerCreationOptions,
|
|
136
|
+
agentApiRequired: boolean
|
|
131
137
|
): string | null {
|
|
132
138
|
return isWorkerType(workerType)
|
|
133
|
-
? (workerFactories[workerType].unmetRequirement?.(options) ?? null)
|
|
139
|
+
? (workerFactories[workerType].unmetRequirement?.(options, agentApiRequired) ?? null)
|
|
134
140
|
: null
|
|
135
141
|
}
|
|
136
142
|
|
|
137
143
|
export interface WorkerGroupInputs {
|
|
144
|
+
readonly agentApiRequired: boolean
|
|
138
145
|
readonly workerTypes: readonly string[]
|
|
139
146
|
readonly options: WorkerCreationOptions
|
|
140
147
|
/**
|
|
@@ -154,7 +161,7 @@ export function assertWorkerInputs(input: WorkerGroupInputs): void {
|
|
|
154
161
|
const unmet = input.workerTypes
|
|
155
162
|
.map((workerType) => ({
|
|
156
163
|
workerType,
|
|
157
|
-
reason: unmetWorkerRequirement(workerType, input.options),
|
|
164
|
+
reason: unmetWorkerRequirement(workerType, input.options, input.agentApiRequired),
|
|
158
165
|
}))
|
|
159
166
|
.filter((entry): entry is { workerType: string; reason: string } => entry.reason !== null)
|
|
160
167
|
|
|
@@ -200,13 +207,7 @@ export function resolveRegisteredWorkerTypes(sixb: LoadedSixbHost): readonly Wor
|
|
|
200
207
|
workerTypes.push("action")
|
|
201
208
|
}
|
|
202
209
|
|
|
203
|
-
if (
|
|
204
|
-
(sixb.definitions.models !== undefined ||
|
|
205
|
-
sixb.definitions.workflows
|
|
206
|
-
.list()
|
|
207
|
-
.some((workflow) => workflow.nodes.some((node) => node.type === "agent"))) &&
|
|
208
|
-
sixb.storage.agents
|
|
209
|
-
) {
|
|
210
|
+
if (agentWorkerRequired(sixb)) {
|
|
210
211
|
workerTypes.push("agent")
|
|
211
212
|
}
|
|
212
213
|
|
|
@@ -236,3 +237,20 @@ function resolveAgentApiBaseUrl(value: string | undefined): string {
|
|
|
236
237
|
}
|
|
237
238
|
return apiBaseUrl
|
|
238
239
|
}
|
|
240
|
+
|
|
241
|
+
/** Explicit model calls can enqueue accounting recovery without a model catalog. */
|
|
242
|
+
export function agentWorkerRequired(sixb: LoadedSixbHost): boolean {
|
|
243
|
+
const { storage } = sixb
|
|
244
|
+
const canRecoverAccounting = Boolean(storage.aiUsage && storage.aiCosts && storage.aiLimits)
|
|
245
|
+
return canRecoverAccounting || (agentRuntimeRequired(sixb.definitions) && Boolean(storage.agents))
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/** Only agent execution needs a sandbox and an API origin; accounting recovery does not. */
|
|
249
|
+
export function agentRuntimeRequired(definitions: LoadedSixbHost["definitions"]): boolean {
|
|
250
|
+
return (
|
|
251
|
+
definitions.models?.language !== undefined ||
|
|
252
|
+
definitions.workflows
|
|
253
|
+
.list()
|
|
254
|
+
.some((workflow) => workflow.nodes.some((node) => node.type === "agent"))
|
|
255
|
+
)
|
|
256
|
+
}
|