claudecode-omc 5.6.8 → 5.11.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 (216) hide show
  1. package/.local/settings/settings.json +8 -0
  2. package/.local/skills/prompt-optimizer/SKILL.md +262 -19
  3. package/.omc-curation/ecc-selection.json +80 -0
  4. package/.omc-curation/governance.json +116 -0
  5. package/.omc-curation/sources.lock.json +30 -0
  6. package/README.md +78 -4
  7. package/bundled/manifest.json +6 -5
  8. package/bundled/upstream/anthropic-skills/.omc-source/bundle.json +18 -0
  9. package/bundled/upstream/anthropic-skills/.omc-source/provenance.json +399 -0
  10. package/bundled/upstream/anthropic-skills/skills/claude-api/SKILL.md +18 -17
  11. package/bundled/upstream/anthropic-skills/skills/claude-api/curl/examples.md +9 -9
  12. package/bundled/upstream/anthropic-skills/skills/claude-api/curl/managed-agents.md +4 -4
  13. package/bundled/upstream/anthropic-skills/skills/claude-api/go/managed-agents/README.md +2 -2
  14. package/bundled/upstream/anthropic-skills/skills/claude-api/java/claude-api.md +2 -2
  15. package/bundled/upstream/anthropic-skills/skills/claude-api/java/managed-agents/README.md +2 -2
  16. package/bundled/upstream/anthropic-skills/skills/claude-api/php/claude-api.md +10 -10
  17. package/bundled/upstream/anthropic-skills/skills/claude-api/php/managed-agents/README.md +2 -2
  18. package/bundled/upstream/anthropic-skills/skills/claude-api/python/claude-api/README.md +16 -16
  19. package/bundled/upstream/anthropic-skills/skills/claude-api/python/claude-api/batches.md +3 -3
  20. package/bundled/upstream/anthropic-skills/skills/claude-api/python/claude-api/files-api.md +3 -3
  21. package/bundled/upstream/anthropic-skills/skills/claude-api/python/claude-api/streaming.md +7 -7
  22. package/bundled/upstream/anthropic-skills/skills/claude-api/python/claude-api/tool-use.md +19 -19
  23. package/bundled/upstream/anthropic-skills/skills/claude-api/python/managed-agents/README.md +3 -3
  24. package/bundled/upstream/anthropic-skills/skills/claude-api/ruby/claude-api.md +4 -4
  25. package/bundled/upstream/anthropic-skills/skills/claude-api/ruby/managed-agents/README.md +2 -2
  26. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/error-codes.md +5 -5
  27. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/live-sources.md +3 -1
  28. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/managed-agents-api-reference.md +10 -4
  29. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/managed-agents-core.md +19 -1
  30. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/managed-agents-environments.md +6 -2
  31. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/managed-agents-multiagent.md +1 -1
  32. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/managed-agents-onboarding.md +3 -3
  33. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/managed-agents-overview.md +3 -2
  34. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/managed-agents-self-hosted-sandboxes.md +173 -0
  35. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/managed-agents-tools.md +10 -4
  36. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/model-migration.md +113 -13
  37. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/models.md +14 -11
  38. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/prompt-caching.md +2 -2
  39. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/tool-use-concepts.md +4 -4
  40. package/bundled/upstream/anthropic-skills/skills/claude-api/typescript/claude-api/README.md +15 -15
  41. package/bundled/upstream/anthropic-skills/skills/claude-api/typescript/claude-api/batches.md +2 -2
  42. package/bundled/upstream/anthropic-skills/skills/claude-api/typescript/claude-api/files-api.md +1 -1
  43. package/bundled/upstream/anthropic-skills/skills/claude-api/typescript/claude-api/streaming.md +5 -5
  44. package/bundled/upstream/anthropic-skills/skills/claude-api/typescript/claude-api/tool-use.md +15 -15
  45. package/bundled/upstream/anthropic-skills/skills/claude-api/typescript/managed-agents/README.md +3 -3
  46. package/bundled/upstream/ecc/.omc-source/bundle.json +2 -1
  47. package/bundled/upstream/ecc/.omc-source/last-plan-apply.json +108 -24
  48. package/bundled/upstream/ecc/.omc-source/manifests/.claude-plugin/marketplace.json +3 -3
  49. package/bundled/upstream/ecc/.omc-source/provenance.json +563 -0
  50. package/bundled/upstream/ecc/agents/marketing-agent.md +159 -0
  51. package/bundled/upstream/ecc/agents/react-build-resolver.md +215 -0
  52. package/bundled/upstream/ecc/agents/react-reviewer.md +167 -0
  53. package/bundled/upstream/ecc/agents/typescript-reviewer.md +3 -0
  54. package/bundled/upstream/ecc/commands/harness-audit.md +17 -10
  55. package/bundled/upstream/ecc/commands/marketing-campaign.md +129 -0
  56. package/bundled/upstream/ecc/commands/react-build.md +187 -0
  57. package/bundled/upstream/ecc/commands/react-review.md +170 -0
  58. package/bundled/upstream/ecc/commands/react-test.md +265 -0
  59. package/bundled/upstream/ecc/skills/benchmark-optimization-loop/SKILL.md +69 -0
  60. package/bundled/upstream/ecc/skills/blender-motion-state-inspection/SKILL.md +164 -0
  61. package/bundled/upstream/ecc/skills/canary-watch/SKILL.md +9 -1
  62. package/bundled/upstream/ecc/skills/continuous-learning-v2/hooks/observe.sh +31 -9
  63. package/bundled/upstream/ecc/skills/continuous-learning-v2/scripts/detect-project.sh +38 -4
  64. package/bundled/upstream/ecc/skills/continuous-learning-v2/scripts/instinct-cli.py +319 -12
  65. package/bundled/upstream/ecc/skills/data-throughput-accelerator/SKILL.md +72 -0
  66. package/bundled/upstream/ecc/skills/dynamic-workflow-mode/SKILL.md +123 -0
  67. package/bundled/upstream/ecc/skills/frontend-a11y/SKILL.md +446 -0
  68. package/bundled/upstream/ecc/skills/ito-basket-compare/SKILL.md +63 -0
  69. package/bundled/upstream/ecc/skills/ito-data-atlas-agent/SKILL.md +63 -0
  70. package/bundled/upstream/ecc/skills/ito-market-intelligence/SKILL.md +60 -0
  71. package/bundled/upstream/ecc/skills/ito-trade-planner/SKILL.md +67 -0
  72. package/bundled/upstream/ecc/skills/latency-critical-systems/SKILL.md +73 -0
  73. package/bundled/upstream/ecc/skills/marketing-campaign/SKILL.md +113 -0
  74. package/bundled/upstream/ecc/skills/nextjs-turbopack/SKILL.md +13 -0
  75. package/bundled/upstream/ecc/skills/parallel-execution-optimizer/SKILL.md +72 -0
  76. package/bundled/upstream/ecc/skills/prediction-market-oracle-research/SKILL.md +63 -0
  77. package/bundled/upstream/ecc/skills/prediction-market-risk-review/SKILL.md +60 -0
  78. package/bundled/upstream/ecc/skills/react-patterns/SKILL.md +341 -0
  79. package/bundled/upstream/ecc/skills/react-performance/SKILL.md +574 -0
  80. package/bundled/upstream/ecc/skills/react-testing/SKILL.md +423 -0
  81. package/bundled/upstream/ecc/skills/recsys-pipeline-architect/SKILL.md +114 -0
  82. package/bundled/upstream/ecc/skills/recursive-decision-ledger/SKILL.md +79 -0
  83. package/bundled/upstream/ecc/skills/social-publisher/SKILL.md +115 -0
  84. package/bundled/upstream/ecc/skills/team-agent-orchestration/SKILL.md +110 -0
  85. package/bundled/upstream/ecc/skills/uncloud/SKILL.md +343 -0
  86. package/bundled/upstream/ecc/skills/windows-desktop-e2e/SKILL.md +99 -0
  87. package/bundled/upstream/impeccable/.omc-source/bundle.json +20 -0
  88. package/bundled/upstream/impeccable/.omc-source/provenance.json +105 -0
  89. package/bundled/upstream/impeccable/agents/impeccable-manual-edit-applier.md +97 -0
  90. package/bundled/upstream/impeccable/skills/impeccable/SKILL.md +168 -0
  91. package/bundled/upstream/impeccable/skills/impeccable/reference/adapt.md +311 -0
  92. package/bundled/upstream/impeccable/skills/impeccable/reference/animate.md +201 -0
  93. package/bundled/upstream/impeccable/skills/impeccable/reference/audit.md +133 -0
  94. package/bundled/upstream/impeccable/skills/impeccable/reference/bolder.md +113 -0
  95. package/bundled/upstream/impeccable/skills/impeccable/reference/brand.md +108 -0
  96. package/bundled/upstream/impeccable/skills/impeccable/reference/clarify.md +288 -0
  97. package/bundled/upstream/impeccable/skills/impeccable/reference/codex.md +105 -0
  98. package/bundled/upstream/impeccable/skills/impeccable/reference/colorize.md +257 -0
  99. package/bundled/upstream/impeccable/skills/impeccable/reference/craft.md +123 -0
  100. package/bundled/upstream/impeccable/skills/impeccable/reference/critique.md +767 -0
  101. package/bundled/upstream/impeccable/skills/impeccable/reference/delight.md +302 -0
  102. package/bundled/upstream/impeccable/skills/impeccable/reference/distill.md +111 -0
  103. package/bundled/upstream/impeccable/skills/impeccable/reference/document.md +429 -0
  104. package/bundled/upstream/impeccable/skills/impeccable/reference/extract.md +69 -0
  105. package/bundled/upstream/impeccable/skills/impeccable/reference/harden.md +347 -0
  106. package/bundled/upstream/impeccable/skills/impeccable/reference/hooks.md +88 -0
  107. package/bundled/upstream/impeccable/skills/impeccable/reference/init.md +172 -0
  108. package/bundled/upstream/impeccable/skills/impeccable/reference/interaction-design.md +189 -0
  109. package/bundled/upstream/impeccable/skills/impeccable/reference/layout.md +161 -0
  110. package/bundled/upstream/impeccable/skills/impeccable/reference/live.md +718 -0
  111. package/bundled/upstream/impeccable/skills/impeccable/reference/onboard.md +234 -0
  112. package/bundled/upstream/impeccable/skills/impeccable/reference/optimize.md +258 -0
  113. package/bundled/upstream/impeccable/skills/impeccable/reference/overdrive.md +130 -0
  114. package/bundled/upstream/impeccable/skills/impeccable/reference/polish.md +241 -0
  115. package/bundled/upstream/impeccable/skills/impeccable/reference/product.md +60 -0
  116. package/bundled/upstream/impeccable/skills/impeccable/reference/quieter.md +99 -0
  117. package/bundled/upstream/impeccable/skills/impeccable/reference/shape.md +165 -0
  118. package/bundled/upstream/impeccable/skills/impeccable/reference/typeset.md +279 -0
  119. package/bundled/upstream/impeccable/skills/impeccable/scripts/command-metadata.json +94 -0
  120. package/bundled/upstream/impeccable/skills/impeccable/scripts/context-signals.mjs +225 -0
  121. package/bundled/upstream/impeccable/skills/impeccable/scripts/context.mjs +280 -0
  122. package/bundled/upstream/impeccable/skills/impeccable/scripts/critique-storage.mjs +242 -0
  123. package/bundled/upstream/impeccable/skills/impeccable/scripts/detect-csp.mjs +198 -0
  124. package/bundled/upstream/impeccable/skills/impeccable/scripts/detect.mjs +21 -0
  125. package/bundled/upstream/impeccable/skills/impeccable/scripts/detector/browser/injected/index.mjs +1735 -0
  126. package/bundled/upstream/impeccable/skills/impeccable/scripts/detector/cli/main.mjs +244 -0
  127. package/bundled/upstream/impeccable/skills/impeccable/scripts/detector/detect-antipatterns-browser.js +4907 -0
  128. package/bundled/upstream/impeccable/skills/impeccable/scripts/detector/detect-antipatterns.mjs +43 -0
  129. package/bundled/upstream/impeccable/skills/impeccable/scripts/detector/engines/browser/detect-url.mjs +252 -0
  130. package/bundled/upstream/impeccable/skills/impeccable/scripts/detector/engines/regex/detect-text.mjs +552 -0
  131. package/bundled/upstream/impeccable/skills/impeccable/scripts/detector/engines/static-html/css-cascade.mjs +1013 -0
  132. package/bundled/upstream/impeccable/skills/impeccable/scripts/detector/engines/static-html/detect-html.mjs +208 -0
  133. package/bundled/upstream/impeccable/skills/impeccable/scripts/detector/engines/visual/screenshot-contrast.mjs +189 -0
  134. package/bundled/upstream/impeccable/skills/impeccable/scripts/detector/findings.mjs +12 -0
  135. package/bundled/upstream/impeccable/skills/impeccable/scripts/detector/node/file-system.mjs +198 -0
  136. package/bundled/upstream/impeccable/skills/impeccable/scripts/detector/profile/profiler.mjs +166 -0
  137. package/bundled/upstream/impeccable/skills/impeccable/scripts/detector/registry/antipatterns.mjs +419 -0
  138. package/bundled/upstream/impeccable/skills/impeccable/scripts/detector/rules/checks.mjs +2671 -0
  139. package/bundled/upstream/impeccable/skills/impeccable/scripts/detector/shared/color.mjs +124 -0
  140. package/bundled/upstream/impeccable/skills/impeccable/scripts/detector/shared/constants.mjs +101 -0
  141. package/bundled/upstream/impeccable/skills/impeccable/scripts/detector/shared/page.mjs +7 -0
  142. package/bundled/upstream/impeccable/skills/impeccable/scripts/hook-admin.mjs +574 -0
  143. package/bundled/upstream/impeccable/skills/impeccable/scripts/hook-before-edit.mjs +473 -0
  144. package/bundled/upstream/impeccable/skills/impeccable/scripts/hook-lib.mjs +1286 -0
  145. package/bundled/upstream/impeccable/skills/impeccable/scripts/hook.mjs +61 -0
  146. package/bundled/upstream/impeccable/skills/impeccable/scripts/lib/design-parser.mjs +835 -0
  147. package/bundled/upstream/impeccable/skills/impeccable/scripts/lib/impeccable-paths.mjs +126 -0
  148. package/bundled/upstream/impeccable/skills/impeccable/scripts/lib/is-generated.mjs +69 -0
  149. package/bundled/upstream/impeccable/skills/impeccable/scripts/live/browser-script-parts.mjs +49 -0
  150. package/bundled/upstream/impeccable/skills/impeccable/scripts/live/completion.mjs +19 -0
  151. package/bundled/upstream/impeccable/skills/impeccable/scripts/live/event-validation.mjs +137 -0
  152. package/bundled/upstream/impeccable/skills/impeccable/scripts/live/insert-ui.mjs +458 -0
  153. package/bundled/upstream/impeccable/skills/impeccable/scripts/live/manual-apply.mjs +939 -0
  154. package/bundled/upstream/impeccable/skills/impeccable/scripts/live/manual-edit-routes.mjs +357 -0
  155. package/bundled/upstream/impeccable/skills/impeccable/scripts/live/manual-edits-buffer.mjs +152 -0
  156. package/bundled/upstream/impeccable/skills/impeccable/scripts/live/session-store.mjs +289 -0
  157. package/bundled/upstream/impeccable/skills/impeccable/scripts/live/svelte-component.mjs +826 -0
  158. package/bundled/upstream/impeccable/skills/impeccable/scripts/live/sveltekit-adapter.mjs +274 -0
  159. package/bundled/upstream/impeccable/skills/impeccable/scripts/live/ui-core.mjs +180 -0
  160. package/bundled/upstream/impeccable/skills/impeccable/scripts/live/vocabulary.mjs +36 -0
  161. package/bundled/upstream/impeccable/skills/impeccable/scripts/live-accept.mjs +812 -0
  162. package/bundled/upstream/impeccable/skills/impeccable/scripts/live-browser-dom.js +146 -0
  163. package/bundled/upstream/impeccable/skills/impeccable/scripts/live-browser-session.js +123 -0
  164. package/bundled/upstream/impeccable/skills/impeccable/scripts/live-browser.js +11086 -0
  165. package/bundled/upstream/impeccable/skills/impeccable/scripts/live-commit-manual-edits.mjs +1241 -0
  166. package/bundled/upstream/impeccable/skills/impeccable/scripts/live-complete.mjs +75 -0
  167. package/bundled/upstream/impeccable/skills/impeccable/scripts/live-copy-edit-agent.mjs +683 -0
  168. package/bundled/upstream/impeccable/skills/impeccable/scripts/live-discard-manual-edits.mjs +51 -0
  169. package/bundled/upstream/impeccable/skills/impeccable/scripts/live-inject.mjs +583 -0
  170. package/bundled/upstream/impeccable/skills/impeccable/scripts/live-insert.mjs +272 -0
  171. package/bundled/upstream/impeccable/skills/impeccable/scripts/live-manual-edit-evidence.mjs +363 -0
  172. package/bundled/upstream/impeccable/skills/impeccable/scripts/live-poll.mjs +379 -0
  173. package/bundled/upstream/impeccable/skills/impeccable/scripts/live-resume.mjs +94 -0
  174. package/bundled/upstream/impeccable/skills/impeccable/scripts/live-server.mjs +1134 -0
  175. package/bundled/upstream/impeccable/skills/impeccable/scripts/live-status.mjs +61 -0
  176. package/bundled/upstream/impeccable/skills/impeccable/scripts/live-wrap.mjs +894 -0
  177. package/bundled/upstream/impeccable/skills/impeccable/scripts/live.mjs +246 -0
  178. package/bundled/upstream/impeccable/skills/impeccable/scripts/modern-screenshot.umd.js +14 -0
  179. package/bundled/upstream/impeccable/skills/impeccable/scripts/palette.mjs +633 -0
  180. package/bundled/upstream/impeccable/skills/impeccable/scripts/pin.mjs +214 -0
  181. package/bundled/upstream/oh-my-claudecode/.omc-source/bundle.json +2 -1
  182. package/bundled/upstream/oh-my-claudecode/.omc-source/provenance.json +116 -0
  183. package/bundled/upstream/oh-my-claudecode/skills/autopilot/SKILL.md +7 -0
  184. package/bundled/upstream/oh-my-claudecode/skills/cancel/SKILL.md +1 -0
  185. package/bundled/upstream/oh-my-claudecode/skills/deep-interview/SKILL.md +39 -5
  186. package/bundled/upstream/oh-my-claudecode/skills/hud/SKILL.md +1 -0
  187. package/bundled/upstream/oh-my-claudecode/skills/local-build-reminder/SKILL.md +78 -0
  188. package/bundled/upstream/oh-my-claudecode/skills/omc-doctor/SKILL.md +1 -1
  189. package/bundled/upstream/oh-my-claudecode/skills/omc-setup/SKILL.md +26 -10
  190. package/bundled/upstream/oh-my-claudecode/skills/omc-setup/phases/01-install-claude-md.md +3 -3
  191. package/bundled/upstream/oh-my-claudecode/skills/omc-setup/phases/02-configure.md +6 -4
  192. package/bundled/upstream/oh-my-claudecode/skills/omc-setup/phases/03-integrations.md +1 -1
  193. package/bundled/upstream/oh-my-claudecode/skills/omc-setup/phases/04-welcome.md +2 -2
  194. package/bundled/upstream/oh-my-claudecode/skills/omc-teams/SKILL.md +6 -6
  195. package/bundled/upstream/oh-my-claudecode/skills/plan/SKILL.md +44 -32
  196. package/bundled/upstream/oh-my-claudecode/skills/ralph/SKILL.md +45 -21
  197. package/bundled/upstream/oh-my-claudecode/skills/ralplan/SKILL.md +1 -1
  198. package/bundled/upstream/oh-my-claudecode/skills/self-improve/SKILL.md +7 -0
  199. package/bundled/upstream/oh-my-claudecode/skills/self-improve/scripts/resolve-paths.mjs +39 -15
  200. package/bundled/upstream/oh-my-claudecode/skills/team/SKILL.md +132 -90
  201. package/bundled/upstream/oh-my-claudecode/skills/ultragoal/SKILL.md +93 -0
  202. package/bundled/upstream/oh-my-claudecode/skills/ultraqa/SKILL.md +28 -13
  203. package/bundled/upstream/oh-my-claudecode/skills/ultrawork/SKILL.md +7 -0
  204. package/bundled/upstream/superpowers/.omc-source/bundle.json +2 -1
  205. package/bundled/upstream/superpowers/.omc-source/provenance.json +63 -0
  206. package/package.json +2 -1
  207. package/src/catalog/source-catalog.js +10 -4
  208. package/src/cli/index.js +4 -0
  209. package/src/cli/plan.js +14 -2
  210. package/src/cli/setup.js +52 -13
  211. package/src/cli/skill.js +1 -1
  212. package/src/cli/source.js +271 -14
  213. package/src/config/sources.js +82 -1
  214. package/src/merge/content-patch.js +88 -0
  215. package/templates/merge-config.json +1 -8
  216. package/bundled/upstream/ecc/skills/strategic-compact/suggest-compact.sh +0 -54
@@ -0,0 +1,146 @@
1
+ /**
2
+ * Browser-side DOM helpers for Impeccable live mode.
3
+ *
4
+ * Kept separate from live-browser.js so future browser script parts can share
5
+ * chrome mounting, lookup, focus, and picker helpers without depending on the
6
+ * full overlay UI bundle.
7
+ */
8
+ (function (root) {
9
+ 'use strict';
10
+ if (!root) return;
11
+
12
+ function createLiveBrowserDomHelpers({
13
+ prefix,
14
+ skipTags,
15
+ document: doc = root.document,
16
+ css = root.CSS,
17
+ crypto = root.crypto,
18
+ } = {}) {
19
+ if (!prefix) throw new Error('prefix required');
20
+ if (!doc) throw new Error('document required');
21
+ const tagsToSkip = skipTags || new Set();
22
+
23
+ function own(el) {
24
+ return el && (el.id?.startsWith(prefix) || el.closest?.('[id^="' + prefix + '"]'));
25
+ }
26
+
27
+ function pickable(el) {
28
+ if (!el || el.nodeType !== 1) return false;
29
+ if (tagsToSkip.has(String(el.tagName || '').toLowerCase())) return false;
30
+ if (own(el)) return false;
31
+ const r = el.getBoundingClientRect();
32
+ return r.width >= 20 && r.height >= 20;
33
+ }
34
+
35
+ function desc(el) {
36
+ if (!el) return '';
37
+ let s = el.tagName.toLowerCase();
38
+ if (el.id) s += '#' + el.id;
39
+ else if (el.classList.length) s += '.' + [...el.classList].slice(0, 2).join('.');
40
+ return s;
41
+ }
42
+
43
+ function rectIsUsableAnchor(rect) {
44
+ return !!rect && rect.width > 0.5 && rect.height > 0.5;
45
+ }
46
+
47
+ function makeFrozenAnchor(el) {
48
+ if (!el || !el.getBoundingClientRect) return null;
49
+ const r = el.getBoundingClientRect();
50
+ if (!rectIsUsableAnchor(r)) return null;
51
+ const rect = {
52
+ x: r.x, y: r.y,
53
+ top: r.top, left: r.left,
54
+ right: r.right, bottom: r.bottom,
55
+ width: r.width, height: r.height,
56
+ };
57
+ return {
58
+ __impeccableFrozenAnchor: true,
59
+ tagName: el.tagName || 'DIV',
60
+ id: el.id || '',
61
+ classList: el.classList ? [...el.classList] : [],
62
+ hasAttribute: () => false,
63
+ getBoundingClientRect: () => rect,
64
+ };
65
+ }
66
+
67
+ function id8() {
68
+ if (crypto?.randomUUID) return crypto.randomUUID().replace(/-/g, '').slice(0, 8);
69
+ return (Math.random().toString(16).slice(2) + Date.now().toString(16)).slice(0, 8);
70
+ }
71
+
72
+ function cssId(id) {
73
+ if (css?.escape) return css.escape(id);
74
+ return String(id).replace(/([ !"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g, '\\$1');
75
+ }
76
+
77
+ function liveUiRoot() {
78
+ const uiRoot = root.__IMPECCABLE_LIVE_UI_ROOT__;
79
+ if (uiRoot && typeof uiRoot.appendChild === 'function') return uiRoot;
80
+ return doc.body;
81
+ }
82
+
83
+ function uiAppend(el) {
84
+ liveUiRoot().appendChild(el);
85
+ return el;
86
+ }
87
+
88
+ function uiAppendStyle(styleEl) {
89
+ const uiRoot = liveUiRoot();
90
+ if (uiRoot && uiRoot !== doc.body) uiRoot.appendChild(styleEl);
91
+ else doc.head.appendChild(styleEl);
92
+ return styleEl;
93
+ }
94
+
95
+ function uiGetById(id) {
96
+ const uiRoot = liveUiRoot();
97
+ if (uiRoot?.getElementById) {
98
+ const found = uiRoot.getElementById(id);
99
+ if (found) return found;
100
+ }
101
+ if (uiRoot?.querySelector) {
102
+ const found = uiRoot.querySelector('#' + cssId(id));
103
+ if (found) return found;
104
+ }
105
+ return doc.getElementById(id);
106
+ }
107
+
108
+ function activeElementDeep() {
109
+ let active = doc.activeElement;
110
+ while (active?.shadowRoot?.activeElement) active = active.shadowRoot.activeElement;
111
+ return active;
112
+ }
113
+
114
+ function defangOutsideHandlers(rootEl, { setPointerEvents = true } = {}) {
115
+ if (!rootEl) return;
116
+ if (setPointerEvents) {
117
+ rootEl.style.setProperty('pointer-events', 'auto', 'important');
118
+ }
119
+ const stop = (e) => e.stopPropagation();
120
+ rootEl.addEventListener('pointerdown', stop);
121
+ rootEl.addEventListener('mousedown', stop);
122
+ rootEl.addEventListener('focusin', stop);
123
+ }
124
+
125
+ return {
126
+ own,
127
+ pickable,
128
+ desc,
129
+ rectIsUsableAnchor,
130
+ makeFrozenAnchor,
131
+ id8,
132
+ cssId,
133
+ liveUiRoot,
134
+ uiAppend,
135
+ uiAppendStyle,
136
+ uiGetById,
137
+ activeElementDeep,
138
+ defangOutsideHandlers,
139
+ };
140
+ }
141
+
142
+ root.__IMPECCABLE_LIVE_DOM__ = {
143
+ version: 1,
144
+ createLiveBrowserDomHelpers,
145
+ };
146
+ })(typeof window !== 'undefined' ? window : globalThis);
@@ -0,0 +1,123 @@
1
+ /**
2
+ * Browser-side durable session helpers for Impeccable live mode.
3
+ *
4
+ * Kept separate from live-browser.js so recovery state can be tested without
5
+ * booting the full overlay UI. Served before live-browser.js and attached to
6
+ * window.__IMPECCABLE_LIVE_SESSION__.
7
+ */
8
+ (function (root) {
9
+ 'use strict';
10
+
11
+ function createLiveBrowserSessionState({ prefix, storage, idFactory }) {
12
+ if (!prefix) throw new Error('prefix required');
13
+ const store = storage || root.localStorage;
14
+ const makeId = idFactory || function () { return Math.random().toString(16).slice(2, 10); };
15
+ const sessionKey = prefix + '-session';
16
+ const handledKey = sessionKey + '-handled';
17
+ const scrollKey = sessionKey + '-scroll';
18
+ let checkpointRevision = 0;
19
+ const owner = makeId();
20
+
21
+ function safeRead(key) {
22
+ try { return store.getItem(key); } catch { return null; }
23
+ }
24
+
25
+ function safeWrite(key, value) {
26
+ try { store.setItem(key, value); } catch { /* quota exceeded or private mode */ }
27
+ }
28
+
29
+ function safeRemove(key) {
30
+ try { store.removeItem(key); } catch { /* unavailable storage */ }
31
+ }
32
+
33
+ function loadSession() {
34
+ try {
35
+ const raw = safeRead(sessionKey);
36
+ if (!raw) return null;
37
+ const parsed = JSON.parse(raw);
38
+ if (Number.isInteger(parsed.checkpointRevision)) {
39
+ checkpointRevision = Math.max(checkpointRevision, parsed.checkpointRevision);
40
+ }
41
+ return parsed;
42
+ } catch { return null; }
43
+ }
44
+
45
+ function saveSession(session) {
46
+ if (!session || !session.id) return;
47
+ const payload = {
48
+ ...session,
49
+ checkpointRevision,
50
+ };
51
+ safeWrite(sessionKey, JSON.stringify(payload));
52
+ }
53
+
54
+ function clearSession() {
55
+ safeRemove(sessionKey);
56
+ }
57
+
58
+ function nextCheckpointRevision() {
59
+ checkpointRevision += 1;
60
+ const existing = loadSession();
61
+ if (existing?.id) saveSession(existing);
62
+ return checkpointRevision;
63
+ }
64
+
65
+ function seedCheckpointRevision(value) {
66
+ if (Number.isInteger(value)) checkpointRevision = Math.max(checkpointRevision, value);
67
+ return checkpointRevision;
68
+ }
69
+
70
+ function currentCheckpointRevision() {
71
+ return checkpointRevision;
72
+ }
73
+
74
+ function markHandled(id) {
75
+ if (!id) return;
76
+ safeWrite(handledKey, id);
77
+ }
78
+
79
+ function isHandled(id) {
80
+ return !!id && safeRead(handledKey) === id;
81
+ }
82
+
83
+ function clearHandled() {
84
+ safeRemove(handledKey);
85
+ }
86
+
87
+ function writeScrollY(y) {
88
+ safeWrite(scrollKey, String(y));
89
+ }
90
+
91
+ function readScrollY() {
92
+ const raw = safeRead(scrollKey);
93
+ if (raw == null) return null;
94
+ const n = parseFloat(raw);
95
+ return isFinite(n) ? n : null;
96
+ }
97
+
98
+ function clearScrollY() {
99
+ safeRemove(scrollKey);
100
+ }
101
+
102
+ return {
103
+ owner,
104
+ sessionKey,
105
+ handledKey,
106
+ scrollKey,
107
+ saveSession,
108
+ loadSession,
109
+ clearSession,
110
+ nextCheckpointRevision,
111
+ seedCheckpointRevision,
112
+ currentCheckpointRevision,
113
+ markHandled,
114
+ isHandled,
115
+ clearHandled,
116
+ writeScrollY,
117
+ readScrollY,
118
+ clearScrollY,
119
+ };
120
+ }
121
+
122
+ root.__IMPECCABLE_LIVE_SESSION__ = { createLiveBrowserSessionState };
123
+ })(typeof window !== 'undefined' ? window : globalThis);