@almadar/runtime 5.7.0 → 5.8.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/dist/LocalPersistenceAdapter.d.ts +46 -0
- package/dist/LocalPersistenceAdapter.js +79 -0
- package/dist/LocalPersistenceAdapter.js.map +1 -0
- package/dist/{OrbitalServerRuntime-BMOr7miw.d.ts → OrbitalServerRuntime-BP5sz5Bn.d.ts} +2 -107
- package/dist/OrbitalServerRuntime.d.ts +2 -1
- package/dist/OrbitalServerRuntime.js +37 -365
- package/dist/OrbitalServerRuntime.js.map +1 -1
- package/dist/PersistenceAdapter-B6dQCbbU.d.ts +67 -0
- package/dist/createOsHandlers.d.ts +28 -0
- package/dist/createOsHandlers.js +285 -0
- package/dist/createOsHandlers.js.map +1 -0
- package/dist/index.d.ts +6 -26
- package/package.json +1 -1
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { EntityRow } from '@almadar/core';
|
|
2
|
+
import { P as PersistenceAdapter } from './PersistenceAdapter-B6dQCbbU.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* LocalPersistenceAdapter - Filesystem CRUD for `persistence: "local"` entities.
|
|
6
|
+
*
|
|
7
|
+
* One directory per entity type, one JSON file per instance.
|
|
8
|
+
* Language-level feature: benefits all .orb programs, not just the agent.
|
|
9
|
+
* Offline-first apps, CLI tools, config managers, local databases all use it.
|
|
10
|
+
*
|
|
11
|
+
* @packageDocumentation
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Filesystem-backed persistence adapter.
|
|
16
|
+
*
|
|
17
|
+
* Storage layout:
|
|
18
|
+
* ```
|
|
19
|
+
* {root}/
|
|
20
|
+
* {entityType}/
|
|
21
|
+
* {id}.json
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
declare class LocalPersistenceAdapter implements PersistenceAdapter {
|
|
25
|
+
private readonly root;
|
|
26
|
+
constructor(root: string);
|
|
27
|
+
private entityDir;
|
|
28
|
+
private filePath;
|
|
29
|
+
create(entityType: string, data: EntityRow): Promise<{
|
|
30
|
+
id: string;
|
|
31
|
+
}>;
|
|
32
|
+
update(entityType: string, id: string, data: EntityRow): Promise<void>;
|
|
33
|
+
delete(entityType: string, id: string): Promise<void>;
|
|
34
|
+
getById(entityType: string, id: string): Promise<EntityRow | null>;
|
|
35
|
+
list(entityType: string): Promise<EntityRow[]>;
|
|
36
|
+
/**
|
|
37
|
+
* Remove all data for an entity type.
|
|
38
|
+
*/
|
|
39
|
+
clear(entityType: string): Promise<void>;
|
|
40
|
+
/**
|
|
41
|
+
* Remove all local data.
|
|
42
|
+
*/
|
|
43
|
+
clearAll(): Promise<void>;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export { LocalPersistenceAdapter };
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import './chunk-PZ5AY32C.js';
|
|
2
|
+
import fs from 'fs';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
|
|
5
|
+
var LocalPersistenceAdapter = class {
|
|
6
|
+
root;
|
|
7
|
+
constructor(root) {
|
|
8
|
+
this.root = root;
|
|
9
|
+
fs.mkdirSync(root, { recursive: true });
|
|
10
|
+
}
|
|
11
|
+
entityDir(entityType) {
|
|
12
|
+
const dir = path.join(this.root, entityType.toLowerCase());
|
|
13
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
14
|
+
return dir;
|
|
15
|
+
}
|
|
16
|
+
filePath(entityType, id) {
|
|
17
|
+
return path.join(this.entityDir(entityType), `${id}.json`);
|
|
18
|
+
}
|
|
19
|
+
async create(entityType, data) {
|
|
20
|
+
const id = data.id || `${entityType.toLowerCase()}_${Date.now()}_${Math.random().toString(36).slice(2, 8)}`;
|
|
21
|
+
const record = { ...data, id };
|
|
22
|
+
const filePath = this.filePath(entityType, id);
|
|
23
|
+
fs.writeFileSync(filePath, JSON.stringify(record, null, 2), "utf-8");
|
|
24
|
+
return { id };
|
|
25
|
+
}
|
|
26
|
+
async update(entityType, id, data) {
|
|
27
|
+
const filePath = this.filePath(entityType, id);
|
|
28
|
+
let existing = { id };
|
|
29
|
+
if (fs.existsSync(filePath)) {
|
|
30
|
+
existing = JSON.parse(fs.readFileSync(filePath, "utf-8"));
|
|
31
|
+
}
|
|
32
|
+
const merged = { ...existing, ...data, id };
|
|
33
|
+
fs.writeFileSync(filePath, JSON.stringify(merged, null, 2), "utf-8");
|
|
34
|
+
}
|
|
35
|
+
async delete(entityType, id) {
|
|
36
|
+
const filePath = this.filePath(entityType, id);
|
|
37
|
+
if (fs.existsSync(filePath)) {
|
|
38
|
+
fs.unlinkSync(filePath);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
async getById(entityType, id) {
|
|
42
|
+
const filePath = this.filePath(entityType, id);
|
|
43
|
+
if (!fs.existsSync(filePath)) return null;
|
|
44
|
+
return JSON.parse(fs.readFileSync(filePath, "utf-8"));
|
|
45
|
+
}
|
|
46
|
+
async list(entityType) {
|
|
47
|
+
const dir = this.entityDir(entityType);
|
|
48
|
+
if (!fs.existsSync(dir)) return [];
|
|
49
|
+
const files = fs.readdirSync(dir).filter((f) => f.endsWith(".json"));
|
|
50
|
+
const results = [];
|
|
51
|
+
for (const file of files) {
|
|
52
|
+
const content = fs.readFileSync(path.join(dir, file), "utf-8");
|
|
53
|
+
results.push(JSON.parse(content));
|
|
54
|
+
}
|
|
55
|
+
return results;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Remove all data for an entity type.
|
|
59
|
+
*/
|
|
60
|
+
async clear(entityType) {
|
|
61
|
+
const dir = path.join(this.root, entityType.toLowerCase());
|
|
62
|
+
if (fs.existsSync(dir)) {
|
|
63
|
+
fs.rmSync(dir, { recursive: true, force: true });
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Remove all local data.
|
|
68
|
+
*/
|
|
69
|
+
async clearAll() {
|
|
70
|
+
if (fs.existsSync(this.root)) {
|
|
71
|
+
fs.rmSync(this.root, { recursive: true, force: true });
|
|
72
|
+
fs.mkdirSync(this.root, { recursive: true });
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export { LocalPersistenceAdapter };
|
|
78
|
+
//# sourceMappingURL=LocalPersistenceAdapter.js.map
|
|
79
|
+
//# sourceMappingURL=LocalPersistenceAdapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/LocalPersistenceAdapter.ts"],"names":[],"mappings":";;;;AAyBO,IAAM,0BAAN,MAA4D;AAAA,EAChD,IAAA;AAAA,EAEjB,YAAY,IAAA,EAAc;AACxB,IAAA,IAAA,CAAK,IAAA,GAAO,IAAA;AACZ,IAAA,EAAA,CAAG,SAAA,CAAU,IAAA,EAAM,EAAE,SAAA,EAAW,MAAM,CAAA;AAAA,EACxC;AAAA,EAEQ,UAAU,UAAA,EAA4B;AAC5C,IAAA,MAAM,MAAM,IAAA,CAAK,IAAA,CAAK,KAAK,IAAA,EAAM,UAAA,CAAW,aAAa,CAAA;AACzD,IAAA,EAAA,CAAG,SAAA,CAAU,GAAA,EAAK,EAAE,SAAA,EAAW,MAAM,CAAA;AACrC,IAAA,OAAO,GAAA;AAAA,EACT;AAAA,EAEQ,QAAA,CAAS,YAAoB,EAAA,EAAoB;AACvD,IAAA,OAAO,IAAA,CAAK,KAAK,IAAA,CAAK,SAAA,CAAU,UAAU,CAAA,EAAG,CAAA,EAAG,EAAE,CAAA,KAAA,CAAO,CAAA;AAAA,EAC3D;AAAA,EAEA,MAAM,MAAA,CAAO,UAAA,EAAoB,IAAA,EAA0C;AACzE,IAAA,MAAM,EAAA,GAAM,KAAK,EAAA,IAAiB,CAAA,EAAG,WAAW,WAAA,EAAa,IAAI,IAAA,CAAK,GAAA,EAAK,CAAA,CAAA,EAAI,IAAA,CAAK,QAAO,CAAE,QAAA,CAAS,EAAE,CAAA,CAAE,KAAA,CAAM,CAAA,EAA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AAC9B,IAAA,IAAI,EAAA,CAAG,UAAA,CAAW,IAAA,CAAK,IAAI,CAAA,EAAG;AAC5B,MAAA,EAAA,CAAG,MAAA,CAAO,KAAK,IAAA,EAAM,EAAE,WAAW,IAAA,EAAM,KAAA,EAAO,MAAM,CAAA;AACrD,MAAA,EAAA,CAAG,UAAU,IAAA,CAAK,IAAA,EAAM,EAAE,SAAA,EAAW,MAAM,CAAA;AAAA,IAC7C;AAAA,EACF;AACF","file":"LocalPersistenceAdapter.js","sourcesContent":["/**\n * LocalPersistenceAdapter - Filesystem CRUD for `persistence: \"local\"` entities.\n *\n * One directory per entity type, one JSON file per instance.\n * Language-level feature: benefits all .orb programs, not just the agent.\n * Offline-first apps, CLI tools, config managers, local databases all use it.\n *\n * @packageDocumentation\n */\n\nimport fs from 'fs';\nimport path from 'path';\nimport type { PersistenceAdapter } from './OrbitalServerRuntime.js';\nimport type { EntityRow } from './types.js';\n\n/**\n * Filesystem-backed persistence adapter.\n *\n * Storage layout:\n * ```\n * {root}/\n * {entityType}/\n * {id}.json\n * ```\n */\nexport class LocalPersistenceAdapter implements PersistenceAdapter {\n private readonly root: string;\n\n constructor(root: string) {\n this.root = root;\n fs.mkdirSync(root, { recursive: true });\n }\n\n private entityDir(entityType: string): string {\n const dir = path.join(this.root, entityType.toLowerCase());\n fs.mkdirSync(dir, { recursive: true });\n return dir;\n }\n\n private filePath(entityType: string, id: string): string {\n return path.join(this.entityDir(entityType), `${id}.json`);\n }\n\n async create(entityType: string, data: EntityRow): Promise<{ id: string }> {\n const id = (data.id as string) || `${entityType.toLowerCase()}_${Date.now()}_${Math.random().toString(36).slice(2, 8)}`;\n const record: EntityRow = { ...data, id };\n const filePath = this.filePath(entityType, id);\n fs.writeFileSync(filePath, JSON.stringify(record, null, 2), 'utf-8');\n return { id };\n }\n\n async update(entityType: string, id: string, data: EntityRow): Promise<void> {\n const filePath = this.filePath(entityType, id);\n let existing: EntityRow = { id };\n if (fs.existsSync(filePath)) {\n existing = JSON.parse(fs.readFileSync(filePath, 'utf-8')) as EntityRow;\n }\n const merged: EntityRow = { ...existing, ...data, id };\n fs.writeFileSync(filePath, JSON.stringify(merged, null, 2), 'utf-8');\n }\n\n async delete(entityType: string, id: string): Promise<void> {\n const filePath = this.filePath(entityType, id);\n if (fs.existsSync(filePath)) {\n fs.unlinkSync(filePath);\n }\n }\n\n async getById(entityType: string, id: string): Promise<EntityRow | null> {\n const filePath = this.filePath(entityType, id);\n if (!fs.existsSync(filePath)) return null;\n return JSON.parse(fs.readFileSync(filePath, 'utf-8')) as EntityRow;\n }\n\n async list(entityType: string): Promise<EntityRow[]> {\n const dir = this.entityDir(entityType);\n if (!fs.existsSync(dir)) return [];\n const files = fs.readdirSync(dir).filter(f => f.endsWith('.json'));\n const results: EntityRow[] = [];\n for (const file of files) {\n const content = fs.readFileSync(path.join(dir, file), 'utf-8');\n results.push(JSON.parse(content) as EntityRow);\n }\n return results;\n }\n\n /**\n * Remove all data for an entity type.\n */\n async clear(entityType: string): Promise<void> {\n const dir = path.join(this.root, entityType.toLowerCase());\n if (fs.existsSync(dir)) {\n fs.rmSync(dir, { recursive: true, force: true });\n }\n }\n\n /**\n * Remove all local data.\n */\n async clearAll(): Promise<void> {\n if (fs.existsSync(this.root)) {\n fs.rmSync(this.root, { recursive: true, force: true });\n fs.mkdirSync(this.root, { recursive: true });\n }\n }\n}\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Router } from 'express';
|
|
2
2
|
import { I as IEventBus, g as RuntimeEvent, f as EventListener, U as Unsubscribe, T as TraitDefinition, R as RuntimeConfig, i as TransitionObserver, C as ConfigContext, h as TraitState, j as TransitionResult, E as EvaluationContextExtensions, a as EffectHandlers } from './types-ByLpy6yj.js';
|
|
3
3
|
import { EventPayload, EntityRow, OrbitalSchema, Orbital, Trait, PatternConfig, ResolvedPatternProps, SExpr, BusEventSource, OrbitalDefinition, Entity, TraitConfig, TraitTick } from '@almadar/core';
|
|
4
|
+
import { P as PersistenceAdapter } from './PersistenceAdapter-B6dQCbbU.js';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* EventBus - Platform-Agnostic Pub/Sub Implementation
|
|
@@ -302,48 +303,6 @@ declare class StateMachineManager {
|
|
|
302
303
|
resetAll(): void;
|
|
303
304
|
}
|
|
304
305
|
|
|
305
|
-
/**
|
|
306
|
-
* LocalPersistenceAdapter - Filesystem CRUD for `persistence: "local"` entities.
|
|
307
|
-
*
|
|
308
|
-
* One directory per entity type, one JSON file per instance.
|
|
309
|
-
* Language-level feature: benefits all .orb programs, not just the agent.
|
|
310
|
-
* Offline-first apps, CLI tools, config managers, local databases all use it.
|
|
311
|
-
*
|
|
312
|
-
* @packageDocumentation
|
|
313
|
-
*/
|
|
314
|
-
|
|
315
|
-
/**
|
|
316
|
-
* Filesystem-backed persistence adapter.
|
|
317
|
-
*
|
|
318
|
-
* Storage layout:
|
|
319
|
-
* ```
|
|
320
|
-
* {root}/
|
|
321
|
-
* {entityType}/
|
|
322
|
-
* {id}.json
|
|
323
|
-
* ```
|
|
324
|
-
*/
|
|
325
|
-
declare class LocalPersistenceAdapter implements PersistenceAdapter {
|
|
326
|
-
private readonly root;
|
|
327
|
-
constructor(root: string);
|
|
328
|
-
private entityDir;
|
|
329
|
-
private filePath;
|
|
330
|
-
create(entityType: string, data: EntityRow): Promise<{
|
|
331
|
-
id: string;
|
|
332
|
-
}>;
|
|
333
|
-
update(entityType: string, id: string, data: EntityRow): Promise<void>;
|
|
334
|
-
delete(entityType: string, id: string): Promise<void>;
|
|
335
|
-
getById(entityType: string, id: string): Promise<EntityRow | null>;
|
|
336
|
-
list(entityType: string): Promise<EntityRow[]>;
|
|
337
|
-
/**
|
|
338
|
-
* Remove all data for an entity type.
|
|
339
|
-
*/
|
|
340
|
-
clear(entityType: string): Promise<void>;
|
|
341
|
-
/**
|
|
342
|
-
* Remove all local data.
|
|
343
|
-
*/
|
|
344
|
-
clearAll(): Promise<void>;
|
|
345
|
-
}
|
|
346
|
-
|
|
347
306
|
/**
|
|
348
307
|
* External Orbital Loader
|
|
349
308
|
*
|
|
@@ -698,70 +657,6 @@ declare function parseNamespacedEvent(eventName: string): {
|
|
|
698
657
|
event: string;
|
|
699
658
|
};
|
|
700
659
|
|
|
701
|
-
/**
|
|
702
|
-
* PersistenceAdapter — the storage contract for runtime effect handlers.
|
|
703
|
-
*
|
|
704
|
-
* The server-side runtime and the in-browser mock runtime both invoke
|
|
705
|
-
* `fetch` / `persist` / `ref` / `deref` / `swap!` effects against an
|
|
706
|
-
* implementation of this interface. Extracted from
|
|
707
|
-
* `OrbitalServerRuntime.ts` so it can be imported by browser code that
|
|
708
|
-
* cannot depend on the server module (which pulls in express).
|
|
709
|
-
*
|
|
710
|
-
* @packageDocumentation
|
|
711
|
-
*/
|
|
712
|
-
|
|
713
|
-
/**
|
|
714
|
-
* Storage contract for CRUD operations on runtime entity rows.
|
|
715
|
-
*
|
|
716
|
-
* Implementations:
|
|
717
|
-
* - `InMemoryPersistence` (this file) — simple Map-backed store, used by
|
|
718
|
-
* the browser mock runtime and as the default when an adapter is not
|
|
719
|
-
* supplied to `OrbitalServerRuntime`.
|
|
720
|
-
* - `MockPersistenceAdapter` — in-memory with faker-generated seed data
|
|
721
|
-
* for realistic preview content.
|
|
722
|
-
* - `LocalPersistenceAdapter` — localStorage-backed, browser-safe.
|
|
723
|
-
* - Consumer-provided (e.g. Firestore, Postgres) for production servers.
|
|
724
|
-
*/
|
|
725
|
-
interface PersistenceAdapter {
|
|
726
|
-
create(entityType: string, data: EntityRow): Promise<{
|
|
727
|
-
id: string;
|
|
728
|
-
}>;
|
|
729
|
-
update(entityType: string, id: string, data: EntityRow): Promise<void>;
|
|
730
|
-
delete(entityType: string, id: string): Promise<void>;
|
|
731
|
-
getById(entityType: string, id: string): Promise<EntityRow | null>;
|
|
732
|
-
list(entityType: string): Promise<EntityRow[]>;
|
|
733
|
-
}
|
|
734
|
-
/**
|
|
735
|
-
* Simple in-memory persistence for dev/testing and offline previews.
|
|
736
|
-
* Keys each entity collection by type, rows by generated string id.
|
|
737
|
-
*/
|
|
738
|
-
declare class InMemoryPersistence implements PersistenceAdapter {
|
|
739
|
-
private data;
|
|
740
|
-
private idCounter;
|
|
741
|
-
/**
|
|
742
|
-
* Seed the store with pre-existing rows.
|
|
743
|
-
*
|
|
744
|
-
* Accepts either a plain `Record<entityType, EntityRow[]>` or an iterable
|
|
745
|
-
* of `[entityType, EntityRow[]]` entries. Rows without an `id` get one
|
|
746
|
-
* generated at insert time; rows with an `id` keep it (so re-seeding
|
|
747
|
-
* after a schema rebuild preserves identities used in render bindings).
|
|
748
|
-
*/
|
|
749
|
-
seed(seedData: Record<string, EntityRow[]> | Iterable<[string, EntityRow[]]>): void;
|
|
750
|
-
create(entityType: string, data: EntityRow): Promise<{
|
|
751
|
-
id: string;
|
|
752
|
-
}>;
|
|
753
|
-
update(entityType: string, id: string, data: EntityRow): Promise<void>;
|
|
754
|
-
delete(entityType: string, id: string): Promise<void>;
|
|
755
|
-
getById(entityType: string, id: string): Promise<EntityRow | null>;
|
|
756
|
-
list(entityType: string): Promise<EntityRow[]>;
|
|
757
|
-
/**
|
|
758
|
-
* Snapshot the entire store as a plain object (entityType → rows).
|
|
759
|
-
* Useful for feeding a fresh render-time binding layer with the
|
|
760
|
-
* current persistence view.
|
|
761
|
-
*/
|
|
762
|
-
snapshot(): Record<string, EntityRow[]>;
|
|
763
|
-
}
|
|
764
|
-
|
|
765
660
|
/**
|
|
766
661
|
* OrbitalServerRuntime - Dynamic Server-Side Orbital Execution
|
|
767
662
|
*
|
|
@@ -1231,4 +1126,4 @@ declare class OrbitalServerRuntime {
|
|
|
1231
1126
|
*/
|
|
1232
1127
|
declare function createOrbitalServerRuntime(config?: OrbitalServerRuntimeConfig): OrbitalServerRuntime;
|
|
1233
1128
|
|
|
1234
|
-
export {
|
|
1129
|
+
export { type ClientNavigateTuple as A, type ClientNotifyTuple as B, type ClientEffectTuple as C, type ClientRenderUITuple as D, type EntitySharingMap as E, type EffectResult as F, type LoaderConfig as G, OrbitalServerRuntime as H, type ImportChainLike as I, type RuntimeTraitTick as J, createOrbitalServerRuntime as K, type LoadResult as L, type OrbitalEventRequest as O, type PreprocessOptions as P, type RegisteredOrbital as R, type SchemaLoader as S, type UnifiedLoaderOptions as U, type LoadedSchema as a, type LoadedOrbital as b, EventBus as c, type EventNamespaceMap as d, type OrbitalEventResponse as e, type OrbitalServerRuntimeConfig as f, type PreprocessResult as g, type PreprocessedSchema as h, type ProcessEventOptions as i, type RuntimeOrbital as j, type RuntimeOrbitalSchema as k, type RuntimeTrait as l, StateMachineManager as m, createInitialTraitState as n, findInitialState as o, findTransition as p, getIsolatedCollectionName as q, getNamespacedEvent as r, isBrowser as s, isElectron as t, isNamespacedEvent as u, isNode as v, normalizeEventKey as w, parseNamespacedEvent as x, preprocessSchema as y, processEvent as z };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import 'express';
|
|
2
|
-
export { C as ClientEffectTuple,
|
|
2
|
+
export { C as ClientEffectTuple, A as ClientNavigateTuple, B as ClientNotifyTuple, D as ClientRenderUITuple, F as EffectResult, G as LoaderConfig, O as OrbitalEventRequest, e as OrbitalEventResponse, H as OrbitalServerRuntime, f as OrbitalServerRuntimeConfig, R as RegisteredOrbital, j as RuntimeOrbital, k as RuntimeOrbitalSchema, l as RuntimeTrait, J as RuntimeTraitTick, K as createOrbitalServerRuntime } from './OrbitalServerRuntime-BP5sz5Bn.js';
|
|
3
3
|
import './types-ByLpy6yj.js';
|
|
4
4
|
import '@almadar/core';
|
|
5
|
+
export { I as InMemoryPersistence, P as PersistenceAdapter } from './PersistenceAdapter-B6dQCbbU.js';
|