wile 0.4.14 → 0.4.16
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/dist/agent/entrypoint.sh +13 -0
- package/dist/agent/scripts/prompt.md +3 -0
- package/dist/cli.js +29 -22
- package/package.json +1 -1
package/dist/agent/entrypoint.sh
CHANGED
|
@@ -98,6 +98,19 @@ MAX_ITERATIONS=${MAX_ITERATIONS:-25}
|
|
|
98
98
|
SCRIPT_DIR="/home/wile/scripts"
|
|
99
99
|
WORKSPACE="/home/wile/workspace"
|
|
100
100
|
|
|
101
|
+
if [ "${WILE_MOCK_CLAUDE:-}" = "true" ]; then
|
|
102
|
+
echo " Claude: Mocked"
|
|
103
|
+
MOCK_BIN="/home/wile/mock-bin"
|
|
104
|
+
mkdir -p "$MOCK_BIN"
|
|
105
|
+
cat > "$MOCK_BIN/claude" << 'MOCK'
|
|
106
|
+
#!/bin/sh
|
|
107
|
+
echo "ANSWER: 2"
|
|
108
|
+
echo "<promise>COMPLETE</promise>"
|
|
109
|
+
MOCK
|
|
110
|
+
chmod +x "$MOCK_BIN/claude"
|
|
111
|
+
export PATH="$MOCK_BIN:$PATH"
|
|
112
|
+
fi
|
|
113
|
+
|
|
101
114
|
# Set up Claude Code authentication
|
|
102
115
|
if [ -n "$CC_CLAUDE_CODE_OAUTH_TOKEN" ]; then
|
|
103
116
|
echo " Auth: OAuth (Pro/Max subscription)"
|
|
@@ -100,6 +100,9 @@ After completing steps 1-8, check if ALL stories in `.wile/prd.json` have `passe
|
|
|
100
100
|
6. **No interactive prompts** - Use `echo -e "\n\n\n" |` if a command might prompt
|
|
101
101
|
7. **NEVER commit node_modules, dist, or build artifacts** - .gitignore should already be set up at the start of the run
|
|
102
102
|
8. **Use acceptance criteria as verification steps** - Run commands to confirm outputs or write tests that fail if the feature is removed
|
|
103
|
+
9. **Integration tests must validate real system behavior, not just the harness**
|
|
104
|
+
10. **If you discover reusable, module-specific guidance, add it to the nearest AGENTS.md**
|
|
105
|
+
Note: Never update .wile/AGENTS.md.
|
|
103
106
|
|
|
104
107
|
## Common Patterns
|
|
105
108
|
|
package/dist/cli.js
CHANGED
|
@@ -7745,6 +7745,7 @@ Use bullet points for additional instructions, e.g.
|
|
|
7745
7745
|
"Guidelines:",
|
|
7746
7746
|
"- Use outcome-focused acceptance criteria (observable results).",
|
|
7747
7747
|
'- Criteria should be hard to satisfy with "empty" tests.',
|
|
7748
|
+
"- For integration tests, write acceptance criteria that validate real system behavior (not just the harness).",
|
|
7748
7749
|
"- If verification is a command, state the expected result of that command.",
|
|
7749
7750
|
"- Use one behavior per bullet.",
|
|
7750
7751
|
"- Keep IDs stable and unique (e.g., US-123).",
|
|
@@ -7753,8 +7754,6 @@ Use bullet points for additional instructions, e.g.
|
|
|
7753
7754
|
"- Mark `passes: false` for work not done yet.",
|
|
7754
7755
|
"- Place the STOP HERE note only on the last story that requires human approval.",
|
|
7755
7756
|
"- Prefer concrete files/commands only when they reflect the real outcome.",
|
|
7756
|
-
"- If you discover reusable, module-specific guidance, add it to the nearest AGENTS.md.",
|
|
7757
|
-
" Note: Never update .wile/AGENTS.md.",
|
|
7758
7757
|
"",
|
|
7759
7758
|
"Environment notes:",
|
|
7760
7759
|
"- Playwright (Chromium) is available in the agent container for UI checks.",
|
|
@@ -7774,7 +7773,7 @@ Wile config complete.`);
|
|
|
7774
7773
|
|
|
7775
7774
|
// src/commands/run.ts
|
|
7776
7775
|
import { existsSync as existsSync3, readFileSync as readFileSync2, mkdirSync, createWriteStream, writeFileSync } from "node:fs";
|
|
7777
|
-
import { spawnSync } from "node:child_process";
|
|
7776
|
+
import { spawn, spawnSync } from "node:child_process";
|
|
7778
7777
|
import { resolve, join as join3, dirname } from "node:path";
|
|
7779
7778
|
import { fileURLToPath } from "node:url";
|
|
7780
7779
|
|
|
@@ -7926,24 +7925,32 @@ var getTimestamp = () => {
|
|
|
7926
7925
|
const pad = (value) => String(value).padStart(2, "0");
|
|
7927
7926
|
return `${now.getFullYear()}${pad(now.getMonth() + 1)}${pad(now.getDate())}_${pad(now.getHours())}${pad(now.getMinutes())}${pad(now.getSeconds())}`;
|
|
7928
7927
|
};
|
|
7929
|
-
var runDockerWithLogging = (args, logPath) => {
|
|
7928
|
+
var runDockerWithLogging = (args, logPath) => new Promise((resolvePromise, rejectPromise) => {
|
|
7930
7929
|
const logStream = createWriteStream(logPath, { flags: "a" });
|
|
7931
|
-
const
|
|
7930
|
+
const child = spawn("docker", args, {
|
|
7932
7931
|
stdio: ["inherit", "pipe", "pipe"]
|
|
7933
7932
|
});
|
|
7934
|
-
|
|
7935
|
-
process.stdout.write(
|
|
7936
|
-
logStream.write(
|
|
7937
|
-
}
|
|
7938
|
-
|
|
7939
|
-
process.stderr.write(
|
|
7940
|
-
logStream.write(
|
|
7941
|
-
}
|
|
7942
|
-
|
|
7943
|
-
|
|
7944
|
-
|
|
7945
|
-
}
|
|
7946
|
-
|
|
7933
|
+
child.stdout.on("data", (chunk) => {
|
|
7934
|
+
process.stdout.write(chunk);
|
|
7935
|
+
logStream.write(chunk);
|
|
7936
|
+
});
|
|
7937
|
+
child.stderr.on("data", (chunk) => {
|
|
7938
|
+
process.stderr.write(chunk);
|
|
7939
|
+
logStream.write(chunk);
|
|
7940
|
+
});
|
|
7941
|
+
child.on("error", (error) => {
|
|
7942
|
+
logStream.end();
|
|
7943
|
+
rejectPromise(error);
|
|
7944
|
+
});
|
|
7945
|
+
child.on("close", (code) => {
|
|
7946
|
+
logStream.end();
|
|
7947
|
+
if (code !== 0) {
|
|
7948
|
+
rejectPromise(new Error("Docker run failed."));
|
|
7949
|
+
return;
|
|
7950
|
+
}
|
|
7951
|
+
resolvePromise();
|
|
7952
|
+
});
|
|
7953
|
+
});
|
|
7947
7954
|
var buildDockerArgs = (options, config, paths, cwd) => {
|
|
7948
7955
|
const dockerArgs = ["run", "--rm"];
|
|
7949
7956
|
if (options.test) {
|
|
@@ -7973,7 +7980,7 @@ var buildDockerArgs = (options, config, paths, cwd) => {
|
|
|
7973
7980
|
dockerArgs.push("wile-agent:local");
|
|
7974
7981
|
return dockerArgs;
|
|
7975
7982
|
};
|
|
7976
|
-
var runWile = (options) => {
|
|
7983
|
+
var runWile = async (options) => {
|
|
7977
7984
|
const cwd = process.cwd();
|
|
7978
7985
|
let paths;
|
|
7979
7986
|
let config;
|
|
@@ -8027,7 +8034,7 @@ var runWile = (options) => {
|
|
|
8027
8034
|
console.log(`- logsDir: ${logsDir}`);
|
|
8028
8035
|
console.log(`- logPath: ${logPath}`);
|
|
8029
8036
|
}
|
|
8030
|
-
runDockerWithLogging(dockerArgs, logPath);
|
|
8037
|
+
await runDockerWithLogging(dockerArgs, logPath);
|
|
8031
8038
|
const finishMessage = `Wile run complete. Monitor progress with git log in your repo.
|
|
8032
8039
|
`;
|
|
8033
8040
|
process.stdout.write(finishMessage);
|
|
@@ -8042,7 +8049,7 @@ program2.name("wile").description("Autonomous AI coding agent that ships feature
|
|
|
8042
8049
|
program2.command("config").description("Configure the current project for Wile").action(async () => {
|
|
8043
8050
|
await runConfig();
|
|
8044
8051
|
});
|
|
8045
|
-
program2.command("run").description("Run Wile on a repository").option("--repo <repo>", "Repository URL or local path").option("--max-iterations <count>", "Maximum iterations", "25").option("--test", "Run in test mode").option("--debug", "Print debug info before running").action((options) => {
|
|
8046
|
-
runWile(options);
|
|
8052
|
+
program2.command("run").description("Run Wile on a repository").option("--repo <repo>", "Repository URL or local path").option("--max-iterations <count>", "Maximum iterations", "25").option("--test", "Run in test mode").option("--debug", "Print debug info before running").action(async (options) => {
|
|
8053
|
+
await runWile(options);
|
|
8047
8054
|
});
|
|
8048
8055
|
program2.parse(process.argv);
|