Skip to content

feat: integrate KohakuTerrarium (kt) as a provider + Explorer/search/settings UX#1

Merged
Yidhar merged 4 commits into
mainfrom
feat/kohaku-integration
Jun 27, 2026
Merged

feat: integrate KohakuTerrarium (kt) as a provider + Explorer/search/settings UX#1
Yidhar merged 4 commits into
mainfrom
feat/kohaku-integration

Conversation

@Yidhar

@Yidhar Yidhar commented Jun 27, 2026

Copy link
Copy Markdown
Owner

Summary

Integrates KohakuTerrarium (kt) as a first-class Switchyard provider (backend = "kohaku") and adds the GUI work to drive/configure it.

Provider

  • New crate switchyard-provider-kohaku: drives kt run <creature> --headless --json -p <prompt> (one-shot), maps the JSONL stream to ProviderEvents; sandbox/leaf/model flags; clear error when no creature is configured.
  • Registered backend kohaku in switchyard-app-providers (alias, inference, default command kt, default @kt-biome/creatures/general); switchyard.toml block.
  • CLI: switchyard app launches the desktop GUI; switchyard-config::global_config_path() for workspace-less global settings.
  • Tests: deterministic integration test via a fake kt bin + env-gated live smoke (SWITCHYARD_TEST_KOHAKU=1).

GUI

  • Settings: kohaku in provider list/roles; built-ins always editable; dynamic model dropdown from kt config llm list --all; save global settings with no workspace open.
  • Explorer: VS Code-style collapsible side bar; file context menu with Cut/Copy/Copy-as/Paste (fs_paste_entry) + Add to Chat (removable context chips, not text paste).
  • Search: VS Code-style ripgrep-backed panel — case/whole-word/regex toggles, file-name mode, hit highlighting, collapsible per-file groups, batch Replace All, jump-to-line on click.

Verification

cargo fmt --all -- --check, cargo clippy --workspace --all-targets -- -D warnings, and cargo test --workspace --all-targets all pass locally.

🤖 Generated with Claude Code

Yidhar and others added 4 commits June 27, 2026 13:25
Generated via /init: common build/test commands, the layered crate
architecture, the provider contract, and the sentinel vs HYARD
delegation protocols.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
New crate `switchyard-provider-kohaku`: drives `kt run <creature>
--headless --json -p <prompt>` as a one-shot subprocess and maps the
JSONL stream onto ProviderEvents (sandbox/leaf/model flags; clear error
when no creature is configured). Mirrors the Claude adapter and reuses
the subprocess streaming helpers.

- Register backend "kohaku" in switchyard-app-providers (alias,
  inference, default command `kt`, default `@kt-biome/creatures/general`
  creature) + tests.
- switchyard.toml: `[providers.kohaku]` block.
- CLI: `switchyard app` launches the desktop GUI (searches next-to-exe,
  target/{release,debug}, then PATH); add `kt` notes.
- switchyard-config: `global_config_path()` (~/.switchyard/switchyard.toml)
  so global settings can persist without a workspace.
- tests: deterministic integration test via a fake `kt` bin
  (kohaku_integration.rs) + env-gated live smoke (kohaku_live_smoke.rs,
  SWITCHYARD_TEST_KOHAKU=1).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Settings: kohaku in the provider list + roles; built-in providers
  always shown/editable; dynamic model dropdown from `kt config llm
  list --all`; save global settings without an open workspace.
- Explorer: VS Code-style collapsible side bar (toggle the active rail
  icon); file context menu with Cut / Copy / Copy as Path|Relative /
  Paste (fs_paste_entry) and "Add to Chat" — staged as removable
  context chips in the composer (not a raw text paste).
- Search: VS Code-style panel backed by ripgrep with case / whole-word
  / regex toggles, file-name mode, hit highlighting, collapsible
  per-file groups, batch Replace All, and jump-to-line on click
  (Canvas scrolls + selects the match).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Yidhar
Yidhar merged commit 7c32c84 into main Jun 27, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant