@rslsp1/fa-app-tools 1.2.8 → 1.3.0

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.
@@ -58,20 +58,28 @@ async function hfUploadProject(zipBase64, name, token) {
58
58
  if (!preRes.ok) throw new Error(`HF preupload failed: ${preRes.status} ${preRes.statusText}`);
59
59
  const preData = await preRes.json();
60
60
  const fileInfo = preData.files?.[0];
61
- if (fileInfo?.uploadMode === "lfs" && fileInfo?.uploadUrl) {
61
+ const debugInfo = JSON.stringify({ uploadMode: fileInfo?.uploadMode, hasUploadUrl: !!fileInfo?.uploadUrl, hasVerifyUrl: !!fileInfo?.verifyUrl, headerKeys: Object.keys(fileInfo?.header || {}), verifyHeaderKeys: Object.keys(fileInfo?.verifyHeader || {}) });
62
+ if (!fileInfo?.uploadMode) throw new Error(`HF preupload kein fileInfo: ${JSON.stringify(preData)}`);
63
+ if (fileInfo.uploadMode === "lfs" && fileInfo.uploadUrl) {
62
64
  const uploadRes = await fetch(fileInfo.uploadUrl, {
63
65
  method: "PUT",
64
66
  headers: { "Content-Type": "application/octet-stream", ...fileInfo.header || {} },
65
67
  body: bytes
66
68
  });
67
- if (!uploadRes.ok) throw new Error(`HF LFS upload failed: ${uploadRes.status}`);
69
+ if (!uploadRes.ok) {
70
+ const uploadErr = await uploadRes.text().catch(() => "");
71
+ throw new Error(`HF LFS upload failed: ${uploadRes.status} \u2014 ${uploadErr.slice(0, 200)}`);
72
+ }
68
73
  if (fileInfo.verifyUrl) {
69
74
  const verifyRes = await fetch(fileInfo.verifyUrl, {
70
75
  method: "POST",
71
76
  headers: { Authorization: `Bearer ${token}`, "Content-Type": "application/json", ...fileInfo.verifyHeader || {} },
72
77
  body: JSON.stringify({ oid, size })
73
78
  });
74
- if (!verifyRes.ok) throw new Error(`HF LFS verify failed: ${verifyRes.status}`);
79
+ if (!verifyRes.ok) {
80
+ const verifyErr = await verifyRes.text().catch(() => "");
81
+ throw new Error(`HF LFS verify failed: ${verifyRes.status} \u2014 ${verifyErr.slice(0, 200)}`);
82
+ }
75
83
  }
76
84
  }
77
85
  const commitRes = await fetch(`${HF_BASE}/api/datasets/${HF_REPO}/commit/main`, {
@@ -6,7 +6,7 @@ import {
6
6
  hfListProjects,
7
7
  hfUploadProject,
8
8
  setHFToken
9
- } from "./chunk-2I37YSKP.mjs";
9
+ } from "./chunk-Q4S6265R.mjs";
10
10
  export {
11
11
  HF_TOKEN_KEY,
12
12
  getHFToken,
package/dist/index.d.mts CHANGED
@@ -448,6 +448,6 @@ declare function buildLoopInstruction(rounds: Array<{
448
448
  declare function autoLabel(index: number): string;
449
449
  declare function buildReferenceImageMediaIds(images: SelectedLabImage[]): string[];
450
450
 
451
- declare const LIB_VERSION = "1.2.8";
451
+ declare const LIB_VERSION = "1.3.0";
452
452
 
453
453
  export { AvatarArchitectApp, type AvatarArchitectAppProps, CollapsibleCard, CompactDropdown, type ExtractedCharacter, FaToolsBadge, type FlowSdk, GLOBAL_STYLES, type Generation, 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, groupGenerationsToLabItems, importProjectFromZip, injectXMPMetadata, interpretSdkError, parsePromptFile, parsePromptResponse, useKeyboardNavigation, useOnClickOutside };
package/dist/index.d.ts CHANGED
@@ -448,6 +448,6 @@ declare function buildLoopInstruction(rounds: Array<{
448
448
  declare function autoLabel(index: number): string;
449
449
  declare function buildReferenceImageMediaIds(images: SelectedLabImage[]): string[];
450
450
 
451
- declare const LIB_VERSION = "1.2.8";
451
+ declare const LIB_VERSION = "1.3.0";
452
452
 
453
453
  export { AvatarArchitectApp, type AvatarArchitectAppProps, CollapsibleCard, CompactDropdown, type ExtractedCharacter, FaToolsBadge, type FlowSdk, GLOBAL_STYLES, type Generation, 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, groupGenerationsToLabItems, importProjectFromZip, injectXMPMetadata, interpretSdkError, parsePromptFile, parsePromptResponse, useKeyboardNavigation, useOnClickOutside };
package/dist/index.js CHANGED
@@ -326,20 +326,28 @@ async function hfUploadProject(zipBase64, name, token) {
326
326
  if (!preRes.ok) throw new Error(`HF preupload failed: ${preRes.status} ${preRes.statusText}`);
327
327
  const preData = await preRes.json();
328
328
  const fileInfo = preData.files?.[0];
329
- if (fileInfo?.uploadMode === "lfs" && fileInfo?.uploadUrl) {
329
+ const debugInfo = JSON.stringify({ uploadMode: fileInfo?.uploadMode, hasUploadUrl: !!fileInfo?.uploadUrl, hasVerifyUrl: !!fileInfo?.verifyUrl, headerKeys: Object.keys(fileInfo?.header || {}), verifyHeaderKeys: Object.keys(fileInfo?.verifyHeader || {}) });
330
+ if (!fileInfo?.uploadMode) throw new Error(`HF preupload kein fileInfo: ${JSON.stringify(preData)}`);
331
+ if (fileInfo.uploadMode === "lfs" && fileInfo.uploadUrl) {
330
332
  const uploadRes = await fetch(fileInfo.uploadUrl, {
331
333
  method: "PUT",
332
334
  headers: { "Content-Type": "application/octet-stream", ...fileInfo.header || {} },
333
335
  body: bytes
334
336
  });
335
- if (!uploadRes.ok) throw new Error(`HF LFS upload failed: ${uploadRes.status}`);
337
+ if (!uploadRes.ok) {
338
+ const uploadErr = await uploadRes.text().catch(() => "");
339
+ throw new Error(`HF LFS upload failed: ${uploadRes.status} \u2014 ${uploadErr.slice(0, 200)}`);
340
+ }
336
341
  if (fileInfo.verifyUrl) {
337
342
  const verifyRes = await fetch(fileInfo.verifyUrl, {
338
343
  method: "POST",
339
344
  headers: { Authorization: `Bearer ${token}`, "Content-Type": "application/json", ...fileInfo.verifyHeader || {} },
340
345
  body: JSON.stringify({ oid, size })
341
346
  });
342
- if (!verifyRes.ok) throw new Error(`HF LFS verify failed: ${verifyRes.status}`);
347
+ if (!verifyRes.ok) {
348
+ const verifyErr = await verifyRes.text().catch(() => "");
349
+ throw new Error(`HF LFS verify failed: ${verifyRes.status} \u2014 ${verifyErr.slice(0, 200)}`);
350
+ }
343
351
  }
344
352
  }
345
353
  const commitRes = await fetch(`${HF_BASE}/api/datasets/${HF_REPO}/commit/main`, {
@@ -4595,7 +4603,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
4595
4603
  }
4596
4604
 
4597
4605
  // src/index.ts
4598
- var LIB_VERSION = "1.2.8";
4606
+ var LIB_VERSION = "1.3.0";
4599
4607
  // Annotate the CommonJS export names for ESM import in node:
4600
4608
  0 && (module.exports = {
4601
4609
  AvatarArchitectApp,
package/dist/index.mjs CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  hfDeleteProject,
8
8
  hfListProjects,
9
9
  hfUploadProject
10
- } from "./chunk-2I37YSKP.mjs";
10
+ } from "./chunk-Q4S6265R.mjs";
11
11
 
12
12
  // src/hooks/useOnClickOutside.ts
13
13
  import { useEffect } from "react";
@@ -1547,7 +1547,7 @@ var ProjectSyncTab = ({
1547
1547
  {
1548
1548
  onClick: async () => {
1549
1549
  try {
1550
- const { hfDownloadProject } = await import("./hfStateService-MSRZPNB2.mjs");
1550
+ const { hfDownloadProject } = await import("./hfStateService-TIQTJTHV.mjs");
1551
1551
  const file = await hfDownloadProject(p.path, hfToken);
1552
1552
  onHfLoad(file);
1553
1553
  } catch (e) {
@@ -3507,7 +3507,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
3507
3507
  onClick: async () => {
3508
3508
  setIsLoadingFromHF(true);
3509
3509
  try {
3510
- const { hfListProjects: hfListProjects2, hfDownloadProject } = await import("./hfStateService-MSRZPNB2.mjs");
3510
+ const { hfListProjects: hfListProjects2, hfDownloadProject } = await import("./hfStateService-TIQTJTHV.mjs");
3511
3511
  const projects = await hfListProjects2(hfToken);
3512
3512
  if (projects.length > 0) {
3513
3513
  const file = await hfDownloadProject(projects[0].path, hfToken);
@@ -4165,7 +4165,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
4165
4165
  }
4166
4166
 
4167
4167
  // src/index.ts
4168
- var LIB_VERSION = "1.2.8";
4168
+ var LIB_VERSION = "1.3.0";
4169
4169
  export {
4170
4170
  AvatarArchitectApp,
4171
4171
  CollapsibleCard,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rslsp1/fa-app-tools",
3
- "version": "1.2.8",
3
+ "version": "1.3.0",
4
4
  "description": "Shared tools and hooks for Fine Art flow apps",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",