opencode-plan-cards-plugin 0.1.1 → 0.1.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.
- package/CHANGELOG.md +23 -0
- package/README.en.md +10 -10
- package/README.ja.md +10 -10
- package/README.md +10 -10
- package/README.zh-CN.md +10 -10
- package/dist/cli.js +2 -1
- package/dist/index.js +8 -1
- package/package.json +15 -4
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [Unreleased]
|
|
6
|
+
|
|
7
|
+
## [0.1.2] - 2026-02-16
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- Open-source community files:
|
|
12
|
+
- `CONTRIBUTING.md`
|
|
13
|
+
- `SECURITY.md`
|
|
14
|
+
- `CODE_OF_CONDUCT.md`
|
|
15
|
+
- GitHub Actions CI workflow (`.github/workflows/ci.yml`) for type-check and build.
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
|
|
19
|
+
- Added npm package metadata: `repository`, `homepage`, `bugs`, `author`, `engines`.
|
|
20
|
+
- Replaced placeholder git clone URLs in all README variants.
|
|
21
|
+
- Added `*.tgz` to `.gitignore`.
|
|
22
|
+
- Card mode is now enabled by default for `plan` sessions after plugin installation.
|
|
23
|
+
- `/plan card off` remains available for session-level opt-out.
|
|
24
|
+
- `/plan card on` can re-enable card mode for that session.
|
|
25
|
+
- Updated multilingual README usage examples for default-on behavior.
|
|
26
|
+
- Updated setup CLI completion message to reflect default-on behavior.
|
|
27
|
+
|
|
5
28
|
## [0.1.1] - 2026-02-16
|
|
6
29
|
|
|
7
30
|
### Added
|
package/README.en.md
CHANGED
|
@@ -9,7 +9,7 @@ A plugin that enhances card-based planning interactions for original OpenCode (D
|
|
|
9
9
|
- `/plan card off`
|
|
10
10
|
- When enabled, it injects a stricter `plan` workflow: clarify first, confirm, then output a complete plan.
|
|
11
11
|
- Enhances the `question` tool definition to encourage card questions with 2–3 options and clear tradeoff descriptions.
|
|
12
|
-
-
|
|
12
|
+
- Enabled by default after installation; still controllable per session.
|
|
13
13
|
|
|
14
14
|
## Compatibility
|
|
15
15
|
|
|
@@ -26,20 +26,20 @@ npx -y opencode-plan-cards-plugin@latest setup
|
|
|
26
26
|
By default this command:
|
|
27
27
|
|
|
28
28
|
- creates a backup of `~/.config/opencode/opencode.json`
|
|
29
|
-
- writes `plugin: ["opencode-plan-cards-plugin@0.1.
|
|
29
|
+
- writes `plugin: ["opencode-plan-cards-plugin@0.1.2"]`
|
|
30
30
|
- writes `agent.ask.hidden = true`
|
|
31
31
|
|
|
32
32
|
Optional flags:
|
|
33
33
|
|
|
34
34
|
```powershell
|
|
35
|
-
npx -y opencode-plan-cards-plugin@latest setup --plugin opencode-plan-cards-plugin@0.1.
|
|
35
|
+
npx -y opencode-plan-cards-plugin@latest setup --plugin opencode-plan-cards-plugin@0.1.2
|
|
36
36
|
npx -y opencode-plan-cards-plugin@latest setup --config "C:\Users\<you>\.config\opencode\opencode.json"
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
## Installation (Method B: Git + file://)
|
|
40
40
|
|
|
41
41
|
```powershell
|
|
42
|
-
git clone
|
|
42
|
+
git clone https://github.com/SAKURA1175/opencode-plan-cards-plugin.git opencode-plan-cards-plugin
|
|
43
43
|
cd opencode-plan-cards-plugin
|
|
44
44
|
npm install
|
|
45
45
|
npm run build
|
|
@@ -71,7 +71,7 @@ After publishing, user config:
|
|
|
71
71
|
{
|
|
72
72
|
"$schema": "https://opencode.ai/config.json",
|
|
73
73
|
"plugin": [
|
|
74
|
-
"opencode-plan-cards-plugin@0.1.
|
|
74
|
+
"opencode-plan-cards-plugin@0.1.2"
|
|
75
75
|
],
|
|
76
76
|
"agent": {
|
|
77
77
|
"ask": {
|
|
@@ -83,14 +83,14 @@ After publishing, user config:
|
|
|
83
83
|
|
|
84
84
|
## Usage
|
|
85
85
|
|
|
86
|
-
1.
|
|
87
|
-
2.
|
|
88
|
-
3. To
|
|
86
|
+
1. After install and restart, card mode is enabled by default in `plan` sessions
|
|
87
|
+
2. To disable card mode in the current session, run `/plan card off`
|
|
88
|
+
3. To re-enable card mode in the current session, run `/plan card on`
|
|
89
89
|
|
|
90
90
|
## Validation Checklist
|
|
91
91
|
|
|
92
|
-
1. Desktop: card interaction appears
|
|
93
|
-
2. CLI: same
|
|
92
|
+
1. Desktop: card interaction appears by default in `plan` sessions
|
|
93
|
+
2. CLI: same default behavior works
|
|
94
94
|
3. `/plan card off` restores default `plan` behavior
|
|
95
95
|
4. `agent.ask.hidden=true` hides ask in UI by default
|
|
96
96
|
|
package/README.ja.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
- `/plan card off`
|
|
10
10
|
- 有効化時、`plan` セッションにのみ「要件確認 → 最終確認 → 完全な実行計画出力」の制約を注入。
|
|
11
11
|
- `question` ツール定義を強化し、2〜3択 + トレードオフ説明のカード質問を促進。
|
|
12
|
-
-
|
|
12
|
+
- インストール後はデフォルトで有効。セッションごとに切り替え可能。
|
|
13
13
|
|
|
14
14
|
## 互換性
|
|
15
15
|
|
|
@@ -26,20 +26,20 @@ npx -y opencode-plan-cards-plugin@latest setup
|
|
|
26
26
|
このコマンドは自動で以下を実行します:
|
|
27
27
|
|
|
28
28
|
- `~/.config/opencode/opencode.json` のバックアップ作成
|
|
29
|
-
- `plugin: ["opencode-plan-cards-plugin@0.1.
|
|
29
|
+
- `plugin: ["opencode-plan-cards-plugin@0.1.2"]` を設定
|
|
30
30
|
- `agent.ask.hidden = true` を設定
|
|
31
31
|
|
|
32
32
|
オプション:
|
|
33
33
|
|
|
34
34
|
```powershell
|
|
35
|
-
npx -y opencode-plan-cards-plugin@latest setup --plugin opencode-plan-cards-plugin@0.1.
|
|
35
|
+
npx -y opencode-plan-cards-plugin@latest setup --plugin opencode-plan-cards-plugin@0.1.2
|
|
36
36
|
npx -y opencode-plan-cards-plugin@latest setup --config "C:\Users\<you>\.config\opencode\opencode.json"
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
## インストール(方式 B:Git + file://)
|
|
40
40
|
|
|
41
41
|
```powershell
|
|
42
|
-
git clone
|
|
42
|
+
git clone https://github.com/SAKURA1175/opencode-plan-cards-plugin.git opencode-plan-cards-plugin
|
|
43
43
|
cd opencode-plan-cards-plugin
|
|
44
44
|
npm install
|
|
45
45
|
npm run build
|
|
@@ -71,7 +71,7 @@ npm run build
|
|
|
71
71
|
{
|
|
72
72
|
"$schema": "https://opencode.ai/config.json",
|
|
73
73
|
"plugin": [
|
|
74
|
-
"opencode-plan-cards-plugin@0.1.
|
|
74
|
+
"opencode-plan-cards-plugin@0.1.2"
|
|
75
75
|
],
|
|
76
76
|
"agent": {
|
|
77
77
|
"ask": {
|
|
@@ -83,14 +83,14 @@ npm run build
|
|
|
83
83
|
|
|
84
84
|
## 使い方
|
|
85
85
|
|
|
86
|
-
1.
|
|
87
|
-
2.
|
|
88
|
-
3.
|
|
86
|
+
1. インストール後に再起動すると、`plan` セッションではカードモードがデフォルトで有効
|
|
87
|
+
2. 現在のセッションでカードモードを無効化する場合は `/plan card off`
|
|
88
|
+
3. 現在のセッションでカードモードを再有効化する場合は `/plan card on`
|
|
89
89
|
|
|
90
90
|
## 動作確認チェックリスト
|
|
91
91
|
|
|
92
|
-
1. Desktop
|
|
93
|
-
2. CLI
|
|
92
|
+
1. Desktop:`plan` セッションでデフォルトでカード質問フローが表示される
|
|
93
|
+
2. CLI:同様にデフォルトで有効
|
|
94
94
|
3. `/plan card off` 後に標準 `plan` 挙動へ復帰
|
|
95
95
|
4. `agent.ask.hidden=true` で UI の ask を非表示化
|
|
96
96
|
|
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@ Language / 语言 / 言語:
|
|
|
14
14
|
- `/plan card off`
|
|
15
15
|
- 开启后仅在 `plan` 会话注入“先澄清、再确认、再输出完整计划”的系统约束。
|
|
16
16
|
- 强化 `question` 工具描述,推动 2–3 选项 + 权衡说明的卡片提问格式。
|
|
17
|
-
-
|
|
17
|
+
- 安装后默认自动开启卡片模式,可按会话临时关闭。
|
|
18
18
|
|
|
19
19
|
## 兼容性
|
|
20
20
|
|
|
@@ -31,20 +31,20 @@ npx -y opencode-plan-cards-plugin@latest setup
|
|
|
31
31
|
默认会自动:
|
|
32
32
|
|
|
33
33
|
- 备份 `~/.config/opencode/opencode.json`
|
|
34
|
-
- 写入 `plugin: ["opencode-plan-cards-plugin@0.1.
|
|
34
|
+
- 写入 `plugin: ["opencode-plan-cards-plugin@0.1.2"]`
|
|
35
35
|
- 写入 `agent.ask.hidden = true`
|
|
36
36
|
|
|
37
37
|
可选参数:
|
|
38
38
|
|
|
39
39
|
```powershell
|
|
40
|
-
npx -y opencode-plan-cards-plugin@latest setup --plugin opencode-plan-cards-plugin@0.1.
|
|
40
|
+
npx -y opencode-plan-cards-plugin@latest setup --plugin opencode-plan-cards-plugin@0.1.2
|
|
41
41
|
npx -y opencode-plan-cards-plugin@latest setup --config "C:\Users\<you>\.config\opencode\opencode.json"
|
|
42
42
|
```
|
|
43
43
|
|
|
44
44
|
## 安装(方式 B:Git + file://)
|
|
45
45
|
|
|
46
46
|
```powershell
|
|
47
|
-
git clone
|
|
47
|
+
git clone https://github.com/SAKURA1175/opencode-plan-cards-plugin.git opencode-plan-cards-plugin
|
|
48
48
|
cd opencode-plan-cards-plugin
|
|
49
49
|
npm install
|
|
50
50
|
npm run build
|
|
@@ -76,7 +76,7 @@ npm run build
|
|
|
76
76
|
{
|
|
77
77
|
"$schema": "https://opencode.ai/config.json",
|
|
78
78
|
"plugin": [
|
|
79
|
-
"opencode-plan-cards-plugin@0.1.
|
|
79
|
+
"opencode-plan-cards-plugin@0.1.2"
|
|
80
80
|
],
|
|
81
81
|
"agent": {
|
|
82
82
|
"ask": {
|
|
@@ -88,14 +88,14 @@ npm run build
|
|
|
88
88
|
|
|
89
89
|
## 使用
|
|
90
90
|
|
|
91
|
-
1.
|
|
92
|
-
2.
|
|
93
|
-
3.
|
|
91
|
+
1. 安装并重启后,在 `plan` 会话中默认启用卡片澄清与确认流程
|
|
92
|
+
2. 需要关闭当前会话卡片模式时输入:`/plan card off`
|
|
93
|
+
3. 需要重新开启当前会话卡片模式时输入:`/plan card on`
|
|
94
94
|
|
|
95
95
|
## 验证清单
|
|
96
96
|
|
|
97
|
-
1.
|
|
98
|
-
2. CLI
|
|
97
|
+
1. 桌面端:进入 `plan` 会话后默认出现卡片问答流程
|
|
98
|
+
2. CLI:同样默认生效
|
|
99
99
|
3. `/plan card off` 后恢复原始 `plan` 行为
|
|
100
100
|
4. `agent.ask.hidden=true` 后 UI 默认不展示 ask
|
|
101
101
|
|
package/README.zh-CN.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
- `/plan card off`
|
|
10
10
|
- 开启后仅在 `plan` 会话注入“先澄清、再确认、再输出完整计划”的系统约束。
|
|
11
11
|
- 强化 `question` 工具描述,推动 2–3 选项 + 权衡说明的卡片提问格式。
|
|
12
|
-
-
|
|
12
|
+
- 安装后默认自动开启卡片模式,可按会话临时关闭。
|
|
13
13
|
|
|
14
14
|
## 兼容性
|
|
15
15
|
|
|
@@ -26,20 +26,20 @@ npx -y opencode-plan-cards-plugin@latest setup
|
|
|
26
26
|
默认会自动:
|
|
27
27
|
|
|
28
28
|
- 备份 `~/.config/opencode/opencode.json`
|
|
29
|
-
- 写入 `plugin: ["opencode-plan-cards-plugin@0.1.
|
|
29
|
+
- 写入 `plugin: ["opencode-plan-cards-plugin@0.1.2"]`
|
|
30
30
|
- 写入 `agent.ask.hidden = true`
|
|
31
31
|
|
|
32
32
|
可选参数:
|
|
33
33
|
|
|
34
34
|
```powershell
|
|
35
|
-
npx -y opencode-plan-cards-plugin@latest setup --plugin opencode-plan-cards-plugin@0.1.
|
|
35
|
+
npx -y opencode-plan-cards-plugin@latest setup --plugin opencode-plan-cards-plugin@0.1.2
|
|
36
36
|
npx -y opencode-plan-cards-plugin@latest setup --config "C:\Users\<you>\.config\opencode\opencode.json"
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
## 安装(方式 B:Git + file://)
|
|
40
40
|
|
|
41
41
|
```powershell
|
|
42
|
-
git clone
|
|
42
|
+
git clone https://github.com/SAKURA1175/opencode-plan-cards-plugin.git opencode-plan-cards-plugin
|
|
43
43
|
cd opencode-plan-cards-plugin
|
|
44
44
|
npm install
|
|
45
45
|
npm run build
|
|
@@ -71,7 +71,7 @@ npm run build
|
|
|
71
71
|
{
|
|
72
72
|
"$schema": "https://opencode.ai/config.json",
|
|
73
73
|
"plugin": [
|
|
74
|
-
"opencode-plan-cards-plugin@0.1.
|
|
74
|
+
"opencode-plan-cards-plugin@0.1.2"
|
|
75
75
|
],
|
|
76
76
|
"agent": {
|
|
77
77
|
"ask": {
|
|
@@ -83,14 +83,14 @@ npm run build
|
|
|
83
83
|
|
|
84
84
|
## 使用
|
|
85
85
|
|
|
86
|
-
1.
|
|
87
|
-
2.
|
|
88
|
-
3.
|
|
86
|
+
1. 安装并重启后,在 `plan` 会话中默认启用卡片澄清与确认流程
|
|
87
|
+
2. 需要关闭当前会话卡片模式时输入:`/plan card off`
|
|
88
|
+
3. 需要重新开启当前会话卡片模式时输入:`/plan card on`
|
|
89
89
|
|
|
90
90
|
## 验证清单
|
|
91
91
|
|
|
92
|
-
1.
|
|
93
|
-
2. CLI
|
|
92
|
+
1. 桌面端:进入 `plan` 会话后默认出现卡片问答流程
|
|
93
|
+
2. CLI:同样默认生效
|
|
94
94
|
3. `/plan card off` 后恢复原始 `plan` 行为
|
|
95
95
|
4. `agent.ask.hidden=true` 后 UI 默认不显示 ask
|
|
96
96
|
|
package/dist/cli.js
CHANGED
|
@@ -220,7 +220,8 @@ function run() {
|
|
|
220
220
|
console.log(`Backup: ${savedBackup}`);
|
|
221
221
|
}
|
|
222
222
|
console.log(`Plugin: ${pluginSpec}`);
|
|
223
|
-
console.log("Done. Restart OpenCode
|
|
223
|
+
console.log("Done. Restart OpenCode. Card mode is enabled by default in plan sessions.");
|
|
224
|
+
console.log("Use /plan card off to disable it for the current session.");
|
|
224
225
|
}
|
|
225
226
|
try {
|
|
226
227
|
run();
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const CARD_COMMAND_PATTERN = /^\/plan\s+card\s+(on|off)$/i;
|
|
2
|
+
const DEFAULT_CARD_MODE = true;
|
|
2
3
|
const cardModeBySession = new Map();
|
|
3
4
|
const lastAgentBySession = new Map();
|
|
4
5
|
const PLAN_CARD_SYSTEM_APPENDIX = `
|
|
@@ -58,6 +59,12 @@ function appendUniqueDescription(base, appendix) {
|
|
|
58
59
|
return normalized;
|
|
59
60
|
return `${base.trim()}\n\n${normalized}`;
|
|
60
61
|
}
|
|
62
|
+
function isCardModeEnabled(sessionID) {
|
|
63
|
+
const mode = cardModeBySession.get(sessionID);
|
|
64
|
+
if (mode === undefined)
|
|
65
|
+
return DEFAULT_CARD_MODE;
|
|
66
|
+
return mode;
|
|
67
|
+
}
|
|
61
68
|
function patchQuestionParameters(parameters) {
|
|
62
69
|
const questionItem = parameters?.properties?.questions?.items;
|
|
63
70
|
const questionProps = questionItem?.properties;
|
|
@@ -98,7 +105,7 @@ export const PlanCardsPlugin = async () => {
|
|
|
98
105
|
"experimental.chat.system.transform": async (input, output) => {
|
|
99
106
|
if (!input.sessionID)
|
|
100
107
|
return;
|
|
101
|
-
if (!
|
|
108
|
+
if (!isCardModeEnabled(input.sessionID))
|
|
102
109
|
return;
|
|
103
110
|
if (lastAgentBySession.get(input.sessionID) !== "plan")
|
|
104
111
|
return;
|
package/package.json
CHANGED
|
@@ -1,11 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-plan-cards-plugin",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Plan card interaction enhancement plugin for OpenCode",
|
|
5
|
+
"author": "sakura1175",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/SAKURA1175/opencode-plan-cards-plugin.git"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/SAKURA1175/opencode-plan-cards-plugin#readme",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/SAKURA1175/opencode-plan-cards-plugin/issues"
|
|
14
|
+
},
|
|
15
|
+
"engines": {
|
|
16
|
+
"node": ">=18"
|
|
17
|
+
},
|
|
5
18
|
"type": "module",
|
|
6
19
|
"main": "dist/index.js",
|
|
7
20
|
"bin": {
|
|
8
|
-
"opencode-plan-cards-plugin": "
|
|
21
|
+
"opencode-plan-cards-plugin": "dist/cli.js"
|
|
9
22
|
},
|
|
10
23
|
"types": "dist/index.d.ts",
|
|
11
24
|
"exports": {
|
|
@@ -29,8 +42,6 @@
|
|
|
29
42
|
"plan",
|
|
30
43
|
"cards"
|
|
31
44
|
],
|
|
32
|
-
"author": "",
|
|
33
|
-
"license": "MIT",
|
|
34
45
|
"peerDependencies": {
|
|
35
46
|
"@opencode-ai/plugin": ">=1.2.0 <2"
|
|
36
47
|
},
|