@interncom/diplomatic 0.20.0 → 0.21.1
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/cli/index.mjs +2 -2
- package/dist/cli/shared/crypto/enclave.d.ts +8 -1
- package/dist/cli/shared/crypto/noble.d.ts +2 -2
- package/dist/cli/shared/types.d.ts +8 -1
- package/dist/web/client.d.ts +14 -13
- package/dist/web/entdb/cached.d.ts +19 -2
- package/dist/web/entdb/manager.d.ts +3 -3
- package/dist/web/index.mjs +1 -1
- package/dist/web/openClient.d.ts +5 -0
- package/dist/web/react/useClient.d.ts +5 -0
- package/dist/web/shared/crypto/enclave.d.ts +8 -1
- package/dist/web/shared/crypto/noble.d.ts +2 -2
- package/dist/web/shared/types.d.ts +8 -1
- package/dist/web/types.d.ts +1 -1
- package/dist/web/verbose.d.ts +4 -0
- package/dist/web/worker.mjs +1 -1
- package/package.json +2 -1
|
@@ -20,6 +20,11 @@ export type OpenEntDBOptions = {
|
|
|
20
20
|
* Set false to notify only after durable commit. Ignored when `cache` is false.
|
|
21
21
|
*/
|
|
22
22
|
optimistic?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Timed `[dip]` traces for apply / list / persist (default false).
|
|
25
|
+
* Process-wide; also accepted on openDiplomaticClient / useClient.
|
|
26
|
+
*/
|
|
27
|
+
verbose?: boolean;
|
|
23
28
|
};
|
|
24
29
|
export type CachedEntDBOptions = {
|
|
25
30
|
/** Secondary mem indexes (default true). See {@link OpenEntDBOptions.indexes}. */
|
|
@@ -32,6 +37,7 @@ export type CachedEntDBOptions = {
|
|
|
32
37
|
* Default: cached with mem indexes and optimistic notify.
|
|
33
38
|
* Pass `{ cache: false }` for durable IDB only.
|
|
34
39
|
* Pass `{ optimistic: false }` to notify only after durable commit.
|
|
40
|
+
* Pass `{ verbose: true }` for `[dip]` timings (apply, list, persist).
|
|
35
41
|
*/
|
|
36
42
|
export declare function openEntDB(opts?: OpenEntDBOptions): Promise<IEntDB>;
|
|
37
43
|
export declare class CachedEntDB implements IEntDB {
|
|
@@ -41,14 +47,18 @@ export declare class CachedEntDB implements IEntDB {
|
|
|
41
47
|
private listeners;
|
|
42
48
|
private chain;
|
|
43
49
|
private optimistic;
|
|
50
|
+
/** Optimistic applies whose durable persist has not finished. */
|
|
51
|
+
private inflight;
|
|
52
|
+
/** In-flight warmType per type (not on the persist/ingest chain). */
|
|
53
|
+
private warmP;
|
|
44
54
|
constructor(durable: IEntDB, init?: IEntity[], opts?: CachedEntDBOptions);
|
|
45
55
|
/** UI / StateManager: fired when mem changes (immediate apply or durable ingest). */
|
|
46
56
|
subscribe(listener: EntChangeListener): () => void;
|
|
47
57
|
private emit;
|
|
48
58
|
private run;
|
|
49
59
|
/**
|
|
50
|
-
* Fan-out write: patch mem, queue durable, notify UI
|
|
51
|
-
*
|
|
60
|
+
* Fan-out write: patch mem, queue durable, notify UI after the next paint.
|
|
61
|
+
* Not `async`: mem patch must run before any await.
|
|
52
62
|
* `{ optimistic: false }`: skip the mem prefix; notify after durable.
|
|
53
63
|
*/
|
|
54
64
|
apply(ops: IOp[]): Promise<import("./entdb").ApplyResult>;
|
|
@@ -67,6 +77,13 @@ export declare class CachedEntDB implements IEntDB {
|
|
|
67
77
|
*/
|
|
68
78
|
private pullEids;
|
|
69
79
|
private warmType;
|
|
80
|
+
/**
|
|
81
|
+
* Load a type from durable into mem. Not on the persist/ingest chain —
|
|
82
|
+
* first UI list must not wait for dirty-eid pull after worker sync.
|
|
83
|
+
*/
|
|
84
|
+
private beginWarm;
|
|
85
|
+
/** Background warm + notify. Does not block the caller. */
|
|
86
|
+
private ensureWarm;
|
|
70
87
|
getRow<T>(eid: EntityID): Promise<ValStat<IEntRow<T> | undefined>>;
|
|
71
88
|
getEnt<T>(eid: EntityID): Promise<ValStat<IEntity<T> | undefined>>;
|
|
72
89
|
getEntities<T>(query: EntitiesQuery): Promise<ValStat<IEntity<T>[]>>;
|
|
@@ -3,8 +3,8 @@ import type { IEntDB } from "./entdb";
|
|
|
3
3
|
/**
|
|
4
4
|
* Build a StateManager for an EntDB.
|
|
5
5
|
* When `edb` is a {@link CachedEntDB}, type notifies come from the cache
|
|
6
|
-
* subscribe path (mem patch +
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* subscribe path (mem patch + notify after paint, then durable persist).
|
|
7
|
+
* cacheDriven: StateManager.apply must not emit after the applier Promise
|
|
8
|
+
* settles — that emit would wait until durable IDB.
|
|
9
9
|
*/
|
|
10
10
|
export declare function entStateManager(edb: IEntDB): StateManager;
|