@crewhaus/target-browser-driver 0.1.8 → 0.2.1

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.d.ts CHANGED
@@ -30,9 +30,9 @@
30
30
  * extends these, mirror the change here too.
31
31
  */
32
32
  import { CrewhausError } from "@crewhaus/errors";
33
- import type { Bundle, IrBrowserV0 } from "@crewhaus/ir";
33
+ import { type Bundle, type EmitReadmeOptions, type IrBrowserV0 } from "@crewhaus/ir";
34
34
  export declare class TargetEmitError extends CrewhausError {
35
35
  readonly name = "TargetEmitError";
36
36
  constructor(message: string, cause?: unknown);
37
37
  }
38
- export declare function emitBrowserDriver(ir: IrBrowserV0): Bundle;
38
+ export declare function emitBrowserDriver(ir: IrBrowserV0, opts?: EmitReadmeOptions): Bundle;
package/dist/index.js CHANGED
@@ -31,6 +31,7 @@
31
31
  */
32
32
  import { CrewhausError } from "@crewhaus/errors";
33
33
  import { escapeJsonString } from "@crewhaus/infra-utils";
34
+ import { renderBundleReadme, } from "@crewhaus/ir";
34
35
  export class TargetEmitError extends CrewhausError {
35
36
  name = "TargetEmitError";
36
37
  constructor(message, cause) {
@@ -101,8 +102,14 @@ function resolveTools(toolNames, toolConfigs) {
101
102
  }
102
103
  return { imports, inits, registrations };
103
104
  }
104
- export function emitBrowserDriver(ir) {
105
- return { files: [{ path: "agent.ts", content: renderAgent(ir) }] };
105
+ export function emitBrowserDriver(ir, opts = {}) {
106
+ const files = [{ path: "agent.ts", content: renderAgent(ir) }];
107
+ // Item 42 — generated bundle README; default ON (`crewhaus compile
108
+ // --no-readme` opts out).
109
+ if (opts.readme !== false) {
110
+ files.push({ path: "README.md", content: renderBundleReadme(ir) });
111
+ }
112
+ return { files };
106
113
  }
107
114
  function renderAgent(ir) {
108
115
  const startUrl = ir.driver.startUrl;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crewhaus/target-browser-driver",
3
- "version": "0.1.8",
3
+ "version": "0.2.1",
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.1.8",
19
- "@crewhaus/infra-utils": "0.1.8",
20
- "@crewhaus/ir": "0.1.8"
18
+ "@crewhaus/errors": "0.2.1",
19
+ "@crewhaus/infra-utils": "0.2.1",
20
+ "@crewhaus/ir": "0.2.1"
21
21
  },
22
22
  "license": "Apache-2.0",
23
23
  "author": {