Agentic coding CLI on Bun, Ink, and the AI SDK. Core: streamText loop with SDK-level tool approval so a denied call provably never executes; endpoint fallback for OpenAI reasoning models; retry with backoff. Tools: read/write/edit/glob/grep/bash, path-jailed, gitignore-aware, ripgrep with a JS fallback, binary rejection, live bash streaming. Agents: five variants crossing thinking level with tool restriction; plan and review withhold mutating tools from the model. Extensibility: frontmatter skills with on-demand bodies, plugin host with blocking hooks, MCP stdio and HTTP, read-only subagents. State: durable per-project memory, session task lists, session persistence, compaction that repairs provider-item dependencies. Distribution: five-platform cross-compiled binaries with checksums, install scripts, CI on three operating systems. 404 tests, typecheck clean.
29 lines
1.0 KiB
TypeScript
29 lines
1.0 KiB
TypeScript
import type { AppHooks } from '../src/ui/App';
|
|
|
|
/** Default AppHooks for UI tests; override only what a test cares about. */
|
|
export function testHooks(over: Partial<AppHooks> = {}): AppHooks {
|
|
return {
|
|
sessionId: 'test1234',
|
|
config: () => ({ provider: 'openai', model: 'gpt-5' }),
|
|
switchModel: (id) => `model is now ${id}`,
|
|
switchAgent: (name) => `agent is now ${name}`,
|
|
switchThinking: (level) => `thinking is now ${level}`,
|
|
agentName: () => 'default',
|
|
thinkingLevel: () => 'medium',
|
|
applyProvider: async () => 'configured',
|
|
listModels: async () => ({ models: [] }),
|
|
listSessions: async () => 'no saved sessions',
|
|
listSkills: () => 'no skills loaded',
|
|
listPlugins: () => 'no plugins active',
|
|
listMemory: async () => 'nothing remembered yet',
|
|
summarizeMemory: async () => 'nothing to compact',
|
|
resumeSession: async () => 'resumed',
|
|
saveSession: async () => 'saved',
|
|
instructionFiles: () => [],
|
|
initPrompt: 'write AGENTS.md',
|
|
history: [],
|
|
recordPrompt: () => {},
|
|
...over,
|
|
};
|
|
}
|