okengine 0.1.4 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/README.md +34 -8
  2. package/package.json +3 -3
  3. package/src/auth/index.ts +1 -0
  4. package/src/client/index.ts +1 -0
  5. package/src/config/index.ts +1 -0
  6. package/src/console/index.ts +1 -0
  7. package/src/drivers/index.ts +1 -0
  8. package/src/elements/ai.ts +1 -0
  9. package/src/elements/channel.ts +1 -0
  10. package/src/elements/clock.ts +1 -0
  11. package/src/elements/gate.ts +1 -0
  12. package/src/elements/signal.ts +1 -0
  13. package/src/elements/store.ts +1 -0
  14. package/src/elements/vault.ts +1 -0
  15. package/src/index.ts +9 -0
  16. package/src/mcp/index.ts +1 -0
  17. package/src/runs/index.ts +1 -0
  18. package/src/test/index.ts +1 -0
  19. package/docs/spec/complete-example.md +0 -1188
  20. package/src/console/ui/dist/assets/index-B71Yl_SS.js +0 -10
  21. package/src/console/ui/dist/assets/panel-access-Dd37LU2c.js +0 -64
  22. package/src/console/ui/dist/assets/panel-ai-CC7LR6-J.js +0 -1
  23. package/src/console/ui/dist/assets/panel-architecture-B5b3iKCz.js +0 -1
  24. package/src/console/ui/dist/assets/panel-channels-CeNjTKXp.js +0 -1
  25. package/src/console/ui/dist/assets/panel-clock-DgFTLoHV.js +0 -1
  26. package/src/console/ui/dist/assets/panel-diff-DxehccqB.js +0 -1
  27. package/src/console/ui/dist/assets/panel-flows-BtrVn-Eg.js +0 -45
  28. package/src/console/ui/dist/assets/panel-gates-Z9MKRGdH.js +0 -1
  29. package/src/console/ui/dist/assets/panel-overview-Bd48d9km.js +0 -1
  30. package/src/console/ui/dist/assets/panel-plugins-DWd0TowH.js +0 -1
  31. package/src/console/ui/dist/assets/panel-runs-BwsWqKeB.js +0 -1
  32. package/src/console/ui/dist/assets/panel-signals-9najbZY2.js +0 -1
  33. package/src/console/ui/dist/assets/panel-store-OHkP2pDp.js +0 -1
  34. package/src/console/ui/dist/assets/panel-traces-tn2JoY8U.js +0 -1
  35. package/src/console/ui/dist/assets/panel-vault-BbfWdox0.js +0 -1
  36. package/src/console/ui/dist/assets/rolldown-runtime-CNC7AqOf.js +0 -1
  37. package/src/console/ui/dist/assets/style-Cnl7WLya.css +0 -3
  38. package/src/console/ui/dist/index.html +0 -14
package/README.md CHANGED
@@ -2,12 +2,37 @@
2
2
 
3
3
  *"Encore's batteries and dashboard, Elysia's speed and DX, Hono's portability — without the Rust lock-in, the cloud gravity, or the source-available license."*
4
4
 
5
+ [![npm](https://img.shields.io/npm/v/okengine.svg)](https://www.npmjs.com/package/okengine)
6
+ [![JSR](https://jsr.io/badges/@omqkhafi/okengine)](https://jsr.io/@omqkhafi/okengine)
7
+ [![npm](https://img.shields.io/npm/v/create-oke.svg)](https://www.npmjs.com/package/create-oke)
5
8
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
6
9
  [![Bun >=1.3](https://img.shields.io/badge/Bun-%3E%3D1.3-black.svg)](https://bun.sh)
7
10
 
8
- **Package:** `okengine` · **CLI:** `oke` · **License:** MIT
11
+ **Framework:** [`okengine`](https://www.npmjs.com/package/okengine) · **CLI:** `oke` · **Scaffold:** [`create-oke`](https://www.npmjs.com/package/create-oke) · **License:** MIT
9
12
 
10
- JSR (`@omqkhafi/okengine`) does not support npm-style `exports` wildcards — import deep drivers (`okengine/drivers/…`) from the npm package, not JSR. The `okengine/drivers` index is available on both.
13
+ ### Install
14
+
15
+ ```bash
16
+ bun add okengine # npm (recommended — ships the `oke` CLI)
17
+ bunx jsr add @omqkhafi/okengine # JSR — library API only
18
+ bunx create-oke@latest my-app # scaffold from npm
19
+ ```
20
+
21
+ | Package | npm | JSR |
22
+ |---|---|---|
23
+ | Framework | [`okengine`](https://www.npmjs.com/package/okengine) | [`@omqkhafi/okengine`](https://jsr.io/@omqkhafi/okengine) |
24
+ | Scaffold | [`create-oke`](https://www.npmjs.com/package/create-oke) | [`@omqkhafi/create-oke`](https://jsr.io/@omqkhafi/create-oke) |
25
+
26
+ ### npm vs JSR
27
+
28
+ | Surface | npm | JSR |
29
+ |---|---|---|
30
+ | Library imports (`okengine`, `/client`, `/drivers`, …) | yes | yes |
31
+ | Deep drivers (`okengine/drivers/postgres`, …) | yes | no — use `okengine/drivers`, or install from npm |
32
+ | `oke` CLI | yes | no |
33
+ | `create-oke` binary | yes | no — prefer `bunx create-oke@latest` from npm |
34
+
35
+ JSR cannot rewrite the CLI’s dynamic imports of your app entry (`oke dev` / `oke start` / config load). Install `okengine` from npm when you need the binary. Deep driver subpaths use npm `exports` wildcards, which JSR does not support.
11
36
 
12
37
  ---
13
38
 
@@ -27,7 +52,7 @@ Eight elements cover what a backend needs. Ten exports are the whole public voca
27
52
  import { on, flow, signal, store, clock, gate, vault, channel, ai, plugin } from "okengine";
28
53
  ```
29
54
 
30
- Batteries included for the Bun era: contract-first APIs, typed client, infrastructure primitives, Console, auth — pure TypeScript, MIT, self-hostable, no cloud lock-in. Detail and comparisons live in [`docs/spec/unified-theory.md`](docs/spec/unified-theory.md).
55
+ Batteries included for the Bun era: contract-first APIs, typed client, infrastructure primitives, Console, auth — pure TypeScript, MIT, self-hostable, no cloud lock-in. Detail and comparisons live in [`docs/spec/unified-theory.md`](https://github.com/omqkhafi/okengine/blob/main/docs/spec/unified-theory.md).
31
56
 
32
57
  ---
33
58
 
@@ -45,7 +70,7 @@ oke dev
45
70
  | `:6533` | Console |
46
71
  | `:6535` | MCP |
47
72
 
48
- That scaffolds the **Notes** app (same tree as [`examples/notes`](examples/notes)). Open the Console — flows, contracts, effects, and an architecture diagram are already there. Derived, not configured.
73
+ That scaffolds the **Notes** app (same tree as [`examples/notes`](https://github.com/omqkhafi/okengine/tree/main/examples/notes)). Open the Console — flows, contracts, effects, and an architecture diagram are already there. Derived, not configured.
49
74
 
50
75
  ### The idea, in one file
51
76
 
@@ -318,10 +343,11 @@ The Console is treated as internet-facing even on localhost. Host header validat
318
343
 
319
344
  ## Status
320
345
 
321
- Pre-1.0. MIT. No `CONTRIBUTING` yet — issues and PRs welcome.
346
+ Pre-1.0. Published on [npm](https://www.npmjs.com/package/okengine) and [JSR](https://jsr.io/@omqkhafi/okengine) (`okengine` + `create-oke`, lockstep). MIT. No `CONTRIBUTING` yet — issues and PRs welcome.
322
347
 
323
348
  | Spec | Path |
324
349
  |---|---|
325
- | Unified theory | [`docs/spec/unified-theory.md`](docs/spec/unified-theory.md) |
326
- | Four applications | [`docs/spec/four-applications.md`](docs/spec/four-applications.md) |
327
- | Console | [`docs/spec/console.md`](docs/spec/console.md) |
350
+ | Unified theory | [`docs/spec/unified-theory.md`](https://github.com/omqkhafi/okengine/blob/main/docs/spec/unified-theory.md) |
351
+ | Four applications | [`docs/spec/four-applications.md`](https://github.com/omqkhafi/okengine/blob/main/docs/spec/four-applications.md) |
352
+ | Console | [`docs/spec/console.md`](https://github.com/omqkhafi/okengine/blob/main/docs/spec/console.md) |
353
+ | Scaffold | [`packages/create-oke`](https://github.com/omqkhafi/okengine/tree/main/packages/create-oke) |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "okengine",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "One law. Eight elements. Ten exports. One package. One manifest. Every backend need is derived, never added.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -122,7 +122,7 @@
122
122
  "bun": ">=1.3"
123
123
  },
124
124
  "bin": {
125
- "oke": "./src/cli/index.ts"
125
+ "oke": "src/cli/index.ts"
126
126
  },
127
127
  "exports": {
128
128
  ".": "./src/index.ts",
@@ -149,4 +149,4 @@
149
149
  "AGENTS.md",
150
150
  "docs/spec"
151
151
  ]
152
- }
152
+ }
package/src/auth/index.ts CHANGED
@@ -3,6 +3,7 @@
3
3
  * plus a provider seam. Subpath: `okengine/auth`.
4
4
  *
5
5
  * Two planes — `fx.operator` vs `fx.auth` — permanently separated.
6
+ * @module
6
7
  */
7
8
 
8
9
  export { auth, type AuthPluginOptions } from "./plugin.ts";
@@ -2,6 +2,7 @@
2
2
  * Typed client (+ live). Subpath: `okengine/client`.
3
3
  *
4
4
  * First Manifest derivation: `type App` → fully typed client, zero codegen.
5
+ * @module
5
6
  */
6
7
 
7
8
  export { createClient, flattenRoutes } from "./create.ts";
@@ -2,6 +2,7 @@
2
2
  * `oke.config.ts` surface. Subpath: `okengine/config`.
3
3
  *
4
4
  * Driver maps are protocol-named; vendor/image choice lives in `images`.
5
+ * @module
5
6
  */
6
7
 
7
8
  /** Environment role keys used in driver maps. */
@@ -3,6 +3,7 @@
3
3
  *
4
4
  * Built on `createClient<ConsoleApp>`. Every action is a real flow through `fx`;
5
5
  * the audit log is the trace (docs/spec/console.md).
6
+ * @module
6
7
  */
7
8
 
8
9
  export {
@@ -2,6 +2,7 @@
2
2
  * Protocol-named drivers, tree-shaken by the Manifest.
3
3
  *
4
4
  * Subpath: `okengine/drivers/*`
5
+ * @module
5
6
  */
6
7
 
7
8
  export type {
@@ -9,6 +9,7 @@
9
9
  * (`oke eval` gates CI). Agents' tools are the app's own flows (gates apply).
10
10
  * PII fields cannot reach a third-party model without explicit `allowPii`.
11
11
  * Nondeterministic ⇒ journaling forced, auto-cache disabled.
12
+ * @module
12
13
  */
13
14
 
14
15
  export { ai } from "./ai/declare.ts";
@@ -8,6 +8,7 @@
8
8
  * MIME, attachments, retry, and the unified error hierarchy come from sently.
9
9
  * OKE adds: declared templates with i18n, consent/opt-out, fallback chains
10
10
  * recorded as chains, and delivery receipts.
11
+ * @module
11
12
  */
12
13
 
13
14
  export { channel } from "./channel/declare.ts";
@@ -7,6 +7,7 @@
7
7
  * Durability lives on the Flow (`durable: true`); the journal records every
8
8
  * `fx` call. Crons leader-elect; schedules are reconciled into the Store at
9
9
  * boot (console §5).
10
+ * @module
10
11
  */
11
12
 
12
13
  export { clock } from "./clock/declare.ts";
@@ -5,6 +5,7 @@
5
5
  * Rate strategies are atomic Lua on the kv driver.
6
6
  *
7
7
  * Drivers: inherits `store.kv` (`memory` · `redis`).
8
+ * @module
8
9
  */
9
10
 
10
11
  export { gate } from "./gate/declare.ts";
@@ -3,6 +3,7 @@
3
3
  *
4
4
  * Delivery physics: `once` · `broadcast` · `live` (mandatory, no default).
5
5
  * Drivers: `memory` · `postgres` (default / transactional) · `redis` · `nats`.
6
+ * @module
6
7
  */
7
8
 
8
9
  export { signal } from "./signal/declare.ts";
@@ -5,6 +5,7 @@
5
5
  * Drivers are protocol-named and live under `src/drivers/*`.
6
6
  * All world access still goes through `fx`; this module only declares
7
7
  * resources and provides runtime helpers (cache, replica routing, PII).
8
+ * @module
8
9
  */
9
10
 
10
11
  export { store, sql, kv, files, index } from "./store/declare.ts";
@@ -7,6 +7,7 @@
7
7
  * A declaration is a contract, never a value. Boot validates every contract
8
8
  * and lists all gaps at once. Logs/traces receive fingerprints and redaction
9
9
  * registered at boot — cleartext never appears even when passed to `fx.log`.
10
+ * @module
10
11
  */
11
12
 
12
13
  export {
package/src/index.ts CHANGED
@@ -3,6 +3,15 @@
3
3
  *
4
4
  * Full ten-export surface lands as elements ship; this entry exposes the
5
5
  * executable core (oke · on · flow · http · fx · contracts).
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * import { oke, on, flow, http } from "okengine";
10
+ *
11
+ * export const app = oke({ name: "notes" });
12
+ * ```
13
+ *
14
+ * @module
6
15
  */
7
16
 
8
17
  export {
package/src/mcp/index.ts CHANGED
@@ -6,6 +6,7 @@
6
6
  * human confirmation, every return wrapped as inert data.
7
7
  *
8
8
  * Subpath: `okengine/mcp`
9
+ * @module
9
10
  */
10
11
 
11
12
  export {
package/src/runs/index.ts CHANGED
@@ -3,6 +3,7 @@
3
3
  *
4
4
  * Not a ninth element: observability derived from the effect system.
5
5
  * Subpath: planned as part of the Console / runtime surface.
6
+ * @module
6
7
  */
7
8
 
8
9
  export type {
package/src/test/index.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  /**
2
2
  * Test harness (`createTestApp`). Subpath: `okengine/test`.
3
+ * @module
3
4
  */
4
5
 
5
6
  export {