@vibeframe/mcp-server 0.103.0 → 0.104.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +82 -22
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -25634,11 +25634,15 @@ var config_exports = {};
25634
25634
  __export(config_exports, {
25635
25635
  CONFIG_DIR: () => CONFIG_DIR,
25636
25636
  CONFIG_PATH: () => CONFIG_PATH,
25637
+ LEGACY_USER_CONFIG_DIR: () => LEGACY_USER_CONFIG_DIR,
25638
+ LEGACY_USER_CONFIG_PATH: () => LEGACY_USER_CONFIG_PATH,
25637
25639
  PROVIDER_ENV_ALIASES: () => PROVIDER_ENV_ALIASES,
25638
25640
  PROVIDER_ENV_VARS: () => PROVIDER_ENV_VARS,
25639
25641
  PROVIDER_NAMES: () => PROVIDER_NAMES,
25642
+ USER_CACHE_DIR: () => USER_CACHE_DIR,
25640
25643
  USER_CONFIG_DIR: () => USER_CONFIG_DIR,
25641
25644
  USER_CONFIG_PATH: () => USER_CONFIG_PATH,
25645
+ USER_DATA_DIR: () => USER_DATA_DIR,
25642
25646
  createDefaultConfig: () => createDefaultConfig,
25643
25647
  findProjectConfigPath: () => findProjectConfigPath,
25644
25648
  getActiveScope: () => getActiveScope,
@@ -25647,6 +25651,7 @@ __export(config_exports, {
25647
25651
  getConfigPath: () => getConfigPath,
25648
25652
  getProjectConfigDir: () => getProjectConfigDir,
25649
25653
  getProjectConfigPath: () => getProjectConfigPath,
25654
+ getUserConfigStatus: () => getUserConfigStatus,
25650
25655
  isConfigured: () => isConfigured,
25651
25656
  loadConfig: () => loadConfig,
25652
25657
  saveConfig: () => saveConfig,
@@ -25655,6 +25660,17 @@ __export(config_exports, {
25655
25660
  import { resolve as resolve3 } from "node:path";
25656
25661
  import { homedir } from "node:os";
25657
25662
  import { readFile as readFile3, writeFile as writeFile2, mkdir as mkdir2, access as access2 } from "node:fs/promises";
25663
+ function resolveEnvPath(name) {
25664
+ const value = process.env[name]?.trim();
25665
+ return value ? resolve3(value) : null;
25666
+ }
25667
+ function resolveXdgAppDir(opts) {
25668
+ const override = resolveEnvPath(opts.overrideEnv);
25669
+ if (override) return override;
25670
+ const xdgBase = resolveEnvPath(opts.xdgEnv);
25671
+ const base = xdgBase ?? resolve3(homedir(), opts.fallbackHomeRel);
25672
+ return resolve3(base, "vibeframe");
25673
+ }
25658
25674
  function getProjectConfigDir(cwd = process.cwd()) {
25659
25675
  return resolve3(cwd, ".vibeframe");
25660
25676
  }
@@ -25675,11 +25691,29 @@ async function fileExists(path14) {
25675
25691
  return false;
25676
25692
  }
25677
25693
  }
25694
+ async function getUserConfigStatus() {
25695
+ const primaryConfigured = await fileExists(USER_CONFIG_PATH);
25696
+ const legacyConfigured = LEGACY_USER_CONFIG_PATH === USER_CONFIG_PATH ? primaryConfigured : await fileExists(LEGACY_USER_CONFIG_PATH);
25697
+ const source3 = primaryConfigured ? "user" : legacyConfigured && LEGACY_USER_CONFIG_PATH !== USER_CONFIG_PATH ? "legacy" : null;
25698
+ return {
25699
+ configured: primaryConfigured || legacyConfigured,
25700
+ configPath: source3 === "user" ? USER_CONFIG_PATH : source3 === "legacy" ? LEGACY_USER_CONFIG_PATH : USER_CONFIG_PATH,
25701
+ writePath: USER_CONFIG_PATH,
25702
+ legacyConfigPath: LEGACY_USER_CONFIG_PATH,
25703
+ primaryConfigured,
25704
+ legacyConfigured,
25705
+ source: source3
25706
+ };
25707
+ }
25678
25708
  async function findProjectConfigPath(cwd = process.cwd()) {
25679
25709
  let dir = resolve3(cwd);
25710
+ const homeDir = resolve3(homedir());
25680
25711
  for (; ; ) {
25712
+ if (dir === homeDir) return null;
25681
25713
  const candidate = getProjectConfigPath(dir);
25682
- if (await fileExists(candidate)) return candidate;
25714
+ if (candidate !== USER_CONFIG_PATH && candidate !== LEGACY_USER_CONFIG_PATH && await fileExists(candidate)) {
25715
+ return candidate;
25716
+ }
25683
25717
  const parent = resolve3(dir, "..");
25684
25718
  if (parent === dir) return null;
25685
25719
  dir = parent;
@@ -25714,10 +25748,15 @@ async function readConfigFile(path14) {
25714
25748
  return null;
25715
25749
  }
25716
25750
  }
25751
+ async function readUserConfigFile() {
25752
+ if (await fileExists(USER_CONFIG_PATH)) return readConfigFile(USER_CONFIG_PATH);
25753
+ if (await fileExists(LEGACY_USER_CONFIG_PATH)) return readConfigFile(LEGACY_USER_CONFIG_PATH);
25754
+ return null;
25755
+ }
25717
25756
  async function loadConfig(options = {}) {
25718
25757
  const { scope, cwd, merge: merge3 } = options;
25719
25758
  if (merge3) {
25720
- const user = await readConfigFile(USER_CONFIG_PATH);
25759
+ const user = await readUserConfigFile();
25721
25760
  const projectPath2 = await findProjectConfigPath(cwd);
25722
25761
  const project2 = projectPath2 ? await readConfigFile(projectPath2) : null;
25723
25762
  if (!user && !project2) return null;
@@ -25738,12 +25777,12 @@ async function loadConfig(options = {}) {
25738
25777
  };
25739
25778
  }
25740
25779
  if (scope) {
25741
- return readConfigFile(getConfigPath(scope, cwd));
25780
+ return scope === "user" ? readUserConfigFile() : readConfigFile(getConfigPath(scope, cwd));
25742
25781
  }
25743
25782
  const projectPath = await findProjectConfigPath(cwd);
25744
25783
  const project = projectPath ? await readConfigFile(projectPath) : null;
25745
25784
  if (project) return project;
25746
- return readConfigFile(USER_CONFIG_PATH);
25785
+ return readUserConfigFile();
25747
25786
  }
25748
25787
  async function saveConfig(config4, options = {}) {
25749
25788
  const scope = options.scope ?? "user";
@@ -25753,8 +25792,8 @@ async function saveConfig(config4, options = {}) {
25753
25792
  const content = (0, import_yaml3.stringify)(config4, { indent: 2, lineWidth: 0 });
25754
25793
  await writeFile2(path14, content, "utf-8");
25755
25794
  }
25756
- async function isConfigured() {
25757
- const config4 = await loadConfig();
25795
+ async function isConfigured(options = {}) {
25796
+ const config4 = await loadConfig({ cwd: options.cwd });
25758
25797
  if (!config4) return false;
25759
25798
  const provider = config4.llm.provider;
25760
25799
  const providerKey = provider === "gemini" ? "google" : provider === "claude" ? "anthropic" : provider;
@@ -25786,15 +25825,23 @@ async function updateProviderKey(providerKey, apiKey, options = {}) {
25786
25825
  config4.providers[providerKey] = apiKey;
25787
25826
  await saveConfig(config4, { scope, cwd: options.cwd });
25788
25827
  }
25789
- var import_yaml3, USER_CONFIG_DIR, USER_CONFIG_PATH, CONFIG_DIR, CONFIG_PATH;
25828
+ var import_yaml3, USER_CONFIG_DIR, USER_CONFIG_PATH, USER_DATA_DIR, USER_CACHE_DIR, LEGACY_USER_CONFIG_DIR, LEGACY_USER_CONFIG_PATH, CONFIG_DIR, CONFIG_PATH;
25790
25829
  var init_config = __esm({
25791
25830
  "../cli/src/config/index.ts"() {
25792
25831
  "use strict";
25793
25832
  import_yaml3 = __toESM(require_dist(), 1);
25794
25833
  init_schema();
25795
25834
  init_schema();
25796
- USER_CONFIG_DIR = resolve3(homedir(), ".vibeframe");
25835
+ USER_CONFIG_DIR = resolveEnvPath("VIBEFRAME_CONFIG_HOME") ?? resolve3(homedir(), ".vibeframe");
25797
25836
  USER_CONFIG_PATH = resolve3(USER_CONFIG_DIR, "config.yaml");
25837
+ USER_DATA_DIR = resolveXdgAppDir({
25838
+ overrideEnv: "VIBEFRAME_DATA_HOME",
25839
+ xdgEnv: "XDG_DATA_HOME",
25840
+ fallbackHomeRel: ".local/share"
25841
+ });
25842
+ USER_CACHE_DIR = resolveEnvPath("VIBEFRAME_CACHE_HOME") ?? resolve3(USER_CONFIG_DIR, "cache");
25843
+ LEGACY_USER_CONFIG_DIR = resolve3(homedir(), ".vibeframe");
25844
+ LEGACY_USER_CONFIG_PATH = resolve3(LEGACY_USER_CONFIG_DIR, "config.yaml");
25798
25845
  CONFIG_DIR = USER_CONFIG_DIR;
25799
25846
  CONFIG_PATH = USER_CONFIG_PATH;
25800
25847
  }
@@ -336822,11 +336869,11 @@ var require_env_paths = __commonJS({
336822
336869
  "use strict";
336823
336870
  var path14 = __require("path");
336824
336871
  var os11 = __require("os");
336825
- var homedir8 = os11.homedir();
336872
+ var homedir7 = os11.homedir();
336826
336873
  var tmpdir7 = os11.tmpdir();
336827
336874
  var { env: env4 } = process;
336828
336875
  var macos = (name) => {
336829
- const library = path14.join(homedir8, "Library");
336876
+ const library = path14.join(homedir7, "Library");
336830
336877
  return {
336831
336878
  data: path14.join(library, "Application Support", name),
336832
336879
  config: path14.join(library, "Preferences", name),
@@ -336836,8 +336883,8 @@ var require_env_paths = __commonJS({
336836
336883
  };
336837
336884
  };
336838
336885
  var windows = (name) => {
336839
- const appData = env4.APPDATA || path14.join(homedir8, "AppData", "Roaming");
336840
- const localAppData = env4.LOCALAPPDATA || path14.join(homedir8, "AppData", "Local");
336886
+ const appData = env4.APPDATA || path14.join(homedir7, "AppData", "Roaming");
336887
+ const localAppData = env4.LOCALAPPDATA || path14.join(homedir7, "AppData", "Local");
336841
336888
  return {
336842
336889
  // Data/config/cache/log are invented by me as Windows isn't opinionated about this
336843
336890
  data: path14.join(localAppData, name, "Data"),
@@ -336848,13 +336895,13 @@ var require_env_paths = __commonJS({
336848
336895
  };
336849
336896
  };
336850
336897
  var linux = (name) => {
336851
- const username = path14.basename(homedir8);
336898
+ const username = path14.basename(homedir7);
336852
336899
  return {
336853
- data: path14.join(env4.XDG_DATA_HOME || path14.join(homedir8, ".local", "share"), name),
336854
- config: path14.join(env4.XDG_CONFIG_HOME || path14.join(homedir8, ".config"), name),
336855
- cache: path14.join(env4.XDG_CACHE_HOME || path14.join(homedir8, ".cache"), name),
336900
+ data: path14.join(env4.XDG_DATA_HOME || path14.join(homedir7, ".local", "share"), name),
336901
+ config: path14.join(env4.XDG_CONFIG_HOME || path14.join(homedir7, ".config"), name),
336902
+ cache: path14.join(env4.XDG_CACHE_HOME || path14.join(homedir7, ".cache"), name),
336856
336903
  // https://wiki.debian.org/XDGBaseDirectorySpecification#state
336857
- log: path14.join(env4.XDG_STATE_HOME || path14.join(homedir8, ".local", "state"), name),
336904
+ log: path14.join(env4.XDG_STATE_HOME || path14.join(homedir7, ".local", "state"), name),
336858
336905
  temp: path14.join(tmpdir7, username, name)
336859
336906
  };
336860
336907
  };
@@ -449058,7 +449105,6 @@ import { GoogleGenerativeAI } from "@google/generative-ai";
449058
449105
  import { createHash as createHash4 } from "node:crypto";
449059
449106
  import { existsSync as existsSync23, mkdirSync as mkdirSync12 } from "node:fs";
449060
449107
  import { mkdir as mkdir7, readFile as readFile6, writeFile as writeFile8 } from "node:fs/promises";
449061
- import { homedir as homedir6 } from "node:os";
449062
449108
  import { dirname as dirname13, join as join23, resolve as resolve15 } from "node:path";
449063
449109
  function buildSystemPrompt(ctx) {
449064
449110
  return `You are a Hyperframes composition author. The skill content below
@@ -449227,7 +449273,7 @@ function computeCacheKey(parts) {
449227
449273
  return createHash4("sha256").update(parts.provider).update("\u241E").update(parts.model).update("\u241E").update(parts.systemPrompt).update("\u241E").update(parts.userPrompt).digest("hex");
449228
449274
  }
449229
449275
  function defaultCacheDir() {
449230
- return join23(homedir6(), ".vibeframe", "cache", "compose-scenes");
449276
+ return join23(USER_CACHE_DIR, "compose-scenes");
449231
449277
  }
449232
449278
  function extractHtml(responseText) {
449233
449279
  const fenced = responseText.match(/```html\s*\n([\s\S]*?)\n```/);
@@ -449517,6 +449563,7 @@ var MODEL_SETTINGS_BY_PROVIDER, ComposeBeatError, defaultCallLLM, CONFIG_PROVIDE
449517
449563
  var init_compose_scenes_skills = __esm({
449518
449564
  "../cli/src/commands/_shared/compose-scenes-skills.ts"() {
449519
449565
  "use strict";
449566
+ init_config();
449520
449567
  init_dist2();
449521
449568
  init_bundle();
449522
449569
  init_scene_lint();
@@ -450237,7 +450284,7 @@ var init_scene_repair = __esm({
450237
450284
 
450238
450285
  // ../cli/src/pipeline/renderers/chrome.ts
450239
450286
  import { existsSync as existsSync27 } from "node:fs";
450240
- import { homedir as homedir7 } from "node:os";
450287
+ import { homedir as homedir6 } from "node:os";
450241
450288
  import { join as join27 } from "node:path";
450242
450289
  function findChrome() {
450243
450290
  const candidates = [
@@ -450245,7 +450292,7 @@ function findChrome() {
450245
450292
  process.env.CHROME_PATH,
450246
450293
  // puppeteer auto-downloaded headless shell
450247
450294
  join27(
450248
- homedir7(),
450295
+ homedir6(),
450249
450296
  ".cache",
450250
450297
  "puppeteer",
450251
450298
  "chrome-headless-shell",
@@ -451593,6 +451640,18 @@ async function createBuildPlan(opts) {
451593
451640
  `vibe storyboard revise ${projectDir} --from "<request>" --dry-run --json`
451594
451641
  );
451595
451642
  }
451643
+ if (validationOk && includeAssets && !opts.skipBackdrop) {
451644
+ const generatedBackdrops = beats.map((beat) => beat.assets.backdrop).filter((asset) => Boolean(asset?.willGenerate));
451645
+ if (generatedBackdrops.length > 0) {
451646
+ const cost = generatedBackdrops.reduce((sum, asset) => sum + asset.estimatedCostUsd, 0);
451647
+ const beatFlag = opts.beat ? ` --beat ${opts.beat}` : "";
451648
+ const skipCommand = `vibe build ${projectDir}${beatFlag} --stage ${stage} --skip-backdrop --json`;
451649
+ warnings.push(
451650
+ `Backdrop image generation will run for ${generatedBackdrops.length} beat(s), estimated $${cost.toFixed(2)}. Use --skip-backdrop for HTML/CSS-derived visuals: ${skipCommand}`
451651
+ );
451652
+ retryWith.push(skipCommand);
451653
+ }
451654
+ }
451596
451655
  return finalizeBuildPlan({
451597
451656
  projectDir,
451598
451657
  config: config4,
@@ -462888,12 +462947,13 @@ async function prompt2(question) {
462888
462947
  });
462889
462948
  });
462890
462949
  }
462891
- var ttyStream;
462950
+ var ttyStream, ANSI_RE;
462892
462951
  var init_tty = __esm({
462893
462952
  "../cli/src/utils/tty.ts"() {
462894
462953
  "use strict";
462895
462954
  init_open_url();
462896
462955
  ttyStream = null;
462956
+ ANSI_RE = new RegExp(`${String.fromCharCode(27)}\\[[0-?]*[ -/]*[@-~]`, "g");
462897
462957
  }
462898
462958
  });
462899
462959
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibeframe/mcp-server",
3
- "version": "0.103.0",
3
+ "version": "0.104.0",
4
4
  "description": "VibeFrame MCP Server - AI-native video editing via Model Context Protocol",
5
5
  "type": "module",
6
6
  "bin": {
@@ -57,8 +57,8 @@
57
57
  "tsx": "^4.21.0",
58
58
  "typescript": "^5.3.3",
59
59
  "vitest": "^1.2.2",
60
- "@vibeframe/cli": "0.103.0",
61
- "@vibeframe/core": "0.103.0"
60
+ "@vibeframe/cli": "0.104.0",
61
+ "@vibeframe/core": "0.104.0"
62
62
  },
63
63
  "engines": {
64
64
  "node": ">=20"