@wildix/wilma-copilot-sessions-client 1.0.7 → 1.0.8

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.
@@ -1,5 +1,5 @@
1
1
  import type { DocumentType as __DocumentType, StreamingBlobTypes } from "@smithy/types";
2
- import type { AssetIcon, AssetSeverity, ButtonVariant, CallDevice, CallParticipantRole, CallParticipantType, CallTranscriptionSpeaker, ConferenceParticipantRole, ConferenceParticipantType, CopilotConversationKind, CopilotIngestedSessionState, CopilotLifecycleReason, CopilotSessionStatus, License, LiveEventType, MessageSmsStatus, MessageType, MessageWhatsAppStatus, PbxLicenseType, TranscriptionSentiment } from "./enums";
2
+ import type { AssetIcon, AssetSeverity, ButtonVariant, CallDevice, CallParticipantRole, CallParticipantType, CallTranscriptionSpeaker, ConferenceParticipantRole, ConferenceParticipantType, CopilotActionStatus, CopilotConversationKind, CopilotIngestedSessionState, CopilotLifecycleReason, CopilotSessionStatus, License, LiveEventType, MessageSmsStatus, MessageType, MessageWhatsAppStatus, PbxLicenseType, TranscriptionSentiment } from "./enums";
3
3
  /**
4
4
  * @public
5
5
  */
@@ -423,6 +423,114 @@ export interface ConferenceAnalyticsLiveTranscriptionEvent {
423
423
  chunk: ConferenceTranscriptionChunk;
424
424
  participant?: ConferenceParticipant | undefined;
425
425
  }
426
+ /**
427
+ * Launches the knowledge search suggested for a detected question (contextual knowledge answers, `suggest_action` mode).
428
+ * @public
429
+ */
430
+ export interface KnowledgeSearchClientAction {
431
+ /**
432
+ * The suggested question's id — the `questionId` carried by the suggestion asset's action payload.
433
+ * @public
434
+ */
435
+ questionId: string;
436
+ /**
437
+ * The question text; used when the suggestion is no longer part of the live session state (e.g. after a revive).
438
+ * @public
439
+ */
440
+ question?: string | undefined;
441
+ }
442
+ /**
443
+ * Invokes one smart action offered by an asset.
444
+ * @public
445
+ */
446
+ export interface SmartActionClientAction {
447
+ /**
448
+ * Id of the asset carrying the smart action.
449
+ * @public
450
+ */
451
+ assetId: string;
452
+ /**
453
+ * Id of the clicked action inside the asset's smart-action list.
454
+ * @public
455
+ */
456
+ actionId: string;
457
+ /**
458
+ * Values for `guided` variable bindings collected from the user, keyed by variable name.
459
+ * @public
460
+ */
461
+ variables?: __DocumentType | undefined;
462
+ }
463
+ /**
464
+ * One user interaction with copilot output. Exactly one member is set.
465
+ * @public
466
+ */
467
+ export type CopilotClientAction = CopilotClientAction.KnowledgeSearchMember | CopilotClientAction.SmartActionMember | CopilotClientAction.$UnknownMember;
468
+ /**
469
+ * @public
470
+ */
471
+ export declare namespace CopilotClientAction {
472
+ /**
473
+ * Launches the knowledge search suggested for a detected question (contextual knowledge answers, `suggest_action` mode).
474
+ * @public
475
+ */
476
+ interface KnowledgeSearchMember {
477
+ knowledgeSearch: KnowledgeSearchClientAction;
478
+ smartAction?: never;
479
+ $unknown?: never;
480
+ }
481
+ /**
482
+ * Invokes one smart action offered by an asset.
483
+ * @public
484
+ */
485
+ interface SmartActionMember {
486
+ knowledgeSearch?: never;
487
+ smartAction: SmartActionClientAction;
488
+ $unknown?: never;
489
+ }
490
+ /**
491
+ * @public
492
+ */
493
+ interface $UnknownMember {
494
+ knowledgeSearch?: never;
495
+ smartAction?: never;
496
+ $unknown: [string, any];
497
+ }
498
+ /**
499
+ * @deprecated unused in schema-serde mode.
500
+ *
501
+ */
502
+ interface Visitor<T> {
503
+ knowledgeSearch: (value: KnowledgeSearchClientAction) => T;
504
+ smartAction: (value: SmartActionClientAction) => T;
505
+ _: (name: string, value: any) => T;
506
+ }
507
+ }
508
+ /**
509
+ * @public
510
+ */
511
+ export interface ActInput {
512
+ sessionId: string;
513
+ /**
514
+ * Company that owns the session. Required when calling with a service (s2s) token, which is not scoped to a single company.
515
+ * @public
516
+ */
517
+ company?: string | undefined;
518
+ /**
519
+ * One user interaction with copilot output. Exactly one member is set.
520
+ * @public
521
+ */
522
+ action: CopilotClientAction;
523
+ }
524
+ /**
525
+ * @public
526
+ */
527
+ export interface ActOutput {
528
+ /**
529
+ * True when the action was accepted into the session mailbox. Follow the event log for outcomes.
530
+ * @public
531
+ */
532
+ accepted: boolean;
533
+ }
426
534
  /**
427
535
  * @public
428
536
  */
@@ -458,6 +566,48 @@ export interface AskOutput {
458
566
  */
459
567
  index: number;
460
568
  }
569
+ /**
570
+ * A client action recorded in the session with its execution outcome. Emitted when the action is accepted (`launched`) and re-emitted when its execution settles (`completed` / `failed`).
571
+ * @public
572
+ */
573
+ export interface CopilotActionEvent {
574
+ /**
575
+ * Monotonic per-session event index. Drives resumption: pass `index + 1` of the last seen event as `startIndex` when reconnecting.
576
+ * @public
577
+ */
578
+ index: number;
579
+ /**
580
+ * ISO-8601 time the event was recorded.
581
+ * @public
582
+ */
583
+ timestamp: string;
584
+ /**
585
+ * Id of the asset the action belongs to.
586
+ * @public
587
+ */
588
+ id: string;
589
+ /**
590
+ * What was invoked: `knowledge_search`, `runAgent`, `runTool`, `transfer`, `handover` or `openUrl`.
591
+ * @public
592
+ */
593
+ kind: string;
594
+ status: CopilotActionStatus;
595
+ /**
596
+ * The user who triggered the action.
597
+ * @public
598
+ */
599
+ userId?: string | undefined;
600
+ /**
601
+ * Execution result payload, for smart actions with `show_card` result mode.
602
+ * @public
603
+ */
604
+ result?: __DocumentType | undefined;
605
+ /**
606
+ * Failure description when status is `failed`.
607
+ * @public
608
+ */
609
+ error?: string | undefined;
610
+ }
461
611
  /**
462
612
  * An ask recorded in the session. The ask itself runs as a regular Wilma session (wilma-assistant); any agent in the company can render its output by presenting `accessToken` to wilma-assistant — copilot sessions are shared within the tenant.
463
613
  * @public
@@ -519,6 +669,18 @@ export interface CopilotAssetEvent {
519
669
  content?: string | undefined;
520
670
  state: __DocumentType;
521
671
  }
672
+ /**
673
+ * One asset the user actually saw rendered in the copilot panel.
674
+ * @public
675
+ */
676
+ export interface CopilotAssetView {
677
+ assetId: string;
678
+ /**
679
+ * When the asset became visible. Defaults to the time the report is ingested.
680
+ * @public
681
+ */
682
+ at?: string | undefined;
683
+ }
522
684
  /**
523
685
  * An assistant chat shown or updated in the session.
524
686
  * @public
@@ -756,7 +918,7 @@ export interface CopilotTranscriptionEvent {
756
918
  * A single typed copilot session event. Exactly one member is set; the member name doubles as the `event:` field of the SSE frames produced by StreamSessionEvents.
757
919
  * @public
758
920
  */
759
- export type CopilotSessionEvent = CopilotSessionEvent.AskMember | CopilotSessionEvent.AssetMember | CopilotSessionEvent.AssistantMember | CopilotSessionEvent.EvaluationMember | CopilotSessionEvent.IntentMember | CopilotSessionEvent.LifecycleMember | CopilotSessionEvent.RelationshipMember | CopilotSessionEvent.TranscriptMember | CopilotSessionEvent.$UnknownMember;
921
+ export type CopilotSessionEvent = CopilotSessionEvent.ActionMember | CopilotSessionEvent.AskMember | CopilotSessionEvent.AssetMember | CopilotSessionEvent.AssistantMember | CopilotSessionEvent.EvaluationMember | CopilotSessionEvent.IntentMember | CopilotSessionEvent.LifecycleMember | CopilotSessionEvent.RelationshipMember | CopilotSessionEvent.TranscriptMember | CopilotSessionEvent.$UnknownMember;
760
922
  /**
761
923
  * @public
762
924
  */
@@ -774,6 +936,7 @@ export declare namespace CopilotSessionEvent {
774
936
  assistant?: never;
775
937
  relationship?: never;
776
938
  ask?: never;
939
+ action?: never;
777
940
  $unknown?: never;
778
941
  }
779
942
  /**
@@ -789,6 +952,7 @@ export declare namespace CopilotSessionEvent {
789
952
  assistant?: never;
790
953
  relationship?: never;
791
954
  ask?: never;
955
+ action?: never;
792
956
  $unknown?: never;
793
957
  }
794
958
  /**
@@ -804,6 +968,7 @@ export declare namespace CopilotSessionEvent {
804
968
  assistant?: never;
805
969
  relationship?: never;
806
970
  ask?: never;
971
+ action?: never;
807
972
  $unknown?: never;
808
973
  }
809
974
  /**
@@ -819,6 +984,7 @@ export declare namespace CopilotSessionEvent {
819
984
  assistant?: never;
820
985
  relationship?: never;
821
986
  ask?: never;
987
+ action?: never;
822
988
  $unknown?: never;
823
989
  }
824
990
  /**
@@ -834,6 +1000,7 @@ export declare namespace CopilotSessionEvent {
834
1000
  assistant?: never;
835
1001
  relationship?: never;
836
1002
  ask?: never;
1003
+ action?: never;
837
1004
  $unknown?: never;
838
1005
  }
839
1006
  /**
@@ -849,6 +1016,7 @@ export declare namespace CopilotSessionEvent {
849
1016
  assistant: CopilotAssistantEvent;
850
1017
  relationship?: never;
851
1018
  ask?: never;
1019
+ action?: never;
852
1020
  $unknown?: never;
853
1021
  }
854
1022
  /**
@@ -864,6 +1032,7 @@ export declare namespace CopilotSessionEvent {
864
1032
  assistant?: never;
865
1033
  relationship: CopilotRelationshipEvent;
866
1034
  ask?: never;
1035
+ action?: never;
867
1036
  $unknown?: never;
868
1037
  }
869
1038
  /**
@@ -879,6 +1048,23 @@ export declare namespace CopilotSessionEvent {
879
1048
  assistant?: never;
880
1049
  relationship?: never;
881
1050
  ask: CopilotAskEvent;
1051
+ action?: never;
1052
+ $unknown?: never;
1053
+ }
1054
+ /**
1055
+ * A client action recorded in the session with its execution outcome. Emitted when the action is accepted (`launched`) and re-emitted when its execution settles (`completed` / `failed`).
1056
+ * @public
1057
+ */
1058
+ interface ActionMember {
1059
+ lifecycle?: never;
1060
+ transcript?: never;
1061
+ intent?: never;
1062
+ evaluation?: never;
1063
+ asset?: never;
1064
+ assistant?: never;
1065
+ relationship?: never;
1066
+ ask?: never;
1067
+ action: CopilotActionEvent;
882
1068
  $unknown?: never;
883
1069
  }
884
1070
  /**
@@ -893,6 +1079,7 @@ export declare namespace CopilotSessionEvent {
893
1079
  assistant?: never;
894
1080
  relationship?: never;
895
1081
  ask?: never;
1082
+ action?: never;
896
1083
  $unknown: [string, any];
897
1084
  }
898
1085
  /**
@@ -908,6 +1095,7 @@ export declare namespace CopilotSessionEvent {
908
1095
  assistant: (value: CopilotAssistantEvent) => T;
909
1096
  relationship: (value: CopilotRelationshipEvent) => T;
910
1097
  ask: (value: CopilotAskEvent) => T;
1098
+ action: (value: CopilotActionEvent) => T;
911
1099
  _: (name: string, value: any) => T;
912
1100
  }
913
1101
  }
@@ -1125,3 +1313,25 @@ export interface StreamSessionEventsOutput {
1125
1313
  events: StreamingBlobTypes;
1126
1314
  contentType: string;
1127
1315
  }
1316
+ /**
1317
+ * @public
1318
+ */
1319
+ export interface TrackInput {
1320
+ sessionId: string;
1321
+ /**
1322
+ * Company that owns the session. Required when calling with a service (s2s) token, which is not scoped to a single company.
1323
+ * @public
1324
+ */
1325
+ company?: string | undefined;
1326
+ views: CopilotAssetView[];
1327
+ }
1328
+ /**
1329
+ * @public
1330
+ */
1331
+ export interface TrackOutput {
1332
+ /**
1333
+ * True when the views were recorded.
1334
+ * @public
1335
+ */
1336
+ accepted: boolean;
1337
+ }
@@ -19,10 +19,14 @@ export declare var ChatAnalyticsLiveTranscriptionEvent$: StaticStructureSchema;
19
19
  export declare var ConferenceAnalyticsLiveTranscriptionEvent$: StaticStructureSchema;
20
20
  export declare var ConferenceParticipant$: StaticStructureSchema;
21
21
  export declare var ConferenceTranscriptionChunk$: StaticStructureSchema;
22
+ export declare var ActInput$: StaticStructureSchema;
23
+ export declare var ActOutput$: StaticStructureSchema;
22
24
  export declare var AskInput$: StaticStructureSchema;
23
25
  export declare var AskOutput$: StaticStructureSchema;
26
+ export declare var CopilotActionEvent$: StaticStructureSchema;
24
27
  export declare var CopilotAskEvent$: StaticStructureSchema;
25
28
  export declare var CopilotAssetEvent$: StaticStructureSchema;
29
+ export declare var CopilotAssetView$: StaticStructureSchema;
26
30
  export declare var CopilotAssistantEvent$: StaticStructureSchema;
27
31
  export declare var CopilotContextConversation$: StaticStructureSchema;
28
32
  export declare var CopilotContextEntity$: StaticStructureSchema;
@@ -38,14 +42,18 @@ export declare var EnrichInput$: StaticStructureSchema;
38
42
  export declare var EnrichOutput$: StaticStructureSchema;
39
43
  export declare var GetSessionEventsInput$: StaticStructureSchema;
40
44
  export declare var GetSessionEventsOutput$: StaticStructureSchema;
45
+ export declare var KnowledgeSearchClientAction$: StaticStructureSchema;
41
46
  export declare var ListSessionsInput$: StaticStructureSchema;
42
47
  export declare var ListSessionsOutput$: StaticStructureSchema;
43
48
  export declare var OpenInput$: StaticStructureSchema;
44
49
  export declare var OpenOutput$: StaticStructureSchema;
45
50
  export declare var ResolveInput$: StaticStructureSchema;
46
51
  export declare var ResolveOutput$: StaticStructureSchema;
52
+ export declare var SmartActionClientAction$: StaticStructureSchema;
47
53
  export declare var StreamSessionEventsInput$: StaticStructureSchema;
48
54
  export declare var StreamSessionEventsOutput$: StaticStructureSchema;
55
+ export declare var TrackInput$: StaticStructureSchema;
56
+ export declare var TrackOutput$: StaticStructureSchema;
49
57
  export declare var ButtonActionHandler$: StaticStructureSchema;
50
58
  export declare var ButtonElement$: StaticStructureSchema;
51
59
  export declare var ButtonLinkHandler$: StaticStructureSchema;
@@ -58,11 +66,13 @@ export declare var MessageQuote$: StaticStructureSchema;
58
66
  export declare var MessageTemplateConfig$: StaticStructureSchema;
59
67
  export declare var Reaction$: StaticStructureSchema;
60
68
  export declare var User$: StaticStructureSchema;
69
+ export declare var CopilotClientAction$: StaticUnionSchema;
61
70
  export declare var CopilotSessionEvent$: StaticUnionSchema;
62
71
  export declare var CopilotTranscriptionData$: StaticUnionSchema;
63
72
  export declare var ActionElement$: StaticUnionSchema;
64
73
  export declare var ButtonHandler$: StaticUnionSchema;
65
74
  export declare var Element$: StaticUnionSchema;
75
+ export declare var Act$: StaticOperationSchema;
66
76
  export declare var Ask$: StaticOperationSchema;
67
77
  export declare var Enrich$: StaticOperationSchema;
68
78
  export declare var GetSessionEvents$: StaticOperationSchema;
@@ -70,3 +80,4 @@ export declare var ListSessions$: StaticOperationSchema;
70
80
  export declare var Open$: StaticOperationSchema;
71
81
  export declare var Resolve$: StaticOperationSchema;
72
82
  export declare var StreamSessionEvents$: StaticOperationSchema;
83
+ export declare var Track$: StaticOperationSchema;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wildix/wilma-copilot-sessions-client",
3
3
  "description": "@wildix/wilma-copilot-sessions-client client",
4
- "version": "1.0.7",
4
+ "version": "1.0.8",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "tsc -p tsconfig.cjs.json",