fly-to-moon 0.1.14 → 0.1.16
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 +12 -0
- package/dist/cli.mjs +21 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -35,6 +35,18 @@ fttm is an autonomous coding agent orchestrator — each iteration makes one sma
|
|
|
35
35
|
npm install -g fly-to-moon
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
+
### Update
|
|
39
|
+
|
|
40
|
+
```sh
|
|
41
|
+
npm install -g fly-to-moon@latest
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Or force reinstall:
|
|
45
|
+
|
|
46
|
+
```sh
|
|
47
|
+
npm install -g fly-to-moon@latest --force
|
|
48
|
+
```
|
|
49
|
+
|
|
38
50
|
### OpenCode
|
|
39
51
|
|
|
40
52
|
```sh
|
package/dist/cli.mjs
CHANGED
|
@@ -259,11 +259,10 @@ function writeSchemaFile(schemaPath) {
|
|
|
259
259
|
writeFileSync(schemaPath, JSON.stringify(AGENT_OUTPUT_SCHEMA, null, 2), "utf-8");
|
|
260
260
|
}
|
|
261
261
|
function ensureRunMetadataIgnored(cwd) {
|
|
262
|
-
const
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
writeFileSync(gitignorePath, "*\n", "utf-8");
|
|
262
|
+
const excludePath = join(cwd, ".git", "info", "exclude");
|
|
263
|
+
if (existsSync(excludePath)) return;
|
|
264
|
+
mkdirSync(join(cwd, ".git", "info"), { recursive: true });
|
|
265
|
+
writeFileSync(excludePath, ".fttm/runs/\n", "utf-8");
|
|
267
266
|
}
|
|
268
267
|
function setupRun(runId, prompt, baseCommit, cwd) {
|
|
269
268
|
ensureRunMetadataIgnored(cwd);
|
|
@@ -860,16 +859,18 @@ var ClaudeAgent = class {
|
|
|
860
859
|
name = "claude";
|
|
861
860
|
bin;
|
|
862
861
|
platform;
|
|
862
|
+
model;
|
|
863
863
|
constructor(binOrDeps = {}) {
|
|
864
864
|
const deps = typeof binOrDeps === "string" ? { bin: binOrDeps } : binOrDeps;
|
|
865
865
|
this.bin = deps.bin ?? "claude";
|
|
866
866
|
this.platform = deps.platform ?? process.platform;
|
|
867
|
+
this.model = deps.model;
|
|
867
868
|
}
|
|
868
869
|
run(prompt, cwd, options) {
|
|
869
870
|
const { onUsage, onMessage, signal, logPath } = options ?? {};
|
|
870
871
|
return new Promise((resolve, reject) => {
|
|
871
872
|
const logStream = logPath ? createWriteStream(logPath) : null;
|
|
872
|
-
const
|
|
873
|
+
const args = [
|
|
873
874
|
"-p",
|
|
874
875
|
prompt,
|
|
875
876
|
"--verbose",
|
|
@@ -878,7 +879,9 @@ var ClaudeAgent = class {
|
|
|
878
879
|
"--json-schema",
|
|
879
880
|
JSON.stringify(AGENT_OUTPUT_SCHEMA),
|
|
880
881
|
"--dangerously-skip-permissions"
|
|
881
|
-
]
|
|
882
|
+
];
|
|
883
|
+
if (this.model) args.push("--model", this.model);
|
|
884
|
+
const child = spawn(this.bin, args, {
|
|
882
885
|
cwd,
|
|
883
886
|
shell: shouldUseWindowsShell$2(this.bin, this.platform),
|
|
884
887
|
stdio: [
|
|
@@ -2089,7 +2092,10 @@ function withTimeoutSignal(signal, timeoutMs) {
|
|
|
2089
2092
|
//#region src/core/agents/factory.ts
|
|
2090
2093
|
function createAgent(name, runInfo, pathOverride, model) {
|
|
2091
2094
|
switch (name) {
|
|
2092
|
-
case "claude": return new ClaudeAgent(
|
|
2095
|
+
case "claude": return new ClaudeAgent({
|
|
2096
|
+
bin: pathOverride,
|
|
2097
|
+
model
|
|
2098
|
+
});
|
|
2093
2099
|
case "codex": return new CodexAgent(runInfo.schemaPath, pathOverride);
|
|
2094
2100
|
case "opencode": return new OpenCodeAgent({
|
|
2095
2101
|
bin: pathOverride,
|
|
@@ -2334,7 +2340,10 @@ var Orchestrator = class extends EventEmitter {
|
|
|
2334
2340
|
}
|
|
2335
2341
|
recordFailure(notesSummary, recordSummary, learnings) {
|
|
2336
2342
|
appendNotes(this.runInfo.notesPath, this.state.currentIteration, notesSummary, [], learnings);
|
|
2337
|
-
|
|
2343
|
+
if (this.limits.commitAll) {
|
|
2344
|
+
commitAll(`fttm #${this.state.currentIteration}: [FAILED] ${recordSummary}`, this.cwd);
|
|
2345
|
+
this.state.commitCount = getBranchCommitCount(this.runInfo.baseCommit, this.cwd);
|
|
2346
|
+
} else resetHard(this.cwd);
|
|
2338
2347
|
this.state.failCount++;
|
|
2339
2348
|
this.state.consecutiveFailures++;
|
|
2340
2349
|
return {
|
|
@@ -3222,7 +3231,7 @@ function readReexecStdinPrompt(env) {
|
|
|
3222
3231
|
}
|
|
3223
3232
|
}
|
|
3224
3233
|
const program = new Command();
|
|
3225
|
-
program.name("fttm").description("Fly to the moon, fly to the mars - AI agents for humans").version(packageVersion).argument("[prompt]", "The objective for the coding agent").option("--agent <agent>", "Agent to use (claude, codex, rovodev, or opencode)").option("--model <model>", "Model to use (e.g., opencode/claude-sonnet-4-6, minimax-m2.7)").option("--max-iterations <n>", "Abort after N total iterations", parseNonNegativeInteger).option("--detach", "Run in background (default: false, use with --max-iterations for true daemon mode)", false).option("--max-tokens <n>", "Abort after N total input+output tokens", parseNonNegativeInteger).option("--prevent-sleep <mode>", "Prevent system sleep during the run (\"on\" or \"off\")", parseOnOffBoolean).option("--mock", "", false).action(async (promptArg, options) => {
|
|
3234
|
+
program.name("fttm").description("Fly to the moon, fly to the mars - AI agents for humans").version(packageVersion).argument("[prompt]", "The objective for the coding agent").option("--agent <agent>", "Agent to use (claude, codex, rovodev, or opencode)").option("--model <model>", "Model to use (e.g., opencode/claude-sonnet-4-6, minimax-m2.7)").option("--max-iterations <n>", "Abort after N total iterations", parseNonNegativeInteger).option("--detach", "Run in background (default: false, use with --max-iterations for true daemon mode)", false).option("--max-tokens <n>", "Abort after N total input+output tokens", parseNonNegativeInteger).option("--prevent-sleep <mode>", "Prevent system sleep during the run (\"on\" or \"off\")", parseOnOffBoolean).option("--commit", "Commit all iterations including failed ones (default: only commit successful iterations)", false).option("--mock", "", false).action(async (promptArg, options) => {
|
|
3226
3235
|
if (options.mock) {
|
|
3227
3236
|
const mock = new MockOrchestrator();
|
|
3228
3237
|
enterAltScreen();
|
|
@@ -3304,7 +3313,8 @@ program.name("fttm").description("Fly to the moon, fly to the mars - AI agents f
|
|
|
3304
3313
|
appendDebugLog("run:start", { args: process$1.argv.slice(2) });
|
|
3305
3314
|
const orchestrator = new Orchestrator(config, createAgent(config.agent, runInfo, config.agentPathOverride[config.agent], options.model), runInfo, prompt, cwd, startIteration, {
|
|
3306
3315
|
maxIterations: options.maxIterations,
|
|
3307
|
-
maxTokens: options.maxTokens
|
|
3316
|
+
maxTokens: options.maxTokens,
|
|
3317
|
+
commitAll: options.commit
|
|
3308
3318
|
});
|
|
3309
3319
|
let shutdownSignal = null;
|
|
3310
3320
|
enterAltScreen();
|