diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a5a248fa91..6a60cc0b86 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/packages/altimate-code/AGENTS.md b/packages/altimate-code/AGENTS.md index dcfc336d65..3c62d558db 100644 --- a/packages/altimate-code/AGENTS.md +++ b/packages/altimate-code/AGENTS.md @@ -1,4 +1,4 @@ -# opencode database guide +# altimate-code database guide ## Database diff --git a/packages/altimate-code/script/build.ts b/packages/altimate-code/script/build.ts index 9dd86acc96..8229c31564 100755 --- a/packages/altimate-code/script/build.ts +++ b/packages/altimate-code/script/build.ts @@ -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) diff --git a/packages/altimate-code/src/acp/README.md b/packages/altimate-code/src/acp/README.md index aab33259bb..a482c3d44d 100644 --- a/packages/altimate-code/src/acp/README.md +++ b/packages/altimate-code/src/acp/README.md @@ -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 @@ -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 @@ -38,10 +38,10 @@ 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 @@ -49,7 +49,7 @@ opencode acp --cwd /path/to/project 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. @@ -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"] } } @@ -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 @@ -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 @@ -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() diff --git a/packages/altimate-code/src/cli/cmd/tui/context/theme/altimate-code.json b/packages/altimate-code/src/cli/cmd/tui/context/theme/altimate-code.json index 8f585a4509..5ac2926916 100644 --- a/packages/altimate-code/src/cli/cmd/tui/context/theme/altimate-code.json +++ b/packages/altimate-code/src/cli/cmd/tui/context/theme/altimate-code.json @@ -1,5 +1,5 @@ { - "$schema": "https://opencode.ai/theme.json", + "$schema": "https://altimate-code.dev/theme.json", "defs": { "darkStep1": "#0a0a0a", "darkStep2": "#141414", diff --git a/packages/altimate-code/src/cli/cmd/tui/context/theme/aura.json b/packages/altimate-code/src/cli/cmd/tui/context/theme/aura.json index e7798d5203..a521a8f8b7 100644 --- a/packages/altimate-code/src/cli/cmd/tui/context/theme/aura.json +++ b/packages/altimate-code/src/cli/cmd/tui/context/theme/aura.json @@ -1,5 +1,5 @@ { - "$schema": "https://opencode.ai/theme.json", + "$schema": "https://altimate-code.dev/theme.json", "defs": { "darkBg": "#0f0f0f", "darkBgPanel": "#15141b", diff --git a/packages/altimate-code/src/cli/cmd/tui/context/theme/ayu.json b/packages/altimate-code/src/cli/cmd/tui/context/theme/ayu.json index a42fce4c4e..8782df3c7c 100644 --- a/packages/altimate-code/src/cli/cmd/tui/context/theme/ayu.json +++ b/packages/altimate-code/src/cli/cmd/tui/context/theme/ayu.json @@ -1,5 +1,5 @@ { - "$schema": "https://opencode.ai/theme.json", + "$schema": "https://altimate-code.dev/theme.json", "defs": { "darkBg": "#0B0E14", "darkBgAlt": "#0D1017", diff --git a/packages/altimate-code/src/cli/cmd/tui/context/theme/carbonfox.json b/packages/altimate-code/src/cli/cmd/tui/context/theme/carbonfox.json index b91de1fea9..c5b655174d 100644 --- a/packages/altimate-code/src/cli/cmd/tui/context/theme/carbonfox.json +++ b/packages/altimate-code/src/cli/cmd/tui/context/theme/carbonfox.json @@ -1,5 +1,5 @@ { - "$schema": "https://opencode.ai/theme.json", + "$schema": "https://altimate-code.dev/theme.json", "defs": { "bg0": "#0d0d0d", "bg1": "#161616", diff --git a/packages/altimate-code/src/cli/cmd/tui/context/theme/catppuccin-frappe.json b/packages/altimate-code/src/cli/cmd/tui/context/theme/catppuccin-frappe.json index 79e56ee9af..6d01fa43c6 100644 --- a/packages/altimate-code/src/cli/cmd/tui/context/theme/catppuccin-frappe.json +++ b/packages/altimate-code/src/cli/cmd/tui/context/theme/catppuccin-frappe.json @@ -1,5 +1,5 @@ { - "$schema": "https://opencode.ai/theme.json", + "$schema": "https://altimate-code.dev/theme.json", "defs": { "frappeRosewater": "#f2d5cf", "frappeFlamingo": "#eebebe", diff --git a/packages/altimate-code/src/cli/cmd/tui/context/theme/catppuccin-macchiato.json b/packages/altimate-code/src/cli/cmd/tui/context/theme/catppuccin-macchiato.json index 6d9827dfe8..6c52da6595 100644 --- a/packages/altimate-code/src/cli/cmd/tui/context/theme/catppuccin-macchiato.json +++ b/packages/altimate-code/src/cli/cmd/tui/context/theme/catppuccin-macchiato.json @@ -1,5 +1,5 @@ { - "$schema": "https://opencode.ai/theme.json", + "$schema": "https://altimate-code.dev/theme.json", "defs": { "macRosewater": "#f4dbd6", "macFlamingo": "#f0c6c6", diff --git a/packages/altimate-code/src/cli/cmd/tui/context/theme/catppuccin.json b/packages/altimate-code/src/cli/cmd/tui/context/theme/catppuccin.json index d0fa6a11d9..b5c030ac71 100644 --- a/packages/altimate-code/src/cli/cmd/tui/context/theme/catppuccin.json +++ b/packages/altimate-code/src/cli/cmd/tui/context/theme/catppuccin.json @@ -1,5 +1,5 @@ { - "$schema": "https://opencode.ai/theme.json", + "$schema": "https://altimate-code.dev/theme.json", "defs": { "lightRosewater": "#dc8a78", "lightFlamingo": "#dd7878", diff --git a/packages/altimate-code/src/cli/cmd/tui/context/theme/cobalt2.json b/packages/altimate-code/src/cli/cmd/tui/context/theme/cobalt2.json index 2967eae58d..e0106fc4ac 100644 --- a/packages/altimate-code/src/cli/cmd/tui/context/theme/cobalt2.json +++ b/packages/altimate-code/src/cli/cmd/tui/context/theme/cobalt2.json @@ -1,5 +1,5 @@ { - "$schema": "https://opencode.ai/theme.json", + "$schema": "https://altimate-code.dev/theme.json", "defs": { "background": "#193549", "backgroundAlt": "#122738", diff --git a/packages/altimate-code/src/cli/cmd/tui/context/theme/cursor.json b/packages/altimate-code/src/cli/cmd/tui/context/theme/cursor.json index ab518dbe7e..164721db95 100644 --- a/packages/altimate-code/src/cli/cmd/tui/context/theme/cursor.json +++ b/packages/altimate-code/src/cli/cmd/tui/context/theme/cursor.json @@ -1,5 +1,5 @@ { - "$schema": "https://opencode.ai/theme.json", + "$schema": "https://altimate-code.dev/theme.json", "defs": { "darkBg": "#181818", "darkPanel": "#141414", diff --git a/packages/altimate-code/src/cli/cmd/tui/context/theme/dracula.json b/packages/altimate-code/src/cli/cmd/tui/context/theme/dracula.json index c837a0b582..7068ec19b2 100644 --- a/packages/altimate-code/src/cli/cmd/tui/context/theme/dracula.json +++ b/packages/altimate-code/src/cli/cmd/tui/context/theme/dracula.json @@ -1,5 +1,5 @@ { - "$schema": "https://opencode.ai/theme.json", + "$schema": "https://altimate-code.dev/theme.json", "defs": { "background": "#282a36", "currentLine": "#44475a", diff --git a/packages/altimate-code/src/cli/cmd/tui/context/theme/everforest.json b/packages/altimate-code/src/cli/cmd/tui/context/theme/everforest.json index 62dfb31ba8..069b6b87d9 100644 --- a/packages/altimate-code/src/cli/cmd/tui/context/theme/everforest.json +++ b/packages/altimate-code/src/cli/cmd/tui/context/theme/everforest.json @@ -1,5 +1,5 @@ { - "$schema": "https://opencode.ai/theme.json", + "$schema": "https://altimate-code.dev/theme.json", "defs": { "darkStep1": "#2d353b", "darkStep2": "#333c43", diff --git a/packages/altimate-code/src/cli/cmd/tui/context/theme/flexoki.json b/packages/altimate-code/src/cli/cmd/tui/context/theme/flexoki.json index e525705dd1..a9a993e4b4 100644 --- a/packages/altimate-code/src/cli/cmd/tui/context/theme/flexoki.json +++ b/packages/altimate-code/src/cli/cmd/tui/context/theme/flexoki.json @@ -1,5 +1,5 @@ { - "$schema": "https://opencode.ai/theme.json", + "$schema": "https://altimate-code.dev/theme.json", "defs": { "black": "#100F0F", "base950": "#1C1B1A", diff --git a/packages/altimate-code/src/cli/cmd/tui/context/theme/github.json b/packages/altimate-code/src/cli/cmd/tui/context/theme/github.json index 99a80879e1..42bea4c1a4 100644 --- a/packages/altimate-code/src/cli/cmd/tui/context/theme/github.json +++ b/packages/altimate-code/src/cli/cmd/tui/context/theme/github.json @@ -1,5 +1,5 @@ { - "$schema": "https://opencode.ai/theme.json", + "$schema": "https://altimate-code.dev/theme.json", "defs": { "darkBg": "#0d1117", "darkBgAlt": "#010409", diff --git a/packages/altimate-code/src/cli/cmd/tui/context/theme/gruvbox.json b/packages/altimate-code/src/cli/cmd/tui/context/theme/gruvbox.json index dcae302581..fab245d236 100644 --- a/packages/altimate-code/src/cli/cmd/tui/context/theme/gruvbox.json +++ b/packages/altimate-code/src/cli/cmd/tui/context/theme/gruvbox.json @@ -1,5 +1,5 @@ { - "$schema": "https://opencode.ai/theme.json", + "$schema": "https://altimate-code.dev/theme.json", "defs": { "darkBg0": "#282828", "darkBg1": "#3c3836", diff --git a/packages/altimate-code/src/cli/cmd/tui/context/theme/kanagawa.json b/packages/altimate-code/src/cli/cmd/tui/context/theme/kanagawa.json index 91a784014a..619dc6768a 100644 --- a/packages/altimate-code/src/cli/cmd/tui/context/theme/kanagawa.json +++ b/packages/altimate-code/src/cli/cmd/tui/context/theme/kanagawa.json @@ -1,5 +1,5 @@ { - "$schema": "https://opencode.ai/theme.json", + "$schema": "https://altimate-code.dev/theme.json", "defs": { "sumiInk0": "#1F1F28", "sumiInk1": "#2A2A37", diff --git a/packages/altimate-code/src/cli/cmd/tui/context/theme/lucent-orng.json b/packages/altimate-code/src/cli/cmd/tui/context/theme/lucent-orng.json index 036dedf2ef..cc94b81d00 100644 --- a/packages/altimate-code/src/cli/cmd/tui/context/theme/lucent-orng.json +++ b/packages/altimate-code/src/cli/cmd/tui/context/theme/lucent-orng.json @@ -1,5 +1,5 @@ { - "$schema": "https://opencode.ai/theme.json", + "$schema": "https://altimate-code.dev/theme.json", "defs": { "darkStep6": "#3c3c3c", "darkStep11": "#808080", diff --git a/packages/altimate-code/src/cli/cmd/tui/context/theme/material.json b/packages/altimate-code/src/cli/cmd/tui/context/theme/material.json index c3a1068085..cea65635d4 100644 --- a/packages/altimate-code/src/cli/cmd/tui/context/theme/material.json +++ b/packages/altimate-code/src/cli/cmd/tui/context/theme/material.json @@ -1,5 +1,5 @@ { - "$schema": "https://opencode.ai/theme.json", + "$schema": "https://altimate-code.dev/theme.json", "defs": { "darkBg": "#263238", "darkBgAlt": "#1e272c", diff --git a/packages/altimate-code/src/cli/cmd/tui/context/theme/matrix.json b/packages/altimate-code/src/cli/cmd/tui/context/theme/matrix.json index 3549462845..fd90039c28 100644 --- a/packages/altimate-code/src/cli/cmd/tui/context/theme/matrix.json +++ b/packages/altimate-code/src/cli/cmd/tui/context/theme/matrix.json @@ -1,5 +1,5 @@ { - "$schema": "https://opencode.ai/theme.json", + "$schema": "https://altimate-code.dev/theme.json", "defs": { "matrixInk0": "#0a0e0a", "matrixInk1": "#0e130d", diff --git a/packages/altimate-code/src/cli/cmd/tui/context/theme/mercury.json b/packages/altimate-code/src/cli/cmd/tui/context/theme/mercury.json index dfd4f35298..296f7c19b5 100644 --- a/packages/altimate-code/src/cli/cmd/tui/context/theme/mercury.json +++ b/packages/altimate-code/src/cli/cmd/tui/context/theme/mercury.json @@ -1,5 +1,5 @@ { - "$schema": "https://opencode.ai/theme.json", + "$schema": "https://altimate-code.dev/theme.json", "defs": { "purple-800": "#3442a6", "purple-700": "#465bd1", diff --git a/packages/altimate-code/src/cli/cmd/tui/context/theme/monokai.json b/packages/altimate-code/src/cli/cmd/tui/context/theme/monokai.json index 09637a1e2d..44803fec62 100644 --- a/packages/altimate-code/src/cli/cmd/tui/context/theme/monokai.json +++ b/packages/altimate-code/src/cli/cmd/tui/context/theme/monokai.json @@ -1,5 +1,5 @@ { - "$schema": "https://opencode.ai/theme.json", + "$schema": "https://altimate-code.dev/theme.json", "defs": { "background": "#272822", "backgroundAlt": "#1e1f1c", diff --git a/packages/altimate-code/src/cli/cmd/tui/context/theme/nightowl.json b/packages/altimate-code/src/cli/cmd/tui/context/theme/nightowl.json index 24c74733dd..c59706c81e 100644 --- a/packages/altimate-code/src/cli/cmd/tui/context/theme/nightowl.json +++ b/packages/altimate-code/src/cli/cmd/tui/context/theme/nightowl.json @@ -1,5 +1,5 @@ { - "$schema": "https://opencode.ai/theme.json", + "$schema": "https://altimate-code.dev/theme.json", "defs": { "nightOwlBg": "#011627", "nightOwlFg": "#d6deeb", diff --git a/packages/altimate-code/src/cli/cmd/tui/context/theme/nord.json b/packages/altimate-code/src/cli/cmd/tui/context/theme/nord.json index 4a525382a3..d21db27c58 100644 --- a/packages/altimate-code/src/cli/cmd/tui/context/theme/nord.json +++ b/packages/altimate-code/src/cli/cmd/tui/context/theme/nord.json @@ -1,5 +1,5 @@ { - "$schema": "https://opencode.ai/theme.json", + "$schema": "https://altimate-code.dev/theme.json", "defs": { "nord0": "#2E3440", "nord1": "#3B4252", diff --git a/packages/altimate-code/src/cli/cmd/tui/context/theme/one-dark.json b/packages/altimate-code/src/cli/cmd/tui/context/theme/one-dark.json index 73b24e9292..349167d504 100644 --- a/packages/altimate-code/src/cli/cmd/tui/context/theme/one-dark.json +++ b/packages/altimate-code/src/cli/cmd/tui/context/theme/one-dark.json @@ -1,5 +1,5 @@ { - "$schema": "https://opencode.ai/theme.json", + "$schema": "https://altimate-code.dev/theme.json", "defs": { "darkBg": "#282c34", "darkBgAlt": "#21252b", diff --git a/packages/altimate-code/src/cli/cmd/tui/context/theme/orng.json b/packages/altimate-code/src/cli/cmd/tui/context/theme/orng.json index 1fc602f2c8..72165fb072 100644 --- a/packages/altimate-code/src/cli/cmd/tui/context/theme/orng.json +++ b/packages/altimate-code/src/cli/cmd/tui/context/theme/orng.json @@ -1,5 +1,5 @@ { - "$schema": "https://opencode.ai/theme.json", + "$schema": "https://altimate-code.dev/theme.json", "defs": { "darkStep1": "#0a0a0a", "darkStep2": "#141414", diff --git a/packages/altimate-code/src/cli/cmd/tui/context/theme/osaka-jade.json b/packages/altimate-code/src/cli/cmd/tui/context/theme/osaka-jade.json index 1c9de92af6..57bd76c578 100644 --- a/packages/altimate-code/src/cli/cmd/tui/context/theme/osaka-jade.json +++ b/packages/altimate-code/src/cli/cmd/tui/context/theme/osaka-jade.json @@ -1,5 +1,5 @@ { - "$schema": "https://opencode.ai/theme.json", + "$schema": "https://altimate-code.dev/theme.json", "defs": { "darkBg0": "#111c18", "darkBg1": "#1a2520", diff --git a/packages/altimate-code/src/cli/cmd/tui/context/theme/palenight.json b/packages/altimate-code/src/cli/cmd/tui/context/theme/palenight.json index 79f7c59e85..40d77c7cd3 100644 --- a/packages/altimate-code/src/cli/cmd/tui/context/theme/palenight.json +++ b/packages/altimate-code/src/cli/cmd/tui/context/theme/palenight.json @@ -1,5 +1,5 @@ { - "$schema": "https://opencode.ai/theme.json", + "$schema": "https://altimate-code.dev/theme.json", "defs": { "background": "#292d3e", "backgroundAlt": "#1e2132", diff --git a/packages/altimate-code/src/cli/cmd/tui/context/theme/rosepine.json b/packages/altimate-code/src/cli/cmd/tui/context/theme/rosepine.json index 444cdbd135..9f5fc79634 100644 --- a/packages/altimate-code/src/cli/cmd/tui/context/theme/rosepine.json +++ b/packages/altimate-code/src/cli/cmd/tui/context/theme/rosepine.json @@ -1,5 +1,5 @@ { - "$schema": "https://opencode.ai/theme.json", + "$schema": "https://altimate-code.dev/theme.json", "defs": { "base": "#191724", "surface": "#1f1d2e", diff --git a/packages/altimate-code/src/cli/cmd/tui/context/theme/solarized.json b/packages/altimate-code/src/cli/cmd/tui/context/theme/solarized.json index e4de113674..0200ed6f7d 100644 --- a/packages/altimate-code/src/cli/cmd/tui/context/theme/solarized.json +++ b/packages/altimate-code/src/cli/cmd/tui/context/theme/solarized.json @@ -1,5 +1,5 @@ { - "$schema": "https://opencode.ai/theme.json", + "$schema": "https://altimate-code.dev/theme.json", "defs": { "base03": "#002b36", "base02": "#073642", diff --git a/packages/altimate-code/src/cli/cmd/tui/context/theme/synthwave84.json b/packages/altimate-code/src/cli/cmd/tui/context/theme/synthwave84.json index d25bf3b49d..eaacb6b187 100644 --- a/packages/altimate-code/src/cli/cmd/tui/context/theme/synthwave84.json +++ b/packages/altimate-code/src/cli/cmd/tui/context/theme/synthwave84.json @@ -1,5 +1,5 @@ { - "$schema": "https://opencode.ai/theme.json", + "$schema": "https://altimate-code.dev/theme.json", "defs": { "background": "#262335", "backgroundAlt": "#1e1a29", diff --git a/packages/altimate-code/src/cli/cmd/tui/context/theme/tokyonight.json b/packages/altimate-code/src/cli/cmd/tui/context/theme/tokyonight.json index 1c9503a420..d9e357eade 100644 --- a/packages/altimate-code/src/cli/cmd/tui/context/theme/tokyonight.json +++ b/packages/altimate-code/src/cli/cmd/tui/context/theme/tokyonight.json @@ -1,5 +1,5 @@ { - "$schema": "https://opencode.ai/theme.json", + "$schema": "https://altimate-code.dev/theme.json", "defs": { "darkStep1": "#1a1b26", "darkStep2": "#1e2030", diff --git a/packages/altimate-code/src/cli/cmd/tui/context/theme/vercel.json b/packages/altimate-code/src/cli/cmd/tui/context/theme/vercel.json index 86b965b10b..75d883e005 100644 --- a/packages/altimate-code/src/cli/cmd/tui/context/theme/vercel.json +++ b/packages/altimate-code/src/cli/cmd/tui/context/theme/vercel.json @@ -1,5 +1,5 @@ { - "$schema": "https://opencode.ai/theme.json", + "$schema": "https://altimate-code.dev/theme.json", "defs": { "background100": "#0A0A0A", "background200": "#000000", diff --git a/packages/altimate-code/src/cli/cmd/tui/context/theme/vesper.json b/packages/altimate-code/src/cli/cmd/tui/context/theme/vesper.json index 758c8f20c1..a5ad7053b4 100644 --- a/packages/altimate-code/src/cli/cmd/tui/context/theme/vesper.json +++ b/packages/altimate-code/src/cli/cmd/tui/context/theme/vesper.json @@ -1,5 +1,5 @@ { - "$schema": "https://opencode.ai/theme.json", + "$schema": "https://altimate-code.dev/theme.json", "defs": { "vesperBg": "#101010", "vesperFg": "#FFF", diff --git a/packages/altimate-code/src/cli/cmd/tui/context/theme/zenburn.json b/packages/altimate-code/src/cli/cmd/tui/context/theme/zenburn.json index c4475923bb..928f037cd1 100644 --- a/packages/altimate-code/src/cli/cmd/tui/context/theme/zenburn.json +++ b/packages/altimate-code/src/cli/cmd/tui/context/theme/zenburn.json @@ -1,5 +1,5 @@ { - "$schema": "https://opencode.ai/theme.json", + "$schema": "https://altimate-code.dev/theme.json", "defs": { "bg": "#3f3f3f", "bgAlt": "#4f4f4f", diff --git a/packages/altimate-code/src/config/config.ts b/packages/altimate-code/src/config/config.ts index ced82ca6ab..9b36743b33 100644 --- a/packages/altimate-code/src/config/config.ts +++ b/packages/altimate-code/src/config/config.ts @@ -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 }>(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)) diff --git a/packages/altimate-code/test/AGENTS.md b/packages/altimate-code/test/AGENTS.md index 209cf72da4..9152edf589 100644 --- a/packages/altimate-code/test/AGENTS.md +++ b/packages/altimate-code/test/AGENTS.md @@ -19,7 +19,7 @@ test("example", async () => { ### Options - `git?: boolean` - Initialize a git repo with a root commit -- `config?: Partial` - Write an `opencode.json` config file +- `config?: Partial` - Write an `altimate-code.json` config file - `init?: (dir: string) => Promise` - Custom setup function, returns value accessible as `tmp.extra` - `dispose?: (dir: string) => Promise` - Custom cleanup function @@ -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) diff --git a/packages/altimate-code/test/agent/agent.test.ts b/packages/altimate-code/test/agent/agent.test.ts index 9f8de04f80..b701bcb74a 100644 --- a/packages/altimate-code/test/agent/agent.test.ts +++ b/packages/altimate-code/test/agent/agent.test.ts @@ -18,7 +18,7 @@ test("returns default native agents when no config", async () => { fn: async () => { const agents = await Agent.list() const names = agents.map((a) => a.name) - expect(names).toContain("build") + expect(names).toContain("builder") expect(names).toContain("plan") expect(names).toContain("general") expect(names).toContain("explore") @@ -29,12 +29,12 @@ test("returns default native agents when no config", async () => { }) }) -test("build agent has correct default properties", async () => { +test("builder agent has correct default properties", async () => { await using tmp = await tmpdir() await Instance.provide({ directory: tmp.path, fn: async () => { - const build = await Agent.get("build") + const build = await Agent.get("builder") expect(build).toBeDefined() expect(build?.mode).toBe("primary") expect(build?.native).toBe(true) @@ -44,7 +44,7 @@ test("build agent has correct default properties", async () => { }) }) -test("plan agent denies edits except .opencode/plans/*", async () => { +test("plan agent denies edits except .altimate-code/plans/*", async () => { await using tmp = await tmpdir() await Instance.provide({ directory: tmp.path, @@ -54,7 +54,7 @@ test("plan agent denies edits except .opencode/plans/*", async () => { // Wildcard is denied expect(evalPerm(plan, "edit")).toBe("deny") // But specific path is allowed - expect(PermissionNext.evaluate("edit", ".opencode/plans/foo.md", plan!.permission).action).toBe("allow") + expect(PermissionNext.evaluate("edit", ".altimate-code/plans/foo.md", plan!.permission).action).toBe("allow") }, }) }) @@ -152,7 +152,7 @@ test("custom agent config overrides native agent properties", async () => { await using tmp = await tmpdir({ config: { agent: { - build: { + builder: { model: "anthropic/claude-3", description: "Custom build agent", temperature: 0.7, @@ -164,7 +164,7 @@ test("custom agent config overrides native agent properties", async () => { await Instance.provide({ directory: tmp.path, fn: async () => { - const build = await Agent.get("build") + const build = await Agent.get("builder") expect(build).toBeDefined() expect(build?.model?.providerID).toBe("anthropic") expect(build?.model?.modelID).toBe("claude-3") @@ -200,7 +200,7 @@ test("agent permission config merges with defaults", async () => { await using tmp = await tmpdir({ config: { agent: { - build: { + builder: { permission: { bash: { "rm -rf *": "deny", @@ -213,7 +213,7 @@ test("agent permission config merges with defaults", async () => { await Instance.provide({ directory: tmp.path, fn: async () => { - const build = await Agent.get("build") + const build = await Agent.get("builder") expect(build).toBeDefined() // Specific pattern is denied expect(PermissionNext.evaluate("bash", "rm -rf *", build!.permission).action).toBe("deny") @@ -234,7 +234,7 @@ test("global permission config applies to all agents", async () => { await Instance.provide({ directory: tmp.path, fn: async () => { - const build = await Agent.get("build") + const build = await Agent.get("builder") expect(build).toBeDefined() expect(evalPerm(build, "bash")).toBe("deny") }, @@ -245,7 +245,7 @@ test("agent steps/maxSteps config sets steps property", async () => { await using tmp = await tmpdir({ config: { agent: { - build: { steps: 50 }, + builder: { steps: 50 }, plan: { maxSteps: 100 }, }, }, @@ -253,7 +253,7 @@ test("agent steps/maxSteps config sets steps property", async () => { await Instance.provide({ directory: tmp.path, fn: async () => { - const build = await Agent.get("build") + const build = await Agent.get("builder") const plan = await Agent.get("plan") expect(build?.steps).toBe(50) expect(plan?.steps).toBe(100) @@ -282,14 +282,14 @@ test("agent name can be overridden", async () => { await using tmp = await tmpdir({ config: { agent: { - build: { name: "Builder" }, + builder: { name: "Builder" }, }, }, }) await Instance.provide({ directory: tmp.path, fn: async () => { - const build = await Agent.get("build") + const build = await Agent.get("builder") expect(build?.name).toBe("Builder") }, }) @@ -299,14 +299,14 @@ test("agent prompt can be set from config", async () => { await using tmp = await tmpdir({ config: { agent: { - build: { prompt: "Custom system prompt" }, + builder: { prompt: "Custom system prompt" }, }, }, }) await Instance.provide({ directory: tmp.path, fn: async () => { - const build = await Agent.get("build") + const build = await Agent.get("builder") expect(build?.prompt).toBe("Custom system prompt") }, }) @@ -316,7 +316,7 @@ test("unknown agent properties are placed into options", async () => { await using tmp = await tmpdir({ config: { agent: { - build: { + builder: { random_property: "hello", another_random: 123, }, @@ -326,7 +326,7 @@ test("unknown agent properties are placed into options", async () => { await Instance.provide({ directory: tmp.path, fn: async () => { - const build = await Agent.get("build") + const build = await Agent.get("builder") expect(build?.options.random_property).toBe("hello") expect(build?.options.another_random).toBe(123) }, @@ -337,7 +337,7 @@ test("agent options merge correctly", async () => { await using tmp = await tmpdir({ config: { agent: { - build: { + builder: { options: { custom_option: true, another_option: "value", @@ -349,7 +349,7 @@ test("agent options merge correctly", async () => { await Instance.provide({ directory: tmp.path, fn: async () => { - const build = await Agent.get("build") + const build = await Agent.get("builder") expect(build?.options.custom_option).toBe(true) expect(build?.options.another_option).toBe("value") }, @@ -400,7 +400,7 @@ test("default permission includes doom_loop and external_directory as ask", asyn await Instance.provide({ directory: tmp.path, fn: async () => { - const build = await Agent.get("build") + const build = await Agent.get("builder") expect(evalPerm(build, "doom_loop")).toBe("ask") expect(evalPerm(build, "external_directory")).toBe("ask") }, @@ -412,7 +412,7 @@ test("webfetch is allowed by default", async () => { await Instance.provide({ directory: tmp.path, fn: async () => { - const build = await Agent.get("build") + const build = await Agent.get("builder") expect(evalPerm(build, "webfetch")).toBe("allow") }, }) @@ -422,7 +422,7 @@ test("legacy tools config converts to permissions", async () => { await using tmp = await tmpdir({ config: { agent: { - build: { + builder: { tools: { bash: false, read: false, @@ -434,7 +434,7 @@ test("legacy tools config converts to permissions", async () => { await Instance.provide({ directory: tmp.path, fn: async () => { - const build = await Agent.get("build") + const build = await Agent.get("builder") expect(evalPerm(build, "bash")).toBe("deny") expect(evalPerm(build, "read")).toBe("deny") }, @@ -445,7 +445,7 @@ test("legacy tools config maps write/edit/patch/multiedit to edit permission", a await using tmp = await tmpdir({ config: { agent: { - build: { + builder: { tools: { write: false, }, @@ -456,7 +456,7 @@ test("legacy tools config maps write/edit/patch/multiedit to edit permission", a await Instance.provide({ directory: tmp.path, fn: async () => { - const build = await Agent.get("build") + const build = await Agent.get("builder") expect(evalPerm(build, "edit")).toBe("deny") }, }) @@ -474,7 +474,7 @@ test("Truncate.GLOB is allowed even when user denies external_directory globally await Instance.provide({ directory: tmp.path, fn: async () => { - const build = await Agent.get("build") + const build = await Agent.get("builder") expect(PermissionNext.evaluate("external_directory", Truncate.GLOB, build!.permission).action).toBe("allow") expect(PermissionNext.evaluate("external_directory", Truncate.DIR, build!.permission).action).toBe("deny") expect(PermissionNext.evaluate("external_directory", "/some/other/path", build!.permission).action).toBe("deny") @@ -487,7 +487,7 @@ test("Truncate.GLOB is allowed even when user denies external_directory per-agen await using tmp = await tmpdir({ config: { agent: { - build: { + builder: { permission: { external_directory: "deny", }, @@ -498,7 +498,7 @@ test("Truncate.GLOB is allowed even when user denies external_directory per-agen await Instance.provide({ directory: tmp.path, fn: async () => { - const build = await Agent.get("build") + const build = await Agent.get("builder") expect(PermissionNext.evaluate("external_directory", Truncate.GLOB, build!.permission).action).toBe("allow") expect(PermissionNext.evaluate("external_directory", Truncate.DIR, build!.permission).action).toBe("deny") expect(PermissionNext.evaluate("external_directory", "/some/other/path", build!.permission).action).toBe("deny") @@ -521,7 +521,7 @@ test("explicit Truncate.GLOB deny is respected", async () => { await Instance.provide({ directory: tmp.path, fn: async () => { - const build = await Agent.get("build") + const build = await Agent.get("builder") expect(PermissionNext.evaluate("external_directory", Truncate.GLOB, build!.permission).action).toBe("deny") expect(PermissionNext.evaluate("external_directory", Truncate.DIR, build!.permission).action).toBe("deny") }, @@ -532,7 +532,7 @@ test("skill directories are allowed for external_directory", async () => { await using tmp = await tmpdir({ git: true, init: async (dir) => { - const skillDir = path.join(dir, ".opencode", "skill", "perm-skill") + const skillDir = path.join(dir, ".altimate-code", "skill", "perm-skill") await Bun.write( path.join(skillDir, "SKILL.md"), `--- @@ -546,31 +546,31 @@ description: Permission skill. }, }) - const home = process.env.OPENCODE_TEST_HOME - process.env.OPENCODE_TEST_HOME = tmp.path + const home = process.env.ALTIMATE_CLI_TEST_HOME + process.env.ALTIMATE_CLI_TEST_HOME = tmp.path try { await Instance.provide({ directory: tmp.path, fn: async () => { - const build = await Agent.get("build") - const skillDir = path.join(tmp.path, ".opencode", "skill", "perm-skill") + const build = await Agent.get("builder") + const skillDir = path.join(tmp.path, ".altimate-code", "skill", "perm-skill") const target = path.join(skillDir, "reference", "notes.md") expect(PermissionNext.evaluate("external_directory", target, build!.permission).action).toBe("allow") }, }) } finally { - process.env.OPENCODE_TEST_HOME = home + process.env.ALTIMATE_CLI_TEST_HOME = home } }) -test("defaultAgent returns build when no default_agent config", async () => { +test("defaultAgent returns builder when no default_agent config", async () => { await using tmp = await tmpdir() await Instance.provide({ directory: tmp.path, fn: async () => { const agent = await Agent.defaultAgent() - expect(agent).toBe("build") + expect(agent).toBe("builder") }, }) }) @@ -652,11 +652,11 @@ test("defaultAgent throws when default_agent points to non-existent agent", asyn }) }) -test("defaultAgent returns plan when build is disabled and default_agent not set", async () => { +test("defaultAgent returns analyst when builder is disabled and default_agent not set", async () => { await using tmp = await tmpdir({ config: { agent: { - build: { disable: true }, + builder: { disable: true }, }, }, }) @@ -664,8 +664,8 @@ test("defaultAgent returns plan when build is disabled and default_agent not set directory: tmp.path, fn: async () => { const agent = await Agent.defaultAgent() - // build is disabled, so it should return plan (next primary agent) - expect(agent).toBe("plan") + // builder is disabled, so it should return analyst (next primary visible agent) + expect(agent).toBe("analyst") }, }) }) @@ -674,7 +674,11 @@ test("defaultAgent throws when all primary agents are disabled", async () => { await using tmp = await tmpdir({ config: { agent: { - build: { disable: true }, + builder: { disable: true }, + analyst: { disable: true }, + executive: { disable: true }, + validator: { disable: true }, + migrator: { disable: true }, plan: { disable: true }, }, }, @@ -682,7 +686,7 @@ test("defaultAgent throws when all primary agents are disabled", async () => { await Instance.provide({ directory: tmp.path, fn: async () => { - // build and plan are disabled, no primary-capable agents remain + // all primary visible agents are disabled, no primary-capable agents remain await expect(Agent.defaultAgent()).rejects.toThrow("no primary visible agent found") }, }) diff --git a/packages/altimate-code/test/config/agent-color.test.ts b/packages/altimate-code/test/config/agent-color.test.ts index b9c7cccc48..0b5d70738f 100644 --- a/packages/altimate-code/test/config/agent-color.test.ts +++ b/packages/altimate-code/test/config/agent-color.test.ts @@ -10,11 +10,11 @@ test("agent color parsed from project config", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", agent: { - build: { color: "#FFA500" }, + builder: { color: "#FFA500" }, plan: { color: "primary" }, }, }), @@ -25,7 +25,7 @@ test("agent color parsed from project config", async () => { directory: tmp.path, fn: async () => { const cfg = await Config.get() - expect(cfg.agent?.["build"]?.color).toBe("#FFA500") + expect(cfg.agent?.["builder"]?.color).toBe("#FFA500") expect(cfg.agent?.["plan"]?.color).toBe("primary") }, }) @@ -35,12 +35,12 @@ test("Agent.get includes color from config", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", agent: { plan: { color: "#A855F7" }, - build: { color: "accent" }, + builder: { color: "accent" }, }, }), ) @@ -51,7 +51,7 @@ test("Agent.get includes color from config", async () => { fn: async () => { const plan = await AgentSvc.get("plan") expect(plan?.color).toBe("#A855F7") - const build = await AgentSvc.get("build") + const build = await AgentSvc.get("builder") expect(build?.color).toBe("accent") }, }) diff --git a/packages/altimate-code/test/config/config.test.ts b/packages/altimate-code/test/config/config.test.ts index 56773570af..18215d6a4d 100644 --- a/packages/altimate-code/test/config/config.test.ts +++ b/packages/altimate-code/test/config/config.test.ts @@ -10,18 +10,18 @@ import { Global } from "../../src/global" import { Filesystem } from "../../src/util/filesystem" // Get managed config directory from environment (set in preload.ts) -const managedConfigDir = process.env.OPENCODE_TEST_MANAGED_CONFIG_DIR! +const managedConfigDir = process.env.ALTIMATE_CLI_TEST_MANAGED_CONFIG_DIR! afterEach(async () => { await fs.rm(managedConfigDir, { force: true, recursive: true }).catch(() => {}) }) -async function writeManagedSettings(settings: object, filename = "opencode.json") { +async function writeManagedSettings(settings: object, filename = "altimate-code.json") { await fs.mkdir(managedConfigDir, { recursive: true }) await Filesystem.write(path.join(managedConfigDir, filename), JSON.stringify(settings)) } -async function writeConfig(dir: string, config: object, name = "opencode.json") { +async function writeConfig(dir: string, config: object, name = "altimate-code.json") { await Filesystem.write(path.join(dir, name), JSON.stringify(config)) } @@ -40,7 +40,7 @@ test("loads JSON config file", async () => { await using tmp = await tmpdir({ init: async (dir) => { await writeConfig(dir, { - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", model: "test/model", username: "testuser", }) @@ -60,10 +60,10 @@ test("loads JSONC config file", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Filesystem.write( - path.join(dir, "opencode.jsonc"), + path.join(dir, "altimate-code.jsonc"), `{ // This is a comment - "$schema": "https://opencode.ai/config.json", + "$schema": "https://altimate-code.dev/config.json", "model": "test/model", "username": "testuser" }`, @@ -86,14 +86,14 @@ test("merges multiple config files with correct precedence", async () => { await writeConfig( dir, { - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", model: "base", username: "base", }, - "opencode.jsonc", + "altimate-code.jsonc", ) await writeConfig(dir, { - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", model: "override", }) }, @@ -116,7 +116,7 @@ test("handles environment variable substitution", async () => { await using tmp = await tmpdir({ init: async (dir) => { await writeConfig(dir, { - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", theme: "{env:TEST_VAR}", }) }, @@ -146,7 +146,7 @@ test("preserves env variables when adding $schema to config", async () => { init: async (dir) => { // Config without $schema - should trigger auto-add await Filesystem.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ theme: "{env:PRESERVE_VAR}", }), @@ -160,7 +160,7 @@ test("preserves env variables when adding $schema to config", async () => { expect(config.theme).toBe("secret_value") // Read the file to verify the env variable was preserved - const content = await Filesystem.readText(path.join(tmp.path, "opencode.json")) + const content = await Filesystem.readText(path.join(tmp.path, "altimate-code.json")) expect(content).toContain("{env:PRESERVE_VAR}") expect(content).not.toContain("secret_value") expect(content).toContain("$schema") @@ -180,7 +180,7 @@ test("handles file inclusion substitution", async () => { init: async (dir) => { await Filesystem.write(path.join(dir, "included.txt"), "test_theme") await writeConfig(dir, { - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", theme: "{file:included.txt}", }) }, @@ -199,7 +199,7 @@ test("handles file inclusion with replacement tokens", async () => { init: async (dir) => { await Filesystem.write(path.join(dir, "included.md"), "const out = await Bun.$`echo hi`") await writeConfig(dir, { - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", theme: "{file:included.md}", }) }, @@ -217,7 +217,7 @@ test("validates config schema and throws on invalid fields", async () => { await using tmp = await tmpdir({ init: async (dir) => { await writeConfig(dir, { - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", invalid_field: "should cause error", }) }, @@ -234,7 +234,7 @@ test("validates config schema and throws on invalid fields", async () => { test("throws error for invalid JSON", async () => { await using tmp = await tmpdir({ init: async (dir) => { - await Filesystem.write(path.join(dir, "opencode.json"), "{ invalid json }") + await Filesystem.write(path.join(dir, "altimate-code.json"), "{ invalid json }") }, }) await Instance.provide({ @@ -249,7 +249,7 @@ test("handles agent configuration", async () => { await using tmp = await tmpdir({ init: async (dir) => { await writeConfig(dir, { - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", agent: { test_agent: { model: "test/model", @@ -279,7 +279,7 @@ test("treats agent variant as model-scoped setting (not provider option)", async await using tmp = await tmpdir({ init: async (dir) => { await writeConfig(dir, { - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", agent: { test_agent: { model: "openai/gpt-5.2", @@ -310,7 +310,7 @@ test("handles command configuration", async () => { await using tmp = await tmpdir({ init: async (dir) => { await writeConfig(dir, { - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", command: { test_command: { template: "test template", @@ -338,9 +338,9 @@ test("migrates autoshare to share field", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Filesystem.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", autoshare: true, }), ) @@ -360,9 +360,9 @@ test("migrates mode field to agent field", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Filesystem.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", mode: { test_mode: { model: "test/model", @@ -391,7 +391,7 @@ test("migrates mode field to agent field", async () => { test("loads config from .opencode directory", async () => { await using tmp = await tmpdir({ init: async (dir) => { - const opencodeDir = path.join(dir, ".opencode") + const opencodeDir = path.join(dir, ".altimate-code") await fs.mkdir(opencodeDir, { recursive: true }) const agentDir = path.join(opencodeDir, "agent") await fs.mkdir(agentDir, { recursive: true }) @@ -420,10 +420,10 @@ Test agent prompt`, }) }) -test("loads agents from .opencode/agents (plural)", async () => { +test("loads agents from .altimate-code/agents (plural)", async () => { await using tmp = await tmpdir({ init: async (dir) => { - const opencodeDir = path.join(dir, ".opencode") + const opencodeDir = path.join(dir, ".altimate-code") await fs.mkdir(opencodeDir, { recursive: true }) const agentsDir = path.join(opencodeDir, "agents") @@ -471,10 +471,10 @@ Nested agent prompt`, }) }) -test("loads commands from .opencode/command (singular)", async () => { +test("loads commands from .altimate-code/command (singular)", async () => { await using tmp = await tmpdir({ init: async (dir) => { - const opencodeDir = path.join(dir, ".opencode") + const opencodeDir = path.join(dir, ".altimate-code") await fs.mkdir(opencodeDir, { recursive: true }) const commandDir = path.join(opencodeDir, "command") @@ -516,10 +516,10 @@ Nested command template`, }) }) -test("loads commands from .opencode/commands (plural)", async () => { +test("loads commands from .altimate-code/commands (plural)", async () => { await using tmp = await tmpdir({ init: async (dir) => { - const opencodeDir = path.join(dir, ".opencode") + const opencodeDir = path.join(dir, ".altimate-code") await fs.mkdir(opencodeDir, { recursive: true }) const commandsDir = path.join(opencodeDir, "commands") @@ -586,7 +586,7 @@ test("gets config directories", async () => { }) }) -test("does not try to install dependencies in read-only OPENCODE_CONFIG_DIR", async () => { +test("does not try to install dependencies in read-only ALTIMATE_CLI_CONFIG_DIR", async () => { if (process.platform === "win32") return await using tmp = await tmpdir({ @@ -603,8 +603,8 @@ test("does not try to install dependencies in read-only OPENCODE_CONFIG_DIR", as }, }) - const prev = process.env.OPENCODE_CONFIG_DIR - process.env.OPENCODE_CONFIG_DIR = tmp.extra + const prev = process.env.ALTIMATE_CLI_CONFIG_DIR + process.env.ALTIMATE_CLI_CONFIG_DIR = tmp.extra try { await Instance.provide({ @@ -614,12 +614,12 @@ test("does not try to install dependencies in read-only OPENCODE_CONFIG_DIR", as }, }) } finally { - if (prev === undefined) delete process.env.OPENCODE_CONFIG_DIR - else process.env.OPENCODE_CONFIG_DIR = prev + if (prev === undefined) delete process.env.ALTIMATE_CLI_CONFIG_DIR + else process.env.ALTIMATE_CLI_CONFIG_DIR = prev } }) -test("installs dependencies in writable OPENCODE_CONFIG_DIR", async () => { +test("installs dependencies in writable ALTIMATE_CLI_CONFIG_DIR", async () => { await using tmp = await tmpdir({ init: async (dir) => { const cfg = path.join(dir, "configdir") @@ -628,8 +628,8 @@ test("installs dependencies in writable OPENCODE_CONFIG_DIR", async () => { }, }) - const prev = process.env.OPENCODE_CONFIG_DIR - process.env.OPENCODE_CONFIG_DIR = tmp.extra + const prev = process.env.ALTIMATE_CLI_CONFIG_DIR + process.env.ALTIMATE_CLI_CONFIG_DIR = tmp.extra try { await Instance.provide({ @@ -643,8 +643,8 @@ test("installs dependencies in writable OPENCODE_CONFIG_DIR", async () => { expect(await Filesystem.exists(path.join(tmp.extra, "package.json"))).toBe(true) expect(await Filesystem.exists(path.join(tmp.extra, ".gitignore"))).toBe(true) } finally { - if (prev === undefined) delete process.env.OPENCODE_CONFIG_DIR - else process.env.OPENCODE_CONFIG_DIR = prev + if (prev === undefined) delete process.env.ALTIMATE_CLI_CONFIG_DIR + else process.env.ALTIMATE_CLI_CONFIG_DIR = prev } }) @@ -676,8 +676,8 @@ test("resolves scoped npm plugins in config", async () => { await Filesystem.write(path.join(pluginDir, "index.js"), "export default {}\n") await Filesystem.write( - path.join(dir, "opencode.json"), - JSON.stringify({ $schema: "https://opencode.ai/config.json", plugin: ["@scope/plugin"] }, null, 2), + path.join(dir, "altimate-code.json"), + JSON.stringify({ $schema: "https://altimate-code.dev/config.json", plugin: ["@scope/plugin"] }, null, 2), ) }, }) @@ -688,7 +688,7 @@ test("resolves scoped npm plugins in config", async () => { const config = await Config.get() const pluginEntries = config.plugin ?? [] - const baseUrl = pathToFileURL(path.join(tmp.path, "opencode.json")).href + const baseUrl = pathToFileURL(path.join(tmp.path, "altimate-code.json")).href const expected = import.meta.resolve("@scope/plugin", baseUrl) expect(pluginEntries.includes(expected)).toBe(true) @@ -705,23 +705,23 @@ test("merges plugin arrays from global and local configs", async () => { init: async (dir) => { // Create a nested project structure with local .opencode config const projectDir = path.join(dir, "project") - const opencodeDir = path.join(projectDir, ".opencode") + const opencodeDir = path.join(projectDir, ".altimate-code") await fs.mkdir(opencodeDir, { recursive: true }) // Global config with plugins await Filesystem.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", plugin: ["global-plugin-1", "global-plugin-2"], }), ) // Local .opencode config with different plugins await Filesystem.write( - path.join(opencodeDir, "opencode.json"), + path.join(opencodeDir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", plugin: ["local-plugin-1"], }), ) @@ -749,7 +749,7 @@ test("merges plugin arrays from global and local configs", async () => { test("does not error when only custom agent is a subagent", async () => { await using tmp = await tmpdir({ init: async (dir) => { - const opencodeDir = path.join(dir, ".opencode") + const opencodeDir = path.join(dir, ".altimate-code") await fs.mkdir(opencodeDir, { recursive: true }) const agentDir = path.join(opencodeDir, "agent") await fs.mkdir(agentDir, { recursive: true }) @@ -782,21 +782,21 @@ test("merges instructions arrays from global and local configs", async () => { await using tmp = await tmpdir({ init: async (dir) => { const projectDir = path.join(dir, "project") - const opencodeDir = path.join(projectDir, ".opencode") + const opencodeDir = path.join(projectDir, ".altimate-code") await fs.mkdir(opencodeDir, { recursive: true }) await Filesystem.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", instructions: ["global-instructions.md", "shared-rules.md"], }), ) await Filesystem.write( - path.join(opencodeDir, "opencode.json"), + path.join(opencodeDir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", instructions: ["local-instructions.md"], }), ) @@ -821,21 +821,21 @@ test("deduplicates duplicate instructions from global and local configs", async await using tmp = await tmpdir({ init: async (dir) => { const projectDir = path.join(dir, "project") - const opencodeDir = path.join(projectDir, ".opencode") + const opencodeDir = path.join(projectDir, ".altimate-code") await fs.mkdir(opencodeDir, { recursive: true }) await Filesystem.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", instructions: ["duplicate.md", "global-only.md"], }), ) await Filesystem.write( - path.join(opencodeDir, "opencode.json"), + path.join(opencodeDir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", instructions: ["duplicate.md", "local-only.md"], }), ) @@ -864,23 +864,23 @@ test("deduplicates duplicate plugins from global and local configs", async () => init: async (dir) => { // Create a nested project structure with local .opencode config const projectDir = path.join(dir, "project") - const opencodeDir = path.join(projectDir, ".opencode") + const opencodeDir = path.join(projectDir, ".altimate-code") await fs.mkdir(opencodeDir, { recursive: true }) // Global config with plugins await Filesystem.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", plugin: ["duplicate-plugin", "global-plugin-1"], }), ) // Local .opencode config with some overlapping plugins await Filesystem.write( - path.join(opencodeDir, "opencode.json"), + path.join(opencodeDir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", plugin: ["duplicate-plugin", "local-plugin-1"], }), ) @@ -917,9 +917,9 @@ test("migrates legacy tools config to permissions - allow", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Filesystem.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", agent: { test: { tools: { @@ -948,9 +948,9 @@ test("migrates legacy tools config to permissions - deny", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Filesystem.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", agent: { test: { tools: { @@ -979,9 +979,9 @@ test("migrates legacy write tool to edit permission", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Filesystem.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", agent: { test: { tools: { @@ -1005,13 +1005,13 @@ test("migrates legacy write tool to edit permission", async () => { }) // Managed settings tests -// Note: preload.ts sets OPENCODE_TEST_MANAGED_CONFIG which Global.Path.managedConfig uses +// Note: preload.ts sets ALTIMATE_CLI_TEST_MANAGED_CONFIG which Global.Path.managedConfig uses test("managed settings override user settings", async () => { await using tmp = await tmpdir({ init: async (dir) => { await writeConfig(dir, { - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", model: "user/model", share: "auto", username: "testuser", @@ -1020,7 +1020,7 @@ test("managed settings override user settings", async () => { }) await writeManagedSettings({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", model: "managed/model", share: "disabled", }) @@ -1040,7 +1040,7 @@ test("managed settings override project settings", async () => { await using tmp = await tmpdir({ init: async (dir) => { await writeConfig(dir, { - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", autoupdate: true, disabled_providers: [], theme: "dark", @@ -1049,7 +1049,7 @@ test("managed settings override project settings", async () => { }) await writeManagedSettings({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", autoupdate: false, disabled_providers: ["openai"], }) @@ -1069,7 +1069,7 @@ test("missing managed settings file is not an error", async () => { await using tmp = await tmpdir({ init: async (dir) => { await writeConfig(dir, { - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", model: "user/model", }) }, @@ -1088,9 +1088,9 @@ test("migrates legacy edit tool to edit permission", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Filesystem.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", agent: { test: { tools: { @@ -1117,9 +1117,9 @@ test("migrates legacy patch tool to edit permission", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Filesystem.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", agent: { test: { tools: { @@ -1146,9 +1146,9 @@ test("migrates legacy multiedit tool to edit permission", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Filesystem.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", agent: { test: { tools: { @@ -1175,9 +1175,9 @@ test("migrates mixed legacy tools config", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Filesystem.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", agent: { test: { tools: { @@ -1210,9 +1210,9 @@ test("merges legacy tools with existing permission config", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Filesystem.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", agent: { test: { permission: { @@ -1243,9 +1243,9 @@ test("permission config preserves key order", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Filesystem.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", permission: { "*": "deny", edit: "ask", @@ -1291,9 +1291,9 @@ test("project config can override MCP server enabled status", async () => { init: async (dir) => { // Simulates a base config (like from remote .well-known) with disabled MCP await Filesystem.write( - path.join(dir, "opencode.jsonc"), + path.join(dir, "altimate-code.jsonc"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", mcp: { jira: { type: "remote", @@ -1310,9 +1310,9 @@ test("project config can override MCP server enabled status", async () => { ) // Project config enables just jira await Filesystem.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", mcp: { jira: { type: "remote", @@ -1349,9 +1349,9 @@ test("MCP config deep merges preserving base config properties", async () => { init: async (dir) => { // Base config with full MCP definition await Filesystem.write( - path.join(dir, "opencode.jsonc"), + path.join(dir, "altimate-code.jsonc"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", mcp: { myserver: { type: "remote", @@ -1366,9 +1366,9 @@ test("MCP config deep merges preserving base config properties", async () => { ) // Override just enables it, should preserve other properties await Filesystem.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", mcp: { myserver: { type: "remote", @@ -1401,9 +1401,9 @@ test("local .opencode config can override MCP from project config", async () => init: async (dir) => { // Project config with disabled MCP await Filesystem.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", mcp: { docs: { type: "remote", @@ -1414,12 +1414,12 @@ test("local .opencode config can override MCP from project config", async () => }), ) // Local .opencode directory config enables it - const opencodeDir = path.join(dir, ".opencode") + const opencodeDir = path.join(dir, ".altimate-code") await fs.mkdir(opencodeDir, { recursive: true }) await Filesystem.write( - path.join(opencodeDir, "opencode.json"), + path.join(opencodeDir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", mcp: { docs: { type: "remote", @@ -1445,7 +1445,7 @@ test("project config overrides remote well-known config", async () => { let fetchedUrl: string | undefined const mockFetch = mock((url: string | URL | Request) => { const urlStr = url.toString() - if (urlStr.includes(".well-known/opencode")) { + if (urlStr.includes(".well-known/altimate-code")) { fetchedUrl = urlStr return Promise.resolve( new Response( @@ -1485,9 +1485,9 @@ test("project config overrides remote well-known config", async () => { init: async (dir) => { // Project config enables jira (overriding remote default) await Filesystem.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", mcp: { jira: { type: "remote", @@ -1504,7 +1504,7 @@ test("project config overrides remote well-known config", async () => { fn: async () => { const config = await Config.get() // Verify fetch was called for wellknown config - expect(fetchedUrl).toBe("https://example.com/.well-known/opencode") + expect(fetchedUrl).toBe("https://example.com/.well-known/altimate-code") // Project config (enabled: true) should override remote (enabled: false) expect(config.mcp?.jira?.enabled).toBe(true) }, @@ -1553,12 +1553,12 @@ describe("deduplicatePlugins", () => { }) test("prefers local file over npm package with same name", () => { - const plugins = ["oh-my-opencode@2.4.3", "file:///project/.opencode/plugin/oh-my-opencode.js"] + const plugins = ["oh-my-opencode@2.4.3", "file:///project/.altimate-code/plugin/oh-my-opencode.js"] const result = Config.deduplicatePlugins(plugins) expect(result.length).toBe(1) - expect(result[0]).toBe("file:///project/.opencode/plugin/oh-my-opencode.js") + expect(result[0]).toBe("file:///project/.altimate-code/plugin/oh-my-opencode.js") }) test("preserves order of remaining plugins", () => { @@ -1569,18 +1569,18 @@ describe("deduplicatePlugins", () => { expect(result).toEqual(["a-plugin@1.0.0", "b-plugin@1.0.0", "c-plugin@1.0.0"]) }) - test("local plugin directory overrides global opencode.json plugin", async () => { + test("local plugin directory overrides global altimate-code.json plugin", async () => { await using tmp = await tmpdir({ init: async (dir) => { const projectDir = path.join(dir, "project") - const opencodeDir = path.join(projectDir, ".opencode") + const opencodeDir = path.join(projectDir, ".altimate-code") const pluginDir = path.join(opencodeDir, "plugin") await fs.mkdir(pluginDir, { recursive: true }) await Filesystem.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", plugin: ["my-plugin@1.0.0"], }), ) @@ -1603,19 +1603,19 @@ describe("deduplicatePlugins", () => { }) }) -describe("OPENCODE_DISABLE_PROJECT_CONFIG", () => { +describe("ALTIMATE_CLI_DISABLE_PROJECT_CONFIG", () => { test("skips project config files when flag is set", async () => { - const originalEnv = process.env["OPENCODE_DISABLE_PROJECT_CONFIG"] - process.env["OPENCODE_DISABLE_PROJECT_CONFIG"] = "true" + const originalEnv = process.env["ALTIMATE_CLI_DISABLE_PROJECT_CONFIG"] + process.env["ALTIMATE_CLI_DISABLE_PROJECT_CONFIG"] = "true" try { await using tmp = await tmpdir({ init: async (dir) => { // Create a project config that would normally be loaded await Filesystem.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", model: "project/model", username: "project-user", }), @@ -1633,22 +1633,22 @@ describe("OPENCODE_DISABLE_PROJECT_CONFIG", () => { }) } finally { if (originalEnv === undefined) { - delete process.env["OPENCODE_DISABLE_PROJECT_CONFIG"] + delete process.env["ALTIMATE_CLI_DISABLE_PROJECT_CONFIG"] } else { - process.env["OPENCODE_DISABLE_PROJECT_CONFIG"] = originalEnv + process.env["ALTIMATE_CLI_DISABLE_PROJECT_CONFIG"] = originalEnv } } }) - test("skips project .opencode/ directories when flag is set", async () => { - const originalEnv = process.env["OPENCODE_DISABLE_PROJECT_CONFIG"] - process.env["OPENCODE_DISABLE_PROJECT_CONFIG"] = "true" + test("skips project .altimate-code/ directories when flag is set", async () => { + const originalEnv = process.env["ALTIMATE_CLI_DISABLE_PROJECT_CONFIG"] + process.env["ALTIMATE_CLI_DISABLE_PROJECT_CONFIG"] = "true" try { await using tmp = await tmpdir({ init: async (dir) => { // Create a .opencode directory with a command - const opencodeDir = path.join(dir, ".opencode", "command") + const opencodeDir = path.join(dir, ".altimate-code", "command") await fs.mkdir(opencodeDir, { recursive: true }) await Filesystem.write(path.join(opencodeDir, "test-cmd.md"), "# Test Command\nThis is a test command.") }, @@ -1664,16 +1664,16 @@ describe("OPENCODE_DISABLE_PROJECT_CONFIG", () => { }) } finally { if (originalEnv === undefined) { - delete process.env["OPENCODE_DISABLE_PROJECT_CONFIG"] + delete process.env["ALTIMATE_CLI_DISABLE_PROJECT_CONFIG"] } else { - process.env["OPENCODE_DISABLE_PROJECT_CONFIG"] = originalEnv + process.env["ALTIMATE_CLI_DISABLE_PROJECT_CONFIG"] = originalEnv } } }) test("still loads global config when flag is set", async () => { - const originalEnv = process.env["OPENCODE_DISABLE_PROJECT_CONFIG"] - process.env["OPENCODE_DISABLE_PROJECT_CONFIG"] = "true" + const originalEnv = process.env["ALTIMATE_CLI_DISABLE_PROJECT_CONFIG"] + process.env["ALTIMATE_CLI_DISABLE_PROJECT_CONFIG"] = "true" try { await using tmp = await tmpdir() @@ -1688,29 +1688,29 @@ describe("OPENCODE_DISABLE_PROJECT_CONFIG", () => { }) } finally { if (originalEnv === undefined) { - delete process.env["OPENCODE_DISABLE_PROJECT_CONFIG"] + delete process.env["ALTIMATE_CLI_DISABLE_PROJECT_CONFIG"] } else { - process.env["OPENCODE_DISABLE_PROJECT_CONFIG"] = originalEnv + process.env["ALTIMATE_CLI_DISABLE_PROJECT_CONFIG"] = originalEnv } } }) test("skips relative instructions with warning when flag is set but no config dir", async () => { - const originalDisable = process.env["OPENCODE_DISABLE_PROJECT_CONFIG"] - const originalConfigDir = process.env["OPENCODE_CONFIG_DIR"] + const originalDisable = process.env["ALTIMATE_CLI_DISABLE_PROJECT_CONFIG"] + const originalConfigDir = process.env["ALTIMATE_CLI_CONFIG_DIR"] try { // Ensure no config dir is set - delete process.env["OPENCODE_CONFIG_DIR"] - process.env["OPENCODE_DISABLE_PROJECT_CONFIG"] = "true" + delete process.env["ALTIMATE_CLI_CONFIG_DIR"] + process.env["ALTIMATE_CLI_DISABLE_PROJECT_CONFIG"] = "true" await using tmp = await tmpdir({ init: async (dir) => { // Create a config with relative instruction path await Filesystem.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", instructions: ["./CUSTOM.md"], }), ) @@ -1733,30 +1733,30 @@ describe("OPENCODE_DISABLE_PROJECT_CONFIG", () => { }) } finally { if (originalDisable === undefined) { - delete process.env["OPENCODE_DISABLE_PROJECT_CONFIG"] + delete process.env["ALTIMATE_CLI_DISABLE_PROJECT_CONFIG"] } else { - process.env["OPENCODE_DISABLE_PROJECT_CONFIG"] = originalDisable + process.env["ALTIMATE_CLI_DISABLE_PROJECT_CONFIG"] = originalDisable } if (originalConfigDir === undefined) { - delete process.env["OPENCODE_CONFIG_DIR"] + delete process.env["ALTIMATE_CLI_CONFIG_DIR"] } else { - process.env["OPENCODE_CONFIG_DIR"] = originalConfigDir + process.env["ALTIMATE_CLI_CONFIG_DIR"] = originalConfigDir } } }) - test("OPENCODE_CONFIG_DIR still works when flag is set", async () => { - const originalDisable = process.env["OPENCODE_DISABLE_PROJECT_CONFIG"] - const originalConfigDir = process.env["OPENCODE_CONFIG_DIR"] + test("ALTIMATE_CLI_CONFIG_DIR still works when flag is set", async () => { + const originalDisable = process.env["ALTIMATE_CLI_DISABLE_PROJECT_CONFIG"] + const originalConfigDir = process.env["ALTIMATE_CLI_CONFIG_DIR"] try { await using configDirTmp = await tmpdir({ init: async (dir) => { // Create config in the custom config dir await Filesystem.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", model: "configdir/model", }), ) @@ -1767,48 +1767,48 @@ describe("OPENCODE_DISABLE_PROJECT_CONFIG", () => { init: async (dir) => { // Create config in project (should be ignored) await Filesystem.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", model: "project/model", }), ) }, }) - process.env["OPENCODE_DISABLE_PROJECT_CONFIG"] = "true" - process.env["OPENCODE_CONFIG_DIR"] = configDirTmp.path + process.env["ALTIMATE_CLI_DISABLE_PROJECT_CONFIG"] = "true" + process.env["ALTIMATE_CLI_CONFIG_DIR"] = configDirTmp.path await Instance.provide({ directory: projectTmp.path, fn: async () => { const config = await Config.get() - // Should load from OPENCODE_CONFIG_DIR, not project + // Should load from ALTIMATE_CLI_CONFIG_DIR, not project expect(config.model).toBe("configdir/model") }, }) } finally { if (originalDisable === undefined) { - delete process.env["OPENCODE_DISABLE_PROJECT_CONFIG"] + delete process.env["ALTIMATE_CLI_DISABLE_PROJECT_CONFIG"] } else { - process.env["OPENCODE_DISABLE_PROJECT_CONFIG"] = originalDisable + process.env["ALTIMATE_CLI_DISABLE_PROJECT_CONFIG"] = originalDisable } if (originalConfigDir === undefined) { - delete process.env["OPENCODE_CONFIG_DIR"] + delete process.env["ALTIMATE_CLI_CONFIG_DIR"] } else { - process.env["OPENCODE_CONFIG_DIR"] = originalConfigDir + process.env["ALTIMATE_CLI_CONFIG_DIR"] = originalConfigDir } } }) }) -describe("OPENCODE_CONFIG_CONTENT token substitution", () => { - test("substitutes {env:} tokens in OPENCODE_CONFIG_CONTENT", async () => { - const originalEnv = process.env["OPENCODE_CONFIG_CONTENT"] +describe("ALTIMATE_CLI_CONFIG_CONTENT token substitution", () => { + test("substitutes {env:} tokens in ALTIMATE_CLI_CONFIG_CONTENT", async () => { + const originalEnv = process.env["ALTIMATE_CLI_CONFIG_CONTENT"] const originalTestVar = process.env["TEST_CONFIG_VAR"] process.env["TEST_CONFIG_VAR"] = "test_api_key_12345" - process.env["OPENCODE_CONFIG_CONTENT"] = JSON.stringify({ - $schema: "https://opencode.ai/config.json", + process.env["ALTIMATE_CLI_CONFIG_CONTENT"] = JSON.stringify({ + $schema: "https://altimate-code.dev/config.json", theme: "{env:TEST_CONFIG_VAR}", }) @@ -1823,9 +1823,9 @@ describe("OPENCODE_CONFIG_CONTENT token substitution", () => { }) } finally { if (originalEnv !== undefined) { - process.env["OPENCODE_CONFIG_CONTENT"] = originalEnv + process.env["ALTIMATE_CLI_CONFIG_CONTENT"] = originalEnv } else { - delete process.env["OPENCODE_CONFIG_CONTENT"] + delete process.env["ALTIMATE_CLI_CONFIG_CONTENT"] } if (originalTestVar !== undefined) { process.env["TEST_CONFIG_VAR"] = originalTestVar @@ -1835,15 +1835,15 @@ describe("OPENCODE_CONFIG_CONTENT token substitution", () => { } }) - test("substitutes {file:} tokens in OPENCODE_CONFIG_CONTENT", async () => { - const originalEnv = process.env["OPENCODE_CONFIG_CONTENT"] + test("substitutes {file:} tokens in ALTIMATE_CLI_CONFIG_CONTENT", async () => { + const originalEnv = process.env["ALTIMATE_CLI_CONFIG_CONTENT"] try { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write(path.join(dir, "api_key.txt"), "secret_key_from_file") - process.env["OPENCODE_CONFIG_CONTENT"] = JSON.stringify({ - $schema: "https://opencode.ai/config.json", + process.env["ALTIMATE_CLI_CONFIG_CONTENT"] = JSON.stringify({ + $schema: "https://altimate-code.dev/config.json", theme: "{file:./api_key.txt}", }) }, @@ -1857,9 +1857,9 @@ describe("OPENCODE_CONFIG_CONTENT token substitution", () => { }) } finally { if (originalEnv !== undefined) { - process.env["OPENCODE_CONFIG_CONTENT"] = originalEnv + process.env["ALTIMATE_CLI_CONFIG_CONTENT"] = originalEnv } else { - delete process.env["OPENCODE_CONFIG_CONTENT"] + delete process.env["ALTIMATE_CLI_CONFIG_CONTENT"] } } }) diff --git a/packages/altimate-code/test/file/path-traversal.test.ts b/packages/altimate-code/test/file/path-traversal.test.ts index 44ae8f1543..8aa1ebb943 100644 --- a/packages/altimate-code/test/file/path-traversal.test.ts +++ b/packages/altimate-code/test/file/path-traversal.test.ts @@ -137,7 +137,7 @@ describe("Instance.containsPath", () => { directory: subdir, fn: () => { // .opencode at worktree root, but we're running from packages/lib - expect(Instance.containsPath(path.join(tmp.path, ".opencode", "state"))).toBe(true) + expect(Instance.containsPath(path.join(tmp.path, ".altimate-code", "state"))).toBe(true) // sibling package should also be accessible expect(Instance.containsPath(path.join(tmp.path, "packages", "other", "file.ts"))).toBe(true) // worktree root itself diff --git a/packages/altimate-code/test/file/ripgrep.test.ts b/packages/altimate-code/test/file/ripgrep.test.ts index ac46f1131b..2bcf044d6c 100644 --- a/packages/altimate-code/test/file/ripgrep.test.ts +++ b/packages/altimate-code/test/file/ripgrep.test.ts @@ -9,14 +9,14 @@ describe("file.ripgrep", () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write(path.join(dir, "visible.txt"), "hello") - await fs.mkdir(path.join(dir, ".opencode"), { recursive: true }) - await Bun.write(path.join(dir, ".opencode", "thing.json"), "{}") + await fs.mkdir(path.join(dir, ".altimate-code"), { recursive: true }) + await Bun.write(path.join(dir, ".altimate-code", "thing.json"), "{}") }, }) const files = await Array.fromAsync(Ripgrep.files({ cwd: tmp.path })) const hasVisible = files.includes("visible.txt") - const hasHidden = files.includes(path.join(".opencode", "thing.json")) + const hasHidden = files.includes(path.join(".altimate-code", "thing.json")) expect(hasVisible).toBe(true) expect(hasHidden).toBe(true) }) @@ -25,14 +25,14 @@ describe("file.ripgrep", () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write(path.join(dir, "visible.txt"), "hello") - await fs.mkdir(path.join(dir, ".opencode"), { recursive: true }) - await Bun.write(path.join(dir, ".opencode", "thing.json"), "{}") + await fs.mkdir(path.join(dir, ".altimate-code"), { recursive: true }) + await Bun.write(path.join(dir, ".altimate-code", "thing.json"), "{}") }, }) const files = await Array.fromAsync(Ripgrep.files({ cwd: tmp.path, hidden: false })) const hasVisible = files.includes("visible.txt") - const hasHidden = files.includes(path.join(".opencode", "thing.json")) + const hasHidden = files.includes(path.join(".altimate-code", "thing.json")) expect(hasVisible).toBe(true) expect(hasHidden).toBe(false) }) diff --git a/packages/altimate-code/test/fixture/fixture.ts b/packages/altimate-code/test/fixture/fixture.ts index a22bb57440..0f1aac584f 100644 --- a/packages/altimate-code/test/fixture/fixture.ts +++ b/packages/altimate-code/test/fixture/fixture.ts @@ -16,7 +16,7 @@ type TmpDirOptions = { dispose?: (dir: string) => Promise } export async function tmpdir(options?: TmpDirOptions) { - const dirpath = sanitizePath(path.join(os.tmpdir(), "opencode-test-" + Math.random().toString(36).slice(2))) + const dirpath = sanitizePath(path.join(os.tmpdir(), "altimate-code-test-" + Math.random().toString(36).slice(2))) await fs.mkdir(dirpath, { recursive: true }) if (options?.git) { await $`git init`.cwd(dirpath).quiet() diff --git a/packages/altimate-code/test/ide/ide.test.ts b/packages/altimate-code/test/ide/ide.test.ts index 4d70140197..82cfa0956e 100644 --- a/packages/altimate-code/test/ide/ide.test.ts +++ b/packages/altimate-code/test/ide/ide.test.ts @@ -62,20 +62,20 @@ describe("ide", () => { expect(Ide.ide()).toBe("unknown") }) - test("should recognize vscode-insiders OPENCODE_CALLER", () => { - process.env["OPENCODE_CALLER"] = "vscode-insiders" + test("should recognize vscode-insiders ALTIMATE_CLI_CALLER", () => { + process.env["ALTIMATE_CLI_CALLER"] = "vscode-insiders" expect(Ide.alreadyInstalled()).toBe(true) }) - test("should recognize vscode OPENCODE_CALLER", () => { - process.env["OPENCODE_CALLER"] = "vscode" + test("should recognize vscode ALTIMATE_CLI_CALLER", () => { + process.env["ALTIMATE_CLI_CALLER"] = "vscode" expect(Ide.alreadyInstalled()).toBe(true) }) - test("should return false for unknown OPENCODE_CALLER", () => { - process.env["OPENCODE_CALLER"] = "unknown" + test("should return false for unknown ALTIMATE_CLI_CALLER", () => { + process.env["ALTIMATE_CLI_CALLER"] = "unknown" expect(Ide.alreadyInstalled()).toBe(false) }) diff --git a/packages/altimate-code/test/mcp/headers.test.ts b/packages/altimate-code/test/mcp/headers.test.ts index 69998aaaa8..27eb3e9f09 100644 --- a/packages/altimate-code/test/mcp/headers.test.ts +++ b/packages/altimate-code/test/mcp/headers.test.ts @@ -51,9 +51,9 @@ test("headers are passed to transports when oauth is enabled (default)", async ( await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - `${dir}/opencode.json`, + `${dir}/altimate-code.json`, JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", mcp: { "test-server": { type: "remote", diff --git a/packages/altimate-code/test/mcp/oauth-browser.test.ts b/packages/altimate-code/test/mcp/oauth-browser.test.ts index ee4429be75..818ad6b227 100644 --- a/packages/altimate-code/test/mcp/oauth-browser.test.ts +++ b/packages/altimate-code/test/mcp/oauth-browser.test.ts @@ -109,9 +109,9 @@ test("BrowserOpenFailed event is published when open() throws", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - `${dir}/opencode.json`, + `${dir}/altimate-code.json`, JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", mcp: { "test-oauth-server": { type: "remote", @@ -160,9 +160,9 @@ test("BrowserOpenFailed event is NOT published when open() succeeds", async () = await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - `${dir}/opencode.json`, + `${dir}/altimate-code.json`, JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", mcp: { "test-oauth-server-2": { type: "remote", @@ -209,9 +209,9 @@ test("open() is called with the authorization URL", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - `${dir}/opencode.json`, + `${dir}/altimate-code.json`, JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", mcp: { "test-oauth-server-3": { type: "remote", diff --git a/packages/altimate-code/test/permission-task.test.ts b/packages/altimate-code/test/permission-task.test.ts index 3d592a3d98..fb08bac059 100644 --- a/packages/altimate-code/test/permission-task.test.ts +++ b/packages/altimate-code/test/permission-task.test.ts @@ -139,7 +139,7 @@ describe("PermissionNext.disabled for task tool", () => { // Integration tests that load permissions from real config files describe("permission.task with real config files", () => { - test("loads task permissions from opencode.json config", async () => { + test("loads task permissions from altimate-code.json config", async () => { await using tmp = await tmpdir({ git: true, config: { diff --git a/packages/altimate-code/test/plugin/auth-override.test.ts b/packages/altimate-code/test/plugin/auth-override.test.ts index d8f8ea4551..e8a3509a1b 100644 --- a/packages/altimate-code/test/plugin/auth-override.test.ts +++ b/packages/altimate-code/test/plugin/auth-override.test.ts @@ -9,7 +9,7 @@ describe("plugin.auth-override", () => { test("user plugin overrides built-in github-copilot auth", async () => { await using tmp = await tmpdir({ init: async (dir) => { - const pluginDir = path.join(dir, ".opencode", "plugin") + const pluginDir = path.join(dir, ".altimate-code", "plugin") await fs.mkdir(pluginDir, { recursive: true }) await Bun.write( diff --git a/packages/altimate-code/test/preload.ts b/packages/altimate-code/test/preload.ts index dee7045707..7f17d99608 100644 --- a/packages/altimate-code/test/preload.ts +++ b/packages/altimate-code/test/preload.ts @@ -17,20 +17,20 @@ process.env["XDG_DATA_HOME"] = path.join(dir, "share") process.env["XDG_CACHE_HOME"] = path.join(dir, "cache") process.env["XDG_CONFIG_HOME"] = path.join(dir, "config") process.env["XDG_STATE_HOME"] = path.join(dir, "state") -process.env["OPENCODE_MODELS_PATH"] = path.join(import.meta.dir, "tool", "fixtures", "models-api.json") +process.env["ALTIMATE_CLI_MODELS_PATH"] = path.join(import.meta.dir, "tool", "fixtures", "models-api.json") // Set test home directory to isolate tests from user's actual home directory // This prevents tests from picking up real user configs/skills from ~/.claude/skills const testHome = path.join(dir, "home") await fs.mkdir(testHome, { recursive: true }) -process.env["OPENCODE_TEST_HOME"] = testHome +process.env["ALTIMATE_CLI_TEST_HOME"] = testHome // Set test managed config directory to isolate tests from system managed settings const testManagedConfigDir = path.join(dir, "managed") -process.env["OPENCODE_TEST_MANAGED_CONFIG_DIR"] = testManagedConfigDir +process.env["ALTIMATE_CLI_TEST_MANAGED_CONFIG_DIR"] = testManagedConfigDir // Write the cache version file to prevent global/index.ts from clearing the cache -const cacheDir = path.join(dir, "cache", "opencode") +const cacheDir = path.join(dir, "cache", "altimate-code") await fs.mkdir(cacheDir, { recursive: true }) await fs.writeFile(path.join(cacheDir, "version"), "14") diff --git a/packages/altimate-code/test/project/project.test.ts b/packages/altimate-code/test/project/project.test.ts index fef9e4190e..952d991cee 100644 --- a/packages/altimate-code/test/project/project.test.ts +++ b/packages/altimate-code/test/project/project.test.ts @@ -78,7 +78,7 @@ describe("Project.fromDirectory", () => { expect(project.vcs).toBe("git") expect(project.worktree).toBe(tmp.path) - const opencodeFile = path.join(tmp.path, ".git", "opencode") + const opencodeFile = path.join(tmp.path, ".git", "altimate-code") const fileExists = await Filesystem.exists(opencodeFile) expect(fileExists).toBe(false) }) @@ -94,7 +94,7 @@ describe("Project.fromDirectory", () => { expect(project.vcs).toBe("git") expect(project.worktree).toBe(tmp.path) - const opencodeFile = path.join(tmp.path, ".git", "opencode") + const opencodeFile = path.join(tmp.path, ".git", "altimate-code") const fileExists = await Filesystem.exists(opencodeFile) expect(fileExists).toBe(true) }) diff --git a/packages/altimate-code/test/provider/amazon-bedrock.test.ts b/packages/altimate-code/test/provider/amazon-bedrock.test.ts index cb64455b4d..9e73e8ee32 100644 --- a/packages/altimate-code/test/provider/amazon-bedrock.test.ts +++ b/packages/altimate-code/test/provider/amazon-bedrock.test.ts @@ -13,9 +13,9 @@ test("Bedrock: config region takes precedence over AWS_REGION env var", async () await using tmp = await tmpdir({ init: async (dir) => { await Filesystem.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", provider: { "amazon-bedrock": { options: { @@ -45,9 +45,9 @@ test("Bedrock: falls back to AWS_REGION env var when no config region", async () await using tmp = await tmpdir({ init: async (dir) => { await Filesystem.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", }), ) }, @@ -70,9 +70,9 @@ test("Bedrock: loads when bearer token from auth.json is present", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Filesystem.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", provider: { "amazon-bedrock": { options: { @@ -138,9 +138,9 @@ test("Bedrock: config profile takes precedence over AWS_PROFILE env var", async await using tmp = await tmpdir({ init: async (dir) => { await Filesystem.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", provider: { "amazon-bedrock": { options: { @@ -171,9 +171,9 @@ test("Bedrock: includes custom endpoint in options when specified", async () => await using tmp = await tmpdir({ init: async (dir) => { await Filesystem.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", provider: { "amazon-bedrock": { options: { @@ -204,9 +204,9 @@ test("Bedrock: autoloads when AWS_WEB_IDENTITY_TOKEN_FILE is present", async () await using tmp = await tmpdir({ init: async (dir) => { await Filesystem.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", provider: { "amazon-bedrock": { options: { @@ -242,9 +242,9 @@ test("Bedrock: model with us. prefix should not be double-prefixed", async () => await using tmp = await tmpdir({ init: async (dir) => { await Filesystem.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", provider: { "amazon-bedrock": { options: { @@ -279,9 +279,9 @@ test("Bedrock: model with global. prefix should not be prefixed", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Filesystem.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", provider: { "amazon-bedrock": { options: { @@ -315,9 +315,9 @@ test("Bedrock: model with eu. prefix should not be double-prefixed", async () => await using tmp = await tmpdir({ init: async (dir) => { await Filesystem.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", provider: { "amazon-bedrock": { options: { @@ -351,9 +351,9 @@ test("Bedrock: model without prefix in US region should get us. prefix added", a await using tmp = await tmpdir({ init: async (dir) => { await Filesystem.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", provider: { "amazon-bedrock": { options: { diff --git a/packages/altimate-code/test/provider/gitlab-duo.test.ts b/packages/altimate-code/test/provider/gitlab-duo.test.ts index c512a45909..e1ad906d03 100644 --- a/packages/altimate-code/test/provider/gitlab-duo.test.ts +++ b/packages/altimate-code/test/provider/gitlab-duo.test.ts @@ -11,9 +11,9 @@ test("GitLab Duo: loads provider with API key from environment", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", }), ) }, @@ -35,9 +35,9 @@ test("GitLab Duo: config instanceUrl option sets baseURL", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", provider: { gitlab: { options: { @@ -67,9 +67,9 @@ test("GitLab Duo: loads with OAuth token from auth.json", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", }), ) }, @@ -104,9 +104,9 @@ test("GitLab Duo: loads with Personal Access Token from auth.json", async () => await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", }), ) }, @@ -140,9 +140,9 @@ test("GitLab Duo: supports self-hosted instance configuration", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", provider: { gitlab: { options: { @@ -172,9 +172,9 @@ test("GitLab Duo: config apiKey takes precedence over environment variable", asy await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", provider: { gitlab: { options: { @@ -202,9 +202,9 @@ test("GitLab Duo: supports feature flags configuration", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", provider: { gitlab: { options: { @@ -237,9 +237,9 @@ test("GitLab Duo: has multiple agentic chat models available", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", }), ) }, diff --git a/packages/altimate-code/test/provider/provider.test.ts b/packages/altimate-code/test/provider/provider.test.ts index 0a5aa41513..a73306f85b 100644 --- a/packages/altimate-code/test/provider/provider.test.ts +++ b/packages/altimate-code/test/provider/provider.test.ts @@ -10,9 +10,9 @@ test("provider loaded from env variable", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", }), ) }, @@ -37,9 +37,9 @@ test("provider loaded from config with apiKey option", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", provider: { anthropic: { options: { @@ -64,9 +64,9 @@ test("disabled_providers excludes provider", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", disabled_providers: ["anthropic"], }), ) @@ -88,9 +88,9 @@ test("enabled_providers restricts to only listed providers", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", enabled_providers: ["anthropic"], }), ) @@ -114,9 +114,9 @@ test("model whitelist filters models for provider", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", provider: { anthropic: { whitelist: ["claude-sonnet-4-20250514"], @@ -145,9 +145,9 @@ test("model blacklist excludes specific models", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", provider: { anthropic: { blacklist: ["claude-sonnet-4-20250514"], @@ -175,9 +175,9 @@ test("custom model alias via config", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", provider: { anthropic: { models: { @@ -210,9 +210,9 @@ test("custom provider with npm package", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", provider: { "custom-provider": { name: "Custom Provider", @@ -253,9 +253,9 @@ test("env variable takes precedence, config merges options", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", provider: { anthropic: { options: { @@ -285,9 +285,9 @@ test("getModel returns model for valid provider/model", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", }), ) }, @@ -312,9 +312,9 @@ test("getModel throws ModelNotFoundError for invalid model", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", }), ) }, @@ -334,9 +334,9 @@ test("getModel throws ModelNotFoundError for invalid provider", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", }), ) }, @@ -365,9 +365,9 @@ test("defaultModel returns first available model when no config set", async () = await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", }), ) }, @@ -389,9 +389,9 @@ test("defaultModel respects config model setting", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", model: "anthropic/claude-sonnet-4-20250514", }), ) @@ -414,9 +414,9 @@ test("provider with baseURL from config", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", provider: { "custom-openai": { name: "Custom OpenAI", @@ -453,9 +453,9 @@ test("model cost defaults to zero when not specified", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", provider: { "test-provider": { name: "Test Provider", @@ -494,9 +494,9 @@ test("model options are merged from existing model", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", provider: { anthropic: { models: { @@ -529,9 +529,9 @@ test("provider removed when all models filtered out", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", provider: { anthropic: { whitelist: ["nonexistent-model"], @@ -557,9 +557,9 @@ test("closest finds model by partial match", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", }), ) }, @@ -582,9 +582,9 @@ test("closest returns undefined for nonexistent provider", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", }), ) }, @@ -602,9 +602,9 @@ test("getModel uses realIdByKey for aliased models", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", provider: { anthropic: { models: { @@ -640,9 +640,9 @@ test("provider api field sets model api.url", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", provider: { "custom-api": { name: "Custom API", @@ -679,9 +679,9 @@ test("explicit baseURL overrides api field", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", provider: { "custom-api": { name: "Custom API", @@ -718,9 +718,9 @@ test("model inherits properties from existing database model", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", provider: { anthropic: { models: { @@ -754,9 +754,9 @@ test("disabled_providers prevents loading even with env var", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", disabled_providers: ["openai"], }), ) @@ -778,9 +778,9 @@ test("enabled_providers with empty array allows no providers", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", enabled_providers: [], }), ) @@ -803,9 +803,9 @@ test("whitelist and blacklist can be combined", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", provider: { anthropic: { whitelist: ["claude-sonnet-4-20250514", "claude-opus-4-20250514"], @@ -836,9 +836,9 @@ test("model modalities default correctly", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", provider: { "test-provider": { name: "Test", @@ -873,9 +873,9 @@ test("model with custom cost values", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", provider: { "test-provider": { name: "Test", @@ -918,9 +918,9 @@ test("getSmallModel returns appropriate small model", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", }), ) }, @@ -942,9 +942,9 @@ test("getSmallModel respects config small_model override", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", small_model: "anthropic/claude-sonnet-4-20250514", }), ) @@ -983,9 +983,9 @@ test("multiple providers can be configured simultaneously", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", provider: { anthropic: { options: { timeout: 30000 }, @@ -1018,9 +1018,9 @@ test("provider with custom npm package", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", provider: { "local-llm": { name: "Local LLM", @@ -1060,9 +1060,9 @@ test("model alias name defaults to alias key when id differs", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", provider: { anthropic: { models: { @@ -1093,9 +1093,9 @@ test("provider with multiple env var options only includes apiKey when single en await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", provider: { "multi-env": { name: "Multi Env Provider", @@ -1135,9 +1135,9 @@ test("provider with single env var includes apiKey automatically", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", provider: { "single-env": { name: "Single Env Provider", @@ -1177,9 +1177,9 @@ test("model cost overrides existing cost values", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", provider: { anthropic: { models: { @@ -1214,9 +1214,9 @@ test("completely new provider not in database can be configured", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", provider: { "brand-new-provider": { name: "Brand New", @@ -1264,9 +1264,9 @@ test("disabled_providers and enabled_providers interaction", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", // enabled_providers takes precedence - only these are considered enabled_providers: ["anthropic", "openai"], // Then disabled_providers filters from the enabled set @@ -1298,9 +1298,9 @@ test("model with tool_call false", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", provider: { "no-tools": { name: "No Tools Provider", @@ -1333,9 +1333,9 @@ test("model defaults tool_call to true when not specified", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", provider: { "default-tools": { name: "Default Tools Provider", @@ -1368,9 +1368,9 @@ test("model headers are preserved", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", provider: { "headers-provider": { name: "Headers Provider", @@ -1411,9 +1411,9 @@ test("provider env fallback - second env var used if first missing", async () => await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", provider: { "fallback-env": { name: "Fallback Env Provider", @@ -1451,9 +1451,9 @@ test("getModel returns consistent results", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", }), ) }, @@ -1477,9 +1477,9 @@ test("provider name defaults to id when not in database", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", provider: { "my-custom-id": { // no name specified @@ -1512,9 +1512,9 @@ test("ModelNotFoundError includes suggestions for typos", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", }), ) }, @@ -1540,9 +1540,9 @@ test("ModelNotFoundError for provider includes suggestions", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", }), ) }, @@ -1568,9 +1568,9 @@ test("getProvider returns undefined for nonexistent provider", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", }), ) }, @@ -1588,9 +1588,9 @@ test("getProvider returns provider info", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", }), ) }, @@ -1612,9 +1612,9 @@ test("closest returns undefined when no partial match found", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", }), ) }, @@ -1635,9 +1635,9 @@ test("closest checks multiple query terms in order", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", }), ) }, @@ -1660,9 +1660,9 @@ test("model limit defaults to zero when not specified", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", provider: { "no-limit": { name: "No Limit Provider", @@ -1697,9 +1697,9 @@ test("provider options are deeply merged", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", provider: { anthropic: { options: { @@ -1734,9 +1734,9 @@ test("custom model inherits npm package from models.dev provider config", async await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", provider: { openai: { models: { @@ -1770,9 +1770,9 @@ test("custom model inherits api.url from models.dev provider", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", provider: { openrouter: { models: { @@ -1814,9 +1814,9 @@ test("model variants are generated for reasoning models", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", }), ) }, @@ -1841,9 +1841,9 @@ test("model variants can be disabled via config", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", provider: { anthropic: { models: { @@ -1879,9 +1879,9 @@ test("model variants can be customized via config", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", provider: { anthropic: { models: { @@ -1920,9 +1920,9 @@ test("disabled key is stripped from variant config", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", provider: { anthropic: { models: { @@ -1960,9 +1960,9 @@ test("all variants can be disabled via config", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", provider: { anthropic: { models: { @@ -1997,9 +1997,9 @@ test("variant config merges with generated variants", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", provider: { anthropic: { models: { @@ -2037,9 +2037,9 @@ test("variants filtered in second pass for database models", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", provider: { openai: { models: { @@ -2075,9 +2075,9 @@ test("custom model with variants enabled and disabled", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", provider: { "custom-reasoning": { name: "Custom Reasoning Provider", @@ -2132,9 +2132,9 @@ test("Google Vertex: retains baseURL for custom proxy", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", provider: { "vertex-proxy": { name: "Vertex Proxy", @@ -2176,9 +2176,9 @@ test("Google Vertex: supports OpenAI compatible models", async () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", provider: { "vertex-openai": { name: "Vertex OpenAI", diff --git a/packages/altimate-code/test/session/compaction.test.ts b/packages/altimate-code/test/session/compaction.test.ts index 452926d12e..776fea3524 100644 --- a/packages/altimate-code/test/session/compaction.test.ts +++ b/packages/altimate-code/test/session/compaction.test.ts @@ -209,7 +209,7 @@ describe("session.compaction.isOverflow", () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ compaction: { auto: false }, }), diff --git a/packages/altimate-code/test/session/instruction.test.ts b/packages/altimate-code/test/session/instruction.test.ts index e0bf94a950..dc65d73bf9 100644 --- a/packages/altimate-code/test/session/instruction.test.ts +++ b/packages/altimate-code/test/session/instruction.test.ts @@ -70,22 +70,22 @@ describe("InstructionPrompt.resolve", () => { }) }) -describe("InstructionPrompt.systemPaths OPENCODE_CONFIG_DIR", () => { +describe("InstructionPrompt.systemPaths ALTIMATE_CLI_CONFIG_DIR", () => { let originalConfigDir: string | undefined beforeEach(() => { - originalConfigDir = process.env["OPENCODE_CONFIG_DIR"] + originalConfigDir = process.env["ALTIMATE_CLI_CONFIG_DIR"] }) afterEach(() => { if (originalConfigDir === undefined) { - delete process.env["OPENCODE_CONFIG_DIR"] + delete process.env["ALTIMATE_CLI_CONFIG_DIR"] } else { - process.env["OPENCODE_CONFIG_DIR"] = originalConfigDir + process.env["ALTIMATE_CLI_CONFIG_DIR"] = originalConfigDir } }) - test("prefers OPENCODE_CONFIG_DIR AGENTS.md over global when both exist", async () => { + test("prefers ALTIMATE_CLI_CONFIG_DIR AGENTS.md over global when both exist", async () => { await using profileTmp = await tmpdir({ init: async (dir) => { await Bun.write(path.join(dir, "AGENTS.md"), "# Profile Instructions") @@ -98,7 +98,7 @@ describe("InstructionPrompt.systemPaths OPENCODE_CONFIG_DIR", () => { }) await using projectTmp = await tmpdir() - process.env["OPENCODE_CONFIG_DIR"] = profileTmp.path + process.env["ALTIMATE_CLI_CONFIG_DIR"] = profileTmp.path const originalGlobalConfig = Global.Path.config ;(Global.Path as { config: string }).config = globalTmp.path @@ -116,7 +116,7 @@ describe("InstructionPrompt.systemPaths OPENCODE_CONFIG_DIR", () => { } }) - test("falls back to global AGENTS.md when OPENCODE_CONFIG_DIR has no AGENTS.md", async () => { + test("falls back to global AGENTS.md when ALTIMATE_CLI_CONFIG_DIR has no AGENTS.md", async () => { await using profileTmp = await tmpdir() await using globalTmp = await tmpdir({ init: async (dir) => { @@ -125,7 +125,7 @@ describe("InstructionPrompt.systemPaths OPENCODE_CONFIG_DIR", () => { }) await using projectTmp = await tmpdir() - process.env["OPENCODE_CONFIG_DIR"] = profileTmp.path + process.env["ALTIMATE_CLI_CONFIG_DIR"] = profileTmp.path const originalGlobalConfig = Global.Path.config ;(Global.Path as { config: string }).config = globalTmp.path @@ -143,7 +143,7 @@ describe("InstructionPrompt.systemPaths OPENCODE_CONFIG_DIR", () => { } }) - test("uses global AGENTS.md when OPENCODE_CONFIG_DIR is not set", async () => { + test("uses global AGENTS.md when ALTIMATE_CLI_CONFIG_DIR is not set", async () => { await using globalTmp = await tmpdir({ init: async (dir) => { await Bun.write(path.join(dir, "AGENTS.md"), "# Global Instructions") @@ -151,7 +151,7 @@ describe("InstructionPrompt.systemPaths OPENCODE_CONFIG_DIR", () => { }) await using projectTmp = await tmpdir() - delete process.env["OPENCODE_CONFIG_DIR"] + delete process.env["ALTIMATE_CLI_CONFIG_DIR"] const originalGlobalConfig = Global.Path.config ;(Global.Path as { config: string }).config = globalTmp.path diff --git a/packages/altimate-code/test/session/llm.test.ts b/packages/altimate-code/test/session/llm.test.ts index a89a00ebc0..0c299de0fe 100644 --- a/packages/altimate-code/test/session/llm.test.ts +++ b/packages/altimate-code/test/session/llm.test.ts @@ -244,9 +244,9 @@ describe("session.llm.stream", () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", enabled_providers: [providerID], provider: { [providerID]: { @@ -367,9 +367,9 @@ describe("session.llm.stream", () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", enabled_providers: ["openai"], provider: { openai: { @@ -496,9 +496,9 @@ describe("session.llm.stream", () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", enabled_providers: [providerID], provider: { [providerID]: { @@ -597,9 +597,9 @@ describe("session.llm.stream", () => { await using tmp = await tmpdir({ init: async (dir) => { await Bun.write( - path.join(dir, "opencode.json"), + path.join(dir, "altimate-code.json"), JSON.stringify({ - $schema: "https://opencode.ai/config.json", + $schema: "https://altimate-code.dev/config.json", enabled_providers: [providerID], provider: { [providerID]: { diff --git a/packages/altimate-code/test/session/message-v2.test.ts b/packages/altimate-code/test/session/message-v2.test.ts index c043754bdb..d514fcc553 100644 --- a/packages/altimate-code/test/session/message-v2.test.ts +++ b/packages/altimate-code/test/session/message-v2.test.ts @@ -859,7 +859,7 @@ describe("session.message-v2.fromError", () => { name: "APIError", data: { message: - "Please reauthenticate with the copilot provider to ensure your credentials work properly with OpenCode.", + "Please reauthenticate with the copilot provider to ensure your credentials work properly with Altimate CLI.", statusCode: 403, isRetryable: false, responseHeaders: { "content-type": "application/json" }, diff --git a/packages/altimate-code/test/session/retry.test.ts b/packages/altimate-code/test/session/retry.test.ts index 5b8f8ac9dd..8253e1e08b 100644 --- a/packages/altimate-code/test/session/retry.test.ts +++ b/packages/altimate-code/test/session/retry.test.ts @@ -124,7 +124,7 @@ describe("session.retry.retryable", () => { }) describe("session.message-v2.fromError", () => { - test.concurrent( + test( "converts ECONNRESET socket errors to retryable APIError", async () => { using server = Bun.serve({ diff --git a/packages/altimate-code/test/skill/skill.test.ts b/packages/altimate-code/test/skill/skill.test.ts index 2264723a09..0b51d9bb44 100644 --- a/packages/altimate-code/test/skill/skill.test.ts +++ b/packages/altimate-code/test/skill/skill.test.ts @@ -22,11 +22,11 @@ This skill is loaded from the global home directory. ) } -test("discovers skills from .opencode/skill/ directory", async () => { +test("discovers skills from .altimate-code/skill/ directory", async () => { await using tmp = await tmpdir({ git: true, init: async (dir) => { - const skillDir = path.join(dir, ".opencode", "skill", "test-skill") + const skillDir = path.join(dir, ".altimate-code", "skill", "test-skill") await Bun.write( path.join(skillDir, "SKILL.md"), `--- @@ -59,7 +59,7 @@ test("returns skill directories from Skill.dirs", async () => { await using tmp = await tmpdir({ git: true, init: async (dir) => { - const skillDir = path.join(dir, ".opencode", "skill", "dir-skill") + const skillDir = path.join(dir, ".altimate-code", "skill", "dir-skill") await Bun.write( path.join(skillDir, "SKILL.md"), `--- @@ -73,30 +73,30 @@ description: Skill for dirs test. }, }) - const home = process.env.OPENCODE_TEST_HOME - process.env.OPENCODE_TEST_HOME = tmp.path + const home = process.env.ALTIMATE_CLI_TEST_HOME + process.env.ALTIMATE_CLI_TEST_HOME = tmp.path try { await Instance.provide({ directory: tmp.path, fn: async () => { const dirs = await Skill.dirs() - const skillDir = path.join(tmp.path, ".opencode", "skill", "dir-skill") + const skillDir = path.join(tmp.path, ".altimate-code", "skill", "dir-skill") expect(dirs).toContain(skillDir) expect(dirs.length).toBe(1) }, }) } finally { - process.env.OPENCODE_TEST_HOME = home + process.env.ALTIMATE_CLI_TEST_HOME = home } }) -test("discovers multiple skills from .opencode/skill/ directory", async () => { +test("discovers multiple skills from .altimate-code/skill/ directory", async () => { await using tmp = await tmpdir({ git: true, init: async (dir) => { - const skillDir1 = path.join(dir, ".opencode", "skill", "skill-one") - const skillDir2 = path.join(dir, ".opencode", "skill", "skill-two") + const skillDir1 = path.join(dir, ".altimate-code", "skill", "skill-one") + const skillDir2 = path.join(dir, ".altimate-code", "skill", "skill-two") await Bun.write( path.join(skillDir1, "SKILL.md"), `--- @@ -135,7 +135,7 @@ test("skips skills with missing frontmatter", async () => { await using tmp = await tmpdir({ git: true, init: async (dir) => { - const skillDir = path.join(dir, ".opencode", "skill", "no-frontmatter") + const skillDir = path.join(dir, ".altimate-code", "skill", "no-frontmatter") await Bun.write( path.join(skillDir, "SKILL.md"), `# No Frontmatter @@ -188,8 +188,8 @@ description: A skill in the .claude/skills directory. test("discovers global skills from ~/.claude/skills/ directory", async () => { await using tmp = await tmpdir({ git: true }) - const originalHome = process.env.OPENCODE_TEST_HOME - process.env.OPENCODE_TEST_HOME = tmp.path + const originalHome = process.env.ALTIMATE_CLI_TEST_HOME + process.env.ALTIMATE_CLI_TEST_HOME = tmp.path try { await createGlobalSkill(tmp.path) @@ -204,7 +204,7 @@ test("discovers global skills from ~/.claude/skills/ directory", async () => { }, }) } finally { - process.env.OPENCODE_TEST_HOME = originalHome + process.env.ALTIMATE_CLI_TEST_HOME = originalHome } }) @@ -253,8 +253,8 @@ description: A skill in the .agents/skills directory. test("discovers global skills from ~/.agents/skills/ directory", async () => { await using tmp = await tmpdir({ git: true }) - const originalHome = process.env.OPENCODE_TEST_HOME - process.env.OPENCODE_TEST_HOME = tmp.path + const originalHome = process.env.ALTIMATE_CLI_TEST_HOME + process.env.ALTIMATE_CLI_TEST_HOME = tmp.path try { const skillDir = path.join(tmp.path, ".agents", "skills", "global-agent-skill") @@ -283,7 +283,7 @@ This skill is loaded from the global home directory. }, }) } finally { - process.env.OPENCODE_TEST_HOME = originalHome + process.env.ALTIMATE_CLI_TEST_HOME = originalHome } }) @@ -331,8 +331,8 @@ test("properly resolves directories that skills live in", async () => { await using tmp = await tmpdir({ git: true, init: async (dir) => { - const opencodeSkillDir = path.join(dir, ".opencode", "skill", "agent-skill") - const opencodeSkillsDir = path.join(dir, ".opencode", "skills", "agent-skill") + const opencodeSkillDir = path.join(dir, ".altimate-code", "skill", "agent-skill") + const opencodeSkillsDir = path.join(dir, ".altimate-code", "skills", "agent-skill") const claudeDir = path.join(dir, ".claude", "skills", "claude-skill") const agentDir = path.join(dir, ".agents", "skills", "agent-skill") await Bun.write( @@ -359,7 +359,7 @@ description: A skill in the .agents/skills directory. path.join(opencodeSkillDir, "SKILL.md"), `--- name: opencode-skill -description: A skill in the .opencode/skill directory. +description: A skill in the .altimate-code/skill directory. --- # OpenCode Skill @@ -369,7 +369,7 @@ description: A skill in the .opencode/skill directory. path.join(opencodeSkillsDir, "SKILL.md"), `--- name: opencode-skill -description: A skill in the .opencode/skills directory. +description: A skill in the .altimate-code/skills directory. --- # OpenCode Skill diff --git a/packages/altimate-code/test/tool/fixtures/models-api.json b/packages/altimate-code/test/tool/fixtures/models-api.json index 391e783699..97e067f82e 100644 --- a/packages/altimate-code/test/tool/fixtures/models-api.json +++ b/packages/altimate-code/test/tool/fixtures/models-api.json @@ -20975,7 +20975,7 @@ }, "opencode": { "id": "opencode", - "env": ["OPENCODE_API_KEY"], + "env": ["ALTIMATE_CLI_API_KEY"], "npm": "@ai-sdk/openai-compatible", "api": "https://opencode.ai/zen/v1", "name": "OpenCode Zen", diff --git a/packages/altimate-code/test/tool/read.test.ts b/packages/altimate-code/test/tool/read.test.ts index b22fc3e712..2633b56048 100644 --- a/packages/altimate-code/test/tool/read.test.ts +++ b/packages/altimate-code/test/tool/read.test.ts @@ -13,7 +13,7 @@ const ctx = { sessionID: "test", messageID: "", callID: "", - agent: "build", + agent: "builder", abort: AbortSignal.any([]), messages: [], metadata: () => {}, @@ -163,7 +163,7 @@ describe("tool.read env file permissions", () => { ["environment.ts", false], ] - describe.each(["build", "plan"])("agent=%s", (agentName) => { + describe.each(["builder", "plan"])("agent=%s", (agentName) => { test.each(cases)("%s asks=%s", async (filename, shouldAsk) => { await using tmp = await tmpdir({ init: (dir) => Bun.write(path.join(dir, filename), "content"), diff --git a/packages/altimate-code/test/tool/registry.test.ts b/packages/altimate-code/test/tool/registry.test.ts index d4da412c80..96c9796c8d 100644 --- a/packages/altimate-code/test/tool/registry.test.ts +++ b/packages/altimate-code/test/tool/registry.test.ts @@ -6,10 +6,10 @@ import { Instance } from "../../src/project/instance" import { ToolRegistry } from "../../src/tool/registry" describe("tool.registry", () => { - test("loads tools from .opencode/tool (singular)", async () => { + test("loads tools from .altimate-code/tool (singular)", async () => { await using tmp = await tmpdir({ init: async (dir) => { - const opencodeDir = path.join(dir, ".opencode") + const opencodeDir = path.join(dir, ".altimate-code") await fs.mkdir(opencodeDir, { recursive: true }) const toolDir = path.join(opencodeDir, "tool") @@ -40,10 +40,10 @@ describe("tool.registry", () => { }) }) - test("loads tools from .opencode/tools (plural)", async () => { + test("loads tools from .altimate-code/tools (plural)", async () => { await using tmp = await tmpdir({ init: async (dir) => { - const opencodeDir = path.join(dir, ".opencode") + const opencodeDir = path.join(dir, ".altimate-code") await fs.mkdir(opencodeDir, { recursive: true }) const toolsDir = path.join(opencodeDir, "tools") @@ -77,7 +77,7 @@ describe("tool.registry", () => { test("loads tools with external dependencies without crashing", async () => { await using tmp = await tmpdir({ init: async (dir) => { - const opencodeDir = path.join(dir, ".opencode") + const opencodeDir = path.join(dir, ".altimate-code") await fs.mkdir(opencodeDir, { recursive: true }) const toolsDir = path.join(opencodeDir, "tools") @@ -88,7 +88,6 @@ describe("tool.registry", () => { JSON.stringify({ name: "custom-tools", dependencies: { - "@altimateai/altimate-code-plugin": "^0.0.0", cowsay: "^1.6.0", }, }), @@ -118,5 +117,5 @@ describe("tool.registry", () => { expect(ids).toContain("cowsay") }, }) - }) + }, 30_000) }) diff --git a/packages/altimate-code/test/tool/skill.test.ts b/packages/altimate-code/test/tool/skill.test.ts index d5057ba9e7..fb81fb8eb9 100644 --- a/packages/altimate-code/test/tool/skill.test.ts +++ b/packages/altimate-code/test/tool/skill.test.ts @@ -22,7 +22,7 @@ describe("tool.skill", () => { await using tmp = await tmpdir({ git: true, init: async (dir) => { - const skillDir = path.join(dir, ".opencode", "skill", "tool-skill") + const skillDir = path.join(dir, ".altimate-code", "skill", "tool-skill") await Bun.write( path.join(skillDir, "SKILL.md"), `--- @@ -36,20 +36,20 @@ description: Skill for tool tests. }, }) - const home = process.env.OPENCODE_TEST_HOME - process.env.OPENCODE_TEST_HOME = tmp.path + const home = process.env.ALTIMATE_CLI_TEST_HOME + process.env.ALTIMATE_CLI_TEST_HOME = tmp.path try { await Instance.provide({ directory: tmp.path, fn: async () => { const tool = await SkillTool.init() - const skillPath = path.join(tmp.path, ".opencode", "skill", "tool-skill", "SKILL.md") + const skillPath = path.join(tmp.path, ".altimate-code", "skill", "tool-skill", "SKILL.md") expect(tool.description).toContain(`${pathToFileURL(skillPath).href}`) }, }) } finally { - process.env.OPENCODE_TEST_HOME = home + process.env.ALTIMATE_CLI_TEST_HOME = home } }) @@ -57,7 +57,7 @@ description: Skill for tool tests. await using tmp = await tmpdir({ git: true, init: async (dir) => { - const skillDir = path.join(dir, ".opencode", "skill", "tool-skill") + const skillDir = path.join(dir, ".altimate-code", "skill", "tool-skill") await Bun.write( path.join(skillDir, "SKILL.md"), `--- @@ -74,8 +74,8 @@ Use this skill. }, }) - const home = process.env.OPENCODE_TEST_HOME - process.env.OPENCODE_TEST_HOME = tmp.path + const home = process.env.ALTIMATE_CLI_TEST_HOME + process.env.ALTIMATE_CLI_TEST_HOME = tmp.path try { await Instance.provide({ @@ -91,7 +91,7 @@ Use this skill. } const result = await tool.execute({ name: "tool-skill" }, ctx) - const dir = path.join(tmp.path, ".opencode", "skill", "tool-skill") + const dir = path.join(tmp.path, ".altimate-code", "skill", "tool-skill") const file = path.resolve(dir, "scripts", "demo.txt") expect(requests.length).toBe(1) @@ -106,7 +106,7 @@ Use this skill. }, }) } finally { - process.env.OPENCODE_TEST_HOME = home + process.env.ALTIMATE_CLI_TEST_HOME = home } }) }) diff --git a/packages/altimate-engine/pyproject.toml b/packages/altimate-engine/pyproject.toml index 757a03fec5..1290f04f88 100644 --- a/packages/altimate-engine/pyproject.toml +++ b/packages/altimate-engine/pyproject.toml @@ -30,5 +30,8 @@ docker = ["docker>=7.0"] tunneling = ["sshtunnel>=0.4", "paramiko>=3.0"] dev = ["pytest>=7.0", "ruff>=0.1"] +[tool.pytest.ini_options] +testpaths = ["tests"] + [tool.hatch.build.targets.wheel] packages = ["src/altimate_engine"] diff --git a/packages/altimate-engine/src/altimate_engine/credential_store.py b/packages/altimate-engine/src/altimate_engine/credential_store.py index 9366ab2dcb..86bcc36020 100644 --- a/packages/altimate-engine/src/altimate_engine/credential_store.py +++ b/packages/altimate-engine/src/altimate_engine/credential_store.py @@ -20,7 +20,7 @@ def _keyring_available() -> bool: if _keyring_cache is not None: return _keyring_cache try: - import keyring + import keyring # noqa: F401 _keyring_cache = True except ImportError: _keyring_cache = False diff --git a/packages/altimate-engine/src/altimate_engine/models.py b/packages/altimate-engine/src/altimate_engine/models.py index 7773cb0cce..bfc26491a5 100644 --- a/packages/altimate-engine/src/altimate_engine/models.py +++ b/packages/altimate-engine/src/altimate_engine/models.py @@ -870,7 +870,7 @@ class SqlGuardCheckParams(BaseModel): class SqlGuardResult(BaseModel): success: bool = True - data: dict[str, Any] = Field(default_factory=dict) + data: dict[str, Any] | None = Field(default_factory=dict) error: str | None = None diff --git a/packages/altimate-engine/src/altimate_engine/schema/cache.py b/packages/altimate-engine/src/altimate_engine/schema/cache.py index 811c9d1c72..07c81046e2 100644 --- a/packages/altimate-engine/src/altimate_engine/schema/cache.py +++ b/packages/altimate-engine/src/altimate_engine/schema/cache.py @@ -7,7 +7,6 @@ from __future__ import annotations -import json import re import sqlite3 from datetime import datetime, timezone diff --git a/packages/altimate-engine/src/altimate_engine/server.py b/packages/altimate-engine/src/altimate_engine/server.py index de0684fce7..01ec07c358 100644 --- a/packages/altimate-engine/src/altimate_engine/server.py +++ b/packages/altimate-engine/src/altimate_engine/server.py @@ -15,16 +15,12 @@ import traceback from altimate_engine.models import ( - ColumnChange, WarehouseAddParams, WarehouseAddResult, WarehouseRemoveParams, WarehouseRemoveResult, DockerContainer, WarehouseDiscoverResult, - CostGateFileResult, - CostGateParams, - CostGateResult, DbtLineageParams, DbtManifestParams, DbtRunParams, @@ -39,11 +35,8 @@ LocalSchemaSyncResult, LocalTestParams, LocalTestResult, - SchemaCacheStatusParams, SchemaCacheStatusResult, SchemaCacheWarehouseStatus, - SchemaDiffParams, - SchemaDiffResult, SchemaIndexParams, SchemaIndexResult, SchemaInspectParams, @@ -59,7 +52,6 @@ SqlAutocompleteSuggestion, SqlExecuteParams, SqlExplainParams, - SqlExplainResult, SqlFixParams, SqlFixResult, SqlFixSuggestion, @@ -118,7 +110,6 @@ from altimate_engine.sql.explainer import explain_sql from altimate_engine.sql.autocomplete import autocomplete_sql from altimate_engine.sql.diff import diff_sql -from altimate_engine.ci.cost_gate import scan_files from altimate_engine.schema.inspector import inspect_schema from altimate_engine.schema.pii_detector import detect_pii from altimate_engine.schema.tags import get_tags, list_tags @@ -187,14 +178,6 @@ from altimate_engine.local.schema_sync import sync_schema from altimate_engine.local.test_local import test_sql_local from altimate_engine.models import ( - SqlGuardValidateParams, - SqlGuardLintParams, - SqlGuardSafetyParams, - SqlGuardTranspileParams, - SqlGuardExplainParams, - SqlGuardCheckParams, - SqlGuardResult, - # Phase 1 (P0) SqlGuardFixParams, SqlGuardPolicyParams, SqlGuardComplexityParams, diff --git a/packages/altimate-engine/src/altimate_engine/sql/feedback_store.py b/packages/altimate-engine/src/altimate_engine/sql/feedback_store.py index 4bed2e46c8..72fa9a8fe6 100644 --- a/packages/altimate-engine/src/altimate_engine/sql/feedback_store.py +++ b/packages/altimate-engine/src/altimate_engine/sql/feedback_store.py @@ -3,7 +3,6 @@ from __future__ import annotations import hashlib -import os import re import sqlite3 import statistics