self-evolving-workflow 0.0.0-stage → 0.1.4

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 (375) hide show
  1. package/LICENSE +27 -0
  2. package/README.md +195 -2
  3. package/dist/agent-memory-prompts.d.ts +13 -0
  4. package/dist/agent-memory-prompts.js +55 -0
  5. package/dist/cli.d.ts +2 -0
  6. package/dist/cli.js +6 -0
  7. package/dist/closeout.d.ts +105 -0
  8. package/dist/closeout.js +473 -0
  9. package/dist/code.d.ts +39 -0
  10. package/dist/code.js +124 -0
  11. package/dist/codex-memory.d.ts +24 -0
  12. package/dist/codex-memory.js +217 -0
  13. package/dist/common.d.ts +16 -0
  14. package/dist/common.js +52 -0
  15. package/dist/context-envelope.d.ts +59 -0
  16. package/dist/context-envelope.js +23 -0
  17. package/dist/host-adapters.d.ts +34 -0
  18. package/dist/host-adapters.js +151 -0
  19. package/dist/http.d.ts +3 -0
  20. package/dist/http.js +90 -0
  21. package/dist/index.d.ts +16 -0
  22. package/dist/index.js +13 -0
  23. package/dist/knowledge-cli.d.ts +198 -0
  24. package/dist/knowledge-cli.js +761 -0
  25. package/dist/knowledge-reads.d.ts +72 -0
  26. package/dist/knowledge-reads.js +201 -0
  27. package/dist/memory-config.d.ts +44 -0
  28. package/dist/memory-config.js +204 -0
  29. package/dist/memory-evidence.d.ts +13 -0
  30. package/dist/memory-evidence.js +40 -0
  31. package/dist/memory-history.d.ts +46 -0
  32. package/dist/memory-history.js +432 -0
  33. package/dist/memory.d.ts +96 -0
  34. package/dist/memory.js +362 -0
  35. package/dist/retrospective.d.ts +57 -0
  36. package/dist/retrospective.js +240 -0
  37. package/dist/search.d.ts +36 -0
  38. package/dist/search.js +112 -0
  39. package/dist/skill-addition.d.ts +25 -0
  40. package/dist/skill-addition.js +89 -0
  41. package/dist/skill-design.d.ts +96 -0
  42. package/dist/skill-design.js +226 -0
  43. package/dist/skill-replay.d.ts +55 -0
  44. package/dist/skill-replay.js +448 -0
  45. package/dist/skill-route.d.ts +30 -0
  46. package/dist/skill-route.js +75 -0
  47. package/dist/transcript-evidence.d.ts +3 -0
  48. package/dist/transcript-evidence.js +58 -0
  49. package/dist/upstream/chunker.d.ts +24 -0
  50. package/dist/upstream/chunker.js +96 -0
  51. package/dist/upstream/file-protocol.d.ts +45 -0
  52. package/dist/upstream/file-protocol.js +117 -0
  53. package/dist/upstream/frontmatter.d.ts +47 -0
  54. package/dist/upstream/frontmatter.js +86 -0
  55. package/dist/upstream/graph-search.d.ts +33 -0
  56. package/dist/upstream/graph-search.js +67 -0
  57. package/dist/upstream/l1-extraction.d.ts +26 -0
  58. package/dist/upstream/l1-extraction.js +405 -0
  59. package/dist/upstream/llm.d.ts +8 -0
  60. package/dist/upstream/llm.js +1 -0
  61. package/dist/upstream/merge.d.ts +50 -0
  62. package/dist/upstream/merge.js +153 -0
  63. package/dist/upstream/prompts.d.ts +53 -0
  64. package/dist/upstream/prompts.js +181 -0
  65. package/dist/upstream/search-utils.d.ts +34 -0
  66. package/dist/upstream/search-utils.js +55 -0
  67. package/dist/upstream/slug.d.ts +26 -0
  68. package/dist/upstream/slug.js +103 -0
  69. package/dist/upstream/template.d.ts +29 -0
  70. package/dist/upstream/template.js +80 -0
  71. package/dist/upstream/tokenize.d.ts +4 -0
  72. package/dist/upstream/tokenize.js +29 -0
  73. package/dist/wiki-change.d.ts +76 -0
  74. package/dist/wiki-change.js +299 -0
  75. package/dist/wiki-entry.d.ts +26 -0
  76. package/dist/wiki-entry.js +93 -0
  77. package/dist/wiki-ingest.d.ts +12 -0
  78. package/dist/wiki-ingest.js +126 -0
  79. package/dist/wiki-migration.d.ts +16 -0
  80. package/dist/wiki-migration.js +268 -0
  81. package/dist/wiki-tokens.d.ts +1 -0
  82. package/dist/wiki-tokens.js +46 -0
  83. package/dist/wiki.d.ts +103 -0
  84. package/dist/wiki.js +330 -0
  85. package/dist/workflow-cli.d.ts +2 -0
  86. package/dist/workflow-cli.js +319 -0
  87. package/dist/workflow-install.d.ts +37 -0
  88. package/dist/workflow-install.js +148 -0
  89. package/dist/workflow-knowledge.d.ts +18 -0
  90. package/dist/workflow-knowledge.js +32 -0
  91. package/dist/workflow-mcp.d.ts +2 -0
  92. package/dist/workflow-mcp.js +137 -0
  93. package/dist/workflow-names.d.ts +4 -0
  94. package/dist/workflow-names.js +31 -0
  95. package/dist/workflow-runtime.d.ts +735 -0
  96. package/dist/workflow-runtime.js +747 -0
  97. package/dist/workflow-skills.d.ts +48 -0
  98. package/dist/workflow-skills.js +141 -0
  99. package/docs/images/impeccable-skill.png +0 -0
  100. package/docs/images/workflow-overview.png +0 -0
  101. package/docs/images/workflow-skills.png +0 -0
  102. package/package.json +77 -4
  103. package/skills/ew-impeccable/LICENSE +191 -0
  104. package/skills/ew-impeccable/NOTICE.md +19 -0
  105. package/skills/ew-impeccable/SKILL.md +91 -0
  106. package/skills/ew-impeccable/UPSTREAM.md +23 -0
  107. package/skills/ew-impeccable/reference/adapt.md +314 -0
  108. package/skills/ew-impeccable/reference/adapt.native.md +60 -0
  109. package/skills/ew-impeccable/reference/android.md +46 -0
  110. package/skills/ew-impeccable/reference/animate.md +91 -0
  111. package/skills/ew-impeccable/reference/audit.md +138 -0
  112. package/skills/ew-impeccable/reference/audit.native.md +141 -0
  113. package/skills/ew-impeccable/reference/bolder.md +35 -0
  114. package/skills/ew-impeccable/reference/clarify.md +96 -0
  115. package/skills/ew-impeccable/reference/colorize.md +88 -0
  116. package/skills/ew-impeccable/reference/craft-floor.md +44 -0
  117. package/skills/ew-impeccable/reference/craft.md +5 -0
  118. package/skills/ew-impeccable/reference/critique.md +808 -0
  119. package/skills/ew-impeccable/reference/degraded/asset-producer.md +36 -0
  120. package/skills/ew-impeccable/reference/degraded/documenter.md +23 -0
  121. package/skills/ew-impeccable/reference/degraded/finish-reviewer.md +72 -0
  122. package/skills/ew-impeccable/reference/degraded/manual-edit-applier.md +91 -0
  123. package/skills/ew-impeccable/reference/delight.md +72 -0
  124. package/skills/ew-impeccable/reference/distill.md +113 -0
  125. package/skills/ew-impeccable/reference/doctor.md +56 -0
  126. package/skills/ew-impeccable/reference/document.md +418 -0
  127. package/skills/ew-impeccable/reference/extract.md +68 -0
  128. package/skills/ew-impeccable/reference/harden.md +338 -0
  129. package/skills/ew-impeccable/reference/hooks.md +113 -0
  130. package/skills/ew-impeccable/reference/init.md +133 -0
  131. package/skills/ew-impeccable/reference/ios.md +51 -0
  132. package/skills/ew-impeccable/reference/layout.md +86 -0
  133. package/skills/ew-impeccable/reference/live-setup.md +102 -0
  134. package/skills/ew-impeccable/reference/live.md +326 -0
  135. package/skills/ew-impeccable/reference/new-work.md +209 -0
  136. package/skills/ew-impeccable/reference/onboard.md +236 -0
  137. package/skills/ew-impeccable/reference/operate.md +61 -0
  138. package/skills/ew-impeccable/reference/optimize.md +260 -0
  139. package/skills/ew-impeccable/reference/overdrive.md +127 -0
  140. package/skills/ew-impeccable/reference/polish.md +105 -0
  141. package/skills/ew-impeccable/reference/quieter.md +101 -0
  142. package/skills/ew-impeccable/reference/routing.md +20 -0
  143. package/skills/ew-impeccable/reference/shape.md +59 -0
  144. package/skills/ew-impeccable/reference/typeset.md +82 -0
  145. package/skills/ew-impeccable/reference/visualize.md +46 -0
  146. package/skills/ew-impeccable/scripts/build-phase.mjs +1022 -0
  147. package/skills/ew-impeccable/scripts/command-metadata.json +94 -0
  148. package/skills/ew-impeccable/scripts/comp-diff.mjs +391 -0
  149. package/skills/ew-impeccable/scripts/comp-spec.mjs +513 -0
  150. package/skills/ew-impeccable/scripts/concept-seed.mjs +814 -0
  151. package/skills/ew-impeccable/scripts/context-signals.mjs +325 -0
  152. package/skills/ew-impeccable/scripts/context.mjs +1521 -0
  153. package/skills/ew-impeccable/scripts/critique-storage.mjs +473 -0
  154. package/skills/ew-impeccable/scripts/data/font-index-failures.json +121 -0
  155. package/skills/ew-impeccable/scripts/data/font-index.json +1 -0
  156. package/skills/ew-impeccable/scripts/detect-csp.mjs +246 -0
  157. package/skills/ew-impeccable/scripts/detect.mjs +30 -0
  158. package/skills/ew-impeccable/scripts/detector/browser/injected/index.mjs +2580 -0
  159. package/skills/ew-impeccable/scripts/detector/cli/main.mjs +498 -0
  160. package/skills/ew-impeccable/scripts/detector/design-system.mjs +1311 -0
  161. package/skills/ew-impeccable/scripts/detector/detect-antipatterns-browser.js +9486 -0
  162. package/skills/ew-impeccable/scripts/detector/detect-antipatterns.mjs +51 -0
  163. package/skills/ew-impeccable/scripts/detector/engines/browser/detect-url.mjs +434 -0
  164. package/skills/ew-impeccable/scripts/detector/engines/regex/detect-text.mjs +1439 -0
  165. package/skills/ew-impeccable/scripts/detector/engines/static-html/css-cascade.mjs +1242 -0
  166. package/skills/ew-impeccable/scripts/detector/engines/static-html/detect-html.mjs +263 -0
  167. package/skills/ew-impeccable/scripts/detector/engines/visual/screenshot-contrast.mjs +189 -0
  168. package/skills/ew-impeccable/scripts/detector/findings.mjs +23 -0
  169. package/skills/ew-impeccable/scripts/detector/node/file-system.mjs +225 -0
  170. package/skills/ew-impeccable/scripts/detector/profile/profiler.mjs +166 -0
  171. package/skills/ew-impeccable/scripts/detector/registry/antipatterns.mjs +636 -0
  172. package/skills/ew-impeccable/scripts/detector/rules/checks.mjs +5750 -0
  173. package/skills/ew-impeccable/scripts/detector/shared/color.mjs +596 -0
  174. package/skills/ew-impeccable/scripts/detector/shared/constants.mjs +127 -0
  175. package/skills/ew-impeccable/scripts/detector/shared/fonts.mjs +30 -0
  176. package/skills/ew-impeccable/scripts/detector/shared/inline-ignores.mjs +148 -0
  177. package/skills/ew-impeccable/scripts/detector/shared/page.mjs +7 -0
  178. package/skills/ew-impeccable/scripts/detector/vendor/MDN-DATA-LICENSE +116 -0
  179. package/skills/ew-impeccable/scripts/detector/vendor/THIRD_PARTY_LICENSES.md +227 -0
  180. package/skills/ew-impeccable/scripts/detector/vendor/static-html-parser.build-entry.txt +11 -0
  181. package/skills/ew-impeccable/scripts/detector/vendor/static-html-parser.bundle.mjs +9121 -0
  182. package/skills/ew-impeccable/scripts/doctor.mjs +330 -0
  183. package/skills/ew-impeccable/scripts/embed-prompt.mjs +166 -0
  184. package/skills/ew-impeccable/scripts/font-match.mjs +457 -0
  185. package/skills/ew-impeccable/scripts/generate-image.mjs +447 -0
  186. package/skills/ew-impeccable/scripts/hook-admin.mjs +829 -0
  187. package/skills/ew-impeccable/scripts/hook-before-edit.mjs +538 -0
  188. package/skills/ew-impeccable/scripts/hook-lib.mjs +2493 -0
  189. package/skills/ew-impeccable/scripts/hook.mjs +79 -0
  190. package/skills/ew-impeccable/scripts/lib/artifact-schema.mjs +93 -0
  191. package/skills/ew-impeccable/scripts/lib/composition-catalog.mjs +200 -0
  192. package/skills/ew-impeccable/scripts/lib/concept-catalog.mjs +395 -0
  193. package/skills/ew-impeccable/scripts/lib/design-parser.mjs +880 -0
  194. package/skills/ew-impeccable/scripts/lib/font-fingerprint.mjs +564 -0
  195. package/skills/ew-impeccable/scripts/lib/font-index.mjs +130 -0
  196. package/skills/ew-impeccable/scripts/lib/hero-checks.mjs +246 -0
  197. package/skills/ew-impeccable/scripts/lib/image-metrics.mjs +306 -0
  198. package/skills/ew-impeccable/scripts/lib/impeccable-config.mjs +640 -0
  199. package/skills/ew-impeccable/scripts/lib/impeccable-paths.mjs +137 -0
  200. package/skills/ew-impeccable/scripts/lib/is-generated.mjs +72 -0
  201. package/skills/ew-impeccable/scripts/lib/live-path-globs.mjs +37 -0
  202. package/skills/ew-impeccable/scripts/lib/open-system-browser.mjs +26 -0
  203. package/skills/ew-impeccable/scripts/lib/png.mjs +281 -0
  204. package/skills/ew-impeccable/scripts/lib/provider.mjs +5 -0
  205. package/skills/ew-impeccable/scripts/lib/raster.mjs +194 -0
  206. package/skills/ew-impeccable/scripts/lib/roll-selection.mjs +369 -0
  207. package/skills/ew-impeccable/scripts/lib/staleness-deep.mjs +491 -0
  208. package/skills/ew-impeccable/scripts/lib/staleness-notice.mjs +169 -0
  209. package/skills/ew-impeccable/scripts/lib/staleness.mjs +532 -0
  210. package/skills/ew-impeccable/scripts/lib/surface-briefs.mjs +149 -0
  211. package/skills/ew-impeccable/scripts/lib/target-args.mjs +42 -0
  212. package/skills/ew-impeccable/scripts/lib/target-slug.mjs +33 -0
  213. package/skills/ew-impeccable/scripts/lib/template-extensions.mjs +146 -0
  214. package/skills/ew-impeccable/scripts/live/accept-css.mjs +617 -0
  215. package/skills/ew-impeccable/scripts/live/accept-verify.mjs +60 -0
  216. package/skills/ew-impeccable/scripts/live/browser-script-parts.mjs +84 -0
  217. package/skills/ew-impeccable/scripts/live/completion.mjs +28 -0
  218. package/skills/ew-impeccable/scripts/live/event-validation.mjs +199 -0
  219. package/skills/ew-impeccable/scripts/live/frameworks/astro.mjs +47 -0
  220. package/skills/ew-impeccable/scripts/live/frameworks/detect-utils.mjs +73 -0
  221. package/skills/ew-impeccable/scripts/live/frameworks/index.mjs +143 -0
  222. package/skills/ew-impeccable/scripts/live/frameworks/journal.mjs +197 -0
  223. package/skills/ew-impeccable/scripts/live/frameworks/nextjs.mjs +49 -0
  224. package/skills/ew-impeccable/scripts/live/frameworks/nuxt.mjs +161 -0
  225. package/skills/ew-impeccable/scripts/live/frameworks/script-src.mjs +17 -0
  226. package/skills/ew-impeccable/scripts/live/frameworks/static-html.mjs +26 -0
  227. package/skills/ew-impeccable/scripts/live/frameworks/sveltekit.mjs +71 -0
  228. package/skills/ew-impeccable/scripts/live/frameworks/tag-strategy.mjs +247 -0
  229. package/skills/ew-impeccable/scripts/live/frameworks/tanstack-start.mjs +70 -0
  230. package/skills/ew-impeccable/scripts/live/frameworks/vite-generic.mjs +42 -0
  231. package/skills/ew-impeccable/scripts/live/generation-preflight.mjs +149 -0
  232. package/skills/ew-impeccable/scripts/live/insert-ui.mjs +458 -0
  233. package/skills/ew-impeccable/scripts/live/instructions.mjs +142 -0
  234. package/skills/ew-impeccable/scripts/live/manual-apply.mjs +939 -0
  235. package/skills/ew-impeccable/scripts/live/manual-edit-routes.mjs +357 -0
  236. package/skills/ew-impeccable/scripts/live/manual-edits-buffer.mjs +152 -0
  237. package/skills/ew-impeccable/scripts/live/poll-lanes.mjs +14 -0
  238. package/skills/ew-impeccable/scripts/live/project-ignores.mjs +139 -0
  239. package/skills/ew-impeccable/scripts/live/roots.mjs +508 -0
  240. package/skills/ew-impeccable/scripts/live/session-store.mjs +563 -0
  241. package/skills/ew-impeccable/scripts/live/source-lock.mjs +105 -0
  242. package/skills/ew-impeccable/scripts/live/source-search.mjs +105 -0
  243. package/skills/ew-impeccable/scripts/live/svelte-ast.mjs +969 -0
  244. package/skills/ew-impeccable/scripts/live/svelte-component.mjs +1366 -0
  245. package/skills/ew-impeccable/scripts/live/sveltekit-adapter.mjs +304 -0
  246. package/skills/ew-impeccable/scripts/live/tanstack-adapter.mjs +259 -0
  247. package/skills/ew-impeccable/scripts/live/ui-surfaces.mjs +75 -0
  248. package/skills/ew-impeccable/scripts/live/vocabulary.mjs +171 -0
  249. package/skills/ew-impeccable/scripts/live-accept.mjs +938 -0
  250. package/skills/ew-impeccable/scripts/live-browser-dom.js +167 -0
  251. package/skills/ew-impeccable/scripts/live-browser-ignores.js +242 -0
  252. package/skills/ew-impeccable/scripts/live-browser-session.js +144 -0
  253. package/skills/ew-impeccable/scripts/live-browser.js +12851 -0
  254. package/skills/ew-impeccable/scripts/live-commit-manual-edits.mjs +1200 -0
  255. package/skills/ew-impeccable/scripts/live-complete.mjs +107 -0
  256. package/skills/ew-impeccable/scripts/live-copy-edit-agent.mjs +800 -0
  257. package/skills/ew-impeccable/scripts/live-discard-manual-edits.mjs +51 -0
  258. package/skills/ew-impeccable/scripts/live-inject.mjs +463 -0
  259. package/skills/ew-impeccable/scripts/live-insert.mjs +292 -0
  260. package/skills/ew-impeccable/scripts/live-manual-edit-evidence.mjs +368 -0
  261. package/skills/ew-impeccable/scripts/live-poll.mjs +430 -0
  262. package/skills/ew-impeccable/scripts/live-resume.mjs +123 -0
  263. package/skills/ew-impeccable/scripts/live-server.mjs +1698 -0
  264. package/skills/ew-impeccable/scripts/live-status.mjs +71 -0
  265. package/skills/ew-impeccable/scripts/live-target.mjs +30 -0
  266. package/skills/ew-impeccable/scripts/live-wrap.mjs +927 -0
  267. package/skills/ew-impeccable/scripts/live.mjs +334 -0
  268. package/skills/ew-impeccable/scripts/modern-screenshot.umd.js +14 -0
  269. package/skills/ew-impeccable/scripts/palette.mjs +628 -0
  270. package/skills/ew-impeccable/scripts/pin.mjs +352 -0
  271. package/skills/ew-impeccable/scripts/serve-question.mjs +1783 -0
  272. package/skills/ew-impeccable/scripts/surface-brief.mjs +74 -0
  273. package/skills/ew-knowledge/SKILL.md +35 -0
  274. package/skills/ew-knowledge/references/closeout-protocol.md +68 -0
  275. package/skills/ew-knowledge/references/knowledge-route.md +73 -0
  276. package/skills/ew-knowledge/references/wiki-maintenance.md +27 -0
  277. package/skills/ew-odyssey/SKILL.md +106 -0
  278. package/skills/ew-odyssey/references/audit-artifacts.md +7 -0
  279. package/skills/ew-odyssey/references/odyssey-base.md +104 -0
  280. package/skills/ew-odyssey/references/odyssey-debug.md +264 -0
  281. package/skills/ew-odyssey/references/odyssey-defensive.md +351 -0
  282. package/skills/ew-odyssey/references/odyssey-improve.md +230 -0
  283. package/skills/ew-odyssey/references/odyssey-planex.md +294 -0
  284. package/skills/ew-odyssey/references/odyssey-review.md +233 -0
  285. package/skills/ew-odyssey/references/odyssey-security.md +231 -0
  286. package/skills/ew-odyssey/references/odyssey-ui.md +232 -0
  287. package/skills/ew-odyssey/references/prepare/odyssey-debug.md +102 -0
  288. package/skills/ew-odyssey/references/prepare/odyssey-defensive.md +117 -0
  289. package/skills/ew-odyssey/references/prepare/odyssey-improve.md +95 -0
  290. package/skills/ew-odyssey/references/prepare/odyssey-planex.md +105 -0
  291. package/skills/ew-odyssey/references/prepare/odyssey-review.md +105 -0
  292. package/skills/ew-odyssey/references/prepare/odyssey-security.md +91 -0
  293. package/skills/ew-odyssey/references/prepare/odyssey-ui.md +88 -0
  294. package/skills/ew-odyssey/references/runtime-adapters.md +31 -0
  295. package/skills/ew-orchestrate/SKILL.md +89 -0
  296. package/skills/ew-orchestrate/references/auto-policy.md +66 -0
  297. package/skills/ew-orchestrate/references/boundary-grill.md +51 -0
  298. package/skills/ew-orchestrate/references/companion-route.md +40 -0
  299. package/skills/ew-orchestrate/references/ew-orchestrate.md +44 -0
  300. package/skills/ew-orchestrate/references/goal.md +51 -0
  301. package/skills/ew-orchestrate/references/orchestrator-run-loop.md +33 -0
  302. package/skills/ew-orchestrate/references/planning.md +54 -0
  303. package/skills/ew-orchestrate/steps/ew-analyze/SKILL.md +70 -0
  304. package/skills/ew-orchestrate/steps/ew-analyze/references/issue-gaps-analyze.md +24 -0
  305. package/skills/ew-orchestrate/steps/ew-analyze/references/prepare.md +8 -0
  306. package/skills/ew-orchestrate/steps/ew-analyze/references/workflow.md +138 -0
  307. package/skills/ew-orchestrate/steps/ew-auto-test/SKILL.md +80 -0
  308. package/skills/ew-orchestrate/steps/ew-auto-test/references/prepare.md +23 -0
  309. package/skills/ew-orchestrate/steps/ew-auto-test/references/workflow.md +31 -0
  310. package/skills/ew-orchestrate/steps/ew-blueprint/SKILL.md +122 -0
  311. package/skills/ew-orchestrate/steps/ew-blueprint/references/prepare.md +21 -0
  312. package/skills/ew-orchestrate/steps/ew-blueprint/references/workflow.md +28 -0
  313. package/skills/ew-orchestrate/steps/ew-brainstorm/SKILL.md +49 -0
  314. package/skills/ew-orchestrate/steps/ew-companion/SKILL.md +50 -0
  315. package/skills/ew-orchestrate/steps/ew-debug/SKILL.md +85 -0
  316. package/skills/ew-orchestrate/steps/ew-debug/references/prepare.md +27 -0
  317. package/skills/ew-orchestrate/steps/ew-debug/references/workflow.md +31 -0
  318. package/skills/ew-orchestrate/steps/ew-execute/SKILL.md +74 -0
  319. package/skills/ew-orchestrate/steps/ew-execute/references/prepare.md +27 -0
  320. package/skills/ew-orchestrate/steps/ew-execute/references/workflow.md +87 -0
  321. package/skills/ew-orchestrate/steps/ew-grill/SKILL.md +62 -0
  322. package/skills/ew-orchestrate/steps/ew-grill/references/prepare.md +26 -0
  323. package/skills/ew-orchestrate/steps/ew-grill/references/workflow.md +31 -0
  324. package/skills/ew-orchestrate/steps/ew-init/SKILL.md +56 -0
  325. package/skills/ew-orchestrate/steps/ew-init/references/prepare.md +25 -0
  326. package/skills/ew-orchestrate/steps/ew-init/references/workflow.md +28 -0
  327. package/skills/ew-orchestrate/steps/ew-plan/SKILL.md +131 -0
  328. package/skills/ew-orchestrate/steps/ew-plan/references/prepare.md +8 -0
  329. package/skills/ew-orchestrate/steps/ew-plan/references/tdd.md +53 -0
  330. package/skills/ew-orchestrate/steps/ew-plan/references/workflow.md +100 -0
  331. package/skills/ew-orchestrate/steps/ew-retrospective/SKILL.md +68 -0
  332. package/skills/ew-orchestrate/steps/ew-retrospective/references/prepare.md +18 -0
  333. package/skills/ew-orchestrate/steps/ew-retrospective/references/workflow.md +34 -0
  334. package/skills/ew-orchestrate/steps/ew-review/SKILL.md +45 -0
  335. package/skills/ew-orchestrate/steps/ew-review/references/prepare.md +17 -0
  336. package/skills/ew-orchestrate/steps/ew-review/references/workflow.md +116 -0
  337. package/skills/ew-orchestrate/steps/ew-roadmap/SKILL.md +62 -0
  338. package/skills/ew-orchestrate/steps/ew-roadmap/references/prepare.md +27 -0
  339. package/skills/ew-orchestrate/steps/ew-roadmap/references/workflow.md +28 -0
  340. package/skills/ew-orchestrate/steps/ew-test/SKILL.md +99 -0
  341. package/skills/ew-orchestrate/steps/ew-test/references/prepare.md +23 -0
  342. package/skills/ew-orchestrate/steps/ew-test/references/workflow.md +23 -0
  343. package/skills/ew-orchestrate/steps/ew-verify/SKILL.md +73 -0
  344. package/skills/ew-orchestrate/steps/ew-verify/references/prepare.md +21 -0
  345. package/skills/ew-orchestrate/steps/ew-verify/references/workflow.md +29 -0
  346. package/skills/ew-skill-design/SKILL.md +30 -0
  347. package/skills/ew-skill-design/references/package-contract.md +40 -0
  348. package/skills/ew-skill-design/references/validation.md +21 -0
  349. package/skills/team-swarm/SKILL.md +68 -0
  350. package/skills/team-swarm/references/mcp-coordination.md +14 -0
  351. package/skills/team-swarm/roles/analyst/role.md +181 -0
  352. package/skills/team-swarm/roles/ant/role.md +149 -0
  353. package/skills/team-swarm/roles/coordinator/commands/converge.md +112 -0
  354. package/skills/team-swarm/roles/coordinator/commands/init-swarm.md +136 -0
  355. package/skills/team-swarm/roles/coordinator/commands/iterate.md +171 -0
  356. package/skills/team-swarm/roles/coordinator/role.md +170 -0
  357. package/skills/team-swarm/roles/scorer/role.md +150 -0
  358. package/skills/team-swarm/scripts/aco.py +646 -0
  359. package/skills/team-swarm/scripts/pheromone.py +144 -0
  360. package/skills/team-swarm/scripts/scoring.py +111 -0
  361. package/skills/team-swarm/scripts/test_aco.py +606 -0
  362. package/skills/team-swarm/specs/ant-output-schema.md +127 -0
  363. package/skills/team-swarm/specs/convergence-criteria.md +108 -0
  364. package/skills/team-swarm/specs/pheromone-schema.md +125 -0
  365. package/skills/team-swarm/specs/swarm-config-template.json +71 -0
  366. package/skills/team-swarm/specs/swarm-protocol.md +119 -0
  367. package/skills/workflow-evolve/SKILL.md +64 -0
  368. package/skills/workflow-evolve/references/agy-gate.md +27 -0
  369. package/skills/workflow-evolve/references/auto-loop.md +23 -0
  370. package/skills/workflow-evolve/references/history-review.md +15 -0
  371. package/skills/workflow-evolve/scripts/codex-memory-replay.mjs +86 -0
  372. package/skills/workflow-evolve/scripts/codex-replay.mjs +1 -0
  373. package/skills/workflow-evolve/scripts/evolve-loop.mjs +260 -0
  374. package/skills/workflow-evolve/scripts/memory-codex-mcp.mjs +124 -0
  375. package/workflows/index.json +33 -0
@@ -0,0 +1,51 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * CLI helper: discard pending manual edits from the buffer without applying.
4
+ *
5
+ * Reads .impeccable/live/pending-manual-edits.json, drops entries, writes back.
6
+ * No source-file writes. Use this when the user wants to throw away unsaved
7
+ * manual edits.
8
+ *
9
+ * Trigger: only when the user explicitly asks the AI to discard / throw away /
10
+ * clear pending manual edits.
11
+ *
12
+ * Usage:
13
+ * node live-discard-manual-edits.mjs # discard all pending
14
+ * node live-discard-manual-edits.mjs --page-url=/ # discard only entries for "/"
15
+ *
16
+ * Output JSON: { discarded: N, entries: [...discardedEntries], totalCount: N }
17
+ */
18
+
19
+ import { readBuffer, removeEntries, truncateBuffer } from './live/manual-edits-buffer.mjs';
20
+
21
+ function argVal(args, name) {
22
+ const prefix = name + '=';
23
+ for (const a of args) {
24
+ if (a === name) return true;
25
+ if (a.startsWith(prefix)) return a.slice(prefix.length);
26
+ }
27
+ return null;
28
+ }
29
+
30
+ const args = process.argv.slice(2);
31
+ if (args.includes('--help') || args.includes('-h')) {
32
+ console.log('Usage: node live-discard-manual-edits.mjs [--page-url=<url>]');
33
+ process.exit(0);
34
+ }
35
+
36
+ const pageUrlFilter = argVal(args, '--page-url');
37
+ const cwd = process.cwd();
38
+
39
+ let discarded;
40
+ let entries;
41
+ const buffer = readBuffer(cwd);
42
+ if (pageUrlFilter) {
43
+ entries = buffer.entries.filter((entry) => entry.pageUrl === pageUrlFilter);
44
+ discarded = removeEntries(cwd, (entry) => entry.pageUrl === pageUrlFilter);
45
+ } else {
46
+ entries = buffer.entries;
47
+ discarded = truncateBuffer(cwd);
48
+ }
49
+
50
+ const remaining = readBuffer(cwd).entries.reduce((n, e) => n + e.ops.length, 0);
51
+ console.log(JSON.stringify({ discarded, entries, totalCount: remaining }));
@@ -0,0 +1,463 @@
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
+ * Framework knowledge lives in `live/frameworks/` — detection order, adapters,
11
+ * the generic tag strategy, and the per-extension authoring traits live-wrap
12
+ * reads. This file is the CLI around it: resolve config, resolve the
13
+ * framework, heal orphaned artifacts, apply or remove, record the journal.
14
+ *
15
+ * Usage:
16
+ * node live-inject.mjs --port PORT [--token TOKEN] # Insert the live script tag
17
+ * node live-inject.mjs --remove # Remove the live script tag
18
+ * node live-inject.mjs --check # Check whether live config exists
19
+ *
20
+ * When --token is supplied, it is appended to the /live.js src as `?token=...`
21
+ * so the server's token-gated /live.js handler will serve the bundle. Omitting
22
+ * the token yields a bare `/live.js` src (legacy behavior; the server returns
23
+ * 401 for it under the current gate).
24
+ */
25
+
26
+ import fs from 'node:fs';
27
+ import path from 'node:path';
28
+ import { fileURLToPath } from 'node:url';
29
+ import { resolveLiveConfigPath } from './lib/impeccable-paths.mjs';
30
+ import { livePathGlobToRegex } from './lib/live-path-globs.mjs';
31
+ import {
32
+ describeInjectArtifacts,
33
+ frameworkIgnorePatterns,
34
+ resolveFramework,
35
+ resolveSourceTraits,
36
+ } from './live/frameworks/index.mjs';
37
+ import {
38
+ clearInjectJournal,
39
+ healInjectJournal,
40
+ recordInjection,
41
+ } from './live/frameworks/journal.mjs';
42
+ import {
43
+ buildTagBlock,
44
+ insertTag,
45
+ patchCspMeta,
46
+ removeTag,
47
+ revertCspMeta,
48
+ } from './live/frameworks/tag-strategy.mjs';
49
+ import { buildLiveScriptSrc } from './live/frameworks/script-src.mjs';
50
+ import { enterLiveRoot } from './live/roots.mjs';
51
+
52
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
53
+ // Resolved lazily so the enterLiveRoot() chdir in the CLI guard below takes
54
+ // effect first; module scope runs before the guard.
55
+ let CONFIG_PATH_CACHED = null;
56
+ function CONFIG_PATH_GET() {
57
+ if (!CONFIG_PATH_CACHED) {
58
+ CONFIG_PATH_CACHED = resolveLiveConfigPath({ cwd: process.cwd(), scriptsDir: __dirname });
59
+ }
60
+ return CONFIG_PATH_CACHED;
61
+ }
62
+ const IGNORE_MARKER_OPEN = '# impeccable-live-ignore-start';
63
+ const IGNORE_MARKER_CLOSE = '# impeccable-live-ignore-end';
64
+
65
+ export const LIVE_IGNORE_PATTERNS = Object.freeze([
66
+ '.impeccable/hook.cache.json',
67
+ '.impeccable/hook.pending.json',
68
+ '.impeccable/config.local.json',
69
+ '.impeccable/live/server.json',
70
+ '.impeccable/live/roots.json',
71
+ '.impeccable/live/app-root.json',
72
+ '.impeccable/live/inject-journal.json',
73
+ '.impeccable/live/sessions/',
74
+ '.impeccable/live/previews/',
75
+ '.impeccable/live/annotations/',
76
+ '.impeccable/live/artifacts/',
77
+ '.impeccable/live/accept-receipts/',
78
+ '.impeccable/live/locks/',
79
+ '.impeccable/live/cache/',
80
+ '.impeccable/live/manual-edit-apply-transaction.json',
81
+ '.impeccable/live/manual-edit-events.jsonl',
82
+ '.impeccable/live/manual-edit-evidence/',
83
+ '.impeccable/live/pending-manual-edits.json',
84
+ '.impeccable/live/deferred-svelte-component-accepts.json',
85
+ '.impeccable-live.json',
86
+ '.impeccable-live/',
87
+ 'app/.impeccable-live/',
88
+ 'src/.impeccable-live/',
89
+ 'node_modules/.impeccable-live/',
90
+ 'src/lib/impeccable/ImpeccableLiveRoot.svelte',
91
+ 'src/lib/impeccable/__runtime.js',
92
+ 'src/lib/impeccable/[0-9a-f]*/',
93
+ 'plugins/impeccable-live.client.ts',
94
+ 'app/plugins/impeccable-live.client.ts',
95
+ 'src/plugins/impeccable-live.client.ts',
96
+ ]);
97
+
98
+ /**
99
+ * Hard-excluded directory patterns. These are NEVER user-facing pages and
100
+ * matching them would silently inject tracking scripts into third-party
101
+ * code. The user cannot turn these off via config — they are the floor.
102
+ */
103
+ const HARD_EXCLUDES = [
104
+ '**/node_modules/**',
105
+ '**/.git/**',
106
+ ];
107
+
108
+ export async function injectCli() {
109
+ const args = process.argv.slice(2);
110
+
111
+ if (args.includes('--help') || args.includes('-h')) {
112
+ console.log(`Usage: node live-inject.mjs [options]
113
+
114
+ Insert or remove the live mode script tag in the project's HTML entry point.
115
+ Reads configuration from .impeccable/live/config.json.
116
+
117
+ Modes:
118
+ --port PORT Insert script tag pointing at http://localhost:PORT/live.js
119
+ --remove Remove the script tag (if present)
120
+ --check Print whether .impeccable/live/config.json exists and its content
121
+
122
+ Output (JSON):
123
+ { ok, file, inserted|removed, config? }`);
124
+ process.exit(0);
125
+ }
126
+
127
+ if (args.includes('--check')) {
128
+ // Deliberately read-only: --check runs from status paths and must never
129
+ // mutate the tree. Journal reconciliation happens on the inject run.
130
+ if (!fs.existsSync(CONFIG_PATH_GET())) {
131
+ console.log(JSON.stringify({ ok: false, error: 'config_missing', path: CONFIG_PATH_GET() }));
132
+ process.exit(0);
133
+ }
134
+ let cfg;
135
+ try {
136
+ cfg = JSON.parse(fs.readFileSync(CONFIG_PATH_GET(), 'utf-8'));
137
+ } catch (err) {
138
+ console.log(JSON.stringify({ ok: false, error: 'config_invalid', message: err.message, path: CONFIG_PATH_GET() }));
139
+ return;
140
+ }
141
+ try {
142
+ validateConfig(cfg);
143
+ } catch (err) {
144
+ console.log(JSON.stringify({ ok: false, error: 'config_invalid', message: err.message, path: CONFIG_PATH_GET() }));
145
+ return;
146
+ }
147
+ console.log(JSON.stringify({ ok: true, config: cfg, path: CONFIG_PATH_GET() }));
148
+ return;
149
+ }
150
+
151
+ // Load config
152
+ if (!fs.existsSync(CONFIG_PATH_GET())) {
153
+ console.error(JSON.stringify({ ok: false, error: 'config_missing', path: CONFIG_PATH_GET() }));
154
+ process.exit(1);
155
+ }
156
+ const config = JSON.parse(fs.readFileSync(CONFIG_PATH_GET(), 'utf-8'));
157
+ validateConfig(config);
158
+
159
+ const cwd = process.cwd();
160
+ const resolvedFiles = resolveFiles(cwd, config);
161
+ const resolved = resolveFramework(cwd, config);
162
+ const isAdapter = resolved?.framework.inject.kind === 'adapter';
163
+
164
+ if (args.includes('--remove')) {
165
+ if (isAdapter) {
166
+ const adapterResult = resolved.framework.inject.remove({ cwd, config, project: resolved.project });
167
+ const ok = !(adapterResult && adapterResult.error);
168
+ // Anything the adapter could not reach (its detection may have shifted
169
+ // since the session started) is still on the journal.
170
+ const { healed } = healInjectJournal(cwd);
171
+ clearInjectJournal(cwd);
172
+ console.log(JSON.stringify({
173
+ ok,
174
+ adapter: resolved.framework.name,
175
+ results: [adapterResult],
176
+ healed: healed.length ? healed : undefined,
177
+ }));
178
+ if (!ok) process.exitCode = 1;
179
+ return;
180
+ }
181
+ const results = resolvedFiles.map((relFile) => {
182
+ const absFile = path.resolve(cwd, relFile);
183
+ if (!fs.existsSync(absFile)) return { file: relFile, error: 'file_not_found' };
184
+ const content = fs.readFileSync(absFile, 'utf-8');
185
+ const detagged = removeTag(content, config.commentSyntax);
186
+ const updated = revertCspMeta(detagged);
187
+ if (updated === content) return { file: relFile, removed: false, note: 'no tag present' };
188
+ fs.writeFileSync(absFile, updated, 'utf-8');
189
+ return {
190
+ file: relFile,
191
+ removed: detagged !== content,
192
+ cspReverted: updated !== detagged,
193
+ };
194
+ });
195
+ const { healed } = healInjectJournal(cwd);
196
+ clearInjectJournal(cwd);
197
+ console.log(JSON.stringify({ ok: true, results, healed: healed.length ? healed : undefined }));
198
+ return;
199
+ }
200
+
201
+ // Insert mode — need --port
202
+ const portIdx = args.indexOf('--port');
203
+ const port = portIdx !== -1 ? parseInt(args[portIdx + 1], 10) : NaN;
204
+ if (!Number.isFinite(port)) {
205
+ console.error(JSON.stringify({ ok: false, error: 'missing_port' }));
206
+ process.exit(1);
207
+ }
208
+ // Optional server token: appended to the /live.js src so the token-gated
209
+ // /live.js handler authorizes the browser fetch. `live.mjs` always passes
210
+ // it; a manual `--port`-only invocation reads the running helper's token
211
+ // from server.json instead of writing an unauthenticated URL that 401s.
212
+ const tokenIdx = args.indexOf('--token');
213
+ let token = tokenIdx !== -1 ? args[tokenIdx + 1] : undefined;
214
+ if (!token) {
215
+ try {
216
+ const info = JSON.parse(fs.readFileSync(path.join(cwd, '.impeccable', 'live', 'server.json'), 'utf-8'));
217
+ // A record for a DIFFERENT port is a stale or foreign helper; its token
218
+ // would 401 just the same, so only adopt a matching one.
219
+ if (info?.token && Number(info.port) === port) token = info.token;
220
+ } catch { /* no running helper recorded; keep legacy tokenless behavior */ }
221
+ }
222
+
223
+ // Reconcile before writing anything. Artifacts this run is about to own are
224
+ // kept (so a repeat inject stays byte-idempotent); artifacts left behind by
225
+ // a session that never got to stop are healed.
226
+ const plannedArtifacts = describeInjectArtifacts(resolved, { cwd, files: resolvedFiles });
227
+ const { healed } = healInjectJournal(cwd, { keep: plannedArtifacts.map((a) => a.path) });
228
+
229
+ const gitIgnore = ensureLiveGitIgnores(cwd, frameworkIgnorePatterns(resolved));
230
+ // In a nested-app repo the roots pointer lives at the REPO root, outside the
231
+ // reach of the appRoot-relative ignore block above; give that directory its
232
+ // own local excludes so the pointer (absolute host paths) never gets staged.
233
+ try {
234
+ const rootsManifest = JSON.parse(fs.readFileSync(path.join(cwd, '.impeccable', 'live', 'roots.json'), 'utf-8'));
235
+ if (rootsManifest?.repoRoot && path.resolve(rootsManifest.repoRoot) !== path.resolve(cwd)) {
236
+ ensureLiveGitIgnores(rootsManifest.repoRoot);
237
+ }
238
+ } catch { /* no manifest: single-root project */ }
239
+
240
+ if (isAdapter) {
241
+ const adapterResult = resolved.framework.inject.apply({
242
+ cwd,
243
+ port,
244
+ token,
245
+ config,
246
+ project: resolved.project,
247
+ });
248
+ const ok = !(adapterResult && adapterResult.error);
249
+ if (ok) recordInjection(cwd, { framework: resolved.framework.name, port, artifacts: plannedArtifacts });
250
+ console.log(JSON.stringify({
251
+ ok,
252
+ port,
253
+ adapter: resolved.framework.name,
254
+ gitIgnore,
255
+ results: [adapterResult],
256
+ healed: healed.length ? healed : undefined,
257
+ }));
258
+ if (!ok) process.exitCode = 1;
259
+ return;
260
+ }
261
+
262
+ const results = resolvedFiles.map((relFile) => {
263
+ const absFile = path.resolve(cwd, relFile);
264
+ if (!fs.existsSync(absFile)) return { file: relFile, error: 'file_not_found' };
265
+ const content = fs.readFileSync(absFile, 'utf-8');
266
+ const withoutOld = revertCspMeta(removeTag(content, config.commentSyntax));
267
+ // Per-file, not per-project: a Vite app can hold an .astro partial, and a
268
+ // framework project's entry template is often plain HTML.
269
+ const scriptAttrs = resolveSourceTraits(relFile).injectScriptAttrs;
270
+ const withTag = insertTag(withoutOld, config, port, token, scriptAttrs);
271
+ if (withTag === withoutOld) {
272
+ return { file: relFile, error: 'insertion_point_not_found', anchor: config.insertBefore || config.insertAfter };
273
+ }
274
+ const updated = patchCspMeta(withTag, port);
275
+ fs.writeFileSync(absFile, updated, 'utf-8');
276
+ return {
277
+ file: relFile,
278
+ inserted: true,
279
+ cspPatched: updated !== withTag,
280
+ };
281
+ });
282
+ const anyInserted = results.some((r) => r.inserted);
283
+ const writtenFiles = new Set(results.filter((r) => r.inserted).map((r) => r.file));
284
+ recordInjection(cwd, {
285
+ framework: resolved?.framework.name,
286
+ port,
287
+ artifacts: plannedArtifacts.filter((a) => writtenFiles.has(a.path)),
288
+ });
289
+ console.log(JSON.stringify({
290
+ ok: anyInserted,
291
+ port,
292
+ gitIgnore,
293
+ results,
294
+ healed: healed.length ? healed : undefined,
295
+ }));
296
+ if (!anyInserted) process.exit(1);
297
+ }
298
+
299
+ export function ensureLiveGitIgnores(cwd = process.cwd(), extraPatterns = []) {
300
+ const target = resolveIgnoreTarget(cwd);
301
+ const existing = fs.existsSync(target.path) ? fs.readFileSync(target.path, 'utf-8') : '';
302
+ const block = [
303
+ IGNORE_MARKER_OPEN,
304
+ ...new Set([...LIVE_IGNORE_PATTERNS, ...extraPatterns]),
305
+ IGNORE_MARKER_CLOSE,
306
+ ].join('\n');
307
+ const markerRe = new RegExp(`${escapeRegExp(IGNORE_MARKER_OPEN)}[\\s\\S]*?${escapeRegExp(IGNORE_MARKER_CLOSE)}`);
308
+
309
+ let updated;
310
+ if (markerRe.test(existing)) {
311
+ updated = existing.replace(markerRe, block);
312
+ } else {
313
+ const prefix = existing.length === 0 ? '' : existing.endsWith('\n') ? existing : existing + '\n';
314
+ updated = `${prefix}${prefix.endsWith('\n\n') || prefix === '' ? '' : '\n'}${block}\n`;
315
+ }
316
+
317
+ if (updated !== existing) {
318
+ fs.mkdirSync(path.dirname(target.path), { recursive: true });
319
+ fs.writeFileSync(target.path, updated, 'utf-8');
320
+ }
321
+
322
+ return {
323
+ file: path.relative(cwd, target.path).split(path.sep).join('/'),
324
+ mode: target.mode,
325
+ changed: updated !== existing,
326
+ patterns: [...new Set([...LIVE_IGNORE_PATTERNS, ...extraPatterns])],
327
+ };
328
+ }
329
+
330
+ function resolveIgnoreTarget(cwd) {
331
+ const gitExcludePath = resolveGitInfoExcludePath(cwd);
332
+ if (gitExcludePath) {
333
+ return { path: gitExcludePath, mode: 'git-info-exclude' };
334
+ }
335
+ return { path: path.join(cwd, '.gitignore'), mode: 'gitignore' };
336
+ }
337
+
338
+ function resolveGitInfoExcludePath(cwd) {
339
+ const dotGit = path.join(cwd, '.git');
340
+ if (!fs.existsSync(dotGit)) return null;
341
+
342
+ const stat = fs.statSync(dotGit);
343
+ if (stat.isDirectory()) return path.join(dotGit, 'info', 'exclude');
344
+ if (!stat.isFile()) return null;
345
+
346
+ const body = fs.readFileSync(dotGit, 'utf-8').trim();
347
+ const match = body.match(/^gitdir:\s*(.+)$/i);
348
+ if (!match) return null;
349
+ const gitDir = path.isAbsolute(match[1]) ? match[1] : path.resolve(cwd, match[1]);
350
+ return path.join(gitDir, 'info', 'exclude');
351
+ }
352
+
353
+ function escapeRegExp(value) {
354
+ return String(value).replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
355
+ }
356
+
357
+ /**
358
+ * Expand config.files (which may contain glob patterns) into a literal list
359
+ * of existing file paths relative to rootDir. Literal entries pass through;
360
+ * glob patterns are expanded via fs.globSync. HARD_EXCLUDES and config.exclude
361
+ * are applied as filters. Duplicates are removed. Order is preserved by
362
+ * first appearance.
363
+ */
364
+ export function resolveFiles(rootDir, config) {
365
+ const patterns = config.files;
366
+ const userExcludes = Array.isArray(config.exclude) ? config.exclude : [];
367
+ const allExcludes = [...HARD_EXCLUDES, ...userExcludes];
368
+ const excludeRegexes = allExcludes.map(livePathGlobToRegex);
369
+
370
+ const isExcluded = (relPath) => excludeRegexes.some((re) => re.test(relPath));
371
+ const isGlob = (s) => /[*?[]/.test(s);
372
+
373
+ const seen = new Set();
374
+ const out = [];
375
+ for (const pat of patterns) {
376
+ if (!isGlob(pat)) {
377
+ // Literal path — include even if it doesn't exist yet; the caller
378
+ // reports file_not_found per-entry. Exclude list doesn't apply to
379
+ // explicit literal entries (user named it on purpose).
380
+ if (!seen.has(pat)) {
381
+ seen.add(pat);
382
+ out.push(pat);
383
+ }
384
+ continue;
385
+ }
386
+ let matches;
387
+ try {
388
+ matches = fs.globSync(pat, { cwd: rootDir, withFileTypes: true });
389
+ } catch {
390
+ continue;
391
+ }
392
+ for (const ent of matches) {
393
+ if (!ent.isFile || !ent.isFile()) continue;
394
+ const abs = path.join(ent.parentPath || ent.path || rootDir, ent.name);
395
+ const rel = path.relative(rootDir, abs).split(path.sep).join('/');
396
+ if (isExcluded(rel)) continue;
397
+ if (seen.has(rel)) continue;
398
+ seen.add(rel);
399
+ out.push(rel);
400
+ }
401
+ }
402
+ return out;
403
+ }
404
+
405
+ // ---------------------------------------------------------------------------
406
+ // Core operations
407
+ // ---------------------------------------------------------------------------
408
+
409
+ function validateConfig(cfg) {
410
+ if (!cfg || typeof cfg !== 'object') throw new Error('config.json must be an object');
411
+ if (!Array.isArray(cfg.files) || cfg.files.length === 0) {
412
+ throw new Error('config.files (non-empty string array) required');
413
+ }
414
+ if (!cfg.files.every((f) => typeof f === 'string' && f.length > 0)) {
415
+ throw new Error('config.files must contain only non-empty strings');
416
+ }
417
+ if (cfg.exclude !== undefined) {
418
+ if (!Array.isArray(cfg.exclude)) {
419
+ throw new Error('config.exclude, if present, must be a string array');
420
+ }
421
+ if (!cfg.exclude.every((f) => typeof f === 'string' && f.length > 0)) {
422
+ throw new Error('config.exclude must contain only non-empty strings');
423
+ }
424
+ }
425
+ if (typeof cfg.insertBefore !== 'string' && typeof cfg.insertAfter !== 'string') {
426
+ throw new Error('config.insertBefore or config.insertAfter (string) required');
427
+ }
428
+ if (cfg.commentSyntax !== 'html' && cfg.commentSyntax !== 'jsx') {
429
+ throw new Error("config.commentSyntax must be 'html' or 'jsx'");
430
+ }
431
+ if (cfg.cspChecked !== undefined && typeof cfg.cspChecked !== 'boolean') {
432
+ throw new Error("config.cspChecked, if present, must be a boolean");
433
+ }
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
+ enterLiveRoot();
443
+ injectCli();
444
+ }
445
+
446
+ // Re-exported so long-standing importers (live.mjs, the adapter modules, the
447
+ // test suites) keep their entry points while the implementations live in
448
+ // live/frameworks/.
449
+ export {
450
+ buildLiveScriptSrc,
451
+ buildTagBlock,
452
+ insertTag,
453
+ patchCspMeta,
454
+ removeTag,
455
+ revertCspMeta,
456
+ validateConfig,
457
+ };
458
+ export {
459
+ applyNuxtLiveAdapter,
460
+ buildNuxtPlugin,
461
+ detectNuxtProject,
462
+ removeNuxtLiveAdapter,
463
+ } from './live/frameworks/nuxt.mjs';