@genesislcap/ai-assistant 14.409.0-FUI-2495.2 → 14.409.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.
Files changed (64) hide show
  1. package/dist/ai-assistant.api.json +1110 -2791
  2. package/dist/ai-assistant.d.ts +45 -267
  3. package/dist/dts/channel/ai-activity-channel.d.ts +0 -1
  4. package/dist/dts/channel/ai-activity-channel.d.ts.map +1 -1
  5. package/dist/dts/components/chat-driver/chat-driver.d.ts +7 -25
  6. package/dist/dts/components/chat-driver/chat-driver.d.ts.map +1 -1
  7. package/dist/dts/components/halo-overlay.d.ts +1 -13
  8. package/dist/dts/components/halo-overlay.d.ts.map +1 -1
  9. package/dist/dts/config/config.d.ts +15 -43
  10. package/dist/dts/config/config.d.ts.map +1 -1
  11. package/dist/dts/config/index.d.ts +0 -1
  12. package/dist/dts/config/index.d.ts.map +1 -1
  13. package/dist/dts/index.d.ts +0 -4
  14. package/dist/dts/index.d.ts.map +1 -1
  15. package/dist/dts/main/main.d.ts +7 -16
  16. package/dist/dts/main/main.d.ts.map +1 -1
  17. package/dist/dts/main/main.styles.d.ts.map +1 -1
  18. package/dist/dts/main/main.template.d.ts.map +1 -1
  19. package/dist/esm/components/chat-driver/chat-driver.js +31 -86
  20. package/dist/esm/components/halo-overlay.js +7 -53
  21. package/dist/esm/config/index.js +0 -1
  22. package/dist/esm/index.js +0 -4
  23. package/dist/esm/main/main.js +45 -103
  24. package/dist/esm/main/main.styles.js +4 -145
  25. package/dist/esm/main/main.template.js +61 -97
  26. package/dist/tsconfig.tsbuildinfo +1 -1
  27. package/package.json +15 -15
  28. package/src/channel/ai-activity-channel.ts +0 -1
  29. package/src/components/chat-driver/chat-driver.ts +35 -116
  30. package/src/components/halo-overlay.ts +7 -45
  31. package/src/config/config.ts +15 -45
  32. package/src/config/index.ts +0 -1
  33. package/src/index.ts +0 -4
  34. package/src/main/main.styles.ts +4 -145
  35. package/src/main/main.template.ts +78 -116
  36. package/src/main/main.ts +50 -105
  37. package/dist/dts/components/ai-driver/ai-driver.d.ts +0 -38
  38. package/dist/dts/components/ai-driver/ai-driver.d.ts.map +0 -1
  39. package/dist/dts/components/ai-driver/index.d.ts +0 -2
  40. package/dist/dts/components/ai-driver/index.d.ts.map +0 -1
  41. package/dist/dts/components/orchestrating-driver/index.d.ts +0 -2
  42. package/dist/dts/components/orchestrating-driver/index.d.ts.map +0 -1
  43. package/dist/dts/components/orchestrating-driver/orchestrating-driver.d.ts +0 -36
  44. package/dist/dts/components/orchestrating-driver/orchestrating-driver.d.ts.map +0 -1
  45. package/dist/dts/components/popout-manager/index.d.ts +0 -2
  46. package/dist/dts/components/popout-manager/index.d.ts.map +0 -1
  47. package/dist/dts/components/popout-manager/popout-manager.d.ts +0 -74
  48. package/dist/dts/components/popout-manager/popout-manager.d.ts.map +0 -1
  49. package/dist/dts/config/fallback-agents.d.ts +0 -20
  50. package/dist/dts/config/fallback-agents.d.ts.map +0 -1
  51. package/dist/esm/components/ai-driver/ai-driver.js +0 -1
  52. package/dist/esm/components/ai-driver/index.js +0 -1
  53. package/dist/esm/components/orchestrating-driver/index.js +0 -1
  54. package/dist/esm/components/orchestrating-driver/orchestrating-driver.js +0 -229
  55. package/dist/esm/components/popout-manager/index.js +0 -1
  56. package/dist/esm/components/popout-manager/popout-manager.js +0 -119
  57. package/dist/esm/config/fallback-agents.js +0 -26
  58. package/src/components/ai-driver/ai-driver.ts +0 -42
  59. package/src/components/ai-driver/index.ts +0 -1
  60. package/src/components/orchestrating-driver/index.ts +0 -1
  61. package/src/components/orchestrating-driver/orchestrating-driver.ts +0 -300
  62. package/src/components/popout-manager/index.ts +0 -1
  63. package/src/components/popout-manager/popout-manager.ts +0 -144
  64. package/src/config/fallback-agents.ts +0 -29
package/src/main/main.ts CHANGED
@@ -12,13 +12,11 @@ import {
12
12
  import { agenticActivityBus } from '../channel/ai-activity-bus';
13
13
  import type { AiAssistantSerializedState } from '../channel/ai-activity-channel';
14
14
  import { AiActivityHalo } from '../components/activity-halo/activity-halo';
15
- import type { AiDriver } from '../components/ai-driver/ai-driver';
16
15
  import { AiChatBubble } from '../components/chat-bubble/chat-bubble';
17
16
  import { ChatDriver } from '../components/chat-driver/chat-driver';
18
17
  import { AiChatInteractionWrapper } from '../components/chat-interaction-wrapper/chat-interaction-wrapper';
19
18
  import { AiChatMarkdown } from '../components/chat-markdown/chat-markdown';
20
19
  import { AiHaloOverlay } from '../components/halo-overlay';
21
- import { OrchestratingDriver } from '../components/orchestrating-driver/orchestrating-driver';
22
20
  import type { AgentConfig } from '../config/config';
23
21
  import { logger } from '../utils/logger';
24
22
  import { styles } from './main.styles';
@@ -40,8 +38,7 @@ avoidTreeShaking(
40
38
  *
41
39
  * @remarks
42
40
  * Inject an `AIProvider` through the DI container. Pass agent configuration via the `agents`
43
- * property. The component creates a `ChatDriver` (single agent) or `OrchestratingDriver`
44
- * (multiple agents) to manage the conversation loop.
41
+ * property. The component creates a `ChatDriver` to manage the conversation loop.
45
42
  *
46
43
  * @beta
47
44
  */
@@ -79,14 +76,11 @@ export class FoundationAiAssistant extends GenesisElement {
79
76
  @observable inputValue = '';
80
77
  @observable attachments: ChatAttachment[] = [];
81
78
  @observable attachmentErrors: string[] = [];
82
- @observable activeAgent?: AgentConfig;
83
79
 
84
80
  /** Current user-facing toggle state for tool call visibility. */
85
81
  @observable showToolCalls = false;
86
82
  /** Current user-facing toggle state for thinking step visibility. */
87
83
  @observable showThinkingSteps = false;
88
- /** Current user-facing toggle state for agent switch indicator visibility. */
89
- @observable showAgentSwitchIndicator = false;
90
84
  /** Currently enabled animations. */
91
85
  @observable enabledAnimations: AiAssistantAnimation[] = [];
92
86
  /** Whether the loading spinner is currently visible. Controlled by the loading delay timer. */
@@ -94,24 +88,24 @@ export class FoundationAiAssistant extends GenesisElement {
94
88
  /** Whether the settings panel is open. */
95
89
  @observable settingsOpen = false;
96
90
 
97
- private driver?: AiDriver;
91
+ private driver?: ChatDriver;
98
92
  private loadingTimer: ReturnType<typeof setTimeout> | undefined;
99
93
  private unsubBus?: () => void;
100
94
  private haloStartPublished = false;
101
95
 
102
- @observable showHalo: 'no' | 'orchestrating' | 'agent' = 'no';
96
+ /**
97
+ * Whether the halo animation should be shown.
98
+ * True when the AI is actively computing (loading state, no pending interaction).
99
+ */
100
+ @observable showHalo: boolean = false;
103
101
 
104
102
  private syncShowHalo() {
105
103
  if (this.state !== 'loading') {
106
- this.showHalo = 'no';
104
+ this.showHalo = false;
107
105
  return;
108
106
  }
109
107
  const last = this.messages[this.messages.length - 1];
110
- if (last?.interaction) {
111
- this.showHalo = 'no';
112
- } else if (this.showHalo !== 'orchestrating') {
113
- this.showHalo = 'agent';
114
- }
108
+ this.showHalo = !last?.interaction;
115
109
  }
116
110
 
117
111
  /** True when there is a pending (unresolved) interaction — disables the popout button. */
@@ -124,7 +118,7 @@ export class FoundationAiAssistant extends GenesisElement {
124
118
 
125
119
  showHaloChanged() {
126
120
  if (!this.enabledAnimations?.includes('halo')) return;
127
- if (this.showHalo === 'no') {
121
+ if (!this.showHalo) {
128
122
  agenticActivityBus.publish('halo-stop', undefined);
129
123
  this.haloStartPublished = false;
130
124
  }
@@ -150,16 +144,7 @@ export class FoundationAiAssistant extends GenesisElement {
150
144
  */
151
145
  @volatile
152
146
  get visibleMessages(): ChatMessage[] {
153
- const showAgentSwitchIndicator =
154
- this.chatConfig.ui?.showAgentSwitchIndicator != null
155
- ? this.showAgentSwitchIndicator
156
- : this.showToolCalls;
157
-
158
147
  return this.messages.filter((m) => {
159
- // Agent switch indicators are shown when the toggle is on (or showToolCalls implies it)
160
- if (m.role === 'system-event') {
161
- return showAgentSwitchIndicator;
162
- }
163
148
  // Never show tool messages to the user
164
149
  if (m.role === 'tool') {
165
150
  return false;
@@ -179,47 +164,27 @@ export class FoundationAiAssistant extends GenesisElement {
179
164
 
180
165
  connectedCallback() {
181
166
  super.connectedCallback();
182
- const ui = this.chatConfig.ui ?? {};
183
- const agent = this.chatConfig.agent ?? {};
184
-
185
- this.showToolCalls = ui.showToolCalls === true;
186
- this.showThinkingSteps = ui.showThinkingSteps === true;
187
- this.showAgentSwitchIndicator = ui.showAgentSwitchIndicator === true;
167
+ const { showToolCalls, showThinkingSteps, animations } = this.chatConfig;
168
+ this.showToolCalls = showToolCalls === true;
169
+ this.showThinkingSteps = showThinkingSteps === true;
188
170
  this.enabledAnimations =
189
- (ui.animations?.enabled as AiAssistantAnimation[]) ??
190
- (ui.animations ? [...ALL_ANIMATIONS] : []);
191
-
192
- const { agents } = this;
193
- if (agents && agents.length > 1) {
194
- const orchestrator = new OrchestratingDriver(this.aiProvider, agents, {
195
- maxHandoffs: agent.maxHandoffs,
196
- classifierHistoryLength: agent.classifierHistoryLength,
197
- classifierRetries: agent.classifierRetries,
198
- maxToolIterations: agent.maxToolIterations,
199
- });
200
- orchestrator.addEventListener('orchestrating-start', () => {
201
- this.showHalo = 'orchestrating';
202
- });
203
- orchestrator.addEventListener('orchestrating-stop', () => {
204
- if (this.showHalo === 'orchestrating') this.showHalo = 'agent';
205
- });
206
- orchestrator.addEventListener('agent-changed', (e: Event) => {
207
- this.activeAgent = (e as CustomEvent<AgentConfig>).detail;
208
- });
209
- this.driver = orchestrator;
210
- } else {
211
- const singleAgent = agents?.[0];
212
- this.activeAgent = singleAgent;
213
- this.driver = new ChatDriver(
214
- this.aiProvider,
215
- singleAgent?.toolHandlers ?? {},
216
- singleAgent?.toolDefinitions ?? [],
217
- singleAgent?.systemPrompt,
218
- singleAgent?.primerHistory,
219
- agent.maxToolIterations,
171
+ (animations?.enabled as AiAssistantAnimation[]) ?? (animations ? [...ALL_ANIMATIONS] : []);
172
+
173
+ // TODO: multi-agent orchestration — classify intent and route to the correct agent
174
+ if (this.agents && this.agents.length > 1) {
175
+ logger.warn(
176
+ 'FoundationAiAssistant: multiple agents configured but orchestration is not yet implemented. Only the first agent will be used.',
220
177
  );
221
178
  }
222
-
179
+ const agent = this.agents?.[0];
180
+ this.driver = new ChatDriver(
181
+ this.aiProvider,
182
+ agent?.toolHandlers ?? {},
183
+ agent?.toolDefinitions ?? [],
184
+ agent?.systemPrompt,
185
+ agent?.primerHistory,
186
+ this.chatConfig.maxToolIterations,
187
+ );
223
188
  this.driver.addEventListener('history-updated', (e: Event) => {
224
189
  this.messages = [...(e as CustomEvent<ChatMessage[]>).detail];
225
190
  });
@@ -263,7 +228,10 @@ export class FoundationAiAssistant extends GenesisElement {
263
228
  }
264
229
  this.syncShowHalo();
265
230
  // Publish halo-start whenever a new toolCalls message arrives.
266
- if (this.showHalo !== 'no' && this.enabledAnimations?.includes('halo')) {
231
+ // If we've already published one this turn, send halo-stop first so grids
232
+ // not relevant to the new tools begin deactivating (fix #2).
233
+ // Never publish with empty toolNames (fix #3).
234
+ if (this.showHalo && this.enabledAnimations?.includes('halo')) {
267
235
  const last = this.messages[this.messages.length - 1];
268
236
  if (last?.toolCalls?.length) {
269
237
  const toolNames = this.getActiveToolNames();
@@ -280,6 +248,7 @@ export class FoundationAiAssistant extends GenesisElement {
280
248
  }
281
249
 
282
250
  showLoadingIndicatorChanged() {
251
+ // Scroll to bottom when the spinner appears so it is visible.
283
252
  if (this.showLoadingIndicator) {
284
253
  this.scrollToBottom();
285
254
  }
@@ -301,7 +270,7 @@ export class FoundationAiAssistant extends GenesisElement {
301
270
 
302
271
  private startLoadingTimer() {
303
272
  this.clearLoadingTimer();
304
- const delay = this.chatConfig.ui?.loadingDelay ?? FoundationAiAssistant.DEFAULT_LOADING_DELAY_S;
273
+ const delay = this.chatConfig.loadingDelay ?? FoundationAiAssistant.DEFAULT_LOADING_DELAY_S;
305
274
  if (delay === 0) {
306
275
  this.showLoadingIndicator = true;
307
276
  } else {
@@ -337,7 +306,6 @@ export class FoundationAiAssistant extends GenesisElement {
337
306
  this.messages = [...state.messages];
338
307
  this.showToolCalls = state.showToolCalls;
339
308
  this.showThinkingSteps = state.showThinkingSteps;
340
- this.showAgentSwitchIndicator = state.showAgentSwitchIndicator;
341
309
  this.enabledAnimations = [...state.enabledAnimations];
342
310
  this.driver?.loadHistory(state.messages);
343
311
  }
@@ -347,30 +315,12 @@ export class FoundationAiAssistant extends GenesisElement {
347
315
  messages: [...this.messages],
348
316
  showToolCalls: this.showToolCalls,
349
317
  showThinkingSteps: this.showThinkingSteps,
350
- showAgentSwitchIndicator: this.showAgentSwitchIndicator,
351
318
  enabledAnimations: [...this.enabledAnimations],
352
319
  };
353
320
  }
354
321
 
355
322
  toggleSettings() {
356
- if (this.settingsOpen) {
357
- const panel = this.shadowRoot?.querySelector('.settings-panel') as HTMLElement | null;
358
- if (panel) {
359
- panel.classList.add('closing');
360
- panel.addEventListener(
361
- 'animationend',
362
- () => {
363
- panel.classList.remove('closing');
364
- this.settingsOpen = false;
365
- },
366
- { once: true },
367
- );
368
- } else {
369
- this.settingsOpen = false;
370
- }
371
- } else {
372
- this.settingsOpen = true;
373
- }
323
+ this.settingsOpen = !this.settingsOpen;
374
324
  }
375
325
 
376
326
  toggleShowToolCalls() {
@@ -381,31 +331,23 @@ export class FoundationAiAssistant extends GenesisElement {
381
331
  this.showThinkingSteps = !this.showThinkingSteps;
382
332
  }
383
333
 
384
- toggleShowAgentSwitchIndicator() {
385
- this.showAgentSwitchIndicator = !this.showAgentSwitchIndicator;
386
- }
387
-
388
334
  setEnabledAnimations(animations: AiAssistantAnimation[]) {
389
335
  this.enabledAnimations = animations;
390
336
  }
391
337
 
392
- getDebugLog() {
393
- return {
394
- messages: this.driver?.getRawHistory?.() ?? this.messages,
395
- agentSummary: this.agents,
396
- host: window.location.host,
397
- activeSystemPrompt: this.activeAgent?.systemPrompt,
398
- activePrimerHistory: this.activeAgent?.primerHistory,
399
- debug: this.debugStateFactory?.(),
400
- };
401
- }
402
-
403
- downloadDebugLog() {
338
+ downloadHistory() {
404
339
  const timestamp = new Date().toISOString().replace(/:/g, '-');
405
- const agentName = (this.activeAgent?.name ?? this.headerTitle ?? 'chat')
340
+ // TODO: multi-agent orchestration use the active agent rather than always agents[0]
341
+ const agent = this.agents?.[0];
342
+ const agentName = (agent?.name ?? this.headerTitle ?? 'chat')
406
343
  .toLowerCase()
407
344
  .replace(/\s+/g, '-');
408
- const payload = this.getDebugLog();
345
+ const payload = {
346
+ messages: this.messages,
347
+ systemPrompt: agent?.systemPrompt,
348
+ primerHistory: agent?.primerHistory,
349
+ debug: this.debugStateFactory?.(),
350
+ };
409
351
  const blob = new Blob([JSON.stringify(payload, null, 2)], { type: 'application/json' });
410
352
  const url = URL.createObjectURL(blob);
411
353
  const a = document.createElement('a');
@@ -438,7 +380,7 @@ export class FoundationAiAssistant extends GenesisElement {
438
380
  }
439
381
 
440
382
  private isAcceptedFile(file: File): boolean {
441
- const accepted = this.chatConfig.ui?.acceptedFiles;
383
+ const accepted = this.chatConfig.acceptedFiles;
442
384
  if (!accepted) return false;
443
385
 
444
386
  const acceptedList = accepted.split(',').map((s) => s.trim().toLowerCase());
@@ -522,6 +464,9 @@ export class FoundationAiAssistant extends GenesisElement {
522
464
  }
523
465
 
524
466
  private restoreFocusIfAppropriate() {
467
+ // If focus is still within this component (document.activeElement === this, since shadow DOM
468
+ // reports the host) or nothing specific has focus (body), return focus to the input.
469
+ // If the user has navigated to another element in the app, leave them there.
525
470
  const active = document.activeElement;
526
471
  if (active !== document.body && active !== this) return;
527
472
  requestAnimationFrame(() => {
@@ -530,7 +475,7 @@ export class FoundationAiAssistant extends GenesisElement {
530
475
  }
531
476
 
532
477
  onChatHeaderMouseDown(e: MouseEvent) {
533
- if (this.popoutMode === 'collapse') return;
478
+ if (this.popoutMode !== 'expand') return;
534
479
  e.preventDefault();
535
480
  this.dispatchEvent(
536
481
  new CustomEvent('chat-header-mousedown', {
@@ -1,38 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,2 +0,0 @@
1
- export type { AiDriver } from './ai-driver';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
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,2 +0,0 @@
1
- export { OrchestratingDriver } from './orchestrating-driver';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
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"}
@@ -1,36 +0,0 @@
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
@@ -1 +0,0 @@
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,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;KACvB;IAoCR,kBAAkB,CAAC,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI;IAIhE,WAAW,CAAC,QAAQ,EAAE,WAAW,EAAE,GAAG,IAAI;IAI1C,aAAa,IAAI,SAAS,WAAW,EAAE;IAIjC,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAiDrF,mBAAmB,CAAC,eAAe,CAAC,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAIrF,OAAO,CAAC,UAAU;YA0BJ,QAAQ;IAkEtB,OAAO,CAAC,mBAAmB;CAO5B"}
@@ -1,2 +0,0 @@
1
- export * from './popout-manager';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/popout-manager/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
@@ -1,74 +0,0 @@
1
- import { GenesisElement } from '@genesislcap/web-core';
2
- import type { AiAssistantSerializedState } from '../../channel/ai-activity-channel';
3
- /**
4
- * Contract for pages that support docking the AI assistant.
5
- * Register an implementation with {@link getAiPopoutManager} on mount and deregister on unmount.
6
- *
7
- * @beta
8
- */
9
- export interface AiDockProvider {
10
- /**
11
- * Called when the user expands the bubble. Receives the assistant element and the
12
- * serialized state to restore. The provider is responsible for inserting the element
13
- * into its layout and calling `applyState` once the element is connected.
14
- * Resolves when the element is connected and state has been applied.
15
- */
16
- onDock(element: HTMLElement, state: AiAssistantSerializedState | undefined): Promise<void>;
17
- /** Called when the user collapses the panel or before navigation. */
18
- onUndock(): Promise<void>;
19
- /**
20
- * Called by `collapseIfDocked` before navigation. The provider is responsible for
21
- * finding the docked assistant element and calling `handlePopout()` on it, which
22
- * publishes `chat-popin` and returns the assistant to the bubble.
23
- */
24
- initiateCollapse(): void;
25
- }
26
- /**
27
- * App-shell component that owns the pop-out/pop-in lifecycle for the AI assistant bubble.
28
- *
29
- * @remarks
30
- * Place this in the persistent app shell, wrapping a `foundation-ai-chat-bubble` that
31
- * contains an AI assistant element in the `dialog-content` slot. The component will
32
- * auto-create a matching collapse-mode element for docking into pages, and will
33
- * control the expand button visibility based on whether a dock provider is registered.
34
- *
35
- * Pages that support docking call `aiPopoutManager.registerDockProvider()` on mount
36
- * and `aiPopoutManager.deregisterDockProvider()` on unmount.
37
- *
38
- * @example
39
- * ```html
40
- * <foundation-ai-popout-manager>
41
- * <foundation-ai-chat-bubble title="My Assistant">
42
- * <my-assistant slot="dialog-content"></my-assistant>
43
- * </foundation-ai-chat-bubble>
44
- * </foundation-ai-popout-manager>
45
- * ```
46
- *
47
- * @beta
48
- */
49
- export declare class FoundationAiPopoutManager extends GenesisElement {
50
- /** True when a dock provider is registered — controls expand button visibility. */
51
- canDock: boolean;
52
- private collapseEl;
53
- private dockProvider;
54
- private isDocked;
55
- private unsubBus?;
56
- connectedCallback(): void;
57
- disconnectedCallback(): void;
58
- canDockChanged(): void;
59
- registerDockProvider(provider: AiDockProvider): void;
60
- deregisterDockProvider(): void;
61
- /**
62
- * If the assistant is currently docked, collapses it back into the bubble.
63
- * Await this in `onBeforeNavButtonClick` to ensure cleanup before navigation.
64
- */
65
- collapseIfDocked(): Promise<void>;
66
- }
67
- /**
68
- * Returns the active `FoundationAiPopoutManager` instance, or `undefined` if none is mounted.
69
- * Import this in pages to call `registerDockProvider` / `deregisterDockProvider`.
70
- *
71
- * @beta
72
- */
73
- export declare function getAiPopoutManager(): FoundationAiPopoutManager | undefined;
74
- //# sourceMappingURL=popout-manager.d.ts.map
@@ -1 +0,0 @@
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;AAExF,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AAEpF;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;;OAKG;IACH,MAAM,CAAC,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,0BAA0B,GAAG,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3F,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;IA4BjB,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,20 +0,0 @@
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
@@ -1 +0,0 @@
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 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export { OrchestratingDriver } from './orchestrating-driver';