cogito-client 1.0.44 → 1.0.46

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 CHANGED
@@ -73,6 +73,13 @@ export declare interface CogitoAudioSurface {
73
73
 
74
74
  export declare type CogitoBuiltInSurface = CogitoApprovalCardSurface | CogitoDataTableSurface | CogitoImageSurface | CogitoImageGallerySurface | CogitoVideoSurface | CogitoAudioSurface | CogitoTerminalSurface | CogitoQuestionFlowSurface | CogitoPreferencesPanelSurface | CogitoParameterSliderSurface | CogitoOptionListSurface | CogitoProgressTrackerSurface | CogitoPlanSurface | CogitoOrderSummarySurface | CogitoCitationSurface | CogitoCodeSurface | CogitoWeatherSurface | CogitoStatsDisplaySurface | CogitoItemCarouselSurface | CogitoChartSurface | CogitoLinkPreviewSurface;
75
75
 
76
+ export declare interface CogitoCallCompletedWebhook {
77
+ type?: "call-completed";
78
+ conversationId: string;
79
+ startTime?: string;
80
+ endTime?: string;
81
+ }
82
+
76
83
  export declare interface CogitoChartSurface {
77
84
  type: "chart";
78
85
  state: {
@@ -158,6 +165,11 @@ export declare interface CogitoCodeSurface {
158
165
 
159
166
  export declare interface CogitoConfig {
160
167
  agents?: CogitoAgent[];
168
+ webhooks?: {
169
+ events: ("message" | "call-completed")[];
170
+ uri: string;
171
+ [k: string]: unknown;
172
+ }[];
161
173
  [k: string]: unknown;
162
174
  }
163
175
 
@@ -460,6 +472,7 @@ export declare interface CogitoMessagePayload {
460
472
  export declare interface CogitoMessageWebhook {
461
473
  type?: "message";
462
474
  role: string;
475
+ conversationId?: string;
463
476
  content: string;
464
477
  }
465
478
 
@@ -1290,11 +1303,11 @@ export declare interface CogitoWeatherSurface {
1290
1303
  };
1291
1304
  }
1292
1305
 
1293
- export declare type CogitoWebhookPayload = CogitoMessageWebhook;
1306
+ export declare type CogitoWebhookPayload = CogitoMessageWebhook | CogitoCallCompletedWebhook;
1294
1307
 
1295
1308
  export declare type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'error';
1296
1309
 
1297
- export declare function useCogito({ mode, server, configuration }: UseCogitoOptions): {
1310
+ export declare function useCogito({ mode, server, configuration, id }: UseCogitoOptions): {
1298
1311
  messages: CogitoMessage[];
1299
1312
  connectionState: ConnectionState;
1300
1313
  isLoading: boolean;
@@ -1315,6 +1328,10 @@ declare interface UseCogitoOptions {
1315
1328
  server: string;
1316
1329
  mode: ChatMode;
1317
1330
  configuration: string;
1331
+ /** Optional unique identifier for localStorage conversation key.
1332
+ * When provided, each id gets its own conversation history.
1333
+ * Without it, all agents share a single global conversation. */
1334
+ id?: string;
1318
1335
  }
1319
1336
 
1320
1337
  export declare type UseCogitoReturn = ReturnType<typeof useCogito>;