@hahnpro/ai-sdk 0.6.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,25 +1,29 @@
1
1
  {
2
2
  "name": "@hahnpro/ai-sdk",
3
- "version": "0.6.0",
3
+ "version": "0.7.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
+ "dependencies": {
8
+ "@hahnpro/hpc-api": "2025.2.13",
9
+ "microsoft-cognitiveservices-speech-sdk": "1.44.1",
10
+ "openid-client": "6.5.1",
11
+ "pretty-bytes": "6.1.1",
12
+ "tslib": "^2.3.0"
13
+ },
7
14
  "peerDependencies": {
8
- "@angular/cdk": "^18.0.0 || ^19.0.0",
9
- "@angular/common": "^18.0.0 || ^19.0.0",
10
- "@angular/core": "^18.0.0 || ^19.0.0",
11
- "@angular/forms": "^18.0.0 || ^19.0.0",
12
- "@angular/material": "^18.0.0 || ^19.0.0",
13
- "@angular/platform-browser": "^18.0.0 || ^19.0.0",
14
- "@angular/router": "^18.0.0 || ^19.0.0",
15
+ "@angular/cdk": "^18.0.0 || ^19.0.0 || ^20.0.0",
16
+ "@angular/common": "^18.0.0 || ^19.0.0 || ^20.0.0",
17
+ "@angular/core": "^18.0.0 || ^19.0.0 || ^20.0.0",
18
+ "@angular/forms": "^18.0.0 || ^19.0.0 || ^20.0.0",
19
+ "@angular/material": "^18.0.0 || ^19.0.0 || ^20.0.0",
20
+ "@angular/platform-browser": "^18.0.0 || ^19.0.0 || ^20.0.0",
21
+ "@angular/router": "^18.0.0 || ^19.0.0 || ^20.0.0",
15
22
  "@jsverse/transloco": "^7.6.0",
16
- "@hahnpro/hpc-api": "^2025.2.12",
17
23
  "date-fns": "^4.0.0",
18
24
  "ngx-extended-pdf-viewer": "^23.0.0",
19
25
  "ngx-logger": "^5.0.0",
20
- "ngx-markdown": "^18.0.0 || ^19.0.0",
21
- "openid-client": "^6.4.0",
22
- "pretty-bytes": "^6.1.0",
26
+ "ngx-markdown": "^18.0.0 || ^19.0.0 || ^20.0.0",
23
27
  "rxjs": "~7.8.0",
24
28
  "socket.io-client": "^4.8.0"
25
29
  },
@@ -34,8 +38,5 @@
34
38
  "types": "./index.d.ts",
35
39
  "default": "./fesm2022/hahnpro-ai-sdk.mjs"
36
40
  }
37
- },
38
- "dependencies": {
39
- "tslib": "^2.3.0"
40
41
  }
41
42
  }
@@ -1,9 +0,0 @@
1
- import * as i0 from "@angular/core";
2
- import * as i1 from "@angular/common";
3
- import * as i2 from "ngx-logger";
4
- import * as i3 from "./transloco.module";
5
- export declare class AiModule {
6
- static ɵfac: i0.ɵɵFactoryDeclaration<AiModule, never>;
7
- static ɵmod: i0.ɵɵNgModuleDeclaration<AiModule, never, [typeof i1.CommonModule, typeof i2.LoggerModule], [typeof i3.AiTranslocoModule]>;
8
- static ɵinj: i0.ɵɵInjectorDeclaration<AiModule>;
9
- }
@@ -1,27 +0,0 @@
1
- import { OnInit } from '@angular/core';
2
- import { MatDialogRef } from '@angular/material/dialog';
3
- import { ChatService } from '../chat.service';
4
- import * as i0 from "@angular/core";
5
- interface AssetData {
6
- id?: string;
7
- name?: string;
8
- externalKey?: string;
9
- }
10
- export interface ChatDialogData {
11
- asset: AssetData;
12
- }
13
- export declare class AiChatDialogComponent implements OnInit {
14
- data: ChatDialogData;
15
- private readonly matDialogRef;
16
- readonly chatService: ChatService;
17
- readonly type: 'asset' | 'ext-asset';
18
- private readonly asset;
19
- private readonly logger;
20
- private readonly translocoService;
21
- constructor(data: ChatDialogData, matDialogRef: MatDialogRef<AiChatDialogComponent>);
22
- ngOnInit(): void;
23
- close(message?: string): void;
24
- static ɵfac: i0.ɵɵFactoryDeclaration<AiChatDialogComponent, never>;
25
- static ɵcmp: i0.ɵɵComponentDeclaration<AiChatDialogComponent, "ng-component", never, {}, {}, never, never, true, never>;
26
- }
27
- export {};
@@ -1,79 +0,0 @@
1
- import type { AiAssistant, AssistantMessage as AiAssistantMessage, SystemMessage, ThreadPopulated, ToolMessage, UserMessage } from '@hahnpro/hpc-api';
2
- import { ContextReference } from './context.service';
3
- import * as i0 from "@angular/core";
4
- export declare enum ChatView {
5
- Start = 0,
6
- Thread = 1,
7
- ThreadList = 2
8
- }
9
- export declare class ChatService {
10
- readonly ChatView: typeof ChatView;
11
- highlightContext: string | null;
12
- isLoading: boolean;
13
- model: string | null;
14
- locale: string;
15
- isProcessing: boolean;
16
- private readonly apiService;
17
- private readonly contextService;
18
- private readonly destroy$;
19
- private readonly router;
20
- private readonly socket;
21
- private readonly translocoService;
22
- private _activeView;
23
- private _activeAssistant;
24
- private _activeThread;
25
- private _assistants;
26
- private _messages;
27
- private errorEvents$;
28
- private threadEvents$;
29
- constructor();
30
- get activeAssistant(): AiAssistant;
31
- get activeThread(): ThreadPopulated | null;
32
- get activeView(): ChatView;
33
- get assistants(): AiAssistant[];
34
- get messages(): ChatMessage[];
35
- get title(): string;
36
- init(): Promise<void>;
37
- createThreadForModal(assistantId: string, initialMessage?: string, hidden?: boolean): Promise<void>;
38
- createThread(initialMessage?: string, assistantId?: string): Promise<void>;
39
- deleteThread(threadId: string): Promise<import("@hahnpro/hpc-api").Thread>;
40
- showThreadList(): void;
41
- openThread(thread: string | ThreadPopulated, isNewThread?: boolean): Promise<void>;
42
- getAssistantName(thread: ThreadPopulated): string;
43
- private getMessages;
44
- sendMessage(content: string, hidden?: boolean): Promise<void>;
45
- selectChoice(selection: any, toolMessage: any): void;
46
- private setupWebsockets;
47
- private collectContext;
48
- private handleThreadEvent;
49
- private updateMessage;
50
- static ɵfac: i0.ɵɵFactoryDeclaration<ChatService, never>;
51
- static ɵprov: i0.ɵɵInjectableDeclaration<ChatService>;
52
- }
53
- interface MessageContent {
54
- response: string;
55
- references: ContextReference[];
56
- }
57
- export interface AssistantMessage extends AiAssistantMessage {
58
- role: 'assistant';
59
- parsedContent?: MessageContent;
60
- }
61
- export type ChatMessage = AssistantMessage | SystemMessage | ToolMessage | UserMessage;
62
- export declare enum WebSocketMessageType {
63
- AI_ASSISTANT_STATUS = "ai_assistant_status",
64
- AI_ASSISTANT_TOOL_STATUS = "ai_assistant_tool_status",
65
- AI_ABORTED = "ai_aborted",
66
- AI_ABORT_FAILED = "ai_abort_failed",
67
- AI_COMPLETE = "ai_complete",
68
- AI_COMPLETE_RESPONSE = "ai_complete_response",
69
- AI_FAILED_TO_PROCESS = "ai_failed_to_process",
70
- AI_INVALID_MESSAGE = "ai_invalid_message",
71
- AI_MESSAGE = "ai_message",
72
- AI_PARTIAL_RESPONSE = "ai_partial_response",
73
- AI_PROCESSING = "ai_processing",
74
- AI_TOOL_RESPONSE = "ai_tool_response",
75
- AI_TOOL_STATUS = "ai_tool_status",
76
- ERROR = "error",
77
- ERROR_EVENT = "errorEvent"
78
- }
79
- export {};
@@ -1,24 +0,0 @@
1
- import { InjectionToken } from '@angular/core';
2
- import type { Asset, Content, Event } from '@hahnpro/hpc-api';
3
- import { Status as ContextStatus } from '../context.service';
4
- import * as i0 from "@angular/core";
5
- export declare const OVERLAY_PAGE_NUMBER: InjectionToken<number>;
6
- export declare const OVERLAY_RESOURCE_ID: InjectionToken<string>;
7
- export declare const OVERLAY_RESOURCE_TYPE: InjectionToken<string>;
8
- export declare class ContextOverlayComponent {
9
- resourceId: string;
10
- resourceType: 'asset' | 'content' | 'event';
11
- pageNumber: number;
12
- private readonly contextService;
13
- private readonly matDialog;
14
- constructor(resourceId: string, resourceType: 'asset' | 'content' | 'event', pageNumber: number);
15
- get resource(): Asset | Content | Event;
16
- get status(): ContextStatus | null;
17
- get asset(): Asset | null;
18
- iconForMimeType(): string;
19
- labelForType(): string;
20
- previewContent(pageNumber?: number): void;
21
- isPreviewSupported(): boolean;
22
- static ɵfac: i0.ɵɵFactoryDeclaration<ContextOverlayComponent, never>;
23
- static ɵcmp: i0.ɵɵComponentDeclaration<ContextOverlayComponent, "ng-component", never, {}, {}, never, never, true, never>;
24
- }
@@ -1,27 +0,0 @@
1
- import type { Asset, Content, Event } from '@hahnpro/hpc-api';
2
- import * as i0 from "@angular/core";
3
- export interface Status {
4
- isComplete?: boolean;
5
- isError?: boolean;
6
- isLoading?: boolean;
7
- }
8
- export declare class ContextService {
9
- cache: Map<string, Content | Asset | Event>;
10
- status: Map<string, Status>;
11
- private readonly apiService;
12
- private readonly ownerResolver;
13
- reset(): void;
14
- loadReferences(references: ContextReference[]): Promise<void>;
15
- getContext(id: string): Asset | Content | Event;
16
- assetForContent(contentId: string): Asset | null;
17
- assetForEvent(event: Event): Asset | null;
18
- static ɵfac: i0.ɵɵFactoryDeclaration<ContextService, never>;
19
- static ɵprov: i0.ɵɵInjectableDeclaration<ContextService>;
20
- }
21
- export interface ContextReference {
22
- reference_id: number;
23
- id: string;
24
- resourceType: 'asset' | 'content' | 'event';
25
- pageNumber?: number;
26
- firstOccurrence?: boolean;
27
- }
@@ -1,18 +0,0 @@
1
- import { iconForMimeType, labelForMimeType } from '../../core/utils';
2
- import { ContextService } from '../context.service';
3
- import { AssistantMessage, ChatService } from '../chat.service';
4
- import * as i0 from "@angular/core";
5
- export declare class MessageContextComponent {
6
- isLastMessage: boolean;
7
- message: AssistantMessage;
8
- readonly chatService: ChatService;
9
- readonly contextService: ContextService;
10
- iconForMimeType: typeof iconForMimeType;
11
- labelForMimeType: typeof labelForMimeType;
12
- private readonly overlay;
13
- private readonly viewContainerRef;
14
- private overlayRef;
15
- openOverlay(event: MouseEvent, resourceId: string, resourceType?: 'asset' | 'content' | 'event', pageNumber?: number): void;
16
- static ɵfac: i0.ɵɵFactoryDeclaration<MessageContextComponent, never>;
17
- static ɵcmp: i0.ɵɵComponentDeclaration<MessageContextComponent, "ai-message-context", never, { "isLastMessage": { "alias": "isLastMessage"; "required": false; }; "message": { "alias": "message"; "required": false; }; }, {}, never, never, true, never>;
18
- }
@@ -1,17 +0,0 @@
1
- import { BreakpointObserver } from '@angular/cdk/layout';
2
- import { ElementRef } from '@angular/core';
3
- import { ChatService } from '../chat.service';
4
- import * as i0 from "@angular/core";
5
- export declare class MessageInputComponent {
6
- messageInput: ElementRef<HTMLTextAreaElement>;
7
- readonly startConversation: string;
8
- readonly chatService: ChatService;
9
- isMobileView: boolean;
10
- message: string;
11
- tmpMessage: string;
12
- private readonly destroyRef;
13
- constructor(breakpointObserver: BreakpointObserver);
14
- sendMessage(): void;
15
- static ɵfac: i0.ɵɵFactoryDeclaration<MessageInputComponent, never>;
16
- static ɵcmp: i0.ɵɵComponentDeclaration<MessageInputComponent, "ai-message-input", never, { "startConversation": { "alias": "startConversation"; "required": false; }; }, {}, never, never, true, never>;
17
- }
@@ -1,27 +0,0 @@
1
- import { OnInit } from '@angular/core';
2
- import { SafeUrl } from '@angular/platform-browser';
3
- import type { Content } from '@hahnpro/hpc-api';
4
- import * as i0 from "@angular/core";
5
- export declare class PreviewComponent implements OnInit {
6
- content: Content & {
7
- analysis?: {
8
- text: string;
9
- };
10
- };
11
- isLoading: boolean;
12
- pageNumber: number;
13
- previewUrl: SafeUrl;
14
- token: string;
15
- markdown?: string;
16
- private readonly apiService;
17
- private readonly logger;
18
- private readonly sanitizer;
19
- constructor(data: Content & {
20
- pageNumber?: number;
21
- });
22
- get pdfSrc(): Promise<Blob>;
23
- ngOnInit(): void;
24
- private loadPreview;
25
- static ɵfac: i0.ɵɵFactoryDeclaration<PreviewComponent, never>;
26
- static ɵcmp: i0.ɵɵComponentDeclaration<PreviewComponent, "ai-content-preview", never, {}, {}, never, never, true, never>;
27
- }
@@ -1,6 +0,0 @@
1
- import { EnvironmentProviders, Provider } from '@angular/core';
2
- /**
3
- * Provides all necessary providers for AI SDK
4
- * This allows consuming applications to configure the AI SDK with a single function
5
- */
6
- export declare function provideAiSdk(): (Provider | EnvironmentProviders)[];
@@ -1,20 +0,0 @@
1
- import { AssistantMessage, ChatService } from '../chat.service';
2
- import { ContextService } from '../context.service';
3
- import * as i0 from "@angular/core";
4
- export declare class ThreadComponent {
5
- readonly chatService: ChatService;
6
- readonly contextService: ContextService;
7
- selection: string;
8
- private readonly translocoService;
9
- private readonly overlay;
10
- private readonly viewContainerRef;
11
- private overlayRef;
12
- openOverlay(event: MouseEvent, resourceId: string, resourceType?: 'asset' | 'content' | 'event', pageNumber?: number): void;
13
- interceptClick(event: MouseEvent): void;
14
- getMarkdownContent(message: AssistantMessage): string;
15
- getToolStatus(item: any): string;
16
- getFailReason(item: any): string;
17
- selectChoice(selection: any, toolMessage: any): void;
18
- static ɵfac: i0.ɵɵFactoryDeclaration<ThreadComponent, never>;
19
- static ɵcmp: i0.ɵɵComponentDeclaration<ThreadComponent, "ai-thread", never, {}, {}, never, never, true, never>;
20
- }