mirror of
https://github.com/sst/opencode.git
synced 2025-08-04 13:30:52 +00:00
chore: rename
This commit is contained in:
parent
1e9399fbee
commit
2391e338b4
81 changed files with 294 additions and 292 deletions
|
@ -35,7 +35,7 @@ curl -fsSL https://opencode.ai/install | VERSION=0.1.0 bash
|
||||||
### Using Homebrew (macOS and Linux)
|
### Using Homebrew (macOS and Linux)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
brew install opencode-ai/tap/opencode
|
brew install sst/tap/opencode
|
||||||
```
|
```
|
||||||
|
|
||||||
### Using AUR (Arch Linux)
|
### Using AUR (Arch Linux)
|
||||||
|
@ -51,7 +51,7 @@ paru -S opencode-bin
|
||||||
### Using Go
|
### Using Go
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
go install github.com/opencode-ai/opencode@latest
|
go install github.com/sst/opencode@latest
|
||||||
```
|
```
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
@ -396,9 +396,11 @@ OpenCode supports custom commands that can be created by users to quickly send p
|
||||||
Custom commands are predefined prompts stored as Markdown files in one of three locations:
|
Custom commands are predefined prompts stored as Markdown files in one of three locations:
|
||||||
|
|
||||||
1. **User Commands** (prefixed with `user:`):
|
1. **User Commands** (prefixed with `user:`):
|
||||||
|
|
||||||
```
|
```
|
||||||
$XDG_CONFIG_HOME/opencode/commands/
|
$XDG_CONFIG_HOME/opencode/commands/
|
||||||
```
|
```
|
||||||
|
|
||||||
(typically `~/.config/opencode/commands/` on Linux/macOS)
|
(typically `~/.config/opencode/commands/` on Linux/macOS)
|
||||||
|
|
||||||
or
|
or
|
||||||
|
@ -541,7 +543,7 @@ While the LSP client implementation supports the full LSP protocol (including co
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Clone the repository
|
# Clone the repository
|
||||||
git clone https://github.com/opencode-ai/opencode.git
|
git clone https://github.com/sst/opencode.git
|
||||||
cd opencode
|
cd opencode
|
||||||
|
|
||||||
# Build
|
# Build
|
||||||
|
|
18
cmd/root.go
18
cmd/root.go
|
@ -11,16 +11,16 @@ import (
|
||||||
|
|
||||||
tea "github.com/charmbracelet/bubbletea"
|
tea "github.com/charmbracelet/bubbletea"
|
||||||
zone "github.com/lrstanley/bubblezone"
|
zone "github.com/lrstanley/bubblezone"
|
||||||
"github.com/opencode-ai/opencode/internal/app"
|
|
||||||
"github.com/opencode-ai/opencode/internal/config"
|
|
||||||
"github.com/opencode-ai/opencode/internal/db"
|
|
||||||
"github.com/opencode-ai/opencode/internal/llm/agent"
|
|
||||||
"github.com/opencode-ai/opencode/internal/logging"
|
|
||||||
"github.com/opencode-ai/opencode/internal/lsp/discovery"
|
|
||||||
"github.com/opencode-ai/opencode/internal/pubsub"
|
|
||||||
"github.com/opencode-ai/opencode/internal/tui"
|
|
||||||
"github.com/opencode-ai/opencode/internal/version"
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
"github.com/sst/opencode/internal/app"
|
||||||
|
"github.com/sst/opencode/internal/config"
|
||||||
|
"github.com/sst/opencode/internal/db"
|
||||||
|
"github.com/sst/opencode/internal/llm/agent"
|
||||||
|
"github.com/sst/opencode/internal/logging"
|
||||||
|
"github.com/sst/opencode/internal/lsp/discovery"
|
||||||
|
"github.com/sst/opencode/internal/pubsub"
|
||||||
|
"github.com/sst/opencode/internal/tui"
|
||||||
|
"github.com/sst/opencode/internal/version"
|
||||||
)
|
)
|
||||||
|
|
||||||
var rootCmd = &cobra.Command{
|
var rootCmd = &cobra.Command{
|
||||||
|
|
|
@ -5,8 +5,8 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/opencode-ai/opencode/internal/config"
|
"github.com/sst/opencode/internal/config"
|
||||||
"github.com/opencode-ai/opencode/internal/llm/models"
|
"github.com/sst/opencode/internal/llm/models"
|
||||||
)
|
)
|
||||||
|
|
||||||
// JSONSchemaType represents a JSON Schema type
|
// JSONSchemaType represents a JSON Schema type
|
||||||
|
|
2
go.mod
2
go.mod
|
@ -1,4 +1,4 @@
|
||||||
module github.com/opencode-ai/opencode
|
module github.com/sst/opencode
|
||||||
|
|
||||||
go 1.24.0
|
go 1.24.0
|
||||||
|
|
||||||
|
|
6
install
6
install
|
@ -40,15 +40,15 @@ INSTALL_DIR=$HOME/.opencode/bin
|
||||||
mkdir -p "$INSTALL_DIR"
|
mkdir -p "$INSTALL_DIR"
|
||||||
|
|
||||||
if [ -z "$requested_version" ]; then
|
if [ -z "$requested_version" ]; then
|
||||||
url="https://github.com/opencode-ai/opencode/releases/latest/download/$filename"
|
url="https://github.com/sst/opencode/releases/latest/download/$filename"
|
||||||
specific_version=$(curl -s https://api.github.com/repos/opencode-ai/opencode/releases/latest | awk -F'"' '/"tag_name": "/ {gsub(/^v/, "", $4); print $4}')
|
specific_version=$(curl -s https://api.github.com/repos/sst/opencode/releases/latest | awk -F'"' '/"tag_name": "/ {gsub(/^v/, "", $4); print $4}')
|
||||||
|
|
||||||
if [[ $? -ne 0 ]]; then
|
if [[ $? -ne 0 ]]; then
|
||||||
echo "${RED}Failed to fetch version information${NC}"
|
echo "${RED}Failed to fetch version information${NC}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
url="https://github.com/opencode-ai/opencode/releases/download/v${requested_version}/$filename"
|
url="https://github.com/sst/opencode/releases/download/v${requested_version}/$filename"
|
||||||
specific_version=$requested_version
|
specific_version=$requested_version
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -9,16 +9,16 @@ import (
|
||||||
|
|
||||||
"log/slog"
|
"log/slog"
|
||||||
|
|
||||||
"github.com/opencode-ai/opencode/internal/config"
|
"github.com/sst/opencode/internal/config"
|
||||||
"github.com/opencode-ai/opencode/internal/history"
|
"github.com/sst/opencode/internal/history"
|
||||||
"github.com/opencode-ai/opencode/internal/llm/agent"
|
"github.com/sst/opencode/internal/llm/agent"
|
||||||
"github.com/opencode-ai/opencode/internal/logging"
|
"github.com/sst/opencode/internal/logging"
|
||||||
"github.com/opencode-ai/opencode/internal/lsp"
|
"github.com/sst/opencode/internal/lsp"
|
||||||
"github.com/opencode-ai/opencode/internal/message"
|
"github.com/sst/opencode/internal/message"
|
||||||
"github.com/opencode-ai/opencode/internal/permission"
|
"github.com/sst/opencode/internal/permission"
|
||||||
"github.com/opencode-ai/opencode/internal/session"
|
"github.com/sst/opencode/internal/session"
|
||||||
"github.com/opencode-ai/opencode/internal/status"
|
"github.com/sst/opencode/internal/status"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/theme"
|
"github.com/sst/opencode/internal/tui/theme"
|
||||||
)
|
)
|
||||||
|
|
||||||
type App struct {
|
type App struct {
|
||||||
|
|
|
@ -6,10 +6,10 @@ import (
|
||||||
|
|
||||||
"log/slog"
|
"log/slog"
|
||||||
|
|
||||||
"github.com/opencode-ai/opencode/internal/config"
|
"github.com/sst/opencode/internal/config"
|
||||||
"github.com/opencode-ai/opencode/internal/logging"
|
"github.com/sst/opencode/internal/logging"
|
||||||
"github.com/opencode-ai/opencode/internal/lsp"
|
"github.com/sst/opencode/internal/lsp"
|
||||||
"github.com/opencode-ai/opencode/internal/lsp/watcher"
|
"github.com/sst/opencode/internal/lsp/watcher"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (app *App) initLSPClients(ctx context.Context) {
|
func (app *App) initLSPClients(ctx context.Context) {
|
||||||
|
|
|
@ -10,8 +10,8 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/opencode-ai/opencode/internal/llm/models"
|
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
|
"github.com/sst/opencode/internal/llm/models"
|
||||||
)
|
)
|
||||||
|
|
||||||
// MCPType defines the type of MCP (Model Control Protocol) server.
|
// MCPType defines the type of MCP (Model Control Protocol) server.
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
_ "github.com/ncruces/go-sqlite3/driver"
|
_ "github.com/ncruces/go-sqlite3/driver"
|
||||||
_ "github.com/ncruces/go-sqlite3/embed"
|
_ "github.com/ncruces/go-sqlite3/embed"
|
||||||
|
|
||||||
"github.com/opencode-ai/opencode/internal/config"
|
"github.com/sst/opencode/internal/config"
|
||||||
"log/slog"
|
"log/slog"
|
||||||
|
|
||||||
"github.com/pressly/goose/v3"
|
"github.com/pressly/goose/v3"
|
||||||
|
|
|
@ -15,9 +15,9 @@ import (
|
||||||
"github.com/aymanbagabas/go-udiff"
|
"github.com/aymanbagabas/go-udiff"
|
||||||
"github.com/charmbracelet/lipgloss"
|
"github.com/charmbracelet/lipgloss"
|
||||||
"github.com/charmbracelet/x/ansi"
|
"github.com/charmbracelet/x/ansi"
|
||||||
"github.com/opencode-ai/opencode/internal/config"
|
|
||||||
"github.com/opencode-ai/opencode/internal/tui/theme"
|
|
||||||
"github.com/sergi/go-diff/diffmatchpatch"
|
"github.com/sergi/go-diff/diffmatchpatch"
|
||||||
|
"github.com/sst/opencode/internal/config"
|
||||||
|
"github.com/sst/opencode/internal/tui/theme"
|
||||||
)
|
)
|
||||||
|
|
||||||
// -------------------------------------------------------------------------
|
// -------------------------------------------------------------------------
|
||||||
|
@ -648,7 +648,7 @@ func applyHighlighting(content string, segments []Segment, segmentType LineType,
|
||||||
r, g, b, _ = bgColor.RGBA()
|
r, g, b, _ = bgColor.RGBA()
|
||||||
sb.WriteString(fmt.Sprintf("%d;%d;%dm", r>>8, g>>8, b>>8))
|
sb.WriteString(fmt.Sprintf("%d;%d;%dm", r>>8, g>>8, b>>8))
|
||||||
sb.WriteString(char)
|
sb.WriteString(char)
|
||||||
|
|
||||||
// Full reset of all attributes to ensure clean state
|
// Full reset of all attributes to ensure clean state
|
||||||
sb.WriteString("\x1b[0m")
|
sb.WriteString("\x1b[0m")
|
||||||
|
|
||||||
|
|
|
@ -11,8 +11,8 @@ import (
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/opencode-ai/opencode/internal/db"
|
"github.com/sst/opencode/internal/db"
|
||||||
"github.com/opencode-ai/opencode/internal/pubsub"
|
"github.com/sst/opencode/internal/pubsub"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -5,11 +5,11 @@ import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/opencode-ai/opencode/internal/config"
|
"github.com/sst/opencode/internal/config"
|
||||||
"github.com/opencode-ai/opencode/internal/llm/tools"
|
"github.com/sst/opencode/internal/llm/tools"
|
||||||
"github.com/opencode-ai/opencode/internal/lsp"
|
"github.com/sst/opencode/internal/lsp"
|
||||||
"github.com/opencode-ai/opencode/internal/message"
|
"github.com/sst/opencode/internal/message"
|
||||||
"github.com/opencode-ai/opencode/internal/session"
|
"github.com/sst/opencode/internal/session"
|
||||||
)
|
)
|
||||||
|
|
||||||
type agentTool struct {
|
type agentTool struct {
|
||||||
|
|
|
@ -10,16 +10,16 @@ import (
|
||||||
|
|
||||||
"log/slog"
|
"log/slog"
|
||||||
|
|
||||||
"github.com/opencode-ai/opencode/internal/config"
|
"github.com/sst/opencode/internal/config"
|
||||||
"github.com/opencode-ai/opencode/internal/llm/models"
|
"github.com/sst/opencode/internal/llm/models"
|
||||||
"github.com/opencode-ai/opencode/internal/llm/prompt"
|
"github.com/sst/opencode/internal/llm/prompt"
|
||||||
"github.com/opencode-ai/opencode/internal/llm/provider"
|
"github.com/sst/opencode/internal/llm/provider"
|
||||||
"github.com/opencode-ai/opencode/internal/llm/tools"
|
"github.com/sst/opencode/internal/llm/tools"
|
||||||
"github.com/opencode-ai/opencode/internal/logging"
|
"github.com/sst/opencode/internal/logging"
|
||||||
"github.com/opencode-ai/opencode/internal/message"
|
"github.com/sst/opencode/internal/message"
|
||||||
"github.com/opencode-ai/opencode/internal/permission"
|
"github.com/sst/opencode/internal/permission"
|
||||||
"github.com/opencode-ai/opencode/internal/session"
|
"github.com/sst/opencode/internal/session"
|
||||||
"github.com/opencode-ai/opencode/internal/status"
|
"github.com/sst/opencode/internal/status"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Common errors
|
// Common errors
|
||||||
|
|
|
@ -5,10 +5,10 @@ import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/opencode-ai/opencode/internal/config"
|
"github.com/sst/opencode/internal/config"
|
||||||
"github.com/opencode-ai/opencode/internal/llm/tools"
|
"github.com/sst/opencode/internal/llm/tools"
|
||||||
"github.com/opencode-ai/opencode/internal/permission"
|
"github.com/sst/opencode/internal/permission"
|
||||||
"github.com/opencode-ai/opencode/internal/version"
|
"github.com/sst/opencode/internal/version"
|
||||||
"log/slog"
|
"log/slog"
|
||||||
|
|
||||||
"github.com/mark3labs/mcp-go/client"
|
"github.com/mark3labs/mcp-go/client"
|
||||||
|
|
|
@ -3,12 +3,12 @@ package agent
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/opencode-ai/opencode/internal/history"
|
"github.com/sst/opencode/internal/history"
|
||||||
"github.com/opencode-ai/opencode/internal/llm/tools"
|
"github.com/sst/opencode/internal/llm/tools"
|
||||||
"github.com/opencode-ai/opencode/internal/lsp"
|
"github.com/sst/opencode/internal/lsp"
|
||||||
"github.com/opencode-ai/opencode/internal/message"
|
"github.com/sst/opencode/internal/message"
|
||||||
"github.com/opencode-ai/opencode/internal/permission"
|
"github.com/sst/opencode/internal/permission"
|
||||||
"github.com/opencode-ai/opencode/internal/session"
|
"github.com/sst/opencode/internal/session"
|
||||||
)
|
)
|
||||||
|
|
||||||
func PrimaryAgentTools(
|
func PrimaryAgentTools(
|
||||||
|
|
|
@ -8,9 +8,9 @@ import (
|
||||||
"runtime"
|
"runtime"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/opencode-ai/opencode/internal/config"
|
"github.com/sst/opencode/internal/config"
|
||||||
"github.com/opencode-ai/opencode/internal/llm/models"
|
"github.com/sst/opencode/internal/llm/models"
|
||||||
"github.com/opencode-ai/opencode/internal/llm/tools"
|
"github.com/sst/opencode/internal/llm/tools"
|
||||||
)
|
)
|
||||||
|
|
||||||
func PrimaryPrompt(provider models.ModelProvider) string {
|
func PrimaryPrompt(provider models.ModelProvider) string {
|
||||||
|
|
|
@ -7,8 +7,8 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/opencode-ai/opencode/internal/config"
|
"github.com/sst/opencode/internal/config"
|
||||||
"github.com/opencode-ai/opencode/internal/llm/models"
|
"github.com/sst/opencode/internal/llm/models"
|
||||||
"log/slog"
|
"log/slog"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/opencode-ai/opencode/internal/config"
|
"github.com/sst/opencode/internal/config"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
|
@ -3,7 +3,7 @@ package prompt
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/opencode-ai/opencode/internal/llm/models"
|
"github.com/sst/opencode/internal/llm/models"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TaskPrompt(_ models.ModelProvider) string {
|
func TaskPrompt(_ models.ModelProvider) string {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package prompt
|
package prompt
|
||||||
|
|
||||||
import "github.com/opencode-ai/opencode/internal/llm/models"
|
import "github.com/sst/opencode/internal/llm/models"
|
||||||
|
|
||||||
func TitlePrompt(_ models.ModelProvider) string {
|
func TitlePrompt(_ models.ModelProvider) string {
|
||||||
return `you will generate a short title based on the first message a user begins a conversation with
|
return `you will generate a short title based on the first message a user begins a conversation with
|
||||||
|
|
|
@ -12,11 +12,11 @@ import (
|
||||||
"github.com/anthropics/anthropic-sdk-go"
|
"github.com/anthropics/anthropic-sdk-go"
|
||||||
"github.com/anthropics/anthropic-sdk-go/bedrock"
|
"github.com/anthropics/anthropic-sdk-go/bedrock"
|
||||||
"github.com/anthropics/anthropic-sdk-go/option"
|
"github.com/anthropics/anthropic-sdk-go/option"
|
||||||
"github.com/opencode-ai/opencode/internal/config"
|
"github.com/sst/opencode/internal/config"
|
||||||
"github.com/opencode-ai/opencode/internal/llm/models"
|
"github.com/sst/opencode/internal/llm/models"
|
||||||
"github.com/opencode-ai/opencode/internal/llm/tools"
|
"github.com/sst/opencode/internal/llm/tools"
|
||||||
"github.com/opencode-ai/opencode/internal/message"
|
"github.com/sst/opencode/internal/message"
|
||||||
"github.com/opencode-ai/opencode/internal/status"
|
"github.com/sst/opencode/internal/status"
|
||||||
"log/slog"
|
"log/slog"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -7,8 +7,8 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/opencode-ai/opencode/internal/llm/tools"
|
"github.com/sst/opencode/internal/llm/tools"
|
||||||
"github.com/opencode-ai/opencode/internal/message"
|
"github.com/sst/opencode/internal/message"
|
||||||
)
|
)
|
||||||
|
|
||||||
type bedrockOptions struct {
|
type bedrockOptions struct {
|
||||||
|
|
|
@ -10,10 +10,10 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/opencode-ai/opencode/internal/config"
|
"github.com/sst/opencode/internal/config"
|
||||||
"github.com/opencode-ai/opencode/internal/llm/tools"
|
"github.com/sst/opencode/internal/llm/tools"
|
||||||
"github.com/opencode-ai/opencode/internal/message"
|
"github.com/sst/opencode/internal/message"
|
||||||
"github.com/opencode-ai/opencode/internal/status"
|
"github.com/sst/opencode/internal/status"
|
||||||
"google.golang.org/genai"
|
"google.golang.org/genai"
|
||||||
"log/slog"
|
"log/slog"
|
||||||
)
|
)
|
||||||
|
|
|
@ -11,11 +11,11 @@ import (
|
||||||
"github.com/openai/openai-go"
|
"github.com/openai/openai-go"
|
||||||
"github.com/openai/openai-go/option"
|
"github.com/openai/openai-go/option"
|
||||||
"github.com/openai/openai-go/shared"
|
"github.com/openai/openai-go/shared"
|
||||||
"github.com/opencode-ai/opencode/internal/config"
|
"github.com/sst/opencode/internal/config"
|
||||||
"github.com/opencode-ai/opencode/internal/llm/models"
|
"github.com/sst/opencode/internal/llm/models"
|
||||||
"github.com/opencode-ai/opencode/internal/llm/tools"
|
"github.com/sst/opencode/internal/llm/tools"
|
||||||
"github.com/opencode-ai/opencode/internal/message"
|
"github.com/sst/opencode/internal/message"
|
||||||
"github.com/opencode-ai/opencode/internal/status"
|
"github.com/sst/opencode/internal/status"
|
||||||
"log/slog"
|
"log/slog"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -4,9 +4,9 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/opencode-ai/opencode/internal/llm/models"
|
"github.com/sst/opencode/internal/llm/models"
|
||||||
"github.com/opencode-ai/opencode/internal/llm/tools"
|
"github.com/sst/opencode/internal/llm/tools"
|
||||||
"github.com/opencode-ai/opencode/internal/message"
|
"github.com/sst/opencode/internal/message"
|
||||||
"log/slog"
|
"log/slog"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -7,9 +7,9 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/opencode-ai/opencode/internal/config"
|
"github.com/sst/opencode/internal/config"
|
||||||
"github.com/opencode-ai/opencode/internal/llm/tools/shell"
|
"github.com/sst/opencode/internal/llm/tools/shell"
|
||||||
"github.com/opencode-ai/opencode/internal/permission"
|
"github.com/sst/opencode/internal/permission"
|
||||||
)
|
)
|
||||||
|
|
||||||
type BashParams struct {
|
type BashParams struct {
|
||||||
|
|
|
@ -9,8 +9,8 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/opencode-ai/opencode/internal/lsp"
|
"github.com/sst/opencode/internal/lsp"
|
||||||
"github.com/opencode-ai/opencode/internal/lsp/protocol"
|
"github.com/sst/opencode/internal/lsp/protocol"
|
||||||
)
|
)
|
||||||
|
|
||||||
type DiagnosticsParams struct {
|
type DiagnosticsParams struct {
|
||||||
|
|
|
@ -9,11 +9,11 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/opencode-ai/opencode/internal/config"
|
"github.com/sst/opencode/internal/config"
|
||||||
"github.com/opencode-ai/opencode/internal/diff"
|
"github.com/sst/opencode/internal/diff"
|
||||||
"github.com/opencode-ai/opencode/internal/history"
|
"github.com/sst/opencode/internal/history"
|
||||||
"github.com/opencode-ai/opencode/internal/lsp"
|
"github.com/sst/opencode/internal/lsp"
|
||||||
"github.com/opencode-ai/opencode/internal/permission"
|
"github.com/sst/opencode/internal/permission"
|
||||||
"log/slog"
|
"log/slog"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -11,8 +11,8 @@ import (
|
||||||
|
|
||||||
md "github.com/JohannesKaufmann/html-to-markdown"
|
md "github.com/JohannesKaufmann/html-to-markdown"
|
||||||
"github.com/PuerkitoBio/goquery"
|
"github.com/PuerkitoBio/goquery"
|
||||||
"github.com/opencode-ai/opencode/internal/config"
|
"github.com/sst/opencode/internal/config"
|
||||||
"github.com/opencode-ai/opencode/internal/permission"
|
"github.com/sst/opencode/internal/permission"
|
||||||
)
|
)
|
||||||
|
|
||||||
type FetchParams struct {
|
type FetchParams struct {
|
||||||
|
|
|
@ -14,7 +14,7 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/bmatcuk/doublestar/v4"
|
"github.com/bmatcuk/doublestar/v4"
|
||||||
"github.com/opencode-ai/opencode/internal/config"
|
"github.com/sst/opencode/internal/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -14,7 +14,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/opencode-ai/opencode/internal/config"
|
"github.com/sst/opencode/internal/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
type GrepParams struct {
|
type GrepParams struct {
|
||||||
|
|
|
@ -8,7 +8,7 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/opencode-ai/opencode/internal/config"
|
"github.com/sst/opencode/internal/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
type LSParams struct {
|
type LSParams struct {
|
||||||
|
|
|
@ -8,11 +8,11 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/opencode-ai/opencode/internal/config"
|
"github.com/sst/opencode/internal/config"
|
||||||
"github.com/opencode-ai/opencode/internal/diff"
|
"github.com/sst/opencode/internal/diff"
|
||||||
"github.com/opencode-ai/opencode/internal/history"
|
"github.com/sst/opencode/internal/history"
|
||||||
"github.com/opencode-ai/opencode/internal/lsp"
|
"github.com/sst/opencode/internal/lsp"
|
||||||
"github.com/opencode-ai/opencode/internal/permission"
|
"github.com/sst/opencode/internal/permission"
|
||||||
"log/slog"
|
"log/slog"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ import (
|
||||||
"syscall"
|
"syscall"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/opencode-ai/opencode/internal/status"
|
"github.com/sst/opencode/internal/status"
|
||||||
)
|
)
|
||||||
|
|
||||||
type PersistentShell struct {
|
type PersistentShell struct {
|
||||||
|
|
|
@ -10,8 +10,8 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/opencode-ai/opencode/internal/config"
|
"github.com/sst/opencode/internal/config"
|
||||||
"github.com/opencode-ai/opencode/internal/lsp"
|
"github.com/sst/opencode/internal/lsp"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ViewParams struct {
|
type ViewParams struct {
|
||||||
|
|
|
@ -9,11 +9,11 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/opencode-ai/opencode/internal/config"
|
"github.com/sst/opencode/internal/config"
|
||||||
"github.com/opencode-ai/opencode/internal/diff"
|
"github.com/sst/opencode/internal/diff"
|
||||||
"github.com/opencode-ai/opencode/internal/history"
|
"github.com/sst/opencode/internal/history"
|
||||||
"github.com/opencode-ai/opencode/internal/lsp"
|
"github.com/sst/opencode/internal/lsp"
|
||||||
"github.com/opencode-ai/opencode/internal/permission"
|
"github.com/sst/opencode/internal/permission"
|
||||||
"log/slog"
|
"log/slog"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -15,8 +15,8 @@ import (
|
||||||
|
|
||||||
"github.com/go-logfmt/logfmt"
|
"github.com/go-logfmt/logfmt"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/opencode-ai/opencode/internal/db"
|
"github.com/sst/opencode/internal/db"
|
||||||
"github.com/opencode-ai/opencode/internal/pubsub"
|
"github.com/sst/opencode/internal/pubsub"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Log struct {
|
type Log struct {
|
||||||
|
|
|
@ -16,10 +16,10 @@ import (
|
||||||
|
|
||||||
"log/slog"
|
"log/slog"
|
||||||
|
|
||||||
"github.com/opencode-ai/opencode/internal/config"
|
"github.com/sst/opencode/internal/config"
|
||||||
"github.com/opencode-ai/opencode/internal/logging"
|
"github.com/sst/opencode/internal/logging"
|
||||||
"github.com/opencode-ai/opencode/internal/lsp/protocol"
|
"github.com/sst/opencode/internal/lsp/protocol"
|
||||||
"github.com/opencode-ai/opencode/internal/status"
|
"github.com/sst/opencode/internal/status"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Client struct {
|
type Client struct {
|
||||||
|
|
|
@ -3,7 +3,7 @@ package discovery
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/opencode-ai/opencode/internal/config"
|
"github.com/sst/opencode/internal/config"
|
||||||
"log/slog"
|
"log/slog"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/opencode-ai/opencode/internal/lsp"
|
"github.com/sst/opencode/internal/lsp"
|
||||||
"log/slog"
|
"log/slog"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,9 @@ package lsp
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
|
||||||
"github.com/opencode-ai/opencode/internal/config"
|
"github.com/sst/opencode/internal/config"
|
||||||
"github.com/opencode-ai/opencode/internal/lsp/protocol"
|
"github.com/sst/opencode/internal/lsp/protocol"
|
||||||
"github.com/opencode-ai/opencode/internal/lsp/util"
|
"github.com/sst/opencode/internal/lsp/util"
|
||||||
"log/slog"
|
"log/slog"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/opencode-ai/opencode/internal/lsp/protocol"
|
"github.com/sst/opencode/internal/lsp/protocol"
|
||||||
)
|
)
|
||||||
|
|
||||||
func DetectLanguageID(uri string) protocol.LanguageKind {
|
func DetectLanguageID(uri string) protocol.LanguageKind {
|
||||||
|
|
|
@ -4,7 +4,7 @@ package lsp
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/opencode-ai/opencode/internal/lsp/protocol"
|
"github.com/sst/opencode/internal/lsp/protocol"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Implementation sends a textDocument/implementation request to the LSP server.
|
// Implementation sends a textDocument/implementation request to the LSP server.
|
||||||
|
|
|
@ -8,7 +8,7 @@ import (
|
||||||
"io"
|
"io"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/opencode-ai/opencode/internal/config"
|
"github.com/sst/opencode/internal/config"
|
||||||
"log/slog"
|
"log/slog"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ import (
|
||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/opencode-ai/opencode/internal/lsp/protocol"
|
"github.com/sst/opencode/internal/lsp/protocol"
|
||||||
)
|
)
|
||||||
|
|
||||||
func applyTextEdits(uri protocol.DocumentUri, edits []protocol.TextEdit) error {
|
func applyTextEdits(uri protocol.DocumentUri, edits []protocol.TextEdit) error {
|
||||||
|
|
|
@ -12,9 +12,9 @@ import (
|
||||||
|
|
||||||
"github.com/bmatcuk/doublestar/v4"
|
"github.com/bmatcuk/doublestar/v4"
|
||||||
"github.com/fsnotify/fsnotify"
|
"github.com/fsnotify/fsnotify"
|
||||||
"github.com/opencode-ai/opencode/internal/config"
|
"github.com/sst/opencode/internal/config"
|
||||||
"github.com/opencode-ai/opencode/internal/lsp"
|
"github.com/sst/opencode/internal/lsp"
|
||||||
"github.com/opencode-ai/opencode/internal/lsp/protocol"
|
"github.com/sst/opencode/internal/lsp/protocol"
|
||||||
"log/slog"
|
"log/slog"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"slices"
|
"slices"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/opencode-ai/opencode/internal/llm/models"
|
"github.com/sst/opencode/internal/llm/models"
|
||||||
)
|
)
|
||||||
|
|
||||||
type MessageRole string
|
type MessageRole string
|
||||||
|
|
|
@ -11,9 +11,9 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/opencode-ai/opencode/internal/db"
|
"github.com/sst/opencode/internal/db"
|
||||||
"github.com/opencode-ai/opencode/internal/llm/models"
|
"github.com/sst/opencode/internal/llm/models"
|
||||||
"github.com/opencode-ai/opencode/internal/pubsub"
|
"github.com/sst/opencode/internal/pubsub"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -11,8 +11,8 @@ import (
|
||||||
"log/slog"
|
"log/slog"
|
||||||
|
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/opencode-ai/opencode/internal/config"
|
"github.com/sst/opencode/internal/config"
|
||||||
"github.com/opencode-ai/opencode/internal/pubsub"
|
"github.com/sst/opencode/internal/pubsub"
|
||||||
)
|
)
|
||||||
|
|
||||||
var ErrorPermissionDenied = errors.New("permission denied")
|
var ErrorPermissionDenied = errors.New("permission denied")
|
||||||
|
|
|
@ -8,8 +8,8 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/opencode-ai/opencode/internal/db"
|
"github.com/sst/opencode/internal/db"
|
||||||
"github.com/opencode-ai/opencode/internal/pubsub"
|
"github.com/sst/opencode/internal/pubsub"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Session struct {
|
type Session struct {
|
||||||
|
|
|
@ -7,7 +7,7 @@ import (
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/opencode-ai/opencode/internal/pubsub"
|
"github.com/sst/opencode/internal/pubsub"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Level string
|
type Level string
|
||||||
|
|
|
@ -6,12 +6,12 @@ import (
|
||||||
|
|
||||||
"github.com/charmbracelet/lipgloss"
|
"github.com/charmbracelet/lipgloss"
|
||||||
"github.com/charmbracelet/x/ansi"
|
"github.com/charmbracelet/x/ansi"
|
||||||
"github.com/opencode-ai/opencode/internal/config"
|
"github.com/sst/opencode/internal/config"
|
||||||
"github.com/opencode-ai/opencode/internal/message"
|
"github.com/sst/opencode/internal/message"
|
||||||
"github.com/opencode-ai/opencode/internal/session"
|
"github.com/sst/opencode/internal/session"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/styles"
|
"github.com/sst/opencode/internal/tui/styles"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/theme"
|
"github.com/sst/opencode/internal/tui/theme"
|
||||||
"github.com/opencode-ai/opencode/internal/version"
|
"github.com/sst/opencode/internal/version"
|
||||||
)
|
)
|
||||||
|
|
||||||
type SendMsg struct {
|
type SendMsg struct {
|
||||||
|
@ -122,7 +122,7 @@ func logo(width int) string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func repo(width int) string {
|
func repo(width int) string {
|
||||||
repo := "github.com/opencode-ai/opencode"
|
repo := "github.com/sst/opencode"
|
||||||
t := theme.CurrentTheme()
|
t := theme.CurrentTheme()
|
||||||
|
|
||||||
return styles.BaseStyle().
|
return styles.BaseStyle().
|
||||||
|
|
|
@ -11,15 +11,15 @@ import (
|
||||||
"github.com/charmbracelet/bubbles/textarea"
|
"github.com/charmbracelet/bubbles/textarea"
|
||||||
tea "github.com/charmbracelet/bubbletea"
|
tea "github.com/charmbracelet/bubbletea"
|
||||||
"github.com/charmbracelet/lipgloss"
|
"github.com/charmbracelet/lipgloss"
|
||||||
"github.com/opencode-ai/opencode/internal/app"
|
"github.com/sst/opencode/internal/app"
|
||||||
"github.com/opencode-ai/opencode/internal/message"
|
"github.com/sst/opencode/internal/message"
|
||||||
"github.com/opencode-ai/opencode/internal/session"
|
"github.com/sst/opencode/internal/session"
|
||||||
"github.com/opencode-ai/opencode/internal/status"
|
"github.com/sst/opencode/internal/status"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/components/dialog"
|
"github.com/sst/opencode/internal/tui/components/dialog"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/layout"
|
"github.com/sst/opencode/internal/tui/layout"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/styles"
|
"github.com/sst/opencode/internal/tui/styles"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/theme"
|
"github.com/sst/opencode/internal/tui/theme"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/util"
|
"github.com/sst/opencode/internal/tui/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
type editorCmp struct {
|
type editorCmp struct {
|
||||||
|
|
|
@ -11,14 +11,14 @@ import (
|
||||||
"github.com/charmbracelet/bubbles/viewport"
|
"github.com/charmbracelet/bubbles/viewport"
|
||||||
tea "github.com/charmbracelet/bubbletea"
|
tea "github.com/charmbracelet/bubbletea"
|
||||||
"github.com/charmbracelet/lipgloss"
|
"github.com/charmbracelet/lipgloss"
|
||||||
"github.com/opencode-ai/opencode/internal/app"
|
"github.com/sst/opencode/internal/app"
|
||||||
"github.com/opencode-ai/opencode/internal/message"
|
"github.com/sst/opencode/internal/message"
|
||||||
"github.com/opencode-ai/opencode/internal/pubsub"
|
"github.com/sst/opencode/internal/pubsub"
|
||||||
"github.com/opencode-ai/opencode/internal/session"
|
"github.com/sst/opencode/internal/session"
|
||||||
"github.com/opencode-ai/opencode/internal/status"
|
"github.com/sst/opencode/internal/status"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/components/dialog"
|
"github.com/sst/opencode/internal/tui/components/dialog"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/styles"
|
"github.com/sst/opencode/internal/tui/styles"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/theme"
|
"github.com/sst/opencode/internal/tui/theme"
|
||||||
)
|
)
|
||||||
|
|
||||||
type cacheItem struct {
|
type cacheItem struct {
|
||||||
|
|
|
@ -10,14 +10,14 @@ import (
|
||||||
|
|
||||||
"github.com/charmbracelet/lipgloss"
|
"github.com/charmbracelet/lipgloss"
|
||||||
"github.com/charmbracelet/x/ansi"
|
"github.com/charmbracelet/x/ansi"
|
||||||
"github.com/opencode-ai/opencode/internal/config"
|
"github.com/sst/opencode/internal/config"
|
||||||
"github.com/opencode-ai/opencode/internal/diff"
|
"github.com/sst/opencode/internal/diff"
|
||||||
"github.com/opencode-ai/opencode/internal/llm/agent"
|
"github.com/sst/opencode/internal/llm/agent"
|
||||||
"github.com/opencode-ai/opencode/internal/llm/models"
|
"github.com/sst/opencode/internal/llm/models"
|
||||||
"github.com/opencode-ai/opencode/internal/llm/tools"
|
"github.com/sst/opencode/internal/llm/tools"
|
||||||
"github.com/opencode-ai/opencode/internal/message"
|
"github.com/sst/opencode/internal/message"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/styles"
|
"github.com/sst/opencode/internal/tui/styles"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/theme"
|
"github.com/sst/opencode/internal/tui/theme"
|
||||||
)
|
)
|
||||||
|
|
||||||
type uiMessageType int
|
type uiMessageType int
|
||||||
|
|
|
@ -8,13 +8,13 @@ import (
|
||||||
|
|
||||||
tea "github.com/charmbracelet/bubbletea"
|
tea "github.com/charmbracelet/bubbletea"
|
||||||
"github.com/charmbracelet/lipgloss"
|
"github.com/charmbracelet/lipgloss"
|
||||||
"github.com/opencode-ai/opencode/internal/config"
|
"github.com/sst/opencode/internal/config"
|
||||||
"github.com/opencode-ai/opencode/internal/diff"
|
"github.com/sst/opencode/internal/diff"
|
||||||
"github.com/opencode-ai/opencode/internal/history"
|
"github.com/sst/opencode/internal/history"
|
||||||
"github.com/opencode-ai/opencode/internal/pubsub"
|
"github.com/sst/opencode/internal/pubsub"
|
||||||
"github.com/opencode-ai/opencode/internal/session"
|
"github.com/sst/opencode/internal/session"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/styles"
|
"github.com/sst/opencode/internal/tui/styles"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/theme"
|
"github.com/sst/opencode/internal/tui/theme"
|
||||||
)
|
)
|
||||||
|
|
||||||
type sidebarCmp struct {
|
type sidebarCmp struct {
|
||||||
|
|
|
@ -7,16 +7,16 @@ import (
|
||||||
|
|
||||||
tea "github.com/charmbracelet/bubbletea"
|
tea "github.com/charmbracelet/bubbletea"
|
||||||
"github.com/charmbracelet/lipgloss"
|
"github.com/charmbracelet/lipgloss"
|
||||||
"github.com/opencode-ai/opencode/internal/config"
|
"github.com/sst/opencode/internal/config"
|
||||||
"github.com/opencode-ai/opencode/internal/llm/models"
|
"github.com/sst/opencode/internal/llm/models"
|
||||||
"github.com/opencode-ai/opencode/internal/lsp"
|
"github.com/sst/opencode/internal/lsp"
|
||||||
"github.com/opencode-ai/opencode/internal/lsp/protocol"
|
"github.com/sst/opencode/internal/lsp/protocol"
|
||||||
"github.com/opencode-ai/opencode/internal/pubsub"
|
"github.com/sst/opencode/internal/pubsub"
|
||||||
"github.com/opencode-ai/opencode/internal/session"
|
"github.com/sst/opencode/internal/session"
|
||||||
"github.com/opencode-ai/opencode/internal/status"
|
"github.com/sst/opencode/internal/status"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/components/chat"
|
"github.com/sst/opencode/internal/tui/components/chat"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/styles"
|
"github.com/sst/opencode/internal/tui/styles"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/theme"
|
"github.com/sst/opencode/internal/tui/theme"
|
||||||
)
|
)
|
||||||
|
|
||||||
type StatusCmp interface {
|
type StatusCmp interface {
|
||||||
|
|
|
@ -6,9 +6,9 @@ import (
|
||||||
tea "github.com/charmbracelet/bubbletea"
|
tea "github.com/charmbracelet/bubbletea"
|
||||||
"github.com/charmbracelet/lipgloss"
|
"github.com/charmbracelet/lipgloss"
|
||||||
|
|
||||||
"github.com/opencode-ai/opencode/internal/tui/styles"
|
"github.com/sst/opencode/internal/tui/styles"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/theme"
|
"github.com/sst/opencode/internal/tui/theme"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/util"
|
"github.com/sst/opencode/internal/tui/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ArgumentsDialogCmp is a component that asks the user for command arguments.
|
// ArgumentsDialogCmp is a component that asks the user for command arguments.
|
||||||
|
|
|
@ -4,10 +4,10 @@ import (
|
||||||
"github.com/charmbracelet/bubbles/key"
|
"github.com/charmbracelet/bubbles/key"
|
||||||
tea "github.com/charmbracelet/bubbletea"
|
tea "github.com/charmbracelet/bubbletea"
|
||||||
"github.com/charmbracelet/lipgloss"
|
"github.com/charmbracelet/lipgloss"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/layout"
|
"github.com/sst/opencode/internal/tui/layout"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/styles"
|
"github.com/sst/opencode/internal/tui/styles"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/theme"
|
"github.com/sst/opencode/internal/tui/theme"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/util"
|
"github.com/sst/opencode/internal/tui/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Command represents a command that can be executed
|
// Command represents a command that can be executed
|
||||||
|
|
|
@ -7,8 +7,8 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
tea "github.com/charmbracelet/bubbletea"
|
tea "github.com/charmbracelet/bubbletea"
|
||||||
"github.com/opencode-ai/opencode/internal/config"
|
"github.com/sst/opencode/internal/config"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/util"
|
"github.com/sst/opencode/internal/tui/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Command prefix constants
|
// Command prefix constants
|
||||||
|
|
|
@ -14,14 +14,14 @@ import (
|
||||||
"github.com/charmbracelet/bubbles/viewport"
|
"github.com/charmbracelet/bubbles/viewport"
|
||||||
tea "github.com/charmbracelet/bubbletea"
|
tea "github.com/charmbracelet/bubbletea"
|
||||||
"github.com/charmbracelet/lipgloss"
|
"github.com/charmbracelet/lipgloss"
|
||||||
"github.com/opencode-ai/opencode/internal/app"
|
"github.com/sst/opencode/internal/app"
|
||||||
"github.com/opencode-ai/opencode/internal/config"
|
"github.com/sst/opencode/internal/config"
|
||||||
"github.com/opencode-ai/opencode/internal/message"
|
"github.com/sst/opencode/internal/message"
|
||||||
"github.com/opencode-ai/opencode/internal/status"
|
"github.com/sst/opencode/internal/status"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/image"
|
"github.com/sst/opencode/internal/tui/image"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/styles"
|
"github.com/sst/opencode/internal/tui/styles"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/theme"
|
"github.com/sst/opencode/internal/tui/theme"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/util"
|
"github.com/sst/opencode/internal/tui/util"
|
||||||
"log/slog"
|
"log/slog"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,8 @@ import (
|
||||||
"github.com/charmbracelet/bubbles/key"
|
"github.com/charmbracelet/bubbles/key"
|
||||||
tea "github.com/charmbracelet/bubbletea"
|
tea "github.com/charmbracelet/bubbletea"
|
||||||
"github.com/charmbracelet/lipgloss"
|
"github.com/charmbracelet/lipgloss"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/styles"
|
"github.com/sst/opencode/internal/tui/styles"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/theme"
|
"github.com/sst/opencode/internal/tui/theme"
|
||||||
)
|
)
|
||||||
|
|
||||||
type helpCmp struct {
|
type helpCmp struct {
|
||||||
|
|
|
@ -5,9 +5,9 @@ import (
|
||||||
tea "github.com/charmbracelet/bubbletea"
|
tea "github.com/charmbracelet/bubbletea"
|
||||||
"github.com/charmbracelet/lipgloss"
|
"github.com/charmbracelet/lipgloss"
|
||||||
|
|
||||||
"github.com/opencode-ai/opencode/internal/tui/styles"
|
"github.com/sst/opencode/internal/tui/styles"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/theme"
|
"github.com/sst/opencode/internal/tui/theme"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/util"
|
"github.com/sst/opencode/internal/tui/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
// InitDialogCmp is a component that asks the user if they want to initialize the project.
|
// InitDialogCmp is a component that asks the user if they want to initialize the project.
|
||||||
|
|
|
@ -8,13 +8,13 @@ import (
|
||||||
"github.com/charmbracelet/bubbles/key"
|
"github.com/charmbracelet/bubbles/key"
|
||||||
tea "github.com/charmbracelet/bubbletea"
|
tea "github.com/charmbracelet/bubbletea"
|
||||||
"github.com/charmbracelet/lipgloss"
|
"github.com/charmbracelet/lipgloss"
|
||||||
"github.com/opencode-ai/opencode/internal/config"
|
"github.com/sst/opencode/internal/config"
|
||||||
"github.com/opencode-ai/opencode/internal/llm/models"
|
"github.com/sst/opencode/internal/llm/models"
|
||||||
"github.com/opencode-ai/opencode/internal/status"
|
"github.com/sst/opencode/internal/status"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/layout"
|
"github.com/sst/opencode/internal/tui/layout"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/styles"
|
"github.com/sst/opencode/internal/tui/styles"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/theme"
|
"github.com/sst/opencode/internal/tui/theme"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/util"
|
"github.com/sst/opencode/internal/tui/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -6,13 +6,13 @@ import (
|
||||||
"github.com/charmbracelet/bubbles/viewport"
|
"github.com/charmbracelet/bubbles/viewport"
|
||||||
tea "github.com/charmbracelet/bubbletea"
|
tea "github.com/charmbracelet/bubbletea"
|
||||||
"github.com/charmbracelet/lipgloss"
|
"github.com/charmbracelet/lipgloss"
|
||||||
"github.com/opencode-ai/opencode/internal/diff"
|
"github.com/sst/opencode/internal/diff"
|
||||||
"github.com/opencode-ai/opencode/internal/llm/tools"
|
"github.com/sst/opencode/internal/llm/tools"
|
||||||
"github.com/opencode-ai/opencode/internal/permission"
|
"github.com/sst/opencode/internal/permission"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/layout"
|
"github.com/sst/opencode/internal/tui/layout"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/styles"
|
"github.com/sst/opencode/internal/tui/styles"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/theme"
|
"github.com/sst/opencode/internal/tui/theme"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/util"
|
"github.com/sst/opencode/internal/tui/util"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -6,10 +6,10 @@ import (
|
||||||
"github.com/charmbracelet/bubbles/key"
|
"github.com/charmbracelet/bubbles/key"
|
||||||
tea "github.com/charmbracelet/bubbletea"
|
tea "github.com/charmbracelet/bubbletea"
|
||||||
"github.com/charmbracelet/lipgloss"
|
"github.com/charmbracelet/lipgloss"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/layout"
|
"github.com/sst/opencode/internal/tui/layout"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/styles"
|
"github.com/sst/opencode/internal/tui/styles"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/theme"
|
"github.com/sst/opencode/internal/tui/theme"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/util"
|
"github.com/sst/opencode/internal/tui/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
const question = "Are you sure you want to quit?"
|
const question = "Are you sure you want to quit?"
|
||||||
|
|
|
@ -4,11 +4,11 @@ import (
|
||||||
"github.com/charmbracelet/bubbles/key"
|
"github.com/charmbracelet/bubbles/key"
|
||||||
tea "github.com/charmbracelet/bubbletea"
|
tea "github.com/charmbracelet/bubbletea"
|
||||||
"github.com/charmbracelet/lipgloss"
|
"github.com/charmbracelet/lipgloss"
|
||||||
"github.com/opencode-ai/opencode/internal/session"
|
"github.com/sst/opencode/internal/session"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/layout"
|
"github.com/sst/opencode/internal/tui/layout"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/styles"
|
"github.com/sst/opencode/internal/tui/styles"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/theme"
|
"github.com/sst/opencode/internal/tui/theme"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/util"
|
"github.com/sst/opencode/internal/tui/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
// SessionSelectedMsg is sent when a session is selected
|
// SessionSelectedMsg is sent when a session is selected
|
||||||
|
|
|
@ -4,11 +4,11 @@ import (
|
||||||
"github.com/charmbracelet/bubbles/key"
|
"github.com/charmbracelet/bubbles/key"
|
||||||
tea "github.com/charmbracelet/bubbletea"
|
tea "github.com/charmbracelet/bubbletea"
|
||||||
"github.com/charmbracelet/lipgloss"
|
"github.com/charmbracelet/lipgloss"
|
||||||
"github.com/opencode-ai/opencode/internal/status"
|
"github.com/sst/opencode/internal/status"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/layout"
|
"github.com/sst/opencode/internal/tui/layout"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/styles"
|
"github.com/sst/opencode/internal/tui/styles"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/theme"
|
"github.com/sst/opencode/internal/tui/theme"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/util"
|
"github.com/sst/opencode/internal/tui/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ThemeChangedMsg is sent when the theme is changed
|
// ThemeChangedMsg is sent when the theme is changed
|
||||||
|
|
|
@ -9,10 +9,10 @@ import (
|
||||||
"github.com/charmbracelet/bubbles/viewport"
|
"github.com/charmbracelet/bubbles/viewport"
|
||||||
tea "github.com/charmbracelet/bubbletea"
|
tea "github.com/charmbracelet/bubbletea"
|
||||||
"github.com/charmbracelet/lipgloss"
|
"github.com/charmbracelet/lipgloss"
|
||||||
"github.com/opencode-ai/opencode/internal/logging"
|
"github.com/sst/opencode/internal/logging"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/layout"
|
"github.com/sst/opencode/internal/tui/layout"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/styles"
|
"github.com/sst/opencode/internal/tui/styles"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/theme"
|
"github.com/sst/opencode/internal/tui/theme"
|
||||||
)
|
)
|
||||||
|
|
||||||
type DetailComponent interface {
|
type DetailComponent interface {
|
||||||
|
|
|
@ -7,12 +7,12 @@ import (
|
||||||
"github.com/charmbracelet/bubbles/key"
|
"github.com/charmbracelet/bubbles/key"
|
||||||
"github.com/charmbracelet/bubbles/table"
|
"github.com/charmbracelet/bubbles/table"
|
||||||
tea "github.com/charmbracelet/bubbletea"
|
tea "github.com/charmbracelet/bubbletea"
|
||||||
"github.com/opencode-ai/opencode/internal/logging"
|
"github.com/sst/opencode/internal/logging"
|
||||||
"github.com/opencode-ai/opencode/internal/pubsub"
|
"github.com/sst/opencode/internal/pubsub"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/components/chat"
|
"github.com/sst/opencode/internal/tui/components/chat"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/layout"
|
"github.com/sst/opencode/internal/tui/layout"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/theme"
|
"github.com/sst/opencode/internal/tui/theme"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/util"
|
"github.com/sst/opencode/internal/tui/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
type TableComponent interface {
|
type TableComponent interface {
|
||||||
|
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"github.com/charmbracelet/bubbles/key"
|
"github.com/charmbracelet/bubbles/key"
|
||||||
tea "github.com/charmbracelet/bubbletea"
|
tea "github.com/charmbracelet/bubbletea"
|
||||||
"github.com/charmbracelet/lipgloss"
|
"github.com/charmbracelet/lipgloss"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/theme"
|
"github.com/sst/opencode/internal/tui/theme"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Container interface {
|
type Container interface {
|
||||||
|
|
|
@ -8,9 +8,9 @@ import (
|
||||||
"github.com/muesli/ansi"
|
"github.com/muesli/ansi"
|
||||||
"github.com/muesli/reflow/truncate"
|
"github.com/muesli/reflow/truncate"
|
||||||
"github.com/muesli/termenv"
|
"github.com/muesli/termenv"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/styles"
|
"github.com/sst/opencode/internal/tui/styles"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/theme"
|
"github.com/sst/opencode/internal/tui/theme"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/util"
|
"github.com/sst/opencode/internal/tui/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Most of this code is borrowed from
|
// Most of this code is borrowed from
|
||||||
|
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"github.com/charmbracelet/bubbles/key"
|
"github.com/charmbracelet/bubbles/key"
|
||||||
tea "github.com/charmbracelet/bubbletea"
|
tea "github.com/charmbracelet/bubbletea"
|
||||||
"github.com/charmbracelet/lipgloss"
|
"github.com/charmbracelet/lipgloss"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/theme"
|
"github.com/sst/opencode/internal/tui/theme"
|
||||||
)
|
)
|
||||||
|
|
||||||
type SplitPaneLayout interface {
|
type SplitPaneLayout interface {
|
||||||
|
|
|
@ -6,14 +6,14 @@ import (
|
||||||
|
|
||||||
"github.com/charmbracelet/bubbles/key"
|
"github.com/charmbracelet/bubbles/key"
|
||||||
tea "github.com/charmbracelet/bubbletea"
|
tea "github.com/charmbracelet/bubbletea"
|
||||||
"github.com/opencode-ai/opencode/internal/app"
|
"github.com/sst/opencode/internal/app"
|
||||||
"github.com/opencode-ai/opencode/internal/message"
|
"github.com/sst/opencode/internal/message"
|
||||||
"github.com/opencode-ai/opencode/internal/session"
|
"github.com/sst/opencode/internal/session"
|
||||||
"github.com/opencode-ai/opencode/internal/status"
|
"github.com/sst/opencode/internal/status"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/components/chat"
|
"github.com/sst/opencode/internal/tui/components/chat"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/components/dialog"
|
"github.com/sst/opencode/internal/tui/components/dialog"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/layout"
|
"github.com/sst/opencode/internal/tui/layout"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/util"
|
"github.com/sst/opencode/internal/tui/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
var ChatPage PageID = "chat"
|
var ChatPage PageID = "chat"
|
||||||
|
|
|
@ -4,10 +4,10 @@ import (
|
||||||
"github.com/charmbracelet/bubbles/key"
|
"github.com/charmbracelet/bubbles/key"
|
||||||
tea "github.com/charmbracelet/bubbletea"
|
tea "github.com/charmbracelet/bubbletea"
|
||||||
"github.com/charmbracelet/lipgloss"
|
"github.com/charmbracelet/lipgloss"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/components/logs"
|
"github.com/sst/opencode/internal/tui/components/logs"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/layout"
|
"github.com/sst/opencode/internal/tui/layout"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/styles"
|
"github.com/sst/opencode/internal/tui/styles"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/theme"
|
"github.com/sst/opencode/internal/tui/theme"
|
||||||
)
|
)
|
||||||
|
|
||||||
var LogsPage PageID = "logs"
|
var LogsPage PageID = "logs"
|
||||||
|
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"github.com/charmbracelet/glamour"
|
"github.com/charmbracelet/glamour"
|
||||||
"github.com/charmbracelet/glamour/ansi"
|
"github.com/charmbracelet/glamour/ansi"
|
||||||
"github.com/charmbracelet/lipgloss"
|
"github.com/charmbracelet/lipgloss"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/theme"
|
"github.com/sst/opencode/internal/tui/theme"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultMargin = 1
|
const defaultMargin = 1
|
||||||
|
|
|
@ -2,7 +2,7 @@ package styles
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/charmbracelet/lipgloss"
|
"github.com/charmbracelet/lipgloss"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/theme"
|
"github.com/sst/opencode/internal/tui/theme"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -8,7 +8,7 @@ import (
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/alecthomas/chroma/v2/styles"
|
"github.com/alecthomas/chroma/v2/styles"
|
||||||
"github.com/opencode-ai/opencode/internal/config"
|
"github.com/sst/opencode/internal/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Manager handles theme registration, selection, and retrieval.
|
// Manager handles theme registration, selection, and retrieval.
|
||||||
|
|
|
@ -10,19 +10,19 @@ import (
|
||||||
"github.com/charmbracelet/bubbles/spinner"
|
"github.com/charmbracelet/bubbles/spinner"
|
||||||
tea "github.com/charmbracelet/bubbletea"
|
tea "github.com/charmbracelet/bubbletea"
|
||||||
"github.com/charmbracelet/lipgloss"
|
"github.com/charmbracelet/lipgloss"
|
||||||
"github.com/opencode-ai/opencode/internal/app"
|
"github.com/sst/opencode/internal/app"
|
||||||
"github.com/opencode-ai/opencode/internal/config"
|
"github.com/sst/opencode/internal/config"
|
||||||
"github.com/opencode-ai/opencode/internal/logging"
|
"github.com/sst/opencode/internal/logging"
|
||||||
"github.com/opencode-ai/opencode/internal/message"
|
"github.com/sst/opencode/internal/message"
|
||||||
"github.com/opencode-ai/opencode/internal/permission"
|
"github.com/sst/opencode/internal/permission"
|
||||||
"github.com/opencode-ai/opencode/internal/pubsub"
|
"github.com/sst/opencode/internal/pubsub"
|
||||||
"github.com/opencode-ai/opencode/internal/status"
|
"github.com/sst/opencode/internal/status"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/components/chat"
|
"github.com/sst/opencode/internal/tui/components/chat"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/components/core"
|
"github.com/sst/opencode/internal/tui/components/core"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/components/dialog"
|
"github.com/sst/opencode/internal/tui/components/dialog"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/layout"
|
"github.com/sst/opencode/internal/tui/layout"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/page"
|
"github.com/sst/opencode/internal/tui/page"
|
||||||
"github.com/opencode-ai/opencode/internal/tui/util"
|
"github.com/sst/opencode/internal/tui/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
type keyMap struct {
|
type keyMap struct {
|
||||||
|
|
|
@ -5,7 +5,7 @@ import "runtime/debug"
|
||||||
// Build-time parameters set via -ldflags
|
// Build-time parameters set via -ldflags
|
||||||
var Version = "unknown"
|
var Version = "unknown"
|
||||||
|
|
||||||
// A user may install pug using `go install github.com/opencode-ai/opencode@latest`.
|
// A user may install pug using `go install github.com/sst/opencode@latest`.
|
||||||
// without -ldflags, in which case the version above is unset. As a workaround
|
// without -ldflags, in which case the version above is unset. As a workaround
|
||||||
// we use the embedded build version that *is* set when using `go install` (and
|
// we use the embedded build version that *is* set when using `go install` (and
|
||||||
// is only set for `go install` and not for `go build`).
|
// is only set for `go install` and not for `go build`).
|
||||||
|
|
6
main.go
6
main.go
|
@ -1,9 +1,9 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/opencode-ai/opencode/cmd"
|
"github.com/sst/opencode/cmd"
|
||||||
"github.com/opencode-ai/opencode/internal/logging"
|
"github.com/sst/opencode/internal/logging"
|
||||||
"github.com/opencode-ai/opencode/internal/status"
|
"github.com/sst/opencode/internal/status"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue