@useago/sdk 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.
Files changed (48) hide show
  1. package/CHANGELOG.md +71 -4
  2. package/README.md +73 -0
  3. package/dist/angular.cjs +1 -1
  4. package/dist/angular.d.cts +97 -28
  5. package/dist/angular.d.ts +97 -28
  6. package/dist/angular.js +4 -1
  7. package/dist/{createConversationSession-B1Qn-y0I.js → createConversationSession-BfJg0WyA.js} +1 -1
  8. package/dist/{createConversationSession-B3v_xOU7.cjs → createConversationSession-CiOXKWl0.cjs} +1 -1
  9. package/dist/{createFormCollector-m79zk_NA.js → createFormCollector-DN1xjAv5.js} +1 -1
  10. package/dist/{createFormCollector-FvwDOqnV.cjs → createFormCollector-DnQl77Ko.cjs} +1 -1
  11. package/dist/createMockClient-BPt1gSve.cjs +1 -0
  12. package/dist/{createMockClient-Beao82tu.js → createMockClient-YoYr3pQr.js} +1 -0
  13. package/dist/devtools.cjs +4 -4
  14. package/dist/devtools.d.cts +95 -28
  15. package/dist/devtools.d.ts +95 -28
  16. package/dist/devtools.js +87 -84
  17. package/dist/helpers.d.cts +42 -12
  18. package/dist/helpers.d.ts +42 -12
  19. package/dist/index.cjs +1 -1
  20. package/dist/index.d.cts +101 -35
  21. package/dist/index.d.ts +101 -35
  22. package/dist/index.js +44 -43
  23. package/dist/react.cjs +4 -4
  24. package/dist/react.d.cts +147 -28
  25. package/dist/react.d.ts +147 -28
  26. package/dist/react.js +814 -727
  27. package/dist/speechToText-BV7qxqPF.js +704 -0
  28. package/dist/speechToText-ZciRyyJE.cjs +1 -0
  29. package/dist/testing.cjs +1 -1
  30. package/dist/testing.d.cts +95 -28
  31. package/dist/testing.d.ts +95 -28
  32. package/dist/testing.js +1 -1
  33. package/dist/{types-Ct1hlKwg.js → types-Q7t1peH-.js} +595 -419
  34. package/dist/types-a7teDBnC.cjs +10 -0
  35. package/dist/vue.cjs +1 -1
  36. package/dist/vue.d.cts +105 -28
  37. package/dist/vue.d.ts +105 -28
  38. package/dist/vue.js +103 -101
  39. package/dist/widget.cjs +6 -6
  40. package/dist/widget.d.cts +127 -28
  41. package/dist/widget.d.ts +127 -28
  42. package/dist/widget.js +1717 -1772
  43. package/llms-full.txt +129 -1
  44. package/package.json +1 -1
  45. package/dist/createMockClient-BEOXI8yW.cjs +0 -1
  46. package/dist/sheetController-BThJRtOu.cjs +0 -1
  47. package/dist/sheetController-aEKXIvjk.js +0 -343
  48. package/dist/types-mcW8vB1U.cjs +0 -10
package/dist/react.d.cts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { default as default_2 } from 'react';
2
2
  import { ForwardRefExoticComponent } from 'react';
3
+ import { JSX as JSX_2 } from 'react/jsx-runtime';
3
4
  import { RefAttributes } from 'react';
4
5
 
5
6
  export declare interface ActivityEntry {
@@ -149,7 +150,10 @@ declare class AgoClient {
149
150
  * `null` otherwise.
150
151
  */
151
152
  proactive: ProactiveController | null;
153
+ /** Removes the mirrored WebMCP tools; `null` when the bridge is off. */
154
+ private detachWebMCP;
152
155
  constructor(config: AgoConfig);
156
+ private attachWebMCPBridge;
153
157
  /**
154
158
  * Send a message and receive a streaming response
155
159
  */
@@ -261,6 +265,7 @@ declare class AgoClient {
261
265
  * (the agent decides what to do next). No-op if the invocation is unknown.
262
266
  */
263
267
  rejectFunction(invocationId: string): Promise<void>;
268
+ /* Excluded from this release type: runExternalFunction */
264
269
  /**
265
270
  * Get a page of conversations, newest-first. `pageSize` is capped at 100 by
266
271
  * the backend (default 50). Returns the `{ data, has_more, total }` envelope
@@ -280,11 +285,20 @@ declare class AgoClient {
280
285
  * `SSEHandler.parseToolCall` so persisted and streamed tool calls match.
281
286
  */
282
287
  private static mapPersistedToolCalls;
288
+ /**
289
+ * Transcribe an audio file into editable text (`POST /api/sdk/v1/audio/transcriptions`).
290
+ * Requires speech to text to be enabled for the tenant. Supports FLAC, MP3,
291
+ * MP4, MPEG, MPGA, M4A, OGG, WAV and WebM files up to 25 MB.
292
+ * The filename must include the matching extension. For a MediaRecorder blob,
293
+ * wrap it in a File with the recording's extension and MIME type.
294
+ * Show the returned text as a draft; call `sendMessage` when the user sends it.
295
+ */
296
+ transcribeAudio(file: File, options?: TranscribeAudioOptions): Promise<AudioTranscription>;
283
297
  /**
284
298
  * The tenant's SDK configuration (`GET /api/sdk/v1/config`): per-permission
285
299
  * agents, the ticket form the agent's `ago_ticketing` tool opens, and the
286
- * file-attachment flag. The vanilla widget fetches it once, when a ticket
287
- * form first appears in a conversation.
300
+ * file-attachment and speech-to-text flags. The vanilla widget fetches it
301
+ * once, when a ticket form first appears in a conversation.
288
302
  */
289
303
  getConfig(): Promise<SdkConfig>;
290
304
  /**
@@ -421,6 +435,9 @@ declare class AgoClient {
421
435
  * Get all registered function schemas
422
436
  */
423
437
  getRegisteredFunctions(): ClientFunctionSchema[];
438
+ /** The callback form of `functions:changed`. Returns an unsubscribe. */
439
+ onFunctionsChanged(listener: () => void): () => void;
440
+ /* Excluded from this release type: getFunctionRegistrations */
424
441
  /**
425
442
  * Execute a registered client function locally, through the same
426
443
  * FunctionRegistry path (result-size guard, error wrapping) as agent-invoked
@@ -753,6 +770,8 @@ declare interface AgoClientEvents {
753
770
  * call running immediately.
754
771
  */
755
772
  "function:awaiting-approval": ClientFunctionInvocation;
773
+ /** A function was registered or unregistered, or the registry cleared. */
774
+ "functions:changed": ClientFunctionSchema[];
756
775
  "function:result": {
757
776
  invocationId: string;
758
777
  result: unknown;
@@ -825,6 +844,8 @@ export declare interface AgoConfig {
825
844
  defaultAgentId?: string;
826
845
  /** Permission name to apply to all requests (sent as `X-Widget-Permission`). Mirrors the widget's `window.AGO.permission`. */
827
846
  permission?: string;
847
+ /** Interface locale selected by the host app, sent as Accept-Language. Null clears the override. */
848
+ language?: string | null;
828
849
  /** User email for identification */
829
850
  userEmail?: string;
830
851
  /** JWT token for authenticated users */
@@ -902,6 +923,15 @@ export declare interface AgoConfig {
902
923
  * mode's `jsErrors` signal. See `client.reportError()` for caught errors.
903
924
  */
904
925
  errorWatcher?: boolean | ErrorWatcherOptions;
926
+ /** Mirror every registered client function into the browser's WebMCP registry
927
+ * (`document.modelContext`), so an external agent can call the same functions
928
+ * the in-app agent calls. Off by default; no-ops without WebMCP.
929
+ *
930
+ * A mirrored function runs immediately: the approval gate
931
+ * ({@link approvalPolicy}, `requiresApproval`) covers the agent loop only.
932
+ * Use `webmcp: false` on a definition to keep it out.
933
+ */
934
+ webmcp?: boolean;
905
935
  }
906
936
 
907
937
  /**
@@ -1170,6 +1200,11 @@ declare type AgoStateSetResult = {
1170
1200
  result: "unchanged";
1171
1201
  };
1172
1202
 
1203
+ /** Editable text returned by `AgoClient.transcribeAudio`. */
1204
+ declare interface AudioTranscription {
1205
+ text: string;
1206
+ }
1207
+
1173
1208
  /** One JavaScript error captured on the page (deduplicated, see `count`). */
1174
1209
  declare interface CapturedError {
1175
1210
  type: CapturedErrorType;
@@ -1217,6 +1252,12 @@ export declare interface ChatInputProps {
1217
1252
  disabled?: boolean;
1218
1253
  placeholder?: string;
1219
1254
  allowFiles?: boolean;
1255
+ /** Microphone, live waveform and draft transcription. Uses the tenant flag. */
1256
+ speechToText?: boolean | SpeechToTextOptions;
1257
+ /** For dictation; otherwise uses AgoProvider's client. */
1258
+ client?: AgoClient;
1259
+ /** Cancels dictation when the conversation or page changes. */
1260
+ scopeKey?: string;
1220
1261
  className?: string;
1221
1262
  }
1222
1263
 
@@ -1255,6 +1296,8 @@ export declare interface ChatWidgetProps {
1255
1296
  placeholder?: string;
1256
1297
  /** Enable file attachments */
1257
1298
  allowFiles?: boolean;
1299
+ /** Microphone, live waveform and draft transcription. Checks the tenant flag. */
1300
+ speechToText?: boolean | SpeechToTextOptions;
1258
1301
  /**
1259
1302
  * While the agent is answering, turn the send button into a Stop button that
1260
1303
  * interrupts the turn. Defaults to `true`.
@@ -1352,22 +1395,11 @@ export declare interface ChatWidgetProps {
1352
1395
  * client.registerFunction(fn);
1353
1396
  * ```
1354
1397
  */
1355
- declare interface ClientFunctionDefinition {
1398
+ declare interface ClientFunctionDefinition extends ClientFunctionSettings {
1356
1399
  name: string;
1357
1400
  description: string;
1358
1401
  parameters: ClientFunctionSchema["parameters"];
1359
1402
  handler: ClientFunctionHandler;
1360
- /**
1361
- * Max serialized result size in bytes before the SDK truncates it to a
1362
- * flagged preview (default: `AgoConfig.maxFunctionResultBytes`, 50 000).
1363
- * `Infinity` disables the guard for this function.
1364
- */
1365
- maxResultBytes?: number;
1366
- /**
1367
- * Require explicit user approval before this function runs. See
1368
- * {@link AgoConfig.approvalPolicy} — pause mode only. ORs with the policy.
1369
- */
1370
- requiresApproval?: boolean;
1371
1403
  }
1372
1404
 
1373
1405
  /**
@@ -1386,20 +1418,7 @@ declare interface ClientFunctionInvocation {
1386
1418
  * Schema-plus-settings object accepted when registering a function: the schema
1387
1419
  * (minus `name`) and SDK-side options that are NOT sent to the backend.
1388
1420
  */
1389
- declare type ClientFunctionRegisterOptions = Omit<ClientFunctionSchema, "name"> & {
1390
- /**
1391
- * Max serialized result size in bytes before the SDK truncates it to a
1392
- * flagged preview. Overrides the client-level default
1393
- * (`AgoConfig.maxFunctionResultBytes`, 50 000 by default). `Infinity`
1394
- * disables the guard for this function.
1395
- */
1396
- maxResultBytes?: number;
1397
- /**
1398
- * Require explicit user approval before this function runs. See
1399
- * {@link AgoConfig.approvalPolicy} — pause mode only. ORs with the policy.
1400
- */
1401
- requiresApproval?: boolean;
1402
- };
1421
+ declare type ClientFunctionRegisterOptions = Omit<ClientFunctionSchema, "name"> & ClientFunctionSettings;
1403
1422
 
1404
1423
  /**
1405
1424
  * Schema for a client-side function that AGO can call
@@ -1426,6 +1445,28 @@ declare interface ClientFunctionSchema {
1426
1445
  };
1427
1446
  }
1428
1447
 
1448
+ /** SDK-side function settings that are never sent to the backend. */
1449
+ declare interface ClientFunctionSettings {
1450
+ /**
1451
+ * Max serialized result size in bytes before the SDK truncates it to a
1452
+ * flagged preview. Overrides the client-level default
1453
+ * (`AgoConfig.maxFunctionResultBytes`, 50 000 by default). `Infinity`
1454
+ * disables the guard for this function.
1455
+ */
1456
+ maxResultBytes?: number;
1457
+ /**
1458
+ * Require explicit user approval before this function runs. See
1459
+ * {@link AgoConfig.approvalPolicy} — pause mode only. ORs with the policy.
1460
+ */
1461
+ requiresApproval?: boolean;
1462
+ /**
1463
+ * WebMCP metadata, read only when the bridge is on (`AgoConfig.webmcp`).
1464
+ * `false` keeps this function out of WebMCP while leaving it available to the
1465
+ * in-app agent.
1466
+ */
1467
+ webmcp?: WebMCPToolMeta | false;
1468
+ }
1469
+
1429
1470
  /** See {@link AgoConfig.clientFunctionsMode}. */
1430
1471
  declare type ClientFunctionsMode = "placeholder" | "pause";
1431
1472
 
@@ -1556,6 +1597,8 @@ declare interface CreateTicketResult {
1556
1597
 
1557
1598
  export declare const DEFAULT_MESSAGE_FEEDBACK_LABELS: MessageFeedbackLabels;
1558
1599
 
1600
+ export declare const DEFAULT_SPEECH_TO_TEXT_LABELS: SpeechToTextLabels;
1601
+
1559
1602
  /**
1560
1603
  * Compute which required fields are still empty and whether the form is complete.
1561
1604
  * Pure — the single home for the "required + non-empty" rule, shared by the update
@@ -2199,6 +2242,14 @@ declare interface ProactiveTriggerWhen {
2199
2242
  fieldErrors?: Record<string, number>;
2200
2243
  }
2201
2244
 
2245
+ /**
2246
+ * Registered function with handler
2247
+ */
2248
+ declare interface RegisteredFunction extends ClientFunctionSettings {
2249
+ schema: ClientFunctionSchema;
2250
+ handler: ClientFunctionHandler;
2251
+ }
2252
+
2202
2253
  /**
2203
2254
  * Hook run before a paused turn is resumed, so the app controls WHEN the
2204
2255
  * continuation fires (e.g. wait for the destination page to mount after a
@@ -2255,6 +2306,8 @@ declare interface SdkPermissionConfig {
2255
2306
  homePage?: SdkHomePageConfig;
2256
2307
  fileAttachmentsEnabled: boolean;
2257
2308
  voiceEnabled: boolean;
2309
+ /** Whether audio uploads can be transcribed. Defaults to false on older backends. */
2310
+ speechToTextEnabled: boolean;
2258
2311
  }
2259
2312
 
2260
2313
  /**
@@ -2411,6 +2464,42 @@ declare interface SignalsSnapshot {
2411
2464
  pageState: Record<string, unknown> | null;
2412
2465
  }
2413
2466
 
2467
+ /** Ready-made microphone, live waveform, cancel/confirm controls and transcription. */
2468
+ export declare function SpeechToTextButton(props: SpeechToTextButtonProps): JSX_2.Element;
2469
+
2470
+ export declare interface SpeechToTextButtonProps {
2471
+ /** Uses AgoProvider's client when omitted. */
2472
+ client?: AgoClient;
2473
+ onTranscript: (text: string) => void;
2474
+ /** Use this to hide or disable your editor while dictation is active. */
2475
+ onBusyChange?: (busy: boolean) => void;
2476
+ disabled?: boolean;
2477
+ /** Cancels dictation when the conversation or page changes. */
2478
+ scopeKey?: string;
2479
+ labels?: Partial<SpeechToTextLabels>;
2480
+ className?: string;
2481
+ }
2482
+
2483
+ /** Strings used by the microphone control in every widget. */
2484
+ export declare interface SpeechToTextLabels {
2485
+ start: string;
2486
+ finish: string;
2487
+ cancel: string;
2488
+ requesting: string;
2489
+ recording: string;
2490
+ transcribing: string;
2491
+ limitApproaching: string;
2492
+ permissionDenied: string;
2493
+ recordingFailed: string;
2494
+ tooLarge: string;
2495
+ noSpeech: string;
2496
+ transcriptionFailed: string;
2497
+ }
2498
+
2499
+ export declare interface SpeechToTextOptions {
2500
+ labels?: Partial<SpeechToTextLabels>;
2501
+ }
2502
+
2414
2503
  /**
2415
2504
  * SSE stream chunk data
2416
2505
  */
@@ -2655,6 +2744,12 @@ declare interface ToolCallTicketPrefill {
2655
2744
 
2656
2745
  declare type ToolCallType = "form" | "confirmation_input" | "status_message" | "progress_indicator" | "client_function" | "reasoning" | "mcp_ui_resource";
2657
2746
 
2747
+ /** Options for `AgoClient.transcribeAudio`. */
2748
+ declare interface TranscribeAudioOptions {
2749
+ /** Cancel the upload or stop waiting for its transcription. */
2750
+ signal?: AbortSignal;
2751
+ }
2752
+
2658
2753
  /**
2659
2754
  * Hook to create and manage an AgoClient instance
2660
2755
  *
@@ -2854,6 +2949,11 @@ export declare interface UseAgoFunctionOptions {
2854
2949
  * See `AgoConfig.approvalPolicy`.
2855
2950
  */
2856
2951
  requiresApproval?: boolean;
2952
+ /**
2953
+ * WebMCP metadata, read only when the bridge is on (`AgoConfig.webmcp`).
2954
+ * `false` keeps this function out of WebMCP.
2955
+ */
2956
+ webmcp?: WebMCPToolMeta | false;
2857
2957
  }
2858
2958
 
2859
2959
  /**
@@ -3191,4 +3291,23 @@ export declare interface UseSheetResult {
3191
3291
  toggle: (cause?: SheetChangeCause) => void;
3192
3292
  }
3193
3293
 
3294
+ /** The MCP behavior hints AGO has no equivalent for. */
3295
+ declare interface WebMCPToolMeta {
3296
+ /**
3297
+ * Both default to `false`, so only set what is true: `readOnlyHint` marks a
3298
+ * function that changes nothing, `untrustedContentHint` one whose result may
3299
+ * carry third-party text.
3300
+ */
3301
+ annotations?: {
3302
+ readOnlyHint?: boolean;
3303
+ untrustedContentHint?: boolean;
3304
+ };
3305
+ /**
3306
+ * This function navigates. The WebMCP call is held open until the function
3307
+ * registry goes quiet, so the caller sees the destination page's tools rather
3308
+ * than the departing page's. Already set on the built-in `navigateToPage`.
3309
+ */
3310
+ navigates?: boolean;
3311
+ }
3312
+
3194
3313
  export { }
package/dist/react.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { default as default_2 } from 'react';
2
2
  import { ForwardRefExoticComponent } from 'react';
3
+ import { JSX as JSX_2 } from 'react/jsx-runtime';
3
4
  import { RefAttributes } from 'react';
4
5
 
5
6
  export declare interface ActivityEntry {
@@ -149,7 +150,10 @@ declare class AgoClient {
149
150
  * `null` otherwise.
150
151
  */
151
152
  proactive: ProactiveController | null;
153
+ /** Removes the mirrored WebMCP tools; `null` when the bridge is off. */
154
+ private detachWebMCP;
152
155
  constructor(config: AgoConfig);
156
+ private attachWebMCPBridge;
153
157
  /**
154
158
  * Send a message and receive a streaming response
155
159
  */
@@ -261,6 +265,7 @@ declare class AgoClient {
261
265
  * (the agent decides what to do next). No-op if the invocation is unknown.
262
266
  */
263
267
  rejectFunction(invocationId: string): Promise<void>;
268
+ /* Excluded from this release type: runExternalFunction */
264
269
  /**
265
270
  * Get a page of conversations, newest-first. `pageSize` is capped at 100 by
266
271
  * the backend (default 50). Returns the `{ data, has_more, total }` envelope
@@ -280,11 +285,20 @@ declare class AgoClient {
280
285
  * `SSEHandler.parseToolCall` so persisted and streamed tool calls match.
281
286
  */
282
287
  private static mapPersistedToolCalls;
288
+ /**
289
+ * Transcribe an audio file into editable text (`POST /api/sdk/v1/audio/transcriptions`).
290
+ * Requires speech to text to be enabled for the tenant. Supports FLAC, MP3,
291
+ * MP4, MPEG, MPGA, M4A, OGG, WAV and WebM files up to 25 MB.
292
+ * The filename must include the matching extension. For a MediaRecorder blob,
293
+ * wrap it in a File with the recording's extension and MIME type.
294
+ * Show the returned text as a draft; call `sendMessage` when the user sends it.
295
+ */
296
+ transcribeAudio(file: File, options?: TranscribeAudioOptions): Promise<AudioTranscription>;
283
297
  /**
284
298
  * The tenant's SDK configuration (`GET /api/sdk/v1/config`): per-permission
285
299
  * agents, the ticket form the agent's `ago_ticketing` tool opens, and the
286
- * file-attachment flag. The vanilla widget fetches it once, when a ticket
287
- * form first appears in a conversation.
300
+ * file-attachment and speech-to-text flags. The vanilla widget fetches it
301
+ * once, when a ticket form first appears in a conversation.
288
302
  */
289
303
  getConfig(): Promise<SdkConfig>;
290
304
  /**
@@ -421,6 +435,9 @@ declare class AgoClient {
421
435
  * Get all registered function schemas
422
436
  */
423
437
  getRegisteredFunctions(): ClientFunctionSchema[];
438
+ /** The callback form of `functions:changed`. Returns an unsubscribe. */
439
+ onFunctionsChanged(listener: () => void): () => void;
440
+ /* Excluded from this release type: getFunctionRegistrations */
424
441
  /**
425
442
  * Execute a registered client function locally, through the same
426
443
  * FunctionRegistry path (result-size guard, error wrapping) as agent-invoked
@@ -753,6 +770,8 @@ declare interface AgoClientEvents {
753
770
  * call running immediately.
754
771
  */
755
772
  "function:awaiting-approval": ClientFunctionInvocation;
773
+ /** A function was registered or unregistered, or the registry cleared. */
774
+ "functions:changed": ClientFunctionSchema[];
756
775
  "function:result": {
757
776
  invocationId: string;
758
777
  result: unknown;
@@ -825,6 +844,8 @@ export declare interface AgoConfig {
825
844
  defaultAgentId?: string;
826
845
  /** Permission name to apply to all requests (sent as `X-Widget-Permission`). Mirrors the widget's `window.AGO.permission`. */
827
846
  permission?: string;
847
+ /** Interface locale selected by the host app, sent as Accept-Language. Null clears the override. */
848
+ language?: string | null;
828
849
  /** User email for identification */
829
850
  userEmail?: string;
830
851
  /** JWT token for authenticated users */
@@ -902,6 +923,15 @@ export declare interface AgoConfig {
902
923
  * mode's `jsErrors` signal. See `client.reportError()` for caught errors.
903
924
  */
904
925
  errorWatcher?: boolean | ErrorWatcherOptions;
926
+ /** Mirror every registered client function into the browser's WebMCP registry
927
+ * (`document.modelContext`), so an external agent can call the same functions
928
+ * the in-app agent calls. Off by default; no-ops without WebMCP.
929
+ *
930
+ * A mirrored function runs immediately: the approval gate
931
+ * ({@link approvalPolicy}, `requiresApproval`) covers the agent loop only.
932
+ * Use `webmcp: false` on a definition to keep it out.
933
+ */
934
+ webmcp?: boolean;
905
935
  }
906
936
 
907
937
  /**
@@ -1170,6 +1200,11 @@ declare type AgoStateSetResult = {
1170
1200
  result: "unchanged";
1171
1201
  };
1172
1202
 
1203
+ /** Editable text returned by `AgoClient.transcribeAudio`. */
1204
+ declare interface AudioTranscription {
1205
+ text: string;
1206
+ }
1207
+
1173
1208
  /** One JavaScript error captured on the page (deduplicated, see `count`). */
1174
1209
  declare interface CapturedError {
1175
1210
  type: CapturedErrorType;
@@ -1217,6 +1252,12 @@ export declare interface ChatInputProps {
1217
1252
  disabled?: boolean;
1218
1253
  placeholder?: string;
1219
1254
  allowFiles?: boolean;
1255
+ /** Microphone, live waveform and draft transcription. Uses the tenant flag. */
1256
+ speechToText?: boolean | SpeechToTextOptions;
1257
+ /** For dictation; otherwise uses AgoProvider's client. */
1258
+ client?: AgoClient;
1259
+ /** Cancels dictation when the conversation or page changes. */
1260
+ scopeKey?: string;
1220
1261
  className?: string;
1221
1262
  }
1222
1263
 
@@ -1255,6 +1296,8 @@ export declare interface ChatWidgetProps {
1255
1296
  placeholder?: string;
1256
1297
  /** Enable file attachments */
1257
1298
  allowFiles?: boolean;
1299
+ /** Microphone, live waveform and draft transcription. Checks the tenant flag. */
1300
+ speechToText?: boolean | SpeechToTextOptions;
1258
1301
  /**
1259
1302
  * While the agent is answering, turn the send button into a Stop button that
1260
1303
  * interrupts the turn. Defaults to `true`.
@@ -1352,22 +1395,11 @@ export declare interface ChatWidgetProps {
1352
1395
  * client.registerFunction(fn);
1353
1396
  * ```
1354
1397
  */
1355
- declare interface ClientFunctionDefinition {
1398
+ declare interface ClientFunctionDefinition extends ClientFunctionSettings {
1356
1399
  name: string;
1357
1400
  description: string;
1358
1401
  parameters: ClientFunctionSchema["parameters"];
1359
1402
  handler: ClientFunctionHandler;
1360
- /**
1361
- * Max serialized result size in bytes before the SDK truncates it to a
1362
- * flagged preview (default: `AgoConfig.maxFunctionResultBytes`, 50 000).
1363
- * `Infinity` disables the guard for this function.
1364
- */
1365
- maxResultBytes?: number;
1366
- /**
1367
- * Require explicit user approval before this function runs. See
1368
- * {@link AgoConfig.approvalPolicy} — pause mode only. ORs with the policy.
1369
- */
1370
- requiresApproval?: boolean;
1371
1403
  }
1372
1404
 
1373
1405
  /**
@@ -1386,20 +1418,7 @@ declare interface ClientFunctionInvocation {
1386
1418
  * Schema-plus-settings object accepted when registering a function: the schema
1387
1419
  * (minus `name`) and SDK-side options that are NOT sent to the backend.
1388
1420
  */
1389
- declare type ClientFunctionRegisterOptions = Omit<ClientFunctionSchema, "name"> & {
1390
- /**
1391
- * Max serialized result size in bytes before the SDK truncates it to a
1392
- * flagged preview. Overrides the client-level default
1393
- * (`AgoConfig.maxFunctionResultBytes`, 50 000 by default). `Infinity`
1394
- * disables the guard for this function.
1395
- */
1396
- maxResultBytes?: number;
1397
- /**
1398
- * Require explicit user approval before this function runs. See
1399
- * {@link AgoConfig.approvalPolicy} — pause mode only. ORs with the policy.
1400
- */
1401
- requiresApproval?: boolean;
1402
- };
1421
+ declare type ClientFunctionRegisterOptions = Omit<ClientFunctionSchema, "name"> & ClientFunctionSettings;
1403
1422
 
1404
1423
  /**
1405
1424
  * Schema for a client-side function that AGO can call
@@ -1426,6 +1445,28 @@ declare interface ClientFunctionSchema {
1426
1445
  };
1427
1446
  }
1428
1447
 
1448
+ /** SDK-side function settings that are never sent to the backend. */
1449
+ declare interface ClientFunctionSettings {
1450
+ /**
1451
+ * Max serialized result size in bytes before the SDK truncates it to a
1452
+ * flagged preview. Overrides the client-level default
1453
+ * (`AgoConfig.maxFunctionResultBytes`, 50 000 by default). `Infinity`
1454
+ * disables the guard for this function.
1455
+ */
1456
+ maxResultBytes?: number;
1457
+ /**
1458
+ * Require explicit user approval before this function runs. See
1459
+ * {@link AgoConfig.approvalPolicy} — pause mode only. ORs with the policy.
1460
+ */
1461
+ requiresApproval?: boolean;
1462
+ /**
1463
+ * WebMCP metadata, read only when the bridge is on (`AgoConfig.webmcp`).
1464
+ * `false` keeps this function out of WebMCP while leaving it available to the
1465
+ * in-app agent.
1466
+ */
1467
+ webmcp?: WebMCPToolMeta | false;
1468
+ }
1469
+
1429
1470
  /** See {@link AgoConfig.clientFunctionsMode}. */
1430
1471
  declare type ClientFunctionsMode = "placeholder" | "pause";
1431
1472
 
@@ -1556,6 +1597,8 @@ declare interface CreateTicketResult {
1556
1597
 
1557
1598
  export declare const DEFAULT_MESSAGE_FEEDBACK_LABELS: MessageFeedbackLabels;
1558
1599
 
1600
+ export declare const DEFAULT_SPEECH_TO_TEXT_LABELS: SpeechToTextLabels;
1601
+
1559
1602
  /**
1560
1603
  * Compute which required fields are still empty and whether the form is complete.
1561
1604
  * Pure — the single home for the "required + non-empty" rule, shared by the update
@@ -2199,6 +2242,14 @@ declare interface ProactiveTriggerWhen {
2199
2242
  fieldErrors?: Record<string, number>;
2200
2243
  }
2201
2244
 
2245
+ /**
2246
+ * Registered function with handler
2247
+ */
2248
+ declare interface RegisteredFunction extends ClientFunctionSettings {
2249
+ schema: ClientFunctionSchema;
2250
+ handler: ClientFunctionHandler;
2251
+ }
2252
+
2202
2253
  /**
2203
2254
  * Hook run before a paused turn is resumed, so the app controls WHEN the
2204
2255
  * continuation fires (e.g. wait for the destination page to mount after a
@@ -2255,6 +2306,8 @@ declare interface SdkPermissionConfig {
2255
2306
  homePage?: SdkHomePageConfig;
2256
2307
  fileAttachmentsEnabled: boolean;
2257
2308
  voiceEnabled: boolean;
2309
+ /** Whether audio uploads can be transcribed. Defaults to false on older backends. */
2310
+ speechToTextEnabled: boolean;
2258
2311
  }
2259
2312
 
2260
2313
  /**
@@ -2411,6 +2464,42 @@ declare interface SignalsSnapshot {
2411
2464
  pageState: Record<string, unknown> | null;
2412
2465
  }
2413
2466
 
2467
+ /** Ready-made microphone, live waveform, cancel/confirm controls and transcription. */
2468
+ export declare function SpeechToTextButton(props: SpeechToTextButtonProps): JSX_2.Element;
2469
+
2470
+ export declare interface SpeechToTextButtonProps {
2471
+ /** Uses AgoProvider's client when omitted. */
2472
+ client?: AgoClient;
2473
+ onTranscript: (text: string) => void;
2474
+ /** Use this to hide or disable your editor while dictation is active. */
2475
+ onBusyChange?: (busy: boolean) => void;
2476
+ disabled?: boolean;
2477
+ /** Cancels dictation when the conversation or page changes. */
2478
+ scopeKey?: string;
2479
+ labels?: Partial<SpeechToTextLabels>;
2480
+ className?: string;
2481
+ }
2482
+
2483
+ /** Strings used by the microphone control in every widget. */
2484
+ export declare interface SpeechToTextLabels {
2485
+ start: string;
2486
+ finish: string;
2487
+ cancel: string;
2488
+ requesting: string;
2489
+ recording: string;
2490
+ transcribing: string;
2491
+ limitApproaching: string;
2492
+ permissionDenied: string;
2493
+ recordingFailed: string;
2494
+ tooLarge: string;
2495
+ noSpeech: string;
2496
+ transcriptionFailed: string;
2497
+ }
2498
+
2499
+ export declare interface SpeechToTextOptions {
2500
+ labels?: Partial<SpeechToTextLabels>;
2501
+ }
2502
+
2414
2503
  /**
2415
2504
  * SSE stream chunk data
2416
2505
  */
@@ -2655,6 +2744,12 @@ declare interface ToolCallTicketPrefill {
2655
2744
 
2656
2745
  declare type ToolCallType = "form" | "confirmation_input" | "status_message" | "progress_indicator" | "client_function" | "reasoning" | "mcp_ui_resource";
2657
2746
 
2747
+ /** Options for `AgoClient.transcribeAudio`. */
2748
+ declare interface TranscribeAudioOptions {
2749
+ /** Cancel the upload or stop waiting for its transcription. */
2750
+ signal?: AbortSignal;
2751
+ }
2752
+
2658
2753
  /**
2659
2754
  * Hook to create and manage an AgoClient instance
2660
2755
  *
@@ -2854,6 +2949,11 @@ export declare interface UseAgoFunctionOptions {
2854
2949
  * See `AgoConfig.approvalPolicy`.
2855
2950
  */
2856
2951
  requiresApproval?: boolean;
2952
+ /**
2953
+ * WebMCP metadata, read only when the bridge is on (`AgoConfig.webmcp`).
2954
+ * `false` keeps this function out of WebMCP.
2955
+ */
2956
+ webmcp?: WebMCPToolMeta | false;
2857
2957
  }
2858
2958
 
2859
2959
  /**
@@ -3191,4 +3291,23 @@ export declare interface UseSheetResult {
3191
3291
  toggle: (cause?: SheetChangeCause) => void;
3192
3292
  }
3193
3293
 
3294
+ /** The MCP behavior hints AGO has no equivalent for. */
3295
+ declare interface WebMCPToolMeta {
3296
+ /**
3297
+ * Both default to `false`, so only set what is true: `readOnlyHint` marks a
3298
+ * function that changes nothing, `untrustedContentHint` one whose result may
3299
+ * carry third-party text.
3300
+ */
3301
+ annotations?: {
3302
+ readOnlyHint?: boolean;
3303
+ untrustedContentHint?: boolean;
3304
+ };
3305
+ /**
3306
+ * This function navigates. The WebMCP call is held open until the function
3307
+ * registry goes quiet, so the caller sees the destination page's tools rather
3308
+ * than the departing page's. Already set on the built-in `navigateToPage`.
3309
+ */
3310
+ navigates?: boolean;
3311
+ }
3312
+
3194
3313
  export { }