@copilotkitnext/angular 0.0.9-alpha.3 → 0.0.10
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/dist/esm2022/index.mjs +2 -70
- package/dist/esm2022/lib/agent.mjs +73 -0
- package/dist/esm2022/lib/chat-config.mjs +35 -0
- package/dist/esm2022/lib/chat-state.mjs +18 -0
- package/dist/esm2022/lib/components/chat/copilot-chat-assistant-message-buttons.mjs +344 -0
- package/dist/esm2022/lib/components/chat/copilot-chat-assistant-message-renderer.mjs +260 -0
- package/dist/esm2022/lib/components/chat/copilot-chat-assistant-message-toolbar.mjs +22 -0
- package/dist/esm2022/{components/chat/copilot-chat-assistant-message.component.mjs → lib/components/chat/copilot-chat-assistant-message.mjs} +216 -240
- package/dist/esm2022/lib/components/chat/copilot-chat-assistant-message.types.mjs +2 -0
- package/dist/esm2022/lib/components/chat/copilot-chat-audio-recorder.mjs +196 -0
- package/dist/esm2022/lib/components/chat/copilot-chat-buttons.mjs +299 -0
- package/dist/esm2022/lib/components/chat/copilot-chat-input-defaults.mjs +39 -0
- package/dist/esm2022/lib/components/chat/copilot-chat-input.mjs +634 -0
- package/dist/esm2022/lib/components/chat/copilot-chat-input.types.mjs +10 -0
- package/dist/esm2022/lib/components/chat/copilot-chat-message-view-cursor.mjs +27 -0
- package/dist/esm2022/lib/components/chat/copilot-chat-message-view.mjs +268 -0
- package/dist/esm2022/lib/components/chat/copilot-chat-message-view.types.mjs +2 -0
- package/dist/esm2022/lib/components/chat/copilot-chat-textarea.mjs +139 -0
- package/dist/esm2022/lib/components/chat/copilot-chat-tool-calls-view.mjs +36 -0
- package/dist/esm2022/lib/components/chat/copilot-chat-toolbar.mjs +20 -0
- package/dist/esm2022/lib/components/chat/copilot-chat-tools-menu.mjs +203 -0
- package/dist/esm2022/lib/components/chat/copilot-chat-user-message-branch-navigation.mjs +118 -0
- package/dist/esm2022/lib/components/chat/copilot-chat-user-message-buttons.mjs +182 -0
- package/dist/esm2022/lib/components/chat/copilot-chat-user-message-renderer.mjs +28 -0
- package/dist/esm2022/lib/components/chat/copilot-chat-user-message-toolbar.mjs +25 -0
- package/dist/esm2022/lib/components/chat/copilot-chat-user-message.mjs +306 -0
- package/dist/esm2022/lib/components/chat/copilot-chat-user-message.types.mjs +2 -0
- package/dist/esm2022/lib/components/chat/copilot-chat-view-disclaimer.mjs +48 -0
- package/dist/esm2022/lib/components/chat/copilot-chat-view-feather.mjs +41 -0
- package/dist/esm2022/lib/components/chat/copilot-chat-view-handlers.mjs +19 -0
- package/dist/esm2022/lib/components/chat/copilot-chat-view-input-container.mjs +96 -0
- package/dist/esm2022/lib/components/chat/copilot-chat-view-scroll-to-bottom-button.mjs +89 -0
- package/dist/esm2022/lib/components/chat/copilot-chat-view-scroll-view.mjs +456 -0
- package/dist/esm2022/lib/components/chat/copilot-chat-view.mjs +404 -0
- package/dist/esm2022/lib/components/chat/copilot-chat-view.types.mjs +2 -0
- package/dist/esm2022/lib/components/chat/copilot-chat.mjs +167 -0
- package/dist/esm2022/lib/config.mjs +9 -0
- package/dist/esm2022/lib/copilotkit.mjs +124 -0
- package/dist/esm2022/lib/directives/copilotkit-agent-context.mjs +130 -0
- package/dist/esm2022/lib/directives/stick-to-bottom.mjs +170 -0
- package/dist/esm2022/lib/directives/tooltip.mjs +217 -0
- package/dist/esm2022/lib/human-in-the-loop.mjs +19 -0
- package/dist/esm2022/lib/render-tool-calls.mjs +131 -0
- package/dist/esm2022/lib/resize-observer.mjs +152 -0
- package/dist/esm2022/lib/scroll-position.mjs +124 -0
- package/dist/esm2022/lib/slots/copilot-slot.mjs +156 -0
- package/dist/esm2022/lib/slots/index.mjs +4 -0
- package/dist/esm2022/lib/slots/slot.types.mjs +3 -3
- package/dist/esm2022/lib/slots/slot.utils.mjs +19 -15
- package/dist/esm2022/lib/tools.mjs +31 -0
- package/dist/esm2022/lib/utils.mjs +3 -3
- package/dist/esm2022/public-api.mjs +47 -0
- package/dist/fesm2022/copilotkitnext-angular.mjs +5249 -8271
- package/dist/fesm2022/copilotkitnext-angular.mjs.map +1 -1
- package/dist/index.d.ts +1 -55
- package/dist/lib/agent.d.ts +53 -0
- package/dist/{core/chat-configuration/chat-configuration.types.d.ts → lib/chat-config.d.ts} +4 -8
- package/dist/lib/chat-state.d.ts +10 -0
- package/dist/lib/components/chat/copilot-chat-assistant-message-buttons.d.ts +68 -0
- package/dist/lib/components/chat/copilot-chat-assistant-message-renderer.d.ts +26 -0
- package/dist/lib/components/chat/copilot-chat-assistant-message-toolbar.d.ts +7 -0
- package/dist/lib/components/chat/copilot-chat-assistant-message.d.ts +178 -0
- package/dist/{components → lib/components}/chat/copilot-chat-assistant-message.types.d.ts +1 -1
- package/dist/{components/chat/copilot-chat-audio-recorder.component.d.ts → lib/components/chat/copilot-chat-audio-recorder.d.ts} +10 -10
- package/dist/lib/components/chat/copilot-chat-buttons.d.ts +65 -0
- package/dist/lib/components/chat/copilot-chat-input-defaults.d.ts +38 -0
- package/dist/lib/components/chat/copilot-chat-input.d.ts +133 -0
- package/dist/{components → lib/components}/chat/copilot-chat-input.types.d.ts +11 -11
- package/dist/lib/components/chat/copilot-chat-message-view-cursor.d.ts +11 -0
- package/dist/{components/chat/copilot-chat-message-view.component.d.ts → lib/components/chat/copilot-chat-message-view.d.ts} +68 -36
- package/dist/{components → lib/components}/chat/copilot-chat-message-view.types.d.ts +2 -2
- package/dist/lib/components/chat/copilot-chat-textarea.d.ts +41 -0
- package/dist/lib/components/chat/copilot-chat-tool-calls-view.d.ts +55 -0
- package/dist/lib/components/chat/copilot-chat-toolbar.d.ts +7 -0
- package/dist/lib/components/chat/copilot-chat-tools-menu.d.ts +20 -0
- package/dist/lib/components/chat/copilot-chat-user-message-branch-navigation.d.ts +20 -0
- package/dist/lib/components/chat/copilot-chat-user-message-buttons.d.ts +35 -0
- package/dist/lib/components/chat/copilot-chat-user-message-renderer.d.ts +8 -0
- package/dist/lib/components/chat/copilot-chat-user-message-toolbar.d.ts +7 -0
- package/dist/lib/components/chat/copilot-chat-user-message.d.ts +55 -0
- package/dist/{components → lib/components}/chat/copilot-chat-user-message.types.d.ts +2 -2
- package/dist/lib/components/chat/copilot-chat-view-disclaimer.d.ts +15 -0
- package/dist/{components/chat/copilot-chat-view-feather.component.d.ts → lib/components/chat/copilot-chat-view-feather.d.ts} +6 -6
- package/dist/{components/chat/copilot-chat-view-handlers.service.d.ts → lib/components/chat/copilot-chat-view-handlers.d.ts} +3 -3
- package/dist/lib/components/chat/copilot-chat-view-input-container.d.ts +23 -0
- package/dist/lib/components/chat/copilot-chat-view-scroll-to-bottom-button.d.ts +16 -0
- package/dist/lib/components/chat/copilot-chat-view-scroll-view.d.ts +114 -0
- package/dist/lib/components/chat/copilot-chat-view.d.ts +239 -0
- package/dist/{components → lib/components}/chat/copilot-chat-view.types.d.ts +2 -2
- package/dist/lib/components/chat/copilot-chat.d.ts +67 -0
- package/dist/lib/config.d.ts +16 -0
- package/dist/lib/copilotkit.d.ts +29 -0
- package/dist/{directives/copilotkit-agent-context.directive.d.ts → lib/directives/copilotkit-agent-context.d.ts} +5 -5
- package/dist/lib/directives/stick-to-bottom.d.ts +62 -0
- package/dist/lib/directives/tooltip.d.ts +33 -0
- package/dist/lib/human-in-the-loop.d.ts +13 -0
- package/dist/lib/render-tool-calls.d.ts +75 -0
- package/dist/{services/resize-observer.service.d.ts → lib/resize-observer.d.ts} +2 -2
- package/dist/{services/scroll-position.service.d.ts → lib/scroll-position.d.ts} +6 -6
- package/dist/lib/slots/copilot-slot.d.ts +34 -0
- package/dist/lib/slots/index.d.ts +3 -0
- package/dist/lib/slots/slot.types.d.ts +1 -1
- package/dist/lib/slots/slot.utils.d.ts +6 -4
- package/dist/lib/tools.d.ts +63 -0
- package/dist/lib/utils.d.ts +1 -1
- package/dist/public-api.d.ts +46 -0
- package/dist/styles.css +0 -69
- package/package.json +3 -3
- package/dist/components/chat/copilot-chat-assistant-message-buttons.component.d.ts +0 -75
- package/dist/components/chat/copilot-chat-assistant-message-renderer.component.d.ts +0 -31
- package/dist/components/chat/copilot-chat-assistant-message-toolbar.component.d.ts +0 -8
- package/dist/components/chat/copilot-chat-assistant-message.component.d.ts +0 -132
- package/dist/components/chat/copilot-chat-buttons.component.d.ts +0 -66
- package/dist/components/chat/copilot-chat-input-defaults.d.ts +0 -37
- package/dist/components/chat/copilot-chat-input.component.d.ts +0 -133
- package/dist/components/chat/copilot-chat-message-view-cursor.component.d.ts +0 -15
- package/dist/components/chat/copilot-chat-textarea.component.d.ts +0 -45
- package/dist/components/chat/copilot-chat-tool-calls-view.component.d.ts +0 -35
- package/dist/components/chat/copilot-chat-toolbar.component.d.ts +0 -8
- package/dist/components/chat/copilot-chat-tools-menu.component.d.ts +0 -20
- package/dist/components/chat/copilot-chat-user-message-branch-navigation.component.d.ts +0 -23
- package/dist/components/chat/copilot-chat-user-message-buttons.component.d.ts +0 -39
- package/dist/components/chat/copilot-chat-user-message-renderer.component.d.ts +0 -9
- package/dist/components/chat/copilot-chat-user-message-toolbar.component.d.ts +0 -8
- package/dist/components/chat/copilot-chat-user-message.component.d.ts +0 -55
- package/dist/components/chat/copilot-chat-view-disclaimer.component.d.ts +0 -15
- package/dist/components/chat/copilot-chat-view-input-container.component.d.ts +0 -23
- package/dist/components/chat/copilot-chat-view-scroll-to-bottom-button.component.d.ts +0 -17
- package/dist/components/chat/copilot-chat-view-scroll-view.component.d.ts +0 -84
- package/dist/components/chat/copilot-chat-view.component.d.ts +0 -205
- package/dist/components/chat/copilot-chat.component.d.ts +0 -36
- package/dist/components/copilotkit-tool-render.component.d.ts +0 -25
- package/dist/core/chat-configuration/chat-configuration.providers.d.ts +0 -54
- package/dist/core/chat-configuration/chat-configuration.service.d.ts +0 -75
- package/dist/core/copilotkit.providers.d.ts +0 -13
- package/dist/core/copilotkit.service.d.ts +0 -119
- package/dist/core/copilotkit.types.d.ts +0 -81
- package/dist/directives/copilotkit-agent.directive.d.ts +0 -106
- package/dist/directives/copilotkit-chat-config.directive.d.ts +0 -84
- package/dist/directives/copilotkit-config.directive.d.ts +0 -44
- package/dist/directives/copilotkit-frontend-tool.directive.d.ts +0 -25
- package/dist/directives/copilotkit-human-in-the-loop.directive.d.ts +0 -124
- package/dist/directives/stick-to-bottom.directive.d.ts +0 -62
- package/dist/esm2022/components/chat/copilot-chat-assistant-message-buttons.component.mjs +0 -384
- package/dist/esm2022/components/chat/copilot-chat-assistant-message-renderer.component.mjs +0 -286
- package/dist/esm2022/components/chat/copilot-chat-assistant-message-toolbar.component.mjs +0 -27
- package/dist/esm2022/components/chat/copilot-chat-assistant-message.types.mjs +0 -2
- package/dist/esm2022/components/chat/copilot-chat-audio-recorder.component.mjs +0 -202
- package/dist/esm2022/components/chat/copilot-chat-buttons.component.mjs +0 -321
- package/dist/esm2022/components/chat/copilot-chat-input-defaults.mjs +0 -38
- package/dist/esm2022/components/chat/copilot-chat-input.component.mjs +0 -666
- package/dist/esm2022/components/chat/copilot-chat-input.types.mjs +0 -10
- package/dist/esm2022/components/chat/copilot-chat-message-view-cursor.component.mjs +0 -45
- package/dist/esm2022/components/chat/copilot-chat-message-view.component.mjs +0 -296
- package/dist/esm2022/components/chat/copilot-chat-message-view.types.mjs +0 -2
- package/dist/esm2022/components/chat/copilot-chat-textarea.component.mjs +0 -188
- package/dist/esm2022/components/chat/copilot-chat-tool-calls-view.component.mjs +0 -222
- package/dist/esm2022/components/chat/copilot-chat-toolbar.component.mjs +0 -25
- package/dist/esm2022/components/chat/copilot-chat-tools-menu.component.mjs +0 -199
- package/dist/esm2022/components/chat/copilot-chat-user-message-branch-navigation.component.mjs +0 -137
- package/dist/esm2022/components/chat/copilot-chat-user-message-buttons.component.mjs +0 -207
- package/dist/esm2022/components/chat/copilot-chat-user-message-renderer.component.mjs +0 -35
- package/dist/esm2022/components/chat/copilot-chat-user-message-toolbar.component.mjs +0 -34
- package/dist/esm2022/components/chat/copilot-chat-user-message.component.mjs +0 -341
- package/dist/esm2022/components/chat/copilot-chat-user-message.types.mjs +0 -2
- package/dist/esm2022/components/chat/copilot-chat-view-disclaimer.component.mjs +0 -52
- package/dist/esm2022/components/chat/copilot-chat-view-feather.component.mjs +0 -55
- package/dist/esm2022/components/chat/copilot-chat-view-handlers.service.mjs +0 -19
- package/dist/esm2022/components/chat/copilot-chat-view-input-container.component.mjs +0 -110
- package/dist/esm2022/components/chat/copilot-chat-view-scroll-to-bottom-button.component.mjs +0 -93
- package/dist/esm2022/components/chat/copilot-chat-view-scroll-view.component.mjs +0 -443
- package/dist/esm2022/components/chat/copilot-chat-view.component.mjs +0 -479
- package/dist/esm2022/components/chat/copilot-chat-view.types.mjs +0 -2
- package/dist/esm2022/components/chat/copilot-chat.component.mjs +0 -220
- package/dist/esm2022/components/copilotkit-tool-render.component.mjs +0 -150
- package/dist/esm2022/core/chat-configuration/chat-configuration.providers.mjs +0 -65
- package/dist/esm2022/core/chat-configuration/chat-configuration.service.mjs +0 -145
- package/dist/esm2022/core/chat-configuration/chat-configuration.types.mjs +0 -26
- package/dist/esm2022/core/copilotkit.providers.mjs +0 -34
- package/dist/esm2022/core/copilotkit.service.mjs +0 -411
- package/dist/esm2022/core/copilotkit.types.mjs +0 -13
- package/dist/esm2022/directives/copilotkit-agent-context.directive.mjs +0 -130
- package/dist/esm2022/directives/copilotkit-agent.directive.mjs +0 -221
- package/dist/esm2022/directives/copilotkit-chat-config.directive.mjs +0 -218
- package/dist/esm2022/directives/copilotkit-config.directive.mjs +0 -94
- package/dist/esm2022/directives/copilotkit-frontend-tool.directive.mjs +0 -128
- package/dist/esm2022/directives/copilotkit-human-in-the-loop.directive.mjs +0 -265
- package/dist/esm2022/directives/stick-to-bottom.directive.mjs +0 -181
- package/dist/esm2022/lib/directives/tooltip.directive.mjs +0 -211
- package/dist/esm2022/lib/slots/copilot-slot.component.mjs +0 -154
- package/dist/esm2022/services/resize-observer.service.mjs +0 -152
- package/dist/esm2022/services/scroll-position.service.mjs +0 -124
- package/dist/esm2022/types/frontend-tool.mjs +0 -2
- package/dist/esm2022/types/human-in-the-loop.mjs +0 -2
- package/dist/esm2022/utils/agent-context.utils.mjs +0 -114
- package/dist/esm2022/utils/agent.utils.mjs +0 -212
- package/dist/esm2022/utils/chat-config.utils.mjs +0 -186
- package/dist/esm2022/utils/copilotkit.utils.mjs +0 -20
- package/dist/esm2022/utils/frontend-tool.utils.mjs +0 -224
- package/dist/esm2022/utils/human-in-the-loop.utils.mjs +0 -293
- package/dist/lib/directives/tooltip.directive.d.ts +0 -33
- package/dist/lib/slots/copilot-slot.component.d.ts +0 -34
- package/dist/types/frontend-tool.d.ts +0 -37
- package/dist/types/human-in-the-loop.d.ts +0 -44
- package/dist/utils/agent-context.utils.d.ts +0 -75
- package/dist/utils/agent.utils.d.ts +0 -108
- package/dist/utils/chat-config.utils.d.ts +0 -166
- package/dist/utils/copilotkit.utils.d.ts +0 -16
- package/dist/utils/frontend-tool.utils.d.ts +0 -119
- package/dist/utils/human-in-the-loop.utils.d.ts +0 -92
|
@@ -1,75 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
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[];
|
|
10
|
-
frontendTools?: AngularFrontendTool<any>[];
|
|
11
|
-
humanInTheLoop?: AngularHumanInTheLoop<any>[];
|
|
12
|
-
}
|
|
13
|
-
export declare function provideCopilotKit(options?: ProvideCopilotKitOptions): Provider[];
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import { ToolCallRender, AngularFrontendTool, AngularHumanInTheLoop } from "./copilotkit.types";
|
|
2
|
-
import { CopilotKitCore } from "@copilotkitnext/core";
|
|
3
|
-
import { AbstractAgent } from "@ag-ui/client";
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
/**
|
|
6
|
-
* Angular service for managing CopilotKit state and interactions.
|
|
7
|
-
* Provides reactive state management using Angular signals and observables.
|
|
8
|
-
*/
|
|
9
|
-
export declare class CopilotKitService {
|
|
10
|
-
private readonly initialFrontendTools;
|
|
11
|
-
private readonly initialHumanInTheLoop;
|
|
12
|
-
private readonly initialRenderToolCalls;
|
|
13
|
-
readonly copilotkit: CopilotKitCore;
|
|
14
|
-
private readonly _renderToolCalls;
|
|
15
|
-
private readonly _currentRenderToolCalls;
|
|
16
|
-
private readonly _runtimeUrl;
|
|
17
|
-
private readonly _headers;
|
|
18
|
-
private readonly _properties;
|
|
19
|
-
private readonly _agents;
|
|
20
|
-
private readonly _frontendTools;
|
|
21
|
-
private readonly _humanInTheLoop;
|
|
22
|
-
private readonly _runtimeStateVersion;
|
|
23
|
-
private readonly _allTools;
|
|
24
|
-
private readonly _allRenderToolCalls;
|
|
25
|
-
readonly renderToolCalls: any;
|
|
26
|
-
readonly currentRenderToolCalls: any;
|
|
27
|
-
readonly runtimeUrl: any;
|
|
28
|
-
readonly headers: any;
|
|
29
|
-
readonly properties: any;
|
|
30
|
-
readonly agents: any;
|
|
31
|
-
readonly frontendTools: any;
|
|
32
|
-
readonly humanInTheLoop: any;
|
|
33
|
-
readonly runtimeStateVersion: any;
|
|
34
|
-
readonly renderToolCalls$: any;
|
|
35
|
-
readonly currentRenderToolCalls$: any;
|
|
36
|
-
readonly runtimeUrl$: any;
|
|
37
|
-
readonly headers$: any;
|
|
38
|
-
readonly properties$: any;
|
|
39
|
-
readonly agents$: any;
|
|
40
|
-
readonly frontendTools$: any;
|
|
41
|
-
readonly humanInTheLoop$: any;
|
|
42
|
-
readonly context: any;
|
|
43
|
-
readonly context$: any;
|
|
44
|
-
constructor(runtimeUrl: string | undefined, headers: Record<string, string>, properties: Record<string, unknown>, agents: Record<string, AbstractAgent>, renderToolCalls: ToolCallRender[], frontendTools: AngularFrontendTool<any>[], humanInTheLoop: AngularHumanInTheLoop<any>[]);
|
|
45
|
-
/**
|
|
46
|
-
* Process frontend tools and human-in-the-loop tools
|
|
47
|
-
*/
|
|
48
|
-
private processTools;
|
|
49
|
-
/**
|
|
50
|
-
* Setup stability warning effects
|
|
51
|
-
*/
|
|
52
|
-
private setupStabilityWarnings;
|
|
53
|
-
/**
|
|
54
|
-
* Setup effects to sync runtime configuration with CopilotKitCore
|
|
55
|
-
*/
|
|
56
|
-
private setupRuntimeSyncEffects;
|
|
57
|
-
/**
|
|
58
|
-
* Subscribe to CopilotKit runtime events
|
|
59
|
-
*/
|
|
60
|
-
private setupEventSubscription;
|
|
61
|
-
/**
|
|
62
|
-
* Notify consumers that the runtime state has changed.
|
|
63
|
-
* This is similar to React's forceUpdate - it triggers change detection
|
|
64
|
-
* for any computed signals or effects that depend on runtime state.
|
|
65
|
-
*/
|
|
66
|
-
private notifyRuntimeStateChange;
|
|
67
|
-
/**
|
|
68
|
-
* Update the runtime URL
|
|
69
|
-
*/
|
|
70
|
-
setRuntimeUrl(url?: string): void;
|
|
71
|
-
/**
|
|
72
|
-
* Update request headers
|
|
73
|
-
*/
|
|
74
|
-
setHeaders(headers: Record<string, string>): void;
|
|
75
|
-
/**
|
|
76
|
-
* Update runtime properties
|
|
77
|
-
*/
|
|
78
|
-
setProperties(properties: Record<string, unknown>): void;
|
|
79
|
-
/**
|
|
80
|
-
* Update agents configuration
|
|
81
|
-
*/
|
|
82
|
-
setAgents(agents: Record<string, AbstractAgent>): void;
|
|
83
|
-
/**
|
|
84
|
-
* Get an agent by ID
|
|
85
|
-
* @param agentId - The agent ID to retrieve
|
|
86
|
-
* @returns The agent or undefined if not found
|
|
87
|
-
*/
|
|
88
|
-
getAgent(agentId: string): AbstractAgent | undefined;
|
|
89
|
-
/**
|
|
90
|
-
* Update render tool calls (warns if object reference changes)
|
|
91
|
-
*/
|
|
92
|
-
setRenderToolCalls(renderToolCalls: ToolCallRender[]): void;
|
|
93
|
-
/**
|
|
94
|
-
* Update frontend tools array
|
|
95
|
-
*/
|
|
96
|
-
setFrontendTools(frontendTools: AngularFrontendTool<any>[]): void;
|
|
97
|
-
/**
|
|
98
|
-
* Update human-in-the-loop array
|
|
99
|
-
*/
|
|
100
|
-
setHumanInTheLoop(humanInTheLoop: AngularHumanInTheLoop<any>[]): void;
|
|
101
|
-
/**
|
|
102
|
-
* Update current render tool calls
|
|
103
|
-
*/
|
|
104
|
-
setCurrentRenderToolCalls(renderToolCalls: ToolCallRender[]): void;
|
|
105
|
-
/**
|
|
106
|
-
* Register a tool render
|
|
107
|
-
*/
|
|
108
|
-
registerToolRender(name: string, render: ToolCallRender): void;
|
|
109
|
-
/**
|
|
110
|
-
* Unregister a tool render
|
|
111
|
-
*/
|
|
112
|
-
unregisterToolRender(name: string): void;
|
|
113
|
-
/**
|
|
114
|
-
* Get a specific tool render
|
|
115
|
-
*/
|
|
116
|
-
getToolRender(name: string): ToolCallRender | undefined;
|
|
117
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<CopilotKitService, never>;
|
|
118
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<CopilotKitService>;
|
|
119
|
-
}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { InjectionToken, TemplateRef, Type, Signal } from "@angular/core";
|
|
2
|
-
import { Observable } from "rxjs";
|
|
3
|
-
import { CopilotKitCore, ToolCallStatus } from "@copilotkitnext/core";
|
|
4
|
-
import { AbstractAgent } from "@ag-ui/client";
|
|
5
|
-
import type { AngularFrontendTool } from "../types/frontend-tool";
|
|
6
|
-
import type { AngularHumanInTheLoop } from "../types/human-in-the-loop";
|
|
7
|
-
export type { Context } from "@ag-ui/client";
|
|
8
|
-
export type { AngularFrontendTool } from "../types/frontend-tool";
|
|
9
|
-
export type { AngularHumanInTheLoop, HumanInTheLoopProps, } from "../types/human-in-the-loop";
|
|
10
|
-
export { ToolCallStatus } from "@copilotkitnext/core";
|
|
11
|
-
export type ToolCallProps<T = unknown> = {
|
|
12
|
-
name: string;
|
|
13
|
-
description: string;
|
|
14
|
-
args: Partial<T>;
|
|
15
|
-
status: ToolCallStatus.InProgress;
|
|
16
|
-
result: undefined;
|
|
17
|
-
} | {
|
|
18
|
-
name: string;
|
|
19
|
-
description: string;
|
|
20
|
-
args: T;
|
|
21
|
-
status: ToolCallStatus.Executing;
|
|
22
|
-
result: undefined;
|
|
23
|
-
} | {
|
|
24
|
-
name: string;
|
|
25
|
-
description: string;
|
|
26
|
-
args: T;
|
|
27
|
-
status: ToolCallStatus.Complete;
|
|
28
|
-
result: string;
|
|
29
|
-
};
|
|
30
|
-
export interface AngularToolCallRender {
|
|
31
|
-
name: string;
|
|
32
|
-
/**
|
|
33
|
-
* Optional agent ID to constrain this tool render to a specific agent.
|
|
34
|
-
* If specified, this render will only be used for the specified agent.
|
|
35
|
-
*/
|
|
36
|
-
agentId?: string;
|
|
37
|
-
render: Type<any> | TemplateRef<ToolCallProps<any>>;
|
|
38
|
-
}
|
|
39
|
-
export type ToolCallRender = AngularToolCallRender;
|
|
40
|
-
export interface CopilotKitContextValue {
|
|
41
|
-
copilotkit: CopilotKitCore;
|
|
42
|
-
renderToolCalls: ToolCallRender[];
|
|
43
|
-
currentRenderToolCalls: ToolCallRender[];
|
|
44
|
-
setCurrentRenderToolCalls: (v: ToolCallRender[]) => void;
|
|
45
|
-
}
|
|
46
|
-
export interface CopilotKitRuntimeInputs {
|
|
47
|
-
runtimeUrl?: string;
|
|
48
|
-
headers?: Record<string, string>;
|
|
49
|
-
properties?: Record<string, unknown>;
|
|
50
|
-
agents?: Record<string, AbstractAgent>;
|
|
51
|
-
renderToolCalls?: ToolCallRender[];
|
|
52
|
-
}
|
|
53
|
-
export declare const COPILOTKIT_RUNTIME_URL: InjectionToken<string>;
|
|
54
|
-
export declare const COPILOTKIT_HEADERS: InjectionToken<Record<string, string>>;
|
|
55
|
-
export declare const COPILOTKIT_PROPERTIES: InjectionToken<Record<string, unknown>>;
|
|
56
|
-
export declare const COPILOTKIT_AGENTS: InjectionToken<Record<string, AbstractAgent>>;
|
|
57
|
-
export declare const COPILOTKIT_RENDER_TOOL_CALLS: InjectionToken<AngularToolCallRender[]>;
|
|
58
|
-
export declare const COPILOTKIT_FRONTEND_TOOLS: InjectionToken<AngularFrontendTool<any>[]>;
|
|
59
|
-
export declare const COPILOTKIT_HUMAN_IN_THE_LOOP: InjectionToken<AngularHumanInTheLoop<any>[]>;
|
|
60
|
-
import type { Message } from "@ag-ui/client";
|
|
61
|
-
export interface AgentWatchResult {
|
|
62
|
-
agent: Signal<AbstractAgent | undefined>;
|
|
63
|
-
messages: Signal<Message[]>;
|
|
64
|
-
isRunning: Signal<boolean>;
|
|
65
|
-
agent$: Observable<AbstractAgent | undefined>;
|
|
66
|
-
messages$: Observable<Message[]>;
|
|
67
|
-
isRunning$: Observable<boolean>;
|
|
68
|
-
unsubscribe: () => void;
|
|
69
|
-
}
|
|
70
|
-
export interface AgentSubscriptionCallbacks {
|
|
71
|
-
onMessagesChanged?: (params: any) => void;
|
|
72
|
-
onStateChanged?: (params: any) => void;
|
|
73
|
-
onRunInitialized?: (params: any) => void;
|
|
74
|
-
onRunFinalized?: (params: any) => void;
|
|
75
|
-
onRunFailed?: (params: any) => void;
|
|
76
|
-
}
|
|
77
|
-
export interface HumanInTheLoopState {
|
|
78
|
-
status: Signal<ToolCallStatus>;
|
|
79
|
-
toolId: string;
|
|
80
|
-
destroy: () => void;
|
|
81
|
-
}
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import { EventEmitter, OnInit, OnChanges, OnDestroy, SimpleChanges } from "@angular/core";
|
|
2
|
-
import { Observable } from "rxjs";
|
|
3
|
-
import { CopilotKitService } from "../core/copilotkit.service";
|
|
4
|
-
import { AbstractAgent } from "@ag-ui/client";
|
|
5
|
-
import * as i0 from "@angular/core";
|
|
6
|
-
/**
|
|
7
|
-
* Directive to watch and interact with CopilotKit agents.
|
|
8
|
-
* Provides reactive outputs for agent state changes.
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```html
|
|
12
|
-
* <!-- Basic usage with default agent -->
|
|
13
|
-
* <div copilotkitAgent
|
|
14
|
-
* (agentChange)="onAgentChange($event)"
|
|
15
|
-
* (runningChange)="isProcessing = $event">
|
|
16
|
-
* Content here
|
|
17
|
-
* </div>
|
|
18
|
-
*
|
|
19
|
-
* <!-- With specific agent ID -->
|
|
20
|
-
* <div copilotkitAgent
|
|
21
|
-
* [agentId]="'my-agent-id'"
|
|
22
|
-
* (agentChange)="currentAgent = $event"
|
|
23
|
-
* (runningChange)="onRunningStateChange($event)"
|
|
24
|
-
* (messagesChange)="onMessagesUpdate($event)"
|
|
25
|
-
* (stateChange)="onStateUpdate($event)">
|
|
26
|
-
* Content here
|
|
27
|
-
* </div>
|
|
28
|
-
*
|
|
29
|
-
* <!-- Two-way binding for running state -->
|
|
30
|
-
* <div copilotkitAgent
|
|
31
|
-
* [(running)]="isAgentRunning">
|
|
32
|
-
* <span *ngIf="isAgentRunning">Processing...</span>
|
|
33
|
-
* </div>
|
|
34
|
-
* ```
|
|
35
|
-
*/
|
|
36
|
-
export declare class CopilotKitAgentDirective implements OnInit, OnChanges, OnDestroy {
|
|
37
|
-
private readonly copilotkit;
|
|
38
|
-
private agent?;
|
|
39
|
-
private agentSubscription?;
|
|
40
|
-
private coreUnsubscribe?;
|
|
41
|
-
private _isRunning;
|
|
42
|
-
private runningSignal;
|
|
43
|
-
private agentSignal;
|
|
44
|
-
constructor(copilotkit: CopilotKitService);
|
|
45
|
-
/**
|
|
46
|
-
* The ID of the agent to watch.
|
|
47
|
-
* If not provided, uses the default agent ID.
|
|
48
|
-
*/
|
|
49
|
-
agentId?: string;
|
|
50
|
-
/**
|
|
51
|
-
* Alternative input using the directive selector.
|
|
52
|
-
* Allows: [copilotkitAgent]="'agent-id'"
|
|
53
|
-
*/
|
|
54
|
-
set directiveAgentId(value: string | undefined);
|
|
55
|
-
/**
|
|
56
|
-
* Emits when the agent instance changes.
|
|
57
|
-
*/
|
|
58
|
-
agentChange: EventEmitter<AbstractAgent>;
|
|
59
|
-
/**
|
|
60
|
-
* Emits when the running state changes.
|
|
61
|
-
*/
|
|
62
|
-
runningChange: EventEmitter<boolean>;
|
|
63
|
-
/**
|
|
64
|
-
* Observable of the running state.
|
|
65
|
-
*/
|
|
66
|
-
get running$(): Observable<boolean>;
|
|
67
|
-
/**
|
|
68
|
-
* Observable of the agent instance.
|
|
69
|
-
*/
|
|
70
|
-
get agent$(): Observable<AbstractAgent | undefined>;
|
|
71
|
-
/**
|
|
72
|
-
* Two-way binding for running state.
|
|
73
|
-
*/
|
|
74
|
-
get running(): boolean;
|
|
75
|
-
set running(value: boolean);
|
|
76
|
-
/**
|
|
77
|
-
* Emits when agent messages change.
|
|
78
|
-
*/
|
|
79
|
-
messagesChange: EventEmitter<any>;
|
|
80
|
-
/**
|
|
81
|
-
* Emits when agent state changes.
|
|
82
|
-
*/
|
|
83
|
-
stateChange: EventEmitter<any>;
|
|
84
|
-
/**
|
|
85
|
-
* Emits when a run is initialized.
|
|
86
|
-
*/
|
|
87
|
-
runInitialized: EventEmitter<any>;
|
|
88
|
-
/**
|
|
89
|
-
* Emits when a run is finalized.
|
|
90
|
-
*/
|
|
91
|
-
runFinalized: EventEmitter<any>;
|
|
92
|
-
/**
|
|
93
|
-
* Emits when a run fails.
|
|
94
|
-
*/
|
|
95
|
-
runFailed: EventEmitter<any>;
|
|
96
|
-
ngOnInit(): void;
|
|
97
|
-
ngOnChanges(changes: SimpleChanges): void;
|
|
98
|
-
ngOnDestroy(): void;
|
|
99
|
-
private setupAgent;
|
|
100
|
-
private subscribeToAgent;
|
|
101
|
-
private subscribeToCore;
|
|
102
|
-
private cleanupAgentSubscription;
|
|
103
|
-
private cleanupCoreSubscription;
|
|
104
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<CopilotKitAgentDirective, never>;
|
|
105
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<CopilotKitAgentDirective, "[copilotkitAgent]", never, { "agentId": { "alias": "agentId"; "required": false; }; "directiveAgentId": { "alias": "copilotkitAgent"; "required": false; }; "running": { "alias": "running"; "required": false; }; }, { "agentChange": "agentChange"; "runningChange": "runningChange"; "messagesChange": "messagesChange"; "stateChange": "stateChange"; "runInitialized": "runInitialized"; "runFinalized": "runFinalized"; "runFailed": "runFailed"; }, never, never, true, never>;
|
|
106
|
-
}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { EventEmitter, OnInit, OnChanges, OnDestroy, SimpleChanges } from "@angular/core";
|
|
2
|
-
import { CopilotChatConfigurationService } from "../core/chat-configuration/chat-configuration.service";
|
|
3
|
-
import { CopilotChatConfiguration, CopilotChatLabels } from "../core/chat-configuration/chat-configuration.types";
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
/**
|
|
6
|
-
* Directive for configuring CopilotKit chat settings declaratively in templates.
|
|
7
|
-
* Works with the CopilotChatConfigurationService to provide reactive chat configuration.
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```html
|
|
11
|
-
* <!-- Basic usage with individual inputs -->
|
|
12
|
-
* <div copilotkitChatConfig
|
|
13
|
-
* [labels]="customLabels"
|
|
14
|
-
* [inputValue]="currentInput"
|
|
15
|
-
* (submitInput)="onSubmit($event)"
|
|
16
|
-
* (changeInput)="onChange($event)">
|
|
17
|
-
* <!-- Chat UI components -->
|
|
18
|
-
* </div>
|
|
19
|
-
*
|
|
20
|
-
* <!-- Using configuration object -->
|
|
21
|
-
* <div [copilotkitChatConfig]="chatConfig">
|
|
22
|
-
* <!-- Chat UI components -->
|
|
23
|
-
* </div>
|
|
24
|
-
*
|
|
25
|
-
* <!-- Two-way binding for input value -->
|
|
26
|
-
* <div copilotkitChatConfig
|
|
27
|
-
* [(value)]="chatInput"
|
|
28
|
-
* (submitInput)="handleSubmit($event)">
|
|
29
|
-
* <!-- Chat UI components -->
|
|
30
|
-
* </div>
|
|
31
|
-
* ```
|
|
32
|
-
*/
|
|
33
|
-
export declare class CopilotKitChatConfigDirective implements OnInit, OnChanges, OnDestroy {
|
|
34
|
-
private readonly chatConfig;
|
|
35
|
-
private _value?;
|
|
36
|
-
private submitHandler?;
|
|
37
|
-
private changeHandler?;
|
|
38
|
-
constructor(chatConfig: CopilotChatConfigurationService | null);
|
|
39
|
-
/**
|
|
40
|
-
* Partial labels to override defaults
|
|
41
|
-
*/
|
|
42
|
-
labels?: Partial<CopilotChatLabels>;
|
|
43
|
-
/**
|
|
44
|
-
* The current input value
|
|
45
|
-
*/
|
|
46
|
-
inputValue?: string;
|
|
47
|
-
/**
|
|
48
|
-
* Event emitted when input is submitted
|
|
49
|
-
*/
|
|
50
|
-
submitInput: EventEmitter<string>;
|
|
51
|
-
/**
|
|
52
|
-
* Event emitted when input value changes
|
|
53
|
-
*/
|
|
54
|
-
changeInput: EventEmitter<string>;
|
|
55
|
-
/**
|
|
56
|
-
* Alternative: accept full configuration object
|
|
57
|
-
*/
|
|
58
|
-
set config(value: CopilotChatConfiguration | undefined);
|
|
59
|
-
/**
|
|
60
|
-
* Two-way binding for input value
|
|
61
|
-
*/
|
|
62
|
-
get value(): string | undefined;
|
|
63
|
-
set value(v: string | undefined);
|
|
64
|
-
/**
|
|
65
|
-
* Two-way binding output for value
|
|
66
|
-
*/
|
|
67
|
-
valueChange: EventEmitter<string>;
|
|
68
|
-
ngOnInit(): void;
|
|
69
|
-
ngOnChanges(changes: SimpleChanges): void;
|
|
70
|
-
ngOnDestroy(): void;
|
|
71
|
-
/**
|
|
72
|
-
* Submit the current input value
|
|
73
|
-
*/
|
|
74
|
-
submit(value: string): void;
|
|
75
|
-
/**
|
|
76
|
-
* Handle input value change
|
|
77
|
-
*/
|
|
78
|
-
change(value: string): void;
|
|
79
|
-
private updateConfiguration;
|
|
80
|
-
private updateInputValue;
|
|
81
|
-
private setupHandlers;
|
|
82
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<CopilotKitChatConfigDirective, [{ optional: true; }]>;
|
|
83
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<CopilotKitChatConfigDirective, "[copilotkitChatConfig]", never, { "labels": { "alias": "labels"; "required": false; }; "inputValue": { "alias": "inputValue"; "required": false; }; "config": { "alias": "copilotkitChatConfig"; "required": false; }; "value": { "alias": "value"; "required": false; }; }, { "submitInput": "submitInput"; "changeInput": "changeInput"; "valueChange": "valueChange"; }, never, never, true, never>;
|
|
84
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { OnChanges, SimpleChanges } from "@angular/core";
|
|
2
|
-
import { CopilotKitService } from "../core/copilotkit.service";
|
|
3
|
-
import { AbstractAgent } from "@ag-ui/client";
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
/**
|
|
6
|
-
* Directive to configure CopilotKit runtime settings declaratively in templates.
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* ```html
|
|
10
|
-
* <div [copilotkitConfig]="{
|
|
11
|
-
* runtimeUrl: 'https://api.example.com',
|
|
12
|
-
* headers: { 'Authorization': 'Bearer token' }
|
|
13
|
-
* }">
|
|
14
|
-
* <!-- Your app content -->
|
|
15
|
-
* </div>
|
|
16
|
-
* ```
|
|
17
|
-
*
|
|
18
|
-
* Or with individual inputs:
|
|
19
|
-
* ```html
|
|
20
|
-
* <div copilotkitConfig
|
|
21
|
-
* [runtimeUrl]="apiUrl"
|
|
22
|
-
* [headers]="authHeaders"
|
|
23
|
-
* [agents]="myAgents">
|
|
24
|
-
* <!-- Your app content -->
|
|
25
|
-
* </div>
|
|
26
|
-
* ```
|
|
27
|
-
*/
|
|
28
|
-
export declare class CopilotKitConfigDirective implements OnChanges {
|
|
29
|
-
private readonly copilotkit;
|
|
30
|
-
constructor(copilotkit: CopilotKitService);
|
|
31
|
-
copilotkitConfig?: {
|
|
32
|
-
runtimeUrl?: string;
|
|
33
|
-
headers?: Record<string, string>;
|
|
34
|
-
properties?: Record<string, unknown>;
|
|
35
|
-
agents?: Record<string, AbstractAgent>;
|
|
36
|
-
};
|
|
37
|
-
runtimeUrl?: string;
|
|
38
|
-
headers?: Record<string, string>;
|
|
39
|
-
properties?: Record<string, unknown>;
|
|
40
|
-
agents?: Record<string, AbstractAgent>;
|
|
41
|
-
ngOnChanges(changes: SimpleChanges): void;
|
|
42
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<CopilotKitConfigDirective, never>;
|
|
43
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<CopilotKitConfigDirective, "[copilotkitConfig]", never, { "copilotkitConfig": { "alias": "copilotkitConfig"; "required": false; }; "runtimeUrl": { "alias": "runtimeUrl"; "required": false; }; "headers": { "alias": "headers"; "required": false; }; "properties": { "alias": "properties"; "required": false; }; "agents": { "alias": "agents"; "required": false; }; }, {}, never, never, true, never>;
|
|
44
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { OnInit, OnChanges, OnDestroy, SimpleChanges, TemplateRef, Type } from "@angular/core";
|
|
2
|
-
import { CopilotKitService } from "../core/copilotkit.service";
|
|
3
|
-
import type { AngularFrontendTool } from "../core/copilotkit.types";
|
|
4
|
-
import type { z } from "zod";
|
|
5
|
-
import * as i0 from "@angular/core";
|
|
6
|
-
export declare class CopilotKitFrontendToolDirective<T extends Record<string, any> = Record<string, any>> implements OnInit, OnChanges, OnDestroy {
|
|
7
|
-
private readonly copilotkit;
|
|
8
|
-
private isRegistered;
|
|
9
|
-
constructor(copilotkit: CopilotKitService);
|
|
10
|
-
name: string;
|
|
11
|
-
description?: string;
|
|
12
|
-
parameters?: z.ZodSchema<T>;
|
|
13
|
-
handler?: (args: T) => Promise<any>;
|
|
14
|
-
render?: Type<any> | TemplateRef<any>;
|
|
15
|
-
followUp?: boolean;
|
|
16
|
-
tool?: AngularFrontendTool<T>;
|
|
17
|
-
ngOnInit(): void;
|
|
18
|
-
ngOnChanges(_changes: SimpleChanges): void;
|
|
19
|
-
ngOnDestroy(): void;
|
|
20
|
-
private registerTool;
|
|
21
|
-
private unregisterTool;
|
|
22
|
-
private getTool;
|
|
23
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<CopilotKitFrontendToolDirective<any>, never>;
|
|
24
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<CopilotKitFrontendToolDirective<any>, "[copilotkitFrontendTool]", never, { "name": { "alias": "name"; "required": false; }; "description": { "alias": "description"; "required": false; }; "parameters": { "alias": "parameters"; "required": false; }; "handler": { "alias": "handler"; "required": false; }; "render": { "alias": "render"; "required": false; }; "followUp": { "alias": "followUp"; "required": false; }; "tool": { "alias": "copilotkitFrontendTool"; "required": false; }; }, {}, never, never, true, never>;
|
|
25
|
-
}
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import { EventEmitter, OnInit, OnChanges, OnDestroy, SimpleChanges, TemplateRef, Type } from "@angular/core";
|
|
2
|
-
import { CopilotKitService } from "../core/copilotkit.service";
|
|
3
|
-
import type { AngularHumanInTheLoop, HumanInTheLoopProps } from "../core/copilotkit.types";
|
|
4
|
-
import { ToolCallStatus } from "../core/copilotkit.types";
|
|
5
|
-
import * as z from "zod";
|
|
6
|
-
import * as i0 from "@angular/core";
|
|
7
|
-
/**
|
|
8
|
-
* Directive for declaratively creating human-in-the-loop tools.
|
|
9
|
-
* Provides reactive outputs for status changes and response events.
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```html
|
|
13
|
-
* <!-- Basic usage -->
|
|
14
|
-
* <div copilotkitHumanInTheLoop
|
|
15
|
-
* [name]="'requireApproval'"
|
|
16
|
-
* [description]="'Requires user approval'"
|
|
17
|
-
* [args]="argsSchema"
|
|
18
|
-
* [render]="approvalComponent"
|
|
19
|
-
* (statusChange)="onStatusChange($event)"
|
|
20
|
-
* (responseProvided)="onResponse($event)">
|
|
21
|
-
* </div>
|
|
22
|
-
*
|
|
23
|
-
* <!-- With template -->
|
|
24
|
-
* <div copilotkitHumanInTheLoop
|
|
25
|
-
* [name]="'requireApproval'"
|
|
26
|
-
* [description]="'Requires user approval'"
|
|
27
|
-
* [args]="argsSchema"
|
|
28
|
-
* [render]="approvalTemplate"
|
|
29
|
-
* [(status)]="approvalStatus">
|
|
30
|
-
* </div>
|
|
31
|
-
*
|
|
32
|
-
* <ng-template #approvalTemplate let-props>
|
|
33
|
-
* <div *ngIf="props.status === 'executing'">
|
|
34
|
-
* <p>{{ props.args.action }}</p>
|
|
35
|
-
* <button (click)="props.respond('approved')">Approve</button>
|
|
36
|
-
* <button (click)="props.respond('rejected')">Reject</button>
|
|
37
|
-
* </div>
|
|
38
|
-
* </ng-template>
|
|
39
|
-
* ```
|
|
40
|
-
*/
|
|
41
|
-
export declare class CopilotKitHumanInTheLoopDirective<T extends Record<string, any> = Record<string, any>> implements OnInit, OnChanges, OnDestroy {
|
|
42
|
-
private readonly copilotkit;
|
|
43
|
-
private toolId?;
|
|
44
|
-
private statusSignal;
|
|
45
|
-
private resolvePromise;
|
|
46
|
-
private _status;
|
|
47
|
-
constructor(copilotkit: CopilotKitService);
|
|
48
|
-
/**
|
|
49
|
-
* The name of the human-in-the-loop tool.
|
|
50
|
-
*/
|
|
51
|
-
name: string;
|
|
52
|
-
/**
|
|
53
|
-
* Description of what the tool does.
|
|
54
|
-
*/
|
|
55
|
-
description: string;
|
|
56
|
-
/**
|
|
57
|
-
* Zod schema for the tool parameters.
|
|
58
|
-
*/
|
|
59
|
-
parameters: z.ZodSchema<T>;
|
|
60
|
-
/**
|
|
61
|
-
* Component class or template to render for user interaction.
|
|
62
|
-
*/
|
|
63
|
-
render: Type<any> | TemplateRef<HumanInTheLoopProps<T>>;
|
|
64
|
-
/**
|
|
65
|
-
* Whether the tool should be registered (default: true).
|
|
66
|
-
*/
|
|
67
|
-
enabled: boolean;
|
|
68
|
-
/**
|
|
69
|
-
* Alternative input using the directive selector.
|
|
70
|
-
* Allows: [copilotkitHumanInTheLoop]="config"
|
|
71
|
-
*/
|
|
72
|
-
set config(value: Partial<AngularHumanInTheLoop<T>> | undefined);
|
|
73
|
-
/**
|
|
74
|
-
* Emits when the status changes.
|
|
75
|
-
*/
|
|
76
|
-
statusChange: EventEmitter<ToolCallStatus>;
|
|
77
|
-
/**
|
|
78
|
-
* Two-way binding for status.
|
|
79
|
-
*/
|
|
80
|
-
get status(): ToolCallStatus;
|
|
81
|
-
set status(value: ToolCallStatus);
|
|
82
|
-
/**
|
|
83
|
-
* Emits when a response is provided by the user.
|
|
84
|
-
*/
|
|
85
|
-
responseProvided: EventEmitter<unknown>;
|
|
86
|
-
/**
|
|
87
|
-
* Emits when the tool execution starts.
|
|
88
|
-
*/
|
|
89
|
-
executionStarted: EventEmitter<any>;
|
|
90
|
-
/**
|
|
91
|
-
* Emits when the tool execution completes.
|
|
92
|
-
*/
|
|
93
|
-
executionCompleted: EventEmitter<unknown>;
|
|
94
|
-
ngOnInit(): void;
|
|
95
|
-
ngOnChanges(changes: SimpleChanges): void;
|
|
96
|
-
ngOnDestroy(): void;
|
|
97
|
-
/**
|
|
98
|
-
* Programmatically trigger a response.
|
|
99
|
-
* Useful when the directive is used as a controller.
|
|
100
|
-
*/
|
|
101
|
-
respond(result: unknown): void;
|
|
102
|
-
private registerTool;
|
|
103
|
-
private unregisterTool;
|
|
104
|
-
private createEnhancedRender;
|
|
105
|
-
private handleResponse;
|
|
106
|
-
private updateStatus;
|
|
107
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<CopilotKitHumanInTheLoopDirective<any>, never>;
|
|
108
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<CopilotKitHumanInTheLoopDirective<any>, "[copilotkitHumanInTheLoop]", never, { "name": { "alias": "name"; "required": false; }; "description": { "alias": "description"; "required": false; }; "parameters": { "alias": "parameters"; "required": false; }; "render": { "alias": "render"; "required": false; }; "enabled": { "alias": "enabled"; "required": false; }; "config": { "alias": "copilotkitHumanInTheLoop"; "required": false; }; "status": { "alias": "status"; "required": false; }; }, { "statusChange": "statusChange"; "responseProvided": "responseProvided"; "executionStarted": "executionStarted"; "executionCompleted": "executionCompleted"; }, never, never, true, never>;
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* Helper directive to provide respond function in templates.
|
|
112
|
-
* This would be used internally by the tool render component.
|
|
113
|
-
*
|
|
114
|
-
* @internal
|
|
115
|
-
*/
|
|
116
|
-
export declare class CopilotKitHumanInTheLoopRespondDirective {
|
|
117
|
-
copilotkitHumanInTheLoopRespond?: (result: unknown) => Promise<void>;
|
|
118
|
-
/**
|
|
119
|
-
* Convenience method for templates to call respond.
|
|
120
|
-
*/
|
|
121
|
-
respond(result: unknown): void;
|
|
122
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<CopilotKitHumanInTheLoopRespondDirective, never>;
|
|
123
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<CopilotKitHumanInTheLoopRespondDirective, "[copilotkitHumanInTheLoopRespond]", never, { "copilotkitHumanInTheLoopRespond": { "alias": "copilotkitHumanInTheLoopRespond"; "required": false; }; }, {}, never, never, true, never>;
|
|
124
|
-
}
|