@crewhaus/target-batch-worker 0.2.1 → 0.2.3
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 +25 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -106,6 +106,30 @@ 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
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Section 55 / item 23 — render the `failureTaxonomy` runChatLoop field.
|
|
123
|
+
* Empty when the spec omits the block (mirror: target-cli +
|
|
124
|
+
* target-channel-bot render the same field; keep the pipeline/research/
|
|
125
|
+
* batch/browser copies in sync).
|
|
126
|
+
*/
|
|
127
|
+
function taxonomyField(ir, indent) {
|
|
128
|
+
const taxonomy = ir.failureTaxonomy;
|
|
129
|
+
if (taxonomy === undefined || taxonomy.length === 0)
|
|
130
|
+
return "";
|
|
131
|
+
return `\n${indent}failureTaxonomy: ${JSON.stringify(taxonomy)},`;
|
|
132
|
+
}
|
|
109
133
|
export function emitBatchWorker(ir, opts = {}) {
|
|
110
134
|
if (ir.queue.adapter !== "in-memory") {
|
|
111
135
|
// v0 only ships the in-memory adapter; the others are stubs that
|
|
@@ -218,7 +242,7 @@ async function main(): Promise<void> {
|
|
|
218
242
|
const runContext = createRunContext();
|
|
219
243
|
const reply = await runChatLoop({
|
|
220
244
|
model: SPEC_MODEL,
|
|
221
|
-
instructions: SPEC_INSTRUCTIONS,
|
|
245
|
+
instructions: SPEC_INSTRUCTIONS,${poolField(ir, " ")}${taxonomyField(ir, " ")}
|
|
222
246
|
runContext,
|
|
223
247
|
sessionName: SPEC_NAME,
|
|
224
248
|
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.3",
|
|
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.3",
|
|
19
|
+
"@crewhaus/infra-utils": "0.2.3",
|
|
20
|
+
"@crewhaus/ir": "0.2.3"
|
|
21
21
|
},
|
|
22
22
|
"license": "Apache-2.0",
|
|
23
23
|
"author": {
|