wile 0.4.14 → 0.4.15
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/cli.js +29 -20
- 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)"
|
package/dist/cli.js
CHANGED
|
@@ -7753,6 +7753,7 @@ Use bullet points for additional instructions, e.g.
|
|
|
7753
7753
|
"- Mark `passes: false` for work not done yet.",
|
|
7754
7754
|
"- Place the STOP HERE note only on the last story that requires human approval.",
|
|
7755
7755
|
"- Prefer concrete files/commands only when they reflect the real outcome.",
|
|
7756
|
+
"- Integration tests must validate real system behavior, not just the harness.",
|
|
7756
7757
|
"- If you discover reusable, module-specific guidance, add it to the nearest AGENTS.md.",
|
|
7757
7758
|
" Note: Never update .wile/AGENTS.md.",
|
|
7758
7759
|
"",
|
|
@@ -7774,7 +7775,7 @@ Wile config complete.`);
|
|
|
7774
7775
|
|
|
7775
7776
|
// src/commands/run.ts
|
|
7776
7777
|
import { existsSync as existsSync3, readFileSync as readFileSync2, mkdirSync, createWriteStream, writeFileSync } from "node:fs";
|
|
7777
|
-
import { spawnSync } from "node:child_process";
|
|
7778
|
+
import { spawn, spawnSync } from "node:child_process";
|
|
7778
7779
|
import { resolve, join as join3, dirname } from "node:path";
|
|
7779
7780
|
import { fileURLToPath } from "node:url";
|
|
7780
7781
|
|
|
@@ -7926,24 +7927,32 @@ var getTimestamp = () => {
|
|
|
7926
7927
|
const pad = (value) => String(value).padStart(2, "0");
|
|
7927
7928
|
return `${now.getFullYear()}${pad(now.getMonth() + 1)}${pad(now.getDate())}_${pad(now.getHours())}${pad(now.getMinutes())}${pad(now.getSeconds())}`;
|
|
7928
7929
|
};
|
|
7929
|
-
var runDockerWithLogging = (args, logPath) => {
|
|
7930
|
+
var runDockerWithLogging = (args, logPath) => new Promise((resolvePromise, rejectPromise) => {
|
|
7930
7931
|
const logStream = createWriteStream(logPath, { flags: "a" });
|
|
7931
|
-
const
|
|
7932
|
+
const child = spawn("docker", args, {
|
|
7932
7933
|
stdio: ["inherit", "pipe", "pipe"]
|
|
7933
7934
|
});
|
|
7934
|
-
|
|
7935
|
-
process.stdout.write(
|
|
7936
|
-
logStream.write(
|
|
7937
|
-
}
|
|
7938
|
-
|
|
7939
|
-
process.stderr.write(
|
|
7940
|
-
logStream.write(
|
|
7941
|
-
}
|
|
7942
|
-
|
|
7943
|
-
|
|
7944
|
-
|
|
7945
|
-
}
|
|
7946
|
-
|
|
7935
|
+
child.stdout.on("data", (chunk) => {
|
|
7936
|
+
process.stdout.write(chunk);
|
|
7937
|
+
logStream.write(chunk);
|
|
7938
|
+
});
|
|
7939
|
+
child.stderr.on("data", (chunk) => {
|
|
7940
|
+
process.stderr.write(chunk);
|
|
7941
|
+
logStream.write(chunk);
|
|
7942
|
+
});
|
|
7943
|
+
child.on("error", (error) => {
|
|
7944
|
+
logStream.end();
|
|
7945
|
+
rejectPromise(error);
|
|
7946
|
+
});
|
|
7947
|
+
child.on("close", (code) => {
|
|
7948
|
+
logStream.end();
|
|
7949
|
+
if (code !== 0) {
|
|
7950
|
+
rejectPromise(new Error("Docker run failed."));
|
|
7951
|
+
return;
|
|
7952
|
+
}
|
|
7953
|
+
resolvePromise();
|
|
7954
|
+
});
|
|
7955
|
+
});
|
|
7947
7956
|
var buildDockerArgs = (options, config, paths, cwd) => {
|
|
7948
7957
|
const dockerArgs = ["run", "--rm"];
|
|
7949
7958
|
if (options.test) {
|
|
@@ -7973,7 +7982,7 @@ var buildDockerArgs = (options, config, paths, cwd) => {
|
|
|
7973
7982
|
dockerArgs.push("wile-agent:local");
|
|
7974
7983
|
return dockerArgs;
|
|
7975
7984
|
};
|
|
7976
|
-
var runWile = (options) => {
|
|
7985
|
+
var runWile = async (options) => {
|
|
7977
7986
|
const cwd = process.cwd();
|
|
7978
7987
|
let paths;
|
|
7979
7988
|
let config;
|
|
@@ -8027,7 +8036,7 @@ var runWile = (options) => {
|
|
|
8027
8036
|
console.log(`- logsDir: ${logsDir}`);
|
|
8028
8037
|
console.log(`- logPath: ${logPath}`);
|
|
8029
8038
|
}
|
|
8030
|
-
runDockerWithLogging(dockerArgs, logPath);
|
|
8039
|
+
await runDockerWithLogging(dockerArgs, logPath);
|
|
8031
8040
|
const finishMessage = `Wile run complete. Monitor progress with git log in your repo.
|
|
8032
8041
|
`;
|
|
8033
8042
|
process.stdout.write(finishMessage);
|
|
@@ -8042,7 +8051,7 @@ program2.name("wile").description("Autonomous AI coding agent that ships feature
|
|
|
8042
8051
|
program2.command("config").description("Configure the current project for Wile").action(async () => {
|
|
8043
8052
|
await runConfig();
|
|
8044
8053
|
});
|
|
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);
|
|
8054
|
+
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) => {
|
|
8055
|
+
await runWile(options);
|
|
8047
8056
|
});
|
|
8048
8057
|
program2.parse(process.argv);
|