@crewhaus/target-batch-worker 0.2.1 → 0.2.2
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/index.js +13 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -106,6 +106,18 @@ function renderPermissionsField(ir) {
|
|
|
106
106
|
}
|
|
107
107
|
return `\n${lines.join("\n")}`;
|
|
108
108
|
}
|
|
109
|
+
/**
|
|
110
|
+
* Adaptive model routing — render the `modelPool` runChatLoop field.
|
|
111
|
+
* JSON.stringify safely quotes the validated pool object (mirroring
|
|
112
|
+
* target-cli's renderModelFailoverFields; keep the pipeline/research/batch/
|
|
113
|
+
* browser copies in sync). Empty when the spec omits `model_pool`, keeping
|
|
114
|
+
* bundles byte-identical.
|
|
115
|
+
*/
|
|
116
|
+
function poolField(ir, indent) {
|
|
117
|
+
return ir.agent.modelPool !== undefined
|
|
118
|
+
? `\n${indent}modelPool: ${JSON.stringify(ir.agent.modelPool)},`
|
|
119
|
+
: "";
|
|
120
|
+
}
|
|
109
121
|
export function emitBatchWorker(ir, opts = {}) {
|
|
110
122
|
if (ir.queue.adapter !== "in-memory") {
|
|
111
123
|
// v0 only ships the in-memory adapter; the others are stubs that
|
|
@@ -218,7 +230,7 @@ async function main(): Promise<void> {
|
|
|
218
230
|
const runContext = createRunContext();
|
|
219
231
|
const reply = await runChatLoop({
|
|
220
232
|
model: SPEC_MODEL,
|
|
221
|
-
instructions: SPEC_INSTRUCTIONS,
|
|
233
|
+
instructions: SPEC_INSTRUCTIONS,${poolField(ir, " ")}
|
|
222
234
|
runContext,
|
|
223
235
|
sessionName: SPEC_NAME,
|
|
224
236
|
sessionTarget: "batch",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crewhaus/target-batch-worker",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Codegen for the BATCH target — emits a queue-consumer daemon (Section 23 BATCH)",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
"test": "bun test src"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@crewhaus/errors": "0.2.
|
|
19
|
-
"@crewhaus/infra-utils": "0.2.
|
|
20
|
-
"@crewhaus/ir": "0.2.
|
|
18
|
+
"@crewhaus/errors": "0.2.2",
|
|
19
|
+
"@crewhaus/infra-utils": "0.2.2",
|
|
20
|
+
"@crewhaus/ir": "0.2.2"
|
|
21
21
|
},
|
|
22
22
|
"license": "Apache-2.0",
|
|
23
23
|
"author": {
|