@copilotkit/angular 2.0.0-rc.59 → 2.0.0-rc.60
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/README.md +6 -0
- package/dist/README.md +6 -0
- package/dist/fesm2022/copilotkit-angular-generative-ui.mjs +59 -21
- package/dist/fesm2022/copilotkit-angular-generative-ui.mjs.map +1 -1
- package/dist/fesm2022/copilotkit-angular.mjs +50 -8
- package/dist/fesm2022/copilotkit-angular.mjs.map +1 -1
- package/dist/types/copilotkit-angular-generative-ui.d.ts +4 -4
- package/dist/types/copilotkit-angular-generative-ui.d.ts.map +1 -1
- package/dist/types/copilotkit-angular.d.ts +48 -2
- package/dist/types/copilotkit-angular.d.ts.map +1 -1
- package/package.json +7 -7
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, inject, DestroyRef, input, viewChild, ElementRef, signal, computed, afterRenderEffect, ChangeDetectionStrategy, Component, effect, untracked, NgZone,
|
|
2
|
+
import { InjectionToken, inject, isDevMode, DestroyRef, input, viewChild, ElementRef, signal, computed, afterRenderEffect, ChangeDetectionStrategy, Component, effect, untracked, NgZone, Injector, PLATFORM_ID, afterNextRender, Injectable, runInInjectionContext, ViewEncapsulation, reflectComponentType, inputBinding, outputBinding, TemplateRef, ViewContainerRef, Input, Inject, Directive, output, DOCUMENT as DOCUMENT$1, ContentChild, Optional, ViewChild, contentChild, forwardRef, Renderer2, HostListener, ChangeDetectorRef, EventEmitter, Output, CUSTOM_ELEMENTS_SCHEMA, model } from '@angular/core';
|
|
3
3
|
import * as i1$1 from '@angular/common';
|
|
4
4
|
import { DOCUMENT, isPlatformBrowser, NgComponentOutlet, NgTemplateOutlet, CommonModule } from '@angular/common';
|
|
5
5
|
import { shouldEnableInspector, GENERATIVE_UI_ACTIVITY_TYPE, DEFAULT_AGENT_ID, getSourceUrl, getDocumentIcon, createRowKeyStore, resolveRowRenderKeys, commitRowKeyStore, formatFileSize, randomUUID } from '@copilotkit/shared';
|
|
@@ -28,11 +28,48 @@ const COPILOT_KIT_CONFIG = new InjectionToken("COPILOT_KIT_CONFIG");
|
|
|
28
28
|
function injectCopilotKitConfig() {
|
|
29
29
|
return inject(COPILOT_KIT_CONFIG);
|
|
30
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* @internal The deprecated `a2ui` option of `provideCopilotKit`.
|
|
33
|
+
* `@copilotkit/angular/generative-ui` reads it to pass its options to
|
|
34
|
+
* generative UI.
|
|
35
|
+
*/
|
|
36
|
+
const ɵCOPILOTKIT_A2UI_CONFIG = new InjectionToken("COPILOTKIT_A2UI_CONFIG");
|
|
37
|
+
/**
|
|
38
|
+
* The generative UI providers for the catalog of the deprecated `a2ui`
|
|
39
|
+
* option. `@copilotkit/angular/generative-ui` sets them when it loads: this
|
|
40
|
+
* entry cannot import that one, not even lazily (ng-packagr rejects the
|
|
41
|
+
* cycle). An app that passes a catalog has loaded it, because the catalog
|
|
42
|
+
* comes from its `createGenerativeUI`.
|
|
43
|
+
*/
|
|
44
|
+
let a2uiGenerativeUIProviders;
|
|
45
|
+
/**
|
|
46
|
+
* @internal Called by `@copilotkit/angular/generative-ui` when it loads, with
|
|
47
|
+
* the providers that turn generative UI on for the deprecated `a2ui` option.
|
|
48
|
+
*/
|
|
49
|
+
function ɵsetA2UIGenerativeUIProviders(providers) {
|
|
50
|
+
a2uiGenerativeUIProviders = providers;
|
|
51
|
+
}
|
|
52
|
+
/** The generative UI providers for the catalog of the deprecated `a2ui` option. */
|
|
53
|
+
function a2uiCatalogProviders() {
|
|
54
|
+
if (a2uiGenerativeUIProviders)
|
|
55
|
+
return [a2uiGenerativeUIProviders()];
|
|
56
|
+
if (isDevMode()) {
|
|
57
|
+
console.warn("[CopilotKit] The `a2ui.catalog` of `provideCopilotKit` renders with `@copilotkit/angular/generative-ui`, which the app did not load. " +
|
|
58
|
+
"Create the catalog with `createGenerativeUI` from `@copilotkit/angular/generative-ui`, or add `provideGenerativeUI({ ui })` to the application providers.");
|
|
59
|
+
}
|
|
60
|
+
return [];
|
|
61
|
+
}
|
|
31
62
|
function provideCopilotKit(config = {}) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
63
|
+
const provider = { provide: COPILOT_KIT_CONFIG, useValue: config };
|
|
64
|
+
const { a2ui } = config;
|
|
65
|
+
if (!a2ui)
|
|
66
|
+
return provider;
|
|
67
|
+
// The deprecated `a2ui` option goes to generative UI.
|
|
68
|
+
return [
|
|
69
|
+
provider,
|
|
70
|
+
{ provide: ɵCOPILOTKIT_A2UI_CONFIG, useValue: a2ui },
|
|
71
|
+
...(a2ui.catalog ? a2uiCatalogProviders() : []),
|
|
72
|
+
];
|
|
36
73
|
}
|
|
37
74
|
|
|
38
75
|
/**
|
|
@@ -288,7 +325,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImpor
|
|
|
288
325
|
}], ctorParameters: () => [], propDecorators: { toolCall: [{ type: i0.Input, args: [{ isSignal: true, alias: "toolCall", required: true }] }] } });
|
|
289
326
|
|
|
290
327
|
// Generated from package.json. Do not edit.
|
|
291
|
-
const ANGULAR_SDK_VERSION = "2.0.0-rc.
|
|
328
|
+
const ANGULAR_SDK_VERSION = "2.0.0-rc.60";
|
|
292
329
|
|
|
293
330
|
/**
|
|
294
331
|
* Injection token that reports whether the Inspector treats the app as
|
|
@@ -538,7 +575,12 @@ function toProviderConfigInput(config) {
|
|
|
538
575
|
}
|
|
539
576
|
class CopilotKit {
|
|
540
577
|
#config = injectCopilotKitConfig();
|
|
541
|
-
|
|
578
|
+
// A renderer is listed once even when two providers add it: the deprecated
|
|
579
|
+
// `a2ui` option of `provideCopilotKit` and `provideGenerativeUI` both add
|
|
580
|
+
// the generative UI renderers.
|
|
581
|
+
#extensionActivityMessageRenderers = [
|
|
582
|
+
...new Set(inject(ɵCOPILOTKIT_BUILT_IN_ACTIVITY_RENDERERS)),
|
|
583
|
+
];
|
|
542
584
|
#rootInjector = inject(Injector);
|
|
543
585
|
#inspector = inject(CopilotInspector);
|
|
544
586
|
/** Whether unknown tools may use the built-in text-only fallback renderer. */
|
|
@@ -13459,5 +13501,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImpor
|
|
|
13459
13501
|
* Generated bundle index. Do not edit.
|
|
13460
13502
|
*/
|
|
13461
13503
|
|
|
13462
|
-
export { AgentStore, COPILOT_CHAT_CONFIGURATION, COPILOT_CHAT_CONFIGURATION_OPTIONS, COPILOT_CHAT_DEFAULT_LABELS, COPILOT_CHAT_LABELS, COPILOT_KIT_CONFIG, ChatState, CopilotActivity, CopilotChat, CopilotChatAddFileButton, CopilotChatAssistantMessage, CopilotChatAssistantMessageCopyButton, CopilotChatAssistantMessageReadAloudButton, CopilotChatAssistantMessageRegenerateButton, CopilotChatAssistantMessageRenderer, CopilotChatAssistantMessageThumbsDownButton, CopilotChatAssistantMessageThumbsUpButton, CopilotChatAssistantMessageToolbar, CopilotChatAssistantMessageToolbarButton, CopilotChatAttachmentQueue, CopilotChatAttachmentRenderer, CopilotChatAttachmentsDirective, CopilotChatAudioRecorder, CopilotChatCancelTranscribeButton, CopilotChatConfiguration, CopilotChatFinishTranscribeButton, CopilotChatInput, CopilotChatInputDefaults, CopilotChatInspectorButton, CopilotChatMessageView, CopilotChatMessageViewCursor, CopilotChatReasoningMessage, CopilotChatSendButton, CopilotChatStartTranscribeButton, CopilotChatSuggestionPill, CopilotChatSuggestionView, CopilotChatTextarea, CopilotChatToolCallGroup, CopilotChatToolCallsView, CopilotChatToolbar, CopilotChatToolbarButton, CopilotChatToolsMenu, CopilotChatUserMessage, CopilotChatUserMessageBranchNavigation, CopilotChatUserMessageCopyButton, CopilotChatUserMessageEditButton, CopilotChatUserMessageRenderer, CopilotChatUserMessageToolbar, CopilotChatUserMessageToolbarButton, CopilotChatView, CopilotChatViewDisclaimer, CopilotChatViewFeather, CopilotChatViewHandlers, CopilotChatViewInputContainer, CopilotChatViewInputMeasure, CopilotChatViewScrollToBottomButton, CopilotChatViewScrollView, CopilotChatWorkSummary, CopilotDefaultToolRenderer, CopilotKit, CopilotKitAgentContext, CopilotKitStyles, CopilotOpenGenerativeUIActivityRenderer, CopilotOpenGenerativeUIRenderer, CopilotOpenGenerativeUIToolRenderer, CopilotPopup, CopilotSidebar, CopilotSlot, CopilotThreadsDrawer, CopilotThreadsDrawerRow, CopilotTooltip, CopilotkitAgentFactory, CopilotkitThreadsFactory, GenerateSandboxedUiArgsSchema, InterruptController, OPEN_GENERATIVE_UI_WEBSANDBOX_LOADER, OpenGenerativeUIContentSchema, RenderToolCall, RenderToolCalls, ResizeObserverService, SLOT_CONFIG, ScrollPosition, StickToBottom, ThreadsStore, TooltipContent, anyActivityContentSchema, connectAgentContext, createSlotConfig, createSlotRenderer, getSlotConfig, injectAgentStore, injectCapabilities, injectChatConfiguration, injectChatLabels, injectChatState, injectCopilotKitConfig, injectInterrupt, injectMemories, injectThreads, isComponentType, isSlotValue, normalizeSlotValue, parseToolCallArguments, pickToolCallHandler, provideCopilotChatConfiguration, provideCopilotChatLabels, provideCopilotKit, provideSlots, registerComponent, registerFrontendTool, registerHumanInTheLoop, registerRenderActivityMessage, registerRenderToolCall, renderSlot, safeToolValue, ɵCOPILOTKIT_ASSISTANT_MARKDOWN_RENDERER, ɵCOPILOTKIT_BUILT_IN_ACTIVITY_RENDERERS, ɵCOPILOTKIT_INSPECTOR_DEVELOPMENT_MODE };
|
|
13504
|
+
export { AgentStore, COPILOT_CHAT_CONFIGURATION, COPILOT_CHAT_CONFIGURATION_OPTIONS, COPILOT_CHAT_DEFAULT_LABELS, COPILOT_CHAT_LABELS, COPILOT_KIT_CONFIG, ChatState, CopilotActivity, CopilotChat, CopilotChatAddFileButton, CopilotChatAssistantMessage, CopilotChatAssistantMessageCopyButton, CopilotChatAssistantMessageReadAloudButton, CopilotChatAssistantMessageRegenerateButton, CopilotChatAssistantMessageRenderer, CopilotChatAssistantMessageThumbsDownButton, CopilotChatAssistantMessageThumbsUpButton, CopilotChatAssistantMessageToolbar, CopilotChatAssistantMessageToolbarButton, CopilotChatAttachmentQueue, CopilotChatAttachmentRenderer, CopilotChatAttachmentsDirective, CopilotChatAudioRecorder, CopilotChatCancelTranscribeButton, CopilotChatConfiguration, CopilotChatFinishTranscribeButton, CopilotChatInput, CopilotChatInputDefaults, CopilotChatInspectorButton, CopilotChatMessageView, CopilotChatMessageViewCursor, CopilotChatReasoningMessage, CopilotChatSendButton, CopilotChatStartTranscribeButton, CopilotChatSuggestionPill, CopilotChatSuggestionView, CopilotChatTextarea, CopilotChatToolCallGroup, CopilotChatToolCallsView, CopilotChatToolbar, CopilotChatToolbarButton, CopilotChatToolsMenu, CopilotChatUserMessage, CopilotChatUserMessageBranchNavigation, CopilotChatUserMessageCopyButton, CopilotChatUserMessageEditButton, CopilotChatUserMessageRenderer, CopilotChatUserMessageToolbar, CopilotChatUserMessageToolbarButton, CopilotChatView, CopilotChatViewDisclaimer, CopilotChatViewFeather, CopilotChatViewHandlers, CopilotChatViewInputContainer, CopilotChatViewInputMeasure, CopilotChatViewScrollToBottomButton, CopilotChatViewScrollView, CopilotChatWorkSummary, CopilotDefaultToolRenderer, CopilotKit, CopilotKitAgentContext, CopilotKitStyles, CopilotOpenGenerativeUIActivityRenderer, CopilotOpenGenerativeUIRenderer, CopilotOpenGenerativeUIToolRenderer, CopilotPopup, CopilotSidebar, CopilotSlot, CopilotThreadsDrawer, CopilotThreadsDrawerRow, CopilotTooltip, CopilotkitAgentFactory, CopilotkitThreadsFactory, GenerateSandboxedUiArgsSchema, InterruptController, OPEN_GENERATIVE_UI_WEBSANDBOX_LOADER, OpenGenerativeUIContentSchema, RenderToolCall, RenderToolCalls, ResizeObserverService, SLOT_CONFIG, ScrollPosition, StickToBottom, ThreadsStore, TooltipContent, anyActivityContentSchema, connectAgentContext, createSlotConfig, createSlotRenderer, getSlotConfig, injectAgentStore, injectCapabilities, injectChatConfiguration, injectChatLabels, injectChatState, injectCopilotKitConfig, injectInterrupt, injectMemories, injectThreads, isComponentType, isSlotValue, normalizeSlotValue, parseToolCallArguments, pickToolCallHandler, provideCopilotChatConfiguration, provideCopilotChatLabels, provideCopilotKit, provideSlots, registerComponent, registerFrontendTool, registerHumanInTheLoop, registerRenderActivityMessage, registerRenderToolCall, renderSlot, safeToolValue, ɵCOPILOTKIT_A2UI_CONFIG, ɵCOPILOTKIT_ASSISTANT_MARKDOWN_RENDERER, ɵCOPILOTKIT_BUILT_IN_ACTIVITY_RENDERERS, ɵCOPILOTKIT_INSPECTOR_DEVELOPMENT_MODE, ɵsetA2UIGenerativeUIProviders };
|
|
13463
13505
|
//# sourceMappingURL=copilotkit-angular.mjs.map
|