@bastani/atomic 0.9.20-alpha.4 → 0.9.20-alpha.6

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 (474) hide show
  1. package/CHANGELOG.md +60 -0
  2. package/README.md +37 -0
  3. package/dist/builtin/intercom/CHANGELOG.md +16 -0
  4. package/dist/builtin/intercom/broker/broker.ts +110 -39
  5. package/dist/builtin/intercom/broker/client.ts +8 -1
  6. package/dist/builtin/intercom/index.bundle.mjs +61 -2
  7. package/dist/builtin/intercom/live-route-refusal.ts +69 -0
  8. package/dist/builtin/intercom/package.json +2 -2
  9. package/dist/builtin/intercom/recoverable-disconnect.ts +16 -4
  10. package/dist/builtin/intercom/skills/intercom/SKILL.md +43 -12
  11. package/dist/builtin/intercom/types.ts +3 -1
  12. package/dist/builtin/mcp/package.json +2 -2
  13. package/dist/builtin/subagents/CHANGELOG.md +18 -0
  14. package/dist/builtin/subagents/README.md +2 -0
  15. package/dist/builtin/subagents/agents/code-simplifier.md +1 -1
  16. package/dist/builtin/subagents/agents/codebase-analyzer.md +1 -1
  17. package/dist/builtin/subagents/agents/codebase-online-researcher.md +3 -3
  18. package/dist/builtin/subagents/agents/debugger.md +7 -5
  19. package/dist/builtin/subagents/agents/worker.md +4 -2
  20. package/dist/builtin/subagents/package.json +3 -3
  21. package/dist/builtin/subagents/skills/agent-browser/SKILL.md +56 -0
  22. package/dist/builtin/subagents/skills/cua-driver/BROWSER.md +494 -0
  23. package/dist/builtin/subagents/skills/cua-driver/EMBEDDING.md +578 -0
  24. package/dist/builtin/subagents/skills/cua-driver/LINUX.md +364 -0
  25. package/dist/builtin/subagents/skills/cua-driver/MACOS.md +509 -0
  26. package/dist/builtin/subagents/skills/cua-driver/README.md +113 -0
  27. package/dist/builtin/subagents/skills/cua-driver/RECORDING.md +162 -0
  28. package/dist/builtin/subagents/skills/cua-driver/SKILL.md +1105 -0
  29. package/dist/builtin/subagents/skills/cua-driver/WINDOWS.md +866 -0
  30. package/dist/builtin/subagents/skills/subagent/SKILL.md +32 -8
  31. package/dist/builtin/subagents/src/extension/index.bundle.mjs +7 -4
  32. package/dist/builtin/web-access/package.json +2 -2
  33. package/dist/builtin/workflows/CHANGELOG.md +43 -0
  34. package/dist/builtin/workflows/README.md +4 -2
  35. package/dist/builtin/workflows/builtin/adversarial-verification.js +3 -3
  36. package/dist/builtin/workflows/builtin/{chunk-1dydq7w3.js → chunk-2hzrv5y8.js} +202 -45
  37. package/dist/builtin/workflows/builtin/{chunk-n4yxrsm9.js → chunk-3tx8ry44.js} +3 -2
  38. package/dist/builtin/workflows/builtin/{chunk-n8g2da69.js → chunk-5724b0cf.js} +1 -1
  39. package/dist/builtin/workflows/builtin/{chunk-scgprmdj.js → chunk-7n51c5gh.js} +1 -1
  40. package/dist/builtin/workflows/builtin/{chunk-9y0f90rd.js → chunk-9z3ztr2a.js} +1 -1
  41. package/dist/builtin/workflows/builtin/{chunk-vt9zgr9d.js → chunk-deq63d9p.js} +4 -4
  42. package/dist/builtin/workflows/builtin/{chunk-k18g9me8.js → chunk-dxjxtgmp.js} +1 -1
  43. package/dist/builtin/workflows/builtin/{chunk-kf5xpbkz.js → chunk-ffdrv23t.js} +1 -1
  44. package/dist/builtin/workflows/builtin/{chunk-119kxb28.js → chunk-hmt5w62g.js} +72 -45
  45. package/dist/builtin/workflows/builtin/{chunk-hnbbb5r0.js → chunk-jngsbbpm.js} +4 -4
  46. package/dist/builtin/workflows/builtin/{chunk-d1xqh1rd.js → chunk-njmf5ze7.js} +1 -1
  47. package/dist/builtin/workflows/builtin/{chunk-sn5mchnx.js → chunk-vn0wb31x.js} +1 -1
  48. package/dist/builtin/workflows/builtin/classify-and-act.js +3 -3
  49. package/dist/builtin/workflows/builtin/fan-out-and-synthesize.js +3 -3
  50. package/dist/builtin/workflows/builtin/generate-and-filter.js +3 -3
  51. package/dist/builtin/workflows/builtin/goal.js +4 -4
  52. package/dist/builtin/workflows/builtin/index.d.ts +1 -1
  53. package/dist/builtin/workflows/builtin/index.js +12 -12
  54. package/dist/builtin/workflows/builtin/loop-until-done.js +3 -3
  55. package/dist/builtin/workflows/builtin/open-claude-design.d.ts +1 -1
  56. package/dist/builtin/workflows/builtin/open-claude-design.js +3 -3
  57. package/dist/builtin/workflows/builtin/ralph.js +4 -4
  58. package/dist/builtin/workflows/builtin/steering-context.js +1 -1
  59. package/dist/builtin/workflows/builtin/tournament.js +3 -3
  60. package/dist/builtin/workflows/package.json +2 -2
  61. package/dist/builtin/workflows/skills/impeccable/SKILL.md +18 -11
  62. package/dist/builtin/workflows/skills/impeccable/reference/adapt.md +1 -1
  63. package/dist/builtin/workflows/skills/impeccable/reference/adapt.native.md +1 -1
  64. package/dist/builtin/workflows/skills/impeccable/reference/animate.md +1 -1
  65. package/dist/builtin/workflows/skills/impeccable/reference/audit.md +5 -5
  66. package/dist/builtin/workflows/skills/impeccable/reference/audit.native.md +6 -6
  67. package/dist/builtin/workflows/skills/impeccable/reference/bolder.md +2 -2
  68. package/dist/builtin/workflows/skills/impeccable/reference/clarify.md +1 -1
  69. package/dist/builtin/workflows/skills/impeccable/reference/colorize.md +1 -1
  70. package/dist/builtin/workflows/skills/impeccable/reference/craft-floor.md +0 -6
  71. package/dist/builtin/workflows/skills/impeccable/reference/critique.md +19 -41
  72. package/dist/builtin/workflows/skills/impeccable/reference/degraded/asset-producer.md +11 -65
  73. package/dist/builtin/workflows/skills/impeccable/reference/degraded/documenter.md +3 -3
  74. package/dist/builtin/workflows/skills/impeccable/reference/degraded/finish-reviewer.md +4 -4
  75. package/dist/builtin/workflows/skills/impeccable/reference/degraded/manual-edit-applier.md +1 -1
  76. package/dist/builtin/workflows/skills/impeccable/reference/delight.md +1 -1
  77. package/dist/builtin/workflows/skills/impeccable/reference/distill.md +2 -2
  78. package/dist/builtin/workflows/skills/impeccable/reference/doctor.md +4 -4
  79. package/dist/builtin/workflows/skills/impeccable/reference/document.md +4 -4
  80. package/dist/builtin/workflows/skills/impeccable/reference/extract.md +1 -1
  81. package/dist/builtin/workflows/skills/impeccable/reference/harden.md +1 -1
  82. package/dist/builtin/workflows/skills/impeccable/reference/hooks.md +21 -21
  83. package/dist/builtin/workflows/skills/impeccable/reference/init.md +8 -8
  84. package/dist/builtin/workflows/skills/impeccable/reference/layout.md +2 -2
  85. package/dist/builtin/workflows/skills/impeccable/reference/live-setup.md +10 -8
  86. package/dist/builtin/workflows/skills/impeccable/reference/live.md +39 -38
  87. package/dist/builtin/workflows/skills/impeccable/reference/new-work.md +48 -21
  88. package/dist/builtin/workflows/skills/impeccable/reference/onboard.md +1 -1
  89. package/dist/builtin/workflows/skills/impeccable/reference/optimize.md +1 -1
  90. package/dist/builtin/workflows/skills/impeccable/reference/overdrive.md +1 -1
  91. package/dist/builtin/workflows/skills/impeccable/reference/polish.md +11 -3
  92. package/dist/builtin/workflows/skills/impeccable/reference/quieter.md +2 -2
  93. package/dist/builtin/workflows/skills/impeccable/reference/routing.md +13 -7
  94. package/dist/builtin/workflows/skills/impeccable/reference/typeset.md +2 -2
  95. package/dist/builtin/workflows/skills/impeccable/reference/visualize.md +13 -19
  96. package/dist/builtin/workflows/skills/impeccable/scripts/VERSION +1 -0
  97. package/dist/builtin/workflows/skills/impeccable/scripts/data/font-index-failures.json +121 -0
  98. package/dist/builtin/workflows/skills/impeccable/scripts/data/font-index.json +1 -0
  99. package/dist/builtin/workflows/skills/impeccable/scripts/impeccable +212 -0
  100. package/dist/builtin/workflows/skills/impeccable/scripts/impeccable.cmd +218 -0
  101. package/dist/builtin/workflows/skills/impeccable/scripts/live-browser-dom.js +21 -0
  102. package/dist/builtin/workflows/skills/impeccable/scripts/live-browser-ignores.js +242 -0
  103. package/dist/builtin/workflows/skills/impeccable/scripts/live-browser-session.js +25 -4
  104. package/dist/builtin/workflows/skills/impeccable/scripts/live-browser.js +666 -197
  105. package/dist/builtin/workflows/skills/research-codebase/SKILL.md +1 -1
  106. package/dist/builtin/workflows/src/extension/index.bundle.mjs +352 -117
  107. package/dist/builtin/workflows/src/index.js +1403 -1218
  108. package/dist/cli/args.d.ts.map +1 -1
  109. package/dist/cli/args.js +15 -4
  110. package/dist/cli/args.js.map +1 -1
  111. package/dist/cli/file-processor.d.ts +1 -1
  112. package/dist/cli/file-processor.d.ts.map +1 -1
  113. package/dist/cli/file-processor.js.map +1 -1
  114. package/dist/core/agent-session-auto-compaction.d.ts.map +1 -1
  115. package/dist/core/agent-session-auto-compaction.js +40 -12
  116. package/dist/core/agent-session-auto-compaction.js.map +1 -1
  117. package/dist/core/agent-session-bash.d.ts.map +1 -1
  118. package/dist/core/agent-session-bash.js +9 -8
  119. package/dist/core/agent-session-bash.js.map +1 -1
  120. package/dist/core/agent-session-boundaries.d.ts +68 -0
  121. package/dist/core/agent-session-boundaries.d.ts.map +1 -0
  122. package/dist/core/agent-session-boundaries.js +334 -0
  123. package/dist/core/agent-session-boundaries.js.map +1 -0
  124. package/dist/core/agent-session-compaction.js +1 -1
  125. package/dist/core/agent-session-compaction.js.map +1 -1
  126. package/dist/core/agent-session-events.d.ts.map +1 -1
  127. package/dist/core/agent-session-events.js +27 -13
  128. package/dist/core/agent-session-events.js.map +1 -1
  129. package/dist/core/agent-session-export.d.ts.map +1 -1
  130. package/dist/core/agent-session-export.js +16 -20
  131. package/dist/core/agent-session-export.js.map +1 -1
  132. package/dist/core/agent-session-message-queue.d.ts.map +1 -1
  133. package/dist/core/agent-session-message-queue.js +3 -2
  134. package/dist/core/agent-session-message-queue.js.map +1 -1
  135. package/dist/core/agent-session-methods.d.ts +30 -4
  136. package/dist/core/agent-session-methods.d.ts.map +1 -1
  137. package/dist/core/agent-session-methods.js.map +1 -1
  138. package/dist/core/agent-session-persistent-custom-messages.d.ts.map +1 -1
  139. package/dist/core/agent-session-persistent-custom-messages.js +2 -1
  140. package/dist/core/agent-session-persistent-custom-messages.js.map +1 -1
  141. package/dist/core/agent-session-prompt.d.ts.map +1 -1
  142. package/dist/core/agent-session-prompt.js +93 -25
  143. package/dist/core/agent-session-prompt.js.map +1 -1
  144. package/dist/core/agent-session-retry.d.ts.map +1 -1
  145. package/dist/core/agent-session-retry.js +4 -9
  146. package/dist/core/agent-session-retry.js.map +1 -1
  147. package/dist/core/agent-session-runtime.js +1 -1
  148. package/dist/core/agent-session-runtime.js.map +1 -1
  149. package/dist/core/agent-session-tool-hooks.d.ts.map +1 -1
  150. package/dist/core/agent-session-tool-hooks.js +15 -5
  151. package/dist/core/agent-session-tool-hooks.js.map +1 -1
  152. package/dist/core/agent-session-tree.d.ts.map +1 -1
  153. package/dist/core/agent-session-tree.js +2 -3
  154. package/dist/core/agent-session-tree.js.map +1 -1
  155. package/dist/core/agent-session-types.d.ts +6 -0
  156. package/dist/core/agent-session-types.d.ts.map +1 -1
  157. package/dist/core/agent-session-types.js.map +1 -1
  158. package/dist/core/agent-session.d.ts +15 -2
  159. package/dist/core/agent-session.d.ts.map +1 -1
  160. package/dist/core/agent-session.js +17 -1
  161. package/dist/core/agent-session.js.map +1 -1
  162. package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  163. package/dist/core/compaction/branch-summarization.js +1 -0
  164. package/dist/core/compaction/branch-summarization.js.map +1 -1
  165. package/dist/core/compaction/compaction-boundary.d.ts.map +1 -1
  166. package/dist/core/compaction/compaction-boundary.js +11 -6
  167. package/dist/core/compaction/compaction-boundary.js.map +1 -1
  168. package/dist/core/compaction/compaction.d.ts +3 -1
  169. package/dist/core/compaction/compaction.d.ts.map +1 -1
  170. package/dist/core/compaction/compaction.js +37 -0
  171. package/dist/core/compaction/compaction.js.map +1 -1
  172. package/dist/core/crash-log.d.ts +6 -0
  173. package/dist/core/crash-log.d.ts.map +1 -0
  174. package/dist/core/crash-log.js +69 -0
  175. package/dist/core/crash-log.js.map +1 -0
  176. package/dist/core/execution-model-router.d.ts +3 -0
  177. package/dist/core/execution-model-router.d.ts.map +1 -1
  178. package/dist/core/execution-model-router.js +45 -16
  179. package/dist/core/execution-model-router.js.map +1 -1
  180. package/dist/core/export-html/template-js/tree-filter-render.js +6 -1
  181. package/dist/core/export-html/template.js +6 -1
  182. package/dist/core/extensions/agent-events.d.ts +69 -3
  183. package/dist/core/extensions/agent-events.d.ts.map +1 -1
  184. package/dist/core/extensions/agent-events.js.map +1 -1
  185. package/dist/core/extensions/api-types.d.ts +5 -3
  186. package/dist/core/extensions/api-types.d.ts.map +1 -1
  187. package/dist/core/extensions/api-types.js.map +1 -1
  188. package/dist/core/extensions/event-results.d.ts +3 -0
  189. package/dist/core/extensions/event-results.d.ts.map +1 -1
  190. package/dist/core/extensions/event-results.js.map +1 -1
  191. package/dist/core/extensions/event-types.d.ts +2 -2
  192. package/dist/core/extensions/event-types.d.ts.map +1 -1
  193. package/dist/core/extensions/event-types.js.map +1 -1
  194. package/dist/core/extensions/index.d.ts +1 -1
  195. package/dist/core/extensions/index.d.ts.map +1 -1
  196. package/dist/core/extensions/index.js.map +1 -1
  197. package/dist/core/extensions/provider-types.d.ts +2 -0
  198. package/dist/core/extensions/provider-types.d.ts.map +1 -1
  199. package/dist/core/extensions/provider-types.js.map +1 -1
  200. package/dist/core/extensions/runner-events.d.ts +16 -2
  201. package/dist/core/extensions/runner-events.d.ts.map +1 -1
  202. package/dist/core/extensions/runner-events.js +98 -5
  203. package/dist/core/extensions/runner-events.js.map +1 -1
  204. package/dist/core/extensions/runner.d.ts +3 -2
  205. package/dist/core/extensions/runner.d.ts.map +1 -1
  206. package/dist/core/extensions/runner.js +4 -1
  207. package/dist/core/extensions/runner.js.map +1 -1
  208. package/dist/core/index.d.ts +1 -1
  209. package/dist/core/index.d.ts.map +1 -1
  210. package/dist/core/index.js.map +1 -1
  211. package/dist/core/messages.d.ts +10 -0
  212. package/dist/core/messages.d.ts.map +1 -1
  213. package/dist/core/messages.js +57 -0
  214. package/dist/core/messages.js.map +1 -1
  215. package/dist/core/model-config.d.ts +52 -0
  216. package/dist/core/model-config.d.ts.map +1 -1
  217. package/dist/core/model-config.js +16 -0
  218. package/dist/core/model-config.js.map +1 -1
  219. package/dist/core/model-resolver-defaults.d.ts.map +1 -1
  220. package/dist/core/model-resolver-defaults.js +2 -1
  221. package/dist/core/model-resolver-defaults.js.map +1 -1
  222. package/dist/core/model-routing-task.d.ts +1 -1
  223. package/dist/core/model-routing-task.d.ts.map +1 -1
  224. package/dist/core/model-routing-task.js +4 -3
  225. package/dist/core/model-routing-task.js.map +1 -1
  226. package/dist/core/prompt-templates-async.d.ts +2 -2
  227. package/dist/core/prompt-templates-async.d.ts.map +1 -1
  228. package/dist/core/prompt-templates-async.js +57 -29
  229. package/dist/core/prompt-templates-async.js.map +1 -1
  230. package/dist/core/prompt-templates.d.ts +6 -1
  231. package/dist/core/prompt-templates.d.ts.map +1 -1
  232. package/dist/core/prompt-templates.js +61 -35
  233. package/dist/core/prompt-templates.js.map +1 -1
  234. package/dist/core/provider-composer-internal.d.ts +1 -0
  235. package/dist/core/provider-composer-internal.d.ts.map +1 -1
  236. package/dist/core/provider-composer-internal.js +19 -0
  237. package/dist/core/provider-composer-internal.js.map +1 -1
  238. package/dist/core/resource-loader-assets.d.ts.map +1 -1
  239. package/dist/core/resource-loader-assets.js +6 -6
  240. package/dist/core/resource-loader-assets.js.map +1 -1
  241. package/dist/core/sdk.js +3 -2
  242. package/dist/core/sdk.js.map +1 -1
  243. package/dist/core/session-manager-core.d.ts +10 -3
  244. package/dist/core/session-manager-core.d.ts.map +1 -1
  245. package/dist/core/session-manager-core.js +65 -7
  246. package/dist/core/session-manager-core.js.map +1 -1
  247. package/dist/core/session-manager-entries.d.ts +4 -1
  248. package/dist/core/session-manager-entries.d.ts.map +1 -1
  249. package/dist/core/session-manager-entries.js +8 -0
  250. package/dist/core/session-manager-entries.js.map +1 -1
  251. package/dist/core/session-manager-history.d.ts +16 -1
  252. package/dist/core/session-manager-history.d.ts.map +1 -1
  253. package/dist/core/session-manager-history.js +105 -42
  254. package/dist/core/session-manager-history.js.map +1 -1
  255. package/dist/core/session-manager-types.d.ts +30 -3
  256. package/dist/core/session-manager-types.d.ts.map +1 -1
  257. package/dist/core/session-manager-types.js.map +1 -1
  258. package/dist/core/session-manager.d.ts +2 -2
  259. package/dist/core/session-manager.d.ts.map +1 -1
  260. package/dist/core/session-manager.js +1 -1
  261. package/dist/core/session-manager.js.map +1 -1
  262. package/dist/core/structured-output/index.d.ts +0 -1
  263. package/dist/core/structured-output/index.d.ts.map +1 -1
  264. package/dist/core/structured-output/index.js +3 -15
  265. package/dist/core/structured-output/index.js.map +1 -1
  266. package/dist/core/structured-output/jev-client.d.ts +4 -8
  267. package/dist/core/structured-output/jev-client.d.ts.map +1 -1
  268. package/dist/core/structured-output/jev-client.js +36 -32
  269. package/dist/core/structured-output/jev-client.js.map +1 -1
  270. package/dist/core/structured-output/jev.d.ts.map +1 -1
  271. package/dist/core/structured-output/jev.js +4 -12
  272. package/dist/core/structured-output/jev.js.map +1 -1
  273. package/dist/core/structured-output/types.d.ts +0 -2
  274. package/dist/core/structured-output/types.d.ts.map +1 -1
  275. package/dist/core/structured-output/types.js.map +1 -1
  276. package/dist/core/system-prompt.d.ts.map +1 -1
  277. package/dist/core/system-prompt.js +2 -1
  278. package/dist/core/system-prompt.js.map +1 -1
  279. package/dist/core/tools/read.d.ts +4 -0
  280. package/dist/core/tools/read.d.ts.map +1 -1
  281. package/dist/core/tools/read.js +5 -1
  282. package/dist/core/tools/read.js.map +1 -1
  283. package/dist/index-extensions.d.ts +1 -1
  284. package/dist/index-extensions.d.ts.map +1 -1
  285. package/dist/index-extensions.js.map +1 -1
  286. package/dist/index.d.ts +3 -3
  287. package/dist/index.d.ts.map +1 -1
  288. package/dist/index.js +3 -3
  289. package/dist/index.js.map +1 -1
  290. package/dist/main-app-mode.d.ts +1 -1
  291. package/dist/main-app-mode.d.ts.map +1 -1
  292. package/dist/main-app-mode.js +3 -2
  293. package/dist/main-app-mode.js.map +1 -1
  294. package/dist/main.d.ts.map +1 -1
  295. package/dist/main.js +1 -1
  296. package/dist/main.js.map +1 -1
  297. package/dist/modes/interactive/components/chat-message-renderer.d.ts.map +1 -1
  298. package/dist/modes/interactive/components/chat-message-renderer.js +4 -0
  299. package/dist/modes/interactive/components/chat-message-renderer.js.map +1 -1
  300. package/dist/modes/interactive/components/tree-selector-content.d.ts.map +1 -1
  301. package/dist/modes/interactive/components/tree-selector-content.js +6 -0
  302. package/dist/modes/interactive/components/tree-selector-content.js.map +1 -1
  303. package/dist/modes/interactive/components/tree-selector-model.d.ts.map +1 -1
  304. package/dist/modes/interactive/components/tree-selector-model.js +1 -0
  305. package/dist/modes/interactive/components/tree-selector-model.js.map +1 -1
  306. package/dist/modes/interactive/interactive-agent-events.js +17 -1
  307. package/dist/modes/interactive/interactive-agent-events.js.map +1 -1
  308. package/dist/modes/interactive/interactive-mode-helpers.d.ts +1 -0
  309. package/dist/modes/interactive/interactive-mode-helpers.d.ts.map +1 -1
  310. package/dist/modes/interactive/interactive-mode-helpers.js +16 -0
  311. package/dist/modes/interactive/interactive-mode-helpers.js.map +1 -1
  312. package/dist/modes/interactive/interactive-mode-surface.d.ts +1 -0
  313. package/dist/modes/interactive/interactive-mode-surface.d.ts.map +1 -1
  314. package/dist/modes/interactive/interactive-mode-surface.js.map +1 -1
  315. package/dist/modes/interactive/interactive-process-lifecycle.js +13 -1
  316. package/dist/modes/interactive/interactive-process-lifecycle.js.map +1 -1
  317. package/dist/modes/interactive/interactive-session-runtime.js +5 -1
  318. package/dist/modes/interactive/interactive-session-runtime.js.map +1 -1
  319. package/dist/utils/mime.js +1 -1
  320. package/dist/utils/mime.js.map +1 -1
  321. package/dist/utils/tool-result-images.d.ts +3 -1
  322. package/dist/utils/tool-result-images.d.ts.map +1 -1
  323. package/dist/utils/tool-result-images.js +4 -1
  324. package/dist/utils/tool-result-images.js.map +1 -1
  325. package/docs/compaction.md +5 -1
  326. package/docs/computer-use.md +123 -73
  327. package/docs/extensions/events.md +75 -7
  328. package/docs/extensions.md +6 -2
  329. package/docs/getting-started/first-session.md +3 -2
  330. package/docs/getting-started/installation.md +6 -2
  331. package/docs/intercom/operations.md +13 -1
  332. package/docs/intercom.md +7 -2
  333. package/docs/models/evals.md +68 -82
  334. package/docs/models/model-selection.md +11 -7
  335. package/docs/models/reference.md +30 -2
  336. package/docs/packages.md +2 -0
  337. package/docs/prompt-templates.md +1 -0
  338. package/docs/providers.md +8 -2
  339. package/docs/quickstart.md +1 -1
  340. package/docs/sdk/reference.md +1 -2
  341. package/docs/sdk/structured-decisions.md +10 -9
  342. package/docs/sdk.md +13 -2
  343. package/docs/session-format.md +17 -2
  344. package/docs/settings.md +1 -1
  345. package/docs/skills.md +3 -1
  346. package/docs/subagents/reference.md +6 -6
  347. package/docs/subagents.md +8 -2
  348. package/docs/usage.md +2 -0
  349. package/docs/windows.md +1 -1
  350. package/docs/workflows/api-reference.md +5 -4
  351. package/docs/workflows/authoring.md +191 -0
  352. package/docs/workflows/builtins.md +2 -2
  353. package/docs/workflows/operations.md +10 -4
  354. package/docs/workflows/reliable-design.md +12 -1
  355. package/docs/workflows/verification.md +27 -14
  356. package/npm-shrinkwrap.json +69 -69
  357. package/package.json +8 -8
  358. package/dist/builtin/subagents/skills/playwright-cli/SKILL.md +0 -420
  359. package/dist/builtin/subagents/skills/playwright-cli/references/element-attributes.md +0 -23
  360. package/dist/builtin/subagents/skills/playwright-cli/references/playwright-tests.md +0 -39
  361. package/dist/builtin/subagents/skills/playwright-cli/references/request-mocking.md +0 -87
  362. package/dist/builtin/subagents/skills/playwright-cli/references/running-code.md +0 -241
  363. package/dist/builtin/subagents/skills/playwright-cli/references/session-management.md +0 -225
  364. package/dist/builtin/subagents/skills/playwright-cli/references/storage-state.md +0 -275
  365. package/dist/builtin/subagents/skills/playwright-cli/references/test-generation.md +0 -433
  366. package/dist/builtin/subagents/skills/playwright-cli/references/tracing.md +0 -139
  367. package/dist/builtin/subagents/skills/playwright-cli/references/video-recording.md +0 -143
  368. package/dist/builtin/workflows/skills/impeccable/agents/impeccable_asset_producer.toml +0 -94
  369. package/dist/builtin/workflows/skills/impeccable/agents/impeccable_documenter.toml +0 -27
  370. package/dist/builtin/workflows/skills/impeccable/agents/impeccable_finish_reviewer.toml +0 -41
  371. package/dist/builtin/workflows/skills/impeccable/agents/impeccable_manual_edit_applier.toml +0 -95
  372. package/dist/builtin/workflows/skills/impeccable/agents/openai.yaml +0 -4
  373. package/dist/builtin/workflows/skills/impeccable/scripts/concept-seed.mjs +0 -695
  374. package/dist/builtin/workflows/skills/impeccable/scripts/context-signals.mjs +0 -325
  375. package/dist/builtin/workflows/skills/impeccable/scripts/context.mjs +0 -1503
  376. package/dist/builtin/workflows/skills/impeccable/scripts/critique-storage.mjs +0 -222
  377. package/dist/builtin/workflows/skills/impeccable/scripts/detect-csp.mjs +0 -198
  378. package/dist/builtin/workflows/skills/impeccable/scripts/detect.mjs +0 -21
  379. package/dist/builtin/workflows/skills/impeccable/scripts/detector/browser/injected/index.mjs +0 -2073
  380. package/dist/builtin/workflows/skills/impeccable/scripts/detector/cli/main.mjs +0 -432
  381. package/dist/builtin/workflows/skills/impeccable/scripts/detector/design-system.mjs +0 -1121
  382. package/dist/builtin/workflows/skills/impeccable/scripts/detector/detect-antipatterns-browser.js +0 -8746
  383. package/dist/builtin/workflows/skills/impeccable/scripts/detector/detect-antipatterns.mjs +0 -51
  384. package/dist/builtin/workflows/skills/impeccable/scripts/detector/engines/browser/detect-url.mjs +0 -376
  385. package/dist/builtin/workflows/skills/impeccable/scripts/detector/engines/regex/detect-text.mjs +0 -1168
  386. package/dist/builtin/workflows/skills/impeccable/scripts/detector/engines/static-html/css-cascade.mjs +0 -1192
  387. package/dist/builtin/workflows/skills/impeccable/scripts/detector/engines/static-html/detect-html.mjs +0 -290
  388. package/dist/builtin/workflows/skills/impeccable/scripts/detector/engines/visual/screenshot-contrast.mjs +0 -189
  389. package/dist/builtin/workflows/skills/impeccable/scripts/detector/findings.mjs +0 -18
  390. package/dist/builtin/workflows/skills/impeccable/scripts/detector/node/file-system.mjs +0 -213
  391. package/dist/builtin/workflows/skills/impeccable/scripts/detector/profile/profiler.mjs +0 -166
  392. package/dist/builtin/workflows/skills/impeccable/scripts/detector/registry/antipatterns.mjs +0 -617
  393. package/dist/builtin/workflows/skills/impeccable/scripts/detector/rules/checks.mjs +0 -5534
  394. package/dist/builtin/workflows/skills/impeccable/scripts/detector/shared/color.mjs +0 -588
  395. package/dist/builtin/workflows/skills/impeccable/scripts/detector/shared/constants.mjs +0 -112
  396. package/dist/builtin/workflows/skills/impeccable/scripts/detector/shared/fonts.mjs +0 -30
  397. package/dist/builtin/workflows/skills/impeccable/scripts/detector/shared/inline-ignores.mjs +0 -148
  398. package/dist/builtin/workflows/skills/impeccable/scripts/detector/shared/page.mjs +0 -35
  399. package/dist/builtin/workflows/skills/impeccable/scripts/doctor.mjs +0 -338
  400. package/dist/builtin/workflows/skills/impeccable/scripts/embed-prompt.mjs +0 -270
  401. package/dist/builtin/workflows/skills/impeccable/scripts/generate-image.mjs +0 -277
  402. package/dist/builtin/workflows/skills/impeccable/scripts/hook-admin.mjs +0 -783
  403. package/dist/builtin/workflows/skills/impeccable/scripts/hook-lib.mjs +0 -2305
  404. package/dist/builtin/workflows/skills/impeccable/scripts/hook.mjs +0 -78
  405. package/dist/builtin/workflows/skills/impeccable/scripts/lib/artifact-schema.mjs +0 -93
  406. package/dist/builtin/workflows/skills/impeccable/scripts/lib/composition-catalog.mjs +0 -200
  407. package/dist/builtin/workflows/skills/impeccable/scripts/lib/concept-catalog.mjs +0 -395
  408. package/dist/builtin/workflows/skills/impeccable/scripts/lib/design-parser.mjs +0 -925
  409. package/dist/builtin/workflows/skills/impeccable/scripts/lib/impeccable-config.mjs +0 -640
  410. package/dist/builtin/workflows/skills/impeccable/scripts/lib/impeccable-paths.mjs +0 -137
  411. package/dist/builtin/workflows/skills/impeccable/scripts/lib/is-generated.mjs +0 -72
  412. package/dist/builtin/workflows/skills/impeccable/scripts/lib/open-system-browser.mjs +0 -57
  413. package/dist/builtin/workflows/skills/impeccable/scripts/lib/provider.mjs +0 -5
  414. package/dist/builtin/workflows/skills/impeccable/scripts/lib/roll-selection.mjs +0 -369
  415. package/dist/builtin/workflows/skills/impeccable/scripts/lib/staleness-deep.mjs +0 -483
  416. package/dist/builtin/workflows/skills/impeccable/scripts/lib/staleness-notice.mjs +0 -169
  417. package/dist/builtin/workflows/skills/impeccable/scripts/lib/staleness.mjs +0 -528
  418. package/dist/builtin/workflows/skills/impeccable/scripts/lib/surface-briefs.mjs +0 -151
  419. package/dist/builtin/workflows/skills/impeccable/scripts/lib/target-args.mjs +0 -42
  420. package/dist/builtin/workflows/skills/impeccable/scripts/lib/target-slug.mjs +0 -33
  421. package/dist/builtin/workflows/skills/impeccable/scripts/lib/template-extensions.mjs +0 -146
  422. package/dist/builtin/workflows/skills/impeccable/scripts/live/accept-css.mjs +0 -617
  423. package/dist/builtin/workflows/skills/impeccable/scripts/live/accept-verify.mjs +0 -71
  424. package/dist/builtin/workflows/skills/impeccable/scripts/live/browser-script-parts.mjs +0 -77
  425. package/dist/builtin/workflows/skills/impeccable/scripts/live/completion.mjs +0 -28
  426. package/dist/builtin/workflows/skills/impeccable/scripts/live/event-validation.mjs +0 -199
  427. package/dist/builtin/workflows/skills/impeccable/scripts/live/frameworks/astro.mjs +0 -47
  428. package/dist/builtin/workflows/skills/impeccable/scripts/live/frameworks/detect-utils.mjs +0 -157
  429. package/dist/builtin/workflows/skills/impeccable/scripts/live/frameworks/index.mjs +0 -143
  430. package/dist/builtin/workflows/skills/impeccable/scripts/live/frameworks/journal.mjs +0 -205
  431. package/dist/builtin/workflows/skills/impeccable/scripts/live/frameworks/nextjs.mjs +0 -49
  432. package/dist/builtin/workflows/skills/impeccable/scripts/live/frameworks/nuxt.mjs +0 -170
  433. package/dist/builtin/workflows/skills/impeccable/scripts/live/frameworks/script-src.mjs +0 -26
  434. package/dist/builtin/workflows/skills/impeccable/scripts/live/frameworks/static-html.mjs +0 -26
  435. package/dist/builtin/workflows/skills/impeccable/scripts/live/frameworks/sveltekit.mjs +0 -71
  436. package/dist/builtin/workflows/skills/impeccable/scripts/live/frameworks/tag-strategy.mjs +0 -247
  437. package/dist/builtin/workflows/skills/impeccable/scripts/live/frameworks/tanstack-start.mjs +0 -70
  438. package/dist/builtin/workflows/skills/impeccable/scripts/live/frameworks/vite-generic.mjs +0 -42
  439. package/dist/builtin/workflows/skills/impeccable/scripts/live/generation-preflight.mjs +0 -149
  440. package/dist/builtin/workflows/skills/impeccable/scripts/live/insert-ui.mjs +0 -458
  441. package/dist/builtin/workflows/skills/impeccable/scripts/live/instructions.mjs +0 -169
  442. package/dist/builtin/workflows/skills/impeccable/scripts/live/manual-apply.mjs +0 -939
  443. package/dist/builtin/workflows/skills/impeccable/scripts/live/manual-edit-routes.mjs +0 -357
  444. package/dist/builtin/workflows/skills/impeccable/scripts/live/manual-edits-buffer.mjs +0 -152
  445. package/dist/builtin/workflows/skills/impeccable/scripts/live/poll-lanes.mjs +0 -14
  446. package/dist/builtin/workflows/skills/impeccable/scripts/live/roots.mjs +0 -670
  447. package/dist/builtin/workflows/skills/impeccable/scripts/live/session-store.mjs +0 -563
  448. package/dist/builtin/workflows/skills/impeccable/scripts/live/source-lock.mjs +0 -105
  449. package/dist/builtin/workflows/skills/impeccable/scripts/live/source-search.mjs +0 -105
  450. package/dist/builtin/workflows/skills/impeccable/scripts/live/svelte-ast.mjs +0 -969
  451. package/dist/builtin/workflows/skills/impeccable/scripts/live/svelte-component.mjs +0 -1401
  452. package/dist/builtin/workflows/skills/impeccable/scripts/live/sveltekit-adapter.mjs +0 -314
  453. package/dist/builtin/workflows/skills/impeccable/scripts/live/tanstack-adapter.mjs +0 -280
  454. package/dist/builtin/workflows/skills/impeccable/scripts/live/ui-surfaces.mjs +0 -75
  455. package/dist/builtin/workflows/skills/impeccable/scripts/live/vocabulary.mjs +0 -171
  456. package/dist/builtin/workflows/skills/impeccable/scripts/live-accept.mjs +0 -961
  457. package/dist/builtin/workflows/skills/impeccable/scripts/live-commit-manual-edits.mjs +0 -1244
  458. package/dist/builtin/workflows/skills/impeccable/scripts/live-complete.mjs +0 -107
  459. package/dist/builtin/workflows/skills/impeccable/scripts/live-copy-edit-agent.mjs +0 -800
  460. package/dist/builtin/workflows/skills/impeccable/scripts/live-discard-manual-edits.mjs +0 -51
  461. package/dist/builtin/workflows/skills/impeccable/scripts/live-inject.mjs +0 -515
  462. package/dist/builtin/workflows/skills/impeccable/scripts/live-insert.mjs +0 -292
  463. package/dist/builtin/workflows/skills/impeccable/scripts/live-manual-edit-evidence.mjs +0 -371
  464. package/dist/builtin/workflows/skills/impeccable/scripts/live-poll.mjs +0 -427
  465. package/dist/builtin/workflows/skills/impeccable/scripts/live-resume.mjs +0 -123
  466. package/dist/builtin/workflows/skills/impeccable/scripts/live-server.mjs +0 -1675
  467. package/dist/builtin/workflows/skills/impeccable/scripts/live-status.mjs +0 -71
  468. package/dist/builtin/workflows/skills/impeccable/scripts/live-target.mjs +0 -30
  469. package/dist/builtin/workflows/skills/impeccable/scripts/live-wrap.mjs +0 -927
  470. package/dist/builtin/workflows/skills/impeccable/scripts/live.mjs +0 -365
  471. package/dist/builtin/workflows/skills/impeccable/scripts/palette.mjs +0 -628
  472. package/dist/builtin/workflows/skills/impeccable/scripts/pin.mjs +0 -224
  473. package/dist/builtin/workflows/skills/impeccable/scripts/serve-question.mjs +0 -1540
  474. package/dist/builtin/workflows/skills/impeccable/scripts/surface-brief.mjs +0 -74
@@ -1,314 +0,0 @@
1
- /**
2
- * SvelteKit live-mode adapter.
3
- *
4
- * SvelteKit must not be patched through src/app.html. That file is a document
5
- * template, not framework-owned component chrome. The adapter keeps SvelteKit
6
- * work limited to mounting a dev-only shadow host from +layout.svelte; the
7
- * actual live UI remains the shared plain-DOM browser chrome.
8
- */
9
-
10
- import crypto from 'node:crypto';
11
- import fs from 'node:fs';
12
- import path from 'node:path';
13
- import { resolveProjectPath, writeProjectFileAtomic } from './frameworks/detect-utils.mjs';
14
- import { buildLiveScriptSrc } from './frameworks/script-src.mjs';
15
-
16
- export const SVELTE_LIVE_ROOT_COMPONENT = 'src/lib/impeccable/ImpeccableLiveRoot.svelte';
17
- export const SVELTE_LAYOUT_MARKER_OPEN = '<!-- impeccable-live-svelte-start -->';
18
- export const SVELTE_LAYOUT_MARKER_CLOSE = '<!-- impeccable-live-svelte-end -->';
19
- export const SVELTE_ROOT_IMPORT = "import ImpeccableLiveRoot from '$lib/impeccable/ImpeccableLiveRoot.svelte';";
20
- // Matches the import at ANY revision (or none). [ \t]* bounds only, never
21
- // \s*: a greedy \s* after the statement swallowed the next line's
22
- // indentation on removal, leaving a formatting scar in user layouts.
23
- const SVELTE_ROOT_IMPORT_LINE_RE = /^[ \t]*import ImpeccableLiveRoot from '\$lib\/impeccable\/ImpeccableLiveRoot\.svelte(?:\?[^']*)?';[ \t]*\r?\n?/gm;
24
-
25
- /**
26
- * The import specifier carries a token-derived revision query. The adapter
27
- * component embeds the helper token, and Vite (client AND SSR) can keep
28
- * serving a stale compiled module after the file is rewritten on a helper
29
- * restart; the browser then requests /live.js with a rotated-out token and
30
- * gets a 401 with no picker. A changed specifier is a different module id,
31
- * which no cache survives.
32
- */
33
- export function svelteRootImportLine(rev) {
34
- if (!rev) return SVELTE_ROOT_IMPORT;
35
- return "import ImpeccableLiveRoot from '$lib/impeccable/ImpeccableLiveRoot.svelte?impeccable-live=" + rev + "';";
36
- }
37
-
38
- export function svelteAdapterRev(token) {
39
- if (!token) return null;
40
- return crypto.createHash('sha256').update(String(token)).digest('hex').slice(0, 8);
41
- }
42
-
43
- export function detectSvelteKitProject(cwd = process.cwd(), config = null) {
44
- const appHtml = findSvelteKitAppHtml(cwd, config);
45
- if (!appHtml) return null;
46
- const hasTemplateMarkers = fileIncludes(path.join(cwd, appHtml), '%sveltekit.body%')
47
- && fileIncludes(path.join(cwd, appHtml), '%sveltekit.head%');
48
- if (!hasTemplateMarkers) return null;
49
-
50
- const hasSvelteConfig = fs.existsSync(path.join(cwd, 'svelte.config.js'))
51
- || fs.existsSync(path.join(cwd, 'svelte.config.mjs'))
52
- || fs.existsSync(path.join(cwd, 'svelte.config.cjs'))
53
- || fs.existsSync(path.join(cwd, 'svelte.config.ts'));
54
- const hasKitPackage = packageHasSvelteKit(cwd);
55
- if (!hasSvelteConfig && !hasKitPackage) return null;
56
-
57
- return {
58
- appHtml,
59
- layoutFile: findSvelteKitLayout(cwd),
60
- rootComponent: SVELTE_LIVE_ROOT_COMPONENT,
61
- };
62
- }
63
-
64
- export function applySvelteKitLiveAdapter({ cwd = process.cwd(), port, token, config = null } = {}) {
65
- if (!Number.isFinite(Number(port))) {
66
- throw new Error('SvelteKit live adapter requires a numeric port');
67
- }
68
- const detected = detectSvelteKitProject(cwd, config);
69
- if (!detected) return null;
70
-
71
- ensureSvelteLiveRootComponent(cwd, Number(port), token);
72
-
73
- const layoutRel = detected.layoutFile;
74
- const layoutAbs = resolveProjectPath(cwd, layoutRel);
75
- const layoutExisted = fs.existsSync(layoutAbs);
76
- const before = layoutExisted ? fs.readFileSync(layoutAbs, 'utf-8') : defaultSvelteLayout();
77
- const after = patchSvelteLayout(before, { rev: svelteAdapterRev(token) });
78
- writeProjectFileAtomic(cwd, layoutRel, after);
79
-
80
- return {
81
- file: layoutRel,
82
- adapter: 'sveltekit',
83
- inserted: after !== before || !layoutExisted,
84
- appHtmlUntouched: true,
85
- rootComponent: SVELTE_LIVE_ROOT_COMPONENT,
86
- };
87
- }
88
-
89
- export function removeSvelteKitLiveAdapter({ cwd = process.cwd(), config = null } = {}) {
90
- const detected = detectSvelteKitProject(cwd, config);
91
- if (!detected) return null;
92
-
93
- const layoutAbs = resolveProjectPath(cwd, detected.layoutFile, { kind: 'file' });
94
- let removed = false;
95
- if (fs.existsSync(layoutAbs)) {
96
- const before = fs.readFileSync(layoutAbs, 'utf-8');
97
- const after = unpatchSvelteLayout(before);
98
- if (after !== before) {
99
- writeProjectFileAtomic(cwd, detected.layoutFile, after);
100
- removed = true;
101
- }
102
- }
103
-
104
- const rootAbs = resolveProjectPath(cwd, SVELTE_LIVE_ROOT_COMPONENT, { kind: 'file' });
105
- if (fs.existsSync(rootAbs) && fs.readFileSync(rootAbs, 'utf-8').includes('impeccable-live-root')) {
106
- fs.rmSync(rootAbs, { force: true });
107
- removed = true;
108
- }
109
-
110
- pruneEmptyDir(path.dirname(rootAbs), resolveProjectPath(cwd, 'src', { kind: 'directory' }));
111
-
112
- return {
113
- file: detected.layoutFile,
114
- adapter: 'sveltekit',
115
- removed,
116
- appHtmlUntouched: true,
117
- rootComponent: SVELTE_LIVE_ROOT_COMPONENT,
118
- };
119
- }
120
-
121
- export function patchSvelteLayout(content, { rev = null } = {}) {
122
- let out = String(content || '');
123
- const importLine = svelteRootImportLine(rev);
124
- if (!out.includes(importLine)) {
125
- // An import at an older revision is replaced in place, keeping its
126
- // indentation; only a layout with no impeccable import gets an insert.
127
- let replaced = false;
128
- out = out.replace(SVELTE_ROOT_IMPORT_LINE_RE, (line) => {
129
- if (replaced) return '';
130
- replaced = true;
131
- const indent = (line.match(/^[ \t]*/) || [''])[0];
132
- return indent + importLine + '\n';
133
- });
134
- if (!replaced) {
135
- const scriptMatch = out.match(/<script(?:\s[^>]*)?>/i);
136
- if (scriptMatch) {
137
- const insertAt = scriptMatch.index + scriptMatch[0].length;
138
- out = out.slice(0, insertAt) + '\n ' + importLine + out.slice(insertAt);
139
- } else {
140
- out = `<script>\n ${importLine}\n</script>\n\n` + out;
141
- }
142
- }
143
- }
144
-
145
- if (!out.includes(SVELTE_LAYOUT_MARKER_OPEN)) {
146
- const block = `${SVELTE_LAYOUT_MARKER_OPEN}\n<ImpeccableLiveRoot />\n${SVELTE_LAYOUT_MARKER_CLOSE}\n`;
147
- const renderMatch = out.match(/\{@render\s+children(?:\?\.)?\(\)\s*\}/);
148
- const slotMatch = out.match(/<slot\s*\/?>/);
149
- const match = renderMatch || slotMatch;
150
- if (match) {
151
- out = out.slice(0, match.index) + block + out.slice(match.index);
152
- } else {
153
- out = out.replace(/\s*$/, '\n\n' + block);
154
- }
155
- }
156
-
157
- return out;
158
- }
159
-
160
- export function unpatchSvelteLayout(content) {
161
- let out = String(content || '');
162
- const blockRe = new RegExp(
163
- '([ \\t]*)' + escapeRegExp(SVELTE_LAYOUT_MARKER_OPEN)
164
- + '\\n<ImpeccableLiveRoot\\s*/>\\n'
165
- + escapeRegExp(SVELTE_LAYOUT_MARKER_CLOSE)
166
- + '\\n?',
167
- 'g',
168
- );
169
- out = out.replace(blockRe, '$1');
170
- out = out.replace(SVELTE_ROOT_IMPORT_LINE_RE, '');
171
- out = out.replace(/<script>\s*<\/script>[ \t]*\r?\n?/g, '');
172
- return out.replace(/\n{3,}/g, '\n\n');
173
- }
174
-
175
- export function ensureSvelteLiveRootComponent(cwd, port, token) {
176
- return writeProjectFileAtomic(cwd, SVELTE_LIVE_ROOT_COMPONENT, buildSvelteLiveRootComponent(port, token));
177
- }
178
-
179
- export function buildSvelteLiveRootComponent(port, token) {
180
- const liveUrl = buildLiveScriptSrc(port, token);
181
- return `<script>
182
- import { onMount } from 'svelte';
183
-
184
- const LIVE_URL = '${liveUrl}';
185
- const HOST_ID = 'impeccable-live-root';
186
-
187
- onMount(() => {
188
- let host = document.querySelector('impeccable-live-root#' + HOST_ID) || document.getElementById(HOST_ID);
189
- if (!host) {
190
- host = document.createElement('impeccable-live-root');
191
- host.id = HOST_ID;
192
- document.body.appendChild(host);
193
- }
194
-
195
- host.dataset.impeccableLiveAdapter = 'sveltekit';
196
- host.style.setProperty('all', 'initial', 'important');
197
- host.style.setProperty('display', 'block', 'important');
198
- host.style.setProperty('position', 'fixed', 'important');
199
- host.style.setProperty('top', '0', 'important');
200
- host.style.setProperty('left', '0', 'important');
201
- host.style.setProperty('width', '0', 'important');
202
- host.style.setProperty('height', '0', 'important');
203
- host.style.setProperty('overflow', 'visible', 'important');
204
- host.style.setProperty('z-index', '2147483000', 'important');
205
- host.style.setProperty('pointer-events', 'none', 'important');
206
-
207
- const root = host.shadowRoot || host.attachShadow({ mode: 'open' });
208
- if (!root.querySelector('style[data-impeccable-live-reset]')) {
209
- const reset = document.createElement('style');
210
- reset.dataset.impeccableLiveReset = 'true';
211
- reset.textContent = ':host, :host *, * { box-sizing: border-box; }';
212
- root.appendChild(reset);
213
- }
214
-
215
- window.__IMPECCABLE_LIVE_ADAPTER__ = 'sveltekit';
216
- window.__IMPECCABLE_LIVE_UI_ROOT__ = root;
217
- window.__IMPECCABLE_LIVE_CHROME_MOUNT__ = {
218
- adapter: 'sveltekit',
219
- version: 1,
220
- host,
221
- root,
222
- };
223
-
224
- const script = document.createElement('script');
225
- script.src = LIVE_URL;
226
- script.async = true;
227
- script.dataset.impeccableLiveScript = 'true';
228
- script.onerror = () => console.error(
229
- '[impeccable] live.js failed to load from ' + LIVE_URL
230
- + ' (helper down, or the token rotated while a stale adapter module was cached).'
231
- + ' Re-run the live boot, then reload this page.'
232
- );
233
- document.head.appendChild(script);
234
-
235
- return () => {
236
- script.remove();
237
- if (window.__IMPECCABLE_LIVE_UI_ROOT__ === root) delete window.__IMPECCABLE_LIVE_UI_ROOT__;
238
- if (window.__IMPECCABLE_LIVE_CHROME_MOUNT__?.root === root) delete window.__IMPECCABLE_LIVE_CHROME_MOUNT__;
239
- if (window.__IMPECCABLE_LIVE_ADAPTER__ === 'sveltekit') delete window.__IMPECCABLE_LIVE_ADAPTER__;
240
- };
241
- });
242
- </script>
243
- `;
244
- }
245
-
246
- function findSvelteKitAppHtml(cwd, config) {
247
- const files = Array.isArray(config?.files) ? config.files : ['src/app.html'];
248
- for (const rel of files) {
249
- if (typeof rel !== 'string' || rel.includes('*')) continue;
250
- const normalized = rel.split(path.sep).join('/');
251
- if (!normalized.endsWith('app.html')) continue;
252
- try {
253
- if (fs.existsSync(resolveProjectPath(cwd, normalized, { kind: 'file' }))) return normalized;
254
- } catch { /* unsafe configured paths are not SvelteKit signals */ }
255
- }
256
- const fallback = 'src/app.html';
257
- return fs.existsSync(path.join(cwd, fallback)) ? fallback : null;
258
- }
259
-
260
- function findSvelteKitLayout(cwd) {
261
- const candidates = [
262
- 'src/routes/+layout.svelte',
263
- 'src/routes/(app)/+layout.svelte',
264
- ];
265
- for (const rel of candidates) {
266
- if (fs.existsSync(path.join(cwd, rel))) return rel;
267
- }
268
- return 'src/routes/+layout.svelte';
269
- }
270
-
271
- function defaultSvelteLayout() {
272
- return `<script>\n let { children } = $props();\n</script>\n\n{@render children?.()}\n`;
273
- }
274
-
275
- function packageHasSvelteKit(cwd) {
276
- const file = path.join(cwd, 'package.json');
277
- if (!fs.existsSync(file)) return false;
278
- try {
279
- const pkg = JSON.parse(fs.readFileSync(file, 'utf-8'));
280
- const deps = {
281
- ...(pkg.dependencies || {}),
282
- ...(pkg.devDependencies || {}),
283
- ...(pkg.peerDependencies || {}),
284
- };
285
- return Boolean(deps['@sveltejs/kit'] || deps['@sveltejs/vite-plugin-svelte'] || deps.svelte);
286
- } catch {
287
- return false;
288
- }
289
- }
290
-
291
- function fileIncludes(file, text) {
292
- try {
293
- return fs.readFileSync(file, 'utf-8').includes(text);
294
- } catch {
295
- return false;
296
- }
297
- }
298
-
299
- function pruneEmptyDir(dir, stopDir) {
300
- let current = dir;
301
- while (current.startsWith(stopDir) && current !== stopDir) {
302
- try {
303
- if (fs.readdirSync(current).length > 0) return;
304
- fs.rmdirSync(current);
305
- current = path.dirname(current);
306
- } catch {
307
- return;
308
- }
309
- }
310
- }
311
-
312
- function escapeRegExp(value) {
313
- return String(value).replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
314
- }
@@ -1,280 +0,0 @@
1
- /**
2
- * TanStack Start live-mode adapter.
3
- *
4
- * TanStack Start is SSR: there is no static index.html to patch. The document
5
- * shell is a React component (`shellComponent`/`component`) defined in the root
6
- * route file, `src/routes/__root.tsx`, which renders `<html>…<body>{children}
7
- * <Scripts /></body></html>`.
8
- *
9
- * A raw `<script src>` placed in that JSX is server-rendered into the streamed
10
- * HTML, but React's script handling and hydration make it an unreliable place
11
- * to load a cross-origin dev bundle. So, like the Nuxt and SvelteKit adapters,
12
- * this keeps the injected code in a dev-only managed component that appends the
13
- * live script on mount (client-only, after hydration). The adapter mounts that
14
- * component from the root document and removes it cleanly on stop.
15
- *
16
- * The managed component lives OUTSIDE `src/routes/` (in `src/impeccable/`) so
17
- * the TanStack Router file-based route generator never treats it as a route.
18
- */
19
-
20
- import fs from 'node:fs';
21
- import path from 'node:path';
22
- import { buildLiveScriptSrc } from './frameworks/script-src.mjs';
23
- import { resolveProjectPath, writeProjectFileAtomic } from './frameworks/detect-utils.mjs';
24
-
25
- export const TANSTACK_MARKER_OPEN = '{/* impeccable-live-tanstack-start */}';
26
- export const TANSTACK_MARKER_CLOSE = '{/* impeccable-live-tanstack-end */}';
27
- export const TANSTACK_COMPONENT_DIR = 'src/impeccable';
28
- export const TANSTACK_COMPONENT_BASENAME = 'ImpeccableLiveRoot';
29
-
30
- const ROOT_ROUTE_CANDIDATES = [
31
- 'src/routes/__root.tsx',
32
- 'src/routes/__root.jsx',
33
- 'src/routes/__root.ts',
34
- 'src/routes/__root.js',
35
- 'app/routes/__root.tsx',
36
- 'app/routes/__root.jsx',
37
- ];
38
-
39
- const START_PACKAGES = [
40
- '@tanstack/react-start',
41
- '@tanstack/solid-start',
42
- '@tanstack/start',
43
- ];
44
-
45
- export function detectTanStackStartProject(cwd = process.cwd()) {
46
- if (!packageHasTanStackStart(cwd)) return null;
47
- const rootRoute = findRootRouteFile(cwd);
48
- if (!rootRoute) return null;
49
-
50
- const ext = path.extname(rootRoute);
51
- const componentExt = ext === '.jsx' || ext === '.js' ? '.jsx' : '.tsx';
52
- const componentFile = `${TANSTACK_COMPONENT_DIR}/${TANSTACK_COMPONENT_BASENAME}${componentExt}`;
53
- const componentImport = relativeImportSpecifier(rootRoute, componentFile);
54
-
55
- return { rootRoute, componentFile, componentImport, ext };
56
- }
57
-
58
- export function applyTanStackLiveAdapter({ cwd = process.cwd(), port, token, project = detectTanStackStartProject(cwd) } = {}) {
59
- if (!project) return { error: 'tanstack_not_detected' };
60
- if (!Number.isFinite(Number(port))) {
61
- throw new Error('TanStack Start live adapter requires a numeric port');
62
- }
63
-
64
- // Write the managed mount component inside the canonical project root.
65
- const componentAbs = resolveProjectPath(cwd, project.componentFile);
66
- const componentBody = buildTanStackLiveRootComponent(Number(port), token);
67
- const componentExisted = fs.existsSync(componentAbs);
68
- if (componentExisted && !isManagedComponent(fs.readFileSync(componentAbs, 'utf-8'))) {
69
- // A non-Impeccable file already sits at our managed path — refuse to clobber.
70
- return {
71
- file: project.componentFile,
72
- error: 'tanstack_component_conflict',
73
- hint: `${project.componentFile} already exists and is not managed by Impeccable Live`,
74
- };
75
- }
76
- writeProjectFileAtomic(cwd, project.componentFile, componentBody);
77
-
78
- // Patch the root document to import + render the mount component.
79
- const rootAbs = resolveProjectPath(cwd, project.rootRoute, { mustExist: true, kind: 'file' });
80
- const before = fs.readFileSync(rootAbs, 'utf-8');
81
- const after = patchTanStackRoot(before, project.componentImport);
82
- const changed = after !== before;
83
- if (changed) writeProjectFileAtomic(cwd, project.rootRoute, after);
84
-
85
- return {
86
- file: project.rootRoute,
87
- adapter: 'tanstack-start',
88
- inserted: changed || !componentExisted,
89
- componentFile: project.componentFile,
90
- devOnly: true,
91
- };
92
- }
93
-
94
- export function removeTanStackLiveAdapter({ cwd = process.cwd(), project = detectTanStackStartProject(cwd) } = {}) {
95
- if (!project) return { error: 'tanstack_not_detected' };
96
- let removed = false;
97
-
98
- const rootAbs = resolveProjectPath(cwd, project.rootRoute, { kind: 'file' });
99
- if (fs.existsSync(rootAbs)) {
100
- const before = fs.readFileSync(rootAbs, 'utf-8');
101
- const after = unpatchTanStackRoot(before);
102
- if (after !== before) {
103
- writeProjectFileAtomic(cwd, project.rootRoute, after);
104
- removed = true;
105
- }
106
- }
107
-
108
- const componentAbs = resolveProjectPath(cwd, project.componentFile, { kind: 'file' });
109
- if (fs.existsSync(componentAbs) && isManagedComponent(fs.readFileSync(componentAbs, 'utf-8'))) {
110
- fs.rmSync(componentAbs, { force: true });
111
- removed = true;
112
- }
113
- pruneEmptyDir(path.dirname(componentAbs), resolveProjectPath(cwd, 'src', { kind: 'directory' }));
114
-
115
- return {
116
- file: project.rootRoute,
117
- adapter: 'tanstack-start',
118
- removed,
119
- componentFile: project.componentFile,
120
- };
121
- }
122
-
123
- export function patchTanStackRoot(content, componentImport) {
124
- let out = String(content || '');
125
- const importStatement = `import ImpeccableLiveRoot from '${componentImport}';`;
126
-
127
- if (!out.includes(importStatement)) {
128
- out = insertAfterLastImport(out, importStatement);
129
- }
130
-
131
- if (!out.includes(TANSTACK_MARKER_OPEN)) {
132
- const block =
133
- `${TANSTACK_MARKER_OPEN}\n`
134
- + ` <ImpeccableLiveRoot />\n`
135
- + ` ${TANSTACK_MARKER_CLOSE}\n `;
136
- // Anchor before <Scripts …/> (the stable TanStack Start document marker);
137
- // fall back to before </body>.
138
- const scriptsMatch = out.match(/<Scripts\b/);
139
- if (scriptsMatch) {
140
- out = out.slice(0, scriptsMatch.index) + block + out.slice(scriptsMatch.index);
141
- } else {
142
- const bodyClose = out.lastIndexOf('</body>');
143
- if (bodyClose !== -1) {
144
- out = out.slice(0, bodyClose) + block + out.slice(bodyClose);
145
- }
146
- }
147
- }
148
-
149
- return out;
150
- }
151
-
152
- export function unpatchTanStackRoot(content) {
153
- let out = String(content || '');
154
- // Remove exactly the inserted block (open marker → component → close marker →
155
- // trailing newline + the indent that leads back to the anchor). Leaving the
156
- // leading indent before the open marker intact hands it back to the anchor
157
- // (e.g. `<Scripts />`) so the file round-trips byte-for-byte.
158
- const blockRe = new RegExp(
159
- escapeRegExp(TANSTACK_MARKER_OPEN)
160
- + '\\s*<ImpeccableLiveRoot\\s*/>\\s*'
161
- + escapeRegExp(TANSTACK_MARKER_CLOSE)
162
- + '\\r?\\n?[ \\t]*',
163
- 'g',
164
- );
165
- out = out.replace(blockRe, '');
166
- // Remove only the managed import line — not any following blank line.
167
- out = out.replace(
168
- new RegExp("^import ImpeccableLiveRoot from '[^']*';[ \\t]*\\r?\\n", 'gm'),
169
- '',
170
- );
171
- return out;
172
- }
173
-
174
- export function buildTanStackLiveRootComponent(port, token) {
175
- const liveSrc = buildLiveScriptSrc(Number(port), token);
176
- return `/* impeccable-live-tanstack-start */
177
- import { useEffect } from 'react';
178
-
179
- const LIVE_SRC = '${liveSrc}';
180
- const LIVE_SELECTOR = 'script[data-impeccable-live-tanstack]';
181
-
182
- // Dev-only mount for Impeccable Live. TanStack Start server-renders the root
183
- // document, so this appends the live-mode bundle from the client after
184
- // hydration (mirrors the Nuxt/SvelteKit adapters). Renders nothing on the
185
- // server, so there is no hydration mismatch.
186
- export default function ImpeccableLiveRoot() {
187
- useEffect(() => {
188
- if (typeof document === 'undefined') return;
189
- const expected = new URL(LIVE_SRC, window.location.href).href;
190
- let script = document.querySelector(LIVE_SELECTOR);
191
- if (script && script.src === expected) return;
192
- if (script) script.remove();
193
-
194
- script = document.createElement('script');
195
- script.src = LIVE_SRC;
196
- script.async = true;
197
- script.setAttribute('data-impeccable-live-tanstack', '');
198
- script.setAttribute('data-impeccable-live-script', 'true');
199
- document.head.appendChild(script);
200
-
201
- return () => {
202
- if (script && script.isConnected) script.remove();
203
- };
204
- }, []);
205
-
206
- return null;
207
- }
208
- `;
209
- }
210
-
211
- // ---------------------------------------------------------------------------
212
- // helpers
213
- // ---------------------------------------------------------------------------
214
-
215
- // The managed mount component carries the `impeccable-live-tanstack` marker in
216
- // its leading comment and its script data-attribute; user files never do.
217
- function isManagedComponent(content) {
218
- return String(content || '').includes('impeccable-live-tanstack');
219
- }
220
-
221
- function findRootRouteFile(cwd) {
222
- for (const rel of ROOT_ROUTE_CANDIDATES) {
223
- if (fs.existsSync(path.join(cwd, rel))) return rel;
224
- }
225
- return null;
226
- }
227
-
228
- function packageHasTanStackStart(cwd) {
229
- const file = path.join(cwd, 'package.json');
230
- if (!fs.existsSync(file)) return false;
231
- try {
232
- const pkg = JSON.parse(fs.readFileSync(file, 'utf-8'));
233
- const deps = {
234
- ...(pkg.dependencies || {}),
235
- ...(pkg.devDependencies || {}),
236
- ...(pkg.peerDependencies || {}),
237
- };
238
- return START_PACKAGES.some((name) => Boolean(deps[name]));
239
- } catch {
240
- return false;
241
- }
242
- }
243
-
244
- function relativeImportSpecifier(fromFile, toFile) {
245
- const rel = path.posix.relative(
246
- path.posix.dirname(fromFile.split(path.sep).join('/')),
247
- toFile.split(path.sep).join('/'),
248
- ).replace(/\.(tsx|ts|jsx|js)$/, '');
249
- return rel.startsWith('.') ? rel : `./${rel}`;
250
- }
251
-
252
- function insertAfterLastImport(content, importStatement) {
253
- const importRe = /^import\b[^\n]*\n/gm;
254
- let lastEnd = -1;
255
- let m;
256
- while ((m = importRe.exec(content)) !== null) {
257
- lastEnd = m.index + m[0].length;
258
- }
259
- if (lastEnd === -1) {
260
- return `${importStatement}\n${content}`;
261
- }
262
- return content.slice(0, lastEnd) + importStatement + '\n' + content.slice(lastEnd);
263
- }
264
-
265
- function pruneEmptyDir(dir, stopDir) {
266
- let current = dir;
267
- while (current.startsWith(stopDir) && current !== stopDir) {
268
- try {
269
- if (fs.readdirSync(current).length > 0) return;
270
- fs.rmdirSync(current);
271
- current = path.dirname(current);
272
- } catch {
273
- return;
274
- }
275
- }
276
- }
277
-
278
- function escapeRegExp(value) {
279
- return String(value).replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
280
- }
@@ -1,75 +0,0 @@
1
- /**
2
- * Canonical inventory of the Live overlay's UI surfaces: one entry per piece of
3
- * chrome Live mounts on the user's page, with the element ids that make it up.
4
- *
5
- * Single source of truth, consumed by:
6
- * - skill/scripts/live/browser-script-parts.mjs — serializes this into
7
- * window.__IMPECCABLE_LIVE_UI_SURFACES__ in the /live.js prelude.
8
- * - skill/scripts/live-browser.js — publishes it on
9
- * window.__IMPECCABLE_LIVE_CHROME_CORE__ for adapters and E2E probes. That
10
- * file is served raw and injected as a classic <script>, so it cannot
11
- * import this module at runtime; it reads the injected global instead, the
12
- * same path live/vocabulary.mjs already takes for the command palette.
13
- * - the private impeccable-site repo — site/components/LiveUiGallery.astro
14
- * and tests/live-ui-lab.test.mjs import LIVE_UI_SURFACES at build time and
15
- * fail the site build when the Live UI lab has no snapshot for a surface
16
- * defined here. That guard only guards if it reads this list rather than a
17
- * copy the site keeps, so this module must stay importable from Node.
18
- * Renaming a key or the module is a breaking change for that build; the
19
- * list was briefly inlined into live-browser.js and the site had to parse
20
- * it back out with a regex.
21
- *
22
- * Add a surface here and both the browser bundle and the site lab follow.
23
- */
24
-
25
- /** Id prefix every Live chrome element carries. Mirrored by PREFIX in live-browser.js. */
26
- export const LIVE_UI_PREFIX = 'impeccable-live';
27
-
28
- const id = (suffix) => `${LIVE_UI_PREFIX}-${suffix}`;
29
-
30
- /**
31
- * The mount contract every Live chrome adapter (DOM, Svelte, ...) satisfies.
32
- * Published alongside the surfaces on __IMPECCABLE_LIVE_CHROME_CORE__.
33
- */
34
- export const LIVE_CHROME_MOUNT_CONTRACT = Object.freeze(['root', 'transport', 'state', 'actions']);
35
-
36
- export const LIVE_UI_SURFACES = Object.freeze([
37
- {
38
- key: 'global-bottom-bar',
39
- ids: [
40
- id('global-bar'), id('global-bar-brand'), id('pick-toggle'), id('insert-toggle'),
41
- id('detect-toggle'), id('detect-badge'), id('design-toggle'), id('page-chat'),
42
- id('page-chat-input'), id('page-chat-voice'), id('page-chat-send'),
43
- ],
44
- },
45
- { key: 'pending-copy-edit-dock', ids: [id('pending-dock')] },
46
- {
47
- key: 'element-selection-chrome',
48
- ids: [
49
- id('highlight'), id('tooltip'), id('bar'), id('selection-pill'), id('input'),
50
- id('configure-voice'), id('configure-bar-tooltip'),
51
- ],
52
- },
53
- { key: 'action-picker', ids: [id('picker')] },
54
- { key: 'edit-chrome', ids: [id('edit-badge')] },
55
- { key: 'generating-row', ids: [id('bar'), id('shader')] },
56
- { key: 'variant-cycling-row', ids: [id('bar'), id('params-panel')] },
57
- { key: 'variant-params-panel', ids: [id('params-panel')] },
58
- { key: 'saving-confirmed-rows', ids: [id('bar')] },
59
- {
60
- key: 'insert-mode-chrome',
61
- ids: [
62
- id('insert-line'), id('insert-placeholder'), id('placeholder-resize'), id('insert-input'),
63
- id('insert-voice'), id('insert-create'), id('insert-create-tooltip'),
64
- ],
65
- },
66
- { key: 'annotation-chrome', ids: [id('annot'), id('annot-svg'), id('annot-pins'), id('annot-clear')] },
67
- { key: 'design-system-panel', ids: [id('design-host')] },
68
- { key: 'toasts-and-errors', ids: [id('toast'), id('mount-error')] },
69
- { key: 'css-isolation-boundary', ids: [id('root')] },
70
- ].map((surface) => Object.freeze({ ...surface, ids: Object.freeze(surface.ids) })));
71
-
72
- /** Every id any surface owns, de-duplicated, in surface order. */
73
- export const LIVE_UI_COMPONENT_IDS = Object.freeze([
74
- ...new Set(LIVE_UI_SURFACES.flatMap((surface) => surface.ids)),
75
- ]);