@wildo-ai/platform-config-lib 1.1.5 → 1.1.7

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 (253) hide show
  1. package/dist/esm/_unimplemented/index.d.ts.map +1 -1
  2. package/dist/esm/_unimplemented/index.js.map +1 -1
  3. package/dist/esm/_unimplemented/soft-warn.d.ts.map +1 -1
  4. package/dist/esm/_unimplemented/soft-warn.js.map +1 -1
  5. package/dist/esm/_unimplemented/unimplemented-field-warning.d.ts.map +1 -1
  6. package/dist/esm/_unimplemented/unimplemented-field-warning.js.map +1 -1
  7. package/dist/esm/bootstrap/application-backend-env.contracts.d.ts.map +1 -1
  8. package/dist/esm/bootstrap/application-backend-env.contracts.js.map +1 -1
  9. package/dist/esm/bootstrap/application-creation-verification-env.contracts.d.ts.map +1 -1
  10. package/dist/esm/bootstrap/application-creation-verification-env.contracts.js.map +1 -1
  11. package/dist/esm/bootstrap/bootstrap-planner.d.ts.map +1 -1
  12. package/dist/esm/bootstrap/bootstrap-planner.js.map +1 -1
  13. package/dist/esm/bootstrap/bootstrap.contracts.d.ts +3 -2
  14. package/dist/esm/bootstrap/bootstrap.contracts.d.ts.map +1 -1
  15. package/dist/esm/bootstrap/bootstrap.contracts.js +3 -2
  16. package/dist/esm/bootstrap/bootstrap.contracts.js.map +1 -1
  17. package/dist/esm/bootstrap/bootstrap.schemas.d.ts +47 -0
  18. package/dist/esm/bootstrap/bootstrap.schemas.d.ts.map +1 -1
  19. package/dist/esm/bootstrap/bootstrap.schemas.js +8 -0
  20. package/dist/esm/bootstrap/bootstrap.schemas.js.map +1 -1
  21. package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts +12 -1
  22. package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts.map +1 -1
  23. package/dist/esm/bootstrap/platform-runtime-env.contracts.js +12 -0
  24. package/dist/esm/bootstrap/platform-runtime-env.contracts.js.map +1 -1
  25. package/dist/esm/bootstrap/platform-store-preconnect.d.ts +37 -0
  26. package/dist/esm/bootstrap/platform-store-preconnect.d.ts.map +1 -0
  27. package/dist/esm/bootstrap/platform-store-preconnect.js +43 -0
  28. package/dist/esm/bootstrap/platform-store-preconnect.js.map +1 -0
  29. package/dist/esm/bootstrap/runtime-backing-service-access.d.ts.map +1 -1
  30. package/dist/esm/bootstrap/runtime-backing-service-access.js +8 -4
  31. package/dist/esm/bootstrap/runtime-backing-service-access.js.map +1 -1
  32. package/dist/esm/bootstrap/runtime-network-policy.d.ts.map +1 -1
  33. package/dist/esm/bootstrap/runtime-network-policy.js.map +1 -1
  34. package/dist/esm/bootstrap/runtime-network-topology.d.ts.map +1 -1
  35. package/dist/esm/bootstrap/runtime-network-topology.js.map +1 -1
  36. package/dist/esm/bootstrap/runtime-platform-access.d.ts.map +1 -1
  37. package/dist/esm/bootstrap/runtime-platform-access.js.map +1 -1
  38. package/dist/esm/bootstrap/runtime-principal.contracts.d.ts.map +1 -1
  39. package/dist/esm/bootstrap/runtime-principal.contracts.js.map +1 -1
  40. package/dist/esm/bootstrap/runtime-topology.contracts.d.ts +36 -3
  41. package/dist/esm/bootstrap/runtime-topology.contracts.d.ts.map +1 -1
  42. package/dist/esm/bootstrap/runtime-topology.contracts.js +36 -13
  43. package/dist/esm/bootstrap/runtime-topology.contracts.js.map +1 -1
  44. package/dist/esm/bootstrap/wildo-owner-organization.contracts.d.ts.map +1 -1
  45. package/dist/esm/bootstrap/wildo-owner-organization.contracts.js.map +1 -1
  46. package/dist/esm/config-authoring.entry.d.ts.map +1 -1
  47. package/dist/esm/config-authoring.entry.js.map +1 -1
  48. package/dist/esm/credentials/credential-generator.service.d.ts.map +1 -1
  49. package/dist/esm/credentials/credential-generator.service.js.map +1 -1
  50. package/dist/esm/index.d.ts +1 -0
  51. package/dist/esm/index.d.ts.map +1 -1
  52. package/dist/esm/index.js +1 -0
  53. package/dist/esm/index.js.map +1 -1
  54. package/dist/esm/lockfile/build-parallelism.d.ts.map +1 -1
  55. package/dist/esm/lockfile/build-parallelism.js.map +1 -1
  56. package/dist/esm/lockfile/canonical-json.d.ts.map +1 -1
  57. package/dist/esm/lockfile/canonical-json.js.map +1 -1
  58. package/dist/esm/lockfile/lockfile-io.d.ts +7 -1
  59. package/dist/esm/lockfile/lockfile-io.d.ts.map +1 -1
  60. package/dist/esm/lockfile/lockfile-io.js +17 -3
  61. package/dist/esm/lockfile/lockfile-io.js.map +1 -1
  62. package/dist/esm/lockfile/materialize-infra-section.d.ts +27 -6
  63. package/dist/esm/lockfile/materialize-infra-section.d.ts.map +1 -1
  64. package/dist/esm/lockfile/materialize-infra-section.js +23 -10
  65. package/dist/esm/lockfile/materialize-infra-section.js.map +1 -1
  66. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts +455 -6
  67. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts.map +1 -1
  68. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js +27 -0
  69. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js.map +1 -1
  70. package/dist/esm/project-config/application-public-pricing-catalog.loader.d.ts +13 -0
  71. package/dist/esm/project-config/application-public-pricing-catalog.loader.d.ts.map +1 -0
  72. package/dist/esm/project-config/application-public-pricing-catalog.loader.js +56 -0
  73. package/dist/esm/project-config/application-public-pricing-catalog.loader.js.map +1 -0
  74. package/dist/esm/project-config/define-framework-config.d.ts.map +1 -1
  75. package/dist/esm/project-config/define-framework-config.js.map +1 -1
  76. package/dist/esm/project-config/define-infra-env-config.d.ts +0 -27
  77. package/dist/esm/project-config/define-infra-env-config.d.ts.map +1 -1
  78. package/dist/esm/project-config/define-infra-env-config.js +0 -2
  79. package/dist/esm/project-config/define-infra-env-config.js.map +1 -1
  80. package/dist/esm/project-config/define-minion-config.d.ts.map +1 -1
  81. package/dist/esm/project-config/define-minion-config.js.map +1 -1
  82. package/dist/esm/project-config/define-saas-config.d.ts +52 -0
  83. package/dist/esm/project-config/define-saas-config.d.ts.map +1 -1
  84. package/dist/esm/project-config/define-saas-config.js +65 -15
  85. package/dist/esm/project-config/define-saas-config.js.map +1 -1
  86. package/dist/esm/project-config/define-worker-config.d.ts.map +1 -1
  87. package/dist/esm/project-config/define-worker-config.js.map +1 -1
  88. package/dist/esm/project-config/hosted-infra-env-config.d.ts.map +1 -1
  89. package/dist/esm/project-config/hosted-infra-env-config.js.map +1 -1
  90. package/dist/esm/project-config/index.d.ts +3 -0
  91. package/dist/esm/project-config/index.d.ts.map +1 -1
  92. package/dist/esm/project-config/index.js +3 -0
  93. package/dist/esm/project-config/index.js.map +1 -1
  94. package/dist/esm/project-config/loader.d.ts +11 -0
  95. package/dist/esm/project-config/loader.d.ts.map +1 -1
  96. package/dist/esm/project-config/loader.js +34 -7
  97. package/dist/esm/project-config/loader.js.map +1 -1
  98. package/dist/esm/project-config/minion-local-provider-registration.d.ts.map +1 -1
  99. package/dist/esm/project-config/minion-local-provider-registration.js.map +1 -1
  100. package/dist/esm/project-config/npm-version-range.d.ts +23 -0
  101. package/dist/esm/project-config/npm-version-range.d.ts.map +1 -0
  102. package/dist/esm/project-config/npm-version-range.js +175 -0
  103. package/dist/esm/project-config/npm-version-range.js.map +1 -0
  104. package/dist/esm/project-config/provider-catalog-types.d.ts.map +1 -1
  105. package/dist/esm/project-config/provider-catalog-types.js.map +1 -1
  106. package/dist/esm/project-config/provider-companion-discovery.d.ts +256 -30
  107. package/dist/esm/project-config/provider-companion-discovery.d.ts.map +1 -1
  108. package/dist/esm/project-config/provider-companion-discovery.js +719 -40
  109. package/dist/esm/project-config/provider-companion-discovery.js.map +1 -1
  110. package/dist/esm/project-config/provider-runtime-artifacts.d.ts +125 -2
  111. package/dist/esm/project-config/provider-runtime-artifacts.d.ts.map +1 -1
  112. package/dist/esm/project-config/provider-runtime-artifacts.js +283 -66
  113. package/dist/esm/project-config/provider-runtime-artifacts.js.map +1 -1
  114. package/dist/esm/project-config/shared/application-creation-verification.schemas.d.ts.map +1 -1
  115. package/dist/esm/project-config/shared/application-creation-verification.schemas.js.map +1 -1
  116. package/dist/esm/project-config/shared/application-modules.schemas.d.ts.map +1 -1
  117. package/dist/esm/project-config/shared/application-modules.schemas.js.map +1 -1
  118. package/dist/esm/project-config/shared/application-modules.utils.d.ts.map +1 -1
  119. package/dist/esm/project-config/shared/application-modules.utils.js.map +1 -1
  120. package/dist/esm/project-config/shared/auth.schemas.d.ts.map +1 -1
  121. package/dist/esm/project-config/shared/auth.schemas.js.map +1 -1
  122. package/dist/esm/project-config/shared/backing-service-servability.d.ts +157 -0
  123. package/dist/esm/project-config/shared/backing-service-servability.d.ts.map +1 -0
  124. package/dist/esm/project-config/shared/backing-service-servability.js +256 -0
  125. package/dist/esm/project-config/shared/backing-service-servability.js.map +1 -0
  126. package/dist/esm/project-config/shared/backing-services.schemas.d.ts +62 -67
  127. package/dist/esm/project-config/shared/backing-services.schemas.d.ts.map +1 -1
  128. package/dist/esm/project-config/shared/backing-services.schemas.js +71 -68
  129. package/dist/esm/project-config/shared/backing-services.schemas.js.map +1 -1
  130. package/dist/esm/project-config/shared/cdn.example.d.ts.map +1 -1
  131. package/dist/esm/project-config/shared/cdn.example.js.map +1 -1
  132. package/dist/esm/project-config/shared/cdn.schemas.d.ts.map +1 -1
  133. package/dist/esm/project-config/shared/cdn.schemas.js.map +1 -1
  134. package/dist/esm/project-config/shared/csp-defaults.d.ts.map +1 -1
  135. package/dist/esm/project-config/shared/csp-defaults.js.map +1 -1
  136. package/dist/esm/project-config/shared/csp-emit.d.ts.map +1 -1
  137. package/dist/esm/project-config/shared/csp-emit.js +41 -2
  138. package/dist/esm/project-config/shared/csp-emit.js.map +1 -1
  139. package/dist/esm/project-config/shared/csp.schemas.d.ts.map +1 -1
  140. package/dist/esm/project-config/shared/csp.schemas.js.map +1 -1
  141. package/dist/esm/project-config/shared/data-services.schemas.d.ts.map +1 -1
  142. package/dist/esm/project-config/shared/data-services.schemas.js.map +1 -1
  143. package/dist/esm/project-config/shared/env-example-defaults.d.ts.map +1 -1
  144. package/dist/esm/project-config/shared/env-example-defaults.js.map +1 -1
  145. package/dist/esm/project-config/shared/environment.schemas.d.ts.map +1 -1
  146. package/dist/esm/project-config/shared/environment.schemas.js.map +1 -1
  147. package/dist/esm/project-config/shared/infra-providers.schemas.d.ts +180 -4
  148. package/dist/esm/project-config/shared/infra-providers.schemas.d.ts.map +1 -1
  149. package/dist/esm/project-config/shared/infra-providers.schemas.js +40 -0
  150. package/dist/esm/project-config/shared/infra-providers.schemas.js.map +1 -1
  151. package/dist/esm/project-config/shared/infra-service.schemas.d.ts.map +1 -1
  152. package/dist/esm/project-config/shared/infra-service.schemas.js.map +1 -1
  153. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.d.ts.map +1 -1
  154. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.js.map +1 -1
  155. package/dist/esm/project-config/shared/k8s-utils.d.ts.map +1 -1
  156. package/dist/esm/project-config/shared/k8s-utils.js.map +1 -1
  157. package/dist/esm/project-config/shared/minion-platform-access.vocabulary.d.ts.map +1 -1
  158. package/dist/esm/project-config/shared/minion-platform-access.vocabulary.js.map +1 -1
  159. package/dist/esm/project-config/shared/minion-resource-access.validation.d.ts.map +1 -1
  160. package/dist/esm/project-config/shared/minion-resource-access.validation.js.map +1 -1
  161. package/dist/esm/project-config/shared/object-storage-session-policy.d.ts.map +1 -1
  162. package/dist/esm/project-config/shared/object-storage-session-policy.js.map +1 -1
  163. package/dist/esm/project-config/shared/platform-services.schemas.d.ts.map +1 -1
  164. package/dist/esm/project-config/shared/platform-services.schemas.js.map +1 -1
  165. package/dist/esm/project-config/shared/platform-storage.schemas.d.ts.map +1 -1
  166. package/dist/esm/project-config/shared/platform-storage.schemas.js.map +1 -1
  167. package/dist/esm/project-config/shared/schema-version.schemas.d.ts.map +1 -1
  168. package/dist/esm/project-config/shared/schema-version.schemas.js.map +1 -1
  169. package/dist/esm/project-config/shared/service-definitions.schemas.d.ts.map +1 -1
  170. package/dist/esm/project-config/shared/service-definitions.schemas.js.map +1 -1
  171. package/dist/esm/project-config/shared/systems-of-record-env.schemas.d.ts.map +1 -1
  172. package/dist/esm/project-config/shared/systems-of-record-env.schemas.js.map +1 -1
  173. package/dist/esm/project-config/static-asset-import-noop.d.ts +26 -0
  174. package/dist/esm/project-config/static-asset-import-noop.d.ts.map +1 -0
  175. package/dist/esm/project-config/static-asset-import-noop.js +49 -0
  176. package/dist/esm/project-config/static-asset-import-noop.js.map +1 -0
  177. package/dist/esm/registry/artifact-domain.schemas.d.ts.map +1 -1
  178. package/dist/esm/registry/artifact-domain.schemas.js.map +1 -1
  179. package/dist/esm/registry/digest.schemas.d.ts.map +1 -1
  180. package/dist/esm/registry/digest.schemas.js.map +1 -1
  181. package/dist/esm/registry/index.d.ts +3 -1
  182. package/dist/esm/registry/index.d.ts.map +1 -1
  183. package/dist/esm/registry/index.js +3 -1
  184. package/dist/esm/registry/index.js.map +1 -1
  185. package/dist/esm/registry/local-checkout-source.d.ts +31 -0
  186. package/dist/esm/registry/local-checkout-source.d.ts.map +1 -0
  187. package/dist/esm/registry/local-checkout-source.js +45 -0
  188. package/dist/esm/registry/local-checkout-source.js.map +1 -0
  189. package/dist/esm/registry/lockfile-modules-section.schemas.d.ts +174 -14
  190. package/dist/esm/registry/lockfile-modules-section.schemas.d.ts.map +1 -1
  191. package/dist/esm/registry/lockfile-modules-section.schemas.js +120 -11
  192. package/dist/esm/registry/lockfile-modules-section.schemas.js.map +1 -1
  193. package/dist/esm/registry/module-artifact.schemas.d.ts +79 -0
  194. package/dist/esm/registry/module-artifact.schemas.d.ts.map +1 -1
  195. package/dist/esm/registry/module-artifact.schemas.js +36 -0
  196. package/dist/esm/registry/module-artifact.schemas.js.map +1 -1
  197. package/dist/esm/registry/module-manifest.schemas.d.ts +393 -7
  198. package/dist/esm/registry/module-manifest.schemas.d.ts.map +1 -1
  199. package/dist/esm/registry/module-manifest.schemas.js +488 -40
  200. package/dist/esm/registry/module-manifest.schemas.js.map +1 -1
  201. package/dist/esm/registry/module-search.schemas.d.ts +80 -0
  202. package/dist/esm/registry/module-search.schemas.d.ts.map +1 -0
  203. package/dist/esm/registry/module-search.schemas.js +112 -0
  204. package/dist/esm/registry/module-search.schemas.js.map +1 -0
  205. package/dist/esm/registry/registry-config.schemas.d.ts +16 -0
  206. package/dist/esm/registry/registry-config.schemas.d.ts.map +1 -1
  207. package/dist/esm/registry/registry-config.schemas.js +8 -0
  208. package/dist/esm/registry/registry-config.schemas.js.map +1 -1
  209. package/dist/esm/registry/registry-defaults.constants.d.ts.map +1 -1
  210. package/dist/esm/registry/registry-defaults.constants.js.map +1 -1
  211. package/dist/esm/registry/registry-errors.d.ts +126 -2
  212. package/dist/esm/registry/registry-errors.d.ts.map +1 -1
  213. package/dist/esm/registry/registry-errors.js +183 -14
  214. package/dist/esm/registry/registry-errors.js.map +1 -1
  215. package/dist/esm/registry/registry-keys.schemas.d.ts +80 -0
  216. package/dist/esm/registry/registry-keys.schemas.d.ts.map +1 -0
  217. package/dist/esm/registry/registry-keys.schemas.js +68 -0
  218. package/dist/esm/registry/registry-keys.schemas.js.map +1 -0
  219. package/dist/esm/registry/registry-section-schemas.constants.d.ts +25 -3
  220. package/dist/esm/registry/registry-section-schemas.constants.d.ts.map +1 -1
  221. package/dist/esm/registry/registry-section-schemas.constants.js.map +1 -1
  222. package/dist/esm/release/framework-release.constants.d.ts.map +1 -1
  223. package/dist/esm/release/framework-release.constants.js.map +1 -1
  224. package/dist/esm/schemas/framework-info.schemas.d.ts.map +1 -1
  225. package/dist/esm/schemas/framework-info.schemas.js.map +1 -1
  226. package/dist/esm/schemas/framework-secrets.schemas.d.ts.map +1 -1
  227. package/dist/esm/schemas/framework-secrets.schemas.js.map +1 -1
  228. package/dist/esm/schemas/platform-application-config.schemas.d.ts.map +1 -1
  229. package/dist/esm/schemas/platform-application-config.schemas.js.map +1 -1
  230. package/dist/esm/schemas/platform-application-secrets.schemas.d.ts.map +1 -1
  231. package/dist/esm/schemas/platform-application-secrets.schemas.js.map +1 -1
  232. package/dist/esm/schemas/platform-config.schemas.d.ts.map +1 -1
  233. package/dist/esm/schemas/platform-config.schemas.js.map +1 -1
  234. package/dist/esm/workspace-scope/application-subject-manifest.d.ts.map +1 -1
  235. package/dist/esm/workspace-scope/application-subject-manifest.js.map +1 -1
  236. package/dist/esm/workspace-scope/index.d.ts.map +1 -1
  237. package/dist/esm/workspace-scope/index.js.map +1 -1
  238. package/dist/esm/workspace-scope/resolve-homes.d.ts.map +1 -1
  239. package/dist/esm/workspace-scope/resolve-homes.js.map +1 -1
  240. package/dist/esm/workspace-scope/workspace-homes.schemas.d.ts +13 -11
  241. package/dist/esm/workspace-scope/workspace-homes.schemas.d.ts.map +1 -1
  242. package/dist/esm/workspace-scope/workspace-homes.schemas.js +2 -2
  243. package/dist/esm/workspace-scope/workspace-homes.schemas.js.map +1 -1
  244. package/dist/esm/workspace-scope/workspace-scope-detector.d.ts.map +1 -1
  245. package/dist/esm/workspace-scope/workspace-scope-detector.js.map +1 -1
  246. package/dist/esm/workspace-scope/workspace-scope.schemas.d.ts.map +1 -1
  247. package/dist/esm/workspace-scope/workspace-scope.schemas.js.map +1 -1
  248. package/dist/tsconfig.build.tsbuildinfo +1 -1
  249. package/package.json +7 -7
  250. package/dist/esm/registry/companion-api.schemas.d.ts +0 -176
  251. package/dist/esm/registry/companion-api.schemas.d.ts.map +0 -1
  252. package/dist/esm/registry/companion-api.schemas.js +0 -165
  253. package/dist/esm/registry/companion-api.schemas.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wildo-ai/platform-config-lib",
3
- "version": "1.1.5",
3
+ "version": "1.1.7",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "description": "Project configuration schemas, defineConfig helpers, and shared bootstrap contracts for the Wildo.ai platform",
6
6
  "author": "Wildo AI",
@@ -34,12 +34,12 @@
34
34
  "test:watch": "vitest"
35
35
  },
36
36
  "dependencies": {
37
- "@wildo-ai/external-connectors-models": "1.1.5",
38
- "@wildo-ai/external-connectors-private": "1.1.5",
39
- "@wildo-ai/external-connectors-public": "1.1.5",
40
- "@wildo-ai/platform-core-shared": "1.1.5",
41
- "@wildo-ai/saas-models": "1.1.5",
42
- "@wildo-ai/zod-decorators": "1.1.5",
37
+ "@wildo-ai/external-connectors-models": "1.1.7",
38
+ "@wildo-ai/external-connectors-private": "1.1.7",
39
+ "@wildo-ai/external-connectors-public": "1.1.7",
40
+ "@wildo-ai/platform-core-shared": "1.1.7",
41
+ "@wildo-ai/saas-models": "1.1.7",
42
+ "@wildo-ai/zod-decorators": "1.1.7",
43
43
  "jiti": "^2.6.1",
44
44
  "proper-lockfile": "^4.1.2",
45
45
  "write-file-atomic": "^5.0.1"
@@ -1,176 +0,0 @@
1
- /**
2
- * Wire schemas for the companion's `/api/companion/registry/*`
3
- * routes.
4
- *
5
- * Phase 2 lands the request/response contracts as Zod schemas so
6
- * both sides (CLI client + companion controller) share the same
7
- * shape. The CLI calls these via `RegistryCompanionClient`; the
8
- * companion implements the routes via `RegistryController`.
9
- *
10
- * KD-6 (companion owns SaaS-app source mutations) maps to these
11
- * routes:
12
- * - `POST /api/companion/registry/install` — copy module source
13
- * into app, mutate `wildo.saas.config.ts > moduleRegistries`,
14
- * mutate `modules-registry.{shared,frontend,backend}.ts`,
15
- * update `sections.modules`, run provider sync.
16
- * - `POST /api/companion/registry/update` — update an installed
17
- * module to a new version (delta apply + lockfile refresh).
18
- * - `POST /api/companion/registry/remove` — remove an installed
19
- * module (delete files, drop sentinel-managed entries, drop
20
- * `sections.modules.installed[<id>]`).
21
- * - `POST /api/companion/registry/publish` — stage + zip + upload
22
- * a local module to its registry (delegates to
23
- * `ModulePackagerService` + `RegistryServerClient`).
24
- *
25
- * Every route returns a `RegistryRouteResultSchema` envelope so
26
- * the CLI client can handle success / failure / repairable
27
- * post-mutation provider-sync errors uniformly.
28
- */
29
- import { z } from 'zod';
30
- /**
31
- * Reason flag forwarded to the provider-sync runner so its
32
- * diagnostic copy mirrors the calling verb.
33
- */
34
- export declare const RegistryMutationReasonSchema: z.ZodEnum<{
35
- install: "install";
36
- update: "update";
37
- adopt: "adopt";
38
- remove: "remove";
39
- }>;
40
- export type RegistryMutationReason = z.infer<typeof RegistryMutationReasonSchema>;
41
- export declare const RegistryInstallRequestSchema: z.ZodObject<{
42
- /** Module id (`<domain>/<name>`). */
43
- moduleId: z.ZodString;
44
- /**
45
- * Resolved exact version. The CLI resolves the range upstream.
46
- * Must be exact semver — accepting a range here (e.g. `^1.2.3`)
47
- * would let the lockfile carry a non-resolvable version.
48
- */
49
- version: z.ZodString;
50
- /** Range the user originally typed (preserved on the lockfile entry). */
51
- requestedRange: z.ZodOptional<z.ZodString>;
52
- /** Registry id from `wildo.saas.config.ts > moduleRegistries[].id`. */
53
- registryId: z.ZodString;
54
- /** Resolved registry URL at install time. */
55
- registryUrl: z.ZodURL;
56
- /** Domain segment under the registry. */
57
- domain: z.ZodString;
58
- /** Artifact integrity digest (`sha256:<64-hex>`). */
59
- artifactDigest: z.ZodString;
60
- }, z.core.$strict>;
61
- export type RegistryInstallRequest = z.infer<typeof RegistryInstallRequestSchema>;
62
- export declare const RegistryUpdateRequestSchema: z.ZodObject<{
63
- moduleId: z.ZodString;
64
- /** Target exact version. CLI resolves the range upstream. */
65
- toVersion: z.ZodString;
66
- toArtifactDigest: z.ZodString;
67
- registryId: z.ZodString;
68
- }, z.core.$strict>;
69
- export type RegistryUpdateRequest = z.infer<typeof RegistryUpdateRequestSchema>;
70
- export declare const RegistryRemoveRequestSchema: z.ZodObject<{
71
- moduleId: z.ZodString;
72
- }, z.core.$strict>;
73
- export type RegistryRemoveRequest = z.infer<typeof RegistryRemoveRequestSchema>;
74
- /**
75
- * `GET /v1/auth/whoami` response — what the registry server hands
76
- * back when a CLI calls `wildo registry login`/`whoami --verify`.
77
- * The CLI Zod-parses every required field so a misconfigured registry
78
- * that omits `organizationId` cannot persist a credential with `org=?`.
79
- *
80
- * `roles` is optional because not every registry deployment models
81
- * roles today; when supplied it lands on the per-machine credential
82
- * blob for staleness UX.
83
- *
84
- * 4th-pass review M5: the schema is `.object({...})` (NOT `.strictObject`)
85
- * so the registry server can add new optional response fields
86
- * (`tokenIssuedAt`, `lastUsedAt`, etc.) WITHOUT every existing CLI
87
- * version refusing to authenticate. The CLI still fails-closed on
88
- * missing required fields; only unknown additional fields are
89
- * silently dropped on the client side. Forward-compat is the priority
90
- * here since CLI versions cannot be flushed in lockstep with server
91
- * deployments.
92
- */
93
- export declare const RegistryWhoamiResponseSchema: z.ZodObject<{
94
- organizationId: z.ZodString;
95
- apiKeyId: z.ZodString;
96
- apiKeyName: z.ZodOptional<z.ZodString>;
97
- roles: z.ZodOptional<z.ZodArray<z.ZodString>>;
98
- }, z.core.$strip>;
99
- export type RegistryWhoamiResponse = z.infer<typeof RegistryWhoamiResponseSchema>;
100
- export declare const RegistryPublishRequestSchema: z.ZodObject<{
101
- /** Module id from the staged manifest. */
102
- moduleId: z.ZodString;
103
- /** Exact version from the staged manifest — semver-validated. */
104
- version: z.ZodString;
105
- /** Registry id to publish to. */
106
- registryId: z.ZodString;
107
- /** Domain to publish under. */
108
- domain: z.ZodString;
109
- /** Pre-computed staging digest (matches `Sha256DigestSchema`). */
110
- artifactDigest: z.ZodString;
111
- }, z.core.$strict>;
112
- export type RegistryPublishRequest = z.infer<typeof RegistryPublishRequestSchema>;
113
- /**
114
- * Provider-sync outcome inside a mutation route's response. Mirrors
115
- * `runProviderSync` return shape (without the always-on path
116
- * constants — the CLI knows them via `platform-config-lib`).
117
- */
118
- export declare const RegistryProviderSyncOutcomeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
119
- status: z.ZodLiteral<"ok">;
120
- mode: z.ZodEnum<{
121
- "shell-out": "shell-out";
122
- "dry-run": "dry-run";
123
- }>;
124
- durationMs: z.ZodNumber;
125
- }, z.core.$strict>, z.ZodObject<{
126
- status: z.ZodLiteral<"failed">;
127
- failureKind: z.ZodEnum<{
128
- unknown: "unknown";
129
- "companion-discovery": "companion-discovery";
130
- "runtime-import-reachability": "runtime-import-reachability";
131
- "invalid-scope": "invalid-scope";
132
- timeout: "timeout";
133
- }>;
134
- message: z.ZodString;
135
- stderrTail: z.ZodOptional<z.ZodString>;
136
- }, z.core.$strict>], "status">;
137
- export type RegistryProviderSyncOutcome = z.infer<typeof RegistryProviderSyncOutcomeSchema>;
138
- export declare const RegistryRouteResultSchema: z.ZodObject<{
139
- ok: z.ZodBoolean;
140
- /** Files written into app source (relative to saas root). */
141
- filesTouched: z.ZodDefault<z.ZodArray<z.ZodString>>;
142
- /** Provider-sync outcome (omitted when not applicable, e.g. publish). */
143
- providerSync: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
144
- status: z.ZodLiteral<"ok">;
145
- mode: z.ZodEnum<{
146
- "shell-out": "shell-out";
147
- "dry-run": "dry-run";
148
- }>;
149
- durationMs: z.ZodNumber;
150
- }, z.core.$strict>, z.ZodObject<{
151
- status: z.ZodLiteral<"failed">;
152
- failureKind: z.ZodEnum<{
153
- unknown: "unknown";
154
- "companion-discovery": "companion-discovery";
155
- "runtime-import-reachability": "runtime-import-reachability";
156
- "invalid-scope": "invalid-scope";
157
- timeout: "timeout";
158
- }>;
159
- message: z.ZodString;
160
- stderrTail: z.ZodOptional<z.ZodString>;
161
- }, z.core.$strict>], "status">>;
162
- /** Free-form diagnostic copy. */
163
- message: z.ZodOptional<z.ZodString>;
164
- }, z.core.$strict>;
165
- export type RegistryRouteResult = z.infer<typeof RegistryRouteResultSchema>;
166
- /**
167
- * Companion route paths — single source of truth shared by the
168
- * CLI client and the companion controller.
169
- */
170
- export declare const REGISTRY_COMPANION_ROUTES: {
171
- readonly install: "/api/companion/registry/install";
172
- readonly update: "/api/companion/registry/update";
173
- readonly remove: "/api/companion/registry/remove";
174
- readonly publish: "/api/companion/registry/publish";
175
- };
176
- //# sourceMappingURL=companion-api.schemas.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"companion-api.schemas.d.ts","sourceRo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C;AACH,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAE5F,eAAO,MAAM,yBAAyB;;IAEpC,6DAA6D;;IAE7D,yEAAyE;;;;;;;;;;;;;;;;;;;;IAEzE,iCAAiC;;kBAEjC,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E;;;GAGG;AACH,eAAO,MAAM,yBAAyB;;;;;CAK5B,CAAC"}
@@ -1,165 +0,0 @@
1
- /**
2
- * Wire schemas for the companion's `/api/companion/registry/*`
3
- * routes.
4
- *
5
- * Phase 2 lands the request/response contracts as Zod schemas so
6
- * both sides (CLI client + companion controller) share the same
7
- * shape. The CLI calls these via `RegistryCompanionClient`; the
8
- * companion implements the routes via `RegistryController`.
9
- *
10
- * KD-6 (companion owns SaaS-app source mutations) maps to these
11
- * routes:
12
- * - `POST /api/companion/registry/install` — copy module source
13
- * into app, mutate `wildo.saas.config.ts > moduleRegistries`,
14
- * mutate `modules-registry.{shared,frontend,backend}.ts`,
15
- * update `sections.modules`, run provider sync.
16
- * - `POST /api/companion/registry/update` — update an installed
17
- * module to a new version (delta apply + lockfile refresh).
18
- * - `POST /api/companion/registry/remove` — remove an installed
19
- * module (delete files, drop sentinel-managed entries, drop
20
- * `sections.modules.installed[<id>]`).
21
- * - `POST /api/companion/registry/publish` — stage + zip + upload
22
- * a local module to its registry (delegates to
23
- * `ModulePackagerService` + `RegistryServerClient`).
24
- *
25
- * Every route returns a `RegistryRouteResultSchema` envelope so
26
- * the CLI client can handle success / failure / repairable
27
- * post-mutation provider-sync errors uniformly.
28
- */
29
- import { z } from 'zod';
30
- import { SemverExactSchema } from './module-manifest.schemas.js';
31
- /**
32
- * Reason flag forwarded to the provider-sync runner so its
33
- * diagnostic copy mirrors the calling verb.
34
- */
35
- export const RegistryMutationReasonSchema = z.enum([
36
- 'install',
37
- 'update',
38
- 'remove',
39
- 'adopt',
40
- ]);
41
- // ---------- Install -------------------------------------------------------
42
- export const RegistryInstallRequestSchema = z.strictObject({
43
- /** Module id (`<domain>/<name>`). */
44
- moduleId: z.string().min(1),
45
- /**
46
- * Resolved exact version. The CLI resolves the range upstream.
47
- * Must be exact semver — accepting a range here (e.g. `^1.2.3`)
48
- * would let the lockfile carry a non-resolvable version.
49
- */
50
- version: SemverExactSchema,
51
- /** Range the user originally typed (preserved on the lockfile entry). */
52
- requestedRange: z.string().min(1).optional(),
53
- /** Registry id from `wildo.saas.config.ts > moduleRegistries[].id`. */
54
- registryId: z.string().min(1),
55
- /** Resolved registry URL at install time. */
56
- registryUrl: z.url(),
57
- /** Domain segment under the registry. */
58
- domain: z.string().min(1),
59
- /** Artifact integrity digest (`sha256:<64-hex>`). */
60
- artifactDigest: z.string().min(1),
61
- });
62
- // ---------- Update --------------------------------------------------------
63
- export const RegistryUpdateRequestSchema = z.strictObject({
64
- moduleId: z.string().min(1),
65
- /** Target exact version. CLI resolves the range upstream. */
66
- toVersion: SemverExactSchema,
67
- toArtifactDigest: z.string().min(1),
68
- registryId: z.string().min(1),
69
- });
70
- // ---------- Remove --------------------------------------------------------
71
- export const RegistryRemoveRequestSchema = z.strictObject({
72
- moduleId: z.string().min(1),
73
- });
74
- // ---------- Publish -------------------------------------------------------
75
- /**
76
- * `GET /v1/auth/whoami` response — what the registry server hands
77
- * back when a CLI calls `wildo registry login`/`whoami --verify`.
78
- * The CLI Zod-parses every required field so a misconfigured registry
79
- * that omits `organizationId` cannot persist a credential with `org=?`.
80
- *
81
- * `roles` is optional because not every registry deployment models
82
- * roles today; when supplied it lands on the per-machine credential
83
- * blob for staleness UX.
84
- *
85
- * 4th-pass review M5: the schema is `.object({...})` (NOT `.strictObject`)
86
- * so the registry server can add new optional response fields
87
- * (`tokenIssuedAt`, `lastUsedAt`, etc.) WITHOUT every existing CLI
88
- * version refusing to authenticate. The CLI still fails-closed on
89
- * missing required fields; only unknown additional fields are
90
- * silently dropped on the client side. Forward-compat is the priority
91
- * here since CLI versions cannot be flushed in lockstep with server
92
- * deployments.
93
- */
94
- export const RegistryWhoamiResponseSchema = z.object({
95
- organizationId: z.string().min(1),
96
- apiKeyId: z.string().min(1),
97
- apiKeyName: z.string().min(1).optional(),
98
- roles: z.array(z.string().min(1)).optional(),
99
- });
100
- export const RegistryPublishRequestSchema = z.strictObject({
101
- /** Module id from the staged manifest. */
102
- moduleId: z.string().min(1),
103
- /** Exact version from the staged manifest — semver-validated. */
104
- version: SemverExactSchema,
105
- /** Registry id to publish to. */
106
- registryId: z.string().min(1),
107
- /** Domain to publish under. */
108
- domain: z.string().min(1),
109
- /** Pre-computed staging digest (matches `Sha256DigestSchema`). */
110
- artifactDigest: z.string().min(1),
111
- });
112
- // ---------- Common result envelope ----------------------------------------
113
- /**
114
- * Provider-sync outcome inside a mutation route's response. Mirrors
115
- * `runProviderSync` return shape (without the always-on path
116
- * constants — the CLI knows them via `platform-config-lib`).
117
- */
118
- export const RegistryProviderSyncOutcomeSchema = z.discriminatedUnion('status', [
119
- z.strictObject({
120
- status: z.literal('ok'),
121
- mode: z.enum(['shell-out', 'dry-run']),
122
- durationMs: z.number().int().nonnegative(),
123
- }),
124
- z.strictObject({
125
- status: z.literal('failed'),
126
- // 4th-pass review H4: keep this enum in lock-step with
127
- // `RegistryProviderSyncFailedError.failureKind` in
128
- // `registry-errors.ts`. The two are wire-and-error twins — when
129
- // the companion serializes a typed error into this envelope, the
130
- // strict-object enum here MUST cover every value the error class
131
- // can carry. `'timeout'` was added in the third-pass H5 fix on the
132
- // error-class side without being mirrored here, so a real timeout
133
- // failed strict validation client-side and surfaced as a generic
134
- // malformed-payload error.
135
- failureKind: z.enum([
136
- 'companion-discovery',
137
- 'runtime-import-reachability',
138
- 'invalid-scope',
139
- 'timeout',
140
- 'unknown',
141
- ]),
142
- message: z.string(),
143
- stderrTail: z.string().optional(),
144
- }),
145
- ]);
146
- export const RegistryRouteResultSchema = z.strictObject({
147
- ok: z.boolean(),
148
- /** Files written into app source (relative to saas root). */
149
- filesTouched: z.array(z.string()).default([]),
150
- /** Provider-sync outcome (omitted when not applicable, e.g. publish). */
151
- providerSync: RegistryProviderSyncOutcomeSchema.optional(),
152
- /** Free-form diagnostic copy. */
153
- message: z.string().optional(),
154
- });
155
- /**
156
- * Companion route paths — single source of truth shared by the
157
- * CLI client and the companion controller.
158
- */
159
- export const REGISTRY_COMPANION_ROUTES = {
160
- install: '/api/companion/registry/install',
161
- update: '/api/companion/registry/update',
162
- remove: '/api/companion/registry/remove',
163
- publish: '/api/companion/registry/publish',
164
- };
165
- //# sourceMappingURL=companion-api.schemas.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"companion-api.schemas.js","sourceRoot":"","sources":["../../../../src/registry/companion-api.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE9D;;;GAGG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC,IAAI,CAAC;IACjD,SAAS;IACT,QAAQ;IACR,QAAQ;IACR,OAAO;CACR,CAAC,CAAC;AAGH,6EAA6E;AAE7E,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC,YAAY,CAAC;IACzD,qCAAqC;IACrC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3B;;;;OAIG;IACH,OAAO,EAAE,iBAAiB;IAC1B,yEAAyE;IACzE,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC5C,uEAAuE;IACvE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7B,6CAA6C;IAC7C,WAAW,EA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EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KAClC,CAAC;CACH,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,YAAY,CAAC;IACtD,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE;IACf,6DAA6D;IAC7D,YAAY,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IAC7C,yEAAyE;IACzE,YAAY,EAAE,iCAAiC,CAAC,QAAQ,EAAE;IAC1D,iCAAiC;IACjC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAC,CAAC;AAGH;;;GAGG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,OAAO,EAAE,iCAAiC;IAC1C,MAAM,EAAE,gCAAgC;IACxC,MAAM,EAAE,gCAAgC;IACxC,OAAO,EAAE,iCAAiC;CAClC,CAAC","sourcesContent":["/**\n * Wire schemas for the companion's `/api/companion/registry/*`\n * routes.\n *\n * Phase 2 lands the request/response contracts as Zod schemas so\n * both sides (CLI client + companion controller) share the same\n * shape. The CLI calls these via `RegistryCompanionClient`; the\n * companion implements the routes via `RegistryController`.\n *\n * KD-6 (companion owns SaaS-app source mutations) maps to these\n * routes:\n * - `POST /api/companion/registry/install` — copy module source\n * into app, mutate `wildo.saas.config.ts > moduleRegistries`,\n * mutate `modules-registry.{shared,frontend,backend}.ts`,\n * update `sections.modules`, run provider sync.\n * - `POST /api/companion/registry/update` — update an installed\n * module to a new version (delta apply + lockfile refresh).\n * - `POST /api/companion/registry/remove` — remove an installed\n * module (delete files, drop sentinel-managed entries, drop\n * `sections.modules.installed[<id>]`).\n * - `POST /api/companion/registry/publish` — stage + zip + upload\n * a local module to its registry (delegates to\n * `ModulePackagerService` + `RegistryServerClient`).\n *\n * Every route returns a `RegistryRouteResultSchema` envelope so\n * the CLI client can handle success / failure / repairable\n * post-mutation provider-sync errors uniformly.\n */\n\nimport { z } from 'zod';\nimport { SemverExactSchema } from './module-manifest.schemas';\n\n/**\n * Reason flag forwarded to the provider-sync runner so its\n * diagnostic copy mirrors the calling verb.\n */\nexport const RegistryMutationReasonSchema = z.enum([\n 'install',\n 'update',\n 'remove',\n 'adopt',\n]);\nexport type RegistryMutationReason = z.infer<typeof RegistryMutationReasonSchema>;\n\n// ---------- Install -------------------------------------------------------\n\nexport const RegistryInstallRequestSchema = z.strictObject({\n /** Module id (`<domain>/<name>`). */\n moduleId: z.string().min(1),\n /**\n * Resolved exact version. The CLI resolves the range upstream.\n * Must be exact semver — accepting a range here (e.g. `^1.2.3`)\n * would let the lockfile carry a non-resolvable version.\n */\n version: SemverExactSchema,\n /** Range the user originally typed (preserved on the lockfile entry). */\n requestedRange: z.string().min(1).optional(),\n /** Registry id from `wildo.saas.config.ts > moduleRegistries[].id`. */\n registryId: z.string().min(1),\n /** Resolved registry URL at install time. */\n registryUrl: z.url(),\n /** Domain segment under the registry. */\n domain: z.string().min(1),\n /** Artifact integrity digest (`sha256:<64-hex>`). */\n artifactDigest: z.string().min(1),\n});\nexport type RegistryInstallRequest = z.infer<typeof RegistryInstallRequestSchema>;\n\n// ---------- Update --------------------------------------------------------\n\nexport const RegistryUpdateRequestSchema = z.strictObject({\n moduleId: z.string().min(1),\n /** Target exact version. CLI resolves the range upstream. */\n toVersion: SemverExactSchema,\n toArtifactDigest: z.string().min(1),\n registryId: z.string().min(1),\n});\nexport type RegistryUpdateRequest = z.infer<typeof RegistryUpdateRequestSchema>;\n\n// ---------- Remove --------------------------------------------------------\n\nexport const RegistryRemoveRequestSchema = z.strictObject({\n moduleId: z.string().min(1),\n});\nexport type RegistryRemoveRequest = z.infer<typeof RegistryRemoveRequestSchema>;\n\n// ---------- Publish -------------------------------------------------------\n\n/**\n * `GET /v1/auth/whoami` response — what the registry server hands\n * back when a CLI calls `wildo registry login`/`whoami --verify`.\n * The CLI Zod-parses every required field so a misconfigured registry\n * that omits `organizationId` cannot persist a credential with `org=?`.\n *\n * `roles` is optional because not every registry deployment models\n * roles today; when supplied it lands on the per-machine credential\n * blob for staleness UX.\n *\n * 4th-pass review M5: the schema is `.object({...})` (NOT `.strictObject`)\n * so the registry server can add new optional response fields\n * (`tokenIssuedAt`, `lastUsedAt`, etc.) WITHOUT every existing CLI\n * version refusing to authenticate. The CLI still fails-closed on\n * missing required fields; only unknown additional fields are\n * silently dropped on the client side. Forward-compat is the priority\n * here since CLI versions cannot be flushed in lockstep with server\n * deployments.\n */\nexport const RegistryWhoamiResponseSchema = z.object({\n organizationId: z.string().min(1),\n apiKeyId: z.string().min(1),\n apiKeyName: z.string().min(1).optional(),\n roles: z.array(z.string().min(1)).optional(),\n});\nexport type RegistryWhoamiResponse = z.infer<typeof RegistryWhoamiResponseSchema>;\n\nexport const RegistryPublishRequestSchema = z.strictObject({\n /** Module id from the staged manifest. */\n moduleId: z.string().min(1),\n /** Exact version from the staged manifest — semver-validated. */\n version: SemverExactSchema,\n /** Registry id to publish to. */\n registryId: z.string().min(1),\n /** Domain to publish under. */\n domain: z.string().min(1),\n /** Pre-computed staging digest (matches `Sha256DigestSchema`). */\n artifactDigest: z.string().min(1),\n});\nexport type RegistryPublishRequest = z.infer<typeof RegistryPublishRequestSchema>;\n\n// ---------- Common result envelope ----------------------------------------\n\n/**\n * Provider-sync outcome inside a mutation route's response. Mirrors\n * `runProviderSync` return shape (without the always-on path\n * constants — the CLI knows them via `platform-config-lib`).\n */\nexport const RegistryProviderSyncOutcomeSchema = z.discriminatedUnion('status', [\n z.strictObject({\n status: z.literal('ok'),\n mode: z.enum(['shell-out', 'dry-run']),\n durationMs: z.number().int().nonnegative(),\n }),\n z.strictObject({\n status: z.literal('failed'),\n // 4th-pass review H4: keep this enum in lock-step with\n // `RegistryProviderSyncFailedError.failureKind` in\n // `registry-errors.ts`. The two are wire-and-error twins — when\n // the companion serializes a typed error into this envelope, the\n // strict-object enum here MUST cover every value the error class\n // can carry. `'timeout'` was added in the third-pass H5 fix on the\n // error-class side without being mirrored here, so a real timeout\n // failed strict validation client-side and surfaced as a generic\n // malformed-payload error.\n failureKind: z.enum([\n 'companion-discovery',\n 'runtime-import-reachability',\n 'invalid-scope',\n 'timeout',\n 'unknown',\n ]),\n message: z.string(),\n stderrTail: z.string().optional(),\n }),\n]);\nexport type RegistryProviderSyncOutcome = z.infer<typeof RegistryProviderSyncOutcomeSchema>;\n\nexport const RegistryRouteResultSchema = z.strictObject({\n ok: z.boolean(),\n /** Files written into app source (relative to saas root). */\n filesTouched: z.array(z.string()).default([]),\n /** Provider-sync outcome (omitted when not applicable, e.g. publish). */\n providerSync: RegistryProviderSyncOutcomeSchema.optional(),\n /** Free-form diagnostic copy. */\n message: z.string().optional(),\n});\nexport type RegistryRouteResult = z.infer<typeof RegistryRouteResultSchema>;\n\n/**\n * Companion route paths — single source of truth shared by the\n * CLI client and the companion controller.\n */\nexport const REGISTRY_COMPANION_ROUTES = {\n install: '/api/companion/registry/install',\n update: '/api/companion/registry/update',\n remove: '/api/companion/registry/remove',\n publish: '/api/companion/registry/publish',\n} as const;\n"]}