agent-media-cli 1.1.0 → 1.2.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.
@@ -1,137 +0,0 @@
1
- // Copyright 2026 agent-media contributors. Apache-2.0 license.
2
- import chalk from 'chalk';
3
- import { detectOutputMode, printJson, printQuiet, createSpinner, } from '../lib/output.js';
4
- import { AgentMediaAPI, } from '../lib/api.js';
5
- import { getApiKey, resolveProfileName } from '../lib/credentials.js';
6
- import { handleError } from '../lib/errors.js';
7
- /**
8
- * Build a display-friendly label for supported operations.
9
- */
10
- function formatOps(model) {
11
- const ops = [];
12
- if (model.supports_text_to_video)
13
- ops.push('text-to-video');
14
- if (model.supports_image_to_video)
15
- ops.push('image-to-video');
16
- if (model.supports_text_to_image)
17
- ops.push('text-to-image');
18
- return ops;
19
- }
20
- /**
21
- * Merge model info with pricing data into display rows.
22
- */
23
- function mergeModelsWithPricing(models, pricing) {
24
- const costMap = new Map();
25
- for (const p of pricing) {
26
- const existing = costMap.get(p.modelSlug) ?? [];
27
- existing.push(p.creditCost);
28
- costMap.set(p.modelSlug, existing);
29
- }
30
- return models.map((m) => {
31
- const costs = costMap.get(m.slug) ?? [];
32
- let creditRange = '-';
33
- if (costs.length > 0) {
34
- const min = Math.min(...costs);
35
- const max = Math.max(...costs);
36
- creditRange = min === max ? String(min) : `${min}-${max}`;
37
- }
38
- return {
39
- slug: m.slug,
40
- displayName: m.display_name,
41
- description: m.description,
42
- type: m.media_type,
43
- operations: formatOps(m),
44
- maxDuration: m.max_duration_seconds,
45
- maxResolution: m.max_resolution,
46
- creditRange,
47
- };
48
- });
49
- }
50
- export function registerModelsCommand(program) {
51
- program
52
- .command('models')
53
- .description('List all available models')
54
- .option('--type <type>', 'Filter by model type (video or image)')
55
- .action(async (cmdOpts) => {
56
- const globalOpts = program.opts();
57
- const mode = detectOutputMode(globalOpts);
58
- try {
59
- const spinner = createSpinner('Fetching models...');
60
- if (mode === 'human')
61
- spinner.start();
62
- const profileName = resolveProfileName(globalOpts.profile);
63
- const apiKey = getApiKey(profileName) ?? '';
64
- const api = new AgentMediaAPI(apiKey);
65
- const [modelsData, pricingData] = await Promise.all([
66
- api.getModels(),
67
- api.getPricing(),
68
- ]);
69
- let models = mergeModelsWithPricing(modelsData, pricingData.pricing);
70
- if (mode === 'human')
71
- spinner.stop();
72
- // Apply --type filter
73
- if (cmdOpts.type) {
74
- const filterType = cmdOpts.type.toLowerCase();
75
- models = models.filter((m) => m.type.includes(filterType));
76
- }
77
- switch (mode) {
78
- case 'json':
79
- printJson(models);
80
- break;
81
- case 'quiet':
82
- printQuiet(models.map((m) => m.slug));
83
- break;
84
- default: {
85
- if (models.length === 0) {
86
- console.log(chalk.dim('\n No models found.\n'));
87
- break;
88
- }
89
- const videoModels = models.filter((m) => m.type === 'video');
90
- const imageModels = models.filter((m) => m.type === 'image');
91
- const printGroup = (title, items) => {
92
- if (items.length === 0)
93
- return;
94
- console.log();
95
- console.log(chalk.bold(` ${title}`));
96
- for (const m of items) {
97
- console.log();
98
- console.log(` ${chalk.cyan(m.slug)} ${chalk.dim(m.displayName)}`);
99
- console.log(` ${chalk.dim(m.description)}`);
100
- const specs = [];
101
- specs.push(m.operations.join(', '));
102
- if (m.maxDuration)
103
- specs.push(`up to ${m.maxDuration}s`);
104
- if (m.maxResolution)
105
- specs.push(`max ${m.maxResolution}`);
106
- specs.push(`${chalk.yellow(m.creditRange)} credits`);
107
- console.log(` ${specs.join(chalk.dim(' | '))}`);
108
- }
109
- };
110
- printGroup('Video Models', videoModels);
111
- printGroup('Image Models', imageModels);
112
- // Examples section
113
- console.log();
114
- console.log(chalk.bold(' Examples'));
115
- console.log();
116
- console.log(chalk.dim(' # Generate a video from text'));
117
- console.log(` ${chalk.green('agent-media generate')} seedance1 -p "A cat riding a skateboard through Tokyo at night"`);
118
- console.log();
119
- console.log(chalk.dim(' # Generate an image'));
120
- console.log(` ${chalk.green('agent-media generate')} flux2-pro -p "Cyberpunk cityscape at sunset, neon lights"`);
121
- console.log();
122
- console.log(chalk.dim(' # Generate, wait, and download the result'));
123
- console.log(` ${chalk.green('agent-media generate')} kling3 -p "Ocean waves crashing on rocks" --sync`);
124
- console.log();
125
- console.log(chalk.dim(' # Image-to-video (use a photo as reference)'));
126
- console.log(` ${chalk.green('agent-media generate')} sora2 -p "Make it come alive" --input photo.jpg -s`);
127
- console.log();
128
- break;
129
- }
130
- }
131
- }
132
- catch (error) {
133
- handleError(error);
134
- }
135
- });
136
- }
137
- //# sourceMappingURL=models.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/commands/models.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAW/D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,gBAAgB,EAChB,SAAS,EACT,UAAU,EACV,aAAa,GACd,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,aAAa,GAGd,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAa/C;;GAEG;AACH,SAAS,SAAS,CAAC,KAAgB;IACjC,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,IAAI,KAAK,CAAC,sBAAsB;QAAE,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IAC5D,IAAI,KAAK,CAAC,uBAAuB;QAAE,GAAG,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IAC9D,IAAI,KAAK,CAAC,sBAAsB;QAAE,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IAC5D,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;GAEG;AACH,SAAS,sBAAsB,CAC7B,MAAmB,EACnB,OAAuB;IAEvB,MAAM,OAAO,GAAG,IAAI,GAAG,EAAoB,CAAC;IAC5C,KAAK,MAAM,CAAC,IAAI,OAAO,E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GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,6CAA6C,CAAC,CAAC,CAAC;oBACtE,OAAO,CAAC,GAAG,CACT,KAAK,KAAK,CAAC,KAAK,CAAC,sBAAsB,CAAC,mDAAmD,CAC5F,CAAC;oBACF,OAAO,CAAC,GAAG,EAAE,CAAC;oBACd,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,+CAA+C,CAAC,CAAC,CAAC;oBACxE,OAAO,CAAC,GAAG,CACT,KAAK,KAAK,CAAC,KAAK,CAAC,sBAAsB,CAAC,qDAAqD,CAC9F,CAAC;oBACF,OAAO,CAAC,GAAG,EAAE,CAAC;oBACd,MAAM;gBACR,CAAC;YACH,CAAC;QACH,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACxB,WAAW,CAAC,KAAK,CAAC,CAAC;QACrB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -1,14 +0,0 @@
1
- /**
2
- * `agent-media pricing [model]` command.
3
- *
4
- * Displays credit pricing for AI generation models. When a model slug
5
- * is provided, shows a detailed cost breakdown for that model across
6
- * all supported operations, durations, and resolutions. Without a model
7
- * argument, shows a summary pricing table for every available model.
8
- *
9
- * Pricing data mirrors the seed data in `supabase/seed.sql` and can
10
- * optionally be fetched from the server when the user is authenticated.
11
- */
12
- import type { Command } from 'commander';
13
- export declare function registerPricingCommand(program: Command): void;
14
- //# sourceMappingURL=pricing.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pricing.d.ts","sourceRoot":"","sources":["../../src/commands/pricing.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAqEzC,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAkI7D"}
@@ -1,160 +0,0 @@
1
- // Copyright 2026 agent-media contributors. Apache-2.0 license.
2
- import chalk from 'chalk';
3
- import { detectOutputMode, printTable, printJson, printQuiet, createSpinner, } from '../lib/output.js';
4
- import { getApiKey, resolveProfileName } from '../lib/credentials.js';
5
- import { AgentMediaAPI } from '../lib/api.js';
6
- import { handleError } from '../lib/errors.js';
7
- // ── Hardcoded fallback pricing (from seed.sql) ──────────────────────────────
8
- // Used when the user is not authenticated or the server is unreachable.
9
- // 1 credit = $0.01. Prices include 50% margin over provider cost.
10
- const FALLBACK_PRICING = [
11
- // Video models (costs from live model_pricing table)
12
- { modelSlug: 'kling3', operation: 'text_to_video', durationSeconds: 5, resolution: null, creditCost: 187, providerCostUsd: 1.12 },
13
- { modelSlug: 'kling3', operation: 'text_to_video', durationSeconds: 10, resolution: null, creditCost: 374, providerCostUsd: 2.24 },
14
- { modelSlug: 'seedance1', operation: 'text_to_video', durationSeconds: 5, resolution: null, creditCost: 104, providerCostUsd: 0.62 },
15
- { modelSlug: 'sora2', operation: 'text_to_video', durationSeconds: 4, resolution: null, creditCost: 200, providerCostUsd: 1.20 },
16
- { modelSlug: 'sora2', operation: 'text_to_video', durationSeconds: 8, resolution: null, creditCost: 400, providerCostUsd: 2.40 },
17
- { modelSlug: 'veo3', operation: 'text_to_video', durationSeconds: 4, resolution: null, creditCost: 134, providerCostUsd: 0.80 },
18
- // Image models
19
- { modelSlug: 'flux2-pro', operation: 'text_to_image', durationSeconds: null, resolution: '1K', creditCost: 5, providerCostUsd: 0.03 },
20
- { modelSlug: 'flux2-pro', operation: 'text_to_image', durationSeconds: null, resolution: '2K', creditCost: 8, providerCostUsd: 0.045 },
21
- { modelSlug: 'flux2-flex', operation: 'text_to_image', durationSeconds: null, resolution: '1K', creditCost: 9, providerCostUsd: 0.05 },
22
- { modelSlug: 'flux2-flex', operation: 'text_to_image', durationSeconds: null, resolution: '2K', creditCost: 17, providerCostUsd: 0.10 },
23
- { modelSlug: 'grok-image', operation: 'text_to_image', durationSeconds: null, resolution: '1K', creditCost: 7, providerCostUsd: 0.04 },
24
- { modelSlug: 'seedream4.5', operation: 'text_to_image', durationSeconds: null, resolution: '2K', creditCost: 4, providerCostUsd: 0.02 },
25
- { modelSlug: 'seedream4.5', operation: 'text_to_image', durationSeconds: null, resolution: '4K', creditCost: 8, providerCostUsd: 0.04 },
26
- ];
27
- /**
28
- * Load pricing data from the server if authenticated, otherwise use fallback.
29
- */
30
- async function loadPricing(profileName, modelSlug) {
31
- const apiKey = getApiKey(profileName);
32
- if (apiKey) {
33
- try {
34
- const api = new AgentMediaAPI(apiKey);
35
- const response = await api.getPricing(modelSlug);
36
- return response.pricing;
37
- }
38
- catch {
39
- // Server unreachable -- fall through to hardcoded data
40
- }
41
- }
42
- // Use fallback pricing
43
- if (modelSlug) {
44
- return FALLBACK_PRICING.filter((p) => p.modelSlug === modelSlug);
45
- }
46
- return FALLBACK_PRICING;
47
- }
48
- /**
49
- * Format an operation string for display (e.g., "text_to_video" -> "text-to-video").
50
- */
51
- function formatOperation(op) {
52
- return op.replace(/_/g, '-');
53
- }
54
- export function registerPricingCommand(program) {
55
- program
56
- .command('pricing [model]')
57
- .description('Show credit pricing for models')
58
- .action(async (model) => {
59
- const globalOpts = program.opts();
60
- const mode = detectOutputMode(globalOpts);
61
- const profileName = resolveProfileName(globalOpts.profile);
62
- try {
63
- const spinner = createSpinner('Loading pricing...');
64
- if (mode === 'human')
65
- spinner.start();
66
- const pricing = await loadPricing(profileName, model);
67
- if (mode === 'human')
68
- spinner.stop();
69
- if (pricing.length === 0) {
70
- if (mode === 'json') {
71
- printJson({ pricing: [], message: model ? `No pricing found for model "${model}"` : 'No pricing data available' });
72
- }
73
- else if (mode === 'quiet') {
74
- printQuiet('');
75
- }
76
- else {
77
- console.log(chalk.yellow(model
78
- ? ` No pricing found for model "${model}". Run 'agent-media models' to see available models.`
79
- : ' No pricing data available.'));
80
- }
81
- return;
82
- }
83
- switch (mode) {
84
- case 'json':
85
- printJson(pricing.map((p) => ({
86
- model: p.modelSlug,
87
- operation: p.operation,
88
- duration_seconds: p.durationSeconds,
89
- resolution: p.resolution,
90
- credits: p.creditCost,
91
- cost_usd: p.creditCost * 0.01,
92
- })));
93
- break;
94
- case 'quiet':
95
- printQuiet(pricing.map((p) => `${p.modelSlug}\t${p.operation}\t${p.durationSeconds ?? '-'}\t${p.resolution ?? '-'}\t${p.creditCost}`));
96
- break;
97
- default: {
98
- if (model) {
99
- // Detailed view for a single model
100
- console.log();
101
- console.log(chalk.bold(` Pricing: ${model}`));
102
- console.log();
103
- const headers = ['Operation', 'Duration', 'Resolution', 'Credits', 'Cost (USD)'];
104
- const rows = pricing.map((p) => [
105
- formatOperation(p.operation),
106
- p.durationSeconds !== null ? `${p.durationSeconds}s` : '-',
107
- p.resolution ?? '-',
108
- String(p.creditCost),
109
- `$${(p.creditCost * 0.01).toFixed(2)}`,
110
- ]);
111
- printTable(headers, rows);
112
- console.log();
113
- console.log(chalk.dim(' 1 credit = $0.01'));
114
- console.log();
115
- }
116
- else {
117
- // Summary view for all models
118
- console.log();
119
- console.log(chalk.bold(' Pricing Overview'));
120
- console.log(chalk.dim(' 1 credit = $0.01 | Prices include platform margin'));
121
- console.log();
122
- // Group by model and show range
123
- const modelGroups = new Map();
124
- for (const p of pricing) {
125
- const group = modelGroups.get(p.modelSlug) ?? [];
126
- group.push(p);
127
- modelGroups.set(p.modelSlug, group);
128
- }
129
- const headers = ['Model', 'Type', 'Credits (min)', 'Credits (max)', 'USD Range'];
130
- const rows = [];
131
- for (const [slug, entries] of modelGroups) {
132
- const isVideo = entries.some((e) => e.operation.includes('video'));
133
- const costs = entries.map((e) => e.creditCost);
134
- const minCost = Math.min(...costs);
135
- const maxCost = Math.max(...costs);
136
- rows.push([
137
- slug,
138
- isVideo ? 'video' : 'image',
139
- String(minCost),
140
- String(maxCost),
141
- minCost === maxCost
142
- ? `$${(minCost * 0.01).toFixed(2)}`
143
- : `$${(minCost * 0.01).toFixed(2)} - $${(maxCost * 0.01).toFixed(2)}`,
144
- ]);
145
- }
146
- printTable(headers, rows);
147
- console.log();
148
- console.log(chalk.dim(" Run 'agent-media pricing <model>' for detailed breakdown"));
149
- console.log();
150
- }
151
- break;
152
- }
153
- }
154
- }
155
- catch (error) {
156
- handleError(error);
157
- }
158
- });
159
- }
160
- //# sourceMappingURL=pricing.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pricing.js","sourceRoot":"","sources":["../../src/commands/pricing.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAe/D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,gBAAgB,EAChB,UAAU,EACV,SAAS,EACT,UAAU,EACV,aAAa,GACd,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,aAAa,EAAqB,MAAM,eAAe,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,+EAA+E;AAC/E,wEAAwE;AACxE,kEAAkE;AAElE,MAAM,gBAAgB,GAAmB;IACvC,qDAAqD;IACrD,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,eAAe,EAAE,eAAe,EAAE,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,eAAe,EAAE,IAAI,EAAE;IACjI,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,eAAe,EAAE,eAAe,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,eAAe,EAAE,IAAI,EAAE;IAClI,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,eAAe,EAAE,eAAe,EAAE,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,eAAe,EAAE,IAAI,EAAE;IACpI,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,eAAe,EAAE,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,eAAe,EAAE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BACnC,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC;4BAEnC,IAAI,CAAC,IAAI,CAAC;gCACR,IAAI;gCACJ,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO;gCAC3B,MAAM,CAAC,OAAO,CAAC;gCACf,MAAM,CAAC,OAAO,CAAC;gCACf,OAAO,KAAK,OAAO;oCACjB,CAAC,CAAC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;oCACnC,CAAC,CAAC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;6BACxE,CAAC,CAAC;wBACL,CAAC;wBAED,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;wBAC1B,OAAO,CAAC,GAAG,EAAE,CAAC;wBACd,OAAO,CAAC,GAAG,CACT,KAAK,CAAC,GAAG,CAAC,4DAA4D,CAAC,CACxE,CAAC;wBACF,OAAO,CAAC,GAAG,EAAE,CAAC;oBAChB,CAAC;oBACD,MAAM;gBACR,CAAC;YACH,CAAC;QACH,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACxB,WAAW,CAAC,KAAK,CAAC,CAAC;QACrB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { Command } from 'commander';
2
- export declare function registerRetryCommand(program: Command): void;
3
- //# sourceMappingURL=retry.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../../src/commands/retry.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA4QzC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAoR3D"}