@anuma/sdk 7.0.7 → 7.1.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/expo/index.cjs +224 -68
- package/dist/expo/index.d.mts +24 -4
- package/dist/expo/index.d.ts +24 -4
- package/dist/expo/index.mjs +224 -68
- package/dist/memory/context.d.mts +1 -0
- package/dist/memory/context.d.ts +1 -0
- package/dist/react/index.cjs +229 -68
- package/dist/react/index.d.mts +24 -4
- package/dist/react/index.d.ts +24 -4
- package/dist/react/index.mjs +229 -68
- package/dist/server/index.cjs +144 -28
- package/dist/server/index.d.mts +22 -2
- package/dist/server/index.d.ts +22 -2
- package/dist/server/index.mjs +144 -28
- package/package.json +1 -1
package/dist/react/index.d.mts
CHANGED
|
@@ -3484,6 +3484,7 @@ interface EntityOperationsContext {
|
|
|
3484
3484
|
* (server / SQLite, where the migration backfill is authoritative).
|
|
3485
3485
|
*/
|
|
3486
3486
|
allowUnscopedRows?: boolean;
|
|
3487
|
+
canWrite?: () => Promise<boolean>;
|
|
3487
3488
|
}
|
|
3488
3489
|
/**
|
|
3489
3490
|
* Link a memory to one or more entities. Accepts bare names (back-compat)
|
|
@@ -5764,6 +5765,10 @@ type ExtractOutcome = "extracted" | "no-facts" | "empty-after-retry" | "dropped-
|
|
|
5764
5765
|
*/
|
|
5765
5766
|
declare function extractAndRetain(messages: AutoExtractMessage[], retainCtx: RetainContext, options: {
|
|
5766
5767
|
extract: ExtractFactsOptions;
|
|
5768
|
+
/** Route extracted facts through this store instead of the local vault. */
|
|
5769
|
+
memoryStore?: MemoryStore | null;
|
|
5770
|
+
/** Cancel remote writes for this extraction batch. */
|
|
5771
|
+
signal?: AbortSignal;
|
|
5767
5772
|
minConfidence?: number;
|
|
5768
5773
|
/** Override scope/folder for all retained facts. */
|
|
5769
5774
|
scope?: string;
|
|
@@ -7142,7 +7147,12 @@ type MemoryRecallOptions = Omit<RecallOptions, "types" | "includeChunks" | "conv
|
|
|
7142
7147
|
* and never receives these credentials, callbacks or redactor instances.
|
|
7143
7148
|
* @public
|
|
7144
7149
|
*/
|
|
7145
|
-
type MemoryRetainOptions = Omit<RetainOptions, "folderId"
|
|
7150
|
+
type MemoryRetainOptions = Omit<RetainOptions, "folderId"> & {
|
|
7151
|
+
/** Reject writes when the originating extraction is no longer eligible. */
|
|
7152
|
+
canWrite?: () => Promise<boolean>;
|
|
7153
|
+
/** Abort pending remote requests when the originating extraction is cancelled. */
|
|
7154
|
+
signal?: AbortSignal;
|
|
7155
|
+
};
|
|
7146
7156
|
/**
|
|
7147
7157
|
* A topic and how many memories link to it.
|
|
7148
7158
|
* @public
|
|
@@ -7271,7 +7281,11 @@ interface MemoryStore {
|
|
|
7271
7281
|
/** Replace the memory's topics with a user-chosen set and stop auto-tagging it. */
|
|
7272
7282
|
setTopics(memoryId: string, topics: readonly EntityInput[]): Promise<StoredVaultMemory | null>;
|
|
7273
7283
|
/** Add topics alongside the existing ones (auto-tagging stays on). */
|
|
7274
|
-
addTopics(memoryId: string, topics: readonly EntityInput[]
|
|
7284
|
+
addTopics(memoryId: string, topics: readonly EntityInput[], options?: {
|
|
7285
|
+
unlessUserManaged?: boolean;
|
|
7286
|
+
canWrite?: () => Promise<boolean>;
|
|
7287
|
+
signal?: AbortSignal;
|
|
7288
|
+
}): Promise<StoredEntity[]>;
|
|
7275
7289
|
setVisibility(id: string, visibility: VaultMemoryVisibility, options?: {
|
|
7276
7290
|
twinOptIn?: boolean;
|
|
7277
7291
|
}): Promise<StoredVaultMemory | null>;
|
|
@@ -8386,8 +8400,8 @@ interface BaseUseChatStorageOptions {
|
|
|
8386
8400
|
hooks?: RunHooks | RunHooks[];
|
|
8387
8401
|
/** WatermelonDB database instance for storing conversations and messages */
|
|
8388
8402
|
database: Database;
|
|
8389
|
-
/** Route memory
|
|
8390
|
-
memoryStore?: MemoryStore;
|
|
8403
|
+
/** 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. */
|
|
8404
|
+
memoryStore?: MemoryStore | null;
|
|
8391
8405
|
/** ID of an existing conversation to load and continue */
|
|
8392
8406
|
conversationId?: string;
|
|
8393
8407
|
/** Automatically create a new conversation if none is set (default: true) */
|
|
@@ -10602,6 +10616,10 @@ interface SyncKeyValueStore {
|
|
|
10602
10616
|
declare function createPlatformCursorStore(storage: SyncKeyValueStore, keyPrefix?: string): ExtractionCursorStore;
|
|
10603
10617
|
interface CreateAutoExtractorOptions {
|
|
10604
10618
|
retainCtx: RetainContext;
|
|
10619
|
+
/** Route retained facts and topics through this store; null disables memory writes. */
|
|
10620
|
+
memoryStore?: MemoryStore | null;
|
|
10621
|
+
/** Cancel remote writes for an extraction batch. */
|
|
10622
|
+
signal?: AbortSignal;
|
|
10605
10623
|
extract: ExtractFactsOptions;
|
|
10606
10624
|
/** Confidence floor for retained facts. Default 0.7. */
|
|
10607
10625
|
minConfidence?: number;
|
|
@@ -11209,6 +11227,8 @@ interface LocalMemoryStoreOptions {
|
|
|
11209
11227
|
walletAddress?: string;
|
|
11210
11228
|
signMessage?: SignMessageFn;
|
|
11211
11229
|
embeddedWalletSigner?: EmbeddedWalletSignerFn;
|
|
11230
|
+
/** Rechecked inside each serialized memory write. */
|
|
11231
|
+
canWrite?: () => Promise<boolean>;
|
|
11212
11232
|
/**
|
|
11213
11233
|
* Scope every read/write to this user — for a shared, multi-tenant database
|
|
11214
11234
|
* whose rows all carry their `user_id`. Rows with no `user_id` are invisible
|
package/dist/react/index.d.ts
CHANGED
|
@@ -3484,6 +3484,7 @@ interface EntityOperationsContext {
|
|
|
3484
3484
|
* (server / SQLite, where the migration backfill is authoritative).
|
|
3485
3485
|
*/
|
|
3486
3486
|
allowUnscopedRows?: boolean;
|
|
3487
|
+
canWrite?: () => Promise<boolean>;
|
|
3487
3488
|
}
|
|
3488
3489
|
/**
|
|
3489
3490
|
* Link a memory to one or more entities. Accepts bare names (back-compat)
|
|
@@ -5764,6 +5765,10 @@ type ExtractOutcome = "extracted" | "no-facts" | "empty-after-retry" | "dropped-
|
|
|
5764
5765
|
*/
|
|
5765
5766
|
declare function extractAndRetain(messages: AutoExtractMessage[], retainCtx: RetainContext, options: {
|
|
5766
5767
|
extract: ExtractFactsOptions;
|
|
5768
|
+
/** Route extracted facts through this store instead of the local vault. */
|
|
5769
|
+
memoryStore?: MemoryStore | null;
|
|
5770
|
+
/** Cancel remote writes for this extraction batch. */
|
|
5771
|
+
signal?: AbortSignal;
|
|
5767
5772
|
minConfidence?: number;
|
|
5768
5773
|
/** Override scope/folder for all retained facts. */
|
|
5769
5774
|
scope?: string;
|
|
@@ -7142,7 +7147,12 @@ type MemoryRecallOptions = Omit<RecallOptions, "types" | "includeChunks" | "conv
|
|
|
7142
7147
|
* and never receives these credentials, callbacks or redactor instances.
|
|
7143
7148
|
* @public
|
|
7144
7149
|
*/
|
|
7145
|
-
type MemoryRetainOptions = Omit<RetainOptions, "folderId"
|
|
7150
|
+
type MemoryRetainOptions = Omit<RetainOptions, "folderId"> & {
|
|
7151
|
+
/** Reject writes when the originating extraction is no longer eligible. */
|
|
7152
|
+
canWrite?: () => Promise<boolean>;
|
|
7153
|
+
/** Abort pending remote requests when the originating extraction is cancelled. */
|
|
7154
|
+
signal?: AbortSignal;
|
|
7155
|
+
};
|
|
7146
7156
|
/**
|
|
7147
7157
|
* A topic and how many memories link to it.
|
|
7148
7158
|
* @public
|
|
@@ -7271,7 +7281,11 @@ interface MemoryStore {
|
|
|
7271
7281
|
/** Replace the memory's topics with a user-chosen set and stop auto-tagging it. */
|
|
7272
7282
|
setTopics(memoryId: string, topics: readonly EntityInput[]): Promise<StoredVaultMemory | null>;
|
|
7273
7283
|
/** Add topics alongside the existing ones (auto-tagging stays on). */
|
|
7274
|
-
addTopics(memoryId: string, topics: readonly EntityInput[]
|
|
7284
|
+
addTopics(memoryId: string, topics: readonly EntityInput[], options?: {
|
|
7285
|
+
unlessUserManaged?: boolean;
|
|
7286
|
+
canWrite?: () => Promise<boolean>;
|
|
7287
|
+
signal?: AbortSignal;
|
|
7288
|
+
}): Promise<StoredEntity[]>;
|
|
7275
7289
|
setVisibility(id: string, visibility: VaultMemoryVisibility, options?: {
|
|
7276
7290
|
twinOptIn?: boolean;
|
|
7277
7291
|
}): Promise<StoredVaultMemory | null>;
|
|
@@ -8386,8 +8400,8 @@ interface BaseUseChatStorageOptions {
|
|
|
8386
8400
|
hooks?: RunHooks | RunHooks[];
|
|
8387
8401
|
/** WatermelonDB database instance for storing conversations and messages */
|
|
8388
8402
|
database: Database;
|
|
8389
|
-
/** Route memory
|
|
8390
|
-
memoryStore?: MemoryStore;
|
|
8403
|
+
/** 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. */
|
|
8404
|
+
memoryStore?: MemoryStore | null;
|
|
8391
8405
|
/** ID of an existing conversation to load and continue */
|
|
8392
8406
|
conversationId?: string;
|
|
8393
8407
|
/** Automatically create a new conversation if none is set (default: true) */
|
|
@@ -10602,6 +10616,10 @@ interface SyncKeyValueStore {
|
|
|
10602
10616
|
declare function createPlatformCursorStore(storage: SyncKeyValueStore, keyPrefix?: string): ExtractionCursorStore;
|
|
10603
10617
|
interface CreateAutoExtractorOptions {
|
|
10604
10618
|
retainCtx: RetainContext;
|
|
10619
|
+
/** Route retained facts and topics through this store; null disables memory writes. */
|
|
10620
|
+
memoryStore?: MemoryStore | null;
|
|
10621
|
+
/** Cancel remote writes for an extraction batch. */
|
|
10622
|
+
signal?: AbortSignal;
|
|
10605
10623
|
extract: ExtractFactsOptions;
|
|
10606
10624
|
/** Confidence floor for retained facts. Default 0.7. */
|
|
10607
10625
|
minConfidence?: number;
|
|
@@ -11209,6 +11227,8 @@ interface LocalMemoryStoreOptions {
|
|
|
11209
11227
|
walletAddress?: string;
|
|
11210
11228
|
signMessage?: SignMessageFn;
|
|
11211
11229
|
embeddedWalletSigner?: EmbeddedWalletSignerFn;
|
|
11230
|
+
/** Rechecked inside each serialized memory write. */
|
|
11231
|
+
canWrite?: () => Promise<boolean>;
|
|
11212
11232
|
/**
|
|
11213
11233
|
* Scope every read/write to this user — for a shared, multi-tenant database
|
|
11214
11234
|
* whose rows all carry their `user_id`. Rows with no `user_id` are invisible
|