claudius-chat-widget 1.12.0 → 1.13.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/index.d.cts CHANGED
@@ -215,6 +215,8 @@ export declare class ChatApiClient {
215
215
  content: string;
216
216
  /** Sources cited by the assistant for this message, when any. */
217
217
  sources?: Source[];
218
+ /** Tools the assistant called while producing this message, when any. */
219
+ toolUses?: ToolUse[];
218
220
  }
219
221
 
220
222
  /**
@@ -233,6 +235,8 @@ export declare class ChatApiClient {
233
235
  reply: string;
234
236
  /** Sources the assistant cited, when any. */
235
237
  sources?: Source[];
238
+ /** Tools the assistant called while producing the reply, when any. */
239
+ toolUses?: ToolUse[];
236
240
  }
237
241
 
238
242
  /**
@@ -246,6 +250,11 @@ export declare class ChatApiClient {
246
250
  * @param fullText - The full reply accumulated so far, including this chunk.
247
251
  */
248
252
  onChunk?: (text: string, fullText: string) => void;
253
+ /**
254
+ * Called when the assistant finishes a tool call mid-stream, so the UI can
255
+ * show a "used tool" affordance before the reply completes.
256
+ */
257
+ onToolUse?: (toolUse: ToolUse, allToolUses: ToolUse[]) => void;
249
258
  /**
250
259
  * Cancels the stream when aborted. Cancellation is not an error: the
251
260
  * promise resolves with the partial reply and `aborted: true`.
@@ -460,6 +469,10 @@ export declare class ChatApiClient {
460
469
  sendMessage: string;
461
470
  /** Accessible label for the stop button shown while a reply streams in. */
462
471
  stopGenerating: string;
472
+ /** Label prefix for the "used tool" chip on assistant messages. */
473
+ toolUsed: string;
474
+ /** Accessible label for the tool-details disclosure toggle. */
475
+ toolDetails: string;
463
476
  /** Accessible label for the message input field. */
464
477
  typeYourMessage: string;
465
478
  /** Accessible label for the button that opens the chat. */
@@ -684,6 +697,21 @@ export declare class ChatApiClient {
684
697
  /** Names of the box-shadow tokens a theme can override. */
685
698
  export declare type ThemeShadowToken = (typeof THEME_SHADOW_TOKENS)[number];
686
699
 
700
+ /**
701
+ * One tool call the assistant made while producing a reply. Rendered as a
702
+ * compact "used tool" affordance with an optional details disclosure.
703
+ */
704
+ export declare interface ToolUse {
705
+ /** Tool name (e.g. `"get_current_time"`). */
706
+ name: string;
707
+ /** Input the model supplied to the tool. */
708
+ input?: Record<string, unknown>;
709
+ /** Serialized tool result, as the model saw it. */
710
+ result?: string;
711
+ /** Present when the tool call failed. */
712
+ isError?: boolean;
713
+ }
714
+
687
715
  /**
688
716
  * A proactive engagement rule. Each variant fires at most once per page on a
689
717
  * different signal: elapsed time, scroll depth, exit intent, or URL match.
package/dist/index.d.ts CHANGED
@@ -215,6 +215,8 @@ export declare class ChatApiClient {
215
215
  content: string;
216
216
  /** Sources cited by the assistant for this message, when any. */
217
217
  sources?: Source[];
218
+ /** Tools the assistant called while producing this message, when any. */
219
+ toolUses?: ToolUse[];
218
220
  }
219
221
 
220
222
  /**
@@ -233,6 +235,8 @@ export declare class ChatApiClient {
233
235
  reply: string;
234
236
  /** Sources the assistant cited, when any. */
235
237
  sources?: Source[];
238
+ /** Tools the assistant called while producing the reply, when any. */
239
+ toolUses?: ToolUse[];
236
240
  }
237
241
 
238
242
  /**
@@ -246,6 +250,11 @@ export declare class ChatApiClient {
246
250
  * @param fullText - The full reply accumulated so far, including this chunk.
247
251
  */
248
252
  onChunk?: (text: string, fullText: string) => void;
253
+ /**
254
+ * Called when the assistant finishes a tool call mid-stream, so the UI can
255
+ * show a "used tool" affordance before the reply completes.
256
+ */
257
+ onToolUse?: (toolUse: ToolUse, allToolUses: ToolUse[]) => void;
249
258
  /**
250
259
  * Cancels the stream when aborted. Cancellation is not an error: the
251
260
  * promise resolves with the partial reply and `aborted: true`.
@@ -460,6 +469,10 @@ export declare class ChatApiClient {
460
469
  sendMessage: string;
461
470
  /** Accessible label for the stop button shown while a reply streams in. */
462
471
  stopGenerating: string;
472
+ /** Label prefix for the "used tool" chip on assistant messages. */
473
+ toolUsed: string;
474
+ /** Accessible label for the tool-details disclosure toggle. */
475
+ toolDetails: string;
463
476
  /** Accessible label for the message input field. */
464
477
  typeYourMessage: string;
465
478
  /** Accessible label for the button that opens the chat. */
@@ -684,6 +697,21 @@ export declare class ChatApiClient {
684
697
  /** Names of the box-shadow tokens a theme can override. */
685
698
  export declare type ThemeShadowToken = (typeof THEME_SHADOW_TOKENS)[number];
686
699
 
700
+ /**
701
+ * One tool call the assistant made while producing a reply. Rendered as a
702
+ * compact "used tool" affordance with an optional details disclosure.
703
+ */
704
+ export declare interface ToolUse {
705
+ /** Tool name (e.g. `"get_current_time"`). */
706
+ name: string;
707
+ /** Input the model supplied to the tool. */
708
+ input?: Record<string, unknown>;
709
+ /** Serialized tool result, as the model saw it. */
710
+ result?: string;
711
+ /** Present when the tool call failed. */
712
+ isError?: boolean;
713
+ }
714
+
687
715
  /**
688
716
  * A proactive engagement rule. Each variant fires at most once per page on a
689
717
  * different signal: elapsed time, scroll depth, exit intent, or URL match.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claudius-chat-widget",
3
- "version": "1.12.0",
3
+ "version": "1.13.0",
4
4
  "type": "module",
5
5
  "description": "Embeddable AI chat widget powered by Claude. Drop-in React component or standalone script embed, backed by a Cloudflare Worker.",
6
6
  "keywords": [