@umituz/react-native-ai-pruna-provider 1.0.24 → 1.0.25
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-ai-pruna-provider",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.25",
|
|
4
4
|
"description": "Pruna AI provider for React Native - implements IAIProvider interface for unified AI generation",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -46,6 +46,17 @@ export async function uploadFileToStorage(
|
|
|
46
46
|
|
|
47
47
|
generationLogCollector.log(sessionId, TAG, 'Uploading file to Pruna storage...');
|
|
48
48
|
|
|
49
|
+
// __DEV__ log input data size
|
|
50
|
+
if (typeof __DEV__ !== 'undefined' && __DEV__) {
|
|
51
|
+
const dataSizeKB = Math.round(base64Data.length / 1024);
|
|
52
|
+
console.log(`[DEV] [${TAG}] File upload input:`, {
|
|
53
|
+
dataSizeKB,
|
|
54
|
+
startsWithDataUri: base64Data.startsWith('data:'),
|
|
55
|
+
startsWithHttp: base64Data.startsWith('http'),
|
|
56
|
+
preview: base64Data.substring(0, 50) + '...',
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
|
|
49
60
|
// Use design system filesystem to create temp file (React Native compatible)
|
|
50
61
|
const tempUri = await base64ToTempFile(base64Data);
|
|
51
62
|
|
|
@@ -65,10 +76,30 @@ export async function uploadFileToStorage(
|
|
|
65
76
|
|
|
66
77
|
generationLogCollector.log(sessionId, TAG, `Temp file created (${blob.size} bytes, type: ${actualMimeType}), uploading to Pruna as ${filename}...`);
|
|
67
78
|
|
|
79
|
+
// __DEV__ detailed blob logging
|
|
80
|
+
if (typeof __DEV__ !== 'undefined' && __DEV__) {
|
|
81
|
+
console.log(`[DEV] [${TAG}] Blob details:`, {
|
|
82
|
+
tempUri,
|
|
83
|
+
blobSize: blob.size,
|
|
84
|
+
blobType: blob.type,
|
|
85
|
+
actualMimeType,
|
|
86
|
+
extension,
|
|
87
|
+
filename,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
|
|
68
91
|
// Create FormData with the blob AND proper filename with extension
|
|
69
92
|
const formData = new FormData();
|
|
70
93
|
formData.append('content', blob, filename);
|
|
71
94
|
|
|
95
|
+
// __DEV__ log FormData entries (if possible)
|
|
96
|
+
if (typeof __DEV__ !== 'undefined' && __DEV__) {
|
|
97
|
+
console.log(`[DEV] [${TAG}] FormData created:`, {
|
|
98
|
+
hasContent: formData.has('content'),
|
|
99
|
+
filename,
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
|
|
72
103
|
const startTime = Date.now();
|
|
73
104
|
|
|
74
105
|
// Apply timeout to prevent indefinite hangs
|
|
@@ -96,12 +96,41 @@ async function buildImageEditInput(
|
|
|
96
96
|
for (let i = 0; i < rawImages.length; i++) {
|
|
97
97
|
const rawImage = rawImages[i];
|
|
98
98
|
generationLogCollector.log(sessionId, TAG, `p-image-edit: uploading image ${i + 1}/${rawImages.length}...`);
|
|
99
|
+
|
|
100
|
+
// __DEV__ log image details before upload
|
|
101
|
+
if (typeof __DEV__ !== 'undefined' && __DEV__) {
|
|
102
|
+
console.log(`[DEV] [${TAG}] Image ${i + 1}/${rawImages.length}:`, {
|
|
103
|
+
sizeKB: Math.round(rawImage.length / 1024),
|
|
104
|
+
isUrl: rawImage.startsWith('http'),
|
|
105
|
+
hasDataUri: rawImage.startsWith('data:'),
|
|
106
|
+
preview: rawImage.substring(0, 50) + '...',
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
|
|
99
110
|
const url = await uploadFileToStorage(rawImage, apiKey, sessionId);
|
|
100
111
|
imageUrls.push(url);
|
|
112
|
+
|
|
113
|
+
// __DEV__ log successful upload
|
|
114
|
+
if (typeof __DEV__ !== 'undefined' && __DEV__) {
|
|
115
|
+
console.log(`[DEV] [${TAG}] Image ${i + 1}/${rawImages.length} uploaded successfully:`, {
|
|
116
|
+
url,
|
|
117
|
+
urlPrefix: url.substring(0, 50) + '...',
|
|
118
|
+
});
|
|
119
|
+
}
|
|
101
120
|
}
|
|
102
121
|
|
|
103
122
|
generationLogCollector.log(sessionId, TAG, `p-image-edit: all ${imageUrls.length} image(s) uploaded successfully`);
|
|
104
123
|
|
|
124
|
+
// __DEV__ log final payload
|
|
125
|
+
if (typeof __DEV__ !== 'undefined' && __DEV__) {
|
|
126
|
+
console.log(`[DEV] [${TAG}] Final p-image-edit payload:`, {
|
|
127
|
+
imageCount: imageUrls.length,
|
|
128
|
+
promptLength: prompt.length,
|
|
129
|
+
aspectRatio,
|
|
130
|
+
imageUrls: imageUrls.map(u => u.substring(0, 60) + '...'),
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
|
|
105
134
|
const payload: Record<string, unknown> = {
|
|
106
135
|
images: imageUrls,
|
|
107
136
|
prompt,
|