Commit Graph

156 Commits (9345830c8a39194c5b5bee9e01099cebef696782)
 

Author SHA1 Message Date
Nicholas Hamilton 9345830c8a
Fix filepicker manual input (#146)
* fix: allows to type i while manual inputting filepath

* fix: file selection in filepicker focus mode

* remove duplicate code
2025-05-09 16:40:06 +02:00
Kujtim Hoxha 5307100f89 small fix 2025-05-09 16:37:02 +02:00
Ed Zynda a58e607c5f
feat: custom commands (#133)
* Implement custom commands

* Add User: prefix

* Reuse var

* Check if the agent is busy and if so report a warning

* Update README

* fix typo

* Implement user and project scoped custom commands

* Allow for $ARGUMENTS

* UI tweaks

* Update internal/tui/components/dialog/arguments.go

Co-authored-by: Kujtim Hoxha <kujtimii.h@gmail.com>

* Also search in $HOME/.opencode/commands

---------

Co-authored-by: Kujtim Hoxha <kujtimii.h@gmail.com>
2025-05-09 16:33:35 +02:00
mineo cd04c44517
replace `github.com/google/generative-ai-go` with `github.com/googleapis/go-genai` (#138)
* replace to github.com/googleapis/go-genai

* fix history logic

* small fixes

---------

Co-authored-by: Kujtim Hoxha <kujtimii.h@gmail.com>
2025-05-09 14:15:38 +02:00
Joshua LaMorey-Salzmann 88711db796
Config fix correcting loose viper string check, default model now set correctly (#147) 2025-05-05 09:40:58 +02:00
phantomreactor 9fec8df7d0
add support for images (#144) 2025-05-02 22:23:58 +02:00
Kujtim Hoxha 603a3e3c71
add xai support (#135) 2025-05-01 14:17:33 +02:00
Aiden Cline e14de7a211
fix: tweak the logic in config to ensure that env vs file configurations merge properly (#115) 2025-05-01 13:22:48 +02:00
Garrett Ladley 004cfe7e8e
feat: test for getContextFromPaths (#105)
* feat: test for getContextFromPaths

* fix: use testify
2025-05-01 12:55:28 +02:00
Adam 58705a1352
fix: more intuitive keybinds (#121) 2025-05-01 12:51:07 +02:00
Adam 82de14371d
feat: themes (#113)
* feat: themes

* feat: flexoki theme

* feat: onedark theme

* feat: monokai pro theme

* feat: opencode theme (default)

* feat: dracula theme

* feat: tokyonight theme

* feat: tron theme

* some small fixes

---------

Co-authored-by: Kujtim Hoxha <kujtimii.h@gmail.com>
2025-05-01 12:49:26 +02:00
Adam 61d9dc9511
fix: allow text selection (#127) 2025-04-30 12:52:30 +02:00
Hunter Casten 76275e533e
fix(openrouter): set api key from env (#129) 2025-04-30 12:50:57 +02:00
Isaac Scarrott 98e2910e82
feat: Add support for OpenRouter (#92)
* Add support for OpenRouter as a new model provider

- Introduced `ProviderOpenRouter` in the `models` package.
- Added OpenRouter-specific models, including `GPT41`, `GPT41Mini`, `GPT4o`, and others, with their configurations and costs.
- Updated `generateSchema` to include OpenRouter as a provider.
- Added OpenRouter-specific environment variable handling (`OPENROUTER_API_KEY`) in `config.go`.
- Implemented default model settings for OpenRouter agents in `setDefaultModelForAgent`.
- Updated `getProviderAPIKey` to retrieve the OpenRouter API key.
- Extended `SupportedModels` to include OpenRouter models.
- Added OpenRouter client initialization in the `provider` package.
- Modified `processGeneration` to handle `FinishReasonUnknown` in addition to `FinishReasonToolUse`.

* [feature/openrouter-provider] Add new models and provider to schema

- Added "deepseek-chat-free" and "deepseek-r1-free" to the list of supported models in `opencode-schema.json`.

* [feature/openrouter-provider] Add OpenRouter provider support and integrate new models

- Updated README.md to include OpenRouter as a supported provider and its configuration details.
- Added `OPENROUTER_API_KEY` to environment variable configuration.
- Introduced OpenRouter-specific models in `internal/llm/models/openrouter.go` with mappings to existing cost and token configurations.
- Updated `internal/config/config.go` to set default models for OpenRouter agents.
- Extended `opencode-schema.json` to include OpenRouter models in the schema definitions.
- Refactored model IDs and names to align with OpenRouter naming conventions.

* [feature/openrouter-provider] Refactor finish reason handling and tool call logic in agent and OpenAI provider

- Simplified finish reason check in `agent.go` by removing redundant variable assignment.
- Updated `openai.go` to override the finish reason to `FinishReasonToolUse` when tool calls are present.
- Ensured consistent finish reason handling in both `send` and `stream` methods of the OpenAI provider.

[feature/openrouter-provider] Refactor finish reason handling and tool call logic in agent and OpenAI provider

- Simplified finish reason check in `agent.go` by removing redundant variable assignment.
- Updated `openai.go` to override the finish reason to `FinishReasonToolUse` when tool calls are present.
- Ensured consistent finish reason handling in both `send` and `stream` methods of the OpenAI provider.

* **[feature/openrouter-provider] Add support for custom headers in OpenAI client configuration**

- Introduced a new `extraHeaders` field in the `openaiOptions` struct to allow specifying additional HTTP headers.
- Added logic in `newOpenAIClient` to apply `extraHeaders` to the OpenAI client configuration.
- Implemented a new option function `WithOpenAIExtraHeaders` to set custom headers in `openaiOptions`.
- Updated the OpenRouter provider configuration in `NewProvider` to include default headers (`HTTP-Referer` and `X-Title`) for OpenRouter API requests.

* Update OpenRouter model config and remove unsupported models

* [feature/openrouter-provider] Update OpenRouter models and default configurations

- Added new OpenRouter models: `claude-3.5-sonnet`, `claude-3-haiku`, `claude-3.7-sonnet`, `claude-3.5-haiku`, and `claude-3-opus` in `openrouter.go`.
- Updated default agent models in `config.go`:
  - `agents.coder.model` now uses `claude-3.7-sonnet`.
  - `agents.task.model` now uses `claude-3.7-sonnet`.
  - `agents.title.model` now uses `claude-3.5-haiku`.
- Updated `opencode-schema.json` to include the new models in the allowed list for schema validation.
- Adjusted logic in `setDefaultModelForAgent` to reflect the new default models.

* [feature/openrouter-provider] Remove unused ProviderEvent emission in stream function

The changes remove the emission of a `ProviderEvent` with type `EventContentStop` in the `stream` function of the `openaiClient` implementation. This event was sent upon successful stream completion but is no longer used.
2025-04-29 13:56:49 +02:00
Kujtim Hoxha 2941137416 fix diagnostics for deleted files 2025-04-28 19:37:42 +02:00
Aiden Cline b3c0285db3
feat: model selection for given provider (#57)
* feat: model selection for given provider

* tweak: adjust cfg validation func, remove duplicated logic, consolidate agent updating into agent.go

* tweak: make the model dialog scrollable, adjust padding slightly for modal"

* feat: add provider selection, add hints, simplify some logic, add horizontal scrolling support, additional scroll indicators"

* remove nav help

* update docs

* increase number of visible models, make horizontal scroll "wrap"

* add provider popularity rankings
2025-04-28 19:25:06 +02:00
YJG 805aeff83c
feat: add azure openai models (#74) 2025-04-28 15:42:57 +02:00
Kujtim Hoxha bce2ec5c10 fix duplicate context 2025-04-27 20:43:27 +02:00
Kujtim Hoxha 292e9d90ca remove unnecessary var 2025-04-27 20:34:20 +02:00
Kujtim Hoxha 2b4441a0d1 fix context 2025-04-27 20:31:53 +02:00
Garrett Ladley 8f3a94df92
feat: configure context paths (#86) 2025-04-27 20:11:09 +02:00
Kujtim Hoxha 4415220555 fix minor issue 2025-04-27 19:24:46 +02:00
Kujtim Hoxha a3a04d8a54 fix gemini provider 2025-04-27 19:12:02 +02:00
Lukáš Loukota 792e2b164b fix: gemini tool calling 2025-04-27 19:12:02 +02:00
Kujtim Hoxha 5859dcdc00 small glob fixes 2025-04-27 18:01:31 +02:00
isaac-scarrott 3c2b0f4dd0 [feature/ripgrep-glob] Add ripgrep-based file globbing to improve performance
- Introduced `globWithRipgrep` function to perform file globbing using the `rg` (ripgrep) command.
- Updated `globFiles` to prioritize ripgrep-based globbing and fall back to doublestar-based globbing if ripgrep fails.
- Added logic to handle ripgrep command execution, output parsing, and filtering of hidden files.
- Ensured results are sorted by path length and limited to the specified maximum number of matches.
- Modified imports to include `os/exec` and `bytes` for ripgrep integration.
2025-04-27 18:01:31 +02:00
Kujtim Hoxha 9738886620 fix provider config 2025-04-27 14:44:40 +02:00
Sam Ottenhoff f3dccad54b Handle new Cursor rules format
1. Check if a path ends with a slash (/)
2. If it does, treat it as a directory and read all files within it
3. For directories like .cursor/rules/, it will scan all files and include their content in the prompt
4. Each file from a directory will be prefixed with "# From filename" for clarity
2025-04-27 14:17:06 +02:00
Kujtim Hoxha b3a8dbd0d9 fix retry warning 2025-04-27 14:08:09 +02:00
Garrett Mitchell Ladley d93694a979 feat: simpler diff implementation 2025-04-27 13:56:57 +02:00
Fuad 8a4d4152ce use workingDir if shellInstance is nil otherwise use cwd if shellInstance is not nil 2025-04-27 13:46:59 +02:00
Fuad f12386e558 use provided workingg dir 2025-04-27 13:46:59 +02:00
Fuad 94aeb7b7fe Fix nil pointer dereference in GetPersistentShell
Added nil check in GetPersistentShell before accessing
shellInstance.isAlive
to prevent panic when newPersistentShell returns nil due to shell
startup
errors. This resolves the "invalid memory address or nil pointer
dereference"
error that was occurring in the shell tool.
2025-04-27 13:46:59 +02:00
Kujtim Hoxha a35466cdb3 fix acc error 2025-04-25 21:58:14 +02:00
Kujtim Hoxha 170c7ad67a small fixes 2025-04-25 14:42:47 +02:00
Hunter Casten 7a62ab7675 feat(groq): add support for Groq using the OpenAI provider 2025-04-25 11:11:52 +02:00
Kujtim Hoxha 1586d757dc remove tool timeout 2025-04-24 22:35:17 +02:00
Dax Raad d043526200 add more installation options 2025-04-24 16:34:57 -04:00
Kujtim Hoxha aaf0bc14ba try fix 2025-04-24 22:27:51 +02:00
Kujtim Hoxha f2d9bb7ee3 try fix 2025-04-24 22:27:51 +02:00
Kujtim Hoxha de41703e20 change db driver 2025-04-24 22:27:51 +02:00
Kujtim Hoxha 2c24bfb7b3 fix kitty issues 2025-04-24 19:57:04 +02:00
Dax Raad 47a37b7dd6 back to disablign cgo 2025-04-24 12:46:11 -04:00
Dax Raad bdbf31f0b9 force CGO 2025-04-24 12:34:55 -04:00
Dax Raad 4e6560efb9 turn on cgo 2025-04-24 12:30:33 -04:00
Dax Raad f2f6efdd35 fix version ldflags 2025-04-24 12:26:42 -04:00
Kujtim Hoxha b106787a50 change package name 2025-04-24 18:26:16 +02:00
Kujtim Hoxha e1b2ce483f change additions/removals 2025-04-24 16:40:36 +02:00
Kujtim Hoxha c42d94c465 small fixes 2025-04-24 16:40:36 +02:00
Kujtim Hoxha f879a94c95 update mainter email 2025-04-24 16:40:36 +02:00