@copilotkitnext/angular 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +39 -0
- package/.turbo/turbo-check-types.log +0 -0
- package/.turbo/turbo-test.log +71 -0
- package/LICENSE +10 -0
- package/README-agent-context.md +310 -0
- package/dist/LICENSE +10 -0
- package/dist/components/chat/copilot-chat-assistant-message-buttons.component.d.ts +75 -0
- package/dist/components/chat/copilot-chat-assistant-message-renderer.component.d.ts +31 -0
- package/dist/components/chat/copilot-chat-assistant-message-toolbar.component.d.ts +8 -0
- package/dist/components/chat/copilot-chat-assistant-message.component.d.ts +131 -0
- package/dist/components/chat/copilot-chat-assistant-message.types.d.ts +31 -0
- package/dist/components/chat/copilot-chat-audio-recorder.component.d.ts +40 -0
- package/dist/components/chat/copilot-chat-buttons.component.d.ts +66 -0
- package/dist/components/chat/copilot-chat-input-defaults.d.ts +37 -0
- package/dist/components/chat/copilot-chat-input.component.d.ts +133 -0
- package/dist/components/chat/copilot-chat-input.types.d.ts +129 -0
- package/dist/components/chat/copilot-chat-message-view-cursor.component.d.ts +15 -0
- package/dist/components/chat/copilot-chat-message-view.component.d.ts +293 -0
- package/dist/components/chat/copilot-chat-message-view.types.d.ts +24 -0
- package/dist/components/chat/copilot-chat-textarea.component.d.ts +45 -0
- package/dist/components/chat/copilot-chat-tool-calls-view.component.d.ts +35 -0
- package/dist/components/chat/copilot-chat-toolbar.component.d.ts +8 -0
- package/dist/components/chat/copilot-chat-tools-menu.component.d.ts +20 -0
- package/dist/components/chat/copilot-chat-user-message-branch-navigation.component.d.ts +23 -0
- package/dist/components/chat/copilot-chat-user-message-buttons.component.d.ts +39 -0
- package/dist/components/chat/copilot-chat-user-message-renderer.component.d.ts +9 -0
- package/dist/components/chat/copilot-chat-user-message-toolbar.component.d.ts +8 -0
- package/dist/components/chat/copilot-chat-user-message.component.d.ts +55 -0
- package/dist/components/chat/copilot-chat-user-message.types.d.ts +33 -0
- package/dist/components/chat/copilot-chat-view-disclaimer.component.d.ts +15 -0
- package/dist/components/chat/copilot-chat-view-feather.component.d.ts +15 -0
- package/dist/components/chat/copilot-chat-view-handlers.service.d.ts +11 -0
- package/dist/components/chat/copilot-chat-view-input-container.component.d.ts +23 -0
- package/dist/components/chat/copilot-chat-view-scroll-to-bottom-button.component.d.ts +17 -0
- package/dist/components/chat/copilot-chat-view-scroll-view.component.d.ts +84 -0
- package/dist/components/chat/copilot-chat-view.component.d.ts +205 -0
- package/dist/components/chat/copilot-chat-view.types.d.ts +42 -0
- package/dist/components/chat/copilot-chat.component.d.ts +37 -0
- package/dist/components/copilotkit-tool-render.component.d.ts +25 -0
- package/dist/core/chat-configuration/chat-configuration.providers.d.ts +54 -0
- package/dist/core/chat-configuration/chat-configuration.service.d.ts +75 -0
- package/dist/core/chat-configuration/chat-configuration.types.d.ts +27 -0
- package/dist/core/copilotkit.providers.d.ts +13 -0
- package/dist/core/copilotkit.service.d.ts +119 -0
- package/dist/core/copilotkit.types.d.ts +83 -0
- package/dist/directives/copilotkit-agent-context.directive.d.ts +68 -0
- package/dist/directives/copilotkit-agent.directive.d.ts +106 -0
- package/dist/directives/copilotkit-chat-config.directive.d.ts +84 -0
- package/dist/directives/copilotkit-config.directive.d.ts +44 -0
- package/dist/directives/copilotkit-frontend-tool.directive.d.ts +25 -0
- package/dist/directives/copilotkit-human-in-the-loop.directive.d.ts +124 -0
- package/dist/directives/stick-to-bottom.directive.d.ts +62 -0
- package/dist/fesm2022/copilotkitnext-angular.mjs +9314 -0
- package/dist/fesm2022/copilotkitnext-angular.mjs.map +1 -0
- package/dist/index.d.ts +55 -0
- package/dist/lib/directives/tooltip.directive.d.ts +33 -0
- package/dist/lib/slots/copilot-slot.component.d.ts +34 -0
- package/dist/lib/slots/slot.types.d.ts +55 -0
- package/dist/lib/slots/slot.utils.d.ts +108 -0
- package/dist/lib/utils.d.ts +6 -0
- package/dist/services/resize-observer.service.d.ts +44 -0
- package/dist/services/scroll-position.service.d.ts +50 -0
- package/dist/styles.css +1963 -0
- package/dist/types/frontend-tool.d.ts +37 -0
- package/dist/types/human-in-the-loop.d.ts +44 -0
- package/dist/utils/agent-context.utils.d.ts +75 -0
- package/dist/utils/agent.utils.d.ts +99 -0
- package/dist/utils/chat-config.utils.d.ts +166 -0
- package/dist/utils/copilotkit.utils.d.ts +16 -0
- package/dist/utils/frontend-tool.utils.d.ts +119 -0
- package/dist/utils/human-in-the-loop.utils.d.ts +92 -0
- package/eslint.config.mjs +20 -0
- package/ng-package.json +19 -0
- package/package.json +96 -0
- package/slots.md +331 -0
- package/src/components/chat/__tests__/copilot-chat-assistant-message.component.spec.ts +282 -0
- package/src/components/chat/__tests__/copilot-chat-input.component.spec.ts +419 -0
- package/src/components/chat/__tests__/copilot-chat-message-view.component.spec.ts +372 -0
- package/src/components/chat/__tests__/copilot-chat-user-message.component.spec.ts +249 -0
- package/src/components/chat/copilot-chat-assistant-message-buttons.component.ts +292 -0
- package/src/components/chat/copilot-chat-assistant-message-renderer.component.ts +472 -0
- package/src/components/chat/copilot-chat-assistant-message-toolbar.component.ts +29 -0
- package/src/components/chat/copilot-chat-assistant-message.component.ts +463 -0
- package/src/components/chat/copilot-chat-assistant-message.types.ts +50 -0
- package/src/components/chat/copilot-chat-audio-recorder.component.ts +241 -0
- package/src/components/chat/copilot-chat-buttons.component.ts +308 -0
- package/src/components/chat/copilot-chat-buttons.component.ts.bak +471 -0
- package/src/components/chat/copilot-chat-input-defaults.ts +47 -0
- package/src/components/chat/copilot-chat-input.component.ts +512 -0
- package/src/components/chat/copilot-chat-input.types.ts +148 -0
- package/src/components/chat/copilot-chat-message-view-cursor.component.ts +51 -0
- package/src/components/chat/copilot-chat-message-view.component.ts +233 -0
- package/src/components/chat/copilot-chat-message-view.types.ts +39 -0
- package/src/components/chat/copilot-chat-textarea.component.ts +220 -0
- package/src/components/chat/copilot-chat-tool-calls-view.component.ts +261 -0
- package/src/components/chat/copilot-chat-toolbar.component.ts +35 -0
- package/src/components/chat/copilot-chat-tools-menu.component.ts +185 -0
- package/src/components/chat/copilot-chat-user-message-branch-navigation.component.ts +121 -0
- package/src/components/chat/copilot-chat-user-message-buttons.component.ts +170 -0
- package/src/components/chat/copilot-chat-user-message-renderer.component.ts +37 -0
- package/src/components/chat/copilot-chat-user-message-toolbar.component.ts +37 -0
- package/src/components/chat/copilot-chat-user-message.component.ts +247 -0
- package/src/components/chat/copilot-chat-user-message.types.ts +42 -0
- package/src/components/chat/copilot-chat-view-disclaimer.component.ts +51 -0
- package/src/components/chat/copilot-chat-view-feather.component.ts +47 -0
- package/src/components/chat/copilot-chat-view-handlers.service.ts +14 -0
- package/src/components/chat/copilot-chat-view-input-container.component.ts +87 -0
- package/src/components/chat/copilot-chat-view-scroll-to-bottom-button.component.ts +79 -0
- package/src/components/chat/copilot-chat-view-scroll-view.component.ts +322 -0
- package/src/components/chat/copilot-chat-view.component.ts +420 -0
- package/src/components/chat/copilot-chat-view.types.ts +52 -0
- package/src/components/chat/copilot-chat.component.ts +232 -0
- package/src/components/copilotkit-tool-render.component.ts +169 -0
- package/src/core/__tests__/copilotkit.service.spec.ts +1051 -0
- package/src/core/__tests__/copilotkit.service.wildcard.spec.ts +316 -0
- package/src/core/chat-configuration/__tests__/chat-configuration.service.spec.ts +287 -0
- package/src/core/chat-configuration/chat-configuration.providers.ts +71 -0
- package/src/core/chat-configuration/chat-configuration.service.ts +162 -0
- package/src/core/chat-configuration/chat-configuration.types.ts +57 -0
- package/src/core/copilotkit.providers.ts +59 -0
- package/src/core/copilotkit.service.ts +542 -0
- package/src/core/copilotkit.types.ts +132 -0
- package/src/directives/__tests__/copilotkit-agent-context.directive.spec.ts +384 -0
- package/src/directives/__tests__/copilotkit-agent.directive.spec.ts +253 -0
- package/src/directives/__tests__/copilotkit-chat-config.directive.spec.ts +385 -0
- package/src/directives/__tests__/copilotkit-config.directive.spec.ts +69 -0
- package/src/directives/__tests__/copilotkit-frontend-tool-simple.directive.spec.ts +60 -0
- package/src/directives/__tests__/copilotkit-frontend-tool.directive.spec.ts +108 -0
- package/src/directives/__tests__/copilotkit-human-in-the-loop.directive.spec.ts +452 -0
- package/src/directives/copilotkit-agent-context.directive.ts +138 -0
- package/src/directives/copilotkit-agent.directive.ts +225 -0
- package/src/directives/copilotkit-chat-config.directive.ts +241 -0
- package/src/directives/copilotkit-config.directive.ts +81 -0
- package/src/directives/copilotkit-frontend-tool.directive.ts +145 -0
- package/src/directives/copilotkit-human-in-the-loop.directive.ts +281 -0
- package/src/directives/stick-to-bottom.directive.ts +204 -0
- package/src/index.ts +105 -0
- package/src/lib/directives/tooltip.directive.ts +292 -0
- package/src/lib/slots/__tests__/slot.utils.spec.ts +377 -0
- package/src/lib/slots/copilot-slot.component.ts +135 -0
- package/src/lib/slots/index.ts +3 -0
- package/src/lib/slots/slot.types.ts +64 -0
- package/src/lib/slots/slot.utils.ts +289 -0
- package/src/lib/utils.ts +10 -0
- package/src/public-api.ts +1 -0
- package/src/services/resize-observer.service.ts +181 -0
- package/src/services/scroll-position.service.ts +169 -0
- package/src/styles/globals.css +266 -0
- package/src/styles/index.css +3 -0
- package/src/test-setup.ts +15 -0
- package/src/testing/index.ts +3 -0
- package/src/testing/testing.utils.ts +248 -0
- package/src/types/frontend-tool.ts +44 -0
- package/src/types/human-in-the-loop.ts +52 -0
- package/src/utils/__tests__/agent.utils.spec.ts +234 -0
- package/src/utils/__tests__/chat-config.utils.spec.ts +306 -0
- package/src/utils/__tests__/frontend-tool-inject.spec.ts +350 -0
- package/src/utils/__tests__/frontend-tool-integration.spec.ts +199 -0
- package/src/utils/__tests__/frontend-tool.utils.spec.ts +272 -0
- package/src/utils/__tests__/human-in-the-loop.utils.spec.ts +365 -0
- package/src/utils/agent-context.utils.ts +133 -0
- package/src/utils/agent.utils.ts +239 -0
- package/src/utils/chat-config.utils.ts +221 -0
- package/src/utils/copilotkit.utils.ts +20 -0
- package/src/utils/frontend-tool.utils.ts +266 -0
- package/src/utils/human-in-the-loop.utils.ts +359 -0
- package/tsconfig.json +33 -0
- package/tsconfig.spec.json +12 -0
- package/vitest.config.mts +34 -0
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { EventEmitter, TemplateRef, Type } from '@angular/core';
|
|
2
|
+
import { CopilotChatToolCallsViewComponent } from './copilot-chat-tool-calls-view.component';
|
|
3
|
+
import type { Message } from '@ag-ui/core';
|
|
4
|
+
import { type AssistantMessage, type CopilotChatAssistantMessageOnThumbsUpProps, type CopilotChatAssistantMessageOnThumbsDownProps, type CopilotChatAssistantMessageOnReadAloudProps, type CopilotChatAssistantMessageOnRegenerateProps, type AssistantMessageMarkdownRendererContext, type AssistantMessageCopyButtonContext, type ThumbsUpButtonContext, type ThumbsDownButtonContext, type ReadAloudButtonContext, type RegenerateButtonContext, type AssistantMessageToolbarContext } from './copilot-chat-assistant-message.types';
|
|
5
|
+
import { CopilotChatAssistantMessageRendererComponent } from './copilot-chat-assistant-message-renderer.component';
|
|
6
|
+
import { CopilotChatAssistantMessageCopyButtonComponent, CopilotChatAssistantMessageThumbsUpButtonComponent, CopilotChatAssistantMessageThumbsDownButtonComponent } from './copilot-chat-assistant-message-buttons.component';
|
|
7
|
+
import { CopilotChatAssistantMessageToolbarComponent } from './copilot-chat-assistant-message-toolbar.component';
|
|
8
|
+
import { CopilotChatViewHandlersService } from './copilot-chat-view-handlers.service';
|
|
9
|
+
import * as i0 from "@angular/core";
|
|
10
|
+
export declare class CopilotChatAssistantMessageComponent {
|
|
11
|
+
markdownRendererTemplate?: TemplateRef<AssistantMessageMarkdownRendererContext>;
|
|
12
|
+
toolbarTemplate?: TemplateRef<AssistantMessageToolbarContext>;
|
|
13
|
+
copyButtonTemplate?: TemplateRef<AssistantMessageCopyButtonContext>;
|
|
14
|
+
thumbsUpButtonTemplate?: TemplateRef<ThumbsUpButtonContext>;
|
|
15
|
+
thumbsDownButtonTemplate?: TemplateRef<ThumbsDownButtonContext>;
|
|
16
|
+
readAloudButtonTemplate?: TemplateRef<ReadAloudButtonContext>;
|
|
17
|
+
regenerateButtonTemplate?: TemplateRef<RegenerateButtonContext>;
|
|
18
|
+
toolCallsViewTemplate?: TemplateRef<any>;
|
|
19
|
+
markdownRendererClass?: string;
|
|
20
|
+
toolbarClass?: string;
|
|
21
|
+
copyButtonClass?: string;
|
|
22
|
+
thumbsUpButtonClass?: string;
|
|
23
|
+
thumbsDownButtonClass?: string;
|
|
24
|
+
readAloudButtonClass?: string;
|
|
25
|
+
regenerateButtonClass?: string;
|
|
26
|
+
toolCallsViewClass?: string;
|
|
27
|
+
markdownRendererComponent?: Type<any>;
|
|
28
|
+
toolbarComponent?: Type<any>;
|
|
29
|
+
copyButtonComponent?: Type<any>;
|
|
30
|
+
thumbsUpButtonComponent?: Type<any>;
|
|
31
|
+
thumbsDownButtonComponent?: Type<any>;
|
|
32
|
+
readAloudButtonComponent?: Type<any>;
|
|
33
|
+
regenerateButtonComponent?: Type<any>;
|
|
34
|
+
toolCallsViewComponent?: Type<any>;
|
|
35
|
+
message: AssistantMessage;
|
|
36
|
+
messages: Message[];
|
|
37
|
+
isLoading: boolean;
|
|
38
|
+
additionalToolbarItems?: TemplateRef<any>;
|
|
39
|
+
toolbarVisible: boolean;
|
|
40
|
+
set inputClass(val: string | undefined);
|
|
41
|
+
handlers: CopilotChatViewHandlersService;
|
|
42
|
+
constructor(handlers?: CopilotChatViewHandlersService | null);
|
|
43
|
+
thumbsUp: EventEmitter<CopilotChatAssistantMessageOnThumbsUpProps>;
|
|
44
|
+
thumbsDown: EventEmitter<CopilotChatAssistantMessageOnThumbsDownProps>;
|
|
45
|
+
readAloud: EventEmitter<CopilotChatAssistantMessageOnReadAloudProps>;
|
|
46
|
+
regenerate: EventEmitter<CopilotChatAssistantMessageOnRegenerateProps>;
|
|
47
|
+
customClass: import("@angular/core").WritableSignal<string>;
|
|
48
|
+
computedClass: import("@angular/core").Signal<string>;
|
|
49
|
+
protected readonly defaultThumbsUpButtonComponent: typeof CopilotChatAssistantMessageThumbsUpButtonComponent;
|
|
50
|
+
protected readonly defaultThumbsDownButtonComponent: typeof CopilotChatAssistantMessageThumbsDownButtonComponent;
|
|
51
|
+
protected readonly CopilotChatAssistantMessageRendererComponent: typeof CopilotChatAssistantMessageRendererComponent;
|
|
52
|
+
protected readonly CopilotChatAssistantMessageToolbarComponent: typeof CopilotChatAssistantMessageToolbarComponent;
|
|
53
|
+
protected readonly CopilotChatAssistantMessageCopyButtonComponent: typeof CopilotChatAssistantMessageCopyButtonComponent;
|
|
54
|
+
protected readonly CopilotChatToolCallsViewComponent: typeof CopilotChatToolCallsViewComponent;
|
|
55
|
+
markdownRendererContext: import("@angular/core").Signal<AssistantMessageMarkdownRendererContext>;
|
|
56
|
+
copyButtonOutputs: {
|
|
57
|
+
clicked: () => void;
|
|
58
|
+
};
|
|
59
|
+
thumbsUpButtonOutputs: {
|
|
60
|
+
clicked: () => void;
|
|
61
|
+
};
|
|
62
|
+
thumbsDownButtonOutputs: {
|
|
63
|
+
clicked: () => void;
|
|
64
|
+
};
|
|
65
|
+
readAloudButtonOutputs: {
|
|
66
|
+
clicked: () => void;
|
|
67
|
+
};
|
|
68
|
+
regenerateButtonOutputs: {
|
|
69
|
+
clicked: () => void;
|
|
70
|
+
};
|
|
71
|
+
toolbarContext: import("@angular/core").Signal<AssistantMessageToolbarContext>;
|
|
72
|
+
toolCallsViewContext: import("@angular/core").Signal<{
|
|
73
|
+
message: {
|
|
74
|
+
id: string;
|
|
75
|
+
role: "assistant";
|
|
76
|
+
name?: string | undefined;
|
|
77
|
+
content?: string | undefined;
|
|
78
|
+
toolCalls?: {
|
|
79
|
+
function: {
|
|
80
|
+
name: string;
|
|
81
|
+
arguments: string;
|
|
82
|
+
};
|
|
83
|
+
type: "function";
|
|
84
|
+
id: string;
|
|
85
|
+
}[] | undefined;
|
|
86
|
+
};
|
|
87
|
+
messages: ({
|
|
88
|
+
id: string;
|
|
89
|
+
role: "developer";
|
|
90
|
+
content: string;
|
|
91
|
+
name?: string | undefined;
|
|
92
|
+
} | {
|
|
93
|
+
id: string;
|
|
94
|
+
role: "system";
|
|
95
|
+
content: string;
|
|
96
|
+
name?: string | undefined;
|
|
97
|
+
} | {
|
|
98
|
+
id: string;
|
|
99
|
+
role: "assistant";
|
|
100
|
+
name?: string | undefined;
|
|
101
|
+
content?: string | undefined;
|
|
102
|
+
toolCalls?: {
|
|
103
|
+
function: {
|
|
104
|
+
name: string;
|
|
105
|
+
arguments: string;
|
|
106
|
+
};
|
|
107
|
+
type: "function";
|
|
108
|
+
id: string;
|
|
109
|
+
}[] | undefined;
|
|
110
|
+
} | {
|
|
111
|
+
id: string;
|
|
112
|
+
role: "user";
|
|
113
|
+
content: string;
|
|
114
|
+
name?: string | undefined;
|
|
115
|
+
} | {
|
|
116
|
+
id: string;
|
|
117
|
+
role: "tool";
|
|
118
|
+
content: string;
|
|
119
|
+
toolCallId: string;
|
|
120
|
+
error?: string | undefined;
|
|
121
|
+
})[];
|
|
122
|
+
isLoading: boolean;
|
|
123
|
+
}>;
|
|
124
|
+
handleCopy(): void;
|
|
125
|
+
handleThumbsUp(): void;
|
|
126
|
+
handleThumbsDown(): void;
|
|
127
|
+
handleReadAloud(): void;
|
|
128
|
+
handleRegenerate(): void;
|
|
129
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CopilotChatAssistantMessageComponent, [{ optional: true; }]>;
|
|
130
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CopilotChatAssistantMessageComponent, "copilot-chat-assistant-message", never, { "markdownRendererClass": { "alias": "markdownRendererClass"; "required": false; }; "toolbarClass": { "alias": "toolbarClass"; "required": false; }; "copyButtonClass": { "alias": "copyButtonClass"; "required": false; }; "thumbsUpButtonClass": { "alias": "thumbsUpButtonClass"; "required": false; }; "thumbsDownButtonClass": { "alias": "thumbsDownButtonClass"; "required": false; }; "readAloudButtonClass": { "alias": "readAloudButtonClass"; "required": false; }; "regenerateButtonClass": { "alias": "regenerateButtonClass"; "required": false; }; "toolCallsViewClass": { "alias": "toolCallsViewClass"; "required": false; }; "markdownRendererComponent": { "alias": "markdownRendererComponent"; "required": false; }; "toolbarComponent": { "alias": "toolbarComponent"; "required": false; }; "copyButtonComponent": { "alias": "copyButtonComponent"; "required": false; }; "thumbsUpButtonComponent": { "alias": "thumbsUpButtonComponent"; "required": false; }; "thumbsDownButtonComponent": { "alias": "thumbsDownButtonComponent"; "required": false; }; "readAloudButtonComponent": { "alias": "readAloudButtonComponent"; "required": false; }; "regenerateButtonComponent": { "alias": "regenerateButtonComponent"; "required": false; }; "toolCallsViewComponent": { "alias": "toolCallsViewComponent"; "required": false; }; "message": { "alias": "message"; "required": false; }; "messages": { "alias": "messages"; "required": false; }; "isLoading": { "alias": "isLoading"; "required": false; }; "additionalToolbarItems": { "alias": "additionalToolbarItems"; "required": false; }; "toolbarVisible": { "alias": "toolbarVisible"; "required": false; }; "inputClass": { "alias": "inputClass"; "required": false; }; }, { "thumbsUp": "thumbsUp"; "thumbsDown": "thumbsDown"; "readAloud": "readAloud"; "regenerate": "regenerate"; }, ["markdownRendererTemplate", "toolbarTemplate", "copyButtonTemplate", "thumbsUpButtonTemplate", "thumbsDownButtonTemplate", "readAloudButtonTemplate", "regenerateButtonTemplate", "toolCallsViewTemplate"], never, true, never>;
|
|
131
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { AssistantMessage } from '@ag-ui/client';
|
|
2
|
+
export interface AssistantMessageMarkdownRendererContext {
|
|
3
|
+
content: string;
|
|
4
|
+
}
|
|
5
|
+
export interface AssistantMessageToolbarContext {
|
|
6
|
+
children?: any;
|
|
7
|
+
}
|
|
8
|
+
export interface AssistantMessageCopyButtonContext {
|
|
9
|
+
content?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface ThumbsUpButtonContext {
|
|
12
|
+
}
|
|
13
|
+
export interface ThumbsDownButtonContext {
|
|
14
|
+
}
|
|
15
|
+
export interface ReadAloudButtonContext {
|
|
16
|
+
}
|
|
17
|
+
export interface RegenerateButtonContext {
|
|
18
|
+
}
|
|
19
|
+
export interface CopilotChatAssistantMessageOnThumbsUpProps {
|
|
20
|
+
message: AssistantMessage;
|
|
21
|
+
}
|
|
22
|
+
export interface CopilotChatAssistantMessageOnThumbsDownProps {
|
|
23
|
+
message: AssistantMessage;
|
|
24
|
+
}
|
|
25
|
+
export interface CopilotChatAssistantMessageOnReadAloudProps {
|
|
26
|
+
message: AssistantMessage;
|
|
27
|
+
}
|
|
28
|
+
export interface CopilotChatAssistantMessageOnRegenerateProps {
|
|
29
|
+
message: AssistantMessage;
|
|
30
|
+
}
|
|
31
|
+
export type { AssistantMessage };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { EventEmitter, ElementRef, AfterViewInit, OnDestroy } from '@angular/core';
|
|
2
|
+
import { AudioRecorderState, AudioRecorderError } from './copilot-chat-input.types';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class CopilotChatAudioRecorderComponent implements AfterViewInit, OnDestroy {
|
|
5
|
+
canvasRef: ElementRef<HTMLCanvasElement>;
|
|
6
|
+
set inputClass(val: string | undefined);
|
|
7
|
+
set inputShowControls(val: boolean | undefined);
|
|
8
|
+
stateChange: EventEmitter<AudioRecorderState>;
|
|
9
|
+
error: EventEmitter<AudioRecorderError>;
|
|
10
|
+
state: import("@angular/core").WritableSignal<AudioRecorderState>;
|
|
11
|
+
customClass: import("@angular/core").WritableSignal<string>;
|
|
12
|
+
showControls: import("@angular/core").WritableSignal<boolean>;
|
|
13
|
+
computedClass: import("@angular/core").Signal<string>;
|
|
14
|
+
statusText: import("@angular/core").Signal<"Recording..." | "Processing..." | "Ready">;
|
|
15
|
+
private animationFrameId?;
|
|
16
|
+
ngAfterViewInit(): void;
|
|
17
|
+
ngOnDestroy(): void;
|
|
18
|
+
/**
|
|
19
|
+
* Start recording audio
|
|
20
|
+
*/
|
|
21
|
+
start(): Promise<void>;
|
|
22
|
+
/**
|
|
23
|
+
* Stop recording audio and return blob
|
|
24
|
+
*/
|
|
25
|
+
stop(): Promise<Blob>;
|
|
26
|
+
/**
|
|
27
|
+
* Get current recorder state
|
|
28
|
+
*/
|
|
29
|
+
getState(): AudioRecorderState;
|
|
30
|
+
/**
|
|
31
|
+
* Dispose of resources
|
|
32
|
+
*/
|
|
33
|
+
dispose(): void;
|
|
34
|
+
private setState;
|
|
35
|
+
private startAnimation;
|
|
36
|
+
private stopAnimation;
|
|
37
|
+
private getLoudness;
|
|
38
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CopilotChatAudioRecorderComponent, never>;
|
|
39
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CopilotChatAudioRecorderComponent, "copilot-chat-audio-recorder", never, { "inputClass": { "alias": "inputClass"; "required": false; }; "inputShowControls": { "alias": "inputShowControls"; "required": false; }; }, { "stateChange": "stateChange"; "error": "error"; }, never, never, true, never>;
|
|
40
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class CopilotChatSendButtonComponent {
|
|
4
|
+
disabled: boolean;
|
|
5
|
+
clicked: EventEmitter<void>;
|
|
6
|
+
readonly ArrowUpIcon: import("lucide-angular").LucideIconData;
|
|
7
|
+
buttonClass: string;
|
|
8
|
+
onClick(): void;
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CopilotChatSendButtonComponent, never>;
|
|
10
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CopilotChatSendButtonComponent, "copilot-chat-send-button", never, { "disabled": { "alias": "disabled"; "required": false; }; }, { "clicked": "clicked"; }, never, never, true, never>;
|
|
11
|
+
}
|
|
12
|
+
export declare class CopilotChatStartTranscribeButtonComponent {
|
|
13
|
+
disabled: boolean;
|
|
14
|
+
clicked: EventEmitter<void>;
|
|
15
|
+
private chatConfig;
|
|
16
|
+
readonly MicIcon: import("lucide-angular").LucideIconData;
|
|
17
|
+
buttonClass: string;
|
|
18
|
+
get label(): string;
|
|
19
|
+
onClick(): void;
|
|
20
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CopilotChatStartTranscribeButtonComponent, never>;
|
|
21
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CopilotChatStartTranscribeButtonComponent, "copilot-chat-start-transcribe-button", never, { "disabled": { "alias": "disabled"; "required": false; }; }, { "clicked": "clicked"; }, never, never, true, never>;
|
|
22
|
+
}
|
|
23
|
+
export declare class CopilotChatCancelTranscribeButtonComponent {
|
|
24
|
+
disabled: boolean;
|
|
25
|
+
clicked: EventEmitter<void>;
|
|
26
|
+
private chatConfig;
|
|
27
|
+
readonly XIcon: import("lucide-angular").LucideIconData;
|
|
28
|
+
buttonClass: string;
|
|
29
|
+
get label(): string;
|
|
30
|
+
onClick(): void;
|
|
31
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CopilotChatCancelTranscribeButtonComponent, never>;
|
|
32
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CopilotChatCancelTranscribeButtonComponent, "copilot-chat-cancel-transcribe-button", never, { "disabled": { "alias": "disabled"; "required": false; }; }, { "clicked": "clicked"; }, never, never, true, never>;
|
|
33
|
+
}
|
|
34
|
+
export declare class CopilotChatFinishTranscribeButtonComponent {
|
|
35
|
+
disabled: boolean;
|
|
36
|
+
clicked: EventEmitter<void>;
|
|
37
|
+
private chatConfig;
|
|
38
|
+
readonly CheckIcon: import("lucide-angular").LucideIconData;
|
|
39
|
+
buttonClass: string;
|
|
40
|
+
get label(): string;
|
|
41
|
+
onClick(): void;
|
|
42
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CopilotChatFinishTranscribeButtonComponent, never>;
|
|
43
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CopilotChatFinishTranscribeButtonComponent, "copilot-chat-finish-transcribe-button", never, { "disabled": { "alias": "disabled"; "required": false; }; }, { "clicked": "clicked"; }, never, never, true, never>;
|
|
44
|
+
}
|
|
45
|
+
export declare class CopilotChatAddFileButtonComponent {
|
|
46
|
+
disabled: boolean;
|
|
47
|
+
clicked: EventEmitter<void>;
|
|
48
|
+
private chatConfig;
|
|
49
|
+
readonly PlusIcon: import("lucide-angular").LucideIconData;
|
|
50
|
+
buttonClass: string;
|
|
51
|
+
get label(): string;
|
|
52
|
+
onClick(): void;
|
|
53
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CopilotChatAddFileButtonComponent, never>;
|
|
54
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CopilotChatAddFileButtonComponent, "copilot-chat-add-file-button", never, { "disabled": { "alias": "disabled"; "required": false; }; }, { "clicked": "clicked"; }, never, never, true, never>;
|
|
55
|
+
}
|
|
56
|
+
export declare class CopilotChatToolbarButtonComponent {
|
|
57
|
+
disabled: import("@angular/core").WritableSignal<boolean>;
|
|
58
|
+
variant: import("@angular/core").WritableSignal<"primary" | "secondary">;
|
|
59
|
+
customClass: import("@angular/core").WritableSignal<string>;
|
|
60
|
+
title: import("@angular/core").WritableSignal<string>;
|
|
61
|
+
clicked: EventEmitter<void>;
|
|
62
|
+
computedClass: import("@angular/core").Signal<string>;
|
|
63
|
+
onClick(): void;
|
|
64
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CopilotChatToolbarButtonComponent, never>;
|
|
65
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CopilotChatToolbarButtonComponent, "copilot-chat-toolbar-button", never, {}, { "clicked": "clicked"; }, never, ["*"], true, never>;
|
|
66
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { CopilotChatTextareaComponent } from "./copilot-chat-textarea.component";
|
|
2
|
+
import { CopilotChatAudioRecorderComponent } from "./copilot-chat-audio-recorder.component";
|
|
3
|
+
import { CopilotChatSendButtonComponent, CopilotChatStartTranscribeButtonComponent, CopilotChatCancelTranscribeButtonComponent, CopilotChatFinishTranscribeButtonComponent, CopilotChatAddFileButtonComponent } from "./copilot-chat-buttons.component";
|
|
4
|
+
import { CopilotChatToolbarComponent } from "./copilot-chat-toolbar.component";
|
|
5
|
+
import { CopilotChatToolsMenuComponent } from "./copilot-chat-tools-menu.component";
|
|
6
|
+
/**
|
|
7
|
+
* Default components used by CopilotChatInput.
|
|
8
|
+
* These can be imported and reused when creating custom slot implementations.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* import { CopilotChatInputDefaults } from '@copilotkitnext/angular';
|
|
13
|
+
*
|
|
14
|
+
* @Component({
|
|
15
|
+
* template: `
|
|
16
|
+
* <copilot-chat-input [sendButtonSlot]="CustomSendButton">
|
|
17
|
+
* </copilot-chat-input>
|
|
18
|
+
* `
|
|
19
|
+
* })
|
|
20
|
+
* export class MyComponent {
|
|
21
|
+
* CustomSendButton = class extends CopilotChatInputDefaults.SendButton {
|
|
22
|
+
* // Custom implementation
|
|
23
|
+
* };
|
|
24
|
+
* }
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare class CopilotChatInputDefaults {
|
|
28
|
+
static readonly TextArea: typeof CopilotChatTextareaComponent;
|
|
29
|
+
static readonly AudioRecorder: typeof CopilotChatAudioRecorderComponent;
|
|
30
|
+
static readonly SendButton: typeof CopilotChatSendButtonComponent;
|
|
31
|
+
static readonly StartTranscribeButton: typeof CopilotChatStartTranscribeButtonComponent;
|
|
32
|
+
static readonly CancelTranscribeButton: typeof CopilotChatCancelTranscribeButtonComponent;
|
|
33
|
+
static readonly FinishTranscribeButton: typeof CopilotChatFinishTranscribeButtonComponent;
|
|
34
|
+
static readonly AddFileButton: typeof CopilotChatAddFileButtonComponent;
|
|
35
|
+
static readonly Toolbar: typeof CopilotChatToolbarComponent;
|
|
36
|
+
static readonly ToolsMenu: typeof CopilotChatToolsMenuComponent;
|
|
37
|
+
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { EventEmitter, TemplateRef, AfterViewInit, OnDestroy, Type } from '@angular/core';
|
|
2
|
+
import { CopilotChatTextareaComponent } from './copilot-chat-textarea.component';
|
|
3
|
+
import { CopilotChatAudioRecorderComponent } from './copilot-chat-audio-recorder.component';
|
|
4
|
+
import { CopilotChatStartTranscribeButtonComponent, CopilotChatCancelTranscribeButtonComponent, CopilotChatFinishTranscribeButtonComponent, CopilotChatAddFileButtonComponent } from './copilot-chat-buttons.component';
|
|
5
|
+
import { CopilotChatToolbarComponent } from './copilot-chat-toolbar.component';
|
|
6
|
+
import { CopilotChatToolsMenuComponent } from './copilot-chat-tools-menu.component';
|
|
7
|
+
import type { CopilotChatInputMode, ToolsMenuItem } from './copilot-chat-input.types';
|
|
8
|
+
import * as i0 from "@angular/core";
|
|
9
|
+
/**
|
|
10
|
+
* Context provided to slot templates
|
|
11
|
+
*/
|
|
12
|
+
export interface SendButtonContext {
|
|
13
|
+
send: () => void;
|
|
14
|
+
disabled: boolean;
|
|
15
|
+
value: string;
|
|
16
|
+
}
|
|
17
|
+
export interface ToolbarContext {
|
|
18
|
+
mode: CopilotChatInputMode;
|
|
19
|
+
value: string;
|
|
20
|
+
}
|
|
21
|
+
export declare class CopilotChatInputComponent implements AfterViewInit, OnDestroy {
|
|
22
|
+
textAreaRef?: CopilotChatTextareaComponent;
|
|
23
|
+
audioRecorderRef?: CopilotChatAudioRecorderComponent;
|
|
24
|
+
sendButtonTemplate?: TemplateRef<SendButtonContext>;
|
|
25
|
+
toolbarTemplate?: TemplateRef<ToolbarContext>;
|
|
26
|
+
textAreaTemplate?: TemplateRef<any>;
|
|
27
|
+
audioRecorderTemplate?: TemplateRef<any>;
|
|
28
|
+
startTranscribeButtonTemplate?: TemplateRef<any>;
|
|
29
|
+
cancelTranscribeButtonTemplate?: TemplateRef<any>;
|
|
30
|
+
finishTranscribeButtonTemplate?: TemplateRef<any>;
|
|
31
|
+
addFileButtonTemplate?: TemplateRef<any>;
|
|
32
|
+
toolsButtonTemplate?: TemplateRef<any>;
|
|
33
|
+
sendButtonClass?: string;
|
|
34
|
+
toolbarClass?: string;
|
|
35
|
+
textAreaClass?: string;
|
|
36
|
+
textAreaMaxRows?: number;
|
|
37
|
+
textAreaPlaceholder?: string;
|
|
38
|
+
audioRecorderClass?: string;
|
|
39
|
+
startTranscribeButtonClass?: string;
|
|
40
|
+
cancelTranscribeButtonClass?: string;
|
|
41
|
+
finishTranscribeButtonClass?: string;
|
|
42
|
+
addFileButtonClass?: string;
|
|
43
|
+
toolsButtonClass?: string;
|
|
44
|
+
sendButtonComponent?: Type<any>;
|
|
45
|
+
toolbarComponent?: Type<any>;
|
|
46
|
+
textAreaComponent?: Type<any>;
|
|
47
|
+
audioRecorderComponent?: Type<any>;
|
|
48
|
+
startTranscribeButtonComponent?: Type<any>;
|
|
49
|
+
cancelTranscribeButtonComponent?: Type<any>;
|
|
50
|
+
finishTranscribeButtonComponent?: Type<any>;
|
|
51
|
+
addFileButtonComponent?: Type<any>;
|
|
52
|
+
toolsButtonComponent?: Type<any>;
|
|
53
|
+
set mode(val: CopilotChatInputMode | undefined);
|
|
54
|
+
set toolsMenu(val: (ToolsMenuItem | '-')[] | undefined);
|
|
55
|
+
set autoFocus(val: boolean | undefined);
|
|
56
|
+
set value(val: string | undefined);
|
|
57
|
+
set inputClass(val: string | undefined);
|
|
58
|
+
additionalToolbarItems?: TemplateRef<any>;
|
|
59
|
+
submitMessage: EventEmitter<string>;
|
|
60
|
+
startTranscribe: EventEmitter<void>;
|
|
61
|
+
cancelTranscribe: EventEmitter<void>;
|
|
62
|
+
finishTranscribe: EventEmitter<void>;
|
|
63
|
+
addFile: EventEmitter<void>;
|
|
64
|
+
valueChange: EventEmitter<string>;
|
|
65
|
+
readonly ArrowUpIcon: import("lucide-angular").LucideIconData;
|
|
66
|
+
readonly defaultButtonClass: string;
|
|
67
|
+
private chatConfig;
|
|
68
|
+
modeSignal: import("@angular/core").WritableSignal<CopilotChatInputMode>;
|
|
69
|
+
toolsMenuSignal: import("@angular/core").WritableSignal<(ToolsMenuItem | "-")[]>;
|
|
70
|
+
autoFocusSignal: import("@angular/core").WritableSignal<boolean>;
|
|
71
|
+
valueSignal: import("@angular/core").WritableSignal<string>;
|
|
72
|
+
customClass: import("@angular/core").WritableSignal<string>;
|
|
73
|
+
defaultAudioRecorder: typeof CopilotChatAudioRecorderComponent;
|
|
74
|
+
defaultSendButton: any;
|
|
75
|
+
CopilotChatToolbarComponent: typeof CopilotChatToolbarComponent;
|
|
76
|
+
CopilotChatAddFileButtonComponent: typeof CopilotChatAddFileButtonComponent;
|
|
77
|
+
CopilotChatToolsMenuComponent: typeof CopilotChatToolsMenuComponent;
|
|
78
|
+
CopilotChatCancelTranscribeButtonComponent: typeof CopilotChatCancelTranscribeButtonComponent;
|
|
79
|
+
CopilotChatFinishTranscribeButtonComponent: typeof CopilotChatFinishTranscribeButtonComponent;
|
|
80
|
+
CopilotChatStartTranscribeButtonComponent: typeof CopilotChatStartTranscribeButtonComponent;
|
|
81
|
+
computedMode: import("@angular/core").Signal<CopilotChatInputMode>;
|
|
82
|
+
computedToolsMenu: import("@angular/core").Signal<(ToolsMenuItem | "-")[]>;
|
|
83
|
+
computedAutoFocus: import("@angular/core").Signal<boolean>;
|
|
84
|
+
computedValue: import("@angular/core").Signal<string>;
|
|
85
|
+
computedClass: import("@angular/core").Signal<string>;
|
|
86
|
+
sendButtonContext: import("@angular/core").Signal<SendButtonContext>;
|
|
87
|
+
toolbarContext: import("@angular/core").Signal<ToolbarContext>;
|
|
88
|
+
textAreaContext: import("@angular/core").Signal<{
|
|
89
|
+
value: string;
|
|
90
|
+
autoFocus: boolean;
|
|
91
|
+
disabled: boolean;
|
|
92
|
+
maxRows: number;
|
|
93
|
+
placeholder: string;
|
|
94
|
+
inputClass: string;
|
|
95
|
+
onKeyDown: (event: KeyboardEvent) => void;
|
|
96
|
+
onChange: (value: string) => void;
|
|
97
|
+
}>;
|
|
98
|
+
audioRecorderContext: import("@angular/core").Signal<{
|
|
99
|
+
inputShowControls: boolean;
|
|
100
|
+
}>;
|
|
101
|
+
toolsContext: import("@angular/core").Signal<{
|
|
102
|
+
inputToolsMenu: (ToolsMenuItem | "-")[];
|
|
103
|
+
inputDisabled: boolean;
|
|
104
|
+
}>;
|
|
105
|
+
constructor();
|
|
106
|
+
addFileButtonOutputs: {
|
|
107
|
+
clicked: () => void;
|
|
108
|
+
};
|
|
109
|
+
cancelTranscribeButtonOutputs: {
|
|
110
|
+
clicked: () => void;
|
|
111
|
+
};
|
|
112
|
+
finishTranscribeButtonOutputs: {
|
|
113
|
+
clicked: () => void;
|
|
114
|
+
};
|
|
115
|
+
startTranscribeButtonOutputs: {
|
|
116
|
+
clicked: () => void;
|
|
117
|
+
};
|
|
118
|
+
sendButtonOutputs: {
|
|
119
|
+
clicked: () => void;
|
|
120
|
+
click: () => void;
|
|
121
|
+
};
|
|
122
|
+
ngAfterViewInit(): void;
|
|
123
|
+
ngOnDestroy(): void;
|
|
124
|
+
handleKeyDown(event: KeyboardEvent): void;
|
|
125
|
+
handleValueChange(value: string): void;
|
|
126
|
+
send(): void;
|
|
127
|
+
handleStartTranscribe(): void;
|
|
128
|
+
handleCancelTranscribe(): void;
|
|
129
|
+
handleFinishTranscribe(): void;
|
|
130
|
+
handleAddFile(): void;
|
|
131
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CopilotChatInputComponent, never>;
|
|
132
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CopilotChatInputComponent, "copilot-chat-input", never, { "sendButtonClass": { "alias": "sendButtonClass"; "required": false; }; "toolbarClass": { "alias": "toolbarClass"; "required": false; }; "textAreaClass": { "alias": "textAreaClass"; "required": false; }; "textAreaMaxRows": { "alias": "textAreaMaxRows"; "required": false; }; "textAreaPlaceholder": { "alias": "textAreaPlaceholder"; "required": false; }; "audioRecorderClass": { "alias": "audioRecorderClass"; "required": false; }; "startTranscribeButtonClass": { "alias": "startTranscribeButtonClass"; "required": false; }; "cancelTranscribeButtonClass": { "alias": "cancelTranscribeButtonClass"; "required": false; }; "finishTranscribeButtonClass": { "alias": "finishTranscribeButtonClass"; "required": false; }; "addFileButtonClass": { "alias": "addFileButtonClass"; "required": false; }; "toolsButtonClass": { "alias": "toolsButtonClass"; "required": false; }; "sendButtonComponent": { "alias": "sendButtonComponent"; "required": false; }; "toolbarComponent": { "alias": "toolbarComponent"; "required": false; }; "textAreaComponent": { "alias": "textAreaComponent"; "required": false; }; "audioRecorderComponent": { "alias": "audioRecorderComponent"; "required": false; }; "startTranscribeButtonComponent": { "alias": "startTranscribeButtonComponent"; "required": false; }; "cancelTranscribeButtonComponent": { "alias": "cancelTranscribeButtonComponent"; "required": false; }; "finishTranscribeButtonComponent": { "alias": "finishTranscribeButtonComponent"; "required": false; }; "addFileButtonComponent": { "alias": "addFileButtonComponent"; "required": false; }; "toolsButtonComponent": { "alias": "toolsButtonComponent"; "required": false; }; "mode": { "alias": "mode"; "required": false; }; "toolsMenu": { "alias": "toolsMenu"; "required": false; }; "autoFocus": { "alias": "autoFocus"; "required": false; }; "value": { "alias": "value"; "required": false; }; "inputClass": { "alias": "inputClass"; "required": false; }; "additionalToolbarItems": { "alias": "additionalToolbarItems"; "required": false; }; }, { "submitMessage": "submitMessage"; "startTranscribe": "startTranscribe"; "cancelTranscribe": "cancelTranscribe"; "finishTranscribe": "finishTranscribe"; "addFile": "addFile"; "valueChange": "valueChange"; }, ["sendButtonTemplate", "toolbarTemplate", "textAreaTemplate", "audioRecorderTemplate", "startTranscribeButtonTemplate", "cancelTranscribeButtonTemplate", "finishTranscribeButtonTemplate", "addFileButtonTemplate", "toolsButtonTemplate"], never, true, never>;
|
|
133
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import type { Type, TemplateRef } from '@angular/core';
|
|
2
|
+
/**
|
|
3
|
+
* Mode of the chat input component
|
|
4
|
+
*/
|
|
5
|
+
export type CopilotChatInputMode = 'input' | 'transcribe' | 'processing';
|
|
6
|
+
/**
|
|
7
|
+
* Represents a menu item in the tools menu
|
|
8
|
+
*/
|
|
9
|
+
export type ToolsMenuItem = {
|
|
10
|
+
label: string;
|
|
11
|
+
} & ({
|
|
12
|
+
action: () => void;
|
|
13
|
+
items?: never;
|
|
14
|
+
} | {
|
|
15
|
+
action?: never;
|
|
16
|
+
items: (ToolsMenuItem | '-')[];
|
|
17
|
+
});
|
|
18
|
+
/**
|
|
19
|
+
* Audio recorder state
|
|
20
|
+
*/
|
|
21
|
+
export type AudioRecorderState = 'idle' | 'recording' | 'processing';
|
|
22
|
+
/**
|
|
23
|
+
* Error class for audio recorder failures
|
|
24
|
+
*/
|
|
25
|
+
export declare class AudioRecorderError extends Error {
|
|
26
|
+
constructor(message: string);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Props for textarea component
|
|
30
|
+
*/
|
|
31
|
+
export interface CopilotChatTextareaProps {
|
|
32
|
+
value?: string;
|
|
33
|
+
placeholder?: string;
|
|
34
|
+
maxRows?: number;
|
|
35
|
+
autoFocus?: boolean;
|
|
36
|
+
disabled?: boolean;
|
|
37
|
+
onChange?: (value: string) => void;
|
|
38
|
+
onKeyDown?: (event: KeyboardEvent) => void;
|
|
39
|
+
inputClass?: string;
|
|
40
|
+
style?: any;
|
|
41
|
+
rows?: number;
|
|
42
|
+
cols?: number;
|
|
43
|
+
readonly?: boolean;
|
|
44
|
+
spellcheck?: boolean;
|
|
45
|
+
wrap?: 'hard' | 'soft' | 'off';
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Props for button components
|
|
49
|
+
*/
|
|
50
|
+
export interface CopilotChatButtonProps {
|
|
51
|
+
disabled?: boolean;
|
|
52
|
+
onClick?: () => void;
|
|
53
|
+
inputClass?: string;
|
|
54
|
+
style?: any;
|
|
55
|
+
type?: 'button' | 'submit' | 'reset';
|
|
56
|
+
ariaLabel?: string;
|
|
57
|
+
ariaPressed?: boolean;
|
|
58
|
+
ariaExpanded?: boolean;
|
|
59
|
+
title?: string;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Props for toolbar button with tooltip
|
|
63
|
+
*/
|
|
64
|
+
export interface CopilotChatToolbarButtonProps extends CopilotChatButtonProps {
|
|
65
|
+
icon?: TemplateRef<any>;
|
|
66
|
+
tooltip?: string;
|
|
67
|
+
variant?: 'primary' | 'secondary';
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Props for tools menu button
|
|
71
|
+
*/
|
|
72
|
+
export interface CopilotChatToolsButtonProps extends CopilotChatButtonProps {
|
|
73
|
+
toolsMenu?: (ToolsMenuItem | '-')[];
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Props for audio recorder
|
|
77
|
+
*/
|
|
78
|
+
export interface CopilotChatAudioRecorderProps {
|
|
79
|
+
inputClass?: string;
|
|
80
|
+
style?: any;
|
|
81
|
+
onStateChange?: (state: AudioRecorderState) => void;
|
|
82
|
+
showControls?: boolean;
|
|
83
|
+
maxDuration?: number;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Props for toolbar
|
|
87
|
+
*/
|
|
88
|
+
export interface CopilotChatToolbarProps {
|
|
89
|
+
inputClass?: string;
|
|
90
|
+
style?: any;
|
|
91
|
+
position?: 'top' | 'bottom';
|
|
92
|
+
alignment?: 'left' | 'center' | 'right' | 'space-between';
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Slot configuration for chat input
|
|
96
|
+
*/
|
|
97
|
+
export interface CopilotChatInputSlots {
|
|
98
|
+
textArea?: Type<any> | TemplateRef<any>;
|
|
99
|
+
sendButton?: Type<any> | TemplateRef<any>;
|
|
100
|
+
startTranscribeButton?: Type<any> | TemplateRef<any>;
|
|
101
|
+
cancelTranscribeButton?: Type<any> | TemplateRef<any>;
|
|
102
|
+
finishTranscribeButton?: Type<any> | TemplateRef<any>;
|
|
103
|
+
addFileButton?: Type<any> | TemplateRef<any>;
|
|
104
|
+
toolsButton?: Type<any> | TemplateRef<any>;
|
|
105
|
+
toolbar?: Type<any> | TemplateRef<any>;
|
|
106
|
+
audioRecorder?: Type<any> | TemplateRef<any>;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Input configuration for the chat input component
|
|
110
|
+
*/
|
|
111
|
+
export interface CopilotChatInputConfig {
|
|
112
|
+
mode?: CopilotChatInputMode;
|
|
113
|
+
toolsMenu?: (ToolsMenuItem | '-')[];
|
|
114
|
+
autoFocus?: boolean;
|
|
115
|
+
additionalToolbarItems?: TemplateRef<any>;
|
|
116
|
+
value?: string;
|
|
117
|
+
class?: string;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Output events for the chat input component
|
|
121
|
+
*/
|
|
122
|
+
export interface CopilotChatInputOutputs {
|
|
123
|
+
submitMessage: (value: string) => void;
|
|
124
|
+
startTranscribe: () => void;
|
|
125
|
+
cancelTranscribe: () => void;
|
|
126
|
+
finishTranscribe: () => void;
|
|
127
|
+
addFile: () => void;
|
|
128
|
+
changeValue: (value: string) => void;
|
|
129
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { OnInit, OnChanges } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* Cursor component that matches the React implementation exactly.
|
|
5
|
+
* Shows a pulsing dot animation to indicate activity.
|
|
6
|
+
*/
|
|
7
|
+
export declare class CopilotChatMessageViewCursorComponent implements OnInit, OnChanges {
|
|
8
|
+
inputClass?: string;
|
|
9
|
+
private inputClassSignal;
|
|
10
|
+
computedClass: import("@angular/core").Signal<string>;
|
|
11
|
+
ngOnInit(): void;
|
|
12
|
+
ngOnChanges(): void;
|
|
13
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CopilotChatMessageViewCursorComponent, never>;
|
|
14
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CopilotChatMessageViewCursorComponent, "copilot-chat-message-view-cursor", never, { "inputClass": { "alias": "inputClass"; "required": false; }; }, {}, never, never, true, never>;
|
|
15
|
+
}
|