fixing imports

This commit is contained in:
2026-02-04 21:32:30 -05:00
parent 74b0a0dbab
commit db79856b08
166 changed files with 1986 additions and 982 deletions

View File

@@ -50,8 +50,7 @@ export const PATCH_ERRORS = {
HUNK_FAILED: (index: number, reason: string) =>
`Hunk #${index + 1} failed: ${reason}`,
FILE_NOT_FOUND: (path: string) => `Target file not found: ${path}`,
CONTEXT_MISMATCH: (line: number) =>
`Context mismatch at line ${line}`,
CONTEXT_MISMATCH: (line: number) => `Context mismatch at line ${line}`,
FUZZY_MATCH_FAILED: (hunk: number) =>
`Could not find match for hunk #${hunk + 1} even with fuzzy matching`,
ALREADY_APPLIED: "Patch appears to be already applied",

View File

@@ -60,7 +60,8 @@ export const BRAIN_TIMEOUTS = {
} as const;
export const BRAIN_ERRORS = {
NOT_RUNNING: "Brain service not available. Start the API server at localhost:5001",
NOT_RUNNING:
"Brain service not available. Start the API server at localhost:5001",
NOT_AUTHENTICATED: "Not authenticated. Please login or set an API key.",
INVALID_API_KEY: "Invalid API key. Please check your credentials.",
CONNECTION_FAILED: "Failed to connect to Brain service.",

View File

@@ -3,7 +3,7 @@
*/
import type { ConfigKey, ConfigAction } from "@/types/handlers";
import type { Provider } from "@/types/index";
import type { Provider } from "@/types/common";
export const VALID_CONFIG_KEYS: readonly ConfigKey[] = [
"provider",

View File

@@ -4,14 +4,18 @@
* Constants for MCP server discovery and search
*/
import type { MCPServerCategory, MCPRegistryServer } from "@/types/mcp-registry";
import type {
MCPServerCategory,
MCPRegistryServer,
} from "@/types/mcp-registry";
/**
* Default registry sources
*/
export const MCP_REGISTRY_SOURCES = {
/** Official MCP servers GitHub */
OFFICIAL: "https://raw.githubusercontent.com/modelcontextprotocol/servers/main/README.md",
OFFICIAL:
"https://raw.githubusercontent.com/modelcontextprotocol/servers/main/README.md",
/** Smithery registry API */
SMITHERY: "https://registry.smithery.ai/servers",
} as const;
@@ -161,7 +165,8 @@ export const MCP_CURATED_SERVERS: MCPRegistryServer[] = [
popularity: 75,
verified: true,
envVars: ["GITLAB_PERSONAL_ACCESS_TOKEN", "GITLAB_API_URL"],
installHint: "Set GITLAB_PERSONAL_ACCESS_TOKEN and optionally GITLAB_API_URL",
installHint:
"Set GITLAB_PERSONAL_ACCESS_TOKEN and optionally GITLAB_API_URL",
updatedAt: "2024-12-01",
},
{

View File

@@ -41,12 +41,13 @@ export const EXECUTION_MODE_DESCRIPTIONS: Record<AgentExecutionMode, string> = {
/**
* Conflict strategy descriptions
*/
export const CONFLICT_STRATEGY_DESCRIPTIONS: Record<ConflictStrategy, string> = {
serialize: "Wait for conflicting agent to complete before proceeding",
"abort-newer": "Abort the agent that started later when conflict detected",
"merge-results": "Attempt to merge changes from both agents",
isolated: "Each agent works in isolated context, merge at end",
} as const;
export const CONFLICT_STRATEGY_DESCRIPTIONS: Record<ConflictStrategy, string> =
{
serialize: "Wait for conflicting agent to complete before proceeding",
"abort-newer": "Abort the agent that started later when conflict detected",
"merge-results": "Attempt to merge changes from both agents",
isolated: "Each agent works in isolated context, merge at end",
} as const;
/**
* Error messages
@@ -56,17 +57,14 @@ export const MULTI_AGENT_ERRORS = {
`Cannot spawn more than ${max} agents in a single request`,
MAX_CONCURRENT_EXCEEDED: (max: number) =>
`Maximum concurrent agents (${max}) reached`,
AGENT_NOT_FOUND: (name: string) =>
`Agent "${name}" not found in registry`,
AGENT_ALREADY_RUNNING: (id: string) =>
`Agent "${id}" is already running`,
AGENT_NOT_FOUND: (name: string) => `Agent "${name}" not found in registry`,
AGENT_ALREADY_RUNNING: (id: string) => `Agent "${id}" is already running`,
EXECUTION_TIMEOUT: (agentId: string, timeout: number) =>
`Agent "${agentId}" timed out after ${timeout}ms`,
CONFLICT_RESOLUTION_FAILED: (filePath: string) =>
`Failed to resolve conflict for file: ${filePath}`,
EXECUTION_ABORTED: "Execution aborted by user",
INVALID_EXECUTION_MODE: (mode: string) =>
`Invalid execution mode: ${mode}`,
INVALID_EXECUTION_MODE: (mode: string) => `Invalid execution mode: ${mode}`,
INVALID_CONFLICT_STRATEGY: (strategy: string) =>
`Invalid conflict strategy: ${strategy}`,
TOO_MANY_CONFLICTS: (count: number) =>

View File

@@ -68,12 +68,13 @@ export const PLUGIN_CAPABILITY_LABELS: Record<PluginCapability, string> = {
/**
* Plugin capability descriptions
*/
export const PLUGIN_CAPABILITY_DESCRIPTIONS: Record<PluginCapability, string> = {
filesystem: "Can read and write files on disk",
network: "Can make network requests",
shell: "Can execute shell commands",
mcp: "Can interact with MCP servers",
};
export const PLUGIN_CAPABILITY_DESCRIPTIONS: Record<PluginCapability, string> =
{
filesystem: "Can read and write files on disk",
network: "Can make network requests",
shell: "Can execute shell commands",
mcp: "Can interact with MCP servers",
};
/**
* Command file extension

View File

@@ -23,7 +23,12 @@ export const DEFAULT_REVIEW_CONFIG: PRReviewConfig = {
minConfidence: MIN_CONFIDENCE_THRESHOLD,
reviewers: [
{ name: "security", type: "security", enabled: true, minConfidence: 80 },
{ name: "performance", type: "performance", enabled: true, minConfidence: 80 },
{
name: "performance",
type: "performance",
enabled: true,
minConfidence: 80,
},
{ name: "style", type: "style", enabled: true, minConfidence: 85 },
{ name: "logic", type: "logic", enabled: true, minConfidence: 80 },
],
@@ -167,9 +172,21 @@ export const RATING_THRESHOLDS = {
*/
export const RECOMMENDATION_THRESHOLDS = {
approve: { maxCritical: 0, maxWarning: 0, maxSuggestion: 5 },
approve_with_suggestions: { maxCritical: 0, maxWarning: 3, maxSuggestion: Infinity },
request_changes: { maxCritical: 1, maxWarning: Infinity, maxSuggestion: Infinity },
needs_discussion: { maxCritical: Infinity, maxWarning: Infinity, maxSuggestion: Infinity },
approve_with_suggestions: {
maxCritical: 0,
maxWarning: 3,
maxSuggestion: Infinity,
},
request_changes: {
maxCritical: 1,
maxWarning: Infinity,
maxSuggestion: Infinity,
},
needs_discussion: {
maxCritical: Infinity,
maxWarning: Infinity,
maxSuggestion: Infinity,
},
} as const;
/**

View File

@@ -129,4 +129,9 @@ export const SKILL_TRIGGER_PATTERNS = {
/**
* Required fields in skill frontmatter
*/
export const SKILL_REQUIRED_FIELDS = ["id", "name", "description", "triggers"] as const;
export const SKILL_REQUIRED_FIELDS = [
"id",
"name",
"description",
"triggers",
] as const;

View File

@@ -10,7 +10,7 @@ export const TOKENS_PER_CHAR = 0.25;
// Context warning thresholds
export const TOKEN_WARNING_THRESHOLD = 0.75; // 75% - yellow warning
export const TOKEN_CRITICAL_THRESHOLD = 0.90; // 90% - red warning
export const TOKEN_CRITICAL_THRESHOLD = 0.9; // 90% - red warning
export const TOKEN_OVERFLOW_THRESHOLD = 0.95; // 95% - trigger compaction
// Pruning thresholds (following OpenCode pattern)

View File

@@ -190,7 +190,11 @@ export const SLASH_COMMANDS: SlashCommand[] = [
// Settings commands
{ name: "model", description: "Select AI model", category: "settings" },
{ name: "agent", description: "Select agent", category: "settings" },
{ name: "mode", description: "Switch interaction mode", category: "settings" },
{
name: "mode",
description: "Switch interaction mode",
category: "settings",
},
{
name: "provider",
description: "Switch LLM provider",

View File

@@ -41,27 +41,101 @@ export const VIM_MODE_HINTS: Record<VimMode, string> = {
*/
export const VIM_DEFAULT_BINDINGS: VimKeyBinding[] = [
// Normal mode - Navigation
{ key: "j", mode: "normal", action: "scroll_down", description: "Scroll down" },
{
key: "j",
mode: "normal",
action: "scroll_down",
description: "Scroll down",
},
{ key: "k", mode: "normal", action: "scroll_up", description: "Scroll up" },
{ key: "d", mode: "normal", action: "scroll_half_down", ctrl: true, description: "Half page down" },
{ key: "u", mode: "normal", action: "scroll_half_up", ctrl: true, description: "Half page up" },
{ key: "g", mode: "normal", action: "goto_top", description: "Go to top (gg)" },
{ key: "G", mode: "normal", action: "goto_bottom", shift: true, description: "Go to bottom" },
{
key: "d",
mode: "normal",
action: "scroll_half_down",
ctrl: true,
description: "Half page down",
},
{
key: "u",
mode: "normal",
action: "scroll_half_up",
ctrl: true,
description: "Half page up",
},
{
key: "g",
mode: "normal",
action: "goto_top",
description: "Go to top (gg)",
},
{
key: "G",
mode: "normal",
action: "goto_bottom",
shift: true,
description: "Go to bottom",
},
// Normal mode - Mode switching
{ key: "i", mode: "normal", action: "enter_insert", description: "Enter insert mode" },
{ key: "a", mode: "normal", action: "enter_insert", description: "Append (enter insert)" },
{ key: ":", mode: "normal", action: "enter_command", description: "Enter command mode" },
{ key: "v", mode: "normal", action: "enter_visual", description: "Enter visual mode" },
{
key: "i",
mode: "normal",
action: "enter_insert",
description: "Enter insert mode",
},
{
key: "a",
mode: "normal",
action: "enter_insert",
description: "Append (enter insert)",
},
{
key: ":",
mode: "normal",
action: "enter_command",
description: "Enter command mode",
},
{
key: "v",
mode: "normal",
action: "enter_visual",
description: "Enter visual mode",
},
// Normal mode - Search
{ key: "/", mode: "normal", action: "search_start", description: "Start search" },
{ key: "n", mode: "normal", action: "search_next", description: "Next search match" },
{ key: "N", mode: "normal", action: "search_prev", shift: true, description: "Previous search match" },
{
key: "/",
mode: "normal",
action: "search_start",
description: "Start search",
},
{
key: "n",
mode: "normal",
action: "search_next",
description: "Next search match",
},
{
key: "N",
mode: "normal",
action: "search_prev",
shift: true,
description: "Previous search match",
},
// Normal mode - Word navigation
{ key: "w", mode: "normal", action: "word_forward", description: "Next word" },
{ key: "b", mode: "normal", action: "word_backward", description: "Previous word" },
{
key: "w",
mode: "normal",
action: "word_forward",
description: "Next word",
},
{
key: "b",
mode: "normal",
action: "word_backward",
description: "Previous word",
},
{ key: "0", mode: "normal", action: "line_start", description: "Line start" },
{ key: "$", mode: "normal", action: "line_end", description: "Line end" },
@@ -72,16 +146,41 @@ export const VIM_DEFAULT_BINDINGS: VimKeyBinding[] = [
{ key: "r", mode: "normal", action: "redo", ctrl: true, description: "Redo" },
// Insert mode
{ key: "escape", mode: "insert", action: "exit_mode", description: "Exit to normal mode" },
{
key: "escape",
mode: "insert",
action: "exit_mode",
description: "Exit to normal mode",
},
// Command mode
{ key: "escape", mode: "command", action: "cancel", description: "Cancel command" },
{ key: "return", mode: "command", action: "execute_command", description: "Execute command" },
{
key: "escape",
mode: "command",
action: "cancel",
description: "Cancel command",
},
{
key: "return",
mode: "command",
action: "execute_command",
description: "Execute command",
},
// Visual mode
{ key: "escape", mode: "visual", action: "exit_mode", description: "Exit visual mode" },
{
key: "escape",
mode: "visual",
action: "exit_mode",
description: "Exit visual mode",
},
{ key: "y", mode: "visual", action: "yank", description: "Yank selection" },
{ key: "d", mode: "visual", action: "delete", description: "Delete selection" },
{
key: "d",
mode: "visual",
action: "delete",
description: "Delete selection",
},
];
/**