@vibeframe/cli 0.104.3 → 0.105.2
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/agent/adapters/claude.d.ts +14 -0
- package/dist/agent/adapters/gemini.d.ts +14 -0
- package/dist/agent/adapters/index.d.ts +27 -0
- package/dist/agent/adapters/ollama.d.ts +19 -0
- package/dist/agent/adapters/openai.d.ts +14 -0
- package/dist/agent/adapters/openrouter.d.ts +15 -0
- package/dist/agent/adapters/openrouter.test.d.ts +4 -0
- package/dist/agent/adapters/xai.d.ts +14 -0
- package/dist/agent/index.d.ts +109 -0
- package/dist/agent/memory/index.d.ts +69 -0
- package/dist/agent/prompts/system.d.ts +5 -0
- package/dist/agent/tools/e2e.test.d.ts +25 -0
- package/dist/agent/tools/index.d.ts +59 -0
- package/dist/agent/tools/integration.test.d.ts +10 -0
- package/dist/agent/tools/scene.test.d.ts +1 -0
- package/dist/agent/types.d.ts +72 -0
- package/dist/commands/_shared/build-asset-metadata.d.ts +43 -0
- package/dist/commands/_shared/build-asset-reference.d.ts +18 -0
- package/dist/commands/_shared/build-backdrop-prompt.d.ts +8 -0
- package/dist/commands/_shared/build-backdrop-prompt.test.d.ts +1 -0
- package/dist/commands/_shared/build-cache.d.ts +37 -0
- package/dist/commands/_shared/build-plan.d.ts +107 -0
- package/dist/commands/_shared/build-plan.test.d.ts +1 -0
- package/dist/commands/_shared/compose-prompts.d.ts +97 -0
- package/dist/commands/_shared/compose-prompts.test.d.ts +1 -0
- package/dist/commands/_shared/compose-scenes-skills.d.ts +282 -0
- package/dist/commands/_shared/compose-scenes-skills.test.d.ts +1 -0
- package/dist/commands/_shared/composer-resolve.d.ts +47 -0
- package/dist/commands/_shared/composer-resolve.test.d.ts +1 -0
- package/dist/commands/_shared/cost-tier.d.ts +58 -0
- package/dist/commands/_shared/edit/_helpers.d.ts +12 -0
- package/dist/commands/_shared/edit/caption.d.ts +47 -0
- package/dist/commands/_shared/edit/fade.d.ts +38 -0
- package/dist/commands/_shared/edit/jump-cut.d.ts +80 -0
- package/dist/commands/_shared/edit/noise-reduce.d.ts +33 -0
- package/dist/commands/_shared/edit/silence-cut.d.ts +63 -0
- package/dist/commands/_shared/edit/text-overlay.d.ts +50 -0
- package/dist/commands/_shared/edit/translate-srt.d.ts +40 -0
- package/dist/commands/_shared/edit/video-review.d.ts +62 -0
- package/dist/commands/_shared/execute-fill-gaps.d.ts +97 -0
- package/dist/commands/_shared/hf-skill-bundle/bundle-content.d.ts +16 -0
- package/dist/commands/_shared/hf-skill-bundle/bundle.d.ts +57 -0
- package/dist/commands/_shared/hf-skill-bundle/bundle.test.d.ts +1 -0
- package/dist/commands/_shared/init-templates.d.ts +58 -0
- package/dist/commands/_shared/init-templates.test.d.ts +1 -0
- package/dist/commands/_shared/install-skill.d.ts +76 -0
- package/dist/commands/_shared/install-skill.test.d.ts +1 -0
- package/dist/commands/_shared/openai-image.d.ts +49 -0
- package/dist/commands/_shared/openai-image.test.d.ts +1 -0
- package/dist/commands/_shared/product-surface.d.ts +11 -0
- package/dist/commands/_shared/product-surface.test.d.ts +1 -0
- package/dist/commands/_shared/project-config.d.ts +60 -0
- package/dist/commands/_shared/render-inspect.d.ts +104 -0
- package/dist/commands/_shared/render-inspect.test.d.ts +1 -0
- package/dist/commands/_shared/review-report.d.ts +65 -0
- package/dist/commands/_shared/root-sync.d.ts +39 -0
- package/dist/commands/_shared/scene-audio-mux.d.ts +74 -0
- package/dist/commands/_shared/scene-audio-mux.test.d.ts +6 -0
- package/dist/commands/_shared/scene-audio-scan.d.ts +93 -0
- package/dist/commands/_shared/scene-audio-scan.test.d.ts +5 -0
- package/dist/commands/_shared/scene-build-mode.d.ts +4 -0
- package/dist/commands/_shared/scene-build-mode.test.d.ts +1 -0
- package/dist/commands/_shared/scene-build.d.ts +452 -0
- package/dist/commands/_shared/scene-build.test.d.ts +1 -0
- package/dist/commands/_shared/scene-html-emit.d.ts +139 -0
- package/dist/commands/_shared/scene-html-emit.test.d.ts +1 -0
- package/dist/commands/_shared/scene-inspect.d.ts +56 -0
- package/dist/commands/_shared/scene-inspect.test.d.ts +1 -0
- package/dist/commands/_shared/scene-lint.d.ts +109 -0
- package/dist/commands/_shared/scene-lint.test.d.ts +1 -0
- package/dist/commands/_shared/scene-project.d.ts +147 -0
- package/dist/commands/_shared/scene-project.test.d.ts +1 -0
- package/dist/commands/_shared/scene-render.d.ts +109 -0
- package/dist/commands/_shared/scene-render.test.d.ts +1 -0
- package/dist/commands/_shared/scene-repair.d.ts +22 -0
- package/dist/commands/_shared/scene-repair.test.d.ts +1 -0
- package/dist/commands/_shared/status-jobs.d.ts +197 -0
- package/dist/commands/_shared/status-jobs.test.d.ts +1 -0
- package/dist/commands/_shared/storyboard-draft.d.ts +13 -0
- package/dist/commands/_shared/storyboard-draft.test.d.ts +1 -0
- package/dist/commands/_shared/storyboard-edit.d.ts +26 -0
- package/dist/commands/_shared/storyboard-edit.test.d.ts +1 -0
- package/dist/commands/_shared/storyboard-parse.d.ts +159 -0
- package/dist/commands/_shared/storyboard-parse.test.d.ts +1 -0
- package/dist/commands/_shared/storyboard-revise.d.ts +32 -0
- package/dist/commands/_shared/storyboard-revise.test.d.ts +1 -0
- package/dist/commands/_shared/timeline-project.d.ts +32 -0
- package/dist/commands/_shared/tts-resolve.d.ts +75 -0
- package/dist/commands/_shared/tts-resolve.test.d.ts +5 -0
- package/dist/commands/_shared/video-providers.d.ts +44 -0
- package/dist/commands/_shared/video-utils.d.ts +71 -0
- package/dist/commands/_shared/visual-styles.d.ts +55 -0
- package/dist/commands/_shared/visual-styles.test.d.ts +1 -0
- package/dist/commands/_shared/walkthroughs/walkthroughs.d.ts +47 -0
- package/dist/commands/_shared/walkthroughs/walkthroughs.test.d.ts +1 -0
- package/dist/commands/agent.d.ts +24 -0
- package/dist/commands/ai-analyze.d.ts +105 -0
- package/dist/commands/ai-animated-caption.d.ts +63 -0
- package/dist/commands/ai-audio.d.ts +92 -0
- package/dist/commands/ai-edit-cli.d.ts +13 -0
- package/dist/commands/ai-edit.d.ts +29 -0
- package/dist/commands/ai-fill-gaps.d.ts +15 -0
- package/dist/commands/ai-helpers.d.ts +26 -0
- package/dist/commands/ai-highlights.d.ts +126 -0
- package/dist/commands/ai-image.d.ts +71 -0
- package/dist/commands/ai-motion.d.ts +53 -0
- package/dist/commands/ai-review.d.ts +58 -0
- package/dist/commands/ai-script-pipeline-cli.d.ts +10 -0
- package/dist/commands/ai-script-pipeline.d.ts +74 -0
- package/dist/commands/ai-suggest-edit.d.ts +32 -0
- package/dist/commands/ai-video.d.ts +95 -0
- package/dist/commands/ai.test.d.ts +1 -0
- package/dist/commands/audio.d.ts +17 -0
- package/dist/commands/batch.d.ts +2 -0
- package/dist/commands/batch.test.d.ts +1 -0
- package/dist/commands/build.d.ts +2 -0
- package/dist/commands/completion.d.ts +20 -0
- package/dist/commands/completion.test.d.ts +1 -0
- package/dist/commands/context.d.ts +7 -0
- package/dist/commands/context.test.d.ts +1 -0
- package/dist/commands/demo.d.ts +6 -0
- package/dist/commands/detect.d.ts +55 -0
- package/dist/commands/doctor.d.ts +5 -0
- package/dist/commands/doctor.test.d.ts +1 -0
- package/dist/commands/edit/motion-overlay.d.ts +30 -0
- package/dist/commands/edit-cmd.d.ts +112 -0
- package/dist/commands/envelope-snapshots.test.d.ts +32 -0
- package/dist/commands/export.d.ts +60 -0
- package/dist/commands/export.test.d.ts +1 -0
- package/dist/commands/generate/background.d.ts +22 -0
- package/dist/commands/generate/image.d.ts +8 -0
- package/dist/commands/generate/music-status.d.ts +20 -0
- package/dist/commands/generate/music.d.ts +27 -0
- package/dist/commands/generate/sound-effect.d.ts +19 -0
- package/dist/commands/generate/speech.d.ts +21 -0
- package/dist/commands/generate/storyboard.d.ts +27 -0
- package/dist/commands/generate/thumbnail.d.ts +8 -0
- package/dist/commands/generate/video-cancel.d.ts +8 -0
- package/dist/commands/generate/video-extend.d.ts +8 -0
- package/dist/commands/generate/video-status.d.ts +8 -0
- package/dist/commands/generate/video.d.ts +8 -0
- package/dist/commands/generate.d.ts +36 -0
- package/dist/commands/init.d.ts +24 -0
- package/dist/commands/init.test.d.ts +1 -0
- package/dist/commands/inspect.d.ts +20 -0
- package/dist/commands/media.d.ts +2 -0
- package/dist/commands/output.d.ts +80 -0
- package/dist/commands/output.test.d.ts +1 -0
- package/dist/commands/plan.d.ts +2 -0
- package/dist/commands/project.d.ts +2 -0
- package/dist/commands/project.test.d.ts +1 -0
- package/dist/commands/provider-config-cli.test.d.ts +1 -0
- package/dist/commands/q-flag-collision.test.d.ts +1 -0
- package/dist/commands/remix.d.ts +20 -0
- package/dist/commands/render.d.ts +2 -0
- package/dist/commands/run.d.ts +14 -0
- package/dist/commands/sanitize.d.ts +20 -0
- package/dist/commands/scene.d.ts +92 -0
- package/dist/commands/scene.test.d.ts +1 -0
- package/dist/commands/schema.d.ts +12 -0
- package/dist/commands/setup.d.ts +5 -0
- package/dist/commands/setup.test.d.ts +1 -0
- package/dist/commands/status.d.ts +2 -0
- package/dist/commands/storyboard.d.ts +2 -0
- package/dist/commands/timeline.d.ts +2 -0
- package/dist/commands/timeline.test.d.ts +1 -0
- package/dist/commands/validate.d.ts +33 -0
- package/dist/commands/walkthrough.d.ts +21 -0
- package/dist/config/config.test.d.ts +1 -0
- package/dist/config/index.d.ts +110 -0
- package/dist/config/schema.d.ts +64 -0
- package/dist/config/scope.test.d.ts +1 -0
- package/dist/engine/index.d.ts +2 -0
- package/dist/engine/index.js +345 -0
- package/dist/engine/project.d.ts +93 -0
- package/dist/engine/project.test.d.ts +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +483 -291
- package/dist/pipeline/executor.d.ts +27 -0
- package/dist/pipeline/generate-actions.test.d.ts +1 -0
- package/dist/pipeline/index.d.ts +3 -0
- package/dist/pipeline/renderers/__tests__/html-template.test.d.ts +1 -0
- package/dist/pipeline/renderers/__tests__/integration.test.d.ts +1 -0
- package/dist/pipeline/renderers/chrome.d.ts +25 -0
- package/dist/pipeline/renderers/html-clips.d.ts +19 -0
- package/dist/pipeline/renderers/html-runtime.d.ts +6 -0
- package/dist/pipeline/renderers/html-template.d.ts +2 -0
- package/dist/pipeline/renderers/hyperframes.d.ts +7 -0
- package/dist/pipeline/renderers/project-builder.d.ts +7 -0
- package/dist/pipeline/renderers/types.d.ts +39 -0
- package/dist/pipeline/resolver.d.ts +19 -0
- package/dist/pipeline/scene-actions.test.d.ts +1 -0
- package/dist/pipeline/types.d.ts +81 -0
- package/dist/tools/adapters/agent.d.ts +9 -0
- package/dist/tools/adapters/agent.js +188 -0
- package/dist/tools/adapters/mcp.d.ts +34 -0
- package/dist/tools/adapters/mcp.js +173 -0
- package/dist/tools/define-tool.d.ts +82 -0
- package/dist/tools/define-tool.js +214 -0
- package/dist/tools/manifest/_project-io.d.ts +13 -0
- package/dist/tools/manifest/agent-only.d.ts +236 -0
- package/dist/tools/manifest/audio.d.ts +93 -0
- package/dist/tools/manifest/detect.d.ts +47 -0
- package/dist/tools/manifest/edit.d.ts +398 -0
- package/dist/tools/manifest/export.d.ts +27 -0
- package/dist/tools/manifest/generate.d.ts +307 -0
- package/dist/tools/manifest/index.d.ts +22 -0
- package/dist/tools/manifest/index.js +60628 -0
- package/dist/tools/manifest/inspect.d.ts +139 -0
- package/dist/tools/manifest/project.d.ts +33 -0
- package/dist/tools/manifest/remix.d.ts +154 -0
- package/dist/tools/manifest/scene.d.ts +221 -0
- package/dist/tools/manifest/status.d.ts +36 -0
- package/dist/tools/manifest/storyboard.d.ts +136 -0
- package/dist/tools/manifest/timeline.d.ts +173 -0
- package/dist/tools/manifest/walkthrough.d.ts +22 -0
- package/dist/tools/manifest.test.d.ts +13 -0
- package/dist/tools/zod-to-json-schema.d.ts +47 -0
- package/dist/utils/agent-host-detect.d.ts +61 -0
- package/dist/utils/agent-host-detect.test.d.ts +1 -0
- package/dist/utils/api-key.d.ts +58 -0
- package/dist/utils/api-key.test.d.ts +1 -0
- package/dist/utils/audio.d.ts +22 -0
- package/dist/utils/clipboard.d.ts +27 -0
- package/dist/utils/clipboard.test.d.ts +1 -0
- package/dist/utils/exec-safe.d.ts +21 -0
- package/dist/utils/first-run.d.ts +16 -0
- package/dist/utils/input-validation.d.ts +26 -0
- package/dist/utils/key-format.d.ts +15 -0
- package/dist/utils/key-live-test.d.ts +29 -0
- package/dist/utils/key-live-test.test.d.ts +1 -0
- package/dist/utils/open-url.d.ts +26 -0
- package/dist/utils/open-url.test.d.ts +1 -0
- package/dist/utils/project-resolver.d.ts +30 -0
- package/dist/utils/project-resolver.test.d.ts +8 -0
- package/dist/utils/provider-resolver.d.ts +32 -0
- package/dist/utils/provider-resolver.test.d.ts +13 -0
- package/dist/utils/remotion.d.ts +201 -0
- package/dist/utils/subtitle.d.ts +64 -0
- package/dist/utils/subtitle.test.d.ts +1 -0
- package/dist/utils/tty.d.ts +86 -0
- package/dist/utils/tty.test.d.ts +1 -0
- package/dist/utils/upload-host.d.ts +15 -0
- package/dist/utils/upload-host.test.d.ts +1 -0
- package/package.json +15 -115
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Claude LLM Adapter with tool_use
|
|
3
|
+
*/
|
|
4
|
+
import type { LLMAdapter } from "./index.js";
|
|
5
|
+
import type { ToolDefinition, LLMResponse, AgentMessage, LLMProvider } from "../types.js";
|
|
6
|
+
export declare class ClaudeAdapter implements LLMAdapter {
|
|
7
|
+
readonly provider: LLMProvider;
|
|
8
|
+
private client;
|
|
9
|
+
private model;
|
|
10
|
+
initialize(apiKey: string): Promise<void>;
|
|
11
|
+
isInitialized(): boolean;
|
|
12
|
+
setModel(model: string): void;
|
|
13
|
+
chat(messages: AgentMessage[], tools: ToolDefinition[]): Promise<LLMResponse>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gemini LLM Adapter with Function Calling
|
|
3
|
+
*/
|
|
4
|
+
import type { LLMAdapter } from "./index.js";
|
|
5
|
+
import type { ToolDefinition, LLMResponse, AgentMessage, LLMProvider } from "../types.js";
|
|
6
|
+
export declare class GeminiAdapter implements LLMAdapter {
|
|
7
|
+
readonly provider: LLMProvider;
|
|
8
|
+
private client;
|
|
9
|
+
private model;
|
|
10
|
+
initialize(apiKey: string): Promise<void>;
|
|
11
|
+
isInitialized(): boolean;
|
|
12
|
+
setModel(model: string): void;
|
|
13
|
+
chat(messages: AgentMessage[], tools: ToolDefinition[]): Promise<LLMResponse>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LLM Adapter Interface and Factory
|
|
3
|
+
*/
|
|
4
|
+
import type { ToolDefinition, LLMResponse, AgentMessage, LLMProvider } from "../types.js";
|
|
5
|
+
/**
|
|
6
|
+
* Abstract interface for LLM providers
|
|
7
|
+
*/
|
|
8
|
+
export interface LLMAdapter {
|
|
9
|
+
/** Provider name */
|
|
10
|
+
readonly provider: LLMProvider;
|
|
11
|
+
/** Initialize the adapter with API key */
|
|
12
|
+
initialize(apiKey: string): Promise<void>;
|
|
13
|
+
/** Check if adapter is initialized */
|
|
14
|
+
isInitialized(): boolean;
|
|
15
|
+
/** Send messages with tools and get response */
|
|
16
|
+
chat(messages: AgentMessage[], tools: ToolDefinition[]): Promise<LLMResponse>;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Factory for creating LLM adapters
|
|
20
|
+
*/
|
|
21
|
+
export declare function createAdapter(provider: LLMProvider): Promise<LLMAdapter>;
|
|
22
|
+
export { OpenAIAdapter } from "./openai.js";
|
|
23
|
+
export { ClaudeAdapter } from "./claude.js";
|
|
24
|
+
export { GeminiAdapter } from "./gemini.js";
|
|
25
|
+
export { OllamaAdapter } from "./ollama.js";
|
|
26
|
+
export { XAIAdapter } from "./xai.js";
|
|
27
|
+
export { OpenRouterAdapter } from "./openrouter.js";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ollama LLM Adapter with JSON-based tool calling
|
|
3
|
+
* Uses prompt engineering to simulate tool calling for local models
|
|
4
|
+
*/
|
|
5
|
+
import type { LLMAdapter } from "./index.js";
|
|
6
|
+
import type { ToolDefinition, LLMResponse, AgentMessage, LLMProvider } from "../types.js";
|
|
7
|
+
export declare class OllamaAdapter implements LLMAdapter {
|
|
8
|
+
readonly provider: LLMProvider;
|
|
9
|
+
private baseUrl;
|
|
10
|
+
private model;
|
|
11
|
+
private initialized;
|
|
12
|
+
initialize(apiKey: string): Promise<void>;
|
|
13
|
+
isInitialized(): boolean;
|
|
14
|
+
setModel(model: string): void;
|
|
15
|
+
setBaseUrl(url: string): void;
|
|
16
|
+
chat(messages: AgentMessage[], tools: ToolDefinition[]): Promise<LLMResponse>;
|
|
17
|
+
private parseToolCalls;
|
|
18
|
+
private extractTextBeforeJson;
|
|
19
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenAI LLM Adapter with Function Calling
|
|
3
|
+
*/
|
|
4
|
+
import type { LLMAdapter } from "./index.js";
|
|
5
|
+
import type { ToolDefinition, LLMResponse, AgentMessage, LLMProvider } from "../types.js";
|
|
6
|
+
export declare class OpenAIAdapter implements LLMAdapter {
|
|
7
|
+
readonly provider: LLMProvider;
|
|
8
|
+
private client;
|
|
9
|
+
private model;
|
|
10
|
+
initialize(apiKey: string): Promise<void>;
|
|
11
|
+
isInitialized(): boolean;
|
|
12
|
+
setModel(model: string): void;
|
|
13
|
+
chat(messages: AgentMessage[], tools: ToolDefinition[]): Promise<LLMResponse>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenRouter LLM Adapter (OpenAI-compatible)
|
|
3
|
+
* Routes to 300+ models via https://openrouter.ai/api/v1
|
|
4
|
+
*/
|
|
5
|
+
import type { LLMAdapter } from "./index.js";
|
|
6
|
+
import type { ToolDefinition, LLMResponse, AgentMessage, LLMProvider } from "../types.js";
|
|
7
|
+
export declare class OpenRouterAdapter implements LLMAdapter {
|
|
8
|
+
readonly provider: LLMProvider;
|
|
9
|
+
private client;
|
|
10
|
+
private model;
|
|
11
|
+
initialize(apiKey: string): Promise<void>;
|
|
12
|
+
isInitialized(): boolean;
|
|
13
|
+
setModel(model: string): void;
|
|
14
|
+
chat(messages: AgentMessage[], tools: ToolDefinition[]): Promise<LLMResponse>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* xAI Grok LLM Adapter (OpenAI-compatible)
|
|
3
|
+
*/
|
|
4
|
+
import type { LLMAdapter } from "./index.js";
|
|
5
|
+
import type { ToolDefinition, LLMResponse, AgentMessage, LLMProvider } from "../types.js";
|
|
6
|
+
export declare class XAIAdapter implements LLMAdapter {
|
|
7
|
+
readonly provider: LLMProvider;
|
|
8
|
+
private client;
|
|
9
|
+
private model;
|
|
10
|
+
initialize(apiKey: string): Promise<void>;
|
|
11
|
+
isInitialized(): boolean;
|
|
12
|
+
setModel(model: string): void;
|
|
13
|
+
chat(messages: AgentMessage[], tools: ToolDefinition[]): Promise<LLMResponse>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AgentExecutor - Main Agentic Loop
|
|
3
|
+
* Orchestrates LLM reasoning and tool execution
|
|
4
|
+
*/
|
|
5
|
+
import type { AgentMessage, AgentContext, ToolDefinition, LLMProvider } from "./types.js";
|
|
6
|
+
export interface AgentExecutorOptions {
|
|
7
|
+
provider: LLMProvider;
|
|
8
|
+
apiKey: string;
|
|
9
|
+
model?: string;
|
|
10
|
+
maxTurns?: number;
|
|
11
|
+
verbose?: boolean;
|
|
12
|
+
projectPath?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Callback to confirm before executing each tool.
|
|
15
|
+
* Return true to execute, false to skip.
|
|
16
|
+
*
|
|
17
|
+
* The `cost` argument is the tool's declared cost tier (free / low /
|
|
18
|
+
* medium / high / very-high) so the prompt can warn about expensive
|
|
19
|
+
* calls. `undefined` for tools that didn't declare a tier.
|
|
20
|
+
*/
|
|
21
|
+
confirmCallback?: (toolName: string, args: Record<string, unknown>, cost: ToolDefinition["cost"]) => Promise<boolean>;
|
|
22
|
+
/**
|
|
23
|
+
* When true, prompt before every tool call. When false (default), the
|
|
24
|
+
* cost gate in `executeTool` fires only for high/very-high tools.
|
|
25
|
+
* Set by `--confirm` CLI flag.
|
|
26
|
+
*/
|
|
27
|
+
confirmAlways?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Disable all confirm prompts, even for high/very-high cost tools.
|
|
30
|
+
* For automated agent sessions where every tool call must run
|
|
31
|
+
* unattended. Set by `--no-confirm` CLI flag.
|
|
32
|
+
*/
|
|
33
|
+
noConfirm?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Cumulative USD ceiling for the agent session. When set, each tool
|
|
36
|
+
* call's tier-derived estimate is added to a running total; if the
|
|
37
|
+
* next call would push the total over `budgetUsd`, the executor
|
|
38
|
+
* skips it and returns a "budget exceeded" tool result so the LLM
|
|
39
|
+
* can adapt or stop. Mirrors `vibe run --budget-usd`. `undefined`
|
|
40
|
+
* disables the cap.
|
|
41
|
+
*/
|
|
42
|
+
budgetUsd?: number;
|
|
43
|
+
}
|
|
44
|
+
export interface ExecutionResult {
|
|
45
|
+
response: string;
|
|
46
|
+
toolsUsed: string[];
|
|
47
|
+
turns: number;
|
|
48
|
+
}
|
|
49
|
+
export declare class AgentExecutor {
|
|
50
|
+
private adapter;
|
|
51
|
+
private registry;
|
|
52
|
+
private memory;
|
|
53
|
+
private cumulativeUsd;
|
|
54
|
+
private context;
|
|
55
|
+
private config;
|
|
56
|
+
private initialized;
|
|
57
|
+
constructor(options: AgentExecutorOptions);
|
|
58
|
+
/**
|
|
59
|
+
* Initialize the agent
|
|
60
|
+
*/
|
|
61
|
+
initialize(): Promise<void>;
|
|
62
|
+
/**
|
|
63
|
+
* Execute a user request
|
|
64
|
+
*/
|
|
65
|
+
execute(userInput: string): Promise<ExecutionResult>;
|
|
66
|
+
/**
|
|
67
|
+
* Execute a single tool
|
|
68
|
+
*
|
|
69
|
+
* Confirm-prompt logic:
|
|
70
|
+
* - `noConfirm: true` → never prompt (automation / CI)
|
|
71
|
+
* - `confirmAlways: true` → prompt for every tool call
|
|
72
|
+
* - default → prompt only when the tool's
|
|
73
|
+
* cost is high/very-high (the
|
|
74
|
+
* `costGate`)
|
|
75
|
+
*
|
|
76
|
+
* The two non-trivial cases require `confirmCallback` to be set; if
|
|
77
|
+
* it isn't, no prompt fires and the tool runs.
|
|
78
|
+
*/
|
|
79
|
+
private executeTool;
|
|
80
|
+
/**
|
|
81
|
+
* Cumulative tier-estimated USD spent in this session. Updates after
|
|
82
|
+
* every successful tool call. Useful for status output / `tools` REPL.
|
|
83
|
+
*/
|
|
84
|
+
getCumulativeUsd(): number;
|
|
85
|
+
/**
|
|
86
|
+
* Update context (e.g., when project changes)
|
|
87
|
+
*/
|
|
88
|
+
updateContext(updates: Partial<AgentContext>): void;
|
|
89
|
+
/**
|
|
90
|
+
* Reset conversation memory
|
|
91
|
+
*/
|
|
92
|
+
reset(): void;
|
|
93
|
+
/**
|
|
94
|
+
* Get current context
|
|
95
|
+
*/
|
|
96
|
+
getContext(): AgentContext;
|
|
97
|
+
/**
|
|
98
|
+
* Get conversation history
|
|
99
|
+
*/
|
|
100
|
+
getHistory(): AgentMessage[];
|
|
101
|
+
/**
|
|
102
|
+
* Get available tools
|
|
103
|
+
*/
|
|
104
|
+
getTools(): string[];
|
|
105
|
+
}
|
|
106
|
+
export type { AgentConfig, AgentContext, AgentMessage, ToolCall, ToolResult } from "./types.js";
|
|
107
|
+
export type { LLMAdapter } from "./adapters/index.js";
|
|
108
|
+
export { ToolRegistry, registerAllTools } from "./tools/index.js";
|
|
109
|
+
export { ConversationMemory } from "./memory/index.js";
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Conversation Memory Management
|
|
3
|
+
*/
|
|
4
|
+
import type { AgentMessage, ToolCall, ToolResult } from "../types.js";
|
|
5
|
+
/**
|
|
6
|
+
* ConversationMemory class
|
|
7
|
+
* Manages conversation history for the agent
|
|
8
|
+
*/
|
|
9
|
+
export declare class ConversationMemory {
|
|
10
|
+
private messages;
|
|
11
|
+
private maxMessages;
|
|
12
|
+
constructor(maxMessages?: number);
|
|
13
|
+
/**
|
|
14
|
+
* Add a system message
|
|
15
|
+
*/
|
|
16
|
+
addSystem(content: string): void;
|
|
17
|
+
/**
|
|
18
|
+
* Add a user message
|
|
19
|
+
*/
|
|
20
|
+
addUser(content: string): void;
|
|
21
|
+
/**
|
|
22
|
+
* Add an assistant message
|
|
23
|
+
*/
|
|
24
|
+
addAssistant(content: string, toolCalls?: ToolCall[]): void;
|
|
25
|
+
/**
|
|
26
|
+
* Add a tool result message
|
|
27
|
+
*/
|
|
28
|
+
addToolResult(toolCallId: string, result: ToolResult): void;
|
|
29
|
+
/**
|
|
30
|
+
* Get all messages
|
|
31
|
+
*/
|
|
32
|
+
getMessages(): AgentMessage[];
|
|
33
|
+
/**
|
|
34
|
+
* Get messages for a specific role
|
|
35
|
+
*/
|
|
36
|
+
getByRole(role: AgentMessage["role"]): AgentMessage[];
|
|
37
|
+
/**
|
|
38
|
+
* Get the last N messages
|
|
39
|
+
*/
|
|
40
|
+
getLast(n: number): AgentMessage[];
|
|
41
|
+
/**
|
|
42
|
+
* Clear all messages except system
|
|
43
|
+
*/
|
|
44
|
+
clear(): void;
|
|
45
|
+
/**
|
|
46
|
+
* Clear all messages including system
|
|
47
|
+
*/
|
|
48
|
+
clearAll(): void;
|
|
49
|
+
/**
|
|
50
|
+
* Get message count
|
|
51
|
+
*/
|
|
52
|
+
get length(): number;
|
|
53
|
+
/**
|
|
54
|
+
* Trim messages to max limit (keep system + most recent)
|
|
55
|
+
*/
|
|
56
|
+
private trim;
|
|
57
|
+
/**
|
|
58
|
+
* Summarize conversation for context compression
|
|
59
|
+
*/
|
|
60
|
+
summarize(): string;
|
|
61
|
+
/**
|
|
62
|
+
* Export conversation as JSON
|
|
63
|
+
*/
|
|
64
|
+
toJSON(): AgentMessage[];
|
|
65
|
+
/**
|
|
66
|
+
* Import conversation from JSON
|
|
67
|
+
*/
|
|
68
|
+
fromJSON(messages: AgentMessage[]): void;
|
|
69
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* E2E Tests: AI Pipeline Tools with Real API Calls
|
|
3
|
+
*
|
|
4
|
+
* ⚠️ WARNING: These tests make REAL API calls and incur COSTS!
|
|
5
|
+
*
|
|
6
|
+
* To run these tests:
|
|
7
|
+
* RUN_E2E=1 pnpm vitest run src/agent/tools/e2e.test.ts
|
|
8
|
+
*
|
|
9
|
+
* Required API keys (set in ~/.vibeframe/config.yaml or env):
|
|
10
|
+
* - ANTHROPIC_API_KEY (Claude - storyboard)
|
|
11
|
+
* - GOOGLE_API_KEY (Gemini - image, video analysis)
|
|
12
|
+
* - OPENAI_API_KEY (Whisper - transcription)
|
|
13
|
+
* - ELEVENLABS_API_KEY (TTS)
|
|
14
|
+
*
|
|
15
|
+
* Estimated costs per full run:
|
|
16
|
+
* - ai_gemini_video: ~$0.01-0.05 (depending on video length)
|
|
17
|
+
* - ai_storyboard: ~$0.01-0.02
|
|
18
|
+
* - ai_image (gemini): Free tier available
|
|
19
|
+
* - ai_tts: ~$0.01-0.05 (depending on text length)
|
|
20
|
+
* - ai_script_to_video (images-only): ~$0.05-0.20
|
|
21
|
+
* - ai_highlights (with Gemini): ~$0.05-0.20
|
|
22
|
+
*
|
|
23
|
+
* Total estimated cost: $0.10-0.50 per full run
|
|
24
|
+
*/
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool Registry - Central registry for all agent tools
|
|
3
|
+
*/
|
|
4
|
+
import type { ToolDefinition, ToolResult, AgentContext } from "../types.js";
|
|
5
|
+
export type ToolHandler = (args: Record<string, unknown>, context: AgentContext) => Promise<ToolResult>;
|
|
6
|
+
/**
|
|
7
|
+
* Tool Registry class
|
|
8
|
+
* Manages tool definitions and execution
|
|
9
|
+
*/
|
|
10
|
+
export declare class ToolRegistry {
|
|
11
|
+
private tools;
|
|
12
|
+
/**
|
|
13
|
+
* Register a tool
|
|
14
|
+
*/
|
|
15
|
+
register(definition: ToolDefinition, handler: ToolHandler): void;
|
|
16
|
+
/**
|
|
17
|
+
* Get all tool definitions
|
|
18
|
+
*/
|
|
19
|
+
getDefinitions(): ToolDefinition[];
|
|
20
|
+
/**
|
|
21
|
+
* Get a specific tool definition
|
|
22
|
+
*/
|
|
23
|
+
getDefinition(name: string): ToolDefinition | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* Get a specific tool definition (alias for getDefinition)
|
|
26
|
+
*/
|
|
27
|
+
get(name: string): ToolDefinition | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* Get all tool definitions (alias for getDefinitions)
|
|
30
|
+
*/
|
|
31
|
+
getAll(): ToolDefinition[];
|
|
32
|
+
/**
|
|
33
|
+
* Get a tool handler by name
|
|
34
|
+
*/
|
|
35
|
+
getHandler(name: string): ToolHandler | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* Execute a tool
|
|
38
|
+
*/
|
|
39
|
+
execute(name: string, args: Record<string, unknown>, context: AgentContext): Promise<ToolResult>;
|
|
40
|
+
/**
|
|
41
|
+
* Check if a tool exists
|
|
42
|
+
*/
|
|
43
|
+
has(name: string): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Get tool count
|
|
46
|
+
*/
|
|
47
|
+
get size(): number;
|
|
48
|
+
/**
|
|
49
|
+
* List all tool names
|
|
50
|
+
*/
|
|
51
|
+
list(): string[];
|
|
52
|
+
}
|
|
53
|
+
export declare const toolRegistry: ToolRegistry;
|
|
54
|
+
/**
|
|
55
|
+
* Register all tools. The manifest (`packages/cli/src/tools/manifest/`) is
|
|
56
|
+
* now the single source of truth for every Agent tool. v0.67 PR2 finished
|
|
57
|
+
* the migration — there are no legacy `register*Tools` left.
|
|
58
|
+
*/
|
|
59
|
+
export declare function registerAllTools(registry: ToolRegistry): Promise<void>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Integration Tests: CLI ↔ Agent Tool Synchronization
|
|
3
|
+
*
|
|
4
|
+
* These tests verify that:
|
|
5
|
+
* 1. All Agent tools are properly registered
|
|
6
|
+
* 2. Agent tools correctly wrap CLI functions
|
|
7
|
+
* 3. Parameter schemas match between CLI and Agent
|
|
8
|
+
* 4. Tool handlers produce expected output formats
|
|
9
|
+
*/
|
|
10
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core types for the VibeFrame Agentic System
|
|
3
|
+
*/
|
|
4
|
+
export interface ToolParameter {
|
|
5
|
+
type: "string" | "number" | "boolean" | "array" | "object";
|
|
6
|
+
description: string;
|
|
7
|
+
required?: boolean;
|
|
8
|
+
enum?: string[];
|
|
9
|
+
items?: ToolParameter;
|
|
10
|
+
properties?: Record<string, ToolParameter>;
|
|
11
|
+
}
|
|
12
|
+
export interface ToolDefinition {
|
|
13
|
+
name: string;
|
|
14
|
+
description: string;
|
|
15
|
+
/**
|
|
16
|
+
* Product-facing classification propagated from the manifest. This is
|
|
17
|
+
* separate from MCP/agent transport exposure and helps agents prefer the
|
|
18
|
+
* intended public workflow over legacy or internal primitives.
|
|
19
|
+
*/
|
|
20
|
+
surface?: "public" | "agent" | "advanced" | "legacy" | "internal";
|
|
21
|
+
replacement?: string;
|
|
22
|
+
note?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Cost tier propagated from the manifest's `defineTool` declaration.
|
|
25
|
+
* Five tiers (free / low / medium / high / very-high). Used by the
|
|
26
|
+
* agent executor to decide whether a confirm prompt is mandatory.
|
|
27
|
+
*/
|
|
28
|
+
cost?: "free" | "low" | "medium" | "high" | "very-high";
|
|
29
|
+
parameters: {
|
|
30
|
+
type: "object";
|
|
31
|
+
properties: Record<string, ToolParameter>;
|
|
32
|
+
required: string[];
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export interface ToolCall {
|
|
36
|
+
id: string;
|
|
37
|
+
name: string;
|
|
38
|
+
arguments: Record<string, unknown>;
|
|
39
|
+
}
|
|
40
|
+
export interface ToolResult {
|
|
41
|
+
toolCallId: string;
|
|
42
|
+
success: boolean;
|
|
43
|
+
output: string;
|
|
44
|
+
error?: string;
|
|
45
|
+
}
|
|
46
|
+
export interface AgentMessage {
|
|
47
|
+
role: "system" | "user" | "assistant" | "tool";
|
|
48
|
+
content: string;
|
|
49
|
+
toolCalls?: ToolCall[];
|
|
50
|
+
toolCallId?: string;
|
|
51
|
+
}
|
|
52
|
+
export interface AgentConfig {
|
|
53
|
+
provider: LLMProvider;
|
|
54
|
+
model?: string;
|
|
55
|
+
maxTurns?: number;
|
|
56
|
+
verbose?: boolean;
|
|
57
|
+
}
|
|
58
|
+
export type LLMProvider = "openai" | "claude" | "gemini" | "ollama" | "xai" | "openrouter";
|
|
59
|
+
export interface LLMResponse {
|
|
60
|
+
content: string;
|
|
61
|
+
toolCalls?: ToolCall[];
|
|
62
|
+
finishReason: "stop" | "tool_calls" | "length" | "error";
|
|
63
|
+
}
|
|
64
|
+
export interface AgentContext {
|
|
65
|
+
projectPath: string | null;
|
|
66
|
+
workingDirectory: string;
|
|
67
|
+
}
|
|
68
|
+
export interface AgentTurn {
|
|
69
|
+
input: string;
|
|
70
|
+
response: string;
|
|
71
|
+
toolsUsed: string[];
|
|
72
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { BuildAssetKind } from "./build-cache.js";
|
|
2
|
+
export type AssetFreshness = "fresh" | "stale" | "unknown" | "referenced";
|
|
3
|
+
export interface BuildAssetMetadata {
|
|
4
|
+
schemaVersion: "1";
|
|
5
|
+
kind: BuildAssetKind;
|
|
6
|
+
beatId: string;
|
|
7
|
+
cue: string;
|
|
8
|
+
provider: string;
|
|
9
|
+
options?: Record<string, unknown>;
|
|
10
|
+
cacheKey: string;
|
|
11
|
+
canonicalPath: string;
|
|
12
|
+
cachePath?: string;
|
|
13
|
+
updatedAt: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function assetMetadataPath(kind: BuildAssetKind, beatId: string): string;
|
|
16
|
+
export declare function readAssetMetadata(projectDir: string, kind: BuildAssetKind, beatId: string): BuildAssetMetadata | null;
|
|
17
|
+
export declare function assetFreshnessFromMetadata(opts: {
|
|
18
|
+
projectDir: string;
|
|
19
|
+
kind: BuildAssetKind;
|
|
20
|
+
beatId: string;
|
|
21
|
+
expectedCacheKey?: string;
|
|
22
|
+
canonicalExists: boolean;
|
|
23
|
+
}): AssetFreshness | undefined;
|
|
24
|
+
export declare function isFreshCanonicalAsset(opts: {
|
|
25
|
+
projectDir: string;
|
|
26
|
+
kind: BuildAssetKind;
|
|
27
|
+
beatId: string;
|
|
28
|
+
cue: string;
|
|
29
|
+
provider?: string;
|
|
30
|
+
options?: Record<string, unknown>;
|
|
31
|
+
cacheKey?: string;
|
|
32
|
+
}): boolean;
|
|
33
|
+
export declare function writeAssetMetadata(opts: {
|
|
34
|
+
projectDir: string;
|
|
35
|
+
kind: BuildAssetKind;
|
|
36
|
+
beatId: string;
|
|
37
|
+
cue: string;
|
|
38
|
+
provider: string;
|
|
39
|
+
options?: Record<string, unknown>;
|
|
40
|
+
cacheKey: string;
|
|
41
|
+
canonicalPath: string;
|
|
42
|
+
cachePath?: string;
|
|
43
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { BuildAssetKind } from "./build-cache.js";
|
|
2
|
+
export interface AssetReferenceCandidate {
|
|
3
|
+
kind: BuildAssetKind;
|
|
4
|
+
raw: string;
|
|
5
|
+
relPath?: string;
|
|
6
|
+
absPath?: string;
|
|
7
|
+
ext: string;
|
|
8
|
+
exists: boolean;
|
|
9
|
+
withinProject: boolean;
|
|
10
|
+
source: "typed" | "asset";
|
|
11
|
+
error?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function resolveTypedAssetReference(projectDir: string, kind: BuildAssetKind, value: unknown): AssetReferenceCandidate | null;
|
|
14
|
+
export declare function resolveGenericAssetReference(projectDir: string, value: unknown): AssetReferenceCandidate | null;
|
|
15
|
+
export declare function isReadyAssetReference(reference: AssetReferenceCandidate | null | undefined): reference is AssetReferenceCandidate & {
|
|
16
|
+
relPath: string;
|
|
17
|
+
absPath: string;
|
|
18
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convert a storyboard `backdrop` cue into a safer image-generation prompt.
|
|
3
|
+
*
|
|
4
|
+
* Backdrops are normally background plates; scene HTML owns the exact text,
|
|
5
|
+
* logos, charts, and UI. Keeping that contract explicit reduces unrelated
|
|
6
|
+
* product-photo drift and avoids generated typography competing with overlays.
|
|
7
|
+
*/
|
|
8
|
+
export declare function augmentBackdropPrompt(cue: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export type BuildAssetKind = "narration" | "backdrop" | "video" | "music";
|
|
2
|
+
export interface CacheAssetDescriptor {
|
|
3
|
+
key: string;
|
|
4
|
+
path: string;
|
|
5
|
+
ext: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function cacheAssetDescriptor(kind: BuildAssetKind, parts: Record<string, unknown>): CacheAssetDescriptor;
|
|
8
|
+
export declare function narrationCacheDescriptor(opts: {
|
|
9
|
+
beatId: string;
|
|
10
|
+
cue: string;
|
|
11
|
+
provider: string;
|
|
12
|
+
voice?: unknown;
|
|
13
|
+
ext: "mp3" | "wav";
|
|
14
|
+
}): CacheAssetDescriptor;
|
|
15
|
+
export declare function backdropCacheDescriptor(opts: {
|
|
16
|
+
beatId: string;
|
|
17
|
+
cue: string;
|
|
18
|
+
provider: string;
|
|
19
|
+
quality: "standard" | "hd";
|
|
20
|
+
size: string;
|
|
21
|
+
ratio?: string;
|
|
22
|
+
}): CacheAssetDescriptor;
|
|
23
|
+
export declare function imageRatioForSize(size: string | undefined): string;
|
|
24
|
+
export declare function videoCacheDescriptor(opts: {
|
|
25
|
+
beatId: string;
|
|
26
|
+
cue: string;
|
|
27
|
+
provider: string;
|
|
28
|
+
duration: number | undefined;
|
|
29
|
+
}): CacheAssetDescriptor;
|
|
30
|
+
export declare function musicCacheDescriptor(opts: {
|
|
31
|
+
beatId: string;
|
|
32
|
+
cue: string;
|
|
33
|
+
provider: string;
|
|
34
|
+
duration: number | undefined;
|
|
35
|
+
}): CacheAssetDescriptor;
|
|
36
|
+
export declare function normalizeVideoDuration(duration: number | undefined): number;
|
|
37
|
+
export declare function normalizeMusicDuration(duration: number | undefined): number;
|