howone 0.1.28 → 0.1.30

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 (224) hide show
  1. package/package.json +1 -1
  2. package/templates/vite/.howone/skills/hallmark/SKILL.md +48 -42
  3. package/templates/vite/.howone/skills/hallmark/references/anti-patterns.md +12 -6
  4. package/templates/vite/.howone/skills/hallmark/references/assets.md +7 -0
  5. package/templates/vite/.howone/skills/hallmark/references/component-cookbook.md +19 -10
  6. package/templates/vite/.howone/skills/hallmark/references/components/f2-sticky-scroll-stack.md +1 -1
  7. package/templates/vite/.howone/skills/hallmark/references/components/ft6-letter-close.md +1 -1
  8. package/templates/vite/.howone/skills/hallmark/references/components/h7-demo-video-clipped-by-viewport-edge.md +1 -1
  9. package/templates/vite/.howone/skills/hallmark/references/components/h9-custom-illustration-centerpiece.md +1 -1
  10. package/templates/vite/.howone/skills/hallmark/references/components/n10-floating-on-scroll-morph.md +1 -1
  11. package/templates/vite/.howone/skills/hallmark/references/components/n11-mega-menu.md +40 -0
  12. package/templates/vite/.howone/skills/hallmark/references/components/n12-banner-retract.md +34 -0
  13. package/templates/vite/.howone/skills/hallmark/references/components/n13-inline-cmdk-pill.md +39 -0
  14. package/templates/vite/.howone/skills/hallmark/references/components/n1b-saas-three-section.md +35 -0
  15. package/templates/vite/.howone/skills/hallmark/references/components/n9-edge-aligned-minimal.md +1 -1
  16. package/templates/vite/.howone/skills/hallmark/references/components/s3-sticky-pinned.md +2 -2
  17. package/templates/vite/.howone/skills/hallmark/references/copy.md +8 -8
  18. package/templates/vite/.howone/skills/hallmark/references/custom-craft.md +2 -2
  19. package/templates/vite/.howone/skills/hallmark/references/custom-theme.md +50 -12
  20. package/templates/vite/.howone/skills/hallmark/references/export-formats.md +1 -1
  21. package/templates/vite/.howone/skills/hallmark/references/genres/atmospheric.md +11 -7
  22. package/templates/vite/.howone/skills/hallmark/references/genres/editorial.md +6 -4
  23. package/templates/vite/.howone/skills/hallmark/references/genres/modern-minimal.md +10 -6
  24. package/templates/vite/.howone/skills/hallmark/references/genres/playful.md +15 -10
  25. package/templates/vite/.howone/skills/hallmark/references/hero-enrichment.md +13 -12
  26. package/templates/vite/.howone/skills/hallmark/references/interaction-and-states.md +2 -1
  27. package/templates/vite/.howone/skills/hallmark/references/layout-and-space.md +4 -3
  28. package/templates/vite/.howone/skills/hallmark/references/macrostructures/04-stat-led.md +3 -1
  29. package/templates/vite/.howone/skills/hallmark/references/macrostructures/12-letter.md +1 -1
  30. package/templates/vite/.howone/skills/hallmark/references/macrostructures.md +1 -1
  31. package/templates/vite/.howone/skills/hallmark/references/microinteractions.md +1 -3
  32. package/templates/vite/.howone/skills/hallmark/references/preview-examples.md +12 -12
  33. package/templates/vite/.howone/skills/hallmark/references/responsive.md +8 -8
  34. package/templates/vite/.howone/skills/hallmark/references/slop-test.md +72 -85
  35. package/templates/vite/.howone/skills/hallmark/references/structure.md +9 -13
  36. package/templates/vite/.howone/skills/hallmark/references/study.md +40 -17
  37. package/templates/vite/.howone/skills/hallmark/references/themes/carnival.md +301 -0
  38. package/templates/vite/.howone/skills/hallmark/references/themes/cobalt.md +146 -0
  39. package/templates/vite/.howone/skills/hallmark/references/themes/hum.md +403 -0
  40. package/templates/vite/.howone/skills/hallmark/references/themes/lumen.md +478 -0
  41. package/templates/vite/.howone/skills/hallmark/references/typography.md +3 -3
  42. package/templates/vite/.howone/skills/hallmark/references/verbs/redesign.md +1 -1
  43. package/templates/vite/.howone/skills/howone/03-sdk/07-ai-action-calls.md +28 -86
  44. package/templates/vite/.howone/skills/howone/03-sdk/09-workflow-execute-sse.md +105 -0
  45. package/templates/vite/.howone/skills/howone/04-ai/03-ai-sdk-handoff.md +15 -13
  46. package/templates/vite/.howone/skills/howone/SKILL.md +2 -2
  47. package/templates/vite/package.json +1 -1
  48. package/templates/vite/.howone/skills/hallmark/LICENSE +0 -21
  49. package/templates/vite/.howone/skills/hallmark/README.md +0 -147
  50. package/templates/vite/.howone/skills/hallmark/ROADMAP.md +0 -201
  51. package/templates/vite/.howone/skills/hallmark/docs/recipes.md +0 -186
  52. package/templates/vite/.howone/skills/hallmark/docs/screenshots/hero-anya.jpg +0 -0
  53. package/templates/vite/.howone/skills/hallmark/docs/screenshots/hero-bananastudio.jpg +0 -0
  54. package/templates/vite/.howone/skills/hallmark/docs/screenshots/hero-hyperlane.jpg +0 -0
  55. package/templates/vite/.howone/skills/hallmark/docs/screenshots/hero-najm.jpg +0 -0
  56. package/templates/vite/.howone/skills/hallmark/docs/screenshots/hero-slow-pour.jpg +0 -0
  57. package/templates/vite/.howone/skills/hallmark/docs/screenshots/hero-soroe.jpg +0 -0
  58. package/templates/vite/.howone/skills/hallmark/docs/screenshots/hero-tally.jpg +0 -0
  59. package/templates/vite/.howone/skills/hallmark/docs/screenshots/hero-wayfare.jpg +0 -0
  60. package/templates/vite/.howone/skills/hallmark/docs/study-examples.md +0 -176
  61. package/templates/vite/.howone/skills/hallmark/docs/talk-slides.md +0 -364
  62. package/templates/vite/.howone/skills/hallmark/package.json +0 -36
  63. package/templates/vite/.howone/skills/hallmark/site/OG-hallmark.png +0 -0
  64. package/templates/vite/.howone/skills/hallmark/site/_tests/01-tide-podcast/brief.md +0 -71
  65. package/templates/vite/.howone/skills/hallmark/site/_tests/01-tide-podcast/index.html +0 -64
  66. package/templates/vite/.howone/skills/hallmark/site/_tests/01-tide-podcast/style.css +0 -240
  67. package/templates/vite/.howone/skills/hallmark/site/_tests/02-streampipe-cli/brief.md +0 -65
  68. package/templates/vite/.howone/skills/hallmark/site/_tests/02-streampipe-cli/index.html +0 -105
  69. package/templates/vite/.howone/skills/hallmark/site/_tests/02-streampipe-cli/style.css +0 -250
  70. package/templates/vite/.howone/skills/hallmark/site/_tests/03-maple-bakery/brief.md +0 -64
  71. package/templates/vite/.howone/skills/hallmark/site/_tests/03-maple-bakery/index.html +0 -131
  72. package/templates/vite/.howone/skills/hallmark/site/_tests/03-maple-bakery/style.css +0 -240
  73. package/templates/vite/.howone/skills/hallmark/site/_tests/04-meridian-manifesto/brief.md +0 -67
  74. package/templates/vite/.howone/skills/hallmark/site/_tests/04-meridian-manifesto/index.html +0 -86
  75. package/templates/vite/.howone/skills/hallmark/site/_tests/04-meridian-manifesto/style.css +0 -262
  76. package/templates/vite/.howone/skills/hallmark/site/_tests/05-tracejam-saas/brief.md +0 -63
  77. package/templates/vite/.howone/skills/hallmark/site/_tests/05-tracejam-saas/index.html +0 -167
  78. package/templates/vite/.howone/skills/hallmark/site/_tests/05-tracejam-saas/style.css +0 -457
  79. package/templates/vite/.howone/skills/hallmark/site/_tests/06-anya-portfolio/brief.md +0 -65
  80. package/templates/vite/.howone/skills/hallmark/site/_tests/06-anya-portfolio/index.html +0 -159
  81. package/templates/vite/.howone/skills/hallmark/site/_tests/06-anya-portfolio/style.css +0 -288
  82. package/templates/vite/.howone/skills/hallmark/site/_tests/07-foundry-compliance/brief.md +0 -64
  83. package/templates/vite/.howone/skills/hallmark/site/_tests/07-foundry-compliance/index.html +0 -146
  84. package/templates/vite/.howone/skills/hallmark/site/_tests/07-foundry-compliance/style.css +0 -484
  85. package/templates/vite/.howone/skills/hallmark/site/_tests/08-cohort-courses/brief.md +0 -64
  86. package/templates/vite/.howone/skills/hallmark/site/_tests/08-cohort-courses/index.html +0 -116
  87. package/templates/vite/.howone/skills/hallmark/site/_tests/08-cohort-courses/style.css +0 -354
  88. package/templates/vite/.howone/skills/hallmark/site/_tests/09-slow-pour/index.html +0 -638
  89. package/templates/vite/.howone/skills/hallmark/site/_tests/10-owl-hours/index.html +0 -515
  90. package/templates/vite/.howone/skills/hallmark/site/_tests/11-soroe-ceramics/index.html +0 -515
  91. package/templates/vite/.howone/skills/hallmark/site/_tests/12-loafer/index.html +0 -608
  92. package/templates/vite/.howone/skills/hallmark/site/_tests/13-alma/index.html +0 -587
  93. package/templates/vite/.howone/skills/hallmark/site/_tests/README.md +0 -157
  94. package/templates/vite/.howone/skills/hallmark/site/_tests/_thumbs/BananaStudio-loop.mp4 +0 -0
  95. package/templates/vite/.howone/skills/hallmark/site/_tests/_thumbs/BananaStudio-still.jpg +0 -0
  96. package/templates/vite/.howone/skills/hallmark/site/_tests/_thumbs/Hyperlane-example.mp4 +0 -0
  97. package/templates/vite/.howone/skills/hallmark/site/_tests/_thumbs/Hyperlane-still.jpg +0 -0
  98. package/templates/vite/.howone/skills/hallmark/site/_tests/_thumbs/Najm-loop.mp4 +0 -0
  99. package/templates/vite/.howone/skills/hallmark/site/_tests/_thumbs/Najm-still.jpg +0 -0
  100. package/templates/vite/.howone/skills/hallmark/site/_tests/_thumbs/Podcast-loop.mp4 +0 -0
  101. package/templates/vite/.howone/skills/hallmark/site/_tests/_thumbs/SaaS-loop.mp4 +0 -0
  102. package/templates/vite/.howone/skills/hallmark/site/_tests/_thumbs/SaaS-still.jpg +0 -0
  103. package/templates/vite/.howone/skills/hallmark/site/_tests/_thumbs/Soroe-loop.mp4 +0 -0
  104. package/templates/vite/.howone/skills/hallmark/site/_tests/_thumbs/Soroe-still.jpg +0 -0
  105. package/templates/vite/.howone/skills/hallmark/site/_tests/_thumbs/after-quiet-hour.png +0 -0
  106. package/templates/vite/.howone/skills/hallmark/site/_tests/_thumbs/anya-loop.mp4 +0 -0
  107. package/templates/vite/.howone/skills/hallmark/site/_tests/_thumbs/anya-still.jpg +0 -0
  108. package/templates/vite/.howone/skills/hallmark/site/_tests/_thumbs/audit-example.png +0 -0
  109. package/templates/vite/.howone/skills/hallmark/site/_tests/_thumbs/before-quiet-hour.png +0 -0
  110. package/templates/vite/.howone/skills/hallmark/site/_tests/_thumbs/example-redesign-uractivation.png +0 -0
  111. package/templates/vite/.howone/skills/hallmark/site/_tests/_thumbs/slow-pour-loop.mp4 +0 -0
  112. package/templates/vite/.howone/skills/hallmark/site/_tests/_thumbs/slow-pour-still.jpg +0 -0
  113. package/templates/vite/.howone/skills/hallmark/site/_tests/_thumbs/study-example.png +0 -0
  114. package/templates/vite/.howone/skills/hallmark/site/_tests/_thumbs/uractivation-after-loop.mp4 +0 -0
  115. package/templates/vite/.howone/skills/hallmark/site/_tests/_thumbs/wayfare-loop.mp4 +0 -0
  116. package/templates/vite/.howone/skills/hallmark/site/_tests/_thumbs/wayfare-still.jpg +0 -0
  117. package/templates/vite/.howone/skills/hallmark/site/_tests/custom/01-coffeebox/index.html +0 -77
  118. package/templates/vite/.howone/skills/hallmark/site/_tests/custom/01-coffeebox/style.css +0 -238
  119. package/templates/vite/.howone/skills/hallmark/site/_tests/custom/02-loop/index.html +0 -110
  120. package/templates/vite/.howone/skills/hallmark/site/_tests/custom/02-loop/style.css +0 -326
  121. package/templates/vite/.howone/skills/hallmark/site/_tests/custom/03-mossroot/index.html +0 -134
  122. package/templates/vite/.howone/skills/hallmark/site/_tests/custom/03-mossroot/style.css +0 -262
  123. package/templates/vite/.howone/skills/hallmark/site/_tests/custom/README.md +0 -30
  124. package/templates/vite/.howone/skills/hallmark/site/_tests/verbs/README.md +0 -17
  125. package/templates/vite/.howone/skills/hallmark/site/_tests/verbs/audit/audit-report.md +0 -56
  126. package/templates/vite/.howone/skills/hallmark/site/_tests/verbs/audit/input.html +0 -160
  127. package/templates/vite/.howone/skills/hallmark/site/_tests/verbs/audit/notes.md +0 -29
  128. package/templates/vite/.howone/skills/hallmark/site/_tests/verbs/redesign/input.html +0 -63
  129. package/templates/vite/.howone/skills/hallmark/site/_tests/verbs/redesign/notes.md +0 -72
  130. package/templates/vite/.howone/skills/hallmark/site/_tests/verbs/redesign/output.html +0 -374
  131. package/templates/vite/.howone/skills/hallmark/site/_tests/verbs/study/diagnosis.md +0 -52
  132. package/templates/vite/.howone/skills/hallmark/site/_tests/verbs/study/input-description.md +0 -29
  133. package/templates/vite/.howone/skills/hallmark/site/_tests/verbs/study/notes.md +0 -61
  134. package/templates/vite/.howone/skills/hallmark/site/_tests/verbs/study/output.css +0 -193
  135. package/templates/vite/.howone/skills/hallmark/site/_tests/verbs/study/output.html +0 -66
  136. package/templates/vite/.howone/skills/hallmark/site/css/base.css +0 -194
  137. package/templates/vite/.howone/skills/hallmark/site/css/components.css +0 -4886
  138. package/templates/vite/.howone/skills/hallmark/site/css/sections.css +0 -2072
  139. package/templates/vite/.howone/skills/hallmark/site/css/tokens.css +0 -1129
  140. package/templates/vite/.howone/skills/hallmark/site/examples/bananastudio/index.html +0 -475
  141. package/templates/vite/.howone/skills/hallmark/site/examples/bananastudio/styles.css +0 -1584
  142. package/templates/vite/.howone/skills/hallmark/site/examples/bananastudio/tokens.css +0 -96
  143. package/templates/vite/.howone/skills/hallmark/site/examples/hyperlane/index.html +0 -344
  144. package/templates/vite/.howone/skills/hallmark/site/examples/hyperlane/script.js +0 -103
  145. package/templates/vite/.howone/skills/hallmark/site/examples/hyperlane/styles.css +0 -1103
  146. package/templates/vite/.howone/skills/hallmark/site/examples/hyperlane/tokens.css +0 -83
  147. package/templates/vite/.howone/skills/hallmark/site/examples/najm/index.html +0 -368
  148. package/templates/vite/.howone/skills/hallmark/site/examples/najm/script.js +0 -133
  149. package/templates/vite/.howone/skills/hallmark/site/examples/najm/styles.css +0 -1062
  150. package/templates/vite/.howone/skills/hallmark/site/examples/najm/tokens.css +0 -97
  151. package/templates/vite/.howone/skills/hallmark/site/examples/tally/app.js +0 -84
  152. package/templates/vite/.howone/skills/hallmark/site/examples/tally/index.html +0 -446
  153. package/templates/vite/.howone/skills/hallmark/site/examples/tally/styles.css +0 -1087
  154. package/templates/vite/.howone/skills/hallmark/site/examples/tally/tokens.css +0 -101
  155. package/templates/vite/.howone/skills/hallmark/site/examples/wayfare/index.html +0 -359
  156. package/templates/vite/.howone/skills/hallmark/site/examples/wayfare/style.css +0 -1168
  157. package/templates/vite/.howone/skills/hallmark/site/examples/wayfare/tokens.css +0 -81
  158. package/templates/vite/.howone/skills/hallmark/site/favicon-dark.svg +0 -5
  159. package/templates/vite/.howone/skills/hallmark/site/favicon-light.svg +0 -5
  160. package/templates/vite/.howone/skills/hallmark/site/index.html +0 -1043
  161. package/templates/vite/.howone/skills/hallmark/site/js/main.js +0 -1175
  162. package/templates/vite/.howone/skills/hallmark/vercel.json +0 -6
  163. package/templates/vite/.howone/skills/impeccable/SKILL.md +0 -168
  164. package/templates/vite/.howone/skills/impeccable/agents/impeccable-asset-producer.md +0 -101
  165. package/templates/vite/.howone/skills/impeccable/reference/adapt.md +0 -190
  166. package/templates/vite/.howone/skills/impeccable/reference/animate.md +0 -175
  167. package/templates/vite/.howone/skills/impeccable/reference/audit.md +0 -133
  168. package/templates/vite/.howone/skills/impeccable/reference/bolder.md +0 -113
  169. package/templates/vite/.howone/skills/impeccable/reference/brand.md +0 -118
  170. package/templates/vite/.howone/skills/impeccable/reference/clarify.md +0 -174
  171. package/templates/vite/.howone/skills/impeccable/reference/codex.md +0 -105
  172. package/templates/vite/.howone/skills/impeccable/reference/cognitive-load.md +0 -106
  173. package/templates/vite/.howone/skills/impeccable/reference/color-and-contrast.md +0 -105
  174. package/templates/vite/.howone/skills/impeccable/reference/colorize.md +0 -154
  175. package/templates/vite/.howone/skills/impeccable/reference/craft.md +0 -123
  176. package/templates/vite/.howone/skills/impeccable/reference/critique.md +0 -273
  177. package/templates/vite/.howone/skills/impeccable/reference/delight.md +0 -302
  178. package/templates/vite/.howone/skills/impeccable/reference/distill.md +0 -111
  179. package/templates/vite/.howone/skills/impeccable/reference/document.md +0 -427
  180. package/templates/vite/.howone/skills/impeccable/reference/extract.md +0 -69
  181. package/templates/vite/.howone/skills/impeccable/reference/harden.md +0 -347
  182. package/templates/vite/.howone/skills/impeccable/reference/heuristics-scoring.md +0 -234
  183. package/templates/vite/.howone/skills/impeccable/reference/interaction-design.md +0 -195
  184. package/templates/vite/.howone/skills/impeccable/reference/layout.md +0 -141
  185. package/templates/vite/.howone/skills/impeccable/reference/live.md +0 -622
  186. package/templates/vite/.howone/skills/impeccable/reference/motion-design.md +0 -109
  187. package/templates/vite/.howone/skills/impeccable/reference/onboard.md +0 -234
  188. package/templates/vite/.howone/skills/impeccable/reference/optimize.md +0 -258
  189. package/templates/vite/.howone/skills/impeccable/reference/overdrive.md +0 -130
  190. package/templates/vite/.howone/skills/impeccable/reference/personas.md +0 -179
  191. package/templates/vite/.howone/skills/impeccable/reference/polish.md +0 -242
  192. package/templates/vite/.howone/skills/impeccable/reference/product.md +0 -62
  193. package/templates/vite/.howone/skills/impeccable/reference/quieter.md +0 -99
  194. package/templates/vite/.howone/skills/impeccable/reference/responsive-design.md +0 -114
  195. package/templates/vite/.howone/skills/impeccable/reference/shape.md +0 -165
  196. package/templates/vite/.howone/skills/impeccable/reference/spatial-design.md +0 -100
  197. package/templates/vite/.howone/skills/impeccable/reference/teach.md +0 -156
  198. package/templates/vite/.howone/skills/impeccable/reference/typeset.md +0 -124
  199. package/templates/vite/.howone/skills/impeccable/reference/typography.md +0 -159
  200. package/templates/vite/.howone/skills/impeccable/reference/ux-writing.md +0 -107
  201. package/templates/vite/.howone/skills/impeccable/scripts/cleanup-deprecated.mjs +0 -284
  202. package/templates/vite/.howone/skills/impeccable/scripts/command-metadata.json +0 -94
  203. package/templates/vite/.howone/skills/impeccable/scripts/critique-storage.mjs +0 -242
  204. package/templates/vite/.howone/skills/impeccable/scripts/design-parser.mjs +0 -820
  205. package/templates/vite/.howone/skills/impeccable/scripts/detect-csp.mjs +0 -198
  206. package/templates/vite/.howone/skills/impeccable/scripts/detect.mjs +0 -21
  207. package/templates/vite/.howone/skills/impeccable/scripts/impeccable-paths.mjs +0 -110
  208. package/templates/vite/.howone/skills/impeccable/scripts/is-generated.mjs +0 -69
  209. package/templates/vite/.howone/skills/impeccable/scripts/live-accept.mjs +0 -595
  210. package/templates/vite/.howone/skills/impeccable/scripts/live-browser-session.js +0 -123
  211. package/templates/vite/.howone/skills/impeccable/scripts/live-browser.js +0 -4860
  212. package/templates/vite/.howone/skills/impeccable/scripts/live-complete.mjs +0 -75
  213. package/templates/vite/.howone/skills/impeccable/scripts/live-completion.mjs +0 -18
  214. package/templates/vite/.howone/skills/impeccable/scripts/live-inject.mjs +0 -446
  215. package/templates/vite/.howone/skills/impeccable/scripts/live-poll.mjs +0 -200
  216. package/templates/vite/.howone/skills/impeccable/scripts/live-resume.mjs +0 -48
  217. package/templates/vite/.howone/skills/impeccable/scripts/live-server.mjs +0 -838
  218. package/templates/vite/.howone/skills/impeccable/scripts/live-session-store.mjs +0 -254
  219. package/templates/vite/.howone/skills/impeccable/scripts/live-status.mjs +0 -47
  220. package/templates/vite/.howone/skills/impeccable/scripts/live-wrap.mjs +0 -632
  221. package/templates/vite/.howone/skills/impeccable/scripts/live.mjs +0 -247
  222. package/templates/vite/.howone/skills/impeccable/scripts/load-context.mjs +0 -141
  223. package/templates/vite/.howone/skills/impeccable/scripts/modern-screenshot.umd.js +0 -14
  224. package/templates/vite/.howone/skills/impeccable/scripts/pin.mjs +0 -214
@@ -1,75 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * Canonical durable completion acknowledgement for Impeccable live sessions.
4
- */
5
-
6
- import { createLiveSessionStore } from './live-session-store.mjs';
7
- import { readLiveServerInfo } from './impeccable-paths.mjs';
8
-
9
- function parseArgs(argv) {
10
- const out = { status: 'complete' };
11
- for (let i = 0; i < argv.length; i++) {
12
- const arg = argv[i];
13
- if (arg === '--id') out.id = argv[++i];
14
- else if (arg.startsWith('--id=')) out.id = arg.slice('--id='.length);
15
- else if (arg === '--discarded' || arg === '--discard') out.status = 'discarded';
16
- else if (arg === '--error') { out.status = 'agent_error'; out.message = argv[++i] || 'unknown error'; }
17
- else if (arg.startsWith('--error=')) { out.status = 'agent_error'; out.message = arg.slice('--error='.length); }
18
- else if (arg === '--help' || arg === '-h') out.help = true;
19
- }
20
- return out;
21
- }
22
-
23
- export async function completeCli() {
24
- const args = parseArgs(process.argv.slice(2));
25
- if (args.help || !args.id) {
26
- console.log(`Usage: node live-complete.mjs --id SESSION_ID [--discarded|--error MESSAGE]\n\nAppend the final durable session acknowledgement. Use after accept/discard cleanup is verified.`);
27
- process.exit(args.help ? 0 : 1);
28
- }
29
-
30
- const serverInfo = readServerInfo();
31
- const serverResult = serverInfo ? await completeThroughServer(serverInfo, args) : null;
32
- if (serverResult?.ok) {
33
- const store = createLiveSessionStore({ cwd: process.cwd(), sessionId: args.id });
34
- const snapshot = store.getSnapshot(args.id, { includeCompleted: true });
35
- console.log(JSON.stringify({ ok: true, id: args.id, phase: snapshot?.phase || args.status, snapshot }, null, 2));
36
- return;
37
- }
38
-
39
- const store = createLiveSessionStore({ cwd: process.cwd(), sessionId: args.id });
40
- const event = args.status === 'discarded'
41
- ? { type: 'discarded', id: args.id }
42
- : args.status === 'agent_error'
43
- ? { type: 'agent_error', id: args.id, message: args.message || 'unknown error' }
44
- : { type: 'complete', id: args.id };
45
- const snapshot = store.appendEvent(event);
46
- console.log(JSON.stringify({ ok: true, id: args.id, phase: snapshot.phase, snapshot }, null, 2));
47
- }
48
-
49
- function readServerInfo() {
50
- return readLiveServerInfo(process.cwd())?.info || null;
51
- }
52
-
53
- async function completeThroughServer(info, args) {
54
- const type = args.status === 'discarded'
55
- ? 'discarded'
56
- : args.status === 'agent_error'
57
- ? 'error'
58
- : 'complete';
59
- try {
60
- const res = await fetch(`http://localhost:${info.port}/poll`, {
61
- method: 'POST',
62
- headers: { 'Content-Type': 'application/json' },
63
- body: JSON.stringify({ token: info.token, id: args.id, type, message: args.message }),
64
- });
65
- if (!res.ok) return null;
66
- return await res.json();
67
- } catch {
68
- return null;
69
- }
70
- }
71
-
72
- const _running = process.argv[1];
73
- if (_running?.endsWith('live-complete.mjs') || _running?.endsWith('live-complete.mjs/')) {
74
- completeCli();
75
- }
@@ -1,18 +0,0 @@
1
- export function completionTypeForAcceptResult(eventType, acceptResult) {
2
- if (eventType === 'discard') return acceptResult?.handled === true ? 'discarded' : 'error';
3
- if (acceptResult?.handled === true && acceptResult?.carbonize === true) return 'agent_done';
4
- if (acceptResult?.handled === true) return 'complete';
5
- if (acceptResult?.mode === 'error') return 'error';
6
- return 'agent_done';
7
- }
8
-
9
- export function completionAckForAcceptResult(eventId, completionType, acceptResult) {
10
- const ack = { ok: true, type: completionType };
11
- if (acceptResult?.handled === true && acceptResult?.carbonize === true) {
12
- ack.final = false;
13
- ack.requiresComplete = true;
14
- ack.nextCommand = `live-complete.mjs --id ${eventId}`;
15
- ack.message = 'Carbonize cleanup must be verified, then the session must be completed explicitly before polling again.';
16
- }
17
- return ack;
18
- }
@@ -1,446 +0,0 @@
1
- /**
2
- * CLI helper: insert/remove the live variant mode script tag in the project's
3
- * main HTML entry point.
4
- *
5
- * On first live run, the agent generates `.impeccable/live/config.json`
6
- * with the project's insertion target (framework-specific). On
7
- * every subsequent run, this script handles insert/remove deterministically
8
- * with zero LLM involvement.
9
- *
10
- * Usage:
11
- * node live-inject.mjs --port PORT # Insert the live script tag
12
- * node live-inject.mjs --remove # Remove the live script tag
13
- * node live-inject.mjs --check # Check whether live config exists
14
- */
15
-
16
- import fs from 'node:fs';
17
- import path from 'node:path';
18
- import { fileURLToPath } from 'node:url';
19
- import { resolveLiveConfigPath } from './impeccable-paths.mjs';
20
-
21
- const __dirname = path.dirname(fileURLToPath(import.meta.url));
22
- const CONFIG_PATH = resolveLiveConfigPath({ cwd: process.cwd(), scriptsDir: __dirname });
23
- const MARKER_OPEN_TEXT = 'impeccable-live-start';
24
- const MARKER_CLOSE_TEXT = 'impeccable-live-end';
25
-
26
- /**
27
- * Hard-excluded directory patterns. These are NEVER user-facing pages and
28
- * matching them would silently inject tracking scripts into third-party
29
- * code. The user cannot turn these off via config — they are the floor.
30
- */
31
- const HARD_EXCLUDES = [
32
- '**/node_modules/**',
33
- '**/.git/**',
34
- ];
35
-
36
- export async function injectCli() {
37
- const args = process.argv.slice(2);
38
-
39
- if (args.includes('--help') || args.includes('-h')) {
40
- console.log(`Usage: node live-inject.mjs [options]
41
-
42
- Insert or remove the live mode script tag in the project's HTML entry point.
43
- Reads configuration from .impeccable/live/config.json.
44
-
45
- Modes:
46
- --port PORT Insert script tag pointing at http://localhost:PORT/live.js
47
- --remove Remove the script tag (if present)
48
- --check Print whether .impeccable/live/config.json exists and its content
49
-
50
- Output (JSON):
51
- { ok, file, inserted|removed, config? }`);
52
- process.exit(0);
53
- }
54
-
55
- if (args.includes('--check')) {
56
- if (!fs.existsSync(CONFIG_PATH)) {
57
- console.log(JSON.stringify({ ok: false, error: 'config_missing', path: CONFIG_PATH }));
58
- process.exit(0);
59
- }
60
- let cfg;
61
- try {
62
- cfg = JSON.parse(fs.readFileSync(CONFIG_PATH, 'utf-8'));
63
- } catch (err) {
64
- console.log(JSON.stringify({ ok: false, error: 'config_invalid', message: err.message, path: CONFIG_PATH }));
65
- return;
66
- }
67
- try {
68
- validateConfig(cfg);
69
- } catch (err) {
70
- console.log(JSON.stringify({ ok: false, error: 'config_invalid', message: err.message, path: CONFIG_PATH }));
71
- return;
72
- }
73
- console.log(JSON.stringify({ ok: true, config: cfg, path: CONFIG_PATH }));
74
- return;
75
- }
76
-
77
- // Load config
78
- if (!fs.existsSync(CONFIG_PATH)) {
79
- console.error(JSON.stringify({ ok: false, error: 'config_missing', path: CONFIG_PATH }));
80
- process.exit(1);
81
- }
82
- const config = JSON.parse(fs.readFileSync(CONFIG_PATH, 'utf-8'));
83
- validateConfig(config);
84
-
85
- const resolvedFiles = resolveFiles(process.cwd(), config);
86
-
87
- if (args.includes('--remove')) {
88
- const results = resolvedFiles.map((relFile) => {
89
- const absFile = path.resolve(process.cwd(), relFile);
90
- if (!fs.existsSync(absFile)) return { file: relFile, error: 'file_not_found' };
91
- const content = fs.readFileSync(absFile, 'utf-8');
92
- const detagged = removeTag(content, config.commentSyntax);
93
- const updated = revertCspMeta(detagged);
94
- if (updated === content) return { file: relFile, removed: false, note: 'no tag present' };
95
- fs.writeFileSync(absFile, updated, 'utf-8');
96
- return {
97
- file: relFile,
98
- removed: detagged !== content,
99
- cspReverted: updated !== detagged,
100
- };
101
- });
102
- console.log(JSON.stringify({ ok: true, results }));
103
- return;
104
- }
105
-
106
- // Insert mode — need --port
107
- const portIdx = args.indexOf('--port');
108
- const port = portIdx !== -1 ? parseInt(args[portIdx + 1], 10) : NaN;
109
- if (!Number.isFinite(port)) {
110
- console.error(JSON.stringify({ ok: false, error: 'missing_port' }));
111
- process.exit(1);
112
- }
113
-
114
- const results = resolvedFiles.map((relFile) => {
115
- const absFile = path.resolve(process.cwd(), relFile);
116
- if (!fs.existsSync(absFile)) return { file: relFile, error: 'file_not_found' };
117
- const content = fs.readFileSync(absFile, 'utf-8');
118
- const withoutOld = revertCspMeta(removeTag(content, config.commentSyntax));
119
- const withTag = insertTag(withoutOld, config, port);
120
- if (withTag === withoutOld) {
121
- return { file: relFile, error: 'insertion_point_not_found', anchor: config.insertBefore || config.insertAfter };
122
- }
123
- const updated = patchCspMeta(withTag, port);
124
- fs.writeFileSync(absFile, updated, 'utf-8');
125
- return {
126
- file: relFile,
127
- inserted: true,
128
- cspPatched: updated !== withTag,
129
- };
130
- });
131
- const anyInserted = results.some((r) => r.inserted);
132
- console.log(JSON.stringify({ ok: anyInserted, port, results }));
133
- if (!anyInserted) process.exit(1);
134
- }
135
-
136
- /**
137
- * Expand config.files (which may contain glob patterns) into a literal list
138
- * of existing file paths relative to rootDir. Literal entries pass through;
139
- * glob patterns are expanded via fs.globSync. HARD_EXCLUDES and config.exclude
140
- * are applied as filters. Duplicates are removed. Order is preserved by
141
- * first appearance.
142
- */
143
- export function resolveFiles(rootDir, config) {
144
- const patterns = config.files;
145
- const userExcludes = Array.isArray(config.exclude) ? config.exclude : [];
146
- const allExcludes = [...HARD_EXCLUDES, ...userExcludes];
147
- const excludeRegexes = allExcludes.map(globToRegex);
148
-
149
- const isExcluded = (relPath) => excludeRegexes.some((re) => re.test(relPath));
150
- const isGlob = (s) => /[*?[]/.test(s);
151
-
152
- const seen = new Set();
153
- const out = [];
154
- for (const pat of patterns) {
155
- if (!isGlob(pat)) {
156
- // Literal path — include even if it doesn't exist yet; the caller
157
- // reports file_not_found per-entry. Exclude list doesn't apply to
158
- // explicit literal entries (user named it on purpose).
159
- if (!seen.has(pat)) {
160
- seen.add(pat);
161
- out.push(pat);
162
- }
163
- continue;
164
- }
165
- let matches;
166
- try {
167
- matches = fs.globSync(pat, { cwd: rootDir, withFileTypes: true });
168
- } catch {
169
- continue;
170
- }
171
- for (const ent of matches) {
172
- if (!ent.isFile || !ent.isFile()) continue;
173
- const abs = path.join(ent.parentPath || ent.path || rootDir, ent.name);
174
- const rel = path.relative(rootDir, abs).split(path.sep).join('/');
175
- if (isExcluded(rel)) continue;
176
- if (seen.has(rel)) continue;
177
- seen.add(rel);
178
- out.push(rel);
179
- }
180
- }
181
- return out;
182
- }
183
-
184
- /**
185
- * Convert a glob pattern to a RegExp. Supports:
186
- * ** → any number of path segments (including zero)
187
- * * → any chars except `/`
188
- * ? → any single char except `/`
189
- * Paths are normalized to forward slashes before matching.
190
- */
191
- function globToRegex(pattern) {
192
- let re = '';
193
- let i = 0;
194
- while (i < pattern.length) {
195
- const c = pattern[i];
196
- if (c === '*') {
197
- if (pattern[i + 1] === '*') {
198
- // ** — any number of segments, including zero. Handle the common
199
- // **/ and /** forms so `a/**/b` matches `a/b` as well as `a/x/y/b`.
200
- if (pattern[i + 2] === '/') {
201
- re += '(?:.*/)?';
202
- i += 3;
203
- } else {
204
- re += '.*';
205
- i += 2;
206
- }
207
- } else {
208
- re += '[^/]*';
209
- i += 1;
210
- }
211
- } else if (c === '?') {
212
- re += '[^/]';
213
- i += 1;
214
- } else if (/[.+^${}()|[\]\\]/.test(c)) {
215
- re += '\\' + c;
216
- i += 1;
217
- } else {
218
- re += c;
219
- i += 1;
220
- }
221
- }
222
- return new RegExp('^' + re + '$');
223
- }
224
-
225
- // ---------------------------------------------------------------------------
226
- // Core operations
227
- // ---------------------------------------------------------------------------
228
-
229
- function validateConfig(cfg) {
230
- if (!cfg || typeof cfg !== 'object') throw new Error('config.json must be an object');
231
- if (!Array.isArray(cfg.files) || cfg.files.length === 0) {
232
- throw new Error('config.files (non-empty string array) required');
233
- }
234
- if (!cfg.files.every((f) => typeof f === 'string' && f.length > 0)) {
235
- throw new Error('config.files must contain only non-empty strings');
236
- }
237
- if (cfg.exclude !== undefined) {
238
- if (!Array.isArray(cfg.exclude)) {
239
- throw new Error('config.exclude, if present, must be a string array');
240
- }
241
- if (!cfg.exclude.every((f) => typeof f === 'string' && f.length > 0)) {
242
- throw new Error('config.exclude must contain only non-empty strings');
243
- }
244
- }
245
- if (typeof cfg.insertBefore !== 'string' && typeof cfg.insertAfter !== 'string') {
246
- throw new Error('config.insertBefore or config.insertAfter (string) required');
247
- }
248
- if (cfg.commentSyntax !== 'html' && cfg.commentSyntax !== 'jsx') {
249
- throw new Error("config.commentSyntax must be 'html' or 'jsx'");
250
- }
251
- if (cfg.cspChecked !== undefined && typeof cfg.cspChecked !== 'boolean') {
252
- throw new Error("config.cspChecked, if present, must be a boolean");
253
- }
254
- }
255
-
256
- function commentOpen(syntax) { return syntax === 'jsx' ? '{/*' : '<!--'; }
257
- function commentClose(syntax) { return syntax === 'jsx' ? '*/}' : '-->'; }
258
-
259
- function buildTagBlock(syntax, port) {
260
- const open = commentOpen(syntax);
261
- const close = commentClose(syntax);
262
- return (
263
- open + ' ' + MARKER_OPEN_TEXT + ' ' + close + '\n' +
264
- '<script src="http://localhost:' + port + '/live.js"></script>\n' +
265
- open + ' ' + MARKER_CLOSE_TEXT + ' ' + close + '\n'
266
- );
267
- }
268
-
269
- function insertTag(content, config, port) {
270
- const block = buildTagBlock(config.commentSyntax, port);
271
- // insertBefore: match the LAST occurrence. Anchors like `</body>` naturally
272
- // belong at the end, and the same literal can appear earlier in code blocks
273
- // within rendered documentation pages.
274
- if (config.insertBefore) {
275
- const idx = content.lastIndexOf(config.insertBefore);
276
- if (idx === -1) return content;
277
- return content.slice(0, idx) + block + content.slice(idx);
278
- }
279
- // insertAfter: match the FIRST occurrence — typical anchors like `<head>` or
280
- // `<body>` open near the top of the document.
281
- const idx = content.indexOf(config.insertAfter);
282
- if (idx === -1) return content;
283
- const after = idx + config.insertAfter.length;
284
- // Preserve a single trailing newline if the anchor didn't end with one
285
- const prefix = content[after] === '\n' ? content.slice(0, after + 1) : content.slice(0, after) + '\n';
286
- return prefix + block + content.slice(prefix.length);
287
- }
288
-
289
- /**
290
- * Remove the live script block. Matches either HTML or JSX comment markers
291
- * regardless of config (so stale tags from a wrong config can still be cleaned).
292
- *
293
- * Indent-preserving: captures any whitespace immediately preceding the opener
294
- * marker and re-emits it in place of the removed block. `insertTag` inserted
295
- * the block *after* the original line's indent and *before* the anchor (e.g.
296
- * `</body>`), which moved the indent onto the opener line and left the anchor
297
- * unindented. Replacing the whole block (plus its trailing newline) with just
298
- * the captured indent hands the indent back to the anchor that follows.
299
- */
300
- function removeTag(content, _syntax) {
301
- const patterns = [
302
- /([ \t]*)<!--\s*impeccable-live-start\s*-->[\s\S]*?<!--\s*impeccable-live-end\s*-->[ \t]*\n/,
303
- /([ \t]*)\{\/\*\s*impeccable-live-start\s*\*\/\}[\s\S]*?\{\/\*\s*impeccable-live-end\s*\*\/\}[ \t]*\n/,
304
- ];
305
- for (const pat of patterns) {
306
- const next = content.replace(pat, '$1');
307
- if (next !== content) return next;
308
- }
309
- return content;
310
- }
311
-
312
- // ---------------------------------------------------------------------------
313
- // Content-Security-Policy meta-tag patcher
314
- //
315
- // When the user's HTML carries `<meta http-equiv="Content-Security-Policy">`,
316
- // the cross-origin load of /live.js (and the SSE/POST connection back to
317
- // localhost:PORT) is blocked unless the CSP explicitly allows that origin.
318
- //
319
- // On insert: append `http://localhost:PORT` to `script-src` and `connect-src`,
320
- // and stash the original `content` value in a `data-impeccable-csp-original`
321
- // attribute (base64) so revert is exact.
322
- //
323
- // On remove: detect the marker attribute, decode it, restore the original
324
- // content value verbatim, drop the marker.
325
- //
326
- // Header-based CSP (Next.js headers, Nuxt routeRules, SvelteKit kit.csp,
327
- // shared helpers) is NOT patched here — those need framework-specific config
328
- // edits and are handled via the existing detect-csp.mjs reference output.
329
- // Only the in-source meta-tag form gets the auto-patch.
330
- // ---------------------------------------------------------------------------
331
-
332
- const CSP_MARKER_ATTR = 'data-impeccable-csp-original';
333
-
334
- function findCspMetaTags(content) {
335
- const out = [];
336
- const tagRe = /<meta\s+([^>]*?)\/?>/gis;
337
- let m;
338
- while ((m = tagRe.exec(content)) !== null) {
339
- const attrs = m[1];
340
- if (!/(http-equiv|httpEquiv)\s*=\s*(['"])Content-Security-Policy\2/i.test(attrs)) continue;
341
- out.push({ start: m.index, end: m.index + m[0].length, full: m[0], attrs });
342
- }
343
- return out;
344
- }
345
-
346
- function getAttr(attrs, name) {
347
- const re = new RegExp(`\\b${name}\\s*=\\s*(['"])([\\s\\S]*?)\\1`, 'i');
348
- const m = attrs.match(re);
349
- return m ? { quote: m[1], value: m[2], full: m[0] } : null;
350
- }
351
-
352
- function appendOriginToDirective(csp, directive, origin) {
353
- const re = new RegExp(`(^|;)(\\s*)(${directive})\\s+([^;]*)`, 'i');
354
- const m = csp.match(re);
355
- if (m) {
356
- const tokens = m[4].trim().split(/\s+/);
357
- if (tokens.includes(origin)) return csp;
358
- return csp.replace(re, `${m[1]}${m[2]}${m[3]} ${[...tokens, origin].join(' ')}`);
359
- }
360
- // Directive missing — add it. Use 'self' + origin so we don't inadvertently
361
- // narrow the policy compared to the default-src fallback (most users with
362
- // an explicit CSP have 'self' there).
363
- return csp.trim().replace(/;?\s*$/, '') + `; ${directive} 'self' ${origin}`;
364
- }
365
-
366
- export function patchCspMeta(content, port) {
367
- const tags = findCspMetaTags(content);
368
- if (tags.length === 0) return content;
369
- const origin = `http://localhost:${port}`;
370
-
371
- // Walk last-to-first so prior splices don't invalidate later indices.
372
- let result = content;
373
- for (let i = tags.length - 1; i >= 0; i--) {
374
- const tag = tags[i];
375
- const attrs = tag.attrs;
376
- if (getAttr(attrs, CSP_MARKER_ATTR)) continue; // already patched
377
- const contentAttr = getAttr(attrs, 'content');
378
- if (!contentAttr) continue;
379
-
380
- const original = contentAttr.value;
381
- let patched = original;
382
- patched = appendOriginToDirective(patched, 'script-src', origin);
383
- patched = appendOriginToDirective(patched, 'connect-src', origin);
384
- // The shader overlay during 'generating' creates a screenshot via
385
- // URL.createObjectURL, producing a `blob:` URL — img-src 'self' rejects
386
- // those. Add `blob:` so the overlay doesn't throw a CSP violation.
387
- patched = appendOriginToDirective(patched, 'img-src', 'blob:');
388
- if (patched === original) continue;
389
-
390
- const newContentAttr = `content=${contentAttr.quote}${patched}${contentAttr.quote}`;
391
- const marker = `${CSP_MARKER_ATTR}="${Buffer.from(original, 'utf-8').toString('base64')}"`;
392
- // The tagRe captures any whitespace between the last attribute and the
393
- // closing `/>` as part of `attrs`. Naively appending ` ${marker}` after
394
- // a replace would land it BEFORE that trailing space, leaving a double
395
- // space inside attrs and clobbering the space before `/>`. Split off
396
- // the trailing whitespace, splice the marker into the attribute body,
397
- // and re-append the original trailing whitespace so a self-closing
398
- // `<meta … />` round-trips byte-for-byte.
399
- const trailingWs = (attrs.match(/[ \t]*$/) || [''])[0];
400
- const attrsBody = attrs.slice(0, attrs.length - trailingWs.length);
401
- const newAttrs = attrsBody.replace(contentAttr.full, newContentAttr) + ' ' + marker + trailingWs;
402
- const newTag = tag.full.replace(attrs, newAttrs);
403
-
404
- result = result.slice(0, tag.start) + newTag + result.slice(tag.end);
405
- }
406
- return result;
407
- }
408
-
409
- export function revertCspMeta(content) {
410
- const tags = findCspMetaTags(content);
411
- if (tags.length === 0) return content;
412
-
413
- let result = content;
414
- for (let i = tags.length - 1; i >= 0; i--) {
415
- const tag = tags[i];
416
- const origAttr = getAttr(tag.attrs, CSP_MARKER_ATTR);
417
- if (!origAttr) continue;
418
- const contentAttr = getAttr(tag.attrs, 'content');
419
- if (!contentAttr) continue;
420
-
421
- let originalValue;
422
- try { originalValue = Buffer.from(origAttr.value, 'base64').toString('utf-8'); }
423
- catch { continue; }
424
-
425
- const newContentAttr = `content=${contentAttr.quote}${originalValue}${contentAttr.quote}`;
426
- let newAttrs = tag.attrs.replace(contentAttr.full, newContentAttr);
427
- // Drop the marker attribute and any single space immediately preceding it.
428
- newAttrs = newAttrs.replace(new RegExp(`\\s*${origAttr.full}`), '');
429
- const newTag = tag.full.replace(tag.attrs, newAttrs);
430
-
431
- result = result.slice(0, tag.start) + newTag + result.slice(tag.end);
432
- }
433
- return result;
434
- }
435
-
436
- // ---------------------------------------------------------------------------
437
- // Auto-execute
438
- // ---------------------------------------------------------------------------
439
-
440
- const _running = process.argv[1];
441
- if (_running?.endsWith('live-inject.mjs') || _running?.endsWith('live-inject.mjs/')) {
442
- injectCli();
443
- }
444
-
445
- export { insertTag, removeTag, validateConfig, buildTagBlock };
446
- // patchCspMeta + revertCspMeta are exported above where they're defined.