@useago/sdk 1.9.0 → 1.12.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 +104 -0
- package/README.md +53 -0
- package/dist/angular.cjs +1 -1
- package/dist/angular.d.cts +313 -0
- package/dist/angular.d.ts +313 -0
- package/dist/angular.js +1 -1
- package/dist/{createConversationSession-BaaXBQ5b.js → createConversationSession-B1Qn-y0I.js} +1 -1
- package/dist/{createConversationSession-CU0b-t1W.cjs → createConversationSession-B3v_xOU7.cjs} +1 -1
- package/dist/{createFormCollector-DfN1xZBy.cjs → createFormCollector-FvwDOqnV.cjs} +1 -1
- package/dist/{createFormCollector-Cf7kGhCB.js → createFormCollector-m79zk_NA.js} +1 -1
- package/dist/createMockClient-BEOXI8yW.cjs +1 -0
- package/dist/{createMockClient-5YF-ZbVu.js → createMockClient-Beao82tu.js} +15 -3
- package/dist/devtools.d.cts +313 -0
- package/dist/devtools.d.ts +313 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +389 -4
- package/dist/index.d.ts +389 -4
- package/dist/index.js +118 -114
- package/dist/react.cjs +1 -1
- package/dist/react.d.cts +313 -0
- package/dist/react.d.ts +313 -0
- package/dist/react.js +8 -6
- package/dist/sheetController-BThJRtOu.cjs +1 -0
- package/dist/sheetController-aEKXIvjk.js +343 -0
- package/dist/testing.cjs +1 -1
- package/dist/testing.d.cts +313 -0
- package/dist/testing.d.ts +313 -0
- package/dist/testing.js +1 -1
- package/dist/types-Ct1hlKwg.js +2408 -0
- package/dist/types-mcW8vB1U.cjs +10 -0
- package/dist/vue.cjs +1 -1
- package/dist/vue.d.cts +505 -0
- package/dist/vue.d.ts +505 -0
- package/dist/vue.js +1 -1
- package/dist/widget.cjs +6 -4
- package/dist/widget.d.cts +585 -2
- package/dist/widget.d.ts +585 -2
- package/dist/widget.js +3985 -995
- package/llms-full.txt +125 -6
- package/package.json +1 -1
- package/dist/createMockClient-BZbOe-23.cjs +0 -1
- package/dist/sheetController-CBUVOroo.js +0 -205
- package/dist/sheetController-DY-sC13T.cjs +0 -1
- package/dist/types-CPga11Of.js +0 -2068
- package/dist/types-D3YQl1jx.cjs +0 -9
package/dist/devtools.d.cts
CHANGED
|
@@ -53,6 +53,7 @@ declare class AgoClient {
|
|
|
53
53
|
private contextRegistry;
|
|
54
54
|
private eventEmitter;
|
|
55
55
|
private activityLedger;
|
|
56
|
+
private errorWatcher;
|
|
56
57
|
private lastSentPageState;
|
|
57
58
|
private config;
|
|
58
59
|
/** Conversations already warned about an empty reply (one warning each). */
|
|
@@ -222,6 +223,26 @@ declare class AgoClient {
|
|
|
222
223
|
* `SSEHandler.parseToolCall` so persisted and streamed tool calls match.
|
|
223
224
|
*/
|
|
224
225
|
private static mapPersistedToolCalls;
|
|
226
|
+
/**
|
|
227
|
+
* The tenant's SDK configuration (`GET /api/sdk/v1/config`): per-permission
|
|
228
|
+
* agents, the ticket form the agent's `ago_ticketing` tool opens, and the
|
|
229
|
+
* file-attachment flag. The vanilla widget fetches it once, when a ticket
|
|
230
|
+
* form first appears in a conversation.
|
|
231
|
+
*/
|
|
232
|
+
getConfig(): Promise<SdkConfig>;
|
|
233
|
+
/**
|
|
234
|
+
* The dashboard's home screen content. A starter card shows its
|
|
235
|
+
* `description` and sends its `initial_message`; one with neither is
|
|
236
|
+
* unusable and is dropped rather than rendered as an empty card.
|
|
237
|
+
*/
|
|
238
|
+
private static mapHomePage;
|
|
239
|
+
private static mapTicketForm;
|
|
240
|
+
/**
|
|
241
|
+
* Create a support ticket (`POST /api/sdk/v1/tickets`, multipart). This is
|
|
242
|
+
* what the ticket form in the conversation does before it completes the
|
|
243
|
+
* `form` tool call with {@link submitToolCallForm}.
|
|
244
|
+
*/
|
|
245
|
+
createTicket(input: CreateTicketInput): Promise<CreateTicketResult>;
|
|
225
246
|
/**
|
|
226
247
|
* Get messages for a conversation
|
|
227
248
|
*/
|
|
@@ -480,6 +501,15 @@ declare class AgoClient {
|
|
|
480
501
|
/* Excluded from this release type: emitProactiveEvent */
|
|
481
502
|
/* Excluded from this release type: getHttp */
|
|
482
503
|
/* Excluded from this release type: getConfiguredAgent */
|
|
504
|
+
/**
|
|
505
|
+
* How the SDK identifies the visitor: the configured `userEmail`, and
|
|
506
|
+
* whether a `userJwt` is set. The ticket form asks for an email when it has
|
|
507
|
+
* neither.
|
|
508
|
+
*/
|
|
509
|
+
getUserIdentity(): {
|
|
510
|
+
email?: string;
|
|
511
|
+
hasJwt: boolean;
|
|
512
|
+
};
|
|
483
513
|
/**
|
|
484
514
|
* Enable automatic capture of the current browser page (URL + title).
|
|
485
515
|
* Injected as a dynamic context entry named `browser-page`.
|
|
@@ -502,6 +532,26 @@ declare class AgoClient {
|
|
|
502
532
|
private addActivity;
|
|
503
533
|
private recordAgentAction;
|
|
504
534
|
private registerActivityContext;
|
|
535
|
+
/**
|
|
536
|
+
* Start capturing the page's JavaScript errors (uncaught exceptions,
|
|
537
|
+
* unhandled rejections, `console.error` calls, {@link reportError}) and send
|
|
538
|
+
* the recent ones as the `errors:recent` context entry on every message.
|
|
539
|
+
* Same as setting `errorWatcher` in the config. Calling it again replaces
|
|
540
|
+
* the watcher (and its options); the captured errors are not kept.
|
|
541
|
+
*/
|
|
542
|
+
enableErrorWatcher(options?: ErrorWatcherOptions): void;
|
|
543
|
+
/** Stop capturing errors and drop the `errors:recent` context entry. */
|
|
544
|
+
disableErrorWatcher(): void;
|
|
545
|
+
/**
|
|
546
|
+
* Record an error the app caught itself (React error boundary, Vue
|
|
547
|
+
* `errorHandler`, Angular `ErrorHandler`, a try/catch) so the agent sees it
|
|
548
|
+
* like an uncaught one. No-op unless the error watcher is enabled. `context`
|
|
549
|
+
* is size-clamped before it is stored; keep it small and free of secrets.
|
|
550
|
+
*/
|
|
551
|
+
reportError(error: unknown, context?: Record<string, unknown>): void;
|
|
552
|
+
/** Errors the watcher currently holds, oldest first (a copy). Empty when disabled. */
|
|
553
|
+
getRecentErrors(): CapturedError[];
|
|
554
|
+
clearErrors(): void;
|
|
505
555
|
/**
|
|
506
556
|
* Subscribe to an event
|
|
507
557
|
*/
|
|
@@ -696,6 +746,12 @@ declare interface AgoClientEvents {
|
|
|
696
746
|
};
|
|
697
747
|
/** A user- or agent-action was recorded into the activity ledger. */
|
|
698
748
|
"activity:recorded": ActivityEntry;
|
|
749
|
+
/**
|
|
750
|
+
* The error watcher captured a JavaScript error (uncaught exception,
|
|
751
|
+
* unhandled rejection, `console.error` call, or `reportError`). Fires on
|
|
752
|
+
* repeats too, with the updated `count`. Requires `errorWatcher` in the config.
|
|
753
|
+
*/
|
|
754
|
+
"error:captured": CapturedError;
|
|
699
755
|
}
|
|
700
756
|
|
|
701
757
|
/**
|
|
@@ -716,6 +772,8 @@ declare interface AgoConfig {
|
|
|
716
772
|
userEmail?: string;
|
|
717
773
|
/** JWT token for authenticated users */
|
|
718
774
|
userJwt?: string;
|
|
775
|
+
/** User metadata sent with messages. Use null to stop sending defaults. Not an authentication credential. */
|
|
776
|
+
metadata?: Record<string, unknown> | null;
|
|
719
777
|
/** Enable debug logging */
|
|
720
778
|
debug?: boolean;
|
|
721
779
|
/**
|
|
@@ -775,6 +833,18 @@ declare interface AgoConfig {
|
|
|
775
833
|
* default otherwise.
|
|
776
834
|
*/
|
|
777
835
|
proactive?: ProactiveOptions;
|
|
836
|
+
/**
|
|
837
|
+
* Capture the page's JavaScript errors as agent context. When set, the SDK
|
|
838
|
+
* listens for uncaught exceptions and unhandled promise rejections, wraps
|
|
839
|
+
* `console.error` (calling through; restored on `destroy`), and sends the
|
|
840
|
+
* recent errors (deduplicated, capped, pruned after 10 min) as the
|
|
841
|
+
* `errors:recent` context entry on every message. `true` uses the defaults;
|
|
842
|
+
* pass {@link ErrorWatcherOptions} to tune the caps or add a `filter` that
|
|
843
|
+
* redacts messages. Off by default: error messages can carry PII or internal
|
|
844
|
+
* URLs, so enabling it is the host's call. Errors also feed the proactive
|
|
845
|
+
* mode's `jsErrors` signal. See `client.reportError()` for caught errors.
|
|
846
|
+
*/
|
|
847
|
+
errorWatcher?: boolean | ErrorWatcherOptions;
|
|
778
848
|
}
|
|
779
849
|
|
|
780
850
|
declare type AgoEventHandler<K extends AgoEventName> = (data: AgoClientEvents[K]) => void;
|
|
@@ -959,6 +1029,32 @@ declare type AgoStateSetResult = {
|
|
|
959
1029
|
result: "unchanged";
|
|
960
1030
|
};
|
|
961
1031
|
|
|
1032
|
+
/** One JavaScript error captured on the page (deduplicated, see `count`). */
|
|
1033
|
+
declare interface CapturedError {
|
|
1034
|
+
type: CapturedErrorType;
|
|
1035
|
+
/** Error message, truncated to 500 chars. */
|
|
1036
|
+
message: string;
|
|
1037
|
+
/** Script URL the error came from, without its query string. */
|
|
1038
|
+
source?: string;
|
|
1039
|
+
line?: number;
|
|
1040
|
+
col?: number;
|
|
1041
|
+
/** Leading stack frames, truncated (see `maxStackChars`). */
|
|
1042
|
+
stack?: string;
|
|
1043
|
+
/** Pathname at capture time. */
|
|
1044
|
+
route: string;
|
|
1045
|
+
/** Epoch ms of the first occurrence. */
|
|
1046
|
+
firstAt: number;
|
|
1047
|
+
/** Epoch ms of the most recent occurrence. */
|
|
1048
|
+
lastAt: number;
|
|
1049
|
+
/** How many times this same error (type + message + source + line) fired. */
|
|
1050
|
+
count: number;
|
|
1051
|
+
/** App-provided context, manual reports only (size-clamped). */
|
|
1052
|
+
context?: Record<string, unknown>;
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
/** How an error reached the watcher. */
|
|
1056
|
+
declare type CapturedErrorType = "error" | "unhandledrejection" | "console" | "manual";
|
|
1057
|
+
|
|
962
1058
|
/**
|
|
963
1059
|
* Single-object function definition — combines name, schema, and handler.
|
|
964
1060
|
*
|
|
@@ -1092,6 +1188,30 @@ declare interface Conversation {
|
|
|
1092
1188
|
messages?: AgoMessage[];
|
|
1093
1189
|
}
|
|
1094
1190
|
|
|
1191
|
+
/** Input of `AgoClient.createTicket` (`POST /api/sdk/v1/tickets`). */
|
|
1192
|
+
declare interface CreateTicketInput {
|
|
1193
|
+
subject: string;
|
|
1194
|
+
body: string;
|
|
1195
|
+
priority?: string;
|
|
1196
|
+
typology?: string;
|
|
1197
|
+
/** Conversation the ticket is filed from. */
|
|
1198
|
+
conversationId?: string;
|
|
1199
|
+
/** Reporter email, for a visitor the SDK does not otherwise identify. */
|
|
1200
|
+
email?: string;
|
|
1201
|
+
customFields?: Array<{
|
|
1202
|
+
id: string;
|
|
1203
|
+
value: string;
|
|
1204
|
+
}>;
|
|
1205
|
+
files?: File[];
|
|
1206
|
+
ticketFormId?: string;
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1209
|
+
/** Response of `AgoClient.createTicket`. */
|
|
1210
|
+
declare interface CreateTicketResult {
|
|
1211
|
+
id: string;
|
|
1212
|
+
url?: string;
|
|
1213
|
+
}
|
|
1214
|
+
|
|
1095
1215
|
/** Options for {@link initDevPanel}. */
|
|
1096
1216
|
export declare interface DevPanelOptions {
|
|
1097
1217
|
/**
|
|
@@ -1130,6 +1250,23 @@ export declare interface DevPanelOptions {
|
|
|
1130
1250
|
*/
|
|
1131
1251
|
declare type DynamicContextProvider = () => ContextEntry | null | undefined;
|
|
1132
1252
|
|
|
1253
|
+
declare interface ErrorWatcherOptions {
|
|
1254
|
+
/** Max distinct errors kept. Oldest dropped first. Default 10. */
|
|
1255
|
+
maxErrors?: number;
|
|
1256
|
+
/**
|
|
1257
|
+
* Errors older than this are pruned when the buffer is read, so a crash from
|
|
1258
|
+
* an hour ago does not confuse the agent. Default 600 000 (10 min).
|
|
1259
|
+
*/
|
|
1260
|
+
maxAgeMs?: number;
|
|
1261
|
+
/** Max chars of stack kept per error. Default 2000. */
|
|
1262
|
+
maxStackChars?: number;
|
|
1263
|
+
/**
|
|
1264
|
+
* Redact or drop an error before it is stored. Return the (possibly edited)
|
|
1265
|
+
* error to keep it, `null` to drop it. Runs on every capture, so keep it cheap.
|
|
1266
|
+
*/
|
|
1267
|
+
filter?: (error: CapturedError) => CapturedError | null;
|
|
1268
|
+
}
|
|
1269
|
+
|
|
1133
1270
|
/**
|
|
1134
1271
|
* Why the user is reporting a message (see `AgoClient.submitFeedback`).
|
|
1135
1272
|
*
|
|
@@ -1492,6 +1629,12 @@ declare interface ProactiveTriggerWhen {
|
|
|
1492
1629
|
pageState?: Partial<Record<string, unknown>>;
|
|
1493
1630
|
/** Min rage-click bursts on the current route. */
|
|
1494
1631
|
rageClicks?: number;
|
|
1632
|
+
/**
|
|
1633
|
+
* Min JavaScript errors captured on the current route. Needs the client's
|
|
1634
|
+
* `errorWatcher` enabled; without it the count stays at 0 and the matcher
|
|
1635
|
+
* never passes.
|
|
1636
|
+
*/
|
|
1637
|
+
jsErrors?: number;
|
|
1495
1638
|
/** Min A→B→A→B route oscillations this session. */
|
|
1496
1639
|
routeBounces?: number;
|
|
1497
1640
|
/** Per-field minimum error counts (field NAME → min count). */
|
|
@@ -1509,10 +1652,69 @@ declare type ResumeGate = (info: {
|
|
|
1509
1652
|
messageId: string;
|
|
1510
1653
|
}) => Promise<void> | void;
|
|
1511
1654
|
|
|
1655
|
+
/** Response of `GET /api/sdk/v1/config` (see `AgoClient.getConfig`). */
|
|
1656
|
+
declare interface SdkConfig {
|
|
1657
|
+
permissions: SdkPermissionConfig[];
|
|
1658
|
+
proactive: {
|
|
1659
|
+
enabled: boolean;
|
|
1660
|
+
};
|
|
1661
|
+
}
|
|
1662
|
+
|
|
1663
|
+
/** The dashboard's home screen content (title, subtitle, starter cards). */
|
|
1664
|
+
declare interface SdkHomePageConfig {
|
|
1665
|
+
title?: string;
|
|
1666
|
+
/** Markdown. */
|
|
1667
|
+
subtitle?: string;
|
|
1668
|
+
starters: SdkHomeStarter[];
|
|
1669
|
+
widgetStarter?: SdkWidgetStarter;
|
|
1670
|
+
}
|
|
1671
|
+
|
|
1672
|
+
/**
|
|
1673
|
+
* A conversation starter card configured in the AGO dashboard. `label` is what
|
|
1674
|
+
* the card shows; clicking it sends `message`.
|
|
1675
|
+
*/
|
|
1676
|
+
declare interface SdkHomeStarter {
|
|
1677
|
+
id: string;
|
|
1678
|
+
/** The card's text (the starter's `description` in the dashboard). */
|
|
1679
|
+
label: string;
|
|
1680
|
+
/** What is sent when the card is clicked. */
|
|
1681
|
+
message: string;
|
|
1682
|
+
/** Answer with this agent instead of the configured default. */
|
|
1683
|
+
agentId?: string;
|
|
1684
|
+
}
|
|
1685
|
+
|
|
1686
|
+
/** One permission's configuration in {@link SdkConfig}. */
|
|
1687
|
+
declare interface SdkPermissionConfig {
|
|
1688
|
+
id?: string;
|
|
1689
|
+
name?: string;
|
|
1690
|
+
displayName?: string;
|
|
1691
|
+
agents: Array<{
|
|
1692
|
+
id: string;
|
|
1693
|
+
name?: string;
|
|
1694
|
+
}>;
|
|
1695
|
+
ticketForm?: TicketForm;
|
|
1696
|
+
/** Home screen content, when the tenant configured one. */
|
|
1697
|
+
homePage?: SdkHomePageConfig;
|
|
1698
|
+
fileAttachmentsEnabled: boolean;
|
|
1699
|
+
voiceEnabled: boolean;
|
|
1700
|
+
}
|
|
1701
|
+
|
|
1702
|
+
/**
|
|
1703
|
+
* The starter the dashboard sends by itself on a fresh visit, before the
|
|
1704
|
+
* visitor types anything.
|
|
1705
|
+
*/
|
|
1706
|
+
declare interface SdkWidgetStarter {
|
|
1707
|
+
id: string;
|
|
1708
|
+
message: string;
|
|
1709
|
+
agentId?: string;
|
|
1710
|
+
}
|
|
1711
|
+
|
|
1512
1712
|
/**
|
|
1513
1713
|
* Options for sending a message
|
|
1514
1714
|
*/
|
|
1515
1715
|
declare interface SendMessageOptions {
|
|
1716
|
+
/** Replaces config.metadata for this message; null omits metadata for this message. */
|
|
1717
|
+
metadata?: Record<string, unknown> | null;
|
|
1516
1718
|
/** Existing conversation ID */
|
|
1517
1719
|
conversationId?: string;
|
|
1518
1720
|
/** Override default agent */
|
|
@@ -1561,6 +1763,12 @@ declare interface SignalsSnapshot {
|
|
|
1561
1763
|
idleMs: number;
|
|
1562
1764
|
/** Rage-click bursts detected on the current route. */
|
|
1563
1765
|
rageClicks: number;
|
|
1766
|
+
/**
|
|
1767
|
+
* JavaScript errors captured on the current route (count only; the messages
|
|
1768
|
+
* travel in `client_context` under `errors:recent`). Always `0` unless the
|
|
1769
|
+
* client has `errorWatcher` enabled.
|
|
1770
|
+
*/
|
|
1771
|
+
jsErrors: number;
|
|
1564
1772
|
/**
|
|
1565
1773
|
* A→B→A→B route oscillations detected in the recent route sequence. Rolling
|
|
1566
1774
|
* session counter (cross-route by nature); trigger cooldowns and dismissal
|
|
@@ -1619,6 +1827,13 @@ declare interface SSEChunkData {
|
|
|
1619
1827
|
follow_up_replies?: string[];
|
|
1620
1828
|
satisfaction_feedback?: unknown;
|
|
1621
1829
|
ask_to_talk_to_human?: boolean;
|
|
1830
|
+
allowed_to_create_ticket?: boolean;
|
|
1831
|
+
ticket?: ToolCallTicketPrefill;
|
|
1832
|
+
mode?: "form" | "embed";
|
|
1833
|
+
ticket_form_id?: string;
|
|
1834
|
+
embed_html?: string;
|
|
1835
|
+
embed_description?: string;
|
|
1836
|
+
display_mode?: "collapsible" | "display" | "both";
|
|
1622
1837
|
/** Tool call ids still awaiting a client result, sent with the final `WAITING_CLIENT` event. */
|
|
1623
1838
|
waiting_tool_call_ids?: string[];
|
|
1624
1839
|
}
|
|
@@ -1672,12 +1887,82 @@ declare type SubmitConfig<V = Record<string, unknown>> = string | {
|
|
|
1672
1887
|
declare interface SubmitToolCallResult {
|
|
1673
1888
|
status: string;
|
|
1674
1889
|
result?: unknown;
|
|
1890
|
+
/** Set when `status` is `"error"`. */
|
|
1891
|
+
error?: string;
|
|
1892
|
+
/** The ticket a ticketing `form` tool call resolved to, when it did. */
|
|
1893
|
+
ticket?: {
|
|
1894
|
+
ticket_id: string;
|
|
1895
|
+
ticket_url?: string;
|
|
1896
|
+
[key: string]: unknown;
|
|
1897
|
+
};
|
|
1675
1898
|
resume?: {
|
|
1676
1899
|
message_id: string;
|
|
1677
1900
|
ready: boolean;
|
|
1678
1901
|
};
|
|
1679
1902
|
}
|
|
1680
1903
|
|
|
1904
|
+
/** A custom field of a ticket form. */
|
|
1905
|
+
declare interface TicketField {
|
|
1906
|
+
id: string;
|
|
1907
|
+
/** The key the ticketing backend expects; used as the submit key when set. */
|
|
1908
|
+
externalId?: string;
|
|
1909
|
+
title?: string;
|
|
1910
|
+
/** Field kind, e.g. `"text"`, `"checkbox"`, `"tagger"`. */
|
|
1911
|
+
type?: string;
|
|
1912
|
+
required: boolean;
|
|
1913
|
+
/** Carried in the submission but never shown. */
|
|
1914
|
+
hidden: boolean;
|
|
1915
|
+
active?: boolean;
|
|
1916
|
+
/** Bypass progressive disclosure, while still respecting conditions. */
|
|
1917
|
+
alwaysVisible?: boolean;
|
|
1918
|
+
regexpForValidation?: string;
|
|
1919
|
+
position: number;
|
|
1920
|
+
/** Non-empty turns the field into a select. */
|
|
1921
|
+
options: TicketFieldOption[];
|
|
1922
|
+
/** Show this field only when the parent field holds `conditionalFieldValue`. */
|
|
1923
|
+
conditionalFieldId?: string;
|
|
1924
|
+
/** Legacy comma-separated condition values. */
|
|
1925
|
+
conditionalFieldValue?: string;
|
|
1926
|
+
/** Takes precedence over conditionalFieldValue when non-empty. */
|
|
1927
|
+
conditionalFieldValues?: string[];
|
|
1928
|
+
}
|
|
1929
|
+
|
|
1930
|
+
/** An option of a ticket form field (`GET /config` → `ticket_form.fields[].options[]`). */
|
|
1931
|
+
declare interface TicketFieldOption {
|
|
1932
|
+
id: string;
|
|
1933
|
+
/** Label shown to the user. */
|
|
1934
|
+
name?: string;
|
|
1935
|
+
/** Value submitted. Falls back to `name` when absent. */
|
|
1936
|
+
value?: string;
|
|
1937
|
+
/** Preselected when the form opens. */
|
|
1938
|
+
default: boolean;
|
|
1939
|
+
/** A note shown under the field once this option is picked. */
|
|
1940
|
+
message?: string;
|
|
1941
|
+
messageType: "info" | "warning" | "danger";
|
|
1942
|
+
position?: number;
|
|
1943
|
+
group?: string;
|
|
1944
|
+
noDisplay?: boolean;
|
|
1945
|
+
conditionalFieldId?: string;
|
|
1946
|
+
/** Available when the parent matches any of these values. */
|
|
1947
|
+
conditionalFieldValues?: string[];
|
|
1948
|
+
}
|
|
1949
|
+
|
|
1950
|
+
/** The ticket form an agent's `ago_ticketing` tool opens in the conversation. */
|
|
1951
|
+
declare interface TicketForm {
|
|
1952
|
+
id: string;
|
|
1953
|
+
name?: string;
|
|
1954
|
+
/** `"form"` renders the SDK's own fields; `"embed"` hosts third-party HTML. */
|
|
1955
|
+
mode: "form" | "embed";
|
|
1956
|
+
showSubject: boolean;
|
|
1957
|
+
showBody: boolean;
|
|
1958
|
+
showPriority: boolean;
|
|
1959
|
+
showTypology: boolean;
|
|
1960
|
+
priorityTypologies?: string[];
|
|
1961
|
+
successMessageText?: string;
|
|
1962
|
+
successMessageUrlLabel?: string;
|
|
1963
|
+
fields: TicketField[];
|
|
1964
|
+
}
|
|
1965
|
+
|
|
1681
1966
|
/**
|
|
1682
1967
|
* Tool call data from SSE stream
|
|
1683
1968
|
*/
|
|
@@ -1692,6 +1977,34 @@ declare interface ToolCallData {
|
|
|
1692
1977
|
data?: Record<string, unknown>;
|
|
1693
1978
|
functionName?: string;
|
|
1694
1979
|
arguments?: Record<string, unknown>;
|
|
1980
|
+
/**
|
|
1981
|
+
* Where the hosted widget shows the call: in the collapsible "reasoning"
|
|
1982
|
+
* section, in the message body, or both. Absent means collapsible only.
|
|
1983
|
+
*/
|
|
1984
|
+
displayMode?: "collapsible" | "display" | "both";
|
|
1985
|
+
/** The user asked to talk to a human. */
|
|
1986
|
+
askToTalkToHuman?: boolean;
|
|
1987
|
+
/** `false` when the tenant blocks ticket creation for this visitor. */
|
|
1988
|
+
allowedToCreateTicket?: boolean;
|
|
1989
|
+
/** Fields the agent pre-filled from the conversation. */
|
|
1990
|
+
ticket?: ToolCallTicketPrefill;
|
|
1991
|
+
/** `"embed"` hosts third-party HTML (`embedHtml`); otherwise the SDK's form. */
|
|
1992
|
+
mode?: "form" | "embed";
|
|
1993
|
+
ticketFormId?: string;
|
|
1994
|
+
embedHtml?: string;
|
|
1995
|
+
embedDescription?: string;
|
|
1996
|
+
}
|
|
1997
|
+
|
|
1998
|
+
/** The ticket the agent pre-filled on a ticketing `form` tool call. */
|
|
1999
|
+
declare interface ToolCallTicketPrefill {
|
|
2000
|
+
subject?: string;
|
|
2001
|
+
body?: string;
|
|
2002
|
+
typology?: string;
|
|
2003
|
+
priority?: string;
|
|
2004
|
+
tag?: string;
|
|
2005
|
+
products?: string[];
|
|
2006
|
+
/** Keyed by the field's external id, or a lowercased, underscored title. */
|
|
2007
|
+
custom_fields?: Record<string, string>;
|
|
1695
2008
|
}
|
|
1696
2009
|
|
|
1697
2010
|
declare type ToolCallType = "form" | "confirmation_input" | "status_message" | "progress_indicator" | "client_function" | "reasoning" | "mcp_ui_resource";
|