wile 0.4.1 → 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 +36 -5
  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");
@@ -7878,13 +7892,20 @@ var resolveAgentDir = () => {
7878
7892
  if (override && existsSync3(override)) {
7879
7893
  return override;
7880
7894
  }
7881
- const cwdAgentDir = join3(process.cwd(), "packages", "agent");
7882
- if (existsSync3(cwdAgentDir)) {
7883
- return cwdAgentDir;
7895
+ const initCwd = process.env.INIT_CWD;
7896
+ if (initCwd) {
7897
+ const found = findAgentDir(initCwd);
7898
+ if (found) {
7899
+ return found;
7900
+ }
7901
+ }
7902
+ const foundFromCwd = findAgentDir(process.cwd());
7903
+ if (foundFromCwd) {
7904
+ return foundFromCwd;
7884
7905
  }
7885
7906
  const here = dirname(fileURLToPath(import.meta.url));
7886
7907
  const cliRoot = resolve(here, "..", "..", "..");
7887
- const agentDir = join3(cliRoot, "..", "agent");
7908
+ const agentDir = join3(cliRoot, "agent");
7888
7909
  if (!existsSync3(agentDir)) {
7889
7910
  throw new Error("Unable to locate packages/agent. Run from the monorepo.");
7890
7911
  }
@@ -7954,6 +7975,16 @@ var runWile = (options) => {
7954
7975
  console.error(error.message);
7955
7976
  process.exit(1);
7956
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
+ }
7957
7988
  try {
7958
7989
  validateGitignore(paths.gitignorePath);
7959
7990
  } catch (error) {
@@ -7996,7 +8027,7 @@ program2.name("wile").description("Autonomous AI coding agent that ships feature
7996
8027
  program2.command("config").description("Configure the current project for Wile").action(async () => {
7997
8028
  await runConfig();
7998
8029
  });
7999
- 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) => {
8000
8031
  runWile(options);
8001
8032
  });
8002
8033
  program2.parse(process.argv);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wile",
3
- "version": "0.4.1",
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": {