@vgai/fal 0.1.3 → 0.1.5
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 +1 -1
- package/src/accept.ts +1 -0
- package/src/contracts.ts +1 -0
- package/src/tool-error.ts +17 -1
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@vgai/fal",
|
|
3
3
|
"author": "Volter AI, Inc.",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
|
-
"version": "0.1.
|
|
5
|
+
"version": "0.1.5",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"description": "Optional registered Fal provider boundary for VGAI projects: quote, submit, poll and accept behind guarded pricing and credentials.",
|
|
8
8
|
"homepage": "https://github.com/volter-ai/vgai-engine#readme",
|
package/src/accept.ts
CHANGED
|
@@ -208,6 +208,7 @@ async function acceptedFiles(
|
|
|
208
208
|
}
|
|
209
209
|
if (
|
|
210
210
|
endpoint === 'fal-ai/minimax/hailuo-02/standard/text-to-video' ||
|
|
211
|
+
endpoint === 'minimax/h3/image-to-video' ||
|
|
211
212
|
endpoint === SEEDANCE_2_REFERENCE_TO_VIDEO_ENDPOINT
|
|
212
213
|
) {
|
|
213
214
|
return [await video(nativeFile(data['video'], 'video'), fetcher)];
|
package/src/contracts.ts
CHANGED
|
@@ -20,6 +20,7 @@ export const FalEndpointSchema = z.enum([
|
|
|
20
20
|
'fal-ai/stable-audio',
|
|
21
21
|
'fal-ai/sam-3/3d-objects',
|
|
22
22
|
'fal-ai/minimax/hailuo-02/standard/text-to-video',
|
|
23
|
+
'minimax/h3/image-to-video',
|
|
23
24
|
SEEDANCE_2_REFERENCE_TO_VIDEO_ENDPOINT,
|
|
24
25
|
'fal-ai/hunyuan_world/image-to-world',
|
|
25
26
|
'fal-ai/hunyuan_world',
|
package/src/tool-error.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ApiError } from '@fal-ai/client';
|
|
1
2
|
import { type ToolContext, ToolError } from '@vgai/sdk/tools';
|
|
2
3
|
|
|
3
4
|
export const falToolErrors = [
|
|
@@ -23,7 +24,22 @@ export function falTool<TInput, TResult>(
|
|
|
23
24
|
throw cause;
|
|
24
25
|
}
|
|
25
26
|
const message = cause instanceof Error ? cause.message : String(cause);
|
|
26
|
-
|
|
27
|
+
const detail = cause instanceof ApiError ? cause.body?.detail : undefined;
|
|
28
|
+
throw new ToolError('PROVIDER_ERROR', message, {
|
|
29
|
+
provider: 'fal',
|
|
30
|
+
message,
|
|
31
|
+
...(cause instanceof ApiError
|
|
32
|
+
? { status: cause.status, requestId: cause.requestId }
|
|
33
|
+
: {}),
|
|
34
|
+
...(typeof detail === 'string' ? { detail } : {}),
|
|
35
|
+
...(Array.isArray(detail)
|
|
36
|
+
? {
|
|
37
|
+
detail: detail
|
|
38
|
+
.filter((item) => item !== null && typeof item === 'object')
|
|
39
|
+
.map(({ loc, msg, type }) => ({ loc, msg, type })),
|
|
40
|
+
}
|
|
41
|
+
: {}),
|
|
42
|
+
});
|
|
27
43
|
}
|
|
28
44
|
};
|
|
29
45
|
}
|