@vibeframe/cli 0.27.0 → 0.30.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 (118) hide show
  1. package/LICENSE +21 -0
  2. package/dist/agent/adapters/index.d.ts +1 -0
  3. package/dist/agent/adapters/index.d.ts.map +1 -1
  4. package/dist/agent/adapters/index.js +5 -0
  5. package/dist/agent/adapters/index.js.map +1 -1
  6. package/dist/agent/adapters/openrouter.d.ts +16 -0
  7. package/dist/agent/adapters/openrouter.d.ts.map +1 -0
  8. package/dist/agent/adapters/openrouter.js +100 -0
  9. package/dist/agent/adapters/openrouter.js.map +1 -0
  10. package/dist/agent/types.d.ts +1 -1
  11. package/dist/agent/types.d.ts.map +1 -1
  12. package/dist/commands/agent.d.ts.map +1 -1
  13. package/dist/commands/agent.js +3 -1
  14. package/dist/commands/agent.js.map +1 -1
  15. package/dist/commands/ai-edit-cli.d.ts.map +1 -1
  16. package/dist/commands/ai-edit-cli.js +18 -0
  17. package/dist/commands/ai-edit-cli.js.map +1 -1
  18. package/dist/commands/generate.js +14 -0
  19. package/dist/commands/generate.js.map +1 -1
  20. package/dist/commands/schema.d.ts +1 -0
  21. package/dist/commands/schema.d.ts.map +1 -1
  22. package/dist/commands/schema.js +122 -21
  23. package/dist/commands/schema.js.map +1 -1
  24. package/dist/commands/setup.js +5 -2
  25. package/dist/commands/setup.js.map +1 -1
  26. package/dist/config/schema.d.ts +2 -1
  27. package/dist/config/schema.d.ts.map +1 -1
  28. package/dist/config/schema.js +2 -0
  29. package/dist/config/schema.js.map +1 -1
  30. package/dist/index.js +0 -0
  31. package/package.json +16 -12
  32. package/.turbo/turbo-build.log +0 -4
  33. package/.turbo/turbo-lint.log +0 -21
  34. package/.turbo/turbo-test.log +0 -689
  35. package/src/agent/adapters/claude.ts +0 -143
  36. package/src/agent/adapters/gemini.ts +0 -159
  37. package/src/agent/adapters/index.ts +0 -61
  38. package/src/agent/adapters/ollama.ts +0 -231
  39. package/src/agent/adapters/openai.ts +0 -116
  40. package/src/agent/adapters/xai.ts +0 -119
  41. package/src/agent/index.ts +0 -251
  42. package/src/agent/memory/index.ts +0 -151
  43. package/src/agent/prompts/system.ts +0 -106
  44. package/src/agent/tools/ai-editing.ts +0 -845
  45. package/src/agent/tools/ai-generation.ts +0 -1073
  46. package/src/agent/tools/ai-pipeline.ts +0 -1055
  47. package/src/agent/tools/ai.ts +0 -21
  48. package/src/agent/tools/batch.ts +0 -429
  49. package/src/agent/tools/e2e.test.ts +0 -545
  50. package/src/agent/tools/export.ts +0 -184
  51. package/src/agent/tools/filesystem.ts +0 -237
  52. package/src/agent/tools/index.ts +0 -150
  53. package/src/agent/tools/integration.test.ts +0 -775
  54. package/src/agent/tools/media.ts +0 -697
  55. package/src/agent/tools/project.ts +0 -313
  56. package/src/agent/tools/timeline.ts +0 -951
  57. package/src/agent/types.ts +0 -68
  58. package/src/commands/agent.ts +0 -340
  59. package/src/commands/ai-analyze.ts +0 -429
  60. package/src/commands/ai-animated-caption.ts +0 -390
  61. package/src/commands/ai-audio.ts +0 -941
  62. package/src/commands/ai-broll.ts +0 -490
  63. package/src/commands/ai-edit-cli.ts +0 -658
  64. package/src/commands/ai-edit.ts +0 -1542
  65. package/src/commands/ai-fill-gaps.ts +0 -566
  66. package/src/commands/ai-helpers.ts +0 -65
  67. package/src/commands/ai-highlights.ts +0 -1303
  68. package/src/commands/ai-image.ts +0 -761
  69. package/src/commands/ai-motion.ts +0 -347
  70. package/src/commands/ai-narrate.ts +0 -451
  71. package/src/commands/ai-review.ts +0 -309
  72. package/src/commands/ai-script-pipeline-cli.ts +0 -1710
  73. package/src/commands/ai-script-pipeline.ts +0 -1365
  74. package/src/commands/ai-suggest-edit.ts +0 -264
  75. package/src/commands/ai-video-fx.ts +0 -445
  76. package/src/commands/ai-video.ts +0 -915
  77. package/src/commands/ai-viral.ts +0 -595
  78. package/src/commands/ai-visual-fx.ts +0 -601
  79. package/src/commands/ai.test.ts +0 -627
  80. package/src/commands/ai.ts +0 -307
  81. package/src/commands/analyze.ts +0 -282
  82. package/src/commands/audio.ts +0 -644
  83. package/src/commands/batch.test.ts +0 -279
  84. package/src/commands/batch.ts +0 -440
  85. package/src/commands/detect.ts +0 -329
  86. package/src/commands/doctor.ts +0 -237
  87. package/src/commands/edit-cmd.ts +0 -1014
  88. package/src/commands/export.ts +0 -918
  89. package/src/commands/generate.ts +0 -2146
  90. package/src/commands/media.ts +0 -177
  91. package/src/commands/output.ts +0 -142
  92. package/src/commands/pipeline.ts +0 -398
  93. package/src/commands/project.test.ts +0 -127
  94. package/src/commands/project.ts +0 -149
  95. package/src/commands/sanitize.ts +0 -60
  96. package/src/commands/schema.ts +0 -130
  97. package/src/commands/setup.ts +0 -509
  98. package/src/commands/timeline.test.ts +0 -499
  99. package/src/commands/timeline.ts +0 -529
  100. package/src/commands/validate.ts +0 -77
  101. package/src/config/config.test.ts +0 -197
  102. package/src/config/index.ts +0 -125
  103. package/src/config/schema.ts +0 -82
  104. package/src/engine/index.ts +0 -2
  105. package/src/engine/project.test.ts +0 -702
  106. package/src/engine/project.ts +0 -439
  107. package/src/index.ts +0 -146
  108. package/src/utils/api-key.test.ts +0 -41
  109. package/src/utils/api-key.ts +0 -247
  110. package/src/utils/audio.ts +0 -83
  111. package/src/utils/exec-safe.ts +0 -75
  112. package/src/utils/first-run.ts +0 -52
  113. package/src/utils/provider-resolver.ts +0 -56
  114. package/src/utils/remotion.ts +0 -951
  115. package/src/utils/subtitle.test.ts +0 -227
  116. package/src/utils/subtitle.ts +0 -169
  117. package/src/utils/tty.ts +0 -196
  118. package/tsconfig.json +0 -20
@@ -1,197 +0,0 @@
1
- import { describe, it, expect, beforeEach, afterEach, vi } from "vitest";
2
- import { resolve } from "node:path";
3
- import { rm, mkdir, readFile } from "node:fs/promises";
4
- import { tmpdir } from "node:os";
5
- import {
6
- createDefaultConfig,
7
- PROVIDER_NAMES,
8
- PROVIDER_ENV_VARS,
9
- type VibeConfig,
10
- } from "./schema.js";
11
-
12
- // Mock homedir for tests
13
- const TEST_HOME = resolve(tmpdir(), `vibe-config-test-${Date.now()}`);
14
-
15
- vi.mock("node:os", async () => {
16
- const actual = await vi.importActual("node:os");
17
- return {
18
- ...(actual as object),
19
- homedir: () => TEST_HOME,
20
- };
21
- });
22
-
23
- // Import after mock
24
- const { loadConfig, saveConfig, isConfigured, CONFIG_DIR, CONFIG_PATH } = await import("./index.js");
25
-
26
- describe("Config Schema", () => {
27
- describe("createDefaultConfig", () => {
28
- it("creates a valid default configuration", () => {
29
- const config = createDefaultConfig();
30
-
31
- expect(config.version).toBe("1.0.0");
32
- expect(config.llm.provider).toBe("claude");
33
- expect(config.providers).toEqual({});
34
- expect(config.defaults.aspectRatio).toBe("16:9");
35
- expect(config.defaults.exportQuality).toBe("standard");
36
- expect(config.repl.autoSave).toBe(true);
37
- });
38
- });
39
-
40
- describe("PROVIDER_NAMES", () => {
41
- it("has display names for all providers", () => {
42
- expect(PROVIDER_NAMES.claude).toBe("Claude (Anthropic)");
43
- expect(PROVIDER_NAMES.openai).toBe("GPT-4 (OpenAI)");
44
- expect(PROVIDER_NAMES.gemini).toBe("Gemini (Google)");
45
- expect(PROVIDER_NAMES.ollama).toBe("Ollama (Local)");
46
- });
47
- });
48
-
49
- describe("PROVIDER_ENV_VARS", () => {
50
- it("has environment variables for all providers", () => {
51
- expect(PROVIDER_ENV_VARS.anthropic).toBe("ANTHROPIC_API_KEY");
52
- expect(PROVIDER_ENV_VARS.openai).toBe("OPENAI_API_KEY");
53
- expect(PROVIDER_ENV_VARS.google).toBe("GOOGLE_API_KEY");
54
- expect(PROVIDER_ENV_VARS.elevenlabs).toBe("ELEVENLABS_API_KEY");
55
- expect(PROVIDER_ENV_VARS.runway).toBe("RUNWAY_API_SECRET");
56
- expect(PROVIDER_ENV_VARS.kling).toBe("KLING_API_KEY");
57
- expect(PROVIDER_ENV_VARS.replicate).toBe("REPLICATE_API_TOKEN");
58
- });
59
- });
60
- });
61
-
62
- describe("Config Loader", () => {
63
- beforeEach(async () => {
64
- // Clean up test directory
65
- try {
66
- await rm(TEST_HOME, { recursive: true, force: true });
67
- } catch {
68
- // Ignore
69
- }
70
- });
71
-
72
- afterEach(async () => {
73
- // Clean up test directory
74
- try {
75
- await rm(TEST_HOME, { recursive: true, force: true });
76
- } catch {
77
- // Ignore
78
- }
79
- });
80
-
81
- describe("loadConfig", () => {
82
- it("returns null when config does not exist", async () => {
83
- const config = await loadConfig();
84
- expect(config).toBeNull();
85
- });
86
-
87
- it("loads existing config", async () => {
88
- // Create config directory and file
89
- await mkdir(CONFIG_DIR, { recursive: true });
90
- const testConfig: VibeConfig = {
91
- version: "1.0.0",
92
- llm: { provider: "openai" },
93
- providers: { openai: "test-key" },
94
- defaults: { aspectRatio: "9:16", exportQuality: "high" },
95
- repl: { autoSave: false },
96
- };
97
-
98
- const { writeFile: fsWrite } = await import("node:fs/promises");
99
- const { stringify } = await import("yaml");
100
- await fsWrite(CONFIG_PATH, stringify(testConfig), "utf-8");
101
-
102
- const loaded = await loadConfig();
103
- expect(loaded).not.toBeNull();
104
- expect(loaded?.llm.provider).toBe("openai");
105
- expect(loaded?.providers.openai).toBe("test-key");
106
- expect(loaded?.defaults.aspectRatio).toBe("9:16");
107
- expect(loaded?.repl.autoSave).toBe(false);
108
- });
109
-
110
- it("merges with defaults for missing fields", async () => {
111
- await mkdir(CONFIG_DIR, { recursive: true });
112
- const partialConfig = {
113
- version: "1.0.0",
114
- llm: { provider: "gemini" },
115
- providers: {},
116
- defaults: {},
117
- repl: {},
118
- };
119
-
120
- const { writeFile: fsWrite } = await import("node:fs/promises");
121
- const { stringify } = await import("yaml");
122
- await fsWrite(CONFIG_PATH, stringify(partialConfig), "utf-8");
123
-
124
- const loaded = await loadConfig();
125
- expect(loaded?.llm.provider).toBe("gemini");
126
- expect(loaded?.defaults.aspectRatio).toBe("16:9"); // Default
127
- expect(loaded?.repl.autoSave).toBe(true); // Default
128
- });
129
- });
130
-
131
- describe("saveConfig", () => {
132
- it("creates config directory and file", async () => {
133
- const config = createDefaultConfig();
134
- config.llm.provider = "openai";
135
- config.providers.openai = "sk-test-123";
136
-
137
- await saveConfig(config);
138
-
139
- const content = await readFile(CONFIG_PATH, "utf-8");
140
- expect(content).toContain("provider: openai");
141
- expect(content).toContain("openai: sk-test-123");
142
- });
143
-
144
- it("overwrites existing config", async () => {
145
- const config1 = createDefaultConfig();
146
- config1.llm.provider = "claude";
147
- await saveConfig(config1);
148
-
149
- const config2 = createDefaultConfig();
150
- config2.llm.provider = "gemini";
151
- await saveConfig(config2);
152
-
153
- const loaded = await loadConfig();
154
- expect(loaded?.llm.provider).toBe("gemini");
155
- });
156
- });
157
-
158
- describe("isConfigured", () => {
159
- it("returns false when no config exists", async () => {
160
- const configured = await isConfigured();
161
- expect(configured).toBe(false);
162
- });
163
-
164
- it("returns false when config exists but no API key", async () => {
165
- const config = createDefaultConfig();
166
- await saveConfig(config);
167
-
168
- const configured = await isConfigured();
169
- expect(configured).toBe(false);
170
- });
171
-
172
- it("returns true when API key is in config", async () => {
173
- const config = createDefaultConfig();
174
- config.llm.provider = "claude";
175
- config.providers.anthropic = "test-key";
176
- await saveConfig(config);
177
-
178
- const configured = await isConfigured();
179
- expect(configured).toBe(true);
180
- });
181
-
182
- it("returns true when API key is in environment", async () => {
183
- const config = createDefaultConfig();
184
- config.llm.provider = "openai";
185
- await saveConfig(config);
186
-
187
- // Set environment variable
188
- process.env.OPENAI_API_KEY = "test-env-key";
189
-
190
- const configured = await isConfigured();
191
- expect(configured).toBe(true);
192
-
193
- // Clean up
194
- delete process.env.OPENAI_API_KEY;
195
- });
196
- });
197
- });
@@ -1,125 +0,0 @@
1
- /**
2
- * Configuration loader/saver for VibeFrame CLI
3
- * Config stored at ~/.vibeframe/config.yaml
4
- */
5
-
6
- import { resolve } from "node:path";
7
- import { homedir } from "node:os";
8
- import { readFile, writeFile, mkdir, access } from "node:fs/promises";
9
- import { parse, stringify } from "yaml";
10
- import { type VibeConfig, createDefaultConfig, PROVIDER_ENV_VARS } from "./schema.js";
11
-
12
- /** Config directory path */
13
- export const CONFIG_DIR = resolve(homedir(), ".vibeframe");
14
-
15
- /** Config file path */
16
- export const CONFIG_PATH = resolve(CONFIG_DIR, "config.yaml");
17
-
18
- /**
19
- * Load configuration from ~/.vibeframe/config.yaml
20
- * Returns null if config doesn't exist
21
- */
22
- export async function loadConfig(): Promise<VibeConfig | null> {
23
- try {
24
- await access(CONFIG_PATH);
25
- const content = await readFile(CONFIG_PATH, "utf-8");
26
- const config = parse(content) as VibeConfig;
27
-
28
- // Merge with defaults to ensure all fields exist
29
- const defaults = createDefaultConfig();
30
- return {
31
- ...defaults,
32
- ...config,
33
- llm: { ...defaults.llm, ...config.llm },
34
- providers: { ...defaults.providers, ...config.providers },
35
- defaults: { ...defaults.defaults, ...config.defaults },
36
- repl: { ...defaults.repl, ...config.repl },
37
- };
38
- } catch {
39
- return null;
40
- }
41
- }
42
-
43
- /**
44
- * Save configuration to ~/.vibeframe/config.yaml
45
- */
46
- export async function saveConfig(config: VibeConfig): Promise<void> {
47
- // Ensure config directory exists
48
- await mkdir(CONFIG_DIR, { recursive: true });
49
-
50
- // Write config as YAML
51
- const content = stringify(config, {
52
- indent: 2,
53
- lineWidth: 0, // Don't wrap lines
54
- });
55
-
56
- await writeFile(CONFIG_PATH, content, "utf-8");
57
- }
58
-
59
- /**
60
- * Check if configuration exists and has required API key
61
- */
62
- export async function isConfigured(): Promise<boolean> {
63
- const config = await loadConfig();
64
- if (!config) return false;
65
-
66
- // Check if primary LLM provider has API key
67
- const provider = config.llm.provider;
68
- const providerKey = provider === "gemini" ? "google" : provider === "claude" ? "anthropic" : provider;
69
-
70
- // Check config first, then environment
71
- if (config.providers[providerKey as keyof typeof config.providers]) {
72
- return true;
73
- }
74
-
75
- const envVar = PROVIDER_ENV_VARS[providerKey];
76
- if (envVar && process.env[envVar]) {
77
- return true;
78
- }
79
-
80
- return false;
81
- }
82
-
83
- /**
84
- * Get API key from config, then environment
85
- * @param providerKey Provider key (e.g., "anthropic", "openai")
86
- * @returns API key or undefined
87
- */
88
- export async function getApiKeyFromConfig(
89
- providerKey: string
90
- ): Promise<string | undefined> {
91
- const config = await loadConfig();
92
-
93
- // Check config first
94
- if (config?.providers[providerKey as keyof typeof config.providers]) {
95
- return config.providers[providerKey as keyof typeof config.providers];
96
- }
97
-
98
- // Fall back to environment variable
99
- const envVar = PROVIDER_ENV_VARS[providerKey];
100
- if (envVar) {
101
- return process.env[envVar];
102
- }
103
-
104
- return undefined;
105
- }
106
-
107
- /**
108
- * Update a specific provider API key in config
109
- */
110
- export async function updateProviderKey(
111
- providerKey: string,
112
- apiKey: string
113
- ): Promise<void> {
114
- let config = await loadConfig();
115
- if (!config) {
116
- config = createDefaultConfig();
117
- }
118
-
119
- config.providers[providerKey as keyof typeof config.providers] = apiKey;
120
- await saveConfig(config);
121
- }
122
-
123
- // Re-export types
124
- export type { VibeConfig, LLMProvider } from "./schema.js";
125
- export { createDefaultConfig, PROVIDER_NAMES, PROVIDER_ENV_VARS } from "./schema.js";
@@ -1,82 +0,0 @@
1
- /**
2
- * Configuration schema for VibeFrame CLI
3
- * Stored at ~/.vibeframe/config.yaml
4
- */
5
-
6
- export type LLMProvider = "claude" | "openai" | "gemini" | "ollama" | "xai";
7
-
8
- export interface VibeConfig {
9
- /** Config file version */
10
- version: string;
11
-
12
- /** LLM provider settings */
13
- llm: {
14
- /** Primary LLM provider for AI commands */
15
- provider: LLMProvider;
16
- };
17
-
18
- /** API keys for various providers */
19
- providers: {
20
- anthropic?: string;
21
- openai?: string;
22
- google?: string;
23
- elevenlabs?: string;
24
- runway?: string;
25
- kling?: string;
26
- imgbb?: string;
27
- replicate?: string;
28
- xai?: string;
29
- };
30
-
31
- /** Default settings for new projects */
32
- defaults: {
33
- aspectRatio: "16:9" | "9:16" | "1:1" | "4:5";
34
- exportQuality: "draft" | "standard" | "high" | "ultra";
35
- };
36
-
37
- /** REPL settings */
38
- repl: {
39
- /** Auto-save project after each command */
40
- autoSave: boolean;
41
- };
42
- }
43
-
44
- /** Provider display names */
45
- export const PROVIDER_NAMES: Record<LLMProvider, string> = {
46
- claude: "Claude (Anthropic)",
47
- openai: "GPT-4 (OpenAI)",
48
- gemini: "Gemini (Google)",
49
- ollama: "Ollama (Local)",
50
- xai: "Grok (xAI)",
51
- };
52
-
53
- /** Environment variable mappings */
54
- export const PROVIDER_ENV_VARS: Record<string, string> = {
55
- anthropic: "ANTHROPIC_API_KEY",
56
- openai: "OPENAI_API_KEY",
57
- google: "GOOGLE_API_KEY",
58
- elevenlabs: "ELEVENLABS_API_KEY",
59
- runway: "RUNWAY_API_SECRET",
60
- kling: "KLING_API_KEY",
61
- imgbb: "IMGBB_API_KEY",
62
- replicate: "REPLICATE_API_TOKEN",
63
- xai: "XAI_API_KEY",
64
- };
65
-
66
- /** Default configuration */
67
- export function createDefaultConfig(): VibeConfig {
68
- return {
69
- version: "1.0.0",
70
- llm: {
71
- provider: "claude",
72
- },
73
- providers: {},
74
- defaults: {
75
- aspectRatio: "16:9",
76
- exportQuality: "standard",
77
- },
78
- repl: {
79
- autoSave: true,
80
- },
81
- };
82
- }
@@ -1,2 +0,0 @@
1
- export { Project, generateId } from "./project.js";
2
- export type { ProjectFile } from "./project.js";