spell 0.8.7 → 0.8.9

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 (304) hide show
  1. package/README-epics.md +149 -49
  2. package/app/package.json +25 -1
  3. package/app/spaces/@spell/guides/SpellUI/SpellUI.spellml +486 -486
  4. package/app/spaces/@spell/sites/SpellApp/SpellApp.spellml +50 -124
  5. package/dist/app/app/pages/SiteBoardView.css +5 -5
  6. package/dist/app/app/pages/SiteBoardView.js +1 -1
  7. package/dist/app/app/pages/SiteEditorPage.js +6 -3
  8. package/dist/app/app/pages/SiteEdits.js +27 -10
  9. package/dist/app/app/pages/SiteWrites.js +11 -0
  10. package/dist/app/app/runner/spellRuntime.js +1 -0
  11. package/dist/cli/publish/PublishedPackage.d.ts +2 -1
  12. package/dist/cli/publish/PublishedPackage.js +6 -3
  13. package/dist/cli/publish/ScratchInstall.d.ts +14 -3
  14. package/dist/cli/publish/ScratchInstall.js +69 -8
  15. package/dist/epic/cli/EpicProgram.js +20 -5
  16. package/dist/epic/cli/epicGroups.js +7 -1
  17. package/dist/epic/command/BaseBranch.d.ts +35 -0
  18. package/dist/epic/command/BaseBranch.js +58 -0
  19. package/dist/epic/command/EpicCheckout.d.ts +1 -1
  20. package/dist/epic/command/EpicCheckout.js +4 -4
  21. package/dist/epic/command/EpicGuide.js +3 -2
  22. package/dist/epic/command/EpicTools.d.ts +5 -0
  23. package/dist/epic/command/EpicTools.js +14 -3
  24. package/dist/epic/command/MainMerge.d.ts +26 -15
  25. package/dist/epic/command/MainMerge.js +60 -16
  26. package/dist/epic/command/PullRequest.d.ts +45 -0
  27. package/dist/epic/command/PullRequest.js +100 -0
  28. package/dist/epic/command/RepoInit.d.ts +196 -39
  29. package/dist/epic/command/RepoInit.js +481 -60
  30. package/dist/epic/command/Requests.d.ts +1 -0
  31. package/dist/epic/command/Requests.js +7 -1
  32. package/dist/epic/command/SessionMoves.js +2 -1
  33. package/dist/epic/command/SkillsCheck.js +3 -2
  34. package/dist/epic/command/Stock.js +3 -1
  35. package/dist/epic/command/TurnEnd.d.ts +1 -1
  36. package/dist/epic/command/TurnEnd.js +4 -3
  37. package/dist/epic/command/Worktrees.d.ts +20 -3
  38. package/dist/epic/command/Worktrees.js +39 -7
  39. package/dist/epic/command/command.types.d.ts +3 -0
  40. package/dist/epic/components/__pack/epics.entry.js +43 -43
  41. package/dist/epic/components/__pack/epics.pack.js +36 -12794
  42. package/dist/epic/config/CodeHost.d.ts +96 -0
  43. package/dist/epic/config/CodeHost.js +89 -0
  44. package/dist/epic/config/EngineFiles.mjs +60 -0
  45. package/dist/epic/config/EpicConfig.d.ts +20 -3
  46. package/dist/epic/config/EpicConfig.js +25 -1
  47. package/dist/epic/config/EpicRepo.js +1 -1
  48. package/dist/epic/config/GitHub.d.ts +75 -3
  49. package/dist/epic/config/GitHub.js +106 -5
  50. package/dist/epic/config/GitLab.d.ts +138 -0
  51. package/dist/epic/config/GitLab.js +297 -0
  52. package/dist/epic/config/LayeredSettings.js +3 -2
  53. package/dist/epic/server/EpicServer.d.ts +1 -1
  54. package/dist/epic/server/EpicServer.js +26 -12
  55. package/dist/epic/tool/InboxPoller.mjs +2 -1
  56. package/dist/epic/tool/MigrateCommands.js +6 -8
  57. package/dist/epic/tool/PlanCommits.d.ts +7 -4
  58. package/dist/epic/tool/PlanCommits.js +7 -5
  59. package/dist/epic/tool/PlanDocCommands.js +3 -4
  60. package/dist/epic/tool/PlanDocFiles.d.ts +3 -1
  61. package/dist/epic/tool/PlanDocFiles.js +13 -5
  62. package/dist/epic/tool/ServedFolders.d.ts +1 -1
  63. package/dist/epic/tool/ServedFolders.js +4 -4
  64. package/dist/epic/tools/PageInboxes.js +3 -3
  65. package/dist/epic/tools/_assets/commands.entry.js +149 -68
  66. package/dist/epic/tools/_assets/commands.js +20 -2073
  67. package/dist/epic/tools/_assets/core-reference.entry.js +244 -124
  68. package/dist/epic/tools/_assets/core-reference.js +20 -2142
  69. package/dist/epic/tools/_assets/emoji/cldr/0.js +2 -2
  70. package/dist/epic/tools/_assets/emoji/cldr/a.js +2 -2
  71. package/dist/epic/tools/_assets/emoji/cldr/b.js +2 -2
  72. package/dist/epic/tools/_assets/emoji/cldr/c.js +2 -2
  73. package/dist/epic/tools/_assets/emoji/cldr/d.js +2 -2
  74. package/dist/epic/tools/_assets/emoji/cldr/e.js +2 -2
  75. package/dist/epic/tools/_assets/emoji/cldr/f.js +2 -2
  76. package/dist/epic/tools/_assets/emoji/cldr/g.js +2 -2
  77. package/dist/epic/tools/_assets/emoji/cldr/h.js +2 -2
  78. package/dist/epic/tools/_assets/emoji/cldr/i.js +2 -2
  79. package/dist/epic/tools/_assets/emoji/cldr/j.js +2 -2
  80. package/dist/epic/tools/_assets/emoji/cldr/k.js +2 -2
  81. package/dist/epic/tools/_assets/emoji/cldr/l.js +2 -2
  82. package/dist/epic/tools/_assets/emoji/cldr/m.js +2 -2
  83. package/dist/epic/tools/_assets/emoji/cldr/n.js +2 -2
  84. package/dist/epic/tools/_assets/emoji/cldr/o.js +2 -2
  85. package/dist/epic/tools/_assets/emoji/cldr/p.js +2 -2
  86. package/dist/epic/tools/_assets/emoji/cldr/r.js +2 -2
  87. package/dist/epic/tools/_assets/emoji/cldr/s.js +2 -2
  88. package/dist/epic/tools/_assets/emoji/cldr/t.js +2 -2
  89. package/dist/epic/tools/_assets/emoji/cldr/u.js +2 -2
  90. package/dist/epic/tools/_assets/emoji/cldr/v.js +2 -2
  91. package/dist/epic/tools/_assets/emoji/cldr/w.js +2 -2
  92. package/dist/epic/tools/_assets/emoji/cldr/x.js +2 -2
  93. package/dist/epic/tools/_assets/emoji/cldr/y.js +2 -2
  94. package/dist/epic/tools/_assets/emoji/cldr/z.js +2 -2
  95. package/dist/epic/tools/_assets/emoji/fomantic/0.js +2 -2
  96. package/dist/epic/tools/_assets/emoji/fomantic/a.js +2 -2
  97. package/dist/epic/tools/_assets/emoji/fomantic/b.js +2 -2
  98. package/dist/epic/tools/_assets/emoji/fomantic/c.js +2 -2
  99. package/dist/epic/tools/_assets/emoji/fomantic/d.js +2 -2
  100. package/dist/epic/tools/_assets/emoji/fomantic/e.js +2 -2
  101. package/dist/epic/tools/_assets/emoji/fomantic/f.js +2 -2
  102. package/dist/epic/tools/_assets/emoji/fomantic/g.js +2 -2
  103. package/dist/epic/tools/_assets/emoji/fomantic/h.js +2 -2
  104. package/dist/epic/tools/_assets/emoji/fomantic/i.js +2 -2
  105. package/dist/epic/tools/_assets/emoji/fomantic/j.js +2 -2
  106. package/dist/epic/tools/_assets/emoji/fomantic/k.js +2 -2
  107. package/dist/epic/tools/_assets/emoji/fomantic/l.js +2 -2
  108. package/dist/epic/tools/_assets/emoji/fomantic/m.js +2 -2
  109. package/dist/epic/tools/_assets/emoji/fomantic/n.js +2 -2
  110. package/dist/epic/tools/_assets/emoji/fomantic/o.js +2 -2
  111. package/dist/epic/tools/_assets/emoji/fomantic/p.js +2 -2
  112. package/dist/epic/tools/_assets/emoji/fomantic/q.js +2 -2
  113. package/dist/epic/tools/_assets/emoji/fomantic/r.js +2 -2
  114. package/dist/epic/tools/_assets/emoji/fomantic/s.js +2 -2
  115. package/dist/epic/tools/_assets/emoji/fomantic/t.js +2 -2
  116. package/dist/epic/tools/_assets/emoji/fomantic/u.js +2 -2
  117. package/dist/epic/tools/_assets/emoji/fomantic/v.js +2 -2
  118. package/dist/epic/tools/_assets/emoji/fomantic/w.js +2 -2
  119. package/dist/epic/tools/_assets/emoji/fomantic/x.js +2 -2
  120. package/dist/epic/tools/_assets/emoji/fomantic/y.js +2 -2
  121. package/dist/epic/tools/_assets/emoji/fomantic/z.js +2 -2
  122. package/dist/epic/tools/_assets/goals-live.js +318 -210
  123. package/dist/epic/tools/_assets/highlight.min.js +5764 -5269
  124. package/dist/epic/tools/_assets/lazy/code-engine.js +5 -1270
  125. package/dist/epic/tools/_assets/lazy/markdown-engine.js +67 -1513
  126. package/dist/epic/tools/_assets/lazy/markdown-sanitizer.js +3 -753
  127. package/dist/epic/tools/_assets/spell-comments.entry.js +282 -159
  128. package/dist/epic/tools/_assets/spell-comments.js +24 -3716
  129. package/dist/epic/tools/_assets/spell-doc-comments.js +1243 -816
  130. package/dist/epic/tools/_assets/spell-doc-helpers.js +298 -165
  131. package/dist/epic/tools/_assets/spell-doc-runtime.js +2760 -1415
  132. package/dist/epic/tools/_assets/spell-doc-toolbar.js +396 -227
  133. package/dist/epic/tools/_assets/spell-syntax.entry.js +505 -285
  134. package/dist/epic/tools/_assets/spell-syntax.js +22 -2916
  135. package/dist/epic/tools/_assets/spell-ui-sources.js +102 -60
  136. package/dist/epic/tools/_assets/spell-ui.entry.js +108 -40
  137. package/dist/epic/tools/_assets/spell-ui.js +3131 -46465
  138. package/dist/epic/tools/pages.d.ts +5 -6
  139. package/dist/epic/tools/pages.js +7 -6
  140. package/dist/epic/window.mjs +2 -3
  141. package/dist/parser/core/classes/View.d.ts +20 -0
  142. package/dist/parser/core/classes/View.js +91 -17
  143. package/dist/parser/core/core.declarations.json5 +18 -0
  144. package/dist/parser/core/core.scopes.js +5 -0
  145. package/dist/parser/core/sites.d.ts +10 -0
  146. package/dist/parser/core/sites.js +12 -0
  147. package/dist/parser/parser/tokenizer/Tokenizer.d.ts +9 -1
  148. package/dist/parser/parser/tokenizer/Tokenizer.js +43 -5
  149. package/dist/parser/parser/tokenizer/Tokens.d.ts +4 -0
  150. package/dist/parser/parser/tokenizer/Tokens.js +4 -0
  151. package/dist/parser/parser/tokenizer/tokenizer.types.d.ts +5 -0
  152. package/dist/parser/parser/tokenizer/tokenizer.types.js +2 -0
  153. package/dist/parser/py/core/spell_core/apps.py +2 -0
  154. package/dist/parser/spell/PARSING.md +21 -0
  155. package/dist/parser/spell/SpellParser.d.ts +2 -0
  156. package/dist/parser/spell/SpellParser.js +58 -3
  157. package/dist/parser/spell/SpellxTokenizer.js +2 -1
  158. package/dist/parser/spell/SpellxTwin.d.ts +4 -1
  159. package/dist/parser/spell/SpellxTwin.js +10 -3
  160. package/dist/parser/spell/builtinTypes.js +24 -1
  161. package/dist/parser/spell/ingest/PlaceIngest.js +3 -1
  162. package/dist/parser/spell/languages/Language.d.ts +11 -2
  163. package/dist/parser/spell/languages/en/words.js +3 -2
  164. package/dist/parser/spell/languages/es/words.js +7 -4
  165. package/dist/parser/spell/rules/Statement.js +1 -1
  166. package/dist/parser/spell/rules/classes/DrawSlot.js +6 -1
  167. package/dist/parser/spell/rules/sites/SitePage.d.ts +3 -3
  168. package/dist/parser/spell/rules/sites/SitePage.js +2 -2
  169. package/dist/parser/spell/rules/sites/sites.en.js +1 -1
  170. package/dist/parser/spell/rules/sites/sites.es.js +1 -1
  171. package/dist/parser/spell/rules/sites/sites.shared.d.ts +2 -2
  172. package/dist/parser/spell/spell.types.d.ts +7 -0
  173. package/dist/parser/spell/spellSyntax.es.json +6 -6
  174. package/dist/parser/spell/spellSyntax.json +6 -6
  175. package/dist/parser/spellx/SpellxView.js +2 -1
  176. package/dist/ui/components/ui-accordion/UIAccordion.d.ts +1 -0
  177. package/dist/ui/components/ui-ad/UIAd.d.ts +1 -0
  178. package/dist/ui/components/ui-breadcrumbs/UIBreadcrumb.d.ts +1 -0
  179. package/dist/ui/components/ui-breadcrumbs/UIBreadcrumbs.d.ts +1 -0
  180. package/dist/ui/components/ui-button/UIButton.d.ts +8 -3
  181. package/dist/ui/components/ui-button/UIButton.fallback.d.ts +8 -3
  182. package/dist/ui/components/ui-button/UIButtons.d.ts +1 -0
  183. package/dist/ui/components/ui-button/UIOr.d.ts +1 -0
  184. package/dist/ui/components/ui-calendar/UICalendar.d.ts +6 -0
  185. package/dist/ui/components/ui-calendar/UICalendar.fallback.d.ts +6 -0
  186. package/dist/ui/components/ui-card/UICards.d.ts +31 -0
  187. package/dist/ui/components/ui-checkbox/UICheckbox.d.ts +7 -0
  188. package/dist/ui/components/ui-checkbox/UICheckbox.fallback.d.ts +7 -0
  189. package/dist/ui/components/ui-comment/UIComment.d.ts +1 -0
  190. package/dist/ui/components/ui-comment/UIComments.d.ts +1 -0
  191. package/dist/ui/components/ui-components/UIComponents.d.ts +1 -0
  192. package/dist/ui/components/ui-dimmer/UIDimmer.d.ts +1 -0
  193. package/dist/ui/components/ui-divider/UIDivider.d.ts +2 -0
  194. package/dist/ui/components/ui-dropdown/UIDropdown.d.ts +6 -0
  195. package/dist/ui/components/ui-dropdown/UIDropdown.fallback.d.ts +6 -0
  196. package/dist/ui/components/ui-embed/UIEmbed.d.ts +1 -0
  197. package/dist/ui/components/ui-emoji/UIEmoji.d.ts +1 -0
  198. package/dist/ui/components/ui-feed/UIFeed.d.ts +1 -0
  199. package/dist/ui/components/ui-feed/UIFeedEvent.d.ts +1 -0
  200. package/dist/ui/components/ui-flag/UIFlag.d.ts +1 -0
  201. package/dist/ui/components/ui-flyout/UIFlyout.d.ts +1 -0
  202. package/dist/ui/components/ui-form/UIFields.d.ts +1 -0
  203. package/dist/ui/components/ui-form/UIRepeat.d.ts +1 -0
  204. package/dist/ui/components/ui-grid/UIColumn.d.ts +1 -0
  205. package/dist/ui/components/ui-grid/UIGrid.d.ts +1 -0
  206. package/dist/ui/components/ui-grid/UIRow.d.ts +1 -0
  207. package/dist/ui/components/ui-icon/UIIcon.d.ts +3 -2
  208. package/dist/ui/components/ui-icon/UIIcons.d.ts +1 -0
  209. package/dist/ui/components/ui-icon-picker/UIIconPicker.d.ts +6 -0
  210. package/dist/ui/components/ui-icon-picker/UIIconPicker.fallback.d.ts +6 -0
  211. package/dist/ui/components/ui-image/UIImages.d.ts +1 -0
  212. package/dist/ui/components/ui-include/UIInclude.d.ts +1 -0
  213. package/dist/ui/components/ui-input/UIInput.fallback.d.ts +9 -2
  214. package/dist/ui/components/ui-items/UIItems.d.ts +1 -0
  215. package/dist/ui/components/ui-keys/UIKeys.d.ts +1 -0
  216. package/dist/ui/components/ui-label/UILabel.d.ts +2 -0
  217. package/dist/ui/components/ui-label/UILabels.d.ts +1 -0
  218. package/dist/ui/components/ui-list/UIList.d.ts +2 -0
  219. package/dist/ui/components/ui-loader/UILoader.d.ts +1 -0
  220. package/dist/ui/components/ui-message/UIMessage.d.ts +2 -0
  221. package/dist/ui/components/ui-modal/UIModal.d.ts +1 -0
  222. package/dist/ui/components/ui-nag/UINag.d.ts +1 -0
  223. package/dist/ui/components/ui-page/UIPage.d.ts +15 -0
  224. package/dist/ui/components/ui-page/UIPage.es.d.ts +1 -0
  225. package/dist/ui/components/ui-parts/UIActions.d.ts +1 -0
  226. package/dist/ui/components/ui-parts/UIAuthor.d.ts +1 -0
  227. package/dist/ui/components/ui-parts/UIAvatar.d.ts +1 -0
  228. package/dist/ui/components/ui-parts/UIContent.d.ts +1 -0
  229. package/dist/ui/components/ui-parts/UIDate.d.ts +1 -0
  230. package/dist/ui/components/ui-parts/UIDescription.d.ts +1 -0
  231. package/dist/ui/components/ui-parts/UIDetail.d.ts +1 -0
  232. package/dist/ui/components/ui-parts/UIExtra.d.ts +1 -0
  233. package/dist/ui/components/ui-parts/UIHeader.d.ts +15 -3
  234. package/dist/ui/components/ui-parts/UIHeader.en.d.ts +5 -2
  235. package/dist/ui/components/ui-parts/UIHeader.en.js +6 -3
  236. package/dist/ui/components/ui-parts/UIHeader.js +45 -5
  237. package/dist/ui/components/ui-parts/UIMeta.d.ts +1 -0
  238. package/dist/ui/components/ui-parts/UIParts.css +18 -0
  239. package/dist/ui/components/ui-parts/UIParts.css.inline.js +1 -1
  240. package/dist/ui/components/ui-parts/UIParts.types.d.ts +15 -1
  241. package/dist/ui/components/ui-parts/UISummary.d.ts +1 -0
  242. package/dist/ui/components/ui-parts/UITitle.d.ts +1 -0
  243. package/dist/ui/components/ui-parts/UIValue.d.ts +1 -0
  244. package/dist/ui/components/ui-placeholder/UIPlaceholder.d.ts +1 -0
  245. package/dist/ui/components/ui-placeholder/UIPlaceholderHeader.d.ts +1 -0
  246. package/dist/ui/components/ui-placeholder/UIPlaceholderImage.d.ts +1 -0
  247. package/dist/ui/components/ui-placeholder/UIPlaceholderLine.d.ts +1 -0
  248. package/dist/ui/components/ui-placeholder/UIPlaceholderParagraph.d.ts +1 -0
  249. package/dist/ui/components/ui-progress/UIProgress.d.ts +2 -0
  250. package/dist/ui/components/ui-quote/UIQuote.d.ts +1 -0
  251. package/dist/ui/components/ui-rail/UIRail.d.ts +1 -0
  252. package/dist/ui/components/ui-rating/UIRating.d.ts +6 -0
  253. package/dist/ui/components/ui-rating/UIRating.fallback.d.ts +6 -0
  254. package/dist/ui/components/ui-reveal/UIReveal.d.ts +1 -0
  255. package/dist/ui/components/ui-search/UISearch.fallback.d.ts +13 -1
  256. package/dist/ui/components/ui-section/UISections.d.ts +1 -0
  257. package/dist/ui/components/ui-segment/UISegment.d.ts +2 -0
  258. package/dist/ui/components/ui-segment/UISegments.d.ts +1 -0
  259. package/dist/ui/components/ui-select/UISelect.d.ts +6 -0
  260. package/dist/ui/components/ui-select/UISelect.fallback.d.ts +6 -0
  261. package/dist/ui/components/ui-shape/UISide.d.ts +4 -0
  262. package/dist/ui/components/ui-sidebar/UIPushable.d.ts +1 -0
  263. package/dist/ui/components/ui-sidebar/UIPusher.d.ts +1 -0
  264. package/dist/ui/components/ui-sidebar/UISidebar.d.ts +1 -0
  265. package/dist/ui/components/ui-sides/UISides.d.ts +6 -0
  266. package/dist/ui/components/ui-sides/UISides.fallback.d.ts +6 -0
  267. package/dist/ui/components/ui-slider/UISlider.d.ts +7 -0
  268. package/dist/ui/components/ui-slider/UISlider.fallback.d.ts +7 -0
  269. package/dist/ui/components/ui-space/UISpace.d.ts +1 -0
  270. package/dist/ui/components/ui-statistic/UIStatistic.d.ts +1 -0
  271. package/dist/ui/components/ui-statistic/UIStatistics.d.ts +1 -0
  272. package/dist/ui/components/ui-step/UIStep.d.ts +1 -0
  273. package/dist/ui/components/ui-step/UISteps.d.ts +1 -0
  274. package/dist/ui/components/ui-table/UICell.d.ts +1 -0
  275. package/dist/ui/components/ui-terms/UITerm.d.ts +1 -0
  276. package/dist/ui/components/ui-terms/UITerms.d.ts +1 -0
  277. package/dist/ui/components/ui-theme-editor/UIColorChip.d.ts +1 -0
  278. package/dist/ui/components/ui-theme-editor/UIThemeToken.d.ts +1 -0
  279. package/dist/ui/components/ui-toast/UIToast.d.ts +1 -0
  280. package/dist/ui/components/ui-toc/UIToc.d.ts +1 -0
  281. package/dist/ui/components/ui-transition/UITransition.d.ts +1 -0
  282. package/dist/ui/components/ui-video/UIAudio.d.ts +1 -0
  283. package/dist/ui/components/ui-video/UIVideo.d.ts +1 -0
  284. package/dist/ui/components/ui-visibility/UIVisibility.d.ts +1 -0
  285. package/dist/ui/components/ui-zoom/UIZoom.d.ts +1 -0
  286. package/dist/ui/jsx.d.ts +4 -4
  287. package/dist/ui/vocabulary/defaults.generated.js +1 -1
  288. package/dist/util/spell/constants.js +1 -1
  289. package/epic/.claude-plugin/plugin.json +1 -1
  290. package/epic/.codex-plugin/plugin.json +1 -1
  291. package/epic/hooks/handoff.mjs +4 -3
  292. package/epic/hooks/worktree.mjs +22 -3
  293. package/epic/package.json +41 -2
  294. package/epic/skills/details/SKILL.md +2 -1
  295. package/epic/skills/epic/SKILL.md +7 -1
  296. package/epic/skills/epic/guide.md +3 -0
  297. package/epic/skills/isolate/SKILL.md +53 -20
  298. package/epic/src/AGENTS.md +11 -2
  299. package/epic/templates/durable.html +1 -1
  300. package/epic/vscode/package.json +1 -1
  301. package/epic/vscode/spell-epic.vsix +0 -0
  302. package/package.json +1 -1
  303. package/parser/package.json +1 -1
  304. package/ui/package.json +15 -2
@@ -26,10 +26,11 @@
26
26
  */
27
27
  import { spawn } from "node:child_process"
28
28
  import { existsSync, openSync, readFileSync, renameSync } from "node:fs"
29
- import { dirname, join } from "node:path"
29
+ import { join } from "node:path"
30
+ import { fileURLToPath } from "node:url"
30
31
 
31
- /** The window script, beside this plugin's `hooks/`. */
32
- const SCRIPT = join(dirname(import.meta.dirname), "src", "window.mjs")
32
+ /** The window script: by its package name, so it's the code the plugin depends on, in a checkout or an npm install. */
33
+ const SCRIPT = fileURLToPath(import.meta.resolve("spell/epic/window.mjs"))
33
34
 
34
35
  try {
35
36
  const input = JSON.parse(readFileSync(0, "utf8") || "{}")
@@ -16,6 +16,8 @@
16
16
  * - checked with CLI 2.1.287
17
17
  * - Names agree: worktree `../<repo>.worktrees/<name>`, branch `<name>` (Claude's own adds `worktree-`).
18
18
  * - Branches from the LOCAL base branch (unpushed work included), not `origin/main`.
19
+ * - where it takes only pull requests (`baseBranchProtected`), fast-forwarded from `origin` first when that's safe
20
+ * (`BaseBranch.catchUp()`): nothing else ever moves it there
19
21
  * - The folders and the branch come from the repo's `.epic/config.json5` (`EpicConfig`):
20
22
  * `worktreesFolder`, `baseBranch`, `contentFolder`; a key left out, the repo's own (`EpicConfig.defaultsFor()`).
21
23
  * - `worktreesFolder` BESIDE the repo since epic `epic-eject` P8: new worktrees go there,
@@ -132,14 +134,16 @@ import { basename, dirname, isAbsolute, join, relative, resolve } from "node:pat
132
134
 
133
135
  import { Git } from "spell/server/Git"
134
136
  import { pathInside } from "spell/server/RealPath"
137
+ import { BaseBranch } from "spell/epic/command/BaseBranch.ts"
135
138
  import { CheckoutPatches } from "spell/epic/command/CheckoutPatches.ts"
136
139
  import { CheckoutServers } from "spell/epic/command/CheckoutServers.ts"
137
140
  import { EpicRepo } from "spell/epic/config/EpicRepo.ts"
141
+ import { EngineFiles } from "spell/epic/config/EngineFiles.mjs"
138
142
  import { EpicConfig } from "spell/epic/config/EpicConfig.ts"
139
143
  import { SessionFolders } from "spell/epic/config/SessionFolders.ts"
140
144
 
141
- /** This plugin's `bin/epic`: `hooks/` is beside `bin/`. */
142
- const EPIC = join(dirname(import.meta.dirname), "bin", "epic")
145
+ /** The `epic` command of the code this plugin runs on (`EngineFiles.bin`). */
146
+ const EPIC = EngineFiles.bin
143
147
 
144
148
  /** The main checkout's git-ignored page server settings, copied into a new worktree (`copyLocalServer()`). */
145
149
  const LOCAL_SERVER = "page-server.local.json5"
@@ -231,6 +235,7 @@ class Worktree {
231
235
  return path
232
236
  }
233
237
  const reused = Worktree.hasBranch(root, name)
238
+ if (!reused) Worktree.catchUpBase(root, config)
234
239
  const args = reused ? [path, name] : ["-b", name, path, config.baseBranch]
235
240
  console.error(`worktree hook: git worktree add ${args.join(" ")}`)
236
241
  mkdirSync(dirname(path), { recursive: true })
@@ -287,8 +292,10 @@ class Worktree {
287
292
  console.error(`worktree hook: reusing ${worktree}`)
288
293
  continue
289
294
  }
290
- const base = new EpicConfig(main).baseBranch
295
+ const repoConfig = new EpicConfig(main)
296
+ const base = repoConfig.baseBranch
291
297
  const reused = Worktree.hasBranch(main, name)
298
+ if (!reused) Worktree.catchUpBase(main, repoConfig)
292
299
  const args = reused ? [worktree, name] : ["-b", name, worktree, base]
293
300
  console.error(`worktree hook: ${repo}: git worktree add ${args.join(" ")}`)
294
301
  mkdirSync(dirname(worktree), { recursive: true })
@@ -305,6 +312,18 @@ class Worktree {
305
312
  return path
306
313
  }
307
314
 
315
+ /**
316
+ * A new worktree is cut from the LOCAL base branch: where that takes only pull requests (`baseBranchProtected`),
317
+ * bring it up to date with `origin` first (`BaseBranch.catchUp()`), so the worktree starts from what GitHub merged.
318
+ * - can't, safely (offline, diverged, uncommitted changes): one line on stderr, and the worktree is cut as it is
319
+ * - NEVER throws
320
+ */
321
+ static catchUpBase(root, config) {
322
+ if (!config.baseBranchProtected) return
323
+ const { line } = BaseBranch.catchUp(root, config.baseBranch)
324
+ if (line) console.error(`worktree hook: ${line}`)
325
+ }
326
+
308
327
  /**
309
328
  * Copy main checkout `root`'s `page-server.local.json5` into new worktree `path`, its `projects` made absolute
310
329
  * (epic-engine's P49): the outside projects the page server serves (spell-brand's Brand tab, Q49), which a
package/epic/package.json CHANGED
@@ -1,6 +1,45 @@
1
1
  {
2
2
  "name": "spell-epic",
3
- "version": "0.8.7",
3
+ "version": "0.8.9",
4
4
  "private": true,
5
- "type": "module"
5
+ "type": "module",
6
+ "pageServer": {
7
+ "bundles": [
8
+ "../dist/epic/components/__pack",
9
+ "../dist/epic/tools/_assets"
10
+ ],
11
+ "routes": [
12
+ "../dist/epic/tools/detailsRoutes.js",
13
+ "../dist/epic/tools/choicesRoutes.js",
14
+ "../dist/epic/tools/runRoutes.js",
15
+ "../dist/epic/tools/commentsRoutes.js",
16
+ "../dist/epic/tool/reviewRoutes.js",
17
+ "../dist/epic/tool/epicRoutes.js",
18
+ "../dist/epic/tool/linkRoutes.js",
19
+ "../dist/epic/list/runningRoutes.js",
20
+ "../dist/epic/tools/agentRoutes.js",
21
+ "../dist/epic/tools/showRoutes.js",
22
+ "../dist/epic/tools/airplaneRoutes.js",
23
+ "../dist/epic/tools/personRoutes.js"
24
+ ],
25
+ "watch": [
26
+ "../dist/epic/tools/_assets",
27
+ "../dist/epic/components/__pack"
28
+ ],
29
+ "componentSets": {
30
+ "epics": {
31
+ "name": "Epic UI",
32
+ "dir": "../dist/epic/docs",
33
+ "assets": "../ui/site/_assets"
34
+ }
35
+ },
36
+ "engineRoutes": {
37
+ "/_epic/assets/": "../dist/epic/tools/_assets",
38
+ "/_epic/pack/": "../dist/epic/components/__pack",
39
+ "/templates/": "templates"
40
+ },
41
+ "localCopies": {
42
+ "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js": "/_epic/assets/highlight.min.js"
43
+ }
44
+ }
6
45
  }
@@ -126,7 +126,8 @@ the page is the same for both agents.
126
126
  - The page NEVER locks: the person sends partial answers, and sends again whenever they like (2026-10-08).
127
127
  - a picture page: delete the question sections and `<epic-send>`; nothing to send
128
128
  3. In an epic: format the page once it's written, as the engine's tools do:
129
- `yarn vp fmt <its ABSOLUTE path>`, from the kit's root
129
+ `yarn vp fmt <its ABSOLUTE path>`, run from the plugin's own folder (`${CLAUDE_PLUGIN_ROOT}`), never your repo's root
130
+ (no `vp` there: skip this step)
130
131
  ([epics' AGENTS.md](${CLAUDE_PLUGIN_ROOT}/src/AGENTS.md), "Finishing a page", step 2).
131
132
 
132
133
  ### Asking the same question again: a new ROUND, never a new page
@@ -651,6 +651,11 @@ than just being able to move on").
651
651
  the repo's text-rewriting skill (spell-app's `/fussbudget`) on the files the phase changed,
652
652
  and the guide and the READMEs the phase made untrue brought in line, in the readme voice
653
653
  ("6. Doc Review"), before the commit.
654
+ - `epic config baseBranchProtected` prints `true`: the base branch takes only pull requests, so `epic merge` refuses
655
+ and steps 1-2 below don't apply.
656
+ No asking, as below: `epic worktree merge-main`, then `epic pr <name>`, which pushes and opens one unless one's open
657
+ ([the isolate skill](../isolate/SKILL.md), "Finish, when the base branch takes only pull requests").
658
+ The phase reaches `main` when the code host merges it; its changelog entry stays under "2. In worktrees" until then.
654
659
  - Then, no asking (the standing epic is the ask):
655
660
  1. `main` moved (`git log --oneline HEAD..main` not empty): `epic worktree merge-main`.
656
661
  - A multi-repo top (`epic config repos` prints names; [the isolate skill](../isolate/SKILL.md), "A
@@ -1318,7 +1323,8 @@ Write an idea down as a FUTURE epic (epic `epic-future`, 2026-10-07).
1318
1323
  - a rough size
1319
1324
  - one question per HIGH-LEVEL open choice (what, where, how far, when): options side by side, one recommended.
1320
1325
  Not the small ones: those are the plan's.
1321
- - Then format it: `yarn vp fmt <its ABSOLUTE path>`, from the kit's root
1326
+ - Then format it: `yarn vp fmt <its ABSOLUTE path>`, run from the plugin's own folder (`${CLAUDE_PLUGIN_ROOT}`), never
1327
+ your repo's root (no `vp` there: skip this step)
1322
1328
  ([epics' AGENTS.md](${CLAUDE_PLUGIN_ROOT}/src/AGENTS.md), "Finishing a page", step 2).
1323
1329
  - Then `epic ask show <name>/analysis --wait`: Bash, in the background.
1324
1330
  It opens in the side bar's Review tab.
@@ -115,6 +115,9 @@ epic turn end
115
115
  1. The Doc Review phase: the epic's guide, its changelog entry, and every doc it touched made true to what was built.
116
116
  2. Merge the worktree's branch into the base branch, when the person says so, and remove the worktree:
117
117
  `epic worktree remove <epic>`, never a bare `git worktree remove`.
118
+ - `epic config baseBranchProtected` prints `true`: the base branch takes only pull requests, and `epic merge` refuses.
119
+ Offer two things, in the chat: "Push and open a pull request" (`epic worktree merge-main`, `epic pr <epic>`) or "Leave it".
120
+ The rest happens once it's merged: `git pull` on the base branch, then `epic worktree remove <epic> --branches`.
118
121
  3. Say what shipped, with the page's links (`epic pages link <page> --show`).
119
122
 
120
123
  ## tidy -- Close what other work made obsolete
@@ -239,9 +239,14 @@ A STANDING epic merges each phase into `main` at once, and never leaves its work
239
239
  - no `ExitWorktree` and back: entering asks the person every time (epic `epic-engine` P12)
240
240
  - In Codex: the same: stay in the worktree's folder.
241
241
  - `/isolate done` in a standing epic's session: say it stands, and ask first ("Stop standing, and finish?").
242
+ - The base branch takes only pull requests (`epic config baseBranchProtected`): `epic merge` refuses; the epic skill's
243
+ step 5 says what a phase does instead.
242
244
 
243
245
  ## Finish: `/isolate done`
244
246
 
247
+ Read `epic config baseBranchProtected` first.
248
+ It prints `true`: steps 2, 4, 7 and 8 are the ones in "Finish, when the base branch takes only pull requests", below.
249
+
245
250
  0. Not in a worktree: say so in one line, then offer to clean up.
246
251
  - Not in one: the session's folder isn't a worktree's, in `.claude/worktrees/` or beside the repo.
247
252
  - Candidates, from `epic worktree list`: each worktree `<name>` that
@@ -321,43 +326,42 @@ A STANDING epic merges each phase into `main` at once, and never leaves its work
321
326
  - `git merge --abort`, say so, and list each file and why.
322
327
  - Then AskUserQuestion "Continue exiting?", options "Exit, unmerged" and "Stay isolated".
323
328
  - In Codex: in the chat too, its options numbered.
324
- 4. Pull request: an offer, ASKED first, since pushing publishes the branch on GitHub.
325
- - Only when GitHub's `main` is up to date with local `main` (Q16 of `review-review`, answer C).
329
+ 4. Pull request (a merge request on GitLab): an offer, ASKED first, since pushing publishes the branch on the
330
+ code host (GitHub or GitLab; `epic config codeHost` says which).
331
+ - Only when `origin`'s `main` is up to date with local `main` (Q16 of `review-review`, answer C).
326
332
  - All from the worktree.
327
333
  - `git fetch origin main`, then `git rev-list --count origin/main..main`:
328
- how far the local one is ahead of GitHub's.
334
+ how far the local one is ahead of `origin`'s.
329
335
  - Not 0: NO offer; say why in one line, e.g.
330
- "No pull request: GitHub's `main` is 62 commits behind local `main`,
331
- so a PR would list all 62 as well as this branch's. Push `main` first if you want one."
336
+ "No pull request: `origin`'s `main` is 62 commits behind local `main`,
337
+ so one would list all 62 as well as this branch's. Push `main` first if you want one."
332
338
  - NEVER push `main` from here.
333
- - The fetch fails (offline, not signed in): "No pull request: couldn't reach GitHub (<the error's gist>)".
334
- - `git rev-list --count origin/main..HEAD` is 0: nothing GitHub lacks, so nothing to show.
339
+ - The fetch fails (offline, not signed in): "No pull request: couldn't reach `origin` (<the error's gist>)".
340
+ - `git rev-list --count origin/main..HEAD` is 0: nothing `origin` lacks, so nothing to show.
335
341
  Skip, silently.
336
- - `gh pr list --head <name> --state open --json number,url`:
337
- one open already, so the offer is to push the branch, which updates it.
338
- - AskUserQuestion "Open a pull request for `<name>` on GitHub?",
339
- saying how many commits it shows and that pushing publishes them.
342
+ - AskUserQuestion "Open a pull request for `<name>` on the code host?",
343
+ saying how many commits it shows and that pushing publishes them; if one is open already, pushing just updates it.
340
344
  - In Codex: ask in the chat, yes or no.
341
- - Options: "Push and open a PR", and "No PR".
342
- - When one is open, the first is "Push `<name>` (updates PR #<n>)".
345
+ - Options: "Push and open a pull request", and "No pull request".
343
346
  - On yes:
344
- - `git push -u origin <name>`: never `--force`.
345
- Refused: say why, and stop the offer there.
346
- - Unless one was open, `gh pr create`:
347
+ - `epic pr`, which pushes the branch (`git push -u origin <name>`, never `--force`) and opens it on either host,
348
+ or says its address if one is open already:
347
349
 
348
350
  ```sh
349
- gh pr create --base main --head <name> --title "<title>" --body-file <file in the scratchpad>
351
+ epic pr <name> --title "<title>" --body-file <file in the scratchpad>
350
352
  ```
351
353
 
354
+ Refused, or the host's command missing: it says why and what to run; stop the offer there.
355
+
352
356
  - Title: the branch's changelog entry's header without its date
353
357
  (`2026-10-05 · Review Review` -> `Review Review`).
354
358
  No entry (left unmerged): the epic page's title, else the branch name.
355
359
  - Body:
356
360
  - the entry's bullets, as a markdown list (`- ...`)
357
- - plain text: its links point into shared docs, which aren't on GitHub
361
+ - plain text: its links point into shared docs, which aren't on the code host
358
362
  - then the attribution line the session's instructions give for pull requests
359
- - One line with the PR's URL.
360
- - Merged later (step 7) and `main` pushed: GitHub marks the PR merged by itself, its commits being in `main`.
363
+ - One line with its URL.
364
+ - Merged later (step 7) and `main` pushed: the code host marks it merged by itself, its commits being in `main`.
361
365
  5. NO move back: the session stays in the window it's in (the worktree's, or the one it stayed in).
362
366
  - Why: 2026-10-03 "we don't need to go back into the originating window.
363
367
  That's just confusing things".
@@ -413,6 +417,35 @@ A STANDING epic merges each phase into `main` at once, and never leaves its work
413
417
  - Agents' worktrees: how many step 7b removed, and any it kept.
414
418
  - Then close the reply as "Closing line" below says.
415
419
 
420
+ ## Finish, when the base branch takes only pull requests
421
+
422
+ `epic config baseBranchProtected` prints `true`: `main` can't be pushed to, and `epic merge` refuses.
423
+ These replace steps 2, 4, 7 and 8 of "Finish" above; the other steps stand.
424
+
425
+ 2. Unmerged commits (`main..HEAD` not empty): AskUserQuestion, listing the commits in the question.
426
+ - In Codex: ask in the chat, the two options numbered.
427
+ - "Push `<name>` and open a pull request?", options "Push and open a pull request" and "Leave it".
428
+ No "Merge now": nothing merges from here.
429
+ - "Leave it": go on to step 5.
430
+ - On "Push and open a pull request":
431
+ - the changelog, if the repo keeps one: this branch's entry, under "2. In worktrees": it isn't merged yet
432
+ - `epic worktree merge-main`, so the pull request starts from what `origin` has:
433
+ it fast-forwards local `main` from `origin` first, when that's safe.
434
+ Conflicts: step 3 above, with "Exit anyway" going on to step 5.
435
+ - `epic pr <name> --title "<title>" --body-file <file>`, its title and body as step 4 says:
436
+ it pushes (never `--force`, never `main`), and opens one, or says one was open and the push updated it.
437
+ Refused: say why, and stop here.
438
+ The host's command missing, or logged out: it prints the line to run; show it.
439
+ - One line with the address it printed.
440
+ 4. Nothing more: step 2 did it.
441
+ - The check step 4 makes above doesn't apply.
442
+ `git rev-list --count origin/main..main` not 0 means local `main` holds commits no pull request has:
443
+ say so in one line, and leave them.
444
+ 7. Nothing to merge here: `epic session done` waits until the pull request is merged.
445
+ 8. One line, where the rest happens, then close the reply as "Closing line" below says:
446
+ "Once it's merged: `git pull` on main in the main checkout, then `epic worktree remove <name> --branches`."
447
+ - `--branches` deletes the branch if its pull request was merged, a squash included: never unmerged work.
448
+
416
449
  ## Closing line
417
450
 
418
451
  A reply that closes out the session's work ends with a line of its own, `*You can close this tab*`
@@ -406,7 +406,12 @@ The `epic/` folder holds TWO things (Q23 of epic `people-and-orgs`, 2026-10-13):
406
406
  logged in), `login()` (`EpicHome.refreshGithub()`'s), `isOrganization()`, `createRepo()`, `addressOf()`
407
407
  (SSH or HTTPS, as gh's `git_protocol` says); never throws but where it says so; `$SPELL_EPIC_GH` names a
408
408
  stand-in; plain `node` loads it
409
- - only `epic whoami` and `epic init` run it: never a page served or a hook
409
+ - only `epic whoami`, `epic init` and `epic worktree remove --branches` (where the base branch takes only pull
410
+ requests) run it: never a page served or a hook
411
+ - `CodeHost` (epic `epic-engine` I248): which server a repo's code is on (`codeHost`, `"github"` or `"gitlab"`,
412
+ worked out from `origin` when left out), and the ONE chooser of how to talk to it, `CodeHost.of(config)`: `GitHub`'s
413
+ statics or a `GitLab`, the same operations; nothing else compares host names
414
+ - `GitLab`: `glab`, on one instance, self-hosted too; `$SPELL_EPIC_GLAB` names a stand-in; plain `node` loads it
410
415
  - `Editor` (epic `epic-friend` P16): which editor the tools drive, VS Code (`code`) or Cursor (`cursor`), the ONE
411
416
  reader of it: `$SPELL_EPIC_EDITOR` (this machine's), else the window's own marks in the environment
412
417
  (`ofWindow()`: Cursor's `CURSOR_TRACE_ID`, its macOS bundle id, its folders in VS Code's `VSCODE_*` paths), else
@@ -444,7 +449,8 @@ The `epic/` folder holds TWO things (Q23 of epic `people-and-orgs`, 2026-10-13):
444
449
  - a class per verb group, a method per verb:
445
450
  - `Requests`: `send`, `requests`, `file`, `home`, `merge`
446
451
  - `Worktrees` (`worktree`), with `MainMerge`
447
- (`worktree merge-main`: installs the packages when it changed a lockfile)
452
+ (`worktree merge-main`: installs the packages when it changed a lockfile, a root lockfile both sides changed
453
+ rewritten by its own tool, snapshots updated by the repo's own runner, `snapshotUpdateOf()`)
448
454
  - then renames Spell UI's old names the branch still writes (`renameOldNames()`, epic `epic-engine` I143):
449
455
  the kit's `spell ui rename --write` over what the merged branch differs from `main` in, once every repo is
450
456
  merged, committed on its own; generated files and links out of the checkout (the epic folder) left out;
@@ -504,6 +510,9 @@ The `epic/` folder holds TWO things (Q23 of epic `people-and-orgs`, 2026-10-13):
504
510
  - left out besides: `linguist-generated`, a `GENERATED` marker on the FIRST line only, bundles
505
511
  - `LocPage` rewrites the LOC guide's tables, dates and left-out list as DOM nodes (`Markup.plain()`), keeping
506
512
  its prose and ids; a missing page is made by `epic pages create durable`
513
+ - `PullRequest`: `epic pr <name>`, a branch pushed and its pull or merge request opened, on either host (`CodeHost`)
514
+ - `BaseBranch`: the local base branch fast-forwarded from `origin`, where it takes only pull requests
515
+ (`baseBranchProtected`): by the worktree hook and `MainMerge`, safe or not at all; plain `node` loads it by path
507
516
  - `CheckoutServers`: a checkout's web servers (page server, vite) stopped as it goes (epic `epic-engine` I53)
508
517
  - `stop()`, BEFORE a removal: the worktree hook, `epic worktree remove` (`/isolate done`, `/worktrees`' clean-up
509
518
  through `Stock`), `epic worktree move`
@@ -220,7 +220,7 @@ const message = greet("spell")</code></pre>
220
220
  <ui-item>
221
221
  <ui-content>
222
222
  <ui-header><code>experiments/measure.ts</code></ui-header>
223
- <ui-meta>experiment · <code>yarn tsx &lt;topic&gt;/experiments/measure.ts</code></ui-meta>
223
+ <ui-meta>experiment · <code>tsx &lt;topic&gt;/experiments/measure.ts</code></ui-meta>
224
224
  <ui-description>What it measures, and which claim above it backs.</ui-description>
225
225
  </ui-content>
226
226
  </ui-item>
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "spell-epic",
3
3
  "displayName": "Spell Epic",
4
- "version": "0.1.1",
4
+ "version": "0.1.3",
5
5
  "private": true,
6
6
  "description": "spell-epic's side bar: the Review, Details and Epic Docs tabs, live from spell-epic's one page server per machine; the window bridge Claude Code sessions reach their window through, and the handoff.",
7
7
  "license": "MIT",
Binary file
package/package.json CHANGED
@@ -23,7 +23,7 @@
23
23
  "optional": true
24
24
  }
25
25
  },
26
- "version": "0.8.7",
26
+ "version": "0.8.9",
27
27
  "exports": {
28
28
  "./toolchain/lint/imports": {
29
29
  "types": "./dist/toolchain/lint.imports.d.ts",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spell-parser",
3
- "version": "0.8.7",
3
+ "version": "0.8.9",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "spell": {
package/ui/package.json CHANGED
@@ -1,6 +1,19 @@
1
1
  {
2
2
  "name": "spell-ui",
3
- "version": "0.8.7",
3
+ "version": "0.8.9",
4
4
  "private": true,
5
- "type": "module"
5
+ "type": "module",
6
+ "pageServer": {
7
+ "bundles": [
8
+ "../dist/ui/components/ui-root",
9
+ "site/_assets"
10
+ ],
11
+ "componentSets": {
12
+ "ui": {
13
+ "name": "Spell UI",
14
+ "dir": "docs",
15
+ "assets": "site/_assets"
16
+ }
17
+ }
18
+ }
6
19
  }