cogito-client 1.0.43 → 1.0.45
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.ts +50 -3
- package/dist/index.js +2258 -2255
- package/dist/index.umd.cjs +7 -7
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -158,12 +158,27 @@ export declare interface CogitoCodeSurface {
|
|
|
158
158
|
|
|
159
159
|
export declare interface CogitoConfig {
|
|
160
160
|
agents?: CogitoAgent[];
|
|
161
|
+
webhooks?: {
|
|
162
|
+
events: "message"[];
|
|
163
|
+
uri: string;
|
|
164
|
+
[k: string]: unknown;
|
|
165
|
+
}[];
|
|
161
166
|
[k: string]: unknown;
|
|
162
167
|
}
|
|
163
168
|
|
|
164
169
|
export declare interface CogitoConversation {
|
|
165
170
|
id: string;
|
|
166
171
|
configuration: CogitoConfig;
|
|
172
|
+
from?: string;
|
|
173
|
+
to?: string;
|
|
174
|
+
/**
|
|
175
|
+
* The URL to use to blind transfer calls
|
|
176
|
+
*/
|
|
177
|
+
phoneBlindTransferUrl?: string;
|
|
178
|
+
/**
|
|
179
|
+
* The LiveKit trunk ID for the outbound trunk
|
|
180
|
+
*/
|
|
181
|
+
phoneOutboundSipTrunkId?: string;
|
|
167
182
|
messages: CogitoMessage[];
|
|
168
183
|
[k: string]: unknown;
|
|
169
184
|
}
|
|
@@ -289,7 +304,26 @@ export declare interface CogitoFunctionTool {
|
|
|
289
304
|
export declare interface CogitoHandoffTool {
|
|
290
305
|
type: "handoff";
|
|
291
306
|
description?: string;
|
|
292
|
-
|
|
307
|
+
targetType?: "agent" | "phone_blind" | "phone_warm";
|
|
308
|
+
/**
|
|
309
|
+
* The channel specific address of the target e.g. to transfer to another agent, use the ID of the agent, to transfer to a phone use the e164 number to transfer to
|
|
310
|
+
*/
|
|
311
|
+
targetAddress?: string;
|
|
312
|
+
/**
|
|
313
|
+
* The name of the party transferring to
|
|
314
|
+
*/
|
|
315
|
+
targetName?: string;
|
|
316
|
+
/**
|
|
317
|
+
* The message to say to the caller before putting them on hold during the transfer process
|
|
318
|
+
*/
|
|
319
|
+
messageToCaller?: string;
|
|
320
|
+
/**
|
|
321
|
+
* A templated message to the party being transferred to. You can insert parameter values into this message e.g. 'I have {caller_name} on the line
|
|
322
|
+
*/
|
|
323
|
+
messageToTransfer?: string;
|
|
324
|
+
/**
|
|
325
|
+
* The object parameters used for the tool definition that will be provided to the LLM, e.g. you could supply a caller_name and reason_for_call property to collect those from the caller
|
|
326
|
+
*/
|
|
293
327
|
parameters?: {
|
|
294
328
|
[k: string]: unknown;
|
|
295
329
|
};
|
|
@@ -428,6 +462,13 @@ export declare interface CogitoMessagePayload {
|
|
|
428
462
|
message: CogitoMessage;
|
|
429
463
|
}
|
|
430
464
|
|
|
465
|
+
export declare interface CogitoMessageWebhook {
|
|
466
|
+
type?: "message";
|
|
467
|
+
role: string;
|
|
468
|
+
conversationId?: string;
|
|
469
|
+
content: string;
|
|
470
|
+
}
|
|
471
|
+
|
|
431
472
|
export declare interface CogitoOptionListSurface {
|
|
432
473
|
type: "option-list";
|
|
433
474
|
state: {
|
|
@@ -787,7 +828,7 @@ export declare interface CogitoReadyPayload {
|
|
|
787
828
|
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
788
829
|
* and run json-schema-to-typescript to regenerate this file.
|
|
789
830
|
*/
|
|
790
|
-
export declare type CogitoSchema = CogitoConfig | CogitoMessage | CogitoConversation | CogitoPayload | CogitoSurfaceDefinition | CogitoSurfaceUpdate | CogitoBuiltInSurface;
|
|
831
|
+
export declare type CogitoSchema = CogitoConfig | CogitoMessage | CogitoWebhookPayload | CogitoConversation | CogitoPayload | CogitoSurfaceDefinition | CogitoSurfaceUpdate | CogitoBuiltInSurface;
|
|
791
832
|
|
|
792
833
|
export declare interface CogitoStatsDisplaySurface {
|
|
793
834
|
type: "stats-display";
|
|
@@ -1255,9 +1296,11 @@ export declare interface CogitoWeatherSurface {
|
|
|
1255
1296
|
};
|
|
1256
1297
|
}
|
|
1257
1298
|
|
|
1299
|
+
export declare type CogitoWebhookPayload = CogitoMessageWebhook;
|
|
1300
|
+
|
|
1258
1301
|
export declare type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'error';
|
|
1259
1302
|
|
|
1260
|
-
export declare function useCogito({ mode, server, configuration }: UseCogitoOptions): {
|
|
1303
|
+
export declare function useCogito({ mode, server, configuration, id }: UseCogitoOptions): {
|
|
1261
1304
|
messages: CogitoMessage[];
|
|
1262
1305
|
connectionState: ConnectionState;
|
|
1263
1306
|
isLoading: boolean;
|
|
@@ -1278,6 +1321,10 @@ declare interface UseCogitoOptions {
|
|
|
1278
1321
|
server: string;
|
|
1279
1322
|
mode: ChatMode;
|
|
1280
1323
|
configuration: string;
|
|
1324
|
+
/** Optional unique identifier for localStorage conversation key.
|
|
1325
|
+
* When provided, each id gets its own conversation history.
|
|
1326
|
+
* Without it, all agents share a single global conversation. */
|
|
1327
|
+
id?: string;
|
|
1281
1328
|
}
|
|
1282
1329
|
|
|
1283
1330
|
export declare type UseCogitoReturn = ReturnType<typeof useCogito>;
|