@genesislcap/ai-assistant 14.420.0 → 14.421.1
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 +4061 -1416
- package/dist/ai-assistant.d.ts +594 -81
- package/dist/dts/channel/ai-activity-channel.d.ts +4 -22
- package/dist/dts/channel/ai-activity-channel.d.ts.map +1 -1
- package/dist/dts/components/ai-driver/ai-driver.d.ts +52 -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 +63 -8
- package/dist/dts/components/chat-driver/chat-driver.d.ts.map +1 -1
- package/dist/dts/components/chat-interaction-wrapper/chat-interaction-wrapper.d.ts +3 -3
- package/dist/dts/components/chat-interaction-wrapper/chat-interaction-wrapper.d.ts.map +1 -1
- package/dist/dts/components/chat-markdown/chat-markdown.d.ts +1 -1
- package/dist/dts/components/chat-markdown/chat-markdown.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 +39 -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 +72 -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 +6 -0
- package/dist/dts/index.d.ts.map +1 -1
- package/dist/dts/main/main.d.ts +122 -21
- 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/dts/main/main.types.d.ts +16 -0
- package/dist/dts/main/main.types.d.ts.map +1 -1
- package/dist/dts/state/ai-assistant-slice.d.ts +38 -0
- package/dist/dts/state/ai-assistant-slice.d.ts.map +1 -0
- package/dist/dts/state/driver-registry.d.ts +22 -0
- package/dist/dts/state/driver-registry.d.ts.map +1 -0
- package/dist/dts/state/session-store.d.ts +37 -0
- package/dist/dts/state/session-store.d.ts.map +1 -0
- package/dist/dts/suggestions/chat-suggestions.d.ts +7 -0
- package/dist/dts/suggestions/chat-suggestions.d.ts.map +1 -0
- package/dist/dts/types/ai-chat-widget.d.ts +3 -2
- package/dist/dts/types/ai-chat-widget.d.ts.map +1 -1
- package/dist/dts/utils/index.d.ts +1 -0
- package/dist/dts/utils/index.d.ts.map +1 -1
- package/dist/dts/utils/tool-fold.d.ts +133 -0
- package/dist/dts/utils/tool-fold.d.ts.map +1 -0
- 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 +499 -67
- package/dist/esm/components/chat-interaction-wrapper/chat-interaction-wrapper.js +2 -2
- package/dist/esm/components/chat-markdown/chat-markdown.js +1 -1
- 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 +247 -0
- package/dist/esm/components/popout-manager/index.js +1 -0
- package/dist/esm/components/popout-manager/popout-manager.js +126 -0
- package/dist/esm/config/fallback-agents.js +26 -0
- package/dist/esm/config/index.js +1 -0
- package/dist/esm/index.js +6 -0
- package/dist/esm/main/main.js +546 -112
- package/dist/esm/main/main.styles.js +200 -4
- package/dist/esm/main/main.template.js +163 -63
- package/dist/esm/state/ai-assistant-slice.js +54 -0
- package/dist/esm/state/driver-registry.js +46 -0
- package/dist/esm/state/session-store.js +39 -0
- package/dist/esm/suggestions/chat-suggestions.js +147 -0
- package/dist/esm/utils/index.js +1 -0
- package/dist/esm/utils/tool-fold.js +92 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/docs/migration-FUI-2495.md +339 -0
- package/docs/sub_agent.md +310 -0
- package/package.json +16 -15
- package/src/channel/ai-activity-channel.ts +4 -20
- package/src/components/ai-driver/ai-driver.ts +69 -0
- package/src/components/ai-driver/index.ts +1 -0
- package/src/components/chat-driver/chat-driver.ts +600 -73
- package/src/components/chat-interaction-wrapper/chat-interaction-wrapper.ts +3 -3
- package/src/components/chat-markdown/chat-markdown.ts +1 -1
- 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 +328 -0
- package/src/components/popout-manager/index.ts +1 -0
- package/src/components/popout-manager/popout-manager.ts +147 -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 +6 -0
- package/src/main/main.styles.ts +200 -4
- package/src/main/main.template.ts +200 -80
- package/src/main/main.ts +567 -94
- package/src/main/main.types.ts +11 -0
- package/src/state/ai-assistant-slice.ts +80 -0
- package/src/state/driver-registry.ts +51 -0
- package/src/state/session-store.ts +56 -0
- package/src/suggestions/chat-suggestions.ts +158 -0
- package/src/types/ai-chat-widget.ts +4 -2
- package/src/utils/index.ts +1 -0
- package/src/utils/tool-fold.ts +181 -0
- package/docs/multi-agent-architecture.md +0 -198
|
@@ -1,17 +1,3 @@
|
|
|
1
|
-
import type { ChatMessage } from '@genesislcap/foundation-ai';
|
|
2
|
-
import type { AiAssistantAnimation } from '../main/main.types';
|
|
3
|
-
/**
|
|
4
|
-
* Serialized state of a `FoundationAiAssistant` instance.
|
|
5
|
-
* All fields are JSON-serializable.
|
|
6
|
-
*
|
|
7
|
-
* @beta
|
|
8
|
-
*/
|
|
9
|
-
export interface AiAssistantSerializedState {
|
|
10
|
-
messages: ChatMessage[];
|
|
11
|
-
showToolCalls: boolean;
|
|
12
|
-
showThinkingSteps: boolean;
|
|
13
|
-
enabledAnimations: AiAssistantAnimation[];
|
|
14
|
-
}
|
|
15
1
|
/**
|
|
16
2
|
* Event map for the AI activity bus.
|
|
17
3
|
*
|
|
@@ -33,13 +19,9 @@ export interface AgenticActivityEvents {
|
|
|
33
19
|
};
|
|
34
20
|
/** Fired when the assistant finishes all tool processing and returns to idle. */
|
|
35
21
|
'halo-stop': undefined;
|
|
36
|
-
/** Fired when the user clicks the expand button — moves assistant from bubble into layout. */
|
|
37
|
-
'chat-popout':
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
/** Fired when the user clicks the collapse button — moves assistant from layout back to bubble. */
|
|
41
|
-
'chat-popin': {
|
|
42
|
-
state: AiAssistantSerializedState;
|
|
43
|
-
};
|
|
22
|
+
/** Fired when the user clicks the expand button — moves assistant from bubble into layout. State lives in the session store, not in this event. */
|
|
23
|
+
'chat-popout': undefined;
|
|
24
|
+
/** Fired when the user clicks the collapse button — moves assistant from layout back to bubble. State lives in the session store, not in this event. */
|
|
25
|
+
'chat-popin': undefined;
|
|
44
26
|
}
|
|
45
27
|
//# sourceMappingURL=ai-activity-channel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-activity-channel.d.ts","sourceRoot":"","sources":["../../../src/channel/ai-activity-channel.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"ai-activity-channel.d.ts","sourceRoot":"","sources":["../../../src/channel/ai-activity-channel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,qBAAqB;IACpC,2FAA2F;IAC3F,YAAY,EAAE;QAAE,SAAS,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IACtC,iFAAiF;IACjF,WAAW,EAAE,SAAS,CAAC;IACvB,mJAAmJ;IACnJ,aAAa,EAAE,SAAS,CAAC;IACzB,wJAAwJ;IACxJ,YAAY,EAAE,SAAS,CAAC;CACzB"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { ChatAttachment, ChatDriverResult, ChatMessage, ChatToolDefinition } from '@genesislcap/foundation-ai';
|
|
2
|
+
/** @internal */
|
|
3
|
+
export interface AllAgentSummary {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
tools: ChatToolDefinition[];
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Common interface implemented by both `ChatDriver` (single-agent) and
|
|
10
|
+
* `OrchestratingDriver` (multi-agent). `FoundationAiAssistant` depends only
|
|
11
|
+
* on this interface — the concrete class is chosen at startup based on how
|
|
12
|
+
* many agents are configured.
|
|
13
|
+
*
|
|
14
|
+
* Extends `EventTarget` so consumers can subscribe to `history-updated` events
|
|
15
|
+
* without knowing the concrete implementation.
|
|
16
|
+
*
|
|
17
|
+
* @beta
|
|
18
|
+
*/
|
|
19
|
+
export interface AiDriver extends EventTarget {
|
|
20
|
+
/**
|
|
21
|
+
* Send a user message and run the tool loop to completion.
|
|
22
|
+
*/
|
|
23
|
+
sendMessage(input: string, attachments?: ChatAttachment[]): Promise<ChatDriverResult>;
|
|
24
|
+
/**
|
|
25
|
+
* Continue the tool loop from the current history without appending a new
|
|
26
|
+
* user message. Used by `OrchestratingDriver` on agent handoffs — the
|
|
27
|
+
* handoff context is already in history; `transientPrimer` is injected as
|
|
28
|
+
* an invisible one-shot message for this call only.
|
|
29
|
+
*/
|
|
30
|
+
continueFromHistory(transientPrimer?: ChatMessage[]): Promise<ChatDriverResult>;
|
|
31
|
+
/**
|
|
32
|
+
* Resolve a pending blocking interaction with the given result.
|
|
33
|
+
*/
|
|
34
|
+
resolveInteraction(interactionId: string, result: unknown): void;
|
|
35
|
+
/**
|
|
36
|
+
* Seed the driver's message history (called on state restore / pop-in).
|
|
37
|
+
*/
|
|
38
|
+
loadHistory(messages: ChatMessage[]): void;
|
|
39
|
+
/**
|
|
40
|
+
* Return the full, unredacted conversation history.
|
|
41
|
+
*/
|
|
42
|
+
getRawHistory?(): readonly ChatMessage[];
|
|
43
|
+
/**
|
|
44
|
+
* Returns true if the driver is currently processing a request.
|
|
45
|
+
*/
|
|
46
|
+
isBusy(): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Get query suggestions from the AI.
|
|
49
|
+
*/
|
|
50
|
+
getSuggestions(history: ChatMessage[], prompt: string, count: number, allAgentInfo?: AllAgentSummary[]): Promise<string[]>;
|
|
51
|
+
}
|
|
52
|
+
//# 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,EACV,cAAc,EACd,gBAAgB,EAChB,WAAW,EACX,kBAAkB,EACnB,MAAM,4BAA4B,CAAC;AAEpC,gBAAgB;AAChB,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,kBAAkB,EAAE,CAAC;CAC7B;AAED;;;;;;;;;;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;IAEzC;;OAEG;IACH,MAAM,IAAI,OAAO,CAAC;IAElB;;OAEG;IACH,cAAc,CACZ,OAAO,EAAE,WAAW,EAAE,EACtB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,YAAY,CAAC,EAAE,eAAe,EAAE,GAC/B,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;CACtB"}
|
|
@@ -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, AllAgentSummary } 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
|
*
|
|
@@ -15,18 +19,45 @@ export type ChatHistoryUpdatedEvent = CustomEvent<ReadonlyArray<ChatMessage>>;
|
|
|
15
19
|
*
|
|
16
20
|
* @beta
|
|
17
21
|
*/
|
|
18
|
-
export declare class ChatDriver extends EventTarget {
|
|
22
|
+
export declare class ChatDriver extends EventTarget implements AiDriver {
|
|
19
23
|
private readonly aiProvider;
|
|
20
|
-
private readonly toolHandlers;
|
|
21
|
-
private readonly toolDefinitions;
|
|
22
|
-
private readonly systemPrompt?;
|
|
23
|
-
private readonly primerHistory?;
|
|
24
24
|
private readonly maxToolIterations;
|
|
25
25
|
private history;
|
|
26
26
|
private busy;
|
|
27
27
|
private pendingInteractions;
|
|
28
|
-
|
|
28
|
+
private systemPrompt?;
|
|
29
|
+
private toolDefinitions;
|
|
30
|
+
private toolHandlers;
|
|
31
|
+
private primerHistory?;
|
|
32
|
+
private activeAgentName?;
|
|
33
|
+
/**
|
|
34
|
+
* When set (e.g. by OrchestratingDriver), applied only to the conversation slice
|
|
35
|
+
* sent to the model — stored `history` stays unchanged for UI and logging.
|
|
36
|
+
*/
|
|
37
|
+
private providerHistoryTransform?;
|
|
38
|
+
/** Stack of fold frames — grows when a fold opens, shrinks when it closes. */
|
|
39
|
+
private foldStack;
|
|
40
|
+
/** Consecutive fold open/close ops without a real tool call. Reset on real tool execution. */
|
|
41
|
+
private consecutiveFoldOps;
|
|
42
|
+
/** Consecutive unknown-tool calls without a real tool call. Reset on real tool execution. */
|
|
43
|
+
private consecutiveUnknownToolCalls;
|
|
44
|
+
private readonly maxFoldOperations;
|
|
45
|
+
constructor(aiProvider: AIProvider, toolHandlers?: ChatToolHandlers, toolDefinitions?: ChatToolDefinition[], systemPrompt?: string, primerHistory?: ChatMessage[], maxToolIterations?: number, maxFoldOperations?: number);
|
|
46
|
+
/**
|
|
47
|
+
* Swap in a new agent's configuration. Called by OrchestratingDriver before
|
|
48
|
+
* each specialist turn so the shared driver runs with the right tools and prompt.
|
|
49
|
+
*/
|
|
50
|
+
applyAgent(config: AgentConfig): void;
|
|
51
|
+
/**
|
|
52
|
+
* Optional transform applied to conversation history immediately before each LLM request.
|
|
53
|
+
* Cleared when `undefined`. Does not alter stored history.
|
|
54
|
+
*/
|
|
55
|
+
setProviderHistoryTransform(transform?: (history: ChatMessage[]) => ChatMessage[]): void;
|
|
29
56
|
getHistory(): ReadonlyArray<ChatMessage>;
|
|
57
|
+
getRawHistory(): readonly ChatMessage[];
|
|
58
|
+
/** Returns the current fold stack names for debugging. */
|
|
59
|
+
getActiveFoldNames(): string[];
|
|
60
|
+
getSuggestions(history: ChatMessage[], prompt: string, count: number, allAgentInfo?: AllAgentSummary[]): Promise<string[]>;
|
|
30
61
|
isBusy(): boolean;
|
|
31
62
|
/**
|
|
32
63
|
* Request a custom UI interaction. Emits a new message with the interaction.
|
|
@@ -46,7 +77,31 @@ export declare class ChatDriver extends EventTarget {
|
|
|
46
77
|
* can continue an existing conversation. Call this before the first user message.
|
|
47
78
|
*/
|
|
48
79
|
loadHistory(messages: ChatMessage[]): void;
|
|
49
|
-
sendMessage(userInput: string, attachments?: ChatAttachment[]): Promise<
|
|
80
|
+
sendMessage(userInput: string, attachments?: ChatAttachment[]): Promise<ChatDriverResult>;
|
|
81
|
+
/**
|
|
82
|
+
* Continue the tool loop from current history without appending a new user message.
|
|
83
|
+
* Used by OrchestratingDriver after an agent handoff.
|
|
84
|
+
*/
|
|
85
|
+
continueFromHistory(transientPrimer?: ChatMessage[]): Promise<ChatDriverResult>;
|
|
86
|
+
/** Extract ToolFold metadata from a handler, or undefined if it isn't a fold facade. */
|
|
87
|
+
private getFold;
|
|
88
|
+
/**
|
|
89
|
+
* Search all currently registered fold facades (and their nested folds recursively)
|
|
90
|
+
* to find which fold contains a given tool name. Returns the immediate parent fold name.
|
|
91
|
+
*/
|
|
92
|
+
private findFoldContaining;
|
|
93
|
+
/**
|
|
94
|
+
* Install the fold's inner tool set, replacing (exclusive) or extending (non-exclusive)
|
|
95
|
+
* the current tool set. Also injects the close tool. Does NOT touch the fold stack.
|
|
96
|
+
*/
|
|
97
|
+
private applyFoldToolSet;
|
|
98
|
+
/** Open a fold: push a stack frame, swap the tool set, return the response message. */
|
|
99
|
+
private openFold;
|
|
100
|
+
private pushFoldFrame;
|
|
101
|
+
/** Close the top fold: pop the stack frame, restore the previous tool set. */
|
|
102
|
+
private closeFold;
|
|
103
|
+
/** Build the fold-awareness suffix appended to the system prompt each LLM call. */
|
|
104
|
+
private buildFoldSystemPromptSuffix;
|
|
50
105
|
private runToolLoop;
|
|
51
106
|
private appendToHistory;
|
|
52
107
|
}
|
|
@@ -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,
|
|
1
|
+
{"version":3,"file":"chat-driver.d.ts","sourceRoot":"","sources":["../../../../src/components/chat-driver/chat-driver.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InteractionResult } from '@genesislcap/foundation-ai';
|
|
1
|
+
import type { InteractionResult } from '@genesislcap/foundation-ai';
|
|
2
2
|
import { GenesisElement } from '@genesislcap/web-core';
|
|
3
3
|
export type ChatInteractionEventsMap = {
|
|
4
4
|
'interaction-completed': InteractionResult<unknown> & {
|
|
@@ -18,8 +18,8 @@ export declare class AiChatInteractionWrapper extends GenesisElement {
|
|
|
18
18
|
data: any;
|
|
19
19
|
/** @internal */
|
|
20
20
|
interactionId: string;
|
|
21
|
-
/**
|
|
22
|
-
resolved:
|
|
21
|
+
/** The resolved result once the interaction has completed. Forwarded to the rendered component. @internal */
|
|
22
|
+
resolved: InteractionResult<unknown> | undefined;
|
|
23
23
|
/** @internal */
|
|
24
24
|
container: HTMLElement;
|
|
25
25
|
connectedCallback(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-interaction-wrapper.d.ts","sourceRoot":"","sources":["../../../../src/components/chat-interaction-wrapper/chat-interaction-wrapper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"chat-interaction-wrapper.d.ts","sourceRoot":"","sources":["../../../../src/components/chat-interaction-wrapper/chat-interaction-wrapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAiB,cAAc,EAAc,MAAM,uBAAuB,CAAC;AAKlF,MAAM,MAAM,wBAAwB,GAAG;IACrC,uBAAuB,EAAE,iBAAiB,CAAC,OAAO,CAAC,GAAG;QAAE,aAAa,EAAE,MAAM,CAAA;KAAE,CAAC;CACjF,CAAC;AAEF;;;;;GAKG;AACH,qBAKa,wBAAyB,SAAQ,cAAc;IAC1D,gBAAgB;IACJ,aAAa,EAAE,MAAM,CAAM;IACvC,gBAAgB;IACJ,IAAI,EAAE,GAAG,CAAC;IACtB,gBAAgB;IACJ,aAAa,EAAE,MAAM,CAAM;IACvC,6GAA6G;IACjG,QAAQ,EAAE,iBAAiB,CAAC,OAAO,CAAC,GAAG,SAAS,CAAa;IAEzE,gBAAgB;IAChB,SAAS,EAAG,WAAW,CAAC;IAExB,iBAAiB;IAKjB,oBAAoB;IAIpB,eAAe;IAOf,OAAO,CAAC,eAAe;CA8CxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-markdown.d.ts","sourceRoot":"","sources":["../../../../src/components/chat-markdown/chat-markdown.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,cAAc,EAAoB,MAAM,uBAAuB,CAAC;AAuE7F,qBAOa,cAAe,SAAQ,cAAc;IAChD,
|
|
1
|
+
{"version":3,"file":"chat-markdown.d.ts","sourceRoot":"","sources":["../../../../src/components/chat-markdown/chat-markdown.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,cAAc,EAAoB,MAAM,uBAAuB,CAAC;AAuE7F,qBAOa,cAAe,SAAQ,cAAc;IAChD,qCAAqC;IACzB,OAAO,EAAE,MAAM,CAAM;IAEjC,gBAAgB;IAChB,cAAc;CAKf"}
|
|
@@ -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,39 @@
|
|
|
1
|
+
import type { AIProvider, ChatAttachment, ChatDriverResult, ChatMessage } from '@genesislcap/foundation-ai';
|
|
2
|
+
import type { AgentConfig } from '../../config/config';
|
|
3
|
+
import type { AiDriver, AllAgentSummary } 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
|
+
maxFoldOperations?: number;
|
|
27
|
+
});
|
|
28
|
+
resolveInteraction(interactionId: string, result: unknown): void;
|
|
29
|
+
isBusy(): boolean;
|
|
30
|
+
loadHistory(messages: ChatMessage[]): void;
|
|
31
|
+
getRawHistory(): readonly ChatMessage[];
|
|
32
|
+
getSuggestions(history: ChatMessage[], prompt: string, count: number, allAgentInfo?: AllAgentSummary[]): Promise<string[]>;
|
|
33
|
+
sendMessage(input: string, attachments?: ChatAttachment[]): Promise<ChatDriverResult>;
|
|
34
|
+
continueFromHistory(transientPrimer?: ChatMessage[]): Promise<ChatDriverResult>;
|
|
35
|
+
private applyAgent;
|
|
36
|
+
private classify;
|
|
37
|
+
private appendInlineMessage;
|
|
38
|
+
}
|
|
39
|
+
//# 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,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAoExE;;;;;;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,WAAW,CAAC;gBAGP,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,WAAW,EAAE,EACtC,OAAO,GAAE;QACP,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,uBAAuB,CAAC,EAAE,MAAM,CAAC;QACjC,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAC;KACvB;IAqCR,kBAAkB,CAAC,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI;IAIhE,MAAM,IAAI,OAAO;IAIjB,WAAW,CAAC,QAAQ,EAAE,WAAW,EAAE,GAAG,IAAI;IAI1C,aAAa,IAAI,SAAS,WAAW,EAAE;IAIjC,cAAc,CAClB,OAAO,EAAE,WAAW,EAAE,EACtB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,YAAY,CAAC,EAAE,eAAe,EAAE,GAC/B,OAAO,CAAC,MAAM,EAAE,CAAC;IASd,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC;IA0DrF,mBAAmB,CAAC,eAAe,CAAC,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAIrF,OAAO,CAAC,UAAU;YAsBJ,QAAQ;IAkEtB,OAAO,CAAC,mBAAmB;CAO5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/popout-manager/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { GenesisElement } from '@genesislcap/web-core';
|
|
2
|
+
/**
|
|
3
|
+
* Contract for pages that support docking the AI assistant.
|
|
4
|
+
* Register an implementation with {@link getAiPopoutManager} on mount and deregister on unmount.
|
|
5
|
+
*
|
|
6
|
+
* @beta
|
|
7
|
+
*/
|
|
8
|
+
export interface AiDockProvider {
|
|
9
|
+
/**
|
|
10
|
+
* Called when the user expands the bubble. The provider is responsible for inserting
|
|
11
|
+
* the element into its layout. State is held in the session store and restored
|
|
12
|
+
* automatically when the element connects.
|
|
13
|
+
*/
|
|
14
|
+
onDock(element: HTMLElement): Promise<void>;
|
|
15
|
+
/** Called when the user collapses the panel or before navigation. */
|
|
16
|
+
onUndock(): Promise<void>;
|
|
17
|
+
/**
|
|
18
|
+
* Called by `collapseIfDocked` before navigation. The provider is responsible for
|
|
19
|
+
* finding the docked assistant element and calling `handlePopout()` on it, which
|
|
20
|
+
* publishes `chat-popin` and returns the assistant to the bubble.
|
|
21
|
+
*/
|
|
22
|
+
initiateCollapse(): void;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* App-shell component that owns the pop-out/pop-in lifecycle for the AI assistant bubble.
|
|
26
|
+
*
|
|
27
|
+
* @remarks
|
|
28
|
+
* Place this in the persistent app shell, wrapping a `foundation-ai-chat-bubble` that
|
|
29
|
+
* contains an AI assistant element in the `dialog-content` slot. The component will
|
|
30
|
+
* auto-create a matching collapse-mode element for docking into pages, and will
|
|
31
|
+
* control the expand button visibility based on whether a dock provider is registered.
|
|
32
|
+
*
|
|
33
|
+
* Pages that support docking call `aiPopoutManager.registerDockProvider()` on mount
|
|
34
|
+
* and `aiPopoutManager.deregisterDockProvider()` on unmount.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```html
|
|
38
|
+
* <foundation-ai-popout-manager>
|
|
39
|
+
* <foundation-ai-chat-bubble title="My Assistant">
|
|
40
|
+
* <my-assistant slot="dialog-content"></my-assistant>
|
|
41
|
+
* </foundation-ai-chat-bubble>
|
|
42
|
+
* </foundation-ai-popout-manager>
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* @beta
|
|
46
|
+
*/
|
|
47
|
+
export declare class FoundationAiPopoutManager extends GenesisElement {
|
|
48
|
+
/** True when a dock provider is registered — controls expand button visibility. */
|
|
49
|
+
canDock: boolean;
|
|
50
|
+
private collapseEl;
|
|
51
|
+
private dockProvider;
|
|
52
|
+
private isDocked;
|
|
53
|
+
private unsubBus?;
|
|
54
|
+
connectedCallback(): void;
|
|
55
|
+
disconnectedCallback(): void;
|
|
56
|
+
canDockChanged(): void;
|
|
57
|
+
registerDockProvider(provider: AiDockProvider): void;
|
|
58
|
+
deregisterDockProvider(): void;
|
|
59
|
+
/**
|
|
60
|
+
* If the assistant is currently docked, collapses it back into the bubble.
|
|
61
|
+
* Await this in `onBeforeNavButtonClick` to ensure cleanup before navigation.
|
|
62
|
+
*/
|
|
63
|
+
collapseIfDocked(): Promise<void>;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Returns the active `FoundationAiPopoutManager` instance, or `undefined` if none is mounted.
|
|
67
|
+
* Import this in pages to call `registerDockProvider` / `deregisterDockProvider`.
|
|
68
|
+
*
|
|
69
|
+
* @beta
|
|
70
|
+
*/
|
|
71
|
+
export declare function getAiPopoutManager(): FoundationAiPopoutManager | undefined;
|
|
72
|
+
//# sourceMappingURL=popout-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"popout-manager.d.ts","sourceRoot":"","sources":["../../../../src/components/popout-manager/popout-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,cAAc,EAAoB,MAAM,uBAAuB,CAAC;AAGxF;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;OAIG;IACH,MAAM,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5C,qEAAqE;IACrE,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B;;;;OAIG;IACH,gBAAgB,IAAI,IAAI,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAMa,yBAA0B,SAAQ,cAAc;IAC3D,mFAAmF;IACvE,OAAO,UAAS;IAE5B,OAAO,CAAC,UAAU,CAA4B;IAC9C,OAAO,CAAC,YAAY,CAA+B;IACnD,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,QAAQ,CAAC,CAAa;IAE9B,iBAAiB;IAiCjB,oBAAoB;IAOpB,cAAc;IAUd,oBAAoB,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI;IAKpD,sBAAsB,IAAI,IAAI;IAM9B;;;OAGG;IACH,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;CAKlC;AAID;;;;;GAKG;AACH,wBAAgB,kBAAkB,IAAI,yBAAyB,GAAG,SAAS,CAE1E"}
|
|
@@ -1,23 +1,9 @@
|
|
|
1
1
|
import type { ChatMessage, ChatToolDefinition, ChatToolHandlers } from '@genesislcap/foundation-ai';
|
|
2
|
-
|
|
3
|
-
* Configuration for a single specialist agent.
|
|
4
|
-
*
|
|
5
|
-
* When multiple agents are provided to `FoundationAiAssistant`, an orchestrating layer
|
|
6
|
-
* will route each user message to the appropriate specialist based on intent. When only
|
|
7
|
-
* one agent is configured, routing is skipped.
|
|
8
|
-
*
|
|
9
|
-
* @beta
|
|
10
|
-
*/
|
|
11
|
-
export interface AgentConfig {
|
|
2
|
+
interface BaseAgentConfig {
|
|
12
3
|
/**
|
|
13
4
|
* Display name shown in the chat header when this agent is active.
|
|
14
5
|
*/
|
|
15
6
|
name: string;
|
|
16
|
-
/**
|
|
17
|
-
* Plain-language description of what this agent handles.
|
|
18
|
-
* Used by the classifier to auto-generate its routing prompt.
|
|
19
|
-
*/
|
|
20
|
-
description: string;
|
|
21
7
|
/**
|
|
22
8
|
* System prompt injected into every conversation turn for this agent.
|
|
23
9
|
*/
|
|
@@ -36,4 +22,46 @@ export interface AgentConfig {
|
|
|
36
22
|
*/
|
|
37
23
|
primerHistory?: ChatMessage[];
|
|
38
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Configuration for a specialist agent.
|
|
27
|
+
*
|
|
28
|
+
* Specialist agents are offered to the classifier for intent routing. The
|
|
29
|
+
* `description` is used to auto-generate the classifier prompt — no manual
|
|
30
|
+
* routing prompt authoring required.
|
|
31
|
+
*
|
|
32
|
+
* @beta
|
|
33
|
+
*/
|
|
34
|
+
export interface SpecialistAgentConfig extends BaseAgentConfig {
|
|
35
|
+
/**
|
|
36
|
+
* Plain-language description of what this agent handles.
|
|
37
|
+
* Used by the classifier to auto-generate its routing prompt.
|
|
38
|
+
*/
|
|
39
|
+
description: string;
|
|
40
|
+
fallback?: never;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Configuration for a fallback agent.
|
|
44
|
+
*
|
|
45
|
+
* Invoked when the classifier returns no match. Excluded from the classifier
|
|
46
|
+
* prompt. Only one fallback is permitted per agents array.
|
|
47
|
+
*
|
|
48
|
+
* @beta
|
|
49
|
+
*/
|
|
50
|
+
export interface FallbackAgentConfig extends BaseAgentConfig {
|
|
51
|
+
/**
|
|
52
|
+
* Marks this agent as the fallback for unrecognised requests.
|
|
53
|
+
*/
|
|
54
|
+
fallback: true;
|
|
55
|
+
description?: never;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Configuration for an agent passed to `FoundationAiAssistant`.
|
|
59
|
+
*
|
|
60
|
+
* Either a specialist (requires `description`) or a fallback (requires
|
|
61
|
+
* `fallback: true`). Passing both or neither is a compile error.
|
|
62
|
+
*
|
|
63
|
+
* @beta
|
|
64
|
+
*/
|
|
65
|
+
export type AgentConfig = SpecialistAgentConfig | FallbackAgentConfig;
|
|
66
|
+
export {};
|
|
39
67
|
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/config/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAEpG
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/config/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAEpG,UAAU,eAAe;IACvB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,eAAe,CAAC,EAAE,kBAAkB,EAAE,CAAC;IACvC;;OAEG;IACH,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC;;;OAGG;IACH,aAAa,CAAC,EAAE,WAAW,EAAE,CAAC;CAC/B;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,qBAAsB,SAAQ,eAAe;IAC5D;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,KAAK,CAAC;CAClB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,mBAAoB,SAAQ,eAAe;IAC1D;;OAEG;IACH,QAAQ,EAAE,IAAI,CAAC;IACf,WAAW,CAAC,EAAE,KAAK,CAAC;CACrB;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,WAAW,GAAG,qBAAqB,GAAG,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { FallbackAgentConfig } from './config';
|
|
2
|
+
/**
|
|
3
|
+
* A warm, conversational fallback agent. Acknowledges it can't help directly,
|
|
4
|
+
* explains what the available specialists can do, and invites the user to retry.
|
|
5
|
+
*
|
|
6
|
+
* The system prompt is generated at runtime by `OrchestratingDriver` from the
|
|
7
|
+
* specialist list — no manual authoring required.
|
|
8
|
+
*
|
|
9
|
+
* @beta
|
|
10
|
+
*/
|
|
11
|
+
export declare const friendlyFallbackAgent: FallbackAgentConfig;
|
|
12
|
+
/**
|
|
13
|
+
* A brief, professional fallback agent. States what is available without
|
|
14
|
+
* elaboration. The `{{agents}}` placeholder is replaced at runtime by
|
|
15
|
+
* `OrchestratingDriver` with the generated specialist list.
|
|
16
|
+
*
|
|
17
|
+
* @beta
|
|
18
|
+
*/
|
|
19
|
+
export declare const strictFallbackAgent: FallbackAgentConfig;
|
|
20
|
+
//# sourceMappingURL=fallback-agents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fallback-agents.d.ts","sourceRoot":"","sources":["../../../src/config/fallback-agents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAEpD;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,EAAE,mBAInC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,EAAE,mBAIjC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/config/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/config/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC"}
|
package/dist/dts/index.d.ts
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
export * from './main/main';
|
|
2
2
|
export * from './main/main.types';
|
|
3
3
|
export * from './main/main.template';
|
|
4
|
+
export * from './components/ai-driver';
|
|
4
5
|
export * from './components/chat-driver';
|
|
6
|
+
export * from './components/orchestrating-driver';
|
|
7
|
+
export * from './components/popout-manager';
|
|
5
8
|
export * from './channel/ai-activity-channel';
|
|
6
9
|
export * from './channel/ai-activity-bus';
|
|
7
10
|
export * from './config/config';
|
|
11
|
+
export * from './config/fallback-agents';
|
|
12
|
+
export * from './utils/tool-fold';
|
|
8
13
|
export type { AiChatWidget } from './types/ai-chat-widget';
|
|
14
|
+
export { AiChatMarkdown } from './components/chat-markdown/chat-markdown';
|
|
9
15
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/dts/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,YAAY,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mCAAmC,CAAC;AAClD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,YAAY,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC"}
|