@treeseed/sdk 0.1.2 → 0.3.1

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 (237) hide show
  1. package/README.md +97 -506
  2. package/dist/{src/cli-tools.d.ts → cli-tools.d.ts} +1 -1
  3. package/dist/cli-tools.js +5 -3
  4. package/dist/{src/content-store.d.ts → content-store.d.ts} +3 -2
  5. package/dist/content-store.js +52 -20
  6. package/dist/{src/d1-store.d.ts → d1-store.d.ts} +62 -1
  7. package/dist/d1-store.js +625 -65
  8. package/dist/field-aliases.d.ts +11 -0
  9. package/dist/field-aliases.js +41 -0
  10. package/dist/graph/build.d.ts +19 -0
  11. package/dist/graph/build.js +949 -0
  12. package/dist/graph/dsl.d.ts +2 -0
  13. package/dist/graph/dsl.js +243 -0
  14. package/dist/graph/query.d.ts +47 -0
  15. package/dist/graph/query.js +447 -0
  16. package/dist/graph/ranking.d.ts +3 -0
  17. package/dist/graph/ranking.js +483 -0
  18. package/dist/graph/schema.d.ts +142 -0
  19. package/dist/graph/schema.js +133 -0
  20. package/dist/graph.d.ts +52 -0
  21. package/dist/graph.js +133 -0
  22. package/dist/index.d.ts +28 -0
  23. package/dist/index.js +91 -2
  24. package/dist/model-registry.d.ts +8 -0
  25. package/dist/model-registry.js +351 -25
  26. package/dist/operations/providers/default.d.ts +10 -0
  27. package/dist/operations/providers/default.js +514 -0
  28. package/dist/operations/runtime.d.ts +7 -0
  29. package/dist/operations/runtime.js +60 -0
  30. package/dist/operations/services/config-runtime.d.ts +269 -0
  31. package/dist/operations/services/config-runtime.js +1397 -0
  32. package/dist/operations/services/d1-migration.d.ts +6 -0
  33. package/dist/operations/services/d1-migration.js +89 -0
  34. package/dist/operations/services/deploy.d.ts +371 -0
  35. package/dist/operations/services/deploy.js +981 -0
  36. package/dist/operations/services/git-workflow.d.ts +49 -0
  37. package/dist/operations/services/git-workflow.js +218 -0
  38. package/dist/operations/services/github-automation.d.ts +156 -0
  39. package/dist/operations/services/github-automation.js +256 -0
  40. package/dist/operations/services/local-dev.d.ts +9 -0
  41. package/dist/operations/services/local-dev.js +106 -0
  42. package/dist/operations/services/mailpit-runtime.d.ts +4 -0
  43. package/dist/operations/services/mailpit-runtime.js +59 -0
  44. package/dist/operations/services/railway-deploy.d.ts +53 -0
  45. package/dist/operations/services/railway-deploy.js +123 -0
  46. package/dist/operations/services/runtime-paths.d.ts +19 -0
  47. package/dist/operations/services/runtime-paths.js +54 -0
  48. package/dist/operations/services/runtime-tools.d.ts +117 -0
  49. package/dist/operations/services/runtime-tools.js +358 -0
  50. package/dist/operations/services/save-deploy-preflight.d.ts +34 -0
  51. package/dist/operations/services/save-deploy-preflight.js +76 -0
  52. package/dist/operations/services/template-registry.d.ts +88 -0
  53. package/dist/operations/services/template-registry.js +407 -0
  54. package/dist/operations/services/watch-dev.d.ts +21 -0
  55. package/dist/operations/services/watch-dev.js +284 -0
  56. package/dist/operations/services/workspace-preflight.d.ts +40 -0
  57. package/dist/operations/services/workspace-preflight.js +165 -0
  58. package/dist/operations/services/workspace-save.d.ts +42 -0
  59. package/dist/operations/services/workspace-save.js +235 -0
  60. package/dist/operations/services/workspace-tools.d.ts +16 -0
  61. package/dist/operations/services/workspace-tools.js +270 -0
  62. package/dist/operations-registry.d.ts +5 -0
  63. package/dist/operations-registry.js +68 -0
  64. package/dist/operations-types.d.ts +71 -0
  65. package/dist/operations-types.js +17 -0
  66. package/dist/operations.d.ts +6 -0
  67. package/dist/operations.js +16 -0
  68. package/dist/platform/books-data.d.ts +1 -0
  69. package/dist/platform/books-data.js +1 -0
  70. package/dist/platform/contracts.d.ts +158 -0
  71. package/dist/platform/contracts.js +0 -0
  72. package/dist/platform/deploy/config.d.ts +4 -0
  73. package/dist/platform/deploy/config.js +222 -0
  74. package/dist/platform/deploy-config.d.ts +1 -0
  75. package/dist/platform/deploy-config.js +1 -0
  76. package/dist/platform/deploy-runtime.d.ts +18 -0
  77. package/dist/platform/deploy-runtime.js +78 -0
  78. package/dist/platform/env.yaml +394 -0
  79. package/dist/platform/environment.d.ts +130 -0
  80. package/dist/platform/environment.js +331 -0
  81. package/dist/platform/plugin.d.ts +2 -0
  82. package/dist/platform/plugin.js +4 -0
  83. package/dist/platform/plugins/constants.d.ts +22 -0
  84. package/dist/platform/plugins/constants.js +29 -0
  85. package/dist/platform/plugins/plugin.d.ts +51 -0
  86. package/dist/platform/plugins/plugin.js +6 -0
  87. package/dist/platform/plugins/runtime.d.ts +35 -0
  88. package/dist/platform/plugins/runtime.js +161 -0
  89. package/dist/platform/plugins.d.ts +6 -0
  90. package/dist/platform/plugins.js +38 -0
  91. package/dist/platform/site-config-schema.js +1 -0
  92. package/dist/platform/tenant/config.d.ts +9 -0
  93. package/dist/platform/tenant/config.js +154 -0
  94. package/dist/platform/tenant/runtime-config.d.ts +4 -0
  95. package/dist/platform/tenant/runtime-config.js +20 -0
  96. package/dist/platform/tenant-config.d.ts +1 -0
  97. package/dist/platform/tenant-config.js +1 -0
  98. package/dist/platform/utils/books-data.d.ts +29 -0
  99. package/dist/platform/utils/books-data.js +82 -0
  100. package/dist/platform/utils/site-config-schema.js +321 -0
  101. package/dist/remote.d.ts +175 -0
  102. package/dist/remote.js +202 -0
  103. package/dist/runtime.js +35 -22
  104. package/dist/scripts/aggregate-book.js +121 -0
  105. package/dist/scripts/build-dist.js +54 -13
  106. package/dist/scripts/build-tenant-worker.js +36 -0
  107. package/dist/scripts/cleanup-markdown.js +373 -0
  108. package/dist/scripts/cli-test-fixtures.js +48 -0
  109. package/dist/scripts/config-treeseed.js +95 -0
  110. package/dist/scripts/ensure-mailpit.js +29 -0
  111. package/dist/scripts/local-dev.js +129 -0
  112. package/dist/scripts/logs-mailpit.js +2 -0
  113. package/dist/scripts/patch-starlight-content-path.js +172 -0
  114. package/dist/scripts/release-verify.js +34 -6
  115. package/dist/scripts/run-fixture-astro-command.js +18 -0
  116. package/dist/scripts/scaffold-site.js +65 -0
  117. package/dist/scripts/stop-mailpit.js +5 -0
  118. package/dist/scripts/sync-dev-vars.js +6 -0
  119. package/dist/scripts/sync-template.js +20 -0
  120. package/dist/scripts/template-catalog.test.js +100 -0
  121. package/dist/scripts/template-command.js +31 -0
  122. package/dist/scripts/tenant-astro-command.js +3 -0
  123. package/dist/scripts/tenant-build.js +16 -0
  124. package/dist/scripts/tenant-check.js +7 -0
  125. package/dist/scripts/tenant-d1-migrate-local.js +11 -0
  126. package/dist/scripts/tenant-deploy.js +180 -0
  127. package/dist/scripts/tenant-destroy.js +104 -0
  128. package/dist/scripts/tenant-dev.js +171 -0
  129. package/dist/scripts/tenant-lint.js +4 -0
  130. package/dist/scripts/tenant-test.js +4 -0
  131. package/dist/scripts/test-cloudflare-local.js +212 -0
  132. package/dist/scripts/test-scaffold.js +314 -0
  133. package/dist/scripts/test-smoke.js +71 -13
  134. package/dist/scripts/treeseed-assert-release-tag-version.js +21 -0
  135. package/dist/scripts/treeseed-build-dist.js +134 -0
  136. package/dist/scripts/treeseed-publish-package.js +19 -0
  137. package/dist/scripts/treeseed-release-verify.js +131 -0
  138. package/dist/scripts/treeseed-run-ts.js +45 -0
  139. package/dist/scripts/validate-templates.js +6 -0
  140. package/dist/scripts/verify-driver.js +29 -0
  141. package/dist/scripts/workflow-commands.test.js +39 -0
  142. package/dist/scripts/workspace-close.js +24 -0
  143. package/dist/scripts/workspace-command-e2e.js +718 -0
  144. package/dist/scripts/workspace-lint.js +9 -0
  145. package/dist/scripts/workspace-preflight.js +22 -0
  146. package/dist/scripts/workspace-publish-changed-packages.js +16 -0
  147. package/dist/scripts/workspace-release-verify.js +81 -0
  148. package/dist/scripts/workspace-release.js +42 -0
  149. package/dist/scripts/workspace-save.js +124 -0
  150. package/dist/scripts/workspace-start-warning.js +3 -0
  151. package/dist/scripts/workspace-start.js +71 -0
  152. package/dist/scripts/workspace-test-unit.js +4 -0
  153. package/dist/scripts/workspace-test.js +11 -0
  154. package/dist/sdk-fields.d.ts +11 -0
  155. package/dist/sdk-fields.js +169 -0
  156. package/dist/sdk-filters.d.ts +4 -0
  157. package/dist/sdk-filters.js +12 -15
  158. package/dist/sdk-types.d.ts +796 -0
  159. package/dist/sdk-types.js +7 -1
  160. package/dist/sdk-version.d.ts +2 -0
  161. package/dist/sdk-version.js +42 -0
  162. package/dist/sdk.d.ts +215 -0
  163. package/dist/sdk.js +235 -11
  164. package/dist/stores/cursor-store.js +9 -3
  165. package/dist/stores/lease-store.js +8 -2
  166. package/dist/{src/stores → stores}/message-store.d.ts +1 -1
  167. package/dist/stores/message-store.js +27 -3
  168. package/dist/stores/operational-store.d.ts +24 -0
  169. package/dist/stores/operational-store.js +279 -0
  170. package/dist/stores/run-store.js +8 -1
  171. package/dist/stores/subscription-store.js +7 -5
  172. package/dist/template-catalog.d.ts +13 -0
  173. package/dist/template-catalog.js +141 -0
  174. package/dist/treeseed/services/compose.yml +7 -0
  175. package/dist/treeseed/template-catalog/catalog.fixture.json +55 -0
  176. package/dist/treeseed/template-catalog/templates/starter-basic/template/astro.config.d.ts +2 -0
  177. package/dist/treeseed/template-catalog/templates/starter-basic/template/astro.config.ts +3 -0
  178. package/dist/treeseed/template-catalog/templates/starter-basic/template/package.json +32 -0
  179. package/dist/treeseed/template-catalog/templates/starter-basic/template/src/config.yaml +40 -0
  180. package/dist/treeseed/template-catalog/templates/starter-basic/template/src/content/empty/.gitkeep +1 -0
  181. package/dist/treeseed/template-catalog/templates/starter-basic/template/src/content/knowledge/handbook/index.mdx +11 -0
  182. package/dist/treeseed/template-catalog/templates/starter-basic/template/src/content/pages/welcome.mdx +11 -0
  183. package/dist/treeseed/template-catalog/templates/starter-basic/template/src/content.config.d.ts +1 -0
  184. package/dist/treeseed/template-catalog/templates/starter-basic/template/src/content.config.ts +3 -0
  185. package/dist/treeseed/template-catalog/templates/starter-basic/template/src/env.yaml +1 -0
  186. package/dist/treeseed/template-catalog/templates/starter-basic/template/src/manifest.yaml +19 -0
  187. package/dist/treeseed/template-catalog/templates/starter-basic/template/treeseed.site.yaml +26 -0
  188. package/dist/treeseed/template-catalog/templates/starter-basic/template/tsconfig.json +9 -0
  189. package/dist/treeseed/template-catalog/templates/starter-basic/template.config.json +90 -0
  190. package/dist/utils/agents/contracts/messages.d.ts +88 -0
  191. package/dist/utils/agents/contracts/messages.js +138 -0
  192. package/dist/utils/agents/contracts/run.d.ts +20 -0
  193. package/dist/utils/agents/contracts/run.js +0 -0
  194. package/dist/utils/agents/runtime-types.d.ts +117 -0
  195. package/dist/utils/agents/runtime-types.js +4 -0
  196. package/dist/verification.d.ts +20 -0
  197. package/dist/verification.js +98 -0
  198. package/dist/workflow/operations.d.ts +396 -0
  199. package/dist/workflow/operations.js +841 -0
  200. package/dist/workflow-state.d.ts +56 -0
  201. package/dist/workflow-state.js +195 -0
  202. package/dist/workflow-support.d.ts +9 -0
  203. package/dist/workflow-support.js +176 -0
  204. package/dist/workflow.d.ts +111 -0
  205. package/dist/workflow.js +97 -0
  206. package/package.json +111 -5
  207. package/scripts/verify-driver.mjs +29 -0
  208. package/dist/scripts/.ts-run-1775630384291-crtqr3izsa.js +0 -22
  209. package/dist/scripts/.ts-run-1775630388025-vnjle0z75a.js +0 -129
  210. package/dist/scripts/assert-release-tag-version.d.ts +0 -1
  211. package/dist/scripts/build-dist.d.ts +0 -1
  212. package/dist/scripts/fixture-tools.d.ts +0 -5
  213. package/dist/scripts/package-tools.d.ts +0 -15
  214. package/dist/scripts/publish-package.d.ts +0 -1
  215. package/dist/scripts/release-verify.d.ts +0 -1
  216. package/dist/scripts/test-smoke.d.ts +0 -1
  217. package/dist/src/index.d.ts +0 -6
  218. package/dist/src/model-registry.d.ts +0 -4
  219. package/dist/src/sdk-filters.d.ts +0 -4
  220. package/dist/src/sdk-types.d.ts +0 -285
  221. package/dist/src/sdk.d.ts +0 -109
  222. package/dist/test/test-fixture.d.ts +0 -1
  223. package/dist/test/utils/envelopes.test.d.ts +0 -1
  224. package/dist/test/utils/sdk.test.d.ts +0 -1
  225. package/dist/vitest.config.d.ts +0 -2
  226. /package/dist/{src/frontmatter.d.ts → frontmatter.d.ts} +0 -0
  227. /package/dist/{src/git-runtime.d.ts → git-runtime.d.ts} +0 -0
  228. /package/dist/{src/runtime.d.ts → runtime.d.ts} +0 -0
  229. /package/dist/{src/stores → stores}/cursor-store.d.ts +0 -0
  230. /package/dist/{src/stores → stores}/envelopes.d.ts +0 -0
  231. /package/dist/{src/stores → stores}/helpers.d.ts +0 -0
  232. /package/dist/{src/stores → stores}/lease-store.d.ts +0 -0
  233. /package/dist/{src/stores → stores}/run-store.d.ts +0 -0
  234. /package/dist/{src/stores → stores}/subscription-store.d.ts +0 -0
  235. /package/dist/{src/types → types}/agents.d.ts +0 -0
  236. /package/dist/{src/types → types}/cloudflare.d.ts +0 -0
  237. /package/dist/{src/wrangler-d1.d.ts → wrangler-d1.d.ts} +0 -0
@@ -0,0 +1,394 @@
1
+ entries:
2
+ GH_TOKEN:
3
+ label: GitHub access token
4
+ group: auth
5
+ description: Personal access token used by Treeseed for GitHub CLI automation, repository setup, CI secret sync, and GitHub Copilot SDK-backed workflows.
6
+ howToGet: "Create a GitHub fine-grained personal access token scoped to the TreeSeed repository. Required repository permissions: Contents read/write, Environments read/write, Secrets and variables read/write, Actions and workflows read/write, Pull requests read/write, Issues read/write. Then paste it here as GH_TOKEN."
7
+ sensitivity: secret
8
+ targets:
9
+ - local-file
10
+ - railway-secret
11
+ scopes:
12
+ - local
13
+ - staging
14
+ - prod
15
+ requirement: required
16
+ purposes:
17
+ - save
18
+ - config
19
+ validation:
20
+ kind: nonempty
21
+ sourcePriority:
22
+ - machine-config
23
+ - process-env
24
+ CLOUDFLARE_API_TOKEN:
25
+ label: Cloudflare API token
26
+ group: auth
27
+ description: Account-level Cloudflare API token used by Wrangler and CI to manage Pages, Workers, Workers KV, D1, Queues, DNS, secrets, and deploys.
28
+ howToGet: "Create a Cloudflare account-level API token scoped to the target domain and account. Required permissions: Account Cloudflare Pages edit, Account Workers Scripts edit, Account Workers KV Storage edit, Account D1 edit, Account Queues edit, Zone DNS edit. Then paste it here as CLOUDFLARE_API_TOKEN."
29
+ sensitivity: secret
30
+ targets:
31
+ - local-file
32
+ - github-secret
33
+ scopes:
34
+ - local
35
+ - staging
36
+ - prod
37
+ requirement: required
38
+ purposes:
39
+ - save
40
+ - deploy
41
+ - destroy
42
+ - config
43
+ validation:
44
+ kind: nonempty
45
+ sourcePriority:
46
+ - machine-config
47
+ - process-env
48
+ RAILWAY_API_TOKEN:
49
+ label: Railway API token
50
+ group: auth
51
+ description: Primary Railway token for user or workspace scoped access, including project creation and most Treeseed-managed Railway flows.
52
+ howToGet: In Railway, create a user or workspace API token that can create and manage the target project, then paste it here as RAILWAY_API_TOKEN.
53
+ sensitivity: secret
54
+ targets:
55
+ - local-file
56
+ - railway-secret
57
+ scopes:
58
+ - local
59
+ - staging
60
+ - prod
61
+ requirement: conditional
62
+ purposes:
63
+ - deploy
64
+ - destroy
65
+ - config
66
+ validation:
67
+ kind: nonempty
68
+ sourcePriority:
69
+ - machine-config
70
+ - process-env
71
+ relevanceRef: railwayManagedEnabled
72
+ requiredWhenRef: railwayManagedEnabled
73
+ RAILWAY_TOKEN:
74
+ label: Railway project token
75
+ group: auth
76
+ description: Optional Railway token for project-scoped resource management after a project already exists.
77
+ howToGet: In Railway, generate a project-scoped token only if you need project resource management separate from the primary API token, then paste it here as RAILWAY_TOKEN.
78
+ sensitivity: secret
79
+ targets:
80
+ - local-file
81
+ - railway-secret
82
+ scopes:
83
+ - local
84
+ - staging
85
+ - prod
86
+ requirement: optional
87
+ purposes:
88
+ - deploy
89
+ - destroy
90
+ - config
91
+ validation:
92
+ kind: nonempty
93
+ sourcePriority:
94
+ - machine-config
95
+ - process-env
96
+ relevanceRef: railwayManagedEnabled
97
+ CLOUDFLARE_ACCOUNT_ID:
98
+ label: Cloudflare account ID
99
+ group: cloudflare
100
+ description: Identifies the Cloudflare account Treeseed should provision and deploy into.
101
+ howToGet: In the Cloudflare dashboard, open Workers & Pages or Account Home and copy the account ID.
102
+ sensitivity: plain
103
+ targets:
104
+ - local-file
105
+ - github-variable
106
+ - config-file
107
+ scopes:
108
+ - staging
109
+ - prod
110
+ requirement: required
111
+ purposes:
112
+ - save
113
+ - deploy
114
+ - destroy
115
+ - config
116
+ validation:
117
+ kind: nonempty
118
+ sourcePriority:
119
+ - machine-config
120
+ - process-env
121
+ - treeseed.site.yaml
122
+ TREESEED_FORM_TOKEN_SECRET:
123
+ label: Forms token secret
124
+ group: forms
125
+ description: Signs form-related tokens and protects Treeseed forms workflows in local and hosted runtimes.
126
+ howToGet: Treeseed can generate a strong random secret for you. Reuse it across environments only if that matches your security model.
127
+ sensitivity: secret
128
+ targets:
129
+ - local-file
130
+ - wrangler-dev-vars
131
+ - github-secret
132
+ - cloudflare-secret
133
+ scopes:
134
+ - local
135
+ - staging
136
+ - prod
137
+ requirement: required
138
+ purposes:
139
+ - dev
140
+ - save
141
+ - deploy
142
+ - config
143
+ validation:
144
+ kind: nonempty
145
+ sourcePriority:
146
+ - machine-config
147
+ - process-env
148
+ defaultValueRef: generatedSecret
149
+ localDefaultValueRef: generatedSecret
150
+ TREESEED_PUBLIC_TURNSTILE_SITE_KEY:
151
+ label: Turnstile site key
152
+ group: forms
153
+ description: Public site key used by the browser to render the Turnstile challenge when forms protection is enabled.
154
+ howToGet: Create a Turnstile widget in Cloudflare Turnstile and copy the site key.
155
+ sensitivity: plain
156
+ targets:
157
+ - local-file
158
+ - wrangler-dev-vars
159
+ - github-variable
160
+ - cloudflare-var
161
+ scopes:
162
+ - local
163
+ - staging
164
+ - prod
165
+ requirement: conditional
166
+ purposes:
167
+ - dev
168
+ - save
169
+ - deploy
170
+ - config
171
+ validation:
172
+ kind: nonempty
173
+ sourcePriority:
174
+ - machine-config
175
+ - process-env
176
+ relevanceRef: turnstileEnabled
177
+ requiredWhenRef: turnstileNonLocal
178
+ TREESEED_TURNSTILE_SECRET_KEY:
179
+ label: Turnstile secret key
180
+ group: forms
181
+ description: Server-side Turnstile secret used to verify challenge responses.
182
+ howToGet: Create a Turnstile widget in Cloudflare Turnstile and copy the secret key.
183
+ sensitivity: secret
184
+ targets:
185
+ - local-file
186
+ - wrangler-dev-vars
187
+ - github-secret
188
+ - cloudflare-secret
189
+ scopes:
190
+ - local
191
+ - staging
192
+ - prod
193
+ requirement: conditional
194
+ purposes:
195
+ - dev
196
+ - save
197
+ - deploy
198
+ - config
199
+ validation:
200
+ kind: nonempty
201
+ sourcePriority:
202
+ - machine-config
203
+ - process-env
204
+ relevanceRef: turnstileEnabled
205
+ requiredWhenRef: turnstileNonLocal
206
+ TREESEED_PUBLIC_FORMS_LOCAL_BYPASS_TURNSTILE:
207
+ label: Local Turnstile bypass
208
+ group: local-development
209
+ description: Lets contributors edit content and exercise forms locally without a live Turnstile widget.
210
+ howToGet: Treeseed defaults this to true for local development. You can switch it off if you want to test with real Turnstile keys locally.
211
+ sensitivity: plain
212
+ targets:
213
+ - local-file
214
+ - wrangler-dev-vars
215
+ scopes:
216
+ - local
217
+ requirement: optional
218
+ purposes:
219
+ - dev
220
+ - config
221
+ validation:
222
+ kind: boolean
223
+ sourcePriority:
224
+ - machine-config
225
+ - process-env
226
+ localDefaultValueRef: localFormsBypassDefault
227
+ TREESEED_SMTP_HOST:
228
+ label: SMTP host
229
+ group: smtp
230
+ description: SMTP host for Treeseed email delivery when SMTP-backed forms behavior is enabled.
231
+ howToGet: Use the SMTP hostname from your email provider or local Mailpit instance.
232
+ sensitivity: plain
233
+ targets:
234
+ - local-file
235
+ - wrangler-dev-vars
236
+ - github-variable
237
+ - cloudflare-var
238
+ scopes:
239
+ - local
240
+ - staging
241
+ - prod
242
+ requirement: conditional
243
+ purposes:
244
+ - dev
245
+ - save
246
+ - deploy
247
+ - config
248
+ validation:
249
+ kind: nonempty
250
+ sourcePriority:
251
+ - machine-config
252
+ - process-env
253
+ relevanceRef: smtpEnabled
254
+ requiredWhenRef: smtpNonLocal
255
+ TREESEED_SMTP_PORT:
256
+ label: SMTP port
257
+ group: smtp
258
+ description: Port used to connect to the SMTP server.
259
+ howToGet: Use the port provided by your email service, commonly 587, 465, or the Mailpit local port.
260
+ sensitivity: plain
261
+ targets:
262
+ - local-file
263
+ - wrangler-dev-vars
264
+ - github-variable
265
+ - cloudflare-var
266
+ scopes:
267
+ - local
268
+ - staging
269
+ - prod
270
+ requirement: conditional
271
+ purposes:
272
+ - dev
273
+ - save
274
+ - deploy
275
+ - config
276
+ validation:
277
+ kind: number
278
+ sourcePriority:
279
+ - machine-config
280
+ - process-env
281
+ relevanceRef: smtpEnabled
282
+ requiredWhenRef: smtpNonLocal
283
+ TREESEED_SMTP_USERNAME:
284
+ label: SMTP username
285
+ group: smtp
286
+ description: SMTP identity used when authenticating to the mail provider.
287
+ howToGet: Use the SMTP username or mailbox identity from your email provider.
288
+ sensitivity: plain
289
+ targets:
290
+ - local-file
291
+ - wrangler-dev-vars
292
+ - github-variable
293
+ - cloudflare-var
294
+ scopes:
295
+ - local
296
+ - staging
297
+ - prod
298
+ requirement: conditional
299
+ purposes:
300
+ - dev
301
+ - save
302
+ - deploy
303
+ - config
304
+ validation:
305
+ kind: nonempty
306
+ sourcePriority:
307
+ - machine-config
308
+ - process-env
309
+ relevanceRef: smtpEnabled
310
+ requiredWhenRef: smtpNonLocal
311
+ TREESEED_SMTP_PASSWORD:
312
+ label: SMTP password
313
+ group: smtp
314
+ description: SMTP password or app password used for authenticated email sending.
315
+ howToGet: Use the SMTP password or app-specific password from your email provider.
316
+ sensitivity: secret
317
+ targets:
318
+ - local-file
319
+ - wrangler-dev-vars
320
+ - github-secret
321
+ - cloudflare-secret
322
+ scopes:
323
+ - local
324
+ - staging
325
+ - prod
326
+ requirement: conditional
327
+ purposes:
328
+ - dev
329
+ - save
330
+ - deploy
331
+ - config
332
+ validation:
333
+ kind: nonempty
334
+ sourcePriority:
335
+ - machine-config
336
+ - process-env
337
+ relevanceRef: smtpEnabled
338
+ requiredWhenRef: smtpNonLocal
339
+ TREESEED_SMTP_FROM:
340
+ label: SMTP from address
341
+ group: smtp
342
+ description: Email address Treeseed uses as the sender for mail notifications.
343
+ howToGet: Use a verified sender address from your SMTP provider.
344
+ sensitivity: plain
345
+ targets:
346
+ - local-file
347
+ - wrangler-dev-vars
348
+ - github-variable
349
+ - cloudflare-var
350
+ scopes:
351
+ - local
352
+ - staging
353
+ - prod
354
+ requirement: conditional
355
+ purposes:
356
+ - dev
357
+ - save
358
+ - deploy
359
+ - config
360
+ validation:
361
+ kind: email
362
+ sourcePriority:
363
+ - machine-config
364
+ - process-env
365
+ relevanceRef: smtpEnabled
366
+ requiredWhenRef: smtpNonLocal
367
+ TREESEED_SMTP_REPLY_TO:
368
+ label: SMTP reply-to address
369
+ group: smtp
370
+ description: Reply-to address attached to Treeseed-generated emails.
371
+ howToGet: Use a monitored mailbox that should receive replies from end users.
372
+ sensitivity: plain
373
+ targets:
374
+ - local-file
375
+ - wrangler-dev-vars
376
+ - github-variable
377
+ - cloudflare-var
378
+ scopes:
379
+ - local
380
+ - staging
381
+ - prod
382
+ requirement: conditional
383
+ purposes:
384
+ - dev
385
+ - save
386
+ - deploy
387
+ - config
388
+ validation:
389
+ kind: email
390
+ sourcePriority:
391
+ - machine-config
392
+ - process-env
393
+ relevanceRef: smtpEnabled
394
+ requiredWhenRef: smtpNonLocal
@@ -0,0 +1,130 @@
1
+ import type { TreeseedDeployConfig, TreeseedTenantConfig } from './contracts.ts';
2
+ import { type LoadedTreeseedPluginEntry } from './plugins/runtime.ts';
3
+ export declare const TREESEED_ENVIRONMENT_SCOPES: readonly ["local", "staging", "prod"];
4
+ export declare const TREESEED_ENVIRONMENT_REQUIREMENTS: readonly ["required", "conditional", "optional"];
5
+ export declare const TREESEED_ENVIRONMENT_TARGETS: readonly ["local-file", "wrangler-dev-vars", "github-secret", "github-variable", "cloudflare-secret", "cloudflare-var", "railway-secret", "config-file"];
6
+ export declare const TREESEED_ENVIRONMENT_PURPOSES: readonly ["dev", "save", "deploy", "destroy", "config"];
7
+ export declare const TREESEED_ENVIRONMENT_SENSITIVITY: readonly ["secret", "plain", "derived"];
8
+ export type TreeseedEnvironmentScope = (typeof TREESEED_ENVIRONMENT_SCOPES)[number];
9
+ export type TreeseedEnvironmentRequirement = (typeof TREESEED_ENVIRONMENT_REQUIREMENTS)[number];
10
+ export type TreeseedEnvironmentTarget = (typeof TREESEED_ENVIRONMENT_TARGETS)[number];
11
+ export type TreeseedEnvironmentPurpose = (typeof TREESEED_ENVIRONMENT_PURPOSES)[number];
12
+ export type TreeseedEnvironmentSensitivity = (typeof TREESEED_ENVIRONMENT_SENSITIVITY)[number];
13
+ export type TreeseedEnvironmentValidation = {
14
+ kind: 'string' | 'nonempty' | 'boolean' | 'number' | 'url' | 'email';
15
+ } | {
16
+ kind: 'enum';
17
+ values: string[];
18
+ };
19
+ export type TreeseedEnvironmentValueResolver = string | ((context: TreeseedEnvironmentContext, scope: TreeseedEnvironmentScope) => string);
20
+ export type TreeseedMachineSecretPayload = {
21
+ algorithm: 'aes-256-gcm';
22
+ iv: string;
23
+ tag: string;
24
+ ciphertext: string;
25
+ };
26
+ export type TreeseedMachineConfig = {
27
+ version: number;
28
+ project: {
29
+ tenantRoot: string;
30
+ tenantId: string;
31
+ slug: string;
32
+ name: string;
33
+ siteUrl: string;
34
+ overlayPath?: string;
35
+ };
36
+ settings: {
37
+ sync: {
38
+ github: boolean;
39
+ cloudflare: boolean;
40
+ };
41
+ };
42
+ environments: Record<TreeseedEnvironmentScope, {
43
+ values: Record<string, string>;
44
+ secrets: Record<string, TreeseedMachineSecretPayload>;
45
+ }>;
46
+ };
47
+ export type TreeseedEnvironmentContext = {
48
+ deployConfig: TreeseedDeployConfig;
49
+ tenantConfig?: TreeseedTenantConfig;
50
+ plugins: LoadedTreeseedPluginEntry[];
51
+ tenantRoot: string;
52
+ };
53
+ export type TreeseedEnvironmentEntry = {
54
+ id: string;
55
+ label: string;
56
+ group: string;
57
+ description: string;
58
+ howToGet: string;
59
+ sensitivity: TreeseedEnvironmentSensitivity;
60
+ targets: TreeseedEnvironmentTarget[];
61
+ scopes: TreeseedEnvironmentScope[];
62
+ requirement: TreeseedEnvironmentRequirement;
63
+ purposes: TreeseedEnvironmentPurpose[];
64
+ validation?: TreeseedEnvironmentValidation;
65
+ sourcePriority?: string[];
66
+ defaultValue?: TreeseedEnvironmentValueResolver;
67
+ localDefaultValue?: TreeseedEnvironmentValueResolver;
68
+ isRelevant?: (context: TreeseedEnvironmentContext, scope: TreeseedEnvironmentScope, purpose?: TreeseedEnvironmentPurpose) => boolean;
69
+ requiredWhen?: (context: TreeseedEnvironmentContext, scope: TreeseedEnvironmentScope, purpose?: TreeseedEnvironmentPurpose) => boolean;
70
+ };
71
+ export type TreeseedEnvironmentEntryYaml = Omit<TreeseedEnvironmentEntry, 'id' | 'defaultValue' | 'localDefaultValue' | 'isRelevant' | 'requiredWhen'> & {
72
+ defaultValueRef?: string;
73
+ localDefaultValueRef?: string;
74
+ relevanceRef?: string;
75
+ requiredWhenRef?: string;
76
+ };
77
+ export type TreeseedEnvironmentEntryOverride = Partial<Omit<TreeseedEnvironmentEntryYaml, 'id'>> & {
78
+ id?: string;
79
+ };
80
+ export type TreeseedEnvironmentRegistryOverlay = {
81
+ entries?: Record<string, TreeseedEnvironmentEntryOverride>;
82
+ };
83
+ export type TreeseedResolvedEnvironmentRegistry = {
84
+ context: TreeseedEnvironmentContext;
85
+ entries: TreeseedEnvironmentEntry[];
86
+ };
87
+ export type TreeseedEnvironmentValidationProblem = {
88
+ id: string;
89
+ label: string;
90
+ reason: 'missing' | 'invalid';
91
+ message: string;
92
+ entry: TreeseedEnvironmentEntry;
93
+ };
94
+ export type TreeseedEnvironmentValidationResult = {
95
+ ok: boolean;
96
+ entries: TreeseedEnvironmentEntry[];
97
+ required: TreeseedEnvironmentEntry[];
98
+ missing: TreeseedEnvironmentValidationProblem[];
99
+ invalid: TreeseedEnvironmentValidationProblem[];
100
+ };
101
+ export declare function loadTreeseedEnvironmentOverlay(tenantRoot: string): {
102
+ path: string;
103
+ overlay: TreeseedEnvironmentRegistryOverlay;
104
+ };
105
+ export declare function resolveTreeseedEnvironmentContext(options?: {
106
+ deployConfig?: TreeseedDeployConfig;
107
+ tenantConfig?: TreeseedTenantConfig;
108
+ plugins?: LoadedTreeseedPluginEntry[];
109
+ }): TreeseedEnvironmentContext;
110
+ export declare function resolveTreeseedEnvironmentRegistry(options?: {
111
+ deployConfig?: TreeseedDeployConfig;
112
+ tenantConfig?: TreeseedTenantConfig;
113
+ plugins?: LoadedTreeseedPluginEntry[];
114
+ }): TreeseedResolvedEnvironmentRegistry;
115
+ export declare function isTreeseedEnvironmentEntryRelevant(entry: TreeseedEnvironmentEntry, context: TreeseedEnvironmentContext, scope: TreeseedEnvironmentScope, purpose?: TreeseedEnvironmentPurpose): boolean;
116
+ export declare function getTreeseedEnvironmentSuggestedValues(options: {
117
+ scope: TreeseedEnvironmentScope;
118
+ purpose?: TreeseedEnvironmentPurpose;
119
+ deployConfig?: TreeseedDeployConfig;
120
+ tenantConfig?: TreeseedTenantConfig;
121
+ plugins?: LoadedTreeseedPluginEntry[];
122
+ }): Record<string, string>;
123
+ export declare function validateTreeseedEnvironmentValues(options: {
124
+ values: Record<string, string | undefined>;
125
+ scope: TreeseedEnvironmentScope;
126
+ purpose: TreeseedEnvironmentPurpose;
127
+ deployConfig?: TreeseedDeployConfig;
128
+ tenantConfig?: TreeseedTenantConfig;
129
+ plugins?: LoadedTreeseedPluginEntry[];
130
+ }): TreeseedEnvironmentValidationResult;