@qwanyx/stack 0.2.95 → 0.2.97
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/auth/index.d.ts +67 -1
- package/dist/client/GraphClient.d.ts +11 -0
- package/dist/components/QMap/QMapNode.d.ts +1 -0
- package/dist/components/VoiceTextEditor.d.ts +33 -2
- package/dist/index.cjs.js +34 -34
- package/dist/index.d.ts +1 -1
- package/dist/index.esm.js +6000 -5652
- package/package.json +1 -1
package/dist/auth/index.d.ts
CHANGED
|
@@ -39,6 +39,41 @@ export interface AuthServiceConfig {
|
|
|
39
39
|
onLogin?: (user: AuthUser) => void;
|
|
40
40
|
onLogout?: () => void;
|
|
41
41
|
}
|
|
42
|
+
export interface SystemUser {
|
|
43
|
+
_id: string;
|
|
44
|
+
id: string;
|
|
45
|
+
email: string;
|
|
46
|
+
firstName?: string;
|
|
47
|
+
lastName?: string;
|
|
48
|
+
phone?: string;
|
|
49
|
+
role: string;
|
|
50
|
+
membershipRole: string;
|
|
51
|
+
status: string;
|
|
52
|
+
created: number;
|
|
53
|
+
modified: number;
|
|
54
|
+
lastLogin?: number;
|
|
55
|
+
isDigitalHuman: boolean;
|
|
56
|
+
}
|
|
57
|
+
export interface ListUsersResult {
|
|
58
|
+
success: boolean;
|
|
59
|
+
users?: SystemUser[];
|
|
60
|
+
total?: number;
|
|
61
|
+
error?: string;
|
|
62
|
+
}
|
|
63
|
+
export interface UserOperationResult {
|
|
64
|
+
success: boolean;
|
|
65
|
+
error?: string;
|
|
66
|
+
}
|
|
67
|
+
export interface UserSystemEntry {
|
|
68
|
+
system_id: string;
|
|
69
|
+
name: string;
|
|
70
|
+
role: string;
|
|
71
|
+
}
|
|
72
|
+
export interface ListUserSystemsResult {
|
|
73
|
+
success: boolean;
|
|
74
|
+
systems?: UserSystemEntry[];
|
|
75
|
+
error?: string;
|
|
76
|
+
}
|
|
42
77
|
export declare class AuthManager {
|
|
43
78
|
/**
|
|
44
79
|
* Store authentication token
|
|
@@ -91,6 +126,7 @@ export declare class AuthService {
|
|
|
91
126
|
/**
|
|
92
127
|
* Register a new user with email and password
|
|
93
128
|
* Sends verification code to email
|
|
129
|
+
* Automatically adds user as member of the configured system
|
|
94
130
|
*/
|
|
95
131
|
register(email: string, password: string, options?: {
|
|
96
132
|
firstName?: string;
|
|
@@ -114,7 +150,7 @@ export declare class AuthService {
|
|
|
114
150
|
/**
|
|
115
151
|
* Login with email and password
|
|
116
152
|
* Uses system coprocessor for authentication
|
|
117
|
-
*
|
|
153
|
+
* Auto-adds user as member of configured system on first login
|
|
118
154
|
*/
|
|
119
155
|
login(email: string, password: string): Promise<LoginResult>;
|
|
120
156
|
/**
|
|
@@ -142,6 +178,36 @@ export declare class AuthService {
|
|
|
142
178
|
* Check if user is authenticated
|
|
143
179
|
*/
|
|
144
180
|
isAuthenticated(): boolean;
|
|
181
|
+
/**
|
|
182
|
+
* List all users in the platform (from system.db)
|
|
183
|
+
*/
|
|
184
|
+
listAllUsers(options?: {
|
|
185
|
+
limit?: number;
|
|
186
|
+
offset?: number;
|
|
187
|
+
}): Promise<ListUsersResult>;
|
|
188
|
+
/**
|
|
189
|
+
* List all users in the current system
|
|
190
|
+
*/
|
|
191
|
+
listSystemUsers(options?: {
|
|
192
|
+
limit?: number;
|
|
193
|
+
offset?: number;
|
|
194
|
+
}): Promise<ListUsersResult>;
|
|
195
|
+
/**
|
|
196
|
+
* Add a user to the current system
|
|
197
|
+
*/
|
|
198
|
+
addUserToSystem(userId: string, role?: string): Promise<UserOperationResult>;
|
|
199
|
+
/**
|
|
200
|
+
* Update a user's membership role in the current system
|
|
201
|
+
*/
|
|
202
|
+
updateMembershipRole(userId: string, newRole: string): Promise<UserOperationResult>;
|
|
203
|
+
/**
|
|
204
|
+
* List all systems a user belongs to
|
|
205
|
+
*/
|
|
206
|
+
listUserSystems(userId: string): Promise<ListUserSystemsResult>;
|
|
207
|
+
/**
|
|
208
|
+
* Remove a user from the current system
|
|
209
|
+
*/
|
|
210
|
+
removeUserFromSystem(userId: string): Promise<UserOperationResult>;
|
|
145
211
|
}
|
|
146
212
|
/**
|
|
147
213
|
* Initialize the auth service
|
|
@@ -57,6 +57,17 @@ export declare class GraphClient {
|
|
|
57
57
|
deleted: boolean;
|
|
58
58
|
count: number;
|
|
59
59
|
}>;
|
|
60
|
+
/**
|
|
61
|
+
* Update an edge's data
|
|
62
|
+
* @param sourceId - Source node ID (null for edges without source)
|
|
63
|
+
* @param targetId - Target node ID
|
|
64
|
+
* @param edgeType - The type of edge to update
|
|
65
|
+
* @param data - New data for the edge
|
|
66
|
+
*/
|
|
67
|
+
updateEdge(sourceId: string | null, targetId: string, edgeType: string, data: Record<string, any>): Promise<{
|
|
68
|
+
success: boolean;
|
|
69
|
+
updated?: number;
|
|
70
|
+
}>;
|
|
60
71
|
/**
|
|
61
72
|
* Get edges from a source node
|
|
62
73
|
* @param sourceId - Source node ID (null for edges without source)
|
|
@@ -19,6 +19,7 @@ export interface QMapNodeProps {
|
|
|
19
19
|
onClick?: (event: React.MouseEvent) => void;
|
|
20
20
|
onDoubleClick?: (event: React.MouseEvent) => void;
|
|
21
21
|
onContextMenu?: (event: React.MouseEvent) => void;
|
|
22
|
+
nodeRef?: (el: HTMLDivElement | null) => void;
|
|
22
23
|
children: React.ReactNode;
|
|
23
24
|
}
|
|
24
25
|
export declare const QMapNode: React.NamedExoticComponent<QMapNodeProps>;
|
|
@@ -2,8 +2,14 @@
|
|
|
2
2
|
* VoiceTextEditor Component
|
|
3
3
|
* Combines AudioEditor (recorder + transcription) with a textarea + AI dropdown
|
|
4
4
|
* Pattern from TaskEditModal: AudioEditor + Notes component
|
|
5
|
+
*
|
|
6
|
+
* TTS Integration:
|
|
7
|
+
* - Option 1 (Integrated): Pass llmClient, graphClient, nodeId, audioFilename
|
|
8
|
+
* Component handles TTS generation and storage internally
|
|
9
|
+
* - Option 2 (Callback): Pass onGenerateTTS callback for custom handling
|
|
5
10
|
*/
|
|
6
|
-
import { type TTSVoice } from '../client/LLMClient';
|
|
11
|
+
import { LLMClient, type TTSVoice } from '../client/LLMClient';
|
|
12
|
+
import { GraphClient } from '../client/GraphClient';
|
|
7
13
|
export interface VoiceTextEditorProps {
|
|
8
14
|
/** Label shown above the textarea */
|
|
9
15
|
label: string;
|
|
@@ -23,6 +29,20 @@ export interface VoiceTextEditorProps {
|
|
|
23
29
|
className?: string;
|
|
24
30
|
/** Number of rows for textarea (if not flex) */
|
|
25
31
|
rows?: number;
|
|
32
|
+
/** LLMClient for TTS generation */
|
|
33
|
+
llmClient?: LLMClient;
|
|
34
|
+
/** GraphClient for file upload/URL */
|
|
35
|
+
graphClient?: GraphClient;
|
|
36
|
+
/** Node ID for file storage (course/lesson ID) */
|
|
37
|
+
nodeId?: string;
|
|
38
|
+
/** Filename for the audio file (e.g., 'description.mp3') */
|
|
39
|
+
audioFilename?: string;
|
|
40
|
+
/** Initial audio filename (if already exists) */
|
|
41
|
+
existingAudio?: string;
|
|
42
|
+
/** Initial voice selection */
|
|
43
|
+
existingVoice?: TTSVoice;
|
|
44
|
+
/** Called when audio is generated (returns filename) */
|
|
45
|
+
onAudioGenerated?: (filename: string, voice: TTSVoice) => void;
|
|
26
46
|
/** Called to generate TTS audio - should return filename */
|
|
27
47
|
onGenerateTTS?: (text: string, voice: TTSVoice) => Promise<string>;
|
|
28
48
|
/** URL of existing audio for playback */
|
|
@@ -31,5 +51,16 @@ export interface VoiceTextEditorProps {
|
|
|
31
51
|
voice?: TTSVoice;
|
|
32
52
|
/** Called when voice selection changes */
|
|
33
53
|
onVoiceChange?: (voice: TTSVoice) => void;
|
|
54
|
+
/** Shows a generate button on the left of toolbar */
|
|
55
|
+
generateButton?: {
|
|
56
|
+
label: string;
|
|
57
|
+
icon?: string;
|
|
58
|
+
};
|
|
59
|
+
/** System prompt for generation (uses llmClient internally) */
|
|
60
|
+
generatePrompt?: string;
|
|
61
|
+
/** Source text for generation (e.g., description to transform into exposé) */
|
|
62
|
+
generateSourceText?: string;
|
|
63
|
+
/** Error message to show if source text is empty */
|
|
64
|
+
generateSourceError?: string;
|
|
34
65
|
}
|
|
35
|
-
export declare function VoiceTextEditor({ label, value, onChange, onTranscribe, onAIAction, onAIPrompt, placeholder, className, rows, onGenerateTTS, audioUrl, voice, onVoiceChange }: VoiceTextEditorProps): import("react/jsx-runtime").JSX.Element;
|
|
66
|
+
export declare function VoiceTextEditor({ label, value, onChange, onTranscribe, onAIAction, onAIPrompt, placeholder, className, rows, llmClient, graphClient, nodeId, audioFilename, existingAudio, existingVoice, onAudioGenerated, onGenerateTTS, audioUrl, voice, onVoiceChange, generateButton, generatePrompt, generateSourceText, generateSourceError }: VoiceTextEditorProps): import("react/jsx-runtime").JSX.Element;
|