okengine 0.2.6 → 0.3.2

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 (681) hide show
  1. package/AGENTS.md +33 -30
  2. package/README.md +74 -340
  3. package/{spec/manifest.v1.schema.json → manifest.v1.schema.json} +40 -9
  4. package/package.json +47 -44
  5. package/site/content/docs/ai/llms-txt.mdx +54 -0
  6. package/site/content/docs/ai/mcp.mdx +123 -0
  7. package/site/content/docs/ai/meta.json +5 -0
  8. package/site/content/docs/ai/skills.mdx +53 -0
  9. package/site/content/docs/console/access.mdx +29 -0
  10. package/site/content/docs/console/ai.mdx +35 -0
  11. package/site/content/docs/console/architecture.mdx +35 -0
  12. package/site/content/docs/console/channels.mdx +37 -0
  13. package/site/content/docs/console/clock.mdx +31 -0
  14. package/site/content/docs/console/flows.mdx +31 -0
  15. package/site/content/docs/console/gates.mdx +35 -0
  16. package/site/content/docs/console/manifest-diff.mdx +34 -0
  17. package/site/content/docs/console/meta.json +23 -0
  18. package/site/content/docs/console/overview.mdx +40 -0
  19. package/site/content/docs/console/plugins.mdx +41 -0
  20. package/site/content/docs/console/privacy.mdx +32 -0
  21. package/site/content/docs/console/runs.mdx +40 -0
  22. package/site/content/docs/console/signals.mdx +31 -0
  23. package/site/content/docs/console/store.mdx +32 -0
  24. package/site/content/docs/console/tenancy.mdx +32 -0
  25. package/site/content/docs/console/traces.mdx +34 -0
  26. package/site/content/docs/console/vault.mdx +37 -0
  27. package/site/content/docs/elements/ai.mdx +180 -0
  28. package/site/content/docs/elements/channel.mdx +167 -0
  29. package/site/content/docs/elements/clock.mdx +182 -0
  30. package/site/content/docs/elements/flow.mdx +288 -0
  31. package/site/content/docs/elements/gate.mdx +171 -0
  32. package/site/content/docs/elements/meta.json +5 -0
  33. package/site/content/docs/elements/signal.mdx +171 -0
  34. package/site/content/docs/elements/store.mdx +320 -0
  35. package/site/content/docs/elements/vault.mdx +263 -0
  36. package/site/content/docs/get-started/basic-usage.mdx +124 -0
  37. package/site/content/docs/get-started/comparison.mdx +65 -0
  38. package/site/content/docs/get-started/installation.mdx +113 -0
  39. package/site/content/docs/get-started/introduction.mdx +123 -0
  40. package/site/content/docs/get-started/meta.json +5 -0
  41. package/site/content/docs/index.mdx +63 -0
  42. package/site/content/docs/meta.json +5 -0
  43. package/site/content/docs/plugins/compression.mdx +60 -0
  44. package/site/content/docs/plugins/cors.mdx +92 -0
  45. package/site/content/docs/plugins/csrf.mdx +96 -0
  46. package/site/content/docs/plugins/ip-allowlist.mdx +92 -0
  47. package/site/content/docs/plugins/maintenance-mode.mdx +101 -0
  48. package/site/content/docs/plugins/meta.json +15 -0
  49. package/site/content/docs/plugins/security-headers.mdx +136 -0
  50. package/site/content/docs/reference/cli.md +101 -0
  51. package/site/content/docs/reference/configuration.mdx +159 -0
  52. package/site/content/docs/reference/environment-variables.mdx +87 -0
  53. package/site/content/docs/reference/errors.mdx +80 -0
  54. package/site/content/docs/reference/fx.mdx +117 -0
  55. package/site/content/docs/reference/meta.json +5 -0
  56. package/site/content/docs/reference/plugins.mdx +249 -0
  57. package/site/content/docs/reference/security.md +63 -0
  58. package/src/auth/api-keys.ts +2 -5
  59. package/src/auth/attenuation.ts +2 -6
  60. package/src/auth/auth.test.ts +56 -31
  61. package/src/auth/invoke-as.ts +1 -3
  62. package/src/auth/operator.ts +8 -26
  63. package/src/auth/planes.ts +2 -7
  64. package/src/auth/plugin.ts +4 -7
  65. package/src/auth/roles.ts +1 -5
  66. package/src/auth/sessions.ts +10 -39
  67. package/src/cli/args.ts +1 -5
  68. package/src/cli/ask-dev-mode.ts +40 -0
  69. package/src/cli/build.ts +1 -2
  70. package/src/cli/client-add.test.ts +8 -15
  71. package/src/cli/client-add.ts +5 -14
  72. package/src/cli/completion.test.ts +1 -5
  73. package/src/cli/completion.ts +4 -17
  74. package/src/cli/db-auto-push.test.ts +64 -0
  75. package/src/cli/db-auto-push.ts +72 -0
  76. package/src/cli/db.test.ts +189 -0
  77. package/src/cli/db.ts +456 -0
  78. package/src/cli/dev-app-runner.ts +2 -8
  79. package/src/cli/dev-db-push.test.ts +193 -0
  80. package/src/cli/dev-mode.test.ts +45 -0
  81. package/src/cli/dev-mode.ts +78 -0
  82. package/src/cli/dev-schema-sync.test.ts +66 -0
  83. package/src/cli/dev-schema-sync.ts +139 -0
  84. package/src/cli/dev.test.ts +264 -15
  85. package/src/cli/dev.ts +355 -139
  86. package/src/cli/doc-staleness.test.ts +69 -0
  87. package/src/cli/docker-cli.test.ts +27 -8
  88. package/src/cli/docker.ts +11 -3
  89. package/src/cli/doctor-diff.test.ts +1 -5
  90. package/src/cli/doctor-diff.ts +17 -46
  91. package/src/cli/doctor-pii.ts +2 -7
  92. package/src/cli/doctor.test.ts +26 -4
  93. package/src/cli/doctor.ts +35 -11
  94. package/src/cli/drizzle-env.test.ts +67 -0
  95. package/src/cli/drizzle-env.ts +78 -0
  96. package/src/cli/ensure-drizzle-config.ts +50 -0
  97. package/src/cli/eval.ts +4 -14
  98. package/src/cli/gates-list.ts +1 -4
  99. package/src/cli/hero-meta.test.ts +17 -19
  100. package/src/cli/hero-meta.ts +20 -30
  101. package/src/cli/images.ts +3 -8
  102. package/src/cli/index.ts +11 -2
  103. package/src/cli/load-config.images.test.ts +14 -14
  104. package/src/cli/load-config.ts +47 -47
  105. package/src/cli/mcp-from-console.ts +1 -4
  106. package/src/cli/mode.ts +65 -0
  107. package/src/cli/openbao-bootstrap.test.ts +147 -0
  108. package/src/cli/openbao-bootstrap.ts +280 -0
  109. package/src/cli/openbao-restart.integration.test.ts +136 -0
  110. package/src/cli/ports.test.ts +7 -14
  111. package/src/cli/ports.ts +7 -5
  112. package/src/cli/privacy-erase.ts +1 -3
  113. package/src/cli/registry.ts +75 -25
  114. package/src/cli/resolve-dev-sql-env.test.ts +48 -0
  115. package/src/cli/resolve-dev-sql-env.ts +42 -0
  116. package/src/cli/schema.ts +3 -10
  117. package/src/cli/stack.ts +8 -10
  118. package/src/cli/start.ts +4 -15
  119. package/src/cli/upgrade.ts +1 -4
  120. package/src/cli/vault-cmd.ts +63 -0
  121. package/src/client/budget-entry.ts +1 -6
  122. package/src/client/create.test.ts +6 -12
  123. package/src/client/create.ts +2 -8
  124. package/src/client/errors.ts +1 -4
  125. package/src/client/index.ts +1 -6
  126. package/src/client/notes-contract.test.ts +4 -13
  127. package/src/client/transport.ts +9 -30
  128. package/src/client/types.ts +15 -30
  129. package/src/compiler/aot.test.ts +2 -9
  130. package/src/compiler/aot.ts +1 -4
  131. package/src/compiler/differential.test.ts +3 -11
  132. package/src/compiler/dynamic.ts +1 -4
  133. package/src/compiler/effects-infer.ts +8 -34
  134. package/src/compiler/emit.ts +1 -3
  135. package/src/compiler/extract.test.ts +136 -30
  136. package/src/compiler/extract.ts +485 -157
  137. package/src/compiler/fixtures/skyport/oke.config.ts +3 -3
  138. package/src/compiler/fixtures/skyport/src/flows/bookings/index.ts +7 -3
  139. package/src/compiler/fixtures/skyport/src/flows/payments/index.ts +1 -3
  140. package/src/compiler/fixtures/skyport/src/flows/support/index.ts +4 -1
  141. package/src/compiler/fixtures/skyport.expected.json +24 -83
  142. package/src/compiler/fixtures/triggers/five-triggers.ts +1 -2
  143. package/src/compiler/http-parse.ts +2 -9
  144. package/src/compiler/index.ts +1 -5
  145. package/src/compiler/response.ts +16 -7
  146. package/src/compiler/sucrose.ts +11 -31
  147. package/src/config/define-config.test.ts +55 -34
  148. package/src/config/index.ts +177 -46
  149. package/src/config/resolve-driver.test.ts +28 -17
  150. package/src/console/budget.test.ts +1 -4
  151. package/src/console/index.ts +1 -4
  152. package/src/console/server/access.test.ts +15 -43
  153. package/src/console/server/access.ts +19 -49
  154. package/src/console/server/ai.test.ts +3 -11
  155. package/src/console/server/ai.ts +23 -46
  156. package/src/console/server/app.ts +16 -45
  157. package/src/console/server/auth-rate.test.ts +4 -12
  158. package/src/console/server/bind.ts +1 -5
  159. package/src/console/server/channels.test.ts +2 -6
  160. package/src/console/server/channels.ts +10 -35
  161. package/src/console/server/claim.ts +2 -8
  162. package/src/console/server/clock.test.ts +2 -6
  163. package/src/console/server/clock.ts +8 -26
  164. package/src/console/server/console.test.ts +1 -3
  165. package/src/console/server/diff.test.ts +5 -17
  166. package/src/console/server/diff.ts +10 -31
  167. package/src/console/server/dry-run.audit.test.ts +2 -8
  168. package/src/console/server/flows.ts +64 -233
  169. package/src/console/server/gates.test.ts +14 -50
  170. package/src/console/server/gates.ts +13 -48
  171. package/src/console/server/index.ts +2 -9
  172. package/src/console/server/live.ts +3 -12
  173. package/src/console/server/operator-db.test.ts +4 -15
  174. package/src/console/server/operator-db.ts +13 -32
  175. package/src/console/server/plugin.ts +50 -53
  176. package/src/console/server/plugins.test.ts +2 -6
  177. package/src/console/server/plugins.ts +17 -56
  178. package/src/console/server/runs-pii.ts +2 -7
  179. package/src/console/server/security.gate.test.ts +18 -40
  180. package/src/console/server/serve.ts +10 -25
  181. package/src/console/server/signals.test.ts +1 -3
  182. package/src/console/server/signals.ts +17 -40
  183. package/src/console/server/state.ts +21 -59
  184. package/src/console/server/store.test.ts +20 -22
  185. package/src/console/server/store.ts +31 -76
  186. package/src/console/server/vault.test.ts +12 -29
  187. package/src/console/server/vault.ts +44 -66
  188. package/src/console/ui/access/AccessA11yView.tsx +6 -21
  189. package/src/console/ui/access/a11y.test.tsx +3 -12
  190. package/src/console/ui/access/acknowledgement.test.ts +1 -4
  191. package/src/console/ui/access/acknowledgement.ts +1 -3
  192. package/src/console/ui/access/blast-radius.ts +1 -3
  193. package/src/console/ui/access/confirmation.test.ts +1 -5
  194. package/src/console/ui/access/confirmation.ts +1 -4
  195. package/src/console/ui/access/fixture.ts +1 -5
  196. package/src/console/ui/access/grantable.test.ts +1 -3
  197. package/src/console/ui/access/grantable.ts +2 -7
  198. package/src/console/ui/access/index.ts +2 -9
  199. package/src/console/ui/access/provenance.test.ts +1 -3
  200. package/src/console/ui/access/provenance.ts +2 -6
  201. package/src/console/ui/access/search.test.ts +1 -5
  202. package/src/console/ui/access/search.ts +2 -6
  203. package/src/console/ui/ai/AiA11yView.tsx +6 -17
  204. package/src/console/ui/ai/a11y.test.tsx +2 -5
  205. package/src/console/ui/ai/fixture.ts +2 -7
  206. package/src/console/ui/ai/format.ts +1 -3
  207. package/src/console/ui/ai/group.test.ts +1 -3
  208. package/src/console/ui/ai/group.ts +4 -12
  209. package/src/console/ui/ai/index.ts +2 -9
  210. package/src/console/ui/ai/promotion.test.ts +2 -7
  211. package/src/console/ui/ai/promotion.ts +4 -13
  212. package/src/console/ui/ai/search.test.ts +2 -11
  213. package/src/console/ui/ai/search.ts +3 -13
  214. package/src/console/ui/ai/types.ts +1 -8
  215. package/src/console/ui/architecture/ArchitectureA11yView.tsx +8 -29
  216. package/src/console/ui/architecture/a11y.test.tsx +1 -2
  217. package/src/console/ui/architecture/declared.ts +1 -5
  218. package/src/console/ui/architecture/index.ts +7 -35
  219. package/src/console/ui/architecture/layout.ts +1 -3
  220. package/src/console/ui/architecture/pathologies.ts +10 -19
  221. package/src/console/ui/architecture/search.ts +6 -15
  222. package/src/console/ui/architecture/traffic.ts +4 -14
  223. package/src/console/ui/architecture/types.ts +2 -10
  224. package/src/console/ui/architecture/view.test.ts +7 -19
  225. package/src/console/ui/architecture/view.ts +9 -36
  226. package/src/console/ui/channels/ChannelsA11yView.tsx +4 -13
  227. package/src/console/ui/channels/a11y.test.tsx +1 -2
  228. package/src/console/ui/channels/confirmation.test.ts +1 -4
  229. package/src/console/ui/channels/confirmation.ts +1 -4
  230. package/src/console/ui/channels/findings.ts +1 -5
  231. package/src/console/ui/channels/index.ts +2 -8
  232. package/src/console/ui/channels/locale.test.ts +1 -3
  233. package/src/console/ui/channels/locale.ts +2 -8
  234. package/src/console/ui/channels/search.ts +4 -13
  235. package/src/console/ui/channels/taxonomy.ts +1 -3
  236. package/src/console/ui/clock/ClockA11yView.tsx +9 -26
  237. package/src/console/ui/clock/a11y.test.tsx +2 -5
  238. package/src/console/ui/clock/confirmation.test.ts +1 -3
  239. package/src/console/ui/clock/confirmation.ts +1 -4
  240. package/src/console/ui/clock/findings.ts +1 -4
  241. package/src/console/ui/clock/health.ts +2 -7
  242. package/src/console/ui/clock/index.ts +2 -10
  243. package/src/console/ui/clock/search.test.ts +1 -3
  244. package/src/console/ui/clock/search.ts +2 -6
  245. package/src/console/ui/clock/timeline.test.ts +1 -3
  246. package/src/console/ui/clock/waiting-on.test.ts +1 -5
  247. package/src/console/ui/clock/waiting-on.ts +2 -7
  248. package/src/console/ui/diff/DiffA11yView.tsx +8 -17
  249. package/src/console/ui/diff/a11y.test.tsx +2 -5
  250. package/src/console/ui/diff/group.test.ts +3 -13
  251. package/src/console/ui/diff/group.ts +2 -8
  252. package/src/console/ui/diff/index.ts +2 -8
  253. package/src/console/ui/diff/search.test.ts +1 -5
  254. package/src/console/ui/diff/search.ts +4 -16
  255. package/src/console/ui/diff/summary.ts +1 -2
  256. package/src/console/ui/dist/assets/{index-Dy4jht9P.js → index-BWo8R7NR.js} +2 -2
  257. package/src/console/ui/dist/assets/{panel-access-Dd37LU2c.js → panel-access-C0J2D-a2.js} +1 -1
  258. package/src/console/ui/dist/assets/{panel-ai-CC7LR6-J.js → panel-ai-D_m6WQI8.js} +1 -1
  259. package/src/console/ui/dist/assets/{panel-architecture-B5b3iKCz.js → panel-architecture-CKnXFyUx.js} +1 -1
  260. package/src/console/ui/dist/assets/{panel-channels-CeNjTKXp.js → panel-channels-BOmQ-onL.js} +1 -1
  261. package/src/console/ui/dist/assets/{panel-clock-DgFTLoHV.js → panel-clock-giAq0Ccv.js} +1 -1
  262. package/src/console/ui/dist/assets/{panel-diff-DxehccqB.js → panel-diff-cdonmH8c.js} +1 -1
  263. package/src/console/ui/dist/assets/{panel-flows-BtrVn-Eg.js → panel-flows-DlCU5zjA.js} +2 -2
  264. package/src/console/ui/dist/assets/{panel-gates-Z9MKRGdH.js → panel-gates-XclZxWD5.js} +1 -1
  265. package/src/console/ui/dist/assets/{panel-overview-Dt_AeXgd.js → panel-overview-BznEOTnb.js} +1 -1
  266. package/src/console/ui/dist/assets/{panel-plugins-DWd0TowH.js → panel-plugins-CcGM1g64.js} +1 -1
  267. package/src/console/ui/dist/assets/{panel-runs-DGstFHeq.js → panel-runs-CGWNHLR4.js} +1 -1
  268. package/src/console/ui/dist/assets/{panel-signals-DzEa2Fnt.js → panel-signals-CNywkdak.js} +1 -1
  269. package/src/console/ui/dist/assets/{panel-store-BJkbNgxx.js → panel-store-KmTbFHMH.js} +1 -1
  270. package/src/console/ui/dist/assets/{panel-traces-BaRVO3gM.js → panel-traces-DBLx2ilD.js} +1 -1
  271. package/src/console/ui/dist/assets/panel-vault-CEnFc0dk.js +1 -0
  272. package/src/console/ui/dist/index.html +1 -1
  273. package/src/console/ui/flows/FlowsA11yView.tsx +7 -22
  274. package/src/console/ui/flows/a11y.test.tsx +2 -8
  275. package/src/console/ui/flows/buffer.test.ts +3 -11
  276. package/src/console/ui/flows/buffer.ts +4 -11
  277. package/src/console/ui/flows/confirmation.ts +1 -3
  278. package/src/console/ui/flows/contract.test.ts +3 -7
  279. package/src/console/ui/flows/contract.ts +12 -36
  280. package/src/console/ui/flows/graph.test.ts +3 -11
  281. package/src/console/ui/flows/graph.ts +5 -15
  282. package/src/console/ui/flows/index.ts +1 -6
  283. package/src/console/ui/flows/save-as-test.ts +1 -3
  284. package/src/console/ui/flows/search.ts +8 -25
  285. package/src/console/ui/flows/tiers.ts +2 -9
  286. package/src/console/ui/gates/GatesA11yView.tsx +4 -13
  287. package/src/console/ui/gates/a11y.test.tsx +2 -5
  288. package/src/console/ui/gates/audit.ts +1 -3
  289. package/src/console/ui/gates/denial.test.ts +1 -3
  290. package/src/console/ui/gates/denial.ts +4 -12
  291. package/src/console/ui/gates/findings.ts +1 -3
  292. package/src/console/ui/gates/group.test.ts +3 -3
  293. package/src/console/ui/gates/group.ts +3 -11
  294. package/src/console/ui/gates/index.ts +2 -10
  295. package/src/console/ui/gates/search.ts +3 -10
  296. package/src/console/ui/overview/OverviewA11yView.tsx +9 -27
  297. package/src/console/ui/overview/a11y.test.tsx +1 -2
  298. package/src/console/ui/overview/busiest.ts +1 -3
  299. package/src/console/ui/overview/compose.ts +1 -13
  300. package/src/console/ui/overview/cost.ts +34 -38
  301. package/src/console/ui/overview/fixture.ts +21 -26
  302. package/src/console/ui/overview/golden.ts +4 -14
  303. package/src/console/ui/overview/index.ts +2 -9
  304. package/src/console/ui/overview/rank.test.ts +3 -10
  305. package/src/console/ui/overview/rank.ts +2 -7
  306. package/src/console/ui/overview/slo.test.ts +5 -9
  307. package/src/console/ui/overview/slo.ts +6 -23
  308. package/src/console/ui/overview/verdict.ts +3 -10
  309. package/src/console/ui/plugins/PluginsA11yView.tsx +8 -18
  310. package/src/console/ui/plugins/a11y.test.tsx +1 -2
  311. package/src/console/ui/plugins/fixture.ts +2 -4
  312. package/src/console/ui/plugins/group.test.ts +1 -3
  313. package/src/console/ui/plugins/group.ts +1 -6
  314. package/src/console/ui/plugins/index.ts +3 -13
  315. package/src/console/ui/plugins/search.ts +7 -19
  316. package/src/console/ui/runs/RunsA11yView.tsx +5 -20
  317. package/src/console/ui/runs/a11y.test.tsx +2 -5
  318. package/src/console/ui/runs/explain.ts +2 -6
  319. package/src/console/ui/runs/group.ts +3 -12
  320. package/src/console/ui/runs/histogram.test.ts +2 -11
  321. package/src/console/ui/runs/histogram.ts +1 -4
  322. package/src/console/ui/runs/index.ts +4 -18
  323. package/src/console/ui/runs/project.ts +2 -6
  324. package/src/console/ui/runs/query.test.ts +1 -3
  325. package/src/console/ui/runs/query.ts +12 -35
  326. package/src/console/ui/runs/search.ts +5 -19
  327. package/src/console/ui/runs/trace-link.test.ts +2 -6
  328. package/src/console/ui/runs/trace-link.ts +4 -16
  329. package/src/console/ui/runs/types.ts +1 -3
  330. package/src/console/ui/shell/App.tsx +2 -10
  331. package/src/console/ui/shell/client.ts +22 -115
  332. package/src/console/ui/shell/components/ui.tsx +1 -4
  333. package/src/console/ui/shell/layout/Shell.tsx +2 -4
  334. package/src/console/ui/shell/main.tsx +31 -96
  335. package/src/console/ui/shell/panels/access/AccessPanel.tsx +34 -98
  336. package/src/console/ui/shell/panels/ai/AiPanel.tsx +35 -106
  337. package/src/console/ui/shell/panels/architecture/ArchitecturePanel.tsx +18 -66
  338. package/src/console/ui/shell/panels/channels/ChannelsPanel.tsx +20 -57
  339. package/src/console/ui/shell/panels/clock/ClockPanel.tsx +22 -54
  340. package/src/console/ui/shell/panels/diff/DiffPanel.tsx +20 -61
  341. package/src/console/ui/shell/panels/flows/ContractEditor.tsx +6 -23
  342. package/src/console/ui/shell/panels/flows/FlowDrawer.tsx +13 -28
  343. package/src/console/ui/shell/panels/flows/FlowsPanel.tsx +9 -29
  344. package/src/console/ui/shell/panels/gates/GatesPanel.tsx +24 -80
  345. package/src/console/ui/shell/panels/overview/OverviewPanel.tsx +20 -58
  346. package/src/console/ui/shell/panels/plugins/PluginsPanel.tsx +16 -41
  347. package/src/console/ui/shell/panels/runs/RunsPanel.tsx +31 -99
  348. package/src/console/ui/shell/panels/signals/SignalsPanel.tsx +38 -101
  349. package/src/console/ui/shell/panels/store/StorePanel.tsx +27 -66
  350. package/src/console/ui/shell/panels/traces/TracesPanel.tsx +28 -89
  351. package/src/console/ui/shell/panels/vault/VaultPanel.tsx +22 -53
  352. package/src/console/ui/shell/setup/Wizard.tsx +3 -5
  353. package/src/console/ui/shell/styles.css +1 -2
  354. package/src/console/ui/signals/SignalsA11yView.tsx +9 -33
  355. package/src/console/ui/signals/a11y.test.tsx +2 -5
  356. package/src/console/ui/signals/confirmation.test.ts +1 -5
  357. package/src/console/ui/signals/confirmation.ts +2 -6
  358. package/src/console/ui/signals/dry-run.ts +1 -3
  359. package/src/console/ui/signals/durable.ts +1 -3
  360. package/src/console/ui/signals/findings.ts +1 -3
  361. package/src/console/ui/signals/group.test.ts +2 -8
  362. package/src/console/ui/signals/group.ts +2 -10
  363. package/src/console/ui/signals/index.ts +1 -4
  364. package/src/console/ui/signals/monitor.ts +2 -7
  365. package/src/console/ui/signals/schema-form.test.ts +3 -14
  366. package/src/console/ui/signals/schema-form.ts +1 -4
  367. package/src/console/ui/signals/search.ts +4 -13
  368. package/src/console/ui/store/StoreA11yView.tsx +3 -9
  369. package/src/console/ui/store/a11y.test.tsx +2 -5
  370. package/src/console/ui/store/confirmation.test.ts +1 -3
  371. package/src/console/ui/store/confirmation.ts +1 -4
  372. package/src/console/ui/store/dry-run.ts +2 -5
  373. package/src/console/ui/store/fixture.ts +1 -2
  374. package/src/console/ui/store/group.test.ts +1 -6
  375. package/src/console/ui/store/group.ts +1 -4
  376. package/src/console/ui/store/index.ts +1 -5
  377. package/src/console/ui/store/search.ts +2 -6
  378. package/src/console/ui/store/will-not-fire.ts +1 -2
  379. package/src/console/ui/traces/TracesA11yView.tsx +10 -29
  380. package/src/console/ui/traces/a11y.test.tsx +1 -2
  381. package/src/console/ui/traces/chain.test.ts +5 -19
  382. package/src/console/ui/traces/chain.ts +1 -3
  383. package/src/console/ui/traces/critical-path.test.ts +1 -3
  384. package/src/console/ui/traces/critical-path.ts +2 -6
  385. package/src/console/ui/traces/filter.test.ts +2 -6
  386. package/src/console/ui/traces/filter.ts +5 -13
  387. package/src/console/ui/traces/fold.test.ts +4 -12
  388. package/src/console/ui/traces/fold.ts +1 -3
  389. package/src/console/ui/traces/mini.ts +1 -3
  390. package/src/console/ui/traces/replay.test.ts +1 -3
  391. package/src/console/ui/traces/replay.ts +1 -3
  392. package/src/console/ui/traces/sampling.ts +1 -4
  393. package/src/console/ui/traces/search.ts +4 -17
  394. package/src/console/ui/traces/tier.ts +1 -3
  395. package/src/console/ui/vault/VaultA11yView.tsx +5 -17
  396. package/src/console/ui/vault/a11y.test.tsx +1 -2
  397. package/src/console/ui/vault/blast-radius.ts +1 -3
  398. package/src/console/ui/vault/confirmation.test.ts +1 -5
  399. package/src/console/ui/vault/confirmation.ts +1 -4
  400. package/src/console/ui/vault/dormant.test.ts +1 -4
  401. package/src/console/ui/vault/export-safe.test.ts +1 -5
  402. package/src/console/ui/vault/export-safe.ts +1 -4
  403. package/src/console/ui/vault/fixture.ts +3 -3
  404. package/src/console/ui/vault/group.ts +1 -2
  405. package/src/console/ui/vault/index.ts +2 -10
  406. package/src/console/ui/vault/search.ts +2 -6
  407. package/src/console/ui/vault/types.ts +1 -1
  408. package/src/console/xss.gate.test.ts +1 -3
  409. package/src/docker/compose.ts +215 -27
  410. package/src/docker/derive.ts +6 -14
  411. package/src/docker/docker.test.ts +118 -15
  412. package/src/docker/dockerfile.integration.test.ts +12 -21
  413. package/src/docker/helpers.ts +5 -4
  414. package/src/docker/index.ts +9 -6
  415. package/src/docker/pin.ts +1 -9
  416. package/src/docker/recipes/index.ts +6 -6
  417. package/src/docker/recipes/mailpit.ts +22 -0
  418. package/src/docker/recipes/openbao.ts +47 -0
  419. package/src/docker/recipes/postgres.ts +17 -6
  420. package/src/docker/recipes/redis.ts +11 -2
  421. package/src/docker/recipes/rustfs.ts +32 -0
  422. package/src/docker/stack-id.test.ts +73 -5
  423. package/src/docker/stack-id.ts +124 -33
  424. package/src/docker/stack.integration.test.ts +6 -21
  425. package/src/docker/stack.ts +36 -4
  426. package/src/docker/types.ts +16 -4
  427. package/src/docs-origin.ts +4 -4
  428. package/src/drivers/ai-anthropic.ts +5 -14
  429. package/src/drivers/ai-mock.ts +2 -5
  430. package/src/drivers/ai-openai-compatible.ts +4 -10
  431. package/src/drivers/ai-providers.test.ts +6 -13
  432. package/src/drivers/bun-native-completeness.test.ts +6 -15
  433. package/src/drivers/channel-console.ts +6 -7
  434. package/src/drivers/channel-fcm.ts +20 -30
  435. package/src/drivers/channel-resend.ts +1 -3
  436. package/src/drivers/channel-smtp.ts +2 -6
  437. package/src/drivers/channel-types.ts +2 -12
  438. package/src/drivers/channel-unifonic.ts +2 -6
  439. package/src/drivers/channel-wa-cloud.ts +2 -6
  440. package/src/drivers/channel-webpush.ts +21 -60
  441. package/src/drivers/conformance.test.ts +2 -10
  442. package/src/drivers/conformance.ts +8 -21
  443. package/src/drivers/drizzle-dialect.test.ts +20 -0
  444. package/src/drivers/drizzle-dialect.ts +37 -0
  445. package/src/drivers/fs.ts +2 -8
  446. package/src/drivers/index.ts +12 -57
  447. package/src/drivers/memory.ts +287 -75
  448. package/src/drivers/pgvector.ts +7 -11
  449. package/src/drivers/postgres.ts +7 -13
  450. package/src/drivers/redis.ts +13 -37
  451. package/src/drivers/s3.ts +15 -18
  452. package/src/drivers/signal-engine.ts +12 -49
  453. package/src/drivers/signal-memory.ts +2 -8
  454. package/src/drivers/signal-nats.ts +4 -9
  455. package/src/drivers/signal-postgres.ts +62 -129
  456. package/src/drivers/signal-redis.ts +7 -21
  457. package/src/drivers/signal-types.ts +1 -4
  458. package/src/drivers/sqlite.ts +3 -12
  459. package/src/drivers/types.ts +4 -23
  460. package/src/drivers/vault-driver-removal.test.ts +55 -0
  461. package/src/drivers/vault-env.ts +2 -6
  462. package/src/drivers/vault-infisical.ts +1 -5
  463. package/src/drivers/vault-managed.ts +1 -5
  464. package/src/drivers/vault-memory.ts +1 -5
  465. package/src/drivers/vault-openbao.test.ts +97 -0
  466. package/src/drivers/vault-openbao.ts +103 -40
  467. package/src/drivers/vault-types.ts +3 -16
  468. package/src/elements/ai/declare.ts +4 -14
  469. package/src/elements/ai/eval.ts +2 -6
  470. package/src/elements/ai/pii.ts +1 -3
  471. package/src/elements/ai/runtime.ts +12 -50
  472. package/src/elements/ai/schema.ts +4 -15
  473. package/src/elements/ai.test.ts +13 -24
  474. package/src/elements/ai.ts +1 -5
  475. package/src/elements/channel/consent.ts +3 -12
  476. package/src/elements/channel/costs.ts +4 -15
  477. package/src/elements/channel/declare.ts +1 -4
  478. package/src/elements/channel/email-auth.ts +1 -4
  479. package/src/elements/channel/locale.ts +2 -10
  480. package/src/elements/channel/mask.ts +1 -3
  481. package/src/elements/channel/mime.ts +2 -12
  482. package/src/elements/channel/outcomes.test.ts +1 -5
  483. package/src/elements/channel/outcomes.ts +5 -15
  484. package/src/elements/channel/receipts.ts +2 -7
  485. package/src/elements/channel/runtime.ts +28 -74
  486. package/src/elements/channel/suppression.ts +8 -14
  487. package/src/elements/channel.test.ts +8 -31
  488. package/src/elements/channel.ts +3 -14
  489. package/src/elements/clock/actions.ts +6 -18
  490. package/src/elements/clock/declare.ts +1 -3
  491. package/src/elements/clock/dst.ts +1 -5
  492. package/src/elements/clock/durable.ts +4 -16
  493. package/src/elements/clock/health.ts +2 -7
  494. package/src/elements/clock/leader.ts +2 -9
  495. package/src/elements/clock/reconcile.ts +4 -15
  496. package/src/elements/clock/runtime.ts +2 -5
  497. package/src/elements/clock/schedule.ts +4 -20
  498. package/src/elements/clock.test.ts +2 -7
  499. package/src/elements/clock.ts +5 -23
  500. package/src/elements/gate/permissions.ts +1 -4
  501. package/src/elements/gate/runtime.ts +7 -28
  502. package/src/elements/gate.ts +1 -5
  503. package/src/elements/index.ts +9 -7
  504. package/src/elements/signal/declare.ts +2 -7
  505. package/src/elements/signal/reconcile.test.ts +1 -4
  506. package/src/elements/signal/runtime.ts +1 -3
  507. package/src/elements/signal.test.ts +3 -15
  508. package/src/elements/signal.ts +2 -8
  509. package/src/elements/store/cache.test.ts +46 -0
  510. package/src/elements/store/cache.ts +3 -11
  511. package/src/elements/store/classify.ts +5 -22
  512. package/src/elements/store/declare.ts +11 -17
  513. package/src/elements/store/domain-ddl.test.ts +86 -0
  514. package/src/elements/store/emit-drizzle.ts +363 -0
  515. package/src/elements/store/files-policy.test.ts +1 -5
  516. package/src/elements/store/files-policy.ts +4 -12
  517. package/src/elements/store/load-plugin-tables.ts +103 -0
  518. package/src/elements/store/missing-relation.test.ts +83 -0
  519. package/src/elements/store/missing-relation.ts +38 -0
  520. package/src/elements/store/replica.ts +1 -4
  521. package/src/elements/store/resource-list-docs.fixture.ts +56 -0
  522. package/src/elements/store/resource-list-docs.test.ts +79 -0
  523. package/src/elements/store/resource.test.ts +253 -0
  524. package/src/elements/store/resource.ts +786 -0
  525. package/src/elements/store/runtime.ts +25 -28
  526. package/src/elements/store/schema-decl.test.ts +227 -0
  527. package/src/elements/store/schema-decl.ts +516 -0
  528. package/src/elements/store/sql-condition.test.ts +132 -0
  529. package/src/elements/store/sql-condition.ts +293 -65
  530. package/src/elements/store/sql-session.test.ts +135 -0
  531. package/src/elements/store/sql-session.ts +241 -84
  532. package/src/elements/store/table.ts +69 -23
  533. package/src/elements/store.test.ts +17 -39
  534. package/src/elements/store.ts +53 -31
  535. package/src/elements/vault/chain.ts +34 -0
  536. package/src/elements/vault/declare.ts +22 -32
  537. package/src/elements/vault/fingerprint.ts +2 -7
  538. package/src/elements/vault/redact.ts +2 -6
  539. package/src/elements/vault/runtime.ts +19 -33
  540. package/src/elements/vault.test.ts +12 -55
  541. package/src/elements/vault.ts +9 -13
  542. package/src/index.ts +5 -2
  543. package/src/kernel/adopt-routes.ts +15 -29
  544. package/src/kernel/app.ts +92 -118
  545. package/src/kernel/auth-resolve.ts +2 -9
  546. package/src/kernel/boot-bind/ai.ts +1 -4
  547. package/src/kernel/boot-bind/channel.test.ts +60 -0
  548. package/src/kernel/boot-bind/channel.ts +61 -5
  549. package/src/kernel/boot-bind/clock.ts +2 -6
  550. package/src/kernel/boot-bind/gate.ts +2 -8
  551. package/src/kernel/boot-bind/runs.ts +1 -3
  552. package/src/kernel/boot-bind/signal.ts +3 -10
  553. package/src/kernel/boot-bind/store.test.ts +27 -18
  554. package/src/kernel/boot-bind/store.ts +93 -52
  555. package/src/kernel/boot-bind/vault.ts +2 -8
  556. package/src/kernel/boot.test.ts +4 -10
  557. package/src/kernel/boot.ts +30 -77
  558. package/src/kernel/budget.test.ts +1 -3
  559. package/src/kernel/capability.ts +3 -10
  560. package/src/kernel/dry-run.test.ts +1 -4
  561. package/src/kernel/dry-run.ts +3 -11
  562. package/src/kernel/edge.test.ts +68 -0
  563. package/src/kernel/effects.test.ts +1 -5
  564. package/src/kernel/effects.ts +4 -11
  565. package/src/kernel/errors.registry.test.ts +2 -8
  566. package/src/kernel/errors.ts +23 -32
  567. package/src/kernel/flow.test.ts +12 -25
  568. package/src/kernel/flow.ts +13 -25
  569. package/src/kernel/fx.test.ts +31 -40
  570. package/src/kernel/fx.ts +135 -90
  571. package/src/kernel/hook-timing.test.ts +3 -6
  572. package/src/kernel/hook-timing.ts +5 -14
  573. package/src/kernel/hooks.test.ts +43 -10
  574. package/src/kernel/hooks.ts +25 -12
  575. package/src/kernel/index.ts +11 -17
  576. package/src/kernel/journal.ts +7 -31
  577. package/src/kernel/on.ts +45 -9
  578. package/src/kernel/pipeline.test.ts +10 -19
  579. package/src/kernel/pipeline.ts +5 -17
  580. package/src/kernel/plug.ts +4 -11
  581. package/src/kernel/plugin/conflicts.test.ts +13 -25
  582. package/src/kernel/plugin/decorate.test.ts +8 -13
  583. package/src/kernel/plugin/scoping.test.ts +4 -11
  584. package/src/kernel/plugin.ts +81 -27
  585. package/src/kernel/registry-isolation.test.ts +74 -0
  586. package/src/kernel/registry.ts +102 -30
  587. package/src/kernel/router.test.ts +15 -13
  588. package/src/kernel/router.ts +9 -29
  589. package/src/kernel/routing-budget.test.ts +1 -3
  590. package/src/kernel/run-telemetry.ts +1 -3
  591. package/src/kernel/triggers.ts +63 -21
  592. package/src/manifest/diff.test.ts +26 -91
  593. package/src/manifest/diff.ts +95 -225
  594. package/src/manifest/fixtures/skyport.excerpt.json +1 -1
  595. package/src/manifest/fixtures/skyport.manifest.json +1 -1
  596. package/src/manifest/index.ts +3 -10
  597. package/src/manifest/types.ts +30 -6
  598. package/src/manifest/undeclared.test.ts +4 -12
  599. package/src/manifest/undeclared.ts +1 -2
  600. package/src/manifest/validate.test.ts +2 -6
  601. package/src/manifest/validate.ts +5 -15
  602. package/src/mcp/authorization.ts +8 -27
  603. package/src/mcp/confirmation.ts +3 -10
  604. package/src/mcp/data.ts +2 -6
  605. package/src/mcp/docs-index.ts +4 -7
  606. package/src/mcp/docs-mcp.test.ts +3 -12
  607. package/src/mcp/docs-server.ts +7 -27
  608. package/src/mcp/docs-tools.ts +2 -6
  609. package/src/mcp/index.ts +1 -6
  610. package/src/mcp/injection.gate.test.ts +4 -18
  611. package/src/mcp/mcp.test.ts +18 -49
  612. package/src/mcp/protocol.ts +3 -10
  613. package/src/mcp/server.ts +11 -52
  614. package/src/mcp/session.ts +4 -14
  615. package/src/mcp/tools.ts +14 -50
  616. package/src/plugins/catalogue.test.ts +3 -7
  617. package/src/plugins/catalogue.ts +1 -3
  618. package/src/plugins/compression.test.ts +127 -0
  619. package/src/plugins/compression.ts +94 -0
  620. package/src/plugins/config-source.test.ts +204 -0
  621. package/src/plugins/config-source.ts +209 -0
  622. package/src/plugins/cors.test.ts +138 -0
  623. package/src/plugins/cors.ts +129 -0
  624. package/src/plugins/csrf.test.ts +102 -0
  625. package/src/plugins/csrf.ts +86 -0
  626. package/src/plugins/headers.ts +54 -0
  627. package/src/plugins/index.ts +26 -0
  628. package/src/plugins/ip-allowlist.test.ts +105 -0
  629. package/src/plugins/ip-allowlist.ts +76 -0
  630. package/src/plugins/maintenance-mode.test.ts +91 -0
  631. package/src/plugins/maintenance-mode.ts +85 -0
  632. package/src/plugins/node-import-scan.ts +2 -5
  633. package/src/plugins/security-headers.test.ts +243 -0
  634. package/src/plugins/security-headers.ts +255 -0
  635. package/src/plugins/supply-chain.ts +5 -17
  636. package/src/release/exports.ts +3 -8
  637. package/src/release/measure.exports.test.ts +1 -3
  638. package/src/release/measure.ts +16 -45
  639. package/src/runs/bench.test.ts +1 -3
  640. package/src/runs/collect.ts +8 -25
  641. package/src/runs/drivers/clickhouse.ts +2 -9
  642. package/src/runs/drivers/files.ts +9 -31
  643. package/src/runs/drivers/memory.ts +5 -22
  644. package/src/runs/drivers/postgres.ts +8 -20
  645. package/src/runs/duckdb.ts +2 -8
  646. package/src/runs/index.ts +3 -14
  647. package/src/runs/outlier.ts +3 -10
  648. package/src/runs/parquet.ts +8 -26
  649. package/src/runs/privacy.ts +2 -8
  650. package/src/runs/runs.test.ts +3 -9
  651. package/src/runs/runtime.ts +7 -32
  652. package/src/runs/shred.ts +10 -29
  653. package/src/runs/types.ts +1 -4
  654. package/src/runtime/bun.ts +4 -15
  655. package/src/runtime/cold-start.bench.ts +1 -3
  656. package/src/runtime/dev-request-log.test.ts +1 -4
  657. package/src/runtime/dev-request-log.ts +1 -4
  658. package/src/runtime/index.ts +1 -6
  659. package/src/runtime/primitives.ts +5 -4
  660. package/src/runtime/security.ts +3 -13
  661. package/src/runtime/serve.test.ts +4 -7
  662. package/src/runtime/types.ts +1 -4
  663. package/src/runtime/web-standard.ts +3 -15
  664. package/src/term.test.ts +4 -6
  665. package/src/term.ts +49 -98
  666. package/src/test/create-test-app.test.ts +4 -14
  667. package/src/test/create-test-app.ts +27 -33
  668. package/src/test/provisions.integration.test.ts +3 -11
  669. package/src/upgrade/codemods.test.ts +25 -6
  670. package/src/upgrade/codemods.ts +116 -3
  671. package/src/validation/standard-schema.test.ts +2 -5
  672. package/src/validation/standard-schema.ts +13 -33
  673. package/docs/spec/console.md +0 -739
  674. package/docs/spec/example.md +0 -1196
  675. package/docs/spec/four-applications.md +0 -1195
  676. package/docs/spec/unified-theory.md +0 -489
  677. package/src/cli/doc-drift.test.ts +0 -146
  678. package/src/cli/doc-drift.ts +0 -430
  679. package/src/cli/doctor-diff-examples.ts +0 -92
  680. package/src/console/ui/dist/assets/panel-vault-BbfWdox0.js +0 -1
  681. package/src/drivers/vault-sops.ts +0 -271
package/package.json CHANGED
@@ -1,39 +1,72 @@
1
1
  {
2
2
  "name": "okengine",
3
- "version": "0.2.6",
3
+ "version": "0.3.2",
4
4
  "description": "One law. Eight elements. Ten exports. One package. One manifest. Every backend need is derived, never added.",
5
5
  "license": "MIT",
6
- "type": "module",
7
- "sideEffects": false,
8
6
  "repository": {
9
7
  "type": "git",
10
8
  "url": "git+https://github.com/omqkhafi/okengine.git"
11
9
  },
10
+ "bin": {
11
+ "oke": "src/cli/index.ts"
12
+ },
12
13
  "workspaces": [
13
14
  "packages/*",
14
- "examples/*",
15
15
  "site"
16
16
  ],
17
+ "files": [
18
+ "src",
19
+ "manifest.v1.schema.json",
20
+ "AGENTS.md",
21
+ "README.md",
22
+ "site/content/docs"
23
+ ],
24
+ "type": "module",
25
+ "sideEffects": false,
26
+ "exports": {
27
+ ".": "./src/index.ts",
28
+ "./client": "./src/client/index.ts",
29
+ "./test": "./src/test/index.ts",
30
+ "./config": "./src/config/index.ts",
31
+ "./auth": "./src/auth/index.ts",
32
+ "./console": "./src/console/index.ts",
33
+ "./mcp": "./src/mcp/index.ts",
34
+ "./plugins": "./src/plugins/index.ts",
35
+ "./store": "./src/elements/store.ts",
36
+ "./signal": "./src/elements/signal.ts",
37
+ "./clock": "./src/elements/clock.ts",
38
+ "./gate": "./src/elements/gate.ts",
39
+ "./vault": "./src/elements/vault.ts",
40
+ "./channel": "./src/elements/channel.ts",
41
+ "./ai": "./src/elements/ai.ts",
42
+ "./runs": "./src/runs/index.ts",
43
+ "./drivers": "./src/drivers/index.ts",
44
+ "./drivers/*": "./src/drivers/*"
45
+ },
17
46
  "scripts": {
18
- "typecheck": "tsc --noEmit",
47
+ "typecheck": "tsc --noEmit && bun run --cwd packages/create-oke typecheck",
48
+ "lint": "oxlint --quiet",
49
+ "lint:fix": "oxlint --fix",
50
+ "fmt": "oxfmt",
51
+ "fmt:check": "oxfmt --check",
19
52
  "test": "bun test --pass-with-no-tests",
20
53
  "test:coverage": "bun test --coverage --pass-with-no-tests",
21
54
  "test:console:smoke": "bunx playwright test tests/console/smoke.spec.ts",
22
- "test:integration": "bun test examples/notes examples/linkly examples/provisions examples/skyport examples/skyport/tests/docker.test.ts && bun run --cwd packages/create-oke typecheck && bun test packages/create-oke/src && CREATE_OKE_INTEGRATION=1 bun test --timeout 180000 packages/create-oke/tests/scaffold.integration.test.ts packages/create-oke/tests/dev.integration.test.ts",
23
55
  "build": "bunx vite build --config src/console/ui/vite.config.ts",
24
56
  "prepack": "bun run build",
25
57
  "bench": "bun test ./src/runtime/cold-start.bench.ts src/client/budget.test.ts src/console/budget.test.ts src/kernel/budget.test.ts src/kernel/routing-budget.test.ts src/runs/bench.test.ts",
26
58
  "budgets": "bun src/release/publish.ts",
27
- "gate": "bun src/cli/doctor-diff-examples.ts && bun test src/kernel/errors.registry.test.ts src/upgrade/codemods.test.ts scripts/publish.gate.test.ts && bun src/cli/doc-drift.ts",
28
- "site:sync": "bun run --cwd site sync",
29
- "site:dev": "bun run --cwd site dev",
59
+ "gate": "bun test src/cli/doc-staleness.test.ts src/drivers/vault-driver-removal.test.ts src/kernel/errors.registry.test.ts src/upgrade/codemods.test.ts",
60
+ "dev": "bun run --cwd site dev",
30
61
  "site:build": "bun run --cwd site build",
31
- "ci": "bun run bench && bun run typecheck && bun run test && bun run budgets && bun run gate && bun run site:build && bun run test:integration",
62
+ "ci:workflow": "bun scripts/ci.ts --workflow",
63
+ "ci": "bun scripts/ci.ts",
32
64
  "bump": "bun run scripts/bump-version.ts",
33
65
  "release": "bun run scripts/publish.ts",
34
66
  "g": "gflows"
35
67
  },
36
68
  "dependencies": {
69
+ "@clack/prompts": "^1.7.0",
37
70
  "@duckdb/node-api": "^1.5.5-r.1",
38
71
  "ajv": "^8.20.0",
39
72
  "ajv-formats": "^3.0.1",
@@ -41,7 +74,6 @@
41
74
  "sently": "^0.8.0"
42
75
  },
43
76
  "devDependencies": {
44
- "age-encryption": "^0.3.0",
45
77
  "@base-ui/react": "^1.6.0",
46
78
  "@codemirror/commands": "^6.10.4",
47
79
  "@codemirror/lang-json": "^6.0.2",
@@ -68,6 +100,9 @@
68
100
  "gflows": "^1.2.1",
69
101
  "happy-dom": "^20.11.1",
70
102
  "mermaid": "^11.16.0",
103
+ "oxfmt": "^0.61.0",
104
+ "oxlint": "^1.76.0",
105
+ "oxlint-tsgolint": "^7.0.2001",
71
106
  "playwright": "^1.62.0",
72
107
  "react": "^19.2.8",
73
108
  "react-dom": "^19.2.8",
@@ -78,16 +113,12 @@
78
113
  "zod": "^4.4.3"
79
114
  },
80
115
  "peerDependencies": {
81
- "age-encryption": "^0.3.0",
82
116
  "drizzle-kit": ">=1.0.0-rc.0",
83
117
  "drizzle-orm": ">=1.0.0-rc.0",
84
118
  "drizzle-seed": ">=0.3.0",
85
119
  "zod": ">=3.23.0"
86
120
  },
87
121
  "peerDependenciesMeta": {
88
- "age-encryption": {
89
- "optional": true
90
- },
91
122
  "drizzle-kit": {
92
123
  "optional": true
93
124
  },
@@ -103,33 +134,5 @@
103
134
  },
104
135
  "engines": {
105
136
  "bun": ">=1.3"
106
- },
107
- "bin": {
108
- "oke": "src/cli/index.ts"
109
- },
110
- "exports": {
111
- ".": "./src/index.ts",
112
- "./client": "./src/client/index.ts",
113
- "./test": "./src/test/index.ts",
114
- "./config": "./src/config/index.ts",
115
- "./auth": "./src/auth/index.ts",
116
- "./console": "./src/console/index.ts",
117
- "./mcp": "./src/mcp/index.ts",
118
- "./store": "./src/elements/store.ts",
119
- "./signal": "./src/elements/signal.ts",
120
- "./clock": "./src/elements/clock.ts",
121
- "./gate": "./src/elements/gate.ts",
122
- "./vault": "./src/elements/vault.ts",
123
- "./channel": "./src/elements/channel.ts",
124
- "./ai": "./src/elements/ai.ts",
125
- "./runs": "./src/runs/index.ts",
126
- "./drivers": "./src/drivers/index.ts",
127
- "./drivers/*": "./src/drivers/*"
128
- },
129
- "files": [
130
- "src",
131
- "spec",
132
- "AGENTS.md",
133
- "docs/spec"
134
- ]
137
+ }
135
138
  }
@@ -0,0 +1,54 @@
1
+ ---
2
+ title: "llms.txt"
3
+ description: "Machine-readable documentation — the index, the full concatenated text, and per-page markdown endpoints this site serves for agents."
4
+ icon: "FileText"
5
+ source: "docs/spec/unified-theory.md"
6
+ ---
7
+
8
+ This documentation site serves machine-readable twins of every page, following the `llms.txt` convention — so an agent can pull exactly the docs it needs (or all of them) instead of scraping HTML. Three endpoints, three granularities:
9
+
10
+ | Endpoint | Contains | Pull it when |
11
+ | ----------------------- | --------------------------------------------------- | --------------------------------------------- |
12
+ | `/llms.txt` | Index of every docs page (title, link, description) | The agent needs the map — what exists, where |
13
+ | `/llms-full.txt` | All pages concatenated as one markdown document | You want the whole docs in one context window |
14
+ | `/llms.mdx/docs/⟨slug⟩` | One page as markdown | The agent needs just the Vault page, say |
15
+
16
+ ## Use them
17
+
18
+ ```bash
19
+ # the map
20
+ curl https://oke.omqkhafi.dev/llms.txt
21
+
22
+ # everything, for stuffing into context
23
+ curl https://oke.omqkhafi.dev/llms-full.txt
24
+
25
+ # one page — e.g. the Vault element
26
+ curl https://oke.omqkhafi.dev/llms.mdx/docs/elements/vault
27
+ ```
28
+
29
+ <Callout title="Which one first?">
30
+ Start with `/llms.txt` — it is small and tells the agent which slugs exist. Fetch `/llms-full.txt`
31
+ only when breadth matters more than tokens; per-page `/llms.mdx` is the precise instrument.
32
+ </Callout>
33
+
34
+ ## How it pairs with the docs MCP
35
+
36
+ These endpoints serve the _published_ docs of the framework. During `oke dev`, the [docs MCP server](/docs/ai/mcp) also runs on :6536 (`oke.docs.search` / `oke.docs.get`), answering from the same content over the MCP protocol — pick the plain HTTP endpoints for one-shot context, the MCP tools when the agent is already connected as a client.
37
+
38
+ ## Learn more
39
+
40
+ - [MCP](/docs/ai/mcp) — runtime and docs MCP servers
41
+ - [Agent contracts](/docs/ai/skills) — teaching agents the vocabulary these pages use
42
+ - [Reference](/docs/reference/configuration) — the most-cited pages for config questions
43
+
44
+ ## Next
45
+
46
+ <Cards>
47
+ <Card title="MCP" description="Runtime :6535 · docs :6536." href="/docs/ai/mcp" />
48
+ <Card
49
+ title="Skills"
50
+ description="AGENTS.md and the shipped agent skills."
51
+ href="/docs/ai/skills"
52
+ />
53
+ <Card title="AI element" description="Models inside your app." href="/docs/elements/ai" />
54
+ </Cards>
@@ -0,0 +1,123 @@
1
+ ---
2
+ title: "MCP"
3
+ description: "The runtime MCP server on :6535 — read tools for Manifest, schemas, effects, and traces, write actions gated by per-call human confirmation — plus the read-only docs MCP on :6536."
4
+ icon: "Plug"
5
+ source: "docs/spec/unified-theory.md"
6
+ ---
7
+
8
+ OKE serves an [MCP](https://modelcontextprotocol.io) endpoint on port **6535** so an AI agent can operate your running app: read its Manifest and traces, and take a small set of safe actions. It speaks JSON-RPC over HTTP (MCP protocol `2024-11-05`), requires a Bearer token **even on localhost**, and never forwards that token upstream — adapters receive structured operator ids instead.
9
+
10
+ <Callout title="The one rule">
11
+ MCP inherits the operator's capability and can never exceed it. Server-level controls alone are
12
+ exactly where the confused-deputy problem lives, so access descends to the tool, the operation,
13
+ and each parameter.
14
+ </Callout>
15
+
16
+ ## Read tools
17
+
18
+ Default-safe — they return inert data envelopes, never live handles:
19
+
20
+ | Tool | Returns | Scope (any of) |
21
+ | ------------------ | ---------------------------------------------- | --------------------------------------------- |
22
+ | `oke.manifest.get` | The current Manifest catalogue | `mcp:manifest:read` · `console:manifest:read` |
23
+ | `oke.schema.get` | In/out/error schemas for one flow (`flowId`) | `mcp:schema:read` · `console:manifest:read` |
24
+ | `oke.effects.get` | Declared effects for one flow (`flowId`) | `mcp:effects:read` · `console:manifest:read` |
25
+ | `oke.traces.list` | Recent runs (`limit` ≤ 200, optional `flowId`) | `mcp:traces:read` · `console:runs:read` |
26
+ | `oke.traces.get` | One run/trace record (`runId`) | `mcp:traces:read` · `console:runs:read` |
27
+
28
+ ## Write tools — confirmed, every single call
29
+
30
+ Two actions are write-class, and each call needs a **fresh, single-use** confirmation — there is no session-level consent cache to leak:
31
+
32
+ | Tool | Does | Scope (any of) |
33
+ | ------------------------------- | ------------------------------------------------------- | ------------------------------------------------------ |
34
+ | `oke.action.invoke` | Invoke a flow by id (sensitive) | `mcp:action:invoke` · `console:flows:invoke` |
35
+ | `oke.action.structural_propose` | Propose a structural diff — reviewable, **not applied** | `mcp:action:structural` · `console:structural:propose` |
36
+
37
+ <Steps>
38
+
39
+ <Step>
40
+ ### Request a confirmation token
41
+
42
+ `oke.action.confirm` with the target `tool`, the exact `args`, and a human `reason` — it returns a single-use token.
43
+
44
+ </Step>
45
+
46
+ <Step>
47
+ ### Call the write tool
48
+
49
+ Pass the token as `confirmToken` plus the phrase `CONFIRM` in `confirmation`. Token, phrase, args, and principal must all match what was confirmed.
50
+
51
+ </Step>
52
+
53
+ <Step>
54
+ ### The token dies
55
+
56
+ Consumed tokens cannot be replayed; the next write needs a new confirmation. A mismatch fails with `write tool requires fresh human confirmation` and the `confirmVia` hint.
57
+
58
+ </Step>
59
+
60
+ </Steps>
61
+
62
+ ## Structural changes arrive as diffs
63
+
64
+ `oke.action.structural_propose` is how an agent suggests a file change: it takes `title`, `relativePath`, and `contents`, and produces a **reviewable diff** for a human — it is never applied to the tree. This is the boundary that lets an agent propose boldly while a human stays the one who merges.
65
+
66
+ ## The security model
67
+
68
+ | Layer | Enforcement |
69
+ | ------------------- | ----------------------------------------------------------- |
70
+ | Authentication | Bearer session token required — even on `127.0.0.1` |
71
+ | Scope inheritance | `console:*` / `mcp:*` expand to every declared tool scope |
72
+ | Per-tool ACL | Each tool declares required scopes + read/write class |
73
+ | Per-parameter rules | `maxLength`, enum allow-lists, forbidden parameters |
74
+ | Token hygiene | Caller token never forwarded — structured operator ids only |
75
+ | Confirmation | Single-use, per call, phrase + token + args bound |
76
+
77
+ ## Docs MCP — a second, docs-only server
78
+
79
+ `oke dev` also boots `okengine-docs-mcp` on port **6536** — the same protocol, but exposing the documentation itself instead of a live Manifest. It is how an agent answers "how do I … in OKE?" from the real pages rather than its training data.
80
+
81
+ | Fact | Value |
82
+ | -------- | -------------------------------------- |
83
+ | Port | `6536` (moves upward when busy) |
84
+ | Auth | None — public documentation, read-only |
85
+ | Endpoint | `POST http://127.0.0.1:6536/mcp` |
86
+ | Health | `GET http://127.0.0.1:6536/health` |
87
+ | Tools | `oke.docs.search` · `oke.docs.get` |
88
+
89
+ ```json
90
+ {
91
+ "mcpServers": {
92
+ "okengine-docs": { "url": "http://127.0.0.1:6536/mcp" }
93
+ }
94
+ }
95
+ ```
96
+
97
+ The docs content ships inside the `okengine` package, so the index your agent searches is exactly the version you have installed. If the surface cannot boot (missing content, busy port), `oke dev` prints `Docs MCP skipped — …` and continues — docs search never takes your dev session down.
98
+
99
+ ## Learn more
100
+
101
+ - [Console · Access](/docs/console/access) — how operator tokens and grants work
102
+ - [Agent contracts](/docs/ai/skills) — what agents are taught about the system they operate
103
+ - [Flow](/docs/elements/flow) — the effects the MCP reads back
104
+
105
+ ## Next
106
+
107
+ <Cards>
108
+ <Card
109
+ title="Skills"
110
+ description="AGENTS.md and the shipped agent skills."
111
+ href="/docs/ai/skills"
112
+ />
113
+ <Card
114
+ title="llms.txt"
115
+ description="Machine-readable documentation surfaces."
116
+ href="/docs/ai/llms-txt"
117
+ />
118
+ <Card
119
+ title="AI element"
120
+ description="Models inside your app — the other direction."
121
+ href="/docs/elements/ai"
122
+ />
123
+ </Cards>
@@ -0,0 +1,5 @@
1
+ {
2
+ "title": "AI Resources",
3
+ "icon": "Bot",
4
+ "pages": ["mcp", "skills", "llms-txt"]
5
+ }
@@ -0,0 +1,53 @@
1
+ ---
2
+ title: "Skills"
3
+ description: "What OKE ships to teach AI agents the system — the repo-level AGENTS.md contract and the installable skills under .agents/skills/."
4
+ icon: "GraduationCap"
5
+ source: "docs/spec/unified-theory.md"
6
+ ---
7
+
8
+ Tools alone don't make a good operator — an agent also needs to know the _vocabulary_: what a Flow is, why `fx` is the only door, which driver ids are legal. OKE ships that knowledge as contracts and skills that agents load automatically, so sessions start aligned instead of drifting and getting corrected.
9
+
10
+ ## The three layers
11
+
12
+ | Layer | Path | Loaded when | Teaches |
13
+ | ------------------ | -------------------------- | ------------------------------------------------- | --------------------------------------------------------------------- |
14
+ | **Agent contract** | `AGENTS.md` (repo root) | Every agent session, automatically | The one law, eight elements, ten exports, the fx rule, ports, budgets |
15
+ | **Element skill** | `.agents/skills/oke/` | Building or changing an okengine app | The element contract in depth — declaration patterns per element |
16
+ | **Docs skill** | `.agents/skills/oke-docs/` | Writing or editing docs under `site/content/docs` | The documentation information-architecture standard and its gates |
17
+
18
+ ## AGENTS.md — the root contract
19
+
20
+ Every OKE app's repo carries an `AGENTS.md` that agents (Cursor, Claude Code, and peers) read at session start. It is deliberately short and absolute: every backend behavior is a Flow (`on(Trigger) → Effects`), there are eight elements and ten exports, all world access goes through `fx`, drivers are named after protocols, and the ports/budgets are fixed. Its closing rule is the one that keeps agents honest: **if the documentation is silent, stop and ask** — never invent the API.
21
+
22
+ ## Skills — installable know-how
23
+
24
+ Skills are `SKILL.md` packages an agent loads when the work matches their description. The two OKE ships:
25
+
26
+ | Skill | Use it for | Inside |
27
+ | ---------- | ----------------------------------- | --------------------------------------------------------- |
28
+ | `oke` | App work — flows, elements, drivers | The agent contract, element patterns, the fx invariants |
29
+ | `oke-docs` | Docs work — new pages, rewrites | The page skeleton, verification sources, the density gate |
30
+
31
+ Both live in the repo under `.agents/skills/`, so they travel with the code and stay versioned with what they describe.
32
+
33
+ ## How contracts compose with MCP
34
+
35
+ Contracts teach the _vocabulary_; [MCP](/docs/ai/mcp) grants the _hands_. An agent that knows the eight elements from `AGENTS.md` reads the Manifest through `oke.manifest.get` with the right mental model — and its write attempts still pass through [per-call human confirmation](/docs/ai/mcp), because knowing the system is not the same as being trusted by it.
36
+
37
+ ## Learn more
38
+
39
+ - [MCP](/docs/ai/mcp) — the runtime surface these contracts pair with
40
+ - [Introduction](/docs/get-started/introduction) — the eight elements in human terms
41
+ - [llms.txt](/docs/ai/llms-txt) — feeding an agent the docs themselves
42
+
43
+ ## Next
44
+
45
+ <Cards>
46
+ <Card
47
+ title="llms.txt"
48
+ description="Machine-readable documentation surfaces."
49
+ href="/docs/ai/llms-txt"
50
+ />
51
+ <Card title="MCP" description="Runtime server :6535." href="/docs/ai/mcp" />
52
+ <Card title="AI element" description="Models inside your app." href="/docs/elements/ai" />
53
+ </Cards>
@@ -0,0 +1,29 @@
1
+ ---
2
+ title: "Access"
3
+ description: "Identities, roles, API keys."
4
+ icon: "Users"
5
+ source: "docs/spec/console.md"
6
+ ---
7
+
8
+ Answers: **identities, roles, API keys**
9
+
10
+ <Callout title="Governing rule">
11
+ Granting an application scope to an operator is impossible in the UI — taught by absence, not
12
+ refusal.
13
+ </Callout>
14
+
15
+ ## What this panel shows
16
+
17
+ <Cards>
18
+ <Card title="Two planes" description="Operators and application users never mix." />
19
+ <Card title="Key creation" description="Value shown once; attenuation to creator scopes only." />
20
+ <Card title="Revocation" description="Blast radius plus honest JWT validity delay." />
21
+ <Card title="Hygiene" description="Unused keys, never-signed-in operators, expired invites." />
22
+ </Cards>
23
+
24
+ ## Catalog
25
+
26
+ <Cards>
27
+ <Card title="Dev" description="✓" />
28
+ <Card title="Prod" description="✓ (admin)" />
29
+ </Cards>
@@ -0,0 +1,35 @@
1
+ ---
2
+ title: "AI"
3
+ description: "Prompt versions, eval scores, cost, agent runs."
4
+ icon: "Sparkles"
5
+ source: "docs/spec/console.md"
6
+ ---
7
+
8
+ Answers: **prompt versions, eval scores, cost, agent runs**
9
+
10
+ <Callout title="Governing rule">
11
+ Everything else in the Console is deterministic; this panel is built on distributions, not single
12
+ values.
13
+ </Callout>
14
+
15
+ ## What this panel shows
16
+
17
+ <Cards>
18
+ <Card title="Prompt versions" description="A version bump is Manifest Diff blast radius." />
19
+ <Card title="Eval + shape" description="Schema-validation failure is its own class." />
20
+ <Card
21
+ title="Agent tools"
22
+ description="Tools are the app’s own flows — undeclared reach is denied and shown."
23
+ />
24
+ <Card
25
+ title="Budgets"
26
+ description="Cost, semantic cache, and `allowPii` as standing review surfaces."
27
+ />
28
+ </Cards>
29
+
30
+ ## Catalog
31
+
32
+ <Cards>
33
+ <Card title="Dev" description="full" />
34
+ <Card title="Prod" description="read + budgets" />
35
+ </Cards>
@@ -0,0 +1,35 @@
1
+ ---
2
+ title: "Architecture"
3
+ description: "How it all connects — the diagram that is the code."
4
+ icon: "Network"
5
+ source: "docs/spec/console.md"
6
+ ---
7
+
8
+ Answers: **how it all connects — the diagram that _is_ the code**
9
+
10
+ <Callout title="Governing rule">
11
+ Flows answers “which one”; Architecture answers “what shape”. Never shows the whole system by
12
+ default.
13
+ </Callout>
14
+
15
+ ## What this panel shows
16
+
17
+ <Cards>
18
+ <Card title="Unit clusters" description="Default aggregated edges; focus one or two hops." />
19
+ <Card title="Element layers" description="Toggle data, messaging, time, external edges." />
20
+ <Card
21
+ title="Live traffic"
22
+ description="Edge thickness from real traffic; dashed = never traversed."
23
+ />
24
+ <Card
25
+ title="Pathologies"
26
+ description="Cycles, god nodes, orphan signals, SPOFs — computed from the graph."
27
+ />
28
+ </Cards>
29
+
30
+ ## Catalog
31
+
32
+ <Cards>
33
+ <Card title="Dev" description="✓" />
34
+ <Card title="Prod" description="✓" />
35
+ </Cards>
@@ -0,0 +1,37 @@
1
+ ---
2
+ title: "Channels"
3
+ description: "Templates, delivery receipts, bounces, opt-outs."
4
+ icon: "Mailbox"
5
+ source: "docs/spec/console.md"
6
+ ---
7
+
8
+ Answers: **templates, delivery receipts, bounces, opt-outs, deliverability (SPF/DKIM/DMARC)**
9
+
10
+ <Callout title="Governing rule">
11
+ Suppression is not failure — the taxonomy of “did not arrive” has seven states with verdicts.
12
+ </Callout>
13
+
14
+ ## What this panel shows
15
+
16
+ <Cards>
17
+ <Card title="Dev inbox" description="`console` driver lands every medium locally." />
18
+ <Card
19
+ title="Deliverability"
20
+ description="SPF/DKIM/DMARC, bounces, complaints, suppression list."
21
+ />
22
+ <Card
23
+ title="Fallback chains"
24
+ description="Recorded as chains (e.g. WhatsApp → SMS), not single outcomes."
25
+ />
26
+ <Card
27
+ title="Locale previews"
28
+ description="Template data bound to schema; RTL-accurate previews."
29
+ />
30
+ </Cards>
31
+
32
+ ## Catalog
33
+
34
+ <Cards>
35
+ <Card title="Dev" description="full + console inbox" />
36
+ <Card title="Prod" description="send test, inspect delivery" />
37
+ </Cards>
@@ -0,0 +1,31 @@
1
+ ---
2
+ title: "Clock"
3
+ description: "Upcoming crons, sleeping durable flows, journal."
4
+ icon: "Clock"
5
+ source: "docs/spec/console.md"
6
+ ---
7
+
8
+ Answers: **upcoming crons, sleeping durable flows, journal**
9
+
10
+ <Callout title="Governing rule">
11
+ Looks like time — a forward timeline for schedules and pending wakes, not a flat grid.
12
+ </Callout>
13
+
14
+ ## What this panel shows
15
+
16
+ <Cards>
17
+ <Card
18
+ title="Schedules"
19
+ description="Recurring crons with drift, overdue, catch-up, lease holder."
20
+ />
21
+ <Card title="Pending wakes" description="Every sleeping durable flow and when it wakes." />
22
+ <Card title="DST warnings" description="Only when the schedule falls in an ambiguous window." />
23
+ <Card title="Actions" description="Run now, wake early, pause, edit when overridable." />
24
+ </Cards>
25
+
26
+ ## Catalog
27
+
28
+ <Cards>
29
+ <Card title="Dev" description="full" />
30
+ <Card title="Prod" description="trigger/pause; edit if `overridable`" />
31
+ </Cards>
@@ -0,0 +1,31 @@
1
+ ---
2
+ title: "Flows"
3
+ description: "What exists; call it; read its contract."
4
+ icon: "GitBranch"
5
+ source: "docs/spec/console.md"
6
+ ---
7
+
8
+ Answers: **what exists; call it; read its contract**
9
+
10
+ <Callout title="Governing rule">
11
+ Renders the one law as three columns: `Causes ← Flows → Effects` — not a tree.
12
+ </Callout>
13
+
14
+ ## What this panel shows
15
+
16
+ <Cards>
17
+ <Card title="Causes column" description="Triggers and callers — what runs this." />
18
+ <Card title="Flows column" description="Context-adaptive centre with contracts and invoke." />
19
+ <Card title="Effects column" description="What changes — store, signal, channel, AI, vault." />
20
+ <Card
21
+ title="Flow drawer"
22
+ description="Workshop peek/expand — save as bun:test from a real response."
23
+ />
24
+ </Cards>
25
+
26
+ ## Catalog
27
+
28
+ <Cards>
29
+ <Card title="Dev" description="full + source links" />
30
+ <Card title="Prod" description="read + invoke per gates" />
31
+ </Cards>
@@ -0,0 +1,35 @@
1
+ ---
2
+ title: "Gates"
3
+ description: "Permission matrix, rate counters, MFA map."
4
+ icon: "Shield"
5
+ source: "docs/spec/console.md"
6
+ ---
7
+
8
+ Answers: **permission matrix, rate counters, MFA map**
9
+
10
+ <Callout title="Governing rule">
11
+ Refuse the giant roles×permissions matrix as the entry point — inquire from principal or from
12
+ flow.
13
+ </Callout>
14
+
15
+ ## What this panel shows
16
+
17
+ <Cards>
18
+ <Card title="Simulator" description="Gate chain in evaluation order — where a 403 stopped." />
19
+ <Card
20
+ title="Unguarded flows"
21
+ description="Continuous audit: public user-plane flows after deploy."
22
+ />
23
+ <Card title="Deploy diff" description="Permission widening caught from Manifest Diff." />
24
+ <Card
25
+ title="Plane separation"
26
+ description="Operator holding an application scope is a violation."
27
+ />
28
+ </Cards>
29
+
30
+ ## Catalog
31
+
32
+ <Cards>
33
+ <Card title="Dev" description="full" />
34
+ <Card title="Prod" description="limits if `overridable`" />
35
+ </Cards>
@@ -0,0 +1,34 @@
1
+ ---
2
+ title: "Manifest Diff"
3
+ description: "Blast radius of a deploy: new effects, widened permissions."
4
+ icon: "Diff"
5
+ source: "docs/spec/console.md"
6
+ ---
7
+
8
+ Answers: **blast radius of a deploy: new effects, widened permissions**
9
+
10
+ <Callout title="Governing rule">
11
+ Compares meaning rather than lines — behaviour change, sorted by blast radius.
12
+ </Callout>
13
+
14
+ ## What this panel shows
15
+
16
+ <Cards>
17
+ <Card title="Contract breaking" description="Existing clients will fail." />
18
+ <Card
19
+ title="Permission widening"
20
+ description="Attack surface grew — gate removed or scope widened."
21
+ />
22
+ <Card title="Effect widening" description="New write, external effect, or secret read." />
23
+ <Card
24
+ title="CI gate"
25
+ description="Blocks undeclared breaks; intended breaks need `breaking: true`."
26
+ />
27
+ </Cards>
28
+
29
+ ## Catalog
30
+
31
+ <Cards>
32
+ <Card title="Dev" description="✓" />
33
+ <Card title="Prod" description="✓" />
34
+ </Cards>