@treeseed/sdk 0.11.0 → 0.12.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (473) hide show
  1. package/README.md +9 -4
  2. package/dist/agent-capacity.d.ts +916 -0
  3. package/dist/agent-capacity.js +1600 -0
  4. package/dist/agent-tools.d.ts +37 -0
  5. package/dist/agent-tools.js +301 -0
  6. package/dist/api/app.d.ts +1 -1
  7. package/dist/api/auth/d1-database.d.ts +2 -2
  8. package/dist/api/auth/d1-provider.d.ts +4 -4
  9. package/dist/api/auth/d1-store.d.ts +2 -2
  10. package/dist/api/auth/memory-provider.d.ts +1 -1
  11. package/dist/api/auth/tokens.d.ts +1 -1
  12. package/dist/api/config.d.ts +3 -1
  13. package/dist/api/config.js +34 -10
  14. package/dist/api/http.d.ts +2 -2
  15. package/dist/api/index.d.ts +10 -10
  16. package/dist/api/index.js +4 -2
  17. package/dist/api/operations-routes.d.ts +3 -3
  18. package/dist/api/operations.d.ts +1 -1
  19. package/dist/api/providers.d.ts +1 -1
  20. package/dist/api/providers.js +21 -4
  21. package/dist/api/railway.d.ts +3 -2
  22. package/dist/api/sdk-dispatch.d.ts +4 -4
  23. package/dist/api/sdk-routes.d.ts +2 -2
  24. package/dist/api/templates.d.ts +2 -2
  25. package/dist/api/types.d.ts +3 -2
  26. package/dist/capacity-provider.d.ts +117 -60
  27. package/dist/capacity-provider.js +215 -43
  28. package/dist/capacity.d.ts +2 -2
  29. package/dist/cli-tools.d.ts +1 -1
  30. package/dist/content-operations.d.ts +97 -0
  31. package/dist/content-operations.js +250 -0
  32. package/dist/content-store.d.ts +4 -4
  33. package/dist/control-plane-client.d.ts +13 -18
  34. package/dist/control-plane-client.js +8 -86
  35. package/dist/control-plane.d.ts +2 -2
  36. package/dist/copilot.d.ts +3 -0
  37. package/dist/copilot.js +16 -1
  38. package/dist/d1-http.d.ts +1 -1
  39. package/dist/d1-store.d.ts +32 -57
  40. package/dist/d1-store.js +115 -318
  41. package/dist/db/d1.d.ts +1 -232
  42. package/dist/db/index.d.ts +3 -3
  43. package/dist/db/market-schema.d.ts +49037 -11843
  44. package/dist/db/market-schema.js +1788 -50
  45. package/dist/db/node-sqlite.d.ts +1 -232
  46. package/dist/db/schema.d.ts +0 -462
  47. package/dist/db/schema.js +2 -22
  48. package/dist/dispatch.d.ts +1 -1
  49. package/dist/dispatch.js +0 -11
  50. package/dist/fixture-support.js +52 -4
  51. package/dist/governance.d.ts +133 -0
  52. package/dist/governance.js +285 -0
  53. package/dist/graph/build.d.ts +2 -2
  54. package/dist/graph/context-query-contracts.d.ts +1 -1
  55. package/dist/graph/dsl.d.ts +1 -1
  56. package/dist/graph/query.d.ts +4 -4
  57. package/dist/graph/ranking.d.ts +1 -1
  58. package/dist/graph/schema.d.ts +1 -1
  59. package/dist/graph.d.ts +11 -11
  60. package/dist/guarantees/index.d.ts +425 -0
  61. package/dist/guarantees/index.js +1146 -0
  62. package/dist/hosting/apps.d.ts +1 -1
  63. package/dist/hosting/builtins.d.ts +1 -1
  64. package/dist/hosting/builtins.js +9 -198
  65. package/dist/hosting/contracts.d.ts +3 -2
  66. package/dist/hosting/graph.d.ts +24 -21
  67. package/dist/hosting/graph.js +280 -294
  68. package/dist/hosting/index.d.ts +4 -4
  69. package/dist/index.d.ts +88 -74
  70. package/dist/index.js +81 -10
  71. package/dist/local-dev/managed-dev.d.ts +85 -0
  72. package/dist/local-dev/managed-dev.js +368 -0
  73. package/dist/managed-dependencies.d.ts +9 -0
  74. package/dist/managed-dependencies.js +10 -8
  75. package/dist/market-client.d.ts +265 -7
  76. package/dist/market-client.js +381 -9
  77. package/dist/model-registry.d.ts +1 -1
  78. package/dist/model-registry.js +19 -19
  79. package/dist/operations/agent-tools.d.ts +2 -11
  80. package/dist/operations/agent-tools.js +2 -14
  81. package/dist/operations/providers/default.d.ts +1 -1
  82. package/dist/operations/providers/default.js +20 -37
  83. package/dist/operations/repository-operations.d.ts +26 -2
  84. package/dist/operations/repository-operations.js +159 -1
  85. package/dist/operations/runtime.d.ts +3 -3
  86. package/dist/operations/services/bootstrap-runner.d.ts +1 -1
  87. package/dist/operations/services/build-warning-policy.d.ts +34 -0
  88. package/dist/operations/services/build-warning-policy.js +81 -82
  89. package/dist/operations/services/commit-message-provider.js +4 -4
  90. package/dist/operations/services/config-runtime.d.ts +73 -19
  91. package/dist/operations/services/config-runtime.js +276 -100
  92. package/dist/operations/services/deploy.d.ts +41 -622
  93. package/dist/operations/services/deploy.js +181 -213
  94. package/dist/operations/services/deployment-readiness.d.ts +1 -1
  95. package/dist/operations/services/deployment-readiness.js +38 -7
  96. package/dist/operations/services/git-remote-policy.js +12 -4
  97. package/dist/operations/services/git-runner.d.ts +66 -0
  98. package/dist/operations/services/git-runner.js +479 -0
  99. package/dist/operations/services/git-workflow.d.ts +43 -5
  100. package/dist/operations/services/git-workflow.js +242 -20
  101. package/dist/operations/services/github-actions-verification.d.ts +3 -1
  102. package/dist/operations/services/github-actions-verification.js +11 -3
  103. package/dist/operations/services/github-api.js +21 -5
  104. package/dist/operations/services/github-automation.d.ts +3 -3
  105. package/dist/operations/services/github-automation.js +15 -18
  106. package/dist/operations/services/github-credentials.js +2 -1
  107. package/dist/operations/services/hosted-service-checks.d.ts +19 -1
  108. package/dist/operations/services/hosted-service-checks.js +162 -11
  109. package/dist/operations/services/hosting-audit.d.ts +2 -2
  110. package/dist/operations/services/hosting-audit.js +7 -7
  111. package/dist/operations/services/hub-launch.d.ts +1 -1
  112. package/dist/operations/services/hub-provider-launch.d.ts +5 -5
  113. package/dist/operations/services/hub-provider-launch.js +19 -14
  114. package/dist/operations/services/live-hosted-service-checks.d.ts +2 -1
  115. package/dist/operations/services/live-hosted-service-checks.js +193 -80
  116. package/dist/operations/services/local-dev.js +0 -1
  117. package/dist/operations/services/managed-host-security.d.ts +1 -1
  118. package/dist/operations/services/managed-repositories.d.ts +37 -0
  119. package/dist/operations/services/managed-repositories.js +177 -0
  120. package/dist/operations/services/operations-runner-smoke.d.ts +3 -2
  121. package/dist/operations/services/operations-runner-smoke.js +22 -4
  122. package/dist/operations/services/package-adapters.d.ts +77 -2
  123. package/dist/operations/services/package-adapters.js +629 -56
  124. package/dist/operations/services/package-reference-policy.d.ts +12 -88
  125. package/dist/operations/services/package-reference-policy.js +81 -213
  126. package/dist/operations/services/project-host-operations.d.ts +4 -4
  127. package/dist/operations/services/project-platform.d.ts +19 -193
  128. package/dist/operations/services/project-platform.js +31 -103
  129. package/dist/operations/services/project-web-monitor.d.ts +2 -2
  130. package/dist/operations/services/project-web-monitor.js +97 -2
  131. package/dist/operations/services/railway-api.d.ts +36 -7
  132. package/dist/operations/services/railway-api.js +331 -100
  133. package/dist/operations/services/railway-deploy.d.ts +7 -95
  134. package/dist/operations/services/railway-deploy.js +334 -742
  135. package/dist/operations/services/release-history.js +3 -4
  136. package/dist/operations/services/release-proof-ledger.d.ts +13 -0
  137. package/dist/operations/services/release-proof-ledger.js +81 -0
  138. package/dist/operations/services/release-proof-planner.d.ts +48 -0
  139. package/dist/operations/services/release-proof-planner.js +195 -0
  140. package/dist/operations/services/release-proof-runner.d.ts +16 -0
  141. package/dist/operations/services/release-proof-runner.js +169 -0
  142. package/dist/operations/services/release-proof.d.ts +81 -0
  143. package/dist/operations/services/release-proof.js +79 -0
  144. package/dist/operations/services/repository-save-orchestrator.d.ts +6 -7
  145. package/dist/operations/services/repository-save-orchestrator.js +353 -174
  146. package/dist/operations/services/runtime-paths.d.ts +1 -3
  147. package/dist/operations/services/runtime-paths.js +0 -4
  148. package/dist/operations/services/runtime-tools.d.ts +1 -192
  149. package/dist/operations/services/runtime-tools.js +4 -444
  150. package/dist/operations/services/save-deploy-preflight.js +9 -1
  151. package/dist/operations/services/template-host-bindings.d.ts +2 -2
  152. package/dist/operations/services/template-host-bindings.js +3 -2
  153. package/dist/operations/services/template-registry.d.ts +6 -6
  154. package/dist/operations/services/template-registry.js +33 -14
  155. package/dist/operations/services/template-secret-sync.d.ts +3 -3
  156. package/dist/operations/services/workflow-timing.d.ts +25 -0
  157. package/dist/operations/services/workflow-timing.js +79 -0
  158. package/dist/operations/services/workspace-dependency-mode.js +41 -4
  159. package/dist/operations/services/workspace-preflight.js +8 -8
  160. package/dist/operations/services/workspace-save-script.d.ts +4 -4
  161. package/dist/operations/services/workspace-save.d.ts +1 -0
  162. package/dist/operations/services/workspace-save.js +41 -18
  163. package/dist/operations/services/workspace-tools.js +40 -6
  164. package/dist/operations-registry.d.ts +1 -1
  165. package/dist/operations-registry.js +5 -6
  166. package/dist/operations-types.d.ts +1 -1
  167. package/dist/operations.d.ts +17 -11
  168. package/dist/operations.js +57 -3
  169. package/dist/platform/book-export.js +2 -0
  170. package/dist/platform/books-data.d.ts +1 -1
  171. package/dist/platform/config.d.ts +27 -0
  172. package/dist/platform/config.js +100 -0
  173. package/dist/platform/content-runtime-source.d.ts +54 -0
  174. package/dist/platform/content-runtime-source.js +169 -0
  175. package/dist/platform/contracts.d.ts +6 -1
  176. package/dist/platform/deploy-config.d.ts +1 -1
  177. package/dist/platform/deploy-config.js +7 -1
  178. package/dist/platform/deploy-runtime.d.ts +1 -1
  179. package/dist/platform/desired-state.d.ts +66 -0
  180. package/dist/platform/desired-state.js +1052 -0
  181. package/dist/platform/env.yaml +414 -19
  182. package/dist/platform/environment.d.ts +2 -2
  183. package/dist/platform/environment.js +54 -22
  184. package/dist/platform/local-content-materialization.d.ts +9 -0
  185. package/dist/platform/local-content-materialization.js +212 -0
  186. package/dist/platform/plugin.d.ts +5 -5
  187. package/dist/platform/plugins/runtime.d.ts +3 -3
  188. package/dist/platform/plugins/runtime.js +62 -1
  189. package/dist/platform/plugins.d.ts +6 -6
  190. package/dist/platform/published-content-pipeline.d.ts +3 -3
  191. package/dist/platform/published-content-pipeline.js +5 -1
  192. package/dist/platform/published-content.d.ts +4 -3
  193. package/dist/platform/site-config-schema.d.ts +1 -0
  194. package/dist/platform/site-config-schema.js +4 -1
  195. package/dist/platform/tenant/runtime-config.d.ts +152 -2
  196. package/dist/platform/tenant-config.d.ts +1 -1
  197. package/dist/platform/utils/site-config-schema.d.ts +154 -0
  198. package/dist/platform/utils/site-config-schema.js +400 -461
  199. package/dist/platform-operation-store.d.ts +1 -1
  200. package/dist/plugin-default.d.ts +1 -1
  201. package/dist/plugin-default.js +27 -12
  202. package/dist/project-import.d.ts +91 -0
  203. package/dist/project-import.js +257 -0
  204. package/dist/project-workflow.d.ts +1 -1
  205. package/dist/reconcile/bootstrap-systems.d.ts +2 -2
  206. package/dist/reconcile/bootstrap-systems.js +3 -3
  207. package/dist/reconcile/builtin-adapters.d.ts +7 -1
  208. package/dist/reconcile/builtin-adapters.js +2924 -346
  209. package/dist/reconcile/contracts.d.ts +15 -2
  210. package/dist/reconcile/desired-state.d.ts +2 -193
  211. package/dist/reconcile/desired-state.js +24 -33
  212. package/dist/reconcile/engine.d.ts +60 -397
  213. package/dist/reconcile/engine.js +182 -18
  214. package/dist/reconcile/index.d.ts +10 -10
  215. package/dist/reconcile/live-acceptance.d.ts +22 -1
  216. package/dist/reconcile/live-acceptance.js +456 -44
  217. package/dist/reconcile/providers/docker-private.d.ts +54 -0
  218. package/dist/reconcile/providers/docker-private.js +101 -0
  219. package/dist/reconcile/providers/github-private.d.ts +65 -0
  220. package/dist/reconcile/providers/github-private.js +119 -0
  221. package/dist/reconcile/providers/local-private.d.ts +28 -0
  222. package/dist/reconcile/providers/local-private.js +75 -0
  223. package/dist/reconcile/providers/railway-iac.d.ts +66 -0
  224. package/dist/reconcile/providers/railway-iac.js +275 -0
  225. package/dist/reconcile/providers/release-private.d.ts +92 -0
  226. package/dist/reconcile/providers/release-private.js +152 -0
  227. package/dist/reconcile/registry.d.ts +2 -2
  228. package/dist/reconcile/registry.js +16 -1
  229. package/dist/reconcile/state.d.ts +1 -1
  230. package/dist/reconcile/state.js +3 -40
  231. package/dist/reconcile/units.d.ts +1 -1
  232. package/dist/reconcile/units.js +7 -1
  233. package/dist/remote.d.ts +6 -6
  234. package/dist/scenes/artifacts.d.ts +16 -0
  235. package/dist/scenes/artifacts.js +61 -0
  236. package/dist/scenes/auth.d.ts +2 -0
  237. package/dist/scenes/auth.js +28 -0
  238. package/dist/scenes/base-url.d.ts +12 -0
  239. package/dist/scenes/base-url.js +123 -0
  240. package/dist/scenes/builtin-plugins.d.ts +2 -0
  241. package/dist/scenes/builtin-plugins.js +447 -0
  242. package/dist/scenes/checkpoints.d.ts +14 -0
  243. package/dist/scenes/checkpoints.js +33 -0
  244. package/dist/scenes/device-matrix.d.ts +2 -0
  245. package/dist/scenes/device-matrix.js +97 -0
  246. package/dist/scenes/devices.d.ts +11 -0
  247. package/dist/scenes/devices.js +22 -0
  248. package/dist/scenes/diagnostics.d.ts +5 -0
  249. package/dist/scenes/diagnostics.js +22 -0
  250. package/dist/scenes/diagram-providers.d.ts +2 -0
  251. package/dist/scenes/diagram-providers.js +181 -0
  252. package/dist/scenes/diagram-validation.d.ts +22 -0
  253. package/dist/scenes/diagram-validation.js +74 -0
  254. package/dist/scenes/environment.d.ts +2 -0
  255. package/dist/scenes/environment.js +65 -0
  256. package/dist/scenes/evidence-bundle.d.ts +5 -0
  257. package/dist/scenes/evidence-bundle.js +42 -0
  258. package/dist/scenes/evidence-report.d.ts +10 -0
  259. package/dist/scenes/evidence-report.js +73 -0
  260. package/dist/scenes/evidence.d.ts +16 -0
  261. package/dist/scenes/evidence.js +277 -0
  262. package/dist/scenes/index.d.ts +48 -0
  263. package/dist/scenes/index.js +312 -0
  264. package/dist/scenes/inspect.d.ts +9 -0
  265. package/dist/scenes/inspect.js +64 -0
  266. package/dist/scenes/loader.d.ts +3 -0
  267. package/dist/scenes/loader.js +38 -0
  268. package/dist/scenes/logs.d.ts +2 -0
  269. package/dist/scenes/logs.js +47 -0
  270. package/dist/scenes/operations.d.ts +3 -0
  271. package/dist/scenes/operations.js +128 -0
  272. package/dist/scenes/phase0.d.ts +9 -0
  273. package/dist/scenes/phase0.js +637 -0
  274. package/dist/scenes/planner.d.ts +12 -0
  275. package/dist/scenes/planner.js +166 -0
  276. package/dist/scenes/playwright-adapter.d.ts +2 -0
  277. package/dist/scenes/playwright-adapter.js +63 -0
  278. package/dist/scenes/plugins.d.ts +5 -0
  279. package/dist/scenes/plugins.js +115 -0
  280. package/dist/scenes/progress.d.ts +17 -0
  281. package/dist/scenes/progress.js +24 -0
  282. package/dist/scenes/publish-destinations.d.ts +12 -0
  283. package/dist/scenes/publish-destinations.js +99 -0
  284. package/dist/scenes/publish-plan-report.d.ts +10 -0
  285. package/dist/scenes/publish-plan-report.js +70 -0
  286. package/dist/scenes/publish-plan.d.ts +15 -0
  287. package/dist/scenes/publish-plan.js +248 -0
  288. package/dist/scenes/publish-redaction.d.ts +16 -0
  289. package/dist/scenes/publish-redaction.js +148 -0
  290. package/dist/scenes/publish-release-record.d.ts +13 -0
  291. package/dist/scenes/publish-release-record.js +34 -0
  292. package/dist/scenes/publish-report.d.ts +10 -0
  293. package/dist/scenes/publish-report.js +67 -0
  294. package/dist/scenes/publish.d.ts +16 -0
  295. package/dist/scenes/publish.js +298 -0
  296. package/dist/scenes/registry.d.ts +12 -0
  297. package/dist/scenes/registry.js +65 -0
  298. package/dist/scenes/remotion-adapter.d.ts +3 -0
  299. package/dist/scenes/remotion-adapter.js +94 -0
  300. package/dist/scenes/remotion-composition-registry.d.ts +2 -0
  301. package/dist/scenes/remotion-composition-registry.js +12 -0
  302. package/dist/scenes/remotion-compositions.d.ts +15 -0
  303. package/dist/scenes/remotion-compositions.js +464 -0
  304. package/dist/scenes/remotion-diagrams.d.ts +9 -0
  305. package/dist/scenes/remotion-diagrams.js +188 -0
  306. package/dist/scenes/remotion-input.d.ts +13 -0
  307. package/dist/scenes/remotion-input.js +291 -0
  308. package/dist/scenes/remotion-visuals.d.ts +29 -0
  309. package/dist/scenes/remotion-visuals.js +198 -0
  310. package/dist/scenes/render-media-assets.d.ts +9 -0
  311. package/dist/scenes/render-media-assets.js +117 -0
  312. package/dist/scenes/render-report.d.ts +10 -0
  313. package/dist/scenes/render-report.js +27 -0
  314. package/dist/scenes/render.d.ts +2 -0
  315. package/dist/scenes/render.js +218 -0
  316. package/dist/scenes/reporter.d.ts +3 -0
  317. package/dist/scenes/reporter.js +101 -0
  318. package/dist/scenes/resume.d.ts +2 -0
  319. package/dist/scenes/resume.js +79 -0
  320. package/dist/scenes/runner.d.ts +2 -0
  321. package/dist/scenes/runner.js +674 -0
  322. package/dist/scenes/schema.d.ts +6 -0
  323. package/dist/scenes/schema.js +994 -0
  324. package/dist/scenes/seed.d.ts +2 -0
  325. package/dist/scenes/seed.js +83 -0
  326. package/dist/scenes/segments.d.ts +15 -0
  327. package/dist/scenes/segments.js +79 -0
  328. package/dist/scenes/selectors.d.ts +3 -0
  329. package/dist/scenes/selectors.js +21 -0
  330. package/dist/scenes/timeline.d.ts +11 -0
  331. package/dist/scenes/timeline.js +26 -0
  332. package/dist/scenes/timeouts.d.ts +6 -0
  333. package/dist/scenes/timeouts.js +17 -0
  334. package/dist/scenes/training-captions.d.ts +14 -0
  335. package/dist/scenes/training-captions.js +98 -0
  336. package/dist/scenes/training-report.d.ts +10 -0
  337. package/dist/scenes/training-report.js +78 -0
  338. package/dist/scenes/training-transcript.d.ts +24 -0
  339. package/dist/scenes/training-transcript.js +204 -0
  340. package/dist/scenes/training.d.ts +10 -0
  341. package/dist/scenes/training.js +134 -0
  342. package/dist/scenes/types.d.ts +1872 -0
  343. package/dist/scenes/types.js +8 -0
  344. package/dist/scenes/visual-audit-contact-sheets.d.ts +6 -0
  345. package/dist/scenes/visual-audit-contact-sheets.js +119 -0
  346. package/dist/scenes/visual-audit-fixtures.d.ts +25 -0
  347. package/dist/scenes/visual-audit-fixtures.js +210 -0
  348. package/dist/scenes/visual-audit-report.d.ts +11 -0
  349. package/dist/scenes/visual-audit-report.js +85 -0
  350. package/dist/scenes/visual-audit-review.d.ts +23 -0
  351. package/dist/scenes/visual-audit-review.js +829 -0
  352. package/dist/scenes/visual-audit-routes.d.ts +13 -0
  353. package/dist/scenes/visual-audit-routes.js +308 -0
  354. package/dist/scenes/visual-audit.d.ts +3 -0
  355. package/dist/scenes/visual-audit.js +596 -0
  356. package/dist/scripts/build-dist.js +154 -40
  357. package/dist/scripts/check-build-warnings.js +42 -53
  358. package/dist/scripts/cleanup-markdown.js +1 -1
  359. package/dist/scripts/cli-test-fixtures.js +24 -28
  360. package/dist/scripts/migrate-journey-csv-to-guarantees.js +140 -0
  361. package/dist/scripts/package-tools.js +12 -1
  362. package/dist/scripts/prepare.js +3 -7
  363. package/dist/scripts/release-verify.js +2 -5
  364. package/dist/scripts/run-fixture-astro-command.js +1 -1
  365. package/dist/scripts/template-catalog.test.js +68 -82
  366. package/dist/scripts/tenant-dev.js +0 -10
  367. package/dist/scripts/test-cloudflare-local.js +1 -1
  368. package/dist/scripts/test-scaffold.js +0 -1
  369. package/dist/scripts/test-smoke.js +3 -3
  370. package/dist/scripts/treeseed-build-dist.js +4 -7
  371. package/dist/scripts/treeseed-release-verify.js +1 -1
  372. package/dist/scripts/verify-driver.js +30 -21
  373. package/dist/scripts/workflow-commands.test.js +18 -27
  374. package/dist/scripts/workspace-command-e2e.js +1 -1
  375. package/dist/scripts/workspace-lint.js +6 -0
  376. package/dist/scripts/workspace-release-test.js +90 -1
  377. package/dist/scripts/workspace-test.js +6 -0
  378. package/dist/sdk-dispatch.d.ts +1 -1
  379. package/dist/sdk-dispatch.js +0 -16
  380. package/dist/sdk-fields.d.ts +1 -1
  381. package/dist/sdk-filters.d.ts +1 -1
  382. package/dist/sdk-types.d.ts +1184 -113
  383. package/dist/sdk-types.js +393 -0
  384. package/dist/sdk.d.ts +74 -79
  385. package/dist/sdk.js +27 -36
  386. package/dist/secrets-capability.d.ts +421 -0
  387. package/dist/secrets-capability.js +530 -0
  388. package/dist/seeds/normalize.js +1 -0
  389. package/dist/seeds/planner.js +38 -0
  390. package/dist/seeds/schema.js +293 -4
  391. package/dist/seeds/types.d.ts +60 -0
  392. package/dist/seeds/types.js +9 -1
  393. package/dist/service-credentials.d.ts +54 -0
  394. package/dist/service-credentials.js +112 -0
  395. package/dist/stores/cursor-store.d.ts +2 -2
  396. package/dist/stores/envelopes.d.ts +1 -1
  397. package/dist/stores/helpers.d.ts +1 -1
  398. package/dist/stores/lease-store.d.ts +2 -2
  399. package/dist/stores/message-store.d.ts +2 -2
  400. package/dist/stores/operational-store.d.ts +3 -26
  401. package/dist/stores/operational-store.js +0 -225
  402. package/dist/stores/project-workflow-store.d.ts +2 -2
  403. package/dist/stores/run-store.d.ts +2 -3
  404. package/dist/stores/run-store.js +0 -98
  405. package/dist/stores/subscription-store.d.ts +2 -3
  406. package/dist/stores/subscription-store.js +0 -100
  407. package/dist/template-catalog.d.ts +1 -1
  408. package/dist/template-launch-requirements.d.ts +2 -2
  409. package/dist/template-launch-ui.d.ts +2 -2
  410. package/dist/treedx/adapters.d.ts +6 -6
  411. package/dist/treedx/client.d.ts +1 -1
  412. package/dist/treedx/errors.d.ts +1 -1
  413. package/dist/treedx/federated-client.d.ts +3 -3
  414. package/dist/treedx/graph-adapter.d.ts +2 -2
  415. package/dist/treedx/index.d.ts +14 -14
  416. package/dist/treedx/market-integration.d.ts +1 -1
  417. package/dist/treedx/ports.d.ts +30 -30
  418. package/dist/treedx/query-adapter.d.ts +3 -3
  419. package/dist/treedx/registry-client.d.ts +2 -2
  420. package/dist/treedx/repository-adapter.d.ts +4 -4
  421. package/dist/treedx/repository-adapter.js +14 -3
  422. package/dist/treedx/sdk-integration.d.ts +3 -3
  423. package/dist/treedx/types.d.ts +2 -2
  424. package/dist/treedx/workspace-adapter.d.ts +2 -2
  425. package/dist/treedx-backends.d.ts +13 -11
  426. package/dist/treedx-backends.js +52 -50
  427. package/dist/treedx-client.d.ts +3 -0
  428. package/dist/treedx-client.js +10 -1
  429. package/dist/treeseed/services/compose.yml +2 -3
  430. package/dist/treeseed/template-catalog/catalog.fixture.json +4 -4
  431. package/dist/types/agents.d.ts +256 -0
  432. package/dist/types/agents.js +42 -1
  433. package/dist/verification.d.ts +1 -0
  434. package/dist/verification.js +143 -14
  435. package/dist/workflow/operations.d.ts +510 -559
  436. package/dist/workflow/operations.js +1891 -1342
  437. package/dist/workflow/policy.js +19 -7
  438. package/dist/workflow/runs.d.ts +9 -3
  439. package/dist/workflow/runs.js +66 -26
  440. package/dist/workflow/session.d.ts +4 -1
  441. package/dist/workflow/session.js +50 -10
  442. package/dist/workflow/worktrees.d.ts +6 -2
  443. package/dist/workflow/worktrees.js +98 -15
  444. package/dist/workflow-state.d.ts +5 -5
  445. package/dist/workflow-state.js +27 -17
  446. package/dist/workflow-support.d.ts +26 -25
  447. package/dist/workflow-support.js +27 -31
  448. package/dist/workflow.d.ts +46 -16
  449. package/dist/workflow.js +19 -7
  450. package/drizzle/d1/0000_treeseed_d1.sql +0 -18
  451. package/drizzle/market/0000_market_control_plane.sql +1793 -1499
  452. package/drizzle/market/0005_agent_capacity_coordination.sql +145 -0
  453. package/drizzle/market/0006_provider_assignment_lifecycle.sql +9 -0
  454. package/drizzle/market/0007_agent_architecture_gap_closure.sql +157 -0
  455. package/drizzle/market/0008_agent_capacity_operational_closure.sql +27 -0
  456. package/drizzle/market/0009_agent_capacity_runtime_hardening.sql +29 -0
  457. package/drizzle/market/0010_secrets_capability_persistence.sql +130 -0
  458. package/drizzle/market/0011_github_app_adapter.sql +47 -0
  459. package/drizzle/market/0012_workday_test_runs.sql +44 -0
  460. package/drizzle/market/0013_runtime_task_lifecycle.sql +39 -0
  461. package/drizzle/market/0014_governance_pipeline.sql +189 -0
  462. package/package.json +75 -18
  463. package/scripts/{verify-driver.mjs → verify-driver.ts} +19 -4
  464. package/templates/github/deploy-web.workflow.yml +12 -8
  465. package/dist/operations/services/mailpit-runtime.d.ts +0 -20
  466. package/dist/operations/services/mailpit-runtime.js +0 -67
  467. package/dist/operations/services/release-candidate.d.ts +0 -60
  468. package/dist/operations/services/release-candidate.js +0 -953
  469. package/dist/scripts/ensure-mailpit.js +0 -48
  470. package/dist/scripts/logs-mailpit.js +0 -2
  471. package/dist/scripts/run-ts.js +0 -45
  472. package/dist/scripts/stop-mailpit.js +0 -5
  473. package/dist/scripts/treeseed-run-ts.js +0 -45
@@ -40,50 +40,46 @@ const workDays = pgTable("work_days", {
40
40
  createdAt: text("created_at").notNull(),
41
41
  updatedAt: text("updated_at").notNull()
42
42
  });
43
- const tasks = pgTable("tasks", {
43
+ const runtimeTasks = pgTable("runtime_tasks", {
44
44
  id: text("id").primaryKey(),
45
+ projectId: text("project_id").notNull(),
45
46
  workDayId: text("work_day_id").notNull(),
46
47
  agentId: text("agent_id").notNull(),
47
- typeColumn: text("type").notNull(),
48
- state: text("state").notNull(),
49
- priority: integer("priority").notNull().default(0),
48
+ type: text("type").notNull(),
50
49
  idempotencyKey: text("idempotency_key").notNull().unique(),
51
50
  payloadJson: text("payload_json").notNull(),
52
- payloadHash: text("payload_hash"),
53
- attemptCount: integer("attempt_count").notNull().default(0),
54
- maxAttempts: integer("max_attempts").notNull().default(3),
51
+ state: text("state").notNull(),
55
52
  claimedBy: text("claimed_by"),
53
+ claimedAt: text("claimed_at"),
56
54
  leaseExpiresAt: text("lease_expires_at"),
57
- availableAt: text("available_at").notNull(),
58
- lastErrorCode: text("last_error_code"),
59
- lastErrorMessage: text("last_error_message"),
60
- graphVersion: text("graph_version"),
61
- parentTaskId: text("parent_task_id"),
55
+ attempts: integer("attempts").notNull().default(0),
62
56
  createdAt: text("created_at").notNull(),
63
- startedAt: text("started_at"),
64
- completedAt: text("completed_at"),
65
57
  updatedAt: text("updated_at").notNull()
66
58
  }, (table) => [
67
- index("idx_tasks_runnable").on(table.state, table.priority, table.availableAt),
68
- index("idx_tasks_work_day_agent").on(table.workDayId, table.agentId, table.createdAt)
59
+ index("idx_runtime_tasks_project_workday_state").on(table.projectId, table.workDayId, table.state, table.createdAt)
69
60
  ]);
70
- const taskEvents = pgTable("task_events", {
61
+ const runtimeTaskEvents = pgTable("runtime_task_events", {
71
62
  id: text("id").primaryKey(),
72
63
  taskId: text("task_id").notNull(),
73
- seq: integer("seq").notNull(),
74
64
  kind: text("kind").notNull(),
75
65
  dataJson: text("data_json").notNull(),
66
+ actor: text("actor"),
76
67
  createdAt: text("created_at").notNull()
77
68
  }, (table) => [
78
- uniqueIndex("idx_task_events_seq").on(table.taskId, table.seq)
69
+ index("idx_runtime_task_events_task_created").on(table.taskId, table.createdAt)
79
70
  ]);
80
- const taskOutputs = pgTable("task_outputs", {
71
+ const runtimeTaskOutputs = pgTable("runtime_task_outputs", {
81
72
  id: text("id").primaryKey(),
82
73
  taskId: text("task_id").notNull(),
83
74
  outputJson: text("output_json").notNull(),
84
75
  outputRef: text("output_ref"),
85
- createdAt: text("created_at").notNull()
86
- });
76
+ summaryJson: text("summary_json"),
77
+ actor: text("actor"),
78
+ createdAt: text("created_at").notNull(),
79
+ updatedAt: text("updated_at").notNull()
80
+ }, (table) => [
81
+ index("idx_runtime_task_outputs_task_created").on(table.taskId, table.createdAt)
82
+ ]);
87
83
  const graphRuns = pgTable("graph_runs", {
88
84
  id: text("id").primaryKey(),
89
85
  workDayId: text("work_day_id").notNull(),
@@ -294,6 +290,360 @@ const webSessions = pgTable("web_sessions", {
294
290
  }, (table) => [
295
291
  index("idx_web_sessions_user_id").on(table.userId)
296
292
  ]);
293
+ const commonsParticipants = pgTable("commons_participants", {
294
+ id: text("id").primaryKey(),
295
+ userId: text("user_id").notNull(),
296
+ teamId: text("team_id").notNull(),
297
+ status: text("status").notNull().default("active"),
298
+ displayName: text("display_name"),
299
+ verifiedEmail: integer("verified_email").notNull().default(0),
300
+ baseWeight: real("base_weight").notNull().default(1),
301
+ trustWeight: real("trust_weight").notNull().default(0),
302
+ contributionWeight: real("contribution_weight").notNull().default(0),
303
+ stakeholderWeight: real("stakeholder_weight").notNull().default(0),
304
+ delegatedWeight: real("delegated_weight").notNull().default(0),
305
+ totalWeight: real("total_weight").notNull().default(1),
306
+ metadataJson: text("metadata_json").notNull().default("{}"),
307
+ createdAt: text("created_at").notNull(),
308
+ updatedAt: text("updated_at").notNull()
309
+ }, (table) => [
310
+ uniqueIndex("idx_commons_participants_user").on(table.userId),
311
+ index("idx_commons_participants_team_status").on(table.teamId, table.status, table.updatedAt)
312
+ ]);
313
+ const commonsQuestions = pgTable("commons_questions", {
314
+ id: text("id").primaryKey(),
315
+ participantId: text("participant_id").notNull(),
316
+ userId: text("user_id").notNull(),
317
+ teamId: text("team_id").notNull(),
318
+ status: text("status").notNull().default("open"),
319
+ title: text("title").notNull(),
320
+ body: text("body").notNull(),
321
+ answer: text("answer"),
322
+ convertedProposalId: text("converted_proposal_id"),
323
+ metadataJson: text("metadata_json").notNull().default("{}"),
324
+ createdAt: text("created_at").notNull(),
325
+ updatedAt: text("updated_at").notNull()
326
+ }, (table) => [
327
+ index("idx_commons_questions_status").on(table.status, table.updatedAt),
328
+ index("idx_commons_questions_participant").on(table.participantId, table.status, table.updatedAt)
329
+ ]);
330
+ const commonsProposals = pgTable("commons_proposals", {
331
+ id: text("id").primaryKey(),
332
+ participantId: text("participant_id").notNull(),
333
+ userId: text("user_id").notNull(),
334
+ teamId: text("team_id").notNull(),
335
+ status: text("status").notNull().default("draft"),
336
+ title: text("title").notNull(),
337
+ summary: text("summary").notNull(),
338
+ body: text("body").notNull(),
339
+ scope: text("scope").notNull().default("treeseed_commons"),
340
+ decisionType: text("decision_type").notNull().default("advisory"),
341
+ contentProposalSlug: text("content_proposal_slug"),
342
+ contentDecisionSlug: text("content_decision_slug"),
343
+ backingCount: integer("backing_count").notNull().default(0),
344
+ voteSupportWeight: real("vote_support_weight").notNull().default(0),
345
+ voteObjectWeight: real("vote_object_weight").notNull().default(0),
346
+ voteAbstainWeight: real("vote_abstain_weight").notNull().default(0),
347
+ qualifiedAt: text("qualified_at"),
348
+ votingStartsAt: text("voting_starts_at"),
349
+ votingEndsAt: text("voting_ends_at"),
350
+ stewardDecisionAt: text("steward_decision_at"),
351
+ stewardDecisionBy: text("steward_decision_by"),
352
+ metadataJson: text("metadata_json").notNull().default("{}"),
353
+ createdAt: text("created_at").notNull(),
354
+ updatedAt: text("updated_at").notNull()
355
+ }, (table) => [
356
+ index("idx_commons_proposals_status").on(table.status, table.updatedAt),
357
+ index("idx_commons_proposals_participant").on(table.participantId, table.status, table.updatedAt),
358
+ index("idx_commons_proposals_scope").on(table.scope, table.status, table.updatedAt)
359
+ ]);
360
+ const commonsWeightSnapshots = pgTable("commons_weight_snapshots", {
361
+ id: text("id").primaryKey(),
362
+ participantId: text("participant_id").notNull(),
363
+ policyVersion: text("policy_version").notNull(),
364
+ baseWeight: real("base_weight").notNull().default(1),
365
+ verifiedEmailWeight: real("verified_email_weight").notNull().default(0),
366
+ accountAgeWeight: real("account_age_weight").notNull().default(0),
367
+ contributionWeight: real("contribution_weight").notNull().default(0),
368
+ stakeholderWeight: real("stakeholder_weight").notNull().default(0),
369
+ trustRoleWeight: real("trust_role_weight").notNull().default(0),
370
+ delegatedWeight: real("delegated_weight").notNull().default(0),
371
+ totalWeight: real("total_weight").notNull().default(1),
372
+ evidenceJson: text("evidence_json").notNull().default("{}"),
373
+ createdAt: text("created_at").notNull()
374
+ }, (table) => [
375
+ index("idx_commons_weight_snapshots_participant").on(table.participantId, table.createdAt)
376
+ ]);
377
+ const commonsProposalBackings = pgTable("commons_proposal_backings", {
378
+ id: text("id").primaryKey(),
379
+ proposalId: text("proposal_id").notNull(),
380
+ participantId: text("participant_id").notNull(),
381
+ userId: text("user_id").notNull(),
382
+ weightSnapshotId: text("weight_snapshot_id").notNull(),
383
+ weight: real("weight").notNull(),
384
+ reason: text("reason"),
385
+ createdAt: text("created_at").notNull()
386
+ }, (table) => [
387
+ uniqueIndex("idx_commons_proposal_backings_once").on(table.proposalId, table.participantId),
388
+ index("idx_commons_proposal_backings_proposal").on(table.proposalId, table.createdAt)
389
+ ]);
390
+ const commonsProposalVotes = pgTable("commons_proposal_votes", {
391
+ id: text("id").primaryKey(),
392
+ proposalId: text("proposal_id").notNull(),
393
+ participantId: text("participant_id").notNull(),
394
+ userId: text("user_id").notNull(),
395
+ vote: text("vote").notNull(),
396
+ weightSnapshotId: text("weight_snapshot_id").notNull(),
397
+ weight: real("weight").notNull(),
398
+ reason: text("reason"),
399
+ createdAt: text("created_at").notNull(),
400
+ updatedAt: text("updated_at").notNull()
401
+ }, (table) => [
402
+ uniqueIndex("idx_commons_proposal_votes_once").on(table.proposalId, table.participantId),
403
+ index("idx_commons_proposal_votes_proposal").on(table.proposalId, table.vote, table.updatedAt)
404
+ ]);
405
+ const commonsDelegations = pgTable("commons_delegations", {
406
+ id: text("id").primaryKey(),
407
+ fromParticipantId: text("from_participant_id").notNull(),
408
+ toParticipantId: text("to_participant_id").notNull(),
409
+ scope: text("scope").notNull().default("treeseed_commons"),
410
+ status: text("status").notNull().default("active"),
411
+ weightLimit: real("weight_limit"),
412
+ reason: text("reason"),
413
+ createdAt: text("created_at").notNull(),
414
+ revokedAt: text("revoked_at")
415
+ }, (table) => [
416
+ uniqueIndex("idx_commons_delegations_active").on(table.fromParticipantId, table.toParticipantId, table.scope, table.status),
417
+ index("idx_commons_delegations_to").on(table.toParticipantId, table.status)
418
+ ]);
419
+ const commonsDecisions = pgTable("commons_decisions", {
420
+ id: text("id").primaryKey(),
421
+ proposalId: text("proposal_id").notNull(),
422
+ status: text("status").notNull().default("proposed"),
423
+ decisionRecordId: text("decision_record_id"),
424
+ decisionRecordSlug: text("decision_record_slug"),
425
+ title: text("title").notNull(),
426
+ summary: text("summary").notNull(),
427
+ stewardReason: text("steward_reason"),
428
+ capacityBudget: text("capacity_budget"),
429
+ scheduledFor: text("scheduled_for"),
430
+ implementedAt: text("implemented_at"),
431
+ metadataJson: text("metadata_json").notNull().default("{}"),
432
+ createdAt: text("created_at").notNull(),
433
+ updatedAt: text("updated_at").notNull()
434
+ }, (table) => [
435
+ uniqueIndex("idx_commons_decisions_proposal").on(table.proposalId),
436
+ index("idx_commons_decisions_status").on(table.status, table.updatedAt)
437
+ ]);
438
+ const commonsGovernanceEvents = pgTable("commons_governance_events", {
439
+ id: text("id").primaryKey(),
440
+ eventType: text("event_type").notNull(),
441
+ actorType: text("actor_type").notNull().default("system"),
442
+ actorId: text("actor_id"),
443
+ participantId: text("participant_id"),
444
+ proposalId: text("proposal_id"),
445
+ questionId: text("question_id"),
446
+ decisionId: text("decision_id"),
447
+ priorState: text("prior_state"),
448
+ nextState: text("next_state"),
449
+ message: text("message"),
450
+ evidenceJson: text("evidence_json").notNull().default("{}"),
451
+ createdAt: text("created_at").notNull()
452
+ }, (table) => [
453
+ index("idx_commons_governance_events_proposal").on(table.proposalId, table.createdAt),
454
+ index("idx_commons_governance_events_participant").on(table.participantId, table.createdAt),
455
+ index("idx_commons_governance_events_type").on(table.eventType, table.createdAt)
456
+ ]);
457
+ const teamGovernancePolicies = pgTable("team_governance_policies", {
458
+ id: text("id").primaryKey(),
459
+ teamId: text("team_id").notNull(),
460
+ scope: text("scope").notNull().default("team"),
461
+ providerId: text("provider_id").notNull(),
462
+ providerVersion: text("provider_version").notNull().default("1"),
463
+ configJson: text("config_json").notNull().default("{}"),
464
+ active: integer("active").notNull().default(1),
465
+ createdBy: text("created_by"),
466
+ createdAt: text("created_at").notNull(),
467
+ updatedAt: text("updated_at").notNull(),
468
+ supersededAt: text("superseded_at")
469
+ }, (table) => [
470
+ index("idx_team_governance_policies_team_scope").on(table.teamId, table.scope, table.active)
471
+ ]);
472
+ const projectGovernancePolicies = pgTable("project_governance_policies", {
473
+ id: text("id").primaryKey(),
474
+ teamId: text("team_id").notNull(),
475
+ projectId: text("project_id").notNull(),
476
+ providerId: text("provider_id").notNull(),
477
+ providerVersion: text("provider_version").notNull().default("1"),
478
+ configJson: text("config_json").notNull().default("{}"),
479
+ active: integer("active").notNull().default(1),
480
+ createdBy: text("created_by"),
481
+ createdAt: text("created_at").notNull(),
482
+ updatedAt: text("updated_at").notNull(),
483
+ supersededAt: text("superseded_at")
484
+ }, (table) => [
485
+ index("idx_project_governance_policies_project").on(table.projectId, table.active)
486
+ ]);
487
+ const governanceProposals = pgTable("governance_proposals", {
488
+ id: text("id").primaryKey(),
489
+ teamId: text("team_id").notNull(),
490
+ projectId: text("project_id"),
491
+ scope: text("scope").notNull().default("project"),
492
+ status: text("status").notNull().default("draft"),
493
+ title: text("title").notNull(),
494
+ summary: text("summary").notNull(),
495
+ body: text("body").notNull(),
496
+ proposalType: text("proposal_type").notNull().default("implementation"),
497
+ contentProposalSlug: text("content_proposal_slug"),
498
+ contentDecisionSlug: text("content_decision_slug"),
499
+ activeVersion: integer("active_version").notNull().default(1),
500
+ activeContentHash: text("active_content_hash").notNull(),
501
+ governanceProviderId: text("governance_provider_id").notNull(),
502
+ governanceProviderVersion: text("governance_provider_version").notNull().default("1"),
503
+ governancePolicyId: text("governance_policy_id"),
504
+ decisionId: text("decision_id"),
505
+ votingStartsAt: text("voting_starts_at"),
506
+ votingEndsAt: text("voting_ends_at"),
507
+ closedAt: text("closed_at"),
508
+ closedReason: text("closed_reason"),
509
+ createdByType: text("created_by_type").notNull().default("user"),
510
+ createdById: text("created_by_id"),
511
+ metadataJson: text("metadata_json").notNull().default("{}"),
512
+ createdAt: text("created_at").notNull(),
513
+ updatedAt: text("updated_at").notNull()
514
+ }, (table) => [
515
+ index("idx_governance_proposals_team_status").on(table.teamId, table.status, table.updatedAt),
516
+ index("idx_governance_proposals_project_status").on(table.projectId, table.status, table.updatedAt),
517
+ index("idx_governance_proposals_scope_status").on(table.scope, table.status, table.updatedAt),
518
+ index("idx_governance_proposals_content_slug").on(table.contentProposalSlug)
519
+ ]);
520
+ const governanceProposalVersions = pgTable("governance_proposal_versions", {
521
+ id: text("id").primaryKey(),
522
+ proposalId: text("proposal_id").notNull(),
523
+ version: integer("version").notNull(),
524
+ title: text("title").notNull(),
525
+ summary: text("summary").notNull(),
526
+ body: text("body").notNull(),
527
+ contentHash: text("content_hash").notNull(),
528
+ changeReason: text("change_reason"),
529
+ createdByType: text("created_by_type").notNull().default("user"),
530
+ createdById: text("created_by_id"),
531
+ createdAt: text("created_at").notNull()
532
+ }, (table) => [
533
+ uniqueIndex("idx_governance_proposal_versions_unique").on(table.proposalId, table.version),
534
+ index("idx_governance_proposal_versions_proposal").on(table.proposalId, table.createdAt)
535
+ ]);
536
+ const governanceElectorateSnapshots = pgTable("governance_electorate_snapshots", {
537
+ id: text("id").primaryKey(),
538
+ proposalId: text("proposal_id").notNull(),
539
+ proposalVersion: integer("proposal_version").notNull(),
540
+ providerId: text("provider_id").notNull(),
541
+ providerVersion: text("provider_version").notNull().default("1"),
542
+ ruleSnapshotJson: text("rule_snapshot_json").notNull().default("{}"),
543
+ chambersJson: text("chambers_json").notNull().default("[]"),
544
+ eligibleVotersJson: text("eligible_voters_json").notNull().default("[]"),
545
+ delegationsJson: text("delegations_json").notNull().default("[]"),
546
+ eligibleWeightTotal: real("eligible_weight_total").notNull().default(0),
547
+ activeWeightTotal: real("active_weight_total").notNull().default(0),
548
+ createdAt: text("created_at").notNull()
549
+ }, (table) => [
550
+ index("idx_governance_electorate_snapshots_proposal").on(table.proposalId, table.proposalVersion)
551
+ ]);
552
+ const governanceProposalVotes = pgTable("governance_proposal_votes", {
553
+ id: text("id").primaryKey(),
554
+ proposalId: text("proposal_id").notNull(),
555
+ proposalVersion: integer("proposal_version").notNull(),
556
+ userId: text("user_id").notNull(),
557
+ vote: text("vote").notNull(),
558
+ reason: text("reason"),
559
+ chamberVotesJson: text("chamber_votes_json").notNull().default("{}"),
560
+ effectiveWeightsJson: text("effective_weights_json").notNull().default("{}"),
561
+ delegatedFromJson: text("delegated_from_json").notNull().default("[]"),
562
+ createdAt: text("created_at").notNull(),
563
+ updatedAt: text("updated_at").notNull()
564
+ }, (table) => [
565
+ uniqueIndex("idx_governance_proposal_votes_once").on(table.proposalId, table.proposalVersion, table.userId),
566
+ index("idx_governance_proposal_votes_proposal").on(table.proposalId, table.proposalVersion, table.vote)
567
+ ]);
568
+ const governanceVoteEvents = pgTable("governance_vote_events", {
569
+ id: text("id").primaryKey(),
570
+ proposalId: text("proposal_id").notNull(),
571
+ proposalVersion: integer("proposal_version").notNull(),
572
+ userId: text("user_id").notNull(),
573
+ priorVote: text("prior_vote"),
574
+ nextVote: text("next_vote").notNull(),
575
+ reason: text("reason"),
576
+ effectiveWeightsJson: text("effective_weights_json").notNull().default("{}"),
577
+ createdAt: text("created_at").notNull()
578
+ }, (table) => [
579
+ index("idx_governance_vote_events_proposal").on(table.proposalId, table.proposalVersion, table.createdAt)
580
+ ]);
581
+ const governanceDelegations = pgTable("governance_delegations", {
582
+ id: text("id").primaryKey(),
583
+ teamId: text("team_id").notNull(),
584
+ scope: text("scope").notNull().default("team"),
585
+ fromUserId: text("from_user_id").notNull(),
586
+ toUserId: text("to_user_id").notNull(),
587
+ chambersJson: text("chambers_json").notNull().default("[]"),
588
+ status: text("status").notNull().default("active"),
589
+ reason: text("reason"),
590
+ createdAt: text("created_at").notNull(),
591
+ revokedAt: text("revoked_at"),
592
+ expiresAt: text("expires_at"),
593
+ metadataJson: text("metadata_json").notNull().default("{}")
594
+ }, (table) => [
595
+ index("idx_governance_delegations_team_status").on(table.teamId, table.status),
596
+ index("idx_governance_delegations_from").on(table.fromUserId, table.status),
597
+ index("idx_governance_delegations_to").on(table.toUserId, table.status)
598
+ ]);
599
+ const governanceDecisions = pgTable("governance_decisions", {
600
+ id: text("id").primaryKey(),
601
+ teamId: text("team_id").notNull(),
602
+ projectId: text("project_id"),
603
+ proposalId: text("proposal_id").notNull(),
604
+ proposalVersion: integer("proposal_version").notNull(),
605
+ proposalContentHash: text("proposal_content_hash").notNull(),
606
+ status: text("status").notNull().default("creating"),
607
+ title: text("title").notNull(),
608
+ summary: text("summary").notNull(),
609
+ contentDecisionSlug: text("content_decision_slug"),
610
+ governanceProviderId: text("governance_provider_id").notNull(),
611
+ governanceRuleJson: text("governance_rule_json").notNull().default("{}"),
612
+ electorateSnapshotId: text("electorate_snapshot_id"),
613
+ voteResultJson: text("vote_result_json").notNull().default("{}"),
614
+ voterReasonsJson: text("voter_reasons_json").notNull().default("[]"),
615
+ proposalSnapshotJson: text("proposal_snapshot_json").notNull().default("{}"),
616
+ decisionRecordJson: text("decision_record_json").notNull().default("{}"),
617
+ createdByType: text("created_by_type").notNull().default("system"),
618
+ createdById: text("created_by_id"),
619
+ createdAt: text("created_at").notNull(),
620
+ updatedAt: text("updated_at").notNull(),
621
+ supersededAt: text("superseded_at")
622
+ }, (table) => [
623
+ uniqueIndex("idx_governance_decisions_proposal").on(table.proposalId),
624
+ index("idx_governance_decisions_project_status").on(table.projectId, table.status, table.updatedAt)
625
+ ]);
626
+ const governanceEvents = pgTable("governance_events", {
627
+ id: text("id").primaryKey(),
628
+ eventType: text("event_type").notNull(),
629
+ actorType: text("actor_type").notNull().default("system"),
630
+ actorId: text("actor_id"),
631
+ teamId: text("team_id").notNull(),
632
+ projectId: text("project_id"),
633
+ proposalId: text("proposal_id"),
634
+ decisionId: text("decision_id"),
635
+ proposalVersion: integer("proposal_version"),
636
+ priorState: text("prior_state"),
637
+ nextState: text("next_state"),
638
+ message: text("message"),
639
+ evidenceJson: text("evidence_json").notNull().default("{}"),
640
+ createdAt: text("created_at").notNull()
641
+ }, (table) => [
642
+ index("idx_governance_events_proposal").on(table.proposalId, table.createdAt),
643
+ index("idx_governance_events_decision").on(table.decisionId, table.createdAt),
644
+ index("idx_governance_events_team").on(table.teamId, table.createdAt),
645
+ index("idx_governance_events_project").on(table.projectId, table.createdAt)
646
+ ]);
297
647
  const projects = pgTable("projects", {
298
648
  id: text("id").primaryKey(),
299
649
  teamId: text("team_id").notNull(),
@@ -446,37 +796,814 @@ const catalogItems = pgTable("catalog_items", {
446
796
  createdAt: text("created_at").notNull(),
447
797
  updatedAt: text("updated_at").notNull()
448
798
  }, (table) => [
449
- uniqueIndex("idx_catalog_items_team_kind_slug").on(table.teamId, table.kind, table.slug),
450
- index("idx_catalog_items_team_kind").on(table.teamId, table.kind, table.updatedAt),
451
- index("idx_catalog_items_visibility_listing").on(table.visibility, table.listingEnabled, table.updatedAt)
799
+ uniqueIndex("idx_catalog_items_team_kind_slug").on(table.teamId, table.kind, table.slug),
800
+ index("idx_catalog_items_team_kind").on(table.teamId, table.kind, table.updatedAt),
801
+ index("idx_catalog_items_visibility_listing").on(table.visibility, table.listingEnabled, table.updatedAt)
802
+ ]);
803
+ const catalogArtifactVersions = pgTable("catalog_artifact_versions", {
804
+ id: text("id").primaryKey(),
805
+ itemId: text("item_id").notNull(),
806
+ teamId: text("team_id").notNull(),
807
+ kind: text("kind").notNull(),
808
+ version: text("version").notNull(),
809
+ contentKey: text("content_key").notNull(),
810
+ manifestKey: text("manifest_key"),
811
+ metadataJson: text("metadata_json"),
812
+ publishedAt: text("published_at").notNull(),
813
+ createdAt: text("created_at").notNull(),
814
+ updatedAt: text("updated_at").notNull()
815
+ }, (table) => [
816
+ uniqueIndex("idx_catalog_artifact_versions_item_version").on(table.itemId, table.version),
817
+ index("idx_catalog_artifact_versions_team_kind").on(table.teamId, table.kind, table.publishedAt)
818
+ ]);
819
+ const catalogItemCollaborators = pgTable("catalog_item_collaborators", {
820
+ id: text("id").primaryKey(),
821
+ itemId: text("item_id").notNull(),
822
+ subjectType: text("subject_type").notNull(),
823
+ subjectId: text("subject_id").notNull(),
824
+ role: text("role").notNull(),
825
+ metadataJson: text("metadata_json"),
826
+ createdAt: text("created_at").notNull(),
827
+ updatedAt: text("updated_at").notNull()
828
+ }, (table) => [
829
+ uniqueIndex("idx_catalog_item_collaborators_subject_role").on(table.itemId, table.subjectType, table.subjectId, table.role)
830
+ ]);
831
+ const commerceVendors = pgTable("commerce_vendors", {
832
+ id: text("id").primaryKey(),
833
+ teamId: text("team_id").notNull(),
834
+ displayName: text("display_name").notNull(),
835
+ slug: text("slug").notNull(),
836
+ status: text("status").notNull().default("submitted"),
837
+ trustLevel: text("trust_level").notNull().default("public_publisher"),
838
+ professionalEntitlementId: text("professional_entitlement_id"),
839
+ stripeAccountId: text("stripe_account_id"),
840
+ salesEnabled: integer("sales_enabled").notNull().default(0),
841
+ serviceSalesEnabled: integer("service_sales_enabled").notNull().default(0),
842
+ capacityListingsEnabled: integer("capacity_listings_enabled").notNull().default(0),
843
+ metadataJson: text("metadata_json").notNull().default("{}"),
844
+ createdAt: text("created_at").notNull(),
845
+ updatedAt: text("updated_at").notNull()
846
+ }, (table) => [
847
+ uniqueIndex("idx_commerce_vendors_team_id").on(table.teamId),
848
+ uniqueIndex("idx_commerce_vendors_slug").on(table.slug),
849
+ index("idx_commerce_vendors_status").on(table.status, table.updatedAt),
850
+ index("idx_commerce_vendors_trust_level").on(table.trustLevel, table.updatedAt)
851
+ ]);
852
+ const commerceVendorStripeAccounts = pgTable("commerce_vendor_stripe_accounts", {
853
+ id: text("id").primaryKey(),
854
+ vendorId: text("vendor_id").notNull(),
855
+ teamId: text("team_id").notNull(),
856
+ environment: text("environment").notNull().default("test"),
857
+ stripeAccountId: text("stripe_account_id").notNull(),
858
+ accountStatus: text("account_status").notNull().default("pending"),
859
+ onboardingStatus: text("onboarding_status").notNull().default("not_started"),
860
+ chargesEnabled: integer("charges_enabled").notNull().default(0),
861
+ payoutsEnabled: integer("payouts_enabled").notNull().default(0),
862
+ detailsSubmitted: integer("details_submitted").notNull().default(0),
863
+ requirementsCurrentlyDueJson: text("requirements_currently_due_json").notNull().default("[]"),
864
+ requirementsEventuallyDueJson: text("requirements_eventually_due_json").notNull().default("[]"),
865
+ requirementsPastDueJson: text("requirements_past_due_json").notNull().default("[]"),
866
+ requirementsDisabledReason: text("requirements_disabled_reason"),
867
+ capabilitiesJson: text("capabilities_json").notNull().default("{}"),
868
+ onboardingStartedAt: text("onboarding_started_at"),
869
+ onboardingCompletedAt: text("onboarding_completed_at"),
870
+ lastSyncedAt: text("last_synced_at"),
871
+ metadataJson: text("metadata_json").notNull().default("{}"),
872
+ createdAt: text("created_at").notNull(),
873
+ updatedAt: text("updated_at").notNull()
874
+ }, (table) => [
875
+ uniqueIndex("idx_commerce_vendor_stripe_accounts_vendor_env").on(table.vendorId, table.environment),
876
+ uniqueIndex("idx_commerce_vendor_stripe_accounts_stripe_env").on(table.stripeAccountId, table.environment),
877
+ index("idx_commerce_vendor_stripe_accounts_team_env").on(table.teamId, table.environment),
878
+ index("idx_commerce_vendor_stripe_accounts_status").on(table.accountStatus, table.updatedAt)
879
+ ]);
880
+ const commerceProducts = pgTable("commerce_products", {
881
+ id: text("id").primaryKey(),
882
+ vendorId: text("vendor_id").notNull(),
883
+ sellerTeamId: text("seller_team_id").notNull(),
884
+ kind: text("kind").notNull(),
885
+ slug: text("slug").notNull(),
886
+ title: text("title").notNull(),
887
+ summary: text("summary"),
888
+ description: text("description"),
889
+ status: text("status").notNull().default("draft"),
890
+ visibility: text("visibility").notNull().default("private"),
891
+ catalogItemId: text("catalog_item_id"),
892
+ currentVersionId: text("current_version_id"),
893
+ ownershipModel: text("ownership_model").notNull().default("team_owned"),
894
+ ownershipRecordId: text("ownership_record_id"),
895
+ supportPolicy: text("support_policy"),
896
+ license: text("license"),
897
+ metadataJson: text("metadata_json").notNull().default("{}"),
898
+ createdAt: text("created_at").notNull(),
899
+ updatedAt: text("updated_at").notNull()
900
+ }, (table) => [
901
+ uniqueIndex("idx_commerce_products_team_kind_slug").on(table.sellerTeamId, table.kind, table.slug),
902
+ index("idx_commerce_products_vendor_status").on(table.vendorId, table.status, table.updatedAt),
903
+ index("idx_commerce_products_catalog_item").on(table.catalogItemId),
904
+ index("idx_commerce_products_ownership_model").on(table.ownershipModel, table.updatedAt)
905
+ ]);
906
+ const commerceOwnershipRecords = pgTable("commerce_ownership_records", {
907
+ id: text("id").primaryKey(),
908
+ productId: text("product_id").notNull(),
909
+ model: text("model").notNull(),
910
+ canonicalOwnerType: text("canonical_owner_type").notNull(),
911
+ canonicalOwnerId: text("canonical_owner_id"),
912
+ sellerTeamId: text("seller_team_id").notNull(),
913
+ stewardTeamId: text("steward_team_id"),
914
+ governancePolicyId: text("governance_policy_id"),
915
+ publicSummary: text("public_summary"),
916
+ buyerVisible: integer("buyer_visible").notNull().default(1),
917
+ effectiveAt: text("effective_at").notNull(),
918
+ supersededAt: text("superseded_at"),
919
+ metadataJson: text("metadata_json").notNull().default("{}"),
920
+ createdAt: text("created_at").notNull(),
921
+ updatedAt: text("updated_at").notNull()
922
+ }, (table) => [
923
+ index("idx_commerce_ownership_product_effective").on(table.productId, table.effectiveAt),
924
+ index("idx_commerce_ownership_seller_effective").on(table.sellerTeamId, table.effectiveAt),
925
+ index("idx_commerce_ownership_model_effective").on(table.model, table.effectiveAt)
926
+ ]);
927
+ const commerceStewardshipAssignments = pgTable("commerce_stewardship_assignments", {
928
+ id: text("id").primaryKey(),
929
+ ownershipRecordId: text("ownership_record_id").notNull(),
930
+ productId: text("product_id").notNull(),
931
+ role: text("role").notNull(),
932
+ assigneeType: text("assignee_type").notNull(),
933
+ assigneeId: text("assignee_id"),
934
+ displayName: text("display_name"),
935
+ responsibilitiesJson: text("responsibilities_json").notNull().default("[]"),
936
+ visibleToBuyers: integer("visible_to_buyers").notNull().default(1),
937
+ startsAt: text("starts_at").notNull(),
938
+ endsAt: text("ends_at"),
939
+ metadataJson: text("metadata_json").notNull().default("{}"),
940
+ createdAt: text("created_at").notNull(),
941
+ updatedAt: text("updated_at").notNull()
942
+ }, (table) => [
943
+ index("idx_commerce_stewards_product_role").on(table.productId, table.role),
944
+ index("idx_commerce_stewards_ownership_role").on(table.ownershipRecordId, table.role),
945
+ index("idx_commerce_stewards_assignee").on(table.assigneeType, table.assigneeId)
946
+ ]);
947
+ const commerceContributions = pgTable("commerce_contributions", {
948
+ id: text("id").primaryKey(),
949
+ productId: text("product_id").notNull(),
950
+ productVersionId: text("product_version_id"),
951
+ contributorType: text("contributor_type").notNull(),
952
+ contributorId: text("contributor_id"),
953
+ displayName: text("display_name"),
954
+ role: text("role").notNull(),
955
+ summary: text("summary"),
956
+ attributionVisibility: text("attribution_visibility").notNull().default("public"),
957
+ agreementRef: text("agreement_ref"),
958
+ benefitWeight: real("benefit_weight"),
959
+ effectiveAt: text("effective_at").notNull(),
960
+ metadataJson: text("metadata_json").notNull().default("{}"),
961
+ createdAt: text("created_at").notNull(),
962
+ updatedAt: text("updated_at").notNull()
963
+ }, (table) => [
964
+ index("idx_commerce_contributions_product_effective").on(table.productId, table.effectiveAt),
965
+ index("idx_commerce_contributions_version_effective").on(table.productVersionId, table.effectiveAt),
966
+ index("idx_commerce_contributions_contributor").on(table.contributorType, table.contributorId)
967
+ ]);
968
+ const commerceGovernancePolicies = pgTable("commerce_governance_policies", {
969
+ id: text("id").primaryKey(),
970
+ productId: text("product_id"),
971
+ teamId: text("team_id"),
972
+ policyKind: text("policy_kind").notNull(),
973
+ title: text("title").notNull(),
974
+ approvalRulesJson: text("approval_rules_json").notNull().default("{}"),
975
+ quorumRulesJson: text("quorum_rules_json").notNull().default("{}"),
976
+ buyerVisibleSummary: text("buyer_visible_summary"),
977
+ status: text("status").notNull().default("draft"),
978
+ createdAt: text("created_at").notNull(),
979
+ updatedAt: text("updated_at").notNull()
980
+ }, (table) => [
981
+ index("idx_commerce_governance_policies_product").on(table.productId, table.status),
982
+ index("idx_commerce_governance_policies_team").on(table.teamId, table.policyKind, table.status)
983
+ ]);
984
+ const commerceOwnershipTransfers = pgTable("commerce_ownership_transfers", {
985
+ id: text("id").primaryKey(),
986
+ productId: text("product_id").notNull(),
987
+ fromOwnershipRecordId: text("from_ownership_record_id").notNull(),
988
+ toOwnershipRecordId: text("to_ownership_record_id").notNull(),
989
+ status: text("status").notNull().default("draft"),
990
+ reason: text("reason").notNull(),
991
+ approvalEvidenceJson: text("approval_evidence_json").notNull().default("{}"),
992
+ buyerVisibleImpact: text("buyer_visible_impact"),
993
+ effectiveAt: text("effective_at").notNull(),
994
+ requestedByType: text("requested_by_type").notNull().default("user"),
995
+ requestedById: text("requested_by_id").notNull().default("system"),
996
+ approvedByType: text("approved_by_type"),
997
+ approvedById: text("approved_by_id"),
998
+ approvedAt: text("approved_at"),
999
+ rejectedAt: text("rejected_at"),
1000
+ supersededAt: text("superseded_at"),
1001
+ metadataJson: text("metadata_json").notNull().default("{}"),
1002
+ createdAt: text("created_at").notNull()
1003
+ }, (table) => [
1004
+ index("idx_commerce_ownership_transfers_product").on(table.productId, table.effectiveAt),
1005
+ index("idx_commerce_ownership_transfers_product_status").on(table.productId, table.status, table.effectiveAt),
1006
+ index("idx_commerce_ownership_transfers_from_status").on(table.fromOwnershipRecordId, table.status),
1007
+ index("idx_commerce_ownership_transfers_to_status").on(table.toOwnershipRecordId, table.status)
1008
+ ]);
1009
+ const commerceSuccessionEvents = pgTable("commerce_succession_events", {
1010
+ id: text("id").primaryKey(),
1011
+ productId: text("product_id").notNull(),
1012
+ ownershipRecordId: text("ownership_record_id"),
1013
+ stewardshipAssignmentId: text("stewardship_assignment_id"),
1014
+ successorType: text("successor_type").notNull(),
1015
+ successorId: text("successor_id").notNull(),
1016
+ eventType: text("event_type").notNull(),
1017
+ status: text("status").notNull().default("submitted"),
1018
+ reason: text("reason"),
1019
+ evidenceJson: text("evidence_json").notNull().default("{}"),
1020
+ effectiveAt: text("effective_at"),
1021
+ createdByType: text("created_by_type").notNull(),
1022
+ createdById: text("created_by_id").notNull(),
1023
+ metadataJson: text("metadata_json").notNull().default("{}"),
1024
+ createdAt: text("created_at").notNull()
1025
+ }, (table) => [
1026
+ index("idx_commerce_succession_events_product").on(table.productId, table.eventType, table.createdAt),
1027
+ index("idx_commerce_succession_events_ownership").on(table.ownershipRecordId, table.eventType),
1028
+ index("idx_commerce_succession_events_successor").on(table.successorType, table.successorId)
1029
+ ]);
1030
+ const commerceProductVersions = pgTable("commerce_product_versions", {
1031
+ id: text("id").primaryKey(),
1032
+ productId: text("product_id").notNull(),
1033
+ version: text("version").notNull(),
1034
+ status: text("status").notNull().default("draft"),
1035
+ catalogArtifactVersionId: text("catalog_artifact_version_id"),
1036
+ manifestKey: text("manifest_key"),
1037
+ artifactKey: text("artifact_key"),
1038
+ integrity: text("integrity"),
1039
+ releaseNotes: text("release_notes"),
1040
+ compatibilityJson: text("compatibility_json").notNull().default("{}"),
1041
+ metadataJson: text("metadata_json").notNull().default("{}"),
1042
+ publishedAt: text("published_at"),
1043
+ createdAt: text("created_at").notNull(),
1044
+ updatedAt: text("updated_at").notNull()
1045
+ }, (table) => [
1046
+ uniqueIndex("idx_commerce_product_versions_product_version").on(table.productId, table.version),
1047
+ index("idx_commerce_product_versions_product_status").on(table.productId, table.status, table.createdAt),
1048
+ index("idx_commerce_product_versions_catalog_artifact").on(table.catalogArtifactVersionId)
1049
+ ]);
1050
+ const commerceOffers = pgTable("commerce_offers", {
1051
+ id: text("id").primaryKey(),
1052
+ productId: text("product_id").notNull(),
1053
+ productVersionId: text("product_version_id"),
1054
+ vendorId: text("vendor_id").notNull(),
1055
+ sellerTeamId: text("seller_team_id").notNull(),
1056
+ mode: text("mode").notNull(),
1057
+ status: text("status").notNull().default("draft"),
1058
+ title: text("title").notNull(),
1059
+ termsSummary: text("terms_summary"),
1060
+ accessScopeJson: text("access_scope_json").notNull().default("{}"),
1061
+ supportScopeJson: text("support_scope_json").notNull().default("{}"),
1062
+ fulfillmentMode: text("fulfillment_mode").notNull().default("automatic"),
1063
+ activePriceId: text("active_price_id"),
1064
+ stripeProductId: text("stripe_product_id"),
1065
+ stripeProductStatus: text("stripe_product_status").notNull().default("not_synced"),
1066
+ stripeProductSyncedAt: text("stripe_product_synced_at"),
1067
+ stripeProductSyncError: text("stripe_product_sync_error"),
1068
+ stripeProductMetadataJson: text("stripe_product_metadata_json").notNull().default("{}"),
1069
+ startsAt: text("starts_at"),
1070
+ endsAt: text("ends_at"),
1071
+ metadataJson: text("metadata_json").notNull().default("{}"),
1072
+ createdAt: text("created_at").notNull(),
1073
+ updatedAt: text("updated_at").notNull()
1074
+ }, (table) => [
1075
+ index("idx_commerce_offers_product_status").on(table.productId, table.status, table.updatedAt),
1076
+ index("idx_commerce_offers_vendor_status").on(table.vendorId, table.status, table.updatedAt),
1077
+ index("idx_commerce_offers_seller_status").on(table.sellerTeamId, table.status, table.updatedAt),
1078
+ index("idx_commerce_offers_active_price").on(table.activePriceId),
1079
+ index("idx_commerce_offers_stripe_product").on(table.stripeProductId),
1080
+ index("idx_commerce_offers_stripe_status").on(table.stripeProductStatus, table.updatedAt)
1081
+ ]);
1082
+ const commercePrices = pgTable("commerce_prices", {
1083
+ id: text("id").primaryKey(),
1084
+ offerId: text("offer_id").notNull(),
1085
+ amount: integer("amount").notNull(),
1086
+ currency: text("currency").notNull(),
1087
+ billingInterval: text("billing_interval").notNull(),
1088
+ status: text("status").notNull().default("draft"),
1089
+ stripeProductId: text("stripe_product_id"),
1090
+ stripePriceId: text("stripe_price_id"),
1091
+ stripeLookupKey: text("stripe_lookup_key"),
1092
+ stripeSyncStatus: text("stripe_sync_status").notNull().default("not_synced"),
1093
+ stripeSyncedAt: text("stripe_synced_at"),
1094
+ stripeSyncError: text("stripe_sync_error"),
1095
+ stripeMetadataJson: text("stripe_metadata_json").notNull().default("{}"),
1096
+ priceVersion: integer("price_version").notNull().default(1),
1097
+ taxBehavior: text("tax_behavior").notNull().default("unspecified"),
1098
+ metadataJson: text("metadata_json").notNull().default("{}"),
1099
+ createdAt: text("created_at").notNull(),
1100
+ updatedAt: text("updated_at").notNull()
1101
+ }, (table) => [
1102
+ uniqueIndex("idx_commerce_prices_offer_version").on(table.offerId, table.priceVersion),
1103
+ index("idx_commerce_prices_offer_status").on(table.offerId, table.status),
1104
+ index("idx_commerce_prices_stripe_price").on(table.stripePriceId),
1105
+ index("idx_commerce_prices_stripe_sync_status").on(table.stripeSyncStatus, table.updatedAt)
1106
+ ]);
1107
+ const commerceGovernanceEvents = pgTable("commerce_governance_events", {
1108
+ id: text("id").primaryKey(),
1109
+ actorType: text("actor_type").notNull(),
1110
+ actorId: text("actor_id"),
1111
+ action: text("action").notNull(),
1112
+ objectType: text("object_type").notNull(),
1113
+ objectId: text("object_id").notNull(),
1114
+ priorState: text("prior_state"),
1115
+ nextState: text("next_state"),
1116
+ reason: text("reason"),
1117
+ evidenceJson: text("evidence_json").notNull().default("{}"),
1118
+ relatedOrderId: text("related_order_id"),
1119
+ relatedOfferId: text("related_offer_id"),
1120
+ relatedProductId: text("related_product_id"),
1121
+ relatedTeamId: text("related_team_id"),
1122
+ createdAt: text("created_at").notNull()
1123
+ }, (table) => [
1124
+ index("idx_commerce_governance_events_object").on(table.objectType, table.objectId, table.createdAt),
1125
+ index("idx_commerce_governance_events_product").on(table.relatedProductId, table.createdAt),
1126
+ index("idx_commerce_governance_events_offer").on(table.relatedOfferId, table.createdAt),
1127
+ index("idx_commerce_governance_events_team").on(table.relatedTeamId, table.createdAt)
1128
+ ]);
1129
+ const commerceCarts = pgTable("commerce_carts", {
1130
+ id: text("id").primaryKey(),
1131
+ buyerTeamId: text("buyer_team_id"),
1132
+ buyerUserId: text("buyer_user_id"),
1133
+ status: text("status").notNull().default("active"),
1134
+ currency: text("currency"),
1135
+ metadataJson: text("metadata_json").notNull().default("{}"),
1136
+ createdAt: text("created_at").notNull(),
1137
+ updatedAt: text("updated_at").notNull()
1138
+ }, (table) => [
1139
+ index("idx_commerce_carts_buyer_team_status").on(table.buyerTeamId, table.status, table.updatedAt),
1140
+ index("idx_commerce_carts_buyer_user_status").on(table.buyerUserId, table.status, table.updatedAt)
1141
+ ]);
1142
+ const commerceCartItems = pgTable("commerce_cart_items", {
1143
+ id: text("id").primaryKey(),
1144
+ cartId: text("cart_id").notNull(),
1145
+ vendorId: text("vendor_id").notNull(),
1146
+ sellerTeamId: text("seller_team_id").notNull(),
1147
+ productId: text("product_id").notNull(),
1148
+ productVersionId: text("product_version_id"),
1149
+ offerId: text("offer_id").notNull(),
1150
+ priceId: text("price_id"),
1151
+ quantity: integer("quantity").notNull().default(1),
1152
+ unitAmount: integer("unit_amount").notNull().default(0),
1153
+ currency: text("currency").notNull(),
1154
+ mode: text("mode").notNull(),
1155
+ status: text("status").notNull().default("active"),
1156
+ metadataJson: text("metadata_json").notNull().default("{}"),
1157
+ createdAt: text("created_at").notNull(),
1158
+ updatedAt: text("updated_at").notNull()
1159
+ }, (table) => [
1160
+ index("idx_commerce_cart_items_cart_status").on(table.cartId, table.status),
1161
+ index("idx_commerce_cart_items_vendor_status").on(table.vendorId, table.status, table.updatedAt),
1162
+ index("idx_commerce_cart_items_offer").on(table.offerId),
1163
+ index("idx_commerce_cart_items_price").on(table.priceId)
1164
+ ]);
1165
+ const commerceCheckouts = pgTable("commerce_checkouts", {
1166
+ id: text("id").primaryKey(),
1167
+ cartId: text("cart_id").notNull(),
1168
+ buyerTeamId: text("buyer_team_id"),
1169
+ buyerUserId: text("buyer_user_id"),
1170
+ status: text("status").notNull().default("draft"),
1171
+ checkoutMode: text("checkout_mode").notNull().default("stripe_elements_grouped_vendor"),
1172
+ groupCount: integer("group_count").notNull().default(0),
1173
+ completedGroupCount: integer("completed_group_count").notNull().default(0),
1174
+ metadataJson: text("metadata_json").notNull().default("{}"),
1175
+ createdAt: text("created_at").notNull(),
1176
+ updatedAt: text("updated_at").notNull()
1177
+ }, (table) => [
1178
+ index("idx_commerce_checkouts_cart").on(table.cartId),
1179
+ index("idx_commerce_checkouts_buyer_team_status").on(table.buyerTeamId, table.status, table.updatedAt),
1180
+ index("idx_commerce_checkouts_buyer_user_status").on(table.buyerUserId, table.status, table.updatedAt)
1181
+ ]);
1182
+ const commerceOrders = pgTable("commerce_orders", {
1183
+ id: text("id").primaryKey(),
1184
+ checkoutId: text("checkout_id"),
1185
+ cartId: text("cart_id"),
1186
+ buyerTeamId: text("buyer_team_id"),
1187
+ buyerUserId: text("buyer_user_id"),
1188
+ vendorId: text("vendor_id"),
1189
+ sellerTeamId: text("seller_team_id"),
1190
+ status: text("status").notNull().default("draft"),
1191
+ currency: text("currency").notNull(),
1192
+ subtotalAmount: integer("subtotal_amount").notNull().default(0),
1193
+ totalAmount: integer("total_amount").notNull().default(0),
1194
+ refundedAmount: integer("refunded_amount").notNull().default(0),
1195
+ refundStatus: text("refund_status").notNull().default("none"),
1196
+ stripeCheckoutSessionId: text("stripe_checkout_session_id"),
1197
+ stripePaymentIntentId: text("stripe_payment_intent_id"),
1198
+ stripeSubscriptionId: text("stripe_subscription_id"),
1199
+ stripeCustomerId: text("stripe_customer_id"),
1200
+ stripeConnectedAccountId: text("stripe_connected_account_id"),
1201
+ ownershipSnapshotJson: text("ownership_snapshot_json").notNull().default("{}"),
1202
+ metadataJson: text("metadata_json").notNull().default("{}"),
1203
+ createdAt: text("created_at").notNull(),
1204
+ updatedAt: text("updated_at").notNull()
1205
+ }, (table) => [
1206
+ index("idx_commerce_orders_checkout").on(table.checkoutId),
1207
+ index("idx_commerce_orders_buyer_team_status").on(table.buyerTeamId, table.status, table.updatedAt),
1208
+ index("idx_commerce_orders_buyer_user_status").on(table.buyerUserId, table.status, table.updatedAt),
1209
+ index("idx_commerce_orders_vendor_status").on(table.vendorId, table.status, table.updatedAt),
1210
+ index("idx_commerce_orders_stripe_payment_intent").on(table.stripePaymentIntentId),
1211
+ index("idx_commerce_orders_stripe_subscription").on(table.stripeSubscriptionId)
1212
+ ]);
1213
+ const commerceOrderItems = pgTable("commerce_order_items", {
1214
+ id: text("id").primaryKey(),
1215
+ orderId: text("order_id").notNull(),
1216
+ vendorId: text("vendor_id").notNull(),
1217
+ sellerTeamId: text("seller_team_id").notNull(),
1218
+ productId: text("product_id").notNull(),
1219
+ productVersionId: text("product_version_id"),
1220
+ offerId: text("offer_id").notNull(),
1221
+ priceId: text("price_id"),
1222
+ mode: text("mode").notNull(),
1223
+ quantity: integer("quantity").notNull().default(1),
1224
+ unitAmount: integer("unit_amount").notNull().default(0),
1225
+ totalAmount: integer("total_amount").notNull().default(0),
1226
+ refundedAmount: integer("refunded_amount").notNull().default(0),
1227
+ refundStatus: text("refund_status").notNull().default("none"),
1228
+ currency: text("currency").notNull(),
1229
+ status: text("status").notNull().default("pending"),
1230
+ entitlementId: text("entitlement_id"),
1231
+ ownershipSnapshotJson: text("ownership_snapshot_json").notNull().default("{}"),
1232
+ accessScopeJson: text("access_scope_json").notNull().default("{}"),
1233
+ supportScopeJson: text("support_scope_json").notNull().default("{}"),
1234
+ metadataJson: text("metadata_json").notNull().default("{}"),
1235
+ createdAt: text("created_at").notNull(),
1236
+ updatedAt: text("updated_at").notNull()
1237
+ }, (table) => [
1238
+ index("idx_commerce_order_items_order").on(table.orderId),
1239
+ index("idx_commerce_order_items_product_status").on(table.productId, table.status),
1240
+ index("idx_commerce_order_items_offer_status").on(table.offerId, table.status),
1241
+ index("idx_commerce_order_items_entitlement").on(table.entitlementId)
1242
+ ]);
1243
+ const commercePaymentGroups = pgTable("commerce_payment_groups", {
1244
+ id: text("id").primaryKey(),
1245
+ checkoutId: text("checkout_id").notNull(),
1246
+ orderId: text("order_id").notNull(),
1247
+ vendorId: text("vendor_id").notNull(),
1248
+ sellerTeamId: text("seller_team_id").notNull(),
1249
+ connectedAccountId: text("connected_account_id"),
1250
+ groupKind: text("group_kind").notNull(),
1251
+ billingInterval: text("billing_interval"),
1252
+ status: text("status").notNull().default("pending"),
1253
+ currency: text("currency").notNull(),
1254
+ subtotalAmount: integer("subtotal_amount").notNull().default(0),
1255
+ totalAmount: integer("total_amount").notNull().default(0),
1256
+ stripePaymentIntentId: text("stripe_payment_intent_id"),
1257
+ stripeSubscriptionId: text("stripe_subscription_id"),
1258
+ stripeCustomerId: text("stripe_customer_id"),
1259
+ clientSecretLast4: text("client_secret_last4"),
1260
+ metadataJson: text("metadata_json").notNull().default("{}"),
1261
+ createdAt: text("created_at").notNull(),
1262
+ updatedAt: text("updated_at").notNull()
1263
+ }, (table) => [
1264
+ index("idx_commerce_payment_groups_checkout").on(table.checkoutId),
1265
+ index("idx_commerce_payment_groups_order").on(table.orderId),
1266
+ index("idx_commerce_payment_groups_vendor_status").on(table.vendorId, table.status, table.updatedAt),
1267
+ index("idx_commerce_payment_groups_payment_intent").on(table.stripePaymentIntentId),
1268
+ index("idx_commerce_payment_groups_subscription").on(table.stripeSubscriptionId)
1269
+ ]);
1270
+ const commerceSubscriptions = pgTable("commerce_subscriptions", {
1271
+ id: text("id").primaryKey(),
1272
+ orderId: text("order_id").notNull(),
1273
+ vendorId: text("vendor_id").notNull(),
1274
+ sellerTeamId: text("seller_team_id").notNull(),
1275
+ buyerTeamId: text("buyer_team_id"),
1276
+ buyerUserId: text("buyer_user_id"),
1277
+ offerId: text("offer_id").notNull(),
1278
+ priceId: text("price_id").notNull(),
1279
+ status: text("status").notNull(),
1280
+ renewalState: text("renewal_state").notNull().default("active"),
1281
+ stripeSubscriptionId: text("stripe_subscription_id").notNull(),
1282
+ stripeCustomerId: text("stripe_customer_id"),
1283
+ stripeConnectedAccountId: text("stripe_connected_account_id").notNull(),
1284
+ currentPeriodStart: text("current_period_start"),
1285
+ currentPeriodEnd: text("current_period_end"),
1286
+ cancelAtPeriodEnd: integer("cancel_at_period_end").notNull().default(0),
1287
+ canceledAt: text("canceled_at"),
1288
+ metadataJson: text("metadata_json").notNull().default("{}"),
1289
+ createdAt: text("created_at").notNull(),
1290
+ updatedAt: text("updated_at").notNull()
1291
+ }, (table) => [
1292
+ uniqueIndex("idx_commerce_subscriptions_stripe").on(table.stripeSubscriptionId, table.stripeConnectedAccountId),
1293
+ index("idx_commerce_subscriptions_buyer_team_status").on(table.buyerTeamId, table.status, table.updatedAt),
1294
+ index("idx_commerce_subscriptions_vendor_status").on(table.vendorId, table.status, table.updatedAt),
1295
+ index("idx_commerce_subscriptions_offer_status").on(table.offerId, table.status)
1296
+ ]);
1297
+ const commerceEntitlements = pgTable("commerce_entitlements", {
1298
+ id: text("id").primaryKey(),
1299
+ buyerTeamId: text("buyer_team_id"),
1300
+ buyerUserId: text("buyer_user_id"),
1301
+ sellerTeamId: text("seller_team_id").notNull(),
1302
+ productId: text("product_id").notNull(),
1303
+ productVersionId: text("product_version_id"),
1304
+ offerId: text("offer_id").notNull(),
1305
+ orderId: text("order_id"),
1306
+ orderItemId: text("order_item_id"),
1307
+ subscriptionId: text("subscription_id"),
1308
+ status: text("status").notNull().default("pending"),
1309
+ accessScopeJson: text("access_scope_json").notNull().default("{}"),
1310
+ startsAt: text("starts_at"),
1311
+ endsAt: text("ends_at"),
1312
+ renewalState: text("renewal_state").notNull().default("none"),
1313
+ fulfillmentArtifactRefsJson: text("fulfillment_artifact_refs_json").notNull().default("[]"),
1314
+ projectId: text("project_id"),
1315
+ catalogItemId: text("catalog_item_id"),
1316
+ ownershipSnapshotJson: text("ownership_snapshot_json").notNull().default("{}"),
1317
+ metadataJson: text("metadata_json").notNull().default("{}"),
1318
+ createdAt: text("created_at").notNull(),
1319
+ updatedAt: text("updated_at").notNull()
1320
+ }, (table) => [
1321
+ index("idx_commerce_entitlements_buyer_team_status").on(table.buyerTeamId, table.status, table.updatedAt),
1322
+ index("idx_commerce_entitlements_buyer_user_status").on(table.buyerUserId, table.status, table.updatedAt),
1323
+ index("idx_commerce_entitlements_product_status").on(table.productId, table.status),
1324
+ index("idx_commerce_entitlements_offer_status").on(table.offerId, table.status),
1325
+ index("idx_commerce_entitlements_order").on(table.orderId),
1326
+ index("idx_commerce_entitlements_subscription").on(table.subscriptionId),
1327
+ index("idx_commerce_entitlements_catalog_item").on(table.catalogItemId)
1328
+ ]);
1329
+ const commerceBuyerStripeCustomers = pgTable("commerce_buyer_stripe_customers", {
1330
+ id: text("id").primaryKey(),
1331
+ buyerTeamId: text("buyer_team_id"),
1332
+ buyerUserId: text("buyer_user_id"),
1333
+ vendorId: text("vendor_id").notNull(),
1334
+ connectedAccountId: text("connected_account_id").notNull(),
1335
+ environment: text("environment").notNull().default("test"),
1336
+ stripeCustomerId: text("stripe_customer_id").notNull(),
1337
+ metadataJson: text("metadata_json").notNull().default("{}"),
1338
+ createdAt: text("created_at").notNull(),
1339
+ updatedAt: text("updated_at").notNull()
1340
+ }, (table) => [
1341
+ uniqueIndex("idx_commerce_buyer_stripe_customers_team").on(table.vendorId, table.environment, table.buyerTeamId),
1342
+ uniqueIndex("idx_commerce_buyer_stripe_customers_user").on(table.vendorId, table.environment, table.buyerUserId),
1343
+ uniqueIndex("idx_commerce_buyer_stripe_customers_stripe").on(table.connectedAccountId, table.stripeCustomerId)
1344
+ ]);
1345
+ const commerceRefunds = pgTable("commerce_refunds", {
1346
+ id: text("id").primaryKey(),
1347
+ orderId: text("order_id").notNull(),
1348
+ orderItemId: text("order_item_id"),
1349
+ paymentGroupId: text("payment_group_id"),
1350
+ vendorId: text("vendor_id").notNull(),
1351
+ sellerTeamId: text("seller_team_id").notNull(),
1352
+ buyerTeamId: text("buyer_team_id"),
1353
+ buyerUserId: text("buyer_user_id"),
1354
+ amount: integer("amount").notNull(),
1355
+ currency: text("currency").notNull(),
1356
+ status: text("status").notNull().default("processing"),
1357
+ reason: text("reason"),
1358
+ stripeRefundId: text("stripe_refund_id"),
1359
+ stripePaymentIntentId: text("stripe_payment_intent_id"),
1360
+ stripeConnectedAccountId: text("stripe_connected_account_id"),
1361
+ idempotencyKey: text("idempotency_key").notNull(),
1362
+ requestedByType: text("requested_by_type").notNull(),
1363
+ requestedById: text("requested_by_id").notNull(),
1364
+ failureReason: text("failure_reason"),
1365
+ metadataJson: text("metadata_json").notNull().default("{}"),
1366
+ createdAt: text("created_at").notNull(),
1367
+ updatedAt: text("updated_at").notNull()
1368
+ }, (table) => [
1369
+ uniqueIndex("idx_commerce_refunds_stripe").on(table.stripeRefundId, table.stripeConnectedAccountId),
1370
+ uniqueIndex("idx_commerce_refunds_idempotency").on(table.idempotencyKey),
1371
+ index("idx_commerce_refunds_order").on(table.orderId, table.createdAt),
1372
+ index("idx_commerce_refunds_vendor_status").on(table.vendorId, table.status, table.updatedAt),
1373
+ index("idx_commerce_refunds_seller_status").on(table.sellerTeamId, table.status, table.updatedAt)
1374
+ ]);
1375
+ const commerceFulfillmentEvents = pgTable("commerce_fulfillment_events", {
1376
+ id: text("id").primaryKey(),
1377
+ orderId: text("order_id").notNull(),
1378
+ orderItemId: text("order_item_id"),
1379
+ entitlementId: text("entitlement_id"),
1380
+ vendorId: text("vendor_id").notNull(),
1381
+ sellerTeamId: text("seller_team_id").notNull(),
1382
+ productId: text("product_id").notNull(),
1383
+ productVersionId: text("product_version_id"),
1384
+ catalogItemId: text("catalog_item_id"),
1385
+ catalogArtifactVersionId: text("catalog_artifact_version_id"),
1386
+ eventType: text("event_type").notNull(),
1387
+ status: text("status").notNull().default("pending"),
1388
+ artifactRefsJson: text("artifact_refs_json").notNull().default("[]"),
1389
+ deliveryRefsJson: text("delivery_refs_json").notNull().default("[]"),
1390
+ message: text("message"),
1391
+ actorType: text("actor_type").notNull(),
1392
+ actorId: text("actor_id").notNull(),
1393
+ metadataJson: text("metadata_json").notNull().default("{}"),
1394
+ createdAt: text("created_at").notNull()
1395
+ }, (table) => [
1396
+ index("idx_commerce_fulfillment_events_order").on(table.orderId, table.createdAt),
1397
+ index("idx_commerce_fulfillment_events_entitlement").on(table.entitlementId, table.createdAt),
1398
+ index("idx_commerce_fulfillment_events_vendor_status").on(table.vendorId, table.status, table.createdAt),
1399
+ index("idx_commerce_fulfillment_events_product").on(table.productId, table.createdAt)
1400
+ ]);
1401
+ const commerceServiceRequests = pgTable("commerce_service_requests", {
1402
+ id: text("id").primaryKey(),
1403
+ buyerTeamId: text("buyer_team_id"),
1404
+ buyerUserId: text("buyer_user_id"),
1405
+ vendorId: text("vendor_id").notNull(),
1406
+ sellerTeamId: text("seller_team_id").notNull(),
1407
+ productId: text("product_id").notNull(),
1408
+ offerId: text("offer_id").notNull(),
1409
+ status: text("status").notNull().default("requested"),
1410
+ requestedScope: text("requested_scope").notNull(),
1411
+ approvedScope: text("approved_scope"),
1412
+ accessNeedsJson: text("access_needs_json").notNull().default("{}"),
1413
+ buyerVisibleSummary: text("buyer_visible_summary"),
1414
+ vendorPrivateNotes: text("vendor_private_notes"),
1415
+ activeQuoteId: text("active_quote_id"),
1416
+ approvedQuoteId: text("approved_quote_id"),
1417
+ contractId: text("contract_id"),
1418
+ relatedProjectId: text("related_project_id"),
1419
+ relatedWorkdayId: text("related_workday_id"),
1420
+ orderId: text("order_id"),
1421
+ entitlementId: text("entitlement_id"),
1422
+ ownershipSnapshotJson: text("ownership_snapshot_json").notNull().default("{}"),
1423
+ metadataJson: text("metadata_json").notNull().default("{}"),
1424
+ createdAt: text("created_at").notNull(),
1425
+ updatedAt: text("updated_at").notNull()
1426
+ }, (table) => [
1427
+ index("idx_commerce_service_requests_buyer_team").on(table.buyerTeamId, table.status, table.updatedAt),
1428
+ index("idx_commerce_service_requests_buyer_user").on(table.buyerUserId, table.status, table.updatedAt),
1429
+ index("idx_commerce_service_requests_vendor").on(table.vendorId, table.status, table.updatedAt),
1430
+ index("idx_commerce_service_requests_seller").on(table.sellerTeamId, table.status, table.updatedAt),
1431
+ index("idx_commerce_service_requests_offer").on(table.offerId, table.status),
1432
+ index("idx_commerce_service_requests_project").on(table.relatedProjectId, table.status),
1433
+ index("idx_commerce_service_requests_workday").on(table.relatedWorkdayId, table.status)
1434
+ ]);
1435
+ const commerceServiceQuotes = pgTable("commerce_service_quotes", {
1436
+ id: text("id").primaryKey(),
1437
+ requestId: text("request_id").notNull(),
1438
+ vendorId: text("vendor_id").notNull(),
1439
+ sellerTeamId: text("seller_team_id").notNull(),
1440
+ buyerTeamId: text("buyer_team_id"),
1441
+ buyerUserId: text("buyer_user_id"),
1442
+ quoteVersion: integer("quote_version").notNull().default(1),
1443
+ status: text("status").notNull().default("draft"),
1444
+ title: text("title").notNull(),
1445
+ scopeSummary: text("scope_summary").notNull(),
1446
+ deliverablesJson: text("deliverables_json").notNull().default("[]"),
1447
+ assumptionsJson: text("assumptions_json").notNull().default("[]"),
1448
+ accessRequirementsJson: text("access_requirements_json").notNull().default("{}"),
1449
+ governanceRequirementsJson: text("governance_requirements_json").notNull().default("{}"),
1450
+ amount: integer("amount").notNull(),
1451
+ currency: text("currency").notNull(),
1452
+ expiresAt: text("expires_at"),
1453
+ buyerApprovedAt: text("buyer_approved_at"),
1454
+ vendorApprovedAt: text("vendor_approved_at"),
1455
+ acceptedAt: text("accepted_at"),
1456
+ rejectedAt: text("rejected_at"),
1457
+ metadataJson: text("metadata_json").notNull().default("{}"),
1458
+ createdAt: text("created_at").notNull(),
1459
+ updatedAt: text("updated_at").notNull()
1460
+ }, (table) => [
1461
+ uniqueIndex("idx_commerce_service_quotes_request_version").on(table.requestId, table.quoteVersion),
1462
+ index("idx_commerce_service_quotes_request").on(table.requestId, table.status, table.updatedAt),
1463
+ index("idx_commerce_service_quotes_vendor").on(table.vendorId, table.status, table.updatedAt),
1464
+ index("idx_commerce_service_quotes_seller").on(table.sellerTeamId, table.status, table.updatedAt)
1465
+ ]);
1466
+ const commerceServiceContracts = pgTable("commerce_service_contracts", {
1467
+ id: text("id").primaryKey(),
1468
+ requestId: text("request_id").notNull(),
1469
+ quoteId: text("quote_id").notNull(),
1470
+ vendorId: text("vendor_id").notNull(),
1471
+ sellerTeamId: text("seller_team_id").notNull(),
1472
+ buyerTeamId: text("buyer_team_id"),
1473
+ buyerUserId: text("buyer_user_id"),
1474
+ productId: text("product_id").notNull(),
1475
+ offerId: text("offer_id").notNull(),
1476
+ status: text("status").notNull().default("pending_checkout"),
1477
+ amount: integer("amount").notNull(),
1478
+ currency: text("currency").notNull(),
1479
+ orderId: text("order_id"),
1480
+ orderItemId: text("order_item_id"),
1481
+ paymentGroupId: text("payment_group_id"),
1482
+ entitlementId: text("entitlement_id"),
1483
+ relatedProjectId: text("related_project_id"),
1484
+ relatedWorkdayId: text("related_workday_id"),
1485
+ ownershipSnapshotJson: text("ownership_snapshot_json").notNull().default("{}"),
1486
+ accessApprovalSnapshotJson: text("access_approval_snapshot_json").notNull().default("{}"),
1487
+ fulfillmentSummary: text("fulfillment_summary"),
1488
+ metadataJson: text("metadata_json").notNull().default("{}"),
1489
+ createdAt: text("created_at").notNull(),
1490
+ updatedAt: text("updated_at").notNull()
1491
+ }, (table) => [
1492
+ uniqueIndex("idx_commerce_service_contracts_request_quote").on(table.requestId, table.quoteId),
1493
+ index("idx_commerce_service_contracts_vendor").on(table.vendorId, table.status, table.updatedAt),
1494
+ index("idx_commerce_service_contracts_seller").on(table.sellerTeamId, table.status, table.updatedAt),
1495
+ index("idx_commerce_service_contracts_buyer_team").on(table.buyerTeamId, table.status, table.updatedAt),
1496
+ index("idx_commerce_service_contracts_buyer_user").on(table.buyerUserId, table.status, table.updatedAt),
1497
+ index("idx_commerce_service_contracts_order").on(table.orderId),
1498
+ index("idx_commerce_service_contracts_entitlement").on(table.entitlementId),
1499
+ index("idx_commerce_service_contracts_project").on(table.relatedProjectId),
1500
+ index("idx_commerce_service_contracts_workday").on(table.relatedWorkdayId)
1501
+ ]);
1502
+ const commerceServiceEvents = pgTable("commerce_service_events", {
1503
+ id: text("id").primaryKey(),
1504
+ requestId: text("request_id").notNull(),
1505
+ quoteId: text("quote_id"),
1506
+ contractId: text("contract_id"),
1507
+ eventType: text("event_type").notNull(),
1508
+ actorType: text("actor_type").notNull(),
1509
+ actorId: text("actor_id"),
1510
+ priorState: text("prior_state"),
1511
+ nextState: text("next_state"),
1512
+ message: text("message"),
1513
+ evidenceJson: text("evidence_json").notNull().default("{}"),
1514
+ createdAt: text("created_at").notNull()
1515
+ }, (table) => [
1516
+ index("idx_commerce_service_events_request").on(table.requestId, table.createdAt),
1517
+ index("idx_commerce_service_events_quote").on(table.quoteId, table.createdAt),
1518
+ index("idx_commerce_service_events_contract").on(table.contractId, table.createdAt),
1519
+ index("idx_commerce_service_events_type").on(table.eventType, table.createdAt)
452
1520
  ]);
453
- const catalogArtifactVersions = pgTable("catalog_artifact_versions", {
1521
+ const commerceCapacityListings = pgTable("commerce_capacity_listings", {
454
1522
  id: text("id").primaryKey(),
455
- itemId: text("item_id").notNull(),
456
- teamId: text("team_id").notNull(),
457
- kind: text("kind").notNull(),
458
- version: text("version").notNull(),
459
- contentKey: text("content_key").notNull(),
460
- manifestKey: text("manifest_key"),
461
- metadataJson: text("metadata_json"),
462
- publishedAt: text("published_at").notNull(),
1523
+ productId: text("product_id").notNull(),
1524
+ vendorId: text("vendor_id").notNull(),
1525
+ sellerTeamId: text("seller_team_id").notNull(),
1526
+ capacityProviderId: text("capacity_provider_id"),
1527
+ capacityProviderLaneId: text("capacity_provider_lane_id"),
1528
+ status: text("status").notNull().default("draft"),
1529
+ accessLevel: text("access_level").notNull().default("public_summary"),
1530
+ runtimeIsolationLevel: text("runtime_isolation_level").notNull().default("none"),
1531
+ humanInvolvementLevel: text("human_involvement_level").notNull().default("none"),
1532
+ aiInvolvementLevel: text("ai_involvement_level").notNull().default("none"),
1533
+ dataAccessLevel: text("data_access_level").notNull().default("none"),
1534
+ secretAccessLevel: text("secret_access_level").notNull().default("none"),
1535
+ supportedServiceTypesJson: text("supported_service_types_json").notNull().default("[]"),
1536
+ supportedRegionsJson: text("supported_regions_json").notNull().default("[]"),
1537
+ runtimeRequirementsJson: text("runtime_requirements_json").notNull().default("{}"),
1538
+ dataHandlingSummary: text("data_handling_summary"),
1539
+ buyerVisibleRiskSummary: text("buyer_visible_risk_summary"),
1540
+ governanceRequirementsJson: text("governance_requirements_json").notNull().default("{}"),
1541
+ supportPolicy: text("support_policy"),
1542
+ availabilitySummary: text("availability_summary"),
1543
+ ownershipSnapshotJson: text("ownership_snapshot_json").notNull().default("{}"),
1544
+ metadataJson: text("metadata_json").notNull().default("{}"),
463
1545
  createdAt: text("created_at").notNull(),
464
1546
  updatedAt: text("updated_at").notNull()
465
1547
  }, (table) => [
466
- uniqueIndex("idx_catalog_artifact_versions_item_version").on(table.itemId, table.version),
467
- index("idx_catalog_artifact_versions_team_kind").on(table.teamId, table.kind, table.publishedAt)
1548
+ uniqueIndex("idx_commerce_capacity_listings_product").on(table.productId),
1549
+ index("idx_commerce_capacity_listings_vendor_status").on(table.vendorId, table.status, table.updatedAt),
1550
+ index("idx_commerce_capacity_listings_seller_status").on(table.sellerTeamId, table.status, table.updatedAt),
1551
+ index("idx_commerce_capacity_listings_provider_status").on(table.capacityProviderId, table.status),
1552
+ index("idx_commerce_capacity_listings_lane_status").on(table.capacityProviderLaneId, table.status),
1553
+ index("idx_commerce_capacity_listings_access_status").on(table.accessLevel, table.status, table.updatedAt)
1554
+ ]);
1555
+ const commerceCapacityListingInquiries = pgTable("commerce_capacity_listing_inquiries", {
1556
+ id: text("id").primaryKey(),
1557
+ listingId: text("listing_id").notNull(),
1558
+ productId: text("product_id").notNull(),
1559
+ vendorId: text("vendor_id").notNull(),
1560
+ sellerTeamId: text("seller_team_id").notNull(),
1561
+ buyerTeamId: text("buyer_team_id"),
1562
+ buyerUserId: text("buyer_user_id"),
1563
+ status: text("status").notNull().default("requested"),
1564
+ requestedServiceType: text("requested_service_type"),
1565
+ requestedScope: text("requested_scope").notNull(),
1566
+ dataAccessRequestedJson: text("data_access_requested_json").notNull().default("{}"),
1567
+ secretAccessRequestedJson: text("secret_access_requested_json").notNull().default("{}"),
1568
+ relatedProjectId: text("related_project_id"),
1569
+ relatedWorkdayId: text("related_workday_id"),
1570
+ governanceEvidenceJson: text("governance_evidence_json").notNull().default("{}"),
1571
+ metadataJson: text("metadata_json").notNull().default("{}"),
1572
+ createdAt: text("created_at").notNull(),
1573
+ updatedAt: text("updated_at").notNull()
1574
+ }, (table) => [
1575
+ index("idx_commerce_capacity_inquiries_listing_status").on(table.listingId, table.status, table.updatedAt),
1576
+ index("idx_commerce_capacity_inquiries_buyer_team").on(table.buyerTeamId, table.status, table.updatedAt),
1577
+ index("idx_commerce_capacity_inquiries_buyer_user").on(table.buyerUserId, table.status, table.updatedAt),
1578
+ index("idx_commerce_capacity_inquiries_vendor_status").on(table.vendorId, table.status, table.updatedAt),
1579
+ index("idx_commerce_capacity_inquiries_seller_status").on(table.sellerTeamId, table.status, table.updatedAt),
1580
+ index("idx_commerce_capacity_inquiries_project").on(table.relatedProjectId, table.status),
1581
+ index("idx_commerce_capacity_inquiries_workday").on(table.relatedWorkdayId, table.status)
468
1582
  ]);
469
- const catalogItemCollaborators = pgTable("catalog_item_collaborators", {
1583
+ const commerceWebhookEvents = pgTable("commerce_webhook_events", {
470
1584
  id: text("id").primaryKey(),
471
- itemId: text("item_id").notNull(),
472
- subjectType: text("subject_type").notNull(),
473
- subjectId: text("subject_id").notNull(),
474
- role: text("role").notNull(),
475
- metadataJson: text("metadata_json"),
1585
+ provider: text("provider").notNull().default("stripe"),
1586
+ environment: text("environment").notNull().default("test"),
1587
+ eventId: text("event_id").notNull(),
1588
+ eventType: text("event_type").notNull(),
1589
+ connectedAccountId: text("connected_account_id"),
1590
+ status: text("status").notNull().default("received"),
1591
+ objectType: text("object_type"),
1592
+ objectId: text("object_id"),
1593
+ relatedOrderId: text("related_order_id"),
1594
+ relatedSubscriptionId: text("related_subscription_id"),
1595
+ payloadHash: text("payload_hash").notNull(),
1596
+ processingError: text("processing_error"),
1597
+ receivedAt: text("received_at").notNull(),
1598
+ processedAt: text("processed_at"),
476
1599
  createdAt: text("created_at").notNull(),
477
1600
  updatedAt: text("updated_at").notNull()
478
1601
  }, (table) => [
479
- uniqueIndex("idx_catalog_item_collaborators_subject_role").on(table.itemId, table.subjectType, table.subjectId, table.role)
1602
+ uniqueIndex("idx_commerce_webhook_events_provider_event").on(table.provider, table.environment, table.eventId),
1603
+ index("idx_commerce_webhook_events_status_received").on(table.status, table.receivedAt),
1604
+ index("idx_commerce_webhook_events_connected_type").on(table.connectedAccountId, table.eventType, table.receivedAt),
1605
+ index("idx_commerce_webhook_events_order").on(table.relatedOrderId),
1606
+ index("idx_commerce_webhook_events_subscription").on(table.relatedSubscriptionId)
480
1607
  ]);
481
1608
  const projectHosting = pgTable("project_hosting", {
482
1609
  id: text("id").primaryKey(),
@@ -921,6 +2048,10 @@ const capacityReservations = pgTable("capacity_reservations", {
921
2048
  capacityProviderId: text("capacity_provider_id").notNull(),
922
2049
  executionProviderId: text("execution_provider_id"),
923
2050
  laneId: text("lane_id").notNull(),
2051
+ allocationSetId: text("allocation_set_id"),
2052
+ projectAgentClassId: text("project_agent_class_id"),
2053
+ assignmentId: text("assignment_id"),
2054
+ mode: text("mode"),
924
2055
  teamId: text("team_id").notNull(),
925
2056
  projectId: text("project_id").notNull(),
926
2057
  workDayId: text("work_day_id"),
@@ -949,6 +2080,9 @@ const capacityLedgerEntries = pgTable("capacity_ledger_entries", {
949
2080
  capacityProviderId: text("capacity_provider_id").notNull(),
950
2081
  laneId: text("lane_id"),
951
2082
  reservationId: text("reservation_id"),
2083
+ assignmentId: text("assignment_id"),
2084
+ modeRunId: text("mode_run_id"),
2085
+ mode: text("mode"),
952
2086
  teamId: text("team_id").notNull(),
953
2087
  projectId: text("project_id"),
954
2088
  workDayId: text("work_day_id"),
@@ -1010,6 +2144,9 @@ const taskUsageActuals = pgTable("task_usage_actuals", {
1010
2144
  workDayId: text("work_day_id"),
1011
2145
  projectId: text("project_id").notNull(),
1012
2146
  taskSignature: text("task_signature").notNull(),
2147
+ assignmentId: text("assignment_id"),
2148
+ modeRunId: text("mode_run_id"),
2149
+ mode: text("mode"),
1013
2150
  capacityProviderId: text("capacity_provider_id"),
1014
2151
  executionProviderId: text("execution_provider_id"),
1015
2152
  laneId: text("lane_id"),
@@ -1061,6 +2198,481 @@ const nativeUsageObservations = pgTable("native_usage_observations", {
1061
2198
  index("idx_native_usage_observations_profile").on(table.projectId, table.taskSignature, table.executionProfileId, table.createdAt),
1062
2199
  index("idx_native_usage_observations_provider").on(table.executionProviderId, table.createdAt)
1063
2200
  ]);
2201
+ const capacityAllocationSets = pgTable("capacity_allocation_sets", {
2202
+ id: text("id").primaryKey(),
2203
+ teamId: text("team_id").notNull(),
2204
+ version: text("version").notNull(),
2205
+ status: text("status").notNull().default("draft"),
2206
+ effectiveFrom: text("effective_from"),
2207
+ effectiveUntil: text("effective_until"),
2208
+ policyJson: text("policy_json").notNull().default("{}"),
2209
+ slicesJson: text("slices_json").notNull().default("[]"),
2210
+ metadataJson: text("metadata_json").notNull().default("{}"),
2211
+ createdById: text("created_by_id"),
2212
+ activatedAt: text("activated_at"),
2213
+ supersededById: text("superseded_by_id"),
2214
+ createdAt: text("created_at").notNull(),
2215
+ updatedAt: text("updated_at").notNull()
2216
+ }, (table) => [
2217
+ index("idx_capacity_allocation_sets_team_status").on(table.teamId, table.status, table.version),
2218
+ index("idx_capacity_allocation_sets_team_created").on(table.teamId, table.createdAt)
2219
+ ]);
2220
+ const projectAgentClasses = pgTable("project_agent_classes", {
2221
+ id: text("id").primaryKey(),
2222
+ teamId: text("team_id").notNull(),
2223
+ projectId: text("project_id").notNull(),
2224
+ slug: text("slug").notNull(),
2225
+ name: text("name").notNull(),
2226
+ status: text("status").notNull().default("active"),
2227
+ allowedModesJson: text("allowed_modes_json").notNull().default("[]"),
2228
+ requiredCapabilitiesJson: text("required_capabilities_json").notNull().default("[]"),
2229
+ kernelProfileJson: text("kernel_profile_json").notNull().default("{}"),
2230
+ kernelPolicyJson: text("kernel_policy_json").notNull().default("{}"),
2231
+ handlerRefsJson: text("handler_refs_json").notNull().default("{}"),
2232
+ outputContractsJson: text("output_contracts_json").notNull().default("{}"),
2233
+ metadataJson: text("metadata_json").notNull().default("{}"),
2234
+ createdAt: text("created_at").notNull(),
2235
+ updatedAt: text("updated_at").notNull()
2236
+ }, (table) => [
2237
+ uniqueIndex("idx_project_agent_classes_project_slug").on(table.projectId, table.slug),
2238
+ index("idx_project_agent_classes_team_project").on(table.teamId, table.projectId, table.status)
2239
+ ]);
2240
+ const providerAvailabilitySessions = pgTable("provider_availability_sessions", {
2241
+ id: text("id").primaryKey(),
2242
+ teamId: text("team_id").notNull(),
2243
+ capacityProviderId: text("capacity_provider_id").notNull(),
2244
+ registrationId: text("registration_id"),
2245
+ environment: text("environment"),
2246
+ status: text("status").notNull().default("open"),
2247
+ checkedInAt: text("checked_in_at").notNull(),
2248
+ availableFrom: text("available_from"),
2249
+ availableUntil: text("available_until"),
2250
+ executionProvidersJson: text("execution_providers_json").notNull().default("[]"),
2251
+ capabilitiesJson: text("capabilities_json").notNull().default("[]"),
2252
+ grantsJson: text("grants_json").notNull().default("[]"),
2253
+ nativeLimitsJson: text("native_limits_json").notNull().default("{}"),
2254
+ runnerPressureJson: text("runner_pressure_json").notNull().default("{}"),
2255
+ constraintsJson: text("constraints_json").notNull().default("{}"),
2256
+ metadataJson: text("metadata_json").notNull().default("{}"),
2257
+ createdAt: text("created_at").notNull(),
2258
+ updatedAt: text("updated_at").notNull(),
2259
+ closedAt: text("closed_at")
2260
+ }, (table) => [
2261
+ index("idx_provider_availability_sessions_provider_status").on(table.capacityProviderId, table.status, table.checkedInAt),
2262
+ index("idx_provider_availability_sessions_team_status").on(table.teamId, table.status, table.checkedInAt)
2263
+ ]);
2264
+ const providerAssignments = pgTable("provider_assignments", {
2265
+ id: text("id").primaryKey(),
2266
+ teamId: text("team_id").notNull(),
2267
+ projectId: text("project_id").notNull(),
2268
+ capacityProviderId: text("capacity_provider_id").notNull(),
2269
+ providerSessionId: text("provider_session_id"),
2270
+ executionProviderId: text("execution_provider_id"),
2271
+ allocationSetId: text("allocation_set_id"),
2272
+ projectAgentClassId: text("project_agent_class_id").notNull(),
2273
+ reservationId: text("reservation_id"),
2274
+ workDayId: text("work_day_id"),
2275
+ taskId: text("task_id"),
2276
+ mode: text("mode").notNull(),
2277
+ status: text("status").notNull().default("pending"),
2278
+ leaseState: text("lease_state").notNull().default("unleased"),
2279
+ leaseExpiresAt: text("lease_expires_at"),
2280
+ leaseToken: text("lease_token"),
2281
+ leaseRenewedAt: text("lease_renewed_at"),
2282
+ runnerId: text("runner_id"),
2283
+ agentId: text("agent_id"),
2284
+ handlerId: text("handler_id"),
2285
+ capacityEnvelopeJson: text("capacity_envelope_json").notNull().default("{}"),
2286
+ decisionInputJson: text("decision_input_json").notNull().default("{}"),
2287
+ workspaceContextJson: text("workspace_context_json").notNull().default("{}"),
2288
+ allowedOutputsJson: text("allowed_outputs_json").notNull().default("{}"),
2289
+ explanationJson: text("explanation_json").notNull().default("{}"),
2290
+ attemptCount: integer("attempt_count").notNull().default(0),
2291
+ assignedAt: text("assigned_at"),
2292
+ claimedAt: text("claimed_at"),
2293
+ completedAt: text("completed_at"),
2294
+ returnedAt: text("returned_at"),
2295
+ failedAt: text("failed_at"),
2296
+ lifecycleReason: text("lifecycle_reason"),
2297
+ lifecycleCode: text("lifecycle_code"),
2298
+ lifecycleOutputJson: text("lifecycle_output_json").notNull().default("{}"),
2299
+ synthesizedFrom: text("synthesized_from"),
2300
+ synthesisKey: text("synthesis_key"),
2301
+ decisionId: text("decision_id"),
2302
+ proposalId: text("proposal_id"),
2303
+ fallbackOutputId: text("fallback_output_id"),
2304
+ treedxProxyHandleJson: text("treedx_proxy_handle_json").notNull().default("{}"),
2305
+ metadataJson: text("metadata_json").notNull().default("{}"),
2306
+ createdAt: text("created_at").notNull(),
2307
+ updatedAt: text("updated_at").notNull()
2308
+ }, (table) => [
2309
+ index("idx_provider_assignments_provider_status").on(table.capacityProviderId, table.status, table.leaseExpiresAt),
2310
+ index("idx_provider_assignments_project_mode").on(table.projectId, table.mode, table.status),
2311
+ index("idx_provider_assignments_lease").on(table.capacityProviderId, table.leaseState, table.leaseExpiresAt),
2312
+ index("idx_provider_assignments_runner").on(table.runnerId, table.leaseState),
2313
+ uniqueIndex("idx_provider_assignments_synthesis_key").on(table.teamId, table.synthesisKey),
2314
+ index("idx_provider_assignments_decision").on(table.decisionId, table.status),
2315
+ index("idx_provider_assignments_team_created").on(table.teamId, table.createdAt)
2316
+ ]);
2317
+ const agentModeRuns = pgTable("agent_mode_runs", {
2318
+ id: text("id").primaryKey(),
2319
+ teamId: text("team_id").notNull(),
2320
+ projectId: text("project_id").notNull(),
2321
+ providerAssignmentId: text("provider_assignment_id").notNull(),
2322
+ capacityProviderId: text("capacity_provider_id").notNull(),
2323
+ executionProviderId: text("execution_provider_id"),
2324
+ projectAgentClassId: text("project_agent_class_id").notNull(),
2325
+ agentId: text("agent_id"),
2326
+ handlerId: text("handler_id"),
2327
+ mode: text("mode").notNull(),
2328
+ status: text("status").notNull().default("queued"),
2329
+ selectedInputJson: text("selected_input_json").notNull().default("{}"),
2330
+ capacityEnvelopeJson: text("capacity_envelope_json").notNull().default("{}"),
2331
+ outputsJson: text("outputs_json").notNull().default("{}"),
2332
+ traceRefsJson: text("trace_refs_json").notNull().default("{}"),
2333
+ usageActualJson: text("usage_actual_json").notNull().default("{}"),
2334
+ validationJson: text("validation_json").notNull().default("{}"),
2335
+ fallbackReason: text("fallback_reason"),
2336
+ startedAt: text("started_at"),
2337
+ completedAt: text("completed_at"),
2338
+ failedAt: text("failed_at"),
2339
+ metadataJson: text("metadata_json").notNull().default("{}"),
2340
+ createdAt: text("created_at").notNull(),
2341
+ updatedAt: text("updated_at").notNull()
2342
+ }, (table) => [
2343
+ index("idx_agent_mode_runs_assignment").on(table.providerAssignmentId, table.status),
2344
+ index("idx_agent_mode_runs_project_mode").on(table.projectId, table.mode, table.createdAt),
2345
+ index("idx_agent_mode_runs_provider").on(table.capacityProviderId, table.createdAt)
2346
+ ]);
2347
+ const decisionPlanningStatuses = pgTable("decision_planning_statuses", {
2348
+ id: text("id").primaryKey(),
2349
+ teamId: text("team_id").notNull(),
2350
+ projectId: text("project_id").notNull(),
2351
+ decisionId: text("decision_id").notNull(),
2352
+ humanApprovalState: text("human_approval_state"),
2353
+ executionReadiness: text("execution_readiness").notNull().default("draft"),
2354
+ planningInputsStatus: text("planning_inputs_status").notNull().default("requested"),
2355
+ scopeHash: text("scope_hash").notNull(),
2356
+ staleReason: text("stale_reason"),
2357
+ readyAt: text("ready_at"),
2358
+ staleAt: text("stale_at"),
2359
+ metadataJson: text("metadata_json").notNull().default("{}"),
2360
+ createdAt: text("created_at").notNull(),
2361
+ updatedAt: text("updated_at").notNull()
2362
+ }, (table) => [
2363
+ uniqueIndex("idx_decision_planning_statuses_decision").on(table.decisionId),
2364
+ index("idx_decision_planning_statuses_project").on(table.projectId, table.executionReadiness, table.updatedAt)
2365
+ ]);
2366
+ const planningInputRequests = pgTable("planning_input_requests", {
2367
+ id: text("id").primaryKey(),
2368
+ teamId: text("team_id").notNull(),
2369
+ projectId: text("project_id").notNull(),
2370
+ decisionId: text("decision_id").notNull(),
2371
+ projectAgentClassId: text("project_agent_class_id"),
2372
+ mode: text("mode").notNull().default("planning"),
2373
+ status: text("status").notNull().default("requested"),
2374
+ scopeHash: text("scope_hash").notNull(),
2375
+ prompt: text("prompt"),
2376
+ responseJson: text("response_json").notNull().default("{}"),
2377
+ metadataJson: text("metadata_json").notNull().default("{}"),
2378
+ requestedAt: text("requested_at").notNull(),
2379
+ completedAt: text("completed_at"),
2380
+ staleAt: text("stale_at")
2381
+ }, (table) => [
2382
+ index("idx_planning_input_requests_decision").on(table.decisionId, table.status, table.requestedAt),
2383
+ index("idx_planning_input_requests_project").on(table.projectId, table.status, table.requestedAt)
2384
+ ]);
2385
+ const decisionExecutionInputs = pgTable("decision_execution_inputs", {
2386
+ id: text("id").primaryKey(),
2387
+ teamId: text("team_id").notNull(),
2388
+ projectId: text("project_id").notNull(),
2389
+ decisionId: text("decision_id").notNull(),
2390
+ projectAgentClassId: text("project_agent_class_id").notNull(),
2391
+ mode: text("mode").notNull().default("acting"),
2392
+ status: text("status").notNull().default("proposed"),
2393
+ scopeHash: text("scope_hash").notNull(),
2394
+ inputJson: text("input_json").notNull().default("{}"),
2395
+ metadataJson: text("metadata_json").notNull().default("{}"),
2396
+ acceptedAt: text("accepted_at"),
2397
+ revisionRequestedAt: text("revision_requested_at"),
2398
+ staleAt: text("stale_at"),
2399
+ createdAt: text("created_at").notNull(),
2400
+ updatedAt: text("updated_at").notNull()
2401
+ }, (table) => [
2402
+ index("idx_decision_execution_inputs_decision").on(table.decisionId, table.status, table.createdAt),
2403
+ index("idx_decision_execution_inputs_project").on(table.projectId, table.status, table.mode, table.createdAt)
2404
+ ]);
2405
+ const workdayCapacityEnvelopes = pgTable("workday_capacity_envelopes", {
2406
+ id: text("id").primaryKey(),
2407
+ teamId: text("team_id").notNull(),
2408
+ projectId: text("project_id").notNull(),
2409
+ allocationSetId: text("allocation_set_id"),
2410
+ status: text("status").notNull().default("draft"),
2411
+ startedAt: text("started_at"),
2412
+ pausedAt: text("paused_at"),
2413
+ completedAt: text("completed_at"),
2414
+ envelopeJson: text("envelope_json").notNull().default("{}"),
2415
+ modeSplitsJson: text("mode_splits_json").notNull().default("{}"),
2416
+ capsJson: text("caps_json").notNull().default("{}"),
2417
+ reservesJson: text("reserves_json").notNull().default("{}"),
2418
+ borrowingRulesJson: text("borrowing_rules_json").notNull().default("{}"),
2419
+ metadataJson: text("metadata_json").notNull().default("{}"),
2420
+ createdAt: text("created_at").notNull(),
2421
+ updatedAt: text("updated_at").notNull()
2422
+ }, (table) => [
2423
+ index("idx_workday_capacity_envelopes_project_status").on(table.projectId, table.status, table.createdAt),
2424
+ index("idx_workday_capacity_envelopes_team_status").on(table.teamId, table.status, table.createdAt)
2425
+ ]);
2426
+ const agentCapacityPlans = pgTable("agent_capacity_plans", {
2427
+ id: text("id").primaryKey(),
2428
+ teamId: text("team_id").notNull(),
2429
+ projectId: text("project_id").notNull(),
2430
+ decisionId: text("decision_id").notNull(),
2431
+ status: text("status").notNull().default("draft"),
2432
+ scopeHash: text("scope_hash").notNull(),
2433
+ allocationSetId: text("allocation_set_id"),
2434
+ workDayId: text("work_day_id"),
2435
+ expectedCredits: real("expected_credits").notNull().default(0),
2436
+ highCredits: real("high_credits").notNull().default(0),
2437
+ workUnitsJson: text("work_units_json").notNull().default("[]"),
2438
+ capabilityNeedsJson: text("capability_needs_json").notNull().default("[]"),
2439
+ environmentNeedsJson: text("environment_needs_json").notNull().default("[]"),
2440
+ reservesJson: text("reserves_json").notNull().default("{}"),
2441
+ blockersJson: text("blockers_json").notNull().default("[]"),
2442
+ priorityRationale: text("priority_rationale"),
2443
+ reviewJson: text("review_json").notNull().default("{}"),
2444
+ metadataJson: text("metadata_json").notNull().default("{}"),
2445
+ acceptedAt: text("accepted_at"),
2446
+ scheduledAt: text("scheduled_at"),
2447
+ supersededAt: text("superseded_at"),
2448
+ createdAt: text("created_at").notNull(),
2449
+ updatedAt: text("updated_at").notNull()
2450
+ }, (table) => [
2451
+ index("idx_agent_capacity_plans_decision").on(table.decisionId, table.status, table.createdAt),
2452
+ index("idx_agent_capacity_plans_project").on(table.projectId, table.status, table.createdAt),
2453
+ index("idx_agent_capacity_plans_workday").on(table.workDayId, table.status, table.createdAt)
2454
+ ]);
2455
+ const treeDxProxyHandles = pgTable("treedx_proxy_handles", {
2456
+ id: text("id").primaryKey(),
2457
+ teamId: text("team_id").notNull(),
2458
+ projectId: text("project_id").notNull(),
2459
+ assignmentId: text("assignment_id"),
2460
+ repositoryId: text("repository_id"),
2461
+ workspaceId: text("workspace_id"),
2462
+ status: text("status").notNull().default("issued"),
2463
+ scopesJson: text("scopes_json").notNull().default("[]"),
2464
+ allowedOperationsJson: text("allowed_operations_json").notNull().default("[]"),
2465
+ allowedPathsJson: text("allowed_paths_json").notNull().default("[]"),
2466
+ tokenHash: text("token_hash"),
2467
+ expiresAt: text("expires_at"),
2468
+ issuedAt: text("issued_at").notNull(),
2469
+ revokedAt: text("revoked_at"),
2470
+ metadataJson: text("metadata_json").notNull().default("{}"),
2471
+ createdAt: text("created_at").notNull(),
2472
+ updatedAt: text("updated_at").notNull()
2473
+ }, (table) => [
2474
+ index("idx_treedx_proxy_handles_assignment").on(table.assignmentId, table.status, table.expiresAt),
2475
+ index("idx_treedx_proxy_handles_project").on(table.projectId, table.status, table.updatedAt)
2476
+ ]);
2477
+ const treeDxProjectProxyAudit = pgTable("treedx_project_proxy_audit", {
2478
+ id: text("id").primaryKey(),
2479
+ teamId: text("team_id").notNull(),
2480
+ projectId: text("project_id").notNull(),
2481
+ assignmentId: text("assignment_id"),
2482
+ actorType: text("actor_type").notNull(),
2483
+ actorId: text("actor_id"),
2484
+ method: text("method").notNull(),
2485
+ path: text("path").notNull(),
2486
+ handleJson: text("handle_json").notNull().default("{}"),
2487
+ resultStatus: text("result_status").notNull().default("observed"),
2488
+ reasonCode: text("reason_code"),
2489
+ reason: text("reason"),
2490
+ metadataJson: text("metadata_json").notNull().default("{}"),
2491
+ createdAt: text("created_at").notNull()
2492
+ }, (table) => [
2493
+ index("idx_treedx_project_proxy_audit_project").on(table.projectId, table.createdAt),
2494
+ index("idx_treedx_project_proxy_audit_assignment").on(table.assignmentId, table.createdAt),
2495
+ index("idx_treedx_project_proxy_audit_result").on(table.projectId, table.resultStatus, table.createdAt)
2496
+ ]);
2497
+ const secretMetadataRecords = pgTable("secret_metadata_records", {
2498
+ id: text("id").primaryKey(),
2499
+ teamId: text("team_id").notNull(),
2500
+ projectId: text("project_id"),
2501
+ name: text("name").notNull(),
2502
+ secretClass: text("secret_class").notNull(),
2503
+ custodyMode: text("custody_mode").notNull(),
2504
+ ownerKind: text("owner_kind").notNull(),
2505
+ status: text("status").notNull().default("active"),
2506
+ githubSecretTargetJson: text("github_secret_target_json").notNull().default("{}"),
2507
+ escrowRecordId: text("escrow_record_id"),
2508
+ apiDecryptable: integer("api_decryptable").notNull().default(0),
2509
+ plaintextAllowed: integer("plaintext_allowed").notNull().default(0),
2510
+ failClosedCode: text("fail_closed_code"),
2511
+ metadataJson: text("metadata_json").notNull().default("{}"),
2512
+ createdAt: text("created_at").notNull(),
2513
+ updatedAt: text("updated_at").notNull(),
2514
+ tombstonedAt: text("tombstoned_at")
2515
+ }, (table) => [
2516
+ index("idx_secret_metadata_team_project").on(table.teamId, table.projectId, table.status),
2517
+ index("idx_secret_metadata_custody").on(table.custodyMode, table.status),
2518
+ uniqueIndex("idx_secret_metadata_team_name").on(table.teamId, table.projectId, table.name)
2519
+ ]);
2520
+ const clientEncryptedEscrowRecords = pgTable("client_encrypted_escrow_records", {
2521
+ id: text("id").primaryKey(),
2522
+ teamId: text("team_id").notNull(),
2523
+ projectId: text("project_id"),
2524
+ secretId: text("secret_id").notNull(),
2525
+ status: text("status").notNull().default("active"),
2526
+ ciphertextRef: text("ciphertext_ref").notNull(),
2527
+ algorithm: text("algorithm").notNull(),
2528
+ wrappingKeyId: text("wrapping_key_id").notNull(),
2529
+ createdByClientId: text("created_by_client_id"),
2530
+ expiresAt: text("expires_at"),
2531
+ migratedTo: text("migrated_to"),
2532
+ metadataJson: text("metadata_json").notNull().default("{}"),
2533
+ createdAt: text("created_at").notNull(),
2534
+ updatedAt: text("updated_at").notNull(),
2535
+ tombstonedAt: text("tombstoned_at")
2536
+ }, (table) => [
2537
+ index("idx_client_encrypted_escrow_secret").on(table.secretId, table.status),
2538
+ index("idx_client_encrypted_escrow_project").on(table.teamId, table.projectId, table.status)
2539
+ ]);
2540
+ const githubRepositoryGrants = pgTable("github_repository_grants", {
2541
+ id: text("id").primaryKey(),
2542
+ teamId: text("team_id").notNull(),
2543
+ projectId: text("project_id"),
2544
+ repository: text("repository").notNull(),
2545
+ installationId: text("installation_id"),
2546
+ accountLogin: text("account_login"),
2547
+ accountId: text("account_id"),
2548
+ status: text("status").notNull().default("active"),
2549
+ permissionsJson: text("permissions_json").notNull().default("{}"),
2550
+ environmentsJson: text("environments_json").notNull().default("[]"),
2551
+ driftCode: text("drift_code"),
2552
+ observedAt: text("observed_at"),
2553
+ revokedAt: text("revoked_at"),
2554
+ metadataJson: text("metadata_json").notNull().default("{}"),
2555
+ createdAt: text("created_at").notNull(),
2556
+ updatedAt: text("updated_at").notNull()
2557
+ }, (table) => [
2558
+ index("idx_github_repository_grants_project").on(table.teamId, table.projectId, table.status),
2559
+ uniqueIndex("idx_github_repository_grants_repository").on(table.teamId, table.repository)
2560
+ ]);
2561
+ const githubAppInstallationRecords = pgTable("github_app_installation_records", {
2562
+ id: text("id").primaryKey(),
2563
+ teamId: text("team_id").notNull(),
2564
+ installationId: text("installation_id").notNull(),
2565
+ accountLogin: text("account_login"),
2566
+ accountId: text("account_id"),
2567
+ accountType: text("account_type"),
2568
+ status: text("status").notNull().default("active"),
2569
+ permissionsJson: text("permissions_json").notNull().default("{}"),
2570
+ repositorySelection: text("repository_selection"),
2571
+ driftCode: text("drift_code"),
2572
+ observedAt: text("observed_at"),
2573
+ revokedAt: text("revoked_at"),
2574
+ suspendedAt: text("suspended_at"),
2575
+ metadataJson: text("metadata_json").notNull().default("{}"),
2576
+ createdAt: text("created_at").notNull(),
2577
+ updatedAt: text("updated_at").notNull()
2578
+ }, (table) => [
2579
+ index("idx_github_app_installations_team_status").on(table.teamId, table.status, table.updatedAt),
2580
+ uniqueIndex("idx_github_app_installations_team_installation").on(table.teamId, table.installationId)
2581
+ ]);
2582
+ const githubAppTokenIssuanceRecords = pgTable("github_app_token_issuance_records", {
2583
+ id: text("id").primaryKey(),
2584
+ teamId: text("team_id").notNull(),
2585
+ projectId: text("project_id"),
2586
+ assignmentId: text("assignment_id"),
2587
+ providerId: text("provider_id"),
2588
+ workdayId: text("workday_id"),
2589
+ operationId: text("operation_id"),
2590
+ repository: text("repository").notNull(),
2591
+ installationId: text("installation_id").notNull(),
2592
+ status: text("status").notNull().default("issued"),
2593
+ tokenPrefix: text("token_prefix"),
2594
+ tokenHash: text("token_hash"),
2595
+ permissionsJson: text("permissions_json").notNull().default("{}"),
2596
+ allowedOperationsJson: text("allowed_operations_json").notNull().default("[]"),
2597
+ expiresAt: text("expires_at"),
2598
+ issuedAt: text("issued_at"),
2599
+ revokedAt: text("revoked_at"),
2600
+ failClosedCode: text("fail_closed_code"),
2601
+ metadataJson: text("metadata_json").notNull().default("{}"),
2602
+ createdAt: text("created_at").notNull(),
2603
+ updatedAt: text("updated_at").notNull()
2604
+ }, (table) => [
2605
+ index("idx_github_app_token_issuance_project").on(table.teamId, table.projectId, table.status, table.updatedAt),
2606
+ index("idx_github_app_token_issuance_operation").on(table.operationId, table.status, table.expiresAt),
2607
+ index("idx_github_app_token_issuance_assignment").on(table.assignmentId, table.status, table.expiresAt)
2608
+ ]);
2609
+ const workflowOperationRecords = pgTable("workflow_operation_records", {
2610
+ id: text("id").primaryKey(),
2611
+ teamId: text("team_id").notNull(),
2612
+ projectId: text("project_id"),
2613
+ name: text("name").notNull(),
2614
+ repository: text("repository").notNull(),
2615
+ workflowFile: text("workflow_file").notNull(),
2616
+ secretBearing: integer("secret_bearing").notNull().default(0),
2617
+ trustedExecutionSetId: text("trusted_execution_set_id").notNull(),
2618
+ dispatchJson: text("dispatch_json").notNull().default("{}"),
2619
+ inputsJson: text("inputs_json").notNull().default("[]"),
2620
+ secretClassesJson: text("secret_classes_json").notNull().default("[]"),
2621
+ status: text("status").notNull().default("active"),
2622
+ failClosedCode: text("fail_closed_code"),
2623
+ metadataJson: text("metadata_json").notNull().default("{}"),
2624
+ createdAt: text("created_at").notNull(),
2625
+ updatedAt: text("updated_at").notNull(),
2626
+ blockedAt: text("blocked_at")
2627
+ }, (table) => [
2628
+ index("idx_workflow_operation_records_project").on(table.teamId, table.projectId, table.status),
2629
+ uniqueIndex("idx_workflow_operation_records_operation").on(table.teamId, table.id)
2630
+ ]);
2631
+ const workflowDispatchRecords = pgTable("workflow_dispatch_records", {
2632
+ id: text("id").primaryKey(),
2633
+ teamId: text("team_id").notNull(),
2634
+ projectId: text("project_id"),
2635
+ workflowOperationId: text("workflow_operation_id").notNull(),
2636
+ platformOperationId: text("platform_operation_id"),
2637
+ repository: text("repository").notNull(),
2638
+ workflowFile: text("workflow_file").notNull(),
2639
+ ref: text("ref"),
2640
+ status: text("status").notNull().default("queued"),
2641
+ inputsJson: text("inputs_json").notNull().default("{}"),
2642
+ resultJson: text("result_json").notNull().default("{}"),
2643
+ failClosedCode: text("fail_closed_code"),
2644
+ metadataJson: text("metadata_json").notNull().default("{}"),
2645
+ createdAt: text("created_at").notNull(),
2646
+ updatedAt: text("updated_at").notNull(),
2647
+ dispatchedAt: text("dispatched_at"),
2648
+ completedAt: text("completed_at")
2649
+ }, (table) => [
2650
+ index("idx_workflow_dispatch_records_operation").on(table.workflowOperationId, table.status, table.createdAt),
2651
+ index("idx_workflow_dispatch_records_platform").on(table.platformOperationId)
2652
+ ]);
2653
+ const treeDxCredentialIssuanceRecords = pgTable("treedx_credential_issuance_records", {
2654
+ id: text("id").primaryKey(),
2655
+ teamId: text("team_id").notNull(),
2656
+ projectId: text("project_id").notNull(),
2657
+ assignmentId: text("assignment_id"),
2658
+ repository: text("repository"),
2659
+ credentialProvider: text("credential_provider").notNull(),
2660
+ status: text("status").notNull().default("issued"),
2661
+ tokenPrefix: text("token_prefix"),
2662
+ tokenHash: text("token_hash"),
2663
+ scopesJson: text("scopes_json").notNull().default("[]"),
2664
+ allowedOperationsJson: text("allowed_operations_json").notNull().default("[]"),
2665
+ expiresAt: text("expires_at"),
2666
+ issuedAt: text("issued_at"),
2667
+ revokedAt: text("revoked_at"),
2668
+ failClosedCode: text("fail_closed_code"),
2669
+ metadataJson: text("metadata_json").notNull().default("{}"),
2670
+ createdAt: text("created_at").notNull(),
2671
+ updatedAt: text("updated_at").notNull()
2672
+ }, (table) => [
2673
+ index("idx_treedx_credential_issuance_assignment").on(table.assignmentId, table.status, table.expiresAt),
2674
+ index("idx_treedx_credential_issuance_project").on(table.projectId, table.status, table.updatedAt)
2675
+ ]);
1064
2676
  const approvalRequests = pgTable("approval_requests", {
1065
2677
  id: text("id").primaryKey(),
1066
2678
  teamId: text("team_id").notNull(),
@@ -1767,9 +3379,6 @@ const treeseedMarketSchema = {
1767
3379
  contactSubmissions,
1768
3380
  runtimeEnvelopes,
1769
3381
  workDays,
1770
- tasks,
1771
- taskEvents,
1772
- taskOutputs,
1773
3382
  graphRuns,
1774
3383
  reports,
1775
3384
  users,
@@ -1788,6 +3397,25 @@ const treeseedMarketSchema = {
1788
3397
  teamMemberships,
1789
3398
  teamRoleBindings,
1790
3399
  webSessions,
3400
+ commonsParticipants,
3401
+ commonsQuestions,
3402
+ commonsProposals,
3403
+ commonsWeightSnapshots,
3404
+ commonsProposalBackings,
3405
+ commonsProposalVotes,
3406
+ commonsDelegations,
3407
+ commonsDecisions,
3408
+ commonsGovernanceEvents,
3409
+ teamGovernancePolicies,
3410
+ projectGovernancePolicies,
3411
+ governanceProposals,
3412
+ governanceProposalVersions,
3413
+ governanceElectorateSnapshots,
3414
+ governanceProposalVotes,
3415
+ governanceVoteEvents,
3416
+ governanceDelegations,
3417
+ governanceDecisions,
3418
+ governanceEvents,
1791
3419
  projects,
1792
3420
  projectConnections,
1793
3421
  projectCapabilityGrants,
@@ -1800,6 +3428,35 @@ const treeseedMarketSchema = {
1800
3428
  catalogItems,
1801
3429
  catalogArtifactVersions,
1802
3430
  catalogItemCollaborators,
3431
+ commerceVendors,
3432
+ commerceProducts,
3433
+ commerceOwnershipRecords,
3434
+ commerceStewardshipAssignments,
3435
+ commerceContributions,
3436
+ commerceGovernancePolicies,
3437
+ commerceOwnershipTransfers,
3438
+ commerceProductVersions,
3439
+ commerceOffers,
3440
+ commercePrices,
3441
+ commerceGovernanceEvents,
3442
+ commerceCarts,
3443
+ commerceCartItems,
3444
+ commerceCheckouts,
3445
+ commerceOrders,
3446
+ commerceOrderItems,
3447
+ commercePaymentGroups,
3448
+ commerceSubscriptions,
3449
+ commerceEntitlements,
3450
+ commerceBuyerStripeCustomers,
3451
+ commerceRefunds,
3452
+ commerceFulfillmentEvents,
3453
+ commerceServiceRequests,
3454
+ commerceServiceQuotes,
3455
+ commerceServiceContracts,
3456
+ commerceServiceEvents,
3457
+ commerceCapacityListings,
3458
+ commerceCapacityListingInquiries,
3459
+ commerceWebhookEvents,
1803
3460
  projectHosting,
1804
3461
  projectEnvironments,
1805
3462
  projectInfrastructureResources,
@@ -1846,6 +3503,12 @@ const treeseedMarketSchema = {
1846
3503
  treeDxMirrors,
1847
3504
  treeDxShares,
1848
3505
  treeDxDeployments,
3506
+ secretMetadataRecords,
3507
+ clientEncryptedEscrowRecords,
3508
+ githubRepositoryGrants,
3509
+ workflowOperationRecords,
3510
+ workflowDispatchRecords,
3511
+ treeDxCredentialIssuanceRecords,
1849
3512
  hubLaunches,
1850
3513
  hubLaunchEvents,
1851
3514
  hubWorkspaceLinks,
@@ -1862,6 +3525,11 @@ const treeseedMarketSchema = {
1862
3525
  messageQueue,
1863
3526
  capacityProviderRegistrations,
1864
3527
  capacityProviderDeployments,
3528
+ capacityAllocationSets,
3529
+ projectAgentClasses,
3530
+ providerAvailabilitySessions,
3531
+ providerAssignments,
3532
+ agentModeRuns,
1865
3533
  platformOperations,
1866
3534
  platformOperationEvents,
1867
3535
  marketOperationRunners,
@@ -1873,7 +3541,9 @@ const treeseedMarketSchema = {
1873
3541
  marketAuthPasswordResets
1874
3542
  };
1875
3543
  export {
3544
+ agentCapacityPlans,
1876
3545
  agentMessages,
3546
+ agentModeRuns,
1877
3547
  agentPoolRegistrations,
1878
3548
  agentPoolScaleDecisions,
1879
3549
  agentPools,
@@ -1886,6 +3556,7 @@ export {
1886
3556
  betterAuthSession,
1887
3557
  betterAuthUser,
1888
3558
  betterAuthVerification,
3559
+ capacityAllocationSets,
1889
3560
  capacityGrants,
1890
3561
  capacityLedgerEntries,
1891
3562
  capacityProviderApiKeys,
@@ -1899,14 +3570,68 @@ export {
1899
3570
  catalogArtifactVersions,
1900
3571
  catalogItemCollaborators,
1901
3572
  catalogItems,
3573
+ clientEncryptedEscrowRecords,
3574
+ commerceBuyerStripeCustomers,
3575
+ commerceCapacityListingInquiries,
3576
+ commerceCapacityListings,
3577
+ commerceCartItems,
3578
+ commerceCarts,
3579
+ commerceCheckouts,
3580
+ commerceContributions,
3581
+ commerceEntitlements,
3582
+ commerceFulfillmentEvents,
3583
+ commerceGovernanceEvents,
3584
+ commerceGovernancePolicies,
3585
+ commerceOffers,
3586
+ commerceOrderItems,
3587
+ commerceOrders,
3588
+ commerceOwnershipRecords,
3589
+ commerceOwnershipTransfers,
3590
+ commercePaymentGroups,
3591
+ commercePrices,
3592
+ commerceProductVersions,
3593
+ commerceProducts,
3594
+ commerceRefunds,
3595
+ commerceServiceContracts,
3596
+ commerceServiceEvents,
3597
+ commerceServiceQuotes,
3598
+ commerceServiceRequests,
3599
+ commerceStewardshipAssignments,
3600
+ commerceSubscriptions,
3601
+ commerceSuccessionEvents,
3602
+ commerceVendorStripeAccounts,
3603
+ commerceVendors,
3604
+ commerceWebhookEvents,
3605
+ commonsDecisions,
3606
+ commonsDelegations,
3607
+ commonsGovernanceEvents,
3608
+ commonsParticipants,
3609
+ commonsProposalBackings,
3610
+ commonsProposalVotes,
3611
+ commonsProposals,
3612
+ commonsQuestions,
3613
+ commonsWeightSnapshots,
1902
3614
  contactSubmissions,
1903
3615
  creditConversionProfiles,
1904
3616
  cursorState,
3617
+ decisionExecutionInputs,
3618
+ decisionPlanningStatuses,
1905
3619
  deviceCodes,
1906
3620
  entitlements,
1907
3621
  executionProviderNativeLimits,
1908
3622
  executionProviderObservations,
1909
3623
  executionProviders,
3624
+ githubAppInstallationRecords,
3625
+ githubAppTokenIssuanceRecords,
3626
+ githubRepositoryGrants,
3627
+ governanceDecisions,
3628
+ governanceDelegations,
3629
+ governanceElectorateSnapshots,
3630
+ governanceEvents,
3631
+ governanceProposalVersions,
3632
+ governanceProposalVotes,
3633
+ governanceProposals,
3634
+ governanceVoteEvents,
1910
3635
  graphRuns,
1911
3636
  hubContentSources,
1912
3637
  hubLaunchEvents,
@@ -1921,22 +3646,27 @@ export {
1921
3646
  messageQueue,
1922
3647
  nativeUsageObservations,
1923
3648
  permissions,
3649
+ planningInputRequests,
1924
3650
  platformOperationEvents,
1925
3651
  platformOperations,
1926
3652
  platformRepositoryClaims,
1927
3653
  priorityOverrides,
1928
3654
  prioritySnapshots,
3655
+ projectAgentClasses,
1929
3656
  projectCapabilityGrants,
1930
3657
  projectConnections,
1931
3658
  projectDeploymentEvents,
1932
3659
  projectDeployments,
1933
3660
  projectEnvironments,
3661
+ projectGovernancePolicies,
1934
3662
  projectHosting,
1935
3663
  projectInfrastructureResources,
1936
3664
  projectSummarySnapshots,
1937
3665
  projectUpdatePlans,
1938
3666
  projectWorkdaySummaries,
1939
3667
  projects,
3668
+ providerAssignments,
3669
+ providerAvailabilitySessions,
1940
3670
  providerCredentialSessions,
1941
3671
  remoteJobEvents,
1942
3672
  remoteJobs,
@@ -1948,18 +3678,20 @@ export {
1948
3678
  runnerScaleDecisions,
1949
3679
  runtimeEnvelopes,
1950
3680
  runtimeRecords,
3681
+ runtimeTaskEvents,
3682
+ runtimeTaskOutputs,
3683
+ runtimeTasks,
1951
3684
  scaleDecisions,
3685
+ secretMetadataRecords,
1952
3686
  seedRuns,
1953
3687
  serviceCredentials,
1954
3688
  subscribers,
1955
3689
  taskCreditLedger,
1956
3690
  taskEstimateProfiles,
1957
3691
  taskEstimates,
1958
- taskEvents,
1959
- taskOutputs,
1960
3692
  taskUsageActuals,
1961
- tasks,
1962
3693
  teamApiKeys,
3694
+ teamGovernancePolicies,
1963
3695
  teamInboxItems,
1964
3696
  teamInvites,
1965
3697
  teamMemberships,
@@ -1967,10 +3699,13 @@ export {
1967
3699
  teamStorageLocators,
1968
3700
  teamWebHosts,
1969
3701
  teams,
3702
+ treeDxCredentialIssuanceRecords,
1970
3703
  treeDxDeployments,
1971
3704
  treeDxInstances,
1972
3705
  treeDxMirrors,
1973
3706
  treeDxProjectLibraries,
3707
+ treeDxProjectProxyAudit,
3708
+ treeDxProxyHandles,
1974
3709
  treeDxShares,
1975
3710
  treeseedMarketSchema,
1976
3711
  userEmailAddresses,
@@ -1981,7 +3716,10 @@ export {
1981
3716
  webSessions,
1982
3717
  workDays,
1983
3718
  workPolicies,
3719
+ workdayCapacityEnvelopes,
1984
3720
  workdayManagerLeases,
1985
3721
  workdayRequests,
1986
- workerRunners
3722
+ workerRunners,
3723
+ workflowDispatchRecords,
3724
+ workflowOperationRecords
1987
3725
  };