hypha-debugger 0.2.9 → 0.3.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/bookmarklet.txt +1 -0
- package/dist/hypha-debugger.js +79 -35
- package/dist/hypha-debugger.min.js +4 -4
- package/dist/hypha-debugger.mjs +76 -32
- package/dist/hypha-debugger.mjs.map +1 -1
- package/dist/hypha-debugger.slim.min.js +1 -0
- package/dist/utils/wrap-fn.d.ts +6 -4
- package/package.json +3 -1
package/dist/utils/wrap-fn.d.ts
CHANGED
|
@@ -2,13 +2,15 @@
|
|
|
2
2
|
* Wrap a function with correct, unminified parameter names for hypha-rpc.
|
|
3
3
|
*
|
|
4
4
|
* In production builds, Babel/Terser minifies parameter names (e.g. 'code' → 'e').
|
|
5
|
-
* hypha-rpc's
|
|
5
|
+
* hypha-rpc's getFunctionInfo() parses Function.toString() to map kwargs to
|
|
6
6
|
* positional args. With minified names, kwargs like {code: '...'} can't be
|
|
7
7
|
* mapped and args are silently dropped.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* the
|
|
9
|
+
* CSP NOTE: this used to build the wrapper with `new Function(...)`, but that is
|
|
10
|
+
* blocked on pages whose Content Security Policy lacks `'unsafe-eval'` (the exact
|
|
11
|
+
* pages the bookmarklet targets). Instead we use a normal closure and OVERRIDE its
|
|
12
|
+
* `.toString()` so hypha-rpc still reads the real, unminified parameter names from
|
|
13
|
+
* the schema — no eval / Function constructor involved.
|
|
12
14
|
*
|
|
13
15
|
* Additionally, it handles the case where hypha-rpc passes kwargs as a single
|
|
14
16
|
* object argument (e.g. `fn({url: "..."})` instead of `fn("...")`). The
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hypha-debugger",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Injectable debugger for web pages and AI agents, powered by Hypha RPC",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/hypha-debugger.js",
|
|
@@ -18,6 +18,8 @@
|
|
|
18
18
|
],
|
|
19
19
|
"scripts": {
|
|
20
20
|
"build": "rollup -c && tsc --declaration --emitDeclarationOnly --outDir dist",
|
|
21
|
+
"postbuild": "node scripts/build-bookmarklet.mjs",
|
|
22
|
+
"build:bookmarklet": "node scripts/build-bookmarklet.mjs",
|
|
21
23
|
"dev": "rollup -c -w",
|
|
22
24
|
"test": "vitest run",
|
|
23
25
|
"test:watch": "vitest",
|