@treeseed/sdk 0.6.1 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/operations/services/bootstrap-runner.d.ts +33 -0
- package/dist/operations/services/bootstrap-runner.js +136 -0
- package/dist/operations/services/config-runtime.d.ts +27 -8
- package/dist/operations/services/config-runtime.js +297 -124
- package/dist/operations/services/github-api.d.ts +33 -0
- package/dist/operations/services/github-api.js +118 -4
- package/dist/operations/services/github-automation.d.ts +30 -0
- package/dist/operations/services/github-automation.js +107 -1
- package/dist/operations/services/project-platform.d.ts +38 -2
- package/dist/operations/services/project-platform.js +281 -9
- package/dist/operations/services/railway-deploy.d.ts +6 -2
- package/dist/operations/services/railway-deploy.js +26 -18
- package/dist/operations/services/runtime-tools.d.ts +0 -2
- package/dist/operations/services/runtime-tools.js +0 -2
- package/dist/platform/env.yaml +68 -96
- package/dist/platform/environment.js +51 -0
- package/dist/reconcile/bootstrap-systems.d.ts +32 -0
- package/dist/reconcile/bootstrap-systems.js +175 -0
- package/dist/reconcile/builtin-adapters.js +1 -9
- package/dist/reconcile/desired-state.js +16 -14
- package/dist/reconcile/engine.d.ts +9 -4
- package/dist/reconcile/engine.js +57 -14
- package/dist/reconcile/index.d.ts +1 -0
- package/dist/reconcile/index.js +1 -0
- package/dist/scripts/config-treeseed.js +30 -0
- package/dist/scripts/package-tools.js +0 -2
- package/dist/scripts/tenant-deploy.js +16 -36
- package/dist/scripts/test-cloudflare-local.js +0 -2
- package/dist/workflow/operations.js +23 -4
- package/dist/workflow.d.ts +5 -0
- package/package.json +1 -1
- package/templates/github/deploy.workflow.yml +15 -15
package/dist/platform/env.yaml
CHANGED
|
@@ -23,6 +23,70 @@ entries:
|
|
|
23
23
|
sourcePriority:
|
|
24
24
|
- machine-config
|
|
25
25
|
- process-env
|
|
26
|
+
TREESEED_GITHUB_OWNER:
|
|
27
|
+
label: GitHub repository owner
|
|
28
|
+
group: github
|
|
29
|
+
description: GitHub user or organization that owns the Treeseed repository used for bootstrap, CI/CD, and environment sync.
|
|
30
|
+
howToGet: Treeseed suggests this from the origin remote when available. Otherwise enter the GitHub user or organization that should own the repository.
|
|
31
|
+
sensitivity: plain
|
|
32
|
+
targets:
|
|
33
|
+
- local-runtime
|
|
34
|
+
scopes:
|
|
35
|
+
- local
|
|
36
|
+
storage: scoped
|
|
37
|
+
requirement: required
|
|
38
|
+
purposes:
|
|
39
|
+
- config
|
|
40
|
+
validation:
|
|
41
|
+
kind: nonempty
|
|
42
|
+
sourcePriority:
|
|
43
|
+
- machine-config
|
|
44
|
+
- process-env
|
|
45
|
+
defaultValueRef: githubOwnerDefault
|
|
46
|
+
TREESEED_GITHUB_REPOSITORY_NAME:
|
|
47
|
+
label: GitHub repository name
|
|
48
|
+
group: github
|
|
49
|
+
description: GitHub repository name Treeseed should verify or create before GitHub bootstrap.
|
|
50
|
+
howToGet: Treeseed suggests this from the origin remote when available and otherwise defaults it from the site slug.
|
|
51
|
+
sensitivity: plain
|
|
52
|
+
targets:
|
|
53
|
+
- local-runtime
|
|
54
|
+
scopes:
|
|
55
|
+
- local
|
|
56
|
+
storage: scoped
|
|
57
|
+
requirement: required
|
|
58
|
+
purposes:
|
|
59
|
+
- config
|
|
60
|
+
validation:
|
|
61
|
+
kind: nonempty
|
|
62
|
+
sourcePriority:
|
|
63
|
+
- machine-config
|
|
64
|
+
- process-env
|
|
65
|
+
defaultValueRef: githubRepositoryNameDefault
|
|
66
|
+
TREESEED_GITHUB_REPOSITORY_VISIBILITY:
|
|
67
|
+
label: GitHub repository visibility
|
|
68
|
+
group: github
|
|
69
|
+
description: Visibility to use if Treeseed needs to create the GitHub repository during bootstrap.
|
|
70
|
+
howToGet: Choose private, public, or internal. Treeseed defaults new repositories to private.
|
|
71
|
+
sensitivity: plain
|
|
72
|
+
targets:
|
|
73
|
+
- local-runtime
|
|
74
|
+
scopes:
|
|
75
|
+
- local
|
|
76
|
+
storage: scoped
|
|
77
|
+
requirement: optional
|
|
78
|
+
purposes:
|
|
79
|
+
- config
|
|
80
|
+
validation:
|
|
81
|
+
kind: enum
|
|
82
|
+
values:
|
|
83
|
+
- private
|
|
84
|
+
- public
|
|
85
|
+
- internal
|
|
86
|
+
sourcePriority:
|
|
87
|
+
- machine-config
|
|
88
|
+
- process-env
|
|
89
|
+
defaultValueRef: githubRepositoryVisibilityDefault
|
|
26
90
|
CLOUDFLARE_API_TOKEN:
|
|
27
91
|
label: Cloudflare API token
|
|
28
92
|
group: auth
|
|
@@ -33,7 +97,6 @@ entries:
|
|
|
33
97
|
- local-runtime
|
|
34
98
|
- github-secret
|
|
35
99
|
scopes:
|
|
36
|
-
- local
|
|
37
100
|
- staging
|
|
38
101
|
- prod
|
|
39
102
|
storage: shared
|
|
@@ -53,13 +116,13 @@ entries:
|
|
|
53
116
|
label: Railway API token
|
|
54
117
|
group: auth
|
|
55
118
|
description: Primary Railway token for user or workspace scoped access, including project creation and most Treeseed-managed Railway flows.
|
|
56
|
-
howToGet: In Railway, create a user or workspace API token that can create and manage the target project, then paste it here.
|
|
119
|
+
howToGet: In Railway, create a user or workspace API token that can create and manage the target project, then paste it here.
|
|
57
120
|
sensitivity: secret
|
|
58
121
|
targets:
|
|
59
122
|
- local-runtime
|
|
123
|
+
- github-secret
|
|
60
124
|
- railway-secret
|
|
61
125
|
scopes:
|
|
62
|
-
- local
|
|
63
126
|
- staging
|
|
64
127
|
- prod
|
|
65
128
|
storage: shared
|
|
@@ -83,10 +146,8 @@ entries:
|
|
|
83
146
|
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.
|
|
84
147
|
sensitivity: plain
|
|
85
148
|
targets:
|
|
86
|
-
- local-runtime
|
|
87
149
|
- railway-var
|
|
88
150
|
scopes:
|
|
89
|
-
- local
|
|
90
151
|
- staging
|
|
91
152
|
- prod
|
|
92
153
|
storage: shared
|
|
@@ -108,9 +169,9 @@ entries:
|
|
|
108
169
|
group: cloudflare
|
|
109
170
|
description: Identifies the Cloudflare account Treeseed should provision and deploy into.
|
|
110
171
|
howToGet: In the Cloudflare dashboard, open Workers & Pages or Account Home and copy the account ID.
|
|
172
|
+
startupProfile: core
|
|
111
173
|
sensitivity: plain
|
|
112
174
|
targets:
|
|
113
|
-
- local-runtime
|
|
114
175
|
- github-variable
|
|
115
176
|
- config-file
|
|
116
177
|
scopes:
|
|
@@ -251,12 +312,10 @@ entries:
|
|
|
251
312
|
howToGet: Treeseed can derive this from the hosting block in treeseed.site.yaml. Override it only when the runtime environment must force a different deployment profile.
|
|
252
313
|
sensitivity: plain
|
|
253
314
|
targets:
|
|
254
|
-
- local-runtime
|
|
255
315
|
- github-variable
|
|
256
316
|
- railway-var
|
|
257
317
|
- config-file
|
|
258
318
|
scopes:
|
|
259
|
-
- local
|
|
260
319
|
- staging
|
|
261
320
|
- prod
|
|
262
321
|
storage: shared
|
|
@@ -282,12 +341,10 @@ entries:
|
|
|
282
341
|
howToGet: Treeseed can derive this from the hosting block in treeseed.site.yaml.
|
|
283
342
|
sensitivity: plain
|
|
284
343
|
targets:
|
|
285
|
-
- local-runtime
|
|
286
344
|
- github-variable
|
|
287
345
|
- railway-var
|
|
288
346
|
- config-file
|
|
289
347
|
scopes:
|
|
290
|
-
- local
|
|
291
348
|
- staging
|
|
292
349
|
- prod
|
|
293
350
|
storage: shared
|
|
@@ -312,17 +369,14 @@ entries:
|
|
|
312
369
|
howToGet: Use the hosted market API URL if Treeseed manages the project for you. Self-hosted deployments should only set this when registration with the market control plane is enabled.
|
|
313
370
|
sensitivity: plain
|
|
314
371
|
targets:
|
|
315
|
-
- local-runtime
|
|
316
372
|
- github-variable
|
|
317
373
|
- railway-var
|
|
318
374
|
scopes:
|
|
319
|
-
- local
|
|
320
375
|
- staging
|
|
321
376
|
- prod
|
|
322
377
|
storage: shared
|
|
323
378
|
requirement: conditional
|
|
324
379
|
purposes:
|
|
325
|
-
- dev
|
|
326
380
|
- deploy
|
|
327
381
|
- config
|
|
328
382
|
validation:
|
|
@@ -341,17 +395,14 @@ entries:
|
|
|
341
395
|
howToGet: Treeseed defaults this to the site slug unless you need a different hosted team identifier.
|
|
342
396
|
sensitivity: plain
|
|
343
397
|
targets:
|
|
344
|
-
- local-runtime
|
|
345
398
|
- github-variable
|
|
346
399
|
- railway-var
|
|
347
400
|
scopes:
|
|
348
|
-
- local
|
|
349
401
|
- staging
|
|
350
402
|
- prod
|
|
351
403
|
storage: shared
|
|
352
404
|
requirement: conditional
|
|
353
405
|
purposes:
|
|
354
|
-
- dev
|
|
355
406
|
- deploy
|
|
356
407
|
- config
|
|
357
408
|
validation:
|
|
@@ -369,17 +420,14 @@ entries:
|
|
|
369
420
|
howToGet: Treeseed defaults this to the site slug unless you need a different hosted project identifier.
|
|
370
421
|
sensitivity: plain
|
|
371
422
|
targets:
|
|
372
|
-
- local-runtime
|
|
373
423
|
- github-variable
|
|
374
424
|
- railway-var
|
|
375
425
|
scopes:
|
|
376
|
-
- local
|
|
377
426
|
- staging
|
|
378
427
|
- prod
|
|
379
428
|
storage: shared
|
|
380
429
|
requirement: conditional
|
|
381
430
|
purposes:
|
|
382
|
-
- dev
|
|
383
431
|
- deploy
|
|
384
432
|
- config
|
|
385
433
|
validation:
|
|
@@ -397,17 +445,14 @@ entries:
|
|
|
397
445
|
howToGet: Generate or rotate this token from the market control plane after connecting a project environment.
|
|
398
446
|
sensitivity: secret
|
|
399
447
|
targets:
|
|
400
|
-
- local-runtime
|
|
401
448
|
- github-secret
|
|
402
449
|
- railway-secret
|
|
403
450
|
scopes:
|
|
404
|
-
- local
|
|
405
451
|
- staging
|
|
406
452
|
- prod
|
|
407
453
|
storage: scoped
|
|
408
454
|
requirement: conditional
|
|
409
455
|
purposes:
|
|
410
|
-
- dev
|
|
411
456
|
- deploy
|
|
412
457
|
- config
|
|
413
458
|
validation:
|
|
@@ -423,17 +468,14 @@ entries:
|
|
|
423
468
|
howToGet: Set this to 0 for scale-to-zero by default unless the project requires warm workers.
|
|
424
469
|
sensitivity: plain
|
|
425
470
|
targets:
|
|
426
|
-
- local-runtime
|
|
427
471
|
- github-variable
|
|
428
472
|
- railway-var
|
|
429
473
|
scopes:
|
|
430
|
-
- local
|
|
431
474
|
- staging
|
|
432
475
|
- prod
|
|
433
476
|
storage: scoped
|
|
434
477
|
requirement: conditional
|
|
435
478
|
purposes:
|
|
436
|
-
- dev
|
|
437
479
|
- deploy
|
|
438
480
|
- config
|
|
439
481
|
validation:
|
|
@@ -450,17 +492,14 @@ entries:
|
|
|
450
492
|
howToGet: Choose a value that reflects your budget and expected concurrency ceiling.
|
|
451
493
|
sensitivity: plain
|
|
452
494
|
targets:
|
|
453
|
-
- local-runtime
|
|
454
495
|
- github-variable
|
|
455
496
|
- railway-var
|
|
456
497
|
scopes:
|
|
457
|
-
- local
|
|
458
498
|
- staging
|
|
459
499
|
- prod
|
|
460
500
|
storage: scoped
|
|
461
501
|
requirement: conditional
|
|
462
502
|
purposes:
|
|
463
|
-
- dev
|
|
464
503
|
- deploy
|
|
465
504
|
- config
|
|
466
505
|
validation:
|
|
@@ -477,17 +516,14 @@ entries:
|
|
|
477
516
|
howToGet: Start with 1 for conservative scaling, then raise it only after observing stable worker latency.
|
|
478
517
|
sensitivity: plain
|
|
479
518
|
targets:
|
|
480
|
-
- local-runtime
|
|
481
519
|
- github-variable
|
|
482
520
|
- railway-var
|
|
483
521
|
scopes:
|
|
484
|
-
- local
|
|
485
522
|
- staging
|
|
486
523
|
- prod
|
|
487
524
|
storage: scoped
|
|
488
525
|
requirement: conditional
|
|
489
526
|
purposes:
|
|
490
|
-
- dev
|
|
491
527
|
- deploy
|
|
492
528
|
- config
|
|
493
529
|
validation:
|
|
@@ -504,17 +540,14 @@ entries:
|
|
|
504
540
|
howToGet: Start with 60 seconds to prevent worker thrash in lightly bursty environments.
|
|
505
541
|
sensitivity: plain
|
|
506
542
|
targets:
|
|
507
|
-
- local-runtime
|
|
508
543
|
- github-variable
|
|
509
544
|
- railway-var
|
|
510
545
|
scopes:
|
|
511
|
-
- local
|
|
512
546
|
- staging
|
|
513
547
|
- prod
|
|
514
548
|
storage: scoped
|
|
515
549
|
requirement: conditional
|
|
516
550
|
purposes:
|
|
517
|
-
- dev
|
|
518
551
|
- deploy
|
|
519
552
|
- config
|
|
520
553
|
validation:
|
|
@@ -531,17 +564,14 @@ entries:
|
|
|
531
564
|
howToGet: Use the project team's operating timezone, such as America/New_York.
|
|
532
565
|
sensitivity: plain
|
|
533
566
|
targets:
|
|
534
|
-
- local-runtime
|
|
535
567
|
- github-variable
|
|
536
568
|
- railway-var
|
|
537
569
|
scopes:
|
|
538
|
-
- local
|
|
539
570
|
- staging
|
|
540
571
|
- prod
|
|
541
572
|
storage: scoped
|
|
542
573
|
requirement: optional
|
|
543
574
|
purposes:
|
|
544
|
-
- dev
|
|
545
575
|
- deploy
|
|
546
576
|
- config
|
|
547
577
|
validation:
|
|
@@ -557,17 +587,14 @@ entries:
|
|
|
557
587
|
howToGet: Provide a JSON value like [{"days":[1,2,3,4,5],"startTime":"09:00","endTime":"17:00"}].
|
|
558
588
|
sensitivity: plain
|
|
559
589
|
targets:
|
|
560
|
-
- local-runtime
|
|
561
590
|
- github-variable
|
|
562
591
|
- railway-var
|
|
563
592
|
scopes:
|
|
564
|
-
- local
|
|
565
593
|
- staging
|
|
566
594
|
- prod
|
|
567
595
|
storage: scoped
|
|
568
596
|
requirement: optional
|
|
569
597
|
purposes:
|
|
570
|
-
- dev
|
|
571
598
|
- deploy
|
|
572
599
|
- config
|
|
573
600
|
validation:
|
|
@@ -583,17 +610,14 @@ entries:
|
|
|
583
610
|
howToGet: Choose the daily throughput ceiling that matches the team's Copilot and infrastructure budget.
|
|
584
611
|
sensitivity: plain
|
|
585
612
|
targets:
|
|
586
|
-
- local-runtime
|
|
587
613
|
- github-variable
|
|
588
614
|
- railway-var
|
|
589
615
|
scopes:
|
|
590
|
-
- local
|
|
591
616
|
- staging
|
|
592
617
|
- prod
|
|
593
618
|
storage: scoped
|
|
594
619
|
requirement: optional
|
|
595
620
|
purposes:
|
|
596
|
-
- dev
|
|
597
621
|
- deploy
|
|
598
622
|
- config
|
|
599
623
|
validation:
|
|
@@ -609,17 +633,14 @@ entries:
|
|
|
609
633
|
howToGet: Start small so queue top-ups stay budget-aware and incremental.
|
|
610
634
|
sensitivity: plain
|
|
611
635
|
targets:
|
|
612
|
-
- local-runtime
|
|
613
636
|
- github-variable
|
|
614
637
|
- railway-var
|
|
615
638
|
scopes:
|
|
616
|
-
- local
|
|
617
639
|
- staging
|
|
618
640
|
- prod
|
|
619
641
|
storage: scoped
|
|
620
642
|
requirement: optional
|
|
621
643
|
purposes:
|
|
622
|
-
- dev
|
|
623
644
|
- deploy
|
|
624
645
|
- config
|
|
625
646
|
validation:
|
|
@@ -635,17 +656,14 @@ entries:
|
|
|
635
656
|
howToGet: Set this lower than or equal to the daily task-credit budget.
|
|
636
657
|
sensitivity: plain
|
|
637
658
|
targets:
|
|
638
|
-
- local-runtime
|
|
639
659
|
- github-variable
|
|
640
660
|
- railway-var
|
|
641
661
|
scopes:
|
|
642
|
-
- local
|
|
643
662
|
- staging
|
|
644
663
|
- prod
|
|
645
664
|
storage: scoped
|
|
646
665
|
requirement: optional
|
|
647
666
|
purposes:
|
|
648
|
-
- dev
|
|
649
667
|
- deploy
|
|
650
668
|
- config
|
|
651
669
|
validation:
|
|
@@ -661,17 +679,14 @@ entries:
|
|
|
661
679
|
howToGet: Leave unset to use the default objective/question/note/page/book/knowledge set.
|
|
662
680
|
sensitivity: plain
|
|
663
681
|
targets:
|
|
664
|
-
- local-runtime
|
|
665
682
|
- github-variable
|
|
666
683
|
- railway-var
|
|
667
684
|
scopes:
|
|
668
|
-
- local
|
|
669
685
|
- staging
|
|
670
686
|
- prod
|
|
671
687
|
storage: scoped
|
|
672
688
|
requirement: optional
|
|
673
689
|
purposes:
|
|
674
|
-
- dev
|
|
675
690
|
- deploy
|
|
676
691
|
- config
|
|
677
692
|
validation:
|
|
@@ -687,17 +702,14 @@ entries:
|
|
|
687
702
|
howToGet: Provide a JSON value such as [{"type":"question","credits":3}].
|
|
688
703
|
sensitivity: plain
|
|
689
704
|
targets:
|
|
690
|
-
- local-runtime
|
|
691
705
|
- github-variable
|
|
692
706
|
- railway-var
|
|
693
707
|
scopes:
|
|
694
|
-
- local
|
|
695
708
|
- staging
|
|
696
709
|
- prod
|
|
697
710
|
storage: scoped
|
|
698
711
|
requirement: optional
|
|
699
712
|
purposes:
|
|
700
|
-
- dev
|
|
701
713
|
- deploy
|
|
702
714
|
- config
|
|
703
715
|
validation:
|
|
@@ -713,17 +725,14 @@ entries:
|
|
|
713
725
|
howToGet: Set this to railway for hosted projects or noop/manual for self-hosted environments without automatic scale control.
|
|
714
726
|
sensitivity: plain
|
|
715
727
|
targets:
|
|
716
|
-
- local-runtime
|
|
717
728
|
- github-variable
|
|
718
729
|
- railway-var
|
|
719
730
|
scopes:
|
|
720
|
-
- local
|
|
721
731
|
- staging
|
|
722
732
|
- prod
|
|
723
733
|
storage: scoped
|
|
724
734
|
requirement: optional
|
|
725
735
|
purposes:
|
|
726
|
-
- dev
|
|
727
736
|
- deploy
|
|
728
737
|
- config
|
|
729
738
|
validation:
|
|
@@ -743,17 +752,14 @@ entries:
|
|
|
743
752
|
howToGet: Copy the project ID from Railway when automatic worker scaling is enabled.
|
|
744
753
|
sensitivity: plain
|
|
745
754
|
targets:
|
|
746
|
-
- local-runtime
|
|
747
755
|
- github-variable
|
|
748
756
|
- railway-var
|
|
749
757
|
scopes:
|
|
750
|
-
- local
|
|
751
758
|
- staging
|
|
752
759
|
- prod
|
|
753
760
|
storage: scoped
|
|
754
761
|
requirement: optional
|
|
755
762
|
purposes:
|
|
756
|
-
- dev
|
|
757
763
|
- deploy
|
|
758
764
|
- config
|
|
759
765
|
validation:
|
|
@@ -768,17 +774,14 @@ entries:
|
|
|
768
774
|
howToGet: Copy the environment ID from Railway for the matching staging or production environment.
|
|
769
775
|
sensitivity: plain
|
|
770
776
|
targets:
|
|
771
|
-
- local-runtime
|
|
772
777
|
- github-variable
|
|
773
778
|
- railway-var
|
|
774
779
|
scopes:
|
|
775
|
-
- local
|
|
776
780
|
- staging
|
|
777
781
|
- prod
|
|
778
782
|
storage: scoped
|
|
779
783
|
requirement: optional
|
|
780
784
|
purposes:
|
|
781
|
-
- dev
|
|
782
785
|
- deploy
|
|
783
786
|
- config
|
|
784
787
|
validation:
|
|
@@ -793,17 +796,14 @@ entries:
|
|
|
793
796
|
howToGet: Copy the worker service ID from Railway after the hosted project environment is provisioned.
|
|
794
797
|
sensitivity: plain
|
|
795
798
|
targets:
|
|
796
|
-
- local-runtime
|
|
797
799
|
- github-variable
|
|
798
800
|
- railway-var
|
|
799
801
|
scopes:
|
|
800
|
-
- local
|
|
801
802
|
- staging
|
|
802
803
|
- prod
|
|
803
804
|
storage: scoped
|
|
804
805
|
requirement: optional
|
|
805
806
|
purposes:
|
|
806
|
-
- dev
|
|
807
807
|
- deploy
|
|
808
808
|
- config
|
|
809
809
|
validation:
|
|
@@ -842,6 +842,7 @@ entries:
|
|
|
842
842
|
- process-env
|
|
843
843
|
defaultValueRef: generatedSecret
|
|
844
844
|
localDefaultValueRef: generatedSecret
|
|
845
|
+
relevanceRef: formsEnabled
|
|
845
846
|
TREESEED_PUBLIC_TURNSTILE_SITE_KEY:
|
|
846
847
|
label: Turnstile site key
|
|
847
848
|
group: forms
|
|
@@ -850,18 +851,14 @@ entries:
|
|
|
850
851
|
howToGet: Create a Turnstile widget in Cloudflare Turnstile and copy the site key.
|
|
851
852
|
sensitivity: plain
|
|
852
853
|
targets:
|
|
853
|
-
- local-runtime
|
|
854
|
-
- local-cloudflare
|
|
855
854
|
- github-variable
|
|
856
855
|
- cloudflare-var
|
|
857
856
|
scopes:
|
|
858
|
-
- local
|
|
859
857
|
- staging
|
|
860
858
|
- prod
|
|
861
859
|
storage: shared
|
|
862
860
|
requirement: conditional
|
|
863
861
|
purposes:
|
|
864
|
-
- dev
|
|
865
862
|
- save
|
|
866
863
|
- deploy
|
|
867
864
|
- config
|
|
@@ -880,18 +877,14 @@ entries:
|
|
|
880
877
|
howToGet: Create a Turnstile widget in Cloudflare Turnstile and copy the secret key.
|
|
881
878
|
sensitivity: secret
|
|
882
879
|
targets:
|
|
883
|
-
- local-runtime
|
|
884
|
-
- local-cloudflare
|
|
885
880
|
- github-secret
|
|
886
881
|
- cloudflare-secret
|
|
887
882
|
scopes:
|
|
888
|
-
- local
|
|
889
883
|
- staging
|
|
890
884
|
- prod
|
|
891
885
|
storage: shared
|
|
892
886
|
requirement: conditional
|
|
893
887
|
purposes:
|
|
894
|
-
- dev
|
|
895
888
|
- save
|
|
896
889
|
- deploy
|
|
897
890
|
- config
|
|
@@ -902,27 +895,6 @@ entries:
|
|
|
902
895
|
- process-env
|
|
903
896
|
relevanceRef: turnstileEnabled
|
|
904
897
|
requiredWhenRef: turnstileNonLocal
|
|
905
|
-
TREESEED_PUBLIC_FORMS_LOCAL_BYPASS_TURNSTILE:
|
|
906
|
-
label: Local Turnstile bypass
|
|
907
|
-
group: local-development
|
|
908
|
-
description: Lets contributors edit content and exercise forms locally without a live Turnstile widget.
|
|
909
|
-
howToGet: Treeseed defaults this to true for local development. You can switch it off if you want to test with real Turnstile keys locally.
|
|
910
|
-
sensitivity: plain
|
|
911
|
-
targets:
|
|
912
|
-
- local-runtime
|
|
913
|
-
- local-cloudflare
|
|
914
|
-
scopes:
|
|
915
|
-
- local
|
|
916
|
-
requirement: optional
|
|
917
|
-
purposes:
|
|
918
|
-
- dev
|
|
919
|
-
- config
|
|
920
|
-
validation:
|
|
921
|
-
kind: boolean
|
|
922
|
-
sourcePriority:
|
|
923
|
-
- machine-config
|
|
924
|
-
- process-env
|
|
925
|
-
localDefaultValueRef: localFormsBypassDefault
|
|
926
898
|
TREESEED_SMTP_HOST:
|
|
927
899
|
label: SMTP host
|
|
928
900
|
group: smtp
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { randomBytes } from "node:crypto";
|
|
2
|
+
import { spawnSync } from "node:child_process";
|
|
2
3
|
import { existsSync, readFileSync } from "node:fs";
|
|
3
4
|
import { dirname, resolve } from "node:path";
|
|
4
5
|
import { fileURLToPath } from "node:url";
|
|
@@ -47,6 +48,21 @@ function turnstileEnabled(context) {
|
|
|
47
48
|
function smtpEnabled(context) {
|
|
48
49
|
return context.deployConfig.smtp?.enabled === true;
|
|
49
50
|
}
|
|
51
|
+
function platformSurfaceEnabled(context, surface) {
|
|
52
|
+
return context.deployConfig.surfaces?.[surface]?.enabled !== false;
|
|
53
|
+
}
|
|
54
|
+
function managedServiceEnabled(context, service) {
|
|
55
|
+
return context.deployConfig.services?.[service]?.enabled !== false;
|
|
56
|
+
}
|
|
57
|
+
function webSurfaceEnabled(context) {
|
|
58
|
+
return platformSurfaceEnabled(context, "web");
|
|
59
|
+
}
|
|
60
|
+
function apiSurfaceEnabled(context) {
|
|
61
|
+
return platformSurfaceEnabled(context, "api") && managedServiceEnabled(context, "api");
|
|
62
|
+
}
|
|
63
|
+
function formsEnabled(context) {
|
|
64
|
+
return webSurfaceEnabled(context) && (context.deployConfig.providers?.forms ?? "store_only") !== "none";
|
|
65
|
+
}
|
|
50
66
|
function railwayManagedEnabled(context) {
|
|
51
67
|
if (context.deployConfig.runtime?.mode === "treeseed_managed") {
|
|
52
68
|
return true;
|
|
@@ -183,6 +199,35 @@ function resolveHostedProjectId(context) {
|
|
|
183
199
|
function resolveRailwayWorkspaceDefault() {
|
|
184
200
|
return "knowledge-coop";
|
|
185
201
|
}
|
|
202
|
+
function parseGitHubRepositorySlugFromRemote(remoteUrl) {
|
|
203
|
+
const normalized = String(remoteUrl ?? "").trim();
|
|
204
|
+
const sshMatch = normalized.match(/^git@github\.com:([^/]+)\/(.+?)(?:\.git)?$/u);
|
|
205
|
+
if (sshMatch) {
|
|
206
|
+
return { owner: sshMatch[1], name: sshMatch[2] };
|
|
207
|
+
}
|
|
208
|
+
const httpsMatch = normalized.match(/^https:\/\/github\.com\/([^/]+)\/(.+?)(?:\.git)?$/u);
|
|
209
|
+
if (httpsMatch) {
|
|
210
|
+
return { owner: httpsMatch[1], name: httpsMatch[2] };
|
|
211
|
+
}
|
|
212
|
+
return null;
|
|
213
|
+
}
|
|
214
|
+
function resolveGitHubOriginRepository(context) {
|
|
215
|
+
const result = spawnSync("git", ["remote", "get-url", "origin"], {
|
|
216
|
+
cwd: context.tenantRoot,
|
|
217
|
+
stdio: "pipe",
|
|
218
|
+
encoding: "utf8"
|
|
219
|
+
});
|
|
220
|
+
if (result.status !== 0) {
|
|
221
|
+
return null;
|
|
222
|
+
}
|
|
223
|
+
return parseGitHubRepositorySlugFromRemote(result.stdout);
|
|
224
|
+
}
|
|
225
|
+
function resolveGitHubOwnerDefault(context) {
|
|
226
|
+
return resolveGitHubOriginRepository(context)?.owner;
|
|
227
|
+
}
|
|
228
|
+
function resolveGitHubRepositoryNameDefault(context) {
|
|
229
|
+
return resolveGitHubOriginRepository(context)?.name || context.deployConfig.slug;
|
|
230
|
+
}
|
|
186
231
|
const VALUE_RESOLVERS = {
|
|
187
232
|
generatedSecret: () => generatedSecret(),
|
|
188
233
|
localFormsBypassDefault: () => "true",
|
|
@@ -206,6 +251,9 @@ const VALUE_RESOLVERS = {
|
|
|
206
251
|
hostingTeamIdDefault: (context) => resolveHostedTeamId(context),
|
|
207
252
|
hostingProjectIdDefault: (context) => resolveHostedProjectId(context),
|
|
208
253
|
railwayWorkspaceDefault: () => resolveRailwayWorkspaceDefault(),
|
|
254
|
+
githubOwnerDefault: (context) => resolveGitHubOwnerDefault(context),
|
|
255
|
+
githubRepositoryNameDefault: (context) => resolveGitHubRepositoryNameDefault(context),
|
|
256
|
+
githubRepositoryVisibilityDefault: () => "private",
|
|
209
257
|
agentPoolMinWorkersDefault: () => "0",
|
|
210
258
|
agentPoolMaxWorkersDefault: () => "2",
|
|
211
259
|
agentPoolTargetQueueDepthDefault: () => "1",
|
|
@@ -224,6 +272,9 @@ const PREDICATES = {
|
|
|
224
272
|
turnstileNonLocal: (context, scope) => turnstileEnabled(context) && scope !== "local",
|
|
225
273
|
smtpEnabled: (context) => smtpEnabled(context),
|
|
226
274
|
smtpNonLocal: (context, scope) => smtpEnabled(context) && scope !== "local",
|
|
275
|
+
webSurfaceEnabled: (context) => webSurfaceEnabled(context),
|
|
276
|
+
apiSurfaceEnabled: (context) => apiSurfaceEnabled(context),
|
|
277
|
+
formsEnabled: (context) => formsEnabled(context),
|
|
227
278
|
railwayManagedEnabled: (context) => railwayManagedEnabled(context),
|
|
228
279
|
hubTreeseedHosted: (context) => resolveHubMode(context) === "treeseed_hosted",
|
|
229
280
|
hubCustomerHosted: (context) => resolveHubMode(context) === "customer_hosted",
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { TreeseedDeployConfig } from '../platform/contracts.ts';
|
|
2
|
+
import type { TreeseedDesiredUnit } from './contracts.ts';
|
|
3
|
+
export declare const TREESEED_BOOTSTRAP_SYSTEMS: readonly ["github", "data", "web", "api", "agents"];
|
|
4
|
+
export type TreeseedBootstrapSystem = typeof TREESEED_BOOTSTRAP_SYSTEMS[number] | 'all';
|
|
5
|
+
export type TreeseedRunnableBootstrapSystem = Exclude<TreeseedBootstrapSystem, 'all'>;
|
|
6
|
+
export type TreeseedBootstrapSystemStatus = {
|
|
7
|
+
system: TreeseedRunnableBootstrapSystem;
|
|
8
|
+
status: 'selected' | 'included_dependency' | 'config_disabled' | 'unavailable' | 'skipped';
|
|
9
|
+
reason: string;
|
|
10
|
+
missing: string[];
|
|
11
|
+
};
|
|
12
|
+
export type TreeseedBootstrapSelection = {
|
|
13
|
+
requested: TreeseedBootstrapSystem[];
|
|
14
|
+
explicit: boolean;
|
|
15
|
+
skipUnavailable: boolean;
|
|
16
|
+
selected: TreeseedRunnableBootstrapSystem[];
|
|
17
|
+
expanded: TreeseedRunnableBootstrapSystem[];
|
|
18
|
+
runnable: TreeseedRunnableBootstrapSystem[];
|
|
19
|
+
configDisabled: TreeseedBootstrapSystemStatus[];
|
|
20
|
+
unavailable: TreeseedBootstrapSystemStatus[];
|
|
21
|
+
skipped: TreeseedBootstrapSystemStatus[];
|
|
22
|
+
statuses: TreeseedBootstrapSystemStatus[];
|
|
23
|
+
};
|
|
24
|
+
export declare function parseTreeseedBootstrapSystems(value: unknown): TreeseedBootstrapSystem[];
|
|
25
|
+
export declare function resolveTreeseedBootstrapSelection({ deployConfig, env, systems, skipUnavailable, }: {
|
|
26
|
+
deployConfig: TreeseedDeployConfig;
|
|
27
|
+
env: NodeJS.ProcessEnv | Record<string, string | undefined>;
|
|
28
|
+
systems?: unknown;
|
|
29
|
+
skipUnavailable?: boolean;
|
|
30
|
+
}): TreeseedBootstrapSelection;
|
|
31
|
+
export declare function bootstrapSystemForUnit(unit: TreeseedDesiredUnit): TreeseedRunnableBootstrapSystem;
|
|
32
|
+
export declare function filterTreeseedDesiredUnitsByBootstrapSystems(units: TreeseedDesiredUnit[], systems?: TreeseedRunnableBootstrapSystem[]): TreeseedDesiredUnit[];
|