ferix-code 0.0.2-beta.10 → 0.0.2-beta.12

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/index.js +31 -6
  2. 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.10",
74
+ version: "0.0.2-beta.12",
75
75
  description: "Composable RALPH loops for AI coding agents - v2 with Effect",
76
76
  type: "module",
77
77
  bin: {
@@ -616,9 +616,11 @@ function separator(width) {
616
616
  );
617
617
  }
618
618
  function borderedLine(content, width) {
619
- const stripped = stripAnsi(content);
620
- const padding = Math.max(0, width - stripped.length - 4);
621
- return `${pc11.cyan(box.vertical)} ${content}${" ".repeat(padding)} ${pc11.cyan(box.vertical)}`;
619
+ const innerWidth = width - 4;
620
+ const finalContent = stripAnsi(content).length > innerWidth ? truncate(content, innerWidth) : content;
621
+ const finalStripped = stripAnsi(finalContent);
622
+ const padding = Math.max(0, innerWidth - finalStripped.length);
623
+ return `${pc11.cyan(box.vertical)} ${finalContent}${" ".repeat(padding)} ${pc11.cyan(box.vertical)}`;
622
624
  }
623
625
  function emptyBorderedLine(width) {
624
626
  const repeatCount = Math.max(0, width - 2);
@@ -2379,8 +2381,8 @@ import { Layer as Layer14 } from "effect";
2379
2381
  // src/layers/git/file-system.ts
2380
2382
  init_esm_shims();
2381
2383
  import { exec } from "child_process";
2382
- import { access, mkdir, rm } from "fs/promises";
2383
- import { join } from "path";
2384
+ import { access, copyFile, mkdir, rm } from "fs/promises";
2385
+ import { dirname, join } from "path";
2384
2386
  import { promisify } from "util";
2385
2387
  import { Effect as Effect4, Layer } from "effect";
2386
2388
 
@@ -2447,6 +2449,28 @@ function directoryExists(dirPath) {
2447
2449
  catch: () => new Error("Directory does not exist")
2448
2450
  }).pipe(Effect4.orElseSucceed(() => false));
2449
2451
  }
2452
+ function copyUntrackedFiles(worktreeDir) {
2453
+ return Effect4.gen(function* () {
2454
+ const untrackedOutput = yield* gitExec(
2455
+ "git ls-files --others --exclude-standard"
2456
+ ).pipe(Effect4.catchAll(() => Effect4.succeed("")));
2457
+ const untrackedFiles = untrackedOutput.split("\n").filter((f) => f.length > 0).filter((f) => !f.startsWith(".ferix/"));
2458
+ for (const file of untrackedFiles) {
2459
+ const srcPath = join(process.cwd(), file);
2460
+ const destPath = join(worktreeDir, file);
2461
+ yield* Effect4.tryPromise({
2462
+ try: async () => {
2463
+ await mkdir(dirname(destPath), { recursive: true });
2464
+ await copyFile(srcPath, destPath);
2465
+ },
2466
+ catch: () => new GitError({
2467
+ message: `Failed to copy untracked file: ${file}`,
2468
+ operation: "createWorktree"
2469
+ })
2470
+ }).pipe(Effect4.catchAll(() => Effect4.succeed(void 0)));
2471
+ }
2472
+ });
2473
+ }
2450
2474
  var make = {
2451
2475
  createWorktree: (sessionId, baseBranch) => Effect4.gen(function* () {
2452
2476
  const worktreeDir = getWorktreeDir(sessionId);
@@ -2475,6 +2499,7 @@ var make = {
2475
2499
  })
2476
2500
  )
2477
2501
  );
2502
+ yield* copyUntrackedFiles(worktreeDir);
2478
2503
  return worktreeDir;
2479
2504
  }),
2480
2505
  removeWorktree: (sessionId) => Effect4.gen(function* () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ferix-code",
3
- "version": "0.0.2-beta.10",
3
+ "version": "0.0.2-beta.12",
4
4
  "description": "Composable RALPH loops for AI coding agents - v2 with Effect",
5
5
  "type": "module",
6
6
  "bin": {