@genesislcap/ai-assistant 15.81.0 → 15.82.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.
- package/dist/ai-assistant.api.json +115 -9
- package/dist/ai-assistant.d.ts +52 -16
- package/dist/chat-driver.cjs +16 -8
- package/dist/chat-driver.cjs.map +2 -2
- package/dist/chat-driver.mjs +16 -8
- package/dist/chat-driver.mjs.map +2 -2
- package/dist/custom-elements.json +58 -7
- package/dist/dts/components/agent-session/agent-session.d.ts +2 -1
- package/dist/dts/components/agent-session/agent-session.d.ts.map +1 -1
- package/dist/dts/components/orchestrating-driver/orchestrating-driver.d.ts +6 -0
- package/dist/dts/components/orchestrating-driver/orchestrating-driver.d.ts.map +1 -1
- package/dist/dts/main/main.d.ts +22 -16
- package/dist/dts/main/main.d.ts.map +1 -1
- package/dist/dts/main/main.types.d.ts +15 -0
- package/dist/dts/main/main.types.d.ts.map +1 -1
- package/dist/dts/state/persistence/session-persister.d.ts +6 -0
- package/dist/dts/state/persistence/session-persister.d.ts.map +1 -1
- package/dist/dts/utils/delegated-message.d.ts +7 -0
- package/dist/dts/utils/delegated-message.d.ts.map +1 -1
- package/dist/esm/components/agent-session/agent-session.js +3 -2
- package/dist/esm/components/orchestrating-driver/orchestrating-driver.js +14 -6
- package/dist/esm/main/main.js +49 -32
- package/dist/esm/state/debug-event-log.js +1 -1
- package/dist/esm/state/persistence/session-persister.js +11 -1
- package/package.json +17 -17
|
@@ -2419,11 +2419,19 @@
|
|
|
2419
2419
|
{
|
|
2420
2420
|
"kind": "Method",
|
|
2421
2421
|
"canonicalReference": "@genesislcap/ai-assistant!AgentSession#getLockedName:member(1)",
|
|
2422
|
-
"docComment": "/**\n * The name routing is locked to, flow lock first. A flow in progress outranks the user's sticky pick for the duration of the flow; neither being set means automatic routing.\n */\n",
|
|
2422
|
+
"docComment": "/**\n * The name routing is locked to, flow lock first. A flow in progress outranks the user's sticky pick for the duration of the flow; neither being set means automatic routing. `pin`, when given, stands in for the sticky pick: one message routed its own way.\n */\n",
|
|
2423
2423
|
"excerptTokens": [
|
|
2424
2424
|
{
|
|
2425
2425
|
"kind": "Content",
|
|
2426
|
-
"text": "getLockedName(
|
|
2426
|
+
"text": "getLockedName(pin?: "
|
|
2427
|
+
},
|
|
2428
|
+
{
|
|
2429
|
+
"kind": "Content",
|
|
2430
|
+
"text": "string | null"
|
|
2431
|
+
},
|
|
2432
|
+
{
|
|
2433
|
+
"kind": "Content",
|
|
2434
|
+
"text": "): "
|
|
2427
2435
|
},
|
|
2428
2436
|
{
|
|
2429
2437
|
"kind": "Content",
|
|
@@ -2436,13 +2444,22 @@
|
|
|
2436
2444
|
],
|
|
2437
2445
|
"isStatic": false,
|
|
2438
2446
|
"returnTypeTokenRange": {
|
|
2439
|
-
"startIndex":
|
|
2440
|
-
"endIndex":
|
|
2447
|
+
"startIndex": 3,
|
|
2448
|
+
"endIndex": 4
|
|
2441
2449
|
},
|
|
2442
2450
|
"releaseTag": "Beta",
|
|
2443
2451
|
"isProtected": false,
|
|
2444
2452
|
"overloadIndex": 1,
|
|
2445
|
-
"parameters": [
|
|
2453
|
+
"parameters": [
|
|
2454
|
+
{
|
|
2455
|
+
"parameterName": "pin",
|
|
2456
|
+
"parameterTypeTokenRange": {
|
|
2457
|
+
"startIndex": 1,
|
|
2458
|
+
"endIndex": 2
|
|
2459
|
+
},
|
|
2460
|
+
"isOptional": true
|
|
2461
|
+
}
|
|
2462
|
+
],
|
|
2446
2463
|
"isOptional": false,
|
|
2447
2464
|
"isAbstract": false,
|
|
2448
2465
|
"name": "getLockedName"
|
|
@@ -22023,7 +22040,7 @@
|
|
|
22023
22040
|
{
|
|
22024
22041
|
"kind": "Property",
|
|
22025
22042
|
"canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#pinnedAgentName:member",
|
|
22026
|
-
"docComment": "/**\n * Name of the agent the user has pinned via the agent picker. `null` means orchestration: the assistant routes each message. Persisted on the session store, so it survives pop-in/pop-out
|
|
22043
|
+
"docComment": "/**\n * Name of the agent the user has pinned via the agent picker. `null` means orchestration: the assistant routes each message. Persisted on the session store, so it survives pop-in/pop-out. A page refresh resets it unless session persistence is on, which saves it with the session and restores it.\n *\n * Only changes on explicit user action (picker click or host's `setAgent`). The orchestrator's auto-pin on stateful activation writes `flowOwnerAgentName` instead, so finishing a guided flow doesn't wipe the user's sticky pick.\n */\n",
|
|
22027
22044
|
"excerptTokens": [
|
|
22028
22045
|
{
|
|
22029
22046
|
"kind": "Content",
|
|
@@ -24697,7 +24714,7 @@
|
|
|
24697
24714
|
{
|
|
24698
24715
|
"kind": "Method",
|
|
24699
24716
|
"canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#submitMessage:member(1)",
|
|
24700
|
-
"docComment": "/**\n * Programmatically submit a message.
|
|
24717
|
+
"docComment": "/**\n * Programmatically submit a message. Sends it the way the built-in composer's Send does, but from external code — a custom input rendered inside `slot=\"splash\"` when paired with `chatConfig.ui.hideComposer`, or a host sending on the user's behalf.\n *\n * The input fully describes the turn: `text` and `files` are sent as given, and the composer is never read or cleared, so whatever the user has typed or attached there stays where it is. Files are validated against `chatConfig.ui.acceptedFiles` using the same pipeline as the composer's attach button. `options` routes the message — see {@link SubmitMessageOptions}.\n *\n * Atomic on validation: if any file fails validation, no send is dispatched, and the failure messages are returned in `errors`. They are not shown as composer chips: the files are the caller's, not the user's.\n *\n * Resolves when the send settles: it awaits the driver's `sendMessage`, which for the built-in drivers is the whole turn, the assistant's response included.\n *\n * @beta\n */\n",
|
|
24701
24718
|
"excerptTokens": [
|
|
24702
24719
|
{
|
|
24703
24720
|
"kind": "Content",
|
|
@@ -24716,6 +24733,15 @@
|
|
|
24716
24733
|
"kind": "Content",
|
|
24717
24734
|
"text": "[];\n }"
|
|
24718
24735
|
},
|
|
24736
|
+
{
|
|
24737
|
+
"kind": "Content",
|
|
24738
|
+
"text": ", options?: "
|
|
24739
|
+
},
|
|
24740
|
+
{
|
|
24741
|
+
"kind": "Reference",
|
|
24742
|
+
"text": "SubmitMessageOptions",
|
|
24743
|
+
"canonicalReference": "@genesislcap/ai-assistant!SubmitMessageOptions:interface"
|
|
24744
|
+
},
|
|
24719
24745
|
{
|
|
24720
24746
|
"kind": "Content",
|
|
24721
24747
|
"text": "): "
|
|
@@ -24745,8 +24771,8 @@
|
|
|
24745
24771
|
],
|
|
24746
24772
|
"isStatic": false,
|
|
24747
24773
|
"returnTypeTokenRange": {
|
|
24748
|
-
"startIndex":
|
|
24749
|
-
"endIndex":
|
|
24774
|
+
"startIndex": 7,
|
|
24775
|
+
"endIndex": 11
|
|
24750
24776
|
},
|
|
24751
24777
|
"releaseTag": "Beta",
|
|
24752
24778
|
"isProtected": false,
|
|
@@ -24759,6 +24785,14 @@
|
|
|
24759
24785
|
"endIndex": 4
|
|
24760
24786
|
},
|
|
24761
24787
|
"isOptional": false
|
|
24788
|
+
},
|
|
24789
|
+
{
|
|
24790
|
+
"parameterName": "options",
|
|
24791
|
+
"parameterTypeTokenRange": {
|
|
24792
|
+
"startIndex": 5,
|
|
24793
|
+
"endIndex": 6
|
|
24794
|
+
},
|
|
24795
|
+
"isOptional": true
|
|
24762
24796
|
}
|
|
24763
24797
|
],
|
|
24764
24798
|
"isOptional": false,
|
|
@@ -31050,6 +31084,33 @@
|
|
|
31050
31084
|
"name": "SendMessageOptions",
|
|
31051
31085
|
"preserveMemberOrder": false,
|
|
31052
31086
|
"members": [
|
|
31087
|
+
{
|
|
31088
|
+
"kind": "PropertySignature",
|
|
31089
|
+
"canonicalReference": "@genesislcap/ai-assistant!SendMessageOptions#agent:member",
|
|
31090
|
+
"docComment": "/**\n * Route only this message as if this agent were pinned, or as Auto when `null`, in place of the sticky pin. Left out, the pin routes it. A flow-owner lock still outranks it, and a stateful agent it reaches takes that lock as usual. Ignored by a driver with nothing to route between, such as a bare `ChatDriver`.\n */\n",
|
|
31091
|
+
"excerptTokens": [
|
|
31092
|
+
{
|
|
31093
|
+
"kind": "Content",
|
|
31094
|
+
"text": "agent?: "
|
|
31095
|
+
},
|
|
31096
|
+
{
|
|
31097
|
+
"kind": "Content",
|
|
31098
|
+
"text": "string | null"
|
|
31099
|
+
},
|
|
31100
|
+
{
|
|
31101
|
+
"kind": "Content",
|
|
31102
|
+
"text": ";"
|
|
31103
|
+
}
|
|
31104
|
+
],
|
|
31105
|
+
"isReadonly": false,
|
|
31106
|
+
"isOptional": true,
|
|
31107
|
+
"releaseTag": "Beta",
|
|
31108
|
+
"name": "agent",
|
|
31109
|
+
"propertyTypeTokenRange": {
|
|
31110
|
+
"startIndex": 1,
|
|
31111
|
+
"endIndex": 2
|
|
31112
|
+
}
|
|
31113
|
+
},
|
|
31053
31114
|
{
|
|
31054
31115
|
"kind": "PropertySignature",
|
|
31055
31116
|
"canonicalReference": "@genesislcap/ai-assistant!SendMessageOptions#delegate:member",
|
|
@@ -34301,6 +34362,51 @@
|
|
|
34301
34362
|
"endIndex": 2
|
|
34302
34363
|
}
|
|
34303
34364
|
},
|
|
34365
|
+
{
|
|
34366
|
+
"kind": "Interface",
|
|
34367
|
+
"canonicalReference": "@genesislcap/ai-assistant!SubmitMessageOptions:interface",
|
|
34368
|
+
"docComment": "/**\n * How {@link FoundationAiAssistant.submitMessage} routes its message.\n *\n * @beta\n */\n",
|
|
34369
|
+
"excerptTokens": [
|
|
34370
|
+
{
|
|
34371
|
+
"kind": "Content",
|
|
34372
|
+
"text": "export interface SubmitMessageOptions "
|
|
34373
|
+
}
|
|
34374
|
+
],
|
|
34375
|
+
"fileUrlPath": "src/main/main.types.ts",
|
|
34376
|
+
"releaseTag": "Beta",
|
|
34377
|
+
"name": "SubmitMessageOptions",
|
|
34378
|
+
"preserveMemberOrder": false,
|
|
34379
|
+
"members": [
|
|
34380
|
+
{
|
|
34381
|
+
"kind": "PropertySignature",
|
|
34382
|
+
"canonicalReference": "@genesislcap/ai-assistant!SubmitMessageOptions#agent:member",
|
|
34383
|
+
"docComment": "/**\n * Route only this message as if this agent were pinned, or as Auto when `null`, without changing `pinnedAgentName`. Left out, the message routes as any other would. A guided flow's lock still outranks it, as it outranks the pin. A stateful agent it reaches takes that lock as usual, so the messages after it go to that agent too, until its flow releases. An agent that is not in `agents` is refused, and nothing is sent.\n */\n",
|
|
34384
|
+
"excerptTokens": [
|
|
34385
|
+
{
|
|
34386
|
+
"kind": "Content",
|
|
34387
|
+
"text": "agent?: "
|
|
34388
|
+
},
|
|
34389
|
+
{
|
|
34390
|
+
"kind": "Content",
|
|
34391
|
+
"text": "string | null"
|
|
34392
|
+
},
|
|
34393
|
+
{
|
|
34394
|
+
"kind": "Content",
|
|
34395
|
+
"text": ";"
|
|
34396
|
+
}
|
|
34397
|
+
],
|
|
34398
|
+
"isReadonly": false,
|
|
34399
|
+
"isOptional": true,
|
|
34400
|
+
"releaseTag": "Beta",
|
|
34401
|
+
"name": "agent",
|
|
34402
|
+
"propertyTypeTokenRange": {
|
|
34403
|
+
"startIndex": 1,
|
|
34404
|
+
"endIndex": 2
|
|
34405
|
+
}
|
|
34406
|
+
}
|
|
34407
|
+
],
|
|
34408
|
+
"extendsTokenRanges": []
|
|
34409
|
+
},
|
|
34304
34410
|
{
|
|
34305
34411
|
"kind": "Interface",
|
|
34306
34412
|
"canonicalReference": "@genesislcap/ai-assistant!SubmitMessageResult:interface",
|
package/dist/ai-assistant.d.ts
CHANGED
|
@@ -560,8 +560,9 @@ export declare class AgentSession {
|
|
|
560
560
|
/**
|
|
561
561
|
* The name routing is locked to, flow lock first. A flow in progress outranks the user's
|
|
562
562
|
* sticky pick for the duration of the flow; neither being set means automatic routing.
|
|
563
|
+
* `pin`, when given, stands in for the sticky pick: one message routed its own way.
|
|
563
564
|
*/
|
|
564
|
-
getLockedName(): string | null;
|
|
565
|
+
getLockedName(pin?: string | null): string | null;
|
|
565
566
|
/** Set the sticky user pin. `null` returns to automatic routing. */
|
|
566
567
|
setPinned(name: string | null): void;
|
|
567
568
|
/**
|
|
@@ -5065,7 +5066,8 @@ export declare class FoundationAiAssistant extends GenesisElement {
|
|
|
5065
5066
|
/**
|
|
5066
5067
|
* Name of the agent the user has pinned via the agent picker. `null` means
|
|
5067
5068
|
* orchestration: the assistant routes each message. Persisted on the session store, so it survives
|
|
5068
|
-
* pop-in/pop-out
|
|
5069
|
+
* pop-in/pop-out. A page refresh resets it unless session persistence is on, which saves it with
|
|
5070
|
+
* the session and restores it.
|
|
5069
5071
|
*
|
|
5070
5072
|
* Only changes on explicit user action (picker click or host's `setAgent`).
|
|
5071
5073
|
* The orchestrator's auto-pin on stateful activation writes
|
|
@@ -6405,30 +6407,30 @@ export declare class FoundationAiAssistant extends GenesisElement {
|
|
|
6405
6407
|
handleStopClick(): void;
|
|
6406
6408
|
handleSuggestionClick(suggestion: string): void;
|
|
6407
6409
|
/**
|
|
6408
|
-
* Programmatically submit a message.
|
|
6409
|
-
*
|
|
6410
|
-
*
|
|
6411
|
-
*
|
|
6410
|
+
* Programmatically submit a message. Sends it the way the built-in composer's
|
|
6411
|
+
* Send does, but from external code — a custom input rendered inside
|
|
6412
|
+
* `slot="splash"` when paired with `chatConfig.ui.hideComposer`, or a host
|
|
6413
|
+
* sending on the user's behalf.
|
|
6412
6414
|
*
|
|
6413
|
-
* The input fully describes the turn: `text` and `files`
|
|
6414
|
-
* composer
|
|
6415
|
+
* The input fully describes the turn: `text` and `files` are sent as given,
|
|
6416
|
+
* and the composer is never read or cleared, so whatever the user has typed or
|
|
6417
|
+
* attached there stays where it is. Files are validated against
|
|
6415
6418
|
* `chatConfig.ui.acceptedFiles` using the same pipeline as the composer's
|
|
6416
|
-
* attach button.
|
|
6419
|
+
* attach button. `options` routes the message — see {@link SubmitMessageOptions}.
|
|
6417
6420
|
*
|
|
6418
|
-
* Atomic on validation: if any file fails validation, no
|
|
6419
|
-
*
|
|
6420
|
-
*
|
|
6421
|
-
* chip UI still surfaces them when visible.
|
|
6421
|
+
* Atomic on validation: if any file fails validation, no send is dispatched,
|
|
6422
|
+
* and the failure messages are returned in `errors`. They are not shown as
|
|
6423
|
+
* composer chips: the files are the caller's, not the user's.
|
|
6422
6424
|
*
|
|
6423
|
-
* Resolves
|
|
6424
|
-
* the assistant's response.
|
|
6425
|
+
* Resolves when the send settles: it awaits the driver's `sendMessage`, which
|
|
6426
|
+
* for the built-in drivers is the whole turn, the assistant's response included.
|
|
6425
6427
|
*
|
|
6426
6428
|
* @beta
|
|
6427
6429
|
*/
|
|
6428
6430
|
submitMessage(input: {
|
|
6429
6431
|
text?: string;
|
|
6430
6432
|
files?: File[];
|
|
6431
|
-
}): Promise<SubmitMessageResult>;
|
|
6433
|
+
}, options?: SubmitMessageOptions): Promise<SubmitMessageResult>;
|
|
6432
6434
|
private fetchSuggestions;
|
|
6433
6435
|
/**
|
|
6434
6436
|
* User text of the message currently being sent, stashed for the lifetime of `send()`.
|
|
@@ -6437,6 +6439,11 @@ export declare class FoundationAiAssistant extends GenesisElement {
|
|
|
6437
6439
|
* a stale raw-history lookup. Cleared once the send settles. (GENC-1351 §5.9)
|
|
6438
6440
|
*/
|
|
6439
6441
|
private _pendingSendPrompt?;
|
|
6442
|
+
/**
|
|
6443
|
+
* @param message - What to send in place of the composer's contents, which are then neither
|
|
6444
|
+
* read nor cleared (`submitMessage`). Left out, the composer's contents are sent and cleared.
|
|
6445
|
+
* @param routing - Passed on to the driver: how this one message is routed.
|
|
6446
|
+
*/
|
|
6440
6447
|
private send;
|
|
6441
6448
|
/**
|
|
6442
6449
|
* The post-turn settle shared by `send()` and a resumed restore turn: back to idle through
|
|
@@ -7350,6 +7357,10 @@ export declare class OrchestratingDriver extends BaseDriverDecorator<ChatDriver>
|
|
|
7350
7357
|
* Two cases, because routing has two modes and they need opposite answers.
|
|
7351
7358
|
*/
|
|
7352
7359
|
getContextReserve(): ContextReserveResolution | undefined;
|
|
7360
|
+
/**
|
|
7361
|
+
* `pin` stands in for the user-pin when given, as for
|
|
7362
|
+
* {@link OrchestratingDriver.resolvePinnedAgent}.
|
|
7363
|
+
*/
|
|
7353
7364
|
private installAgent;
|
|
7354
7365
|
/**
|
|
7355
7366
|
* Release the current stateful agent: fire `onDeactivate` and clear the flow-owner lock. The
|
|
@@ -7403,6 +7414,8 @@ export declare class OrchestratingDriver extends BaseDriverDecorator<ChatDriver>
|
|
|
7403
7414
|
*
|
|
7404
7415
|
* Logs and returns `undefined` if a name no longer matches the agents array
|
|
7405
7416
|
* — protects against stale state after an agents-array reassignment.
|
|
7417
|
+
*
|
|
7418
|
+
* `pin` stands in for the user-pin when given — `SendMessageOptions.agent`.
|
|
7406
7419
|
*/
|
|
7407
7420
|
private resolvePinnedAgent;
|
|
7408
7421
|
/**
|
|
@@ -7868,6 +7881,13 @@ export declare interface SendMessageOptions {
|
|
|
7868
7881
|
* reaches the session total. Ignored unless `delegate` is set and it is a positive, finite number.
|
|
7869
7882
|
*/
|
|
7870
7883
|
externalCostUsd?: number;
|
|
7884
|
+
/**
|
|
7885
|
+
* Route only this message as if this agent were pinned, or as Auto when `null`, in place of the
|
|
7886
|
+
* sticky pin. Left out, the pin routes it. A flow-owner lock still outranks it, and a stateful
|
|
7887
|
+
* agent it reaches takes that lock as usual. Ignored by a driver with nothing to route between,
|
|
7888
|
+
* such as a bare `ChatDriver`.
|
|
7889
|
+
*/
|
|
7890
|
+
agent?: string | null;
|
|
7871
7891
|
}
|
|
7872
7892
|
|
|
7873
7893
|
/**
|
|
@@ -8447,6 +8467,22 @@ export declare type StepOutcome = 'started' | 'resumed' | 'done' | 'skipped';
|
|
|
8447
8467
|
*/
|
|
8448
8468
|
export declare const strictFallbackAgent: FallbackAgentConfig;
|
|
8449
8469
|
|
|
8470
|
+
/**
|
|
8471
|
+
* How {@link FoundationAiAssistant.submitMessage} routes its message.
|
|
8472
|
+
*
|
|
8473
|
+
* @beta
|
|
8474
|
+
*/
|
|
8475
|
+
export declare interface SubmitMessageOptions {
|
|
8476
|
+
/**
|
|
8477
|
+
* Route only this message as if this agent were pinned, or as Auto when `null`, without
|
|
8478
|
+
* changing `pinnedAgentName`. Left out, the message routes as any other would. A guided flow's
|
|
8479
|
+
* lock still outranks it, as it outranks the pin. A stateful agent it reaches takes that lock as
|
|
8480
|
+
* usual, so the messages after it go to that agent too, until its flow releases. An agent that
|
|
8481
|
+
* is not in `agents` is refused, and nothing is sent.
|
|
8482
|
+
*/
|
|
8483
|
+
agent?: string | null;
|
|
8484
|
+
}
|
|
8485
|
+
|
|
8450
8486
|
/**
|
|
8451
8487
|
* Result returned by {@link FoundationAiAssistant.submitMessage}.
|
|
8452
8488
|
*
|
package/dist/chat-driver.cjs
CHANGED
|
@@ -5020,9 +5020,10 @@ var AgentSession = class {
|
|
|
5020
5020
|
/**
|
|
5021
5021
|
* The name routing is locked to, flow lock first. A flow in progress outranks the user's
|
|
5022
5022
|
* sticky pick for the duration of the flow; neither being set means automatic routing.
|
|
5023
|
+
* `pin`, when given, stands in for the sticky pick: one message routed its own way.
|
|
5023
5024
|
*/
|
|
5024
|
-
getLockedName() {
|
|
5025
|
-
return this.flowOwner ??
|
|
5025
|
+
getLockedName(pin = this.pinned) {
|
|
5026
|
+
return this.flowOwner ?? pin;
|
|
5026
5027
|
}
|
|
5027
5028
|
/** Set the sticky user pin. `null` returns to automatic routing. */
|
|
5028
5029
|
setPinned(name) {
|
|
@@ -9698,7 +9699,8 @@ var OrchestratingDriver = class _OrchestratingDriver extends BaseDriverDecorator
|
|
|
9698
9699
|
})
|
|
9699
9700
|
);
|
|
9700
9701
|
const routingInput = delegated.delegate ? frameDelegatedContent(input, delegated.delegateFraming) : input;
|
|
9701
|
-
const
|
|
9702
|
+
const pin = options?.agent;
|
|
9703
|
+
const pinned = this.resolvePinnedAgent(pin);
|
|
9702
9704
|
if (!pinned) this.dispatchEvent(new CustomEvent("orchestrating-start"));
|
|
9703
9705
|
let routed;
|
|
9704
9706
|
if (pinned) {
|
|
@@ -9716,7 +9718,7 @@ var OrchestratingDriver = class _OrchestratingDriver extends BaseDriverDecorator
|
|
|
9716
9718
|
let lastResult;
|
|
9717
9719
|
while (true) {
|
|
9718
9720
|
if (this.cancelled) break;
|
|
9719
|
-
await this.installAgent(currentAgent);
|
|
9721
|
+
await this.installAgent(currentAgent, pin);
|
|
9720
9722
|
if (this.cancelled) break;
|
|
9721
9723
|
let result;
|
|
9722
9724
|
if (isHandoff) {
|
|
@@ -9852,9 +9854,13 @@ var OrchestratingDriver = class _OrchestratingDriver extends BaseDriverDecorator
|
|
|
9852
9854
|
}
|
|
9853
9855
|
return winner ? { ...winner, agentName, basis: "reachable-max" } : void 0;
|
|
9854
9856
|
}
|
|
9855
|
-
|
|
9857
|
+
/**
|
|
9858
|
+
* `pin` stands in for the user-pin when given, as for
|
|
9859
|
+
* {@link OrchestratingDriver.resolvePinnedAgent}.
|
|
9860
|
+
*/
|
|
9861
|
+
async installAgent(agent, pin) {
|
|
9856
9862
|
const { previousAgent } = await this.agentSession.activate(agent);
|
|
9857
|
-
const isTerminal = isFallback(agent) || this.agentSession.getPinned() !== null || this.agentSession.getFlowOwner() !== null || !!(agent.onActivate || agent.onDeactivate);
|
|
9863
|
+
const isTerminal = isFallback(agent) || (pin === void 0 ? this.agentSession.getPinned() : pin) !== null || this.agentSession.getFlowOwner() !== null || !!(agent.onActivate || agent.onDeactivate);
|
|
9858
9864
|
let agentToApply = agent;
|
|
9859
9865
|
if (!isTerminal) {
|
|
9860
9866
|
const declaredTools = agent.toolDefinitions;
|
|
@@ -10095,9 +10101,11 @@ ${recentMessages}` : ""}`;
|
|
|
10095
10101
|
*
|
|
10096
10102
|
* Logs and returns `undefined` if a name no longer matches the agents array
|
|
10097
10103
|
* — protects against stale state after an agents-array reassignment.
|
|
10104
|
+
*
|
|
10105
|
+
* `pin` stands in for the user-pin when given — `SendMessageOptions.agent`.
|
|
10098
10106
|
*/
|
|
10099
|
-
resolvePinnedAgent() {
|
|
10100
|
-
const name = this.agentSession.getLockedName();
|
|
10107
|
+
resolvePinnedAgent(pin) {
|
|
10108
|
+
const name = this.agentSession.getLockedName(pin);
|
|
10101
10109
|
if (name === null) return void 0;
|
|
10102
10110
|
const match = this.agents.find((a) => a.name === name);
|
|
10103
10111
|
if (!match) {
|