@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.
Files changed (169) hide show
  1. package/.turbo/turbo-build.log +39 -0
  2. package/.turbo/turbo-check-types.log +0 -0
  3. package/.turbo/turbo-test.log +71 -0
  4. package/LICENSE +10 -0
  5. package/README-agent-context.md +310 -0
  6. package/dist/LICENSE +10 -0
  7. package/dist/components/chat/copilot-chat-assistant-message-buttons.component.d.ts +75 -0
  8. package/dist/components/chat/copilot-chat-assistant-message-renderer.component.d.ts +31 -0
  9. package/dist/components/chat/copilot-chat-assistant-message-toolbar.component.d.ts +8 -0
  10. package/dist/components/chat/copilot-chat-assistant-message.component.d.ts +131 -0
  11. package/dist/components/chat/copilot-chat-assistant-message.types.d.ts +31 -0
  12. package/dist/components/chat/copilot-chat-audio-recorder.component.d.ts +40 -0
  13. package/dist/components/chat/copilot-chat-buttons.component.d.ts +66 -0
  14. package/dist/components/chat/copilot-chat-input-defaults.d.ts +37 -0
  15. package/dist/components/chat/copilot-chat-input.component.d.ts +133 -0
  16. package/dist/components/chat/copilot-chat-input.types.d.ts +129 -0
  17. package/dist/components/chat/copilot-chat-message-view-cursor.component.d.ts +15 -0
  18. package/dist/components/chat/copilot-chat-message-view.component.d.ts +293 -0
  19. package/dist/components/chat/copilot-chat-message-view.types.d.ts +24 -0
  20. package/dist/components/chat/copilot-chat-textarea.component.d.ts +45 -0
  21. package/dist/components/chat/copilot-chat-tool-calls-view.component.d.ts +35 -0
  22. package/dist/components/chat/copilot-chat-toolbar.component.d.ts +8 -0
  23. package/dist/components/chat/copilot-chat-tools-menu.component.d.ts +20 -0
  24. package/dist/components/chat/copilot-chat-user-message-branch-navigation.component.d.ts +23 -0
  25. package/dist/components/chat/copilot-chat-user-message-buttons.component.d.ts +39 -0
  26. package/dist/components/chat/copilot-chat-user-message-renderer.component.d.ts +9 -0
  27. package/dist/components/chat/copilot-chat-user-message-toolbar.component.d.ts +8 -0
  28. package/dist/components/chat/copilot-chat-user-message.component.d.ts +55 -0
  29. package/dist/components/chat/copilot-chat-user-message.types.d.ts +33 -0
  30. package/dist/components/chat/copilot-chat-view-disclaimer.component.d.ts +15 -0
  31. package/dist/components/chat/copilot-chat-view-feather.component.d.ts +15 -0
  32. package/dist/components/chat/copilot-chat-view-handlers.service.d.ts +11 -0
  33. package/dist/components/chat/copilot-chat-view-input-container.component.d.ts +23 -0
  34. package/dist/components/chat/copilot-chat-view-scroll-to-bottom-button.component.d.ts +17 -0
  35. package/dist/components/chat/copilot-chat-view-scroll-view.component.d.ts +84 -0
  36. package/dist/components/chat/copilot-chat-view.component.d.ts +205 -0
  37. package/dist/components/chat/copilot-chat-view.types.d.ts +42 -0
  38. package/dist/components/chat/copilot-chat.component.d.ts +37 -0
  39. package/dist/components/copilotkit-tool-render.component.d.ts +25 -0
  40. package/dist/core/chat-configuration/chat-configuration.providers.d.ts +54 -0
  41. package/dist/core/chat-configuration/chat-configuration.service.d.ts +75 -0
  42. package/dist/core/chat-configuration/chat-configuration.types.d.ts +27 -0
  43. package/dist/core/copilotkit.providers.d.ts +13 -0
  44. package/dist/core/copilotkit.service.d.ts +119 -0
  45. package/dist/core/copilotkit.types.d.ts +83 -0
  46. package/dist/directives/copilotkit-agent-context.directive.d.ts +68 -0
  47. package/dist/directives/copilotkit-agent.directive.d.ts +106 -0
  48. package/dist/directives/copilotkit-chat-config.directive.d.ts +84 -0
  49. package/dist/directives/copilotkit-config.directive.d.ts +44 -0
  50. package/dist/directives/copilotkit-frontend-tool.directive.d.ts +25 -0
  51. package/dist/directives/copilotkit-human-in-the-loop.directive.d.ts +124 -0
  52. package/dist/directives/stick-to-bottom.directive.d.ts +62 -0
  53. package/dist/fesm2022/copilotkitnext-angular.mjs +9314 -0
  54. package/dist/fesm2022/copilotkitnext-angular.mjs.map +1 -0
  55. package/dist/index.d.ts +55 -0
  56. package/dist/lib/directives/tooltip.directive.d.ts +33 -0
  57. package/dist/lib/slots/copilot-slot.component.d.ts +34 -0
  58. package/dist/lib/slots/slot.types.d.ts +55 -0
  59. package/dist/lib/slots/slot.utils.d.ts +108 -0
  60. package/dist/lib/utils.d.ts +6 -0
  61. package/dist/services/resize-observer.service.d.ts +44 -0
  62. package/dist/services/scroll-position.service.d.ts +50 -0
  63. package/dist/styles.css +1963 -0
  64. package/dist/types/frontend-tool.d.ts +37 -0
  65. package/dist/types/human-in-the-loop.d.ts +44 -0
  66. package/dist/utils/agent-context.utils.d.ts +75 -0
  67. package/dist/utils/agent.utils.d.ts +99 -0
  68. package/dist/utils/chat-config.utils.d.ts +166 -0
  69. package/dist/utils/copilotkit.utils.d.ts +16 -0
  70. package/dist/utils/frontend-tool.utils.d.ts +119 -0
  71. package/dist/utils/human-in-the-loop.utils.d.ts +92 -0
  72. package/eslint.config.mjs +20 -0
  73. package/ng-package.json +19 -0
  74. package/package.json +96 -0
  75. package/slots.md +331 -0
  76. package/src/components/chat/__tests__/copilot-chat-assistant-message.component.spec.ts +282 -0
  77. package/src/components/chat/__tests__/copilot-chat-input.component.spec.ts +419 -0
  78. package/src/components/chat/__tests__/copilot-chat-message-view.component.spec.ts +372 -0
  79. package/src/components/chat/__tests__/copilot-chat-user-message.component.spec.ts +249 -0
  80. package/src/components/chat/copilot-chat-assistant-message-buttons.component.ts +292 -0
  81. package/src/components/chat/copilot-chat-assistant-message-renderer.component.ts +472 -0
  82. package/src/components/chat/copilot-chat-assistant-message-toolbar.component.ts +29 -0
  83. package/src/components/chat/copilot-chat-assistant-message.component.ts +463 -0
  84. package/src/components/chat/copilot-chat-assistant-message.types.ts +50 -0
  85. package/src/components/chat/copilot-chat-audio-recorder.component.ts +241 -0
  86. package/src/components/chat/copilot-chat-buttons.component.ts +308 -0
  87. package/src/components/chat/copilot-chat-buttons.component.ts.bak +471 -0
  88. package/src/components/chat/copilot-chat-input-defaults.ts +47 -0
  89. package/src/components/chat/copilot-chat-input.component.ts +512 -0
  90. package/src/components/chat/copilot-chat-input.types.ts +148 -0
  91. package/src/components/chat/copilot-chat-message-view-cursor.component.ts +51 -0
  92. package/src/components/chat/copilot-chat-message-view.component.ts +233 -0
  93. package/src/components/chat/copilot-chat-message-view.types.ts +39 -0
  94. package/src/components/chat/copilot-chat-textarea.component.ts +220 -0
  95. package/src/components/chat/copilot-chat-tool-calls-view.component.ts +261 -0
  96. package/src/components/chat/copilot-chat-toolbar.component.ts +35 -0
  97. package/src/components/chat/copilot-chat-tools-menu.component.ts +185 -0
  98. package/src/components/chat/copilot-chat-user-message-branch-navigation.component.ts +121 -0
  99. package/src/components/chat/copilot-chat-user-message-buttons.component.ts +170 -0
  100. package/src/components/chat/copilot-chat-user-message-renderer.component.ts +37 -0
  101. package/src/components/chat/copilot-chat-user-message-toolbar.component.ts +37 -0
  102. package/src/components/chat/copilot-chat-user-message.component.ts +247 -0
  103. package/src/components/chat/copilot-chat-user-message.types.ts +42 -0
  104. package/src/components/chat/copilot-chat-view-disclaimer.component.ts +51 -0
  105. package/src/components/chat/copilot-chat-view-feather.component.ts +47 -0
  106. package/src/components/chat/copilot-chat-view-handlers.service.ts +14 -0
  107. package/src/components/chat/copilot-chat-view-input-container.component.ts +87 -0
  108. package/src/components/chat/copilot-chat-view-scroll-to-bottom-button.component.ts +79 -0
  109. package/src/components/chat/copilot-chat-view-scroll-view.component.ts +322 -0
  110. package/src/components/chat/copilot-chat-view.component.ts +420 -0
  111. package/src/components/chat/copilot-chat-view.types.ts +52 -0
  112. package/src/components/chat/copilot-chat.component.ts +232 -0
  113. package/src/components/copilotkit-tool-render.component.ts +169 -0
  114. package/src/core/__tests__/copilotkit.service.spec.ts +1051 -0
  115. package/src/core/__tests__/copilotkit.service.wildcard.spec.ts +316 -0
  116. package/src/core/chat-configuration/__tests__/chat-configuration.service.spec.ts +287 -0
  117. package/src/core/chat-configuration/chat-configuration.providers.ts +71 -0
  118. package/src/core/chat-configuration/chat-configuration.service.ts +162 -0
  119. package/src/core/chat-configuration/chat-configuration.types.ts +57 -0
  120. package/src/core/copilotkit.providers.ts +59 -0
  121. package/src/core/copilotkit.service.ts +542 -0
  122. package/src/core/copilotkit.types.ts +132 -0
  123. package/src/directives/__tests__/copilotkit-agent-context.directive.spec.ts +384 -0
  124. package/src/directives/__tests__/copilotkit-agent.directive.spec.ts +253 -0
  125. package/src/directives/__tests__/copilotkit-chat-config.directive.spec.ts +385 -0
  126. package/src/directives/__tests__/copilotkit-config.directive.spec.ts +69 -0
  127. package/src/directives/__tests__/copilotkit-frontend-tool-simple.directive.spec.ts +60 -0
  128. package/src/directives/__tests__/copilotkit-frontend-tool.directive.spec.ts +108 -0
  129. package/src/directives/__tests__/copilotkit-human-in-the-loop.directive.spec.ts +452 -0
  130. package/src/directives/copilotkit-agent-context.directive.ts +138 -0
  131. package/src/directives/copilotkit-agent.directive.ts +225 -0
  132. package/src/directives/copilotkit-chat-config.directive.ts +241 -0
  133. package/src/directives/copilotkit-config.directive.ts +81 -0
  134. package/src/directives/copilotkit-frontend-tool.directive.ts +145 -0
  135. package/src/directives/copilotkit-human-in-the-loop.directive.ts +281 -0
  136. package/src/directives/stick-to-bottom.directive.ts +204 -0
  137. package/src/index.ts +105 -0
  138. package/src/lib/directives/tooltip.directive.ts +292 -0
  139. package/src/lib/slots/__tests__/slot.utils.spec.ts +377 -0
  140. package/src/lib/slots/copilot-slot.component.ts +135 -0
  141. package/src/lib/slots/index.ts +3 -0
  142. package/src/lib/slots/slot.types.ts +64 -0
  143. package/src/lib/slots/slot.utils.ts +289 -0
  144. package/src/lib/utils.ts +10 -0
  145. package/src/public-api.ts +1 -0
  146. package/src/services/resize-observer.service.ts +181 -0
  147. package/src/services/scroll-position.service.ts +169 -0
  148. package/src/styles/globals.css +266 -0
  149. package/src/styles/index.css +3 -0
  150. package/src/test-setup.ts +15 -0
  151. package/src/testing/index.ts +3 -0
  152. package/src/testing/testing.utils.ts +248 -0
  153. package/src/types/frontend-tool.ts +44 -0
  154. package/src/types/human-in-the-loop.ts +52 -0
  155. package/src/utils/__tests__/agent.utils.spec.ts +234 -0
  156. package/src/utils/__tests__/chat-config.utils.spec.ts +306 -0
  157. package/src/utils/__tests__/frontend-tool-inject.spec.ts +350 -0
  158. package/src/utils/__tests__/frontend-tool-integration.spec.ts +199 -0
  159. package/src/utils/__tests__/frontend-tool.utils.spec.ts +272 -0
  160. package/src/utils/__tests__/human-in-the-loop.utils.spec.ts +365 -0
  161. package/src/utils/agent-context.utils.ts +133 -0
  162. package/src/utils/agent.utils.ts +239 -0
  163. package/src/utils/chat-config.utils.ts +221 -0
  164. package/src/utils/copilotkit.utils.ts +20 -0
  165. package/src/utils/frontend-tool.utils.ts +266 -0
  166. package/src/utils/human-in-the-loop.utils.ts +359 -0
  167. package/tsconfig.json +33 -0
  168. package/tsconfig.spec.json +12 -0
  169. package/vitest.config.mts +34 -0
@@ -0,0 +1,23 @@
1
+ import { ElementRef } from '@angular/core';
2
+ import { CopilotChatInputComponent } from './copilot-chat-input.component';
3
+ import { CopilotChatViewDisclaimerComponent } from './copilot-chat-view-disclaimer.component';
4
+ import * as i0 from "@angular/core";
5
+ /**
6
+ * InputContainer component for CopilotChatView
7
+ * Container for input and disclaimer components
8
+ * Uses ForwardRef for DOM access
9
+ */
10
+ export declare class CopilotChatViewInputContainerComponent extends ElementRef {
11
+ inputContainerClass?: string;
12
+ input?: any;
13
+ inputClass?: string;
14
+ disclaimer?: any;
15
+ disclaimerText?: string;
16
+ disclaimerClass?: string;
17
+ protected readonly defaultInputComponent: typeof CopilotChatInputComponent;
18
+ protected readonly defaultDisclaimerComponent: typeof CopilotChatViewDisclaimerComponent;
19
+ constructor(elementRef: ElementRef);
20
+ get computedClass(): string;
21
+ static ɵfac: i0.ɵɵFactoryDeclaration<CopilotChatViewInputContainerComponent, never>;
22
+ static ɵcmp: i0.ɵɵComponentDeclaration<CopilotChatViewInputContainerComponent, "copilot-chat-view-input-container", never, { "inputContainerClass": { "alias": "inputContainerClass"; "required": false; }; "input": { "alias": "input"; "required": false; }; "inputClass": { "alias": "inputClass"; "required": false; }; "disclaimer": { "alias": "disclaimer"; "required": false; }; "disclaimerText": { "alias": "disclaimerText"; "required": false; }; "disclaimerClass": { "alias": "disclaimerClass"; "required": false; }; }, {}, never, never, true, never>;
23
+ }
@@ -0,0 +1,17 @@
1
+ import { EventEmitter } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ /**
4
+ * ScrollToBottomButton component for CopilotChatView
5
+ * Matches React implementation exactly with same Tailwind classes
6
+ */
7
+ export declare class CopilotChatViewScrollToBottomButtonComponent {
8
+ inputClass?: string;
9
+ disabled: boolean;
10
+ onClick?: () => void;
11
+ clicked: EventEmitter<void>;
12
+ protected readonly ChevronDown: import("lucide-angular").LucideIconData;
13
+ get computedClass(): string;
14
+ handleClick(): void;
15
+ static ɵfac: i0.ɵɵFactoryDeclaration<CopilotChatViewScrollToBottomButtonComponent, never>;
16
+ static ɵcmp: i0.ɵɵComponentDeclaration<CopilotChatViewScrollToBottomButtonComponent, "copilot-chat-view-scroll-to-bottom-button", never, { "inputClass": { "alias": "inputClass"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "onClick": { "alias": "onClick"; "required": false; }; }, { "clicked": "clicked"; }, never, never, true, never>;
17
+ }
@@ -0,0 +1,84 @@
1
+ import { EventEmitter, ElementRef, OnInit, OnChanges, AfterViewInit, OnDestroy } from '@angular/core';
2
+ import { CopilotChatMessageViewComponent } from './copilot-chat-message-view.component';
3
+ import { CopilotChatViewScrollToBottomButtonComponent } from './copilot-chat-view-scroll-to-bottom-button.component';
4
+ import { StickToBottomDirective } from '../../directives/stick-to-bottom.directive';
5
+ import { Message } from '@ag-ui/client';
6
+ import * as i0 from "@angular/core";
7
+ /**
8
+ * ScrollView component for CopilotChatView
9
+ * Handles auto-scrolling and scroll position management
10
+ */
11
+ export declare class CopilotChatViewScrollViewComponent implements OnInit, OnChanges, AfterViewInit, OnDestroy {
12
+ private cdr;
13
+ autoScroll: boolean;
14
+ private _inputContainerHeight;
15
+ set inputContainerHeight(value: number);
16
+ get inputContainerHeight(): number;
17
+ isResizing: boolean;
18
+ inputClass?: string;
19
+ messages: Message[];
20
+ messageView?: any;
21
+ messageViewClass?: string;
22
+ showCursor: boolean;
23
+ scrollToBottomButton?: any;
24
+ scrollToBottomButtonClass?: string;
25
+ assistantMessageThumbsUp: EventEmitter<{
26
+ message: Message;
27
+ }>;
28
+ assistantMessageThumbsDown: EventEmitter<{
29
+ message: Message;
30
+ }>;
31
+ assistantMessageReadAloud: EventEmitter<{
32
+ message: Message;
33
+ }>;
34
+ assistantMessageRegenerate: EventEmitter<{
35
+ message: Message;
36
+ }>;
37
+ userMessageCopy: EventEmitter<{
38
+ message: Message;
39
+ }>;
40
+ userMessageEdit: EventEmitter<{
41
+ message: Message;
42
+ }>;
43
+ scrollContainer?: ElementRef<HTMLElement>;
44
+ contentContainer?: ElementRef<HTMLElement>;
45
+ stickToBottomDirective?: StickToBottomDirective;
46
+ protected readonly defaultMessageViewComponent: typeof CopilotChatMessageViewComponent;
47
+ protected readonly defaultScrollToBottomButtonComponent: typeof CopilotChatViewScrollToBottomButtonComponent;
48
+ protected hasMounted: import("@angular/core").WritableSignal<boolean>;
49
+ protected showScrollButton: import("@angular/core").WritableSignal<boolean>;
50
+ protected isAtBottom: import("@angular/core").WritableSignal<boolean>;
51
+ protected inputContainerHeightSignal: import("@angular/core").WritableSignal<number>;
52
+ protected paddingBottom: import("@angular/core").Signal<number>;
53
+ protected computedClass: import("@angular/core").Signal<string>;
54
+ private destroy$;
55
+ private platformId;
56
+ private scrollPositionService;
57
+ ngOnInit(): void;
58
+ ngOnChanges(): void;
59
+ ngAfterViewInit(): void;
60
+ /**
61
+ * Handle isAtBottom change from StickToBottom directive
62
+ */
63
+ onIsAtBottomChange(isAtBottom: boolean): void;
64
+ /**
65
+ * Scroll to bottom for manual mode
66
+ */
67
+ scrollToBottom(): void;
68
+ /**
69
+ * Scroll to bottom for stick-to-bottom mode
70
+ */
71
+ scrollToBottomFromStick(): void;
72
+ ngOnDestroy(): void;
73
+ scrollToBottomOutputs: {
74
+ clicked: () => void;
75
+ };
76
+ scrollToBottomFromStickOutputs: {
77
+ clicked: () => void;
78
+ };
79
+ messageViewContext(): any;
80
+ scrollToBottomContext(): any;
81
+ scrollToBottomFromStickContext(): any;
82
+ static ɵfac: i0.ɵɵFactoryDeclaration<CopilotChatViewScrollViewComponent, never>;
83
+ static ɵcmp: i0.ɵɵComponentDeclaration<CopilotChatViewScrollViewComponent, "copilot-chat-view-scroll-view", never, { "autoScroll": { "alias": "autoScroll"; "required": false; }; "inputContainerHeight": { "alias": "inputContainerHeight"; "required": false; }; "isResizing": { "alias": "isResizing"; "required": false; }; "inputClass": { "alias": "inputClass"; "required": false; }; "messages": { "alias": "messages"; "required": false; }; "messageView": { "alias": "messageView"; "required": false; }; "messageViewClass": { "alias": "messageViewClass"; "required": false; }; "showCursor": { "alias": "showCursor"; "required": false; }; "scrollToBottomButton": { "alias": "scrollToBottomButton"; "required": false; }; "scrollToBottomButtonClass": { "alias": "scrollToBottomButtonClass"; "required": false; }; }, { "assistantMessageThumbsUp": "assistantMessageThumbsUp"; "assistantMessageThumbsDown": "assistantMessageThumbsDown"; "assistantMessageReadAloud": "assistantMessageReadAloud"; "assistantMessageRegenerate": "assistantMessageRegenerate"; "userMessageCopy": "userMessageCopy"; "userMessageEdit": "userMessageEdit"; }, never, ["*"], true, never>;
84
+ }
@@ -0,0 +1,205 @@
1
+ import { EventEmitter, TemplateRef, Type, ElementRef, ChangeDetectorRef, OnInit, OnChanges, OnDestroy, AfterViewInit } from '@angular/core';
2
+ import { CopilotChatViewScrollViewComponent } from './copilot-chat-view-scroll-view.component';
3
+ import { CopilotChatViewScrollToBottomButtonComponent } from './copilot-chat-view-scroll-to-bottom-button.component';
4
+ import { CopilotChatViewFeatherComponent } from './copilot-chat-view-feather.component';
5
+ import { CopilotChatViewInputContainerComponent } from './copilot-chat-view-input-container.component';
6
+ import { CopilotChatViewDisclaimerComponent } from './copilot-chat-view-disclaimer.component';
7
+ import { Message } from '@ag-ui/client';
8
+ import { ResizeObserverService } from '../../services/resize-observer.service';
9
+ import { CopilotChatViewHandlersService } from './copilot-chat-view-handlers.service';
10
+ import * as i0 from "@angular/core";
11
+ /**
12
+ * CopilotChatView component - Angular port of the React component.
13
+ * A complete chat interface with message feed and input components.
14
+ *
15
+ * @example
16
+ * ```html
17
+ * <copilot-chat-view
18
+ * [messages]="messages"
19
+ * [autoScroll]="true"
20
+ * [messageViewProps]="{ assistantMessage: { onThumbsUp: handleThumbsUp } }">
21
+ * </copilot-chat-view>
22
+ * ```
23
+ */
24
+ export declare class CopilotChatViewComponent implements OnInit, OnChanges, AfterViewInit, OnDestroy {
25
+ private resizeObserverService;
26
+ private cdr;
27
+ private handlers;
28
+ messages: Message[];
29
+ autoScroll: boolean;
30
+ showCursor: boolean;
31
+ messageViewComponent?: Type<any>;
32
+ messageViewTemplate?: TemplateRef<any>;
33
+ messageViewClass?: string;
34
+ scrollViewComponent?: Type<any>;
35
+ scrollViewTemplate?: TemplateRef<any>;
36
+ scrollViewClass?: string;
37
+ scrollToBottomButtonComponent?: Type<any>;
38
+ scrollToBottomButtonTemplate?: TemplateRef<any>;
39
+ scrollToBottomButtonClass?: string;
40
+ inputComponent?: Type<any>;
41
+ inputTemplate?: TemplateRef<any>;
42
+ inputContainerComponent?: Type<any>;
43
+ inputContainerTemplate?: TemplateRef<any>;
44
+ inputContainerClass?: string;
45
+ featherComponent?: Type<any>;
46
+ featherTemplate?: TemplateRef<any>;
47
+ featherClass?: string;
48
+ disclaimerComponent?: Type<any>;
49
+ disclaimerTemplate?: TemplateRef<any>;
50
+ disclaimerClass?: string;
51
+ disclaimerText?: string;
52
+ customLayoutTemplate?: TemplateRef<any>;
53
+ sendButtonTemplate?: TemplateRef<any>;
54
+ toolbarTemplate?: TemplateRef<any>;
55
+ textAreaTemplate?: TemplateRef<any>;
56
+ audioRecorderTemplate?: TemplateRef<any>;
57
+ assistantMessageMarkdownRendererTemplate?: TemplateRef<any>;
58
+ thumbsUpButtonTemplate?: TemplateRef<any>;
59
+ thumbsDownButtonTemplate?: TemplateRef<any>;
60
+ readAloudButtonTemplate?: TemplateRef<any>;
61
+ regenerateButtonTemplate?: TemplateRef<any>;
62
+ assistantMessageThumbsUp: EventEmitter<{
63
+ message: Message;
64
+ }>;
65
+ assistantMessageThumbsDown: EventEmitter<{
66
+ message: Message;
67
+ }>;
68
+ assistantMessageReadAloud: EventEmitter<{
69
+ message: Message;
70
+ }>;
71
+ assistantMessageRegenerate: EventEmitter<{
72
+ message: Message;
73
+ }>;
74
+ userMessageCopy: EventEmitter<{
75
+ message: Message;
76
+ }>;
77
+ userMessageEdit: EventEmitter<{
78
+ message: Message;
79
+ }>;
80
+ inputContainerSlotRef?: ElementRef;
81
+ protected readonly defaultScrollViewComponent: typeof CopilotChatViewScrollViewComponent;
82
+ protected readonly defaultScrollToBottomButtonComponent: typeof CopilotChatViewScrollToBottomButtonComponent;
83
+ protected readonly defaultInputContainerComponent: typeof CopilotChatViewInputContainerComponent;
84
+ protected readonly defaultFeatherComponent: typeof CopilotChatViewFeatherComponent;
85
+ protected readonly defaultDisclaimerComponent: typeof CopilotChatViewDisclaimerComponent;
86
+ protected messagesSignal: import("@angular/core").WritableSignal<({
87
+ id: string;
88
+ role: "developer";
89
+ content: string;
90
+ name?: string | undefined;
91
+ } | {
92
+ id: string;
93
+ role: "system";
94
+ content: string;
95
+ name?: string | undefined;
96
+ } | {
97
+ id: string;
98
+ role: "assistant";
99
+ name?: string | undefined;
100
+ content?: string | undefined;
101
+ toolCalls?: {
102
+ function: {
103
+ name: string;
104
+ arguments: string;
105
+ };
106
+ type: "function";
107
+ id: string;
108
+ }[] | undefined;
109
+ } | {
110
+ id: string;
111
+ role: "user";
112
+ content: string;
113
+ name?: string | undefined;
114
+ } | {
115
+ id: string;
116
+ role: "tool";
117
+ content: string;
118
+ toolCallId: string;
119
+ error?: string | undefined;
120
+ })[]>;
121
+ protected autoScrollSignal: import("@angular/core").WritableSignal<boolean>;
122
+ protected showCursorSignal: import("@angular/core").WritableSignal<boolean>;
123
+ protected disclaimerTextSignal: import("@angular/core").WritableSignal<string>;
124
+ protected disclaimerClassSignal: import("@angular/core").WritableSignal<string>;
125
+ protected inputContainerHeight: import("@angular/core").WritableSignal<number>;
126
+ protected isResizing: import("@angular/core").WritableSignal<boolean>;
127
+ protected contentPaddingBottom: import("@angular/core").Signal<number>;
128
+ protected computedClass: import("@angular/core").Signal<string>;
129
+ protected messageViewSlot: import("@angular/core").Signal<Type<any> | TemplateRef<any>>;
130
+ protected scrollViewSlot: import("@angular/core").Signal<Type<any> | TemplateRef<any>>;
131
+ protected scrollToBottomButtonSlot: import("@angular/core").Signal<Type<any> | TemplateRef<any>>;
132
+ protected inputSlot: import("@angular/core").Signal<Type<any> | TemplateRef<any>>;
133
+ protected inputContainerSlot: import("@angular/core").Signal<Type<any> | TemplateRef<any>>;
134
+ protected featherSlot: import("@angular/core").Signal<Type<any> | TemplateRef<any>>;
135
+ protected disclaimerSlot: import("@angular/core").Signal<Type<any> | TemplateRef<any>>;
136
+ protected scrollViewContext: import("@angular/core").Signal<{
137
+ autoScroll: boolean;
138
+ scrollToBottomButton: Type<any> | TemplateRef<any>;
139
+ scrollToBottomButtonClass: string;
140
+ inputContainerHeight: number;
141
+ isResizing: boolean;
142
+ messages: ({
143
+ id: string;
144
+ role: "developer";
145
+ content: string;
146
+ name?: string | undefined;
147
+ } | {
148
+ id: string;
149
+ role: "system";
150
+ content: string;
151
+ name?: string | undefined;
152
+ } | {
153
+ id: string;
154
+ role: "assistant";
155
+ name?: string | undefined;
156
+ content?: string | undefined;
157
+ toolCalls?: {
158
+ function: {
159
+ name: string;
160
+ arguments: string;
161
+ };
162
+ type: "function";
163
+ id: string;
164
+ }[] | undefined;
165
+ } | {
166
+ id: string;
167
+ role: "user";
168
+ content: string;
169
+ name?: string | undefined;
170
+ } | {
171
+ id: string;
172
+ role: "tool";
173
+ content: string;
174
+ toolCallId: string;
175
+ error?: string | undefined;
176
+ })[];
177
+ messageView: Type<any> | TemplateRef<any>;
178
+ messageViewClass: string;
179
+ }>;
180
+ protected inputContainerContext: import("@angular/core").Signal<{
181
+ input: Type<any> | TemplateRef<any>;
182
+ disclaimer: Type<any> | TemplateRef<any>;
183
+ disclaimerText: string;
184
+ disclaimerClass: string;
185
+ inputContainerClass: string;
186
+ }>;
187
+ protected layoutContext: import("@angular/core").Signal<{
188
+ messageView: Type<any> | TemplateRef<any>;
189
+ input: Type<any> | TemplateRef<any>;
190
+ scrollView: Type<any> | TemplateRef<any>;
191
+ scrollToBottomButton: Type<any> | TemplateRef<any>;
192
+ feather: Type<any> | TemplateRef<any>;
193
+ inputContainer: Type<any> | TemplateRef<any>;
194
+ disclaimer: Type<any> | TemplateRef<any>;
195
+ }>;
196
+ private destroy$;
197
+ private resizeTimeoutRef?;
198
+ constructor(resizeObserverService: ResizeObserverService, cdr: ChangeDetectorRef, handlers: CopilotChatViewHandlersService);
199
+ ngOnInit(): void;
200
+ ngOnChanges(): void;
201
+ ngAfterViewInit(): void;
202
+ ngOnDestroy(): void;
203
+ static ɵfac: i0.ɵɵFactoryDeclaration<CopilotChatViewComponent, never>;
204
+ static ɵcmp: i0.ɵɵComponentDeclaration<CopilotChatViewComponent, "copilot-chat-view", never, { "messages": { "alias": "messages"; "required": false; }; "autoScroll": { "alias": "autoScroll"; "required": false; }; "showCursor": { "alias": "showCursor"; "required": false; }; "messageViewComponent": { "alias": "messageViewComponent"; "required": false; }; "messageViewTemplate": { "alias": "messageViewTemplate"; "required": false; }; "messageViewClass": { "alias": "messageViewClass"; "required": false; }; "scrollViewComponent": { "alias": "scrollViewComponent"; "required": false; }; "scrollViewTemplate": { "alias": "scrollViewTemplate"; "required": false; }; "scrollViewClass": { "alias": "scrollViewClass"; "required": false; }; "scrollToBottomButtonComponent": { "alias": "scrollToBottomButtonComponent"; "required": false; }; "scrollToBottomButtonTemplate": { "alias": "scrollToBottomButtonTemplate"; "required": false; }; "scrollToBottomButtonClass": { "alias": "scrollToBottomButtonClass"; "required": false; }; "inputComponent": { "alias": "inputComponent"; "required": false; }; "inputTemplate": { "alias": "inputTemplate"; "required": false; }; "inputContainerComponent": { "alias": "inputContainerComponent"; "required": false; }; "inputContainerTemplate": { "alias": "inputContainerTemplate"; "required": false; }; "inputContainerClass": { "alias": "inputContainerClass"; "required": false; }; "featherComponent": { "alias": "featherComponent"; "required": false; }; "featherTemplate": { "alias": "featherTemplate"; "required": false; }; "featherClass": { "alias": "featherClass"; "required": false; }; "disclaimerComponent": { "alias": "disclaimerComponent"; "required": false; }; "disclaimerTemplate": { "alias": "disclaimerTemplate"; "required": false; }; "disclaimerClass": { "alias": "disclaimerClass"; "required": false; }; "disclaimerText": { "alias": "disclaimerText"; "required": false; }; }, { "assistantMessageThumbsUp": "assistantMessageThumbsUp"; "assistantMessageThumbsDown": "assistantMessageThumbsDown"; "assistantMessageReadAloud": "assistantMessageReadAloud"; "assistantMessageRegenerate": "assistantMessageRegenerate"; "userMessageCopy": "userMessageCopy"; "userMessageEdit": "userMessageEdit"; }, ["customLayoutTemplate", "sendButtonTemplate", "toolbarTemplate", "textAreaTemplate", "audioRecorderTemplate", "assistantMessageMarkdownRendererTemplate", "thumbsUpButtonTemplate", "thumbsDownButtonTemplate", "readAloudButtonTemplate", "regenerateButtonTemplate"], never, true, never>;
205
+ }
@@ -0,0 +1,42 @@
1
+ import { Type, TemplateRef } from '@angular/core';
2
+ import { Message } from '@ag-ui/client';
3
+ /**
4
+ * Props for CopilotChatView component
5
+ */
6
+ export interface CopilotChatViewProps {
7
+ messages?: Message[];
8
+ autoScroll?: boolean;
9
+ messageViewComponent?: Type<any>;
10
+ messageViewTemplate?: TemplateRef<any>;
11
+ messageViewClass?: string;
12
+ scrollViewComponent?: Type<any>;
13
+ scrollViewTemplate?: TemplateRef<any>;
14
+ scrollViewClass?: string;
15
+ scrollToBottomButtonComponent?: Type<any>;
16
+ scrollToBottomButtonTemplate?: TemplateRef<any>;
17
+ scrollToBottomButtonClass?: string;
18
+ inputComponent?: Type<any>;
19
+ inputTemplate?: TemplateRef<any>;
20
+ inputContainerComponent?: Type<any>;
21
+ inputContainerTemplate?: TemplateRef<any>;
22
+ inputContainerClass?: string;
23
+ featherComponent?: Type<any>;
24
+ featherTemplate?: TemplateRef<any>;
25
+ featherClass?: string;
26
+ disclaimerComponent?: Type<any>;
27
+ disclaimerTemplate?: TemplateRef<any>;
28
+ disclaimerClass?: string;
29
+ disclaimerText?: string;
30
+ }
31
+ /**
32
+ * Context for custom layout template
33
+ */
34
+ export interface CopilotChatViewLayoutContext {
35
+ messageView: any;
36
+ input: any;
37
+ scrollView: any;
38
+ scrollToBottomButton: any;
39
+ feather: any;
40
+ inputContainer: any;
41
+ disclaimer: any;
42
+ }
@@ -0,0 +1,37 @@
1
+ import { OnInit, OnChanges, OnDestroy, SimpleChanges, ChangeDetectorRef, Signal, Injector } from "@angular/core";
2
+ import { CopilotChatConfigurationService } from "../../core/chat-configuration/chat-configuration.service";
3
+ import { Message, AbstractAgent } from "@ag-ui/client";
4
+ import * as i0 from "@angular/core";
5
+ /**
6
+ * CopilotChat component - Angular equivalent of React's <CopilotChat>
7
+ * Provides a complete chat interface that wires an agent to the chat view
8
+ *
9
+ * @example
10
+ * ```html
11
+ * <copilot-chat [agentId]="'default'" [threadId]="'abc123'"></copilot-chat>
12
+ * ```
13
+ */
14
+ export declare class CopilotChatComponent implements OnInit, OnChanges, OnDestroy {
15
+ private chatConfig;
16
+ private cdr;
17
+ private injector;
18
+ agentId?: string;
19
+ threadId?: string;
20
+ constructor(chatConfig: CopilotChatConfigurationService | null, cdr: ChangeDetectorRef, injector: Injector);
21
+ protected agent: Signal<AbstractAgent | undefined>;
22
+ protected messages: Signal<Message[]>;
23
+ protected isRunning: Signal<boolean>;
24
+ protected showCursor: import("@angular/core").WritableSignal<boolean>;
25
+ private generatedThreadId;
26
+ private agentWatcher?;
27
+ private hasConnectedOnce;
28
+ private lastAgentId?;
29
+ ngOnInit(): void;
30
+ ngOnChanges(changes: SimpleChanges): void;
31
+ private connectToAgent;
32
+ private setupChatHandlers;
33
+ ngOnDestroy(): void;
34
+ private createWatcher;
35
+ static ɵfac: i0.ɵɵFactoryDeclaration<CopilotChatComponent, [{ optional: true; }, null, null]>;
36
+ static ɵcmp: i0.ɵɵComponentDeclaration<CopilotChatComponent, "copilot-chat", never, { "agentId": { "alias": "agentId"; "required": false; }; "threadId": { "alias": "threadId"; "required": false; }; }, {}, never, never, true, never>;
37
+ }
@@ -0,0 +1,25 @@
1
+ import { TemplateRef, OnChanges, SimpleChanges, AfterViewInit } from "@angular/core";
2
+ import { ToolCallStatus } from "../core/copilotkit.types";
3
+ import * as i0 from "@angular/core";
4
+ export declare class CopilotKitToolRenderComponent implements OnChanges, AfterViewInit {
5
+ toolName: string;
6
+ args: any;
7
+ status: ToolCallStatus;
8
+ result?: any;
9
+ description?: string;
10
+ private container;
11
+ private copilotkit;
12
+ private componentRef?;
13
+ templateRef?: TemplateRef<any>;
14
+ templateContext?: any;
15
+ ngAfterViewInit(): void;
16
+ ngOnChanges(changes: SimpleChanges): void;
17
+ private renderTool;
18
+ private renderComponent;
19
+ private renderTemplate;
20
+ private isComponentClass;
21
+ private isTemplateRef;
22
+ ngOnDestroy(): void;
23
+ static ɵfac: i0.ɵɵFactoryDeclaration<CopilotKitToolRenderComponent, never>;
24
+ static ɵcmp: i0.ɵɵComponentDeclaration<CopilotKitToolRenderComponent, "copilotkit-tool-render", never, { "toolName": { "alias": "toolName"; "required": false; }; "args": { "alias": "args"; "required": false; }; "status": { "alias": "status"; "required": false; }; "result": { "alias": "result"; "required": false; }; "description": { "alias": "description"; "required": false; }; }, {}, never, never, true, never>;
25
+ }
@@ -0,0 +1,54 @@
1
+ import { Provider } from '@angular/core';
2
+ import { CopilotChatConfiguration } from './chat-configuration.types';
3
+ /**
4
+ * Provides CopilotKit chat configuration at a specific component level.
5
+ * This allows for scoped configuration where different parts of the app
6
+ * can have different chat configurations.
7
+ *
8
+ * @param config - Optional initial configuration
9
+ * @returns Array of providers
10
+ *
11
+ * @example
12
+ * ```typescript
13
+ * // Global configuration in app.config.ts
14
+ * export const appConfig: ApplicationConfig = {
15
+ * providers: [
16
+ * provideCopilotChatConfiguration({
17
+ * labels: {
18
+ * chatInputPlaceholder: "How can I help you today?"
19
+ * }
20
+ * })
21
+ * ]
22
+ * };
23
+ *
24
+ * // Component-scoped configuration
25
+ * @Component({
26
+ * selector: 'customer-support-chat',
27
+ * providers: [
28
+ * provideCopilotChatConfiguration({
29
+ * labels: {
30
+ * chatInputPlaceholder: "Describe your issue..."
31
+ * },
32
+ * onSubmitInput: (value) => console.log('Support message:', value)
33
+ * })
34
+ * ],
35
+ * template: `...`
36
+ * })
37
+ * export class CustomerSupportChatComponent {}
38
+ *
39
+ * // Multiple independent chats
40
+ * @Component({
41
+ * selector: 'sales-chat',
42
+ * providers: [
43
+ * provideCopilotChatConfiguration({
44
+ * labels: {
45
+ * chatInputPlaceholder: "Ask about our products..."
46
+ * }
47
+ * })
48
+ * ],
49
+ * template: `...`
50
+ * })
51
+ * export class SalesChatComponent {}
52
+ * ```
53
+ */
54
+ export declare function provideCopilotChatConfiguration(config?: CopilotChatConfiguration): Provider[];
@@ -0,0 +1,75 @@
1
+ import { signal } from '@angular/core';
2
+ import { CopilotChatConfiguration, CopilotChatLabels } from './chat-configuration.types';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * Service for managing CopilotKit chat configuration.
6
+ * Can be provided at different component levels for scoped configuration.
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * // Global configuration
11
+ * providers: [provideCopilotChatConfiguration({ labels: { ... } })]
12
+ *
13
+ * // Component-scoped configuration
14
+ * @Component({
15
+ * providers: [provideCopilotChatConfiguration()],
16
+ * ...
17
+ * })
18
+ * ```
19
+ */
20
+ export declare class CopilotChatConfigurationService {
21
+ private readonly initialConfig;
22
+ private readonly _labels;
23
+ private readonly _inputValue;
24
+ private readonly _onSubmitInput;
25
+ private readonly _onChangeInput;
26
+ readonly labels: ReturnType<typeof signal<CopilotChatLabels>>['asReadonly'] extends () => infer R ? R : never;
27
+ readonly inputValue: ReturnType<typeof signal<string | undefined>>['asReadonly'] extends () => infer R ? R : never;
28
+ constructor(initialConfig: CopilotChatConfiguration | null);
29
+ /**
30
+ * Update chat labels (partial update, merged with defaults)
31
+ */
32
+ setLabels(labels: Partial<CopilotChatLabels>): void;
33
+ /**
34
+ * Update the current input value
35
+ */
36
+ setInputValue(value: string | undefined): void;
37
+ /**
38
+ * Set the submit input handler
39
+ */
40
+ setSubmitHandler(handler: ((value: string) => void) | undefined): void;
41
+ /**
42
+ * Set the change input handler
43
+ */
44
+ setChangeHandler(handler: ((value: string) => void) | undefined): void;
45
+ /**
46
+ * Submit the current input value
47
+ */
48
+ submitInput(value: string): void;
49
+ /**
50
+ * Handle input value change
51
+ */
52
+ changeInput(value: string): void;
53
+ /**
54
+ * Update the entire configuration at once
55
+ */
56
+ updateConfiguration(config: CopilotChatConfiguration): void;
57
+ /**
58
+ * Reset configuration to defaults
59
+ */
60
+ reset(): void;
61
+ /**
62
+ * Get the current submit handler
63
+ */
64
+ getSubmitHandler(): ((value: string) => void) | undefined;
65
+ /**
66
+ * Get the current change handler
67
+ */
68
+ getChangeHandler(): ((value: string) => void) | undefined;
69
+ /**
70
+ * Merge partial labels with defaults
71
+ */
72
+ private mergeLabels;
73
+ static ɵfac: i0.ɵɵFactoryDeclaration<CopilotChatConfigurationService, [{ optional: true; }]>;
74
+ static ɵprov: i0.ɵɵInjectableDeclaration<CopilotChatConfigurationService>;
75
+ }
@@ -0,0 +1,27 @@
1
+ import { InjectionToken } from "@angular/core";
2
+ export interface CopilotChatLabels {
3
+ chatInputPlaceholder: string;
4
+ chatInputToolbarStartTranscribeButtonLabel: string;
5
+ chatInputToolbarCancelTranscribeButtonLabel: string;
6
+ chatInputToolbarFinishTranscribeButtonLabel: string;
7
+ chatInputToolbarAddButtonLabel: string;
8
+ chatInputToolbarToolsButtonLabel: string;
9
+ assistantMessageToolbarCopyCodeLabel: string;
10
+ assistantMessageToolbarCopyCodeCopiedLabel: string;
11
+ assistantMessageToolbarCopyMessageLabel: string;
12
+ assistantMessageToolbarThumbsUpLabel: string;
13
+ assistantMessageToolbarThumbsDownLabel: string;
14
+ assistantMessageToolbarReadAloudLabel: string;
15
+ assistantMessageToolbarRegenerateLabel: string;
16
+ userMessageToolbarCopyMessageLabel: string;
17
+ userMessageToolbarEditMessageLabel: string;
18
+ chatDisclaimerText: string;
19
+ }
20
+ export declare const COPILOT_CHAT_DEFAULT_LABELS: CopilotChatLabels;
21
+ export interface CopilotChatConfiguration {
22
+ labels?: Partial<CopilotChatLabels>;
23
+ inputValue?: string;
24
+ onSubmitInput?: (value: string) => void;
25
+ onChangeInput?: (value: string) => void;
26
+ }
27
+ export declare const COPILOT_CHAT_INITIAL_CONFIG: InjectionToken<CopilotChatConfiguration>;
@@ -0,0 +1,13 @@
1
+ import { Provider } from "@angular/core";
2
+ import { ToolCallRender, AngularFrontendTool, AngularHumanInTheLoop } from "./copilotkit.types";
3
+ import { AbstractAgent } from "@ag-ui/client";
4
+ export interface ProvideCopilotKitOptions {
5
+ runtimeUrl?: string;
6
+ headers?: Record<string, string>;
7
+ properties?: Record<string, unknown>;
8
+ agents?: Record<string, AbstractAgent>;
9
+ renderToolCalls?: ToolCallRender<unknown>[];
10
+ frontendTools?: AngularFrontendTool<any>[];
11
+ humanInTheLoop?: AngularHumanInTheLoop<any>[];
12
+ }
13
+ export declare function provideCopilotKit(options?: ProvideCopilotKitOptions): Provider[];