@m6d/cortex-client 1.3.0 → 1.4.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.
package/package.json
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { Signal, Type, Injector
|
|
2
|
+
import { Signal, Type, Injector } from '@angular/core';
|
|
3
3
|
import * as ai from 'ai';
|
|
4
|
-
import { ChatOnToolCallCallback, UIMessage
|
|
4
|
+
import { ChatOnToolCallCallback, UIMessage } from 'ai';
|
|
5
5
|
import * as rxjs from 'rxjs';
|
|
6
|
-
import { Observable } from 'rxjs';
|
|
7
6
|
import { Chat } from '@ai-sdk/angular';
|
|
8
|
-
import * as _m6d_cortex_client from '@m6d/cortex-client';
|
|
9
|
-
import * as _angular_forms from '@angular/forms';
|
|
10
|
-
import { ControlValueAccessor, FormControl } from '@angular/forms';
|
|
11
|
-
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
|
|
12
7
|
|
|
13
8
|
type CortexClientTransport = {
|
|
14
9
|
baseUrl: string | Signal<string>;
|
|
@@ -64,23 +59,6 @@ declare class CortexChatService {
|
|
|
64
59
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<CortexChatService>;
|
|
65
60
|
}
|
|
66
61
|
|
|
67
|
-
declare class CortexClientWebSocketService {
|
|
68
|
-
private readonly events$;
|
|
69
|
-
constructor();
|
|
70
|
-
get events(): Observable<_m6d_cortex_client.ThreadTitleUpdatedEvent>;
|
|
71
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CortexClientWebSocketService, never>;
|
|
72
|
-
static ɵprov: _angular_core.ɵɵInjectableDeclaration<CortexClientWebSocketService>;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
type ThreadTitleUpdatedEvent = {
|
|
76
|
-
type: 'thread:title-updated';
|
|
77
|
-
payload: {
|
|
78
|
-
threadId: string;
|
|
79
|
-
title: string;
|
|
80
|
-
};
|
|
81
|
-
};
|
|
82
|
-
type WsEvent = ThreadTitleUpdatedEvent;
|
|
83
|
-
|
|
84
62
|
declare class CortexChatWidgetComponent {
|
|
85
63
|
readonly config: _angular_core.InputSignal<CortexClientConfig>;
|
|
86
64
|
protected readonly text: _angular_core.ModelSignal<string>;
|
|
@@ -100,199 +78,5 @@ declare class CortexChatWidgetComponent {
|
|
|
100
78
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CortexChatWidgetComponent, "cortex-chat-widget", never, { "config": { "alias": "config"; "required": true; "isSignal": true; }; "text": { "alias": "text"; "required": false; "isSignal": true; }; }, { "text": "textChange"; }, never, never, true, never>;
|
|
101
79
|
}
|
|
102
80
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
readonly debugMode: _angular_core.InputSignal<boolean>;
|
|
106
|
-
private readonly messagesContainer;
|
|
107
|
-
private shouldScrollToBottom;
|
|
108
|
-
private isNearBottom;
|
|
109
|
-
protected readonly animateNewParts: _angular_core.WritableSignal<boolean>;
|
|
110
|
-
constructor(chatService: CortexChatService, destroyRef: DestroyRef);
|
|
111
|
-
ngAfterViewInit(): void;
|
|
112
|
-
protected onScroll(): void;
|
|
113
|
-
private scrollToBottom;
|
|
114
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MessageListComponent, never>;
|
|
115
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MessageListComponent, "cortex-message-list", never, { "debugMode": { "alias": "debugMode"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
declare class MessageComponent {
|
|
119
|
-
readonly message: _angular_core.InputSignal<UIMessage<unknown, UIDataTypes, UITools>>;
|
|
120
|
-
readonly debugMode: _angular_core.InputSignal<boolean>;
|
|
121
|
-
readonly animate: _angular_core.InputSignal<boolean>;
|
|
122
|
-
protected readonly visibleParts: _angular_core.Signal<(ai.TextUIPart | ai.ReasoningUIPart | ai.DynamicToolUIPart | ai.SourceUrlUIPart | ai.SourceDocumentUIPart | ai.FileUIPart | ({
|
|
123
|
-
type: `tool-${string}`;
|
|
124
|
-
} & ai.UIToolInvocation<ai.UITool>) | {
|
|
125
|
-
type: `data-${string}`;
|
|
126
|
-
id?: string;
|
|
127
|
-
data: unknown;
|
|
128
|
-
})[]>;
|
|
129
|
-
private readonly parts;
|
|
130
|
-
constructor();
|
|
131
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MessageComponent, never>;
|
|
132
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MessageComponent, "cortex-message", never, { "message": { "alias": "message"; "required": true; "isSignal": true; }; "debugMode": { "alias": "debugMode"; "required": false; "isSignal": true; }; "animate": { "alias": "animate"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
declare class MessagePartComponent {
|
|
136
|
-
readonly message: _angular_core.InputSignal<UIMessage<unknown, UIDataTypes, UITools>>;
|
|
137
|
-
readonly part: _angular_core.InputSignal<UIMessagePart<UIDataTypes, UITools>>;
|
|
138
|
-
readonly debugMode: _angular_core.InputSignal<boolean>;
|
|
139
|
-
readonly animate: _angular_core.InputSignal<boolean>;
|
|
140
|
-
protected readonly isStaticToolUIPart: typeof isStaticToolUIPart;
|
|
141
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MessagePartComponent, never>;
|
|
142
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MessagePartComponent, "cortex-message-part", never, { "message": { "alias": "message"; "required": true; "isSignal": true; }; "part": { "alias": "part"; "required": true; "isSignal": true; }; "debugMode": { "alias": "debugMode"; "required": false; "isSignal": true; }; "animate": { "alias": "animate"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
declare class MessageTextPartComponent {
|
|
146
|
-
readonly role: _angular_core.InputSignal<"system" | "user" | "assistant">;
|
|
147
|
-
readonly textPart: _angular_core.InputSignal<TextUIPart>;
|
|
148
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MessageTextPartComponent, never>;
|
|
149
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MessageTextPartComponent, "cortex-message-text-part", never, { "role": { "alias": "role"; "required": true; "isSignal": true; }; "textPart": { "alias": "textPart"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
declare class MessageToolCallAnimatedComponent {
|
|
153
|
-
readonly message: _angular_core.InputSignal<UIMessage<unknown, ai.UIDataTypes, ai.UITools>>;
|
|
154
|
-
readonly toolCallPart: _angular_core.InputSignal<{
|
|
155
|
-
type: `tool-${string}`;
|
|
156
|
-
} & ai.UIToolInvocation<ai.UITool>>;
|
|
157
|
-
protected readonly config: _m6d_cortex_client.CortexClientConfig;
|
|
158
|
-
protected readonly customComponent: _angular_core.Signal<_angular_core.Type<unknown> | null>;
|
|
159
|
-
protected readonly animState: _angular_core.Signal<"error" | "starting" | "processing" | "complete" | "denied">;
|
|
160
|
-
protected readonly isActive: _angular_core.Signal<boolean>;
|
|
161
|
-
protected readonly displayTitleKey: _angular_core.Signal<string>;
|
|
162
|
-
private readonly stableIndex;
|
|
163
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MessageToolCallAnimatedComponent, never>;
|
|
164
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MessageToolCallAnimatedComponent, "cortex-message-tool-call-animated", never, { "message": { "alias": "message"; "required": true; "isSignal": true; }; "toolCallPart": { "alias": "toolCallPart"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
declare class MessageToolCallPartComponent {
|
|
168
|
-
private static readonly CODE_FIELDS;
|
|
169
|
-
readonly toolCallPart: _angular_core.InputSignal<{
|
|
170
|
-
type: `tool-${string}`;
|
|
171
|
-
} & ai.UIToolInvocation<ai.UITool>>;
|
|
172
|
-
protected readonly codeSnippets: _angular_core.Signal<{
|
|
173
|
-
key: string;
|
|
174
|
-
lang: string;
|
|
175
|
-
value: string;
|
|
176
|
-
}[]>;
|
|
177
|
-
protected readonly remainingInput: _angular_core.Signal<unknown>;
|
|
178
|
-
protected toolName(): string;
|
|
179
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MessageToolCallPartComponent, never>;
|
|
180
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MessageToolCallPartComponent, "cortex-message-tool-call-part", never, { "toolCallPart": { "alias": "toolCallPart"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
declare class MessageReasoningPartComponent {
|
|
184
|
-
readonly reasoningPart: _angular_core.InputSignal<ReasoningUIPart>;
|
|
185
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MessageReasoningPartComponent, never>;
|
|
186
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MessageReasoningPartComponent, "cortex-message-reasoning-part", never, { "reasoningPart": { "alias": "reasoningPart"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
declare class MessageReasoningAnimatedComponent {
|
|
190
|
-
readonly reasoningPart: _angular_core.InputSignal<ReasoningUIPart>;
|
|
191
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MessageReasoningAnimatedComponent, never>;
|
|
192
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MessageReasoningAnimatedComponent, "cortex-message-reasoning-animated", never, { "reasoningPart": { "alias": "reasoningPart"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
type InputFile = {
|
|
196
|
-
name: string;
|
|
197
|
-
bytes: string;
|
|
198
|
-
};
|
|
199
|
-
declare class MessageCaptureFilesPartComponent {
|
|
200
|
-
readonly message: _angular_core.InputSignal<UIMessage<unknown, ai.UIDataTypes, ai.UITools>>;
|
|
201
|
-
readonly toolPart: _angular_core.InputSignal<{
|
|
202
|
-
type: `tool-${string}`;
|
|
203
|
-
} & ai.UIToolInvocation<ai.UITool>>;
|
|
204
|
-
readonly data: Signal<{
|
|
205
|
-
files: {
|
|
206
|
-
label: string;
|
|
207
|
-
id: string;
|
|
208
|
-
}[];
|
|
209
|
-
}>;
|
|
210
|
-
protected readonly isLoading: _angular_core.WritableSignal<boolean>;
|
|
211
|
-
protected readonly outputData: Signal<{
|
|
212
|
-
status: "success" | "canceled";
|
|
213
|
-
message?: string;
|
|
214
|
-
result?: {
|
|
215
|
-
id: string;
|
|
216
|
-
uploadId: string;
|
|
217
|
-
}[];
|
|
218
|
-
} | null>;
|
|
219
|
-
protected readonly form: Signal<_angular_forms.FormGroup<{
|
|
220
|
-
files: _angular_forms.FormArray<_angular_forms.FormGroup<{
|
|
221
|
-
id: FormControl<string>;
|
|
222
|
-
file: FormControl<InputFile>;
|
|
223
|
-
}>>;
|
|
224
|
-
}>>;
|
|
225
|
-
private readonly fb;
|
|
226
|
-
private readonly chatService;
|
|
227
|
-
private readonly config;
|
|
228
|
-
protected submit(): Promise<void>;
|
|
229
|
-
protected downloadFile(uploadId: string): Promise<void>;
|
|
230
|
-
protected cancel(): void;
|
|
231
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MessageCaptureFilesPartComponent, never>;
|
|
232
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MessageCaptureFilesPartComponent, "cortex-message-capture-files-part", never, { "message": { "alias": "message"; "required": true; "isSignal": true; }; "toolPart": { "alias": "toolPart"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
233
|
-
}
|
|
234
|
-
declare class FileInputComponent implements ControlValueAccessor {
|
|
235
|
-
allowedMimeTypes: _angular_core.InputSignal<string>;
|
|
236
|
-
protected readonly value: _angular_core.WritableSignal<InputFile | undefined>;
|
|
237
|
-
protected readonly isDisabled: _angular_core.WritableSignal<boolean>;
|
|
238
|
-
protected onTouch?: () => void;
|
|
239
|
-
protected readonly isProcessing: _angular_core.WritableSignal<boolean>;
|
|
240
|
-
private onChange?;
|
|
241
|
-
writeValue(value?: InputFile): void;
|
|
242
|
-
registerOnChange(fn: (value?: InputFile) => void): void;
|
|
243
|
-
registerOnTouched(fn: () => void): void;
|
|
244
|
-
setDisabledState(isDisabled: boolean): void;
|
|
245
|
-
protected loadFile(event: Event): Promise<void>;
|
|
246
|
-
protected updateValue(value: InputFile): void;
|
|
247
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<FileInputComponent, never>;
|
|
248
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<FileInputComponent, "cortex-file-input", never, { "allowedMimeTypes": { "alias": "allowedMimeTypes"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
declare class JsonTreeComponent {
|
|
252
|
-
readonly data: _angular_core.InputSignal<unknown>;
|
|
253
|
-
readonly expandDepth: _angular_core.InputSignal<number>;
|
|
254
|
-
private collapsedPaths;
|
|
255
|
-
private userToggled;
|
|
256
|
-
protected isCollapsed(path: string, depth: number): boolean;
|
|
257
|
-
protected toggle(path: string, depth: number): void;
|
|
258
|
-
protected isObject(value: unknown): boolean;
|
|
259
|
-
protected isArray(value: unknown): value is any[];
|
|
260
|
-
protected objectEntries(value: unknown): [string, unknown][];
|
|
261
|
-
protected arrayItems(value: unknown): any[];
|
|
262
|
-
protected objectLength(value: unknown): number;
|
|
263
|
-
protected arrayLength(value: unknown): number;
|
|
264
|
-
protected formatPrimitive(value: unknown): string;
|
|
265
|
-
protected primitiveClass(value: unknown): "" | "jt-null" | "jt-string" | "jt-number" | "jt-boolean";
|
|
266
|
-
protected isContainer(value: unknown): boolean;
|
|
267
|
-
protected parsed(value: unknown): unknown;
|
|
268
|
-
private deepParse;
|
|
269
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<JsonTreeComponent, never>;
|
|
270
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<JsonTreeComponent, "cortex-json-tree", never, { "data": { "alias": "data"; "required": true; "isSignal": true; }; "expandDepth": { "alias": "expandDepth"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
declare class MarkedPipe implements PipeTransform {
|
|
274
|
-
private readonly sanitizer;
|
|
275
|
-
constructor(sanitizer: DomSanitizer);
|
|
276
|
-
transform(value: string | undefined | null): SafeHtml;
|
|
277
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MarkedPipe, never>;
|
|
278
|
-
static ɵpipe: _angular_core.ɵɵPipeDeclaration<MarkedPipe, "marked", true>;
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
declare class HighlightPipe implements PipeTransform {
|
|
282
|
-
private readonly sanitizer;
|
|
283
|
-
constructor(sanitizer: DomSanitizer);
|
|
284
|
-
transform(code: string, lang: string): SafeHtml;
|
|
285
|
-
private escapeHtml;
|
|
286
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HighlightPipe, never>;
|
|
287
|
-
static ɵpipe: _angular_core.ɵɵPipeDeclaration<HighlightPipe, "highlight", true>;
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
declare class PrettyJsonPipe implements PipeTransform {
|
|
291
|
-
transform(value: unknown): string;
|
|
292
|
-
private deepFormat;
|
|
293
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<PrettyJsonPipe, never>;
|
|
294
|
-
static ɵpipe: _angular_core.ɵɵPipeDeclaration<PrettyJsonPipe, "prettyJson", true>;
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
export { CortexChatService, CortexChatWidgetComponent, CortexClientWebSocketService, FileInputComponent, HighlightPipe, JsonTreeComponent, MarkedPipe, MessageCaptureFilesPartComponent, MessageComponent, MessageListComponent, MessagePartComponent, MessageReasoningAnimatedComponent, MessageReasoningPartComponent, MessageTextPartComponent, MessageToolCallAnimatedComponent, MessageToolCallPartComponent, PrettyJsonPipe };
|
|
298
|
-
export type { CortexClientConfig, CortexClientTransport, Thread, ThreadTitleUpdatedEvent, WsEvent };
|
|
81
|
+
export { CortexChatWidgetComponent };
|
|
82
|
+
export type { CortexClientConfig, CortexClientTransport };
|