@rslsp1/fa-app-tools 1.3.18 → 2.0.12
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/chunk-WCFXXLKN.mjs +409 -0
- package/dist/hfStateService-6YYT6ATO.mjs +54 -0
- package/dist/index.d.mts +103 -9
- package/dist/index.d.ts +103 -9
- package/dist/index.js +810 -297
- package/dist/index.mjs +573 -251
- package/package.json +5 -4
- package/dist/chunk-X6S5BP36.mjs +0 -232
- package/dist/hfStateService-B62RV5K3.mjs +0 -32
package/dist/index.d.ts
CHANGED
|
@@ -310,12 +310,14 @@ interface AvatarArchitectAppProps {
|
|
|
310
310
|
onSelectMedia: () => Promise<MediaItem[]>;
|
|
311
311
|
buildInfo?: string;
|
|
312
312
|
initialHfToken?: string;
|
|
313
|
+
hfNamespace?: string;
|
|
314
|
+
allowDevNamespace?: boolean;
|
|
313
315
|
onFetchServerProjects?: () => Promise<ProjectMeta[]>;
|
|
314
316
|
onServerSave?: (zipBase64: string, name: string) => Promise<ProjectMeta>;
|
|
315
317
|
onServerLoad?: (id: string) => Promise<File>;
|
|
316
318
|
onServerDelete?: (id: string) => Promise<void>;
|
|
317
319
|
}
|
|
318
|
-
declare function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onSelectMedia, buildInfo, initialHfToken, onFetchServerProjects, onServerSave, onServerLoad, onServerDelete }: AvatarArchitectAppProps): react_jsx_runtime.JSX.Element;
|
|
320
|
+
declare function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onSelectMedia, buildInfo, initialHfToken, hfNamespace, allowDevNamespace, onFetchServerProjects, onServerSave, onServerLoad, onServerDelete }: AvatarArchitectAppProps): react_jsx_runtime.JSX.Element;
|
|
319
321
|
|
|
320
322
|
interface FaAppProps {
|
|
321
323
|
onGenerateImage: (params: Record<string, any>) => Promise<{
|
|
@@ -347,13 +349,15 @@ interface FaAppProps {
|
|
|
347
349
|
mediaId: string;
|
|
348
350
|
}>;
|
|
349
351
|
libToken?: string;
|
|
352
|
+
allowDevNamespace?: boolean;
|
|
353
|
+
serverBaseUrl?: string;
|
|
350
354
|
onFetchServerProjects?: () => Promise<ProjectMeta[]>;
|
|
351
355
|
onServerSave?: (zipBase64: string, name: string) => Promise<ProjectMeta>;
|
|
352
356
|
onServerLoad?: (id: string) => Promise<File>;
|
|
353
357
|
onServerDelete?: (id: string) => Promise<void>;
|
|
354
358
|
buildInfo?: string;
|
|
355
359
|
}
|
|
356
|
-
declare function FaApp({ onGenerateImage, onGeneratePrompt, onGenerateVideo: _onGenerateVideo, onDownload, onSelectMedia, onFlowSave: _onFlowSave, onFlowUpload: _onFlowUpload, onFlowMediaUpload: _onFlowMediaUpload, libToken, onFetchServerProjects, onServerSave, onServerLoad, onServerDelete, buildInfo, }: FaAppProps): react_jsx_runtime.JSX.Element;
|
|
360
|
+
declare function FaApp({ onGenerateImage, onGeneratePrompt, onGenerateVideo: _onGenerateVideo, onDownload, onSelectMedia, onFlowSave: _onFlowSave, onFlowUpload: _onFlowUpload, onFlowMediaUpload: _onFlowMediaUpload, libToken, allowDevNamespace, serverBaseUrl, onFetchServerProjects, onServerSave, onServerLoad, onServerDelete, buildInfo, }: FaAppProps): react_jsx_runtime.JSX.Element;
|
|
357
361
|
|
|
358
362
|
interface CollapsibleCardProps {
|
|
359
363
|
title: string;
|
|
@@ -394,6 +398,7 @@ interface PromptTabProps {
|
|
|
394
398
|
declare const PromptTab: React.FC<PromptTabProps>;
|
|
395
399
|
|
|
396
400
|
interface ProjectSyncTabProps {
|
|
401
|
+
topSlot?: React.ReactNode;
|
|
397
402
|
onProjectExport?: () => Promise<void>;
|
|
398
403
|
onProjectImport?: (file: File) => Promise<void>;
|
|
399
404
|
onWorkspaceImport?: (file: File) => void;
|
|
@@ -498,6 +503,46 @@ declare function buildLoopInstruction(rounds: Array<{
|
|
|
498
503
|
declare function autoLabel(index: number): string;
|
|
499
504
|
declare function buildReferenceImageMediaIds(images: SelectedLabImage[]): string[];
|
|
500
505
|
|
|
506
|
+
interface HFEventVersion {
|
|
507
|
+
major: number;
|
|
508
|
+
minor: number;
|
|
509
|
+
}
|
|
510
|
+
interface HFEvent<P = unknown> {
|
|
511
|
+
v: HFEventVersion;
|
|
512
|
+
type: string;
|
|
513
|
+
ts: number;
|
|
514
|
+
prevTs: number[];
|
|
515
|
+
clientId: string;
|
|
516
|
+
payload: P;
|
|
517
|
+
}
|
|
518
|
+
interface HFStateMeta {
|
|
519
|
+
consolidatedAt: number;
|
|
520
|
+
version: number;
|
|
521
|
+
}
|
|
522
|
+
interface HFStateSnapshot {
|
|
523
|
+
metadata: HFMetadataEntry[];
|
|
524
|
+
tags: WorkspaceTags;
|
|
525
|
+
meta: HFStateMeta;
|
|
526
|
+
}
|
|
527
|
+
interface HFFileInfo$1 {
|
|
528
|
+
type: 'file' | 'directory';
|
|
529
|
+
path: string;
|
|
530
|
+
size: number;
|
|
531
|
+
}
|
|
532
|
+
interface ImageAddedPayload extends HFMetadataEntry {
|
|
533
|
+
}
|
|
534
|
+
interface TagUpsertedPayload {
|
|
535
|
+
category: string;
|
|
536
|
+
label: string;
|
|
537
|
+
value: string;
|
|
538
|
+
is_user_created?: boolean;
|
|
539
|
+
is_deleted?: boolean;
|
|
540
|
+
}
|
|
541
|
+
interface MetadataUpdatedPayload {
|
|
542
|
+
id: string;
|
|
543
|
+
delta: Partial<HFMetadataEntry>;
|
|
544
|
+
}
|
|
545
|
+
|
|
501
546
|
declare function getHFToken(): string | null;
|
|
502
547
|
declare function setHFToken(token: string): void;
|
|
503
548
|
interface HFProjectMeta {
|
|
@@ -507,17 +552,66 @@ interface HFProjectMeta {
|
|
|
507
552
|
size: number;
|
|
508
553
|
isLfs: boolean;
|
|
509
554
|
}
|
|
555
|
+
interface HFFileInfo {
|
|
556
|
+
type: 'file' | 'directory';
|
|
557
|
+
path: string;
|
|
558
|
+
size: number;
|
|
559
|
+
}
|
|
560
|
+
declare function hfListDir(namespace: string, subdir: string, token: string): Promise<HFFileInfo[]>;
|
|
561
|
+
declare function hfUploadSmallFile(repoPath: string, content: string, token: string, summary?: string): Promise<void>;
|
|
562
|
+
declare function hfBatchArchive(moves: Array<{
|
|
563
|
+
from: string;
|
|
564
|
+
to: string;
|
|
565
|
+
content: string;
|
|
566
|
+
}>, token: string, summary: string): Promise<void>;
|
|
567
|
+
declare function tsFromEventPath(repoPath: string): number;
|
|
568
|
+
declare function loadHFState(namespace: string, token: string): Promise<HFStateSnapshot | null>;
|
|
569
|
+
declare function loadPendingEvents(namespace: string, token: string, sinceTs: number): Promise<HFEvent[]>;
|
|
570
|
+
declare function getSessionClientId(): string;
|
|
571
|
+
declare function writeHFEvent<P>(namespace: string, token: string, type: string, payload: P, prevTs: number[]): Promise<HFEvent<P>>;
|
|
572
|
+
declare function hfBootstrapFromLegacy(namespace: string, token: string, onProgress?: (msg: string) => void): Promise<void>;
|
|
510
573
|
declare function hfListProjects(token: string): Promise<HFProjectMeta[]>;
|
|
511
574
|
declare function hfDownloadProject(path: string, token: string): Promise<File>;
|
|
512
|
-
declare function hfUploadProjectForm(
|
|
575
|
+
declare function hfUploadProjectForm(_zipBase64: string, _name: string, _token: string): Promise<HFProjectMeta>;
|
|
513
576
|
declare function hfDeleteProject(path: string, token: string): Promise<void>;
|
|
514
|
-
declare function hfSaveTags(workspaceTags: any, token: string): Promise<void>;
|
|
515
|
-
declare function hfLoadTags(token: string): Promise<any | null>;
|
|
516
|
-
declare function hfSaveMetadata(entries: any[], token: string): Promise<void>;
|
|
517
|
-
declare function hfLoadMetadata(token: string): Promise<any[]>;
|
|
518
577
|
declare function hfUploadImage(base64: string, id: string, token: string, mimeType?: string): Promise<void>;
|
|
519
578
|
declare function hfLoadImageAsBase64(id: string, token: string): Promise<string | null>;
|
|
520
579
|
|
|
521
|
-
|
|
580
|
+
interface HFStateResult {
|
|
581
|
+
state: HFStateSnapshot | null;
|
|
582
|
+
isLoading: boolean;
|
|
583
|
+
error: string | null;
|
|
584
|
+
pendingBufferCount: number;
|
|
585
|
+
eventCount: number;
|
|
586
|
+
forks: Array<{
|
|
587
|
+
parentTs: number;
|
|
588
|
+
childTs: number[];
|
|
589
|
+
}>;
|
|
590
|
+
allEvents: HFEvent[];
|
|
591
|
+
writeEvent: (type: string, payload: any) => Promise<void>;
|
|
592
|
+
refresh: () => Promise<void>;
|
|
593
|
+
lastEventTs: number;
|
|
594
|
+
hasStateZip: boolean;
|
|
595
|
+
}
|
|
596
|
+
declare function useHFState(token: string, namespace: string): HFStateResult;
|
|
597
|
+
|
|
598
|
+
declare function applyEvent(state: HFStateSnapshot, event: HFEvent): HFStateSnapshot;
|
|
599
|
+
declare function applyEvents(state: HFStateSnapshot, events: HFEvent[]): HFStateSnapshot;
|
|
600
|
+
|
|
601
|
+
interface DagNode {
|
|
602
|
+
event: HFEvent;
|
|
603
|
+
children: number[];
|
|
604
|
+
}
|
|
605
|
+
interface DagFork {
|
|
606
|
+
parentTs: number;
|
|
607
|
+
childTs: number[];
|
|
608
|
+
}
|
|
609
|
+
type Dag = Map<number, DagNode>;
|
|
610
|
+
declare function buildDag(events: HFEvent[]): Dag;
|
|
611
|
+
declare function findTips(dag: Dag): number[];
|
|
612
|
+
declare function findForks(dag: Dag): DagFork[];
|
|
613
|
+
declare function topoSort(events: HFEvent[]): HFEvent[];
|
|
614
|
+
|
|
615
|
+
declare const LIB_VERSION = "2.0.12";
|
|
522
616
|
|
|
523
|
-
export { AvatarArchitectApp, type AvatarArchitectAppProps, CollapsibleCard, CompactDropdown, type ExtractedCharacter, FaApp, type FaAppProps, FaToolsBadge, type FlowSdk, GLOBAL_STYLES, type Generation, type HFMetadataEntry, HistoryPanel, InspectPanel, LIB_VERSION, LabBlend, LabCompare, type LabFrame, LabImagePicker, type LabItem, LabLoop, LabRemix, type LabServices, LabsTab, ListView, type MediaItem, MediaLibrary, PillButton, type ProjectMeta, type ProjectSettings, ProjectSyncTab, PromptTab, SectionLabel, type SelectedLabImage, type SelectedTag, SetupPanel, type SyncDiff, TagManagerPanel, type TagOption, type WorkspaceTags, autoLabel, buildBlendInstruction, buildCompareInstruction, buildFallbackPrompt, buildGenerationPrompt, buildImageGenerationOptions, buildLoopInstruction, buildPromptTabPayload, buildReferenceImageMediaIds, buildRemixInstruction, buildScanInstruction, cleanAiResponse, createFlowServices, exportProjectToZip, formatTreeToMarkdown, frameToGeneration, getFormattedTimestamp, getHFToken,
|
|
617
|
+
export { AvatarArchitectApp, type AvatarArchitectAppProps, CollapsibleCard, CompactDropdown, type DagFork, type ExtractedCharacter, FaApp, type FaAppProps, FaToolsBadge, type FlowSdk, GLOBAL_STYLES, type Generation, type HFEvent, type HFEventVersion, type HFFileInfo$1 as HFFileInfo, type HFMetadataEntry, type HFStateMeta, type HFStateResult, type HFStateSnapshot, HistoryPanel, type ImageAddedPayload, InspectPanel, LIB_VERSION, LabBlend, LabCompare, type LabFrame, LabImagePicker, type LabItem, LabLoop, LabRemix, type LabServices, LabsTab, ListView, type MediaItem, MediaLibrary, type MetadataUpdatedPayload, PillButton, type ProjectMeta, type ProjectSettings, ProjectSyncTab, PromptTab, SectionLabel, type SelectedLabImage, type SelectedTag, SetupPanel, type SyncDiff, TagManagerPanel, type TagOption, type TagUpsertedPayload, type WorkspaceTags, applyEvent, applyEvents, autoLabel, buildBlendInstruction, buildCompareInstruction, buildDag, buildFallbackPrompt, buildGenerationPrompt, buildImageGenerationOptions, buildLoopInstruction, buildPromptTabPayload, buildReferenceImageMediaIds, buildRemixInstruction, buildScanInstruction, cleanAiResponse, createFlowServices, exportProjectToZip, findForks, findTips, formatTreeToMarkdown, frameToGeneration, getFormattedTimestamp, getHFToken, getSessionClientId, groupGenerationsToLabItems, hfBatchArchive, hfBootstrapFromLegacy, hfDeleteProject, hfDownloadProject, hfListDir, hfListProjects, hfLoadImageAsBase64, hfUploadImage, hfUploadProjectForm, hfUploadSmallFile, importProjectFromZip, injectXMPMetadata, interpretSdkError, loadHFState, loadPendingEvents, parsePromptFile, parsePromptResponse, setHFToken, topoSort, tsFromEventPath, useHFState, useKeyboardNavigation, useOnClickOutside, writeHFEvent };
|