@crewhaus/target-browser-driver 0.2.0 → 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
|
@@ -102,6 +102,18 @@ 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
|
+
}
|
|
105
117
|
export function emitBrowserDriver(ir, opts = {}) {
|
|
106
118
|
const files = [{ path: "agent.ts", content: renderAgent(ir) }];
|
|
107
119
|
// Item 42 — generated bundle README; default ON (`crewhaus compile
|
|
@@ -188,7 +200,7 @@ async function main(): Promise<void> {
|
|
|
188
200
|
try {
|
|
189
201
|
finalText = await runChatLoop({
|
|
190
202
|
model: SPEC_MODEL,
|
|
191
|
-
instructions: SPEC_INSTRUCTIONS,
|
|
203
|
+
instructions: SPEC_INSTRUCTIONS,${poolField(ir, " ")}
|
|
192
204
|
runContext,
|
|
193
205
|
sessionName: SPEC_NAME,
|
|
194
206
|
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.2",
|
|
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.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": {
|