Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: pip install -e ".[dev]"
run: pip install -e ".[dev,warehouses]"
working-directory: packages/altimate-engine

- name: Run tests
Expand Down
2 changes: 1 addition & 1 deletion packages/altimate-code/AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# opencode database guide
# altimate-code database guide

## Database

Expand Down
2 changes: 1 addition & 1 deletion packages/altimate-code/script/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { $ } from "bun"
import fs from "fs"
import path from "path"
import { fileURLToPath } from "url"
import solidPlugin from "../node_modules/@opentui/solid/scripts/solid-plugin"
import solidPlugin from "@opentui/solid/bun-plugin"

const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
Expand Down
22 changes: 11 additions & 11 deletions packages/altimate-code/src/acp/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ACP (Agent Client Protocol) Implementation

This directory contains a clean, protocol-compliant implementation of the [Agent Client Protocol](https://agentclientprotocol.com/) for opencode.
This directory contains a clean, protocol-compliant implementation of the [Agent Client Protocol](https://agentclientprotocol.com/) for altimate-code.

## Architecture

Expand All @@ -21,7 +21,7 @@ The implementation follows a clean separation of concerns:

- **`session.ts`** - Session state management
- Creates and tracks ACP sessions
- Maps ACP sessions to internal opencode sessions
- Maps ACP sessions to internal altimate-code sessions
- Maintains working directory context
- Handles MCP server configurations

Expand All @@ -38,18 +38,18 @@ The implementation follows a clean separation of concerns:

```bash
# Start the ACP server in the current directory
opencode acp
altimate-code acp

# Start in a specific directory
opencode acp --cwd /path/to/project
altimate-code acp --cwd /path/to/project
```

### Question Tool Opt-In

ACP excludes `QuestionTool` by default.

```bash
OPENCODE_ENABLE_QUESTION_TOOL=1 opencode acp
ALTIMATE_CODE_ENABLE_QUESTION_TOOL=1 altimate-code acp
```

Enable this only for ACP clients that support interactive question prompts.
Expand All @@ -69,8 +69,8 @@ Add to your Zed configuration (`~/.config/zed/settings.json`):
```json
{
"agent_servers": {
"OpenCode": {
"command": "opencode",
"Altimate Code": {
"command": "altimate-code",
"args": ["acp"]
}
}
Expand Down Expand Up @@ -124,7 +124,7 @@ This implementation follows the ACP specification v1:
- **Session Persistence**: Save and restore full conversation history
- **Mode Support**: Implement different operational modes (ask, code, etc.)
- **Enhanced Permissions**: More sophisticated permission handling
- **Terminal Integration**: Full terminal support via opencode's bash tool
- **Terminal Integration**: Full terminal support via altimate-code's bash tool

## Testing

Expand All @@ -133,7 +133,7 @@ This implementation follows the ACP specification v1:
bun test test/acp.test.ts

# Test manually with stdio
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":1}}' | opencode acp
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":1}}' | altimate-code acp
```

## Design Decisions
Expand All @@ -158,9 +158,9 @@ Each component has a single responsibility:

This makes the codebase maintainable and testable.

### Mapping to OpenCode
### Mapping to Altimate Code

ACP sessions map cleanly to opencode's internal session model:
ACP sessions map cleanly to altimate-code's internal session model:

- ACP `session/new` → creates internal Session
- ACP `session/prompt` → uses SessionPrompt.prompt()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://opencode.ai/theme.json",
"$schema": "https://altimate-code.dev/theme.json",
"defs": {
"darkStep1": "#0a0a0a",
"darkStep2": "#141414",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://opencode.ai/theme.json",
"$schema": "https://altimate-code.dev/theme.json",
"defs": {
"darkBg": "#0f0f0f",
"darkBgPanel": "#15141b",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://opencode.ai/theme.json",
"$schema": "https://altimate-code.dev/theme.json",
"defs": {
"darkBg": "#0B0E14",
"darkBgAlt": "#0D1017",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://opencode.ai/theme.json",
"$schema": "https://altimate-code.dev/theme.json",
"defs": {
"bg0": "#0d0d0d",
"bg1": "#161616",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://opencode.ai/theme.json",
"$schema": "https://altimate-code.dev/theme.json",
"defs": {
"frappeRosewater": "#f2d5cf",
"frappeFlamingo": "#eebebe",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://opencode.ai/theme.json",
"$schema": "https://altimate-code.dev/theme.json",
"defs": {
"macRosewater": "#f4dbd6",
"macFlamingo": "#f0c6c6",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://opencode.ai/theme.json",
"$schema": "https://altimate-code.dev/theme.json",
"defs": {
"lightRosewater": "#dc8a78",
"lightFlamingo": "#dd7878",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://opencode.ai/theme.json",
"$schema": "https://altimate-code.dev/theme.json",
"defs": {
"background": "#193549",
"backgroundAlt": "#122738",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://opencode.ai/theme.json",
"$schema": "https://altimate-code.dev/theme.json",
"defs": {
"darkBg": "#181818",
"darkPanel": "#141414",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://opencode.ai/theme.json",
"$schema": "https://altimate-code.dev/theme.json",
"defs": {
"background": "#282a36",
"currentLine": "#44475a",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://opencode.ai/theme.json",
"$schema": "https://altimate-code.dev/theme.json",
"defs": {
"darkStep1": "#2d353b",
"darkStep2": "#333c43",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://opencode.ai/theme.json",
"$schema": "https://altimate-code.dev/theme.json",
"defs": {
"black": "#100F0F",
"base950": "#1C1B1A",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://opencode.ai/theme.json",
"$schema": "https://altimate-code.dev/theme.json",
"defs": {
"darkBg": "#0d1117",
"darkBgAlt": "#010409",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://opencode.ai/theme.json",
"$schema": "https://altimate-code.dev/theme.json",
"defs": {
"darkBg0": "#282828",
"darkBg1": "#3c3836",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://opencode.ai/theme.json",
"$schema": "https://altimate-code.dev/theme.json",
"defs": {
"sumiInk0": "#1F1F28",
"sumiInk1": "#2A2A37",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://opencode.ai/theme.json",
"$schema": "https://altimate-code.dev/theme.json",
"defs": {
"darkStep6": "#3c3c3c",
"darkStep11": "#808080",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://opencode.ai/theme.json",
"$schema": "https://altimate-code.dev/theme.json",
"defs": {
"darkBg": "#263238",
"darkBgAlt": "#1e272c",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://opencode.ai/theme.json",
"$schema": "https://altimate-code.dev/theme.json",
"defs": {
"matrixInk0": "#0a0e0a",
"matrixInk1": "#0e130d",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://opencode.ai/theme.json",
"$schema": "https://altimate-code.dev/theme.json",
"defs": {
"purple-800": "#3442a6",
"purple-700": "#465bd1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://opencode.ai/theme.json",
"$schema": "https://altimate-code.dev/theme.json",
"defs": {
"background": "#272822",
"backgroundAlt": "#1e1f1c",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://opencode.ai/theme.json",
"$schema": "https://altimate-code.dev/theme.json",
"defs": {
"nightOwlBg": "#011627",
"nightOwlFg": "#d6deeb",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://opencode.ai/theme.json",
"$schema": "https://altimate-code.dev/theme.json",
"defs": {
"nord0": "#2E3440",
"nord1": "#3B4252",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://opencode.ai/theme.json",
"$schema": "https://altimate-code.dev/theme.json",
"defs": {
"darkBg": "#282c34",
"darkBgAlt": "#21252b",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://opencode.ai/theme.json",
"$schema": "https://altimate-code.dev/theme.json",
"defs": {
"darkStep1": "#0a0a0a",
"darkStep2": "#141414",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://opencode.ai/theme.json",
"$schema": "https://altimate-code.dev/theme.json",
"defs": {
"darkBg0": "#111c18",
"darkBg1": "#1a2520",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://opencode.ai/theme.json",
"$schema": "https://altimate-code.dev/theme.json",
"defs": {
"background": "#292d3e",
"backgroundAlt": "#1e2132",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://opencode.ai/theme.json",
"$schema": "https://altimate-code.dev/theme.json",
"defs": {
"base": "#191724",
"surface": "#1f1d2e",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://opencode.ai/theme.json",
"$schema": "https://altimate-code.dev/theme.json",
"defs": {
"base03": "#002b36",
"base02": "#073642",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://opencode.ai/theme.json",
"$schema": "https://altimate-code.dev/theme.json",
"defs": {
"background": "#262335",
"backgroundAlt": "#1e1a29",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://opencode.ai/theme.json",
"$schema": "https://altimate-code.dev/theme.json",
"defs": {
"darkStep1": "#1a1b26",
"darkStep2": "#1e2030",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://opencode.ai/theme.json",
"$schema": "https://altimate-code.dev/theme.json",
"defs": {
"background100": "#0A0A0A",
"background200": "#000000",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://opencode.ai/theme.json",
"$schema": "https://altimate-code.dev/theme.json",
"defs": {
"vesperBg": "#101010",
"vesperFg": "#FFF",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://opencode.ai/theme.json",
"$schema": "https://altimate-code.dev/theme.json",
"defs": {
"bg": "#3f3f3f",
"bgAlt": "#4f4f4f",
Expand Down
12 changes: 7 additions & 5 deletions packages/altimate-code/src/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,14 +266,16 @@ export namespace Config {

export async function installDependencies(dir: string) {
const pkg = path.join(dir, "package.json")
const targetVersion = Installation.isLocal() ? "*" : Installation.VERSION

const json = await Filesystem.readJson<{ dependencies?: Record<string, string> }>(pkg).catch(() => ({
dependencies: {},
}))
json.dependencies = {
...json.dependencies,
"@altimateai/altimate-code-plugin": targetVersion,
if (!Installation.isLocal()) {
// Only add the plugin dependency for published installations.
// In local dev the plugin is already available via the workspace.
json.dependencies = {
...json.dependencies,
"@altimateai/altimate-code-plugin": Installation.VERSION,
}
}
await Filesystem.writeJson(pkg, json)
await new Promise((resolve) => setTimeout(resolve, 3000))
Expand Down
4 changes: 2 additions & 2 deletions packages/altimate-code/test/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ test("example", async () => {
### Options

- `git?: boolean` - Initialize a git repo with a root commit
- `config?: Partial<Config.Info>` - Write an `opencode.json` config file
- `config?: Partial<Config.Info>` - Write an `altimate-code.json` config file
- `init?: (dir: string) => Promise<T>` - Custom setup function, returns value accessible as `tmp.extra`
- `dispose?: (dir: string) => Promise<T>` - Custom cleanup function

Expand Down Expand Up @@ -76,6 +76,6 @@ await using tmp = await tmpdir({

### Notes

- Directories are created in the system temp folder with prefix `opencode-test-`
- Directories are created in the system temp folder with prefix `altimate-code-test-`
- Use `await using` for automatic cleanup when the variable goes out of scope
- Paths are sanitized to strip null bytes (defensive fix for CI environments)
Loading