Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 22 additions & 3 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co

## Project Overview

Mysti is a VSCode extension providing a unified AI coding assistant interface supporting multiple AI backends (Claude Code CLI, OpenAI Codex CLI, and Google Gemini CLI). It features sidebar/tab chat panels, conversation persistence, multi-agent brainstorm mode (select 2 of 3 agents), permission controls, and plan selection.
Mysti is a VSCode extension providing a unified AI coding assistant interface supporting multiple AI backends (Claude Code CLI, OpenAI Codex CLI, Google Gemini CLI, and Cline). It features sidebar/tab chat panels, conversation persistence, multi-agent brainstorm mode (select 2 of 4 agents), permission controls, and plan selection.

## Build Commands

Expand Down Expand Up @@ -58,13 +58,14 @@ extension.ts (entry)
└── Providers (CLI integrations)
├── ClaudeCodeProvider (extends BaseCliProvider)
├── CodexProvider (extends BaseCliProvider)
└── GeminiProvider (extends BaseCliProvider)
├── GeminiProvider (extends BaseCliProvider)
└── ClineProvider (extends BaseCliProvider)
```

### Key Design Decisions

- **Per-panel isolation**: Each webview panel (sidebar or tab) has independent state, conversation, and child process
- **CLI-based providers**: Spawn `claude`/`codex`/`gemini` CLI with `--output-format stream-json`, parse line-delimited JSON events
- **CLI-based providers**: Spawn `claude`/`codex`/`gemini`/`cline` CLI with `--output-format stream-json`, parse line-delimited JSON events
- **AsyncGenerator streaming**: Providers yield `StreamChunk` items for real-time response updates
- **Webview communication**: Extension ↔ webview via `postMessage()` with typed `WebviewMessage`

Expand Down Expand Up @@ -141,6 +142,24 @@ Libraries:
4. Add to `ProviderType` union in `src/types.ts`
5. Add configuration options in `package.json`

## Cline Provider Notes

Cline is an autonomous coding agent that can use the CLI, editor, and browser. Key differences from other providers:

**Installation**: Cline is primarily distributed as a VSCode extension (`ext install saoudrizwan.claude-dev`).

**CLI Path**: The provider looks for the Cline binary in:
- VSCode extensions directory (`~/.vscode/extensions/saoudrizwan.claude-dev-*/`)
- Configured path via `mysti.clinePath` setting

**Authentication**: Cline uses API keys configured in its own settings (Anthropic API, OpenRouter, etc.). The Mysti provider checks if an API key is configured.

**Streaming Format**: Cline uses a similar stream-json format to Claude Code, making integration straightforward.

**Models**: Cline supports the same Claude models (Sonnet 4.5, Opus 4.5, Haiku 4.5) as well as other providers via OpenRouter.

**File**: `src/providers/cline/ClineProvider.ts`

### Adding a New Persona (Markdown-based)

**Current count**: 16 core personas in `resources/agents/core/personas/`
Expand Down
61 changes: 61 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

54 changes: 54 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
description = "Mysti - AI Coding Agent VSCode Extension";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
# Node.js and tools
nodejs_20
nodePackages.npm
nodePackages.typescript

# Linting
nodePackages.eslint
# Packaging (use npx vsce if vsce is not available)
vsce
];

shellHook = ''
echo "Mysti Development Environment"
echo "=================================="
echo ""
echo "Available commands:"
echo " npm run compile - Production build"
echo " npm run watch - Development build with watch mode"
echo " npm run lint - ESLint check"
echo " npm run sync-agents - Sync agent definitions"
echo " npx vsce package - Package as .vsix"
echo ""
echo "Press F5 in VSCode to launch Extension Development Host"
echo ""

# Set up Node environment
export NODE_ENV=development

# Ensure npm dependencies are installed
if [ ! -d "node_modules" ]; then
echo "Installing npm dependencies..."
npm install
fi
'';
};
}
);
}
Loading