@neta-art/generation 0.1.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/LICENSE +21 -0
- package/README.md +235 -0
- package/dist/builtins-BuI-rf8X.d.ts +137 -0
- package/dist/builtins-BuI-rf8X.d.ts.map +1 -0
- package/dist/builtins-hmNIcYXN.js +311 -0
- package/dist/builtins-hmNIcYXN.js.map +1 -0
- package/dist/builtins.d.ts +2 -0
- package/dist/builtins.js +3 -0
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.js +65 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/export-config-ZxwkQoZ6.js +128 -0
- package/dist/export-config-ZxwkQoZ6.js.map +1 -0
- package/dist/index.d.ts +82 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +602 -0
- package/dist/index.js.map +1 -0
- package/models/gemini-3.1-flash-image-preview.yaml +62 -0
- package/models/gpt-image-2.yaml +56 -0
- package/models/seedance-2-0-fast.yaml +97 -0
- package/models/seedance-2-0.yaml +97 -0
- package/package.json +74 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["resolved: Record<string, unknown>","REQUEST_TIMEOUT_MS","RESOLUTION_SHORT_EDGE: Record<string, number>","ASPECT_RATIOS: Record<string, [number, number] | null>","content: Array<Record<string, unknown>>","metadata: Record<string, unknown>","payload: Record<string, unknown>","output: GenerationContentBlock[]","REQUEST_TIMEOUT_MS","generationConfig: Record<string, unknown>","image: Record<string, string>","output: GenerationContentBlock[]","payload: Record<string, unknown>","output: GenerationContentBlock[]","builtinGenerationAdapters: Record<string, GenerationAdapter>","defaultGenerationSourceResolver: GenerationSourceResolver"],"sources":["../src/http.ts","../src/validation.ts","../src/adapters/ark-video-generations.ts","../src/adapters/gemini-generate-content.ts","../src/adapters/openai-images.ts","../src/adapters/index.ts","../src/source.ts","../src/client.ts"],"sourcesContent":["import { GenerationTimeoutError } from \"./errors.js\";\n\nexport async function fetchWithTimeout(\n fetchFn: typeof fetch,\n url: string,\n init: RequestInit,\n timeoutMs: number,\n): Promise<Response> {\n const controller = new AbortController();\n const timeout = setTimeout(() => controller.abort(), timeoutMs);\n try {\n return await fetchFn(url, { ...init, signal: controller.signal });\n } catch (error) {\n if (error instanceof Error && error.name === \"AbortError\") throw new GenerationTimeoutError();\n throw error;\n } finally {\n clearTimeout(timeout);\n }\n}\n\nexport function joinUrl(baseUrl: string, path: string): string {\n return `${baseUrl.replace(/\\/+$/, \"\")}/${path.replace(/^\\/+/, \"\")}`;\n}\n","import { GenerationValidationError } from \"./errors.js\";\nimport type { GenerationContentBlock, GenerationContentSpec, GenerationModelDeclaration } from \"./types.js\";\n\nfunction specsByType(specs: GenerationContentSpec[]) {\n const map = new Map<GenerationContentSpec[\"type\"], GenerationContentSpec>();\n for (const spec of specs) map.set(spec.type, spec);\n return map;\n}\n\nexport function validateGenerationContent(\n declaration: GenerationModelDeclaration,\n content: GenerationContentBlock[],\n): void {\n const inputSpecs = specsByType(declaration.content.input);\n const counts = new Map<GenerationContentSpec[\"type\"], number>();\n\n for (const block of content) {\n const spec = inputSpecs.get(block.type);\n if (!spec)\n throw new GenerationValidationError(`Content block type is not supported by ${declaration.model}: ${block.type}`);\n counts.set(block.type, (counts.get(block.type) ?? 0) + 1);\n\n if (\"source\" in block && spec.sources && !spec.sources.includes(block.source.type)) {\n throw new GenerationValidationError(\n `${block.type} source is not supported by ${declaration.model}: ${block.source.type}`,\n );\n }\n }\n\n for (const spec of declaration.content.input) {\n const count = counts.get(spec.type) ?? 0;\n if (spec.required && count === 0)\n throw new GenerationValidationError(`Missing required ${spec.type} content block`);\n if (spec.min !== undefined && count < spec.min)\n throw new GenerationValidationError(`Expected at least ${spec.min} ${spec.type} content block(s)`);\n if (spec.max !== undefined && count > spec.max)\n throw new GenerationValidationError(`Expected at most ${spec.max} ${spec.type} content block(s)`);\n }\n}\n\nexport function resolveGenerationParameters(\n declaration: GenerationModelDeclaration,\n parameters: Record<string, unknown> | undefined,\n): Record<string, unknown> {\n const specs = declaration.parameters ?? {};\n const resolved: Record<string, unknown> = {};\n\n for (const key of Object.keys(parameters ?? {})) {\n if (!specs[key]) throw new GenerationValidationError(`Unknown parameter: ${key}`);\n }\n\n for (const [key, spec] of Object.entries(specs)) {\n const value = parameters?.[key];\n if (value === undefined) {\n if (spec.default !== undefined) resolved[key] = spec.default;\n else if (!spec.optional) throw new GenerationValidationError(`Missing required parameter: ${key}`);\n continue;\n }\n\n switch (spec.type) {\n case \"string\":\n if (typeof value !== \"string\") throw new GenerationValidationError(`Parameter ${key} must be a string`);\n if (spec.enum && !spec.enum.includes(value))\n throw new GenerationValidationError(`Parameter ${key} must be one of: ${spec.enum.join(\", \")}`);\n break;\n case \"number\":\n if (typeof value !== \"number\" || !Number.isFinite(value))\n throw new GenerationValidationError(`Parameter ${key} must be a number`);\n if (spec.min !== undefined && value < spec.min)\n throw new GenerationValidationError(`Parameter ${key} must be >= ${spec.min}`);\n if (spec.max !== undefined && value > spec.max)\n throw new GenerationValidationError(`Parameter ${key} must be <= ${spec.max}`);\n break;\n case \"integer\":\n if (typeof value !== \"number\" || !Number.isInteger(value))\n throw new GenerationValidationError(`Parameter ${key} must be an integer`);\n if (spec.min !== undefined && value < spec.min)\n throw new GenerationValidationError(`Parameter ${key} must be >= ${spec.min}`);\n if (spec.max !== undefined && value > spec.max)\n throw new GenerationValidationError(`Parameter ${key} must be <= ${spec.max}`);\n break;\n case \"boolean\":\n if (typeof value !== \"boolean\") throw new GenerationValidationError(`Parameter ${key} must be a boolean`);\n break;\n }\n resolved[key] = value;\n }\n\n return resolved;\n}\n\nexport function mergeTextBlocks(declaration: GenerationModelDeclaration, content: GenerationContentBlock[]): string {\n const textSpec = declaration.content.input.find((spec) => spec.type === \"text\");\n const separator = textSpec?.merge === \"space\" ? \" \" : textSpec?.merge === \"concat\" ? \"\" : \"\\n\";\n return content\n .filter((block): block is Extract<GenerationContentBlock, { type: \"text\" }> => block.type === \"text\")\n .map((block) => block.text)\n .join(separator)\n .trim();\n}\n","import { GenerationProviderError, GenerationTimeoutError, GenerationValidationError } from \"../errors.js\";\nimport { fetchWithTimeout, joinUrl } from \"../http.js\";\nimport type { GenerationAdapterInput, GenerationContentBlock } from \"../types.js\";\nimport { getBlockMeta } from \"../utils.js\";\nimport { mergeTextBlocks } from \"../validation.js\";\n\nconst REQUEST_TIMEOUT_MS = 60_000;\nconst DEFAULT_POLL_INTERVAL_SEC = 2;\nconst DEFAULT_MAX_WAIT_SEC = 600;\n\nconst RESOLUTION_SHORT_EDGE: Record<string, number> = {\n \"480p\": 480,\n \"720p\": 720,\n \"1080p\": 1080,\n \"2K\": 1440,\n};\n\nconst ASPECT_RATIOS: Record<string, [number, number] | null> = {\n \"16:9\": [16, 9],\n \"9:16\": [9, 16],\n \"1:1\": [1, 1],\n \"4:3\": [4, 3],\n \"3:2\": [3, 2],\n \"2:3\": [2, 3],\n \"3:4\": [3, 4],\n \"21:9\": [21, 9],\n adaptive: null,\n};\n\ntype ArkCreateTaskResponse = { id?: unknown; task_id?: unknown; status?: unknown };\n\ntype ArkTaskStatusResponse = {\n data?: {\n task_id?: unknown;\n status?: unknown;\n result_url?: unknown;\n progress?: unknown;\n data?: {\n status?: unknown;\n content?: { video_url?: unknown; last_frame_url?: unknown };\n resolution?: unknown;\n ratio?: unknown;\n duration?: unknown;\n framespersecond?: unknown;\n seed?: unknown;\n generate_audio?: unknown;\n model?: unknown;\n usage?: unknown;\n };\n };\n status?: unknown;\n url?: unknown;\n last_frame_url?: unknown;\n metadata?: unknown;\n};\n\ntype ImageMode = \"image\" | \"frame\" | \"reference\";\ntype ResolvedImage = { url: string; role: string | undefined };\n\nfunction sleep(ms: number): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n\nfunction asString(value: unknown): string | undefined {\n return typeof value === \"string\" && value ? value : undefined;\n}\n\nfunction asNumber(value: unknown): number | undefined {\n return typeof value === \"number\" && Number.isFinite(value) ? value : undefined;\n}\n\nfunction asBoolean(value: unknown): boolean | undefined {\n return typeof value === \"boolean\" ? value : undefined;\n}\n\nfunction getIntegerParameter(parameters: Record<string, unknown>, key: string, fallback: number): number {\n const value = parameters[key];\n return typeof value === \"number\" && Number.isInteger(value) ? value : fallback;\n}\n\nfunction resolveSize(resolution: string, aspectRatio: string): { width: number; height: number } | null {\n const ratio = ASPECT_RATIOS[aspectRatio];\n if (!ratio) return null;\n\n const shortEdge = RESOLUTION_SHORT_EDGE[resolution];\n if (!shortEdge) throw new GenerationValidationError(`Unsupported resolution: ${resolution}`);\n\n const [wRatio, hRatio] = ratio;\n const width = wRatio >= hRatio ? Math.round((shortEdge * wRatio) / hRatio) : shortEdge;\n const height = wRatio >= hRatio ? shortEdge : Math.round((shortEdge * hRatio) / wRatio);\n return { width: width % 2 === 0 ? width : width + 1, height: height % 2 === 0 ? height : height + 1 };\n}\n\nfunction getImageRole(block: Extract<GenerationContentBlock, { type: \"image\" }>): string | undefined {\n const role = getBlockMeta(block)?.role;\n return typeof role === \"string\" && role ? role : undefined;\n}\n\nfunction classifyImages(images: ResolvedImage[]): ImageMode | null {\n if (images.length === 0) return null;\n const hasFirstOrLast = images.some((image) => image.role === \"first_frame\" || image.role === \"last_frame\");\n const hasReference = images.some((image) => image.role === \"reference_image\");\n const hasPlain = images.some((image) => !image.role);\n const modes = [hasPlain, hasFirstOrLast, hasReference].filter(Boolean).length;\n if (modes > 1)\n throw new GenerationValidationError(\n \"Cannot mix video image modes: use only plain image, first_frame/last_frame, or reference_image\",\n );\n if (hasReference) return \"reference\";\n if (hasFirstOrLast) return \"frame\";\n return \"image\";\n}\n\nfunction buildMetadataContent(prompt: string, images: ResolvedImage[], mode: Exclude<ImageMode, \"image\">) {\n const content: Array<Record<string, unknown>> = [{ type: \"text\", text: prompt }];\n for (const image of images) {\n if (mode === \"frame\" && image.role !== \"first_frame\" && image.role !== \"last_frame\") {\n throw new GenerationValidationError(\"Frame mode images must use meta.role first_frame or last_frame\");\n }\n if (mode === \"reference\" && image.role !== \"reference_image\") {\n throw new GenerationValidationError(\"Reference mode images must use meta.role reference_image\");\n }\n content.push({ type: \"image_url\", image_url: { url: image.url }, role: image.role });\n }\n return content;\n}\n\nfunction extractTaskId(response: ArkCreateTaskResponse): string {\n const taskId = asString(response.task_id) ?? asString(response.id);\n if (!taskId) throw new GenerationProviderError(\"Video generation provider did not return a task id\");\n return taskId;\n}\n\nfunction normalizeTaskStatus(response: ArkTaskStatusResponse) {\n if (response.data) {\n const wrapper = response.data;\n const native = wrapper.data;\n const status = (asString(native?.status) ?? asString(wrapper.status) ?? \"unknown\").toLowerCase();\n const videoUrl = asString(wrapper.result_url) ?? asString(native?.content?.video_url);\n const lastFrameUrl = asString(native?.content?.last_frame_url);\n const metadata: Record<string, unknown> = {\n progress: wrapper.progress,\n resolution: native?.resolution,\n ratio: native?.ratio,\n duration: native?.duration,\n framespersecond: native?.framespersecond,\n seed: native?.seed,\n generate_audio: native?.generate_audio,\n model: native?.model,\n usage: native?.usage,\n };\n for (const key of Object.keys(metadata)) if (metadata[key] === undefined) delete metadata[key];\n return { status, videoUrl, lastFrameUrl, metadata };\n }\n return {\n status: (asString(response.status) ?? \"unknown\").toLowerCase(),\n videoUrl: asString(response.url),\n lastFrameUrl: asString(response.last_frame_url),\n metadata:\n response.metadata && typeof response.metadata === \"object\" ? (response.metadata as Record<string, unknown>) : {},\n };\n}\n\nasync function requestJson(input: GenerationAdapterInput, path: string, init: RequestInit): Promise<unknown> {\n const response = await fetchWithTimeout(\n input.context.fetch,\n joinUrl(input.context.baseUrl, path),\n {\n ...init,\n headers: {\n Authorization: `Bearer ${input.context.apiKey}`,\n \"Content-Type\": \"application/json\",\n ...init.headers,\n },\n },\n REQUEST_TIMEOUT_MS,\n );\n\n if (!response.ok) {\n const body = await response.text().catch(() => response.statusText);\n throw new GenerationProviderError(\"Video generation provider request failed\", { status: response.status, body });\n }\n return response.json();\n}\n\nexport async function arkVideoGenerationsAdapter(input: GenerationAdapterInput): Promise<GenerationContentBlock[]> {\n const prompt = mergeTextBlocks(input.declaration, input.request.content);\n if (!prompt) throw new GenerationValidationError(\"Prompt text is required\");\n\n const imageBlocks = input.request.content.filter(\n (block): block is Extract<GenerationContentBlock, { type: \"image\" }> => block.type === \"image\",\n );\n const images = await Promise.all(\n imageBlocks.map(async (block) => ({\n url: await input.context.resolveSource(block.source),\n role: getImageRole(block),\n })),\n );\n\n const mode = classifyImages(images);\n const resolution = asString(input.parameters.resolution) ?? \"720p\";\n const aspectRatio = asString(input.parameters.aspect_ratio) ?? \"16:9\";\n const duration = getIntegerParameter(input.parameters, \"duration\", 5);\n const fps = getIntegerParameter(input.parameters, \"fps\", 30);\n const pollIntervalSec = getIntegerParameter(input.parameters, \"poll_interval\", DEFAULT_POLL_INTERVAL_SEC);\n const maxWaitSec = getIntegerParameter(input.parameters, \"max_wait\", DEFAULT_MAX_WAIT_SEC);\n const generateAudio = asBoolean(input.parameters.generate_audio) ?? true;\n const returnLastFrame = asBoolean(input.parameters.return_last_frame) ?? true;\n const cameraFixed = asBoolean(input.parameters.camera_fixed) ?? false;\n const watermark = asBoolean(input.parameters.watermark) ?? false;\n const seed = asNumber(input.parameters.seed);\n\n const payload: Record<string, unknown> = { model: input.declaration.model, prompt };\n const metadata: Record<string, unknown> = { duration, fps, generate_audio: generateAudio };\n if (seed !== undefined) metadata.seed = seed;\n if (returnLastFrame) metadata.return_last_frame = true;\n if (cameraFixed) metadata.camera_fixed = true;\n if (watermark) metadata.watermark = true;\n\n if (mode === \"frame\" || mode === \"reference\") {\n metadata.content = buildMetadataContent(prompt, images, mode);\n metadata.resolution = resolution;\n metadata.ratio = aspectRatio;\n } else {\n const size = resolveSize(resolution, aspectRatio);\n if (size) {\n payload.width = size.width;\n payload.height = size.height;\n }\n if (images[0]) payload.image = images[0].url;\n }\n payload.metadata = metadata;\n\n const task = (await requestJson(input, \"/v1/video/generations\", {\n method: \"POST\",\n body: JSON.stringify(payload),\n })) as ArkCreateTaskResponse;\n const taskId = extractTaskId(task);\n const startedAt = Date.now();\n\n while (Date.now() - startedAt <= maxWaitSec * 1000) {\n await sleep(pollIntervalSec * 1000);\n const rawStatus = (await requestJson(input, `/v1/video/generations/${encodeURIComponent(taskId)}`, {\n method: \"GET\",\n })) as ArkTaskStatusResponse;\n const status = normalizeTaskStatus(rawStatus);\n\n if (status.status === \"succeeded\") {\n if (!status.videoUrl) throw new GenerationProviderError(\"Video generation succeeded but returned no video URL\");\n const output: GenerationContentBlock[] = [\n {\n type: \"video\",\n source: { type: \"url\", url: status.videoUrl },\n meta: { task_id: taskId, status: status.status, ...status.metadata },\n },\n ];\n if (status.lastFrameUrl)\n output.push({\n type: \"image\",\n source: { type: \"url\", url: status.lastFrameUrl },\n meta: { role: \"last_frame\", task_id: taskId },\n });\n return output;\n }\n\n if ([\"failed\", \"expired\", \"cancelled\"].includes(status.status)) {\n throw new GenerationProviderError(`Video generation ${status.status}`, { details: { taskId, rawStatus } });\n }\n }\n\n throw new GenerationTimeoutError(\"Timed out waiting for video generation\", { taskId });\n}\n","import { GenerationProviderError, GenerationValidationError } from \"../errors.js\";\nimport { fetchWithTimeout, joinUrl } from \"../http.js\";\nimport type { GenerationAdapterInput, GenerationContentBlock } from \"../types.js\";\nimport { mergeTextBlocks } from \"../validation.js\";\n\nconst REQUEST_TIMEOUT_MS = 300_000;\nconst IMAGE_FETCH_TIMEOUT_MS = 60_000;\nconst MAX_REFERENCE_IMAGE_BYTES = 10 * 1024 * 1024;\n\nconst DATA_URI_PATTERN = /^data:([^;]+);base64,(.+)$/s;\nconst MARKDOWN_IMAGE_DATA_URI_PATTERN = /!\\[[^\\]]*\\]\\(data:([^;]+);base64,([^)]+)\\)/;\n\ntype GeminiPart = { text: string } | { inlineData: { mimeType: string; data: string } };\n\ntype GeminiResponsePart = {\n text?: unknown;\n inlineData?: { mimeType?: unknown; data?: unknown };\n inline_data?: { mime_type?: unknown; mimeType?: unknown; data?: unknown };\n};\n\ntype GeminiGenerateContentResponse = {\n candidates?: Array<{ content?: { parts?: GeminiResponsePart[] } }>;\n};\n\nfunction dataUriToInlineData(value: string): GeminiPart | null {\n const match = DATA_URI_PATTERN.exec(value);\n if (!match) return null;\n const [, mimeType, data] = match;\n if (!mimeType || !data) return null;\n return { inlineData: { mimeType, data } };\n}\n\nasync function urlToInlineData(fetchFn: typeof fetch, url: string): Promise<GeminiPart> {\n const response = await fetchWithTimeout(\n fetchFn,\n url,\n { method: \"GET\", headers: { \"User-Agent\": \"NetaGeneration/1.0\" } },\n IMAGE_FETCH_TIMEOUT_MS,\n );\n if (!response.ok) throw new GenerationProviderError(\"Failed to fetch reference image\", { status: response.status });\n\n const contentLength = response.headers.get(\"content-length\");\n if (contentLength && Number(contentLength) > MAX_REFERENCE_IMAGE_BYTES) {\n throw new GenerationValidationError(\"Reference image is too large\");\n }\n\n const bytes = Buffer.from(await response.arrayBuffer());\n if (bytes.byteLength > MAX_REFERENCE_IMAGE_BYTES) throw new GenerationValidationError(\"Reference image is too large\");\n\n const contentType = response.headers.get(\"content-type\")?.split(\";\")[0]?.trim();\n const mimeType = contentType?.startsWith(\"image/\") ? contentType : \"image/png\";\n return { inlineData: { mimeType, data: bytes.toString(\"base64\") } };\n}\n\nasync function sourceToInlineData(input: GenerationAdapterInput, value: string): Promise<GeminiPart> {\n const inline = dataUriToInlineData(value);\n if (inline) return inline;\n if (value.startsWith(\"http://\") || value.startsWith(\"https://\")) return urlToInlineData(input.context.fetch, value);\n throw new GenerationValidationError(\"Unsupported image source for Gemini image generation\");\n}\n\nfunction extractMarkdownDataUriImage(text: string): GenerationContentBlock | null {\n const match = MARKDOWN_IMAGE_DATA_URI_PATTERN.exec(text);\n if (!match) return null;\n const [, mediaType, data] = match;\n if (!mediaType || !data) return null;\n return { type: \"image\", source: { type: \"base64\", mediaType, data } };\n}\n\nfunction appendGeminiPartOutput(output: GenerationContentBlock[], part: GeminiResponsePart): void {\n if (typeof part.text === \"string\" && part.text.trim()) {\n const image = extractMarkdownDataUriImage(part.text);\n if (image) {\n output.push(image);\n return;\n }\n output.push({ type: \"text\", text: part.text });\n return;\n }\n\n if (part.inlineData && typeof part.inlineData.data === \"string\" && part.inlineData.data) {\n output.push({\n type: \"image\",\n source: {\n type: \"base64\",\n mediaType: typeof part.inlineData.mimeType === \"string\" ? part.inlineData.mimeType : \"image/png\",\n data: part.inlineData.data,\n },\n });\n return;\n }\n\n const inline = part.inline_data;\n if (!inline || typeof inline.data !== \"string\" || !inline.data) return;\n const mediaType =\n typeof inline.mime_type === \"string\"\n ? inline.mime_type\n : typeof inline.mimeType === \"string\"\n ? inline.mimeType\n : \"image/png\";\n output.push({ type: \"image\", source: { type: \"base64\", mediaType, data: inline.data } });\n}\n\nexport async function geminiGenerateContentAdapter(input: GenerationAdapterInput): Promise<GenerationContentBlock[]> {\n const prompt = mergeTextBlocks(input.declaration, input.request.content);\n if (!prompt) throw new GenerationValidationError(\"Prompt text is required\");\n\n const imageParts = await Promise.all(\n input.request.content\n .filter((block): block is Extract<GenerationContentBlock, { type: \"image\" }> => block.type === \"image\")\n .map(async (block) => sourceToInlineData(input, await input.context.resolveSource(block.source))),\n );\n\n const generationConfig: Record<string, unknown> = { responseModalities: [\"IMAGE\"] };\n const aspectRatio = input.parameters.aspect_ratio;\n const imageSize = input.parameters.image_size;\n if (typeof aspectRatio === \"string\" || typeof imageSize === \"string\") {\n const image: Record<string, string> = {};\n if (typeof aspectRatio === \"string\") image.aspectRatio = aspectRatio;\n if (typeof imageSize === \"string\") image.imageSize = imageSize;\n generationConfig.responseFormat = { image };\n }\n\n const payload = {\n contents: [{ parts: [{ text: prompt }, ...imageParts] satisfies GeminiPart[] }],\n generationConfig,\n };\n\n const response = await fetchWithTimeout(\n input.context.fetch,\n joinUrl(input.context.baseUrl, `/v1beta/models/${encodeURIComponent(input.declaration.model)}:generateContent`),\n {\n method: \"POST\",\n headers: {\n Authorization: `Bearer ${input.context.apiKey}`,\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(payload),\n },\n REQUEST_TIMEOUT_MS,\n );\n\n if (!response.ok) {\n const body = await response.text().catch(() => response.statusText);\n throw new GenerationProviderError(\"Gemini generation provider request failed\", { status: response.status, body });\n }\n\n const raw = (await response.json()) as GeminiGenerateContentResponse;\n const output: GenerationContentBlock[] = [];\n for (const candidate of raw.candidates ?? []) {\n for (const part of candidate.content?.parts ?? []) appendGeminiPartOutput(output, part);\n }\n if (output.length === 0) throw new GenerationProviderError(\"Gemini generation returned no output\");\n return output;\n}\n","import { GenerationProviderError, GenerationValidationError } from \"../errors.js\";\nimport { fetchWithTimeout, joinUrl } from \"../http.js\";\nimport type { GenerationAdapterInput, GenerationContentBlock } from \"../types.js\";\nimport { mergeTextBlocks } from \"../validation.js\";\n\nconst REQUEST_TIMEOUT_MS = 300_000;\n\ntype OpenAiImagesResponse = {\n data?: Array<{\n url?: unknown;\n revised_prompt?: unknown;\n }>;\n};\n\nexport async function openAiImagesAdapter(input: GenerationAdapterInput): Promise<GenerationContentBlock[]> {\n const prompt = mergeTextBlocks(input.declaration, input.request.content);\n if (!prompt) throw new GenerationValidationError(\"Prompt text is required\");\n\n const images = await Promise.all(\n input.request.content\n .filter((block): block is Extract<GenerationContentBlock, { type: \"image\" }> => block.type === \"image\")\n .map((block) => input.context.resolveSource(block.source)),\n );\n\n const payload: Record<string, unknown> = {\n model: input.declaration.model,\n prompt,\n ...input.parameters,\n };\n if (images.length > 0) payload.image = images;\n\n const response = await fetchWithTimeout(\n input.context.fetch,\n joinUrl(input.context.baseUrl, \"/v1/images/generations\"),\n {\n method: \"POST\",\n headers: {\n Authorization: `Bearer ${input.context.apiKey}`,\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(payload),\n },\n REQUEST_TIMEOUT_MS,\n );\n\n if (!response.ok) {\n const body = await response.text().catch(() => response.statusText);\n throw new GenerationProviderError(\"Image generation provider request failed\", { status: response.status, body });\n }\n\n const raw = (await response.json()) as OpenAiImagesResponse;\n const output: GenerationContentBlock[] = [];\n for (const item of raw.data ?? []) {\n if (typeof item.url === \"string\" && item.url) {\n output.push({ type: \"image\", source: { type: \"url\", url: item.url } });\n }\n if (typeof item.revised_prompt === \"string\" && item.revised_prompt.trim()) {\n output.push({ type: \"text\", text: item.revised_prompt, meta: { role: \"revised_prompt\" } });\n }\n }\n return output;\n}\n","import { GenerationUnsupportedAdapterError } from \"../errors.js\";\nimport type { GenerationAdapter } from \"../types.js\";\nimport { arkVideoGenerationsAdapter } from \"./ark-video-generations.js\";\nimport { geminiGenerateContentAdapter } from \"./gemini-generate-content.js\";\nimport { openAiImagesAdapter } from \"./openai-images.js\";\n\nexport const builtinGenerationAdapters: Record<string, GenerationAdapter> = {\n \"ark.videoGenerations\": arkVideoGenerationsAdapter,\n \"gemini.generateContent\": geminiGenerateContentAdapter,\n \"openai.images\": openAiImagesAdapter,\n};\n\nexport function getGenerationAdapter(\n type: string,\n adapters: Record<string, GenerationAdapter> = {},\n): GenerationAdapter {\n const adapter = adapters[type] ?? builtinGenerationAdapters[type];\n if (!adapter) throw new GenerationUnsupportedAdapterError(type);\n return adapter;\n}\n\nexport * from \"./ark-video-generations.js\";\nexport * from \"./gemini-generate-content.js\";\nexport * from \"./openai-images.js\";\n","import type { GenerationSource, GenerationSourceResolver } from \"./types.js\";\n\nexport const defaultGenerationSourceResolver: GenerationSourceResolver = (source: GenerationSource) => {\n switch (source.type) {\n case \"url\":\n return source.url;\n case \"base64\":\n return `data:${source.mediaType};base64,${source.data}`;\n }\n};\n","import { getGenerationAdapter } from \"./adapters/index.js\";\nimport { builtinGenerationModels } from \"./builtins.js\";\nimport {\n readGenerationModelDeclarationsFromDirectory,\n readGenerationModelDeclarationsFromFiles,\n stringifyGenerationModelDeclaration,\n writeGenerationModelDeclaration,\n writeGenerationModelDeclarations,\n} from \"./config.js\";\nimport { GenerationConfigError } from \"./errors.js\";\nimport { defaultGenerationSourceResolver } from \"./source.js\";\nimport type {\n CreateGenerationClientOptions,\n GenerateRequest,\n GenerationClient,\n GenerationModelDeclaration,\n} from \"./types.js\";\nimport { cloneJson } from \"./utils.js\";\nimport { resolveGenerationParameters, validateGenerationContent } from \"./validation.js\";\n\nconst DEFAULT_BASE_URL = \"https://router.neta.art\";\n\nfunction resolveModels(options: CreateGenerationClientOptions): GenerationModelDeclaration[] {\n const includeBuiltinModels = options.includeBuiltinModels ?? !options.models;\n const models = [...(includeBuiltinModels ? builtinGenerationModels : []), ...(options.models ?? [])];\n const byModel = new Map<string, GenerationModelDeclaration>();\n for (const model of models) byModel.set(model.model, cloneJson(model));\n return [...byModel.values()].sort((a, b) => a.model.localeCompare(b.model));\n}\n\nexport function createGenerationClient(options: CreateGenerationClientOptions = {}): GenerationClient {\n const models = resolveModels(options);\n const byModel = new Map(models.map((declaration) => [declaration.model, declaration]));\n const fetchFn = options.fetch ?? globalThis.fetch;\n if (!fetchFn) throw new GenerationConfigError(\"A fetch implementation is required\");\n\n function requireModel(model: string): GenerationModelDeclaration {\n const declaration = byModel.get(model);\n if (!declaration) throw new GenerationConfigError(`Generation model is unavailable: ${model}`);\n return declaration;\n }\n\n return {\n validate(request: GenerateRequest) {\n const declaration = requireModel(request.model);\n validateGenerationContent(declaration, request.content);\n const parameters = resolveGenerationParameters(declaration, request.parameters);\n return { declaration: cloneJson(declaration), request: cloneJson(request), parameters };\n },\n\n async generate(request: GenerateRequest) {\n const resolved = this.validate(request);\n const apiKey = request.apiKey ?? options.apiKey;\n if (!apiKey) throw new GenerationConfigError(\"apiKey is required\");\n const adapter = getGenerationAdapter(resolved.declaration.adapter.type, options.adapters);\n return adapter({\n ...resolved,\n context: {\n apiKey,\n baseUrl: request.baseUrl ?? options.baseUrl ?? DEFAULT_BASE_URL,\n fetch: fetchFn,\n resolveSource: options.sourceResolver ?? defaultGenerationSourceResolver,\n },\n });\n },\n\n listModels() {\n return cloneJson(models);\n },\n\n getModel(model: string) {\n const declaration = byModel.get(model);\n return declaration ? cloneJson(declaration) : null;\n },\n\n stringifyModelConfig(model: string, stringifyOptions = {}) {\n return stringifyGenerationModelDeclaration(requireModel(model), stringifyOptions);\n },\n\n exportModelConfig(model: string, filePath: string) {\n return writeGenerationModelDeclaration(requireModel(model), filePath);\n },\n\n exportModelConfigs(directory: string) {\n return writeGenerationModelDeclarations(models, directory);\n },\n };\n}\n\nexport async function createGenerationClientFromFiles(\n filePaths: string[],\n options: Omit<CreateGenerationClientOptions, \"models\"> = {},\n): Promise<GenerationClient> {\n const models = await readGenerationModelDeclarationsFromFiles(filePaths);\n return createGenerationClient({ ...options, models, includeBuiltinModels: options.includeBuiltinModels ?? true });\n}\n\nexport async function createGenerationClientFromDirectory(\n directory: string,\n options: Omit<CreateGenerationClientOptions, \"models\"> = {},\n): Promise<GenerationClient> {\n const models = await readGenerationModelDeclarationsFromDirectory(directory);\n return createGenerationClient({ ...options, models, includeBuiltinModels: options.includeBuiltinModels ?? true });\n}\n\nexport async function createGenerationClientFromFile(\n filePath: string,\n options: Omit<CreateGenerationClientOptions, \"models\"> = {},\n): Promise<GenerationClient> {\n return createGenerationClientFromFiles([filePath], options);\n}\n"],"mappings":";;;;AAEA,eAAsB,iBACpB,SACA,KACA,MACA,WACmB;CACnB,MAAM,aAAa,IAAI,iBAAiB;CACxC,MAAM,UAAU,iBAAiB,WAAW,OAAO,EAAE,UAAU;AAC/D,KAAI;AACF,SAAO,MAAM,QAAQ,KAAK;GAAE,GAAG;GAAM,QAAQ,WAAW;GAAQ,CAAC;UAC1D,OAAO;AACd,MAAI,iBAAiB,SAAS,MAAM,SAAS,aAAc,OAAM,IAAI,wBAAwB;AAC7F,QAAM;WACE;AACR,eAAa,QAAQ;;;AAIzB,SAAgB,QAAQ,SAAiB,MAAsB;AAC7D,QAAO,GAAG,QAAQ,QAAQ,QAAQ,GAAG,CAAC,GAAG,KAAK,QAAQ,QAAQ,GAAG;;;;;AClBnE,SAAS,YAAY,OAAgC;CACnD,MAAM,sBAAM,IAAI,KAA2D;AAC3E,MAAK,MAAM,QAAQ,MAAO,KAAI,IAAI,KAAK,MAAM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M,6CAA6C,UAAU;AAC5E,QAAO,uBAAuB;EAAE,GAAG;EAAS;EAAQ,sBAAsB,QAAQ,wBAAwB;EAAM,CAAC;;AAGnH,eAAsB,+BACpB,UACA,UAAyD,EAAE,EAChC;AAC3B,QAAO,gCAAgC,CAAC,SAAS,EAAE,QAAQ"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
schema: neta.generation.model.v1
|
|
2
|
+
model: gemini-3.1-flash-image-preview
|
|
3
|
+
title: Gemini 3.1 Flash Image Preview
|
|
4
|
+
description: Gemini image generation and editing model. Good for text rendering, infographics, style transfer, and iterative image editing with references.
|
|
5
|
+
adapter:
|
|
6
|
+
type: gemini.generateContent
|
|
7
|
+
content:
|
|
8
|
+
input:
|
|
9
|
+
- type: text
|
|
10
|
+
required: true
|
|
11
|
+
min: 1
|
|
12
|
+
max: 16
|
|
13
|
+
merge: newline
|
|
14
|
+
description: Prompt text.
|
|
15
|
+
- type: image
|
|
16
|
+
required: false
|
|
17
|
+
max: 14
|
|
18
|
+
sources:
|
|
19
|
+
- url
|
|
20
|
+
- base64
|
|
21
|
+
description: Optional reference images.
|
|
22
|
+
parameters:
|
|
23
|
+
aspect_ratio:
|
|
24
|
+
type: string
|
|
25
|
+
optional: true
|
|
26
|
+
default: "1:1"
|
|
27
|
+
enum:
|
|
28
|
+
- "1:1"
|
|
29
|
+
- "16:9"
|
|
30
|
+
- "4:3"
|
|
31
|
+
- "3:2"
|
|
32
|
+
- "3:4"
|
|
33
|
+
- "2:3"
|
|
34
|
+
- "9:16"
|
|
35
|
+
- "5:4"
|
|
36
|
+
- "4:5"
|
|
37
|
+
- "21:9"
|
|
38
|
+
- "1:4"
|
|
39
|
+
- "4:1"
|
|
40
|
+
- "1:8"
|
|
41
|
+
- "8:1"
|
|
42
|
+
description: Output aspect ratio.
|
|
43
|
+
image_size:
|
|
44
|
+
type: string
|
|
45
|
+
optional: true
|
|
46
|
+
default: 2K
|
|
47
|
+
enum:
|
|
48
|
+
- "512"
|
|
49
|
+
- 1K
|
|
50
|
+
- 2K
|
|
51
|
+
- 4K
|
|
52
|
+
description: Output image resolution.
|
|
53
|
+
examples:
|
|
54
|
+
- title: Basic image
|
|
55
|
+
request:
|
|
56
|
+
model: gemini-3.1-flash-image-preview
|
|
57
|
+
content:
|
|
58
|
+
- type: text
|
|
59
|
+
text: a vibrant infographic explaining photosynthesis with clear readable labels
|
|
60
|
+
parameters:
|
|
61
|
+
aspect_ratio: "16:9"
|
|
62
|
+
image_size: 1K
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
schema: neta.generation.model.v1
|
|
2
|
+
model: gpt-image-2
|
|
3
|
+
title: GPT Image 2
|
|
4
|
+
description: Image generation model with optional reference images. Good for photorealistic scenes, detailed images, and image editing with references.
|
|
5
|
+
adapter:
|
|
6
|
+
type: openai.images
|
|
7
|
+
content:
|
|
8
|
+
input:
|
|
9
|
+
- type: text
|
|
10
|
+
required: true
|
|
11
|
+
min: 1
|
|
12
|
+
max: 16
|
|
13
|
+
merge: newline
|
|
14
|
+
description: Prompt text.
|
|
15
|
+
- type: image
|
|
16
|
+
required: false
|
|
17
|
+
max: 16
|
|
18
|
+
sources:
|
|
19
|
+
- url
|
|
20
|
+
- base64
|
|
21
|
+
description: Optional reference images.
|
|
22
|
+
parameters:
|
|
23
|
+
size:
|
|
24
|
+
type: string
|
|
25
|
+
optional: true
|
|
26
|
+
default: 1024x1024
|
|
27
|
+
description: Output image size.
|
|
28
|
+
examples:
|
|
29
|
+
- auto
|
|
30
|
+
- 1024x1024
|
|
31
|
+
- 1536x1024
|
|
32
|
+
- 1024x1536
|
|
33
|
+
- 2048x2048
|
|
34
|
+
- 2048x1152
|
|
35
|
+
- 3840x2160
|
|
36
|
+
- 2160x3840
|
|
37
|
+
quality:
|
|
38
|
+
type: string
|
|
39
|
+
optional: true
|
|
40
|
+
default: auto
|
|
41
|
+
enum:
|
|
42
|
+
- auto
|
|
43
|
+
- low
|
|
44
|
+
- medium
|
|
45
|
+
- high
|
|
46
|
+
description: Image quality.
|
|
47
|
+
examples:
|
|
48
|
+
- title: Basic image
|
|
49
|
+
request:
|
|
50
|
+
model: gpt-image-2
|
|
51
|
+
content:
|
|
52
|
+
- type: text
|
|
53
|
+
text: a cyberpunk cat in neon rain
|
|
54
|
+
parameters:
|
|
55
|
+
size: 1024x1024
|
|
56
|
+
quality: auto
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
schema: neta.generation.model.v1
|
|
2
|
+
model: seedance-2-0-fast
|
|
3
|
+
title: Seedance 2.0 Fast
|
|
4
|
+
description: Fast Ark video generation model for drafts, rapid iteration, text-to-video, image-to-video, and reference-guided video generation.
|
|
5
|
+
adapter:
|
|
6
|
+
type: ark.videoGenerations
|
|
7
|
+
content:
|
|
8
|
+
input:
|
|
9
|
+
- type: text
|
|
10
|
+
required: true
|
|
11
|
+
min: 1
|
|
12
|
+
max: 16
|
|
13
|
+
merge: newline
|
|
14
|
+
description: Video prompt.
|
|
15
|
+
- type: image
|
|
16
|
+
required: false
|
|
17
|
+
max: 9
|
|
18
|
+
sources:
|
|
19
|
+
- url
|
|
20
|
+
- base64
|
|
21
|
+
description: Optional image input. Use meta.role as first_frame, last_frame, or reference_image.
|
|
22
|
+
parameters:
|
|
23
|
+
duration:
|
|
24
|
+
type: integer
|
|
25
|
+
optional: true
|
|
26
|
+
default: 5
|
|
27
|
+
min: 4
|
|
28
|
+
max: 15
|
|
29
|
+
description: Video duration in seconds.
|
|
30
|
+
resolution:
|
|
31
|
+
type: string
|
|
32
|
+
optional: true
|
|
33
|
+
default: 720p
|
|
34
|
+
enum: [480p, 720p, 1080p, 2K]
|
|
35
|
+
description: Output video resolution.
|
|
36
|
+
aspect_ratio:
|
|
37
|
+
type: string
|
|
38
|
+
optional: true
|
|
39
|
+
default: "16:9"
|
|
40
|
+
enum: ["16:9", "9:16", "1:1", "4:3", "3:2", "2:3", "3:4", "21:9", adaptive]
|
|
41
|
+
description: Output aspect ratio. Use adaptive to let the model choose.
|
|
42
|
+
fps:
|
|
43
|
+
type: integer
|
|
44
|
+
optional: true
|
|
45
|
+
default: 30
|
|
46
|
+
min: 1
|
|
47
|
+
max: 60
|
|
48
|
+
description: Frames per second.
|
|
49
|
+
seed:
|
|
50
|
+
type: integer
|
|
51
|
+
optional: true
|
|
52
|
+
description: Random seed for reproducibility.
|
|
53
|
+
generate_audio:
|
|
54
|
+
type: boolean
|
|
55
|
+
optional: true
|
|
56
|
+
default: true
|
|
57
|
+
description: Generate synchronized audio.
|
|
58
|
+
return_last_frame:
|
|
59
|
+
type: boolean
|
|
60
|
+
optional: true
|
|
61
|
+
default: true
|
|
62
|
+
description: Return the last frame as an image for chaining video segments.
|
|
63
|
+
camera_fixed:
|
|
64
|
+
type: boolean
|
|
65
|
+
optional: true
|
|
66
|
+
default: false
|
|
67
|
+
description: Fix camera position when supported.
|
|
68
|
+
watermark:
|
|
69
|
+
type: boolean
|
|
70
|
+
optional: true
|
|
71
|
+
default: false
|
|
72
|
+
description: Add AI Generated watermark.
|
|
73
|
+
poll_interval:
|
|
74
|
+
type: integer
|
|
75
|
+
optional: true
|
|
76
|
+
default: 2
|
|
77
|
+
min: 1
|
|
78
|
+
max: 30
|
|
79
|
+
description: Seconds between task status checks.
|
|
80
|
+
max_wait:
|
|
81
|
+
type: integer
|
|
82
|
+
optional: true
|
|
83
|
+
default: 600
|
|
84
|
+
min: 30
|
|
85
|
+
max: 1800
|
|
86
|
+
description: Maximum seconds to wait for task completion.
|
|
87
|
+
examples:
|
|
88
|
+
- title: Text to video
|
|
89
|
+
request:
|
|
90
|
+
model: seedance-2-0-fast
|
|
91
|
+
content:
|
|
92
|
+
- type: text
|
|
93
|
+
text: a cat playing piano in a cozy jazz club, cinematic lighting, smooth camera movement
|
|
94
|
+
parameters:
|
|
95
|
+
duration: 5
|
|
96
|
+
resolution: 720p
|
|
97
|
+
aspect_ratio: "16:9"
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
schema: neta.generation.model.v1
|
|
2
|
+
model: seedance-2-0
|
|
3
|
+
title: Seedance 2.0
|
|
4
|
+
description: Higher quality Ark video generation model for final production outputs.
|
|
5
|
+
adapter:
|
|
6
|
+
type: ark.videoGenerations
|
|
7
|
+
content:
|
|
8
|
+
input:
|
|
9
|
+
- type: text
|
|
10
|
+
required: true
|
|
11
|
+
min: 1
|
|
12
|
+
max: 16
|
|
13
|
+
merge: newline
|
|
14
|
+
description: Video prompt.
|
|
15
|
+
- type: image
|
|
16
|
+
required: false
|
|
17
|
+
max: 9
|
|
18
|
+
sources:
|
|
19
|
+
- url
|
|
20
|
+
- base64
|
|
21
|
+
description: Optional image input. Use meta.role as first_frame, last_frame, or reference_image.
|
|
22
|
+
parameters:
|
|
23
|
+
duration:
|
|
24
|
+
type: integer
|
|
25
|
+
optional: true
|
|
26
|
+
default: 5
|
|
27
|
+
min: 4
|
|
28
|
+
max: 15
|
|
29
|
+
description: Video duration in seconds.
|
|
30
|
+
resolution:
|
|
31
|
+
type: string
|
|
32
|
+
optional: true
|
|
33
|
+
default: 1080p
|
|
34
|
+
enum: [480p, 720p, 1080p, 2K]
|
|
35
|
+
description: Output video resolution.
|
|
36
|
+
aspect_ratio:
|
|
37
|
+
type: string
|
|
38
|
+
optional: true
|
|
39
|
+
default: "16:9"
|
|
40
|
+
enum: ["16:9", "9:16", "1:1", "4:3", "3:2", "2:3", "3:4", "21:9", adaptive]
|
|
41
|
+
description: Output aspect ratio. Use adaptive to let the model choose.
|
|
42
|
+
fps:
|
|
43
|
+
type: integer
|
|
44
|
+
optional: true
|
|
45
|
+
default: 30
|
|
46
|
+
min: 1
|
|
47
|
+
max: 60
|
|
48
|
+
description: Frames per second.
|
|
49
|
+
seed:
|
|
50
|
+
type: integer
|
|
51
|
+
optional: true
|
|
52
|
+
description: Random seed for reproducibility.
|
|
53
|
+
generate_audio:
|
|
54
|
+
type: boolean
|
|
55
|
+
optional: true
|
|
56
|
+
default: true
|
|
57
|
+
description: Generate synchronized audio.
|
|
58
|
+
return_last_frame:
|
|
59
|
+
type: boolean
|
|
60
|
+
optional: true
|
|
61
|
+
default: true
|
|
62
|
+
description: Return the last frame as an image for chaining video segments.
|
|
63
|
+
camera_fixed:
|
|
64
|
+
type: boolean
|
|
65
|
+
optional: true
|
|
66
|
+
default: false
|
|
67
|
+
description: Fix camera position when supported.
|
|
68
|
+
watermark:
|
|
69
|
+
type: boolean
|
|
70
|
+
optional: true
|
|
71
|
+
default: false
|
|
72
|
+
description: Add AI Generated watermark.
|
|
73
|
+
poll_interval:
|
|
74
|
+
type: integer
|
|
75
|
+
optional: true
|
|
76
|
+
default: 2
|
|
77
|
+
min: 1
|
|
78
|
+
max: 30
|
|
79
|
+
description: Seconds between task status checks.
|
|
80
|
+
max_wait:
|
|
81
|
+
type: integer
|
|
82
|
+
optional: true
|
|
83
|
+
default: 900
|
|
84
|
+
min: 30
|
|
85
|
+
max: 1800
|
|
86
|
+
description: Maximum seconds to wait for task completion.
|
|
87
|
+
examples:
|
|
88
|
+
- title: Text to video
|
|
89
|
+
request:
|
|
90
|
+
model: seedance-2-0
|
|
91
|
+
content:
|
|
92
|
+
- type: text
|
|
93
|
+
text: a cat playing piano in a cozy jazz club, cinematic lighting, smooth camera movement
|
|
94
|
+
parameters:
|
|
95
|
+
duration: 5
|
|
96
|
+
resolution: 1080p
|
|
97
|
+
aspect_ratio: "16:9"
|
package/package.json
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@neta-art/generation",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "A lightweight multimodal generation SDK with built-in model presets and adapter-based provider calls.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"ai",
|
|
7
|
+
"generation",
|
|
8
|
+
"generative-ai",
|
|
9
|
+
"multimodal",
|
|
10
|
+
"image-generation",
|
|
11
|
+
"video-generation",
|
|
12
|
+
"sdk",
|
|
13
|
+
"neta-art"
|
|
14
|
+
],
|
|
15
|
+
"homepage": "https://www.neta.art/",
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/talesofai/generation-sdk.git"
|
|
19
|
+
},
|
|
20
|
+
"bugs": {
|
|
21
|
+
"url": "https://github.com/talesofai/generation-sdk/issues"
|
|
22
|
+
},
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"type": "module",
|
|
25
|
+
"sideEffects": false,
|
|
26
|
+
"exports": {
|
|
27
|
+
".": {
|
|
28
|
+
"types": "./dist/index.d.ts",
|
|
29
|
+
"import": "./dist/index.js"
|
|
30
|
+
},
|
|
31
|
+
"./models": {
|
|
32
|
+
"types": "./dist/builtins.d.ts",
|
|
33
|
+
"import": "./dist/builtins.js"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"bin": {
|
|
37
|
+
"neta-generation": "./dist/cli/index.js"
|
|
38
|
+
},
|
|
39
|
+
"files": [
|
|
40
|
+
"dist",
|
|
41
|
+
"models",
|
|
42
|
+
"README.md"
|
|
43
|
+
],
|
|
44
|
+
"scripts": {
|
|
45
|
+
"build": "tsdown",
|
|
46
|
+
"example:basic-image": "node --env-file=.env --experimental-strip-types examples/basic-image.ts",
|
|
47
|
+
"example:image-editing": "node --env-file=.env --experimental-strip-types examples/image-editing.ts",
|
|
48
|
+
"example:text-to-video": "node --env-file=.env --experimental-strip-types examples/text-to-video.ts",
|
|
49
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
50
|
+
"test": "vitest run",
|
|
51
|
+
"test:watch": "vitest",
|
|
52
|
+
"lint": "biome check .",
|
|
53
|
+
"lint:fix": "biome check --write .",
|
|
54
|
+
"format": "biome format --write .",
|
|
55
|
+
"prepublishOnly": "pnpm lint && pnpm typecheck && pnpm test && pnpm build"
|
|
56
|
+
},
|
|
57
|
+
"dependencies": {
|
|
58
|
+
"yaml": "^2.8.3"
|
|
59
|
+
},
|
|
60
|
+
"devDependencies": {
|
|
61
|
+
"@biomejs/biome": "^2.4.1",
|
|
62
|
+
"@types/node": "^22.10.0",
|
|
63
|
+
"tsdown": "^0.15.0",
|
|
64
|
+
"typescript": "^5.8.0",
|
|
65
|
+
"vitest": "^3.2.0"
|
|
66
|
+
},
|
|
67
|
+
"engines": {
|
|
68
|
+
"node": ">=20.0.0"
|
|
69
|
+
},
|
|
70
|
+
"packageManager": "pnpm@10.32.1",
|
|
71
|
+
"publishConfig": {
|
|
72
|
+
"access": "public"
|
|
73
|
+
}
|
|
74
|
+
}
|