Commit Graph
186 Commits
Author SHA1 Message Date
Bohdan Triapitsyn 6b11211968 release v1.13.1 2026-06-17 02:06:57 +03:00
Bohdan Triapitsyn ada6d417a0 chore: updated changelog with unreleased points 2026-06-17 01:45:24 +03:00
Bohdan Triapitsyn 71172181ef chore: add unreleased changelog entries for recent fixes and perf improvements 2026-06-17 01:08:54 +03:00
Bohdan Triapitsyn 6ea8fb357d chore: add unreleased changelog entries 2026-06-16 14:56:40 +03:00
Bohdan Triapitsyn f321562abd chore: bump @opencode-ai/sdk to ^1.17.7 and update changelogs
Upgraded @opencode-ai/sdk dependency from ^1.17.0 to ^1.17.7 across all packages
Added unreleased changelog entries for VSCode startup parity, mobile tool card fix, and files workspace directory fix
Refined VSCode changelog to remove inaccurate project-level actions note
2026-06-15 13:24:39 +03:00
Bohdan Triapitsyn 5773297ecf chore: updated unreleased changelog 2026-06-15 10:45:18 +03:00
Bohdan Triapitsyn 296177357b perf: speed up model/agent readiness on the initial draft
Load startup config under the owning project's directory key (resolving from a
worktree directory when needed) so the auto-opened draft, which activates the
project, finds a ready providers/agents snapshot instead of triggering a second
load. Also dedupe app.agents: listAgents now takes the directory directly and
shares an in-flight request, so the config store and agents store no longer
issue duplicate agent fetches at startup.
2026-06-14 22:04:32 +03:00
Bohdan Triapitsyn 9111611bdc fix: start draft sessions from default model/agent and honor OpenCode default_agent
A new draft session inherited the previous session's model/agent instead of
resetting to defaults, because opening a draft restored the directory snapshot
without re-applying the startup default cascade. When the prior session ran in
a worktree, defaults were resolved against the worktree directory's provider
list, which omits project/global-scoped providers, so the default agent's model
fell back to opencode/big-pickle.

Resolve the default agent/model via a shared cascade (settings default ->
OpenCode default_agent -> build -> first), resolve the model from the agent's
pinned model/variant or OpenCode's config model, and activate the project's
config (not the worktree's) when opening a draft.
2026-06-14 21:36:05 +03:00
Bohdan Triapitsyn f645d57c93 Stage, unstage, and discard individual diff hunks
Add per-hunk staging, unstaging, and discarding to the Changes diff
view, so a single change region inside a file can be acted on in
isolation instead of forcing whole-file stage/revert. The change is
wired end-to-end across the web server, the shared UI runtime API
contract, and the VS Code extension, with Electron inheriting the web
path unchanged (it boots the server in-process).

Server
------
- New `applyHunk(directory, filePath, { patch, action })` in
  packages/web/server/lib/git/service.js. It resolves the repository
  context and validates the file path with the same helpers used by
  stageFiles/unstageFiles (resolveGitFileContext +
  validateRepositoryFilePaths), then writes the single-hunk patch to a
  temporary file in the OS temp dir (never inside the repo, so it
  cannot show up as an untracked file) and runs `git apply` with flags
  chosen per action:
    stage   -> git apply --cached          (working tree -> index)
    unstage -> git apply --cached --reverse (index -> working tree)
    discard -> git apply --reverse          (revert in working tree)
  A `git apply --check` runs first with the same flags, so a stale
  hunk that no longer applies fails with a clear "Hunk no longer
  applies - refresh and try again" message instead of leaving a
  partial mutation. The patch's target path is parsed and must match
  the requested file (with /dev/null tolerated for new/deleted files),
  preventing a patch from silently targeting a different path. The
  whole operation runs inside withGitIndexMutationQueue to avoid
  racing with concurrent stage/unstage. The temp file is removed in a
  finally block.
- New `POST /api/git/apply-hunk` route in routes.js, registered
  alongside stage/unstage. Validates directory, path, non-empty patch,
  and action before delegating.
- DOCUMENTATION.md updated with the new service entry.

Patch extraction
----------------
- packages/ui/src/lib/diff/patchFileDiff.ts gains
  splitPatchIntoHunks(patch) and extractHunkPatch(patch, hunkIndex).
  They keep the original file header (diff --git / index / --- / +++)
  and emit exactly one @@ hunk per standalone patch, which is what
  `git apply` expects. Each emitted patch is guaranteed to end with a
  trailing newline (without it git apply reports "corrupt patch").

Runtime API contract
--------------------
- GitAPI (packages/ui/src/lib/api/types.ts) gains optional
  stageGitHunk / unstageGitHunk / revertGitHunk, matching the
  stageGitFiles? / unstageGitFiles? precedent so runtimes that do not
  support it degrade gracefully.
- gitApi.ts delegates to the registered runtime git API, falling back
  to gitApiHttp, exactly like the existing whole-file helpers.
- gitApiHttp.ts posts to /api/git/apply-hunk.
- Web runtime composes the three methods in packages/web/src/api/git.ts.

VS Code parity
--------------
- packages/vscode/src/gitService.ts adds applyGitHunk(), implemented
  natively with the existing execGit helper + a temp patch file +
  `git apply` (--cached / --cached --reverse / --reverse), mirroring
  the server's --check-first safety and temp-file cleanup.
- bridge-git-runtime.ts handles the new api:git/apply-hunk bridge
  message; webview/api/git.ts sends it. VS Code users get identical
  stage/unstage/discard-hunk behavior.

UI
--
- New DiffHunkActions component renders a compact per-hunk strip
  above each expanded file diff in the Changes view. Each hunk chip
  shows its +additions / -deletions counts and offers:
    working scope -> Stage + Discard
    staged scope  -> Unstage
  Clicking extracts that hunk's standalone patch via
  extractHunkPatch(patch, hunkIndex) and calls the runtime git API.
  Because the chip index comes directly from fileDiff.hunks[] and the
  patch is sliced in the same order, the hunk the user sees is always
  the hunk that gets applied. While any action is in flight all buttons
  disable to prevent conflicting concurrent mutations; the per-hunk
  spinner reflects in-flight state.
- DiffView wires DiffHunkActions into InlineDiffViewer (text diffs
  only; binary/image and full-file-content modes are excluded since
  they have no patch). MultiFileDiffEntry passes directory/staged
  through and handles onHunkApplied by bumping the diff reload nonce
  (so the file's diff re-fetches and the affected hunk disappears)
  and refreshing git status (so file counts and the staged/changed
  scope update). Hunk actions are therefore available wherever the
  default patch-context diff is shown.

i18n
----
- 10 new keys (diffView.hunk.*) added to all 9 locales (en, es, fr,
  ko, pl, pt-BR, uk, zh-CN, zh-TW), including stage/unstage/discard
  labels, tooltips with the hunk index, a stale-hunk error message,
  and an unsupported-runtime fallback.

Tests
-----
- packages/ui/src/lib/diff/patchFileDiff.test.ts covers
  splitHunks/extractHunkPatch: multi-hunk split, header preservation,
  single-hunk and empty patches, out-of-range indices.
- service.test.js adds an applyHunk suite that builds real temp repos
  with two separate hunks and verifies: staging one hunk leaves the
  other unstaged, discarding reverts only the targeted hunk in the
  working tree, unstaging removes only one hunk from the index, and a
  retargeted patch (different file path) is rejected. Also covers
  invalid-action / missing-hunk-header validation.
- packages/web/src/api/git.test.ts mock completed with the new methods
  (and previously-missing exports that prevented the test from
  loading) and asserts the three hunk methods are exposed.
- routes.test.js continues to pass under bun.

CHANGELOG updated under [Unreleased].
2026-06-14 10:58:23 +03:00
Bohdan Triapitsyn 8174ede976 Improve Changes diff experience 2026-06-14 01:39:49 +03:00
Bohdan Triapitsyn b8dc25c7c8 fix: show about settings only on mobile
Hides About from desktop settings navigation and command palette
Keeps About available in mobile settings
2026-06-13 01:59:33 +03:00
Bohdan Triapitsyn 6cc3a93547 chore: update unreleased changelog 2026-06-12 18:54:35 +03:00
Bohdan Triapitsyn 75014e0317 release v1.12.4 2026-06-11 01:42:41 +03:00
Bohdan Triapitsyn 0c25c4aecb docs: update unreleased changelog entries 2026-06-10 15:39:14 +03:00
Bohdan Triapitsyn 78c851f7cd feat: open isolated multirun sessions before setup completes
Open isolated Multi-Run sessions while worktree setup continues in the background
Apply the faster flow to VS Code Agent Manager isolated runs
Document the new Multi-Run and Agent Manager behavior
2026-06-07 02:05:10 +03:00
Bohdan Triapitsyn 3bfb7ba6aa release v1.12.3 2026-06-05 20:42:29 +03:00
Bohdan Triapitsyn a5628b20df release v1.12.2 2026-06-05 15:32:13 +03:00
Bohdan Triapitsyn 84df7fa24f fix: show time format setting in vscode 2026-06-03 23:10:58 +03:00
Bohdan Triapitsyn e80bd15dd9 release v1.12.0 2026-06-03 01:41:19 +03:00
Bohdan Triapitsyn 27255c642d release v1.11.7 2026-05-27 01:16:43 +03:00
Bohdan Triapitsyn 6e16504dac release v1.11.6 2026-05-25 19:32:26 +03:00
Quat3rnionandBohdan Triapitsyn 2b47d899c6 feat: plugin settings (#1375)
* feat(settings): add opencode plugins page

Manage opencode `plugin` array entries (npm, scoped npm, versioned,
local paths) and auto-loaded plugin files in `~/.config/opencode/plugins/`
and `<project>/.opencode/plugins/`. Mirrors MCP CRUD pattern.

- Server: `plugins.js` data layer + `plugin-routes.js` REST routes
- UI: PluginsSidebar / PluginsPage / AddPluginDialog
- Store: usePluginsStore (cache TTL, in-flight dedup, narrow selectors)
- i18n: 41 keys across 7 locales

Whitelist /api/config/plugins in JSON body-parser so POST/PATCH bodies
parse; opencode plugin specs runtime-resolve OPENCODE_CONFIG dir so
parallel test files do not cross-pollute module-frozen consts.

* feat(settings/plugins): hook npm registry for update + invalid-version detection

Plugins page now consults registry.npmjs.org with a 1h server cache. Sidebar
rows show an update badge with the latest version, group headers show how
many updates are available, the kebab adds an "Update to latest" action
that reuses the existing PATCH+restart flow, and the editor surfaces a
banner for update-available / missing-version / missing-package / malformed
/ missing-path / unreadable-path / offline-registry states. A refresh
button in the sidebar header forces a cache bypass.

- Server: `npm-registry.js` (cache + in-flight dedup + 5s timeout, 404
  cached, network failures NOT cached) + `plugin-spec.js` (parser + exact
  semver detection) + `GET /api/config/plugins/registry?specs=...&refresh=`
- Routes accept up to 100 specs/request, dedup by npm package name before
  fetching, classify each result by kind, never propagate network failure
  as 500.
- Client: `registryInfo` slice + `loadRegistryInfo` (fire-and-forget after
  loadPlugins, refreshes on mutations) + `updateToLatest(id)`.
- UI: `RegistryBadge` per-row + `RegistryBanner` per-entry editor, both
  use theme tokens (text-only color, no new bg/border tokens) and the
  shared Icon sprite. Per-spec subscriptions only.
- i18n: 24 new keys (incl. split singular/plural for "N update(s)
  available" because the runtime does not parse ICU plural format).

* fix(settings/plugins): keep registry badge visible for long specs

Sidebar entry row used `inline-flex` with `truncate` only on the spec
text. With long npm specs the badge could be pushed past the row edge
and clipped by the parent overflow. Switch to `flex` with spec
`flex-1 min-w-0 truncate` and add `shrink-0` to the badge wrapper so
the update indicator stays anchored to the right of the row.

* fix(settings/plugins): use code-box icon to distinguish from MCP

Plugins nav entry used 'plug' which is visually too close to MCP's
'plug-2' icon. Swap to 'code-box' for clearer differentiation in the
Settings nav list.

* Update packages/ui/src/components/sections/plugins/PluginsPage.tsx

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Signed-off-by: Quat3rnion <81202811+Quat3rnion@users.noreply.github.com>

* Update packages/ui/src/stores/usePluginsStore.ts

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Signed-off-by: Quat3rnion <81202811+Quat3rnion@users.noreply.github.com>

* fix(settings/plugins): validate registry directory + surface save errors

- registry endpoint: return 400 on invalid directory query (was silently falling back to homedir, breaking relative path specs)
- save failure toast: prefer result.message over generic 'Reload failed'

* fix(settings/plugins): address review follow-ups

---------

Signed-off-by: Quat3rnion <81202811+Quat3rnion@users.noreply.github.com>
Co-authored-by: Bohdan Triapitsyn <artmore@protonmail.com>
2026-05-25 19:20:04 +03:00
Bohdan Triapitsyn 68f00e4b7b release v1.11.5 2026-05-25 02:23:56 +03:00
luo jiyin 47f72c2e09 fix: correct typos in CHANGELOG files (#1338) 2026-05-23 21:16:09 +03:00
Tom Rochette fd01a0ba62 Update CHANGELOG with contributor name corrections (#1382)
Signed-off-by: Tom Rochette <roctom@gmail.com>
2026-05-23 20:52:21 +03:00
Bohdan Triapitsyn 07eb9d50d3 release v1.11.4 2026-05-22 02:07:11 +03:00
Bohdan Triapitsyn f354762e22 release v1.11.3 2026-05-19 19:26:38 +03:00
Bohdan Triapitsyn d5cdf464fa release v1.11.2 2026-05-18 01:01:31 +03:00
Bohdan Triapitsyn 947f725976 release v1.11.1 2026-05-15 23:18:55 +03:00
Bohdan Triapitsyn a4decfd3dd release v1.11.0 2026-05-14 15:36:07 +03:00
Bohdan Triapitsyn c38727efc9 release v1.10.4 2026-05-09 01:18:33 +03:00
Bohdan Triapitsyn a591f63ed2 release v1.10.3 2026-05-08 16:26:07 +03:00
Bohdan Triapitsyn 686fec7419 release v1.10.2 2026-05-07 23:54:35 +03:00
Bohdan Triapitsyn 633edb27c3 release v1.10.1 2026-05-06 20:03:29 +03:00
Bohdan Triapitsyn 495b9d56d2 release v1.10.0 2026-05-05 01:39:33 +03:00
Bohdan Triapitsyn 90c8c948f8 chore: update changelogs with unreleased changes 2026-04-30 12:22:49 +03:00
Bohdan Triapitsyn 17650becc0 release v1.9.10 2026-04-28 17:45:58 +03:00
Bohdan Triapitsyn 67f082988c release v1.9.9 2026-04-26 20:49:28 +03:00
Bohdan Triapitsyn c94da0c1a0 release v1.9.8 2026-04-22 22:15:23 +03:00
Bohdan Triapitsyn 2a0aef89d5 release v1.9.7 2026-04-22 00:36:25 +03:00
Bohdan Triapitsyn 5710198864 release v1.9.6 2026-04-17 19:06:27 +03:00
Bohdan Triapitsyn 9908f2dc9c release v1.9.5 2026-04-14 23:58:06 +03:00
Bohdan Triapitsyn ec1e309c40 release v1.9.4 2026-04-07 23:10:08 +03:00
Bohdan Triapitsyn 507f429674 release v1.9.3 2026-04-01 19:42:13 +03:00
Bohdan Triapitsyn d99417c4a0 chore: update changelogs for unreleased features and fixes across desktop and vscode packages 2026-04-01 16:24:45 +03:00
Bohdan Triapitsyn 47176de18a release v1.9.2 2026-03-31 19:31:17 +03:00
Bohdan Triapitsyn c66d480782 release v1.9.1 2026-03-20 19:35:42 +02:00
Bohdan Triapitsyn 200843ffae release v1.9.0 2026-03-20 02:05:58 +02:00
Bohdan Triapitsyn 2b1c120280 release v1.8.7 2026-03-13 11:42:27 +02:00
Bohdan Triapitsyn 1fa6ec7032 release v1.8.6 2026-03-13 00:02:39 +02:00