@rslsp1/fa-app-tools 1.0.2 → 1.0.4
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.mts +102 -9
- package/dist/index.d.ts +102 -9
- package/dist/index.js +1599 -261
- package/dist/index.mjs +1581 -246
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { RefObject } from 'react';
|
|
1
|
+
import React, { RefObject, ReactNode } from 'react';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
3
|
import { Node, Edge } from '@xyflow/react';
|
|
4
4
|
|
|
@@ -7,6 +7,8 @@ declare function useOnClickOutside(ref: RefObject<HTMLElement | null>, handler:
|
|
|
7
7
|
interface TagOption {
|
|
8
8
|
label: string;
|
|
9
9
|
value: string;
|
|
10
|
+
is_user_created?: boolean;
|
|
11
|
+
is_deleted?: boolean;
|
|
10
12
|
}
|
|
11
13
|
interface WorkspaceTags {
|
|
12
14
|
by_category: Record<string, TagOption[]>;
|
|
@@ -40,6 +42,16 @@ interface ProjectSettings {
|
|
|
40
42
|
seed: number;
|
|
41
43
|
seedMode: 'random' | 'fixed';
|
|
42
44
|
}
|
|
45
|
+
interface ProjectMeta {
|
|
46
|
+
id: string;
|
|
47
|
+
name: string;
|
|
48
|
+
saved_at: string;
|
|
49
|
+
size: number;
|
|
50
|
+
}
|
|
51
|
+
interface SyncDiff {
|
|
52
|
+
localOnly: Generation[];
|
|
53
|
+
serverOnly: Generation[];
|
|
54
|
+
}
|
|
43
55
|
|
|
44
56
|
/**
|
|
45
57
|
* Hook für die Tastaturnavigation im Detailview.
|
|
@@ -62,7 +74,7 @@ declare function injectXMPMetadata(base64: string, prompt: string, seed?: number
|
|
|
62
74
|
/**
|
|
63
75
|
* Vollständiger Export: JSON + MD + Bilder (mit XMP Meta)
|
|
64
76
|
*/
|
|
65
|
-
declare function exportProjectToZip(nodes: any[], edges: any[], history: any[], galleryItems: any[], settings: any): Promise<{
|
|
77
|
+
declare function exportProjectToZip(nodes: any[], edges: any[], history: any[], galleryItems: any[], settings: any, workspaceTags?: any): Promise<{
|
|
66
78
|
base64: string;
|
|
67
79
|
}>;
|
|
68
80
|
declare function importProjectFromZip(file: File): Promise<any>;
|
|
@@ -71,11 +83,44 @@ declare function buildGenerationPrompt(hierarchyText: string, mode?: 'literal' |
|
|
|
71
83
|
declare function buildFallbackPrompt(hierarchyText: string): string;
|
|
72
84
|
declare function cleanAiResponse(text: string): string;
|
|
73
85
|
declare function buildImageGenerationOptions(prompt: string, aspectRatio: string, model: string, referenceMediaId?: string): Record<string, any>;
|
|
74
|
-
|
|
86
|
+
interface SelectedTag {
|
|
87
|
+
label: string;
|
|
88
|
+
value: string;
|
|
89
|
+
category: string;
|
|
90
|
+
}
|
|
91
|
+
declare function buildPromptTabPayload(selectedTags: SelectedTag[], instructions: string, rules: string, treeText?: string): string;
|
|
75
92
|
declare function parsePromptResponse(raw: string): {
|
|
76
93
|
prompt: string;
|
|
77
94
|
feedback: string | null;
|
|
78
95
|
};
|
|
96
|
+
interface FlowSdk {
|
|
97
|
+
generate: {
|
|
98
|
+
image: (options: Record<string, any>) => Promise<{
|
|
99
|
+
base64: string;
|
|
100
|
+
mediaId: string;
|
|
101
|
+
}>;
|
|
102
|
+
text: (prompt: string, options?: Record<string, any>) => Promise<{
|
|
103
|
+
text: string;
|
|
104
|
+
}>;
|
|
105
|
+
};
|
|
106
|
+
download: (args: {
|
|
107
|
+
base64: string;
|
|
108
|
+
mimeType: string;
|
|
109
|
+
filename: string;
|
|
110
|
+
}) => Promise<void>;
|
|
111
|
+
media: {
|
|
112
|
+
selectMultiple: (args: {
|
|
113
|
+
filter: string;
|
|
114
|
+
}) => Promise<any[]>;
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
declare function createFlowServices(Flow: FlowSdk): {
|
|
118
|
+
generateImage: (options: Record<string, any>) => Promise<{
|
|
119
|
+
base64: string;
|
|
120
|
+
mediaId: string;
|
|
121
|
+
}>;
|
|
122
|
+
generateText: (hierarchyText: string, mode?: "literal" | "creative") => Promise<string>;
|
|
123
|
+
};
|
|
79
124
|
declare function interpretSdkError(err: any): Error;
|
|
80
125
|
|
|
81
126
|
interface ExtractedCharacter {
|
|
@@ -142,9 +187,7 @@ declare const InspectPanel: React.FC<InspectPanelProps>;
|
|
|
142
187
|
|
|
143
188
|
interface SetupPanelProps {
|
|
144
189
|
onWorkspaceImport: (file: File) => void;
|
|
145
|
-
|
|
146
|
-
onProjectImport: (file: File) => void;
|
|
147
|
-
projectActionState: 'idle' | 'working' | 'working-full' | 'done' | 'error';
|
|
190
|
+
buildInfo?: string;
|
|
148
191
|
}
|
|
149
192
|
declare const SetupPanel: React.FC<SetupPanelProps>;
|
|
150
193
|
|
|
@@ -193,15 +236,65 @@ interface AvatarArchitectAppProps {
|
|
|
193
236
|
onGeneratePrompt: (text: string) => Promise<string>;
|
|
194
237
|
onDownload: (base64: string, mimeType: string, filename: string) => Promise<void>;
|
|
195
238
|
onSelectMedia: () => Promise<MediaItem[]>;
|
|
239
|
+
buildInfo?: string;
|
|
240
|
+
onFetchServerProjects?: () => Promise<ProjectMeta[]>;
|
|
241
|
+
onServerSave?: (zipBase64: string, name: string) => Promise<ProjectMeta>;
|
|
242
|
+
onServerLoad?: (id: string) => Promise<File>;
|
|
243
|
+
onServerDelete?: (id: string) => Promise<void>;
|
|
244
|
+
}
|
|
245
|
+
declare function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onSelectMedia, buildInfo, onFetchServerProjects, onServerSave, onServerLoad, onServerDelete }: AvatarArchitectAppProps): react_jsx_runtime.JSX.Element;
|
|
246
|
+
|
|
247
|
+
interface CollapsibleCardProps {
|
|
248
|
+
title: string;
|
|
249
|
+
icon?: ReactNode;
|
|
250
|
+
actions?: ReactNode;
|
|
251
|
+
children: ReactNode;
|
|
252
|
+
defaultOpen?: boolean;
|
|
253
|
+
collapsible?: boolean;
|
|
254
|
+
className?: string;
|
|
196
255
|
}
|
|
197
|
-
declare
|
|
256
|
+
declare const CollapsibleCard: React.FC<CollapsibleCardProps>;
|
|
198
257
|
|
|
199
258
|
interface PromptTabProps {
|
|
200
259
|
workspaceTags: WorkspaceTags;
|
|
201
|
-
onGenerate: (
|
|
260
|
+
onGenerate: (selectedTags: SelectedTag[], instructions: string, rules: string) => Promise<void>;
|
|
202
261
|
isGenerating: boolean;
|
|
203
262
|
feedback: string | null;
|
|
263
|
+
promptResult?: string | null;
|
|
264
|
+
lastPayload?: string | null;
|
|
265
|
+
onGenerateImage?: (prompt: string) => void;
|
|
266
|
+
isGeneratingImage?: boolean;
|
|
267
|
+
onRandom?: () => void;
|
|
268
|
+
onTokenize?: () => void;
|
|
269
|
+
isTokenizing?: boolean;
|
|
270
|
+
onScanImage?: (file: File) => void;
|
|
271
|
+
isScanning?: boolean;
|
|
272
|
+
onExpand?: () => void;
|
|
273
|
+
isExpanding?: boolean;
|
|
274
|
+
onTagCreate?: (tag: SelectedTag & {
|
|
275
|
+
is_user_created: true;
|
|
276
|
+
}) => void;
|
|
277
|
+
onTagUpdate?: (originalLabel: string, originalCategory: string, updates: {
|
|
278
|
+
label: string;
|
|
279
|
+
value: string;
|
|
280
|
+
}) => void;
|
|
281
|
+
onTagDelete?: (label: string, category: string) => void;
|
|
204
282
|
}
|
|
205
283
|
declare const PromptTab: React.FC<PromptTabProps>;
|
|
206
284
|
|
|
207
|
-
|
|
285
|
+
interface ProjectSyncTabProps {
|
|
286
|
+
onProjectExport?: () => Promise<void>;
|
|
287
|
+
onProjectImport?: (file: File) => Promise<void>;
|
|
288
|
+
onWorkspaceImport?: (file: File) => void;
|
|
289
|
+
projectActionState?: 'idle' | 'working' | 'working-full' | 'done' | 'error';
|
|
290
|
+
serverProjects?: ProjectMeta[];
|
|
291
|
+
onServerSave?: (name?: string) => Promise<void>;
|
|
292
|
+
onServerLoad?: (id: string) => void;
|
|
293
|
+
onServerDelete?: (id: string) => void;
|
|
294
|
+
onRefreshServerProjects?: () => Promise<void>;
|
|
295
|
+
onComputeSyncDiff?: () => Promise<SyncDiff>;
|
|
296
|
+
onExecuteSync?: (selectedLocalIds: string[]) => Promise<void>;
|
|
297
|
+
}
|
|
298
|
+
declare const ProjectSyncTab: React.FC<ProjectSyncTabProps>;
|
|
299
|
+
|
|
300
|
+
export { AvatarArchitectApp, type AvatarArchitectAppProps, CollapsibleCard, CompactDropdown, type ExtractedCharacter, FaToolsBadge, type FlowSdk, GLOBAL_STYLES, type Generation, HistoryPanel, InspectPanel, ListView, type MediaItem, MediaLibrary, PillButton, type ProjectMeta, type ProjectSettings, ProjectSyncTab, PromptTab, SectionLabel, type SelectedTag, SetupPanel, type SyncDiff, type TagOption, type WorkspaceTags, buildFallbackPrompt, buildGenerationPrompt, buildImageGenerationOptions, buildPromptTabPayload, cleanAiResponse, createFlowServices, exportProjectToZip, formatTreeToMarkdown, getFormattedTimestamp, importProjectFromZip, injectXMPMetadata, interpretSdkError, parsePromptFile, parsePromptResponse, useKeyboardNavigation, useOnClickOutside };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { RefObject } from 'react';
|
|
1
|
+
import React, { RefObject, ReactNode } from 'react';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
3
|
import { Node, Edge } from '@xyflow/react';
|
|
4
4
|
|
|
@@ -7,6 +7,8 @@ declare function useOnClickOutside(ref: RefObject<HTMLElement | null>, handler:
|
|
|
7
7
|
interface TagOption {
|
|
8
8
|
label: string;
|
|
9
9
|
value: string;
|
|
10
|
+
is_user_created?: boolean;
|
|
11
|
+
is_deleted?: boolean;
|
|
10
12
|
}
|
|
11
13
|
interface WorkspaceTags {
|
|
12
14
|
by_category: Record<string, TagOption[]>;
|
|
@@ -40,6 +42,16 @@ interface ProjectSettings {
|
|
|
40
42
|
seed: number;
|
|
41
43
|
seedMode: 'random' | 'fixed';
|
|
42
44
|
}
|
|
45
|
+
interface ProjectMeta {
|
|
46
|
+
id: string;
|
|
47
|
+
name: string;
|
|
48
|
+
saved_at: string;
|
|
49
|
+
size: number;
|
|
50
|
+
}
|
|
51
|
+
interface SyncDiff {
|
|
52
|
+
localOnly: Generation[];
|
|
53
|
+
serverOnly: Generation[];
|
|
54
|
+
}
|
|
43
55
|
|
|
44
56
|
/**
|
|
45
57
|
* Hook für die Tastaturnavigation im Detailview.
|
|
@@ -62,7 +74,7 @@ declare function injectXMPMetadata(base64: string, prompt: string, seed?: number
|
|
|
62
74
|
/**
|
|
63
75
|
* Vollständiger Export: JSON + MD + Bilder (mit XMP Meta)
|
|
64
76
|
*/
|
|
65
|
-
declare function exportProjectToZip(nodes: any[], edges: any[], history: any[], galleryItems: any[], settings: any): Promise<{
|
|
77
|
+
declare function exportProjectToZip(nodes: any[], edges: any[], history: any[], galleryItems: any[], settings: any, workspaceTags?: any): Promise<{
|
|
66
78
|
base64: string;
|
|
67
79
|
}>;
|
|
68
80
|
declare function importProjectFromZip(file: File): Promise<any>;
|
|
@@ -71,11 +83,44 @@ declare function buildGenerationPrompt(hierarchyText: string, mode?: 'literal' |
|
|
|
71
83
|
declare function buildFallbackPrompt(hierarchyText: string): string;
|
|
72
84
|
declare function cleanAiResponse(text: string): string;
|
|
73
85
|
declare function buildImageGenerationOptions(prompt: string, aspectRatio: string, model: string, referenceMediaId?: string): Record<string, any>;
|
|
74
|
-
|
|
86
|
+
interface SelectedTag {
|
|
87
|
+
label: string;
|
|
88
|
+
value: string;
|
|
89
|
+
category: string;
|
|
90
|
+
}
|
|
91
|
+
declare function buildPromptTabPayload(selectedTags: SelectedTag[], instructions: string, rules: string, treeText?: string): string;
|
|
75
92
|
declare function parsePromptResponse(raw: string): {
|
|
76
93
|
prompt: string;
|
|
77
94
|
feedback: string | null;
|
|
78
95
|
};
|
|
96
|
+
interface FlowSdk {
|
|
97
|
+
generate: {
|
|
98
|
+
image: (options: Record<string, any>) => Promise<{
|
|
99
|
+
base64: string;
|
|
100
|
+
mediaId: string;
|
|
101
|
+
}>;
|
|
102
|
+
text: (prompt: string, options?: Record<string, any>) => Promise<{
|
|
103
|
+
text: string;
|
|
104
|
+
}>;
|
|
105
|
+
};
|
|
106
|
+
download: (args: {
|
|
107
|
+
base64: string;
|
|
108
|
+
mimeType: string;
|
|
109
|
+
filename: string;
|
|
110
|
+
}) => Promise<void>;
|
|
111
|
+
media: {
|
|
112
|
+
selectMultiple: (args: {
|
|
113
|
+
filter: string;
|
|
114
|
+
}) => Promise<any[]>;
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
declare function createFlowServices(Flow: FlowSdk): {
|
|
118
|
+
generateImage: (options: Record<string, any>) => Promise<{
|
|
119
|
+
base64: string;
|
|
120
|
+
mediaId: string;
|
|
121
|
+
}>;
|
|
122
|
+
generateText: (hierarchyText: string, mode?: "literal" | "creative") => Promise<string>;
|
|
123
|
+
};
|
|
79
124
|
declare function interpretSdkError(err: any): Error;
|
|
80
125
|
|
|
81
126
|
interface ExtractedCharacter {
|
|
@@ -142,9 +187,7 @@ declare const InspectPanel: React.FC<InspectPanelProps>;
|
|
|
142
187
|
|
|
143
188
|
interface SetupPanelProps {
|
|
144
189
|
onWorkspaceImport: (file: File) => void;
|
|
145
|
-
|
|
146
|
-
onProjectImport: (file: File) => void;
|
|
147
|
-
projectActionState: 'idle' | 'working' | 'working-full' | 'done' | 'error';
|
|
190
|
+
buildInfo?: string;
|
|
148
191
|
}
|
|
149
192
|
declare const SetupPanel: React.FC<SetupPanelProps>;
|
|
150
193
|
|
|
@@ -193,15 +236,65 @@ interface AvatarArchitectAppProps {
|
|
|
193
236
|
onGeneratePrompt: (text: string) => Promise<string>;
|
|
194
237
|
onDownload: (base64: string, mimeType: string, filename: string) => Promise<void>;
|
|
195
238
|
onSelectMedia: () => Promise<MediaItem[]>;
|
|
239
|
+
buildInfo?: string;
|
|
240
|
+
onFetchServerProjects?: () => Promise<ProjectMeta[]>;
|
|
241
|
+
onServerSave?: (zipBase64: string, name: string) => Promise<ProjectMeta>;
|
|
242
|
+
onServerLoad?: (id: string) => Promise<File>;
|
|
243
|
+
onServerDelete?: (id: string) => Promise<void>;
|
|
244
|
+
}
|
|
245
|
+
declare function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onSelectMedia, buildInfo, onFetchServerProjects, onServerSave, onServerLoad, onServerDelete }: AvatarArchitectAppProps): react_jsx_runtime.JSX.Element;
|
|
246
|
+
|
|
247
|
+
interface CollapsibleCardProps {
|
|
248
|
+
title: string;
|
|
249
|
+
icon?: ReactNode;
|
|
250
|
+
actions?: ReactNode;
|
|
251
|
+
children: ReactNode;
|
|
252
|
+
defaultOpen?: boolean;
|
|
253
|
+
collapsible?: boolean;
|
|
254
|
+
className?: string;
|
|
196
255
|
}
|
|
197
|
-
declare
|
|
256
|
+
declare const CollapsibleCard: React.FC<CollapsibleCardProps>;
|
|
198
257
|
|
|
199
258
|
interface PromptTabProps {
|
|
200
259
|
workspaceTags: WorkspaceTags;
|
|
201
|
-
onGenerate: (
|
|
260
|
+
onGenerate: (selectedTags: SelectedTag[], instructions: string, rules: string) => Promise<void>;
|
|
202
261
|
isGenerating: boolean;
|
|
203
262
|
feedback: string | null;
|
|
263
|
+
promptResult?: string | null;
|
|
264
|
+
lastPayload?: string | null;
|
|
265
|
+
onGenerateImage?: (prompt: string) => void;
|
|
266
|
+
isGeneratingImage?: boolean;
|
|
267
|
+
onRandom?: () => void;
|
|
268
|
+
onTokenize?: () => void;
|
|
269
|
+
isTokenizing?: boolean;
|
|
270
|
+
onScanImage?: (file: File) => void;
|
|
271
|
+
isScanning?: boolean;
|
|
272
|
+
onExpand?: () => void;
|
|
273
|
+
isExpanding?: boolean;
|
|
274
|
+
onTagCreate?: (tag: SelectedTag & {
|
|
275
|
+
is_user_created: true;
|
|
276
|
+
}) => void;
|
|
277
|
+
onTagUpdate?: (originalLabel: string, originalCategory: string, updates: {
|
|
278
|
+
label: string;
|
|
279
|
+
value: string;
|
|
280
|
+
}) => void;
|
|
281
|
+
onTagDelete?: (label: string, category: string) => void;
|
|
204
282
|
}
|
|
205
283
|
declare const PromptTab: React.FC<PromptTabProps>;
|
|
206
284
|
|
|
207
|
-
|
|
285
|
+
interface ProjectSyncTabProps {
|
|
286
|
+
onProjectExport?: () => Promise<void>;
|
|
287
|
+
onProjectImport?: (file: File) => Promise<void>;
|
|
288
|
+
onWorkspaceImport?: (file: File) => void;
|
|
289
|
+
projectActionState?: 'idle' | 'working' | 'working-full' | 'done' | 'error';
|
|
290
|
+
serverProjects?: ProjectMeta[];
|
|
291
|
+
onServerSave?: (name?: string) => Promise<void>;
|
|
292
|
+
onServerLoad?: (id: string) => void;
|
|
293
|
+
onServerDelete?: (id: string) => void;
|
|
294
|
+
onRefreshServerProjects?: () => Promise<void>;
|
|
295
|
+
onComputeSyncDiff?: () => Promise<SyncDiff>;
|
|
296
|
+
onExecuteSync?: (selectedLocalIds: string[]) => Promise<void>;
|
|
297
|
+
}
|
|
298
|
+
declare const ProjectSyncTab: React.FC<ProjectSyncTabProps>;
|
|
299
|
+
|
|
300
|
+
export { AvatarArchitectApp, type AvatarArchitectAppProps, CollapsibleCard, CompactDropdown, type ExtractedCharacter, FaToolsBadge, type FlowSdk, GLOBAL_STYLES, type Generation, HistoryPanel, InspectPanel, ListView, type MediaItem, MediaLibrary, PillButton, type ProjectMeta, type ProjectSettings, ProjectSyncTab, PromptTab, SectionLabel, type SelectedTag, SetupPanel, type SyncDiff, type TagOption, type WorkspaceTags, buildFallbackPrompt, buildGenerationPrompt, buildImageGenerationOptions, buildPromptTabPayload, cleanAiResponse, createFlowServices, exportProjectToZip, formatTreeToMarkdown, getFormattedTimestamp, importProjectFromZip, injectXMPMetadata, interpretSdkError, parsePromptFile, parsePromptResponse, useKeyboardNavigation, useOnClickOutside };
|