|
1 | 1 | import { Component, computed } from '@angular/core'; |
2 | | -import { ChatComponent } from '@cacheplane/chat'; |
| 2 | +import { ChatComponent, views } from '@cacheplane/chat'; |
3 | 3 | import { agent } from '@cacheplane/angular'; |
| 4 | +import { signalStateStore } from '@cacheplane/render'; |
4 | 5 | import { environment } from '../environments/environment'; |
| 6 | +import { CalculatorResultComponent } from './views/calculator-result.component'; |
| 7 | +import { WordCountResultComponent } from './views/word-count-result.component'; |
5 | 8 |
|
6 | 9 | /** |
7 | 10 | * Represents a matched skill invocation: tool call paired with its result. |
@@ -29,7 +32,7 @@ interface SkillInvocation { |
29 | 32 | imports: [ChatComponent], |
30 | 33 | template: ` |
31 | 34 | <div class="flex h-screen"> |
32 | | - <chat [ref]="stream" class="flex-1 min-w-0" /> |
| 35 | + <chat [ref]="stream" [views]="ui" [store]="uiStore" class="flex-1 min-w-0" /> |
33 | 36 | <aside class="w-72 shrink-0 border-l overflow-y-auto p-4 space-y-3" |
34 | 37 | style="border-color: var(--chat-border, #333); background: var(--chat-bg, #171717); color: var(--chat-text, #e0e0e0);"> |
35 | 38 | <h3 class="text-xs font-semibold uppercase tracking-wide" |
@@ -65,6 +68,9 @@ interface SkillInvocation { |
65 | 68 | `, |
66 | 69 | }) |
67 | 70 | export class SkillsComponent { |
| 71 | + readonly ui = views({ 'calculator-result': CalculatorResultComponent, 'word-count-result': WordCountResultComponent }); |
| 72 | + readonly uiStore = signalStateStore({}); |
| 73 | + |
68 | 74 | protected readonly stream = agent({ |
69 | 75 | apiUrl: environment.langGraphApiUrl, |
70 | 76 | assistantId: environment.streamingAssistantId, |
|
0 commit comments