@melius-ai/cli 0.11.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/dist/bin/mel.js +1 -1
- package/dist/{chunk-CHRQZMYE.js → chunk-5APS3BGT.js} +261 -47
- package/dist/src/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -130,6 +130,7 @@ Edge type determines data flow: `text` passes text output, `image` passes image
|
|
|
130
130
|
| Command | Description |
|
|
131
131
|
| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
|
|
132
132
|
| `mel run start <nodeId> --canvas-id <canvasId>` | Start a generation. Returns `{ id }` |
|
|
133
|
+
| `mel run tool <nodeId> --canvas-id <canvasId> --tool remove-background` | Remove an image background in place. Returns `{ id }` |
|
|
133
134
|
| `mel run get <runId>` | Check run status: `pending`, `running`, `finished`, `failed` |
|
|
134
135
|
| `mel run wait <runId>` | **Block until done.** Exit 0 = finished, 1 = failed, 4 = timeout |
|
|
135
136
|
| `mel run latest <canvasId>` | Latest run status for every node on a canvas |
|
|
@@ -138,6 +139,8 @@ Edge type determines data flow: `text` passes text output, `image` passes image
|
|
|
138
139
|
|
|
139
140
|
**Magic resize:** `mel run magic-resize` creates a magic-resize node, wires the source image in, and runs it — all in one call. The source node must already have a finished image asset. `--ratios` is comma-separated (1–5): presets `21:9, 16:9, 4:3, 1:1, 3:4, 9:16, 9:21` render at 1K, or pass custom `WxH` pixel sizes (each side 64–4096, e.g. `1080x1350`). Pass the returned `nodeId` to `mel run wait` to block until the variants are ready.
|
|
140
141
|
|
|
142
|
+
**Node tools:** `mel run tool` post-processes a node's finished asset in place and creates a new active version. The currently supported tool is `remove-background` for image and image-backed file nodes. Pass the returned run ID to `mel run wait` before inspecting the result with `mel canvas content <canvasId> --node-id <nodeId> --include-all-versions`.
|
|
143
|
+
|
|
141
144
|
**Auto-model resolution:** when `--model`/`--variant` are omitted, `mel run start` automatically resolves the correct model from the platform defaults. `--canvas-id` is required so the CLI can verify the node is on the canvas and the backend can do edge-aware detection (picks `image-to-image` when the node has incoming image edges). Always source the node ID from the latest `mel canvas content` output or the current-turn `idMap` returned by `mel node bulk-create`.
|
|
142
145
|
|
|
143
146
|
```bash
|
|
@@ -149,6 +152,9 @@ mel run start <nodeId> --canvas-id <canvasId> --model flux-pro --variant text-to
|
|
|
149
152
|
|
|
150
153
|
# With overrides
|
|
151
154
|
mel run start <nodeId> --canvas-id <canvasId> --prompt "Override prompt" --variations 3
|
|
155
|
+
|
|
156
|
+
# Remove an image background in place
|
|
157
|
+
mel run tool <imageNodeId> --canvas-id <canvasId> --tool remove-background
|
|
152
158
|
```
|
|
153
159
|
|
|
154
160
|
### Bulk runs (entire canvas)
|
package/dist/bin/mel.js
CHANGED
|
@@ -1166,7 +1166,7 @@ var require_command = __commonJS({
|
|
|
1166
1166
|
var { Help: Help2, stripColor } = require_help();
|
|
1167
1167
|
var { Option: Option2, DualOptions } = require_option();
|
|
1168
1168
|
var { suggestSimilar } = require_suggestSimilar();
|
|
1169
|
-
var
|
|
1169
|
+
var Command3 = class _Command extends EventEmitter {
|
|
1170
1170
|
/**
|
|
1171
1171
|
* Initialize a new `Command`.
|
|
1172
1172
|
*
|
|
@@ -3307,7 +3307,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
3307
3307
|
return true;
|
|
3308
3308
|
return void 0;
|
|
3309
3309
|
}
|
|
3310
|
-
exports.Command =
|
|
3310
|
+
exports.Command = Command3;
|
|
3311
3311
|
exports.useColor = useColor;
|
|
3312
3312
|
}
|
|
3313
3313
|
});
|
|
@@ -3317,15 +3317,15 @@ var require_commander = __commonJS({
|
|
|
3317
3317
|
"../../node_modules/.pnpm/commander@13.1.0/node_modules/commander/index.js"(exports) {
|
|
3318
3318
|
"use strict";
|
|
3319
3319
|
var { Argument: Argument2 } = require_argument();
|
|
3320
|
-
var { Command:
|
|
3320
|
+
var { Command: Command3 } = require_command();
|
|
3321
3321
|
var { CommanderError: CommanderError3, InvalidArgumentError: InvalidArgumentError2 } = require_error();
|
|
3322
3322
|
var { Help: Help2 } = require_help();
|
|
3323
3323
|
var { Option: Option2 } = require_option();
|
|
3324
|
-
exports.program = new
|
|
3325
|
-
exports.createCommand = (name) => new
|
|
3324
|
+
exports.program = new Command3();
|
|
3325
|
+
exports.createCommand = (name) => new Command3(name);
|
|
3326
3326
|
exports.createOption = (flags, description) => new Option2(flags, description);
|
|
3327
3327
|
exports.createArgument = (name, description) => new Argument2(name, description);
|
|
3328
|
-
exports.Command =
|
|
3328
|
+
exports.Command = Command3;
|
|
3329
3329
|
exports.Option = Option2;
|
|
3330
3330
|
exports.Argument = Argument2;
|
|
3331
3331
|
exports.Help = Help2;
|
|
@@ -8224,6 +8224,18 @@ var CompleteFilesUploadBodySchema = external_exports.object({
|
|
|
8224
8224
|
var CompleteFilesUploadResponseSchema = external_exports.object({
|
|
8225
8225
|
file: FileCardSchema
|
|
8226
8226
|
});
|
|
8227
|
+
var ImportUploadcareFileBodySchema = external_exports.object({
|
|
8228
|
+
uuid: external_exports.string().uuid(),
|
|
8229
|
+
folderId: external_exports.string().uuid().nullable().optional()
|
|
8230
|
+
});
|
|
8231
|
+
var ImportUploadcareFileResponseSchema = external_exports.object({
|
|
8232
|
+
file: FileCardSchema
|
|
8233
|
+
});
|
|
8234
|
+
var UploadcareUploadSignatureResponseSchema = external_exports.object({
|
|
8235
|
+
signature: external_exports.string(),
|
|
8236
|
+
/** Unix seconds, as a string — the exact bytes that were signed. */
|
|
8237
|
+
expire: external_exports.string()
|
|
8238
|
+
});
|
|
8227
8239
|
var EmbeddingStorageUsageResponseSchema = external_exports.object({
|
|
8228
8240
|
usedBytes: external_exports.number(),
|
|
8229
8241
|
limitBytes: external_exports.number()
|
|
@@ -8609,6 +8621,28 @@ var filesContract = c2.router({
|
|
|
8609
8621
|
403: ErrorBodySchema
|
|
8610
8622
|
},
|
|
8611
8623
|
summary: "Complete a Files upload"
|
|
8624
|
+
},
|
|
8625
|
+
createUploadcareUploadSignature: {
|
|
8626
|
+
method: "POST",
|
|
8627
|
+
path: "/files/import/uploadcare/signature",
|
|
8628
|
+
body: external_exports.object({}),
|
|
8629
|
+
responses: {
|
|
8630
|
+
200: UploadcareUploadSignatureResponseSchema,
|
|
8631
|
+
403: ErrorBodySchema
|
|
8632
|
+
},
|
|
8633
|
+
summary: "Mint short-lived credentials for a signed Uploadcare upload"
|
|
8634
|
+
},
|
|
8635
|
+
importUploadcareFile: {
|
|
8636
|
+
method: "POST",
|
|
8637
|
+
path: "/files/import/uploadcare",
|
|
8638
|
+
body: ImportUploadcareFileBodySchema,
|
|
8639
|
+
responses: {
|
|
8640
|
+
200: ImportUploadcareFileResponseSchema,
|
|
8641
|
+
400: ErrorBodySchema,
|
|
8642
|
+
403: ErrorBodySchema,
|
|
8643
|
+
404: ErrorBodySchema
|
|
8644
|
+
},
|
|
8645
|
+
summary: "Import a file picked from a cloud source through Uploadcare"
|
|
8612
8646
|
}
|
|
8613
8647
|
});
|
|
8614
8648
|
|
|
@@ -9327,6 +9361,29 @@ var audioContract = c5.router({
|
|
|
9327
9361
|
}
|
|
9328
9362
|
});
|
|
9329
9363
|
|
|
9364
|
+
// ../api-contract/src/heygen.ts
|
|
9365
|
+
var HeygenAvatarSettingsSchema = external_exports.object({
|
|
9366
|
+
backgroundColor: external_exports.string().regex(/^#[0-9a-f]{6}$/i, "Background color must be a hex color").optional(),
|
|
9367
|
+
removeBackground: external_exports.boolean().optional(),
|
|
9368
|
+
fit: external_exports.enum(["cover", "contain"]).optional(),
|
|
9369
|
+
caption: external_exports.boolean().optional()
|
|
9370
|
+
});
|
|
9371
|
+
var HeygenAvatarVariantSchema = external_exports.object({
|
|
9372
|
+
avatar: external_exports.string().describe(
|
|
9373
|
+
"Raw avatar id. Pass this exact value as modelConfig.heygenAvatar"
|
|
9374
|
+
),
|
|
9375
|
+
description: external_exports.string().describe("Pose, setting, and framing, e.g. 'Standing office front'")
|
|
9376
|
+
});
|
|
9377
|
+
var HeygenAvatarPersonSchema = external_exports.object({
|
|
9378
|
+
name: external_exports.string().describe("The presenter's first name, e.g. 'Abigail'"),
|
|
9379
|
+
variants: external_exports.array(HeygenAvatarVariantSchema).describe("Every pose available for this presenter")
|
|
9380
|
+
});
|
|
9381
|
+
var HeygenAvatarCatalogSchema = external_exports.object({
|
|
9382
|
+
people: external_exports.array(HeygenAvatarPersonSchema),
|
|
9383
|
+
totalPeople: external_exports.number(),
|
|
9384
|
+
totalAvatars: external_exports.number()
|
|
9385
|
+
});
|
|
9386
|
+
|
|
9330
9387
|
// ../api-contract/src/auto-model-proxy.ts
|
|
9331
9388
|
var AUTO_MODEL_REGISTRY = [
|
|
9332
9389
|
// ── Video ───────────────────────────────────────────────────────────
|
|
@@ -9442,6 +9499,12 @@ var AUTO_MODEL_REGISTRY = [
|
|
|
9442
9499
|
model: "elevenlabs-sfx",
|
|
9443
9500
|
variant: "text-to-sfx"
|
|
9444
9501
|
},
|
|
9502
|
+
{
|
|
9503
|
+
nodeType: "audio",
|
|
9504
|
+
inputPattern: "video-to-sfx",
|
|
9505
|
+
model: "sonilo-video-sfx",
|
|
9506
|
+
variant: "video-to-sfx"
|
|
9507
|
+
},
|
|
9445
9508
|
{
|
|
9446
9509
|
nodeType: "audio",
|
|
9447
9510
|
inputPattern: "text-to-music",
|
|
@@ -9684,6 +9747,7 @@ var GENERATION_MODES = [
|
|
|
9684
9747
|
"text-to-speech",
|
|
9685
9748
|
"audio-to-audio",
|
|
9686
9749
|
"text-to-sfx",
|
|
9750
|
+
"video-to-sfx",
|
|
9687
9751
|
"text-to-music",
|
|
9688
9752
|
"speech-to-text",
|
|
9689
9753
|
"voice-isolator"
|
|
@@ -10473,6 +10537,8 @@ var ModelConfigSchema = external_exports.object({
|
|
|
10473
10537
|
tier: external_exports.string().nullable().optional(),
|
|
10474
10538
|
/** HeyGen Avatar V only: the Runware avatar id for this node. */
|
|
10475
10539
|
heygenAvatar: external_exports.string().optional(),
|
|
10540
|
+
/** HeyGen Avatar V presentation, speech, and output controls. */
|
|
10541
|
+
heygenSettings: HeygenAvatarSettingsSchema.optional(),
|
|
10476
10542
|
// Magic-resize stores its per-run config here so each version carries the
|
|
10477
10543
|
// ratios + resolution that produced it.
|
|
10478
10544
|
ratios: external_exports.array(external_exports.string()).optional(),
|
|
@@ -10499,6 +10565,8 @@ var ModelConfigInputSchema = external_exports.object({
|
|
|
10499
10565
|
tier: external_exports.string().nullable().optional(),
|
|
10500
10566
|
/** HeyGen Avatar V only: the Runware avatar id for this node. */
|
|
10501
10567
|
heygenAvatar: external_exports.string().trim().min(1).optional(),
|
|
10568
|
+
/** HeyGen Avatar V presentation, speech, and output controls. */
|
|
10569
|
+
heygenSettings: HeygenAvatarSettingsSchema.optional(),
|
|
10502
10570
|
/** better-font-32b only: the font the model renders the requested text in (supplied to the model as a rendered reference image). */
|
|
10503
10571
|
font: external_exports.object({
|
|
10504
10572
|
source: external_exports.enum(["custom", "google"]),
|
|
@@ -10690,6 +10758,8 @@ var NodeResponseSchema = external_exports.object({
|
|
|
10690
10758
|
outputResolution: OutputResolutionSchema.nullable().optional(),
|
|
10691
10759
|
/** Current seed on the node (from CRDT). */
|
|
10692
10760
|
seed: external_exports.number().int().nonnegative().max(MAX_SEED).nullable().optional(),
|
|
10761
|
+
/** Current variation count on the node (from CRDT). */
|
|
10762
|
+
numVariations: external_exports.number().int().min(1).max(MAX_VARIATIONS).nullable().optional(),
|
|
10693
10763
|
/** Current audio toggle on the node (from CRDT). */
|
|
10694
10764
|
generateAudio: external_exports.boolean().nullable().optional(),
|
|
10695
10765
|
/** Selected video model supports start/end image inputs (from CRDT). */
|
|
@@ -10937,6 +11007,14 @@ var RunImageToolBodySchema = external_exports.object({
|
|
|
10937
11007
|
/** Base64-encoded PNG mask image for inpainting (white = areas to regenerate). */
|
|
10938
11008
|
maskImageBase64: external_exports.string().optional()
|
|
10939
11009
|
});
|
|
11010
|
+
var REMOVE_BACKGROUND_NODE_TOOL_NAME = "remove-background";
|
|
11011
|
+
var PUBLIC_NODE_TOOL_NAMES = [
|
|
11012
|
+
REMOVE_BACKGROUND_NODE_TOOL_NAME
|
|
11013
|
+
];
|
|
11014
|
+
var RunNodeToolBodySchema = external_exports.object({
|
|
11015
|
+
canvasId: external_exports.string().uuid(),
|
|
11016
|
+
toolName: external_exports.enum(PUBLIC_NODE_TOOL_NAMES)
|
|
11017
|
+
});
|
|
10940
11018
|
var RunSplitLayersBodySchema = external_exports.object({
|
|
10941
11019
|
canvasId: external_exports.string().uuid().optional(),
|
|
10942
11020
|
numLayers: external_exports.number().int().min(2).max(5).nullable()
|
|
@@ -11144,6 +11222,7 @@ var CreateDirectNodeBodyObjectSchema = external_exports.object({
|
|
|
11144
11222
|
outputResolution: OutputResolutionSchema.nullable().optional(),
|
|
11145
11223
|
matchAudioToVideoDuration: external_exports.boolean().nullable().optional(),
|
|
11146
11224
|
seed: external_exports.number().int().nonnegative().max(MAX_SEED).nullable().optional(),
|
|
11225
|
+
numVariations: external_exports.number().int().min(1).max(MAX_VARIATIONS).nullable().optional(),
|
|
11147
11226
|
negativePrompt: external_exports.string().nullable().optional(),
|
|
11148
11227
|
stitchClipOrder: StitchClipOrderSchema.nullable().optional(),
|
|
11149
11228
|
stitchScaleFit: StitchScaleFitSchema.nullable().optional(),
|
|
@@ -11193,6 +11272,7 @@ var UpdateDirectNodeBodySchema = external_exports.object({
|
|
|
11193
11272
|
outputResolution: OutputResolutionSchema.nullable().optional(),
|
|
11194
11273
|
matchAudioToVideoDuration: external_exports.boolean().nullable().optional(),
|
|
11195
11274
|
seed: external_exports.number().int().nonnegative().max(MAX_SEED).nullable().optional(),
|
|
11275
|
+
numVariations: external_exports.number().int().min(1).max(MAX_VARIATIONS).nullable().optional(),
|
|
11196
11276
|
negativePrompt: external_exports.string().nullable().optional(),
|
|
11197
11277
|
stitchClipOrder: StitchClipOrderSchema.nullable().optional(),
|
|
11198
11278
|
stitchScaleFit: StitchScaleFitSchema.nullable().optional(),
|
|
@@ -11227,6 +11307,7 @@ var DirectNodeResponseSchema = external_exports.object({
|
|
|
11227
11307
|
outputResolution: OutputResolutionSchema.nullable(),
|
|
11228
11308
|
matchAudioToVideoDuration: external_exports.boolean().nullable().optional(),
|
|
11229
11309
|
seed: external_exports.number().int().nonnegative().max(MAX_SEED).nullable(),
|
|
11310
|
+
numVariations: external_exports.number().int().min(1).max(MAX_VARIATIONS).nullable(),
|
|
11230
11311
|
negativePrompt: external_exports.string().nullable(),
|
|
11231
11312
|
stitchClipOrder: StitchClipOrderSchema.nullable().optional(),
|
|
11232
11313
|
stitchScaleFit: StitchScaleFitSchema.nullable().optional(),
|
|
@@ -11280,6 +11361,7 @@ var BulkUpdateDirectNodesItemSchema = external_exports.object({
|
|
|
11280
11361
|
outputResolution: OutputResolutionSchema.nullable().optional(),
|
|
11281
11362
|
matchAudioToVideoDuration: external_exports.boolean().nullable().optional(),
|
|
11282
11363
|
seed: external_exports.number().int().nonnegative().max(MAX_SEED).nullable().optional(),
|
|
11364
|
+
numVariations: external_exports.number().int().min(1).max(MAX_VARIATIONS).nullable().optional(),
|
|
11283
11365
|
negativePrompt: external_exports.string().nullable().optional(),
|
|
11284
11366
|
stitchClipOrder: StitchClipOrderSchema.nullable().optional(),
|
|
11285
11367
|
stitchScaleFit: StitchScaleFitSchema.nullable().optional(),
|
|
@@ -11368,6 +11450,16 @@ var PlaygroundCanvasReferenceSchema = external_exports.object({
|
|
|
11368
11450
|
projectId: external_exports.string().uuid(),
|
|
11369
11451
|
canvasId: external_exports.string().uuid()
|
|
11370
11452
|
});
|
|
11453
|
+
var PlaygroundCanvasDestinationSchema = external_exports.discriminatedUnion("kind", [
|
|
11454
|
+
external_exports.object({
|
|
11455
|
+
kind: external_exports.literal("existing"),
|
|
11456
|
+
projectId: external_exports.string().uuid()
|
|
11457
|
+
}),
|
|
11458
|
+
external_exports.object({
|
|
11459
|
+
kind: external_exports.literal("new"),
|
|
11460
|
+
projectName: external_exports.string().trim().min(1).max(500)
|
|
11461
|
+
})
|
|
11462
|
+
]);
|
|
11371
11463
|
var PlaygroundCanvasPageSchema = external_exports.object({
|
|
11372
11464
|
projectId: external_exports.string().uuid().nullable(),
|
|
11373
11465
|
data: external_exports.array(external_exports.object({ id: external_exports.string().uuid() })),
|
|
@@ -11377,9 +11469,12 @@ var canvasContract = c7.router({
|
|
|
11377
11469
|
createPlaygroundCanvas: {
|
|
11378
11470
|
method: "POST",
|
|
11379
11471
|
path: "/playground/canvases",
|
|
11380
|
-
body:
|
|
11472
|
+
body: external_exports.object({
|
|
11473
|
+
destination: PlaygroundCanvasDestinationSchema.optional()
|
|
11474
|
+
}).optional(),
|
|
11381
11475
|
responses: {
|
|
11382
11476
|
201: PlaygroundCanvasReferenceSchema,
|
|
11477
|
+
404: MessageResponseSchema,
|
|
11383
11478
|
409: MessageResponseSchema
|
|
11384
11479
|
}
|
|
11385
11480
|
},
|
|
@@ -11805,6 +11900,18 @@ var canvasContract = c7.router({
|
|
|
11805
11900
|
404: NodeRunErrorResponseSchema
|
|
11806
11901
|
}
|
|
11807
11902
|
},
|
|
11903
|
+
runNodeTool: {
|
|
11904
|
+
method: "POST",
|
|
11905
|
+
path: "/nodes/:nodeId/tool-runs",
|
|
11906
|
+
pathParams: external_exports.object({ nodeId: external_exports.string().uuid() }),
|
|
11907
|
+
body: RunNodeToolBodySchema,
|
|
11908
|
+
responses: {
|
|
11909
|
+
201: CreateNodeRunResponseSchema,
|
|
11910
|
+
202: external_exports.object({ approvalId: external_exports.string().uuid() }),
|
|
11911
|
+
400: NodeRunErrorResponseSchema,
|
|
11912
|
+
404: NodeRunErrorResponseSchema
|
|
11913
|
+
}
|
|
11914
|
+
},
|
|
11808
11915
|
runImageTool: {
|
|
11809
11916
|
method: "POST",
|
|
11810
11917
|
path: "/nodes/:nodeId/image-tool-runs",
|
|
@@ -12507,6 +12614,8 @@ var GenerationRunBodySchema = external_exports.object({
|
|
|
12507
12614
|
prompt: external_exports.string().trim().min(1).optional(),
|
|
12508
12615
|
/** Selected avatar id from Runware's HeyGen Avatar V catalog. */
|
|
12509
12616
|
heygenAvatar: external_exports.string().trim().min(1).optional(),
|
|
12617
|
+
/** HeyGen Avatar V presentation controls. */
|
|
12618
|
+
heygenSettings: HeygenAvatarSettingsSchema.optional(),
|
|
12510
12619
|
imageUrls: external_exports.array(external_exports.string().url()).optional(),
|
|
12511
12620
|
endImageUrls: external_exports.array(external_exports.string().url()).optional(),
|
|
12512
12621
|
referenceImageUrls: external_exports.array(external_exports.string().url()).optional(),
|
|
@@ -12627,6 +12736,9 @@ var AutoModelDefaultsCategorySchema = external_exports.object({
|
|
|
12627
12736
|
textToSpeech: AutoModelDefaultEntrySchema,
|
|
12628
12737
|
audioToAudio: AutoModelDefaultEntrySchema,
|
|
12629
12738
|
textToSfx: AutoModelDefaultEntrySchema,
|
|
12739
|
+
// Optional so deployed clients validating a response from an
|
|
12740
|
+
// older backend (which omits it) keep working.
|
|
12741
|
+
videoToSfx: AutoModelDefaultEntrySchema.optional(),
|
|
12630
12742
|
textToMusic: AutoModelDefaultEntrySchema,
|
|
12631
12743
|
speechToText: AutoModelDefaultEntrySchema
|
|
12632
12744
|
}).optional()
|
|
@@ -12797,6 +12909,9 @@ var GenerationHistoryItemSchema = external_exports.object({
|
|
|
12797
12909
|
tier: external_exports.string().nullable().optional(),
|
|
12798
12910
|
status: GenerationJobStatusSchema,
|
|
12799
12911
|
creditCost: external_exports.number().nullable(),
|
|
12912
|
+
// Whether the debit was reversed — `creditCost` was charged and given back,
|
|
12913
|
+
// so it did not count towards usage. Optional so older clients ignore it.
|
|
12914
|
+
refunded: external_exports.boolean().optional(),
|
|
12800
12915
|
createdAt: external_exports.string(),
|
|
12801
12916
|
user: external_exports.object({
|
|
12802
12917
|
id: external_exports.string(),
|
|
@@ -12807,7 +12922,15 @@ var GenerationHistoryItemSchema = external_exports.object({
|
|
|
12807
12922
|
id: external_exports.string(),
|
|
12808
12923
|
title: external_exports.string(),
|
|
12809
12924
|
archived: external_exports.boolean()
|
|
12810
|
-
}).nullable()
|
|
12925
|
+
}).nullable(),
|
|
12926
|
+
// Set when the generation was produced by running a template: the bulk run
|
|
12927
|
+
// it belonged to plus the template's name. Lets a run's per-model rows be
|
|
12928
|
+
// consolidated into one row (see `consolidateTemplateRuns`). Optional so
|
|
12929
|
+
// older clients ignore it and it is absent for non-template generations.
|
|
12930
|
+
templateRun: external_exports.object({
|
|
12931
|
+
runId: external_exports.string(),
|
|
12932
|
+
title: external_exports.string()
|
|
12933
|
+
}).nullable().optional()
|
|
12811
12934
|
});
|
|
12812
12935
|
var ListGenerationHistoryResponseSchema = external_exports.object({
|
|
12813
12936
|
items: external_exports.array(GenerationHistoryItemSchema),
|
|
@@ -13575,6 +13698,13 @@ var TeamAdvancedSettingsSchema = external_exports.object({
|
|
|
13575
13698
|
// enterprise team's owner domain. Admin-governed via the dedicated
|
|
13576
13699
|
// domain-join-settings endpoint, not the editor-facing advanced-settings write.
|
|
13577
13700
|
domainJoinAutoApprove: external_exports.boolean().optional()
|
|
13701
|
+
// NOTE: the team's approval policy config also lives in this jsonb column,
|
|
13702
|
+
// but is deliberately NOT declared here — see `InternalTeamAdvancedSettings`
|
|
13703
|
+
// in `apps/core/nagi/team/team.mappers.ts`, the same treatment
|
|
13704
|
+
// `modelDiscounts` gets. Declaring it would publish the team's approver
|
|
13705
|
+
// list into the public OpenAPI surface, and would make it writable through
|
|
13706
|
+
// the editor-facing advanced-settings endpoint. It is read and written
|
|
13707
|
+
// only through the admin-gated approvals endpoints.
|
|
13578
13708
|
});
|
|
13579
13709
|
var DomainJoinTargetSchema = external_exports.object({
|
|
13580
13710
|
teamId: external_exports.string().uuid(),
|
|
@@ -13832,10 +13962,17 @@ var ProjectResponseSchema = external_exports.object({
|
|
|
13832
13962
|
updatedAt: external_exports.string().datetime(),
|
|
13833
13963
|
lastEditAt: external_exports.string().datetime()
|
|
13834
13964
|
});
|
|
13965
|
+
var ProjectOptionSchema = ProjectResponseSchema.pick({
|
|
13966
|
+
id: true,
|
|
13967
|
+
title: true
|
|
13968
|
+
});
|
|
13835
13969
|
var ProjectIdParamsSchema = external_exports.object({ projectId: external_exports.string().uuid() });
|
|
13836
13970
|
var PaginationQuerySchema = external_exports.object(
|
|
13837
13971
|
paginationQuery({ maxLimit: 100, defaultLimit: 50 })
|
|
13838
13972
|
);
|
|
13973
|
+
var ProjectOptionsQuerySchema = PaginationQuerySchema.extend({
|
|
13974
|
+
search: external_exports.string().max(500).optional()
|
|
13975
|
+
});
|
|
13839
13976
|
var IncludePreviewAssetsQuerySchema = external_exports.preprocess((value) => {
|
|
13840
13977
|
if (value === void 0) return void 0;
|
|
13841
13978
|
if (value === "true" || value === true) return true;
|
|
@@ -13859,6 +13996,10 @@ var PaginatedProjectsResponseSchema = external_exports.object({
|
|
|
13859
13996
|
data: external_exports.array(ProjectResponseSchema),
|
|
13860
13997
|
total: external_exports.number().int()
|
|
13861
13998
|
});
|
|
13999
|
+
var PaginatedProjectOptionsResponseSchema = external_exports.object({
|
|
14000
|
+
data: external_exports.array(ProjectOptionSchema),
|
|
14001
|
+
total: external_exports.number().int()
|
|
14002
|
+
});
|
|
13862
14003
|
var ProjectListResponseSchema = external_exports.object({
|
|
13863
14004
|
data: external_exports.array(ProjectResponseSchema)
|
|
13864
14005
|
});
|
|
@@ -13872,8 +14013,15 @@ var ProjectThumbnailResponseSchema = external_exports.object({
|
|
|
13872
14013
|
var ProjectThumbnailsResponseSchema = external_exports.object({
|
|
13873
14014
|
data: external_exports.array(ProjectThumbnailResponseSchema)
|
|
13874
14015
|
});
|
|
14016
|
+
var MAX_PROJECT_TITLE_LENGTH = 500;
|
|
14017
|
+
var PROJECT_CONFLICT_CODE = {
|
|
14018
|
+
nameTaken: "PROJECT_NAME_TAKEN"
|
|
14019
|
+
};
|
|
14020
|
+
var ProjectConflictResponseSchema = MessageResponseSchema.extend({
|
|
14021
|
+
code: external_exports.nativeEnum(PROJECT_CONFLICT_CODE).optional()
|
|
14022
|
+
});
|
|
13875
14023
|
var CreateProjectBodySchema = external_exports.object({
|
|
13876
|
-
title: external_exports.string().min(1).max(
|
|
14024
|
+
title: external_exports.string().min(1).max(MAX_PROJECT_TITLE_LENGTH).optional(),
|
|
13877
14025
|
description: external_exports.string().max(5e3).optional(),
|
|
13878
14026
|
isPublic: external_exports.boolean().optional(),
|
|
13879
14027
|
// Folder to create the project in. Omit (or `null`) to create at the team
|
|
@@ -13881,7 +14029,7 @@ var CreateProjectBodySchema = external_exports.object({
|
|
|
13881
14029
|
folderId: external_exports.string().uuid().nullable().optional()
|
|
13882
14030
|
});
|
|
13883
14031
|
var UpdateProjectBodySchema = external_exports.object({
|
|
13884
|
-
title: external_exports.string().min(1).max(
|
|
14032
|
+
title: external_exports.string().min(1).max(MAX_PROJECT_TITLE_LENGTH).optional(),
|
|
13885
14033
|
description: external_exports.string().max(5e3).nullable().optional(),
|
|
13886
14034
|
isPublic: external_exports.boolean().optional()
|
|
13887
14035
|
});
|
|
@@ -13912,7 +14060,7 @@ var projectContract = c14.router({
|
|
|
13912
14060
|
body: CreateProjectBodySchema,
|
|
13913
14061
|
responses: {
|
|
13914
14062
|
201: ProjectResponseSchema,
|
|
13915
|
-
409:
|
|
14063
|
+
409: ProjectConflictResponseSchema
|
|
13916
14064
|
}
|
|
13917
14065
|
},
|
|
13918
14066
|
listDeletedProjects: {
|
|
@@ -13921,6 +14069,12 @@ var projectContract = c14.router({
|
|
|
13921
14069
|
query: PaginationQuerySchema,
|
|
13922
14070
|
responses: { 200: PaginatedProjectsResponseSchema }
|
|
13923
14071
|
},
|
|
14072
|
+
listProjectOptions: {
|
|
14073
|
+
method: "GET",
|
|
14074
|
+
path: "/projects/options",
|
|
14075
|
+
query: ProjectOptionsQuerySchema,
|
|
14076
|
+
responses: { 200: PaginatedProjectOptionsResponseSchema }
|
|
14077
|
+
},
|
|
13924
14078
|
getProject: {
|
|
13925
14079
|
method: "GET",
|
|
13926
14080
|
path: "/projects/:projectId",
|
|
@@ -13934,7 +14088,7 @@ var projectContract = c14.router({
|
|
|
13934
14088
|
body: UpdateProjectBodySchema,
|
|
13935
14089
|
responses: {
|
|
13936
14090
|
200: ProjectResponseSchema,
|
|
13937
|
-
409:
|
|
14091
|
+
409: ProjectConflictResponseSchema
|
|
13938
14092
|
}
|
|
13939
14093
|
},
|
|
13940
14094
|
deleteProject: {
|
|
@@ -14277,6 +14431,7 @@ var publicContract = c16.router(
|
|
|
14277
14431
|
},
|
|
14278
14432
|
run: {
|
|
14279
14433
|
start: canvasContract.runNode,
|
|
14434
|
+
tool: canvasContract.runNodeTool,
|
|
14280
14435
|
get: canvasContract.getNodeRun,
|
|
14281
14436
|
cancel: canvasContract.cancelNodeRun,
|
|
14282
14437
|
latest: canvasContract.getLatestNodeRuns,
|
|
@@ -14579,7 +14734,7 @@ function isMajorUpgrade(current, latest) {
|
|
|
14579
14734
|
return l[0] > c17[0];
|
|
14580
14735
|
}
|
|
14581
14736
|
function shouldShowUpgradeNotice(ctx = {}) {
|
|
14582
|
-
const current = ctx.current ?? "0.
|
|
14737
|
+
const current = ctx.current ?? "0.13.0";
|
|
14583
14738
|
const latest = ctx.latest ?? serverLatestVersion;
|
|
14584
14739
|
const env = ctx.env ?? process.env;
|
|
14585
14740
|
const isTty = ctx.isTty ?? Boolean(process.stderr.isTTY);
|
|
@@ -14600,7 +14755,7 @@ Upgrade: npm install -g @melius-ai/cli@latest (or: brew update && brew upgrade
|
|
|
14600
14755
|
function printUpgradeNoticeIfNeeded(ctx = {}) {
|
|
14601
14756
|
try {
|
|
14602
14757
|
if (!shouldShowUpgradeNotice(ctx)) return;
|
|
14603
|
-
const current = ctx.current ?? "0.
|
|
14758
|
+
const current = ctx.current ?? "0.13.0";
|
|
14604
14759
|
const latest = ctx.latest ?? serverLatestVersion;
|
|
14605
14760
|
process.stderr.write(formatUpgradeNotice(current, latest));
|
|
14606
14761
|
} catch {
|
|
@@ -16799,7 +16954,7 @@ previewSrc, mediaType, generatedText, activeVersionId, voiceId, createdByUserId.
|
|
|
16799
16954
|
ID is auto-generated if --id is omitted. Geometry defaults per type (text: 380x200, image: 520x293, audio: 380x280).
|
|
16800
16955
|
Valid aspect ratios: 21:9, 16:9, 4:3, 3:2, 1:1, 2:3, 3:4, 9:16, 9:21.
|
|
16801
16956
|
Resolutions vary per model (e.g. 720p, 1080p, 4k for video; 1K, 2K, 4K for images). Use mel model list to check supportedResolutions.
|
|
16802
|
-
Audio modes (set via --variant): text-to-speech (TTS, requires --voice-id), text-to-sfx (5/6/8/10/12/15/20/22 second SFX), text-to-music (10/30/60/90/120/180/240/300 second music), speech-to-text (requires an audio input edge), audio-to-audio (requires an audio input edge and --voice-id). Use mel audio voice list to discover voice ids.
|
|
16957
|
+
Audio modes (set via --variant): text-to-speech (TTS, requires --voice-id), text-to-sfx (5/6/8/10/12/15/20/22 second SFX), video-to-sfx (requires a video input edge; length follows the clip), text-to-music (10/30/60/90/120/180/240/300 second music), speech-to-text (requires an audio input edge), audio-to-audio (requires an audio input edge and --voice-id). Use mel audio voice list to discover voice ids.
|
|
16803
16958
|
For stitch nodes, use --clip-order with connected source node IDs (video or image) in playback order and --scale-fit to control frame adaptation. Images render as 2-second still frames.
|
|
16804
16959
|
|
|
16805
16960
|
Examples:
|
|
@@ -17010,7 +17165,7 @@ Valid node types: text, image, video, audio, file, group, custom_text, stitch.
|
|
|
17010
17165
|
Stitch nodes also accept clipOrder (source node IDs \u2014 video or image \u2014 in playback order; images render as 2-second stills) and scaleFit (fit or stretch).
|
|
17011
17166
|
Valid aspect ratios: 21:9, 16:9, 4:3, 3:2, 1:1, 2:3, 3:4, 9:16, 9:21.
|
|
17012
17167
|
Valid edge types: text, image, video, audio, file.
|
|
17013
|
-
Audio modes (set via variant): text-to-speech (TTS, requires voiceId), text-to-sfx (5/6/8/10/12/15/20/22 second SFX), text-to-music (10/30/60/90/120/180/240/300 second music), speech-to-text (requires an audio input edge), audio-to-audio (requires an audio input edge and voiceId).
|
|
17168
|
+
Audio modes (set via variant): text-to-speech (TTS, requires voiceId), text-to-sfx (5/6/8/10/12/15/20/22 second SFX), video-to-sfx (requires a video input edge; length follows the clip), text-to-music (10/30/60/90/120/180/240/300 second music), speech-to-text (requires an audio input edge), audio-to-audio (requires an audio input edge and voiceId).
|
|
17014
17169
|
|
|
17015
17170
|
Use mel canvas plan-layout first to compute positions, then pass x/y/w/h into each node.
|
|
17016
17171
|
Accepts two JSON formats via stdin (or --json):
|
|
@@ -17909,6 +18064,38 @@ function assertNodeIdsExistOnCanvas(nodeIds, canvasId, canvasNodeIds) {
|
|
|
17909
18064
|
}
|
|
17910
18065
|
|
|
17911
18066
|
// src/commands/run.ts
|
|
18067
|
+
async function handleRunApproval(result, client, outputOpts, details) {
|
|
18068
|
+
if (result.status !== 202) return false;
|
|
18069
|
+
const body = result.body;
|
|
18070
|
+
const signal = JSON.stringify({
|
|
18071
|
+
type: "approval_required",
|
|
18072
|
+
approvalId: body.approvalId,
|
|
18073
|
+
tool: details.tool,
|
|
18074
|
+
summary: details.summary
|
|
18075
|
+
});
|
|
18076
|
+
process.stdout.write(signal + "\n");
|
|
18077
|
+
process.stderr.write(signal + "\n");
|
|
18078
|
+
const approval = await pollApproval(
|
|
18079
|
+
client,
|
|
18080
|
+
body.approvalId,
|
|
18081
|
+
18e5,
|
|
18082
|
+
2e3
|
|
18083
|
+
);
|
|
18084
|
+
if (approval.status === "denied") {
|
|
18085
|
+
writeError(
|
|
18086
|
+
formatError(
|
|
18087
|
+
"DENIED",
|
|
18088
|
+
"The user denied this generation. Do NOT retry or re-run this command. Ask the user what they would like to do instead.",
|
|
18089
|
+
{
|
|
18090
|
+
suggestion: "Ask the user what they would like to do next"
|
|
18091
|
+
}
|
|
18092
|
+
),
|
|
18093
|
+
EXIT_API_ERROR
|
|
18094
|
+
);
|
|
18095
|
+
}
|
|
18096
|
+
writeJson(approval.result, outputOpts);
|
|
18097
|
+
return true;
|
|
18098
|
+
}
|
|
17912
18099
|
function registerRunCommands(program2, getOutputOpts) {
|
|
17913
18100
|
const run = program2.command("run").description("Start AI generations and poll for results");
|
|
17914
18101
|
run.command("start").description("Start an AI generation run on a node").argument(
|
|
@@ -18007,35 +18194,10 @@ Examples:
|
|
|
18007
18194
|
}
|
|
18008
18195
|
}
|
|
18009
18196
|
});
|
|
18010
|
-
if (result
|
|
18011
|
-
|
|
18012
|
-
|
|
18013
|
-
|
|
18014
|
-
approvalId: body.approvalId,
|
|
18015
|
-
tool: "run_start",
|
|
18016
|
-
summary: `mel run start ${nodeId} --canvas-id ${opts.canvasId}`
|
|
18017
|
-
});
|
|
18018
|
-
process.stdout.write(signal + "\n");
|
|
18019
|
-
process.stderr.write(signal + "\n");
|
|
18020
|
-
const approval = await pollApproval(
|
|
18021
|
-
client,
|
|
18022
|
-
body.approvalId,
|
|
18023
|
-
18e5,
|
|
18024
|
-
2e3
|
|
18025
|
-
);
|
|
18026
|
-
if (approval.status === "denied") {
|
|
18027
|
-
writeError(
|
|
18028
|
-
formatError(
|
|
18029
|
-
"DENIED",
|
|
18030
|
-
"The user denied this generation. Do NOT retry or re-run this command. Ask the user what they would like to do instead.",
|
|
18031
|
-
{
|
|
18032
|
-
suggestion: "Ask the user what they would like to do next"
|
|
18033
|
-
}
|
|
18034
|
-
),
|
|
18035
|
-
EXIT_API_ERROR
|
|
18036
|
-
);
|
|
18037
|
-
}
|
|
18038
|
-
writeJson(approval.result, getOutputOpts());
|
|
18197
|
+
if (await handleRunApproval(result, client, getOutputOpts(), {
|
|
18198
|
+
tool: "run_start",
|
|
18199
|
+
summary: `mel run start ${nodeId} --canvas-id ${opts.canvasId}`
|
|
18200
|
+
})) {
|
|
18039
18201
|
return;
|
|
18040
18202
|
}
|
|
18041
18203
|
if (result.status !== 201) {
|
|
@@ -18051,6 +18213,58 @@ Examples:
|
|
|
18051
18213
|
writeJson(result.body, getOutputOpts());
|
|
18052
18214
|
}
|
|
18053
18215
|
);
|
|
18216
|
+
run.command("tool").description(
|
|
18217
|
+
"Run a node tool on an existing node in place and return its run ID"
|
|
18218
|
+
).argument(
|
|
18219
|
+
"<nodeId>",
|
|
18220
|
+
"Node ID with a finished asset (from mel canvas content)"
|
|
18221
|
+
).requiredOption(
|
|
18222
|
+
"--canvas-id <id>",
|
|
18223
|
+
"Canvas ID (from mel canvas create or mel canvas list output)"
|
|
18224
|
+
).addOption(
|
|
18225
|
+
new Option(
|
|
18226
|
+
"--tool <name>",
|
|
18227
|
+
`Node tool name. Valid values: ${PUBLIC_NODE_TOOL_NAMES.join(", ")}`
|
|
18228
|
+
).choices([...PUBLIC_NODE_TOOL_NAMES]).makeOptionMandatory()
|
|
18229
|
+
).addHelpText(
|
|
18230
|
+
"after",
|
|
18231
|
+
`
|
|
18232
|
+
Returns: { id } \u2014 the run ID. Use mel run wait <id> to block until completion.
|
|
18233
|
+
Valid tools: ${PUBLIC_NODE_TOOL_NAMES.join(", ")}.
|
|
18234
|
+
Node tools post-process the node's finished asset in place and create a new active version.
|
|
18235
|
+
After completion, use mel canvas content <canvasId> --node-id <nodeId> --include-all-versions to inspect the result.
|
|
18236
|
+
|
|
18237
|
+
Examples:
|
|
18238
|
+
$ mel run tool <imageNodeId> --canvas-id <canvasId> --tool remove-background
|
|
18239
|
+
$ RUN=$(mel run tool <imageNodeId> --canvas-id <canvasId> --tool remove-background); mel run wait $(echo $RUN | jq -r .id)`
|
|
18240
|
+
).action(
|
|
18241
|
+
async (nodeId, opts) => {
|
|
18242
|
+
const client = getClient();
|
|
18243
|
+
const canvasNodeIds = await loadCanvasNodeIds(
|
|
18244
|
+
client,
|
|
18245
|
+
opts.canvasId
|
|
18246
|
+
);
|
|
18247
|
+
assertNodeExistsOnCanvas(nodeId, opts.canvasId, canvasNodeIds);
|
|
18248
|
+
const result = await client.run.tool({
|
|
18249
|
+
params: { nodeId },
|
|
18250
|
+
body: {
|
|
18251
|
+
canvasId: opts.canvasId,
|
|
18252
|
+
toolName: opts.tool
|
|
18253
|
+
}
|
|
18254
|
+
});
|
|
18255
|
+
if (await handleRunApproval(result, client, getOutputOpts(), {
|
|
18256
|
+
tool: "run_node_tool",
|
|
18257
|
+
summary: `mel run tool ${nodeId} --canvas-id ${opts.canvasId} --tool ${opts.tool}`
|
|
18258
|
+
})) {
|
|
18259
|
+
return;
|
|
18260
|
+
}
|
|
18261
|
+
if (result.status !== 201) {
|
|
18262
|
+
const suggestion = result.status === 404 ? `Run: mel canvas content ${opts.canvasId} to refresh node IDs, then retry with a current node ID` : `Make sure the node has a finished image asset. Use mel canvas content ${opts.canvasId} --node-id ${nodeId} --include-all-versions to inspect it.`;
|
|
18263
|
+
handleApiError(result.status, result.body, suggestion);
|
|
18264
|
+
}
|
|
18265
|
+
writeJson(result.body, getOutputOpts());
|
|
18266
|
+
}
|
|
18267
|
+
);
|
|
18054
18268
|
run.command("magic-resize").description(
|
|
18055
18269
|
"Resize an image into multiple aspect ratios in one call. Creates a magic-resize node, wires the source image in, and runs it (writes to CRDT + starts a run)"
|
|
18056
18270
|
).argument(
|
|
@@ -18450,7 +18664,7 @@ function registerModelCommands(program2, getOutputOpts) {
|
|
|
18450
18664
|
Returns: Array of models, each with name, displayName, provider, variants[], and supportedInputs[].
|
|
18451
18665
|
Each variant has: mode, supportedAspectRatios[], supportedDurations[], supportedResolutions[], requiredInputs[].
|
|
18452
18666
|
For text models, supportedInputs lists accepted media types (e.g. ["image", "video"]) \u2014 use these to determine valid edge handles.
|
|
18453
|
-
For audio, variants are text-to-speech, text-to-sfx, text-to-music, speech-to-text, and audio-to-audio \u2014 supportedDurations applies to sfx and music only. For text-to-speech and audio-to-audio, also call mel audio voice list to discover voice ids.
|
|
18667
|
+
For audio, variants are text-to-speech, text-to-sfx, video-to-sfx, text-to-music, speech-to-text, and audio-to-audio \u2014 supportedDurations applies to sfx and music only. For text-to-speech and audio-to-audio, also call mel audio voice list to discover voice ids.
|
|
18454
18668
|
Use this to discover valid --model and --variant values for mel run start and mel node create.
|
|
18455
18669
|
|
|
18456
18670
|
Examples:
|
|
@@ -19737,7 +19951,7 @@ function withDefaultHelp(args) {
|
|
|
19737
19951
|
}
|
|
19738
19952
|
function createProgram() {
|
|
19739
19953
|
const program2 = new Command();
|
|
19740
|
-
program2.name("mel").description("Mel \u2014 Melius agent CLI").version("0.
|
|
19954
|
+
program2.name("mel").description("Mel \u2014 Melius agent CLI").version("0.13.0").showSuggestionAfterError(true).option("--json", "Force JSON output (default)").option("--text", "Human-readable output").option(
|
|
19741
19955
|
"--fields <fields>",
|
|
19742
19956
|
"Select specific output fields (comma-separated)"
|
|
19743
19957
|
).option("--quiet", "Suppress output, exit code only").option("--verbose", "Log request/response metadata to stderr").addHelpText(
|
package/dist/src/index.js
CHANGED