@cimulate/copilot-sdk 3.6.0 → 3.7.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 (28) hide show
  1. package/dist/{bundle.cimulate.copilot-sdk.528903a1.umd.js → bundle.cimulate.copilot-sdk.19bd46a0.umd.js} +2 -2
  2. package/dist/{bundle.cimulate.copilot-sdk.a9e69ca5.cjs.js.map → bundle.cimulate.copilot-sdk.19bd46a0.umd.js.map} +1 -1
  3. package/dist/{bundle.cimulate.copilot-sdk.a9e69ca5.cjs.js → bundle.cimulate.copilot-sdk.2fdeb472.cjs.js} +2 -2
  4. package/dist/{bundle.cimulate.copilot-sdk.528903a1.umd.js.map → bundle.cimulate.copilot-sdk.2fdeb472.cjs.js.map} +1 -1
  5. package/dist/{bundle.cimulate.copilot-sdk.1fbe1d17.esm.js → bundle.cimulate.copilot-sdk.77727d1e.esm.js} +2 -2
  6. package/dist/{bundle.cimulate.copilot-sdk.1fbe1d17.esm.js.map → bundle.cimulate.copilot-sdk.77727d1e.esm.js.map} +1 -1
  7. package/dist/index.cjs.js +1 -1
  8. package/dist/index.cjs.js.map +1 -1
  9. package/dist/index.esm.js +1 -1
  10. package/dist/index.esm.js.map +1 -1
  11. package/dist/index.umd.js +1 -1
  12. package/dist/index.umd.js.map +1 -1
  13. package/dist/types/copilot.d.ts +5 -3
  14. package/dist/types/model/CopilotApiAck.d.ts +3 -2
  15. package/dist/types/model/FollowUp.d.ts +2 -1
  16. package/dist/types/model/ProductView.d.ts +6 -0
  17. package/dist/types/model/ProductViewAck.d.ts +10 -0
  18. package/dist/types/model/ProductViewSuggestion.d.ts +7 -0
  19. package/dist/types/model/index.d.ts +3 -0
  20. package/examples/conversationReset.ts +2 -2
  21. package/package.json +1 -1
  22. package/src/copilot.ts +23 -3
  23. package/src/model/CopilotApiAck.ts +3 -1
  24. package/src/model/FollowUp.ts +2 -1
  25. package/src/model/ProductView.ts +7 -0
  26. package/src/model/ProductViewAck.ts +10 -0
  27. package/src/model/ProductViewSuggestion.ts +7 -0
  28. package/src/model/index.ts +3 -0
@@ -3,8 +3,9 @@
3
3
  For any new event, manually create an entry here.
4
4
  */
5
5
  import { CancelAck } from "./CancelAck";
6
+ import { ConversationResetAck } from "./ConversationResetAck";
6
7
  import { CopilotError } from "./CopilotError";
7
8
  import { CopilotSearchAck } from "./CopilotSearchAck";
8
9
  import { FacetedNavigationAck } from "./FacetedNavigationAck";
9
- import { ConversationResetAck } from "./ConversationResetAck";
10
- export type CopilotAPIAck = CancelAck | CopilotSearchAck | ConversationResetAck | FacetedNavigationAck | CopilotError;
10
+ import { ProductViewAck } from "./ProductViewAck";
11
+ export type CopilotAPIAck = CancelAck | CopilotSearchAck | ConversationResetAck | FacetedNavigationAck | ProductViewAck | CopilotError;
@@ -1,12 +1,13 @@
1
1
  import { CopilotSearchSuggestion } from './CopilotSearchSuggestion';
2
2
  import { FacetedNavigationSuggestion } from './FacetedNavigationSuggestion';
3
+ import { ProductViewSuggestion } from './ProductViewSuggestion';
3
4
  interface FollowUp {
4
5
  sessionId: string;
5
6
  id: string;
6
7
  createdAt: string;
7
8
  eventSourceId: string;
8
9
  message: string;
9
- suggestions: (CopilotSearchSuggestion | FacetedNavigationSuggestion)[];
10
+ suggestions: (CopilotSearchSuggestion | FacetedNavigationSuggestion | ProductViewSuggestion)[];
10
11
  name: 'follow_up';
11
12
  }
12
13
  export { FollowUp };
@@ -0,0 +1,6 @@
1
+ interface ProductView {
2
+ productId: string;
3
+ pdpLink?: string;
4
+ userPrompt?: string;
5
+ }
6
+ export { ProductView };
@@ -0,0 +1,10 @@
1
+ import { ProductView } from './ProductView';
2
+ interface ProductViewAck {
3
+ name: 'product_view';
4
+ request: ProductView;
5
+ sessionId: string;
6
+ id: string;
7
+ createdAt: string;
8
+ status: number;
9
+ }
10
+ export { ProductViewAck };
@@ -0,0 +1,7 @@
1
+ import { ProductView } from './ProductView';
2
+ interface ProductViewSuggestion {
3
+ displayText: string;
4
+ action: 'product_view';
5
+ params: ProductView;
6
+ }
7
+ export { ProductViewSuggestion };
@@ -27,6 +27,9 @@ export * from './FollowUp';
27
27
  export * from './Inquiry';
28
28
  export * from './OperationAck';
29
29
  export * from './PartialInquiry';
30
+ export * from './ProductView';
31
+ export * from './ProductViewAck';
32
+ export * from './ProductViewSuggestion';
30
33
  export * from './Progress';
31
34
  export * from './ProgressToolKwargs';
32
35
  export * from './RefinedSearch';
@@ -26,11 +26,11 @@ async function main() {
26
26
  copilot.connect();
27
27
 
28
28
  console.log("Reset conversaton with empty payload");
29
- const response = await copilot.conversationResetRequest({});
29
+ const response = await copilot.conversationReset({});
30
30
  console.log("Conversation reset response: ", response);
31
31
 
32
32
  console.log("Reset conversaton with empty payload");
33
- const responseWithUserReason = await copilot.conversationResetRequest({
33
+ const responseWithUserReason = await copilot.conversationReset({
34
34
  reason: "Clear the copilot context."
35
35
  });
36
36
  console.log("Conversation reset response: ", responseWithUserReason);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cimulate/copilot-sdk",
3
- "version": "3.6.0",
3
+ "version": "3.7.0",
4
4
  "description": "A lightweight API client SDK for Cimulate Copilot",
5
5
  "files": [
6
6
  "dist/**",
package/src/copilot.ts CHANGED
@@ -13,6 +13,8 @@ import type {
13
13
  CopilotSearchAck,
14
14
  FacetedNavigation,
15
15
  FacetedNavigationAck,
16
+ ProductView,
17
+ ProductViewAck,
16
18
  ReturnedFields,
17
19
  SessionInformation,
18
20
  ConversationReset,
@@ -253,12 +255,12 @@ export default class CimulateCopilot<
253
255
  );
254
256
  }
255
257
 
256
- async conversationResetRequest(args: ConversationReset): Promise<CopilotResult<T, ConversationResetAck>>;
257
- async conversationResetRequest(
258
+ async conversationReset(args: ConversationReset): Promise<CopilotResult<T, ConversationResetAck>>;
259
+ async conversationReset(
258
260
  args: ConversationReset,
259
261
  callback?: (event: ConversationResetAck) => void
260
262
  ): Promise<void>;
261
- conversationResetRequest(
263
+ conversationReset(
262
264
  args: ConversationReset,
263
265
  callback?: (event: ConversationResetAck) => void
264
266
  ): Promise<CopilotResult<T, ConversationResetAck> | void> {
@@ -269,6 +271,24 @@ export default class CimulateCopilot<
269
271
  );
270
272
  }
271
273
 
274
+ async productView(
275
+ args: ProductView
276
+ ): Promise<CopilotResult<T, ProductViewAck>>;
277
+ async productView(
278
+ args: ProductView,
279
+ callback?: (event: ProductViewAck) => void
280
+ ): Promise<void>;
281
+ async productView(
282
+ args: ProductView,
283
+ callback?: (event: ProductViewAck) => void
284
+ ): Promise<CopilotResult<T, ProductViewAck> | void> {
285
+ return this.asyncResponse<ProductView, ProductViewAck>(
286
+ "product_view",
287
+ args,
288
+ callback
289
+ );
290
+ }
291
+
272
292
  async requestSessionInformation(): Promise<
273
293
  CopilotResult<T, SessionInformation>
274
294
  >;
@@ -3,14 +3,16 @@
3
3
  For any new event, manually create an entry here.
4
4
  */
5
5
  import { CancelAck } from "./CancelAck";
6
+ import { ConversationResetAck } from "./ConversationResetAck";
6
7
  import { CopilotError } from "./CopilotError";
7
8
  import { CopilotSearchAck } from "./CopilotSearchAck";
8
9
  import { FacetedNavigationAck } from "./FacetedNavigationAck";
9
- import { ConversationResetAck } from "./ConversationResetAck";
10
+ import { ProductViewAck } from "./ProductViewAck"
10
11
 
11
12
  export type CopilotAPIAck =
12
13
  | CancelAck
13
14
  | CopilotSearchAck
14
15
  | ConversationResetAck
15
16
  | FacetedNavigationAck
17
+ | ProductViewAck
16
18
  | CopilotError;
@@ -1,12 +1,13 @@
1
1
  import { CopilotSearchSuggestion } from './CopilotSearchSuggestion';
2
2
  import { FacetedNavigationSuggestion } from './FacetedNavigationSuggestion';
3
+ import { ProductViewSuggestion } from './ProductViewSuggestion';
3
4
  interface FollowUp {
4
5
  sessionId: string;
5
6
  id: string;
6
7
  createdAt: string;
7
8
  eventSourceId: string;
8
9
  message: string;
9
- suggestions: (CopilotSearchSuggestion | FacetedNavigationSuggestion)[];
10
+ suggestions: (CopilotSearchSuggestion | FacetedNavigationSuggestion | ProductViewSuggestion)[];
10
11
  name: 'follow_up';
11
12
  }
12
13
  export { FollowUp };
@@ -0,0 +1,7 @@
1
+
2
+ interface ProductView {
3
+ productId: string;
4
+ pdpLink?: string;
5
+ userPrompt?: string;
6
+ }
7
+ export { ProductView };
@@ -0,0 +1,10 @@
1
+ import { ProductView } from './ProductView';
2
+ interface ProductViewAck {
3
+ name: 'product_view';
4
+ request: ProductView;
5
+ sessionId: string;
6
+ id: string;
7
+ createdAt: string;
8
+ status: number;
9
+ }
10
+ export { ProductViewAck };
@@ -0,0 +1,7 @@
1
+ import { ProductView } from './ProductView';
2
+ interface ProductViewSuggestion {
3
+ displayText: string;
4
+ action: 'product_view';
5
+ params: ProductView;
6
+ }
7
+ export { ProductViewSuggestion };
@@ -27,6 +27,9 @@ export * from './FollowUp';
27
27
  export * from './Inquiry';
28
28
  export * from './OperationAck';
29
29
  export * from './PartialInquiry';
30
+ export * from './ProductView';
31
+ export * from './ProductViewAck';
32
+ export * from './ProductViewSuggestion';
30
33
  export * from './Progress';
31
34
  export * from './ProgressToolKwargs';
32
35
  export * from './RefinedSearch';