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.
- package/AGENTS.md +11 -4
- package/LICENSE +202 -0
- package/NOTICE +2 -0
- package/README.md +15 -9
- package/manifest.v1.schema.json +54 -0
- package/package.json +53 -38
- package/site/content/docs/ai/mcp.mdx +13 -9
- package/site/content/docs/ai/skills.mdx +2 -2
- package/site/content/docs/client/calling.mdx +27 -19
- package/site/content/docs/client/index.mdx +1 -1
- package/site/content/docs/elements/ai/agents.mdx +61 -13
- package/site/content/docs/elements/ai/decide.mdx +536 -0
- package/site/content/docs/elements/ai/events.mdx +373 -0
- package/site/content/docs/elements/ai/index.mdx +9 -3
- package/site/content/docs/elements/ai/meta.json +1 -1
- package/site/content/docs/elements/ai/prompts.mdx +4 -2
- package/site/content/docs/elements/channel/email.mdx +1 -1
- package/site/content/docs/elements/channel/index.mdx +1 -1
- package/site/content/docs/elements/flow/http.mdx +4 -4
- package/site/content/docs/elements/flow/index.mdx +3 -3
- package/site/content/docs/elements/flow/meta.json +1 -1
- package/site/content/docs/elements/gate/auth.mdx +4 -1
- package/site/content/docs/elements/gate/tenancy.mdx +1 -1
- package/site/content/docs/elements/store/index.mdx +1 -1
- package/site/content/docs/elements/store/kv.mdx +5 -5
- package/site/content/docs/elements/vault/rotation.mdx +15 -0
- package/site/content/docs/plugins/otp.mdx +31 -31
- package/site/content/docs/recipes/dragonfly.mdx +5 -5
- package/site/content/docs/recipes/index.mdx +6 -6
- package/site/content/docs/recipes/mailpit.mdx +1 -1
- package/site/content/docs/recipes/meilisearch.mdx +1 -1
- package/site/content/docs/recipes/pgdog.mdx +1 -1
- package/site/content/docs/recipes/postgres.mdx +12 -8
- package/site/content/docs/recipes/redis.mdx +4 -4
- package/site/content/docs/reference/cli.mdx +2 -1
- package/site/content/docs/reference/configuration.mdx +11 -9
- package/site/content/docs/reference/errors.mdx +12 -2
- package/site/content/docs/reference/fx.mdx +35 -21
- package/site/content/docs/reference/idempotency.mdx +192 -0
- package/site/content/docs/reference/index.mdx +6 -1
- package/site/content/docs/reference/meta.json +2 -1
- package/site/content/docs/understand/meta.json +1 -1
- package/site/content/docs/{elements/flow → understand}/routing.mdx +11 -10
- package/site/content/docs/understand/the-architecture.mdx +14 -12
- package/site/content/docs/understand/try-it.mdx +3 -3
- package/src/auth/api-key-sql.test.ts +44 -0
- package/src/auth/api-key-sql.ts +1 -0
- package/src/auth/api-keys.ts +30 -12
- package/src/auth/config.ts +6 -2
- package/src/auth/gate-auth.test.ts +20 -0
- package/src/cli/agents-md.test.ts +25 -0
- package/src/cli/ask-vault-gaps.test.ts +38 -1
- package/src/cli/ask-vault-gaps.ts +35 -2
- package/src/cli/competitor-mention-removal.test.ts +3 -3
- package/src/cli/decide.ts +174 -0
- package/src/cli/decision-lock-watch.test.ts +45 -0
- package/src/cli/decision-lock-watch.ts +51 -0
- package/src/cli/dev-app-runner.ts +34 -8
- package/src/cli/dev-auth-secret.test.ts +49 -0
- package/src/cli/dev-auth-secret.ts +49 -0
- package/src/cli/dev-hot.test.ts +41 -0
- package/src/cli/dev-hot.ts +48 -0
- package/src/cli/dev.test.ts +1 -1
- package/src/cli/dev.ts +24 -6
- package/src/cli/docker-cli.test.ts +1 -1
- package/src/cli/eval.ts +142 -1
- package/src/cli/index.ts +14 -1
- package/src/cli/load-config.images.test.ts +12 -12
- package/src/cli/load-config.ts +2 -2
- package/src/cli/mcp-from-console.ts +48 -0
- package/src/cli/registry.ts +35 -1
- package/src/cli/vault-cmd.test.ts +23 -0
- package/src/cli/vault-cmd.ts +7 -0
- package/src/client/agent.ts +307 -0
- package/src/client/create.ts +18 -1
- package/src/client/transport.test.ts +245 -0
- package/src/client/transport.ts +133 -19
- package/src/client/types.ts +29 -3
- package/src/client-react/index.ts +7 -1
- package/src/client-react/use-agent-run.test.ts +271 -0
- package/src/client-react/use-agent-run.ts +193 -0
- package/src/compiler/ai-approval.test.ts +36 -0
- package/src/compiler/ai-repair.test.ts +22 -0
- package/src/compiler/decisions.extract.test.ts +164 -0
- package/src/compiler/effects-infer.ts +753 -17
- package/src/compiler/extract.test.ts +37 -0
- package/src/compiler/extract.ts +381 -24
- package/src/compiler/fixtures/skyport.expected.json +24 -0
- package/src/compiler/fx-follow.test.ts +164 -0
- package/src/compiler/fx-index.ts +399 -0
- package/src/compiler/response.ts +35 -2
- package/src/config/index.ts +21 -3
- package/src/console/server/ai-runs-flows.ts +269 -0
- package/src/console/server/ai-runs.test.ts +323 -0
- package/src/console/server/ai-runs.ts +562 -0
- package/src/console/server/ai.ts +12 -1
- package/src/console/server/app.ts +10 -1
- package/src/console/server/decisions-flows.ts +157 -0
- package/src/console/server/decisions.test.ts +66 -0
- package/src/console/server/decisions.ts +229 -0
- package/src/console/server/flows-invoke.test.ts +2 -2
- package/src/console/server/flows.ts +50 -2
- package/src/console/server/invoke-user-flow.ts +9 -0
- package/src/console/server/runs-ingest.ts +16 -0
- package/src/console/server/serve.ts +5 -0
- package/src/console/server/state.ts +25 -1
- package/src/console/server/store-stats.test.ts +47 -0
- package/src/console/server/store-stats.ts +92 -18
- package/src/console/ui-next/dist/assets/access-page-DDKkhT9v.js +4 -0
- package/src/console/ui-next/dist/assets/agent-disclosure-62Xts8Xi.js +1 -0
- package/src/console/ui-next/dist/assets/{cache-glyph-92uM5MO7.js → cache-glyph-DyeoKHKA.js} +1 -1
- package/src/console/ui-next/dist/assets/{call-pii-button-DtGVPtcs.js → call-pii-button-DvfpLXsU.js} +1 -1
- package/src/console/ui-next/dist/assets/{collapsible-DN7l6zmC.js → collapsible-BY03SeCg.js} +1 -1
- package/src/console/ui-next/dist/assets/confirm-sheet-DZfuJXP4.js +1 -0
- package/src/console/ui-next/dist/assets/copy-inline-button-BTjPVjRT.js +1 -0
- package/src/console/ui-next/dist/assets/decisions-page-CgkKlA56.js +1 -0
- package/src/console/ui-next/dist/assets/detail-header-Dk5LipF6.js +1 -0
- package/src/console/ui-next/dist/assets/dropdown-menu-CRGrj5JU.js +1 -0
- package/src/console/ui-next/dist/assets/duration-tone-Y6HLjyJ5.js +9 -0
- package/src/console/ui-next/dist/assets/element-icons-C6t8Vlml.js +1 -0
- package/src/console/ui-next/dist/assets/explorer-chrome-Dslh2yE8.js +1 -0
- package/src/console/ui-next/dist/assets/explorer-empty-CIVg7Jgb.js +1 -0
- package/src/console/ui-next/dist/assets/flows-page-DLPfNy-_.js +1 -0
- package/src/console/ui-next/dist/assets/{highlighted-json-BlAEVgNW.js → highlighted-json-D7nNzpgB.js} +1 -1
- package/src/console/ui-next/dist/assets/{http-method-BDf7OAHv.js → http-method-DdL19zzh.js} +1 -1
- package/src/console/ui-next/dist/assets/index-BlrN49Hs.css +2 -0
- package/src/console/ui-next/dist/assets/index-C0lc_s9d.js +58 -0
- package/src/console/ui-next/dist/assets/observability-page-CRlcyLCC.js +8 -0
- package/src/console/ui-next/dist/assets/{replica-lag-B3GLNVfF.js → replica-lag-Bb3FWUu9.js} +7 -7
- package/src/console/ui-next/dist/assets/request-meta-DYBMWhX8.js +1 -0
- package/src/console/ui-next/dist/assets/shortcut-keys-DTE1sjTC.js +1 -0
- package/src/console/ui-next/dist/assets/store-page-CcE-SXC8.js +41 -0
- package/src/console/ui-next/dist/assets/trace-detail-sheet-CKMSEQ4s.js +2 -0
- package/src/console/ui-next/dist/assets/tree-expand-toggle-QOfk0M0H.js +55 -0
- package/src/console/ui-next/dist/assets/units-page-DKC1CDDd.js +1 -0
- package/src/console/ui-next/dist/assets/use-vault-list-BAyQG8Re.js +1 -0
- package/src/console/ui-next/dist/assets/vault-page-B54v4Yit.js +2 -0
- package/src/console/ui-next/dist/index.html +4 -3
- package/src/console/ui-next/seed-parked-approval.ts +126 -0
- package/src/console/ui-next/src/client.ts +224 -1
- package/src/console/ui-next/src/components/explorer/detail-header.tsx +9 -0
- package/src/console/ui-next/src/components/explorer/explorer-start-toggle.tsx +5 -1
- package/src/console/ui-next/src/components/ui/sheet-form.tsx +21 -12
- package/src/console/ui-next/src/features/flows/decisions/decisions-page.tsx +216 -0
- package/src/console/ui-next/src/features/flows/decisions/resolve.test.ts +48 -0
- package/src/console/ui-next/src/features/flows/decisions/resolve.ts +111 -0
- package/src/console/ui-next/src/features/flows/flows-page.tsx +10 -0
- package/src/console/ui-next/src/features/flows/graph/element-map.ts +1 -0
- package/src/console/ui-next/src/features/flows/traces/effect-kind.ts +6 -0
- package/src/console/ui-next/src/features/flows/traces/effect-summary.test.ts +24 -0
- package/src/console/ui-next/src/features/flows/traces/effect-summary.ts +24 -0
- package/src/console/ui-next/src/features/flows/traces/http-status.ts +58 -0
- package/src/console/ui-next/src/features/flows/traces/request-client-card.tsx +355 -0
- package/src/console/ui-next/src/features/flows/traces/request-client.test.ts +114 -0
- package/src/console/ui-next/src/features/flows/traces/request-client.ts +423 -0
- package/src/console/ui-next/src/features/flows/traces/request-input-view.test.ts +52 -6
- package/src/console/ui-next/src/features/flows/traces/request-input-view.ts +85 -19
- package/src/console/ui-next/src/features/flows/traces/trace-detail-sheet.tsx +505 -80
- package/src/console/ui-next/src/features/flows/traces/trace-lanes.test.ts +61 -0
- package/src/console/ui-next/src/features/flows/traces/trace-lanes.ts +78 -0
- package/src/console/ui-next/src/features/flows/traces/trace-nav.test.ts +48 -0
- package/src/console/ui-next/src/features/flows/traces/trace-nav.ts +57 -0
- package/src/console/ui-next/src/features/flows/traces/trace-request-section.tsx +275 -96
- package/src/console/ui-next/src/features/flows/traces/traces-pane.tsx +16 -2
- package/src/console/ui-next/src/features/observability/detail/ai-runs.tsx +369 -0
- package/src/console/ui-next/src/features/observability/observability-page.tsx +31 -1
- package/src/console/ui-next/src/features/observability/state/observability-selection.ts +18 -3
- package/src/console/ui-next/src/features/store/performance/kv-performance-panel.tsx +12 -1
- package/src/console/ui-next/src/features/store/performance/performance-panel.tsx +14 -1
- package/src/console/ui-next/src/features/units/call/call-api-panel.tsx +1 -1
- package/src/console/ui-next/src/features/units/detail/flow-contract-panel.tsx +15 -2
- package/src/console/ui-next/src/features/units/explorer/units-tree.tsx +73 -18
- package/src/console/ui-next/src/features/units/lib/unit-tree.test.ts +21 -0
- package/src/console/ui-next/src/features/units/lib/unit-tree.ts +82 -0
- package/src/console/ui-next/src/features/units/units-page.tsx +25 -7
- package/src/console/ui-next/src/router.tsx +17 -0
- package/src/console/ui-next/ui-next-seed-runs.ts +23 -0
- package/src/console/ui-next/vite-console-kernel-plugin.ts +43 -3
- package/src/console/ui-next/vite.config.ts +9 -0
- package/src/docker/docker.test.ts +13 -13
- package/src/docker/images-config.test.ts +12 -12
- package/src/docker/recipes/dragonfly.ts +3 -2
- package/src/docker/recipes/redis.ts +1 -1
- package/src/docker/stack-id.test.ts +1 -1
- package/src/drivers/ai-anthropic.ts +212 -21
- package/src/drivers/ai-mock.ts +34 -1
- package/src/drivers/ai-openai-compatible.ts +67 -26
- package/src/drivers/ai-preconnect.ts +18 -0
- package/src/drivers/ai-stream.test.ts +62 -0
- package/src/drivers/ai-types.ts +20 -0
- package/src/drivers/journal-postgres.ts +455 -3
- package/src/drivers/meilisearch.ts +2 -0
- package/src/drivers/memory-ddl.test.ts +18 -0
- package/src/drivers/memory.ts +21 -1
- package/src/drivers/pg-rls.test.ts +31 -0
- package/src/drivers/pg-rls.ts +15 -0
- package/src/drivers/postgres.test.ts +9 -0
- package/src/drivers/postgres.ts +49 -11
- package/src/drivers/vault-builtin.test.ts +10 -0
- package/src/drivers/vault-builtin.ts +13 -1
- package/src/drivers/vault-remote-bag.ts +5 -1
- package/src/drivers/vault-types.ts +6 -1
- package/src/elements/ai/agent-event-slot.ts +27 -0
- package/src/elements/ai/approval-http.ts +207 -0
- package/src/elements/ai/approval.test.ts +741 -0
- package/src/elements/ai/approval.ts +228 -0
- package/src/elements/ai/decisions/bind.ts +163 -0
- package/src/elements/ai/decisions/certificate.test.ts +291 -0
- package/src/elements/ai/decisions/certificate.ts +377 -0
- package/src/elements/ai/decisions/certify.ts +314 -0
- package/src/elements/ai/decisions/decide.test.ts +953 -0
- package/src/elements/ai/decisions/e2e.test.ts +399 -0
- package/src/elements/ai/decisions/export.test.ts +120 -0
- package/src/elements/ai/decisions/export.ts +146 -0
- package/src/elements/ai/decisions/fixtures/openrouter-request.json +24 -0
- package/src/elements/ai/decisions/fixtures/openrouter-response.json +22 -0
- package/src/elements/ai/decisions/fixtures/typesafe-request.json +19 -0
- package/src/elements/ai/decisions/fixtures/typesafe-response.json +13 -0
- package/src/elements/ai/decisions/http.test.ts +154 -0
- package/src/elements/ai/decisions/http.ts +240 -0
- package/src/elements/ai/decisions/labels.test.ts +282 -0
- package/src/elements/ai/decisions/labels.ts +257 -0
- package/src/elements/ai/decisions/openrouter.live.test.ts +136 -0
- package/src/elements/ai/decisions/openrouter.ts +36 -0
- package/src/elements/ai/decisions/provider.ts +102 -0
- package/src/elements/ai/decisions/typesafe.ts +36 -0
- package/src/elements/ai/declare.ts +252 -1
- package/src/elements/ai/events.test.ts +379 -0
- package/src/elements/ai/events.ts +138 -0
- package/src/elements/ai/run-events.test.ts +461 -0
- package/src/elements/ai/run-events.ts +522 -0
- package/src/elements/ai/runtime.ts +1186 -105
- package/src/elements/ai/stream-turn.ts +214 -0
- package/src/elements/ai/stream.live.test.ts +76 -0
- package/src/elements/ai/subagent.test.ts +136 -0
- package/src/elements/ai.test.ts +497 -3
- package/src/elements/ai.ts +16 -1
- package/src/elements/clock/durable.ts +27 -1
- package/src/elements/store/emit-drizzle.ts +2 -2
- package/src/elements/store/live-default.test.ts +2 -0
- package/src/elements/store/live-http.test.ts +1 -0
- package/src/elements/store/resource-list-docs.test.ts +2 -2
- package/src/elements/store/resource.test.ts +3 -3
- package/src/elements/store/schema-decl.test.ts +1 -0
- package/src/elements/store/sql-condition.ts +24 -7
- package/src/elements/store/sql-session.test.ts +51 -0
- package/src/elements/store/sql-session.ts +111 -1
- package/src/elements/store/upsert-app.test.ts +1 -1
- package/src/elements/vault/audit.test.ts +137 -0
- package/src/elements/vault/audit.ts +106 -13
- package/src/elements/vault/boot-chain.ts +9 -1
- package/src/elements/vault/builtin-adapter.ts +33 -3
- package/src/i18n/catalogs/ar.ts +9 -0
- package/src/i18n/catalogs/en.ts +9 -0
- package/src/index.ts +2 -0
- package/src/kernel/abort-scope.ts +33 -2
- package/src/kernel/agent-event-store.ts +448 -0
- package/src/kernel/app.ts +294 -19
- package/src/kernel/auto-cache.test.ts +6 -6
- package/src/kernel/boot-bind/ai.ts +3 -0
- package/src/kernel/boot-bind/store.test.ts +26 -0
- package/src/kernel/boot-bind/store.ts +82 -6
- package/src/kernel/boot-bind/vault.ts +1 -0
- package/src/kernel/boot.ts +34 -5
- package/src/kernel/builtin-errors.ts +10 -0
- package/src/kernel/capability.ts +3 -0
- package/src/kernel/client-descriptor.ts +1 -0
- package/src/kernel/concurrency.test.ts +33 -0
- package/src/kernel/decision-label-store.ts +441 -0
- package/src/kernel/effects-stamping.test.ts +2 -2
- package/src/kernel/effects.test.ts +2 -1
- package/src/kernel/effects.ts +13 -1
- package/src/kernel/element-registries.ts +3 -0
- package/src/kernel/errors-compiler.ts +20 -0
- package/src/kernel/errors-text.ts +4 -0
- package/src/kernel/errors.ts +2 -0
- package/src/kernel/external-effects.test.ts +36 -0
- package/src/kernel/flow.test.ts +2 -3
- package/src/kernel/flow.ts +24 -0
- package/src/kernel/fx-decide.ts +761 -0
- package/src/kernel/fx-fetch.ts +5 -1
- package/src/kernel/fx.test.ts +12 -5
- package/src/kernel/fx.ts +316 -29
- package/src/kernel/http-frame.test.ts +94 -0
- package/src/kernel/http-frame.ts +203 -0
- package/src/kernel/idempotency-store.ts +578 -0
- package/src/kernel/idempotency.test.ts +556 -0
- package/src/kernel/idempotency.ts +304 -0
- package/src/kernel/index.ts +1 -0
- package/src/kernel/journal.ts +160 -0
- package/src/kernel/json-result.ts +10 -0
- package/src/kernel/pipeline.test.ts +45 -0
- package/src/kernel/sse-id.ts +32 -0
- package/src/manifest/diff.ts +1 -0
- package/src/manifest/types.ts +37 -2
- package/src/mcp/ai-tools.test.ts +202 -0
- package/src/mcp/authorization.ts +66 -0
- package/src/mcp/session.ts +3 -0
- package/src/mcp/tools.ts +168 -0
- package/src/plugins/auth-delivery.mailpit.integration.test.ts +1 -1
- package/src/plugins/otp.test.ts +65 -1
- package/src/plugins/otp.ts +59 -7
- package/src/release/absolute-regression.test.ts +63 -0
- package/src/release/http-graph.test.ts +27 -0
- package/src/release/http-graph.ts +95 -0
- package/src/release/index.ts +3 -0
- package/src/release/limits.ts +17 -2
- package/src/release/measure.ts +144 -28
- package/src/runs/collect.ts +4 -1
- package/src/runs/parquet.test.ts +27 -1
- package/src/runs/parquet.ts +19 -0
- package/src/runs/types.ts +31 -0
- package/src/runtime/json-code-block.test.ts +106 -47
- package/src/runtime/json-code-block.ts +1209 -46
- package/src/term.test.ts +13 -0
- package/src/term.ts +81 -49
- package/src/test/create-test-app.test.ts +3 -1
- package/src/test/create-test-app.ts +40 -0
- package/src/test/live-signals.test.ts +1 -0
- package/src/test/provisions.integration.test.ts +1 -0
- package/src/test/tenant-isolation.test.ts +1 -0
- package/src/console/ui-next/dist/assets/PlusSignIcon-CwG3nxfu.js +0 -1
- package/src/console/ui-next/dist/assets/access-page-Bgt9bq2r.js +0 -4
- package/src/console/ui-next/dist/assets/agent-disclosure-B43CXZZR.js +0 -1
- package/src/console/ui-next/dist/assets/copy-inline-button-CAYD18cr.js +0 -1
- package/src/console/ui-next/dist/assets/detail-header-DVWNjWjg.js +0 -1
- package/src/console/ui-next/dist/assets/dropdown-menu-4h2LOVXM.js +0 -1
- package/src/console/ui-next/dist/assets/duration-tone-BmIR9FV8.js +0 -9
- package/src/console/ui-next/dist/assets/element-icons-BI8cJgdh.js +0 -1
- package/src/console/ui-next/dist/assets/explorer-empty-CJs5A-wm.js +0 -1
- package/src/console/ui-next/dist/assets/flows-page-BMHs-IzK.js +0 -1
- package/src/console/ui-next/dist/assets/index-BKpaes3n.js +0 -63
- package/src/console/ui-next/dist/assets/index-VxoEz295.css +0 -2
- package/src/console/ui-next/dist/assets/observability-page-WnVLI-0j.js +0 -4
- package/src/console/ui-next/dist/assets/request-meta-DMbnAe3f.js +0 -1
- package/src/console/ui-next/dist/assets/shortcut-keys-3ILd8oGn.js +0 -1
- package/src/console/ui-next/dist/assets/store-page-KvFDingJ.js +0 -41
- package/src/console/ui-next/dist/assets/trace-detail-sheet-Htk8Cm9t.js +0 -2
- package/src/console/ui-next/dist/assets/tree-expand-toggle-CFMPWX4f.js +0 -55
- package/src/console/ui-next/dist/assets/units-page-C4NdNuxP.js +0 -1
- package/src/console/ui-next/dist/assets/use-vault-list-CT4-gajj.js +0 -1
- 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 | <
|
|
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 /
|
|
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
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://
|
|
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/
|
|
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). [
|
|
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).
|
package/manifest.v1.schema.json
CHANGED
|
@@ -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.
|
|
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": "
|
|
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": "
|
|
106
|
-
"
|
|
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": "
|
|
111
|
-
"
|
|
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": "
|
|
117
|
-
"
|
|
118
|
-
"dev:console
|
|
119
|
-
"dev:console:
|
|
120
|
-
"dev:console:
|
|
121
|
-
"dev:
|
|
122
|
-
"dev:
|
|
123
|
-
"dev:keel
|
|
124
|
-
"
|
|
125
|
-
"
|
|
126
|
-
"
|
|
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": "
|
|
134
|
-
"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.
|
|
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.
|
|
163
|
+
"@codemirror/commands": "^6.11.1",
|
|
151
164
|
"@codemirror/lang-json": "^6.0.2",
|
|
152
|
-
"@codemirror/state": "^6.7.
|
|
165
|
+
"@codemirror/state": "^6.7.6",
|
|
153
166
|
"@codemirror/theme-one-dark": "^6.1.3",
|
|
154
|
-
"@codemirror/view": "^6.43.
|
|
167
|
+
"@codemirror/view": "^6.43.13",
|
|
155
168
|
"@dagrejs/dagre": "^3.1.1",
|
|
156
|
-
"@duckdb/node-api": "^1.5.5-r.
|
|
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.
|
|
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.
|
|
169
|
-
"@tanstack/react-router": "^1.170.
|
|
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.
|
|
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-
|
|
196
|
-
"drizzle-orm": "1.0.0-rc.5-
|
|
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.
|
|
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
|
|
214
|
+
"motion": "^13.4.2",
|
|
202
215
|
"nuqs": "^2.10.1",
|
|
203
216
|
"oxfmt": "^0.67.0",
|
|
204
|
-
"oxlint": "^1.
|
|
205
|
-
"oxlint-tsgolint": "^7.0.
|
|
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.
|
|
222
|
+
"react-resizable-panels": "^4.13.3",
|
|
210
223
|
"shadcn": "^4.21.0",
|
|
211
224
|
"shiki": "^4.4.3",
|
|
212
|
-
"tailwind-merge": "^3.
|
|
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.
|
|
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
|
|
32
|
-
|
|
|
33
|
-
| `oke.manifest.get`
|
|
34
|
-
| `oke.schema.get`
|
|
35
|
-
| `oke.effects.get`
|
|
36
|
-
| `oke.traces.list`
|
|
37
|
-
| `oke.traces.get`
|
|
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
|
|