@melius-ai/cli 0.15.4 → 0.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -106,6 +106,7 @@ All node mutations write directly to the CRDT document. Changes are synced to co
106
106
  --prompt <text> Text prompt (maps to textPrompt)
107
107
  --model <m> Model name (requires --variant)
108
108
  --variant <v> Model variant (requires --model)
109
+ --tier <t> Speed tier of that model+variant (fast, pro, turbo; requires --model and --variant). Omit for standard speed
109
110
  --aspect-ratio <r> 21:9, 16:9, 4:3, 3:2, 1:1, 2:3, 3:4, 9:16, 9:21
110
111
  --duration <n> Output duration in seconds (video only)
111
112
  --x, --y, --w, --h Geometry (defaults per type: text 380x200, image 520x293)
@@ -141,6 +142,8 @@ Edge type determines data flow: `text` passes text output, `image` passes image
141
142
 
142
143
  **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
144
 
145
+ **Speed tiers:** a model can serve the same variant at more than one speed, and a speed word attached to a model names a tier rather than a separate model — "Wan 3.0 Fast" is `--model wan-3.0 --variant text-to-video --tier fast`. Each variant's `tier` comes from `mel model list`, and tiers can be priced differently from the standard speed.
146
+
144
147
  **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`.
145
148
 
146
149
  ```bash
@@ -150,6 +153,9 @@ mel run start <nodeId> --canvas-id <canvasId>
150
153
  # Explicit model
151
154
  mel run start <nodeId> --canvas-id <canvasId> --model flux-pro --variant text-to-image
152
155
 
156
+ # Explicit model at a non-standard speed tier
157
+ mel run start <nodeId> --canvas-id <canvasId> --model wan-3.0 --variant text-to-video --tier fast
158
+
153
159
  # With overrides
154
160
  mel run start <nodeId> --canvas-id <canvasId> --prompt "Override prompt" --variations 3
155
161
 
@@ -293,11 +299,13 @@ Use a `familyName` from `mel font list` with the `better-font-32b` image model b
293
299
 
294
300
  Supported formats: PNG, JPEG, GIF, WebP, AVIF.
295
301
 
296
- Returns `{ assetId, s3Bucket, s3Key, url }`. Use the returned `url` as `--src` when creating a file node, or pass `--node-id` to link the upload directly to an existing node.
302
+ Returns `{ assetId, s3Bucket, s3Key, url }`. Without `--node-id`, the image is stored as a standalone asset in the team's Files/DAM library. To put it on a canvas, create a file node first and pass `--node-id` and `--canvas-id`; do not feed the returned `url` to `--src` unless you also provide the internal `s3Key`, `s3Bucket`, and `contentType` fields.
297
303
 
298
304
  ```bash
299
- # Upload and create a file node from the result
305
+ # Upload a standalone asset to the Files/DAM library
300
306
  mel upload ./photo.png
307
+
308
+ # Upload and attach to an existing file node
301
309
  mel upload ./photo.png --node-id <nodeId> --canvas-id <canvasId>
302
310
  ```
303
311
 
package/dist/bin/mel.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  printUpgradeNoticeIfNeeded,
8
8
  withDefaultHelp,
9
9
  writeError
10
- } from "../chunk-LAHVPP66.js";
10
+ } from "../chunk-II5TPJQQ.js";
11
11
 
12
12
  // bin/mel.ts
13
13
  var program = createProgram();
@@ -7741,7 +7741,7 @@ var MAX_INPUT_DOCUMENTS = 5;
7741
7741
  var MAX_AGENT_MESSAGE_CONTENT_LENGTH = 5e4;
7742
7742
  var MAX_SEED = 2147483647;
7743
7743
  var MAX_VARIATIONS = 10;
7744
- var MAX_PINNED_MODELS = 5;
7744
+ var MAX_PINNED_MODELS = 20;
7745
7745
 
7746
7746
  // ../api-contract/src/common.ts
7747
7747
  var MessageResponseSchema = external_exports.object({ message: external_exports.string() });
@@ -7757,6 +7757,17 @@ var CompletedPartSchema = external_exports.object({
7757
7757
  partNumber: external_exports.number().int().positive(),
7758
7758
  etag: external_exports.string()
7759
7759
  });
7760
+ var NodeMaterializationPayloadSchema = external_exports.object({
7761
+ nodeType: external_exports.string(),
7762
+ geometry: external_exports.object({
7763
+ x: external_exports.number(),
7764
+ y: external_exports.number(),
7765
+ w: external_exports.number(),
7766
+ h: external_exports.number()
7767
+ }),
7768
+ title: external_exports.string().optional(),
7769
+ createdByUserId: external_exports.string().uuid().optional()
7770
+ });
7760
7771
  function paginationQuery({
7761
7772
  maxLimit,
7762
7773
  defaultLimit
@@ -7922,6 +7933,12 @@ var FileCardSchema = external_exports.object({
7922
7933
  // version-stack affordance on the card and whether the viewer shows the
7923
7934
  // read-only Versions list. Absent/`<= 1` means a single version (no stack).
7924
7935
  versionCount: external_exports.number().int().nonnegative().optional(),
7936
+ // Live comments on this asset, across every thread on it — the count the
7937
+ // viewer's Comments tab would show. Drives the comment indicator on the
7938
+ // card so a member can see which assets are being discussed without opening
7939
+ // each one. Optional so a client that ships ahead of the server keeps
7940
+ // validating; absent reads the same as zero.
7941
+ commentCount: external_exports.number().int().nonnegative().optional(),
7925
7942
  // Node/version to toggle when favoriting this asset from a Files surface.
7926
7943
  favoriteNodeId: external_exports.string().uuid().nullable().optional(),
7927
7944
  favoriteVersionId: external_exports.string().uuid().nullable().optional(),
@@ -8033,6 +8050,8 @@ var FileSortSchema = external_exports.enum([
8033
8050
  "size_desc"
8034
8051
  ]);
8035
8052
  var ListFilesQuerySchema = external_exports.object({
8053
+ projectId: external_exports.string().uuid().optional(),
8054
+ canvasId: external_exports.string().uuid().optional(),
8036
8055
  q: external_exports.string().optional(),
8037
8056
  ...paginationQuery({ maxLimit: 100, defaultLimit: 50 }),
8038
8057
  // Opaque pagination cursor for semantic search. When present, the server
@@ -8079,6 +8098,10 @@ var ListFilesQuerySchema = external_exports.object({
8079
8098
  includeTotal: external_exports.union([external_exports.boolean(), external_exports.literal("true"), external_exports.literal("false")]).optional().transform((value) => value !== false && value !== "false")
8080
8099
  });
8081
8100
  var ListFilesResponseSchema = external_exports.object({
8101
+ // Echoed only when project filtering was applied, so new clients can safely
8102
+ // detect older servers that ignore this additive query parameter.
8103
+ projectId: external_exports.string().uuid().optional(),
8104
+ canvasId: external_exports.string().uuid().optional(),
8082
8105
  data: external_exports.array(FileCardSchema),
8083
8106
  // The exact match count when `includeTotal` is true (the default). When a
8084
8107
  // client passes `includeTotal=false`, this is NOT the true cardinality — it
@@ -8093,10 +8116,15 @@ var ListFilesResponseSchema = external_exports.object({
8093
8116
  hasMore: external_exports.boolean().optional()
8094
8117
  });
8095
8118
  var FileTabCountsQuerySchema = external_exports.object({
8119
+ projectId: external_exports.string().uuid().optional(),
8120
+ canvasId: external_exports.string().uuid().optional(),
8096
8121
  q: external_exports.string().optional(),
8097
8122
  folderId: external_exports.union([external_exports.string().uuid(), external_exports.literal("root")]).optional()
8098
8123
  });
8099
8124
  var FileTabCountsResponseSchema = external_exports.object({
8125
+ // Confirms project scoping to clients that may be deployed before core.
8126
+ projectId: external_exports.string().uuid().optional(),
8127
+ canvasId: external_exports.string().uuid().optional(),
8100
8128
  // "All assets" — always uploads + generations (a file is one or the other).
8101
8129
  all: external_exports.number().int(),
8102
8130
  uploads: external_exports.number().int(),
@@ -8214,6 +8242,28 @@ var ImportGoogleDriveFileBodySchema = external_exports.object({
8214
8242
  var ImportGoogleDriveFileResponseSchema = external_exports.object({
8215
8243
  file: FileCardSchema
8216
8244
  });
8245
+ var StartGoogleDriveImportJobBodySchema = external_exports.object({
8246
+ requestId: external_exports.string().uuid(),
8247
+ driveFileId: external_exports.string().min(1).max(MAX_GOOGLE_DRIVE_FILE_ID_LENGTH),
8248
+ folderId: external_exports.string().uuid().nullable().optional()
8249
+ });
8250
+ var StartGoogleDriveImportJobResponseSchema = external_exports.object({
8251
+ jobId: external_exports.string().uuid()
8252
+ });
8253
+ var GoogleDriveImportJobParamsSchema = external_exports.object({
8254
+ jobId: external_exports.string().uuid()
8255
+ });
8256
+ var GoogleDriveImportJobStatusSchema = external_exports.discriminatedUnion("status", [
8257
+ external_exports.object({ status: external_exports.literal("running") }),
8258
+ external_exports.object({
8259
+ status: external_exports.literal("completed"),
8260
+ file: FileCardSchema
8261
+ }),
8262
+ external_exports.object({
8263
+ status: external_exports.literal("failed"),
8264
+ message: external_exports.string()
8265
+ })
8266
+ ]);
8217
8267
  var UploadcareUploadSignatureResponseSchema = external_exports.object({
8218
8268
  signature: external_exports.string(),
8219
8269
  /** Unix seconds, as a string — the exact bytes that were signed. */
@@ -8562,7 +8612,7 @@ var agentContract = c.router({
8562
8612
  // Per-turn override for the persisted profile setting.
8563
8613
  // Omitted = use the user's saved preference.
8564
8614
  agentAutoRunOverride: external_exports.boolean().optional(),
8565
- // Plan mode (flag `agent-plan-mode`): run this turn on the
8615
+ // Plan mode: run this turn on the
8566
8616
  // execution model with high reasoning and a read-only toolset
8567
8617
  // so the agent drafts or refines a plan instead of executing.
8568
8618
  // Ignored (normal turn) when the flag is off for the caller.
@@ -8786,6 +8836,15 @@ var agentContract = c.router({
8786
8836
  }
8787
8837
  });
8788
8838
 
8839
+ // ../api-contract/src/errors.ts
8840
+ var API_ERROR_CODE = {
8841
+ projectNameTaken: "PROJECT_NAME_TAKEN",
8842
+ apiKeyNameTaken: "API_KEY_NAME_TAKEN",
8843
+ accountNotFound: "ACCOUNT_NOT_FOUND",
8844
+ /** The `:teamId` in the path names a different team than `X-Team-Id`. */
8845
+ teamIdMismatch: "TEAM_ID_MISMATCH"
8846
+ };
8847
+
8789
8848
  // ../api-contract/src/api-key/schema.ts
8790
8849
  var MAX_API_KEY_NAME_LENGTH = 255;
8791
8850
  var CreateApiKeyBodySchema = external_exports.object({
@@ -8798,6 +8857,9 @@ var CreateApiKeyBodySchema = external_exports.object({
8798
8857
  var RenameApiKeyBodySchema = external_exports.object({
8799
8858
  name: external_exports.string().trim().min(1).max(MAX_API_KEY_NAME_LENGTH)
8800
8859
  });
8860
+ var API_KEY_CONFLICT_CODE = {
8861
+ nameTaken: API_ERROR_CODE.apiKeyNameTaken
8862
+ };
8801
8863
  var AGENT_SESSION_KEY_NAME_PREFIX = "agent-session-";
8802
8864
  var API_KEY_NAME_RESERVED_MESSAGE = `"${AGENT_SESSION_KEY_NAME_PREFIX}" is a reserved name prefix`;
8803
8865
  var ApiKeyResponseSchema = external_exports.object({
@@ -8959,6 +9021,9 @@ var STANDARD_VOICE_LIBRARY_FILTER_OPTIONS = {
8959
9021
  age: ["young", "middle_aged", "old"],
8960
9022
  useCase: STANDARD_VOICE_LIBRARY_USE_CASES.map((entry) => entry.value)
8961
9023
  };
9024
+ var USE_CASE_LABEL_BY_VALUE = Object.fromEntries(
9025
+ STANDARD_VOICE_LIBRARY_USE_CASES.map((entry) => [entry.value, entry.label])
9026
+ );
8962
9027
  var asZodEnum = (values) => values;
8963
9028
  var AudioVoiceResponseSchema = external_exports.object({
8964
9029
  voiceId: external_exports.string(),
@@ -8967,10 +9032,7 @@ var AudioVoiceResponseSchema = external_exports.object({
8967
9032
  previewUrl: external_exports.string().url().nullable(),
8968
9033
  labels: external_exports.record(external_exports.string())
8969
9034
  });
8970
- var ListAudioVoicesQuerySchema = external_exports.object({
8971
- page: external_exports.coerce.number().int().min(0).default(0),
8972
- pageSize: external_exports.coerce.number().int().min(1).max(100).default(AUDIO_VOICE_LIBRARY_PAGE_SIZE),
8973
- search: external_exports.string().optional(),
9035
+ var StandardVoiceLibraryFilterQueryShape = {
8974
9036
  /** Maps to `category=high_quality` on ElevenLabs (`studio` is the only value). */
8975
9037
  quality: external_exports.enum(asZodEnum(STANDARD_VOICE_LIBRARY_FILTER_OPTIONS.quality)).optional(),
8976
9038
  language: external_exports.enum(asZodEnum(STANDARD_VOICE_LIBRARY_FILTER_OPTIONS.language)).optional(),
@@ -8978,6 +9040,12 @@ var ListAudioVoicesQuerySchema = external_exports.object({
8978
9040
  gender: external_exports.enum(asZodEnum(STANDARD_VOICE_LIBRARY_FILTER_OPTIONS.gender)).optional(),
8979
9041
  age: external_exports.enum(asZodEnum(STANDARD_VOICE_LIBRARY_FILTER_OPTIONS.age)).optional(),
8980
9042
  useCase: external_exports.enum(asZodEnum(STANDARD_VOICE_LIBRARY_FILTER_OPTIONS.useCase)).optional()
9043
+ };
9044
+ var ListAudioVoicesQuerySchema = external_exports.object({
9045
+ page: external_exports.coerce.number().int().min(0).default(0),
9046
+ pageSize: external_exports.coerce.number().int().min(1).max(100).default(AUDIO_VOICE_LIBRARY_PAGE_SIZE),
9047
+ search: external_exports.string().optional(),
9048
+ ...StandardVoiceLibraryFilterQueryShape
8981
9049
  });
8982
9050
  var ListAudioVoicesResponseSchema = external_exports.object({
8983
9051
  voices: external_exports.array(AudioVoiceResponseSchema),
@@ -9169,7 +9237,8 @@ var CANVAS_NODE_TYPES = [
9169
9237
  "pdf",
9170
9238
  "composite",
9171
9239
  "stitch",
9172
- "magic_resize"
9240
+ "magic_resize",
9241
+ "element"
9173
9242
  ];
9174
9243
  var CANVAS_GROUP_TYPES = ["default", "unified", "template"];
9175
9244
  var CANVAS_MEDIA_TYPES = ["image", "video", "audio", "pdf"];
@@ -9257,13 +9326,13 @@ var AUTO_MODEL_REGISTRY = [
9257
9326
  {
9258
9327
  nodeType: "image",
9259
9328
  inputPattern: "text-to-image",
9260
- model: "nano-banana-pro",
9329
+ model: "seedream-5-pro",
9261
9330
  variant: "text-to-image"
9262
9331
  },
9263
9332
  {
9264
9333
  nodeType: "image",
9265
9334
  inputPattern: "image-to-image",
9266
- model: "nano-banana-pro",
9335
+ model: "seedream-5-pro",
9267
9336
  variant: "image-to-image"
9268
9337
  },
9269
9338
  // ── Text ────────────────────────────────────────────────────────────
@@ -9507,6 +9576,12 @@ var MODALITIES = {
9507
9576
  var GENERATIVE_NODE_TYPES = Object.keys(
9508
9577
  MODALITIES
9509
9578
  );
9579
+ var SOURCE_ONLY_NODE_TYPES = /* @__PURE__ */ new Set([
9580
+ "custom_text",
9581
+ "file",
9582
+ "pdf",
9583
+ "element"
9584
+ ]);
9510
9585
  var NODE_DEFAULTS = {
9511
9586
  text: { title: "Text", mode: "text", prompt: "" },
9512
9587
  image: {
@@ -9538,7 +9613,8 @@ var NODE_DEFAULTS = {
9538
9613
  magic_resize: {
9539
9614
  title: "Magic resize",
9540
9615
  ratios: ["16:9", "1:1", "9:16", "4:3", "3:4"]
9541
- }
9616
+ },
9617
+ element: { title: "Element", src: "", mediaType: "image" }
9542
9618
  };
9543
9619
  function estimateNodeHeight(contentHeight) {
9544
9620
  return contentHeight + NODE_CARD_OVERHEAD;
@@ -9598,6 +9674,7 @@ function getDefaultGeometry(nodeType, aspectRatio) {
9598
9674
  return { x: 0, y: 0, w, h: estimateNodeHeight(contentH) };
9599
9675
  }
9600
9676
  case "file":
9677
+ case "element":
9601
9678
  return {
9602
9679
  x: 0,
9603
9680
  y: 0,
@@ -9662,6 +9739,7 @@ function getPresetNodeWidth(type, aspectRatio, explicitWidth) {
9662
9739
  function getEstimatedHeight(type) {
9663
9740
  switch (type) {
9664
9741
  case "file":
9742
+ case "element":
9665
9743
  return 320;
9666
9744
  case "text":
9667
9745
  case "custom_text":
@@ -10055,19 +10133,26 @@ function computeAutoformat(allNodes, allEdges, nodeIds) {
10055
10133
  const rawComponents = findConnectedComponents(targetIds, topologyEdges);
10056
10134
  const connectedComponents = rawComponents.filter((c14) => c14.length > 1);
10057
10135
  const isolatedIds = rawComponents.filter((c14) => c14.length === 1).flat().toSorted();
10058
- if (isolatedIds.length > 0) connectedComponents.push(isolatedIds);
10059
- const components = connectedComponents.toSorted((a, b) => {
10060
- const aHasText = a.some((id) => {
10061
- const n = nodeById.get(id);
10062
- return n != null && isTextType(n.nodeType);
10063
- });
10064
- const bHasText = b.some((id) => {
10065
- const n = nodeById.get(id);
10066
- return n != null && isTextType(n.nodeType);
10067
- });
10068
- if (aHasText !== bHasText) return aHasText ? -1 : 1;
10069
- return a[0] < b[0] ? -1 : a[0] > b[0] ? 1 : 0;
10070
- });
10136
+ const isSourceOnly = (id) => {
10137
+ const nodeType = nodeById.get(id)?.nodeType;
10138
+ return nodeType != null && SOURCE_ONLY_NODE_TYPES.has(nodeType);
10139
+ };
10140
+ const looseSources = isolatedIds.filter(isSourceOnly);
10141
+ const looseOthers = isolatedIds.filter((id) => !isSourceOnly(id));
10142
+ if (looseSources.length > 0) connectedComponents.push(looseSources);
10143
+ if (looseOthers.length > 0) connectedComponents.push(looseOthers);
10144
+ const componentRank = (ids) => {
10145
+ const nodes = ids.flatMap((id) => nodeById.get(id) ?? []);
10146
+ if (nodes.length > 0 && nodes.every((n) => isSourceOnly(n.id))) {
10147
+ return 0;
10148
+ }
10149
+ if (nodes.some((n) => isTextType(n.nodeType))) return 1;
10150
+ return 2;
10151
+ };
10152
+ const components = connectedComponents.map((ids) => ({ ids, rank: componentRank(ids) })).toSorted((a, b) => {
10153
+ if (a.rank !== b.rank) return a.rank - b.rank;
10154
+ return a.ids[0] < b.ids[0] ? -1 : a.ids[0] > b.ids[0] ? 1 : 0;
10155
+ }).map((c14) => c14.ids);
10071
10156
  if (components.length > 1) {
10072
10157
  const targets2 = sortedNodes.filter((n) => targetIds.has(n.id));
10073
10158
  const parentId2 = targets2[0]?.groupId;
@@ -10805,6 +10890,14 @@ function inferDirectFileNodeMediaTypeFromContentType(contentType) {
10805
10890
  if (mimeType === "application/pdf") return "pdf";
10806
10891
  return null;
10807
10892
  }
10893
+ function refuseDirectElementNode(input, ctx) {
10894
+ if (input.nodeType !== "element") return;
10895
+ ctx.addIssue({
10896
+ code: external_exports.ZodIssueCode.custom,
10897
+ path: ["nodeType"],
10898
+ message: "An element node is placed from the element library, not created directly"
10899
+ });
10900
+ }
10808
10901
  function validateDirectFileNodeAssetFields(input, ctx) {
10809
10902
  if (input.nodeType !== "file") {
10810
10903
  const assetField = [
@@ -10936,6 +11029,7 @@ var STABILITY_V3 = {
10936
11029
  min: 0,
10937
11030
  max: 1,
10938
11031
  step: 0.5,
11032
+ apiStep: 0.01,
10939
11033
  default: 0.5,
10940
11034
  rangeLabel: "Creative \xB7 Natural \xB7 Robust"
10941
11035
  };
@@ -10968,7 +11062,6 @@ var ELEVENLABS_VOICE_SETTINGS_CONSTRAINTS = {
10968
11062
  stability: STABILITY_V3,
10969
11063
  speedSupported: true,
10970
11064
  speedApiSupported: false,
10971
- stabilitySnapValues: [0, 0.5, 1],
10972
11065
  speedSnapValues: SPEED_V3_SNAP_VALUES
10973
11066
  },
10974
11067
  eleven_english_sts_v2: {
@@ -11039,8 +11132,8 @@ var HeygenAvatarVariantSchema = external_exports.object({
11039
11132
  description: external_exports.string().describe("Pose, setting, and framing, e.g. 'Standing office front'")
11040
11133
  });
11041
11134
  var HeygenAvatarPersonSchema = external_exports.object({
11042
- name: external_exports.string().describe("The presenter's first name, e.g. 'Abigail'"),
11043
- variants: external_exports.array(HeygenAvatarVariantSchema).describe("Every pose available for this presenter")
11135
+ name: external_exports.string().describe("The avatar's first name, e.g. 'Abigail'"),
11136
+ variants: external_exports.array(HeygenAvatarVariantSchema).describe("Every pose available for this avatar")
11044
11137
  });
11045
11138
  var HeygenAvatarCatalogSchema = external_exports.object({
11046
11139
  people: external_exports.array(HeygenAvatarPersonSchema),
@@ -11148,6 +11241,23 @@ var PreviewAssetSchema = external_exports.object({
11148
11241
  thumbnailUrl: external_exports.string().nullable()
11149
11242
  });
11150
11243
 
11244
+ // ../api-contract/src/text-thinking.ts
11245
+ var TEXT_THINKING_LEVELS = [
11246
+ "off",
11247
+ "on",
11248
+ "minimal",
11249
+ "low",
11250
+ "medium",
11251
+ "high",
11252
+ "xhigh",
11253
+ "max"
11254
+ ];
11255
+ var TextThinkingLevelSchema = external_exports.enum(TEXT_THINKING_LEVELS);
11256
+ var TextThinkingCapabilitySchema = external_exports.object({
11257
+ levels: external_exports.array(TextThinkingLevelSchema).min(1),
11258
+ defaultLevel: TextThinkingLevelSchema
11259
+ });
11260
+
11151
11261
  // ../api-contract/src/canvas/schema.ts
11152
11262
  var CanvasResponseSchema = external_exports.object({
11153
11263
  id: external_exports.string().uuid(),
@@ -11196,10 +11306,18 @@ var EdgeTypeSchema = external_exports.enum([
11196
11306
  ]);
11197
11307
  var GroupTypeSchema = external_exports.enum(CANVAS_GROUP_TYPES);
11198
11308
  var GroupColorSchema = external_exports.enum(GROUP_COLOR_KEYS);
11309
+ var ImageGenerationQualityIdSchema = external_exports.string().trim().min(1).max(64);
11310
+ var ImageGenerationQualityOptionSchema = external_exports.object({
11311
+ id: ImageGenerationQualityIdSchema,
11312
+ label: external_exports.string().trim().min(1).max(64)
11313
+ });
11199
11314
  var ModelConfigSchema = external_exports.object({
11200
11315
  model: external_exports.string(),
11201
11316
  variant: external_exports.string(),
11202
11317
  tier: external_exports.string().nullable().optional(),
11318
+ quality: ImageGenerationQualityIdSchema.optional(),
11319
+ /** Text-only: reasoning control used for this version. */
11320
+ thinkingLevel: TextThinkingLevelSchema.optional(),
11203
11321
  /** HeyGen Avatar V only: the Runware avatar id for this node. */
11204
11322
  heygenAvatar: external_exports.string().optional(),
11205
11323
  /** HeyGen Avatar V presentation, speech, and output controls. */
@@ -11234,6 +11352,9 @@ var ModelConfigInputSchema = external_exports.object({
11234
11352
  model: external_exports.string(),
11235
11353
  variant: external_exports.string().refine(isValidGenerationMode, "Invalid generation mode"),
11236
11354
  tier: external_exports.string().nullable().optional(),
11355
+ quality: ImageGenerationQualityIdSchema.optional(),
11356
+ /** Text-only: reasoning control for this run. */
11357
+ thinkingLevel: TextThinkingLevelSchema.optional(),
11237
11358
  /** HeyGen Avatar V only: the Runware avatar id for this node. */
11238
11359
  heygenAvatar: external_exports.string().trim().min(1).optional(),
11239
11360
  /** HeyGen Avatar V presentation, speech, and output controls. */
@@ -11389,6 +11510,8 @@ var NodeVersionResponseSchema = external_exports.object({
11389
11510
  pdfExtraction: PdfExtractionSchema.nullable().optional(),
11390
11511
  /** Present when an active node run exists for this version (e.g. PDF extraction in progress). */
11391
11512
  nodeRunId: external_exports.string().uuid().nullable().optional(),
11513
+ /** Element nodes only: the element version this node version is pinned to. */
11514
+ elementVersionId: external_exports.string().uuid().nullable().optional(),
11392
11515
  layerCount: external_exports.number().int().nonnegative(),
11393
11516
  errorMessage: external_exports.string().nullable(),
11394
11517
  errorSeverity: ErrorSeveritySchema.nullable(),
@@ -11878,6 +12001,11 @@ var CanvasAssetResponseSchema = external_exports.object({
11878
12001
  durationInMs: external_exports.number().int().nonnegative().nullable(),
11879
12002
  createdAt: external_exports.string().datetime()
11880
12003
  });
12004
+ var CanvasLibraryFiltersSchema = ListFilesQuerySchema.pick({
12005
+ fileType: true,
12006
+ tagIds: true,
12007
+ sort: true
12008
+ }).partial({ sort: true });
11881
12009
  var CanvasLibraryAssetResponseSchema = external_exports.object({
11882
12010
  id: external_exports.string().uuid(),
11883
12011
  assetUrl: external_exports.string().nullable(),
@@ -12027,8 +12155,8 @@ var CreateDirectNodeBodyObjectSchema = external_exports.object({
12027
12155
  });
12028
12156
  var CreateDirectNodeBodySchema = CreateDirectNodeBodyObjectSchema.superRefine(
12029
12157
  validateDirectFileNodeAssetFields
12030
- );
12031
- var UpdateDirectNodeBodySchema = external_exports.object({
12158
+ ).superRefine(refuseDirectElementNode);
12159
+ var UpdateDirectNodeBodyObjectSchema = external_exports.object({
12032
12160
  geometry: GeometrySchema.optional(),
12033
12161
  nodeType: NodeTypeSchema.optional(),
12034
12162
  title: external_exports.string().optional(),
@@ -12053,6 +12181,7 @@ var UpdateDirectNodeBodySchema = external_exports.object({
12053
12181
  customVoiceId: external_exports.string().uuid().nullable().optional(),
12054
12182
  elevenLabsVoiceSettings: ElevenLabsVoiceSettingsSchema.nullable().optional()
12055
12183
  });
12184
+ var UpdateDirectNodeBodySchema = UpdateDirectNodeBodyObjectSchema.superRefine(refuseDirectElementNode);
12056
12185
  var CreateDirectEdgeBodySchema = external_exports.object({
12057
12186
  id: external_exports.string().uuid(),
12058
12187
  srcNodeId: external_exports.string().uuid(),
@@ -12215,7 +12344,12 @@ var CanvasSettingsResponseSchema = external_exports.object({
12215
12344
  createdAt: external_exports.string().datetime(),
12216
12345
  updatedAt: external_exports.string().datetime()
12217
12346
  });
12218
- var GenerationSurfaceSchema = external_exports.enum(["playground", "cast"]);
12347
+ var GenerationSurfaceSchema = external_exports.enum([
12348
+ "playground",
12349
+ "cast",
12350
+ "element"
12351
+ ]);
12352
+ var RequestableGenerationSurfaceSchema = GenerationSurfaceSchema.exclude(["element"]);
12219
12353
  var PlaygroundCanvasReferenceSchema = external_exports.object({
12220
12354
  projectId: external_exports.string().uuid(),
12221
12355
  canvasId: external_exports.string().uuid()
@@ -12245,7 +12379,7 @@ var canvasContract = c4.router({
12245
12379
  body: external_exports.object({
12246
12380
  destination: PlaygroundCanvasDestinationSchema.optional(),
12247
12381
  /** Defaults to `playground` server-side. */
12248
- surface: GenerationSurfaceSchema.optional()
12382
+ surface: RequestableGenerationSurfaceSchema.optional()
12249
12383
  }).optional(),
12250
12384
  responses: {
12251
12385
  201: PlaygroundCanvasReferenceSchema,
@@ -12259,7 +12393,7 @@ var canvasContract = c4.router({
12259
12393
  query: external_exports.object({
12260
12394
  ...paginationQuery({ maxLimit: 100, defaultLimit: 25 }),
12261
12395
  /** Defaults to `playground` server-side. */
12262
- surface: GenerationSurfaceSchema.optional()
12396
+ surface: RequestableGenerationSurfaceSchema.optional()
12263
12397
  }),
12264
12398
  responses: { 200: PlaygroundCanvasPageSchema }
12265
12399
  },
@@ -12928,7 +13062,19 @@ var canvasContract = c4.router({
12928
13062
  * Node ids whose audio-to-video duration should be matched to
12929
13063
  * connected generated audio after upstream audio nodes finish.
12930
13064
  */
12931
- matchAudioToVideoDurationNodeIds: external_exports.array(external_exports.string().uuid()).max(500).optional()
13065
+ matchAudioToVideoDurationNodeIds: external_exports.array(external_exports.string().uuid()).max(500).optional(),
13066
+ /**
13067
+ * Node ids whose connected audio may be shortened to the longest
13068
+ * clip the model offers, when it overruns by a hair.
13069
+ *
13070
+ * Separate from the field above, and deliberately narrower: matching
13071
+ * grows the *video* to fit the read and is safe for anything, while
13072
+ * this drops the end of somebody's audio. Only a caller that
13073
+ * generated that audio itself — from a script the member wrote, in
13074
+ * the same run — can say that is the right trade, so the permission
13075
+ * is the caller's to give rather than something inferred here.
13076
+ */
13077
+ trimAudioToMatchedDurationNodeIds: external_exports.array(external_exports.string().uuid()).max(500).optional()
12932
13078
  }),
12933
13079
  responses: {
12934
13080
  201: BulkNodeRunResponseSchema,
@@ -13219,6 +13365,7 @@ var canvasContract = c4.router({
13219
13365
  path: "/canvases/:canvasId/library-assets",
13220
13366
  pathParams: external_exports.object({ canvasId: external_exports.string().uuid() }),
13221
13367
  query: external_exports.object({
13368
+ ...CanvasLibraryFiltersSchema.shape,
13222
13369
  ...paginationQuery({ maxLimit: 100, defaultLimit: 50 }),
13223
13370
  source: external_exports.enum(["upload", "generated"]).optional(),
13224
13371
  // Filename search, matching the DAM Files search input.
@@ -13241,7 +13388,10 @@ var canvasContract = c4.router({
13241
13388
  assetId: external_exports.string().uuid()
13242
13389
  }),
13243
13390
  body: external_exports.object({
13244
- nodeId: external_exports.string().uuid()
13391
+ nodeId: external_exports.string().uuid(),
13392
+ // The node was just created client-side in the CRDT; this lets the
13393
+ // server materialize its row when the WS update hasn't arrived yet.
13394
+ node: NodeMaterializationPayloadSchema.optional()
13245
13395
  }),
13246
13396
  responses: {
13247
13397
  200: external_exports.object({
@@ -13420,6 +13570,8 @@ var ASSET_ENGAGEMENT_SOURCES = {
13420
13570
  /** In-app (web) Mel chat acting for a member. */
13421
13571
  Agent: "agent",
13422
13572
  Canvas: "canvas",
13573
+ /** Cast studio playback handoff: download or public sharing. */
13574
+ Cast: "cast",
13423
13575
  /** API key with no MCP session header — CLI and direct API use. */
13424
13576
  Cli: "cli",
13425
13577
  Files: "files",
@@ -13433,6 +13585,7 @@ var ASSET_ENGAGEMENT_SOURCES = {
13433
13585
  };
13434
13586
  var ClientAssetEngagementSourceSchema = external_exports.enum([
13435
13587
  ASSET_ENGAGEMENT_SOURCES.Canvas,
13588
+ ASSET_ENGAGEMENT_SOURCES.Cast,
13436
13589
  ASSET_ENGAGEMENT_SOURCES.Files,
13437
13590
  ASSET_ENGAGEMENT_SOURCES.Playground
13438
13591
  ]);
@@ -13782,6 +13935,29 @@ var filesContract = c6.router({
13782
13935
  },
13783
13936
  summary: "Resolve a Files folder's owning team for the current user"
13784
13937
  },
13938
+ getFileFolderShareMode: {
13939
+ method: "GET",
13940
+ path: "/files/folders/:folderId/share-mode",
13941
+ pathParams: FileFolderIdParamsSchema,
13942
+ responses: {
13943
+ 200: external_exports.object({ shareMode: AssetShareModeSchema }),
13944
+ 403: ErrorBodySchema,
13945
+ 404: ErrorBodySchema
13946
+ },
13947
+ summary: "Get an asset folder share mode"
13948
+ },
13949
+ updateFileFolderShareMode: {
13950
+ method: "PATCH",
13951
+ path: "/files/folders/:folderId/share-mode",
13952
+ pathParams: FileFolderIdParamsSchema,
13953
+ body: external_exports.object({ shareMode: AssetShareModeSchema }),
13954
+ responses: {
13955
+ 200: external_exports.object({ shareMode: AssetShareModeSchema }),
13956
+ 403: ErrorBodySchema,
13957
+ 404: ErrorBodySchema
13958
+ },
13959
+ summary: "Update an asset folder share mode"
13960
+ },
13785
13961
  updateFileFolder: {
13786
13962
  method: "PATCH",
13787
13963
  path: "/files/folders/:folderId",
@@ -14183,6 +14359,31 @@ var filesContract = c6.router({
14183
14359
  404: ErrorBodySchema
14184
14360
  },
14185
14361
  summary: "Import a file the user picked from Google Drive"
14362
+ },
14363
+ startGoogleDriveImportJob: {
14364
+ method: "POST",
14365
+ path: "/files/import/google-drive/jobs",
14366
+ body: StartGoogleDriveImportJobBodySchema,
14367
+ responses: {
14368
+ 202: StartGoogleDriveImportJobResponseSchema,
14369
+ 400: ErrorBodySchema,
14370
+ 403: ErrorBodySchema,
14371
+ 404: ErrorBodySchema,
14372
+ 503: ErrorBodySchema
14373
+ },
14374
+ summary: "Start a durable Google Drive import"
14375
+ },
14376
+ getGoogleDriveImportJob: {
14377
+ method: "GET",
14378
+ path: "/files/import/google-drive/jobs/:jobId",
14379
+ pathParams: GoogleDriveImportJobParamsSchema,
14380
+ responses: {
14381
+ 200: GoogleDriveImportJobStatusSchema,
14382
+ 403: ErrorBodySchema,
14383
+ 404: ErrorBodySchema,
14384
+ 503: ErrorBodySchema
14385
+ },
14386
+ summary: "Get a durable Google Drive import"
14186
14387
  }
14187
14388
  });
14188
14389
 
@@ -14205,6 +14406,10 @@ var VoiceCapabilitySchema = external_exports.discriminatedUnion("source", [
14205
14406
  ]);
14206
14407
 
14207
14408
  // ../api-contract/src/generation/schema.ts
14409
+ var ImageGenerationQualityPricingSchema = external_exports.record(
14410
+ external_exports.string(),
14411
+ external_exports.record(external_exports.string(), external_exports.number())
14412
+ );
14208
14413
  var GenerationJobStatusSchema = external_exports.enum([
14209
14414
  "in_progress",
14210
14415
  "finished",
@@ -14246,6 +14451,8 @@ var GenerationRunBodySchema = external_exports.object({
14246
14451
  aspectRatio: OutputAspectRatioSchema.optional(),
14247
14452
  duration: external_exports.number().int().positive().optional(),
14248
14453
  resolution: OutputResolutionSchema.optional(),
14454
+ /** Quality mode for image variants that expose it; ignored by other models. */
14455
+ quality: ImageGenerationQualityIdSchema.optional(),
14249
14456
  seed: external_exports.number().int().nonnegative().max(MAX_SEED).optional(),
14250
14457
  numVariations: external_exports.number().int().min(1).max(MAX_VARIATIONS).optional(),
14251
14458
  /**
@@ -14320,6 +14527,9 @@ var AutoModelDefaultCapabilitiesSchema = external_exports.object({
14320
14527
  minCustomResolutionArea: external_exports.number().nullable().optional(),
14321
14528
  maxCustomResolutionAspectRatio: external_exports.number().nullable().optional(),
14322
14529
  resolutionPricingMultipliers: external_exports.record(external_exports.string(), external_exports.number()).nullable().optional(),
14530
+ qualityOptions: external_exports.array(ImageGenerationQualityOptionSchema).optional(),
14531
+ defaultQuality: ImageGenerationQualityIdSchema.optional(),
14532
+ qualityPricingMultipliersByResolution: ImageGenerationQualityPricingSchema.nullable().optional(),
14323
14533
  audioOffCreditMultiplier: external_exports.number().nullable().optional(),
14324
14534
  audioOffCreditMultipliersByResolution: external_exports.record(external_exports.string(), external_exports.number()).nullable().optional(),
14325
14535
  maxImageInputs: external_exports.number().nullable().optional(),
@@ -14511,6 +14721,12 @@ var ModelVariantResponseSchema = external_exports.object({
14511
14721
  minCustomResolutionArea: external_exports.number().nullable().optional(),
14512
14722
  maxCustomResolutionAspectRatio: external_exports.number().nullable().optional(),
14513
14723
  resolutionPricingMultipliers: external_exports.record(external_exports.string(), external_exports.number()).nullable(),
14724
+ /** User-selectable quality modes for this image variant. */
14725
+ qualityOptions: external_exports.array(ImageGenerationQualityOptionSchema).optional(),
14726
+ /** Quality used when a node predates the selector or has no explicit value. */
14727
+ defaultQuality: ImageGenerationQualityIdSchema.optional(),
14728
+ /** Total base-price multiplier for each quality/resolution pair. */
14729
+ qualityPricingMultipliersByResolution: ImageGenerationQualityPricingSchema.nullable().optional(),
14514
14730
  /** Multiplier applied to creditCost when audio is toggled off. */
14515
14731
  audioOffCreditMultiplier: external_exports.number().nullable().optional(),
14516
14732
  /** Per-resolution overrides of audioOffCreditMultiplier. */
@@ -14579,7 +14795,9 @@ var ModelResponseSchema = external_exports.object({
14579
14795
  /** Maximum prompt length in characters. Used by text models that lack variants. */
14580
14796
  maxPromptLength: external_exports.number().nullable().optional(),
14581
14797
  /** Per-1M-token credit rates for text models; drives the live cost-range estimate. */
14582
- textTokenPricing: TextTokenPricingSchema.optional()
14798
+ textTokenPricing: TextTokenPricingSchema.optional(),
14799
+ /** Text-only reasoning levels supported by the routed provider model. */
14800
+ thinking: TextThinkingCapabilitySchema.nullable().optional()
14583
14801
  });
14584
14802
  var ListGenerativeModelsResponseSchema = external_exports.object({
14585
14803
  models: external_exports.array(ModelResponseSchema)
@@ -14932,6 +15150,22 @@ var ProfileUserSchema = external_exports.object({
14932
15150
  completedProductTour: external_exports.string().datetime().nullable(),
14933
15151
  avatarUrl: external_exports.string().nullable(),
14934
15152
  advancedSettings: UserAdvancedSettingsSchema,
15153
+ /**
15154
+ * Generations this member started themselves, saturating at
15155
+ * {@link PROFILE_GENERATION_COUNT_CAP}. Agent- and MCP-triggered runs are
15156
+ * not counted: the readers are prompts about hands-on canvas work, and the
15157
+ * two attribution columns cannot be counted together within one bounded
15158
+ * index scan.
15159
+ *
15160
+ * Sent only while `advancedSettings.hideNodePromptsEnabled` is unset. The
15161
+ * count exists to decide whether to offer the node-display prompt, and a
15162
+ * saved display default has already decided it, so the server does not
15163
+ * spend the query. Absent therefore means "no reader needs this" — never
15164
+ * "this member has run nothing" — and a client must not show it as a total.
15165
+ *
15166
+ * Optional, so a client built before this reads the payload unchanged.
15167
+ */
15168
+ generationCount: external_exports.number().int().nonnegative().optional(),
14935
15169
  /**
14936
15170
  * Whether this session may open the staff tools panel — a Melius account,
14937
15171
  * or somebody of ours behind a verified impersonation marker.
@@ -15022,7 +15256,170 @@ var profileContract = c9.router({
15022
15256
  }
15023
15257
  });
15024
15258
 
15259
+ // ../api-contract/src/asset-comment/schema.ts
15260
+ var spatialMarkFields = {
15261
+ /**
15262
+ * The asset the mark was drawn on — the identity that decides whether a pin
15263
+ * may be painted. Placing an asset onto another canvas makes a new node and
15264
+ * a new version around the SAME image, so version ids differ per node while
15265
+ * the pixels are identical; keying on `versionId` alone hid every pin from
15266
+ * every other canvas. Optional: anchors written before this fall back to
15267
+ * `versionId`.
15268
+ */
15269
+ assetId: external_exports.string().uuid().optional(),
15270
+ versionId: external_exports.string().uuid().optional(),
15271
+ timeMs: external_exports.number().nonnegative().optional(),
15272
+ color: external_exports.string().optional()
15273
+ };
15274
+ var CommentAnchorSchema = external_exports.discriminatedUnion("kind", [
15275
+ external_exports.object({
15276
+ kind: external_exports.literal("video_timestamp"),
15277
+ timeMs: external_exports.number().nonnegative()
15278
+ }),
15279
+ external_exports.object({
15280
+ kind: external_exports.literal("image_point"),
15281
+ x: external_exports.number(),
15282
+ y: external_exports.number(),
15283
+ ...spatialMarkFields
15284
+ }),
15285
+ external_exports.object({
15286
+ kind: external_exports.literal("image_region"),
15287
+ x: external_exports.number(),
15288
+ y: external_exports.number(),
15289
+ w: external_exports.number(),
15290
+ h: external_exports.number(),
15291
+ ...spatialMarkFields
15292
+ })
15293
+ ]);
15294
+ var MAX_COMMENT_ATTACHMENTS = 10;
15295
+ var AssetCommentAttachmentSchema = external_exports.object({
15296
+ assetId: external_exports.string().uuid(),
15297
+ fileType: FileTypeSchema,
15298
+ contentType: external_exports.string(),
15299
+ displayName: external_exports.string(),
15300
+ /** The file itself; null when it cannot be signed. */
15301
+ url: external_exports.string().nullable(),
15302
+ /** A still thumbnail (image resize or video poster); null for audio/pdf. */
15303
+ previewUrl: external_exports.string().nullable()
15304
+ });
15305
+ var guestName = external_exports.string().trim().min(1).max(100);
15306
+ var GuestCommentAuthorSchema = external_exports.object({
15307
+ guestFirstName: guestName,
15308
+ guestLastName: guestName
15309
+ }).strict();
15310
+ var CommentAuthorSchema = external_exports.object({
15311
+ createdByUserId: external_exports.string().uuid().nullable(),
15312
+ // Absent on responses from an account-only server.
15313
+ guestFirstName: GuestCommentAuthorSchema.shape.guestFirstName.nullish(),
15314
+ guestLastName: GuestCommentAuthorSchema.shape.guestLastName.nullish(),
15315
+ createdByName: external_exports.string()
15316
+ });
15317
+ function hasSingleCommentAuthor(author) {
15318
+ if (author.createdByUserId !== null) {
15319
+ return author.guestFirstName == null && author.guestLastName == null;
15320
+ }
15321
+ return author.guestFirstName != null && author.guestLastName != null;
15322
+ }
15323
+ var AssetCommentSchema = external_exports.object({
15324
+ id: external_exports.string().uuid(),
15325
+ threadId: external_exports.string().uuid(),
15326
+ body: external_exports.string(),
15327
+ ...CommentAuthorSchema.shape,
15328
+ createdAt: external_exports.string().datetime(),
15329
+ updatedAt: external_exports.string().datetime(),
15330
+ // Optional so clients tolerate deploy skew with an older core.
15331
+ attachments: external_exports.array(AssetCommentAttachmentSchema).optional()
15332
+ }).refine(hasSingleCommentAuthor, "A comment must have exactly one author");
15333
+ var AssetCommentThreadSchema = external_exports.object({
15334
+ id: external_exports.string().uuid(),
15335
+ assetId: external_exports.string().uuid(),
15336
+ anchor: CommentAnchorSchema.nullable(),
15337
+ isResolved: external_exports.boolean(),
15338
+ ...CommentAuthorSchema.shape,
15339
+ createdAt: external_exports.string().datetime(),
15340
+ updatedAt: external_exports.string().datetime(),
15341
+ comments: external_exports.array(AssetCommentSchema)
15342
+ }).refine(hasSingleCommentAuthor, "A thread must have exactly one author");
15343
+ var commentBody = external_exports.string().min(1).max(1e4);
15344
+ var commentAttachmentAssetIds = external_exports.array(external_exports.string().uuid()).max(MAX_COMMENT_ATTACHMENTS);
15345
+
15346
+ // ../api-contract/src/share/comment-upload.schema.ts
15347
+ var SharedCommentUploadInitSchema = external_exports.object({
15348
+ filename: external_exports.string().trim().min(1).max(255),
15349
+ contentType: external_exports.string().min(1).max(255),
15350
+ sizeInBytes: external_exports.number().int().positive().max(16 * 1024 * 1024 * 1e4)
15351
+ }).strict();
15352
+ var uploadToken = external_exports.string().min(1).max(8192);
15353
+ var SharedCommentUploadInitResponseSchema = external_exports.object({
15354
+ uploadToken,
15355
+ partSize: external_exports.number().int().positive()
15356
+ });
15357
+ var SharedCommentUploadPartSchema = external_exports.object({
15358
+ uploadToken,
15359
+ partNumber: external_exports.number().int().min(1).max(1e4)
15360
+ }).strict();
15361
+ var SharedCommentUploadCompleteSchema = external_exports.object({
15362
+ uploadToken,
15363
+ parts: external_exports.array(CompletedPartSchema).min(1).max(1e4)
15364
+ }).strict();
15365
+ var SharedCommentUploadCompleteResponseSchema = external_exports.object({
15366
+ attachment: AssetCommentAttachmentSchema,
15367
+ uploadToken
15368
+ });
15369
+ var SharedCommentAttachmentsSchema = external_exports.array(
15370
+ external_exports.object({
15371
+ assetId: external_exports.string().uuid(),
15372
+ uploadToken
15373
+ }).strict()
15374
+ ).max(MAX_COMMENT_ATTACHMENTS).refine(
15375
+ (attachments) => new Set(attachments.map((item) => item.assetId)).size === attachments.length,
15376
+ "Attachments must be unique"
15377
+ );
15378
+
15025
15379
  // ../api-contract/src/share/schema.ts
15380
+ var SharedAssetCommentInputSchema = external_exports.object({
15381
+ body: commentBody.trim().min(1),
15382
+ guest: GuestCommentAuthorSchema.optional(),
15383
+ attachments: SharedCommentAttachmentsSchema.optional()
15384
+ }).strict();
15385
+ var SharedCommentAnchorSchema = external_exports.discriminatedUnion("kind", [
15386
+ CommentAnchorSchema.options[0].extend({ timeMs: external_exports.number().finite().nonnegative() }).strict(),
15387
+ CommentAnchorSchema.options[1].omit({ versionId: true }).extend({
15388
+ x: external_exports.number().finite().min(0).max(1),
15389
+ y: external_exports.number().finite().min(0).max(1),
15390
+ timeMs: external_exports.number().finite().nonnegative().optional()
15391
+ }).strict(),
15392
+ CommentAnchorSchema.options[2].omit({ versionId: true }).extend({
15393
+ x: external_exports.number().finite().min(0).max(1),
15394
+ y: external_exports.number().finite().min(0).max(1),
15395
+ w: external_exports.number().finite().positive().max(1),
15396
+ h: external_exports.number().finite().positive().max(1),
15397
+ timeMs: external_exports.number().finite().nonnegative().optional()
15398
+ }).strict()
15399
+ ]);
15400
+ var SharedAssetCommentThreadInputSchema = SharedAssetCommentInputSchema.extend({
15401
+ anchor: SharedCommentAnchorSchema.nullish()
15402
+ });
15403
+ var SharedAssetCommentViewerSchema = external_exports.discriminatedUnion(
15404
+ "authorMode",
15405
+ [
15406
+ external_exports.object({
15407
+ authorMode: external_exports.literal("guest"),
15408
+ canComment: external_exports.literal(true)
15409
+ }),
15410
+ external_exports.object({
15411
+ authorMode: external_exports.literal("member"),
15412
+ canComment: external_exports.boolean(),
15413
+ userId: external_exports.string().uuid(),
15414
+ teamId: external_exports.string().uuid(),
15415
+ role: TeamRoleSchema
15416
+ })
15417
+ ]
15418
+ );
15419
+ var SharedAssetCommentsResponseSchema = external_exports.object({
15420
+ viewer: SharedAssetCommentViewerSchema,
15421
+ data: external_exports.array(AssetCommentThreadSchema)
15422
+ });
15026
15423
  var ShareModeSchema = external_exports.enum(["restricted", "view"]);
15027
15424
  var SharedAssetResponseSchema = external_exports.object({
15028
15425
  id: external_exports.string().uuid(),
@@ -15035,6 +15432,37 @@ var SharedAssetResponseSchema = external_exports.object({
15035
15432
  height: external_exports.number().int().nullable(),
15036
15433
  durationInMs: external_exports.number().int().nullable()
15037
15434
  });
15435
+ var SharedFolderAssetSchema = external_exports.object({
15436
+ id: external_exports.string().uuid(),
15437
+ folderId: external_exports.string().uuid(),
15438
+ filename: external_exports.string(),
15439
+ fileType: FileTypeSchema,
15440
+ contentType: external_exports.string().nullable(),
15441
+ mediaUrl: external_exports.string().url().nullable(),
15442
+ previewUrl: external_exports.string().url().nullable(),
15443
+ width: external_exports.number().int().nullable(),
15444
+ height: external_exports.number().int().nullable(),
15445
+ durationInMs: external_exports.number().int().nullable(),
15446
+ // The three fields the shared grid sorts and filters on, matching what a
15447
+ // `FileCard` carries so the public page renders the same tile and row a
15448
+ // member sees. Optional to support version-skew between web and core
15449
+ // deployments; the viewer treats an absent value as unknown rather than
15450
+ // guessing.
15451
+ source: FileSourceSchema.optional(),
15452
+ fileSizeInKb: external_exports.number().int().nullable().optional(),
15453
+ createdAt: external_exports.string().datetime().nullable().optional()
15454
+ });
15455
+ var SharedFolderChildSchema = external_exports.object({
15456
+ id: external_exports.string().uuid(),
15457
+ parentFolderId: external_exports.string().uuid().nullable(),
15458
+ name: external_exports.string()
15459
+ });
15460
+ var SharedFolderResponseSchema = external_exports.object({
15461
+ id: external_exports.string().uuid(),
15462
+ name: external_exports.string(),
15463
+ folders: external_exports.array(SharedFolderChildSchema),
15464
+ assets: external_exports.array(SharedFolderAssetSchema)
15465
+ });
15038
15466
  var SharedDownloadResponseSchema = external_exports.object({
15039
15467
  url: external_exports.string().url().nullable(),
15040
15468
  text: external_exports.string().nullable(),
@@ -15240,7 +15668,7 @@ var ProjectThumbnailsResponseSchema = external_exports.object({
15240
15668
  });
15241
15669
  var MAX_PROJECT_TITLE_LENGTH = 500;
15242
15670
  var PROJECT_CONFLICT_CODE = {
15243
- nameTaken: "PROJECT_NAME_TAKEN"
15671
+ nameTaken: API_ERROR_CODE.projectNameTaken
15244
15672
  };
15245
15673
  var ProjectConflictResponseSchema = MessageResponseSchema.extend({
15246
15674
  code: external_exports.nativeEnum(PROJECT_CONFLICT_CODE).optional()
@@ -15710,6 +16138,27 @@ var publicTemplateApplyRoute = {
15710
16138
  }
15711
16139
  };
15712
16140
 
16141
+ // ../api-contract/src/media-types.ts
16142
+ var IMAGE_CONTENT_TYPE_BY_EXTENSION = {
16143
+ ".jpg": "image/jpeg",
16144
+ ".jpeg": "image/jpeg",
16145
+ ".png": "image/png",
16146
+ ".webp": "image/webp",
16147
+ ".gif": "image/gif",
16148
+ ".avif": "image/avif",
16149
+ ".svg": "image/svg+xml"
16150
+ };
16151
+ var MAX_DOCUMENT_PDF_FILE_SIZE = 25 * 1024 * 1024;
16152
+ var MAX_DOCUMENT_MARKDOWN_FILE_SIZE = 1 * 1024 * 1024;
16153
+ var UPLOAD_PURPOSES = [
16154
+ "asset",
16155
+ "avatar",
16156
+ "team-photo",
16157
+ "custom-font",
16158
+ "comment-attachment"
16159
+ ];
16160
+ var MAX_FONT_FILE_SIZE_BYTES = 10 * 1024 * 1024;
16161
+
15713
16162
  // ../api-contract/src/upload/schema.ts
15714
16163
  var PdfExtractionModeSchema = external_exports.enum(["summary", "pages"]);
15715
16164
  var InitUploadBodySchema = external_exports.object({
@@ -15717,7 +16166,7 @@ var InitUploadBodySchema = external_exports.object({
15717
16166
  filename: external_exports.string(),
15718
16167
  contentType: external_exports.string(),
15719
16168
  sizeInBytes: external_exports.number().int().positive(),
15720
- purpose: external_exports.enum(["asset", "avatar", "team-photo", "custom-font"]).optional().default("asset")
16169
+ purpose: external_exports.enum(UPLOAD_PURPOSES).optional().default("asset")
15721
16170
  });
15722
16171
  var InitUploadResponseSchema = external_exports.object({
15723
16172
  uploadId: external_exports.string(),
@@ -15734,17 +16183,6 @@ var SignPartBodySchema = external_exports.object({
15734
16183
  var SignPartResponseSchema = external_exports.object({
15735
16184
  url: external_exports.string()
15736
16185
  });
15737
- var CompleteUploadNodePayloadSchema = external_exports.object({
15738
- nodeType: external_exports.string(),
15739
- geometry: external_exports.object({
15740
- x: external_exports.number(),
15741
- y: external_exports.number(),
15742
- w: external_exports.number(),
15743
- h: external_exports.number()
15744
- }),
15745
- title: external_exports.string().optional(),
15746
- createdByUserId: external_exports.string().uuid().optional()
15747
- });
15748
16186
  var CompleteUploadBodySchema = external_exports.object({
15749
16187
  uploadId: external_exports.string(),
15750
16188
  s3Bucket: external_exports.string(),
@@ -15760,8 +16198,8 @@ var CompleteUploadBodySchema = external_exports.object({
15760
16198
  // here lets the server skip a separate ranged S3 GET on complete.
15761
16199
  width: external_exports.number().int().positive().optional(),
15762
16200
  height: external_exports.number().int().positive().optional(),
15763
- // Optional materialization payload — see schema comment above.
15764
- node: CompleteUploadNodePayloadSchema.optional(),
16201
+ // Optional materialization payload — see `NodeMaterializationPayloadSchema`.
16202
+ node: NodeMaterializationPayloadSchema.optional(),
15765
16203
  // url_to_canvas (agent) uploads need the final image URL written into
15766
16204
  // the CRDT so the file node renders immediately when the update arrives
15767
16205
  // over WS. Regular web uploads keep the broadcastPreviewUrls flow.
@@ -15774,7 +16212,10 @@ var CompleteUploadBodySchema = external_exports.object({
15774
16212
  replaceActiveVersion: external_exports.boolean().optional(),
15775
16213
  // PDF-only: how to process the upload once complete. Omitted ⇒ "summary"
15776
16214
  // (the server default and every non-PDF upload). See PdfExtractionModeSchema.
15777
- pdfExtractionMode: PdfExtractionModeSchema.optional()
16215
+ pdfExtractionMode: PdfExtractionModeSchema.optional(),
16216
+ // The same purpose given to `init`. Omitted ⇒ "asset" (old clients). A
16217
+ // `comment-attachment` completes as an asset that stays out of Files.
16218
+ purpose: external_exports.enum(UPLOAD_PURPOSES).optional()
15778
16219
  });
15779
16220
  var CompleteUploadResponseSchema = external_exports.object({
15780
16221
  success: external_exports.boolean(),
@@ -16154,7 +16595,7 @@ function isMajorUpgrade(current, latest) {
16154
16595
  return l[0] > c14[0];
16155
16596
  }
16156
16597
  function shouldShowUpgradeNotice(ctx = {}) {
16157
- const current = ctx.current ?? "0.15.4";
16598
+ const current = ctx.current ?? "0.16.1";
16158
16599
  const latest = ctx.latest ?? serverLatestVersion;
16159
16600
  const env = ctx.env ?? process.env;
16160
16601
  const isTty = ctx.isTty ?? Boolean(process.stderr.isTTY);
@@ -16175,7 +16616,7 @@ Upgrade: npm install -g @melius-ai/cli@latest (or: brew update && brew upgrade
16175
16616
  function printUpgradeNoticeIfNeeded(ctx = {}) {
16176
16617
  try {
16177
16618
  if (!shouldShowUpgradeNotice(ctx)) return;
16178
- const current = ctx.current ?? "0.15.4";
16619
+ const current = ctx.current ?? "0.16.1";
16179
16620
  const latest = ctx.latest ?? serverLatestVersion;
16180
16621
  process.stderr.write(formatUpgradeNotice(current, latest));
16181
16622
  } catch {
@@ -16738,20 +17179,6 @@ function normalizeEdgeId(id, generateId = () => crypto.randomUUID()) {
16738
17179
  return id && UUID_RE.test(id) ? id : generateId();
16739
17180
  }
16740
17181
 
16741
- // ../api-contract/src/media-types.ts
16742
- var IMAGE_CONTENT_TYPE_BY_EXTENSION = {
16743
- ".jpg": "image/jpeg",
16744
- ".jpeg": "image/jpeg",
16745
- ".png": "image/png",
16746
- ".webp": "image/webp",
16747
- ".gif": "image/gif",
16748
- ".avif": "image/avif",
16749
- ".svg": "image/svg+xml"
16750
- };
16751
- var MAX_DOCUMENT_PDF_FILE_SIZE = 25 * 1024 * 1024;
16752
- var MAX_DOCUMENT_MARKDOWN_FILE_SIZE = 1 * 1024 * 1024;
16753
- var MAX_FONT_FILE_SIZE_BYTES = 10 * 1024 * 1024;
16754
-
16755
17182
  // ../api-contract/src/canvas-layout.ts
16756
17183
  function computePresetLayout(preset, center) {
16757
17184
  const presetGroups = preset.nodes.filter((n) => n.type === "group");
@@ -17378,7 +17805,7 @@ function resolveNodeIds2(canvasId, nodeIds) {
17378
17805
  }
17379
17806
 
17380
17807
  // src/lib/validation.ts
17381
- function validateModelConfig(model, variant) {
17808
+ function validateModelConfig(model, variant, tier) {
17382
17809
  if (model === FISH_AUDIO_MODEL) {
17383
17810
  writeError(
17384
17811
  formatError(
@@ -17391,7 +17818,19 @@ function validateModelConfig(model, variant) {
17391
17818
  EXIT_USAGE_ERROR
17392
17819
  );
17393
17820
  }
17394
- if (model && variant) return { model, variant };
17821
+ if (model && variant) return { model, variant, ...tier && { tier } };
17822
+ if (tier) {
17823
+ writeError(
17824
+ formatError(
17825
+ "USAGE_ERROR",
17826
+ "--tier requires --model and --variant",
17827
+ {
17828
+ suggestion: "A tier names a speed of one model+variant. Run: mel model list to find the variant's tier, then pass --model <model> --variant <variant> --tier <tier>"
17829
+ }
17830
+ ),
17831
+ EXIT_USAGE_ERROR
17832
+ );
17833
+ }
17395
17834
  if (!model && !variant) return void 0;
17396
17835
  writeError(
17397
17836
  formatError(
@@ -17442,7 +17881,10 @@ function parseClipOrder(value) {
17442
17881
  return clipOrder.length > 0 ? clipOrder : void 0;
17443
17882
  }
17444
17883
  function addNodeOptions(cmd) {
17445
- return cmd.option("--id <uuid>", "Node ID (auto-generated if omitted)").option("--title <title>", "Node title").option("--x <number>", "X position").option("--y <number>", "Y position").option("--w <number>", "Width").option("--h <number>", "Height").option("--z-index <number>", "Z-index").option("--group-id <uuid>", "Parent group ID").option("--model <model>", "Model name (requires --variant)").option("--variant <variant>", "Model variant (requires --model)").option("--prompt <text>", "Text prompt").option(
17884
+ return cmd.option("--id <uuid>", "Node ID (auto-generated if omitted)").option("--title <title>", "Node title").option("--x <number>", "X position").option("--y <number>", "Y position").option("--w <number>", "Width").option("--h <number>", "Height").option("--z-index <number>", "Z-index").option("--group-id <uuid>", "Parent group ID").option("--model <model>", "Model name (requires --variant)").option("--variant <variant>", "Model variant (requires --model)").option(
17885
+ "--tier <tier>",
17886
+ "Speed tier of that model+variant (e.g. fast, pro, turbo; requires --model and --variant). Omit for the model's standard speed. Use mel model list to see each variant's tier"
17887
+ ).option("--prompt <text>", "Text prompt").option(
17446
17888
  "--content <text>",
17447
17889
  "Literal text content for custom_text nodes"
17448
17890
  ).option("--aspect-ratio <ratio>", "Output aspect ratio").option(
@@ -17514,6 +17956,7 @@ Examples:
17514
17956
  $ mel node create <canvasId> --type stitch --clip-order <video1>,<video2> --scale-fit stretch
17515
17957
  $ mel node create <canvasId> --type text --x 100 --y 200 --title "My node"
17516
17958
  $ mel node create <canvasId> --type image --model flux-pro --variant text-to-image
17959
+ $ mel node create <canvasId> --type video --model wan-3.0 --variant text-to-video --tier fast
17517
17960
  $ mel node create <canvasId> --type file --src https://cdn.example.com/photo.jpg --media-type image --s3-key assets/photo.jpg --s3-bucket <bucket> --content-type image/jpeg --title "Source"
17518
17961
  $ mel node create <canvasId> --type audio --model eleven_v3 --variant text-to-speech --prompt "Hello there" --voice-id <voiceId>
17519
17962
  $ mel node create <canvasId> --type audio --model elevenlabs-sfx --variant text-to-sfx --prompt "Thunder crack" --duration 10
@@ -17522,7 +17965,11 @@ Examples:
17522
17965
  ).action(async (canvasId, opts) => {
17523
17966
  const client = getClient();
17524
17967
  const id = opts.id ?? crypto.randomUUID();
17525
- const modelConfig = validateModelConfig(opts.model, opts.variant);
17968
+ const modelConfig = validateModelConfig(
17969
+ opts.model,
17970
+ opts.variant,
17971
+ opts.tier
17972
+ );
17526
17973
  const geometry = buildGeometry(opts.type, opts);
17527
17974
  const clipOrder = parseClipOrder(opts.clipOrder);
17528
17975
  const result = await client.node.create({
@@ -17612,7 +18059,8 @@ Examples:
17612
18059
  const client = getClient();
17613
18060
  const modelConfig = validateModelConfig(
17614
18061
  opts.model,
17615
- opts.variant
18062
+ opts.variant,
18063
+ opts.tier
17616
18064
  );
17617
18065
  const clipOrder = parseClipOrder(opts.clipOrder);
17618
18066
  const geoProvided = [opts.x, opts.y, opts.w, opts.h].filter(
@@ -17700,7 +18148,7 @@ Examples:
17700
18148
  "Canvas ID (from mel canvas create or mel canvas list)"
17701
18149
  ).option(
17702
18150
  "--json <json>",
17703
- 'JSON array of node objects OR {"nodes":[...],"edges":[...]} object, or "-" to read from stdin. Each node object: { type, title?, x?, y?, w?, h?, prompt?, text?, aspectRatio?, duration?, model?, variant?, groupId?, id?, seed?, voiceId?, negativePrompt?, clipOrder?, scaleFit?, src?, mediaType?, s3Key?, s3Bucket?, contentType?, sourceNodeId? }'
18151
+ 'JSON array of node objects OR {"nodes":[...],"edges":[...]} object, or "-" to read from stdin. Each node object: { type, title?, x?, y?, w?, h?, prompt?, text?, aspectRatio?, duration?, model?, variant?, tier?, groupId?, id?, seed?, voiceId?, negativePrompt?, clipOrder?, scaleFit?, src?, mediaType?, s3Key?, s3Bucket?, contentType?, sourceNodeId? }'
17704
18152
  ).option(
17705
18153
  "--edges <json>",
17706
18154
  'JSON array of edge objects: [{"src":"a","dst":"b","type":"text"}]. Merged with any edges in the JSON body'
@@ -17881,7 +18329,8 @@ Valid node types: text, image, video, audio, file, group, custom_text, stitch.
17881
18329
  const autoGeo = item.id ? autoPositions[item.id] : void 0;
17882
18330
  const modelConfig = validateModelConfig(
17883
18331
  item.model,
17884
- item.variant
18332
+ item.variant,
18333
+ item.tier
17885
18334
  );
17886
18335
  return {
17887
18336
  id,
@@ -18660,6 +19109,9 @@ function registerRunCommands(program2, getOutputOpts) {
18660
19109
  ).option(
18661
19110
  "--variant <variant>",
18662
19111
  "Model variant (requires --model). e.g. text-to-image, image-to-image"
19112
+ ).option(
19113
+ "--tier <tier>",
19114
+ "Speed tier of that model+variant (e.g. fast, pro, turbo; requires --model and --variant). Omit for the model's standard speed. Use mel model list to see each variant's tier"
18663
19115
  ).option(
18664
19116
  "--aspect-ratio <ratio>",
18665
19117
  "Output aspect ratio: 21:9, 16:9, 4:3, 3:2, 1:1, 2:3, 3:4, 9:16, 9:21"
@@ -18699,6 +19151,7 @@ Examples:
18699
19151
  $ mel run start <nodeId> --canvas-id <canvasId>
18700
19152
  $ mel run start <nodeId> --canvas-id <canvasId> --prompt "A sunset over the ocean"
18701
19153
  $ mel run start <nodeId> --canvas-id <canvasId> --variations 3
19154
+ $ mel run start <nodeId> --canvas-id <canvasId> --model wan-3.0 --variant text-to-video --tier fast
18702
19155
  $ mel run start <audioNodeId> --canvas-id <canvasId> --voice-id <voiceId>
18703
19156
  $ mel run start <audioNodeId> --canvas-id <canvasId> --duration 10`
18704
19157
  ).action(
@@ -18706,7 +19159,8 @@ Examples:
18706
19159
  const client = getClient();
18707
19160
  const modelConfig = validateModelConfig(
18708
19161
  opts.model,
18709
- opts.variant
19162
+ opts.variant,
19163
+ opts.tier
18710
19164
  );
18711
19165
  const canvasNodeIds = await loadCanvasNodeIds(
18712
19166
  client,
@@ -20183,8 +20637,10 @@ function registerUploadCommands(program2, getOutputOpts) {
20183
20637
  Returns: { assetId, s3Bucket, s3Key, url } \u2014 the uploaded asset metadata and presigned URL.
20184
20638
  Supported formats: PNG, JPEG, GIF, WebP, AVIF.
20185
20639
 
20186
- Use the returned url as --src when creating a file node, or pass --node-id to associate
20187
- the upload directly with an existing node.
20640
+ Without --node-id, the image is uploaded as a standalone asset in the team's Files/DAM
20641
+ library. To put it on a canvas, create a file node first and pass --node-id and
20642
+ --canvas-id; do not feed the returned url to --src unless you also provide the internal
20643
+ s3Key, s3Bucket, and contentType fields.
20188
20644
 
20189
20645
  Examples:
20190
20646
  $ mel upload ./photo.png
@@ -20507,7 +20963,7 @@ function withDefaultHelp(args) {
20507
20963
  }
20508
20964
  function createProgram() {
20509
20965
  const program2 = new Command();
20510
- program2.name("mel").description("Mel \u2014 Melius agent CLI").version("0.15.4").showSuggestionAfterError(true).option("--json", "Force JSON output (default)").option("--text", "Human-readable output").option(
20966
+ program2.name("mel").description("Mel \u2014 Melius agent CLI").version("0.16.1").showSuggestionAfterError(true).option("--json", "Force JSON output (default)").option("--text", "Human-readable output").option(
20511
20967
  "--fields <fields>",
20512
20968
  "Select specific output fields (comma-separated)"
20513
20969
  ).option("--quiet", "Suppress output, exit code only").option("--verbose", "Log request/response metadata to stderr").addHelpText(
package/dist/src/index.js CHANGED
@@ -2,7 +2,7 @@ import { createRequire } from 'node:module'; const require = createRequire(impor
2
2
  import {
3
3
  createProgram,
4
4
  withDefaultHelp
5
- } from "../chunk-LAHVPP66.js";
5
+ } from "../chunk-II5TPJQQ.js";
6
6
  export {
7
7
  createProgram,
8
8
  withDefaultHelp
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@melius-ai/cli",
3
- "version": "0.15.4",
3
+ "version": "0.16.1",
4
4
  "description": "The Melius command-line interface — create canvases and run AI image/video generations from your terminal",
5
5
  "keywords": [
6
6
  "ai",