lazycodex-ai 5.1.44 → 5.1.46

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 (412) hide show
  1. package/README.de.md +0 -5
  2. package/README.es.md +0 -5
  3. package/README.fr.md +0 -5
  4. package/README.it.md +0 -5
  5. package/README.ja.md +0 -5
  6. package/README.ko.md +0 -5
  7. package/README.md +4 -5
  8. package/README.pt-br.md +0 -5
  9. package/README.ru.md +0 -6
  10. package/README.zh-cn.md +0 -5
  11. package/dist/cli/index.js +865 -413
  12. package/dist/cli/service-auth/keystore.d.ts +4 -2
  13. package/dist/cli-node/index.js +865 -413
  14. package/docs/reference/web-terminal-visual-qa.md +8 -0
  15. package/package.json +1 -1
  16. package/packages/lsp-daemon/dist/cli.js +7 -7
  17. package/packages/lsp-daemon/dist/client.js +7 -7
  18. package/packages/lsp-daemon/dist/index.js +7 -7
  19. package/packages/lsp-daemon/package.json +3 -3
  20. package/packages/lsp-tools-mcp/dist/cli.js +7 -7
  21. package/packages/lsp-tools-mcp/dist/mcp.js +7 -7
  22. package/packages/lsp-tools-mcp/dist/tools.js +4 -4
  23. package/packages/lsp-tools-mcp/package.json +3 -3
  24. package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
  25. package/packages/omo-codex/plugin/components/bootstrap/dist/cli.js +77 -26
  26. package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +1 -1
  27. package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
  28. package/packages/omo-codex/plugin/components/bootstrap/src/hook.ts +1 -1
  29. package/packages/omo-codex/plugin/components/comment-checker/biome.json +1 -21
  30. package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
  31. package/packages/omo-codex/plugin/components/comment-checker/package.json +4 -4
  32. package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
  33. package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
  34. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/biome.json +1 -21
  35. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +1 -1
  36. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +4 -4
  37. package/packages/omo-codex/plugin/components/lsp/biome.json +1 -21
  38. package/packages/omo-codex/plugin/components/lsp/dist/.omo-runtime-manifest.json +3 -3
  39. package/packages/omo-codex/plugin/components/lsp/dist/cli.js +4 -4
  40. package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
  41. package/packages/omo-codex/plugin/components/lsp/package.json +4 -4
  42. package/packages/omo-codex/plugin/components/lsp/scripts/build-runtime.mjs +0 -1
  43. package/packages/omo-codex/plugin/components/lsp/test/codex-hook-not-installed.test.ts +1 -1
  44. package/packages/omo-codex/plugin/components/rules/biome.json +1 -21
  45. package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
  46. package/packages/omo-codex/plugin/components/rules/package.json +4 -4
  47. package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +1 -1
  48. package/packages/omo-codex/plugin/components/teammode/package.json +1 -1
  49. package/packages/omo-codex/plugin/components/telemetry/biome.json +1 -21
  50. package/packages/omo-codex/plugin/components/telemetry/dist/cli.js +90 -1
  51. package/packages/omo-codex/plugin/components/telemetry/dist/posthog.js +91 -1
  52. package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
  53. package/packages/omo-codex/plugin/components/telemetry/package.json +4 -4
  54. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-gate-reviewer.toml +2 -2
  55. package/packages/omo-codex/plugin/components/ultrawork/biome.json +1 -21
  56. package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
  57. package/packages/omo-codex/plugin/components/ultrawork/package.json +4 -4
  58. package/packages/omo-codex/plugin/components/ulw-execute-continuation/biome.json +1 -21
  59. package/packages/omo-codex/plugin/components/ulw-execute-continuation/directive.md +1 -1
  60. package/packages/omo-codex/plugin/components/ulw-execute-continuation/hooks/hooks.json +1 -1
  61. package/packages/omo-codex/plugin/components/ulw-execute-continuation/package.json +4 -4
  62. package/packages/omo-codex/plugin/components/ulw-loop/biome.json +1 -21
  63. package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint.js +1 -1
  64. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli.js +7 -7
  65. package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-goal-instruction.js +5 -5
  66. package/packages/omo-codex/plugin/components/ulw-loop/dist/stop-resume-hook.js +1 -1
  67. package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +5 -5
  68. package/packages/omo-codex/plugin/components/ulw-loop/package.json +4 -4
  69. package/packages/omo-codex/plugin/components/ulw-loop/src/checkpoint.ts +1 -1
  70. package/packages/omo-codex/plugin/components/ulw-loop/src/codex-goal-instruction.ts +5 -5
  71. package/packages/omo-codex/plugin/components/ulw-loop/src/stop-resume-hook.ts +1 -1
  72. package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/commit-mutations.mjs +2 -0
  73. package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +1 -1
  74. package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +1 -1
  75. package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +1 -1
  76. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +1 -1
  77. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +1 -1
  78. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +1 -1
  79. package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +1 -1
  80. package/packages/omo-codex/plugin/hooks/post-tool-use-recording-spawn-admission.json +1 -1
  81. package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +1 -1
  82. package/packages/omo-codex/plugin/hooks/pre-tool-use-guarding-ulw-loop-spawns.json +1 -1
  83. package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +1 -1
  84. package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +1 -1
  85. package/packages/omo-codex/plugin/hooks/session-start-checking-bootstrap-provisioning.json +1 -1
  86. package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +1 -1
  87. package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +1 -1
  88. package/packages/omo-codex/plugin/hooks/stop-checking-ulw-execute-continuation.json +1 -1
  89. package/packages/omo-codex/plugin/hooks/stop-checking-ulw-loop-resume.json +1 -1
  90. package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +1 -1
  91. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +1 -1
  92. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +1 -1
  93. package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +1 -1
  94. package/packages/omo-codex/plugin/package-lock.json +12 -12
  95. package/packages/omo-codex/plugin/package.json +1 -1
  96. package/packages/omo-codex/plugin/scripts/sync-skills.mjs +14 -9
  97. package/packages/omo-codex/plugin/skills/ast-grep/AGENTS.md +1 -1
  98. package/packages/omo-codex/plugin/skills/browser/SKILL.md +21 -22
  99. package/packages/omo-codex/plugin/skills/browser/references/commands.md +2 -9
  100. package/packages/omo-codex/plugin/skills/browser/references/install.md +1 -2
  101. package/packages/omo-codex/plugin/skills/browser/runtime/omowright/manifest.json +1 -1
  102. package/packages/omo-codex/plugin/skills/browser/scripts/browser-doctor.mjs +2 -2
  103. package/packages/omo-codex/plugin/skills/browser/scripts/browser-engine-guard.mjs +63 -487
  104. package/packages/omo-codex/plugin/skills/browser/scripts/browser-install.mjs +1 -1
  105. package/packages/omo-codex/plugin/skills/browser/scripts/omowright.mjs +1 -10
  106. package/packages/omo-codex/plugin/skills/frontend/ATTRIBUTION.md +2 -2
  107. package/packages/omo-codex/plugin/skills/frontend/SKILL.md +79 -118
  108. package/packages/omo-codex/plugin/skills/frontend/references/design/README.md +75 -224
  109. package/packages/omo-codex/plugin/skills/frontend/references/design/stylegallery.md +32 -27
  110. package/packages/omo-codex/plugin/skills/frontend/references/perfection/README.md +2 -2
  111. package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/check-accent-stripes.ts +8 -24
  112. package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/check-draft-guard.ts +40 -0
  113. package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/collect-files.ts +53 -0
  114. package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/draft-guard/findings.ts +16 -0
  115. package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/draft-guard/lint.ts +38 -0
  116. package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/draft-guard/rules.ts +69 -0
  117. package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/draft-guard/text-nodes.ts +121 -0
  118. package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/fixtures/draft-guard/negative/attr-lookalikes.tsx +10 -0
  119. package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/fixtures/draft-guard/negative/bound-values.tsx +12 -0
  120. package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/fixtures/draft-guard/negative/const-generics.tsx +3 -0
  121. package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/fixtures/draft-guard/negative/generics.tsx +7 -0
  122. package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/fixtures/draft-guard/negative/measured-stats.html +6 -0
  123. package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/fixtures/draft-guard/negative/plain-copy.html +9 -0
  124. package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/fixtures/draft-guard/negative/state-copy.html +11 -0
  125. package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/fixtures/draft-guard/positive/attribute-edges.html +7 -0
  126. package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/fixtures/draft-guard/positive/components.tsx +16 -0
  127. package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/fixtures/draft-guard/positive/decorative-badge.vue +7 -0
  128. package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/fixtures/draft-guard/positive/emoji-icons.tsx +9 -0
  129. package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/fixtures/draft-guard/positive/jsx-edges.tsx +1 -0
  130. package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/fixtures/draft-guard/positive/promo-copy.html +6 -0
  131. package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/fixtures/draft-guard/positive/promo-copy.tsx +8 -0
  132. package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/fixtures/draft-guard/positive/vanity-stats.html +5 -0
  133. package/packages/omo-codex/plugin/skills/init-deep/SKILL.md +1 -1
  134. package/packages/omo-codex/plugin/skills/programming/SKILL.md +10 -7
  135. package/packages/omo-codex/plugin/skills/programming/references/typescript/README.md +10 -7
  136. package/packages/omo-codex/plugin/skills/programming/references/typescript/bootstrap.md +9 -23
  137. package/packages/omo-codex/plugin/skills/programming/references/typescript/oxc-lint.md +130 -0
  138. package/packages/omo-codex/plugin/skills/programming/references/typescript/tsconfig-strict.md +6 -62
  139. package/packages/omo-codex/plugin/skills/programming/scripts/typescript/check-no-excuse-rules.ts +12 -12
  140. package/packages/omo-codex/plugin/skills/programming/scripts/typescript/new-project.ts +20 -81
  141. package/packages/omo-codex/plugin/skills/programming/scripts/typescript/oxc/.oxfmtrc.json +9 -0
  142. package/packages/omo-codex/plugin/skills/programming/scripts/typescript/oxc/.oxlintrc.json +46 -0
  143. package/packages/omo-codex/plugin/skills/programming/scripts/typescript/oxc/lint/oxlint-plugin/LICENSE +21 -0
  144. package/packages/omo-codex/plugin/skills/programming/scripts/typescript/oxc/lint/oxlint-plugin/index.js +10 -0
  145. package/packages/omo-codex/plugin/skills/programming/scripts/typescript/oxc/lint/oxlint-plugin/no-em-dash-copy.js +28 -0
  146. package/packages/omo-codex/plugin/skills/programming/scripts/typescript/oxc/lint/oxlint-plugin/require-suppression-reason.js +62 -0
  147. package/packages/omo-codex/plugin/skills/programming/scripts/typescript/oxc/tsconfig.json +29 -0
  148. package/packages/omo-codex/plugin/skills/refactor/SKILL.md +14 -14
  149. package/packages/omo-codex/plugin/skills/remove-ai-slops/SKILL.md +1 -1
  150. package/packages/omo-codex/plugin/skills/review-work/SKILL.md +2 -2
  151. package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/AGENTS.md +1 -1
  152. package/packages/omo-codex/plugin/skills/ulw-execute/SKILL.md +2 -2
  153. package/packages/omo-codex/plugin/skills/ulw-loop/SKILL.md +1 -1
  154. package/packages/omo-codex/plugin/skills/ulw-research/AGENTS.md +21 -3
  155. package/packages/omo-codex/plugin/skills/ulw-research/SKILL.md +37 -12
  156. package/packages/omo-codex/plugin/skills/ulw-research/references/deliverable-phase.md +77 -16
  157. package/packages/omo-codex/plugin/skills/ulw-research/references/fact-ledger-grammar.md +134 -0
  158. package/packages/omo-codex/plugin/skills/ulw-research/references/fact-ledger.md +95 -0
  159. package/packages/omo-codex/plugin/skills/ulw-research/references/fidelity-claim-kinds.md +19 -0
  160. package/packages/omo-codex/plugin/skills/ulw-research/references/report-gates.md +68 -3
  161. package/packages/omo-codex/plugin/skills/ulw-research/references/report-visualization.md +2 -0
  162. package/packages/omo-codex/plugin/skills/ulw-research/references/unit-rules.md +157 -0
  163. package/packages/omo-codex/plugin/skills/ulw-research/scripts/claim-kinds.mjs +116 -0
  164. package/packages/omo-codex/plugin/skills/ulw-research/scripts/claims-index.mjs +125 -0
  165. package/packages/omo-codex/plugin/skills/ulw-research/scripts/cli-support.mjs +19 -5
  166. package/packages/omo-codex/plugin/skills/ulw-research/scripts/contracts.mjs +89 -3
  167. package/packages/omo-codex/plugin/skills/ulw-research/scripts/fact-commands-meaning.mjs +191 -0
  168. package/packages/omo-codex/plugin/skills/ulw-research/scripts/fact-commands-verify.mjs +164 -0
  169. package/packages/omo-codex/plugin/skills/ulw-research/scripts/fact-commands.mjs +239 -0
  170. package/packages/omo-codex/plugin/skills/ulw-research/scripts/fact-derive.mjs +66 -0
  171. package/packages/omo-codex/plugin/skills/ulw-research/scripts/fact-expr.mjs +108 -0
  172. package/packages/omo-codex/plugin/skills/ulw-research/scripts/fact-fill.mjs +194 -0
  173. package/packages/omo-codex/plugin/skills/ulw-research/scripts/fact-ledger-kinds.mjs +250 -0
  174. package/packages/omo-codex/plugin/skills/ulw-research/scripts/fact-ledger-schema.mjs +221 -0
  175. package/packages/omo-codex/plugin/skills/ulw-research/scripts/fact-ledger.mjs +123 -0
  176. package/packages/omo-codex/plugin/skills/ulw-research/scripts/fact-locate.mjs +231 -0
  177. package/packages/omo-codex/plugin/skills/ulw-research/scripts/fact-pairs.mjs +187 -0
  178. package/packages/omo-codex/plugin/skills/ulw-research/scripts/fact-recompute.mjs +89 -0
  179. package/packages/omo-codex/plugin/skills/ulw-research/scripts/fidelity-binding.mjs +130 -0
  180. package/packages/omo-codex/plugin/skills/ulw-research/scripts/fidelity-brief.mjs +150 -0
  181. package/packages/omo-codex/plugin/skills/ulw-research/scripts/fidelity-claims.mjs +89 -0
  182. package/packages/omo-codex/plugin/skills/ulw-research/scripts/fidelity-lexicon.mjs +145 -0
  183. package/packages/omo-codex/plugin/skills/ulw-research/scripts/fidelity-records.mjs +163 -0
  184. package/packages/omo-codex/plugin/skills/ulw-research/scripts/fidelity-state.mjs +64 -0
  185. package/packages/omo-codex/plugin/skills/ulw-research/scripts/fidelity-trace.mjs +85 -0
  186. package/packages/omo-codex/plugin/skills/ulw-research/scripts/fidelity-values.mjs +229 -0
  187. package/packages/omo-codex/plugin/skills/ulw-research/scripts/gates-fidelity.mjs +113 -0
  188. package/packages/omo-codex/plugin/skills/ulw-research/scripts/gates-static.mjs +29 -9
  189. package/packages/omo-codex/plugin/skills/ulw-research/scripts/gates-structure.mjs +1 -1
  190. package/packages/omo-codex/plugin/skills/ulw-research/scripts/gates-text.mjs +1 -27
  191. package/packages/omo-codex/plugin/skills/ulw-research/scripts/html-lite.mjs +2 -2
  192. package/packages/omo-codex/plugin/skills/ulw-research/scripts/html-markup.mjs +182 -0
  193. package/packages/omo-codex/plugin/skills/ulw-research/scripts/lexicon.mjs +47 -0
  194. package/packages/omo-codex/plugin/skills/ulw-research/scripts/md-lite.mjs +193 -0
  195. package/packages/omo-codex/plugin/skills/ulw-research/scripts/meaning-check.mjs +196 -0
  196. package/packages/omo-codex/plugin/skills/ulw-research/scripts/numerals.mjs +226 -0
  197. package/packages/omo-codex/plugin/skills/ulw-research/scripts/outcome.mjs +8 -8
  198. package/packages/omo-codex/plugin/skills/ulw-research/scripts/particles-ko.mjs +108 -0
  199. package/packages/omo-codex/plugin/skills/ulw-research/scripts/placeholder.mjs +184 -0
  200. package/packages/omo-codex/plugin/skills/ulw-research/scripts/polish-apply.mjs +115 -0
  201. package/packages/omo-codex/plugin/skills/ulw-research/scripts/polish-diff.mjs +31 -0
  202. package/packages/omo-codex/plugin/skills/ulw-research/scripts/polish-project.mjs +125 -0
  203. package/packages/omo-codex/plugin/skills/ulw-research/scripts/polish-rules.mjs +170 -0
  204. package/packages/omo-codex/plugin/skills/ulw-research/scripts/rational.mjs +139 -0
  205. package/packages/omo-codex/plugin/skills/ulw-research/scripts/report-tools-commands.mjs +21 -10
  206. package/packages/omo-codex/plugin/skills/ulw-research/scripts/report-tools.mjs +15 -0
  207. package/packages/omo-codex/plugin/skills/ulw-research/scripts/sentence-split.mjs +77 -0
  208. package/packages/omo-codex/plugin/skills/ulw-research/scripts/source-commands.mjs +140 -0
  209. package/packages/omo-codex/plugin/skills/ulw-research/scripts/source-snapshot.mjs +176 -0
  210. package/packages/omo-codex/plugin/skills/ulw-research/scripts/text-normalize.mjs +82 -0
  211. package/packages/omo-codex/plugin/skills/ulw-research/scripts/text-similarity.mjs +28 -0
  212. package/packages/omo-codex/plugin/skills/ulw-research/scripts/unit-algebra.mjs +101 -0
  213. package/packages/omo-codex/plugin/skills/ulw-research/scripts/unit-errors.mjs +23 -0
  214. package/packages/omo-codex/plugin/skills/ulw-research/scripts/unit-metadata.mjs +31 -0
  215. package/packages/omo-codex/plugin/skills/ulw-research/scripts/unit-pairs.mjs +72 -0
  216. package/packages/omo-codex/plugin/skills/ulw-research/scripts/unit-precision.mjs +44 -0
  217. package/packages/omo-codex/plugin/skills/ulw-research/scripts/unit-rules-shapes.mjs +64 -0
  218. package/packages/omo-codex/plugin/skills/ulw-research/scripts/unit-rules.mjs +173 -0
  219. package/packages/omo-codex/plugin/skills/ulw-research/scripts/units.mjs +105 -0
  220. package/packages/omo-codex/plugin/skills/visual-qa/SKILL.md +71 -64
  221. package/packages/omo-codex/plugin/test/component-bundled-cli.test.mjs +4 -1
  222. package/packages/omo-codex/plugin/test/sync-skills-codex-compatibility.test.mjs +19 -0
  223. package/packages/omo-codex/plugin/test/sync-skills-test-support.mjs +12 -8
  224. package/packages/omo-codex/scripts/install-dist/install-local.mjs +169 -30
  225. package/packages/shared-skills/skills/ast-grep/AGENTS.md +1 -1
  226. package/packages/shared-skills/skills/browser/SKILL.md +21 -22
  227. package/packages/shared-skills/skills/browser/references/commands.md +2 -9
  228. package/packages/shared-skills/skills/browser/references/install.md +1 -2
  229. package/packages/shared-skills/skills/browser/runtime/omowright/manifest.json +1 -1
  230. package/packages/shared-skills/skills/browser/scripts/browser-doctor.mjs +2 -2
  231. package/packages/shared-skills/skills/browser/scripts/browser-engine-guard.mjs +63 -487
  232. package/packages/shared-skills/skills/browser/scripts/browser-install.mjs +1 -1
  233. package/packages/shared-skills/skills/browser/scripts/omowright.mjs +1 -10
  234. package/packages/shared-skills/skills/frontend/ATTRIBUTION.md +2 -2
  235. package/packages/shared-skills/skills/frontend/SKILL.md +79 -118
  236. package/packages/shared-skills/skills/frontend/references/design/README.md +75 -224
  237. package/packages/shared-skills/skills/frontend/references/design/stylegallery.md +32 -27
  238. package/packages/shared-skills/skills/frontend/references/perfection/README.md +2 -2
  239. package/packages/shared-skills/skills/frontend/scripts/perfection/check-accent-stripes.ts +8 -24
  240. package/packages/shared-skills/skills/frontend/scripts/perfection/check-draft-guard.test.ts +101 -0
  241. package/packages/shared-skills/skills/frontend/scripts/perfection/check-draft-guard.ts +40 -0
  242. package/packages/shared-skills/skills/frontend/scripts/perfection/collect-files.test.ts +50 -0
  243. package/packages/shared-skills/skills/frontend/scripts/perfection/collect-files.ts +53 -0
  244. package/packages/shared-skills/skills/frontend/scripts/perfection/draft-guard/findings.ts +16 -0
  245. package/packages/shared-skills/skills/frontend/scripts/perfection/draft-guard/lint.ts +38 -0
  246. package/packages/shared-skills/skills/frontend/scripts/perfection/draft-guard/rules.ts +69 -0
  247. package/packages/shared-skills/skills/frontend/scripts/perfection/draft-guard/text-nodes.ts +121 -0
  248. package/packages/shared-skills/skills/frontend/scripts/perfection/fixtures/draft-guard/negative/attr-lookalikes.tsx +10 -0
  249. package/packages/shared-skills/skills/frontend/scripts/perfection/fixtures/draft-guard/negative/bound-values.tsx +12 -0
  250. package/packages/shared-skills/skills/frontend/scripts/perfection/fixtures/draft-guard/negative/const-generics.tsx +3 -0
  251. package/packages/shared-skills/skills/frontend/scripts/perfection/fixtures/draft-guard/negative/generics.tsx +7 -0
  252. package/packages/shared-skills/skills/frontend/scripts/perfection/fixtures/draft-guard/negative/measured-stats.html +6 -0
  253. package/packages/shared-skills/skills/frontend/scripts/perfection/fixtures/draft-guard/negative/plain-copy.html +9 -0
  254. package/packages/shared-skills/skills/frontend/scripts/perfection/fixtures/draft-guard/negative/state-copy.html +11 -0
  255. package/packages/shared-skills/skills/frontend/scripts/perfection/fixtures/draft-guard/positive/attribute-edges.html +7 -0
  256. package/packages/shared-skills/skills/frontend/scripts/perfection/fixtures/draft-guard/positive/components.tsx +16 -0
  257. package/packages/shared-skills/skills/frontend/scripts/perfection/fixtures/draft-guard/positive/decorative-badge.vue +7 -0
  258. package/packages/shared-skills/skills/frontend/scripts/perfection/fixtures/draft-guard/positive/emoji-icons.tsx +9 -0
  259. package/packages/shared-skills/skills/frontend/scripts/perfection/fixtures/draft-guard/positive/jsx-edges.tsx +1 -0
  260. package/packages/shared-skills/skills/frontend/scripts/perfection/fixtures/draft-guard/positive/promo-copy.html +6 -0
  261. package/packages/shared-skills/skills/frontend/scripts/perfection/fixtures/draft-guard/positive/promo-copy.tsx +8 -0
  262. package/packages/shared-skills/skills/frontend/scripts/perfection/fixtures/draft-guard/positive/vanity-stats.html +5 -0
  263. package/packages/shared-skills/skills/programming/SKILL.md +10 -7
  264. package/packages/shared-skills/skills/programming/references/typescript/README.md +10 -7
  265. package/packages/shared-skills/skills/programming/references/typescript/bootstrap.md +9 -23
  266. package/packages/shared-skills/skills/programming/references/typescript/oxc-lint.md +130 -0
  267. package/packages/shared-skills/skills/programming/references/typescript/tsconfig-strict.md +6 -62
  268. package/packages/shared-skills/skills/programming/scripts/typescript/check-no-excuse-rules.ts +12 -12
  269. package/packages/shared-skills/skills/programming/scripts/typescript/new-project.test.ts +162 -0
  270. package/packages/shared-skills/skills/programming/scripts/typescript/new-project.ts +20 -81
  271. package/packages/shared-skills/skills/programming/scripts/typescript/oxc/.oxfmtrc.json +9 -0
  272. package/packages/shared-skills/skills/programming/scripts/typescript/oxc/.oxlintrc.json +46 -0
  273. package/packages/shared-skills/skills/programming/scripts/typescript/oxc/lint/oxlint-plugin/LICENSE +21 -0
  274. package/packages/shared-skills/skills/programming/scripts/typescript/oxc/lint/oxlint-plugin/index.js +10 -0
  275. package/packages/shared-skills/skills/programming/scripts/typescript/oxc/lint/oxlint-plugin/no-em-dash-copy.js +28 -0
  276. package/packages/shared-skills/skills/programming/scripts/typescript/oxc/lint/oxlint-plugin/require-suppression-reason.js +62 -0
  277. package/packages/shared-skills/skills/programming/scripts/typescript/oxc/tsconfig.json +29 -0
  278. package/packages/shared-skills/skills/refactor/SKILL.md +13 -13
  279. package/packages/shared-skills/skills/ultimate-browsing/engine/AGENTS.md +1 -1
  280. package/packages/shared-skills/skills/ulw-execute/SKILL.md +1 -1
  281. package/packages/shared-skills/skills/ulw-research/AGENTS.md +21 -3
  282. package/packages/shared-skills/skills/ulw-research/SKILL.md +37 -12
  283. package/packages/shared-skills/skills/ulw-research/references/deliverable-phase.md +77 -16
  284. package/packages/shared-skills/skills/ulw-research/references/fact-ledger-grammar.md +134 -0
  285. package/packages/shared-skills/skills/ulw-research/references/fact-ledger.md +95 -0
  286. package/packages/shared-skills/skills/ulw-research/references/fidelity-claim-kinds.md +19 -0
  287. package/packages/shared-skills/skills/ulw-research/references/report-gates.md +68 -3
  288. package/packages/shared-skills/skills/ulw-research/references/report-visualization.md +2 -0
  289. package/packages/shared-skills/skills/ulw-research/references/unit-rules.md +157 -0
  290. package/packages/shared-skills/skills/ulw-research/scripts/claim-kinds.mjs +116 -0
  291. package/packages/shared-skills/skills/ulw-research/scripts/claim-kinds.test.ts +193 -0
  292. package/packages/shared-skills/skills/ulw-research/scripts/claims-index.mjs +125 -0
  293. package/packages/shared-skills/skills/ulw-research/scripts/claims-index.test.ts +149 -0
  294. package/packages/shared-skills/skills/ulw-research/scripts/cli-support.mjs +19 -5
  295. package/packages/shared-skills/skills/ulw-research/scripts/cli-support.test.ts +13 -2
  296. package/packages/shared-skills/skills/ulw-research/scripts/contracts.mjs +89 -3
  297. package/packages/shared-skills/skills/ulw-research/scripts/contracts.test.ts +100 -12
  298. package/packages/shared-skills/skills/ulw-research/scripts/copy-returns.test.ts +183 -0
  299. package/packages/shared-skills/skills/ulw-research/scripts/delivery-barrier.test.ts +245 -0
  300. package/packages/shared-skills/skills/ulw-research/scripts/fact-commands-meaning.mjs +191 -0
  301. package/packages/shared-skills/skills/ulw-research/scripts/fact-commands-verify.mjs +164 -0
  302. package/packages/shared-skills/skills/ulw-research/scripts/fact-commands.mjs +239 -0
  303. package/packages/shared-skills/skills/ulw-research/scripts/fact-derive.mjs +66 -0
  304. package/packages/shared-skills/skills/ulw-research/scripts/fact-derive.test.ts +375 -0
  305. package/packages/shared-skills/skills/ulw-research/scripts/fact-expr.mjs +108 -0
  306. package/packages/shared-skills/skills/ulw-research/scripts/fact-fill.mjs +194 -0
  307. package/packages/shared-skills/skills/ulw-research/scripts/fact-fill.test.ts +221 -0
  308. package/packages/shared-skills/skills/ulw-research/scripts/fact-ledger-grammar.test.ts +197 -0
  309. package/packages/shared-skills/skills/ulw-research/scripts/fact-ledger-kinds.mjs +250 -0
  310. package/packages/shared-skills/skills/ulw-research/scripts/fact-ledger-kinds.test.ts +156 -0
  311. package/packages/shared-skills/skills/ulw-research/scripts/fact-ledger-legacy.test.ts +160 -0
  312. package/packages/shared-skills/skills/ulw-research/scripts/fact-ledger-schema.mjs +221 -0
  313. package/packages/shared-skills/skills/ulw-research/scripts/fact-ledger-schema.test.ts +43 -0
  314. package/packages/shared-skills/skills/ulw-research/scripts/fact-ledger.mjs +123 -0
  315. package/packages/shared-skills/skills/ulw-research/scripts/fact-ledger.test.ts +254 -0
  316. package/packages/shared-skills/skills/ulw-research/scripts/fact-locate.mjs +231 -0
  317. package/packages/shared-skills/skills/ulw-research/scripts/fact-locate.test.ts +118 -0
  318. package/packages/shared-skills/skills/ulw-research/scripts/fact-pairs.mjs +187 -0
  319. package/packages/shared-skills/skills/ulw-research/scripts/fact-pairs.test.ts +167 -0
  320. package/packages/shared-skills/skills/ulw-research/scripts/fact-recompute.mjs +89 -0
  321. package/packages/shared-skills/skills/ulw-research/scripts/fact-unit-dimensions.test.ts +409 -0
  322. package/packages/shared-skills/skills/ulw-research/scripts/fact-unit-rules.test.ts +388 -0
  323. package/packages/shared-skills/skills/ulw-research/scripts/fidelity-binding.mjs +130 -0
  324. package/packages/shared-skills/skills/ulw-research/scripts/fidelity-binding.test.ts +81 -0
  325. package/packages/shared-skills/skills/ulw-research/scripts/fidelity-brief.mjs +150 -0
  326. package/packages/shared-skills/skills/ulw-research/scripts/fidelity-brief.test.ts +179 -0
  327. package/packages/shared-skills/skills/ulw-research/scripts/fidelity-claims.mjs +89 -0
  328. package/packages/shared-skills/skills/ulw-research/scripts/fidelity-lexicon.mjs +145 -0
  329. package/packages/shared-skills/skills/ulw-research/scripts/fidelity-lexicon.test.ts +117 -0
  330. package/packages/shared-skills/skills/ulw-research/scripts/fidelity-records.mjs +163 -0
  331. package/packages/shared-skills/skills/ulw-research/scripts/fidelity-state.mjs +64 -0
  332. package/packages/shared-skills/skills/ulw-research/scripts/fidelity-state.test.ts +46 -0
  333. package/packages/shared-skills/skills/ulw-research/scripts/fidelity-trace.mjs +85 -0
  334. package/packages/shared-skills/skills/ulw-research/scripts/fidelity-trace.test.ts +58 -0
  335. package/packages/shared-skills/skills/ulw-research/scripts/fidelity-values.mjs +229 -0
  336. package/packages/shared-skills/skills/ulw-research/scripts/fidelity-values.test.ts +270 -0
  337. package/packages/shared-skills/skills/ulw-research/scripts/gates-context.test.ts +64 -0
  338. package/packages/shared-skills/skills/ulw-research/scripts/gates-fidelity.mjs +113 -0
  339. package/packages/shared-skills/skills/ulw-research/scripts/gates-fidelity.test.ts +73 -0
  340. package/packages/shared-skills/skills/ulw-research/scripts/gates-static.mjs +29 -9
  341. package/packages/shared-skills/skills/ulw-research/scripts/gates-structure.mjs +1 -1
  342. package/packages/shared-skills/skills/ulw-research/scripts/gates-text.mjs +1 -27
  343. package/packages/shared-skills/skills/ulw-research/scripts/html-lite.mjs +2 -2
  344. package/packages/shared-skills/skills/ulw-research/scripts/html-markup.mjs +182 -0
  345. package/packages/shared-skills/skills/ulw-research/scripts/lexicon.mjs +47 -0
  346. package/packages/shared-skills/skills/ulw-research/scripts/lexicon.test.ts +57 -0
  347. package/packages/shared-skills/skills/ulw-research/scripts/md-lite.mjs +193 -0
  348. package/packages/shared-skills/skills/ulw-research/scripts/md-lite.test.ts +271 -0
  349. package/packages/shared-skills/skills/ulw-research/scripts/meaning-check.mjs +196 -0
  350. package/packages/shared-skills/skills/ulw-research/scripts/meaning-check.test.ts +228 -0
  351. package/packages/shared-skills/skills/ulw-research/scripts/numerals.mjs +226 -0
  352. package/packages/shared-skills/skills/ulw-research/scripts/numerals.test.ts +120 -0
  353. package/packages/shared-skills/skills/ulw-research/scripts/outcome.mjs +8 -8
  354. package/packages/shared-skills/skills/ulw-research/scripts/outcome.test.ts +29 -0
  355. package/packages/shared-skills/skills/ulw-research/scripts/particles-ko.mjs +108 -0
  356. package/packages/shared-skills/skills/ulw-research/scripts/particles-ko.test.ts +86 -0
  357. package/packages/shared-skills/skills/ulw-research/scripts/placeholder.mjs +184 -0
  358. package/packages/shared-skills/skills/ulw-research/scripts/placeholder.test.ts +77 -0
  359. package/packages/shared-skills/skills/ulw-research/scripts/polish-apply.mjs +115 -0
  360. package/packages/shared-skills/skills/ulw-research/scripts/polish-apply.test.ts +363 -0
  361. package/packages/shared-skills/skills/ulw-research/scripts/polish-diff.mjs +31 -0
  362. package/packages/shared-skills/skills/ulw-research/scripts/polish-diff.test.ts +168 -0
  363. package/packages/shared-skills/skills/ulw-research/scripts/polish-markup.test.ts +187 -0
  364. package/packages/shared-skills/skills/ulw-research/scripts/polish-project.mjs +125 -0
  365. package/packages/shared-skills/skills/ulw-research/scripts/polish-rules.mjs +170 -0
  366. package/packages/shared-skills/skills/ulw-research/scripts/rational.mjs +139 -0
  367. package/packages/shared-skills/skills/ulw-research/scripts/rational.test.ts +46 -0
  368. package/packages/shared-skills/skills/ulw-research/scripts/report-tools-commands.mjs +21 -10
  369. package/packages/shared-skills/skills/ulw-research/scripts/report-tools.mjs +15 -0
  370. package/packages/shared-skills/skills/ulw-research/scripts/report-tools.test.ts +458 -2
  371. package/packages/shared-skills/skills/ulw-research/scripts/sentence-split.mjs +77 -0
  372. package/packages/shared-skills/skills/ulw-research/scripts/sentence-split.test.ts +109 -0
  373. package/packages/shared-skills/skills/ulw-research/scripts/source-commands.mjs +140 -0
  374. package/packages/shared-skills/skills/ulw-research/scripts/source-snapshot.mjs +176 -0
  375. package/packages/shared-skills/skills/ulw-research/scripts/source-snapshot.test.ts +113 -0
  376. package/packages/shared-skills/skills/ulw-research/scripts/tests/fixtures/fidelity/assets/share.csv +3 -0
  377. package/packages/shared-skills/skills/ulw-research/scripts/tests/fixtures/fidelity/claim-graph.md +13 -0
  378. package/packages/shared-skills/skills/ulw-research/scripts/tests/fixtures/fidelity/gen-legacy-dev.mjs +89 -0
  379. package/packages/shared-skills/skills/ulw-research/scripts/tests/fixtures/fidelity/ledger-basic.json +223 -0
  380. package/packages/shared-skills/skills/ulw-research/scripts/tests/fixtures/fidelity/ledger-legacy-dev.json +859 -0
  381. package/packages/shared-skills/skills/ulw-research/scripts/tests/fixtures/fidelity/ledger-verify.json +420 -0
  382. package/packages/shared-skills/skills/ulw-research/scripts/tests/fixtures/fidelity/report-bad.html +19 -0
  383. package/packages/shared-skills/skills/ulw-research/scripts/tests/fixtures/fidelity/report-good.html +39 -0
  384. package/packages/shared-skills/skills/ulw-research/scripts/tests/fixtures/fidelity/sources/S4/acronyms.json +3 -0
  385. package/packages/shared-skills/skills/ulw-research/scripts/tests/fixtures/fidelity/sources/S4/meta.json +9 -0
  386. package/packages/shared-skills/skills/ulw-research/scripts/tests/fixtures/fidelity/sources/S4/sentences.jsonl +7 -0
  387. package/packages/shared-skills/skills/ulw-research/scripts/tests/fixtures/fidelity/sources/S4/text.txt +7 -0
  388. package/packages/shared-skills/skills/ulw-research/scripts/tests/fixtures/fidelity/sources/S4.html +19 -0
  389. package/packages/shared-skills/skills/ulw-research/scripts/tests/fixtures/fidelity/sources/S5/acronyms.json +1 -0
  390. package/packages/shared-skills/skills/ulw-research/scripts/tests/fixtures/fidelity/sources/S5/meta.json +9 -0
  391. package/packages/shared-skills/skills/ulw-research/scripts/tests/fixtures/fidelity/sources/S5/sentences.jsonl +1 -0
  392. package/packages/shared-skills/skills/ulw-research/scripts/tests/fixtures/fidelity/sources/S5/text.txt +1 -0
  393. package/packages/shared-skills/skills/ulw-research/scripts/tests/fixtures/fidelity/sources/S9.txt +1 -0
  394. package/packages/shared-skills/skills/ulw-research/scripts/tests/fixtures/fidelity-brief-locked.md +17 -0
  395. package/packages/shared-skills/skills/ulw-research/scripts/tests/fixtures/fidelity-brief-pending.md +17 -0
  396. package/packages/shared-skills/skills/ulw-research/scripts/text-normalize.mjs +82 -0
  397. package/packages/shared-skills/skills/ulw-research/scripts/text-normalize.test.ts +73 -0
  398. package/packages/shared-skills/skills/ulw-research/scripts/text-similarity.mjs +28 -0
  399. package/packages/shared-skills/skills/ulw-research/scripts/text-similarity.test.ts +38 -0
  400. package/packages/shared-skills/skills/ulw-research/scripts/unit-algebra.mjs +101 -0
  401. package/packages/shared-skills/skills/ulw-research/scripts/unit-errors.mjs +23 -0
  402. package/packages/shared-skills/skills/ulw-research/scripts/unit-metadata.mjs +31 -0
  403. package/packages/shared-skills/skills/ulw-research/scripts/unit-pairs.mjs +72 -0
  404. package/packages/shared-skills/skills/ulw-research/scripts/unit-precision.mjs +44 -0
  405. package/packages/shared-skills/skills/ulw-research/scripts/unit-rules-shapes.mjs +64 -0
  406. package/packages/shared-skills/skills/ulw-research/scripts/unit-rules.mjs +173 -0
  407. package/packages/shared-skills/skills/ulw-research/scripts/units.mjs +105 -0
  408. package/packages/shared-skills/skills/ulw-research/scripts/units.test.ts +83 -0
  409. package/packages/shared-skills/skills/visual-qa/SKILL.md +70 -63
  410. package/packages/shared-skills/skills/visual-qa/scripts/skill-doc-fields.test.ts +34 -0
  411. package/script/qa/web-terminal-visual-qa.mjs +6 -2
  412. package/script/qa/xterm-live-terminal.mjs +26 -3
@@ -98,17 +98,10 @@ Every refusal is a `BskRpcError` with the daemon's own `code`:
98
98
  | `invalid_params` | wrong option shape | fix the call, do not retry as-is |
99
99
  | `permission_denied` | `evaluate` on a tab outside the Agent Window, or a denied borrow | stop; the user said no |
100
100
  | `timeout` | the tool did not finish in its budget | read the page state before retrying once |
101
- | `user_aborted` | the user pressed Stop in the browser | stop the task and report; under `OMO_BROWSER_ENGINE` this surfaces as `BrowserUserStoppedError` and no session starts again this turn |
101
+ | `user_aborted` | the user pressed Stop in the browser | stop the task and report |
102
102
  | `cdp_failed` | the page cannot be attached (restricted URL, DevTools open) | say which page and why |
103
103
 
104
- Typed errors under `OMO_BROWSER_ENGINE` (see SKILL.md Step 0):
105
-
106
- | Error | `code` | Meaning |
107
- |---|---|---|
108
- | `BrowserNotConnectedError` | `browser_not_connected` | the user's browser is not connected; ask them to connect it |
109
- | `BrowserEngineRefusal` | `browser_engine_none` / `browser_engine_builtin` / `browser_engine_unsupported` / `browser_tool_blocked` | this engine setting does not allow that call |
110
- | `BrowserActionDeclinedError` | `user_declined` | the user said no, or no question could be asked; do not retry |
111
- | `BrowserUserStoppedError` | `user_stopped` | the user stopped browser use |
104
+ Inside OmO Desktop (`OMO_BROWSER_ENGINE` set), `connectBuiltinBrowser()` throws `BuiltinBrowserUnavailableError` (`code` `browser_builtin_unavailable`). Reasons `unavailable`, `timeout`, and `invalid_grant` mean the built-in browser is unavailable; `invalid_grant` includes a missing or unreadable token file. For `user_stopped` or any other app refusal, stop browser work and report it without opening another browser. Refresh uses the new grant's endpoint and token together; every other call behaves as in the terminal.
112
105
 
113
106
  Long calls can be cancelled: `const h = session.client.callWithHandle("tool.navigate", {...})`
114
107
  then `await session.client.cancel(h.rpcId)`.
@@ -11,8 +11,7 @@ Three pieces. The onboarding script prepares all three; a human finishes exactly
11
11
  ## Inside the OmO desktop app
12
12
 
13
13
  The app installs the `bsk` CLI and starts its daemon itself, and keeps the daemon running when the app closes.
14
- Do not run `browser-install.mjs` there unless the doctor says the app's engine is missing; a session set to
15
- `OMO_BROWSER_ENGINE=builtin` or `none` never uses this skill's attached engine at all. `BSK_HOME` and `BSK_BIN`
14
+ Do not run `browser-install.mjs` there unless the doctor says the app's engine is missing. `BSK_HOME` and `BSK_BIN`
16
15
  still decide where the CLI and daemon are found, here and everywhere else.
17
16
 
18
17
  ## Supported
@@ -5,5 +5,5 @@
5
5
  "index.js": "d67d3a847fe0bbc43e824feded48b280890d31879538309e671cd5f671133995",
6
6
  "page-bundle.js": "bfd51e8383cf47200d57387bbbed258bce5a3a3d00c38fc108034d2888e23f0c"
7
7
  },
8
- "stagedAtUtc": "2026-10-23T05:07:41.453Z"
8
+ "stagedAtUtc": "2026-10-25T01:02:39.752Z"
9
9
  }
@@ -19,7 +19,7 @@ const state = report.ready
19
19
 
20
20
  const REMEDIES = {
21
21
  ready: "Attached engine is live: const { connectBrowserSkill } = await import(omowrightEntry); const session = await connectBrowserSkill({ name: \"<task>\", focused: false })",
22
- "no-cli": "Run node \"<skill-root>/scripts/browser-install.mjs\" — it installs the CLI, starts the daemon and registers the extension; then tell the user the single step it prints.",
22
+ "no-cli": "Run node \"<skill-root>/scripts/browser-install.mjs\". It installs the CLI, starts the daemon and registers the extension; then tell the user the single step it prints.",
23
23
  "no-daemon": "Run node \"<skill-root>/scripts/browser-install.mjs\" (it starts the daemon through `bsk status`), then re-run this doctor.",
24
24
  "no-extension": report.nextStep ?? "Register the extension with browser-install.mjs, then relay its human step to the user and re-run this doctor.",
25
25
  "choose-browser": `Do not install anything yet. First check your memory for the browser this user works in; if it names one of the candidates, re-run with --browser=<id>. Otherwise ask the user which browser they actually use (${report.identification.reason}), record the answer in memory, then run node "<skill-root>/scripts/browser-install.mjs" --browser=<id>.`,
@@ -47,7 +47,7 @@ if (process.argv.includes("--json")) {
47
47
  console.log(`state: ${state}`)
48
48
  console.log(`omowright: ${entry}`)
49
49
  console.log(`cli: ${report.cli.installed ? `${report.cli.bskBin} (${report.cli.version})` : "not installed"}`)
50
- console.log(`daemon: ${report.daemon.running ? `running (${report.daemon.version}, protocol ${report.daemon.protocolVersion})` : `not running${report.daemon.error ? ` — ${report.daemon.error}` : ""}`}`)
50
+ console.log(`daemon: ${report.daemon.running ? `running (${report.daemon.version}, protocol ${report.daemon.protocolVersion})` : `not running${report.daemon.error ? ` - ${report.daemon.error}` : ""}`}`)
51
51
  console.log(`browser the user uses: ${summary.browser ? `${summary.browser.label} [${summary.browser.id}] (${summary.browser.reason})` : `not identified (${report.identification.reason})`}`)
52
52
  console.log(`candidates: ${summary.candidates.map((c) => `${c.id}${c.signals.length ? ` (${c.signals.join(", ")})` : ""}`).join(", ") || "none"}`)
53
53
  if (summary.registeredElsewhere.length > 0) console.log(`extension entries left in other browsers: ${summary.registeredElsewhere.join(", ")} (not removed automatically)`)
@@ -1,506 +1,82 @@
1
- export const BROWSER_CONFIRMATION_POLICY = "ask-before-irreversible"
2
- export const BROWSER_ENGINE_ENV = "OMO_BROWSER_ENGINE"
3
- export const BROWSER_STATE_EVENT = "omo.browser.state"
4
-
5
- const BRIDGE_TOOL = "omo_browser_bridge"
6
- const ENGINES = new Set(["connected", "builtin", "none"])
7
- const NOT_CONNECTED_CODES = new Set(["no_browser_connected", "no_daemon", "unsupported"])
8
- const CLASSIFY_HTML_BYTES = 4096
9
- const QUESTION_HEADER = "Browser"
10
- const ALLOW = "Allow"
11
- const DECLINE = "Don't allow"
12
- const READ_ONLY_RAW_TOOLS = new Set(["observe", "snapshot", "get_html", "screenshot", "tab_list", "console", "network"])
13
-
14
- const OWNED_SESSION_CREATORS = new Set(["connect", "connectPipe", "connectCloakProfile"])
15
- const PASSTHROUGH_FUNCTIONS = new Set([
16
- "bskDoctor",
17
- "bskOnboard",
18
- "installBskCli",
19
- "readDaemonInfo",
20
- "resolveBskHome",
21
- "listBrowsers",
22
- "catalogBrowsers",
23
- "detectBrowsers",
24
- "identifyBrowser",
25
- "probeBrowserSignals",
26
- "findCloakBrowserPath",
27
- "resolveCloakProfile",
28
- "registerExternalExtension",
29
- "unregisterExternalExtension",
30
- "externalExtensionEntry",
31
- "buildSnapshotExpression",
32
- "buildCloakBrowserArgs",
33
- "compactSnapshot",
34
- "snapshotTokens",
35
- "describeLayers",
36
- "layersHeader",
37
- "decodeFrames",
38
- "encodeFrame",
39
- "reconcileFrames",
40
- "normalizeDialogPolicy",
41
- "resolveDialogAction",
42
- "sanitizeCookies",
43
- "toHar",
44
- "BskRpcError",
45
- "BridgeProtocolError",
46
- "BridgeUnavailableError",
47
- "BrowserCdpCommandError",
48
- "UnsupportedOperationError",
49
- ])
50
-
51
- class CodedError extends Error {
52
- constructor(name, code, message, options) {
53
- super(message, options)
54
- this.name = name
55
- this.code = code
56
- }
57
- }
58
-
59
- export class BrowserEngineRefusal extends CodedError {
60
- constructor(code, message) {
61
- super("BrowserEngineRefusal", code, message)
62
- }
63
- }
64
-
65
- export class BrowserNotConnectedError extends CodedError {
66
- constructor(message, options) {
67
- super("BrowserNotConnectedError", "browser_not_connected", message, options)
68
- }
69
- }
70
-
71
- export class BrowserUserStoppedError extends CodedError {
72
- constructor(message = "The user stopped browser use. Report that and do not start another browser session this turn.") {
73
- super("BrowserUserStoppedError", "user_stopped", message)
74
- }
75
- }
76
-
77
- export class BrowserActionDeclinedError extends CodedError {
78
- constructor(message, code = "user_declined") {
79
- super("BrowserActionDeclinedError", code, message)
80
- }
81
- }
82
-
83
- const IRREVERSIBLE_LABELS = [
84
- /\b(send|post|publish|tweet|reply)\b/i,
85
- /\b(pay|purchase|buy|subscribe|donate|checkout|submit|confirm|transfer|approve|merge)\b/i,
86
- /\b(e-?sign|sign\s+(the\s+|this\s+|your\s+)?(document|contract|agreement|transaction|petition|form))\b/i,
87
- /\border\b(?!\s+(history|status|details|number|tracking))/i,
88
- /\b(delete|remove|unsubscribe|deactivate)\b/i,
89
- /\bcancel\s+(my\s+|your\s+)?(subscription|membership|plan|account)\b/i,
90
- /\bclose\s+(my\s+|your\s+)?account\b/i,
91
- /결제|구매|주문|구독|삭제|제거|탈퇴|전송|발송|게시|발행|제출|승인|송금|이체|병합/,
92
- ]
93
- const IRREVERSIBLE_ACTION_PATH = /\/(send|post|publish|pay|purchase|order|subscribe|delete|remove)\b/i
94
- const SCRIPT_DRIVES_UI = /\.(click|submit|requestSubmit)\s*\(|\bdispatchEvent\b/
95
- const SCRIPT_BEACON = /\bsendBeacon\s*\(/
96
- const SCRIPT_REACHES_NETWORK = /\b(fetch|XMLHttpRequest)\b/
97
- const SCRIPT_WRITES = /["'`](POST|PUT|PATCH|DELETE)["'`]/i
98
- const ENTER_KEY = /(^|\+)(Enter|Return)$/i
99
- const SENDING_CHORD = /(^|\+)(Control|Ctrl|Meta|Cmd|Command)\+/i
100
-
101
- export function isIrreversibleLabel(label) {
102
- return typeof label === "string" && IRREVERSIBLE_LABELS.some((pattern) => pattern.test(label))
103
- }
104
-
105
- function labelsOf(descriptor) {
106
- return [descriptor?.text, descriptor?.ariaLabel, descriptor?.title, descriptor?.value].filter((label) => typeof label === "string" && label.length > 0)
107
- }
108
-
109
- function markupIsEditable(html) {
110
- return /\bcontenteditable\b(?!\s*=\s*["']?false)|\brole\s*=\s*["']textbox["']|<textarea\b/i.test(html)
111
- }
112
-
113
- function labelsFromMarkup(html) {
114
- const labels = []
115
- for (const match of html.matchAll(/\b(?:aria-label|title|value|alt)\s*=\s*"([^"]*)"/gi)) labels.push(match[1])
116
- labels.push(html.replace(/<[^>]*>/g, " ").replace(/\s+/g, " ").trim())
117
- return labels.filter((label) => label.length > 0)
118
- }
1
+ import { readFile } from "node:fs/promises"
119
2
 
120
- function scriptNeedsConfirmation(expression) {
121
- if (typeof expression !== "string") return false
122
- if (SCRIPT_DRIVES_UI.test(expression) || SCRIPT_BEACON.test(expression)) return true
123
- return SCRIPT_REACHES_NETWORK.test(expression) && SCRIPT_WRITES.test(expression)
124
- }
125
-
126
- function describeElementExpression(selector) {
127
- return `(function (selector) {
128
- const el = selector ? document.querySelector(selector) : document.activeElement
129
- if (!el || el === document.body || el === document.documentElement) return null
130
- const text = (el.innerText || el.textContent || "").trim().slice(0, 200)
131
- const form = el.form || (el.closest ? el.closest("form") : null)
132
- return {
133
- tag: el.localName,
134
- editable: el.isContentEditable === true || el.localName === "textarea" || el.getAttribute("role") === "textbox",
135
- text,
136
- ariaLabel: el.getAttribute("aria-label") || undefined,
137
- title: el.getAttribute("title") || undefined,
138
- value: el.localName === "button" || (el.localName === "input" && /^(submit|button|image)$/i.test(el.type)) ? el.value : undefined,
139
- form: form ? {
140
- action: form.getAttribute("action") || "",
141
- method: (form.getAttribute("method") || "get").toLowerCase(),
142
- submitLabels: Array.from(form.querySelectorAll("button, input[type=submit], input[type=image]")).filter((b) => (b.type || "submit") === "submit").map((b) => (b.innerText || b.value || b.getAttribute("aria-label") || "").trim().slice(0, 100)),
143
- } : undefined,
144
- }
145
- })(${JSON.stringify(selector ?? null)})`
146
- }
147
-
148
- function codeOf(error) {
149
- return typeof error?.code === "string" ? error.code : error instanceof Error ? error.name : "error"
150
- }
151
-
152
- function targetKind(target) {
153
- if (typeof target === "string") return /^@?e\d+$/.test(target) ? { kind: "ref", ref: target } : { kind: "selector", selector: target }
154
- if (target && typeof target === "object") {
155
- if (typeof target.ref === "string") return { kind: "ref", ref: target.ref }
156
- if (typeof target.selector === "string") return { kind: "selector", selector: target.selector }
157
- }
158
- return { kind: "point" }
159
- }
160
-
161
- function createBridge(host, context) {
162
- const call = async (args) => {
163
- if (host === undefined) return undefined
164
- try {
165
- const result = await host.callTool(BRIDGE_TOOL, args)
166
- return result?.hasError === true ? undefined : result
167
- } catch {
168
- return undefined
169
- }
170
- }
171
- return {
172
- async emit(status, extra = {}) {
173
- const data = { engine: context.engine, status }
174
- if (context.sessionId !== undefined) data.session = context.sessionId
175
- for (const [key, value] of Object.entries(extra)) if (value !== undefined) data[key] = value
176
- await call({ op: "state", data })
177
- },
178
- async stopped() {
179
- return (await call({ op: "status" }))?.details?.stopped === true
180
- },
181
- async markStopped() {
182
- await call({ op: "stopped" })
183
- },
184
- }
185
- }
186
-
187
- function describeTab(tab) {
188
- if (!tab || typeof tab !== "object") return undefined
189
- const favicon = tab.favicon_url ?? tab.faviconUrl ?? tab.favIconUrl ?? tab.favicon
190
- const described = { id: tab.id, url: tab.url, title: tab.title }
191
- if (typeof favicon === "string") described.favicon = favicon
192
- return described
193
- }
194
-
195
- async function currentTab(rawSession) {
196
- try {
197
- const { tabs } = await rawSession.tabList({ scope: "agent" })
198
- return describeTab(tabs?.find((tab) => tab.active) ?? tabs?.[0])
199
- } catch {
200
- return undefined
201
- }
202
- }
203
-
204
- function questionFor(variant, description) {
205
- const options = [
206
- { label: ALLOW, description: "Do it this once." },
207
- { label: DECLINE, description: "Stop this action and tell the agent." },
208
- ]
209
- const question = `Allow the agent to ${description}?`
210
- if (variant === "ask_user_question") {
211
- return { waitForAnswer: true, questions: [{ header: QUESTION_HEADER, question, multiSelect: false, options }] }
212
- }
213
- return { wait_for_answer: true, questions: [{ id: "confirm_browser_action", header: QUESTION_HEADER, question, options }] }
214
- }
215
-
216
- function chosenAnswer(variant, details) {
217
- if (details?.status !== "answered") return undefined
218
- const entries = Object.values(details.answers ?? {})
219
- if (entries.length !== 1) return undefined
220
- return variant === "ask_user_question" ? entries[0] : entries[0]?.answers?.[0]
221
- }
3
+ export const BROWSER_ENGINE_ENV = "OMO_BROWSER_ENGINE"
222
4
 
223
- async function confirmWithUser({ host, bridge, rawSession, description, action }) {
224
- const decline = (unavailableReason) =>
225
- unavailableReason === undefined
226
- ? new BrowserActionDeclinedError(`The user declined: ${description}. Nothing was done; report that and do not retry it.`)
227
- : new BrowserActionDeclinedError(`Nothing was done: ${description}. ${unavailableReason}`, "confirmation_unavailable")
228
- let variant
229
- try {
230
- const names = host === undefined ? [] : await host.listTools()
231
- variant = ["ask_user_question", "request_user_input"].find((name) => names.includes(name))
232
- } catch {
233
- variant = undefined
234
- }
235
- if (host === undefined || variant === undefined) {
236
- throw decline("The user could not be asked because this session has no question tool.")
237
- }
238
- const tab = await currentTab(rawSession)
239
- await bridge.emit("awaiting_confirmation", { action, tab })
240
- let answer
241
- try {
242
- const result = await host.callTool(variant, questionFor(variant, description))
243
- answer = result?.hasError === true ? undefined : chosenAnswer(variant, result?.details)
244
- } catch {
245
- answer = undefined
246
- }
247
- if (answer !== ALLOW) {
248
- await bridge.emit("failed", { action, reason: "user_declined", tab })
249
- throw decline()
250
- }
5
+ const TOOLKIT_TOOL = "omo_desktop_toolkit"
6
+ const BUILTIN_UNAVAILABLE = {
7
+ unavailable: "this app does not offer its built-in browser to this session",
8
+ timeout: "the app did not answer the request for its built-in browser",
9
+ invalid_grant: "the app answered the request for its built-in browser with something unusable",
251
10
  }
252
11
 
253
- function hostOf(url) {
254
- try {
255
- return new URL(url).host
256
- } catch {
257
- return undefined
12
+ export class BuiltinBrowserUnavailableError extends Error {
13
+ constructor(reason) {
14
+ const unavailable = Object.hasOwn(BUILTIN_UNAVAILABLE, reason)
15
+ super(
16
+ unavailable
17
+ ? `OmO's built-in browser is not available here: ${BUILTIN_UNAVAILABLE[reason]}. Every other browser works as usual: connectBrowserSkill() for the user's own browser, connectPipe() for a browser of your own.`
18
+ : `OmO's built-in browser was refused: ${reason === "user_stopped" ? "the user stopped browser work" : `the app refused it (${reason})`}. Stop browser work and report the refusal; do not open another browser.`,
19
+ )
20
+ this.name = "BuiltinBrowserUnavailableError"
21
+ this.code = "browser_builtin_unavailable"
22
+ this.reason = reason
258
23
  }
259
24
  }
260
25
 
261
- async function describeForConfirmation(rawSession, label, rawSessionTab) {
262
- const site = hostOf(rawSessionTab?.url)
263
- return site === undefined ? label : `${label} on ${site}`
264
- }
265
-
266
- function wrapSession(rawSession, context, bridge, host) {
267
- const nowStopped = async () => {
268
- if (!(await bridge.stopped())) return
269
- try {
270
- await rawSession.stop()
271
- } catch {
272
- // The daemon may already have ended the session.
273
- }
274
- throw new BrowserUserStoppedError()
275
- }
276
-
277
- const confirm = async (action, label) => {
278
- const tab = await currentTab(rawSession)
279
- await confirmWithUser({ host, bridge, rawSession, description: await describeForConfirmation(rawSession, label, tab), action })
280
- }
26
+ /**
27
+ * Inside OmO Desktop (`OMO_BROWSER_ENGINE` set) the library is the terminal's own, unchanged, plus
28
+ * `connectBuiltinBrowser()`: the app's built-in browser for this thread, the tab the user sees beside the chat.
29
+ */
30
+ export function guardOmowright(raw, { env = process.env, host } = {}) {
31
+ const engine = env[BROWSER_ENGINE_ENV]
32
+ if (engine === undefined || engine === "") return raw
281
33
 
282
- const readTarget = async (target) => {
283
- const kind = targetKind(target)
284
- if (kind.kind === "point") return { unknown: true, labels: [] }
34
+ const acquireBuiltinBrowser = async () => {
35
+ let details
285
36
  try {
286
- if (kind.kind === "ref") {
287
- const reply = await rawSession.getHtml({ ref: kind.ref, maxBytes: CLASSIFY_HTML_BYTES })
288
- const html = String(reply?.html ?? "")
289
- return { unknown: false, labels: labelsFromMarkup(html), editable: markupIsEditable(html) }
290
- }
291
- const reply = await rawSession.evaluate(describeElementExpression(kind.selector), { returnByValue: true, awaitPromise: false })
292
- if (!reply || reply.ok === false) return { unknown: true, labels: [] }
293
- if (reply.value === null || reply.value === undefined) return { unknown: false, labels: [], missing: true }
294
- return { unknown: false, labels: labelsOf(reply.value), descriptor: reply.value }
37
+ details = (await host?.callTool(TOOLKIT_TOOL, { op: "acquire", toolkit: "browser" }))?.details
295
38
  } catch {
296
- return { unknown: true, labels: [] }
297
- }
298
- }
299
-
300
- const preflightClick = async (target) => {
301
- const read = await readTarget(target)
302
- if (read.unknown) return confirm("click", "click a control whose label could not be read")
303
- const label = read.labels.find(isIrreversibleLabel)
304
- if (label !== undefined) return confirm("click", `click "${label}"`)
305
- return undefined
306
- }
307
-
308
- const preflightPress = async (key, options) => {
309
- if (typeof key !== "string" || !ENTER_KEY.test(key)) return undefined
310
- if (SENDING_CHORD.test(key)) return confirm("press", `press ${key}, which sends in many apps`)
311
- if (/(^|\+)Shift\+/i.test(key)) return undefined
312
- const sendsFromMessageBox = () => confirm("press", "press Enter in a message box, which sends in many apps")
313
- const target = options?.target
314
- if (target !== undefined && targetKind(target).kind !== "selector") {
315
- const read = await readTarget(target)
316
- if (read.unknown) return confirm("press", "press Enter on a control that could not be read")
317
- if (read.editable) return sendsFromMessageBox()
318
- const label = read.labels.find(isIrreversibleLabel)
319
- return label === undefined ? undefined : confirm("press", `press Enter on "${label}"`)
39
+ details = undefined
320
40
  }
321
- let described
41
+ if (details?.ok !== true) throw new BuiltinBrowserUnavailableError(typeof details?.reason === "string" ? details.reason : "unavailable")
42
+ // Without an endpoint CdpClient falls back to 127.0.0.1:9222 and would send the token to whatever listens there.
43
+ const endpoint = details.grant?.endpoint
44
+ if (typeof endpoint !== "string" || endpoint === "") throw new BuiltinBrowserUnavailableError("invalid_grant")
45
+ let token
322
46
  try {
323
- const reply = await rawSession.evaluate(describeElementExpression(target === undefined ? undefined : targetKind(target).selector), {
324
- returnByValue: true,
325
- awaitPromise: false,
326
- })
327
- if (!reply || reply.ok === false) return confirm("press", "press Enter in a field that could not be read")
328
- described = reply.value
47
+ token = (await readFile(details.grant.tokenFile, "utf8")).trim()
329
48
  } catch {
330
- return confirm("press", "press Enter in a field that could not be read")
49
+ throw new BuiltinBrowserUnavailableError("invalid_grant")
331
50
  }
332
- if (described === null || described === undefined) return undefined
333
- const form = described.form
334
- if (described.editable === true && (form === undefined || form.method !== "get")) return sendsFromMessageBox()
335
- const own = labelsOf(described).find(isIrreversibleLabel)
336
- if (own !== undefined && described.tag !== "input") return confirm("press", `press Enter on "${own}"`)
337
- if (form === undefined) return undefined
338
- const submit = (form.submitLabels ?? []).find(isIrreversibleLabel)
339
- if (submit !== undefined) return confirm("press", `submit a form with "${submit}"`)
340
- if (form.method === "post" && IRREVERSIBLE_ACTION_PATH.test(String(form.action))) return confirm("press", "submit a form that sends")
341
- return undefined
342
- }
343
-
344
- const act = async (kind, run, { navigates = false, preflight } = {}) => {
345
- await nowStopped()
346
- if (preflight !== undefined) await preflight()
347
- await bridge.emit("acting", { action: kind })
348
- let result
349
- try {
350
- result = await run()
351
- } catch (error) {
352
- if (codeOf(error) === "user_aborted") {
353
- await bridge.markStopped()
354
- await bridge.emit("user_stopped", { action: kind })
355
- try {
356
- await rawSession.stop()
357
- } catch {
358
- // The daemon already ended it.
51
+ return { endpoint, authorization: `Bearer ${token}` }
52
+ }
53
+
54
+ // A CDP endpoint that shows only this thread's tabs. The token is read from the file the grant names, so it never
55
+ // passes through a tool result.
56
+ const connectBuiltinBrowser = async (options = {}) => {
57
+ let current = await acquireBuiltinBrowser()
58
+ // Concurrent refreshes share one acquire, so a token is never paired with another grant's endpoint.
59
+ let refreshing
60
+ const authorizer = {
61
+ async resolveAuthorization({ forceRefresh } = {}) {
62
+ if (forceRefresh) {
63
+ refreshing ??= acquireBuiltinBrowser()
64
+ .then((next) => {
65
+ current = next
66
+ client.cdpUrl = next.endpoint
67
+ return next
68
+ })
69
+ .finally(() => {
70
+ refreshing = undefined
71
+ })
72
+ return (await refreshing).authorization
359
73
  }
360
- throw new BrowserUserStoppedError()
361
- }
362
- await bridge.emit("failed", { action: kind, reason: codeOf(error) })
363
- throw error
364
- }
365
- if (navigates) await bridge.emit("navigated", { action: kind, tab: await currentTab(rawSession) })
366
- await bridge.emit("idle", { action: kind })
367
- return result
368
- }
369
-
370
- const plain = (method, navigates) => (...args) => act(method, () => rawSession[method](...args), { navigates })
371
- const handlers = {
372
- navigate: plain("navigate", true),
373
- back: plain("back", true),
374
- forward: plain("forward", true),
375
- reload: plain("reload", true),
376
- waitForNavigation: plain("waitForNavigation", true),
377
- tabCreate: plain("tabCreate", true),
378
- tabSelect: plain("tabSelect", true),
379
- tabClose: plain("tabClose", true),
380
- tabBorrow: plain("tabBorrow", true),
381
- tabReturn: plain("tabReturn", true),
382
- fill: plain("fill", false),
383
- select: plain("select", false),
384
- hover: plain("hover", false),
385
- focus: plain("focus", false),
386
- blur: plain("blur", false),
387
- scrollTo: plain("scrollTo", false),
388
- wheel: plain("wheel", false),
389
- click: (target, options) => act("click", () => rawSession.click(target, options), { preflight: () => preflightClick(target) }),
390
- press: (key, options) => act("press", () => rawSession.press(key, options), { preflight: () => preflightPress(key, options) }),
391
- evaluate: (expression, options) =>
392
- act("evaluate", () => rawSession.evaluate(expression, options), {
393
- preflight: () => (scriptNeedsConfirmation(expression) ? confirm("evaluate", "run a script that can click, submit or send in your browser") : undefined),
394
- }),
395
- tool: async (name, params) => {
396
- if (!READ_ONLY_RAW_TOOLS.has(name)) {
397
- throw new BrowserEngineRefusal("browser_tool_blocked", `session.tool("${name}") skips the confirmation policy; only reads go through it. Call the matching session method instead.`)
398
- }
399
- return await rawSession.tool(name, params)
400
- },
401
- async stop() {
402
- if (rawSession.stopped) return null
403
- try {
404
- return await rawSession.stop()
405
- } finally {
406
- await bridge.emit("stopped")
407
- }
408
- },
409
- }
410
-
411
- return new Proxy(rawSession, {
412
- get(target, property) {
413
- if (Object.hasOwn(handlers, property)) return handlers[property]
414
- const value = Reflect.get(target, property, target)
415
- return typeof value === "function" ? value.bind(target) : value
416
- },
417
- })
418
- }
419
-
420
- const GUARDED_SESSIONS = new WeakMap()
421
-
422
- function connectErrorFor(error) {
423
- if (NOT_CONNECTED_CODES.has(codeOf(error))) {
424
- return new BrowserNotConnectedError(
425
- "Connect your browser: this session is set to drive the user's own browser, and none is connected. Ask the user to open the browser that has the BrowserSkill extension enabled, then try again. Do not use or launch another browser.",
426
- { cause: error },
427
- )
428
- }
429
- return error
430
- }
431
-
432
- export function guardOmowright(raw, { env = process.env, host } = {}) {
433
- const engine = env[BROWSER_ENGINE_ENV]
434
- if (engine === undefined || engine === "") return raw
435
-
436
- const connectBrowserSkill = async (options) => {
437
- if (!ENGINES.has(engine)) {
438
- throw new BrowserEngineRefusal("browser_engine_unsupported", `${BROWSER_ENGINE_ENV} is "${engine}", which is not connected, builtin or none; browser use is refused.`)
439
- }
440
- if (engine === "none") {
441
- throw new BrowserEngineRefusal("browser_engine_none", "Agent browser access is off for this project. Tell the user; do not try another browser.")
74
+ return current.authorization
75
+ },
442
76
  }
443
- if (engine === "builtin") {
444
- throw new BrowserEngineRefusal("browser_engine_builtin", "This session uses the app's built-in browser. Do not call connectBrowserSkill(); use the app's in-app browser tools.")
445
- }
446
- const context = { engine, sessionId: undefined }
447
- const bridge = createBridge(host, context)
448
- if (await bridge.stopped()) throw new BrowserUserStoppedError()
449
- let rawSession
450
- try {
451
- rawSession = await raw.connectBrowserSkill(options)
452
- } catch (error) {
453
- await bridge.emit("connect_failed", { reason: codeOf(error) })
454
- throw connectErrorFor(error)
455
- }
456
- context.sessionId = rawSession.sessionId
457
- const session = wrapSession(rawSession, context, bridge, host)
458
- GUARDED_SESSIONS.set(session, rawSession)
459
- await bridge.emit("started")
460
- return session
77
+ const client = new raw.CdpClient({ ...options.client, cdpUrl: current.endpoint, authorizer })
78
+ return await new raw.BrowserConnection(client, options).initialize()
461
79
  }
462
80
 
463
- const bskSnapshot = (session, options) => raw.bskSnapshot(GUARDED_SESSIONS.get(session) ?? session, options)
464
-
465
- return allowlistedLibrary(raw, engine, { connectBrowserSkill, bskSnapshot })
466
- }
467
-
468
- function ownedBrowserRefusal(engine) {
469
- const why =
470
- engine === "none"
471
- ? "Agent browser access is off for this project."
472
- : engine === "builtin"
473
- ? "This session uses the app's built-in browser."
474
- : engine === "connected"
475
- ? "This session drives the user's own browser only."
476
- : `${BROWSER_ENGINE_ENV} is "${engine}", which is not connected, builtin or none.`
477
- const refusal = new BrowserEngineRefusal("browser_engine_owned_blocked", `${why} Do not launch an owned browser; tell the user instead.`)
478
- refusal.engine = engine
479
- return refusal
480
- }
481
-
482
- function blockedExport(name, engine) {
483
- const blocked = function () {
484
- const refusal = new BrowserEngineRefusal(
485
- OWNED_SESSION_CREATORS.has(name) ? "browser_engine_owned_blocked" : "browser_engine_export_blocked",
486
- OWNED_SESSION_CREATORS.has(name)
487
- ? ownedBrowserRefusal(engine).message
488
- : `omowright.${name} is not available while ${BROWSER_ENGINE_ENV} is set; it can act on a browser without the engine and confirmation policy.`,
489
- )
490
- refusal.engine = engine
491
- if (new.target !== undefined) throw refusal
492
- return Promise.reject(refusal)
493
- }
494
- Object.defineProperty(blocked, "name", { value: name })
495
- return blocked
496
- }
497
-
498
- function allowlistedLibrary(raw, engine, guarded) {
499
- const library = {}
500
- for (const [name, value] of Object.entries(raw)) {
501
- if (typeof value !== "function") library[name] = value
502
- else if (PASSTHROUGH_FUNCTIONS.has(name)) library[name] = value
503
- else library[name] = blockedExport(name, engine)
504
- }
505
- return Object.assign(library, guarded)
81
+ return { ...raw, connectBuiltinBrowser }
506
82
  }
@@ -36,7 +36,7 @@ if (json) {
36
36
  console.log(`attached engine ready: ${summary.browsersConnected.map((b) => `${b.name} ${b.version}`).join(", ")}`)
37
37
  } else {
38
38
  console.log(`cli: ${result.cli.installed ? `${result.cli.bskBin} (${result.cli.version})` : "install failed"}`)
39
- console.log(`daemon: ${result.daemon.running ? "running" : `not running${result.daemon.error ? ` — ${result.daemon.error}` : ""}`}`)
39
+ console.log(`daemon: ${result.daemon.running ? "running" : `not running${result.daemon.error ? ` - ${result.daemon.error}` : ""}`}`)
40
40
  console.log(summary.browser ? `browser: ${summary.browser.label} [${summary.browser.id}] (${summary.browser.reason})` : `browser: not identified (${result.identification.reason})`)
41
41
  for (const r of summary.registrations) {
42
42
  console.log(`extension for ${r.browser}: ${r.registered ? (r.alreadyPresent ? "already registered" : "registered") : `not registered (${r.reason})`}`)
@@ -3,16 +3,7 @@ import { dirname, join } from "node:path"
3
3
  import { fileURLToPath, pathToFileURL } from "node:url"
4
4
  import { guardOmowright } from "./browser-engine-guard.mjs"
5
5
 
6
- export {
7
- BROWSER_CONFIRMATION_POLICY,
8
- BROWSER_ENGINE_ENV,
9
- BROWSER_STATE_EVENT,
10
- BrowserActionDeclinedError,
11
- BrowserEngineRefusal,
12
- BrowserNotConnectedError,
13
- BrowserUserStoppedError,
14
- guardOmowright,
15
- } from "./browser-engine-guard.mjs"
6
+ export { BROWSER_ENGINE_ENV, BuiltinBrowserUnavailableError, guardOmowright } from "./browser-engine-guard.mjs"
16
7
 
17
8
  const scriptDir = dirname(fileURLToPath(import.meta.url))
18
9
  const skillRoot = dirname(scriptDir)