@treeseed/core 0.1.2

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 (384) hide show
  1. package/README.md +145 -0
  2. package/dist/agents/index.js +5 -0
  3. package/dist/agents/registry-helper.js +14 -0
  4. package/dist/agents/registry.js +88 -0
  5. package/dist/components/DevWatchReload.astro +45 -0
  6. package/dist/components/SiteTitle.astro +51 -0
  7. package/dist/components/content/ContentStatusLegend.astro +18 -0
  8. package/dist/components/content/StatusBadge.astro +11 -0
  9. package/dist/components/docs/BookFontControls.astro +180 -0
  10. package/dist/components/docs/DesktopSidebarToggle.astro +88 -0
  11. package/dist/components/docs/DownloadBook.astro +34 -0
  12. package/dist/components/docs/Footer.astro +196 -0
  13. package/dist/components/docs/Header.astro +150 -0
  14. package/dist/components/docs/PageFrame.astro +260 -0
  15. package/dist/components/docs/PageSidebar.astro +63 -0
  16. package/dist/components/docs/PageTitle.astro +39 -0
  17. package/dist/components/docs/Sidebar.astro +41 -0
  18. package/dist/components/docs/ThemeSelect.astro +3 -0
  19. package/dist/components/forms/ContactForm.astro +234 -0
  20. package/dist/components/forms/FooterSubscribeForm.astro +189 -0
  21. package/dist/components/site/BookList.astro +27 -0
  22. package/dist/components/site/CTASection.astro +24 -0
  23. package/dist/components/site/ChronicleList.astro +33 -0
  24. package/dist/components/site/Hero.astro +18 -0
  25. package/dist/components/site/NotesList.astro +18 -0
  26. package/dist/components/site/PathCard.astro +16 -0
  27. package/dist/components/site/ProfileList.astro +30 -0
  28. package/dist/components/site/SectionIntro.astro +9 -0
  29. package/dist/components/site/StageBanner.astro +8 -0
  30. package/dist/components/site/TrustCallout.astro +9 -0
  31. package/dist/components/starlight.js +6 -0
  32. package/dist/config.js +8 -0
  33. package/dist/content-config.js +9 -0
  34. package/dist/content.js +230 -0
  35. package/dist/contracts.d.ts +130 -0
  36. package/dist/contracts.js +0 -0
  37. package/dist/deploy/config.d.ts +4 -0
  38. package/dist/deploy/config.js +154 -0
  39. package/dist/deploy/runtime.js +77 -0
  40. package/dist/env.yaml +322 -0
  41. package/dist/environment.d.ts +130 -0
  42. package/dist/environment.js +324 -0
  43. package/dist/index.js +81 -0
  44. package/dist/layouts/AuthoredEntryLayout.astro +87 -0
  45. package/dist/layouts/BookLayout.astro +35 -0
  46. package/dist/layouts/BridgeLayout.astro +11 -0
  47. package/dist/layouts/ContentLayout.astro +24 -0
  48. package/dist/layouts/MainLayout.astro +203 -0
  49. package/dist/layouts/NoteLayout.astro +26 -0
  50. package/dist/layouts/ProfileLayout.astro +81 -0
  51. package/dist/middleware/starlightRouteData.js +45 -0
  52. package/dist/pages/404.astro +29 -0
  53. package/dist/pages/[slug].astro +30 -0
  54. package/dist/pages/agents/[slug].astro +29 -0
  55. package/dist/pages/agents/index.astro +27 -0
  56. package/dist/pages/api/form/submit.js +14 -0
  57. package/dist/pages/books/[slug].astro +19 -0
  58. package/dist/pages/books/index.astro +28 -0
  59. package/dist/pages/contact.astro +27 -0
  60. package/dist/pages/feed.xml.js +34 -0
  61. package/dist/pages/index.astro +290 -0
  62. package/dist/pages/notes/[slug].astro +19 -0
  63. package/dist/pages/notes/index.astro +21 -0
  64. package/dist/pages/objectives/[slug].astro +31 -0
  65. package/dist/pages/objectives/index.astro +30 -0
  66. package/dist/pages/people/[slug].astro +29 -0
  67. package/dist/pages/people/index.astro +28 -0
  68. package/dist/pages/questions/[slug].astro +31 -0
  69. package/dist/pages/questions/index.astro +30 -0
  70. package/dist/plugin-default.js +4 -0
  71. package/dist/plugins/builtin/default-plugin.d.ts +21 -0
  72. package/dist/plugins/builtin/default-plugin.js +32 -0
  73. package/dist/plugins/constants.d.ts +21 -0
  74. package/dist/plugins/constants.js +28 -0
  75. package/dist/plugins/plugin.d.ts +42 -0
  76. package/dist/plugins/plugin.js +6 -0
  77. package/dist/plugins/runtime.d.ts +31 -0
  78. package/dist/plugins/runtime.js +120 -0
  79. package/dist/scripts/aggregate-book.js +112 -0
  80. package/dist/scripts/assert-release-tag-version.js +21 -0
  81. package/dist/scripts/build-dist.js +384 -0
  82. package/dist/scripts/build-tenant-worker.js +36 -0
  83. package/dist/scripts/package-tools.js +88 -0
  84. package/dist/scripts/patch-starlight-content-path.js +172 -0
  85. package/dist/scripts/paths.js +11 -0
  86. package/dist/scripts/publish-package.js +20 -0
  87. package/dist/scripts/release-verify.js +52 -0
  88. package/dist/scripts/run-fixture-astro-command.js +21 -0
  89. package/dist/scripts/tenant-astro-command.js +3 -0
  90. package/dist/scripts/tenant-build.js +16 -0
  91. package/dist/scripts/tenant-check.js +7 -0
  92. package/dist/scripts/test-smoke.js +105 -0
  93. package/dist/server.js +53 -0
  94. package/dist/site-resources.d.ts +29 -0
  95. package/dist/site-resources.js +127 -0
  96. package/dist/site.js +313 -0
  97. package/dist/styles/global.css +683 -0
  98. package/dist/styles/prose.css +89 -0
  99. package/dist/styles/tokens.css +24 -0
  100. package/dist/tenant/bridge.js +5 -0
  101. package/dist/tenant/config.d.ts +9 -0
  102. package/dist/tenant/config.js +124 -0
  103. package/dist/tenant/runtime-config.js +20 -0
  104. package/dist/tsconfigs/strict.json +3 -0
  105. package/dist/types/agents.d.ts +1 -0
  106. package/dist/types/agents.js +1 -0
  107. package/dist/types/astro-build.d.js +0 -0
  108. package/dist/types/cloudflare-sockets.d.js +0 -0
  109. package/dist/types/cloudflare.d.ts +1 -0
  110. package/dist/types/cloudflare.js +1 -0
  111. package/dist/types/forms.js +4 -0
  112. package/dist/utils/agents/adapters/execution.js +90 -0
  113. package/dist/utils/agents/adapters/mutations.js +30 -0
  114. package/dist/utils/agents/adapters/notification.js +16 -0
  115. package/dist/utils/agents/adapters/repository.js +61 -0
  116. package/dist/utils/agents/adapters/research.js +25 -0
  117. package/dist/utils/agents/adapters/verification.js +62 -0
  118. package/dist/utils/agents/cli-tools.js +5 -0
  119. package/dist/utils/agents/contracts/messages.d.ts +88 -0
  120. package/dist/utils/agents/contracts/messages.js +138 -0
  121. package/dist/utils/agents/contracts/run.d.ts +20 -0
  122. package/dist/utils/agents/contracts/run.js +0 -0
  123. package/dist/utils/agents/runtime-types.d.ts +117 -0
  124. package/dist/utils/agents/runtime-types.js +4 -0
  125. package/dist/utils/books-data.js +82 -0
  126. package/dist/utils/content-status.js +38 -0
  127. package/dist/utils/forms/config.js +87 -0
  128. package/dist/utils/forms/constants.js +27 -0
  129. package/dist/utils/forms/contact-submissions-local.js +19 -0
  130. package/dist/utils/forms/contact-submissions.js +72 -0
  131. package/dist/utils/forms/crypto.js +64 -0
  132. package/dist/utils/forms/guard.js +76 -0
  133. package/dist/utils/forms/http.js +51 -0
  134. package/dist/utils/forms/provider-core.js +88 -0
  135. package/dist/utils/forms/routing-core.js +7 -0
  136. package/dist/utils/forms/routing.js +13 -0
  137. package/dist/utils/forms/runtime-core.js +17 -0
  138. package/dist/utils/forms/runtime.js +27 -0
  139. package/dist/utils/forms/service-core.js +256 -0
  140. package/dist/utils/forms/service.js +55 -0
  141. package/dist/utils/forms/session.js +57 -0
  142. package/dist/utils/forms/smtp-cloudflare.js +107 -0
  143. package/dist/utils/forms/smtp-node.js +27 -0
  144. package/dist/utils/forms/smtp.js +10 -0
  145. package/dist/utils/forms/subscribers-local.js +21 -0
  146. package/dist/utils/forms/subscribers.js +53 -0
  147. package/dist/utils/forms/turnstile.js +31 -0
  148. package/dist/utils/forms/validation.js +58 -0
  149. package/dist/utils/hub-content.js +28 -0
  150. package/dist/utils/plugin-runtime.js +158 -0
  151. package/dist/utils/routes.js +17 -0
  152. package/dist/utils/seo.js +4 -0
  153. package/dist/utils/site-config-schema.js +282 -0
  154. package/dist/utils/site-config.js +122 -0
  155. package/dist/utils/starlight-nav.js +62 -0
  156. package/dist/utils/theme.js +49 -0
  157. package/dist/vendor/starlight/components/AnchorHeading.astro +53 -0
  158. package/dist/vendor/starlight/components/Banner.astro +23 -0
  159. package/dist/vendor/starlight/components/ContentNotice.astro +33 -0
  160. package/dist/vendor/starlight/components/ContentPanel.astro +27 -0
  161. package/dist/vendor/starlight/components/DraftContentNotice.astro +5 -0
  162. package/dist/vendor/starlight/components/EditLink.astro +28 -0
  163. package/dist/vendor/starlight/components/FallbackContentNotice.astro +5 -0
  164. package/dist/vendor/starlight/components/Footer.astro +61 -0
  165. package/dist/vendor/starlight/components/Head.astro +5 -0
  166. package/dist/vendor/starlight/components/Header.astro +94 -0
  167. package/dist/vendor/starlight/components/Hero.astro +143 -0
  168. package/dist/vendor/starlight/components/Icons.js +121 -0
  169. package/dist/vendor/starlight/components/LanguageSelect.astro +57 -0
  170. package/dist/vendor/starlight/components/LastUpdated.astro +14 -0
  171. package/dist/vendor/starlight/components/MarkdownContent.astro +5 -0
  172. package/dist/vendor/starlight/components/MobileMenuFooter.astro +35 -0
  173. package/dist/vendor/starlight/components/MobileMenuToggle.astro +107 -0
  174. package/dist/vendor/starlight/components/MobileTableOfContents.astro +151 -0
  175. package/dist/vendor/starlight/components/Page.astro +126 -0
  176. package/dist/vendor/starlight/components/PageFrame.astro +97 -0
  177. package/dist/vendor/starlight/components/PageSidebar.astro +59 -0
  178. package/dist/vendor/starlight/components/PageTitle.astro +17 -0
  179. package/dist/vendor/starlight/components/Pagination.astro +79 -0
  180. package/dist/vendor/starlight/components/Search.astro +488 -0
  181. package/dist/vendor/starlight/components/Select.astro +99 -0
  182. package/dist/vendor/starlight/components/Sidebar.astro +15 -0
  183. package/dist/vendor/starlight/components/SidebarPersistState.js +43 -0
  184. package/dist/vendor/starlight/components/SidebarPersister.astro +78 -0
  185. package/dist/vendor/starlight/components/SidebarRestorePoint.astro +12 -0
  186. package/dist/vendor/starlight/components/SidebarSublist.astro +154 -0
  187. package/dist/vendor/starlight/components/SiteTitle.astro +59 -0
  188. package/dist/vendor/starlight/components/SkipLink.astro +26 -0
  189. package/dist/vendor/starlight/components/SocialIcons.astro +32 -0
  190. package/dist/vendor/starlight/components/StarlightPage.astro +17 -0
  191. package/dist/vendor/starlight/components/TableOfContents/TableOfContentsList.astro +79 -0
  192. package/dist/vendor/starlight/components/TableOfContents/starlight-toc.js +93 -0
  193. package/dist/vendor/starlight/components/TableOfContents.astro +18 -0
  194. package/dist/vendor/starlight/components/ThemeProvider.astro +38 -0
  195. package/dist/vendor/starlight/components/ThemeSelect.astro +73 -0
  196. package/dist/vendor/starlight/components/TwoColumnContent.astro +54 -0
  197. package/dist/vendor/starlight/components.js +26 -0
  198. package/dist/vendor/starlight/constants.js +4 -0
  199. package/dist/vendor/starlight/expressive-code.d.js +1 -0
  200. package/dist/vendor/starlight/global.d.js +0 -0
  201. package/dist/vendor/starlight/i18n.d.js +1 -0
  202. package/dist/vendor/starlight/index.js +119 -0
  203. package/dist/vendor/starlight/integrations/asides-error.js +12 -0
  204. package/dist/vendor/starlight/integrations/asides.js +179 -0
  205. package/dist/vendor/starlight/integrations/code-rtl-support.js +21 -0
  206. package/dist/vendor/starlight/integrations/expressive-code/hast.d.js +1 -0
  207. package/dist/vendor/starlight/integrations/expressive-code/index.js +63 -0
  208. package/dist/vendor/starlight/integrations/expressive-code/preprocessor.js +92 -0
  209. package/dist/vendor/starlight/integrations/expressive-code/themes/night-owl-dark.jsonc +1796 -0
  210. package/dist/vendor/starlight/integrations/expressive-code/themes/night-owl-dark.jsonc.js +1 -0
  211. package/dist/vendor/starlight/integrations/expressive-code/themes/night-owl-light.jsonc +1695 -0
  212. package/dist/vendor/starlight/integrations/expressive-code/themes/night-owl-light.jsonc.js +1 -0
  213. package/dist/vendor/starlight/integrations/expressive-code/theming.js +62 -0
  214. package/dist/vendor/starlight/integrations/expressive-code/translations.js +29 -0
  215. package/dist/vendor/starlight/integrations/heading-links.js +61 -0
  216. package/dist/vendor/starlight/integrations/pagefind.js +43 -0
  217. package/dist/vendor/starlight/integrations/remark-rehype.js +68 -0
  218. package/dist/vendor/starlight/integrations/shared/absolutePathToLang.js +15 -0
  219. package/dist/vendor/starlight/integrations/shared/localeToLang.js +9 -0
  220. package/dist/vendor/starlight/integrations/shared/slugToLocale.js +10 -0
  221. package/dist/vendor/starlight/integrations/sitemap.js +20 -0
  222. package/dist/vendor/starlight/integrations/virtual-user-config.js +110 -0
  223. package/dist/vendor/starlight/integrations/vite-layer-order.js +42 -0
  224. package/dist/vendor/starlight/internal.js +6 -0
  225. package/dist/vendor/starlight/loaders.js +36 -0
  226. package/dist/vendor/starlight/locals.d.js +0 -0
  227. package/dist/vendor/starlight/locals.js +30 -0
  228. package/dist/vendor/starlight/package.json +231 -0
  229. package/dist/vendor/starlight/package.json.js +248 -0
  230. package/dist/vendor/starlight/props.js +0 -0
  231. package/dist/vendor/starlight/route-data.js +6 -0
  232. package/dist/vendor/starlight/routes/common.astro +23 -0
  233. package/dist/vendor/starlight/routes/ssr/404.astro +7 -0
  234. package/dist/vendor/starlight/routes/ssr/index.astro +14 -0
  235. package/dist/vendor/starlight/routes/static/404.astro +7 -0
  236. package/dist/vendor/starlight/routes/static/index.astro +12 -0
  237. package/dist/vendor/starlight/schema.js +102 -0
  238. package/dist/vendor/starlight/schemas/badge.js +26 -0
  239. package/dist/vendor/starlight/schemas/components.js +235 -0
  240. package/dist/vendor/starlight/schemas/expressiveCode.js +12 -0
  241. package/dist/vendor/starlight/schemas/favicon.js +33 -0
  242. package/dist/vendor/starlight/schemas/head.js +32 -0
  243. package/dist/vendor/starlight/schemas/hero.js +57 -0
  244. package/dist/vendor/starlight/schemas/i18n.js +101 -0
  245. package/dist/vendor/starlight/schemas/icon.js +7 -0
  246. package/dist/vendor/starlight/schemas/logo.js +24 -0
  247. package/dist/vendor/starlight/schemas/pagefind.js +108 -0
  248. package/dist/vendor/starlight/schemas/prevNextLink.js +14 -0
  249. package/dist/vendor/starlight/schemas/sidebar.js +80 -0
  250. package/dist/vendor/starlight/schemas/site-title.js +19 -0
  251. package/dist/vendor/starlight/schemas/social.js +19 -0
  252. package/dist/vendor/starlight/schemas/tableOfContents.js +16 -0
  253. package/dist/vendor/starlight/style/anchor-links.css +131 -0
  254. package/dist/vendor/starlight/style/asides.css +51 -0
  255. package/dist/vendor/starlight/style/layers.css +1 -0
  256. package/dist/vendor/starlight/style/markdown.css +253 -0
  257. package/dist/vendor/starlight/style/print.css +175 -0
  258. package/dist/vendor/starlight/style/props.css +188 -0
  259. package/dist/vendor/starlight/style/reset.css +52 -0
  260. package/dist/vendor/starlight/style/util.css +63 -0
  261. package/dist/vendor/starlight/translations/ar.json +30 -0
  262. package/dist/vendor/starlight/translations/ar.json.js +32 -0
  263. package/dist/vendor/starlight/translations/ca.json +43 -0
  264. package/dist/vendor/starlight/translations/ca.json.js +45 -0
  265. package/dist/vendor/starlight/translations/cs.json +43 -0
  266. package/dist/vendor/starlight/translations/cs.json.js +45 -0
  267. package/dist/vendor/starlight/translations/da.json +30 -0
  268. package/dist/vendor/starlight/translations/da.json.js +32 -0
  269. package/dist/vendor/starlight/translations/de.json +30 -0
  270. package/dist/vendor/starlight/translations/de.json.js +32 -0
  271. package/dist/vendor/starlight/translations/el.json +30 -0
  272. package/dist/vendor/starlight/translations/el.json.js +32 -0
  273. package/dist/vendor/starlight/translations/en.json +30 -0
  274. package/dist/vendor/starlight/translations/en.json.js +32 -0
  275. package/dist/vendor/starlight/translations/es.json +43 -0
  276. package/dist/vendor/starlight/translations/es.json.js +45 -0
  277. package/dist/vendor/starlight/translations/fa.json +30 -0
  278. package/dist/vendor/starlight/translations/fa.json.js +32 -0
  279. package/dist/vendor/starlight/translations/fi.json +30 -0
  280. package/dist/vendor/starlight/translations/fi.json.js +32 -0
  281. package/dist/vendor/starlight/translations/fr.json +33 -0
  282. package/dist/vendor/starlight/translations/fr.json.js +35 -0
  283. package/dist/vendor/starlight/translations/gl.json +43 -0
  284. package/dist/vendor/starlight/translations/gl.json.js +45 -0
  285. package/dist/vendor/starlight/translations/he.json +30 -0
  286. package/dist/vendor/starlight/translations/he.json.js +32 -0
  287. package/dist/vendor/starlight/translations/hi.json +30 -0
  288. package/dist/vendor/starlight/translations/hi.json.js +32 -0
  289. package/dist/vendor/starlight/translations/hu.json +43 -0
  290. package/dist/vendor/starlight/translations/hu.json.js +45 -0
  291. package/dist/vendor/starlight/translations/id.json +30 -0
  292. package/dist/vendor/starlight/translations/id.json.js +32 -0
  293. package/dist/vendor/starlight/translations/index.js +77 -0
  294. package/dist/vendor/starlight/translations/it.json +30 -0
  295. package/dist/vendor/starlight/translations/it.json.js +32 -0
  296. package/dist/vendor/starlight/translations/ja.json +30 -0
  297. package/dist/vendor/starlight/translations/ja.json.js +32 -0
  298. package/dist/vendor/starlight/translations/ko.json +30 -0
  299. package/dist/vendor/starlight/translations/ko.json.js +32 -0
  300. package/dist/vendor/starlight/translations/lv.json +30 -0
  301. package/dist/vendor/starlight/translations/lv.json.js +32 -0
  302. package/dist/vendor/starlight/translations/nb.json +30 -0
  303. package/dist/vendor/starlight/translations/nb.json.js +32 -0
  304. package/dist/vendor/starlight/translations/nl.json +30 -0
  305. package/dist/vendor/starlight/translations/nl.json.js +32 -0
  306. package/dist/vendor/starlight/translations/pl.json +33 -0
  307. package/dist/vendor/starlight/translations/pl.json.js +35 -0
  308. package/dist/vendor/starlight/translations/pt.json +30 -0
  309. package/dist/vendor/starlight/translations/pt.json.js +32 -0
  310. package/dist/vendor/starlight/translations/ro.json +30 -0
  311. package/dist/vendor/starlight/translations/ro.json.js +32 -0
  312. package/dist/vendor/starlight/translations/ru.json +33 -0
  313. package/dist/vendor/starlight/translations/ru.json.js +35 -0
  314. package/dist/vendor/starlight/translations/sk.json +30 -0
  315. package/dist/vendor/starlight/translations/sk.json.js +32 -0
  316. package/dist/vendor/starlight/translations/sv.json +30 -0
  317. package/dist/vendor/starlight/translations/sv.json.js +32 -0
  318. package/dist/vendor/starlight/translations/th.json +30 -0
  319. package/dist/vendor/starlight/translations/th.json.js +32 -0
  320. package/dist/vendor/starlight/translations/tr.json +30 -0
  321. package/dist/vendor/starlight/translations/tr.json.js +32 -0
  322. package/dist/vendor/starlight/translations/uk.json +30 -0
  323. package/dist/vendor/starlight/translations/uk.json.js +32 -0
  324. package/dist/vendor/starlight/translations/vi.json +30 -0
  325. package/dist/vendor/starlight/translations/vi.json.js +32 -0
  326. package/dist/vendor/starlight/translations/zh-CN.json +30 -0
  327. package/dist/vendor/starlight/translations/zh-CN.json.js +32 -0
  328. package/dist/vendor/starlight/translations/zh-TW.json +30 -0
  329. package/dist/vendor/starlight/translations/zh-TW.json.js +32 -0
  330. package/dist/vendor/starlight/types.js +0 -0
  331. package/dist/vendor/starlight/user-components/Aside.astro +40 -0
  332. package/dist/vendor/starlight/user-components/Badge.astro +148 -0
  333. package/dist/vendor/starlight/user-components/Card.astro +68 -0
  334. package/dist/vendor/starlight/user-components/CardGrid.astro +38 -0
  335. package/dist/vendor/starlight/user-components/FileTree.astro +137 -0
  336. package/dist/vendor/starlight/user-components/Icon.astro +42 -0
  337. package/dist/vendor/starlight/user-components/LinkButton.astro +78 -0
  338. package/dist/vendor/starlight/user-components/LinkCard.astro +78 -0
  339. package/dist/vendor/starlight/user-components/Steps.astro +90 -0
  340. package/dist/vendor/starlight/user-components/TabItem.astro +19 -0
  341. package/dist/vendor/starlight/user-components/Tabs.astro +268 -0
  342. package/dist/vendor/starlight/user-components/file-tree-icons.js +608 -0
  343. package/dist/vendor/starlight/user-components/rehype-file-tree.js +160 -0
  344. package/dist/vendor/starlight/user-components/rehype-steps.js +53 -0
  345. package/dist/vendor/starlight/user-components/rehype-tabs.js +73 -0
  346. package/dist/vendor/starlight/utils/base.js +14 -0
  347. package/dist/vendor/starlight/utils/canonical.js +13 -0
  348. package/dist/vendor/starlight/utils/collection-fs.js +13 -0
  349. package/dist/vendor/starlight/utils/collection.js +16 -0
  350. package/dist/vendor/starlight/utils/createPathFormatter.js +39 -0
  351. package/dist/vendor/starlight/utils/createTranslationSystem.js +60 -0
  352. package/dist/vendor/starlight/utils/error-map.js +110 -0
  353. package/dist/vendor/starlight/utils/format-path.js +9 -0
  354. package/dist/vendor/starlight/utils/generateToC.js +18 -0
  355. package/dist/vendor/starlight/utils/git.js +92 -0
  356. package/dist/vendor/starlight/utils/gitInlined.js +13 -0
  357. package/dist/vendor/starlight/utils/head.js +156 -0
  358. package/dist/vendor/starlight/utils/i18n.js +121 -0
  359. package/dist/vendor/starlight/utils/localizedUrl.js +37 -0
  360. package/dist/vendor/starlight/utils/navigation.js +320 -0
  361. package/dist/vendor/starlight/utils/path.js +52 -0
  362. package/dist/vendor/starlight/utils/plugins.js +355 -0
  363. package/dist/vendor/starlight/utils/routing/data.js +116 -0
  364. package/dist/vendor/starlight/utils/routing/index.js +107 -0
  365. package/dist/vendor/starlight/utils/routing/middleware.js +40 -0
  366. package/dist/vendor/starlight/utils/routing/types.js +0 -0
  367. package/dist/vendor/starlight/utils/routing.js +1 -0
  368. package/dist/vendor/starlight/utils/slugs.js +70 -0
  369. package/dist/vendor/starlight/utils/starlight-page.js +123 -0
  370. package/dist/vendor/starlight/utils/translations-fs.js +31 -0
  371. package/dist/vendor/starlight/utils/translations.js +31 -0
  372. package/dist/vendor/starlight/utils/types.js +0 -0
  373. package/dist/vendor/starlight/utils/url.js +5 -0
  374. package/dist/vendor/starlight/utils/user-config.js +255 -0
  375. package/dist/vendor/starlight/utils/validateLogoImports.js +22 -0
  376. package/dist/vendor/starlight/virtual-internal.d.js +0 -0
  377. package/dist/vendor/starlight/virtual.d.js +0 -0
  378. package/dist/worker/forms-worker.js +141 -0
  379. package/package.json +156 -0
  380. package/style/anchor-links.css +131 -0
  381. package/templates/github/deploy.workflow.yml +47 -0
  382. package/tsconfigs/strict.json +3 -0
  383. package/utils/git.ts +121 -0
  384. package/utils/gitInlined.ts +20 -0
@@ -0,0 +1,9 @@
1
+ ---
2
+ const { title, body } = Astro.props;
3
+ ---
4
+
5
+ <aside class="border-l-4 border-[color:var(--site-warm)] bg-[color:rgba(215,176,123,0.12)] px-5 py-5 text-[color:var(--site-text)]">
6
+ <p class="text-sm font-semibold uppercase tracking-[0.14em] text-[color:var(--site-warm-strong)]">Trust note</p>
7
+ <h3 class="mt-2 text-2xl font-bold">{title}</h3>
8
+ <p class="mt-3 text-base leading-8 text-[color:var(--site-text-muted)]">{body}</p>
9
+ </aside>
@@ -0,0 +1,6 @@
1
+ import { Card, CardGrid, LinkCard } from "../vendor/starlight/components.js";
2
+ export {
3
+ Card,
4
+ CardGrid,
5
+ LinkCard
6
+ };
package/dist/config.js ADDED
@@ -0,0 +1,8 @@
1
+ import starlight from './vendor/starlight/index.js';
2
+ import { createTreeseedSite } from './site.js';
3
+ import { loadTreeseedManifest } from './tenant/config.js';
4
+
5
+ export function createTreeseedTenantSite(manifestPath) {
6
+ const tenant = loadTreeseedManifest(manifestPath);
7
+ return createTreeseedSite(tenant, { starlight });
8
+ }
@@ -0,0 +1,9 @@
1
+ import { docsLoader } from './vendor/starlight/loaders.js';
2
+ import { docsSchema } from './vendor/starlight/schema.js';
3
+ import { createTreeseedCollections } from './content.js';
4
+ import { loadTreeseedManifest } from './tenant/config.js';
5
+
6
+ export function createTreeseedTenantCollections(manifestPath) {
7
+ const tenant = loadTreeseedManifest(manifestPath);
8
+ return createTreeseedCollections(tenant, { docsLoader, docsSchema });
9
+ }
@@ -0,0 +1,230 @@
1
+ import { defineCollection, reference } from "astro:content";
2
+ import { z } from "astro/zod";
3
+ import { glob } from "astro/loaders";
4
+ import { AGENT_CLI_ALLOW_TOOLS } from "./types/agents.js";
5
+ import { loadTreeseedPluginRuntime } from "./plugins/runtime.js";
6
+ import { loadTreeseedDeployConfig } from "./deploy/config.js";
7
+ import {
8
+ AGENT_MODEL_DEFAULTS,
9
+ BOOK_MODEL_DEFAULTS,
10
+ TREESEED_MODEL_DEFAULTS,
11
+ NOTE_MODEL_DEFAULTS,
12
+ OBJECTIVE_MODEL_DEFAULTS,
13
+ PAGE_MODEL_DEFAULTS,
14
+ PEOPLE_MODEL_DEFAULTS,
15
+ QUESTION_MODEL_DEFAULTS
16
+ } from "./utils/site-config.js";
17
+ const statusValues = ["live", "in progress", "exploratory", "planned", "speculative"];
18
+ const pageLayoutValues = ["article", "bridge"];
19
+ const questionTypeValues = ["research", "implementation", "strategy", "evaluation"];
20
+ const timeHorizonValues = ["near-term", "mid-term", "long-term"];
21
+ const runtimeStatusValues = ["active", "experimental", "dormant"];
22
+ const agentTriggerTypeValues = ["schedule", "message", "follow", "startup"];
23
+ const agentPermissionOperationValues = ["get", "search", "follow", "pick", "create", "update"];
24
+ function withOptionalDefault(schema, defaultValue) {
25
+ return defaultValue === void 0 ? schema : schema.default(defaultValue);
26
+ }
27
+ function createKnowledgeDocId({ entry, data }) {
28
+ const rawSlug = typeof data.slug === "string" ? data.slug : entry;
29
+ const normalized = rawSlug.replace(/\\/g, "/").replace(/\.(md|mdx)$/i, "").replace(/\/index$/i, "").replace(/^\/+|\/+$/g, "");
30
+ if (normalized === "knowledge" || normalized.startsWith("knowledge/")) {
31
+ return normalized;
32
+ }
33
+ return normalized ? `knowledge/${normalized}` : "knowledge";
34
+ }
35
+ function resolveDocsCollectionProvider(tenantConfig, dependencies) {
36
+ const pluginRuntime = loadTreeseedPluginRuntime(loadTreeseedDeployConfig());
37
+ const selectedId = pluginRuntime.config.providers.content.docs;
38
+ if (selectedId === "default") {
39
+ return {
40
+ loader: dependencies.docsLoader({ generateId: createKnowledgeDocId }),
41
+ schema: dependencies.docsSchema({
42
+ extend: z.object({
43
+ tags: z.array(z.string()).default(TREESEED_MODEL_DEFAULTS.tags ?? [])
44
+ })
45
+ })
46
+ };
47
+ }
48
+ for (const { plugin, config, package: packageName } of pluginRuntime.plugins) {
49
+ const docsProviders = plugin.contentProviders?.docs ?? {};
50
+ if (!(selectedId in docsProviders)) {
51
+ continue;
52
+ }
53
+ const resolved = docsProviders[selectedId]({
54
+ tenantConfig,
55
+ dependencies,
56
+ pluginConfig: config ?? {}
57
+ });
58
+ if (!resolved?.loader || !resolved?.schema) {
59
+ throw new Error(`Treeseed docs provider "${selectedId}" from "${packageName}" must return loader and schema.`);
60
+ }
61
+ return resolved;
62
+ }
63
+ throw new Error(`Treeseed docs provider "${selectedId}" is not registered.`);
64
+ }
65
+ function createTreeseedCollections(tenantConfig, { docsLoader, docsSchema }) {
66
+ const contributorReference = z.union([reference("people"), reference("agents")]);
67
+ const sidebarItemSchema = z.lazy(
68
+ () => z.object({
69
+ label: z.string(),
70
+ link: z.string().optional(),
71
+ autogenerate: z.object({ directory: z.string() }).optional(),
72
+ items: z.array(sidebarItemSchema).optional()
73
+ })
74
+ );
75
+ const pageSchema = z.object({
76
+ title: z.string(),
77
+ description: z.string(),
78
+ slug: z.string(),
79
+ pageLayout: withOptionalDefault(z.enum(pageLayoutValues), PAGE_MODEL_DEFAULTS.pageLayout),
80
+ status: withOptionalDefault(z.enum(statusValues), PAGE_MODEL_DEFAULTS.status),
81
+ stage: withOptionalDefault(z.string(), PAGE_MODEL_DEFAULTS.stage),
82
+ audience: z.array(z.string()).default(PAGE_MODEL_DEFAULTS.audience ?? []),
83
+ summary: z.string(),
84
+ updated: z.coerce.date(),
85
+ seoTitle: z.string().optional(),
86
+ seoDescription: z.string().optional()
87
+ });
88
+ const noteSchema = z.object({
89
+ title: z.string(),
90
+ description: z.string(),
91
+ date: z.coerce.date(),
92
+ status: withOptionalDefault(z.enum(statusValues), NOTE_MODEL_DEFAULTS.status),
93
+ tags: z.array(z.string()).default(NOTE_MODEL_DEFAULTS.tags ?? []),
94
+ author: withOptionalDefault(z.string(), NOTE_MODEL_DEFAULTS.author),
95
+ summary: z.string(),
96
+ draft: z.boolean().default(NOTE_MODEL_DEFAULTS.draft ?? false),
97
+ canonicalRoute: z.string().optional()
98
+ });
99
+ const questionSchema = z.object({
100
+ title: z.string(),
101
+ description: z.string(),
102
+ date: z.coerce.date(),
103
+ status: withOptionalDefault(z.enum(statusValues), QUESTION_MODEL_DEFAULTS.status),
104
+ tags: z.array(z.string()).default(QUESTION_MODEL_DEFAULTS.tags ?? []),
105
+ summary: z.string(),
106
+ draft: z.boolean().default(QUESTION_MODEL_DEFAULTS.draft ?? false),
107
+ questionType: z.enum(questionTypeValues),
108
+ motivation: z.string(),
109
+ primaryContributor: contributorReference,
110
+ relatedObjectives: z.array(reference("objectives")).default([]),
111
+ relatedBooks: z.array(reference("books")).default([])
112
+ });
113
+ const objectiveSchema = z.object({
114
+ title: z.string(),
115
+ description: z.string(),
116
+ date: z.coerce.date(),
117
+ status: withOptionalDefault(z.enum(statusValues), OBJECTIVE_MODEL_DEFAULTS.status),
118
+ tags: z.array(z.string()).default(OBJECTIVE_MODEL_DEFAULTS.tags ?? []),
119
+ summary: z.string(),
120
+ draft: z.boolean().default(OBJECTIVE_MODEL_DEFAULTS.draft ?? false),
121
+ timeHorizon: z.enum(timeHorizonValues),
122
+ motivation: z.string(),
123
+ primaryContributor: contributorReference,
124
+ relatedQuestions: z.array(reference("questions")).default([]),
125
+ relatedBooks: z.array(reference("books")).default([])
126
+ });
127
+ const profileLinkSchema = z.object({ label: z.string(), href: z.string() });
128
+ const agentCliSchema = z.object({
129
+ model: z.string().optional(),
130
+ allowTools: z.array(z.enum(AGENT_CLI_ALLOW_TOOLS)).default([]),
131
+ additionalArgs: z.array(z.string()).default([])
132
+ });
133
+ const agentTriggerSchema = z.object({
134
+ type: z.enum(agentTriggerTypeValues),
135
+ cron: z.string().optional(),
136
+ messageTypes: z.array(z.string()).default([]),
137
+ models: z.array(z.string()).default([]),
138
+ sinceField: z.string().optional(),
139
+ runOnStart: z.boolean().default(false)
140
+ });
141
+ const agentPermissionSchema = z.object({
142
+ model: z.string(),
143
+ operations: z.array(z.enum(agentPermissionOperationValues)).min(1)
144
+ });
145
+ const agentExecutionSchema = z.object({
146
+ maxConcurrency: z.number().int().positive().default(1),
147
+ timeoutSeconds: z.number().int().positive().default(900),
148
+ cooldownSeconds: z.number().int().nonnegative().default(30),
149
+ leaseSeconds: z.number().int().positive().default(300),
150
+ retryLimit: z.number().int().nonnegative().default(3),
151
+ branchPrefix: z.string().default("agent")
152
+ });
153
+ const agentTriggerPolicySchema = z.object({
154
+ maxRunsPerCycle: z.number().int().positive().optional(),
155
+ messageBatchSize: z.number().int().positive().optional()
156
+ });
157
+ const agentOutputSchema = z.object({
158
+ messageTypes: z.array(z.string()).default([]),
159
+ modelMutations: z.array(z.string()).default([])
160
+ });
161
+ const peopleSchema = z.object({
162
+ name: z.string(),
163
+ description: z.string(),
164
+ summary: z.string(),
165
+ role: z.string(),
166
+ affiliation: z.string(),
167
+ status: withOptionalDefault(z.enum(statusValues), PEOPLE_MODEL_DEFAULTS.status),
168
+ tags: z.array(z.string()).default(PEOPLE_MODEL_DEFAULTS.tags ?? []),
169
+ links: z.array(profileLinkSchema).default([]),
170
+ relatedQuestions: z.array(reference("questions")).default([]),
171
+ relatedObjectives: z.array(reference("objectives")).default([])
172
+ });
173
+ const agentSchema = z.object({
174
+ name: z.string(),
175
+ slug: z.string(),
176
+ handler: z.string(),
177
+ enabled: z.boolean().default(true),
178
+ description: z.string(),
179
+ summary: z.string(),
180
+ operator: z.string(),
181
+ runtimeStatus: withOptionalDefault(z.enum(runtimeStatusValues), AGENT_MODEL_DEFAULTS.runtimeStatus),
182
+ capabilities: z.array(z.string()).default([]),
183
+ tags: z.array(z.string()).default(AGENT_MODEL_DEFAULTS.tags ?? []),
184
+ links: z.array(profileLinkSchema).default([]),
185
+ relatedQuestions: z.array(reference("questions")).default([]),
186
+ relatedObjectives: z.array(reference("objectives")).default([]),
187
+ systemPrompt: z.string(),
188
+ persona: z.string(),
189
+ cli: agentCliSchema.default({ allowTools: [], additionalArgs: [] }),
190
+ triggers: z.array(agentTriggerSchema).min(1),
191
+ triggerPolicy: agentTriggerPolicySchema.optional(),
192
+ permissions: z.array(agentPermissionSchema).min(1),
193
+ execution: agentExecutionSchema.default({}),
194
+ outputs: agentOutputSchema.default({})
195
+ });
196
+ const bookSchema = z.object({
197
+ order: z.number().int().nonnegative(),
198
+ slug: z.string(),
199
+ title: z.string(),
200
+ description: z.string(),
201
+ summary: z.string(),
202
+ sectionLabel: z.string(),
203
+ basePath: z.string(),
204
+ landingPath: z.string(),
205
+ outlinePath: z.string().optional(),
206
+ downloadFileName: z.string(),
207
+ downloadHref: z.string(),
208
+ downloadTitle: z.string(),
209
+ exportRoots: z.array(z.string()).min(1).optional(),
210
+ sidebarItems: z.array(sidebarItemSchema).min(1),
211
+ tags: z.array(z.string()).default(BOOK_MODEL_DEFAULTS.tags ?? [])
212
+ });
213
+ const docsCollectionProvider = resolveDocsCollectionProvider(tenantConfig, { docsLoader, docsSchema });
214
+ return {
215
+ pages: defineCollection({ loader: glob({ pattern: "**/*.{md,mdx}", base: tenantConfig.content.pages }), schema: pageSchema }),
216
+ notes: defineCollection({ loader: glob({ pattern: "**/*.{md,mdx}", base: tenantConfig.content.notes }), schema: noteSchema }),
217
+ questions: defineCollection({ loader: glob({ pattern: "**/*.{md,mdx}", base: tenantConfig.content.questions }), schema: questionSchema }),
218
+ objectives: defineCollection({ loader: glob({ pattern: "**/*.{md,mdx}", base: tenantConfig.content.objectives }), schema: objectiveSchema }),
219
+ people: defineCollection({ loader: glob({ pattern: "**/*.{md,mdx}", base: tenantConfig.content.people }), schema: peopleSchema }),
220
+ agents: defineCollection({ loader: glob({ pattern: "**/*.{md,mdx}", base: tenantConfig.content.agents }), schema: agentSchema }),
221
+ books: defineCollection({ loader: glob({ pattern: "**/*.{md,mdx}", base: tenantConfig.content.books }), schema: bookSchema }),
222
+ docs: defineCollection({
223
+ loader: docsCollectionProvider.loader,
224
+ schema: docsCollectionProvider.schema
225
+ })
226
+ };
227
+ }
228
+ export {
229
+ createTreeseedCollections
230
+ };
@@ -0,0 +1,130 @@
1
+ export type TreeseedFeatureName = 'docs' | 'books' | 'notes' | 'questions' | 'objectives' | 'agents' | 'forms';
2
+ export type TreeseedContentCollection = 'pages' | 'notes' | 'questions' | 'objectives' | 'people' | 'agents' | 'books' | 'docs';
3
+ export interface TreeseedFeatureModules {
4
+ docs?: boolean;
5
+ books?: boolean;
6
+ notes?: boolean;
7
+ questions?: boolean;
8
+ objectives?: boolean;
9
+ agents?: boolean;
10
+ forms?: boolean;
11
+ [key: string]: boolean | undefined;
12
+ }
13
+ export interface TreeseedContentMap {
14
+ pages: string;
15
+ notes: string;
16
+ questions: string;
17
+ objectives: string;
18
+ people: string;
19
+ agents: string;
20
+ books: string;
21
+ docs: string;
22
+ }
23
+ export interface TreeseedBookDefinition {
24
+ order: number;
25
+ slug: string;
26
+ title: string;
27
+ description: string;
28
+ summary: string;
29
+ sectionLabel: string;
30
+ basePath: string;
31
+ landingPath: string;
32
+ outlinePath?: string;
33
+ downloadFileName: string;
34
+ downloadHref: string;
35
+ downloadTitle: string;
36
+ exportRoots?: string[];
37
+ sidebarItems: Array<{
38
+ label: string;
39
+ link?: string;
40
+ autogenerate?: {
41
+ directory: string;
42
+ };
43
+ items?: TreeseedBookDefinition['sidebarItems'];
44
+ }>;
45
+ tags?: string[];
46
+ id?: string;
47
+ }
48
+ export interface TreeseedThemeConfig {
49
+ surfaces?: {
50
+ background?: string;
51
+ backgroundElevated?: string;
52
+ backgroundSoft?: string;
53
+ panel?: string;
54
+ panelStrong?: string;
55
+ };
56
+ text?: {
57
+ body?: string;
58
+ muted?: string;
59
+ soft?: string;
60
+ };
61
+ border?: {
62
+ base?: string;
63
+ strong?: string;
64
+ grid?: string;
65
+ };
66
+ accent?: {
67
+ base?: string;
68
+ strong?: string;
69
+ soft?: string;
70
+ };
71
+ info?: {
72
+ base?: string;
73
+ strong?: string;
74
+ soft?: string;
75
+ };
76
+ warm?: {
77
+ base?: string;
78
+ strong?: string;
79
+ };
80
+ }
81
+ export interface TreeseedPluginReference {
82
+ package: string;
83
+ enabled?: boolean;
84
+ config?: Record<string, unknown>;
85
+ }
86
+ export interface TreeseedProviderSelections {
87
+ forms: string;
88
+ agents: {
89
+ execution: string;
90
+ mutation: string;
91
+ repository: string;
92
+ verification: string;
93
+ notification: string;
94
+ research: string;
95
+ };
96
+ deploy: string;
97
+ content?: {
98
+ docs: string;
99
+ };
100
+ site?: string;
101
+ }
102
+ export interface TreeseedDeployConfig {
103
+ name: string;
104
+ slug: string;
105
+ siteUrl: string;
106
+ contactEmail: string;
107
+ cloudflare: {
108
+ accountId: string;
109
+ workerName?: string;
110
+ };
111
+ plugins: TreeseedPluginReference[];
112
+ providers: TreeseedProviderSelections;
113
+ smtp?: {
114
+ enabled?: boolean;
115
+ };
116
+ turnstile?: {
117
+ enabled?: boolean;
118
+ };
119
+ }
120
+ export interface TreeseedTenantConfig {
121
+ id: string;
122
+ siteConfigPath: string;
123
+ content: TreeseedContentMap;
124
+ features: TreeseedFeatureModules;
125
+ overrides?: {
126
+ pagesRoot?: string;
127
+ stylesRoot?: string;
128
+ componentsRoot?: string;
129
+ };
130
+ }
File without changes
@@ -0,0 +1,4 @@
1
+ import type { TreeseedDeployConfig } from '../contracts';
2
+ export declare function resolveTreeseedDeployConfigPath(configPath?: string): string;
3
+ export declare function deriveCloudflareWorkerName(config: TreeseedDeployConfig): string;
4
+ export declare function loadTreeseedDeployConfig(configPath?: string): TreeseedDeployConfig;
@@ -0,0 +1,154 @@
1
+ import { existsSync, readFileSync } from "node:fs";
2
+ import { dirname, resolve } from "node:path";
3
+ import { parse as parseYaml } from "yaml";
4
+ import { resolveTreeseedTenantRoot } from "../tenant/config.js";
5
+ import {
6
+ TREESEED_DEFAULT_PLUGIN_REFERENCES,
7
+ TREESEED_DEFAULT_PROVIDER_SELECTIONS
8
+ } from "../plugins/constants.js";
9
+ function expectString(value, label) {
10
+ if (typeof value !== "string" || !value.trim()) {
11
+ throw new Error(`Invalid deploy config: expected ${label} to be a non-empty string.`);
12
+ }
13
+ return value.trim();
14
+ }
15
+ function optionalString(value) {
16
+ if (typeof value !== "string" || !value.trim()) {
17
+ return void 0;
18
+ }
19
+ return value.trim();
20
+ }
21
+ function optionalBoolean(value, label) {
22
+ if (value === void 0) {
23
+ return void 0;
24
+ }
25
+ if (typeof value !== "boolean") {
26
+ throw new Error(`Invalid deploy config: expected ${label} to be a boolean when provided.`);
27
+ }
28
+ return value;
29
+ }
30
+ function optionalRecord(value, label) {
31
+ if (value === void 0 || value === null) {
32
+ return void 0;
33
+ }
34
+ if (typeof value !== "object" || Array.isArray(value)) {
35
+ throw new Error(`Invalid deploy config: expected ${label} to be an object when provided.`);
36
+ }
37
+ return value;
38
+ }
39
+ function parsePluginReferences(value) {
40
+ if (value === void 0) {
41
+ return [...TREESEED_DEFAULT_PLUGIN_REFERENCES];
42
+ }
43
+ if (!Array.isArray(value)) {
44
+ throw new Error("Invalid deploy config: expected plugins to be an array.");
45
+ }
46
+ return value.map((entry, index) => {
47
+ const record = optionalRecord(entry, `plugins[${index}]`);
48
+ return {
49
+ package: expectString(record?.package, `plugins[${index}].package`),
50
+ enabled: record?.enabled === void 0 ? true : optionalBoolean(record.enabled, `plugins[${index}].enabled`),
51
+ config: record?.config === void 0 ? {} : optionalRecord(record.config, `plugins[${index}].config`)
52
+ };
53
+ });
54
+ }
55
+ function parseProviderSelections(value) {
56
+ const record = optionalRecord(value, "providers");
57
+ if (!record) {
58
+ return structuredClone(TREESEED_DEFAULT_PROVIDER_SELECTIONS);
59
+ }
60
+ const agentProviders = optionalRecord(record.agents, "providers.agents") ?? {};
61
+ const contentProviders = optionalRecord(record.content, "providers.content") ?? {};
62
+ return {
63
+ forms: expectString(record.forms ?? TREESEED_DEFAULT_PROVIDER_SELECTIONS.forms, "providers.forms"),
64
+ agents: {
65
+ execution: expectString(
66
+ agentProviders.execution ?? TREESEED_DEFAULT_PROVIDER_SELECTIONS.agents.execution,
67
+ "providers.agents.execution"
68
+ ),
69
+ mutation: expectString(
70
+ agentProviders.mutation ?? TREESEED_DEFAULT_PROVIDER_SELECTIONS.agents.mutation,
71
+ "providers.agents.mutation"
72
+ ),
73
+ repository: expectString(
74
+ agentProviders.repository ?? TREESEED_DEFAULT_PROVIDER_SELECTIONS.agents.repository,
75
+ "providers.agents.repository"
76
+ ),
77
+ verification: expectString(
78
+ agentProviders.verification ?? TREESEED_DEFAULT_PROVIDER_SELECTIONS.agents.verification,
79
+ "providers.agents.verification"
80
+ ),
81
+ notification: expectString(
82
+ agentProviders.notification ?? TREESEED_DEFAULT_PROVIDER_SELECTIONS.agents.notification,
83
+ "providers.agents.notification"
84
+ ),
85
+ research: expectString(
86
+ agentProviders.research ?? TREESEED_DEFAULT_PROVIDER_SELECTIONS.agents.research,
87
+ "providers.agents.research"
88
+ )
89
+ },
90
+ deploy: expectString(record.deploy ?? TREESEED_DEFAULT_PROVIDER_SELECTIONS.deploy, "providers.deploy"),
91
+ content: {
92
+ docs: expectString(
93
+ contentProviders.docs ?? TREESEED_DEFAULT_PROVIDER_SELECTIONS.content.docs,
94
+ "providers.content.docs"
95
+ )
96
+ },
97
+ site: expectString(record.site ?? TREESEED_DEFAULT_PROVIDER_SELECTIONS.site, "providers.site")
98
+ };
99
+ }
100
+ function parseDeployConfig(raw) {
101
+ const parsed = parseYaml(raw) ?? {};
102
+ const cloudflare = optionalRecord(parsed.cloudflare, "cloudflare") ?? {};
103
+ const smtp = optionalRecord(parsed.smtp, "smtp") ?? {};
104
+ const turnstile = optionalRecord(parsed.turnstile, "turnstile") ?? {};
105
+ optionalBoolean(turnstile.enabled, "turnstile.enabled");
106
+ return {
107
+ name: expectString(parsed.name, "name"),
108
+ slug: expectString(parsed.slug, "slug"),
109
+ siteUrl: expectString(parsed.siteUrl, "siteUrl"),
110
+ contactEmail: expectString(parsed.contactEmail, "contactEmail"),
111
+ cloudflare: {
112
+ accountId: optionalString(cloudflare.accountId) ?? optionalString(process.env.CLOUDFLARE_ACCOUNT_ID) ?? "replace-with-cloudflare-account-id",
113
+ workerName: optionalString(cloudflare.workerName)
114
+ },
115
+ plugins: parsePluginReferences(parsed.plugins),
116
+ providers: parseProviderSelections(parsed.providers),
117
+ smtp: {
118
+ enabled: optionalBoolean(smtp.enabled, "smtp.enabled")
119
+ },
120
+ turnstile: {
121
+ enabled: true
122
+ }
123
+ };
124
+ }
125
+ function resolveTreeseedDeployConfigPath(configPath = "treeseed.site.yaml") {
126
+ const tenantRoot = resolveTreeseedTenantRoot();
127
+ const candidate = resolve(tenantRoot, configPath);
128
+ if (!existsSync(candidate)) {
129
+ throw new Error(`Unable to resolve Treeseed deploy config at "${candidate}".`);
130
+ }
131
+ return candidate;
132
+ }
133
+ function deriveCloudflareWorkerName(config) {
134
+ return config.cloudflare.workerName?.trim() || config.slug;
135
+ }
136
+ function loadTreeseedDeployConfig(configPath = "treeseed.site.yaml") {
137
+ const resolvedConfigPath = resolveTreeseedDeployConfigPath(configPath);
138
+ const tenantRoot = dirname(resolvedConfigPath);
139
+ const parsed = parseDeployConfig(readFileSync(resolvedConfigPath, "utf8"));
140
+ Object.defineProperty(parsed, "__tenantRoot", {
141
+ value: tenantRoot,
142
+ enumerable: false
143
+ });
144
+ Object.defineProperty(parsed, "__configPath", {
145
+ value: resolvedConfigPath,
146
+ enumerable: false
147
+ });
148
+ return parsed;
149
+ }
150
+ export {
151
+ deriveCloudflareWorkerName,
152
+ loadTreeseedDeployConfig,
153
+ resolveTreeseedDeployConfigPath
154
+ };
@@ -0,0 +1,77 @@
1
+ import { loadTreeseedDeployConfig } from "./config.js";
2
+ import {
3
+ TREESEED_DEFAULT_PLUGIN_REFERENCES,
4
+ TREESEED_DEFAULT_PROVIDER_SELECTIONS
5
+ } from "../plugins/constants.js";
6
+ let cachedDeployConfig = null;
7
+ function defaultDeployConfig() {
8
+ return {
9
+ name: "Treeseed Site",
10
+ slug: "treeseed-site",
11
+ siteUrl: "https://example.com",
12
+ contactEmail: "contact@example.com",
13
+ cloudflare: {
14
+ accountId: "",
15
+ workerName: "treeseed-site"
16
+ },
17
+ plugins: [...TREESEED_DEFAULT_PLUGIN_REFERENCES],
18
+ providers: structuredClone(TREESEED_DEFAULT_PROVIDER_SELECTIONS),
19
+ smtp: {
20
+ enabled: false
21
+ },
22
+ turnstile: {
23
+ enabled: true
24
+ }
25
+ };
26
+ }
27
+ function getTreeseedDeployConfig() {
28
+ if (cachedDeployConfig) {
29
+ return cachedDeployConfig;
30
+ }
31
+ if (typeof __TREESEED_DEPLOY_CONFIG__ !== "undefined" && __TREESEED_DEPLOY_CONFIG__) {
32
+ cachedDeployConfig = __TREESEED_DEPLOY_CONFIG__;
33
+ return cachedDeployConfig;
34
+ }
35
+ try {
36
+ cachedDeployConfig = loadTreeseedDeployConfig();
37
+ return cachedDeployConfig;
38
+ } catch {
39
+ cachedDeployConfig = defaultDeployConfig();
40
+ return cachedDeployConfig;
41
+ }
42
+ }
43
+ function resetTreeseedDeployConfigForTests() {
44
+ cachedDeployConfig = null;
45
+ }
46
+ function getTreeseedFormsProvider() {
47
+ return getTreeseedDeployConfig().providers?.forms ?? TREESEED_DEFAULT_PROVIDER_SELECTIONS.forms;
48
+ }
49
+ function getTreeseedAgentProviderSelections() {
50
+ return getTreeseedDeployConfig().providers?.agents ?? TREESEED_DEFAULT_PROVIDER_SELECTIONS.agents;
51
+ }
52
+ function getTreeseedDeployProvider() {
53
+ return getTreeseedDeployConfig().providers?.deploy ?? TREESEED_DEFAULT_PROVIDER_SELECTIONS.deploy;
54
+ }
55
+ function getTreeseedDocsProvider() {
56
+ return getTreeseedDeployConfig().providers?.content?.docs ?? TREESEED_DEFAULT_PROVIDER_SELECTIONS.content.docs;
57
+ }
58
+ function getTreeseedSiteProvider() {
59
+ return getTreeseedDeployConfig().providers?.site ?? TREESEED_DEFAULT_PROVIDER_SELECTIONS.site;
60
+ }
61
+ function isTreeseedSmtpEnabled() {
62
+ return getTreeseedDeployConfig().smtp?.enabled ?? false;
63
+ }
64
+ function isTreeseedTurnstileEnabled() {
65
+ return getTreeseedDeployConfig().turnstile?.enabled ?? true;
66
+ }
67
+ export {
68
+ getTreeseedAgentProviderSelections,
69
+ getTreeseedDeployConfig,
70
+ getTreeseedDeployProvider,
71
+ getTreeseedDocsProvider,
72
+ getTreeseedFormsProvider,
73
+ getTreeseedSiteProvider,
74
+ isTreeseedSmtpEnabled,
75
+ isTreeseedTurnstileEnabled,
76
+ resetTreeseedDeployConfigForTests
77
+ };