mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-24 17:32:18 +00:00
0e02bbc2fbbd67f92bbc5a99ea81d5e439d84d1d
15
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
c3224d30c6 |
feat: network device mode for SSH + serial charset encoding support (#540)
* feat: add deviceType field to Host model for network device support Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: pass deviceType through session metadata pipeline Thread deviceType from Host model through AITerminalSessionInfo, IPC types, and mcpServerBridge so AI agents can inspect device type per session. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat: route network device SSH sessions to raw PTY execution When deviceType === 'network', handleExec now uses execViaRawPty instead of execViaPty so vendor CLIs (Huawei VRP, Cisco IOS, etc.) receive commands as-is without POSIX shell wrapping or markers. The command blocklist is also skipped for network devices, consistent with the existing serial session bypass. AI context description updated to document the raw-execution behaviour for network device sessions. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat: add network device mode toggle to host settings UI Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: add network device awareness to Catty Agent system prompt Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: extend network device mode to Catty Agent exec path and host context - Add network device detection and raw execution routing to aiBridge.cjs (the primary Catty Agent command path), not just the MCP bridge - Export getSessionMeta from mcpServerBridge for reuse in aiBridge - Surface deviceType in Catty Agent system prompt host list so the AI can identify which sessions are network devices - Pass deviceType through buildSystemPrompt context Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: exempt network device sessions from client-side blocklist and update ACP context - Add deviceType to ExecutorContext sessions type - Skip renderer-side command blocklist for deviceType=network sessions in shared toolExecutors.ts (not just main-process side) - Update ACP agent context hint to mention network device sessions Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: only show network device mode toggle for SSH hosts Telnet and local hosts don't support the network device execution path, so hiding the toggle prevents users from enabling a broken configuration. Serial hosts already use raw mode by default. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: exclude Mosh sessions from network device raw execution path Mosh uses a shell-backed PTY and cannot connect to vendor CLIs, so network device mode should only apply to SSH and serial sessions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: prefer session.protocol over metadata for Mosh detection Mosh tabs report protocol:"ssh" in renderer metadata but "mosh" in the main-process session object. Prioritize session.protocol (runtime truth) to correctly exclude Mosh from network device raw execution. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: suppress deviceType metadata for Mosh sessions Mosh requires a shell-backed PTY and cannot connect to vendor CLIs, so omit deviceType from AI-facing metadata when session is Mosh-backed. This prevents the AI from being told to use vendor CLI syntax when the actual execution path uses normal shell wrapping. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: use exit code 0 for network device sessions and hide toggle for Mosh - Network device / serial sessions return exitCode: null from vendor CLIs. Default to 0 instead of -1 so the AI doesn't misinterpret successful commands as failures. - Hide the network device mode toggle when Mosh is enabled, since the setting is suppressed at runtime for Mosh sessions anyway. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: preserve null exit codes and restrict raw mode to SSH/serial - Preserve exitCode: null for network device sessions instead of coercing to 0, so the AI knows exit status is unavailable rather than seeing a misleading success code. - Explicitly whitelist SSH/serial protocols for network device mode instead of just excluding mosh, preventing local/telnet sessions from accidentally entering raw execution. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: use UTF-8 encoding for SSH network device raw execution execViaRawPty hardcodes latin1 for serial port data decoding. Add an encoding option (default: latin1) and pass utf8 from SSH network device call sites so multi-byte characters aren't corrupted. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: use host charset for serial port decoding instead of hardcoded latin1 - Extract charsetToNodeEncoding() to module scope in terminalBridge - Serial sessions now read options.charset (from Host.charset) for both terminal display decoding and AI command output - Store serialEncoding on session object so exec paths can use it - Pass encoding through all execViaRawPty call sites - Default encoding changed from latin1 to utf8 (matches most modern network equipment and is the safer default for CJK environments) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: move serialEncoding declaration before session object creation serialEncoding was referenced in the session object literal before its const declaration, causing a TDZ ReferenceError that would crash every serial connection. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: tighten isNetworkDevice logic and clean up edge cases - Align toolExecutors isNetworkDevice check with bridge logic: require explicit SSH/serial protocol match instead of trusting deviceType alone - Remove empty-string protocol match from isSshOrSerial in both bridges to prevent local/unknown sessions from being treated as network devices - Widen exitCode return type to `number | null` to match actual behavior - Clear deviceType when enabling Mosh (incompatible combination) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: update MCP server tool descriptions for network device sessions The get_environment and terminal_execute tool descriptions only mentioned serial/raw sessions for network devices. Updated to also reference deviceType: network SSH sessions so external AI agents (Claude, Codex) know about the new execution mode. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: include deviceType in get_environment and guard execViaChannel fallback - Add deviceType to executeWorkspaceGetInfo session mapping and return type so Catty Agent's get_environment tool matches MCP bridge output - Guard both aiBridge and mcpServerBridge against falling through to execViaChannel for network device sessions — network devices require an interactive PTY and exec channels would produce broken behavior Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: add charset setting to serial host configuration UI Serial hosts now have a charset input in the Advanced section, defaulting to UTF-8. The value is saved to Host.charset and used by the serial decoder in terminalBridge. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: add charset to serial quick-connect modal with full pipeline - Add charset input to SerialConnectModal (Advanced section) - Thread charset through onConnect callback → handleConnectSerial → createSerialSession → TerminalSession.charset - Add charset field to TerminalSession interface - Include charset in fallback host builder for quick-connect sessions so createTerminalSessionStarters can pass it to startSerialSession - Saved hosts also store charset via onSaveHost Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: constrain serial connect modal height with scrollable content Modal content could overflow the viewport when Advanced section was expanded. Add max-h-[85vh] to DialogContent with flex layout so the content area scrolls while header and footer buttons stay visible. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: propagate charset through all serial session creation paths - Add charset to startSerialSession type in global.d.ts - Copy host.charset to TerminalSession in connectToHost serial path - Copy host.charset in createWorkspaceWithHosts serial path - Propagate session.charset in splitSession (both workspace and standalone) - Propagate session.charset in copySession Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: propagate charset in remaining session creation paths Add host.charset to connectToHost (non-serial), createWorkspaceWithHosts (non-serial), and runSnippet session creation for consistency. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
54297859e3 | Fix AI cancellation and shell wrapper edge cases | ||
|
|
4971f18bbe | Fix AI terminal execution completion and tool UI | ||
|
|
17e98090ad |
Add AI support for local terminal sessions (#419)
* Add AI support for local terminal sessions * Fix local AI session metadata and shell safety * Fix local session cloning and multi-exec errors * Refactor local shell detection helpers * Fix local shell helper import path * Fix CJS imports in renderer * Use ESM local shell helpers in renderer * Normalize local shell paths and platform metadata |
||
|
|
ccfa2d4dd0 |
fix: non-zero exit code is not a failure, include output on real errors (#377)
* fix: treat non-zero exit code as success and include output on failure - Non-zero exit codes (e.g. grep returning 1, ls on missing file) are valid command results, not execution failures. Changed execViaPty and execViaChannel to always return ok:true when the command actually ran. - ok:false is now reserved for real failures: timeout, session gone, stream not writable, etc. - When ok:false, include any partial stdout/stderr in the error message so the user and LLM can see what happened before the failure. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: return stdout+exitCode for all completed commands, clean up dead code - ptyExec: preserve original ok semantics (non-zero = ok:false) so MCP server bridge callers (handleMultiExec, stopOnError) still work - execViaChannel: null exit code (SSH disconnect) returns ok:false - toolExecutors: Catty Agent always returns stdout+exitCode to the LLM regardless of exit code, only treats real failures (timeout, disconnect) as errors — with partial output included - Remove dead code: executeTerminalSendInput, executeSftp*, executeMultiHost - Clean up unused imports, bridge interface, ExecutorContext Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
7c5478b2a5 |
refactor: remove SFTP tools from AI agent (#376)
Remove sftp_list_directory, sftp_read_file, and sftp_write_file tools. The AI can use terminal_execute with standard shell commands (ls, cat, tee, etc.) which is more flexible, supports sudo/pipes/redirects, and reduces tool choice complexity for the LLM. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
fff031eb25 |
fix: remove multi_host_execute and fix MissingToolResultsError (#372)
Remove multi_host_execute tool — the AI can call terminal_execute for each host individually, which is simpler, more reliable, and avoids the hang issue where parallel remote commands block the stream. Fix AI_MissingToolResultsError that occurs after user stops a stream mid-tool-execution: when building SDK messages, skip orphaned tool calls that have no matching tool result instead of including them (which causes the SDK to reject the next message). Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
6727248924 |
feat: add web search & URL fetch tools for AI agent (#365)
* feat: add web search and URL fetch tools for AI agent Add web_search and url_fetch tools to Catty Agent, allowing the AI to search the internet for current information and fetch webpage content. - Support 5 search providers: Tavily, Exa, Bocha, Zhipu, SearXNG - Settings UI with provider selection, API key encryption, and config - web_search is conditional on config; url_fetch is always available - Both tools are read-only and work in all permission modes (incl. observer) - aiFetch skipHostCheck for AI tool requests to arbitrary URLs - System prompt guidelines for when to use search/fetch - i18n support (en + zh-CN) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: address code review findings (SSRF, key exposure, state race) - P1: Restore SSRF protection when skipHostCheck is true — still block localhost, RFC1918, link-local, and cloud metadata endpoints; only skip the domain allowlist for public HTTPS hosts - P2: Move web search API key decryption to main process via dedicated IPC handler, matching the existing provider key security model - P2: Use configRef to avoid stale closure in async settings callbacks that could overwrite newer user changes Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: address second review — DNS rebinding, url_fetch approval, maxResults - P1: url_fetch now requires approval in confirm mode (outbound GET is a side effect that could exfiltrate data via query strings) - P1: Add DNS resolution check when skipHostCheck is set — resolve hostname and reject if any IP is private/loopback/link-local, blocking DNS rebinding attacks against internal services - P2: Slice search results after provider call to enforce maxResults consistently (Zhipu and SearXNG ignore the limit parameter) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: address third review — localhost/IPv6 SSRF, API key blur race - P1: Block localhost/loopback when skipHostCheck is enabled — restructure isAllowedFetchUrl to check private hosts first in the skipHostCheck path, preventing access to local services on allowlisted ports - P1: Handle IPv6 private ranges (fc00::/7, fe80::/10, ::ffff: mapped), strip brackets from URL.hostname, block [::1] and fd00:: addresses - P2: Guard handleApiKeyBlur against provider change during async encryption — skip stale write if provider switched while encrypting Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: address fourth review — main-process key isolation, SearXNG compat - P1: Replace aiWebSearchDecryptKey IPC with __WEB_SEARCH_KEY__ placeholder pattern — renderer never sees plaintext keys; main process replaces placeholder in headers before HTTP request, matching provider key flow - P1: Search API requests use normal allowlist path (not skipHostCheck), so SearXNG on localhost/HTTP/private networks works via aiSyncWebSearch; only url_fetch uses skipHostCheck for arbitrary public HTTPS URLs - P2: Remove needsApproval from url_fetch — treat as read-only like sftp_read_file, consistent with observer mode allowlist Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: address fifth review — private LAN providers, maxResults default - P1: Allow private-IP hosts that are explicitly in the provider/search allowlist (e.g. https://192.168.x.x model providers or SearXNG) - P2: Remove .default(5) from web_search maxResults schema so the user's configured maxResults setting is used when the model omits the param Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: address sixth review — HTTPS scope, config gate, redirects - P2: Scope HTTP exception to private/LAN IPs only — remote allowlisted hosts still require HTTPS to protect API keys in transit - P2: Gate web_search tool on complete config (API key for providers that require it, apiHost for SearXNG) to avoid advertising a broken tool - P2: Add redirect following (up to 5 hops) to aiFetch for url_fetch — handles 301/302/307 for short links, www canonicalization, etc. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: address seventh review — redirect SSRF, decrypt race, HTTPS-only - P1: Revalidate each redirect hop against SSRF guards (allowlist check + DNS resolution) before following, preventing open-redirect SSRF - P2: Add sequence counter to API key decryption effect — stale promise results from a previous provider are discarded on provider switch - P3: Restrict url_fetch to HTTPS-only URLs, matching the skipHostCheck policy that already rejects HTTP in the bridge Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: address eighth review — OS resolver, allowlisted HTTP hosts - P1: Use dns.lookup (OS resolver) instead of dns.resolve4/6 for private IP checks — matches what http.request actually connects to, respects /etc/hosts, mDNS, and other local resolver sources - P2: Allow HTTP for any explicitly allowlisted host (not just literal private IPs), so self-hosted SearXNG at http://searxng.lan works Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: address ninth review — HTTP scope, blur ordering, decrypt flag - P1: Narrow HTTP exception to web search apiHost only — AI provider endpoints remain HTTPS-only to protect credentials in transit - P2: Add blur sequence counter to prevent out-of-order encryption results from overwriting newer API key saves - P2: Reset isDecrypting flag when cancelling decrypt on provider switch, preventing permanently disabled API key input Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: address tenth review — DNS pinning, prompt/tool alignment - P1: Pin validated DNS result to the HTTP request via custom lookup function, preventing TOCTOU/DNS-rebinding between validation and actual connection - P2: Extract isWebSearchReady() helper and use it consistently in both tool registration and system prompt, so the model isn't told web search is available when config is incomplete Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: address eleventh review — single DNS lookup, redirect pinning, CGNAT - P1: Combine DNS validation and pinning into a single lookup call, eliminating the TOCTOU window between hasPrivateResolution and pinnedLookup - P1: Pin DNS for redirect targets too — resolve/validate/pin in one step before following each redirect hop - P2: Add 100.64.0.0/10 (CGNAT) to private IP ranges for Tailscale and similar CGNAT-addressed internal services Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: address twelfth review — apiHost validation, sync on enable - P2: Validate apiHost is a well-formed URL in isWebSearchReady(), preventing tool exposure when user enters a malformed host - P2: Add webSearchConfig.enabled to sync effect deps so the main process gets updated immediately when the toggle changes Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: remove DNS-level SSRF checks that break fakedns/proxy environments DNS resolution validation (dns.lookup + IP pinning) breaks in proxy environments where fakedns resolves all domains to LAN addresses. Revert to hostname-level checks only (blocking localhost, 127.0.0.1, metadata endpoints, etc.) which are sufficient without false positives. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: resolve empty catch block lint warning Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
71b13a77a3 |
fix: address security, correctness, and performance issues from code review
Security: validate agent spawn commands against allowlist, replace execSync with execFileSync in agent discovery, restrict localhost SSRF to known ports, add observer mode enforcement at IPC layer, add IPC sender validation, expand dangerous env key blocklist, add pending approval timeout. Correctness: replace updateLastMessage with ID-based updateMessageById to fix race condition during streaming, include tool-call/tool-result messages in SDK context, flush debounced persist on unmount, fix ACP client break placement, use proper AI SDK message types. Performance: pre-compile command blocklist regexps, extract shared tool executors to deduplicate executor.ts and tools.ts (~50% reduction each). Also: i18n for hardcoded English strings, remove dead detectDoomLoop code, add bypass-resistant blocklist patterns, include permissionMode in ACP provider reuse fingerprint. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
808d021ebe |
fix: address security, correctness, and performance issues from code review
- Use crypto.randomBytes for PTY markers instead of Math.random - Replace execSync with execFileSync to prevent command injection - Fix sftp_write_file missing safety check (pass path to guardWriteOperation) - Add IPC input validation for handleExec, handleSftpRead, handleMultiExec - Add maxBytes bounds validation in executor, tools, and MCP server - Fix approval race condition (clear ref after destructuring, strict messageId match) - Shorten API key plaintext lifetime in memory - Fix stream cancellation race with AbortController registered before request - Delay revokeObjectURL for download timing - Extract shared limitConcurrency to infrastructure/ai/concurrency.ts - Add execStream null check in execViaChannel Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
0b9cb86c4e |
fix: address security and correctness issues from code review
- Add command blocklist check to terminal_send_input (executor + SDK tools) - Add session scope validation to all tools in executor.ts - Fix abort handler to call aiChatCancel instead of aiChatStream - Enforce URL allowlist in fetch proxy to prevent SSRF - Wrap event.sender.send with safeSend for destroyed window check - Filter dangerous env vars (LD_PRELOAD, NODE_OPTIONS, etc.) from agent spawn - Fix stale debouncedPersistSessions closure using sessionsRef - Fix cleanupOrphanedSessions race when sessions load before workspaces - Fix limitConcurrency implementation using Set + finally pattern - Improve command blocklist regex patterns with word boundaries - Add regex validation with error feedback in SafetySettings - Add confirmation dialog for provider removal - Fix React key warning for tool-role messages in ChatMessageList - Remove debug console.warn in TerminalLayer - Remove unused nanoid dependency - Remove redundant platform-specific codex-acp binary from dependencies Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
d8d29d1709 |
fix: address code review findings for AI chat panel
Security: - Apply checkCommandSafety() in aiExec IPC handler to enforce command blocklist - Add critical path validation in handleSftpRemove (normalize + blocklist) - Change rm -rf to rm -r so permission errors surface Stream lifecycle: - Abort all active streams on component unmount (abortControllersRef cleanup) - Wrap stream reader in try/finally with releaseLock() to prevent leaks - Use refs for inputValue/images in handleSend to stabilize callback identity State persistence: - Clear debounce timer before synchronous persist in destructive operations (clearSessionMessages, deleteSession, deleteSessionsByTarget) - Add 10MB max buffer guard in ACP client and MCP server NDJSON parsing i18n: - Replace hardcoded English strings with t() calls in InlineApprovalCard, PermissionDialog, ConversationExport, ThinkingBlock, AgentSelector - Add 23 new i18n keys to en.ts and zh-CN.ts Misc: - Remove debug console.log statements in mcpServerBridge Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
2d4f260f0b |
fix: address review findings from refactoring review
- Fix stale closure: add updateLastMessage to handleApprovalResponse deps - Use random heredoc delimiter to prevent content corruption when file contains the literal delimiter string - Remove dead ensureClaudeConfigDir function from claudeHelpers Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
a55da77471 |
refactor: fix security issues, remove dead code, and split monolithic files
Security: - Fix command injection in 15+ shell interpolation sites with shellQuote() - Add token-based authentication to MCP TCP server - Fix heredoc delimiter collision in SFTP write fallbacks - Add case-insensitive flag to mcpServerBridge command blocklist - Add exhaustive default case to createModelFromConfig Architecture: - Split aiBridge.cjs (1971→1483 lines) into 4 modules: shellUtils, codexHelpers, claudeHelpers, ptyExec - Split SettingsAITab.tsx (1480→520 lines) into 10 sub-components - Extract shared processCattyStream from AIChatSidePanel.tsx (-168 lines) - Consolidate duplicate PTY execution logic into shared ptyExec.cjs - Consolidate duplicate stripAnsi/toUnpackedAsarPath utilities Code quality: - Remove ~33 debug console.log statements from production code - Remove dead code: terminal_read_output stub, checkToolPermission, isCommandAllowed, READ_ONLY_TOOLS - Unify bridge type accessor in useAIState.ts (eliminate 15 unsafe casts) - Add localStorage session pruning (50 sessions / 200 messages cap) - Fix ModelSelector onBlur race condition (setTimeout → preventDefault) - Fix duplicate getShellEnv() calls in Codex helpers - Remove unused _config param from claudeAgentAdapter - Type claudeAgentAdapter bridge parameter directly as ClaudeBridge Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
72887c35b5 |
feat: add AI chat panel with Vercel AI SDK integration
Add a comprehensive AI assistant feature to netcatty, enabling AI-powered terminal automation and multi-host orchestration. Core features: - AI chat side panel (Zed-style) with agent selector, session history, conversation export (Markdown/JSON/TXT), and streaming responses - Catty Agent: built-in terminal assistant with 9 tools (terminal exec, SFTP read/write, multi-host orchestration) using zod schemas - BYOK provider support: OpenAI, Anthropic, Google, Ollama, OpenRouter, and custom OpenAI-compatible endpoints - Three-tier permission model: Observer / Confirm / Autonomous - Command safety: blocklist patterns, doom loop detection, abort support - External agent support: ACP protocol (JSON-RPC over stdio) for Claude Agent, Codex CLI, Gemini CLI, and custom agents Tech stack: - Vercel AI SDK (ai, @ai-sdk/openai, @ai-sdk/anthropic, @ai-sdk/google) with streamText + fullStream for streaming tool-call loops - AI Elements: adapted conversation (use-stick-to-bottom), message (streamdown markdown), prompt-input (InputGroup) components - Custom bridge fetch adapter routing all API calls through Electron main process IPC to avoid CORS - zod for tool parameter schemas UI components: - AIChatSidePanel, AgentSelector, ChatInput, ChatMessageList - PermissionDialog, ExecutionPlan, ConversationExport - AI Elements: conversation, message, tool-call, prompt-input - New UI primitives: InputGroup, Spinner - Settings AI tab for BYOK configuration and safety settings Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |