@melius-ai/cli 0.9.0 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bin/mel.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  printUpgradeNoticeIfNeeded,
8
8
  withDefaultHelp,
9
9
  writeError
10
- } from "../chunk-24FW76XZ.js";
10
+ } from "../chunk-WRLYKNYI.js";
11
11
 
12
12
  // bin/mel.ts
13
13
  var program = createProgram();
@@ -9797,6 +9797,20 @@ function parseCustomResolution(resolution) {
9797
9797
  return { width, height };
9798
9798
  }
9799
9799
  var MENTION_RE = /@\[([^\]]+)\](?:\{([^}]+)\})?/g;
9800
+ var MENTION_WITH_ID_RE = /@\[[^\]]+\]\{([^}]+)\}/g;
9801
+ function extractMentionedNodeIds(text) {
9802
+ if (!text) return [];
9803
+ const ids = [];
9804
+ const seen = /* @__PURE__ */ new Set();
9805
+ for (const match of text.matchAll(MENTION_WITH_ID_RE)) {
9806
+ const id = match[1];
9807
+ if (!seen.has(id)) {
9808
+ seen.add(id);
9809
+ ids.push(id);
9810
+ }
9811
+ }
9812
+ return ids;
9813
+ }
9800
9814
  var MAGIC_RESIZE_NODE_WIDTH = 500;
9801
9815
  var MAGIC_RESIZE_PREGEN_HEIGHT = 550;
9802
9816
 
@@ -10012,6 +10026,19 @@ var ElevenLabsVoiceSettingsSchema = external_exports.object({
10012
10026
  outputFormat: ElevenLabsOutputFormatSchema.optional()
10013
10027
  });
10014
10028
 
10029
+ // ../api-contract/src/generation-failure-reason.ts
10030
+ var GENERATION_FAILURE_REASONS = [
10031
+ "insufficient_credits",
10032
+ "content_policy",
10033
+ "no_media_generated",
10034
+ "provider_error",
10035
+ "validation_error",
10036
+ "timeout",
10037
+ "system",
10038
+ "unknown"
10039
+ ];
10040
+ var GenerationFailureReasonSchema = external_exports.enum(GENERATION_FAILURE_REASONS);
10041
+
10015
10042
  // ../api-contract/src/lora.ts
10016
10043
  var c6 = initContract();
10017
10044
  var LORA_UPLOAD_PART_SIZE_BYTES = 16 * 1024 * 1024;
@@ -10897,6 +10924,7 @@ var NodeRunResponseSchema = external_exports.object({
10897
10924
  errorMessage: external_exports.string().nullable(),
10898
10925
  errorSeverity: ErrorSeveritySchema.nullable().default(null),
10899
10926
  errorRetryable: external_exports.boolean().nullable().optional(),
10927
+ errorReason: GenerationFailureReasonSchema.nullable().optional(),
10900
10928
  numVariationsRequested: external_exports.number().int().nullable(),
10901
10929
  numVariationsCompleted: external_exports.number().int().nullable().optional(),
10902
10930
  numVariationsFailed: external_exports.number().int().nullable().optional(),
@@ -10951,6 +10979,7 @@ var LatestNodeRunResponseSchema = external_exports.object({
10951
10979
  errorMessage: external_exports.string().nullable(),
10952
10980
  errorSeverity: ErrorSeveritySchema.nullable().default(null),
10953
10981
  errorRetryable: external_exports.boolean().nullable().optional(),
10982
+ errorReason: GenerationFailureReasonSchema.nullable().optional(),
10954
10983
  numVariationsRequested: external_exports.number().int().nullable(),
10955
10984
  numVariationsCompleted: external_exports.number().int().nullable().optional(),
10956
10985
  numVariationsFailed: external_exports.number().int().nullable().optional(),
@@ -14220,7 +14249,7 @@ function isMajorUpgrade(current, latest) {
14220
14249
  return l[0] > c17[0];
14221
14250
  }
14222
14251
  function shouldShowUpgradeNotice(ctx = {}) {
14223
- const current = ctx.current ?? "0.9.0";
14252
+ const current = ctx.current ?? "0.9.1";
14224
14253
  const latest = ctx.latest ?? serverLatestVersion;
14225
14254
  const env = ctx.env ?? process.env;
14226
14255
  const isTty = ctx.isTty ?? Boolean(process.stderr.isTTY);
@@ -14241,7 +14270,7 @@ Upgrade: npm install -g @melius-ai/cli@latest (or: brew update && brew upgrade
14241
14270
  function printUpgradeNoticeIfNeeded(ctx = {}) {
14242
14271
  try {
14243
14272
  if (!shouldShowUpgradeNotice(ctx)) return;
14244
- const current = ctx.current ?? "0.9.0";
14273
+ const current = ctx.current ?? "0.9.1";
14245
14274
  const latest = ctx.latest ?? serverLatestVersion;
14246
14275
  process.stderr.write(formatUpgradeNotice(current, latest));
14247
14276
  } catch {
@@ -15498,11 +15527,36 @@ function planLayout(content, planned, edges, anchorNodeIds) {
15498
15527
  srcNodeId: e.srcNodeId,
15499
15528
  dstNodeId: e.dstNodeId
15500
15529
  }));
15530
+ const canvasNodeIds = new Set(content.nodes.map((n) => n.id));
15531
+ const mentionEdges = [];
15532
+ let mentionEdgeIndex = 0;
15533
+ for (const p of planned) {
15534
+ const mentionIds = /* @__PURE__ */ new Set([
15535
+ ...extractMentionedNodeIds(p.prompt),
15536
+ ...extractMentionedNodeIds(p.text)
15537
+ ]);
15538
+ for (const mentionedId of mentionIds) {
15539
+ let srcId;
15540
+ if (virtualIds.has(mentionedId)) {
15541
+ srcId = mentionedId;
15542
+ } else if (canvasNodeIds.has(mentionedId)) {
15543
+ const node = nodeById.get(mentionedId);
15544
+ srcId = node?.groupId ?? mentionedId;
15545
+ }
15546
+ if (!srcId || srcId === p.id) continue;
15547
+ mentionEdges.push({
15548
+ id: `mention-${mentionEdgeIndex++}`,
15549
+ srcNodeId: srcId,
15550
+ dstNodeId: p.id
15551
+ });
15552
+ }
15553
+ }
15501
15554
  const anchorEdges = [];
15502
15555
  if (anchorNodes && anchorNodes.length > 0) {
15503
15556
  const hasExplicitAnchorEdge = [
15504
15557
  ...plannedEdges,
15505
- ...relevantExisting
15558
+ ...relevantExisting,
15559
+ ...mentionEdges
15506
15560
  ].some(
15507
15561
  (e) => anchorNodeIds.includes(e.srcNodeId) && virtualIds.has(e.dstNodeId)
15508
15562
  );
@@ -15518,7 +15572,17 @@ function planLayout(content, planned, edges, anchorNodeIds) {
15518
15572
  }
15519
15573
  }
15520
15574
  }
15521
- const allEdges = [...plannedEdges, ...relevantExisting, ...anchorEdges];
15575
+ const baseEdges = [...plannedEdges, ...relevantExisting, ...anchorEdges];
15576
+ const baseEdgeKeys = new Set(
15577
+ baseEdges.map((e) => `${e.srcNodeId}->${e.dstNodeId}`)
15578
+ );
15579
+ const uniqueMentionEdges = mentionEdges.filter((e) => {
15580
+ const key = `${e.srcNodeId}->${e.dstNodeId}`;
15581
+ if (baseEdgeKeys.has(key)) return false;
15582
+ baseEdgeKeys.add(key);
15583
+ return true;
15584
+ });
15585
+ const allEdges = [...baseEdges, ...uniqueMentionEdges];
15522
15586
  const allNodes = [...existingNodes, ...virtualNodes];
15523
15587
  const virtualIdsArr = [...virtualIds];
15524
15588
  const rawResult = computeAutoformat(allNodes, allEdges, virtualIdsArr);
@@ -16733,7 +16797,9 @@ Valid node types: text, image, video, audio, file, group, custom_text, stitch.
16733
16797
  const planned = itemsWithoutGeometry.map((item) => ({
16734
16798
  id: item.id ?? item.type,
16735
16799
  nodeType: item.type,
16736
- aspectRatio: item.aspectRatio
16800
+ aspectRatio: item.aspectRatio,
16801
+ prompt: item.prompt,
16802
+ text: item.text
16737
16803
  }));
16738
16804
  const plannedIds = new Set(planned.map((p) => p.id));
16739
16805
  const edges = (edgeItems ?? []).filter(
@@ -19205,7 +19271,7 @@ function withDefaultHelp(args) {
19205
19271
  }
19206
19272
  function createProgram() {
19207
19273
  const program2 = new Command();
19208
- program2.name("mel").description("Mel \u2014 Melius agent CLI").version("0.9.0").showSuggestionAfterError(true).option("--json", "Force JSON output (default)").option("--text", "Human-readable output").option(
19274
+ program2.name("mel").description("Mel \u2014 Melius agent CLI").version("0.9.1").showSuggestionAfterError(true).option("--json", "Force JSON output (default)").option("--text", "Human-readable output").option(
19209
19275
  "--fields <fields>",
19210
19276
  "Select specific output fields (comma-separated)"
19211
19277
  ).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-24FW76XZ.js";
5
+ } from "../chunk-WRLYKNYI.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.9.0",
3
+ "version": "0.9.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",