@genesislcap/ai-assistant 14.408.0 → 14.409.0-FUI-2495.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 +2794 -1113
- package/dist/ai-assistant.d.ts +267 -45
- package/dist/dts/channel/ai-activity-channel.d.ts +1 -0
- package/dist/dts/channel/ai-activity-channel.d.ts.map +1 -1
- package/dist/dts/components/ai-driver/ai-driver.d.ts +38 -0
- package/dist/dts/components/ai-driver/ai-driver.d.ts.map +1 -0
- package/dist/dts/components/ai-driver/index.d.ts +2 -0
- package/dist/dts/components/ai-driver/index.d.ts.map +1 -0
- package/dist/dts/components/chat-driver/chat-driver.d.ts +25 -7
- package/dist/dts/components/chat-driver/chat-driver.d.ts.map +1 -1
- package/dist/dts/components/halo-overlay.d.ts +13 -1
- package/dist/dts/components/halo-overlay.d.ts.map +1 -1
- package/dist/dts/components/orchestrating-driver/index.d.ts +2 -0
- package/dist/dts/components/orchestrating-driver/index.d.ts.map +1 -0
- package/dist/dts/components/orchestrating-driver/orchestrating-driver.d.ts +36 -0
- package/dist/dts/components/orchestrating-driver/orchestrating-driver.d.ts.map +1 -0
- package/dist/dts/components/popout-manager/index.d.ts +2 -0
- package/dist/dts/components/popout-manager/index.d.ts.map +1 -0
- package/dist/dts/components/popout-manager/popout-manager.d.ts +74 -0
- package/dist/dts/components/popout-manager/popout-manager.d.ts.map +1 -0
- package/dist/dts/config/config.d.ts +43 -15
- package/dist/dts/config/config.d.ts.map +1 -1
- package/dist/dts/config/fallback-agents.d.ts +20 -0
- package/dist/dts/config/fallback-agents.d.ts.map +1 -0
- package/dist/dts/config/index.d.ts +1 -0
- package/dist/dts/config/index.d.ts.map +1 -1
- package/dist/dts/index.d.ts +4 -0
- package/dist/dts/index.d.ts.map +1 -1
- package/dist/dts/main/main.d.ts +16 -7
- package/dist/dts/main/main.d.ts.map +1 -1
- package/dist/dts/main/main.styles.d.ts.map +1 -1
- package/dist/dts/main/main.template.d.ts.map +1 -1
- package/dist/esm/components/ai-driver/ai-driver.js +1 -0
- package/dist/esm/components/ai-driver/index.js +1 -0
- package/dist/esm/components/chat-driver/chat-driver.js +86 -31
- package/dist/esm/components/halo-overlay.js +53 -7
- package/dist/esm/components/orchestrating-driver/index.js +1 -0
- package/dist/esm/components/orchestrating-driver/orchestrating-driver.js +229 -0
- package/dist/esm/components/popout-manager/index.js +1 -0
- package/dist/esm/components/popout-manager/popout-manager.js +119 -0
- package/dist/esm/config/fallback-agents.js +26 -0
- package/dist/esm/config/index.js +1 -0
- package/dist/esm/index.js +4 -0
- package/dist/esm/main/main.js +103 -45
- package/dist/esm/main/main.styles.js +145 -4
- package/dist/esm/main/main.template.js +97 -61
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +15 -15
- package/src/channel/ai-activity-channel.ts +1 -0
- package/src/components/ai-driver/ai-driver.ts +42 -0
- package/src/components/ai-driver/index.ts +1 -0
- package/src/components/chat-driver/chat-driver.ts +116 -35
- package/src/components/halo-overlay.ts +45 -7
- package/src/components/orchestrating-driver/index.ts +1 -0
- package/src/components/orchestrating-driver/orchestrating-driver.ts +300 -0
- package/src/components/popout-manager/index.ts +1 -0
- package/src/components/popout-manager/popout-manager.ts +144 -0
- package/src/config/config.ts +45 -15
- package/src/config/fallback-agents.ts +29 -0
- package/src/config/index.ts +1 -0
- package/src/index.ts +4 -0
- package/src/main/main.styles.ts +145 -4
- package/src/main/main.template.ts +116 -78
- package/src/main/main.ts +105 -50
- package/docs/api/ai-assistant.agentconfig.description.md +0 -16
- package/docs/api/ai-assistant.agentconfig.md +0 -158
- package/docs/api/ai-assistant.agentconfig.name.md +0 -16
- package/docs/api/ai-assistant.agentconfig.primerhistory.md +0 -16
- package/docs/api/ai-assistant.agentconfig.systemprompt.md +0 -16
- package/docs/api/ai-assistant.agentconfig.tooldefinitions.md +0 -16
- package/docs/api/ai-assistant.agentconfig.toolhandlers.md +0 -16
- package/docs/api/ai-assistant.agenticactivitybus._constructor_.md +0 -53
- package/docs/api/ai-assistant.agenticactivitybus.addcrosstabevent.md +0 -55
- package/docs/api/ai-assistant.agenticactivitybus.close.md +0 -20
- package/docs/api/ai-assistant.agenticactivitybus.md +0 -18
- package/docs/api/ai-assistant.agenticactivitybus.publish.md +0 -69
- package/docs/api/ai-assistant.agenticactivitybus.subscribe.md +0 -69
- package/docs/api/ai-assistant.agenticactivitybusconfig.channelname.md +0 -16
- package/docs/api/ai-assistant.agenticactivitybusconfig.crosstabevents.md +0 -16
- package/docs/api/ai-assistant.agenticactivitybusconfig.md +0 -80
- package/docs/api/ai-assistant.agenticactivityevents._chat-popin_.md +0 -18
- package/docs/api/ai-assistant.agenticactivityevents._chat-popout_.md +0 -18
- package/docs/api/ai-assistant.agenticactivityevents._halo-start_.md +0 -18
- package/docs/api/ai-assistant.agenticactivityevents._halo-stop_.md +0 -16
- package/docs/api/ai-assistant.agenticactivityevents.md +0 -128
- package/docs/api/ai-assistant.aiassistantanimation.md +0 -18
- package/docs/api/ai-assistant.aiassistantanimationdef.label.md +0 -16
- package/docs/api/ai-assistant.aiassistantanimationdef.md +0 -80
- package/docs/api/ai-assistant.aiassistantanimationdef.tooltip.md +0 -16
- package/docs/api/ai-assistant.aiassistantserializedstate.enabledanimations.md +0 -14
- package/docs/api/ai-assistant.aiassistantserializedstate.md +0 -118
- package/docs/api/ai-assistant.aiassistantserializedstate.messages.md +0 -14
- package/docs/api/ai-assistant.aiassistantserializedstate.showthinkingsteps.md +0 -14
- package/docs/api/ai-assistant.aiassistantserializedstate.showtoolcalls.md +0 -14
- package/docs/api/ai-assistant.aiassistantstate.md +0 -16
- package/docs/api/ai-assistant.aichatwidget.data.md +0 -14
- package/docs/api/ai-assistant.aichatwidget.md +0 -80
- package/docs/api/ai-assistant.aichatwidget.resolved.md +0 -16
- package/docs/api/ai-assistant.animation_defs.md +0 -25
- package/docs/api/ai-assistant.chatdriver._constructor_.md +0 -131
- package/docs/api/ai-assistant.chatdriver.gethistory.md +0 -18
- package/docs/api/ai-assistant.chatdriver.isbusy.md +0 -18
- package/docs/api/ai-assistant.chatdriver.loadhistory.md +0 -55
- package/docs/api/ai-assistant.chatdriver.md +0 -158
- package/docs/api/ai-assistant.chatdriver.requestinteraction.md +0 -73
- package/docs/api/ai-assistant.chatdriver.resolveinteraction.md +0 -69
- package/docs/api/ai-assistant.chatdriver.sendmessage.md +0 -69
- package/docs/api/ai-assistant.chathistoryupdatedevent.md +0 -16
- package/docs/api/ai-assistant.foundationaiassistant.agents.md +0 -16
- package/docs/api/ai-assistant.foundationaiassistant.aiprovider.md +0 -14
- package/docs/api/ai-assistant.foundationaiassistant.applystate.md +0 -55
- package/docs/api/ai-assistant.foundationaiassistant.attachmenterrors.md +0 -14
- package/docs/api/ai-assistant.foundationaiassistant.attachments.md +0 -14
- package/docs/api/ai-assistant.foundationaiassistant.chatconfig.md +0 -14
- package/docs/api/ai-assistant.foundationaiassistant.connectedcallback.md +0 -18
- package/docs/api/ai-assistant.foundationaiassistant.debugstatefactory.md +0 -14
- package/docs/api/ai-assistant.foundationaiassistant.designsystemprefix.md +0 -14
- package/docs/api/ai-assistant.foundationaiassistant.disconnectedcallback.md +0 -18
- package/docs/api/ai-assistant.foundationaiassistant.downloadhistory.md +0 -18
- package/docs/api/ai-assistant.foundationaiassistant.enabledanimations.md +0 -16
- package/docs/api/ai-assistant.foundationaiassistant.handlefileselect.md +0 -53
- package/docs/api/ai-assistant.foundationaiassistant.handleinteractioncompleted.md +0 -53
- package/docs/api/ai-assistant.foundationaiassistant.handlepopout.md +0 -20
- package/docs/api/ai-assistant.foundationaiassistant.handlesendclick.md +0 -18
- package/docs/api/ai-assistant.foundationaiassistant.hasactivependinginteraction.md +0 -16
- package/docs/api/ai-assistant.foundationaiassistant.headertitle.md +0 -14
- package/docs/api/ai-assistant.foundationaiassistant.imagesrc.md +0 -14
- package/docs/api/ai-assistant.foundationaiassistant.inputvalue.md +0 -14
- package/docs/api/ai-assistant.foundationaiassistant.md +0 -769
- package/docs/api/ai-assistant.foundationaiassistant.messages.md +0 -14
- package/docs/api/ai-assistant.foundationaiassistant.messageschanged.md +0 -18
- package/docs/api/ai-assistant.foundationaiassistant.onchatheadermousedown.md +0 -53
- package/docs/api/ai-assistant.foundationaiassistant.placeholder.md +0 -14
- package/docs/api/ai-assistant.foundationaiassistant.popoutmode.md +0 -16
- package/docs/api/ai-assistant.foundationaiassistant.removeattachment.md +0 -53
- package/docs/api/ai-assistant.foundationaiassistant.removeattachmenterror.md +0 -53
- package/docs/api/ai-assistant.foundationaiassistant.setenabledanimations.md +0 -53
- package/docs/api/ai-assistant.foundationaiassistant.settingsopen.md +0 -16
- package/docs/api/ai-assistant.foundationaiassistant.showhalo.md +0 -16
- package/docs/api/ai-assistant.foundationaiassistant.showhalochanged.md +0 -18
- package/docs/api/ai-assistant.foundationaiassistant.showloadingindicator.md +0 -16
- package/docs/api/ai-assistant.foundationaiassistant.showloadingindicatorchanged.md +0 -18
- package/docs/api/ai-assistant.foundationaiassistant.showthinkingsteps.md +0 -16
- package/docs/api/ai-assistant.foundationaiassistant.showtoolcalls.md +0 -16
- package/docs/api/ai-assistant.foundationaiassistant.state.md +0 -14
- package/docs/api/ai-assistant.foundationaiassistant.statechanged.md +0 -18
- package/docs/api/ai-assistant.foundationaiassistant.togglesettings.md +0 -18
- package/docs/api/ai-assistant.foundationaiassistant.toggleshowthinkingsteps.md +0 -18
- package/docs/api/ai-assistant.foundationaiassistant.toggleshowtoolcalls.md +0 -18
- package/docs/api/ai-assistant.foundationaiassistant.triggerfileinput.md +0 -18
- package/docs/api/ai-assistant.foundationaiassistant.visiblemessages.md +0 -16
- package/docs/api/ai-assistant.md +0 -249
- package/docs/api/ai-assistant.popoutmode.md +0 -16
- package/docs/api/index.md +0 -30
- package/docs/api-report.md.api.md +0 -209
- package/temp/api-report.md.api.md +0 -209
package/dist/ai-assistant.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { AIProvider } from '@genesislcap/foundation-ai';
|
|
2
2
|
import type { ChatAttachment } from '@genesislcap/foundation-ai';
|
|
3
3
|
import type { ChatConfig } from '@genesislcap/foundation-ai';
|
|
4
|
+
import type { ChatDriverResult } from '@genesislcap/foundation-ai';
|
|
4
5
|
import type { ChatMessage } from '@genesislcap/foundation-ai';
|
|
5
6
|
import type { ChatToolDefinition } from '@genesislcap/foundation-ai';
|
|
6
7
|
import type { ChatToolHandlers } from '@genesislcap/foundation-ai';
|
|
@@ -8,42 +9,14 @@ import { GenesisElement } from '@genesislcap/web-core';
|
|
|
8
9
|
import { ViewTemplate } from '@genesislcap/web-core';
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
|
-
* Configuration for
|
|
12
|
+
* Configuration for an agent passed to `FoundationAiAssistant`.
|
|
12
13
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* one agent is configured, routing is skipped.
|
|
14
|
+
* Either a specialist (requires `description`) or a fallback (requires
|
|
15
|
+
* `fallback: true`). Passing both or neither is a compile error.
|
|
16
16
|
*
|
|
17
17
|
* @beta
|
|
18
18
|
*/
|
|
19
|
-
export declare
|
|
20
|
-
/**
|
|
21
|
-
* Display name shown in the chat header when this agent is active.
|
|
22
|
-
*/
|
|
23
|
-
name: string;
|
|
24
|
-
/**
|
|
25
|
-
* Plain-language description of what this agent handles.
|
|
26
|
-
* Used by the classifier to auto-generate its routing prompt.
|
|
27
|
-
*/
|
|
28
|
-
description: string;
|
|
29
|
-
/**
|
|
30
|
-
* System prompt injected into every conversation turn for this agent.
|
|
31
|
-
*/
|
|
32
|
-
systemPrompt?: string;
|
|
33
|
-
/**
|
|
34
|
-
* Tool definitions (JSON Schema) passed to the AI provider for this agent.
|
|
35
|
-
*/
|
|
36
|
-
toolDefinitions?: ChatToolDefinition[];
|
|
37
|
-
/**
|
|
38
|
-
* Tool handler implementations for this agent.
|
|
39
|
-
*/
|
|
40
|
-
toolHandlers?: ChatToolHandlers;
|
|
41
|
-
/**
|
|
42
|
-
* Optional primer history prepended to every call (not visible to the user).
|
|
43
|
-
* Used to establish agent identity and behavioural rules.
|
|
44
|
-
*/
|
|
45
|
-
primerHistory?: ChatMessage[];
|
|
46
|
-
}
|
|
19
|
+
export declare type AgentConfig = SpecialistAgentConfig | FallbackAgentConfig;
|
|
47
20
|
|
|
48
21
|
/**
|
|
49
22
|
* Typed in-process event bus for AI assistant activity events.
|
|
@@ -183,6 +156,7 @@ export declare interface AiAssistantSerializedState {
|
|
|
183
156
|
messages: ChatMessage[];
|
|
184
157
|
showToolCalls: boolean;
|
|
185
158
|
showThinkingSteps: boolean;
|
|
159
|
+
showAgentSwitchIndicator: boolean;
|
|
186
160
|
enabledAnimations: AiAssistantAnimation[];
|
|
187
161
|
}
|
|
188
162
|
|
|
@@ -205,6 +179,67 @@ export declare interface AiChatWidget {
|
|
|
205
179
|
resolved?: boolean;
|
|
206
180
|
}
|
|
207
181
|
|
|
182
|
+
/**
|
|
183
|
+
* Contract for pages that support docking the AI assistant.
|
|
184
|
+
* Register an implementation with {@link getAiPopoutManager} on mount and deregister on unmount.
|
|
185
|
+
*
|
|
186
|
+
* @beta
|
|
187
|
+
*/
|
|
188
|
+
export declare interface AiDockProvider {
|
|
189
|
+
/**
|
|
190
|
+
* Called when the user expands the bubble. Receives the assistant element and the
|
|
191
|
+
* serialized state to restore. The provider is responsible for inserting the element
|
|
192
|
+
* into its layout and calling `applyState` once the element is connected.
|
|
193
|
+
* Resolves when the element is connected and state has been applied.
|
|
194
|
+
*/
|
|
195
|
+
onDock(element: HTMLElement, state: AiAssistantSerializedState | undefined): Promise<void>;
|
|
196
|
+
/** Called when the user collapses the panel or before navigation. */
|
|
197
|
+
onUndock(): Promise<void>;
|
|
198
|
+
/**
|
|
199
|
+
* Called by `collapseIfDocked` before navigation. The provider is responsible for
|
|
200
|
+
* finding the docked assistant element and calling `handlePopout()` on it, which
|
|
201
|
+
* publishes `chat-popin` and returns the assistant to the bubble.
|
|
202
|
+
*/
|
|
203
|
+
initiateCollapse(): void;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Common interface implemented by both `ChatDriver` (single-agent) and
|
|
208
|
+
* `OrchestratingDriver` (multi-agent). `FoundationAiAssistant` depends only
|
|
209
|
+
* on this interface — the concrete class is chosen at startup based on how
|
|
210
|
+
* many agents are configured.
|
|
211
|
+
*
|
|
212
|
+
* Extends `EventTarget` so consumers can subscribe to `history-updated` events
|
|
213
|
+
* without knowing the concrete implementation.
|
|
214
|
+
*
|
|
215
|
+
* @beta
|
|
216
|
+
*/
|
|
217
|
+
export declare interface AiDriver extends EventTarget {
|
|
218
|
+
/**
|
|
219
|
+
* Send a user message and run the tool loop to completion.
|
|
220
|
+
*/
|
|
221
|
+
sendMessage(input: string, attachments?: ChatAttachment[]): Promise<ChatDriverResult>;
|
|
222
|
+
/**
|
|
223
|
+
* Continue the tool loop from the current history without appending a new
|
|
224
|
+
* user message. Used by `OrchestratingDriver` on agent handoffs — the
|
|
225
|
+
* handoff context is already in history; `transientPrimer` is injected as
|
|
226
|
+
* an invisible one-shot message for this call only.
|
|
227
|
+
*/
|
|
228
|
+
continueFromHistory(transientPrimer?: ChatMessage[]): Promise<ChatDriverResult>;
|
|
229
|
+
/**
|
|
230
|
+
* Resolve a pending blocking interaction with the given result.
|
|
231
|
+
*/
|
|
232
|
+
resolveInteraction(interactionId: string, result: unknown): void;
|
|
233
|
+
/**
|
|
234
|
+
* Seed the driver's message history (called on state restore / pop-in).
|
|
235
|
+
*/
|
|
236
|
+
loadHistory(messages: ChatMessage[]): void;
|
|
237
|
+
/**
|
|
238
|
+
* Return the full, unredacted conversation history.
|
|
239
|
+
*/
|
|
240
|
+
getRawHistory?(): readonly ChatMessage[];
|
|
241
|
+
}
|
|
242
|
+
|
|
208
243
|
/**
|
|
209
244
|
* All available animation names, derived from the registry.
|
|
210
245
|
*
|
|
@@ -229,6 +264,30 @@ export declare const ANIMATION_DEFS: {
|
|
|
229
264
|
};
|
|
230
265
|
};
|
|
231
266
|
|
|
267
|
+
declare interface BaseAgentConfig {
|
|
268
|
+
/**
|
|
269
|
+
* Display name shown in the chat header when this agent is active.
|
|
270
|
+
*/
|
|
271
|
+
name: string;
|
|
272
|
+
/**
|
|
273
|
+
* System prompt injected into every conversation turn for this agent.
|
|
274
|
+
*/
|
|
275
|
+
systemPrompt?: string;
|
|
276
|
+
/**
|
|
277
|
+
* Tool definitions (JSON Schema) passed to the AI provider for this agent.
|
|
278
|
+
*/
|
|
279
|
+
toolDefinitions?: ChatToolDefinition[];
|
|
280
|
+
/**
|
|
281
|
+
* Tool handler implementations for this agent.
|
|
282
|
+
*/
|
|
283
|
+
toolHandlers?: ChatToolHandlers;
|
|
284
|
+
/**
|
|
285
|
+
* Optional primer history prepended to every call (not visible to the user).
|
|
286
|
+
* Used to establish agent identity and behavioural rules.
|
|
287
|
+
*/
|
|
288
|
+
primerHistory?: ChatMessage[];
|
|
289
|
+
}
|
|
290
|
+
|
|
232
291
|
/**
|
|
233
292
|
* Plain TS class that drives a multi-turn chat conversation, including the tool-call loop.
|
|
234
293
|
* Owned by `FoundationAiAssistant` — created in `connectedCallback`, torn down in `disconnectedCallback`.
|
|
@@ -237,18 +296,25 @@ export declare const ANIMATION_DEFS: {
|
|
|
237
296
|
*
|
|
238
297
|
* @beta
|
|
239
298
|
*/
|
|
240
|
-
export declare class ChatDriver extends EventTarget {
|
|
299
|
+
export declare class ChatDriver extends EventTarget implements AiDriver {
|
|
241
300
|
private readonly aiProvider;
|
|
242
|
-
private readonly toolHandlers;
|
|
243
|
-
private readonly toolDefinitions;
|
|
244
|
-
private readonly systemPrompt?;
|
|
245
|
-
private readonly primerHistory?;
|
|
246
301
|
private readonly maxToolIterations;
|
|
247
302
|
private history;
|
|
248
303
|
private busy;
|
|
249
304
|
private pendingInteractions;
|
|
305
|
+
private systemPrompt?;
|
|
306
|
+
private toolDefinitions;
|
|
307
|
+
private toolHandlers;
|
|
308
|
+
private primerHistory?;
|
|
309
|
+
private activeAgentName?;
|
|
250
310
|
constructor(aiProvider: AIProvider, toolHandlers?: ChatToolHandlers, toolDefinitions?: ChatToolDefinition[], systemPrompt?: string, primerHistory?: ChatMessage[], maxToolIterations?: number);
|
|
311
|
+
/**
|
|
312
|
+
* Swap in a new agent's configuration. Called by OrchestratingDriver before
|
|
313
|
+
* each specialist turn so the shared driver runs with the right tools and prompt.
|
|
314
|
+
*/
|
|
315
|
+
applyAgent(config: AgentConfig): void;
|
|
251
316
|
getHistory(): ReadonlyArray<ChatMessage>;
|
|
317
|
+
getRawHistory(): readonly ChatMessage[];
|
|
252
318
|
isBusy(): boolean;
|
|
253
319
|
/**
|
|
254
320
|
* Request a custom UI interaction. Emits a new message with the interaction.
|
|
@@ -268,7 +334,14 @@ export declare class ChatDriver extends EventTarget {
|
|
|
268
334
|
* can continue an existing conversation. Call this before the first user message.
|
|
269
335
|
*/
|
|
270
336
|
loadHistory(messages: ChatMessage[]): void;
|
|
271
|
-
sendMessage(userInput: string, attachments?: ChatAttachment[]): Promise<
|
|
337
|
+
sendMessage(userInput: string, attachments?: ChatAttachment[]): Promise<ChatDriverResult>;
|
|
338
|
+
/**
|
|
339
|
+
* Continue the tool loop from current history without appending a new user message.
|
|
340
|
+
* Used by OrchestratingDriver after an agent handoff — the handoff context is
|
|
341
|
+
* already in history; `transientPrimer` is injected as an invisible one-shot
|
|
342
|
+
* message for this call only.
|
|
343
|
+
*/
|
|
344
|
+
continueFromHistory(transientPrimer?: ChatMessage[]): Promise<ChatDriverResult>;
|
|
272
345
|
private runToolLoop;
|
|
273
346
|
private appendToHistory;
|
|
274
347
|
}
|
|
@@ -280,12 +353,29 @@ export declare class ChatDriver extends EventTarget {
|
|
|
280
353
|
*/
|
|
281
354
|
export declare type ChatHistoryUpdatedEvent = CustomEvent<ReadonlyArray<ChatMessage>>;
|
|
282
355
|
|
|
356
|
+
/**
|
|
357
|
+
* Configuration for a fallback agent.
|
|
358
|
+
*
|
|
359
|
+
* Invoked when the classifier returns no match. Excluded from the classifier
|
|
360
|
+
* prompt. Only one fallback is permitted per agents array.
|
|
361
|
+
*
|
|
362
|
+
* @beta
|
|
363
|
+
*/
|
|
364
|
+
export declare interface FallbackAgentConfig extends BaseAgentConfig {
|
|
365
|
+
/**
|
|
366
|
+
* Marks this agent as the fallback for unrecognised requests.
|
|
367
|
+
*/
|
|
368
|
+
fallback: true;
|
|
369
|
+
description?: never;
|
|
370
|
+
}
|
|
371
|
+
|
|
283
372
|
/**
|
|
284
373
|
* Foundation AI Assistant component.
|
|
285
374
|
*
|
|
286
375
|
* @remarks
|
|
287
376
|
* Inject an `AIProvider` through the DI container. Pass agent configuration via the `agents`
|
|
288
|
-
* property. The component creates a `ChatDriver`
|
|
377
|
+
* property. The component creates a `ChatDriver` (single agent) or `OrchestratingDriver`
|
|
378
|
+
* (multiple agents) to manage the conversation loop.
|
|
289
379
|
*
|
|
290
380
|
* @beta
|
|
291
381
|
*/
|
|
@@ -314,10 +404,13 @@ export declare class FoundationAiAssistant extends GenesisElement {
|
|
|
314
404
|
inputValue: string;
|
|
315
405
|
attachments: ChatAttachment[];
|
|
316
406
|
attachmentErrors: string[];
|
|
407
|
+
activeAgent?: AgentConfig;
|
|
317
408
|
/** Current user-facing toggle state for tool call visibility. */
|
|
318
409
|
showToolCalls: boolean;
|
|
319
410
|
/** Current user-facing toggle state for thinking step visibility. */
|
|
320
411
|
showThinkingSteps: boolean;
|
|
412
|
+
/** Current user-facing toggle state for agent switch indicator visibility. */
|
|
413
|
+
showAgentSwitchIndicator: boolean;
|
|
321
414
|
/** Currently enabled animations. */
|
|
322
415
|
enabledAnimations: AiAssistantAnimation[];
|
|
323
416
|
/** Whether the loading spinner is currently visible. Controlled by the loading delay timer. */
|
|
@@ -328,11 +421,7 @@ export declare class FoundationAiAssistant extends GenesisElement {
|
|
|
328
421
|
private loadingTimer;
|
|
329
422
|
private unsubBus?;
|
|
330
423
|
private haloStartPublished;
|
|
331
|
-
|
|
332
|
-
* Whether the halo animation should be shown.
|
|
333
|
-
* True when the AI is actively computing (loading state, no pending interaction).
|
|
334
|
-
*/
|
|
335
|
-
showHalo: boolean;
|
|
424
|
+
showHalo: 'no' | 'orchestrating' | 'agent';
|
|
336
425
|
private syncShowHalo;
|
|
337
426
|
/** True when there is a pending (unresolved) interaction — disables the popout button. */
|
|
338
427
|
get hasActivePendingInteraction(): boolean;
|
|
@@ -363,8 +452,17 @@ export declare class FoundationAiAssistant extends GenesisElement {
|
|
|
363
452
|
toggleSettings(): void;
|
|
364
453
|
toggleShowToolCalls(): void;
|
|
365
454
|
toggleShowThinkingSteps(): void;
|
|
455
|
+
toggleShowAgentSwitchIndicator(): void;
|
|
366
456
|
setEnabledAnimations(animations: AiAssistantAnimation[]): void;
|
|
367
|
-
|
|
457
|
+
getDebugLog(): {
|
|
458
|
+
messages: readonly ChatMessage[];
|
|
459
|
+
agentSummary: AgentConfig[];
|
|
460
|
+
host: string;
|
|
461
|
+
activeSystemPrompt: string;
|
|
462
|
+
activePrimerHistory: ChatMessage[];
|
|
463
|
+
debug: unknown;
|
|
464
|
+
};
|
|
465
|
+
downloadDebugLog(): void;
|
|
368
466
|
triggerFileInput(): void;
|
|
369
467
|
handleFileSelect(e: Event): void;
|
|
370
468
|
removeAttachment(attachment: ChatAttachment): void;
|
|
@@ -382,6 +480,100 @@ export declare class FoundationAiAssistant extends GenesisElement {
|
|
|
382
480
|
/** @internal */
|
|
383
481
|
export declare const FoundationAiAssistantTemplate: (designSystemPrefix: string) => ViewTemplate<FoundationAiAssistant>;
|
|
384
482
|
|
|
483
|
+
/**
|
|
484
|
+
* App-shell component that owns the pop-out/pop-in lifecycle for the AI assistant bubble.
|
|
485
|
+
*
|
|
486
|
+
* @remarks
|
|
487
|
+
* Place this in the persistent app shell, wrapping a `foundation-ai-chat-bubble` that
|
|
488
|
+
* contains an AI assistant element in the `dialog-content` slot. The component will
|
|
489
|
+
* auto-create a matching collapse-mode element for docking into pages, and will
|
|
490
|
+
* control the expand button visibility based on whether a dock provider is registered.
|
|
491
|
+
*
|
|
492
|
+
* Pages that support docking call `aiPopoutManager.registerDockProvider()` on mount
|
|
493
|
+
* and `aiPopoutManager.deregisterDockProvider()` on unmount.
|
|
494
|
+
*
|
|
495
|
+
* @example
|
|
496
|
+
* ```html
|
|
497
|
+
* <foundation-ai-popout-manager>
|
|
498
|
+
* <foundation-ai-chat-bubble title="My Assistant">
|
|
499
|
+
* <my-assistant slot="dialog-content"></my-assistant>
|
|
500
|
+
* </foundation-ai-chat-bubble>
|
|
501
|
+
* </foundation-ai-popout-manager>
|
|
502
|
+
* ```
|
|
503
|
+
*
|
|
504
|
+
* @beta
|
|
505
|
+
*/
|
|
506
|
+
export declare class FoundationAiPopoutManager extends GenesisElement {
|
|
507
|
+
/** True when a dock provider is registered — controls expand button visibility. */
|
|
508
|
+
canDock: boolean;
|
|
509
|
+
private collapseEl;
|
|
510
|
+
private dockProvider;
|
|
511
|
+
private isDocked;
|
|
512
|
+
private unsubBus?;
|
|
513
|
+
connectedCallback(): void;
|
|
514
|
+
disconnectedCallback(): void;
|
|
515
|
+
canDockChanged(): void;
|
|
516
|
+
registerDockProvider(provider: AiDockProvider): void;
|
|
517
|
+
deregisterDockProvider(): void;
|
|
518
|
+
/**
|
|
519
|
+
* If the assistant is currently docked, collapses it back into the bubble.
|
|
520
|
+
* Await this in `onBeforeNavButtonClick` to ensure cleanup before navigation.
|
|
521
|
+
*/
|
|
522
|
+
collapseIfDocked(): Promise<void>;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
/**
|
|
526
|
+
* A warm, conversational fallback agent. Acknowledges it can't help directly,
|
|
527
|
+
* explains what the available specialists can do, and invites the user to retry.
|
|
528
|
+
*
|
|
529
|
+
* The system prompt is generated at runtime by `OrchestratingDriver` from the
|
|
530
|
+
* specialist list — no manual authoring required.
|
|
531
|
+
*
|
|
532
|
+
* @beta
|
|
533
|
+
*/
|
|
534
|
+
export declare const friendlyFallbackAgent: FallbackAgentConfig;
|
|
535
|
+
|
|
536
|
+
/**
|
|
537
|
+
* Returns the active `FoundationAiPopoutManager` instance, or `undefined` if none is mounted.
|
|
538
|
+
* Import this in pages to call `registerDockProvider` / `deregisterDockProvider`.
|
|
539
|
+
*
|
|
540
|
+
* @beta
|
|
541
|
+
*/
|
|
542
|
+
export declare function getAiPopoutManager(): FoundationAiPopoutManager | undefined;
|
|
543
|
+
|
|
544
|
+
/**
|
|
545
|
+
* Orchestrates multiple specialist agents. Sits between `FoundationAiAssistant`
|
|
546
|
+
* and `ChatDriver`, classifying each user message and routing it to the right
|
|
547
|
+
* specialist — each with its own focused system prompt, tools, and primer.
|
|
548
|
+
*
|
|
549
|
+
* @beta
|
|
550
|
+
*/
|
|
551
|
+
export declare class OrchestratingDriver extends EventTarget implements AiDriver {
|
|
552
|
+
private readonly aiProvider;
|
|
553
|
+
private readonly agents;
|
|
554
|
+
private readonly chatDriver;
|
|
555
|
+
private readonly specialists;
|
|
556
|
+
private readonly fallback?;
|
|
557
|
+
private readonly maxHandoffs;
|
|
558
|
+
private readonly classifierHistoryLength;
|
|
559
|
+
private readonly classifierRetries;
|
|
560
|
+
activeAgent?: AgentConfig;
|
|
561
|
+
constructor(aiProvider: AIProvider, agents: AgentConfig[], options?: {
|
|
562
|
+
maxHandoffs?: number;
|
|
563
|
+
classifierHistoryLength?: number;
|
|
564
|
+
classifierRetries?: number;
|
|
565
|
+
maxToolIterations?: number;
|
|
566
|
+
});
|
|
567
|
+
resolveInteraction(interactionId: string, result: unknown): void;
|
|
568
|
+
loadHistory(messages: ChatMessage[]): void;
|
|
569
|
+
getRawHistory(): readonly ChatMessage[];
|
|
570
|
+
sendMessage(input: string, attachments?: ChatAttachment[]): Promise<ChatDriverResult>;
|
|
571
|
+
continueFromHistory(transientPrimer?: ChatMessage[]): Promise<ChatDriverResult>;
|
|
572
|
+
private applyAgent;
|
|
573
|
+
private classify;
|
|
574
|
+
private appendInlineMessage;
|
|
575
|
+
}
|
|
576
|
+
|
|
385
577
|
/**
|
|
386
578
|
* Controls the pop-out button shown in the assistant header.
|
|
387
579
|
* - `"expand"` — assistant is embedded in the bubble dialog; button expands it to a layout panel.
|
|
@@ -391,4 +583,34 @@ export declare const FoundationAiAssistantTemplate: (designSystemPrefix: string)
|
|
|
391
583
|
*/
|
|
392
584
|
export declare type PopoutMode = 'expand' | 'collapse';
|
|
393
585
|
|
|
586
|
+
/** Name reserved for the cross-agent handoff tool — injected by OrchestratingDriver. */
|
|
587
|
+
export declare const REQUEST_CONTINUATION_TOOL = "request_continuation";
|
|
588
|
+
|
|
589
|
+
/**
|
|
590
|
+
* Configuration for a specialist agent.
|
|
591
|
+
*
|
|
592
|
+
* Specialist agents are offered to the classifier for intent routing. The
|
|
593
|
+
* `description` is used to auto-generate the classifier prompt — no manual
|
|
594
|
+
* routing prompt authoring required.
|
|
595
|
+
*
|
|
596
|
+
* @beta
|
|
597
|
+
*/
|
|
598
|
+
export declare interface SpecialistAgentConfig extends BaseAgentConfig {
|
|
599
|
+
/**
|
|
600
|
+
* Plain-language description of what this agent handles.
|
|
601
|
+
* Used by the classifier to auto-generate its routing prompt.
|
|
602
|
+
*/
|
|
603
|
+
description: string;
|
|
604
|
+
fallback?: never;
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
/**
|
|
608
|
+
* A brief, professional fallback agent. States what is available without
|
|
609
|
+
* elaboration. The `{{agents}}` placeholder is replaced at runtime by
|
|
610
|
+
* `OrchestratingDriver` with the generated specialist list.
|
|
611
|
+
*
|
|
612
|
+
* @beta
|
|
613
|
+
*/
|
|
614
|
+
export declare const strictFallbackAgent: FallbackAgentConfig;
|
|
615
|
+
|
|
394
616
|
export { }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-activity-channel.d.ts","sourceRoot":"","sources":["../../../src/channel/ai-activity-channel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MA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AAE,CAAC;IACrD,mGAAmG;IACnG,YAAY,EAAE;QAAE,KAAK,EAAE,0BAA0B,CAAA;KAAE,CAAC;CACrD"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { ChatAttachment, ChatDriverResult, ChatMessage } from '@genesislcap/foundation-ai';
|
|
2
|
+
/**
|
|
3
|
+
* Common interface implemented by both `ChatDriver` (single-agent) and
|
|
4
|
+
* `OrchestratingDriver` (multi-agent). `FoundationAiAssistant` depends only
|
|
5
|
+
* on this interface — the concrete class is chosen at startup based on how
|
|
6
|
+
* many agents are configured.
|
|
7
|
+
*
|
|
8
|
+
* Extends `EventTarget` so consumers can subscribe to `history-updated` events
|
|
9
|
+
* without knowing the concrete implementation.
|
|
10
|
+
*
|
|
11
|
+
* @beta
|
|
12
|
+
*/
|
|
13
|
+
export interface AiDriver extends EventTarget {
|
|
14
|
+
/**
|
|
15
|
+
* Send a user message and run the tool loop to completion.
|
|
16
|
+
*/
|
|
17
|
+
sendMessage(input: string, attachments?: ChatAttachment[]): Promise<ChatDriverResult>;
|
|
18
|
+
/**
|
|
19
|
+
* Continue the tool loop from the current history without appending a new
|
|
20
|
+
* user message. Used by `OrchestratingDriver` on agent handoffs — the
|
|
21
|
+
* handoff context is already in history; `transientPrimer` is injected as
|
|
22
|
+
* an invisible one-shot message for this call only.
|
|
23
|
+
*/
|
|
24
|
+
continueFromHistory(transientPrimer?: ChatMessage[]): Promise<ChatDriverResult>;
|
|
25
|
+
/**
|
|
26
|
+
* Resolve a pending blocking interaction with the given result.
|
|
27
|
+
*/
|
|
28
|
+
resolveInteraction(interactionId: string, result: unknown): void;
|
|
29
|
+
/**
|
|
30
|
+
* Seed the driver's message history (called on state restore / pop-in).
|
|
31
|
+
*/
|
|
32
|
+
loadHistory(messages: ChatMessage[]): void;
|
|
33
|
+
/**
|
|
34
|
+
* Return the full, unredacted conversation history.
|
|
35
|
+
*/
|
|
36
|
+
getRawHistory?(): readonly ChatMessage[];
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=ai-driver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-driver.d.ts","sourceRoot":"","sources":["../../../../src/components/ai-driver/ai-driver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAEhG;;;;;;;;;;GAUG;AACH,MAAM,WAAW,QAAS,SAAQ,WAAW;IAC3C;;OAEG;IACH,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAEtF;;;;;OAKG;IACH,mBAAmB,CAAC,eAAe,CAAC,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAEhF;;OAEG;IACH,kBAAkB,CAAC,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IAEjE;;OAEG;IACH,WAAW,CAAC,QAAQ,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;IAE3C;;OAEG;IACH,aAAa,CAAC,IAAI,SAAS,WAAW,EAAE,CAAC;CAC1C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ai-driver/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import type { AIProvider, ChatAttachment, ChatMessage, ChatToolDefinition, ChatToolHandlers } from '@genesislcap/foundation-ai';
|
|
1
|
+
import type { AIProvider, ChatAttachment, ChatDriverResult, ChatMessage, ChatToolDefinition, ChatToolHandlers } from '@genesislcap/foundation-ai';
|
|
2
|
+
import type { AgentConfig } from '../../config/config';
|
|
3
|
+
import type { AiDriver } from '../ai-driver/ai-driver';
|
|
4
|
+
/** Name reserved for the cross-agent handoff tool — injected by OrchestratingDriver. */
|
|
5
|
+
export declare const REQUEST_CONTINUATION_TOOL = "request_continuation";
|
|
2
6
|
/**
|
|
3
7
|
* Event emitted when the chat history is updated (new message appended).
|
|
4
8
|
*
|
|
@@ -13,18 +17,25 @@ export type ChatHistoryUpdatedEvent = CustomEvent<ReadonlyArray<ChatMessage>>;
|
|
|
13
17
|
*
|
|
14
18
|
* @beta
|
|
15
19
|
*/
|
|
16
|
-
export declare class ChatDriver extends EventTarget {
|
|
20
|
+
export declare class ChatDriver extends EventTarget implements AiDriver {
|
|
17
21
|
private readonly aiProvider;
|
|
18
|
-
private readonly toolHandlers;
|
|
19
|
-
private readonly toolDefinitions;
|
|
20
|
-
private readonly systemPrompt?;
|
|
21
|
-
private readonly primerHistory?;
|
|
22
22
|
private readonly maxToolIterations;
|
|
23
23
|
private history;
|
|
24
24
|
private busy;
|
|
25
25
|
private pendingInteractions;
|
|
26
|
+
private systemPrompt?;
|
|
27
|
+
private toolDefinitions;
|
|
28
|
+
private toolHandlers;
|
|
29
|
+
private primerHistory?;
|
|
30
|
+
private activeAgentName?;
|
|
26
31
|
constructor(aiProvider: AIProvider, toolHandlers?: ChatToolHandlers, toolDefinitions?: ChatToolDefinition[], systemPrompt?: string, primerHistory?: ChatMessage[], maxToolIterations?: number);
|
|
32
|
+
/**
|
|
33
|
+
* Swap in a new agent's configuration. Called by OrchestratingDriver before
|
|
34
|
+
* each specialist turn so the shared driver runs with the right tools and prompt.
|
|
35
|
+
*/
|
|
36
|
+
applyAgent(config: AgentConfig): void;
|
|
27
37
|
getHistory(): ReadonlyArray<ChatMessage>;
|
|
38
|
+
getRawHistory(): readonly ChatMessage[];
|
|
28
39
|
isBusy(): boolean;
|
|
29
40
|
/**
|
|
30
41
|
* Request a custom UI interaction. Emits a new message with the interaction.
|
|
@@ -44,7 +55,14 @@ export declare class ChatDriver extends EventTarget {
|
|
|
44
55
|
* can continue an existing conversation. Call this before the first user message.
|
|
45
56
|
*/
|
|
46
57
|
loadHistory(messages: ChatMessage[]): void;
|
|
47
|
-
sendMessage(userInput: string, attachments?: ChatAttachment[]): Promise<
|
|
58
|
+
sendMessage(userInput: string, attachments?: ChatAttachment[]): Promise<ChatDriverResult>;
|
|
59
|
+
/**
|
|
60
|
+
* Continue the tool loop from current history without appending a new user message.
|
|
61
|
+
* Used by OrchestratingDriver after an agent handoff — the handoff context is
|
|
62
|
+
* already in history; `transientPrimer` is injected as an invisible one-shot
|
|
63
|
+
* message for this call only.
|
|
64
|
+
*/
|
|
65
|
+
continueFromHistory(transientPrimer?: ChatMessage[]): Promise<ChatDriverResult>;
|
|
48
66
|
private runToolLoop;
|
|
49
67
|
private appendToHistory;
|
|
50
68
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-driver.d.ts","sourceRoot":"","sources":["../../../../src/components/chat-driver/chat-driver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,cAAc,EACd,WAAW,EAEX,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"chat-driver.d.ts","sourceRoot":"","sources":["../../../../src/components/chat-driver/chat-driver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,WAAW,EAEX,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAKvD,wFAAwF;AACxF,eAAO,MAAM,yBAAyB,yBAAyB,CAAC;AAEhE;;;;GAIG;AACH,MAAM,MAAM,uBAAuB,GAAG,WAAW,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC;AAE9E;;;;;;;GAOG;AACH,qBAAa,UAAW,SAAQ,WAAY,YAAW,QAAQ;I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WxB"}
|
|
@@ -14,7 +14,19 @@ import { GenesisElement } from '@genesislcap/web-core';
|
|
|
14
14
|
*/
|
|
15
15
|
export declare class AiHaloOverlay extends GenesisElement {
|
|
16
16
|
active: boolean;
|
|
17
|
-
|
|
17
|
+
/** Rotation speed in degrees per frame. Default: 1.5 (≈ 4 s per full revolution at 60 fps). */
|
|
18
|
+
speed: number;
|
|
19
|
+
/** Rotation direction. Default: 'cw' (clockwise). */
|
|
20
|
+
direction: 'cw' | 'ccw';
|
|
21
|
+
/** Border thickness in px. Default: 3. */
|
|
22
|
+
borderSize: number;
|
|
23
|
+
/** Glow layer opacity (0–1). Default: 0.35. */
|
|
24
|
+
glowOpacity: number;
|
|
25
|
+
/** Transparent stop of the radial glow mask as a percentage (0–100). Higher = less spread. Default: 70. */
|
|
26
|
+
glowSpread: number;
|
|
27
|
+
borderSizeChanged(): void;
|
|
28
|
+
glowOpacityChanged(): void;
|
|
29
|
+
glowSpreadChanged(): void;
|
|
18
30
|
private static readonly FULL_ROTATION_DEG;
|
|
19
31
|
private angle;
|
|
20
32
|
private animFrame?;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"halo-overlay.d.ts","sourceRoot":"","sources":["../../../src/components/halo-overlay.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,cAAc,EAAQ,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"halo-overlay.d.ts","sourceRoot":"","sources":["../../../src/components/halo-overlay.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,cAAc,EAAQ,MAAM,uBAAuB,CAAC;AAavF;;;;;;;;;;;;GAYG;AACH,qBA0Ea,aAAc,SAAQ,cAAc;IACpB,MAAM,EAAE,OAAO,CAAS;IACnD,+FAA+F;IACpC,KAAK,EAAE,MAAM,CAAsB;IAC9F,qDAAqD;IAC/C,SAAS,EAAE,IAAI,GAAG,KAAK,CAAQ;IACrC,0CAA0C;IAE1C,UAAU,EAAE,MAAM,CAA4B;IAC9C,+CAA+C;IAE/C,WAAW,EAAE,MAAM,CAA6B;IAChD,2GAA2G;IAE3G,UAAU,EAAE,MAAM,CAA4B;IAE9C,iBAAiB;IAIjB,kBAAkB;IAIlB,iBAAiB;IAUjB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,iBAAiB,CAAO;IAEhD,OAAO,CAAC,KAAK,CAAK;IAClB,OAAO,CAAC,SAAS,CAAC,CAAS;IAE3B,iBAAiB;IAKjB,oBAAoB;IAOpB,OAAO,CAAC,IAAI;CAOb"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/orchestrating-driver/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { AIProvider, ChatAttachment, ChatDriverResult, ChatMessage } from '@genesislcap/foundation-ai';
|
|
2
|
+
import type { AgentConfig } from '../../config/config';
|
|
3
|
+
import type { AiDriver } from '../ai-driver/ai-driver';
|
|
4
|
+
/**
|
|
5
|
+
* Orchestrates multiple specialist agents. Sits between `FoundationAiAssistant`
|
|
6
|
+
* and `ChatDriver`, classifying each user message and routing it to the right
|
|
7
|
+
* specialist — each with its own focused system prompt, tools, and primer.
|
|
8
|
+
*
|
|
9
|
+
* @beta
|
|
10
|
+
*/
|
|
11
|
+
export declare class OrchestratingDriver extends EventTarget implements AiDriver {
|
|
12
|
+
private readonly aiProvider;
|
|
13
|
+
private readonly agents;
|
|
14
|
+
private readonly chatDriver;
|
|
15
|
+
private readonly specialists;
|
|
16
|
+
private readonly fallback?;
|
|
17
|
+
private readonly maxHandoffs;
|
|
18
|
+
private readonly classifierHistoryLength;
|
|
19
|
+
private readonly classifierRetries;
|
|
20
|
+
activeAgent?: AgentConfig;
|
|
21
|
+
constructor(aiProvider: AIProvider, agents: AgentConfig[], options?: {
|
|
22
|
+
maxHandoffs?: number;
|
|
23
|
+
classifierHistoryLength?: number;
|
|
24
|
+
classifierRetries?: number;
|
|
25
|
+
maxToolIterations?: number;
|
|
26
|
+
});
|
|
27
|
+
resolveInteraction(interactionId: string, result: unknown): void;
|
|
28
|
+
loadHistory(messages: ChatMessage[]): void;
|
|
29
|
+
getRawHistory(): readonly ChatMessage[];
|
|
30
|
+
sendMessage(input: string, attachments?: ChatAttachment[]): Promise<ChatDriverResult>;
|
|
31
|
+
continueFromHistory(transientPrimer?: ChatMessage[]): Promise<ChatDriverResult>;
|
|
32
|
+
private applyAgent;
|
|
33
|
+
private classify;
|
|
34
|
+
private appendInlineMessage;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=orchestrating-driver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orchestrating-driver.d.ts","sourceRoot":"","sources":["../../../../src/components/orchestrating-driver/orchestrating-driver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,WAAW,EAEZ,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,WAAW,EAA8C,MAAM,qBAAqB,CAAC;AAEnG,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAiEvD;;;;;;GAMG;AACH,qBAAa,mBAAoB,SAAQ,WAAY,YAAW,QAAQ;IAWpE,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,MAAM;IAXzB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;IACxC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA0B;IACtD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAsB;IAChD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IACrC,OAAO,CAAC,QAAQ,CAAC,uBAAuB,CAAS;IACjD,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAS;IAE3C,WAAW,CAAC,EAAE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