@agentskit/chat-angular 0.1.0
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/LICENSE +22 -0
- package/README.md +9 -0
- package/dist/README.md +9 -0
- package/dist/fesm2022/agentskit-chat-angular.mjs +354 -0
- package/dist/fesm2022/agentskit-chat-angular.mjs.map +1 -0
- package/dist/types/agentskit-chat-angular.d.ts +210 -0
- package/dist/types/agentskit-chat-angular.d.ts.map +1 -0
- package/package.json +65 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 AgentsKit
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
package/README.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# @agentskit/chat-angular
|
|
2
|
+
|
|
3
|
+
Native Angular application shell for AgentsKit Chat. It composes `AgentskitChat` and the standalone components published by `@agentskit/angular`; chat state and lifecycle remain upstream.
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
import { AgentChatComponent } from '@agentskit/chat-angular'
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
The standalone component works with Angular 18–21. Use content templates named `container`, `message`, `input`, `thinking`, `confirmation`, and `choiceList` for Angular-native customization.
|
package/dist/README.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# @agentskit/chat-angular
|
|
2
|
+
|
|
3
|
+
Native Angular application shell for AgentsKit Chat. It composes `AgentskitChat` and the standalone components published by `@agentskit/angular`; chat state and lifecycle remain upstream.
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
import { AgentChatComponent } from '@agentskit/chat-angular'
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
The standalone component works with Angular 18–21. Use content templates named `container`, `message`, `input`, `thinking`, `confirmation`, and `choiceList` for Angular-native customization.
|
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
import { NgTemplateOutlet } from '@angular/common';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { Input, Component, signal, inject, computed, TemplateRef, ContentChild } from '@angular/core';
|
|
4
|
+
import { AgentskitChat, ChatContainerComponent, MessageComponent, InputBarComponent, ThinkingIndicatorComponent, ToolConfirmationComponent } from '@agentskit/angular';
|
|
5
|
+
import { ButtonGroupPropsSchema, FormPropsSchema, ConfirmationPropsSchema, ProgressPropsSchema, SourceListPropsSchema, LinkCardPropsSchema, ErrorNoticePropsSchema, ToolCallPropsSchema, ApprovalRequestPropsSchema, TablePropsSchema, FileAttachmentPropsSchema, resolveComponentFallback, resolveComponentFrame, createComponentInteraction, resolveChatTheme, resolveChoiceListFrame, selectChoice, getLifecycleTargets, resolveChatSession, presentChatMessage, formatSemanticFallback, resolveChoiceAction } from '@agentskit/chat';
|
|
6
|
+
|
|
7
|
+
class StandardComponentComponent {
|
|
8
|
+
constructor() {
|
|
9
|
+
this.disabled = false;
|
|
10
|
+
this.valid = false;
|
|
11
|
+
this.values = {};
|
|
12
|
+
this.buttonGroup = () => ButtonGroupPropsSchema.safeParse(this.frame.props).data;
|
|
13
|
+
this.form = () => FormPropsSchema.safeParse(this.frame.props).data;
|
|
14
|
+
this.confirmation = () => ConfirmationPropsSchema.safeParse(this.frame.props).data;
|
|
15
|
+
this.progress = () => ProgressPropsSchema.safeParse(this.frame.props).data;
|
|
16
|
+
this.sourceList = () => SourceListPropsSchema.safeParse(this.frame.props).data;
|
|
17
|
+
this.linkCard = () => LinkCardPropsSchema.safeParse(this.frame.props).data;
|
|
18
|
+
this.errorNotice = () => ErrorNoticePropsSchema.safeParse(this.frame.props).data;
|
|
19
|
+
this.toolCall = () => ToolCallPropsSchema.safeParse(this.frame.props).data;
|
|
20
|
+
this.approval = () => ApprovalRequestPropsSchema.safeParse(this.frame.props).data;
|
|
21
|
+
this.table = () => TablePropsSchema.safeParse(this.frame.props).data;
|
|
22
|
+
this.file = () => FileAttachmentPropsSchema.safeParse(this.frame.props).data;
|
|
23
|
+
this.fallback = () => resolveComponentFallback(this.frame, this.manifest) ?? '';
|
|
24
|
+
}
|
|
25
|
+
ngOnChanges() { this.valid = resolveComponentFrame(this.frame, this.manifest).ok && this.frame.componentKey !== 'choice-list'; }
|
|
26
|
+
emit(event, value) { this.onInteract(createComponentInteraction(this.frame, this.manifest, event, value)); }
|
|
27
|
+
link(event, name, value) { event.preventDefault(); this.emit(name, value); }
|
|
28
|
+
submit(event) { event.preventDefault(); this.emit('submit', { ...this.values }); }
|
|
29
|
+
setSelect(id, event) { if (event.target instanceof HTMLSelectElement)
|
|
30
|
+
this.values[id] = event.target.value; }
|
|
31
|
+
setInput(id, type, event) { if (event.target instanceof HTMLInputElement)
|
|
32
|
+
this.values[id] = type === 'checkbox' ? event.target.checked : event.target.value; }
|
|
33
|
+
json(value) { return value === undefined ? '' : JSON.stringify(value, null, 2); }
|
|
34
|
+
cell(value) { return value === null || ['string', 'number', 'boolean'].includes(typeof value) ? String(value ?? '') : ''; }
|
|
35
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: StandardComponentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
36
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.18", type: StandardComponentComponent, isStandalone: true, selector: "ak-standard-component", inputs: { frame: "frame", manifest: "manifest", onInteract: "onInteract", disabled: "disabled" }, usesOnChanges: true, ngImport: i0, template: `@if (valid) { @switch (frame.componentKey) {
|
|
37
|
+
@case ('button-group') { @if (buttonGroup(); as item) { <fieldset [attr.aria-label]="item.label" data-ak-component="button-group"><legend>{{ item.label }}</legend>@for (button of item.buttons; track button.id) { <button type="button" [disabled]="disabled || button.disabled" (click)="emit('select', button.id)">{{ button.label }}</button> }</fieldset> } }
|
|
38
|
+
@case ('form') { @if (form(); as item) { <form [attr.aria-label]="item.title ?? 'Form'" data-ak-component="form" (submit)="submit($event)">@if (item.title) { <h3>{{ item.title }}</h3> } @for (field of item.fields; track field.id) { <label>{{ field.label }}@if (field.type === 'select') { <select [required]="field.required" [disabled]="disabled" (change)="setSelect(field.id, $event)"><option value="" disabled selected>Select…</option>@for (option of field.options ?? []; track option.id) { <option [value]="option.id">{{ option.label }}</option> }</select> } @else { <input [type]="field.type" [required]="field.required" [disabled]="disabled" [placeholder]="field.placeholder" (input)="setInput(field.id, field.type, $event)" /> }</label> } <button type="submit" [disabled]="disabled">{{ item.submitLabel }}</button></form> } }
|
|
39
|
+
@case ('confirmation') { @if (confirmation(); as item) { <section [attr.aria-label]="item.title" data-ak-component="confirmation"><h3>{{ item.title }}</h3><p>{{ item.message }}</p><button [disabled]="disabled" (click)="emit('confirm')">{{ item.confirmLabel }}</button><button [disabled]="disabled" (click)="emit('cancel')">{{ item.cancelLabel }}</button></section> } }
|
|
40
|
+
@case ('progress') { @if (progress(); as item) { <div data-ak-component="progress"><label>{{ item.label }}<progress max="100" [value]="item.value"></progress></label>@if (item.status) { <p>{{ item.status }}</p> }</div> } }
|
|
41
|
+
@case ('source-list') { @if (sourceList(); as item) { <section data-ak-component="source-list"><h3>{{ item.label }}</h3><ul>@for (source of item.sources; track source.id) { <li>@if (source.url) { <a [href]="source.url" (click)="link($event, 'open', source.id)">{{ source.title }}</a> } @else { {{ source.title }} } @if (source.snippet) { <p>{{ source.snippet }}</p> }</li> }</ul></section> } }
|
|
42
|
+
@case ('link-card') { @if (linkCard(); as item) { <a data-ak-component="link-card" [href]="item.href" (click)="link($event, 'open', item.href)"><strong>{{ item.title }}</strong><span>{{ item.description }}</span><span>{{ item.label }}</span></a> } }
|
|
43
|
+
@case ('error-notice') { @if (errorNotice(); as item) { <section role="alert" data-ak-component="error-notice"><strong>{{ item.title }}</strong><p>{{ item.message }}</p><code>{{ item.code }}</code>@if (item.retryLabel) { <button [disabled]="disabled" (click)="emit('retry')">{{ item.retryLabel }}</button> }</section> } }
|
|
44
|
+
@case ('tool-call') { @if (toolCall(); as item) { <section role="status" data-ak-component="tool-call"><strong>{{ item.name }}</strong><span>{{ item.status }}</span><pre>{{ json(item.arguments) }}</pre><pre>{{ json(item.result) }}</pre></section> } }
|
|
45
|
+
@case ('approval-request') { @if (approval(); as item) { <section [attr.aria-label]="item.title" data-ak-component="approval-request"><h3>{{ item.title }}</h3><p>{{ item.description }}</p><button [disabled]="disabled" (click)="emit('approve')">{{ item.approveLabel }}</button><button [disabled]="disabled" (click)="emit('deny')">{{ item.denyLabel }}</button></section> } }
|
|
46
|
+
@case ('table') { @if (table(); as item) { <table data-ak-component="table"><caption>{{ item.caption }}</caption><thead><tr>@for (column of item.columns; track column.key) { <th scope="col">{{ column.label }}</th> }</tr></thead><tbody>@for (row of item.rows; track $index) { <tr>@for (column of item.columns; track column.key) { <td>{{ cell(row[column.key]) }}</td> }</tr> }</tbody></table> } }
|
|
47
|
+
@case ('file-attachment') { @if (file(); as item) { <article data-ak-component="file-attachment"><strong>{{ item.name }}</strong><span>{{ item.mimeType }}</span>@if (item.sizeBytes !== undefined) { <span>{{ item.sizeBytes }} bytes</span> } @if (item.url) { <a [href]="item.url" (click)="link($event, 'open', item.url)">Open</a> }</article> } }
|
|
48
|
+
@default { <p data-ak-component-fallback>{{ fallback() }}</p> }
|
|
49
|
+
} }`, isInline: true }); }
|
|
50
|
+
}
|
|
51
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: StandardComponentComponent, decorators: [{
|
|
52
|
+
type: Component,
|
|
53
|
+
args: [{
|
|
54
|
+
selector: 'ak-standard-component', standalone: true,
|
|
55
|
+
template: `@if (valid) { @switch (frame.componentKey) {
|
|
56
|
+
@case ('button-group') { @if (buttonGroup(); as item) { <fieldset [attr.aria-label]="item.label" data-ak-component="button-group"><legend>{{ item.label }}</legend>@for (button of item.buttons; track button.id) { <button type="button" [disabled]="disabled || button.disabled" (click)="emit('select', button.id)">{{ button.label }}</button> }</fieldset> } }
|
|
57
|
+
@case ('form') { @if (form(); as item) { <form [attr.aria-label]="item.title ?? 'Form'" data-ak-component="form" (submit)="submit($event)">@if (item.title) { <h3>{{ item.title }}</h3> } @for (field of item.fields; track field.id) { <label>{{ field.label }}@if (field.type === 'select') { <select [required]="field.required" [disabled]="disabled" (change)="setSelect(field.id, $event)"><option value="" disabled selected>Select…</option>@for (option of field.options ?? []; track option.id) { <option [value]="option.id">{{ option.label }}</option> }</select> } @else { <input [type]="field.type" [required]="field.required" [disabled]="disabled" [placeholder]="field.placeholder" (input)="setInput(field.id, field.type, $event)" /> }</label> } <button type="submit" [disabled]="disabled">{{ item.submitLabel }}</button></form> } }
|
|
58
|
+
@case ('confirmation') { @if (confirmation(); as item) { <section [attr.aria-label]="item.title" data-ak-component="confirmation"><h3>{{ item.title }}</h3><p>{{ item.message }}</p><button [disabled]="disabled" (click)="emit('confirm')">{{ item.confirmLabel }}</button><button [disabled]="disabled" (click)="emit('cancel')">{{ item.cancelLabel }}</button></section> } }
|
|
59
|
+
@case ('progress') { @if (progress(); as item) { <div data-ak-component="progress"><label>{{ item.label }}<progress max="100" [value]="item.value"></progress></label>@if (item.status) { <p>{{ item.status }}</p> }</div> } }
|
|
60
|
+
@case ('source-list') { @if (sourceList(); as item) { <section data-ak-component="source-list"><h3>{{ item.label }}</h3><ul>@for (source of item.sources; track source.id) { <li>@if (source.url) { <a [href]="source.url" (click)="link($event, 'open', source.id)">{{ source.title }}</a> } @else { {{ source.title }} } @if (source.snippet) { <p>{{ source.snippet }}</p> }</li> }</ul></section> } }
|
|
61
|
+
@case ('link-card') { @if (linkCard(); as item) { <a data-ak-component="link-card" [href]="item.href" (click)="link($event, 'open', item.href)"><strong>{{ item.title }}</strong><span>{{ item.description }}</span><span>{{ item.label }}</span></a> } }
|
|
62
|
+
@case ('error-notice') { @if (errorNotice(); as item) { <section role="alert" data-ak-component="error-notice"><strong>{{ item.title }}</strong><p>{{ item.message }}</p><code>{{ item.code }}</code>@if (item.retryLabel) { <button [disabled]="disabled" (click)="emit('retry')">{{ item.retryLabel }}</button> }</section> } }
|
|
63
|
+
@case ('tool-call') { @if (toolCall(); as item) { <section role="status" data-ak-component="tool-call"><strong>{{ item.name }}</strong><span>{{ item.status }}</span><pre>{{ json(item.arguments) }}</pre><pre>{{ json(item.result) }}</pre></section> } }
|
|
64
|
+
@case ('approval-request') { @if (approval(); as item) { <section [attr.aria-label]="item.title" data-ak-component="approval-request"><h3>{{ item.title }}</h3><p>{{ item.description }}</p><button [disabled]="disabled" (click)="emit('approve')">{{ item.approveLabel }}</button><button [disabled]="disabled" (click)="emit('deny')">{{ item.denyLabel }}</button></section> } }
|
|
65
|
+
@case ('table') { @if (table(); as item) { <table data-ak-component="table"><caption>{{ item.caption }}</caption><thead><tr>@for (column of item.columns; track column.key) { <th scope="col">{{ column.label }}</th> }</tr></thead><tbody>@for (row of item.rows; track $index) { <tr>@for (column of item.columns; track column.key) { <td>{{ cell(row[column.key]) }}</td> }</tr> }</tbody></table> } }
|
|
66
|
+
@case ('file-attachment') { @if (file(); as item) { <article data-ak-component="file-attachment"><strong>{{ item.name }}</strong><span>{{ item.mimeType }}</span>@if (item.sizeBytes !== undefined) { <span>{{ item.sizeBytes }} bytes</span> } @if (item.url) { <a [href]="item.url" (click)="link($event, 'open', item.url)">Open</a> }</article> } }
|
|
67
|
+
@default { <p data-ak-component-fallback>{{ fallback() }}</p> }
|
|
68
|
+
} }`,
|
|
69
|
+
}]
|
|
70
|
+
}], propDecorators: { frame: [{
|
|
71
|
+
type: Input,
|
|
72
|
+
args: [{ required: true }]
|
|
73
|
+
}], manifest: [{
|
|
74
|
+
type: Input,
|
|
75
|
+
args: [{ required: true }]
|
|
76
|
+
}], onInteract: [{
|
|
77
|
+
type: Input,
|
|
78
|
+
args: [{ required: true }]
|
|
79
|
+
}], disabled: [{
|
|
80
|
+
type: Input
|
|
81
|
+
}] } });
|
|
82
|
+
|
|
83
|
+
const toChatCssVariables = (input) => {
|
|
84
|
+
const theme = resolveChatTheme(input);
|
|
85
|
+
return {
|
|
86
|
+
'--ak-color-bg': theme.colors.background, '--ak-color-surface': theme.colors.surface, '--ak-color-border': theme.colors.border,
|
|
87
|
+
'--ak-color-text': theme.colors.text, '--ak-color-text-muted': theme.colors.muted, '--ak-color-bubble-user': theme.colors.accent,
|
|
88
|
+
'--ak-color-bubble-user-text': theme.colors.onAccent, '--ak-color-bubble-assistant': theme.colors.surface, '--ak-color-bubble-assistant-text': theme.colors.text,
|
|
89
|
+
'--ak-color-input-bg': theme.colors.background, '--ak-color-input-border': theme.colors.border, '--ak-color-input-focus': theme.colors.accent,
|
|
90
|
+
'--ak-color-button': theme.colors.accent, '--ak-color-button-text': theme.colors.onAccent, '--ak-color-tool-bg': theme.colors.surface,
|
|
91
|
+
'--ak-color-tool-border': theme.colors.border, '--ak-app-color-danger': theme.colors.danger,
|
|
92
|
+
'--ak-font-family': theme.fontFamily === 'system' ? "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif" : theme.fontFamily,
|
|
93
|
+
'--ak-radius': `${theme.radius.medium}px`, '--ak-radius-lg': `${theme.radius.large}px`, '--ak-spacing-sm': `${theme.spacing.small}px`,
|
|
94
|
+
'--ak-spacing-md': `${theme.spacing.medium}px`, '--ak-spacing-lg': `${theme.spacing.large}px`,
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
class ChoiceListComponent {
|
|
98
|
+
constructor() {
|
|
99
|
+
this.disabled = false;
|
|
100
|
+
this.resolved = signal(undefined, ...(ngDevMode ? [{ debugName: "resolved" }] : /* istanbul ignore next */ []));
|
|
101
|
+
}
|
|
102
|
+
ngOnChanges() { const value = resolveChoiceListFrame(this.frame, this.manifest); this.resolved.set(value.ok ? value : undefined); }
|
|
103
|
+
choose(choiceId) { const value = this.resolved(); if (value)
|
|
104
|
+
this.onSelect(selectChoice(value.frame, choiceId)); }
|
|
105
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ChoiceListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
106
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.18", type: ChoiceListComponent, isStandalone: true, selector: "ak-choice-list", inputs: { frame: "frame", manifest: "manifest", onSelect: "onSelect", disabled: "disabled" }, usesOnChanges: true, ngImport: i0, template: `@if (resolved(); as item) { <fieldset [attr.aria-label]="item.props.prompt" data-ak-component="choice-list"><legend>{{ item.props.prompt }}</legend>
|
|
107
|
+
@for (choice of item.props.choices; track choice.id) { <button type="button" [disabled]="disabled" (click)="choose(choice.id)"><span>{{ choice.label }}</span>@if (choice.description) { <small>{{ choice.description }}</small> }</button> }
|
|
108
|
+
</fieldset> }`, isInline: true }); }
|
|
109
|
+
}
|
|
110
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ChoiceListComponent, decorators: [{
|
|
111
|
+
type: Component,
|
|
112
|
+
args: [{
|
|
113
|
+
selector: 'ak-choice-list', standalone: true,
|
|
114
|
+
template: `@if (resolved(); as item) { <fieldset [attr.aria-label]="item.props.prompt" data-ak-component="choice-list"><legend>{{ item.props.prompt }}</legend>
|
|
115
|
+
@for (choice of item.props.choices; track choice.id) { <button type="button" [disabled]="disabled" (click)="choose(choice.id)"><span>{{ choice.label }}</span>@if (choice.description) { <small>{{ choice.description }}</small> }</button> }
|
|
116
|
+
</fieldset> }`,
|
|
117
|
+
}]
|
|
118
|
+
}], propDecorators: { frame: [{
|
|
119
|
+
type: Input,
|
|
120
|
+
args: [{ required: true }]
|
|
121
|
+
}], manifest: [{
|
|
122
|
+
type: Input,
|
|
123
|
+
args: [{ required: true }]
|
|
124
|
+
}], onSelect: [{
|
|
125
|
+
type: Input,
|
|
126
|
+
args: [{ required: true }]
|
|
127
|
+
}], disabled: [{
|
|
128
|
+
type: Input
|
|
129
|
+
}] } });
|
|
130
|
+
class AgentChatComponent {
|
|
131
|
+
constructor() {
|
|
132
|
+
this.service = inject(AgentskitChat);
|
|
133
|
+
this.chat = computed(() => this.service.state() ? this.service.snapshot() : null, ...(ngDevMode ? [{ debugName: "chat" }] : /* istanbul ignore next */ []));
|
|
134
|
+
this.error = signal(null, ...(ngDevMode ? [{ debugName: "error" }] : /* istanbul ignore next */ []));
|
|
135
|
+
this.displayError = computed(() => this.chat()?.error ?? this.error(), ...(ngDevMode ? [{ debugName: "displayError" }] : /* istanbul ignore next */ []));
|
|
136
|
+
this.editDraft = signal(undefined, ...(ngDevMode ? [{ debugName: "editDraft" }] : /* istanbul ignore next */ []));
|
|
137
|
+
this.resolvedInstances = signal(new Set(), ...(ngDevMode ? [{ debugName: "resolvedInstances" }] : /* istanbul ignore next */ []));
|
|
138
|
+
this.initialized = false;
|
|
139
|
+
this.styleText = () => this.theme === undefined ? null : Object.entries(toChatCssVariables(this.theme)).map(([key, value]) => `${key}:${value}`).join(';');
|
|
140
|
+
this.dangerColor = () => resolveChatTheme(this.theme).colors.danger;
|
|
141
|
+
this.targets = () => getLifecycleTargets(this.chat()?.messages ?? []);
|
|
142
|
+
this.toolCalls = () => (this.chat()?.messages ?? []).flatMap(message => message.toolCalls ?? []);
|
|
143
|
+
this.selectFor = (frame) => (event) => this.selectComponent(event, frame);
|
|
144
|
+
this.interact = (event) => { if (this.resolvedInstances().has(event.instanceId))
|
|
145
|
+
return; this.resolvedInstances.update(current => new Set(current).add(event.instanceId)); try {
|
|
146
|
+
this.onComponentInteract?.(event);
|
|
147
|
+
}
|
|
148
|
+
catch (error) {
|
|
149
|
+
this.resolvedInstances.update(current => { const next = new Set(current); next.delete(event.instanceId); return next; });
|
|
150
|
+
this.fail(error, 'Component interaction callback failed.');
|
|
151
|
+
} };
|
|
152
|
+
this.approve = (id) => { const record = this.confirmation?.getByToolCall(id); void (record ? this.confirmation.approve(record.token, this.currentSession.sessionId) : this.chat().approve(id)).catch(error => this.fail(error, 'Action approval failed.')); };
|
|
153
|
+
this.deny = (id, reason) => { const record = this.confirmation?.getByToolCall(id); void (record ? this.confirmation.reject(record.token, this.currentSession.sessionId, reason) : this.chat().deny(id, reason)).catch(error => this.fail(error, 'Action rejection failed.')); };
|
|
154
|
+
}
|
|
155
|
+
ngOnChanges(_changes) {
|
|
156
|
+
if (!this.definition)
|
|
157
|
+
return;
|
|
158
|
+
const revision = this.definition.revision ?? 1;
|
|
159
|
+
const identityChanged = !this.initialized || this.definition.id !== this.definitionId || revision !== this.definitionRevision || this.session !== this.preparedSession;
|
|
160
|
+
if (identityChanged) {
|
|
161
|
+
this.initialized = true;
|
|
162
|
+
this.definitionId = this.definition.id;
|
|
163
|
+
this.definitionRevision = revision;
|
|
164
|
+
this.preparedSession = this.session;
|
|
165
|
+
this.currentSession = resolveChatSession(this.definition, this.session);
|
|
166
|
+
this.resolvedInstances.set(new Set());
|
|
167
|
+
this.error.set(null);
|
|
168
|
+
this.editDraft.set(undefined);
|
|
169
|
+
this.initialize(this.definition.chat, false);
|
|
170
|
+
this.confirmation = this.currentSession.createConfirmation({ ...(this.actionConfirmationTtlMs === undefined ? {} : { ttlMs: this.actionConfirmationTtlMs }), chat: { proposeToolCall: proposal => this.chat().proposeToolCall(proposal), approve: id => this.chat().approve(id), deny: (id, reason) => this.chat().deny(id, reason) } });
|
|
171
|
+
}
|
|
172
|
+
else if (this.definition.chat !== this.activeChat)
|
|
173
|
+
this.initialize(this.definition.chat, true);
|
|
174
|
+
}
|
|
175
|
+
ngOnDestroy() { this.service.destroy(); }
|
|
176
|
+
initialize(config, preserve) {
|
|
177
|
+
const messages = preserve ? this.chat()?.messages : config.initialMessages;
|
|
178
|
+
this.activeChat = config;
|
|
179
|
+
this.service.init(this.currentSession.updateChat({ ...config, ...(messages === undefined ? {} : { initialMessages: messages }) }));
|
|
180
|
+
}
|
|
181
|
+
presentations(message) {
|
|
182
|
+
return presentChatMessage(message).map(presentation => {
|
|
183
|
+
if (presentation.kind === 'message')
|
|
184
|
+
return { kind: 'message', message: presentation.message };
|
|
185
|
+
if (presentation.kind === 'diagnostic')
|
|
186
|
+
return { kind: 'diagnostic', message, diagnosticCode: presentation.code, diagnosticMessage: presentation.message };
|
|
187
|
+
const resolved = this.definition.components === undefined ? undefined : resolveComponentFrame(presentation.frame, this.definition.components);
|
|
188
|
+
return resolved?.ok
|
|
189
|
+
? { kind: presentation.frame.componentKey === 'choice-list' ? 'choice' : 'standard', message, frame: presentation.frame }
|
|
190
|
+
: { kind: 'fallback', message, fallback: formatSemanticFallback(presentation.frame.fallback) };
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
selectComponent(event, frame) {
|
|
194
|
+
if (this.resolvedInstances().has(event.instanceId))
|
|
195
|
+
return;
|
|
196
|
+
this.error.set(null);
|
|
197
|
+
this.resolvedInstances.update(current => new Set(current).add(event.instanceId));
|
|
198
|
+
try {
|
|
199
|
+
this.onComponentSelect?.(event);
|
|
200
|
+
}
|
|
201
|
+
catch (error) {
|
|
202
|
+
this.fail(error, 'Component selection callback failed.');
|
|
203
|
+
}
|
|
204
|
+
const action = resolveChoiceAction(frame, event.choiceId);
|
|
205
|
+
if (action)
|
|
206
|
+
void this.confirmation.propose(action).catch(error => { this.resolvedInstances.update(current => { const next = new Set(current); next.delete(event.instanceId); return next; }); this.fail(error, 'Action proposal failed.'); });
|
|
207
|
+
else {
|
|
208
|
+
let submission;
|
|
209
|
+
try {
|
|
210
|
+
submission = this.definition.choiceSubmission?.(frame, event.choiceId, { sessionId: this.currentSession.sessionId });
|
|
211
|
+
}
|
|
212
|
+
catch (error) {
|
|
213
|
+
this.resolvedInstances.update(current => { const next = new Set(current); next.delete(event.instanceId); return next; });
|
|
214
|
+
this.fail(error, 'Choice submission authorization failed.');
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
if (submission && 'unavailable' in submission) {
|
|
218
|
+
this.resolvedInstances.update(current => { const next = new Set(current); next.delete(event.instanceId); return next; });
|
|
219
|
+
this.fail(new Error('This deterministic choice expired. Ask the question again.'), 'Choice unavailable.');
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
if (submission)
|
|
223
|
+
void this.chat().send(submission.value).then(() => { try {
|
|
224
|
+
submission.commit();
|
|
225
|
+
}
|
|
226
|
+
catch (error) {
|
|
227
|
+
this.fail(error, 'Choice submission settlement failed.');
|
|
228
|
+
} }, error => {
|
|
229
|
+
try {
|
|
230
|
+
submission.release();
|
|
231
|
+
}
|
|
232
|
+
catch { /* settlement isolation */ }
|
|
233
|
+
finally {
|
|
234
|
+
this.resolvedInstances.update(current => { const next = new Set(current); next.delete(event.instanceId); return next; });
|
|
235
|
+
}
|
|
236
|
+
this.fail(error, 'Choice submission failed.');
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
run(operation) { this.error.set(null); void operation.catch(error => this.fail(error, 'Lifecycle operation failed.')); }
|
|
241
|
+
beginEdit() { const id = this.targets().userId; if (id)
|
|
242
|
+
this.editDraft.set({ messageId: id, content: this.chat().messages.find(message => message.id === id)?.content ?? '' }); }
|
|
243
|
+
updateEdit(content) { const draft = this.editDraft(); if (draft)
|
|
244
|
+
this.editDraft.set({ ...draft, content }); }
|
|
245
|
+
updateEditEvent(event) { if (event.target instanceof HTMLInputElement)
|
|
246
|
+
this.updateEdit(event.target.value); }
|
|
247
|
+
saveEdit(event) { event.preventDefault(); const draft = this.editDraft(); if (!draft?.content.trim())
|
|
248
|
+
return; this.run(this.chat().edit(draft.messageId, draft.content)); this.editDraft.set(undefined); }
|
|
249
|
+
inputContext() { const chat = this.chat(); return { $implicit: chat, chat, disabled: chat?.status === 'streaming', placeholder: this.placeholder }; }
|
|
250
|
+
confirmationContext(toolCall) { return { $implicit: toolCall, toolCall, approve: this.approve, deny: this.deny }; }
|
|
251
|
+
choiceContext(frame) { const props = { frame, manifest: this.definition.components, disabled: this.resolvedInstances().has(frame.instanceId), onSelect: this.selectFor(frame) }; return { $implicit: props, ...props }; }
|
|
252
|
+
standardContext(frame) { const props = { frame, manifest: this.definition.components, disabled: this.resolvedInstances().has(frame.instanceId), onInteract: this.interact }; return { $implicit: props, ...props }; }
|
|
253
|
+
fail(error, fallback) { this.error.set(error instanceof Error ? error : new Error(fallback)); }
|
|
254
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: AgentChatComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
255
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.18", type: AgentChatComponent, isStandalone: true, selector: "ak-agent-chat", inputs: { definition: "definition", placeholder: "placeholder", onComponentSelect: "onComponentSelect", onComponentInteract: "onComponentInteract", actionConfirmationTtlMs: "actionConfirmationTtlMs", session: "session", theme: "theme" }, providers: [AgentskitChat], queries: [{ propertyName: "containerTemplate", first: true, predicate: ["container"], descendants: true, read: TemplateRef }, { propertyName: "messageTemplate", first: true, predicate: ["message"], descendants: true, read: TemplateRef }, { propertyName: "inputTemplate", first: true, predicate: ["input"], descendants: true, read: TemplateRef }, { propertyName: "thinkingTemplate", first: true, predicate: ["thinking"], descendants: true, read: TemplateRef }, { propertyName: "confirmationTemplate", first: true, predicate: ["confirmation"], descendants: true, read: TemplateRef }, { propertyName: "choiceListTemplate", first: true, predicate: ["choiceList"], descendants: true, read: TemplateRef }, { propertyName: "standardComponentTemplate", first: true, predicate: ["standardComponent"], descendants: true, read: TemplateRef }], usesOnChanges: true, ngImport: i0, template: `<section [attr.aria-label]="definition.id + ' chat'" data-ak-app-chat [style]="styleText()">
|
|
256
|
+
<div aria-live="polite" aria-relevant="additions text" role="log"><ng-template #content>
|
|
257
|
+
@for (message of chat()?.messages ?? []; track message.id) { @for (view of presentations(message); track $index) {
|
|
258
|
+
@switch (view.kind) {
|
|
259
|
+
@case ('choice') { @if (choiceListTemplate) { <ng-container [ngTemplateOutlet]="choiceListTemplate" [ngTemplateOutletContext]="choiceContext(view.frame!)" /> } @else { <ak-choice-list [frame]="view.frame" [manifest]="definition.components!" [disabled]="resolvedInstances().has(view.frame!.instanceId)" [onSelect]="selectFor(view.frame!)" /> } }
|
|
260
|
+
@case ('standard') { @if (standardComponentTemplate) { <ng-container [ngTemplateOutlet]="standardComponentTemplate" [ngTemplateOutletContext]="standardContext(view.frame!)" /> } @else { <ak-standard-component [frame]="view.frame!" [manifest]="definition.components!" [disabled]="resolvedInstances().has(view.frame!.instanceId)" [onInteract]="interact" /> } }
|
|
261
|
+
@case ('fallback') { <p data-ak-component-fallback>{{ view.fallback }}</p> }
|
|
262
|
+
@case ('diagnostic') { <p role="alert" [attr.data-ak-component-diagnostic]="view.diagnosticCode">{{ view.diagnosticMessage }}</p> }
|
|
263
|
+
@default { @if (messageTemplate) { <ng-container [ngTemplateOutlet]="messageTemplate" [ngTemplateOutletContext]="{ $implicit: view.message }" /> } @else { <ak-message [message]="view.message!" /> } }
|
|
264
|
+
}
|
|
265
|
+
} }
|
|
266
|
+
@for (toolCall of toolCalls(); track toolCall.id) { @if (confirmationTemplate) { <ng-container [ngTemplateOutlet]="confirmationTemplate" [ngTemplateOutletContext]="confirmationContext(toolCall)" /> } @else { <ak-tool-confirmation [toolCall]="toolCall" [onApprove]="approve" [onDeny]="deny" /> } }
|
|
267
|
+
@if (thinkingTemplate) { <ng-container [ngTemplateOutlet]="thinkingTemplate" [ngTemplateOutletContext]="{ $implicit: chat()?.status === 'streaming' }" /> } @else { <ak-thinking-indicator [visible]="chat()?.status === 'streaming'" /> }
|
|
268
|
+
</ng-template>@if (containerTemplate) { <ng-container [ngTemplateOutlet]="containerTemplate" [ngTemplateOutletContext]="{ $implicit: content, content: content }" /> } @else { <ak-chat-container><ng-container [ngTemplateOutlet]="content" /></ak-chat-container> }</div>
|
|
269
|
+
@if (displayError(); as currentError) { <p role="alert" [style.color]="dangerColor()">{{ currentError.message }}</p> }
|
|
270
|
+
@if (chat()?.status === 'streaming') { <button type="button" (click)="chat()?.stop()">Stop</button> }
|
|
271
|
+
@if (targets().userId && chat()?.status !== 'streaming') { <div aria-label="Response actions">
|
|
272
|
+
<button type="button" aria-label="Retry response" (click)="run(chat()!.retry())">Retry</button>
|
|
273
|
+
@if (targets().assistantId) { <button type="button" aria-label="Regenerate response" (click)="run(chat()!.regenerate(targets().assistantId!))">Regenerate</button> }
|
|
274
|
+
<button type="button" (click)="beginEdit()">Edit last message</button>
|
|
275
|
+
@if (editDraft(); as draft) { <form (submit)="saveEdit($event)"><label>Edit message<input aria-label="Edit message" [value]="draft.content" (input)="updateEditEvent($event)" /></label><button type="submit" aria-label="Save edit">Save edit</button><button type="button" (click)="editDraft.set(undefined)">Cancel edit</button></form> }
|
|
276
|
+
</div> }
|
|
277
|
+
@if (inputTemplate) { <ng-container [ngTemplateOutlet]="inputTemplate" [ngTemplateOutletContext]="inputContext()" /> } @else if (chat(); as currentChat) { <ak-input-bar [chat]="currentChat" [disabled]="currentChat.status === 'streaming'" [placeholder]="placeholder ?? 'Type a message...'" /> }
|
|
278
|
+
</section>`, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ChatContainerComponent, selector: "ak-chat-container" }, { kind: "component", type: MessageComponent, selector: "ak-message", inputs: ["message"] }, { kind: "component", type: InputBarComponent, selector: "ak-input-bar", inputs: ["chat", "placeholder", "disabled"] }, { kind: "component", type: ThinkingIndicatorComponent, selector: "ak-thinking-indicator", inputs: ["visible", "label"] }, { kind: "component", type: ToolConfirmationComponent, selector: "ak-tool-confirmation", inputs: ["toolCall", "onApprove", "onDeny"] }, { kind: "component", type: ChoiceListComponent, selector: "ak-choice-list", inputs: ["frame", "manifest", "onSelect", "disabled"] }, { kind: "component", type: StandardComponentComponent, selector: "ak-standard-component", inputs: ["frame", "manifest", "onInteract", "disabled"] }] }); }
|
|
279
|
+
}
|
|
280
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: AgentChatComponent, decorators: [{
|
|
281
|
+
type: Component,
|
|
282
|
+
args: [{
|
|
283
|
+
selector: 'ak-agent-chat', standalone: true,
|
|
284
|
+
imports: [NgTemplateOutlet, ChatContainerComponent, MessageComponent, InputBarComponent, ThinkingIndicatorComponent, ToolConfirmationComponent, ChoiceListComponent, StandardComponentComponent],
|
|
285
|
+
providers: [AgentskitChat],
|
|
286
|
+
template: `<section [attr.aria-label]="definition.id + ' chat'" data-ak-app-chat [style]="styleText()">
|
|
287
|
+
<div aria-live="polite" aria-relevant="additions text" role="log"><ng-template #content>
|
|
288
|
+
@for (message of chat()?.messages ?? []; track message.id) { @for (view of presentations(message); track $index) {
|
|
289
|
+
@switch (view.kind) {
|
|
290
|
+
@case ('choice') { @if (choiceListTemplate) { <ng-container [ngTemplateOutlet]="choiceListTemplate" [ngTemplateOutletContext]="choiceContext(view.frame!)" /> } @else { <ak-choice-list [frame]="view.frame" [manifest]="definition.components!" [disabled]="resolvedInstances().has(view.frame!.instanceId)" [onSelect]="selectFor(view.frame!)" /> } }
|
|
291
|
+
@case ('standard') { @if (standardComponentTemplate) { <ng-container [ngTemplateOutlet]="standardComponentTemplate" [ngTemplateOutletContext]="standardContext(view.frame!)" /> } @else { <ak-standard-component [frame]="view.frame!" [manifest]="definition.components!" [disabled]="resolvedInstances().has(view.frame!.instanceId)" [onInteract]="interact" /> } }
|
|
292
|
+
@case ('fallback') { <p data-ak-component-fallback>{{ view.fallback }}</p> }
|
|
293
|
+
@case ('diagnostic') { <p role="alert" [attr.data-ak-component-diagnostic]="view.diagnosticCode">{{ view.diagnosticMessage }}</p> }
|
|
294
|
+
@default { @if (messageTemplate) { <ng-container [ngTemplateOutlet]="messageTemplate" [ngTemplateOutletContext]="{ $implicit: view.message }" /> } @else { <ak-message [message]="view.message!" /> } }
|
|
295
|
+
}
|
|
296
|
+
} }
|
|
297
|
+
@for (toolCall of toolCalls(); track toolCall.id) { @if (confirmationTemplate) { <ng-container [ngTemplateOutlet]="confirmationTemplate" [ngTemplateOutletContext]="confirmationContext(toolCall)" /> } @else { <ak-tool-confirmation [toolCall]="toolCall" [onApprove]="approve" [onDeny]="deny" /> } }
|
|
298
|
+
@if (thinkingTemplate) { <ng-container [ngTemplateOutlet]="thinkingTemplate" [ngTemplateOutletContext]="{ $implicit: chat()?.status === 'streaming' }" /> } @else { <ak-thinking-indicator [visible]="chat()?.status === 'streaming'" /> }
|
|
299
|
+
</ng-template>@if (containerTemplate) { <ng-container [ngTemplateOutlet]="containerTemplate" [ngTemplateOutletContext]="{ $implicit: content, content: content }" /> } @else { <ak-chat-container><ng-container [ngTemplateOutlet]="content" /></ak-chat-container> }</div>
|
|
300
|
+
@if (displayError(); as currentError) { <p role="alert" [style.color]="dangerColor()">{{ currentError.message }}</p> }
|
|
301
|
+
@if (chat()?.status === 'streaming') { <button type="button" (click)="chat()?.stop()">Stop</button> }
|
|
302
|
+
@if (targets().userId && chat()?.status !== 'streaming') { <div aria-label="Response actions">
|
|
303
|
+
<button type="button" aria-label="Retry response" (click)="run(chat()!.retry())">Retry</button>
|
|
304
|
+
@if (targets().assistantId) { <button type="button" aria-label="Regenerate response" (click)="run(chat()!.regenerate(targets().assistantId!))">Regenerate</button> }
|
|
305
|
+
<button type="button" (click)="beginEdit()">Edit last message</button>
|
|
306
|
+
@if (editDraft(); as draft) { <form (submit)="saveEdit($event)"><label>Edit message<input aria-label="Edit message" [value]="draft.content" (input)="updateEditEvent($event)" /></label><button type="submit" aria-label="Save edit">Save edit</button><button type="button" (click)="editDraft.set(undefined)">Cancel edit</button></form> }
|
|
307
|
+
</div> }
|
|
308
|
+
@if (inputTemplate) { <ng-container [ngTemplateOutlet]="inputTemplate" [ngTemplateOutletContext]="inputContext()" /> } @else if (chat(); as currentChat) { <ak-input-bar [chat]="currentChat" [disabled]="currentChat.status === 'streaming'" [placeholder]="placeholder ?? 'Type a message...'" /> }
|
|
309
|
+
</section>`,
|
|
310
|
+
}]
|
|
311
|
+
}], propDecorators: { definition: [{
|
|
312
|
+
type: Input,
|
|
313
|
+
args: [{ required: true }]
|
|
314
|
+
}], placeholder: [{
|
|
315
|
+
type: Input
|
|
316
|
+
}], onComponentSelect: [{
|
|
317
|
+
type: Input
|
|
318
|
+
}], onComponentInteract: [{
|
|
319
|
+
type: Input
|
|
320
|
+
}], actionConfirmationTtlMs: [{
|
|
321
|
+
type: Input
|
|
322
|
+
}], session: [{
|
|
323
|
+
type: Input
|
|
324
|
+
}], theme: [{
|
|
325
|
+
type: Input
|
|
326
|
+
}], containerTemplate: [{
|
|
327
|
+
type: ContentChild,
|
|
328
|
+
args: ['container', { read: TemplateRef }]
|
|
329
|
+
}], messageTemplate: [{
|
|
330
|
+
type: ContentChild,
|
|
331
|
+
args: ['message', { read: TemplateRef }]
|
|
332
|
+
}], inputTemplate: [{
|
|
333
|
+
type: ContentChild,
|
|
334
|
+
args: ['input', { read: TemplateRef }]
|
|
335
|
+
}], thinkingTemplate: [{
|
|
336
|
+
type: ContentChild,
|
|
337
|
+
args: ['thinking', { read: TemplateRef }]
|
|
338
|
+
}], confirmationTemplate: [{
|
|
339
|
+
type: ContentChild,
|
|
340
|
+
args: ['confirmation', { read: TemplateRef }]
|
|
341
|
+
}], choiceListTemplate: [{
|
|
342
|
+
type: ContentChild,
|
|
343
|
+
args: ['choiceList', { read: TemplateRef }]
|
|
344
|
+
}], standardComponentTemplate: [{
|
|
345
|
+
type: ContentChild,
|
|
346
|
+
args: ['standardComponent', { read: TemplateRef }]
|
|
347
|
+
}] } });
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* Generated bundle index. Do not edit.
|
|
351
|
+
*/
|
|
352
|
+
|
|
353
|
+
export { AgentChatComponent, ChoiceListComponent, StandardComponentComponent, toChatCssVariables };
|
|
354
|
+
//# sourceMappingURL=agentskit-chat-angular.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agentskit-chat-angular.mjs","sources":["../../src/standard-component.ts","../../src/index.ts","../../src/agentskit-chat-angular.ts"],"sourcesContent":["import { Component, Input, type OnChanges } from '@angular/core'\nimport { ApprovalRequestPropsSchema, ButtonGroupPropsSchema, ConfirmationPropsSchema, ErrorNoticePropsSchema, FileAttachmentPropsSchema, FormPropsSchema, LinkCardPropsSchema, ProgressPropsSchema, SourceListPropsSchema, TablePropsSchema, ToolCallPropsSchema, createComponentInteraction, resolveComponentFallback, resolveComponentFrame, type ComponentManifest } from '@agentskit/chat'\nimport type { ComponentInteractionEvent, ComponentRenderFrame } from '@agentskit/chat-protocol'\n\n@Component({\n selector: 'ak-standard-component', standalone: true,\n template: `@if (valid) { @switch (frame.componentKey) {\n @case ('button-group') { @if (buttonGroup(); as item) { <fieldset [attr.aria-label]=\"item.label\" data-ak-component=\"button-group\"><legend>{{ item.label }}</legend>@for (button of item.buttons; track button.id) { <button type=\"button\" [disabled]=\"disabled || button.disabled\" (click)=\"emit('select', button.id)\">{{ button.label }}</button> }</fieldset> } }\n @case ('form') { @if (form(); as item) { <form [attr.aria-label]=\"item.title ?? 'Form'\" data-ak-component=\"form\" (submit)=\"submit($event)\">@if (item.title) { <h3>{{ item.title }}</h3> } @for (field of item.fields; track field.id) { <label>{{ field.label }}@if (field.type === 'select') { <select [required]=\"field.required\" [disabled]=\"disabled\" (change)=\"setSelect(field.id, $event)\"><option value=\"\" disabled selected>Select…</option>@for (option of field.options ?? []; track option.id) { <option [value]=\"option.id\">{{ option.label }}</option> }</select> } @else { <input [type]=\"field.type\" [required]=\"field.required\" [disabled]=\"disabled\" [placeholder]=\"field.placeholder\" (input)=\"setInput(field.id, field.type, $event)\" /> }</label> } <button type=\"submit\" [disabled]=\"disabled\">{{ item.submitLabel }}</button></form> } }\n @case ('confirmation') { @if (confirmation(); as item) { <section [attr.aria-label]=\"item.title\" data-ak-component=\"confirmation\"><h3>{{ item.title }}</h3><p>{{ item.message }}</p><button [disabled]=\"disabled\" (click)=\"emit('confirm')\">{{ item.confirmLabel }}</button><button [disabled]=\"disabled\" (click)=\"emit('cancel')\">{{ item.cancelLabel }}</button></section> } }\n @case ('progress') { @if (progress(); as item) { <div data-ak-component=\"progress\"><label>{{ item.label }}<progress max=\"100\" [value]=\"item.value\"></progress></label>@if (item.status) { <p>{{ item.status }}</p> }</div> } }\n @case ('source-list') { @if (sourceList(); as item) { <section data-ak-component=\"source-list\"><h3>{{ item.label }}</h3><ul>@for (source of item.sources; track source.id) { <li>@if (source.url) { <a [href]=\"source.url\" (click)=\"link($event, 'open', source.id)\">{{ source.title }}</a> } @else { {{ source.title }} } @if (source.snippet) { <p>{{ source.snippet }}</p> }</li> }</ul></section> } }\n @case ('link-card') { @if (linkCard(); as item) { <a data-ak-component=\"link-card\" [href]=\"item.href\" (click)=\"link($event, 'open', item.href)\"><strong>{{ item.title }}</strong><span>{{ item.description }}</span><span>{{ item.label }}</span></a> } }\n @case ('error-notice') { @if (errorNotice(); as item) { <section role=\"alert\" data-ak-component=\"error-notice\"><strong>{{ item.title }}</strong><p>{{ item.message }}</p><code>{{ item.code }}</code>@if (item.retryLabel) { <button [disabled]=\"disabled\" (click)=\"emit('retry')\">{{ item.retryLabel }}</button> }</section> } }\n @case ('tool-call') { @if (toolCall(); as item) { <section role=\"status\" data-ak-component=\"tool-call\"><strong>{{ item.name }}</strong><span>{{ item.status }}</span><pre>{{ json(item.arguments) }}</pre><pre>{{ json(item.result) }}</pre></section> } }\n @case ('approval-request') { @if (approval(); as item) { <section [attr.aria-label]=\"item.title\" data-ak-component=\"approval-request\"><h3>{{ item.title }}</h3><p>{{ item.description }}</p><button [disabled]=\"disabled\" (click)=\"emit('approve')\">{{ item.approveLabel }}</button><button [disabled]=\"disabled\" (click)=\"emit('deny')\">{{ item.denyLabel }}</button></section> } }\n @case ('table') { @if (table(); as item) { <table data-ak-component=\"table\"><caption>{{ item.caption }}</caption><thead><tr>@for (column of item.columns; track column.key) { <th scope=\"col\">{{ column.label }}</th> }</tr></thead><tbody>@for (row of item.rows; track $index) { <tr>@for (column of item.columns; track column.key) { <td>{{ cell(row[column.key]) }}</td> }</tr> }</tbody></table> } }\n @case ('file-attachment') { @if (file(); as item) { <article data-ak-component=\"file-attachment\"><strong>{{ item.name }}</strong><span>{{ item.mimeType }}</span>@if (item.sizeBytes !== undefined) { <span>{{ item.sizeBytes }} bytes</span> } @if (item.url) { <a [href]=\"item.url\" (click)=\"link($event, 'open', item.url)\">Open</a> }</article> } }\n @default { <p data-ak-component-fallback>{{ fallback() }}</p> }\n } }`,\n})\nexport class StandardComponentComponent implements OnChanges {\n @Input({ required: true }) frame!: ComponentRenderFrame\n @Input({ required: true }) manifest!: ComponentManifest\n @Input({ required: true }) onInteract!: (event: ComponentInteractionEvent) => void\n @Input() disabled = false\n valid = false\n private values: Record<string, string | boolean> = {}\n ngOnChanges(): void { this.valid = resolveComponentFrame(this.frame, this.manifest).ok && this.frame.componentKey !== 'choice-list' }\n buttonGroup = () => ButtonGroupPropsSchema.safeParse(this.frame.props).data\n form = () => FormPropsSchema.safeParse(this.frame.props).data\n confirmation = () => ConfirmationPropsSchema.safeParse(this.frame.props).data\n progress = () => ProgressPropsSchema.safeParse(this.frame.props).data\n sourceList = () => SourceListPropsSchema.safeParse(this.frame.props).data\n linkCard = () => LinkCardPropsSchema.safeParse(this.frame.props).data\n errorNotice = () => ErrorNoticePropsSchema.safeParse(this.frame.props).data\n toolCall = () => ToolCallPropsSchema.safeParse(this.frame.props).data\n approval = () => ApprovalRequestPropsSchema.safeParse(this.frame.props).data\n table = () => TablePropsSchema.safeParse(this.frame.props).data\n file = () => FileAttachmentPropsSchema.safeParse(this.frame.props).data\n fallback = (): string => resolveComponentFallback(this.frame, this.manifest) ?? ''\n emit(event: string, value?: unknown): void { this.onInteract(createComponentInteraction(this.frame, this.manifest, event, value)) }\n link(event: Event, name: string, value: string): void { event.preventDefault(); this.emit(name, value) }\n submit(event: Event): void { event.preventDefault(); this.emit('submit', { ...this.values }) }\n setSelect(id: string, event: Event): void { if (event.target instanceof HTMLSelectElement) this.values[id] = event.target.value }\n setInput(id: string, type: string, event: Event): void { if (event.target instanceof HTMLInputElement) this.values[id] = type === 'checkbox' ? event.target.checked : event.target.value }\n json(value: unknown): string { return value === undefined ? '' : JSON.stringify(value, null, 2) }\n cell(value: unknown): string { return value === null || ['string', 'number', 'boolean'].includes(typeof value) ? String(value ?? '') : '' }\n}\n","import { NgTemplateOutlet } from '@angular/common'\nimport { Component, ContentChild, Input, OnChanges, SimpleChanges, TemplateRef, computed, inject, signal, type OnDestroy } from '@angular/core'\nimport { AgentskitChat, ChatContainerComponent, InputBarComponent, MessageComponent, ThinkingIndicatorComponent, ToolConfirmationComponent } from '@agentskit/angular'\nimport { formatSemanticFallback, getLifecycleTargets, presentChatMessage, resolveChatSession, resolveChatTheme, resolveChoiceAction, resolveChoiceListFrame, resolveComponentFrame, selectChoice } from '@agentskit/chat'\nimport type { ChatDefinition, ChatSession, ChatThemeInput, ComponentManifest } from '@agentskit/chat'\nimport type { ComponentInteractionEvent, ComponentRenderFrame, ComponentSelectionEvent } from '@agentskit/chat-protocol'\nimport type { ChatReturn, Message as ChatMessage, ToolCall } from '@agentskit/core'\nimport { StandardComponentComponent } from './standard-component.js'\n\nexport { StandardComponentComponent } from './standard-component.js'\n\nexport type ChatCssVariables = Readonly<Record<`--ak-${string}`, string | number>>\nexport const toChatCssVariables = (input?: ChatThemeInput): ChatCssVariables => {\n const theme = resolveChatTheme(input)\n return {\n '--ak-color-bg': theme.colors.background, '--ak-color-surface': theme.colors.surface, '--ak-color-border': theme.colors.border,\n '--ak-color-text': theme.colors.text, '--ak-color-text-muted': theme.colors.muted, '--ak-color-bubble-user': theme.colors.accent,\n '--ak-color-bubble-user-text': theme.colors.onAccent, '--ak-color-bubble-assistant': theme.colors.surface, '--ak-color-bubble-assistant-text': theme.colors.text,\n '--ak-color-input-bg': theme.colors.background, '--ak-color-input-border': theme.colors.border, '--ak-color-input-focus': theme.colors.accent,\n '--ak-color-button': theme.colors.accent, '--ak-color-button-text': theme.colors.onAccent, '--ak-color-tool-bg': theme.colors.surface,\n '--ak-color-tool-border': theme.colors.border, '--ak-app-color-danger': theme.colors.danger,\n '--ak-font-family': theme.fontFamily === 'system' ? \"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif\" : theme.fontFamily,\n '--ak-radius': `${theme.radius.medium}px`, '--ak-radius-lg': `${theme.radius.large}px`, '--ak-spacing-sm': `${theme.spacing.small}px`,\n '--ak-spacing-md': `${theme.spacing.medium}px`, '--ak-spacing-lg': `${theme.spacing.large}px`,\n }\n}\n\n@Component({\n selector: 'ak-choice-list', standalone: true,\n template: `@if (resolved(); as item) { <fieldset [attr.aria-label]=\"item.props.prompt\" data-ak-component=\"choice-list\"><legend>{{ item.props.prompt }}</legend>\n @for (choice of item.props.choices; track choice.id) { <button type=\"button\" [disabled]=\"disabled\" (click)=\"choose(choice.id)\"><span>{{ choice.label }}</span>@if (choice.description) { <small>{{ choice.description }}</small> }</button> }\n </fieldset> }`,\n})\nexport class ChoiceListComponent implements OnChanges {\n @Input({ required: true }) frame!: unknown\n @Input({ required: true }) manifest!: ComponentManifest\n @Input({ required: true }) onSelect!: (event: ComponentSelectionEvent) => void\n @Input() disabled = false\n readonly resolved = signal<Extract<ReturnType<typeof resolveChoiceListFrame>, { ok: true }> | undefined>(undefined)\n ngOnChanges(): void { const value = resolveChoiceListFrame(this.frame, this.manifest); this.resolved.set(value.ok ? value : undefined) }\n choose(choiceId: string): void { const value = this.resolved(); if (value) this.onSelect(selectChoice(value.frame, choiceId)) }\n}\n\ninterface MessagePresentation {\n readonly kind: 'message' | 'choice' | 'standard' | 'fallback' | 'diagnostic'\n readonly message: ChatMessage\n readonly frame?: ComponentRenderFrame\n readonly fallback?: string\n readonly diagnosticCode?: string\n readonly diagnosticMessage?: string\n}\n\n@Component({\n selector: 'ak-agent-chat', standalone: true,\n imports: [NgTemplateOutlet, ChatContainerComponent, MessageComponent, InputBarComponent, ThinkingIndicatorComponent, ToolConfirmationComponent, ChoiceListComponent, StandardComponentComponent],\n providers: [AgentskitChat],\n template: `<section [attr.aria-label]=\"definition.id + ' chat'\" data-ak-app-chat [style]=\"styleText()\">\n <div aria-live=\"polite\" aria-relevant=\"additions text\" role=\"log\"><ng-template #content>\n @for (message of chat()?.messages ?? []; track message.id) { @for (view of presentations(message); track $index) {\n @switch (view.kind) {\n @case ('choice') { @if (choiceListTemplate) { <ng-container [ngTemplateOutlet]=\"choiceListTemplate\" [ngTemplateOutletContext]=\"choiceContext(view.frame!)\" /> } @else { <ak-choice-list [frame]=\"view.frame\" [manifest]=\"definition.components!\" [disabled]=\"resolvedInstances().has(view.frame!.instanceId)\" [onSelect]=\"selectFor(view.frame!)\" /> } }\n @case ('standard') { @if (standardComponentTemplate) { <ng-container [ngTemplateOutlet]=\"standardComponentTemplate\" [ngTemplateOutletContext]=\"standardContext(view.frame!)\" /> } @else { <ak-standard-component [frame]=\"view.frame!\" [manifest]=\"definition.components!\" [disabled]=\"resolvedInstances().has(view.frame!.instanceId)\" [onInteract]=\"interact\" /> } }\n @case ('fallback') { <p data-ak-component-fallback>{{ view.fallback }}</p> }\n @case ('diagnostic') { <p role=\"alert\" [attr.data-ak-component-diagnostic]=\"view.diagnosticCode\">{{ view.diagnosticMessage }}</p> }\n @default { @if (messageTemplate) { <ng-container [ngTemplateOutlet]=\"messageTemplate\" [ngTemplateOutletContext]=\"{ $implicit: view.message }\" /> } @else { <ak-message [message]=\"view.message!\" /> } }\n }\n } }\n @for (toolCall of toolCalls(); track toolCall.id) { @if (confirmationTemplate) { <ng-container [ngTemplateOutlet]=\"confirmationTemplate\" [ngTemplateOutletContext]=\"confirmationContext(toolCall)\" /> } @else { <ak-tool-confirmation [toolCall]=\"toolCall\" [onApprove]=\"approve\" [onDeny]=\"deny\" /> } }\n @if (thinkingTemplate) { <ng-container [ngTemplateOutlet]=\"thinkingTemplate\" [ngTemplateOutletContext]=\"{ $implicit: chat()?.status === 'streaming' }\" /> } @else { <ak-thinking-indicator [visible]=\"chat()?.status === 'streaming'\" /> }\n </ng-template>@if (containerTemplate) { <ng-container [ngTemplateOutlet]=\"containerTemplate\" [ngTemplateOutletContext]=\"{ $implicit: content, content: content }\" /> } @else { <ak-chat-container><ng-container [ngTemplateOutlet]=\"content\" /></ak-chat-container> }</div>\n @if (displayError(); as currentError) { <p role=\"alert\" [style.color]=\"dangerColor()\">{{ currentError.message }}</p> }\n @if (chat()?.status === 'streaming') { <button type=\"button\" (click)=\"chat()?.stop()\">Stop</button> }\n @if (targets().userId && chat()?.status !== 'streaming') { <div aria-label=\"Response actions\">\n <button type=\"button\" aria-label=\"Retry response\" (click)=\"run(chat()!.retry())\">Retry</button>\n @if (targets().assistantId) { <button type=\"button\" aria-label=\"Regenerate response\" (click)=\"run(chat()!.regenerate(targets().assistantId!))\">Regenerate</button> }\n <button type=\"button\" (click)=\"beginEdit()\">Edit last message</button>\n @if (editDraft(); as draft) { <form (submit)=\"saveEdit($event)\"><label>Edit message<input aria-label=\"Edit message\" [value]=\"draft.content\" (input)=\"updateEditEvent($event)\" /></label><button type=\"submit\" aria-label=\"Save edit\">Save edit</button><button type=\"button\" (click)=\"editDraft.set(undefined)\">Cancel edit</button></form> }\n </div> }\n @if (inputTemplate) { <ng-container [ngTemplateOutlet]=\"inputTemplate\" [ngTemplateOutletContext]=\"inputContext()\" /> } @else if (chat(); as currentChat) { <ak-input-bar [chat]=\"currentChat\" [disabled]=\"currentChat.status === 'streaming'\" [placeholder]=\"placeholder ?? 'Type a message...'\" /> }\n </section>`,\n})\nexport class AgentChatComponent implements OnChanges, OnDestroy {\n @Input({ required: true }) definition!: ChatDefinition\n @Input() placeholder?: string\n @Input() onComponentSelect?: (event: ComponentSelectionEvent) => void\n @Input() onComponentInteract?: (event: ComponentInteractionEvent) => void\n @Input() actionConfirmationTtlMs?: number\n @Input() session?: ChatSession\n @Input() theme?: ChatThemeInput\n @ContentChild('container', { read: TemplateRef }) containerTemplate?: TemplateRef<unknown>\n @ContentChild('message', { read: TemplateRef }) messageTemplate?: TemplateRef<unknown>\n @ContentChild('input', { read: TemplateRef }) inputTemplate?: TemplateRef<unknown>\n @ContentChild('thinking', { read: TemplateRef }) thinkingTemplate?: TemplateRef<unknown>\n @ContentChild('confirmation', { read: TemplateRef }) confirmationTemplate?: TemplateRef<unknown>\n @ContentChild('choiceList', { read: TemplateRef }) choiceListTemplate?: TemplateRef<unknown>\n @ContentChild('standardComponent', { read: TemplateRef }) standardComponentTemplate?: TemplateRef<unknown>\n\n private readonly service = inject(AgentskitChat)\n readonly chat = computed<ChatReturn | null>(() => this.service.state() ? this.service.snapshot() : null)\n readonly error = signal<Error | null>(null)\n readonly displayError = computed(() => this.chat()?.error ?? this.error())\n readonly editDraft = signal<{ readonly messageId: string; readonly content: string } | undefined>(undefined)\n readonly resolvedInstances = signal(new Set<string>())\n private activeChat?: ChatDefinition['chat']\n private initialized = false\n private definitionId?: string\n private definitionRevision?: number\n private preparedSession: ChatSession | undefined\n private currentSession?: ChatSession\n private confirmation?: ReturnType<ChatSession['createConfirmation']>\n\n ngOnChanges(_changes: SimpleChanges): void {\n if (!this.definition) return\n const revision = this.definition.revision ?? 1\n const identityChanged = !this.initialized || this.definition.id !== this.definitionId || revision !== this.definitionRevision || this.session !== this.preparedSession\n if (identityChanged) {\n this.initialized = true; this.definitionId = this.definition.id; this.definitionRevision = revision; this.preparedSession = this.session\n this.currentSession = resolveChatSession(this.definition, this.session); this.resolvedInstances.set(new Set()); this.error.set(null); this.editDraft.set(undefined); this.initialize(this.definition.chat, false)\n this.confirmation = this.currentSession.createConfirmation({ ...(this.actionConfirmationTtlMs === undefined ? {} : { ttlMs: this.actionConfirmationTtlMs }), chat: { proposeToolCall: proposal => this.chat()!.proposeToolCall(proposal), approve: id => this.chat()!.approve(id), deny: (id, reason) => this.chat()!.deny(id, reason) } })\n } else if (this.definition.chat !== this.activeChat) this.initialize(this.definition.chat, true)\n }\n\n ngOnDestroy(): void { this.service.destroy() }\n private initialize(config: ChatDefinition['chat'], preserve: boolean): void {\n const messages = preserve ? this.chat()?.messages : config.initialMessages\n this.activeChat = config; this.service.init(this.currentSession!.updateChat({ ...config, ...(messages === undefined ? {} : { initialMessages: messages }) }))\n }\n readonly styleText = (): string | null => this.theme === undefined ? null : Object.entries(toChatCssVariables(this.theme)).map(([key, value]) => `${key}:${value}`).join(';')\n readonly dangerColor = (): string => resolveChatTheme(this.theme).colors.danger\n readonly targets = () => getLifecycleTargets(this.chat()?.messages ?? [])\n readonly toolCalls = (): ToolCall[] => (this.chat()?.messages ?? []).flatMap(message => message.toolCalls ?? [])\n presentations(message: ChatMessage): readonly MessagePresentation[] {\n return presentChatMessage(message).map(presentation => {\n if (presentation.kind === 'message') return { kind: 'message', message: presentation.message }\n if (presentation.kind === 'diagnostic') return { kind: 'diagnostic', message, diagnosticCode: presentation.code, diagnosticMessage: presentation.message }\n const resolved = this.definition.components === undefined ? undefined : resolveComponentFrame(presentation.frame, this.definition.components)\n return resolved?.ok\n ? { kind: presentation.frame.componentKey === 'choice-list' ? 'choice' : 'standard', message, frame: presentation.frame }\n : { kind: 'fallback', message, fallback: formatSemanticFallback(presentation.frame.fallback) }\n })\n }\n readonly selectFor = (frame: ComponentRenderFrame) => (event: ComponentSelectionEvent): void => this.selectComponent(event, frame)\n readonly interact = (event: ComponentInteractionEvent): void => { if (this.resolvedInstances().has(event.instanceId)) return; this.resolvedInstances.update(current => new Set(current).add(event.instanceId)); try { this.onComponentInteract?.(event) } catch (error) { this.resolvedInstances.update(current => { const next = new Set(current); next.delete(event.instanceId); return next }); this.fail(error, 'Component interaction callback failed.') } }\n private selectComponent(event: ComponentSelectionEvent, frame: ComponentRenderFrame): void {\n if (this.resolvedInstances().has(event.instanceId)) return\n this.error.set(null); this.resolvedInstances.update(current => new Set(current).add(event.instanceId))\n try { this.onComponentSelect?.(event) } catch (error) { this.fail(error, 'Component selection callback failed.') }\n const action = resolveChoiceAction(frame, event.choiceId)\n if (action) void this.confirmation!.propose(action).catch(error => { this.resolvedInstances.update(current => { const next = new Set(current); next.delete(event.instanceId); return next }); this.fail(error, 'Action proposal failed.') })\n else {\n let submission\n try { submission = this.definition.choiceSubmission?.(frame, event.choiceId, { sessionId: this.currentSession!.sessionId }) } catch (error) {\n this.resolvedInstances.update(current => { const next = new Set(current); next.delete(event.instanceId); return next })\n this.fail(error, 'Choice submission authorization failed.')\n return\n }\n if (submission && 'unavailable' in submission) {\n this.resolvedInstances.update(current => { const next = new Set(current); next.delete(event.instanceId); return next })\n this.fail(new Error('This deterministic choice expired. Ask the question again.'), 'Choice unavailable.')\n return\n }\n if (submission) void this.chat()!.send(submission.value).then(\n () => { try { submission.commit() } catch (error) { this.fail(error, 'Choice submission settlement failed.') } },\n error => {\n try { submission.release() } catch { /* settlement isolation */ }\n finally { this.resolvedInstances.update(current => { const next = new Set(current); next.delete(event.instanceId); return next }) }\n this.fail(error, 'Choice submission failed.')\n },\n )\n }\n }\n readonly approve = (id: string): void => { const record = this.confirmation?.getByToolCall(id); void (record ? this.confirmation!.approve(record.token, this.currentSession!.sessionId) : this.chat()!.approve(id)).catch(error => this.fail(error, 'Action approval failed.')) }\n readonly deny = (id: string, reason?: string): void => { const record = this.confirmation?.getByToolCall(id); void (record ? this.confirmation!.reject(record.token, this.currentSession!.sessionId, reason) : this.chat()!.deny(id, reason)).catch(error => this.fail(error, 'Action rejection failed.')) }\n run(operation: Promise<void>): void { this.error.set(null); void operation.catch(error => this.fail(error, 'Lifecycle operation failed.')) }\n beginEdit(): void { const id = this.targets().userId; if (id) this.editDraft.set({ messageId: id, content: this.chat()!.messages.find(message => message.id === id)?.content ?? '' }) }\n updateEdit(content: string): void { const draft = this.editDraft(); if (draft) this.editDraft.set({ ...draft, content }) }\n updateEditEvent(event: Event): void { if (event.target instanceof HTMLInputElement) this.updateEdit(event.target.value) }\n saveEdit(event: Event): void { event.preventDefault(); const draft = this.editDraft(); if (!draft?.content.trim()) return; this.run(this.chat()!.edit(draft.messageId, draft.content)); this.editDraft.set(undefined) }\n inputContext(): Record<string, unknown> { const chat = this.chat(); return { $implicit: chat, chat, disabled: chat?.status === 'streaming', placeholder: this.placeholder } }\n confirmationContext(toolCall: ToolCall): Record<string, unknown> { return { $implicit: toolCall, toolCall, approve: this.approve, deny: this.deny } }\n choiceContext(frame: ComponentRenderFrame): Record<string, unknown> { const props = { frame, manifest: this.definition.components!, disabled: this.resolvedInstances().has(frame.instanceId), onSelect: this.selectFor(frame) }; return { $implicit: props, ...props } }\n standardContext(frame: ComponentRenderFrame): Record<string, unknown> { const props = { frame, manifest: this.definition.components!, disabled: this.resolvedInstances().has(frame.instanceId), onInteract: this.interact }; return { $implicit: props, ...props } }\n private fail(error: unknown, fallback: string): void { this.error.set(error instanceof Error ? error : new Error(fallback)) }\n}\n\nexport type { ChatDef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,yBAAyB,EAAE,mBAAmB,EAAE,0BAA0B,CAAC;oBAChM,SAAS,EAAE,CAAC,aAAa,CAAC;AAC1B,oBAAA,QAAQ,EAAE,CAAA;;;;;;;;;;;;;;;;;;;;;;;AAuBC,YAAA,CAAA;AACZ,iBAAA;;sBAEE,KAAK;uBAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;;sBACxB;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA,YAAY;AAAC,gBAAA,IAAA,EAAA,CAAA,WAAW,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE;;sBAC/C,YAAY;AAAC,gBAAA,IAAA,EAAA,CAAA,SAAS,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE;;sBAC7C,YAAY;AAAC,gBAAA,IAAA,EAAA,CAAA,OAAO,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE;;sBAC3C,YAAY;AAAC,gBAAA,IAAA,EAAA,CAAA,UAAU,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE;;sBAC9C,YAAY;AAAC,gBAAA,IAAA,EAAA,CAAA,cAAc,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE;;sBAClD,YAAY;AAAC,gBAAA,IAAA,EAAA,CAAA,YAAY,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE;;sBAChD,YAAY;AAAC,gBAAA,IAAA,EAAA,CAAA,mBAAmB,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE;;;AC/F1D;;AAEG;;;;"}
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { OnChanges, OnDestroy, TemplateRef, SimpleChanges } from '@angular/core';
|
|
3
|
+
import * as zod from 'zod';
|
|
4
|
+
import { ComponentManifest, ChatDefinition, ChatSession, ChatThemeInput } from '@agentskit/chat';
|
|
5
|
+
export { ChatDefinition } from '@agentskit/chat';
|
|
6
|
+
import { ComponentRenderFrame, ComponentInteractionEvent, ComponentSelectionEvent } from '@agentskit/chat-protocol';
|
|
7
|
+
import { ChatReturn, ToolCall, Message } from '@agentskit/core';
|
|
8
|
+
|
|
9
|
+
declare class StandardComponentComponent implements OnChanges {
|
|
10
|
+
frame: ComponentRenderFrame;
|
|
11
|
+
manifest: ComponentManifest;
|
|
12
|
+
onInteract: (event: ComponentInteractionEvent) => void;
|
|
13
|
+
disabled: boolean;
|
|
14
|
+
valid: boolean;
|
|
15
|
+
private values;
|
|
16
|
+
ngOnChanges(): void;
|
|
17
|
+
buttonGroup: () => Readonly<{
|
|
18
|
+
label: string;
|
|
19
|
+
buttons: Readonly<{
|
|
20
|
+
id: string;
|
|
21
|
+
label: string;
|
|
22
|
+
disabled?: boolean | undefined;
|
|
23
|
+
variant?: "danger" | "primary" | "secondary" | undefined;
|
|
24
|
+
}>[];
|
|
25
|
+
}> | undefined;
|
|
26
|
+
form: () => Readonly<{
|
|
27
|
+
fields: Readonly<{
|
|
28
|
+
id: string;
|
|
29
|
+
label: string;
|
|
30
|
+
type: "number" | "checkbox" | "select" | "text" | "email";
|
|
31
|
+
required?: boolean | undefined;
|
|
32
|
+
placeholder?: string | undefined;
|
|
33
|
+
options?: Readonly<{
|
|
34
|
+
id: string;
|
|
35
|
+
label: string;
|
|
36
|
+
}>[] | undefined;
|
|
37
|
+
}>[];
|
|
38
|
+
submitLabel: string;
|
|
39
|
+
title?: string | undefined;
|
|
40
|
+
}> | undefined;
|
|
41
|
+
confirmation: () => Readonly<{
|
|
42
|
+
title: string;
|
|
43
|
+
message: string;
|
|
44
|
+
confirmLabel: string;
|
|
45
|
+
cancelLabel: string;
|
|
46
|
+
}> | undefined;
|
|
47
|
+
progress: () => Readonly<{
|
|
48
|
+
label: string;
|
|
49
|
+
value: number;
|
|
50
|
+
status?: string | undefined;
|
|
51
|
+
}> | undefined;
|
|
52
|
+
sourceList: () => Readonly<{
|
|
53
|
+
label: string;
|
|
54
|
+
sources: Readonly<{
|
|
55
|
+
id: string;
|
|
56
|
+
title: string;
|
|
57
|
+
url?: string | undefined;
|
|
58
|
+
snippet?: string | undefined;
|
|
59
|
+
}>[];
|
|
60
|
+
}> | undefined;
|
|
61
|
+
linkCard: () => Readonly<{
|
|
62
|
+
title: string;
|
|
63
|
+
href: string;
|
|
64
|
+
description?: string | undefined;
|
|
65
|
+
label?: string | undefined;
|
|
66
|
+
}> | undefined;
|
|
67
|
+
errorNotice: () => Readonly<{
|
|
68
|
+
title: string;
|
|
69
|
+
message: string;
|
|
70
|
+
code?: string | undefined;
|
|
71
|
+
retryLabel?: string | undefined;
|
|
72
|
+
}> | undefined;
|
|
73
|
+
toolCall: () => Readonly<{
|
|
74
|
+
name: string;
|
|
75
|
+
status: "error" | "pending" | "running" | "complete";
|
|
76
|
+
arguments?: Record<string, zod.JSONType> | undefined;
|
|
77
|
+
result?: zod.JSONType | undefined;
|
|
78
|
+
}> | undefined;
|
|
79
|
+
approval: () => Readonly<{
|
|
80
|
+
title: string;
|
|
81
|
+
description: string;
|
|
82
|
+
approveLabel: string;
|
|
83
|
+
denyLabel: string;
|
|
84
|
+
}> | undefined;
|
|
85
|
+
table: () => Readonly<{
|
|
86
|
+
caption: string;
|
|
87
|
+
columns: Readonly<{
|
|
88
|
+
key: string;
|
|
89
|
+
label: string;
|
|
90
|
+
}>[];
|
|
91
|
+
rows: Record<string, string | number | boolean | null>[];
|
|
92
|
+
}> | undefined;
|
|
93
|
+
file: () => Readonly<{
|
|
94
|
+
name: string;
|
|
95
|
+
mimeType: string;
|
|
96
|
+
sizeBytes?: number | undefined;
|
|
97
|
+
url?: string | undefined;
|
|
98
|
+
}> | undefined;
|
|
99
|
+
fallback: () => string;
|
|
100
|
+
emit(event: string, value?: unknown): void;
|
|
101
|
+
link(event: Event, name: string, value: string): void;
|
|
102
|
+
submit(event: Event): void;
|
|
103
|
+
setSelect(id: string, event: Event): void;
|
|
104
|
+
setInput(id: string, type: string, event: Event): void;
|
|
105
|
+
json(value: unknown): string;
|
|
106
|
+
cell(value: unknown): string;
|
|
107
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<StandardComponentComponent, never>;
|
|
108
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<StandardComponentComponent, "ak-standard-component", never, { "frame": { "alias": "frame"; "required": true; }; "manifest": { "alias": "manifest"; "required": true; }; "onInteract": { "alias": "onInteract"; "required": true; }; "disabled": { "alias": "disabled"; "required": false; }; }, {}, never, never, true, never>;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
type ChatCssVariables = Readonly<Record<`--ak-${string}`, string | number>>;
|
|
112
|
+
declare const toChatCssVariables: (input?: ChatThemeInput) => ChatCssVariables;
|
|
113
|
+
declare class ChoiceListComponent implements OnChanges {
|
|
114
|
+
frame: unknown;
|
|
115
|
+
manifest: ComponentManifest;
|
|
116
|
+
onSelect: (event: ComponentSelectionEvent) => void;
|
|
117
|
+
disabled: boolean;
|
|
118
|
+
readonly resolved: _angular_core.WritableSignal<{
|
|
119
|
+
readonly ok: true;
|
|
120
|
+
readonly frame: ComponentRenderFrame;
|
|
121
|
+
readonly props: Readonly<{
|
|
122
|
+
prompt: string;
|
|
123
|
+
choices: Readonly<{
|
|
124
|
+
id: string;
|
|
125
|
+
label: string;
|
|
126
|
+
description?: string | undefined;
|
|
127
|
+
action?: Readonly<{
|
|
128
|
+
name: string;
|
|
129
|
+
input: Record<string, zod.JSONType>;
|
|
130
|
+
}> | undefined;
|
|
131
|
+
}>[];
|
|
132
|
+
}>;
|
|
133
|
+
} | undefined>;
|
|
134
|
+
ngOnChanges(): void;
|
|
135
|
+
choose(choiceId: string): void;
|
|
136
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ChoiceListComponent, never>;
|
|
137
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ChoiceListComponent, "ak-choice-list", never, { "frame": { "alias": "frame"; "required": true; }; "manifest": { "alias": "manifest"; "required": true; }; "onSelect": { "alias": "onSelect"; "required": true; }; "disabled": { "alias": "disabled"; "required": false; }; }, {}, never, never, true, never>;
|
|
138
|
+
}
|
|
139
|
+
interface MessagePresentation {
|
|
140
|
+
readonly kind: 'message' | 'choice' | 'standard' | 'fallback' | 'diagnostic';
|
|
141
|
+
readonly message: Message;
|
|
142
|
+
readonly frame?: ComponentRenderFrame;
|
|
143
|
+
readonly fallback?: string;
|
|
144
|
+
readonly diagnosticCode?: string;
|
|
145
|
+
readonly diagnosticMessage?: string;
|
|
146
|
+
}
|
|
147
|
+
declare class AgentChatComponent implements OnChanges, OnDestroy {
|
|
148
|
+
definition: ChatDefinition;
|
|
149
|
+
placeholder?: string;
|
|
150
|
+
onComponentSelect?: (event: ComponentSelectionEvent) => void;
|
|
151
|
+
onComponentInteract?: (event: ComponentInteractionEvent) => void;
|
|
152
|
+
actionConfirmationTtlMs?: number;
|
|
153
|
+
session?: ChatSession;
|
|
154
|
+
theme?: ChatThemeInput;
|
|
155
|
+
containerTemplate?: TemplateRef<unknown>;
|
|
156
|
+
messageTemplate?: TemplateRef<unknown>;
|
|
157
|
+
inputTemplate?: TemplateRef<unknown>;
|
|
158
|
+
thinkingTemplate?: TemplateRef<unknown>;
|
|
159
|
+
confirmationTemplate?: TemplateRef<unknown>;
|
|
160
|
+
choiceListTemplate?: TemplateRef<unknown>;
|
|
161
|
+
standardComponentTemplate?: TemplateRef<unknown>;
|
|
162
|
+
private readonly service;
|
|
163
|
+
readonly chat: _angular_core.Signal<ChatReturn | null>;
|
|
164
|
+
readonly error: _angular_core.WritableSignal<Error | null>;
|
|
165
|
+
readonly displayError: _angular_core.Signal<Error | null>;
|
|
166
|
+
readonly editDraft: _angular_core.WritableSignal<{
|
|
167
|
+
readonly messageId: string;
|
|
168
|
+
readonly content: string;
|
|
169
|
+
} | undefined>;
|
|
170
|
+
readonly resolvedInstances: _angular_core.WritableSignal<Set<string>>;
|
|
171
|
+
private activeChat?;
|
|
172
|
+
private initialized;
|
|
173
|
+
private definitionId?;
|
|
174
|
+
private definitionRevision?;
|
|
175
|
+
private preparedSession;
|
|
176
|
+
private currentSession?;
|
|
177
|
+
private confirmation?;
|
|
178
|
+
ngOnChanges(_changes: SimpleChanges): void;
|
|
179
|
+
ngOnDestroy(): void;
|
|
180
|
+
private initialize;
|
|
181
|
+
readonly styleText: () => string | null;
|
|
182
|
+
readonly dangerColor: () => string;
|
|
183
|
+
readonly targets: () => {
|
|
184
|
+
readonly userId: string | undefined;
|
|
185
|
+
readonly assistantId: string | undefined;
|
|
186
|
+
};
|
|
187
|
+
readonly toolCalls: () => ToolCall[];
|
|
188
|
+
presentations(message: Message): readonly MessagePresentation[];
|
|
189
|
+
readonly selectFor: (frame: ComponentRenderFrame) => (event: ComponentSelectionEvent) => void;
|
|
190
|
+
readonly interact: (event: ComponentInteractionEvent) => void;
|
|
191
|
+
private selectComponent;
|
|
192
|
+
readonly approve: (id: string) => void;
|
|
193
|
+
readonly deny: (id: string, reason?: string) => void;
|
|
194
|
+
run(operation: Promise<void>): void;
|
|
195
|
+
beginEdit(): void;
|
|
196
|
+
updateEdit(content: string): void;
|
|
197
|
+
updateEditEvent(event: Event): void;
|
|
198
|
+
saveEdit(event: Event): void;
|
|
199
|
+
inputContext(): Record<string, unknown>;
|
|
200
|
+
confirmationContext(toolCall: ToolCall): Record<string, unknown>;
|
|
201
|
+
choiceContext(frame: ComponentRenderFrame): Record<string, unknown>;
|
|
202
|
+
standardContext(frame: ComponentRenderFrame): Record<string, unknown>;
|
|
203
|
+
private fail;
|
|
204
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AgentChatComponent, never>;
|
|
205
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<AgentChatComponent, "ak-agent-chat", never, { "definition": { "alias": "definition"; "required": true; }; "placeholder": { "alias": "placeholder"; "required": false; }; "onComponentSelect": { "alias": "onComponentSelect"; "required": false; }; "onComponentInteract": { "alias": "onComponentInteract"; "required": false; }; "actionConfirmationTtlMs": { "alias": "actionConfirmationTtlMs"; "required": false; }; "session": { "alias": "session"; "required": false; }; "theme": { "alias": "theme"; "required": false; }; }, {}, ["containerTemplate", "messageTemplate", "inputTemplate", "thinkingTemplate", "confirmationTemplate", "choiceListTemplate", "standardComponentTemplate"], never, true, never>;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
export { AgentChatComponent, ChoiceListComponent, StandardComponentComponent, toChatCssVariables };
|
|
209
|
+
export type { ChatCssVariables };
|
|
210
|
+
//# sourceMappingURL=agentskit-chat-angular.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agentskit-chat-angular.d.ts","sources":["../../src/standard-component.ts","../../src/index.ts"],"mappings":";;;;;;;;AAIA,cAiBa,0BAA2B,YAAW,SAAS;WACvB,oBAAoB;cACjB,iBAAiB;AAC5B,wBAAqB,yBAAyB;AAChE;AACT;;AAEA;uBACW,QAAA;;;;;;;;AAAgE;gBACvE,QAAA;;;;;;;;;;;;;;AAAyD;wBACjD,QAAA;;;;;AAAiE;oBACrE,QAAA;;;;AAA6D;sBAC3D,QAAA;;;;;;;;AAA+D;oBACjE,QAAA;;;;;AAA6D;uBAC1D,QAAA;;;;;AAAgE;oBACnE,QAAA;;;;;AAA6D;oBAC7D,QAAA;;;;;AAAoE;iBACvE,QAAA;;;;;;;AAA0D;gBAC3D,QAAA;;;;;AAAmE;;;AAGvE,gBAAY,KAAK;AACjB,kBAAc,KAAK;iCACU,KAAK;AAClC,8CAA0C,KAAK;AAC/C;AACA;oDA1BW,0BAA0B;sDAA1B,0BAA0B;AA2BtC;;KCrCW,gBAAgB,GAAG,QAAQ,CAAC,MAAM;AAC9C,cAAa,kBAAkB,WAAY,cAAc,KAAG,gBAa3D;AAED,cAMa,mBAAoB,YAAW,SAAS;;cAEb,iBAAiB;AAC5B,sBAAmB,uBAAuB;AAC5D;AACT,uBAAiB,aAAA,CAAA,cAAA;;;;;;;;;;;;;;;AAAkG;AACnH;AACA;oDAPW,mBAAmB;sDAAnB,mBAAmB;AAQ/B;AAED,UAAU,mBAAmB;AAC3B;AACA,sBAAkBA,OAAW;AAC7B,qBAAiB,oBAAoB;AACrC;AACA;AACA;AACD;AAED,cA6Ba,kBAAmB,YAAW,SAAS,EAAE,SAAS;gBACrB,cAAc;;gCAEjB,uBAAuB;kCACrB,yBAAyB;;cAE7C,WAAW;YACb,cAAc;AACmB,wBAAoB,WAAW;AACjC,sBAAkB,WAAW;AAC/B,oBAAgB,WAAW;AACxB,uBAAmB,WAAW;AAC1B,2BAAuB,WAAW;AACpC,yBAAqB,WAAW;AACzB,gCAA4B,WAAW;AAEjG;mBACa,aAAA,CAAA,MAAA,CAAA,UAAA;oBACC,aAAA,CAAA,cAAA,CAAA,KAAA;2BACO,aAAA,CAAA,MAAA,CAAA,KAAA;AACrB,wBAAkB,aAAA,CAAA,cAAA;;;AAA0F;gCAClF,aAAA,CAAA,cAAA,CAAA,GAAA;;;;;;;;AAS1B,0BAAsB,aAAa;AAWnC;AACA;AAIA;AACA;AACA;;;AAAyE;AACzE,8BAAyB,QAAQ;AACjC,2BAAuBA,OAAW,YAAY,mBAAmB;gCAUpC,oBAAoB,aAAa,uBAAuB;AACrF,+BAA4B,yBAAyB;AACrD;AA4BA;;mBAEe,OAAO;AACtB;AACA;AACA,2BAAuB,KAAK;AAC5B,oBAAgB,KAAK;AACrB,oBAAgB,MAAM;kCACQ,QAAQ,GAAG,MAAM;yBAC1B,oBAAoB,GAAG,MAAM;2BAC3B,oBAAoB,GAAG,MAAM;AACpD;oDArGW,kBAAkB;sDAAlB,kBAAkB;AAsG9B;;;;","names":["ChatMessage"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@agentskit/chat-angular",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Angular application shell for AgentsKit Chat.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/AgentsKit-io/agentskit-chat.git",
|
|
9
|
+
"directory": "packages/angular"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/AgentsKit-io/agentskit-chat#readme",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/AgentsKit-io/agentskit-chat/issues"
|
|
14
|
+
},
|
|
15
|
+
"type": "module",
|
|
16
|
+
"main": "./dist/fesm2022/agentskit-chat-angular.mjs",
|
|
17
|
+
"module": "./dist/fesm2022/agentskit-chat-angular.mjs",
|
|
18
|
+
"types": "./dist/types/agentskit-chat-angular.d.ts",
|
|
19
|
+
"exports": {
|
|
20
|
+
".": {
|
|
21
|
+
"types": "./dist/types/agentskit-chat-angular.d.ts",
|
|
22
|
+
"import": "./dist/fesm2022/agentskit-chat-angular.mjs",
|
|
23
|
+
"default": "./dist/fesm2022/agentskit-chat-angular.mjs"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"dist"
|
|
28
|
+
],
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@agentskit/core": "^1.12.2",
|
|
31
|
+
"tslib": "^2.8.1",
|
|
32
|
+
"@agentskit/chat": "0.1.0",
|
|
33
|
+
"@agentskit/chat-protocol": "0.1.0"
|
|
34
|
+
},
|
|
35
|
+
"peerDependencies": {
|
|
36
|
+
"@agentskit/angular": "^0.4.6",
|
|
37
|
+
"@angular/common": ">=18.1 <22",
|
|
38
|
+
"@angular/core": ">=18.1 <22",
|
|
39
|
+
"rxjs": "^7.0.0"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@agentskit/angular": "^0.4.6",
|
|
43
|
+
"@angular/common": "^21.2.18",
|
|
44
|
+
"@angular/compiler": "^21.2.18",
|
|
45
|
+
"@angular/compiler-cli": "^21.2.18",
|
|
46
|
+
"@angular/core": "^21.2.18",
|
|
47
|
+
"@angular/platform-browser": "^21.2.18",
|
|
48
|
+
"@angular/platform-browser-dynamic": "^21.2.18",
|
|
49
|
+
"@types/node": "^25.0.0",
|
|
50
|
+
"happy-dom": "^20.10.3",
|
|
51
|
+
"ng-packagr": "^21.2.5",
|
|
52
|
+
"rxjs": "^7.8.2",
|
|
53
|
+
"typescript": "^5.9.3",
|
|
54
|
+
"zone.js": "^0.16.2"
|
|
55
|
+
},
|
|
56
|
+
"publishConfig": {
|
|
57
|
+
"access": "public",
|
|
58
|
+
"provenance": true
|
|
59
|
+
},
|
|
60
|
+
"scripts": {
|
|
61
|
+
"build": "ng-packagr -p ng-package.json -c tsconfig.lib.json",
|
|
62
|
+
"lint": "tsc --noEmit",
|
|
63
|
+
"test": "pnpm --filter @agentskit/chat-protocol build && pnpm --filter @agentskit/chat build && pnpm build && vitest run --coverage"
|
|
64
|
+
}
|
|
65
|
+
}
|