@treeseed/sdk 0.1.1 → 0.3.0
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 +97 -494
- package/dist/{src/cli-tools.d.ts → cli-tools.d.ts} +1 -1
- package/dist/cli-tools.js +5 -3
- package/dist/{src/content-store.d.ts → content-store.d.ts} +3 -2
- package/dist/content-store.js +52 -20
- package/dist/{src/d1-store.d.ts → d1-store.d.ts} +62 -1
- package/dist/d1-store.js +625 -65
- package/dist/field-aliases.d.ts +11 -0
- package/dist/field-aliases.js +41 -0
- package/dist/graph/build.d.ts +19 -0
- package/dist/graph/build.js +949 -0
- package/dist/graph/dsl.d.ts +2 -0
- package/dist/graph/dsl.js +243 -0
- package/dist/graph/query.d.ts +47 -0
- package/dist/graph/query.js +447 -0
- package/dist/graph/ranking.d.ts +3 -0
- package/dist/graph/ranking.js +483 -0
- package/dist/graph/schema.d.ts +142 -0
- package/dist/graph/schema.js +133 -0
- package/dist/graph.d.ts +52 -0
- package/dist/graph.js +133 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.js +90 -2
- package/dist/model-registry.d.ts +8 -0
- package/dist/model-registry.js +351 -25
- package/dist/operations/providers/default.d.ts +10 -0
- package/dist/operations/providers/default.js +514 -0
- package/dist/operations/runtime.d.ts +7 -0
- package/dist/operations/runtime.js +60 -0
- package/dist/operations/services/config-runtime.d.ts +269 -0
- package/dist/operations/services/config-runtime.js +1397 -0
- package/dist/operations/services/d1-migration.d.ts +6 -0
- package/dist/operations/services/d1-migration.js +89 -0
- package/dist/operations/services/deploy.d.ts +371 -0
- package/dist/operations/services/deploy.js +981 -0
- package/dist/operations/services/git-workflow.d.ts +49 -0
- package/dist/operations/services/git-workflow.js +218 -0
- package/dist/operations/services/github-automation.d.ts +156 -0
- package/dist/operations/services/github-automation.js +256 -0
- package/dist/operations/services/local-dev.d.ts +9 -0
- package/dist/operations/services/local-dev.js +106 -0
- package/dist/operations/services/mailpit-runtime.d.ts +4 -0
- package/dist/operations/services/mailpit-runtime.js +59 -0
- package/dist/operations/services/railway-deploy.d.ts +53 -0
- package/dist/operations/services/railway-deploy.js +123 -0
- package/dist/operations/services/runtime-paths.d.ts +19 -0
- package/dist/operations/services/runtime-paths.js +54 -0
- package/dist/operations/services/runtime-tools.d.ts +117 -0
- package/dist/operations/services/runtime-tools.js +358 -0
- package/dist/operations/services/save-deploy-preflight.d.ts +34 -0
- package/dist/operations/services/save-deploy-preflight.js +76 -0
- package/dist/operations/services/template-registry.d.ts +88 -0
- package/dist/operations/services/template-registry.js +407 -0
- package/dist/operations/services/watch-dev.d.ts +21 -0
- package/dist/operations/services/watch-dev.js +284 -0
- package/dist/operations/services/workspace-preflight.d.ts +40 -0
- package/dist/operations/services/workspace-preflight.js +165 -0
- package/dist/operations/services/workspace-save.d.ts +42 -0
- package/dist/operations/services/workspace-save.js +235 -0
- package/dist/operations/services/workspace-tools.d.ts +16 -0
- package/dist/operations/services/workspace-tools.js +270 -0
- package/dist/operations-registry.d.ts +5 -0
- package/dist/operations-registry.js +68 -0
- package/dist/operations-types.d.ts +71 -0
- package/dist/operations-types.js +17 -0
- package/dist/operations.d.ts +6 -0
- package/dist/operations.js +16 -0
- package/dist/platform/books-data.d.ts +1 -0
- package/dist/platform/books-data.js +1 -0
- package/dist/platform/contracts.d.ts +158 -0
- package/dist/platform/contracts.js +0 -0
- package/dist/platform/deploy/config.d.ts +4 -0
- package/dist/platform/deploy/config.js +222 -0
- package/dist/platform/deploy-config.d.ts +1 -0
- package/dist/platform/deploy-config.js +1 -0
- package/dist/platform/env.yaml +394 -0
- package/dist/platform/environment.d.ts +130 -0
- package/dist/platform/environment.js +331 -0
- package/dist/platform/plugin.d.ts +2 -0
- package/dist/platform/plugin.js +4 -0
- package/dist/platform/plugins/constants.d.ts +22 -0
- package/dist/platform/plugins/constants.js +29 -0
- package/dist/platform/plugins/plugin.d.ts +51 -0
- package/dist/platform/plugins/plugin.js +6 -0
- package/dist/platform/plugins/runtime.d.ts +35 -0
- package/dist/platform/plugins/runtime.js +142 -0
- package/dist/platform/plugins.d.ts +5 -0
- package/dist/platform/plugins.js +16 -0
- package/dist/platform/site-config-schema.js +1 -0
- package/dist/platform/tenant/config.d.ts +9 -0
- package/dist/platform/tenant/config.js +154 -0
- package/dist/platform/tenant/runtime-config.d.ts +4 -0
- package/dist/platform/tenant/runtime-config.js +20 -0
- package/dist/platform/tenant-config.d.ts +1 -0
- package/dist/platform/tenant-config.js +1 -0
- package/dist/platform/utils/books-data.d.ts +29 -0
- package/dist/platform/utils/books-data.js +82 -0
- package/dist/platform/utils/site-config-schema.js +321 -0
- package/dist/remote.d.ts +175 -0
- package/dist/remote.js +202 -0
- package/dist/runtime.js +50 -3
- package/dist/scripts/aggregate-book.js +121 -0
- package/dist/scripts/build-dist.js +57 -13
- package/dist/scripts/build-tenant-worker.js +36 -0
- package/dist/scripts/cleanup-markdown.js +373 -0
- package/dist/scripts/cli-test-fixtures.js +48 -0
- package/dist/scripts/config-treeseed.js +95 -0
- package/dist/scripts/ensure-mailpit.js +29 -0
- package/dist/scripts/local-dev.js +129 -0
- package/dist/scripts/logs-mailpit.js +2 -0
- package/dist/scripts/patch-starlight-content-path.js +172 -0
- package/dist/scripts/release-verify.js +34 -5
- package/dist/scripts/run-fixture-astro-command.js +18 -0
- package/dist/scripts/scaffold-site.js +65 -0
- package/dist/scripts/stop-mailpit.js +5 -0
- package/dist/scripts/sync-dev-vars.js +6 -0
- package/dist/scripts/sync-template.js +20 -0
- package/dist/scripts/template-catalog.test.js +100 -0
- package/dist/scripts/template-command.js +31 -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/tenant-d1-migrate-local.js +11 -0
- package/dist/scripts/tenant-deploy.js +180 -0
- package/dist/scripts/tenant-destroy.js +104 -0
- package/dist/scripts/tenant-dev.js +171 -0
- package/dist/scripts/tenant-lint.js +4 -0
- package/dist/scripts/tenant-test.js +4 -0
- package/dist/scripts/test-cloudflare-local.js +212 -0
- package/dist/scripts/test-scaffold.js +314 -0
- package/dist/scripts/test-smoke.js +71 -13
- package/dist/scripts/treeseed-assert-release-tag-version.js +21 -0
- package/dist/scripts/treeseed-build-dist.js +134 -0
- package/dist/scripts/treeseed-publish-package.js +19 -0
- package/dist/scripts/treeseed-release-verify.js +131 -0
- package/dist/scripts/treeseed-run-ts.js +45 -0
- package/dist/scripts/validate-templates.js +6 -0
- package/dist/scripts/verify-driver.js +29 -0
- package/dist/scripts/workflow-commands.test.js +39 -0
- package/dist/scripts/workspace-close.js +24 -0
- package/dist/scripts/workspace-command-e2e.js +718 -0
- package/dist/scripts/workspace-lint.js +9 -0
- package/dist/scripts/workspace-preflight.js +22 -0
- package/dist/scripts/workspace-publish-changed-packages.js +16 -0
- package/dist/scripts/workspace-release-verify.js +81 -0
- package/dist/scripts/workspace-release.js +42 -0
- package/dist/scripts/workspace-save.js +124 -0
- package/dist/scripts/workspace-start-warning.js +3 -0
- package/dist/scripts/workspace-start.js +71 -0
- package/dist/scripts/workspace-test-unit.js +4 -0
- package/dist/scripts/workspace-test.js +11 -0
- package/dist/sdk-fields.d.ts +11 -0
- package/dist/sdk-fields.js +169 -0
- package/dist/sdk-filters.d.ts +4 -0
- package/dist/sdk-filters.js +12 -15
- package/dist/sdk-types.d.ts +796 -0
- package/dist/sdk-types.js +7 -1
- package/dist/sdk-version.d.ts +2 -0
- package/dist/sdk-version.js +42 -0
- package/dist/sdk.d.ts +215 -0
- package/dist/sdk.js +235 -11
- package/dist/stores/cursor-store.js +9 -3
- package/dist/stores/lease-store.js +8 -2
- package/dist/{src/stores → stores}/message-store.d.ts +1 -1
- package/dist/stores/message-store.js +27 -3
- package/dist/stores/operational-store.d.ts +24 -0
- package/dist/stores/operational-store.js +279 -0
- package/dist/stores/run-store.js +8 -1
- package/dist/stores/subscription-store.js +7 -5
- package/dist/template-catalog.d.ts +13 -0
- package/dist/template-catalog.js +141 -0
- package/dist/treeseed/services/compose.yml +7 -0
- package/dist/treeseed/template-catalog/catalog.fixture.json +55 -0
- package/dist/treeseed/template-catalog/templates/starter-basic/template/astro.config.d.ts +2 -0
- package/dist/treeseed/template-catalog/templates/starter-basic/template/astro.config.ts +3 -0
- package/dist/treeseed/template-catalog/templates/starter-basic/template/package.json +32 -0
- package/dist/treeseed/template-catalog/templates/starter-basic/template/src/config.yaml +40 -0
- package/dist/treeseed/template-catalog/templates/starter-basic/template/src/content/empty/.gitkeep +1 -0
- package/dist/treeseed/template-catalog/templates/starter-basic/template/src/content/knowledge/handbook/index.mdx +11 -0
- package/dist/treeseed/template-catalog/templates/starter-basic/template/src/content/pages/welcome.mdx +11 -0
- package/dist/treeseed/template-catalog/templates/starter-basic/template/src/content.config.d.ts +1 -0
- package/dist/treeseed/template-catalog/templates/starter-basic/template/src/content.config.ts +3 -0
- package/dist/treeseed/template-catalog/templates/starter-basic/template/src/env.yaml +1 -0
- package/dist/treeseed/template-catalog/templates/starter-basic/template/src/manifest.yaml +19 -0
- package/dist/treeseed/template-catalog/templates/starter-basic/template/treeseed.site.yaml +26 -0
- package/dist/treeseed/template-catalog/templates/starter-basic/template/tsconfig.json +9 -0
- package/dist/treeseed/template-catalog/templates/starter-basic/template.config.json +90 -0
- package/dist/verification.d.ts +20 -0
- package/dist/verification.js +98 -0
- package/dist/workflow/operations.d.ts +396 -0
- package/dist/workflow/operations.js +841 -0
- package/dist/workflow-state.d.ts +56 -0
- package/dist/workflow-state.js +195 -0
- package/dist/workflow-support.d.ts +9 -0
- package/dist/workflow-support.js +176 -0
- package/dist/workflow.d.ts +111 -0
- package/dist/workflow.js +97 -0
- package/package.json +97 -5
- package/scripts/verify-driver.mjs +29 -0
- package/dist/scripts/.ts-run-1775616845195-odh4xzphk3l.js +0 -22
- package/dist/scripts/.ts-run-1775616848931-9386s6kwrl.js +0 -126
- package/dist/scripts/assert-release-tag-version.d.ts +0 -1
- package/dist/scripts/build-dist.d.ts +0 -1
- package/dist/scripts/package-tools.d.ts +0 -15
- package/dist/scripts/publish-package.d.ts +0 -1
- package/dist/scripts/release-verify.d.ts +0 -1
- package/dist/scripts/test-smoke.d.ts +0 -1
- package/dist/src/index.d.ts +0 -6
- package/dist/src/model-registry.d.ts +0 -4
- package/dist/src/sdk-filters.d.ts +0 -4
- package/dist/src/sdk-types.d.ts +0 -285
- package/dist/src/sdk.d.ts +0 -109
- package/dist/test/test-fixture.d.ts +0 -1
- package/dist/test/utils/envelopes.test.d.ts +0 -1
- package/dist/test/utils/sdk.test.d.ts +0 -1
- package/dist/vitest.config.d.ts +0 -2
- /package/dist/{src/frontmatter.d.ts → frontmatter.d.ts} +0 -0
- /package/dist/{src/git-runtime.d.ts → git-runtime.d.ts} +0 -0
- /package/dist/{src/runtime.d.ts → runtime.d.ts} +0 -0
- /package/dist/{src/stores → stores}/cursor-store.d.ts +0 -0
- /package/dist/{src/stores → stores}/envelopes.d.ts +0 -0
- /package/dist/{src/stores → stores}/helpers.d.ts +0 -0
- /package/dist/{src/stores → stores}/lease-store.d.ts +0 -0
- /package/dist/{src/stores → stores}/run-store.d.ts +0 -0
- /package/dist/{src/stores → stores}/subscription-store.d.ts +0 -0
- /package/dist/{src/types → types}/agents.d.ts +0 -0
- /package/dist/{src/types → types}/cloudflare.d.ts +0 -0
- /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;
|