{"_id":"@abeyjs/runtime","_rev":"5-a7c940257b725b5aceb2f1607b0ebd27","name":"@abeyjs/runtime","dist-tags":{"latest":"0.1.4"},"versions":{"0.1.0":{"name":"@abeyjs/runtime","version":"0.1.0","license":"MIT","_id":"@abeyjs/runtime@0.1.0","maintainers":[{"name":"abeyjs","email":"abeyjs98@gmail.com"}],"dist":{"shasum":"23e5045ea99dad52709f005c067e1754bf50fa89","tarball":"https://registry.npmjs.org/@abeyjs/runtime/-/runtime-0.1.0.tgz","fileCount":22,"integrity":"sha512-bUKeFI4CW9VibA6QdaBl7bfyw416pvjsTBSrhpfUD3sF1VCetWKsye/7I/nHNZnctNzeBeIcgJlwGfqLZgCROg==","signatures":[{"sig":"MEQCIC5VDcLVrxDHi78kBkW9XuyULIHAGyz2P8wK9bZOttOlAiBkDPbV9P8XiBgZX1Jws03ZVokrXqeEZsDsxuMwZs14ug==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":33430},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"24fe5ea792f5be4e8facf7c820025f89265c1467","scripts":{"build":"tsc -p tsconfig.json"},"_npmUser":{"name":"abeyjs","email":"abeyjs98@gmail.com"},"_npmVersion":"10.8.2","description":"Application **composition root** for AbeyJs: wraps an **`OmegaChannel`** (`@abeyjs/core`), an **`OmegaFlowManager`** (`@abeyjs/flows`), lightweight **DI** (**`OmegaContainer`**), **agent** registration, optional **URL → intent** bridging, and an in-memory","directories":{},"sideEffects":false,"_nodeVersion":"20.20.2","dependencies":{"@abeyjs/core":"0.1.0","@abeyjs/flows":"0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.0"},"_npmOperationalInternal":{"tmp":"tmp/runtime_0.1.0_1777684941621_0.9720894800387789","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@abeyjs/runtime","version":"0.1.1","license":"MIT","_id":"@abeyjs/runtime@0.1.1","maintainers":[{"name":"abeyjs","email":"abeyjs98@gmail.com"}],"dist":{"shasum":"9a2098f7b0dd0526bdbbb4671ab476315b58bdda","tarball":"https://registry.npmjs.org/@abeyjs/runtime/-/runtime-0.1.1.tgz","fileCount":12,"integrity":"sha512-m+GPPGPs0KLhwb9yM0eUv1qJc2ontFW3P2D+zbJUqmo6W2ai+NoTpkL7CWldU4JFHSLsca7MpxGSXVsB2EqUzg==","signatures":[{"sig":"MEQCIDucZPFRoGrYunlR8S2GGbBXCBbD1RGJzlBqAH4NbpK6AiBvsuEp2G5yNrNIXTLUdHn53wlSABPC1BACiVkVrtXu6w==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":20598},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"8e89473e70d292931fe54ab9e184c613a03528d3","scripts":{"build":"tsc -p tsconfig.json"},"_npmUser":{"name":"abeyjs","email":"abeyjs98@gmail.com"},"_npmVersion":"10.8.2","description":"Application **composition root** for AbeyJs: wraps an **`OmegaChannel`** (`@abeyjs/core`), an **`OmegaFlowManager`** (`@abeyjs/flows`), lightweight **DI** (**`OmegaContainer`**), **agent** registration, optional **URL → intent** bridging, and an in-memory","directories":{},"sideEffects":false,"_nodeVersion":"20.20.2","dependencies":{"@abeyjs/core":"0.1.1","@abeyjs/flows":"0.1.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.0"},"_npmOperationalInternal":{"tmp":"tmp/runtime_0.1.1_1777736091417_0.1301080343270471","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@abeyjs/runtime","version":"0.1.2","license":"MIT","_id":"@abeyjs/runtime@0.1.2","maintainers":[{"name":"abeyjs","email":"abeyjs98@gmail.com"}],"dist":{"shasum":"b77880fe2c234074ca0553d74aec9820f97ee1a8","tarball":"https://registry.npmjs.org/@abeyjs/runtime/-/runtime-0.1.2.tgz","fileCount":12,"integrity":"sha512-HwL/x4jDkrjXzotOTMOmsGuTpBFvFD0UzIAFdPkU8tMjyLKIefQ4bL5JlAFn1bYJ8ZbEHfN+aWG+BdrBghzXew==","signatures":[{"sig":"MEQCIB0qnRF8UlH9KnbjeBMbAnBlr3pXZCu33aw+lpOBzIqSAiAeJb6jHH0NU3G1aU7YR6EqjkoD2RF1V9NTIKmd/vBKpA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":21334},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"7bc92eb51592bb29e6b8d02cf20496cf23a3476b","scripts":{"build":"tsc -p tsconfig.json"},"_npmUser":{"name":"abeyjs","email":"abeyjs98@gmail.com"},"_npmVersion":"8.19.4","description":"Application **composition root** for AbeyJs: wraps an **`OmegaChannel`** (`@abeyjs/core`), an **`OmegaFlowManager`** (`@abeyjs/flows`), lightweight **DI** (**`OmegaContainer`**), **agent** registration, optional **URL → intent** bridging, and an in-memory","directories":{},"sideEffects":false,"_nodeVersion":"22.20.0","dependencies":{"@abeyjs/core":"0.1.1","@abeyjs/flows":"0.1.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.0"},"_npmOperationalInternal":{"tmp":"tmp/runtime_0.1.2_1778320859084_0.05503666547185926","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@abeyjs/runtime","version":"0.1.3","license":"MIT","_id":"@abeyjs/runtime@0.1.3","maintainers":[{"name":"abeyjs","email":"abeyjs98@gmail.com"}],"dist":{"shasum":"6a790dbbe2e399edd62bb340da95b4401bb3bb65","tarball":"https://registry.npmjs.org/@abeyjs/runtime/-/runtime-0.1.3.tgz","fileCount":20,"integrity":"sha512-yJfeWIXMMDm0MT429iL4zrtqShc5Zf58ZYaLOAvpNtaYCdkiFjsbirBK+NKWL3/2/190ymMFSFmXxA9mBQQRYg==","signatures":[{"sig":"MEYCIQDYDhRHqN+N29MJY14t00QM4t0H8d80MHRz0h161EVBJAIhAMm1UADBUZuzJqiXaVcmN7P2S21ux86pxCjW8Dj3a0Y5","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":55521},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"cbb1d3a215f893ebfdad8fe7ea649122de675c2e","scripts":{"build":"tsc -p tsconfig.json"},"_npmUser":{"name":"abeyjs","email":"abeyjs98@gmail.com"},"_npmVersion":"8.19.4","description":"Application **composition root** for AbeyJs: wraps an **`OmegaChannel`** (`@abeyjs/core`), an **`OmegaFlowManager`** (`@abeyjs/flows`), lightweight **DI** (**`OmegaContainer`**), **agent** registration, optional **URL → intent** bridging, and an in-memory","directories":{},"sideEffects":false,"_nodeVersion":"22.20.0","dependencies":{"@abeyjs/core":"0.1.1","@abeyjs/flows":"0.1.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.0"},"_npmOperationalInternal":{"tmp":"tmp/runtime_0.1.3_1778324689687_0.9704782186712566","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@abeyjs/runtime","version":"0.1.4","license":"MIT","publishConfig":{"access":"public"},"type":"module","sideEffects":false,"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"build":"tsc -p tsconfig.json"},"dependencies":{"@abeyjs/core":"0.1.1","@abeyjs/flows":"0.1.1"},"devDependencies":{"typescript":"^5.7.0"},"gitHead":"425428144da76c8e959165f2a0b45b9acf1f2fb5","description":"Application **composition root** for AbeyJs: wraps an **`OmegaChannel`** (`@abeyjs/core`), an **`OmegaFlowManager`** (`@abeyjs/flows`), lightweight **DI** (**`OmegaContainer`**), **agent** registration, optional **URL → intent** bridging, and an in-memory","_id":"@abeyjs/runtime@0.1.4","_nodeVersion":"22.20.0","_npmVersion":"8.19.4","dist":{"integrity":"sha512-pGzHJUY9ybMNIu8+7RCIR2pE9QyaUtAmoVZwvt2tKVfOs6WFN/baEdxihLWVBYyNlbVUxzD/7p68wSmHuROtWw==","shasum":"b460b7afbd8984e175d7bfab19edd532b5b9f5f1","tarball":"https://registry.npmjs.org/@abeyjs/runtime/-/runtime-0.1.4.tgz","fileCount":20,"unpackedSize":55521,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIEyifSCWHcleV1ZbYU02WG6WUwz4aEkah1LOPRYmgAWuAiEAtr5TMskQ/tsiS0I6B1m18FfOIeDC1gW+lWRUz6zMK1U="}]},"_npmUser":{"name":"abeyjs","email":"abeyjs98@gmail.com"},"directories":{},"maintainers":[{"name":"abeyjs","email":"abeyjs98@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/runtime_0.1.4_1778385790873_0.02777825456373395"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-02T01:22:21.508Z","modified":"2026-05-10T04:03:11.142Z","0.1.0":"2026-05-02T01:22:21.764Z","0.1.1":"2026-05-02T15:34:51.575Z","0.1.2":"2026-05-09T10:00:59.213Z","0.1.3":"2026-05-09T11:04:49.897Z","0.1.4":"2026-05-10T04:03:11.024Z"},"license":"MIT","description":"Application **composition root** for AbeyJs: wraps an **`OmegaChannel`** (`@abeyjs/core`), an **`OmegaFlowManager`** (`@abeyjs/flows`), lightweight **DI** (**`OmegaContainer`**), **agent** registration, optional **URL → intent** bridging, and an in-memory","maintainers":[{"name":"abeyjs","email":"abeyjs98@gmail.com"}],"readme":"# `@abeyjs/runtime`\r\n\r\nApplication **composition root** for AbeyJs: wraps an **`OmegaChannel`** (`@abeyjs/core`), an **`OmegaFlowManager`** (`@abeyjs/flows`), lightweight **DI** (**`OmegaContainer`**), **agent** registration, optional **URL → intent** bridging, and an in-memory **trace ring** suited for the **Inspector** (`@abeyjs/inspector`).\r\n\r\nMost apps create **one** **`OmegaRuntime`** inside **`omegaSetup`** (`createOmegaRuntime()`), then **`registerModule`**, **`registerAgent`**, **`registerPlugin`**, and **`onIntent`** handlers.\r\n\r\n---\r\n\r\n## Composition\r\n\r\n| Member | Role |\r\n|--------|------|\r\n| **`channel`** | **`OmegaChannel`** shared by flows, HTTP (`@abeyjs/http`), agents, and UI adapters. |\r\n| **`flow`** | **`OmegaFlowManager`** — **`dispatch`**, **`registerHandler`** (wrapped by **`runtime.onIntent`**). |\r\n| **`di`** | **`OmegaContainer`** — **`provide`**, **`provideFactory`**, **`get`** / **`tryGet`**. |\r\n\r\nConstructor wiring:\r\n\r\n1. **`channel`** — injected or **`createChannel()`**.\r\n2. **`createOmegaFlowManager(channel)`** — **`flow`** owns intent routing with correlation metadata.\r\n3. **`channel.onAll`** captures every published event into **`_trace`** while **`setTraceEnabled(true)`** (default), capped at **2000** entries.\r\n\r\n---\r\n\r\n## Lifecycle API (`OmegaRuntime`)\r\n\r\n### Intents & flows\r\n\r\n- **`dispatch(intent, { source? })`** — forwards to **`flow.dispatch`**.\r\n- **`onIntent(name, handler)`** — shorthand for **`flow.registerHandler`** (**`FlowManagerContext`** matches `@abeyjs/flows`).\r\n\r\n### Agents\r\n\r\n- **`registerAgent(factory)`** — invokes **`factory(channel)`**, **`connect()`** on success, replaces prior agent with same **`id`** after **`dispose`** on the old instance.\r\n\r\n### Plugins\r\n\r\n- **`registerPlugin({ id, install })`** — **`install(runtime)`** may return **teardown**; registering the same **`id`** runs previous teardown first.\r\n- **`unregisterPlugin`**, **`disposeAll`** — teardown plugins and **all** agents (**`agents.clear`** after **`dispose`**).\r\n\r\n### Modules & DI\r\n\r\n- **`registerModule`** / **`registerModules`** — **`OmegaModule`** **`(container, runtime) => void`** executed **once per module function** (**`WeakSet`** dedupe).\r\n- **`provide`**, **`provideFactory`**, **`get`**, **`tryGet`** — delegate to **`di`**.\r\n\r\n### Troubleshooting: missing provider\r\n\r\nIf the app throws **`OmegaContainer: missing provider for token \"abeyjs:…\"`** (literal suffix matches your **`omegaToken(\"…\")`** name):\r\n\r\n1. **`get` / `tryGet`** ran for a token that was never **`provide`**‘d or **`provideFactory`**‘d—often inside a copied **`install…(runtime)`** that expects HTTP or another service registered elsewhere.\r\n2. **Fix:** call **`runtime.registerModule((c, rt) => { … })`** *before* that installer, and register the same **`omegaToken(\"…\")`** (or shared **`const`** re-export) you pass to **`get`**.\r\n3. **`omegaToken(\"name\")`** uses **`Symbol.for(\"abeyjs:name\")`**, so the error string **`abeyjs:name`** matches the **`omegaToken`** argument.\r\n\r\n### Trace\r\n\r\n- **`getTraceSnapshot()`** — read-only view of the ring buffer (**`RuntimeTraceEvent`**).\r\n- **`setTraceEnabled(on)`** — disables/enables capture (does not clear history).\r\n\r\nInspectors and bridges typically read **`getTraceSnapshot`** or subscribe live via **`channel.onAll`**.\r\n\r\n---\r\n\r\n## Types\r\n\r\n **`RuntimeTraceEvent`** — mirrors channel envelopes: **`name`**, **`data`** (payload), **`correlationId`**, **`timestamp`**, optional **`source`**.\r\n\r\n **`OmegaRegisteredAgent`** — **`id`**, **`connect()`**, **`dispose()`**; satisfied by **`OmegaAgent`** implementations in **`@abeyjs/agents`**.\r\n\r\n **`OmegaPlugin`** — named **`install`** hook with optional unsubscribe.\r\n\r\n **`OmegaModule`** — grouping hook for DI registration against **`OmegaContainer` + `OmegaRuntime`**.\r\n\r\n---\r\n\r\n## URL bridge (`url-bridge.ts`)\r\n\r\nBrowser helpers for **intent-first routing** (no framework router required):\r\n\r\n| Function | Behaviour |\r\n|----------|-----------|\r\n| **`startUrlIntentSync(maps, flow, getPath?)`** | On load and optional **`popstate`**, match normalized pathname against **`PathIntentMap.path`**, **`flow.dispatch(intentOf(...))`**. No-op if **`window`** is undefined. |\r\n| **`setPath(path)`** | **`history.pushState`** without reload. |\r\n| **`intentFromQuery(search)`** | Deep link: **`?omegaIntent=Name&foo=bar`** → **`intentOf(\"Name\", { foo: \"bar\" })`**. |\r\n\r\n**`PathIntentMap`**: template path **without** leading slash, **`IntentType`**, optional **`toPayload`**, **`syncOnPopState`**.\r\n\r\n---\r\n\r\n## Dependencies\r\n\r\n- **`@abeyjs/core`** — channel, **`Intent`**, **`intentOf`**, correlation metadata.\r\n- **`@abeyjs/flows`** — **`OmegaFlowManager`**, **`FlowManagerContext`**.\r\n\r\n---\r\n\r\n## Build\r\n\r\n```bash\r\nnpm run build -w @abeyjs/runtime\r\n```\r\n","readmeFilename":"README.md"}