@galvanized-pukeko/vue-ui 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -0
- package/dist/src/index.d.ts +20 -0
- package/dist/src/services/chatService.d.ts +53 -0
- package/dist/src/services/configService.d.ts +22 -0
- package/dist/src/services/connectionService.d.ts +43 -0
- package/dist/src/types/jsonrpc.d.ts +22 -0
- package/dist/vue-ui.css +1 -0
- package/dist/vue-ui.es.js +505 -526
- package/dist/vue-ui.umd.js +3 -3
- package/package.json +9 -7
- package/dist/style.css +0 -1
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { default as CoreApp } from './CoreApp.vue';
|
|
2
|
+
import { default as PkForm } from './components/PkForm.vue';
|
|
3
|
+
import { default as PkInput } from './components/PkInput.vue';
|
|
4
|
+
import { default as PkCheckbox } from './components/PkCheckbox.vue';
|
|
5
|
+
import { default as PkRadio } from './components/PkRadio.vue';
|
|
6
|
+
import { default as PkSelect } from './components/PkSelect.vue';
|
|
7
|
+
import { default as PkButton } from './components/PkButton.vue';
|
|
8
|
+
import { default as PkInputCounter } from './components/PkInputCounter.vue';
|
|
9
|
+
import { default as PkBarChart } from './components/PkBarChart.vue';
|
|
10
|
+
import { default as PkPieChart } from './components/PkPieChart.vue';
|
|
11
|
+
import { default as PkTable } from './components/PkTable.vue';
|
|
12
|
+
import { default as ChatInterface } from './components/ChatInterface.vue';
|
|
13
|
+
import { default as PkNavHeader } from './components/PkNavHeader.vue';
|
|
14
|
+
import { default as PkLogo } from './components/PkLogo.vue';
|
|
15
|
+
import { default as PkLogoLarge } from './components/PkLogoLarge.vue';
|
|
16
|
+
import { default as PkNavItem } from './components/PkNavItem.vue';
|
|
17
|
+
export { CoreApp };
|
|
18
|
+
export * from './services/configService';
|
|
19
|
+
export * from './services/connectionService';
|
|
20
|
+
export { PkForm, PkInput, PkCheckbox, PkRadio, PkSelect, PkButton, PkInputCounter, PkBarChart, PkPieChart, PkTable, ChatInterface, PkNavHeader, PkLogo, PkLogoLarge, PkNavItem };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
interface ChatSession {
|
|
2
|
+
id: string;
|
|
3
|
+
appName: string;
|
|
4
|
+
userId: string;
|
|
5
|
+
state: Record<string, unknown>;
|
|
6
|
+
events: unknown[];
|
|
7
|
+
lastUpdateTime: number;
|
|
8
|
+
}
|
|
9
|
+
interface FunctionCall {
|
|
10
|
+
id: string;
|
|
11
|
+
name: string;
|
|
12
|
+
args: Record<string, unknown>;
|
|
13
|
+
}
|
|
14
|
+
interface FunctionResponse {
|
|
15
|
+
id: string;
|
|
16
|
+
name: string;
|
|
17
|
+
response: {
|
|
18
|
+
text_output?: Array<{
|
|
19
|
+
text: string;
|
|
20
|
+
}>;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
interface ChatMessagePart {
|
|
24
|
+
text?: string;
|
|
25
|
+
functionCall?: FunctionCall;
|
|
26
|
+
functionResponse?: FunctionResponse;
|
|
27
|
+
}
|
|
28
|
+
interface ChatMessage {
|
|
29
|
+
role: 'user' | 'model';
|
|
30
|
+
parts: ChatMessagePart[];
|
|
31
|
+
}
|
|
32
|
+
interface ChatResponse {
|
|
33
|
+
id: string;
|
|
34
|
+
invocationId: string;
|
|
35
|
+
author: string;
|
|
36
|
+
content: ChatMessage;
|
|
37
|
+
actions: {
|
|
38
|
+
stateDelta: Record<string, unknown>;
|
|
39
|
+
artifactDelta: Record<string, unknown>;
|
|
40
|
+
requestedAuthConfigs: Record<string, unknown>;
|
|
41
|
+
};
|
|
42
|
+
timestamp: number;
|
|
43
|
+
}
|
|
44
|
+
interface CompleteChatResponse {
|
|
45
|
+
chunks: ChatResponse[];
|
|
46
|
+
finalMessage: ChatResponse;
|
|
47
|
+
}
|
|
48
|
+
declare class ChatService {
|
|
49
|
+
createSession(userId?: string): Promise<ChatSession>;
|
|
50
|
+
sendMessage(sessionId: string, text: string, userId?: string): Promise<CompleteChatResponse>;
|
|
51
|
+
}
|
|
52
|
+
export declare const chatService: ChatService;
|
|
53
|
+
export type { ChatSession, ChatResponse, ChatMessage, CompleteChatResponse, ChatMessagePart };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
interface UiConfigItem {
|
|
2
|
+
text?: string;
|
|
3
|
+
href?: string;
|
|
4
|
+
img?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface UiConfig {
|
|
7
|
+
baseUrl: string;
|
|
8
|
+
wsUrl: string;
|
|
9
|
+
appName: string;
|
|
10
|
+
pageTitle?: string;
|
|
11
|
+
configUrl?: string;
|
|
12
|
+
logo?: UiConfigItem;
|
|
13
|
+
header?: UiConfigItem[];
|
|
14
|
+
footer?: UiConfigItem[];
|
|
15
|
+
}
|
|
16
|
+
declare class ConfigService {
|
|
17
|
+
private config;
|
|
18
|
+
load(): Promise<void>;
|
|
19
|
+
get(): UiConfig;
|
|
20
|
+
}
|
|
21
|
+
export declare const configService: ConfigService;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
type ConnectionStatus = 'connecting' | 'connected' | 'disconnected';
|
|
2
|
+
interface ComponentConfig {
|
|
3
|
+
type: string;
|
|
4
|
+
label: string;
|
|
5
|
+
options?: string[];
|
|
6
|
+
value?: string;
|
|
7
|
+
}
|
|
8
|
+
interface WebSocketMessage {
|
|
9
|
+
type: string;
|
|
10
|
+
components?: ComponentConfig[];
|
|
11
|
+
submitLabel?: string;
|
|
12
|
+
cancelLabel?: string;
|
|
13
|
+
[key: string]: unknown;
|
|
14
|
+
}
|
|
15
|
+
type MessageHandler = (message: WebSocketMessage) => void;
|
|
16
|
+
type StatusHandler = (status: ConnectionStatus) => void;
|
|
17
|
+
declare class ConnectionService {
|
|
18
|
+
private ws;
|
|
19
|
+
private messageHandlers;
|
|
20
|
+
private statusHandlers;
|
|
21
|
+
private currentStatus;
|
|
22
|
+
private reconnectTimeout;
|
|
23
|
+
private requestId;
|
|
24
|
+
private pendingRequests;
|
|
25
|
+
connect(): void;
|
|
26
|
+
disconnect(): void;
|
|
27
|
+
subscribeToMessage(messageType: string, handler: MessageHandler): () => void;
|
|
28
|
+
subscribeToStatus(handler: StatusHandler): () => void;
|
|
29
|
+
sendMessage(message: unknown): void;
|
|
30
|
+
sendJsonRpcRequest(method: string, params?: object | unknown[]): Promise<unknown>;
|
|
31
|
+
sendJsonRpcNotification(method: string, params?: object | unknown[]): void;
|
|
32
|
+
submitForm(data: Record<string, unknown>, timestamp?: number): Promise<unknown>;
|
|
33
|
+
cancelForm(timestamp?: number): Promise<unknown>;
|
|
34
|
+
getStatus(): ConnectionStatus;
|
|
35
|
+
private handleMessage;
|
|
36
|
+
private handleJsonRpcResponse;
|
|
37
|
+
private handleJsonRpcNotification;
|
|
38
|
+
private updateStatus;
|
|
39
|
+
private scheduleReconnect;
|
|
40
|
+
private cleanupPendingRequests;
|
|
41
|
+
}
|
|
42
|
+
export declare const connectionService: ConnectionService;
|
|
43
|
+
export type { ConnectionStatus, ComponentConfig, WebSocketMessage };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface JsonRpcRequest {
|
|
2
|
+
jsonrpc: '2.0';
|
|
3
|
+
method: string;
|
|
4
|
+
params?: unknown[] | object;
|
|
5
|
+
id?: string | number | null;
|
|
6
|
+
}
|
|
7
|
+
export interface JsonRpcResponse {
|
|
8
|
+
jsonrpc: '2.0';
|
|
9
|
+
result?: unknown;
|
|
10
|
+
error?: JsonRpcError;
|
|
11
|
+
id: string | number | null;
|
|
12
|
+
}
|
|
13
|
+
export interface JsonRpcError {
|
|
14
|
+
code: number;
|
|
15
|
+
message: string;
|
|
16
|
+
data?: unknown;
|
|
17
|
+
}
|
|
18
|
+
export interface JsonRpcNotification {
|
|
19
|
+
jsonrpc: '2.0';
|
|
20
|
+
method: string;
|
|
21
|
+
params?: unknown[] | object;
|
|
22
|
+
}
|