okengine 0.21.1 → 0.23.0

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 (342) hide show
  1. package/AGENTS.md +11 -4
  2. package/LICENSE +202 -0
  3. package/NOTICE +2 -0
  4. package/README.md +15 -9
  5. package/manifest.v1.schema.json +54 -0
  6. package/package.json +53 -38
  7. package/site/content/docs/ai/mcp.mdx +13 -9
  8. package/site/content/docs/ai/skills.mdx +2 -2
  9. package/site/content/docs/client/calling.mdx +27 -19
  10. package/site/content/docs/client/index.mdx +1 -1
  11. package/site/content/docs/elements/ai/agents.mdx +61 -13
  12. package/site/content/docs/elements/ai/decide.mdx +536 -0
  13. package/site/content/docs/elements/ai/events.mdx +373 -0
  14. package/site/content/docs/elements/ai/index.mdx +9 -3
  15. package/site/content/docs/elements/ai/meta.json +1 -1
  16. package/site/content/docs/elements/ai/prompts.mdx +4 -2
  17. package/site/content/docs/elements/channel/email.mdx +1 -1
  18. package/site/content/docs/elements/channel/index.mdx +1 -1
  19. package/site/content/docs/elements/flow/http.mdx +4 -4
  20. package/site/content/docs/elements/flow/index.mdx +3 -3
  21. package/site/content/docs/elements/flow/meta.json +1 -1
  22. package/site/content/docs/elements/gate/auth.mdx +4 -1
  23. package/site/content/docs/elements/gate/tenancy.mdx +1 -1
  24. package/site/content/docs/elements/store/index.mdx +1 -1
  25. package/site/content/docs/elements/store/kv.mdx +5 -5
  26. package/site/content/docs/elements/vault/rotation.mdx +15 -0
  27. package/site/content/docs/plugins/otp.mdx +31 -31
  28. package/site/content/docs/recipes/dragonfly.mdx +5 -5
  29. package/site/content/docs/recipes/index.mdx +6 -6
  30. package/site/content/docs/recipes/mailpit.mdx +1 -1
  31. package/site/content/docs/recipes/meilisearch.mdx +1 -1
  32. package/site/content/docs/recipes/pgdog.mdx +1 -1
  33. package/site/content/docs/recipes/postgres.mdx +12 -8
  34. package/site/content/docs/recipes/redis.mdx +4 -4
  35. package/site/content/docs/reference/cli.mdx +2 -1
  36. package/site/content/docs/reference/configuration.mdx +11 -9
  37. package/site/content/docs/reference/errors.mdx +12 -2
  38. package/site/content/docs/reference/fx.mdx +35 -21
  39. package/site/content/docs/reference/idempotency.mdx +192 -0
  40. package/site/content/docs/reference/index.mdx +6 -1
  41. package/site/content/docs/reference/meta.json +2 -1
  42. package/site/content/docs/understand/meta.json +1 -1
  43. package/site/content/docs/{elements/flow → understand}/routing.mdx +11 -10
  44. package/site/content/docs/understand/the-architecture.mdx +14 -12
  45. package/site/content/docs/understand/try-it.mdx +3 -3
  46. package/src/auth/api-key-sql.test.ts +44 -0
  47. package/src/auth/api-key-sql.ts +1 -0
  48. package/src/auth/api-keys.ts +30 -12
  49. package/src/auth/config.ts +6 -2
  50. package/src/auth/gate-auth.test.ts +20 -0
  51. package/src/cli/agents-md.test.ts +25 -0
  52. package/src/cli/ask-vault-gaps.test.ts +38 -1
  53. package/src/cli/ask-vault-gaps.ts +35 -2
  54. package/src/cli/competitor-mention-removal.test.ts +3 -3
  55. package/src/cli/decide.ts +174 -0
  56. package/src/cli/decision-lock-watch.test.ts +45 -0
  57. package/src/cli/decision-lock-watch.ts +51 -0
  58. package/src/cli/dev-app-runner.ts +34 -8
  59. package/src/cli/dev-auth-secret.test.ts +49 -0
  60. package/src/cli/dev-auth-secret.ts +49 -0
  61. package/src/cli/dev-hot.test.ts +41 -0
  62. package/src/cli/dev-hot.ts +48 -0
  63. package/src/cli/dev.test.ts +1 -1
  64. package/src/cli/dev.ts +24 -6
  65. package/src/cli/docker-cli.test.ts +1 -1
  66. package/src/cli/eval.ts +142 -1
  67. package/src/cli/index.ts +14 -1
  68. package/src/cli/load-config.images.test.ts +12 -12
  69. package/src/cli/load-config.ts +2 -2
  70. package/src/cli/mcp-from-console.ts +48 -0
  71. package/src/cli/registry.ts +35 -1
  72. package/src/cli/vault-cmd.test.ts +23 -0
  73. package/src/cli/vault-cmd.ts +7 -0
  74. package/src/client/agent.ts +307 -0
  75. package/src/client/create.ts +18 -1
  76. package/src/client/transport.test.ts +245 -0
  77. package/src/client/transport.ts +133 -19
  78. package/src/client/types.ts +29 -3
  79. package/src/client-react/index.ts +7 -1
  80. package/src/client-react/use-agent-run.test.ts +271 -0
  81. package/src/client-react/use-agent-run.ts +193 -0
  82. package/src/compiler/ai-approval.test.ts +36 -0
  83. package/src/compiler/ai-repair.test.ts +22 -0
  84. package/src/compiler/decisions.extract.test.ts +164 -0
  85. package/src/compiler/effects-infer.ts +753 -17
  86. package/src/compiler/extract.test.ts +37 -0
  87. package/src/compiler/extract.ts +381 -24
  88. package/src/compiler/fixtures/skyport.expected.json +24 -0
  89. package/src/compiler/fx-follow.test.ts +164 -0
  90. package/src/compiler/fx-index.ts +399 -0
  91. package/src/compiler/response.ts +35 -2
  92. package/src/config/index.ts +21 -3
  93. package/src/console/server/ai-runs-flows.ts +269 -0
  94. package/src/console/server/ai-runs.test.ts +323 -0
  95. package/src/console/server/ai-runs.ts +562 -0
  96. package/src/console/server/ai.ts +12 -1
  97. package/src/console/server/app.ts +10 -1
  98. package/src/console/server/decisions-flows.ts +157 -0
  99. package/src/console/server/decisions.test.ts +66 -0
  100. package/src/console/server/decisions.ts +229 -0
  101. package/src/console/server/flows-invoke.test.ts +2 -2
  102. package/src/console/server/flows.ts +50 -2
  103. package/src/console/server/invoke-user-flow.ts +9 -0
  104. package/src/console/server/runs-ingest.ts +16 -0
  105. package/src/console/server/serve.ts +5 -0
  106. package/src/console/server/state.ts +25 -1
  107. package/src/console/server/store-stats.test.ts +47 -0
  108. package/src/console/server/store-stats.ts +92 -18
  109. package/src/console/ui-next/dist/assets/access-page-DDKkhT9v.js +4 -0
  110. package/src/console/ui-next/dist/assets/agent-disclosure-62Xts8Xi.js +1 -0
  111. package/src/console/ui-next/dist/assets/{cache-glyph-92uM5MO7.js → cache-glyph-DyeoKHKA.js} +1 -1
  112. package/src/console/ui-next/dist/assets/{call-pii-button-DtGVPtcs.js → call-pii-button-DvfpLXsU.js} +1 -1
  113. package/src/console/ui-next/dist/assets/{collapsible-DN7l6zmC.js → collapsible-BY03SeCg.js} +1 -1
  114. package/src/console/ui-next/dist/assets/confirm-sheet-DZfuJXP4.js +1 -0
  115. package/src/console/ui-next/dist/assets/copy-inline-button-BTjPVjRT.js +1 -0
  116. package/src/console/ui-next/dist/assets/decisions-page-CgkKlA56.js +1 -0
  117. package/src/console/ui-next/dist/assets/detail-header-Dk5LipF6.js +1 -0
  118. package/src/console/ui-next/dist/assets/dropdown-menu-CRGrj5JU.js +1 -0
  119. package/src/console/ui-next/dist/assets/duration-tone-Y6HLjyJ5.js +9 -0
  120. package/src/console/ui-next/dist/assets/element-icons-C6t8Vlml.js +1 -0
  121. package/src/console/ui-next/dist/assets/explorer-chrome-Dslh2yE8.js +1 -0
  122. package/src/console/ui-next/dist/assets/explorer-empty-CIVg7Jgb.js +1 -0
  123. package/src/console/ui-next/dist/assets/flows-page-DLPfNy-_.js +1 -0
  124. package/src/console/ui-next/dist/assets/{highlighted-json-BlAEVgNW.js → highlighted-json-D7nNzpgB.js} +1 -1
  125. package/src/console/ui-next/dist/assets/{http-method-BDf7OAHv.js → http-method-DdL19zzh.js} +1 -1
  126. package/src/console/ui-next/dist/assets/index-BlrN49Hs.css +2 -0
  127. package/src/console/ui-next/dist/assets/index-C0lc_s9d.js +58 -0
  128. package/src/console/ui-next/dist/assets/observability-page-CRlcyLCC.js +8 -0
  129. package/src/console/ui-next/dist/assets/{replica-lag-B3GLNVfF.js → replica-lag-Bb3FWUu9.js} +7 -7
  130. package/src/console/ui-next/dist/assets/request-meta-DYBMWhX8.js +1 -0
  131. package/src/console/ui-next/dist/assets/shortcut-keys-DTE1sjTC.js +1 -0
  132. package/src/console/ui-next/dist/assets/store-page-CcE-SXC8.js +41 -0
  133. package/src/console/ui-next/dist/assets/trace-detail-sheet-CKMSEQ4s.js +2 -0
  134. package/src/console/ui-next/dist/assets/tree-expand-toggle-QOfk0M0H.js +55 -0
  135. package/src/console/ui-next/dist/assets/units-page-DKC1CDDd.js +1 -0
  136. package/src/console/ui-next/dist/assets/use-vault-list-BAyQG8Re.js +1 -0
  137. package/src/console/ui-next/dist/assets/vault-page-B54v4Yit.js +2 -0
  138. package/src/console/ui-next/dist/index.html +4 -3
  139. package/src/console/ui-next/seed-parked-approval.ts +126 -0
  140. package/src/console/ui-next/src/client.ts +224 -1
  141. package/src/console/ui-next/src/components/explorer/detail-header.tsx +9 -0
  142. package/src/console/ui-next/src/components/explorer/explorer-start-toggle.tsx +5 -1
  143. package/src/console/ui-next/src/components/ui/sheet-form.tsx +21 -12
  144. package/src/console/ui-next/src/features/flows/decisions/decisions-page.tsx +216 -0
  145. package/src/console/ui-next/src/features/flows/decisions/resolve.test.ts +48 -0
  146. package/src/console/ui-next/src/features/flows/decisions/resolve.ts +111 -0
  147. package/src/console/ui-next/src/features/flows/flows-page.tsx +10 -0
  148. package/src/console/ui-next/src/features/flows/graph/element-map.ts +1 -0
  149. package/src/console/ui-next/src/features/flows/traces/effect-kind.ts +6 -0
  150. package/src/console/ui-next/src/features/flows/traces/effect-summary.test.ts +24 -0
  151. package/src/console/ui-next/src/features/flows/traces/effect-summary.ts +24 -0
  152. package/src/console/ui-next/src/features/flows/traces/http-status.ts +58 -0
  153. package/src/console/ui-next/src/features/flows/traces/request-client-card.tsx +355 -0
  154. package/src/console/ui-next/src/features/flows/traces/request-client.test.ts +114 -0
  155. package/src/console/ui-next/src/features/flows/traces/request-client.ts +423 -0
  156. package/src/console/ui-next/src/features/flows/traces/request-input-view.test.ts +52 -6
  157. package/src/console/ui-next/src/features/flows/traces/request-input-view.ts +85 -19
  158. package/src/console/ui-next/src/features/flows/traces/trace-detail-sheet.tsx +505 -80
  159. package/src/console/ui-next/src/features/flows/traces/trace-lanes.test.ts +61 -0
  160. package/src/console/ui-next/src/features/flows/traces/trace-lanes.ts +78 -0
  161. package/src/console/ui-next/src/features/flows/traces/trace-nav.test.ts +48 -0
  162. package/src/console/ui-next/src/features/flows/traces/trace-nav.ts +57 -0
  163. package/src/console/ui-next/src/features/flows/traces/trace-request-section.tsx +275 -96
  164. package/src/console/ui-next/src/features/flows/traces/traces-pane.tsx +16 -2
  165. package/src/console/ui-next/src/features/observability/detail/ai-runs.tsx +369 -0
  166. package/src/console/ui-next/src/features/observability/observability-page.tsx +31 -1
  167. package/src/console/ui-next/src/features/observability/state/observability-selection.ts +18 -3
  168. package/src/console/ui-next/src/features/store/performance/kv-performance-panel.tsx +12 -1
  169. package/src/console/ui-next/src/features/store/performance/performance-panel.tsx +14 -1
  170. package/src/console/ui-next/src/features/units/call/call-api-panel.tsx +1 -1
  171. package/src/console/ui-next/src/features/units/detail/flow-contract-panel.tsx +15 -2
  172. package/src/console/ui-next/src/features/units/explorer/units-tree.tsx +73 -18
  173. package/src/console/ui-next/src/features/units/lib/unit-tree.test.ts +21 -0
  174. package/src/console/ui-next/src/features/units/lib/unit-tree.ts +82 -0
  175. package/src/console/ui-next/src/features/units/units-page.tsx +25 -7
  176. package/src/console/ui-next/src/router.tsx +17 -0
  177. package/src/console/ui-next/ui-next-seed-runs.ts +23 -0
  178. package/src/console/ui-next/vite-console-kernel-plugin.ts +43 -3
  179. package/src/console/ui-next/vite.config.ts +9 -0
  180. package/src/docker/docker.test.ts +13 -13
  181. package/src/docker/images-config.test.ts +12 -12
  182. package/src/docker/recipes/dragonfly.ts +3 -2
  183. package/src/docker/recipes/redis.ts +1 -1
  184. package/src/docker/stack-id.test.ts +1 -1
  185. package/src/drivers/ai-anthropic.ts +212 -21
  186. package/src/drivers/ai-mock.ts +34 -1
  187. package/src/drivers/ai-openai-compatible.ts +67 -26
  188. package/src/drivers/ai-preconnect.ts +18 -0
  189. package/src/drivers/ai-stream.test.ts +62 -0
  190. package/src/drivers/ai-types.ts +20 -0
  191. package/src/drivers/journal-postgres.ts +455 -3
  192. package/src/drivers/meilisearch.ts +2 -0
  193. package/src/drivers/memory-ddl.test.ts +18 -0
  194. package/src/drivers/memory.ts +21 -1
  195. package/src/drivers/pg-rls.test.ts +31 -0
  196. package/src/drivers/pg-rls.ts +15 -0
  197. package/src/drivers/postgres.test.ts +9 -0
  198. package/src/drivers/postgres.ts +49 -11
  199. package/src/drivers/vault-builtin.test.ts +10 -0
  200. package/src/drivers/vault-builtin.ts +13 -1
  201. package/src/drivers/vault-remote-bag.ts +5 -1
  202. package/src/drivers/vault-types.ts +6 -1
  203. package/src/elements/ai/agent-event-slot.ts +27 -0
  204. package/src/elements/ai/approval-http.ts +207 -0
  205. package/src/elements/ai/approval.test.ts +741 -0
  206. package/src/elements/ai/approval.ts +228 -0
  207. package/src/elements/ai/decisions/bind.ts +163 -0
  208. package/src/elements/ai/decisions/certificate.test.ts +291 -0
  209. package/src/elements/ai/decisions/certificate.ts +377 -0
  210. package/src/elements/ai/decisions/certify.ts +314 -0
  211. package/src/elements/ai/decisions/decide.test.ts +953 -0
  212. package/src/elements/ai/decisions/e2e.test.ts +399 -0
  213. package/src/elements/ai/decisions/export.test.ts +120 -0
  214. package/src/elements/ai/decisions/export.ts +146 -0
  215. package/src/elements/ai/decisions/fixtures/openrouter-request.json +24 -0
  216. package/src/elements/ai/decisions/fixtures/openrouter-response.json +22 -0
  217. package/src/elements/ai/decisions/fixtures/typesafe-request.json +19 -0
  218. package/src/elements/ai/decisions/fixtures/typesafe-response.json +13 -0
  219. package/src/elements/ai/decisions/http.test.ts +154 -0
  220. package/src/elements/ai/decisions/http.ts +240 -0
  221. package/src/elements/ai/decisions/labels.test.ts +282 -0
  222. package/src/elements/ai/decisions/labels.ts +257 -0
  223. package/src/elements/ai/decisions/openrouter.live.test.ts +136 -0
  224. package/src/elements/ai/decisions/openrouter.ts +36 -0
  225. package/src/elements/ai/decisions/provider.ts +102 -0
  226. package/src/elements/ai/decisions/typesafe.ts +36 -0
  227. package/src/elements/ai/declare.ts +252 -1
  228. package/src/elements/ai/events.test.ts +379 -0
  229. package/src/elements/ai/events.ts +138 -0
  230. package/src/elements/ai/run-events.test.ts +461 -0
  231. package/src/elements/ai/run-events.ts +522 -0
  232. package/src/elements/ai/runtime.ts +1186 -105
  233. package/src/elements/ai/stream-turn.ts +214 -0
  234. package/src/elements/ai/stream.live.test.ts +76 -0
  235. package/src/elements/ai/subagent.test.ts +136 -0
  236. package/src/elements/ai.test.ts +497 -3
  237. package/src/elements/ai.ts +16 -1
  238. package/src/elements/clock/durable.ts +27 -1
  239. package/src/elements/store/emit-drizzle.ts +2 -2
  240. package/src/elements/store/live-default.test.ts +2 -0
  241. package/src/elements/store/live-http.test.ts +1 -0
  242. package/src/elements/store/resource-list-docs.test.ts +2 -2
  243. package/src/elements/store/resource.test.ts +3 -3
  244. package/src/elements/store/schema-decl.test.ts +1 -0
  245. package/src/elements/store/sql-condition.ts +24 -7
  246. package/src/elements/store/sql-session.test.ts +51 -0
  247. package/src/elements/store/sql-session.ts +111 -1
  248. package/src/elements/store/upsert-app.test.ts +1 -1
  249. package/src/elements/vault/audit.test.ts +137 -0
  250. package/src/elements/vault/audit.ts +106 -13
  251. package/src/elements/vault/boot-chain.ts +9 -1
  252. package/src/elements/vault/builtin-adapter.ts +33 -3
  253. package/src/i18n/catalogs/ar.ts +9 -0
  254. package/src/i18n/catalogs/en.ts +9 -0
  255. package/src/index.ts +2 -0
  256. package/src/kernel/abort-scope.ts +33 -2
  257. package/src/kernel/agent-event-store.ts +448 -0
  258. package/src/kernel/app.ts +294 -19
  259. package/src/kernel/auto-cache.test.ts +6 -6
  260. package/src/kernel/boot-bind/ai.ts +3 -0
  261. package/src/kernel/boot-bind/store.test.ts +26 -0
  262. package/src/kernel/boot-bind/store.ts +82 -6
  263. package/src/kernel/boot-bind/vault.ts +1 -0
  264. package/src/kernel/boot.ts +34 -5
  265. package/src/kernel/builtin-errors.ts +10 -0
  266. package/src/kernel/capability.ts +3 -0
  267. package/src/kernel/client-descriptor.ts +1 -0
  268. package/src/kernel/concurrency.test.ts +33 -0
  269. package/src/kernel/decision-label-store.ts +441 -0
  270. package/src/kernel/effects-stamping.test.ts +2 -2
  271. package/src/kernel/effects.test.ts +2 -1
  272. package/src/kernel/effects.ts +13 -1
  273. package/src/kernel/element-registries.ts +3 -0
  274. package/src/kernel/errors-compiler.ts +20 -0
  275. package/src/kernel/errors-text.ts +4 -0
  276. package/src/kernel/errors.ts +2 -0
  277. package/src/kernel/external-effects.test.ts +36 -0
  278. package/src/kernel/flow.test.ts +2 -3
  279. package/src/kernel/flow.ts +24 -0
  280. package/src/kernel/fx-decide.ts +761 -0
  281. package/src/kernel/fx-fetch.ts +5 -1
  282. package/src/kernel/fx.test.ts +12 -5
  283. package/src/kernel/fx.ts +316 -29
  284. package/src/kernel/http-frame.test.ts +94 -0
  285. package/src/kernel/http-frame.ts +203 -0
  286. package/src/kernel/idempotency-store.ts +578 -0
  287. package/src/kernel/idempotency.test.ts +556 -0
  288. package/src/kernel/idempotency.ts +304 -0
  289. package/src/kernel/index.ts +1 -0
  290. package/src/kernel/journal.ts +160 -0
  291. package/src/kernel/json-result.ts +10 -0
  292. package/src/kernel/pipeline.test.ts +45 -0
  293. package/src/kernel/sse-id.ts +32 -0
  294. package/src/manifest/diff.ts +1 -0
  295. package/src/manifest/types.ts +37 -2
  296. package/src/mcp/ai-tools.test.ts +202 -0
  297. package/src/mcp/authorization.ts +66 -0
  298. package/src/mcp/session.ts +3 -0
  299. package/src/mcp/tools.ts +168 -0
  300. package/src/plugins/auth-delivery.mailpit.integration.test.ts +1 -1
  301. package/src/plugins/otp.test.ts +65 -1
  302. package/src/plugins/otp.ts +59 -7
  303. package/src/release/absolute-regression.test.ts +63 -0
  304. package/src/release/http-graph.test.ts +27 -0
  305. package/src/release/http-graph.ts +95 -0
  306. package/src/release/index.ts +3 -0
  307. package/src/release/limits.ts +17 -2
  308. package/src/release/measure.ts +144 -28
  309. package/src/runs/collect.ts +4 -1
  310. package/src/runs/parquet.test.ts +27 -1
  311. package/src/runs/parquet.ts +19 -0
  312. package/src/runs/types.ts +31 -0
  313. package/src/runtime/json-code-block.test.ts +106 -47
  314. package/src/runtime/json-code-block.ts +1209 -46
  315. package/src/term.test.ts +13 -0
  316. package/src/term.ts +81 -49
  317. package/src/test/create-test-app.test.ts +3 -1
  318. package/src/test/create-test-app.ts +40 -0
  319. package/src/test/live-signals.test.ts +1 -0
  320. package/src/test/provisions.integration.test.ts +1 -0
  321. package/src/test/tenant-isolation.test.ts +1 -0
  322. package/src/console/ui-next/dist/assets/PlusSignIcon-CwG3nxfu.js +0 -1
  323. package/src/console/ui-next/dist/assets/access-page-Bgt9bq2r.js +0 -4
  324. package/src/console/ui-next/dist/assets/agent-disclosure-B43CXZZR.js +0 -1
  325. package/src/console/ui-next/dist/assets/copy-inline-button-CAYD18cr.js +0 -1
  326. package/src/console/ui-next/dist/assets/detail-header-DVWNjWjg.js +0 -1
  327. package/src/console/ui-next/dist/assets/dropdown-menu-4h2LOVXM.js +0 -1
  328. package/src/console/ui-next/dist/assets/duration-tone-BmIR9FV8.js +0 -9
  329. package/src/console/ui-next/dist/assets/element-icons-BI8cJgdh.js +0 -1
  330. package/src/console/ui-next/dist/assets/explorer-empty-CJs5A-wm.js +0 -1
  331. package/src/console/ui-next/dist/assets/flows-page-BMHs-IzK.js +0 -1
  332. package/src/console/ui-next/dist/assets/index-BKpaes3n.js +0 -63
  333. package/src/console/ui-next/dist/assets/index-VxoEz295.css +0 -2
  334. package/src/console/ui-next/dist/assets/observability-page-WnVLI-0j.js +0 -4
  335. package/src/console/ui-next/dist/assets/request-meta-DMbnAe3f.js +0 -1
  336. package/src/console/ui-next/dist/assets/shortcut-keys-3ILd8oGn.js +0 -1
  337. package/src/console/ui-next/dist/assets/store-page-KvFDingJ.js +0 -41
  338. package/src/console/ui-next/dist/assets/trace-detail-sheet-Htk8Cm9t.js +0 -2
  339. package/src/console/ui-next/dist/assets/tree-expand-toggle-CFMPWX4f.js +0 -55
  340. package/src/console/ui-next/dist/assets/units-page-C4NdNuxP.js +0 -1
  341. package/src/console/ui-next/dist/assets/use-vault-list-CT4-gajj.js +0 -1
  342. package/src/console/ui-next/dist/assets/vault-page-CBYl0LW_.js +0 -2
package/AGENTS.md CHANGED
@@ -55,6 +55,13 @@ We build only what genuinely does not exist: the effect system, the Manifest and
55
55
 
56
56
  A direct `node:` import (or any other side-channel I/O) in element or flow code is a **defect**. `fx` is the single door to the outside world; effects are inferred from what a Flow touches through it. Deterministic tests, least privilege, cache invalidation, live queries, and durability all depend on this invariant.
57
57
 
58
+ ## AI
59
+
60
+ - `fx.ask` runs a prompt (repair, budgets). `fx.run` runs an agent (`maxSteps`, `maxCostPerRun`, `stopReason`). `fx.decide` runs a decision.
61
+ - A tool with `approval` requires `durable: true`. Resolve it in the Console or on the approval routes. Do not resolve it from MCP.
62
+ - Stream with `return fx.json.stream(fx.run(agent, input, { stream: true }))`. Follow with `GET /agent/runs/:runId/events` (`Last-Event-ID`). Client: `okengine/client/agent`. React: `useAgentRun`.
63
+ - `fx.decide` takes exactly one of `review` or `onUncertain: "abstain"`. Review only inside a durable non-HTTP Flow (emit to a consumer). Autonomy needs `{ maxError, audit }` and comes only from `oke-decisions.lock.json` (`oke eval --certify` / `oke decide promote`).
64
+
58
65
  ## Ports
59
66
 
60
67
  | Port | Surface |
@@ -71,13 +78,13 @@ Mnemonic: O·K·E = 6·5·3.
71
78
  | Budget | Limit |
72
79
  | --------------------- | ------- |
73
80
  | Kernel (edge profile) | < 17 kB |
74
- | Client runtime | < 5 kB |
81
+ | Client runtime | < 6 kB |
75
82
  | Cold start on Bun | < 75 ms |
76
83
  | p99 routing overhead | < 1 ms |
77
84
 
78
- A regression fails the build. Claims we cannot measure, we do not make.
85
+ A regression fails the build. An absolute sample that can still double and stay under its cap (cold start today) also fails at 2× the last committed value. Claims we cannot measure, we do not make.
79
86
 
80
- After changing `src/kernel/`, `src/client/`, `src/compiler/`, `src/validation/`, or `src/release/limits.ts` / `measure.ts`, run `bun run budgets:core` (kernel edge + client gzip) before claiming done. Do not raise the published 17 kB / 5 kB caps without a measured before/after and an Unreleased changelog note; prefer lazy-loading off the edge graph.
87
+ After changing `src/kernel/`, `src/client/`, `src/compiler/`, `src/validation/`, or `src/release/limits.ts` / `measure.ts`, run `bun run budgets:core` (kernel edge + client gzip) before claiming done. Do not raise the published 17 kB / 6 kB caps without a measured before/after and an Unreleased changelog note; prefer lazy-loading off the edge graph.
81
88
 
82
89
  ## Package shape
83
90
 
@@ -103,7 +110,7 @@ Engine: Bun `>=1.4.2`.
103
110
 
104
111
  ## After every implementation
105
112
 
106
- Before claiming work done: run [`.agents/skills/oke-ship`](.agents/skills/oke-ship/SKILL.md) — append notes to `changelog.md` under `## Unreleased` (never under a shipped `## v…` section), and update site docs via [`.agents/skills/oke-docs`](.agents/skills/oke-docs/SKILL.md) for any user-facing surface. Version bump is separate: `bun run bump` promotes Unreleased into the next `## vX.Y.Z`.
113
+ Before claiming work done: run [`.agents/skills/oke-ship`](.agents/skills/oke-ship/SKILL.md) — append notes to `changelog.md` under `## Unreleased` (never under a shipped `## v…` section), and update site docs via [`.agents/skills/oke-docs`](.agents/skills/oke-docs/SKILL.md) for any user-facing surface. Version bump is separate: `bun run bump` promotes Unreleased into the next `## vX.Y.Z`. Before that bump, run [`.agents/skills/oke-perf`](.agents/skills/oke-perf/SKILL.md).
107
114
 
108
115
  Do **NOT** run `bun run ci` automatically after finishing an implementation. Only run `bun run ci` when the user explicitly requests it.
109
116
 
package/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/NOTICE ADDED
@@ -0,0 +1,2 @@
1
+ okengine
2
+ Copyright 2026 Omq Khafi
package/README.md CHANGED
@@ -15,7 +15,7 @@
15
15
  <p align="center">
16
16
  <a href="https://www.npmjs.com/package/okengine"><img alt="npm" src="https://shieldcn.dev/npm/okengine.svg?size=sm&variant=outline" /></a>
17
17
  <a href="https://jsr.io/@omqkhafi/okengine"><img alt="JSR" src="https://shieldcn.dev/jsr/@omqkhafi/okengine.svg?size=sm&variant=outline" /></a>
18
- <a href="https://opensource.org/licenses/MIT"><img alt="MIT" src="https://shieldcn.dev/npm/license/okengine.svg?size=sm&variant=outline" /></a>
18
+ <a href="https://www.apache.org/licenses/LICENSE-2.0"><img alt="Apache-2.0" src="https://shieldcn.dev/npm/license/okengine.svg?size=sm&variant=outline" /></a>
19
19
  <a href="https://bun.sh"><img alt="Bun >=1.4.2" src="https://shieldcn.dev/badge/Bun-%3E%3D1.4.2.svg?logo=bun&size=sm&variant=outline" /></a>
20
20
  <a href="https://github.com/omqkhafi/okengine/actions"><img alt="CI" src="https://shieldcn.dev/github/ci/omqkhafi/okengine.svg?size=sm&variant=outline" /></a>
21
21
  <a href="https://github.com/omqkhafi/okengine/commits"><img alt="last commit" src="https://shieldcn.dev/github/last-commit/omqkhafi/okengine.svg?size=sm&variant=outline" /></a>
@@ -69,16 +69,22 @@ Mnemonic: **O·K·E = 6·5·3**.
69
69
  The starter already exports a health Flow — change it and save; App and Console update from the same Manifest:
70
70
 
71
71
  ```typescript
72
- // src/flows/main/health.ts — folders are the URL: `main/health.ts` → GET /health
73
- import { on, flow, http } from "okengine";
72
+ // src/flows/main/shapes.ts
74
73
  import { z } from "zod";
75
74
 
75
+ /** Liveness payload for `GET /health`. */
76
+ export const HealthOut = z.object({
77
+ ok: z.literal(true),
78
+ });
79
+
80
+ // src/flows/main/health.ts — folders are the URL: `main/health.ts` → GET /health
81
+ import { on, flow, http } from "okengine/http";
82
+
83
+ import { HealthOut } from "./shapes";
84
+
76
85
  export const health = on(
77
- http.get().public(),
78
- flow({
79
- out: z.object({ ok: z.literal(true) }),
80
- do: () => ({ ok: true as const }),
81
- }),
86
+ http.get({ out: HealthOut }).public(),
87
+ flow({ do: () => ({ ok: true as const }) }),
82
88
  );
83
89
  ```
84
90
 
@@ -148,4 +154,4 @@ Store apps sync schema with `oke db push|generate|migrate` (local `oke dev` auto
148
154
 
149
155
  ## License
150
156
 
151
- Pre-1.0. Published on [npm](https://www.npmjs.com/package/okengine) and [JSR](https://jsr.io/@omqkhafi/okengine). [MIT](https://opensource.org/licenses/MIT).
157
+ Pre-1.0. Published on [npm](https://www.npmjs.com/package/okengine) and [JSR](https://jsr.io/@omqkhafi/okengine). [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0).
@@ -185,6 +185,11 @@
185
185
  "type": "array",
186
186
  "items": { "$ref": "#/$defs/FlowRef" },
187
187
  "uniqueItems": true
188
+ },
189
+ "decides": {
190
+ "type": "array",
191
+ "items": { "type": "string", "minLength": 1 },
192
+ "uniqueItems": true
188
193
  }
189
194
  }
190
195
  },
@@ -308,6 +313,16 @@
308
313
  "enum": ["user", "operator"]
309
314
  },
310
315
  "durable": { "type": "boolean" },
316
+ "idempotency": {
317
+ "type": "object",
318
+ "additionalProperties": false,
319
+ "required": ["mode", "ttl"],
320
+ "properties": {
321
+ "mode": { "enum": ["off", "auto", "required"] },
322
+ "ttl": { "type": "string", "minLength": 1 }
323
+ }
324
+ },
325
+ "usesRaw": { "type": "boolean" },
311
326
  "live": {
312
327
  "type": "string",
313
328
  "description": "Live signal name when this flow streams delivery: live SSE."
@@ -656,6 +671,7 @@
656
671
  "version": { "type": "integer", "minimum": 1 },
657
672
  "evals": { "type": "string", "minLength": 1 },
658
673
  "budget": { "$ref": "#/$defs/AiPromptBudget" },
674
+ "repair": { "type": "integer", "enum": [0, 1] },
659
675
  "model": { "type": "string", "minLength": 1 },
660
676
  "in": { "$ref": "#/$defs/JsonSchema" },
661
677
  "out": { "$ref": "#/$defs/JsonSchema" }
@@ -670,11 +686,44 @@
670
686
  "items": { "$ref": "#/$defs/FlowRef" },
671
687
  "uniqueItems": true
672
688
  },
689
+ "approvals": {
690
+ "type": "object",
691
+ "propertyNames": { "type": "string", "minLength": 1 },
692
+ "additionalProperties": { "const": true }
693
+ },
673
694
  "maxSteps": { "type": "integer", "minimum": 1 },
695
+ "maxDepth": { "type": "integer", "minimum": 1 },
674
696
  "model": { "type": "string", "minLength": 1 },
675
697
  "budget": { "$ref": "#/$defs/AiPromptBudget" }
676
698
  }
677
699
  },
700
+ "AiDecision": {
701
+ "type": "object",
702
+ "additionalProperties": false,
703
+ "required": ["mode", "questions"],
704
+ "properties": {
705
+ "mode": { "enum": ["review", "abstain"] },
706
+ "review": { "type": "string", "minLength": 1 },
707
+ "model": { "type": "string", "minLength": 1 },
708
+ "driverId": { "enum": ["openrouter", "typesafe"] },
709
+ "questions": {
710
+ "type": "array",
711
+ "items": { "type": "string", "minLength": 1 },
712
+ "uniqueItems": true
713
+ },
714
+ "evals": { "type": "string", "minLength": 1 },
715
+ "autonomy": {
716
+ "type": "object",
717
+ "additionalProperties": false,
718
+ "required": ["maxError", "audit"],
719
+ "properties": {
720
+ "maxError": { "type": "number", "exclusiveMinimum": 0, "maximum": 1 },
721
+ "audit": { "type": "number", "minimum": 0, "maximum": 1 },
722
+ "risk": { "type": "number", "exclusiveMinimum": 0, "maximum": 1 }
723
+ }
724
+ }
725
+ }
726
+ },
678
727
  "Ai": {
679
728
  "type": "object",
680
729
  "additionalProperties": false,
@@ -693,6 +742,11 @@
693
742
  "type": "object",
694
743
  "propertyNames": { "type": "string", "minLength": 1 },
695
744
  "additionalProperties": { "$ref": "#/$defs/AiAgent" }
745
+ },
746
+ "decisions": {
747
+ "type": "object",
748
+ "propertyNames": { "type": "string", "minLength": 1 },
749
+ "additionalProperties": { "$ref": "#/$defs/AiDecision" }
696
750
  }
697
751
  }
698
752
  },
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "okengine",
3
- "version": "0.21.1",
3
+ "version": "0.23.0",
4
4
  "description": "One law. Eight elements. One contract. The backend model stays small; operational surfaces are derived from it instead of maintained separately.",
5
- "license": "MIT",
5
+ "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "git+https://github.com/omqkhafi/okengine.git"
@@ -16,6 +16,8 @@
16
16
  "site"
17
17
  ],
18
18
  "files": [
19
+ "LICENSE",
20
+ "NOTICE",
19
21
  "src",
20
22
  "dist",
21
23
  "manifest.v1.schema.json",
@@ -71,6 +73,7 @@
71
73
  "./client": "./src/client/index.ts",
72
74
  "./client/auth": "./src/client/auth.ts",
73
75
  "./client/explain": "./src/client/explain.ts",
76
+ "./client/agent": "./src/client/agent.ts",
74
77
  "./client-react": "./src/client-react/index.ts",
75
78
  "./test": "./src/test/index.ts",
76
79
  "./testing": {
@@ -102,36 +105,46 @@
102
105
  }
103
106
  },
104
107
  "scripts": {
105
- "typecheck": "tsc --noEmit && tsc --noEmit -p tests/console/tsconfig.ui-next.json && tsc --noEmit -p src/console/ui-next && bun run --cwd packages/create-oke typecheck && bun run --cwd examples/keel typecheck",
106
- "lint": "oxlint --quiet",
108
+ "typecheck": "turbo run typecheck typecheck:framework typecheck:console typecheck:console-tests",
109
+ "typecheck:framework": "tsc --noEmit",
110
+ "typecheck:console": "tsc --noEmit -p src/console/ui-next",
111
+ "typecheck:console-tests": "tsc --noEmit -p tests/console/tsconfig.ui-next.json",
112
+ "lint": "turbo run lint:repo",
113
+ "lint:repo": "oxlint --quiet",
107
114
  "lint:fix": "oxlint --fix",
108
115
  "fmt": "oxfmt",
109
116
  "format": "oxfmt",
110
- "fmt:check": "oxfmt --check",
111
- "test": "bun test --pass-with-no-tests",
117
+ "fmt:check": "turbo run fmt:check:repo",
118
+ "fmt:check:repo": "oxfmt --check",
119
+ "test": "turbo run test:framework",
120
+ "test:framework": "bun test --pass-with-no-tests",
112
121
  "test:coverage": "bun test --coverage --pass-with-no-tests",
113
122
  "test:console:smoke": "bunx playwright test tests/console/smoke.spec.ts",
114
123
  "test:console:setup": "bunx playwright test --config playwright.ui-next.config.ts",
115
124
  "test:console:setup:report": "bunx playwright show-report playwright-report/ui-next",
116
- "build": "bunx --bun vite build --config src/console/ui-next/vite.config.ts",
117
- "dev:console": "bunx --bun vite --config src/console/ui-next/vite.config.ts",
118
- "dev:console:seed": "OKE_CONSOLE_SEEDED=1 bunx --bun vite --config src/console/ui-next/vite.config.ts",
119
- "dev:console:fresh": "OKE_CONSOLE_FRESH=1 bunx --bun vite --config src/console/ui-next/vite.config.ts",
120
- "dev:console:fresh:seed": "OKE_CONSOLE_FRESH=1 OKE_CONSOLE_SEEDED=1 bunx --bun vite --config src/console/ui-next/vite.config.ts",
121
- "dev:keel": "bun run --cwd examples/keel dev",
122
- "dev:keel:seed": "bun run --cwd examples/keel seed",
123
- "dev:keel:reset": "bun run --cwd examples/keel reset",
124
- "test:keel": "bun run --cwd examples/keel test",
125
- "test:keel:docker": "OKE_TEST_DOCKER=1 bun run --cwd examples/keel test",
126
- "build:lib": "bun src/release/build-lib.ts",
125
+ "build": "turbo run build:console",
126
+ "build:console": "bunx --bun vite build --config src/console/ui-next/vite.config.ts",
127
+ "dev:console": "turbo run dev:console:repo",
128
+ "dev:console:repo": "bunx --bun vite --config src/console/ui-next/vite.config.ts",
129
+ "dev:console:seed": "OKE_CONSOLE_SEEDED=1 turbo run dev:console:repo",
130
+ "dev:console:fresh": "OKE_CONSOLE_FRESH=1 turbo run dev:console:repo",
131
+ "dev:console:fresh:seed": "OKE_CONSOLE_FRESH=1 OKE_CONSOLE_SEEDED=1 turbo run dev:console:repo",
132
+ "dev:keel": "turbo run dev --filter=@oke/example-keel",
133
+ "dev:keel:seed": "turbo run seed --filter=@oke/example-keel",
134
+ "dev:keel:reset": "turbo run reset --filter=@oke/example-keel",
135
+ "test:keel": "turbo run test --filter=@oke/example-keel",
136
+ "test:keel:docker": "OKE_TEST_DOCKER=1 turbo run test --filter=@oke/example-keel",
137
+ "build:lib": "turbo run build:lib:repo",
138
+ "build:lib:repo": "bun src/release/build-lib.ts",
127
139
  "prepack": "bun run build && bun run build:lib",
128
140
  "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 src/okid.bench.test.ts",
129
141
  "bench:load": "OKE_BENCH=1 bun test ./src/bench/*.bench.ts --timeout 600000 --pass-with-no-tests",
130
142
  "budgets": "bun src/release/publish.ts",
131
143
  "budgets:core": "bun test src/kernel/budget.test.ts src/client/budget.test.ts",
132
144
  "gate": "PUBLISH_GATE=1 bun test src/cli/doc-staleness.test.ts src/cli/competitor-mention-removal.test.ts src/drivers/vault-driver-removal.test.ts src/kernel/errors.registry.test.ts src/upgrade/codemods.test.ts scripts/publish.gate.test.ts",
133
- "dev": "bun run --cwd site dev",
134
- "site:build": "bun run --cwd site build",
145
+ "dev": "turbo run dev --filter=site",
146
+ "site:build": "turbo run build --filter=site",
147
+ "boundaries": "turbo boundaries",
135
148
  "verify": "bun run lint && bun run fmt:check && bun run typecheck && bun run test && bun run gate && bun run site:build",
136
149
  "ci": "bun scripts/ci.ts",
137
150
  "bump": "bun run scripts/bump-version.ts",
@@ -140,23 +153,23 @@
140
153
  "postinstall": "bun run --cwd examples/keel prepare"
141
154
  },
142
155
  "dependencies": {
143
- "@clack/prompts": "^1.8.0",
156
+ "@clack/prompts": "^1.8.1",
144
157
  "intl-messageformat": "^11.2.14",
145
158
  "oxc-parser": "^0.149.0",
146
159
  "sently": "1.2.2"
147
160
  },
148
161
  "devDependencies": {
149
162
  "@base-ui/react": "^1.8.0",
150
- "@codemirror/commands": "^6.11.0",
163
+ "@codemirror/commands": "^6.11.1",
151
164
  "@codemirror/lang-json": "^6.0.2",
152
- "@codemirror/state": "^6.7.4",
165
+ "@codemirror/state": "^6.7.6",
153
166
  "@codemirror/theme-one-dark": "^6.1.3",
154
- "@codemirror/view": "^6.43.11",
167
+ "@codemirror/view": "^6.43.13",
155
168
  "@dagrejs/dagre": "^3.1.1",
156
- "@duckdb/node-api": "^1.5.5-r.4",
169
+ "@duckdb/node-api": "^1.5.5-r.5",
157
170
  "@electric-sql/pglite": "^0.5.8",
158
171
  "@electric-sql/pglite-pgvector": "^0.0.9",
159
- "@hugeicons/core-free-icons": "^4.3.2",
172
+ "@hugeicons/core-free-icons": "^4.3.5",
160
173
  "@hugeicons/react": "^1.1.10",
161
174
  "@number-flow/react": "^0.6.2",
162
175
  "@oxc-project/types": "^0.149.0",
@@ -165,10 +178,10 @@
165
178
  "@tailwindcss/vite": "^4.3.3",
166
179
  "@tanstack/react-form": "^1.33.5",
167
180
  "@tanstack/react-hotkeys": "^0.10.0",
168
- "@tanstack/react-query": "^5.102.8",
169
- "@tanstack/react-router": "^1.170.34",
181
+ "@tanstack/react-query": "^5.103.2",
182
+ "@tanstack/react-router": "^1.170.39",
170
183
  "@tanstack/react-table": "^9.2.4",
171
- "@tanstack/react-virtual": "^3.14.11",
184
+ "@tanstack/react-virtual": "^3.14.13",
172
185
  "@types/bun": "latest",
173
186
  "@types/d3-array": "^3.2.2",
174
187
  "@types/d3-shape": "^3.2.0",
@@ -192,30 +205,31 @@
192
205
  "d3-array": "^3.2.4",
193
206
  "d3-shape": "^3.2.0",
194
207
  "date-fns": "^4.4.0",
195
- "drizzle-kit": "1.0.0-rc.5-ab785fc",
196
- "drizzle-orm": "1.0.0-rc.5-169397b",
208
+ "drizzle-kit": "1.0.0-rc.5-5935859",
209
+ "drizzle-orm": "1.0.0-rc.5-5935859",
197
210
  "gflows": "^1.2.1",
198
- "happy-dom": "^20.14.3",
211
+ "happy-dom": "^20.14.5",
199
212
  "hast-util-to-jsx-runtime": "^2.3.6",
200
213
  "mermaid": "^11.17.2",
201
- "motion": "^13.2.0",
214
+ "motion": "^13.4.2",
202
215
  "nuqs": "^2.10.1",
203
216
  "oxfmt": "^0.67.0",
204
- "oxlint": "^1.82.0",
205
- "oxlint-tsgolint": "^7.0.2001",
217
+ "oxlint": "^1.85.0",
218
+ "oxlint-tsgolint": "^7.0.2002",
206
219
  "playwright": "^1.63.0",
207
220
  "react": "^19.3.0",
208
221
  "react-dom": "^19.3.0",
209
- "react-resizable-panels": "^4.12.4",
222
+ "react-resizable-panels": "^4.13.3",
210
223
  "shadcn": "^4.21.0",
211
224
  "shiki": "^4.4.3",
212
- "tailwind-merge": "^3.6.0",
225
+ "tailwind-merge": "^3.7.0",
213
226
  "tailwindcss": "^4.3.3",
227
+ "turbo": "^2.11.4",
214
228
  "tw-animate-css": "^1.4.0",
215
229
  "typescript": "^7.0.2",
216
230
  "valibot": "^1.5.0",
217
231
  "vite": "^8.3.0",
218
- "zod": "^4.6.1"
232
+ "zod": "^4.6.5"
219
233
  },
220
234
  "peerDependencies": {
221
235
  "@aws-sdk/client-kms": ">=3.0.0",
@@ -283,5 +297,6 @@
283
297
  },
284
298
  "engines": {
285
299
  "bun": ">=1.4.2"
286
- }
300
+ },
301
+ "packageManager": "bun@1.4.2"
287
302
  }
@@ -26,15 +26,19 @@ The server on **6535** speaks JSON-RPC over HTTP (MCP protocol `2024-11-05`), re
26
26
 
27
27
  ## Read tools
28
28
 
29
- Default-safe — they return inert data envelopes, never live handles:
30
-
31
- | Tool | Returns | Scope (any of) |
32
- | ------------------ | ---------------------------------------------- | --------------------------------------------- |
33
- | `oke.manifest.get` | The current Manifest catalogue | `mcp:manifest:read` · `console:manifest:read` |
34
- | `oke.schema.get` | In/out/error schemas for one flow (`flowId`) | `mcp:schema:read` · `console:manifest:read` |
35
- | `oke.effects.get` | Declared effects for one flow (`flowId`) | `mcp:effects:read` · `console:manifest:read` |
36
- | `oke.traces.list` | Recent runs (`limit` ≤ 200, optional `flowId`) | `mcp:traces:read` · `console:runs:read` |
37
- | `oke.traces.get` | One run/trace record (`runId`) | `mcp:traces:read` · `console:runs:read` |
29
+ Default-safe — they return inert data envelopes, never live handles. Approving a tool, resolving a review, and promoting a decision are not tools. Those stay with a person in the Console or the CLI.
30
+
31
+ | Tool | Returns | Scope (any of) |
32
+ | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------- |
33
+ | `oke.manifest.get` | The current Manifest catalogue | `mcp:manifest:read` · `console:manifest:read` |
34
+ | `oke.schema.get` | In/out/error schemas for one flow (`flowId`) | `mcp:schema:read` · `console:manifest:read` |
35
+ | `oke.effects.get` | Declared effects for one flow (`flowId`) | `mcp:effects:read` · `console:manifest:read` |
36
+ | `oke.traces.list` | Recent runs (`limit` ≤ 200, optional `flowId`) | `mcp:traces:read` · `console:runs:read` |
37
+ | `oke.traces.get` | One run/trace record (`runId`) | `mcp:traces:read` · `console:runs:read` |
38
+ | `oke.ai.runs.list` | Agent runs for the token's tenant (`limit` ≤ 200). `console:*` or `mcp:*` may omit `tenant` or name another one. PII and secrets are masked. | `mcp:ai:read` · `console:runs:read` |
39
+ | `oke.ai.runs.get` | One agent run plus its follow events (`runId`). Same tenant rule. Args, trail, and events are masked. | `mcp:ai:read` · `console:runs:read` |
40
+ | `oke.ai.approvals.list` | Pending tool approvals for the token's tenant. Same operator rule. Approval args are masked. | `mcp:ai:read` · `console:runs:read` |
41
+ | `oke.decisions.list` | Decision state, pending count, metrics, and drift for the token's tenant. Same operator rule. Inputs are masked. | `mcp:decisions:read` · `console:runs:read` |
38
42
 
39
43
  ## Write tools — confirmed, every single call
40
44
 
@@ -19,11 +19,11 @@ Tools alone don't make a good operator — an agent also needs to know the _voca
19
19
  | **Images skill** | `.agents/skills/oke-images/` | Updating Compose image pins | Registry probe, pin style, catalog + recipes + Keel + docs lockstep |
20
20
 
21
21
  Contributor-only skills in the same tree (not required for app authors):
22
- `oke-ci`, `oke-docs-update`, `oke-docs-visuals`, `oke-console-style`.
22
+ `oke-ci`, `oke-perf` (before a release), `oke-docs-update`, `oke-docs-visuals`, `oke-console-style`.
23
23
 
24
24
  ## AGENTS.md — the root contract
25
25
 
26
- 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 bound to one contract, 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.
26
+ 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 bound to one contract, all world access goes through `fx`, drivers are named after protocols, and the ports/budgets are fixed. The AI section separates `fx.ask`, `fx.run`, and `fx.decide`: tool approvals need `durable: true` and a human resolve, streams follow `GET /agent/runs/:runId/events`, and autonomy comes only from `oke-decisions.lock.json` (`oke eval --certify` writes the certificate; `oke decide promote` installs it). Its closing rule is the one that keeps agents honest: **if the documentation is silent, stop and ask** — never invent the API.
27
27
 
28
28
  ## Skills — installable know-how
29
29