@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.
- package/CHANGELOG.md +71 -4
- package/README.md +73 -0
- package/dist/angular.cjs +1 -1
- package/dist/angular.d.cts +97 -28
- package/dist/angular.d.ts +97 -28
- package/dist/angular.js +4 -1
- package/dist/{createConversationSession-B1Qn-y0I.js → createConversationSession-BfJg0WyA.js} +1 -1
- package/dist/{createConversationSession-B3v_xOU7.cjs → createConversationSession-CiOXKWl0.cjs} +1 -1
- package/dist/{createFormCollector-m79zk_NA.js → createFormCollector-DN1xjAv5.js} +1 -1
- package/dist/{createFormCollector-FvwDOqnV.cjs → createFormCollector-DnQl77Ko.cjs} +1 -1
- package/dist/createMockClient-BPt1gSve.cjs +1 -0
- package/dist/{createMockClient-Beao82tu.js → createMockClient-YoYr3pQr.js} +1 -0
- package/dist/devtools.cjs +4 -4
- package/dist/devtools.d.cts +95 -28
- package/dist/devtools.d.ts +95 -28
- package/dist/devtools.js +87 -84
- package/dist/helpers.d.cts +42 -12
- package/dist/helpers.d.ts +42 -12
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +101 -35
- package/dist/index.d.ts +101 -35
- package/dist/index.js +44 -43
- package/dist/react.cjs +4 -4
- package/dist/react.d.cts +147 -28
- package/dist/react.d.ts +147 -28
- package/dist/react.js +814 -727
- package/dist/speechToText-BV7qxqPF.js +704 -0
- package/dist/speechToText-ZciRyyJE.cjs +1 -0
- package/dist/testing.cjs +1 -1
- package/dist/testing.d.cts +95 -28
- package/dist/testing.d.ts +95 -28
- package/dist/testing.js +1 -1
- package/dist/{types-Ct1hlKwg.js → types-Q7t1peH-.js} +595 -419
- package/dist/types-a7teDBnC.cjs +10 -0
- package/dist/vue.cjs +1 -1
- package/dist/vue.d.cts +105 -28
- package/dist/vue.d.ts +105 -28
- package/dist/vue.js +103 -101
- package/dist/widget.cjs +6 -6
- package/dist/widget.d.cts +127 -28
- package/dist/widget.d.ts +127 -28
- package/dist/widget.js +1717 -1772
- package/llms-full.txt +129 -1
- package/package.json +1 -1
- package/dist/createMockClient-BEOXI8yW.cjs +0 -1
- package/dist/sheetController-BThJRtOu.cjs +0 -1
- package/dist/sheetController-aEKXIvjk.js +0 -343
- package/dist/types-mcW8vB1U.cjs +0 -10
package/dist/widget.d.cts
CHANGED
|
@@ -92,7 +92,10 @@ declare class AgoClient {
|
|
|
92
92
|
* `null` otherwise.
|
|
93
93
|
*/
|
|
94
94
|
proactive: ProactiveController | null;
|
|
95
|
+
/** Removes the mirrored WebMCP tools; `null` when the bridge is off. */
|
|
96
|
+
private detachWebMCP;
|
|
95
97
|
constructor(config: AgoConfig);
|
|
98
|
+
private attachWebMCPBridge;
|
|
96
99
|
/**
|
|
97
100
|
* Send a message and receive a streaming response
|
|
98
101
|
*/
|
|
@@ -204,6 +207,7 @@ declare class AgoClient {
|
|
|
204
207
|
* (the agent decides what to do next). No-op if the invocation is unknown.
|
|
205
208
|
*/
|
|
206
209
|
rejectFunction(invocationId: string): Promise<void>;
|
|
210
|
+
/* Excluded from this release type: runExternalFunction */
|
|
207
211
|
/**
|
|
208
212
|
* Get a page of conversations, newest-first. `pageSize` is capped at 100 by
|
|
209
213
|
* the backend (default 50). Returns the `{ data, has_more, total }` envelope
|
|
@@ -223,11 +227,20 @@ declare class AgoClient {
|
|
|
223
227
|
* `SSEHandler.parseToolCall` so persisted and streamed tool calls match.
|
|
224
228
|
*/
|
|
225
229
|
private static mapPersistedToolCalls;
|
|
230
|
+
/**
|
|
231
|
+
* Transcribe an audio file into editable text (`POST /api/sdk/v1/audio/transcriptions`).
|
|
232
|
+
* Requires speech to text to be enabled for the tenant. Supports FLAC, MP3,
|
|
233
|
+
* MP4, MPEG, MPGA, M4A, OGG, WAV and WebM files up to 25 MB.
|
|
234
|
+
* The filename must include the matching extension. For a MediaRecorder blob,
|
|
235
|
+
* wrap it in a File with the recording's extension and MIME type.
|
|
236
|
+
* Show the returned text as a draft; call `sendMessage` when the user sends it.
|
|
237
|
+
*/
|
|
238
|
+
transcribeAudio(file: File, options?: TranscribeAudioOptions): Promise<AudioTranscription>;
|
|
226
239
|
/**
|
|
227
240
|
* The tenant's SDK configuration (`GET /api/sdk/v1/config`): per-permission
|
|
228
241
|
* agents, the ticket form the agent's `ago_ticketing` tool opens, and the
|
|
229
|
-
* file-attachment
|
|
230
|
-
* form first appears in a conversation.
|
|
242
|
+
* file-attachment and speech-to-text flags. The vanilla widget fetches it
|
|
243
|
+
* once, when a ticket form first appears in a conversation.
|
|
231
244
|
*/
|
|
232
245
|
getConfig(): Promise<SdkConfig>;
|
|
233
246
|
/**
|
|
@@ -364,6 +377,9 @@ declare class AgoClient {
|
|
|
364
377
|
* Get all registered function schemas
|
|
365
378
|
*/
|
|
366
379
|
getRegisteredFunctions(): ClientFunctionSchema[];
|
|
380
|
+
/** The callback form of `functions:changed`. Returns an unsubscribe. */
|
|
381
|
+
onFunctionsChanged(listener: () => void): () => void;
|
|
382
|
+
/* Excluded from this release type: getFunctionRegistrations */
|
|
367
383
|
/**
|
|
368
384
|
* Execute a registered client function locally, through the same
|
|
369
385
|
* FunctionRegistry path (result-size guard, error wrapping) as agent-invoked
|
|
@@ -696,6 +712,8 @@ declare interface AgoClientEvents {
|
|
|
696
712
|
* call running immediately.
|
|
697
713
|
*/
|
|
698
714
|
"function:awaiting-approval": ClientFunctionInvocation;
|
|
715
|
+
/** A function was registered or unregistered, or the registry cleared. */
|
|
716
|
+
"functions:changed": ClientFunctionSchema[];
|
|
699
717
|
"function:result": {
|
|
700
718
|
invocationId: string;
|
|
701
719
|
result: unknown;
|
|
@@ -768,6 +786,8 @@ declare interface AgoConfig {
|
|
|
768
786
|
defaultAgentId?: string;
|
|
769
787
|
/** Permission name to apply to all requests (sent as `X-Widget-Permission`). Mirrors the widget's `window.AGO.permission`. */
|
|
770
788
|
permission?: string;
|
|
789
|
+
/** Interface locale selected by the host app, sent as Accept-Language. Null clears the override. */
|
|
790
|
+
language?: string | null;
|
|
771
791
|
/** User email for identification */
|
|
772
792
|
userEmail?: string;
|
|
773
793
|
/** JWT token for authenticated users */
|
|
@@ -845,6 +865,15 @@ declare interface AgoConfig {
|
|
|
845
865
|
* mode's `jsErrors` signal. See `client.reportError()` for caught errors.
|
|
846
866
|
*/
|
|
847
867
|
errorWatcher?: boolean | ErrorWatcherOptions;
|
|
868
|
+
/** Mirror every registered client function into the browser's WebMCP registry
|
|
869
|
+
* (`document.modelContext`), so an external agent can call the same functions
|
|
870
|
+
* the in-app agent calls. Off by default; no-ops without WebMCP.
|
|
871
|
+
*
|
|
872
|
+
* A mirrored function runs immediately: the approval gate
|
|
873
|
+
* ({@link approvalPolicy}, `requiresApproval`) covers the agent loop only.
|
|
874
|
+
* Use `webmcp: false` on a definition to keep it out.
|
|
875
|
+
*/
|
|
876
|
+
webmcp?: boolean;
|
|
848
877
|
}
|
|
849
878
|
|
|
850
879
|
declare type AgoEventHandler<K extends AgoEventName> = (data: AgoClientEvents[K]) => void;
|
|
@@ -1058,6 +1087,11 @@ export declare interface AgoWidgetConfig {
|
|
|
1058
1087
|
metadata?: Record<string, unknown>;
|
|
1059
1088
|
}
|
|
1060
1089
|
|
|
1090
|
+
/** Editable text returned by `AgoClient.transcribeAudio`. */
|
|
1091
|
+
declare interface AudioTranscription {
|
|
1092
|
+
text: string;
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1061
1095
|
/** One JavaScript error captured on the page (deduplicated, see `count`). */
|
|
1062
1096
|
declare interface CapturedError {
|
|
1063
1097
|
type: CapturedErrorType;
|
|
@@ -1145,22 +1179,11 @@ export declare interface ChatWidgetHandle {
|
|
|
1145
1179
|
* client.registerFunction(fn);
|
|
1146
1180
|
* ```
|
|
1147
1181
|
*/
|
|
1148
|
-
declare interface ClientFunctionDefinition {
|
|
1182
|
+
declare interface ClientFunctionDefinition extends ClientFunctionSettings {
|
|
1149
1183
|
name: string;
|
|
1150
1184
|
description: string;
|
|
1151
1185
|
parameters: ClientFunctionSchema["parameters"];
|
|
1152
1186
|
handler: ClientFunctionHandler;
|
|
1153
|
-
/**
|
|
1154
|
-
* Max serialized result size in bytes before the SDK truncates it to a
|
|
1155
|
-
* flagged preview (default: `AgoConfig.maxFunctionResultBytes`, 50 000).
|
|
1156
|
-
* `Infinity` disables the guard for this function.
|
|
1157
|
-
*/
|
|
1158
|
-
maxResultBytes?: number;
|
|
1159
|
-
/**
|
|
1160
|
-
* Require explicit user approval before this function runs. See
|
|
1161
|
-
* {@link AgoConfig.approvalPolicy} — pause mode only. ORs with the policy.
|
|
1162
|
-
*/
|
|
1163
|
-
requiresApproval?: boolean;
|
|
1164
1187
|
}
|
|
1165
1188
|
|
|
1166
1189
|
/**
|
|
@@ -1179,20 +1202,7 @@ declare interface ClientFunctionInvocation {
|
|
|
1179
1202
|
* Schema-plus-settings object accepted when registering a function: the schema
|
|
1180
1203
|
* (minus `name`) and SDK-side options that are NOT sent to the backend.
|
|
1181
1204
|
*/
|
|
1182
|
-
declare type ClientFunctionRegisterOptions = Omit<ClientFunctionSchema, "name"> &
|
|
1183
|
-
/**
|
|
1184
|
-
* Max serialized result size in bytes before the SDK truncates it to a
|
|
1185
|
-
* flagged preview. Overrides the client-level default
|
|
1186
|
-
* (`AgoConfig.maxFunctionResultBytes`, 50 000 by default). `Infinity`
|
|
1187
|
-
* disables the guard for this function.
|
|
1188
|
-
*/
|
|
1189
|
-
maxResultBytes?: number;
|
|
1190
|
-
/**
|
|
1191
|
-
* Require explicit user approval before this function runs. See
|
|
1192
|
-
* {@link AgoConfig.approvalPolicy} — pause mode only. ORs with the policy.
|
|
1193
|
-
*/
|
|
1194
|
-
requiresApproval?: boolean;
|
|
1195
|
-
};
|
|
1205
|
+
declare type ClientFunctionRegisterOptions = Omit<ClientFunctionSchema, "name"> & ClientFunctionSettings;
|
|
1196
1206
|
|
|
1197
1207
|
/**
|
|
1198
1208
|
* Schema for a client-side function that AGO can call
|
|
@@ -1219,6 +1229,28 @@ declare interface ClientFunctionSchema {
|
|
|
1219
1229
|
};
|
|
1220
1230
|
}
|
|
1221
1231
|
|
|
1232
|
+
/** SDK-side function settings that are never sent to the backend. */
|
|
1233
|
+
declare interface ClientFunctionSettings {
|
|
1234
|
+
/**
|
|
1235
|
+
* Max serialized result size in bytes before the SDK truncates it to a
|
|
1236
|
+
* flagged preview. Overrides the client-level default
|
|
1237
|
+
* (`AgoConfig.maxFunctionResultBytes`, 50 000 by default). `Infinity`
|
|
1238
|
+
* disables the guard for this function.
|
|
1239
|
+
*/
|
|
1240
|
+
maxResultBytes?: number;
|
|
1241
|
+
/**
|
|
1242
|
+
* Require explicit user approval before this function runs. See
|
|
1243
|
+
* {@link AgoConfig.approvalPolicy} — pause mode only. ORs with the policy.
|
|
1244
|
+
*/
|
|
1245
|
+
requiresApproval?: boolean;
|
|
1246
|
+
/**
|
|
1247
|
+
* WebMCP metadata, read only when the bridge is on (`AgoConfig.webmcp`).
|
|
1248
|
+
* `false` keeps this function out of WebMCP while leaving it available to the
|
|
1249
|
+
* in-app agent.
|
|
1250
|
+
*/
|
|
1251
|
+
webmcp?: WebMCPToolMeta | false;
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1222
1254
|
/** See {@link AgoConfig.clientFunctionsMode}. */
|
|
1223
1255
|
declare type ClientFunctionsMode = "placeholder" | "pause";
|
|
1224
1256
|
|
|
@@ -1400,6 +1432,8 @@ declare interface CreateTicketResult {
|
|
|
1400
1432
|
|
|
1401
1433
|
export declare const DEFAULT_FEEDBACK_LABELS: FeedbackLabels;
|
|
1402
1434
|
|
|
1435
|
+
export declare const DEFAULT_SPEECH_TO_TEXT_LABELS: SpeechToTextLabels;
|
|
1436
|
+
|
|
1403
1437
|
export declare const DEFAULT_TOOL_CALL_FORM_LABELS: ToolCallFormLabels;
|
|
1404
1438
|
|
|
1405
1439
|
export declare const DEFAULT_WIDGET_LABELS: WidgetLabels;
|
|
@@ -1708,12 +1742,22 @@ export declare interface MountChatWidgetOptions {
|
|
|
1708
1742
|
placeholder?: string;
|
|
1709
1743
|
/** Enable file attachments. */
|
|
1710
1744
|
allowFiles?: boolean;
|
|
1745
|
+
/** Microphone, live waveform and draft transcription. Checks the tenant flag. Default false. */
|
|
1746
|
+
speechToText?: boolean | SpeechToTextOptions;
|
|
1711
1747
|
/**
|
|
1712
1748
|
* While the agent is answering, turn the send button into a Stop button that
|
|
1713
1749
|
* interrupts the turn. Default `true`; set `false` to keep showing a disabled
|
|
1714
1750
|
* spinner instead.
|
|
1715
1751
|
*/
|
|
1716
1752
|
allowStop?: boolean;
|
|
1753
|
+
/**
|
|
1754
|
+
* Follow new messages and streamed replies while the reader is at the bottom.
|
|
1755
|
+
* Defaults to `true`; sending a message or clicking the jump button resumes
|
|
1756
|
+
* following. Set `false` to keep the scroll position during replies. Sending
|
|
1757
|
+
* a message or clicking the jump button still jumps to the end once, without
|
|
1758
|
+
* enabling follow for subsequent chunks.
|
|
1759
|
+
*/
|
|
1760
|
+
autoScroll?: boolean;
|
|
1717
1761
|
/** Widget height (number → px). Ignored when `placement` is `"left"`/`"right"`
|
|
1718
1762
|
* (a side panel is always full-height). */
|
|
1719
1763
|
height?: string | number;
|
|
@@ -2153,6 +2197,14 @@ declare interface ProactiveTriggerWhen {
|
|
|
2153
2197
|
*/
|
|
2154
2198
|
export declare function readableTextColor(background: string | undefined): string;
|
|
2155
2199
|
|
|
2200
|
+
/**
|
|
2201
|
+
* Registered function with handler
|
|
2202
|
+
*/
|
|
2203
|
+
declare interface RegisteredFunction extends ClientFunctionSettings {
|
|
2204
|
+
schema: ClientFunctionSchema;
|
|
2205
|
+
handler: ClientFunctionHandler;
|
|
2206
|
+
}
|
|
2207
|
+
|
|
2156
2208
|
/**
|
|
2157
2209
|
* Tiny, dependency-free markdown → DOM renderer for the vanilla chat widget.
|
|
2158
2210
|
*
|
|
@@ -2237,6 +2289,8 @@ declare interface SdkPermissionConfig {
|
|
|
2237
2289
|
homePage?: SdkHomePageConfig;
|
|
2238
2290
|
fileAttachmentsEnabled: boolean;
|
|
2239
2291
|
voiceEnabled: boolean;
|
|
2292
|
+
/** Whether audio uploads can be transcribed. Defaults to false on older backends. */
|
|
2293
|
+
speechToTextEnabled: boolean;
|
|
2240
2294
|
}
|
|
2241
2295
|
|
|
2242
2296
|
/**
|
|
@@ -2408,6 +2462,26 @@ declare interface SignalsSnapshot {
|
|
|
2408
2462
|
pageState: Record<string, unknown> | null;
|
|
2409
2463
|
}
|
|
2410
2464
|
|
|
2465
|
+
/** Strings used by the microphone control in every widget. */
|
|
2466
|
+
export declare interface SpeechToTextLabels {
|
|
2467
|
+
start: string;
|
|
2468
|
+
finish: string;
|
|
2469
|
+
cancel: string;
|
|
2470
|
+
requesting: string;
|
|
2471
|
+
recording: string;
|
|
2472
|
+
transcribing: string;
|
|
2473
|
+
limitApproaching: string;
|
|
2474
|
+
permissionDenied: string;
|
|
2475
|
+
recordingFailed: string;
|
|
2476
|
+
tooLarge: string;
|
|
2477
|
+
noSpeech: string;
|
|
2478
|
+
transcriptionFailed: string;
|
|
2479
|
+
}
|
|
2480
|
+
|
|
2481
|
+
export declare interface SpeechToTextOptions {
|
|
2482
|
+
labels?: Partial<SpeechToTextLabels>;
|
|
2483
|
+
}
|
|
2484
|
+
|
|
2411
2485
|
/**
|
|
2412
2486
|
* SSE stream chunk data
|
|
2413
2487
|
*/
|
|
@@ -2690,6 +2764,31 @@ declare interface ToolCallTicketPrefill {
|
|
|
2690
2764
|
|
|
2691
2765
|
declare type ToolCallType = "form" | "confirmation_input" | "status_message" | "progress_indicator" | "client_function" | "reasoning" | "mcp_ui_resource";
|
|
2692
2766
|
|
|
2767
|
+
/** Options for `AgoClient.transcribeAudio`. */
|
|
2768
|
+
declare interface TranscribeAudioOptions {
|
|
2769
|
+
/** Cancel the upload or stop waiting for its transcription. */
|
|
2770
|
+
signal?: AbortSignal;
|
|
2771
|
+
}
|
|
2772
|
+
|
|
2773
|
+
/** The MCP behavior hints AGO has no equivalent for. */
|
|
2774
|
+
declare interface WebMCPToolMeta {
|
|
2775
|
+
/**
|
|
2776
|
+
* Both default to `false`, so only set what is true: `readOnlyHint` marks a
|
|
2777
|
+
* function that changes nothing, `untrustedContentHint` one whose result may
|
|
2778
|
+
* carry third-party text.
|
|
2779
|
+
*/
|
|
2780
|
+
annotations?: {
|
|
2781
|
+
readOnlyHint?: boolean;
|
|
2782
|
+
untrustedContentHint?: boolean;
|
|
2783
|
+
};
|
|
2784
|
+
/**
|
|
2785
|
+
* This function navigates. The WebMCP call is held open until the function
|
|
2786
|
+
* registry goes quiet, so the caller sees the destination page's tools rather
|
|
2787
|
+
* than the departing page's. Already set on the built-in `navigateToPage`.
|
|
2788
|
+
*/
|
|
2789
|
+
navigates?: boolean;
|
|
2790
|
+
}
|
|
2791
|
+
|
|
2693
2792
|
/**
|
|
2694
2793
|
* The greeting shown before any conversation has started. Pass a plain string
|
|
2695
2794
|
* for the classic centered empty-state placeholder, or an object to control how
|
package/dist/widget.d.ts
CHANGED
|
@@ -92,7 +92,10 @@ declare class AgoClient {
|
|
|
92
92
|
* `null` otherwise.
|
|
93
93
|
*/
|
|
94
94
|
proactive: ProactiveController | null;
|
|
95
|
+
/** Removes the mirrored WebMCP tools; `null` when the bridge is off. */
|
|
96
|
+
private detachWebMCP;
|
|
95
97
|
constructor(config: AgoConfig);
|
|
98
|
+
private attachWebMCPBridge;
|
|
96
99
|
/**
|
|
97
100
|
* Send a message and receive a streaming response
|
|
98
101
|
*/
|
|
@@ -204,6 +207,7 @@ declare class AgoClient {
|
|
|
204
207
|
* (the agent decides what to do next). No-op if the invocation is unknown.
|
|
205
208
|
*/
|
|
206
209
|
rejectFunction(invocationId: string): Promise<void>;
|
|
210
|
+
/* Excluded from this release type: runExternalFunction */
|
|
207
211
|
/**
|
|
208
212
|
* Get a page of conversations, newest-first. `pageSize` is capped at 100 by
|
|
209
213
|
* the backend (default 50). Returns the `{ data, has_more, total }` envelope
|
|
@@ -223,11 +227,20 @@ declare class AgoClient {
|
|
|
223
227
|
* `SSEHandler.parseToolCall` so persisted and streamed tool calls match.
|
|
224
228
|
*/
|
|
225
229
|
private static mapPersistedToolCalls;
|
|
230
|
+
/**
|
|
231
|
+
* Transcribe an audio file into editable text (`POST /api/sdk/v1/audio/transcriptions`).
|
|
232
|
+
* Requires speech to text to be enabled for the tenant. Supports FLAC, MP3,
|
|
233
|
+
* MP4, MPEG, MPGA, M4A, OGG, WAV and WebM files up to 25 MB.
|
|
234
|
+
* The filename must include the matching extension. For a MediaRecorder blob,
|
|
235
|
+
* wrap it in a File with the recording's extension and MIME type.
|
|
236
|
+
* Show the returned text as a draft; call `sendMessage` when the user sends it.
|
|
237
|
+
*/
|
|
238
|
+
transcribeAudio(file: File, options?: TranscribeAudioOptions): Promise<AudioTranscription>;
|
|
226
239
|
/**
|
|
227
240
|
* The tenant's SDK configuration (`GET /api/sdk/v1/config`): per-permission
|
|
228
241
|
* agents, the ticket form the agent's `ago_ticketing` tool opens, and the
|
|
229
|
-
* file-attachment
|
|
230
|
-
* form first appears in a conversation.
|
|
242
|
+
* file-attachment and speech-to-text flags. The vanilla widget fetches it
|
|
243
|
+
* once, when a ticket form first appears in a conversation.
|
|
231
244
|
*/
|
|
232
245
|
getConfig(): Promise<SdkConfig>;
|
|
233
246
|
/**
|
|
@@ -364,6 +377,9 @@ declare class AgoClient {
|
|
|
364
377
|
* Get all registered function schemas
|
|
365
378
|
*/
|
|
366
379
|
getRegisteredFunctions(): ClientFunctionSchema[];
|
|
380
|
+
/** The callback form of `functions:changed`. Returns an unsubscribe. */
|
|
381
|
+
onFunctionsChanged(listener: () => void): () => void;
|
|
382
|
+
/* Excluded from this release type: getFunctionRegistrations */
|
|
367
383
|
/**
|
|
368
384
|
* Execute a registered client function locally, through the same
|
|
369
385
|
* FunctionRegistry path (result-size guard, error wrapping) as agent-invoked
|
|
@@ -696,6 +712,8 @@ declare interface AgoClientEvents {
|
|
|
696
712
|
* call running immediately.
|
|
697
713
|
*/
|
|
698
714
|
"function:awaiting-approval": ClientFunctionInvocation;
|
|
715
|
+
/** A function was registered or unregistered, or the registry cleared. */
|
|
716
|
+
"functions:changed": ClientFunctionSchema[];
|
|
699
717
|
"function:result": {
|
|
700
718
|
invocationId: string;
|
|
701
719
|
result: unknown;
|
|
@@ -768,6 +786,8 @@ declare interface AgoConfig {
|
|
|
768
786
|
defaultAgentId?: string;
|
|
769
787
|
/** Permission name to apply to all requests (sent as `X-Widget-Permission`). Mirrors the widget's `window.AGO.permission`. */
|
|
770
788
|
permission?: string;
|
|
789
|
+
/** Interface locale selected by the host app, sent as Accept-Language. Null clears the override. */
|
|
790
|
+
language?: string | null;
|
|
771
791
|
/** User email for identification */
|
|
772
792
|
userEmail?: string;
|
|
773
793
|
/** JWT token for authenticated users */
|
|
@@ -845,6 +865,15 @@ declare interface AgoConfig {
|
|
|
845
865
|
* mode's `jsErrors` signal. See `client.reportError()` for caught errors.
|
|
846
866
|
*/
|
|
847
867
|
errorWatcher?: boolean | ErrorWatcherOptions;
|
|
868
|
+
/** Mirror every registered client function into the browser's WebMCP registry
|
|
869
|
+
* (`document.modelContext`), so an external agent can call the same functions
|
|
870
|
+
* the in-app agent calls. Off by default; no-ops without WebMCP.
|
|
871
|
+
*
|
|
872
|
+
* A mirrored function runs immediately: the approval gate
|
|
873
|
+
* ({@link approvalPolicy}, `requiresApproval`) covers the agent loop only.
|
|
874
|
+
* Use `webmcp: false` on a definition to keep it out.
|
|
875
|
+
*/
|
|
876
|
+
webmcp?: boolean;
|
|
848
877
|
}
|
|
849
878
|
|
|
850
879
|
declare type AgoEventHandler<K extends AgoEventName> = (data: AgoClientEvents[K]) => void;
|
|
@@ -1058,6 +1087,11 @@ export declare interface AgoWidgetConfig {
|
|
|
1058
1087
|
metadata?: Record<string, unknown>;
|
|
1059
1088
|
}
|
|
1060
1089
|
|
|
1090
|
+
/** Editable text returned by `AgoClient.transcribeAudio`. */
|
|
1091
|
+
declare interface AudioTranscription {
|
|
1092
|
+
text: string;
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1061
1095
|
/** One JavaScript error captured on the page (deduplicated, see `count`). */
|
|
1062
1096
|
declare interface CapturedError {
|
|
1063
1097
|
type: CapturedErrorType;
|
|
@@ -1145,22 +1179,11 @@ export declare interface ChatWidgetHandle {
|
|
|
1145
1179
|
* client.registerFunction(fn);
|
|
1146
1180
|
* ```
|
|
1147
1181
|
*/
|
|
1148
|
-
declare interface ClientFunctionDefinition {
|
|
1182
|
+
declare interface ClientFunctionDefinition extends ClientFunctionSettings {
|
|
1149
1183
|
name: string;
|
|
1150
1184
|
description: string;
|
|
1151
1185
|
parameters: ClientFunctionSchema["parameters"];
|
|
1152
1186
|
handler: ClientFunctionHandler;
|
|
1153
|
-
/**
|
|
1154
|
-
* Max serialized result size in bytes before the SDK truncates it to a
|
|
1155
|
-
* flagged preview (default: `AgoConfig.maxFunctionResultBytes`, 50 000).
|
|
1156
|
-
* `Infinity` disables the guard for this function.
|
|
1157
|
-
*/
|
|
1158
|
-
maxResultBytes?: number;
|
|
1159
|
-
/**
|
|
1160
|
-
* Require explicit user approval before this function runs. See
|
|
1161
|
-
* {@link AgoConfig.approvalPolicy} — pause mode only. ORs with the policy.
|
|
1162
|
-
*/
|
|
1163
|
-
requiresApproval?: boolean;
|
|
1164
1187
|
}
|
|
1165
1188
|
|
|
1166
1189
|
/**
|
|
@@ -1179,20 +1202,7 @@ declare interface ClientFunctionInvocation {
|
|
|
1179
1202
|
* Schema-plus-settings object accepted when registering a function: the schema
|
|
1180
1203
|
* (minus `name`) and SDK-side options that are NOT sent to the backend.
|
|
1181
1204
|
*/
|
|
1182
|
-
declare type ClientFunctionRegisterOptions = Omit<ClientFunctionSchema, "name"> &
|
|
1183
|
-
/**
|
|
1184
|
-
* Max serialized result size in bytes before the SDK truncates it to a
|
|
1185
|
-
* flagged preview. Overrides the client-level default
|
|
1186
|
-
* (`AgoConfig.maxFunctionResultBytes`, 50 000 by default). `Infinity`
|
|
1187
|
-
* disables the guard for this function.
|
|
1188
|
-
*/
|
|
1189
|
-
maxResultBytes?: number;
|
|
1190
|
-
/**
|
|
1191
|
-
* Require explicit user approval before this function runs. See
|
|
1192
|
-
* {@link AgoConfig.approvalPolicy} — pause mode only. ORs with the policy.
|
|
1193
|
-
*/
|
|
1194
|
-
requiresApproval?: boolean;
|
|
1195
|
-
};
|
|
1205
|
+
declare type ClientFunctionRegisterOptions = Omit<ClientFunctionSchema, "name"> & ClientFunctionSettings;
|
|
1196
1206
|
|
|
1197
1207
|
/**
|
|
1198
1208
|
* Schema for a client-side function that AGO can call
|
|
@@ -1219,6 +1229,28 @@ declare interface ClientFunctionSchema {
|
|
|
1219
1229
|
};
|
|
1220
1230
|
}
|
|
1221
1231
|
|
|
1232
|
+
/** SDK-side function settings that are never sent to the backend. */
|
|
1233
|
+
declare interface ClientFunctionSettings {
|
|
1234
|
+
/**
|
|
1235
|
+
* Max serialized result size in bytes before the SDK truncates it to a
|
|
1236
|
+
* flagged preview. Overrides the client-level default
|
|
1237
|
+
* (`AgoConfig.maxFunctionResultBytes`, 50 000 by default). `Infinity`
|
|
1238
|
+
* disables the guard for this function.
|
|
1239
|
+
*/
|
|
1240
|
+
maxResultBytes?: number;
|
|
1241
|
+
/**
|
|
1242
|
+
* Require explicit user approval before this function runs. See
|
|
1243
|
+
* {@link AgoConfig.approvalPolicy} — pause mode only. ORs with the policy.
|
|
1244
|
+
*/
|
|
1245
|
+
requiresApproval?: boolean;
|
|
1246
|
+
/**
|
|
1247
|
+
* WebMCP metadata, read only when the bridge is on (`AgoConfig.webmcp`).
|
|
1248
|
+
* `false` keeps this function out of WebMCP while leaving it available to the
|
|
1249
|
+
* in-app agent.
|
|
1250
|
+
*/
|
|
1251
|
+
webmcp?: WebMCPToolMeta | false;
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1222
1254
|
/** See {@link AgoConfig.clientFunctionsMode}. */
|
|
1223
1255
|
declare type ClientFunctionsMode = "placeholder" | "pause";
|
|
1224
1256
|
|
|
@@ -1400,6 +1432,8 @@ declare interface CreateTicketResult {
|
|
|
1400
1432
|
|
|
1401
1433
|
export declare const DEFAULT_FEEDBACK_LABELS: FeedbackLabels;
|
|
1402
1434
|
|
|
1435
|
+
export declare const DEFAULT_SPEECH_TO_TEXT_LABELS: SpeechToTextLabels;
|
|
1436
|
+
|
|
1403
1437
|
export declare const DEFAULT_TOOL_CALL_FORM_LABELS: ToolCallFormLabels;
|
|
1404
1438
|
|
|
1405
1439
|
export declare const DEFAULT_WIDGET_LABELS: WidgetLabels;
|
|
@@ -1708,12 +1742,22 @@ export declare interface MountChatWidgetOptions {
|
|
|
1708
1742
|
placeholder?: string;
|
|
1709
1743
|
/** Enable file attachments. */
|
|
1710
1744
|
allowFiles?: boolean;
|
|
1745
|
+
/** Microphone, live waveform and draft transcription. Checks the tenant flag. Default false. */
|
|
1746
|
+
speechToText?: boolean | SpeechToTextOptions;
|
|
1711
1747
|
/**
|
|
1712
1748
|
* While the agent is answering, turn the send button into a Stop button that
|
|
1713
1749
|
* interrupts the turn. Default `true`; set `false` to keep showing a disabled
|
|
1714
1750
|
* spinner instead.
|
|
1715
1751
|
*/
|
|
1716
1752
|
allowStop?: boolean;
|
|
1753
|
+
/**
|
|
1754
|
+
* Follow new messages and streamed replies while the reader is at the bottom.
|
|
1755
|
+
* Defaults to `true`; sending a message or clicking the jump button resumes
|
|
1756
|
+
* following. Set `false` to keep the scroll position during replies. Sending
|
|
1757
|
+
* a message or clicking the jump button still jumps to the end once, without
|
|
1758
|
+
* enabling follow for subsequent chunks.
|
|
1759
|
+
*/
|
|
1760
|
+
autoScroll?: boolean;
|
|
1717
1761
|
/** Widget height (number → px). Ignored when `placement` is `"left"`/`"right"`
|
|
1718
1762
|
* (a side panel is always full-height). */
|
|
1719
1763
|
height?: string | number;
|
|
@@ -2153,6 +2197,14 @@ declare interface ProactiveTriggerWhen {
|
|
|
2153
2197
|
*/
|
|
2154
2198
|
export declare function readableTextColor(background: string | undefined): string;
|
|
2155
2199
|
|
|
2200
|
+
/**
|
|
2201
|
+
* Registered function with handler
|
|
2202
|
+
*/
|
|
2203
|
+
declare interface RegisteredFunction extends ClientFunctionSettings {
|
|
2204
|
+
schema: ClientFunctionSchema;
|
|
2205
|
+
handler: ClientFunctionHandler;
|
|
2206
|
+
}
|
|
2207
|
+
|
|
2156
2208
|
/**
|
|
2157
2209
|
* Tiny, dependency-free markdown → DOM renderer for the vanilla chat widget.
|
|
2158
2210
|
*
|
|
@@ -2237,6 +2289,8 @@ declare interface SdkPermissionConfig {
|
|
|
2237
2289
|
homePage?: SdkHomePageConfig;
|
|
2238
2290
|
fileAttachmentsEnabled: boolean;
|
|
2239
2291
|
voiceEnabled: boolean;
|
|
2292
|
+
/** Whether audio uploads can be transcribed. Defaults to false on older backends. */
|
|
2293
|
+
speechToTextEnabled: boolean;
|
|
2240
2294
|
}
|
|
2241
2295
|
|
|
2242
2296
|
/**
|
|
@@ -2408,6 +2462,26 @@ declare interface SignalsSnapshot {
|
|
|
2408
2462
|
pageState: Record<string, unknown> | null;
|
|
2409
2463
|
}
|
|
2410
2464
|
|
|
2465
|
+
/** Strings used by the microphone control in every widget. */
|
|
2466
|
+
export declare interface SpeechToTextLabels {
|
|
2467
|
+
start: string;
|
|
2468
|
+
finish: string;
|
|
2469
|
+
cancel: string;
|
|
2470
|
+
requesting: string;
|
|
2471
|
+
recording: string;
|
|
2472
|
+
transcribing: string;
|
|
2473
|
+
limitApproaching: string;
|
|
2474
|
+
permissionDenied: string;
|
|
2475
|
+
recordingFailed: string;
|
|
2476
|
+
tooLarge: string;
|
|
2477
|
+
noSpeech: string;
|
|
2478
|
+
transcriptionFailed: string;
|
|
2479
|
+
}
|
|
2480
|
+
|
|
2481
|
+
export declare interface SpeechToTextOptions {
|
|
2482
|
+
labels?: Partial<SpeechToTextLabels>;
|
|
2483
|
+
}
|
|
2484
|
+
|
|
2411
2485
|
/**
|
|
2412
2486
|
* SSE stream chunk data
|
|
2413
2487
|
*/
|
|
@@ -2690,6 +2764,31 @@ declare interface ToolCallTicketPrefill {
|
|
|
2690
2764
|
|
|
2691
2765
|
declare type ToolCallType = "form" | "confirmation_input" | "status_message" | "progress_indicator" | "client_function" | "reasoning" | "mcp_ui_resource";
|
|
2692
2766
|
|
|
2767
|
+
/** Options for `AgoClient.transcribeAudio`. */
|
|
2768
|
+
declare interface TranscribeAudioOptions {
|
|
2769
|
+
/** Cancel the upload or stop waiting for its transcription. */
|
|
2770
|
+
signal?: AbortSignal;
|
|
2771
|
+
}
|
|
2772
|
+
|
|
2773
|
+
/** The MCP behavior hints AGO has no equivalent for. */
|
|
2774
|
+
declare interface WebMCPToolMeta {
|
|
2775
|
+
/**
|
|
2776
|
+
* Both default to `false`, so only set what is true: `readOnlyHint` marks a
|
|
2777
|
+
* function that changes nothing, `untrustedContentHint` one whose result may
|
|
2778
|
+
* carry third-party text.
|
|
2779
|
+
*/
|
|
2780
|
+
annotations?: {
|
|
2781
|
+
readOnlyHint?: boolean;
|
|
2782
|
+
untrustedContentHint?: boolean;
|
|
2783
|
+
};
|
|
2784
|
+
/**
|
|
2785
|
+
* This function navigates. The WebMCP call is held open until the function
|
|
2786
|
+
* registry goes quiet, so the caller sees the destination page's tools rather
|
|
2787
|
+
* than the departing page's. Already set on the built-in `navigateToPage`.
|
|
2788
|
+
*/
|
|
2789
|
+
navigates?: boolean;
|
|
2790
|
+
}
|
|
2791
|
+
|
|
2693
2792
|
/**
|
|
2694
2793
|
* The greeting shown before any conversation has started. Pass a plain string
|
|
2695
2794
|
* for the classic centered empty-state placeholder, or an object to control how
|