helloloop 0.8.2 → 0.8.5
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/.codex-plugin/plugin.json +1 -1
- package/README.md +67 -0
- package/hosts/claude/marketplace/plugins/helloloop/.claude-plugin/plugin.json +1 -1
- package/hosts/gemini/extension/gemini-extension.json +1 -1
- package/package.json +2 -2
- package/src/analyzer.mjs +60 -154
- package/src/analyzer_support.mjs +232 -0
- package/src/cli.mjs +8 -0
- package/src/cli_analyze_command.mjs +25 -4
- package/src/cli_args.mjs +5 -0
- package/src/cli_command_handlers.mjs +78 -0
- package/src/completion_review.mjs +2 -0
- package/src/context.mjs +6 -0
- package/src/engine_process_support.mjs +63 -3
- package/src/host_lease.mjs +204 -0
- package/src/process.mjs +7 -654
- package/src/runner_execute_task.mjs +55 -1
- package/src/runner_execution_support.mjs +14 -0
- package/src/runner_status.mjs +12 -1
- package/src/runtime_engine_support.mjs +342 -0
- package/src/runtime_engine_task.mjs +395 -0
- package/src/runtime_recovery.mjs +3 -0
- package/src/supervisor_runtime.mjs +285 -0
- package/src/verify_runner.mjs +84 -0
- package/templates/analysis-output.schema.json +18 -4
- package/templates/task-review-output.schema.json +5 -1
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
|
|
3
|
+
import { tailText, writeText } from "./common.mjs";
|
|
4
|
+
import { resolveVerifyInvocation, runChild } from "./engine_process_support.mjs";
|
|
5
|
+
import { isHostLeaseAlive } from "./host_lease.mjs";
|
|
6
|
+
import { buildHostLeaseStoppedResult } from "./runtime_engine_support.mjs";
|
|
7
|
+
|
|
8
|
+
export async function runShellCommand(context, commandLine, runDir, index, options = {}) {
|
|
9
|
+
if (!isHostLeaseAlive(options.hostLease)) {
|
|
10
|
+
const stopped = buildHostLeaseStoppedResult("检测到宿主窗口已关闭,HelloLoop 已停止当前验证命令。");
|
|
11
|
+
const prefix = String(index + 1).padStart(2, "0");
|
|
12
|
+
writeText(path.join(runDir, `${prefix}-verify-command.txt`), commandLine);
|
|
13
|
+
writeText(path.join(runDir, `${prefix}-verify-stdout.log`), stopped.stdout);
|
|
14
|
+
writeText(path.join(runDir, `${prefix}-verify-stderr.log`), stopped.stderr);
|
|
15
|
+
return { command: commandLine, ...stopped };
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const shellInvocation = resolveVerifyInvocation();
|
|
19
|
+
if (shellInvocation.error) {
|
|
20
|
+
const result = {
|
|
21
|
+
command: commandLine,
|
|
22
|
+
ok: false,
|
|
23
|
+
code: 1,
|
|
24
|
+
stdout: "",
|
|
25
|
+
stderr: shellInvocation.error,
|
|
26
|
+
};
|
|
27
|
+
const prefix = String(index + 1).padStart(2, "0");
|
|
28
|
+
writeText(path.join(runDir, `${prefix}-verify-command.txt`), commandLine);
|
|
29
|
+
writeText(path.join(runDir, `${prefix}-verify-stdout.log`), result.stdout);
|
|
30
|
+
writeText(path.join(runDir, `${prefix}-verify-stderr.log`), result.stderr);
|
|
31
|
+
return result;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const result = await runChild(shellInvocation.command, [
|
|
35
|
+
...shellInvocation.argsPrefix,
|
|
36
|
+
commandLine,
|
|
37
|
+
], {
|
|
38
|
+
cwd: context.repoRoot,
|
|
39
|
+
shell: shellInvocation.shell,
|
|
40
|
+
shouldKeepRunning() {
|
|
41
|
+
return isHostLeaseAlive(options.hostLease);
|
|
42
|
+
},
|
|
43
|
+
leaseStopReason: "检测到宿主窗口已关闭,HelloLoop 已停止当前验证命令。",
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
const prefix = String(index + 1).padStart(2, "0");
|
|
47
|
+
writeText(path.join(runDir, `${prefix}-verify-command.txt`), commandLine);
|
|
48
|
+
writeText(path.join(runDir, `${prefix}-verify-stdout.log`), result.stdout);
|
|
49
|
+
writeText(path.join(runDir, `${prefix}-verify-stderr.log`), result.stderr);
|
|
50
|
+
|
|
51
|
+
return { command: commandLine, ...result };
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export async function runVerifyCommands(context, commands, runDir, options = {}) {
|
|
55
|
+
const results = [];
|
|
56
|
+
|
|
57
|
+
for (const [index, command] of commands.entries()) {
|
|
58
|
+
const result = await runShellCommand(context, command, runDir, index, options);
|
|
59
|
+
results.push(result);
|
|
60
|
+
if (!result.ok) {
|
|
61
|
+
return {
|
|
62
|
+
ok: false,
|
|
63
|
+
results,
|
|
64
|
+
failed: result,
|
|
65
|
+
summary: [
|
|
66
|
+
`验证失败:${result.command}`,
|
|
67
|
+
"",
|
|
68
|
+
"stdout 尾部:",
|
|
69
|
+
tailText(result.stdout, 40),
|
|
70
|
+
"",
|
|
71
|
+
"stderr 尾部:",
|
|
72
|
+
tailText(result.stderr, 40),
|
|
73
|
+
].join("\n").trim(),
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return {
|
|
79
|
+
ok: true,
|
|
80
|
+
results,
|
|
81
|
+
failed: null,
|
|
82
|
+
summary: "全部验证命令通过。",
|
|
83
|
+
};
|
|
84
|
+
}
|
|
@@ -5,6 +5,9 @@
|
|
|
5
5
|
"required": [
|
|
6
6
|
"project",
|
|
7
7
|
"summary",
|
|
8
|
+
"constraints",
|
|
9
|
+
"requestInterpretation",
|
|
10
|
+
"repoDecision",
|
|
8
11
|
"tasks"
|
|
9
12
|
],
|
|
10
13
|
"properties": {
|
|
@@ -45,13 +48,19 @@
|
|
|
45
48
|
}
|
|
46
49
|
},
|
|
47
50
|
"constraints": {
|
|
48
|
-
"type":
|
|
51
|
+
"type": [
|
|
52
|
+
"array",
|
|
53
|
+
"null"
|
|
54
|
+
],
|
|
49
55
|
"items": {
|
|
50
56
|
"type": "string"
|
|
51
57
|
}
|
|
52
58
|
},
|
|
53
59
|
"requestInterpretation": {
|
|
54
|
-
"type":
|
|
60
|
+
"type": [
|
|
61
|
+
"object",
|
|
62
|
+
"null"
|
|
63
|
+
],
|
|
55
64
|
"additionalProperties": false,
|
|
56
65
|
"required": [
|
|
57
66
|
"summary",
|
|
@@ -78,7 +87,10 @@
|
|
|
78
87
|
}
|
|
79
88
|
},
|
|
80
89
|
"repoDecision": {
|
|
81
|
-
"type":
|
|
90
|
+
"type": [
|
|
91
|
+
"object",
|
|
92
|
+
"null"
|
|
93
|
+
],
|
|
82
94
|
"additionalProperties": false,
|
|
83
95
|
"required": [
|
|
84
96
|
"compatibility",
|
|
@@ -122,7 +134,9 @@
|
|
|
122
134
|
"goal",
|
|
123
135
|
"docs",
|
|
124
136
|
"paths",
|
|
125
|
-
"acceptance"
|
|
137
|
+
"acceptance",
|
|
138
|
+
"dependsOn",
|
|
139
|
+
"verify"
|
|
126
140
|
],
|
|
127
141
|
"properties": {
|
|
128
142
|
"id": {
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
"summary",
|
|
8
8
|
"acceptanceChecks",
|
|
9
9
|
"missing",
|
|
10
|
+
"blockerReason",
|
|
10
11
|
"nextAction"
|
|
11
12
|
],
|
|
12
13
|
"properties": {
|
|
@@ -60,7 +61,10 @@
|
|
|
60
61
|
}
|
|
61
62
|
},
|
|
62
63
|
"blockerReason": {
|
|
63
|
-
"type":
|
|
64
|
+
"type": [
|
|
65
|
+
"string",
|
|
66
|
+
"null"
|
|
67
|
+
]
|
|
64
68
|
},
|
|
65
69
|
"nextAction": {
|
|
66
70
|
"type": "string",
|