@treeseed/sdk 0.12.62 → 0.13.0-rc.10

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 (1108) hide show
  1. package/LICENSE +13 -0
  2. package/README.md +33 -359
  3. package/dist/accounts/account-contracts.d.ts +170 -0
  4. package/dist/accounts/account-contracts.js +33 -0
  5. package/dist/agent-capacity/allocation.d.ts +186 -0
  6. package/dist/agent-capacity/allocation.js +226 -0
  7. package/dist/agent-capacity/artifact-mutation-receipt.d.ts +49 -0
  8. package/dist/agent-capacity/artifact-mutation-receipt.js +36 -0
  9. package/dist/agent-capacity/artifacts.d.ts +107 -0
  10. package/dist/agent-capacity/artifacts.js +39 -0
  11. package/dist/agent-capacity/authority/agent-authority-presets.d.ts +13 -0
  12. package/dist/agent-capacity/authority/agent-authority-presets.js +106 -0
  13. package/dist/agent-capacity/contracts/capacity/assignments/assignment-records.d.ts +269 -0
  14. package/dist/agent-capacity/contracts/capacity/assignments/assignment-records.js +10 -0
  15. package/dist/agent-capacity/contracts/capacity/communication/communication-records.d.ts +101 -0
  16. package/dist/agent-capacity/contracts/capacity/communication/communication-records.js +9 -0
  17. package/dist/agent-capacity/contracts/capacity/providers/supply-policy.d.ts +36 -0
  18. package/dist/agent-capacity/contracts/capacity/providers/supply-policy.js +4 -0
  19. package/dist/agent-capacity/contracts/capacity/workdays/workday-records.d.ts +188 -0
  20. package/dist/agent-capacity/contracts/configuration/configuration.d.ts +11 -0
  21. package/dist/agent-capacity/contracts/configuration/configuration.js +20 -0
  22. package/dist/agent-capacity/contracts/operations/research-workflow.d.ts +59 -0
  23. package/dist/agent-capacity/contracts/operations/research-workflow.js +16 -0
  24. package/dist/agent-capacity/contracts/operations/workflow-promotion.d.ts +24 -0
  25. package/dist/agent-capacity/contracts/projects/agents/project-agent-class.d.ts +37 -0
  26. package/dist/agent-capacity/contracts/runtime/runtime-observability.d.ts +335 -0
  27. package/dist/agent-capacity/contracts/support/agent-atlas.d.ts +185 -0
  28. package/dist/agent-capacity/contracts/support/agent-atlas.js +47 -0
  29. package/dist/agent-capacity/contracts/support/agent-lab-monitoring.d.ts +96 -0
  30. package/dist/agent-capacity/contracts/support/agent-lab-monitoring.js +14 -0
  31. package/dist/agent-capacity/contracts/support/authority/execution-mode.d.ts +10 -0
  32. package/dist/agent-capacity/contracts/support/authority/execution-mode.js +17 -0
  33. package/dist/agent-capacity/contracts/support/decision-work.d.ts +251 -0
  34. package/dist/agent-capacity/contracts/support/failure-records.d.ts +9 -0
  35. package/dist/agent-capacity/contracts/support/failure-records.js +0 -0
  36. package/dist/agent-capacity/contracts/support/financial-records.d.ts +124 -0
  37. package/dist/agent-capacity/contracts/support/financial-records.js +0 -0
  38. package/dist/agent-capacity/contracts/support/planning-records.d.ts +121 -0
  39. package/dist/agent-capacity/contracts/support/planning-records.js +0 -0
  40. package/dist/agent-capacity/contracts/support/research-citation.d.ts +15 -0
  41. package/dist/agent-capacity/contracts/support/research-citation.js +0 -0
  42. package/dist/agent-capacity/contracts/support/research-source-policy.d.ts +8 -0
  43. package/dist/agent-capacity/contracts/support/research-source-policy.js +0 -0
  44. package/dist/agent-capacity/contracts/support/time-capacity.d.ts +163 -0
  45. package/dist/agent-capacity/contracts/support/time-capacity.js +63 -0
  46. package/dist/agent-capacity/policy/capacity/allocations/allocation-hierarchy.d.ts +29 -0
  47. package/dist/agent-capacity/policy/capacity/allocations/allocation-hierarchy.js +110 -0
  48. package/dist/agent-capacity/validation/activity-profile.d.ts +12 -0
  49. package/dist/agent-capacity/validation/activity-profile.js +264 -0
  50. package/dist/agent-capacity/validation/agent-definition-schema.d.ts +9140 -0
  51. package/dist/agent-capacity/validation/agent-definition-schema.js +198 -0
  52. package/dist/agent-capacity/validation/agent-lab-forensics-schema.d.ts +234 -0
  53. package/dist/agent-capacity/validation/agent-lab-forensics-schema.js +104 -0
  54. package/dist/agent-capacity/validation/agent-signal.d.ts +30 -0
  55. package/dist/agent-capacity/validation/agent-signal.js +31 -0
  56. package/dist/agent-capacity/validation/allocation.d.ts +12 -0
  57. package/dist/agent-capacity/validation/allocation.js +115 -0
  58. package/dist/agent-capacity/validation/assignment-records.d.ts +16 -0
  59. package/dist/agent-capacity/validation/assignment-records.js +92 -0
  60. package/dist/agent-capacity/validation/configuration.d.ts +14 -0
  61. package/dist/agent-capacity/validation/configuration.js +23 -0
  62. package/dist/agent-capacity/validation/index.d.ts +11 -0
  63. package/dist/agent-capacity/validation/index.js +11 -0
  64. package/dist/agent-capacity/validation/proposal-type.d.ts +22 -0
  65. package/dist/agent-capacity/validation/proposal-type.js +21 -0
  66. package/dist/agent-capacity/validation/research/citation.d.ts +16 -0
  67. package/dist/agent-capacity/validation/research/citation.js +47 -0
  68. package/dist/agent-capacity/validation/research/source-policy.d.ts +11 -0
  69. package/dist/agent-capacity/validation/research/source-policy.js +26 -0
  70. package/dist/agent-capacity/validation/research/workflow.d.ts +10 -0
  71. package/dist/agent-capacity/validation/research/workflow.js +31 -0
  72. package/dist/agent-capacity/validation/workflow-promotion.d.ts +2 -0
  73. package/dist/agent-capacity/validation/workflow-promotion.js +34 -0
  74. package/dist/agent-capacity/workday.d.ts +52 -0
  75. package/dist/agent-capacity/workday.js +105 -0
  76. package/dist/ai-appliance/contracts.d.ts +90 -0
  77. package/dist/ai-appliance/contracts.js +16 -0
  78. package/dist/ai-appliance/validation.d.ts +4 -0
  79. package/dist/ai-appliance/validation.js +62 -0
  80. package/dist/capacity/agents/agent-capacity.d.ts +21 -0
  81. package/dist/capacity/agents/agent-capacity.js +20 -0
  82. package/dist/capacity/capacity-core/capacity-pagination.d.ts +18 -0
  83. package/dist/capacity/capacity-core/capacity-pagination.js +33 -0
  84. package/dist/capacity/providers/capacity-provider.d.ts +1 -0
  85. package/dist/capacity/providers/capacity-provider.js +1 -0
  86. package/dist/capacity-provider/client.d.ts +56 -0
  87. package/dist/capacity-provider/client.js +163 -0
  88. package/dist/capacity-provider/contracts/capacity-facts.d.ts +64 -0
  89. package/dist/capacity-provider/contracts/capacity-facts.js +0 -0
  90. package/dist/capacity-provider/contracts/governance.d.ts +399 -0
  91. package/dist/capacity-provider/contracts/governance.js +18 -0
  92. package/dist/capacity-provider/contracts/index.d.ts +2 -0
  93. package/dist/capacity-provider/contracts/index.js +2 -0
  94. package/dist/capacity-provider/index.d.ts +3 -0
  95. package/dist/capacity-provider/index.js +3 -0
  96. package/dist/capacity-provider/validation.d.ts +27 -0
  97. package/dist/capacity-provider/validation.js +184 -0
  98. package/dist/configuration/secrets-capability.d.ts +4 -0
  99. package/dist/configuration/secrets-capability.js +4 -0
  100. package/dist/content/contracts.d.ts +12 -0
  101. package/dist/content/contracts.js +0 -0
  102. package/dist/content/validation/agent-operational-content-schemas.d.ts +1351 -0
  103. package/dist/content/validation/agent-operational-content-schemas.js +146 -0
  104. package/dist/content/validation/auxiliary-content-schemas.d.ts +1715 -0
  105. package/dist/content/validation/auxiliary-content-schemas.js +173 -0
  106. package/dist/content/validation/content-model-schemas.d.ts +21728 -0
  107. package/dist/content/validation/content-model-schemas.js +271 -0
  108. package/dist/content/validation/index.d.ts +3 -0
  109. package/dist/content/validation/index.js +3 -0
  110. package/dist/content/validation/portable-content-data.d.ts +2101 -0
  111. package/dist/content/validation/portable-content-data.js +49 -0
  112. package/dist/entrypoints/clients/control-plane-client.d.ts +112 -0
  113. package/dist/entrypoints/clients/control-plane-client.js +180 -0
  114. package/dist/entrypoints/models/field-aliases.d.ts +11 -0
  115. package/dist/entrypoints/models/model-registry.d.ts +3 -0
  116. package/dist/entrypoints/models/model-registry.js +3 -0
  117. package/dist/entrypoints/models/sdk-fields.d.ts +11 -0
  118. package/dist/entrypoints/models/sdk-types.d.ts +10 -0
  119. package/dist/entrypoints/models/sdk-types.js +10 -0
  120. package/dist/feedback/contracts.d.ts +142 -0
  121. package/dist/feedback/contracts.js +18 -0
  122. package/dist/feedback/index.d.ts +1 -0
  123. package/dist/feedback/index.js +1 -0
  124. package/dist/governance/groups/contracts.d.ts +102 -0
  125. package/dist/governance/groups/contracts.js +6 -0
  126. package/dist/graph/context-query-contracts.d.ts +19 -1
  127. package/dist/graph/context-query-contracts.js +49 -8
  128. package/dist/knowledge/contracts.d.ts +173 -0
  129. package/dist/knowledge/contracts.js +16 -0
  130. package/dist/knowledge/index.d.ts +1 -0
  131. package/dist/knowledge/index.js +1 -0
  132. package/dist/model-registry/agent-operational-models.d.ts +4 -0
  133. package/dist/model-registry/agent-operational-models.js +38 -0
  134. package/dist/model-registry/build-builtin-model-registry.d.ts +2 -0
  135. package/dist/model-registry/build-builtin-model-registry.js +426 -0
  136. package/dist/model-registry/content-root.d.ts +9 -0
  137. package/dist/model-registry/content-root.js +33 -0
  138. package/dist/model-registry/discussion-models.d.ts +4 -0
  139. package/dist/model-registry/discussion-models.js +84 -0
  140. package/dist/model-registry/group-models.d.ts +2 -0
  141. package/dist/model-registry/group-models.js +52 -0
  142. package/dist/model-registry/knowledge-models.d.ts +2 -0
  143. package/dist/model-registry/knowledge-models.js +89 -0
  144. package/dist/model-registry/normalize-definition.d.ts +8 -0
  145. package/dist/model-registry/normalize-definition.js +69 -0
  146. package/dist/operator-contracts/canonical-command-tree.d.ts +3 -0
  147. package/dist/operator-contracts/canonical-command-tree.js +81 -0
  148. package/dist/operator-contracts/command-tree.d.ts +79 -0
  149. package/dist/operator-contracts/command-tree.js +53 -0
  150. package/dist/operator-contracts/control-plane-operation.d.ts +80 -0
  151. package/dist/operator-contracts/control-plane-operation.js +75 -0
  152. package/dist/operator-contracts/control-plane-operations.d.ts +546 -0
  153. package/dist/operator-contracts/control-plane-operations.js +352 -0
  154. package/dist/operator-contracts/index.d.ts +8 -0
  155. package/dist/operator-contracts/index.js +8 -0
  156. package/dist/operator-contracts/mcp.d.ts +78 -0
  157. package/dist/operator-contracts/mcp.js +23 -0
  158. package/dist/operator-contracts/oauth.d.ts +46 -0
  159. package/dist/operator-contracts/oauth.js +0 -0
  160. package/dist/operator-contracts/workday-lifecycle.d.ts +157 -0
  161. package/dist/operator-contracts/workday-lifecycle.js +65 -0
  162. package/dist/operator-contracts/workday-profile.d.ts +72 -0
  163. package/dist/operator-contracts/workday-profile.js +106 -0
  164. package/dist/projects/projects-core/project-workflow.d.ts +179 -0
  165. package/dist/projects/projects-core/project-workflow.js +66 -0
  166. package/dist/sdk-types/configuration/sdk-dispatch-credential-source.d.ts +201 -0
  167. package/dist/sdk-types/configuration/sdk-dispatch-credential-source.js +0 -0
  168. package/dist/sdk-types/control-plane/resource-requests.d.ts +124 -0
  169. package/dist/sdk-types/control-plane/resource-requests.js +0 -0
  170. package/dist/sdk-types/governance/commons/commons-question-input.d.ts +61 -0
  171. package/dist/sdk-types/governance/commons/commons-question-input.js +0 -0
  172. package/dist/sdk-types/support/planning-policy.d.ts +210 -0
  173. package/dist/sdk-types/support/planning-policy.js +0 -0
  174. package/dist/sdk-types/support/platform-contracts.d.ts +178 -0
  175. package/dist/sdk-types/support/platform-contracts.js +15 -0
  176. package/dist/sdk-types/support/sdk-model-names.d.ts +44 -0
  177. package/dist/sdk-types/support/sdk-model-names.js +80 -0
  178. package/dist/sdk-types/support/sdk-search-request.d.ts +182 -0
  179. package/dist/sdk-types/support/sdk-search-request.js +0 -0
  180. package/dist/sdk-types/support/task-planning.d.ts +189 -0
  181. package/dist/sdk-types/support/task-planning.js +0 -0
  182. package/dist/sdk-types/treedx/graph/sdk-graph-query-request.d.ts +157 -0
  183. package/dist/sdk-types/treedx/graph/sdk-graph-query-request.js +0 -0
  184. package/dist/secrets-capability/provider-operation-contracts.d.ts +90 -0
  185. package/dist/secrets-capability/provider-operation-contracts.js +10 -0
  186. package/dist/secrets-capability/service-provider-contracts.d.ts +92 -0
  187. package/dist/secrets-capability/service-provider-contracts.js +183 -0
  188. package/dist/secrets-capability/service-vault-contracts.d.ts +61 -0
  189. package/dist/secrets-capability/service-vault-contracts.js +39 -0
  190. package/dist/secrets-capability/workflow-operation-contracts.d.ts +95 -0
  191. package/dist/secrets-capability/workflow-operation-contracts.js +0 -0
  192. package/dist/standards/canonicalize.d.ts +10 -0
  193. package/dist/standards/canonicalize.js +43 -0
  194. package/dist/standards/compatibility-attestation.d.ts +23 -0
  195. package/dist/standards/compatibility-attestation.js +40 -0
  196. package/dist/standards/composition.d.ts +15 -0
  197. package/dist/standards/composition.js +14 -0
  198. package/dist/standards/contract-bundle.d.ts +8 -0
  199. package/dist/standards/contract-bundle.js +23 -0
  200. package/dist/standards/contracts.d.ts +39 -0
  201. package/dist/standards/contracts.js +0 -0
  202. package/dist/standards/errors.d.ts +6 -0
  203. package/dist/standards/errors.js +13 -0
  204. package/dist/standards/index.d.ts +8 -0
  205. package/dist/standards/index.js +8 -0
  206. package/dist/standards/mcp/compare.d.ts +2 -0
  207. package/dist/standards/mcp/compare.js +38 -0
  208. package/dist/standards/mcp/contracts.d.ts +34 -0
  209. package/dist/standards/mcp/contracts.js +0 -0
  210. package/dist/standards/mcp/index.d.ts +3 -0
  211. package/dist/standards/mcp/index.js +3 -0
  212. package/dist/standards/mcp/normalize.d.ts +4 -0
  213. package/dist/standards/mcp/normalize.js +30 -0
  214. package/dist/standards/openapi/compare.d.ts +2 -0
  215. package/dist/standards/openapi/compare.js +112 -0
  216. package/dist/standards/openapi/contracts.d.ts +24 -0
  217. package/dist/standards/openapi/contracts.js +0 -0
  218. package/dist/standards/openapi/index.d.ts +3 -0
  219. package/dist/standards/openapi/index.js +3 -0
  220. package/dist/standards/openapi/normalize.d.ts +2 -0
  221. package/dist/standards/openapi/normalize.js +57 -0
  222. package/dist/standards/package-manifest.d.ts +37 -0
  223. package/dist/standards/package-manifest.js +89 -0
  224. package/dist/standards/portfolio-entry.d.ts +12 -0
  225. package/dist/standards/portfolio-entry.js +11 -0
  226. package/dist/standards/typescript/compare.d.ts +2 -0
  227. package/dist/standards/typescript/compare.js +88 -0
  228. package/dist/standards/typescript/contracts.d.ts +44 -0
  229. package/dist/standards/typescript/contracts.js +0 -0
  230. package/dist/standards/typescript/extract.d.ts +10 -0
  231. package/dist/standards/typescript/extract.js +244 -0
  232. package/dist/standards/typescript/index.d.ts +3 -0
  233. package/dist/standards/typescript/index.js +3 -0
  234. package/dist/treedx/accounts/auth.d.ts +17 -0
  235. package/dist/treedx/accounts/auth.js +48 -0
  236. package/dist/treedx/client/accounts/contracts/auth-mode.d.ts +3 -0
  237. package/dist/treedx/client/accounts/contracts/auth-mode.js +6 -0
  238. package/dist/treedx/client/build/creation/build-context.d.ts +3 -0
  239. package/dist/treedx/client/build/creation/build-context.js +7 -0
  240. package/dist/treedx/client/build/creation/build-snapshot.d.ts +3 -0
  241. package/dist/treedx/client/build/creation/build-snapshot.js +8 -0
  242. package/dist/treedx/client/capacity/allocations/contracts/put-capability-grant.d.ts +3 -0
  243. package/dist/treedx/client/capacity/allocations/contracts/put-capability-grant.js +7 -0
  244. package/dist/treedx/client/capacity/allocations/queries/list-capability-grants.d.ts +6 -0
  245. package/dist/treedx/client/capacity/allocations/queries/list-capability-grants.js +10 -0
  246. package/dist/treedx/client/methods.d.ts +102 -0
  247. package/dist/treedx/client/methods.js +209 -0
  248. package/dist/treedx/client/persistence/contracts/restore-storage.d.ts +3 -0
  249. package/dist/treedx/client/persistence/contracts/restore-storage.js +6 -0
  250. package/dist/treedx/client/persistence/lifecycle/verify-storage-restore.d.ts +3 -0
  251. package/dist/treedx/client/persistence/lifecycle/verify-storage-restore.js +6 -0
  252. package/dist/treedx/client/repositories/creation/register-repository.d.ts +3 -0
  253. package/dist/treedx/client/repositories/creation/register-repository.js +7 -0
  254. package/dist/treedx/client/repositories/queries/get-repository.d.ts +3 -0
  255. package/dist/treedx/client/repositories/queries/get-repository.js +7 -0
  256. package/dist/treedx/client/repositories/queries/list-repository-paths.d.ts +3 -0
  257. package/dist/treedx/client/repositories/queries/list-repository-paths.js +7 -0
  258. package/dist/treedx/client/repositories/queries/list-repository-refs.d.ts +3 -0
  259. package/dist/treedx/client/repositories/queries/list-repository-refs.js +12 -0
  260. package/dist/treedx/client/repositories/queries/query-repository.d.ts +3 -0
  261. package/dist/treedx/client/repositories/queries/query-repository.js +7 -0
  262. package/dist/treedx/client/repositories/queries/read-repository-file.d.ts +3 -0
  263. package/dist/treedx/client/repositories/queries/read-repository-file.js +6 -0
  264. package/dist/treedx/client/repositories/queries/read-repository-files.d.ts +3 -0
  265. package/dist/treedx/client/repositories/queries/read-repository-files.js +7 -0
  266. package/dist/treedx/client/repositories/queries/search-repository-files.d.ts +3 -0
  267. package/dist/treedx/client/repositories/queries/search-repository-files.js +7 -0
  268. package/dist/treedx/client/support/contracts/treedx/artifacts/contracts/download-artifact.d.ts +3 -0
  269. package/dist/treedx/client/support/contracts/treedx/artifacts/contracts/download-artifact.js +9 -0
  270. package/dist/treedx/client/support/contracts/treedx/authorization/contracts/whoami.d.ts +3 -0
  271. package/dist/treedx/client/support/contracts/treedx/authorization/contracts/whoami.js +6 -0
  272. package/dist/treedx/client/support/contracts/treedx/graph/contracts/parse-context-dsl.d.ts +3 -0
  273. package/dist/treedx/client/support/contracts/treedx/graph/contracts/parse-context-dsl.js +7 -0
  274. package/dist/treedx/client/support/contracts/treedx/health/contracts/deep-health.d.ts +5 -0
  275. package/dist/treedx/client/support/contracts/treedx/health/contracts/deep-health.js +7 -0
  276. package/dist/treedx/client/support/contracts/treedx/health/contracts/health.d.ts +3 -0
  277. package/dist/treedx/client/support/contracts/treedx/health/contracts/health.js +6 -0
  278. package/dist/treedx/client/support/contracts/treedx/health/contracts/metrics.d.ts +3 -0
  279. package/dist/treedx/client/support/contracts/treedx/health/contracts/metrics.js +7 -0
  280. package/dist/treedx/client/support/contracts/treedx/health/contracts/prometheus-metrics.d.ts +2 -0
  281. package/dist/treedx/client/support/contracts/treedx/health/contracts/prometheus-metrics.js +19 -0
  282. package/dist/treedx/client/support/contracts/treedx/health/contracts/ready.d.ts +3 -0
  283. package/dist/treedx/client/support/contracts/treedx/health/contracts/ready.js +7 -0
  284. package/dist/treedx/client/support/contracts/treedx/health/contracts/status.d.ts +3 -0
  285. package/dist/treedx/client/support/contracts/treedx/health/contracts/status.js +6 -0
  286. package/dist/treedx/client/support/contracts/treedx/repositories/contracts/commit.d.ts +3 -0
  287. package/dist/treedx/client/support/contracts/treedx/repositories/contracts/commit.js +7 -0
  288. package/dist/treedx/client/support/contracts/treedx/repositories/contracts/diff.d.ts +3 -0
  289. package/dist/treedx/client/support/contracts/treedx/repositories/contracts/diff.js +6 -0
  290. package/dist/treedx/client/support/contracts/treedx/repositories/contracts/fetch-remote.d.ts +3 -0
  291. package/dist/treedx/client/support/contracts/treedx/repositories/contracts/fetch-remote.js +7 -0
  292. package/dist/treedx/client/support/contracts/treedx/repositories/contracts/push.d.ts +6 -0
  293. package/dist/treedx/client/support/contracts/treedx/repositories/contracts/push.js +23 -0
  294. package/dist/treedx/client/support/contracts/treedx/search/contracts/compact-search-index.d.ts +3 -0
  295. package/dist/treedx/client/support/contracts/treedx/search/contracts/compact-search-index.js +8 -0
  296. package/dist/treedx/client/support/contracts/treedx/search/contracts/search.d.ts +3 -0
  297. package/dist/treedx/client/support/contracts/treedx/search/contracts/search.js +7 -0
  298. package/dist/treedx/client/support/contracts/treedx/storage/contracts/backup-storage.d.ts +3 -0
  299. package/dist/treedx/client/support/contracts/treedx/storage/contracts/backup-storage.js +8 -0
  300. package/dist/treedx/client/support/contracts/treedx/storage/contracts/compact-storage.d.ts +3 -0
  301. package/dist/treedx/client/support/contracts/treedx/storage/contracts/compact-storage.js +8 -0
  302. package/dist/treedx/client/support/contracts/treedx/transport/contracts/assert-binary-ok.d.ts +2 -0
  303. package/dist/treedx/client/support/contracts/treedx/transport/contracts/assert-binary-ok.js +15 -0
  304. package/dist/treedx/client/support/contracts/treedx/transport/contracts/fetch-with-timeout.d.ts +2 -0
  305. package/dist/treedx/client/support/contracts/treedx/transport/contracts/fetch-with-timeout.js +38 -0
  306. package/dist/treedx/client/support/contracts/treedx/transport/contracts/headers.d.ts +2 -0
  307. package/dist/treedx/client/support/contracts/treedx/transport/contracts/headers.js +15 -0
  308. package/dist/treedx/client/support/contracts/treedx/transport/contracts/parse-json-response.d.ts +2 -0
  309. package/dist/treedx/client/support/contracts/treedx/transport/contracts/parse-json-response.js +15 -0
  310. package/dist/treedx/client/support/contracts/treedx/transport/contracts/query.d.ts +2 -0
  311. package/dist/treedx/client/support/contracts/treedx/transport/contracts/query.js +14 -0
  312. package/dist/treedx/client/support/contracts/treedx/transport/contracts/repo-id.d.ts +2 -0
  313. package/dist/treedx/client/support/contracts/treedx/transport/contracts/repo-id.js +14 -0
  314. package/dist/treedx/client/support/contracts/treedx/transport/contracts/request.d.ts +6 -0
  315. package/dist/treedx/client/support/contracts/treedx/transport/contracts/request.js +41 -0
  316. package/dist/treedx/client/support/contracts/treedx/transport/contracts/throw-api-error.d.ts +2 -0
  317. package/dist/treedx/client/support/contracts/treedx/transport/contracts/throw-api-error.js +14 -0
  318. package/dist/treedx/client/support/contracts/treedx/workspaces/contracts/exec.d.ts +3 -0
  319. package/dist/treedx/client/support/contracts/treedx/workspaces/contracts/exec.js +7 -0
  320. package/dist/treedx/client/support/creation/apply-changeset.d.ts +3 -0
  321. package/dist/treedx/client/support/creation/apply-changeset.js +10 -0
  322. package/dist/treedx/client/support/creation/apply-storage-migration.d.ts +3 -0
  323. package/dist/treedx/client/support/creation/apply-storage-migration.js +7 -0
  324. package/dist/treedx/client/support/creation/create-migration.d.ts +6 -0
  325. package/dist/treedx/client/support/creation/create-migration.js +7 -0
  326. package/dist/treedx/client/support/creation/export-artifact.d.ts +3 -0
  327. package/dist/treedx/client/support/creation/export-artifact.js +8 -0
  328. package/dist/treedx/client/support/creation/plan-storage-migration.d.ts +3 -0
  329. package/dist/treedx/client/support/creation/plan-storage-migration.js +7 -0
  330. package/dist/treedx/client/support/creation/request-binary.d.ts +6 -0
  331. package/dist/treedx/client/support/creation/request-binary.js +42 -0
  332. package/dist/treedx/client/support/creation/write-file.d.ts +3 -0
  333. package/dist/treedx/client/support/creation/write-file.js +10 -0
  334. package/dist/treedx/client/support/creation/write-files.d.ts +3 -0
  335. package/dist/treedx/client/support/creation/write-files.js +12 -0
  336. package/dist/treedx/client/support/queries/treedx/artifacts/queries/get-artifact.d.ts +3 -0
  337. package/dist/treedx/client/support/queries/treedx/artifacts/queries/get-artifact.js +7 -0
  338. package/dist/treedx/client/support/queries/treedx/artifacts/queries/list-artifacts.d.ts +3 -0
  339. package/dist/treedx/client/support/queries/treedx/artifacts/queries/list-artifacts.js +7 -0
  340. package/dist/treedx/client/support/queries/treedx/authorization/queries/effective-scope.d.ts +3 -0
  341. package/dist/treedx/client/support/queries/treedx/authorization/queries/effective-scope.js +9 -0
  342. package/dist/treedx/client/support/queries/treedx/authorization/queries/list-capabilities.d.ts +4 -0
  343. package/dist/treedx/client/support/queries/treedx/authorization/queries/list-capabilities.js +6 -0
  344. package/dist/treedx/client/support/queries/treedx/federation/queries/get-placement.d.ts +3 -0
  345. package/dist/treedx/client/support/queries/treedx/federation/queries/get-placement.js +7 -0
  346. package/dist/treedx/client/support/queries/treedx/graph/queries/get-node.d.ts +3 -0
  347. package/dist/treedx/client/support/queries/treedx/graph/queries/get-node.js +7 -0
  348. package/dist/treedx/client/support/queries/treedx/graph/queries/get-related.d.ts +3 -0
  349. package/dist/treedx/client/support/queries/treedx/graph/queries/get-related.js +7 -0
  350. package/dist/treedx/client/support/queries/treedx/graph/queries/list-nodes.d.ts +3 -0
  351. package/dist/treedx/client/support/queries/treedx/graph/queries/list-nodes.js +7 -0
  352. package/dist/treedx/client/support/queries/treedx/repositories/queries/list-tree.d.ts +3 -0
  353. package/dist/treedx/client/support/queries/treedx/repositories/queries/list-tree.js +10 -0
  354. package/dist/treedx/client/support/queries/treedx/repositories/queries/read-file.d.ts +3 -0
  355. package/dist/treedx/client/support/queries/treedx/repositories/queries/read-file.js +9 -0
  356. package/dist/treedx/client/support/queries/treedx/search/queries/get-search-index-status.d.ts +3 -0
  357. package/dist/treedx/client/support/queries/treedx/search/queries/get-search-index-status.js +7 -0
  358. package/dist/treedx/client/support/queries/treedx/storage/queries/get-migration.d.ts +6 -0
  359. package/dist/treedx/client/support/queries/treedx/storage/queries/get-migration.js +7 -0
  360. package/dist/treedx/client/support/queries/treedx/storage/queries/get-snapshot.d.ts +6 -0
  361. package/dist/treedx/client/support/queries/treedx/storage/queries/get-snapshot.js +7 -0
  362. package/dist/treedx/client/support/queries/treedx/storage/queries/list-storage-migrations.d.ts +6 -0
  363. package/dist/treedx/client/support/queries/treedx/storage/queries/list-storage-migrations.js +6 -0
  364. package/dist/treedx/client/support/queries/treedx/transport/queries/list-audit-events.d.ts +15 -0
  365. package/dist/treedx/client/support/queries/treedx/transport/queries/list-audit-events.js +6 -0
  366. package/dist/treedx/client/support/queries/treedx/transport/queries/list-repositories.d.ts +3 -0
  367. package/dist/treedx/client/support/queries/treedx/transport/queries/list-repositories.js +7 -0
  368. package/dist/treedx/client/support/retirement/cleanup-artifacts.d.ts +3 -0
  369. package/dist/treedx/client/support/retirement/cleanup-artifacts.js +7 -0
  370. package/dist/treedx/client/support/retirement/delete-artifact.d.ts +3 -0
  371. package/dist/treedx/client/support/retirement/delete-artifact.js +7 -0
  372. package/dist/treedx/client/support/retirement/delete-file.d.ts +3 -0
  373. package/dist/treedx/client/support/retirement/delete-file.js +10 -0
  374. package/dist/treedx/client/support/retirement/rollback-storage-migration.d.ts +3 -0
  375. package/dist/treedx/client/support/retirement/rollback-storage-migration.js +7 -0
  376. package/dist/treedx/client/support/updates/patch-file.d.ts +3 -0
  377. package/dist/treedx/client/support/updates/patch-file.js +10 -0
  378. package/dist/treedx/client/support/updates/refresh-search-index.d.ts +3 -0
  379. package/dist/treedx/client/support/updates/refresh-search-index.js +8 -0
  380. package/dist/treedx/client/treedx/blobs/contracts/download-blob.d.ts +3 -0
  381. package/dist/treedx/client/treedx/blobs/contracts/download-blob.js +6 -0
  382. package/dist/treedx/client/treedx/blobs/creation/create-blob-upload.d.ts +3 -0
  383. package/dist/treedx/client/treedx/blobs/creation/create-blob-upload.js +8 -0
  384. package/dist/treedx/client/treedx/blobs/creation/request-blob-download.d.ts +3 -0
  385. package/dist/treedx/client/treedx/blobs/creation/request-blob-download.js +27 -0
  386. package/dist/treedx/client/treedx/blobs/creation/request-blob-upload.d.ts +3 -0
  387. package/dist/treedx/client/treedx/blobs/creation/request-blob-upload.js +41 -0
  388. package/dist/treedx/client/treedx/blobs/creation/upload-blob-part.d.ts +3 -0
  389. package/dist/treedx/client/treedx/blobs/creation/upload-blob-part.js +27 -0
  390. package/dist/treedx/client/treedx/blobs/creation/upload-blob.d.ts +3 -0
  391. package/dist/treedx/client/treedx/blobs/creation/upload-blob.js +6 -0
  392. package/dist/treedx/client/treedx/blobs/creation/write-blob.d.ts +3 -0
  393. package/dist/treedx/client/treedx/blobs/creation/write-blob.js +8 -0
  394. package/dist/treedx/client/treedx/blobs/lifecycle/complete-blob-upload.d.ts +3 -0
  395. package/dist/treedx/client/treedx/blobs/lifecycle/complete-blob-upload.js +8 -0
  396. package/dist/treedx/client/treedx/blobs/queries/read-blob.d.ts +3 -0
  397. package/dist/treedx/client/treedx/blobs/queries/read-blob.js +10 -0
  398. package/dist/treedx/client/treedx/blobs/retirement/abort-blob-upload.d.ts +3 -0
  399. package/dist/treedx/client/treedx/blobs/retirement/abort-blob-upload.js +7 -0
  400. package/dist/treedx/client/treedx/blobs/retirement/delete-blob.d.ts +3 -0
  401. package/dist/treedx/client/treedx/blobs/retirement/delete-blob.js +8 -0
  402. package/dist/treedx/client/treedx/federation/contracts/federated-query.d.ts +3 -0
  403. package/dist/treedx/client/treedx/federation/contracts/federated-query.js +7 -0
  404. package/dist/treedx/client/treedx/federation/creation/plan-federated-query.d.ts +3 -0
  405. package/dist/treedx/client/treedx/federation/creation/plan-federated-query.js +6 -0
  406. package/dist/treedx/client/treedx/federation/queries/check-mirror-health.d.ts +3 -0
  407. package/dist/treedx/client/treedx/federation/queries/check-mirror-health.js +7 -0
  408. package/dist/treedx/client/treedx/federation/updates/promote-mirror.d.ts +3 -0
  409. package/dist/treedx/client/treedx/federation/updates/promote-mirror.js +7 -0
  410. package/dist/treedx/client/treedx/federation/updates/sync-mirror.d.ts +3 -0
  411. package/dist/treedx/client/treedx/federation/updates/sync-mirror.js +7 -0
  412. package/dist/treedx/client/treedx/graph/contracts/federated-context.d.ts +3 -0
  413. package/dist/treedx/client/treedx/graph/contracts/federated-context.js +7 -0
  414. package/dist/treedx/client/treedx/graph/contracts/federated-graph.d.ts +3 -0
  415. package/dist/treedx/client/treedx/graph/contracts/federated-graph.js +7 -0
  416. package/dist/treedx/client/treedx/graph/contracts/graph-search.d.ts +3 -0
  417. package/dist/treedx/client/treedx/graph/contracts/graph-search.js +8 -0
  418. package/dist/treedx/client/treedx/graph/queries/get-graph-node.d.ts +3 -0
  419. package/dist/treedx/client/treedx/graph/queries/get-graph-node.js +10 -0
  420. package/dist/treedx/client/treedx/graph/queries/get-graph-refresh-job.d.ts +3 -0
  421. package/dist/treedx/client/treedx/graph/queries/get-graph-refresh-job.js +7 -0
  422. package/dist/treedx/client/treedx/graph/queries/get-subgraph.d.ts +3 -0
  423. package/dist/treedx/client/treedx/graph/queries/get-subgraph.js +7 -0
  424. package/dist/treedx/client/treedx/graph/queries/query-graph.d.ts +3 -0
  425. package/dist/treedx/client/treedx/graph/queries/query-graph.js +7 -0
  426. package/dist/treedx/client/treedx/graph/queries/search-graph-entities.d.ts +3 -0
  427. package/dist/treedx/client/treedx/graph/queries/search-graph-entities.js +6 -0
  428. package/dist/treedx/client/treedx/graph/queries/search-graph-files.d.ts +3 -0
  429. package/dist/treedx/client/treedx/graph/queries/search-graph-files.js +6 -0
  430. package/dist/treedx/client/treedx/graph/queries/search-graph-sections.d.ts +3 -0
  431. package/dist/treedx/client/treedx/graph/queries/search-graph-sections.js +6 -0
  432. package/dist/treedx/client/treedx/graph/updates/refresh-graph.d.ts +3 -0
  433. package/dist/treedx/client/treedx/graph/updates/refresh-graph.js +7 -0
  434. package/dist/treedx/client/treedx/search/contracts/federated-search.d.ts +3 -0
  435. package/dist/treedx/client/treedx/search/contracts/federated-search.js +7 -0
  436. package/dist/treedx/client/treedx/workspaces/creation/create-workspace.d.ts +3 -0
  437. package/dist/treedx/client/treedx/workspaces/creation/create-workspace.js +7 -0
  438. package/dist/treedx/client/treedx/workspaces/retirement/abandon-workspace.d.ts +3 -0
  439. package/dist/treedx/client/treedx/workspaces/retirement/abandon-workspace.js +12 -0
  440. package/dist/treedx/client/treedx/workspaces/retirement/close-workspace.d.ts +2 -0
  441. package/dist/treedx/client/treedx/workspaces/retirement/close-workspace.js +6 -0
  442. package/dist/treedx/generated/openapi-types.d.ts +104 -0
  443. package/dist/treedx/support/client.d.ts +251 -0
  444. package/dist/treedx/support/client.js +252 -0
  445. package/dist/treedx/support/errors.d.ts +13 -0
  446. package/dist/treedx/types/tree-dx-actor.d.ts +209 -0
  447. package/dist/treedx/types/tree-dx-actor.js +8 -0
  448. package/dist/treedx/types/tree-dx-artifact-list-response.d.ts +13 -0
  449. package/dist/treedx/types/tree-dx-artifact-list-response.js +0 -0
  450. package/dist/treedx/types/tree-dx-changeset.d.ts +51 -0
  451. package/dist/treedx/types/tree-dx-changeset.js +6 -0
  452. package/dist/treedx/types/tree-dx-context-request.d.ts +245 -0
  453. package/dist/treedx/types/tree-dx-context-request.js +0 -0
  454. package/dist/treedx/types/tree-dx-exec-result.d.ts +249 -0
  455. package/dist/treedx/types/tree-dx-exec-result.js +0 -0
  456. package/dist/treedx/types/tree-dx-list-tree-request.d.ts +222 -0
  457. package/dist/treedx/types/tree-dx-list-tree-request.js +0 -0
  458. package/dist/treedx/types/tree-dx-push-request.d.ts +229 -0
  459. package/dist/treedx/types/tree-dx-push-request.js +0 -0
  460. package/dist/treedx/types.d.ts +7 -1084
  461. package/dist/treedx/types.js +7 -8
  462. package/dist/types/agents/agent-activity-profile.d.ts +267 -0
  463. package/dist/types/agents/agent-activity-profile.js +0 -0
  464. package/dist/types/agents/agent-trigger-kinds.d.ts +189 -0
  465. package/dist/types/agents/agent-trigger-kinds.js +107 -0
  466. package/dist/types/agents/execution-run-ref.d.ts +136 -0
  467. package/dist/types/agents/execution-run-ref.js +0 -0
  468. package/dist/types/agents.d.ts +3 -493
  469. package/dist/types/agents.js +3 -95
  470. package/package.json +77 -362
  471. package/dist/agent-capacity.d.ts +0 -1100
  472. package/dist/agent-capacity.js +0 -1822
  473. package/dist/agent-tools.d.ts +0 -37
  474. package/dist/agent-tools.js +0 -301
  475. package/dist/api/app.d.ts +0 -8
  476. package/dist/api/app.js +0 -404
  477. package/dist/api/auth/d1-database.d.ts +0 -3
  478. package/dist/api/auth/d1-database.js +0 -20
  479. package/dist/api/auth/d1-provider.d.ts +0 -85
  480. package/dist/api/auth/d1-provider.js +0 -95
  481. package/dist/api/auth/d1-store.d.ts +0 -121
  482. package/dist/api/auth/d1-store.js +0 -990
  483. package/dist/api/auth/memory-provider.d.ts +0 -82
  484. package/dist/api/auth/memory-provider.js +0 -297
  485. package/dist/api/auth/rbac.d.ts +0 -22
  486. package/dist/api/auth/rbac.js +0 -162
  487. package/dist/api/auth/tokens.d.ts +0 -18
  488. package/dist/api/auth/tokens.js +0 -56
  489. package/dist/api/config.d.ts +0 -4
  490. package/dist/api/config.js +0 -149
  491. package/dist/api/http.d.ts +0 -28
  492. package/dist/api/http.js +0 -51
  493. package/dist/api/index.d.ts +0 -10
  494. package/dist/api/index.js +0 -29
  495. package/dist/api/operations-routes.d.ts +0 -11
  496. package/dist/api/operations-routes.js +0 -39
  497. package/dist/api/operations.d.ts +0 -3
  498. package/dist/api/operations.js +0 -26
  499. package/dist/api/providers.d.ts +0 -2
  500. package/dist/api/providers.js +0 -85
  501. package/dist/api/railway.d.ts +0 -53
  502. package/dist/api/railway.js +0 -71
  503. package/dist/api/sdk-dispatch.d.ts +0 -6
  504. package/dist/api/sdk-dispatch.js +0 -14
  505. package/dist/api/sdk-routes.d.ts +0 -11
  506. package/dist/api/sdk-routes.js +0 -29
  507. package/dist/api/templates.d.ts +0 -3
  508. package/dist/api/templates.js +0 -31
  509. package/dist/api/types.d.ts +0 -238
  510. package/dist/capacity-provider.d.ts +0 -494
  511. package/dist/capacity-provider.js +0 -727
  512. package/dist/capacity.d.ts +0 -483
  513. package/dist/capacity.js +0 -2331
  514. package/dist/cli-tools.d.ts +0 -3
  515. package/dist/cli-tools.js +0 -46
  516. package/dist/content-operations.d.ts +0 -97
  517. package/dist/content-operations.js +0 -250
  518. package/dist/content-store.d.ts +0 -25
  519. package/dist/content-store.js +0 -269
  520. package/dist/control-plane-client.d.ts +0 -203
  521. package/dist/control-plane-client.js +0 -540
  522. package/dist/control-plane.d.ts +0 -101
  523. package/dist/control-plane.js +0 -201
  524. package/dist/copilot.d.ts +0 -18
  525. package/dist/copilot.js +0 -90
  526. package/dist/d1-http.d.ts +0 -38
  527. package/dist/d1-http.js +0 -95
  528. package/dist/d1-store.d.ts +0 -336
  529. package/dist/d1-store.js +0 -1431
  530. package/dist/db/d1.d.ts +0 -246
  531. package/dist/db/d1.js +0 -8
  532. package/dist/db/index.d.ts +0 -3
  533. package/dist/db/index.js +0 -3
  534. package/dist/db/market-schema.d.ts +0 -83651
  535. package/dist/db/market-schema.js +0 -3725
  536. package/dist/db/node-sqlite.d.ts +0 -297
  537. package/dist/db/node-sqlite.js +0 -133
  538. package/dist/db/schema.d.ts +0 -483
  539. package/dist/db/schema.js +0 -29
  540. package/dist/dispatch.d.ts +0 -4
  541. package/dist/dispatch.js +0 -174
  542. package/dist/field-aliases.d.ts +0 -11
  543. package/dist/fixture-support.d.ts +0 -24
  544. package/dist/fixture-support.js +0 -385
  545. package/dist/frontmatter.d.ts +0 -6
  546. package/dist/frontmatter.js +0 -33
  547. package/dist/git-runtime.d.ts +0 -16
  548. package/dist/git-runtime.js +0 -69
  549. package/dist/governance.d.ts +0 -133
  550. package/dist/governance.js +0 -285
  551. package/dist/graph/build.d.ts +0 -19
  552. package/dist/graph/build.js +0 -949
  553. package/dist/graph/dsl.d.ts +0 -2
  554. package/dist/graph/dsl.js +0 -243
  555. package/dist/graph/query.d.ts +0 -47
  556. package/dist/graph/query.js +0 -447
  557. package/dist/graph/ranking.d.ts +0 -3
  558. package/dist/graph/ranking.js +0 -483
  559. package/dist/graph/schema.d.ts +0 -142
  560. package/dist/graph/schema.js +0 -137
  561. package/dist/graph.d.ts +0 -52
  562. package/dist/graph.js +0 -133
  563. package/dist/guarantees/index.d.ts +0 -512
  564. package/dist/guarantees/index.js +0 -1782
  565. package/dist/hosting/apps.d.ts +0 -12
  566. package/dist/hosting/apps.js +0 -107
  567. package/dist/hosting/builtins.d.ts +0 -25
  568. package/dist/hosting/builtins.js +0 -685
  569. package/dist/hosting/contracts.d.ts +0 -190
  570. package/dist/hosting/graph.d.ts +0 -110
  571. package/dist/hosting/graph.js +0 -993
  572. package/dist/hosting/index.d.ts +0 -4
  573. package/dist/hosting/index.js +0 -4
  574. package/dist/index.d.ts +0 -88
  575. package/dist/index.js +0 -757
  576. package/dist/local-dev/managed-dev.d.ts +0 -85
  577. package/dist/local-dev/managed-dev.js +0 -431
  578. package/dist/managed-dependencies.d.ts +0 -91
  579. package/dist/managed-dependencies.js +0 -1186
  580. package/dist/market-client.d.ts +0 -831
  581. package/dist/market-client.js +0 -1219
  582. package/dist/model-registry.d.ts +0 -8
  583. package/dist/model-registry.js +0 -674
  584. package/dist/operations/agent-tools.d.ts +0 -105
  585. package/dist/operations/agent-tools.js +0 -171
  586. package/dist/operations/providers/default.d.ts +0 -10
  587. package/dist/operations/providers/default.js +0 -1245
  588. package/dist/operations/repository-operations.d.ts +0 -158
  589. package/dist/operations/repository-operations.js +0 -851
  590. package/dist/operations/runtime.d.ts +0 -7
  591. package/dist/operations/runtime.js +0 -61
  592. package/dist/operations/services/bootstrap-runner.d.ts +0 -39
  593. package/dist/operations/services/bootstrap-runner.js +0 -191
  594. package/dist/operations/services/build-warning-policy.d.ts +0 -34
  595. package/dist/operations/services/build-warning-policy.js +0 -91
  596. package/dist/operations/services/commit-message-provider.d.ts +0 -65
  597. package/dist/operations/services/commit-message-provider.js +0 -496
  598. package/dist/operations/services/config-runtime.d.ts +0 -558
  599. package/dist/operations/services/config-runtime.js +0 -3494
  600. package/dist/operations/services/d1-migration.d.ts +0 -6
  601. package/dist/operations/services/d1-migration.js +0 -120
  602. package/dist/operations/services/deploy.d.ts +0 -645
  603. package/dist/operations/services/deploy.js +0 -3826
  604. package/dist/operations/services/deployment-readiness.d.ts +0 -30
  605. package/dist/operations/services/deployment-readiness.js +0 -217
  606. package/dist/operations/services/export-runtime.d.ts +0 -18
  607. package/dist/operations/services/export-runtime.js +0 -140
  608. package/dist/operations/services/git-remote-policy.d.ts +0 -9
  609. package/dist/operations/services/git-remote-policy.js +0 -63
  610. package/dist/operations/services/git-runner.d.ts +0 -68
  611. package/dist/operations/services/git-runner.js +0 -500
  612. package/dist/operations/services/git-workflow.d.ts +0 -255
  613. package/dist/operations/services/git-workflow.js +0 -845
  614. package/dist/operations/services/github-actions-verification.d.ts +0 -148
  615. package/dist/operations/services/github-actions-verification.js +0 -589
  616. package/dist/operations/services/github-api.d.ts +0 -279
  617. package/dist/operations/services/github-api.js +0 -936
  618. package/dist/operations/services/github-automation.d.ts +0 -230
  619. package/dist/operations/services/github-automation.js +0 -520
  620. package/dist/operations/services/github-credentials.d.ts +0 -13
  621. package/dist/operations/services/github-credentials.js +0 -59
  622. package/dist/operations/services/hosted-service-checks.d.ts +0 -82
  623. package/dist/operations/services/hosted-service-checks.js +0 -527
  624. package/dist/operations/services/hosting-audit.d.ts +0 -69
  625. package/dist/operations/services/hosting-audit.js +0 -638
  626. package/dist/operations/services/hub-launch.d.ts +0 -182
  627. package/dist/operations/services/hub-launch.js +0 -309
  628. package/dist/operations/services/hub-provider-launch.d.ts +0 -160
  629. package/dist/operations/services/hub-provider-launch.js +0 -1056
  630. package/dist/operations/services/key-agent.d.ts +0 -137
  631. package/dist/operations/services/key-agent.js +0 -641
  632. package/dist/operations/services/live-hosted-service-checks.d.ts +0 -30
  633. package/dist/operations/services/live-hosted-service-checks.js +0 -611
  634. package/dist/operations/services/local-cleanup.d.ts +0 -30
  635. package/dist/operations/services/local-cleanup.js +0 -77
  636. package/dist/operations/services/local-dev.d.ts +0 -8
  637. package/dist/operations/services/local-dev.js +0 -97
  638. package/dist/operations/services/managed-host-security.d.ts +0 -13
  639. package/dist/operations/services/managed-host-security.js +0 -56
  640. package/dist/operations/services/managed-repositories.d.ts +0 -37
  641. package/dist/operations/services/managed-repositories.js +0 -177
  642. package/dist/operations/services/market-packaging.d.ts +0 -59
  643. package/dist/operations/services/market-packaging.js +0 -234
  644. package/dist/operations/services/operations-runner-smoke.d.ts +0 -31
  645. package/dist/operations/services/operations-runner-smoke.js +0 -212
  646. package/dist/operations/services/package-adapters.d.ts +0 -184
  647. package/dist/operations/services/package-adapters.js +0 -912
  648. package/dist/operations/services/package-artifacts.d.ts +0 -37
  649. package/dist/operations/services/package-artifacts.js +0 -99
  650. package/dist/operations/services/package-reference-policy.d.ts +0 -64
  651. package/dist/operations/services/package-reference-policy.js +0 -364
  652. package/dist/operations/services/project-host-operations.d.ts +0 -153
  653. package/dist/operations/services/project-host-operations.js +0 -365
  654. package/dist/operations/services/project-platform.d.ts +0 -727
  655. package/dist/operations/services/project-platform.js +0 -1603
  656. package/dist/operations/services/project-web-monitor.d.ts +0 -15
  657. package/dist/operations/services/project-web-monitor.js +0 -377
  658. package/dist/operations/services/railway-api.d.ts +0 -494
  659. package/dist/operations/services/railway-api.js +0 -1874
  660. package/dist/operations/services/railway-cli.d.ts +0 -47
  661. package/dist/operations/services/railway-cli.js +0 -142
  662. package/dist/operations/services/railway-deploy.d.ts +0 -161
  663. package/dist/operations/services/railway-deploy.js +0 -1808
  664. package/dist/operations/services/railway-source-policy.d.ts +0 -25
  665. package/dist/operations/services/railway-source-policy.js +0 -111
  666. package/dist/operations/services/release-history.d.ts +0 -59
  667. package/dist/operations/services/release-history.js +0 -158
  668. package/dist/operations/services/release-proof-ledger.d.ts +0 -13
  669. package/dist/operations/services/release-proof-ledger.js +0 -81
  670. package/dist/operations/services/release-proof-planner.d.ts +0 -48
  671. package/dist/operations/services/release-proof-planner.js +0 -195
  672. package/dist/operations/services/release-proof-runner.d.ts +0 -16
  673. package/dist/operations/services/release-proof-runner.js +0 -169
  674. package/dist/operations/services/release-proof.d.ts +0 -81
  675. package/dist/operations/services/release-proof.js +0 -79
  676. package/dist/operations/services/repository-save-orchestrator.d.ts +0 -193
  677. package/dist/operations/services/repository-save-orchestrator.js +0 -2110
  678. package/dist/operations/services/runtime-paths.d.ts +0 -19
  679. package/dist/operations/services/runtime-paths.js +0 -54
  680. package/dist/operations/services/runtime-tools.d.ts +0 -35
  681. package/dist/operations/services/runtime-tools.js +0 -212
  682. package/dist/operations/services/save-deploy-preflight.d.ts +0 -32
  683. package/dist/operations/services/save-deploy-preflight.js +0 -82
  684. package/dist/operations/services/template-host-bindings.d.ts +0 -68
  685. package/dist/operations/services/template-host-bindings.js +0 -401
  686. package/dist/operations/services/template-registry.d.ts +0 -110
  687. package/dist/operations/services/template-registry.js +0 -595
  688. package/dist/operations/services/template-secret-sync.d.ts +0 -97
  689. package/dist/operations/services/template-secret-sync.js +0 -292
  690. package/dist/operations/services/verification-cache.d.ts +0 -25
  691. package/dist/operations/services/verification-cache.js +0 -71
  692. package/dist/operations/services/watch-dev.d.ts +0 -21
  693. package/dist/operations/services/watch-dev.js +0 -282
  694. package/dist/operations/services/workflow-timing.d.ts +0 -25
  695. package/dist/operations/services/workflow-timing.js +0 -79
  696. package/dist/operations/services/workspace-dependency-mode.d.ts +0 -74
  697. package/dist/operations/services/workspace-dependency-mode.js +0 -478
  698. package/dist/operations/services/workspace-preflight.d.ts +0 -40
  699. package/dist/operations/services/workspace-preflight.js +0 -172
  700. package/dist/operations/services/workspace-save-script.d.ts +0 -26
  701. package/dist/operations/services/workspace-save-script.js +0 -50
  702. package/dist/operations/services/workspace-save.d.ts +0 -76
  703. package/dist/operations/services/workspace-save.js +0 -453
  704. package/dist/operations/services/workspace-tools.d.ts +0 -17
  705. package/dist/operations/services/workspace-tools.js +0 -320
  706. package/dist/operations-registry.d.ts +0 -5
  707. package/dist/operations-registry.js +0 -98
  708. package/dist/operations-types.d.ts +0 -75
  709. package/dist/operations-types.js +0 -17
  710. package/dist/operations.d.ts +0 -17
  711. package/dist/operations.js +0 -114
  712. package/dist/platform/book-export.d.ts +0 -78
  713. package/dist/platform/book-export.js +0 -451
  714. package/dist/platform/books-data.d.ts +0 -28
  715. package/dist/platform/books-data.js +0 -111
  716. package/dist/platform/config.d.ts +0 -27
  717. package/dist/platform/config.js +0 -100
  718. package/dist/platform/content-runtime-source.d.ts +0 -54
  719. package/dist/platform/content-runtime-source.js +0 -169
  720. package/dist/platform/contracts.d.ts +0 -361
  721. package/dist/platform/deploy-config.d.ts +0 -17
  722. package/dist/platform/deploy-config.js +0 -731
  723. package/dist/platform/deploy-runtime.d.ts +0 -22
  724. package/dist/platform/deploy-runtime.js +0 -93
  725. package/dist/platform/desired-state.d.ts +0 -66
  726. package/dist/platform/desired-state.js +0 -1071
  727. package/dist/platform/env.yaml +0 -1126
  728. package/dist/platform/environment.d.ts +0 -159
  729. package/dist/platform/environment.js +0 -778
  730. package/dist/platform/local-content-materialization.d.ts +0 -9
  731. package/dist/platform/local-content-materialization.js +0 -212
  732. package/dist/platform/plugin.d.ts +0 -103
  733. package/dist/platform/plugin.js +0 -6
  734. package/dist/platform/plugins/constants.d.ts +0 -26
  735. package/dist/platform/plugins/constants.js +0 -33
  736. package/dist/platform/plugins/runtime.d.ts +0 -41
  737. package/dist/platform/plugins/runtime.js +0 -257
  738. package/dist/platform/plugins.d.ts +0 -6
  739. package/dist/platform/plugins.js +0 -42
  740. package/dist/platform/published-content-pipeline.d.ts +0 -84
  741. package/dist/platform/published-content-pipeline.js +0 -547
  742. package/dist/platform/published-content.d.ts +0 -224
  743. package/dist/platform/published-content.js +0 -611
  744. package/dist/platform/site-config-schema.d.ts +0 -1
  745. package/dist/platform/site-config-schema.js +0 -4
  746. package/dist/platform/tenant/runtime-config.d.ts +0 -154
  747. package/dist/platform/tenant/runtime-config.js +0 -69
  748. package/dist/platform/tenant-config.d.ts +0 -8
  749. package/dist/platform/tenant-config.js +0 -207
  750. package/dist/platform/utils/site-config-schema.d.ts +0 -154
  751. package/dist/platform/utils/site-config-schema.js +0 -450
  752. package/dist/platform-operation-store.d.ts +0 -94
  753. package/dist/platform-operation-store.js +0 -531
  754. package/dist/platform-operations.d.ts +0 -273
  755. package/dist/platform-operations.js +0 -440
  756. package/dist/plugin-default.d.ts +0 -28
  757. package/dist/plugin-default.js +0 -55
  758. package/dist/project-import.d.ts +0 -91
  759. package/dist/project-import.js +0 -257
  760. package/dist/project-workflow.d.ts +0 -233
  761. package/dist/project-workflow.js +0 -82
  762. package/dist/reconcile/bootstrap-systems.d.ts +0 -32
  763. package/dist/reconcile/bootstrap-systems.js +0 -175
  764. package/dist/reconcile/builtin-adapters.d.ts +0 -9
  765. package/dist/reconcile/builtin-adapters.js +0 -5545
  766. package/dist/reconcile/contracts.d.ts +0 -172
  767. package/dist/reconcile/desired-state.d.ts +0 -10
  768. package/dist/reconcile/desired-state.js +0 -322
  769. package/dist/reconcile/engine.d.ts +0 -118
  770. package/dist/reconcile/engine.js +0 -645
  771. package/dist/reconcile/errors.d.ts +0 -5
  772. package/dist/reconcile/errors.js +0 -13
  773. package/dist/reconcile/index.d.ts +0 -10
  774. package/dist/reconcile/index.js +0 -10
  775. package/dist/reconcile/live-acceptance.d.ts +0 -100
  776. package/dist/reconcile/live-acceptance.js +0 -2018
  777. package/dist/reconcile/platform.d.ts +0 -104
  778. package/dist/reconcile/platform.js +0 -100
  779. package/dist/reconcile/providers/docker-private.d.ts +0 -54
  780. package/dist/reconcile/providers/docker-private.js +0 -101
  781. package/dist/reconcile/providers/github-private.d.ts +0 -69
  782. package/dist/reconcile/providers/github-private.js +0 -145
  783. package/dist/reconcile/providers/local-private.d.ts +0 -28
  784. package/dist/reconcile/providers/local-private.js +0 -75
  785. package/dist/reconcile/providers/railway-iac.d.ts +0 -220
  786. package/dist/reconcile/providers/railway-iac.js +0 -621
  787. package/dist/reconcile/providers/release-private.d.ts +0 -89
  788. package/dist/reconcile/providers/release-private.js +0 -140
  789. package/dist/reconcile/registry.d.ts +0 -7
  790. package/dist/reconcile/registry.js +0 -79
  791. package/dist/reconcile/state.d.ts +0 -7
  792. package/dist/reconcile/state.js +0 -270
  793. package/dist/reconcile/units.d.ts +0 -6
  794. package/dist/reconcile/units.js +0 -72
  795. package/dist/remote.d.ts +0 -244
  796. package/dist/remote.js +0 -284
  797. package/dist/scenes/artifacts.d.ts +0 -16
  798. package/dist/scenes/artifacts.js +0 -61
  799. package/dist/scenes/auth.d.ts +0 -2
  800. package/dist/scenes/auth.js +0 -28
  801. package/dist/scenes/base-url.d.ts +0 -12
  802. package/dist/scenes/base-url.js +0 -123
  803. package/dist/scenes/builtin-plugins.d.ts +0 -2
  804. package/dist/scenes/builtin-plugins.js +0 -499
  805. package/dist/scenes/checkpoints.d.ts +0 -14
  806. package/dist/scenes/checkpoints.js +0 -33
  807. package/dist/scenes/device-matrix.d.ts +0 -2
  808. package/dist/scenes/device-matrix.js +0 -100
  809. package/dist/scenes/devices.d.ts +0 -11
  810. package/dist/scenes/devices.js +0 -40
  811. package/dist/scenes/diagnostics.d.ts +0 -5
  812. package/dist/scenes/diagnostics.js +0 -22
  813. package/dist/scenes/diagram-providers.d.ts +0 -2
  814. package/dist/scenes/diagram-providers.js +0 -181
  815. package/dist/scenes/diagram-validation.d.ts +0 -22
  816. package/dist/scenes/diagram-validation.js +0 -74
  817. package/dist/scenes/environment.d.ts +0 -2
  818. package/dist/scenes/environment.js +0 -65
  819. package/dist/scenes/evidence-bundle.d.ts +0 -5
  820. package/dist/scenes/evidence-bundle.js +0 -42
  821. package/dist/scenes/evidence-report.d.ts +0 -10
  822. package/dist/scenes/evidence-report.js +0 -73
  823. package/dist/scenes/evidence.d.ts +0 -16
  824. package/dist/scenes/evidence.js +0 -277
  825. package/dist/scenes/index.d.ts +0 -48
  826. package/dist/scenes/index.js +0 -312
  827. package/dist/scenes/inspect.d.ts +0 -9
  828. package/dist/scenes/inspect.js +0 -64
  829. package/dist/scenes/loader.d.ts +0 -3
  830. package/dist/scenes/loader.js +0 -38
  831. package/dist/scenes/logs.d.ts +0 -2
  832. package/dist/scenes/logs.js +0 -47
  833. package/dist/scenes/operations.d.ts +0 -3
  834. package/dist/scenes/operations.js +0 -128
  835. package/dist/scenes/phase0.d.ts +0 -9
  836. package/dist/scenes/phase0.js +0 -637
  837. package/dist/scenes/planner.d.ts +0 -12
  838. package/dist/scenes/planner.js +0 -166
  839. package/dist/scenes/playwright-adapter.d.ts +0 -2
  840. package/dist/scenes/playwright-adapter.js +0 -63
  841. package/dist/scenes/plugins.d.ts +0 -5
  842. package/dist/scenes/plugins.js +0 -115
  843. package/dist/scenes/progress.d.ts +0 -17
  844. package/dist/scenes/progress.js +0 -24
  845. package/dist/scenes/publish-destinations.d.ts +0 -12
  846. package/dist/scenes/publish-destinations.js +0 -99
  847. package/dist/scenes/publish-plan-report.d.ts +0 -10
  848. package/dist/scenes/publish-plan-report.js +0 -70
  849. package/dist/scenes/publish-plan.d.ts +0 -15
  850. package/dist/scenes/publish-plan.js +0 -248
  851. package/dist/scenes/publish-redaction.d.ts +0 -16
  852. package/dist/scenes/publish-redaction.js +0 -148
  853. package/dist/scenes/publish-release-record.d.ts +0 -13
  854. package/dist/scenes/publish-release-record.js +0 -34
  855. package/dist/scenes/publish-report.d.ts +0 -10
  856. package/dist/scenes/publish-report.js +0 -67
  857. package/dist/scenes/publish.d.ts +0 -16
  858. package/dist/scenes/publish.js +0 -298
  859. package/dist/scenes/registry.d.ts +0 -12
  860. package/dist/scenes/registry.js +0 -65
  861. package/dist/scenes/remotion-adapter.d.ts +0 -3
  862. package/dist/scenes/remotion-adapter.js +0 -94
  863. package/dist/scenes/remotion-composition-registry.d.ts +0 -2
  864. package/dist/scenes/remotion-composition-registry.js +0 -12
  865. package/dist/scenes/remotion-compositions.d.ts +0 -15
  866. package/dist/scenes/remotion-compositions.js +0 -464
  867. package/dist/scenes/remotion-diagrams.d.ts +0 -9
  868. package/dist/scenes/remotion-diagrams.js +0 -188
  869. package/dist/scenes/remotion-input.d.ts +0 -13
  870. package/dist/scenes/remotion-input.js +0 -291
  871. package/dist/scenes/remotion-visuals.d.ts +0 -29
  872. package/dist/scenes/remotion-visuals.js +0 -198
  873. package/dist/scenes/render-media-assets.d.ts +0 -9
  874. package/dist/scenes/render-media-assets.js +0 -117
  875. package/dist/scenes/render-report.d.ts +0 -10
  876. package/dist/scenes/render-report.js +0 -27
  877. package/dist/scenes/render.d.ts +0 -2
  878. package/dist/scenes/render.js +0 -218
  879. package/dist/scenes/reporter.d.ts +0 -3
  880. package/dist/scenes/reporter.js +0 -101
  881. package/dist/scenes/resume.d.ts +0 -2
  882. package/dist/scenes/resume.js +0 -79
  883. package/dist/scenes/runner.d.ts +0 -2
  884. package/dist/scenes/runner.js +0 -687
  885. package/dist/scenes/schema.d.ts +0 -6
  886. package/dist/scenes/schema.js +0 -1023
  887. package/dist/scenes/seed.d.ts +0 -2
  888. package/dist/scenes/seed.js +0 -83
  889. package/dist/scenes/segments.d.ts +0 -15
  890. package/dist/scenes/segments.js +0 -79
  891. package/dist/scenes/selectors.d.ts +0 -3
  892. package/dist/scenes/selectors.js +0 -21
  893. package/dist/scenes/timeline.d.ts +0 -11
  894. package/dist/scenes/timeline.js +0 -26
  895. package/dist/scenes/timeouts.d.ts +0 -6
  896. package/dist/scenes/timeouts.js +0 -17
  897. package/dist/scenes/training-captions.d.ts +0 -14
  898. package/dist/scenes/training-captions.js +0 -98
  899. package/dist/scenes/training-report.d.ts +0 -10
  900. package/dist/scenes/training-report.js +0 -78
  901. package/dist/scenes/training-transcript.d.ts +0 -24
  902. package/dist/scenes/training-transcript.js +0 -204
  903. package/dist/scenes/training.d.ts +0 -10
  904. package/dist/scenes/training.js +0 -134
  905. package/dist/scenes/types.d.ts +0 -1900
  906. package/dist/scenes/types.js +0 -8
  907. package/dist/scenes/visual-audit-contact-sheets.d.ts +0 -6
  908. package/dist/scenes/visual-audit-contact-sheets.js +0 -119
  909. package/dist/scenes/visual-audit-fixtures.d.ts +0 -25
  910. package/dist/scenes/visual-audit-fixtures.js +0 -247
  911. package/dist/scenes/visual-audit-report.d.ts +0 -11
  912. package/dist/scenes/visual-audit-report.js +0 -85
  913. package/dist/scenes/visual-audit-review.d.ts +0 -23
  914. package/dist/scenes/visual-audit-review.js +0 -829
  915. package/dist/scenes/visual-audit-routes.d.ts +0 -13
  916. package/dist/scenes/visual-audit-routes.js +0 -308
  917. package/dist/scenes/visual-audit.d.ts +0 -3
  918. package/dist/scenes/visual-audit.js +0 -596
  919. package/dist/scripts/aggregate-book.js +0 -16
  920. package/dist/scripts/assert-release-tag-version.js +0 -23
  921. package/dist/scripts/build-dist.js +0 -294
  922. package/dist/scripts/build-tenant-worker.js +0 -36
  923. package/dist/scripts/check-build-warnings.js +0 -51
  924. package/dist/scripts/cleanup-markdown.js +0 -377
  925. package/dist/scripts/cli-test-fixtures.js +0 -44
  926. package/dist/scripts/config-treeseed.js +0 -131
  927. package/dist/scripts/deployment-readiness.js +0 -20
  928. package/dist/scripts/generate-treedx-openapi-types.js +0 -186
  929. package/dist/scripts/install-managed-dependencies.js +0 -12
  930. package/dist/scripts/key-agent.js +0 -165
  931. package/dist/scripts/local-dev.js +0 -129
  932. package/dist/scripts/migrate-journey-csv-to-guarantees.js +0 -140
  933. package/dist/scripts/operations-runner-smoke.js +0 -16
  934. package/dist/scripts/package-tools.js +0 -85
  935. package/dist/scripts/patch-starlight-content-path.js +0 -173
  936. package/dist/scripts/prepare.js +0 -10
  937. package/dist/scripts/publish-package.js +0 -29
  938. package/dist/scripts/release-verify.js +0 -105
  939. package/dist/scripts/run-fixture-astro-command.js +0 -18
  940. package/dist/scripts/scaffold-site.js +0 -66
  941. package/dist/scripts/sync-template.js +0 -20
  942. package/dist/scripts/template-catalog.test.js +0 -86
  943. package/dist/scripts/template-command.js +0 -31
  944. package/dist/scripts/tenant-astro-command.js +0 -3
  945. package/dist/scripts/tenant-build.js +0 -48
  946. package/dist/scripts/tenant-check.js +0 -10
  947. package/dist/scripts/tenant-d1-migrate-local.js +0 -15
  948. package/dist/scripts/tenant-deploy.js +0 -220
  949. package/dist/scripts/tenant-destroy.js +0 -112
  950. package/dist/scripts/tenant-dev.js +0 -160
  951. package/dist/scripts/tenant-lint.js +0 -4
  952. package/dist/scripts/tenant-test.js +0 -4
  953. package/dist/scripts/tenant-workflow-action.js +0 -101
  954. package/dist/scripts/test-cloudflare-local.js +0 -209
  955. package/dist/scripts/test-scaffold.js +0 -300
  956. package/dist/scripts/test-smoke.js +0 -137
  957. package/dist/scripts/treeseed-assert-release-tag-version.js +0 -21
  958. package/dist/scripts/treeseed-build-dist.js +0 -131
  959. package/dist/scripts/treeseed-publish-package.js +0 -19
  960. package/dist/scripts/treeseed-release-verify.js +0 -131
  961. package/dist/scripts/validate-templates.js +0 -6
  962. package/dist/scripts/verify-driver.js +0 -45
  963. package/dist/scripts/workflow-commands.test.js +0 -31
  964. package/dist/scripts/workspace-command-e2e.js +0 -718
  965. package/dist/scripts/workspace-lint.js +0 -15
  966. package/dist/scripts/workspace-preflight.js +0 -22
  967. package/dist/scripts/workspace-publish-changed-packages.js +0 -16
  968. package/dist/scripts/workspace-release-test.js +0 -104
  969. package/dist/scripts/workspace-release-verify.js +0 -81
  970. package/dist/scripts/workspace-save.js +0 -64
  971. package/dist/scripts/workspace-start-warning.js +0 -3
  972. package/dist/scripts/workspace-test-unit.js +0 -4
  973. package/dist/scripts/workspace-test.js +0 -17
  974. package/dist/sdk-dispatch.d.ts +0 -12
  975. package/dist/sdk-dispatch.js +0 -126
  976. package/dist/sdk-fields.d.ts +0 -11
  977. package/dist/sdk-filters.d.ts +0 -4
  978. package/dist/sdk-filters.js +0 -74
  979. package/dist/sdk-types.d.ts +0 -3868
  980. package/dist/sdk-types.js +0 -542
  981. package/dist/sdk-version.d.ts +0 -2
  982. package/dist/sdk-version.js +0 -42
  983. package/dist/sdk.d.ts +0 -266
  984. package/dist/sdk.js +0 -825
  985. package/dist/secrets-capability.d.ts +0 -421
  986. package/dist/secrets-capability.js +0 -530
  987. package/dist/seeds/errors.d.ts +0 -5
  988. package/dist/seeds/errors.js +0 -22
  989. package/dist/seeds/index.d.ts +0 -20
  990. package/dist/seeds/index.js +0 -53
  991. package/dist/seeds/loader.d.ts +0 -8
  992. package/dist/seeds/loader.js +0 -32
  993. package/dist/seeds/normalize.d.ts +0 -13
  994. package/dist/seeds/normalize.js +0 -282
  995. package/dist/seeds/planner.d.ts +0 -10
  996. package/dist/seeds/planner.js +0 -149
  997. package/dist/seeds/schema.d.ts +0 -2
  998. package/dist/seeds/schema.js +0 -893
  999. package/dist/seeds/types.d.ts +0 -312
  1000. package/dist/seeds/types.js +0 -12
  1001. package/dist/service-credentials.d.ts +0 -54
  1002. package/dist/service-credentials.js +0 -112
  1003. package/dist/stores/cursor-store.d.ts +0 -10
  1004. package/dist/stores/cursor-store.js +0 -164
  1005. package/dist/stores/envelopes.d.ts +0 -116
  1006. package/dist/stores/envelopes.js +0 -219
  1007. package/dist/stores/helpers.d.ts +0 -12
  1008. package/dist/stores/helpers.js +0 -42
  1009. package/dist/stores/lease-store.d.ts +0 -18
  1010. package/dist/stores/lease-store.js +0 -189
  1011. package/dist/stores/message-store.d.ts +0 -12
  1012. package/dist/stores/message-store.js +0 -273
  1013. package/dist/stores/operational-store.d.ts +0 -55
  1014. package/dist/stores/operational-store.js +0 -861
  1015. package/dist/stores/project-workflow-store.d.ts +0 -56
  1016. package/dist/stores/project-workflow-store.js +0 -482
  1017. package/dist/stores/run-store.d.ts +0 -9
  1018. package/dist/stores/run-store.js +0 -75
  1019. package/dist/stores/subscription-store.d.ts +0 -8
  1020. package/dist/stores/subscription-store.js +0 -73
  1021. package/dist/template-catalog.d.ts +0 -13
  1022. package/dist/template-catalog.js +0 -151
  1023. package/dist/template-launch-requirements.d.ts +0 -118
  1024. package/dist/template-launch-requirements.js +0 -768
  1025. package/dist/template-launch-ui.d.ts +0 -85
  1026. package/dist/template-launch-ui.js +0 -189
  1027. package/dist/timing.d.ts +0 -20
  1028. package/dist/timing.js +0 -73
  1029. package/dist/treedx/adapters.d.ts +0 -6
  1030. package/dist/treedx/adapters.js +0 -36
  1031. package/dist/treedx/client.d.ts +0 -222
  1032. package/dist/treedx/client.js +0 -871
  1033. package/dist/treedx/errors.d.ts +0 -13
  1034. package/dist/treedx/federated-client.d.ts +0 -27
  1035. package/dist/treedx/federated-client.js +0 -158
  1036. package/dist/treedx/graph-adapter.d.ts +0 -33
  1037. package/dist/treedx/graph-adapter.js +0 -156
  1038. package/dist/treedx/index.d.ts +0 -14
  1039. package/dist/treedx/index.js +0 -48
  1040. package/dist/treedx/market-integration.d.ts +0 -27
  1041. package/dist/treedx/market-integration.js +0 -131
  1042. package/dist/treedx/ports.d.ts +0 -166
  1043. package/dist/treedx/ports.js +0 -231
  1044. package/dist/treedx/query-adapter.d.ts +0 -19
  1045. package/dist/treedx/query-adapter.js +0 -62
  1046. package/dist/treedx/registry-client.d.ts +0 -11
  1047. package/dist/treedx/registry-client.js +0 -19
  1048. package/dist/treedx/repository-adapter.d.ts +0 -45
  1049. package/dist/treedx/repository-adapter.js +0 -319
  1050. package/dist/treedx/sdk-integration.d.ts +0 -27
  1051. package/dist/treedx/sdk-integration.js +0 -63
  1052. package/dist/treedx/workspace-adapter.d.ts +0 -27
  1053. package/dist/treedx/workspace-adapter.js +0 -65
  1054. package/dist/treedx-backends.d.ts +0 -220
  1055. package/dist/treedx-backends.js +0 -634
  1056. package/dist/treedx-client.d.ts +0 -89
  1057. package/dist/treedx-client.js +0 -184
  1058. package/dist/treeseed/services/compose.yml +0 -6
  1059. package/dist/treeseed/template-catalog/catalog.fixture.json +0 -707
  1060. package/dist/types/cloudflare.d.ts +0 -54
  1061. package/dist/verification.d.ts +0 -31
  1062. package/dist/verification.js +0 -430
  1063. package/dist/workflow/operations.d.ts +0 -1516
  1064. package/dist/workflow/operations.js +0 -7001
  1065. package/dist/workflow/policy.d.ts +0 -12
  1066. package/dist/workflow/policy.js +0 -70
  1067. package/dist/workflow/runs.d.ts +0 -143
  1068. package/dist/workflow/runs.js +0 -720
  1069. package/dist/workflow/session.d.ts +0 -34
  1070. package/dist/workflow/session.js +0 -160
  1071. package/dist/workflow/worktrees.d.ts +0 -43
  1072. package/dist/workflow/worktrees.js +0 -307
  1073. package/dist/workflow-state.d.ts +0 -250
  1074. package/dist/workflow-state.js +0 -844
  1075. package/dist/workflow-support.d.ts +0 -28
  1076. package/dist/workflow-support.js +0 -390
  1077. package/dist/workflow.d.ts +0 -327
  1078. package/dist/workflow.js +0 -140
  1079. package/drizzle/d1/0000_treeseed_d1.sql +0 -19
  1080. package/drizzle/market/0000_market_control_plane.sql +0 -3223
  1081. package/drizzle/market/0001_capacity_budget_mode_default.sql +0 -4
  1082. package/drizzle/market/0002_user_email_addresses.sql +0 -26
  1083. package/drizzle/market/0003_project_team_slug_unique.sql +0 -4
  1084. package/drizzle/market/0004_treedx_market_integration.sql +0 -99
  1085. package/drizzle/market/0005_agent_capacity_coordination.sql +0 -145
  1086. package/drizzle/market/0006_provider_assignment_lifecycle.sql +0 -9
  1087. package/drizzle/market/0007_agent_architecture_gap_closure.sql +0 -157
  1088. package/drizzle/market/0008_agent_capacity_operational_closure.sql +0 -27
  1089. package/drizzle/market/0009_agent_capacity_runtime_hardening.sql +0 -29
  1090. package/drizzle/market/0010_secrets_capability_persistence.sql +0 -130
  1091. package/drizzle/market/0011_github_app_adapter.sql +0 -47
  1092. package/drizzle/market/0012_workday_test_runs.sql +0 -44
  1093. package/drizzle/market/0013_runtime_task_lifecycle.sql +0 -39
  1094. package/drizzle/market/0014_governance_pipeline.sql +0 -189
  1095. package/drizzle/market/0015_agent_decision_assignment_graphs.sql +0 -60
  1096. package/scripts/verify-driver.ts +0 -51
  1097. package/templates/github/deploy-web.workflow.yml +0 -168
  1098. package/templates/github/hosted-project.workflow.yml +0 -76
  1099. /package/dist/{api/types.js → agent-capacity/contracts/capacity/workdays/workday-records.js} +0 -0
  1100. /package/dist/{hosting/contracts.js → agent-capacity/contracts/operations/workflow-promotion.js} +0 -0
  1101. /package/dist/{platform/contracts.js → agent-capacity/contracts/projects/agents/project-agent-class.js} +0 -0
  1102. /package/dist/{reconcile/contracts.js → agent-capacity/contracts/runtime/runtime-observability.js} +0 -0
  1103. /package/dist/{types/cloudflare.js → agent-capacity/contracts/support/decision-work.js} +0 -0
  1104. /package/dist/{field-aliases.js → entrypoints/models/field-aliases.js} +0 -0
  1105. /package/dist/{sdk-fields.js → entrypoints/models/sdk-fields.js} +0 -0
  1106. /package/dist/{runtime.d.ts → runtime/runtime.d.ts} +0 -0
  1107. /package/dist/{runtime.js → runtime/runtime.js} +0 -0
  1108. /package/dist/treedx/{errors.js → support/errors.js} +0 -0
@@ -1,3725 +0,0 @@
1
- import { bigint, index, integer, pgTable, primaryKey, real, serial, text, uniqueIndex } from "drizzle-orm/pg-core";
2
- const subscribers = pgTable("subscribers", {
3
- email: text("email").primaryKey(),
4
- createdAt: text("created_at").notNull()
5
- });
6
- const agentRuns = pgTable("agent_runs", {
7
- runId: text("run_id").primaryKey(),
8
- agentSlug: text("agent_slug").notNull(),
9
- status: text("status").notNull(),
10
- createdAt: text("created_at").notNull()
11
- });
12
- const agentMessages = pgTable("agent_messages", {
13
- id: serial("id").primaryKey(),
14
- typeColumn: text("type").notNull(),
15
- payloadJson: text("payload_json").notNull(),
16
- createdAt: text("created_at").notNull()
17
- });
18
- const contactSubmissions = pgTable("contact_submissions", {
19
- id: serial("id").primaryKey(),
20
- email: text("email").notNull(),
21
- message: text("message").notNull(),
22
- createdAt: text("created_at").notNull()
23
- });
24
- const runtimeEnvelopes = pgTable("runtime_envelopes", {
25
- id: serial("id").primaryKey(),
26
- recordType: text("record_type").notNull(),
27
- payloadJson: text("payload_json").notNull(),
28
- createdAt: text("created_at").notNull()
29
- });
30
- const workDays = pgTable("work_days", {
31
- id: text("id").primaryKey(),
32
- projectId: text("project_id").notNull(),
33
- state: text("state").notNull(),
34
- capacityBudget: integer("capacity_budget").notNull().default(0),
35
- capacityUsed: integer("capacity_used").notNull().default(0),
36
- graphVersion: text("graph_version"),
37
- summaryJson: text("summary_json"),
38
- startedAt: text("started_at").notNull(),
39
- endedAt: text("ended_at"),
40
- createdAt: text("created_at").notNull(),
41
- updatedAt: text("updated_at").notNull()
42
- });
43
- const runtimeTasks = pgTable("runtime_tasks", {
44
- id: text("id").primaryKey(),
45
- projectId: text("project_id").notNull(),
46
- workDayId: text("work_day_id").notNull(),
47
- agentId: text("agent_id").notNull(),
48
- type: text("type").notNull(),
49
- idempotencyKey: text("idempotency_key").notNull().unique(),
50
- payloadJson: text("payload_json").notNull(),
51
- state: text("state").notNull(),
52
- claimedBy: text("claimed_by"),
53
- claimedAt: text("claimed_at"),
54
- leaseExpiresAt: text("lease_expires_at"),
55
- attempts: integer("attempts").notNull().default(0),
56
- createdAt: text("created_at").notNull(),
57
- updatedAt: text("updated_at").notNull()
58
- }, (table) => [
59
- index("idx_runtime_tasks_project_workday_state").on(table.projectId, table.workDayId, table.state, table.createdAt)
60
- ]);
61
- const runtimeTaskEvents = pgTable("runtime_task_events", {
62
- id: text("id").primaryKey(),
63
- taskId: text("task_id").notNull(),
64
- kind: text("kind").notNull(),
65
- dataJson: text("data_json").notNull(),
66
- actor: text("actor"),
67
- createdAt: text("created_at").notNull()
68
- }, (table) => [
69
- index("idx_runtime_task_events_task_created").on(table.taskId, table.createdAt)
70
- ]);
71
- const runtimeTaskOutputs = pgTable("runtime_task_outputs", {
72
- id: text("id").primaryKey(),
73
- taskId: text("task_id").notNull(),
74
- outputJson: text("output_json").notNull(),
75
- outputRef: text("output_ref"),
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
- ]);
83
- const graphRuns = pgTable("graph_runs", {
84
- id: text("id").primaryKey(),
85
- workDayId: text("work_day_id").notNull(),
86
- corpusHash: text("corpus_hash").notNull(),
87
- graphVersion: text("graph_version").notNull(),
88
- queryJson: text("query_json"),
89
- seedIdsJson: text("seed_ids_json"),
90
- selectedNodeIdsJson: text("selected_node_ids_json"),
91
- statsJson: text("stats_json"),
92
- snapshotRef: text("snapshot_ref"),
93
- createdAt: text("created_at").notNull()
94
- });
95
- const reports = pgTable("reports", {
96
- id: text("id").primaryKey(),
97
- workDayId: text("work_day_id").notNull(),
98
- kind: text("kind").notNull(),
99
- bodyJson: text("body_json").notNull(),
100
- renderedRef: text("rendered_ref"),
101
- sentAt: text("sent_at"),
102
- createdAt: text("created_at").notNull()
103
- });
104
- const users = pgTable("users", {
105
- id: text("id").primaryKey(),
106
- email: text("email"),
107
- displayName: text("display_name"),
108
- status: text("status").notNull().default("active"),
109
- metadataJson: text("metadata_json"),
110
- createdAt: text("created_at").notNull(),
111
- updatedAt: text("updated_at").notNull(),
112
- username: text("username")
113
- }, (table) => [
114
- uniqueIndex("idx_users_username").on(table.username)
115
- ]);
116
- const userIdentities = pgTable("user_identities", {
117
- id: text("id").primaryKey(),
118
- userId: text("user_id").notNull(),
119
- provider: text("provider").notNull(),
120
- providerSubject: text("provider_subject").notNull(),
121
- email: text("email"),
122
- emailVerified: integer("email_verified").notNull().default(0),
123
- profileJson: text("profile_json"),
124
- createdAt: text("created_at").notNull(),
125
- updatedAt: text("updated_at").notNull()
126
- }, (table) => [
127
- uniqueIndex("idx_user_identities_provider_subject").on(table.provider, table.providerSubject)
128
- ]);
129
- const userEmailAddresses = pgTable("user_email_addresses", {
130
- id: text("id").primaryKey(),
131
- userId: text("user_id").notNull(),
132
- email: text("email").notNull(),
133
- normalizedEmail: text("normalized_email").notNull().unique(),
134
- status: text("status").notNull().default("pending"),
135
- isPrimary: integer("is_primary").notNull().default(0),
136
- verificationRequestedAt: text("verification_requested_at"),
137
- verifiedAt: text("verified_at"),
138
- createdAt: text("created_at").notNull(),
139
- updatedAt: text("updated_at").notNull()
140
- }, (table) => [
141
- index("idx_user_email_addresses_user").on(table.userId, table.status, table.isPrimary),
142
- uniqueIndex("idx_user_email_addresses_normalized").on(table.normalizedEmail)
143
- ]);
144
- const roles = pgTable("roles", {
145
- id: text("id").primaryKey(),
146
- keyColumn: text("key").notNull().unique(),
147
- description: text("description"),
148
- createdAt: text("created_at").notNull()
149
- });
150
- const permissions = pgTable("permissions", {
151
- id: text("id").primaryKey(),
152
- keyColumn: text("key").notNull().unique(),
153
- resource: text("resource").notNull(),
154
- action: text("action").notNull(),
155
- scope: text("scope").notNull(),
156
- description: text("description"),
157
- createdAt: text("created_at").notNull()
158
- });
159
- const rolePermissions = pgTable("role_permissions", {
160
- roleId: text("role_id"),
161
- permissionId: text("permission_id"),
162
- createdAt: text("created_at").notNull()
163
- }, (table) => [
164
- primaryKey({ columns: [table.roleId, table.permissionId] })
165
- ]);
166
- const userRoleBindings = pgTable("user_role_bindings", {
167
- id: text("id").primaryKey(),
168
- userId: text("user_id").notNull(),
169
- roleId: text("role_id").notNull(),
170
- createdAt: text("created_at").notNull()
171
- }, (table) => [
172
- uniqueIndex("idx_user_role_bindings_user_role").on(table.userId, table.roleId)
173
- ]);
174
- const apiTokens = pgTable("api_tokens", {
175
- id: text("id").primaryKey(),
176
- userId: text("user_id").notNull(),
177
- kind: text("kind").notNull(),
178
- name: text("name").notNull(),
179
- tokenPrefix: text("token_prefix").notNull(),
180
- tokenHash: text("token_hash").notNull(),
181
- scopesJson: text("scopes_json").notNull(),
182
- expiresAt: text("expires_at"),
183
- lastUsedAt: text("last_used_at"),
184
- revokedAt: text("revoked_at"),
185
- metadataJson: text("metadata_json"),
186
- createdAt: text("created_at").notNull(),
187
- updatedAt: text("updated_at").notNull()
188
- }, (table) => [
189
- index("idx_api_tokens_user_id").on(table.userId),
190
- index("idx_api_tokens_prefix").on(table.tokenPrefix)
191
- ]);
192
- const serviceCredentials = pgTable("service_credentials", {
193
- id: text("id").primaryKey(),
194
- serviceId: text("service_id").notNull().unique(),
195
- name: text("name").notNull(),
196
- secretHash: text("secret_hash").notNull(),
197
- rolesJson: text("roles_json").notNull(),
198
- permissionsJson: text("permissions_json").notNull(),
199
- revokedAt: text("revoked_at"),
200
- createdAt: text("created_at").notNull(),
201
- updatedAt: text("updated_at").notNull(),
202
- lastUsedAt: text("last_used_at")
203
- });
204
- const authSessions = pgTable("auth_sessions", {
205
- id: text("id").primaryKey(),
206
- userId: text("user_id").notNull(),
207
- sessionType: text("session_type").notNull(),
208
- refreshTokenHash: text("refresh_token_hash").notNull(),
209
- scopesJson: text("scopes_json").notNull(),
210
- expiresAt: text("expires_at").notNull(),
211
- revokedAt: text("revoked_at"),
212
- dataJson: text("data_json"),
213
- createdAt: text("created_at").notNull(),
214
- updatedAt: text("updated_at").notNull()
215
- }, (table) => [
216
- index("idx_auth_sessions_user_id").on(table.userId)
217
- ]);
218
- const auditEvents = pgTable("audit_events", {
219
- id: text("id").primaryKey(),
220
- actorType: text("actor_type").notNull(),
221
- actorId: text("actor_id"),
222
- eventType: text("event_type").notNull(),
223
- targetType: text("target_type"),
224
- targetId: text("target_id"),
225
- dataJson: text("data_json"),
226
- createdAt: text("created_at").notNull()
227
- }, (table) => [
228
- index("idx_audit_events_target").on(table.targetType, table.targetId)
229
- ]);
230
- const deviceCodes = pgTable("device_codes", {
231
- id: text("id").primaryKey(),
232
- deviceCode: text("device_code").notNull().unique(),
233
- userCode: text("user_code").notNull().unique(),
234
- requestedScopesJson: text("requested_scopes_json").notNull(),
235
- expiresAt: text("expires_at").notNull(),
236
- intervalSeconds: integer("interval_seconds").notNull(),
237
- status: text("status").notNull(),
238
- userId: text("user_id"),
239
- createdAt: text("created_at").notNull(),
240
- updatedAt: text("updated_at").notNull()
241
- });
242
- const teams = pgTable("teams", {
243
- id: text("id").primaryKey(),
244
- slug: text("slug").notNull().unique(),
245
- name: text("name").notNull(),
246
- metadataJson: text("metadata_json"),
247
- createdAt: text("created_at").notNull(),
248
- updatedAt: text("updated_at").notNull(),
249
- displayName: text("display_name"),
250
- logoUrl: text("logo_url"),
251
- profileSummary: text("profile_summary")
252
- }, (table) => [
253
- uniqueIndex("idx_teams_name").on(table.name)
254
- ]);
255
- const teamMemberships = pgTable("team_memberships", {
256
- id: text("id").primaryKey(),
257
- teamId: text("team_id").notNull(),
258
- userId: text("user_id").notNull(),
259
- status: text("status").notNull().default("active"),
260
- createdAt: text("created_at").notNull(),
261
- updatedAt: text("updated_at").notNull()
262
- }, (table) => [
263
- uniqueIndex("idx_team_memberships_team_user").on(table.teamId, table.userId)
264
- ]);
265
- const teamRoleBindings = pgTable("team_role_bindings", {
266
- id: text("id").primaryKey(),
267
- teamMembershipId: text("team_membership_id").notNull(),
268
- roleId: text("role_id").notNull(),
269
- createdAt: text("created_at").notNull()
270
- });
271
- const webSessions = pgTable("web_sessions", {
272
- id: text("id").primaryKey(),
273
- userId: text("user_id").notNull(),
274
- identityId: text("identity_id"),
275
- betterAuthSessionId: text("better_auth_session_id"),
276
- provider: text("provider").notNull(),
277
- providerSubject: text("provider_subject").notNull(),
278
- email: text("email"),
279
- displayName: text("display_name"),
280
- principalJson: text("principal_json").notNull(),
281
- csrfToken: text("csrf_token").notNull(),
282
- ipAddress: text("ip_address"),
283
- userAgent: text("user_agent"),
284
- authenticatedAt: text("authenticated_at").notNull(),
285
- lastSeenAt: text("last_seen_at"),
286
- expiresAt: text("expires_at").notNull(),
287
- revokedAt: text("revoked_at"),
288
- createdAt: text("created_at").notNull(),
289
- updatedAt: text("updated_at").notNull()
290
- }, (table) => [
291
- index("idx_web_sessions_user_id").on(table.userId)
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
- ]);
647
- const projects = pgTable("projects", {
648
- id: text("id").primaryKey(),
649
- teamId: text("team_id").notNull(),
650
- slug: text("slug").notNull(),
651
- name: text("name").notNull(),
652
- description: text("description"),
653
- metadataJson: text("metadata_json"),
654
- createdAt: text("created_at").notNull(),
655
- updatedAt: text("updated_at").notNull()
656
- }, (table) => [
657
- uniqueIndex("idx_projects_team_slug").on(table.teamId, table.slug),
658
- index("idx_projects_team_id").on(table.teamId)
659
- ]);
660
- const projectConnections = pgTable("project_connections", {
661
- id: text("id").primaryKey(),
662
- projectId: text("project_id").notNull().unique(),
663
- mode: text("mode").notNull(),
664
- projectApiBaseUrl: text("project_api_base_url"),
665
- executionOwner: text("execution_owner").notNull(),
666
- runnerRegistrationState: text("runner_registration_state").notNull().default("pending"),
667
- runnerKeyPrefix: text("runner_key_prefix"),
668
- runnerKeyHash: text("runner_key_hash"),
669
- runnerRegisteredAt: text("runner_registered_at"),
670
- runnerLastSeenAt: text("runner_last_seen_at"),
671
- metadataJson: text("metadata_json"),
672
- createdAt: text("created_at").notNull(),
673
- updatedAt: text("updated_at").notNull()
674
- });
675
- const projectCapabilityGrants = pgTable("project_capability_grants", {
676
- id: text("id").primaryKey(),
677
- projectId: text("project_id").notNull(),
678
- label: text("label"),
679
- namespace: text("namespace").notNull(),
680
- operation: text("operation").notNull(),
681
- executionClass: text("execution_class").notNull(),
682
- allowedTargetsJson: text("allowed_targets_json").notNull(),
683
- defaultDispatchMode: text("default_dispatch_mode").notNull(),
684
- approvalPolicyJson: text("approval_policy_json").notNull().default("{}"),
685
- resourceScopeJson: text("resource_scope_json").notNull().default("{}"),
686
- metadataJson: text("metadata_json").notNull().default("{}"),
687
- enabled: integer("enabled").notNull().default(1),
688
- createdAt: text("created_at").notNull(),
689
- updatedAt: text("updated_at").notNull()
690
- }, (table) => [
691
- uniqueIndex("idx_project_capability_grants_project_operation").on(table.projectId, table.namespace, table.operation)
692
- ]);
693
- const teamApiKeys = pgTable("team_api_keys", {
694
- id: text("id").primaryKey(),
695
- teamId: text("team_id").notNull(),
696
- name: text("name").notNull(),
697
- keyPrefix: text("key_prefix").notNull(),
698
- keyHash: text("key_hash").notNull(),
699
- permissionsJson: text("permissions_json").notNull(),
700
- expiresAt: text("expires_at"),
701
- lastUsedAt: text("last_used_at"),
702
- revokedAt: text("revoked_at"),
703
- createdAt: text("created_at").notNull(),
704
- updatedAt: text("updated_at").notNull()
705
- }, (table) => [
706
- index("idx_team_api_keys_prefix").on(table.keyPrefix)
707
- ]);
708
- const entitlements = pgTable("entitlements", {
709
- id: text("id").primaryKey(),
710
- teamId: text("team_id"),
711
- projectId: text("project_id"),
712
- tier: text("tier").notNull(),
713
- status: text("status").notNull(),
714
- metadataJson: text("metadata_json"),
715
- createdAt: text("created_at").notNull(),
716
- updatedAt: text("updated_at").notNull()
717
- }, (table) => [
718
- uniqueIndex("idx_entitlements_project").on(table.projectId)
719
- ]);
720
- const remoteJobs = pgTable("remote_jobs", {
721
- id: text("id").primaryKey(),
722
- projectId: text("project_id").notNull(),
723
- namespace: text("namespace").notNull(),
724
- operation: text("operation").notNull(),
725
- status: text("status").notNull(),
726
- preferredMode: text("preferred_mode").notNull(),
727
- selectedTarget: text("selected_target").notNull(),
728
- capabilityJson: text("capability_json").notNull(),
729
- inputJson: text("input_json").notNull(),
730
- outputJson: text("output_json"),
731
- errorJson: text("error_json"),
732
- requestedByType: text("requested_by_type").notNull(),
733
- requestedById: text("requested_by_id"),
734
- assignedRunnerId: text("assigned_runner_id"),
735
- idempotencyKey: text("idempotency_key"),
736
- createdAt: text("created_at").notNull(),
737
- updatedAt: text("updated_at").notNull(),
738
- startedAt: text("started_at"),
739
- finishedAt: text("finished_at"),
740
- cancelledAt: text("cancelled_at")
741
- }, (table) => [
742
- index("idx_remote_jobs_project_status").on(table.projectId, table.status, table.createdAt),
743
- index("idx_remote_jobs_project_idempotency").on(table.projectId, table.idempotencyKey)
744
- ]);
745
- const remoteJobEvents = pgTable("remote_job_events", {
746
- id: text("id").primaryKey(),
747
- jobId: text("job_id").notNull(),
748
- seq: integer("seq").notNull(),
749
- kind: text("kind").notNull(),
750
- dataJson: text("data_json"),
751
- createdAt: text("created_at").notNull()
752
- }, (table) => [
753
- uniqueIndex("idx_remote_job_events_job_seq").on(table.jobId, table.seq)
754
- ]);
755
- const knowledgePacks = pgTable("knowledge_packs", {
756
- id: text("id").primaryKey(),
757
- teamId: text("team_id").notNull(),
758
- slug: text("slug").notNull().unique(),
759
- name: text("name").notNull(),
760
- summary: text("summary"),
761
- sourceKind: text("source_kind").notNull(),
762
- sourceRef: text("source_ref"),
763
- installStrategy: text("install_strategy").notNull(),
764
- visibility: text("visibility").notNull(),
765
- metadataJson: text("metadata_json"),
766
- createdAt: text("created_at").notNull(),
767
- updatedAt: text("updated_at").notNull()
768
- }, (table) => [
769
- index("idx_knowledge_packs_team_id").on(table.teamId)
770
- ]);
771
- const teamStorageLocators = pgTable("team_storage_locators", {
772
- id: text("id").primaryKey(),
773
- teamId: text("team_id").notNull().unique(),
774
- bucketName: text("bucket_name").notNull(),
775
- manifestKeyTemplate: text("manifest_key_template").notNull(),
776
- previewRootTemplate: text("preview_root_template").notNull(),
777
- publicBaseUrl: text("public_base_url"),
778
- metadataJson: text("metadata_json"),
779
- createdAt: text("created_at").notNull(),
780
- updatedAt: text("updated_at").notNull()
781
- });
782
- const catalogItems = pgTable("catalog_items", {
783
- id: text("id").primaryKey(),
784
- teamId: text("team_id").notNull(),
785
- kind: text("kind").notNull(),
786
- slug: text("slug").notNull(),
787
- title: text("title").notNull(),
788
- summary: text("summary"),
789
- visibility: text("visibility").notNull(),
790
- listingEnabled: integer("listing_enabled").notNull().default(0),
791
- offerMode: text("offer_mode").notNull(),
792
- manifestKey: text("manifest_key"),
793
- artifactKey: text("artifact_key"),
794
- searchText: text("search_text"),
795
- metadataJson: text("metadata_json"),
796
- createdAt: text("created_at").notNull(),
797
- updatedAt: text("updated_at").notNull()
798
- }, (table) => [
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)
1520
- ]);
1521
- const commerceCapacityListings = pgTable("commerce_capacity_listings", {
1522
- id: text("id").primaryKey(),
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("{}"),
1545
- createdAt: text("created_at").notNull(),
1546
- updatedAt: text("updated_at").notNull()
1547
- }, (table) => [
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)
1582
- ]);
1583
- const commerceWebhookEvents = pgTable("commerce_webhook_events", {
1584
- id: text("id").primaryKey(),
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"),
1599
- createdAt: text("created_at").notNull(),
1600
- updatedAt: text("updated_at").notNull()
1601
- }, (table) => [
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)
1607
- ]);
1608
- const projectHosting = pgTable("project_hosting", {
1609
- id: text("id").primaryKey(),
1610
- projectId: text("project_id").notNull().unique(),
1611
- hostingKind: text("hosting_kind").notNull(),
1612
- registration: text("registration").notNull().default("none"),
1613
- marketBaseUrl: text("market_base_url"),
1614
- sourceRepoOwner: text("source_repo_owner"),
1615
- sourceRepoName: text("source_repo_name"),
1616
- sourceRepoUrl: text("source_repo_url"),
1617
- sourceRepoWorkflowPath: text("source_repo_workflow_path"),
1618
- metadataJson: text("metadata_json"),
1619
- createdAt: text("created_at").notNull(),
1620
- updatedAt: text("updated_at").notNull()
1621
- });
1622
- const projectEnvironments = pgTable("project_environments", {
1623
- id: text("id").primaryKey(),
1624
- projectId: text("project_id").notNull(),
1625
- environment: text("environment").notNull(),
1626
- deploymentProfile: text("deployment_profile").notNull(),
1627
- baseUrl: text("base_url"),
1628
- cloudflareAccountId: text("cloudflare_account_id"),
1629
- pagesProjectName: text("pages_project_name"),
1630
- workerName: text("worker_name"),
1631
- r2BucketName: text("r2_bucket_name"),
1632
- d1DatabaseName: text("d1_database_name"),
1633
- queueName: text("queue_name"),
1634
- railwayProjectName: text("railway_project_name"),
1635
- metadataJson: text("metadata_json"),
1636
- createdAt: text("created_at").notNull(),
1637
- updatedAt: text("updated_at").notNull()
1638
- }, (table) => [
1639
- uniqueIndex("idx_project_environments_project_environment").on(table.projectId, table.environment)
1640
- ]);
1641
- const projectInfrastructureResources = pgTable("project_infrastructure_resources", {
1642
- id: text("id").primaryKey(),
1643
- projectId: text("project_id").notNull(),
1644
- environment: text("environment").notNull(),
1645
- provider: text("provider").notNull(),
1646
- resourceKind: text("resource_kind").notNull(),
1647
- logicalName: text("logical_name").notNull(),
1648
- locator: text("locator"),
1649
- metadataJson: text("metadata_json"),
1650
- createdAt: text("created_at").notNull(),
1651
- updatedAt: text("updated_at").notNull()
1652
- }, (table) => [
1653
- uniqueIndex("idx_project_infrastructure_resource_unique").on(table.projectId, table.environment, table.provider, table.resourceKind, table.logicalName)
1654
- ]);
1655
- const projectDeployments = pgTable("project_deployments", {
1656
- id: text("id").primaryKey(),
1657
- teamId: text("team_id").notNull(),
1658
- projectId: text("project_id").notNull(),
1659
- environment: text("environment").notNull(),
1660
- deploymentKind: text("deployment_kind").notNull(),
1661
- action: text("action").notNull().default("deploy_web"),
1662
- status: text("status").notNull(),
1663
- platformOperationId: text("platform_operation_id"),
1664
- retryOfDeploymentId: text("retry_of_deployment_id"),
1665
- resumedFromDeploymentId: text("resumed_from_deployment_id"),
1666
- idempotencyKey: text("idempotency_key"),
1667
- requestedByUserId: text("requested_by_user_id"),
1668
- sourceRef: text("source_ref"),
1669
- releaseTag: text("release_tag"),
1670
- commitSha: text("commit_sha"),
1671
- triggeredByType: text("triggered_by_type"),
1672
- triggeredById: text("triggered_by_id"),
1673
- repositoryJson: text("repository_json").notNull().default("{}"),
1674
- externalWorkflowJson: text("external_workflow_json").notNull().default("{}"),
1675
- targetJson: text("target_json").notNull().default("{}"),
1676
- monitorJson: text("monitor_json").notNull().default("{}"),
1677
- summary: text("summary"),
1678
- errorJson: text("error_json").notNull().default("{}"),
1679
- metadataJson: text("metadata_json"),
1680
- startedAt: text("started_at"),
1681
- finishedAt: text("finished_at"),
1682
- createdAt: text("created_at").notNull(),
1683
- updatedAt: text("updated_at").notNull(),
1684
- completedAt: text("completed_at")
1685
- }, (table) => [
1686
- index("idx_project_deployments_project_created").on(table.projectId, table.createdAt),
1687
- index("idx_project_deployments_project_environment").on(table.projectId, table.environment, table.createdAt),
1688
- index("idx_project_deployments_project_status").on(table.projectId, table.status, table.updatedAt),
1689
- index("idx_project_deployments_operation").on(table.platformOperationId),
1690
- index("idx_project_deployments_team_created").on(table.teamId, table.createdAt),
1691
- uniqueIndex("idx_project_deployments_idempotency").on(table.projectId, table.idempotencyKey)
1692
- ]);
1693
- const projectDeploymentEvents = pgTable("project_deployment_events", {
1694
- id: text("id").primaryKey(),
1695
- deploymentId: text("deployment_id").notNull(),
1696
- projectId: text("project_id").notNull(),
1697
- teamId: text("team_id").notNull(),
1698
- operationId: text("operation_id"),
1699
- kind: text("kind").notNull(),
1700
- message: text("message").notNull(),
1701
- status: text("status"),
1702
- severity: text("severity").notNull().default("info"),
1703
- sequence: integer("sequence").notNull(),
1704
- payloadJson: text("payload_json").notNull().default("{}"),
1705
- createdAt: text("created_at").notNull()
1706
- }, (table) => [
1707
- index("idx_project_deployment_events_deployment_sequence").on(table.deploymentId, table.sequence),
1708
- index("idx_project_deployment_events_project_created").on(table.projectId, table.createdAt),
1709
- index("idx_project_deployment_events_operation").on(table.operationId)
1710
- ]);
1711
- const agentPools = pgTable("agent_pools", {
1712
- id: text("id").primaryKey(),
1713
- projectId: text("project_id").notNull(),
1714
- teamId: text("team_id").notNull(),
1715
- environment: text("environment").notNull(),
1716
- name: text("name").notNull(),
1717
- registrationIdentity: text("registration_identity"),
1718
- serviceBaseUrl: text("service_base_url"),
1719
- status: text("status").notNull().default("pending"),
1720
- minWorkers: integer("min_workers").notNull().default(0),
1721
- maxWorkers: integer("max_workers").notNull().default(1),
1722
- targetQueueDepth: integer("target_queue_depth").notNull().default(1),
1723
- cooldownSeconds: integer("cooldown_seconds").notNull().default(60),
1724
- metadataJson: text("metadata_json"),
1725
- createdAt: text("created_at").notNull(),
1726
- updatedAt: text("updated_at").notNull()
1727
- }, (table) => [
1728
- uniqueIndex("idx_agent_pools_project_environment_name").on(table.projectId, table.environment, table.name)
1729
- ]);
1730
- const agentPoolRegistrations = pgTable("agent_pool_registrations", {
1731
- id: text("id").primaryKey(),
1732
- poolId: text("pool_id").notNull(),
1733
- projectId: text("project_id").notNull(),
1734
- runnerId: text("runner_id"),
1735
- managerId: text("manager_id"),
1736
- serviceName: text("service_name"),
1737
- heartbeatAt: text("heartbeat_at").notNull(),
1738
- desiredWorkers: integer("desired_workers"),
1739
- observedQueueDepth: integer("observed_queue_depth"),
1740
- observedActiveLeases: integer("observed_active_leases"),
1741
- metadataJson: text("metadata_json"),
1742
- createdAt: text("created_at").notNull(),
1743
- updatedAt: text("updated_at").notNull()
1744
- }, (table) => [
1745
- index("idx_agent_pool_registrations_pool_heartbeat").on(table.poolId, table.heartbeatAt)
1746
- ]);
1747
- const agentPoolScaleDecisions = pgTable("agent_pool_scale_decisions", {
1748
- id: text("id").primaryKey(),
1749
- poolId: text("pool_id").notNull(),
1750
- projectId: text("project_id").notNull(),
1751
- environment: text("environment").notNull(),
1752
- desiredWorkers: integer("desired_workers").notNull(),
1753
- observedQueueDepth: integer("observed_queue_depth").notNull().default(0),
1754
- observedActiveLeases: integer("observed_active_leases").notNull().default(0),
1755
- workDayId: text("work_day_id"),
1756
- reason: text("reason").notNull(),
1757
- metadataJson: text("metadata_json").notNull(),
1758
- createdAt: text("created_at").notNull(),
1759
- updatedAt: text("updated_at").notNull()
1760
- }, (table) => [
1761
- index("idx_agent_pool_scale_decisions_pool_created").on(table.poolId, table.createdAt)
1762
- ]);
1763
- const projectWorkdaySummaries = pgTable("project_workday_summaries", {
1764
- id: text("id").primaryKey(),
1765
- projectId: text("project_id").notNull(),
1766
- environment: text("environment").notNull(),
1767
- workDayId: text("work_day_id").notNull(),
1768
- kind: text("kind").notNull(),
1769
- state: text("state"),
1770
- startedAt: text("started_at"),
1771
- endedAt: text("ended_at"),
1772
- summaryJson: text("summary_json").notNull(),
1773
- metadataJson: text("metadata_json").notNull(),
1774
- createdAt: text("created_at").notNull(),
1775
- updatedAt: text("updated_at").notNull()
1776
- }, (table) => [
1777
- index("idx_project_workday_summaries_project_environment_created").on(table.projectId, table.environment, table.createdAt)
1778
- ]);
1779
- const workPolicies = pgTable("work_policies", {
1780
- projectId: text("project_id"),
1781
- environment: text("environment"),
1782
- scheduleJson: text("schedule_json").notNull(),
1783
- dailyTaskCreditBudget: integer("daily_task_credit_budget").notNull().default(0),
1784
- maxQueuedTasks: integer("max_queued_tasks").notNull().default(0),
1785
- maxQueuedCredits: integer("max_queued_credits").notNull().default(0),
1786
- autoscaleJson: text("autoscale_json").notNull(),
1787
- creditWeightsJson: text("credit_weights_json").notNull(),
1788
- metadataJson: text("metadata_json").notNull(),
1789
- createdAt: text("created_at").notNull(),
1790
- updatedAt: text("updated_at").notNull(),
1791
- enabled: integer("enabled").notNull().default(1),
1792
- startCron: text("start_cron").notNull().default("0 9 * * 1-5"),
1793
- durationMinutes: integer("duration_minutes").notNull().default(480),
1794
- maxRunners: integer("max_runners").notNull().default(1),
1795
- maxWorkersPerRunner: integer("max_workers_per_runner").notNull().default(4),
1796
- dailyCreditBudget: integer("daily_credit_budget").notNull().default(0),
1797
- closeoutGraceMinutes: integer("closeout_grace_minutes").notNull().default(15)
1798
- }, (table) => [
1799
- primaryKey({ columns: [table.projectId, table.environment] })
1800
- ]);
1801
- const priorityOverrides = pgTable("priority_overrides", {
1802
- id: text("id").primaryKey(),
1803
- projectId: text("project_id").notNull(),
1804
- model: text("model").notNull(),
1805
- subjectId: text("subject_id").notNull(),
1806
- priority: real("priority").notNull().default(0),
1807
- estimatedCredits: real("estimated_credits"),
1808
- metadataJson: text("metadata_json").notNull(),
1809
- createdAt: text("created_at").notNull(),
1810
- updatedAt: text("updated_at").notNull()
1811
- }, (table) => [
1812
- index("idx_priority_overrides_project_priority").on(table.projectId, table.priority, table.updatedAt)
1813
- ]);
1814
- const prioritySnapshots = pgTable("priority_snapshots", {
1815
- id: text("id").primaryKey(),
1816
- projectId: text("project_id").notNull(),
1817
- workDayId: text("work_day_id"),
1818
- snapshotJson: text("snapshot_json").notNull(),
1819
- metadataJson: text("metadata_json").notNull(),
1820
- generatedAt: text("generated_at").notNull(),
1821
- createdAt: text("created_at").notNull(),
1822
- updatedAt: text("updated_at").notNull()
1823
- }, (table) => [
1824
- index("idx_priority_snapshots_project_generated").on(table.projectId, table.generatedAt)
1825
- ]);
1826
- const taskCreditLedger = pgTable("task_credit_ledger", {
1827
- id: text("id").primaryKey(),
1828
- projectId: text("project_id").notNull(),
1829
- workDayId: text("work_day_id").notNull(),
1830
- taskId: text("task_id"),
1831
- phase: text("phase").notNull(),
1832
- credits: real("credits").notNull(),
1833
- metadataJson: text("metadata_json").notNull(),
1834
- createdAt: text("created_at").notNull()
1835
- }, (table) => [
1836
- index("idx_task_credit_ledger_work_day_created").on(table.workDayId, table.createdAt)
1837
- ]);
1838
- const scaleDecisions = pgTable("scale_decisions", {
1839
- id: text("id").primaryKey(),
1840
- projectId: text("project_id").notNull(),
1841
- environment: text("environment").notNull(),
1842
- poolName: text("pool_name").notNull(),
1843
- workDayId: text("work_day_id"),
1844
- desiredWorkers: integer("desired_workers").notNull(),
1845
- observedQueueDepth: integer("observed_queue_depth").notNull().default(0),
1846
- observedActiveLeases: integer("observed_active_leases").notNull().default(0),
1847
- reason: text("reason").notNull(),
1848
- metadataJson: text("metadata_json").notNull(),
1849
- createdAt: text("created_at").notNull()
1850
- }, (table) => [
1851
- index("idx_scale_decisions_project_environment_pool_created").on(table.projectId, table.environment, table.poolName, table.createdAt)
1852
- ]);
1853
- const projectSummarySnapshots = pgTable("project_summary_snapshots", {
1854
- projectId: text("project_id").primaryKey(),
1855
- teamId: text("team_id").notNull(),
1856
- summaryJson: text("summary_json").notNull(),
1857
- generatedAt: text("generated_at").notNull(),
1858
- createdAt: text("created_at").notNull(),
1859
- updatedAt: text("updated_at").notNull()
1860
- }, (table) => [
1861
- index("idx_project_summary_snapshots_team_generated").on(table.teamId, table.generatedAt)
1862
- ]);
1863
- const teamInboxItems = pgTable("team_inbox_items", {
1864
- id: text("id").primaryKey(),
1865
- teamId: text("team_id").notNull(),
1866
- projectId: text("project_id"),
1867
- kind: text("kind").notNull(),
1868
- state: text("state").notNull(),
1869
- title: text("title").notNull(),
1870
- summary: text("summary"),
1871
- href: text("href"),
1872
- itemKey: text("item_key"),
1873
- metadataJson: text("metadata_json").notNull().default("{}"),
1874
- createdAt: text("created_at").notNull(),
1875
- updatedAt: text("updated_at").notNull()
1876
- }, (table) => [
1877
- index("idx_team_inbox_items_team_created").on(table.teamId, table.createdAt)
1878
- ]);
1879
- const betterAuthUser = pgTable("better_auth_user", {
1880
- id: text("id").primaryKey(),
1881
- name: text("name").notNull(),
1882
- email: text("email").notNull().unique(),
1883
- emailVerified: integer("emailVerified").notNull().default(0),
1884
- image: text("image"),
1885
- createdAt: bigint("createdAt", { mode: "number" }).notNull(),
1886
- updatedAt: bigint("updatedAt", { mode: "number" }).notNull(),
1887
- username: text("username"),
1888
- firstName: text("firstName"),
1889
- lastName: text("lastName")
1890
- }, (table) => [
1891
- uniqueIndex("idx_better_auth_user_username").on(table.username)
1892
- ]);
1893
- const betterAuthSession = pgTable("better_auth_session", {
1894
- id: text("id").primaryKey(),
1895
- expiresAt: bigint("expiresAt", { mode: "number" }).notNull(),
1896
- token: text("token").notNull().unique(),
1897
- createdAt: bigint("createdAt", { mode: "number" }).notNull(),
1898
- updatedAt: bigint("updatedAt", { mode: "number" }).notNull(),
1899
- ipAddress: text("ipAddress"),
1900
- userAgent: text("userAgent"),
1901
- userId: text("userId").notNull()
1902
- }, (table) => [
1903
- index("idx_better_auth_session_token").on(table.token),
1904
- index("idx_better_auth_session_userId").on(table.userId)
1905
- ]);
1906
- const betterAuthAccount = pgTable("better_auth_account", {
1907
- id: text("id").primaryKey(),
1908
- accountId: text("accountId").notNull(),
1909
- providerId: text("providerId").notNull(),
1910
- userId: text("userId").notNull(),
1911
- accessToken: text("accessToken"),
1912
- refreshToken: text("refreshToken"),
1913
- idToken: text("idToken"),
1914
- accessTokenExpiresAt: bigint("accessTokenExpiresAt", { mode: "number" }),
1915
- refreshTokenExpiresAt: bigint("refreshTokenExpiresAt", { mode: "number" }),
1916
- scope: text("scope"),
1917
- password: text("password"),
1918
- createdAt: bigint("createdAt", { mode: "number" }).notNull(),
1919
- updatedAt: bigint("updatedAt", { mode: "number" }).notNull()
1920
- }, (table) => [
1921
- index("idx_better_auth_account_userId").on(table.userId),
1922
- uniqueIndex("idx_better_auth_account_provider_account").on(table.providerId, table.accountId)
1923
- ]);
1924
- const betterAuthVerification = pgTable("better_auth_verification", {
1925
- id: text("id").primaryKey(),
1926
- identifier: text("identifier").notNull(),
1927
- value: text("value").notNull(),
1928
- expiresAt: bigint("expiresAt", { mode: "number" }).notNull(),
1929
- createdAt: bigint("createdAt", { mode: "number" }).notNull(),
1930
- updatedAt: bigint("updatedAt", { mode: "number" }).notNull()
1931
- }, (table) => [
1932
- index("idx_better_auth_verification_identifier").on(table.identifier)
1933
- ]);
1934
- const teamWebHosts = pgTable("team_web_hosts", {
1935
- id: text("id").primaryKey(),
1936
- teamId: text("team_id").notNull(),
1937
- provider: text("provider").notNull(),
1938
- ownership: text("ownership").notNull(),
1939
- name: text("name").notNull(),
1940
- accountLabel: text("account_label"),
1941
- allowedEnvironmentsJson: text("allowed_environments_json").notNull().default("[]"),
1942
- status: text("status").notNull().default("active"),
1943
- encryptedPayloadJson: text("encrypted_payload_json"),
1944
- metadataJson: text("metadata_json"),
1945
- createdById: text("created_by_id"),
1946
- updatedById: text("updated_by_id"),
1947
- createdAt: text("created_at").notNull(),
1948
- updatedAt: text("updated_at").notNull()
1949
- }, (table) => [
1950
- index("idx_team_web_hosts_team_provider").on(table.teamId, table.provider, table.status),
1951
- uniqueIndex("idx_team_web_hosts_team_provider_name").on(table.teamId, table.provider, table.name)
1952
- ]);
1953
- const teamInvites = pgTable("team_invites", {
1954
- id: text("id").primaryKey(),
1955
- teamId: text("team_id").notNull(),
1956
- email: text("email").notNull(),
1957
- roleKey: text("role_key").notNull(),
1958
- tokenPrefix: text("token_prefix").notNull(),
1959
- tokenHash: text("token_hash").notNull(),
1960
- status: text("status").notNull().default("pending"),
1961
- invitedByUserId: text("invited_by_user_id"),
1962
- acceptedByUserId: text("accepted_by_user_id"),
1963
- acceptedAt: text("accepted_at"),
1964
- expiresAt: text("expires_at").notNull(),
1965
- createdAt: text("created_at").notNull(),
1966
- updatedAt: text("updated_at").notNull()
1967
- }, (table) => [
1968
- index("idx_team_invites_team_status").on(table.teamId, table.status, table.createdAt),
1969
- index("idx_team_invites_token_prefix").on(table.tokenPrefix)
1970
- ]);
1971
- const capacityProviders = pgTable("capacity_providers", {
1972
- id: text("id").primaryKey(),
1973
- teamId: text("team_id"),
1974
- ownerTeamId: text("owner_team_id"),
1975
- name: text("name").notNull(),
1976
- kind: text("kind").notNull(),
1977
- status: text("status").notNull().default("pending"),
1978
- provider: text("provider").notNull(),
1979
- billingScope: text("billing_scope").notNull().default("team"),
1980
- monthlyCreditBudget: real("monthly_credit_budget").notNull().default(0),
1981
- dailyCreditBudget: real("daily_credit_budget").notNull().default(0),
1982
- creditBudgetMode: text("credit_budget_mode").notNull().default("derived"),
1983
- maxConcurrentWorkdays: integer("max_concurrent_workdays").notNull().default(1),
1984
- maxConcurrentWorkers: integer("max_concurrent_workers").notNull().default(1),
1985
- capacityModelJson: text("capacity_model_json").notNull().default("{}"),
1986
- metadataJson: text("metadata_json").notNull().default("{}"),
1987
- createdAt: text("created_at").notNull(),
1988
- updatedAt: text("updated_at").notNull()
1989
- }, (table) => [
1990
- index("idx_capacity_providers_team_status").on(table.teamId, table.status, table.provider)
1991
- ]);
1992
- const capacityProviderHosts = pgTable("capacity_provider_hosts", {
1993
- id: text("id").primaryKey(),
1994
- capacityProviderId: text("capacity_provider_id").notNull(),
1995
- hostId: text("host_id").notNull(),
1996
- role: text("role").notNull(),
1997
- required: integer("required").notNull().default(1),
1998
- metadataJson: text("metadata_json").notNull().default("{}"),
1999
- createdAt: text("created_at").notNull(),
2000
- updatedAt: text("updated_at").notNull()
2001
- }, (table) => [
2002
- uniqueIndex("idx_capacity_provider_hosts_unique").on(table.capacityProviderId, table.hostId, table.role)
2003
- ]);
2004
- const capacityProviderLanes = pgTable("capacity_provider_lanes", {
2005
- id: text("id").primaryKey(),
2006
- capacityProviderId: text("capacity_provider_id").notNull(),
2007
- name: text("name").notNull(),
2008
- businessModel: text("business_model").notNull().default("custom"),
2009
- modelFamily: text("model_family"),
2010
- modelClass: text("model_class"),
2011
- regionPolicy: text("region_policy"),
2012
- unit: text("unit").notNull().default("treeseed_credit"),
2013
- scarcityLevel: text("scarcity_level").notNull().default("medium"),
2014
- hardLimitsJson: text("hard_limits_json").notNull().default("{}"),
2015
- routingPolicyJson: text("routing_policy_json").notNull().default("{}"),
2016
- metadataJson: text("metadata_json").notNull().default("{}"),
2017
- createdAt: text("created_at").notNull(),
2018
- updatedAt: text("updated_at").notNull()
2019
- }, (table) => [
2020
- index("idx_capacity_provider_lanes_provider").on(table.capacityProviderId, table.businessModel, table.scarcityLevel)
2021
- ]);
2022
- const capacityGrants = pgTable("capacity_grants", {
2023
- id: text("id").primaryKey(),
2024
- capacityProviderId: text("capacity_provider_id").notNull(),
2025
- laneId: text("lane_id"),
2026
- grantScope: text("grant_scope").notNull().default("team"),
2027
- teamId: text("team_id").notNull(),
2028
- projectId: text("project_id"),
2029
- environment: text("environment"),
2030
- state: text("state").notNull().default("active"),
2031
- dailyCreditLimit: real("daily_credit_limit"),
2032
- weeklyCreditLimit: real("weekly_credit_limit"),
2033
- monthlyCreditLimit: real("monthly_credit_limit"),
2034
- dailyUsdLimit: real("daily_usd_limit"),
2035
- weeklyQuotaMinutes: real("weekly_quota_minutes"),
2036
- monthlyProviderUnits: real("monthly_provider_units"),
2037
- priorityWeight: real("priority_weight").notNull().default(1),
2038
- overflowPolicy: text("overflow_policy").notNull().default("soft_grant"),
2039
- metadataJson: text("metadata_json").notNull().default("{}"),
2040
- createdAt: text("created_at").notNull(),
2041
- updatedAt: text("updated_at").notNull()
2042
- }, (table) => [
2043
- index("idx_capacity_grants_team_project").on(table.teamId, table.projectId, table.state),
2044
- index("idx_capacity_grants_provider_lane").on(table.capacityProviderId, table.laneId, table.state)
2045
- ]);
2046
- const capacityReservations = pgTable("capacity_reservations", {
2047
- id: text("id").primaryKey(),
2048
- capacityProviderId: text("capacity_provider_id").notNull(),
2049
- executionProviderId: text("execution_provider_id"),
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"),
2055
- teamId: text("team_id").notNull(),
2056
- projectId: text("project_id").notNull(),
2057
- workDayId: text("work_day_id"),
2058
- taskId: text("task_id"),
2059
- state: text("state").notNull().default("reserved"),
2060
- reservedCredits: real("reserved_credits").notNull(),
2061
- consumedCredits: real("consumed_credits").notNull().default(0),
2062
- nativeUnit: text("native_unit"),
2063
- reservedNativeAmount: real("reserved_native_amount"),
2064
- consumedNativeAmount: real("consumed_native_amount"),
2065
- reservedProviderUnits: real("reserved_provider_units"),
2066
- consumedProviderUnits: real("consumed_provider_units"),
2067
- reservedUsd: real("reserved_usd"),
2068
- consumedUsd: real("consumed_usd"),
2069
- expiresAt: text("expires_at"),
2070
- metadataJson: text("metadata_json").notNull().default("{}"),
2071
- createdAt: text("created_at").notNull(),
2072
- updatedAt: text("updated_at").notNull()
2073
- }, (table) => [
2074
- index("idx_capacity_reservations_project_workday_state").on(table.projectId, table.workDayId, table.state, table.createdAt),
2075
- index("idx_capacity_reservations_provider_state").on(table.capacityProviderId, table.laneId, table.state),
2076
- index("idx_capacity_reservations_execution_provider_state").on(table.executionProviderId, table.state, table.createdAt)
2077
- ]);
2078
- const capacityLedgerEntries = pgTable("capacity_ledger_entries", {
2079
- id: text("id").primaryKey(),
2080
- capacityProviderId: text("capacity_provider_id").notNull(),
2081
- laneId: text("lane_id"),
2082
- reservationId: text("reservation_id"),
2083
- assignmentId: text("assignment_id"),
2084
- modeRunId: text("mode_run_id"),
2085
- mode: text("mode"),
2086
- teamId: text("team_id").notNull(),
2087
- projectId: text("project_id"),
2088
- workDayId: text("work_day_id"),
2089
- taskId: text("task_id"),
2090
- phase: text("phase").notNull(),
2091
- credits: real("credits").notNull(),
2092
- providerUnits: real("provider_units"),
2093
- usd: real("usd"),
2094
- source: text("source").notNull(),
2095
- metadataJson: text("metadata_json").notNull().default("{}"),
2096
- createdAt: text("created_at").notNull()
2097
- }, (table) => [
2098
- index("idx_capacity_ledger_project_workday_created").on(table.projectId, table.workDayId, table.createdAt)
2099
- ]);
2100
- const capacityRoutingDecisions = pgTable("capacity_routing_decisions", {
2101
- id: text("id").primaryKey(),
2102
- taskId: text("task_id"),
2103
- workDayId: text("work_day_id"),
2104
- projectId: text("project_id").notNull(),
2105
- selectedProviderId: text("selected_provider_id").notNull(),
2106
- selectedLaneId: text("selected_lane_id").notNull(),
2107
- selectedModel: text("selected_model"),
2108
- decision: text("decision").notNull().default("selected"),
2109
- reason: text("reason").notNull(),
2110
- candidateJson: text("candidate_json").notNull().default("[]"),
2111
- scoreJson: text("score_json").notNull().default("{}"),
2112
- metadataJson: text("metadata_json").notNull().default("{}"),
2113
- createdAt: text("created_at").notNull()
2114
- }, (table) => [
2115
- index("idx_capacity_routing_decisions_project_workday").on(table.projectId, table.workDayId, table.createdAt)
2116
- ]);
2117
- const taskEstimates = pgTable("task_estimates", {
2118
- id: text("id").primaryKey(),
2119
- taskId: text("task_id"),
2120
- workDayId: text("work_day_id"),
2121
- projectId: text("project_id").notNull(),
2122
- estimatePhase: text("estimate_phase").notNull(),
2123
- taskSignature: text("task_signature").notNull(),
2124
- confidence: text("confidence").notNull(),
2125
- estimatedCreditsP50: real("estimated_credits_p50").notNull(),
2126
- estimatedCreditsP90: real("estimated_credits_p90").notNull(),
2127
- reservedCredits: real("reserved_credits").notNull(),
2128
- estimatedInputTokensP50: integer("estimated_input_tokens_p50"),
2129
- estimatedInputTokensP90: integer("estimated_input_tokens_p90"),
2130
- estimatedOutputTokensP50: integer("estimated_output_tokens_p50"),
2131
- estimatedOutputTokensP90: integer("estimated_output_tokens_p90"),
2132
- estimatedQuotaMinutesP50: real("estimated_quota_minutes_p50"),
2133
- estimatedQuotaMinutesP90: real("estimated_quota_minutes_p90"),
2134
- featuresJson: text("features_json").notNull().default("{}"),
2135
- createdAt: text("created_at").notNull(),
2136
- executionProfileId: text("execution_profile_id").notNull().default("standard-code-model")
2137
- }, (table) => [
2138
- index("idx_task_estimates_project_signature").on(table.projectId, table.taskSignature, table.createdAt),
2139
- index("idx_task_estimates_project_signature_profile").on(table.projectId, table.taskSignature, table.executionProfileId, table.createdAt)
2140
- ]);
2141
- const taskUsageActuals = pgTable("task_usage_actuals", {
2142
- id: text("id").primaryKey(),
2143
- taskId: text("task_id"),
2144
- workDayId: text("work_day_id"),
2145
- projectId: text("project_id").notNull(),
2146
- taskSignature: text("task_signature").notNull(),
2147
- assignmentId: text("assignment_id"),
2148
- modeRunId: text("mode_run_id"),
2149
- mode: text("mode"),
2150
- capacityProviderId: text("capacity_provider_id"),
2151
- executionProviderId: text("execution_provider_id"),
2152
- laneId: text("lane_id"),
2153
- businessModel: text("business_model").notNull(),
2154
- modelName: text("model_name"),
2155
- inputTokens: integer("input_tokens"),
2156
- outputTokens: integer("output_tokens"),
2157
- cachedInputTokens: integer("cached_input_tokens"),
2158
- quotaMinutes: real("quota_minutes"),
2159
- wallMinutes: real("wall_minutes"),
2160
- filesOpened: integer("files_opened"),
2161
- filesChanged: integer("files_changed"),
2162
- diffLinesAdded: integer("diff_lines_added"),
2163
- diffLinesRemoved: integer("diff_lines_removed"),
2164
- testRuns: integer("test_runs"),
2165
- retryCount: integer("retry_count"),
2166
- actualCredits: real("actual_credits").notNull(),
2167
- actualUsd: real("actual_usd"),
2168
- creditFormulaVersion: text("credit_formula_version").notNull().default("treeseed.actual-credits.v1"),
2169
- actualCreditSource: text("actual_credit_source").notNull().default("central_calculator"),
2170
- nativeUsageJson: text("native_usage_json").notNull().default("{}"),
2171
- metadataJson: text("metadata_json").notNull().default("{}"),
2172
- createdAt: text("created_at").notNull(),
2173
- executionProfileId: text("execution_profile_id").notNull().default("standard-code-model")
2174
- }, (table) => [
2175
- index("idx_task_usage_actuals_project_signature").on(table.projectId, table.taskSignature, table.createdAt),
2176
- index("idx_task_usage_actuals_project_signature_profile").on(table.projectId, table.taskSignature, table.executionProfileId, table.createdAt),
2177
- index("idx_task_usage_actuals_execution_provider").on(table.executionProviderId, table.createdAt)
2178
- ]);
2179
- const nativeUsageObservations = pgTable("native_usage_observations", {
2180
- id: text("id").primaryKey(),
2181
- taskUsageActualId: text("task_usage_actual_id"),
2182
- taskId: text("task_id"),
2183
- workDayId: text("work_day_id"),
2184
- projectId: text("project_id").notNull(),
2185
- taskSignature: text("task_signature").notNull(),
2186
- executionProfileId: text("execution_profile_id").notNull().default("standard-code-model"),
2187
- capacityProviderId: text("capacity_provider_id"),
2188
- executionProviderId: text("execution_provider_id"),
2189
- nativeUnit: text("native_unit"),
2190
- nativeUsageJson: text("native_usage_json").notNull().default("{}"),
2191
- observedAt: text("observed_at").notNull(),
2192
- source: text("source").notNull().default("provider_report"),
2193
- formulaVersion: text("formula_version").notNull().default("treeseed.actual-credits.v1"),
2194
- actualCredits: real("actual_credits").notNull(),
2195
- metadataJson: text("metadata_json").notNull().default("{}"),
2196
- createdAt: text("created_at").notNull()
2197
- }, (table) => [
2198
- index("idx_native_usage_observations_profile").on(table.projectId, table.taskSignature, table.executionProfileId, table.createdAt),
2199
- index("idx_native_usage_observations_provider").on(table.executionProviderId, table.createdAt)
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
- ]);
2676
- const approvalRequests = pgTable("approval_requests", {
2677
- id: text("id").primaryKey(),
2678
- teamId: text("team_id").notNull(),
2679
- projectId: text("project_id").notNull(),
2680
- workDayId: text("work_day_id"),
2681
- taskId: text("task_id"),
2682
- kind: text("kind").notNull(),
2683
- state: text("state").notNull().default("pending"),
2684
- severity: text("severity").notNull().default("medium"),
2685
- requestedByType: text("requested_by_type").notNull().default("worker"),
2686
- requestedById: text("requested_by_id"),
2687
- title: text("title").notNull(),
2688
- summary: text("summary").notNull(),
2689
- optionsJson: text("options_json").notNull().default("[]"),
2690
- recommendationJson: text("recommendation_json").notNull().default("{}"),
2691
- policySnapshotJson: text("policy_snapshot_json").notNull().default("{}"),
2692
- expiresAt: text("expires_at"),
2693
- decidedByType: text("decided_by_type"),
2694
- decidedById: text("decided_by_id"),
2695
- decidedAt: text("decided_at"),
2696
- decisionJson: text("decision_json"),
2697
- metadataJson: text("metadata_json").notNull().default("{}"),
2698
- createdAt: text("created_at").notNull(),
2699
- updatedAt: text("updated_at").notNull()
2700
- }, (table) => [
2701
- index("idx_approval_requests_team_state").on(table.teamId, table.state, table.createdAt),
2702
- index("idx_approval_requests_project_workday").on(table.projectId, table.workDayId, table.state, table.createdAt)
2703
- ]);
2704
- const workdayRequests = pgTable("workday_requests", {
2705
- id: text("id").primaryKey(),
2706
- projectId: text("project_id").notNull(),
2707
- environment: text("environment").notNull(),
2708
- typeColumn: text("type").notNull(),
2709
- state: text("state").notNull().default("pending"),
2710
- workDayId: text("work_day_id"),
2711
- requestedBy: text("requested_by"),
2712
- reason: text("reason"),
2713
- payloadJson: text("payload_json").notNull(),
2714
- metadataJson: text("metadata_json").notNull(),
2715
- createdAt: text("created_at").notNull(),
2716
- updatedAt: text("updated_at").notNull()
2717
- }, (table) => [
2718
- index("idx_workday_requests_project_environment_state").on(table.projectId, table.environment, table.state, table.createdAt)
2719
- ]);
2720
- const workdayManagerLeases = pgTable("workday_manager_leases", {
2721
- id: text("id").primaryKey(),
2722
- projectId: text("project_id").notNull(),
2723
- environment: text("environment").notNull(),
2724
- workDayId: text("work_day_id"),
2725
- managerId: text("manager_id").notNull(),
2726
- state: text("state").notNull().default("active"),
2727
- heartbeatAt: text("heartbeat_at").notNull(),
2728
- expiresAt: text("expires_at").notNull(),
2729
- metadataJson: text("metadata_json").notNull(),
2730
- createdAt: text("created_at").notNull(),
2731
- updatedAt: text("updated_at").notNull()
2732
- }, (table) => [
2733
- index("idx_workday_manager_leases_active").on(table.projectId, table.environment, table.state, table.heartbeatAt)
2734
- ]);
2735
- const workerRunners = pgTable("worker_runners", {
2736
- id: text("id").primaryKey(),
2737
- projectId: text("project_id").notNull(),
2738
- environment: text("environment").notNull(),
2739
- runnerId: text("runner_id").notNull(),
2740
- runnerServiceName: text("runner_service_name").notNull(),
2741
- volumeIdentity: text("volume_identity").notNull(),
2742
- state: text("state").notNull().default("active"),
2743
- maxLocalWorkers: integer("max_local_workers").notNull().default(4),
2744
- activeLocalWorkers: integer("active_local_workers").notNull().default(0),
2745
- availableCapacity: integer("available_capacity").notNull().default(4),
2746
- lastHeartbeatAt: text("last_heartbeat_at"),
2747
- claimedRepositoryIdsJson: text("claimed_repository_ids_json").notNull(),
2748
- metadataJson: text("metadata_json").notNull(),
2749
- createdAt: text("created_at").notNull(),
2750
- updatedAt: text("updated_at").notNull()
2751
- }, (table) => [
2752
- uniqueIndex("idx_worker_runners_identity").on(table.projectId, table.environment, table.runnerId),
2753
- index("idx_worker_runners_state_capacity").on(table.projectId, table.environment, table.state, table.availableCapacity)
2754
- ]);
2755
- const repositoryClaims = pgTable("repository_claims", {
2756
- id: text("id").primaryKey(),
2757
- projectId: text("project_id").notNull(),
2758
- repositoryId: text("repository_id").notNull(),
2759
- runnerId: text("runner_id").notNull(),
2760
- runnerServiceName: text("runner_service_name").notNull(),
2761
- volumeIdentity: text("volume_identity").notNull(),
2762
- lastSeenCommit: text("last_seen_commit"),
2763
- lastTaskAt: text("last_task_at"),
2764
- claimState: text("claim_state").notNull().default("active"),
2765
- metadataJson: text("metadata_json").notNull(),
2766
- createdAt: text("created_at").notNull(),
2767
- updatedAt: text("updated_at").notNull()
2768
- }, (table) => [
2769
- uniqueIndex("idx_repository_claims_runner_repo").on(table.projectId, table.repositoryId, table.runnerId),
2770
- index("idx_repository_claims_repo_state").on(table.projectId, table.repositoryId, table.claimState, table.updatedAt)
2771
- ]);
2772
- const runnerScaleDecisions = pgTable("runner_scale_decisions", {
2773
- id: text("id").primaryKey(),
2774
- projectId: text("project_id").notNull(),
2775
- environment: text("environment").notNull(),
2776
- workDayId: text("work_day_id"),
2777
- runnerId: text("runner_id"),
2778
- runnerServiceName: text("runner_service_name"),
2779
- action: text("action").notNull(),
2780
- reason: text("reason").notNull(),
2781
- metadataJson: text("metadata_json").notNull(),
2782
- createdAt: text("created_at").notNull()
2783
- }, (table) => [
2784
- index("idx_runner_scale_decisions_project_workday").on(table.projectId, table.environment, table.workDayId, table.createdAt)
2785
- ]);
2786
- const repositoryHosts = pgTable("repository_hosts", {
2787
- id: text("id").primaryKey(),
2788
- teamId: text("team_id"),
2789
- provider: text("provider").notNull(),
2790
- ownership: text("ownership").notNull(),
2791
- name: text("name").notNull(),
2792
- accountLabel: text("account_label"),
2793
- organizationOrOwner: text("organization_or_owner").notNull(),
2794
- defaultVisibility: text("default_visibility").notNull().default("private"),
2795
- softwareRepositoryNameTemplate: text("software_repository_name_template").notNull().default("{hub}-site"),
2796
- contentRepositoryNameTemplate: text("content_repository_name_template").notNull().default("{hub}-content"),
2797
- branchPolicyJson: text("branch_policy_json").notNull().default("{}"),
2798
- workflowPolicyJson: text("workflow_policy_json").notNull().default("{}"),
2799
- encryptedPayloadJson: text("encrypted_payload_json"),
2800
- allowedProjectKindsJson: text("allowed_project_kinds_json").notNull().default('["knowledge_hub"]'),
2801
- metadataJson: text("metadata_json").notNull().default("{}"),
2802
- status: text("status").notNull().default("active"),
2803
- createdById: text("created_by_id"),
2804
- updatedById: text("updated_by_id"),
2805
- createdAt: text("created_at").notNull(),
2806
- updatedAt: text("updated_at").notNull()
2807
- }, (table) => [
2808
- index("idx_repository_hosts_team_provider").on(table.teamId, table.provider, table.status),
2809
- uniqueIndex("idx_repository_hosts_team_provider_name").on(table.teamId, table.provider, table.name),
2810
- uniqueIndex("idx_repository_hosts_platform_provider_name").on(table.provider, table.name)
2811
- ]);
2812
- const hubRepositories = pgTable("hub_repositories", {
2813
- id: text("id").primaryKey(),
2814
- hubId: text("hub_id").notNull(),
2815
- teamId: text("team_id").notNull(),
2816
- role: text("role").notNull(),
2817
- repositoryHostId: text("repository_host_id"),
2818
- provider: text("provider").notNull(),
2819
- owner: text("owner").notNull(),
2820
- name: text("name").notNull(),
2821
- url: text("url"),
2822
- defaultBranch: text("default_branch"),
2823
- currentBranch: text("current_branch"),
2824
- status: text("status").notNull().default("queued"),
2825
- accessPolicyJson: text("access_policy_json").notNull().default("{}"),
2826
- releasePolicyJson: text("release_policy_json").notNull().default("{}"),
2827
- publishPolicyJson: text("publish_policy_json").notNull().default("{}"),
2828
- submodulePath: text("submodule_path"),
2829
- metadataJson: text("metadata_json").notNull().default("{}"),
2830
- createdAt: text("created_at").notNull(),
2831
- updatedAt: text("updated_at").notNull()
2832
- }, (table) => [
2833
- uniqueIndex("idx_hub_repositories_hub_role").on(table.hubId, table.role)
2834
- ]);
2835
- const hubContentSources = pgTable("hub_content_sources", {
2836
- id: text("id").primaryKey(),
2837
- hubId: text("hub_id").notNull().unique(),
2838
- teamId: text("team_id").notNull(),
2839
- contentRepositoryId: text("content_repository_id"),
2840
- productionSource: text("production_source").notNull(),
2841
- overlayPolicy: text("overlay_policy").notNull(),
2842
- r2BucketName: text("r2_bucket_name"),
2843
- r2ManifestKey: text("r2_manifest_key"),
2844
- r2PublicBaseUrl: text("r2_public_base_url"),
2845
- latestPublishId: text("latest_publish_id"),
2846
- latestContentVersion: text("latest_content_version"),
2847
- metadataJson: text("metadata_json").notNull().default("{}"),
2848
- createdAt: text("created_at").notNull(),
2849
- updatedAt: text("updated_at").notNull()
2850
- });
2851
- const treeDxInstances = pgTable("treedx_instances", {
2852
- id: text("id").primaryKey(),
2853
- teamId: text("team_id").notNull(),
2854
- kind: text("kind").notNull(),
2855
- provider: text("provider").notNull(),
2856
- name: text("name").notNull(),
2857
- baseUrl: text("base_url"),
2858
- registryUrl: text("registry_url"),
2859
- publicRead: integer("public_read").notNull().default(0),
2860
- primary: integer("primary").notNull().default(1),
2861
- status: text("status").notNull().default("pending"),
2862
- imageRef: text("image_ref"),
2863
- railwayProjectId: text("railway_project_id"),
2864
- railwayServiceId: text("railway_service_id"),
2865
- railwayEnvironmentId: text("railway_environment_id"),
2866
- volumeMountPath: text("volume_mount_path"),
2867
- metadataJson: text("metadata_json").notNull().default("{}"),
2868
- createdAt: text("created_at").notNull(),
2869
- updatedAt: text("updated_at").notNull()
2870
- }, (table) => [
2871
- index("idx_treedx_instances_team_status").on(table.teamId, table.status)
2872
- ]);
2873
- const treeDxProjectLibraries = pgTable("treedx_project_libraries", {
2874
- id: text("id").primaryKey(),
2875
- teamId: text("team_id").notNull(),
2876
- projectId: text("project_id").notNull(),
2877
- instanceId: text("instance_id").notNull(),
2878
- libraryId: text("library_id").notNull(),
2879
- repositoryId: text("repository_id"),
2880
- contentPath: text("content_path").notNull().default("src/content"),
2881
- contentRepositoryUrl: text("content_repository_url"),
2882
- contentRepositoryDefaultBranch: text("content_repository_default_branch"),
2883
- contentRepositoryRef: text("content_repository_ref"),
2884
- r2BucketName: text("r2_bucket_name"),
2885
- r2ManifestKey: text("r2_manifest_key"),
2886
- topologyJson: text("topology_json").notNull().default("{}"),
2887
- metadataJson: text("metadata_json").notNull().default("{}"),
2888
- createdAt: text("created_at").notNull(),
2889
- updatedAt: text("updated_at").notNull()
2890
- }, (table) => [
2891
- uniqueIndex("idx_treedx_project_libraries_project").on(table.projectId),
2892
- index("idx_treedx_project_libraries_instance").on(table.instanceId)
2893
- ]);
2894
- const treeDxMirrors = pgTable("treedx_mirrors", {
2895
- id: text("id").primaryKey(),
2896
- teamId: text("team_id").notNull(),
2897
- instanceId: text("instance_id").notNull(),
2898
- name: text("name").notNull(),
2899
- direction: text("direction").notNull().default("bidirectional"),
2900
- targetKind: text("target_kind").notNull(),
2901
- targetUrl: text("target_url"),
2902
- status: text("status").notNull().default("pending"),
2903
- instructions: text("instructions"),
2904
- lastSyncAt: text("last_sync_at"),
2905
- lastSyncStatus: text("last_sync_status"),
2906
- lastSyncMetadataJson: text("last_sync_metadata_json").notNull().default("{}"),
2907
- metadataJson: text("metadata_json").notNull().default("{}"),
2908
- createdAt: text("created_at").notNull(),
2909
- updatedAt: text("updated_at").notNull()
2910
- }, (table) => [
2911
- index("idx_treedx_mirrors_team_instance").on(table.teamId, table.instanceId)
2912
- ]);
2913
- const treeDxShares = pgTable("treedx_shares", {
2914
- id: text("id").primaryKey(),
2915
- teamId: text("team_id").notNull(),
2916
- instanceId: text("instance_id"),
2917
- projectId: text("project_id"),
2918
- libraryId: text("library_id"),
2919
- scope: text("scope").notNull(),
2920
- targetTeamId: text("target_team_id"),
2921
- trustGrantJson: text("trust_grant_json").notNull().default("{}"),
2922
- publicRead: integer("public_read").notNull().default(0),
2923
- status: text("status").notNull().default("active"),
2924
- expiresAt: text("expires_at"),
2925
- metadataJson: text("metadata_json").notNull().default("{}"),
2926
- createdAt: text("created_at").notNull(),
2927
- updatedAt: text("updated_at").notNull(),
2928
- revokedAt: text("revoked_at")
2929
- }, (table) => [
2930
- index("idx_treedx_shares_team_scope").on(table.teamId, table.scope, table.status)
2931
- ]);
2932
- const treeDxDeployments = pgTable("treedx_deployments", {
2933
- id: text("id").primaryKey(),
2934
- teamId: text("team_id").notNull(),
2935
- instanceId: text("instance_id"),
2936
- provider: text("provider").notNull(),
2937
- status: text("status").notNull().default("queued"),
2938
- imageRef: text("image_ref"),
2939
- volumeMountPath: text("volume_mount_path"),
2940
- serviceRefsJson: text("service_refs_json").notNull().default("{}"),
2941
- resultJson: text("result_json").notNull().default("{}"),
2942
- errorJson: text("error_json"),
2943
- createdAt: text("created_at").notNull(),
2944
- updatedAt: text("updated_at").notNull(),
2945
- completedAt: text("completed_at")
2946
- }, (table) => [
2947
- index("idx_treedx_deployments_team_instance").on(table.teamId, table.instanceId, table.createdAt)
2948
- ]);
2949
- const hubLaunches = pgTable("hub_launches", {
2950
- id: text("id").primaryKey(),
2951
- hubId: text("hub_id").notNull(),
2952
- teamId: text("team_id").notNull(),
2953
- jobId: text("job_id"),
2954
- intentJson: text("intent_json").notNull(),
2955
- planJson: text("plan_json").notNull().default("{}"),
2956
- state: text("state").notNull(),
2957
- currentPhase: text("current_phase"),
2958
- lastSuccessfulPhase: text("last_successful_phase"),
2959
- resultJson: text("result_json"),
2960
- errorJson: text("error_json"),
2961
- createdAt: text("created_at").notNull(),
2962
- updatedAt: text("updated_at").notNull(),
2963
- completedAt: text("completed_at")
2964
- }, (table) => [
2965
- index("idx_hub_launches_hub_created").on(table.hubId, table.createdAt)
2966
- ]);
2967
- const hubLaunchEvents = pgTable("hub_launch_events", {
2968
- id: text("id").primaryKey(),
2969
- launchId: text("launch_id").notNull(),
2970
- seq: integer("seq").notNull(),
2971
- phase: text("phase").notNull(),
2972
- status: text("status").notNull(),
2973
- title: text("title"),
2974
- summary: text("summary"),
2975
- startedAt: text("started_at"),
2976
- finishedAt: text("finished_at"),
2977
- errorJson: text("error_json"),
2978
- dataJson: text("data_json").notNull().default("{}"),
2979
- createdAt: text("created_at").notNull()
2980
- }, (table) => [
2981
- uniqueIndex("idx_hub_launch_events_launch_seq").on(table.launchId, table.seq)
2982
- ]);
2983
- const hubWorkspaceLinks = pgTable("hub_workspace_links", {
2984
- id: text("id").primaryKey(),
2985
- hubId: text("hub_id").notNull(),
2986
- teamId: text("team_id").notNull(),
2987
- parentRepositoryHostId: text("parent_repository_host_id"),
2988
- parentOwner: text("parent_owner"),
2989
- parentName: text("parent_name"),
2990
- parentUrl: text("parent_url"),
2991
- parentBranch: text("parent_branch"),
2992
- hubMountPath: text("hub_mount_path"),
2993
- softwareSubmodulePath: text("software_submodule_path"),
2994
- contentSubmodulePath: text("content_submodule_path"),
2995
- updateSubmodulePointersEnabled: integer("update_submodule_pointers_enabled").notNull().default(0),
2996
- accessPolicyJson: text("access_policy_json").notNull().default("{}"),
2997
- metadataJson: text("metadata_json").notNull().default("{}"),
2998
- createdAt: text("created_at").notNull(),
2999
- updatedAt: text("updated_at").notNull()
3000
- }, (table) => [
3001
- index("idx_hub_workspace_links_hub").on(table.hubId)
3002
- ]);
3003
- const projectUpdatePlans = pgTable("project_update_plans", {
3004
- id: text("id").primaryKey(),
3005
- hubId: text("hub_id").notNull(),
3006
- teamId: text("team_id").notNull(),
3007
- sourceKind: text("source_kind").notNull(),
3008
- sourceRef: text("source_ref"),
3009
- sourceVersion: text("source_version"),
3010
- planJson: text("plan_json").notNull().default("{}"),
3011
- state: text("state").notNull().default("planned"),
3012
- requiresDecision: integer("requires_decision").notNull().default(0),
3013
- decisionId: text("decision_id"),
3014
- createdBy: text("created_by"),
3015
- createdAt: text("created_at").notNull(),
3016
- updatedAt: text("updated_at").notNull()
3017
- }, (table) => [
3018
- index("idx_project_update_plans_hub").on(table.hubId, table.createdAt)
3019
- ]);
3020
- const providerCredentialSessions = pgTable("provider_credential_sessions", {
3021
- id: text("id").primaryKey(),
3022
- teamId: text("team_id").notNull(),
3023
- projectId: text("project_id"),
3024
- jobId: text("job_id"),
3025
- hostKind: text("host_kind").notNull(),
3026
- hostId: text("host_id").notNull(),
3027
- purpose: text("purpose").notNull(),
3028
- encryptedPayloadJson: text("encrypted_payload_json").notNull(),
3029
- status: text("status").notNull().default("active"),
3030
- expiresAt: text("expires_at").notNull(),
3031
- consumedAt: text("consumed_at"),
3032
- createdById: text("created_by_id"),
3033
- createdAt: text("created_at").notNull(),
3034
- updatedAt: text("updated_at").notNull(),
3035
- metadataJson: text("metadata_json").notNull().default("{}")
3036
- }, (table) => [
3037
- index("idx_provider_credential_sessions_team_host").on(table.teamId, table.hostKind, table.hostId, table.status),
3038
- index("idx_provider_credential_sessions_job").on(table.jobId, table.status)
3039
- ]);
3040
- const capacityProviderApiKeys = pgTable("capacity_provider_api_keys", {
3041
- id: text("id").primaryKey(),
3042
- capacityProviderId: text("capacity_provider_id").notNull(),
3043
- teamId: text("team_id").notNull(),
3044
- name: text("name").notNull(),
3045
- keyPrefix: text("key_prefix").notNull(),
3046
- keyHash: text("key_hash").notNull(),
3047
- scopesJson: text("scopes_json").notNull().default("[]"),
3048
- status: text("status").notNull().default("active"),
3049
- lastUsedAt: text("last_used_at"),
3050
- rotatedFromKeyId: text("rotated_from_key_id"),
3051
- expiresAt: text("expires_at"),
3052
- revokedAt: text("revoked_at"),
3053
- createdById: text("created_by_id"),
3054
- createdAt: text("created_at").notNull(),
3055
- updatedAt: text("updated_at").notNull()
3056
- }, (table) => [
3057
- index("idx_capacity_provider_api_keys_provider_status").on(table.capacityProviderId, table.status, table.createdAt),
3058
- index("idx_capacity_provider_api_keys_prefix").on(table.keyPrefix)
3059
- ]);
3060
- const userPreferences = pgTable("user_preferences", {
3061
- userId: text("user_id").primaryKey(),
3062
- colorScheme: text("color_scheme").notNull().default("fern"),
3063
- themeMode: text("theme_mode").notNull().default("system"),
3064
- createdAt: text("created_at").notNull(),
3065
- updatedAt: text("updated_at").notNull()
3066
- });
3067
- const taskEstimateProfiles = pgTable("task_estimate_profiles", {
3068
- taskSignature: text("task_signature"),
3069
- executionProfileId: text("execution_profile_id").default("standard-code-model"),
3070
- sampleCount: integer("sample_count").notNull().default(0),
3071
- completedSampleCount: integer("completed_sample_count").notNull().default(0),
3072
- interruptedSampleCount: integer("interrupted_sample_count").notNull().default(0),
3073
- inputTokensP50: integer("input_tokens_p50"),
3074
- inputTokensP90: integer("input_tokens_p90"),
3075
- outputTokensP50: integer("output_tokens_p50"),
3076
- outputTokensP90: integer("output_tokens_p90"),
3077
- quotaMinutesP50: real("quota_minutes_p50"),
3078
- quotaMinutesP90: real("quota_minutes_p90"),
3079
- filesChangedP50: real("files_changed_p50"),
3080
- filesChangedP90: real("files_changed_p90"),
3081
- creditsP50: real("credits_p50"),
3082
- creditsP90: real("credits_p90"),
3083
- creditsVariance: real("credits_variance"),
3084
- confidenceScore: real("confidence_score"),
3085
- outlierCount: integer("outlier_count").notNull().default(0),
3086
- partialCredits: real("partial_credits"),
3087
- firstSampleAt: text("first_sample_at"),
3088
- lastSampleAt: text("last_sample_at"),
3089
- updatedAt: text("updated_at").notNull()
3090
- }, (table) => [
3091
- primaryKey({ columns: [table.taskSignature, table.executionProfileId] })
3092
- ]);
3093
- const creditConversionProfiles = pgTable("credit_conversion_profiles", {
3094
- id: text("id").primaryKey(),
3095
- taskSignature: text("task_signature").notNull(),
3096
- executionProfileId: text("execution_profile_id").notNull().default("standard-code-model"),
3097
- executionProviderKind: text("execution_provider_kind").notNull(),
3098
- nativeUnit: text("native_unit").notNull(),
3099
- sampleCount: integer("sample_count").notNull().default(0),
3100
- completedSampleCount: integer("completed_sample_count").notNull().default(0),
3101
- interruptedSampleCount: integer("interrupted_sample_count").notNull().default(0),
3102
- nativeUnitsPerCreditP50: real("native_units_per_credit_p50"),
3103
- nativeUnitsPerCreditP90: real("native_units_per_credit_p90"),
3104
- creditsPerNativeUnitP50: real("credits_per_native_unit_p50"),
3105
- creditsPerNativeUnitP90: real("credits_per_native_unit_p90"),
3106
- actualCreditsP50: real("actual_credits_p50"),
3107
- actualCreditsP90: real("actual_credits_p90"),
3108
- confidence: text("confidence").notNull().default("low"),
3109
- formulaVersion: text("formula_version").notNull(),
3110
- metadataJson: text("metadata_json").notNull().default("{}"),
3111
- createdAt: text("created_at").notNull(),
3112
- updatedAt: text("updated_at").notNull()
3113
- }, (table) => [
3114
- uniqueIndex("idx_credit_conversion_profiles_profile_key").on(table.taskSignature, table.executionProfileId, table.executionProviderKind, table.nativeUnit),
3115
- index("idx_credit_conversion_profiles_kind_unit").on(table.executionProviderKind, table.nativeUnit, table.updatedAt)
3116
- ]);
3117
- const seedRuns = pgTable("seed_runs", {
3118
- id: text("id").primaryKey(),
3119
- seedName: text("seed_name").notNull(),
3120
- seedVersion: integer("seed_version").notNull(),
3121
- environmentsJson: text("environments_json").notNull(),
3122
- mode: text("mode").notNull(),
3123
- state: text("state").notNull(),
3124
- actorType: text("actor_type"),
3125
- actorId: text("actor_id"),
3126
- manifestHash: text("manifest_hash").notNull(),
3127
- planJson: text("plan_json").notNull(),
3128
- resultJson: text("result_json"),
3129
- errorJson: text("error_json"),
3130
- createdAt: text("created_at").notNull(),
3131
- updatedAt: text("updated_at").notNull(),
3132
- completedAt: text("completed_at")
3133
- }, (table) => [
3134
- index("idx_seed_runs_seed_created").on(table.seedName, table.createdAt),
3135
- index("idx_seed_runs_state_created").on(table.state, table.createdAt)
3136
- ]);
3137
- const runtimeRecords = pgTable("runtime_records", {
3138
- id: serial("id").primaryKey(),
3139
- recordType: text("record_type").notNull(),
3140
- recordKey: text("record_key").notNull(),
3141
- lookupKey: text("lookup_key"),
3142
- secondaryKey: text("secondary_key"),
3143
- status: text("status").notNull(),
3144
- schemaVersion: integer("schema_version").notNull().default(1),
3145
- createdAt: text("created_at").notNull(),
3146
- updatedAt: text("updated_at").notNull(),
3147
- payloadJson: text("payload_json").notNull(),
3148
- metaJson: text("meta_json").notNull()
3149
- }, (table) => [
3150
- index("idx_runtime_records_type_lookup_updated").on(table.recordType, table.lookupKey, table.updatedAt),
3151
- index("idx_runtime_records_type_status_updated").on(table.recordType, table.status, table.updatedAt)
3152
- ]);
3153
- const cursorState = pgTable("cursor_state", {
3154
- agentSlug: text("agent_slug"),
3155
- cursorKey: text("cursor_key"),
3156
- status: text("status").notNull(),
3157
- schemaVersion: integer("schema_version").notNull().default(1),
3158
- updatedAt: text("updated_at").notNull(),
3159
- payloadJson: text("payload_json").notNull(),
3160
- metaJson: text("meta_json").notNull()
3161
- }, (table) => [
3162
- primaryKey({ columns: [table.agentSlug, table.cursorKey] }),
3163
- index("idx_cursor_state_updated").on(table.updatedAt)
3164
- ]);
3165
- const leaseState = pgTable("lease_state", {
3166
- model: text("model"),
3167
- itemKey: text("item_key"),
3168
- status: text("status").notNull(),
3169
- schemaVersion: integer("schema_version").notNull().default(1),
3170
- claimedBy: text("claimed_by"),
3171
- claimedAt: text("claimed_at"),
3172
- leaseExpiresAt: text("lease_expires_at"),
3173
- createdAt: text("created_at").notNull(),
3174
- updatedAt: text("updated_at").notNull(),
3175
- payloadJson: text("payload_json").notNull(),
3176
- metaJson: text("meta_json").notNull()
3177
- }, (table) => [
3178
- primaryKey({ columns: [table.model, table.itemKey] }),
3179
- index("idx_lease_state_status_expires").on(table.status, table.leaseExpiresAt),
3180
- index("idx_lease_state_claimed_by").on(table.claimedBy, table.updatedAt)
3181
- ]);
3182
- const messageQueue = pgTable("message_queue", {
3183
- id: serial("id").primaryKey(),
3184
- messageType: text("message_type").notNull(),
3185
- status: text("status").notNull(),
3186
- schemaVersion: integer("schema_version").notNull().default(1),
3187
- relatedModel: text("related_model"),
3188
- relatedId: text("related_id"),
3189
- priority: integer("priority").notNull().default(0),
3190
- availableAt: text("available_at").notNull(),
3191
- claimedBy: text("claimed_by"),
3192
- claimedAt: text("claimed_at"),
3193
- leaseExpiresAt: text("lease_expires_at"),
3194
- attempts: integer("attempts").notNull().default(0),
3195
- maxAttempts: integer("max_attempts").notNull().default(3),
3196
- createdAt: text("created_at").notNull(),
3197
- updatedAt: text("updated_at").notNull(),
3198
- payloadJson: text("payload_json").notNull(),
3199
- metaJson: text("meta_json").notNull()
3200
- }, (table) => [
3201
- index("idx_message_queue_claimable").on(table.status, table.availableAt, table.priority),
3202
- index("idx_message_queue_related").on(table.relatedModel, table.relatedId, table.createdAt)
3203
- ]);
3204
- const capacityProviderRegistrations = pgTable("capacity_provider_registrations", {
3205
- id: text("id").primaryKey(),
3206
- capacityProviderId: text("capacity_provider_id").notNull(),
3207
- teamId: text("team_id").notNull(),
3208
- runtimeVersion: text("runtime_version").notNull(),
3209
- marketId: text("market_id").notNull(),
3210
- capabilitiesJson: text("capabilities_json").notNull().default("[]"),
3211
- budgetsJson: text("budgets_json").notNull().default("{}"),
3212
- healthJson: text("health_json").notNull().default("{}"),
3213
- status: text("status").notNull().default("online"),
3214
- registeredAt: text("registered_at").notNull(),
3215
- lastSeenAt: text("last_seen_at").notNull(),
3216
- disconnectedAt: text("disconnected_at"),
3217
- createdAt: text("created_at").notNull(),
3218
- updatedAt: text("updated_at").notNull()
3219
- }, (table) => [
3220
- index("idx_capacity_provider_registrations_provider_seen").on(table.capacityProviderId, table.lastSeenAt)
3221
- ]);
3222
- const capacityProviderDeployments = pgTable("capacity_provider_deployments", {
3223
- id: text("id").primaryKey(),
3224
- teamId: text("team_id").notNull(),
3225
- capacityProviderId: text("capacity_provider_id").notNull(),
3226
- launchMode: text("launch_mode").notNull(),
3227
- hostKind: text("host_kind").notNull(),
3228
- hostId: text("host_id"),
3229
- status: text("status").notNull(),
3230
- imageRef: text("image_ref"),
3231
- serviceRefsJson: text("service_refs_json").notNull().default("{}"),
3232
- envRefsJson: text("env_refs_json").notNull().default("{}"),
3233
- resultJson: text("result_json").notNull().default("{}"),
3234
- errorJson: text("error_json"),
3235
- createdById: text("created_by_id"),
3236
- createdAt: text("created_at").notNull(),
3237
- updatedAt: text("updated_at").notNull(),
3238
- completedAt: text("completed_at")
3239
- }, (table) => [
3240
- index("idx_capacity_provider_deployments_provider_created").on(table.capacityProviderId, table.createdAt)
3241
- ]);
3242
- const platformOperations = pgTable("platform_operations", {
3243
- id: text("id").primaryKey(),
3244
- namespace: text("namespace").notNull(),
3245
- operation: text("operation").notNull(),
3246
- status: text("status").notNull(),
3247
- target: text("target").notNull(),
3248
- idempotencyKey: text("idempotency_key"),
3249
- inputJson: text("input_json").notNull().default("{}"),
3250
- outputJson: text("output_json"),
3251
- errorJson: text("error_json"),
3252
- requestedByType: text("requested_by_type").notNull(),
3253
- requestedById: text("requested_by_id"),
3254
- assignedRunnerId: text("assigned_runner_id"),
3255
- leaseExpiresAt: text("lease_expires_at"),
3256
- createdAt: text("created_at").notNull(),
3257
- updatedAt: text("updated_at").notNull(),
3258
- startedAt: text("started_at"),
3259
- finishedAt: text("finished_at"),
3260
- cancelledAt: text("cancelled_at")
3261
- }, (table) => [
3262
- uniqueIndex("idx_platform_operations_idempotency").on(table.namespace, table.operation, table.idempotencyKey),
3263
- index("idx_platform_operations_runnable").on(table.status, table.createdAt)
3264
- ]);
3265
- const platformOperationEvents = pgTable("platform_operation_events", {
3266
- id: text("id").primaryKey(),
3267
- operationId: text("operation_id").notNull(),
3268
- seq: integer("seq").notNull(),
3269
- kind: text("kind").notNull(),
3270
- dataJson: text("data_json").notNull().default("{}"),
3271
- createdAt: text("created_at").notNull()
3272
- }, (table) => [
3273
- uniqueIndex("idx_platform_operation_events_seq").on(table.operationId, table.seq)
3274
- ]);
3275
- const marketOperationRunners = pgTable("market_operation_runners", {
3276
- id: text("id").primaryKey(),
3277
- runnerKey: text("runner_key").notNull().unique(),
3278
- name: text("name").notNull(),
3279
- environment: text("environment").notNull(),
3280
- status: text("status").notNull().default("online"),
3281
- version: text("version"),
3282
- capabilitiesJson: text("capabilities_json").notNull().default("[]"),
3283
- activeJobCount: integer("active_job_count").notNull().default(0),
3284
- maxConcurrentJobs: integer("max_concurrent_jobs").notNull().default(1),
3285
- heartbeatAt: text("heartbeat_at"),
3286
- metadataJson: text("metadata_json").notNull().default("{}"),
3287
- createdAt: text("created_at").notNull(),
3288
- updatedAt: text("updated_at").notNull()
3289
- });
3290
- const platformRepositoryClaims = pgTable("platform_repository_claims", {
3291
- id: text("id").primaryKey(),
3292
- repositoryKey: text("repository_key").notNull(),
3293
- runnerId: text("runner_id").notNull(),
3294
- workspacePath: text("workspace_path").notNull(),
3295
- branch: text("branch"),
3296
- commitSha: text("commit_sha"),
3297
- claimState: text("claim_state").notNull().default("active"),
3298
- leaseExpiresAt: text("lease_expires_at"),
3299
- metadataJson: text("metadata_json").notNull().default("{}"),
3300
- createdAt: text("created_at").notNull(),
3301
- updatedAt: text("updated_at").notNull()
3302
- }, (table) => [
3303
- uniqueIndex("idx_platform_repository_claims_active").on(table.repositoryKey, table.runnerId),
3304
- index("idx_platform_repository_claims_runner").on(table.runnerId, table.claimState)
3305
- ]);
3306
- const executionProviders = pgTable("execution_providers", {
3307
- id: text("id").primaryKey(),
3308
- teamId: text("team_id").notNull(),
3309
- capacityProviderId: text("capacity_provider_id"),
3310
- name: text("name").notNull(),
3311
- kind: text("kind").notNull(),
3312
- status: text("status").notNull().default("active"),
3313
- nativeUnit: text("native_unit").notNull(),
3314
- quotaVisibility: text("quota_visibility").notNull().default("opaque"),
3315
- maxConcurrentWorkers: integer("max_concurrent_workers").notNull().default(1),
3316
- resetCadence: text("reset_cadence"),
3317
- configJson: text("config_json").notNull().default("{}"),
3318
- metadataJson: text("metadata_json").notNull().default("{}"),
3319
- createdAt: text("created_at").notNull(),
3320
- updatedAt: text("updated_at").notNull()
3321
- }, (table) => [
3322
- index("idx_execution_providers_team_status").on(table.teamId, table.status, table.kind),
3323
- index("idx_execution_providers_capacity_provider").on(table.capacityProviderId, table.status)
3324
- ]);
3325
- const executionProviderNativeLimits = pgTable("execution_provider_native_limits", {
3326
- id: text("id").primaryKey(),
3327
- executionProviderId: text("execution_provider_id").notNull(),
3328
- scope: text("scope").notNull(),
3329
- nativeUnit: text("native_unit").notNull(),
3330
- limitAmount: real("limit_amount").notNull(),
3331
- reserveBufferPercent: real("reserve_buffer_percent").notNull().default(0),
3332
- resetCadence: text("reset_cadence"),
3333
- resetAt: text("reset_at"),
3334
- confidence: text("confidence").notNull().default("estimated"),
3335
- source: text("source").notNull().default("configured"),
3336
- metadataJson: text("metadata_json").notNull().default("{}"),
3337
- createdAt: text("created_at").notNull(),
3338
- updatedAt: text("updated_at").notNull()
3339
- }, (table) => [
3340
- index("idx_execution_provider_native_limits_provider_scope").on(table.executionProviderId, table.scope, table.nativeUnit)
3341
- ]);
3342
- const executionProviderObservations = pgTable("execution_provider_observations", {
3343
- id: text("id").primaryKey(),
3344
- executionProviderId: text("execution_provider_id").notNull(),
3345
- observedAt: text("observed_at").notNull(),
3346
- health: text("health").notNull().default("unknown"),
3347
- activeWorkers: integer("active_workers"),
3348
- queuedTasks: integer("queued_tasks"),
3349
- throttleState: text("throttle_state"),
3350
- nativeRemainingJson: text("native_remaining_json").notNull().default("{}"),
3351
- resetAt: text("reset_at"),
3352
- confidence: text("confidence").notNull().default("estimated"),
3353
- metadataJson: text("metadata_json").notNull().default("{}"),
3354
- createdAt: text("created_at").notNull()
3355
- }, (table) => [
3356
- index("idx_execution_provider_observations_provider_observed").on(table.executionProviderId, table.observedAt)
3357
- ]);
3358
- const marketAuthCredentials = pgTable("market_auth_credentials", {
3359
- userId: text("user_id").primaryKey(),
3360
- email: text("email").notNull().unique(),
3361
- username: text("username").unique(),
3362
- passwordHash: text("password_hash").notNull(),
3363
- status: text("status").notNull().default("active"),
3364
- createdAt: text("created_at").notNull(),
3365
- updatedAt: text("updated_at").notNull()
3366
- });
3367
- const marketAuthPasswordResets = pgTable("market_auth_password_resets", {
3368
- id: text("id").primaryKey(),
3369
- userId: text("user_id").notNull(),
3370
- tokenHash: text("token_hash").notNull().unique(),
3371
- expiresAt: text("expires_at").notNull(),
3372
- usedAt: text("used_at"),
3373
- createdAt: text("created_at").notNull()
3374
- });
3375
- const treeseedMarketSchema = {
3376
- subscribers,
3377
- agentRuns,
3378
- agentMessages,
3379
- contactSubmissions,
3380
- runtimeEnvelopes,
3381
- workDays,
3382
- graphRuns,
3383
- reports,
3384
- users,
3385
- userIdentities,
3386
- userEmailAddresses,
3387
- roles,
3388
- permissions,
3389
- rolePermissions,
3390
- userRoleBindings,
3391
- apiTokens,
3392
- serviceCredentials,
3393
- authSessions,
3394
- auditEvents,
3395
- deviceCodes,
3396
- teams,
3397
- teamMemberships,
3398
- teamRoleBindings,
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,
3419
- projects,
3420
- projectConnections,
3421
- projectCapabilityGrants,
3422
- teamApiKeys,
3423
- entitlements,
3424
- remoteJobs,
3425
- remoteJobEvents,
3426
- knowledgePacks,
3427
- teamStorageLocators,
3428
- catalogItems,
3429
- catalogArtifactVersions,
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,
3460
- projectHosting,
3461
- projectEnvironments,
3462
- projectInfrastructureResources,
3463
- projectDeployments,
3464
- projectDeploymentEvents,
3465
- agentPools,
3466
- agentPoolRegistrations,
3467
- agentPoolScaleDecisions,
3468
- projectWorkdaySummaries,
3469
- workPolicies,
3470
- priorityOverrides,
3471
- prioritySnapshots,
3472
- taskCreditLedger,
3473
- scaleDecisions,
3474
- projectSummarySnapshots,
3475
- teamInboxItems,
3476
- betterAuthUser,
3477
- betterAuthSession,
3478
- betterAuthAccount,
3479
- betterAuthVerification,
3480
- teamWebHosts,
3481
- teamInvites,
3482
- capacityProviders,
3483
- capacityProviderHosts,
3484
- capacityProviderLanes,
3485
- capacityGrants,
3486
- capacityReservations,
3487
- capacityLedgerEntries,
3488
- capacityRoutingDecisions,
3489
- taskEstimates,
3490
- taskUsageActuals,
3491
- nativeUsageObservations,
3492
- approvalRequests,
3493
- workdayRequests,
3494
- workdayManagerLeases,
3495
- workerRunners,
3496
- repositoryClaims,
3497
- runnerScaleDecisions,
3498
- repositoryHosts,
3499
- hubRepositories,
3500
- hubContentSources,
3501
- treeDxInstances,
3502
- treeDxProjectLibraries,
3503
- treeDxMirrors,
3504
- treeDxShares,
3505
- treeDxDeployments,
3506
- secretMetadataRecords,
3507
- clientEncryptedEscrowRecords,
3508
- githubRepositoryGrants,
3509
- workflowOperationRecords,
3510
- workflowDispatchRecords,
3511
- treeDxCredentialIssuanceRecords,
3512
- hubLaunches,
3513
- hubLaunchEvents,
3514
- hubWorkspaceLinks,
3515
- projectUpdatePlans,
3516
- providerCredentialSessions,
3517
- capacityProviderApiKeys,
3518
- userPreferences,
3519
- taskEstimateProfiles,
3520
- creditConversionProfiles,
3521
- seedRuns,
3522
- runtimeRecords,
3523
- cursorState,
3524
- leaseState,
3525
- messageQueue,
3526
- capacityProviderRegistrations,
3527
- capacityProviderDeployments,
3528
- capacityAllocationSets,
3529
- projectAgentClasses,
3530
- providerAvailabilitySessions,
3531
- providerAssignments,
3532
- agentModeRuns,
3533
- platformOperations,
3534
- platformOperationEvents,
3535
- marketOperationRunners,
3536
- platformRepositoryClaims,
3537
- executionProviders,
3538
- executionProviderNativeLimits,
3539
- executionProviderObservations,
3540
- marketAuthCredentials,
3541
- marketAuthPasswordResets
3542
- };
3543
- export {
3544
- agentCapacityPlans,
3545
- agentMessages,
3546
- agentModeRuns,
3547
- agentPoolRegistrations,
3548
- agentPoolScaleDecisions,
3549
- agentPools,
3550
- agentRuns,
3551
- apiTokens,
3552
- approvalRequests,
3553
- auditEvents,
3554
- authSessions,
3555
- betterAuthAccount,
3556
- betterAuthSession,
3557
- betterAuthUser,
3558
- betterAuthVerification,
3559
- capacityAllocationSets,
3560
- capacityGrants,
3561
- capacityLedgerEntries,
3562
- capacityProviderApiKeys,
3563
- capacityProviderDeployments,
3564
- capacityProviderHosts,
3565
- capacityProviderLanes,
3566
- capacityProviderRegistrations,
3567
- capacityProviders,
3568
- capacityReservations,
3569
- capacityRoutingDecisions,
3570
- catalogArtifactVersions,
3571
- catalogItemCollaborators,
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,
3614
- contactSubmissions,
3615
- creditConversionProfiles,
3616
- cursorState,
3617
- decisionExecutionInputs,
3618
- decisionPlanningStatuses,
3619
- deviceCodes,
3620
- entitlements,
3621
- executionProviderNativeLimits,
3622
- executionProviderObservations,
3623
- executionProviders,
3624
- githubAppInstallationRecords,
3625
- githubAppTokenIssuanceRecords,
3626
- githubRepositoryGrants,
3627
- governanceDecisions,
3628
- governanceDelegations,
3629
- governanceElectorateSnapshots,
3630
- governanceEvents,
3631
- governanceProposalVersions,
3632
- governanceProposalVotes,
3633
- governanceProposals,
3634
- governanceVoteEvents,
3635
- graphRuns,
3636
- hubContentSources,
3637
- hubLaunchEvents,
3638
- hubLaunches,
3639
- hubRepositories,
3640
- hubWorkspaceLinks,
3641
- knowledgePacks,
3642
- leaseState,
3643
- marketAuthCredentials,
3644
- marketAuthPasswordResets,
3645
- marketOperationRunners,
3646
- messageQueue,
3647
- nativeUsageObservations,
3648
- permissions,
3649
- planningInputRequests,
3650
- platformOperationEvents,
3651
- platformOperations,
3652
- platformRepositoryClaims,
3653
- priorityOverrides,
3654
- prioritySnapshots,
3655
- projectAgentClasses,
3656
- projectCapabilityGrants,
3657
- projectConnections,
3658
- projectDeploymentEvents,
3659
- projectDeployments,
3660
- projectEnvironments,
3661
- projectGovernancePolicies,
3662
- projectHosting,
3663
- projectInfrastructureResources,
3664
- projectSummarySnapshots,
3665
- projectUpdatePlans,
3666
- projectWorkdaySummaries,
3667
- projects,
3668
- providerAssignments,
3669
- providerAvailabilitySessions,
3670
- providerCredentialSessions,
3671
- remoteJobEvents,
3672
- remoteJobs,
3673
- reports,
3674
- repositoryClaims,
3675
- repositoryHosts,
3676
- rolePermissions,
3677
- roles,
3678
- runnerScaleDecisions,
3679
- runtimeEnvelopes,
3680
- runtimeRecords,
3681
- runtimeTaskEvents,
3682
- runtimeTaskOutputs,
3683
- runtimeTasks,
3684
- scaleDecisions,
3685
- secretMetadataRecords,
3686
- seedRuns,
3687
- serviceCredentials,
3688
- subscribers,
3689
- taskCreditLedger,
3690
- taskEstimateProfiles,
3691
- taskEstimates,
3692
- taskUsageActuals,
3693
- teamApiKeys,
3694
- teamGovernancePolicies,
3695
- teamInboxItems,
3696
- teamInvites,
3697
- teamMemberships,
3698
- teamRoleBindings,
3699
- teamStorageLocators,
3700
- teamWebHosts,
3701
- teams,
3702
- treeDxCredentialIssuanceRecords,
3703
- treeDxDeployments,
3704
- treeDxInstances,
3705
- treeDxMirrors,
3706
- treeDxProjectLibraries,
3707
- treeDxProjectProxyAudit,
3708
- treeDxProxyHandles,
3709
- treeDxShares,
3710
- treeseedMarketSchema,
3711
- userEmailAddresses,
3712
- userIdentities,
3713
- userPreferences,
3714
- userRoleBindings,
3715
- users,
3716
- webSessions,
3717
- workDays,
3718
- workPolicies,
3719
- workdayCapacityEnvelopes,
3720
- workdayManagerLeases,
3721
- workdayRequests,
3722
- workerRunners,
3723
- workflowDispatchRecords,
3724
- workflowOperationRecords
3725
- };