gipity 1.1.10 → 1.1.11
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/commands/agent.js +28 -3
- package/dist/commands/approval.js +3 -3
- package/dist/commands/deploy.js +1 -1
- package/dist/commands/email.js +2 -2
- package/dist/commands/generate.js +94 -34
- package/dist/commands/key.js +2 -2
- package/dist/commands/logs.js +2 -2
- package/dist/commands/realtime.js +3 -3
- package/dist/commands/records.js +4 -4
- package/dist/commands/service.js +8 -4
- package/dist/index.js +174 -42
- package/dist/provider-docs.js +65 -1
- package/package.json +1 -1
package/dist/commands/agent.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
2
|
import { get, post, put, del } from '../api.js';
|
|
3
3
|
import { requireConfig, saveConfig } from '../config.js';
|
|
4
|
-
import { error as clrError, success } from '../colors.js';
|
|
4
|
+
import { error as clrError, success, muted } from '../colors.js';
|
|
5
5
|
import { run, printList, printResult } from '../helpers/index.js';
|
|
6
6
|
import { confirm } from '../utils.js';
|
|
7
7
|
export const agentCommand = new Command('agent')
|
|
@@ -32,10 +32,35 @@ export const agentCommand = new Command('agent')
|
|
|
32
32
|
return `${a.name}${active}${def}${model}`;
|
|
33
33
|
});
|
|
34
34
|
}));
|
|
35
|
+
agentCommand
|
|
36
|
+
.command('models')
|
|
37
|
+
.description('List the LLM models an agent can use (ids for `agent create --model` and `agent set model`)')
|
|
38
|
+
.option('--json', 'Output as JSON')
|
|
39
|
+
.action((opts) => run('Models', async () => {
|
|
40
|
+
const res = await get('/agents/models');
|
|
41
|
+
if (opts.json) {
|
|
42
|
+
console.log(JSON.stringify(res.data));
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
const width = res.data.reduce((m, x) => Math.max(m, x.id.length), 0);
|
|
46
|
+
for (const m of res.data) {
|
|
47
|
+
const notes = [
|
|
48
|
+
m.displayName,
|
|
49
|
+
m.provider,
|
|
50
|
+
`$${m.inputCostPerMTok}/$${m.outputCostPerMTok} per 1M tok`,
|
|
51
|
+
`${Math.round(m.maxContextTokens / 1000)}K ctx`,
|
|
52
|
+
];
|
|
53
|
+
if (m.blurb)
|
|
54
|
+
notes.push(m.blurb);
|
|
55
|
+
if (m.isDefault)
|
|
56
|
+
notes.push('default');
|
|
57
|
+
console.log(`${m.id.padEnd(width)} ${muted(notes.join(' · '))}`);
|
|
58
|
+
}
|
|
59
|
+
}));
|
|
35
60
|
agentCommand
|
|
36
61
|
.command('create <name>')
|
|
37
62
|
.description('Create an agent')
|
|
38
|
-
.option('--model <model>', 'Model preference')
|
|
63
|
+
.option('--model <model>', 'Model preference (an id from `gipity agent models`; default: platform default)')
|
|
39
64
|
.option('--switch', 'Switch to new agent after creation')
|
|
40
65
|
.option('--json', 'Output as JSON')
|
|
41
66
|
.action((name, opts) => run('Create', async () => {
|
|
@@ -58,7 +83,7 @@ agentCommand
|
|
|
58
83
|
}));
|
|
59
84
|
agentCommand
|
|
60
85
|
.command('set <field> <value>')
|
|
61
|
-
.description('Set a field (model, temp)')
|
|
86
|
+
.description('Set a field (model, temp). Model ids: `gipity agent models`')
|
|
62
87
|
.option('--json', 'Output as JSON')
|
|
63
88
|
.action((field, value, opts) => run('Set', async () => {
|
|
64
89
|
const config = requireConfig();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
1
|
+
import { Command, Option } from 'commander';
|
|
2
2
|
import { get, post } from '../api.js';
|
|
3
3
|
import { muted, success } from '../colors.js';
|
|
4
4
|
import { run, printList, printResult } from '../helpers/index.js';
|
|
@@ -25,7 +25,7 @@ export const approvalCommand = new Command('approval')
|
|
|
25
25
|
approvalCommand
|
|
26
26
|
.command('list')
|
|
27
27
|
.description('List pending approvals')
|
|
28
|
-
.
|
|
28
|
+
.addOption(new Option('--status <status>', 'Filter by status').choices(['pending', 'approved', 'denied', 'cancelled', 'expired', 'all']).default('pending'))
|
|
29
29
|
.option('--json', 'Output as JSON')
|
|
30
30
|
.action((opts) => run('List', async () => {
|
|
31
31
|
const res = await get(`/approvals?status=${encodeURIComponent(opts.status)}`);
|
|
@@ -35,7 +35,7 @@ approvalCommand
|
|
|
35
35
|
.command('create <title...>')
|
|
36
36
|
.description('Create a pending approval')
|
|
37
37
|
.option('--description <text>', 'Detailed context')
|
|
38
|
-
.
|
|
38
|
+
.addOption(new Option('--type <type>', 'Approval type').choices(['yes_no', 'choice', 'text']).default('yes_no'))
|
|
39
39
|
.option('--choices <a,b,c>', 'Comma-separated options (for --type choice)')
|
|
40
40
|
.option('--prompt <text>', 'Custom prompt shown to the user')
|
|
41
41
|
.option('--expires-in <minutes>', 'Minutes until expiry (default: 10080 = 7d)')
|
package/dist/commands/deploy.js
CHANGED
|
@@ -21,7 +21,7 @@ export const deployCommand = new Command('deploy')
|
|
|
21
21
|
.description('Deploy to dev or prod')
|
|
22
22
|
.argument('[target]', 'dev or prod', 'dev')
|
|
23
23
|
.option('--source-dir <dir>', 'Source directory to deploy from')
|
|
24
|
-
.option('--only <phases>', 'Run only specific phases
|
|
24
|
+
.option('--only <phases>', 'Run only specific phases, comma-separated, matched by gipity.yaml phase name or type: files/static, database/sql, functions, workflows, services, jobs, records, realtime, env, auth_branding')
|
|
25
25
|
.option('--force', 'Re-run all phases (ignore checksums) and bypass the sync bulk-deletion guard')
|
|
26
26
|
.option('--no-sync', 'Skip sync-up before deploy')
|
|
27
27
|
.option('--optimize', 'Force Vite build optimization on (default for prod; use this to optimize a dev deploy too)')
|
package/dist/commands/email.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
1
|
+
import { Command, Option } from 'commander';
|
|
2
2
|
import { get, post } from '../api.js';
|
|
3
3
|
import { resolveProjectContext } from '../config.js';
|
|
4
4
|
import { error as clrError, success, bold, muted, warning } from '../colors.js';
|
|
@@ -98,7 +98,7 @@ emailCommand
|
|
|
98
98
|
emailCommand
|
|
99
99
|
.command('log')
|
|
100
100
|
.description('Recent email() sends and skipped attempts from your app')
|
|
101
|
-
.
|
|
101
|
+
.addOption(new Option('--range <range>', 'Time range').choices(['1h', '24h', '7d', '30d', '1y']).default('7d'))
|
|
102
102
|
.option('--limit <n>', 'Max rows', '50')
|
|
103
103
|
.option('--project <guid-or-slug>', 'Target a specific project instead of cwd / Home')
|
|
104
104
|
.option('--json', 'Output raw JSON')
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
1
|
+
import { Command, Option } from 'commander';
|
|
2
2
|
import { post } from '../api.js';
|
|
3
3
|
import { resolveProjectContext, getConfigPath } from '../config.js';
|
|
4
4
|
import { pushFile } from '../sync.js';
|
|
@@ -8,7 +8,43 @@ import { error as clrError, success, muted } from '../colors.js';
|
|
|
8
8
|
import { printCommandError } from '../helpers/command.js';
|
|
9
9
|
import { withSpinner } from '../progress.js';
|
|
10
10
|
import { guessMime } from '../upload.js';
|
|
11
|
-
import {
|
|
11
|
+
import { IMAGE_MODELS_TABLE, IMAGE_PROVIDER_IDS, IMAGE_QUALITY_IDS, IMAGE_TIER_ALIASES_DOC, IMAGE_TIER_ALIAS_IDS, IMAGE_GEMINI_ASPECT_RATIO_IDS, IMAGE_GEMINI_SIZE_IDS, VIDEO_MODEL_IDS, VIDEO_MODELS_TABLE, VIDEO_ASPECT_RATIOS, VIDEO_ASPECT_RATIO_IDS, VIDEO_RESOLUTION_IDS, TTS_PROVIDER_IDS, TTS_PROVIDER_DESCRIPTIONS, GEMINI_TTS_VOICES_DOC, } from '../provider-docs.js';
|
|
12
|
+
function printMetrics(metrics) {
|
|
13
|
+
const rows = metrics.filter((m) => m !== null);
|
|
14
|
+
const width = Math.max(...rows.map((m) => m.label.length));
|
|
15
|
+
for (const m of rows) {
|
|
16
|
+
console.log(` ${muted(`${m.label.padStart(width)}:`)} ${m.value}`);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function fmtSeconds(s) {
|
|
20
|
+
if (s >= 60)
|
|
21
|
+
return `${Math.floor(s / 60)}m ${Math.round(s % 60)}s`;
|
|
22
|
+
return `${s < 10 ? Math.round(s * 10) / 10 : Math.round(s)}s`;
|
|
23
|
+
}
|
|
24
|
+
/** The standard metric rows, in a fixed order so every subcommand reads the
|
|
25
|
+
* same: duration, size, time, speed, credits. Rows whose data is missing
|
|
26
|
+
* (image has no duration; free ops have no credits) are skipped. */
|
|
27
|
+
function generationMetrics(result, elapsedSeconds) {
|
|
28
|
+
// ffmpeg-style realtime multiple: media seconds produced per wall-clock
|
|
29
|
+
// second. Generation is slower than playback, so expect values below 1x.
|
|
30
|
+
const speed = result.duration_seconds !== undefined && elapsedSeconds > 0
|
|
31
|
+
? result.duration_seconds / elapsedSeconds : undefined;
|
|
32
|
+
return [
|
|
33
|
+
result.duration_seconds !== undefined
|
|
34
|
+
? { label: 'duration', value: `${fmtSeconds(result.duration_seconds)} clip` } : null,
|
|
35
|
+
{ label: 'size', value: `${Math.round(result.size_bytes / 1024)}KB` },
|
|
36
|
+
{ label: 'time', value: fmtSeconds(elapsedSeconds) },
|
|
37
|
+
speed !== undefined
|
|
38
|
+
? { label: 'speed', value: `${speed >= 1 ? Math.round(speed * 10) / 10 : Math.round(speed * 100) / 100}x realtime` } : null,
|
|
39
|
+
result.credits_deducted !== undefined
|
|
40
|
+
? { label: 'credits', value: `${result.credits_deducted.toLocaleString('en-US')} (${result.remaining_balance.toLocaleString('en-US')} remaining)` } : null,
|
|
41
|
+
];
|
|
42
|
+
}
|
|
43
|
+
/** JSON-mode result: the server fields plus how long generation took and
|
|
44
|
+
* where the file landed. */
|
|
45
|
+
function jsonResult(result, elapsedSeconds, savedPath) {
|
|
46
|
+
return JSON.stringify({ ...result, generation_seconds: Math.round(elapsedSeconds * 10) / 10, saved: savedPath });
|
|
47
|
+
}
|
|
12
48
|
/** Download a URL and save to a local file, then push it up to the project so
|
|
13
49
|
* the cloud (and anything that mirrors it) immediately matches local disk.
|
|
14
50
|
* Returns the absolute path written, so callers can report where it landed.
|
|
@@ -172,7 +208,11 @@ function readInputImages(paths) {
|
|
|
172
208
|
const imageCommand = new Command('image')
|
|
173
209
|
.description('Generate an image from a text prompt, or edit existing images with --input')
|
|
174
210
|
.addHelpText('after', `
|
|
175
|
-
Models:
|
|
211
|
+
Models (one line per provider; pass an id with --model, the provider with --provider):
|
|
212
|
+
${IMAGE_MODELS_TABLE}
|
|
213
|
+
|
|
214
|
+
Tier aliases (pass to --model instead of an id; each names a provider+model):
|
|
215
|
+
${IMAGE_TIER_ALIASES_DOC}
|
|
176
216
|
|
|
177
217
|
Editing (--input): pass one or more source images and the prompt becomes an edit
|
|
178
218
|
instruction applied to them - "make it night time", "add a hat", "remove the car
|
|
@@ -189,12 +229,12 @@ Examples:
|
|
|
189
229
|
`)
|
|
190
230
|
.argument('<prompt>', 'Text description of the image, or (with --input) the edit instruction to apply')
|
|
191
231
|
.option('--input <file>', 'Source image to edit/compose (repeatable). With --input the prompt is an edit instruction; routes to Gemini.', (v, acc) => (acc || []).concat(v))
|
|
192
|
-
.
|
|
193
|
-
.option('--model <model>',
|
|
232
|
+
.addOption(new Option('--provider <provider>', 'Image provider (default: bfl)').choices(IMAGE_PROVIDER_IDS))
|
|
233
|
+
.option('--model <model>', `Model id for the chosen provider, or a tier alias (${IMAGE_TIER_ALIAS_IDS.join(', ')}); see Models below`)
|
|
194
234
|
.option('--size <size>', 'Dimensions as WxH, e.g. "1024x1024" (OpenAI/BFL)')
|
|
195
|
-
.
|
|
196
|
-
.
|
|
197
|
-
.
|
|
235
|
+
.addOption(new Option('--quality <quality>', 'Quality (gpt-image-2 only)').choices(IMAGE_QUALITY_IDS))
|
|
236
|
+
.addOption(new Option('--aspect-ratio <ratio>', 'Aspect ratio (Gemini only)').choices(IMAGE_GEMINI_ASPECT_RATIO_IDS))
|
|
237
|
+
.addOption(new Option('--image-size <size>', 'Output resolution (Gemini only)').choices(IMAGE_GEMINI_SIZE_IDS))
|
|
198
238
|
.option('--seed <n>', 'Deterministic seed (BFL only): reuse one seed to keep a set of images visually coherent', (v) => parseInt(v, 10))
|
|
199
239
|
.option('-o, --output <file>', 'Output path (default ./generated.png). For an image your app ships, write it into the source tree so it deploys, e.g. -o src/assets/images/hero.png; the cwd default is fine for one-off generation.')
|
|
200
240
|
.option('--json', 'Output as JSON')
|
|
@@ -216,21 +256,24 @@ Examples:
|
|
|
216
256
|
input_images: inputImages,
|
|
217
257
|
});
|
|
218
258
|
const verb = inputImages ? 'Editing image...' : 'Generating image...';
|
|
259
|
+
const started = Date.now();
|
|
219
260
|
const result = opts.json
|
|
220
261
|
? await doGenerate()
|
|
221
262
|
: await withSpinner(verb, doGenerate, { done: null });
|
|
263
|
+
const elapsed = (Date.now() - started) / 1000;
|
|
222
264
|
const ext = result.content_type.includes('png') ? 'png' : 'jpg';
|
|
223
265
|
const filename = opts.output || `generated.${ext}`;
|
|
224
266
|
const savedPath = await downloadFile(result.url, filename, !!opts.output);
|
|
225
267
|
if (opts.json) {
|
|
226
|
-
console.log(
|
|
268
|
+
console.log(jsonResult(result, elapsed, savedPath));
|
|
227
269
|
}
|
|
228
270
|
else {
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
271
|
+
console.log(muted(`Generated with ${result.provider}/${result.model}`));
|
|
272
|
+
printMetrics([
|
|
273
|
+
...generationMetrics(result, elapsed),
|
|
274
|
+
result.seed !== undefined
|
|
275
|
+
? { label: 'seed', value: `${result.seed} ${muted(`(pass --seed ${result.seed} to keep the next image coherent)`)}` } : null,
|
|
276
|
+
]);
|
|
234
277
|
// Saved-path last: a caller reading a truncated tail of this output (an
|
|
235
278
|
// agent batching several generates in one shell call) must still see
|
|
236
279
|
// WHERE the bytes landed - that is the one line the next command needs.
|
|
@@ -246,7 +289,10 @@ Examples:
|
|
|
246
289
|
const videoCommand = new Command('video')
|
|
247
290
|
.description('Generate a short video (up to 8 seconds) from a text prompt using Google Veo')
|
|
248
291
|
.addHelpText('after', `
|
|
249
|
-
Models:
|
|
292
|
+
Models (default: veo-3.1-generate-preview):
|
|
293
|
+
${VIDEO_MODELS_TABLE}
|
|
294
|
+
|
|
295
|
+
Aspect ratios: ${VIDEO_ASPECT_RATIOS}
|
|
250
296
|
|
|
251
297
|
Tips:
|
|
252
298
|
- Describe the scene, camera movement, lighting, and any dialogue
|
|
@@ -260,9 +306,9 @@ Examples:
|
|
|
260
306
|
gipity generate video "a wave crashing" --duration 4 --model veo-3.1-lite-generate-preview
|
|
261
307
|
`)
|
|
262
308
|
.argument('<prompt>', 'Description of the video scene, action, camera movement, and dialogue')
|
|
263
|
-
.
|
|
264
|
-
.
|
|
265
|
-
.
|
|
309
|
+
.addOption(new Option('--model <model>', 'Video model; see Models below for quality/price').choices(VIDEO_MODEL_IDS))
|
|
310
|
+
.addOption(new Option('--aspect <ratio>', 'Aspect ratio (landscape, portrait, square)').choices(VIDEO_ASPECT_RATIO_IDS))
|
|
311
|
+
.addOption(new Option('--resolution <res>', 'Video resolution').choices(VIDEO_RESOLUTION_IDS))
|
|
266
312
|
.option('--duration <seconds>', 'Clip length in seconds. Veo models: 4, 6, or 8 (8 required at 1080p/4K); omni-flash: 3-10. Default 8. Billing is per second, so shorter is cheaper.')
|
|
267
313
|
.option('-o, --output <file>', 'Output path (default ./generated.mp4). For a clip your app ships, write it into the source tree so it deploys, e.g. -o src/assets/video/clip.mp4; the cwd default is fine for one-off generation.')
|
|
268
314
|
.option('--json', 'Output as JSON')
|
|
@@ -279,17 +325,19 @@ Examples:
|
|
|
279
325
|
duration_seconds: opts.duration ? Number(opts.duration) : undefined,
|
|
280
326
|
});
|
|
281
327
|
// Veo runs 30-120s; the bouncing bar + timer keeps the wait honest.
|
|
328
|
+
const started = Date.now();
|
|
282
329
|
const result = opts.json
|
|
283
330
|
? await doGenerate()
|
|
284
331
|
: await withSpinner('Generating video...', doGenerate, { done: null });
|
|
332
|
+
const elapsed = (Date.now() - started) / 1000;
|
|
285
333
|
const filename = opts.output || 'generated.mp4';
|
|
286
334
|
const savedPath = await downloadFile(result.url, filename, !!opts.output);
|
|
287
335
|
if (opts.json) {
|
|
288
|
-
console.log(
|
|
336
|
+
console.log(jsonResult(result, elapsed, savedPath));
|
|
289
337
|
}
|
|
290
338
|
else {
|
|
291
|
-
|
|
292
|
-
|
|
339
|
+
console.log(muted(`Generated with ${result.provider}/${result.model}`));
|
|
340
|
+
printMetrics(generationMetrics(result, elapsed));
|
|
293
341
|
console.log(success(`Saved to ${savedPath}`));
|
|
294
342
|
}
|
|
295
343
|
}
|
|
@@ -302,7 +350,13 @@ Examples:
|
|
|
302
350
|
const speechCommand = new Command('speech')
|
|
303
351
|
.description('Generate speech audio from text using text-to-speech')
|
|
304
352
|
.addHelpText('after', `
|
|
305
|
-
Providers:
|
|
353
|
+
Providers:
|
|
354
|
+
${Object.entries(TTS_PROVIDER_DESCRIPTIONS).map(([k, v]) => ` ${k.padEnd(10)} ${v}`).join('\n')}
|
|
355
|
+
|
|
356
|
+
Voices: openai voices are the list above; the full Gemini list is below. ElevenLabs
|
|
357
|
+
voice ids: gipity service call "tts/voices?provider=elevenlabs" --get
|
|
358
|
+
|
|
359
|
+
Gemini voices: ${GEMINI_TTS_VOICES_DOC}
|
|
306
360
|
|
|
307
361
|
Multi-speaker (--speakers, Gemini only): JSON array like
|
|
308
362
|
[{"name":"Joe","voice":"Kore"},{"name":"Jane","voice":"Puck"}]; format the
|
|
@@ -315,8 +369,8 @@ Examples:
|
|
|
315
369
|
gipity generate speech 'Joe: Hey!\\nJane: Hi there!' --provider gemini --speakers '[{"name":"Joe","voice":"Charon"},{"name":"Jane","voice":"Leda"}]'
|
|
316
370
|
`)
|
|
317
371
|
.argument('<text>', 'Text to convert to speech (max 5000 characters)')
|
|
318
|
-
.
|
|
319
|
-
.option('--voice <voice>', 'Voice ID or name (provider-specific)')
|
|
372
|
+
.addOption(new Option('--provider <provider>', 'TTS provider (default: elevenlabs)').choices(TTS_PROVIDER_IDS))
|
|
373
|
+
.option('--voice <voice>', 'Voice ID or name (provider-specific; see Voices below)')
|
|
320
374
|
.option('--language <code>', 'BCP-47 language code, e.g. ja-JP, es-ES (Gemini only, 60+ languages)')
|
|
321
375
|
.option('--speakers <json>', 'Multi-speaker config as JSON array (Gemini only, up to 2 speakers)')
|
|
322
376
|
.option('-o, --output <file>', 'Output path (default ./speech.mp3). For audio your app ships, write it into the source tree so it deploys, e.g. -o src/assets/sounds/intro.mp3; the cwd default is fine for one-off generation.')
|
|
@@ -343,17 +397,19 @@ Examples:
|
|
|
343
397
|
language: opts.language,
|
|
344
398
|
speakers,
|
|
345
399
|
});
|
|
400
|
+
const started = Date.now();
|
|
346
401
|
const result = opts.json
|
|
347
402
|
? await doGenerate()
|
|
348
403
|
: await withSpinner('Generating speech...', doGenerate, { done: null });
|
|
404
|
+
const elapsed = (Date.now() - started) / 1000;
|
|
349
405
|
const filename = opts.output || 'speech.mp3';
|
|
350
406
|
const savedPath = await downloadFile(result.url, filename, !!opts.output);
|
|
351
407
|
if (opts.json) {
|
|
352
|
-
console.log(
|
|
408
|
+
console.log(jsonResult(result, elapsed, savedPath));
|
|
353
409
|
}
|
|
354
410
|
else {
|
|
355
|
-
|
|
356
|
-
|
|
411
|
+
console.log(muted(`Generated with ${result.provider}`));
|
|
412
|
+
printMetrics(generationMetrics(result, elapsed));
|
|
357
413
|
console.log(success(`Saved to ${savedPath}`));
|
|
358
414
|
}
|
|
359
415
|
}
|
|
@@ -382,7 +438,7 @@ Examples:
|
|
|
382
438
|
`)
|
|
383
439
|
.argument('<prompt>', 'Text description of the music to generate')
|
|
384
440
|
.option('--duration <seconds>', 'Clip length in seconds (default 30; max depends on the model)', (v) => parseInt(v, 10))
|
|
385
|
-
.option('--model <model>', 'Music model id (default: platform default)')
|
|
441
|
+
.option('--model <model>', 'Music model id (default: platform default; list ids: gipity service call music/models --get)')
|
|
386
442
|
.option('--vocals', 'Allow vocals (default: instrumental only)')
|
|
387
443
|
.option('-o, --output <file>', 'Output path (default ./music.mp3). For audio your app ships, write it into the source tree so it deploys, e.g. -o src/assets/audio/theme.mp3; the cwd default is fine for one-off generation.')
|
|
388
444
|
.option('--json', 'Output as JSON')
|
|
@@ -397,17 +453,19 @@ Examples:
|
|
|
397
453
|
model: opts.model,
|
|
398
454
|
instrumental: !opts.vocals,
|
|
399
455
|
});
|
|
456
|
+
const started = Date.now();
|
|
400
457
|
const result = opts.json
|
|
401
458
|
? await doGenerate()
|
|
402
459
|
: await withSpinner('Generating music...', doGenerate, { done: null });
|
|
460
|
+
const elapsed = (Date.now() - started) / 1000;
|
|
403
461
|
const filename = opts.output || 'music.mp3';
|
|
404
462
|
const savedPath = await downloadFile(result.url, filename, !!opts.output);
|
|
405
463
|
if (opts.json) {
|
|
406
|
-
console.log(
|
|
464
|
+
console.log(jsonResult(result, elapsed, savedPath));
|
|
407
465
|
}
|
|
408
466
|
else {
|
|
409
|
-
|
|
410
|
-
|
|
467
|
+
console.log(muted(`Generated with ${result.model}`));
|
|
468
|
+
printMetrics(generationMetrics(result, elapsed));
|
|
411
469
|
console.log(success(`Saved to ${savedPath}`));
|
|
412
470
|
}
|
|
413
471
|
}
|
|
@@ -449,17 +507,19 @@ Examples:
|
|
|
449
507
|
duration_seconds: opts.duration,
|
|
450
508
|
prompt_influence: opts.influence,
|
|
451
509
|
});
|
|
510
|
+
const started = Date.now();
|
|
452
511
|
const result = opts.json
|
|
453
512
|
? await doGenerate()
|
|
454
513
|
: await withSpinner('Generating sound effect...', doGenerate, { done: null });
|
|
514
|
+
const elapsed = (Date.now() - started) / 1000;
|
|
455
515
|
const filename = opts.output || 'sound.mp3';
|
|
456
516
|
const savedPath = await downloadFile(result.url, filename, !!opts.output);
|
|
457
517
|
if (opts.json) {
|
|
458
|
-
console.log(
|
|
518
|
+
console.log(jsonResult(result, elapsed, savedPath));
|
|
459
519
|
}
|
|
460
520
|
else {
|
|
461
|
-
|
|
462
|
-
|
|
521
|
+
console.log(muted('Generated sound effect'));
|
|
522
|
+
printMetrics(generationMetrics(result, elapsed));
|
|
463
523
|
console.log(success(`Saved to ${savedPath}`));
|
|
464
524
|
}
|
|
465
525
|
}
|
package/dist/commands/key.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
1
|
+
import { Command, Option } from 'commander';
|
|
2
2
|
import { get, post, del } from '../api.js';
|
|
3
3
|
import { resolveProjectContext } from '../config.js';
|
|
4
4
|
import { bold, muted, success, warning } from '../colors.js';
|
|
@@ -35,7 +35,7 @@ async function projectGuid(opts) {
|
|
|
35
35
|
keyCommand
|
|
36
36
|
.command('create <name>')
|
|
37
37
|
.description('Mint a project API key (shown once). Give it a name you will recognize later')
|
|
38
|
-
.
|
|
38
|
+
.addOption(new Option('--role <role>', 'Access role for the key').choices(['viewer', 'editor', 'owner']).default('viewer'))
|
|
39
39
|
.option('--expires-days <n>', 'Days until the key expires (default: never)')
|
|
40
40
|
.option(...projectOpt)
|
|
41
41
|
.option('--json', 'Output as JSON')
|
package/dist/commands/logs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
1
|
+
import { Command, Option } from 'commander';
|
|
2
2
|
import { get } from '../api.js';
|
|
3
3
|
import { requireConfig } from '../config.js';
|
|
4
4
|
import { success, error as clrError, warning, muted, bold } from '../colors.js';
|
|
@@ -66,7 +66,7 @@ logsCommand
|
|
|
66
66
|
.command('app')
|
|
67
67
|
.description('Unified recent activity for this app — JS errors, failed function calls, failed services, network failures. Designed for agents debugging a deployed app.')
|
|
68
68
|
.option('--since <window>', "Window: 5m / 10m / 30m / 1h / 6h / 24h / 7d", '10m')
|
|
69
|
-
.
|
|
69
|
+
.addOption(new Option('--severity <level>', 'Severity filter').choices(['error', 'warn', 'network', 'all']).default('all'))
|
|
70
70
|
.option('--type <list>', "Comma-separated: errors,functions,services,traffic. Default excludes traffic (high volume).")
|
|
71
71
|
.option('--filter <pattern>', 'Substring match against message / fn name / path (case-insensitive)')
|
|
72
72
|
.option('--limit <n>', 'Max entries', '100')
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { existsSync } from 'fs';
|
|
2
2
|
import { dirname, resolve } from 'path';
|
|
3
|
-
import { Command } from 'commander';
|
|
3
|
+
import { Command, Option } from 'commander';
|
|
4
4
|
import { get, post, del } from '../api.js';
|
|
5
5
|
import { requireConfig, getConfigPath } from '../config.js';
|
|
6
6
|
import { error as clrError, success, muted, bold } from '../colors.js';
|
|
@@ -21,8 +21,8 @@ const roomCommand = new Command('room')
|
|
|
21
21
|
.description('Manage realtime rooms')
|
|
22
22
|
.argument('[action]', 'list | create | delete | info', 'list')
|
|
23
23
|
.argument('[name]', 'room name (for create | delete | info)')
|
|
24
|
-
.
|
|
25
|
-
.
|
|
24
|
+
.addOption(new Option('--type <type>', 'Room type for create').choices(['state', 'relay']).default('state'))
|
|
25
|
+
.addOption(new Option('--auth <level>', 'Auth level for create').choices(['public', 'user']).default('public'))
|
|
26
26
|
.option('--max-clients <n>', 'max clients for create (1-200)')
|
|
27
27
|
.option('--json', 'Output as JSON')
|
|
28
28
|
.action((action, name, opts) => run('Realtime room', async () => {
|
package/dist/commands/records.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
1
|
+
import { Command, Option } from 'commander';
|
|
2
2
|
import { get, post, put, patch, del, publicRequest, mintAppToken } from '../api.js';
|
|
3
3
|
import { getAuth } from '../auth.js';
|
|
4
4
|
import { requireConfig } from '../config.js';
|
|
@@ -50,7 +50,7 @@ recordsCommand
|
|
|
50
50
|
recordsCommand
|
|
51
51
|
.command('config <table>')
|
|
52
52
|
.description('Show or set a table\'s Records API config (auth level, search, etc.)')
|
|
53
|
-
.
|
|
53
|
+
.addOption(new Option('--auth <level>', 'Auth level: public (anonymous writes), member (sign-in), or user').choices(['public', 'member', 'user']))
|
|
54
54
|
.option('--searchable <bool>', 'Enable full-text search (true/false)')
|
|
55
55
|
.option('--primary-key <col>', 'Primary key column (default: id)')
|
|
56
56
|
.option('--soft-delete <col>', 'Soft-delete column (pass "none" to clear)')
|
|
@@ -81,8 +81,8 @@ recordsCommand
|
|
|
81
81
|
.command('query <table>')
|
|
82
82
|
.description('List records (full-text search, filter, sort, recycle bin)')
|
|
83
83
|
.option('-q, --q <text>', 'Full-text search across the table\'s text columns (needs `--searchable true` on the table)')
|
|
84
|
-
.option('--filter <filter>', 'AND filter string
|
|
85
|
-
.option('--any <filter>', 'OR filter group, same grammar as --filter (e.g., "owner:eq:me,shared:eq:true")')
|
|
84
|
+
.option('--filter <filter>', 'AND filter string, "col:op:value" comma-joined. Ops: eq, neq, gt, gte, lt, lte, like, ilike, in (pipe-separated values), is_null, not_null. Full grammar: gipity skill read app-records')
|
|
85
|
+
.option('--any <filter>', 'OR filter group, same grammar and ops as --filter (e.g., "owner:eq:me,shared:eq:true")')
|
|
86
86
|
.option('--sort <sort>', 'Sort string (e.g., "created_at:desc")')
|
|
87
87
|
.option('--limit <n>', 'Max rows', '20')
|
|
88
88
|
.option('--offset <n>', 'Offset', '0')
|
package/dist/commands/service.js
CHANGED
|
@@ -13,9 +13,10 @@ const SERVICES = [
|
|
|
13
13
|
{ name: 'image', method: 'POST', desc: 'Generate an image ({ prompt, provider?, size? })' },
|
|
14
14
|
{ name: 'image/models', method: 'GET', desc: 'List image providers/models' },
|
|
15
15
|
{ name: 'tts', method: 'POST', desc: 'Text-to-speech ({ text, voice?, ... })' },
|
|
16
|
-
{ name: 'tts/voices', method: 'GET', desc: 'List TTS voices' },
|
|
16
|
+
{ name: 'tts/voices', method: 'GET', desc: 'List TTS voices (append ?provider=elevenlabs|openai|gemini)' },
|
|
17
17
|
{ name: 'sound', method: 'POST', desc: 'Sound effect ({ text, duration_seconds? })' },
|
|
18
18
|
{ name: 'music', method: 'POST', desc: 'Music generation ({ prompt, duration_seconds? })' },
|
|
19
|
+
{ name: 'music/models', method: 'GET', desc: 'List music models (ids for --model / model)' },
|
|
19
20
|
{ name: 'video', method: 'POST', desc: 'Video generation ({ prompt, ... })' },
|
|
20
21
|
{ name: 'location/ip', method: 'POST', desc: 'IP geolocation ({ ip? })' },
|
|
21
22
|
{ name: 'location/geocode', method: 'POST', desc: 'Reverse geocode ({ lat, lon })' },
|
|
@@ -75,9 +76,12 @@ serviceCommand
|
|
|
75
76
|
.action((name, bodyArg, opts) => run('Call', async () => {
|
|
76
77
|
const config = requireConfig();
|
|
77
78
|
// Encode each path segment but preserve the `/` separators so subpaths
|
|
78
|
-
// like `location/geocode` and `llm/models` resolve correctly.
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
// like `location/geocode` and `llm/models` resolve correctly. A query
|
|
80
|
+
// string rides along untouched, so listing endpoints that filter by
|
|
81
|
+
// parameter work: `gipity service call "tts/voices?provider=elevenlabs" --get`.
|
|
82
|
+
const [pathPart, query] = name.split('?', 2);
|
|
83
|
+
const path = pathPart.split('/').map(encodeURIComponent).join('/');
|
|
84
|
+
const url = `/api/${config.projectGuid}/services/${path}${query ? `?${query}` : ''}`;
|
|
81
85
|
const body = resolveBody(bodyArg || opts.data, opts.file);
|
|
82
86
|
// Name the calling identity (stderr, so stdout stays parseable). An owner
|
|
83
87
|
// call always succeeds regardless of billing mode, so without this line a
|
package/dist/index.js
CHANGED
|
@@ -35664,7 +35664,7 @@ async function projectGuid(opts) {
|
|
|
35664
35664
|
const { config } = await resolveProjectContext({ projectOverride: opts.project });
|
|
35665
35665
|
return config.projectGuid;
|
|
35666
35666
|
}
|
|
35667
|
-
keyCommand.command("create <name>").description("Mint a project API key (shown once). Give it a name you will recognize later").
|
|
35667
|
+
keyCommand.command("create <name>").description("Mint a project API key (shown once). Give it a name you will recognize later").addOption(new Option("--role <role>", "Access role for the key").choices(["viewer", "editor", "owner"]).default("viewer")).option("--expires-days <n>", "Days until the key expires (default: never)").option(...projectOpt).option("--json", "Output as JSON").action((name, opts) => run("Create", async () => {
|
|
35668
35668
|
const body = { name, role: opts.role };
|
|
35669
35669
|
if (opts.expiresDays !== void 0) {
|
|
35670
35670
|
const days = parseInt(opts.expiresDays, 10);
|
|
@@ -38003,7 +38003,7 @@ function statusIcon(status) {
|
|
|
38003
38003
|
if (status === "warning") return warning("\u26A0");
|
|
38004
38004
|
return muted("\u2192");
|
|
38005
38005
|
}
|
|
38006
|
-
var deployCommand = new Command("deploy").description("Deploy to dev or prod").argument("[target]", "dev or prod", "dev").option("--source-dir <dir>", "Source directory to deploy from").option("--only <phases>", "Run only specific phases
|
|
38006
|
+
var deployCommand = new Command("deploy").description("Deploy to dev or prod").argument("[target]", "dev or prod", "dev").option("--source-dir <dir>", "Source directory to deploy from").option("--only <phases>", "Run only specific phases, comma-separated, matched by gipity.yaml phase name or type: files/static, database/sql, functions, workflows, services, jobs, records, realtime, env, auth_branding").option("--force", "Re-run all phases (ignore checksums) and bypass the sync bulk-deletion guard").option("--no-sync", "Skip sync-up before deploy").option("--optimize", "Force Vite build optimization on (default for prod; use this to optimize a dev deploy too)").option("--no-optimize", 'Skip build optimization and upload files as-is - the escape hatch for plain-HTML apps whose <script src> tags are not type="module"').option("--json", "Output as JSON").option("--inspect [path]", "After a successful deploy, run `page inspect` on the deployed URL (or URL + path) in the same command - one build-loop step instead of two. With --json, emits two JSON lines: deploy, then inspect.").option("--wait <ms>", "With --inspect: sleep this many ms before capturing (max 30000)").option("--wait-for <selector>", "With --inspect: wait until this CSS selector appears before capturing (deterministic; the app's own ready signal)").option("--wait-timeout <ms>", "With --inspect: max ms to wait for --wait-for before giving up", "5000").action((target, opts) => run("Deploy", async () => {
|
|
38007
38007
|
if (target !== "dev" && target !== "prod") {
|
|
38008
38008
|
console.error(error('Target must be "dev" or "prod"'));
|
|
38009
38009
|
process.exit(1);
|
|
@@ -38952,7 +38952,26 @@ var agentCommand = new Command("agent").description("Manage agents").argument("[
|
|
|
38952
38952
|
return `${a.name}${active}${def}${model}`;
|
|
38953
38953
|
});
|
|
38954
38954
|
}));
|
|
38955
|
-
agentCommand.command("
|
|
38955
|
+
agentCommand.command("models").description("List the LLM models an agent can use (ids for `agent create --model` and `agent set model`)").option("--json", "Output as JSON").action((opts) => run("Models", async () => {
|
|
38956
|
+
const res = await get("/agents/models");
|
|
38957
|
+
if (opts.json) {
|
|
38958
|
+
console.log(JSON.stringify(res.data));
|
|
38959
|
+
return;
|
|
38960
|
+
}
|
|
38961
|
+
const width = res.data.reduce((m, x) => Math.max(m, x.id.length), 0);
|
|
38962
|
+
for (const m of res.data) {
|
|
38963
|
+
const notes = [
|
|
38964
|
+
m.displayName,
|
|
38965
|
+
m.provider,
|
|
38966
|
+
`$${m.inputCostPerMTok}/$${m.outputCostPerMTok} per 1M tok`,
|
|
38967
|
+
`${Math.round(m.maxContextTokens / 1e3)}K ctx`
|
|
38968
|
+
];
|
|
38969
|
+
if (m.blurb) notes.push(m.blurb);
|
|
38970
|
+
if (m.isDefault) notes.push("default");
|
|
38971
|
+
console.log(`${m.id.padEnd(width)} ${muted(notes.join(" \xB7 "))}`);
|
|
38972
|
+
}
|
|
38973
|
+
}));
|
|
38974
|
+
agentCommand.command("create <name>").description("Create an agent").option("--model <model>", "Model preference (an id from `gipity agent models`; default: platform default)").option("--switch", "Switch to new agent after creation").option("--json", "Output as JSON").action((name, opts) => run("Create", async () => {
|
|
38956
38975
|
const body = { name };
|
|
38957
38976
|
if (opts.model) body.modelPreference = opts.model;
|
|
38958
38977
|
const res = await post("/agents", body);
|
|
@@ -38967,7 +38986,7 @@ agentCommand.command("create <name>").description("Create an agent").option("--m
|
|
|
38967
38986
|
if (opts.switch) console.log("Switched.");
|
|
38968
38987
|
}
|
|
38969
38988
|
}));
|
|
38970
|
-
agentCommand.command("set <field> <value>").description("Set a field (model, temp)").option("--json", "Output as JSON").action((field, value, opts) => run("Set", async () => {
|
|
38989
|
+
agentCommand.command("set <field> <value>").description("Set a field (model, temp). Model ids: `gipity agent models`").option("--json", "Output as JSON").action((field, value, opts) => run("Set", async () => {
|
|
38971
38990
|
const config = requireConfig();
|
|
38972
38991
|
const body = {};
|
|
38973
38992
|
if (field === "model") body.modelPreference = value;
|
|
@@ -42216,7 +42235,7 @@ and its own error message), use the per-call log instead:
|
|
|
42216
42235
|
}
|
|
42217
42236
|
}
|
|
42218
42237
|
}));
|
|
42219
|
-
logsCommand.command("app").description("Unified recent activity for this app \u2014 JS errors, failed function calls, failed services, network failures. Designed for agents debugging a deployed app.").option("--since <window>", "Window: 5m / 10m / 30m / 1h / 6h / 24h / 7d", "10m").
|
|
42238
|
+
logsCommand.command("app").description("Unified recent activity for this app \u2014 JS errors, failed function calls, failed services, network failures. Designed for agents debugging a deployed app.").option("--since <window>", "Window: 5m / 10m / 30m / 1h / 6h / 24h / 7d", "10m").addOption(new Option("--severity <level>", "Severity filter").choices(["error", "warn", "network", "all"]).default("all")).option("--type <list>", "Comma-separated: errors,functions,services,traffic. Default excludes traffic (high volume).").option("--filter <pattern>", "Substring match against message / fn name / path (case-insensitive)").option("--limit <n>", "Max entries", "100").option("--json", "Output as JSON (parseable by agents / pipes)").addHelpText("after", `
|
|
42220
42239
|
Examples:
|
|
42221
42240
|
$ gipity logs app Last 10 min of errors + fn failures
|
|
42222
42241
|
$ gipity logs app --since 1h Last hour
|
|
@@ -42712,7 +42731,7 @@ recordsCommand.command("list").description("List record tables").option("--json"
|
|
|
42712
42731
|
(t) => `${bold(t.table_name)} ${muted(t.auth_level)} ${muted(`pk=${t.primary_key_column}`)} ${muted(`db=${t.database_name}`)}`
|
|
42713
42732
|
);
|
|
42714
42733
|
}));
|
|
42715
|
-
recordsCommand.command("config <table>").description("Show or set a table's Records API config (auth level, search, etc.)").
|
|
42734
|
+
recordsCommand.command("config <table>").description("Show or set a table's Records API config (auth level, search, etc.)").addOption(new Option("--auth <level>", "Auth level: public (anonymous writes), member (sign-in), or user").choices(["public", "member", "user"])).option("--searchable <bool>", "Enable full-text search (true/false)").option("--primary-key <col>", "Primary key column (default: id)").option("--soft-delete <col>", 'Soft-delete column (pass "none" to clear)').option("--json", "Output as JSON").action((table, opts) => run("Config", async () => {
|
|
42716
42735
|
const config = requireConfig();
|
|
42717
42736
|
const base = `/api/${config.projectGuid}/records/${table}/config`;
|
|
42718
42737
|
const setting = opts.auth || opts.searchable !== void 0 || opts.primaryKey || opts.softDelete;
|
|
@@ -42733,7 +42752,7 @@ recordsCommand.command("config <table>").description("Show or set a table's Reco
|
|
|
42733
42752
|
res.data
|
|
42734
42753
|
);
|
|
42735
42754
|
}));
|
|
42736
|
-
recordsCommand.command("query <table>").description("List records (full-text search, filter, sort, recycle bin)").option("-q, --q <text>", "Full-text search across the table's text columns (needs `--searchable true` on the table)").option("--filter <filter>", 'AND filter string
|
|
42755
|
+
recordsCommand.command("query <table>").description("List records (full-text search, filter, sort, recycle bin)").option("-q, --q <text>", "Full-text search across the table's text columns (needs `--searchable true` on the table)").option("--filter <filter>", 'AND filter string, "col:op:value" comma-joined. Ops: eq, neq, gt, gte, lt, lte, like, ilike, in (pipe-separated values), is_null, not_null. Full grammar: gipity skill read app-records').option("--any <filter>", 'OR filter group, same grammar and ops as --filter (e.g., "owner:eq:me,shared:eq:true")').option("--sort <sort>", 'Sort string (e.g., "created_at:desc")').option("--limit <n>", "Max rows", "20").option("--offset <n>", "Offset", "0").option("--fields <fields>", "Comma-separated column names").option("--include-deleted", "Include soft-deleted rows (owner/editor)").option("--only-deleted", "Only soft-deleted rows - the recycle bin (owner/editor)").option(ANON_FLAG, ANON_HELP).option("--json", "Output as JSON").action((table, opts) => run("Query", async () => {
|
|
42737
42756
|
const api = await recordsHttp(opts);
|
|
42738
42757
|
const params = new URLSearchParams();
|
|
42739
42758
|
if (opts.q) params.set("q", opts.q);
|
|
@@ -42903,9 +42922,10 @@ var SERVICES = [
|
|
|
42903
42922
|
{ name: "image", method: "POST", desc: "Generate an image ({ prompt, provider?, size? })" },
|
|
42904
42923
|
{ name: "image/models", method: "GET", desc: "List image providers/models" },
|
|
42905
42924
|
{ name: "tts", method: "POST", desc: "Text-to-speech ({ text, voice?, ... })" },
|
|
42906
|
-
{ name: "tts/voices", method: "GET", desc: "List TTS voices" },
|
|
42925
|
+
{ name: "tts/voices", method: "GET", desc: "List TTS voices (append ?provider=elevenlabs|openai|gemini)" },
|
|
42907
42926
|
{ name: "sound", method: "POST", desc: "Sound effect ({ text, duration_seconds? })" },
|
|
42908
42927
|
{ name: "music", method: "POST", desc: "Music generation ({ prompt, duration_seconds? })" },
|
|
42928
|
+
{ name: "music/models", method: "GET", desc: "List music models (ids for --model / model)" },
|
|
42909
42929
|
{ name: "video", method: "POST", desc: "Video generation ({ prompt, ... })" },
|
|
42910
42930
|
{ name: "location/ip", method: "POST", desc: "IP geolocation ({ ip? })" },
|
|
42911
42931
|
{ name: "location/geocode", method: "POST", desc: "Reverse geocode ({ lat, lon })" }
|
|
@@ -42941,8 +42961,9 @@ function anonBillingHint(name, err) {
|
|
|
42941
42961
|
}
|
|
42942
42962
|
serviceCommand.command("call <name> [body]").description("Call an app service by name (e.g. llm, image, music). Uses your logged-in session - no token wrangling; --anon calls it as a signed-out visitor instead.").option("-d, --data <json>", "JSON request body: inline JSON, @file to read a file, or @- / - for stdin (alternative to the positional [body])").option("--file <field=@path>", "Attach a file as { data, media_type } under <field> (the vision/media shape these services expect), repeatable, e.g. --file image=@receipt.png", (v7, acc) => (acc || []).concat(v7)).option("--anon", "Call as an anonymous visitor (the public path a signed-out user of your deployed app hits) instead of as your signed-in account").option("--get", "Issue a GET (for listing endpoints like llm/models, tts/voices)").option("--field <path>", "Print only this field of the result (dot path, e.g. choices.0.message.content)").option("--json", "Output compact JSON").action((name, bodyArg, opts) => run("Call", async () => {
|
|
42943
42963
|
const config = requireConfig();
|
|
42944
|
-
const
|
|
42945
|
-
const
|
|
42964
|
+
const [pathPart, query] = name.split("?", 2);
|
|
42965
|
+
const path5 = pathPart.split("/").map(encodeURIComponent).join("/");
|
|
42966
|
+
const url = `/api/${config.projectGuid}/services/${path5}${query ? `?${query}` : ""}`;
|
|
42946
42967
|
const body = resolveBody(bodyArg || opts.data, opts.file);
|
|
42947
42968
|
if (opts.anon) {
|
|
42948
42969
|
console.error(muted("Auth: anonymous visitor (the public path a signed-out user of your deployed app hits)"));
|
|
@@ -43686,7 +43707,7 @@ emailCommand.command("test").description("Send a test email through your app's e
|
|
|
43686
43707
|
console.log(muted(` ${r.to} \u2014 ${r.status}${r.reason ? `: ${r.reason}` : ""}`));
|
|
43687
43708
|
}
|
|
43688
43709
|
}));
|
|
43689
|
-
emailCommand.command("log").description("Recent email() sends and skipped attempts from your app").
|
|
43710
|
+
emailCommand.command("log").description("Recent email() sends and skipped attempts from your app").addOption(new Option("--range <range>", "Time range").choices(["1h", "24h", "7d", "30d", "1y"]).default("7d")).option("--limit <n>", "Max rows", "50").option("--project <guid-or-slug>", "Target a specific project instead of cwd / Home").option("--json", "Output raw JSON").action((opts) => run("Email", async () => {
|
|
43690
43711
|
const { config } = await resolveProjectContext({ projectOverride: opts.project });
|
|
43691
43712
|
const res = await get(
|
|
43692
43713
|
`/account/logs/credits?operations=email_send,email_skip&app_guid=${config.projectGuid}&range=${encodeURIComponent(opts.range)}&limit=${encodeURIComponent(opts.limit)}`
|
|
@@ -43718,15 +43739,103 @@ import { mkdirSync as mkdirSync13, writeFileSync as writeFileSync13, readFileSyn
|
|
|
43718
43739
|
import { resolve as resolvePath2, dirname as dirname12, relative as relative5, isAbsolute, basename as basename6 } from "path";
|
|
43719
43740
|
|
|
43720
43741
|
// src/provider-docs.ts
|
|
43721
|
-
var
|
|
43742
|
+
var GEMINI_TTS_VOICES_DOC = `Zephyr, Puck, Charon, Kore, Fenrir, Leda, Orus, Aoede, Callirrhoe, Autonoe, Enceladus, Iapetus, Umbriel, Algieba, Despina, Erinome, Algenib, Rasalgethi, Laomedeia, Achernar, Alnilam, Schedar, Gacrux, Pulcherrima, Achird, Zubenelgenubi, Vindemiatrix, Sadachbia, Sadaltager, Sulafat`;
|
|
43743
|
+
var IMAGE_GEMINI_ASPECT_RATIO_IDS = [
|
|
43744
|
+
"1:1",
|
|
43745
|
+
"16:9",
|
|
43746
|
+
"9:16",
|
|
43747
|
+
"4:3",
|
|
43748
|
+
"3:4",
|
|
43749
|
+
"3:2",
|
|
43750
|
+
"2:3",
|
|
43751
|
+
"4:5",
|
|
43752
|
+
"5:4",
|
|
43753
|
+
"21:9"
|
|
43754
|
+
];
|
|
43755
|
+
var IMAGE_GEMINI_SIZE_IDS = [
|
|
43756
|
+
"512",
|
|
43757
|
+
"1K",
|
|
43758
|
+
"2K",
|
|
43759
|
+
"4K"
|
|
43760
|
+
];
|
|
43761
|
+
var IMAGE_MODELS_TABLE = ` openai gpt-image-2
|
|
43762
|
+
bfl flux-2-pro, flux-2-flex, flux-2-max, flux-2-klein-9b, flux-2-klein-4b
|
|
43763
|
+
gemini gemini-3.1-flash-lite-image, gemini-2.5-flash-image, gemini-3.1-flash-image, gemini-3-pro-image`;
|
|
43764
|
+
var IMAGE_PROVIDER_IDS = [
|
|
43765
|
+
"openai",
|
|
43766
|
+
"bfl",
|
|
43767
|
+
"gemini"
|
|
43768
|
+
];
|
|
43769
|
+
var IMAGE_QUALITY_IDS = [
|
|
43770
|
+
"low",
|
|
43771
|
+
"medium",
|
|
43772
|
+
"high",
|
|
43773
|
+
"auto"
|
|
43774
|
+
];
|
|
43775
|
+
var IMAGE_TIER_ALIASES_DOC = `fast (gemini/gemini-3.1-flash-lite-image), standard (openai/gpt-image-2), high (bfl/flux-2-pro), ultra (bfl/flux-2-max)`;
|
|
43776
|
+
var IMAGE_TIER_ALIAS_IDS = [
|
|
43777
|
+
"fast",
|
|
43778
|
+
"standard",
|
|
43779
|
+
"high",
|
|
43780
|
+
"ultra"
|
|
43781
|
+
];
|
|
43722
43782
|
var TTS_PROVIDER_DESCRIPTIONS = {
|
|
43723
|
-
"elevenlabs": `ElevenLabs (many voices
|
|
43783
|
+
"elevenlabs": `ElevenLabs (many premium voices)`,
|
|
43724
43784
|
"openai": `OpenAI (alloy, ash, ballad, coral, echo, fable, nova, onyx, sage, shimmer, verse)`,
|
|
43725
43785
|
"gemini": `Gemini (30 voices: Kore, Puck, Zephyr, Charon, Fenrir, Leda, Orus, Aoede, and 22 more). Multi-speaker (up to 2) and 60+ languages`
|
|
43726
43786
|
};
|
|
43727
|
-
var
|
|
43787
|
+
var TTS_PROVIDER_IDS = [
|
|
43788
|
+
"elevenlabs",
|
|
43789
|
+
"openai",
|
|
43790
|
+
"gemini"
|
|
43791
|
+
];
|
|
43792
|
+
var VIDEO_ASPECT_RATIOS = `16:9 (landscape), 9:16 (portrait), 1:1 (square)`;
|
|
43793
|
+
var VIDEO_ASPECT_RATIO_IDS = [
|
|
43794
|
+
"16:9",
|
|
43795
|
+
"9:16",
|
|
43796
|
+
"1:1"
|
|
43797
|
+
];
|
|
43798
|
+
var VIDEO_MODELS_TABLE = ` veo-3.1-generate-preview best quality, up to 4K, ~$0.40/sec
|
|
43799
|
+
veo-3.1-fast-generate-preview faster, ~$0.10/sec
|
|
43800
|
+
veo-3.1-lite-generate-preview budget, ~$0.05/sec
|
|
43801
|
+
gemini-omni-flash-preview 3-10s @ 720p, conversational editing, ~$0.10/sec`;
|
|
43802
|
+
var VIDEO_MODEL_IDS = [
|
|
43803
|
+
"veo-3.1-generate-preview",
|
|
43804
|
+
"veo-3.1-fast-generate-preview",
|
|
43805
|
+
"veo-3.1-lite-generate-preview",
|
|
43806
|
+
"gemini-omni-flash-preview"
|
|
43807
|
+
];
|
|
43808
|
+
var VIDEO_RESOLUTION_IDS = [
|
|
43809
|
+
"720p",
|
|
43810
|
+
"1080p",
|
|
43811
|
+
"4k"
|
|
43812
|
+
];
|
|
43728
43813
|
|
|
43729
43814
|
// src/commands/generate.ts
|
|
43815
|
+
function printMetrics(metrics) {
|
|
43816
|
+
const rows = metrics.filter((m) => m !== null);
|
|
43817
|
+
const width = Math.max(...rows.map((m) => m.label.length));
|
|
43818
|
+
for (const m of rows) {
|
|
43819
|
+
console.log(` ${muted(`${m.label.padStart(width)}:`)} ${m.value}`);
|
|
43820
|
+
}
|
|
43821
|
+
}
|
|
43822
|
+
function fmtSeconds(s) {
|
|
43823
|
+
if (s >= 60) return `${Math.floor(s / 60)}m ${Math.round(s % 60)}s`;
|
|
43824
|
+
return `${s < 10 ? Math.round(s * 10) / 10 : Math.round(s)}s`;
|
|
43825
|
+
}
|
|
43826
|
+
function generationMetrics(result, elapsedSeconds) {
|
|
43827
|
+
const speed = result.duration_seconds !== void 0 && elapsedSeconds > 0 ? result.duration_seconds / elapsedSeconds : void 0;
|
|
43828
|
+
return [
|
|
43829
|
+
result.duration_seconds !== void 0 ? { label: "duration", value: `${fmtSeconds(result.duration_seconds)} clip` } : null,
|
|
43830
|
+
{ label: "size", value: `${Math.round(result.size_bytes / 1024)}KB` },
|
|
43831
|
+
{ label: "time", value: fmtSeconds(elapsedSeconds) },
|
|
43832
|
+
speed !== void 0 ? { label: "speed", value: `${speed >= 1 ? Math.round(speed * 10) / 10 : Math.round(speed * 100) / 100}x realtime` } : null,
|
|
43833
|
+
result.credits_deducted !== void 0 ? { label: "credits", value: `${result.credits_deducted.toLocaleString("en-US")} (${result.remaining_balance.toLocaleString("en-US")} remaining)` } : null
|
|
43834
|
+
];
|
|
43835
|
+
}
|
|
43836
|
+
function jsonResult(result, elapsedSeconds, savedPath) {
|
|
43837
|
+
return JSON.stringify({ ...result, generation_seconds: Math.round(elapsedSeconds * 10) / 10, saved: savedPath });
|
|
43838
|
+
}
|
|
43730
43839
|
async function downloadFile(url, filename, explicit) {
|
|
43731
43840
|
const res = await fetch(url);
|
|
43732
43841
|
if (!res.ok) throw new Error(`Download failed: ${res.status}`);
|
|
@@ -43812,7 +43921,11 @@ function readInputImages(paths) {
|
|
|
43812
43921
|
});
|
|
43813
43922
|
}
|
|
43814
43923
|
var imageCommand = new Command("image").description("Generate an image from a text prompt, or edit existing images with --input").addHelpText("after", `
|
|
43815
|
-
Models:
|
|
43924
|
+
Models (one line per provider; pass an id with --model, the provider with --provider):
|
|
43925
|
+
${IMAGE_MODELS_TABLE}
|
|
43926
|
+
|
|
43927
|
+
Tier aliases (pass to --model instead of an id; each names a provider+model):
|
|
43928
|
+
${IMAGE_TIER_ALIASES_DOC}
|
|
43816
43929
|
|
|
43817
43930
|
Editing (--input): pass one or more source images and the prompt becomes an edit
|
|
43818
43931
|
instruction applied to them - "make it night time", "add a hat", "remove the car
|
|
@@ -43826,7 +43939,7 @@ Examples:
|
|
|
43826
43939
|
gipity generate image "landscape sunset" --provider gemini --aspect-ratio 16:9 --image-size 2K
|
|
43827
43940
|
gipity generate image "product photo" --provider openai --model gpt-image-2 --size 1536x1024 --quality high
|
|
43828
43941
|
gipity generate image "abstract art" --provider bfl --model flux-2-pro -o art.png
|
|
43829
|
-
`).argument("<prompt>", "Text description of the image, or (with --input) the edit instruction to apply").option("--input <file>", "Source image to edit/compose (repeatable). With --input the prompt is an edit instruction; routes to Gemini.", (v7, acc) => (acc || []).concat(v7)).
|
|
43942
|
+
`).argument("<prompt>", "Text description of the image, or (with --input) the edit instruction to apply").option("--input <file>", "Source image to edit/compose (repeatable). With --input the prompt is an edit instruction; routes to Gemini.", (v7, acc) => (acc || []).concat(v7)).addOption(new Option("--provider <provider>", "Image provider (default: bfl)").choices(IMAGE_PROVIDER_IDS)).option("--model <model>", `Model id for the chosen provider, or a tier alias (${IMAGE_TIER_ALIAS_IDS.join(", ")}); see Models below`).option("--size <size>", 'Dimensions as WxH, e.g. "1024x1024" (OpenAI/BFL)').addOption(new Option("--quality <quality>", "Quality (gpt-image-2 only)").choices(IMAGE_QUALITY_IDS)).addOption(new Option("--aspect-ratio <ratio>", "Aspect ratio (Gemini only)").choices(IMAGE_GEMINI_ASPECT_RATIO_IDS)).addOption(new Option("--image-size <size>", "Output resolution (Gemini only)").choices(IMAGE_GEMINI_SIZE_IDS)).option("--seed <n>", "Deterministic seed (BFL only): reuse one seed to keep a set of images visually coherent", (v7) => parseInt(v7, 10)).option("-o, --output <file>", "Output path (default ./generated.png). For an image your app ships, write it into the source tree so it deploys, e.g. -o src/assets/images/hero.png; the cwd default is fine for one-off generation.").option("--json", "Output as JSON").action(async (prompt2, opts) => {
|
|
43830
43943
|
try {
|
|
43831
43944
|
const { config } = await resolveProjectContext();
|
|
43832
43945
|
if (opts.output) ensureOutputDir(opts.output);
|
|
@@ -43843,18 +43956,20 @@ Examples:
|
|
|
43843
43956
|
input_images: inputImages
|
|
43844
43957
|
});
|
|
43845
43958
|
const verb = inputImages ? "Editing image..." : "Generating image...";
|
|
43959
|
+
const started = Date.now();
|
|
43846
43960
|
const result = opts.json ? await doGenerate() : await withSpinner(verb, doGenerate, { done: null });
|
|
43961
|
+
const elapsed = (Date.now() - started) / 1e3;
|
|
43847
43962
|
const ext = result.content_type.includes("png") ? "png" : "jpg";
|
|
43848
43963
|
const filename = opts.output || `generated.${ext}`;
|
|
43849
43964
|
const savedPath = await downloadFile(result.url, filename, !!opts.output);
|
|
43850
43965
|
if (opts.json) {
|
|
43851
|
-
console.log(
|
|
43966
|
+
console.log(jsonResult(result, elapsed, savedPath));
|
|
43852
43967
|
} else {
|
|
43853
|
-
|
|
43854
|
-
|
|
43855
|
-
|
|
43856
|
-
|
|
43857
|
-
|
|
43968
|
+
console.log(muted(`Generated with ${result.provider}/${result.model}`));
|
|
43969
|
+
printMetrics([
|
|
43970
|
+
...generationMetrics(result, elapsed),
|
|
43971
|
+
result.seed !== void 0 ? { label: "seed", value: `${result.seed} ${muted(`(pass --seed ${result.seed} to keep the next image coherent)`)}` } : null
|
|
43972
|
+
]);
|
|
43858
43973
|
console.log(success(`Saved to ${savedPath}`));
|
|
43859
43974
|
}
|
|
43860
43975
|
} catch (err) {
|
|
@@ -43863,7 +43978,10 @@ Examples:
|
|
|
43863
43978
|
}
|
|
43864
43979
|
});
|
|
43865
43980
|
var videoCommand = new Command("video").description("Generate a short video (up to 8 seconds) from a text prompt using Google Veo").addHelpText("after", `
|
|
43866
|
-
Models:
|
|
43981
|
+
Models (default: veo-3.1-generate-preview):
|
|
43982
|
+
${VIDEO_MODELS_TABLE}
|
|
43983
|
+
|
|
43984
|
+
Aspect ratios: ${VIDEO_ASPECT_RATIOS}
|
|
43867
43985
|
|
|
43868
43986
|
Tips:
|
|
43869
43987
|
- Describe the scene, camera movement, lighting, and any dialogue
|
|
@@ -43875,7 +43993,7 @@ Examples:
|
|
|
43875
43993
|
gipity generate video "close-up of coffee being poured" --model veo-3.1-fast-generate-preview
|
|
43876
43994
|
gipity generate video "vertical dance video" --aspect 9:16 --resolution 1080p -o dance.mp4
|
|
43877
43995
|
gipity generate video "a wave crashing" --duration 4 --model veo-3.1-lite-generate-preview
|
|
43878
|
-
`).argument("<prompt>", "Description of the video scene, action, camera movement, and dialogue").
|
|
43996
|
+
`).argument("<prompt>", "Description of the video scene, action, camera movement, and dialogue").addOption(new Option("--model <model>", "Video model; see Models below for quality/price").choices(VIDEO_MODEL_IDS)).addOption(new Option("--aspect <ratio>", "Aspect ratio (landscape, portrait, square)").choices(VIDEO_ASPECT_RATIO_IDS)).addOption(new Option("--resolution <res>", "Video resolution").choices(VIDEO_RESOLUTION_IDS)).option("--duration <seconds>", "Clip length in seconds. Veo models: 4, 6, or 8 (8 required at 1080p/4K); omni-flash: 3-10. Default 8. Billing is per second, so shorter is cheaper.").option("-o, --output <file>", "Output path (default ./generated.mp4). For a clip your app ships, write it into the source tree so it deploys, e.g. -o src/assets/video/clip.mp4; the cwd default is fine for one-off generation.").option("--json", "Output as JSON").action(async (prompt2, opts) => {
|
|
43879
43997
|
try {
|
|
43880
43998
|
const { config } = await resolveProjectContext();
|
|
43881
43999
|
if (opts.output) ensureOutputDir(opts.output);
|
|
@@ -43886,14 +44004,16 @@ Examples:
|
|
|
43886
44004
|
resolution: opts.resolution,
|
|
43887
44005
|
duration_seconds: opts.duration ? Number(opts.duration) : void 0
|
|
43888
44006
|
});
|
|
44007
|
+
const started = Date.now();
|
|
43889
44008
|
const result = opts.json ? await doGenerate() : await withSpinner("Generating video...", doGenerate, { done: null });
|
|
44009
|
+
const elapsed = (Date.now() - started) / 1e3;
|
|
43890
44010
|
const filename = opts.output || "generated.mp4";
|
|
43891
44011
|
const savedPath = await downloadFile(result.url, filename, !!opts.output);
|
|
43892
44012
|
if (opts.json) {
|
|
43893
|
-
console.log(
|
|
44013
|
+
console.log(jsonResult(result, elapsed, savedPath));
|
|
43894
44014
|
} else {
|
|
43895
|
-
|
|
43896
|
-
|
|
44015
|
+
console.log(muted(`Generated with ${result.provider}/${result.model}`));
|
|
44016
|
+
printMetrics(generationMetrics(result, elapsed));
|
|
43897
44017
|
console.log(success(`Saved to ${savedPath}`));
|
|
43898
44018
|
}
|
|
43899
44019
|
} catch (err) {
|
|
@@ -43902,7 +44022,13 @@ Examples:
|
|
|
43902
44022
|
}
|
|
43903
44023
|
});
|
|
43904
44024
|
var speechCommand = new Command("speech").description("Generate speech audio from text using text-to-speech").addHelpText("after", `
|
|
43905
|
-
Providers:
|
|
44025
|
+
Providers:
|
|
44026
|
+
${Object.entries(TTS_PROVIDER_DESCRIPTIONS).map(([k7, v7]) => ` ${k7.padEnd(10)} ${v7}`).join("\n")}
|
|
44027
|
+
|
|
44028
|
+
Voices: openai voices are the list above; the full Gemini list is below. ElevenLabs
|
|
44029
|
+
voice ids: gipity service call "tts/voices?provider=elevenlabs" --get
|
|
44030
|
+
|
|
44031
|
+
Gemini voices: ${GEMINI_TTS_VOICES_DOC}
|
|
43906
44032
|
|
|
43907
44033
|
Multi-speaker (--speakers, Gemini only): JSON array like
|
|
43908
44034
|
[{"name":"Joe","voice":"Kore"},{"name":"Jane","voice":"Puck"}]; format the
|
|
@@ -43913,7 +44039,7 @@ Examples:
|
|
|
43913
44039
|
gipity generate speech "\u3053\u3093\u306B\u3061\u306F\u4E16\u754C" --provider gemini --voice Kore --language ja-JP
|
|
43914
44040
|
gipity generate speech "Bonjour le monde" --provider gemini --language fr-FR
|
|
43915
44041
|
gipity generate speech 'Joe: Hey!\\nJane: Hi there!' --provider gemini --speakers '[{"name":"Joe","voice":"Charon"},{"name":"Jane","voice":"Leda"}]'
|
|
43916
|
-
`).argument("<text>", "Text to convert to speech (max 5000 characters)").
|
|
44042
|
+
`).argument("<text>", "Text to convert to speech (max 5000 characters)").addOption(new Option("--provider <provider>", "TTS provider (default: elevenlabs)").choices(TTS_PROVIDER_IDS)).option("--voice <voice>", "Voice ID or name (provider-specific; see Voices below)").option("--language <code>", "BCP-47 language code, e.g. ja-JP, es-ES (Gemini only, 60+ languages)").option("--speakers <json>", "Multi-speaker config as JSON array (Gemini only, up to 2 speakers)").option("-o, --output <file>", "Output path (default ./speech.mp3). For audio your app ships, write it into the source tree so it deploys, e.g. -o src/assets/sounds/intro.mp3; the cwd default is fine for one-off generation.").option("--json", "Output as JSON").action(async (text, opts) => {
|
|
43917
44043
|
try {
|
|
43918
44044
|
const { config } = await resolveProjectContext();
|
|
43919
44045
|
if (opts.output) ensureOutputDir(opts.output);
|
|
@@ -43933,14 +44059,16 @@ Examples:
|
|
|
43933
44059
|
language: opts.language,
|
|
43934
44060
|
speakers
|
|
43935
44061
|
});
|
|
44062
|
+
const started = Date.now();
|
|
43936
44063
|
const result = opts.json ? await doGenerate() : await withSpinner("Generating speech...", doGenerate, { done: null });
|
|
44064
|
+
const elapsed = (Date.now() - started) / 1e3;
|
|
43937
44065
|
const filename = opts.output || "speech.mp3";
|
|
43938
44066
|
const savedPath = await downloadFile(result.url, filename, !!opts.output);
|
|
43939
44067
|
if (opts.json) {
|
|
43940
|
-
console.log(
|
|
44068
|
+
console.log(jsonResult(result, elapsed, savedPath));
|
|
43941
44069
|
} else {
|
|
43942
|
-
|
|
43943
|
-
|
|
44070
|
+
console.log(muted(`Generated with ${result.provider}`));
|
|
44071
|
+
printMetrics(generationMetrics(result, elapsed));
|
|
43944
44072
|
console.log(success(`Saved to ${savedPath}`));
|
|
43945
44073
|
}
|
|
43946
44074
|
} catch (err) {
|
|
@@ -43962,7 +44090,7 @@ Examples:
|
|
|
43962
44090
|
gipity generate music "chill lo-fi beat for studying"
|
|
43963
44091
|
gipity generate music "epic orchestral battle theme" --duration 60 -o src/assets/audio/theme.mp3
|
|
43964
44092
|
gipity generate music "indie pop chorus" --vocals --duration 20
|
|
43965
|
-
`).argument("<prompt>", "Text description of the music to generate").option("--duration <seconds>", "Clip length in seconds (default 30; max depends on the model)", (v7) => parseInt(v7, 10)).option("--model <model>", "Music model id (default: platform default)").option("--vocals", "Allow vocals (default: instrumental only)").option("-o, --output <file>", "Output path (default ./music.mp3). For audio your app ships, write it into the source tree so it deploys, e.g. -o src/assets/audio/theme.mp3; the cwd default is fine for one-off generation.").option("--json", "Output as JSON").action(async (prompt2, opts) => {
|
|
44093
|
+
`).argument("<prompt>", "Text description of the music to generate").option("--duration <seconds>", "Clip length in seconds (default 30; max depends on the model)", (v7) => parseInt(v7, 10)).option("--model <model>", "Music model id (default: platform default; list ids: gipity service call music/models --get)").option("--vocals", "Allow vocals (default: instrumental only)").option("-o, --output <file>", "Output path (default ./music.mp3). For audio your app ships, write it into the source tree so it deploys, e.g. -o src/assets/audio/theme.mp3; the cwd default is fine for one-off generation.").option("--json", "Output as JSON").action(async (prompt2, opts) => {
|
|
43966
44094
|
try {
|
|
43967
44095
|
const { config } = await resolveProjectContext();
|
|
43968
44096
|
if (opts.output) ensureOutputDir(opts.output);
|
|
@@ -43972,14 +44100,16 @@ Examples:
|
|
|
43972
44100
|
model: opts.model,
|
|
43973
44101
|
instrumental: !opts.vocals
|
|
43974
44102
|
});
|
|
44103
|
+
const started = Date.now();
|
|
43975
44104
|
const result = opts.json ? await doGenerate() : await withSpinner("Generating music...", doGenerate, { done: null });
|
|
44105
|
+
const elapsed = (Date.now() - started) / 1e3;
|
|
43976
44106
|
const filename = opts.output || "music.mp3";
|
|
43977
44107
|
const savedPath = await downloadFile(result.url, filename, !!opts.output);
|
|
43978
44108
|
if (opts.json) {
|
|
43979
|
-
console.log(
|
|
44109
|
+
console.log(jsonResult(result, elapsed, savedPath));
|
|
43980
44110
|
} else {
|
|
43981
|
-
|
|
43982
|
-
|
|
44111
|
+
console.log(muted(`Generated with ${result.model}`));
|
|
44112
|
+
printMetrics(generationMetrics(result, elapsed));
|
|
43983
44113
|
console.log(success(`Saved to ${savedPath}`));
|
|
43984
44114
|
}
|
|
43985
44115
|
} catch (err) {
|
|
@@ -44010,14 +44140,16 @@ Examples:
|
|
|
44010
44140
|
duration_seconds: opts.duration,
|
|
44011
44141
|
prompt_influence: opts.influence
|
|
44012
44142
|
});
|
|
44143
|
+
const started = Date.now();
|
|
44013
44144
|
const result = opts.json ? await doGenerate() : await withSpinner("Generating sound effect...", doGenerate, { done: null });
|
|
44145
|
+
const elapsed = (Date.now() - started) / 1e3;
|
|
44014
44146
|
const filename = opts.output || "sound.mp3";
|
|
44015
44147
|
const savedPath = await downloadFile(result.url, filename, !!opts.output);
|
|
44016
44148
|
if (opts.json) {
|
|
44017
|
-
console.log(
|
|
44149
|
+
console.log(jsonResult(result, elapsed, savedPath));
|
|
44018
44150
|
} else {
|
|
44019
|
-
|
|
44020
|
-
|
|
44151
|
+
console.log(muted("Generated sound effect"));
|
|
44152
|
+
printMetrics(generationMetrics(result, elapsed));
|
|
44021
44153
|
console.log(success(`Saved to ${savedPath}`));
|
|
44022
44154
|
}
|
|
44023
44155
|
} catch (err) {
|
|
@@ -44321,7 +44453,7 @@ function hasDeployManifest() {
|
|
|
44321
44453
|
if (!cfgPath) return false;
|
|
44322
44454
|
return existsSync17(resolve14(dirname13(cfgPath), "gipity.yaml"));
|
|
44323
44455
|
}
|
|
44324
|
-
var roomCommand = new Command("room").description("Manage realtime rooms").argument("[action]", "list | create | delete | info", "list").argument("[name]", "room name (for create | delete | info)").
|
|
44456
|
+
var roomCommand = new Command("room").description("Manage realtime rooms").argument("[action]", "list | create | delete | info", "list").argument("[name]", "room name (for create | delete | info)").addOption(new Option("--type <type>", "Room type for create").choices(["state", "relay"]).default("state")).addOption(new Option("--auth <level>", "Auth level for create").choices(["public", "user"]).default("public")).option("--max-clients <n>", "max clients for create (1-200)").option("--json", "Output as JSON").action((action, name, opts) => run("Realtime room", async () => {
|
|
44325
44457
|
const config = requireConfig();
|
|
44326
44458
|
const base = `/projects/${config.projectGuid}/realtime-rooms`;
|
|
44327
44459
|
const sub = (action || "list").toLowerCase();
|
|
@@ -48414,7 +48546,7 @@ function keyToIndex(key) {
|
|
|
48414
48546
|
return code >= 0 && code < 26 ? code : -1;
|
|
48415
48547
|
}
|
|
48416
48548
|
var approvalCommand = new Command("approval").description("Manage approvals");
|
|
48417
|
-
approvalCommand.command("list").description("List pending approvals").
|
|
48549
|
+
approvalCommand.command("list").description("List pending approvals").addOption(new Option("--status <status>", "Filter by status").choices(["pending", "approved", "denied", "cancelled", "expired", "all"]).default("pending")).option("--json", "Output as JSON").action((opts) => run("List", async () => {
|
|
48418
48550
|
const res = await get(`/approvals?status=${encodeURIComponent(opts.status)}`);
|
|
48419
48551
|
printList(
|
|
48420
48552
|
res.data,
|
|
@@ -48423,7 +48555,7 @@ approvalCommand.command("list").description("List pending approvals").option("--
|
|
|
48423
48555
|
(a) => `${a.guid} ${a.title} ${muted(`[${a.status}] ${timeAgo(a.created_at)}`)}`
|
|
48424
48556
|
);
|
|
48425
48557
|
}));
|
|
48426
|
-
approvalCommand.command("create <title...>").description("Create a pending approval").option("--description <text>", "Detailed context").
|
|
48558
|
+
approvalCommand.command("create <title...>").description("Create a pending approval").option("--description <text>", "Detailed context").addOption(new Option("--type <type>", "Approval type").choices(["yes_no", "choice", "text"]).default("yes_no")).option("--choices <a,b,c>", "Comma-separated options (for --type choice)").option("--prompt <text>", "Custom prompt shown to the user").option("--expires-in <minutes>", "Minutes until expiry (default: 10080 = 7d)").option("--json", "Output as JSON").action((titleParts, opts) => run("Create", async () => {
|
|
48427
48559
|
const body = { title: titleParts.join(" ") };
|
|
48428
48560
|
if (opts.description) body.description = opts.description;
|
|
48429
48561
|
if (opts.type) body.response_type = opts.type;
|
package/dist/provider-docs.js
CHANGED
|
@@ -41,8 +41,29 @@ export const GEMINI_TTS_VOICES = [
|
|
|
41
41
|
export const GEMINI_TTS_VOICES_DOC = `Zephyr, Puck, Charon, Kore, Fenrir, Leda, Orus, Aoede, Callirrhoe, Autonoe, Enceladus, Iapetus, Umbriel, Algieba, Despina, Erinome, Algenib, Rasalgethi, Laomedeia, Achernar, Alnilam, Schedar, Gacrux, Pulcherrima, Achird, Zubenelgenubi, Vindemiatrix, Sadachbia, Sadaltager, Sulafat`;
|
|
42
42
|
export const GEMINI_TTS_VOICES_SHORT = `Kore, Puck, Zephyr, Charon, Fenrir, Leda, Orus, Aoede, and 22 more`;
|
|
43
43
|
export const IMAGE_GEMINI_ASPECT_RATIOS = `1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 4:5, 5:4, 21:9`;
|
|
44
|
+
export const IMAGE_GEMINI_ASPECT_RATIO_IDS = [
|
|
45
|
+
'1:1',
|
|
46
|
+
'16:9',
|
|
47
|
+
'9:16',
|
|
48
|
+
'4:3',
|
|
49
|
+
'3:4',
|
|
50
|
+
'3:2',
|
|
51
|
+
'2:3',
|
|
52
|
+
'4:5',
|
|
53
|
+
'5:4',
|
|
54
|
+
'21:9',
|
|
55
|
+
];
|
|
44
56
|
export const IMAGE_GEMINI_SIZES = `512, 1K, 2K, 4K`;
|
|
57
|
+
export const IMAGE_GEMINI_SIZE_IDS = [
|
|
58
|
+
'512',
|
|
59
|
+
'1K',
|
|
60
|
+
'2K',
|
|
61
|
+
'4K',
|
|
62
|
+
];
|
|
45
63
|
export const IMAGE_MODELS_DOC = `openai: gpt-image-2. bfl: flux-2-pro, flux-2-flex, flux-2-max, flux-2-klein-9b, flux-2-klein-4b. gemini: gemini-3.1-flash-lite-image, gemini-2.5-flash-image, gemini-3.1-flash-image, gemini-3-pro-image`;
|
|
64
|
+
export const IMAGE_MODELS_TABLE = ` openai gpt-image-2
|
|
65
|
+
bfl flux-2-pro, flux-2-flex, flux-2-max, flux-2-klein-9b, flux-2-klein-4b
|
|
66
|
+
gemini gemini-3.1-flash-lite-image, gemini-2.5-flash-image, gemini-3.1-flash-image, gemini-3-pro-image`;
|
|
46
67
|
export const IMAGE_PROVIDERS_BULLET = `- **OpenAI**: \`gpt-image-2\`
|
|
47
68
|
- **BFL/Flux**: \`flux-2-pro, flux-2-flex, flux-2-max, flux-2-klein-9b, flux-2-klein-4b\`
|
|
48
69
|
- **Gemini/Nano Banana**: \`gemini-3.1-flash-lite-image, gemini-2.5-flash-image, gemini-3.1-flash-image, gemini-3-pro-image\``;
|
|
@@ -52,18 +73,61 @@ export const IMAGE_PROVIDER_DESCRIPTIONS = {
|
|
|
52
73
|
'bfl': `BFL/Flux (flux-2-pro, flux-2-flex, flux-2-max, flux-2-klein-9b, flux-2-klein-4b)`,
|
|
53
74
|
'gemini': `Gemini/Nano Banana (gemini-3.1-flash-lite-image, gemini-2.5-flash-image, gemini-3.1-flash-image, gemini-3-pro-image)`,
|
|
54
75
|
};
|
|
76
|
+
export const IMAGE_PROVIDER_IDS = [
|
|
77
|
+
'openai',
|
|
78
|
+
'bfl',
|
|
79
|
+
'gemini',
|
|
80
|
+
];
|
|
81
|
+
export const IMAGE_QUALITY_IDS = [
|
|
82
|
+
'low',
|
|
83
|
+
'medium',
|
|
84
|
+
'high',
|
|
85
|
+
'auto',
|
|
86
|
+
];
|
|
87
|
+
export const IMAGE_TIER_ALIASES_DOC = `fast (gemini/gemini-3.1-flash-lite-image), standard (openai/gpt-image-2), high (bfl/flux-2-pro), ultra (bfl/flux-2-max)`;
|
|
88
|
+
export const IMAGE_TIER_ALIAS_IDS = [
|
|
89
|
+
'fast',
|
|
90
|
+
'standard',
|
|
91
|
+
'high',
|
|
92
|
+
'ultra',
|
|
93
|
+
];
|
|
55
94
|
export const LLM_DEFAULT_MODELS_DOC = `OpenAI: gpt-5.4-nano (cheapest), gpt-5.4-mini (cheap reasoning). Anthropic: claude-haiku-4-5 (cheapest). Gemini: gemini-2.5-flash-lite (cheapest, 1M context)`;
|
|
56
95
|
export const LLM_PROVIDERS_LIST = `anthropic, openai, gemini`;
|
|
57
96
|
export const OPENAI_TTS_VOICES_DOC = `alloy, ash, ballad, coral, echo, fable, nova, onyx, sage, shimmer, verse`;
|
|
58
97
|
export const TRANSCRIBE_PROVIDERS_DOC = `elevenlabs (default, Scribe v2), openai (GPT-4o Transcribe), gemini (Gemini 2.5 Flash - cheapest, multilingual)`;
|
|
59
98
|
export const TTS_PROVIDERS_LIST = `elevenlabs, openai, gemini`;
|
|
60
99
|
export const TTS_PROVIDER_DESCRIPTIONS = {
|
|
61
|
-
'elevenlabs': `ElevenLabs (many voices
|
|
100
|
+
'elevenlabs': `ElevenLabs (many premium voices)`,
|
|
62
101
|
'openai': `OpenAI (alloy, ash, ballad, coral, echo, fable, nova, onyx, sage, shimmer, verse)`,
|
|
63
102
|
'gemini': `Gemini (30 voices: Kore, Puck, Zephyr, Charon, Fenrir, Leda, Orus, Aoede, and 22 more). Multi-speaker (up to 2) and 60+ languages`,
|
|
64
103
|
};
|
|
104
|
+
export const TTS_PROVIDER_IDS = [
|
|
105
|
+
'elevenlabs',
|
|
106
|
+
'openai',
|
|
107
|
+
'gemini',
|
|
108
|
+
];
|
|
65
109
|
export const VIDEO_ASPECT_RATIOS = `16:9 (landscape), 9:16 (portrait), 1:1 (square)`;
|
|
110
|
+
export const VIDEO_ASPECT_RATIO_IDS = [
|
|
111
|
+
'16:9',
|
|
112
|
+
'9:16',
|
|
113
|
+
'1:1',
|
|
114
|
+
];
|
|
66
115
|
export const VIDEO_MODELS_DOC = `veo-3.1-generate-preview (best quality, up to 4K, ~$0.40/sec), veo-3.1-fast-generate-preview (faster, ~$0.10/sec), veo-3.1-lite-generate-preview (budget, ~$0.05/sec), gemini-omni-flash-preview (3-10s @ 720p, conversational editing, ~$0.10/sec)`;
|
|
67
116
|
export const VIDEO_MODELS_LIST = `veo-3.1-generate-preview, veo-3.1-fast-generate-preview, veo-3.1-lite-generate-preview, gemini-omni-flash-preview`;
|
|
117
|
+
export const VIDEO_MODELS_TABLE = ` veo-3.1-generate-preview best quality, up to 4K, ~$0.40/sec
|
|
118
|
+
veo-3.1-fast-generate-preview faster, ~$0.10/sec
|
|
119
|
+
veo-3.1-lite-generate-preview budget, ~$0.05/sec
|
|
120
|
+
gemini-omni-flash-preview 3-10s @ 720p, conversational editing, ~$0.10/sec`;
|
|
121
|
+
export const VIDEO_MODEL_IDS = [
|
|
122
|
+
'veo-3.1-generate-preview',
|
|
123
|
+
'veo-3.1-fast-generate-preview',
|
|
124
|
+
'veo-3.1-lite-generate-preview',
|
|
125
|
+
'gemini-omni-flash-preview',
|
|
126
|
+
];
|
|
68
127
|
export const VIDEO_RESOLUTIONS = `720p, 1080p, 4k`;
|
|
128
|
+
export const VIDEO_RESOLUTION_IDS = [
|
|
129
|
+
'720p',
|
|
130
|
+
'1080p',
|
|
131
|
+
'4k',
|
|
132
|
+
];
|
|
69
133
|
//# sourceMappingURL=provider-docs.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gipity",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.11",
|
|
4
4
|
"description": "The full-stack platform tuned for AI agents. Database, storage, auth, functions, deploy, and drop-in kits - all agent-tuned. Pair with Claude Code or use standalone.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"gipity": "dist/updater/shim.js",
|