okengine 0.17.2 → 0.18.4

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 (209) hide show
  1. package/AGENTS.md +5 -3
  2. package/README.md +14 -10
  3. package/manifest.v1.schema.json +61 -2
  4. package/package.json +19 -5
  5. package/site/content/docs/ai/index.mdx +1 -1
  6. package/site/content/docs/ai/mcp.mdx +10 -1
  7. package/site/content/docs/ai/skills.mdx +9 -9
  8. package/site/content/docs/elements/ai.mdx +1 -1
  9. package/site/content/docs/elements/clock.mdx +1 -1
  10. package/site/content/docs/elements/flow.mdx +25 -1
  11. package/site/content/docs/elements/gate.mdx +3 -2
  12. package/site/content/docs/elements/store.mdx +289 -341
  13. package/site/content/docs/elements/vault.mdx +5 -5
  14. package/site/content/docs/get-started/basic-usage.mdx +3 -10
  15. package/site/content/docs/get-started/index.mdx +1 -1
  16. package/site/content/docs/get-started/installation.mdx +2 -3
  17. package/site/content/docs/get-started/introduction.mdx +58 -121
  18. package/site/content/docs/get-started/meta.json +9 -1
  19. package/site/content/docs/get-started/project-structure.mdx +4 -11
  20. package/site/content/docs/get-started/testing.mdx +328 -0
  21. package/site/content/docs/get-started/why.mdx +93 -71
  22. package/site/content/docs/index.mdx +44 -11
  23. package/site/content/docs/meta.json +8 -5
  24. package/site/content/docs/plugins/apple.mdx +151 -0
  25. package/site/content/docs/plugins/discord.mdx +139 -0
  26. package/site/content/docs/plugins/facebook.mdx +134 -0
  27. package/site/content/docs/plugins/figma.mdx +138 -0
  28. package/site/content/docs/plugins/github.mdx +138 -0
  29. package/site/content/docs/plugins/google.mdx +153 -0
  30. package/site/content/docs/plugins/index.mdx +47 -1
  31. package/site/content/docs/plugins/meta.json +10 -0
  32. package/site/content/docs/plugins/microsoft.mdx +151 -0
  33. package/site/content/docs/plugins/oauth.mdx +188 -0
  34. package/site/content/docs/plugins/x.mdx +125 -0
  35. package/site/content/docs/providers/index.mdx +2 -0
  36. package/site/content/docs/recipes/index.mdx +2 -0
  37. package/site/content/docs/reference/cli.md +3 -2
  38. package/site/content/docs/reference/client.mdx +58 -1
  39. package/site/content/docs/reference/configuration.mdx +2 -4
  40. package/site/content/docs/reference/fx.mdx +3 -1
  41. package/site/content/docs/reference/index.mdx +0 -5
  42. package/site/content/docs/reference/meta.json +2 -2
  43. package/site/content/docs/reference/okid.mdx +137 -0
  44. package/src/auth/bindings.ts +1 -1
  45. package/src/auth/config.ts +9 -0
  46. package/src/auth/identity-sql.ts +314 -0
  47. package/src/auth/identity.ts +140 -2
  48. package/src/auth/index.ts +17 -1
  49. package/src/auth/method-context.ts +3 -0
  50. package/src/auth/oauth-as/cimd.ts +132 -0
  51. package/src/auth/oauth-as/crypto.test.ts +101 -0
  52. package/src/auth/oauth-as/crypto.ts +393 -0
  53. package/src/auth/oauth-as/errors.ts +68 -0
  54. package/src/auth/oauth-as/http.test.ts +419 -0
  55. package/src/auth/oauth-as/http.ts +842 -0
  56. package/src/auth/oauth-as/stores.ts +61 -0
  57. package/src/auth/oauth-as/tables.ts +142 -0
  58. package/src/auth/tables.ts +0 -11
  59. package/src/bench/README.md +83 -0
  60. package/src/bench/REPORT.md +176 -0
  61. package/src/bench/g01-rls-stamp.bench.ts +194 -0
  62. package/src/bench/g02-clock-per-tenant.bench.ts +158 -0
  63. package/src/bench/g03-signal-once.bench.ts +157 -0
  64. package/src/bench/g03-signal-reconnect.bench.ts +254 -0
  65. package/src/bench/g03-signal-sse-memory.bench.ts +191 -0
  66. package/src/bench/g04-auth-vault-hotpath.bench.ts +170 -0
  67. package/src/bench/g05-sustained-full.bench.ts +265 -0
  68. package/src/bench/g06-mixed-load.bench.ts +260 -0
  69. package/src/bench/g07-vault-crypto.bench.ts +100 -0
  70. package/src/bench/g07-vault-rotate-under-read.bench.ts +285 -0
  71. package/src/bench/g08-conn-oversubscribe.bench.ts +194 -0
  72. package/src/bench/g08-store-kv-durable.bench.ts +133 -0
  73. package/src/bench/g08-store-sql.bench.ts +178 -0
  74. package/src/bench/g09-journal-sustained.bench.ts +203 -0
  75. package/src/bench/g10-observability-contention.bench.ts +246 -0
  76. package/src/bench/g11-cold-start-cycle.bench.ts +164 -0
  77. package/src/bench/g13-elements.bench.ts +427 -0
  78. package/src/bench/g14-graceful-shutdown.bench.ts +244 -0
  79. package/src/bench/g15-postgres-degradation.bench.ts +264 -0
  80. package/src/bench/g16-live-query-fanout.bench.ts +206 -0
  81. package/src/bench/lib/event-loop-lag.ts +26 -0
  82. package/src/bench/lib/infra.ts +60 -0
  83. package/src/bench/lib/report.ts +52 -0
  84. package/src/bench/lib/rss-sampler.ts +61 -0
  85. package/src/bench/lib/signal-pg.ts +88 -0
  86. package/src/bench/load-app.ts +337 -0
  87. package/src/bench/load-child.ts +108 -0
  88. package/src/bench/smoke.bench.ts +43 -0
  89. package/src/cli/competitor-mention-removal.test.ts +28 -0
  90. package/src/cli/doctor-fd.ts +117 -0
  91. package/src/cli/doctor.test.ts +192 -0
  92. package/src/cli/doctor.ts +129 -1
  93. package/src/client/create.ts +95 -1
  94. package/src/client/index.ts +9 -2
  95. package/src/client/transport.ts +11 -4
  96. package/src/client/use-live-query.ts +154 -0
  97. package/src/client-react/index.ts +15 -1
  98. package/src/client-react/live-resource.ts +246 -0
  99. package/src/client-react/use-live-query.test.ts +475 -0
  100. package/src/client-react/use-live-query.ts +530 -0
  101. package/src/compiler/extract.test.ts +518 -0
  102. package/src/compiler/extract.ts +386 -19
  103. package/src/console/server/invoke-user-flow.ts +2 -1
  104. package/src/console/ui-next/dist/assets/{access-page-DnWbnGzq.js → access-page-De7Lc2JC.js} +1 -1
  105. package/src/console/ui-next/dist/assets/{flows-page-BiZ4-6yQ.js → flows-page-RGy7VEA_.js} +1 -1
  106. package/src/console/ui-next/dist/assets/{index-C8NRK2R-.js → index-_rgpdVzo.js} +3 -3
  107. package/src/console/ui-next/dist/assets/{observability-page-CrB6vd1T.js → observability-page-Ds6pcnh-.js} +1 -1
  108. package/src/console/ui-next/dist/assets/{store-page-CS5-aETQ.js → store-page-02xOiqIK.js} +3 -3
  109. package/src/console/ui-next/dist/assets/{units-page-CjtdlW8l.js → units-page-4rHOePuE.js} +1 -1
  110. package/src/console/ui-next/dist/assets/{vault-page-C6Xxm9SA.js → vault-page-DISPgxLM.js} +1 -1
  111. package/src/console/ui-next/dist/index.html +1 -1
  112. package/src/console/ui-next/src/features/store/lib/fields-from-table.ts +36 -2
  113. package/src/drivers/cdc-outbox.ts +389 -0
  114. package/src/drivers/memory.ts +20 -0
  115. package/src/drivers/oauth-apple.ts +156 -0
  116. package/src/drivers/oauth-discord.ts +79 -0
  117. package/src/drivers/oauth-facebook.ts +80 -0
  118. package/src/drivers/oauth-figma.ts +116 -0
  119. package/src/drivers/oauth-github.ts +92 -0
  120. package/src/drivers/oauth-google.ts +142 -0
  121. package/src/drivers/oauth-microsoft.ts +174 -0
  122. package/src/drivers/oauth-oidc.ts +293 -0
  123. package/src/drivers/oauth-shared.ts +326 -0
  124. package/src/drivers/oauth-types.ts +159 -0
  125. package/src/drivers/oauth-x.ts +77 -0
  126. package/src/drivers/oauth2-common.ts +95 -0
  127. package/src/drivers/oauth2-token.ts +61 -0
  128. package/src/drivers/pg-rls-row-passes.ts +251 -0
  129. package/src/drivers/pg-rls.ts +2 -0
  130. package/src/drivers/postgres.ts +45 -2
  131. package/src/drivers/signal-postgres.ts +2 -1
  132. package/src/elements/channel/runtime.ts +29 -2
  133. package/src/elements/channel.test.ts +52 -0
  134. package/src/elements/gate/boot.ts +29 -2
  135. package/src/elements/store/emit-drizzle.ts +147 -14
  136. package/src/elements/store/field-ddl.test.ts +118 -0
  137. package/src/elements/store/field-types.test.ts +455 -0
  138. package/src/elements/store/list-query.golden.json +777 -0
  139. package/src/elements/store/list-query.parity.test.ts +396 -0
  140. package/src/elements/store/list-query.ts +792 -0
  141. package/src/elements/store/live-default.test.ts +136 -0
  142. package/src/elements/store/live-http.test.ts +160 -0
  143. package/src/elements/store/live-isolation.test.ts +291 -0
  144. package/src/elements/store/live-query-runtime.test.ts +323 -0
  145. package/src/elements/store/live-query-runtime.ts +403 -0
  146. package/src/elements/store/live-query-server.test.ts +377 -0
  147. package/src/elements/store/live-query-server.ts +102 -0
  148. package/src/elements/store/live-query.ts +97 -0
  149. package/src/elements/store/resource.ts +189 -680
  150. package/src/elements/store/rls-row-passes-policies.parity.test.ts +665 -0
  151. package/src/elements/store/schema-decl.ts +539 -41
  152. package/src/elements/store/sql-rls-stamp.test.ts +27 -0
  153. package/src/elements/store/sql-session.ts +297 -35
  154. package/src/elements/store/table.ts +102 -21
  155. package/src/elements/store.test.ts +3 -1
  156. package/src/elements/store.ts +12 -1
  157. package/src/elements/vault/chaos-child.ts +74 -1
  158. package/src/elements/vault/chaos.test.ts +4 -2
  159. package/src/elements/vault/storage.ts +4 -2
  160. package/src/index.ts +5 -2
  161. package/src/kernel/app-auth.ts +1 -0
  162. package/src/kernel/app.ts +116 -2
  163. package/src/kernel/auth-sharing.test.ts +196 -0
  164. package/src/kernel/boot.test.ts +3 -3
  165. package/src/kernel/errors.ts +8 -0
  166. package/src/kernel/fx.test.ts +1 -0
  167. package/src/kernel/fx.ts +14 -2
  168. package/src/kernel/horizontal-child.ts +2 -1
  169. package/src/kernel/http-resource.ts +33 -7
  170. package/src/kernel/identity-host-persist.test.ts +119 -0
  171. package/src/kernel/instance-id.ts +4 -2
  172. package/src/kernel/journal.ts +2 -1
  173. package/src/kernel/mcp-tool.test.ts +95 -0
  174. package/src/kernel/on.ts +9 -0
  175. package/src/kernel/realtime-bind.ts +326 -0
  176. package/src/kernel/resource-live.ts +117 -0
  177. package/src/kernel/triggers.ts +86 -4
  178. package/src/manifest/diff.ts +37 -0
  179. package/src/manifest/types.ts +64 -2
  180. package/src/okid.bench.test.ts +64 -0
  181. package/src/okid.test.ts +338 -0
  182. package/src/okid.ts +245 -0
  183. package/src/plugins/anonymous.ts +19 -1
  184. package/src/plugins/auth/shared.ts +15 -0
  185. package/src/plugins/index.ts +2 -0
  186. package/src/plugins/magic-link.ts +10 -8
  187. package/src/plugins/mcp-oauth.ts +208 -0
  188. package/src/plugins/oauth/flow-store.ts +117 -0
  189. package/src/plugins/oauth/link.ts +69 -0
  190. package/src/plugins/oauth/shared.ts +108 -0
  191. package/src/plugins/oauth/token-vault.ts +100 -0
  192. package/src/plugins/oauth.security.test.ts +535 -0
  193. package/src/plugins/oauth.ts +532 -0
  194. package/src/plugins/otp.ts +48 -6
  195. package/src/plugins/passkey.ts +20 -1
  196. package/src/plugins/two-factor.ts +11 -0
  197. package/src/plugins/username.ts +40 -7
  198. package/src/release/build-lib.ts +7 -1
  199. package/src/release/measure.ts +1 -0
  200. package/src/release/official-plugins.ts +4 -1
  201. package/src/runs/collect.ts +2 -1
  202. package/src/runs/drivers/files.ts +2 -1
  203. package/src/test/create-test-app.ts +114 -5
  204. package/src/test/export-bundle.test.ts +33 -0
  205. package/src/test/live-signals.test.ts +83 -0
  206. package/src/test/tenant-isolation.test.ts +175 -0
  207. package/src/testing.ts +26 -0
  208. package/src/upgrade/codemods.ts +1 -1
  209. package/site/content/docs/reference/migrating-environments.mdx +0 -158
@@ -173,8 +173,8 @@ A value already in the vault / managed backend wins over a leftover env pin.
173
173
  If every layer misses a contract, boot **fails** before any request is served:
174
174
 
175
175
  ```text
176
- VaultBootError: 1 secret(s) missing:
177
- STRIPE_KEY Payments gateway key
176
+ vault boot failed — 1 missing secret(s):
177
+ - STRIPE_KEY: Payments gateway key
178
178
  ```
179
179
 
180
180
  <Callout title="Good to know">
@@ -242,9 +242,9 @@ Backup stays on the CLI (`oke vault backup` / `restore`). The Console never
242
242
  accepts a master key in the HTTP body — unseal via `OKE_VAULT_MASTER_KEY`.
243
243
 
244
244
  <Callout title="Builtin concurrency (rotate / audit / backup)">
245
- `rotate-master` uses SKIP LOCKED + lease TTL (one holder; crashed holders reclaim). Audit appends
246
- under a transactional row lock. Backups use temp fsync rename with end marker + checksum —
247
- restore rejects incomplete files before decrypt.
245
+ `rotate-master` holds a lease (`FOR UPDATE` + lease TTL) so exactly one batch runs at a time; a
246
+ busy audit append briefly waits rather than being misread as "lease held". Audit appends serialize
247
+ under a transactional write lock; backups use temp → fsync → rename with end marker + checksum.
248
248
  </Callout>
249
249
 
250
250
  <Callout title="Builtin master keys and expired rows">
@@ -46,16 +46,9 @@ lists HTTP routes — static GET paths are links. `curl` still gets `{ data, err
46
46
  The standard starter already exports a named health Flow:
47
47
 
48
48
  ```typescript title="flows/main/health.ts"
49
- import { on, flow, http } from "okengine";
50
- import { z } from "zod";
51
-
52
- export const health = on(
53
- http.get().public(),
54
- flow({
55
- out: z.object({ ok: z.literal(true) }),
56
- do: () => ({ ok: true as const }),
57
- }),
58
- );
49
+ import { on, flow, http } from "okengine/http";
50
+
51
+ export const health = on(http.get().public(), flow({ do: () => ({ ok: true }) }));
59
52
  ```
60
53
 
61
54
  `main` omits the URL prefix, so this file is `GET /health` named `main.health`. See [Project structure](/docs/get-started/project-structure).
@@ -12,7 +12,7 @@ Learn the shape once, install on Bun, then write your first Flow from the standa
12
12
  <Cards>
13
13
  <Card
14
14
  title="Introduction"
15
- description="One law, eight elements, ten exports."
15
+ description="One law, eight elements, one contract."
16
16
  href="/docs/get-started/introduction"
17
17
  />
18
18
  <Card
@@ -146,7 +146,7 @@ Uncommented supported controls in the generated compose env are preserved when
146
146
  `oke dev` regenerates the file.
147
147
 
148
148
  Migrating from `local` / `docker` maps or `oke mode`?
149
- See [Migrating environments](/docs/reference/migrating-environments).
149
+ Rename the env keys in `oke.config.ts` to `dev` / `test` / `prod`.
150
150
 
151
151
  ## Troubleshooting
152
152
 
@@ -198,7 +198,6 @@ See [Migrating environments](/docs/reference/migrating-environments).
198
198
  - [CLI Reference](/docs/reference/cli) — `oke`, `create-oke`, `oke test`, and db commands
199
199
  - [Environment variables](/docs/reference/environment-variables) — protocol-shaped env
200
200
  - [Configuration](/docs/reference/configuration) — `oke.config.ts` drivers and `db.autoPush`
201
- - [Migrating environments](/docs/reference/migrating-environments) — four-key maps → three
202
201
 
203
202
  ## Next
204
203
 
@@ -210,7 +209,7 @@ See [Migrating environments](/docs/reference/migrating-environments).
210
209
  />
211
210
  <Card
212
211
  title="Introduction"
213
- description="The one law, eight elements, ten exports."
212
+ description="The one law, eight elements, one contract."
214
213
  href="/docs/get-started/introduction"
215
214
  />
216
215
  <Card
@@ -1,82 +1,54 @@
1
1
  ---
2
2
  title: Introduction
3
- description: Learn the one idea behind okengine — then the eight elements and ten exports you will use everywhere.
3
+ description: Learn the one idea behind okengine — then the eight elements and core programming vocabulary you will use everywhere.
4
4
  source: docs/spec/unified-theory.md
5
5
  icon: BookOpen
6
6
  ---
7
7
 
8
- A booking API, a nightly cleanup job, a receipt email, a row-change hook — in
9
- most stacks those are four frameworks. In OKE they are **one species** with one
10
- shape. Learn the shape once; only the trigger changes.
8
+ ## The One Idea
11
9
 
12
- <Callout title="The one rule">
13
- **Every backend behavior is a Flow:** `on(Trigger) → Effects`. There are no separate species
14
- called endpoints, handlers, consumers, jobs, or workflows.
15
- </Callout>
10
+ A booking API, a nightly cleanup job, a receipt email, a row-change hook — in most stacks those are four frameworks. In OKE they are **one species** with one shape. Learn the shape once; only the trigger changes.
16
11
 
17
- ## Quick start
12
+ > **The one rule**
13
+ > Every backend behavior is a **Flow**: `on(Trigger) → Effects`. There are no separate species called endpoints, handlers, consumers, jobs, or workflows.
18
14
 
19
- <Steps>
15
+ ## Quick Start
20
16
 
21
- <Step>
22
- ### Write one Flow
17
+ ### Write One Flow
23
18
 
24
19
  Four contracts plus a `do`. This is the standard starter's health check:
25
20
 
26
- ```typescript title="flows/main/health.ts"
27
- import { on, flow, http } from "okengine";
28
- import { z } from "zod";
29
-
30
- export const health = on(
31
- http.get().public(),
32
- flow({
33
- out: z.object({ ok: z.literal(true) }),
34
- do: () => ({ ok: true as const }),
35
- }),
36
- );
21
+ ```typescript
22
+ import { on, flow, http } from "okengine/http";
23
+
24
+ export const health = on(http.get().public(), flow({ do: () => ({ ok: true }) }));
37
25
  ```
38
26
 
39
27
  `main` omits the URL prefix, so this file is `GET /health` named `main.health`. See [Project structure](/docs/get-started/project-structure). Explicit `http.get("/health")` and `flow("main.health")` still win.
40
28
 
41
- </Step>
29
+ ### Change Only the Trigger
42
30
 
43
- <Step>
44
- ### Change only the trigger
31
+ Triggers define what starts the flow. Changing the trigger replaces the entire behavior while keeping the same structure:
45
32
 
46
33
  | Trigger | Starts when | Replaces |
47
34
  | ---------------------------------- | ------------------ | ------------------ |
48
- | `http.post("/bookings")` | a request arrives | endpoint · handler |
49
- | `every("10m")` | time passes | cron job |
50
- | `orderPlaced` (a signal) | another flow emits | queue consumer |
51
- | `db.table(users).changed("email")` | a row changes | CDC pipeline |
35
+ | `http.post("/bookings")` | A request arrives | Endpoint · handler |
36
+ | `every("10m")` | Time passes | Cron job |
37
+ | `orderPlaced` (a signal) | Another flow emits | Queue consumer |
38
+ | `db.table(users).changed("email")` | A row changes | CDC pipeline |
39
+
40
+ ```typescript
41
+ import { on, flow, http } from "okengine";
52
42
 
53
- ```typescript title="triggers"
54
43
  on(http.post("/bookings"), createBooking);
55
44
  on(every("10m"), expireStale);
56
45
  on(orderPlaced, sendReceipt);
57
46
  on(db.table(users).changed("email"), reverify);
58
47
  ```
59
48
 
60
- </Step>
61
-
62
- <Step>
63
- ### See what was derived
64
-
65
- Run `oke dev`. Four surfaces come up together — nothing configured by hand in
66
- a separate dashboard.
67
-
68
- <Surfaces />
69
-
70
- </Step>
71
-
72
- </Steps>
73
-
74
49
  ## Anatomy
75
50
 
76
- One pipeline. Only the trigger changes between an endpoint, a job, a consumer,
77
- and a row hook.
78
-
79
- <FlowShape />
51
+ One pipeline. Only the trigger changes between an endpoint, a job, a consumer, and a row hook.
80
52
 
81
53
  | Piece | Role |
82
54
  | ------------- | -------------------------------------------------------------- |
@@ -85,33 +57,25 @@ and a row hook.
85
57
  | **`do`** | The body — every read, write, emit, and call goes through `fx` |
86
58
  | **Effects** | Inferred from those `fx` calls — not hand-annotated |
87
59
 
88
- | Consequence | Follows from |
89
- | ---------------------------------- | -------------- |
90
- | One documentation path | One species |
91
- | One trace shape | One Flow model |
92
- | One thing for an AI agent to learn | One law |
93
-
94
- ## The `fx` rule
60
+ Consequence: One documentation path, one trace shape, one Flow model, one thing for an AI agent to learn.
95
61
 
96
- **All world access goes through `fx`.** A Flow that imports `node:fs`, calls
97
- `fetch` directly, or uses `Date.now()` is a defect.
62
+ ## The `fx` Rule
98
63
 
99
- | Inferred from `fx` touches | Without hand annotations |
100
- | -------------------------- | ------------------------ |
101
- | Cache invalidation keys | Yes |
102
- | Live queries | Yes |
103
- | Least-privilege tokens | Yes |
104
- | Deterministic tests | Yes |
105
- | Manifest Diff | Yes |
64
+ **All world access goes through `fx`.** A Flow that imports `node:fs`, calls `fetch` directly, or uses `Date.now()` is a defect.
106
65
 
107
- ## What the Manifest derives
66
+ | Inferred From | With `fx` |
67
+ | ----------------------- | --------- |
68
+ | Cache invalidation keys | Yes |
69
+ | Live queries | Yes |
70
+ | Least-privilege tokens | Yes |
71
+ | Deterministic tests | Yes |
72
+ | Manifest Diff | Yes |
108
73
 
109
- At build time OKE extracts a **Manifest** — a machine-readable description of
110
- your system. You do not maintain a second source of truth.
74
+ ## What the Manifest Derives
111
75
 
112
- <ManifestPipeline />
76
+ At build time OKE extracts a **Manifest** — a machine-readable description of your system. You do not maintain a second source of truth.
113
77
 
114
- | Surface | Port / place | You maintain? |
78
+ | Surface | Port / Place | You Maintain? |
115
79
  | --------------------------------- | ------------------ | ----------------------------- |
116
80
  | Typed client (`okengine/client`) | your app code | No separate codegen |
117
81
  | Console panels, traces, explorers | `:6533` | No |
@@ -119,47 +83,38 @@ your system. You do not maintain a second source of truth.
119
83
  | Architecture diagram | Console | No — it _is_ the effect graph |
120
84
  | Capability matrix + cache keys | compiler / runtime | No — from `fx` |
121
85
 
122
- ## Eight elements
86
+ ## The Eight Elements
123
87
 
124
- An element earns its place only if it has **irreducible physics**. New
125
- infrastructure becomes a new **driver** — never a ninth element.
88
+ An element earns its place only if it has **irreducible physics**. New infrastructure becomes a new **driver** — never a ninth element.
126
89
 
127
- <Features />
128
-
129
- | Element | Essence | Replaces the zoo of |
90
+ | Element | Essence | Replaces the Zoo |
130
91
  | ----------- | ----------------------------- | --------------------------------------------------------- |
131
- | **Flow** | behavior | endpoint · handler · consumer · job · workflow · webhook |
132
- | **Signal** | data in motion | queue · pub/sub · stream · websocket · SSE · event bus |
133
- | **Store** | data at rest | database · cache · KV · file storage · search index |
134
- | **Clock** | time | cron · delay · timeout · durable sleep · TTL |
135
- | **Gate** | permission to act | auth · session · ABAC · rate limit · quota · feature flag |
136
- | **Vault** | protected knowledge | secrets · config · environment |
137
- | **Channel** | reaching humans | email · SMS · WhatsApp · push |
138
- | **AI** | reaching machine intelligence | model calls · prompts · embeddings · agents · RAG |
92
+ | **Flow** | Behavior | endpoint · handler · consumer · job · workflow · webhook |
93
+ | **Signal** | Data in motion | queue · pub/sub · stream · websocket · SSE · event bus |
94
+ | **Store** | Data at rest | database · cache · KV · file storage · search index |
95
+ | **Clock** | Time | cron · delay · timeout · durable sleep · TTL |
96
+ | **Gate** | Permission to act | auth · session · ABAC · rate limit · quota · feature flag |
97
+ | **Vault** | Protected knowledge | secrets · config · environment |
98
+ | **Channel** | Reaching humans | email · SMS · WhatsApp · push |
99
+ | **AI** | Reaching machine intelligence | model calls · prompts · embeddings · agents · RAG |
139
100
 
140
- ## Ten exports
101
+ ## Core Programming Vocabulary
141
102
 
142
- The entire public vocabulary fits in one import. Everything else in the docs is
143
- derived from these ten names:
103
+ The core programming vocabulary fits in one import. Everything else in the docs is derived from these names:
144
104
 
145
- ```ts title="okengine"
105
+ ```ts
146
106
  import { on, flow, signal, store, clock, gate, vault, channel, ai, plugin } from "okengine";
147
107
  ```
148
108
 
149
- For HTTP-only apps, prefer the slim entry so the cold graph stays on the edge
150
- router:
109
+ For HTTP-only apps, prefer the slim entry so the cold graph stays on the edge:
151
110
 
152
- ```ts title="okengine/http"
111
+ ```ts
153
112
  import { on, flow, http, gate, oke, createBunRuntime } from "okengine/http";
154
113
  ```
155
114
 
156
- Heavy surfaces (`runs`, journal factories, compiler extract, the legacy
157
- mega-barrel) live on `okengine/runs`, `okengine/journal`, `okengine/compiler`,
158
- and `okengine/full`.
159
-
160
- <Vocabulary />
115
+ Heavy surfaces (runs, journal factories, compiler extract, the legacy mega-barrel) live on `okengine/runs`, `okengine/journal`, `okengine/compiler`, and `okengine/full`.
161
116
 
162
- ## Learn more
117
+ ## Learn More
163
118
 
164
119
  | Topic | Page |
165
120
  | ------- | ------------------------------------------------------------------------------- |
@@ -169,27 +124,9 @@ and `okengine/full`.
169
124
  | `fx` | [fx](/docs/reference/fx) |
170
125
  | Agents | [MCP](/docs/ai/mcp) · [Skills](/docs/ai/skills) · [llms.txt](/docs/ai/llms-txt) |
171
126
 
172
- ## Next
173
-
174
- <Cards>
175
- <Card
176
- title="Why OKE"
177
- description="Traditional backend pain — and what Manifest derivation closes."
178
- href="/docs/get-started/why"
179
- />
180
- <Card
181
- title="Installation"
182
- description="Scaffold with create-oke and open the Console."
183
- href="/docs/get-started/installation"
184
- />
185
- <Card
186
- title="Basic Usage"
187
- description="Health Flow, typed client, and bun:test."
188
- href="/docs/get-started/basic-usage"
189
- />
190
- <Card
191
- title="Project structure"
192
- description="Folders are the URL; unit plus export is the name."
193
- href="/docs/get-started/project-structure"
194
- />
195
- </Cards>
127
+ ## Next Steps
128
+
129
+ - [Why OKE](/docs/get-started/why)
130
+ - [Installation](/docs/get-started/installation)
131
+ - [Basic Usage](/docs/get-started/basic-usage)
132
+ - [Project Structure](/docs/get-started/project-structure)
@@ -1,5 +1,13 @@
1
1
  {
2
2
  "title": "Get Started",
3
3
  "icon": "Rocket",
4
- "pages": ["index", "introduction", "why", "installation", "basic-usage", "project-structure"]
4
+ "pages": [
5
+ "index",
6
+ "why",
7
+ "introduction",
8
+ "installation",
9
+ "basic-usage",
10
+ "testing",
11
+ "project-structure"
12
+ ]
5
13
  }
@@ -561,10 +561,7 @@ export const archive = on(
561
561
  <Tab value="(public)">
562
562
 
563
563
  ```typescript title="flows/main/(public)/health.ts"
564
- export const health = on(
565
- http.get().public(),
566
- flow({ out: z.object({ ok: z.literal(true) }), do: () => ({ ok: true as const }) }),
567
- );
564
+ export const health = on(http.get().public(), flow({ do: () => ({ ok: true }) }));
568
565
  // still GET /health named main.health
569
566
  ```
570
567
 
@@ -635,13 +632,9 @@ Do not put `index.ts` next to `health.ts` — that mix is a generate error. Use
635
632
  <Tab value="health.ts">
636
633
 
637
634
  ```typescript title="flows/main/health.ts"
638
- export const health = on(
639
- http.get().public(),
640
- flow({
641
- out: z.object({ ok: z.literal(true) }),
642
- do: () => ({ ok: true as const }),
643
- }),
644
- );
635
+ import { on, flow, http } from "okengine/http";
636
+
637
+ export const health = on(http.get().public(), flow({ do: () => ({ ok: true }) }));
645
638
  // GET /health name main.health
646
639
  ```
647
640