@cardinal4/opencode-fold-diffs 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +9 -2
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,8 +1,15 @@
1
1
  # opencode-fold-diffs
2
2
 
3
+ > [!IMPORTANT]
4
+ > **This is a fork, and it exists for one reason: OpenCode V2 support.**
5
+ >
6
+ > The original plugin is **[Tanner Bruhn](https://github.com/tannerbruhn)**'s [`tannerbruhn/opencode-fold-diffs`](https://github.com/tannerbruhn/opencode-fold-diffs) (npm: `opencode-fold-diffs`) — the **OpenCode V1** plugin, whose V1 implementation does not run in V2. This fork — [`cardin/opencode-fold-diffs`](https://github.com/cardin/opencode-fold-diffs), published as [`@cardinal4/opencode-fold-diffs`](https://www.npmjs.com/package/@cardinal4/opencode-fold-diffs) — ports it to **OpenCode V2** (the `@opencode/cli` 2.x line, `opencode v2.0.x`). Install this fork if you are on V2; install upstream if you are on V1.
7
+ >
8
+ > **All credit for the original plugin goes to [Tanner Bruhn](https://github.com/tannerbruhn).** This fork is unofficial and independent: Tanner has not reviewed it, does not maintain it, and does not endorse it. Report bugs in this fork here, not upstream.
9
+
3
10
  **Every `write` and `edit` dumps the whole file or the whole diff into your transcript, and stays there.** This plugin folds those blocks down to their header line — `# Wrote 40 lines · click to expand src/app.ts` — and opens them again on click, or with a fold/unfold-all key if you configure one.
4
11
 
5
- This branch targets **OpenCode V2** (the `@opencode/cli` 2.x line, `opencode v2.0.x`). The V1 plugin implementation does not run in V2; see [Migrating from V1](#migrating-from-v1).
12
+ The V2 port is not a re-host: it follows V2's new plugin API and render tree, so the V1 code cannot be reused. See [Migrating from V1](#migrating-from-v1) for what changed.
6
13
 
7
14
  ## What V2 already folds
8
15
 
@@ -121,7 +128,7 @@ Blocks are re-scanned on `message.part.updated` and `message.updated`, plus a 2
121
128
 
122
129
  ## Migrating from V1
123
130
 
124
- V1 plugin implementations do not run in V2. This branch made these changes:
131
+ V1 plugin implementations do not run in V2. The V2 port made these changes:
125
132
 
126
133
  - Entrypoint is a `{ id, setup(context) }` definition (`Plugin.define()` is an identity helper, so the shape is the same). `setup` returns the cleanup function instead of `api.lifecycle.onDispose`.
127
134
  - `api.renderer` → `context.renderer`; `api.route.current.name` → `context.ui.router.current().type`; `api.event.on` → `context.data.on`; `api.ui.toast` → `context.ui.toast.show`; `api.keymap.registerLayer` → `context.keymap.layer`.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cardinal4/opencode-fold-diffs",
3
- "version": "0.3.1",
4
- "description": "OpenCode V2 TUI plugin: write, edit and apply_patch blocks render folded to their header line, click or ctrl+o to open them.",
3
+ "version": "0.3.2",
4
+ "description": "Unofficial OpenCode V2 fork of opencode-fold-diffs: write, edit and apply_patch blocks render folded to their header line, click to expand.",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "keywords": [