@ai-stack/payloadcms 3.76.0-beta.2 → 3.76.0-beta.4

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.
Files changed (78) hide show
  1. package/README.md +5 -5
  2. package/dist/ai/core/media/image/handlers/multimodal.js +2 -2
  3. package/dist/ai/core/media/image/handlers/multimodal.js.map +1 -1
  4. package/dist/ai/providers/blocks/anthropic.js +2 -2
  5. package/dist/ai/providers/blocks/anthropic.js.map +1 -1
  6. package/dist/ai/providers/blocks/elevenlabs.js +3 -3
  7. package/dist/ai/providers/blocks/elevenlabs.js.map +1 -1
  8. package/dist/ai/providers/blocks/fal.js +2 -2
  9. package/dist/ai/providers/blocks/fal.js.map +1 -1
  10. package/dist/ai/providers/blocks/google.js +4 -3
  11. package/dist/ai/providers/blocks/google.js.map +1 -1
  12. package/dist/ai/providers/blocks/openai-compatible.js +2 -2
  13. package/dist/ai/providers/blocks/openai-compatible.js.map +1 -1
  14. package/dist/ai/providers/blocks/openai.js +2 -2
  15. package/dist/ai/providers/blocks/openai.js.map +1 -1
  16. package/dist/ai/providers/blocks/xai.js +2 -2
  17. package/dist/ai/providers/blocks/xai.js.map +1 -1
  18. package/dist/ai/utilities/nodeToSchemaMap.js +6 -6
  19. package/dist/ai/utilities/nodeToSchemaMap.js.map +1 -1
  20. package/dist/collections/AIProviders.js +13 -13
  21. package/dist/collections/AIProviders.js.map +1 -1
  22. package/dist/collections/Instructions.js +6 -6
  23. package/dist/collections/Instructions.js.map +1 -1
  24. package/dist/endpoints/index.js +1 -1
  25. package/dist/endpoints/index.js.map +1 -1
  26. package/dist/exports/types.d.ts +1 -1
  27. package/dist/exports/types.js.map +1 -1
  28. package/dist/fields/LexicalEditor/feature.server.d.ts +1 -1
  29. package/dist/fields/LexicalEditor/feature.server.js +2 -2
  30. package/dist/fields/LexicalEditor/feature.server.js.map +1 -1
  31. package/dist/fields/PromptEditorField/feature.client.js.map +1 -1
  32. package/dist/fields/PromptEditorField/feature.server.js +1 -1
  33. package/dist/fields/PromptEditorField/feature.server.js.map +1 -1
  34. package/dist/index.d.ts +2 -2
  35. package/dist/index.js +2 -2
  36. package/dist/index.js.map +1 -1
  37. package/dist/plugin.d.ts +2 -2
  38. package/dist/plugin.js +3 -3
  39. package/dist/plugin.js.map +1 -1
  40. package/dist/providers/FieldProvider/FieldProvider.js +1 -1
  41. package/dist/providers/FieldProvider/FieldProvider.js.map +1 -1
  42. package/dist/providers/FieldProvider/FieldProvider.jsx +2 -2
  43. package/dist/providers/InstructionsProvider/InstructionsProvider.js +1 -1
  44. package/dist/providers/InstructionsProvider/InstructionsProvider.js.map +1 -1
  45. package/dist/providers/InstructionsProvider/InstructionsProvider.jsx +2 -2
  46. package/dist/types.d.ts +10 -0
  47. package/dist/types.js.map +1 -1
  48. package/dist/ui/Compose/Compose.js.map +1 -1
  49. package/dist/ui/Compose/hooks/menu/Item.js.map +1 -1
  50. package/dist/ui/Compose/hooks/menu/TranslateMenu.js +12 -4
  51. package/dist/ui/Compose/hooks/menu/TranslateMenu.js.map +1 -1
  52. package/dist/ui/Compose/hooks/menu/TranslateMenu.jsx +8 -4
  53. package/dist/ui/Compose/hooks/useHistory.js +1 -1
  54. package/dist/ui/Compose/hooks/useHistory.js.map +1 -1
  55. package/dist/ui/DynamicModelSelect/index.js +1 -1
  56. package/dist/ui/DynamicModelSelect/index.js.map +1 -1
  57. package/dist/ui/DynamicModelSelect/index.jsx +1 -1
  58. package/dist/ui/DynamicProviderSelect/index.js +1 -1
  59. package/dist/ui/DynamicProviderSelect/index.js.map +1 -1
  60. package/dist/ui/DynamicProviderSelect/index.jsx +1 -1
  61. package/dist/ui/DynamicVoiceSelect/index.js +1 -1
  62. package/dist/ui/DynamicVoiceSelect/index.js.map +1 -1
  63. package/dist/ui/DynamicVoiceSelect/index.jsx +1 -1
  64. package/dist/ui/InstructionProviderOptions/ProviderOptionsTree.js.map +1 -1
  65. package/dist/ui/hooks/useAISettings.js.map +1 -1
  66. package/dist/ui/providerOptions/updateProviderOptionsValue.d.ts +1 -1
  67. package/dist/ui/providerOptions/updateProviderOptionsValue.js.map +1 -1
  68. package/dist/utilities/ai/resolveEffectiveInstructionSettings.js.map +1 -1
  69. package/dist/utilities/fields/updateFieldsConfig.js +1 -1
  70. package/dist/utilities/fields/updateFieldsConfig.js.map +1 -1
  71. package/dist/utilities/lexical/lexicalToPromptTemplate.d.ts +1 -1
  72. package/dist/utilities/lexical/lexicalToPromptTemplate.js +1 -1
  73. package/dist/utilities/lexical/lexicalToPromptTemplate.js.map +1 -1
  74. package/dist/utilities/lexical/stringToLexicalJSON.js +1 -1
  75. package/dist/utilities/lexical/stringToLexicalJSON.js.map +1 -1
  76. package/dist/utilities/seedProperties.js +19 -2
  77. package/dist/utilities/seedProperties.js.map +1 -1
  78. package/package.json +37 -6
package/README.md CHANGED
@@ -91,11 +91,11 @@ pnpm add @ai-stack/payloadcms
91
91
 
92
92
  ```typescript
93
93
  // payload.config.ts
94
- import { payloadAiPlugin } from '@ai-stack/payloadcms'
94
+ import { aiPlugin } from '@ai-stack/payloadcms'
95
95
 
96
96
  export default buildConfig({
97
97
  plugins: [
98
- payloadAiPlugin({
98
+ aiPlugin({
99
99
  collections: {
100
100
  [Posts.slug]: true,
101
101
  },
@@ -108,14 +108,14 @@ export default buildConfig({
108
108
 
109
109
  ```typescript
110
110
  // collections/Posts.ts
111
- import { PayloadAiPluginLexicalEditorFeature } from '@ai-stack/payloadcms'
111
+ import { aiPluginLexicalEditorFeature } from '@ai-stack/payloadcms'
112
112
 
113
113
  fields: [
114
114
  {
115
115
  name: 'content',
116
116
  type: 'richText',
117
117
  editor: lexicalEditor({
118
- features: ({ rootFeatures }) => [...rootFeatures, PayloadAiPluginLexicalEditorFeature()],
118
+ features: ({ rootFeatures }) => [...rootFeatures, aiPluginLexicalEditorFeature()],
119
119
  }),
120
120
  },
121
121
  ]
@@ -240,7 +240,7 @@ Images are automatically fetched and sent to vision-capable models like GPT-4o,
240
240
  <summary>🔧 Access Control, Multi-Tenant, Custom Prompts</summary>
241
241
 
242
242
  ```typescript
243
- payloadAiPlugin({
243
+ aiPlugin({
244
244
  collections: {
245
245
  [Posts.slug]: true,
246
246
  },
@@ -12,7 +12,6 @@ import { convertToBuffer, getExtensionFromMimeType } from '../../utils.js';
12
12
  });
13
13
  const result = await generateText({
14
14
  model,
15
- providerOptions: aiSdkProviderOptions,
16
15
  prompt: [
17
16
  {
18
17
  content: [
@@ -24,7 +23,8 @@ import { convertToBuffer, getExtensionFromMimeType } from '../../utils.js';
24
23
  ],
25
24
  role: 'user'
26
25
  }
27
- ]
26
+ ],
27
+ providerOptions: aiSdkProviderOptions
28
28
  });
29
29
  // Extract images from result.files
30
30
  const resultImages = result.files?.filter((f)=>f.mediaType?.startsWith('image/')) || [];
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../src/ai/core/media/image/handlers/multimodal.ts"],"sourcesContent":["import { generateText, type LanguageModel } from 'ai'\n\nimport type { ImageGenerationArgs, MediaResult, MultimodalImageFile } from '../../types.js'\n\nimport { toAISDKProviderOptions } from '../../../../providers/registry.js'\nimport { convertToBuffer, getExtensionFromMimeType } from '../../utils.js'\n\n/**\n * Handle multimodal text-to-image generation (e.g., Gemini Nano Banana)\n * Uses generateText with image response modalities\n */\nexport async function generateMultimodalImage(\n model: LanguageModel,\n args: ImageGenerationArgs,\n): Promise<MediaResult> {\n const { images = [], prompt, provider, providerOptions } = args\n\n const aiSdkProviderOptions = toAISDKProviderOptions({\n providerId: provider,\n settingsOverride: providerOptions,\n })\n\n const result = await generateText({\n model,\n providerOptions: aiSdkProviderOptions,\n prompt: [\n {\n content: [{ type: 'text', text: prompt }, ...images],\n role: 'user',\n },\n ],\n })\n\n // Extract images from result.files\n const resultImages = (result.files?.filter((f: MultimodalImageFile) =>\n f.mediaType?.startsWith('image/'),\n ) || []) as MultimodalImageFile[]\n\n if (resultImages.length === 0) {\n // Check if Google returned a specific error message\n const responseBody = result.response?.body as\n | { candidates?: Array<{ finishMessage?: string; finishReason?: string }> }\n | undefined\n const candidate = responseBody?.candidates?.[0]\n\n if (candidate?.finishMessage) {\n throw new Error(`Image generation failed: ${candidate.finishMessage}`)\n }\n if (candidate?.finishReason && candidate.finishReason !== 'STOP') {\n throw new Error(`Image generation failed with reason: ${candidate.finishReason}`)\n }\n\n throw new Error('No images returned from the model. The model may have generated only text.')\n }\n\n const files = resultImages.map((image) => {\n const mimeType = image.mediaType || 'image/png'\n const imageData = image.base64Data || image.uint8Array\n\n if (!imageData) {\n throw new Error('Image data is missing from the response.')\n }\n\n const buffer = convertToBuffer(imageData)\n const extension = getExtensionFromMimeType(mimeType)\n\n return {\n name: `generated.${extension}`,\n data: buffer,\n mimetype: mimeType,\n size: buffer.byteLength,\n }\n })\n\n return {\n files,\n }\n}\n"],"names":["generateText","toAISDKProviderOptions","convertToBuffer","getExtensionFromMimeType","generateMultimodalImage","model","args","images","prompt","provider","providerOptions","aiSdkProviderOptions","providerId","settingsOverride","result","content","type","text","role","resultImages","files","filter","f","mediaType","startsWith","length","responseBody","response","body","candidate","candidates","finishMessage","Error","finishReason","map","image","mimeType","imageData","base64Data","uint8Array","buffer","extension","name","data","mimetype","size","byteLength"],"mappings":"AAAA,SAASA,YAAY,QAA4B,KAAI;AAIrD,SAASC,sBAAsB,QAAQ,oCAAmC;AAC1E,SAASC,eAAe,EAAEC,wBAAwB,QAAQ,iBAAgB;AAE1E;;;CAGC,GACD,OAAO,eAAeC,wBACpBC,KAAoB,EACpBC,IAAyB;IAEzB,MAAM,EAAEC,SAAS,EAAE,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,eAAe,EAAE,GAAGJ;IAE3D,MAAMK,uBAAuBV,uBAAuB;QAClDW,YAAYH;QACZI,kBAAkBH;IACpB;IAEA,MAAMI,SAAS,MAAMd,aAAa;QAChCK;QACAK,iBAAiBC;QACjBH,QAAQ;YACN;gBACEO,SAAS;oBAAC;wBAAEC,MAAM;wBAAQC,MAAMT;oBAAO;uBAAMD;iBAAO;gBACpDW,MAAM;YACR;SACD;IACH;IAEA,mCAAmC;IACnC,MAAMC,eAAgBL,OAAOM,KAAK,EAAEC,OAAO,CAACC,IAC1CA,EAAEC,SAAS,EAAEC,WAAW,cACrB,EAAE;IAEP,IAAIL,aAAaM,MAAM,KAAK,GAAG;QAC7B,oDAAoD;QACpD,MAAMC,eAAeZ,OAAOa,QAAQ,EAAEC;QAGtC,MAAMC,YAAYH,cAAcI,YAAY,CAAC,EAAE;QAE/C,IAAID,WAAWE,eAAe;YAC5B,MAAM,IAAIC,MAAM,CAAC,yBAAyB,EAAEH,UAAUE,aAAa,CAAC,CAAC;QACvE;QACA,IAAIF,WAAWI,gBAAgBJ,UAAUI,YAAY,KAAK,QAAQ;YAChE,MAAM,IAAID,MAAM,CAAC,qCAAqC,EAAEH,UAAUI,YAAY,CAAC,CAAC;QAClF;QAEA,MAAM,IAAID,MAAM;IAClB;IAEA,MAAMZ,QAAQD,aAAae,GAAG,CAAC,CAACC;QAC9B,MAAMC,WAAWD,MAAMZ,SAAS,IAAI;QACpC,MAAMc,YAAYF,MAAMG,UAAU,IAAIH,MAAMI,UAAU;QAEtD,IAAI,CAACF,WAAW;YACd,MAAM,IAAIL,MAAM;QAClB;QAEA,MAAMQ,SAAStC,gBAAgBmC;QAC/B,MAAMI,YAAYtC,yBAAyBiC;QAE3C,OAAO;YACLM,MAAM,CAAC,UAAU,EAAED,UAAU,CAAC;YAC9BE,MAAMH;YACNI,UAAUR;YACVS,MAAML,OAAOM,UAAU;QACzB;IACF;IAEA,OAAO;QACL1B;IACF;AACF"}
1
+ {"version":3,"sources":["../../../../../../src/ai/core/media/image/handlers/multimodal.ts"],"sourcesContent":["import { generateText, type LanguageModel } from 'ai'\n\nimport type { ImageGenerationArgs, MediaResult, MultimodalImageFile } from '../../types.js'\n\nimport { toAISDKProviderOptions } from '../../../../providers/registry.js'\nimport { convertToBuffer, getExtensionFromMimeType } from '../../utils.js'\n\n/**\n * Handle multimodal text-to-image generation (e.g., Gemini Nano Banana)\n * Uses generateText with image response modalities\n */\nexport async function generateMultimodalImage(\n model: LanguageModel,\n args: ImageGenerationArgs,\n): Promise<MediaResult> {\n const { images = [], prompt, provider, providerOptions } = args\n\n const aiSdkProviderOptions = toAISDKProviderOptions({\n providerId: provider,\n settingsOverride: providerOptions,\n })\n\n const result = await generateText({\n model,\n prompt: [\n {\n content: [{ type: 'text', text: prompt }, ...images],\n role: 'user',\n },\n ],\n providerOptions: aiSdkProviderOptions,\n })\n\n // Extract images from result.files\n const resultImages = (result.files?.filter((f: MultimodalImageFile) =>\n f.mediaType?.startsWith('image/'),\n ) || []) as MultimodalImageFile[]\n\n if (resultImages.length === 0) {\n // Check if Google returned a specific error message\n const responseBody = result.response?.body as\n | { candidates?: Array<{ finishMessage?: string; finishReason?: string }> }\n | undefined\n const candidate = responseBody?.candidates?.[0]\n\n if (candidate?.finishMessage) {\n throw new Error(`Image generation failed: ${candidate.finishMessage}`)\n }\n if (candidate?.finishReason && candidate.finishReason !== 'STOP') {\n throw new Error(`Image generation failed with reason: ${candidate.finishReason}`)\n }\n\n throw new Error('No images returned from the model. The model may have generated only text.')\n }\n\n const files = resultImages.map((image) => {\n const mimeType = image.mediaType || 'image/png'\n const imageData = image.base64Data || image.uint8Array\n\n if (!imageData) {\n throw new Error('Image data is missing from the response.')\n }\n\n const buffer = convertToBuffer(imageData)\n const extension = getExtensionFromMimeType(mimeType)\n\n return {\n name: `generated.${extension}`,\n data: buffer,\n mimetype: mimeType,\n size: buffer.byteLength,\n }\n })\n\n return {\n files,\n }\n}\n"],"names":["generateText","toAISDKProviderOptions","convertToBuffer","getExtensionFromMimeType","generateMultimodalImage","model","args","images","prompt","provider","providerOptions","aiSdkProviderOptions","providerId","settingsOverride","result","content","type","text","role","resultImages","files","filter","f","mediaType","startsWith","length","responseBody","response","body","candidate","candidates","finishMessage","Error","finishReason","map","image","mimeType","imageData","base64Data","uint8Array","buffer","extension","name","data","mimetype","size","byteLength"],"mappings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L,MAAM;QAClB;QAEA,MAAMQ,SAAStC,gBAAgBmC;QAC/B,MAAMI,YAAYtC,yBAAyBiC;QAE3C,OAAO;YACLM,MAAM,CAAC,UAAU,EAAED,UAAU,CAAC;YAC9BE,MAAMH;YACNI,UAAUR;YACVS,MAAML,OAAOM,UAAU;QACzB;IACF;IAEA,OAAO;QACL1B;IACF;AACF"}
@@ -19,7 +19,7 @@ export const anthropicBlock = {
19
19
  type: 'text',
20
20
  admin: {
21
21
  components: {
22
- Field: '@ai-stack/payloadcms/client#EncryptedTextField'
22
+ Field: '@ai-stack/payloadcms/ui/EncryptedTextField/index.js#EncryptedTextField'
23
23
  },
24
24
  description: 'Your Anthropic API key. Will be encrypted in the database.'
25
25
  },
@@ -37,7 +37,7 @@ export const anthropicBlock = {
37
37
  type: 'array',
38
38
  admin: {
39
39
  components: {
40
- RowLabel: '@ai-stack/payloadcms/client#ModelRowLabel'
40
+ RowLabel: '@ai-stack/payloadcms/ui/ModelRowLabel/index.js#ModelRowLabel'
41
41
  },
42
42
  initCollapsed: true
43
43
  },
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/ai/providers/blocks/anthropic.ts"],"sourcesContent":["import type { Block } from 'payload'\n\nimport { AnthropicIcon } from '../icons.js'\n\nexport const anthropicBlock: Block = {\n slug: 'anthropic',\n fields: [\n {\n type: 'tabs',\n tabs: [\n // 1. Setup tab\n {\n fields: [\n {\n name: 'enabled',\n type: 'checkbox',\n defaultValue: true,\n label: 'Enabled',\n },\n {\n name: 'apiKey',\n type: 'text',\n admin: {\n components: {\n Field: '@ai-stack/payloadcms/client#EncryptedTextField',\n },\n description: 'Your Anthropic API key. Will be encrypted in the database.',\n },\n label: 'API Key',\n required: true,\n },\n ],\n label: 'Setup',\n },\n\n // 3. Models tab\n {\n fields: [\n {\n name: 'models',\n type: 'array',\n admin: {\n components: {\n RowLabel: '@ai-stack/payloadcms/client#ModelRowLabel',\n },\n initCollapsed: true,\n },\n defaultValue: [\n { id: 'claude-opus-4-1', name: 'Claude Opus 4.1', enabled: true, responseModalities: ['TEXT'], useCase: 'text' },\n { id: 'claude-opus-4-0', name: 'Claude Opus 4.0', enabled: true, responseModalities: ['TEXT'], useCase: 'text' },\n { id: 'claude-sonnet-4-0', name: 'Claude Sonnet 4.0', enabled: true, responseModalities: ['TEXT'], useCase: 'text' },\n {\n id: 'claude-3-5-sonnet-latest',\n name: 'Claude 3.5 Sonnet',\n enabled: true,\n responseModalities: ['TEXT'],\n useCase: 'text',\n },\n {\n id: 'claude-3-5-haiku-latest',\n name: 'Claude 3.5 Haiku',\n enabled: true,\n responseModalities: ['TEXT'],\n useCase: 'text',\n },\n ],\n fields: [\n {\n type: 'row',\n fields: [\n {\n name: 'id',\n type: 'text',\n admin: { width: '33%' },\n label: 'Model ID',\n required: true,\n },\n {\n name: 'name',\n type: 'text',\n admin: { width: '33%' },\n label: 'Display Name',\n required: true,\n },\n {\n name: 'useCase',\n type: 'select',\n admin: { width: '33%' },\n dbName: 'anthropic-model-useCase',\n defaultValue: 'text',\n label: 'Use Case',\n options: [{ label: 'Text Generation', value: 'text' }],\n },\n ],\n },\n {\n name: 'responseModalities',\n type: 'select',\n admin: {\n description: 'Output capabilities of this model',\n width: '50%',\n },\n dbName: 'anthropic-model-modalities',\n hasMany: true,\n label: 'Response Modalities',\n options: [\n { label: 'Text', value: 'TEXT' },\n { label: 'Image', value: 'IMAGE' },\n { label: 'Audio', value: 'AUDIO' },\n ],\n },\n {\n name: 'enabled',\n type: 'checkbox',\n admin: {\n width: '50%',\n },\n defaultValue: true,\n label: 'Enabled',\n },\n ],\n label: 'Available Models',\n },\n ],\n label: 'Models',\n },\n ],\n },\n ],\n imageURL: AnthropicIcon,\n labels: {\n plural: 'Anthropic Providers',\n singular: 'Anthropic',\n },\n}\n"],"names":["AnthropicIcon","anthropicBlock","slug","fields","type","tabs","name","defaultValue","label","admin","components","Field","description","required","RowLabel","initCollapsed","id","enabled","responseModalities","useCase","width","dbName","options","value","hasMany","imageURL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M;4CACNF,MAAM;4CACNK,OAAO;gDAAEW,OAAO;4CAAM;4CACtBZ,OAAO;4CACPK,UAAU;wCACZ;wCACA;4CACEP,MAAM;4CACNF,MAAM;4CACNK,OAAO;gDAAEW,OAAO;4CAAM;4CACtBC,QAAQ;4CACRd,cAAc;4CACdC,OAAO;4CACPc,SAAS;gDAAC;oDAAEd,OAAO;oDAAmBe,OAAO;gDAAO;6CAAE;wCACxD;qCACD;gCACH;gCACA;oCACEjB,MAAM;oCACNF,MAAM;oCACNK,OAAO;wCACLG,aAAa;wCACbQ,OAAO;oCACT;oCACAC,QAAQ;oCACRG,SAAS;oCACThB,OAAO;oCACPc,SAAS;wCACP;4CAAEd,OAAO;4CAAQe,OAAO;wCAAO;wCAC/B;4CAAEf,OAAO;4CAASe,OAAO;wCAAQ;wCACjC;4CAAEf,OAAO;4CAASe,OAAO;wCAAQ;qCAClC;gCACH;gCACA;oCACEjB,MAAM;oCACNF,MAAM;oCACNK,OAAO;wCACLW,OAAO;oCACT;oCACAb,cAAc;oCACdC,OAAO;gCACT;6BACD;4BACDA,OAAO;wBACT;qBACD;oBACDA,OAAO;gBACT;aACD;QACH;KACD;IACDiB,UAAUzB;IACV0B,QAAQ;QACNC,QAAQ;QACRC,UAAU;IACZ;AACF,EAAC"}
1
+ {"version":3,"sources":["../../../../src/ai/providers/blocks/anthropic.ts"],"sourcesContent":["import type { Block } from 'payload'\n\nimport { AnthropicIcon } from '../icons.js'\n\nexport const anthropicBlock: Block = {\n slug: 'anthropic',\n fields: [\n {\n type: 'tabs',\n tabs: [\n // 1. Setup tab\n {\n fields: [\n {\n name: 'enabled',\n type: 'checkbox',\n defaultValue: true,\n label: 'Enabled',\n },\n {\n name: 'apiKey',\n type: 'text',\n admin: {\n components: {\n Field: '@ai-stack/payloadcms/ui/EncryptedTextField/index.js#EncryptedTextField',\n },\n description: 'Your Anthropic API key. Will be encrypted in the database.',\n },\n label: 'API Key',\n required: true,\n },\n ],\n label: 'Setup',\n },\n\n // 3. Models tab\n {\n fields: [\n {\n name: 'models',\n type: 'array',\n admin: {\n components: {\n RowLabel: '@ai-stack/payloadcms/ui/ModelRowLabel/index.js#ModelRowLabel',\n },\n initCollapsed: true,\n },\n defaultValue: [\n { id: 'claude-opus-4-1', name: 'Claude Opus 4.1', enabled: true, responseModalities: ['TEXT'], useCase: 'text' },\n { id: 'claude-opus-4-0', name: 'Claude Opus 4.0', enabled: true, responseModalities: ['TEXT'], useCase: 'text' },\n { id: 'claude-sonnet-4-0', name: 'Claude Sonnet 4.0', enabled: true, responseModalities: ['TEXT'], useCase: 'text' },\n {\n id: 'claude-3-5-sonnet-latest',\n name: 'Claude 3.5 Sonnet',\n enabled: true,\n responseModalities: ['TEXT'],\n useCase: 'text',\n },\n {\n id: 'claude-3-5-haiku-latest',\n name: 'Claude 3.5 Haiku',\n enabled: true,\n responseModalities: ['TEXT'],\n useCase: 'text',\n },\n ],\n fields: [\n {\n type: 'row',\n fields: [\n {\n name: 'id',\n type: 'text',\n admin: { width: '33%' },\n label: 'Model ID',\n required: true,\n },\n {\n name: 'name',\n type: 'text',\n admin: { width: '33%' },\n label: 'Display Name',\n required: true,\n },\n {\n name: 'useCase',\n type: 'select',\n admin: { width: '33%' },\n dbName: 'anthropic-model-useCase',\n defaultValue: 'text',\n label: 'Use Case',\n options: [{ label: 'Text Generation', value: 'text' }],\n },\n ],\n },\n {\n name: 'responseModalities',\n type: 'select',\n admin: {\n description: 'Output capabilities of this model',\n width: '50%',\n },\n dbName: 'anthropic-model-modalities',\n hasMany: true,\n label: 'Response Modalities',\n options: [\n { label: 'Text', value: 'TEXT' },\n { label: 'Image', value: 'IMAGE' },\n { label: 'Audio', value: 'AUDIO' },\n ],\n },\n {\n name: 'enabled',\n type: 'checkbox',\n admin: {\n width: '50%',\n },\n defaultValue: true,\n label: 'Enabled',\n },\n ],\n label: 'Available Models',\n },\n ],\n label: 'Models',\n },\n ],\n },\n ],\n imageURL: AnthropicIcon,\n labels: {\n plural: 'Anthropic Providers',\n singular: 'Anthropic',\n },\n}\n"],"names":["AnthropicIcon","anthropicBlock","slug","fields","type","tabs","name","defaultValue","label","admin","components","Field","description","required","RowLabel","initCollapsed","id","enabled","responseModalities","useCase","width","dbName","options","value","hasMany","imageURL","labels","plural","singular"],"mappings":"AAEA,SAASA,aAAa,QAAQ,cAAa;AAE3C,OAAO,MAAMC,iBAAwB;IACnCC,MAAM;IACNC,QAAQ;QACN;YACEC,MAAM;YACNC,MAAM;gBACJ,eAAe;gBACf;oBACEF,QAAQ;wBACN;4BACEG,MAAM;4BACNF,MAAM;4BACNG,cAAc;4BACdC,OAAO;wBACT;wBACA;4BACEF,MAAM;4BACNF,MAAM;4BACNK,OAAO;gCACLC,YAAY;oCACVC,OAAO;gCACT;gCACAC,aAAa;4BACf;4BACAJ,OAAO;4BACPK,UAAU;wBACZ;qBACD;oBACDL,OAAO;gBACT;gBAEA,gBAAgB;gBAChB;oBACEL,QAAQ;wBACN;4BACEG,MAAM;4BACNF,MAAM;4BACNK,OAAO;gCACLC,YAAY;oCACVI,UAAU;gCACZ;gCACAC,eAAe;4BACjB;4BACAR,cAAc;gCACZ;oCAAES,IAAI;oCAAmBV,MAAM;oCAAmBW,SAAS;oCAAMC,oBAAoB;wCAAC;qCAAO;oCAAEC,SAAS;gCAAO;gCAC/G;oCAAEH,IAAI;oCAAmBV,MAAM;oCAAmBW,SAAS;oCAAMC,oBAAoB;wCAAC;qCAAO;oCAAEC,SAAS;gCAAO;gCAC/G;oCAAEH,IAAI;oCAAqBV,MAAM;oCAAqBW,SAAS;oCAAMC,oBAAoB;wCAAC;qCAAO;oCAAEC,SAAS;gCAAO;gCACnH;oCACEH,IAAI;oCACJV,MAAM;oCACNW,SAAS;oCACTC,oBAAoB;wCAAC;qCAAO;oCAC5BC,SAAS;gCACX;gCACA;oCACEH,IAAI;oCACJV,MAAM;oCACNW,SAAS;oCACTC,oBAAoB;wCAAC;qCAAO;oCAC5BC,SAAS;gCACX;6BACD;4BACDhB,QAAQ;gCACN;oCACEC,MAAM;oCACND,QAAQ;wCACN;4CACEG,MAAM;4CACNF,MAAM;4CACNK,OAAO;gDAAEW,OAAO;4CAAM;4CACtBZ,OAAO;4CACPK,UAAU;wCACZ;wCACA;4CACEP,MAAM;4CACNF,MAAM;4CACNK,OAAO;gDAAEW,OAAO;4CAAM;4CACtBZ,OAAO;4CACPK,UAAU;wCACZ;wCACA;4CACEP,MAAM;4CACNF,MAAM;4CACNK,OAAO;gDAAEW,OAAO;4CAAM;4CACtBC,QAAQ;4CACRd,cAAc;4CACdC,OAAO;4CACPc,SAAS;gDAAC;oDAAEd,OAAO;oDAAmBe,OAAO;gDAAO;6CAAE;wCACxD;qCACD;gCACH;gCACA;oCACEjB,MAAM;oCACNF,MAAM;oCACNK,OAAO;wCACLG,aAAa;wCACbQ,OAAO;oCACT;oCACAC,QAAQ;oCACRG,SAAS;oCACThB,OAAO;oCACPc,SAAS;wCACP;4CAAEd,OAAO;4CAAQe,OAAO;wCAAO;wCAC/B;4CAAEf,OAAO;4CAASe,OAAO;wCAAQ;wCACjC;4CAAEf,OAAO;4CAASe,OAAO;wCAAQ;qCAClC;gCACH;gCACA;oCACEjB,MAAM;oCACNF,MAAM;oCACNK,OAAO;wCACLW,OAAO;oCACT;oCACAb,cAAc;oCACdC,OAAO;gCACT;6BACD;4BACDA,OAAO;wBACT;qBACD;oBACDA,OAAO;gBACT;aACD;QACH;KACD;IACDiB,UAAUzB;IACV0B,QAAQ;QACNC,QAAQ;QACRC,UAAU;IACZ;AACF,EAAC"}
@@ -19,7 +19,7 @@ export const elevenlabsBlock = {
19
19
  type: 'text',
20
20
  admin: {
21
21
  components: {
22
- Field: '@ai-stack/payloadcms/client#EncryptedTextField'
22
+ Field: '@ai-stack/payloadcms/ui/EncryptedTextField/index.js#EncryptedTextField'
23
23
  },
24
24
  description: 'Your ElevenLabs API key. Will be encrypted in the database. Get yours at elevenlabs.io'
25
25
  },
@@ -94,7 +94,7 @@ export const elevenlabsBlock = {
94
94
  type: 'ui',
95
95
  admin: {
96
96
  components: {
97
- Field: '@ai-stack/payloadcms/client#VoicesFetcher'
97
+ Field: '@ai-stack/payloadcms/ui/VoicesFetcher/index.js#VoicesFetcher'
98
98
  }
99
99
  }
100
100
  },
@@ -201,7 +201,7 @@ export const elevenlabsBlock = {
201
201
  type: 'array',
202
202
  admin: {
203
203
  components: {
204
- RowLabel: '@ai-stack/payloadcms/client#ModelRowLabel'
204
+ RowLabel: '@ai-stack/payloadcms/ui/ModelRowLabel/index.js#ModelRowLabel'
205
205
  },
206
206
  description: 'Configure TTS models. Use the Voices and Provider Options tabs for detailed settings.',
207
207
  initCollapsed: true
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/ai/providers/blocks/elevenlabs.ts"],"sourcesContent":["import type { Block } from 'payload'\n\nimport { ElevenLabsIcon } from '../icons.js'\n\nexport const elevenlabsBlock: Block = {\n slug: 'elevenlabs',\n\n fields: [\n {\n type: 'tabs',\n tabs: [\n // 1. Setup tab\n {\n fields: [\n {\n name: 'enabled',\n type: 'checkbox',\n defaultValue: true,\n label: 'Enabled',\n },\n {\n name: 'apiKey',\n type: 'text',\n admin: {\n components: {\n Field: '@ai-stack/payloadcms/client#EncryptedTextField',\n },\n description:\n 'Your ElevenLabs API key. Will be encrypted in the database. Get yours at elevenlabs.io',\n },\n label: 'API Key',\n required: true,\n },\n ],\n label: 'Setup',\n },\n\n // 2. Connection tab\n {\n fields: [\n {\n type: 'collapsible',\n admin: {\n initCollapsed: false,\n },\n fields: [\n {\n name: 'baseURL',\n type: 'text',\n admin: {\n description:\n 'Optional. Override default API endpoint (defaults to https://api.elevenlabs.io/v1).',\n },\n defaultValue: 'https://api.elevenlabs.io/v1',\n label: 'Base URL',\n },\n {\n name: 'headers',\n type: 'array',\n admin: {\n description: 'Optional. Custom headers to send with every request.',\n },\n fields: [\n {\n type: 'row',\n fields: [\n {\n name: 'key',\n type: 'text',\n admin: {\n width: '50%',\n },\n label: 'Header Name',\n required: true,\n },\n {\n name: 'value',\n type: 'text',\n admin: {\n width: '50%',\n },\n label: 'Header Value',\n required: true,\n },\n ],\n },\n ],\n label: 'Custom Headers',\n },\n ],\n label: 'API & Network Settings',\n },\n ],\n label: 'Connection',\n },\n\n // 3. Voices tab (Existing)\n {\n fields: [\n {\n name: 'voicesFetcherUI',\n type: 'ui',\n admin: {\n components: {\n Field: '@ai-stack/payloadcms/client#VoicesFetcher',\n },\n },\n },\n {\n name: 'voices',\n type: 'array',\n admin: {\n description:\n 'Use the \"Fetch Voices\" button above to populate this list from your ElevenLabs account.',\n initCollapsed: true,\n },\n fields: [\n {\n type: 'row',\n fields: [\n {\n name: 'id',\n type: 'text',\n admin: {\n description: 'Voice ID from ElevenLabs',\n width: '40%',\n },\n label: 'Voice ID',\n required: true,\n },\n {\n name: 'name',\n type: 'text',\n admin: {\n width: '40%',\n },\n label: 'Display Name',\n required: true,\n },\n {\n name: 'enabled',\n type: 'checkbox',\n admin: {\n width: '20%',\n },\n defaultValue: true,\n label: 'Enabled',\n },\n ],\n },\n {\n type: 'row',\n fields: [\n {\n name: 'category',\n type: 'select',\n admin: {\n width: '50%',\n },\n dbName: 'eleven-voice-category',\n label: 'Category',\n options: [\n { label: 'Premade', value: 'premade' },\n { label: 'Cloned', value: 'cloned' },\n { label: 'Professional', value: 'professional' },\n { label: 'Generated', value: 'generated' },\n ],\n },\n {\n name: 'preview_url',\n type: 'text',\n admin: {\n width: '50%',\n },\n label: 'Preview URL',\n },\n ],\n },\n {\n name: 'labels',\n type: 'json',\n admin: {\n description:\n 'Voice attributes like gender, age, accent (JSON object). Example: {\"gender\": \"female\", \"age\": \"young\", \"accent\": \"american\"}',\n },\n label: 'Labels',\n },\n ],\n label: 'Available Voices',\n },\n ],\n label: 'Voices',\n },\n\n\n\n // 5. Models (SIMPLIFIED - no per-model settings)\n {\n fields: [\n {\n name: 'models',\n type: 'array',\n admin: {\n components: {\n RowLabel: '@ai-stack/payloadcms/client#ModelRowLabel',\n },\n description:\n 'Configure TTS models. Use the Voices and Provider Options tabs for detailed settings.',\n initCollapsed: true,\n },\n defaultValue: [\n {\n id: 'eleven_flash_v2_5',\n name: 'Flash V2.5 (Fastest)',\n enabled: true,\n responseModalities: ['AUDIO'],\n useCase: 'tts',\n },\n {\n id: 'eleven_turbo_v2_5',\n name: 'Turbo V2.5 (Latest)',\n enabled: true,\n responseModalities: ['AUDIO'],\n useCase: 'tts',\n },\n {\n id: 'eleven_multilingual_v2',\n name: 'Multilingual V2',\n enabled: true,\n responseModalities: ['AUDIO'],\n useCase: 'tts',\n },\n {\n id: 'eleven_turbo_v2',\n name: 'Turbo V2',\n enabled: false,\n responseModalities: ['AUDIO'],\n useCase: 'tts',\n },\n ],\n fields: [\n // Basic info\n {\n type: 'row',\n fields: [\n {\n name: 'id',\n type: 'text',\n admin: {\n description: 'Model ID (e.g., eleven_flash_v2_5)',\n width: '50%',\n },\n label: 'Model ID',\n required: true,\n },\n {\n name: 'name',\n type: 'text',\n admin: {\n width: '50%',\n },\n label: 'Display Name',\n required: true,\n },\n ],\n },\n {\n type: 'row',\n fields: [\n {\n name: 'useCase',\n type: 'select',\n admin: {\n width: '33%',\n },\n dbName: 'eleven-model-useCase',\n defaultValue: 'tts',\n label: 'Use Case',\n options: [{ label: 'Text-to-Speech', value: 'tts' }],\n },\n {\n name: 'responseModalities',\n type: 'select',\n admin: {\n description: 'Output capabilities of this model',\n width: '33%',\n },\n dbName: 'eleven-model-modalities',\n hasMany: true,\n label: 'Response Modalities',\n options: [\n { label: 'Text', value: 'TEXT' },\n { label: 'Audio', value: 'AUDIO' },\n ],\n },\n {\n name: 'enabled',\n type: 'checkbox',\n admin: {\n width: '33%',\n },\n defaultValue: true,\n label: 'Enabled',\n },\n ],\n },\n ],\n label: 'Available Models',\n labels: {\n plural: 'Models',\n singular: 'Model',\n },\n },\n ],\n label: 'Models',\n },\n ],\n },\n ],\n imageURL: ElevenLabsIcon,\n labels: {\n plural: 'ElevenLabs Providers',\n singular: 'ElevenLabs',\n },\n}\n"],"names":["ElevenLabsIcon","elevenlabsBlock","slug","fields","type","tabs","name","defaultValue","label","admin","components","Field","description","required","initCollapsed","width","dbName","options","value","RowLabel","id","enabled","responseModalities","useCase","hasMany","labels","plural","singular","imageURL"],"mappings":"AAEA,SAASA,cAAc,QAAQ,cAAa;AAE5C,OAAO,MAAMC,kBAAyB;IACpCC,MAAM;IAENC,QAAQ;QACN;YACEC,MAAM;YACNC,MAAM;gBACJ,eAAe;gBACf;oBACEF,QAAQ;wBACN;4BACEG,MAAM;4BACNF,MAAM;4BACNG,cAAc;4BACdC,OAAO;wBACT;wBACA;4BACEF,MAAM;4BACNF,MAAM;4BACNK,OAAO;gCACLC,YAAY;oCACVC,OAAO;gCACT;gCACAC,aACE;4BACJ;4BACAJ,OAAO;4BACPK,UAAU;wBACZ;qBACD;oBACDL,OAAO;gBACT;gBAEA,oBAAoB;gBACpB;oBACEL,QAAQ;wBACN;4BACEC,MAAM;4BACNK,OAAO;gCACLK,eAAe;4BACjB;4BACAX,QAAQ;gCACN;oCACEG,MAAM;oCACNF,MAAM;oCACNK,OAAO;wCACLG,aACE;oCACJ;oCACAL,cAAc;oCACdC,OAAO;gCACT;gCACA;oCACEF,MAAM;oCACNF,MAAM;oCACNK,OAAO;wCACLG,aAAa;oCACf;oCACAT,QAAQ;wCACN;4CACEC,MAAM;4CACND,QAAQ;gDACN;oDACEG,MAAM;oDACNF,MAAM;oDACNK,OAAO;wDACLM,OAAO;oDACT;oDACAP,OAAO;oDACPK,UAAU;gDACZ;gDACA;oDACEP,MAAM;oDACNF,MAAM;oDACNK,OAAO;wDACLM,OAAO;oDACT;oDACAP,OAAO;oDACPK,UAAU;gDACZ;6CACD;wCACH;qCACD;oCACDL,OAAO;gCACT;6BACD;4BACDA,OAAO;wBACT;qBACD;oBACDA,OAAO;gBACT;gBAEA,2BAA2B;gBAC3B;oBACEL,QAAQ;wBACN;4BACEG,MAAM;4BACNF,MAAM;4BACNK,OAAO;gCACLC,YAAY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,QAAQ;gCACNC,QAAQ;gCACRC,UAAU;4BACZ;wBACF;qBACD;oBACDnB,OAAO;gBACT;aACD;QACH;KACD;IACDoB,UAAU5B;IACVyB,QAAQ;QACNC,QAAQ;QACRC,UAAU;IACZ;AACF,EAAC"}
1
+ {"version":3,"sources":["../../../../src/ai/providers/blocks/elevenlabs.ts"],"sourcesContent":["import type { Block } from 'payload'\n\nimport { ElevenLabsIcon } from '../icons.js'\n\nexport const elevenlabsBlock: Block = {\n slug: 'elevenlabs',\n\n fields: [\n {\n type: 'tabs',\n tabs: [\n // 1. Setup tab\n {\n fields: [\n {\n name: 'enabled',\n type: 'checkbox',\n defaultValue: true,\n label: 'Enabled',\n },\n {\n name: 'apiKey',\n type: 'text',\n admin: {\n components: {\n Field: '@ai-stack/payloadcms/ui/EncryptedTextField/index.js#EncryptedTextField',\n },\n description:\n 'Your ElevenLabs API key. Will be encrypted in the database. Get yours at elevenlabs.io',\n },\n label: 'API Key',\n required: true,\n },\n ],\n label: 'Setup',\n },\n\n // 2. Connection tab\n {\n fields: [\n {\n type: 'collapsible',\n admin: {\n initCollapsed: false,\n },\n fields: [\n {\n name: 'baseURL',\n type: 'text',\n admin: {\n description:\n 'Optional. Override default API endpoint (defaults to https://api.elevenlabs.io/v1).',\n },\n defaultValue: 'https://api.elevenlabs.io/v1',\n label: 'Base URL',\n },\n {\n name: 'headers',\n type: 'array',\n admin: {\n description: 'Optional. Custom headers to send with every request.',\n },\n fields: [\n {\n type: 'row',\n fields: [\n {\n name: 'key',\n type: 'text',\n admin: {\n width: '50%',\n },\n label: 'Header Name',\n required: true,\n },\n {\n name: 'value',\n type: 'text',\n admin: {\n width: '50%',\n },\n label: 'Header Value',\n required: true,\n },\n ],\n },\n ],\n label: 'Custom Headers',\n },\n ],\n label: 'API & Network Settings',\n },\n ],\n label: 'Connection',\n },\n\n // 3. Voices tab (Existing)\n {\n fields: [\n {\n name: 'voicesFetcherUI',\n type: 'ui',\n admin: {\n components: {\n Field: '@ai-stack/payloadcms/ui/VoicesFetcher/index.js#VoicesFetcher',\n },\n },\n },\n {\n name: 'voices',\n type: 'array',\n admin: {\n description:\n 'Use the \"Fetch Voices\" button above to populate this list from your ElevenLabs account.',\n initCollapsed: true,\n },\n fields: [\n {\n type: 'row',\n fields: [\n {\n name: 'id',\n type: 'text',\n admin: {\n description: 'Voice ID from ElevenLabs',\n width: '40%',\n },\n label: 'Voice ID',\n required: true,\n },\n {\n name: 'name',\n type: 'text',\n admin: {\n width: '40%',\n },\n label: 'Display Name',\n required: true,\n },\n {\n name: 'enabled',\n type: 'checkbox',\n admin: {\n width: '20%',\n },\n defaultValue: true,\n label: 'Enabled',\n },\n ],\n },\n {\n type: 'row',\n fields: [\n {\n name: 'category',\n type: 'select',\n admin: {\n width: '50%',\n },\n dbName: 'eleven-voice-category',\n label: 'Category',\n options: [\n { label: 'Premade', value: 'premade' },\n { label: 'Cloned', value: 'cloned' },\n { label: 'Professional', value: 'professional' },\n { label: 'Generated', value: 'generated' },\n ],\n },\n {\n name: 'preview_url',\n type: 'text',\n admin: {\n width: '50%',\n },\n label: 'Preview URL',\n },\n ],\n },\n {\n name: 'labels',\n type: 'json',\n admin: {\n description:\n 'Voice attributes like gender, age, accent (JSON object). Example: {\"gender\": \"female\", \"age\": \"young\", \"accent\": \"american\"}',\n },\n label: 'Labels',\n },\n ],\n label: 'Available Voices',\n },\n ],\n label: 'Voices',\n },\n\n\n\n // 5. Models (SIMPLIFIED - no per-model settings)\n {\n fields: [\n {\n name: 'models',\n type: 'array',\n admin: {\n components: {\n RowLabel: '@ai-stack/payloadcms/ui/ModelRowLabel/index.js#ModelRowLabel',\n },\n description:\n 'Configure TTS models. Use the Voices and Provider Options tabs for detailed settings.',\n initCollapsed: true,\n },\n defaultValue: [\n {\n id: 'eleven_flash_v2_5',\n name: 'Flash V2.5 (Fastest)',\n enabled: true,\n responseModalities: ['AUDIO'],\n useCase: 'tts',\n },\n {\n id: 'eleven_turbo_v2_5',\n name: 'Turbo V2.5 (Latest)',\n enabled: true,\n responseModalities: ['AUDIO'],\n useCase: 'tts',\n },\n {\n id: 'eleven_multilingual_v2',\n name: 'Multilingual V2',\n enabled: true,\n responseModalities: ['AUDIO'],\n useCase: 'tts',\n },\n {\n id: 'eleven_turbo_v2',\n name: 'Turbo V2',\n enabled: false,\n responseModalities: ['AUDIO'],\n useCase: 'tts',\n },\n ],\n fields: [\n // Basic info\n {\n type: 'row',\n fields: [\n {\n name: 'id',\n type: 'text',\n admin: {\n description: 'Model ID (e.g., eleven_flash_v2_5)',\n width: '50%',\n },\n label: 'Model ID',\n required: true,\n },\n {\n name: 'name',\n type: 'text',\n admin: {\n width: '50%',\n },\n label: 'Display Name',\n required: true,\n },\n ],\n },\n {\n type: 'row',\n fields: [\n {\n name: 'useCase',\n type: 'select',\n admin: {\n width: '33%',\n },\n dbName: 'eleven-model-useCase',\n defaultValue: 'tts',\n label: 'Use Case',\n options: [{ label: 'Text-to-Speech', value: 'tts' }],\n },\n {\n name: 'responseModalities',\n type: 'select',\n admin: {\n description: 'Output capabilities of this model',\n width: '33%',\n },\n dbName: 'eleven-model-modalities',\n hasMany: true,\n label: 'Response Modalities',\n options: [\n { label: 'Text', value: 'TEXT' },\n { label: 'Audio', value: 'AUDIO' },\n ],\n },\n {\n name: 'enabled',\n type: 'checkbox',\n admin: {\n width: '33%',\n },\n defaultValue: true,\n label: 'Enabled',\n },\n ],\n },\n ],\n label: 'Available Models',\n labels: {\n plural: 'Models',\n singular: 'Model',\n },\n },\n ],\n label: 'Models',\n },\n ],\n },\n ],\n imageURL: ElevenLabsIcon,\n labels: {\n plural: 'ElevenLabs Providers',\n singular: 'ElevenLabs',\n },\n}\n"],"names":["ElevenLabsIcon","elevenlabsBlock","slug","fields","type","tabs","name","defaultValue","label","admin","components","Field","description","required","initCollapsed","width","dbName","options","value","RowLabel","id","enabled","responseModalities","useCase","hasMany","labels","plural","singular","imageURL"],"mappings":"AAEA,SAASA,cAAc,QAAQ,cAAa;AAE5C,OA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,SAAS;oCACTC,oBAAoB;wCAAC;qCAAQ;oCAC7BC,SAAS;gCACX;gCACA;oCACEH,IAAI;oCACJd,MAAM;oCACNe,SAAS;oCACTC,oBAAoB;wCAAC;qCAAQ;oCAC7BC,SAAS;gCACX;6BACD;4BACDpB,QAAQ;gCACN,aAAa;gCACb;oCACEC,MAAM;oCACND,QAAQ;wCACN;4CACEG,MAAM;4CACNF,MAAM;4CACNK,OAAO;gDACLG,aAAa;gDACbG,OAAO;4CACT;4CACAP,OAAO;4CACPK,UAAU;wCACZ;wCACA;4CACEP,MAAM;4CACNF,MAAM;4CACNK,OAAO;gDACLM,OAAO;4CACT;4CACAP,OAAO;4CACPK,UAAU;wCACZ;qCACD;gCACH;gCACA;oCACET,MAAM;oCACND,QAAQ;wCACN;4CACEG,MAAM;4CACNF,MAAM;4CACNK,OAAO;gDACLM,OAAO;4CACT;4CACAC,QAAQ;4CACRT,cAAc;4CACdC,OAAO;4CACPS,SAAS;gDAAC;oDAAET,OAAO;oDAAkBU,OAAO;gDAAM;6CAAE;wCACtD;wCACA;4CACEZ,MAAM;4CACNF,MAAM;4CACNK,OAAO;gDACLG,aAAa;gDACbG,OAAO;4CACT;4CACAC,QAAQ;4CACRQ,SAAS;4CACThB,OAAO;4CACPS,SAAS;gDACP;oDAAET,OAAO;oDAAQU,OAAO;gDAAO;gDAC/B;oDAAEV,OAAO;oDAASU,OAAO;gDAAQ;6CAClC;wCACH;wCACA;4CACEZ,MAAM;4CACNF,MAAM;4CACNK,OAAO;gDACLM,OAAO;4CACT;4CACAR,cAAc;4CACdC,OAAO;wCACT;qCACD;gCACH;6BACD;4BACDA,OAAO;4BACPiB,QAAQ;gCACNC,QAAQ;gCACRC,UAAU;4BACZ;wBACF;qBACD;oBACDnB,OAAO;gBACT;aACD;QACH;KACD;IACDoB,UAAU5B;IACVyB,QAAQ;QACNC,QAAQ;QACRC,UAAU;IACZ;AACF,EAAC"}
@@ -19,7 +19,7 @@ export const falBlock = {
19
19
  type: 'text',
20
20
  admin: {
21
21
  components: {
22
- Field: '@ai-stack/payloadcms/client#EncryptedTextField'
22
+ Field: '@ai-stack/payloadcms/ui/EncryptedTextField/index.js#EncryptedTextField'
23
23
  },
24
24
  description: 'Your Fal API key. Will be encrypted in the database.'
25
25
  },
@@ -45,7 +45,7 @@ export const falBlock = {
45
45
  type: 'array',
46
46
  admin: {
47
47
  components: {
48
- RowLabel: '@ai-stack/payloadcms/client#ModelRowLabel'
48
+ RowLabel: '@ai-stack/payloadcms/ui/ModelRowLabel/index.js#ModelRowLabel'
49
49
  },
50
50
  initCollapsed: true
51
51
  },
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/ai/providers/blocks/fal.ts"],"sourcesContent":["import type { Block } from 'payload'\n\nimport { FalIcon } from '../icons.js'\n\nexport const falBlock: Block = {\n slug: 'fal',\n fields: [\n {\n type: 'tabs',\n tabs: [\n // 1. Setup tab\n {\n fields: [\n {\n name: 'enabled',\n type: 'checkbox',\n defaultValue: true,\n label: 'Enabled',\n },\n {\n name: 'apiKey',\n type: 'text',\n admin: {\n components: {\n Field: '@ai-stack/payloadcms/client#EncryptedTextField',\n },\n description: 'Your Fal API key. Will be encrypted in the database.',\n },\n label: 'API Key',\n required: true,\n },\n {\n name: 'webhookSecret',\n type: 'text',\n admin: {\n description: 'Secret for webhook verification (optional)',\n },\n label: 'Webhook Secret',\n },\n ],\n label: 'Setup',\n },\n\n // 3. Models tab\n {\n fields: [\n {\n name: 'models',\n type: 'array',\n admin: {\n components: {\n RowLabel: '@ai-stack/payloadcms/client#ModelRowLabel',\n },\n initCollapsed: true,\n },\n defaultValue: [\n { id: 'fal-ai/flux-pro', name: 'Flux Pro', enabled: true, useCase: 'image' },\n { id: 'fal-ai/flux/dev', name: 'Flux Dev', enabled: true, useCase: 'image' },\n { id: 'fal-ai/flux/schnell', name: 'Flux Schnell', enabled: true, useCase: 'image' },\n { id: 'fal-ai/flux-realism', name: 'Flux Realism', enabled: true, useCase: 'image' },\n { id: 'fal-ai/minimax-video', name: 'Minimax Video', enabled: true, useCase: 'video' },\n { id: 'fal-ai/hunyuan-video', name: 'Hunyuan Video', enabled: true, useCase: 'video' },\n {\n id: 'fal-ai/luma-dream-machine',\n name: 'Luma Dream Machine',\n enabled: true,\n useCase: 'video',\n },\n ],\n fields: [\n {\n type: 'row',\n fields: [\n {\n name: 'id',\n type: 'text',\n admin: { width: '33%' },\n label: 'Model ID',\n required: true,\n },\n {\n name: 'name',\n type: 'text',\n admin: { width: '33%' },\n label: 'Display Name',\n required: true,\n },\n {\n name: 'useCase',\n type: 'select',\n admin: { width: '33%' },\n dbName: 'fal-model-useCase',\n label: 'Use Case',\n options: [\n { label: 'Image Generation', value: 'image' },\n { label: 'Video Generation', value: 'video' },\n ],\n required: true,\n },\n ],\n },\n {\n name: 'enabled',\n type: 'checkbox',\n admin: {\n width: '50%',\n },\n defaultValue: true,\n label: 'Enabled',\n },\n {\n name: 'responseModalities',\n type: 'select',\n admin: {\n description: 'Output capabilities of this model',\n width: '50%',\n },\n dbName: 'fal-model-modalities',\n hasMany: true,\n label: 'Response Modalities',\n options: [\n { label: 'Text', value: 'TEXT' },\n { label: 'Image', value: 'IMAGE' },\n { label: 'Audio', value: 'AUDIO' },\n { label: 'Video', value: 'VIDEO' },\n ],\n },\n ],\n label: 'Available Models',\n },\n ],\n label: 'Models',\n },\n ],\n },\n ],\n imageURL: FalIcon,\n labels: {\n plural: 'Fal Providers',\n singular: 'Fal AI',\n },\n}\n"],"names":["FalIcon","falBlock","slug","fields","type","tabs","name","defaultValue","label","admin","components","Field","description","required","RowLabel","initCollapsed","id","enabled","useCase","width","dbName","options","value","hasMany","imageURL","labels","plural","singular"],"mappings":"AAEA,SAASA,OAAO,QAAQ,cAAa;AAErC,OAAO,MAAMC,WAAkB;IAC7BC,MAAM;IACNC,QAAQ;QACN;YACEC,MAAM;YACNC,MAAM;gBACJ,eAAe;gBACf;oBACEF,QAAQ;wBACN;4BACEG,MAAM;4BACNF,MAAM;4B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;4CACNK,OAAO;gDAAEU,OAAO;4CAAM;4CACtBC,QAAQ;4CACRZ,OAAO;4CACPa,SAAS;gDACP;oDAAEb,OAAO;oDAAoBc,OAAO;gDAAQ;gDAC5C;oDAAEd,OAAO;oDAAoBc,OAAO;gDAAQ;6CAC7C;4CACDT,UAAU;wCACZ;qCACD;gCACH;gCACA;oCACEP,MAAM;oCACNF,MAAM;oCACNK,OAAO;wCACLU,OAAO;oCACT;oCACAZ,cAAc;oCACdC,OAAO;gCACT;gCACA;oCACEF,MAAM;oCACNF,MAAM;oCACNK,OAAO;wCACLG,aAAa;wCACbO,OAAO;oCACT;oCACAC,QAAQ;oCACRG,SAAS;oCACTf,OAAO;oCACPa,SAAS;wCACP;4CAAEb,OAAO;4CAAQc,OAAO;wCAAO;wCAC/B;4CAAEd,OAAO;4CAASc,OAAO;wCAAQ;wCACjC;4CAAEd,OAAO;4CAASc,OAAO;wCAAQ;wCACjC;4CAAEd,OAAO;4CAASc,OAAO;wCAAQ;qCAClC;gCACH;6BACD;4BACDd,OAAO;wBACT;qBACD;oBACDA,OAAO;gBACT;aACD;QACH;KACD;IACDgB,UAAUxB;IACVyB,QAAQ;QACNC,QAAQ;QACRC,UAAU;IACZ;AACF,EAAC"}
1
+ {"version":3,"sources":["../../../../src/ai/providers/blocks/fal.ts"],"sourcesContent":["import type { Block } from 'payload'\n\nimport { FalIcon } from '../icons.js'\n\nexport const falBlock: Block = {\n slug: 'fal',\n fields: [\n {\n type: 'tabs',\n tabs: [\n // 1. Setup tab\n {\n fields: [\n {\n name: 'enabled',\n type: 'checkbox',\n defaultValue: true,\n label: 'Enabled',\n },\n {\n name: 'apiKey',\n type: 'text',\n admin: {\n components: {\n Field: '@ai-stack/payloadcms/ui/EncryptedTextField/index.js#EncryptedTextField',\n },\n description: 'Your Fal API key. Will be encrypted in the database.',\n },\n label: 'API Key',\n required: true,\n },\n {\n name: 'webhookSecret',\n type: 'text',\n admin: {\n description: 'Secret for webhook verification (optional)',\n },\n label: 'Webhook Secret',\n },\n ],\n label: 'Setup',\n },\n\n // 3. Models tab\n {\n fields: [\n {\n name: 'models',\n type: 'array',\n admin: {\n components: {\n RowLabel: '@ai-stack/payloadcms/ui/ModelRowLabel/index.js#ModelRowLabel',\n },\n initCollapsed: true,\n },\n defaultValue: [\n { id: 'fal-ai/flux-pro', name: 'Flux Pro', enabled: true, useCase: 'image' },\n { id: 'fal-ai/flux/dev', name: 'Flux Dev', enabled: true, useCase: 'image' },\n { id: 'fal-ai/flux/schnell', name: 'Flux Schnell', enabled: true, useCase: 'image' },\n { id: 'fal-ai/flux-realism', name: 'Flux Realism', enabled: true, useCase: 'image' },\n { id: 'fal-ai/minimax-video', name: 'Minimax Video', enabled: true, useCase: 'video' },\n { id: 'fal-ai/hunyuan-video', name: 'Hunyuan Video', enabled: true, useCase: 'video' },\n {\n id: 'fal-ai/luma-dream-machine',\n name: 'Luma Dream Machine',\n enabled: true,\n useCase: 'video',\n },\n ],\n fields: [\n {\n type: 'row',\n fields: [\n {\n name: 'id',\n type: 'text',\n admin: { width: '33%' },\n label: 'Model ID',\n required: true,\n },\n {\n name: 'name',\n type: 'text',\n admin: { width: '33%' },\n label: 'Display Name',\n required: true,\n },\n {\n name: 'useCase',\n type: 'select',\n admin: { width: '33%' },\n dbName: 'fal-model-useCase',\n label: 'Use Case',\n options: [\n { label: 'Image Generation', value: 'image' },\n { label: 'Video Generation', value: 'video' },\n ],\n required: true,\n },\n ],\n },\n {\n name: 'enabled',\n type: 'checkbox',\n admin: {\n width: '50%',\n },\n defaultValue: true,\n label: 'Enabled',\n },\n {\n name: 'responseModalities',\n type: 'select',\n admin: {\n description: 'Output capabilities of this model',\n width: '50%',\n },\n dbName: 'fal-model-modalities',\n hasMany: true,\n label: 'Response Modalities',\n options: [\n { label: 'Text', value: 'TEXT' },\n { label: 'Image', value: 'IMAGE' },\n { label: 'Audio', value: 'AUDIO' },\n { label: 'Video', value: 'VIDEO' },\n ],\n },\n ],\n label: 'Available Models',\n },\n ],\n label: 'Models',\n },\n ],\n },\n ],\n imageURL: FalIcon,\n labels: {\n plural: 'Fal Providers',\n singular: 'Fal AI',\n },\n}\n"],"names":["FalIcon","falBlock","slug","fields","type","tabs","name","defaultValue","label","admin","components","Field","description","required","RowLabel","initCollapsed","id","enabled","useCase","width","dbName","options","value","hasMany","imageURL","labels","plural","singular"],"mappings":"AAEA,SAASA,OAAO,QAAQ,cAAa;AAErC,OAAO,MAAMC,WAAkB;IAC7BC,MAAM;IACNC,QAAQ;QACN;YACEC,MAAM;YACNC,MAAM;gBACJ,eAAe;gBACf;oBACEF,QAAQ;wBACN;4BACEG,MAAM;4BACNF,MAAM;4BACNG,cAAc;4BACdC,OAAO;wBACT;wBACA;4BACEF,MAAM;4BACNF,MAAM;4BACNK,OAAO;gCACLC,YAAY;oCACVC,OAAO;gCACT;gCACAC,aAAa;4BACf;4BACAJ,OAAO;4BACPK,UAAU;wBACZ;wBACA;4BACEP,MAAM;4BACNF,MAAM;4BACNK,OAAO;gCACLG,aAAa;4BACf;4BACAJ,OAAO;wBACT;qBACD;oBACDA,OAAO;gBACT;gBAEA,gBAAgB;gBAChB;oBACEL,QAAQ;wBACN;4BACEG,MAAM;4BACNF,MAAM;4BACNK,OAAO;gCACLC,YAAY;oCACVI,UAAU;gCACZ;gCACAC,eAAe;4BACjB;4BACAR,cAAc;gCACZ;oCAAES,IAAI;oCAAmBV,MAAM;oCAAYW,SAAS;oCAAMC,SAAS;gCAAQ;gCAC3E;oCAAEF,IAAI;oCAAmBV,MAAM;oCAAYW,SAAS;oCAAMC,SAAS;gCAAQ;gCAC3E;oCAAEF,IAAI;oCAAuBV,MAAM;oCAAgBW,SAAS;oCAAMC,SAAS;gCAAQ;gCACnF;oCAAEF,IAAI;oCAAuBV,MAAM;oCAAgBW,SAAS;oCAAMC,SAAS;gCAAQ;gCACnF;oCAAEF,IAAI;oCAAwBV,MAAM;oCAAiBW,SAAS;oCAAMC,SAAS;gCAAQ;gCACrF;oCAAEF,IAA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admin: {
21
21
  components: {
22
- Field: '@ai-stack/payloadcms/client#EncryptedTextField'
22
+ Field: '@ai-stack/payloadcms/ui/EncryptedTextField/index.js#EncryptedTextField'
23
23
  },
24
24
  description: 'Optional. If empty, @ai-sdk/google will use the GOOGLE_GENERATIVE_AI_API_KEY environment variable.'
25
25
  },
@@ -180,7 +180,7 @@ export const googleBlock = {
180
180
  type: 'array',
181
181
  admin: {
182
182
  components: {
183
- RowLabel: '@ai-stack/payloadcms/client#ModelRowLabel'
183
+ RowLabel: '@ai-stack/payloadcms/ui/ModelRowLabel/index.js#ModelRowLabel'
184
184
  },
185
185
  description: 'Keep this list short. Enable only the models you actually use.',
186
186
  initCollapsed: true
@@ -238,7 +238,8 @@ export const googleBlock = {
238
238
  name: 'Gemini 2.5 Flash Image',
239
239
  enabled: true,
240
240
  responseModalities: [
241
- 'IMAGE'
241
+ 'IMAGE',
242
+ 'TEXT'
242
243
  ],
243
244
  useCase: 'image'
244
245
  },
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/ai/providers/blocks/google.ts"],"sourcesContent":["import type { Block } from 'payload'\n\nimport { GoogleIcon } from '../icons.js'\n\nexport const googleBlock: Block = {\n slug: 'google',\n\n fields: [\n {\n type: 'tabs',\n tabs: [\n // 1. Setup tab\n {\n fields: [\n {\n name: 'enabled',\n type: 'checkbox',\n defaultValue: true,\n label: 'Enabled',\n },\n {\n name: 'apiKey',\n type: 'text',\n admin: {\n components: {\n Field: '@ai-stack/payloadcms/client#EncryptedTextField',\n },\n description:\n 'Optional. If empty, @ai-sdk/google will use the GOOGLE_GENERATIVE_AI_API_KEY environment variable.',\n },\n label: 'API Key',\n required: false,\n },\n ],\n label: 'Setup',\n },\n\n // 2. Connection tab\n {\n fields: [\n {\n type: 'collapsible',\n admin: {\n initCollapsed: false,\n },\n fields: [\n {\n type: 'row',\n fields: [\n {\n name: 'baseURL',\n type: 'text',\n admin: {\n description:\n 'Optional. Override default API endpoint (defaults to https://generativelanguage.googleapis.com/v1beta).',\n },\n label: 'Base URL',\n },\n ],\n },\n {\n name: 'headers',\n type: 'array',\n admin: {\n description:\n 'Optional. Extra headers to send with every request, for example routing through a proxy.',\n },\n fields: [\n {\n type: 'row',\n fields: [\n {\n name: 'key',\n type: 'text',\n admin: {\n width: '50%',\n },\n label: 'Header Name',\n required: true,\n },\n {\n name: 'value',\n type: 'text',\n admin: {\n width: '50%',\n },\n label: 'Header Value',\n required: true,\n },\n ],\n },\n ],\n label: 'Custom Headers',\n },\n ],\n label: 'API & Network Settings',\n },\n ],\n label: 'Connection',\n },\n\n // 3. Voices tab (NEW)\n {\n fields: [\n {\n name: 'voices',\n type: 'array',\n admin: {\n description: 'Available voices for Gemini TTS models.',\n initCollapsed: false,\n },\n defaultValue: [\n { id: 'Puck', name: 'Puck (Upbeat)', enabled: true },\n { id: 'Charon', name: 'Charon (Informative)', enabled: true },\n { id: 'Kore', name: 'Kore (Firm)', enabled: true },\n { id: 'Fenrir', name: 'Fenrir (Excitable)', enabled: true },\n { id: 'Aoede', name: 'Aoede (Breezy)', enabled: true },\n { id: 'Zephyr', name: 'Zephyr (Bright)', enabled: true },\n ],\n fields: [\n {\n type: 'row',\n fields: [\n {\n name: 'id',\n type: 'text',\n admin: {\n description: 'Voice ID used by Google API',\n width: '40%',\n },\n label: 'Voice ID',\n required: true,\n },\n {\n name: 'name',\n type: 'text',\n admin: {\n width: '40%',\n },\n label: 'Display Name',\n required: true,\n },\n {\n name: 'enabled',\n type: 'checkbox',\n admin: {\n width: '20%',\n },\n defaultValue: true,\n label: 'Enabled',\n },\n ],\n },\n ],\n label: 'Available Voices',\n },\n ],\n label: 'Voices',\n },\n\n\n\n // 5. Models tab (Simplified)\n {\n fields: [\n {\n name: 'models',\n type: 'array',\n admin: {\n components: {\n RowLabel: '@ai-stack/payloadcms/client#ModelRowLabel',\n },\n description: 'Keep this list short. Enable only the models you actually use.',\n initCollapsed: true,\n },\n defaultValue: [\n // Text models\n {\n id: 'gemini-3-pro-preview',\n name: 'Gemini 3.0 Pro (Preview)',\n enabled: true,\n responseModalities: ['TEXT'],\n useCase: 'text',\n },\n {\n id: 'gemini-2.5-pro',\n name: 'Gemini 2.5 Pro',\n enabled: true,\n responseModalities: ['TEXT'],\n useCase: 'text',\n },\n {\n id: 'gemini-2.5-flash',\n name: 'Gemini 2.5 Flash',\n enabled: true,\n responseModalities: ['TEXT'],\n useCase: 'text',\n },\n {\n id: 'gemini-1.5-pro-latest',\n name: 'Gemini 1.5 Pro (Latest)',\n enabled: true,\n responseModalities: ['TEXT'],\n useCase: 'text',\n },\n {\n id: 'gemini-1.5-flash-latest',\n name: 'Gemini 1.5 Flash (Latest)',\n enabled: true,\n responseModalities: ['TEXT'],\n useCase: 'text',\n },\n\n // Image models\n {\n id: 'gemini-2.5-flash-image',\n name: 'Gemini 2.5 Flash Image',\n enabled: true,\n responseModalities: ['IMAGE'],\n useCase: 'image',\n },\n {\n id: 'imagen-4.0-generate-001',\n name: 'Imagen 4',\n enabled: true,\n // TODO: fix this with proper definition for multimodel or image model only\n responseModalities: ['IMAGE'],\n useCase: 'image',\n },\n {\n id: 'gemini-3-pro-image-preview',\n name: 'Gemini 3.0 Pro Image (Preview)',\n enabled: true,\n responseModalities: ['IMAGE', 'TEXT'],\n useCase: 'image',\n },\n\n // TTS Models\n {\n id: 'gemini-2.5-pro-preview-tts',\n name: 'Gemini 2.5 Pro TTS (Preview)',\n enabled: true,\n responseModalities: ['AUDIO'],\n useCase: 'tts',\n },\n {\n id: 'gemini-2.5-flash-preview-tts',\n name: 'Gemini 2.5 Flash TTS (Preview)',\n enabled: true,\n responseModalities: ['AUDIO'],\n useCase: 'tts',\n },\n ],\n fields: [\n // Basic model info\n {\n type: 'row',\n fields: [\n {\n name: 'id',\n type: 'text',\n admin: {\n description: 'Exact model id as used with @ai-sdk/google.',\n width: '33%',\n },\n label: 'Model ID',\n required: true,\n },\n {\n name: 'name',\n type: 'text',\n admin: {\n width: '33%',\n },\n label: 'Display Name',\n required: true,\n },\n {\n name: 'useCase',\n type: 'select',\n admin: {\n width: '33%',\n },\n dbName: 'google-model-useCase',\n defaultValue: 'text',\n label: 'Use Case',\n options: [\n { label: 'Text', value: 'text' },\n { label: 'Image Generation', value: 'image' },\n { label: 'Text-to-Speech', value: 'tts' },\n { label: 'Embeddings', value: 'embedding' },\n ],\n },\n ],\n },\n {\n name: 'responseModalities',\n type: 'select',\n admin: {\n description: 'Output capabilities of this model',\n width: '50%',\n },\n dbName: 'google-model-modalities',\n hasMany: true,\n label: 'Response Modalities',\n options: [\n { label: 'Text', value: 'TEXT' },\n { label: 'Image', value: 'IMAGE' },\n { label: 'Audio', value: 'AUDIO' },\n ],\n },\n {\n name: 'enabled',\n type: 'checkbox',\n admin: {\n width: '50%',\n },\n defaultValue: true,\n label: 'Enabled',\n },\n ],\n label: 'Available Models',\n labels: {\n plural: 'Models',\n singular: 'Model',\n },\n },\n ],\n label: 'Models',\n },\n ],\n },\n ],\n imageURL: GoogleIcon,\n labels: {\n plural: 'Google Providers',\n singular: 'Google Gemini',\n },\n}\n"],"names":["GoogleIcon","googleBlock","slug","fields","type","tabs","name","defaultValue","label","admin","components","Field","description","required","initCollapsed","width","id","enabled","RowLabel","responseModalities","useCase","dbName","options","value","hasMany","labels","plural","singular","imageURL"],"mappings":"AAEA,SAASA,UAAU,QAAQ,cAAa;AAExC,OAAO,MAAMC,cAAqB;IAChCC,MAAM;IAENC,QAAQ;QACN;YACEC,MAAM;YACNC,MAAM;gBACJ,eAAe;gBACf;oBACEF,QAAQ;wBACN;4BACEG,MAAM;4BACNF,MAAM;4BACNG,cAAc;4BACdC,OAAO;wBACT;wBACA;4BACEF,MAAM;4BACNF,MAAM;4BACNK,OAAO;gCACLC,YAAY;oCACVC,OAAO;gCACT;gCACAC,aACE;4BACJ;4BACAJ,OAAO;4BACPK,UAAU;wBACZ;qBACD;oBACDL,OAAO;gBACT;gBAEA,oBAAoB;gBACpB;oBACEL,QAAQ;wBACN;4BACEC,MAAM;4BACNK,OA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;gCACNC,QAAQ;gCACRC,UAAU;4BACZ;wBACF;qBACD;oBACDnB,OAAO;gBACT;aACD;QACH;KACD;IACDoB,UAAU5B;IACVyB,QAAQ;QACNC,QAAQ;QACRC,UAAU;IACZ;AACF,EAAC"}
1
+ {"version":3,"sources":["../../../../src/ai/providers/blocks/google.ts"],"sourcesContent":["import type { Block } from 'payload'\n\nimport { GoogleIcon } from '../icons.js'\n\nexport const googleBlock: Block = {\n slug: 'google',\n\n fields: [\n {\n type: 'tabs',\n tabs: [\n // 1. Setup tab\n {\n fields: [\n {\n name: 'enabled',\n type: 'checkbox',\n defaultValue: true,\n label: 'Enabled',\n },\n {\n name: 'apiKey',\n type: 'text',\n admin: {\n components: {\n Field: '@ai-stack/payloadcms/ui/EncryptedTextField/index.js#EncryptedTextField',\n },\n description:\n 'Optional. If empty, @ai-sdk/google will use the GOOGLE_GENERATIVE_AI_API_KEY environment variable.',\n },\n label: 'API Key',\n required: false,\n },\n ],\n label: 'Setup',\n },\n\n // 2. Connection tab\n {\n fields: [\n {\n type: 'collapsible',\n admin: {\n initCollapsed: false,\n },\n fields: [\n {\n type: 'row',\n fields: [\n {\n name: 'baseURL',\n type: 'text',\n admin: {\n description:\n 'Optional. Override default API endpoint (defaults to https://generativelanguage.googleapis.com/v1beta).',\n },\n label: 'Base URL',\n },\n ],\n },\n {\n name: 'headers',\n type: 'array',\n admin: {\n description:\n 'Optional. Extra headers to send with every request, for example routing through a proxy.',\n },\n fields: [\n {\n type: 'row',\n fields: [\n {\n name: 'key',\n type: 'text',\n admin: {\n width: '50%',\n },\n label: 'Header Name',\n required: true,\n },\n {\n name: 'value',\n type: 'text',\n admin: {\n width: '50%',\n },\n label: 'Header Value',\n required: true,\n },\n ],\n },\n ],\n label: 'Custom Headers',\n },\n ],\n label: 'API & Network Settings',\n },\n ],\n label: 'Connection',\n },\n\n // 3. Voices tab (NEW)\n {\n fields: [\n {\n name: 'voices',\n type: 'array',\n admin: {\n description: 'Available voices for Gemini TTS models.',\n initCollapsed: false,\n },\n defaultValue: [\n { id: 'Puck', name: 'Puck (Upbeat)', enabled: true },\n { id: 'Charon', name: 'Charon (Informative)', enabled: true },\n { id: 'Kore', name: 'Kore (Firm)', enabled: true },\n { id: 'Fenrir', name: 'Fenrir (Excitable)', enabled: true },\n { id: 'Aoede', name: 'Aoede (Breezy)', enabled: true },\n { id: 'Zephyr', name: 'Zephyr (Bright)', enabled: true },\n ],\n fields: [\n {\n type: 'row',\n fields: [\n {\n name: 'id',\n type: 'text',\n admin: {\n description: 'Voice ID used by Google API',\n width: '40%',\n },\n label: 'Voice ID',\n required: true,\n },\n {\n name: 'name',\n type: 'text',\n admin: {\n width: '40%',\n },\n label: 'Display Name',\n required: true,\n },\n {\n name: 'enabled',\n type: 'checkbox',\n admin: {\n width: '20%',\n },\n defaultValue: true,\n label: 'Enabled',\n },\n ],\n },\n ],\n label: 'Available Voices',\n },\n ],\n label: 'Voices',\n },\n\n\n\n // 5. Models tab (Simplified)\n {\n fields: [\n {\n name: 'models',\n type: 'array',\n admin: {\n components: {\n RowLabel: '@ai-stack/payloadcms/ui/ModelRowLabel/index.js#ModelRowLabel',\n },\n description: 'Keep this list short. Enable only the models you actually use.',\n initCollapsed: true,\n },\n defaultValue: [\n // Text models\n {\n id: 'gemini-3-pro-preview',\n name: 'Gemini 3.0 Pro (Preview)',\n enabled: true,\n responseModalities: ['TEXT'],\n useCase: 'text',\n },\n {\n id: 'gemini-2.5-pro',\n name: 'Gemini 2.5 Pro',\n enabled: true,\n responseModalities: ['TEXT'],\n useCase: 'text',\n },\n {\n id: 'gemini-2.5-flash',\n name: 'Gemini 2.5 Flash',\n enabled: true,\n responseModalities: ['TEXT'],\n useCase: 'text',\n },\n {\n id: 'gemini-1.5-pro-latest',\n name: 'Gemini 1.5 Pro (Latest)',\n enabled: true,\n responseModalities: ['TEXT'],\n useCase: 'text',\n },\n {\n id: 'gemini-1.5-flash-latest',\n name: 'Gemini 1.5 Flash (Latest)',\n enabled: true,\n responseModalities: ['TEXT'],\n useCase: 'text',\n },\n\n // Image models\n {\n id: 'gemini-2.5-flash-image',\n name: 'Gemini 2.5 Flash Image',\n enabled: true,\n responseModalities: ['IMAGE', 'TEXT'],\n useCase: 'image',\n },\n {\n id: 'imagen-4.0-generate-001',\n name: 'Imagen 4',\n enabled: true,\n // TODO: fix this with proper definition for multimodel or image model only\n responseModalities: ['IMAGE'],\n useCase: 'image',\n },\n {\n id: 'gemini-3-pro-image-preview',\n name: 'Gemini 3.0 Pro Image (Preview)',\n enabled: true,\n responseModalities: ['IMAGE', 'TEXT'],\n useCase: 'image',\n },\n\n // TTS Models\n {\n id: 'gemini-2.5-pro-preview-tts',\n name: 'Gemini 2.5 Pro TTS (Preview)',\n enabled: true,\n responseModalities: ['AUDIO'],\n useCase: 'tts',\n },\n {\n id: 'gemini-2.5-flash-preview-tts',\n name: 'Gemini 2.5 Flash TTS (Preview)',\n enabled: true,\n responseModalities: ['AUDIO'],\n useCase: 'tts',\n },\n ],\n fields: [\n // Basic model info\n {\n type: 'row',\n fields: [\n {\n name: 'id',\n type: 'text',\n admin: {\n description: 'Exact model id as used with @ai-sdk/google.',\n width: '33%',\n },\n label: 'Model ID',\n required: true,\n },\n {\n name: 'name',\n type: 'text',\n admin: {\n width: '33%',\n },\n label: 'Display Name',\n required: true,\n },\n {\n name: 'useCase',\n type: 'select',\n admin: {\n width: '33%',\n },\n dbName: 'google-model-useCase',\n defaultValue: 'text',\n label: 'Use Case',\n options: [\n { label: 'Text', value: 'text' },\n { label: 'Image Generation', value: 'image' },\n { label: 'Text-to-Speech', value: 'tts' },\n { label: 'Embeddings', value: 'embedding' },\n ],\n },\n ],\n },\n {\n name: 'responseModalities',\n type: 'select',\n admin: {\n description: 'Output capabilities of this model',\n width: '50%',\n },\n dbName: 'google-model-modalities',\n hasMany: true,\n label: 'Response Modalities',\n options: [\n { label: 'Text', value: 'TEXT' },\n { label: 'Image', value: 'IMAGE' },\n { label: 'Audio', value: 'AUDIO' },\n ],\n },\n {\n name: 'enabled',\n type: 'checkbox',\n admin: {\n width: '50%',\n },\n defaultValue: true,\n label: 'Enabled',\n },\n ],\n label: 'Available Models',\n labels: {\n plural: 'Models',\n singular: 'Model',\n },\n },\n ],\n label: 'Models',\n },\n ],\n },\n ],\n imageURL: GoogleIcon,\n labels: {\n plural: 'Google Providers',\n singular: 'Google Gemini',\n },\n}\n"],"names":["GoogleIcon","googleBlock","slug","fields","type","tabs","name","defaultValue","label","admin","components","Field","description","required","initCollapsed","width","id","enabled","RowLabel","responseModalities","useCase","dbName","options","value","hasMany","labels","plural","singular","imageURL"],"mappings":"AAEA,SAASA,UAAU,QAAQ,cAAa;AAExC,OAAO,MAAMC,cAAqB;IAChCC,MAAM;IAENC,QAAQ;QACN;YACEC,MAAM;YACNC,MAAM;gBACJ,eAAe;gBACf;oBACEF,QAAQ;wBACN;4BACEG,MAAM;4BACNF,MAAM;4BACNG,cAAc;4BACdC,OAAO;wBACT;wBACA;4BACEF,MAAM;4BACNF,MAAM;4BACNK,OAAO;gCACLC,YAAY;oCACVC,OAAO;gCACT;gCACAC,aACE;4BACJ;4BACAJ,OAAO;4BACPK,UAAU;wBACZ;qBACD;oBACDL,OAAO;gBACT;gBAEA,oBAAoB;gBACpB;oBACEL,QAAQ;wBACN;4BACEC,MAAM;4BACNK,OAAO;gCACLK,eAAe;4BACjB;4BACAX,QAAQ;gCACN;oCACEC,MAAM;oCACND,QAAQ;wCACN;4CACEG,MAAM;4CACNF,MAAM;4CACNK,OAAO;gDACLG,aACE;4CACJ;4CACAJ,OAAO;wCACT;qCACD;gCACH;gCACA;oCACEF,MAAM;oCACNF,MAAM;oCACNK,OAAO;wCACLG,aACE;oCACJ;oCACAT,QAAQ;wCACN;4CACEC,MAAM;4CACND,QAAQ;gDACN;oDACEG,MAAM;oDACNF,MAAM;oDACNK,OAAO;wDACLM,OAAO;oDACT;oDACAP,OAAO;oDACPK,UAAU;gDACZ;gDACA;oDACEP,MAAM;oDACNF,MAAM;oDAC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ACEP,MAAM;4CACNF,MAAM;4CACNK,OAAO;gDACLM,OAAO;4CACT;4CACAP,OAAO;4CACPK,UAAU;wCACZ;wCACA;4CACEP,MAAM;4CACNF,MAAM;4CACNK,OAAO;gDACLM,OAAO;4CACT;4CACAM,QAAQ;4CACRd,cAAc;4CACdC,OAAO;4CACPc,SAAS;gDACP;oDAAEd,OAAO;oDAAQe,OAAO;gDAAO;gDAC/B;oDAAEf,OAAO;oDAAoBe,OAAO;gDAAQ;gDAC5C;oDAAEf,OAAO;oDAAkBe,OAAO;gDAAM;gDACxC;oDAAEf,OAAO;oDAAce,OAAO;gDAAY;6CAC3C;wCACH;qCACD;gCACH;gCACA;oCACEjB,MAAM;oCACNF,MAAM;oCACNK,OAAO;wCACLG,aAAa;wCACbG,OAAO;oCACT;oCACAM,QAAQ;oCACRG,SAAS;oCACThB,OAAO;oCACPc,SAAS;wCACP;4CAAEd,OAAO;4CAAQe,OAAO;wCAAO;wCAC/B;4CAAEf,OAAO;4CAASe,OAAO;wCAAQ;wCACjC;4CAAEf,OAAO;4CAASe,OAAO;wCAAQ;qCAClC;gCACH;gCACA;oCACEjB,MAAM;oCACNF,MAAM;oCACNK,OAAO;wCACLM,OAAO;oCACT;oCACAR,cAAc;oCACdC,OAAO;gCACT;6BACD;4BACDA,OAAO;4BACPiB,QAAQ;gCACNC,QAAQ;gCACRC,UAAU;4BACZ;wBACF;qBACD;oBACDnB,OAAO;gBACT;aACD;QACH;KACD;IACDoB,UAAU5B;IACVyB,QAAQ;QACNC,QAAQ;QACRC,UAAU;IACZ;AACF,EAAC"}
@@ -28,7 +28,7 @@ export const openaiCompatibleBlock = {
28
28
  type: 'text',
29
29
  admin: {
30
30
  components: {
31
- Field: '@ai-stack/payloadcms/client#EncryptedTextField'
31
+ Field: '@ai-stack/payloadcms/ui/EncryptedTextField/index.js#EncryptedTextField'
32
32
  },
33
33
  description: 'API key for this provider (if required)'
34
34
  },
@@ -55,7 +55,7 @@ export const openaiCompatibleBlock = {
55
55
  type: 'array',
56
56
  admin: {
57
57
  components: {
58
- RowLabel: '@ai-stack/payloadcms/client#ModelRowLabel'
58
+ RowLabel: '@ai-stack/payloadcms/ui/ModelRowLabel/index.js#ModelRowLabel'
59
59
  },
60
60
  initCollapsed: true
61
61
  },
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/ai/providers/blocks/openai-compatible.ts"],"sourcesContent":["import type { Block } from 'payload'\n\nimport { CustomProviderIcon } from '../icons.js'\n\nexport const openaiCompatibleBlock: Block = {\n slug: 'openai-compatible',\n fields: [\n {\n type: 'tabs',\n tabs: [\n // 1. Setup tab\n {\n fields: [\n {\n name: 'providerName',\n type: 'text',\n admin: {\n description: 'Display name for this custom provider (e.g., \"Ollama\", \"Together AI\")',\n },\n label: 'Provider Name',\n required: true,\n },\n {\n name: 'enabled',\n type: 'checkbox',\n defaultValue: true,\n label: 'Enabled',\n },\n {\n name: 'apiKey',\n type: 'text',\n admin: {\n components: {\n Field: '@ai-stack/payloadcms/client#EncryptedTextField',\n },\n description: 'API key for this provider (if required)',\n },\n label: 'API Key',\n required: true,\n },\n {\n name: 'baseURL',\n type: 'text',\n admin: {\n description: 'OpenAI-compatible API endpoint (e.g., http://localhost:11434/v1)',\n },\n label: 'API Base URL',\n required: true,\n },\n ],\n label: 'Setup',\n },\n\n // 3. Models tab\n {\n fields: [\n {\n name: 'models',\n type: 'array',\n admin: {\n components: {\n RowLabel: '@ai-stack/payloadcms/client#ModelRowLabel',\n },\n initCollapsed: true,\n },\n fields: [\n {\n type: 'row',\n fields: [\n {\n name: 'id',\n type: 'text',\n admin: { width: '33%' },\n label: 'Model ID',\n required: true,\n },\n {\n name: 'name',\n type: 'text',\n admin: { width: '33%' },\n label: 'Display Name',\n required: true,\n },\n {\n name: 'useCase',\n type: 'select',\n admin: { width: '33%' },\n dbName: 'compat-model-useCase',\n label: 'Use Case',\n options: [\n { label: 'Text Generation', value: 'text' },\n { label: 'Image Generation', value: 'image' },\n { label: 'Video Generation', value: 'video' },\n { label: 'Text-to-Speech', value: 'tts' },\n ],\n required: true,\n },\n ],\n },\n {\n name: 'enabled',\n type: 'checkbox',\n admin: {\n width: '50%',\n },\n defaultValue: true,\n label: 'Enabled',\n },\n {\n name: 'responseModalities',\n type: 'select',\n admin: {\n description: 'Output capabilities of this model',\n width: '50%',\n },\n dbName: 'compat-model-modalities',\n hasMany: true,\n label: 'Response Modalities',\n options: [\n { label: 'Text', value: 'TEXT' },\n { label: 'Image', value: 'IMAGE' },\n { label: 'Audio', value: 'AUDIO' },\n ],\n },\n ],\n label: 'Available Models',\n },\n ],\n label: 'Models',\n },\n ],\n },\n ],\n imageURL: CustomProviderIcon,\n labels: {\n plural: 'Custom Providers',\n singular: 'Custom Provider',\n },\n}\n"],"names":["CustomProviderIcon","openaiCompatibleBlock","slug","fields","type","tabs","name","admin","description","label","required","defaultValue","components","Field","RowLabel","initCollapsed","width","dbName","options","value","hasMany","imageURL","labels","plural","singular"],"mappings":"AAEA,SAASA,kBAAkB,QAAQ,cAAa;AAEhD,OAAO,MAAMC,wBAA+B;IAC1CC,MAAM;IACNC,QAAQ;QACN;YACEC,MAAM;YACNC,MAAM;gBACJ,eAAe;gBACf;oBACEF,QAAQ;wBACN;4BACEG,MAAM;4BACNF,MAAM;4BACNG,OAAO;gCACLC,aAAa;4BACf;4BACAC,OAAO;4BACPC,UAAU;wBACZ;wBACA;4BACEJ,MAAM;4BACNF,MAAM;4BACNO,cAAc;4BACdF,OAAO;wBACT;wBACA;4BACEH,MAAM;4BACNF,MAAM;4BACNG,OAAO;gCACLK,YAAY;oCACVC,OAAO;gCACT;gCACAL,aAAa;4BACf;4BACAC,OAAO;4BACPC,UAAU;wBACZ;wBACA;4BACEJ,MAAM;4BACNF,MAAM;4BACNG,OAAO;gCACLC,aAAa;4BACf;4BACAC,OAAO;4BACPC,UAAU;wBACZ;qBACD;oBACDD,OAAO;gBACT;gBAEA,gBAAgB;gBAChB;oBACEN,QAAQ;wBACN;4BACEG,MAAM;4BACNF,MAAM;4BACNG,OAAO;gCACLK,YAAY;oCACVE,UAAU;gCACZ;gCACAC,eAAe;4BACjB;4BACAZ,QAAQ;gCACN;oCACEC,MAAM;oCACND,QAAQ;wCACN;4CACEG,MAAM;4CACNF,MAAM;4CACNG,OAAO;gDAAES,OAAO;4CAAM;4CACtBP,OAAO;4CACPC,UAAU;wCACZ;wCACA;4CACEJ,MAAM;4CACNF,MAAM;4CACNG,OAAO;gDAAES,OAAO;4CAAM;4CACtBP,OAAO;4CACPC,UAAU;wCACZ;wCACA;4CACEJ,MAAM;4CACNF,MAAM;4CACNG,OAAO;gDAAES,OAAO;4CAAM;4CACtBC,QAAQ;4CACRR,OAAO;4CACPS,SAAS;gDACP;oDAAET,OAAO;oDAAmBU,OAAO;gDAAO;gDAC1C;oDAAEV,OAAO;oDAAoBU,OAAO;gDAAQ;gDAC5C;oDAAEV,OAAO;oDAAoBU,OAAO;gDAAQ;gDAC5C;oDAAEV,OAAO;oDAAkBU,OAAO;gDAAM;6CACzC;4CACDT,UAAU;wCACZ;qCACD;gCACH;gCACA;oCACEJ,MAAM;oCACNF,MAAM;oCACNG,OAAO;wCACLS,OAAO;oCACT;oCACAL,cAAc;oCACdF,OAAO;gCACT;gCACA;oCACEH,MAAM;oCACNF,MAAM;oCACNG,OAAO;wCACLC,aAAa;wCACbQ,OAAO;oCACT;oCACAC,QAAQ;oCACRG,SAAS;oCACTX,OAAO;oCACPS,SAAS;wCACP;4CAAET,OAAO;4CAAQU,OAAO;wCAAO;wCAC/B;4CAAEV,OAAO;4CAASU,OAAO;wCAAQ;wCACjC;4CAAEV,OAAO;4CAASU,OAAO;wCAAQ;qCAClC;gCACH;6BACD;4BACDV,OAAO;wBACT;qBACD;oBACDA,OAAO;gBACT;aACD;QACH;KACD;IACDY,UAAUrB;IACVsB,QAAQ;QACNC,QAAQ;QACRC,UAAU;IACZ;AACF,EAAC"}
1
+ {"version":3,"sources":["../../../../src/ai/providers/blocks/openai-compatible.ts"],"sourcesContent":["import type { Block } from 'payload'\n\nimport { CustomProviderIcon } from '../icons.js'\n\nexport const openaiCompatibleBlock: Block = {\n slug: 'openai-compatible',\n fields: [\n {\n type: 'tabs',\n tabs: [\n // 1. Setup tab\n {\n fields: [\n {\n name: 'providerName',\n type: 'text',\n admin: {\n description: 'Display name for this custom provider (e.g., \"Ollama\", \"Together AI\")',\n },\n label: 'Provider Name',\n required: true,\n },\n {\n name: 'enabled',\n type: 'checkbox',\n defaultValue: true,\n label: 'Enabled',\n },\n {\n name: 'apiKey',\n type: 'text',\n admin: {\n components: {\n Field: '@ai-stack/payloadcms/ui/EncryptedTextField/index.js#EncryptedTextField',\n },\n description: 'API key for this provider (if required)',\n },\n label: 'API Key',\n required: true,\n },\n {\n name: 'baseURL',\n type: 'text',\n admin: {\n description: 'OpenAI-compatible API endpoint (e.g., http://localhost:11434/v1)',\n },\n label: 'API Base URL',\n required: true,\n },\n ],\n label: 'Setup',\n },\n\n // 3. Models tab\n {\n fields: [\n {\n name: 'models',\n type: 'array',\n admin: {\n components: {\n RowLabel: '@ai-stack/payloadcms/ui/ModelRowLabel/index.js#ModelRowLabel',\n },\n initCollapsed: true,\n },\n fields: [\n {\n type: 'row',\n fields: [\n {\n name: 'id',\n type: 'text',\n admin: { width: '33%' },\n label: 'Model ID',\n required: true,\n },\n {\n name: 'name',\n type: 'text',\n admin: { width: '33%' },\n label: 'Display Name',\n required: true,\n },\n {\n name: 'useCase',\n type: 'select',\n admin: { width: '33%' },\n dbName: 'compat-model-useCase',\n label: 'Use Case',\n options: [\n { label: 'Text Generation', value: 'text' },\n { label: 'Image Generation', value: 'image' },\n { label: 'Video Generation', value: 'video' },\n { label: 'Text-to-Speech', value: 'tts' },\n ],\n required: true,\n },\n ],\n },\n {\n name: 'enabled',\n type: 'checkbox',\n admin: {\n width: '50%',\n },\n defaultValue: true,\n label: 'Enabled',\n },\n {\n name: 'responseModalities',\n type: 'select',\n admin: {\n description: 'Output capabilities of this model',\n width: '50%',\n },\n dbName: 'compat-model-modalities',\n hasMany: true,\n label: 'Response Modalities',\n options: [\n { label: 'Text', value: 'TEXT' },\n { label: 'Image', value: 'IMAGE' },\n { label: 'Audio', value: 'AUDIO' },\n ],\n },\n ],\n label: 'Available Models',\n },\n ],\n label: 'Models',\n },\n ],\n },\n ],\n imageURL: CustomProviderIcon,\n labels: {\n plural: 'Custom Providers',\n singular: 'Custom Provider',\n },\n}\n"],"names":["CustomProviderIcon","openaiCompatibleBlock","slug","fields","type","tabs","name","admin","description","label","required","defaultValue","components","Field","RowLabel","initCollapsed","width","dbName","options","value","hasMany","imageURL","labels","plural","singular"],"mappings":"AAEA,SAASA,kBAAkB,QAAQ,cAAa;AAEhD,OAAO,MAAMC,wBAA+B;IAC1CC,MAAM;IACNC,QAAQ;QACN;YACEC,MAAM;YACNC,MAAM;gBACJ,eAAe;gBACf;oBACEF,QAAQ;wBACN;4BACEG,MAAM;4BACNF,MAAM;4BACNG,OAAO;gCACLC,aAAa;4BACf;4BACAC,OAAO;4BACPC,UAAU;wBACZ;wBACA;4BACEJ,MAAM;4BACNF,MAAM;4BACNO,cAAc;4BACdF,OAAO;wBACT;wBACA;4BACEH,MAAM;4BACNF,MAAM;4BACNG,OAAO;gCACLK,YAAY;oCACVC,OAAO;gCACT;gCACAL,aAAa;4BACf;4BACAC,OAAO;4BACPC,UAAU;wBACZ;wBACA;4BACEJ,MAAM;4BACNF,MAAM;4BACNG,OAAO;gCACLC,aAAa;4BACf;4BACAC,OAAO;4BACPC,UAAU;wBACZ;qBACD;oBACDD,OAAO;gBACT;gBAEA,gBAAgB;gBAChB;oBACEN,QAAQ;wBACN;4BACEG,MAAM;4BACNF,MAAM;4BACNG,OAAO;gCACLK,YAAY;oCACVE,UAAU;gCACZ;gCACAC,eAAe;4BACjB;4BACAZ,QAAQ;gCACN;oCACEC,MAAM;oCACND,QAAQ;wCACN;4CACEG,MAAM;4CACNF,MAAM;4CACNG,OAAO;gDAAES,OAAO;4CAAM;4CACtBP,OAAO;4CACPC,UAAU;wCACZ;wCACA;4CACEJ,MAAM;4CACNF,MAAM;4CACNG,OAAO;gDAAES,OAAO;4CAAM;4CACtBP,OAAO;4CACPC,UAAU;wCACZ;wCACA;4CACEJ,MAAM;4CACNF,MAAM;4CACNG,OAAO;gDAAES,OAAO;4CAAM;4CACtBC,QAAQ;4CACRR,OAAO;4CACPS,SAAS;gDACP;oDAAET,OAAO;oDAAmBU,OAAO;gDAAO;gDAC1C;oDAAEV,OAAO;oDAAoBU,OAAO;gDAAQ;gDAC5C;oDAAEV,OAAO;oDAAoBU,OAAO;gDAAQ;gDAC5C;oDAAEV,OAAO;oDAAkBU,OAAO;gDAAM;6CACzC;4CACDT,UAAU;wCACZ;qCACD;gCACH;gCACA;oCACEJ,MAAM;oCACNF,MAAM;oCACNG,OAAO;wCACLS,OAAO;oCACT;oCACAL,cAAc;oCACdF,OAAO;gCACT;gCACA;oCACEH,MAAM;oCACNF,MAAM;oCACNG,OAAO;wCACLC,aAAa;wCACbQ,OAAO;oCACT;oCACAC,QAAQ;oCACRG,SAAS;oCACTX,OAAO;oCACPS,SAAS;wCACP;4CAAET,OAAO;4CAAQU,OAAO;wCAAO;wCAC/B;4CAAEV,OAAO;4CAASU,OAAO;wCAAQ;wCACjC;4CAAEV,OAAO;4CAASU,OAAO;wCAAQ;qCAClC;gCACH;6BACD;4BACDV,OAAO;wBACT;qBACD;oBACDA,OAAO;gBACT;aACD;QACH;KACD;IACDY,UAAUrB;IACVsB,QAAQ;QACNC,QAAQ;QACRC,UAAU;IACZ;AACF,EAAC"}
@@ -19,7 +19,7 @@ export const openaiBlock = {
19
19
  type: 'text',
20
20
  admin: {
21
21
  components: {
22
- Field: '@ai-stack/payloadcms/client#EncryptedTextField'
22
+ Field: '@ai-stack/payloadcms/ui/EncryptedTextField/index.js#EncryptedTextField'
23
23
  },
24
24
  description: 'Optional. If empty, @ai-sdk/openai will use the OPENAI_API_KEY environment variable.'
25
25
  },
@@ -202,7 +202,7 @@ export const openaiBlock = {
202
202
  type: 'array',
203
203
  admin: {
204
204
  components: {
205
- RowLabel: '@ai-stack/payloadcms/client#ModelRowLabel'
205
+ RowLabel: '@ai-stack/payloadcms/ui/ModelRowLabel/index.js#ModelRowLabel'
206
206
  },
207
207
  description: 'Keep this list short. Enable only the models you actually use.',
208
208
  initCollapsed: true
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/ai/providers/blocks/openai.ts"],"sourcesContent":["import type { Block } from 'payload'\n\nimport { OpenAIIcon } from '../icons.js'\n\nexport const openaiBlock: Block = {\n slug: 'openai',\n\n fields: [\n {\n type: 'tabs',\n tabs: [\n // 1. Setup tab\n {\n fields: [\n {\n name: 'enabled',\n type: 'checkbox',\n defaultValue: true,\n label: 'Enabled',\n },\n {\n name: 'apiKey',\n type: 'text',\n admin: {\n components: {\n Field: '@ai-stack/payloadcms/client#EncryptedTextField',\n },\n description:\n 'Optional. If empty, @ai-sdk/openai will use the OPENAI_API_KEY environment variable.',\n },\n label: 'API Key',\n required: false,\n },\n ],\n label: 'Setup',\n },\n\n // 2. Connection tab\n {\n fields: [\n {\n type: 'collapsible',\n admin: {\n initCollapsed: false,\n },\n fields: [\n {\n type: 'row',\n fields: [\n {\n name: 'baseURL',\n type: 'text',\n admin: {\n description:\n 'Optional. Override default API endpoint (defaults to https://api.openai.com/v1).',\n },\n defaultValue: 'https://api.openai.com/v1',\n label: 'Base URL',\n },\n ],\n },\n {\n type: 'row',\n fields: [\n {\n name: 'organization',\n type: 'text',\n admin: {\n description:\n 'Optional. OpenAI organization ID for billing and access control.',\n },\n label: 'Organization ID',\n },\n {\n name: 'project',\n type: 'text',\n admin: {\n description: 'Optional. OpenAI project ID for organization-level access.',\n },\n label: 'Project ID',\n },\n ],\n },\n {\n name: 'headers',\n type: 'array',\n admin: {\n description:\n 'Optional. Extra headers to send with every request, for example routing through a proxy.',\n },\n fields: [\n {\n type: 'row',\n fields: [\n {\n name: 'key',\n type: 'text',\n admin: {\n width: '50%',\n },\n label: 'Header Name',\n required: true,\n },\n {\n name: 'value',\n type: 'text',\n admin: {\n width: '50%',\n },\n label: 'Header Value',\n required: true,\n },\n ],\n },\n ],\n label: 'Custom Headers',\n },\n ],\n label: 'API & Network Settings',\n },\n ],\n label: 'Connection',\n },\n\n // 3. Voices tab (NEW)\n {\n fields: [\n {\n name: 'voices',\n type: 'array',\n admin: {\n description:\n 'Available voices for Text-to-Speech models. You can add custom voices here.',\n initCollapsed: false,\n },\n defaultValue: [\n { id: 'alloy', name: 'Alloy', enabled: true },\n { id: 'echo', name: 'Echo', enabled: true },\n { id: 'fable', name: 'Fable', enabled: true },\n { id: 'onyx', name: 'Onyx', enabled: true },\n { id: 'nova', name: 'Nova', enabled: true },\n { id: 'shimmer', name: 'Shimmer', enabled: true },\n ],\n fields: [\n {\n type: 'row',\n fields: [\n {\n name: 'id',\n type: 'text',\n admin: {\n description: 'Voice ID as used by OpenAI API',\n width: '40%',\n },\n label: 'Voice ID',\n required: true,\n },\n {\n name: 'name',\n type: 'text',\n admin: {\n width: '40%',\n },\n label: 'Display Name',\n required: true,\n },\n {\n name: 'enabled',\n type: 'checkbox',\n admin: {\n width: '20%',\n },\n defaultValue: true,\n label: 'Enabled',\n },\n ],\n },\n ],\n label: 'Available Voices',\n },\n ],\n label: 'Voices',\n },\n\n // 5. Models (SIMPLIFIED - no per-model settings)\n {\n fields: [\n {\n name: 'models',\n type: 'array',\n admin: {\n components: {\n RowLabel: '@ai-stack/payloadcms/client#ModelRowLabel',\n },\n description: 'Keep this list short. Enable only the models you actually use.',\n initCollapsed: true,\n },\n label: 'Available Models',\n labels: {\n plural: 'Models',\n singular: 'Model',\n },\n // Curated models for content creation platforms\n defaultValue: [\n // ===== Text Generation =====\n {\n id: 'gpt-5',\n name: 'GPT-5 (Latest Flagship)',\n enabled: true,\n responseModalities: ['TEXT'],\n useCase: 'text',\n },\n {\n id: 'gpt-5-mini',\n name: 'GPT-5 Mini (Fast & Efficient)',\n enabled: true,\n responseModalities: ['TEXT'],\n useCase: 'text',\n },\n {\n id: 'chatgpt-4o-latest',\n name: 'ChatGPT-4o (Always Updated)',\n enabled: true,\n responseModalities: ['TEXT'],\n useCase: 'text',\n },\n {\n id: 'gpt-4o',\n name: 'GPT-4o (Multimodal)',\n enabled: true,\n responseModalities: ['TEXT'],\n useCase: 'text',\n },\n {\n id: 'gpt-4o-mini',\n name: 'GPT-4o Mini (Best Value)',\n enabled: true,\n responseModalities: ['TEXT'],\n useCase: 'text',\n },\n {\n id: 'gpt-4-turbo',\n name: 'GPT-4 Turbo',\n enabled: true,\n responseModalities: ['TEXT'],\n useCase: 'text',\n },\n\n // ===== Image Generation =====\n {\n id: 'gpt-image-1',\n name: 'GPT Image 1 (Latest)',\n enabled: true,\n useCase: 'image',\n },\n {\n id: 'dall-e-3',\n name: 'DALL-E 3',\n enabled: true,\n useCase: 'image',\n },\n\n // ===== Audio =====\n {\n id: 'tts-1-hd',\n name: 'TTS HD (Text-to-Speech)',\n enabled: true,\n responseModalities: ['AUDIO'],\n useCase: 'tts',\n },\n ],\n fields: [\n // Basic model info\n {\n type: 'row',\n fields: [\n {\n name: 'id',\n type: 'text',\n admin: {\n description:\n 'Exact model id as used with @ai-sdk/openai, for example gpt-4o.',\n width: '33%',\n },\n label: 'Model ID',\n required: true,\n },\n {\n name: 'name',\n type: 'text',\n admin: {\n width: '33%',\n },\n label: 'Display Name',\n required: true,\n },\n {\n name: 'useCase',\n type: 'select',\n admin: {\n width: '33%',\n },\n dbName: 'openai-model-useCase',\n defaultValue: 'text',\n label: 'Use Case',\n options: [\n { label: 'Text', value: 'text' },\n { label: 'Image Generation', value: 'image' },\n { label: 'Text-to-Speech', value: 'tts' },\n { label: 'Embeddings', value: 'embedding' },\n ],\n },\n ],\n },\n // Response modalities and enabled checkbox\n {\n name: 'responseModalities',\n type: 'select',\n admin: {\n description: 'Output capabilities of this model',\n width: '50%',\n },\n dbName: 'openai-model-modalities',\n hasMany: true,\n label: 'Response Modalities',\n options: [\n { label: 'Text', value: 'TEXT' },\n { label: 'Image', value: 'IMAGE' },\n { label: 'Audio', value: 'AUDIO' },\n ],\n },\n {\n name: 'enabled',\n type: 'checkbox',\n admin: {\n width: '50%',\n },\n defaultValue: true,\n label: 'Enabled',\n },\n ],\n },\n ],\n label: 'Models',\n },\n ],\n },\n ],\n imageURL: OpenAIIcon,\n labels: {\n plural: 'OpenAI Providers',\n singular: 'OpenAI',\n },\n}\n"],"names":["OpenAIIcon","openaiBlock","slug","fields","type","tabs","name","defaultValue","label","admin","components","Field","description","required","initCollapsed","width","id","enabled","RowLabel","labels","plural","singular","responseModalities","useCase","dbName","options","value","hasMany","imageURL"],"mappings":"AAEA,SAASA,UAAU,QAAQ,cAAa;AAExC,OAAO,MAAMC,cAAqB;IAChCC,MAAM;IAENC,QAAQ;QACN;YACEC,MAAM;YACNC,MAAM;gBACJ,eAAe;gBACf;oBACEF,QAAQ;wBACN;4BACEG,MAAM;4BACNF,MAAM;4BACNG,cAAc;4BACdC,OAAO;wBACT;wBACA;4BACEF,MAAM;4BACNF,MAAM;4BACNK,OAAO;gCACLC,YAAY;oCACVC,OAAO;gCACT;gCACAC,aACE;4BACJ;4BACAJ,OAAO;4BACPK,UAAU;wBACZ;qBACD;oBACDL,OAAO;gBACT;gBAEA,oBAAoB;gBACpB;oBACEL,QAAQ;wBACN;4BACEC,MAAM;4BACNK,OAAO;gCACLK,eAAe;4BACjB;4BACAX,QAAQ;gCACN;oCACEC,MAAM;oCACND,QAAQ;wCACN;4CACEG,MAAM;4CACNF,MAAM;4CACNK,OAAO;gDACLG,aACE;4CACJ;4CACAL,cAAc;4CACdC,OAAO;wCACT;qCACD;gCACH;gCACA;oCACEJ,MAAM;oCACND,QAAQ;wCACN;4CACEG,MAAM;4CACNF,MAAM;4CACNK,OAAO;gDACLG,aACE;4CACJ;4CACAJ,OAAO;wCACT;wCACA;4CACEF,MAAM;4CACNF,MAAM;4CACNK,OAAO;gDACLG,aAAa;4CACf;4CACAJ,OAAO;wCACT;qCACD;g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ND,QAAQ;wCACN;4CACEG,MAAM;4CACNF,MAAM;4CACNK,OAAO;gDACLG,aACE;gDACFG,OAAO;4CACT;4CACAP,OAAO;4CACPK,UAAU;wCACZ;wCACA;4CACEP,MAAM;4CACNF,MAAM;4CACNK,OAAO;gDACLM,OAAO;4CACT;4CACAP,OAAO;4CACPK,UAAU;wCACZ;wCACA;4CACEP,MAAM;4CACNF,MAAM;4CACNK,OAAO;gDACLM,OAAO;4CACT;4CACAS,QAAQ;4CACRjB,cAAc;4CACdC,OAAO;4CACPiB,SAAS;gDACP;oDAAEjB,OAAO;oDAAQkB,OAAO;gDAAO;gDAC/B;oDAAElB,OAAO;oDAAoBkB,OAAO;gDAAQ;gDAC5C;oDAAElB,OAAO;oDAAkBkB,OAAO;gDAAM;gDACxC;oDAAElB,OAAO;oDAAckB,OAAO;gDAAY;6CAC3C;wCACH;qCACD;gCACH;gCACA,2CAA2C;gCAC3C;oCACEpB,MAAM;oCACNF,MAAM;oCACNK,OAAO;wCACLG,aAAa;wCACbG,OAAO;oCACT;oCACAS,QAAQ;oCACRG,SAAS;oCACTnB,OAAO;oCACPiB,SAAS;wCACP;4CAAEjB,OAAO;4CAAQkB,OAAO;wCAAO;wCAC/B;4CAAElB,OAAO;4CAASkB,OAAO;wCAAQ;wCACjC;4CAAElB,OAAO;4CAASkB,OAAO;wCAAQ;qCAClC;gCACH;gCACA;oCACEpB,MAAM;oCACNF,MAAM;oCACNK,OAAO;wCACLM,OAAO;oCACT;oCACAR,cAAc;oCACdC,OAAO;gCACT;6BACD;wBACH;qBACD;oBACDA,OAAO;gBACT;aACD;QACH;KACD;IACDoB,UAAU5B;IACVmB,QAAQ;QACNC,QAAQ;QACRC,UAAU;IACZ;AACF,EAAC"}
1
+ {"version":3,"sources":["../../../../src/ai/providers/blocks/openai.ts"],"sourcesContent":["import type { Block } from 'payload'\n\nimport { OpenAIIcon } from '../icons.js'\n\nexport const openaiBlock: Block = {\n slug: 'openai',\n\n fields: [\n {\n type: 'tabs',\n tabs: [\n // 1. Setup tab\n {\n fields: [\n {\n name: 'enabled',\n type: 'checkbox',\n defaultValue: true,\n label: 'Enabled',\n },\n {\n name: 'apiKey',\n type: 'text',\n admin: {\n components: {\n Field: '@ai-stack/payloadcms/ui/EncryptedTextField/index.js#EncryptedTextField',\n },\n description:\n 'Optional. If empty, @ai-sdk/openai will use the OPENAI_API_KEY environment variable.',\n },\n label: 'API Key',\n required: false,\n },\n ],\n label: 'Setup',\n },\n\n // 2. Connection tab\n {\n fields: [\n {\n type: 'collapsible',\n admin: {\n initCollapsed: false,\n },\n fields: [\n {\n type: 'row',\n fields: [\n {\n name: 'baseURL',\n type: 'text',\n admin: {\n description:\n 'Optional. Override default API endpoint (defaults to https://api.openai.com/v1).',\n },\n defaultValue: 'https://api.openai.com/v1',\n label: 'Base URL',\n },\n ],\n },\n {\n type: 'row',\n fields: [\n {\n name: 'organization',\n type: 'text',\n admin: {\n description:\n 'Optional. OpenAI organization ID for billing and access control.',\n },\n label: 'Organization ID',\n },\n {\n name: 'project',\n type: 'text',\n admin: {\n description: 'Optional. OpenAI project ID for organization-level access.',\n },\n label: 'Project ID',\n },\n ],\n },\n {\n name: 'headers',\n type: 'array',\n admin: {\n description:\n 'Optional. Extra headers to send with every request, for example routing through a proxy.',\n },\n fields: [\n {\n type: 'row',\n fields: [\n {\n name: 'key',\n type: 'text',\n admin: {\n width: '50%',\n },\n label: 'Header Name',\n required: true,\n },\n {\n name: 'value',\n type: 'text',\n admin: {\n width: '50%',\n },\n label: 'Header Value',\n required: true,\n },\n ],\n },\n ],\n label: 'Custom Headers',\n },\n ],\n label: 'API & Network Settings',\n },\n ],\n label: 'Connection',\n },\n\n // 3. Voices tab (NEW)\n {\n fields: [\n {\n name: 'voices',\n type: 'array',\n admin: {\n description:\n 'Available voices for Text-to-Speech models. You can add custom voices here.',\n initCollapsed: false,\n },\n defaultValue: [\n { id: 'alloy', name: 'Alloy', enabled: true },\n { id: 'echo', name: 'Echo', enabled: true },\n { id: 'fable', name: 'Fable', enabled: true },\n { id: 'onyx', name: 'Onyx', enabled: true },\n { id: 'nova', name: 'Nova', enabled: true },\n { id: 'shimmer', name: 'Shimmer', enabled: true },\n ],\n fields: [\n {\n type: 'row',\n fields: [\n {\n name: 'id',\n type: 'text',\n admin: {\n description: 'Voice ID as used by OpenAI API',\n width: '40%',\n },\n label: 'Voice ID',\n required: true,\n },\n {\n name: 'name',\n type: 'text',\n admin: {\n width: '40%',\n },\n label: 'Display Name',\n required: true,\n },\n {\n name: 'enabled',\n type: 'checkbox',\n admin: {\n width: '20%',\n },\n defaultValue: true,\n label: 'Enabled',\n },\n ],\n },\n ],\n label: 'Available Voices',\n },\n ],\n label: 'Voices',\n },\n\n // 5. Models (SIMPLIFIED - no per-model settings)\n {\n fields: [\n {\n name: 'models',\n type: 'array',\n admin: {\n components: {\n RowLabel: '@ai-stack/payloadcms/ui/ModelRowLabel/index.js#ModelRowLabel',\n },\n description: 'Keep this list short. Enable only the models you actually use.',\n initCollapsed: true,\n },\n label: 'Available Models',\n labels: {\n plural: 'Models',\n singular: 'Model',\n },\n // Curated models for content creation platforms\n defaultValue: [\n // ===== Text Generation =====\n {\n id: 'gpt-5',\n name: 'GPT-5 (Latest Flagship)',\n enabled: true,\n responseModalities: ['TEXT'],\n useCase: 'text',\n },\n {\n id: 'gpt-5-mini',\n name: 'GPT-5 Mini (Fast & Efficient)',\n enabled: true,\n responseModalities: ['TEXT'],\n useCase: 'text',\n },\n {\n id: 'chatgpt-4o-latest',\n name: 'ChatGPT-4o (Always Updated)',\n enabled: true,\n responseModalities: ['TEXT'],\n useCase: 'text',\n },\n {\n id: 'gpt-4o',\n name: 'GPT-4o (Multimodal)',\n enabled: true,\n responseModalities: ['TEXT'],\n useCase: 'text',\n },\n {\n id: 'gpt-4o-mini',\n name: 'GPT-4o Mini (Best Value)',\n enabled: true,\n responseModalities: ['TEXT'],\n useCase: 'text',\n },\n {\n id: 'gpt-4-turbo',\n name: 'GPT-4 Turbo',\n enabled: true,\n responseModalities: ['TEXT'],\n useCase: 'text',\n },\n\n // ===== Image Generation =====\n {\n id: 'gpt-image-1',\n name: 'GPT Image 1 (Latest)',\n enabled: true,\n useCase: 'image',\n },\n {\n id: 'dall-e-3',\n name: 'DALL-E 3',\n enabled: true,\n useCase: 'image',\n },\n\n // ===== Audio =====\n {\n id: 'tts-1-hd',\n name: 'TTS HD (Text-to-Speech)',\n enabled: true,\n responseModalities: ['AUDIO'],\n useCase: 'tts',\n },\n ],\n fields: [\n // Basic model info\n {\n type: 'row',\n fields: [\n {\n name: 'id',\n type: 'text',\n admin: {\n description:\n 'Exact model id as used with @ai-sdk/openai, for example gpt-4o.',\n width: '33%',\n },\n label: 'Model ID',\n required: true,\n },\n {\n name: 'name',\n type: 'text',\n admin: {\n width: '33%',\n },\n label: 'Display Name',\n required: true,\n },\n {\n name: 'useCase',\n type: 'select',\n admin: {\n width: '33%',\n },\n dbName: 'openai-model-useCase',\n defaultValue: 'text',\n label: 'Use Case',\n options: [\n { label: 'Text', value: 'text' },\n { label: 'Image Generation', value: 'image' },\n { label: 'Text-to-Speech', value: 'tts' },\n { label: 'Embeddings', value: 'embedding' },\n ],\n },\n ],\n },\n // Response modalities and enabled checkbox\n {\n name: 'responseModalities',\n type: 'select',\n admin: {\n description: 'Output capabilities of this model',\n width: '50%',\n },\n dbName: 'openai-model-modalities',\n hasMany: true,\n label: 'Response Modalities',\n options: [\n { label: 'Text', value: 'TEXT' },\n { label: 'Image', value: 'IMAGE' },\n { label: 'Audio', value: 'AUDIO' },\n ],\n },\n {\n name: 'enabled',\n type: 'checkbox',\n admin: {\n width: '50%',\n },\n defaultValue: true,\n label: 'Enabled',\n },\n ],\n },\n ],\n label: 'Models',\n },\n ],\n },\n ],\n imageURL: OpenAIIcon,\n labels: {\n plural: 'OpenAI Providers',\n singular: 'OpenAI',\n },\n}\n"],"names":["OpenAIIcon","openaiBlock","slug","fields","type","tabs","name","defaultValue","label","admin","components","Field","description","required","initCollapsed","width","id","enabled","RowLabel","labels","plural","singular","responseModalities","useCase","dbName","options","value","hasMany","imageURL"],"mappings":"AAEA,SAASA,UAAU,QAAQ,cAAa;AAExC,OAAO,MAAMC,cAAqB;IAChCC,MAAM;IAENC,QAAQ;QACN;YACEC,MAAM;YACNC,MAAM;gBACJ,eAAe;gBACf;oBACEF,QAAQ;wBACN;4BACEG,MAAM;4BACNF,MAAM;4BACNG,cAAc;4BACdC,OAAO;wBACT;wBACA;4BACEF,MAAM;4BACNF,MAAM;4BACNK,OAAO;gCACLC,YAAY;oCACVC,OAAO;gCACT;gCACAC,aACE;4BACJ;4BACAJ,OAAO;4BACPK,UAAU;wBACZ;qBACD;oBACDL,OAAO;gBACT;gBAEA,oBAAoB;gBACpB;oBACEL,QAAQ;wBACN;4BACEC,MAAM;4BACNK,OAAO;gCACLK,eAAe;4BACjB;4BACAX,QAAQ;gCACN;oCACEC,MAAM;oCACND,QAAQ;wCACN;4CACEG,MAAM;4CACNF,MAAM;4CACNK,OAAO;gDACLG,aACE;4CACJ;4CACAL,cAAc;4CACdC,OAAO;wCACT;qCACD;gCACH;gCACA;oCACEJ,MAAM;oCACND,QAAQ;wCACN;4CACEG,MAAM;4CACNF,MAAM;4CACNK,OAAO;gDACLG,aACE;4CACJ;4CACAJ,OAAO;wCACT;wCACA;4CACEF,MAAM;4CACNF,MAAM;4CACNK,OAAO;gDACLG,aAAa;4CACf;4CACAJ,OAAO;wCACT;qCACD;gCACH;gCACA;oCACEF,MAAM;oCACNF,MAAM;oCACNK,OAAO;wCACLG,aACE;oCACJ;oCACAT,QAAQ;wCACN;4CACEC,MAAM;4CACND,QAAQ;gDACN;oDACEG,MAAM;oDACNF,MAAM;oDACNK,OAAO;wDACLM,OAAO;oDACT;oDACAP,OAAO;oDACPK,UAAU;gDACZ;gDACA;oDACEP,MAAM;oDACNF,MAAM;oDACNK,OAAO;wDACLM,OAAO;oDACT;oDACAP,OAAO;oDACPK,UAAU;gDACZ;6CACD;wCACH;qCACD;oCACDL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S;gDACP;oDAAEjB,OAAO;oDAAQkB,OAAO;gDAAO;gDAC/B;oDAAElB,OAAO;oDAAoBkB,OAAO;gDAAQ;gDAC5C;oDAAElB,OAAO;oDAAkBkB,OAAO;gDAAM;gDACxC;oDAAElB,OAAO;oDAAckB,OAAO;gDAAY;6CAC3C;wCACH;qCACD;gCACH;gCACA,2CAA2C;gCAC3C;oCACEpB,MAAM;oCACNF,MAAM;oCACNK,OAAO;wCACLG,aAAa;wCACbG,OAAO;oCACT;oCACAS,QAAQ;oCACRG,SAAS;oCACTnB,OAAO;oCACPiB,SAAS;wCACP;4CAAEjB,OAAO;4CAAQkB,OAAO;wCAAO;wCAC/B;4CAAElB,OAAO;4CAASkB,OAAO;wCAAQ;wCACjC;4CAAElB,OAAO;4CAASkB,OAAO;wCAAQ;qCAClC;gCACH;gCACA;oCACEpB,MAAM;oCACNF,MAAM;oCACNK,OAAO;wCACLM,OAAO;oCACT;oCACAR,cAAc;oCACdC,OAAO;gCACT;6BACD;wBACH;qBACD;oBACDA,OAAO;gBACT;aACD;QACH;KACD;IACDoB,UAAU5B;IACVmB,QAAQ;QACNC,QAAQ;QACRC,UAAU;IACZ;AACF,EAAC"}
@@ -19,7 +19,7 @@ export const xaiBlock = {
19
19
  type: 'text',
20
20
  admin: {
21
21
  components: {
22
- Field: '@ai-stack/payloadcms/client#EncryptedTextField'
22
+ Field: '@ai-stack/payloadcms/ui/EncryptedTextField/index.js#EncryptedTextField'
23
23
  },
24
24
  description: 'Your xAI API key. Will be encrypted in the database.'
25
25
  },
@@ -37,7 +37,7 @@ export const xaiBlock = {
37
37
  type: 'array',
38
38
  admin: {
39
39
  components: {
40
- RowLabel: '@ai-stack/payloadcms/client#ModelRowLabel'
40
+ RowLabel: '@ai-stack/payloadcms/ui/ModelRowLabel/index.js#ModelRowLabel'
41
41
  },
42
42
  initCollapsed: true
43
43
  },