@plumbus/core 0.7.1 → 0.8.0-beta.1

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 (513) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/README.md +2 -1
  3. package/dist/.tsbuildinfo +1 -1
  4. package/dist/admission/client.d.ts +9 -0
  5. package/dist/admission/client.d.ts.map +1 -0
  6. package/dist/admission/client.js +34 -0
  7. package/dist/admission/client.js.map +1 -0
  8. package/dist/admission/index.d.ts +5 -0
  9. package/dist/admission/index.d.ts.map +1 -0
  10. package/dist/admission/index.js +4 -0
  11. package/dist/admission/index.js.map +1 -0
  12. package/dist/admission/request-admission.d.ts +26 -0
  13. package/dist/admission/request-admission.d.ts.map +1 -0
  14. package/dist/admission/request-admission.js +85 -0
  15. package/dist/admission/request-admission.js.map +1 -0
  16. package/dist/admission/shared.d.ts +31 -0
  17. package/dist/admission/shared.d.ts.map +1 -0
  18. package/dist/admission/shared.js +30 -0
  19. package/dist/admission/shared.js.map +1 -0
  20. package/dist/ai/ai/provider.d.ts +5 -7
  21. package/dist/ai/ai-service.d.ts +8 -1
  22. package/dist/ai/ai-service.d.ts.map +1 -1
  23. package/dist/ai/ai-service.js +23 -13
  24. package/dist/ai/ai-service.js.map +1 -1
  25. package/dist/ai/errors/data-errors.d.ts +6 -0
  26. package/dist/ai/errors/index.d.ts +4 -1
  27. package/dist/ai/fill-prompt-template.d.ts +12 -0
  28. package/dist/ai/fill-prompt-template.d.ts.map +1 -0
  29. package/dist/ai/fill-prompt-template.js +19 -0
  30. package/dist/ai/fill-prompt-template.js.map +1 -0
  31. package/dist/ai/governed-artifacts.d.ts +49 -0
  32. package/dist/ai/governed-artifacts.d.ts.map +1 -0
  33. package/dist/ai/governed-artifacts.js +277 -0
  34. package/dist/ai/governed-artifacts.js.map +1 -0
  35. package/dist/ai/governed-budget.d.ts +17 -0
  36. package/dist/ai/governed-budget.d.ts.map +1 -0
  37. package/dist/ai/governed-budget.js +52 -0
  38. package/dist/ai/governed-budget.js.map +1 -0
  39. package/dist/ai/governed-host.d.ts +54 -0
  40. package/dist/ai/governed-host.d.ts.map +1 -0
  41. package/dist/ai/governed-host.js +8 -0
  42. package/dist/ai/governed-host.js.map +1 -0
  43. package/dist/ai/governed-invoke.d.ts +41 -0
  44. package/dist/ai/governed-invoke.d.ts.map +1 -0
  45. package/dist/ai/governed-invoke.js +102 -0
  46. package/dist/ai/governed-invoke.js.map +1 -0
  47. package/dist/ai/governed-runtime.d.ts +103 -0
  48. package/dist/ai/governed-runtime.d.ts.map +1 -0
  49. package/dist/ai/governed-runtime.js +151 -0
  50. package/dist/ai/governed-runtime.js.map +1 -0
  51. package/dist/ai/index.d.ts +12 -2
  52. package/dist/ai/index.d.ts.map +1 -1
  53. package/dist/ai/index.js +8 -2
  54. package/dist/ai/index.js.map +1 -1
  55. package/dist/ai/prompt-registry.d.ts +6 -0
  56. package/dist/ai/prompt-registry.d.ts.map +1 -1
  57. package/dist/ai/prompt-registry.js +12 -0
  58. package/dist/ai/prompt-registry.js.map +1 -1
  59. package/dist/ai/provider.d.ts +5 -7
  60. package/dist/ai/provider.d.ts.map +1 -1
  61. package/dist/ai/provider.js +29 -0
  62. package/dist/ai/provider.js.map +1 -1
  63. package/dist/ai/types/enums.d.ts +2 -0
  64. package/dist/ai/types/fields.d.ts +7 -0
  65. package/dist/ai/types/prompt.d.ts +8 -0
  66. package/dist/ai/validation.d.ts.map +1 -1
  67. package/dist/ai/validation.js +10 -1
  68. package/dist/ai/validation.js.map +1 -1
  69. package/dist/api/exposure.d.ts +14 -0
  70. package/dist/api/exposure.d.ts.map +1 -1
  71. package/dist/api/exposure.js +16 -0
  72. package/dist/api/exposure.js.map +1 -1
  73. package/dist/api/idempotency.d.ts +67 -0
  74. package/dist/api/idempotency.d.ts.map +1 -0
  75. package/dist/api/idempotency.js +176 -0
  76. package/dist/api/idempotency.js.map +1 -0
  77. package/dist/api/index.d.ts +3 -1
  78. package/dist/api/index.d.ts.map +1 -1
  79. package/dist/api/index.js +4 -2
  80. package/dist/api/index.js.map +1 -1
  81. package/dist/api/route-generator.d.ts +50 -6
  82. package/dist/api/route-generator.d.ts.map +1 -1
  83. package/dist/api/route-generator.js +254 -12
  84. package/dist/api/route-generator.js.map +1 -1
  85. package/dist/approvals/action-risk.d.ts +41 -0
  86. package/dist/approvals/action-risk.d.ts.map +1 -0
  87. package/dist/approvals/action-risk.js +56 -0
  88. package/dist/approvals/action-risk.js.map +1 -0
  89. package/dist/approvals/actors.d.ts +8 -0
  90. package/dist/approvals/actors.d.ts.map +1 -0
  91. package/dist/approvals/actors.js +26 -0
  92. package/dist/approvals/actors.js.map +1 -0
  93. package/dist/approvals/authorization.d.ts +5 -0
  94. package/dist/approvals/authorization.d.ts.map +1 -0
  95. package/dist/approvals/authorization.js +16 -0
  96. package/dist/approvals/authorization.js.map +1 -0
  97. package/dist/approvals/digest.d.ts +3 -0
  98. package/dist/approvals/digest.d.ts.map +1 -0
  99. package/dist/approvals/digest.js +21 -0
  100. package/dist/approvals/digest.js.map +1 -0
  101. package/dist/approvals/gate.d.ts +15 -0
  102. package/dist/approvals/gate.d.ts.map +1 -0
  103. package/dist/approvals/gate.js +102 -0
  104. package/dist/approvals/gate.js.map +1 -0
  105. package/dist/approvals/host-runtime.d.ts +16 -0
  106. package/dist/approvals/host-runtime.d.ts.map +1 -0
  107. package/dist/approvals/host-runtime.js +12 -0
  108. package/dist/approvals/host-runtime.js.map +1 -0
  109. package/dist/approvals/index.d.ts +19 -0
  110. package/dist/approvals/index.d.ts.map +1 -0
  111. package/dist/approvals/index.js +13 -0
  112. package/dist/approvals/index.js.map +1 -0
  113. package/dist/approvals/memory-store.d.ts +3 -0
  114. package/dist/approvals/memory-store.d.ts.map +1 -0
  115. package/dist/approvals/memory-store.js +33 -0
  116. package/dist/approvals/memory-store.js.map +1 -0
  117. package/dist/approvals/schema.d.ts +484 -0
  118. package/dist/approvals/schema.d.ts.map +1 -0
  119. package/dist/approvals/schema.js +55 -0
  120. package/dist/approvals/schema.js.map +1 -0
  121. package/dist/approvals/service.d.ts +17 -0
  122. package/dist/approvals/service.d.ts.map +1 -0
  123. package/dist/approvals/service.js +240 -0
  124. package/dist/approvals/service.js.map +1 -0
  125. package/dist/approvals/sql-store.d.ts +9 -0
  126. package/dist/approvals/sql-store.d.ts.map +1 -0
  127. package/dist/approvals/sql-store.js +179 -0
  128. package/dist/approvals/sql-store.js.map +1 -0
  129. package/dist/approvals/types.d.ts +156 -0
  130. package/dist/approvals/types.d.ts.map +1 -0
  131. package/dist/approvals/types.js +32 -0
  132. package/dist/approvals/types.js.map +1 -0
  133. package/dist/approvals/wait.d.ts +10 -0
  134. package/dist/approvals/wait.d.ts.map +1 -0
  135. package/dist/approvals/wait.js +11 -0
  136. package/dist/approvals/wait.js.map +1 -0
  137. package/dist/audit/service.d.ts.map +1 -1
  138. package/dist/audit/service.js +6 -1
  139. package/dist/audit/service.js.map +1 -1
  140. package/dist/cli/cli.d.ts.map +1 -1
  141. package/dist/cli/cli.js +2 -1
  142. package/dist/cli/cli.js.map +1 -1
  143. package/dist/cli/commands/api.d.ts +65 -0
  144. package/dist/cli/commands/api.d.ts.map +1 -1
  145. package/dist/cli/commands/api.js +79 -4
  146. package/dist/cli/commands/api.js.map +1 -1
  147. package/dist/cli/commands/compile-flows.d.ts +9 -0
  148. package/dist/cli/commands/compile-flows.d.ts.map +1 -0
  149. package/dist/cli/commands/compile-flows.js +55 -0
  150. package/dist/cli/commands/compile-flows.js.map +1 -0
  151. package/dist/cli/commands/dev.d.ts +6 -0
  152. package/dist/cli/commands/dev.d.ts.map +1 -1
  153. package/dist/cli/commands/dev.js +22 -5
  154. package/dist/cli/commands/dev.js.map +1 -1
  155. package/dist/cli/commands/e2e.d.ts +5 -0
  156. package/dist/cli/commands/e2e.d.ts.map +1 -1
  157. package/dist/cli/commands/e2e.js +42 -3
  158. package/dist/cli/commands/e2e.js.map +1 -1
  159. package/dist/cli/commands/flow.d.ts.map +1 -1
  160. package/dist/cli/commands/flow.js +12 -3
  161. package/dist/cli/commands/flow.js.map +1 -1
  162. package/dist/cli/commands/generate-openapi-from-zod.d.ts +26 -0
  163. package/dist/cli/commands/generate-openapi-from-zod.d.ts.map +1 -0
  164. package/dist/cli/commands/generate-openapi-from-zod.js +189 -0
  165. package/dist/cli/commands/generate-openapi-from-zod.js.map +1 -0
  166. package/dist/cli/commands/generate.d.ts +10 -4
  167. package/dist/cli/commands/generate.d.ts.map +1 -1
  168. package/dist/cli/commands/generate.js +27 -70
  169. package/dist/cli/commands/generate.js.map +1 -1
  170. package/dist/cli/commands/index.d.ts +1 -0
  171. package/dist/cli/commands/index.d.ts.map +1 -1
  172. package/dist/cli/commands/index.js +2 -0
  173. package/dist/cli/commands/index.js.map +1 -1
  174. package/dist/cli/commands/mcp.d.ts +5 -0
  175. package/dist/cli/commands/mcp.d.ts.map +1 -1
  176. package/dist/cli/commands/mcp.js +28 -2
  177. package/dist/cli/commands/mcp.js.map +1 -1
  178. package/dist/cli/commands/migrate.d.ts +1 -0
  179. package/dist/cli/commands/migrate.d.ts.map +1 -1
  180. package/dist/cli/commands/migrate.js +145 -34
  181. package/dist/cli/commands/migrate.js.map +1 -1
  182. package/dist/cli/commands/openapi-3-1.d.ts +34 -0
  183. package/dist/cli/commands/openapi-3-1.d.ts.map +1 -0
  184. package/dist/cli/commands/openapi-3-1.js +333 -0
  185. package/dist/cli/commands/openapi-3-1.js.map +1 -0
  186. package/dist/cli/commands/start.d.ts +5 -0
  187. package/dist/cli/commands/start.d.ts.map +1 -1
  188. package/dist/cli/commands/start.js +20 -2
  189. package/dist/cli/commands/start.js.map +1 -1
  190. package/dist/cli/commands/ui.d.ts +11 -0
  191. package/dist/cli/commands/ui.d.ts.map +1 -1
  192. package/dist/cli/commands/ui.js +105 -20
  193. package/dist/cli/commands/ui.js.map +1 -1
  194. package/dist/cli/commands/verify.d.ts.map +1 -1
  195. package/dist/cli/commands/verify.js +2 -0
  196. package/dist/cli/commands/verify.js.map +1 -1
  197. package/dist/cli/commands/worker.d.ts +5 -0
  198. package/dist/cli/commands/worker.d.ts.map +1 -1
  199. package/dist/cli/commands/worker.js +18 -2
  200. package/dist/cli/commands/worker.js.map +1 -1
  201. package/dist/cli/index.d.ts +1 -1
  202. package/dist/cli/index.d.ts.map +1 -1
  203. package/dist/cli/index.js +1 -1
  204. package/dist/cli/index.js.map +1 -1
  205. package/dist/credentials/catalog.d.ts +71 -0
  206. package/dist/credentials/catalog.d.ts.map +1 -0
  207. package/dist/credentials/catalog.js +293 -0
  208. package/dist/credentials/catalog.js.map +1 -0
  209. package/dist/credentials/index.d.ts +3 -0
  210. package/dist/credentials/index.d.ts.map +1 -0
  211. package/dist/credentials/index.js +2 -0
  212. package/dist/credentials/index.js.map +1 -0
  213. package/dist/data/drift-inspector.d.ts +1 -4
  214. package/dist/data/drift-inspector.d.ts.map +1 -1
  215. package/dist/data/drift-inspector.js +39 -5
  216. package/dist/data/drift-inspector.js.map +1 -1
  217. package/dist/data/field-encryption.d.ts +7 -0
  218. package/dist/data/field-encryption.d.ts.map +1 -1
  219. package/dist/data/field-encryption.js +35 -17
  220. package/dist/data/field-encryption.js.map +1 -1
  221. package/dist/data/framework-migration-rewriter.js +1 -1
  222. package/dist/data/framework-migration-rewriter.js.map +1 -1
  223. package/dist/data/index.d.ts +1 -1
  224. package/dist/data/index.d.ts.map +1 -1
  225. package/dist/data/index.js +1 -1
  226. package/dist/data/index.js.map +1 -1
  227. package/dist/data/mask-fields.d.ts +2 -0
  228. package/dist/data/mask-fields.d.ts.map +1 -1
  229. package/dist/data/mask-fields.js +6 -0
  230. package/dist/data/mask-fields.js.map +1 -1
  231. package/dist/data/migration.d.ts.map +1 -1
  232. package/dist/data/migration.js +25 -1
  233. package/dist/data/migration.js.map +1 -1
  234. package/dist/data/repository.d.ts.map +1 -1
  235. package/dist/data/repository.js +15 -3
  236. package/dist/data/repository.js.map +1 -1
  237. package/dist/data/schema-generator.d.ts +95 -3
  238. package/dist/data/schema-generator.d.ts.map +1 -1
  239. package/dist/data/schema-generator.js +122 -6
  240. package/dist/data/schema-generator.js.map +1 -1
  241. package/dist/define/defineCapability.d.ts +7 -0
  242. package/dist/define/defineCapability.d.ts.map +1 -1
  243. package/dist/define/defineCapability.js +15 -0
  244. package/dist/define/defineCapability.js.map +1 -1
  245. package/dist/define/defineFlow.d.ts +3 -1
  246. package/dist/define/defineFlow.d.ts.map +1 -1
  247. package/dist/define/defineFlow.js.map +1 -1
  248. package/dist/durable/apply-ddl.d.ts +13 -0
  249. package/dist/durable/apply-ddl.d.ts.map +1 -0
  250. package/dist/durable/apply-ddl.js +278 -0
  251. package/dist/durable/apply-ddl.js.map +1 -0
  252. package/dist/durable/harness.d.ts +31 -0
  253. package/dist/durable/harness.d.ts.map +1 -0
  254. package/dist/durable/harness.js +136 -0
  255. package/dist/durable/harness.js.map +1 -0
  256. package/dist/durable/index.d.ts +18 -0
  257. package/dist/durable/index.d.ts.map +1 -0
  258. package/dist/durable/index.js +16 -0
  259. package/dist/durable/index.js.map +1 -0
  260. package/dist/durable/memory-store.d.ts +48 -0
  261. package/dist/durable/memory-store.d.ts.map +1 -0
  262. package/dist/durable/memory-store.js +260 -0
  263. package/dist/durable/memory-store.js.map +1 -0
  264. package/dist/durable/migrations-path.d.ts +5 -0
  265. package/dist/durable/migrations-path.d.ts.map +1 -0
  266. package/dist/durable/migrations-path.js +8 -0
  267. package/dist/durable/migrations-path.js.map +1 -0
  268. package/dist/durable/opaque-dispatch.d.ts +7 -0
  269. package/dist/durable/opaque-dispatch.d.ts.map +1 -0
  270. package/dist/durable/opaque-dispatch.js +67 -0
  271. package/dist/durable/opaque-dispatch.js.map +1 -0
  272. package/dist/durable/persist-before-ack.d.ts +52 -0
  273. package/dist/durable/persist-before-ack.d.ts.map +1 -0
  274. package/dist/durable/persist-before-ack.js +153 -0
  275. package/dist/durable/persist-before-ack.js.map +1 -0
  276. package/dist/durable/pg-env.d.ts +9 -0
  277. package/dist/durable/pg-env.d.ts.map +1 -0
  278. package/dist/durable/pg-env.js +20 -0
  279. package/dist/durable/pg-env.js.map +1 -0
  280. package/dist/durable/postgres-persist.d.ts +33 -0
  281. package/dist/durable/postgres-persist.d.ts.map +1 -0
  282. package/dist/durable/postgres-persist.js +239 -0
  283. package/dist/durable/postgres-persist.js.map +1 -0
  284. package/dist/durable/reconciliation.d.ts +20 -0
  285. package/dist/durable/reconciliation.d.ts.map +1 -0
  286. package/dist/durable/reconciliation.js +91 -0
  287. package/dist/durable/reconciliation.js.map +1 -0
  288. package/dist/durable/schema.d.ts +1448 -0
  289. package/dist/durable/schema.d.ts.map +1 -0
  290. package/dist/durable/schema.js +138 -0
  291. package/dist/durable/schema.js.map +1 -0
  292. package/dist/durable/spine-claim.d.ts +16 -0
  293. package/dist/durable/spine-claim.d.ts.map +1 -0
  294. package/dist/durable/spine-claim.js +131 -0
  295. package/dist/durable/spine-claim.js.map +1 -0
  296. package/dist/durable/types.d.ts +153 -0
  297. package/dist/durable/types.d.ts.map +1 -0
  298. package/dist/durable/types.js +114 -0
  299. package/dist/durable/types.js.map +1 -0
  300. package/dist/errors/data-errors.d.ts +6 -0
  301. package/dist/errors/data-errors.d.ts.map +1 -1
  302. package/dist/errors/data-errors.js +9 -0
  303. package/dist/errors/data-errors.js.map +1 -1
  304. package/dist/errors/http.d.ts.map +1 -1
  305. package/dist/errors/http.js +9 -1
  306. package/dist/errors/http.js.map +1 -1
  307. package/dist/errors/index.d.ts +4 -1
  308. package/dist/errors/index.d.ts.map +1 -1
  309. package/dist/errors/index.js +11 -1
  310. package/dist/errors/index.js.map +1 -1
  311. package/dist/errors-entry.d.ts +1 -1
  312. package/dist/errors-entry.d.ts.map +1 -1
  313. package/dist/errors-entry.js +1 -1
  314. package/dist/errors-entry.js.map +1 -1
  315. package/dist/events/consumer-registry.d.ts +6 -0
  316. package/dist/events/consumer-registry.d.ts.map +1 -1
  317. package/dist/events/consumer-registry.js.map +1 -1
  318. package/dist/events/dispatcher.d.ts +19 -0
  319. package/dist/events/dispatcher.d.ts.map +1 -1
  320. package/dist/events/dispatcher.js +161 -114
  321. package/dist/events/dispatcher.js.map +1 -1
  322. package/dist/events/idempotency.d.ts +3 -2
  323. package/dist/events/idempotency.d.ts.map +1 -1
  324. package/dist/events/idempotency.js +3 -2
  325. package/dist/events/idempotency.js.map +1 -1
  326. package/dist/events/index.d.ts +2 -0
  327. package/dist/events/index.d.ts.map +1 -1
  328. package/dist/events/index.js +1 -0
  329. package/dist/events/index.js.map +1 -1
  330. package/dist/events/subscription.d.ts +29 -0
  331. package/dist/events/subscription.d.ts.map +1 -0
  332. package/dist/events/subscription.js +19 -0
  333. package/dist/events/subscription.js.map +1 -0
  334. package/dist/events/worker.d.ts +8 -1
  335. package/dist/events/worker.d.ts.map +1 -1
  336. package/dist/events/worker.js +32 -5
  337. package/dist/events/worker.js.map +1 -1
  338. package/dist/execution/capability-executor.d.ts +6 -3
  339. package/dist/execution/capability-executor.d.ts.map +1 -1
  340. package/dist/execution/capability-executor.js +34 -6
  341. package/dist/execution/capability-executor.js.map +1 -1
  342. package/dist/execution/context-deps.d.ts +2 -0
  343. package/dist/execution/context-deps.d.ts.map +1 -1
  344. package/dist/execution/context-deps.js +2 -1
  345. package/dist/execution/context-deps.js.map +1 -1
  346. package/dist/execution/context-factory.d.ts +38 -1
  347. package/dist/execution/context-factory.d.ts.map +1 -1
  348. package/dist/execution/context-factory.js +102 -4
  349. package/dist/execution/context-factory.js.map +1 -1
  350. package/dist/execution/index.d.ts +2 -2
  351. package/dist/execution/index.d.ts.map +1 -1
  352. package/dist/execution/index.js +1 -1
  353. package/dist/execution/index.js.map +1 -1
  354. package/dist/execution/transactional-outbox.d.ts +10 -0
  355. package/dist/execution/transactional-outbox.d.ts.map +1 -1
  356. package/dist/execution/transactional-outbox.js +41 -2
  357. package/dist/execution/transactional-outbox.js.map +1 -1
  358. package/dist/flows/budget.d.ts +44 -0
  359. package/dist/flows/budget.d.ts.map +1 -0
  360. package/dist/flows/budget.js +81 -0
  361. package/dist/flows/budget.js.map +1 -0
  362. package/dist/flows/compile-flow.d.ts +23 -0
  363. package/dist/flows/compile-flow.d.ts.map +1 -0
  364. package/dist/flows/compile-flow.js +176 -0
  365. package/dist/flows/compile-flow.js.map +1 -0
  366. package/dist/flows/compiled-registry.d.ts +43 -0
  367. package/dist/flows/compiled-registry.d.ts.map +1 -0
  368. package/dist/flows/compiled-registry.js +198 -0
  369. package/dist/flows/compiled-registry.js.map +1 -0
  370. package/dist/flows/dead-letter.d.ts +16 -0
  371. package/dist/flows/dead-letter.d.ts.map +1 -1
  372. package/dist/flows/dead-letter.js +67 -0
  373. package/dist/flows/dead-letter.js.map +1 -1
  374. package/dist/flows/definition-strategy.d.ts +13 -0
  375. package/dist/flows/definition-strategy.d.ts.map +1 -0
  376. package/dist/flows/definition-strategy.js +30 -0
  377. package/dist/flows/definition-strategy.js.map +1 -0
  378. package/dist/flows/engine.d.ts +38 -1
  379. package/dist/flows/engine.d.ts.map +1 -1
  380. package/dist/flows/engine.js +375 -32
  381. package/dist/flows/engine.js.map +1 -1
  382. package/dist/flows/index.d.ts +12 -4
  383. package/dist/flows/index.d.ts.map +1 -1
  384. package/dist/flows/index.js +7 -2
  385. package/dist/flows/index.js.map +1 -1
  386. package/dist/flows/scheduler.d.ts +26 -0
  387. package/dist/flows/scheduler.d.ts.map +1 -1
  388. package/dist/flows/scheduler.js +157 -37
  389. package/dist/flows/scheduler.js.map +1 -1
  390. package/dist/flows/schema.d.ts +34 -0
  391. package/dist/flows/schema.d.ts.map +1 -1
  392. package/dist/flows/schema.js +4 -0
  393. package/dist/flows/schema.js.map +1 -1
  394. package/dist/flows/step-executor.d.ts +3 -0
  395. package/dist/flows/step-executor.d.ts.map +1 -1
  396. package/dist/flows/step-executor.js +33 -0
  397. package/dist/flows/step-executor.js.map +1 -1
  398. package/dist/governance/capability-source-scan.d.ts.map +1 -1
  399. package/dist/governance/capability-source-scan.js +2 -29
  400. package/dist/governance/capability-source-scan.js.map +1 -1
  401. package/dist/governance/forbidden-path-scan.d.ts +7 -0
  402. package/dist/governance/forbidden-path-scan.d.ts.map +1 -0
  403. package/dist/governance/forbidden-path-scan.js +60 -0
  404. package/dist/governance/forbidden-path-scan.js.map +1 -0
  405. package/dist/governance/index.d.ts +2 -0
  406. package/dist/governance/index.d.ts.map +1 -1
  407. package/dist/governance/index.js +2 -0
  408. package/dist/governance/index.js.map +1 -1
  409. package/dist/governance/source-walk.d.ts +3 -0
  410. package/dist/governance/source-walk.d.ts.map +1 -0
  411. package/dist/governance/source-walk.js +33 -0
  412. package/dist/governance/source-walk.js.map +1 -0
  413. package/dist/index.d.ts +21 -12
  414. package/dist/index.d.ts.map +1 -1
  415. package/dist/index.js +22 -9
  416. package/dist/index.js.map +1 -1
  417. package/dist/runtime/bootstrap.d.ts +3 -1
  418. package/dist/runtime/bootstrap.d.ts.map +1 -1
  419. package/dist/runtime/load-extensions.d.ts.map +1 -1
  420. package/dist/runtime/load-extensions.js +11 -0
  421. package/dist/runtime/load-extensions.js.map +1 -1
  422. package/dist/runtime/register-consumers.d.ts +3 -0
  423. package/dist/runtime/register-consumers.d.ts.map +1 -1
  424. package/dist/runtime/register-consumers.js +4 -0
  425. package/dist/runtime/register-consumers.js.map +1 -1
  426. package/dist/runtime/start-worker-pool.d.ts.map +1 -1
  427. package/dist/runtime/start-worker-pool.js +1 -0
  428. package/dist/runtime/start-worker-pool.js.map +1 -1
  429. package/dist/runtime-entry.d.ts +4 -0
  430. package/dist/runtime-entry.d.ts.map +1 -0
  431. package/dist/runtime-entry.js +30 -0
  432. package/dist/runtime-entry.js.map +1 -0
  433. package/dist/server/bootstrap.d.ts +116 -8
  434. package/dist/server/bootstrap.d.ts.map +1 -1
  435. package/dist/server/bootstrap.js +139 -62
  436. package/dist/server/bootstrap.js.map +1 -1
  437. package/dist/tenancy/data-plane-connection.d.ts +108 -0
  438. package/dist/tenancy/data-plane-connection.d.ts.map +1 -0
  439. package/dist/tenancy/data-plane-connection.js +320 -0
  440. package/dist/tenancy/data-plane-connection.js.map +1 -0
  441. package/dist/tenancy/data-plane-migrate.d.ts +30 -0
  442. package/dist/tenancy/data-plane-migrate.d.ts.map +1 -0
  443. package/dist/tenancy/data-plane-migrate.js +44 -0
  444. package/dist/tenancy/data-plane-migrate.js.map +1 -0
  445. package/dist/tenancy/data-plane-provisioning.d.ts +135 -0
  446. package/dist/tenancy/data-plane-provisioning.d.ts.map +1 -0
  447. package/dist/tenancy/data-plane-provisioning.js +639 -0
  448. package/dist/tenancy/data-plane-provisioning.js.map +1 -0
  449. package/dist/tenancy/data-plane-resolver.d.ts +37 -0
  450. package/dist/tenancy/data-plane-resolver.d.ts.map +1 -0
  451. package/dist/tenancy/data-plane-resolver.js +302 -0
  452. package/dist/tenancy/data-plane-resolver.js.map +1 -0
  453. package/dist/tenancy/index.d.ts +9 -0
  454. package/dist/tenancy/index.d.ts.map +1 -0
  455. package/dist/tenancy/index.js +22 -0
  456. package/dist/tenancy/index.js.map +1 -0
  457. package/dist/tenancy/types.d.ts +117 -0
  458. package/dist/tenancy/types.d.ts.map +1 -0
  459. package/dist/tenancy/types.js +8 -0
  460. package/dist/tenancy/types.js.map +1 -0
  461. package/dist/testing/context.d.ts.map +1 -1
  462. package/dist/testing/context.js +6 -1
  463. package/dist/testing/context.js.map +1 -1
  464. package/dist/testing/crash-matrix-simulation.d.ts +51 -0
  465. package/dist/testing/crash-matrix-simulation.d.ts.map +1 -0
  466. package/dist/testing/crash-matrix-simulation.js +350 -0
  467. package/dist/testing/crash-matrix-simulation.js.map +1 -0
  468. package/dist/testing/scaffolding.d.ts.map +1 -1
  469. package/dist/testing/scaffolding.js +4 -1
  470. package/dist/testing/scaffolding.js.map +1 -1
  471. package/dist/types/capability.d.ts +16 -0
  472. package/dist/types/capability.d.ts.map +1 -1
  473. package/dist/types/capability.js.map +1 -1
  474. package/dist/types/context.d.ts +62 -0
  475. package/dist/types/context.d.ts.map +1 -1
  476. package/dist/types/enums.d.ts +2 -0
  477. package/dist/types/enums.d.ts.map +1 -1
  478. package/dist/types/enums.js +2 -0
  479. package/dist/types/enums.js.map +1 -1
  480. package/dist/types/fields.d.ts +7 -0
  481. package/dist/types/fields.d.ts.map +1 -1
  482. package/dist/types/flow.d.ts +96 -1
  483. package/dist/types/flow.d.ts.map +1 -1
  484. package/dist/types/flow.js +7 -1
  485. package/dist/types/flow.js.map +1 -1
  486. package/dist/types/index.d.ts +9 -6
  487. package/dist/types/index.d.ts.map +1 -1
  488. package/dist/types/index.js +5 -1
  489. package/dist/types/index.js.map +1 -1
  490. package/dist/types/prompt.d.ts +8 -0
  491. package/dist/types/prompt.d.ts.map +1 -1
  492. package/dist/types/prompt.js +7 -0
  493. package/dist/types/prompt.js.map +1 -1
  494. package/dist/worker/bootstrap.d.ts +100 -1
  495. package/dist/worker/bootstrap.d.ts.map +1 -1
  496. package/dist/worker/bootstrap.js +155 -14
  497. package/dist/worker/bootstrap.js.map +1 -1
  498. package/instructions/api.md +21 -0
  499. package/instructions/cli.md +15 -9
  500. package/instructions/deployment.md +27 -25
  501. package/instructions/flows.md +8 -1
  502. package/instructions/framework.md +2 -1
  503. package/instructions/mcp.md +1 -1
  504. package/instructions/peer-dependencies.md +16 -14
  505. package/instructions/prompts.md +3 -0
  506. package/instructions/security.md +4 -0
  507. package/instructions/testing.md +2 -2
  508. package/migrations/durable-tenant/0000_durable_tenant.sql +92 -0
  509. package/migrations/durable-tenant/0001_human_task.sql +45 -0
  510. package/migrations/durable-tenant/meta/_journal.json +20 -0
  511. package/migrations/spine/0000_opaque_dispatch.sql +26 -0
  512. package/migrations/spine/meta/_journal.json +13 -0
  513. package/package.json +26 -8
@@ -8,15 +8,15 @@ Plumbus applications deploy as up to four services — a **backend** (Fastify AP
8
8
  +-----------+ +-----------+ +-----------+
9
9
  | frontend | | admin | | backend |
10
10
  | Next.js | | Next.js | | Fastify |
11
- | :3001 |---->| :3002 |---->| :3000 |
11
+ | $FRONTEND |---->| $ADMIN |---->| $API_PORT |
12
12
  +-----------+ +-----------+ +-----+-----+
13
13
  |
14
14
  +---------------------------+---------------------------+
15
15
  | | |
16
16
  +-----v-----+ +-----v-----+ +-----v-----+
17
17
  | worker | | PG | | Redis |
18
- | (optional)| | :5432 | | :6379 |
19
- | :3001 | +-----------+ +-----------+
18
+ | (optional)| | | | |
19
+ | $HEALTH | +-----------+ +-----------+
20
20
  +-----------+
21
21
  ```
22
22
 
@@ -70,7 +70,7 @@ These rules are critical. Violating any one causes build failures or bloated ima
70
70
  - **DO**: Create a separate `proddeps` stage that removes `@plumbus/ui` from `package.json` before `npm install --omit=dev`.
71
71
  - **DO NOT**: Copy the full `node_modules` (including `@plumbus/ui`) into the backend runner.
72
72
  - **Why**: `@plumbus/ui` pulls in `next`, `react`, `react-dom`, `tailwindcss`, `lucide-react` (~300 MB). The backend only needs `@plumbus/core` at runtime.
73
- - **Peer deps**: npm enforces `peerDependencies` strictly in this stage. Add-on packages must declare npm-safe `@plumbus/core` peers (`0.7.x` for the new release family). See `peer-dependencies.md` in this folder — `pnpm install` passing locally does not prove Docker will build.
73
+ - **Peer deps**: npm enforces `peerDependencies` strictly in this stage. Add-on packages must declare npm-safe `@plumbus/core` peers (`0.8.x` for the new release family). See `peer-dependencies.md` in this folder — `pnpm install` passing locally does not prove Docker will build.
74
74
  - **Target image size**: Backend should be ~500-700 MB, not 1.5 GB+.
75
75
 
76
76
  ### Rule 8: Use `ENV PATH` instead of `npx` for frontend builds
@@ -81,7 +81,7 @@ These rules are critical. Violating any one causes build failures or bloated ima
81
81
 
82
82
  ### Rule 9: Never run migrations in the entrypoint
83
83
 
84
- - **DO**: Run `npx plumbus migrate apply` as a separate CI/CD step or one-off job.
84
+ - **DO**: Run `npx plumbus migrate apply` as a separate CI/CD step or one-off job. Database-per-tenant hosts apply once per named database (`--database` or `applyDataPlaneMigrations`) as the owner role.
85
85
  - **DO NOT**: Put migration commands in `entrypoint.sh` or Docker init containers.
86
86
  - **Why**: In multi-replica deployments, concurrent migrations corrupt data.
87
87
 
@@ -143,7 +143,7 @@ Use `plumbus start` for production:
143
143
  | Cookies | `secure: false` | `secure: true` |
144
144
 
145
145
  ```bash
146
- npx plumbus start --port 3000
146
+ npx plumbus start --port $PLUMBUS_START_PORT
147
147
  ```
148
148
 
149
149
  ### Runtime File Requirements
@@ -165,7 +165,7 @@ These directories **must be present** in the production image:
165
165
  # entrypoint.sh — only starts the server. No migrations here.
166
166
  #!/bin/sh
167
167
  set -e
168
- exec npx plumbus start --port 3000
168
+ exec npx plumbus start --port $PLUMBUS_START_PORT
169
169
  ```
170
170
 
171
171
  Migrations run separately:
@@ -173,6 +173,8 @@ Migrations run separately:
173
173
  ```sh
174
174
  # Run BEFORE deploying new containers (CI/CD step or one-off job):
175
175
  npx plumbus migrate apply
176
+ # Per tenant data plane (owner credentials in env):
177
+ # npx plumbus migrate apply --database tenant_alpha
176
178
  ```
177
179
 
178
180
  ### Health Endpoints
@@ -190,10 +192,10 @@ For production deployments that scale API and background work independently:
190
192
 
191
193
  ```bash
192
194
  # API container — no worker pool
193
- PLUMBUS_RUNTIME_ROLE=api npx plumbus start --port 3000
195
+ PLUMBUS_RUNTIME_ROLE=api npx plumbus start --port $PLUMBUS_START_PORT
194
196
 
195
197
  # Worker container — no public API routes
196
- npx plumbus worker start --health-port 3001
198
+ npx plumbus worker start --health-port $PLUMBUS_WORKER_HEALTH_PORT
197
199
  ```
198
200
 
199
201
  **Redis is required** when API and worker run as separate replicas. Set `QUEUE_URL` or `REDIS_URL` on both containers.
@@ -221,8 +223,8 @@ Full monorepo checklists: `docs/upgrading-workers.md` and `docs/upgrading-capabi
221
223
 
222
224
  | Container | Command | Probes | Notes |
223
225
  |-----------|---------|--------|-------|
224
- | API | `plumbus start` | `GET /health`, `GET /ready` on port 3000 | Set `PLUMBUS_RUNTIME_ROLE=api` |
225
- | Worker | `plumbus worker start` | `GET /health`, `GET /ready` on `--health-port` (default 3001) | Exposes `/metrics` for Prometheus |
226
+ | API | `plumbus start --port $PLUMBUS_START_PORT` | `GET /health`, `GET /ready` on that port | Set `PLUMBUS_RUNTIME_ROLE=api` |
227
+ | Worker | `plumbus worker start --health-port $PLUMBUS_WORKER_HEALTH_PORT` | `GET /health`, `GET /ready` on `--health-port` | Exposes `/metrics` for Prometheus |
226
228
 
227
229
  Install optional peers in both images when needed:
228
230
 
@@ -238,16 +240,16 @@ Worker entrypoint example:
238
240
  ```sh
239
241
  #!/bin/sh
240
242
  set -e
241
- exec npx plumbus worker start --health-port 3001
243
+ exec npx plumbus worker start --health-port $PLUMBUS_WORKER_HEALTH_PORT
242
244
  ```
243
245
 
244
246
  Worker health probes (Kubernetes):
245
247
 
246
248
  ```yaml
247
249
  livenessProbe:
248
- httpGet: { path: /health, port: 3001 }
250
+ httpGet: { path: /health, port: health }
249
251
  readinessProbe:
250
- httpGet: { path: /ready, port: 3001 }
252
+ httpGet: { path: /ready, port: health }
251
253
  ```
252
254
 
253
255
  Colocated mode (single `plumbus start` process, no separate worker container) remains the default and requires no `PLUMBUS_RUNTIME_ROLE` override. See `docs/architecture/workers-and-queues.md` for runtime mode details.
@@ -274,7 +276,7 @@ const nextConfig = {
274
276
  npx next build
275
277
 
276
278
  # Run standalone server
277
- PORT=3001 HOSTNAME=0.0.0.0 node .next/standalone/frontend/server.js
279
+ PORT=$FRONTEND_PORT HOSTNAME=0.0.0.0 node .next/standalone/frontend/server.js
278
280
  ```
279
281
 
280
282
  ### Static Assets
@@ -289,7 +291,7 @@ After a standalone build, copy static files alongside the server:
289
291
  ### Environment Variables
290
292
 
291
293
  - `NEXT_PUBLIC_*` — inlined at **build time**. Set before `next build`, not at runtime.
292
- - `API_BASE_URL` — set at **runtime**. Internal Docker network address (e.g., `http://backend:3000`).
294
+ - **`API_BASE_URL`** — set at **runtime**. Internal Docker network address (the backend service name plus `PLUMBUS_START_PORT`).
293
295
  - `AUTH_SECRET` — required for cookie signing.
294
296
 
295
297
  ---
@@ -324,7 +326,7 @@ After a standalone build, copy static files alongside the server:
324
326
  | Variable | Build/Runtime | Description |
325
327
  |----------|---------------|-------------|
326
328
  | `NEXT_PUBLIC_API_BASE_URL` | Build | Public API URL (empty string if using server-side proxy) |
327
- | `API_BASE_URL` | Runtime | Backend URL for server-side proxy (e.g., `http://backend:3000`) |
329
+ | `API_BASE_URL` | Runtime | Backend URL for server-side proxy (Docker service name plus the API listen port from env) |
328
330
  | `AUTH_SECRET` | Runtime | Cookie signing secret |
329
331
  | `AUTH_COOKIE_SECURE` | Runtime | Set to `"true"` for TLS, `"false"` for HTTP-only deployments |
330
332
 
@@ -415,14 +417,15 @@ COPY app/ ./app/
415
417
  COPY config/ ./config/
416
418
  COPY drizzle/ ./drizzle/
417
419
  USER plumbus
418
- EXPOSE 3000
419
- HEALTHCHECK CMD wget -q -O /dev/null http://localhost:3000/ready || exit 1
420
+ # Do not EXPOSE a literal port — EXPOSE cannot read env. Publish the mapping in compose/k8s.
421
+ HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 \
422
+ CMD node -e "const p=process.env.PLUMBUS_START_PORT||process.env.PORT;if(!p){process.exit(1)}fetch('http://127.0.0.1:'+p+'/ready').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"
420
423
  ENTRYPOINT ["./entrypoint.sh"]
421
424
  ```
422
425
 
423
426
  ### Frontend Dockerfile
424
427
 
425
- For the **admin dashboard**, replace `{./frontend}` with `{./frontend-admin}`, change port 3001 to 3002, and adjust the package filter accordingly.
428
+ For the **admin dashboard**, replace `{./frontend}` with `{./frontend-admin}` and bind the dashboard to `FRONTEND_ADMIN_PORT` from the host environment.
426
429
 
427
430
  ```dockerfile
428
431
  # ==============================================================
@@ -463,7 +466,6 @@ RUN addgroup --system --gid 1001 nextjs && \
463
466
  COPY --from=build /app/deployed/.next/standalone ./
464
467
  COPY --from=build /app/deployed/.next/static ./deployed/.next/static
465
468
  USER nextjs
466
- EXPOSE 3001
467
469
  CMD ["node", "deployed/server.js"]
468
470
  ```
469
471
 
@@ -483,7 +485,7 @@ services:
483
485
  volumes: [uploads_data:/app/uploads]
484
486
  worker:
485
487
  build: { dockerfile: Dockerfile.backend }
486
- command: ['npx', 'plumbus', 'worker', 'start', '--health-port', '3001']
488
+ command: ['npx', 'plumbus', 'worker', 'start', '--health-port', '${PLUMBUS_WORKER_HEALTH_PORT}']
487
489
  depends_on: [postgres, redis]
488
490
  frontend:
489
491
  build: { dockerfile: Dockerfile.frontend }
@@ -594,10 +596,10 @@ spec:
594
596
 
595
597
  ```yaml
596
598
  livenessProbe:
597
- httpGet: { path: /health, port: 3000 }
599
+ httpGet: { path: /health, port: http }
598
600
  periodSeconds: 30
599
601
  readinessProbe:
600
- httpGet: { path: /ready, port: 3000 }
602
+ httpGet: { path: /ready, port: http }
601
603
  periodSeconds: 10
602
604
  ```
603
605
 
@@ -649,7 +651,7 @@ readinessProbe:
649
651
  ### Volumes and Networking
650
652
 
651
653
  - [ ] Persistent volumes for PostgreSQL data and uploads
652
- - [ ] `API_BASE_URL` set to Docker service name (e.g., `http://backend:3000`)
654
+ - [ ] `API_BASE_URL` set to the Docker service name and the API listen port from env
653
655
  - [ ] `NEXT_PUBLIC_API_BASE_URL` set to empty string `""` (for server-side proxy)
654
656
  - [ ] `AUTH_COOKIE_SECURE` set to `"true"` (or `"false"` only for HTTP-only — security trade-off)
655
657
 
@@ -38,7 +38,8 @@ export const refundApproval = defineFlow({
38
38
  | `wait` | Pause until event or timeout | `event` |
39
39
  | `delay` | Pause for a fixed duration | `duration` (e.g., `"24h"`, `"5m"`) |
40
40
  | `parallel` | Run multiple steps concurrently | `branches` (step names) |
41
- | `eventEmit` | Emit a framework event | `event` (event type) |
41
+ | `eventEmit` | Emit a framework event | `event` |
42
+ | `approval-outcome` | Route on Stage 4 approval decision | `outcomes` |
42
43
  ### Conditional Syntax
43
44
 
44
45
  The `if` field accepts a JavaScript-like expression string. You can reference the flow `input` and `state` directly:
@@ -113,6 +114,12 @@ retry: {
113
114
 
114
115
  Steps that fail with transient errors are retried. Permanent failures stop the flow and move it to the dead-letter queue.
115
116
 
117
+ ## Compiled definitions
118
+
119
+ Scheduled flows use `createFlowScheduler` and `flow_schedules`. Set `schedule.catchUpPolicy` to `catch-up` for bounded missed-tick catch-up; default is `skip`. Do not add a second scheduler.
120
+
121
+ `plumbus compile-flows` emits signed JSON from `defineFlow` modules. Pass `compiledRegistry` to `createFlowEngine` so production runs consume compiled JSON (not live TypeScript steps) and pin version+digest on `flow_executions`. `approval-outcome` steps use Stage 4 `ApprovalService`. `applyDefinitionStrategy(..., 'migrate')` is not supported. Do not write a second workflow engine.
122
+
116
123
  ## Flow Lifecycle
117
124
 
118
125
  `created → running → waiting → running → completed | failed`
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Release family 0.7.0
4
4
 
5
- This package requires an explicit upgrade from its previous minor line. Current Plumbus peers: `@plumbus/api` `0.2.x`, `@plumbus/ai-bedrock` `0.2.x`, `@plumbus/mcp` `0.6.x`. Install the matching versions of all Plumbus packages the app uses; do not bypass peer checks with `--force` or `--legacy-peer-deps`. Historical feature floors below describe earlier releases, not compatibility with this new family. Read the core `instructions/upgrading-security-release.md` checklist and refresh agent wiring with `plumbus init --patch` (v16).
5
+ This package requires an explicit upgrade from its previous minor line. Current Plumbus peers: `@plumbus/api` `0.3.x`, `@plumbus/ai-bedrock` `0.3.x`, `@plumbus/mcp` `0.7.x`. Install the matching versions of all Plumbus packages the app uses; do not bypass peer checks with `--force` or `--legacy-peer-deps`. Historical feature floors below describe earlier releases, not compatibility with this new family. Read the core `instructions/upgrading-security-release.md` checklist and refresh agent wiring with `plumbus init --patch` (v16).
6
6
 
7
7
 
8
8
  Plumbus is an AI-native, contract-driven TypeScript application framework. You build applications by composing six primitives — **Capabilities**, **Entities**, **Events**, **Flows**, **Prompts**, and **Translations** — through a controlled execution context (`ctx`). Optional add-on packages extend the surface when installed explicitly: `@plumbus/api` (partner HTTP API), `@plumbus/mcp` (AI agent tools), `@plumbus/chat` (+ `@plumbus/chat-ui`), `@plumbus/voice`, `@plumbus/knowledge-base`, `@plumbus/ui` (web UI generation), and `@plumbus/browser-extension`.
@@ -154,6 +154,7 @@ The optional `app/server.ts` file exports hooks that customize server behavior.
154
154
  | `resolveAiOverrides` | Before each AI call | Dynamic model/provider configuration from DB |
155
155
  | `onAICostRecorded` | After each AI cost record is written | Custom cost analytics or billing hooks |
156
156
  | `enableStrictStructuredOutputs` | Server bootstrap | Global toggle for strict structured-output mode |
157
+ | `credentials` | Server bootstrap | Optional host credential catalog (`export const credentials`). Passed to `createServer({ credentials })`. Names, types, refs, and public labels only — secrets stay in the host resolver. |
157
158
 
158
159
  ### Error Capture Coverage
159
160
 
@@ -17,7 +17,7 @@ Plumbus capabilities can be exposed to external AI agents as MCP tools. **Contra
17
17
  - **`plumbus generate`** — MCP manifest + skill files (no `@plumbus/mcp` install required).
18
18
  - **`plumbus mcp serve` / `list-tools` / `mcp generate`** — CLI entry points. The current CLI loads environment config, not `plumbus.config.*`; use `AUTH_SECRET` for CLI JWT authentication, or application-owned runtime wiring for `mcp.agents`.
19
19
 
20
- Install the runtime when serving agents: `pnpm add @plumbus/mcp` (optional peer of `@plumbus/core`, version-locked `0.6.x`).
20
+ Install the runtime when serving agents: `pnpm add @plumbus/mcp` (optional peer of `@plumbus/core`, version-locked `0.7.x`).
21
21
 
22
22
 
23
23
  Core 0.7.0 + MCP 0.6.0 require explicit authentication on every HTTP transport request. Discovery remains separately configurable. Environment-token fallback is for map-based stdio calls without an explicit header; an invalid header never falls back. Read [the security release checklist](./upgrading-security-release.md).
@@ -2,26 +2,28 @@
2
2
 
3
3
  Read this file before editing `peerDependencies` in any `packages/*/package.json`.
4
4
 
5
- ## Security release family — explicit upgrade required
5
+ ## Core 0.8 family (beta) — explicit upgrade required
6
6
 
7
- Core **0.7.x**, UI **0.8.x**, MCP **0.6.x**, voice **0.5.x**, and the remaining add-ons **0.2.x** form one coordinated release family. This is an intentional migration boundary: legacy caret ranges must not install these packages, and new packages must not accept legacy Plumbus peers. Do not widen these ranges to admit old core/voice lines just to make an installation pass.
7
+ Core **0.8.x**, UI **0.9.x**, MCP **0.7.x**, voice **0.6.x**, and the remaining add-ons **0.3.x** form one coordinated release family. It is currently staged as **`-beta.N` prereleases under a branch-named dist-tag (`plumbus-next`)**; see [Upgrading to core 0.8](../../../docs/upgrading-core-0.8.md). This is an intentional migration boundary: legacy caret ranges must not install these packages, and new packages must not accept legacy Plumbus peers. Do not widen these ranges to admit old core/voice lines just to make an installation pass.
8
8
 
9
- The previous family remains on core 0.6.x, UI 0.7.x, MCP 0.5.x, voice 0.4.x, and add-ons 0.1.x. Historical feature floors are not peer contracts for the new release.
9
+ The previous family remains on core 0.7.x, UI 0.8.x, MCP 0.6.x, voice 0.5.x, and add-ons 0.2.x (the security release). Historical feature floors are not peer contracts for the new release.
10
+
11
+ **Prerelease literal.** Semver excludes prereleases from `0.8.x`, so while the family is in beta every peer uses the closed range `>=0.8.0-beta.0 <0.9.0` (same shape for the other lines). It admits `0.8.0-beta.N` and every stable `0.8.N`, and still rejects 0.7.x. When the family goes stable, replace each literal with the plain `0.8.x` form in the same commit that drops the `-beta` suffixes.
10
12
 
11
13
  ## Canonical literals — copy exactly
12
14
 
13
15
  | Declaring package | Peer target | Literal |
14
16
  | --- | --- | --- |
15
- | Every add-on that peers on core | `@plumbus/core` | `"0.7.x"` |
16
- | `@plumbus/core` | `@plumbus/mcp` | `"0.6.x"` (optional) |
17
- | `@plumbus/core` | `@plumbus/api` | `"0.2.x"` (optional) |
18
- | `@plumbus/core` | `@plumbus/ai-bedrock` | `"0.2.x"` (optional) |
19
- | `@plumbus/chat` | `@plumbus/knowledge-base` | `"0.2.x"` (optional) |
20
- | `@plumbus/chat-ui` | `@plumbus/chat` | `"0.2.x"` |
21
- | `@plumbus/auth-cognito` | `@plumbus/auth` | `"0.2.x"` |
22
- | Every `@plumbus/voice-*` provider | `@plumbus/voice` | `"0.5.x"` |
17
+ | Every add-on that peers on core | `@plumbus/core` | `">=0.8.0-beta.0 <0.9.0"` (stable: `"0.8.x"`) |
18
+ | `@plumbus/core` | `@plumbus/mcp` | `">=0.7.0-beta.0 <0.8.0"` (optional; stable: `"0.7.x"`) |
19
+ | `@plumbus/core` | `@plumbus/api` | `">=0.3.0-beta.0 <0.4.0"` (optional; stable: `"0.3.x"`) |
20
+ | `@plumbus/core` | `@plumbus/ai-bedrock` | `">=0.3.0-beta.0 <0.4.0"` (optional; stable: `"0.3.x"`) |
21
+ | `@plumbus/chat` | `@plumbus/knowledge-base` | `">=0.3.0-beta.0 <0.4.0"` (optional; stable: `"0.3.x"`) |
22
+ | `@plumbus/chat-ui` | `@plumbus/chat` | `">=0.3.0-beta.0 <0.4.0"` (stable: `"0.3.x"`) |
23
+ | `@plumbus/auth-cognito` | `@plumbus/auth` | `">=0.3.0-beta.0 <0.4.0"` (stable: `"0.3.x"`) |
24
+ | Every `@plumbus/voice-*` provider | `@plumbus/voice` | `">=0.6.0-beta.0 <0.7.0"` (stable: `"0.6.x"`) |
23
25
 
24
- UI 0.8.0 replaces its direct core dependency with the required peer `"@plumbus/core": "0.7.x"` and uses `workspace:*` only for development. This prevents npm from accepting old application core plus a hidden new core nested inside UI. Install core and UI together. All Plumbus packages share the application runtime through peers.
26
+ UI 0.9.x keeps the required core peer (no direct core dependency) and uses `workspace:*` only for development. This prevents npm from accepting old application core plus a hidden new core nested inside UI. Install core and UI together. All Plumbus packages share the application runtime through peers.
25
27
 
26
28
  Voice does not peer on vendor add-ons. Apps explicitly install only providers they use, register their `*_REGISTRATION` through `createProviderRegistry()`, and pass that registry to routes/workers.
27
29
 
@@ -31,7 +33,7 @@ Voice does not peer on vendor add-ons. Apps explicitly install only providers th
31
33
  - New-family packages require the new family. Do not publish narrowed peers or migration-requiring behavior as a patch on an old line: an existing caret could select that patch.
32
34
  - `pnpm install` passing in this workspace does not prove npm consumer compatibility. Validate packed tarballs with npm; production installs use npm.
33
35
  - Keep all manifests, READMEs, package instructions, changelogs, and AGENTS/CLAUDE in sync.
34
- - Packages publish normally to npm’s **latest** dist-tag; there is no separate release-staging or promotion step.
36
+ - The publish workflow picks the npm dist-tag from the branch that contains the tagged commit: `latest` when the commit is on `main`, otherwise the branch name (this beta, tagged from `plumbus-next`, publishes as `plumbus-next`). Promoting to latest is a separate operator decision after the entire family and consumer staging checks pass.
35
37
 
36
38
  ## Future releases
37
39
 
@@ -41,4 +43,4 @@ Run lint, format checking, typechecking, tests, and packed npm install checks be
41
43
 
42
44
  ## Consumer upgrade
43
45
 
44
- Read [upgrading-security-release.md](./upgrading-security-release.md), explicitly select the new package versions for every installed Plumbus add-on, and run `plumbus init --patch` for agent wiring **v16**. Keep application business logic in Plumbus primitives and `ctx.*`; do not bypass security checks to make a migration pass.
46
+ Read [upgrading-security-release.md](./upgrading-security-release.md) and the 0.8 notes in the root docs, explicitly select the new package versions for every installed Plumbus add-on, and run `plumbus init --patch` for agent wiring **v16**. Keep application business logic in Plumbus primitives and `ctx.*`; do not bypass security checks to make a migration pass.
@@ -12,6 +12,9 @@ The actual instructions sent to the provider live in two optional string fields:
12
12
  | `description` | User/data prompt content (the main task text) |
13
13
 
14
14
  Both support simple top-level `{{key}}` substitution from the prompt `input` object.
15
+ Fill is a single pass over the original template. Values are inserted literally:
16
+ `$` sequences and `{{otherKey}}` inside a value are not interpreted. The helper is
17
+ `fillPromptTemplate` from `@plumbus/core`.
15
18
 
16
19
  ```ts
17
20
  import { definePrompt } from "@plumbus/core";
@@ -57,6 +57,10 @@ If flow steps return **403** after upgrading to 0.5.x, audit `access.roles` on s
57
57
 
58
58
  Events carry `tenantId` and are only delivered to matching consumers.
59
59
 
60
+ **Database-per-tenant:** `provisionDataPlane` creates the database plus owner/runtime roles. Apply generated `drizzle/` SQL as the **owner** (`applyDataPlaneMigrations` or `plumbus migrate apply --database <name>`). Request traffic opens the same database as the **runtime** role through `openDataPlaneConnection`. See `docs/sdk-reference/tenant-data-planes.md`.
61
+
62
+ **Credential catalog:** `createMemoryCredentialCatalog` is the host-declared type list plus opaque name/ref bindings. The host supplies secret values at `reveal`; they never enter logs, JSON, or catalog errors. There are no built-in types. See `docs/sdk-reference/credential-catalog.md`.
63
+
60
64
  ## Field Classification & Edit Zones
61
65
 
62
66
  Entity fields with `classification: "sensitive"` or `"highly_sensitive"`:
@@ -195,7 +195,7 @@ Plumbus provides vitest + Playwright end-to-end testing for generated Next.js fr
195
195
  plumbus ui e2e
196
196
 
197
197
  # Custom output directory and base URL
198
- plumbus ui e2e e2e-tests --frontend-dir frontend --base-url http://localhost:3001
198
+ plumbus ui e2e e2e-tests --frontend-dir frontend --base-url "$E2E_BASE_URL"
199
199
  ```
200
200
 
201
201
  This scans `frontend/app/**/page.tsx` for ActionPanel usage and generates:
@@ -245,7 +245,7 @@ describe("Project page", () => {
245
245
  beforeAll(async () => {
246
246
  browser = await chromium.launch();
247
247
  page = await browser.newPage();
248
- await page.goto("http://localhost:3001/project");
248
+ await page.goto(`${process.env.E2E_BASE_URL}/project`);
249
249
  await page.waitForLoadState("networkidle");
250
250
  }, 30_000);
251
251
 
@@ -0,0 +1,92 @@
1
+ CREATE SCHEMA IF NOT EXISTS "core_plumbus";
2
+ --> statement-breakpoint
3
+ CREATE TABLE "core_plumbus"."execution_state" (
4
+ execution_id text PRIMARY KEY,
5
+ state_ref_id text NOT NULL,
6
+ tenant_ref text NOT NULL,
7
+ revision integer NOT NULL,
8
+ tenant_epoch integer NOT NULL,
9
+ status text NOT NULL,
10
+ definition_id text NOT NULL,
11
+ definition_version text NOT NULL,
12
+ current_step_id text NOT NULL,
13
+ step_index integer NOT NULL,
14
+ attempt integer NOT NULL,
15
+ correlation_id text NOT NULL,
16
+ created_at timestamptz NOT NULL,
17
+ updated_at timestamptz NOT NULL,
18
+ wake_at timestamptz,
19
+ terminal boolean NOT NULL
20
+ );
21
+ --> statement-breakpoint
22
+ CREATE INDEX execution_state_status_idx ON "core_plumbus"."execution_state" (status);
23
+ --> statement-breakpoint
24
+ CREATE INDEX execution_state_epoch_idx ON "core_plumbus"."execution_state" (tenant_epoch);
25
+ --> statement-breakpoint
26
+ CREATE TABLE "core_plumbus"."step_execution" (
27
+ step_execution_id text PRIMARY KEY,
28
+ execution_id text NOT NULL,
29
+ step_id text NOT NULL,
30
+ attempt integer NOT NULL,
31
+ state text NOT NULL,
32
+ started_at timestamptz NOT NULL,
33
+ updated_at timestamptz NOT NULL,
34
+ completed_at timestamptz
35
+ );
36
+ --> statement-breakpoint
37
+ CREATE INDEX step_execution_exec_idx ON "core_plumbus"."step_execution" (execution_id);
38
+ --> statement-breakpoint
39
+ CREATE TABLE "core_plumbus"."wait_state" (
40
+ wait_state_id text PRIMARY KEY,
41
+ execution_id text NOT NULL,
42
+ step_id text NOT NULL,
43
+ kind text NOT NULL,
44
+ state text NOT NULL,
45
+ created_at timestamptz NOT NULL,
46
+ updated_at timestamptz NOT NULL,
47
+ not_before timestamptz,
48
+ expires_at timestamptz,
49
+ resolved_at timestamptz
50
+ );
51
+ --> statement-breakpoint
52
+ CREATE INDEX wait_state_exec_idx ON "core_plumbus"."wait_state" (execution_id);
53
+ --> statement-breakpoint
54
+ CREATE TABLE "core_plumbus"."terminal_state" (
55
+ terminal_state_id text PRIMARY KEY,
56
+ execution_id text NOT NULL UNIQUE,
57
+ operational_state text NOT NULL,
58
+ final_revision integer NOT NULL,
59
+ completed_at timestamptz NOT NULL,
60
+ domain_outcome_id text
61
+ );
62
+ --> statement-breakpoint
63
+ CREATE TABLE "core_plumbus"."dispatch_outbox" (
64
+ outbox_id text PRIMARY KEY,
65
+ execution_id text NOT NULL,
66
+ state_ref_id text NOT NULL,
67
+ expected_revision integer NOT NULL,
68
+ tenant_epoch integer NOT NULL,
69
+ tenant_ref text NOT NULL,
70
+ step_id text NOT NULL,
71
+ definition_id text NOT NULL,
72
+ definition_version text NOT NULL,
73
+ correlation_id text NOT NULL,
74
+ work_class_id text NOT NULL,
75
+ priority_class_id text NOT NULL,
76
+ not_before timestamptz NOT NULL,
77
+ created_at timestamptz NOT NULL,
78
+ published_at timestamptz,
79
+ spine_row_id text,
80
+ spine_acked_at timestamptz,
81
+ superseded boolean NOT NULL
82
+ );
83
+ --> statement-breakpoint
84
+ CREATE INDEX dispatch_outbox_pending_idx ON "core_plumbus"."dispatch_outbox" (published_at, spine_acked_at);
85
+ --> statement-breakpoint
86
+ CREATE INDEX dispatch_outbox_exec_rev_idx ON "core_plumbus"."dispatch_outbox" (execution_id, expected_revision);
87
+ --> statement-breakpoint
88
+ CREATE TABLE "core_plumbus"."side_effect_log" (
89
+ effect_key text PRIMARY KEY,
90
+ label text NOT NULL,
91
+ applied_at timestamptz NOT NULL
92
+ );
@@ -0,0 +1,45 @@
1
+ CREATE SCHEMA IF NOT EXISTS "core_plumbus";
2
+ --> statement-breakpoint
3
+ CREATE TABLE "core_plumbus"."human_task" (
4
+ human_task_id text PRIMARY KEY,
5
+ kind text NOT NULL,
6
+ state text NOT NULL,
7
+ approval_request_id text,
8
+ execution_id text,
9
+ created_at timestamptz NOT NULL,
10
+ expires_at timestamptz NOT NULL,
11
+ updated_at timestamptz NOT NULL,
12
+ resolved_at timestamptz
13
+ );
14
+ --> statement-breakpoint
15
+ CREATE INDEX human_task_state_idx ON "core_plumbus"."human_task" (state);
16
+ --> statement-breakpoint
17
+ CREATE TABLE "core_plumbus"."approval_request" (
18
+ approval_request_id text PRIMARY KEY,
19
+ capability_id text NOT NULL,
20
+ definition_version text NOT NULL,
21
+ input_digest text NOT NULL,
22
+ risk_class text NOT NULL,
23
+ review_reason text NOT NULL,
24
+ state text NOT NULL,
25
+ execution_id text,
26
+ created_at timestamptz NOT NULL,
27
+ expires_at timestamptz NOT NULL,
28
+ updated_at timestamptz NOT NULL,
29
+ resolved_at timestamptz,
30
+ invalidated_reason text
31
+ );
32
+ --> statement-breakpoint
33
+ CREATE INDEX approval_request_capability_idx ON "core_plumbus"."approval_request" (capability_id);
34
+ --> statement-breakpoint
35
+ CREATE INDEX approval_request_binding_idx ON "core_plumbus"."approval_request" (capability_id, definition_version, input_digest);
36
+ --> statement-breakpoint
37
+ CREATE TABLE "core_plumbus"."approval_decision" (
38
+ approval_decision_id text PRIMARY KEY,
39
+ approval_request_id text NOT NULL,
40
+ approver_account_id text NOT NULL,
41
+ decision text NOT NULL,
42
+ decided_at timestamptz NOT NULL
43
+ );
44
+ --> statement-breakpoint
45
+ CREATE INDEX approval_decision_request_idx ON "core_plumbus"."approval_decision" (approval_request_id);
@@ -0,0 +1,20 @@
1
+ {
2
+ "version": "7",
3
+ "dialect": "postgresql",
4
+ "entries": [
5
+ {
6
+ "idx": 0,
7
+ "version": "7",
8
+ "when": 1787184000000,
9
+ "tag": "0000_durable_tenant",
10
+ "breakpoints": true
11
+ },
12
+ {
13
+ "idx": 1,
14
+ "version": "7",
15
+ "when": 1787184060000,
16
+ "tag": "0001_human_task",
17
+ "breakpoints": true
18
+ }
19
+ ]
20
+ }
@@ -0,0 +1,26 @@
1
+ CREATE TABLE "opaque_dispatch" (
2
+ dispatch_id text PRIMARY KEY,
3
+ contract_version text NOT NULL,
4
+ tenant_route_id text NOT NULL,
5
+ execution_id text NOT NULL,
6
+ definition_id text NOT NULL,
7
+ definition_version text NOT NULL,
8
+ step_id text NOT NULL,
9
+ tenant_execution_state_ref_id text NOT NULL,
10
+ expected_revision integer NOT NULL,
11
+ tenant_epoch integer NOT NULL,
12
+ work_class_id text NOT NULL,
13
+ priority_class_id text NOT NULL,
14
+ delivery_state text NOT NULL,
15
+ attempt integer NOT NULL,
16
+ not_before timestamptz NOT NULL,
17
+ lease_ref_id text,
18
+ lease_expires_at timestamptz,
19
+ privacy_safe_failure_category_id text,
20
+ correlation_id text NOT NULL,
21
+ created_at timestamptz NOT NULL,
22
+ updated_at timestamptz NOT NULL,
23
+ UNIQUE (tenant_route_id, execution_id, expected_revision)
24
+ );
25
+ --> statement-breakpoint
26
+ CREATE INDEX opaque_dispatch_claim_idx ON "opaque_dispatch" (delivery_state, not_before, lease_expires_at);
@@ -0,0 +1,13 @@
1
+ {
2
+ "version": "7",
3
+ "dialect": "postgresql",
4
+ "entries": [
5
+ {
6
+ "idx": 0,
7
+ "version": "7",
8
+ "when": 1787184000001,
9
+ "tag": "0000_opaque_dispatch",
10
+ "breakpoints": true
11
+ }
12
+ ]
13
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plumbus/core",
3
- "version": "0.7.1",
3
+ "version": "0.8.0-beta.1",
4
4
  "description": "Plumbus framework core — types, SDK, runtime, CLI, test utilities",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -17,6 +17,10 @@
17
17
  "types": "./dist/errors-entry.d.ts",
18
18
  "import": "./dist/errors-entry.js"
19
19
  },
20
+ "./runtime": {
21
+ "types": "./dist/runtime-entry.d.ts",
22
+ "import": "./dist/runtime-entry.js"
23
+ },
20
24
  "./testing": {
21
25
  "types": "./dist/testing/index.d.ts",
22
26
  "import": "./dist/testing/index.js"
@@ -32,11 +36,24 @@
32
36
  "./mcp": {
33
37
  "types": "./dist/mcp/index.d.ts",
34
38
  "import": "./dist/mcp/index.js"
39
+ },
40
+ "./credentials": {
41
+ "types": "./dist/credentials/index.d.ts",
42
+ "import": "./dist/credentials/index.js"
43
+ },
44
+ "./admission": {
45
+ "types": "./dist/admission/index.d.ts",
46
+ "import": "./dist/admission/index.js"
47
+ },
48
+ "./admission/client": {
49
+ "types": "./dist/admission/client.d.ts",
50
+ "import": "./dist/admission/client.js"
35
51
  }
36
52
  },
37
53
  "files": [
38
54
  "dist",
39
55
  "instructions",
56
+ "migrations",
40
57
  "CHANGELOG.md"
41
58
  ],
42
59
  "keywords": [
@@ -58,6 +75,7 @@
58
75
  "node": ">=20.6.0"
59
76
  },
60
77
  "dependencies": {
78
+ "@noble/hashes": "1.8.0",
61
79
  "@xmldom/xmldom": "^0.9.10",
62
80
  "commander": "^12.1.0",
63
81
  "drizzle-kit": "^0.31.9",
@@ -74,9 +92,9 @@
74
92
  "zod-to-json-schema": "^3.25.2"
75
93
  },
76
94
  "peerDependencies": {
77
- "@plumbus/api": "0.2.x",
78
- "@plumbus/ai-bedrock": "0.2.x",
79
- "@plumbus/mcp": "0.6.x",
95
+ "@plumbus/api": ">=0.3.0-beta.0 <0.4.0",
96
+ "@plumbus/ai-bedrock": ">=0.3.0-beta.0 <0.4.0",
97
+ "@plumbus/mcp": ">=0.7.0-beta.0 <0.8.0",
80
98
  "cron-parser": "^4.9.0",
81
99
  "redis": "^4.7.0"
82
100
  },
@@ -103,10 +121,10 @@
103
121
  "@vitest/browser": "^3.0.0",
104
122
  "esbuild": "^0.25.12",
105
123
  "typescript": "^5.7.0",
106
- "@plumbus/api": "0.2.1",
107
- "@plumbus/voice": "0.5.1",
108
- "@plumbus/ai-bedrock": "0.2.1",
109
- "@plumbus/mcp": "0.6.1"
124
+ "@plumbus/ai-bedrock": "0.3.0-beta.0",
125
+ "@plumbus/voice": "0.6.0-beta.0",
126
+ "@plumbus/mcp": "0.7.0-beta.0",
127
+ "@plumbus/api": "0.3.0-beta.0"
110
128
  },
111
129
  "scripts": {
112
130
  "build": "tsc -b",