@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.
- package/README.md +145 -0
- package/dist/agents/index.js +5 -0
- package/dist/agents/registry-helper.js +14 -0
- package/dist/agents/registry.js +88 -0
- package/dist/components/DevWatchReload.astro +45 -0
- package/dist/components/SiteTitle.astro +51 -0
- package/dist/components/content/ContentStatusLegend.astro +18 -0
- package/dist/components/content/StatusBadge.astro +11 -0
- package/dist/components/docs/BookFontControls.astro +180 -0
- package/dist/components/docs/DesktopSidebarToggle.astro +88 -0
- package/dist/components/docs/DownloadBook.astro +34 -0
- package/dist/components/docs/Footer.astro +196 -0
- package/dist/components/docs/Header.astro +150 -0
- package/dist/components/docs/PageFrame.astro +260 -0
- package/dist/components/docs/PageSidebar.astro +63 -0
- package/dist/components/docs/PageTitle.astro +39 -0
- package/dist/components/docs/Sidebar.astro +41 -0
- package/dist/components/docs/ThemeSelect.astro +3 -0
- package/dist/components/forms/ContactForm.astro +234 -0
- package/dist/components/forms/FooterSubscribeForm.astro +189 -0
- package/dist/components/site/BookList.astro +27 -0
- package/dist/components/site/CTASection.astro +24 -0
- package/dist/components/site/ChronicleList.astro +33 -0
- package/dist/components/site/Hero.astro +18 -0
- package/dist/components/site/NotesList.astro +18 -0
- package/dist/components/site/PathCard.astro +16 -0
- package/dist/components/site/ProfileList.astro +30 -0
- package/dist/components/site/SectionIntro.astro +9 -0
- package/dist/components/site/StageBanner.astro +8 -0
- package/dist/components/site/TrustCallout.astro +9 -0
- package/dist/components/starlight.js +6 -0
- package/dist/config.js +8 -0
- package/dist/content-config.js +9 -0
- package/dist/content.js +230 -0
- package/dist/contracts.d.ts +130 -0
- package/dist/contracts.js +0 -0
- package/dist/deploy/config.d.ts +4 -0
- package/dist/deploy/config.js +154 -0
- package/dist/deploy/runtime.js +77 -0
- package/dist/env.yaml +322 -0
- package/dist/environment.d.ts +130 -0
- package/dist/environment.js +324 -0
- package/dist/index.js +81 -0
- package/dist/layouts/AuthoredEntryLayout.astro +87 -0
- package/dist/layouts/BookLayout.astro +35 -0
- package/dist/layouts/BridgeLayout.astro +11 -0
- package/dist/layouts/ContentLayout.astro +24 -0
- package/dist/layouts/MainLayout.astro +203 -0
- package/dist/layouts/NoteLayout.astro +26 -0
- package/dist/layouts/ProfileLayout.astro +81 -0
- package/dist/middleware/starlightRouteData.js +45 -0
- package/dist/pages/404.astro +29 -0
- package/dist/pages/[slug].astro +30 -0
- package/dist/pages/agents/[slug].astro +29 -0
- package/dist/pages/agents/index.astro +27 -0
- package/dist/pages/api/form/submit.js +14 -0
- package/dist/pages/books/[slug].astro +19 -0
- package/dist/pages/books/index.astro +28 -0
- package/dist/pages/contact.astro +27 -0
- package/dist/pages/feed.xml.js +34 -0
- package/dist/pages/index.astro +290 -0
- package/dist/pages/notes/[slug].astro +19 -0
- package/dist/pages/notes/index.astro +21 -0
- package/dist/pages/objectives/[slug].astro +31 -0
- package/dist/pages/objectives/index.astro +30 -0
- package/dist/pages/people/[slug].astro +29 -0
- package/dist/pages/people/index.astro +28 -0
- package/dist/pages/questions/[slug].astro +31 -0
- package/dist/pages/questions/index.astro +30 -0
- package/dist/plugin-default.js +4 -0
- package/dist/plugins/builtin/default-plugin.d.ts +21 -0
- package/dist/plugins/builtin/default-plugin.js +32 -0
- package/dist/plugins/constants.d.ts +21 -0
- package/dist/plugins/constants.js +28 -0
- package/dist/plugins/plugin.d.ts +42 -0
- package/dist/plugins/plugin.js +6 -0
- package/dist/plugins/runtime.d.ts +31 -0
- package/dist/plugins/runtime.js +120 -0
- package/dist/scripts/aggregate-book.js +112 -0
- package/dist/scripts/assert-release-tag-version.js +21 -0
- package/dist/scripts/build-dist.js +384 -0
- package/dist/scripts/build-tenant-worker.js +36 -0
- package/dist/scripts/package-tools.js +88 -0
- package/dist/scripts/patch-starlight-content-path.js +172 -0
- package/dist/scripts/paths.js +11 -0
- package/dist/scripts/publish-package.js +20 -0
- package/dist/scripts/release-verify.js +52 -0
- package/dist/scripts/run-fixture-astro-command.js +21 -0
- package/dist/scripts/tenant-astro-command.js +3 -0
- package/dist/scripts/tenant-build.js +16 -0
- package/dist/scripts/tenant-check.js +7 -0
- package/dist/scripts/test-smoke.js +105 -0
- package/dist/server.js +53 -0
- package/dist/site-resources.d.ts +29 -0
- package/dist/site-resources.js +127 -0
- package/dist/site.js +313 -0
- package/dist/styles/global.css +683 -0
- package/dist/styles/prose.css +89 -0
- package/dist/styles/tokens.css +24 -0
- package/dist/tenant/bridge.js +5 -0
- package/dist/tenant/config.d.ts +9 -0
- package/dist/tenant/config.js +124 -0
- package/dist/tenant/runtime-config.js +20 -0
- package/dist/tsconfigs/strict.json +3 -0
- package/dist/types/agents.d.ts +1 -0
- package/dist/types/agents.js +1 -0
- package/dist/types/astro-build.d.js +0 -0
- package/dist/types/cloudflare-sockets.d.js +0 -0
- package/dist/types/cloudflare.d.ts +1 -0
- package/dist/types/cloudflare.js +1 -0
- package/dist/types/forms.js +4 -0
- package/dist/utils/agents/adapters/execution.js +90 -0
- package/dist/utils/agents/adapters/mutations.js +30 -0
- package/dist/utils/agents/adapters/notification.js +16 -0
- package/dist/utils/agents/adapters/repository.js +61 -0
- package/dist/utils/agents/adapters/research.js +25 -0
- package/dist/utils/agents/adapters/verification.js +62 -0
- package/dist/utils/agents/cli-tools.js +5 -0
- package/dist/utils/agents/contracts/messages.d.ts +88 -0
- package/dist/utils/agents/contracts/messages.js +138 -0
- package/dist/utils/agents/contracts/run.d.ts +20 -0
- package/dist/utils/agents/contracts/run.js +0 -0
- package/dist/utils/agents/runtime-types.d.ts +117 -0
- package/dist/utils/agents/runtime-types.js +4 -0
- package/dist/utils/books-data.js +82 -0
- package/dist/utils/content-status.js +38 -0
- package/dist/utils/forms/config.js +87 -0
- package/dist/utils/forms/constants.js +27 -0
- package/dist/utils/forms/contact-submissions-local.js +19 -0
- package/dist/utils/forms/contact-submissions.js +72 -0
- package/dist/utils/forms/crypto.js +64 -0
- package/dist/utils/forms/guard.js +76 -0
- package/dist/utils/forms/http.js +51 -0
- package/dist/utils/forms/provider-core.js +88 -0
- package/dist/utils/forms/routing-core.js +7 -0
- package/dist/utils/forms/routing.js +13 -0
- package/dist/utils/forms/runtime-core.js +17 -0
- package/dist/utils/forms/runtime.js +27 -0
- package/dist/utils/forms/service-core.js +256 -0
- package/dist/utils/forms/service.js +55 -0
- package/dist/utils/forms/session.js +57 -0
- package/dist/utils/forms/smtp-cloudflare.js +107 -0
- package/dist/utils/forms/smtp-node.js +27 -0
- package/dist/utils/forms/smtp.js +10 -0
- package/dist/utils/forms/subscribers-local.js +21 -0
- package/dist/utils/forms/subscribers.js +53 -0
- package/dist/utils/forms/turnstile.js +31 -0
- package/dist/utils/forms/validation.js +58 -0
- package/dist/utils/hub-content.js +28 -0
- package/dist/utils/plugin-runtime.js +158 -0
- package/dist/utils/routes.js +17 -0
- package/dist/utils/seo.js +4 -0
- package/dist/utils/site-config-schema.js +282 -0
- package/dist/utils/site-config.js +122 -0
- package/dist/utils/starlight-nav.js +62 -0
- package/dist/utils/theme.js +49 -0
- package/dist/vendor/starlight/components/AnchorHeading.astro +53 -0
- package/dist/vendor/starlight/components/Banner.astro +23 -0
- package/dist/vendor/starlight/components/ContentNotice.astro +33 -0
- package/dist/vendor/starlight/components/ContentPanel.astro +27 -0
- package/dist/vendor/starlight/components/DraftContentNotice.astro +5 -0
- package/dist/vendor/starlight/components/EditLink.astro +28 -0
- package/dist/vendor/starlight/components/FallbackContentNotice.astro +5 -0
- package/dist/vendor/starlight/components/Footer.astro +61 -0
- package/dist/vendor/starlight/components/Head.astro +5 -0
- package/dist/vendor/starlight/components/Header.astro +94 -0
- package/dist/vendor/starlight/components/Hero.astro +143 -0
- package/dist/vendor/starlight/components/Icons.js +121 -0
- package/dist/vendor/starlight/components/LanguageSelect.astro +57 -0
- package/dist/vendor/starlight/components/LastUpdated.astro +14 -0
- package/dist/vendor/starlight/components/MarkdownContent.astro +5 -0
- package/dist/vendor/starlight/components/MobileMenuFooter.astro +35 -0
- package/dist/vendor/starlight/components/MobileMenuToggle.astro +107 -0
- package/dist/vendor/starlight/components/MobileTableOfContents.astro +151 -0
- package/dist/vendor/starlight/components/Page.astro +126 -0
- package/dist/vendor/starlight/components/PageFrame.astro +97 -0
- package/dist/vendor/starlight/components/PageSidebar.astro +59 -0
- package/dist/vendor/starlight/components/PageTitle.astro +17 -0
- package/dist/vendor/starlight/components/Pagination.astro +79 -0
- package/dist/vendor/starlight/components/Search.astro +488 -0
- package/dist/vendor/starlight/components/Select.astro +99 -0
- package/dist/vendor/starlight/components/Sidebar.astro +15 -0
- package/dist/vendor/starlight/components/SidebarPersistState.js +43 -0
- package/dist/vendor/starlight/components/SidebarPersister.astro +78 -0
- package/dist/vendor/starlight/components/SidebarRestorePoint.astro +12 -0
- package/dist/vendor/starlight/components/SidebarSublist.astro +154 -0
- package/dist/vendor/starlight/components/SiteTitle.astro +59 -0
- package/dist/vendor/starlight/components/SkipLink.astro +26 -0
- package/dist/vendor/starlight/components/SocialIcons.astro +32 -0
- package/dist/vendor/starlight/components/StarlightPage.astro +17 -0
- package/dist/vendor/starlight/components/TableOfContents/TableOfContentsList.astro +79 -0
- package/dist/vendor/starlight/components/TableOfContents/starlight-toc.js +93 -0
- package/dist/vendor/starlight/components/TableOfContents.astro +18 -0
- package/dist/vendor/starlight/components/ThemeProvider.astro +38 -0
- package/dist/vendor/starlight/components/ThemeSelect.astro +73 -0
- package/dist/vendor/starlight/components/TwoColumnContent.astro +54 -0
- package/dist/vendor/starlight/components.js +26 -0
- package/dist/vendor/starlight/constants.js +4 -0
- package/dist/vendor/starlight/expressive-code.d.js +1 -0
- package/dist/vendor/starlight/global.d.js +0 -0
- package/dist/vendor/starlight/i18n.d.js +1 -0
- package/dist/vendor/starlight/index.js +119 -0
- package/dist/vendor/starlight/integrations/asides-error.js +12 -0
- package/dist/vendor/starlight/integrations/asides.js +179 -0
- package/dist/vendor/starlight/integrations/code-rtl-support.js +21 -0
- package/dist/vendor/starlight/integrations/expressive-code/hast.d.js +1 -0
- package/dist/vendor/starlight/integrations/expressive-code/index.js +63 -0
- package/dist/vendor/starlight/integrations/expressive-code/preprocessor.js +92 -0
- package/dist/vendor/starlight/integrations/expressive-code/themes/night-owl-dark.jsonc +1796 -0
- package/dist/vendor/starlight/integrations/expressive-code/themes/night-owl-dark.jsonc.js +1 -0
- package/dist/vendor/starlight/integrations/expressive-code/themes/night-owl-light.jsonc +1695 -0
- package/dist/vendor/starlight/integrations/expressive-code/themes/night-owl-light.jsonc.js +1 -0
- package/dist/vendor/starlight/integrations/expressive-code/theming.js +62 -0
- package/dist/vendor/starlight/integrations/expressive-code/translations.js +29 -0
- package/dist/vendor/starlight/integrations/heading-links.js +61 -0
- package/dist/vendor/starlight/integrations/pagefind.js +43 -0
- package/dist/vendor/starlight/integrations/remark-rehype.js +68 -0
- package/dist/vendor/starlight/integrations/shared/absolutePathToLang.js +15 -0
- package/dist/vendor/starlight/integrations/shared/localeToLang.js +9 -0
- package/dist/vendor/starlight/integrations/shared/slugToLocale.js +10 -0
- package/dist/vendor/starlight/integrations/sitemap.js +20 -0
- package/dist/vendor/starlight/integrations/virtual-user-config.js +110 -0
- package/dist/vendor/starlight/integrations/vite-layer-order.js +42 -0
- package/dist/vendor/starlight/internal.js +6 -0
- package/dist/vendor/starlight/loaders.js +36 -0
- package/dist/vendor/starlight/locals.d.js +0 -0
- package/dist/vendor/starlight/locals.js +30 -0
- package/dist/vendor/starlight/package.json +231 -0
- package/dist/vendor/starlight/package.json.js +248 -0
- package/dist/vendor/starlight/props.js +0 -0
- package/dist/vendor/starlight/route-data.js +6 -0
- package/dist/vendor/starlight/routes/common.astro +23 -0
- package/dist/vendor/starlight/routes/ssr/404.astro +7 -0
- package/dist/vendor/starlight/routes/ssr/index.astro +14 -0
- package/dist/vendor/starlight/routes/static/404.astro +7 -0
- package/dist/vendor/starlight/routes/static/index.astro +12 -0
- package/dist/vendor/starlight/schema.js +102 -0
- package/dist/vendor/starlight/schemas/badge.js +26 -0
- package/dist/vendor/starlight/schemas/components.js +235 -0
- package/dist/vendor/starlight/schemas/expressiveCode.js +12 -0
- package/dist/vendor/starlight/schemas/favicon.js +33 -0
- package/dist/vendor/starlight/schemas/head.js +32 -0
- package/dist/vendor/starlight/schemas/hero.js +57 -0
- package/dist/vendor/starlight/schemas/i18n.js +101 -0
- package/dist/vendor/starlight/schemas/icon.js +7 -0
- package/dist/vendor/starlight/schemas/logo.js +24 -0
- package/dist/vendor/starlight/schemas/pagefind.js +108 -0
- package/dist/vendor/starlight/schemas/prevNextLink.js +14 -0
- package/dist/vendor/starlight/schemas/sidebar.js +80 -0
- package/dist/vendor/starlight/schemas/site-title.js +19 -0
- package/dist/vendor/starlight/schemas/social.js +19 -0
- package/dist/vendor/starlight/schemas/tableOfContents.js +16 -0
- package/dist/vendor/starlight/style/anchor-links.css +131 -0
- package/dist/vendor/starlight/style/asides.css +51 -0
- package/dist/vendor/starlight/style/layers.css +1 -0
- package/dist/vendor/starlight/style/markdown.css +253 -0
- package/dist/vendor/starlight/style/print.css +175 -0
- package/dist/vendor/starlight/style/props.css +188 -0
- package/dist/vendor/starlight/style/reset.css +52 -0
- package/dist/vendor/starlight/style/util.css +63 -0
- package/dist/vendor/starlight/translations/ar.json +30 -0
- package/dist/vendor/starlight/translations/ar.json.js +32 -0
- package/dist/vendor/starlight/translations/ca.json +43 -0
- package/dist/vendor/starlight/translations/ca.json.js +45 -0
- package/dist/vendor/starlight/translations/cs.json +43 -0
- package/dist/vendor/starlight/translations/cs.json.js +45 -0
- package/dist/vendor/starlight/translations/da.json +30 -0
- package/dist/vendor/starlight/translations/da.json.js +32 -0
- package/dist/vendor/starlight/translations/de.json +30 -0
- package/dist/vendor/starlight/translations/de.json.js +32 -0
- package/dist/vendor/starlight/translations/el.json +30 -0
- package/dist/vendor/starlight/translations/el.json.js +32 -0
- package/dist/vendor/starlight/translations/en.json +30 -0
- package/dist/vendor/starlight/translations/en.json.js +32 -0
- package/dist/vendor/starlight/translations/es.json +43 -0
- package/dist/vendor/starlight/translations/es.json.js +45 -0
- package/dist/vendor/starlight/translations/fa.json +30 -0
- package/dist/vendor/starlight/translations/fa.json.js +32 -0
- package/dist/vendor/starlight/translations/fi.json +30 -0
- package/dist/vendor/starlight/translations/fi.json.js +32 -0
- package/dist/vendor/starlight/translations/fr.json +33 -0
- package/dist/vendor/starlight/translations/fr.json.js +35 -0
- package/dist/vendor/starlight/translations/gl.json +43 -0
- package/dist/vendor/starlight/translations/gl.json.js +45 -0
- package/dist/vendor/starlight/translations/he.json +30 -0
- package/dist/vendor/starlight/translations/he.json.js +32 -0
- package/dist/vendor/starlight/translations/hi.json +30 -0
- package/dist/vendor/starlight/translations/hi.json.js +32 -0
- package/dist/vendor/starlight/translations/hu.json +43 -0
- package/dist/vendor/starlight/translations/hu.json.js +45 -0
- package/dist/vendor/starlight/translations/id.json +30 -0
- package/dist/vendor/starlight/translations/id.json.js +32 -0
- package/dist/vendor/starlight/translations/index.js +77 -0
- package/dist/vendor/starlight/translations/it.json +30 -0
- package/dist/vendor/starlight/translations/it.json.js +32 -0
- package/dist/vendor/starlight/translations/ja.json +30 -0
- package/dist/vendor/starlight/translations/ja.json.js +32 -0
- package/dist/vendor/starlight/translations/ko.json +30 -0
- package/dist/vendor/starlight/translations/ko.json.js +32 -0
- package/dist/vendor/starlight/translations/lv.json +30 -0
- package/dist/vendor/starlight/translations/lv.json.js +32 -0
- package/dist/vendor/starlight/translations/nb.json +30 -0
- package/dist/vendor/starlight/translations/nb.json.js +32 -0
- package/dist/vendor/starlight/translations/nl.json +30 -0
- package/dist/vendor/starlight/translations/nl.json.js +32 -0
- package/dist/vendor/starlight/translations/pl.json +33 -0
- package/dist/vendor/starlight/translations/pl.json.js +35 -0
- package/dist/vendor/starlight/translations/pt.json +30 -0
- package/dist/vendor/starlight/translations/pt.json.js +32 -0
- package/dist/vendor/starlight/translations/ro.json +30 -0
- package/dist/vendor/starlight/translations/ro.json.js +32 -0
- package/dist/vendor/starlight/translations/ru.json +33 -0
- package/dist/vendor/starlight/translations/ru.json.js +35 -0
- package/dist/vendor/starlight/translations/sk.json +30 -0
- package/dist/vendor/starlight/translations/sk.json.js +32 -0
- package/dist/vendor/starlight/translations/sv.json +30 -0
- package/dist/vendor/starlight/translations/sv.json.js +32 -0
- package/dist/vendor/starlight/translations/th.json +30 -0
- package/dist/vendor/starlight/translations/th.json.js +32 -0
- package/dist/vendor/starlight/translations/tr.json +30 -0
- package/dist/vendor/starlight/translations/tr.json.js +32 -0
- package/dist/vendor/starlight/translations/uk.json +30 -0
- package/dist/vendor/starlight/translations/uk.json.js +32 -0
- package/dist/vendor/starlight/translations/vi.json +30 -0
- package/dist/vendor/starlight/translations/vi.json.js +32 -0
- package/dist/vendor/starlight/translations/zh-CN.json +30 -0
- package/dist/vendor/starlight/translations/zh-CN.json.js +32 -0
- package/dist/vendor/starlight/translations/zh-TW.json +30 -0
- package/dist/vendor/starlight/translations/zh-TW.json.js +32 -0
- package/dist/vendor/starlight/types.js +0 -0
- package/dist/vendor/starlight/user-components/Aside.astro +40 -0
- package/dist/vendor/starlight/user-components/Badge.astro +148 -0
- package/dist/vendor/starlight/user-components/Card.astro +68 -0
- package/dist/vendor/starlight/user-components/CardGrid.astro +38 -0
- package/dist/vendor/starlight/user-components/FileTree.astro +137 -0
- package/dist/vendor/starlight/user-components/Icon.astro +42 -0
- package/dist/vendor/starlight/user-components/LinkButton.astro +78 -0
- package/dist/vendor/starlight/user-components/LinkCard.astro +78 -0
- package/dist/vendor/starlight/user-components/Steps.astro +90 -0
- package/dist/vendor/starlight/user-components/TabItem.astro +19 -0
- package/dist/vendor/starlight/user-components/Tabs.astro +268 -0
- package/dist/vendor/starlight/user-components/file-tree-icons.js +608 -0
- package/dist/vendor/starlight/user-components/rehype-file-tree.js +160 -0
- package/dist/vendor/starlight/user-components/rehype-steps.js +53 -0
- package/dist/vendor/starlight/user-components/rehype-tabs.js +73 -0
- package/dist/vendor/starlight/utils/base.js +14 -0
- package/dist/vendor/starlight/utils/canonical.js +13 -0
- package/dist/vendor/starlight/utils/collection-fs.js +13 -0
- package/dist/vendor/starlight/utils/collection.js +16 -0
- package/dist/vendor/starlight/utils/createPathFormatter.js +39 -0
- package/dist/vendor/starlight/utils/createTranslationSystem.js +60 -0
- package/dist/vendor/starlight/utils/error-map.js +110 -0
- package/dist/vendor/starlight/utils/format-path.js +9 -0
- package/dist/vendor/starlight/utils/generateToC.js +18 -0
- package/dist/vendor/starlight/utils/git.js +92 -0
- package/dist/vendor/starlight/utils/gitInlined.js +13 -0
- package/dist/vendor/starlight/utils/head.js +156 -0
- package/dist/vendor/starlight/utils/i18n.js +121 -0
- package/dist/vendor/starlight/utils/localizedUrl.js +37 -0
- package/dist/vendor/starlight/utils/navigation.js +320 -0
- package/dist/vendor/starlight/utils/path.js +52 -0
- package/dist/vendor/starlight/utils/plugins.js +355 -0
- package/dist/vendor/starlight/utils/routing/data.js +116 -0
- package/dist/vendor/starlight/utils/routing/index.js +107 -0
- package/dist/vendor/starlight/utils/routing/middleware.js +40 -0
- package/dist/vendor/starlight/utils/routing/types.js +0 -0
- package/dist/vendor/starlight/utils/routing.js +1 -0
- package/dist/vendor/starlight/utils/slugs.js +70 -0
- package/dist/vendor/starlight/utils/starlight-page.js +123 -0
- package/dist/vendor/starlight/utils/translations-fs.js +31 -0
- package/dist/vendor/starlight/utils/translations.js +31 -0
- package/dist/vendor/starlight/utils/types.js +0 -0
- package/dist/vendor/starlight/utils/url.js +5 -0
- package/dist/vendor/starlight/utils/user-config.js +255 -0
- package/dist/vendor/starlight/utils/validateLogoImports.js +22 -0
- package/dist/vendor/starlight/virtual-internal.d.js +0 -0
- package/dist/vendor/starlight/virtual.d.js +0 -0
- package/dist/worker/forms-worker.js +141 -0
- package/package.json +156 -0
- package/style/anchor-links.css +131 -0
- package/templates/github/deploy.workflow.yml +47 -0
- package/tsconfigs/strict.json +3 -0
- package/utils/git.ts +121 -0
- package/utils/gitInlined.ts +20 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
export interface QuestionPriorityUpdatedMessage {
|
|
2
|
+
questionId: string;
|
|
3
|
+
reason: string;
|
|
4
|
+
plannerRunId: string;
|
|
5
|
+
}
|
|
6
|
+
export interface ObjectivePriorityUpdatedMessage {
|
|
7
|
+
objectiveId: string;
|
|
8
|
+
reason: string;
|
|
9
|
+
plannerRunId: string;
|
|
10
|
+
}
|
|
11
|
+
export interface ArchitectureUpdatedMessage {
|
|
12
|
+
objectiveId: string;
|
|
13
|
+
knowledgeId: string;
|
|
14
|
+
architectRunId: string;
|
|
15
|
+
}
|
|
16
|
+
export interface SubscriberNotifiedMessage {
|
|
17
|
+
email: string;
|
|
18
|
+
itemCount: number;
|
|
19
|
+
notifierRunId: string;
|
|
20
|
+
}
|
|
21
|
+
export interface ResearchStartedMessage {
|
|
22
|
+
questionId: string;
|
|
23
|
+
researcherRunId: string;
|
|
24
|
+
}
|
|
25
|
+
export interface ResearchCompletedMessage {
|
|
26
|
+
questionId: string;
|
|
27
|
+
knowledgeId: string | null;
|
|
28
|
+
researcherRunId: string;
|
|
29
|
+
}
|
|
30
|
+
export interface TaskCompleteMessage {
|
|
31
|
+
branchName: string | null;
|
|
32
|
+
changedTargets: string[];
|
|
33
|
+
engineerRunId: string;
|
|
34
|
+
}
|
|
35
|
+
export interface TaskWaitingMessage {
|
|
36
|
+
blockingReason: string;
|
|
37
|
+
engineerRunId: string;
|
|
38
|
+
}
|
|
39
|
+
export interface TaskFailedMessage {
|
|
40
|
+
failureSummary: string;
|
|
41
|
+
engineerRunId: string;
|
|
42
|
+
}
|
|
43
|
+
export interface TaskVerifiedMessage {
|
|
44
|
+
branchName: string | null;
|
|
45
|
+
reviewerRunId: string;
|
|
46
|
+
}
|
|
47
|
+
export interface ReviewFailedMessage {
|
|
48
|
+
failureSummary: string;
|
|
49
|
+
reviewerRunId: string;
|
|
50
|
+
}
|
|
51
|
+
export interface ReviewWaitingMessage {
|
|
52
|
+
blockingReason: string;
|
|
53
|
+
reviewerRunId: string;
|
|
54
|
+
}
|
|
55
|
+
export interface ReleaseStartedMessage {
|
|
56
|
+
taskRunId: string | null;
|
|
57
|
+
releaserRunId: string;
|
|
58
|
+
}
|
|
59
|
+
export interface ReleaseCompletedMessage {
|
|
60
|
+
releaseSummary: string;
|
|
61
|
+
releaserRunId: string;
|
|
62
|
+
}
|
|
63
|
+
export interface ReleaseFailedMessage {
|
|
64
|
+
failureSummary: string;
|
|
65
|
+
releaserRunId: string;
|
|
66
|
+
}
|
|
67
|
+
export interface AgentMessageContracts {
|
|
68
|
+
question_priority_updated: QuestionPriorityUpdatedMessage;
|
|
69
|
+
objective_priority_updated: ObjectivePriorityUpdatedMessage;
|
|
70
|
+
architecture_updated: ArchitectureUpdatedMessage;
|
|
71
|
+
subscriber_notified: SubscriberNotifiedMessage;
|
|
72
|
+
research_started: ResearchStartedMessage;
|
|
73
|
+
research_completed: ResearchCompletedMessage;
|
|
74
|
+
task_complete: TaskCompleteMessage;
|
|
75
|
+
task_waiting: TaskWaitingMessage;
|
|
76
|
+
task_failed: TaskFailedMessage;
|
|
77
|
+
task_verified: TaskVerifiedMessage;
|
|
78
|
+
review_failed: ReviewFailedMessage;
|
|
79
|
+
review_waiting: ReviewWaitingMessage;
|
|
80
|
+
release_started: ReleaseStartedMessage;
|
|
81
|
+
release_completed: ReleaseCompletedMessage;
|
|
82
|
+
release_failed: ReleaseFailedMessage;
|
|
83
|
+
}
|
|
84
|
+
export type AgentMessageType = keyof AgentMessageContracts;
|
|
85
|
+
export type AgentMessagePayload<TType extends AgentMessageType> = AgentMessageContracts[TType];
|
|
86
|
+
export declare const AGENT_MESSAGE_TYPES: readonly ["question_priority_updated", "objective_priority_updated", "architecture_updated", "subscriber_notified", "research_started", "research_completed", "task_complete", "task_waiting", "task_failed", "task_verified", "review_failed", "review_waiting", "release_started", "release_completed", "release_failed"];
|
|
87
|
+
export declare function parseAgentMessagePayload<TType extends AgentMessageType>(type: TType, payloadJson: string): AgentMessagePayload<TType>;
|
|
88
|
+
export declare function serializeAgentMessagePayload<TType extends AgentMessageType>(type: TType, payload: AgentMessagePayload<TType>): Record<string, unknown>;
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
const AGENT_MESSAGE_TYPES = [
|
|
2
|
+
"question_priority_updated",
|
|
3
|
+
"objective_priority_updated",
|
|
4
|
+
"architecture_updated",
|
|
5
|
+
"subscriber_notified",
|
|
6
|
+
"research_started",
|
|
7
|
+
"research_completed",
|
|
8
|
+
"task_complete",
|
|
9
|
+
"task_waiting",
|
|
10
|
+
"task_failed",
|
|
11
|
+
"task_verified",
|
|
12
|
+
"review_failed",
|
|
13
|
+
"review_waiting",
|
|
14
|
+
"release_started",
|
|
15
|
+
"release_completed",
|
|
16
|
+
"release_failed"
|
|
17
|
+
];
|
|
18
|
+
function ensureString(value, label) {
|
|
19
|
+
if (typeof value !== "string" || value.trim().length === 0) {
|
|
20
|
+
throw new Error(`Invalid ${label}: expected non-empty string.`);
|
|
21
|
+
}
|
|
22
|
+
return value;
|
|
23
|
+
}
|
|
24
|
+
function ensureOptionalString(value, label) {
|
|
25
|
+
if (value === null || value === void 0) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
return ensureString(value, label);
|
|
29
|
+
}
|
|
30
|
+
function ensureStringArray(value, label) {
|
|
31
|
+
if (!Array.isArray(value)) {
|
|
32
|
+
throw new Error(`Invalid ${label}: expected array.`);
|
|
33
|
+
}
|
|
34
|
+
return value.map((entry, index) => ensureString(entry, `${label}[${index}]`));
|
|
35
|
+
}
|
|
36
|
+
function ensureNumber(value, label) {
|
|
37
|
+
if (typeof value !== "number" || Number.isNaN(value)) {
|
|
38
|
+
throw new Error(`Invalid ${label}: expected number.`);
|
|
39
|
+
}
|
|
40
|
+
return value;
|
|
41
|
+
}
|
|
42
|
+
function parseAgentMessagePayload(type, payloadJson) {
|
|
43
|
+
const parsed = JSON.parse(payloadJson);
|
|
44
|
+
switch (type) {
|
|
45
|
+
case "question_priority_updated":
|
|
46
|
+
return {
|
|
47
|
+
questionId: ensureString(parsed.questionId, "questionId"),
|
|
48
|
+
reason: ensureString(parsed.reason, "reason"),
|
|
49
|
+
plannerRunId: ensureString(parsed.plannerRunId, "plannerRunId")
|
|
50
|
+
};
|
|
51
|
+
case "objective_priority_updated":
|
|
52
|
+
return {
|
|
53
|
+
objectiveId: ensureString(parsed.objectiveId, "objectiveId"),
|
|
54
|
+
reason: ensureString(parsed.reason, "reason"),
|
|
55
|
+
plannerRunId: ensureString(parsed.plannerRunId, "plannerRunId")
|
|
56
|
+
};
|
|
57
|
+
case "architecture_updated":
|
|
58
|
+
return {
|
|
59
|
+
objectiveId: ensureString(parsed.objectiveId, "objectiveId"),
|
|
60
|
+
knowledgeId: ensureString(parsed.knowledgeId, "knowledgeId"),
|
|
61
|
+
architectRunId: ensureString(parsed.architectRunId, "architectRunId")
|
|
62
|
+
};
|
|
63
|
+
case "subscriber_notified":
|
|
64
|
+
return {
|
|
65
|
+
email: ensureString(parsed.email, "email"),
|
|
66
|
+
itemCount: ensureNumber(parsed.itemCount, "itemCount"),
|
|
67
|
+
notifierRunId: ensureString(parsed.notifierRunId, "notifierRunId")
|
|
68
|
+
};
|
|
69
|
+
case "research_started":
|
|
70
|
+
return {
|
|
71
|
+
questionId: ensureString(parsed.questionId, "questionId"),
|
|
72
|
+
researcherRunId: ensureString(parsed.researcherRunId, "researcherRunId")
|
|
73
|
+
};
|
|
74
|
+
case "research_completed":
|
|
75
|
+
return {
|
|
76
|
+
questionId: ensureString(parsed.questionId, "questionId"),
|
|
77
|
+
knowledgeId: ensureOptionalString(parsed.knowledgeId, "knowledgeId"),
|
|
78
|
+
researcherRunId: ensureString(parsed.researcherRunId, "researcherRunId")
|
|
79
|
+
};
|
|
80
|
+
case "task_complete":
|
|
81
|
+
return {
|
|
82
|
+
branchName: ensureOptionalString(parsed.branchName, "branchName"),
|
|
83
|
+
changedTargets: ensureStringArray(parsed.changedTargets, "changedTargets"),
|
|
84
|
+
engineerRunId: ensureString(parsed.engineerRunId, "engineerRunId")
|
|
85
|
+
};
|
|
86
|
+
case "task_waiting":
|
|
87
|
+
return {
|
|
88
|
+
blockingReason: ensureString(parsed.blockingReason, "blockingReason"),
|
|
89
|
+
engineerRunId: ensureString(parsed.engineerRunId, "engineerRunId")
|
|
90
|
+
};
|
|
91
|
+
case "task_failed":
|
|
92
|
+
return {
|
|
93
|
+
failureSummary: ensureString(parsed.failureSummary, "failureSummary"),
|
|
94
|
+
engineerRunId: ensureString(parsed.engineerRunId, "engineerRunId")
|
|
95
|
+
};
|
|
96
|
+
case "task_verified":
|
|
97
|
+
return {
|
|
98
|
+
branchName: ensureOptionalString(parsed.branchName, "branchName"),
|
|
99
|
+
reviewerRunId: ensureString(parsed.reviewerRunId, "reviewerRunId")
|
|
100
|
+
};
|
|
101
|
+
case "review_failed":
|
|
102
|
+
return {
|
|
103
|
+
failureSummary: ensureString(parsed.failureSummary, "failureSummary"),
|
|
104
|
+
reviewerRunId: ensureString(parsed.reviewerRunId, "reviewerRunId")
|
|
105
|
+
};
|
|
106
|
+
case "review_waiting":
|
|
107
|
+
return {
|
|
108
|
+
blockingReason: ensureString(parsed.blockingReason, "blockingReason"),
|
|
109
|
+
reviewerRunId: ensureString(parsed.reviewerRunId, "reviewerRunId")
|
|
110
|
+
};
|
|
111
|
+
case "release_started":
|
|
112
|
+
return {
|
|
113
|
+
taskRunId: ensureOptionalString(parsed.taskRunId, "taskRunId"),
|
|
114
|
+
releaserRunId: ensureString(parsed.releaserRunId, "releaserRunId")
|
|
115
|
+
};
|
|
116
|
+
case "release_completed":
|
|
117
|
+
return {
|
|
118
|
+
releaseSummary: ensureString(parsed.releaseSummary, "releaseSummary"),
|
|
119
|
+
releaserRunId: ensureString(parsed.releaserRunId, "releaserRunId")
|
|
120
|
+
};
|
|
121
|
+
case "release_failed":
|
|
122
|
+
return {
|
|
123
|
+
failureSummary: ensureString(parsed.failureSummary, "failureSummary"),
|
|
124
|
+
releaserRunId: ensureString(parsed.releaserRunId, "releaserRunId")
|
|
125
|
+
};
|
|
126
|
+
default:
|
|
127
|
+
throw new Error(`Unsupported message type "${type}".`);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
function serializeAgentMessagePayload(type, payload) {
|
|
131
|
+
parseAgentMessagePayload(type, JSON.stringify(payload));
|
|
132
|
+
return payload;
|
|
133
|
+
}
|
|
134
|
+
export {
|
|
135
|
+
AGENT_MESSAGE_TYPES,
|
|
136
|
+
parseAgentMessagePayload,
|
|
137
|
+
serializeAgentMessagePayload
|
|
138
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type AgentErrorCategory = 'trigger_resolution_error' | 'permission_error' | 'message_claim_error' | 'lease_error' | 'execution_error' | 'mutation_error' | 'sdk_error';
|
|
2
|
+
export interface AgentRunTrace {
|
|
3
|
+
[key: string]: unknown;
|
|
4
|
+
runId: string;
|
|
5
|
+
agentSlug: string;
|
|
6
|
+
handlerKind: string;
|
|
7
|
+
triggerKind: string;
|
|
8
|
+
triggerSource: string;
|
|
9
|
+
claimedMessageId: number | null;
|
|
10
|
+
selectedItemKey: string | null;
|
|
11
|
+
branchName: string | null;
|
|
12
|
+
commitSha: string | null;
|
|
13
|
+
changedPaths: string[];
|
|
14
|
+
summary: string | null;
|
|
15
|
+
error: string | null;
|
|
16
|
+
errorCategory: AgentErrorCategory | null;
|
|
17
|
+
startedAt: string;
|
|
18
|
+
finishedAt: string | null;
|
|
19
|
+
status: string;
|
|
20
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import type { AgentHandlerKind, AgentRuntimeSpec, AgentRunStatus, AgentTriggerConfig } from '@treeseed/sdk/types/agents';
|
|
2
|
+
import type { AgentErrorCategory } from './contracts/run.ts';
|
|
3
|
+
import type { ScopedAgentSdk, SdkMessageEntity } from '@treeseed/sdk';
|
|
4
|
+
export interface AgentTriggerInvocation {
|
|
5
|
+
kind: 'startup' | 'schedule' | 'message' | 'manual' | 'follow';
|
|
6
|
+
source: string;
|
|
7
|
+
trigger: AgentTriggerConfig;
|
|
8
|
+
message?: SdkMessageEntity | null;
|
|
9
|
+
followModels?: string[];
|
|
10
|
+
cursorValue?: string | null;
|
|
11
|
+
}
|
|
12
|
+
export interface AgentExecutionResult {
|
|
13
|
+
status: AgentRunStatus;
|
|
14
|
+
summary: string;
|
|
15
|
+
stdout?: string;
|
|
16
|
+
stderr?: string;
|
|
17
|
+
errorCategory?: AgentErrorCategory | null;
|
|
18
|
+
metadata?: Record<string, unknown>;
|
|
19
|
+
}
|
|
20
|
+
export interface AgentMutationResult {
|
|
21
|
+
branchName: string | null;
|
|
22
|
+
commitMessage: string | null;
|
|
23
|
+
worktreePath: string | null;
|
|
24
|
+
commitSha: string | null;
|
|
25
|
+
changedPaths: string[];
|
|
26
|
+
}
|
|
27
|
+
export interface AgentRepositoryInspectionResult {
|
|
28
|
+
branchName: string | null;
|
|
29
|
+
changedPaths: string[];
|
|
30
|
+
commitSha: string | null;
|
|
31
|
+
summary: string;
|
|
32
|
+
}
|
|
33
|
+
export interface AgentVerificationResult {
|
|
34
|
+
status: 'completed' | 'failed' | 'waiting';
|
|
35
|
+
summary: string;
|
|
36
|
+
stdout?: string;
|
|
37
|
+
stderr?: string;
|
|
38
|
+
errorCategory?: AgentErrorCategory | null;
|
|
39
|
+
}
|
|
40
|
+
export interface AgentNotificationResult {
|
|
41
|
+
status: 'completed' | 'failed' | 'waiting';
|
|
42
|
+
summary: string;
|
|
43
|
+
deliveredCount: number;
|
|
44
|
+
}
|
|
45
|
+
export interface AgentResearchResult {
|
|
46
|
+
status: 'completed' | 'failed' | 'waiting';
|
|
47
|
+
summary: string;
|
|
48
|
+
markdown: string;
|
|
49
|
+
sources?: string[];
|
|
50
|
+
errorCategory?: AgentErrorCategory | null;
|
|
51
|
+
}
|
|
52
|
+
export interface AgentExecutionAdapter {
|
|
53
|
+
runTask(input: {
|
|
54
|
+
agent: AgentRuntimeSpec;
|
|
55
|
+
runId: string;
|
|
56
|
+
prompt: string;
|
|
57
|
+
}): Promise<AgentExecutionResult>;
|
|
58
|
+
}
|
|
59
|
+
export interface AgentMutationAdapter {
|
|
60
|
+
writeArtifact(input: {
|
|
61
|
+
runId: string;
|
|
62
|
+
agent: AgentRuntimeSpec;
|
|
63
|
+
relativePath: string;
|
|
64
|
+
content: string;
|
|
65
|
+
commitMessage: string;
|
|
66
|
+
}): Promise<AgentMutationResult>;
|
|
67
|
+
}
|
|
68
|
+
export interface AgentRepositoryInspectionAdapter {
|
|
69
|
+
inspectBranch(input: {
|
|
70
|
+
repoRoot: string;
|
|
71
|
+
branchName: string | null;
|
|
72
|
+
}): Promise<AgentRepositoryInspectionResult>;
|
|
73
|
+
}
|
|
74
|
+
export interface AgentVerificationAdapter {
|
|
75
|
+
runChecks(input: {
|
|
76
|
+
agent: AgentRuntimeSpec;
|
|
77
|
+
runId: string;
|
|
78
|
+
commands: string[];
|
|
79
|
+
}): Promise<AgentVerificationResult>;
|
|
80
|
+
}
|
|
81
|
+
export interface AgentNotificationAdapter {
|
|
82
|
+
deliver(input: {
|
|
83
|
+
agent: AgentRuntimeSpec;
|
|
84
|
+
runId: string;
|
|
85
|
+
recipients: string[];
|
|
86
|
+
subject: string;
|
|
87
|
+
body: string;
|
|
88
|
+
}): Promise<AgentNotificationResult>;
|
|
89
|
+
}
|
|
90
|
+
export interface AgentResearchAdapter {
|
|
91
|
+
research(input: {
|
|
92
|
+
agent: AgentRuntimeSpec;
|
|
93
|
+
runId: string;
|
|
94
|
+
questionId: string;
|
|
95
|
+
reason: string | null;
|
|
96
|
+
}): Promise<AgentResearchResult>;
|
|
97
|
+
}
|
|
98
|
+
export interface AgentContext {
|
|
99
|
+
runId: string;
|
|
100
|
+
repoRoot: string;
|
|
101
|
+
agent: AgentRuntimeSpec;
|
|
102
|
+
sdk: ScopedAgentSdk;
|
|
103
|
+
trigger: AgentTriggerInvocation;
|
|
104
|
+
execution: AgentExecutionAdapter;
|
|
105
|
+
mutations: AgentMutationAdapter;
|
|
106
|
+
repository: AgentRepositoryInspectionAdapter;
|
|
107
|
+
verification: AgentVerificationAdapter;
|
|
108
|
+
notifications: AgentNotificationAdapter;
|
|
109
|
+
research: AgentResearchAdapter;
|
|
110
|
+
}
|
|
111
|
+
export interface AgentHandler<TInputs = unknown, TResult = unknown> {
|
|
112
|
+
kind: AgentHandlerKind;
|
|
113
|
+
resolveInputs(context: AgentContext): Promise<TInputs>;
|
|
114
|
+
execute(context: AgentContext, inputs: TInputs): Promise<TResult>;
|
|
115
|
+
emitOutputs(context: AgentContext, result: TResult): Promise<AgentExecutionResult>;
|
|
116
|
+
}
|
|
117
|
+
export declare const TRESEED_AGENT_RUNTIME_TYPES_MODULE = true;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { readFileSync, readdirSync, statSync } from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { parse as parseYaml } from "yaml";
|
|
4
|
+
import { getTenantContentRoot } from "../tenant/config.js";
|
|
5
|
+
import { RUNTIME_PROJECT_ROOT, RUNTIME_TENANT } from "../tenant/runtime-config.js";
|
|
6
|
+
function sortPaths(paths) {
|
|
7
|
+
return [...paths].sort((left, right) => left.localeCompare(right, void 0, { numeric: true, sensitivity: "base" }));
|
|
8
|
+
}
|
|
9
|
+
function collectMarkdownFiles(rootPath) {
|
|
10
|
+
const stats = statSync(rootPath);
|
|
11
|
+
if (stats.isFile()) {
|
|
12
|
+
return [rootPath];
|
|
13
|
+
}
|
|
14
|
+
return sortPaths(
|
|
15
|
+
readdirSync(rootPath, { withFileTypes: true }).flatMap((entry) => {
|
|
16
|
+
const fullPath = path.join(rootPath, entry.name);
|
|
17
|
+
if (entry.isDirectory()) {
|
|
18
|
+
return collectMarkdownFiles(fullPath);
|
|
19
|
+
}
|
|
20
|
+
if (entry.isFile() && (entry.name.endsWith(".md") || entry.name.endsWith(".mdx"))) {
|
|
21
|
+
return [fullPath];
|
|
22
|
+
}
|
|
23
|
+
return [];
|
|
24
|
+
})
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
function parseFrontmatter(filePath) {
|
|
28
|
+
const raw = readFileSync(filePath, "utf8");
|
|
29
|
+
const match = raw.match(/^---\r?\n([\s\S]*?)\r?\n---/);
|
|
30
|
+
if (!match) {
|
|
31
|
+
throw new Error(`Book content entry is missing frontmatter: ${filePath}`);
|
|
32
|
+
}
|
|
33
|
+
return parseYaml(match[1]);
|
|
34
|
+
}
|
|
35
|
+
function inferDocsLibraryDownload(book) {
|
|
36
|
+
const title = book?.title ? `${book.title} Library` : "Knowledge Library";
|
|
37
|
+
return {
|
|
38
|
+
downloadFileName: "treeseed-knowledge.md",
|
|
39
|
+
downloadHref: "/books/treeseed-knowledge.md",
|
|
40
|
+
downloadTitle: title
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function buildTenantBookRuntime(tenantConfig, options = {}) {
|
|
44
|
+
const projectRoot = options.projectRoot ?? process.cwd();
|
|
45
|
+
const booksContentRoot = path.resolve(projectRoot, getTenantContentRoot(tenantConfig, "books"));
|
|
46
|
+
const books = collectMarkdownFiles(booksContentRoot).map((filePath) => {
|
|
47
|
+
const frontmatter = parseFrontmatter(filePath);
|
|
48
|
+
return {
|
|
49
|
+
...frontmatter,
|
|
50
|
+
id: path.basename(filePath, path.extname(filePath))
|
|
51
|
+
};
|
|
52
|
+
}).sort((left, right) => left.order - right.order);
|
|
53
|
+
const docsHomePath = options.docsHomePath ?? "/knowledge/";
|
|
54
|
+
const docsLibraryDownload = options.docsLibraryDownload ?? inferDocsLibraryDownload(tenantConfig);
|
|
55
|
+
return {
|
|
56
|
+
BOOKS: books,
|
|
57
|
+
BOOKS_LINK: {
|
|
58
|
+
label: "Books",
|
|
59
|
+
link: docsHomePath
|
|
60
|
+
},
|
|
61
|
+
TREESEED_LINKS: {
|
|
62
|
+
home: docsHomePath
|
|
63
|
+
},
|
|
64
|
+
TREESEED_LIBRARY_DOWNLOAD: docsLibraryDownload
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
const runtime = buildTenantBookRuntime(RUNTIME_TENANT, {
|
|
68
|
+
projectRoot: RUNTIME_PROJECT_ROOT,
|
|
69
|
+
docsLibraryDownload: {
|
|
70
|
+
downloadFileName: "treeseed-knowledge.md",
|
|
71
|
+
downloadHref: "/books/treeseed-knowledge.md",
|
|
72
|
+
downloadTitle: "TreeSeed Knowledge Library"
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
const { BOOKS, BOOKS_LINK, TREESEED_LINKS, TREESEED_LIBRARY_DOWNLOAD } = runtime;
|
|
76
|
+
export {
|
|
77
|
+
BOOKS,
|
|
78
|
+
BOOKS_LINK,
|
|
79
|
+
TREESEED_LIBRARY_DOWNLOAD,
|
|
80
|
+
TREESEED_LINKS,
|
|
81
|
+
buildTenantBookRuntime
|
|
82
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { SITE } from "./site-config.js";
|
|
2
|
+
const CONTENT_STATUSES = ["live", "in progress", "exploratory", "planned", "speculative"];
|
|
3
|
+
const CONTENT_STATUS_META = {
|
|
4
|
+
live: {
|
|
5
|
+
label: "Live",
|
|
6
|
+
description: "Materially exists and is maintained.",
|
|
7
|
+
tone: "border-[color:var(--site-accent)]/35 bg-[color:var(--site-accent-soft)] text-[color:var(--site-accent-strong)]"
|
|
8
|
+
},
|
|
9
|
+
"in progress": {
|
|
10
|
+
label: "In Progress",
|
|
11
|
+
description: "Actively being built or hardened.",
|
|
12
|
+
tone: "border-[color:var(--site-warm)]/40 bg-[color:rgba(215,176,123,0.18)] text-[color:var(--site-warm-strong)]"
|
|
13
|
+
},
|
|
14
|
+
exploratory: {
|
|
15
|
+
label: "Exploratory",
|
|
16
|
+
description: "Directionally important, but still unsettled.",
|
|
17
|
+
tone: "border-[color:var(--site-blue)]/40 bg-[color:var(--site-blue-soft)] text-[color:var(--site-blue-strong)]"
|
|
18
|
+
},
|
|
19
|
+
planned: {
|
|
20
|
+
label: "Planned",
|
|
21
|
+
description: "Intended, but not started in a meaningful way.",
|
|
22
|
+
tone: "border-[color:#9c9277]/35 bg-[color:rgba(156,146,119,0.14)] text-[color:#5f5743]"
|
|
23
|
+
},
|
|
24
|
+
speculative: {
|
|
25
|
+
label: "Speculative",
|
|
26
|
+
description: "Conceptual or long-range, not a current commitment.",
|
|
27
|
+
tone: "border-[color:#a39b8e]/35 bg-[color:rgba(163,155,142,0.14)] text-[color:#4d4638]"
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
const PROJECT_STAGE = {
|
|
31
|
+
label: SITE.projectStage,
|
|
32
|
+
description: SITE.projectStageDetail
|
|
33
|
+
};
|
|
34
|
+
export {
|
|
35
|
+
CONTENT_STATUSES,
|
|
36
|
+
CONTENT_STATUS_META,
|
|
37
|
+
PROJECT_STAGE
|
|
38
|
+
};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import {
|
|
2
|
+
TREESEED_FORM_TOKEN_SECRET,
|
|
3
|
+
TREESEED_FORMS_LOCAL_BYPASS_CLOUDFLARE_GUARDS,
|
|
4
|
+
TREESEED_FORMS_LOCAL_BYPASS_TURNSTILE,
|
|
5
|
+
TREESEED_FORMS_LOCAL_USE_MAILPIT,
|
|
6
|
+
TREESEED_LOCAL_DEV_MODE,
|
|
7
|
+
TREESEED_MAILPIT_SMTP_HOST,
|
|
8
|
+
TREESEED_MAILPIT_SMTP_PORT,
|
|
9
|
+
TREESEED_SMTP_FROM,
|
|
10
|
+
TREESEED_SMTP_HOST,
|
|
11
|
+
TREESEED_SMTP_PASSWORD,
|
|
12
|
+
TREESEED_SMTP_PORT,
|
|
13
|
+
TREESEED_SMTP_REPLY_TO,
|
|
14
|
+
TREESEED_SMTP_USERNAME,
|
|
15
|
+
TREESEED_TURNSTILE_SECRET_KEY
|
|
16
|
+
} from "astro:env/server";
|
|
17
|
+
import { SITE_EMAIL_NOTIFICATIONS } from "../site-config.js";
|
|
18
|
+
import { getTreeseedFormsProvider, isTreeseedSmtpEnabled, isTreeseedTurnstileEnabled } from "../../deploy/runtime.js";
|
|
19
|
+
function getFormSecret() {
|
|
20
|
+
return TREESEED_FORM_TOKEN_SECRET ?? "";
|
|
21
|
+
}
|
|
22
|
+
function getTurnstileSecret() {
|
|
23
|
+
return TREESEED_TURNSTILE_SECRET_KEY ?? "";
|
|
24
|
+
}
|
|
25
|
+
function getContactRoutingMap() {
|
|
26
|
+
return SITE_EMAIL_NOTIFICATIONS.contactRouting;
|
|
27
|
+
}
|
|
28
|
+
function getSubscribeRecipients() {
|
|
29
|
+
return SITE_EMAIL_NOTIFICATIONS.subscribeRecipients;
|
|
30
|
+
}
|
|
31
|
+
function getSmtpConfig() {
|
|
32
|
+
const useMailpit = TREESEED_FORMS_LOCAL_USE_MAILPIT ?? false;
|
|
33
|
+
return {
|
|
34
|
+
host: useMailpit ? TREESEED_MAILPIT_SMTP_HOST ?? TREESEED_SMTP_HOST ?? "127.0.0.1" : TREESEED_SMTP_HOST ?? "",
|
|
35
|
+
port: useMailpit ? TREESEED_MAILPIT_SMTP_PORT ?? TREESEED_SMTP_PORT ?? 1025 : TREESEED_SMTP_PORT ?? 465,
|
|
36
|
+
username: TREESEED_SMTP_USERNAME ?? "",
|
|
37
|
+
password: TREESEED_SMTP_PASSWORD ?? "",
|
|
38
|
+
from: TREESEED_SMTP_FROM ?? "",
|
|
39
|
+
replyTo: TREESEED_SMTP_REPLY_TO ?? ""
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
function getFormsMode() {
|
|
43
|
+
return getTreeseedFormsProvider();
|
|
44
|
+
}
|
|
45
|
+
function getLocalDevMode() {
|
|
46
|
+
if (TREESEED_LOCAL_DEV_MODE === "cloudflare") {
|
|
47
|
+
return "cloudflare";
|
|
48
|
+
}
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
function shouldBypassTurnstileByEnv() {
|
|
52
|
+
return TREESEED_FORMS_LOCAL_BYPASS_TURNSTILE;
|
|
53
|
+
}
|
|
54
|
+
function shouldBypassCloudflareGuardsByEnv() {
|
|
55
|
+
return TREESEED_FORMS_LOCAL_BYPASS_CLOUDFLARE_GUARDS;
|
|
56
|
+
}
|
|
57
|
+
function shouldUseMailpit() {
|
|
58
|
+
return TREESEED_FORMS_LOCAL_USE_MAILPIT ?? false;
|
|
59
|
+
}
|
|
60
|
+
function isSmtpConfigured() {
|
|
61
|
+
const smtp = getSmtpConfig();
|
|
62
|
+
return Boolean(smtp.host && smtp.port && smtp.from);
|
|
63
|
+
}
|
|
64
|
+
function isSmtpEnabled() {
|
|
65
|
+
if (shouldUseMailpit()) {
|
|
66
|
+
return true;
|
|
67
|
+
}
|
|
68
|
+
return isTreeseedSmtpEnabled() && isSmtpConfigured();
|
|
69
|
+
}
|
|
70
|
+
function isTurnstileEnabled() {
|
|
71
|
+
return isTreeseedTurnstileEnabled() && Boolean(getTurnstileSecret());
|
|
72
|
+
}
|
|
73
|
+
export {
|
|
74
|
+
getContactRoutingMap,
|
|
75
|
+
getFormSecret,
|
|
76
|
+
getFormsMode,
|
|
77
|
+
getLocalDevMode,
|
|
78
|
+
getSmtpConfig,
|
|
79
|
+
getSubscribeRecipients,
|
|
80
|
+
getTurnstileSecret,
|
|
81
|
+
isSmtpConfigured,
|
|
82
|
+
isSmtpEnabled,
|
|
83
|
+
isTurnstileEnabled,
|
|
84
|
+
shouldBypassCloudflareGuardsByEnv,
|
|
85
|
+
shouldBypassTurnstileByEnv,
|
|
86
|
+
shouldUseMailpit
|
|
87
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
const FORM_SESSION_COOKIE = "treeseed_form_session";
|
|
2
|
+
const FORM_TOKEN_TTL_MS = 30 * 60 * 1e3;
|
|
3
|
+
const NONCE_TTL_SECONDS = 60 * 60;
|
|
4
|
+
const RATE_LIMIT_TTL_SECONDS = 10 * 60;
|
|
5
|
+
const RATE_LIMIT_MAX_ATTEMPTS = 3;
|
|
6
|
+
const HONEYPOT_FIELD = "website";
|
|
7
|
+
const FORM_SUCCESS_PARAM = "formStatus";
|
|
8
|
+
const FORM_CODE_PARAM = "formCode";
|
|
9
|
+
const SUBSCRIBE_ANCHOR_ID = "site-subscribe";
|
|
10
|
+
const CONTACT_TYPE_LABELS = {
|
|
11
|
+
question: "Question",
|
|
12
|
+
feedback: "Feedback",
|
|
13
|
+
collaboration: "Collaboration",
|
|
14
|
+
issue: "Report Issue"
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
CONTACT_TYPE_LABELS,
|
|
18
|
+
FORM_CODE_PARAM,
|
|
19
|
+
FORM_SESSION_COOKIE,
|
|
20
|
+
FORM_SUCCESS_PARAM,
|
|
21
|
+
FORM_TOKEN_TTL_MS,
|
|
22
|
+
HONEYPOT_FIELD,
|
|
23
|
+
NONCE_TTL_SECONDS,
|
|
24
|
+
RATE_LIMIT_MAX_ATTEMPTS,
|
|
25
|
+
RATE_LIMIT_TTL_SECONDS,
|
|
26
|
+
SUBSCRIBE_ANCHOR_ID
|
|
27
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { hashValue } from "./crypto.js";
|
|
2
|
+
const localContactSubmissions = globalThis.__treeseedFixtureContactSubmissions ?? [];
|
|
3
|
+
globalThis.__treeseedFixtureContactSubmissions = localContactSubmissions;
|
|
4
|
+
async function createLocalContactSubmission(input) {
|
|
5
|
+
localContactSubmissions.push({
|
|
6
|
+
name: input.name,
|
|
7
|
+
email: input.email,
|
|
8
|
+
organization: input.organization,
|
|
9
|
+
contactType: input.contactType,
|
|
10
|
+
subject: input.subject,
|
|
11
|
+
message: input.message,
|
|
12
|
+
userAgent: input.userAgent || "unknown user agent",
|
|
13
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
14
|
+
ipHash: await hashValue(input.ip || "unknown")
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
createLocalContactSubmission
|
|
19
|
+
};
|