@wildo-ai/wildo-cli 1.1.3 → 1.1.4

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 (141) hide show
  1. package/dist/src/commands/context/__tests__/assurance-basis.command.test.d.ts +2 -0
  2. package/dist/src/commands/context/__tests__/assurance-basis.command.test.d.ts.map +1 -0
  3. package/dist/src/commands/context/__tests__/assurance-basis.command.test.js +63 -0
  4. package/dist/src/commands/context/__tests__/assurance-basis.command.test.js.map +1 -0
  5. package/dist/src/commands/context/assurance-basis.command.d.ts +61 -0
  6. package/dist/src/commands/context/assurance-basis.command.d.ts.map +1 -0
  7. package/dist/src/commands/context/assurance-basis.command.js +166 -0
  8. package/dist/src/commands/context/assurance-basis.command.js.map +1 -0
  9. package/dist/src/commands/dev/charts-audit.command.d.ts +5 -3
  10. package/dist/src/commands/dev/charts-audit.command.d.ts.map +1 -1
  11. package/dist/src/commands/dev/charts-audit.command.js +35 -6
  12. package/dist/src/commands/dev/charts-audit.command.js.map +1 -1
  13. package/dist/src/commands/fwk/generate-providers.command.d.ts.map +1 -1
  14. package/dist/src/commands/fwk/generate-providers.command.js +18 -2
  15. package/dist/src/commands/fwk/generate-providers.command.js.map +1 -1
  16. package/dist/src/commands/generate/email-preview.command.d.ts +8 -0
  17. package/dist/src/commands/generate/email-preview.command.d.ts.map +1 -1
  18. package/dist/src/commands/generate/email-preview.command.js +57 -0
  19. package/dist/src/commands/generate/email-preview.command.js.map +1 -1
  20. package/dist/src/commands/init.command.d.ts.map +1 -1
  21. package/dist/src/commands/init.command.js +32 -0
  22. package/dist/src/commands/init.command.js.map +1 -1
  23. package/dist/src/commands/lock/check.command.d.ts.map +1 -1
  24. package/dist/src/commands/lock/check.command.js +3 -2
  25. package/dist/src/commands/lock/check.command.js.map +1 -1
  26. package/dist/src/commands/registry/login.command.d.ts.map +1 -1
  27. package/dist/src/commands/registry/login.command.js +2 -0
  28. package/dist/src/commands/registry/login.command.js.map +1 -1
  29. package/dist/src/commands/registry/publish.command.d.ts.map +1 -1
  30. package/dist/src/commands/registry/publish.command.js +2 -0
  31. package/dist/src/commands/registry/publish.command.js.map +1 -1
  32. package/dist/src/commands/registry/registry-transport.constants.d.ts +33 -0
  33. package/dist/src/commands/registry/registry-transport.constants.d.ts.map +1 -0
  34. package/dist/src/commands/registry/registry-transport.constants.js +33 -0
  35. package/dist/src/commands/registry/registry-transport.constants.js.map +1 -0
  36. package/dist/src/commands/registry/whoami.command.d.ts.map +1 -1
  37. package/dist/src/commands/registry/whoami.command.js +2 -0
  38. package/dist/src/commands/registry/whoami.command.js.map +1 -1
  39. package/dist/src/modules/domain/credentials/__tests__/approver-user.module.test.d.ts +2 -0
  40. package/dist/src/modules/domain/credentials/__tests__/approver-user.module.test.d.ts.map +1 -0
  41. package/dist/src/modules/domain/credentials/__tests__/approver-user.module.test.js +146 -0
  42. package/dist/src/modules/domain/credentials/__tests__/approver-user.module.test.js.map +1 -0
  43. package/dist/src/modules/domain/credentials/approver-user.module.d.ts +85 -0
  44. package/dist/src/modules/domain/credentials/approver-user.module.d.ts.map +1 -0
  45. package/dist/src/modules/domain/credentials/approver-user.module.js +92 -0
  46. package/dist/src/modules/domain/credentials/approver-user.module.js.map +1 -0
  47. package/dist/src/services/application/__tests__/app-bootstrap.approving-administrator.test.d.ts +2 -0
  48. package/dist/src/services/application/__tests__/app-bootstrap.approving-administrator.test.d.ts.map +1 -0
  49. package/dist/src/services/application/__tests__/app-bootstrap.approving-administrator.test.js +111 -0
  50. package/dist/src/services/application/__tests__/app-bootstrap.approving-administrator.test.js.map +1 -0
  51. package/dist/src/services/application/__tests__/provider-package-links.service.test.js +68 -0
  52. package/dist/src/services/application/__tests__/provider-package-links.service.test.js.map +1 -1
  53. package/dist/src/services/application/app-bootstrap.service.d.ts +9 -0
  54. package/dist/src/services/application/app-bootstrap.service.d.ts.map +1 -1
  55. package/dist/src/services/application/app-bootstrap.service.js +30 -1
  56. package/dist/src/services/application/app-bootstrap.service.js.map +1 -1
  57. package/dist/src/services/application/application-runtime-bootstrap.service.d.ts +6 -0
  58. package/dist/src/services/application/application-runtime-bootstrap.service.d.ts.map +1 -1
  59. package/dist/src/services/application/application-runtime-bootstrap.service.js +41 -0
  60. package/dist/src/services/application/application-runtime-bootstrap.service.js.map +1 -1
  61. package/dist/src/services/application/provider-package-links.service.d.ts +30 -0
  62. package/dist/src/services/application/provider-package-links.service.d.ts.map +1 -1
  63. package/dist/src/services/application/provider-package-links.service.js +35 -3
  64. package/dist/src/services/application/provider-package-links.service.js.map +1 -1
  65. package/dist/src/services/application/provider-runtime-sync.service.d.ts.map +1 -1
  66. package/dist/src/services/application/provider-runtime-sync.service.js +4 -3
  67. package/dist/src/services/application/provider-runtime-sync.service.js.map +1 -1
  68. package/dist/src/services/application/saas-skeleton.service.d.ts.map +1 -1
  69. package/dist/src/services/application/saas-skeleton.service.js +22 -2
  70. package/dist/src/services/application/saas-skeleton.service.js.map +1 -1
  71. package/dist/src/services/companion/workbench-cli.service.js +10 -1
  72. package/dist/src/services/companion/workbench-cli.service.js.map +1 -1
  73. package/dist/src/services/credentials/__tests__/provider-contribution-registration.guard.test.d.ts +2 -0
  74. package/dist/src/services/credentials/__tests__/provider-contribution-registration.guard.test.d.ts.map +1 -0
  75. package/dist/src/services/credentials/__tests__/provider-contribution-registration.guard.test.js +94 -0
  76. package/dist/src/services/credentials/__tests__/provider-contribution-registration.guard.test.js.map +1 -0
  77. package/dist/src/services/credentials/ci-secrets-adapter.service.d.ts.map +1 -1
  78. package/dist/src/services/credentials/ci-secrets-adapter.service.js +16 -0
  79. package/dist/src/services/credentials/ci-secrets-adapter.service.js.map +1 -1
  80. package/dist/src/services/credentials/composed-provider-catalogue.d.ts +34 -0
  81. package/dist/src/services/credentials/composed-provider-catalogue.d.ts.map +1 -1
  82. package/dist/src/services/credentials/composed-provider-catalogue.js +35 -0
  83. package/dist/src/services/credentials/composed-provider-catalogue.js.map +1 -1
  84. package/dist/src/services/credentials/credentials.schemas.d.ts +27 -0
  85. package/dist/src/services/credentials/credentials.schemas.d.ts.map +1 -1
  86. package/dist/src/services/credentials/credentials.schemas.js +50 -0
  87. package/dist/src/services/credentials/credentials.schemas.js.map +1 -1
  88. package/dist/src/services/credentials/framework-managed-secrets.d.ts +1 -1
  89. package/dist/src/services/credentials/framework-managed-secrets.d.ts.map +1 -1
  90. package/dist/src/services/credentials/framework-managed-secrets.js +49 -8
  91. package/dist/src/services/credentials/framework-managed-secrets.js.map +1 -1
  92. package/dist/src/services/deployment/infra-writer.service.d.ts.map +1 -1
  93. package/dist/src/services/deployment/infra-writer.service.js +23 -4
  94. package/dist/src/services/deployment/infra-writer.service.js.map +1 -1
  95. package/dist/src/services/deployment/k8s/__tests__/k8s-bootstrap.service.test.js +45 -2
  96. package/dist/src/services/deployment/k8s/__tests__/k8s-bootstrap.service.test.js.map +1 -1
  97. package/dist/src/services/deployment/k8s/k8s-bootstrap.service.d.ts +23 -0
  98. package/dist/src/services/deployment/k8s/k8s-bootstrap.service.d.ts.map +1 -1
  99. package/dist/src/services/deployment/k8s/k8s-bootstrap.service.js +49 -6
  100. package/dist/src/services/deployment/k8s/k8s-bootstrap.service.js.map +1 -1
  101. package/dist/src/services/environment/env-vars-builder.service.d.ts.map +1 -1
  102. package/dist/src/services/environment/env-vars-builder.service.js +19 -0
  103. package/dist/src/services/environment/env-vars-builder.service.js.map +1 -1
  104. package/dist/src/services/framework/__tests__/engine-provider-specifications.reconciliation.test.js +8 -0
  105. package/dist/src/services/framework/__tests__/engine-provider-specifications.reconciliation.test.js.map +1 -1
  106. package/dist/src/services/framework/__tests__/framework-knowledge-audit.live.contract.test.js +17 -0
  107. package/dist/src/services/framework/__tests__/framework-knowledge-audit.live.contract.test.js.map +1 -1
  108. package/dist/src/services/framework/__tests__/framework-knowledge-audit.service.test.js +51 -0
  109. package/dist/src/services/framework/__tests__/framework-knowledge-audit.service.test.js.map +1 -1
  110. package/dist/src/services/framework/framework-knowledge-audit.service.d.ts +41 -1
  111. package/dist/src/services/framework/framework-knowledge-audit.service.d.ts.map +1 -1
  112. package/dist/src/services/framework/framework-knowledge-audit.service.js +90 -0
  113. package/dist/src/services/framework/framework-knowledge-audit.service.js.map +1 -1
  114. package/dist/src/services/framework/provider-transposition/__tests__/base-url-is-a-declared-env-slot.test.d.ts +2 -0
  115. package/dist/src/services/framework/provider-transposition/__tests__/base-url-is-a-declared-env-slot.test.d.ts.map +1 -0
  116. package/dist/src/services/framework/provider-transposition/__tests__/base-url-is-a-declared-env-slot.test.js +100 -0
  117. package/dist/src/services/framework/provider-transposition/__tests__/base-url-is-a-declared-env-slot.test.js.map +1 -0
  118. package/dist/src/services/framework/provider-transposition/__tests__/plan-matches-emit.test.js +55 -2
  119. package/dist/src/services/framework/provider-transposition/__tests__/plan-matches-emit.test.js.map +1 -1
  120. package/dist/src/services/framework/provider-transposition/provider-package.emitter.d.ts +9 -0
  121. package/dist/src/services/framework/provider-transposition/provider-package.emitter.d.ts.map +1 -1
  122. package/dist/src/services/framework/provider-transposition/provider-package.emitter.js +139 -19
  123. package/dist/src/services/framework/provider-transposition/provider-package.emitter.js.map +1 -1
  124. package/dist/src/services/frontend/cloudflare-cdn.service.d.ts.map +1 -1
  125. package/dist/src/services/frontend/cloudflare-cdn.service.js +33 -2
  126. package/dist/src/services/frontend/cloudflare-cdn.service.js.map +1 -1
  127. package/dist/tsconfig.build.tsbuildinfo +1 -1
  128. package/dist/tsconfig.tsbuildinfo +1 -1
  129. package/package.json +17 -17
  130. package/scripts/app-dependency-alignment/propagated-engine-overrides.json +13 -0
  131. package/templates/infra/docker-compose/docker-compose.wildo-platform.yml.hbs +64 -16
  132. package/templates/saas/engine-peer-closure.json +12 -0
  133. package/templates/saas/scenarios/add-provider/scenario.json +11 -11
  134. package/templates/saas/scenarios/add-technical-doc/files/technical-doc/docusaurus.config.ts.hbs +34 -0
  135. package/templates/saas/scenarios/add-technical-doc/files/technical-doc/src/pages/auth/exchange.tsx +24 -1
  136. package/templates/saas/scenarios/add-technical-doc/files/technical-doc/src/theme/Root.tsx +22 -2
  137. package/templates/saas/skeleton/backend-api/package.json.hbs +1 -1
  138. package/templates/saas/skeleton/backend-api/src/companion-exports.ts +13 -2
  139. package/wildo-framework.info.json +1 -1
  140. package/templates/saas/scenarios/add-backend-provider/scenario.json +0 -17
  141. package/templates/saas/skeleton/backend-api/src/provider-contributions.ts +0 -44
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wildo-ai/wildo-cli",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "description": "Wildo.ai CLI — context-aware developer toolkit",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "author": "Wildo AI",
@@ -61,22 +61,22 @@
61
61
  "@radix-ui/react-use-controllable-state": "^1.2.2",
62
62
  "@react-aria/virtualizer": "4.1.9",
63
63
  "@tanstack/react-table": "^8.21.3",
64
- "@wildo-ai/application-creation-runtime": "1.1.3",
65
- "@wildo-ai/external-connectors-models": "1.1.3",
66
- "@wildo-ai/external-connectors-private": "1.1.3",
67
- "@wildo-ai/framework-knowledge": "1.1.3",
68
- "@wildo-ai/platform-config-lib": "1.1.3",
69
- "@wildo-ai/platform-core-backend": "1.1.3",
70
- "@wildo-ai/platform-core-shared": "1.1.3",
71
- "@wildo-ai/platform-infra-providers": "1.1.3",
72
- "@wildo-ai/platform-shared-lib": "1.1.3",
73
- "@wildo-ai/presets-components-models": "1.1.3",
74
- "@wildo-ai/saas-backend-lib": "1.1.3",
75
- "@wildo-ai/saas-models": "1.1.3",
76
- "@wildo-ai/saas-specifications": "1.1.3",
77
- "@wildo-ai/saas-website": "1.1.3",
78
- "@wildo-ai/wildo-module-client": "1.1.3",
79
- "@wildo-ai/zod-decorators": "1.1.3",
64
+ "@wildo-ai/application-creation-runtime": "1.1.4",
65
+ "@wildo-ai/external-connectors-models": "1.1.4",
66
+ "@wildo-ai/external-connectors-private": "1.1.4",
67
+ "@wildo-ai/framework-knowledge": "1.1.4",
68
+ "@wildo-ai/platform-config-lib": "1.1.4",
69
+ "@wildo-ai/platform-core-backend": "1.1.4",
70
+ "@wildo-ai/platform-core-shared": "1.1.4",
71
+ "@wildo-ai/platform-infra-providers": "1.1.4",
72
+ "@wildo-ai/platform-shared-lib": "1.1.4",
73
+ "@wildo-ai/presets-components-models": "1.1.4",
74
+ "@wildo-ai/saas-backend-lib": "1.1.4",
75
+ "@wildo-ai/saas-models": "1.1.4",
76
+ "@wildo-ai/saas-specifications": "1.1.4",
77
+ "@wildo-ai/saas-website": "1.1.4",
78
+ "@wildo-ai/wildo-module-client": "1.1.4",
79
+ "@wildo-ai/zod-decorators": "1.1.4",
80
80
  "@xyflow/react": "^12.9.3",
81
81
  "ai": "7.0.29",
82
82
  "amqplib": "^0.10.9",
@@ -14,6 +14,7 @@
14
14
  "@wildo-ai/platform-shared-lib",
15
15
  "@wildo-ai/presets-components",
16
16
  "@wildo-ai/presets-components-models",
17
+ "@wildo-ai/providers",
17
18
  "@wildo-ai/saas-backend-lib",
18
19
  "@wildo-ai/saas-frontend-lib",
19
20
  "@wildo-ai/saas-minions-lib",
@@ -473,6 +474,18 @@
473
474
  "react",
474
475
  "zod"
475
476
  ],
477
+ "@wildo-ai/providers": [
478
+ "async-mutex",
479
+ "big.js",
480
+ "bottleneck",
481
+ "inversify",
482
+ "jsonwebtoken",
483
+ "react",
484
+ "reflect-metadata",
485
+ "safe-stable-stringify",
486
+ "yaml",
487
+ "zod"
488
+ ],
476
489
  "@wildo-ai/saas-backend-lib": [
477
490
  "async-mutex",
478
491
  "big.js",
@@ -752,11 +752,27 @@ services:
752
752
  PLATFORM_CRONTABS_BATCHES_MANAGER_PUBLIC_KEY: ${PLATFORM_CRONTABS_BATCHES_MANAGER_PUBLIC_KEY}
753
753
  PLATFORM_APPLICATION_PRIMARY_SECRET: ${PLATFORM_APPLICATION_PRIMARY_SECRET}
754
754
  PLATFORM_ADMIN_SECRET: ${PLATFORM_ADMIN_SECRET}
755
- PG_HOST: ${PG_HOST}
756
- PG_PORT: ${PG_PORT}
757
- PG_ADMIN_USER: ${PG_ADMIN_USER}
758
- PG_ADMIN_PASSWORD: ${PG_ADMIN_PASSWORD}
759
- PG_ADMIN_DATABASE: ${PG_ADMIN_DATABASE}
755
+ # `:-` on EVERY PostgreSQL key, not just some.
756
+ #
757
+ # A Mongo-engined application legitimately writes no `PG_*` into
758
+ # `.env.wildo-platform`, and compose warns once per bare `${VAR}` per service. Measured on a
759
+ # Mongo-only app: 16 warnings on every single `local up`, `config sync` and `local down` —
760
+ # 5 keys × 3 services, plus `PG_SSL_MODE` which was guarded at 2 of its 3 sites.
761
+ #
762
+ # `${VAR}` and `${VAR:-}` produce the IDENTICAL empty string when unset; only the warning
763
+ # differs. Proven rather than assumed: `docker compose config` before and after the change is
764
+ # BYTE-IDENTICAL, and the warning count goes 16 → 0.
765
+ #
766
+ # This is not cosmetics. Sixteen lines of expected-but-unexplained warning on every command
767
+ # is what teaches an operator to skim past compose warnings — including the one that matters.
768
+ # `PG_CONNECT_URL` and `DATABASE_DEFAULT_ADAPTER` below already carried the guard with a
769
+ # comment saying exactly why; it simply was not applied to their siblings. Enforced now by
770
+ # `check:platform-compose-contract` rule 4, so it cannot drift back one site at a time.
771
+ PG_HOST: ${PG_HOST:-}
772
+ PG_PORT: ${PG_PORT:-}
773
+ PG_ADMIN_USER: ${PG_ADMIN_USER:-}
774
+ PG_ADMIN_PASSWORD: ${PG_ADMIN_PASSWORD:-}
775
+ PG_ADMIN_DATABASE: ${PG_ADMIN_DATABASE:-}
760
776
  # `:-` — sibling-key omission fix (5.3 review round 3, F5): the NORMAL block carried this
761
777
  # while INIT did not, so INIT's admin connection defaulted to sslmode=require against the
762
778
  # SSL-less local container and logged a false "PostgreSQL admin connection failed" lead.
@@ -868,12 +884,28 @@ services:
868
884
  PLATFORM_CRONTABS_BATCHES_MANAGER_PUBLIC_KEY: ${PLATFORM_CRONTABS_BATCHES_MANAGER_PUBLIC_KEY}
869
885
  PLATFORM_APPLICATION_PRIMARY_SECRET: ${PLATFORM_APPLICATION_PRIMARY_SECRET}
870
886
  PLATFORM_ADMIN_SECRET: ${PLATFORM_ADMIN_SECRET}
871
- PG_HOST: ${PG_HOST}
872
- PG_PORT: ${PG_PORT}
873
- PG_ADMIN_USER: ${PG_ADMIN_USER}
874
- PG_ADMIN_PASSWORD: ${PG_ADMIN_PASSWORD}
875
- PG_ADMIN_DATABASE: ${PG_ADMIN_DATABASE}
876
- PG_SSL_MODE: ${PG_SSL_MODE}
887
+ # `:-` on EVERY PostgreSQL key, not just some.
888
+ #
889
+ # A Mongo-engined application legitimately writes no `PG_*` into
890
+ # `.env.wildo-platform`, and compose warns once per bare `${VAR}` per service. Measured on a
891
+ # Mongo-only app: 16 warnings on every single `local up`, `config sync` and `local down` —
892
+ # 5 keys × 3 services, plus `PG_SSL_MODE` which was guarded at 2 of its 3 sites.
893
+ #
894
+ # `${VAR}` and `${VAR:-}` produce the IDENTICAL empty string when unset; only the warning
895
+ # differs. Proven rather than assumed: `docker compose config` before and after the change is
896
+ # BYTE-IDENTICAL, and the warning count goes 16 → 0.
897
+ #
898
+ # This is not cosmetics. Sixteen lines of expected-but-unexplained warning on every command
899
+ # is what teaches an operator to skim past compose warnings — including the one that matters.
900
+ # `PG_CONNECT_URL` and `DATABASE_DEFAULT_ADAPTER` below already carried the guard with a
901
+ # comment saying exactly why; it simply was not applied to their siblings. Enforced now by
902
+ # `check:platform-compose-contract` rule 4, so it cannot drift back one site at a time.
903
+ PG_HOST: ${PG_HOST:-}
904
+ PG_PORT: ${PG_PORT:-}
905
+ PG_ADMIN_USER: ${PG_ADMIN_USER:-}
906
+ PG_ADMIN_PASSWORD: ${PG_ADMIN_PASSWORD:-}
907
+ PG_ADMIN_DATABASE: ${PG_ADMIN_DATABASE:-}
908
+ PG_SSL_MODE: ${PG_SSL_MODE:-}
877
909
  # The platform's OWN PostgreSQL (D7/5.3) — see the platform-init block's note: this
878
910
  # environment block is an interpolation allow-list, and an unlisted key never reaches
879
911
  # the container. `:-` because Mongo-engined env files omit both keys; the runtime env
@@ -1025,11 +1057,27 @@ services:
1025
1057
  MONGO_CONNECT_URL: ${MONGO_CONNECT_URL:-}
1026
1058
  MONGO_PLATFORM_URL: ${MONGO_CONNECT_URL:-}
1027
1059
  BASE_MONGO_SERVER_URL: ${BASE_MONGO_SERVER_URL}
1028
- PG_HOST: ${PG_HOST}
1029
- PG_PORT: ${PG_PORT}
1030
- PG_ADMIN_USER: ${PG_ADMIN_USER}
1031
- PG_ADMIN_PASSWORD: ${PG_ADMIN_PASSWORD}
1032
- PG_ADMIN_DATABASE: ${PG_ADMIN_DATABASE}
1060
+ # `:-` on EVERY PostgreSQL key, not just some.
1061
+ #
1062
+ # A Mongo-engined application legitimately writes no `PG_*` into
1063
+ # `.env.wildo-platform`, and compose warns once per bare `${VAR}` per service. Measured on a
1064
+ # Mongo-only app: 16 warnings on every single `local up`, `config sync` and `local down` —
1065
+ # 5 keys × 3 services, plus `PG_SSL_MODE` which was guarded at 2 of its 3 sites.
1066
+ #
1067
+ # `${VAR}` and `${VAR:-}` produce the IDENTICAL empty string when unset; only the warning
1068
+ # differs. Proven rather than assumed: `docker compose config` before and after the change is
1069
+ # BYTE-IDENTICAL, and the warning count goes 16 → 0.
1070
+ #
1071
+ # This is not cosmetics. Sixteen lines of expected-but-unexplained warning on every command
1072
+ # is what teaches an operator to skim past compose warnings — including the one that matters.
1073
+ # `PG_CONNECT_URL` and `DATABASE_DEFAULT_ADAPTER` below already carried the guard with a
1074
+ # comment saying exactly why; it simply was not applied to their siblings. Enforced now by
1075
+ # `check:platform-compose-contract` rule 4, so it cannot drift back one site at a time.
1076
+ PG_HOST: ${PG_HOST:-}
1077
+ PG_PORT: ${PG_PORT:-}
1078
+ PG_ADMIN_USER: ${PG_ADMIN_USER:-}
1079
+ PG_ADMIN_PASSWORD: ${PG_ADMIN_PASSWORD:-}
1080
+ PG_ADMIN_DATABASE: ${PG_ADMIN_DATABASE:-}
1033
1081
  PG_SSL_MODE: ${PG_SSL_MODE:-}
1034
1082
  PG_CONNECT_URL: ${PG_CONNECT_URL:-}
1035
1083
  DATABASE_DEFAULT_ADAPTER: ${DATABASE_DEFAULT_ADAPTER:-}
@@ -267,6 +267,18 @@
267
267
  "react",
268
268
  "zod"
269
269
  ],
270
+ "@wildo-ai/providers": [
271
+ "async-mutex",
272
+ "big.js",
273
+ "bottleneck",
274
+ "inversify",
275
+ "jsonwebtoken",
276
+ "react",
277
+ "reflect-metadata",
278
+ "safe-stable-stringify",
279
+ "yaml",
280
+ "zod"
281
+ ],
270
282
  "@wildo-ai/saas-backend-lib": [
271
283
  "async-mutex",
272
284
  "big.js",
@@ -1,36 +1,36 @@
1
1
  {
2
2
  "ref": "add-provider",
3
- "version": 1,
4
- "title": "Declare a packaged provider (@wildo-ai/provider-<ref>) in this application",
5
- "description": "Edit-only scenario, one step for the three declarations a packaged provider needs: the package DEPENDENCY on the backend service (which is what the `file:`/version override, the lazy engine-peer closure and pnpm itself all read), the backend provider SCOPE in wildo.saas.config.ts, and optionally the companion scope. `wildo compose` reconciles the root pnpm.overrides from the dependency afterwards, so the application resolves the provider without a hand-written override. Distinct from add-backend-provider, which projects a provider the ENGINE already ships: this one brings a provider the engine does not carry.",
3
+ "version": 2,
4
+ "title": "Declare a catalogue provider (@wildo-ai/providers/<ref>) in this application",
5
+ "description": "Edit-only scenario for the two declarations a catalogue provider needs: the DEPENDENCY on @wildo-ai/providers from the backend service (once — the catalogue is ONE package with a subpath per vendor, so a second provider adds no second dependency), and the provider SCOPE in wildo.saas.config.ts. `wildo compose` reconciles the root pnpm.overrides entry from that dependency afterwards, resolving it to a file: link in a framework checkout and to the application's framework release otherwise, so no override is hand-written. Version 2, because version 1 wrote a dependency on `@wildo-ai/provider-<ref>` — one package per vendor, the shape reversed on 2026-09-06 — and no such package has ever existed: the declaration it wrote could not install.",
6
6
  "variables": [
7
- { "name": "providerRef", "description": "Provider ref, matching its package name @wildo-ai/provider-<ref> (e.g. slack, microsoft-graph-mail)", "kind": "string", "required": true, "pattern": "[a-z][a-z0-9-]*" },
8
- { "name": "reachesCompanion", "description": "true when the dev companion should also reach this provider (LLM and observability providers typically do)", "kind": "boolean", "required": false, "default": "false" },
7
+ { "name": "providerRef", "description": "Catalogue vendor ref, matching its subpath @wildo-ai/providers/<ref> (e.g. slack, hubspot, google-calendar)", "kind": "string", "required": true, "pattern": "[a-z][a-z0-9-]*" },
8
+ { "name": "reachesCompanion", "description": "true when the dev companion should also reach this provider", "kind": "boolean", "required": false, "default": "false" },
9
9
  { "name": "backendServicePath", "description": "App-root-relative path of the backend service package that imports the provider", "kind": "string", "required": false, "default": "backend-api" }
10
10
  ],
11
11
  "edits": [
12
12
  {
13
13
  "kind": "package-dependency-add",
14
14
  "file": "{{backendServicePath}}/package.json",
15
- "entries": { "@wildo-ai/provider-{{providerRef}}": "*" }
15
+ "entries": { "@wildo-ai/providers": "*" }
16
16
  },
17
17
  {
18
18
  "kind": "config-property-add",
19
19
  "file": "wildo.saas.config.ts",
20
20
  "configPath": ["providers", "scopes", "backend", "providers", "{{providerRef}}"],
21
- "valueText": "{\n engineCapabilities: [],\n providerCapabilities: [],\n protocols: [],\n }"
21
+ "valueText": "{\n engineCapabilities: [],\n providerCapabilities: [],\n protocols: ['REST_API'],\n }"
22
22
  },
23
23
  {
24
24
  "kind": "config-property-add",
25
25
  "file": "wildo.saas.config.ts",
26
26
  "configPath": ["providers", "scopes", "companion", "providers", "{{providerRef}}"],
27
- "valueText": "{\n engineCapabilities: [],\n providerCapabilities: [],\n protocols: [],\n }",
27
+ "valueText": "{\n engineCapabilities: [],\n providerCapabilities: [],\n protocols: ['REST_API'],\n }",
28
28
  "onlyWhenVariableEquals": { "variable": "reachesCompanion", "value": "true" }
29
29
  }
30
30
  ],
31
31
  "postNotes": [
32
- "The scope was written with EMPTY capability and protocol lists — a declaration the runtime sync will reject until you fill them in. That is deliberate: the honest values come from the provider package's own ./companion export (its metadata, providerCapabilities and protocols), and a scenario that guessed them would author a claim the package never made.",
33
- "Author the provider's credentials: `wildo setup` (or secrets.json `providerEnv`), using the env-var names the package's secrets contract declares. Then run `wildo config sync` so the provider-runtime artifact and the .env files pick them up.",
34
- "Run `pnpm install` — the root pnpm.overrides entry that resolves @wildo-ai/provider-{{providerRef}} was written by this command, from the dependency above."
32
+ "The scope was written COMPLETE and the runtime sync accepts it as-is — unlike version 1, which wrote empty lists a human had to fill in. That is not a guess: every vendor the transposer emits carries exactly one REST_API protocol and no providerCapabilities, by construction, and it was measured across all of them on 2026-09-09 (682 of 682). A catalogue provider is addressed by REF through an httpApiBinding, never selected by capability, so an engineCapability here would enter a selection mechanism nothing consults.",
33
+ "Author the vendor's credential using the env-var names its secrets contract declares — `wildo setup`, or secrets.json `providerEnv`. A provider declared with no credential still loads and composes at boot; the credential is resolved per CALL, so declaring an integration before configuring it is a supported state.",
34
+ "Run `wildo config sync` so the provider-runtime artifact, the generated per-host module and the .env files pick it up, then `pnpm install` for the root pnpm.overrides entry this command reconciled."
35
35
  ]
36
36
  }
@@ -15,6 +15,31 @@ import type * as Preset from '@docusaurus/preset-classic';
15
15
  * `webpack-dev-server` is a devDependency for exactly this reason.
16
16
  */
17
17
  import type {} from 'webpack-dev-server';
18
+
19
+ /**
20
+ * Load this service's own `.env` before anything reads `process.env`.
21
+ *
22
+ * `wildo config sync` WRITES `technical-doc/.env` — `WILDO_DOCS_API_BASE_URL` among others — and
23
+ * Docusaurus, unlike Vite, does not load a `.env` for you. So without this line every
24
+ * `process.env.WILDO_*` below is `undefined` at config-evaluation time, `customFields` receives the
25
+ * empty fallback, and the Root swizzle correctly concludes there is no application API and skips the
26
+ * session provider. Nothing failed: an unrecognised reader is a valid state for a docs site, so the
27
+ * portal looked exactly like a deliberate standalone deployment.
28
+ *
29
+ * Measured 2026-09-09 against a running portal: `/auth/exchange` mounted and threw
30
+ * `useDocsAuthSession must be used within <DocsAuthProvider>` — the provider had been skipped for
31
+ * seven hours on a stack whose `.env` carried the right value the whole time.
32
+ *
33
+ * `process.loadEnvFile` is built into Node (>= 20.12) so this adds no dependency, and it is
34
+ * NON-FATAL: a portal built without a synced `.env` — a docs site published on its own — must still
35
+ * build, and simply recognises nobody.
36
+ */
37
+ try {
38
+ process.loadEnvFile(join(dirname(fileURLToPath(import.meta.url)), '.env'));
39
+ } catch {
40
+ // No `.env` beside this config. A standalone docs site is a real deployment; carry on unconfigured.
41
+ }
42
+
18
43
  import {
19
44
  META_CSP_HEAD_TAG,
20
45
  NGINX_CSP_HEADER_NAME,
@@ -122,6 +147,15 @@ const config: Config = {
122
147
  */
123
148
  customFields: {
124
149
  wildoDocsApiBaseUrl: process.env.WILDO_DOCS_API_BASE_URL ?? '',
150
+ /*
151
+ * The SECOND value the session needs, and omitting it fails in a way nothing local reports.
152
+ * `POST /auth/token/exchange` resolves the calling frontend's public URL from the
153
+ * `X-Frontend-Service-Name` header and refuses without it — measured 2026-09-09 against a live
154
+ * stack as `403 frontend_service_header_required`, AFTER the provider had mounted and the code had
155
+ * been minted. `DocsAuthClient` already sends the header whenever it has a name, and config sync
156
+ * already writes this variable beside the API origin; the mount simply never carried it across.
157
+ */
158
+ wildoDocsFrontendServiceName: process.env.WILDO_DOCS_FRONTEND_SERVICE_NAME ?? '',
125
159
  },
126
160
 
127
161
  organizationName: '{{slug}}',
@@ -1,6 +1,7 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import Head from '@docusaurus/Head';
3
3
  import { useHistory } from '@docusaurus/router';
4
+ import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
4
5
  import Layout from '@theme/Layout';
5
6
  import { AuthExchangePage } from '@wildo-ai/saas-technical-doc/runtime';
6
7
 
@@ -30,6 +31,15 @@ import { AuthExchangePage } from '@wildo-ai/saas-technical-doc/runtime';
30
31
  * anonymous, having spent their code, with nothing reporting a failure. Docusaurus is an SPA, so the
31
32
  * push has to go through its own router.
32
33
  *
34
+ * ## It must DEGRADE where the provider is absent, not crash
35
+ *
36
+ * `theme/Root.tsx` skips `DocsAuthProvider` when no application API origin is configured — a docs
37
+ * site published on its own is a real deployment and must render. This route is the one page that
38
+ * cannot work in that state: `AuthExchangePage` calls `useDocsAuthSession`, which THROWS outside the
39
+ * provider, so rendering it unconditionally replaced the page with Docusaurus's "This page crashed".
40
+ * Measured on a live portal 2026-09-09. A crash is worse than the 404 this page replaced, so the same
41
+ * condition Root branches on is checked here and the reader is told plainly instead.
42
+ *
33
43
  * ## Not indexed
34
44
  *
35
45
  * This URL is only ever meaningful with a live single-use `?code=`. Without one it renders an error
@@ -38,6 +48,12 @@ import { AuthExchangePage } from '@wildo-ai/saas-technical-doc/runtime';
38
48
  */
39
49
  export default function AuthExchangeRoute(): ReactNode {
40
50
  const history = useHistory();
51
+ const apiBaseUrl = useDocusaurusContext().siteConfig.customFields?.wildoDocsApiBaseUrl;
52
+
53
+ // The SAME condition `theme/Root.tsx` mounts the provider on. Read here rather than inferred from a
54
+ // caught error, because the two must agree: a page that guessed differently would either crash or
55
+ // hide a working hand-off.
56
+ const sessionIsAvailable = typeof apiBaseUrl === 'string' && apiBaseUrl.length > 0;
41
57
 
42
58
  return (
43
59
  <Layout title="Signing you in" description="Completing a documentation sign-in hand-off.">
@@ -45,7 +61,14 @@ export default function AuthExchangeRoute(): ReactNode {
45
61
  <meta name="robots" content="noindex, nofollow" />
46
62
  </Head>
47
63
  <main>
48
- <AuthExchangePage onSuccessNavigate={(returnPath) => history.push(returnPath)} />
64
+ {sessionIsAvailable ? (
65
+ <AuthExchangePage onSuccessNavigate={(returnPath) => history.push(returnPath)} />
66
+ ) : (
67
+ <p style={{ margin: '4rem auto', maxWidth: '32rem', textAlign: 'center' }}>
68
+ This documentation site is not connected to an application, so there is no sign-in to
69
+ complete. Every page here is public and needs no account.
70
+ </p>
71
+ )}
49
72
  </main>
50
73
  </Layout>
51
74
  );
@@ -24,9 +24,29 @@ import { DocsAuthProvider } from '@wildo-ai/saas-technical-doc/runtime';
24
24
  * recognises nobody.
25
25
  */
26
26
  export default function Root({ children }: { children: ReactNode }): ReactNode {
27
- const apiBaseUrl = useDocusaurusContext().siteConfig.customFields?.wildoDocsApiBaseUrl;
27
+ const { customFields } = useDocusaurusContext().siteConfig;
28
+ const apiBaseUrl = customFields?.wildoDocsApiBaseUrl;
29
+ const frontendServiceName = customFields?.wildoDocsFrontendServiceName;
28
30
 
29
31
  if (typeof apiBaseUrl !== 'string' || apiBaseUrl.length === 0) return children;
30
32
 
31
- return <DocsAuthProvider apiBaseUrl={apiBaseUrl}>{children}</DocsAuthProvider>;
33
+ return (
34
+ <DocsAuthProvider
35
+ apiBaseUrl={apiBaseUrl}
36
+ /*
37
+ * REQUIRED for the hand-off, even though the prop is optional. `POST /auth/token/exchange`
38
+ * resolves the calling frontend's public URL from the `X-Frontend-Service-Name` header and
39
+ * refuses without it — `403 frontend_service_header_required`, measured on a live stack. The
40
+ * mount originally carried only the API origin, so the provider mounted, the reader arrived with
41
+ * a valid code, and the exchange was refused at the last step.
42
+ *
43
+ * Passed as `null` when unset rather than `''`, because the client tests the value for
44
+ * truthiness to decide whether to SEND the header, and an empty string would be sent as an empty
45
+ * header — a different, worse failure than omitting it.
46
+ */
47
+ frontendServiceName={typeof frontendServiceName === 'string' && frontendServiceName.length > 0 ? frontendServiceName : null}
48
+ >
49
+ {children}
50
+ </DocsAuthProvider>
51
+ );
32
52
  }
@@ -19,7 +19,7 @@
19
19
  "dev:watch": "node ../../../scripts/dev-orchestrator/local-dev-compile-observer.mjs --app-root .. --package-name @{{slug}}/backend-api --dist dist -- pnpm exec tsc-watch -p tsconfig.build.json --preserveWatchOutput --onSuccess \"node ../../../scripts/run-tsc-alias-safe.mjs --project tsconfig.build.json --dist dist --signal-file ../.wildo-saas/runtime-signals/backend-api.signal\"",
20
20
  "dev:run": "node ../../../scripts/runtime-supervisor.mjs --cwd . --node-import @wildo-ai/saas-backend-lib/otel-preload --entry dist/index.js --signal-file ../.wildo-saas/runtime-signals/backend-api.signal --label backend-api --runtime-target @{{slug}}/backend-api",
21
21
  {{else}}
22
- "dev": "tsc-watch -p tsconfig.build.json --preserveWatchOutput --onSuccess \"tsc-alias -p tsconfig.build.json --resolve-full-paths --resolve-full-extension .js\"",
22
+ "dev": "tsc-watch -p tsconfig.build.json --preserveWatchOutput --onSuccess \"sh -c 'tsc-alias -p tsconfig.build.json --resolve-full-paths --resolve-full-extension .js && node dist/index.js'\"",
23
23
  {{/if}}
24
24
  "typecheck": "tsc --noEmit",
25
25
  "start": "node dist/index.js",
@@ -10,18 +10,29 @@
10
10
  import backendConfig from './saas-config.backend.js';
11
11
  import type { BackendOwnedModule } from './backend-owned-module.js';
12
12
  import { buildBackendApplicationInitializationConfig } from './bootstrap-config.js';
13
- import { backendProviderContributions } from './provider-contributions.js';
14
13
 
15
14
  export async function loadBackendModules(): Promise<BackendOwnedModule[]> {
16
15
  const moduleExports = await import('./modules-registry.backend.js');
17
16
  return moduleExports.backendOwnedModules;
18
17
  }
19
18
 
19
+ /**
20
+ * No `providerContributions` key, deliberately.
21
+ *
22
+ * An application declares its providers ONCE, in `wildo.saas.config.ts` under `providers.scopes`.
23
+ * Discovery reads the engine's own `./companion` barrel for engine-shipped providers and each
24
+ * installed provider package's for the rest, and derives which runtimes reach them from those
25
+ * scopes — so a hand-authored projection here would be a second copy of a decision already made,
26
+ * and the only thing it could add is a disagreement (#358).
27
+ *
28
+ * The key remains OPTIONAL rather than removed from the contract: an application that ships its OWN
29
+ * provider module — one the engine does not carry and no package publishes — still declares it here,
30
+ * and that is the case the surface exists for.
31
+ */
20
32
  export const backendCompanionExports = {
21
33
  backendConfig,
22
34
  loadBackendModules,
23
35
  buildApplicationInitializationConfig: buildBackendApplicationInitializationConfig,
24
- providerContributions: backendProviderContributions,
25
36
  };
26
37
 
27
38
  export { backendConfig };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "wildo-ai",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "minCliVersion": "0.2.0"
5
5
  }
@@ -1,17 +0,0 @@
1
- {
2
- "ref": "add-backend-provider",
3
- "version": 1,
4
- "title": "Project an engine backend provider into the application",
5
- "description": "Edit-only scenario: appends a projectEngineBackendProviderContribution entry to backendProviderContributions, declaring which runtime hosts can reach the engine-owned provider. Capabilities, protocols and the secret contract stay owned by the engine registry — the application authors only reachability. The matching provider SCOPE in wildo.saas.config.ts stays a post-step BY DESIGN: its capability and protocol values are owned by the engine registry, so a scenario that wrote them would author a claim the registry never made. The sibling add-provider scenario does write a scope, and writes it with EMPTY lists the runtime sync rejects until a human fills them in — the same trade, one step further along.",
6
- "variables": [
7
- { "name": "providerRef", "description": "Engine backend provider ref (e.g. stripe, resend, openai, posthog)", "kind": "string", "required": true, "pattern": "[a-z][a-z0-9-]*" },
8
- { "name": "reachesCompanion", "description": "true when the companion should also reach this provider (LLM/observability providers typically do)", "kind": "boolean", "required": false, "default": "false" }
9
- ],
10
- "edits": [
11
- { "kind": "ts-array-append", "file": "backend-api/src/provider-contributions.ts", "exportedArray": "backendProviderContributions", "element": "projectEngineBackendProviderContribution('{{providerRef}}', [{ kind: 'backend' }{{#if reachesCompanion}}, { kind: 'companion' }{{/if}}])" }
12
- ],
13
- "postNotes": [
14
- "Declare the provider's SCOPE in wildo.saas.config.ts (providers.scopes.backend.{{providerRef}}) — the runtime sync cross-validates roster and scope, and refuses a scope whose capabilities and protocols do not match what the engine registry declares for this provider. Take the values from the registry rather than inventing them.",
15
- "Author the provider's secrets via `wildo setup` / secrets.json providerEnv, then run `wildo config sync`."
16
- ]
17
- }
@@ -1,44 +0,0 @@
1
- import { engineBackendProviderContributions } from '@wildo-ai/external-connectors-private/companion';
2
- import type { ProviderCompanionContribution, ProviderCompanionRuntimeTarget } from '@wildo-ai/saas-models';
3
-
4
- const BACKEND_RUNTIME_IMPORT_PATH = '@wildo-ai/saas-backend-lib';
5
-
6
- /**
7
- * Project one engine-owned provider into this application's reachable runtime
8
- * topology without copying its semantic metadata.
9
- *
10
- * Capabilities, protocols, and the values-free secret contract remain owned by
11
- * the engine provider registry. The application owns only which of its runtime
12
- * hosts can reach that provider and the package path those hosts import.
13
- */
14
- function projectEngineBackendProviderContribution(
15
- ref: string,
16
- runtimeTargets: ProviderCompanionRuntimeTarget[],
17
- ): ProviderCompanionContribution {
18
- const engineContribution = engineBackendProviderContributions.find((contribution) => contribution.ref === ref);
19
- if (!engineContribution) {
20
- throw new Error(`Cannot project unknown engine backend provider "${ref}" into this application.`);
21
- }
22
-
23
- return {
24
- ...engineContribution,
25
- runtimeImportPath: BACKEND_RUNTIME_IMPORT_PATH,
26
- runtimeTargets,
27
- };
28
- }
29
-
30
- /**
31
- * Backend-owned provider reachability for runtime sync validation.
32
- *
33
- * The provider roster and runtime targets are application topology; provider
34
- * capabilities, protocols, and secret-contract shapes are projected from the
35
- * canonical engine registry so additions and renames cannot drift here. The
36
- * `add-provider` composition scenario appends
37
- * `projectEngineBackendProviderContribution('<ref>', [{ kind: 'backend' }])`
38
- * entries alongside the matching provider scope in `wildo.saas.config.ts`.
39
- */
40
- export const backendProviderContributions: ProviderCompanionContribution[] = [];
41
-
42
- // Exported for the add-provider scenario's appended entries (and to keep the
43
- // helper live while the roster is empty).
44
- export { projectEngineBackendProviderContribution };