@phi-code-admin/camofox-browser 1.0.1 → 1.0.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.
Files changed (2) hide show
  1. package/lib/plugins.js +5 -2
  2. package/package.json +2 -2
package/lib/plugins.js CHANGED
@@ -60,7 +60,7 @@
60
60
  import { EventEmitter } from 'events';
61
61
  import fs from 'fs';
62
62
  import path from 'path';
63
- import { fileURLToPath } from 'url';
63
+ import { fileURLToPath, pathToFileURL } from 'url';
64
64
 
65
65
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
66
66
  const ROOT_DIR = path.join(__dirname, '..');
@@ -155,7 +155,10 @@ export async function loadPlugins(app, ctx) {
155
155
  }
156
156
 
157
157
  try {
158
- const mod = await import(indexPath);
158
+ // PHI-VENDOR: on Windows, Node's ESM loader refuses raw absolute paths
159
+ // (e.g. "C:\foo\plugin.js") and demands a file:// URL. Convert before
160
+ // calling dynamic import so plugin loading works cross-platform.
161
+ const mod = await import(pathToFileURL(indexPath).href);
159
162
  const register = mod.default || mod.register;
160
163
  if (typeof register !== 'function') {
161
164
  ctx.log('warn', `plugin "${name}" does not export a register function, skipping`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phi-code-admin/camofox-browser",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Phi-code vendored headless browser automation library (snapshot of jo-inc/camofox-browser@c9a90daf, MIT). 10 OpenClaw browser tools exposed as ES module functions; legacy Express server kept opt-in.",
5
5
  "type": "module",
6
6
  "main": "server.js",
@@ -133,7 +133,7 @@
133
133
  "fetch-bin": "node -e \"console.warn('@phi-code-admin/camofox-browser bundles the binary via @phi-code-admin/camoufox-bin-*; no fetch needed. Reinstall if missing.')\""
134
134
  },
135
135
  "dependencies": {
136
- "@phi-code-admin/camoufox-js": "1.0.0",
136
+ "@phi-code-admin/camoufox-js": "1.0.1",
137
137
  "express": "^4.18.2",
138
138
  "playwright-core": "^1.58.0",
139
139
  "prom-client": "^15.1.3",