Commit Graph

48 Commits

Author SHA1 Message Date
Ed Zynda 80f3a642a3 refactor: migrate markdown rendering from glamour to herald-md
- Replace glamour-based markdown rendering with herald/herald-md
- Update go.mod and go.sum with new dependencies
- Refactor styles.go to use Typography cache instead of TermRenderer
- Update enhanced_styles.go for compatibility
- Update btca.config.jsonc configuration
2026-03-30 15:02:01 +03:00
Ed Zynda 26f0969e3e deps: update all dependencies and refactor Read tool rendering
- Update github.com/indaco/herald v0.9.0 -> v0.10.0
- Update charm.land/bubbles/v2 v2.0.0 -> v2.1.0
- Update AWS SDK v2 packages
- Update google.golang.org/genai v1.51.0 -> v1.52.0
- Update various other dependencies

refactor(ui): use herald.CodeBlock for Read tool output

- Replace manual renderCodeBlock() with herald.CodeBlock()
- Add WithCodeLineNumberOffset() support for correct line numbers
- Extract language hint from file extension for syntax highlighting
- Preserve existing syntax highlighting via WithCodeFormatter()
- Remove unused codeLine struct and renderCodeBlock function
2026-03-30 14:51:23 +03:00
Ed Zynda f12e195390 refactor(ui): replace custom message rendering with herald typography library
- Replace MessageRenderer with herald-based implementation
- Use herald alerts (Note, Tip, Warning, Caution) for message types
- Use blockquote for thinking/reasoning content
- Use KVGroup for startup info display
- Add margin-bottom to all message types for visual separation
- Simplify Read tool with herald CodeBlock and line numbers
- Add detectLanguage helper for syntax highlighting
- Capture extension startup messages and print after startup banner
- Remove ~200 lines of custom rendering code
2026-03-27 20:54:43 +03:00
Ed Zynda 741520927c chore: update dependencies and fix test issues
- Update all Go dependencies to latest versions
- Remove internal/app/usage_test.go (import cycle)
- Add sanitizeToolCallID function to fix message tests
- All tests pass with race detection
2026-03-26 15:56:04 +03:00
Ed Zynda f03625d6e5 Upgrade fantasy to v0.17.1 and fix Codex API instructions parameter
- Upgrade charm.land/fantasy from v0.16.0 to v0.17.1
- Add buildCodexProviderOptions() to pass system prompt as 'instructions'
- The Codex API requires instructions as a top-level field, not as system message
- Set Store=false to prevent server-side conversation storage
- Use ResponsesProviderOptions.Instructions for system prompt
2026-03-26 15:00:10 +03:00
Ed Zynda eb3219e7ca chore: upgrade all dependencies to latest versions
- Go version: 1.26.0 -> 1.26.1 (required by charm.land/fantasy)
- Major updates:
  - charm.land/fantasy v0.11.1 -> v0.16.0
  - charm.land/lipgloss/v2 v2.0.1 -> v2.0.2
  - github.com/charmbracelet/fang v0.4.4 -> v1.0.0
  - github.com/charmbracelet/glamour v0.10.0 -> v1.0.0
  - github.com/charmbracelet/log v0.4.2 -> v1.0.0
  - github.com/mark3labs/mcp-go v0.44.1 -> v0.45.0
- Plus 30+ indirect dependency updates

All tests pass and build succeeds.
2026-03-22 19:39:53 +03:00
Ed Zynda 5b214b9fdf refactor: Use huh for CLI prompts, fix extension discovery in mixed repos
- Replace custom multi-select with huh.NewMultiSelect for kit install --select
- Replace raw bufio prompts in cmd/auth.go with huh.NewConfirm and huh.NewInput
- Fix extension discovery to use opinionated conventions (only scan root,
  extensions/, ext/, examples/extensions/ directories, skip cmd/internal/pkg/)
- Fix loader to use same convention-based scanning for installed git repos
- Fix errcheck lint warning in loader.go
2026-03-18 16:49:48 +03:00
Ed Zynda e613a07773 feat: add ACP server mode (kit acp)
Implement Agent Client Protocol server allowing ACP-compatible clients
(e.g. OpenCode) to drive Kit as a remote coding agent over stdio.

- internal/acpserver/agent.go: acp.Agent implementation bridging Kit's
  LLM execution, tool system, and event bus to ACP session updates
- internal/acpserver/session.go: session registry mapping ACP sessions
  to persisted Kit JSONL tree sessions
- cmd/acp.go: cobra subcommand wiring stdio JSON-RPC connection
- Add acp-go-sdk dependency, update README with ACP docs
2026-03-09 21:41:10 +03:00
Ed Zynda 4577d218d3 feat: add /model slash command with interactive fuzzy-finding selector
Add /model command that allows switching LLM models mid-session.
When invoked without arguments, opens a full-screen selector overlay
showing only models with configured API keys, with inline fuzzy search,
cursor navigation, and current model indicator. When invoked with an
argument (e.g. /model anthropic/claude-haiku-4-5), switches directly.

Also upgrades all Go dependencies to latest versions.
2026-03-06 18:50:32 +03:00
Ed Zynda f42d487214 add Yaegi-based in-process extension system with event handlers, tool/command registration, and styled output
Implement a Pi-style extension system where plain .go files are loaded at
runtime via Yaegi. Extensions register typed event handlers against 13
lifecycle events (tool_call, tool_result, input, before_agent_start, etc.)
using concrete-type-only API methods to avoid Yaegi interface panics.

Key capabilities:
- Tool interception: block calls, modify results (wrapper pattern)
- Input handling: transform or fully handle user input (skip agent)
- System prompt injection via BeforeAgentStartResult
- Custom tool and slash command registration
- Styled output: ctx.Print, PrintInfo, PrintError, PrintBlock
- Legacy hooks.yml compatibility via adapter
- Auto-discovery from ~/.config/kit/extensions/ and .kit/extensions/
- CLI: kit extensions list|validate|init, --no-extensions, -e flags
- 58 unit tests covering runner, loader (Yaegi), wrapper, events
2026-02-27 00:08:48 +03:00
Ed Zynda 3f2a399e47 replace builtin MCP tools with native core tools and custom content blocks
Remove the entire internal/builtin package (bash, fetch, todo, http, fs
servers) and all inprocess/builtin transport support from config and
connection pool.

Add internal/core package with 7 direct fantasy.AgentTool implementations
matching pi's coding agent: bash, read, write, edit, grep, find, ls.
These execute in-process with zero MCP/JSON serialization overhead.

Add internal/message package with crush-inspired custom content blocks:
ContentPart interface with TextContent, ReasoningContent, ToolCall,
ToolResult, and Finish types. Messages carry heterogeneous Parts slices
with type-tagged JSON serialization for persistence and a ToFantasyMessages
bridge for LLM provider integration.

Core tools are always registered on the agent. External MCP servers remain
supported for additional tools, but MCP loading failures are now non-fatal
since core tools guarantee a working baseline.
2026-02-26 17:41:02 +03:00
Ed Zynda 71bdc768be feat: replace catwalk with models.dev, auto-route openai-compatible providers, fix all lint issues
Replace catwalk dependency with direct models.dev integration (97 providers,
3039 models vs catwalk's 22/679). Auto-route @ai-sdk/openai-compatible
providers through fantasy's openaicompat using the api URL from models.dev,
eliminating the need for --provider-url. Add --all flag to 'mcphost models'
to show all providers vs just fantasy-compatible ones.

Fix all 74 golangci-lint issues: errcheck (53), staticcheck SA4006 (24),
SA9003 (2), ST1005 (5), ineffassign (3). Restructure styles.go color
handling into a colorScheme struct to eliminate SA4006 false positives
from new(x) syntax.
2026-02-25 22:51:45 +03:00
Ed Zynda 29a46f6f98 feat: advisory model validation, update-models command, and vercel provider
- Make model validation advisory: unknown models pass through to the
  provider API with a stderr warning instead of blocking. Catwalk
  metadata is used for cost tracking and suggestions when available.
- Add LookupModel() as the primary registry API (returns nil for
  unknown models, no error).
- Add 'mcphost update-models' subcommand to refresh the model database
  from a catwalk server (defaults to https://catwalk.charm.sh), a local
  file, or reset to the embedded version. Supports ETag caching.
- Add disk cache layer at ~/.local/share/mcphost/providers.json;
  registry loads cached data first, falls back to embedded.
- Add vercel provider support via fantasy.
- Add io.Closer plumbing to ProviderResult and Agent.Close() for
  providers that hold resources.
2026-02-25 22:09:24 +03:00
Ed Zynda be9162637b chore: upgrade all dependencies to latest versions 2026-02-25 18:20:08 +03:00
Ed Zynda 0703dd1602 fix: eliminate escape sequence leak from spinner tea.Program instances
Each spinner created a new tea.NewProgram which sent DECRQM queries for
synchronized output mode 2026. When the program exited and restored
cooked terminal mode, the terminal's DECRPM response leaked as visible
^[[?2026;2$y characters. Replace Bubble Tea spinner with a simple
goroutine animation loop writing directly to stderr via lipgloss.
2026-02-25 18:17:25 +03:00
Ed Zynda ce32cea7ee feat: upgrade charmbracelet libs to v2 (bubbletea, lipgloss, bubbles)
Migrate from github.com/charmbracelet/* v1 to charm.land/* v2 vanity imports.

Key changes:
- bubbletea: View() returns tea.View, KeyMsg -> KeyPressMsg, msg.String() matching
- lipgloss: AdaptiveColor replaced with cached dark-bg detection helper
- bubbles/textarea: Styles()/SetStyles() pattern, KeyMap.InsertNewline override
- bubbles/progress: SetWidth(), WithDefaultBlend(), typed Update return
- Input: enter always submits, ctrl+j/alt+enter insert newlines
- User message newlines preserved through glamour via \n -> \n\n conversion
- glamour stays at v1 (no v2 exists)
2026-02-25 17:07:09 +03:00
Ramiz Polic 191dcea159 chore: update packages to resolve security issues (#154)
Signed-off-by: Ramiz Polic <rpolic@cisco.com>
2026-02-15 19:56:44 +03:00
Ed Zynda a77aab3d90 fix: upgrade sonic to v1.15.0 for Go 1.26 compatibility
Fixes build error with Go 1.26rc1/rc2 caused by undefined GoMapIterator
in sonic v1.14.1.

Closes #152
2026-02-02 11:09:51 +03:00
Shane McDonald c4aa911e3a feat: add Google Vertex AI support for Claude models (#146)
Add support for using Claude models via Google Cloud Vertex AI through
the `google-vertex-anthropic` provider. This enables users who have
Claude access through their Google Cloud account to use mcphost with
Vertex AI authentication.

Changes:
- Add `google-vertex-anthropic` provider case and createVertexAnthropicProvider()
- Support multiple env var names for project/region to match eino-claude:
  - Project: ANTHROPIC_VERTEX_PROJECT_ID, GOOGLE_CLOUD_PROJECT, GCLOUD_PROJECT
  - Region: CLOUD_ML_REGION (defaults to "global" if not set)
- Upgrade eino from v0.5.11 to v0.7.11 (required by eino-claude v0.1.12)
- Migrate schema API from OpenAPI v3 to JSON Schema (eino v0.7.11 change)

Usage:
  # Authenticate with Google Cloud
  gcloud auth application-default login

  # Set required environment variables
  export ANTHROPIC_VERTEX_PROJECT_ID="your-project-id"
  export CLOUD_ML_REGION="us-east5"  # or use default "global"

  # Run mcphost
  mcphost --model google-vertex-anthropic:claude-sonnet-4@20250514

Reference: https://docs.anthropic.com/en/docs/claude-code/google-vertex-ai

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 13:01:18 +03:00
Ed Zynda c284a20dab upgrade deps 2026-01-09 17:25:53 +03:00
Darragh O'Reilly f240b9a8c1 Bump github.com/cloudwego/eino to fix panic (#142)
Fixes panic when using some MCP servers that were auto-generated
from OpenAPI specs. Fixes #141
2025-12-09 18:28:52 +03:00
Ed Zynda 8c1f548eac update deps 2025-11-14 17:06:07 +03:00
Ed Zynda dec5f08f80 update mcp-go 2025-10-07 10:35:31 +03:00
Ed Zynda 81ec644cb9 Update deps 2025-09-03 15:45:02 +03:00
Ed Zynda cc1ab91e64 Update mcp-go 2025-09-02 13:46:31 +03:00
Ed Zynda 4f2f61c673 Update mcp-go 2025-08-11 20:21:05 +03:00
Ed Zynda 2f428997b3 Use fang 2025-08-11 20:10:20 +03:00
Štefan Baebler 4808ed2138 Upgrade github.com/bytedance/sonic to v1.14.0 for Go 1.25 support (#122)
Fixes #121

$ go get github.com/bytedance/sonic@latest && go mod tidy
go: upgraded github.com/bytedance/sonic v1.13.3 => v1.14.0
go: upgraded github.com/bytedance/sonic/loader v0.2.4 => v0.3.0
2025-08-10 13:49:03 +07:00
Ed Zynda b0761f7ada add fetch_summarize tool 2025-07-15 13:35:18 +03:00
Ed Zynda a66c55e175 Improve Ollama and GPU handling (#85)
* preload ollama models

* fix num-gpu

* add download progress bar for ollama models

* fmt

* reorg
2025-06-26 13:32:18 +03:00
dependabot[bot] 6219b84937 Bump github.com/getkin/kin-openapi from 0.118.0 to 0.131.0 (#83)
Bumps [github.com/getkin/kin-openapi](https://github.com/getkin/kin-openapi) from 0.118.0 to 0.131.0.
- [Release notes](https://github.com/getkin/kin-openapi/releases)
- [Commits](https://github.com/getkin/kin-openapi/compare/v0.118.0...v0.131.0)

---
updated-dependencies:
- dependency-name: github.com/getkin/kin-openapi
  dependency-version: 0.131.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-26 11:50:03 +03:00
Ed Zynda a2346721cb Claude max (#78)
* anthropic oauth

* update claude oauth costs
2025-06-25 14:27:19 +03:00
Ed Zynda 84fd21fc42 new builtin servers 2025-06-24 16:53:48 +03:00
Ed Zynda d9983b9524 builtin servers 2025-06-24 16:29:44 +03:00
Ed Zynda 1f407bf7fb streamable HTTP 2025-06-19 16:16:19 +03:00
Ed Zynda 82b50fbf0e fix gemini 2025-06-10 14:20:40 +03:00
Ed Zynda 57efdb5332 cleanup 2025-06-10 13:44:17 +03:00
Ed Zynda 6bc360d375 Allow yaml (#60) 2025-06-09 16:24:27 +03:00
Ed Zynda 8645a8c36a Huge refactor (#58)
* overhaul

* fix ui glitch

* system messages

* use sonnet 4
2025-06-09 14:38:31 +03:00
Ed Zynda 7a81dc3ccf upgrade mcp-go 2025-06-08 13:45:47 +03:00
Roman Gelembjuk ec996fd1e1 Add support of config for SSE servers. Add Authorization header support (#24)
* Add support of config for SSE servers. Add Authorization header support

* Change the format of JSON for SSE servers to be similar to other tools

---------

Co-authored-by: Roman Gelembjuk <Roman Gelembjuk>
2025-04-16 20:18:44 +03:00
zku d58251f53e Add Google/Gemini support (#15)
* add google/gemini support

* fix user/model role issues, use chat session

* properly maintain history

* update gemini/google provider, pipe context through runPrompt, minor fixes

* minor formatting fix in usage tooltip

* update readme to showcase Google/Gemini support

---------

Co-authored-by: Ed Zynda <ezynda3@users.noreply.github.com>
2025-04-11 23:19:06 +03:00
Ed Zynda 9a50bcbcbe update versions and formatting 2024-12-20 18:25:10 +03:00
Ed Zynda e3a64a107d update SDK version 2024-12-18 11:31:27 +03:00
Ed Zynda 0bbe5f15c1 Update deps 2024-12-11 15:36:01 +03:00
Ed Zynda e69bbb8354 Update deps 2024-12-11 15:35:56 +03:00
Ed Zynda 8350b7a55a Update MCP-Go SDK 2024-12-09 10:12:51 +03:00
Ed Zynda d80a14f660 Initial commit 2024-12-08 19:27:53 +03:00