wile 0.4.2 → 0.4.3

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.
Files changed (2) hide show
  1. package/dist/cli.js +32 -8
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -7835,6 +7835,20 @@ var readWileConfig = (options = {}) => {
7835
7835
  };
7836
7836
 
7837
7837
  // src/commands/run.ts
7838
+ var findAgentDir = (startDir) => {
7839
+ let current = startDir;
7840
+ while (true) {
7841
+ const candidate = join3(current, "packages", "agent");
7842
+ if (existsSync3(candidate)) {
7843
+ return candidate;
7844
+ }
7845
+ const parent = dirname(current);
7846
+ if (parent === current) {
7847
+ return null;
7848
+ }
7849
+ current = parent;
7850
+ }
7851
+ };
7838
7852
  var readJson = (path) => {
7839
7853
  try {
7840
7854
  const contents = readFileSync2(path, "utf8");
@@ -7880,18 +7894,18 @@ var resolveAgentDir = () => {
7880
7894
  }
7881
7895
  const initCwd = process.env.INIT_CWD;
7882
7896
  if (initCwd) {
7883
- const initAgentDir = join3(initCwd, "packages", "agent");
7884
- if (existsSync3(initAgentDir)) {
7885
- return initAgentDir;
7897
+ const found = findAgentDir(initCwd);
7898
+ if (found) {
7899
+ return found;
7886
7900
  }
7887
7901
  }
7888
- const cwdAgentDir = join3(process.cwd(), "packages", "agent");
7889
- if (existsSync3(cwdAgentDir)) {
7890
- return cwdAgentDir;
7902
+ const foundFromCwd = findAgentDir(process.cwd());
7903
+ if (foundFromCwd) {
7904
+ return foundFromCwd;
7891
7905
  }
7892
7906
  const here = dirname(fileURLToPath(import.meta.url));
7893
7907
  const cliRoot = resolve(here, "..", "..", "..");
7894
- const agentDir = join3(cliRoot, "..", "agent");
7908
+ const agentDir = join3(cliRoot, "agent");
7895
7909
  if (!existsSync3(agentDir)) {
7896
7910
  throw new Error("Unable to locate packages/agent. Run from the monorepo.");
7897
7911
  }
@@ -7961,6 +7975,16 @@ var runWile = (options) => {
7961
7975
  console.error(error.message);
7962
7976
  process.exit(1);
7963
7977
  }
7978
+ if (options.debug) {
7979
+ const initCwd = process.env.INIT_CWD ?? "(unset)";
7980
+ console.log("Debug:");
7981
+ console.log(`- cwd: ${cwd}`);
7982
+ console.log(`- INIT_CWD: ${initCwd}`);
7983
+ console.log(`- WILE_AGENT_DIR: ${process.env.WILE_AGENT_DIR ?? "(unset)"}`);
7984
+ console.log(`- repoSource: ${config.repoSource}`);
7985
+ console.log(`- githubRepoUrl: ${config.githubRepoUrl || "(empty)"}`);
7986
+ console.log(`- branchName: ${config.branchName || "(empty)"}`);
7987
+ }
7964
7988
  try {
7965
7989
  validateGitignore(paths.gitignorePath);
7966
7990
  } catch (error) {
@@ -8003,7 +8027,7 @@ program2.name("wile").description("Autonomous AI coding agent that ships feature
8003
8027
  program2.command("config").description("Configure the current project for Wile").action(async () => {
8004
8028
  await runConfig();
8005
8029
  });
8006
- 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").action((options) => {
8030
+ 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) => {
8007
8031
  runWile(options);
8008
8032
  });
8009
8033
  program2.parse(process.argv);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wile",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "description": "Autonomous AI coding agent that ships features while you sleep",
5
5
  "type": "module",
6
6
  "bin": {