@crewhaus/target-browser-driver 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
|
@@ -102,6 +102,30 @@ function resolveTools(toolNames, toolConfigs) {
|
|
|
102
102
|
}
|
|
103
103
|
return { imports, inits, registrations };
|
|
104
104
|
}
|
|
105
|
+
/**
|
|
106
|
+
* Adaptive model routing — render the `modelPool` runChatLoop field.
|
|
107
|
+
* JSON.stringify safely quotes the validated pool object (mirroring
|
|
108
|
+
* target-cli's renderModelFailoverFields; keep the pipeline/research/batch/
|
|
109
|
+
* browser copies in sync). Empty when the spec omits `model_pool`, keeping
|
|
110
|
+
* bundles byte-identical.
|
|
111
|
+
*/
|
|
112
|
+
function poolField(ir, indent) {
|
|
113
|
+
return ir.agent.modelPool !== undefined
|
|
114
|
+
? `\n${indent}modelPool: ${JSON.stringify(ir.agent.modelPool)},`
|
|
115
|
+
: "";
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Section 55 / item 23 — render the `failureTaxonomy` runChatLoop field.
|
|
119
|
+
* Empty when the spec omits the block (mirror: target-cli +
|
|
120
|
+
* target-channel-bot render the same field; keep the pipeline/research/
|
|
121
|
+
* batch/browser copies in sync).
|
|
122
|
+
*/
|
|
123
|
+
function taxonomyField(ir, indent) {
|
|
124
|
+
const taxonomy = ir.failureTaxonomy;
|
|
125
|
+
if (taxonomy === undefined || taxonomy.length === 0)
|
|
126
|
+
return "";
|
|
127
|
+
return `\n${indent}failureTaxonomy: ${JSON.stringify(taxonomy)},`;
|
|
128
|
+
}
|
|
105
129
|
export function emitBrowserDriver(ir, opts = {}) {
|
|
106
130
|
const files = [{ path: "agent.ts", content: renderAgent(ir) }];
|
|
107
131
|
// Item 42 — generated bundle README; default ON (`crewhaus compile
|
|
@@ -188,7 +212,7 @@ async function main(): Promise<void> {
|
|
|
188
212
|
try {
|
|
189
213
|
finalText = await runChatLoop({
|
|
190
214
|
model: SPEC_MODEL,
|
|
191
|
-
instructions: SPEC_INSTRUCTIONS,
|
|
215
|
+
instructions: SPEC_INSTRUCTIONS,${poolField(ir, " ")}${taxonomyField(ir, " ")}
|
|
192
216
|
runContext,
|
|
193
217
|
sessionName: SPEC_NAME,
|
|
194
218
|
sessionTarget: "browser",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crewhaus/target-browser-driver",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Codegen for the BROW target — emits a single agent.ts that boots a chromium driver + vision-grounding tools (Section 25 BROW)",
|
|
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": {
|