wile 0.1.1 → 0.2.0
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/README.md +3 -0
- package/dist/cli.js +56 -32
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -23,6 +23,9 @@ This creates:
|
|
|
23
23
|
- `.wile/.gitignore` to ignore `secrets/`, `screenshots/`, and `logs/`
|
|
24
24
|
- `.wile/prd.json` (empty) and `.wile/prd.json.example`
|
|
25
25
|
|
|
26
|
+
Set `WILE_REPO_SOURCE=local` in `.wile/secrets/.env` to run against the current directory without GitHub.
|
|
27
|
+
When `WILE_REPO_SOURCE=local`, GitHub credentials are optional.
|
|
28
|
+
|
|
26
29
|
## Run Wile
|
|
27
30
|
|
|
28
31
|
```bash
|
package/dist/cli.js
CHANGED
|
@@ -7660,21 +7660,34 @@ var runConfig = async () => {
|
|
|
7660
7660
|
],
|
|
7661
7661
|
initial: existingEnv.CC_CLAUDE_MODEL === "opus" ? 1 : 0
|
|
7662
7662
|
});
|
|
7663
|
-
|
|
7664
|
-
|
|
7665
|
-
|
|
7666
|
-
|
|
7663
|
+
const repoSourceResponse = await prompt({
|
|
7664
|
+
type: "select",
|
|
7665
|
+
name: "repoSource",
|
|
7666
|
+
message: "Repo source",
|
|
7667
|
+
choices: [
|
|
7668
|
+
{ title: "GitHub (remote)", value: "github" },
|
|
7669
|
+
{ title: "Local directory (no GitHub)", value: "local" }
|
|
7670
|
+
],
|
|
7671
|
+
initial: existingEnv.WILE_REPO_SOURCE === "local" ? 1 : 0
|
|
7672
|
+
});
|
|
7673
|
+
const repoSource = repoSourceResponse.repoSource;
|
|
7674
|
+
if (repoSource === "github") {
|
|
7675
|
+
console.log("");
|
|
7676
|
+
console.log(tips.github);
|
|
7677
|
+
console.log("");
|
|
7678
|
+
}
|
|
7679
|
+
const githubTokenResponse = repoSource === "github" ? await prompt({
|
|
7667
7680
|
type: "password",
|
|
7668
7681
|
name: "githubToken",
|
|
7669
7682
|
message: "GitHub token (press enter to keep existing)",
|
|
7670
7683
|
initial: existingEnv.GITHUB_TOKEN ?? ""
|
|
7671
|
-
});
|
|
7672
|
-
const repoResponse = await prompt({
|
|
7684
|
+
}) : { githubToken: undefined };
|
|
7685
|
+
const repoResponse = repoSource === "github" ? await prompt({
|
|
7673
7686
|
type: "text",
|
|
7674
7687
|
name: "repoUrl",
|
|
7675
7688
|
message: "GitHub repo URL",
|
|
7676
7689
|
initial: existingEnv.GITHUB_REPO_URL ?? ""
|
|
7677
|
-
});
|
|
7690
|
+
}) : { repoUrl: undefined };
|
|
7678
7691
|
const branchResponse = await prompt({
|
|
7679
7692
|
type: "text",
|
|
7680
7693
|
name: "branchName",
|
|
@@ -7683,11 +7696,12 @@ var runConfig = async () => {
|
|
|
7683
7696
|
});
|
|
7684
7697
|
const authFallback = authMethod === "oauth" ? existingEnv.CC_CLAUDE_CODE_OAUTH_TOKEN : existingEnv.CC_ANTHROPIC_API_KEY;
|
|
7685
7698
|
const authValue = coalesceValue(authValueResponse.authValue, authFallback);
|
|
7686
|
-
const githubToken = coalesceValue(githubTokenResponse.githubToken, existingEnv.GITHUB_TOKEN);
|
|
7687
|
-
const repoUrl = coalesceValue(repoResponse.repoUrl, existingEnv.GITHUB_REPO_URL);
|
|
7699
|
+
const githubToken = repoSource === "github" ? coalesceValue(githubTokenResponse.githubToken, existingEnv.GITHUB_TOKEN) : existingEnv.GITHUB_TOKEN;
|
|
7700
|
+
const repoUrl = repoSource === "github" ? coalesceValue(repoResponse.repoUrl, existingEnv.GITHUB_REPO_URL) : existingEnv.GITHUB_REPO_URL;
|
|
7688
7701
|
const branchName = coalesceValue(branchResponse.branchName, existingEnv.BRANCH_NAME ?? "main");
|
|
7689
7702
|
const envLines = [
|
|
7690
7703
|
"CODING_AGENT=CC",
|
|
7704
|
+
`WILE_REPO_SOURCE=${repoSource}`,
|
|
7691
7705
|
`GITHUB_TOKEN=${githubToken ?? ""}`,
|
|
7692
7706
|
`GITHUB_REPO_URL=${repoUrl ?? ""}`,
|
|
7693
7707
|
`BRANCH_NAME=${branchName ?? "main"}`,
|
|
@@ -7758,11 +7772,14 @@ var readWileConfig = (options = {}) => {
|
|
|
7758
7772
|
}
|
|
7759
7773
|
const env = parseEnvFile(paths.envPath);
|
|
7760
7774
|
const envProject = parseEnvFile(paths.envProjectPath);
|
|
7775
|
+
const repoSource = env.WILE_REPO_SOURCE || "github";
|
|
7761
7776
|
if (validate) {
|
|
7762
7777
|
ensureRequired(env.CODING_AGENT === "CC", "CODING_AGENT must be set to CC in .wile/secrets/.env. Run 'bunx wile config'.");
|
|
7763
|
-
|
|
7764
|
-
|
|
7765
|
-
|
|
7778
|
+
if (repoSource === "github") {
|
|
7779
|
+
ensureRequired(Boolean(env.GITHUB_TOKEN), "GITHUB_TOKEN is required in .wile/secrets/.env. Run 'bunx wile config'.");
|
|
7780
|
+
ensureRequired(Boolean(env.GITHUB_REPO_URL), "GITHUB_REPO_URL is required in .wile/secrets/.env. Run 'bunx wile config'.");
|
|
7781
|
+
ensureRequired(Boolean(env.BRANCH_NAME), "BRANCH_NAME is required in .wile/secrets/.env. Run 'bunx wile config'.");
|
|
7782
|
+
}
|
|
7766
7783
|
ensureRequired(Boolean(env.CC_CLAUDE_CODE_OAUTH_TOKEN || env.CC_ANTHROPIC_API_KEY), "Either CC_CLAUDE_CODE_OAUTH_TOKEN or CC_ANTHROPIC_API_KEY is required in .wile/secrets/.env.");
|
|
7767
7784
|
}
|
|
7768
7785
|
return {
|
|
@@ -7772,6 +7789,7 @@ var readWileConfig = (options = {}) => {
|
|
|
7772
7789
|
githubToken: env.GITHUB_TOKEN ?? "",
|
|
7773
7790
|
githubRepoUrl: env.GITHUB_REPO_URL ?? "",
|
|
7774
7791
|
branchName: env.BRANCH_NAME ?? "",
|
|
7792
|
+
repoSource,
|
|
7775
7793
|
ccClaudeModel: env.CC_CLAUDE_MODEL,
|
|
7776
7794
|
ccClaudeCodeOauthToken: env.CC_CLAUDE_CODE_OAUTH_TOKEN,
|
|
7777
7795
|
ccAnthropicApiKey: env.CC_ANTHROPIC_API_KEY,
|
|
@@ -7855,6 +7873,30 @@ var runDockerWithLogging = (args, logPath) => {
|
|
|
7855
7873
|
throw new Error("Docker run failed.");
|
|
7856
7874
|
}
|
|
7857
7875
|
};
|
|
7876
|
+
var buildDockerArgs = (options, config, paths, cwd) => {
|
|
7877
|
+
const dockerArgs = ["run", "--rm"];
|
|
7878
|
+
if (options.test) {
|
|
7879
|
+
dockerArgs.push("-e", "WILE_TEST=true", "-e", "WILE_TEST_REPO_PATH=/home/wile/workspace/repo", "-v", `${cwd}:/home/wile/workspace/repo`);
|
|
7880
|
+
}
|
|
7881
|
+
if (options.maxIterations) {
|
|
7882
|
+
dockerArgs.push("-e", `MAX_ITERATIONS=${options.maxIterations}`);
|
|
7883
|
+
}
|
|
7884
|
+
const repoSource = options.test || options.repo ? "github" : config.repoSource ?? "github";
|
|
7885
|
+
if (repoSource === "local") {
|
|
7886
|
+
dockerArgs.push("-e", "WILE_REPO_SOURCE=local", "-e", "WILE_LOCAL_REPO_PATH=/home/wile/workspace/repo", "-v", `${cwd}:/home/wile/workspace/repo`);
|
|
7887
|
+
} else {
|
|
7888
|
+
const repoValue = options.repo ?? config.githubRepoUrl;
|
|
7889
|
+
if (repoValue) {
|
|
7890
|
+
dockerArgs.push("-e", `GITHUB_REPO_URL=${repoValue}`);
|
|
7891
|
+
}
|
|
7892
|
+
}
|
|
7893
|
+
const envFiles = [paths.envPath, paths.envProjectPath].filter((path) => existsSync3(path));
|
|
7894
|
+
for (const envFile of envFiles) {
|
|
7895
|
+
dockerArgs.push("--env-file", envFile);
|
|
7896
|
+
}
|
|
7897
|
+
dockerArgs.push("wile-agent:local");
|
|
7898
|
+
return dockerArgs;
|
|
7899
|
+
};
|
|
7858
7900
|
var runWile = (options) => {
|
|
7859
7901
|
const cwd = process.cwd();
|
|
7860
7902
|
let paths;
|
|
@@ -7884,25 +7926,7 @@ var runWile = (options) => {
|
|
|
7884
7926
|
}
|
|
7885
7927
|
const agentDir = resolveAgentDir();
|
|
7886
7928
|
buildAgentImage(agentDir);
|
|
7887
|
-
const dockerArgs =
|
|
7888
|
-
if (options.test) {
|
|
7889
|
-
dockerArgs.push("-e", "WILE_TEST=true", "-e", "WILE_TEST_REPO_PATH=/home/wile/workspace/repo", "-v", `${cwd}:/home/wile/workspace/repo`);
|
|
7890
|
-
}
|
|
7891
|
-
if (options.maxIterations) {
|
|
7892
|
-
dockerArgs.push("-e", `MAX_ITERATIONS=${options.maxIterations}`);
|
|
7893
|
-
}
|
|
7894
|
-
const repoValue = options.repo ?? config.githubRepoUrl;
|
|
7895
|
-
if (repoValue) {
|
|
7896
|
-
dockerArgs.push("-e", `GITHUB_REPO_URL=${repoValue}`);
|
|
7897
|
-
}
|
|
7898
|
-
if (options.branch) {
|
|
7899
|
-
dockerArgs.push("-e", `BRANCH_NAME=${options.branch}`);
|
|
7900
|
-
}
|
|
7901
|
-
const envFiles = [paths.envPath, paths.envProjectPath].filter((path) => existsSync3(path));
|
|
7902
|
-
for (const envFile of envFiles) {
|
|
7903
|
-
dockerArgs.push("--env-file", envFile);
|
|
7904
|
-
}
|
|
7905
|
-
dockerArgs.push("wile-agent:local");
|
|
7929
|
+
const dockerArgs = buildDockerArgs(options, config, paths, cwd);
|
|
7906
7930
|
const logsDir = join3(paths.wileDir, "logs");
|
|
7907
7931
|
mkdirSync(logsDir, { recursive: true });
|
|
7908
7932
|
const logPath = join3(logsDir, `run-${getTimestamp()}.log`);
|
|
@@ -7927,7 +7951,7 @@ program2.name("wile").description("Autonomous AI coding agent that ships feature
|
|
|
7927
7951
|
program2.command("config").description("Configure the current project for Wile").action(async () => {
|
|
7928
7952
|
await runConfig();
|
|
7929
7953
|
});
|
|
7930
|
-
program2.command("run").description("Run Wile on a repository").option("--
|
|
7954
|
+
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) => {
|
|
7931
7955
|
runWile(options);
|
|
7932
7956
|
});
|
|
7933
7957
|
program2.parse(process.argv);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wile",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Autonomous AI coding agent that ships features while you sleep",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
"scripts": {
|
|
15
15
|
"build": "bun build ./src/cli.ts --outdir ./dist --target node",
|
|
16
16
|
"dev": "bun run ./src/cli.ts",
|
|
17
|
-
"prepublishOnly": "./build.sh"
|
|
17
|
+
"prepublishOnly": "./build.sh",
|
|
18
|
+
"test": "bun test"
|
|
18
19
|
},
|
|
19
20
|
"dependencies": {
|
|
20
21
|
"commander": "^14.0.2",
|