okengine 0.10.2 → 0.11.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.
- package/package.json +76 -10
- package/site/content/docs/ai/mcp.mdx +0 -1
- package/site/content/docs/deployment/docker-swarm.mdx +48 -111
- package/site/content/docs/deployment/docker.mdx +43 -36
- package/site/content/docs/deployment/index.mdx +9 -9
- package/site/content/docs/deployment/kubernetes.mdx +4 -4
- package/site/content/docs/elements/ai.mdx +7 -13
- package/site/content/docs/elements/channel.mdx +9 -13
- package/site/content/docs/elements/clock.mdx +8 -14
- package/site/content/docs/elements/flow.mdx +46 -54
- package/site/content/docs/elements/gate.mdx +6 -11
- package/site/content/docs/elements/signal.mdx +2 -8
- package/site/content/docs/elements/store.mdx +79 -93
- package/site/content/docs/elements/vault.mdx +89 -76
- package/site/content/docs/get-started/basic-usage.mdx +8 -14
- package/site/content/docs/get-started/installation.mdx +36 -36
- package/site/content/docs/get-started/introduction.mdx +11 -0
- package/site/content/docs/get-started/why.mdx +3 -4
- package/site/content/docs/index.mdx +0 -1
- package/site/content/docs/meta.json +0 -1
- package/site/content/docs/plugins/anonymous.mdx +1 -1
- package/site/content/docs/plugins/magic-link.mdx +11 -11
- package/site/content/docs/plugins/otp.mdx +2 -2
- package/site/content/docs/plugins/passkey.mdx +1 -1
- package/site/content/docs/plugins/two-factor.mdx +1 -1
- package/site/content/docs/plugins/username.mdx +1 -1
- package/site/content/docs/recipes/caddy.mdx +1 -1
- package/site/content/docs/recipes/cockroachdb.mdx +2 -2
- package/site/content/docs/recipes/dragonfly.mdx +1 -1
- package/site/content/docs/recipes/index.mdx +1 -2
- package/site/content/docs/recipes/llama-cpp.mdx +21 -23
- package/site/content/docs/recipes/mailpit.mdx +11 -11
- package/site/content/docs/recipes/meilisearch.mdx +10 -10
- package/site/content/docs/recipes/meta.json +0 -1
- package/site/content/docs/recipes/ollama.mdx +1 -1
- package/site/content/docs/recipes/pgdog.mdx +12 -9
- package/site/content/docs/recipes/postgres.mdx +3 -3
- package/site/content/docs/recipes/redis.mdx +2 -2
- package/site/content/docs/recipes/rustfs.mdx +10 -7
- package/site/content/docs/recipes/sglang.mdx +1 -1
- package/site/content/docs/recipes/supabase-docker.mdx +1 -1
- package/site/content/docs/recipes/timescale.mdx +2 -2
- package/site/content/docs/recipes/valkey.mdx +1 -1
- package/site/content/docs/recipes/vllm.mdx +1 -1
- package/site/content/docs/recipes/yugabytedb.mdx +2 -2
- package/site/content/docs/reference/cli.md +61 -38
- package/site/content/docs/reference/configuration.mdx +145 -70
- package/site/content/docs/reference/environment-variables.mdx +36 -28
- package/site/content/docs/reference/errors.mdx +28 -29
- package/site/content/docs/reference/fx.mdx +14 -7
- package/site/content/docs/reference/i18n.mdx +17 -6
- package/site/content/docs/reference/index.mdx +5 -0
- package/site/content/docs/reference/meta.json +1 -0
- package/site/content/docs/reference/migrating-environments.mdx +158 -0
- package/site/content/docs/reference/plugins.mdx +2 -2
- package/src/auth/gate-auth.test.ts +12 -10
- package/src/cli/ai-setup/ai-setup.test.ts +30 -16
- package/src/cli/ai-setup/apply.ts +111 -15
- package/src/cli/ai-setup/catalog.ts +3 -3
- package/src/cli/ai-setup/index.ts +1 -1
- package/src/cli/ai-setup/prompts.ts +1 -1
- package/src/cli/ai-setup/recommend.test.ts +1 -1
- package/src/cli/ask-seed.test.ts +3 -3
- package/src/cli/build.ts +8 -9
- package/src/cli/db-auto-push.test.ts +6 -3
- package/src/cli/db-auto-push.ts +7 -5
- package/src/cli/db-seed.ts +7 -8
- package/src/cli/db.test.ts +70 -71
- package/src/cli/db.ts +86 -12
- package/src/cli/dev-controller.test.ts +35 -0
- package/src/cli/dev-controller.ts +298 -0
- package/src/cli/dev-controls.ts +11 -65
- package/src/cli/dev-db-push.test.ts +47 -15
- package/src/cli/dev-schema-sync.test.ts +11 -11
- package/src/cli/dev-schema-sync.ts +10 -10
- package/src/cli/dev-session-lock.test.ts +106 -0
- package/src/cli/dev-session-lock.ts +209 -0
- package/src/cli/dev.test.ts +246 -114
- package/src/cli/dev.ts +153 -205
- package/src/cli/doc-staleness.test.ts +3 -6
- package/src/cli/docker-clean.test.ts +33 -1
- package/src/cli/docker-clean.ts +28 -33
- package/src/cli/docker-cli.test.ts +12 -11
- package/src/cli/docker.ts +95 -20
- package/src/cli/doctor.test.ts +40 -0
- package/src/cli/doctor.ts +142 -9
- package/src/cli/drizzle-env.test.ts +11 -13
- package/src/cli/drizzle-env.ts +18 -11
- package/src/cli/ensure-drizzle-config.ts +11 -14
- package/src/cli/hero-meta.test.ts +15 -15
- package/src/cli/hero-meta.ts +10 -9
- package/src/cli/index.ts +36 -6
- package/src/cli/load-config.images.test.ts +44 -10
- package/src/cli/load-config.source.test.ts +50 -0
- package/src/cli/load-config.ts +35 -29
- package/src/cli/meilisearch-local.ts +1 -2
- package/src/cli/mode.ts +7 -58
- package/src/cli/registry.ts +175 -19
- package/src/cli/resolve-dev-sql-env.test.ts +8 -16
- package/src/cli/resolve-dev-sql-env.ts +13 -15
- package/src/cli/safe-defaults.test.ts +29 -11
- package/src/cli/schema.ts +65 -16
- package/src/cli/test.ts +58 -0
- package/src/cli/tui/App.tsx +252 -0
- package/src/cli/tui/DevLive.tsx +116 -0
- package/src/cli/tui/components/ConfirmDialog.tsx +48 -0
- package/src/cli/tui/components/HeaderBar.tsx +67 -0
- package/src/cli/tui/components/LogStream.tsx +47 -0
- package/src/cli/tui/components/PanelCard.tsx +39 -0
- package/src/cli/tui/components/SelectRow.tsx +37 -0
- package/src/cli/tui/components/SlashPalette.tsx +172 -0
- package/src/cli/tui/components/Spinner.tsx +32 -0
- package/src/cli/tui/components/StatusBar.tsx +51 -0
- package/src/cli/tui/components/StatusDot.tsx +37 -0
- package/src/cli/tui/components/TabBar.tsx +49 -0
- package/src/cli/tui/components/Wordmark.tsx +43 -0
- package/src/cli/tui/format.ts +38 -0
- package/src/cli/tui/keys.test.ts +18 -0
- package/src/cli/tui/keys.ts +26 -0
- package/src/cli/tui/launch.test.ts +18 -0
- package/src/cli/tui/launch.ts +57 -0
- package/src/cli/tui/panels/Dashboard.tsx +201 -0
- package/src/cli/tui/panels/Database.tsx +198 -0
- package/src/cli/tui/panels/Dev.tsx +257 -0
- package/src/cli/tui/panels/Docker.tsx +357 -0
- package/src/cli/tui/panels/Navigator.test.ts +22 -0
- package/src/cli/tui/panels/Navigator.tsx +213 -0
- package/src/cli/tui/slash-catalog.test.ts +31 -0
- package/src/cli/tui/slash-catalog.ts +184 -0
- package/src/cli/tui/slash-run.ts +54 -0
- package/src/cli/tui/state/ports.ts +95 -0
- package/src/cli/tui/theme.ts +24 -0
- package/src/cli/vault-cmd.test.ts +402 -0
- package/src/cli/vault-cmd.ts +727 -69
- package/src/cli/vault-secure-input.test.ts +56 -0
- package/src/cli/vault-secure-input.ts +124 -0
- package/src/compiler/effects-infer.ts +7 -0
- package/src/compiler/extract.ts +12 -0
- package/src/compiler/fixtures/skyport/oke.config.ts +7 -5
- package/src/compiler/fixtures/skyport/src/flows/payments/index.ts +1 -1
- package/src/compiler/fixtures/skyport.expected.json +1 -1
- package/src/compiler/generate-adopt.ts +27 -1
- package/src/compiler-entry.ts +7 -0
- package/src/config/define-config.test.ts +111 -47
- package/src/config/driver-defaults.test.ts +115 -0
- package/src/config/driver-defaults.ts +156 -0
- package/src/config/index.ts +246 -131
- package/src/config/resolve-driver.test.ts +14 -19
- package/src/console/server/app.ts +4 -2
- package/src/console/server/console.test.ts +58 -1
- package/src/console/server/flows.ts +22 -2
- package/src/console/server/index.ts +3 -0
- package/src/console/server/operator-db.test.ts +55 -13
- package/src/console/server/operator-db.ts +305 -263
- package/src/console/server/serve.ts +16 -7
- package/src/console/server/state.ts +31 -9
- package/src/console/server/vault.test.ts +120 -5
- package/src/console/server/vault.ts +208 -12
- package/src/console/ui/dist/assets/{index-D-9KFce5.js → index--Y0Uaz-m.js} +2 -2
- package/src/console/ui/dist/assets/panel-vault-BkZdJPX8.js +1 -0
- package/src/console/ui/dist/assets/style-C3L349iZ.css +3 -0
- package/src/console/ui/dist/index.html +2 -2
- package/src/console/ui/shell/client.ts +16 -0
- package/src/console/ui/shell/panels/vault/VaultPanel.tsx +54 -1
- package/src/console/ui/vault/VaultA11yView.tsx +33 -1
- package/src/console/ui/vault/backend.test.ts +75 -0
- package/src/console/ui/vault/backend.ts +117 -0
- package/src/console/ui/vault/fixture.ts +21 -2
- package/src/console/ui/vault/index.ts +11 -1
- package/src/console/ui/vault/types.ts +26 -0
- package/src/docker/compose.ts +164 -61
- package/src/docker/derive.ts +106 -12
- package/src/docker/docker.test.ts +156 -110
- package/src/docker/helpers.ts +98 -0
- package/src/docker/images-config.test.ts +163 -0
- package/src/docker/index.ts +30 -5
- package/src/docker/recipes/index.ts +0 -3
- package/src/docker/recipes/llama-cpp.ts +4 -4
- package/src/docker/recipes/pgdog.ts +9 -2
- package/src/docker/resources.test.ts +71 -0
- package/src/docker/resources.ts +176 -0
- package/src/docker/stack-id.test.ts +11 -4
- package/src/docker/stack-id.ts +42 -32
- package/src/docker/stack.integration.test.ts +4 -15
- package/src/docker/types.ts +35 -3
- package/src/drivers/ai-ollama.integration.test.ts +2 -2
- package/src/drivers/conformance.test.ts +11 -12
- package/src/drivers/drizzle-dialect.test.ts +0 -4
- package/src/drivers/drizzle-dialect.ts +7 -13
- package/src/drivers/index.ts +24 -7
- package/src/drivers/journal-postgres.test.ts +3 -1
- package/src/drivers/journal-postgres.ts +4 -2
- package/src/drivers/meilisearch.ts +1 -1
- package/src/drivers/pglite.ts +28 -5
- package/src/drivers/types.ts +9 -11
- package/src/drivers/vault-aws-secrets-manager.test.ts +159 -0
- package/src/drivers/vault-aws-secrets-manager.ts +333 -0
- package/src/drivers/vault-builtin.test.ts +110 -0
- package/src/drivers/vault-builtin.ts +184 -0
- package/src/drivers/vault-driver-removal.test.ts +13 -0
- package/src/drivers/vault-managed.test.ts +95 -0
- package/src/drivers/vault-managed.ts +101 -25
- package/src/drivers/vault-types.ts +25 -5
- package/src/elements/ai/runtime.ts +1 -1
- package/src/elements/clock/chaos.test.ts +4 -1
- package/src/elements/clock/durable.ts +57 -4
- package/src/elements/clock.test.ts +13 -14
- package/src/elements/gate/constants.ts +18 -0
- package/src/elements/gate.test.ts +1 -1
- package/src/elements/gate.ts +2 -2
- package/src/elements/store/domain-ddl.test.ts +5 -12
- package/src/elements/store/emit-drizzle.ts +44 -19
- package/src/elements/store/index-boot.test.ts +15 -116
- package/src/elements/store/load-plugin-tables.ts +1 -1
- package/src/elements/store/resource-list-docs.fixture.ts +12 -6
- package/src/elements/store/resource-list-docs.test.ts +64 -44
- package/src/elements/store/resource.test.ts +17 -10
- package/src/elements/store/runtime.ts +9 -12
- package/src/elements/store/schema-decl.test.ts +16 -32
- package/src/elements/store/seed.test.ts +1 -2
- package/src/elements/store/seed.ts +7 -8
- package/src/elements/store/sql-condition.test.ts +2 -2
- package/src/elements/store/sql-session.test.ts +8 -10
- package/src/elements/store/sql-session.ts +10 -2
- package/src/elements/store.test.ts +13 -13
- package/src/elements/vault/audit.ts +233 -0
- package/src/elements/vault/boot-chain.test.ts +78 -0
- package/src/elements/vault/boot-chain.ts +43 -39
- package/src/elements/vault/builtin-adapter.test.ts +479 -0
- package/src/elements/vault/builtin-adapter.ts +1184 -0
- package/src/elements/vault/crypto.test.ts +237 -0
- package/src/elements/vault/crypto.ts +431 -0
- package/src/elements/vault/declare.ts +164 -3
- package/src/elements/vault/errors.ts +56 -0
- package/src/elements/vault/kms-unseal.test.ts +76 -0
- package/src/elements/vault/kms-unseal.ts +181 -0
- package/src/elements/vault/path.ts +90 -0
- package/src/elements/vault/resilience.test.ts +102 -0
- package/src/elements/vault/resilience.ts +107 -0
- package/src/elements/vault/runtime.ts +36 -4
- package/src/elements/vault/security-checklist.test.ts +130 -0
- package/src/elements/vault/storage.ts +448 -0
- package/src/elements/vault/types.ts +288 -0
- package/src/elements/vault/unseal.ts +150 -0
- package/src/elements/vault.test.ts +72 -4
- package/src/elements/vault.ts +91 -2
- package/src/full.ts +248 -0
- package/src/http.ts +41 -0
- package/src/i18n/interpolate-simple.ts +37 -0
- package/src/i18n/messages.ts +51 -4
- package/src/i18n-entry.ts +7 -0
- package/src/index.ts +35 -145
- package/src/journal-entry.ts +20 -0
- package/src/kernel/adopt-barrel-fresh.test.ts +25 -10
- package/src/kernel/app.ts +40 -42
- package/src/kernel/auto-registry.test.ts +2 -2
- package/src/kernel/boot-bind/ai.test.ts +5 -5
- package/src/kernel/boot-bind/ai.ts +2 -1
- package/src/kernel/boot-bind/channel.test.ts +6 -6
- package/src/kernel/boot-bind/channel.ts +5 -4
- package/src/kernel/boot-bind/clock.ts +5 -5
- package/src/kernel/boot-bind/gate.ts +6 -7
- package/src/kernel/boot-bind/honor-config.test.ts +42 -42
- package/src/kernel/boot-bind/journal.ts +5 -5
- package/src/kernel/boot-bind/signal.ts +3 -1
- package/src/kernel/boot-bind/store.test.ts +55 -37
- package/src/kernel/boot-bind/store.ts +24 -34
- package/src/kernel/boot-bind/vault.ts +19 -4
- package/src/kernel/boot.test.ts +12 -4
- package/src/kernel/boot.ts +31 -19
- package/src/kernel/budget-entry.ts +1 -1
- package/src/kernel/compensate.test.ts +288 -1
- package/src/kernel/compensate.ts +126 -0
- package/src/kernel/concurrency.test.ts +10 -9
- package/src/kernel/effects-stamping.test.ts +27 -2
- package/src/kernel/element-registries.ts +5 -3
- package/src/kernel/flow.ts +4 -2
- package/src/kernel/fx.test.ts +119 -3
- package/src/kernel/fx.ts +215 -40
- package/src/kernel/index.ts +14 -0
- package/src/kernel/journal.ts +130 -7
- package/src/kernel/pipeline.test.ts +20 -6
- package/src/kernel/redacted.test.ts +35 -0
- package/src/kernel/redacted.ts +24 -2
- package/src/kernel/router/create-default.ts +16 -0
- package/src/kernel/router/create-edge.ts +18 -0
- package/src/kernel/router/create.ts +23 -0
- package/src/kernel/router/index.ts +23 -0
- package/src/kernel/router/linear.ts +88 -0
- package/src/kernel/router/regexp.ts +188 -0
- package/src/kernel/router/smart.ts +120 -0
- package/src/kernel/router/trie.ts +108 -0
- package/src/kernel/router/types.ts +56 -0
- package/src/kernel/router.ts +18 -532
- package/src/kernel-entry.ts +43 -0
- package/src/manifest/fixtures/skyport.excerpt.json +1 -1
- package/src/manifest/fixtures/skyport.manifest.json +1 -1
- package/src/plugins/config-source.test.ts +7 -7
- package/src/release/build-lib.ts +58 -0
- package/src/release/exports.test.ts +4 -2
- package/src/release/exports.ts +30 -4
- package/src/release/measure.ts +101 -22
- package/src/runs/duckdb.ts +7 -2
- package/src/shared/optional-peer.ts +41 -0
- package/src/term.test.ts +3 -44
- package/src/test/create-test-app.ts +12 -0
- package/src/test/provisions.integration.test.ts +1 -1
- package/src/test/reset-element-registries.ts +2 -0
- package/src/upgrade/codemods.test.ts +7 -20
- package/src/upgrade/codemods.ts +93 -60
- package/site/content/docs/console/access.mdx +0 -29
- package/site/content/docs/console/ai.mdx +0 -35
- package/site/content/docs/console/architecture.mdx +0 -35
- package/site/content/docs/console/channels.mdx +0 -37
- package/site/content/docs/console/clock.mdx +0 -51
- package/site/content/docs/console/flows.mdx +0 -31
- package/site/content/docs/console/gates.mdx +0 -73
- package/site/content/docs/console/index.mdx +0 -54
- package/site/content/docs/console/manifest-diff.mdx +0 -34
- package/site/content/docs/console/meta.json +0 -24
- package/site/content/docs/console/overview.mdx +0 -40
- package/site/content/docs/console/plugins.mdx +0 -41
- package/site/content/docs/console/privacy.mdx +0 -32
- package/site/content/docs/console/runs.mdx +0 -50
- package/site/content/docs/console/signals.mdx +0 -40
- package/site/content/docs/console/store.mdx +0 -32
- package/site/content/docs/console/tenancy.mdx +0 -32
- package/site/content/docs/console/traces.mdx +0 -38
- package/site/content/docs/console/vault.mdx +0 -41
- package/site/content/docs/recipes/openbao.mdx +0 -141
- package/src/cli/ask-dev-mode.ts +0 -40
- package/src/cli/dev-mode.test.ts +0 -45
- package/src/cli/dev-mode.ts +0 -78
- package/src/cli/openbao-bootstrap.test.ts +0 -150
- package/src/cli/openbao-bootstrap.ts +0 -321
- package/src/cli/openbao-restart.integration.test.ts +0 -145
- package/src/console/ui/dist/assets/panel-vault-Za1GyJfM.js +0 -1
- package/src/console/ui/dist/assets/style-C8MxEWPd.css +0 -3
- package/src/docker/recipes/openbao.ts +0 -47
- package/src/drivers/libsql.ts +0 -179
- package/src/drivers/sqlite.ts +0 -44
- package/src/drivers/vault-openbao.test.ts +0 -97
- package/src/drivers/vault-openbao.ts +0 -143
|
@@ -55,7 +55,7 @@ oke vault set STRIPE_KEY sk_test_your_key_here
|
|
|
55
55
|
<Step>
|
|
56
56
|
### Read it in a Flow
|
|
57
57
|
|
|
58
|
-
Flows read secrets through `fx.vault` — never through `process.env`.
|
|
58
|
+
Flows read secrets through `fx.vault.get` — never through `process.env`. It resolves to a
|
|
59
59
|
`Redacted<string>`: printing, logging, or serializing it yields a placeholder, never the value.
|
|
60
60
|
Call `.reveal()` once at the boundary that needs the real credential:
|
|
61
61
|
|
|
@@ -66,7 +66,7 @@ export const charge = on(
|
|
|
66
66
|
in: ChargeInput,
|
|
67
67
|
out: z.object({ id: z.string() }),
|
|
68
68
|
do: async (input, fx) => {
|
|
69
|
-
const key = fx.vault(stripeKey); // Redacted — safe to pass to fx.log
|
|
69
|
+
const key = await fx.vault.get(stripeKey); // Redacted — safe to pass to fx.log
|
|
70
70
|
const intent = await stripe(key.reveal()).create(input);
|
|
71
71
|
return { id: intent.id };
|
|
72
72
|
},
|
|
@@ -87,9 +87,9 @@ That's the whole loop: declare → set → read. Everything below is what OKE gu
|
|
|
87
87
|
|
|
88
88
|
<VaultRedacted />
|
|
89
89
|
|
|
90
|
-
Pass the wrapper freely — `fx.log`, `String()`,
|
|
91
|
-
`
|
|
92
|
-
credential.
|
|
90
|
+
Pass the wrapper freely — `fx.log`, `String()`, `JSON.stringify`, and
|
|
91
|
+
`console.log` / `util.inspect` all yield `[redacted]` (or a `Redacted<…>` label).
|
|
92
|
+
Call `.reveal()` once at the provider boundary that needs the credential.
|
|
93
93
|
|
|
94
94
|
## Two kinds of contracts
|
|
95
95
|
|
|
@@ -100,6 +100,20 @@ credential.
|
|
|
100
100
|
|
|
101
101
|
`vault(name, …)` is shorthand for `vault.secret(name, …)`.
|
|
102
102
|
|
|
103
|
+
### Plain environment variables
|
|
104
|
+
|
|
105
|
+
`vault.env` reads `process.env` synchronously for values that need no contract — a port, a feature flag, a log level. It never joins the resolution chain, never gets a fingerprint, and never gets redacted.
|
|
106
|
+
|
|
107
|
+
| Call | Returns | On a missing value |
|
|
108
|
+
| -------------------------------- | --------------------- | -------------------------------------- |
|
|
109
|
+
| `vault.env("LOG_LEVEL")` | `string \| undefined` | `undefined` (empty counts as missing) |
|
|
110
|
+
| `vault.env.required("REGION")` | `string` | Throws, and boot lists it as a gap |
|
|
111
|
+
| `vault.env.int("PORT", 3000)` | `number` | The default; throws when none is given |
|
|
112
|
+
| `vault.env.bool("DEBUG", false)` | `boolean` | The default; throws when none is given |
|
|
113
|
+
| `vault.env.json("FLAGS")` | `T \| undefined` | `undefined`; throws on malformed JSON |
|
|
114
|
+
|
|
115
|
+
Every name passed to `vault.env.required` is registered, so boot reports missing variables in the same `VaultBootError` as missing secrets — before it opens a database connection.
|
|
116
|
+
|
|
103
117
|
### Contract options
|
|
104
118
|
|
|
105
119
|
| Option | Type | Meaning |
|
|
@@ -110,9 +124,9 @@ credential.
|
|
|
110
124
|
| `dev` | string | Local-only fallback when no source provides a value (never used in prod) |
|
|
111
125
|
| `sensitive` | boolean | Override the default (`true` for secrets, `false` for config) |
|
|
112
126
|
|
|
113
|
-
### Zero-setup
|
|
127
|
+
### Zero-setup Compose fallback
|
|
114
128
|
|
|
115
|
-
`dev: vault.fromDocker("store.sql")` resolves the connection URL that `oke dev
|
|
129
|
+
`dev: vault.fromDocker("store.sql")` resolves the connection URL that `oke dev` generated for that role — no manual copying of Postgres URLs:
|
|
116
130
|
|
|
117
131
|
```typescript
|
|
118
132
|
export const dbUrl = vault.secret("DATABASE_URL", {
|
|
@@ -140,85 +154,82 @@ VaultBootError: 1 secret(s) missing:
|
|
|
140
154
|
|
|
141
155
|
## Setting and rotating values
|
|
142
156
|
|
|
143
|
-
| Command
|
|
144
|
-
|
|
|
145
|
-
| `oke vault set NAME value`
|
|
146
|
-
| `oke vault list`
|
|
147
|
-
| `oke vault import <file>`
|
|
157
|
+
| Command | What it does |
|
|
158
|
+
| -------------------------------------------------- | -------------------------------------------------------------------- |
|
|
159
|
+
| `oke vault set NAME value` | Write a value to the env file (`.env.local` by default) |
|
|
160
|
+
| `oke vault list` | List names present in the active store |
|
|
161
|
+
| `oke vault import <file>` | Bulk-import names from a dotenv file |
|
|
162
|
+
| `oke vault init` | Initialize the built-in encrypted store (prints the master key once) |
|
|
163
|
+
| `oke vault status` / `seal` / `unseal` | Built-in seal lifecycle |
|
|
164
|
+
| `oke vault rotate <path>` / `rotate-master` | Re-encrypt a secret, or rewrap every DEK under a new master |
|
|
165
|
+
| `oke vault audit` / `audit verify` / `audit purge` | Hash-chained audit (no secret values) |
|
|
166
|
+
| `oke vault purge-expired [--dry-run] [--before]` | Hard-delete secret rows past `expires_at` (operator cleanup) |
|
|
167
|
+
| `oke vault backup` / `restore` | Encrypted backup under a separate backup KEK |
|
|
148
168
|
|
|
149
|
-
|
|
169
|
+
Flows can write too, through the same capability gate as reads: `fx.vault.set(path, value, { ttlMs?, metadata? })`, `fx.vault.rotate(path, value)`, `fx.vault.delete(path)`, plus `fx.vault.list(prefix?)` and `fx.vault.status()`. These need the encrypted-at-rest backend (`drivers.vault = "vault"`) and throw without it; `fx.vault.get` works on every app.
|
|
150
170
|
|
|
151
171
|
The **Console** (`:6533`) can also set and rotate values, but it is **write-only**: it shows a salted fingerprint (`sha256:…`) per secret, never the cleartext. When you rotate a key there, the panel shows the **blast radius** — which in-flight durable runs will wake up with the new value.
|
|
152
172
|
|
|
173
|
+
<Callout title="Builtin master keys and expired rows">
|
|
174
|
+
Resolve the master key with `--key -` (stdin), `OKE_VAULT_MASTER_KEY`, or a hidden TTY prompt —
|
|
175
|
+
never put keys on argv in shared shells (history risk). Expired rows stay until `oke vault
|
|
176
|
+
purge-expired` (use `--dry-run` first, or schedule via cron).
|
|
177
|
+
</Callout>
|
|
178
|
+
|
|
153
179
|
<Callout title="Secrets never reach logs">
|
|
154
|
-
`fx.vault` returns `Redacted` — `fx.log` shows `[redacted]`. A revealed string that still
|
|
155
|
-
a log is scrubbed by the boot redactor to `[redacted:secret]`. Traces and the Console get
|
|
180
|
+
`fx.vault.get` returns `Redacted` — `fx.log` shows `[redacted]`. A revealed string that still
|
|
181
|
+
reaches a log is scrubbed by the boot redactor to `[redacted:secret]`. Traces and the Console get
|
|
156
182
|
fingerprints, never cleartext.
|
|
157
183
|
</Callout>
|
|
158
184
|
|
|
159
185
|
## Per-environment drivers
|
|
160
186
|
|
|
161
|
-
Which backend holds your values depends on the
|
|
187
|
+
Which backend holds your values depends on the environment — configured once in `oke.config.ts`.
|
|
162
188
|
App boot and the Console share the same resolution-chain builder (`env` layers → backend):
|
|
163
189
|
|
|
164
190
|
```typescript title="oke.config.ts"
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
191
|
+
drivers: {
|
|
192
|
+
vault: {
|
|
193
|
+
dev: "env", // process env / .env.local
|
|
194
|
+
test: "memory",
|
|
195
|
+
prod: "vault", // built-in encrypted store (Postgres you already run)
|
|
196
|
+
},
|
|
170
197
|
},
|
|
171
198
|
```
|
|
172
199
|
|
|
173
|
-
|
|
174
|
-
| --------- | --------------- | ------------------------------------------ |
|
|
175
|
-
| `env` | `.env.local` | Local loop — no infra at all |
|
|
176
|
-
| `openbao` | OpenBao (KV v2) | Docker + prod — durable, access-controlled |
|
|
177
|
-
| `memory` | in-process map | Tests |
|
|
200
|
+
Defaults are `env` / `memory` / `vault`. create-oke templates pin the built-in store for prod.
|
|
178
201
|
|
|
179
|
-
|
|
202
|
+
| Driver | Backend | Best for |
|
|
203
|
+
| --------- | ------------------------------------------------------------------- | ---------------------------------- |
|
|
204
|
+
| `env` | process env | Local pins — no encryption at rest |
|
|
205
|
+
| `vault` | Postgres/PGlite envelope (AES-256-GCM) | Default prod — no extra container |
|
|
206
|
+
| `managed` | AWS Secrets Manager (`OKE_VAULT_PROVIDER`) or platform-injected env | Cloud SM / Fly / Railway / K8s |
|
|
207
|
+
| `memory` | in-process map | Tests |
|
|
180
208
|
|
|
181
|
-
|
|
209
|
+
### Threat model (honest)
|
|
182
210
|
|
|
183
|
-
|
|
211
|
+
Built-in Vault protects a **database dump** (ciphertext + wrapped DEKs). It does **not** equal a separate process-isolated vault:
|
|
184
212
|
|
|
185
|
-
|
|
213
|
+
| Threat | Built-in `vault` | Managed AWS SM / remote vault |
|
|
214
|
+
| --------------------------------------------- | ---------------------------------- | ----------------------------- |
|
|
215
|
+
| Postgres dump / backup leak | Protected (need master/KEK) | Protected |
|
|
216
|
+
| App RCE / memory dump | Game over (same process) | Better if vault is isolated |
|
|
217
|
+
| Master key only in `.env` next to app secrets | Weak — use KMS auto-unseal in prod | Prefer non-exportable KEK |
|
|
218
|
+
| JS `Buffer.fill(0)` vs remote `mlock` | Hygiene only — not claimed | Stronger outside the app |
|
|
186
219
|
|
|
187
|
-
|
|
188
|
-
### First boot is automatic
|
|
220
|
+
For production built-in stores, set `vault.encryption.masterKey` to a KMS source (optional peer `@aws-sdk/client-kms`) or use `managed` + AWS Secrets Manager. `oke doctor` warns when prod would take the master key from the environment.
|
|
189
221
|
|
|
190
|
-
|
|
222
|
+
## Managed providers (official)
|
|
191
223
|
|
|
192
|
-
|
|
224
|
+
Official managed provider: **AWS Secrets Manager** — set `drivers.vault` to `"managed"` and
|
|
225
|
+
`OKE_VAULT_PROVIDER=aws-secrets-manager` (optional peer `@aws-sdk/client-secrets-manager`).
|
|
226
|
+
Omit the provider when the platform already injects secrets as env vars.
|
|
193
227
|
|
|
194
|
-
|
|
195
|
-
### Keys stay on the host
|
|
196
|
-
|
|
197
|
-
The unseal key and root token are written to `.oke/openbao/` (mode `0600`, gitignored) — never into `docker/.env.docker`, never into YAML. Only the least-privilege app token lands in `.env.docker` as `OKE_VAULT_TOKEN`.
|
|
198
|
-
|
|
199
|
-
</Step>
|
|
228
|
+
## Community / plugin
|
|
200
229
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
On every later start OKE detects the sealed vault and unseals it with the host key. Secrets set before a container restart are still there after it — proven by an integration test, not assumed.
|
|
205
|
-
|
|
206
|
-
</Step>
|
|
207
|
-
|
|
208
|
-
</Steps>
|
|
209
|
-
|
|
210
|
-
| File | Holds | Used by |
|
|
211
|
-
| ------------------------- | ------------------------- | -------------------------------- |
|
|
212
|
-
| `.oke/openbao/unseal.key` | The single unseal share | `oke` (every start) |
|
|
213
|
-
| `.oke/openbao/root.token` | Root token | `oke` (policy sync / token mint) |
|
|
214
|
-
| `.oke/openbao/app.token` | Least-privilege app token | the app + Console |
|
|
215
|
-
|
|
216
|
-
<Callout title="Single point of failure — read this once" type="warn">
|
|
217
|
-
Back up `.oke/openbao/unseal.key` to a separate safe location. Losing it means losing every secret
|
|
218
|
-
permanently, with no recovery.
|
|
219
|
-
</Callout>
|
|
220
|
-
|
|
221
|
-
This is by design: self-hosted single-node, Shamir 1-of-1, no cloud KMS. If OpenBao is initialized but the key is gone, boot fails with an explicit permanent-loss error — it never silently starts empty.
|
|
230
|
+
OpenBao, HashiCorp Vault, Azure Key Vault, GCP Secret Manager, Doppler, and 1Password are not
|
|
231
|
+
shipped in core. Implement a community adapter for the `managed` driver surface, or keep using
|
|
232
|
+
built-in `vault` / `env`.
|
|
222
233
|
|
|
223
234
|
## Troubleshooting
|
|
224
235
|
|
|
@@ -228,31 +239,38 @@ This is by design: self-hosted single-node, Shamir 1-of-1, no cloud KMS. If Open
|
|
|
228
239
|
A contract has no value in any layer of the chain. Fix by providing it in exactly one place:
|
|
229
240
|
|
|
230
241
|
- locally: add `NAME=value` to `.env.local` (or run `oke vault set NAME value`)
|
|
231
|
-
-
|
|
232
|
-
- CI / hosting: set a real environment variable
|
|
242
|
+
- built-in store: `oke vault init` then unseal, or set via Console (write-only)
|
|
243
|
+
- CI / hosting: set a real environment variable (or AWS SM when `managed`)
|
|
233
244
|
|
|
234
245
|
</Accordion>
|
|
235
|
-
<Accordion title="
|
|
246
|
+
<Accordion title="How do I rotate a key safely?">
|
|
236
247
|
|
|
237
|
-
|
|
248
|
+
Set the new value (`oke vault set` or the Console). The Console's rotation view shows the blast radius — in-flight durable runs that will resume with the new value — before you commit. The `rotate: "90d"` hint on the contract drives the rotation-due signal.
|
|
238
249
|
|
|
239
250
|
</Accordion>
|
|
240
|
-
<Accordion title="
|
|
251
|
+
<Accordion title="How do I pass the builtin master key without shell history?">
|
|
241
252
|
|
|
242
|
-
|
|
253
|
+
Prefer `oke vault unseal --key -` and pipe the key on stdin, or omit `--key` on a
|
|
254
|
+
TTY and type it at the hidden prompt. Avoid `--key <base64>` on shared hosts.
|
|
243
255
|
|
|
244
256
|
</Accordion>
|
|
245
|
-
<Accordion title="
|
|
257
|
+
<Accordion title="Expired secrets still take space in Postgres">
|
|
246
258
|
|
|
247
|
-
|
|
259
|
+
`expires_at` fails closed on read, but rows stay until you hard-delete them:
|
|
260
|
+
|
|
261
|
+
```bash
|
|
262
|
+
oke vault purge-expired --dry-run
|
|
263
|
+
oke vault purge-expired
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
Schedule the live command with cron when you want automatic cleanup.
|
|
248
267
|
|
|
249
268
|
</Accordion>
|
|
250
269
|
</Accordions>
|
|
251
270
|
|
|
252
271
|
## Learn more
|
|
253
272
|
|
|
254
|
-
- [
|
|
255
|
-
- [Flow](/docs/elements/flow) — how `fx.vault` reads secrets inside `do`
|
|
273
|
+
- [Flow](/docs/elements/flow) — how `fx.vault.get` reads secrets inside `do`
|
|
256
274
|
- [CLI Reference](/docs/reference/cli) — `oke vault set` · `list` · `import`
|
|
257
275
|
|
|
258
276
|
## Next
|
|
@@ -264,9 +282,4 @@ Set the new value (`oke vault set` or the Console). The Console's rotation view
|
|
|
264
282
|
description="Eight elements overview."
|
|
265
283
|
href="/docs/get-started/introduction"
|
|
266
284
|
/>
|
|
267
|
-
<Card
|
|
268
|
-
title="Console"
|
|
269
|
-
description="Panels derived from the Manifest."
|
|
270
|
-
href="/docs/console/overview"
|
|
271
|
-
/>
|
|
272
285
|
</Cards>
|
|
@@ -39,7 +39,7 @@ digest Clock, and an AI summarize stub.
|
|
|
39
39
|
The standard starter already exports a named health Flow:
|
|
40
40
|
|
|
41
41
|
```typescript title="flows/main"
|
|
42
|
-
import { on, flow, http, gate } from "okengine";
|
|
42
|
+
import { on, flow, http, gate } from "okengine/http";
|
|
43
43
|
import { z } from "zod";
|
|
44
44
|
|
|
45
45
|
export const health = on(
|
|
@@ -63,17 +63,17 @@ same Manifest.
|
|
|
63
63
|
Adopted modules become namespaces on the client:
|
|
64
64
|
|
|
65
65
|
```typescript title="app"
|
|
66
|
-
import
|
|
67
|
-
import * as main from "./flows/main";
|
|
68
|
-
import * as notes from "./flows/notes";
|
|
69
|
-
import { db } from "./core";
|
|
66
|
+
import "@/core";
|
|
70
67
|
|
|
71
|
-
|
|
68
|
+
import { oke } from "okengine/http";
|
|
69
|
+
import * as routes from "@/flows/generated";
|
|
70
|
+
|
|
71
|
+
export const app = oke({ name: "notes" }).adopt(routes);
|
|
72
72
|
export type App = typeof app;
|
|
73
73
|
```
|
|
74
74
|
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
`import "@/core"` loads stores, secrets, channels, and message catalogs
|
|
76
|
+
(via `locales/index.ts`) so they auto-register before `oke()`.
|
|
77
77
|
|
|
78
78
|
```typescript title="client"
|
|
79
79
|
import { createClient } from "okengine/client";
|
|
@@ -146,7 +146,6 @@ bun test
|
|
|
146
146
|
- [Flow](/docs/elements/flow) — triggers, contracts, effects, and composition
|
|
147
147
|
- [Store](/docs/elements/store) — SQL, KV, files, index
|
|
148
148
|
- [fx](/docs/reference/fx) — the full effect surface
|
|
149
|
-
- [Console · Overview](/docs/console/overview) — Manifest-derived panels
|
|
150
149
|
|
|
151
150
|
## Next
|
|
152
151
|
|
|
@@ -161,9 +160,4 @@ bun test
|
|
|
161
160
|
description="SQL, KV, files, index, and declarative resources."
|
|
162
161
|
href="/docs/elements/store"
|
|
163
162
|
/>
|
|
164
|
-
<Card
|
|
165
|
-
title="Console"
|
|
166
|
-
description="Manifest-derived flows, effects, traces, and architecture."
|
|
167
|
-
href="/docs/console/overview"
|
|
168
|
-
/>
|
|
169
163
|
</Cards>
|
|
@@ -21,8 +21,11 @@ This page gets you from zero to a running app on Bun. The engine targets
|
|
|
21
21
|
### Prerequisites
|
|
22
22
|
|
|
23
23
|
- [Bun](https://bun.sh) ≥ 1.3.14 (`bun --version`)
|
|
24
|
+
- [Docker](https://docs.docker.com/get-docker/) with a running daemon (`docker info`)
|
|
24
25
|
- A terminal and a code editor
|
|
25
26
|
|
|
27
|
+
`oke dev` always starts Docker Compose for Postgres / Redis / S3 / SMTP (and other pinned images). Use `oke test` for PGLite tests without Compose.
|
|
28
|
+
|
|
26
29
|
</Step>
|
|
27
30
|
|
|
28
31
|
<Step>
|
|
@@ -59,23 +62,19 @@ bunx create-oke@latest my-app --sql postgres
|
|
|
59
62
|
bunx create-oke@latest my-app --yes
|
|
60
63
|
```
|
|
61
64
|
|
|
62
|
-
Two Notes starters: **standard**
|
|
63
|
-
|
|
64
|
-
|
|
65
|
+
Two Notes starters: **standard** and **advanced** (adds `store.index` + optional AI).
|
|
66
|
+
Both are Docker-first (`dev`/`prod` share production protocols; `test` uses PGLite /
|
|
67
|
+
memory). Both ship a minimal GitHub Actions workflow (typecheck + `bun test`).
|
|
65
68
|
|
|
66
69
|
On a TTY: pick a template, then **recommended defaults**, **customize**, or
|
|
67
|
-
**reuse** matching saved settings (
|
|
68
|
-
|
|
69
|
-
Customize asks local or docker first, walks facets (including `store.index` with
|
|
70
|
-
`none`), then **AI setup** (Recommended / Customize / Off). Project name rejects
|
|
71
|
-
a non-empty existing path.
|
|
70
|
+
**reuse** matching saved settings (`~/.oke/create-defaults.json`).
|
|
72
71
|
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
Customize walks Docker-first facets (including `store.index` with `none`), then
|
|
73
|
+
**AI setup** (Recommended / Customize / Off). Project name rejects a non-empty
|
|
74
|
+
existing path.
|
|
75
75
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
`--docker`.
|
|
76
|
+
Non-TTY / `--yes` stay scriptable. `--sql postgres` pins SQL; `--ai` runs the
|
|
77
|
+
model wizard before install.
|
|
79
78
|
|
|
80
79
|
</Step>
|
|
81
80
|
|
|
@@ -102,9 +101,9 @@ configured.**
|
|
|
102
101
|
|
|
103
102
|
</Steps>
|
|
104
103
|
|
|
105
|
-
##
|
|
104
|
+
## Database sync in `oke dev`
|
|
106
105
|
|
|
107
|
-
|
|
106
|
+
`oke dev` watches schema paths and auto-runs `oke db push` so the database
|
|
108
107
|
stays in sync. Opt out with `oke dev --no-db-push` or
|
|
109
108
|
`db: { autoPush: false }` in `oke.config.ts`.
|
|
110
109
|
|
|
@@ -116,25 +115,18 @@ oke db generate # write drizzle/*.sql
|
|
|
116
115
|
oke db migrate # apply
|
|
117
116
|
```
|
|
118
117
|
|
|
119
|
-
## Docker
|
|
118
|
+
## Docker Compose under `oke dev`
|
|
120
119
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
120
|
+
`oke dev` always brings up Compose under `docker/` and runs the app on host Bun
|
|
121
|
+
with the `dev` driver profile (filled from `prod` when omitted). Credentials and
|
|
122
|
+
host ports are unique per project.
|
|
124
123
|
|
|
125
124
|
```bash title="Terminal"
|
|
126
|
-
oke dev
|
|
127
|
-
|
|
125
|
+
oke dev # full Compose set from images
|
|
126
|
+
oke dev -d store.sql,signal # optional: only these roles
|
|
127
|
+
oke test # PGLite tests — no Compose
|
|
128
128
|
```
|
|
129
129
|
|
|
130
|
-
Uses the `docker` driver profile in `oke.config.ts` (filled from `prod` when
|
|
131
|
-
omitted). Compose and credentials land under `docker/` (`.env.docker` beside
|
|
132
|
-
compose); host ports are unique per project.
|
|
133
|
-
|
|
134
|
-
Bare `oke dev` uses `.oke/mode` when present (seeded by create-oke). On a TTY
|
|
135
|
-
with no saved mode it prompts once and writes the file; non-TTY defaults to
|
|
136
|
-
`local`.
|
|
137
|
-
|
|
138
130
|
| Protocol | Env shape (generated) |
|
|
139
131
|
| ------------------- | --------------------------------------------------------------------------------------------------------------- |
|
|
140
132
|
| Postgres | `DATABASE_URL` plus `OKE_STORE_SQL_*` |
|
|
@@ -142,9 +134,11 @@ with no saved mode it prompts once and writes the file; non-TTY defaults to
|
|
|
142
134
|
| S3-compatible files | `S3_ENDPOINT`, `S3_ACCESS_KEY_ID`, `S3_SECRET_ACCESS_KEY`, `S3_BUCKET`, `S3_URL`, `S3_REGION`, `S3_CONSOLE_URL` |
|
|
143
135
|
| SMTP email | `SMTP_URL`, `SMTP_HOST`, `SMTP_PORT`, `MAILPIT_UI_URL`, optional `SMTP_USER` / `SMTP_PASSWORD` |
|
|
144
136
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
137
|
+
Uncommented supported controls in the generated compose env are preserved when
|
|
138
|
+
`oke dev` regenerates the file.
|
|
139
|
+
|
|
140
|
+
Migrating from `local` / `docker` maps or `oke mode`?
|
|
141
|
+
See [Migrating environments](/docs/reference/migrating-environments).
|
|
148
142
|
|
|
149
143
|
## Troubleshooting
|
|
150
144
|
|
|
@@ -156,6 +150,11 @@ controls are preserved when `oke dev --docker` regenerates the file.
|
|
|
156
150
|
package name — only `okengine`.
|
|
157
151
|
</Accordion>
|
|
158
152
|
|
|
153
|
+
<Accordion title="Docker daemon not running">
|
|
154
|
+
`oke dev` requires Docker. Start Docker Desktop (or your engine), confirm with `docker info`, then
|
|
155
|
+
retry. For tests without Compose, use `oke test`.
|
|
156
|
+
</Accordion>
|
|
157
|
+
|
|
159
158
|
<Accordion title="Console is empty / no flows listed">
|
|
160
159
|
Confirm `oke dev` is running and you opened `:6533`, not `:6530`. Flows appear only after the app
|
|
161
160
|
boots and the Manifest is extracted — fix TypeScript errors in the terminal first.
|
|
@@ -168,12 +167,12 @@ controls are preserved when `oke dev --docker` regenerates the file.
|
|
|
168
167
|
</Accordion>
|
|
169
168
|
|
|
170
169
|
<Accordion title="Database out of sync after editing schema">
|
|
171
|
-
|
|
172
|
-
|
|
170
|
+
`oke dev` auto-pushes by default. If you passed `--no-db-push` or set `db.autoPush: false`, run
|
|
171
|
+
`oke db push` yourself, or re-enable auto-push.
|
|
173
172
|
</Accordion>
|
|
174
173
|
|
|
175
174
|
<Accordion title="Docker containers left after deleting a project">
|
|
176
|
-
Each project gets its own `oke-dev-<id>` compose
|
|
175
|
+
Each project gets its own `oke-dev-<id>` compose project; `oke dev` stop keeps volumes. Run
|
|
177
176
|
`oke docker clean` (TTY picker) or `oke docker clean --all --yes` from anywhere to remove
|
|
178
177
|
leftover containers, networks, and volumes.
|
|
179
178
|
</Accordion>
|
|
@@ -182,9 +181,10 @@ controls are preserved when `oke dev --docker` regenerates the file.
|
|
|
182
181
|
|
|
183
182
|
## Learn more
|
|
184
183
|
|
|
185
|
-
- [CLI Reference](/docs/reference/cli) — `oke`, `create-oke`,
|
|
184
|
+
- [CLI Reference](/docs/reference/cli) — `oke`, `create-oke`, `oke test`, and db commands
|
|
186
185
|
- [Environment variables](/docs/reference/environment-variables) — protocol-shaped env
|
|
187
186
|
- [Configuration](/docs/reference/configuration) — `oke.config.ts` drivers and `db.autoPush`
|
|
187
|
+
- [Migrating environments](/docs/reference/migrating-environments) — four-key maps → three
|
|
188
188
|
|
|
189
189
|
## Next
|
|
190
190
|
|
|
@@ -144,6 +144,17 @@ derived from these ten names:
|
|
|
144
144
|
import { on, flow, signal, store, clock, gate, vault, channel, ai, plugin } from "okengine";
|
|
145
145
|
```
|
|
146
146
|
|
|
147
|
+
For HTTP-only apps, prefer the slim entry so the cold graph stays on the edge
|
|
148
|
+
router:
|
|
149
|
+
|
|
150
|
+
```ts title="okengine/http"
|
|
151
|
+
import { on, flow, http, gate, oke, createBunRuntime } from "okengine/http";
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Heavy surfaces (`runs`, journal factories, compiler extract, the legacy
|
|
155
|
+
mega-barrel) live on `okengine/runs`, `okengine/journal`, `okengine/compiler`,
|
|
156
|
+
and `okengine/full`.
|
|
157
|
+
|
|
147
158
|
<Vocabulary />
|
|
148
159
|
|
|
149
160
|
## Learn more
|
|
@@ -49,7 +49,7 @@ shared lifecycle, optional live DB config, nothing to re-copy.
|
|
|
49
49
|
Your observability stack learned your routes from sampled traffic. The Flow
|
|
50
50
|
you deployed an hour ago is invisible until someone wires it by hand.
|
|
51
51
|
|
|
52
|
-
**OKE derives:**
|
|
52
|
+
**OKE derives:** its operator interface reads the Manifest —
|
|
53
53
|
flows, effects, traces, architecture — current on every save, in dev and prod
|
|
54
54
|
(`:6533`).
|
|
55
55
|
|
|
@@ -67,7 +67,7 @@ Local runs one vendor client, CI another, prod a third — three glue stories
|
|
|
67
67
|
for the same database. "Works on my machine" is a driver mismatch.
|
|
68
68
|
|
|
69
69
|
**OKE derives:** drivers are named after protocols (`postgres`, `redis`,
|
|
70
|
-
`s3`), the vendor lives in `images`, and `oke dev
|
|
70
|
+
`s3`), the vendor lives in `images`, and `oke dev` runs the real
|
|
71
71
|
stack locally.
|
|
72
72
|
|
|
73
73
|
## The tax is drift
|
|
@@ -101,7 +101,7 @@ ninth element — the set of eight is closed.
|
|
|
101
101
|
| Secrets / config | Env sprawl; fails on first request | Vault contracts; `VaultBootError` at boot |
|
|
102
102
|
| Observability | Bolted on; separate source of truth | Console from the Manifest, dev and prod (`:6533`) |
|
|
103
103
|
| Permissions | Ad-hoc checks scattered in handlers | Least-privilege matrix from declared effects |
|
|
104
|
-
| Local vs prod | Vendor clients; one-off compose | Protocol drivers; vendor in `images`; `oke dev
|
|
104
|
+
| Local vs prod | Vendor clients; one-off compose | Protocol drivers; vendor in `images`; `oke dev` |
|
|
105
105
|
| Client / agents | Separate codegen or hand-kept schemas | Typed client and MCP (`:6535`) from the same Manifest |
|
|
106
106
|
|
|
107
107
|
## Ambition, stated plainly
|
|
@@ -118,7 +118,6 @@ ninth element — the set of eight is closed.
|
|
|
118
118
|
- [Flow](/docs/elements/flow) — how effects are recorded and inferred
|
|
119
119
|
- [Vault](/docs/elements/vault) — fail-loud secret contracts
|
|
120
120
|
- [Plugins](/docs/reference/plugins) — the official HTTP glue set
|
|
121
|
-
- [Console · Overview](/docs/console/overview) — the Manifest-derived operator UI
|
|
122
121
|
|
|
123
122
|
## Next
|
|
124
123
|
|
|
@@ -31,7 +31,6 @@ on(orderPlaced, sendReceipt);
|
|
|
31
31
|
description="Official extensions — security, ops, performance."
|
|
32
32
|
href="/docs/plugins"
|
|
33
33
|
/>
|
|
34
|
-
<Card title="Console" description="Manifest-derived operator panels." href="/docs/console" />
|
|
35
34
|
<Card
|
|
36
35
|
title="Deployment"
|
|
37
36
|
description="Compose, Swarm, Kubernetes, reverse proxy."
|
|
@@ -27,7 +27,7 @@ import { magicLink } from "okengine/plugins";
|
|
|
27
27
|
|
|
28
28
|
export const app = oke({
|
|
29
29
|
name: "shop",
|
|
30
|
-
env: "
|
|
30
|
+
env: "dev",
|
|
31
31
|
gate: { auth: {} },
|
|
32
32
|
}).plug(magicLink({ baseUrl: "http://127.0.0.1:6530" }));
|
|
33
33
|
```
|
|
@@ -43,8 +43,8 @@ const { data } = await api.auth.requestMagicLink({ email: "ali@example.com" });
|
|
|
43
43
|
// data.devToken only when exposeDevToken
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
`POST /auth/magic-link/request`.
|
|
47
|
-
`oke dev
|
|
46
|
+
`POST /auth/magic-link/request`. Under `oke test` the `console` driver captures mail; with
|
|
47
|
+
`oke dev`, Mailpit receives the real SMTP message.
|
|
48
48
|
|
|
49
49
|
</Step>
|
|
50
50
|
|
|
@@ -88,12 +88,12 @@ catalog bodies (`{{link}}`, `{{token}}`). Override copy by merging your own cata
|
|
|
88
88
|
|
|
89
89
|
## Delivery drivers
|
|
90
90
|
|
|
91
|
-
| `drivers.channel.email` | Delivery
|
|
92
|
-
| ----------------------- |
|
|
93
|
-
| `console` | Dev inbox (local/test default)
|
|
94
|
-
| `smtp` | Any SMTP host — Mailpit under `oke dev
|
|
95
|
-
| `resend` / `sndr` | Hosted email APIs
|
|
96
|
-
| `taqnyat-mail` | Taqnyat Mail API (additive option)
|
|
91
|
+
| `drivers.channel.email` | Delivery |
|
|
92
|
+
| ----------------------- | ----------------------------------------------------- |
|
|
93
|
+
| `console` | Dev inbox (local/test default) |
|
|
94
|
+
| `smtp` | Any SMTP host — Mailpit under `oke dev` (dev default) |
|
|
95
|
+
| `resend` / `sndr` | Hosted email APIs |
|
|
96
|
+
| `taqnyat-mail` | Taqnyat Mail API (additive option) |
|
|
97
97
|
|
|
98
98
|
### Taqnyat Mail
|
|
99
99
|
|
|
@@ -101,7 +101,7 @@ catalog bodies (`{{link}}`, `{{token}}`). Override copy by merging your own cata
|
|
|
101
101
|
export default {
|
|
102
102
|
drivers: {
|
|
103
103
|
channel: {
|
|
104
|
-
email: {
|
|
104
|
+
email: { dev: "smtp", test: "console", prod: "taqnyat-mail" },
|
|
105
105
|
},
|
|
106
106
|
},
|
|
107
107
|
};
|
|
@@ -139,7 +139,7 @@ Token expired (default 10m), already used, or mistyped. Request a new link.
|
|
|
139
139
|
<Accordion title="No email arrived">
|
|
140
140
|
|
|
141
141
|
In `local` / `test` the `console` driver captures mail into the inbox — nothing hits a mailbox.
|
|
142
|
-
Run `oke dev
|
|
142
|
+
Run `oke dev` and open Mailpit (`MAILPIT_UI_URL`) to see the rendered message. For
|
|
143
143
|
unit tests without SMTP, set `exposeDevToken: true`.
|
|
144
144
|
|
|
145
145
|
</Accordion>
|
|
@@ -40,7 +40,7 @@ import { otp } from "okengine/plugins";
|
|
|
40
40
|
|
|
41
41
|
export const app = oke({
|
|
42
42
|
name: "shop",
|
|
43
|
-
env: "
|
|
43
|
+
env: "dev",
|
|
44
44
|
gate: { auth: {} },
|
|
45
45
|
}).plug(
|
|
46
46
|
otp({
|
|
@@ -122,7 +122,7 @@ const { data } = await api.auth.verifyOtp({
|
|
|
122
122
|
export default {
|
|
123
123
|
drivers: {
|
|
124
124
|
channel: {
|
|
125
|
-
sms: {
|
|
125
|
+
sms: { test: "console", prod: "taqnyat" },
|
|
126
126
|
},
|
|
127
127
|
},
|
|
128
128
|
};
|