@contractspec/lib.contracts 0.0.0-canary-20260113162409

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 (550) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +109 -0
  3. package/dist/_virtual/rolldown_runtime.js +37 -0
  4. package/dist/app-config/app-config.capability.d.ts +7 -0
  5. package/dist/app-config/app-config.capability.js +23 -0
  6. package/dist/app-config/app-config.feature.d.ts +11 -0
  7. package/dist/app-config/app-config.feature.js +61 -0
  8. package/dist/app-config/branding.d.ts +55 -0
  9. package/dist/app-config/branding.js +0 -0
  10. package/dist/app-config/contracts.d.ts +245 -0
  11. package/dist/app-config/contracts.js +395 -0
  12. package/dist/app-config/docs/app-config.docblock.d.ts +6 -0
  13. package/dist/app-config/docs/app-config.docblock.js +21 -0
  14. package/dist/app-config/events.d.ts +122 -0
  15. package/dist/app-config/events.js +174 -0
  16. package/dist/app-config/index.d.ts +10 -0
  17. package/dist/app-config/index.js +9 -0
  18. package/dist/app-config/lifecycle-contracts.d.ts +273 -0
  19. package/dist/app-config/lifecycle-contracts.js +440 -0
  20. package/dist/app-config/lifecycle.d.ts +27 -0
  21. package/dist/app-config/lifecycle.js +0 -0
  22. package/dist/app-config/runtime.d.ts +120 -0
  23. package/dist/app-config/runtime.js +617 -0
  24. package/dist/app-config/spec.d.ts +175 -0
  25. package/dist/app-config/spec.js +19 -0
  26. package/dist/app-config/validation.d.ts +49 -0
  27. package/dist/app-config/validation.js +538 -0
  28. package/dist/capabilities/capabilities.d.ts +41 -0
  29. package/dist/capabilities/capabilities.js +48 -0
  30. package/dist/capabilities/docs/capabilities.docblock.d.ts +6 -0
  31. package/dist/capabilities/docs/capabilities.docblock.js +21 -0
  32. package/dist/capabilities/index.d.ts +3 -0
  33. package/dist/capabilities/index.js +4 -0
  34. package/dist/capabilities/openbanking.d.ts +10 -0
  35. package/dist/capabilities/openbanking.js +92 -0
  36. package/dist/client/index.d.ts +6 -0
  37. package/dist/client/index.js +9 -0
  38. package/dist/client/react/drivers/rn-reusables.d.ts +22 -0
  39. package/dist/client/react/drivers/rn-reusables.js +21 -0
  40. package/dist/client/react/drivers/shadcn.d.ts +12 -0
  41. package/dist/client/react/drivers/shadcn.js +11 -0
  42. package/dist/client/react/feature-render.d.ts +23 -0
  43. package/dist/client/react/feature-render.js +44 -0
  44. package/dist/client/react/form-render.d.ts +92 -0
  45. package/dist/client/react/form-render.js +301 -0
  46. package/dist/client/react/index.d.ts +5 -0
  47. package/dist/client/react/index.js +8 -0
  48. package/dist/contract-registry/index.d.ts +3 -0
  49. package/dist/contract-registry/index.js +3 -0
  50. package/dist/contract-registry/schemas.d.ts +124 -0
  51. package/dist/contract-registry/schemas.js +61 -0
  52. package/dist/contract-registry/types.d.ts +46 -0
  53. package/dist/contract-registry/types.js +0 -0
  54. package/dist/data-views/data-views.d.ts +5 -0
  55. package/dist/data-views/data-views.js +5 -0
  56. package/dist/data-views/docs/data-views.docblock.d.ts +6 -0
  57. package/dist/data-views/docs/data-views.docblock.js +21 -0
  58. package/dist/data-views/index.d.ts +4 -0
  59. package/dist/data-views/index.js +4 -0
  60. package/dist/data-views/query-generator.d.ts +40 -0
  61. package/dist/data-views/query-generator.js +48 -0
  62. package/dist/data-views/registry.d.ts +17 -0
  63. package/dist/data-views/registry.js +20 -0
  64. package/dist/data-views/runtime.d.ts +32 -0
  65. package/dist/data-views/runtime.js +68 -0
  66. package/dist/data-views/spec.d.ts +32 -0
  67. package/dist/data-views/spec.js +10 -0
  68. package/dist/data-views/types.d.ts +157 -0
  69. package/dist/data-views/types.js +0 -0
  70. package/dist/docs/accessibility_wcag_compliance_specs.docblock.d.ts +6 -0
  71. package/dist/docs/accessibility_wcag_compliance_specs.docblock.js +17 -0
  72. package/dist/docs/index.d.ts +6 -0
  73. package/dist/docs/index.js +30 -0
  74. package/dist/docs/meta.docs.d.ts +6 -0
  75. package/dist/docs/meta.docs.js +29 -0
  76. package/dist/docs/presentations.d.ts +31 -0
  77. package/dist/docs/presentations.js +57 -0
  78. package/dist/docs/registry.d.ts +23 -0
  79. package/dist/docs/registry.js +51 -0
  80. package/dist/docs/tech/auth/better-auth-nextjs.docblock.d.ts +6 -0
  81. package/dist/docs/tech/auth/better-auth-nextjs.docblock.js +81 -0
  82. package/dist/docs/tech/cli.docblock.d.ts +6 -0
  83. package/dist/docs/tech/cli.docblock.js +138 -0
  84. package/dist/docs/tech/contracts/README.docblock.d.ts +6 -0
  85. package/dist/docs/tech/contracts/README.docblock.js +21 -0
  86. package/dist/docs/tech/contracts/migrations.docblock.d.ts +6 -0
  87. package/dist/docs/tech/contracts/migrations.docblock.js +21 -0
  88. package/dist/docs/tech/contracts/openapi-export.docblock.d.ts +6 -0
  89. package/dist/docs/tech/contracts/openapi-export.docblock.js +58 -0
  90. package/dist/docs/tech/contracts/openapi-import.docblock.d.ts +6 -0
  91. package/dist/docs/tech/contracts/openapi-import.docblock.js +65 -0
  92. package/dist/docs/tech/contracts/ops-to-presentation-linking.docblock.d.ts +6 -0
  93. package/dist/docs/tech/contracts/ops-to-presentation-linking.docblock.js +21 -0
  94. package/dist/docs/tech/contracts/overlays.docblock.d.ts +6 -0
  95. package/dist/docs/tech/contracts/overlays.docblock.js +21 -0
  96. package/dist/docs/tech/contracts/tests.docblock.d.ts +6 -0
  97. package/dist/docs/tech/contracts/tests.docblock.js +21 -0
  98. package/dist/docs/tech/contracts/themes.docblock.d.ts +6 -0
  99. package/dist/docs/tech/contracts/themes.docblock.js +21 -0
  100. package/dist/docs/tech/contracts/vertical-pocket-family-office.docblock.d.ts +6 -0
  101. package/dist/docs/tech/contracts/vertical-pocket-family-office.docblock.js +126 -0
  102. package/dist/docs/tech/lifecycle-stage-system.docblock.d.ts +6 -0
  103. package/dist/docs/tech/lifecycle-stage-system.docblock.js +17 -0
  104. package/dist/docs/tech/llm/llm-integration.docblock.d.ts +7 -0
  105. package/dist/docs/tech/llm/llm-integration.docblock.js +358 -0
  106. package/dist/docs/tech/mcp-endpoints.docblock.d.ts +6 -0
  107. package/dist/docs/tech/mcp-endpoints.docblock.js +38 -0
  108. package/dist/docs/tech/presentation-runtime.docblock.d.ts +6 -0
  109. package/dist/docs/tech/presentation-runtime.docblock.js +17 -0
  110. package/dist/docs/tech/schema/README.docblock.d.ts +6 -0
  111. package/dist/docs/tech/schema/README.docblock.js +21 -0
  112. package/dist/docs/tech/studio/learning-events.docblock.d.ts +6 -0
  113. package/dist/docs/tech/studio/learning-events.docblock.js +49 -0
  114. package/dist/docs/tech/studio/learning-journeys.docblock.d.ts +6 -0
  115. package/dist/docs/tech/studio/learning-journeys.docblock.js +80 -0
  116. package/dist/docs/tech/studio/platform-admin-panel.docblock.d.ts +6 -0
  117. package/dist/docs/tech/studio/platform-admin-panel.docblock.js +85 -0
  118. package/dist/docs/tech/studio/project-access-teams.docblock.d.ts +6 -0
  119. package/dist/docs/tech/studio/project-access-teams.docblock.js +48 -0
  120. package/dist/docs/tech/studio/project-routing.docblock.d.ts +6 -0
  121. package/dist/docs/tech/studio/project-routing.docblock.js +68 -0
  122. package/dist/docs/tech/studio/sandbox-unlogged.docblock.d.ts +6 -0
  123. package/dist/docs/tech/studio/sandbox-unlogged.docblock.js +41 -0
  124. package/dist/docs/tech/studio/team-invitations.docblock.d.ts +6 -0
  125. package/dist/docs/tech/studio/team-invitations.docblock.js +70 -0
  126. package/dist/docs/tech/studio/workspace-ops.docblock.d.ts +6 -0
  127. package/dist/docs/tech/studio/workspace-ops.docblock.js +48 -0
  128. package/dist/docs/tech/studio/workspaces.docblock.d.ts +6 -0
  129. package/dist/docs/tech/studio/workspaces.docblock.js +63 -0
  130. package/dist/docs/tech/telemetry-ingest.docblock.d.ts +6 -0
  131. package/dist/docs/tech/telemetry-ingest.docblock.js +156 -0
  132. package/dist/docs/tech/vscode-extension.docblock.d.ts +6 -0
  133. package/dist/docs/tech/vscode-extension.docblock.js +102 -0
  134. package/dist/docs/tech-contracts.docs.d.ts +6 -0
  135. package/dist/docs/tech-contracts.docs.js +96 -0
  136. package/dist/docs/types.d.ts +41 -0
  137. package/dist/docs/types.js +0 -0
  138. package/dist/events.d.ts +47 -0
  139. package/dist/events.js +19 -0
  140. package/dist/examples/docs/examples.docblock.d.ts +6 -0
  141. package/dist/examples/docs/examples.docblock.js +165 -0
  142. package/dist/examples/index.d.ts +13 -0
  143. package/dist/examples/index.js +13 -0
  144. package/dist/examples/registry.d.ts +43 -0
  145. package/dist/examples/registry.js +88 -0
  146. package/dist/examples/schema.d.ts +282 -0
  147. package/dist/examples/schema.js +125 -0
  148. package/dist/examples/types.d.ts +167 -0
  149. package/dist/examples/types.js +43 -0
  150. package/dist/examples/validation.d.ts +65 -0
  151. package/dist/examples/validation.js +144 -0
  152. package/dist/experiments/docs/experiments.docblock.d.ts +6 -0
  153. package/dist/experiments/docs/experiments.docblock.js +21 -0
  154. package/dist/experiments/evaluator.d.ts +37 -0
  155. package/dist/experiments/evaluator.js +101 -0
  156. package/dist/experiments/spec-resolver.d.ts +17 -0
  157. package/dist/experiments/spec-resolver.js +0 -0
  158. package/dist/experiments/spec.d.ts +80 -0
  159. package/dist/experiments/spec.js +15 -0
  160. package/dist/features/index.d.ts +13 -0
  161. package/dist/features/index.js +12 -0
  162. package/dist/features/install.d.ts +22 -0
  163. package/dist/features/install.js +36 -0
  164. package/dist/features/registry.d.ts +26 -0
  165. package/dist/features/registry.js +49 -0
  166. package/dist/features/types.d.ts +88 -0
  167. package/dist/features/types.js +0 -0
  168. package/dist/features/validation.d.ts +8 -0
  169. package/dist/features/validation.js +14 -0
  170. package/dist/forms/docs/forms.docblock.d.ts +6 -0
  171. package/dist/forms/docs/forms.docblock.js +21 -0
  172. package/dist/forms/forms.d.ts +266 -0
  173. package/dist/forms/forms.js +143 -0
  174. package/dist/forms/index.d.ts +2 -0
  175. package/dist/forms/index.js +3 -0
  176. package/dist/index.d.ts +154 -0
  177. package/dist/index.js +132 -0
  178. package/dist/install.d.ts +77 -0
  179. package/dist/install.js +40 -0
  180. package/dist/integrations/binding.d.ts +17 -0
  181. package/dist/integrations/binding.js +0 -0
  182. package/dist/integrations/connection.d.ts +51 -0
  183. package/dist/integrations/connection.js +0 -0
  184. package/dist/integrations/docs/integrations.docblock.d.ts +6 -0
  185. package/dist/integrations/docs/integrations.docblock.js +94 -0
  186. package/dist/integrations/health.d.ts +21 -0
  187. package/dist/integrations/health.js +69 -0
  188. package/dist/integrations/index.d.ts +34 -0
  189. package/dist/integrations/index.js +23 -0
  190. package/dist/integrations/integrations.capability.d.ts +7 -0
  191. package/dist/integrations/integrations.capability.js +17 -0
  192. package/dist/integrations/integrations.feature.d.ts +11 -0
  193. package/dist/integrations/integrations.feature.js +67 -0
  194. package/dist/integrations/openbanking/contracts/accounts.d.ts +289 -0
  195. package/dist/integrations/openbanking/contracts/accounts.js +236 -0
  196. package/dist/integrations/openbanking/contracts/balances.d.ts +165 -0
  197. package/dist/integrations/openbanking/contracts/balances.js +166 -0
  198. package/dist/integrations/openbanking/contracts/index.d.ts +10 -0
  199. package/dist/integrations/openbanking/contracts/index.js +12 -0
  200. package/dist/integrations/openbanking/contracts/transactions.d.ts +213 -0
  201. package/dist/integrations/openbanking/contracts/transactions.js +217 -0
  202. package/dist/integrations/openbanking/guards.d.ts +12 -0
  203. package/dist/integrations/openbanking/guards.js +33 -0
  204. package/dist/integrations/openbanking/models.d.ts +228 -0
  205. package/dist/integrations/openbanking/models.js +240 -0
  206. package/dist/integrations/openbanking/openbanking.capability.d.ts +7 -0
  207. package/dist/integrations/openbanking/openbanking.capability.js +21 -0
  208. package/dist/integrations/openbanking/openbanking.feature.d.ts +11 -0
  209. package/dist/integrations/openbanking/openbanking.feature.js +76 -0
  210. package/dist/integrations/openbanking/telemetry.d.ts +15 -0
  211. package/dist/integrations/openbanking/telemetry.js +39 -0
  212. package/dist/integrations/operations.d.ts +437 -0
  213. package/dist/integrations/operations.js +392 -0
  214. package/dist/integrations/providers/calendar.d.ts +78 -0
  215. package/dist/integrations/providers/calendar.js +0 -0
  216. package/dist/integrations/providers/elevenlabs.d.ts +8 -0
  217. package/dist/integrations/providers/elevenlabs.js +56 -0
  218. package/dist/integrations/providers/email.d.ts +86 -0
  219. package/dist/integrations/providers/email.js +0 -0
  220. package/dist/integrations/providers/embedding.d.ts +24 -0
  221. package/dist/integrations/providers/embedding.js +0 -0
  222. package/dist/integrations/providers/gcs-storage.d.ts +8 -0
  223. package/dist/integrations/providers/gcs-storage.js +79 -0
  224. package/dist/integrations/providers/gmail.d.ts +8 -0
  225. package/dist/integrations/providers/gmail.js +91 -0
  226. package/dist/integrations/providers/google-calendar.d.ts +8 -0
  227. package/dist/integrations/providers/google-calendar.js +70 -0
  228. package/dist/integrations/providers/impls/elevenlabs-voice.d.ts +20 -0
  229. package/dist/integrations/providers/impls/elevenlabs-voice.js +95 -0
  230. package/dist/integrations/providers/impls/gcs-storage.d.ts +24 -0
  231. package/dist/integrations/providers/impls/gcs-storage.js +88 -0
  232. package/dist/integrations/providers/impls/gmail-inbound.d.ts +26 -0
  233. package/dist/integrations/providers/impls/gmail-inbound.js +200 -0
  234. package/dist/integrations/providers/impls/gmail-outbound.d.ts +18 -0
  235. package/dist/integrations/providers/impls/gmail-outbound.js +105 -0
  236. package/dist/integrations/providers/impls/google-calendar.d.ts +23 -0
  237. package/dist/integrations/providers/impls/google-calendar.js +154 -0
  238. package/dist/integrations/providers/impls/index.d.ts +15 -0
  239. package/dist/integrations/providers/impls/index.js +16 -0
  240. package/dist/integrations/providers/impls/mistral-embedding.d.ts +23 -0
  241. package/dist/integrations/providers/impls/mistral-embedding.js +41 -0
  242. package/dist/integrations/providers/impls/mistral-llm.d.ts +31 -0
  243. package/dist/integrations/providers/impls/mistral-llm.js +247 -0
  244. package/dist/integrations/providers/impls/postmark-email.d.ts +19 -0
  245. package/dist/integrations/providers/impls/postmark-email.js +55 -0
  246. package/dist/integrations/providers/impls/powens-client.d.ts +124 -0
  247. package/dist/integrations/providers/impls/powens-client.js +171 -0
  248. package/dist/integrations/providers/impls/powens-openbanking.d.ts +27 -0
  249. package/dist/integrations/providers/impls/powens-openbanking.js +218 -0
  250. package/dist/integrations/providers/impls/provider-factory.d.ts +26 -0
  251. package/dist/integrations/providers/impls/provider-factory.js +146 -0
  252. package/dist/integrations/providers/impls/qdrant-vector.d.ts +24 -0
  253. package/dist/integrations/providers/impls/qdrant-vector.js +69 -0
  254. package/dist/integrations/providers/impls/stripe-payments.d.ts +28 -0
  255. package/dist/integrations/providers/impls/stripe-payments.js +202 -0
  256. package/dist/integrations/providers/impls/twilio-sms.d.ts +20 -0
  257. package/dist/integrations/providers/impls/twilio-sms.js +58 -0
  258. package/dist/integrations/providers/index.d.ts +22 -0
  259. package/dist/integrations/providers/index.js +13 -0
  260. package/dist/integrations/providers/llm.d.ts +82 -0
  261. package/dist/integrations/providers/llm.js +0 -0
  262. package/dist/integrations/providers/mistral.d.ts +8 -0
  263. package/dist/integrations/providers/mistral.js +72 -0
  264. package/dist/integrations/providers/openbanking.d.ts +128 -0
  265. package/dist/integrations/providers/openbanking.js +0 -0
  266. package/dist/integrations/providers/payments.d.ts +109 -0
  267. package/dist/integrations/providers/payments.js +0 -0
  268. package/dist/integrations/providers/postmark.d.ts +8 -0
  269. package/dist/integrations/providers/postmark.js +72 -0
  270. package/dist/integrations/providers/powens.d.ts +8 -0
  271. package/dist/integrations/providers/powens.js +120 -0
  272. package/dist/integrations/providers/qdrant.d.ts +8 -0
  273. package/dist/integrations/providers/qdrant.js +77 -0
  274. package/dist/integrations/providers/registry.d.ts +11 -0
  275. package/dist/integrations/providers/registry.js +34 -0
  276. package/dist/integrations/providers/sms.d.ts +34 -0
  277. package/dist/integrations/providers/sms.js +0 -0
  278. package/dist/integrations/providers/storage.d.ts +60 -0
  279. package/dist/integrations/providers/storage.js +0 -0
  280. package/dist/integrations/providers/stripe.d.ts +8 -0
  281. package/dist/integrations/providers/stripe.js +87 -0
  282. package/dist/integrations/providers/twilio-sms.d.ts +8 -0
  283. package/dist/integrations/providers/twilio-sms.js +65 -0
  284. package/dist/integrations/providers/vector-store.d.ts +43 -0
  285. package/dist/integrations/providers/vector-store.js +0 -0
  286. package/dist/integrations/providers/voice.d.ts +34 -0
  287. package/dist/integrations/providers/voice.js +0 -0
  288. package/dist/integrations/runtime.d.ts +99 -0
  289. package/dist/integrations/runtime.js +186 -0
  290. package/dist/integrations/secrets/aws-secret-manager.d.ts +31 -0
  291. package/dist/integrations/secrets/aws-secret-manager.js +231 -0
  292. package/dist/integrations/secrets/env-secret-provider.d.ts +31 -0
  293. package/dist/integrations/secrets/env-secret-provider.js +81 -0
  294. package/dist/integrations/secrets/gcp-secret-manager.d.ts +32 -0
  295. package/dist/integrations/secrets/gcp-secret-manager.js +229 -0
  296. package/dist/integrations/secrets/index.d.ts +7 -0
  297. package/dist/integrations/secrets/index.js +8 -0
  298. package/dist/integrations/secrets/manager.d.ts +47 -0
  299. package/dist/integrations/secrets/manager.js +103 -0
  300. package/dist/integrations/secrets/provider.d.ts +52 -0
  301. package/dist/integrations/secrets/provider.js +58 -0
  302. package/dist/integrations/secrets/scaleway-secret-manager.d.ts +38 -0
  303. package/dist/integrations/secrets/scaleway-secret-manager.js +247 -0
  304. package/dist/integrations/secrets-types.d.ts +17 -0
  305. package/dist/integrations/secrets-types.js +0 -0
  306. package/dist/integrations/spec.d.ts +77 -0
  307. package/dist/integrations/spec.js +22 -0
  308. package/dist/jobs/define-job.d.ts +18 -0
  309. package/dist/jobs/define-job.js +16 -0
  310. package/dist/jobs/gcp-cloud-tasks.d.ts +41 -0
  311. package/dist/jobs/gcp-cloud-tasks.js +53 -0
  312. package/dist/jobs/gcp-pubsub.d.ts +25 -0
  313. package/dist/jobs/gcp-pubsub.js +39 -0
  314. package/dist/jobs/handlers/gmail-sync-handler.d.ts +9 -0
  315. package/dist/jobs/handlers/gmail-sync-handler.js +9 -0
  316. package/dist/jobs/handlers/index.d.ts +9 -0
  317. package/dist/jobs/handlers/index.js +12 -0
  318. package/dist/jobs/handlers/ping-handler.d.ts +10 -0
  319. package/dist/jobs/handlers/ping-handler.js +15 -0
  320. package/dist/jobs/handlers/storage-document-handler.d.ts +12 -0
  321. package/dist/jobs/handlers/storage-document-handler.js +14 -0
  322. package/dist/jobs/index.d.ts +3 -0
  323. package/dist/jobs/index.js +4 -0
  324. package/dist/jobs/memory-queue.d.ts +18 -0
  325. package/dist/jobs/memory-queue.js +71 -0
  326. package/dist/jobs/queue.d.ts +131 -0
  327. package/dist/jobs/queue.js +33 -0
  328. package/dist/jobs/scaleway-sqs-queue.d.ts +30 -0
  329. package/dist/jobs/scaleway-sqs-queue.js +153 -0
  330. package/dist/jsonschema.d.ts +42 -0
  331. package/dist/jsonschema.js +51 -0
  332. package/dist/knowledge/binding.d.ts +25 -0
  333. package/dist/knowledge/binding.js +0 -0
  334. package/dist/knowledge/docs/knowledge.docblock.d.ts +6 -0
  335. package/dist/knowledge/docs/knowledge.docblock.js +21 -0
  336. package/dist/knowledge/index.d.ts +11 -0
  337. package/dist/knowledge/index.js +10 -0
  338. package/dist/knowledge/ingestion/document-processor.d.ts +24 -0
  339. package/dist/knowledge/ingestion/document-processor.js +54 -0
  340. package/dist/knowledge/ingestion/embedding-service.d.ts +12 -0
  341. package/dist/knowledge/ingestion/embedding-service.js +25 -0
  342. package/dist/knowledge/ingestion/gmail-adapter.d.ts +18 -0
  343. package/dist/knowledge/ingestion/gmail-adapter.js +51 -0
  344. package/dist/knowledge/ingestion/index.d.ts +6 -0
  345. package/dist/knowledge/ingestion/index.js +7 -0
  346. package/dist/knowledge/ingestion/storage-adapter.d.ts +15 -0
  347. package/dist/knowledge/ingestion/storage-adapter.js +26 -0
  348. package/dist/knowledge/ingestion/vector-indexer.d.ts +18 -0
  349. package/dist/knowledge/ingestion/vector-indexer.js +32 -0
  350. package/dist/knowledge/knowledge.capability.d.ts +7 -0
  351. package/dist/knowledge/knowledge.capability.js +21 -0
  352. package/dist/knowledge/knowledge.feature.d.ts +11 -0
  353. package/dist/knowledge/knowledge.feature.js +68 -0
  354. package/dist/knowledge/operations.d.ts +318 -0
  355. package/dist/knowledge/operations.js +321 -0
  356. package/dist/knowledge/query/index.d.ts +2 -0
  357. package/dist/knowledge/query/index.js +3 -0
  358. package/dist/knowledge/query/service.d.ts +29 -0
  359. package/dist/knowledge/query/service.js +65 -0
  360. package/dist/knowledge/runtime.d.ts +32 -0
  361. package/dist/knowledge/runtime.js +49 -0
  362. package/dist/knowledge/source.d.ts +32 -0
  363. package/dist/knowledge/source.js +0 -0
  364. package/dist/knowledge/spaces/email-threads.d.ts +7 -0
  365. package/dist/knowledge/spaces/email-threads.js +37 -0
  366. package/dist/knowledge/spaces/financial-docs.d.ts +7 -0
  367. package/dist/knowledge/spaces/financial-docs.js +37 -0
  368. package/dist/knowledge/spaces/financial-overview.d.ts +7 -0
  369. package/dist/knowledge/spaces/financial-overview.js +41 -0
  370. package/dist/knowledge/spaces/index.d.ts +7 -0
  371. package/dist/knowledge/spaces/index.js +8 -0
  372. package/dist/knowledge/spaces/product-canon.d.ts +7 -0
  373. package/dist/knowledge/spaces/product-canon.js +37 -0
  374. package/dist/knowledge/spaces/support-faq.d.ts +7 -0
  375. package/dist/knowledge/spaces/support-faq.js +40 -0
  376. package/dist/knowledge/spaces/uploaded-docs.d.ts +7 -0
  377. package/dist/knowledge/spaces/uploaded-docs.js +37 -0
  378. package/dist/knowledge/spec.d.ts +46 -0
  379. package/dist/knowledge/spec.js +17 -0
  380. package/dist/llm/exporters.d.ts +70 -0
  381. package/dist/llm/exporters.js +542 -0
  382. package/dist/llm/index.d.ts +4 -0
  383. package/dist/llm/index.js +4 -0
  384. package/dist/llm/prompts.d.ts +52 -0
  385. package/dist/llm/prompts.js +410 -0
  386. package/dist/llm/types.d.ts +215 -0
  387. package/dist/llm/types.js +0 -0
  388. package/dist/markdown.d.ts +22 -0
  389. package/dist/markdown.js +119 -0
  390. package/dist/migrations.d.ts +52 -0
  391. package/dist/migrations.js +31 -0
  392. package/dist/model-registry.d.ts +13 -0
  393. package/dist/model-registry.js +33 -0
  394. package/dist/onboarding-base.d.ts +138 -0
  395. package/dist/onboarding-base.js +195 -0
  396. package/dist/openapi.d.ts +31 -0
  397. package/dist/openapi.js +82 -0
  398. package/dist/operations/index.d.ts +3 -0
  399. package/dist/operations/index.js +4 -0
  400. package/dist/operations/operation.d.ts +186 -0
  401. package/dist/operations/operation.js +35 -0
  402. package/dist/operations/registry.d.ts +54 -0
  403. package/dist/operations/registry.js +176 -0
  404. package/dist/ownership.d.ts +84 -0
  405. package/dist/ownership.js +38 -0
  406. package/dist/policy/docs/policy.docblock.d.ts +6 -0
  407. package/dist/policy/docs/policy.docblock.js +21 -0
  408. package/dist/policy/engine.d.ts +40 -0
  409. package/dist/policy/engine.js +225 -0
  410. package/dist/policy/index.d.ts +5 -0
  411. package/dist/policy/index.js +5 -0
  412. package/dist/policy/opa-adapter.d.ts +45 -0
  413. package/dist/policy/opa-adapter.js +71 -0
  414. package/dist/policy/registry.d.ts +9 -0
  415. package/dist/policy/registry.js +11 -0
  416. package/dist/policy/spec.d.ts +103 -0
  417. package/dist/policy/spec.js +0 -0
  418. package/dist/presentations/docs/presentations-conventions.docblock.d.ts +6 -0
  419. package/dist/presentations/docs/presentations-conventions.docblock.js +21 -0
  420. package/dist/presentations/index.d.ts +4 -0
  421. package/dist/presentations/index.js +5 -0
  422. package/dist/presentations/presentations.d.ts +50 -0
  423. package/dist/presentations/presentations.js +7 -0
  424. package/dist/presentations/registry.d.ts +10 -0
  425. package/dist/presentations/registry.js +12 -0
  426. package/dist/presentations/transform-engine.d.ts +66 -0
  427. package/dist/presentations/transform-engine.js +282 -0
  428. package/dist/prompt.d.ts +53 -0
  429. package/dist/prompt.js +10 -0
  430. package/dist/promptRegistry.d.ts +15 -0
  431. package/dist/promptRegistry.js +31 -0
  432. package/dist/regenerator/adapters.d.ts +19 -0
  433. package/dist/regenerator/adapters.js +0 -0
  434. package/dist/regenerator/docs/regenerator.docblock.d.ts +6 -0
  435. package/dist/regenerator/docs/regenerator.docblock.js +21 -0
  436. package/dist/regenerator/executor.d.ts +70 -0
  437. package/dist/regenerator/executor.js +86 -0
  438. package/dist/regenerator/index.d.ts +7 -0
  439. package/dist/regenerator/index.js +6 -0
  440. package/dist/regenerator/service.d.ts +33 -0
  441. package/dist/regenerator/service.js +93 -0
  442. package/dist/regenerator/sinks.d.ts +26 -0
  443. package/dist/regenerator/sinks.js +32 -0
  444. package/dist/regenerator/types.d.ts +107 -0
  445. package/dist/regenerator/types.js +0 -0
  446. package/dist/regenerator/utils.d.ts +9 -0
  447. package/dist/regenerator/utils.js +51 -0
  448. package/dist/registry-utils.d.ts +106 -0
  449. package/dist/registry-utils.js +122 -0
  450. package/dist/registry.d.ts +32 -0
  451. package/dist/registry.js +61 -0
  452. package/dist/resources.d.ts +64 -0
  453. package/dist/resources.js +50 -0
  454. package/dist/schema-to-markdown.d.ts +54 -0
  455. package/dist/schema-to-markdown.js +217 -0
  456. package/dist/server/contracts-adapter-hydration.d.ts +15 -0
  457. package/dist/server/contracts-adapter-hydration.js +41 -0
  458. package/dist/server/contracts-adapter-input.d.ts +9 -0
  459. package/dist/server/contracts-adapter-input.js +83 -0
  460. package/dist/server/graphql-pothos.d.ts +31 -0
  461. package/dist/server/graphql-pothos.js +134 -0
  462. package/dist/server/index.d.ts +9 -0
  463. package/dist/server/index.js +10 -0
  464. package/dist/server/mcp/createMcpServer.d.ts +15 -0
  465. package/dist/server/mcp/createMcpServer.js +27 -0
  466. package/dist/server/mcp/mcpTypes.d.ts +27 -0
  467. package/dist/server/mcp/mcpTypes.js +0 -0
  468. package/dist/server/mcp/registerPresentations.d.ts +7 -0
  469. package/dist/server/mcp/registerPresentations.js +54 -0
  470. package/dist/server/mcp/registerPrompts.d.ts +8 -0
  471. package/dist/server/mcp/registerPrompts.js +41 -0
  472. package/dist/server/mcp/registerResources.d.ts +8 -0
  473. package/dist/server/mcp/registerResources.js +35 -0
  474. package/dist/server/mcp/registerTools.d.ts +8 -0
  475. package/dist/server/mcp/registerTools.js +22 -0
  476. package/dist/server/provider-mcp.d.ts +2 -0
  477. package/dist/server/provider-mcp.js +3 -0
  478. package/dist/server/rest-elysia.d.ts +40 -0
  479. package/dist/server/rest-elysia.js +20 -0
  480. package/dist/server/rest-express.d.ts +16 -0
  481. package/dist/server/rest-express.js +36 -0
  482. package/dist/server/rest-generic.d.ts +32 -0
  483. package/dist/server/rest-generic.js +124 -0
  484. package/dist/server/rest-next-app.d.ts +35 -0
  485. package/dist/server/rest-next-app.js +38 -0
  486. package/dist/server/rest-next-mcp.d.ts +11 -0
  487. package/dist/server/rest-next-mcp.js +45 -0
  488. package/dist/server/rest-next-pages.d.ts +9 -0
  489. package/dist/server/rest-next-pages.js +22 -0
  490. package/dist/telemetry/anomaly.d.ts +27 -0
  491. package/dist/telemetry/anomaly.js +48 -0
  492. package/dist/telemetry/docs/telemetry.docblock.d.ts +6 -0
  493. package/dist/telemetry/docs/telemetry.docblock.js +21 -0
  494. package/dist/telemetry/index.d.ts +4 -0
  495. package/dist/telemetry/index.js +5 -0
  496. package/dist/telemetry/spec.d.ts +91 -0
  497. package/dist/telemetry/spec.js +42 -0
  498. package/dist/telemetry/tracker.d.ts +51 -0
  499. package/dist/telemetry/tracker.js +76 -0
  500. package/dist/tests/index.d.ts +3 -0
  501. package/dist/tests/index.js +4 -0
  502. package/dist/tests/runner.d.ts +43 -0
  503. package/dist/tests/runner.js +150 -0
  504. package/dist/tests/spec.d.ts +82 -0
  505. package/dist/tests/spec.js +34 -0
  506. package/dist/themes.d.ts +51 -0
  507. package/dist/themes.js +17 -0
  508. package/dist/translations/catalog.d.ts +28 -0
  509. package/dist/translations/catalog.js +0 -0
  510. package/dist/translations/tenant.d.ts +15 -0
  511. package/dist/translations/tenant.js +0 -0
  512. package/dist/types.d.ts +92 -0
  513. package/dist/types.js +0 -0
  514. package/dist/versioning/index.d.ts +3 -0
  515. package/dist/versioning/index.js +4 -0
  516. package/dist/versioning/types.d.ts +127 -0
  517. package/dist/versioning/types.js +24 -0
  518. package/dist/versioning/utils.d.ts +95 -0
  519. package/dist/versioning/utils.js +180 -0
  520. package/dist/workflow/adapters/db-adapter.d.ts +46 -0
  521. package/dist/workflow/adapters/db-adapter.js +83 -0
  522. package/dist/workflow/adapters/file-adapter.d.ts +14 -0
  523. package/dist/workflow/adapters/file-adapter.js +11 -0
  524. package/dist/workflow/adapters/index.d.ts +4 -0
  525. package/dist/workflow/adapters/index.js +5 -0
  526. package/dist/workflow/adapters/memory-store.d.ts +18 -0
  527. package/dist/workflow/adapters/memory-store.js +58 -0
  528. package/dist/workflow/expression.d.ts +9 -0
  529. package/dist/workflow/expression.js +99 -0
  530. package/dist/workflow/index.d.ts +17 -0
  531. package/dist/workflow/index.js +16 -0
  532. package/dist/workflow/overview.docblock.d.ts +6 -0
  533. package/dist/workflow/overview.docblock.js +21 -0
  534. package/dist/workflow/runner.d.ts +77 -0
  535. package/dist/workflow/runner.js +337 -0
  536. package/dist/workflow/sla-monitor.d.ts +20 -0
  537. package/dist/workflow/sla-monitor.js +47 -0
  538. package/dist/workflow/spec.d.ts +93 -0
  539. package/dist/workflow/spec.js +11 -0
  540. package/dist/workflow/state.d.ts +35 -0
  541. package/dist/workflow/state.js +0 -0
  542. package/dist/workflow/validation.d.ts +29 -0
  543. package/dist/workflow/validation.js +176 -0
  544. package/dist/workspace-config/contractsrc-schema.d.ts +1162 -0
  545. package/dist/workspace-config/contractsrc-schema.js +421 -0
  546. package/dist/workspace-config/index.d.ts +2 -0
  547. package/dist/workspace-config/index.js +3 -0
  548. package/dist/workspace-config/workspace-config.docblock.d.ts +6 -0
  549. package/dist/workspace-config/workspace-config.docblock.js +45 -0
  550. package/package.json +618 -0
@@ -0,0 +1,395 @@
1
+ import { OwnersEnum, StabilityEnum, TagsEnum } from "../ownership.js";
2
+ import { defineCommand, defineQuery } from "../operations/operation.js";
3
+ import "../operations/index.js";
4
+ import { ScalarTypeEnum, SchemaModel } from "@contractspec/lib.schema";
5
+
6
+ //#region src/app-config/contracts.ts
7
+ const BrandingAssetInput = new SchemaModel({
8
+ name: "BrandingAssetInput",
9
+ fields: {
10
+ type: {
11
+ type: ScalarTypeEnum.String_unsecure(),
12
+ isOptional: false
13
+ },
14
+ url: {
15
+ type: ScalarTypeEnum.URL(),
16
+ isOptional: false
17
+ },
18
+ mimeType: {
19
+ type: ScalarTypeEnum.String_unsecure(),
20
+ isOptional: true
21
+ }
22
+ }
23
+ });
24
+ const UpdateTenantBrandingInput = new SchemaModel({
25
+ name: "UpdateTenantBrandingInput",
26
+ fields: {
27
+ tenantId: {
28
+ type: ScalarTypeEnum.ID(),
29
+ isOptional: false
30
+ },
31
+ appId: {
32
+ type: ScalarTypeEnum.ID(),
33
+ isOptional: false
34
+ },
35
+ environment: {
36
+ type: ScalarTypeEnum.String_unsecure(),
37
+ isOptional: true
38
+ },
39
+ appName: {
40
+ type: ScalarTypeEnum.JSONObject(),
41
+ isOptional: true
42
+ },
43
+ assets: {
44
+ type: BrandingAssetInput,
45
+ isOptional: true,
46
+ isArray: true
47
+ },
48
+ colors: {
49
+ type: ScalarTypeEnum.JSONObject(),
50
+ isOptional: true
51
+ },
52
+ customDomain: {
53
+ type: ScalarTypeEnum.String_unsecure(),
54
+ isOptional: true
55
+ },
56
+ subdomain: {
57
+ type: ScalarTypeEnum.String_unsecure(),
58
+ isOptional: true
59
+ }
60
+ }
61
+ });
62
+ const UpdateTenantBrandingOutput = new SchemaModel({
63
+ name: "UpdateTenantBrandingOutput",
64
+ fields: {
65
+ success: {
66
+ type: ScalarTypeEnum.Boolean(),
67
+ isOptional: false
68
+ },
69
+ updatedAt: {
70
+ type: ScalarTypeEnum.DateTime(),
71
+ isOptional: false
72
+ }
73
+ }
74
+ });
75
+ const VerifyCustomDomainInput = new SchemaModel({
76
+ name: "VerifyCustomDomainInput",
77
+ fields: {
78
+ tenantId: {
79
+ type: ScalarTypeEnum.ID(),
80
+ isOptional: false
81
+ },
82
+ appId: {
83
+ type: ScalarTypeEnum.ID(),
84
+ isOptional: false
85
+ },
86
+ domain: {
87
+ type: ScalarTypeEnum.String_unsecure(),
88
+ isOptional: false
89
+ }
90
+ }
91
+ });
92
+ const VerifyCustomDomainOutput = new SchemaModel({
93
+ name: "VerifyCustomDomainOutput",
94
+ fields: {
95
+ status: {
96
+ type: ScalarTypeEnum.String_unsecure(),
97
+ isOptional: false
98
+ },
99
+ message: {
100
+ type: ScalarTypeEnum.String_unsecure(),
101
+ isOptional: true
102
+ }
103
+ }
104
+ });
105
+ const TranslationEntryInput = new SchemaModel({
106
+ name: "TranslationEntryInput",
107
+ fields: {
108
+ key: {
109
+ type: ScalarTypeEnum.String_unsecure(),
110
+ isOptional: false
111
+ },
112
+ locale: {
113
+ type: ScalarTypeEnum.String_unsecure(),
114
+ isOptional: false
115
+ },
116
+ value: {
117
+ type: ScalarTypeEnum.String_unsecure(),
118
+ isOptional: false
119
+ },
120
+ context: {
121
+ type: ScalarTypeEnum.String_unsecure(),
122
+ isOptional: true
123
+ }
124
+ }
125
+ });
126
+ const UpdateBlueprintTranslationInput = new SchemaModel({
127
+ name: "UpdateBlueprintTranslationInput",
128
+ fields: {
129
+ blueprintName: {
130
+ type: ScalarTypeEnum.String_unsecure(),
131
+ isOptional: false
132
+ },
133
+ blueprintVersion: {
134
+ type: ScalarTypeEnum.Int_unsecure(),
135
+ isOptional: false
136
+ },
137
+ catalogName: {
138
+ type: ScalarTypeEnum.String_unsecure(),
139
+ isOptional: false
140
+ },
141
+ catalogVersion: {
142
+ type: ScalarTypeEnum.String_unsecure(),
143
+ isOptional: false
144
+ },
145
+ defaultLocale: {
146
+ type: ScalarTypeEnum.String_unsecure(),
147
+ isOptional: false
148
+ },
149
+ supportedLocales: {
150
+ type: ScalarTypeEnum.String_unsecure(),
151
+ isOptional: false,
152
+ isArray: true
153
+ },
154
+ entries: {
155
+ type: TranslationEntryInput,
156
+ isOptional: false,
157
+ isArray: true
158
+ }
159
+ }
160
+ });
161
+ const UpdateTenantTranslationInput = new SchemaModel({
162
+ name: "UpdateTenantTranslationInput",
163
+ fields: {
164
+ tenantId: {
165
+ type: ScalarTypeEnum.ID(),
166
+ isOptional: false
167
+ },
168
+ appId: {
169
+ type: ScalarTypeEnum.ID(),
170
+ isOptional: false
171
+ },
172
+ entries: {
173
+ type: TranslationEntryInput,
174
+ isOptional: false,
175
+ isArray: true
176
+ },
177
+ defaultLocale: {
178
+ type: ScalarTypeEnum.String_unsecure(),
179
+ isOptional: true
180
+ },
181
+ enabledLocales: {
182
+ type: ScalarTypeEnum.String_unsecure(),
183
+ isOptional: true,
184
+ isArray: true
185
+ }
186
+ }
187
+ });
188
+ const MessageResolutionInput = new SchemaModel({
189
+ name: "MessageResolutionInput",
190
+ fields: {
191
+ tenantId: {
192
+ type: ScalarTypeEnum.ID(),
193
+ isOptional: false
194
+ },
195
+ appId: {
196
+ type: ScalarTypeEnum.ID(),
197
+ isOptional: false
198
+ },
199
+ locale: {
200
+ type: ScalarTypeEnum.String_unsecure(),
201
+ isOptional: false
202
+ },
203
+ key: {
204
+ type: ScalarTypeEnum.String_unsecure(),
205
+ isOptional: false
206
+ }
207
+ }
208
+ });
209
+ const MessageResolutionOutput = new SchemaModel({
210
+ name: "MessageResolutionOutput",
211
+ fields: {
212
+ value: {
213
+ type: ScalarTypeEnum.String_unsecure(),
214
+ isOptional: true
215
+ },
216
+ source: {
217
+ type: ScalarTypeEnum.String_unsecure(),
218
+ isOptional: true
219
+ }
220
+ }
221
+ });
222
+ const UpdateTenantBrandingCommand = defineCommand({
223
+ meta: {
224
+ key: "appConfig.updateTenantBranding",
225
+ version: "1.0.0",
226
+ description: "Applies tenant branding overrides (names, assets, domains).",
227
+ owners: [OwnersEnum.PlatformSigil],
228
+ tags: ["branding"],
229
+ stability: StabilityEnum.Beta,
230
+ goal: "Maintain tenant-specific branding assets and domains.",
231
+ context: "Invoked by the Studio or automation when a tenant updates branding settings."
232
+ },
233
+ io: {
234
+ input: UpdateTenantBrandingInput,
235
+ output: UpdateTenantBrandingOutput
236
+ },
237
+ policy: {
238
+ auth: "admin",
239
+ policies: [{
240
+ key: "platform.app-config.manage",
241
+ version: "1.0.0"
242
+ }]
243
+ }
244
+ });
245
+ const VerifyCustomDomainCommand = defineCommand({
246
+ meta: {
247
+ key: "appConfig.verifyCustomDomain",
248
+ version: "1.0.0",
249
+ description: "Validates DNS ownership for tenant custom domains.",
250
+ owners: [OwnersEnum.PlatformSigil],
251
+ tags: ["branding"],
252
+ stability: StabilityEnum.Experimental,
253
+ goal: "Confirm tenant-provided domains before activation.",
254
+ context: "Triggered after the tenant adds DNS records to verify domain ownership."
255
+ },
256
+ io: {
257
+ input: VerifyCustomDomainInput,
258
+ output: VerifyCustomDomainOutput
259
+ },
260
+ policy: {
261
+ auth: "admin",
262
+ policies: [{
263
+ key: "platform.app-config.manage",
264
+ version: "1.0.0"
265
+ }]
266
+ }
267
+ });
268
+ const UpdateBlueprintTranslationCatalogCommand = defineCommand({
269
+ meta: {
270
+ key: "appConfig.updateBlueprintTranslationCatalog",
271
+ version: "1.0.0",
272
+ description: "Registers or updates translation entries for a blueprint.",
273
+ owners: [OwnersEnum.PlatformSigil],
274
+ tags: [TagsEnum.I18n],
275
+ stability: StabilityEnum.Beta,
276
+ goal: "Keep blueprint translation catalogs in sync with shipped copy.",
277
+ context: "Executed by platform automation or CI when committing updated translation catalogs."
278
+ },
279
+ io: {
280
+ input: UpdateBlueprintTranslationInput,
281
+ output: UpdateTenantBrandingOutput
282
+ },
283
+ policy: {
284
+ auth: "admin",
285
+ policies: [{
286
+ key: "platform.app-config.manage",
287
+ version: "1.0.0"
288
+ }]
289
+ }
290
+ });
291
+ const UpdateTenantTranslationOverridesCommand = defineCommand({
292
+ meta: {
293
+ key: "appConfig.updateTenantTranslations",
294
+ version: "1.0.0",
295
+ description: "Applies tenant-specific translation entries.",
296
+ owners: [OwnersEnum.PlatformSigil],
297
+ tags: [TagsEnum.I18n],
298
+ stability: StabilityEnum.Beta,
299
+ goal: "Allow tenants to override selected message keys.",
300
+ context: "Called by the Studio when a tenant customizes labels or copy for their locale."
301
+ },
302
+ io: {
303
+ input: UpdateTenantTranslationInput,
304
+ output: UpdateTenantBrandingOutput
305
+ },
306
+ policy: {
307
+ auth: "admin",
308
+ policies: [{
309
+ key: "platform.app-config.manage",
310
+ version: "1.0.0"
311
+ }]
312
+ }
313
+ });
314
+ const GetResolvedBrandingQuery = defineQuery({
315
+ meta: {
316
+ key: "appConfig.getResolvedBranding",
317
+ version: "1.0.0",
318
+ description: "Returns the resolved branding for a tenant/app/environment.",
319
+ owners: [OwnersEnum.PlatformSigil],
320
+ tags: ["branding"],
321
+ stability: StabilityEnum.Beta,
322
+ goal: "Expose hydrated branding assets for rendering UI/email experiences.",
323
+ context: "Used by runtime surfaces to fetch brand assets prior to rendering tenant-specific experiences."
324
+ },
325
+ io: {
326
+ input: new SchemaModel({
327
+ name: "GetResolvedBrandingInput",
328
+ fields: {
329
+ tenantId: {
330
+ type: ScalarTypeEnum.ID(),
331
+ isOptional: false
332
+ },
333
+ appId: {
334
+ type: ScalarTypeEnum.ID(),
335
+ isOptional: false
336
+ },
337
+ environment: {
338
+ type: ScalarTypeEnum.String_unsecure(),
339
+ isOptional: true
340
+ }
341
+ }
342
+ }),
343
+ output: new SchemaModel({
344
+ name: "GetResolvedBrandingOutput",
345
+ fields: { branding: {
346
+ type: ScalarTypeEnum.JSONObject(),
347
+ isOptional: false
348
+ } }
349
+ })
350
+ },
351
+ policy: {
352
+ auth: "admin",
353
+ policies: [{
354
+ key: "platform.app-config.read",
355
+ version: "1.0.0"
356
+ }]
357
+ }
358
+ });
359
+ const ResolveMessageQuery = defineQuery({
360
+ meta: {
361
+ key: "appConfig.resolveMessage",
362
+ version: "1.0.0",
363
+ description: "Resolves a translation key for a tenant in the requested locale.",
364
+ owners: [OwnersEnum.PlatformSigil],
365
+ tags: [TagsEnum.I18n],
366
+ stability: StabilityEnum.Experimental,
367
+ goal: "Expose a server-side API for resolving message keys on demand.",
368
+ context: "Used by backend services or scripts that need translated copy outside the front-end runtime."
369
+ },
370
+ io: {
371
+ input: MessageResolutionInput,
372
+ output: MessageResolutionOutput
373
+ },
374
+ policy: {
375
+ auth: "admin",
376
+ policies: [{
377
+ key: "platform.app-config.read",
378
+ version: "1.0.0"
379
+ }]
380
+ }
381
+ });
382
+ const appConfigOperations = {
383
+ UpdateTenantBrandingCommand,
384
+ VerifyCustomDomainCommand,
385
+ UpdateBlueprintTranslationCatalogCommand,
386
+ UpdateTenantTranslationOverridesCommand,
387
+ GetResolvedBrandingQuery,
388
+ ResolveMessageQuery
389
+ };
390
+ function registerAppConfigOperations(registry) {
391
+ return registry.register(UpdateTenantBrandingCommand).register(VerifyCustomDomainCommand).register(UpdateBlueprintTranslationCatalogCommand).register(UpdateTenantTranslationOverridesCommand).register(GetResolvedBrandingQuery).register(ResolveMessageQuery);
392
+ }
393
+
394
+ //#endregion
395
+ export { GetResolvedBrandingQuery, ResolveMessageQuery, UpdateBlueprintTranslationCatalogCommand, UpdateTenantBrandingCommand, UpdateTenantTranslationOverridesCommand, VerifyCustomDomainCommand, appConfigOperations, registerAppConfigOperations };
@@ -0,0 +1,6 @@
1
+ import { DocBlock } from "@contractspec/lib.contracts/docs";
2
+
3
+ //#region src/app-config/docs/app-config.docblock.d.ts
4
+ declare const tech_contracts_app_config_DocBlocks: DocBlock[];
5
+ //#endregion
6
+ export { tech_contracts_app_config_DocBlocks };
@@ -0,0 +1,21 @@
1
+ import { registerDocBlocks } from "../../docs/registry.js";
2
+
3
+ //#region src/app-config/docs/app-config.docblock.ts
4
+ const tech_contracts_app_config_DocBlocks = [{
5
+ id: "docs.tech.contracts.app-config",
6
+ title: "App Configuration Layers",
7
+ summary: "App orchestration is split into three explicit layers:",
8
+ kind: "reference",
9
+ visibility: "public",
10
+ route: "/docs/tech/contracts/app-config",
11
+ tags: [
12
+ "tech",
13
+ "contracts",
14
+ "app-config"
15
+ ],
16
+ body: "## App Configuration Layers\n\nApp orchestration is split into three explicit layers:\n\n1. **AppBlueprintSpec** – global, versioned description of what an app can look like. Stored in Git, no tenant/environment data.\n2. **TenantAppConfig** – tenant/environment overrides that the future Studio edits. Stored per tenant (DB/contract), mutable at runtime.\n3. **ResolvedAppConfig** – pure, merged view consumed by the runtime. Derived in-memory from a blueprint + tenant config.\n\n- Types & registry: `packages/libs/contracts/src/app-config/spec.ts`\n- Resolution helpers: `packages/libs/contracts/src/app-config/runtime.ts`\n- CLI wizard (blueprint scaffolding): `contractspec create app-config`\n\n### 1. AppBlueprintSpec\n\n```ts\nexport interface AppBlueprintSpec {\n meta: AppBlueprintMeta; // { name, version, appId, ownership }\n capabilities?: { enabled?: CapabilityRef[]; disabled?: CapabilityRef[] };\n features?: { include?: FeatureRef[]; exclude?: FeatureRef[] };\n integrationSlots?: AppIntegrationSlot[];\n branding?: BrandingDefaults;\n dataViews?: Record<string, SpecPointer>;\n workflows?: Record<string, SpecPointer>;\n policies?: PolicyRef[];\n theme?: AppThemeBinding;\n telemetry?: TelemetryBinding;\n experiments?: { active?: ExperimentRef[]; paused?: ExperimentRef[] };\n featureFlags?: FeatureFlagState[];\n routes?: AppRouteConfig[];\n notes?: string;\n}\n```\n\nRegister blueprints with `AppBlueprintRegistry`. Blueprints only capture the default/global experience.\n\n- **Integration slots** declare the categories and capability requirements an app expects (e.g. `\"primary-payments\"` must be a payments provider that supports managed or BYOK credentials). Slots never include secrets; tenants bind concrete connections later.\n- **Branding defaults** provide message-key based names, placeholder assets, and theme token references that downstream tenants can override.\n\n### 2. TenantAppConfig\n\n```ts\nexport interface TenantAppConfig {\n meta: TenantAppConfigMeta; // { id, tenantId, appId, blueprintName/version, environment?, version, timestamps }\n capabilities?: { enable?: CapabilityRef[]; disable?: CapabilityRef[] };\n features?: { include?: FeatureRef[]; exclude?: FeatureRef[] };\n dataViewOverrides?: TenantSpecOverride[];\n workflowOverrides?: TenantSpecOverride[];\n additionalPolicies?: PolicyRef[];\n themeOverride?: { primary?: ThemeRef | null; fallbacks?: ThemeRef[] };\n telemetryOverride?: { spec?: SpecPointer | null; disabledEvents?: string[] };\n experiments?: { active?: ExperimentRef[]; paused?: ExperimentRef[] };\n featureFlags?: FeatureFlagState[];\n routeOverrides?: TenantRouteOverride[];\n integrations?: AppIntegrationBinding[];\n knowledge?: AppKnowledgeBinding[];\n branding?: TenantBrandingConfig;\n notes?: string;\n}\n```\n\nThis object represents what a tenant edits via the Studio (stored in DB/contracts later).\n\n- **AppIntegrationBinding** now maps `slotId` → `connectionId` (plus optional workflow scopes). It no longer carries capability lists; those are defined once in the slot.\n- **TenantBrandingConfig** allows per-tenant names, assets, and domain overrides while keeping secrets and large files out of blueprints.\n\n### 3. ResolvedAppConfig\n\n```ts\nexport interface ResolvedAppConfig {\n appId: string;\n tenantId: string;\n environment?: string;\n blueprintName: string;\n blueprintVersion: number;\n configVersion: number;\n capabilities: { enabled: CapabilityRef[]; disabled: CapabilityRef[] };\n features: { include: FeatureRef[]; exclude: FeatureRef[] };\n dataViews: Record<string, SpecPointer>;\n workflows: Record<string, SpecPointer>;\n policies: PolicyRef[];\n theme?: AppThemeBinding;\n telemetry?: TelemetryBinding;\n experiments: { catalog: ExperimentRef[]; active: ExperimentRef[]; paused: ExperimentRef[] };\n featureFlags: FeatureFlagState[];\n routes: AppRouteConfig[];\n integrations: ResolvedIntegration[];\n knowledge: ResolvedKnowledge[];\n branding: ResolvedBranding;\n notes?: string;\n}\n```\n\nUse `resolveAppConfig(blueprint, tenant)` to produce this merged view. No IO, no registry lookups—pure data merge.\n\n- `resolveAppConfig` validates slot/category/mode constraints when `integrationConnections` and `integrationSpecs` are provided.\n- `branding` merges blueprint defaults with tenant overrides, producing a runtime-friendly shape (resolved asset URLs, color values, and effective domain).\n\n### Materializing specs\n\n`composeAppConfig(blueprint, tenant, registries, { strict })`:\n\n1. Calls `resolveAppConfig` to build the merged pointers.\n2. Looks up referenced specs in the provided registries.\n3. Returns:\n - `resolved` – the merged pointer view\n - `capabilities`, `features`, `dataViews`, `workflows`, `policies`, `theme`, `telemetry`, `experiments`\n - `missing` – unresolved references (strict mode throws).\n\n```ts\nconst blueprint = blueprintRegistry.get('core.app', 1)!;\nconst tenant = loadTenantConfigFromDB();\n\nconst composition = composeAppConfig(blueprint, tenant, {\n capabilities,\n features,\n dataViews,\n workflows,\n policies,\n themes,\n telemetry,\n experiments,\n});\n\nif (composition.missing.length) {\n console.warn('Unresolved references', composition.missing);\n}\n```\n\n### CLI workflow\n\n```\ncontractspec create app-config\n```\n\nGenerates an `AppBlueprintSpec`. A separate flow will later scaffold tenant configs.\n\n### Best practices\n\n1. Keep blueprint and tenant versions monotonic; bump when referenced spec versions change.\n2. Favor stable slot keys (e.g. `dataViews.dashboard`) to align with Studio UX.\n3. Reference telemetry and experiments declared in their respective specs to maintain observability.\n4. Run `resolveAppConfig` in pure unit tests and `composeAppConfig(..., { strict: true })` in CI to catch drift early.\n5. Pair resolved configs with `TestSpec` scenarios to guard tenant experiences end-to-end.\n\n### Static validation\n\nUse the validation helpers in `@contractspec/lib.contracts/app-config/validation` to keep blueprints and tenant configs safe before publish time.\n\n```ts\nimport {\n validateConfig,\n validateBlueprint,\n validateTenantConfig,\n validateResolvedConfig,\n} from '@contractspec/lib.contracts/app-config/validation';\n\nconst context = {\n integrationSpecs,\n tenantConnections,\n knowledgeSpaces,\n knowledgeSources,\n translationCatalogs: {\n blueprint: blueprintCatalog,\n platform: platformCatalog,\n },\n existingConfigs,\n};\n\nconst blueprintReport = validateBlueprint(blueprint, context);\nconst tenantReport = validateTenantConfig(blueprint, tenant, context);\nconst publishReport = validateConfig(blueprint, tenant, context);\n```\n\n- `ValidationResult` exposes `valid`, plus structured `errors`, `warnings`, and `info`.\n- Core rules cover capability references, integration slot bindings (category/ownership/capabilities), knowledge bindings, branding constraints (domains + assets), and translation coverage.\n- Call `validateBlueprint` in CI when committing new specs, and `validateConfig` before promoting/publishing a tenant config.\n- `validateResolvedConfig` can be used as a runtime pre-flight check when composing full configs for workflows.\n- CLI usage example (blueprint + tenant):\n\n```\nbuncontractspec validate \\\n packages/examples/integration-stripe/blueprint.ts \\\n --blueprint packages/examples/integration-stripe/blueprint.ts \\\n --tenant-config packages/examples/integration-stripe/tenant.ts\n```\n- Repository script:\n\n```\nbun run validate:blueprints\n```\n\nRuns the static validator for the sample blueprints/tenants and is wired into CI.\n\n\n### Lifecycle types & events\n\nTo model multi-step configuration changes, use the lifecycle helpers exported from `@contractspec/lib.contracts/app-config`:\n\n```ts\nimport type {\n ConfigStatus,\n TenantAppConfigVersion,\n ConfigTransition,\n} from '@contractspec/lib.contracts/app-config';\nimport {\n ConfigDraftCreatedEvent,\n ConfigPromotedToPreviewEvent,\n ConfigPublishedEvent,\n ConfigRolledBackEvent,\n} from '@contractspec/lib.contracts/app-config';\n```\n\n- `ConfigStatus` enumerates the canonical states: `draft`, `preview`, `published`, `archived`, `superseded`.\n- `TenantAppConfigMeta` now includes lifecycle metadata (`status`, `createdBy`, `publishedBy`, `publishedAt`, `rolledBackFrom`, `rolledBackTo`, `changeSummary`).\n- `TenantAppConfigVersion` couples the lifecycle-aware metadata with the `TenantAppConfig` payload for history views.\n- `ConfigTransition` captures state changes with actor, timestamp, and optional reason.\n- Lifecycle events (`app_config.draft_created`, `app_config.promoted_to_preview`, `app_config.published`, `app_config.rolled_back`) standardize observability across services.\n- Lifecycle contract specs (`appConfig.lifecycle.*`) expose typed commands/queries for create → preview → publish → rollback flows.\n\n"
17
+ }];
18
+ registerDocBlocks(tech_contracts_app_config_DocBlocks);
19
+
20
+ //#endregion
21
+ export { tech_contracts_app_config_DocBlocks };
@@ -0,0 +1,122 @@
1
+ import { EventSpec } from "../events.js";
2
+ import "../index.js";
3
+ import * as _contractspec_lib_schema195 from "@contractspec/lib.schema";
4
+ import { SchemaModel } from "@contractspec/lib.schema";
5
+
6
+ //#region src/app-config/events.d.ts
7
+ declare const ConfigDraftCreatedEvent: EventSpec<SchemaModel<{
8
+ tenantId: {
9
+ type: _contractspec_lib_schema195.FieldType<string, string>;
10
+ isOptional: false;
11
+ };
12
+ appId: {
13
+ type: _contractspec_lib_schema195.FieldType<string, string>;
14
+ isOptional: false;
15
+ };
16
+ version: {
17
+ type: _contractspec_lib_schema195.FieldType<string, string>;
18
+ isOptional: false;
19
+ };
20
+ blueprintName: {
21
+ type: _contractspec_lib_schema195.FieldType<string, string>;
22
+ isOptional: false;
23
+ };
24
+ blueprintVersion: {
25
+ type: _contractspec_lib_schema195.FieldType<string, string>;
26
+ isOptional: false;
27
+ };
28
+ createdBy: {
29
+ type: _contractspec_lib_schema195.FieldType<string, string>;
30
+ isOptional: false;
31
+ };
32
+ clonedFrom: {
33
+ type: _contractspec_lib_schema195.FieldType<number, number>;
34
+ isOptional: true;
35
+ };
36
+ }>>;
37
+ declare const ConfigPromotedToPreviewEvent: EventSpec<SchemaModel<{
38
+ tenantId: {
39
+ type: _contractspec_lib_schema195.FieldType<string, string>;
40
+ isOptional: false;
41
+ };
42
+ appId: {
43
+ type: _contractspec_lib_schema195.FieldType<string, string>;
44
+ isOptional: false;
45
+ };
46
+ version: {
47
+ type: _contractspec_lib_schema195.FieldType<string, string>;
48
+ isOptional: false;
49
+ };
50
+ promotedBy: {
51
+ type: _contractspec_lib_schema195.FieldType<string, string>;
52
+ isOptional: false;
53
+ };
54
+ warnings: {
55
+ type: _contractspec_lib_schema195.FieldType<string, string>;
56
+ isOptional: true;
57
+ isArray: true;
58
+ };
59
+ }>>;
60
+ declare const ConfigPublishedEvent: EventSpec<SchemaModel<{
61
+ tenantId: {
62
+ type: _contractspec_lib_schema195.FieldType<string, string>;
63
+ isOptional: false;
64
+ };
65
+ appId: {
66
+ type: _contractspec_lib_schema195.FieldType<string, string>;
67
+ isOptional: false;
68
+ };
69
+ version: {
70
+ type: _contractspec_lib_schema195.FieldType<string, string>;
71
+ isOptional: false;
72
+ };
73
+ previousVersion: {
74
+ type: _contractspec_lib_schema195.FieldType<string, string>;
75
+ isOptional: true;
76
+ };
77
+ publishedBy: {
78
+ type: _contractspec_lib_schema195.FieldType<string, string>;
79
+ isOptional: false;
80
+ };
81
+ changeSummary: {
82
+ type: _contractspec_lib_schema195.FieldType<string, string>;
83
+ isOptional: true;
84
+ };
85
+ changedSections: {
86
+ type: _contractspec_lib_schema195.FieldType<string, string>;
87
+ isOptional: true;
88
+ isArray: true;
89
+ };
90
+ }>>;
91
+ declare const ConfigRolledBackEvent: EventSpec<SchemaModel<{
92
+ tenantId: {
93
+ type: _contractspec_lib_schema195.FieldType<string, string>;
94
+ isOptional: false;
95
+ };
96
+ appId: {
97
+ type: _contractspec_lib_schema195.FieldType<string, string>;
98
+ isOptional: false;
99
+ };
100
+ newVersion: {
101
+ type: _contractspec_lib_schema195.FieldType<string, string>;
102
+ isOptional: false;
103
+ };
104
+ rolledBackFrom: {
105
+ type: _contractspec_lib_schema195.FieldType<string, string>;
106
+ isOptional: false;
107
+ };
108
+ rolledBackTo: {
109
+ type: _contractspec_lib_schema195.FieldType<string, string>;
110
+ isOptional: false;
111
+ };
112
+ rolledBackBy: {
113
+ type: _contractspec_lib_schema195.FieldType<string, string>;
114
+ isOptional: false;
115
+ };
116
+ reason: {
117
+ type: _contractspec_lib_schema195.FieldType<string, string>;
118
+ isOptional: false;
119
+ };
120
+ }>>;
121
+ //#endregion
122
+ export { ConfigDraftCreatedEvent, ConfigPromotedToPreviewEvent, ConfigPublishedEvent, ConfigRolledBackEvent };