@jini-ai/diagnostics 0.6.10 → 0.6.11

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/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @jini-ai/diagnostics
2
2
 
3
+ ## 0.6.11
4
+
5
+ ### Patch Changes
6
+
7
+ - Tool inputs apply a sole near-miss and declared input aliases; plugin-load outcomes are reported; `web_fetch` reads SVG/JS as text; `content_read` suggests its resource first; the browser falls back to system Chrome.
8
+ - Updated dependencies
9
+ - Updated dependencies
10
+ - @jini-ai/core@0.6.11
11
+
3
12
  ## 0.6.10
4
13
 
5
14
  ### Patch Changes
@@ -6,12 +6,12 @@
6
6
  * Why the import is dynamic, and why the module's types are declared here
7
7
  * ---------------------------------------------------------------------------
8
8
  * The host may optionally install `playwright`; this package adds no browser dependency. The BROWSER
9
- * BINARY it drives needs a separate `playwright install chromium` step in the host deployment.
10
- * Installing the module alone does not supply that binary. So both halves can
9
+ * BINARY it drives needs a separate `playwright install chromium` step or an installed system
10
+ * Chrome. Installing the module alone does not supply either binary. So both halves can
11
11
  * legitimately be missing at runtime, independently:
12
12
  *
13
13
  * - the module itself, on a deployment that pruned it;
14
- * - the Chromium binary, on a deployment that installed the module but not the browser.
14
+ * - both browser binaries, on a deployment that installed the module but neither browser.
15
15
  *
16
16
  * Both are caught here and converted into `{ available: false, reason }`, never a thrown error and
17
17
  * never a boot failure. The tool then reports "no browser in this deployment" and the compliance
@@ -51,6 +51,7 @@ export interface PlaywrightLike {
51
51
  headless?: boolean;
52
52
  args?: readonly string[];
53
53
  chromiumSandbox?: boolean;
54
+ channel?: "chrome";
54
55
  }): Promise<RenderBrowser>;
55
56
  };
56
57
  }
@@ -59,9 +60,9 @@ export interface PlaywrightLike {
59
60
  * deployment cannot.
60
61
  *
61
62
  * @returns `{ available: true, browser }` on success; `{ available: false, reason }` when the
62
- * `playwright` module or its Chromium binary is not present. Never throws for either case — see
63
+ * `playwright` module or both Chromium and system Chrome are unavailable. Never throws for either case — see
63
64
  * this file's header for why an absent browser must be a reportable state rather than an error.
64
- * @complexity One process launch. The caller is responsible for calling `close()`, which
65
+ * @complexity At most two process launch attempts. The caller is responsible for calling `close()`, which
65
66
  * `collectPageEvidence` does in a `finally`.
66
67
  */
67
68
  export interface PlaywrightAdapterOptions {
@@ -84,7 +85,9 @@ export interface PlaywrightAdapterOptions {
84
85
  /** Default {@link PlaywrightAdapterOptions.moduleLoader}: a real dynamic import by module name, wired
85
86
  * here at the composition edge so the optional `playwright` dependency is only resolved on use. */
86
87
  export declare const nodeModuleLoader: NonNullable<PlaywrightAdapterOptions["moduleLoader"]>;
87
- /** Opens the optional browser capability; import and launch failures become availability results. */
88
+ /** Opens bundled Chromium, then system Chrome; import/launch failures become availability results.
89
+ * Launch policy is retained on both attempts; successful process ownership transfers to the caller.
90
+ * @complexity At most two launches, O(1) retained state. */
88
91
  export declare function openPlaywrightRenderBrowser(_required: Record<string, never>, options?: PlaywrightAdapterOptions): Promise<{
89
92
  available: true;
90
93
  browser: RenderBrowser;
@@ -3,7 +3,9 @@
3
3
  export const nodeModuleLoader = {
4
4
  load: async ({ moduleName }) => (await import(moduleName)),
5
5
  };
6
- /** Opens the optional browser capability; import and launch failures become availability results. */
6
+ /** Opens bundled Chromium, then system Chrome; import/launch failures become availability results.
7
+ * Launch policy is retained on both attempts; successful process ownership transfers to the caller.
8
+ * @complexity At most two launches, O(1) retained state. */
7
9
  // A successful launch transfers process ownership to the caller; close the browser in a finally
8
10
  // block so an unreachable or unstable page cannot leak the browser process.
9
11
  export async function openPlaywrightRenderBrowser(_required, options = {}) {
@@ -21,13 +23,19 @@ export async function openPlaywrightRenderBrowser(_required, options = {}) {
21
23
  }
22
24
  let browser;
23
25
  try {
24
- browser = await playwright.chromium.launch({ headless: true, ...options.launchOptions });
26
+ try {
27
+ browser = await playwright.chromium.launch({ headless: true, ...options.launchOptions });
28
+ }
29
+ catch {
30
+ // Desktop retains the driver but omits browser downloads. Keep the same sandbox/network policy.
31
+ browser = await playwright.chromium.launch({ headless: true, ...options.launchOptions, channel: "chrome" });
32
+ }
25
33
  }
26
34
  catch (error) {
27
35
  return {
28
36
  available: false,
29
- reason: "Chromium could not be launched in this deployment — the 'playwright' package is present but its " +
30
- `browser binary may be missing or the host may not support the configured sandbox (run 'npx playwright install --with-deps chromium'). Underlying error: ${error instanceof Error ? error.message : String(error)}`,
37
+ reason: "Neither bundled Chromium nor system Chrome could be launched in this deployment — the 'playwright' package is present but the " +
38
+ `browser binaries may be missing or the host may not support the configured sandbox (install Chrome or run 'npx playwright install --with-deps chromium'). Underlying error: ${error instanceof Error ? error.message : String(error)}`,
31
39
  };
32
40
  }
33
41
  return { available: true, browser };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jini-ai/diagnostics",
3
- "version": "0.6.10",
3
+ "version": "0.6.11",
4
4
  "description": "Diagnostics-bundle tooling: JSON/text secret redaction, log-source collection, manifest building, and zip packaging for support exports.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -82,11 +82,11 @@
82
82
  "devDependencies": {
83
83
  "@vitest/coverage-v8": "^2.1.9",
84
84
  "jszip": "^3.10.1",
85
- "@jini-ai/core": "^0.6.10"
85
+ "@jini-ai/core": "^0.6.11"
86
86
  },
87
87
  "dependencies": {
88
88
  "js-tokens": "^9.0.1",
89
- "@jini-ai/core": "^0.6.10"
89
+ "@jini-ai/core": "^0.6.11"
90
90
  },
91
91
  "peerDependencies": {
92
92
  "jszip": "^3.10.1"