@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
package/dist/dts/main/main.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { AIProvider } from '@genesislcap/foundation-ai';
|
|
2
2
|
import type { ChatAttachment, ChatConfig, ChatMessage } from '@genesislcap/foundation-ai';
|
|
3
3
|
import { GenesisElement } from '@genesislcap/web-core';
|
|
4
|
-
import type { AiAssistantSerializedState } from '../channel/ai-activity-channel';
|
|
5
4
|
import type { AgentConfig } from '../config/config';
|
|
6
|
-
import type { AiAssistantAnimation, AiAssistantState, PopoutMode } from './main.types';
|
|
5
|
+
import type { AiAssistantAnimation, AiAssistantState, PopoutMode, SuggestionsState } from './main.types';
|
|
7
6
|
/**
|
|
8
7
|
* Foundation AI Assistant component.
|
|
9
8
|
*
|
|
10
9
|
* @remarks
|
|
11
10
|
* Inject an `AIProvider` through the DI container. Pass agent configuration via the `agents`
|
|
12
|
-
* property. The component creates a `ChatDriver`
|
|
11
|
+
* property. The component creates a `ChatDriver` (single agent) or `OrchestratingDriver`
|
|
12
|
+
* (multiple agents) to manage the conversation loop.
|
|
13
13
|
*
|
|
14
14
|
* Popout/collapse coordination uses `agenticActivityBus` topics `chat-popout` and `chat-popin` — not DOM `CustomEvent`s on this element.
|
|
15
15
|
*
|
|
@@ -20,7 +20,7 @@ import type { AiAssistantAnimation, AiAssistantState, PopoutMode } from './main.
|
|
|
20
20
|
export declare class FoundationAiAssistant extends GenesisElement {
|
|
21
21
|
aiProvider: AIProvider;
|
|
22
22
|
designSystemPrefix: string;
|
|
23
|
-
headerTitle
|
|
23
|
+
headerTitle: string;
|
|
24
24
|
imageSrc?: string;
|
|
25
25
|
placeholder: string;
|
|
26
26
|
/**
|
|
@@ -37,30 +37,67 @@ export declare class FoundationAiAssistant extends GenesisElement {
|
|
|
37
37
|
agents?: AgentConfig[];
|
|
38
38
|
chatConfig: ChatConfig;
|
|
39
39
|
debugStateFactory?: () => unknown;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
/** When set, enables Redux DevTools for this instance's session store. */
|
|
41
|
+
debugRedux: boolean;
|
|
42
|
+
private _sessionRef?;
|
|
43
|
+
get messages(): ChatMessage[];
|
|
44
|
+
set messages(value: ChatMessage[]);
|
|
45
|
+
get state(): AiAssistantState;
|
|
46
|
+
set state(value: AiAssistantState);
|
|
47
|
+
get activeAgent(): Omit<AgentConfig, 'toolHandlers'> | undefined;
|
|
48
|
+
set activeAgent(value: AgentConfig | undefined);
|
|
49
|
+
get suggestionsState(): SuggestionsState;
|
|
50
|
+
set suggestionsState(value: SuggestionsState);
|
|
45
51
|
/** Current user-facing toggle state for tool call visibility. */
|
|
46
|
-
showToolCalls: boolean;
|
|
52
|
+
get showToolCalls(): boolean;
|
|
53
|
+
set showToolCalls(value: boolean);
|
|
47
54
|
/** Current user-facing toggle state for thinking step visibility. */
|
|
48
|
-
showThinkingSteps: boolean;
|
|
55
|
+
get showThinkingSteps(): boolean;
|
|
56
|
+
set showThinkingSteps(value: boolean);
|
|
57
|
+
/** Current user-facing toggle state for agent switch indicator visibility. */
|
|
58
|
+
get showAgentSwitchIndicator(): boolean;
|
|
59
|
+
set showAgentSwitchIndicator(value: boolean);
|
|
49
60
|
/** Currently enabled animations. */
|
|
50
|
-
enabledAnimations: AiAssistantAnimation[];
|
|
61
|
+
get enabledAnimations(): AiAssistantAnimation[];
|
|
62
|
+
set enabledAnimations(value: AiAssistantAnimation[]);
|
|
63
|
+
/** Most recent prompt token count from the AI provider, if available. */
|
|
64
|
+
get contextTokens(): number | undefined;
|
|
65
|
+
set contextTokens(value: number | undefined);
|
|
66
|
+
/** Context window size for the active model, if known. */
|
|
67
|
+
get contextLimit(): number | undefined;
|
|
68
|
+
set contextLimit(value: number | undefined);
|
|
69
|
+
private _suggestionsGeneration;
|
|
70
|
+
get inputValue(): string;
|
|
71
|
+
set inputValue(value: string);
|
|
72
|
+
attachments: ChatAttachment[];
|
|
73
|
+
attachmentErrors: string[];
|
|
51
74
|
/** Whether the loading spinner is currently visible. Controlled by the loading delay timer. */
|
|
52
75
|
showLoadingIndicator: boolean;
|
|
53
76
|
/** Whether the settings panel is open. */
|
|
54
77
|
settingsOpen: boolean;
|
|
78
|
+
/** Whether the splash overlay is currently showing (no messages and showSplash is enabled). Reflected as a boolean attribute on the host. */
|
|
79
|
+
showingSplash: boolean;
|
|
55
80
|
private driver?;
|
|
81
|
+
private driverCleanup?;
|
|
56
82
|
private loadingTimer;
|
|
57
83
|
private unsubBus?;
|
|
58
84
|
private haloStartPublished;
|
|
85
|
+
/** Fingerprint of the agents array used to build the current driver. Used by agentsChanged to skip spurious rebuilds. */
|
|
86
|
+
private _driverAgentsKey?;
|
|
87
|
+
/** Bound to the messages container via the template ref — assigned by FAST before connectedCallback logic runs. */
|
|
88
|
+
messagesEl?: HTMLElement;
|
|
89
|
+
/** True when the user has intentionally scrolled away from the bottom — suppresses auto-scroll. */
|
|
90
|
+
private _userScrolledAway;
|
|
91
|
+
private _scrollListener?;
|
|
92
|
+
private static readonly SCROLL_BOTTOM_THRESHOLD_PX;
|
|
59
93
|
/**
|
|
60
|
-
*
|
|
61
|
-
*
|
|
94
|
+
* Unsubscribes a one-shot state subscription created when this element connects
|
|
95
|
+
* mid-execution. The subscription watches for `state` becoming 'idle' so that
|
|
96
|
+
* this element can stop its loading timer and sync the halo even when the
|
|
97
|
+
* originating `send()` ran on a different element instance.
|
|
62
98
|
*/
|
|
63
|
-
|
|
99
|
+
private _executionCompletionUnsub?;
|
|
100
|
+
showHalo: 'no' | 'orchestrating' | 'agent';
|
|
64
101
|
private syncShowHalo;
|
|
65
102
|
/** True when there is a pending (unresolved) interaction — disables the popout button. */
|
|
66
103
|
get hasActivePendingInteraction(): boolean;
|
|
@@ -70,29 +107,91 @@ export declare class FoundationAiAssistant extends GenesisElement {
|
|
|
70
107
|
* Messages filtered by the current toggle state.
|
|
71
108
|
* Tool-related messages (those with toolCalls or toolResult) are hidden when
|
|
72
109
|
* `showToolCalls` is false.
|
|
110
|
+
*
|
|
111
|
+
* Marked `@volatile` because the filter branches conditionally access
|
|
112
|
+
* `showToolCalls`, `showThinkingSteps`, and `showAgentSwitchIndicator`
|
|
113
|
+
* depending on message content. Without it, FAST would only track the
|
|
114
|
+
* observables accessed on the last evaluation and miss toggle changes that
|
|
115
|
+
* happen to hit an untracked branch.
|
|
73
116
|
*/
|
|
74
117
|
get visibleMessages(): ChatMessage[];
|
|
118
|
+
agentsChanged(): void;
|
|
119
|
+
/** Returns a stable fingerprint for an agents array based on agent names and tool handler keys. */
|
|
120
|
+
private getAgentsKey;
|
|
121
|
+
/**
|
|
122
|
+
* Pure factory — creates a ChatDriver or OrchestratingDriver based on the
|
|
123
|
+
* current agent configuration. Does not wire event listeners or register in
|
|
124
|
+
* the driver registry.
|
|
125
|
+
*/
|
|
126
|
+
private createDriver;
|
|
127
|
+
/**
|
|
128
|
+
* Attaches event listeners to the current driver. Stores a cleanup function
|
|
129
|
+
* so `unwireDriver` can remove them precisely. Safe to call multiple
|
|
130
|
+
* times — unwires any existing listeners first.
|
|
131
|
+
*/
|
|
132
|
+
private wireDriver;
|
|
133
|
+
/**
|
|
134
|
+
* Removes event listeners attached by `wireDriver`. Does not destroy
|
|
135
|
+
* the driver or remove it from the registry.
|
|
136
|
+
*/
|
|
137
|
+
private unwireDriver;
|
|
75
138
|
connectedCallback(): void;
|
|
76
139
|
disconnectedCallback(): void;
|
|
77
|
-
|
|
78
|
-
|
|
140
|
+
private resolveContextLimit;
|
|
141
|
+
chatConfigChanged(): void;
|
|
142
|
+
showingSplashChanged(): void;
|
|
143
|
+
private syncShowingSplash;
|
|
144
|
+
/**
|
|
145
|
+
* Runs side effects that were previously in `messagesChanged()`.
|
|
146
|
+
* Called from the `messages` setter after dispatching to the store.
|
|
147
|
+
*/
|
|
148
|
+
private handleMessagesUpdate;
|
|
79
149
|
showLoadingIndicatorChanged(): void;
|
|
80
150
|
private scrollToBottom;
|
|
81
151
|
private static readonly DEFAULT_LOADING_DELAY_S;
|
|
152
|
+
private static readonly DEFAULT_SUGGESTION_COUNT;
|
|
82
153
|
private static readonly MS_PER_SECOND;
|
|
83
154
|
private startLoadingTimer;
|
|
84
155
|
private clearLoadingTimer;
|
|
85
156
|
private stopLoadingTimer;
|
|
86
157
|
/** Called when the user clicks the popout button. */
|
|
87
158
|
handlePopout(): void;
|
|
88
|
-
/**
|
|
89
|
-
|
|
90
|
-
private serializeState;
|
|
159
|
+
/** Returns a cache key for this instance, or undefined if the component has no identity. */
|
|
160
|
+
private getStateKey;
|
|
91
161
|
toggleSettings(): void;
|
|
92
162
|
toggleShowToolCalls(): void;
|
|
93
163
|
toggleShowThinkingSteps(): void;
|
|
164
|
+
toggleShowAgentSwitchIndicator(): void;
|
|
94
165
|
setEnabledAnimations(animations: AiAssistantAnimation[]): void;
|
|
95
|
-
|
|
166
|
+
getDebugLog(): {
|
|
167
|
+
messages: readonly ChatMessage[];
|
|
168
|
+
meta: {
|
|
169
|
+
timestamp: string;
|
|
170
|
+
host: string;
|
|
171
|
+
agentSummary: ({
|
|
172
|
+
toolDefinitions: import("../utils/tool-fold").ToolTreeNode[];
|
|
173
|
+
toolHandlers: any;
|
|
174
|
+
description: string;
|
|
175
|
+
fallback?: never;
|
|
176
|
+
name: string;
|
|
177
|
+
systemPrompt?: string;
|
|
178
|
+
primerHistory?: ChatMessage[];
|
|
179
|
+
} | {
|
|
180
|
+
toolDefinitions: import("../utils/tool-fold").ToolTreeNode[];
|
|
181
|
+
toolHandlers: any;
|
|
182
|
+
fallback: true;
|
|
183
|
+
description?: never;
|
|
184
|
+
name: string;
|
|
185
|
+
systemPrompt?: string;
|
|
186
|
+
primerHistory?: ChatMessage[];
|
|
187
|
+
})[];
|
|
188
|
+
activeSystemPrompt: string;
|
|
189
|
+
activePrimerHistory: ChatMessage[];
|
|
190
|
+
activeFoldStack: string[];
|
|
191
|
+
debug: unknown;
|
|
192
|
+
};
|
|
193
|
+
};
|
|
194
|
+
downloadDebugLog(): void;
|
|
96
195
|
triggerFileInput(): void;
|
|
97
196
|
handleFileSelect(e: Event): void;
|
|
98
197
|
removeAttachment(attachment: ChatAttachment): void;
|
|
@@ -101,6 +200,8 @@ export declare class FoundationAiAssistant extends GenesisElement {
|
|
|
101
200
|
private readFileAsText;
|
|
102
201
|
private loadSelectedFiles;
|
|
103
202
|
handleSendClick(): void;
|
|
203
|
+
handleSuggestionClick(suggestion: string): void;
|
|
204
|
+
private fetchSuggestions;
|
|
104
205
|
private send;
|
|
105
206
|
private restoreFocusIfAppropriate;
|
|
106
207
|
onChatHeaderMouseDown(e: MouseEvent): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/main/main.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/main/main.ts"],"names":[],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.styles.d.ts","sourceRoot":"","sources":["../../../src/main/main.styles.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"main.styles.d.ts","sourceRoot":"","sources":["../../../src/main/main.styles.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,MAAM,iDA2iBlB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.template.d.ts","sourceRoot":"","sources":["../../../src/main/main.template.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"main.template.d.ts","sourceRoot":"","sources":["../../../src/main/main.template.ts"],"names":[],"mappings":"AAEA,OAAO,EAA2B,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,QAAQ,CAAC;AAuEpD,gBAAgB;AAChB,eAAO,MAAM,6BAA6B,GACxC,oBAAoB,MAAM,KACzB,YAAY,CAAC,qBAAqB,CA6ZpC,CAAC"}
|
|
@@ -12,6 +12,22 @@ export type AiAssistantState = 'idle' | 'loading' | 'error';
|
|
|
12
12
|
* @beta
|
|
13
13
|
*/
|
|
14
14
|
export type PopoutMode = 'expand' | 'collapse';
|
|
15
|
+
/**
|
|
16
|
+
* State of the chat suggestions feature.
|
|
17
|
+
*
|
|
18
|
+
* @beta
|
|
19
|
+
*/
|
|
20
|
+
export type SuggestionsState = {
|
|
21
|
+
status: 'idle';
|
|
22
|
+
} | {
|
|
23
|
+
status: 'loading';
|
|
24
|
+
} | {
|
|
25
|
+
status: 'loaded';
|
|
26
|
+
suggestions: string[];
|
|
27
|
+
} | {
|
|
28
|
+
status: 'error';
|
|
29
|
+
message: string;
|
|
30
|
+
};
|
|
15
31
|
/**
|
|
16
32
|
* Metadata describing a UI animation in the assistant.
|
|
17
33
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.types.d.ts","sourceRoot":"","sources":["../../../src/main/main.types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;AAE5D;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,UAAU,CAAC;AAE/C;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACtC,uDAAuD;IACvD,KAAK,EAAE,MAAM,CAAC;IACd,0DAA0D;IAC1D,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;GAKG;AACH,eAAO,MAAM,cAAc;;;;;;;;;CASwB,CAAC;AAEpD;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAAG,MAAM,OAAO,cAAc,CAAC;AAE/D;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAAkC,oBAAoB,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"main.types.d.ts","sourceRoot":"","sources":["../../../src/main/main.types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;AAE5D;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,UAAU,CAAC;AAE/C;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GACxB;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,GAClB;IAAE,MAAM,EAAE,SAAS,CAAA;CAAE,GACrB;IAAE,MAAM,EAAE,QAAQ,CAAC;IAAC,WAAW,EAAE,MAAM,EAAE,CAAA;CAAE,GAC3C;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAEzC;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACtC,uDAAuD;IACvD,KAAK,EAAE,MAAM,CAAC;IACd,0DAA0D;IAC1D,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;GAKG;AACH,eAAO,MAAM,cAAc;;;;;;;;;CASwB,CAAC;AAEpD;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAAG,MAAM,OAAO,cAAc,CAAC;AAE/D;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAAkC,oBAAoB,EAAE,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { ChatMessage } from '@genesislcap/foundation-ai';
|
|
2
|
+
import type { PayloadAction } from '@genesislcap/foundation-redux';
|
|
3
|
+
import type { AgentConfig } from '../config/config';
|
|
4
|
+
import type { AiAssistantAnimation, AiAssistantState, SuggestionsState } from '../main/main.types';
|
|
5
|
+
/**
|
|
6
|
+
* Shape of a single AI assistant session's serializable state.
|
|
7
|
+
*
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export interface AiAssistantSessionState {
|
|
11
|
+
messages: ChatMessage[];
|
|
12
|
+
state: AiAssistantState;
|
|
13
|
+
showToolCalls: boolean;
|
|
14
|
+
showThinkingSteps: boolean;
|
|
15
|
+
showAgentSwitchIndicator: boolean;
|
|
16
|
+
enabledAnimations: AiAssistantAnimation[];
|
|
17
|
+
suggestionsState: SuggestionsState;
|
|
18
|
+
contextTokens: number | undefined;
|
|
19
|
+
contextLimit: number | undefined;
|
|
20
|
+
activeAgent: Omit<AgentConfig, 'toolHandlers'> | undefined;
|
|
21
|
+
/** Draft text in the input box — preserved across pop-in/pop-out cycles. */
|
|
22
|
+
inputValue: string;
|
|
23
|
+
}
|
|
24
|
+
export declare const defaultSessionState: AiAssistantSessionState;
|
|
25
|
+
export declare const aiAssistantSlice: import("@reduxjs/toolkit").Slice<AiAssistantSessionState, {
|
|
26
|
+
setMessages(state: import("immer").WritableDraft<AiAssistantSessionState>, action: PayloadAction<ChatMessage[]>): void;
|
|
27
|
+
setState(state: import("immer").WritableDraft<AiAssistantSessionState>, action: PayloadAction<AiAssistantState>): void;
|
|
28
|
+
setShowToolCalls(state: import("immer").WritableDraft<AiAssistantSessionState>, action: PayloadAction<boolean>): void;
|
|
29
|
+
setShowThinkingSteps(state: import("immer").WritableDraft<AiAssistantSessionState>, action: PayloadAction<boolean>): void;
|
|
30
|
+
setShowAgentSwitchIndicator(state: import("immer").WritableDraft<AiAssistantSessionState>, action: PayloadAction<boolean>): void;
|
|
31
|
+
setEnabledAnimations(state: import("immer").WritableDraft<AiAssistantSessionState>, action: PayloadAction<AiAssistantAnimation[]>): void;
|
|
32
|
+
setSuggestionsState(state: import("immer").WritableDraft<AiAssistantSessionState>, action: PayloadAction<SuggestionsState>): void;
|
|
33
|
+
setContextTokens(state: import("immer").WritableDraft<AiAssistantSessionState>, action: PayloadAction<number | undefined>): void;
|
|
34
|
+
setContextLimit(state: import("immer").WritableDraft<AiAssistantSessionState>, action: PayloadAction<number | undefined>): void;
|
|
35
|
+
setActiveAgent(state: import("immer").WritableDraft<AiAssistantSessionState>, action: PayloadAction<Omit<AgentConfig, "toolHandlers"> | undefined>): void;
|
|
36
|
+
setInputValue(state: import("immer").WritableDraft<AiAssistantSessionState>, action: PayloadAction<string>): void;
|
|
37
|
+
}, "aiAssistant", "aiAssistant", {}>;
|
|
38
|
+
//# sourceMappingURL=ai-assistant-slice.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-assistant-slice.d.ts","sourceRoot":"","sources":["../../../src/state/ai-assistant-slice.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEnG;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,KAAK,EAAE,gBAAgB,CAAC;IACxB,aAAa,EAAE,OAAO,CAAC;IACvB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,wBAAwB,EAAE,OAAO,CAAC;IAClC,iBAAiB,EAAE,oBAAoB,EAAE,CAAC;IAC1C,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,SAAS,CAAC;IAC3D,4EAA4E;IAC5E,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,mBAAmB,EAAE,uBAYjC,CAAC;AAEF,eAAO,MAAM,gBAAgB;uFAIE,aAAa,CAAC,WAAW,EAAE,CAAC;oFAG/B,aAAa,CAAC,gBAAgB,CAAC;4FAGvB,aAAa,CAAC,OAAO,CAAC;gGAGlB,aAAa,CAAC,OAAO,CAAC;uGAGf,aAAa,CAAC,OAAO,CAAC;gGAG7B,aAAa,CAAC,oBAAoB,EAAE,CAAC;+FAGtC,aAAa,CAAC,gBAAgB,CAAC;4FAGlC,aAAa,CAAC,MAAM,GAAG,SAAS,CAAC;2FAGlC,aAAa,CAAC,MAAM,GAAG,SAAS,CAAC;0FAGlC,aAAa,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,SAAS,CAAC;yFAG7D,aAAa,CAAC,MAAM,CAAC;oCAKpD,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { AiDriver } from '../components/ai-driver/ai-driver';
|
|
2
|
+
/**
|
|
3
|
+
* Returns the existing driver for the given key, or calls the factory
|
|
4
|
+
* to create and register a new one.
|
|
5
|
+
*/
|
|
6
|
+
export declare function getOrCreateDriver(key: string, factory: () => AiDriver): AiDriver;
|
|
7
|
+
/**
|
|
8
|
+
* Returns the existing driver for the given key, or `undefined`.
|
|
9
|
+
*/
|
|
10
|
+
export declare function getDriver(key: string): AiDriver | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Removes and returns the driver for the given key.
|
|
13
|
+
* Used when agents change (driver must be rebuilt) or on explicit session teardown.
|
|
14
|
+
*/
|
|
15
|
+
export declare function deleteDriver(key: string): AiDriver | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Removes all entries. Exposed for test isolation only — not part of the public API.
|
|
18
|
+
*
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
export declare function clearDriverRegistry(): void;
|
|
22
|
+
//# sourceMappingURL=driver-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"driver-registry.d.ts","sourceRoot":"","sources":["../../../src/state/driver-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAclE;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,QAAQ,GAAG,QAAQ,CAMhF;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAE3D;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAI9D;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAE1C"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type AiAssistantSessionState } from './ai-assistant-slice';
|
|
2
|
+
type SessionStoreReturn = ReturnType<typeof makeStore>;
|
|
3
|
+
declare function makeStore(devTools: boolean | undefined): import("@genesislcap/foundation-redux").StoreReturn<import("@reduxjs/toolkit").Slice<AiAssistantSessionState, {
|
|
4
|
+
setMessages(state: import("immer").WritableDraft<AiAssistantSessionState>, action: import("@reduxjs/toolkit").PayloadAction<import("@genesislcap/foundation-ai").ChatMessage[]>): void;
|
|
5
|
+
setState(state: import("immer").WritableDraft<AiAssistantSessionState>, action: import("@reduxjs/toolkit").PayloadAction<import("..").AiAssistantState>): void;
|
|
6
|
+
setShowToolCalls(state: import("immer").WritableDraft<AiAssistantSessionState>, action: import("@reduxjs/toolkit").PayloadAction<boolean>): void;
|
|
7
|
+
setShowThinkingSteps(state: import("immer").WritableDraft<AiAssistantSessionState>, action: import("@reduxjs/toolkit").PayloadAction<boolean>): void;
|
|
8
|
+
setShowAgentSwitchIndicator(state: import("immer").WritableDraft<AiAssistantSessionState>, action: import("@reduxjs/toolkit").PayloadAction<boolean>): void;
|
|
9
|
+
setEnabledAnimations(state: import("immer").WritableDraft<AiAssistantSessionState>, action: import("@reduxjs/toolkit").PayloadAction<import("..").AiAssistantAnimation[]>): void;
|
|
10
|
+
setSuggestionsState(state: import("immer").WritableDraft<AiAssistantSessionState>, action: import("@reduxjs/toolkit").PayloadAction<import("..").SuggestionsState>): void;
|
|
11
|
+
setContextTokens(state: import("immer").WritableDraft<AiAssistantSessionState>, action: import("@reduxjs/toolkit").PayloadAction<number | undefined>): void;
|
|
12
|
+
setContextLimit(state: import("immer").WritableDraft<AiAssistantSessionState>, action: import("@reduxjs/toolkit").PayloadAction<number | undefined>): void;
|
|
13
|
+
setActiveAgent(state: import("immer").WritableDraft<AiAssistantSessionState>, action: import("@reduxjs/toolkit").PayloadAction<Omit<import("..").AgentConfig, "toolHandlers"> | undefined>): void;
|
|
14
|
+
setInputValue(state: import("immer").WritableDraft<AiAssistantSessionState>, action: import("@reduxjs/toolkit").PayloadAction<string>): void;
|
|
15
|
+
}, "aiAssistant", "aiAssistant", {}>[]>;
|
|
16
|
+
/**
|
|
17
|
+
* Returns the session store for the given key, creating one if it does not
|
|
18
|
+
* already exist. Omit `devTools` (or pass `undefined`) to defer to `isDev()`.
|
|
19
|
+
* Pass `true` to force-enable or `false` to force-disable Redux DevTools.
|
|
20
|
+
*/
|
|
21
|
+
export declare function getSessionStore(key: string, devTools?: boolean): SessionStoreReturn;
|
|
22
|
+
/**
|
|
23
|
+
* Returns true if a session store already exists for the given key.
|
|
24
|
+
*/
|
|
25
|
+
export declare function hasSessionStore(key: string): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Deletes the session store for the given key.
|
|
28
|
+
*/
|
|
29
|
+
export declare function deleteSessionStore(key: string): void;
|
|
30
|
+
/**
|
|
31
|
+
* Removes all session stores. Exposed for test isolation only — not part of the public API.
|
|
32
|
+
*
|
|
33
|
+
* @internal
|
|
34
|
+
*/
|
|
35
|
+
export declare function clearAllSessionStores(): void;
|
|
36
|
+
export type { SessionStoreReturn, AiAssistantSessionState };
|
|
37
|
+
//# sourceMappingURL=session-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-store.d.ts","sourceRoot":"","sources":["../../../src/state/session-store.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,uBAAuB,EAC7B,MAAM,sBAAsB,CAAC;AAE9B,KAAK,kBAAkB,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC;AAIvD,iBAAS,SAAS,CAAC,QAAQ,EAAE,OAAO,GAAG,SAAS;;;;;;;;;;;;wCAM/C;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO,GAAG,kBAAkB,CAMnF;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAEpD;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAE5C;AAED,YAAY,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { GenesisElement } from '@genesislcap/web-core';
|
|
2
|
+
import type { SuggestionsState } from '../main/main.types';
|
|
3
|
+
export declare class ChatSuggestions extends GenesisElement {
|
|
4
|
+
state: SuggestionsState;
|
|
5
|
+
handleSuggestionClick(suggestion: string): void;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=chat-suggestions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-suggestions.d.ts","sourceRoot":"","sources":["../../../src/suggestions/chat-suggestions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AA+I3D,qBAKa,eAAgB,SAAQ,cAAc;IAEjD,KAAK,EAAE,gBAAgB,CAAsB;IAE7C,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;CAGhD"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { InteractionResult } from '@genesislcap/foundation-ai';
|
|
1
2
|
/**
|
|
2
3
|
* Interface that AI inline interaction components can implement.
|
|
3
4
|
* The `AiChatInteractionWrapper` always sets `data` and `resolved` on the rendered element.
|
|
@@ -6,7 +7,7 @@
|
|
|
6
7
|
*/
|
|
7
8
|
export interface AiChatWidget {
|
|
8
9
|
data: unknown;
|
|
9
|
-
/**
|
|
10
|
-
resolved?:
|
|
10
|
+
/** The result when the interaction has been resolved. Truthy = resolved; value contains status/payload for display. */
|
|
11
|
+
resolved?: InteractionResult<unknown>;
|
|
11
12
|
}
|
|
12
13
|
//# sourceMappingURL=ai-chat-widget.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-chat-widget.d.ts","sourceRoot":"","sources":["../../../src/types/ai-chat-widget.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,OAAO,CAAC;IACd,
|
|
1
|
+
{"version":3,"file":"ai-chat-widget.d.ts","sourceRoot":"","sources":["../../../src/types/ai-chat-widget.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAEpE;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,OAAO,CAAC;IACd,uHAAuH;IACvH,QAAQ,CAAC,EAAE,iBAAiB,CAAC,OAAO,CAAC,CAAC;CACvC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import type { ChatToolDefinition, ChatToolHandlers } from '@genesislcap/foundation-ai';
|
|
2
|
+
/**
|
|
3
|
+
* Symbol used to attach ToolFold metadata to a facade handler function.
|
|
4
|
+
* The ChatDriver inspects this to detect fold facades at runtime.
|
|
5
|
+
*
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export declare const TOOL_FOLD_SYMBOL: unique symbol;
|
|
9
|
+
/**
|
|
10
|
+
* Internal metadata for a tool fold. Attached to the facade handler via TOOL_FOLD_SYMBOL.
|
|
11
|
+
*
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
export interface ToolFold {
|
|
15
|
+
/** Facade tool name. */
|
|
16
|
+
name: string;
|
|
17
|
+
/** Description shown to the model. */
|
|
18
|
+
description: string;
|
|
19
|
+
/** Optional guidance injected in the fold-open response. */
|
|
20
|
+
usageNotes?: string;
|
|
21
|
+
/** Tool definitions inside this fold. */
|
|
22
|
+
tools: ChatToolDefinition[];
|
|
23
|
+
/** Handlers for the inner tools (keyed by tool name). */
|
|
24
|
+
handlers: ChatToolHandlers;
|
|
25
|
+
/**
|
|
26
|
+
* When true (default), all other tools are removed when this fold opens —
|
|
27
|
+
* the model can only see this fold's tools until it closes.
|
|
28
|
+
* When false, sibling tools remain alongside the inner tools.
|
|
29
|
+
*/
|
|
30
|
+
exclusive: boolean;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The value returned by `createToolFold`.
|
|
34
|
+
*
|
|
35
|
+
* @beta
|
|
36
|
+
*/
|
|
37
|
+
export interface ToolFoldResult {
|
|
38
|
+
/**
|
|
39
|
+
* The facade tool definition. Add this to your agent's `toolDefinitions`.
|
|
40
|
+
* It is a regular `ChatToolDefinition` with an empty parameter schema.
|
|
41
|
+
*/
|
|
42
|
+
definition: ChatToolDefinition;
|
|
43
|
+
/**
|
|
44
|
+
* The facade handler — a single-entry map keyed by the fold name.
|
|
45
|
+
* Spread this into your agent's `toolHandlers`.
|
|
46
|
+
* Inner tool handlers are NOT included here — they are encapsulated inside
|
|
47
|
+
* the fold metadata and installed by the driver only when the fold opens.
|
|
48
|
+
*/
|
|
49
|
+
handler: ChatToolHandlers;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Creates a tool fold — a facade that hides a group of related tools behind a single
|
|
53
|
+
* named entry, revealing them progressively when the model invokes the facade.
|
|
54
|
+
*
|
|
55
|
+
* The `tools` and `handlers` parameters accept the exact same types as `AgentConfig.toolDefinitions`
|
|
56
|
+
* and `AgentConfig.toolHandlers`, so existing tool creation functions can be passed in unchanged.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```typescript
|
|
60
|
+
* const tradingTools = createToolFold({
|
|
61
|
+
* name: 'trading_tools',
|
|
62
|
+
* tools: createTradesToolDefinitions(),
|
|
63
|
+
* handlers: createTradesToolHandlers(connect),
|
|
64
|
+
* });
|
|
65
|
+
*
|
|
66
|
+
* const agent: AgentConfig = {
|
|
67
|
+
* name: 'Trades',
|
|
68
|
+
* systemPrompt: '...',
|
|
69
|
+
* toolDefinitions: [getCurrentDateDef, tradingTools.definition],
|
|
70
|
+
* toolHandlers: { get_current_date: handler, ...tradingTools.handler },
|
|
71
|
+
* };
|
|
72
|
+
* ```
|
|
73
|
+
*
|
|
74
|
+
* @example Nesting folds
|
|
75
|
+
* ```typescript
|
|
76
|
+
* const insertFold = createToolFold({
|
|
77
|
+
* name: 'trade_insertion',
|
|
78
|
+
* tools: [validateDef, insertDef],
|
|
79
|
+
* handlers: { validate_trade: vHandler, insert_trade: iHandler },
|
|
80
|
+
* });
|
|
81
|
+
*
|
|
82
|
+
* const tradingFold = createToolFold({
|
|
83
|
+
* name: 'trading_tools',
|
|
84
|
+
* tools: [searchDef, insertFold.definition],
|
|
85
|
+
* handlers: { search_trades: sHandler, ...insertFold.handler },
|
|
86
|
+
* });
|
|
87
|
+
* ```
|
|
88
|
+
*
|
|
89
|
+
* @beta
|
|
90
|
+
*/
|
|
91
|
+
export declare function createToolFold(config: {
|
|
92
|
+
/** Facade tool name — used as the tool name the model calls to open this fold. */
|
|
93
|
+
name: string;
|
|
94
|
+
/**
|
|
95
|
+
* Description shown to the model for the facade tool.
|
|
96
|
+
* If omitted, auto-generated from the inner tool names:
|
|
97
|
+
* "Contains: tool_a, tool_b. Invoke to access these tools."
|
|
98
|
+
*/
|
|
99
|
+
description?: string;
|
|
100
|
+
/**
|
|
101
|
+
* Optional usage guidance injected into the fold-open response message.
|
|
102
|
+
* Not included in the facade description — only visible once the fold is open.
|
|
103
|
+
*/
|
|
104
|
+
usageNotes?: string;
|
|
105
|
+
/** Inner tool definitions. Same type as `AgentConfig.toolDefinitions`. */
|
|
106
|
+
tools: ChatToolDefinition[];
|
|
107
|
+
/** Inner tool handlers. Same type as `AgentConfig.toolHandlers`. */
|
|
108
|
+
handlers: ChatToolHandlers;
|
|
109
|
+
/**
|
|
110
|
+
* When true (default), all other tools are removed when this fold opens.
|
|
111
|
+
* When false, sibling tools remain available alongside the inner tools.
|
|
112
|
+
*/
|
|
113
|
+
exclusive?: boolean;
|
|
114
|
+
}): ToolFoldResult;
|
|
115
|
+
/**
|
|
116
|
+
* A tool entry in the expanded debug tree.
|
|
117
|
+
* Folds are represented as nodes with a `tools` array; regular tools have none.
|
|
118
|
+
*
|
|
119
|
+
* @beta
|
|
120
|
+
*/
|
|
121
|
+
export interface ToolTreeNode extends ChatToolDefinition {
|
|
122
|
+
/** Present when this tool is a fold — contains its inner tools recursively expanded. */
|
|
123
|
+
tools?: ToolTreeNode[];
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Expands a flat list of tool definitions into a nested tree by resolving fold
|
|
127
|
+
* metadata from the corresponding handlers. Use this for debug output so the
|
|
128
|
+
* full tool hierarchy is visible rather than just the top-level facade names.
|
|
129
|
+
*
|
|
130
|
+
* @beta
|
|
131
|
+
*/
|
|
132
|
+
export declare function expandToolTree(definitions: ChatToolDefinition[], handlers: ChatToolHandlers): ToolTreeNode[];
|
|
133
|
+
//# sourceMappingURL=tool-fold.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-fold.d.ts","sourceRoot":"","sources":["../../../src/utils/tool-fold.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAEvF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,eAAqB,CAAC;AAEnD;;;;GAIG;AACH,MAAM,WAAW,QAAQ;IACvB,wBAAwB;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,sCAAsC;IACtC,WAAW,EAAE,MAAM,CAAC;IACpB,4DAA4D;IAC5D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yCAAyC;IACzC,KAAK,EAAE,kBAAkB,EAAE,CAAC;IAC5B,yDAAyD;IACzD,QAAQ,EAAE,gBAAgB,CAAC;IAC3B;;;;OAIG;IACH,SAAS,EAAE,OAAO,CAAC;CACpB;AAED;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,UAAU,EAAE,kBAAkB,CAAC;IAC/B;;;;;OAKG;IACH,OAAO,EAAE,gBAAgB,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE;IACrC,kFAAkF;IAClF,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,0EAA0E;IAC1E,KAAK,EAAE,kBAAkB,EAAE,CAAC;IAC5B,oEAAoE;IACpE,QAAQ,EAAE,gBAAgB,CAAC;IAC3B;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,GAAG,cAAc,CA+BjB;AAED;;;;;GAKG;AACH,MAAM,WAAW,YAAa,SAAQ,kBAAkB;IACtD,wFAAwF;IACxF,KAAK,CAAC,EAAE,YAAY,EAAE,CAAC;CACxB;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,WAAW,EAAE,kBAAkB,EAAE,EACjC,QAAQ,EAAE,gBAAgB,GACzB,YAAY,EAAE,CAShB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|