wile 0.4.11 → 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.
@@ -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)"
@@ -49,7 +49,7 @@ echo "════════════════════════
49
49
  echo ""
50
50
 
51
51
  if [ -f "$SETUP_PROMPT_FILE" ]; then
52
- OUTPUT=$(cat "$SETUP_PROMPT_FILE" | claude --model "$CLAUDE_MODEL" --dangerously-skip-permissions 2>&1 | tee /dev/stderr) || true
52
+ OUTPUT=$(cat "$SETUP_PROMPT_FILE" | claude --model "$CLAUDE_MODEL" --verbose --dangerously-skip-permissions 2>&1 | tee /dev/stderr) || true
53
53
 
54
54
  # Check if setup failed critically
55
55
  if echo "$OUTPUT" | grep -q "<promise>SETUP_FAILED</promise>"; then
@@ -80,7 +80,7 @@ for i in $(seq 1 $MAX_ITERATIONS); do
80
80
  # Pipe prompt to Claude Code
81
81
  # --dangerously-skip-permissions allows autonomous operation
82
82
  # Capture output while also displaying it (tee to stderr)
83
- OUTPUT=$(cat "$PROMPT_FILE" | claude --model "$CLAUDE_MODEL" --dangerously-skip-permissions 2>&1 | tee /dev/stderr) || true
83
+ OUTPUT=$(cat "$PROMPT_FILE" | claude --model "$CLAUDE_MODEL" --verbose --dangerously-skip-permissions 2>&1 | tee /dev/stderr) || true
84
84
 
85
85
  # Check for completion signal
86
86
  if echo "$OUTPUT" | grep -q "<promise>COMPLETE</promise>"; then
package/dist/cli.js CHANGED
@@ -7743,17 +7743,24 @@ Use bullet points for additional instructions, e.g.
7743
7743
  "each story is independently actionable and verifiable.",
7744
7744
  "",
7745
7745
  "Guidelines:",
7746
- "- Use clear, testable acceptance criteria (one behavior per bullet).",
7746
+ "- Use outcome-focused acceptance criteria (observable results).",
7747
+ '- Criteria should be hard to satisfy with "empty" tests.',
7748
+ "- If verification is a command, state the expected result of that command.",
7749
+ "- Use one behavior per bullet.",
7747
7750
  "- Keep IDs stable and unique (e.g., US-123).",
7748
7751
  '- Avoid vague terms like "should" or "nice".',
7749
7752
  "- Keep stories small enough to finish in one iteration.",
7750
7753
  "- Mark `passes: false` for work not done yet.",
7751
7754
  "- Place the STOP HERE note only on the last story that requires human approval.",
7752
- "- Prefer concrete files/commands when verification matters.",
7755
+ "- Prefer concrete files/commands only when they reflect the real outcome.",
7756
+ "- Integration tests must validate real system behavior, not just the harness.",
7757
+ "- If you discover reusable, module-specific guidance, add it to the nearest AGENTS.md.",
7758
+ " Note: Never update .wile/AGENTS.md.",
7753
7759
  "",
7754
7760
  "Environment notes:",
7755
7761
  "- Playwright (Chromium) is available in the agent container for UI checks.",
7756
7762
  "- Project env vars can be passed via `.wile/secrets/.env.project`.",
7763
+ "- Optional extra guidance can be added in `.wile/additional-instructions.md`.",
7757
7764
  "- The container has outbound internet access by default.",
7758
7765
  ""
7759
7766
  ].join(`
@@ -7768,7 +7775,7 @@ Wile config complete.`);
7768
7775
 
7769
7776
  // src/commands/run.ts
7770
7777
  import { existsSync as existsSync3, readFileSync as readFileSync2, mkdirSync, createWriteStream, writeFileSync } from "node:fs";
7771
- import { spawnSync } from "node:child_process";
7778
+ import { spawn, spawnSync } from "node:child_process";
7772
7779
  import { resolve, join as join3, dirname } from "node:path";
7773
7780
  import { fileURLToPath } from "node:url";
7774
7781
 
@@ -7920,24 +7927,32 @@ var getTimestamp = () => {
7920
7927
  const pad = (value) => String(value).padStart(2, "0");
7921
7928
  return `${now.getFullYear()}${pad(now.getMonth() + 1)}${pad(now.getDate())}_${pad(now.getHours())}${pad(now.getMinutes())}${pad(now.getSeconds())}`;
7922
7929
  };
7923
- var runDockerWithLogging = (args, logPath) => {
7930
+ var runDockerWithLogging = (args, logPath) => new Promise((resolvePromise, rejectPromise) => {
7924
7931
  const logStream = createWriteStream(logPath, { flags: "a" });
7925
- const result = spawnSync("docker", args, {
7932
+ const child = spawn("docker", args, {
7926
7933
  stdio: ["inherit", "pipe", "pipe"]
7927
7934
  });
7928
- if (result.stdout) {
7929
- process.stdout.write(result.stdout);
7930
- logStream.write(result.stdout);
7931
- }
7932
- if (result.stderr) {
7933
- process.stderr.write(result.stderr);
7934
- logStream.write(result.stderr);
7935
- }
7936
- logStream.end();
7937
- if (result.status !== 0) {
7938
- throw new Error("Docker run failed.");
7939
- }
7940
- };
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
+ });
7941
7956
  var buildDockerArgs = (options, config, paths, cwd) => {
7942
7957
  const dockerArgs = ["run", "--rm"];
7943
7958
  if (options.test) {
@@ -7967,7 +7982,7 @@ var buildDockerArgs = (options, config, paths, cwd) => {
7967
7982
  dockerArgs.push("wile-agent:local");
7968
7983
  return dockerArgs;
7969
7984
  };
7970
- var runWile = (options) => {
7985
+ var runWile = async (options) => {
7971
7986
  const cwd = process.cwd();
7972
7987
  let paths;
7973
7988
  let config;
@@ -8021,7 +8036,7 @@ var runWile = (options) => {
8021
8036
  console.log(`- logsDir: ${logsDir}`);
8022
8037
  console.log(`- logPath: ${logPath}`);
8023
8038
  }
8024
- runDockerWithLogging(dockerArgs, logPath);
8039
+ await runDockerWithLogging(dockerArgs, logPath);
8025
8040
  const finishMessage = `Wile run complete. Monitor progress with git log in your repo.
8026
8041
  `;
8027
8042
  process.stdout.write(finishMessage);
@@ -8036,7 +8051,7 @@ program2.name("wile").description("Autonomous AI coding agent that ships feature
8036
8051
  program2.command("config").description("Configure the current project for Wile").action(async () => {
8037
8052
  await runConfig();
8038
8053
  });
8039
- 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) => {
8040
- 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);
8041
8056
  });
8042
8057
  program2.parse(process.argv);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wile",
3
- "version": "0.4.11",
3
+ "version": "0.4.15",
4
4
  "description": "Autonomous AI coding agent that ships features while you sleep",
5
5
  "type": "module",
6
6
  "bin": {
@@ -15,7 +15,9 @@
15
15
  "build": "bun build ./src/cli.ts --outdir ./dist --target node",
16
16
  "dev": "bun run ./src/cli.ts",
17
17
  "prepublishOnly": "./build.sh",
18
- "test": "bun test"
18
+ "test": "bun test",
19
+ "tsc": "tsc --noEmit",
20
+ "lint": "eslint . --max-warnings=0"
19
21
  },
20
22
  "dependencies": {
21
23
  "commander": "^14.0.2",
@@ -29,5 +31,12 @@
29
31
  "agent",
30
32
  "claude"
31
33
  ],
32
- "license": "MIT"
34
+ "license": "MIT",
35
+ "devDependencies": {
36
+ "@types/prompts": "^2.4.9",
37
+ "@typescript-eslint/eslint-plugin": "^8.52.0",
38
+ "@typescript-eslint/parser": "^8.52.0",
39
+ "eslint": "8.57.0",
40
+ "typescript": "^5.9.3"
41
+ }
33
42
  }