Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
177113a
refactor(core): 抽取共享核心纯逻辑模块
Hotakus Aug 16, 2026
f769b2e
refactor(panel): 抽取共享面板组件与 PanelApi 契约
Hotakus Aug 16, 2026
eb6c122
feat(v2): 新增 opencode2 适配壳(完整面板复用)
Hotakus Aug 16, 2026
4142d22
feat(v2): 底部栏口径对齐 + 斜杠命令注册(实验)
Hotakus Aug 16, 2026
994ba3b
fix(v2): 命令显示(mode global)+ 对话框字段 + 持久化恢复
Hotakus Aug 16, 2026
4abffb3
feat(v2): 命令完整对齐 V1 + 实测修复(余额轮询/底部栏/主题色/侧边栏顺序)
Hotakus Aug 16, 2026
a6184a7
fix(v2): 分布/技能/单价/回合适配对齐 V1(part 归一化 + provider 组装)
Hotakus Aug 16, 2026
38147f0
fix(v2): 单价修复——location.model.list 传 location 参数 + 响应式 getter
Hotakus Aug 16, 2026
b600923
fix(server): server 入口双格式兼容 V2 setup
Hotakus Aug 17, 2026
931859e
fix(server): 恢复 V1 server 空实现(V2 经 v2 版本入口加载)
Hotakus Aug 17, 2026
9c5cafb
feat(v2): tui 目录入口 + server 兼容标记(V2 npm 包方式可用)
Hotakus Aug 17, 2026
8b0f0ec
ci: V2 发布工作流(publish-v2.yml + prepare 脚本)
Hotakus Aug 17, 2026
910ca0a
fix(package): exports[./tui] 指向 tui/index.js 并纳入发布
Hotakus Aug 17, 2026
9188d93
feat(tui): 双格式入口(V1 tui + V2 setup——统一版本基础)
Hotakus Aug 17, 2026
789dde2
Merge branch 'master' of github.com:Hotakus/opencode-visual-cache int…
Hotakus Aug 19, 2026
cd040bf
chore: beta 版本 1.7.0-beta.3(发布状态)
Hotakus Aug 19, 2026
de9471a
merge: 合并 master(#27 修复 + 1.6.3)——保留 beta 版本线
Hotakus Aug 19, 2026
e8700a0
Merge remote-tracking branch 'origin/master' into refactor/v2-dual-entry
Hotakus Aug 23, 2026
02bff14
fix(v2): 底部状态栏支持 /cache-section 显隐开关
TogetsuDo Sep 2, 2026
ae3afcb
fix(publish): oc2 发布脚本 server 入口指向空实现
TogetsuDo Sep 2, 2026
9ff55be
fix(v2): 会话开始前隐藏底部状态栏
TogetsuDo Sep 2, 2026
3035f9f
Merge pull request #31 from TogetsuDo/fix/v2-bottom-bar-and-server-entry
Hotakus Sep 2, 2026
fff3bb6
fix(v2): 命令层挂载到常驻 app slot
TogetsuDo Sep 2, 2026
21c207d
Merge pull request #32 from TogetsuDo/fix/v2-commands-always-mounted
Hotakus Sep 2, 2026
51426bc
fix(v2): 主题文本色兼容两代命名并修正对话框字段
Hotakus Sep 20, 2026
0bfb157
Merge remote-tracking branch 'origin/master' into refactor/v2-dual-entry
Hotakus Sep 20, 2026
97ff585
feat(balance): 余额支持自定义显示文本与 OpenAI OAuth token 读取
Hotakus Sep 20, 2026
a91b21b
fix(panel): 移除余额区重复的分隔线
Hotakus Sep 20, 2026
7493b5e
docs(readme): 补充 opencode 2.x 安装方式
Hotakus Sep 21, 2026
57eb99c
chore(deps): 对齐 V2 依赖声明并移除无效 exports 字段
Hotakus Sep 21, 2026
fef0501
docs(readme): 补充 2.x 安装注意事项与排障说明
Hotakus Sep 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/publish-v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Publish v2 (oc2)

on:
workflow_dispatch:
inputs:
version:
description: "版本号(如 1.7.0-oc2,格式 x.y.z-oc2)"
required: true

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write

steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 22
registry-url: 'https://registry.npmjs.org'
cache: npm

- run: npm install -g npm@11

- run: npm ci

# 改写 package.json 为 v2 版本(version + exports["./tui"] → tui/index.js + files 加 tui/)
- run: node scripts/prepare-v2-publish.mjs ${{ inputs.version }}

# 生成 _version.ts(对齐 oc2 版本号,注入 v2.js)
- run: npm run version

# 构建(v2.js 注入版本号;external 用宿主 @opentui/solid——renderer 相通)
- run: npm run build

# 校验 v2.js 已注入版本号 + tui/index.js 存在
- run: node -e "const c=require('fs').readFileSync('dist/v2.js','utf8'); if(!c.includes(process.argv[1])) { console.error('dist/v2.js 未注入版本号'); process.exit(1) }" ${{ inputs.version }}
- run: node -e "if(!require('fs').existsSync('tui/index.js')) { console.error('tui/index.js 缺失'); process.exit(1) }"

# 发布到 oc2 通道(dist-tag 用 oc2——"v2" 是合法 SemVer range 会被 npm 拒绝;
# --access public 与主线 publish.yml 一致;认证用 OIDC/trusted publishing(id-token: write),无 token)
- run: npm publish --access public --tag oc2

# 校验 dist-tag
- run: npm dist-tag ls opencode-visual-cache
48 changes: 42 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,45 @@

## 3. 安装

### 3.1 方式一:OpenCode 命令安装(推荐)
本插件同时支持 opencode 1.x 与 2.x。

### 3.1 opencode 2.x

opencode 2.x 的 TUI 插件由 `cli.json` 的 `plugins` 管理;添加条目后,下次启动 opencode 时会自动安装并加载。

创建或编辑 `~/.config/opencode/cli.json`,在 `plugins` 数组中追加以下条目:

```json
{
"plugins": [
{
"package": "opencode-visual-cache@latest",
"options": {
"enabled": true
}
}
]
}
```

若文件中已有其他插件或配置,只需在现有 `plugins` 数组末尾追加这个对象条目。

> **注意**:不要使用 `opencode plugin add` 安装本插件。该命令会把条目写入 `opencode.jsonc`(用于 server 插件),而本插件是 TUI 插件,会导致 server 插件加载报错:
>
> ```
> Plugin must export a default definition with an id and an effect or setup function.
> ```
>
> 如果已经用该命令安装过,请:
> 1. 打开 `~/.config/opencode/opencode.jsonc`,从 `plugins` 数组中删除本插件条目
> 2. 按上述方式在 `cli.json` 的 `plugins` 中声明
> 3. 重启 opencode

> **排障**:若插件未生效,可清理插件缓存后重启。V2 缓存在 `~/.cache/opencode/npm`,V1 在 `~/.cache/opencode/packages`。

### 3.2 opencode 1.x

**方式一:命令安装(推荐)**

在 OpenCode 中按 **`Ctrl + P`** 打开命令面板,搜索 **`install plugin`**,输入:

Expand All @@ -70,17 +108,15 @@ opencode-visual-cache@latest

回车即可完成安装与配置。

### 3.2 方式二:手动安装
**方式二:手动安装**

**1. 安装插件**
1. 安装插件

```bash
npm install -g opencode-visual-cache@latest
```

**2. 配置 TUI 插件**

创建或编辑 `~/.config/opencode/tui.jsonc`:
2. 配置 TUI 插件 —— 创建或编辑 `~/.config/opencode/tui.jsonc`:

```jsonc
{
Expand Down
48 changes: 42 additions & 6 deletions README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,45 @@ Interested in sub-agent monitoring? Check out [opencode-subagent-magazine](https

## 3. Installation

### 3.1 Option 1: OpenCode Command (recommended)
This plugin supports both opencode 1.x and 2.x.

### 3.1 opencode 2.x

opencode 2.x manages TUI plugins through the `plugins` array in `cli.json`; after adding an entry, it is installed and loaded automatically on the next start.

Create or edit `~/.config/opencode/cli.json` and append the following entry to the `plugins` array:

```json
{
"plugins": [
{
"package": "opencode-visual-cache@latest",
"options": {
"enabled": true
}
}
]
}
```

If the file already contains other plugins or settings, just append this object entry to the existing `plugins` array.

> **Note**: Do not install this plugin with `opencode plugin add`. That command writes the entry to `opencode.jsonc` (used for server plugins), which makes the server fail to load it:
>
> ```
> Plugin must export a default definition with an id and an effect or setup function.
> ```
>
> If you already installed it that way:
> 1. Open `~/.config/opencode/opencode.jsonc` and remove this plugin from the `plugins` array
> 2. Declare it in the `plugins` array of `cli.json` as described above
> 3. Restart opencode

> **Troubleshooting**: If the plugin does not take effect, clear the plugin cache and restart. The V2 cache lives in `~/.cache/opencode/npm`, and the V1 cache in `~/.cache/opencode/packages`.

### 3.2 opencode 1.x

**Option 1: Command (recommended)**

Press **`Ctrl + P`** in OpenCode to open the command palette, search **`install plugin`**, then type:

Expand All @@ -70,17 +108,15 @@ opencode-visual-cache@latest

Press Enter to install and configure automatically.

### 3.2 Option 2: Manual
**Option 2: Manual**

**1. Install the plugin**
1. Install the plugin

```bash
npm install -g opencode-visual-cache@latest
```

**2. Configure TUI plugin**

Create or edit `~/.config/opencode/tui.jsonc`:
2. Configure the TUI plugin — create or edit `~/.config/opencode/tui.jsonc`:

```jsonc
{
Expand Down
13 changes: 13 additions & 0 deletions build.tui.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,16 @@ await esbuild.build({
external: ["@opencode-ai/*", "@opentui/*", "solid-js"],
plugins: [solidPlugin({ solid: { moduleName: "@opentui/solid", generate: "universal" } })],
})

// V2 (opencode2) 入口:{ id, setup } 协议,独立产物。
// @opentui/* + solid-js 保持 external:必须用 V2 宿主的同一实例(renderer 上下文相通——
// self-contained 内联会导致 "No renderer found");@opencode-ai/* 为 type-only(编译擦除)。
await esbuild.build({
entryPoints: ["src/v2/index.tsx"],
outfile: "dist/v2.js",
format: "esm",
platform: "node",
bundle: true,
external: ["@opencode-ai/*", "@opentui/*", "solid-js"],
plugins: [solidPlugin({ solid: { moduleName: "@opentui/solid", generate: "universal" } })],
})
Loading
Loading