codemini-cli 0.5.10 → 0.5.12
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/OPERATIONS.md +242 -242
- package/README.md +588 -588
- package/codemini-web/dist/assets/{highlighted-body-OFNGDK62-7HL7yft8.js → highlighted-body-OFNGDK62-B-G99D0A.js} +1 -1
- package/codemini-web/dist/assets/{index-BK75hMb2.js → index-DIGUEzan.js} +108 -108
- package/codemini-web/dist/assets/index-Dkq1DdDX.css +2 -0
- package/codemini-web/dist/assets/mermaid-GHXKKRXX-va2Kl89u.js +1 -0
- package/codemini-web/dist/index.html +35 -23
- package/codemini-web/lib/approval-manager.js +32 -32
- package/codemini-web/lib/runtime-bridge.js +17 -11
- package/codemini-web/server.js +534 -205
- package/deployment.md +212 -212
- package/package.json +2 -2
- package/skills/brainstorm/SKILL.md +77 -77
- package/skills/codemini.skills.json +40 -40
- package/skills/grill-me/SKILL.md +30 -30
- package/skills/superpowers-lite/SKILL.md +82 -82
- package/src/cli.js +74 -74
- package/src/commands/chat.js +210 -210
- package/src/commands/run.js +313 -313
- package/src/commands/skill.js +438 -304
- package/src/commands/web.js +57 -57
- package/src/core/agent-loop.js +980 -980
- package/src/core/ast.js +309 -307
- package/src/core/chat-runtime.js +6261 -6253
- package/src/core/command-evaluator.js +72 -72
- package/src/core/command-loader.js +311 -311
- package/src/core/command-policy.js +301 -301
- package/src/core/command-risk.js +156 -156
- package/src/core/config-store.js +286 -285
- package/src/core/constants.js +18 -1
- package/src/core/context-compact.js +365 -365
- package/src/core/default-system-prompt.js +114 -107
- package/src/core/dream-audit.js +105 -105
- package/src/core/dream-consolidate.js +229 -229
- package/src/core/dream-evaluator.js +185 -185
- package/src/core/fff-adapter.js +383 -383
- package/src/core/memory-store.js +543 -543
- package/src/core/project-index.js +737 -548
- package/src/core/project-instructions.js +98 -98
- package/src/core/provider/anthropic.js +514 -514
- package/src/core/provider/openai-compatible.js +501 -501
- package/src/core/reflect-skill.js +178 -178
- package/src/core/reply-language.js +40 -40
- package/src/core/session-store.js +474 -474
- package/src/core/shell-profile.js +237 -237
- package/src/core/shell.js +323 -323
- package/src/core/soul.js +69 -69
- package/src/core/system-prompt-composer.js +52 -52
- package/src/core/tool-args.js +199 -154
- package/src/core/tool-output.js +184 -184
- package/src/core/tool-result-store.js +206 -206
- package/src/core/tools.js +3024 -2893
- package/src/core/version.js +11 -11
- package/src/tui/chat-app.js +5173 -5171
- package/src/tui/tool-activity/presenters/misc.js +30 -30
- package/src/tui/tool-activity/presenters/system.js +20 -20
- package/templates/project-requirements/report-shell.html +582 -582
- package/codemini-web/dist/assets/index-BSdIdn3L.css +0 -2
- package/codemini-web/dist/assets/mermaid-GHXKKRXX-Dg9qh8mg.js +0 -1
|
@@ -1,98 +1,98 @@
|
|
|
1
|
-
import fs from 'node:fs/promises';
|
|
2
|
-
import path from 'node:path';
|
|
3
|
-
|
|
4
|
-
const DEFAULT_MAX_CHARS = 12000;
|
|
5
|
-
const CANDIDATE_FILES = [
|
|
6
|
-
'AGENTS.md',
|
|
7
|
-
path.join('.agents', 'AGENTS.md'),
|
|
8
|
-
path.join('.agents', 'agents.md'),
|
|
9
|
-
path.join('.codemini', 'AGENTS.md'),
|
|
10
|
-
'CLAUDE.md'
|
|
11
|
-
];
|
|
12
|
-
|
|
13
|
-
function trimProjectInstructions(value, maxChars = DEFAULT_MAX_CHARS) {
|
|
14
|
-
const text = String(value || '').trim();
|
|
15
|
-
if (!text) return '';
|
|
16
|
-
const limit = Math.max(1000, Number(maxChars) || DEFAULT_MAX_CHARS);
|
|
17
|
-
if (text.length <= limit) return text;
|
|
18
|
-
return `${text.slice(0, limit - 120).trimEnd()}\n\n[Project instructions truncated: keep AGENTS.md concise or move details into linked docs.]`;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
async function readFirstExistingFile(cwd, candidates = CANDIDATE_FILES) {
|
|
22
|
-
let current = path.resolve(cwd);
|
|
23
|
-
while (true) {
|
|
24
|
-
for (const candidate of candidates) {
|
|
25
|
-
const absolutePath = path.resolve(current, candidate);
|
|
26
|
-
let stat;
|
|
27
|
-
try {
|
|
28
|
-
stat = await fs.stat(absolutePath);
|
|
29
|
-
} catch {
|
|
30
|
-
continue;
|
|
31
|
-
}
|
|
32
|
-
if (!stat?.isFile()) continue;
|
|
33
|
-
const content = await fs.readFile(absolutePath, 'utf8');
|
|
34
|
-
const relativePath = path.relative(cwd, absolutePath) || candidate;
|
|
35
|
-
return {
|
|
36
|
-
path: absolutePath,
|
|
37
|
-
relativePath: relativePath.split(path.sep).join('/'),
|
|
38
|
-
content
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
const parent = path.dirname(current);
|
|
42
|
-
if (parent === current) break;
|
|
43
|
-
current = parent;
|
|
44
|
-
}
|
|
45
|
-
return null;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export async function loadProjectInstructions({
|
|
49
|
-
cwd = process.cwd(),
|
|
50
|
-
config = {},
|
|
51
|
-
maxChars = config?.context?.project_instructions_max_chars
|
|
52
|
-
} = {}) {
|
|
53
|
-
const enabled = config?.context?.project_instructions_enabled !== false;
|
|
54
|
-
if (!enabled) return '';
|
|
55
|
-
|
|
56
|
-
const found = await readFirstExistingFile(cwd);
|
|
57
|
-
if (!found) return '';
|
|
58
|
-
|
|
59
|
-
const body = trimProjectInstructions(found.content, maxChars);
|
|
60
|
-
if (!body) return '';
|
|
61
|
-
|
|
62
|
-
return [
|
|
63
|
-
'Project Instructions:',
|
|
64
|
-
`Source: ${found.relativePath}`,
|
|
65
|
-
body
|
|
66
|
-
].join('\n');
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export function buildDefaultAgentsMd() {
|
|
70
|
-
return `# AGENTS.md
|
|
71
|
-
|
|
72
|
-
This file gives coding agents stable project instructions. Keep it short and use it as a map, not as full documentation.
|
|
73
|
-
|
|
74
|
-
## Project
|
|
75
|
-
|
|
76
|
-
- Describe what this repository is and the main runtime or product surface.
|
|
77
|
-
- Note required runtime versions and package managers.
|
|
78
|
-
|
|
79
|
-
## Commands
|
|
80
|
-
|
|
81
|
-
- Install: \`npm install\`
|
|
82
|
-
- Test: \`npm test\`
|
|
83
|
-
- Build: add the project build command here.
|
|
84
|
-
|
|
85
|
-
## Task Routing
|
|
86
|
-
|
|
87
|
-
- CLI or command behavior: list the entry files here.
|
|
88
|
-
- Runtime behavior: list the core runtime files here.
|
|
89
|
-
- Web UI behavior: list the server, state, and component roots here.
|
|
90
|
-
- Tests: list focused test files for common changes.
|
|
91
|
-
|
|
92
|
-
## Rules
|
|
93
|
-
|
|
94
|
-
- Use project/file indexes for orientation, then inspect real source files before editing.
|
|
95
|
-
- Keep generated output and build artifacts out of manual edits.
|
|
96
|
-
- Put reusable workflows in skills; put always-needed project facts and routing rules here.
|
|
97
|
-
`;
|
|
98
|
-
}
|
|
1
|
+
import fs from 'node:fs/promises';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
|
|
4
|
+
const DEFAULT_MAX_CHARS = 12000;
|
|
5
|
+
const CANDIDATE_FILES = [
|
|
6
|
+
'AGENTS.md',
|
|
7
|
+
path.join('.agents', 'AGENTS.md'),
|
|
8
|
+
path.join('.agents', 'agents.md'),
|
|
9
|
+
path.join('.codemini', 'AGENTS.md'),
|
|
10
|
+
'CLAUDE.md'
|
|
11
|
+
];
|
|
12
|
+
|
|
13
|
+
function trimProjectInstructions(value, maxChars = DEFAULT_MAX_CHARS) {
|
|
14
|
+
const text = String(value || '').trim();
|
|
15
|
+
if (!text) return '';
|
|
16
|
+
const limit = Math.max(1000, Number(maxChars) || DEFAULT_MAX_CHARS);
|
|
17
|
+
if (text.length <= limit) return text;
|
|
18
|
+
return `${text.slice(0, limit - 120).trimEnd()}\n\n[Project instructions truncated: keep AGENTS.md concise or move details into linked docs.]`;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
async function readFirstExistingFile(cwd, candidates = CANDIDATE_FILES) {
|
|
22
|
+
let current = path.resolve(cwd);
|
|
23
|
+
while (true) {
|
|
24
|
+
for (const candidate of candidates) {
|
|
25
|
+
const absolutePath = path.resolve(current, candidate);
|
|
26
|
+
let stat;
|
|
27
|
+
try {
|
|
28
|
+
stat = await fs.stat(absolutePath);
|
|
29
|
+
} catch {
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
if (!stat?.isFile()) continue;
|
|
33
|
+
const content = await fs.readFile(absolutePath, 'utf8');
|
|
34
|
+
const relativePath = path.relative(cwd, absolutePath) || candidate;
|
|
35
|
+
return {
|
|
36
|
+
path: absolutePath,
|
|
37
|
+
relativePath: relativePath.split(path.sep).join('/'),
|
|
38
|
+
content
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
const parent = path.dirname(current);
|
|
42
|
+
if (parent === current) break;
|
|
43
|
+
current = parent;
|
|
44
|
+
}
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export async function loadProjectInstructions({
|
|
49
|
+
cwd = process.cwd(),
|
|
50
|
+
config = {},
|
|
51
|
+
maxChars = config?.context?.project_instructions_max_chars
|
|
52
|
+
} = {}) {
|
|
53
|
+
const enabled = config?.context?.project_instructions_enabled !== false;
|
|
54
|
+
if (!enabled) return '';
|
|
55
|
+
|
|
56
|
+
const found = await readFirstExistingFile(cwd);
|
|
57
|
+
if (!found) return '';
|
|
58
|
+
|
|
59
|
+
const body = trimProjectInstructions(found.content, maxChars);
|
|
60
|
+
if (!body) return '';
|
|
61
|
+
|
|
62
|
+
return [
|
|
63
|
+
'Project Instructions:',
|
|
64
|
+
`Source: ${found.relativePath}`,
|
|
65
|
+
body
|
|
66
|
+
].join('\n');
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export function buildDefaultAgentsMd() {
|
|
70
|
+
return `# AGENTS.md
|
|
71
|
+
|
|
72
|
+
This file gives coding agents stable project instructions. Keep it short and use it as a map, not as full documentation.
|
|
73
|
+
|
|
74
|
+
## Project
|
|
75
|
+
|
|
76
|
+
- Describe what this repository is and the main runtime or product surface.
|
|
77
|
+
- Note required runtime versions and package managers.
|
|
78
|
+
|
|
79
|
+
## Commands
|
|
80
|
+
|
|
81
|
+
- Install: \`npm install\`
|
|
82
|
+
- Test: \`npm test\`
|
|
83
|
+
- Build: add the project build command here.
|
|
84
|
+
|
|
85
|
+
## Task Routing
|
|
86
|
+
|
|
87
|
+
- CLI or command behavior: list the entry files here.
|
|
88
|
+
- Runtime behavior: list the core runtime files here.
|
|
89
|
+
- Web UI behavior: list the server, state, and component roots here.
|
|
90
|
+
- Tests: list focused test files for common changes.
|
|
91
|
+
|
|
92
|
+
## Rules
|
|
93
|
+
|
|
94
|
+
- Use project/file indexes for orientation, then inspect real source files before editing.
|
|
95
|
+
- Keep generated output and build artifacts out of manual edits.
|
|
96
|
+
- Put reusable workflows in skills; put always-needed project facts and routing rules here.
|
|
97
|
+
`;
|
|
98
|
+
}
|