ceulen 0.5.1 → 0.7.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 (358) hide show
  1. package/CHANGELOG.md +317 -12
  2. package/README.md +87 -91
  3. package/extensions/lib/advisor-marker.ts +33 -0
  4. package/extensions/lib/panel.ts +25 -2
  5. package/extensions/lib/rate.ts +24 -0
  6. package/extensions/lib/registry.ts +93 -7
  7. package/extensions/lib/tools.ts +47 -0
  8. package/extensions/lib/usage-store.ts +33 -0
  9. package/extensions/modules/advisor/commands/advisor.ts +244 -0
  10. package/extensions/modules/advisor/configPanel.ts +194 -0
  11. package/extensions/modules/advisor/index.ts +217 -0
  12. package/extensions/modules/advisor/lib/config.ts +248 -0
  13. package/extensions/modules/advisor/lib/emission-guard.ts +153 -0
  14. package/extensions/modules/advisor/lib/isolated-model.ts +160 -0
  15. package/extensions/modules/advisor/lib/model-picker.ts +47 -0
  16. package/extensions/modules/advisor/lib/watcher.ts +286 -0
  17. package/extensions/modules/advisor/test/compliance.test.ts +125 -0
  18. package/extensions/modules/advisor/test/config.test.ts +202 -0
  19. package/extensions/modules/advisor/test/configPanel.test.ts +223 -0
  20. package/extensions/modules/advisor/test/emission-guard.test.ts +201 -0
  21. package/extensions/modules/advisor/test/isolated-model.test.ts +311 -0
  22. package/extensions/modules/advisor/test/model-picker.test.ts +32 -0
  23. package/extensions/modules/advisor/test/module.test.ts +586 -0
  24. package/extensions/modules/advisor/test/watcher.test.ts +478 -0
  25. package/extensions/modules/classifier/configPanel.ts +104 -0
  26. package/extensions/modules/classifier/index.ts +297 -0
  27. package/extensions/modules/classifier/lib/settings.ts +95 -0
  28. package/extensions/modules/classifier/test/classifier.test.ts +475 -0
  29. package/extensions/modules/composer/index.ts +152 -3
  30. package/extensions/modules/composer/lib/footer.ts +119 -0
  31. package/extensions/modules/composer/lib/shapes.ts +265 -26
  32. package/extensions/modules/composer/test/editor.test.ts +1 -1
  33. package/extensions/modules/composer/test/footer.test.ts +96 -0
  34. package/extensions/modules/composer/test/module.test.ts +113 -11
  35. package/extensions/modules/composer/test/screen.test.ts +29 -1
  36. package/extensions/modules/composer/test/shapes.test.ts +224 -8
  37. package/extensions/modules/config/defaultTools.ts +96 -0
  38. package/extensions/modules/config/index.ts +147 -7
  39. package/extensions/modules/config/piSettings.ts +254 -69
  40. package/extensions/modules/config/test/defaultTools.test.ts +122 -0
  41. package/extensions/modules/config/test/menu.test.ts +64 -0
  42. package/extensions/modules/config/test/panel.test.ts +38 -23
  43. package/extensions/modules/config/test/piSettings.test.ts +130 -3
  44. package/extensions/modules/config/test/renderTools.test.ts +71 -0
  45. package/extensions/modules/config/test/tools.test.ts +146 -0
  46. package/extensions/modules/fff/index.ts +2094 -0
  47. package/extensions/modules/fff/lib/query.ts +129 -0
  48. package/extensions/modules/fff/test/index.test.ts +607 -0
  49. package/extensions/modules/fff/test/query.test.ts +71 -0
  50. package/extensions/modules/munin/configPanel.ts +105 -0
  51. package/extensions/modules/munin/index.ts +641 -0
  52. package/extensions/modules/munin/lib/helpers.ts +471 -0
  53. package/extensions/modules/munin/lib/retry.ts +20 -0
  54. package/extensions/modules/munin/lib/sdk.ts +218 -0
  55. package/extensions/modules/munin/test/config.test.ts +168 -0
  56. package/extensions/modules/munin/test/configPanel.test.ts +161 -0
  57. package/extensions/modules/munin/test/extension.test.ts +224 -0
  58. package/extensions/modules/munin/test/helpers.test.ts +523 -0
  59. package/extensions/modules/munin/test/retry.test.ts +145 -0
  60. package/extensions/modules/munin/test/stale-protocol.test.ts +554 -0
  61. package/extensions/modules/plan/configPanel.ts +152 -0
  62. package/extensions/modules/plan/index.ts +917 -0
  63. package/extensions/modules/plan/lib/plan-tools.ts +72 -0
  64. package/extensions/modules/plan/lib/prompt.ts +65 -0
  65. package/extensions/modules/plan/lib/settings.ts +166 -0
  66. package/extensions/modules/plan/lib/shell-gate.ts +200 -0
  67. package/extensions/modules/plan/test/configPanel.test.ts +96 -0
  68. package/extensions/modules/plan/test/harness.ts +133 -0
  69. package/extensions/modules/plan/test/module.test.ts +305 -0
  70. package/extensions/modules/plan/test/settings.test.ts +114 -0
  71. package/extensions/modules/plan/test/shell-gate.test.ts +103 -0
  72. package/extensions/modules/ponytail/index.ts +23 -73
  73. package/extensions/modules/ponytail/lib/config.ts +1 -6
  74. package/extensions/modules/ponytail/test/extension.test.ts +1 -85
  75. package/extensions/modules/repair/configPanel.ts +96 -0
  76. package/extensions/modules/repair/index.ts +414 -0
  77. package/extensions/modules/repair/lib/auto-bg.ts +333 -0
  78. package/extensions/modules/repair/lib/edit-repair.ts +155 -0
  79. package/extensions/modules/repair/lib/editor.ts +251 -0
  80. package/extensions/modules/repair/lib/guards.ts +34 -0
  81. package/extensions/modules/repair/lib/input-repair.ts +324 -0
  82. package/extensions/modules/repair/lib/patch.ts +481 -0
  83. package/extensions/modules/repair/lib/settings.ts +114 -0
  84. package/extensions/modules/repair/test/auto-bg.test.ts +405 -0
  85. package/extensions/modules/repair/test/edit-repair.test.ts +224 -0
  86. package/extensions/modules/repair/test/editor.test.ts +141 -0
  87. package/extensions/modules/repair/test/guards.test.ts +64 -0
  88. package/extensions/modules/repair/test/input-repair.test.ts +231 -0
  89. package/extensions/modules/repair/test/patch.test.ts +563 -0
  90. package/extensions/modules/repair/test/settings.test.ts +167 -0
  91. package/extensions/modules/repair/test/wrapper.test.ts +210 -0
  92. package/extensions/modules/router/commands/commands.ts +4 -0
  93. package/extensions/modules/router/lib/client.ts +61 -0
  94. package/extensions/modules/router/lib/provider.ts +34 -13
  95. package/extensions/modules/router/lib/systemone.ts +152 -0
  96. package/extensions/modules/router/test/unit.test.ts +179 -0
  97. package/extensions/modules/rtk/findFallback.js +68 -0
  98. package/extensions/modules/rtk/index.ts +248 -0
  99. package/extensions/modules/rtk/safe-rewrite.js +74 -0
  100. package/extensions/modules/rtk/test/findFallback.test.js +66 -0
  101. package/extensions/modules/rtk/test/index.test.js +131 -0
  102. package/extensions/modules/rtk/test/safe-rewrite.test.js +96 -0
  103. package/extensions/modules/rtk/version-gate.js +34 -0
  104. package/extensions/modules/serena/index.ts +629 -0
  105. package/extensions/modules/serena/lib/detect.ts +73 -0
  106. package/extensions/modules/serena/lib/env.ts +76 -0
  107. package/extensions/modules/serena/lib/guidance.ts +26 -0
  108. package/extensions/modules/serena/lib/normalize.ts +27 -0
  109. package/extensions/modules/serena/lib/symbol-key.ts +20 -0
  110. package/extensions/modules/serena/lib/truncate.ts +20 -0
  111. package/extensions/modules/serena/test/env.test.ts +122 -0
  112. package/extensions/modules/serena/test/index.test.ts +347 -0
  113. package/extensions/modules/serena/test/worker.test.ts +562 -0
  114. package/extensions/modules/serena/worker.ts +858 -0
  115. package/extensions/modules/steering/configPanel.ts +122 -0
  116. package/extensions/modules/steering/index.ts +616 -0
  117. package/extensions/modules/steering/lib/anchor.ts +175 -0
  118. package/extensions/modules/steering/lib/errors.ts +253 -0
  119. package/extensions/modules/steering/lib/family.ts +33 -0
  120. package/extensions/modules/steering/lib/guidance.ts +172 -0
  121. package/extensions/modules/steering/lib/history.ts +170 -0
  122. package/extensions/modules/steering/lib/settings.ts +127 -0
  123. package/extensions/modules/steering/test/anchor-regressions.test.ts +93 -0
  124. package/extensions/modules/steering/test/anchor-wiring.test.ts +99 -0
  125. package/extensions/modules/steering/test/anchor.test.ts +160 -0
  126. package/extensions/modules/steering/test/cache-stats.test.ts +43 -0
  127. package/extensions/modules/steering/test/errors.test.ts +309 -0
  128. package/extensions/modules/steering/test/family.test.ts +43 -0
  129. package/extensions/modules/steering/test/guidance.test.ts +357 -0
  130. package/extensions/modules/steering/test/harness.ts +93 -0
  131. package/extensions/modules/steering/test/history.test.ts +118 -0
  132. package/extensions/modules/steering/test/settings.test.ts +182 -0
  133. package/extensions/modules/steering/test/status.test.ts +71 -0
  134. package/extensions/modules/steering/test/toolCall.test.ts +99 -0
  135. package/extensions/modules/subagent/agents/planner.md +14 -0
  136. package/extensions/modules/subagent/agents/reviewer.md +42 -0
  137. package/extensions/modules/subagent/agents/scout.md +47 -0
  138. package/extensions/modules/subagent/agents/tester.md +12 -0
  139. package/extensions/modules/subagent/agents/worker.md +18 -0
  140. package/extensions/modules/subagent/configPanel.ts +219 -0
  141. package/extensions/modules/subagent/index.ts +2451 -0
  142. package/extensions/modules/subagent/lib/agents.ts +408 -0
  143. package/extensions/modules/subagent/lib/background.ts +383 -0
  144. package/extensions/modules/subagent/lib/herdr.ts +1019 -0
  145. package/extensions/modules/subagent/lib/history.ts +126 -0
  146. package/extensions/modules/subagent/lib/model.ts +156 -0
  147. package/extensions/modules/subagent/lib/render.ts +335 -0
  148. package/extensions/modules/subagent/lib/result.ts +110 -0
  149. package/extensions/modules/subagent/lib/roles.ts +296 -0
  150. package/extensions/modules/subagent/lib/routing.ts +223 -0
  151. package/extensions/modules/subagent/lib/runner.ts +559 -0
  152. package/extensions/modules/subagent/lib/schema.ts +21 -0
  153. package/extensions/modules/subagent/lib/security.ts +752 -0
  154. package/extensions/modules/subagent/lib/settings.ts +159 -0
  155. package/extensions/modules/subagent/lib/thread-viewer.ts +319 -0
  156. package/extensions/modules/subagent/lib/threads.ts +135 -0
  157. package/extensions/modules/subagent/lib/types.ts +18 -0
  158. package/extensions/modules/subagent/lib/widget.ts +475 -0
  159. package/extensions/modules/subagent/test/configPanel.test.ts +132 -0
  160. package/extensions/modules/subagent/test/herdr-advisor.test.ts +40 -0
  161. package/extensions/modules/subagent/test/routing.test.ts +350 -0
  162. package/extensions/modules/subagent/test/widget.test.ts +208 -0
  163. package/extensions/modules/usage/index.ts +59 -16
  164. package/extensions/modules/usage/test/genrate.test.ts +70 -0
  165. package/extensions/modules/usage/test/parsers.test.ts +13 -0
  166. package/extensions/modules/ux/UPSTREAM +24 -0
  167. package/extensions/modules/ux/index.ts +393 -0
  168. package/extensions/modules/ux/lib/audit.ts +562 -0
  169. package/extensions/modules/ux/lib/config.ts +136 -0
  170. package/extensions/modules/ux/lib/instructions.ts +77 -0
  171. package/extensions/modules/ux/test/audit.test.ts +756 -0
  172. package/extensions/modules/ux/test/extension.test.ts +394 -0
  173. package/extensions/modules/ux/test/instructions.test.ts +19 -0
  174. package/extensions/modules/web/configPanel.ts +193 -0
  175. package/extensions/modules/web/index.ts +978 -0
  176. package/extensions/modules/web/lib/agy.ts +209 -0
  177. package/extensions/modules/web/lib/brave.ts +42 -0
  178. package/extensions/modules/web/lib/cdp.ts +686 -0
  179. package/extensions/modules/web/lib/chatapi.ts +101 -0
  180. package/extensions/modules/web/lib/chatgpt.ts +796 -0
  181. package/extensions/modules/web/lib/chrome.ts +328 -0
  182. package/extensions/modules/web/lib/config.ts +136 -0
  183. package/extensions/modules/web/lib/content.ts +99 -0
  184. package/extensions/modules/web/lib/crawl4ai.ts +172 -0
  185. package/extensions/modules/web/lib/extract.ts +235 -0
  186. package/extensions/modules/web/lib/firecrawl.ts +56 -0
  187. package/extensions/modules/web/lib/format.ts +197 -0
  188. package/extensions/modules/web/lib/gemini-auth.ts +286 -0
  189. package/extensions/modules/web/lib/gemini-dr.ts +338 -0
  190. package/extensions/modules/web/lib/gemini.ts +551 -0
  191. package/extensions/modules/web/lib/imageapi.ts +559 -0
  192. package/extensions/modules/web/lib/retry.ts +71 -0
  193. package/extensions/modules/web/lib/search.ts +237 -0
  194. package/extensions/modules/web/lib/searxng.ts +69 -0
  195. package/extensions/modules/web/lib/settings.ts +148 -0
  196. package/extensions/modules/web/scripts/cdp-smoke.ts +77 -0
  197. package/extensions/modules/web/scripts/gemini-smoke.ts +107 -0
  198. package/extensions/modules/web/test/agy.test.ts +383 -0
  199. package/extensions/modules/web/test/cdp.test.ts +717 -0
  200. package/extensions/modules/web/test/chat.test.ts +171 -0
  201. package/extensions/modules/web/test/chatgpt.test.ts +633 -0
  202. package/extensions/modules/web/test/chrome.test.ts +282 -0
  203. package/extensions/modules/web/test/config.test.ts +218 -0
  204. package/extensions/modules/web/test/configPanel.test.ts +132 -0
  205. package/extensions/modules/web/test/crawl.test.ts +134 -0
  206. package/extensions/modules/web/test/crawl4ai.test.ts +105 -0
  207. package/extensions/modules/web/test/extension.test.ts +118 -0
  208. package/extensions/modules/web/test/extract.test.ts +436 -0
  209. package/extensions/modules/web/test/fixtures/dr-confirm.bin +12 -0
  210. package/extensions/modules/web/test/fixtures/dr-plan.bin +20 -0
  211. package/extensions/modules/web/test/fixtures/interaction.html +31 -0
  212. package/extensions/modules/web/test/format.test.ts +230 -0
  213. package/extensions/modules/web/test/gemini-auth.test.ts +465 -0
  214. package/extensions/modules/web/test/gemini-dr.test.ts +249 -0
  215. package/extensions/modules/web/test/gemini.test.ts +472 -0
  216. package/extensions/modules/web/test/hook.test.ts +101 -0
  217. package/extensions/modules/web/test/image.test.ts +1089 -0
  218. package/extensions/modules/web/test/retry.test.ts +119 -0
  219. package/extensions/modules/web/test/screenshot.test.ts +109 -0
  220. package/extensions/modules/web/test/search.test.ts +210 -0
  221. package/extensions/modules/web/test/settings.test.ts +165 -0
  222. package/extensions/modules/web/test/skill.test.ts +72 -0
  223. package/extensions/modules/web/types.d.ts +3 -0
  224. package/extensions/modules/web/vendor/package.json +1 -0
  225. package/extensions/modules/web/vendor/readability/LICENSE.md +13 -0
  226. package/extensions/modules/web/vendor/readability/Readability-readerable.js +123 -0
  227. package/extensions/modules/web/vendor/readability/Readability.js +2787 -0
  228. package/extensions/modules/web/vendor/readability/index.d.ts +64 -0
  229. package/extensions/modules/web/vendor/readability/index.js +9 -0
  230. package/extensions/modules/web/vendor/turndown/LICENSE +21 -0
  231. package/extensions/modules/web/vendor/turndown/turndown.cjs.js +784 -0
  232. package/extensions/modules/web/vendor/turndown-plugin-gfm/LICENSE +21 -0
  233. package/extensions/modules/web/vendor/turndown-plugin-gfm/turndown-plugin-gfm.cjs.js +163 -0
  234. package/extensions/modules/zai/configPanel.ts +151 -0
  235. package/extensions/modules/zai/index.ts +186 -0
  236. package/extensions/modules/zai/lib/anthropic.ts +159 -0
  237. package/extensions/modules/zai/lib/settings.ts +198 -0
  238. package/extensions/modules/zai/lib/signing.ts +718 -0
  239. package/extensions/modules/zai/lib/throttle.ts +198 -0
  240. package/extensions/modules/zai/test/anthropic.test.ts +132 -0
  241. package/extensions/modules/zai/test/configPanel.test.ts +207 -0
  242. package/extensions/modules/zai/test/extension.test.ts +249 -0
  243. package/extensions/modules/zai/test/settings.test.ts +183 -0
  244. package/extensions/modules/zai/test/signing-wiring.test.ts +108 -0
  245. package/extensions/modules/zai/test/signing.test.ts +345 -0
  246. package/extensions/modules/zai/test/throttle.test.ts +329 -0
  247. package/package.json +19 -4
  248. package/scripts/validate-themes.mjs +75 -0
  249. package/skills/munin/SKILL.md +117 -0
  250. package/skills/ux-capture/SKILL.md +202 -0
  251. package/skills/ux-design/SKILL.md +279 -0
  252. package/skills/ux-presets/SKILL.md +484 -0
  253. package/skills/ux-routing/SKILL.md +46 -0
  254. package/skills/web/SKILL.md +153 -0
  255. package/themes/alabaster.json +93 -0
  256. package/themes/amethyst.json +96 -0
  257. package/themes/anthracite.json +93 -0
  258. package/themes/basalt.json +91 -0
  259. package/themes/birch.json +95 -0
  260. package/themes/catppuccin-mocha.json +91 -0
  261. package/themes/dark-abyss.json +91 -0
  262. package/themes/dark-arctic.json +104 -0
  263. package/themes/dark-aurora.json +95 -0
  264. package/themes/dark-catppuccin.json +107 -0
  265. package/themes/dark-cavern.json +91 -0
  266. package/themes/dark-celestial.json +106 -0
  267. package/themes/dark-copper.json +95 -0
  268. package/themes/dark-cosmos.json +90 -0
  269. package/themes/dark-cyberpunk.json +102 -0
  270. package/themes/dark-dracula.json +98 -0
  271. package/themes/dark-eclipse.json +91 -0
  272. package/themes/dark-ember.json +95 -0
  273. package/themes/dark-equinox.json +90 -0
  274. package/themes/dark-forest.json +96 -0
  275. package/themes/dark-github.json +105 -0
  276. package/themes/dark-gruvbox.json +112 -0
  277. package/themes/dark-lavender.json +95 -0
  278. package/themes/dark-lunar.json +89 -0
  279. package/themes/dark-midnight.json +95 -0
  280. package/themes/dark-monochrome.json +94 -0
  281. package/themes/dark-monokai.json +98 -0
  282. package/themes/dark-nebula.json +90 -0
  283. package/themes/dark-neon-noir.json +100 -0
  284. package/themes/dark-nord.json +98 -0
  285. package/themes/dark-ocean.json +101 -0
  286. package/themes/dark-one.json +100 -0
  287. package/themes/dark-poimandres.json +115 -0
  288. package/themes/dark-rainforest.json +91 -0
  289. package/themes/dark-reef.json +91 -0
  290. package/themes/dark-retro.json +92 -0
  291. package/themes/dark-rose-pine.json +96 -0
  292. package/themes/dark-sakura.json +95 -0
  293. package/themes/dark-slate.json +95 -0
  294. package/themes/dark-solarized.json +97 -0
  295. package/themes/dark-solstice.json +90 -0
  296. package/themes/dark-starfall.json +91 -0
  297. package/themes/dark-sunset.json +99 -0
  298. package/themes/dark-swamp.json +90 -0
  299. package/themes/dark-synthwave.json +103 -0
  300. package/themes/dark-taiga.json +91 -0
  301. package/themes/dark-terminal.json +95 -0
  302. package/themes/dark-tokyo-night.json +101 -0
  303. package/themes/dark-tundra.json +91 -0
  304. package/themes/dark-twilight.json +91 -0
  305. package/themes/dark-volcanic.json +91 -0
  306. package/themes/dark.json +80 -0
  307. package/themes/graphite.json +92 -0
  308. package/themes/light-arctic.json +107 -0
  309. package/themes/light-aurora-day.json +91 -0
  310. package/themes/light-canyon.json +91 -0
  311. package/themes/light-catppuccin.json +106 -0
  312. package/themes/light-cirrus.json +90 -0
  313. package/themes/light-coral.json +95 -0
  314. package/themes/light-cyberpunk.json +96 -0
  315. package/themes/light-dawn.json +90 -0
  316. package/themes/light-dunes.json +91 -0
  317. package/themes/light-eucalyptus.json +95 -0
  318. package/themes/light-forest.json +100 -0
  319. package/themes/light-frost.json +95 -0
  320. package/themes/light-github.json +115 -0
  321. package/themes/light-glacier.json +91 -0
  322. package/themes/light-gruvbox.json +108 -0
  323. package/themes/light-haze.json +90 -0
  324. package/themes/light-honeycomb.json +95 -0
  325. package/themes/light-lagoon.json +91 -0
  326. package/themes/light-lavender.json +95 -0
  327. package/themes/light-meadow.json +91 -0
  328. package/themes/light-mint.json +95 -0
  329. package/themes/light-monochrome.json +101 -0
  330. package/themes/light-ocean.json +99 -0
  331. package/themes/light-one.json +99 -0
  332. package/themes/light-opal.json +91 -0
  333. package/themes/light-orchard.json +91 -0
  334. package/themes/light-paper.json +95 -0
  335. package/themes/light-poimandres.json +115 -0
  336. package/themes/light-prism.json +90 -0
  337. package/themes/light-retro.json +98 -0
  338. package/themes/light-sand.json +95 -0
  339. package/themes/light-savanna.json +91 -0
  340. package/themes/light-solarized.json +102 -0
  341. package/themes/light-soleil.json +90 -0
  342. package/themes/light-sunset.json +99 -0
  343. package/themes/light-synthwave.json +98 -0
  344. package/themes/light-tokyo-night.json +111 -0
  345. package/themes/light-wetland.json +91 -0
  346. package/themes/light-zenith.json +89 -0
  347. package/themes/light.json +80 -0
  348. package/themes/limestone.json +94 -0
  349. package/themes/mahogany.json +97 -0
  350. package/themes/marble.json +93 -0
  351. package/themes/mirage.json +79 -0
  352. package/themes/obsidian.json +91 -0
  353. package/themes/onyx.json +91 -0
  354. package/themes/pearl.json +93 -0
  355. package/themes/porcelain.json +91 -0
  356. package/themes/quartz.json +96 -0
  357. package/themes/sandstone.json +95 -0
  358. package/themes/titanium.json +90 -0
@@ -0,0 +1,436 @@
1
+ import { describe, it, beforeEach, afterEach } from "node:test";
2
+ import assert from "node:assert/strict";
3
+ import { createRequire } from "node:module";
4
+
5
+ import {
6
+ extractWithDiagnostics,
7
+ type ExtractMode,
8
+ type ExtractParams,
9
+ type ExtractResult,
10
+ } from "../lib/extract";
11
+ import { resetAgyInstalledCache } from "../lib/agy";
12
+
13
+ // The web settings layer reads the agent-dir settings.json — isolate the
14
+ // agent dir so a host `web` section never leaks into these tests.
15
+ process.env.PI_CODING_AGENT_DIR = "/nonexistent-pi-agent-dir-for-web-tests";
16
+
17
+ // chai-compat helpers (assert-based)
18
+ function includes(haystack: unknown, needle: unknown): boolean {
19
+ if (typeof haystack === "string") return haystack.includes(String(needle));
20
+ if (Array.isArray(haystack)) return (haystack as unknown[]).some((v) => {
21
+ if (typeof v === "string" && typeof needle === "string") return v.includes(needle);
22
+ if (v === needle) return true;
23
+ // chai's to.include on an array does DEEP membership for objects.
24
+ if (v && needle && typeof v === "object" && typeof needle === "object") {
25
+ try { assert.deepStrictEqual(v, needle); return true; } catch { return false; }
26
+ }
27
+ return false;
28
+ });
29
+ // chai's to.include on an OBJECT target: needle's properties are a subset.
30
+ if (haystack && typeof haystack === "object" && needle && typeof needle === "object") {
31
+ return deepIncludes(haystack, needle as Record<string, unknown>);
32
+ }
33
+ return false;
34
+ }
35
+ function lengthOf(v: unknown): number {
36
+ if (Array.isArray(v)) return v.length;
37
+ if (typeof v === "string") return v.length;
38
+ if (v && typeof v === "object" && "length" in (v as Record<string, unknown>)) return Number((v as Record<string, unknown>).length);
39
+ if (v && typeof v === "object" && "size" in (v as Record<string, unknown>)) return Number((v as Record<string, unknown>).size);
40
+ throw new Error("lengthOf: value has no length/size");
41
+ }
42
+ /** Deep "includes" — every own key of `part` must exist on `obj` with a
43
+ * deep-equal value (chai's to.deep.include for object subjects). */
44
+ function deepIncludes(obj: unknown, part: Record<string, unknown>): boolean {
45
+ if (Array.isArray(obj)) return includes(obj, part); // deep membership
46
+ if (typeof obj !== "object" || obj === null) return false;
47
+ return Object.entries(part).every(([k, v]) => {
48
+ try { assert.deepStrictEqual((obj as Record<string, unknown>)[k], v); return true; } catch { return false; }
49
+ });
50
+ }
51
+
52
+ const _require = createRequire(import.meta.url);
53
+
54
+ const ORIGINAL_ENV = { ...process.env };
55
+ const ORIGINAL_FETCH = globalThis.fetch;
56
+
57
+ function jsonResponse(body: unknown, status = 200): Response {
58
+ return new Response(JSON.stringify(body), {
59
+ status,
60
+ headers: { "content-type": "application/json" },
61
+ });
62
+ }
63
+
64
+ function htmlResponse(body: string, status = 200): Response {
65
+ return new Response(body, {
66
+ status,
67
+ headers: { "content-type": "text/html" },
68
+ });
69
+ }
70
+
71
+ function installMockFetch(handler: (url: string, init?: RequestInit) => Response | Promise<Response>): string[] {
72
+ const calls: string[] = [];
73
+ globalThis.fetch = (async (input: RequestInfo | URL, init?: RequestInit) => {
74
+ const url = String(input);
75
+ calls.push(url);
76
+ return handler(url, init);
77
+ }) as typeof fetch;
78
+ return calls;
79
+ }
80
+
81
+ function restoreEnv(): void {
82
+ process.env = { ...ORIGINAL_ENV };
83
+ }
84
+
85
+ describe("ExtractParams and ExtractResult types", () => {
86
+ it("accept expected fields", () => {
87
+ const modes: ExtractMode[] = ["auto", "static", "dynamic", "full", "agy"];
88
+ const params: ExtractParams = { url: "https://example.com", mode: modes[0], wait_for: 1000, mobile: true };
89
+ const result: ExtractResult = { title: "Title", markdown: "Content", backend: "static", structured: { ok: true } };
90
+ assert.equal(params.mode, "auto");
91
+ assert.deepEqual(result.structured, { ok: true });
92
+ });
93
+ });
94
+
95
+ describe("extractWithDiagnostics", () => {
96
+ beforeEach(() => {
97
+ restoreEnv();
98
+ process.env.FIRECRAWL_API_URL = "http://firecrawl.test/v2";
99
+ process.env.CRAWL4AI_API_URL = "http://crawl4ai.test";
100
+ resetAgyInstalledCache(); // agy install cache is module-level — must reset between tests
101
+ });
102
+
103
+ afterEach(() => {
104
+ globalThis.fetch = ORIGINAL_FETCH;
105
+ restoreEnv();
106
+ resetAgyInstalledCache();
107
+ });
108
+
109
+ it("uses static extraction when it returns useful content", async () => {
110
+ installMockFetch((url) => {
111
+ if (url === "https://example.com/static") {
112
+ return htmlResponse("<html><head><title>Static</title></head><body><main><h1>Static</h1><p>This static article has enough readable text to pass the useful-content threshold in auto mode without falling back.</p><p>Additional words make it reliably longer than the minimum threshold.</p></main></body></html>");
113
+ }
114
+ throw new Error(`unexpected fetch ${url}`);
115
+ });
116
+
117
+ const diagnostics = await extractWithDiagnostics({ url: "https://example.com/static" });
118
+ assert.equal(diagnostics.selectedMode, "static");
119
+ assert.strictEqual(diagnostics.fallbackUsed, false);
120
+ assert.ok(includes(diagnostics.result.markdown, "static article"));
121
+ });
122
+
123
+ it("passes raw text/plain and JSON bodies through without Readability", async () => {
124
+ installMockFetch((url) => {
125
+ if (url === "https://raw.test/code.js") {
126
+ return new Response("// A module used by tests.\n" + "export function boot() { return 42; }\n".repeat(6), { status: 200, headers: { "content-type": "text/plain; charset=utf-8" } });
127
+ }
128
+ if (url === "https://raw.test/data.json") {
129
+ return new Response(JSON.stringify({ name: "pi-fff", stars: 99, description: "Fuzzy file and content search for Pi, well over the useful-content threshold for extraction." }), { status: 200, headers: { "content-type": "application/json" } });
130
+ }
131
+ if (url === "https://raw.test/page.html") {
132
+ return htmlResponse("<html><head><title>Page</title></head><body><main><h1>Page</h1><p>This ordinary web page has plenty of readable content to pass the useful-content threshold in auto mode. Additional sentences ensure the extracted text is long enough to be considered useful by the extraction pipeline.</p><p>More filler keeps the article comfortably above the minimum length so the static path succeeds without falling through.</p></main></body></html>");
133
+ }
134
+ throw new Error(`unexpected fetch ${url}`);
135
+ });
136
+
137
+ const textDiag = await extractWithDiagnostics({ url: "https://raw.test/code.js" });
138
+ assert.equal(textDiag.selectedMode, "static");
139
+ assert.ok(includes(textDiag.result.markdown, "return 42;"));
140
+
141
+ const jsonDiag = await extractWithDiagnostics({ url: "https://raw.test/data.json" });
142
+ assert.ok(includes(jsonDiag.result.markdown, '"stars":99'));
143
+ assert.equal(jsonDiag.result.markdown.indexOf("```json"), 0);
144
+
145
+ // text/html must still go through Readability → markdown, not raw source
146
+ const htmlDiag = await extractWithDiagnostics({ url: "https://raw.test/page.html" });
147
+ assert.ok(!includes(htmlDiag.result.markdown, "<main>"));
148
+ assert.equal(htmlDiag.result.title, "Page");
149
+ assert.ok(includes(htmlDiag.result.markdown, "plenty of readable content"));
150
+ });
151
+
152
+ it("falls through from short static content to dynamic extraction", async () => {
153
+ const calls = installMockFetch((url) => {
154
+ if (url === "https://example.com/short") return htmlResponse("<html><body><main>short</main></body></html>");
155
+ if (url === "http://firecrawl.test/v2/scrape") {
156
+ return jsonResponse({ data: { markdown: "# Dynamic\n\nDynamic content from Firecrawl after static extraction was too short.", metadata: { title: "Dynamic", sourceURL: "https://example.com/short" } } });
157
+ }
158
+ throw new Error(`unexpected fetch ${url}`);
159
+ });
160
+
161
+ const diagnostics = await extractWithDiagnostics({ url: "https://example.com/short" });
162
+ assert.equal(diagnostics.selectedMode, "dynamic");
163
+ assert.strictEqual(diagnostics.fallbackUsed, true);
164
+ assert.deepEqual(diagnostics.attempts.map((a) => a.mode), ["static", "dynamic"]);
165
+ assert.ok(includes(diagnostics.result.markdown, "fell back to Firecrawl"));
166
+ assert.deepEqual(calls, ["https://example.com/short", "http://firecrawl.test/v2/scrape"]);
167
+ });
168
+
169
+ it("explicit static mode does not fall through", async () => {
170
+ installMockFetch((url) => {
171
+ if (url === "https://example.com/short") return htmlResponse("<html><body><main>short</main></body></html>");
172
+ throw new Error(`unexpected fetch ${url}`);
173
+ });
174
+
175
+ const diagnostics = await extractWithDiagnostics({ url: "https://example.com/short", mode: "static" });
176
+ assert.equal(diagnostics.selectedMode, "static");
177
+ assert.ok(includes(diagnostics.result.markdown, "short"));
178
+ });
179
+
180
+ it("dynamic mode includes structured JSON output when present", async () => {
181
+ installMockFetch((url, init) => {
182
+ if (url === "http://firecrawl.test/v2/scrape") {
183
+ const body = JSON.parse(String(init?.body));
184
+ assert.deepEqual(body.formats, ["markdown", "json"]);
185
+ assert.deepEqual(body.jsonOptions, { prompt: "Extract title" });
186
+ return jsonResponse({ data: { markdown: "# Dynamic\n\nBody", json: { title: "Structured" }, metadata: { title: "Dynamic" } } });
187
+ }
188
+ throw new Error(`unexpected fetch ${url}`);
189
+ });
190
+
191
+ const diagnostics = await extractWithDiagnostics({ url: "https://example.com/dynamic", mode: "dynamic", prompt: "Extract title" });
192
+ assert.deepEqual(diagnostics.result.structured, { title: "Structured" });
193
+ assert.ok(includes(diagnostics.result.markdown, "## Structured extraction"));
194
+ });
195
+
196
+ it("falls through to full mode when static and dynamic fail", async () => {
197
+ installMockFetch((url) => {
198
+ if (url === "https://example.com/full") return htmlResponse("<html><body><main>tiny</main></body></html>");
199
+ if (url === "http://firecrawl.test/v2/scrape") return jsonResponse({ error: "blocked" }, 500);
200
+ if (url === "http://crawl4ai.test/md") return jsonResponse({ success: true, markdown: "# Full\n\nCrawl4AI markdown content" });
201
+ throw new Error(`unexpected fetch ${url}`);
202
+ });
203
+
204
+ const diagnostics = await extractWithDiagnostics({ url: "https://example.com/full" });
205
+ assert.equal(diagnostics.selectedMode, "full");
206
+ assert.deepEqual(diagnostics.attempts.map((a) => a.mode), ["static", "dynamic", "full"]);
207
+ assert.ok(includes(diagnostics.result.markdown, "Crawl4AI"));
208
+ });
209
+
210
+ it("falls through to agy mode when static/dynamic/full all fail and agy is installed", async () => {
211
+ const cp = _require("node:child_process");
212
+ const origSpawn = cp.spawn;
213
+ const origSpawnSync = cp.spawnSync;
214
+ cp.spawnSync = () => ({ status: 0 }); // agy installed
215
+ cp.spawn = function () {
216
+ const { EventEmitter } = _require("events");
217
+ const child = new EventEmitter() as any;
218
+ child.stdout = new EventEmitter();
219
+ child.stderr = new EventEmitter();
220
+ child.pid = 123;
221
+ process.nextTick(() => {
222
+ child.stdout.emit("data", Buffer.from(JSON.stringify({ response: "# agy content\n\nFetched via read_url" })));
223
+ child.emit("close", 0, null);
224
+ });
225
+ return child;
226
+ } as any;
227
+
228
+ installMockFetch((url) => {
229
+ if (url === "https://example.com/blocked") return htmlResponse("<html><body><main>tiny</main></body></html>");
230
+ if (url === "http://firecrawl.test/v2/scrape") return jsonResponse({ error: "blocked" }, 500);
231
+ if (url === "http://crawl4ai.test/md") return jsonResponse({ error: "blocked" }, 500);
232
+ throw new Error(`unexpected fetch ${url}`);
233
+ });
234
+
235
+ try {
236
+ const diagnostics = await extractWithDiagnostics({ url: "https://example.com/blocked" });
237
+ assert.equal(diagnostics.selectedMode, "agy");
238
+ assert.deepEqual(diagnostics.attempts.map((a) => a.mode), ["static", "dynamic", "full", "agy"]);
239
+ assert.ok(includes(diagnostics.result.markdown, "agy (model-backed browser)"));
240
+ assert.ok(includes(diagnostics.result.markdown, "Fetched via read_url"));
241
+ } finally {
242
+ cp.spawn = origSpawn;
243
+ cp.spawnSync = origSpawnSync;
244
+ }
245
+ });
246
+
247
+ it("skips agy in auto chain when agy is not installed", async () => {
248
+ const cp = _require("node:child_process");
249
+ const origSpawnSync = cp.spawnSync;
250
+ cp.spawnSync = () => ({ status: 1 }); // agy not installed
251
+
252
+ installMockFetch((url) => {
253
+ if (url === "https://example.com/skipagy") return htmlResponse("<html><body><main>tiny</main></body></html>");
254
+ if (url === "http://firecrawl.test/v2/scrape") return jsonResponse({ error: "blocked" }, 500);
255
+ if (url === "http://crawl4ai.test/md") return jsonResponse({ success: true, markdown: "# Full\n\nCrawl4AI fallback content" });
256
+ throw new Error(`unexpected fetch ${url}`);
257
+ });
258
+
259
+ try {
260
+ const diagnostics = await extractWithDiagnostics({ url: "https://example.com/skipagy" });
261
+ assert.equal(diagnostics.selectedMode, "full");
262
+ assert.deepEqual(diagnostics.attempts.map((a) => a.mode), ["static", "dynamic", "full"]);
263
+ } finally {
264
+ cp.spawnSync = origSpawnSync;
265
+ }
266
+ });
267
+
268
+ it("explicit agy mode calls agy directly", async () => {
269
+ const cp = _require("node:child_process");
270
+ const origSpawn = cp.spawn;
271
+ const origSpawnSync = cp.spawnSync;
272
+ cp.spawnSync = () => ({ status: 0 });
273
+ let capturedArgs: string[] | null = null;
274
+ cp.spawn = function (_cmd: string, args: string[]) {
275
+ capturedArgs = args;
276
+ const { EventEmitter } = _require("events");
277
+ const child = new EventEmitter() as any;
278
+ child.stdout = new EventEmitter();
279
+ child.stderr = new EventEmitter();
280
+ child.pid = 123;
281
+ process.nextTick(() => {
282
+ child.stdout.emit("data", Buffer.from(JSON.stringify({ response: "# Direct agy\n\ncontent" })));
283
+ child.emit("close", 0, null);
284
+ });
285
+ return child;
286
+ } as any;
287
+
288
+ try {
289
+ const diagnostics = await extractWithDiagnostics({ url: "https://example.com/direct", mode: "agy" });
290
+ assert.equal(diagnostics.selectedMode, "agy");
291
+ assert.deepEqual(diagnostics.attempts.map((a) => a.mode), ["agy"]);
292
+ assert.notStrictEqual(capturedArgs, null);
293
+ assert.ok(!includes(capturedArgs!.join(" "), "--dangerously-skip-permissions"));
294
+ assert.ok(includes(capturedArgs!.join(" "), "read_url"));
295
+ assert.ok(includes(diagnostics.result.markdown, "Direct agy"));
296
+ } finally {
297
+ cp.spawn = origSpawn;
298
+ cp.spawnSync = origSpawnSync;
299
+ }
300
+ });
301
+
302
+ it("agy structured extraction populates structured field and strips fenced JSON", async () => {
303
+ const cp = _require("node:child_process");
304
+ const origSpawn = cp.spawn;
305
+ const origSpawnSync = cp.spawnSync;
306
+ cp.spawnSync = () => ({ status: 0 });
307
+ cp.spawn = function () {
308
+ const { EventEmitter } = _require("events");
309
+ const child = new EventEmitter() as any;
310
+ child.stdout = new EventEmitter();
311
+ child.stderr = new EventEmitter();
312
+ child.pid = 123;
313
+ process.nextTick(() => {
314
+ child.stdout.emit("data", Buffer.from(JSON.stringify({ response: '```json\n{"title": "Moby", "first": "sentence"}\n```\n' })));
315
+ child.emit("close", 0, null);
316
+ });
317
+ return child;
318
+ } as any;
319
+
320
+ try {
321
+ const diagnostics = await extractWithDiagnostics({
322
+ url: "https://example.com/structured",
323
+ mode: "agy",
324
+ schema: { title: "string" },
325
+ });
326
+ assert.deepEqual(diagnostics.result.structured, { title: "Moby", first: "sentence" });
327
+ // raw model fenced block stripped; only the renderer's own block remains
328
+ assert.equal(diagnostics.result.markdown.split("```json").length - 1, 1);
329
+ assert.ok(includes(diagnostics.result.markdown, "## Structured extraction"));
330
+ } finally {
331
+ cp.spawn = origSpawn;
332
+ cp.spawnSync = origSpawnSync;
333
+ }
334
+ });
335
+
336
+ it("agy prompt-only (no schema) also populates structured field", async () => {
337
+ const cp = _require("node:child_process");
338
+ const origSpawn = cp.spawn;
339
+ const origSpawnSync = cp.spawnSync;
340
+ cp.spawnSync = () => ({ status: 0 });
341
+ cp.spawn = function () {
342
+ const { EventEmitter } = _require("events");
343
+ const child = new EventEmitter() as any;
344
+ child.stdout = new EventEmitter();
345
+ child.stderr = new EventEmitter();
346
+ child.pid = 123;
347
+ process.nextTick(() => {
348
+ child.stdout.emit("data", Buffer.from(JSON.stringify({ response: '```json\n{"title": "Moby"}\n```\n' })));
349
+ child.emit("close", 0, null);
350
+ });
351
+ return child;
352
+ } as any;
353
+
354
+ try {
355
+ const diagnostics = await extractWithDiagnostics({
356
+ url: "https://example.com/promptonly",
357
+ mode: "agy",
358
+ prompt: "Extract the title",
359
+ });
360
+ assert.deepEqual(diagnostics.result.structured, { title: "Moby" });
361
+ } finally {
362
+ cp.spawn = origSpawn;
363
+ cp.spawnSync = origSpawnSync;
364
+ }
365
+ });
366
+
367
+ it("agy structured JSON is not duplicated in the body when only JSON is returned", async () => {
368
+ const cp = _require("node:child_process");
369
+ const origSpawn = cp.spawn;
370
+ const origSpawnSync = cp.spawnSync;
371
+ cp.spawnSync = () => ({ status: 0 });
372
+ cp.spawn = function () {
373
+ const { EventEmitter } = _require("events");
374
+ const child = new EventEmitter() as any;
375
+ child.stdout = new EventEmitter();
376
+ child.stderr = new EventEmitter();
377
+ child.pid = 123;
378
+ process.nextTick(() => {
379
+ child.stdout.emit("data", Buffer.from(JSON.stringify({ response: '```json\n{"title": "Moby"}\n```\n' })));
380
+ child.emit("close", 0, null);
381
+ });
382
+ return child;
383
+ } as any;
384
+
385
+ try {
386
+ const diagnostics = await extractWithDiagnostics({
387
+ url: "https://example.com/jsononly",
388
+ mode: "agy",
389
+ schema: { title: "string" },
390
+ });
391
+ const md = diagnostics.result.markdown;
392
+ const sectionIdx = md.indexOf("## Structured extraction");
393
+ const body = md.slice(0, sectionIdx);
394
+ // JSON appears only once total (in the structured section), not verbatim in body
395
+ assert.ok(!includes(body, '"title"'));
396
+ assert.ok(includes(body, "Structured extraction only"));
397
+ assert.equal(md.split('"title"').length - 1, 1);
398
+ } finally {
399
+ cp.spawn = origSpawn;
400
+ cp.spawnSync = origSpawnSync;
401
+ }
402
+ });
403
+
404
+ it("agy bare-JSON output (no fence) still populates structured field", async () => {
405
+ const cp = _require("node:child_process");
406
+ const origSpawn = cp.spawn;
407
+ const origSpawnSync = cp.spawnSync;
408
+ cp.spawnSync = () => ({ status: 0 });
409
+ cp.spawn = function () {
410
+ const { EventEmitter } = _require("events");
411
+ const child = new EventEmitter() as any;
412
+ child.stdout = new EventEmitter();
413
+ child.stderr = new EventEmitter();
414
+ child.pid = 123;
415
+ process.nextTick(() => {
416
+ child.stdout.emit("data", Buffer.from(JSON.stringify({ response: '{"title": "Moby"}\n' })));
417
+ child.emit("close", 0, null);
418
+ });
419
+ return child;
420
+ } as any;
421
+
422
+ try {
423
+ const diagnostics = await extractWithDiagnostics({
424
+ url: "https://example.com/barejson",
425
+ mode: "agy",
426
+ schema: { title: "string" },
427
+ });
428
+ assert.deepEqual(diagnostics.result.structured, { title: "Moby" });
429
+ assert.ok(includes(diagnostics.result.markdown, "Structured extraction only"));
430
+ } finally {
431
+ cp.spawn = origSpawn;
432
+ cp.spawnSync = origSpawnSync;
433
+ }
434
+ });
435
+
436
+ });
@@ -0,0 +1,12 @@
1
+ )]}'
2
+
3
+ 177
4
+ [["wrb.fr",null,"[null,[\"c_10950ff6b1b0ebc1\",\"r_8d0d706f1f6d605a\"],{\"18\":\"r_8d0d706f1f6d605a\",\"21\":[\"-f7o3eTGR0msv5diEfqdSQD5C4u9-Xep4taW7RbT-7k\"],\"44\":true}]"]]
5
+ 2118
6
+ [["wrb.fr",null,"[null,[\"c_10950ff6b1b0ebc1\",\"r_8d0d706f1f6d605a\"],null,null,[[\"rc_f677b23c177da006\",[\"Great, I'm on it. I'll let you know when the research is finished. You can leave this chat in the meantime.\\n\\nhttp://googleusercontent.com/immersive_entry_chip/0\"],null,null,null,null,null,null,[1],null,null,null,[null,null,null,null,null,null,null,[],{\"57\":[[[\"http://googleusercontent.com/immersive_entry_chip/0\"],\"im_b0b79bb5c1358740\",\"agency-placeholder-task-id\",\"History of JPEG Compression\",null,[1789326587,993201000],null,3]],\"58\":[\"agency-placeholder-task-id\",[null,null,null,null,[\"History of JPEG Compression\"]],[null,[]],null,[]],\"70\":3}],null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,[],null,[[\"im_b0b79bb5c1358740\",null,\"History of JPEG Compression\",\"agency-placeholder-task-id\",\"\",[{\"70\":3}],null,null,[],\"im_b0b79bb5c1358740\",3,null,false,null,null,null,null,[\"\",[{\"70\":3}],null,[]]]],null,null,null,null,null,null,[]]],[\"Ha Dong, Ha Noi, Vietnam\",\"SWML_DESCRIPTION_FROM_YOUR_INTERNET_ADDRESS\",false,null,\"//www.google.com/maps/vt/data\\u003dJ9ojrGEG2GSAiLZq9odjIkDkUM_iNyNknjytmjhZw4lVwk-oAnyUvylvWsxEW_U1Szr_2sOBVvOJKk1cEkLdKiMrVYxm0pXLDRhf8mBfUw8v5m2yOy9G7S3Yk8OT4I33fbWcAX4DEEXynxsZl4Rb7A4Ib9nAOaa6aOtXx0K8VitZwevxHASjpFEALPsgo719\"],null,null,\"VN\",null,null,null,null,null,false,null,null,null,null,\"en\",null,null,null,true,[null,[false,false,true],[false,false,false,false,false],false],null,[[[[null,[null,0,\"Great, I'm on it. I'll let you know when the research is finished. You can leave this chat in the meantime.\"]],[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,[[[\"http://googleusercontent.com/immersive_entry_chip/0\"],\"im_b0b79bb5c1358740\",\"agency-placeholder-task-id\",\"History of JPEG Compression\",null,[1789326587,993201000],null,3]]]]]],null,null,[1,1,1],null,null,null,null,null,null,null,null,null,null,null,null,\"3.5 Flash-Lite\",true,[[]],null,2,null,null,null,null,null,null,null,null,null,null,null,6,1]"]]
7
+ 995
8
+ [["wrb.fr",null,"[null,[\"c_10950ff6b1b0ebc1\",\"r_8d0d706f1f6d605a\"],{\"44\":true,\"46\":[\"c_10950ff6b1b0ebc1\",\"KvsECipDaEJpTW1ZMVlXVTFNamczWm1NMU1UZGxFQWdhQkRaaE9UZ3FBMkZ3WXcSEmNfMTA5NTBmZjZiMWIwZWJjMRodChVDaGF0UmVzcG9uc2VQcm9jZXNzb3ISBAoAOAEadgoXQ29udGV4dE1hbmFnZXJQcm9jZXNzb3ISWypZClcKU2JhcmQvZ2VtaW5pX2NoYXQvMC4wLjEtZGVlcF9yZXNlYXJjaF9iYXNfY29udGV4dF9tYW5hZ2VyX2FnZW50XzE0ODMwMDM4MTI1NjA3MTY2MzA3GAEaMwoXUmVteUdvYWxTdGF0dXNQcm9jZXNzb3ISGAoWChQKEDE3ODkzMjY1ODc5ODUyMzgQKho1ChVBc3luY1RyaWdnZXJQcm9jZXNzb3ISHAoaChQKEDE3ODkzMjY1ODc5ODc0ODQQKxAAGAIaMAoUUmVxdWVzdENvc3RQcm9jZXNzb3ISGAoWChQKEDE3ODkzMjY1ODc5NzE4OTQQEiJmEhJyXzhkMGQ3MDZmMWY2ZDYwNWEaEnJfOGQwZDcwNmYxZjZkNjA1YSITcmNfZjY3N2IyM2MxNzdkYTAwNioScl9iMWE4ZTYzZGEyMWFlMjQ0MhNyY19hOWEwOGY5NTcyZGI2NDI0KjMKJGJhcmQvZ2VtaW5pX2NoYXQvMC4wLjEtZGVlcF9yZXNlYXJjaBILYmFzX2NoYW5uZWxaFAoQMTc4OTMyNjU4Nzk5MDU5MRAwaAGiAQQIARABsAHa7bPhiTTCARgKEnJfOGQwZDcwNmYxZjZkNjA1YRICEAHSASQyRTYwREYxOC0yM0YwLTQwQkUtOTE2Ny1FODVDREIzM0NCQjI\\u003d\"],\"52\":[]}]"]]
9
+ 59
10
+ [["di",1142],["af.httprm",1141,"-768050095059620953",51]]
11
+ 26
12
+ [["e",6,null,null,3395]]
@@ -0,0 +1,20 @@
1
+ )]}'
2
+
3
+ 177
4
+ [["wrb.fr",null,"[null,[\"c_10950ff6b1b0ebc1\",\"r_b1a8e63da21ae244\"],{\"18\":\"r_b1a8e63da21ae244\",\"21\":[\"dBOphGzo_SbGikcnFHbFN6u18yG3oGIadMA6B6n_huI\"],\"44\":true}]"]]
5
+ 1802
6
+ [["wrb.fr",null,"[null,[\"c_10950ff6b1b0ebc1\",\"r_b1a8e63da21ae244\"],null,null,[[\"rc_a9a08f9572db6424\",[\"\"],null,null,null,null,null,null,[1],null,null,null,[null,null,null,null,null,null,null,[]],null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,[],null,null,null,null,null,null,null,null,[[\"***Generating research plan***\\n\\nTo best answer your request, I'm starting by constructing a comprehensive research plan. This will outline the key areas I need to investigate and the strategy I'll use to connect them.\"],[[[\"***Generating research plan***\\n\\nTo best answer your request, I'm starting by constructing a comprehensive research plan. This will outline the key areas I need to investigate and the strategy I'll use to connect them.\"],\"\",\"\",\"\",[[[null,[null,0,\"Generating research plan\",[[0,24,[[null,null,null,null,2]]],[0,24,[[null,null,null,null,1]]]]]],[null,[null,0,\"To best answer your request, I'm starting by constructing a comprehensive research plan. This will outline the key areas I need to investigate and the strategy I'll use to connect them.\"]]]],\"\",\"\"]]]]],[\"Ha Dong, Ha Noi, Vietnam\",\"SWML_DESCRIPTION_FROM_YOUR_INTERNET_ADDRESS\",false,null,\"//www.google.com/maps/vt/data\\u003dJ9ojrGEG2GSAiLZq9odjIkDkUM_iNyNknjytmjhZw4lVwk-oAnyUvylvWsxEW_U1Szr_2sOBVvOJKk1cEkLdKiMrVYxm0pXLDRhf8mBfUw8v5m2yOy9G7S3Yk8OT4I33fbWcAX4DEEXynxsZl4Rb7A4Ib9nAOaa6aOtXx0K8VitZwevxHASjpFEALPsgo719\"],null,null,\"VN\",null,null,null,null,null,false,null,null,null,null,\"en\",null,null,null,true,[null,[false,true,true],[false,false,false,false,false],false],null,[[]],null,null,[1,1,1],null,null,null,null,null,null,null,null,null,null,null,null,\"3.5 Flash-Lite\",true,[[]],null,2,null,null,null,null,null,null,null,null,null,null,null,6,1]"]]
7
+ 5358
8
+ [["wrb.fr",null,"[null,[\"c_10950ff6b1b0ebc1\",\"r_b1a8e63da21ae244\"],null,null,[[\"rc_a9a08f9572db6424\",[\"Here's the plan I've put together. Let me know if you need any changes before I start researching.\\nhttp://googleusercontent.com/deep_research_confirmation_content/0\\n\"],null,null,null,null,null,null,[1],\"en\",null,null,[{\"8\":[],\"56\":[\"History of JPEG Compression\",[[1,\"Research Websites\",\"(1) Investigate the pre-JPEG origins of image compression, focusing on the invention of the Discrete Cosine Transform (DCT) in 1974 and early compression research.\\n(2) Research the formation of the Joint Photographic Experts Group committee in 1986 by ISO, IEC, and ITU-T, identifying key contributors and initial goals.\\n(3) Trace the development process and formal standardization of JPEG leading to the publication of ISO/IEC 10918-1 (ITU-T T.81) in 1992.\\n(4) Analyze the core technical components defined in the original JPEG standard:\\n (a) Color space conversion (RGB to YCbCr) and chrominance subsampling\\n (b) 8x8 block-based Discrete Cosine Transform (DCT)\\n (c) Quantization matrix selection and lossy compression trade-offs\\n (d) Entropy encoding techniques including Huffman coding and arithmetic coding\\n(5) Investigate major patent controversies and licensing challenges, such as the Forgent Networks patent enforcement attempt in the early 2000s.\\n(6) Evaluate the historical impact of JPEG on the growth of the World Wide Web, digital photography, and personal computing.\\n(7) Examine the development of successor image standards (JPEG 2000, JPEG XR, JPEG XL, WebP, AVIF) and analyze why the original JPEG format maintains broad dominance.\"],[2,\"Analyze Results\"],[3,\"Create Report\"]],\"Ready in a few mins\",[\"Start research\"],[\"http://googleusercontent.com/deep_research_confirmation_content/0\",0],[\"Edit plan\",[null,null,null,\"Edit the research plan\"]]],\"70\":2}],null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,[],null,null,null,null,null,null,null,null,[[\"***Generating research plan***\\n\\nTo best answer your request, I'm starting by constructing a comprehensive research plan. This will outline the key areas I need to investigate and the strategy I'll use to connect them.\"],[[[\"***Generating research plan***\\n\\nTo best answer your request, I'm starting by constructing a comprehensive research plan. This will outline the key areas I need to investigate and the strategy I'll use to connect them.\"],\"\",\"\",\"\",[[[null,[null,0,\"Generating research plan\",[[0,24,[[null,null,null,null,2]]],[0,24,[[null,null,null,null,1]]]]]],[null,[null,0,\"To best answer your request, I'm starting by constructing a comprehensive research plan. This will outline the key areas I need to investigate and the strategy I'll use to connect them.\"]]]],\"\",\"\"]]]]],[\"Ha Dong, Ha Noi, Vietnam\",\"SWML_DESCRIPTION_FROM_YOUR_INTERNET_ADDRESS\",false,null,\"//www.google.com/maps/vt/data\\u003dJ9ojrGEG2GSAiLZq9odjIkDkUM_iNyNknjytmjhZw4lVwk-oAnyUvylvWsxEW_U1Szr_2sOBVvOJKk1cEkLdKiMrVYxm0pXLDRhf8mBfUw8v5m2yOy9G7S3Yk8OT4I33fbWcAX4DEEXynxsZl4Rb7A4Ib9nAOaa6aOtXx0K8VitZwevxHASjpFEALPsgo719\"],null,null,\"VN\",null,null,null,null,null,false,null,null,null,null,\"en\",null,null,null,true,[null,[false,true,true],[false,false,false,false,false],false],null,[[[[null,[null,0,\"Here's the plan I've put together. Let me know if you need any changes before I start researching.\\n\"]],[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,[[\"History of JPEG Compression\",[[1,\"Research Websites\",\"(1) Investigate the pre-JPEG origins of image compression, focusing on the invention of the Discrete Cosine Transform (DCT) in 1974 and early compression research.\\n(2) Research the formation of the Joint Photographic Experts Group committee in 1986 by ISO, IEC, and ITU-T, identifying key contributors and initial goals.\\n(3) Trace the development process and formal standardization of JPEG leading to the publication of ISO/IEC 10918-1 (ITU-T T.81) in 1992.\\n(4) Analyze the core technical components defined in the original JPEG standard:\\n (a) Color space conversion (RGB to YCbCr) and chrominance subsampling\\n (b) 8x8 block-based Discrete Cosine Transform (DCT)\\n (c) Quantization matrix selection and lossy compression trade-offs\\n (d) Entropy encoding techniques including Huffman coding and arithmetic coding\\n(5) Investigate major patent controversies and licensing challenges, such as the Forgent Networks patent enforcement attempt in the early 2000s.\\n(6) Evaluate the historical impact of JPEG on the growth of the World Wide Web, digital photography, and personal computing.\\n(7) Examine the development of successor image standards (JPEG 2000, JPEG XR, JPEG XL, WebP, AVIF) and analyze why the original JPEG format maintains broad dominance.\"],[2,\"Analyze Results\"],[3,\"Create Report\"]],\"Ready in a few mins\",[\"Start research\"],[\"http://googleusercontent.com/deep_research_confirmation_content/0\",0],[\"Edit plan\",[null,null,null,\"Edit the research plan\"]]]]]]]],null,null,[1,1,1],null,null,null,null,null,null,null,null,null,null,null,null,\"3.5 Flash-Lite\",true,[[]],null,2,null,null,null,null,null,null,null,null,null,null,null,6,1]"]]
9
+ 5374
10
+ [["wrb.fr",null,"[null,[\"c_10950ff6b1b0ebc1\",\"r_b1a8e63da21ae244\"],null,null,[[\"rc_a9a08f9572db6424\",[\"Here's the plan I've put together. Let me know if you need any changes before I start researching.\\nhttp://googleusercontent.com/deep_research_confirmation_content/0\\n\"],null,null,null,null,null,null,[2],\"en\",null,null,[{\"8\":[],\"56\":[\"History of JPEG Compression\",[[1,\"Research Websites\",\"(1) Investigate the pre-JPEG origins of image compression, focusing on the invention of the Discrete Cosine Transform (DCT) in 1974 and early compression research.\\n(2) Research the formation of the Joint Photographic Experts Group committee in 1986 by ISO, IEC, and ITU-T, identifying key contributors and initial goals.\\n(3) Trace the development process and formal standardization of JPEG leading to the publication of ISO/IEC 10918-1 (ITU-T T.81) in 1992.\\n(4) Analyze the core technical components defined in the original JPEG standard:\\n (a) Color space conversion (RGB to YCbCr) and chrominance subsampling\\n (b) 8x8 block-based Discrete Cosine Transform (DCT)\\n (c) Quantization matrix selection and lossy compression trade-offs\\n (d) Entropy encoding techniques including Huffman coding and arithmetic coding\\n(5) Investigate major patent controversies and licensing challenges, such as the Forgent Networks patent enforcement attempt in the early 2000s.\\n(6) Evaluate the historical impact of JPEG on the growth of the World Wide Web, digital photography, and personal computing.\\n(7) Examine the development of successor image standards (JPEG 2000, JPEG XR, JPEG XL, WebP, AVIF) and analyze why the original JPEG format maintains broad dominance.\"],[2,\"Analyze Results\"],[3,\"Create Report\"]],\"Ready in a few mins\",[\"Start research\"],[\"http://googleusercontent.com/deep_research_confirmation_content/0\",0],[\"Edit plan\",[null,null,null,\"Edit the research plan\"]]],\"70\":2}],null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,[],null,null,null,null,null,null,null,null,[[\"***Generating research plan***\\n\\nTo best answer your request, I'm starting by constructing a comprehensive research plan. This will outline the key areas I need to investigate and the strategy I'll use to connect them.\"],[[[\"***Generating research plan***\\n\\nTo best answer your request, I'm starting by constructing a comprehensive research plan. This will outline the key areas I need to investigate and the strategy I'll use to connect them.\"],\"\",\"\",\"\",[[[null,[null,0,\"Generating research plan\",[[0,24,[[null,null,null,null,2]]],[0,24,[[null,null,null,null,1]]]]]],[null,[null,0,\"To best answer your request, I'm starting by constructing a comprehensive research plan. This will outline the key areas I need to investigate and the strategy I'll use to connect them.\"]]]],\"\",\"\"]]]]],[\"Ha Dong, Ha Noi, Vietnam\",\"SWML_DESCRIPTION_FROM_YOUR_INTERNET_ADDRESS\",false,null,\"//www.google.com/maps/vt/data\\u003dJ9ojrGEG2GSAiLZq9odjIkDkUM_iNyNknjytmjhZw4lVwk-oAnyUvylvWsxEW_U1Szr_2sOBVvOJKk1cEkLdKiMrVYxm0pXLDRhf8mBfUw8v5m2yOy9G7S3Yk8OT4I33fbWcAX4DEEXynxsZl4Rb7A4Ib9nAOaa6aOtXx0K8VitZwevxHASjpFEALPsgo719\"],null,null,\"VN\",null,null,null,null,null,true,null,null,null,null,\"en\",null,null,null,true,[null,[false,true,true],[false,false,false,false,false],false],null,[[[[null,[null,0,\"Here's the plan I've put together. Let me know if you need any changes before I start researching.\\n\"]],[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,[[\"History of JPEG Compression\",[[1,\"Research Websites\",\"(1) Investigate the pre-JPEG origins of image compression, focusing on the invention of the Discrete Cosine Transform (DCT) in 1974 and early compression research.\\n(2) Research the formation of the Joint Photographic Experts Group committee in 1986 by ISO, IEC, and ITU-T, identifying key contributors and initial goals.\\n(3) Trace the development process and formal standardization of JPEG leading to the publication of ISO/IEC 10918-1 (ITU-T T.81) in 1992.\\n(4) Analyze the core technical components defined in the original JPEG standard:\\n (a) Color space conversion (RGB to YCbCr) and chrominance subsampling\\n (b) 8x8 block-based Discrete Cosine Transform (DCT)\\n (c) Quantization matrix selection and lossy compression trade-offs\\n (d) Entropy encoding techniques including Huffman coding and arithmetic coding\\n(5) Investigate major patent controversies and licensing challenges, such as the Forgent Networks patent enforcement attempt in the early 2000s.\\n(6) Evaluate the historical impact of JPEG on the growth of the World Wide Web, digital photography, and personal computing.\\n(7) Examine the development of successor image standards (JPEG 2000, JPEG XR, JPEG XL, WebP, AVIF) and analyze why the original JPEG format maintains broad dominance.\"],[2,\"Analyze Results\"],[3,\"Create Report\"]],\"Ready in a few mins\",[\"Start research\"],[\"http://googleusercontent.com/deep_research_confirmation_content/0\",0],[\"Edit plan\",[null,null,null,\"Edit the research plan\"]]]]]]]],null,null,[1,1,1],null,null,null,null,null,null,null,null,null,null,null,null,\"3.5 Flash-Lite\",true,[[]],null,2,null,null,null,null,null,null,null,null,null,null,null,6,1,null,null,null,1]"]]
11
+ 134
12
+ [["wrb.fr",null,"[null,[\"c_10950ff6b1b0ebc1\",\"r_b1a8e63da21ae244\"],{\"11\":[\"JPEG Compression Research Plan\"],\"44\":true}]"]]
13
+ 133
14
+ [["wrb.fr",null,"[null,[\"c_10950ff6b1b0ebc1\",\"r_b1a8e63da21ae244\"],{\"26\":\"AwAAAAAAAAAQwBHO-LzoF6KNX8_CCRo\",\"44\":true}]"]]
15
+ 137
16
+ [["wrb.fr",null,"[null,[\"c_10950ff6b1b0ebc1\",\"r_b1a8e63da21ae244\"],{\"44\":true,\"46\":[\"c_10950ff6b1b0ebc1\",\"\"],\"52\":[]}]"]]
17
+ 62
18
+ [["di",13003],["af.httprm",13002,"-3730072432154435131",43]]
19
+ 28
20
+ [["e",10,null,null,13239]]
@@ -0,0 +1,31 @@
1
+ <!DOCTYPE html>
2
+ <!-- Fixture for cdp-smoke.ts: exercises trusted click (user activation via
3
+ execCommand('copy')), typing, Enter handling, wait_for, and evaluate. -->
4
+ <html>
5
+ <head><meta charset="utf-8"><style>body{font-family:sans-serif;margin:16px}</style></head>
6
+ <body>
7
+ <h1>Interaction fixture</h1>
8
+ <button id="copy">Copy</button>
9
+ <span id="copy-status">idle</span>
10
+ <form id="form">
11
+ <input id="name" placeholder="name" />
12
+ <button id="submit" type="submit">Submit</button>
13
+ </form>
14
+ <pre id="log"></pre>
15
+ <button id="ghost" style="display:none">Ghost</button>
16
+ <div id="later" hidden>appeared</div>
17
+ <script>
18
+ document.getElementById("copy").addEventListener("click", () => {
19
+ // User activation required: synthetic el.click() would return false.
20
+ const ok = document.execCommand("copy");
21
+ document.getElementById("copy-status").textContent = ok ? "copied" : "blocked";
22
+ });
23
+ document.getElementById("form").addEventListener("submit", (e) => {
24
+ e.preventDefault();
25
+ document.getElementById("log").textContent +=
26
+ "submitted:" + document.getElementById("name").value + "\n";
27
+ });
28
+ setTimeout(() => { document.getElementById("later").hidden = false; }, 300);
29
+ </script>
30
+ </body>
31
+ </html>