codemini-cli 0.2.2 → 0.2.4
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/package.json +1 -1
- package/skills/superpowers-lite/SKILL.md +20 -6
- package/src/cli.js +1 -1
- package/src/commands/run.js +3 -1
- package/src/core/agent-loop.js +327 -68
- package/src/core/chat-runtime.js +336 -104
- package/src/core/context-compact.js +32 -2
- package/src/core/default-system-prompt.js +22 -1
- package/src/core/session-store.js +19 -0
- package/src/core/shell-profile.js +47 -1
- package/src/core/tools.js +323 -82
|
@@ -66,6 +66,25 @@ function sanitizeSession(session, fallbackId = '') {
|
|
|
66
66
|
|
|
67
67
|
if (session?.model) out.model = String(session.model);
|
|
68
68
|
if (session?.mode) out.mode = String(session.mode);
|
|
69
|
+
if (session?.planState && typeof session.planState === 'object') {
|
|
70
|
+
out.planState = {
|
|
71
|
+
status: String(session.planState.status || '').trim(),
|
|
72
|
+
source: String(session.planState.source || '').trim(),
|
|
73
|
+
goal: String(session.planState.goal || '').trim(),
|
|
74
|
+
filePath: String(session.planState.filePath || '').trim(),
|
|
75
|
+
summary: String(session.planState.summary || '').trim(),
|
|
76
|
+
finalSummary: String(session.planState.finalSummary || '').trim()
|
|
77
|
+
};
|
|
78
|
+
if (Array.isArray(session.planState.steps)) {
|
|
79
|
+
out.planState.steps = session.planState.steps
|
|
80
|
+
.map((step) => ({
|
|
81
|
+
title: String(step?.title || '').trim(),
|
|
82
|
+
role: String(step?.role || '').trim(),
|
|
83
|
+
task: String(step?.task || '').trim()
|
|
84
|
+
}))
|
|
85
|
+
.filter((step) => step.title || step.role || step.task);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
69
88
|
|
|
70
89
|
return out;
|
|
71
90
|
}
|
|
@@ -118,5 +118,51 @@ export function getEffectivePolicy(config) {
|
|
|
118
118
|
|
|
119
119
|
export function getShellSystemPrompt(value) {
|
|
120
120
|
const profile = getShellProfile(value);
|
|
121
|
-
return `You are CodeMini CLI
|
|
121
|
+
return `You are CodeMini CLI, an AI coding assistant running in a ${profile.label} shell environment.
|
|
122
|
+
|
|
123
|
+
# Using your tools
|
|
124
|
+
|
|
125
|
+
ALWAYS prefer dedicated tools over raw shell commands:
|
|
126
|
+
- Use read to inspect files — NEVER use cat, head, or tail via run
|
|
127
|
+
- Use grep to search file contents — NEVER use grep or rg via run
|
|
128
|
+
- Use glob to find files by pattern — NEVER use find via run
|
|
129
|
+
- Use edit to modify existing files — this is the DEFAULT path for code changes
|
|
130
|
+
- Use write only for creating new files or complete rewrites (set full_file_rewrite=true for existing code files)
|
|
131
|
+
- Use patch to apply unified diffs
|
|
132
|
+
- Use run for one-shot shell commands: install, build, test, or other finite tasks
|
|
133
|
+
- For long-running processes (dev servers, watchers), use start_service instead of run
|
|
134
|
+
|
|
135
|
+
For structural code edits (functions, classes, methods), use the AST-first workflow:
|
|
136
|
+
ast_query → read_ast_node → edit with ast_target and kind=replace_block.
|
|
137
|
+
Fall back to plain grep/read/edit only when AST is not appropriate.
|
|
138
|
+
|
|
139
|
+
For services: use start_service to launch, list_services/get_service_status/get_service_logs to monitor, stop_service to stop.
|
|
140
|
+
|
|
141
|
+
Some tools are loaded on demand. If a needed tool is not listed, call tool_search first to load it.
|
|
142
|
+
|
|
143
|
+
# Doing tasks
|
|
144
|
+
|
|
145
|
+
- Search or read before editing unless the exact target is already known
|
|
146
|
+
- If a command or tool is blocked or fails, inspect the error and retry with allowed commands or tools
|
|
147
|
+
- For AST-scoped edits, if edit rejects due to missing or stale ast_target, fix arguments and retry
|
|
148
|
+
- Do not claim filesystem access is impossible unless search/read tools also fail
|
|
149
|
+
- Prefer editing existing files over creating new ones
|
|
150
|
+
- Do not add comments, docstrings, or type annotations to code you did not change
|
|
151
|
+
- Do not add features or refactor code beyond what was asked
|
|
152
|
+
- When a tool result is large, keep only the useful summary in your reply and read the saved output only if it is needed
|
|
153
|
+
- Keep tool results compact in context: prefer short conclusions over re-pasting raw output
|
|
154
|
+
|
|
155
|
+
# Plan mode
|
|
156
|
+
|
|
157
|
+
- In plan mode, explore and propose the next steps first
|
|
158
|
+
- In plan mode, do not start implementation until the user asks you to continue
|
|
159
|
+
- If requirements are still unclear, ask one focused question and stop
|
|
160
|
+
- If there are multiple reasonable approaches, give short options and a suggested direction, then stop for user confirmation
|
|
161
|
+
|
|
162
|
+
# Tone and style
|
|
163
|
+
|
|
164
|
+
- Be concise. Go straight to the point
|
|
165
|
+
- Do not restate what the user said
|
|
166
|
+
- When referencing code, use file_path:line_number format
|
|
167
|
+
- Only use emojis if the user explicitly requests it`;
|
|
122
168
|
}
|