@anuma/sdk 11.0.1 → 11.2.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 +303 -148
- package/dist/expo/index.d.mts +17 -2
- package/dist/expo/index.d.ts +17 -2
- package/dist/expo/index.mjs +300 -145
- package/dist/index.d.mts +9 -1
- package/dist/index.d.ts +9 -1
- package/dist/react/index.cjs +587 -193
- package/dist/react/index.d.mts +21 -2
- package/dist/react/index.d.ts +21 -2
- package/dist/react/index.mjs +585 -190
- package/dist/server/index.cjs +162 -129
- package/dist/server/index.d.mts +11 -1
- package/dist/server/index.d.ts +11 -1
- package/dist/server/index.mjs +159 -126
- package/dist/tools/index.cjs +27 -5
- package/dist/tools/index.d.mts +13 -2
- package/dist/tools/index.d.ts +13 -2
- package/dist/tools/index.mjs +27 -5
- package/dist/tools/selection/index.d.mts +9 -1
- package/dist/tools/selection/index.d.ts +9 -1
- package/package.json +1 -1
package/dist/expo/index.d.mts
CHANGED
|
@@ -2373,7 +2373,13 @@ type StreamingTransport = (options: StreamingTransportOptions) => StreamingTrans
|
|
|
2373
2373
|
/**
|
|
2374
2374
|
* Tool executor function type
|
|
2375
2375
|
*/
|
|
2376
|
-
type ToolExecutor = (args: Record<string, unknown>, signal?: AbortSignal) => Promise<unknown> | unknown;
|
|
2376
|
+
type ToolExecutor = (args: Record<string, unknown>, signal?: AbortSignal, context?: ToolExecutionContext) => Promise<unknown> | unknown;
|
|
2377
|
+
/** How the portal treats a call to this device tool while the device is away. */
|
|
2378
|
+
type DetachedToolClass = "render" | "deferred";
|
|
2379
|
+
/** Context for one executor run; `detached` marks a call from an answer finished while the device was away. */
|
|
2380
|
+
type ToolExecutionContext = {
|
|
2381
|
+
detached?: boolean;
|
|
2382
|
+
};
|
|
2377
2383
|
/**
|
|
2378
2384
|
* Tool configuration with optional executor
|
|
2379
2385
|
*/
|
|
@@ -2443,6 +2449,8 @@ type ToolConfig = LlmapiChatCompletionTool & {
|
|
|
2443
2449
|
* files from IndexedDB that `create_file` writes.
|
|
2444
2450
|
*/
|
|
2445
2451
|
dependsOn?: string[];
|
|
2452
|
+
/** How the portal handles a call to this tool while the device is away; unset tools pause the turn. */
|
|
2453
|
+
detachedClass?: DetachedToolClass;
|
|
2446
2454
|
};
|
|
2447
2455
|
/**
|
|
2448
2456
|
* Responses API options that can be passed to sendMessage
|
|
@@ -8221,6 +8229,8 @@ interface ResumeStreamOptions {
|
|
|
8221
8229
|
onFinish?: (response: ApiResponse) => void;
|
|
8222
8230
|
/** Called on a transient/unexpected failure. Never called for 410 (throws) nor interrupted terminals. */
|
|
8223
8231
|
onError?: (error: Error) => void;
|
|
8232
|
+
/** Tools a finished replay may end on because the device runs them when the answer is stored. */
|
|
8233
|
+
finishedToolNames?: string[];
|
|
8224
8234
|
}
|
|
8225
8235
|
/**
|
|
8226
8236
|
* Result of {@link resumeStream}. A `410 Gone` is the only outcome that throws
|
|
@@ -12054,7 +12064,7 @@ type UseChatResult = BaseUseChatResult & {
|
|
|
12054
12064
|
* the hook's `getToken`/`baseUrl`/`transport` defaults; the token is resolved
|
|
12055
12065
|
* at invocation so a refresh during the detach window is honored.
|
|
12056
12066
|
*/
|
|
12057
|
-
resumeStream: (handle: StreamResumeHandle, opts?: Pick<ResumeStreamOptions, "idleTimeoutMs" | "smoothing"> & {
|
|
12067
|
+
resumeStream: (handle: StreamResumeHandle, opts?: Pick<ResumeStreamOptions, "idleTimeoutMs" | "smoothing" | "finishedToolNames"> & {
|
|
12058
12068
|
/**
|
|
12059
12069
|
* Replay + reconcile + persist exactly as normal, but emit NOTHING to any
|
|
12060
12070
|
* consumer callback — `onData` / `onThinking` / `onFinish` / `onError` are
|
|
@@ -12216,6 +12226,11 @@ interface UseChatStorageOptions extends BaseUseChatStorageOptions {
|
|
|
12216
12226
|
}) => void;
|
|
12217
12227
|
/** The vault inbox that receives answers finished while no client was attached. */
|
|
12218
12228
|
inbox?: VaultInbox;
|
|
12229
|
+
/**
|
|
12230
|
+
* Device tools that can finish a turn the portal completed while the device was away: their
|
|
12231
|
+
* executors run when that answer is stored. Pass the display tools and the memory save tool.
|
|
12232
|
+
*/
|
|
12233
|
+
detachedTools?: ToolConfig[];
|
|
12219
12234
|
/**
|
|
12220
12235
|
* Observability hook fired once per send with the tools actually selected for
|
|
12221
12236
|
* the turn (after server + client filtering). Never throws into the send path.
|
package/dist/expo/index.d.ts
CHANGED
|
@@ -2373,7 +2373,13 @@ type StreamingTransport = (options: StreamingTransportOptions) => StreamingTrans
|
|
|
2373
2373
|
/**
|
|
2374
2374
|
* Tool executor function type
|
|
2375
2375
|
*/
|
|
2376
|
-
type ToolExecutor = (args: Record<string, unknown>, signal?: AbortSignal) => Promise<unknown> | unknown;
|
|
2376
|
+
type ToolExecutor = (args: Record<string, unknown>, signal?: AbortSignal, context?: ToolExecutionContext) => Promise<unknown> | unknown;
|
|
2377
|
+
/** How the portal treats a call to this device tool while the device is away. */
|
|
2378
|
+
type DetachedToolClass = "render" | "deferred";
|
|
2379
|
+
/** Context for one executor run; `detached` marks a call from an answer finished while the device was away. */
|
|
2380
|
+
type ToolExecutionContext = {
|
|
2381
|
+
detached?: boolean;
|
|
2382
|
+
};
|
|
2377
2383
|
/**
|
|
2378
2384
|
* Tool configuration with optional executor
|
|
2379
2385
|
*/
|
|
@@ -2443,6 +2449,8 @@ type ToolConfig = LlmapiChatCompletionTool & {
|
|
|
2443
2449
|
* files from IndexedDB that `create_file` writes.
|
|
2444
2450
|
*/
|
|
2445
2451
|
dependsOn?: string[];
|
|
2452
|
+
/** How the portal handles a call to this tool while the device is away; unset tools pause the turn. */
|
|
2453
|
+
detachedClass?: DetachedToolClass;
|
|
2446
2454
|
};
|
|
2447
2455
|
/**
|
|
2448
2456
|
* Responses API options that can be passed to sendMessage
|
|
@@ -8221,6 +8229,8 @@ interface ResumeStreamOptions {
|
|
|
8221
8229
|
onFinish?: (response: ApiResponse) => void;
|
|
8222
8230
|
/** Called on a transient/unexpected failure. Never called for 410 (throws) nor interrupted terminals. */
|
|
8223
8231
|
onError?: (error: Error) => void;
|
|
8232
|
+
/** Tools a finished replay may end on because the device runs them when the answer is stored. */
|
|
8233
|
+
finishedToolNames?: string[];
|
|
8224
8234
|
}
|
|
8225
8235
|
/**
|
|
8226
8236
|
* Result of {@link resumeStream}. A `410 Gone` is the only outcome that throws
|
|
@@ -12054,7 +12064,7 @@ type UseChatResult = BaseUseChatResult & {
|
|
|
12054
12064
|
* the hook's `getToken`/`baseUrl`/`transport` defaults; the token is resolved
|
|
12055
12065
|
* at invocation so a refresh during the detach window is honored.
|
|
12056
12066
|
*/
|
|
12057
|
-
resumeStream: (handle: StreamResumeHandle, opts?: Pick<ResumeStreamOptions, "idleTimeoutMs" | "smoothing"> & {
|
|
12067
|
+
resumeStream: (handle: StreamResumeHandle, opts?: Pick<ResumeStreamOptions, "idleTimeoutMs" | "smoothing" | "finishedToolNames"> & {
|
|
12058
12068
|
/**
|
|
12059
12069
|
* Replay + reconcile + persist exactly as normal, but emit NOTHING to any
|
|
12060
12070
|
* consumer callback — `onData` / `onThinking` / `onFinish` / `onError` are
|
|
@@ -12216,6 +12226,11 @@ interface UseChatStorageOptions extends BaseUseChatStorageOptions {
|
|
|
12216
12226
|
}) => void;
|
|
12217
12227
|
/** The vault inbox that receives answers finished while no client was attached. */
|
|
12218
12228
|
inbox?: VaultInbox;
|
|
12229
|
+
/**
|
|
12230
|
+
* Device tools that can finish a turn the portal completed while the device was away: their
|
|
12231
|
+
* executors run when that answer is stored. Pass the display tools and the memory save tool.
|
|
12232
|
+
*/
|
|
12233
|
+
detachedTools?: ToolConfig[];
|
|
12219
12234
|
/**
|
|
12220
12235
|
* Observability hook fired once per send with the tools actually selected for
|
|
12221
12236
|
* the turn (after server + client filtering). Never throws into the send path.
|