@copilotkit/angular 0.1.1 → 0.2.0
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.
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { Type, Signal, InjectionToken, Provider, Injector, DestroyRef, WritableSignal, OnDestroy, NgZone, ElementRef, TemplateRef, ViewContainerRef, ComponentRef, EmbeddedViewRef, OnInit, OnChanges, ChangeDetectorRef, SimpleChanges, AfterViewInit } from '@angular/core';
|
|
2
|
+
import { Type, Signal, InjectionToken, Provider, Injector, DestroyRef, WritableSignal, OnDestroy, NgZone, ElementRef, TemplateRef, ViewContainerRef, ComponentRef, EmbeddedViewRef, OnInit, OnChanges, ChangeDetectorRef, SimpleChanges, AfterViewInit, EventEmitter } from '@angular/core';
|
|
3
3
|
import * as _ag_ui_client from '@ag-ui/client';
|
|
4
4
|
import { AbstractAgent, ActivityMessage, ToolCall, Context, AssistantMessage, Message as Message$1 } from '@ag-ui/client';
|
|
5
5
|
export { AssistantMessage, Message } from '@ag-ui/client';
|
|
6
|
-
import { FrontendTool, FrontendToolHandlerContext, SuggestionsConfig, CopilotKitCoreRuntimeConnectionStatus, CopilotRuntimeTransport, CopilotKitCoreGetSuggestionsResult, CopilotKitCore, Suggestion } from '@copilotkit/core';
|
|
7
|
-
export { DynamicSuggestionsConfig, StaticSuggestionsConfig, Suggestion, SuggestionsConfig } from '@copilotkit/core';
|
|
6
|
+
import { FrontendTool, FrontendToolHandlerContext, SuggestionsConfig, CopilotKitCoreRuntimeConnectionStatus, CopilotRuntimeTransport, ThreadEndpointRuntimeInfo, IntelligenceRuntimeInfo, RuntimeLicenseStatus, CopilotKitCoreGetSuggestionsResult, CopilotKitCore, Suggestion, Memory, MemoryRealtimeStatus, NewMemory, MemoryChanges } from '@copilotkit/core';
|
|
7
|
+
export { DynamicSuggestionsConfig, Memory, MemoryChanges, MemoryKind, MemoryScope, NewMemory, StaticSuggestionsConfig, Suggestion, SuggestionsConfig } from '@copilotkit/core';
|
|
8
8
|
import { StandardSchemaV1, Attachment, TranscriptionErrorCode, AttachmentsConfig, AttachmentModality, InputContent, ImageInputPart, AudioInputPart, VideoInputPart, DocumentInputPart } from '@copilotkit/shared';
|
|
9
9
|
export { Attachment, AttachmentModality, AttachmentUploadError, AttachmentUploadResult, AttachmentsConfig, TranscriptionErrorCode } from '@copilotkit/shared';
|
|
10
10
|
import { z } from 'zod';
|
|
@@ -15,6 +15,7 @@ import { ClassValue } from 'clsx';
|
|
|
15
15
|
import * as _copilotkit_angular from '@copilotkit/angular';
|
|
16
16
|
import * as lucide_angular from 'lucide-angular';
|
|
17
17
|
import { UserMessage, Message, ReasoningMessage, ActivityMessage as ActivityMessage$1 } from '@ag-ui/core';
|
|
18
|
+
import { DrawerThread } from '@copilotkit/web-components/threads-drawer';
|
|
18
19
|
import Websandbox from '@jetbrains/websandbox';
|
|
19
20
|
|
|
20
21
|
type AngularToolCall<Args extends Record<string, unknown> = Record<string, unknown>> = {
|
|
@@ -219,6 +220,28 @@ declare class CopilotKit {
|
|
|
219
220
|
readonly runtimeUrl: Signal<string>;
|
|
220
221
|
readonly runtimeTransport: Signal<CopilotRuntimeTransport>;
|
|
221
222
|
readonly headers: Signal<Record<string, string>>;
|
|
223
|
+
/**
|
|
224
|
+
* Thread-endpoint capability advertised by the connected runtime's `/info`
|
|
225
|
+
* response, or `undefined` before the runtime reports `Connected`. Exposed
|
|
226
|
+
* as a signal (rather than a plain `core.threadEndpoints` read) so reactive
|
|
227
|
+
* consumers re-run when `/info` lands.
|
|
228
|
+
*/
|
|
229
|
+
readonly threadEndpoints: Signal<ThreadEndpointRuntimeInfo>;
|
|
230
|
+
/**
|
|
231
|
+
* Intelligence runtime info advertised by the connected runtime's `/info`
|
|
232
|
+
* response, or `undefined` before the runtime reports `Connected`. Carries
|
|
233
|
+
* the realtime `wsUrl`. Exposed as a signal so reactive consumers re-run
|
|
234
|
+
* when `/info` populates it — even if the connection status does not
|
|
235
|
+
* transition in the same turn.
|
|
236
|
+
*/
|
|
237
|
+
readonly intelligence: Signal<IntelligenceRuntimeInfo>;
|
|
238
|
+
/**
|
|
239
|
+
* Server-reported license status from the connected runtime's `/info`
|
|
240
|
+
* response, or `undefined` before the runtime reports it. Exposed as a signal
|
|
241
|
+
* (rather than a plain `core.licenseStatus` read) so reactive consumers — e.g.
|
|
242
|
+
* the threads drawer's license gate — re-run once the status resolves.
|
|
243
|
+
*/
|
|
244
|
+
readonly licenseStatus: Signal<RuntimeLicenseStatus>;
|
|
222
245
|
readonly suggestionsByAgent: Signal<Record<string, CopilotKitCoreGetSuggestionsResult>>;
|
|
223
246
|
readonly core: CopilotKitCore;
|
|
224
247
|
readonly toolCallRenderConfigs: Signal<RenderToolCallConfig[]>;
|
|
@@ -533,6 +556,235 @@ declare class CopilotkitAgentFactory {
|
|
|
533
556
|
}
|
|
534
557
|
declare function injectAgentStore(agentId: string | Signal<string | undefined>): Signal<AgentStore>;
|
|
535
558
|
|
|
559
|
+
/**
|
|
560
|
+
* A conversation thread managed by the Intelligence platform.
|
|
561
|
+
*
|
|
562
|
+
* Each thread has a unique `id`, an optional human-readable `name`, and
|
|
563
|
+
* timestamp fields tracking creation and update times. This mirrors the
|
|
564
|
+
* `Thread` projection exposed by react-core's `useThreads` so framework
|
|
565
|
+
* wrappers share an identical shape.
|
|
566
|
+
*/
|
|
567
|
+
interface Thread {
|
|
568
|
+
/** Stable, server-assigned thread identifier. */
|
|
569
|
+
id: string;
|
|
570
|
+
/** The agent this thread belongs to. */
|
|
571
|
+
agentId: string;
|
|
572
|
+
/** Human-readable name, or `null` when the thread is unnamed. */
|
|
573
|
+
name: string | null;
|
|
574
|
+
/** `true` when the thread has been archived. */
|
|
575
|
+
archived: boolean;
|
|
576
|
+
/** ISO-8601 creation timestamp. */
|
|
577
|
+
createdAt: string;
|
|
578
|
+
/** ISO-8601 timestamp of the most recent metadata update. */
|
|
579
|
+
updatedAt: string;
|
|
580
|
+
/**
|
|
581
|
+
* ISO-8601 timestamp of the most recent agent run on this thread. Absent
|
|
582
|
+
* when the thread has never been run. Prefer this over `updatedAt` for
|
|
583
|
+
* user-facing "last activity" displays — it is not bumped by metadata-only
|
|
584
|
+
* actions like rename or archive.
|
|
585
|
+
*/
|
|
586
|
+
lastRunAt?: string;
|
|
587
|
+
}
|
|
588
|
+
/**
|
|
589
|
+
* Configuration for {@link injectThreads}.
|
|
590
|
+
*
|
|
591
|
+
* Thread operations are scoped to the runtime-authenticated user and the
|
|
592
|
+
* provided agent on the Intelligence platform. Each field may be supplied as
|
|
593
|
+
* a plain value or a {@link Signal}; when a signal is used the underlying
|
|
594
|
+
* runtime context is re-synced whenever its value changes.
|
|
595
|
+
*/
|
|
596
|
+
interface InjectThreadsInput {
|
|
597
|
+
/** The ID of the agent whose threads to list and manage. */
|
|
598
|
+
agentId: string | Signal<string>;
|
|
599
|
+
/** When `true`, archived threads are included in the list. Defaults to `false`. */
|
|
600
|
+
includeArchived?: boolean | Signal<boolean | undefined>;
|
|
601
|
+
/** Maximum number of threads to fetch per page. When set, enables cursor-based pagination. */
|
|
602
|
+
limit?: number | Signal<number | undefined>;
|
|
603
|
+
/**
|
|
604
|
+
* When `false`, the store stays inert: no runtime context is dispatched, so
|
|
605
|
+
* NO thread-list fetch or realtime subscription is issued, and the
|
|
606
|
+
* synthesized pre-connect loading state is suppressed. Used by gated
|
|
607
|
+
* surfaces (e.g. an unlicensed `<copilotkit-threads-drawer>`) that must not touch
|
|
608
|
+
* the network until the gate opens. Defaults to `true`. Mirrors react-core's
|
|
609
|
+
* `UseThreadsInput.enabled`.
|
|
610
|
+
*/
|
|
611
|
+
enabled?: boolean | Signal<boolean | undefined>;
|
|
612
|
+
}
|
|
613
|
+
/**
|
|
614
|
+
* Signal-based threads-list API returned by {@link injectThreads}.
|
|
615
|
+
*
|
|
616
|
+
* The `threads` signal is kept in sync with the platform via a realtime
|
|
617
|
+
* WebSocket subscription (when available) and is sorted most-recently-active
|
|
618
|
+
* first. Mutation methods reject with an `Error` if the platform request
|
|
619
|
+
* fails; `delete` additionally rolls back its optimistic removal.
|
|
620
|
+
*/
|
|
621
|
+
interface InjectThreadsResult {
|
|
622
|
+
/**
|
|
623
|
+
* Threads for the current user/agent pair, sorted most-recently-active
|
|
624
|
+
* first. Updated in realtime when the platform pushes metadata events.
|
|
625
|
+
* Includes archived threads only when `includeArchived` is set.
|
|
626
|
+
*/
|
|
627
|
+
threads: Signal<Thread[]>;
|
|
628
|
+
/**
|
|
629
|
+
* `true` while the initial thread list is being fetched from the platform.
|
|
630
|
+
* Subsequent realtime updates do not re-enter the loading state.
|
|
631
|
+
*/
|
|
632
|
+
isLoading: Signal<boolean>;
|
|
633
|
+
/**
|
|
634
|
+
* The most recent error from fetching threads or executing a mutation, or
|
|
635
|
+
* `null` when there is no error. Reset to `null` on the next successful
|
|
636
|
+
* fetch.
|
|
637
|
+
*/
|
|
638
|
+
error: Signal<Error | null>;
|
|
639
|
+
/**
|
|
640
|
+
* List/mutation errors only — excludes developer/config errors (missing
|
|
641
|
+
* runtime URL, runtime without thread endpoints) so consumer UIs do not
|
|
642
|
+
* surface dev strings to end users. Prefer this over `error` for
|
|
643
|
+
* user-facing error display.
|
|
644
|
+
*/
|
|
645
|
+
listError: Signal<Error | null>;
|
|
646
|
+
/**
|
|
647
|
+
* Error from the most recent FAILED next-page (fetch-more) load, or `null`.
|
|
648
|
+
* Tracked separately from {@link InjectThreadsResult.listError} so a
|
|
649
|
+
* paginated-load failure surfaces an inline "couldn't load more" affordance
|
|
650
|
+
* while the loaded list stays visible. Cleared when a fetch-more is retried
|
|
651
|
+
* or succeeds.
|
|
652
|
+
*/
|
|
653
|
+
fetchMoreError: Signal<Error | null>;
|
|
654
|
+
/**
|
|
655
|
+
* `true` when there are more threads available to fetch via
|
|
656
|
+
* {@link InjectThreadsResult.fetchMoreThreads}. Only meaningful when `limit`
|
|
657
|
+
* is set.
|
|
658
|
+
*/
|
|
659
|
+
hasMoreThreads: Signal<boolean>;
|
|
660
|
+
/** `true` while a subsequent page of threads is being fetched. */
|
|
661
|
+
isFetchingMoreThreads: Signal<boolean>;
|
|
662
|
+
/**
|
|
663
|
+
* `true` while at least one thread mutation (rename, archive, unarchive,
|
|
664
|
+
* delete) is awaiting a server response. Mutations apply optimistically, so
|
|
665
|
+
* this is primarily useful for disabling controls or showing a subtle
|
|
666
|
+
* in-flight indicator.
|
|
667
|
+
*/
|
|
668
|
+
isMutating: Signal<boolean>;
|
|
669
|
+
/**
|
|
670
|
+
* Fetch the next page of threads. No-op when
|
|
671
|
+
* {@link InjectThreadsResult.hasMoreThreads} is `false` or a fetch is
|
|
672
|
+
* already in progress.
|
|
673
|
+
*/
|
|
674
|
+
fetchMoreThreads: () => void;
|
|
675
|
+
/**
|
|
676
|
+
* Re-fetch the thread list from the platform without clearing the current
|
|
677
|
+
* list. Backs the drawer's error-state Retry and the Active/All filter
|
|
678
|
+
* refetch. No-op until the runtime is connected.
|
|
679
|
+
*/
|
|
680
|
+
refetchThreads: () => void;
|
|
681
|
+
/**
|
|
682
|
+
* Reset to a fresh, non-explicit client-side thread so the welcome screen
|
|
683
|
+
* shows. Lazy creation: no row appears in {@link InjectThreadsResult.threads}
|
|
684
|
+
* until the new thread's first run persists server-side.
|
|
685
|
+
*/
|
|
686
|
+
startNewThread: () => void;
|
|
687
|
+
/**
|
|
688
|
+
* Rename a thread on the platform. Resolves when the server confirms the
|
|
689
|
+
* update; rejects on failure.
|
|
690
|
+
*/
|
|
691
|
+
renameThread: (threadId: string, name: string) => Promise<void>;
|
|
692
|
+
/**
|
|
693
|
+
* Archive a thread on the platform. Archived threads are excluded from
|
|
694
|
+
* subsequent list results. Resolves when the server confirms the update;
|
|
695
|
+
* rejects on failure.
|
|
696
|
+
*/
|
|
697
|
+
archiveThread: (threadId: string) => Promise<void>;
|
|
698
|
+
/**
|
|
699
|
+
* Restore a previously archived thread on the platform. The thread
|
|
700
|
+
* re-appears in default (non-archived) list results. Resolves when the
|
|
701
|
+
* server confirms the update; rejects on failure.
|
|
702
|
+
*/
|
|
703
|
+
unarchiveThread: (threadId: string) => Promise<void>;
|
|
704
|
+
/**
|
|
705
|
+
* Permanently delete a thread from the platform. This is irreversible.
|
|
706
|
+
* Resolves when the server confirms deletion; rejects on failure (the
|
|
707
|
+
* optimistic removal is rolled back).
|
|
708
|
+
*/
|
|
709
|
+
deleteThread: (threadId: string) => Promise<void>;
|
|
710
|
+
}
|
|
711
|
+
/**
|
|
712
|
+
* Owns a single core thread store, bridges its selector observables onto
|
|
713
|
+
* Angular writable signals, keeps the store's runtime context in sync with the
|
|
714
|
+
* ambient {@link CopilotKit} configuration, and registers/unregisters the
|
|
715
|
+
* store with core for the active agent.
|
|
716
|
+
*
|
|
717
|
+
* One instance backs each {@link injectThreads} call. Tear-down (selector
|
|
718
|
+
* unsubscribe, store stop, core unregister) runs on the host's
|
|
719
|
+
* {@link DestroyRef}.
|
|
720
|
+
*/
|
|
721
|
+
declare class ThreadsStore implements InjectThreadsResult {
|
|
722
|
+
#private;
|
|
723
|
+
readonly threads: Signal<Thread[]>;
|
|
724
|
+
readonly error: Signal<Error | null>;
|
|
725
|
+
readonly listError: Signal<Error | null>;
|
|
726
|
+
readonly fetchMoreError: Signal<Error>;
|
|
727
|
+
readonly isLoading: Signal<boolean>;
|
|
728
|
+
readonly hasMoreThreads: Signal<boolean>;
|
|
729
|
+
readonly isFetchingMoreThreads: Signal<boolean>;
|
|
730
|
+
readonly isMutating: Signal<boolean>;
|
|
731
|
+
constructor(input: InjectThreadsInput, destroyRef: DestroyRef);
|
|
732
|
+
readonly renameThread: (threadId: string, name: string) => Promise<void>;
|
|
733
|
+
readonly archiveThread: (threadId: string) => Promise<void>;
|
|
734
|
+
readonly unarchiveThread: (threadId: string) => Promise<void>;
|
|
735
|
+
readonly deleteThread: (threadId: string) => Promise<void>;
|
|
736
|
+
readonly fetchMoreThreads: () => void;
|
|
737
|
+
readonly refetchThreads: () => void;
|
|
738
|
+
readonly startNewThread: () => void;
|
|
739
|
+
/** Unsubscribes all selector bridges and stops the underlying core store. */
|
|
740
|
+
teardown(): void;
|
|
741
|
+
}
|
|
742
|
+
/**
|
|
743
|
+
* Factory for {@link ThreadsStore} instances. Provided at the root so the
|
|
744
|
+
* ambient {@link CopilotKit} configuration is resolved from the application's
|
|
745
|
+
* injector.
|
|
746
|
+
*/
|
|
747
|
+
declare class CopilotkitThreadsFactory {
|
|
748
|
+
/**
|
|
749
|
+
* Creates a {@link ThreadsStore} bound to the given input and host
|
|
750
|
+
* `DestroyRef`.
|
|
751
|
+
*
|
|
752
|
+
* @param input - Agent identifier and optional list controls.
|
|
753
|
+
* @param destroyRef - Host lifetime; tears the store down on destroy.
|
|
754
|
+
*/
|
|
755
|
+
create(input: InjectThreadsInput, destroyRef: DestroyRef): ThreadsStore;
|
|
756
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CopilotkitThreadsFactory, never>;
|
|
757
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<CopilotkitThreadsFactory>;
|
|
758
|
+
}
|
|
759
|
+
/**
|
|
760
|
+
* Angular threads-list API over the platform-agnostic core thread store —
|
|
761
|
+
* the signal-based counterpart to react-core's `useThreads`.
|
|
762
|
+
*
|
|
763
|
+
* On creation the store fetches the thread list for the runtime-authenticated
|
|
764
|
+
* user and the given `agentId`. When the Intelligence platform exposes a
|
|
765
|
+
* WebSocket URL it also opens a realtime subscription so the `threads` signal
|
|
766
|
+
* stays current without polling. Mutation methods return promises that resolve
|
|
767
|
+
* once the platform confirms the operation and reject with an `Error` on
|
|
768
|
+
* failure.
|
|
769
|
+
*
|
|
770
|
+
* Must be called within an injection context (component/directive constructor
|
|
771
|
+
* or field initializer). The underlying store is torn down on the host's
|
|
772
|
+
* `DestroyRef`.
|
|
773
|
+
*
|
|
774
|
+
* @param input - Agent identifier and optional list controls. Each field
|
|
775
|
+
* accepts a plain value or a `Signal`.
|
|
776
|
+
* @returns Thread list state as signals plus stable mutation callbacks.
|
|
777
|
+
*
|
|
778
|
+
* @example
|
|
779
|
+
* ```ts
|
|
780
|
+
* @Component({ ... })
|
|
781
|
+
* class ThreadList {
|
|
782
|
+
* readonly threads = injectThreads({ agentId: "agent-1" });
|
|
783
|
+
* }
|
|
784
|
+
* ```
|
|
785
|
+
*/
|
|
786
|
+
declare function injectThreads(input: InjectThreadsInput): InjectThreadsResult;
|
|
787
|
+
|
|
536
788
|
interface CopilotChatLabels {
|
|
537
789
|
chatInputPlaceholder: string;
|
|
538
790
|
chatInputToolbarStartTranscribeButtonLabel: string;
|
|
@@ -557,6 +809,169 @@ declare const COPILOT_CHAT_LABELS: InjectionToken<CopilotChatLabels>;
|
|
|
557
809
|
declare function injectChatLabels(): CopilotChatLabels;
|
|
558
810
|
declare function provideCopilotChatLabels(config: Partial<CopilotChatLabels>): Provider;
|
|
559
811
|
|
|
812
|
+
/**
|
|
813
|
+
* Options for configuring the CopilotChat session.
|
|
814
|
+
* Mirrors the React CopilotChatConfigurationProvider props so behaviour
|
|
815
|
+
* is consistent across frameworks.
|
|
816
|
+
*/
|
|
817
|
+
interface CopilotChatConfigurationOptions {
|
|
818
|
+
/**
|
|
819
|
+
* The agent id to connect to.
|
|
820
|
+
* When omitted the runtime's default agent is used.
|
|
821
|
+
*/
|
|
822
|
+
agentId?: string;
|
|
823
|
+
/**
|
|
824
|
+
* An explicit thread id to resume.
|
|
825
|
+
* When provided the session joins the existing thread instead of starting a
|
|
826
|
+
* new one.
|
|
827
|
+
*/
|
|
828
|
+
threadId?: string;
|
|
829
|
+
/**
|
|
830
|
+
* Whether the thread id was supplied explicitly by the host application.
|
|
831
|
+
* Defaults to `false`, which seeds a non-explicit thread id that the runtime
|
|
832
|
+
* may override.
|
|
833
|
+
*/
|
|
834
|
+
hasExplicitThreadId?: boolean;
|
|
835
|
+
}
|
|
836
|
+
/**
|
|
837
|
+
* Angular service that holds the runtime chat configuration state.
|
|
838
|
+
*
|
|
839
|
+
* Active-thread resolution mirrors the React
|
|
840
|
+
* `CopilotChatConfigurationProvider` precedence (prop → override → minted)
|
|
841
|
+
* without parent-provider branches (PR1 has no nested providers).
|
|
842
|
+
*/
|
|
843
|
+
declare class CopilotChatConfiguration {
|
|
844
|
+
#private;
|
|
845
|
+
/**
|
|
846
|
+
* The resolved agent id for this chat session.
|
|
847
|
+
* Falls back to {@link DEFAULT_AGENT_ID} when no agent id is provided.
|
|
848
|
+
*/
|
|
849
|
+
readonly agentId: Signal<string>;
|
|
850
|
+
/**
|
|
851
|
+
* The resolved thread id for this chat session.
|
|
852
|
+
*
|
|
853
|
+
* Precedence (highest → lowest):
|
|
854
|
+
* 1. Prop-driven `threadId` when `#propIsAuthoritative` is true.
|
|
855
|
+
* 2. Imperative `#override` set by internal helpers.
|
|
856
|
+
* 3. Non-authoritative seed `threadId` from options.
|
|
857
|
+
* 4. Auto-minted UUID fallback.
|
|
858
|
+
*/
|
|
859
|
+
readonly threadId: Signal<string>;
|
|
860
|
+
/**
|
|
861
|
+
* Whether the current thread id was supplied explicitly by the host
|
|
862
|
+
* application (as opposed to being auto-minted or seeded without intent).
|
|
863
|
+
*/
|
|
864
|
+
readonly hasExplicitThreadId: Signal<boolean>;
|
|
865
|
+
/** Returns `true` when the host application controls the thread id via props. */
|
|
866
|
+
protected get isControlled(): boolean;
|
|
867
|
+
/**
|
|
868
|
+
* Sets an imperative thread override. No-ops when the session is
|
|
869
|
+
* controlled by the host application via props.
|
|
870
|
+
*
|
|
871
|
+
* @param threadId - The thread id to activate.
|
|
872
|
+
* @param explicit - Whether the override represents a deliberate user choice.
|
|
873
|
+
*/
|
|
874
|
+
protected _setOverride(threadId: string, explicit: boolean): void;
|
|
875
|
+
/**
|
|
876
|
+
* Switches the active thread to the given id.
|
|
877
|
+
*
|
|
878
|
+
* By default the switch is treated as an explicit user-driven choice
|
|
879
|
+
* (`explicit` defaults to `true`). Pass `{ explicit: false }` to mark it as
|
|
880
|
+
* a non-explicit seed that the runtime may replace.
|
|
881
|
+
*
|
|
882
|
+
* No-ops when the threadId is controlled by the host application via props.
|
|
883
|
+
*
|
|
884
|
+
* @param threadId - The thread id to activate.
|
|
885
|
+
* @param options - Optional overrides; `explicit` defaults to `true`.
|
|
886
|
+
*/
|
|
887
|
+
setActiveThreadId(threadId: string, options?: {
|
|
888
|
+
explicit?: boolean;
|
|
889
|
+
}): void;
|
|
890
|
+
/**
|
|
891
|
+
* Abandons the current thread and starts a fresh one by minting a new UUID.
|
|
892
|
+
*
|
|
893
|
+
* The new thread is marked as non-explicit so the runtime may assign a
|
|
894
|
+
* server-side thread id once the first message is sent.
|
|
895
|
+
*
|
|
896
|
+
* No-ops when the threadId is controlled by the host application via props.
|
|
897
|
+
*/
|
|
898
|
+
startNewThread(): void;
|
|
899
|
+
/**
|
|
900
|
+
* Read-only signal reflecting the current drawer open-state.
|
|
901
|
+
*
|
|
902
|
+
* @remarks
|
|
903
|
+
* Consumed by {@link CopilotThreadsDrawer} to drive the element's controlled
|
|
904
|
+
* `open` property; a future popup or sidebar component may also toggle it to
|
|
905
|
+
* implement mobile mutual-exclusion between the drawer and other overlays.
|
|
906
|
+
*/
|
|
907
|
+
readonly drawerOpen: Signal<boolean>;
|
|
908
|
+
/**
|
|
909
|
+
* Sets the drawer open-state imperatively.
|
|
910
|
+
*
|
|
911
|
+
* @remarks
|
|
912
|
+
* Called by {@link CopilotThreadsDrawer} in response to the element's
|
|
913
|
+
* `open-change` event to keep the shared open-state coordinated.
|
|
914
|
+
*
|
|
915
|
+
* @param open - `true` to mark the drawer as open, `false` to close it.
|
|
916
|
+
*/
|
|
917
|
+
setDrawerOpen(open: boolean): void;
|
|
918
|
+
/**
|
|
919
|
+
* Computed signal that is `true` when at least one drawer instance has
|
|
920
|
+
* registered itself via {@link registerDrawer}.
|
|
921
|
+
*/
|
|
922
|
+
readonly drawerRegistered: Signal<boolean>;
|
|
923
|
+
/**
|
|
924
|
+
* Registers a drawer instance and returns an idempotent unregister function.
|
|
925
|
+
*
|
|
926
|
+
* Increments the internal drawer count so that {@link drawerRegistered}
|
|
927
|
+
* becomes `true`. The returned function decrements the count when called;
|
|
928
|
+
* calling it more than once is safe — subsequent calls are no-ops (guarded
|
|
929
|
+
* by an `active` flag, floor at 0).
|
|
930
|
+
*
|
|
931
|
+
* @remarks
|
|
932
|
+
* Called by {@link CopilotThreadsDrawer} on construction with cleanup on
|
|
933
|
+
* destroy. Intended for future popup/sidebar coordination as well.
|
|
934
|
+
*
|
|
935
|
+
* @returns An idempotent cleanup function that unregisters this drawer.
|
|
936
|
+
*/
|
|
937
|
+
registerDrawer(): () => void;
|
|
938
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CopilotChatConfiguration, never>;
|
|
939
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<CopilotChatConfiguration>;
|
|
940
|
+
}
|
|
941
|
+
/**
|
|
942
|
+
* Injection token for the {@link CopilotChatConfiguration} service instance.
|
|
943
|
+
* Use {@link injectChatConfiguration} to retrieve it from the injector.
|
|
944
|
+
*/
|
|
945
|
+
declare const COPILOT_CHAT_CONFIGURATION: InjectionToken<CopilotChatConfiguration>;
|
|
946
|
+
/**
|
|
947
|
+
* Injection token for the raw {@link CopilotChatConfigurationOptions} value
|
|
948
|
+
* supplied to {@link provideCopilotChatConfiguration}.
|
|
949
|
+
*/
|
|
950
|
+
declare const COPILOT_CHAT_CONFIGURATION_OPTIONS: InjectionToken<CopilotChatConfigurationOptions>;
|
|
951
|
+
/**
|
|
952
|
+
* Registers the {@link CopilotChatConfiguration} service and its options into
|
|
953
|
+
* the current injector.
|
|
954
|
+
*
|
|
955
|
+
* `CopilotChatConfiguration` is registered as the canonical class provider.
|
|
956
|
+
* `COPILOT_CHAT_CONFIGURATION` is aliased to the same instance via
|
|
957
|
+
* `useExisting`, so both `inject(COPILOT_CHAT_CONFIGURATION)` (via
|
|
958
|
+
* {@link injectChatConfiguration}) and a direct `inject(CopilotChatConfiguration)`
|
|
959
|
+
* resolve to the **same object** with shared signal state.
|
|
960
|
+
*
|
|
961
|
+
* @param options - Optional chat configuration overrides.
|
|
962
|
+
* @returns An array of Angular providers to pass to `providers` or
|
|
963
|
+
* `TestBed.configureTestingModule`.
|
|
964
|
+
*/
|
|
965
|
+
declare function provideCopilotChatConfiguration(options?: CopilotChatConfigurationOptions): Provider[];
|
|
966
|
+
/**
|
|
967
|
+
* Retrieves the {@link CopilotChatConfiguration} service from the current
|
|
968
|
+
* injection context.
|
|
969
|
+
*
|
|
970
|
+
* Must be called inside an injection context (component constructor, factory
|
|
971
|
+
* function, or `TestBed.runInInjectionContext`).
|
|
972
|
+
*/
|
|
973
|
+
declare function injectChatConfiguration(): CopilotChatConfiguration;
|
|
974
|
+
|
|
560
975
|
declare abstract class ChatState {
|
|
561
976
|
abstract readonly inputValue: WritableSignal<string>;
|
|
562
977
|
readonly attachments: WritableSignal<Attachment[]>;
|
|
@@ -709,6 +1124,112 @@ interface ConnectAgentContextConfig {
|
|
|
709
1124
|
*/
|
|
710
1125
|
declare function connectAgentContext(context: Context | Signal<Context>, config?: ConnectAgentContextConfig): void;
|
|
711
1126
|
|
|
1127
|
+
/**
|
|
1128
|
+
* Return value of {@link injectMemories}.
|
|
1129
|
+
*
|
|
1130
|
+
* The `memories` signal is the server-authoritative list for the current
|
|
1131
|
+
* runtime-authenticated user. It is hydrated from a REST snapshot and kept
|
|
1132
|
+
* current by realtime `memory_metadata` deltas pushed over the memory store's
|
|
1133
|
+
* own channel. Mutations resolve once the platform confirms the operation and
|
|
1134
|
+
* reject with an `Error` on failure.
|
|
1135
|
+
*/
|
|
1136
|
+
interface MemoriesController {
|
|
1137
|
+
/**
|
|
1138
|
+
* Memories for the current user, newest first. Updated in realtime when the
|
|
1139
|
+
* platform pushes `memory_metadata` events over the memory store's channel.
|
|
1140
|
+
*/
|
|
1141
|
+
memories: Signal<Memory[]>;
|
|
1142
|
+
/**
|
|
1143
|
+
* `true` while the initial memory snapshot is being fetched. Subsequent
|
|
1144
|
+
* realtime updates do not re-enter the loading state.
|
|
1145
|
+
*/
|
|
1146
|
+
isLoading: Signal<boolean>;
|
|
1147
|
+
/**
|
|
1148
|
+
* The most recent error from fetching memories or a mutation, or `null`
|
|
1149
|
+
* when there is no error. Cleared on the next fetch attempt, on a
|
|
1150
|
+
* successful fetch, when the runtime context changes, and on a successful
|
|
1151
|
+
* mutation (a failed mutation replaces it with that mutation's error).
|
|
1152
|
+
*/
|
|
1153
|
+
error: Signal<Error | null>;
|
|
1154
|
+
/**
|
|
1155
|
+
* `true` when the platform memory routes are available. Set to `false`
|
|
1156
|
+
* after a 404 or 501, indicating memory is not supported by the current
|
|
1157
|
+
* runtime configuration.
|
|
1158
|
+
*/
|
|
1159
|
+
isAvailable: Signal<boolean>;
|
|
1160
|
+
/**
|
|
1161
|
+
* Health of the realtime connection that streams live `memory_metadata`
|
|
1162
|
+
* deltas. Distinct from `isAvailable`/`error` (which describe the REST list
|
|
1163
|
+
* route): `"connecting"` while the socket opens/joins, `"connected"` once
|
|
1164
|
+
* live deltas are flowing, and `"unavailable"` once the socket permanently
|
|
1165
|
+
* gives up — at which point the list is a frozen snapshot. Lets a template
|
|
1166
|
+
* drop a "live" indicator instead of showing it over stale data.
|
|
1167
|
+
*/
|
|
1168
|
+
realtimeStatus: Signal<MemoryRealtimeStatus>;
|
|
1169
|
+
/**
|
|
1170
|
+
* Re-fetch the memory snapshot from the platform. Resolves when the re-pull
|
|
1171
|
+
* succeeds; rejects if it fails or the store is torn down mid-flight.
|
|
1172
|
+
*/
|
|
1173
|
+
refresh: () => Promise<void>;
|
|
1174
|
+
/**
|
|
1175
|
+
* Create a memory. Resolves to the stored memory (server-authoritative);
|
|
1176
|
+
* rejects on failure.
|
|
1177
|
+
*/
|
|
1178
|
+
addMemory: (input: NewMemory) => Promise<Memory>;
|
|
1179
|
+
/**
|
|
1180
|
+
* Supersede a memory: the old memory is retired and a new one is created.
|
|
1181
|
+
* Resolves to the new memory (its `id` differs from the supplied `id`);
|
|
1182
|
+
* rejects on failure.
|
|
1183
|
+
*
|
|
1184
|
+
* Supersede is a FULL replacement, not a partial patch: `changes` is the
|
|
1185
|
+
* complete definition of the new memory. You must re-supply `content` and
|
|
1186
|
+
* `kind`, and an omitted `sourceThreadIds` resets the new memory's source
|
|
1187
|
+
* threads to empty — it does not preserve the prior memory's value.
|
|
1188
|
+
*/
|
|
1189
|
+
updateMemory: (id: string, changes: MemoryChanges) => Promise<Memory>;
|
|
1190
|
+
/**
|
|
1191
|
+
* Retire a memory (non-lossy delete). Resolves when the server confirms;
|
|
1192
|
+
* rejects on failure.
|
|
1193
|
+
*/
|
|
1194
|
+
removeMemory: (id: string) => Promise<void>;
|
|
1195
|
+
}
|
|
1196
|
+
/**
|
|
1197
|
+
* Angular injection function for listing and managing platform memories — the
|
|
1198
|
+
* signal-based counterpart to react-core's `useMemories`.
|
|
1199
|
+
*
|
|
1200
|
+
* Reads the user-scoped memory store owned and wired by `CopilotKitCore`. The
|
|
1201
|
+
* binding does not create, register, start, or stop the store: core owns its
|
|
1202
|
+
* lifecycle and opens its own `user_meta:memories:<joinCode>` channel, applying
|
|
1203
|
+
* `memory_metadata` deltas to the list. The binding only bridges the store's
|
|
1204
|
+
* selectors onto Angular signals and forwards the stable mutation callbacks.
|
|
1205
|
+
*
|
|
1206
|
+
* Mutations are server-authoritative: each resolves once the platform confirms
|
|
1207
|
+
* the operation and rejects with an `Error` on failure. You can still call
|
|
1208
|
+
* `refresh()` to re-pull the REST snapshot on demand.
|
|
1209
|
+
*
|
|
1210
|
+
* Must be called inside an injection context (component constructor, field
|
|
1211
|
+
* initializer, `inject` callback, or `TestBed.runInInjectionContext`) so the
|
|
1212
|
+
* selector→signal bridges (`toSignal`) tear down with the host.
|
|
1213
|
+
*
|
|
1214
|
+
* @returns Signals for memory state and stable mutation callbacks.
|
|
1215
|
+
*
|
|
1216
|
+
* @example
|
|
1217
|
+
* ```ts
|
|
1218
|
+
* import { injectMemories } from "@copilotkit/angular";
|
|
1219
|
+
*
|
|
1220
|
+
* @Component({ ... })
|
|
1221
|
+
* class MemoryList {
|
|
1222
|
+
* readonly #m = injectMemories();
|
|
1223
|
+
* memories = this.#m.memories;
|
|
1224
|
+
* isLoading = this.#m.isLoading;
|
|
1225
|
+
* isAvailable = this.#m.isAvailable;
|
|
1226
|
+
*
|
|
1227
|
+
* remove(id: string) { this.#m.removeMemory(id); }
|
|
1228
|
+
* }
|
|
1229
|
+
* ```
|
|
1230
|
+
*/
|
|
1231
|
+
declare function injectMemories(): MemoriesController;
|
|
1232
|
+
|
|
712
1233
|
/**
|
|
713
1234
|
* Represents a value that can be used as a slot override.
|
|
714
1235
|
* Can be a component type or template reference only.
|
|
@@ -1078,6 +1599,13 @@ declare class CopilotChat extends ChatState {
|
|
|
1078
1599
|
readonly threadId: _angular_core.InputSignal<string>;
|
|
1079
1600
|
readonly inputComponent: _angular_core.InputSignal<Type<any>>;
|
|
1080
1601
|
readonly attachmentsConfig: _angular_core.InputSignal<AttachmentsConfig>;
|
|
1602
|
+
/**
|
|
1603
|
+
* Ambient chat configuration, when a {@link provideCopilotChatConfiguration}
|
|
1604
|
+
* provider is in scope. Absent (`null`) for standalone
|
|
1605
|
+
* `<copilot-chat [threadId]>` usage, which has no provider — resolved via the
|
|
1606
|
+
* optional inject so the component does not throw without one.
|
|
1607
|
+
*/
|
|
1608
|
+
private readonly config;
|
|
1081
1609
|
protected readonly resolvedAgentId: _angular_core.Signal<string>;
|
|
1082
1610
|
readonly agentStore: _angular_core.Signal<_copilotkit_angular.AgentStore>;
|
|
1083
1611
|
private readonly copilotKit;
|
|
@@ -1194,7 +1722,7 @@ declare class CopilotChat extends ChatState {
|
|
|
1194
1722
|
encryptedValue?: string | undefined;
|
|
1195
1723
|
})[]>;
|
|
1196
1724
|
protected isRunning: _angular_core.Signal<boolean>;
|
|
1197
|
-
protected hasExplicitThreadId: _angular_core.Signal<boolean>;
|
|
1725
|
+
protected readonly hasExplicitThreadId: _angular_core.Signal<boolean>;
|
|
1198
1726
|
protected readonly agentRef: _angular_core.Signal<AbstractAgent>;
|
|
1199
1727
|
protected readonly resolvedThreadId: _angular_core.Signal<string>;
|
|
1200
1728
|
readonly attachmentsEnabled: _angular_core.Signal<boolean>;
|
|
@@ -4535,6 +5063,300 @@ interface CopilotChatViewLayoutContext {
|
|
|
4535
5063
|
disclaimer: any;
|
|
4536
5064
|
}
|
|
4537
5065
|
|
|
5066
|
+
/**
|
|
5067
|
+
* Structural directive that captures a per-row template for projection into
|
|
5068
|
+
* the `<copilotkit-threads-drawer>` element as light-DOM children with
|
|
5069
|
+
* `slot="row:{id}"`.
|
|
5070
|
+
*
|
|
5071
|
+
* Apply it to an `<ng-template>` that is a direct child of `<copilot-threads-drawer>`.
|
|
5072
|
+
* The implicit context variable (`let-t`) receives the full {@link Thread}
|
|
5073
|
+
* record for that row.
|
|
5074
|
+
*
|
|
5075
|
+
* @example
|
|
5076
|
+
* ```html
|
|
5077
|
+
* <copilot-threads-drawer>
|
|
5078
|
+
* <ng-template copilotThreadsDrawerRow let-t>
|
|
5079
|
+
* <span>{{ t.name }}</span>
|
|
5080
|
+
* </ng-template>
|
|
5081
|
+
* </copilot-threads-drawer>
|
|
5082
|
+
* ```
|
|
5083
|
+
*/
|
|
5084
|
+
declare class CopilotThreadsDrawerRow {
|
|
5085
|
+
/** The captured template reference for the per-row content. */
|
|
5086
|
+
readonly template: TemplateRef<any>;
|
|
5087
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CopilotThreadsDrawerRow, never>;
|
|
5088
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CopilotThreadsDrawerRow, "[copilotThreadsDrawerRow]", never, {}, {}, never, never, true, never>;
|
|
5089
|
+
}
|
|
5090
|
+
/**
|
|
5091
|
+
* Angular wrapper around the `<copilotkit-threads-drawer>` Lit web component.
|
|
5092
|
+
*
|
|
5093
|
+
* Registers the custom element on construction (idempotent; SSR-guarded
|
|
5094
|
+
* internally by {@link defineCopilotKitThreadsDrawer}) and projects it into the DOM
|
|
5095
|
+
* via the `CUSTOM_ELEMENTS_SCHEMA`-enabled template.
|
|
5096
|
+
*
|
|
5097
|
+
* Thread list state is fetched from the Intelligence platform via
|
|
5098
|
+
* {@link injectThreads} and pushed onto the element's JS properties via an
|
|
5099
|
+
* `effect`, following the imperative property-assignment pattern used elsewhere
|
|
5100
|
+
* in this package (see `CopilotA2UIActivityRenderer`).
|
|
5101
|
+
*
|
|
5102
|
+
* DOM events emitted by the element are routed back to the chat configuration
|
|
5103
|
+
* and thread mutation methods via declarative Angular event bindings.
|
|
5104
|
+
*
|
|
5105
|
+
* @example
|
|
5106
|
+
* ```html
|
|
5107
|
+
* <copilot-threads-drawer data-testid="my-drawer" />
|
|
5108
|
+
* ```
|
|
5109
|
+
*/
|
|
5110
|
+
declare class CopilotThreadsDrawer {
|
|
5111
|
+
/**
|
|
5112
|
+
* Optional agent id whose threads this drawer lists/manages. Scopes the
|
|
5113
|
+
* {@link injectThreads} store (via the resolved-agent precedence: this input
|
|
5114
|
+
* → ambient config's `agentId` → {@link DEFAULT_AGENT_ID}). NOT forwarded to
|
|
5115
|
+
* the element (the element has no `agentId` property).
|
|
5116
|
+
*/
|
|
5117
|
+
readonly agentId: _angular_core.InputSignal<string>;
|
|
5118
|
+
/**
|
|
5119
|
+
* Value applied as the `data-testid` attribute on the inner
|
|
5120
|
+
* `<copilotkit-threads-drawer>` element. Defaults to `"copilot-threads-drawer"`.
|
|
5121
|
+
*/
|
|
5122
|
+
readonly dataTestId: _angular_core.InputSignal<string>;
|
|
5123
|
+
/**
|
|
5124
|
+
* Optional accessible/region + default-header label forwarded to the element's
|
|
5125
|
+
* `label` property; defaults to the element's own `"Threads"` when unset.
|
|
5126
|
+
*/
|
|
5127
|
+
readonly label: _angular_core.InputSignal<string>;
|
|
5128
|
+
/**
|
|
5129
|
+
* Optional heading for the "Recent Conversations" section, forwarded to the
|
|
5130
|
+
* element's `recent-label` attribute; defaults to the element's own
|
|
5131
|
+
* `"Recent Conversations"` when unset.
|
|
5132
|
+
*/
|
|
5133
|
+
readonly recentLabel: _angular_core.InputSignal<string>;
|
|
5134
|
+
/**
|
|
5135
|
+
* Whether the drawer offers a collapse toggle. Pushed onto the element's
|
|
5136
|
+
* `collapsible` PROPERTY (a default-true boolean, exactly like `licensed` — a
|
|
5137
|
+
* string attribute cannot represent it since any non-empty value is truthy).
|
|
5138
|
+
* When `false`, the drawer has no collapse toggle and is always expanded.
|
|
5139
|
+
* Defaults to the element's own `true` when unset.
|
|
5140
|
+
*/
|
|
5141
|
+
readonly collapsible: _angular_core.InputSignal<boolean>;
|
|
5142
|
+
/**
|
|
5143
|
+
* Emits the new collapsed state whenever the drawer's collapsed state changes
|
|
5144
|
+
* (mirrors the element's `collapse-change` event).
|
|
5145
|
+
*/
|
|
5146
|
+
readonly collapseChange: EventEmitter<boolean>;
|
|
5147
|
+
/**
|
|
5148
|
+
* Optional host override for the thread-select action.
|
|
5149
|
+
*
|
|
5150
|
+
* When provided, this callback is invoked instead of driving
|
|
5151
|
+
* `config.setActiveThreadId`. Bound via `[onThreadSelect]="fn"`.
|
|
5152
|
+
*/
|
|
5153
|
+
readonly threadSelectHandler: _angular_core.InputSignal<(threadId: string) => void>;
|
|
5154
|
+
/**
|
|
5155
|
+
* Optional host override for the new-thread action.
|
|
5156
|
+
*
|
|
5157
|
+
* When provided, this callback is invoked instead of driving
|
|
5158
|
+
* `config.startNewThread`. The core `threads.startNewThread()` reset is
|
|
5159
|
+
* always called regardless. Bound via `[onNewThread]="fn"`.
|
|
5160
|
+
*/
|
|
5161
|
+
readonly newThreadHandler: _angular_core.InputSignal<() => void>;
|
|
5162
|
+
/**
|
|
5163
|
+
* Page size for thread pagination. When set, threads load in pages of this
|
|
5164
|
+
* size and the element shows a "Load more" control while more remain. When
|
|
5165
|
+
* unset, the full list loads at once and no pagination control shows.
|
|
5166
|
+
*/
|
|
5167
|
+
readonly limit: _angular_core.InputSignal<number>;
|
|
5168
|
+
/**
|
|
5169
|
+
* Destination the locked view's Upgrade CTA opens in a new tab. Forwarded to
|
|
5170
|
+
* the element's `licenseUrl` property; defaults to the element's built-in
|
|
5171
|
+
* CopilotKit Intelligence docs URL when unset. Set to an empty string to
|
|
5172
|
+
* suppress the default navigation and handle the click via `onLicensed`.
|
|
5173
|
+
*/
|
|
5174
|
+
readonly licenseUrl: _angular_core.InputSignal<string>;
|
|
5175
|
+
/**
|
|
5176
|
+
* Optional host hook fired when the locked view's Upgrade CTA is clicked. The
|
|
5177
|
+
* element still performs its default navigation unless `licenseUrl` is blank;
|
|
5178
|
+
* use this for telemetry or to drive your own upgrade flow. Bound via
|
|
5179
|
+
* `[onLicensed]="fn"`.
|
|
5180
|
+
*/
|
|
5181
|
+
readonly licensedHandler: _angular_core.InputSignal<() => void>;
|
|
5182
|
+
private readonly config;
|
|
5183
|
+
private readonly copilotkit;
|
|
5184
|
+
private readonly drawerRef;
|
|
5185
|
+
/**
|
|
5186
|
+
* Optional per-row template directive projected as a direct child of this
|
|
5187
|
+
* component. When present, a `<div slot="row:{id}">` is rendered inside the
|
|
5188
|
+
* `<copilotkit-threads-drawer>` element for each thread, allowing the host to inject
|
|
5189
|
+
* custom light-DOM content into each row slot.
|
|
5190
|
+
*/
|
|
5191
|
+
protected readonly rowDirective: _angular_core.Signal<CopilotThreadsDrawerRow>;
|
|
5192
|
+
/**
|
|
5193
|
+
* The resolved agent id for the threads store. Precedence:
|
|
5194
|
+
* 1. `agentId` input prop.
|
|
5195
|
+
* 2. Ambient `CopilotChatConfiguration.agentId`.
|
|
5196
|
+
* 3. {@link DEFAULT_AGENT_ID}.
|
|
5197
|
+
*/
|
|
5198
|
+
protected readonly resolvedAgentId: _angular_core.Signal<string>;
|
|
5199
|
+
/**
|
|
5200
|
+
* Normalized license context derived from the core's runtime-reported status,
|
|
5201
|
+
* via the same `@copilotkit/shared` helper the React provider uses.
|
|
5202
|
+
*/
|
|
5203
|
+
private readonly licenseContext;
|
|
5204
|
+
/**
|
|
5205
|
+
* Two-pronged license gate, mirroring the React wrapper. `checkFeature` fails
|
|
5206
|
+
* OPEN (returns true) when no license is configured, so it cannot by itself
|
|
5207
|
+
* detect the no-license case; we therefore also require a positive
|
|
5208
|
+
* license-present signal. Only a resolved `valid`/`expiring` status counts as
|
|
5209
|
+
* present — a resolved `none`/`expired`/`invalid` gates the drawer to the
|
|
5210
|
+
* locked view.
|
|
5211
|
+
*/
|
|
5212
|
+
protected readonly licensed: _angular_core.Signal<boolean>;
|
|
5213
|
+
/**
|
|
5214
|
+
* Whether the runtime has not yet reported a license status. The status is
|
|
5215
|
+
* `null` until the first `/info` response lands; treat that window as
|
|
5216
|
+
* "not yet unlicensed" — show the loading state, never the locked view — so a
|
|
5217
|
+
* licensed drawer never flashes (or strands) the Upgrade CTA mid-resolution.
|
|
5218
|
+
*/
|
|
5219
|
+
protected readonly licensePending: _angular_core.Signal<boolean>;
|
|
5220
|
+
/** Live thread list from the Intelligence platform for the resolved agent. */
|
|
5221
|
+
protected readonly threads: _copilotkit_angular.InjectThreadsResult;
|
|
5222
|
+
/** Thread records mapped to the element's {@link DrawerThread} shape. */
|
|
5223
|
+
protected readonly drawerThreads: _angular_core.Signal<DrawerThread[]>;
|
|
5224
|
+
/**
|
|
5225
|
+
* User-facing error message from the filtered list error signal, or `null`
|
|
5226
|
+
* when there is no error. Uses `listError` (not `error`) so developer/config
|
|
5227
|
+
* errors (missing runtime URL, runtime without thread endpoints) are excluded
|
|
5228
|
+
* and never displayed to end users.
|
|
5229
|
+
*/
|
|
5230
|
+
protected readonly errorMessage: _angular_core.Signal<string>;
|
|
5231
|
+
/**
|
|
5232
|
+
* The currently-active thread id, sourced from the ambient chat
|
|
5233
|
+
* configuration, or `null` when no configuration is present.
|
|
5234
|
+
*/
|
|
5235
|
+
protected readonly activeThreadId: _angular_core.Signal<string>;
|
|
5236
|
+
/**
|
|
5237
|
+
* User-facing fetch-more error message from the dedicated fetch-more error
|
|
5238
|
+
* signal, or `null`. Drives the element's inline "couldn't load more — retry"
|
|
5239
|
+
* panel without disturbing the loaded list or the initial-list `error`.
|
|
5240
|
+
*/
|
|
5241
|
+
protected readonly fetchMoreErrorMessage: _angular_core.Signal<string>;
|
|
5242
|
+
private readonly destroyRef;
|
|
5243
|
+
/**
|
|
5244
|
+
* Provider-less fallback open-state. Without a surrounding chat configuration
|
|
5245
|
+
* there is no shared open-state to bind to, so the wrapper keeps its own
|
|
5246
|
+
* local state. Starts CLOSED — matching the configuration's own default — so
|
|
5247
|
+
* the element does not spring open (and scroll-lock the page on mobile) on
|
|
5248
|
+
* load, and the element's `open-change` events still toggle it.
|
|
5249
|
+
*/
|
|
5250
|
+
private readonly localDrawerOpen;
|
|
5251
|
+
/**
|
|
5252
|
+
* The effective drawer open-state: the ambient chat configuration's
|
|
5253
|
+
* `drawerOpen` when present, else the provider-less {@link localDrawerOpen}.
|
|
5254
|
+
* Pushed onto the element's controlled `open` property in the effect below.
|
|
5255
|
+
*/
|
|
5256
|
+
protected readonly drawerOpen: _angular_core.Signal<boolean>;
|
|
5257
|
+
constructor();
|
|
5258
|
+
/**
|
|
5259
|
+
* Handles the `thread-selected` event from the drawer element.
|
|
5260
|
+
*
|
|
5261
|
+
* When a `threadSelectHandler` override is provided by the host, it is called
|
|
5262
|
+
* exclusively. Otherwise, the ambient chat configuration is driven directly so
|
|
5263
|
+
* a bare `<copilot-threads-drawer>` works without any host wiring.
|
|
5264
|
+
*
|
|
5265
|
+
* @param event - The raw DOM event; cast to `CustomEvent<ThreadSelectedDetail>` to extract `threadId`.
|
|
5266
|
+
*/
|
|
5267
|
+
protected onThreadSelected(event: Event): void;
|
|
5268
|
+
/**
|
|
5269
|
+
* Handles the `open-change` event from the drawer element.
|
|
5270
|
+
*
|
|
5271
|
+
* Drives the ambient chat configuration's `setDrawerOpen` when present, else
|
|
5272
|
+
* the provider-less {@link localDrawerOpen} fallback — mirroring the React
|
|
5273
|
+
* and Vue wrappers so the element's open-state stays coordinated.
|
|
5274
|
+
*
|
|
5275
|
+
* @param event - The raw DOM event; cast to `CustomEvent<OpenChangeDetail>` to extract `open`.
|
|
5276
|
+
*/
|
|
5277
|
+
protected onOpenChange(event: Event): void;
|
|
5278
|
+
/**
|
|
5279
|
+
* Handles the `new-thread` event from the drawer element.
|
|
5280
|
+
*
|
|
5281
|
+
* Always resets the core thread store to a fresh, non-explicit client-side
|
|
5282
|
+
* thread first. When a `newThreadHandler` override is provided by the host,
|
|
5283
|
+
* it is called exclusively. Otherwise, the ambient chat configuration is
|
|
5284
|
+
* driven directly so a bare `<copilot-threads-drawer>` works without any host wiring.
|
|
5285
|
+
*/
|
|
5286
|
+
protected onNewThread(): void;
|
|
5287
|
+
/**
|
|
5288
|
+
* Handles the `archive` event from the drawer element.
|
|
5289
|
+
*
|
|
5290
|
+
* Delegates to the threads mutation and logs any failure to the console.
|
|
5291
|
+
*
|
|
5292
|
+
* @param event - The raw DOM event; cast to `CustomEvent<ArchiveDetail>` to extract `threadId`.
|
|
5293
|
+
*/
|
|
5294
|
+
protected onArchive(event: Event): void;
|
|
5295
|
+
/**
|
|
5296
|
+
* Handles the `unarchive` event from the drawer element.
|
|
5297
|
+
*
|
|
5298
|
+
* Delegates to the threads mutation and logs any failure to the console.
|
|
5299
|
+
*
|
|
5300
|
+
* @param event - The raw DOM event; cast to `CustomEvent<UnarchiveDetail>` to extract `threadId`.
|
|
5301
|
+
*/
|
|
5302
|
+
protected onUnarchive(event: Event): void;
|
|
5303
|
+
/**
|
|
5304
|
+
* Handles the `delete` event from the drawer element.
|
|
5305
|
+
*
|
|
5306
|
+
* Deleting the active thread resets to a fresh, non-explicit thread so the
|
|
5307
|
+
* user is not stranded on a now-gone conversation. Archiving the active
|
|
5308
|
+
* thread keeps the user viewing it.
|
|
5309
|
+
*
|
|
5310
|
+
* The core `threads.startNewThread()` reset is always called when the deleted
|
|
5311
|
+
* thread was active. When a `newThreadHandler` override is provided by the
|
|
5312
|
+
* host, it is called exclusively; otherwise the ambient chat configuration is
|
|
5313
|
+
* driven directly.
|
|
5314
|
+
*
|
|
5315
|
+
* @param event - The raw DOM event; cast to `CustomEvent<DeleteDetail>` to extract `threadId`.
|
|
5316
|
+
*/
|
|
5317
|
+
protected onDelete(event: Event): void;
|
|
5318
|
+
/**
|
|
5319
|
+
* Handles the `filter-change` event from the drawer element.
|
|
5320
|
+
*
|
|
5321
|
+
* The element owns the Active/All filter; on change we refetch so the list
|
|
5322
|
+
* reflects the server.
|
|
5323
|
+
*/
|
|
5324
|
+
protected onFilterChange(): void;
|
|
5325
|
+
/**
|
|
5326
|
+
* Handles the `collapse-change` event from the drawer element — re-emits the
|
|
5327
|
+
* new collapsed state through the component's `collapseChange` output so hosts
|
|
5328
|
+
* can observe (or persist) the drawer's collapsed state.
|
|
5329
|
+
*
|
|
5330
|
+
* @param event - The raw DOM event; cast to `CustomEvent<CollapseChangeDetail>` to extract `collapsed`.
|
|
5331
|
+
*/
|
|
5332
|
+
protected onCollapseChange(event: Event): void;
|
|
5333
|
+
/**
|
|
5334
|
+
* Handles the `retry` event from the drawer element.
|
|
5335
|
+
*
|
|
5336
|
+
* `scope` distinguishes an initial fetch retry from a fetch-more retry so
|
|
5337
|
+
* the correct pagination operation is invoked.
|
|
5338
|
+
*
|
|
5339
|
+
* @param event - The raw DOM event; cast to `CustomEvent<RetryDetail>` to extract `scope`.
|
|
5340
|
+
*/
|
|
5341
|
+
protected onRetry(event: Event): void;
|
|
5342
|
+
/**
|
|
5343
|
+
* Handles the `load-more` event from the drawer element — advances pagination
|
|
5344
|
+
* by fetching the next page. No-op when there is no next page (the element
|
|
5345
|
+
* only surfaces the "Load more" control while `hasMoreThreads` is true).
|
|
5346
|
+
*/
|
|
5347
|
+
protected onLoadMore(): void;
|
|
5348
|
+
/**
|
|
5349
|
+
* Handles the `licensed` event from the drawer element (Upgrade CTA click).
|
|
5350
|
+
*
|
|
5351
|
+
* The element performs its own default navigation to `licenseUrl`; this hook
|
|
5352
|
+
* lets the host observe the click (e.g. for telemetry) or drive a custom
|
|
5353
|
+
* upgrade flow when provided via `[onLicensed]`.
|
|
5354
|
+
*/
|
|
5355
|
+
protected onLicensed(): void;
|
|
5356
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CopilotThreadsDrawer, never>;
|
|
5357
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CopilotThreadsDrawer, "copilot-threads-drawer", never, { "agentId": { "alias": "agentId"; "required": false; "isSignal": true; }; "dataTestId": { "alias": "data-testid"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "recentLabel": { "alias": "recentLabel"; "required": false; "isSignal": true; }; "collapsible": { "alias": "collapsible"; "required": false; "isSignal": true; }; "threadSelectHandler": { "alias": "onThreadSelect"; "required": false; "isSignal": true; }; "newThreadHandler": { "alias": "onNewThread"; "required": false; "isSignal": true; }; "limit": { "alias": "limit"; "required": false; "isSignal": true; }; "licenseUrl": { "alias": "licenseUrl"; "required": false; "isSignal": true; }; "licensedHandler": { "alias": "onLicensed"; "required": false; "isSignal": true; }; }, { "collapseChange": "collapseChange"; }, ["rowDirective"], ["*"], true, never>;
|
|
5358
|
+
}
|
|
5359
|
+
|
|
4538
5360
|
declare class CopilotA2UIActivityRenderer implements ActivityRenderer<unknown> {
|
|
4539
5361
|
readonly activityType: _angular_core.InputSignal<string>;
|
|
4540
5362
|
readonly content: _angular_core.InputSignal<unknown>;
|
|
@@ -4706,5 +5528,5 @@ declare class CopilotOpenGenerativeUIToolRenderer implements ToolRenderer<Genera
|
|
|
4706
5528
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CopilotOpenGenerativeUIToolRenderer, "copilot-open-generative-ui-tool-renderer", never, { "toolCall": { "alias": "toolCall"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
4707
5529
|
}
|
|
4708
5530
|
|
|
4709
|
-
export { AGUI_SEND_STATE_SNAPSHOT_TOOL_NAME, AgentStore, AudioRecorderError, COPILOT_CHAT_DEFAULT_LABELS, COPILOT_CHAT_LABELS, COPILOT_KIT_CONFIG, ChatState, CopilotA2UIActivityRenderer, CopilotA2UIProgress, CopilotA2UIToolRenderer, CopilotChat, CopilotChatAddFileButton, CopilotChatAssistantMessage, CopilotChatAssistantMessageCopyButton, CopilotChatAssistantMessageReadAloudButton, CopilotChatAssistantMessageRegenerateButton, CopilotChatAssistantMessageRenderer, CopilotChatAssistantMessageThumbsDownButton, CopilotChatAssistantMessageThumbsUpButton, CopilotChatAssistantMessageToolbar, CopilotChatAssistantMessageToolbarButton, CopilotChatAttachmentQueue, CopilotChatAttachmentRenderer, CopilotChatAttachmentsDirective, CopilotChatAudioRecorder, CopilotChatCancelTranscribeButton, CopilotChatFinishTranscribeButton, CopilotChatInput, CopilotChatInputDefaults, CopilotChatMessageView, CopilotChatMessageViewCursor, CopilotChatReasoningMessage, CopilotChatSendButton, CopilotChatStartTranscribeButton, CopilotChatSuggestionPill, CopilotChatSuggestionView, CopilotChatTextarea, CopilotChatToolCallsView, CopilotChatToolbar, CopilotChatToolbarButton, CopilotChatToolsMenu, CopilotChatUserMessage, CopilotChatUserMessageBranchNavigation, CopilotChatUserMessageCopyButton, CopilotChatUserMessageEditButton, CopilotChatUserMessageRenderer, CopilotChatUserMessageToolbar, CopilotChatUserMessageToolbarButton, CopilotChatView, CopilotChatViewDisclaimer, CopilotChatViewFeather, CopilotChatViewHandlers, CopilotChatViewInputContainer, CopilotChatViewScrollToBottomButton, CopilotChatViewScrollView, CopilotKit, CopilotKitAgentContext, CopilotOpenGenerativeUIActivityRenderer, CopilotOpenGenerativeUIRenderer, CopilotOpenGenerativeUIToolRenderer, CopilotSlot, CopilotTooltip, CopilotkitAgentFactory, DEFAULT_OPEN_GENERATIVE_UI_DESIGN_SKILL, GENERATE_SANDBOXED_UI_DESCRIPTION, GENERATE_SANDBOXED_UI_TOOL_NAME, GenerateSandboxedUiArgsSchema, OPEN_GENERATIVE_UI_ACTIVITY_TYPE, OPEN_GENERATIVE_UI_WEBSANDBOX_LOADER, OpenGenerativeUIContentSchema, RENDER_A2UI_TOOL_NAME, RenderA2UIArgsSchema, RenderToolCalls, ResizeObserverService, SLOT_CONFIG, ScrollPosition, StickToBottom, TooltipContent, TranscriptionError, anyActivityContentSchema, cn, connectAgentContext, createSlotConfig, createSlotRenderer, getSlotConfig, injectAgentStore, injectChatLabels, injectChatState, injectCopilotKitConfig, isComponentType, isSlotValue, normalizeSlotValue, provideCopilotChatLabels, provideCopilotKit, provideSlots, registerFrontendTool, registerHumanInTheLoop, registerRenderToolCall, renderSlot, transcribeAudio };
|
|
4710
|
-
export type { A2UIConfig, ActivityRenderer, AngularActivityContentParseResult, AngularActivityContentSchema, AngularToolCall, AssistantMessageCopyButtonContext, AssistantMessageMarkdownRendererContext, AssistantMessageToolbarContext, AudioRecorderState, BranchNavigationContext, ClientTool, ConnectAgentContextConfig, CopilotChatAssistantMessageOnReadAloudProps, CopilotChatAssistantMessageOnRegenerateProps, CopilotChatAssistantMessageOnThumbsDownProps, CopilotChatAssistantMessageOnThumbsUpProps, CopilotChatAudioRecorderProps, CopilotChatButtonProps, CopilotChatInputConfig, CopilotChatInputMode, CopilotChatInputOutputs, CopilotChatInputSlots, CopilotChatLabels, CopilotChatMessageViewProps, CopilotChatTextareaProps, CopilotChatToolbarButtonProps, CopilotChatToolbarProps, CopilotChatToolsButtonProps, CopilotChatUserMessageOnEditMessageProps, CopilotChatUserMessageOnSwitchToBranchProps, CopilotChatViewLayoutContext, CopilotChatViewProps, CopilotKitConfig, CopyButtonContext, CursorContext, EditButtonContext, FrontendToolConfig, GenerateSandboxedUiArgs, HumanInTheLoopConfig, HumanInTheLoopToolCall, HumanInTheLoopToolRenderer, MessageRendererContext, MessageViewContext, OpenGenerativeUIConfig, OpenGenerativeUIContent, ReadAloudButtonContext, RegenerateButtonContext, RenderA2UIArgs, RenderActivityMessageConfig, RenderSlotOptions, RenderToolCallConfig, ResizeState, SandboxFunction, ScrollBehavior, ScrollState, SendButtonContext, SlotConfig, SlotContext, SlotRegistryEntry, SlotValue, ThumbsDownButtonContext, ThumbsUpButtonContext, ToolRenderer, ToolbarContext, ToolsMenuItem, TranscriptionErrorInfo, TranscriptionResult, UserMessageToolbarContext, WithSlots };
|
|
5531
|
+
export { AGUI_SEND_STATE_SNAPSHOT_TOOL_NAME, AgentStore, AudioRecorderError, COPILOT_CHAT_CONFIGURATION, COPILOT_CHAT_CONFIGURATION_OPTIONS, COPILOT_CHAT_DEFAULT_LABELS, COPILOT_CHAT_LABELS, COPILOT_KIT_CONFIG, ChatState, CopilotA2UIActivityRenderer, CopilotA2UIProgress, CopilotA2UIToolRenderer, CopilotChat, CopilotChatAddFileButton, CopilotChatAssistantMessage, CopilotChatAssistantMessageCopyButton, CopilotChatAssistantMessageReadAloudButton, CopilotChatAssistantMessageRegenerateButton, CopilotChatAssistantMessageRenderer, CopilotChatAssistantMessageThumbsDownButton, CopilotChatAssistantMessageThumbsUpButton, CopilotChatAssistantMessageToolbar, CopilotChatAssistantMessageToolbarButton, CopilotChatAttachmentQueue, CopilotChatAttachmentRenderer, CopilotChatAttachmentsDirective, CopilotChatAudioRecorder, CopilotChatCancelTranscribeButton, CopilotChatConfiguration, CopilotChatFinishTranscribeButton, CopilotChatInput, CopilotChatInputDefaults, CopilotChatMessageView, CopilotChatMessageViewCursor, CopilotChatReasoningMessage, CopilotChatSendButton, CopilotChatStartTranscribeButton, CopilotChatSuggestionPill, CopilotChatSuggestionView, CopilotChatTextarea, CopilotChatToolCallsView, CopilotChatToolbar, CopilotChatToolbarButton, CopilotChatToolsMenu, CopilotChatUserMessage, CopilotChatUserMessageBranchNavigation, CopilotChatUserMessageCopyButton, CopilotChatUserMessageEditButton, CopilotChatUserMessageRenderer, CopilotChatUserMessageToolbar, CopilotChatUserMessageToolbarButton, CopilotChatView, CopilotChatViewDisclaimer, CopilotChatViewFeather, CopilotChatViewHandlers, CopilotChatViewInputContainer, CopilotChatViewScrollToBottomButton, CopilotChatViewScrollView, CopilotKit, CopilotKitAgentContext, CopilotOpenGenerativeUIActivityRenderer, CopilotOpenGenerativeUIRenderer, CopilotOpenGenerativeUIToolRenderer, CopilotSlot, CopilotThreadsDrawer, CopilotThreadsDrawerRow, CopilotTooltip, CopilotkitAgentFactory, CopilotkitThreadsFactory, DEFAULT_OPEN_GENERATIVE_UI_DESIGN_SKILL, GENERATE_SANDBOXED_UI_DESCRIPTION, GENERATE_SANDBOXED_UI_TOOL_NAME, GenerateSandboxedUiArgsSchema, OPEN_GENERATIVE_UI_ACTIVITY_TYPE, OPEN_GENERATIVE_UI_WEBSANDBOX_LOADER, OpenGenerativeUIContentSchema, RENDER_A2UI_TOOL_NAME, RenderA2UIArgsSchema, RenderToolCalls, ResizeObserverService, SLOT_CONFIG, ScrollPosition, StickToBottom, ThreadsStore, TooltipContent, TranscriptionError, anyActivityContentSchema, cn, connectAgentContext, createSlotConfig, createSlotRenderer, getSlotConfig, injectAgentStore, injectChatConfiguration, injectChatLabels, injectChatState, injectCopilotKitConfig, injectMemories, injectThreads, isComponentType, isSlotValue, normalizeSlotValue, provideCopilotChatConfiguration, provideCopilotChatLabels, provideCopilotKit, provideSlots, registerFrontendTool, registerHumanInTheLoop, registerRenderToolCall, renderSlot, transcribeAudio };
|
|
5532
|
+
export type { A2UIConfig, ActivityRenderer, AngularActivityContentParseResult, AngularActivityContentSchema, AngularToolCall, AssistantMessageCopyButtonContext, AssistantMessageMarkdownRendererContext, AssistantMessageToolbarContext, AudioRecorderState, BranchNavigationContext, ClientTool, ConnectAgentContextConfig, CopilotChatAssistantMessageOnReadAloudProps, CopilotChatAssistantMessageOnRegenerateProps, CopilotChatAssistantMessageOnThumbsDownProps, CopilotChatAssistantMessageOnThumbsUpProps, CopilotChatAudioRecorderProps, CopilotChatButtonProps, CopilotChatConfigurationOptions, CopilotChatInputConfig, CopilotChatInputMode, CopilotChatInputOutputs, CopilotChatInputSlots, CopilotChatLabels, CopilotChatMessageViewProps, CopilotChatTextareaProps, CopilotChatToolbarButtonProps, CopilotChatToolbarProps, CopilotChatToolsButtonProps, CopilotChatUserMessageOnEditMessageProps, CopilotChatUserMessageOnSwitchToBranchProps, CopilotChatViewLayoutContext, CopilotChatViewProps, CopilotKitConfig, CopyButtonContext, CursorContext, EditButtonContext, FrontendToolConfig, GenerateSandboxedUiArgs, HumanInTheLoopConfig, HumanInTheLoopToolCall, HumanInTheLoopToolRenderer, InjectThreadsInput, InjectThreadsResult, MemoriesController, MessageRendererContext, MessageViewContext, OpenGenerativeUIConfig, OpenGenerativeUIContent, ReadAloudButtonContext, RegenerateButtonContext, RenderA2UIArgs, RenderActivityMessageConfig, RenderSlotOptions, RenderToolCallConfig, ResizeState, SandboxFunction, ScrollBehavior, ScrollState, SendButtonContext, SlotConfig, SlotContext, SlotRegistryEntry, SlotValue, Thread, ThumbsDownButtonContext, ThumbsUpButtonContext, ToolRenderer, ToolbarContext, ToolsMenuItem, TranscriptionErrorInfo, TranscriptionResult, UserMessageToolbarContext, WithSlots };
|