@henjicc/ai-sdk 0.2.8 → 0.4.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.
- package/CHANGELOG.md +157 -141
- package/README.md +497 -455
- package/dist/capabilities/embedding/bailian.d.ts +23 -0
- package/dist/capabilities/embedding/bailian.js +10 -0
- package/dist/capabilities/embedding/bigmodel.d.ts +9 -0
- package/dist/capabilities/embedding/bigmodel.js +5 -0
- package/dist/capabilities/embedding/index.d.ts +1 -0
- package/dist/capabilities/embedding/index.js +1 -0
- package/dist/capabilities/embedding/ppio.d.ts +7 -0
- package/dist/capabilities/embedding/ppio.js +5 -0
- package/dist/capabilities/embedding/siliconflow.d.ts +21 -0
- package/dist/capabilities/embedding/siliconflow.js +10 -0
- package/dist/capabilities/embedding/volcengine.d.ts +10 -0
- package/dist/capabilities/embedding/volcengine.js +6 -0
- package/dist/capabilities/rerank/bailian.d.ts +21 -0
- package/dist/capabilities/rerank/bailian.js +14 -0
- package/dist/capabilities/rerank/bigmodel.d.ts +9 -0
- package/dist/capabilities/rerank/bigmodel.js +5 -0
- package/dist/capabilities/rerank/index.d.ts +1 -0
- package/dist/capabilities/rerank/index.js +1 -0
- package/dist/capabilities/rerank/ppio.d.ts +7 -0
- package/dist/capabilities/rerank/ppio.js +5 -0
- package/dist/capabilities/rerank/siliconflow.d.ts +21 -0
- package/dist/capabilities/rerank/siliconflow.js +10 -0
- package/dist/capabilities/retrieval/http.d.ts +3 -0
- package/dist/capabilities/retrieval/http.js +48 -0
- package/dist/capabilities/retrieval/module.d.ts +11 -0
- package/dist/capabilities/retrieval/module.js +110 -0
- package/dist/capabilities/retrieval/types.d.ts +54 -0
- package/dist/capabilities/retrieval/types.js +1 -0
- package/dist/capabilities/retrieval/validation.d.ts +10 -0
- package/dist/capabilities/retrieval/validation.js +65 -0
- package/dist/capabilities/types.d.ts +1 -1
- package/dist/catalog/apimart/gpt-image-2.5.model.d.ts +2 -0
- package/dist/catalog/apimart/gpt-image-2.5.model.js +51 -0
- package/dist/catalog/fal/gpt-image-2.5.model.d.ts +2 -0
- package/dist/catalog/fal/gpt-image-2.5.model.js +53 -0
- package/dist/catalog/fal/ic-light-v2.model.js +9 -13
- package/dist/catalog/grsai/gpt-image-2.5.model.d.ts +2 -0
- package/dist/catalog/grsai/gpt-image-2.5.model.js +54 -0
- package/dist/catalog/grsai/gptImage25Sizes.d.ts +1 -0
- package/dist/catalog/grsai/gptImage25Sizes.js +76 -0
- package/dist/catalog/index.js +112 -104
- package/dist/catalog/kie/gpt-image-2.5.model.d.ts +2 -0
- package/dist/catalog/kie/gpt-image-2.5.model.js +38 -0
- package/dist/catalog/shared/gptImage25.d.ts +16 -0
- package/dist/catalog/shared/gptImage25.js +48 -0
- package/dist/catalog/shared/gptImage25Pricing.d.ts +12 -0
- package/dist/catalog/shared/gptImage25Pricing.js +508 -0
- package/dist/llm/defaults.d.ts +1 -1
- package/dist/llm/defaults.js +1 -1
- package/dist/llm/discovery.d.ts +2 -0
- package/dist/llm/discovery.js +16 -5
- package/dist/llm/modelCatalogEntries.js +32 -0
- package/dist/llm/providerPresets.d.ts +3 -1
- package/dist/llm/providerPresets.js +6 -3
- package/dist/llm/providerReasoningRequest.js +14 -1
- package/dist/llm/siliconflow/index.d.ts +21 -0
- package/dist/llm/siliconflow/index.js +32 -0
- package/dist/llm/siliconflow/preset.d.ts +6 -0
- package/dist/llm/siliconflow/preset.js +33 -0
- package/dist/packs/models/apimart/gpt-image-2.5.d.ts +6 -0
- package/dist/packs/models/apimart/gpt-image-2.5.js +7 -0
- package/dist/packs/models/fal/gpt-image-2.5.d.ts +6 -0
- package/dist/packs/models/fal/gpt-image-2.5.js +7 -0
- package/dist/packs/models/grsai/gpt-image-2.5.d.ts +6 -0
- package/dist/packs/models/grsai/gpt-image-2.5.js +7 -0
- package/dist/packs/models/kie/gpt-image-2.5.d.ts +6 -0
- package/dist/packs/models/kie/gpt-image-2.5.js +7 -0
- package/dist/packs/provider-packs/apimart.d.ts +1 -1
- package/dist/packs/provider-packs/apimart.js +21 -20
- package/dist/packs/provider-packs/fal.d.ts +1 -1
- package/dist/packs/provider-packs/fal.js +37 -36
- package/dist/packs/provider-packs/grsai.d.ts +1 -1
- package/dist/packs/provider-packs/grsai.js +6 -5
- package/dist/packs/provider-packs/kie.d.ts +1 -1
- package/dist/packs/provider-packs/kie.js +28 -27
- package/dist/packs/tool-models/fal/{qwen-image-edit-2509-multiple-angles.d.ts → qwen-image-edit-2511-multiple-angles.d.ts} +1 -1
- package/dist/packs/tool-models/fal/{qwen-image-edit-2509-multiple-angles.js → qwen-image-edit-2511-multiple-angles.js} +1 -1
- package/dist/packs/tool-packs/fal-multi-angle-tools.js +1 -1
- package/dist/tool-packs/fal-multi-angle/models/qwen-image-edit-2511-multiple-angles.model.d.ts +2 -0
- package/dist/tool-packs/fal-multi-angle/models/{qwen-image-edit-2509-multiple-angles.model.js → qwen-image-edit-2511-multiple-angles.model.js} +20 -17
- package/docs/README.md +26 -26
- package/docs/consumers.md +56 -48
- package/docs/llm-adaptation/README.md +139 -137
- package/docs/llm-adaptation//344/276/233/345/272/224/345/225/206/DeepSeek.md +103 -91
- package/docs/llm-adaptation//344/276/233/345/272/224/345/225/206/Kimi.md +75 -75
- package/docs/llm-adaptation//344/276/233/345/272/224/345/225/206/MiniMax.md +84 -84
- package/docs/llm-adaptation//344/276/233/345/272/224/345/225/206//345/260/217/347/261/263MiMo.md +85 -85
- package/docs/llm-adaptation//344/276/233/345/272/224/345/225/206//346/231/272/350/260/261GLM.md +232 -232
- package/docs/llm-adaptation//344/276/233/345/272/224/345/225/206//347/201/253/345/261/261/345/274/225/346/223/216.md +87 -87
- package/docs/llm-adaptation//344/276/233/345/272/224/345/225/206//347/231/276/347/202/274Qwen.md +84 -84
- package/docs/llm-adaptation//346/226/207/346/241/243/351/207/207/351/233/206/346/211/213/345/206/214.md +88 -88
- package/docs/model-adaptation/Bria-Eraser/Bria-Eraser_Fal.md +32 -32
- package/docs/model-adaptation/Bria-/345/210/233/346/204/217/346/224/276/345/244/247/Bria-/345/210/233/346/204/217/346/224/276/345/244/247_Fal.md +31 -31
- package/docs/model-adaptation/ControlLight/ControlLight_Fal.md +85 -85
- package/docs/model-adaptation/FLUX-2-/345/244/232/350/247/222/345/272/246/FLUX-2-/345/244/232/350/247/222/345/272/246_Fal.md +107 -107
- package/docs/model-adaptation/Finegrain-Eraser/Finegrain-Eraser_Fal.md +31 -31
- package/docs/model-adaptation/Flux-Pro-Erase/Flux-Pro-Erase_Fal.md +34 -34
- package/docs/model-adaptation/Fun-ASR/Fun-ASR_/347/231/276/347/202/274.md +43 -43
- package/docs/model-adaptation/Fun-ASR-Flash-2026-06-15/Fun-ASR-Flash-2026-06-15_/347/231/276/347/202/274.md +41 -41
- package/docs/model-adaptation/Fun-ASR-Realtime/Fun-ASR-Realtime_/347/231/276/347/202/274.md +37 -37
- package/docs/model-adaptation/Fun-ASR-Realtime-2026-02-28/Fun-ASR-Realtime-2026-02-28_/347/231/276/347/202/274.md +39 -39
- package/docs/model-adaptation/GLM-5.3-Flash/GLM-5.3-Flash_/346/231/272/350/260/261.md +207 -207
- package/docs/model-adaptation/GPT-Image-2/GPT-Image-2_APIMart.md +173 -173
- package/docs/model-adaptation/GPT-Image-2/GPT-Image-2_Fal.md +94 -94
- package/docs/model-adaptation/GPT-Image-2/GPT-Image-2_Grsai.md +137 -137
- package/docs/model-adaptation/GPT-Image-2/GPT-Image-2_KIE.md +93 -93
- package/docs/model-adaptation/GPT-Image-2.5/GPT-Image-2.5_APIMart.md +66 -0
- package/docs/model-adaptation/GPT-Image-2.5/GPT-Image-2.5_Fal.md +55 -0
- package/docs/model-adaptation/GPT-Image-2.5/GPT-Image-2.5_Grsai.md +53 -0
- package/docs/model-adaptation/GPT-Image-2.5/GPT-Image-2.5_KIE.md +55 -0
- package/docs/model-adaptation/GPT-OSS-20B/GPT-OSS-20B_Groq.md +62 -62
- package/docs/model-adaptation/Gemini-Omni-Flash/Gemini-Omni-Flash_APIMart.md +124 -124
- package/docs/model-adaptation/Gemini-Omni-Flash/Gemini-Omni-Flash_Fal.md +84 -84
- package/docs/model-adaptation/Gemini-Omni-Flash/Gemini-Omni-Flash_KIE.md +129 -129
- package/docs/model-adaptation/Grok-Imagine/Grok-Imagine_KIE.md +36 -36
- package/docs/model-adaptation/Grok-Imagine-2.0/Grok-Imagine-2.0_APIMart.md +250 -250
- package/docs/model-adaptation/Grok-Imagine-2.0/Grok-Imagine-2.0_Fal.md +84 -84
- package/docs/model-adaptation/Grok-Imagine-2.0/Grok-Imagine-2.0_KIE.md +105 -105
- package/docs/model-adaptation/Hailuo-02/Hailuo-02_Fal.md +93 -93
- package/docs/model-adaptation/Hailuo-02/Hailuo-02_KIE.md +56 -56
- package/docs/model-adaptation/Hailuo-2.3/Hailuo-2.3_Fal.md +88 -88
- package/docs/model-adaptation/Hailuo-2.3/Hailuo-2.3_KIE.md +51 -51
- package/docs/model-adaptation/Hailuo-2.3/Hailuo-2.3_/346/264/276/346/254/247/344/272/221.md +70 -70
- package/docs/model-adaptation/IC-Light-v2/IC-Light-v2_Fal.md +97 -94
- package/docs/model-adaptation/Ideogram-/345/233/276/347/211/207/346/224/276/345/244/247/Ideogram-/345/233/276/347/211/207/346/224/276/345/244/247_Fal.md +41 -41
- package/docs/model-adaptation/Image-Apps-v2-/345/225/206/345/223/201/346/221/204/345/275/261/Image-Apps-v2-/345/225/206/345/223/201/346/221/204/345/275/261_Fal.md +72 -72
- package/docs/model-adaptation/Image-Apps-v2-/346/211/251/345/233/276/Image-Apps-v2-/346/211/251/345/233/276_Fal.md +93 -93
- package/docs/model-adaptation/Image-Apps-v2-/347/205/247/347/211/207/344/277/256/345/244/215/Image-Apps-v2-/347/205/247/347/211/207/344/277/256/345/244/215_Fal.md +86 -86
- package/docs/model-adaptation/Image-Apps-v2-/351/207/215/346/211/223/345/205/211/Image-Apps-v2-/351/207/215/346/211/223/345/205/211_Fal.md +84 -84
- package/docs/model-adaptation/Kling-3.0/Kling-3.0_APIMart.md +112 -112
- package/docs/model-adaptation/Kling-3.0/Kling-3.0_Fal.md +89 -89
- package/docs/model-adaptation/Kling-3.0/Kling-3.0_KIE.md +106 -106
- package/docs/model-adaptation/Kling-3.0/Kling-3.0_/346/264/276/346/254/247/344/272/221.md +119 -119
- package/docs/model-adaptation/Kling-3.0-Omni/Kling-3.0-Omni_APIMart.md +125 -125
- package/docs/model-adaptation/Kling-3.0-Omni/Kling-3.0-Omni_Fal.md +107 -107
- package/docs/model-adaptation/Kling-3.0-Omni/Kling-3.0-Omni_KIE.md +143 -143
- package/docs/model-adaptation/Kling-3.0-Turbo/Kling-3.0-Turbo_APIMart.md +85 -85
- package/docs/model-adaptation/Kling-3.0-Turbo/Kling-3.0-Turbo_Fal.md +83 -83
- package/docs/model-adaptation/Kling-3.0-Turbo/Kling-3.0-Turbo_KIE.md +84 -84
- package/docs/model-adaptation/Midjourney/Midjourney_APIMart.md +396 -396
- package/docs/model-adaptation/MiniMax-H3/MiniMax-H3_APIMart.md +234 -234
- package/docs/model-adaptation/MiniMax-H3/MiniMax-H3_Fal.md +108 -108
- package/docs/model-adaptation/MiniMax-H3/MiniMax-H3_KIE.md +111 -111
- package/docs/model-adaptation/MiniMax-Speech/MiniMax-Speech_/346/264/276/346/254/247/344/272/221.md +170 -170
- package/docs/model-adaptation/Nano-Banana-2/Nano-Banana-2_APIMart.md +89 -89
- package/docs/model-adaptation/Nano-Banana-2/Nano-Banana-2_Fal.md +99 -99
- package/docs/model-adaptation/Nano-Banana-2/Nano-Banana-2_Grsai.md +82 -82
- package/docs/model-adaptation/Nano-Banana-2/Nano-Banana-2_KIE.md +70 -70
- package/docs/model-adaptation/Nano-Banana-2-Lite/Nano-Banana-2-Lite_APIMart.md +79 -79
- package/docs/model-adaptation/Nano-Banana-2-Lite/Nano-Banana-2-Lite_Grsai.md +65 -65
- package/docs/model-adaptation/Nano-Banana-2-Lite/Nano-Banana-2-Lite_KIE.md +64 -64
- package/docs/model-adaptation/Nano-Banana-Pro/Nano-Banana-Pro_APIMart.md +83 -83
- package/docs/model-adaptation/Nano-Banana-Pro/Nano-Banana-Pro_Fal.md +89 -89
- package/docs/model-adaptation/Nano-Banana-Pro/Nano-Banana-Pro_Grsai.md +82 -82
- package/docs/model-adaptation/Nano-Banana-Pro/Nano-Banana-Pro_KIE.md +64 -64
- package/docs/model-adaptation/Pixelcut-/350/203/214/346/231/257/347/247/273/351/231/244/Pixelcut-/350/203/214/346/231/257/347/247/273/351/231/244_Fal.md +79 -79
- package/docs/model-adaptation/Qwen-Image-3.0/Qwen-Image-3.0_APIMart.md +117 -117
- package/docs/model-adaptation/Qwen-Image-3.0/Qwen-Image-3.0_Fal.md +84 -84
- package/docs/model-adaptation/Qwen-Image-3.0/Qwen-Image-3.0_KIE.md +103 -103
- package/docs/model-adaptation/Qwen-Image-3.0/Qwen-Image-3.0_/347/231/276/347/202/274.md +138 -138
- package/docs/model-adaptation/Qwen-Image-Edit-2511-/345/244/232/350/247/222/345/272/246/Qwen-Image-Edit-2511-/345/244/232/350/247/222/345/272/246_Fal.md +57 -0
- package/docs/model-adaptation/Qwen-MT-Flash/Qwen-MT-Flash_/347/231/276/347/202/274.md +47 -47
- package/docs/model-adaptation/Qwen-MT-Lite/Qwen-MT-Lite_/347/231/276/347/202/274.md +39 -39
- package/docs/model-adaptation/Qwen-MT-Plus/Qwen-MT-Plus_/347/231/276/347/202/274.md +39 -39
- package/docs/model-adaptation/Qwen3-ASR-Flash/Qwen3-ASR-Flash_/347/231/276/347/202/274.md +40 -40
- package/docs/model-adaptation/Qwen3-ASR-Flash-2026-02-10/Qwen3-ASR-Flash-2026-02-10_/347/231/276/347/202/274.md +33 -33
- package/docs/model-adaptation/Qwen3-ASR-Flash-Filetrans/Qwen3-ASR-Flash-Filetrans_/347/231/276/347/202/274.md +41 -41
- package/docs/model-adaptation/Qwen3-ASR-Flash-Realtime/Qwen3-ASR-Flash-Realtime_/347/231/276/347/202/274.md +35 -35
- package/docs/model-adaptation/Qwen3-ASR-Flash-Realtime-2026-02-10/Qwen3-ASR-Flash-Realtime-2026-02-10_/347/231/276/347/202/274.md +37 -37
- package/docs/model-adaptation/README.md +313 -295
- package/docs/model-adaptation/SeedASR-2.0-File/SeedASR-2.0-File_/347/201/253/345/261/261/345/274/225/346/223/216.md +115 -115
- package/docs/model-adaptation/SeedASR-2.0-Realtime/SeedASR-2.0-Realtime_/347/201/253/345/261/261/345/274/225/346/223/216.md +143 -143
- package/docs/model-adaptation/SeedVR2-/345/233/276/347/211/207/346/224/276/345/244/247/SeedVR2-/345/233/276/347/211/207/346/224/276/345/244/247_Fal.md +45 -45
- package/docs/model-adaptation/Seedance-2.0/Seedance-2.0_APIMart.md +121 -121
- package/docs/model-adaptation/Seedance-2.0/Seedance-2.0_Fal.md +97 -97
- package/docs/model-adaptation/Seedance-2.0/Seedance-2.0_KIE.md +86 -86
- package/docs/model-adaptation/Seedance-2.0-Fast/Seedance-2.0-Fast_APIMart.md +89 -89
- package/docs/model-adaptation/Seedance-2.0-Fast/Seedance-2.0-Fast_Fal.md +95 -95
- package/docs/model-adaptation/Seedance-2.0-Fast/Seedance-2.0-Fast_KIE.md +78 -78
- package/docs/model-adaptation/Seedance-2.0-Mini/Seedance-2.0-Mini_APIMart.md +89 -89
- package/docs/model-adaptation/Seedance-2.0-Mini/Seedance-2.0-Mini_Fal.md +96 -96
- package/docs/model-adaptation/Seedance-2.0-Mini/Seedance-2.0-Mini_KIE.md +78 -78
- package/docs/model-adaptation/Seedance-2.5/Seedance-2.5_APIMart.md +212 -212
- package/docs/model-adaptation/Seedance-2.5/Seedance-2.5_Fal.md +94 -94
- package/docs/model-adaptation/Seedance-2.5/Seedance-2.5_KIE.md +89 -89
- package/docs/model-adaptation/Seedream-5.0-Lite/Seedream-5.0-Lite_APIMart.md +106 -106
- package/docs/model-adaptation/Seedream-5.0-Lite/Seedream-5.0-Lite_Fal.md +91 -91
- package/docs/model-adaptation/Seedream-5.0-Lite/Seedream-5.0-Lite_KIE.md +89 -89
- package/docs/model-adaptation/Seedream-5.0-Lite/Seedream-5.0-Lite_/347/201/253/345/261/261/345/274/225/346/223/216.md +108 -108
- package/docs/model-adaptation/Seedream-5.0-Pro/Seedream-5.0-Pro_APIMart.md +194 -194
- package/docs/model-adaptation/Seedream-5.0-Pro/Seedream-5.0-Pro_Fal.md +100 -100
- package/docs/model-adaptation/Seedream-5.0-Pro/Seedream-5.0-Pro_KIE.md +141 -141
- package/docs/model-adaptation/Seedream-5.0-Pro/Seedream-5.0-Pro_/347/201/253/345/261/261/345/274/225/346/223/216.md +137 -137
- package/docs/model-adaptation/SenseVoiceSmall/SenseVoiceSmall_/347/241/205/345/237/272/346/265/201/345/212/250.md +69 -69
- package/docs/model-adaptation/TeleSpeechASR/TeleSpeechASR_/347/241/205/345/237/272/346/265/201/345/212/250.md +72 -72
- package/docs/model-adaptation/Topaz-/345/233/276/347/211/207/346/224/276/345/244/247/Topaz-/345/233/276/347/211/207/346/224/276/345/244/247_Fal.md +87 -87
- package/docs/model-adaptation/Topaz-/351/200/217/346/230/216/345/233/276/346/224/276/345/244/247/Topaz-/351/200/217/346/230/216/345/233/276/346/224/276/345/244/247_Fal.md +34 -34
- package/docs/model-adaptation/Wan-2.5-Preview/Wan-2.5-Preview_/346/264/276/346/254/247/344/272/221.md +82 -82
- package/docs/model-adaptation/Wan-2.6/Wan-2.6_/346/264/276/346/254/247/344/272/221.md +84 -84
- package/docs/model-adaptation/Wan-2.7/Wan-2.7_/346/264/276/346/254/247/344/272/221.md +122 -122
- package/docs/model-adaptation/Whisper-Large-v3/Whisper-Large-v3_Groq.md +76 -76
- package/docs/model-adaptation/Whisper-Large-v3-Turbo/Whisper-Large-v3-Turbo_Groq.md +75 -75
- package/docs/model-adaptation/Z-Image-Turbo/Z-Image-Turbo_APIMart.md +88 -88
- package/docs/model-adaptation/Z-Image-Turbo/Z-Image-Turbo_Fal.md +95 -95
- package/docs/model-adaptation/Z-Image-Turbo/Z-Image-Turbo_KIE.md +71 -71
- package/docs/model-adaptation/Z-Image-Turbo/Z-Image-Turbo_/347/231/276/347/202/274.md +122 -122
- package/docs/model-adaptation/Z-Image-Turbo/Z-Image-Turbo_/351/255/224/346/220/255.md +97 -97
- package/docs/model-adaptation//344/276/233/345/272/224/345/225/206/APIMart.md +238 -238
- package/docs/model-adaptation//344/276/233/345/272/224/345/225/206/Fal.md +172 -172
- package/docs/model-adaptation//344/276/233/345/272/224/345/225/206/Groq.md +121 -121
- package/docs/model-adaptation//344/276/233/345/272/224/345/225/206/Grsai.md +217 -217
- package/docs/model-adaptation//344/276/233/345/272/224/345/225/206/KIE.md +131 -131
- package/docs/model-adaptation//344/276/233/345/272/224/345/225/206//345/200/231/351/200/211/344/276/233/345/272/224/345/225/206/350/260/203/347/240/224-/345/233/276/347/211/207/345/267/245/345/205/267.md +151 -151
- package/docs/model-adaptation//344/276/233/345/272/224/345/225/206//345/277/253/351/200/237/351/200/202/351/205/215/344/276/233/345/272/224/345/225/206.md +65 -65
- package/docs/model-adaptation//344/276/233/345/272/224/345/225/206//346/264/276/346/254/247/344/272/221.md +147 -138
- package/docs/model-adaptation//344/276/233/345/272/224/345/225/206//347/201/253/345/261/261/345/274/225/346/223/216.md +181 -171
- package/docs/model-adaptation//344/276/233/345/272/224/345/225/206//347/231/276/347/202/274.md +237 -227
- package/docs/model-adaptation//344/276/233/345/272/224/345/225/206//347/241/205/345/237/272/346/265/201/345/212/250.md +140 -75
- package/docs/model-adaptation//344/276/233/345/272/224/345/225/206//351/255/224/346/220/255.md +207 -207
- package/docs/model-adaptation//346/226/207/346/241/243/351/207/207/351/233/206/346/211/213/345/206/214.md +338 -311
- package/docs/model-adaptation//351/200/217/350/247/206/345/217/230/346/215/242//351/200/217/350/247/206/345/217/230/346/215/242_Fal.md +59 -59
- package/docs//346/216/245/345/205/245/346/214/207/345/215/227/Electron.md +77 -77
- package/docs//346/216/245/345/205/245/346/214/207/345/215/227/Tauri.md +81 -81
- package/docs//346/216/245/345/205/245/346/214/207/345/215/227/UXP.md +169 -169
- package/docs//346/216/245/345/205/245/346/214/207/345/215/227//344/276/233/345/272/224/345/225/206/345/237/237/345/220/215.md +83 -83
- package/docs//346/216/245/345/205/245/346/214/207/345/215/227//351/224/231/350/257/257/345/244/204/347/220/206.md +72 -72
- package/examples/form-renderer/README.md +17 -17
- package/examples/form-renderer/cli.ts +32 -32
- package/examples/form-renderer/index.ts +144 -144
- package/examples/form-renderer/package.json +16 -16
- package/examples/form-renderer/tsconfig.json +14 -14
- package/examples/llm-chat/README.md +32 -32
- package/examples/llm-chat/index.ts +100 -100
- package/examples/llm-chat/package.json +19 -19
- package/examples/llm-chat/tsconfig.json +14 -14
- package/examples/minimal-node/README.md +31 -31
- package/examples/minimal-node/index.ts +138 -138
- package/examples/minimal-node/package.json +17 -17
- package/examples/minimal-node/tsconfig.json +14 -14
- package/package.json +255 -195
- package/dist/tool-packs/fal-multi-angle/models/qwen-image-edit-2509-multiple-angles.model.d.ts +0 -2
- package/docs/model-adaptation/Qwen-Image-Edit-2509-/345/244/232/350/247/222/345/272/246/Qwen-Image-Edit-2509-/345/244/232/350/247/222/345/272/246_Fal.md +0 -116
|
@@ -1,169 +1,169 @@
|
|
|
1
|
-
# Photoshop UXP 接入
|
|
2
|
-
|
|
3
|
-
## 证据边界
|
|
4
|
-
|
|
5
|
-
SDK 上游已完成 generation-only 与窄 LLM streaming IIFE/VM 门禁;Photoshop UXP 真机网络与图层编码
|
|
6
|
-
仍由插件集成验证。
|
|
7
|
-
|
|
8
|
-
- UXP 有 `fetch` / `AbortController` / Streams,但未找到官方证据证明长时间 `text/event-stream`
|
|
9
|
-
在 Photoshop UXP 中稳定;SDK 已完成 scripted SSE 与取消门禁,真实长流稳定性仍是插件真机项。
|
|
10
|
-
- `requiredPermissions.network.domains` 支持 `https://*.example.com` 子域通配和 `"all"`。
|
|
11
|
-
`requiredPermissions.webview.domains` 是另一套权限,不支持同样的通配,不要混用。
|
|
12
|
-
- `allowCodeGenerationFromStrings` 默认 `false`;UXP 又没有 Node/`node:vm`。SDK 因此只直接调用
|
|
13
|
-
ESM 函数,不用 `eval`/`new Function`。不需要为 SDK 开启这项高风险权限。
|
|
14
|
-
- UXP 没有运行时 Node 模块解析;`@henjicc/ai-sdk` 必须在构建期 bundle。只做少量生成模型时使用
|
|
15
|
-
`@henjicc/ai-sdk/generation/core` + 完整模型 pack;需要全部 99 模型时才使用兼容的
|
|
16
|
-
`@henjicc/ai-sdk/generation`。不要导入带 LLM 的包根。
|
|
17
|
-
- UXP 只做原生流式聊天时导入 `@henjicc/ai-sdk/llm/streaming`,不要导入 `llm` 总入口;后者为了
|
|
18
|
-
向后兼容还包含 modelStep、Zod 与 Vercel AI SDK。
|
|
19
|
-
|
|
20
|
-
generation-only 入口公开 `createGenerationClient`,提供 `generate`、`continuePolling`、`cancel`、
|
|
21
|
-
`catalog`、`providers` 与 `dispose`。发布门禁确认其 IIFE 不含 LLM/Vercel AI SDK、Node、动态代码生成、
|
|
22
|
-
global fetch、Streams、File、`btoa`/`atob`,import/create/catalog/dispose 网络调用为 0,目录为 99 个模型;
|
|
23
|
-
宿主不需要 alias 或 shim。
|
|
24
|
-
|
|
25
|
-
窄 LLM streaming 入口只导出原生 OpenAI-compatible SSE 执行、取消、DTO、运行时类型与稳定错误协议。
|
|
26
|
-
关闭 tree-shaking 的 IIFE/ESM 静态图门禁确认 Zod、modelStep、Vercel `ai`、`@ai-sdk/*`、Node builtin、
|
|
27
|
-
`Buffer`、`process`、global fetch、`eval`/`new Function`、`TransformStream`、`WritableStream` 均为 0。
|
|
28
|
-
`ReadableStream` 仍由宿主响应提供;Photoshop 27.5 / UXP 9.2 真机确认没有全局 `TextEncoder` 与
|
|
29
|
-
`TextDecoder`,`0.1.8` 起 SSE 使用 SDK 内部增量 UTF-8 解码器,不要求插件注入 DOM 或 Node polyfill。
|
|
30
|
-
|
|
31
|
-
## manifest v5 网络权限
|
|
32
|
-
|
|
33
|
-
```json
|
|
34
|
-
{
|
|
35
|
-
"manifestVersion": 5,
|
|
36
|
-
"requiredPermissions": {
|
|
37
|
-
"network": {
|
|
38
|
-
"domains": [
|
|
39
|
-
"https://api.kie.ai",
|
|
40
|
-
"https://kieai.redpandaai.co",
|
|
41
|
-
"https://fal.run",
|
|
42
|
-
"https://*.fal.run",
|
|
43
|
-
"https://rest.fal.ai"
|
|
44
|
-
]
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
这里只是短示例;复制 [供应商域名.md](供应商域名.md) 中你实际启用的全部请求域名。
|
|
51
|
-
模型结果可能来自供应商 CDN 或用户自定义 LLM Base URL,它们不可能被静态 SDK 目录穷举;
|
|
52
|
-
宿主需要在保持最小权限的前提下单独加入。
|
|
53
|
-
|
|
54
|
-
## RuntimeContext
|
|
55
|
-
|
|
56
|
-
```ts
|
|
57
|
-
import { createModularGenerationClient } from '@henjicc/ai-sdk/generation/core'
|
|
58
|
-
import { pack as kieZImage } from '@henjicc/ai-sdk/models/kie/z-image'
|
|
59
|
-
import type { Logger, RuntimeContext } from '@henjicc/ai-sdk/runtime'
|
|
60
|
-
|
|
61
|
-
const { secureStorage } = require('uxp').storage
|
|
62
|
-
|
|
63
|
-
type ExportEncodedLayer = (ref: string) => Promise<{
|
|
64
|
-
bytes: Uint8Array
|
|
65
|
-
mimeType: 'image/png' | 'image/jpeg'
|
|
66
|
-
filename: string
|
|
67
|
-
}>
|
|
68
|
-
|
|
69
|
-
export function createUxpRuntime(
|
|
70
|
-
exportEncodedLayer: ExportEncodedLayer,
|
|
71
|
-
logger?: Logger,
|
|
72
|
-
): RuntimeContext {
|
|
73
|
-
return {
|
|
74
|
-
transport: { fetch: (url, init) => fetch(url, init) },
|
|
75
|
-
credentials: {
|
|
76
|
-
async get(scope, providerId) {
|
|
77
|
-
const stored = await secureStorage.getItem(`${scope}:${providerId}`)
|
|
78
|
-
return stored ? decodeAsciiCredential(stored) : undefined
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
media: { read: exportEncodedLayer },
|
|
82
|
-
logger,
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
// API key 按 ASCII 保存;避免 UXP 不存在 TextDecoder 时凭据读取失败。
|
|
87
|
-
function decodeAsciiCredential(bytes: Uint8Array): string {
|
|
88
|
-
let value = ''
|
|
89
|
-
for (const byte of bytes) value += String.fromCharCode(byte)
|
|
90
|
-
return value
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export function createUxpGenerationClient(exportEncodedLayer: ExportEncodedLayer) {
|
|
94
|
-
return createModularGenerationClient({
|
|
95
|
-
runtime: createUxpRuntime(exportEncodedLayer),
|
|
96
|
-
packs: [kieZImage],
|
|
97
|
-
})
|
|
98
|
-
}
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
LLM 使用同一个 `RuntimeContext`,密钥 scope 为 `llm`:
|
|
102
|
-
|
|
103
|
-
```ts
|
|
104
|
-
import {
|
|
105
|
-
cancelLlmChatTask,
|
|
106
|
-
runLlmChatStream,
|
|
107
|
-
type LlmChatRequestDto,
|
|
108
|
-
} from '@henjicc/ai-sdk/llm/streaming'
|
|
109
|
-
|
|
110
|
-
const request: LlmChatRequestDto = {
|
|
111
|
-
requestId: 'uxp-chat-1',
|
|
112
|
-
providerId: 'openai',
|
|
113
|
-
modelId: 'gpt-5-mini',
|
|
114
|
-
messages: [{ role: 'user', content: '描述当前图片' }],
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
const outcome = await runLlmChatStream(request, request.requestId!, (event) => {
|
|
118
|
-
if (event.type === 'Token') appendText(event.data)
|
|
119
|
-
if (event.type === 'ReasoningToken') appendReasoning(event.data)
|
|
120
|
-
}, runtime)
|
|
121
|
-
console.log(outcome.usage, outcome.finishReason)
|
|
122
|
-
|
|
123
|
-
// 用户点击取消时使用同一个 taskId:
|
|
124
|
-
cancelLlmChatTask(request.requestId!)
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
输入图片/视频/音频时仍通过 `LlmContentPart` 结构与 `RuntimeContext.media` 处理宿主管理引用;不要在插件
|
|
128
|
-
里复制 SSE parser、错误分类或取消登记表。`Transport.fetch` 必须保留 `Response.body` 的原生字节流并尊重
|
|
129
|
-
`init.signal`,不能先把整段响应转为字符串,否则会失去 token 流与及时取消。
|
|
130
|
-
|
|
131
|
-
`kieZImage` 是完整执行 pack,不只是目录定义;它已包含 KIE adapter 与 KIE 范围内的媒体上传策略。
|
|
132
|
-
选择别的模型时替换或追加对应 `models/<provider>/<model>` pack。不要只拿同路径的低层 `model`
|
|
133
|
-
导出再由插件手拼上传逻辑。需要某供应商全部模型时改用 `provider-packs/<provider>`。
|
|
134
|
-
|
|
135
|
-
Photoshop 的消除面板应只导入可选模型分发集合,不把工具塞进普通生成目录:
|
|
136
|
-
|
|
137
|
-
```ts
|
|
138
|
-
import { createModularGenerationClient } from '@henjicc/ai-sdk/generation/core'
|
|
139
|
-
import { pack as falImageEditTools } from '@henjicc/ai-sdk/tool-packs/fal-image-edit-tools'
|
|
140
|
-
|
|
141
|
-
const erase = createModularGenerationClient({ runtime, packs: [falImageEditTools] })
|
|
142
|
-
const created = await erase.generate({
|
|
143
|
-
modelId: 'fal-finegrain-eraser',
|
|
144
|
-
params: {
|
|
145
|
-
image: ['uxp://active-layer'],
|
|
146
|
-
mask: ['uxp://erase-mask'],
|
|
147
|
-
mode: 'standard',
|
|
148
|
-
},
|
|
149
|
-
})
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
该入口只携带 3 个 Fal 消除模型、Fal adapter 和 Fal CDN 上传;默认 105 目录、其他供应商与 LLM
|
|
153
|
-
不会进入静态依赖图。单模型可改用 `tool-models/fal/<model>` 导出的 `pack`。运行时能力筛选只过滤
|
|
154
|
-
已导入候选;要缩小 UXP bundle,必须从 import 边界选择 pack,不能先导入集合再靠筛选期待 tree-shake。
|
|
155
|
-
|
|
156
|
-
`ref` 应是你插件自己管理的 `uxp://...` / `managed://...` 文档或图层引用,不是让用户手填 URL。
|
|
157
|
-
这些引用会原样交给 `MediaReader.read()`。`photoshop.imaging.getPixels()`
|
|
158
|
-
可得到 `PhotoshopImageData`,再从 `imageData.getData()` 取像素字节;这是**原始像素**,
|
|
159
|
-
必须经插件的图像编码/临时文件导出流程得到真正 PNG/JPEG 字节,再从 `MediaReader.read()`
|
|
160
|
-
返回;不得把 RGBA 像素误报成 `image/png`。记录中 Grayscale/LAB 的通道处理与 CMYK
|
|
161
|
-
`getData()` 有历史问题,正式开放前要在真实 Photoshop 复测或明确禁用这些色彩模式。
|
|
162
|
-
|
|
163
|
-
## SecureStorage 与媒体编码
|
|
164
|
-
|
|
165
|
-
- SecureStorage 的 value 加密,key 名不加密;Adobe 将它定位为“更像缓存”,数据可丢失。
|
|
166
|
-
凭据丢失时 `get()` 返回 `undefined`,UI 必须让用户重新填写;不得把它当作唯一且永久的账户真相源。
|
|
167
|
-
- SDK 的媒体 base64 编解码只依赖 `Uint8Array`,不要求 UXP 提供 `btoa` / `atob` polyfill。
|
|
168
|
-
- Fal 本地媒体上传使用 `RuntimeContext.transport` 执行 REST initiate + signed PUT,不构造 `File`;
|
|
169
|
-
取消信号与 120 秒上传 deadline 会传到两段请求。真实 UXP 网络权限、取消和图片放置仍需真机验证。
|
|
1
|
+
# Photoshop UXP 接入
|
|
2
|
+
|
|
3
|
+
## 证据边界
|
|
4
|
+
|
|
5
|
+
SDK 上游已完成 generation-only 与窄 LLM streaming IIFE/VM 门禁;Photoshop UXP 真机网络与图层编码
|
|
6
|
+
仍由插件集成验证。
|
|
7
|
+
|
|
8
|
+
- UXP 有 `fetch` / `AbortController` / Streams,但未找到官方证据证明长时间 `text/event-stream`
|
|
9
|
+
在 Photoshop UXP 中稳定;SDK 已完成 scripted SSE 与取消门禁,真实长流稳定性仍是插件真机项。
|
|
10
|
+
- `requiredPermissions.network.domains` 支持 `https://*.example.com` 子域通配和 `"all"`。
|
|
11
|
+
`requiredPermissions.webview.domains` 是另一套权限,不支持同样的通配,不要混用。
|
|
12
|
+
- `allowCodeGenerationFromStrings` 默认 `false`;UXP 又没有 Node/`node:vm`。SDK 因此只直接调用
|
|
13
|
+
ESM 函数,不用 `eval`/`new Function`。不需要为 SDK 开启这项高风险权限。
|
|
14
|
+
- UXP 没有运行时 Node 模块解析;`@henjicc/ai-sdk` 必须在构建期 bundle。只做少量生成模型时使用
|
|
15
|
+
`@henjicc/ai-sdk/generation/core` + 完整模型 pack;需要全部 99 模型时才使用兼容的
|
|
16
|
+
`@henjicc/ai-sdk/generation`。不要导入带 LLM 的包根。
|
|
17
|
+
- UXP 只做原生流式聊天时导入 `@henjicc/ai-sdk/llm/streaming`,不要导入 `llm` 总入口;后者为了
|
|
18
|
+
向后兼容还包含 modelStep、Zod 与 Vercel AI SDK。
|
|
19
|
+
|
|
20
|
+
generation-only 入口公开 `createGenerationClient`,提供 `generate`、`continuePolling`、`cancel`、
|
|
21
|
+
`catalog`、`providers` 与 `dispose`。发布门禁确认其 IIFE 不含 LLM/Vercel AI SDK、Node、动态代码生成、
|
|
22
|
+
global fetch、Streams、File、`btoa`/`atob`,import/create/catalog/dispose 网络调用为 0,目录为 99 个模型;
|
|
23
|
+
宿主不需要 alias 或 shim。
|
|
24
|
+
|
|
25
|
+
窄 LLM streaming 入口只导出原生 OpenAI-compatible SSE 执行、取消、DTO、运行时类型与稳定错误协议。
|
|
26
|
+
关闭 tree-shaking 的 IIFE/ESM 静态图门禁确认 Zod、modelStep、Vercel `ai`、`@ai-sdk/*`、Node builtin、
|
|
27
|
+
`Buffer`、`process`、global fetch、`eval`/`new Function`、`TransformStream`、`WritableStream` 均为 0。
|
|
28
|
+
`ReadableStream` 仍由宿主响应提供;Photoshop 27.5 / UXP 9.2 真机确认没有全局 `TextEncoder` 与
|
|
29
|
+
`TextDecoder`,`0.1.8` 起 SSE 使用 SDK 内部增量 UTF-8 解码器,不要求插件注入 DOM 或 Node polyfill。
|
|
30
|
+
|
|
31
|
+
## manifest v5 网络权限
|
|
32
|
+
|
|
33
|
+
```json
|
|
34
|
+
{
|
|
35
|
+
"manifestVersion": 5,
|
|
36
|
+
"requiredPermissions": {
|
|
37
|
+
"network": {
|
|
38
|
+
"domains": [
|
|
39
|
+
"https://api.kie.ai",
|
|
40
|
+
"https://kieai.redpandaai.co",
|
|
41
|
+
"https://fal.run",
|
|
42
|
+
"https://*.fal.run",
|
|
43
|
+
"https://rest.fal.ai"
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
这里只是短示例;复制 [供应商域名.md](供应商域名.md) 中你实际启用的全部请求域名。
|
|
51
|
+
模型结果可能来自供应商 CDN 或用户自定义 LLM Base URL,它们不可能被静态 SDK 目录穷举;
|
|
52
|
+
宿主需要在保持最小权限的前提下单独加入。
|
|
53
|
+
|
|
54
|
+
## RuntimeContext
|
|
55
|
+
|
|
56
|
+
```ts
|
|
57
|
+
import { createModularGenerationClient } from '@henjicc/ai-sdk/generation/core'
|
|
58
|
+
import { pack as kieZImage } from '@henjicc/ai-sdk/models/kie/z-image'
|
|
59
|
+
import type { Logger, RuntimeContext } from '@henjicc/ai-sdk/runtime'
|
|
60
|
+
|
|
61
|
+
const { secureStorage } = require('uxp').storage
|
|
62
|
+
|
|
63
|
+
type ExportEncodedLayer = (ref: string) => Promise<{
|
|
64
|
+
bytes: Uint8Array
|
|
65
|
+
mimeType: 'image/png' | 'image/jpeg'
|
|
66
|
+
filename: string
|
|
67
|
+
}>
|
|
68
|
+
|
|
69
|
+
export function createUxpRuntime(
|
|
70
|
+
exportEncodedLayer: ExportEncodedLayer,
|
|
71
|
+
logger?: Logger,
|
|
72
|
+
): RuntimeContext {
|
|
73
|
+
return {
|
|
74
|
+
transport: { fetch: (url, init) => fetch(url, init) },
|
|
75
|
+
credentials: {
|
|
76
|
+
async get(scope, providerId) {
|
|
77
|
+
const stored = await secureStorage.getItem(`${scope}:${providerId}`)
|
|
78
|
+
return stored ? decodeAsciiCredential(stored) : undefined
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
media: { read: exportEncodedLayer },
|
|
82
|
+
logger,
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// API key 按 ASCII 保存;避免 UXP 不存在 TextDecoder 时凭据读取失败。
|
|
87
|
+
function decodeAsciiCredential(bytes: Uint8Array): string {
|
|
88
|
+
let value = ''
|
|
89
|
+
for (const byte of bytes) value += String.fromCharCode(byte)
|
|
90
|
+
return value
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export function createUxpGenerationClient(exportEncodedLayer: ExportEncodedLayer) {
|
|
94
|
+
return createModularGenerationClient({
|
|
95
|
+
runtime: createUxpRuntime(exportEncodedLayer),
|
|
96
|
+
packs: [kieZImage],
|
|
97
|
+
})
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
LLM 使用同一个 `RuntimeContext`,密钥 scope 为 `llm`:
|
|
102
|
+
|
|
103
|
+
```ts
|
|
104
|
+
import {
|
|
105
|
+
cancelLlmChatTask,
|
|
106
|
+
runLlmChatStream,
|
|
107
|
+
type LlmChatRequestDto,
|
|
108
|
+
} from '@henjicc/ai-sdk/llm/streaming'
|
|
109
|
+
|
|
110
|
+
const request: LlmChatRequestDto = {
|
|
111
|
+
requestId: 'uxp-chat-1',
|
|
112
|
+
providerId: 'openai',
|
|
113
|
+
modelId: 'gpt-5-mini',
|
|
114
|
+
messages: [{ role: 'user', content: '描述当前图片' }],
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const outcome = await runLlmChatStream(request, request.requestId!, (event) => {
|
|
118
|
+
if (event.type === 'Token') appendText(event.data)
|
|
119
|
+
if (event.type === 'ReasoningToken') appendReasoning(event.data)
|
|
120
|
+
}, runtime)
|
|
121
|
+
console.log(outcome.usage, outcome.finishReason)
|
|
122
|
+
|
|
123
|
+
// 用户点击取消时使用同一个 taskId:
|
|
124
|
+
cancelLlmChatTask(request.requestId!)
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
输入图片/视频/音频时仍通过 `LlmContentPart` 结构与 `RuntimeContext.media` 处理宿主管理引用;不要在插件
|
|
128
|
+
里复制 SSE parser、错误分类或取消登记表。`Transport.fetch` 必须保留 `Response.body` 的原生字节流并尊重
|
|
129
|
+
`init.signal`,不能先把整段响应转为字符串,否则会失去 token 流与及时取消。
|
|
130
|
+
|
|
131
|
+
`kieZImage` 是完整执行 pack,不只是目录定义;它已包含 KIE adapter 与 KIE 范围内的媒体上传策略。
|
|
132
|
+
选择别的模型时替换或追加对应 `models/<provider>/<model>` pack。不要只拿同路径的低层 `model`
|
|
133
|
+
导出再由插件手拼上传逻辑。需要某供应商全部模型时改用 `provider-packs/<provider>`。
|
|
134
|
+
|
|
135
|
+
Photoshop 的消除面板应只导入可选模型分发集合,不把工具塞进普通生成目录:
|
|
136
|
+
|
|
137
|
+
```ts
|
|
138
|
+
import { createModularGenerationClient } from '@henjicc/ai-sdk/generation/core'
|
|
139
|
+
import { pack as falImageEditTools } from '@henjicc/ai-sdk/tool-packs/fal-image-edit-tools'
|
|
140
|
+
|
|
141
|
+
const erase = createModularGenerationClient({ runtime, packs: [falImageEditTools] })
|
|
142
|
+
const created = await erase.generate({
|
|
143
|
+
modelId: 'fal-finegrain-eraser',
|
|
144
|
+
params: {
|
|
145
|
+
image: ['uxp://active-layer'],
|
|
146
|
+
mask: ['uxp://erase-mask'],
|
|
147
|
+
mode: 'standard',
|
|
148
|
+
},
|
|
149
|
+
})
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
该入口只携带 3 个 Fal 消除模型、Fal adapter 和 Fal CDN 上传;默认 105 目录、其他供应商与 LLM
|
|
153
|
+
不会进入静态依赖图。单模型可改用 `tool-models/fal/<model>` 导出的 `pack`。运行时能力筛选只过滤
|
|
154
|
+
已导入候选;要缩小 UXP bundle,必须从 import 边界选择 pack,不能先导入集合再靠筛选期待 tree-shake。
|
|
155
|
+
|
|
156
|
+
`ref` 应是你插件自己管理的 `uxp://...` / `managed://...` 文档或图层引用,不是让用户手填 URL。
|
|
157
|
+
这些引用会原样交给 `MediaReader.read()`。`photoshop.imaging.getPixels()`
|
|
158
|
+
可得到 `PhotoshopImageData`,再从 `imageData.getData()` 取像素字节;这是**原始像素**,
|
|
159
|
+
必须经插件的图像编码/临时文件导出流程得到真正 PNG/JPEG 字节,再从 `MediaReader.read()`
|
|
160
|
+
返回;不得把 RGBA 像素误报成 `image/png`。记录中 Grayscale/LAB 的通道处理与 CMYK
|
|
161
|
+
`getData()` 有历史问题,正式开放前要在真实 Photoshop 复测或明确禁用这些色彩模式。
|
|
162
|
+
|
|
163
|
+
## SecureStorage 与媒体编码
|
|
164
|
+
|
|
165
|
+
- SecureStorage 的 value 加密,key 名不加密;Adobe 将它定位为“更像缓存”,数据可丢失。
|
|
166
|
+
凭据丢失时 `get()` 返回 `undefined`,UI 必须让用户重新填写;不得把它当作唯一且永久的账户真相源。
|
|
167
|
+
- SDK 的媒体 base64 编解码只依赖 `Uint8Array`,不要求 UXP 提供 `btoa` / `atob` polyfill。
|
|
168
|
+
- Fal 本地媒体上传使用 `RuntimeContext.transport` 执行 REST initiate + signed PUT,不构造 `File`;
|
|
169
|
+
取消信号与 120 秒上传 deadline 会传到两段请求。真实 UXP 网络权限、取消和图片放置仍需真机验证。
|
|
@@ -1,83 +1,83 @@
|
|
|
1
|
-
# 供应商域名白名单
|
|
2
|
-
|
|
3
|
-
本清单不是凭记忆维护。在仓库根运行:
|
|
4
|
-
|
|
5
|
-
```bash
|
|
6
|
-
node packages/ai-sdk/scripts/audit-integration-docs.cjs --check
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
脚本从 SDK provider、Transport 上传与 LLM Base URL 常量提取域名,
|
|
10
|
-
再断言本文档逐项覆盖。`apiKeyUrl`/控制台/文档链接不属于 SDK 运行时请求,不放进白名单。
|
|
11
|
-
|
|
12
|
-
## 供应商官网与 API Key 入口
|
|
13
|
-
|
|
14
|
-
这些地址由 `PROVIDER_METADATA` / `findProviderMetadata(providerId, options)` 统一导出,宿主不再复制。
|
|
15
|
-
`websiteUrl` 是实际对用户展示的跳转入口:一般供应商使用正常官网;派欧云、KIE、APIMart
|
|
16
|
-
保留项目已有的邀请码。`apiKeyUrl` 只用于用户主动打开控制台,不参与 SDK 运行时请求。
|
|
17
|
-
|
|
18
|
-
| providerId | 官网入口 `websiteUrl` | API Key 入口 `apiKeyUrl` |
|
|
19
|
-
|---|---|---|
|
|
20
|
-
| `apimart` | `https://apimart.ai/register?aff=cGPOZd`(邀请码) | `https://apimart.ai/keys` |
|
|
21
|
-
| `bailian` | `https://www.aliyun.com/product/bailian` | `https://bailian.console.aliyun.com/?apiKey=1#/api-key` |
|
|
22
|
-
| `bigmodel` | `https://open.bigmodel.cn/` | `https://bigmodel.cn/usercenter/proj-mgmt/apikeys` |
|
|
23
|
-
| `bigmodel-global` | `https://z.ai/` | `https://z.ai/manage-apikey/apikey-list` |
|
|
24
|
-
| `deepseek` | `https://www.deepseek.com/` | `https://platform.deepseek.com/api_keys` |
|
|
25
|
-
| `fal` | `https://fal.ai/` | `https://fal.ai/dashboard/keys` |
|
|
26
|
-
| `groq` | `https://groq.com/` | `https://console.groq.com/keys` |
|
|
27
|
-
| `grsai` | `https://grsai.ai/` | `https://grsai.ai/zh/dashboard/api-keys` |
|
|
28
|
-
| `kie` | `https://kie.ai?ref=eef20ef0b0595cad227d45b29c635f6c`(邀请码) | `https://kie.ai/api-key` |
|
|
29
|
-
| `kimi` | `https://platform.kimi.com/` | `https://platform.kimi.com/console/api-keys` |
|
|
30
|
-
| `minimax` | `https://platform.minimaxi.com/` | `https://platform.minimaxi.com/console/access?tab=api-keys` |
|
|
31
|
-
| `mimo` | `https://mimo.mi.com/` | `https://platform.xiaomimimo.com/console/api-keys` |
|
|
32
|
-
| `modelscope` | `https://www.modelscope.cn/` | `https://modelscope.cn/my/myaccesstoken` |
|
|
33
|
-
| `ppio` | `https://ppio.com/user/register?invited_by=WGY0DZ`(邀请码) | `https://ppio.com/settings/key-management` |
|
|
34
|
-
| `siliconflow` | `https://siliconflow.cn/` | `https://cloud.siliconflow.cn/account/ak` |
|
|
35
|
-
| `volcengine` | `https://www.volcengine.com/product/ark` | `https://console.volcengine.com/ark/region:cn-beijing/apiKey` |
|
|
36
|
-
|
|
37
|
-
BigModel 国内/国际共用 provider family;调用
|
|
38
|
-
`findProviderMetadata('bigmodel', { endpointProfile: 'global' })` 会返回 `bigmodel-global` 的 Z.AI 地址。
|
|
39
|
-
纯自定义供应商没有官方目录依据时返回 `null`,消费软件不应要求用户填写或自行猜测管理地址。
|
|
40
|
-
|
|
41
|
-
## 生成、上传与连通性
|
|
42
|
-
|
|
43
|
-
| 供应商/用途 | 必需域名 |
|
|
44
|
-
|---|---|
|
|
45
|
-
| APIMart 生成、图片上传、故障切换 | `api.apimart.ai`、`api.apib.ai`、`api.aiuxu.com`、`api.aishuch.com` |
|
|
46
|
-
| Grsai 生成、查询、故障切换 | `grsaiapi.com`、`grsai.dakka.com.cn` |
|
|
47
|
-
| KIE 生成/轮询/余额 | `api.kie.ai` |
|
|
48
|
-
| KIE 公网文件上传 | `kieai.redpandaai.co` |
|
|
49
|
-
| Fal 同步/队列 | `fal.run`、`queue.fal.run`、`*.fal.run` |
|
|
50
|
-
| Fal CDN REST 存储上传 | `rest.fal.ai` |
|
|
51
|
-
| 派欧云生成与 LLM | `api.ppio.com` |
|
|
52
|
-
| 魔搭 | `api-inference.modelscope.cn` |
|
|
53
|
-
| 百炼图像/ASR/翻译 | `dashscope.aliyuncs.com`、`*.cn-beijing.maas.aliyuncs.com` |
|
|
54
|
-
| 火山引擎图像/LLM | `ark.cn-beijing.volces.com` |
|
|
55
|
-
| 火山引擎 SeedASR 2.0 | `openspeech.bytedance.com` |
|
|
56
|
-
| 硅基流动 ASR | `api.siliconflow.cn` |
|
|
57
|
-
| Groq LLM/ASR | `api.groq.com` |
|
|
58
|
-
|
|
59
|
-
## LLM 内置/默认地址
|
|
60
|
-
|
|
61
|
-
| 供应商 | 必需域名 |
|
|
62
|
-
|---|---|
|
|
63
|
-
| DeepSeek | `api.deepseek.com` |
|
|
64
|
-
| Kimi | `api.moonshot.cn` |
|
|
65
|
-
| 智谱 GLM | `open.bigmodel.cn` |
|
|
66
|
-
| 小米 MiMo | `api.xiaomimimo.com` |
|
|
67
|
-
| MiniMax | `api.minimaxi.com` |
|
|
68
|
-
| 百炼 Qwen 工作空间地址 | `*.cn-beijing.maas.aliyuncs.com` |
|
|
69
|
-
| OpenAI-compatible 默认回落 | `api.openai.com` |
|
|
70
|
-
|
|
71
|
-
## 权限格式
|
|
72
|
-
|
|
73
|
-
UXP manifest 使用 scheme + host,例如 `https://api.kie.ai` 和 `https://*.fal.run`。
|
|
74
|
-
Tauri `http:allow-fetch` 在后面加路径 glob,例如 `https://api.kie.ai/*` 和
|
|
75
|
-
`https://*.fal.run/*`。
|
|
76
|
-
|
|
77
|
-
本表只穷举 **SDK 主动请求**。下列域名必须由宿主按实际输入/结果动态管理,不能假装可以在此静态穷举:
|
|
78
|
-
|
|
79
|
-
- 用户自建 LLM provider 的 `baseUrl`。
|
|
80
|
-
- 供应商返回的 CDN/结果 URL。
|
|
81
|
-
- 用户传入的既有远程媒体 URL。
|
|
82
|
-
|
|
83
|
-
新增供应商或域名时,同时更新源码常量、本文档、UXP manifest/Tauri capability,并发布宿主新版本。
|
|
1
|
+
# 供应商域名白名单
|
|
2
|
+
|
|
3
|
+
本清单不是凭记忆维护。在仓库根运行:
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
node packages/ai-sdk/scripts/audit-integration-docs.cjs --check
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
脚本从 SDK provider、Transport 上传与 LLM Base URL 常量提取域名,
|
|
10
|
+
再断言本文档逐项覆盖。`apiKeyUrl`/控制台/文档链接不属于 SDK 运行时请求,不放进白名单。
|
|
11
|
+
|
|
12
|
+
## 供应商官网与 API Key 入口
|
|
13
|
+
|
|
14
|
+
这些地址由 `PROVIDER_METADATA` / `findProviderMetadata(providerId, options)` 统一导出,宿主不再复制。
|
|
15
|
+
`websiteUrl` 是实际对用户展示的跳转入口:一般供应商使用正常官网;派欧云、KIE、APIMart
|
|
16
|
+
保留项目已有的邀请码。`apiKeyUrl` 只用于用户主动打开控制台,不参与 SDK 运行时请求。
|
|
17
|
+
|
|
18
|
+
| providerId | 官网入口 `websiteUrl` | API Key 入口 `apiKeyUrl` |
|
|
19
|
+
|---|---|---|
|
|
20
|
+
| `apimart` | `https://apimart.ai/register?aff=cGPOZd`(邀请码) | `https://apimart.ai/keys` |
|
|
21
|
+
| `bailian` | `https://www.aliyun.com/product/bailian` | `https://bailian.console.aliyun.com/?apiKey=1#/api-key` |
|
|
22
|
+
| `bigmodel` | `https://open.bigmodel.cn/` | `https://bigmodel.cn/usercenter/proj-mgmt/apikeys` |
|
|
23
|
+
| `bigmodel-global` | `https://z.ai/` | `https://z.ai/manage-apikey/apikey-list` |
|
|
24
|
+
| `deepseek` | `https://www.deepseek.com/` | `https://platform.deepseek.com/api_keys` |
|
|
25
|
+
| `fal` | `https://fal.ai/` | `https://fal.ai/dashboard/keys` |
|
|
26
|
+
| `groq` | `https://groq.com/` | `https://console.groq.com/keys` |
|
|
27
|
+
| `grsai` | `https://grsai.ai/` | `https://grsai.ai/zh/dashboard/api-keys` |
|
|
28
|
+
| `kie` | `https://kie.ai?ref=eef20ef0b0595cad227d45b29c635f6c`(邀请码) | `https://kie.ai/api-key` |
|
|
29
|
+
| `kimi` | `https://platform.kimi.com/` | `https://platform.kimi.com/console/api-keys` |
|
|
30
|
+
| `minimax` | `https://platform.minimaxi.com/` | `https://platform.minimaxi.com/console/access?tab=api-keys` |
|
|
31
|
+
| `mimo` | `https://mimo.mi.com/` | `https://platform.xiaomimimo.com/console/api-keys` |
|
|
32
|
+
| `modelscope` | `https://www.modelscope.cn/` | `https://modelscope.cn/my/myaccesstoken` |
|
|
33
|
+
| `ppio` | `https://ppio.com/user/register?invited_by=WGY0DZ`(邀请码) | `https://ppio.com/settings/key-management` |
|
|
34
|
+
| `siliconflow` | `https://siliconflow.cn/` | `https://cloud.siliconflow.cn/account/ak` |
|
|
35
|
+
| `volcengine` | `https://www.volcengine.com/product/ark` | `https://console.volcengine.com/ark/region:cn-beijing/apiKey` |
|
|
36
|
+
|
|
37
|
+
BigModel 国内/国际共用 provider family;调用
|
|
38
|
+
`findProviderMetadata('bigmodel', { endpointProfile: 'global' })` 会返回 `bigmodel-global` 的 Z.AI 地址。
|
|
39
|
+
纯自定义供应商没有官方目录依据时返回 `null`,消费软件不应要求用户填写或自行猜测管理地址。
|
|
40
|
+
|
|
41
|
+
## 生成、上传与连通性
|
|
42
|
+
|
|
43
|
+
| 供应商/用途 | 必需域名 |
|
|
44
|
+
|---|---|
|
|
45
|
+
| APIMart 生成、图片上传、故障切换 | `api.apimart.ai`、`api.apib.ai`、`api.aiuxu.com`、`api.aishuch.com` |
|
|
46
|
+
| Grsai 生成、查询、故障切换 | `grsaiapi.com`、`grsai.dakka.com.cn` |
|
|
47
|
+
| KIE 生成/轮询/余额 | `api.kie.ai` |
|
|
48
|
+
| KIE 公网文件上传 | `kieai.redpandaai.co` |
|
|
49
|
+
| Fal 同步/队列 | `fal.run`、`queue.fal.run`、`*.fal.run` |
|
|
50
|
+
| Fal CDN REST 存储上传 | `rest.fal.ai` |
|
|
51
|
+
| 派欧云生成与 LLM | `api.ppio.com` |
|
|
52
|
+
| 魔搭 | `api-inference.modelscope.cn` |
|
|
53
|
+
| 百炼图像/ASR/翻译 | `dashscope.aliyuncs.com`、`*.cn-beijing.maas.aliyuncs.com` |
|
|
54
|
+
| 火山引擎图像/LLM | `ark.cn-beijing.volces.com` |
|
|
55
|
+
| 火山引擎 SeedASR 2.0 | `openspeech.bytedance.com` |
|
|
56
|
+
| 硅基流动 ASR | `api.siliconflow.cn` |
|
|
57
|
+
| Groq LLM/ASR | `api.groq.com` |
|
|
58
|
+
|
|
59
|
+
## LLM 内置/默认地址
|
|
60
|
+
|
|
61
|
+
| 供应商 | 必需域名 |
|
|
62
|
+
|---|---|
|
|
63
|
+
| DeepSeek | `api.deepseek.com` |
|
|
64
|
+
| Kimi | `api.moonshot.cn` |
|
|
65
|
+
| 智谱 GLM | `open.bigmodel.cn` |
|
|
66
|
+
| 小米 MiMo | `api.xiaomimimo.com` |
|
|
67
|
+
| MiniMax | `api.minimaxi.com` |
|
|
68
|
+
| 百炼 Qwen 工作空间地址 | `*.cn-beijing.maas.aliyuncs.com` |
|
|
69
|
+
| OpenAI-compatible 默认回落 | `api.openai.com` |
|
|
70
|
+
|
|
71
|
+
## 权限格式
|
|
72
|
+
|
|
73
|
+
UXP manifest 使用 scheme + host,例如 `https://api.kie.ai` 和 `https://*.fal.run`。
|
|
74
|
+
Tauri `http:allow-fetch` 在后面加路径 glob,例如 `https://api.kie.ai/*` 和
|
|
75
|
+
`https://*.fal.run/*`。
|
|
76
|
+
|
|
77
|
+
本表只穷举 **SDK 主动请求**。下列域名必须由宿主按实际输入/结果动态管理,不能假装可以在此静态穷举:
|
|
78
|
+
|
|
79
|
+
- 用户自建 LLM provider 的 `baseUrl`。
|
|
80
|
+
- 供应商返回的 CDN/结果 URL。
|
|
81
|
+
- 用户传入的既有远程媒体 URL。
|
|
82
|
+
|
|
83
|
+
新增供应商或域名时,同时更新源码常量、本文档、UXP manifest/Tauri capability,并发布宿主新版本。
|