@wildix/wilma-copilot-sessions-client 1.0.13 → 1.0.15

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,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TrackInput$ = exports.StreamSessionEventsOutput$ = exports.StreamSessionEventsInput$ = exports.SmartActionClientAction$ = exports.ResolveOutput$ = exports.ResolveInput$ = exports.OpenOutput$ = exports.OpenInput$ = exports.ListSessionsOutput$ = exports.ListSessionsInput$ = exports.ListRelationshipSessionsOutput$ = exports.ListRelationshipSessionsInput$ = exports.KnowledgeSearchClientAction$ = exports.GetSessionEventsOutput$ = exports.GetSessionEventsInput$ = exports.EnrichOutput$ = exports.EnrichInput$ = exports.CopilotTranscriptionEvent$ = exports.CopilotSessionSummary$ = exports.CopilotRelationshipEvent$ = exports.CopilotLifecycleEvent$ = exports.CopilotIntentEvent$ = exports.CopilotIngestedSession$ = exports.CopilotEvaluationEvent$ = exports.CopilotContextLookup$ = exports.CopilotContextEntity$ = exports.CopilotContextConversation$ = exports.CopilotAssistantEvent$ = exports.CopilotAssetView$ = exports.CopilotAssetEvent$ = exports.CopilotAskEvent$ = exports.CopilotActionEvent$ = exports.AskOutput$ = exports.AskInput$ = exports.ActOutput$ = exports.ActInput$ = exports.ConferenceTranscriptionChunk$ = exports.ConferenceParticipant$ = exports.ConferenceAnalyticsLiveTranscriptionEvent$ = exports.ChatAnalyticsLiveTranscriptionEvent$ = exports.CallTranscriptionChunk$ = exports.CallParticipant$ = exports.CallAnalyticsLiveTranscriptionEvent$ = exports.TemplateWithParameters$ = exports.TemplateParameter$ = exports.errorTypeRegistries = exports.ValidationException$ = exports.NotFoundException$ = exports.ForbiddenException$ = exports.WilmaCopilotSessionsServiceException$ = void 0;
4
- exports.Track$ = exports.StreamSessionEvents$ = exports.Resolve$ = exports.Open$ = exports.ListSessions$ = exports.ListRelationshipSessions$ = exports.GetSessionEvents$ = exports.Enrich$ = exports.Ask$ = exports.Act$ = exports.Element$ = exports.ButtonHandler$ = exports.ActionElement$ = exports.CopilotTranscriptionData$ = exports.CopilotSessionEvent$ = exports.CopilotClientAction$ = exports.User$ = exports.Reaction$ = exports.MessageTemplateConfig$ = exports.MessageQuote$ = exports.MessageGiphy$ = exports.MessageForward$ = exports.MessageAttachment$ = exports.Message$ = exports.ButtonReplyHandler$ = exports.ButtonLinkHandler$ = exports.ButtonElement$ = exports.ButtonActionHandler$ = exports.TrackOutput$ = void 0;
3
+ exports.StreamSessionEventsOutput$ = exports.StreamSessionEventsInput$ = exports.SmartActionClientAction$ = exports.ResolveOutput$ = exports.ResolveInput$ = exports.PlaybookClientAction$ = exports.OpenOutput$ = exports.OpenInput$ = exports.ListSessionsOutput$ = exports.ListSessionsInput$ = exports.ListRelationshipSessionsOutput$ = exports.ListRelationshipSessionsInput$ = exports.KnowledgeSearchClientAction$ = exports.GetSessionEventsOutput$ = exports.GetSessionEventsInput$ = exports.EnrichOutput$ = exports.EnrichInput$ = exports.CopilotTranscriptionEvent$ = exports.CopilotSessionSummary$ = exports.CopilotRelationshipEvent$ = exports.CopilotLifecycleEvent$ = exports.CopilotIntentEvent$ = exports.CopilotIngestedSession$ = exports.CopilotEvaluationEvent$ = exports.CopilotContextLookup$ = exports.CopilotContextEntity$ = exports.CopilotContextConversation$ = exports.CopilotAssistantEvent$ = exports.CopilotAssetView$ = exports.CopilotAssetEvent$ = exports.CopilotAskEvent$ = exports.CopilotActionEvent$ = exports.AskOutput$ = exports.AskInput$ = exports.ActOutput$ = exports.ActInput$ = exports.ConferenceTranscriptionChunk$ = exports.ConferenceParticipant$ = exports.ConferenceAnalyticsLiveTranscriptionEvent$ = exports.ChatAnalyticsLiveTranscriptionEvent$ = exports.CallTranscriptionChunk$ = exports.CallParticipant$ = exports.CallAnalyticsLiveTranscriptionEvent$ = exports.TemplateWithParameters$ = exports.TemplateParameter$ = exports.errorTypeRegistries = exports.ValidationException$ = exports.NotFoundException$ = exports.ForbiddenException$ = exports.WilmaCopilotSessionsServiceException$ = void 0;
4
+ exports.Track$ = exports.StreamSessionEvents$ = exports.Resolve$ = exports.Open$ = exports.ListSessions$ = exports.ListRelationshipSessions$ = exports.GetSessionEvents$ = exports.Enrich$ = exports.Ask$ = exports.Act$ = exports.Element$ = exports.ButtonHandler$ = exports.ActionElement$ = exports.CopilotTranscriptionData$ = exports.CopilotSessionEvent$ = exports.CopilotClientAction$ = exports.User$ = exports.Reaction$ = exports.MessageTemplateConfig$ = exports.MessageQuote$ = exports.MessageGiphy$ = exports.MessageForward$ = exports.MessageAttachment$ = exports.Message$ = exports.ButtonReplyHandler$ = exports.ButtonLinkHandler$ = exports.ButtonElement$ = exports.ButtonActionHandler$ = exports.TrackOutput$ = exports.TrackInput$ = void 0;
5
5
  const _A = "Act";
6
6
  const _AE = "ActionElement";
7
7
  const _AEL = "ActionsElementsList";
@@ -74,6 +74,7 @@ const _NFE = "NotFoundException";
74
74
  const _O = "Open";
75
75
  const _OI = "OpenInput";
76
76
  const _OO = "OpenOutput";
77
+ const _PCA = "PlaybookClientAction";
77
78
  const _R = "Reaction";
78
79
  const _RI = "ResolveInput";
79
80
  const _RL = "ReactionList";
@@ -116,6 +117,7 @@ const _ca = "call";
116
117
  const _ch = "chunk";
117
118
  const _cha = "chat";
118
119
  const _co = "company";
120
+ const _com = "complete";
119
121
  const _con = "confidence";
120
122
  const _conf = "conference";
121
123
  const _cont = "content";
@@ -192,6 +194,7 @@ const _pb = "pbx";
192
194
  const _ph = "phone";
193
195
  const _pho = "phones";
194
196
  const _pi = "picture";
197
+ const _pl = "playbook";
195
198
  const _q = "question";
196
199
  const _qI = "questionId";
197
200
  const _qu = "quote";
@@ -209,6 +212,7 @@ const _sAm = "smartAction";
209
212
  const _sCI = "sipCallId";
210
213
  const _sI = "sessionId";
211
214
  const _sIt = "startIndex";
215
+ const _sIte = "stepIds";
212
216
  const _sS = "smsStatus";
213
217
  const _se = "sentiment";
214
218
  const _ses = "sessions";
@@ -224,6 +228,7 @@ const _state = "state";
224
228
  const _sti = "sticky";
225
229
  const _sty = "styling";
226
230
  const _t = "time";
231
+ const _tI = "traceId";
227
232
  const _tST = "transcriptionStartTime";
228
233
  const _tZ = "timeZone";
229
234
  const _te = "text";
@@ -406,8 +411,8 @@ exports.CopilotIntentEvent$ = [3, n1, _CIE,
406
411
  ];
407
412
  exports.CopilotLifecycleEvent$ = [3, n1, _CLE,
408
413
  0,
409
- [_in, _ti, _sI, _stat, _rea],
410
- [1, 0, 0, 0, 0], 4
414
+ [_in, _ti, _sI, _stat, _tI, _rea],
415
+ [1, 0, 0, 0, 0, 0], 4
411
416
  ];
412
417
  exports.CopilotRelationshipEvent$ = [3, n1, _CRE,
413
418
  0,
@@ -479,6 +484,11 @@ exports.OpenOutput$ = [3, n1, _OO,
479
484
  [_rI, _sess, _rel],
480
485
  [0, () => exports.CopilotIngestedSession$, () => CopilotSessionSummaryList], 3
481
486
  ];
487
+ exports.PlaybookClientAction$ = [3, n1, _PCA,
488
+ 0,
489
+ [_aI, _sIte, _com],
490
+ [0, 64 | 0, 2], 1
491
+ ];
482
492
  exports.ResolveInput$ = [3, n1, _RI,
483
493
  0,
484
494
  [_loo, _co],
@@ -592,6 +602,7 @@ var CopilotSessionEvents = [1, n1, _CSE,
592
602
  var CopilotSessionSummaryList = [1, n1, _CSSL,
593
603
  0, () => exports.CopilotSessionSummary$
594
604
  ];
605
+ var PlaybookStepIdList = 64 | 0;
595
606
  var ActionsElementsList = [1, n4, _AEL,
596
607
  0, () => exports.ActionElement$
597
608
  ];
@@ -611,8 +622,8 @@ var CopilotContextAttributes = 128 | 0;
611
622
  var ReactionCounts = 128 | 1;
612
623
  exports.CopilotClientAction$ = [4, n1, _CCA,
613
624
  0,
614
- [_kS, _sAm],
615
- [() => exports.KnowledgeSearchClientAction$, () => exports.SmartActionClientAction$]
625
+ [_kS, _sAm, _pl],
626
+ [() => exports.KnowledgeSearchClientAction$, () => exports.SmartActionClientAction$, () => exports.PlaybookClientAction$]
616
627
  ];
617
628
  exports.CopilotSessionEvent$ = [4, n1, _CSEo,
618
629
  0,
@@ -70,6 +70,7 @@ const _NFE = "NotFoundException";
70
70
  const _O = "Open";
71
71
  const _OI = "OpenInput";
72
72
  const _OO = "OpenOutput";
73
+ const _PCA = "PlaybookClientAction";
73
74
  const _R = "Reaction";
74
75
  const _RI = "ResolveInput";
75
76
  const _RL = "ReactionList";
@@ -112,6 +113,7 @@ const _ca = "call";
112
113
  const _ch = "chunk";
113
114
  const _cha = "chat";
114
115
  const _co = "company";
116
+ const _com = "complete";
115
117
  const _con = "confidence";
116
118
  const _conf = "conference";
117
119
  const _cont = "content";
@@ -188,6 +190,7 @@ const _pb = "pbx";
188
190
  const _ph = "phone";
189
191
  const _pho = "phones";
190
192
  const _pi = "picture";
193
+ const _pl = "playbook";
191
194
  const _q = "question";
192
195
  const _qI = "questionId";
193
196
  const _qu = "quote";
@@ -205,6 +208,7 @@ const _sAm = "smartAction";
205
208
  const _sCI = "sipCallId";
206
209
  const _sI = "sessionId";
207
210
  const _sIt = "startIndex";
211
+ const _sIte = "stepIds";
208
212
  const _sS = "smsStatus";
209
213
  const _se = "sentiment";
210
214
  const _ses = "sessions";
@@ -220,6 +224,7 @@ const _state = "state";
220
224
  const _sti = "sticky";
221
225
  const _sty = "styling";
222
226
  const _t = "time";
227
+ const _tI = "traceId";
223
228
  const _tST = "transcriptionStartTime";
224
229
  const _tZ = "timeZone";
225
230
  const _te = "text";
@@ -402,8 +407,8 @@ export var CopilotIntentEvent$ = [3, n1, _CIE,
402
407
  ];
403
408
  export var CopilotLifecycleEvent$ = [3, n1, _CLE,
404
409
  0,
405
- [_in, _ti, _sI, _stat, _rea],
406
- [1, 0, 0, 0, 0], 4
410
+ [_in, _ti, _sI, _stat, _tI, _rea],
411
+ [1, 0, 0, 0, 0, 0], 4
407
412
  ];
408
413
  export var CopilotRelationshipEvent$ = [3, n1, _CRE,
409
414
  0,
@@ -475,6 +480,11 @@ export var OpenOutput$ = [3, n1, _OO,
475
480
  [_rI, _sess, _rel],
476
481
  [0, () => CopilotIngestedSession$, () => CopilotSessionSummaryList], 3
477
482
  ];
483
+ export var PlaybookClientAction$ = [3, n1, _PCA,
484
+ 0,
485
+ [_aI, _sIte, _com],
486
+ [0, 64 | 0, 2], 1
487
+ ];
478
488
  export var ResolveInput$ = [3, n1, _RI,
479
489
  0,
480
490
  [_loo, _co],
@@ -588,6 +598,7 @@ var CopilotSessionEvents = [1, n1, _CSE,
588
598
  var CopilotSessionSummaryList = [1, n1, _CSSL,
589
599
  0, () => CopilotSessionSummary$
590
600
  ];
601
+ var PlaybookStepIdList = 64 | 0;
591
602
  var ActionsElementsList = [1, n4, _AEL,
592
603
  0, () => ActionElement$
593
604
  ];
@@ -607,8 +618,8 @@ var CopilotContextAttributes = 128 | 0;
607
618
  var ReactionCounts = 128 | 1;
608
619
  export var CopilotClientAction$ = [4, n1, _CCA,
609
620
  0,
610
- [_kS, _sAm],
611
- [() => KnowledgeSearchClientAction$, () => SmartActionClientAction$]
621
+ [_kS, _sAm, _pl],
622
+ [() => KnowledgeSearchClientAction$, () => SmartActionClientAction$, () => PlaybookClientAction$]
612
623
  ];
613
624
  export var CopilotSessionEvent$ = [4, n1, _CSEo,
614
625
  0,
@@ -27,11 +27,11 @@ declare const ActCommand_base: {
27
27
  getEndpointParameterInstructions(): import("@smithy/types").EndpointParameterInstructions;
28
28
  };
29
29
  /**
30
- * Submits one user interaction with copilot output — a knowledge-search suggestion click or a
31
- * smart-action invocation. The action is appended to the session's input mailbox and processed
32
- * asynchronously by the session worker; outcomes surface in the event log as `action` events and
33
- * asset updates. Clicks also feed the per-resource usage statistics in the wilma-copilot config
34
- * API.
30
+ * Submits one user interaction with copilot output — a knowledge-search suggestion click, a
31
+ * smart-action invocation, or playbook progress the agent made by hand. The action is appended to
32
+ * the session's input mailbox and processed asynchronously by the session worker; outcomes surface
33
+ * in the event log as `action` events and asset updates. Clicks also feed the per-resource usage
34
+ * statistics in the wilma-copilot config API.
35
35
  * @example
36
36
  * Use a bare-bones client and the command you need to make an API call.
37
37
  * ```javascript
@@ -53,6 +53,13 @@ declare const ActCommand_base: {
53
53
  * actionId: "STRING_VALUE", // required
54
54
  * variables: "DOCUMENT_VALUE",
55
55
  * },
56
+ * playbook: { // PlaybookClientAction
57
+ * assetId: "STRING_VALUE", // required
58
+ * stepIds: [ // PlaybookStepIdList
59
+ * "STRING_VALUE",
60
+ * ],
61
+ * complete: true || false,
62
+ * },
56
63
  * },
57
64
  * };
58
65
  * const command = new ActCommand(input);
@@ -51,6 +51,7 @@ declare const GetSessionEventsCommand_base: {
51
51
  * // index: Number("int"), // required
52
52
  * // timestamp: "STRING_VALUE", // required
53
53
  * // sessionId: "STRING_VALUE", // required
54
+ * // traceId: "STRING_VALUE",
54
55
  * // status: "active" || "idle" || "archived" || "failed", // required
55
56
  * // reason: "created" || "ended" || "stopped" || "inactivity" || "archive_timer" || "revived" || "error",
56
57
  * // },
@@ -28,7 +28,7 @@ declare const StreamSessionEventsCommand_base: {
28
28
  getEndpointParameterInstructions(): import("@smithy/types").EndpointParameterInstructions;
29
29
  };
30
30
  /**
31
- * Replays and tails copilot session events as Server-Sent Events (`text/event-stream`). Each frame carries one CopilotSessionEvent: `id:` is the event index, `event:` is the union member name, and `data:` is the JSON document of the union value. The stream closes after a `lifecycle` event that leaves the session dormant (`idle`, `archived`) or `failed`; reconnect with the last seen index + 1 as `startIndex` to resume, including after a dormant session revives.
31
+ * Replays and tails copilot session events as Server-Sent Events (`text/event-stream`). Each frame carries one CopilotSessionEvent: `id:` is the event index, `event:` is the union member name, and `data:` is the JSON document of the union value. The stream closes after a `lifecycle` event that leaves the session dormant (`idle`, `archived`) or `failed`; reconnect with the last seen index + 1 as `startIndex` to resume, including after a dormant session revives. `startIndex` is the only resume cursor — no `Last-Event-ID` header is read, because a client already tracks the index it is rendering, and that is the same cursor GetSessionEvents pages with.
32
32
  * @example
33
33
  * Use a bare-bones client and the command you need to make an API call.
34
34
  * ```javascript
@@ -439,6 +439,31 @@ export interface KnowledgeSearchClientAction {
439
439
  */
440
440
  question?: string | undefined;
441
441
  }
442
+ /**
443
+ * Records playbook progress the agent made by hand: the steps that do not auto-complete from the
444
+ * transcript, and — where the playbook allows it — the playbook itself. Progress is append-only, so
445
+ * a step the transcript already completed stays complete and re-sending an id is a no-op.
446
+ * @public
447
+ */
448
+ export interface PlaybookClientAction {
449
+ /**
450
+ * Id of the asset carrying the playbook.
451
+ * @public
452
+ */
453
+ assetId: string;
454
+ /**
455
+ * Steps the agent ticked. Ids that are not steps of this playbook are ignored.
456
+ * @public
457
+ */
458
+ stepIds?: string[] | undefined;
459
+ /**
460
+ * Marks the whole playbook complete. Honoured only when the playbook's `completionCriteria` is
461
+ * `manual` with `allowAgentMarkComplete`; ignored for semantic criteria, where the model owns the
462
+ * goal verdict. Required steps still gate the checkmark either way.
463
+ * @public
464
+ */
465
+ complete?: boolean | undefined;
466
+ }
442
467
  /**
443
468
  * Invokes one smart action offered by an asset.
444
469
  * @public
@@ -464,7 +489,7 @@ export interface SmartActionClientAction {
464
489
  * One user interaction with copilot output. Exactly one member is set.
465
490
  * @public
466
491
  */
467
- export type CopilotClientAction = CopilotClientAction.KnowledgeSearchMember | CopilotClientAction.SmartActionMember | CopilotClientAction.$UnknownMember;
492
+ export type CopilotClientAction = CopilotClientAction.KnowledgeSearchMember | CopilotClientAction.PlaybookMember | CopilotClientAction.SmartActionMember | CopilotClientAction.$UnknownMember;
468
493
  /**
469
494
  * @public
470
495
  */
@@ -476,6 +501,7 @@ export declare namespace CopilotClientAction {
476
501
  interface KnowledgeSearchMember {
477
502
  knowledgeSearch: KnowledgeSearchClientAction;
478
503
  smartAction?: never;
504
+ playbook?: never;
479
505
  $unknown?: never;
480
506
  }
481
507
  /**
@@ -485,6 +511,19 @@ export declare namespace CopilotClientAction {
485
511
  interface SmartActionMember {
486
512
  knowledgeSearch?: never;
487
513
  smartAction: SmartActionClientAction;
514
+ playbook?: never;
515
+ $unknown?: never;
516
+ }
517
+ /**
518
+ * Records playbook progress the agent made by hand: the steps that do not auto-complete from the
519
+ * transcript, and — where the playbook allows it — the playbook itself. Progress is append-only, so
520
+ * a step the transcript already completed stays complete and re-sending an id is a no-op.
521
+ * @public
522
+ */
523
+ interface PlaybookMember {
524
+ knowledgeSearch?: never;
525
+ smartAction?: never;
526
+ playbook: PlaybookClientAction;
488
527
  $unknown?: never;
489
528
  }
490
529
  /**
@@ -493,6 +532,7 @@ export declare namespace CopilotClientAction {
493
532
  interface $UnknownMember {
494
533
  knowledgeSearch?: never;
495
534
  smartAction?: never;
535
+ playbook?: never;
496
536
  $unknown: [string, any];
497
537
  }
498
538
  /**
@@ -502,6 +542,7 @@ export declare namespace CopilotClientAction {
502
542
  interface Visitor<T> {
503
543
  knowledgeSearch: (value: KnowledgeSearchClientAction) => T;
504
544
  smartAction: (value: SmartActionClientAction) => T;
545
+ playbook: (value: PlaybookClientAction) => T;
505
546
  _: (name: string, value: any) => T;
506
547
  }
507
548
  }
@@ -587,7 +628,7 @@ export interface CopilotActionEvent {
587
628
  */
588
629
  id: string;
589
630
  /**
590
- * What was invoked: `knowledge_search`, `runAgent`, `runTool`, `transfer`, `handover` or `openUrl`.
631
+ * What was invoked: `knowledge_search`, `playbook`, `runAgent`, `transfer`, `handover` or `openUrl`.
591
632
  * @public
592
633
  */
593
634
  kind: string;
@@ -798,7 +839,9 @@ export interface CopilotIntentEvent {
798
839
  state: __DocumentType;
799
840
  }
800
841
  /**
801
- * Session lifecycle transition. Emitted on attach and on every status transition; `reason` says why the session moved.
842
+ * Session lifecycle transition. Emitted on attach and on every status transition; `reason` says
843
+ * why the session moved. Copilot exposes no session read operation, so this is where a client
844
+ * learns the session's identity — including the trace recording it, delivered on attach.
802
845
  * @public
803
846
  */
804
847
  export interface CopilotLifecycleEvent {
@@ -813,6 +856,11 @@ export interface CopilotLifecycleEvent {
813
856
  */
814
857
  timestamp: string;
815
858
  sessionId: string;
859
+ /**
860
+ * Opaque trace identifier generated by the tracing runtime.
861
+ * @public
862
+ */
863
+ traceId?: string | undefined;
816
864
  status: CopilotSessionStatus;
817
865
  /**
818
866
  * Why a lifecycle transition happened.
@@ -924,7 +972,9 @@ export type CopilotSessionEvent = CopilotSessionEvent.ActionMember | CopilotSess
924
972
  */
925
973
  export declare namespace CopilotSessionEvent {
926
974
  /**
927
- * Session lifecycle transition. Emitted on attach and on every status transition; `reason` says why the session moved.
975
+ * Session lifecycle transition. Emitted on attach and on every status transition; `reason` says
976
+ * why the session moved. Copilot exposes no session read operation, so this is where a client
977
+ * learns the session's identity — including the trace recording it, delivered on attach.
928
978
  * @public
929
979
  */
930
980
  interface LifecycleMember {
@@ -49,6 +49,7 @@ export declare var ListSessionsInput$: StaticStructureSchema;
49
49
  export declare var ListSessionsOutput$: StaticStructureSchema;
50
50
  export declare var OpenInput$: StaticStructureSchema;
51
51
  export declare var OpenOutput$: StaticStructureSchema;
52
+ export declare var PlaybookClientAction$: StaticStructureSchema;
52
53
  export declare var ResolveInput$: StaticStructureSchema;
53
54
  export declare var ResolveOutput$: StaticStructureSchema;
54
55
  export declare var SmartActionClientAction$: StaticStructureSchema;
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.13",
4
+ "version": "1.0.15",
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",