codemini-cli 0.5.9 → 0.5.11

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 (59) hide show
  1. package/OPERATIONS.md +242 -242
  2. package/README.md +588 -489
  3. package/codemini-web/dist/assets/{highlighted-body-OFNGDK62-HgeDi9HJ.js → highlighted-body-OFNGDK62-CANOG7Xg.js} +1 -1
  4. package/codemini-web/dist/assets/{index-C4tKT3v4.js → index-B71xykPM.js} +108 -108
  5. package/codemini-web/dist/assets/index-Dkq1DdDX.css +2 -0
  6. package/codemini-web/dist/assets/mermaid-GHXKKRXX-Z_w7M93P.js +1 -0
  7. package/codemini-web/dist/index.html +23 -23
  8. package/codemini-web/lib/approval-manager.js +32 -32
  9. package/codemini-web/lib/runtime-bridge.js +17 -11
  10. package/codemini-web/server.js +534 -205
  11. package/deployment.md +212 -212
  12. package/package.json +1 -1
  13. package/skills/brainstorm/SKILL.md +77 -72
  14. package/skills/codemini.skills.json +40 -40
  15. package/skills/grill-me/SKILL.md +30 -30
  16. package/skills/superpowers-lite/SKILL.md +82 -82
  17. package/src/cli.js +74 -74
  18. package/src/commands/chat.js +210 -210
  19. package/src/commands/run.js +313 -313
  20. package/src/commands/skill.js +438 -304
  21. package/src/commands/web.js +57 -57
  22. package/src/core/agent-loop.js +980 -980
  23. package/src/core/ast.js +309 -292
  24. package/src/core/chat-runtime.js +6261 -6240
  25. package/src/core/command-evaluator.js +72 -72
  26. package/src/core/command-loader.js +311 -311
  27. package/src/core/command-policy.js +301 -301
  28. package/src/core/command-risk.js +156 -156
  29. package/src/core/config-store.js +289 -287
  30. package/src/core/constants.js +18 -1
  31. package/src/core/context-compact.js +365 -365
  32. package/src/core/default-system-prompt.js +114 -107
  33. package/src/core/dream-audit.js +105 -105
  34. package/src/core/dream-consolidate.js +229 -229
  35. package/src/core/dream-evaluator.js +185 -185
  36. package/src/core/fff-adapter.js +383 -383
  37. package/src/core/memory-store.js +543 -543
  38. package/src/core/project-index.js +737 -529
  39. package/src/core/project-instructions.js +98 -0
  40. package/src/core/provider/anthropic.js +514 -514
  41. package/src/core/provider/openai-compatible.js +501 -501
  42. package/src/core/reflect-skill.js +178 -178
  43. package/src/core/reply-language.js +40 -40
  44. package/src/core/session-store.js +474 -474
  45. package/src/core/shell-profile.js +237 -237
  46. package/src/core/shell.js +323 -317
  47. package/src/core/soul.js +69 -69
  48. package/src/core/system-prompt-composer.js +52 -42
  49. package/src/core/tool-args.js +199 -154
  50. package/src/core/tool-output.js +184 -184
  51. package/src/core/tool-result-store.js +206 -206
  52. package/src/core/tools.js +3024 -2893
  53. package/src/core/version.js +11 -11
  54. package/src/tui/chat-app.js +5171 -5171
  55. package/src/tui/tool-activity/presenters/misc.js +30 -30
  56. package/src/tui/tool-activity/presenters/system.js +20 -20
  57. package/templates/project-requirements/report-shell.html +582 -582
  58. package/codemini-web/dist/assets/index-BSdIdn3L.css +0 -2
  59. package/codemini-web/dist/assets/mermaid-GHXKKRXX-CDgkkDBg.js +0 -1
package/deployment.md CHANGED
@@ -1,212 +1,212 @@
1
- # Deployment Guide
2
-
3
- This document describes how to package, copy, install, configure, and verify `codemini-cli` from a `.tgz` file.
4
-
5
- ## 1. Build The TGZ Package
6
-
7
- Run this in the project root on the packaging machine:
8
-
9
- ```bash
10
- npm pack
11
- ```
12
-
13
- Expected output:
14
-
15
- ```text
16
- codemini-cli-0.5.5.tgz
17
- ```
18
-
19
- If you want to verify the package contents:
20
-
21
- ```bash
22
- tar -tf codemini-cli-0.5.5.tgz
23
- ```
24
-
25
- ## 2. Copy To The Target Machine
26
-
27
- Copy the generated `.tgz` file to the Win10 machine by one of these methods:
28
-
29
- - company internal file share
30
- - USB drive
31
- - secure artifact repository
32
- - SCP or similar internal transfer tool
33
-
34
- Recommended target path:
35
-
36
- ```powershell
37
- C:\temp\codemini-cli-0.5.5.tgz
38
- ```
39
-
40
- ## 3. Environment Requirements
41
-
42
- Target machine requirements:
43
-
44
- - Windows 10
45
- - Node.js 22 or newer
46
- - npm available
47
- - PowerShell available
48
-
49
- Check:
50
-
51
- ```powershell
52
- node -v
53
- npm -v
54
- ```
55
-
56
- ## 4. Install From TGZ
57
-
58
- Global install:
59
-
60
- ```powershell
61
- npm install -g C:\temp\codemini-cli-0.5.5.tgz
62
- ```
63
-
64
- If global install is blocked by company policy, install in a working directory instead:
65
-
66
- ```powershell
67
- mkdir C:\temp\coder-test
68
- cd C:\temp\coder-test
69
- npm install C:\temp\codemini-cli-0.5.5.tgz
70
- ```
71
-
72
- ## 5. Confirm Installation
73
-
74
- If installed globally:
75
-
76
- ```powershell
77
- codemini --help
78
- ```
79
-
80
- If installed locally without global bin exposure:
81
-
82
- ```powershell
83
- npx codemini --help
84
- ```
85
-
86
- Or:
87
-
88
- ```powershell
89
- node .\node_modules\codemini-cli\bin\coder.js --help
90
- ```
91
-
92
- ## 6. Initial Configuration
93
-
94
- Set your internal gateway, key, model, and shell:
95
-
96
- ```powershell
97
- codemini config set gateway.base_url https://your-internal-gateway/v1
98
- codemini config set gateway.api_key your_token
99
- codemini config set model.name your_model_id
100
- codemini config set model.max_context_tokens 32768
101
- codemini config set shell.default powershell
102
- ```
103
-
104
- Optional but recommended:
105
-
106
- ```powershell
107
- codemini config set gateway.timeout_ms 180000
108
- codemini config set gateway.max_retries 2
109
- ```
110
-
111
- Check current config:
112
-
113
- ```powershell
114
- codemini config list
115
- ```
116
-
117
- ## 7. Smoke Test
118
-
119
- Run the built-in environment check:
120
-
121
- ```powershell
122
- codemini doctor
123
- ```
124
-
125
- Then launch the TUI:
126
-
127
- ```powershell
128
- codemini
129
- ```
130
-
131
- Inside the TUI, test these:
132
-
133
- ```text
134
- /config list
135
- /history list
136
- /spec 写一个Win10内部CLI权限规范
137
- /plan from-spec
138
- 帮我创建一个 hello.js
139
- 读取 hello.js
140
- ```
141
-
142
- ## 8. Installed Data Locations
143
-
144
- Project-scoped data:
145
-
146
- ```text
147
- .coder\
148
- ```
149
-
150
- Global user/tool data on Win10:
151
-
152
- ```text
153
- %APPDATA%\codemini-cli\
154
- ```
155
-
156
- Typical contents:
157
-
158
- - `config.json`
159
- - `sessions\`
160
- - `skills\`
161
- - project skills are stored per workspace under `.codemini\skills\`
162
- - `input-history.json`
163
-
164
- ## 9. Skills
165
-
166
- List installed skills:
167
-
168
- ```powershell
169
- codemini skill list
170
- ```
171
-
172
- Install a local skill into the current project:
173
-
174
- ```powershell
175
- codemini skill install C:\path\to\skill-folder
176
- ```
177
-
178
- Install a local skill globally:
179
-
180
- ```powershell
181
- codemini skill install --scope=global C:\path\to\skill-folder
182
- ```
183
-
184
- Rebuild the global registry:
185
-
186
- ```powershell
187
- codemini skill reindex
188
- ```
189
-
190
- ## 10. Uninstall
191
-
192
- Global uninstall:
193
-
194
- ```powershell
195
- npm uninstall -g codemini-cli
196
- ```
197
-
198
- Local uninstall inside a test directory:
199
-
200
- ```powershell
201
- npm uninstall codemini-cli
202
- ```
203
-
204
- ## 11. Known Limitation
205
-
206
- This `.tgz` package is suitable for package distribution, but it is not a fully self-contained offline dependency bundle.
207
-
208
- If the target machine is completely air-gapped and does not already have the required npm dependencies available, prepare one of these instead:
209
-
210
- - a tested `node_modules` bundle
211
- - a company internal npm mirror
212
- - a dedicated offline installer bundle
1
+ # Deployment Guide
2
+
3
+ This document describes how to package, copy, install, configure, and verify `codemini-cli` from a `.tgz` file.
4
+
5
+ ## 1. Build The TGZ Package
6
+
7
+ Run this in the project root on the packaging machine:
8
+
9
+ ```bash
10
+ npm pack
11
+ ```
12
+
13
+ Expected output:
14
+
15
+ ```text
16
+ codemini-cli-0.5.5.tgz
17
+ ```
18
+
19
+ If you want to verify the package contents:
20
+
21
+ ```bash
22
+ tar -tf codemini-cli-0.5.5.tgz
23
+ ```
24
+
25
+ ## 2. Copy To The Target Machine
26
+
27
+ Copy the generated `.tgz` file to the Win10 machine by one of these methods:
28
+
29
+ - company internal file share
30
+ - USB drive
31
+ - secure artifact repository
32
+ - SCP or similar internal transfer tool
33
+
34
+ Recommended target path:
35
+
36
+ ```powershell
37
+ C:\temp\codemini-cli-0.5.5.tgz
38
+ ```
39
+
40
+ ## 3. Environment Requirements
41
+
42
+ Target machine requirements:
43
+
44
+ - Windows 10
45
+ - Node.js 22 or newer
46
+ - npm available
47
+ - PowerShell available
48
+
49
+ Check:
50
+
51
+ ```powershell
52
+ node -v
53
+ npm -v
54
+ ```
55
+
56
+ ## 4. Install From TGZ
57
+
58
+ Global install:
59
+
60
+ ```powershell
61
+ npm install -g C:\temp\codemini-cli-0.5.5.tgz
62
+ ```
63
+
64
+ If global install is blocked by company policy, install in a working directory instead:
65
+
66
+ ```powershell
67
+ mkdir C:\temp\coder-test
68
+ cd C:\temp\coder-test
69
+ npm install C:\temp\codemini-cli-0.5.5.tgz
70
+ ```
71
+
72
+ ## 5. Confirm Installation
73
+
74
+ If installed globally:
75
+
76
+ ```powershell
77
+ codemini --help
78
+ ```
79
+
80
+ If installed locally without global bin exposure:
81
+
82
+ ```powershell
83
+ npx codemini --help
84
+ ```
85
+
86
+ Or:
87
+
88
+ ```powershell
89
+ node .\node_modules\codemini-cli\bin\coder.js --help
90
+ ```
91
+
92
+ ## 6. Initial Configuration
93
+
94
+ Set your internal gateway, key, model, and shell:
95
+
96
+ ```powershell
97
+ codemini config set gateway.base_url https://your-internal-gateway/v1
98
+ codemini config set gateway.api_key your_token
99
+ codemini config set model.name your_model_id
100
+ codemini config set model.max_context_tokens 32768
101
+ codemini config set shell.default powershell
102
+ ```
103
+
104
+ Optional but recommended:
105
+
106
+ ```powershell
107
+ codemini config set gateway.timeout_ms 180000
108
+ codemini config set gateway.max_retries 2
109
+ ```
110
+
111
+ Check current config:
112
+
113
+ ```powershell
114
+ codemini config list
115
+ ```
116
+
117
+ ## 7. Smoke Test
118
+
119
+ Run the built-in environment check:
120
+
121
+ ```powershell
122
+ codemini doctor
123
+ ```
124
+
125
+ Then launch the TUI:
126
+
127
+ ```powershell
128
+ codemini
129
+ ```
130
+
131
+ Inside the TUI, test these:
132
+
133
+ ```text
134
+ /config list
135
+ /history list
136
+ /spec 写一个Win10内部CLI权限规范
137
+ /plan from-spec
138
+ 帮我创建一个 hello.js
139
+ 读取 hello.js
140
+ ```
141
+
142
+ ## 8. Installed Data Locations
143
+
144
+ Project-scoped data:
145
+
146
+ ```text
147
+ .coder\
148
+ ```
149
+
150
+ Global user/tool data on Win10:
151
+
152
+ ```text
153
+ %APPDATA%\codemini-cli\
154
+ ```
155
+
156
+ Typical contents:
157
+
158
+ - `config.json`
159
+ - `sessions\`
160
+ - `skills\`
161
+ - project skills are stored per workspace under `.codemini\skills\`
162
+ - `input-history.json`
163
+
164
+ ## 9. Skills
165
+
166
+ List installed skills:
167
+
168
+ ```powershell
169
+ codemini skill list
170
+ ```
171
+
172
+ Install a local skill into the current project:
173
+
174
+ ```powershell
175
+ codemini skill install C:\path\to\skill-folder
176
+ ```
177
+
178
+ Install a local skill globally:
179
+
180
+ ```powershell
181
+ codemini skill install --scope=global C:\path\to\skill-folder
182
+ ```
183
+
184
+ Rebuild the global registry:
185
+
186
+ ```powershell
187
+ codemini skill reindex
188
+ ```
189
+
190
+ ## 10. Uninstall
191
+
192
+ Global uninstall:
193
+
194
+ ```powershell
195
+ npm uninstall -g codemini-cli
196
+ ```
197
+
198
+ Local uninstall inside a test directory:
199
+
200
+ ```powershell
201
+ npm uninstall codemini-cli
202
+ ```
203
+
204
+ ## 11. Known Limitation
205
+
206
+ This `.tgz` package is suitable for package distribution, but it is not a fully self-contained offline dependency bundle.
207
+
208
+ If the target machine is completely air-gapped and does not already have the required npm dependencies available, prepare one of these instead:
209
+
210
+ - a tested `node_modules` bundle
211
+ - a company internal npm mirror
212
+ - a dedicated offline installer bundle
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codemini-cli",
3
- "version": "0.5.9",
3
+ "version": "0.5.11",
4
4
  "description": "Coding CLI optimized for small-model workflows and Windows PowerShell",
5
5
  "keywords": [
6
6
  "cli",
@@ -1,72 +1,77 @@
1
- ---
2
- name: brainstorm
3
- description: Lightweight brainstorming skill. Use when a feature or behavior request has multiple reasonable approaches and the missing piece is user preference, tradeoff choice, or key constraint.
4
- version: 0.2.0
5
- ---
6
-
7
- Use this skill only when the task needs clarification or option comparison before coding.
8
-
9
- **Announce:** When entering brainstorm, say "Using brainstorm to explore approaches before implementation."
10
-
11
- ## Anti-Pattern
12
-
13
- Do NOT skip this skill for tasks that appear straightforward but lack clear requirements or constraints. Underspecified tasks cause the most wasted work. Even a few seconds of clarification beats a wrong implementation.
14
-
15
- ## Process
16
-
17
- 1. **Ask one question at a time.** If a key uncertainty remains, ask the next best question and STOP. Wait for the user's answer.
18
- 2. **Give 2-3 short options** only when the blocking constraint is already clear. Keep options concrete and focused on the main tradeoff.
19
- 3. **Present conclusions as suggested decisions**, not final choices.
20
- 4. **Do NOT write code, pseudo-code, file edits, or broad repo exploration** while direction is still being chosen.
21
-
22
- ## Output Formats
23
-
24
- ### Mode A: key constraint missing
25
-
26
- ```
27
- Question:
28
- - ask: <one specific question>
29
- - why this matters: <1-2 sentences on what this decides>
30
- ```
31
-
32
- Wait for the user's answer. Do NOT proceed with options or code.
33
-
34
- ### Mode B: goal is clear but approach choice remains
35
-
36
- ```
37
- Option 1:
38
- - idea: <concrete approach>
39
- - pros: <1-2 points>
40
- - cons: <1-2 points>
41
-
42
- Option 2:
43
- - idea: <concrete approach>
44
- - pros: <1-2 points>
45
- - cons: <1-2 points>
46
-
47
- Option 3 (optional):
48
- - idea: <concrete approach>
49
- - pros: <1-2 points>
50
- - cons: <1-2 points>
51
-
52
- Suggested decision:
53
- - recommended: <option N>
54
- - reason: <why>
55
- ```
56
-
57
- ## Self-Review
58
-
59
- Before presenting options or a suggested decision, quickly check:
60
-
61
- - Are all options actually different, or are two of them the same idea in different words?
62
- - Does the recommended option match the user's stated constraints?
63
- - Did I invent requirements the user never mentioned? Remove them.
64
-
65
- ## Exit
66
-
67
- After the user approves a direction:
68
-
69
- - If the task is small and clear enough to implement directly → proceed to code.
70
- - If the task is non-trivial or touches multiple areas YOU MUST invoke `writing-plans` to create an implementation plan before coding.
71
-
72
- Do NOT stop at the brainstorm conclusion when the natural next step is planning.
1
+ ---
2
+ name: brainstorm
3
+ description: Lightweight brainstorming skill. Use when a feature or behavior request has multiple reasonable approaches and the missing piece is user preference, tradeoff choice, or key constraint.
4
+ version: 0.2.1
5
+ ---
6
+
7
+ Use this skill only when the task needs clarification or option comparison before coding.
8
+
9
+ **Announce:** When entering brainstorm, say "Using brainstorm to explore approaches before implementation."
10
+
11
+ ## Anti-Pattern
12
+
13
+ Do NOT skip this skill for tasks that appear straightforward but lack clear requirements or constraints. Underspecified tasks cause the most wasted work. Even a few seconds of clarification beats a wrong implementation.
14
+
15
+ ## Process
16
+
17
+ 1. **Ask one question at a time.** If a key uncertainty remains, ask the next best question and STOP. Wait for the user's answer.
18
+ 2. **Give 2-3 short options** only when the blocking constraint is already clear. Keep options concrete and focused on the main tradeoff.
19
+ 3. **Present conclusions as suggested decisions**, not final choices.
20
+ 4. **Do NOT write code, pseudo-code, file edits, or broad repo exploration** while direction is still being chosen.
21
+ 5. **Stop after your brainstorm response.** Do not say "I will start", "starting now", "I'll edit", or otherwise transition into implementation in the same turn.
22
+
23
+ ## Output Formats
24
+
25
+ ### Mode A: key constraint missing
26
+
27
+ ```
28
+ Question:
29
+ - ask: <one specific question>
30
+ - why this matters: <1-2 sentences on what this decides>
31
+ ```
32
+
33
+ Wait for the user's answer. Do NOT proceed with options or code.
34
+
35
+ ### Mode B: goal is clear but approach choice remains
36
+
37
+ ```
38
+ Option 1:
39
+ - idea: <concrete approach>
40
+ - pros: <1-2 points>
41
+ - cons: <1-2 points>
42
+
43
+ Option 2:
44
+ - idea: <concrete approach>
45
+ - pros: <1-2 points>
46
+ - cons: <1-2 points>
47
+
48
+ Option 3 (optional):
49
+ - idea: <concrete approach>
50
+ - pros: <1-2 points>
51
+ - cons: <1-2 points>
52
+
53
+ Suggested decision:
54
+ - recommended: <option N>
55
+ - reason: <why>
56
+ ```
57
+
58
+ After Mode B, STOP. Wait for the user to approve, reject, or revise the suggested decision.
59
+
60
+ ## Self-Review
61
+
62
+ Before presenting options or a suggested decision, quickly check:
63
+
64
+ - Are all options actually different, or are two of them the same idea in different words?
65
+ - Does the recommended option match the user's stated constraints?
66
+ - Did I invent requirements the user never mentioned? Remove them.
67
+
68
+ ## Exit
69
+
70
+ Brainstorm ends only when the user sends a later message that clearly approves a direction, for example "use option 2", "按这个做", "确认,开始实现", or "直接写代码".
71
+
72
+ After that later user approval:
73
+
74
+ - If the task is small and clear enough to implement directly → proceed to code.
75
+ - If the task is non-trivial or touches multiple areas → YOU MUST invoke `writing-plans` to create an implementation plan before coding.
76
+
77
+ Do NOT treat your own suggested decision as approval. Do NOT continue from the brainstorm conclusion into planning or implementation until the user has explicitly approved a direction in a separate message.
@@ -1,40 +1,40 @@
1
- {
2
- "version": 1,
3
- "skills": {
4
- "superpowers-lite": {
5
- "description": "Default concise workflow for coding tasks; keep context tight, choose the right route, and verify before claiming success.",
6
- "mode": "always",
7
- "triggers": [],
8
- "enabled": true,
9
- "priority": 100
10
- },
11
- "brainstorm": {
12
- "description": "Use when a feature or behavior request has multiple reasonable approaches and the missing piece is user preference, tradeoff choice, or key constraint.",
13
- "mode": "agent_requested",
14
- "triggers": [],
15
- "enabled": true,
16
- "priority": 70
17
- },
18
- "writing-plans": {
19
- "description": "Use when you have a clear goal or approved design for a non-trivial task, before touching code.",
20
- "mode": "agent_requested",
21
- "triggers": [],
22
- "enabled": true,
23
- "priority": 75
24
- },
25
- "grill-me": {
26
- "description": "Use when the user explicitly asks to pressure-test a plan, architecture choice, PR, launch, or product idea.",
27
- "mode": "agent_requested",
28
- "triggers": [],
29
- "enabled": true,
30
- "priority": 65
31
- },
32
- "project-requirements": {
33
- "description": "Create a project requirements report with repository inspection and structured output artifacts.",
34
- "mode": "manual",
35
- "triggers": [],
36
- "enabled": true,
37
- "priority": 50
38
- }
39
- }
40
- }
1
+ {
2
+ "version": 1,
3
+ "skills": {
4
+ "superpowers-lite": {
5
+ "description": "Default concise workflow for coding tasks; keep context tight, choose the right route, and verify before claiming success.",
6
+ "mode": "always",
7
+ "triggers": [],
8
+ "enabled": true,
9
+ "priority": 100
10
+ },
11
+ "brainstorm": {
12
+ "description": "Use when a feature or behavior request has multiple reasonable approaches and the missing piece is user preference, tradeoff choice, or key constraint.",
13
+ "mode": "agent_requested",
14
+ "triggers": [],
15
+ "enabled": true,
16
+ "priority": 70
17
+ },
18
+ "writing-plans": {
19
+ "description": "Use when you have a clear goal or approved design for a non-trivial task, before touching code.",
20
+ "mode": "agent_requested",
21
+ "triggers": [],
22
+ "enabled": true,
23
+ "priority": 75
24
+ },
25
+ "grill-me": {
26
+ "description": "Use when the user explicitly asks to pressure-test a plan, architecture choice, PR, launch, or product idea.",
27
+ "mode": "agent_requested",
28
+ "triggers": [],
29
+ "enabled": true,
30
+ "priority": 65
31
+ },
32
+ "project-requirements": {
33
+ "description": "Create a project requirements report with repository inspection and structured output artifacts.",
34
+ "mode": "manual",
35
+ "triggers": [],
36
+ "enabled": true,
37
+ "priority": 50
38
+ }
39
+ }
40
+ }