@jshookmcp/jshook 0.2.9 → 0.3.0

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 (187) hide show
  1. package/README.md +2 -2
  2. package/README.zh.md +2 -2
  3. package/dist/{AntiCheatDetector-BNk-EoBt.mjs → AntiCheatDetector-CqGDXmfc.mjs} +159 -53
  4. package/dist/{CodeInjector-Cq8q01kp.mjs → CodeInjector-BdjRfNx7.mjs} +5 -5
  5. package/dist/{ConsoleMonitor-CPVQW1Y-.mjs → ConsoleMonitor-DykL3IAw.mjs} +85 -17
  6. package/dist/{DetailedDataManager-BQQcxh64.mjs → DetailedDataManager-HT49OrvF.mjs} +1 -1
  7. package/dist/{ExtensionManager-CWYgw0YW.mjs → ExtensionManager-BDMsY2Dz.mjs} +15 -8
  8. package/dist/{HardwareBreakpoint-B9gZCdFP.mjs → HardwareBreakpoint-Cc2AFq1Y.mjs} +3 -3
  9. package/dist/{HeapAnalyzer-BLDH0dCv.mjs → HeapAnalyzer-DruMgsgj.mjs} +20 -20
  10. package/dist/{HookGeneratorBuilders.core.generators.storage-CtcdK78Q.mjs → HookGeneratorBuilders.core.generators.storage-CTbB4Lcx.mjs} +1 -74
  11. package/dist/{InstrumentationSession-CvPC7Jwy.mjs → InstrumentationSession-DLH0vd-z.mjs} +2 -2
  12. package/dist/{MemoryController-CbVdCIJF.mjs → MemoryController-CMtviNW_.mjs} +3 -3
  13. package/dist/{MemoryScanSession-BsDZbLYm.mjs → MemoryScanSession-ITgb_NMi.mjs} +2 -2
  14. package/dist/{MemoryScanner-Bcpml6II.mjs → MemoryScanner-CiL7Z3ey.mjs} +12 -9
  15. package/dist/{NativeMemoryManager.impl-dZtA1ZGn.mjs → NativeMemoryManager.impl-D9Lkovvn.mjs} +13 -10
  16. package/dist/{NativeMemoryManager.utils-B-FjA2mJ.mjs → NativeMemoryManager.utils-BBlAixF5.mjs} +1 -1
  17. package/dist/{PEAnalyzer-D1lzJ_VG.mjs → PEAnalyzer-DMQ44gen.mjs} +15 -15
  18. package/dist/{PageController-Bqm2kZ_X.mjs → PageController-BPJNqqBN.mjs} +18 -4
  19. package/dist/{PointerChainEngine-BOhyVsjx.mjs → PointerChainEngine-K7wN8Z-w.mjs} +10 -7
  20. package/dist/ProcessRegistry-zGg12QbE.mjs +74 -0
  21. package/dist/{ResponseBuilder-D3iFYx2N.mjs → ResponseBuilder-CJXWmWNw.mjs} +10 -10
  22. package/dist/{ScriptManager-aHHq0X7U.mjs → ScriptManager-ZuWD-0Jg.mjs} +195 -192
  23. package/dist/{Speedhack-CqdIFlQl.mjs → Speedhack-D-z0umeT.mjs} +2 -2
  24. package/dist/{StructureAnalyzer-DhFaPvRO.mjs → StructureAnalyzer-Cav5AVSL.mjs} +9 -6
  25. package/dist/{ToolCatalog-C0JGZoOm.mjs → ToolCatalog-5OJdMiF0.mjs} +81 -81
  26. package/dist/{ToolProbe-oC7aPrkv.mjs → ToolProbe-DbCFGyrg.mjs} +1 -1
  27. package/dist/{ToolRegistry-BjaF4oNz.mjs → ToolRegistry-B9krbTtI.mjs} +51 -2
  28. package/dist/{ToolRouter.policy-BWV67ZK-.mjs → ToolRouter.policy-BGDAGyeH.mjs} +60 -20
  29. package/dist/TraceRecorder-B41Z5XBj.mjs +1286 -0
  30. package/dist/{Win32API-CePkipZY.mjs → Win32API-C2kjj0ze.mjs} +18 -12
  31. package/dist/{Win32Debug-BvKs-gxc.mjs → Win32Debug-CKrGOTpo.mjs} +2 -2
  32. package/dist/{WorkflowEngine-CuvkZtWu.mjs → WorkflowEngine-DJ6M4opp.mjs} +226 -255
  33. package/dist/analysis-BHeJW2Nb.mjs +1234 -0
  34. package/dist/{antidebug-CqDTB_uk.mjs → antidebug-BRKeyt27.mjs} +3 -3
  35. package/dist/{artifactRetention-CFEprwPw.mjs → artifactRetention-CPXkUJXp.mjs} +13 -6
  36. package/dist/{artifacts-Bk2-_uPq.mjs → artifacts-DkfosXH3.mjs} +1 -1
  37. package/dist/authorization-schema-DRqyJMSk.mjs +31 -0
  38. package/dist/{binary-instrument-CXfpx6fT.mjs → binary-instrument--V3MAhJ4.mjs} +19 -27
  39. package/dist/bind-helpers-ClV34xdn.mjs +42 -0
  40. package/dist/{boringssl-inspector-BH2D3VKc.mjs → boringssl-inspector-Bo_LOLaS.mjs} +1 -1
  41. package/dist/{browser-BpOr5PEx.mjs → browser-Dx3_S2cG.mjs} +324 -37
  42. package/dist/capabilities-CcHlvWgK.mjs +33 -0
  43. package/dist/{constants-B0OANIBL.mjs → constants-CDZLOoVv.mjs} +18 -3
  44. package/dist/{coordination-qUbyF8KU.mjs → coordination-DgItD9DL.mjs} +2 -2
  45. package/dist/{debugger-gnKxRSN0.mjs → debugger-RS3RSAqs.mjs} +30 -13
  46. package/dist/definitions-BEoYofW5.mjs +47 -0
  47. package/dist/{definitions-bAhHQJq9.mjs → definitions-BRaefg3u.mjs} +11 -5
  48. package/dist/{definitions-DVGfrn7y.mjs → definitions-BbkvZkiv.mjs} +2 -2
  49. package/dist/definitions-BtWSHJ3o.mjs +17 -0
  50. package/dist/{definitions-BMfYXoNC.mjs → definitions-C1gCHO0i.mjs} +1 -1
  51. package/dist/{definitions-C1UvM5Iy.mjs → definitions-CDOg_b-l.mjs} +14 -2
  52. package/dist/definitions-CVPD9hzZ.mjs +54 -0
  53. package/dist/{definitions-Cke7zEb8.mjs → definitions-Cea8Lgl7.mjs} +1 -1
  54. package/dist/definitions-DAgIyjxM.mjs +10 -0
  55. package/dist/{definitions-B4rAvHNZ.mjs → definitions-DJA27nsL.mjs} +12 -9
  56. package/dist/{definitions-ClJLzsJQ.mjs → definitions-DKPFU3LW.mjs} +1 -1
  57. package/dist/{definitions-D3VsGcvz.mjs → definitions-DPRpZQ96.mjs} +7 -7
  58. package/dist/{definitions-B18eyf0B.mjs → definitions-DUE5gmdn.mjs} +1 -1
  59. package/dist/definitions-DYVjOtxa.mjs +26 -0
  60. package/dist/{definitions-BB_4jnmy.mjs → definitions-DcYLVLCo.mjs} +1 -1
  61. package/dist/{definitions-Beid2EB3.mjs → definitions-Pp5LI2H4.mjs} +1 -1
  62. package/dist/definitions-j9KdHVNR.mjs +14 -0
  63. package/dist/definitions-uzkjBwa7.mjs +258 -0
  64. package/dist/{definitions-Cq-zroAU.mjs → definitions-va-AnLuQ.mjs} +4 -4
  65. package/dist/{encoding-Bvz5jLRv.mjs → encoding-DJeqHmpd.mjs} +18 -4
  66. package/dist/{evidence-graph-bridge-C_fv9PuC.mjs → evidence-graph-bridge-DcYizFk2.mjs} +1 -0
  67. package/dist/{factory-DxlGh9Xf.mjs → factory-C90tBff6.mjs} +6 -6
  68. package/dist/flat-target-session-Dgax2Cy3.mjs +29 -0
  69. package/dist/{graphql-DYWzJ29s.mjs → graphql-CoHrhweh.mjs} +205 -34
  70. package/dist/{handlers-C67ktuRN.mjs → handlers-4jmR0nMs.mjs} +220 -32
  71. package/dist/{handlers-DlCJN4Td.mjs → handlers-BAHPxcch.mjs} +122 -90
  72. package/dist/{handlers-9sAbfIg-.mjs → handlers-BOs9b907.mjs} +849 -801
  73. package/dist/{handlers-DxGIq15_2.mjs → handlers-BWXEy6ef.mjs} +16 -16
  74. package/dist/{handlers-tB9Mp9ZK.mjs → handlers-Bndn6QvE.mjs} +31 -4
  75. package/dist/{handlers-CTsDAO6p.mjs → handlers-BqC4bD4s.mjs} +1 -1
  76. package/dist/{handlers-C87g8oCe.mjs → handlers-BtYq60bM2.mjs} +1 -1
  77. package/dist/{handlers-DeLOCd5m.mjs → handlers-BzgcB4iv.mjs} +17 -17
  78. package/dist/{handlers-Cgyg6c0U.mjs → handlers-CRyRWj2b.mjs} +237 -23
  79. package/dist/{handlers-U6L4xhuF.mjs → handlers-CVv2H1uq.mjs} +24 -17
  80. package/dist/{handlers-tiy7EIBp.mjs → handlers-Dl5a7JS4.mjs} +3 -3
  81. package/dist/{handlers-D6j6yka7.mjs → handlers-Dx2d7jt7.mjs} +1893 -1480
  82. package/dist/{handlers-Bl8zkwz1.mjs → handlers-Dz9PYsCa.mjs} +95 -6
  83. package/dist/handlers-HujRKC3b.mjs +661 -0
  84. package/dist/{handlers.impl-DS0d9fUw.mjs → handlers.impl-XWXkQfyi.mjs} +70 -24
  85. package/dist/{hooks-CzCWByww.mjs → hooks-B1B8NRHL.mjs} +3 -3
  86. package/dist/index.mjs +154 -144
  87. package/dist/{maintenance-P7ePRXQC.mjs → maintenance-PRMkLVRW.mjs} +35 -30
  88. package/dist/manifest-67Bok-Si.mjs +58 -0
  89. package/dist/{manifest-B3QVVeBS.mjs → manifest-6lNTMZAB2.mjs} +33 -28
  90. package/dist/manifest-B2duEHiH.mjs +90 -0
  91. package/dist/manifest-B6EY9Vm8.mjs +57 -0
  92. package/dist/{manifest-gZ4s_UtG.mjs → manifest-B6nKSbyY.mjs} +32 -33
  93. package/dist/{manifest-2ToTpjv8.mjs → manifest-BL8AQNPF.mjs} +31 -31
  94. package/dist/{manifest-DzwvxPJX.mjs → manifest-BSZvJJmV.mjs} +23 -14
  95. package/dist/{manifest-Sc_0JQ13.mjs → manifest-BU7qzUyX.mjs} +23 -23
  96. package/dist/{manifest-CT7zZBV1.mjs → manifest-Bl62e8WK.mjs} +24 -23
  97. package/dist/manifest-Bo5cXjdt.mjs +82 -0
  98. package/dist/manifest-BpS4gtUK.mjs +1347 -0
  99. package/dist/manifest-Bv65_e2W.mjs +101 -0
  100. package/dist/manifest-BytNIF4Z.mjs +117 -0
  101. package/dist/{manifest-BqrQ4Tpj.mjs → manifest-C-xtsjS3.mjs} +23 -23
  102. package/dist/{manifest-NXctwWQq.mjs → manifest-CDYl7OhA.mjs} +36 -38
  103. package/dist/manifest-CRZ3xmkD.mjs +61 -0
  104. package/dist/manifest-CoW6u4Tp.mjs +132 -0
  105. package/dist/manifest-Cq5zN_8A.mjs +50 -0
  106. package/dist/{manifest-CAhOuvSl.mjs → manifest-D7YZM_2e.mjs} +75 -85
  107. package/dist/{manifest-DCyjf4n2.mjs → manifest-DE_VrAeQ.mjs} +27 -7
  108. package/dist/manifest-DGsXSCpT.mjs +39 -0
  109. package/dist/{manifest-BB2J8IMJ.mjs → manifest-DJ2vfEuW.mjs} +48 -41
  110. package/dist/{manifest-3g71z6Bg.mjs → manifest-DPXDYhEu.mjs} +26 -25
  111. package/dist/manifest-Dd4fQb0a.mjs +322 -0
  112. package/dist/{manifest-CXsRWjjI.mjs → manifest-Deq6opGg.mjs} +95 -96
  113. package/dist/{manifest-C9RT5nk32.mjs → manifest-DfJTafJK.mjs} +14 -11
  114. package/dist/manifest-DgOdgN_j.mjs +50 -0
  115. package/dist/{manifest-BmtZzQiQ2.mjs → manifest-DlbMW4v4.mjs} +17 -15
  116. package/dist/{manifest-DrbmZcFl2.mjs → manifest-DmVfbH0w.mjs} +212 -91
  117. package/dist/manifest-Dog6Ddjr.mjs +109 -0
  118. package/dist/manifest-DvgU5FWb.mjs +58 -0
  119. package/dist/manifest-HsfDBs7j.mjs +50 -0
  120. package/dist/manifest-I8oQHvCG.mjs +186 -0
  121. package/dist/manifest-NvH_a-av.mjs +786 -0
  122. package/dist/{manifest-Dh8WBmEW.mjs → manifest-cEJU1v0Z.mjs} +24 -24
  123. package/dist/manifest-wOl5XLB12.mjs +112 -0
  124. package/dist/{modules-C184v-S9.mjs → modules-tZozf0LQ.mjs} +130 -860
  125. package/dist/{mojo-ipc-B_H61Afw.mjs → mojo-ipc-DXNEXEqb.mjs} +141 -26
  126. package/dist/{network-671Cw6hV.mjs → network-CPVvwvFg.mjs} +1329 -823
  127. package/dist/{outputPaths-B1uGmrWZ.mjs → outputPaths-um7lCRY3.mjs} +4 -8
  128. package/dist/{platform-WmNn8Sxb.mjs → platform-CYeFoTWp.mjs} +101 -10
  129. package/dist/{process-QcbIy5Zq.mjs → process-BTbgcVc6.mjs} +251 -346
  130. package/dist/{proxy-DqNs0bAd.mjs → proxy-r8YN6nP1.mjs} +30 -8
  131. package/dist/{registry-D-6e18lB.mjs → registry-Bl8ZQW61.mjs} +3 -3
  132. package/dist/{response-BQVP-xUn.mjs → response-CWhh2aLo.mjs} +7 -1
  133. package/dist/{shared-state-board-DV-dpHFJ.mjs → shared-state-board-BoZnSoj-.mjs} +2 -2
  134. package/dist/{sourcemap-Dq8ez8vS.mjs → sourcemap-BIDHUVXy.mjs} +350 -66
  135. package/dist/{streaming-BUQ0VJsg.mjs → streaming-Dal6utPp.mjs} +13 -13
  136. package/dist/{tool-builder-DCbIC5Eo.mjs → tool-builder-BHJp32mV.mjs} +1 -1
  137. package/dist/{transform-CiYJfNX0.mjs → transform-DRVgGG90.mjs} +18 -14
  138. package/dist/wasm-BYx5UOeG.mjs +1044 -0
  139. package/dist/webcrack-Be0_FccV.mjs +747 -0
  140. package/dist/{workflow-f3xJOcjx.mjs → workflow-BpuKEtvn.mjs} +8 -8
  141. package/package.json +76 -43
  142. package/dist/TraceRecorder-DgxyVbdQ.mjs +0 -519
  143. package/dist/analysis-CL9uACt9.mjs +0 -463
  144. package/dist/bind-helpers-xFfRF-qm.mjs +0 -22
  145. package/dist/definitions-6M-eejaT.mjs +0 -53
  146. package/dist/definitions-B3QdlrHv.mjs +0 -34
  147. package/dist/definitions-CXEI7QC72.mjs +0 -216
  148. package/dist/definitions-C_4r7Fo-2.mjs +0 -14
  149. package/dist/definitions-CkFDALoa.mjs +0 -26
  150. package/dist/definitions-Cy3Sl6gV.mjs +0 -34
  151. package/dist/definitions-LKpC3-nL.mjs +0 -9
  152. package/dist/handlers-DdFzXLvF.mjs +0 -446
  153. package/dist/manifest-82baTv4U.mjs +0 -45
  154. package/dist/manifest-BKbgbSiY.mjs +0 -60
  155. package/dist/manifest-Bcf-TJzH.mjs +0 -848
  156. package/dist/manifest-Bnd7kqEY.mjs +0 -55
  157. package/dist/manifest-BqQX6OQC2.mjs +0 -65
  158. package/dist/manifest-Br4RPFt5.mjs +0 -370
  159. package/dist/manifest-C5qDjysN.mjs +0 -107
  160. package/dist/manifest-CBYWCUBJ.mjs +0 -51
  161. package/dist/manifest-CFADCRa1.mjs +0 -37
  162. package/dist/manifest-CQVhavRF.mjs +0 -114
  163. package/dist/manifest-CV12bcrF.mjs +0 -121
  164. package/dist/manifest-CZLUCfG02.mjs +0 -95
  165. package/dist/manifest-D6phHKFd.mjs +0 -131
  166. package/dist/manifest-DHsnKgP6.mjs +0 -60
  167. package/dist/manifest-Df_dliIe.mjs +0 -55
  168. package/dist/manifest-DhKRAT8_.mjs +0 -92
  169. package/dist/manifest-DlpTj4ic2.mjs +0 -193
  170. package/dist/manifest-DuwHjUa5.mjs +0 -70
  171. package/dist/manifest-qSleDqdO.mjs +0 -1023
  172. package/dist/wasm-DQTnHDs4.mjs +0 -531
  173. /package/dist/{CacheAdapters-CDe5WPSV.mjs → CacheAdapters-jJFy20G-.mjs} +0 -0
  174. /package/dist/{DarwinAPI-BNPxu0RH.mjs → DarwinAPI-ETyy0xyo.mjs} +0 -0
  175. /package/dist/{EventBus-DgPmwpeu.mjs → EventBus-DFKvADm3.mjs} +0 -0
  176. /package/dist/{EvidenceGraphBridge-SFesNera.mjs → EvidenceGraphBridge-318Oi0Lf.mjs} +0 -0
  177. /package/dist/{FingerprintManager-gzWtkKuf.mjs → FingerprintManager-BN4UQWnX.mjs} +0 -0
  178. /package/dist/{PrerequisiteError-Dl33Svkz.mjs → PrerequisiteError-TuyZIs6n.mjs} +0 -0
  179. /package/dist/{ReverseEvidenceGraph-Dlsk94LC.mjs → ReverseEvidenceGraph-C02-gXOh.mjs} +0 -0
  180. /package/dist/{StealthVerifier-Bo4T3bz8.mjs → StealthVerifier-BWmPgQsv.mjs} +0 -0
  181. /package/dist/{VersionDetector-CwVLVdDM.mjs → VersionDetector-K3V4vGsw.mjs} +0 -0
  182. /package/dist/{betterSqlite3-0pqusHHH.mjs → betterSqlite3-DLSBZodi.mjs} +0 -0
  183. /package/dist/{concurrency-Bt0yv1kJ.mjs → concurrency-Drev_Vz9.mjs} +0 -0
  184. /package/dist/{formatAddress-DVkj9kpI.mjs → formatAddress-nnMvEohD.mjs} +0 -0
  185. /package/dist/{parse-args-BlRjqlkL.mjs → parse-args-B4cY5Vx5.mjs} +0 -0
  186. /package/dist/{ssrf-policy-ZaUfvhq7.mjs → ssrf-policy-Dsqd-DTX.mjs} +0 -0
  187. /package/dist/{types-CPhOReNX.mjs → types-DDBWs9UP.mjs} +0 -0
@@ -1,4 +1,4 @@
1
- import { Jn as SEARCH_VECTOR_ENABLED, Kn as SEARCH_VECTOR_COSINE_WEIGHT, Qn as SEARCH_VECTOR_MODEL_ID, qn as SEARCH_VECTOR_DYNAMIC_WEIGHT } from "./constants-B0OANIBL.mjs";
1
+ import { $n as SEARCH_VECTOR_DYNAMIC_WEIGHT, Qn as SEARCH_VECTOR_COSINE_WEIGHT, er as SEARCH_VECTOR_ENABLED, ir as SEARCH_VECTOR_MODEL_ID } from "./constants-CDZLOoVv.mjs";
2
2
  import { homedir } from "node:os";
3
3
  import { z } from "zod";
4
4
  import { basename, dirname, extname, isAbsolute, join, normalize, relative, resolve, sep } from "node:path";
@@ -433,7 +433,7 @@ const DEFAULT_SEARCH_CONFIG = {
433
433
  ],
434
434
  intentToolBoostRules: [
435
435
  {
436
- pattern: "(?:端到端闭环|全链路闭环|一键闭环|api(?:[_\\s-]*)capture(?:[_\\s-]*)session|web_api_capture_session|抓取接口|抓包流程)",
436
+ pattern: "(?:端到端闭环|全链路闭环|一键闭环|api(?:[_\\s-]*)capture(?:[_\\s-]*)session|抓取接口|抓包流程)",
437
437
  flags: "i",
438
438
  boosts: [
439
439
  {
@@ -634,17 +634,13 @@ const DEFAULT_SEARCH_CONFIG = {
634
634
  flags: "i",
635
635
  boosts: [
636
636
  {
637
- tool: "evidence_query_url",
637
+ tool: "evidence_query",
638
638
  bonus: 16
639
639
  },
640
640
  {
641
- tool: "evidence_export_markdown",
641
+ tool: "evidence_export",
642
642
  bonus: 14
643
643
  },
644
- {
645
- tool: "evidence_export_json",
646
- bonus: 12
647
- },
648
644
  {
649
645
  tool: "run_extension_workflow",
650
646
  bonus: 6
@@ -1,9 +1,10 @@
1
1
  import { t as logger } from "./logger-Dh_xb7_2.mjs";
2
- import { fr as V8_BYTECODE_SUBPROC_TIMEOUT_MS } from "./constants-B0OANIBL.mjs";
3
- import { o as ExternalToolRunner } from "./modules-C184v-S9.mjs";
4
- import { i as resolveArtifactPath } from "./artifacts-Bk2-_uPq.mjs";
5
- import { t as ToolRegistry } from "./ToolRegistry-BjaF4oNz.mjs";
6
- import "./definitions-6M-eejaT.mjs";
2
+ import { Sr as V8_BYTECODE_SUBPROC_TIMEOUT_MS } from "./constants-CDZLOoVv.mjs";
3
+ import { o as ExternalToolRunner } from "./modules-tZozf0LQ.mjs";
4
+ import { i as resolveArtifactPath } from "./artifacts-DkfosXH3.mjs";
5
+ import { n as capabilityReport } from "./capabilities-CcHlvWgK.mjs";
6
+ import { t as ToolRegistry } from "./ToolRegistry-B9krbTtI.mjs";
7
+ import "./definitions-CVPD9hzZ.mjs";
7
8
  import { homedir } from "node:os";
8
9
  import { basename, dirname, extname, join, normalize, relative, resolve, sep } from "node:path";
9
10
  import { copyFile, mkdir, readFile, readdir, stat, writeFile } from "node:fs/promises";
@@ -1309,6 +1310,34 @@ async function tryView8(filePath) {
1309
1310
  }
1310
1311
  }
1311
1312
  }
1313
+ async function tryView8Interpreter(interpreter) {
1314
+ try {
1315
+ await execFileAsync(interpreter, ["-c", "import view8; print(getattr(view8, \"__file__\", \"view8\"))"], {
1316
+ timeout: V8_BYTECODE_SUBPROC_TIMEOUT_MS,
1317
+ maxBuffer: 1024 * 1024
1318
+ });
1319
+ return {
1320
+ available: true,
1321
+ interpreter
1322
+ };
1323
+ } catch (error) {
1324
+ return {
1325
+ available: false,
1326
+ interpreter,
1327
+ reason: error instanceof Error ? error.message : String(error)
1328
+ };
1329
+ }
1330
+ }
1331
+ async function probeView8Availability() {
1332
+ const python = await tryView8Interpreter("python");
1333
+ if (python.available) return python;
1334
+ const python3 = await tryView8Interpreter("python3");
1335
+ if (python3.available) return python3;
1336
+ return {
1337
+ available: false,
1338
+ reason: python.reason && python3.reason ? `${python.reason}; ${python3.reason}` : python.reason ?? python3.reason ?? "view8 is not available"
1339
+ };
1340
+ }
1312
1341
  /**
1313
1342
  * Strategy 2: Built-in constant pool extractor.
1314
1343
  * Extracts readable strings and numeric constants from V8 serialized bytecode.
@@ -1652,6 +1681,14 @@ async function handleElectronDebugStatus(args) {
1652
1681
  * EADV-03: IPC sniffing probe.
1653
1682
  */
1654
1683
  const ipcSessions = /* @__PURE__ */ new Map();
1684
+ function getElectronIPCSniffRuntimeCapability() {
1685
+ if (typeof globalThis.WebSocket === "function") return { available: true };
1686
+ return {
1687
+ available: false,
1688
+ reason: "Global WebSocket is not available in this Node runtime.",
1689
+ fix: "Use Node.js 21+ or provide a WebSocket-compatible runtime."
1690
+ };
1691
+ }
1655
1692
  /**
1656
1693
  * The JS payload injected into the renderer to hook ipcRenderer methods.
1657
1694
  * Uses CDP Runtime.evaluate to execute in the page context.
@@ -1789,14 +1826,15 @@ async function cdpEvaluate(wsDebuggerUrl, expression) {
1789
1826
  function cdpEvalViaWs(wsUrl, expression) {
1790
1827
  return new Promise((resolve) => {
1791
1828
  try {
1792
- const WS = globalThis.WebSocket;
1793
- if (!WS) {
1829
+ const runtimeCapability = getElectronIPCSniffRuntimeCapability();
1830
+ if (!runtimeCapability.available) {
1794
1831
  resolve({
1795
1832
  ok: false,
1796
- error: "WebSocket not available. Requires Node.js 21+ or ws package."
1833
+ error: `${runtimeCapability.reason} ${runtimeCapability.fix ?? ""}`.trim()
1797
1834
  });
1798
1835
  return;
1799
1836
  }
1837
+ const WS = globalThis.WebSocket;
1800
1838
  const ws = new WS(wsUrl);
1801
1839
  const timeout = setTimeout(() => {
1802
1840
  try {
@@ -2017,15 +2055,68 @@ async function handleElectronIPCSniff(args) {
2017
2055
  }
2018
2056
  }
2019
2057
  //#endregion
2058
+ //#region src/server/domains/platform/handlers/capabilities.ts
2059
+ async function handlePlatformCapabilities(runner) {
2060
+ const miniappProbe = (await runner.probeAll())["miniapp.unpacker"];
2061
+ const view8Availability = await probeView8Availability() ?? {
2062
+ available: false,
2063
+ reason: "view8 probe returned no result"
2064
+ };
2065
+ const ipcCapability = getElectronIPCSniffRuntimeCapability() ?? {
2066
+ available: false,
2067
+ reason: "IPC runtime probe returned no result"
2068
+ };
2069
+ return toTextResponse(capabilityReport("platform_capabilities", [
2070
+ {
2071
+ capability: "miniapp_unpacker",
2072
+ status: miniappProbe?.available ? "available" : "unavailable",
2073
+ reason: miniappProbe?.reason,
2074
+ fix: miniappProbe?.available ? void 0 : "Install unveilr to enable the fast external unpack path.",
2075
+ details: {
2076
+ tools: ["miniapp_pkg_unpack"],
2077
+ fallback: "Built-in Node.js parser remains available.",
2078
+ ...miniappProbe?.path ? { path: miniappProbe.path } : {},
2079
+ ...miniappProbe?.version ? { version: miniappProbe.version } : {}
2080
+ }
2081
+ },
2082
+ {
2083
+ capability: "view8",
2084
+ status: view8Availability.available ? "available" : "unavailable",
2085
+ reason: view8Availability.reason,
2086
+ fix: view8Availability.available ? void 0 : "Install view8 with pip install view8 to enable full bytecode decompilation.",
2087
+ details: {
2088
+ tools: ["v8_bytecode_decompile"],
2089
+ fallback: "Built-in constant-pool extraction remains available.",
2090
+ ...view8Availability.interpreter ? { interpreter: view8Availability.interpreter } : {}
2091
+ }
2092
+ },
2093
+ {
2094
+ capability: "electron_ipc_sniff_runtime",
2095
+ status: ipcCapability.available ? "available" : "unavailable",
2096
+ reason: ipcCapability.reason,
2097
+ fix: ipcCapability.fix,
2098
+ details: {
2099
+ tools: ["electron_ipc_sniff"],
2100
+ note: "A renderer CDP port is still required at call time."
2101
+ }
2102
+ }
2103
+ ]));
2104
+ }
2105
+ //#endregion
2020
2106
  //#region src/server/domains/platform/handlers.ts
2021
2107
  var PlatformToolHandlers = class {
2022
2108
  miniapp;
2023
2109
  electron;
2110
+ runner;
2024
2111
  constructor(collector) {
2025
- const runner = new ExternalToolRunner(new ToolRegistry());
2026
- this.miniapp = new MiniappHandlers(runner, collector);
2112
+ const registry = new ToolRegistry();
2113
+ this.runner = new ExternalToolRunner(registry);
2114
+ this.miniapp = new MiniappHandlers(this.runner, collector);
2027
2115
  this.electron = new ElectronHandlers(collector);
2028
2116
  }
2117
+ handlePlatformCapabilities() {
2118
+ return handlePlatformCapabilities(this.runner);
2119
+ }
2029
2120
  handleMiniappPkgScan(args) {
2030
2121
  return this.miniapp.handleMiniappPkgScan(args);
2031
2122
  }