@markus-global/cli 0.10.0 → 0.10.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.
Files changed (64) hide show
  1. package/dist/markus.mjs +254 -36
  2. package/dist/web-ui/assets/{CommentInput-BqMnooel.js → CommentInput-C3h-Yzay.js} +1 -1
  3. package/dist/web-ui/assets/{ContentRenderer-DL45IlDu.js → ContentRenderer-zASgOqkn.js} +2 -2
  4. package/dist/web-ui/assets/{DeliverableShareModal-2BWwrD0B.js → DeliverableShareModal-Dbnn1New.js} +1 -1
  5. package/dist/web-ui/assets/{Deliverables-ZRYTt61i.js → Deliverables-DJAIrKO-.js} +1 -1
  6. package/dist/web-ui/assets/{Notifications-DTWB_mkr.js → Notifications-Yg4YtKfK.js} +1 -1
  7. package/dist/web-ui/assets/{Search-CJotdd_7.js → Search-BxrbCVbt.js} +1 -1
  8. package/dist/web-ui/assets/{Settings-hOETMz7R.js → Settings-D3Sk4wo8.js} +3 -3
  9. package/dist/web-ui/assets/{Store-BA0EkZGV.js → Store-_qnw3ukN.js} +1 -1
  10. package/dist/web-ui/assets/{Team-D2FwZz_o.js → Team-DJ1rMsS3.js} +38 -38
  11. package/dist/web-ui/assets/{Work-DJOaN4GX.js → Work-CB0n0sCV.js} +1 -1
  12. package/dist/web-ui/assets/{arc-DHkGrr0f.js → arc-BjnJOOw9.js} +1 -1
  13. package/dist/web-ui/assets/{architectureDiagram-3BPJPVTR-SV9bE7r9.js → architectureDiagram-3BPJPVTR-CNCZskCC.js} +1 -1
  14. package/dist/web-ui/assets/{blockDiagram-GPEHLZMM-Bb1vRq1C.js → blockDiagram-GPEHLZMM-tvgynQ_P.js} +1 -1
  15. package/dist/web-ui/assets/{c4Diagram-AAUBKEIU-tcZyAXyl.js → c4Diagram-AAUBKEIU-VjR6PhyJ.js} +1 -1
  16. package/dist/web-ui/assets/channel-CmOq1ZYv.js +1 -0
  17. package/dist/web-ui/assets/{chunk-2J33WTMH-CJwLLa3C.js → chunk-2J33WTMH-ZF0vS7Am.js} +1 -1
  18. package/dist/web-ui/assets/{chunk-4BX2VUAB-BOtdLqQJ.js → chunk-4BX2VUAB-DIc3vKk2.js} +1 -1
  19. package/dist/web-ui/assets/{chunk-55IACEB6-NQr5uRBA.js → chunk-55IACEB6-DaYrbGjR.js} +1 -1
  20. package/dist/web-ui/assets/{chunk-727SXJPM-B5zAoAuj.js → chunk-727SXJPM-CLEluTgG.js} +1 -1
  21. package/dist/web-ui/assets/{chunk-AQP2D5EJ-D6ckRpUW.js → chunk-AQP2D5EJ-CvnOAGKW.js} +1 -1
  22. package/dist/web-ui/assets/{chunk-FMBD7UC4-uWIbAJn7.js → chunk-FMBD7UC4-B-08R9l2.js} +1 -1
  23. package/dist/web-ui/assets/{chunk-ND2GUHAM-DRoYVcWH.js → chunk-ND2GUHAM-KSpUjU1U.js} +1 -1
  24. package/dist/web-ui/assets/{chunk-QZHKN3VN-TwjLbnMx.js → chunk-QZHKN3VN-d3Lb3-2g.js} +1 -1
  25. package/dist/web-ui/assets/classDiagram-4FO5ZUOK-DzFj83Mn.js +1 -0
  26. package/dist/web-ui/assets/classDiagram-v2-Q7XG4LA2-DzFj83Mn.js +1 -0
  27. package/dist/web-ui/assets/{cose-bilkent-S5V4N54A-BfQ_0liP.js → cose-bilkent-S5V4N54A-DfhCvOY4.js} +1 -1
  28. package/dist/web-ui/assets/{dagre-BM42HDAG-CU3dMbrI.js → dagre-BM42HDAG-DsnRWNK6.js} +1 -1
  29. package/dist/web-ui/assets/{diagram-2AECGRRQ-DYleVZiW.js → diagram-2AECGRRQ-BWQQTl0l.js} +1 -1
  30. package/dist/web-ui/assets/{diagram-5GNKFQAL-DykVmK0r.js → diagram-5GNKFQAL-CBk0iWkF.js} +1 -1
  31. package/dist/web-ui/assets/{diagram-KO2AKTUF-BIlHPMdB.js → diagram-KO2AKTUF-DzzA482R.js} +1 -1
  32. package/dist/web-ui/assets/{diagram-LMA3HP47-D70tKzYv.js → diagram-LMA3HP47-D2kcYGlo.js} +1 -1
  33. package/dist/web-ui/assets/{diagram-OG6HWLK6-CV2Nu6ik.js → diagram-OG6HWLK6-AbGNmLXr.js} +1 -1
  34. package/dist/web-ui/assets/{docx-preview-DL_6q0h-.js → docx-preview--1ncczOI.js} +1 -1
  35. package/dist/web-ui/assets/{erDiagram-TEJ5UH35-Dzq3Vw8P.js → erDiagram-TEJ5UH35-CBFv7tRL.js} +1 -1
  36. package/dist/web-ui/assets/{flowDiagram-I6XJVG4X-DGkcoQ60.js → flowDiagram-I6XJVG4X-DpXrThuu.js} +1 -1
  37. package/dist/web-ui/assets/{ganttDiagram-6RSMTGT7-BLQ3H0r3.js → ganttDiagram-6RSMTGT7-CupAuc9R.js} +1 -1
  38. package/dist/web-ui/assets/{gitGraphDiagram-PVQCEYII-DUmAstFU.js → gitGraphDiagram-PVQCEYII-BJCAOb-p.js} +1 -1
  39. package/dist/web-ui/assets/{index-B6fl84HP.js → index-BhgfBFXX.js} +8 -8
  40. package/dist/web-ui/assets/{infoDiagram-5YYISTIA-CsXOZLwT.js → infoDiagram-5YYISTIA-DaNJu9kK.js} +1 -1
  41. package/dist/web-ui/assets/{ishikawaDiagram-YF4QCWOH-FxKhYmDc.js → ishikawaDiagram-YF4QCWOH-BmgExWtv.js} +1 -1
  42. package/dist/web-ui/assets/{journeyDiagram-JHISSGLW-BlhEY13x.js → journeyDiagram-JHISSGLW-BGNYie65.js} +1 -1
  43. package/dist/web-ui/assets/{kanban-definition-UN3LZRKU-CBPhJXrD.js → kanban-definition-UN3LZRKU-BFJ79pHV.js} +1 -1
  44. package/dist/web-ui/assets/{mermaid.core-DHGX5lHc.js → mermaid.core-Des6lIh7.js} +5 -5
  45. package/dist/web-ui/assets/{mindmap-definition-RKZ34NQL-DBuFrFuP.js → mindmap-definition-RKZ34NQL-Dh8lPNzf.js} +1 -1
  46. package/dist/web-ui/assets/modelCapabilities-DDtCBZ6o.js +1 -0
  47. package/dist/web-ui/assets/{pieDiagram-4H26LBE5-mWrxRhxJ.js → pieDiagram-4H26LBE5-D00jFAPE.js} +1 -1
  48. package/dist/web-ui/assets/{quadrantDiagram-W4KKPZXB-JFaiGibg.js → quadrantDiagram-W4KKPZXB-Bb76wY4G.js} +1 -1
  49. package/dist/web-ui/assets/{requirementDiagram-4Y6WPE33-CVHcioJN.js → requirementDiagram-4Y6WPE33-Bp_uC7mF.js} +1 -1
  50. package/dist/web-ui/assets/{sankeyDiagram-5OEKKPKP-BI8QYkQZ.js → sankeyDiagram-5OEKKPKP-f9suZ_m2.js} +1 -1
  51. package/dist/web-ui/assets/{sequenceDiagram-3UESZ5HK-DloeuaaF.js → sequenceDiagram-3UESZ5HK-CdbTYw2a.js} +1 -1
  52. package/dist/web-ui/assets/{stateDiagram-AJRCARHV-u1GtjbZs.js → stateDiagram-AJRCARHV-CcK2OMSf.js} +1 -1
  53. package/dist/web-ui/assets/stateDiagram-v2-BHNVJYJU-0jXPoaYs.js +1 -0
  54. package/dist/web-ui/assets/{timeline-definition-PNZ67QCA-CbhjCcpj.js → timeline-definition-PNZ67QCA-CXP-5wIX.js} +1 -1
  55. package/dist/web-ui/assets/{vennDiagram-CIIHVFJN-CUKEb9oX.js → vennDiagram-CIIHVFJN-DpIWugKQ.js} +1 -1
  56. package/dist/web-ui/assets/{wardley-L42UT6IY-D64zeLnz.js → wardley-L42UT6IY-BLjAic-S.js} +1 -1
  57. package/dist/web-ui/assets/{wardleyDiagram-YWT4CUSO-BpbJymuq.js → wardleyDiagram-YWT4CUSO-B1M1hx57.js} +1 -1
  58. package/dist/web-ui/assets/{xychartDiagram-2RQKCTM6-Dt54kL4V.js → xychartDiagram-2RQKCTM6-a4RO5hTM.js} +1 -1
  59. package/dist/web-ui/index.html +1 -1
  60. package/package.json +1 -1
  61. package/dist/web-ui/assets/channel-N52kezHF.js +0 -1
  62. package/dist/web-ui/assets/classDiagram-4FO5ZUOK-XkibfmWR.js +0 -1
  63. package/dist/web-ui/assets/classDiagram-v2-Q7XG4LA2-XkibfmWR.js +0 -1
  64. package/dist/web-ui/assets/stateDiagram-v2-BHNVJYJU-DligGfEm.js +0 -1
package/dist/markus.mjs CHANGED
@@ -203448,7 +203448,11 @@ function createSettingsTools(ctx) {
203448
203448
  maxOutputTokens: m.maxOutputTokens,
203449
203449
  cost: m.cost,
203450
203450
  reasoning: m.reasoning,
203451
- vision: m.inputTypes?.includes("image")
203451
+ vision: m.inputTypes?.includes("image"),
203452
+ // Explicit capability declaration (imageGeneration/tts/stt/…).
203453
+ // Lets agents see at a glance which non-chat models a provider
203454
+ // can actually serve — no id-guessing needed.
203455
+ capabilities: m.capabilities ?? []
203452
203456
  })) ?? []
203453
203457
  };
203454
203458
  });
@@ -203569,6 +203573,26 @@ function createSettingsTools(ctx) {
203569
203573
  model: {
203570
203574
  type: "string",
203571
203575
  description: 'Default model ID (e.g. "deepseek-v4-flash")'
203576
+ },
203577
+ image_generation_timeout_ms: {
203578
+ type: "number",
203579
+ description: "Optional timeout in ms for image generation calls (default 600000 = 10min; raise for very slow local/self-hosted servers)"
203580
+ },
203581
+ tts_timeout_ms: {
203582
+ type: "number",
203583
+ description: "Optional timeout in ms for text-to-speech calls (default 600000 = 10min)"
203584
+ },
203585
+ stt_timeout_ms: {
203586
+ type: "number",
203587
+ description: "Optional timeout in ms for speech-to-text calls (default 600000 = 10min)"
203588
+ },
203589
+ video_generation_timeout_ms: {
203590
+ type: "number",
203591
+ description: "Optional timeout in ms for video generation calls (default 600000 = 10min)"
203592
+ },
203593
+ decision_timeout_ms: {
203594
+ type: "number",
203595
+ description: "Optional timeout in ms for decision calls (default 60000)"
203572
203596
  }
203573
203597
  },
203574
203598
  required: ["name", "model"]
@@ -203578,12 +203602,14 @@ function createSettingsTools(ctx) {
203578
203602
  const apiKey = args["api_key"];
203579
203603
  const baseUrl = args["base_url"];
203580
203604
  const model = args["model"];
203605
+ const mediaTimeouts = pickMediaTimeoutFields(args);
203581
203606
  try {
203582
203607
  ctx.llmRouter.registerProviderFromConfig(name, {
203583
203608
  provider: name,
203584
203609
  model,
203585
203610
  apiKey,
203586
- baseUrl
203611
+ baseUrl,
203612
+ ...mediaTimeouts
203587
203613
  });
203588
203614
  if (ctx.persistConfig) {
203589
203615
  try {
@@ -203594,6 +203620,7 @@ function createSettingsTools(ctx) {
203594
203620
  ...apiKey ? { apiKey } : {},
203595
203621
  model,
203596
203622
  ...baseUrl ? { baseUrl } : {},
203623
+ ...mediaTimeouts,
203597
203624
  enabled: true
203598
203625
  }
203599
203626
  }
@@ -203635,6 +203662,26 @@ function createSettingsTools(ctx) {
203635
203662
  model: {
203636
203663
  type: "string",
203637
203664
  description: "New model ID (optional)"
203665
+ },
203666
+ image_generation_timeout_ms: {
203667
+ type: "number",
203668
+ description: "Optional timeout in ms for image generation calls (default 600000 = 10min)"
203669
+ },
203670
+ tts_timeout_ms: {
203671
+ type: "number",
203672
+ description: "Optional timeout in ms for text-to-speech calls (default 600000 = 10min)"
203673
+ },
203674
+ stt_timeout_ms: {
203675
+ type: "number",
203676
+ description: "Optional timeout in ms for speech-to-text calls (default 600000 = 10min)"
203677
+ },
203678
+ video_generation_timeout_ms: {
203679
+ type: "number",
203680
+ description: "Optional timeout in ms for video generation calls (default 600000 = 10min)"
203681
+ },
203682
+ decision_timeout_ms: {
203683
+ type: "number",
203684
+ description: "Optional timeout in ms for decision calls (default 60000)"
203638
203685
  }
203639
203686
  },
203640
203687
  required: ["provider"]
@@ -203644,6 +203691,7 @@ function createSettingsTools(ctx) {
203644
203691
  const apiKey = args["api_key"];
203645
203692
  const baseUrl = args["base_url"];
203646
203693
  const model = args["model"];
203694
+ const mediaTimeouts = pickMediaTimeoutFields(args);
203647
203695
  try {
203648
203696
  const provider = ctx.llmRouter.getProvider(providerName);
203649
203697
  if (!provider) {
@@ -203656,6 +203704,7 @@ function createSettingsTools(ctx) {
203656
203704
  configUpdate.apiKey = apiKey;
203657
203705
  if (baseUrl !== void 0)
203658
203706
  configUpdate.baseUrl = baseUrl;
203707
+ Object.assign(configUpdate, mediaTimeouts);
203659
203708
  provider.configure(configUpdate);
203660
203709
  if (ctx.persistConfig) {
203661
203710
  try {
@@ -203666,6 +203715,7 @@ function createSettingsTools(ctx) {
203666
203715
  updates.model = model;
203667
203716
  if (baseUrl !== void 0)
203668
203717
  updates.baseUrl = baseUrl || void 0;
203718
+ Object.assign(updates, mediaTimeouts);
203669
203719
  ctx.persistConfig({ llm: { providers: { [providerName]: updates } } });
203670
203720
  } catch (e) {
203671
203721
  log29.warn("Failed to persist provider edit", { error: String(e) });
@@ -203722,12 +203772,21 @@ function createSettingsTools(ctx) {
203722
203772
  vision: {
203723
203773
  type: "boolean",
203724
203774
  description: "Whether the model supports image input (optional)"
203775
+ },
203776
+ capabilities: {
203777
+ type: "array",
203778
+ items: {
203779
+ type: "string",
203780
+ enum: ["chat", "imageGeneration", "vision", "tts", "stt", "videoGeneration", "decision"]
203781
+ },
203782
+ description: 'Explicit capability declaration for this model (OPTIONAL but recommended for non-chat models). Values: imageGeneration (text-to-image), vision (image input), tts, stt, videoGeneration, decision, chat. When declared, capability routing trusts this list instead of guessing from the model id \u2014 use this for local/self-hosted models (Ollama, vLLM, diffusers servers) whose names do not match known commercial naming patterns. Add "chat" when the model ALSO serves /chat/completions (e.g. ["imageGeneration","chat"]): declaring it keeps the model in the chat pickers and text routing, which a media-only declaration otherwise removes it from.'
203725
203783
  }
203726
203784
  },
203727
203785
  required: ["provider", "id", "name", "context_window", "max_output_tokens", "cost_input", "cost_output"]
203728
203786
  },
203729
203787
  async execute(args) {
203730
203788
  const providerName = args["provider"];
203789
+ const declaredCaps = Array.isArray(args["capabilities"]) ? args["capabilities"].filter((c) => typeof c === "string") : [];
203731
203790
  const modelDef = {
203732
203791
  id: args["id"],
203733
203792
  name: args["name"],
@@ -203739,7 +203798,8 @@ function createSettingsTools(ctx) {
203739
203798
  output: args["cost_output"]
203740
203799
  },
203741
203800
  ...args["reasoning"] ? { reasoning: true } : {},
203742
- ...args["vision"] ? { inputTypes: ["text", "image"] } : { inputTypes: ["text"] }
203801
+ ...args["vision"] ? { inputTypes: ["text", "image"] } : { inputTypes: ["text"] },
203802
+ ...declaredCaps.length > 0 ? { capabilities: declaredCaps } : {}
203743
203803
  };
203744
203804
  try {
203745
203805
  ctx.llmRouter.addCustomModel(providerName, modelDef);
@@ -203829,6 +203889,10 @@ function createSettingsTools(ctx) {
203829
203889
  fallback_model: {
203830
203890
  type: "string",
203831
203891
  description: "Optional fallback model"
203892
+ },
203893
+ force: {
203894
+ type: "boolean",
203895
+ description: "When true, bypass the model-name heuristic gate (e.g. a self-hosted image model whose id does not look like a commercial image model). Explicit capability declarations on the model (via llm_add_model capabilities=...) are still honored and preferred. Default false."
203832
203896
  }
203833
203897
  },
203834
203898
  required: ["capability_type", "provider", "model"]
@@ -203838,6 +203902,7 @@ function createSettingsTools(ctx) {
203838
203902
  const capabilityType = resolveCapabilityTypeArg(args, VALID);
203839
203903
  const provider = String(args["provider"] ?? "").trim();
203840
203904
  const model = String(args["model"] ?? "").trim();
203905
+ const force = args["force"] === true;
203841
203906
  try {
203842
203907
  if (!capabilityType) {
203843
203908
  const raw = args["capability_type"] ?? args["capabilityType"] ?? args["type"] ?? args["capability"];
@@ -203879,13 +203944,16 @@ function createSettingsTools(ctx) {
203879
203944
  hint: `Call llm_get_capability_routing and pick from usable_models.${capabilityType}.`
203880
203945
  });
203881
203946
  }
203882
- const mismatch = detectModelCapabilityMismatch(model, capabilityType);
203883
- if (mismatch) {
203884
- return JSON.stringify({
203885
- status: "error",
203886
- error: mismatch,
203887
- hint: `Use llm_get_capability_routing.usable_models.${capabilityType} to find a suitable model.`
203888
- });
203947
+ const declared = findModelDeclaredCapabilities(ctx.llmRouter, provider, model);
203948
+ if (!force && !declared) {
203949
+ const mismatch = detectModelCapabilityMismatch(model, capabilityType);
203950
+ if (mismatch) {
203951
+ return JSON.stringify({
203952
+ status: "error",
203953
+ error: mismatch,
203954
+ hint: `Use llm_get_capability_routing.usable_models.${capabilityType} to find a suitable model, or declare capabilities on this model via llm_add_model (capabilities: ["${CAP_TAG_BY_TYPE[capabilityType] ?? "imageGeneration"}"]), or pass force:true to override the name heuristic.`
203955
+ });
203956
+ }
203889
203957
  }
203890
203958
  }
203891
203959
  const assignment = { provider, model };
@@ -204087,6 +204155,32 @@ function createSettingsTools(ctx) {
204087
204155
  }
204088
204156
  ];
204089
204157
  }
204158
+ function findModelDeclaredCapabilities(router, provider, model) {
204159
+ const settings = router.getEnhancedSettings();
204160
+ const p = settings.providers[provider];
204161
+ if (!p?.models?.length)
204162
+ return void 0;
204163
+ const entry = p.models.find((m) => m.id === model);
204164
+ if (!entry?.capabilities?.length)
204165
+ return void 0;
204166
+ return entry.capabilities;
204167
+ }
204168
+ function pickMediaTimeoutFields(args) {
204169
+ const out = {};
204170
+ const pairs = [
204171
+ ["image_generation_timeout_ms", "imageGenerationTimeoutMs"],
204172
+ ["tts_timeout_ms", "ttsTimeoutMs"],
204173
+ ["stt_timeout_ms", "sttTimeoutMs"],
204174
+ ["video_generation_timeout_ms", "videoGenerationTimeoutMs"],
204175
+ ["decision_timeout_ms", "decisionTimeoutMs"]
204176
+ ];
204177
+ for (const [argKey, cfgKey] of pairs) {
204178
+ const v = args[argKey];
204179
+ if (typeof v === "number" && Number.isFinite(v) && v > 0)
204180
+ out[cfgKey] = v;
204181
+ }
204182
+ return out;
204183
+ }
204090
204184
  function resolveCapabilityTypeArg(args, valid) {
204091
204185
  const raw = args["capability_type"] ?? args["capabilityType"] ?? args["type"] ?? args["capability"];
204092
204186
  if (typeof raw !== "string" || !raw.trim())
@@ -204148,7 +204242,9 @@ var init_settings = __esm({
204148
204242
  decision: "decision"
204149
204243
  };
204150
204244
  CAPABILITY_MODEL_PATTERNS = {
204151
- image_generation: /\bdall-?e\b|gpt-image|flux|stable.?diffusion|sdxl|imagen|wanx|wan[.-]?ai|kolors|playground|cogview|glm-image|seedream|grok-imagine|image-01/i,
204245
+ // Include common local / self-hosted diffusion families so undeclared ids
204246
+ // (qwen-image-2.1, hunyuan-image, nano-banana, …) route without being told.
204247
+ image_generation: /\bdall-?e\b|gpt-image|flux|stable.?diffusion|sdxl|imagen|qwen[.-]?image|hunyuan|nano.?banana|ideogram|recraft|grok.?image|playground|cogview|glm-image|seedream|wanx|wan[.-]?ai|kolors|image-01/i,
204152
204248
  image_recognition: /\bvl\b|vision|visual|eye|gpt-4o|gemini|claude/i,
204153
204249
  // Dedicated TTS ids only — do NOT match bare "speech"/"voice" (too broad) or music models.
204154
204250
  audio_tts: /\btts\b|cosy.?voice|bark|xtts|orpheus|aura-?\d|tts-1|text[-_.]?to[-_.]?speech/i,
@@ -204314,6 +204410,14 @@ function resolveEffectiveCandidates(candidates, agentProvider, agentModel, ctx,
204314
204410
  };
204315
204411
  }
204316
204412
  if (agentModel) {
204413
+ const slash = agentModel.indexOf("/");
204414
+ if (slash > 0) {
204415
+ const prefix = agentModel.slice(0, slash);
204416
+ const bare = agentModel.slice(slash + 1);
204417
+ if (bare && (ctx.resolveProvider?.(prefix) || candidates.some((c) => c.name === prefix))) {
204418
+ return resolveEffectiveCandidates(candidates, prefix, bare, ctx, method);
204419
+ }
204420
+ }
204317
204421
  return { candidates: candidates.map((c) => ({ ...c, model: agentModel })) };
204318
204422
  }
204319
204423
  return { candidates };
@@ -204708,7 +204812,10 @@ function createMultiModalTools(ctx) {
204708
204812
  }
204709
204813
  const tried = candidates.map((c) => c.model ?? c.name).join(", ");
204710
204814
  log30.error(`Image generation failed on all ${candidates.length} provider(s)`);
204711
- return toolErr(`Image generation failed (tried: ${tried}): ${lastError instanceof Error ? lastError.message : String(lastError)}`, { hint: ROUTING_HINT, tried_models: candidates.map((c) => c.model).filter(Boolean) });
204815
+ return toolErr(`Image generation failed (tried: ${tried}): ${lastError instanceof Error ? lastError.message : String(lastError)}`, {
204816
+ hint: `${ROUTING_HINT} If the error mentions "model not found" / "not served for this capability", the selected model is a text/chat model, not an image model \u2014 pick from llm_get_capability_routing.usable_models.image_generation.`,
204817
+ tried_models: candidates.map((c) => c.model).filter(Boolean)
204818
+ });
204712
204819
  }
204713
204820
  },
204714
204821
  {
@@ -214033,6 +214140,11 @@ var init_openai = __esm({
214033
214140
  maxTokens;
214034
214141
  chatTimeoutMs;
214035
214142
  streamTimeoutMs;
214143
+ imageGenerationTimeoutMs;
214144
+ ttsTimeoutMs;
214145
+ sttTimeoutMs;
214146
+ videoGenerationTimeoutMs;
214147
+ decisionTimeoutMs;
214036
214148
  tokenResolver;
214037
214149
  /** Explicit decisions endpoint; when unset it is resolved from `baseUrl`. */
214038
214150
  decisionsUrl;
@@ -214045,6 +214157,11 @@ var init_openai = __esm({
214045
214157
  this.maxTokens = config?.maxTokens ?? DEFAULT_REQUEST_MAX_TOKENS;
214046
214158
  this.chatTimeoutMs = config?.timeoutMs ?? 9e4;
214047
214159
  this.streamTimeoutMs = config?.streamTimeoutMs ?? 18e4;
214160
+ this.imageGenerationTimeoutMs = config?.imageGenerationTimeoutMs ?? 6e5;
214161
+ this.ttsTimeoutMs = config?.ttsTimeoutMs ?? 6e5;
214162
+ this.sttTimeoutMs = config?.sttTimeoutMs ?? 6e5;
214163
+ this.videoGenerationTimeoutMs = config?.videoGenerationTimeoutMs ?? 6e5;
214164
+ this.decisionTimeoutMs = config?.decisionTimeoutMs ?? 6e4;
214048
214165
  this.decisionsUrl = config?.decisionsUrl;
214049
214166
  this.tokenResolver = tokenResolver;
214050
214167
  }
@@ -214061,6 +214178,16 @@ var init_openai = __esm({
214061
214178
  this.chatTimeoutMs = config.timeoutMs;
214062
214179
  if (config.streamTimeoutMs)
214063
214180
  this.streamTimeoutMs = config.streamTimeoutMs;
214181
+ if (config.imageGenerationTimeoutMs !== void 0)
214182
+ this.imageGenerationTimeoutMs = config.imageGenerationTimeoutMs;
214183
+ if (config.ttsTimeoutMs !== void 0)
214184
+ this.ttsTimeoutMs = config.ttsTimeoutMs;
214185
+ if (config.sttTimeoutMs !== void 0)
214186
+ this.sttTimeoutMs = config.sttTimeoutMs;
214187
+ if (config.videoGenerationTimeoutMs !== void 0)
214188
+ this.videoGenerationTimeoutMs = config.videoGenerationTimeoutMs;
214189
+ if (config.decisionTimeoutMs !== void 0)
214190
+ this.decisionTimeoutMs = config.decisionTimeoutMs;
214064
214191
  if (config.decisionsUrl)
214065
214192
  this.decisionsUrl = config.decisionsUrl;
214066
214193
  }
@@ -214468,7 +214595,7 @@ var init_openai = __esm({
214468
214595
  "X-Title": "Markus"
214469
214596
  },
214470
214597
  body: JSON.stringify(body),
214471
- signal: AbortSignal.timeout(6e4)
214598
+ signal: AbortSignal.timeout(this.decisionTimeoutMs)
214472
214599
  });
214473
214600
  if (!res.ok) {
214474
214601
  const errText = await res.text();
@@ -214503,7 +214630,7 @@ var init_openai = __esm({
214503
214630
  method: "POST",
214504
214631
  headers: { "Content-Type": "application/json", Authorization: authorization },
214505
214632
  body: JSON.stringify(body),
214506
- signal: AbortSignal.timeout(12e4)
214633
+ signal: AbortSignal.timeout(this.imageGenerationTimeoutMs)
214507
214634
  });
214508
214635
  if (!res.ok) {
214509
214636
  const errText = await res.text();
@@ -214540,7 +214667,7 @@ var init_openai = __esm({
214540
214667
  method: "POST",
214541
214668
  headers: { "Content-Type": "application/json", Authorization: authorization },
214542
214669
  body: JSON.stringify(body),
214543
- signal: AbortSignal.timeout(18e4)
214670
+ signal: AbortSignal.timeout(this.ttsTimeoutMs)
214544
214671
  });
214545
214672
  if (!res.ok) {
214546
214673
  const errText = await res.text();
@@ -214568,7 +214695,7 @@ var init_openai = __esm({
214568
214695
  method: "POST",
214569
214696
  headers: { Authorization: authorization },
214570
214697
  body: formData,
214571
- signal: AbortSignal.timeout(12e4)
214698
+ signal: AbortSignal.timeout(this.sttTimeoutMs)
214572
214699
  });
214573
214700
  if (!res.ok) {
214574
214701
  const errText = await res.text();
@@ -214732,7 +214859,7 @@ var init_minimax = __esm({
214732
214859
  method: "POST",
214733
214860
  headers: { "Content-Type": "application/json", Authorization: authorization },
214734
214861
  body: JSON.stringify(body),
214735
- signal: AbortSignal.timeout(12e4)
214862
+ signal: AbortSignal.timeout(this.imageGenerationTimeoutMs)
214736
214863
  });
214737
214864
  if (!res.ok) {
214738
214865
  const errText = await res.text();
@@ -214772,7 +214899,7 @@ var init_minimax = __esm({
214772
214899
  method: "POST",
214773
214900
  headers: { "Content-Type": "application/json", Authorization: authorization },
214774
214901
  body: JSON.stringify(body),
214775
- signal: AbortSignal.timeout(18e4)
214902
+ signal: AbortSignal.timeout(this.ttsTimeoutMs)
214776
214903
  });
214777
214904
  if (!res.ok) {
214778
214905
  const errText = await res.text();
@@ -214809,7 +214936,7 @@ var init_minimax = __esm({
214809
214936
  method: "POST",
214810
214937
  headers: { "Content-Type": "application/json", Authorization: authorization },
214811
214938
  body: JSON.stringify(body),
214812
- signal: AbortSignal.timeout(12e4)
214939
+ signal: AbortSignal.timeout(this.videoGenerationTimeoutMs)
214813
214940
  });
214814
214941
  if (!createRes.ok) {
214815
214942
  const errText = await createRes.text();
@@ -214956,7 +215083,7 @@ var init_dashscope = __esm({
214956
215083
  method: "POST",
214957
215084
  headers: { "Content-Type": "application/json", Authorization: authorization },
214958
215085
  body: JSON.stringify(body),
214959
- signal: AbortSignal.timeout(12e4)
215086
+ signal: AbortSignal.timeout(this.imageGenerationTimeoutMs)
214960
215087
  });
214961
215088
  if (!res.ok) {
214962
215089
  const errText = await res.text();
@@ -214997,7 +215124,7 @@ var init_dashscope = __esm({
214997
215124
  method: "POST",
214998
215125
  headers: { "Content-Type": "application/json", Authorization: authorization },
214999
215126
  body: JSON.stringify(body),
215000
- signal: AbortSignal.timeout(6e4)
215127
+ signal: AbortSignal.timeout(this.ttsTimeoutMs)
215001
215128
  });
215002
215129
  if (!res.ok) {
215003
215130
  const errText = await res.text();
@@ -215079,7 +215206,7 @@ var init_fireworks = __esm({
215079
215206
  Authorization: authorization
215080
215207
  },
215081
215208
  body: JSON.stringify(body),
215082
- signal: AbortSignal.timeout(12e4)
215209
+ signal: AbortSignal.timeout(this.imageGenerationTimeoutMs)
215083
215210
  });
215084
215211
  if (!res.ok) {
215085
215212
  const errText = await res.text();
@@ -216384,6 +216511,13 @@ var init_markus_provider = __esm({
216384
216511
  maxTokens;
216385
216512
  chatTimeoutMs;
216386
216513
  streamTimeoutMs;
216514
+ /** Generative-media client timeouts; each independently configurable per
216515
+ * provider (defaults match the historical hardcoded ceilings). */
216516
+ imageGenerationTimeoutMs;
216517
+ ttsTimeoutMs;
216518
+ sttTimeoutMs;
216519
+ videoGenerationTimeoutMs;
216520
+ decisionTimeoutMs;
216387
216521
  cuCache = new CUCache();
216388
216522
  /** Hub-served geo-aware model catalog URL. */
216389
216523
  modelsUrl = "";
@@ -216408,6 +216542,11 @@ var init_markus_provider = __esm({
216408
216542
  this.maxTokens = config?.maxTokens;
216409
216543
  this.chatTimeoutMs = config?.timeoutMs ?? CHAT_TIMEOUT_MS;
216410
216544
  this.streamTimeoutMs = config?.streamTimeoutMs ?? STREAM_TIMEOUT_MS;
216545
+ this.imageGenerationTimeoutMs = config?.imageGenerationTimeoutMs ?? 6e5;
216546
+ this.ttsTimeoutMs = config?.ttsTimeoutMs ?? 6e5;
216547
+ this.sttTimeoutMs = config?.sttTimeoutMs ?? 6e5;
216548
+ this.videoGenerationTimeoutMs = config?.videoGenerationTimeoutMs ?? 6e5;
216549
+ this.decisionTimeoutMs = config?.decisionTimeoutMs ?? 6e4;
216411
216550
  this.applyRetryConfig(config);
216412
216551
  this.modelsUrl = config?.modelsUrl ?? process.env["MARKUS_MODELS_URL"] ?? "";
216413
216552
  this.hubUrl = config?.hubUrl ?? process.env["MARKUS_HUB_URL"] ?? "";
@@ -216445,6 +216584,16 @@ var init_markus_provider = __esm({
216445
216584
  this.chatTimeoutMs = config.timeoutMs;
216446
216585
  if (config.streamTimeoutMs)
216447
216586
  this.streamTimeoutMs = config.streamTimeoutMs;
216587
+ if (config.imageGenerationTimeoutMs !== void 0)
216588
+ this.imageGenerationTimeoutMs = config.imageGenerationTimeoutMs;
216589
+ if (config.ttsTimeoutMs !== void 0)
216590
+ this.ttsTimeoutMs = config.ttsTimeoutMs;
216591
+ if (config.sttTimeoutMs !== void 0)
216592
+ this.sttTimeoutMs = config.sttTimeoutMs;
216593
+ if (config.videoGenerationTimeoutMs !== void 0)
216594
+ this.videoGenerationTimeoutMs = config.videoGenerationTimeoutMs;
216595
+ if (config.decisionTimeoutMs !== void 0)
216596
+ this.decisionTimeoutMs = config.decisionTimeoutMs;
216448
216597
  this.applyRetryConfig(config);
216449
216598
  }
216450
216599
  /** Whether OpenRouter credentials are available. */
@@ -217427,7 +217576,7 @@ var init_markus_provider = __esm({
217427
217576
  "X-Title": "Markus"
217428
217577
  },
217429
217578
  body: JSON.stringify(body),
217430
- signal: AbortSignal.timeout(6e4)
217579
+ signal: AbortSignal.timeout(this.decisionTimeoutMs)
217431
217580
  });
217432
217581
  if (!res.ok) {
217433
217582
  const errText = await res.text();
@@ -217486,7 +217635,7 @@ var init_markus_provider = __esm({
217486
217635
  method: "POST",
217487
217636
  headers: { "Content-Type": "application/json", Authorization: this.bearerOpenRouter() },
217488
217637
  body: JSON.stringify(body),
217489
- signal: AbortSignal.timeout(18e4)
217638
+ signal: AbortSignal.timeout(this.imageGenerationTimeoutMs)
217490
217639
  });
217491
217640
  if (!res.ok) {
217492
217641
  const errText = await res.text();
@@ -217568,7 +217717,7 @@ var init_markus_provider = __esm({
217568
217717
  headers: { "Content-Type": "application/json", Authorization: this.bearerOpenRouter() },
217569
217718
  body: JSON.stringify(body),
217570
217719
  // Long narration + MiniMax/Deepgram synthesis often exceeds 60s.
217571
- signal: AbortSignal.timeout(18e4)
217720
+ signal: AbortSignal.timeout(this.ttsTimeoutMs)
217572
217721
  });
217573
217722
  if (!res.ok) {
217574
217723
  const errText = await res.text();
@@ -217615,7 +217764,7 @@ var init_markus_provider = __esm({
217615
217764
  method: "POST",
217616
217765
  headers: { "Content-Type": "application/json", Authorization: this.bearerOpenRouter() },
217617
217766
  body: JSON.stringify(body),
217618
- signal: AbortSignal.timeout(12e4)
217767
+ signal: AbortSignal.timeout(this.sttTimeoutMs)
217619
217768
  });
217620
217769
  if (!res.ok) {
217621
217770
  const errText = await res.text();
@@ -217684,7 +217833,7 @@ var init_markus_provider = __esm({
217684
217833
  method: "POST",
217685
217834
  headers: { "Content-Type": "application/json", Authorization: this.bearerOpenRouter() },
217686
217835
  body: JSON.stringify(body),
217687
- signal: AbortSignal.timeout(12e4)
217836
+ signal: AbortSignal.timeout(this.videoGenerationTimeoutMs)
217688
217837
  });
217689
217838
  if (!createRes.ok) {
217690
217839
  const errText = await createRes.text();
@@ -218945,6 +219094,33 @@ var init_oauth_manager = __esm({
218945
219094
  }
218946
219095
  });
218947
219096
 
219097
+ // ../core/dist/llm/model-capabilities.js
219098
+ function isChatCapableModel(model) {
219099
+ const caps = model.capabilities ?? [];
219100
+ if (caps.includes(CHAT_CAPABILITY))
219101
+ return true;
219102
+ if (caps.some((c) => NON_CHAT_CAPABILITIES.has(c)))
219103
+ return false;
219104
+ if (model.mode && model.mode !== "chat")
219105
+ return false;
219106
+ return true;
219107
+ }
219108
+ var CHAT_CAPABILITY, NON_CHAT_CAPABILITIES;
219109
+ var init_model_capabilities = __esm({
219110
+ "../core/dist/llm/model-capabilities.js"() {
219111
+ "use strict";
219112
+ CHAT_CAPABILITY = "chat";
219113
+ NON_CHAT_CAPABILITIES = /* @__PURE__ */ new Set([
219114
+ "imageGeneration",
219115
+ "tts",
219116
+ "stt",
219117
+ "videoGeneration",
219118
+ "audioOutput",
219119
+ "audioInput"
219120
+ ]);
219121
+ }
219122
+ });
219123
+
218948
219124
  // ../core/dist/llm/router.js
218949
219125
  function resolveFallbackContextWindow() {
218950
219126
  const raw = process.env["MARKUS_FALLBACK_CONTEXT_WINDOW"];
@@ -219056,6 +219232,7 @@ var init_router2 = __esm({
219056
219232
  init_model_discovery();
219057
219233
  init_auth_profiles();
219058
219234
  init_oauth_manager();
219235
+ init_model_capabilities();
219059
219236
  log59 = createLogger("llm-router");
219060
219237
  OLLAMA_DEFAULT_CONTEXT_WINDOW = 8192;
219061
219238
  OLLAMA_DEFAULT_MAX_OUTPUT = 4096;
@@ -219415,7 +219592,7 @@ var init_router2 = __esm({
219415
219592
  }
219416
219593
  const customModels = this.customModelCatalog.get(providerName) ?? [];
219417
219594
  const merged = [...builtinModels, ...customModels.filter((cm) => !builtinModels.some((bm) => bm.id === cm.id))];
219418
- const hasChatModel = merged.some((m) => (m.capabilities?.length ?? 0) === 0 && m.contextWindow > 0);
219595
+ const hasChatModel = merged.some((m) => isChatCapableModel(m) && m.contextWindow > 0);
219419
219596
  if (!hasChatModel) {
219420
219597
  const bootstrapId = getProviderBootstrapModel(providerName);
219421
219598
  if (bootstrapId && !merged.some((m) => m.id === bootstrapId)) {
@@ -219761,7 +219938,7 @@ var init_router2 = __esm({
219761
219938
  return model;
219762
219939
  const hasPricing = catalogEntry.inputCostPer1MTokens > 0 || catalogEntry.outputCostPer1MTokens > 0;
219763
219940
  const caps = catalogEntry.capabilities;
219764
- const isChatModel = !model.capabilities || model.capabilities.length === 0;
219941
+ const isChatModel = isChatCapableModel(model);
219765
219942
  const inputTypes = isChatModel && caps ? caps.vision ? ["text", "image"] : ["text"] : void 0;
219766
219943
  if (!hasPricing && !inputTypes && !catalogEntry.maxInputTokens)
219767
219944
  return model;
@@ -220017,8 +220194,16 @@ var init_router2 = __esm({
220017
220194
  * Resolve a provider instance for a non-text modality (image_generation, audio_tts, etc.).
220018
220195
  * Returns the provider and the assigned model name WITHOUT mutating provider state.
220019
220196
  * The caller is responsible for passing `model` into the API call options.
220197
+ *
220198
+ * For non-text capabilities this NEVER falls back to the global text routing
220199
+ * default model id (deepseek/gpt-4o/…): posting a chat id to an image/tts/stt
220200
+ * endpoint yields a confusing upstream 404 ("model not found" / "not served for
220201
+ * this capability"). Unassigned capabilities resolve to the provider only; the
220202
+ * provider's own modality-appropriate default (or an explicit per-call model)
220203
+ * is used instead.
220020
220204
  */
220021
220205
  resolveModalityProvider(capabilityType) {
220206
+ const isText2 = capabilityType === "text";
220022
220207
  const assignment = this._capabilityRouting.assignments[capabilityType];
220023
220208
  if (assignment) {
220024
220209
  const provider = this.providers.get(assignment.provider);
@@ -220035,12 +220220,46 @@ var init_router2 = __esm({
220035
220220
  if (this._routingDefaultModel) {
220036
220221
  const p2 = this.providers.get(this._routingDefaultModel.provider);
220037
220222
  if (p2 && this.isAvailable(this._routingDefaultModel.provider)) {
220038
- return { provider: p2, model: this._routingDefaultModel.model };
220223
+ const model = isText2 || this.routingDefaultModelServesCapability(capabilityType) ? this._routingDefaultModel.model : void 0;
220224
+ return { provider: p2, ...model ? { model } : {} };
220039
220225
  }
220040
220226
  }
220041
220227
  const p = this.providers.get(this.defaultProvider);
220042
220228
  return p && this.isAvailable(this.defaultProvider) ? { provider: p } : void 0;
220043
220229
  }
220230
+ /**
220231
+ * True when the routing default model's catalog entry declares the requested
220232
+ * capability. Used to decide whether a non-text fallback may carry the model
220233
+ * id — a text/chat model must never be POSTed to a media endpoint.
220234
+ */
220235
+ routingDefaultModelServesCapability(capabilityType) {
220236
+ const r = this._routingDefaultModel;
220237
+ if (!r)
220238
+ return false;
220239
+ try {
220240
+ const entry = this.getProviderModels(r.provider).find((m) => m.id === r.model);
220241
+ if (!entry)
220242
+ return false;
220243
+ switch (capabilityType) {
220244
+ case "image_generation":
220245
+ return !!entry.capabilities?.includes("imageGeneration");
220246
+ case "audio_tts":
220247
+ return !!entry.capabilities?.includes("tts");
220248
+ case "audio_stt":
220249
+ return !!entry.capabilities?.includes("stt");
220250
+ case "video_generation":
220251
+ return !!entry.capabilities?.includes("videoGeneration");
220252
+ case "decision":
220253
+ return !!entry.capabilities?.includes("decision");
220254
+ case "image_recognition":
220255
+ return !!entry.inputTypes?.includes("image") || !!entry.capabilities?.includes("vision");
220256
+ default:
220257
+ return false;
220258
+ }
220259
+ } catch {
220260
+ return false;
220261
+ }
220262
+ }
220044
220263
  /**
220045
220264
  * Look up any registered provider by name for one-shot tool overrides
220046
220265
  * (`provider=` + `model=` on generate_image / text_to_speech / …).
@@ -226271,6 +226490,7 @@ __export(dist_exports3, {
226271
226490
  AnthropicProvider: () => AnthropicProvider,
226272
226491
  AttentionController: () => AttentionController,
226273
226492
  AuthProfileStore: () => AuthProfileStore,
226493
+ CHAT_CAPABILITY: () => CHAT_CAPABILITY,
226274
226494
  COMMENT_RESPONSE_ALLOWED_TOOLS: () => COMMENT_RESPONSE_ALLOWED_TOOLS,
226275
226495
  CodexResponsesProvider: () => CodexResponsesProvider,
226276
226496
  CognitivePreparation: () => CognitivePreparation,
@@ -226307,6 +226527,7 @@ __export(dist_exports3, {
226307
226527
  MemoryStore: () => MemoryStore,
226308
226528
  MiniMaxProvider: () => MiniMaxProvider,
226309
226529
  ModelCatalogService: () => ModelCatalogService,
226530
+ NON_CHAT_CAPABILITIES: () => NON_CHAT_CAPABILITIES,
226310
226531
  NotLoggedIntoHubError: () => NotLoggedIntoHubError,
226311
226532
  OAuthManager: () => OAuthManager,
226312
226533
  OllamaProvider: () => OllamaProvider,
@@ -226420,6 +226641,7 @@ __export(dist_exports3, {
226420
226641
  importSkillPackage: () => importSkillPackage,
226421
226642
  initTokenCounter: () => initTokenCounter,
226422
226643
  isAnthropicTokenCounterEnabled: () => isAnthropicTokenCounterEnabled,
226644
+ isChatCapableModel: () => isChatCapableModel,
226423
226645
  isGreenfieldLlmConfig: () => isGreenfieldLlmConfig,
226424
226646
  isLegacyMarkusProxyBaseUrl: () => isLegacyMarkusProxyBaseUrl,
226425
226647
  isObsoleteMarkusModel: () => isObsoleteMarkusModel,
@@ -226480,6 +226702,7 @@ var init_dist7 = __esm({
226480
226702
  init_environment_profile();
226481
226703
  init_tool_selector();
226482
226704
  init_router2();
226705
+ init_model_capabilities();
226483
226706
  init_llm_logger();
226484
226707
  init_anthropic();
226485
226708
  init_openai();
@@ -361944,13 +362167,8 @@ EXPLANATION_END`;
361944
362167
  const suggestions = {};
361945
362168
  for (const capabilityType of ALL_CAPABILITY_TYPES) {
361946
362169
  let candidates;
361947
- const NON_TEXT_CAPS = /* @__PURE__ */ new Set(["imageGeneration", "tts", "stt", "videoGeneration", "audioOutput", "audioInput"]);
361948
362170
  if (TEXT_CAPABILITIES.has(capabilityType)) {
361949
- candidates = allCandidates.filter((m) => {
361950
- if (m.capabilities && m.capabilities.some((c) => NON_TEXT_CAPS.has(c)))
361951
- return false;
361952
- return true;
361953
- });
362171
+ candidates = allCandidates.filter((m) => isChatCapableModel(m));
361954
362172
  } else {
361955
362173
  const requiredCaps = CAP_MAP[capabilityType] ?? [];
361956
362174
  candidates = allCandidates.filter((m) => m.capabilities && m.capabilities.length > 0 && requiredCaps.some((cap) => m.capabilities.includes(cap)));