@anuma/sdk 7.0.7 → 7.1.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.
@@ -109,6 +109,9 @@ interface CloudKitRecord {
109
109
  size: number;
110
110
  };
111
111
  };
112
+ backupRevision?: {
113
+ value: string;
114
+ };
112
115
  };
113
116
  modified?: {
114
117
  timestamp: number;
@@ -3484,6 +3487,7 @@ interface EntityOperationsContext {
3484
3487
  * (server / SQLite, where the migration backfill is authoritative).
3485
3488
  */
3486
3489
  allowUnscopedRows?: boolean;
3490
+ canWrite?: () => Promise<boolean>;
3487
3491
  }
3488
3492
  /**
3489
3493
  * Link a memory to one or more entities. Accepts bare names (back-compat)
@@ -5764,6 +5768,10 @@ type ExtractOutcome = "extracted" | "no-facts" | "empty-after-retry" | "dropped-
5764
5768
  */
5765
5769
  declare function extractAndRetain(messages: AutoExtractMessage[], retainCtx: RetainContext, options: {
5766
5770
  extract: ExtractFactsOptions;
5771
+ /** Route extracted facts through this store instead of the local vault. */
5772
+ memoryStore?: MemoryStore | null;
5773
+ /** Cancel remote writes for this extraction batch. */
5774
+ signal?: AbortSignal;
5767
5775
  minConfidence?: number;
5768
5776
  /** Override scope/folder for all retained facts. */
5769
5777
  scope?: string;
@@ -7142,7 +7150,12 @@ type MemoryRecallOptions = Omit<RecallOptions, "types" | "includeChunks" | "conv
7142
7150
  * and never receives these credentials, callbacks or redactor instances.
7143
7151
  * @public
7144
7152
  */
7145
- type MemoryRetainOptions = Omit<RetainOptions, "folderId">;
7153
+ type MemoryRetainOptions = Omit<RetainOptions, "folderId"> & {
7154
+ /** Reject writes when the originating extraction is no longer eligible. */
7155
+ canWrite?: () => Promise<boolean>;
7156
+ /** Abort pending remote requests when the originating extraction is cancelled. */
7157
+ signal?: AbortSignal;
7158
+ };
7146
7159
  /**
7147
7160
  * A topic and how many memories link to it.
7148
7161
  * @public
@@ -7271,7 +7284,11 @@ interface MemoryStore {
7271
7284
  /** Replace the memory's topics with a user-chosen set and stop auto-tagging it. */
7272
7285
  setTopics(memoryId: string, topics: readonly EntityInput[]): Promise<StoredVaultMemory | null>;
7273
7286
  /** Add topics alongside the existing ones (auto-tagging stays on). */
7274
- addTopics(memoryId: string, topics: readonly EntityInput[]): Promise<StoredEntity[]>;
7287
+ addTopics(memoryId: string, topics: readonly EntityInput[], options?: {
7288
+ unlessUserManaged?: boolean;
7289
+ canWrite?: () => Promise<boolean>;
7290
+ signal?: AbortSignal;
7291
+ }): Promise<StoredEntity[]>;
7275
7292
  setVisibility(id: string, visibility: VaultMemoryVisibility, options?: {
7276
7293
  twinOptIn?: boolean;
7277
7294
  }): Promise<StoredVaultMemory | null>;
@@ -8386,8 +8403,8 @@ interface BaseUseChatStorageOptions {
8386
8403
  hooks?: RunHooks | RunHooks[];
8387
8404
  /** WatermelonDB database instance for storing conversations and messages */
8388
8405
  database: Database;
8389
- /** Route memory reads, writes, recall and the memory tools through this store instead of the database's vault; folders are unsupported. With `piiRedaction` on, build the store with `embeddingOptions.maskInput` (e.g. `(text) => redactor.maskText(text)` with any `PiiRedactor`) or its memory calls throw. */
8390
- memoryStore?: MemoryStore;
8406
+ /** Route memory operations through this store; `null` disables memory access while `undefined` uses the local vault. Folders are unsupported. With `piiRedaction` on, build the store with `embeddingOptions.maskInput` or its memory calls throw. */
8407
+ memoryStore?: MemoryStore | null;
8391
8408
  /** ID of an existing conversation to load and continue */
8392
8409
  conversationId?: string;
8393
8410
  /** Automatically create a new conversation if none is set (default: true) */
@@ -10602,6 +10619,10 @@ interface SyncKeyValueStore {
10602
10619
  declare function createPlatformCursorStore(storage: SyncKeyValueStore, keyPrefix?: string): ExtractionCursorStore;
10603
10620
  interface CreateAutoExtractorOptions {
10604
10621
  retainCtx: RetainContext;
10622
+ /** Route retained facts and topics through this store; null disables memory writes. */
10623
+ memoryStore?: MemoryStore | null;
10624
+ /** Cancel remote writes for an extraction batch. */
10625
+ signal?: AbortSignal;
10605
10626
  extract: ExtractFactsOptions;
10606
10627
  /** Confidence floor for retained facts. Default 0.7. */
10607
10628
  minConfidence?: number;
@@ -11209,6 +11230,8 @@ interface LocalMemoryStoreOptions {
11209
11230
  walletAddress?: string;
11210
11231
  signMessage?: SignMessageFn;
11211
11232
  embeddedWalletSigner?: EmbeddedWalletSignerFn;
11233
+ /** Rechecked inside each serialized memory write. */
11234
+ canWrite?: () => Promise<boolean>;
11212
11235
  /**
11213
11236
  * Scope every read/write to this user — for a shared, multi-tenant database
11214
11237
  * whose rows all carry their `user_id`. Rows with no `user_id` are invisible
@@ -109,6 +109,9 @@ interface CloudKitRecord {
109
109
  size: number;
110
110
  };
111
111
  };
112
+ backupRevision?: {
113
+ value: string;
114
+ };
112
115
  };
113
116
  modified?: {
114
117
  timestamp: number;
@@ -3484,6 +3487,7 @@ interface EntityOperationsContext {
3484
3487
  * (server / SQLite, where the migration backfill is authoritative).
3485
3488
  */
3486
3489
  allowUnscopedRows?: boolean;
3490
+ canWrite?: () => Promise<boolean>;
3487
3491
  }
3488
3492
  /**
3489
3493
  * Link a memory to one or more entities. Accepts bare names (back-compat)
@@ -5764,6 +5768,10 @@ type ExtractOutcome = "extracted" | "no-facts" | "empty-after-retry" | "dropped-
5764
5768
  */
5765
5769
  declare function extractAndRetain(messages: AutoExtractMessage[], retainCtx: RetainContext, options: {
5766
5770
  extract: ExtractFactsOptions;
5771
+ /** Route extracted facts through this store instead of the local vault. */
5772
+ memoryStore?: MemoryStore | null;
5773
+ /** Cancel remote writes for this extraction batch. */
5774
+ signal?: AbortSignal;
5767
5775
  minConfidence?: number;
5768
5776
  /** Override scope/folder for all retained facts. */
5769
5777
  scope?: string;
@@ -7142,7 +7150,12 @@ type MemoryRecallOptions = Omit<RecallOptions, "types" | "includeChunks" | "conv
7142
7150
  * and never receives these credentials, callbacks or redactor instances.
7143
7151
  * @public
7144
7152
  */
7145
- type MemoryRetainOptions = Omit<RetainOptions, "folderId">;
7153
+ type MemoryRetainOptions = Omit<RetainOptions, "folderId"> & {
7154
+ /** Reject writes when the originating extraction is no longer eligible. */
7155
+ canWrite?: () => Promise<boolean>;
7156
+ /** Abort pending remote requests when the originating extraction is cancelled. */
7157
+ signal?: AbortSignal;
7158
+ };
7146
7159
  /**
7147
7160
  * A topic and how many memories link to it.
7148
7161
  * @public
@@ -7271,7 +7284,11 @@ interface MemoryStore {
7271
7284
  /** Replace the memory's topics with a user-chosen set and stop auto-tagging it. */
7272
7285
  setTopics(memoryId: string, topics: readonly EntityInput[]): Promise<StoredVaultMemory | null>;
7273
7286
  /** Add topics alongside the existing ones (auto-tagging stays on). */
7274
- addTopics(memoryId: string, topics: readonly EntityInput[]): Promise<StoredEntity[]>;
7287
+ addTopics(memoryId: string, topics: readonly EntityInput[], options?: {
7288
+ unlessUserManaged?: boolean;
7289
+ canWrite?: () => Promise<boolean>;
7290
+ signal?: AbortSignal;
7291
+ }): Promise<StoredEntity[]>;
7275
7292
  setVisibility(id: string, visibility: VaultMemoryVisibility, options?: {
7276
7293
  twinOptIn?: boolean;
7277
7294
  }): Promise<StoredVaultMemory | null>;
@@ -8386,8 +8403,8 @@ interface BaseUseChatStorageOptions {
8386
8403
  hooks?: RunHooks | RunHooks[];
8387
8404
  /** WatermelonDB database instance for storing conversations and messages */
8388
8405
  database: Database;
8389
- /** Route memory reads, writes, recall and the memory tools through this store instead of the database's vault; folders are unsupported. With `piiRedaction` on, build the store with `embeddingOptions.maskInput` (e.g. `(text) => redactor.maskText(text)` with any `PiiRedactor`) or its memory calls throw. */
8390
- memoryStore?: MemoryStore;
8406
+ /** Route memory operations through this store; `null` disables memory access while `undefined` uses the local vault. Folders are unsupported. With `piiRedaction` on, build the store with `embeddingOptions.maskInput` or its memory calls throw. */
8407
+ memoryStore?: MemoryStore | null;
8391
8408
  /** ID of an existing conversation to load and continue */
8392
8409
  conversationId?: string;
8393
8410
  /** Automatically create a new conversation if none is set (default: true) */
@@ -10602,6 +10619,10 @@ interface SyncKeyValueStore {
10602
10619
  declare function createPlatformCursorStore(storage: SyncKeyValueStore, keyPrefix?: string): ExtractionCursorStore;
10603
10620
  interface CreateAutoExtractorOptions {
10604
10621
  retainCtx: RetainContext;
10622
+ /** Route retained facts and topics through this store; null disables memory writes. */
10623
+ memoryStore?: MemoryStore | null;
10624
+ /** Cancel remote writes for an extraction batch. */
10625
+ signal?: AbortSignal;
10605
10626
  extract: ExtractFactsOptions;
10606
10627
  /** Confidence floor for retained facts. Default 0.7. */
10607
10628
  minConfidence?: number;
@@ -11209,6 +11230,8 @@ interface LocalMemoryStoreOptions {
11209
11230
  walletAddress?: string;
11210
11231
  signMessage?: SignMessageFn;
11211
11232
  embeddedWalletSigner?: EmbeddedWalletSignerFn;
11233
+ /** Rechecked inside each serialized memory write. */
11234
+ canWrite?: () => Promise<boolean>;
11212
11235
  /**
11213
11236
  * Scope every read/write to this user — for a shared, multi-tenant database
11214
11237
  * whose rows all carry their `user_id`. Rows with no `user_id` are invisible