@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,62 @@
|
|
|
1
|
+
import { EventEmitter, OnInit, OnDestroy, AfterViewInit } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export type ScrollBehavior = 'smooth' | 'instant' | 'auto';
|
|
4
|
+
/**
|
|
5
|
+
* Directive for implementing stick-to-bottom scroll behavior
|
|
6
|
+
* Similar to the React use-stick-to-bottom library
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```html
|
|
10
|
+
* <div copilotStickToBottom
|
|
11
|
+
* [enabled]="true"
|
|
12
|
+
* [threshold]="10"
|
|
13
|
+
* [initialBehavior]="'smooth'"
|
|
14
|
+
* [resizeBehavior]="'smooth'"
|
|
15
|
+
* (isAtBottomChange)="onBottomChange($event)">
|
|
16
|
+
* <!-- Content -->
|
|
17
|
+
* </div>
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare class StickToBottomDirective implements OnInit, AfterViewInit, OnDestroy {
|
|
21
|
+
enabled: boolean;
|
|
22
|
+
threshold: number;
|
|
23
|
+
initialBehavior: ScrollBehavior;
|
|
24
|
+
resizeBehavior: ScrollBehavior;
|
|
25
|
+
debounceMs: number;
|
|
26
|
+
isAtBottomChange: EventEmitter<boolean>;
|
|
27
|
+
scrollToBottomRequested: EventEmitter<void>;
|
|
28
|
+
private elementRef;
|
|
29
|
+
private scrollService;
|
|
30
|
+
private resizeService;
|
|
31
|
+
private destroy$;
|
|
32
|
+
private contentElement?;
|
|
33
|
+
private wasAtBottom;
|
|
34
|
+
private hasInitialized;
|
|
35
|
+
private userHasScrolled;
|
|
36
|
+
ngOnInit(): void;
|
|
37
|
+
ngAfterViewInit(): void;
|
|
38
|
+
private setupScrollMonitoring;
|
|
39
|
+
private setupResizeMonitoring;
|
|
40
|
+
private setupContentMutationObserver;
|
|
41
|
+
/**
|
|
42
|
+
* Public method to scroll to bottom
|
|
43
|
+
* Can be called from parent component
|
|
44
|
+
*/
|
|
45
|
+
scrollToBottom(behavior?: ScrollBehavior): void;
|
|
46
|
+
/**
|
|
47
|
+
* Check if currently at bottom
|
|
48
|
+
*/
|
|
49
|
+
isAtBottom(): boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Get current scroll state
|
|
52
|
+
*/
|
|
53
|
+
getScrollState(): {
|
|
54
|
+
scrollTop: any;
|
|
55
|
+
scrollHeight: any;
|
|
56
|
+
clientHeight: any;
|
|
57
|
+
isAtBottom: boolean;
|
|
58
|
+
};
|
|
59
|
+
ngOnDestroy(): void;
|
|
60
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<StickToBottomDirective, never>;
|
|
61
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<StickToBottomDirective, "[copilotStickToBottom]", never, { "enabled": { "alias": "enabled"; "required": false; }; "threshold": { "alias": "threshold"; "required": false; }; "initialBehavior": { "alias": "initialBehavior"; "required": false; }; "resizeBehavior": { "alias": "resizeBehavior"; "required": false; }; "debounceMs": { "alias": "debounceMs"; "required": false; }; }, { "isAtBottomChange": "isAtBottomChange"; "scrollToBottomRequested": "scrollToBottomRequested"; }, never, never, true, never>;
|
|
62
|
+
}
|