ferix-code 0.0.2-beta.10 → 0.0.2-beta.11
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/dist/index.js +26 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -71,7 +71,7 @@ import { Command } from "commander";
|
|
|
71
71
|
// package.json
|
|
72
72
|
var package_default = {
|
|
73
73
|
name: "ferix-code",
|
|
74
|
-
version: "0.0.2-beta.
|
|
74
|
+
version: "0.0.2-beta.11",
|
|
75
75
|
description: "Composable RALPH loops for AI coding agents - v2 with Effect",
|
|
76
76
|
type: "module",
|
|
77
77
|
bin: {
|
|
@@ -2379,8 +2379,8 @@ import { Layer as Layer14 } from "effect";
|
|
|
2379
2379
|
// src/layers/git/file-system.ts
|
|
2380
2380
|
init_esm_shims();
|
|
2381
2381
|
import { exec } from "child_process";
|
|
2382
|
-
import { access, mkdir, rm } from "fs/promises";
|
|
2383
|
-
import { join } from "path";
|
|
2382
|
+
import { access, copyFile, mkdir, rm } from "fs/promises";
|
|
2383
|
+
import { dirname, join } from "path";
|
|
2384
2384
|
import { promisify } from "util";
|
|
2385
2385
|
import { Effect as Effect4, Layer } from "effect";
|
|
2386
2386
|
|
|
@@ -2447,6 +2447,28 @@ function directoryExists(dirPath) {
|
|
|
2447
2447
|
catch: () => new Error("Directory does not exist")
|
|
2448
2448
|
}).pipe(Effect4.orElseSucceed(() => false));
|
|
2449
2449
|
}
|
|
2450
|
+
function copyUntrackedFiles(worktreeDir) {
|
|
2451
|
+
return Effect4.gen(function* () {
|
|
2452
|
+
const untrackedOutput = yield* gitExec(
|
|
2453
|
+
"git ls-files --others --exclude-standard"
|
|
2454
|
+
).pipe(Effect4.catchAll(() => Effect4.succeed("")));
|
|
2455
|
+
const untrackedFiles = untrackedOutput.split("\n").filter((f) => f.length > 0).filter((f) => !f.startsWith(".ferix/"));
|
|
2456
|
+
for (const file of untrackedFiles) {
|
|
2457
|
+
const srcPath = join(process.cwd(), file);
|
|
2458
|
+
const destPath = join(worktreeDir, file);
|
|
2459
|
+
yield* Effect4.tryPromise({
|
|
2460
|
+
try: async () => {
|
|
2461
|
+
await mkdir(dirname(destPath), { recursive: true });
|
|
2462
|
+
await copyFile(srcPath, destPath);
|
|
2463
|
+
},
|
|
2464
|
+
catch: () => new GitError({
|
|
2465
|
+
message: `Failed to copy untracked file: ${file}`,
|
|
2466
|
+
operation: "createWorktree"
|
|
2467
|
+
})
|
|
2468
|
+
}).pipe(Effect4.catchAll(() => Effect4.succeed(void 0)));
|
|
2469
|
+
}
|
|
2470
|
+
});
|
|
2471
|
+
}
|
|
2450
2472
|
var make = {
|
|
2451
2473
|
createWorktree: (sessionId, baseBranch) => Effect4.gen(function* () {
|
|
2452
2474
|
const worktreeDir = getWorktreeDir(sessionId);
|
|
@@ -2475,6 +2497,7 @@ var make = {
|
|
|
2475
2497
|
})
|
|
2476
2498
|
)
|
|
2477
2499
|
);
|
|
2500
|
+
yield* copyUntrackedFiles(worktreeDir);
|
|
2478
2501
|
return worktreeDir;
|
|
2479
2502
|
}),
|
|
2480
2503
|
removeWorktree: (sessionId) => Effect4.gen(function* () {
|