@treeseed/agent 0.8.5

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 (138) hide show
  1. package/Dockerfile +7 -0
  2. package/README.md +198 -0
  3. package/dist/agent-runtime.d.ts +17 -0
  4. package/dist/agent-runtime.js +117 -0
  5. package/dist/agents/adapters/execution.d.ts +41 -0
  6. package/dist/agents/adapters/execution.js +73 -0
  7. package/dist/agents/adapters/mutations.d.ts +22 -0
  8. package/dist/agents/adapters/mutations.js +30 -0
  9. package/dist/agents/adapters/notification.d.ts +26 -0
  10. package/dist/agents/adapters/notification.js +46 -0
  11. package/dist/agents/adapters/repository.d.ts +28 -0
  12. package/dist/agents/adapters/repository.js +61 -0
  13. package/dist/agents/adapters/research.d.ts +26 -0
  14. package/dist/agents/adapters/research.js +59 -0
  15. package/dist/agents/adapters/verification.d.ts +36 -0
  16. package/dist/agents/adapters/verification.js +62 -0
  17. package/dist/agents/cli-tools.d.ts +1 -0
  18. package/dist/agents/cli-tools.js +5 -0
  19. package/dist/agents/cli.d.ts +15 -0
  20. package/dist/agents/cli.js +109 -0
  21. package/dist/agents/contracts/messages.d.ts +88 -0
  22. package/dist/agents/contracts/messages.js +138 -0
  23. package/dist/agents/contracts/run.d.ts +21 -0
  24. package/dist/agents/contracts/run.js +0 -0
  25. package/dist/agents/index.d.ts +1 -0
  26. package/dist/agents/index.js +5 -0
  27. package/dist/agents/kernel/agent-kernel.d.ts +63 -0
  28. package/dist/agents/kernel/agent-kernel.js +291 -0
  29. package/dist/agents/kernel/trigger-resolver.d.ts +19 -0
  30. package/dist/agents/kernel/trigger-resolver.js +157 -0
  31. package/dist/agents/registry-helper.d.ts +4 -0
  32. package/dist/agents/registry-helper.js +14 -0
  33. package/dist/agents/registry.d.ts +6 -0
  34. package/dist/agents/registry.js +98 -0
  35. package/dist/agents/runtime-types.d.ts +118 -0
  36. package/dist/agents/runtime-types.js +0 -0
  37. package/dist/agents/spec-loader.d.ts +18 -0
  38. package/dist/agents/spec-loader.js +54 -0
  39. package/dist/agents/spec-normalizer.d.ts +2 -0
  40. package/dist/agents/spec-normalizer.js +327 -0
  41. package/dist/agents/spec-types.d.ts +64 -0
  42. package/dist/agents/spec-types.js +0 -0
  43. package/dist/agents/testing/agents-smoke.d.ts +1 -0
  44. package/dist/agents/testing/agents-smoke.js +32 -0
  45. package/dist/agents/testing/e2e-harness.d.ts +44 -0
  46. package/dist/agents/testing/e2e-harness.js +503 -0
  47. package/dist/api/agent-routes.d.ts +13 -0
  48. package/dist/api/agent-routes.js +327 -0
  49. package/dist/api/app.d.ts +8 -0
  50. package/dist/api/app.js +444 -0
  51. package/dist/api/auth/d1-database.d.ts +3 -0
  52. package/dist/api/auth/d1-database.js +20 -0
  53. package/dist/api/auth/d1-provider.d.ts +79 -0
  54. package/dist/api/auth/d1-provider.js +92 -0
  55. package/dist/api/auth/d1-store.d.ts +114 -0
  56. package/dist/api/auth/d1-store.js +895 -0
  57. package/dist/api/auth/memory-provider.d.ts +77 -0
  58. package/dist/api/auth/memory-provider.js +249 -0
  59. package/dist/api/auth/rbac.d.ts +22 -0
  60. package/dist/api/auth/rbac.js +162 -0
  61. package/dist/api/auth/tokens.d.ts +18 -0
  62. package/dist/api/auth/tokens.js +56 -0
  63. package/dist/api/capabilities.d.ts +9 -0
  64. package/dist/api/capabilities.js +33 -0
  65. package/dist/api/config.d.ts +2 -0
  66. package/dist/api/config.js +77 -0
  67. package/dist/api/http.d.ts +28 -0
  68. package/dist/api/http.js +51 -0
  69. package/dist/api/index.d.ts +9 -0
  70. package/dist/api/index.js +20 -0
  71. package/dist/api/operations-routes.d.ts +11 -0
  72. package/dist/api/operations-routes.js +87 -0
  73. package/dist/api/operations.d.ts +3 -0
  74. package/dist/api/operations.js +26 -0
  75. package/dist/api/project-routes.d.ts +8 -0
  76. package/dist/api/project-routes.js +585 -0
  77. package/dist/api/providers.d.ts +2 -0
  78. package/dist/api/providers.js +62 -0
  79. package/dist/api/railway.d.ts +51 -0
  80. package/dist/api/railway.js +71 -0
  81. package/dist/api/sdk-dispatch.d.ts +5 -0
  82. package/dist/api/sdk-dispatch.js +13 -0
  83. package/dist/api/sdk-routes.d.ts +11 -0
  84. package/dist/api/sdk-routes.js +29 -0
  85. package/dist/api/server.d.ts +2 -0
  86. package/dist/api/server.js +10 -0
  87. package/dist/api/templates.d.ts +3 -0
  88. package/dist/api/templates.js +31 -0
  89. package/dist/api/types.d.ts +237 -0
  90. package/dist/api/types.js +0 -0
  91. package/dist/env.yaml +957 -0
  92. package/dist/index.d.ts +14 -0
  93. package/dist/index.js +41 -0
  94. package/dist/scripts/assert-release-tag-version.d.ts +1 -0
  95. package/dist/scripts/assert-release-tag-version.js +20 -0
  96. package/dist/scripts/build-dist.d.ts +1 -0
  97. package/dist/scripts/build-dist.js +106 -0
  98. package/dist/scripts/package-tools.d.ts +1 -0
  99. package/dist/scripts/package-tools.js +7 -0
  100. package/dist/scripts/publish-package.d.ts +1 -0
  101. package/dist/scripts/publish-package.js +24 -0
  102. package/dist/scripts/release-verify.d.ts +1 -0
  103. package/dist/scripts/release-verify.js +152 -0
  104. package/dist/scripts/test-smoke.d.ts +1 -0
  105. package/dist/scripts/test-smoke.js +23 -0
  106. package/dist/scripts/treeseed-agent-api.d.ts +2 -0
  107. package/dist/scripts/treeseed-agent-api.js +25 -0
  108. package/dist/scripts/treeseed-agent-service.d.ts +2 -0
  109. package/dist/scripts/treeseed-agent-service.js +36 -0
  110. package/dist/scripts/treeseed-agents.d.ts +2 -0
  111. package/dist/scripts/treeseed-agents.js +13 -0
  112. package/dist/services/agents.d.ts +17 -0
  113. package/dist/services/agents.js +48 -0
  114. package/dist/services/common.d.ts +66 -0
  115. package/dist/services/common.js +212 -0
  116. package/dist/services/index.d.ts +6 -0
  117. package/dist/services/index.js +19 -0
  118. package/dist/services/manager.d.ts +333 -0
  119. package/dist/services/manager.js +1368 -0
  120. package/dist/services/remote-runner.d.ts +30 -0
  121. package/dist/services/remote-runner.js +230 -0
  122. package/dist/services/workday-content.d.ts +53 -0
  123. package/dist/services/workday-content.js +190 -0
  124. package/dist/services/workday-manager.d.ts +391 -0
  125. package/dist/services/workday-manager.js +163 -0
  126. package/dist/services/workday-report.d.ts +238 -0
  127. package/dist/services/workday-report.js +17 -0
  128. package/dist/services/workday-start.d.ts +238 -0
  129. package/dist/services/workday-start.js +17 -0
  130. package/dist/services/worker-capacity.d.ts +58 -0
  131. package/dist/services/worker-capacity.js +208 -0
  132. package/dist/services/worker-pool-scaler.d.ts +27 -0
  133. package/dist/services/worker-pool-scaler.js +127 -0
  134. package/dist/services/worker.d.ts +19 -0
  135. package/dist/services/worker.js +436 -0
  136. package/dist/templates/github/deploy-processing.workflow.yml +119 -0
  137. package/package.json +136 -0
  138. package/templates/github/deploy-processing.workflow.yml +119 -0
package/dist/env.yaml ADDED
@@ -0,0 +1,957 @@
1
+ entries:
2
+ RAILWAY_API_TOKEN:
3
+ label: Railway API token
4
+ group: auth
5
+ description: Primary Railway token for user or workspace scoped access, including project creation and most Treeseed-managed Railway flows.
6
+ howToGet: In Railway, create a user or workspace API token that can create and manage the target project, then paste it here.
7
+ sensitivity: secret
8
+ targets:
9
+ - local-runtime
10
+ - github-secret
11
+ - railway-secret
12
+ scopes:
13
+ - staging
14
+ - prod
15
+ storage: shared
16
+ requirement: conditional
17
+ purposes:
18
+ - deploy
19
+ - destroy
20
+ - config
21
+ validation:
22
+ kind: nonempty
23
+ minLength: 8
24
+ sourcePriority:
25
+ - machine-config
26
+ - process-env
27
+ relevanceRef: railwayManagedEnabled
28
+ requiredWhenRef: railwayManagedEnabled
29
+ RAILWAY_TOKEN:
30
+ label: Railway project token
31
+ group: auth
32
+ description: Project-scoped Railway token used by the Railway CLI for CI deploy uploads. Treeseed can mint a scoped token from RAILWAY_API_TOKEN during processing deploys when this is not configured.
33
+ howToGet: In Railway, open the target project environment settings, create a project token, and store it as RAILWAY_TOKEN. Leave unset when Treeseed should mint an ephemeral CI deploy token from RAILWAY_API_TOKEN.
34
+ sensitivity: secret
35
+ targets:
36
+ - github-secret
37
+ scopes:
38
+ - staging
39
+ - prod
40
+ storage: scoped
41
+ requirement: optional
42
+ purposes:
43
+ - deploy
44
+ validation:
45
+ kind: nonempty
46
+ minLength: 8
47
+ sourcePriority:
48
+ - machine-config
49
+ - process-env
50
+ relevanceRef: railwayManagedEnabled
51
+ TREESEED_RAILWAY_WORKSPACE:
52
+ label: Railway workspace
53
+ group: railway
54
+ description: Railway workspace Treeseed should use when listing or creating projects during bootstrap and config reconciliation.
55
+ howToGet: In Railway, use the workspace slug or name shown in the workspace switcher. Treeseed defaults this repository to knowledge-coop unless you override it here.
56
+ sensitivity: plain
57
+ targets:
58
+ - railway-var
59
+ scopes:
60
+ - staging
61
+ - prod
62
+ storage: shared
63
+ requirement: conditional
64
+ purposes:
65
+ - deploy
66
+ - destroy
67
+ - config
68
+ validation:
69
+ kind: nonempty
70
+ sourcePriority:
71
+ - machine-config
72
+ - process-env
73
+ defaultValueRef: railwayWorkspaceDefault
74
+ relevanceRef: railwayManagedEnabled
75
+ requiredWhenRef: railwayManagedEnabled
76
+ TREESEED_PROJECT_RUNNER_TOKEN:
77
+ label: Project runner registration token
78
+ group: hosting
79
+ description: Shared bearer token used by manager, worker, and agents services to authenticate against the market control plane for remote jobs and agent-pool registration.
80
+ howToGet: Generate or rotate this token from the market control plane after connecting a project environment.
81
+ sensitivity: secret
82
+ targets:
83
+ - github-secret
84
+ - railway-secret
85
+ scopes:
86
+ - staging
87
+ - prod
88
+ storage: scoped
89
+ requirement: conditional
90
+ purposes:
91
+ - deploy
92
+ - config
93
+ validation:
94
+ kind: nonempty
95
+ sourcePriority:
96
+ - machine-config
97
+ - process-env
98
+ relevanceRef: projectRegistrationEnabled
99
+ TREESEED_AGENT_POOL_MIN_WORKERS:
100
+ label: Agent pool minimum workers
101
+ group: hosting
102
+ description: Lower autoscaling bound for the Railway worker service for one project environment.
103
+ howToGet: Set this to 0 for scale-to-zero by default unless the project requires warm workers.
104
+ sensitivity: plain
105
+ targets:
106
+ - github-variable
107
+ - railway-var
108
+ scopes:
109
+ - staging
110
+ - prod
111
+ storage: scoped
112
+ requirement: conditional
113
+ purposes:
114
+ - deploy
115
+ - config
116
+ validation:
117
+ kind: number
118
+ sourcePriority:
119
+ - machine-config
120
+ - process-env
121
+ relevanceRef: railwayManagedEnabled
122
+ defaultValueRef: agentPoolMinWorkersDefault
123
+ TREESEED_AGENT_POOL_MAX_WORKERS:
124
+ label: Agent pool maximum workers
125
+ group: hosting
126
+ description: Upper autoscaling bound for the Railway worker service for one project environment.
127
+ howToGet: Choose a value that reflects your budget and expected concurrency ceiling.
128
+ sensitivity: plain
129
+ targets:
130
+ - github-variable
131
+ - railway-var
132
+ scopes:
133
+ - staging
134
+ - prod
135
+ storage: scoped
136
+ requirement: conditional
137
+ purposes:
138
+ - deploy
139
+ - config
140
+ validation:
141
+ kind: number
142
+ sourcePriority:
143
+ - machine-config
144
+ - process-env
145
+ relevanceRef: railwayManagedEnabled
146
+ defaultValueRef: agentPoolMaxWorkersDefault
147
+ TREESEED_AGENT_POOL_TARGET_QUEUE_DEPTH:
148
+ label: Agent pool target queue depth
149
+ group: hosting
150
+ description: Desired queue depth per worker instance that the manager uses when computing worker scale.
151
+ howToGet: Start with 1 for conservative scaling, then raise it only after observing stable worker latency.
152
+ sensitivity: plain
153
+ targets:
154
+ - github-variable
155
+ - railway-var
156
+ scopes:
157
+ - staging
158
+ - prod
159
+ storage: scoped
160
+ requirement: conditional
161
+ purposes:
162
+ - deploy
163
+ - config
164
+ validation:
165
+ kind: number
166
+ sourcePriority:
167
+ - machine-config
168
+ - process-env
169
+ relevanceRef: railwayManagedEnabled
170
+ defaultValueRef: agentPoolTargetQueueDepthDefault
171
+ TREESEED_AGENT_POOL_COOLDOWN_SECONDS:
172
+ label: Agent pool cooldown seconds
173
+ group: hosting
174
+ description: Cooldown window the manager uses before scaling the worker pool down after queue activity drops.
175
+ howToGet: Start with 60 seconds to prevent worker thrash in lightly bursty environments.
176
+ sensitivity: plain
177
+ targets:
178
+ - github-variable
179
+ - railway-var
180
+ scopes:
181
+ - staging
182
+ - prod
183
+ storage: scoped
184
+ requirement: conditional
185
+ purposes:
186
+ - deploy
187
+ - config
188
+ validation:
189
+ kind: number
190
+ sourcePriority:
191
+ - machine-config
192
+ - process-env
193
+ relevanceRef: railwayManagedEnabled
194
+ defaultValueRef: agentPoolCooldownSecondsDefault
195
+ TREESEED_WORKDAY_TIMEZONE:
196
+ label: Workday timezone
197
+ group: hosting
198
+ description: IANA timezone used when evaluating active work windows for the manager.
199
+ howToGet: Use the project team's operating timezone, such as America/New_York.
200
+ sensitivity: plain
201
+ targets:
202
+ - github-variable
203
+ - railway-var
204
+ scopes:
205
+ - staging
206
+ - prod
207
+ storage: scoped
208
+ requirement: optional
209
+ purposes:
210
+ - deploy
211
+ - config
212
+ validation:
213
+ kind: nonempty
214
+ sourcePriority:
215
+ - machine-config
216
+ - process-env
217
+ defaultValueRef: workdayTimezoneDefault
218
+ TREESEED_WORKDAY_WINDOWS_JSON:
219
+ label: Workday schedule JSON
220
+ group: hosting
221
+ description: JSON array of recurring work windows used by the manager to decide when to open or close a workday.
222
+ howToGet: Provide a JSON value like [{"days":[1,2,3,4,5],"startTime":"09:00","endTime":"17:00"}].
223
+ sensitivity: plain
224
+ targets:
225
+ - github-variable
226
+ - railway-var
227
+ scopes:
228
+ - staging
229
+ - prod
230
+ storage: scoped
231
+ requirement: optional
232
+ purposes:
233
+ - deploy
234
+ - config
235
+ validation:
236
+ kind: nonempty
237
+ sourcePriority:
238
+ - machine-config
239
+ - process-env
240
+ defaultValueRef: workdayWindowsDefault
241
+ TREESEED_WORKDAY_TASK_CREDIT_BUDGET:
242
+ label: Daily task-credit budget
243
+ group: hosting
244
+ description: Maximum task credits the manager may allocate during one workday before it stops seeding new work.
245
+ howToGet: Choose the daily throughput ceiling that matches the team's Copilot and infrastructure budget.
246
+ sensitivity: plain
247
+ targets:
248
+ - github-variable
249
+ - railway-var
250
+ scopes:
251
+ - staging
252
+ - prod
253
+ storage: scoped
254
+ requirement: optional
255
+ purposes:
256
+ - deploy
257
+ - config
258
+ validation:
259
+ kind: number
260
+ sourcePriority:
261
+ - machine-config
262
+ - process-env
263
+ defaultValueRef: workdayTaskCreditBudgetDefault
264
+ TREESEED_MANAGER_MAX_QUEUED_TASKS:
265
+ label: Manager max queued tasks
266
+ group: hosting
267
+ description: Upper bound on how many runnable tasks the manager will keep queued at one time.
268
+ howToGet: Start small so queue top-ups stay budget-aware and incremental.
269
+ sensitivity: plain
270
+ targets:
271
+ - github-variable
272
+ - railway-var
273
+ scopes:
274
+ - staging
275
+ - prod
276
+ storage: scoped
277
+ requirement: optional
278
+ purposes:
279
+ - deploy
280
+ - config
281
+ validation:
282
+ kind: number
283
+ sourcePriority:
284
+ - machine-config
285
+ - process-env
286
+ defaultValueRef: managerMaxQueuedTasksDefault
287
+ TREESEED_MANAGER_MAX_QUEUED_CREDITS:
288
+ label: Manager max queued credits
289
+ group: hosting
290
+ description: Credit ceiling for runnable queued work so the manager never seeds the entire day’s budget at once.
291
+ howToGet: Set this lower than or equal to the daily task-credit budget.
292
+ sensitivity: plain
293
+ targets:
294
+ - github-variable
295
+ - railway-var
296
+ scopes:
297
+ - staging
298
+ - prod
299
+ storage: scoped
300
+ requirement: optional
301
+ purposes:
302
+ - deploy
303
+ - config
304
+ validation:
305
+ kind: number
306
+ sourcePriority:
307
+ - machine-config
308
+ - process-env
309
+ defaultValueRef: managerMaxQueuedCreditsDefault
310
+ TREESEED_MANAGER_PRIORITY_MODELS:
311
+ label: Manager priority models
312
+ group: hosting
313
+ description: Comma-separated content models the manager should evaluate when building priority snapshots.
314
+ howToGet: Leave unset to use the default objective/question/note/page/book/knowledge set.
315
+ sensitivity: plain
316
+ targets:
317
+ - github-variable
318
+ - railway-var
319
+ scopes:
320
+ - staging
321
+ - prod
322
+ storage: scoped
323
+ requirement: optional
324
+ purposes:
325
+ - deploy
326
+ - config
327
+ validation:
328
+ kind: nonempty
329
+ sourcePriority:
330
+ - machine-config
331
+ - process-env
332
+ defaultValueRef: managerPriorityModelsDefault
333
+ TREESEED_TASK_CREDIT_WEIGHTS_JSON:
334
+ label: Task credit weights JSON
335
+ group: hosting
336
+ description: JSON array of task-type or model-specific credit weights used when estimating daily budget consumption.
337
+ howToGet: Provide a JSON value such as [{"type":"question","credits":3}].
338
+ sensitivity: plain
339
+ targets:
340
+ - github-variable
341
+ - railway-var
342
+ scopes:
343
+ - staging
344
+ - prod
345
+ storage: scoped
346
+ requirement: optional
347
+ purposes:
348
+ - deploy
349
+ - config
350
+ validation:
351
+ kind: nonempty
352
+ sourcePriority:
353
+ - machine-config
354
+ - process-env
355
+ defaultValueRef: taskCreditWeightsDefault
356
+ TREESEED_WORKER_POOL_SCALER:
357
+ label: Worker pool scaler kind
358
+ group: hosting
359
+ description: Selects the runtime worker scaler adapter. Hosted Railway projects should normally use railway.
360
+ howToGet: Set this to railway for hosted projects or noop/manual for self-hosted environments without automatic scale control.
361
+ sensitivity: plain
362
+ targets:
363
+ - github-variable
364
+ - railway-var
365
+ scopes:
366
+ - staging
367
+ - prod
368
+ storage: scoped
369
+ requirement: optional
370
+ purposes:
371
+ - deploy
372
+ - config
373
+ validation:
374
+ kind: enum
375
+ values:
376
+ - railway
377
+ - noop
378
+ - manual
379
+ sourcePriority:
380
+ - machine-config
381
+ - process-env
382
+ defaultValueRef: workerPoolScalerDefault
383
+ TREESEED_RAILWAY_PROJECT_ID:
384
+ label: Railway project ID
385
+ group: hosting
386
+ visibility: system
387
+ description: Railway project identifier used by runtime scaling and reconciliation helpers for the active environment.
388
+ howToGet: Copy the project ID from Railway when automatic worker scaling is enabled.
389
+ sensitivity: plain
390
+ targets:
391
+ - github-variable
392
+ - railway-var
393
+ scopes:
394
+ - staging
395
+ - prod
396
+ storage: scoped
397
+ requirement: optional
398
+ purposes:
399
+ - deploy
400
+ - config
401
+ validation:
402
+ kind: nonempty
403
+ sourcePriority:
404
+ - machine-config
405
+ - process-env
406
+ TREESEED_RAILWAY_ENVIRONMENT_ID:
407
+ label: Railway environment ID
408
+ group: hosting
409
+ visibility: system
410
+ description: Railway environment identifier used by the runtime scaler when adjusting worker replicas.
411
+ howToGet: Copy the environment ID from Railway for the matching staging or production environment.
412
+ sensitivity: plain
413
+ targets:
414
+ - github-variable
415
+ - railway-var
416
+ scopes:
417
+ - staging
418
+ - prod
419
+ storage: scoped
420
+ requirement: optional
421
+ purposes:
422
+ - deploy
423
+ - config
424
+ validation:
425
+ kind: nonempty
426
+ sourcePriority:
427
+ - machine-config
428
+ - process-env
429
+ TREESEED_RAILWAY_WORKER_SERVICE_ID:
430
+ label: Railway worker service ID
431
+ group: hosting
432
+ visibility: system
433
+ description: Railway service identifier for the scalable worker pool that the manager adjusts at runtime.
434
+ howToGet: Copy the worker service ID from Railway after the hosted project environment is provisioned.
435
+ sensitivity: plain
436
+ targets:
437
+ - github-variable
438
+ - railway-var
439
+ scopes:
440
+ - staging
441
+ - prod
442
+ storage: scoped
443
+ requirement: optional
444
+ purposes:
445
+ - deploy
446
+ - config
447
+ validation:
448
+ kind: nonempty
449
+ sourcePriority:
450
+ - machine-config
451
+ - process-env
452
+ TREESEED_API_BASE_URL:
453
+ label: Treeseed API base URL
454
+ group: auth
455
+ description: Base URL for the API used by the site BFF, CLI, and remote auth flows. Local defaults should resolve automatically from the integrated runtime, while hosted environments prefer configured service URLs and project domains.
456
+ howToGet: Override this only when the generated local or hosted API URL is wrong for the selected environment.
457
+ sensitivity: plain
458
+ targets:
459
+ - local-runtime
460
+ - local-cloudflare
461
+ - github-variable
462
+ - railway-var
463
+ - cloudflare-var
464
+ scopes:
465
+ - local
466
+ - staging
467
+ - prod
468
+ storage: scoped
469
+ requirement: required
470
+ purposes:
471
+ - dev
472
+ - deploy
473
+ - config
474
+ validation:
475
+ kind: nonempty
476
+ sourcePriority:
477
+ - machine-config
478
+ - process-env
479
+ defaultValueRef: apiBaseUrlDefault
480
+ relevanceRef: apiSurfaceEnabled
481
+ TREESEED_API_D1_DATABASE_ID:
482
+ label: API D1 database ID
483
+ group: auth
484
+ description: Cloudflare D1 database identifier used by the Railway API for remote auth and session persistence.
485
+ howToGet: In Cloudflare D1, copy the database ID for SITE_DATA_DB and paste it here.
486
+ sensitivity: plain
487
+ targets:
488
+ - railway-var
489
+ scopes:
490
+ - staging
491
+ - prod
492
+ requirement: optional
493
+ purposes:
494
+ - deploy
495
+ - config
496
+ validation:
497
+ kind: nonempty
498
+ sourcePriority:
499
+ - machine-config
500
+ - process-env
501
+ relevanceRef: apiSurfaceEnabled
502
+ TREESEED_API_D1_DATABASE_NAME:
503
+ label: API D1 database name
504
+ group: auth
505
+ description: D1 binding or database name used by the Railway API for local Wrangler-backed auth access.
506
+ howToGet: Use the D1 binding name, typically SITE_DATA_DB.
507
+ sensitivity: plain
508
+ targets:
509
+ - local-runtime
510
+ scopes:
511
+ - local
512
+ requirement: optional
513
+ purposes:
514
+ - dev
515
+ - config
516
+ validation:
517
+ kind: nonempty
518
+ sourcePriority:
519
+ - machine-config
520
+ - process-env
521
+ relevanceRef: apiSurfaceEnabled
522
+ TREESEED_API_D1_LOCAL_PERSIST_TO:
523
+ label: API local D1 persist path
524
+ group: auth
525
+ description: Optional Wrangler D1 persistence directory used when the Railway API runs locally against SITE_DATA_DB.
526
+ howToGet: Use the local Wrangler D1 persist directory, such as .wrangler/state/v3/d1.
527
+ sensitivity: plain
528
+ targets:
529
+ - local-runtime
530
+ scopes:
531
+ - local
532
+ requirement: optional
533
+ purposes:
534
+ - dev
535
+ - config
536
+ validation:
537
+ kind: nonempty
538
+ sourcePriority:
539
+ - machine-config
540
+ - process-env
541
+ relevanceRef: apiSurfaceEnabled
542
+ TREESEED_API_WEB_SERVICE_ID:
543
+ label: API trusted web service ID
544
+ group: auth
545
+ description: Trusted web service identity expected by the agent Treeseed API runtime in @treeseed/agent for Astro BFF calls.
546
+ howToGet: Match this to the web service ID configured on the Astro side, typically web.
547
+ sensitivity: plain
548
+ targets:
549
+ - local-runtime
550
+ - railway-var
551
+ scopes:
552
+ - local
553
+ - staging
554
+ - prod
555
+ requirement: required
556
+ purposes:
557
+ - dev
558
+ - deploy
559
+ - config
560
+ validation:
561
+ kind: nonempty
562
+ sourcePriority:
563
+ - machine-config
564
+ - process-env
565
+ defaultValueRef: apiWebServiceIdDefault
566
+ localDefaultValueRef: apiWebServiceIdDefault
567
+ relevanceRef: apiSurfaceEnabled
568
+ TREESEED_API_WEB_SERVICE_SECRET:
569
+ label: API trusted web service secret
570
+ group: auth
571
+ description: Shared secret expected by the agent Treeseed API runtime in @treeseed/agent for Astro BFF calls.
572
+ howToGet: Match this to the web service secret configured on the Astro side.
573
+ sensitivity: secret
574
+ targets:
575
+ - local-runtime
576
+ - github-secret
577
+ - railway-secret
578
+ scopes:
579
+ - local
580
+ - staging
581
+ - prod
582
+ requirement: required
583
+ purposes:
584
+ - dev
585
+ - deploy
586
+ - config
587
+ validation:
588
+ kind: nonempty
589
+ sourcePriority:
590
+ - machine-config
591
+ - process-env
592
+ defaultValueRef: generatedSecret
593
+ localDefaultValueRef: generatedSecret
594
+ relevanceRef: apiSurfaceEnabled
595
+ TREESEED_API_WEB_ASSERTION_SECRET:
596
+ label: API web assertion secret
597
+ group: auth
598
+ description: Secret used by the agent Treeseed API runtime in @treeseed/agent to verify trusted web user-context assertions.
599
+ howToGet: Match this to the web assertion secret configured on the Astro side.
600
+ sensitivity: secret
601
+ targets:
602
+ - local-runtime
603
+ - github-secret
604
+ - railway-secret
605
+ scopes:
606
+ - local
607
+ - staging
608
+ - prod
609
+ requirement: required
610
+ purposes:
611
+ - dev
612
+ - deploy
613
+ - config
614
+ validation:
615
+ kind: nonempty
616
+ sourcePriority:
617
+ - machine-config
618
+ - process-env
619
+ defaultValueRef: generatedSecret
620
+ localDefaultValueRef: generatedSecret
621
+ relevanceRef: apiSurfaceEnabled
622
+ TREESEED_API_AUTH_SECRET:
623
+ label: API auth secret
624
+ group: auth
625
+ description: Secret used by the agent API auth provider to sign access, refresh, service, and trusted exchange tokens.
626
+ howToGet: Generate a strong random secret and keep it stable per API environment.
627
+ sensitivity: secret
628
+ targets:
629
+ - local-runtime
630
+ - github-secret
631
+ - railway-secret
632
+ scopes:
633
+ - local
634
+ - staging
635
+ - prod
636
+ requirement: required
637
+ purposes:
638
+ - dev
639
+ - deploy
640
+ - config
641
+ validation:
642
+ kind: nonempty
643
+ sourcePriority:
644
+ - machine-config
645
+ - process-env
646
+ defaultValueRef: generatedSecret
647
+ localDefaultValueRef: generatedSecret
648
+ relevanceRef: apiSurfaceEnabled
649
+ TREESEED_API_ISSUER:
650
+ label: API token issuer
651
+ group: auth
652
+ description: Issuer claim used in agent API auth tokens. Defaults to TREESEED_API_BASE_URL when unset.
653
+ howToGet: Use the public API base URL for the environment.
654
+ sensitivity: plain
655
+ targets:
656
+ - local-runtime
657
+ - railway-var
658
+ scopes:
659
+ - local
660
+ - staging
661
+ - prod
662
+ requirement: optional
663
+ purposes:
664
+ - dev
665
+ - deploy
666
+ - config
667
+ validation:
668
+ kind: url
669
+ sourcePriority:
670
+ - machine-config
671
+ - process-env
672
+ relevanceRef: apiSurfaceEnabled
673
+ TREESEED_API_PROVIDER_AUTH:
674
+ label: API auth provider
675
+ group: auth
676
+ description: Core API auth provider implementation. Use d1 for durable users, identities, API tokens, and sessions.
677
+ howToGet: Use d1 for market environments.
678
+ sensitivity: plain
679
+ targets:
680
+ - local-runtime
681
+ - railway-var
682
+ scopes:
683
+ - local
684
+ - staging
685
+ - prod
686
+ requirement: optional
687
+ purposes:
688
+ - dev
689
+ - deploy
690
+ - config
691
+ validation:
692
+ kind: enum
693
+ values:
694
+ - d1
695
+ - memory
696
+ sourcePriority:
697
+ - machine-config
698
+ - process-env
699
+ relevanceRef: apiSurfaceEnabled
700
+ TREESEED_API_ACCESS_TOKEN_TTL:
701
+ label: API access token TTL
702
+ group: auth
703
+ description: Access token lifetime in seconds for agent API user and service exchanges.
704
+ howToGet: Use 900 for a 15 minute access token unless a stricter policy is required.
705
+ sensitivity: plain
706
+ targets:
707
+ - local-runtime
708
+ - railway-var
709
+ scopes:
710
+ - local
711
+ - staging
712
+ - prod
713
+ requirement: optional
714
+ purposes:
715
+ - dev
716
+ - deploy
717
+ - config
718
+ validation:
719
+ kind: number
720
+ sourcePriority:
721
+ - machine-config
722
+ - process-env
723
+ relevanceRef: apiSurfaceEnabled
724
+ TREESEED_API_REFRESH_TOKEN_TTL:
725
+ label: API refresh token TTL
726
+ group: auth
727
+ description: Refresh token lifetime in seconds for agent API user sessions.
728
+ howToGet: Use 604800 for seven days, or a shorter value for stricter environments.
729
+ sensitivity: plain
730
+ targets:
731
+ - local-runtime
732
+ - railway-var
733
+ scopes:
734
+ - local
735
+ - staging
736
+ - prod
737
+ requirement: optional
738
+ purposes:
739
+ - dev
740
+ - deploy
741
+ - config
742
+ validation:
743
+ kind: number
744
+ sourcePriority:
745
+ - machine-config
746
+ - process-env
747
+ relevanceRef: apiSurfaceEnabled
748
+ TREESEED_API_WEB_EXCHANGE_TTL:
749
+ label: API web exchange TTL
750
+ group: auth
751
+ description: Lifetime in seconds for trusted web-to-API exchanged access tokens.
752
+ howToGet: Use 300 for short-lived browser BFF exchanges.
753
+ sensitivity: plain
754
+ targets:
755
+ - local-runtime
756
+ - railway-var
757
+ scopes:
758
+ - local
759
+ - staging
760
+ - prod
761
+ requirement: optional
762
+ purposes:
763
+ - dev
764
+ - deploy
765
+ - config
766
+ validation:
767
+ kind: number
768
+ sourcePriority:
769
+ - machine-config
770
+ - process-env
771
+ relevanceRef: apiSurfaceEnabled
772
+ TREESEED_API_DEVICE_CODE_TTL:
773
+ label: API device code TTL
774
+ group: auth
775
+ description: Device authorization code lifetime in seconds.
776
+ howToGet: Use 600 for a ten minute device authorization window.
777
+ sensitivity: plain
778
+ targets:
779
+ - local-runtime
780
+ - railway-var
781
+ scopes:
782
+ - local
783
+ - staging
784
+ - prod
785
+ requirement: optional
786
+ purposes:
787
+ - dev
788
+ - deploy
789
+ - config
790
+ validation:
791
+ kind: number
792
+ sourcePriority:
793
+ - machine-config
794
+ - process-env
795
+ relevanceRef: apiSurfaceEnabled
796
+ TREESEED_API_DEVICE_CODE_POLL_INTERVAL:
797
+ label: API device code poll interval
798
+ group: auth
799
+ description: Minimum polling interval in seconds for device authorization clients.
800
+ howToGet: Use 5 unless clients need a slower polling cadence.
801
+ sensitivity: plain
802
+ targets:
803
+ - local-runtime
804
+ - railway-var
805
+ scopes:
806
+ - local
807
+ - staging
808
+ - prod
809
+ requirement: optional
810
+ purposes:
811
+ - dev
812
+ - deploy
813
+ - config
814
+ validation:
815
+ kind: number
816
+ sourcePriority:
817
+ - machine-config
818
+ - process-env
819
+ relevanceRef: apiSurfaceEnabled
820
+ TREESEED_API_BOOTSTRAP_ADMIN_ALLOWLIST:
821
+ label: API bootstrap admin allowlist
822
+ group: auth
823
+ description: Comma-separated list of trusted emails or provider subjects that receive the platform_admin root role on first identity sync. The platform_admin role grants every global permission.
824
+ howToGet: |
825
+ Recipe:
826
+ 1. Decide who the root market operator is before the first sign-in for an environment.
827
+ 2. For internal email/password registration, add the normalized email address, for example founder@example.com.
828
+ 3. For OAuth-only bootstrapping, add provider:subject entries after you know the provider subject, for example github:1234567 or google:109876543210987654321.
829
+ 4. Separate multiple trusted identities with commas.
830
+ 5. Start narrowly. Remove bootstrap entries after the intended root users have signed in and received platform_admin.
831
+ 6. In the UI, the signed-in root user is shown on /app/account as "Root user" with the platform_admin badge.
832
+ Notes:
833
+ - platform_admin is defined in core RBAC and maps to *:*:*.
834
+ - Agent owns reusable global roles and permissions; market team ownership remains in the market tables.
835
+ sensitivity: plain
836
+ targets:
837
+ - local-runtime
838
+ - cloudflare-var
839
+ - railway-var
840
+ scopes:
841
+ - local
842
+ - staging
843
+ - prod
844
+ requirement: optional
845
+ purposes:
846
+ - dev
847
+ - deploy
848
+ - config
849
+ validation:
850
+ kind: nonempty
851
+ sourcePriority:
852
+ - machine-config
853
+ - process-env
854
+ relevanceRef: apiSurfaceEnabled
855
+ TREESEED_CAPACITY_PROVIDER_ID:
856
+ label: Capacity provider ID
857
+ group: processing
858
+ description: Stable identifier registered by a Processing host with the market control plane.
859
+ howToGet: Use the provider id assigned by the market control plane, or a stable slug for local Processing hosts.
860
+ sensitivity: plain
861
+ targets:
862
+ - local-runtime
863
+ - railway-var
864
+ scopes:
865
+ - local
866
+ - staging
867
+ - prod
868
+ storage: scoped
869
+ requirement: optional
870
+ purposes:
871
+ - dev
872
+ - deploy
873
+ - config
874
+ validation:
875
+ kind: nonempty
876
+ sourcePriority:
877
+ - machine-config
878
+ - process-env
879
+ relevanceRef: processingPlaneEnabled
880
+ TREESEED_CAPACITY_PROVIDER_TEAM_ID:
881
+ label: Capacity provider team ID
882
+ group: processing
883
+ description: Team id that owns or is assigned the Processing host capacity provider.
884
+ howToGet: Use the team id from the market control plane capacity provider record.
885
+ sensitivity: plain
886
+ targets:
887
+ - local-runtime
888
+ - railway-var
889
+ scopes:
890
+ - local
891
+ - staging
892
+ - prod
893
+ storage: scoped
894
+ requirement: optional
895
+ purposes:
896
+ - dev
897
+ - deploy
898
+ - config
899
+ validation:
900
+ kind: nonempty
901
+ sourcePriority:
902
+ - machine-config
903
+ - process-env
904
+ relevanceRef: processingPlaneEnabled
905
+ TREESEED_CAPACITY_PROVIDER_SERVICE_BASE_URL:
906
+ label: Capacity provider service URL
907
+ group: processing
908
+ description: Public base URL where the Processing host API exposes health, heartbeat, and task endpoints.
909
+ howToGet: Use the API service URL from the Processing host deployment.
910
+ sensitivity: plain
911
+ targets:
912
+ - local-runtime
913
+ - railway-var
914
+ scopes:
915
+ - local
916
+ - staging
917
+ - prod
918
+ storage: scoped
919
+ requirement: optional
920
+ purposes:
921
+ - dev
922
+ - deploy
923
+ - config
924
+ validation:
925
+ kind: url
926
+ sourcePriority:
927
+ - machine-config
928
+ - process-env
929
+ relevanceRef: processingPlaneEnabled
930
+ TREESEED_PROCESSING_DRAIN:
931
+ label: Processing drain mode
932
+ group: processing
933
+ description: Set to 1 to report the Processing host as draining and stop accepting new work.
934
+ howToGet: Set temporarily during maintenance or decommissioning.
935
+ sensitivity: plain
936
+ targets:
937
+ - local-runtime
938
+ - railway-var
939
+ scopes:
940
+ - local
941
+ - staging
942
+ - prod
943
+ storage: scoped
944
+ requirement: optional
945
+ purposes:
946
+ - dev
947
+ - deploy
948
+ - config
949
+ validation:
950
+ kind: enum
951
+ values:
952
+ - "0"
953
+ - "1"
954
+ sourcePriority:
955
+ - machine-config
956
+ - process-env
957
+ relevanceRef: processingPlaneEnabled