feat: implement hooks, plugins, session forks, and vim motions
Add 4 major features to codetyper-cli:
- Hooks System: Lifecycle hooks (PreToolUse, PostToolUse, SessionStart,
SessionEnd, UserPromptSubmit, Stop) with exit code control flow
- Plugin System: Custom tools, commands, and hooks via plugin manifest
- Session Forking: Snapshots, rewind, fork, and switch between branches
- Vim Motions: Normal/Insert/Command/Visual modes with keyboard navigation
New files:
- src/types/{hooks,plugin,session-fork,vim}.ts
- src/constants/{hooks,plugin,session-fork,vim}.ts
- src/services/{hooks-service,plugin-loader,plugin-service,session-fork-service}.ts
- src/stores/vim-store.ts (vanilla)
- src/tui/hooks/{useVimMode,useVimStore,useTodoStore,useThemeStore}.ts
- src/tui/components/VimStatusLine.tsx
Modified:
- src/services/agent.ts (hook integration)
- src/tools/index.ts (plugin tool registration)
- src/stores/{todo-store,theme-store}.ts (converted to vanilla)
- TUI components (updated hook imports)
This commit is contained in:
41
src/constants/web-search.ts
Normal file
41
src/constants/web-search.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
/**
|
||||
* Web Search Tool Constants
|
||||
*/
|
||||
|
||||
export const WEB_SEARCH_DEFAULTS = {
|
||||
MAX_RESULTS: 10,
|
||||
TIMEOUT_MS: 15000,
|
||||
USER_AGENT:
|
||||
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
|
||||
} as const;
|
||||
|
||||
export const WEB_SEARCH_MESSAGES = {
|
||||
SEARCHING: (query: string) => `Searching: "${query}"`,
|
||||
NO_RESULTS: "No results found",
|
||||
SEARCH_ERROR: (error: string) => `Search failed: ${error}`,
|
||||
TIMEOUT: "Search timed out",
|
||||
} as const;
|
||||
|
||||
export const WEB_SEARCH_TITLES = {
|
||||
SEARCHING: (query: string) => `Searching: ${query}`,
|
||||
RESULTS: (count: number) => `Found ${count} result(s)`,
|
||||
FAILED: "Search failed",
|
||||
NO_RESULTS: "No results",
|
||||
} as const;
|
||||
|
||||
export const WEB_SEARCH_DESCRIPTION = `Search the web for information.
|
||||
|
||||
Use this tool to:
|
||||
- Find documentation
|
||||
- Look up error messages
|
||||
- Research libraries and APIs
|
||||
- Get current information not in your training data
|
||||
|
||||
Parameters:
|
||||
- query: The search query string
|
||||
- maxResults: Maximum number of results to return (default: 5)
|
||||
|
||||
Example:
|
||||
- Search for "TypeScript generics tutorial"
|
||||
- Search for "React useEffect cleanup function"
|
||||
- Search for "bun test framework documentation"`;
|
||||
Reference in New Issue
Block a user