@mthanhlm/autodev 0.4.3 → 0.4.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/.claude-plugin/plugin.json +1 -1
- package/README.md +13 -0
- package/autodev/bin/autodev-tools.cjs +314 -69
- package/autodev/templates/project-state.md +2 -0
- package/autodev/templates/state.md +2 -0
- package/autodev/templates/track-state.md +2 -0
- package/autodev/workflows/autodev-auto.md +62 -0
- package/autodev/workflows/autodev.md +5 -1
- package/autodev/workflows/execute-phase.md +32 -15
- package/autodev/workflows/explore-codebase.md +5 -1
- package/autodev/workflows/help.md +4 -1
- package/autodev/workflows/new-project.md +9 -2
- package/autodev/workflows/plan-phase.md +11 -3
- package/autodev/workflows/review-phase.md +9 -2
- package/autodev/workflows/verify-work.md +17 -3
- package/bin/install.js +113 -23
- package/commands/autodev/auto.md +27 -0
- package/hooks/autodev-phase-boundary.sh +1 -1
- package/hooks/autodev-prompt-guard.js +26 -3
- package/hooks/autodev-read-guard.js +2 -2
- package/hooks/autodev-statusline.js +9 -4
- package/hooks/autodev-workflow-guard.js +1 -1
- package/hooks/hooks.json +4 -4
- package/package.json +1 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: autodev:auto
|
|
3
|
+
description: Run autodev continuously until blocked, manual verification is required, or the active track is done
|
|
4
|
+
argument-hint: "[goal, track, or question]"
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Write
|
|
8
|
+
- Edit
|
|
9
|
+
- Bash
|
|
10
|
+
- Grep
|
|
11
|
+
- Glob
|
|
12
|
+
- TodoWrite
|
|
13
|
+
- AskUserQuestion
|
|
14
|
+
- Agent
|
|
15
|
+
- WebFetch
|
|
16
|
+
---
|
|
17
|
+
<objective>
|
|
18
|
+
Use `/autodev-auto` as the explicit opt-in continuous runner. Keep going until the work is done or a real stop condition appears.
|
|
19
|
+
</objective>
|
|
20
|
+
|
|
21
|
+
<execution_context>
|
|
22
|
+
@~/.claude/autodev/workflows/autodev-auto.md
|
|
23
|
+
</execution_context>
|
|
24
|
+
|
|
25
|
+
<process>
|
|
26
|
+
Execute the auto router workflow in @~/.claude/autodev/workflows/autodev-auto.md end-to-end.
|
|
27
|
+
</process>
|
|
@@ -41,7 +41,7 @@ if [ "$ENABLED" != "1" ]; then
|
|
|
41
41
|
fi
|
|
42
42
|
|
|
43
43
|
INPUT=$(cat)
|
|
44
|
-
FILE=$(echo "$INPUT" | node -e "let d='';process.stdin.on('data',c=>d+=c);process.stdin.on('end',()=>{try{
|
|
44
|
+
FILE=$(echo "$INPUT" | node -e "let d='';process.stdin.on('data',c=>d+=c);process.stdin.on('end',()=>{try{const t=JSON.parse(d).tool_input||{};process.stdout.write(t.file_path||t.path||'')}catch{}})" 2>/dev/null)
|
|
45
45
|
|
|
46
46
|
if [[ "$FILE" == *.autodev/* ]] || [[ "$FILE" == .autodev/* ]]; then
|
|
47
47
|
echo ".autodev file updated: $FILE"
|
|
@@ -11,6 +11,29 @@ const PATTERNS = [
|
|
|
11
11
|
/<\/?(?:system|assistant|human)>/i
|
|
12
12
|
];
|
|
13
13
|
|
|
14
|
+
function extractWrittenContent(toolInput) {
|
|
15
|
+
if (!toolInput || typeof toolInput !== 'object') {
|
|
16
|
+
return '';
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
if (typeof toolInput.content === 'string' && toolInput.content) {
|
|
20
|
+
return toolInput.content;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (typeof toolInput.new_string === 'string' && toolInput.new_string) {
|
|
24
|
+
return toolInput.new_string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if (Array.isArray(toolInput.edits)) {
|
|
28
|
+
return toolInput.edits
|
|
29
|
+
.map(edit => edit?.new_string || '')
|
|
30
|
+
.filter(Boolean)
|
|
31
|
+
.join('\n');
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return '';
|
|
35
|
+
}
|
|
36
|
+
|
|
14
37
|
let input = '';
|
|
15
38
|
const stdinTimeout = setTimeout(() => process.exit(0), 3000);
|
|
16
39
|
process.stdin.setEncoding('utf8');
|
|
@@ -22,16 +45,16 @@ process.stdin.on('end', () => {
|
|
|
22
45
|
|
|
23
46
|
try {
|
|
24
47
|
const data = JSON.parse(input);
|
|
25
|
-
if (!['Write', 'Edit'].includes(data.tool_name)) {
|
|
48
|
+
if (!['Write', 'Edit', 'MultiEdit'].includes(data.tool_name)) {
|
|
26
49
|
process.exit(0);
|
|
27
50
|
}
|
|
28
51
|
|
|
29
|
-
const filePath = data.tool_input?.file_path || '';
|
|
52
|
+
const filePath = data.tool_input?.file_path || data.tool_input?.path || '';
|
|
30
53
|
if (!filePath.includes('.autodev/')) {
|
|
31
54
|
process.exit(0);
|
|
32
55
|
}
|
|
33
56
|
|
|
34
|
-
const content = data.tool_input
|
|
57
|
+
const content = extractWrittenContent(data.tool_input);
|
|
35
58
|
if (!content) {
|
|
36
59
|
process.exit(0);
|
|
37
60
|
}
|
|
@@ -15,7 +15,7 @@ process.stdin.on('end', () => {
|
|
|
15
15
|
|
|
16
16
|
try {
|
|
17
17
|
const data = JSON.parse(input);
|
|
18
|
-
if (!['Write', 'Edit'].includes(data.tool_name)) {
|
|
18
|
+
if (!['Write', 'Edit', 'MultiEdit'].includes(data.tool_name)) {
|
|
19
19
|
process.exit(0);
|
|
20
20
|
}
|
|
21
21
|
|
|
@@ -24,7 +24,7 @@ process.stdin.on('end', () => {
|
|
|
24
24
|
process.exit(0);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
const filePath = data.tool_input?.file_path || '';
|
|
27
|
+
const filePath = data.tool_input?.file_path || data.tool_input?.path || '';
|
|
28
28
|
if (!filePath || !fs.existsSync(filePath)) {
|
|
29
29
|
process.exit(0);
|
|
30
30
|
}
|
|
@@ -13,21 +13,25 @@ function readStateFields(cwd) {
|
|
|
13
13
|
if (!statePath) {
|
|
14
14
|
return {
|
|
15
15
|
currentTask: '',
|
|
16
|
-
currentTaskStatus: ''
|
|
16
|
+
currentTaskStatus: '',
|
|
17
|
+
runMode: ''
|
|
17
18
|
};
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
const content = fs.readFileSync(statePath, 'utf8');
|
|
21
22
|
const currentTask = content.match(/^Current Task:\s*(.+)$/mi)?.[1]?.trim() || '';
|
|
22
23
|
const currentTaskStatus = content.match(/^Current Task Status:\s*(.+)$/mi)?.[1]?.trim() || '';
|
|
24
|
+
const runMode = content.match(/^Run Mode:\s*(.+)$/mi)?.[1]?.trim() || '';
|
|
23
25
|
return {
|
|
24
26
|
currentTask: currentTask && currentTask !== 'none' ? currentTask : '',
|
|
25
|
-
currentTaskStatus: currentTaskStatus && currentTaskStatus !== 'idle' ? currentTaskStatus : ''
|
|
27
|
+
currentTaskStatus: currentTaskStatus && currentTaskStatus !== 'idle' ? currentTaskStatus : '',
|
|
28
|
+
runMode: runMode === 'auto' ? 'auto' : ''
|
|
26
29
|
};
|
|
27
30
|
} catch {
|
|
28
31
|
return {
|
|
29
32
|
currentTask: '',
|
|
30
|
-
currentTaskStatus: ''
|
|
33
|
+
currentTaskStatus: '',
|
|
34
|
+
runMode: ''
|
|
31
35
|
};
|
|
32
36
|
}
|
|
33
37
|
}
|
|
@@ -67,11 +71,12 @@ process.stdin.on('end', () => {
|
|
|
67
71
|
}
|
|
68
72
|
}
|
|
69
73
|
|
|
74
|
+
const modeLabel = taskState.runMode ? ` | ${taskState.runMode}` : '';
|
|
70
75
|
const taskLabel = taskState.currentTask
|
|
71
76
|
? ` | task ${taskState.currentTask}${taskState.currentTaskStatus ? ` (${taskState.currentTaskStatus})` : ''}`
|
|
72
77
|
: '';
|
|
73
78
|
|
|
74
|
-
process.stdout.write(`${model} | ${path.basename(currentDir)}${taskLabel}${contextLabel}`);
|
|
79
|
+
process.stdout.write(`${model} | ${path.basename(currentDir)}${modeLabel}${taskLabel}${contextLabel}`);
|
|
75
80
|
} catch {
|
|
76
81
|
process.exit(0);
|
|
77
82
|
}
|
package/hooks/hooks.json
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
],
|
|
14
14
|
"PreToolUse": [
|
|
15
15
|
{
|
|
16
|
-
"matcher": "Write|Edit",
|
|
16
|
+
"matcher": "Write|Edit|MultiEdit",
|
|
17
17
|
"hooks": [
|
|
18
18
|
{
|
|
19
19
|
"type": "command",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
]
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
|
-
"matcher": "Write|Edit",
|
|
26
|
+
"matcher": "Write|Edit|MultiEdit",
|
|
27
27
|
"hooks": [
|
|
28
28
|
{
|
|
29
29
|
"type": "command",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
]
|
|
34
34
|
},
|
|
35
35
|
{
|
|
36
|
-
"matcher": "Write|Edit",
|
|
36
|
+
"matcher": "Write|Edit|MultiEdit",
|
|
37
37
|
"hooks": [
|
|
38
38
|
{
|
|
39
39
|
"type": "command",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
]
|
|
76
76
|
},
|
|
77
77
|
{
|
|
78
|
-
"matcher": "Write|Edit",
|
|
78
|
+
"matcher": "Write|Edit|MultiEdit",
|
|
79
79
|
"hooks": [
|
|
80
80
|
{
|
|
81
81
|
"type": "command",
|
package/package.json
CHANGED