@interncom/diplomatic 0.18.3 → 0.19.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.
@@ -12,6 +12,11 @@ type UseClientBase = {
12
12
  seed?: Enclave;
13
13
  host?: IHostConnectionInfo<URL>;
14
14
  readyTimeoutMs?: number;
15
+ /**
16
+ * EntDB optimistic UI notify (default true). See {@link openEntDB}.
17
+ * Set false to notify only after durable commit.
18
+ */
19
+ optimistic?: boolean;
15
20
  };
16
21
  /**
17
22
  * Worker path: IndexedDB on main; sync Worker appears on setSeed via Enclave.
@@ -8,14 +8,12 @@ import type { ValStat } from "./valstat.ts";
8
8
  /** Identity seed brands — defined in seed.ts; re-exported for convenience. */
9
9
  export type { MasterSeed, SealedMasterKey } from "./seed.ts";
10
10
  export { asSealedMasterKey, MASTER_SEED_LEN, SEALED_MASTER_KEY_LEN, } from "./seed.ts";
11
- export type GroupID = string;
12
11
  declare const entityIDSymbol: unique symbol;
13
12
  export type EntityID = Uint8Array & {
14
13
  readonly [entityIDSymbol]: true;
15
14
  };
16
15
  export type SerializedContent = Uint8Array;
17
16
  export interface IMsgEntBody<T = unknown> {
18
- gid?: GroupID;
19
17
  pid?: EntityID;
20
18
  /**
21
19
  * Optional multi-value tags for reverse multi-ref / label lookup (multiEntry-indexed).
@@ -12,8 +12,9 @@ export declare class StateManager implements IStateManager {
12
12
  /** Worker / peer: eids successfully applied to durable EntDB. */
13
13
  private onDirtyEids;
14
14
  /**
15
- * When set (CachedEntDB), type events are driven by the cache's subscribe
16
- * path (immediate + durable ingest). apply() does not re-emit.
15
+ * When set (CachedEntDB), type events come from cache.subscribe (optimistic
16
+ * mem patch + later reconcile). apply() must not emit after awaiting the
17
+ * applier — that Promise settles only after durable IDB.
17
18
  */
18
19
  private cacheDriven;
19
20
  private peerIngest;
@@ -85,7 +85,7 @@ export declare class WorkerClient implements IClient<URL> {
85
85
  hosts(): Promise<IHostRow<URL>[]>;
86
86
  connect(listen?: boolean, sync?: boolean): Promise<void>;
87
87
  disconnect(): Promise<void>;
88
- /** Local UI write: archive + apply on main (cache notifies UI); sync via worker. */
88
+ /** Local UI write on main (cache notifies in apply's sync prefix); sync via worker. */
89
89
  insertRaw(content: SerializedContent): Promise<ValStat<IMessageHead>>;
90
90
  updateRaw(prior: IEntRev, content: SerializedContent | undefined, force?: boolean): Promise<ValStat<IMessageHead>>;
91
91
  insert<T = unknown>(op: IInsertParams<T>): Promise<ValStat<IMessageHead>>;