iagenify 0.4.0 → 0.4.1
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/dist/index.cjs +35 -17
- package/dist/index.js +35 -17
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -5081,20 +5081,26 @@ ${r.text}`).join("\n\n"), 3e4),
|
|
|
5081
5081
|
}
|
|
5082
5082
|
};
|
|
5083
5083
|
}
|
|
5084
|
-
var OMNI_MODELS = ["gemini-omni-1.1-flash-preview"
|
|
5084
|
+
var OMNI_MODELS = ["gemini-omni-1.1-flash-preview"];
|
|
5085
|
+
var OMNI_SECONDS = { min: 3, max: 10, default: 10 };
|
|
5085
5086
|
var IMAGE_MODELS = ["gemini-3.1-flash-image", "gemini-2.5-flash-image", ...OMNI_MODELS];
|
|
5086
5087
|
var VIDEO_MODELS = ["veo-3.1-lite", "veo-3.1-fast", "veo-3.1", ...OMNI_MODELS];
|
|
5087
5088
|
var VIDEO_RESOLUTIONS = {
|
|
5088
5089
|
"veo-3.1": ["720p", "1080p", "4K"],
|
|
5089
5090
|
"veo-3.1-fast": ["720p", "1080p", "4K"],
|
|
5090
5091
|
"veo-3.1-lite": ["720p", "1080p"],
|
|
5091
|
-
// Omni
|
|
5092
|
-
//
|
|
5093
|
-
"gemini-omni-1.1-flash-preview": []
|
|
5094
|
-
"gemini-omni-flash-preview": []
|
|
5092
|
+
// Omni (P83) : les deux résolutions mesurées. La 4K et le 360p existent dans les types de l'API,
|
|
5093
|
+
// mais aucune n'a été mesurée — donc aucune n'a de prix.
|
|
5094
|
+
"gemini-omni-1.1-flash-preview": ["720p", "1080p"]
|
|
5095
5095
|
};
|
|
5096
5096
|
var VIDEO_WITH_AUDIO = ["veo-3.1"];
|
|
5097
5097
|
var VIDEO_DURATIONS = [4, 6, 8];
|
|
5098
|
+
var VIDEO_DURATIONS_BY_MODEL = {
|
|
5099
|
+
"veo-3.1": VIDEO_DURATIONS,
|
|
5100
|
+
"veo-3.1-fast": VIDEO_DURATIONS,
|
|
5101
|
+
"veo-3.1-lite": VIDEO_DURATIONS,
|
|
5102
|
+
...Object.fromEntries(OMNI_MODELS.map((m) => [m, [3, 4, 5, 6, 7, 8, 9, 10]]))
|
|
5103
|
+
};
|
|
5098
5104
|
var MEDIA = {
|
|
5099
5105
|
create_image: {
|
|
5100
5106
|
type: "image",
|
|
@@ -5128,9 +5134,9 @@ var MEDIA = {
|
|
|
5128
5134
|
cost: "13 to 150 credits per second: 4s of veo-3.1-lite in 720p costs 52, 8s of veo-3.1 in 1080p with audio costs 800",
|
|
5129
5135
|
from: "Workspace image to animate: the video starts from it",
|
|
5130
5136
|
params: {
|
|
5131
|
-
model: { type: "string", enum: VIDEO_MODELS, description: "veo-3.1-lite (13-20 credits/s, default) \xB7 veo-3.1-fast (25-75) \xB7 veo-3.1 (50-150, the only one with sound)" },
|
|
5132
|
-
duration: { type: "number", description: "Seconds: 4, 6 or 8. The price is per second.
|
|
5133
|
-
resolution: { type: "string", enum: ["720p", "1080p", "4K"], description: "Default 720p. 4K needs veo-3.1 or veo-3.1-fast." },
|
|
5137
|
+
model: { type: "string", enum: VIDEO_MODELS, description: "veo-3.1-lite (13-20 credits/s, default) \xB7 veo-3.1-fast (25-75) \xB7 veo-3.1 (50-150, the only one with sound) \xB7 gemini-omni-1.1-flash-preview (about 25 credits/s in 720p, 38 in 1080p; any length from 3 to 10 s)" },
|
|
5138
|
+
duration: { type: "number", description: "Seconds. veo: 4, 6 or 8, default 4. omni: anything from 3 to 10 (10 is the provider's maximum), default 10. The price is per second." },
|
|
5139
|
+
resolution: { type: "string", enum: ["720p", "1080p", "4K"], description: "Default 720p. 4K needs veo-3.1 or veo-3.1-fast; omni does 720p or 1080p." },
|
|
5134
5140
|
audio: { type: "boolean", description: "Sound in the video. Only veo-3.1 makes it, and it doubles the price. Default false." },
|
|
5135
5141
|
aspect: { type: "string", enum: ["16:9", "9:16"], description: "Landscape or portrait. Default 16:9." }
|
|
5136
5142
|
},
|
|
@@ -5138,11 +5144,17 @@ var MEDIA = {
|
|
|
5138
5144
|
// produire doit se dire tout de suite, pas revenir en erreur du fournisseur une fois payé.
|
|
5139
5145
|
verify: (a, model) => {
|
|
5140
5146
|
if (OMNI_MODELS.includes(model)) {
|
|
5141
|
-
|
|
5142
|
-
|
|
5143
|
-
|
|
5147
|
+
if (a.audio === true) fail5(`"${model}" has no sound option. Use veo-3.1 for sound.`);
|
|
5148
|
+
if (a.duration !== void 0 && a.duration !== null && a.duration !== "") {
|
|
5149
|
+
const d = Number(a.duration);
|
|
5150
|
+
if (!Number.isFinite(d) || d < OMNI_SECONDS.min || d > OMNI_SECONDS.max) {
|
|
5151
|
+
fail5(`"${model}" makes videos of ${OMNI_SECONDS.min} to ${OMNI_SECONDS.max} seconds (the provider's limit); you asked for ${a.duration}.`);
|
|
5144
5152
|
}
|
|
5145
5153
|
}
|
|
5154
|
+
const permises = VIDEO_RESOLUTIONS[model] || [];
|
|
5155
|
+
if (filled2(a.resolution) && !permises.includes(a.resolution)) {
|
|
5156
|
+
fail5(`"${model}" has no ${a.resolution}. It does ${permises.join(", ")}.`);
|
|
5157
|
+
}
|
|
5146
5158
|
return;
|
|
5147
5159
|
}
|
|
5148
5160
|
if (a.audio === true && !VIDEO_WITH_AUDIO.includes(model)) {
|
|
@@ -5156,13 +5168,19 @@ var MEDIA = {
|
|
|
5156
5168
|
fail5(`"${model}" has no ${a.resolution}. It does ${allowed.join(", ")} \u2014 change the resolution, or pick another model.`);
|
|
5157
5169
|
}
|
|
5158
5170
|
},
|
|
5159
|
-
|
|
5171
|
+
// Omni : seulement ce qui a été demandé — sans durée, le modèle fait ses 10 s par défaut, et un
|
|
5172
|
+
// défaut de 4 s imposé ici changerait en silence ce qu'un appel sans option produisait.
|
|
5173
|
+
settings: (a, model) => OMNI_MODELS.includes(model) ? {
|
|
5174
|
+
...Number(a.duration) > 0 ? { duration: Number(a.duration) } : {},
|
|
5175
|
+
...filled2(a.resolution) ? { resolution: a.resolution } : {},
|
|
5176
|
+
...filled2(a.aspect) ? { aspectRatio: a.aspect } : {}
|
|
5177
|
+
} : {
|
|
5160
5178
|
duration: Number(a.duration) > 0 ? Number(a.duration) : 4,
|
|
5161
5179
|
resolution: a.resolution || "720p",
|
|
5162
5180
|
audio: a.audio === true,
|
|
5163
5181
|
...filled2(a.aspect) ? { aspectRatio: a.aspect } : {}
|
|
5164
|
-
}
|
|
5165
|
-
detail: (a) => [`${Number(a.duration) > 0 ? Number(a.duration) : 4}s`, a.resolution || "720p", a.audio === true ? "with audio" : "silent"]
|
|
5182
|
+
},
|
|
5183
|
+
detail: (a, model) => OMNI_MODELS.includes(model) ? [`${Number(a.duration) > 0 ? Number(a.duration) : OMNI_SECONDS.default}s`, a.resolution || "720p", ...filled2(a.aspect) ? [a.aspect] : []] : [`${Number(a.duration) > 0 ? Number(a.duration) : 4}s`, a.resolution || "720p", a.audio === true ? "with audio" : "silent"]
|
|
5166
5184
|
},
|
|
5167
5185
|
create_voice: {
|
|
5168
5186
|
type: "audio",
|
|
@@ -5208,7 +5226,7 @@ var MEDIA_OPTIONS = Object.fromEntries(Object.entries(MEDIA).map(([nom, spec]) =
|
|
|
5208
5226
|
model: spec.model,
|
|
5209
5227
|
models: spec.models,
|
|
5210
5228
|
params: Object.fromEntries(Object.entries(spec.params || {}).map(([cle, p]) => [cle, { type: p.type, values: p.enum || null }])),
|
|
5211
|
-
...nom === "create_video" ? { resolutionsByModel: VIDEO_RESOLUTIONS, audioModels: VIDEO_WITH_AUDIO, durations: VIDEO_DURATIONS } : {}
|
|
5229
|
+
...nom === "create_video" ? { resolutionsByModel: VIDEO_RESOLUTIONS, audioModels: VIDEO_WITH_AUDIO, durations: VIDEO_DURATIONS, durationsByModel: VIDEO_DURATIONS_BY_MODEL } : {}
|
|
5212
5230
|
}
|
|
5213
5231
|
]));
|
|
5214
5232
|
var MEDIA_KINDS = Object.fromEntries(Object.keys(MEDIA).map((n) => [n, n.replace(/^create_/, "")]));
|
|
@@ -5252,7 +5270,7 @@ function createMediaTools({ client, media = {} }) {
|
|
|
5252
5270
|
if (source.size > ATTACHMENT_MAX) fail5(`"${source.path}" is ${(source.size / 1048576).toFixed(1)} MB; the starting image must be under ${ATTACHMENT_MAX / 1048576} MB.`);
|
|
5253
5271
|
inputs.push({ type: "image", content: Buffer.from(source.content).toString("base64"), mime });
|
|
5254
5272
|
}
|
|
5255
|
-
const session = await models.create({ model, settings: spec.settings(args), memory: false });
|
|
5273
|
+
const session = await models.create({ model, settings: spec.settings(args, model), memory: false });
|
|
5256
5274
|
try {
|
|
5257
5275
|
const result = await session.generate({ inputs, outputs: [{ type: spec.output }] });
|
|
5258
5276
|
const output = result.outputs?.find((o) => o.content);
|
|
@@ -5260,7 +5278,7 @@ function createMediaTools({ client, media = {} }) {
|
|
|
5260
5278
|
const ext = output.mime?.split("/")[1]?.split(";")[0]?.replace("mpeg", "mp3") || spec.ext;
|
|
5261
5279
|
const target = path || `Agent/${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}/${Date.now()}.${ext}`;
|
|
5262
5280
|
const item = await files.write(target, Buffer.from(output.content, "base64"));
|
|
5263
|
-
const fait = [model, ...spec.detail(args)].join(", ");
|
|
5281
|
+
const fait = [model, ...spec.detail(args, model)].join(", ");
|
|
5264
5282
|
return {
|
|
5265
5283
|
output: `Saved ${spec.type} to ${item.path} (${item.size} bytes, ${result.usage?.credits ?? "?"} credits \u2014 ${fait}).`,
|
|
5266
5284
|
summary: `Created ${item.path}`,
|
package/dist/index.js
CHANGED
|
@@ -5023,20 +5023,26 @@ ${r.text}`).join("\n\n"), 3e4),
|
|
|
5023
5023
|
}
|
|
5024
5024
|
};
|
|
5025
5025
|
}
|
|
5026
|
-
var OMNI_MODELS = ["gemini-omni-1.1-flash-preview"
|
|
5026
|
+
var OMNI_MODELS = ["gemini-omni-1.1-flash-preview"];
|
|
5027
|
+
var OMNI_SECONDS = { min: 3, max: 10, default: 10 };
|
|
5027
5028
|
var IMAGE_MODELS = ["gemini-3.1-flash-image", "gemini-2.5-flash-image", ...OMNI_MODELS];
|
|
5028
5029
|
var VIDEO_MODELS = ["veo-3.1-lite", "veo-3.1-fast", "veo-3.1", ...OMNI_MODELS];
|
|
5029
5030
|
var VIDEO_RESOLUTIONS = {
|
|
5030
5031
|
"veo-3.1": ["720p", "1080p", "4K"],
|
|
5031
5032
|
"veo-3.1-fast": ["720p", "1080p", "4K"],
|
|
5032
5033
|
"veo-3.1-lite": ["720p", "1080p"],
|
|
5033
|
-
// Omni
|
|
5034
|
-
//
|
|
5035
|
-
"gemini-omni-1.1-flash-preview": []
|
|
5036
|
-
"gemini-omni-flash-preview": []
|
|
5034
|
+
// Omni (P83) : les deux résolutions mesurées. La 4K et le 360p existent dans les types de l'API,
|
|
5035
|
+
// mais aucune n'a été mesurée — donc aucune n'a de prix.
|
|
5036
|
+
"gemini-omni-1.1-flash-preview": ["720p", "1080p"]
|
|
5037
5037
|
};
|
|
5038
5038
|
var VIDEO_WITH_AUDIO = ["veo-3.1"];
|
|
5039
5039
|
var VIDEO_DURATIONS = [4, 6, 8];
|
|
5040
|
+
var VIDEO_DURATIONS_BY_MODEL = {
|
|
5041
|
+
"veo-3.1": VIDEO_DURATIONS,
|
|
5042
|
+
"veo-3.1-fast": VIDEO_DURATIONS,
|
|
5043
|
+
"veo-3.1-lite": VIDEO_DURATIONS,
|
|
5044
|
+
...Object.fromEntries(OMNI_MODELS.map((m) => [m, [3, 4, 5, 6, 7, 8, 9, 10]]))
|
|
5045
|
+
};
|
|
5040
5046
|
var MEDIA = {
|
|
5041
5047
|
create_image: {
|
|
5042
5048
|
type: "image",
|
|
@@ -5070,9 +5076,9 @@ var MEDIA = {
|
|
|
5070
5076
|
cost: "13 to 150 credits per second: 4s of veo-3.1-lite in 720p costs 52, 8s of veo-3.1 in 1080p with audio costs 800",
|
|
5071
5077
|
from: "Workspace image to animate: the video starts from it",
|
|
5072
5078
|
params: {
|
|
5073
|
-
model: { type: "string", enum: VIDEO_MODELS, description: "veo-3.1-lite (13-20 credits/s, default) \xB7 veo-3.1-fast (25-75) \xB7 veo-3.1 (50-150, the only one with sound)" },
|
|
5074
|
-
duration: { type: "number", description: "Seconds: 4, 6 or 8. The price is per second.
|
|
5075
|
-
resolution: { type: "string", enum: ["720p", "1080p", "4K"], description: "Default 720p. 4K needs veo-3.1 or veo-3.1-fast." },
|
|
5079
|
+
model: { type: "string", enum: VIDEO_MODELS, description: "veo-3.1-lite (13-20 credits/s, default) \xB7 veo-3.1-fast (25-75) \xB7 veo-3.1 (50-150, the only one with sound) \xB7 gemini-omni-1.1-flash-preview (about 25 credits/s in 720p, 38 in 1080p; any length from 3 to 10 s)" },
|
|
5080
|
+
duration: { type: "number", description: "Seconds. veo: 4, 6 or 8, default 4. omni: anything from 3 to 10 (10 is the provider's maximum), default 10. The price is per second." },
|
|
5081
|
+
resolution: { type: "string", enum: ["720p", "1080p", "4K"], description: "Default 720p. 4K needs veo-3.1 or veo-3.1-fast; omni does 720p or 1080p." },
|
|
5076
5082
|
audio: { type: "boolean", description: "Sound in the video. Only veo-3.1 makes it, and it doubles the price. Default false." },
|
|
5077
5083
|
aspect: { type: "string", enum: ["16:9", "9:16"], description: "Landscape or portrait. Default 16:9." }
|
|
5078
5084
|
},
|
|
@@ -5080,11 +5086,17 @@ var MEDIA = {
|
|
|
5080
5086
|
// produire doit se dire tout de suite, pas revenir en erreur du fournisseur une fois payé.
|
|
5081
5087
|
verify: (a, model) => {
|
|
5082
5088
|
if (OMNI_MODELS.includes(model)) {
|
|
5083
|
-
|
|
5084
|
-
|
|
5085
|
-
|
|
5089
|
+
if (a.audio === true) fail5(`"${model}" has no sound option. Use veo-3.1 for sound.`);
|
|
5090
|
+
if (a.duration !== void 0 && a.duration !== null && a.duration !== "") {
|
|
5091
|
+
const d = Number(a.duration);
|
|
5092
|
+
if (!Number.isFinite(d) || d < OMNI_SECONDS.min || d > OMNI_SECONDS.max) {
|
|
5093
|
+
fail5(`"${model}" makes videos of ${OMNI_SECONDS.min} to ${OMNI_SECONDS.max} seconds (the provider's limit); you asked for ${a.duration}.`);
|
|
5086
5094
|
}
|
|
5087
5095
|
}
|
|
5096
|
+
const permises = VIDEO_RESOLUTIONS[model] || [];
|
|
5097
|
+
if (filled2(a.resolution) && !permises.includes(a.resolution)) {
|
|
5098
|
+
fail5(`"${model}" has no ${a.resolution}. It does ${permises.join(", ")}.`);
|
|
5099
|
+
}
|
|
5088
5100
|
return;
|
|
5089
5101
|
}
|
|
5090
5102
|
if (a.audio === true && !VIDEO_WITH_AUDIO.includes(model)) {
|
|
@@ -5098,13 +5110,19 @@ var MEDIA = {
|
|
|
5098
5110
|
fail5(`"${model}" has no ${a.resolution}. It does ${allowed.join(", ")} \u2014 change the resolution, or pick another model.`);
|
|
5099
5111
|
}
|
|
5100
5112
|
},
|
|
5101
|
-
|
|
5113
|
+
// Omni : seulement ce qui a été demandé — sans durée, le modèle fait ses 10 s par défaut, et un
|
|
5114
|
+
// défaut de 4 s imposé ici changerait en silence ce qu'un appel sans option produisait.
|
|
5115
|
+
settings: (a, model) => OMNI_MODELS.includes(model) ? {
|
|
5116
|
+
...Number(a.duration) > 0 ? { duration: Number(a.duration) } : {},
|
|
5117
|
+
...filled2(a.resolution) ? { resolution: a.resolution } : {},
|
|
5118
|
+
...filled2(a.aspect) ? { aspectRatio: a.aspect } : {}
|
|
5119
|
+
} : {
|
|
5102
5120
|
duration: Number(a.duration) > 0 ? Number(a.duration) : 4,
|
|
5103
5121
|
resolution: a.resolution || "720p",
|
|
5104
5122
|
audio: a.audio === true,
|
|
5105
5123
|
...filled2(a.aspect) ? { aspectRatio: a.aspect } : {}
|
|
5106
|
-
}
|
|
5107
|
-
detail: (a) => [`${Number(a.duration) > 0 ? Number(a.duration) : 4}s`, a.resolution || "720p", a.audio === true ? "with audio" : "silent"]
|
|
5124
|
+
},
|
|
5125
|
+
detail: (a, model) => OMNI_MODELS.includes(model) ? [`${Number(a.duration) > 0 ? Number(a.duration) : OMNI_SECONDS.default}s`, a.resolution || "720p", ...filled2(a.aspect) ? [a.aspect] : []] : [`${Number(a.duration) > 0 ? Number(a.duration) : 4}s`, a.resolution || "720p", a.audio === true ? "with audio" : "silent"]
|
|
5108
5126
|
},
|
|
5109
5127
|
create_voice: {
|
|
5110
5128
|
type: "audio",
|
|
@@ -5150,7 +5168,7 @@ var MEDIA_OPTIONS = Object.fromEntries(Object.entries(MEDIA).map(([nom, spec]) =
|
|
|
5150
5168
|
model: spec.model,
|
|
5151
5169
|
models: spec.models,
|
|
5152
5170
|
params: Object.fromEntries(Object.entries(spec.params || {}).map(([cle, p]) => [cle, { type: p.type, values: p.enum || null }])),
|
|
5153
|
-
...nom === "create_video" ? { resolutionsByModel: VIDEO_RESOLUTIONS, audioModels: VIDEO_WITH_AUDIO, durations: VIDEO_DURATIONS } : {}
|
|
5171
|
+
...nom === "create_video" ? { resolutionsByModel: VIDEO_RESOLUTIONS, audioModels: VIDEO_WITH_AUDIO, durations: VIDEO_DURATIONS, durationsByModel: VIDEO_DURATIONS_BY_MODEL } : {}
|
|
5154
5172
|
}
|
|
5155
5173
|
]));
|
|
5156
5174
|
var MEDIA_KINDS = Object.fromEntries(Object.keys(MEDIA).map((n) => [n, n.replace(/^create_/, "")]));
|
|
@@ -5194,7 +5212,7 @@ function createMediaTools({ client, media = {} }) {
|
|
|
5194
5212
|
if (source.size > ATTACHMENT_MAX) fail5(`"${source.path}" is ${(source.size / 1048576).toFixed(1)} MB; the starting image must be under ${ATTACHMENT_MAX / 1048576} MB.`);
|
|
5195
5213
|
inputs.push({ type: "image", content: Buffer.from(source.content).toString("base64"), mime });
|
|
5196
5214
|
}
|
|
5197
|
-
const session = await models.create({ model, settings: spec.settings(args), memory: false });
|
|
5215
|
+
const session = await models.create({ model, settings: spec.settings(args, model), memory: false });
|
|
5198
5216
|
try {
|
|
5199
5217
|
const result = await session.generate({ inputs, outputs: [{ type: spec.output }] });
|
|
5200
5218
|
const output = result.outputs?.find((o) => o.content);
|
|
@@ -5202,7 +5220,7 @@ function createMediaTools({ client, media = {} }) {
|
|
|
5202
5220
|
const ext = output.mime?.split("/")[1]?.split(";")[0]?.replace("mpeg", "mp3") || spec.ext;
|
|
5203
5221
|
const target = path || `Agent/${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}/${Date.now()}.${ext}`;
|
|
5204
5222
|
const item = await files.write(target, Buffer.from(output.content, "base64"));
|
|
5205
|
-
const fait = [model, ...spec.detail(args)].join(", ");
|
|
5223
|
+
const fait = [model, ...spec.detail(args, model)].join(", ");
|
|
5206
5224
|
return {
|
|
5207
5225
|
output: `Saved ${spec.type} to ${item.path} (${item.size} bytes, ${result.usage?.credits ?? "?"} credits \u2014 ${fait}).`,
|
|
5208
5226
|
summary: `Created ${item.path}`,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iagenify",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "IaGenify client and agent engine — the agent loop runs inside the SDK (tools, skills, sub-agents, terminals, sessions, memory) in Node, the browser and Cloudflare Workers.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|