@genesislcap/ai-assistant 15.96.2 → 15.96.3-GENC-1640.2
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/ai-assistant.api.json +111 -6
- package/dist/ai-assistant.d.ts +24 -8
- package/dist/chat-driver.cjs +18 -1
- package/dist/chat-driver.cjs.map +2 -2
- package/dist/chat-driver.mjs +18 -1
- package/dist/chat-driver.mjs.map +2 -2
- package/dist/custom-elements.json +2122 -2086
- package/dist/dts/components/ai-driver/ai-driver.d.ts +14 -4
- package/dist/dts/components/ai-driver/ai-driver.d.ts.map +1 -1
- package/dist/dts/components/ai-driver/base-driver-decorator.d.ts +1 -0
- package/dist/dts/components/ai-driver/base-driver-decorator.d.ts.map +1 -1
- package/dist/dts/components/orchestrating-driver/hand-off.d.ts.map +1 -1
- package/dist/dts/components/orchestrating-driver/orchestrating-driver.d.ts +2 -0
- package/dist/dts/components/orchestrating-driver/orchestrating-driver.d.ts.map +1 -1
- package/dist/dts/config/config.d.ts +7 -4
- package/dist/dts/config/config.d.ts.map +1 -1
- package/dist/dts/state/persistence/session-persister.d.ts +18 -0
- package/dist/dts/state/persistence/session-persister.d.ts.map +1 -1
- package/dist/esm/components/ai-driver/base-driver-decorator.js +4 -0
- package/dist/esm/components/orchestrating-driver/hand-off.js +2 -0
- package/dist/esm/components/orchestrating-driver/orchestrating-driver.js +20 -2
- package/dist/esm/state/persistence/session-persister.js +82 -10
- package/package.json +17 -17
|
@@ -5154,6 +5154,39 @@
|
|
|
5154
5154
|
"parameters": [],
|
|
5155
5155
|
"name": "getTurnSnapshots"
|
|
5156
5156
|
},
|
|
5157
|
+
{
|
|
5158
|
+
"kind": "MethodSignature",
|
|
5159
|
+
"canonicalReference": "@genesislcap/ai-assistant!AiDriver#getWaitingCallers:member(1)",
|
|
5160
|
+
"docComment": "/**\n * The agent behind each hand-off frame's caller, oldest first, so a save can ask each whether it `resumable` (GENC-1640): the live instance when it waits live, else the configured one.\n *\n * @beta\n */\n",
|
|
5161
|
+
"excerptTokens": [
|
|
5162
|
+
{
|
|
5163
|
+
"kind": "Content",
|
|
5164
|
+
"text": "getWaitingCallers?(): "
|
|
5165
|
+
},
|
|
5166
|
+
{
|
|
5167
|
+
"kind": "Reference",
|
|
5168
|
+
"text": "AgentConfig",
|
|
5169
|
+
"canonicalReference": "@genesislcap/ai-assistant!AgentConfig:type"
|
|
5170
|
+
},
|
|
5171
|
+
{
|
|
5172
|
+
"kind": "Content",
|
|
5173
|
+
"text": "[]"
|
|
5174
|
+
},
|
|
5175
|
+
{
|
|
5176
|
+
"kind": "Content",
|
|
5177
|
+
"text": ";"
|
|
5178
|
+
}
|
|
5179
|
+
],
|
|
5180
|
+
"isOptional": true,
|
|
5181
|
+
"returnTypeTokenRange": {
|
|
5182
|
+
"startIndex": 1,
|
|
5183
|
+
"endIndex": 3
|
|
5184
|
+
},
|
|
5185
|
+
"releaseTag": "Beta",
|
|
5186
|
+
"overloadIndex": 1,
|
|
5187
|
+
"parameters": [],
|
|
5188
|
+
"name": "getWaitingCallers"
|
|
5189
|
+
},
|
|
5157
5190
|
{
|
|
5158
5191
|
"kind": "MethodSignature",
|
|
5159
5192
|
"canonicalReference": "@genesislcap/ai-assistant!AiDriver#invokeAsUser:member(1)",
|
|
@@ -5710,7 +5743,7 @@
|
|
|
5710
5743
|
{
|
|
5711
5744
|
"kind": "MethodSignature",
|
|
5712
5745
|
"canonicalReference": "@genesislcap/ai-assistant!AiDriver#restoreHandOffData:member(1)",
|
|
5713
|
-
"docComment": "/**\n * Restore what {@link AiDriver.getHandOffData} saved, before the hand-off stack.
|
|
5746
|
+
"docComment": "/**\n * Restore what {@link AiDriver.getHandOffData} saved, before the hand-off stack. With `interrupted` true nothing comes back. A frozen session saves only its waiting callers' data, which resume, so a host restoring one passes `false`.\n *\n * @beta\n */\n",
|
|
5714
5747
|
"excerptTokens": [
|
|
5715
5748
|
{
|
|
5716
5749
|
"kind": "Content",
|
|
@@ -5771,7 +5804,7 @@
|
|
|
5771
5804
|
{
|
|
5772
5805
|
"kind": "MethodSignature",
|
|
5773
5806
|
"canonicalReference": "@genesislcap/ai-assistant!AiDriver#restoreHandOffStack:member(1)",
|
|
5774
|
-
"docComment": "/**\n * Restore saved hand-offs, before the condense policies, against the agents configured now and the saved agent states. A frame whose caller has gone, or whose stateful caller has no saved state
|
|
5807
|
+
"docComment": "/**\n * Restore saved hand-offs, before the condense policies, against the agents configured now and the saved agent states. A frame whose caller has gone, or whose stateful caller has no saved state, is unwound with `handoff-unwound`. `interrupted` says the save was frozen: the running target's state was dropped, but the waiting callers' were kept, so when the top frame's target had not finished its outcome is `target-interrupted`. When the top frame's target had finished, or has gone, or was interrupted, its caller is due to resume: `resume` names it and the note its resumed turn needs, and {@link AiDriver.resumeRestoredFlow} hands back. `droppedLocks` names plain targets of unwound hand-offs, whose saved lock was only that hand-off's.\n *\n * @beta\n */\n",
|
|
5775
5808
|
"excerptTokens": [
|
|
5776
5809
|
{
|
|
5777
5810
|
"kind": "Content",
|
|
@@ -12576,6 +12609,42 @@
|
|
|
12576
12609
|
"isAbstract": false,
|
|
12577
12610
|
"name": "getTurnSnapshots"
|
|
12578
12611
|
},
|
|
12612
|
+
{
|
|
12613
|
+
"kind": "Method",
|
|
12614
|
+
"canonicalReference": "@genesislcap/ai-assistant!BaseDriverDecorator#getWaitingCallers:member(1)",
|
|
12615
|
+
"docComment": "",
|
|
12616
|
+
"excerptTokens": [
|
|
12617
|
+
{
|
|
12618
|
+
"kind": "Content",
|
|
12619
|
+
"text": "getWaitingCallers(): "
|
|
12620
|
+
},
|
|
12621
|
+
{
|
|
12622
|
+
"kind": "Reference",
|
|
12623
|
+
"text": "AgentConfig",
|
|
12624
|
+
"canonicalReference": "@genesislcap/ai-assistant!AgentConfig:type"
|
|
12625
|
+
},
|
|
12626
|
+
{
|
|
12627
|
+
"kind": "Content",
|
|
12628
|
+
"text": "[]"
|
|
12629
|
+
},
|
|
12630
|
+
{
|
|
12631
|
+
"kind": "Content",
|
|
12632
|
+
"text": ";"
|
|
12633
|
+
}
|
|
12634
|
+
],
|
|
12635
|
+
"isStatic": false,
|
|
12636
|
+
"returnTypeTokenRange": {
|
|
12637
|
+
"startIndex": 1,
|
|
12638
|
+
"endIndex": 3
|
|
12639
|
+
},
|
|
12640
|
+
"releaseTag": "Beta",
|
|
12641
|
+
"isProtected": false,
|
|
12642
|
+
"overloadIndex": 1,
|
|
12643
|
+
"parameters": [],
|
|
12644
|
+
"isOptional": false,
|
|
12645
|
+
"isAbstract": false,
|
|
12646
|
+
"name": "getWaitingCallers"
|
|
12647
|
+
},
|
|
12579
12648
|
{
|
|
12580
12649
|
"kind": "Property",
|
|
12581
12650
|
"canonicalReference": "@genesislcap/ai-assistant!BaseDriverDecorator#inner:member",
|
|
@@ -30533,7 +30602,7 @@
|
|
|
30533
30602
|
{
|
|
30534
30603
|
"kind": "TypeAlias",
|
|
30535
30604
|
"canonicalReference": "@genesislcap/ai-assistant!HandOffOutcomeKind:type",
|
|
30536
|
-
"docComment": "/**\n * How a hand-off ended (GENC-1737): - `completed`: the target called `completeHandOff`; - `released`: the target called `releaseAgent`, or, a plain one, ended its turn; - `cleared`: the user cleared the chat; - `agent-removed`: the caller or the target is no longer in the agent list, found on restore; - `state-lost`: the caller's saved state is gone, so it cannot resume: a
|
|
30605
|
+
"docComment": "/**\n * How a hand-off ended (GENC-1737): - `completed`: the target called `completeHandOff`; - `released`: the target called `releaseAgent`, or, a plain one, ended its turn; - `cleared`: the user cleared the chat; - `agent-removed`: the caller or the target is no longer in the agent list, found on restore; - `target-interrupted`: a reload cut the target's work short and it cannot resume (its `resumable` was `false`), so its unsaved work is lost; the caller's own state was saved, so the caller resumes and is told, and decides what to do next, such as handing off again; - `state-lost`: the caller's saved state is gone, so it cannot resume: a stateful caller whose state was not saved, or a change to the agents, which disposes them.\n *\n * @beta\n */\n",
|
|
30537
30606
|
"excerptTokens": [
|
|
30538
30607
|
{
|
|
30539
30608
|
"kind": "Content",
|
|
@@ -30541,7 +30610,7 @@
|
|
|
30541
30610
|
},
|
|
30542
30611
|
{
|
|
30543
30612
|
"kind": "Content",
|
|
30544
|
-
"text": "'completed' | 'released' | 'cleared' | 'agent-removed' | 'state-lost'"
|
|
30613
|
+
"text": "'completed' | 'released' | 'cleared' | 'agent-removed' | 'target-interrupted' | 'state-lost'"
|
|
30545
30614
|
},
|
|
30546
30615
|
{
|
|
30547
30616
|
"kind": "Content",
|
|
@@ -37342,10 +37411,46 @@
|
|
|
37342
37411
|
"isAbstract": false,
|
|
37343
37412
|
"name": "getSuggestions"
|
|
37344
37413
|
},
|
|
37414
|
+
{
|
|
37415
|
+
"kind": "Method",
|
|
37416
|
+
"canonicalReference": "@genesislcap/ai-assistant!OrchestratingDriver#getWaitingCallers:member(1)",
|
|
37417
|
+
"docComment": "/**\n * The agent behind each hand-off frame's caller, oldest first, so a save can ask each whether it `resumable` (GENC-1640): the live instance when it waits live, else the configured one.\n */\n",
|
|
37418
|
+
"excerptTokens": [
|
|
37419
|
+
{
|
|
37420
|
+
"kind": "Content",
|
|
37421
|
+
"text": "getWaitingCallers(): "
|
|
37422
|
+
},
|
|
37423
|
+
{
|
|
37424
|
+
"kind": "Reference",
|
|
37425
|
+
"text": "AgentConfig",
|
|
37426
|
+
"canonicalReference": "@genesislcap/ai-assistant!AgentConfig:type"
|
|
37427
|
+
},
|
|
37428
|
+
{
|
|
37429
|
+
"kind": "Content",
|
|
37430
|
+
"text": "[]"
|
|
37431
|
+
},
|
|
37432
|
+
{
|
|
37433
|
+
"kind": "Content",
|
|
37434
|
+
"text": ";"
|
|
37435
|
+
}
|
|
37436
|
+
],
|
|
37437
|
+
"isStatic": false,
|
|
37438
|
+
"returnTypeTokenRange": {
|
|
37439
|
+
"startIndex": 1,
|
|
37440
|
+
"endIndex": 3
|
|
37441
|
+
},
|
|
37442
|
+
"releaseTag": "Beta",
|
|
37443
|
+
"isProtected": false,
|
|
37444
|
+
"overloadIndex": 1,
|
|
37445
|
+
"parameters": [],
|
|
37446
|
+
"isOptional": false,
|
|
37447
|
+
"isAbstract": false,
|
|
37448
|
+
"name": "getWaitingCallers"
|
|
37449
|
+
},
|
|
37345
37450
|
{
|
|
37346
37451
|
"kind": "Method",
|
|
37347
37452
|
"canonicalReference": "@genesislcap/ai-assistant!OrchestratingDriver#restoreHandOffData:member(1)",
|
|
37348
|
-
"docComment": "/**\n * Restore what {@link AiDriver.getHandOffData} saved, before the hand-off stack.
|
|
37453
|
+
"docComment": "/**\n * Restore what {@link AiDriver.getHandOffData} saved, before the hand-off stack. With `interrupted` true nothing comes back. A frozen session saves only its waiting callers' data, which resume, so a host restoring one passes `false`.\n */\n",
|
|
37349
37454
|
"excerptTokens": [
|
|
37350
37455
|
{
|
|
37351
37456
|
"kind": "Content",
|
|
@@ -37409,7 +37514,7 @@
|
|
|
37409
37514
|
{
|
|
37410
37515
|
"kind": "Method",
|
|
37411
37516
|
"canonicalReference": "@genesislcap/ai-assistant!OrchestratingDriver#restoreHandOffStack:member(1)",
|
|
37412
|
-
"docComment": "/**\n * Restore saved hand-offs, before the condense policies, against the agents configured now and the saved agent states. A frame whose caller has gone, or whose stateful caller has no saved state
|
|
37517
|
+
"docComment": "/**\n * Restore saved hand-offs, before the condense policies, against the agents configured now and the saved agent states. A frame whose caller has gone, or whose stateful caller has no saved state, is unwound with `handoff-unwound`. `interrupted` says the save was frozen: the running target's state was dropped, but the waiting callers' were kept, so when the top frame's target had not finished its outcome is `target-interrupted`. When the top frame's target had finished, or has gone, or was interrupted, its caller is due to resume: `resume` names it and the note its resumed turn needs, and {@link AiDriver.resumeRestoredFlow} hands back. `droppedLocks` names plain targets of unwound hand-offs, whose saved lock was only that hand-off's.\n */\n",
|
|
37413
37518
|
"excerptTokens": [
|
|
37414
37519
|
{
|
|
37415
37520
|
"kind": "Content",
|
package/dist/ai-assistant.d.ts
CHANGED
|
@@ -1102,8 +1102,10 @@ export declare interface AiDriver extends EventTarget {
|
|
|
1102
1102
|
/**
|
|
1103
1103
|
* Restore saved hand-offs, before the condense policies, against the agents configured now and
|
|
1104
1104
|
* the saved agent states. A frame whose caller has gone, or whose stateful caller has no saved
|
|
1105
|
-
* state
|
|
1106
|
-
* target
|
|
1105
|
+
* state, is unwound with `handoff-unwound`. `interrupted` says the save was frozen: the running
|
|
1106
|
+
* target's state was dropped, but the waiting callers' were kept, so when the top frame's target
|
|
1107
|
+
* had not finished its outcome is `target-interrupted`. When the top frame's target had
|
|
1108
|
+
* finished, or has gone, or was interrupted, its caller is due to resume: `resume` names it and the note
|
|
1107
1109
|
* its resumed turn needs, and {@link AiDriver.resumeRestoredFlow} hands back. `droppedLocks`
|
|
1108
1110
|
* names plain targets of unwound hand-offs, whose saved lock was only that hand-off's.
|
|
1109
1111
|
*
|
|
@@ -1130,6 +1132,13 @@ export declare interface AiDriver extends EventTarget {
|
|
|
1130
1132
|
* @beta
|
|
1131
1133
|
*/
|
|
1132
1134
|
serializeWaitingCallers?(): Record<string, unknown>;
|
|
1135
|
+
/**
|
|
1136
|
+
* The agent behind each hand-off frame's caller, oldest first, so a save can ask each whether it
|
|
1137
|
+
* `resumable` (GENC-1640): the live instance when it waits live, else the configured one.
|
|
1138
|
+
*
|
|
1139
|
+
* @beta
|
|
1140
|
+
*/
|
|
1141
|
+
getWaitingCallers?(): AgentConfig[];
|
|
1133
1142
|
/**
|
|
1134
1143
|
* The `data` each hand-off target was activated with, by name, for the agents a reload resumes:
|
|
1135
1144
|
* the flow owner and the callers waiting in a hand-off. See the tool context's `handOffData`.
|
|
@@ -1138,8 +1147,9 @@ export declare interface AiDriver extends EventTarget {
|
|
|
1138
1147
|
*/
|
|
1139
1148
|
getHandOffData?(): Record<string, unknown>;
|
|
1140
1149
|
/**
|
|
1141
|
-
* Restore what {@link AiDriver.getHandOffData} saved, before the hand-off stack.
|
|
1142
|
-
* back
|
|
1150
|
+
* Restore what {@link AiDriver.getHandOffData} saved, before the hand-off stack. With
|
|
1151
|
+
* `interrupted` true nothing comes back. A frozen session saves only its waiting callers' data,
|
|
1152
|
+
* which resume, so a host restoring one passes `false`.
|
|
1143
1153
|
*
|
|
1144
1154
|
* @beta
|
|
1145
1155
|
*/
|
|
@@ -2573,7 +2583,7 @@ declare interface BaseAgentConfig {
|
|
|
2573
2583
|
onHandOffStart?: (frame: HandOffFrame) => void | Promise<void>;
|
|
2574
2584
|
/**
|
|
2575
2585
|
* Fires on the caller when a hand-off it made ends, before its next model call, so its own state
|
|
2576
|
-
* can move on. `outcome.kind` says how it ended. Not fired for `state-lost`, whose caller cannot
|
|
2586
|
+
* can move on. `outcome.kind` says how it ended. Fired for `target-interrupted`, whose caller resumes. Not fired for `state-lost`, whose caller cannot
|
|
2577
2587
|
* resume. GENC-1737.
|
|
2578
2588
|
*
|
|
2579
2589
|
* @beta
|
|
@@ -2758,6 +2768,7 @@ export declare abstract class BaseDriverDecorator<TInner extends AiDriver = AiDr
|
|
|
2758
2768
|
};
|
|
2759
2769
|
unwindHandOffs(kind: Extract<HandOffOutcomeKind, 'cleared' | 'state-lost'>): Promise<void>;
|
|
2760
2770
|
serializeWaitingCallers(): Record<string, unknown>;
|
|
2771
|
+
getWaitingCallers(): AgentConfig[];
|
|
2761
2772
|
getHandOffData(): Record<string, unknown>;
|
|
2762
2773
|
restoreHandOffData(saved: unknown, interrupted: boolean): void;
|
|
2763
2774
|
getActiveAgent(): AgentConfig | undefined;
|
|
@@ -7573,12 +7584,15 @@ export declare interface HandOffOutcome {
|
|
|
7573
7584
|
* - `released`: the target called `releaseAgent`, or, a plain one, ended its turn;
|
|
7574
7585
|
* - `cleared`: the user cleared the chat;
|
|
7575
7586
|
* - `agent-removed`: the caller or the target is no longer in the agent list, found on restore;
|
|
7576
|
-
* - `
|
|
7577
|
-
*
|
|
7587
|
+
* - `target-interrupted`: a reload cut the target's work short and it cannot resume (its
|
|
7588
|
+
* `resumable` was `false`), so its unsaved work is lost; the caller's own state was saved, so
|
|
7589
|
+
* the caller resumes and is told, and decides what to do next, such as handing off again;
|
|
7590
|
+
* - `state-lost`: the caller's saved state is gone, so it cannot resume: a stateful caller whose
|
|
7591
|
+
* state was not saved, or a change to the agents, which disposes them.
|
|
7578
7592
|
*
|
|
7579
7593
|
* @beta
|
|
7580
7594
|
*/
|
|
7581
|
-
export declare type HandOffOutcomeKind = 'completed' | 'released' | 'cleared' | 'agent-removed' | 'state-lost';
|
|
7595
|
+
export declare type HandOffOutcomeKind = 'completed' | 'released' | 'cleared' | 'agent-removed' | 'target-interrupted' | 'state-lost';
|
|
7582
7596
|
|
|
7583
7597
|
/**
|
|
7584
7598
|
* What `act` is given besides the action: the arguments a person would fill in.
|
|
@@ -9220,6 +9234,8 @@ export declare class OrchestratingDriver extends BaseDriverDecorator<ChatDriver>
|
|
|
9220
9234
|
getHandOffData(): Record<string, unknown>;
|
|
9221
9235
|
/** {@inheritDoc AiDriver.restoreHandOffData} */
|
|
9222
9236
|
restoreHandOffData(saved: unknown, interrupted: boolean): void;
|
|
9237
|
+
/** {@inheritDoc AiDriver.getWaitingCallers} */
|
|
9238
|
+
getWaitingCallers(): AgentConfig[];
|
|
9223
9239
|
/** {@inheritDoc AiDriver.serializeWaitingCallers} */
|
|
9224
9240
|
serializeWaitingCallers(): Record<string, unknown>;
|
|
9225
9241
|
/**
|
package/dist/chat-driver.cjs
CHANGED
|
@@ -11130,6 +11130,9 @@ var BaseDriverDecorator = class _BaseDriverDecorator extends EventTarget {
|
|
|
11130
11130
|
serializeWaitingCallers() {
|
|
11131
11131
|
return this.inner.serializeWaitingCallers?.() ?? {};
|
|
11132
11132
|
}
|
|
11133
|
+
getWaitingCallers() {
|
|
11134
|
+
return this.inner.getWaitingCallers?.() ?? [];
|
|
11135
|
+
}
|
|
11133
11136
|
getHandOffData() {
|
|
11134
11137
|
return this.inner.getHandOffData?.() ?? {};
|
|
11135
11138
|
}
|
|
@@ -11261,6 +11264,7 @@ var OUTCOME_KINDS = [
|
|
|
11261
11264
|
"released",
|
|
11262
11265
|
"cleared",
|
|
11263
11266
|
"agent-removed",
|
|
11267
|
+
"target-interrupted",
|
|
11264
11268
|
"state-lost"
|
|
11265
11269
|
];
|
|
11266
11270
|
function handOffNote(caller) {
|
|
@@ -11272,6 +11276,7 @@ function handBackNote(frame, outcome) {
|
|
|
11272
11276
|
released: `${frame.target} has finished the request you handed it, without a summary. Its last reply is above.`,
|
|
11273
11277
|
cleared: "The hand-off was cleared.",
|
|
11274
11278
|
"agent-removed": `${frame.target} is no longer available, so the request you handed it was not finished.`,
|
|
11279
|
+
"target-interrupted": `${frame.target} was cut short by a page reload and could not resume, so the request you handed it was not finished and its unsaved work is lost.`,
|
|
11275
11280
|
"state-lost": `The hand-off to ${frame.target} could not be resumed.`
|
|
11276
11281
|
};
|
|
11277
11282
|
const summary = outcome.kind === "completed" && outcome.message ? " Its summary is the message above." : "";
|
|
@@ -11873,7 +11878,7 @@ var OrchestratingDriver = class _OrchestratingDriver extends BaseDriverDecorator
|
|
|
11873
11878
|
const outcome = frame.outcome;
|
|
11874
11879
|
if (!caller) {
|
|
11875
11880
|
this.unwound(frame, "agent-removed");
|
|
11876
|
-
} else if (
|
|
11881
|
+
} else if (caller.serialize && savedStates?.[caller.name] === void 0) {
|
|
11877
11882
|
this.unwound(frame, "state-lost");
|
|
11878
11883
|
} else {
|
|
11879
11884
|
kept.push(frame);
|
|
@@ -11890,6 +11895,8 @@ var OrchestratingDriver = class _OrchestratingDriver extends BaseDriverDecorator
|
|
|
11890
11895
|
const top = kept[kept.length - 1];
|
|
11891
11896
|
if (top && !top.outcome && !this.agents.some((a) => a.name === top.target)) {
|
|
11892
11897
|
top.outcome = { kind: "agent-removed" };
|
|
11898
|
+
} else if (top && !top.outcome && interrupted) {
|
|
11899
|
+
top.outcome = { kind: "target-interrupted" };
|
|
11893
11900
|
}
|
|
11894
11901
|
this.handOffStack = kept;
|
|
11895
11902
|
this.chatDriver.suspendRestoredActivations(kept.map((f) => f.caller));
|
|
@@ -11935,6 +11942,16 @@ var OrchestratingDriver = class _OrchestratingDriver extends BaseDriverDecorator
|
|
|
11935
11942
|
if (interrupted || !saved || typeof saved !== "object" || Array.isArray(saved)) return;
|
|
11936
11943
|
for (const [name, data] of Object.entries(saved)) this.agentSession.setHandOffData(name, data);
|
|
11937
11944
|
}
|
|
11945
|
+
/** {@inheritDoc AiDriver.getWaitingCallers} */
|
|
11946
|
+
getWaitingCallers() {
|
|
11947
|
+
const live2 = this.agentSession.getSuspended();
|
|
11948
|
+
const callers = [];
|
|
11949
|
+
for (const frame of this.handOffStack) {
|
|
11950
|
+
const agent = live2.find((a) => a.name === frame.caller) ?? this.agents.find((a) => a.name === frame.caller);
|
|
11951
|
+
if (agent) callers.push(agent);
|
|
11952
|
+
}
|
|
11953
|
+
return callers;
|
|
11954
|
+
}
|
|
11938
11955
|
/** {@inheritDoc AiDriver.serializeWaitingCallers} */
|
|
11939
11956
|
serializeWaitingCallers() {
|
|
11940
11957
|
const states = {};
|