@saadnvd1/agent-os 0.3.464 → 0.3.466

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 (57) hide show
  1. package/README.md +20 -0
  2. package/app/api/fresh-start/route.ts +5 -3
  3. package/app/api/git/commit/route.ts +4 -3
  4. package/app/api/git/file-content/route.ts +4 -15
  5. package/app/api/git/history/[hash]/diff/route.ts +1 -1
  6. package/app/api/git/history/[hash]/route.ts +1 -1
  7. package/app/api/git/history/route.ts +1 -1
  8. package/app/api/git/push/route.ts +2 -2
  9. package/app/api/sessions/[id]/pr/route.ts +2 -2
  10. package/components/Chat/ChatPanel.tsx +23 -1
  11. package/components/Chat/Messages.tsx +2 -3
  12. package/components/Chat/StaleChip.tsx +55 -0
  13. package/components/Workspaces/FreshStartForm.tsx +29 -6
  14. package/data/chat/useChat.ts +10 -2
  15. package/lib/away/deploy.ts +3 -7
  16. package/lib/away/run.ts +6 -5
  17. package/lib/build.ts +2 -6
  18. package/lib/bus/index.ts +3 -0
  19. package/lib/chat/client-send.ts +11 -3
  20. package/lib/chat/drivers/claude-mapper.ts +11 -1
  21. package/lib/chat/drivers/claude.ts +9 -1
  22. package/lib/chat/events.ts +14 -1
  23. package/lib/chat/files.ts +31 -9
  24. package/lib/chat/refresh.ts +14 -2
  25. package/lib/chat/runner.ts +8 -1
  26. package/lib/chat/stale.ts +95 -0
  27. package/lib/chat/worker/host.ts +133 -4
  28. package/lib/chat/worker/protocol.ts +3 -0
  29. package/lib/done/remote.ts +5 -6
  30. package/lib/done/testing.ts +2 -7
  31. package/lib/done/worktree.ts +2 -2
  32. package/lib/git-exec.ts +334 -0
  33. package/lib/git-history.ts +29 -41
  34. package/lib/git-status.ts +45 -124
  35. package/lib/git.ts +44 -159
  36. package/lib/lumifyhub/publish.ts +2 -2
  37. package/lib/orchestrator/deliver.ts +9 -1
  38. package/lib/orchestrator/diff.ts +15 -13
  39. package/lib/orchestrator/rebase.ts +20 -24
  40. package/lib/orchestrator/repo-slug.ts +4 -7
  41. package/lib/orchestrator/repo.ts +24 -35
  42. package/lib/pr-generation.ts +2 -1
  43. package/lib/pr.ts +16 -57
  44. package/lib/schedules/start.ts +1 -0
  45. package/lib/sessions/worktree-setup.ts +17 -13
  46. package/lib/stacks/start.ts +7 -11
  47. package/lib/tasks/branch-worktree.ts +3 -2
  48. package/lib/tasks/finish.ts +5 -6
  49. package/lib/tasks/gh.ts +5 -0
  50. package/lib/tasks/move-testing.ts +2 -2
  51. package/lib/tasks/move.ts +3 -2
  52. package/lib/tasks/project-ref.ts +12 -19
  53. package/lib/tasks/session.ts +5 -5
  54. package/lib/worktree-hooks.ts +3 -7
  55. package/lib/worktree-placed.ts +3 -10
  56. package/lib/worktrees.ts +4 -42
  57. package/package.json +1 -1
@@ -16,17 +16,13 @@
16
16
  * own git directory, so it goes when the worktree does.
17
17
  */
18
18
 
19
- import { execFile } from "child_process";
20
- import { promisify } from "util";
21
19
  import fs from "fs";
22
20
  import os from "os";
23
21
  import path from "path";
22
+ import { git as runGit } from "./git-exec";
24
23
 
25
- const execFileAsync = promisify(execFile);
26
-
27
- const git = async (cwd: string, args: string[]) =>
28
- (await execFileAsync("git", ["-C", cwd, ...args], { timeout: 10_000 }))
29
- .stdout;
24
+ const git = (cwd: string, args: string[]) =>
25
+ runGit(cwd, args, { timeout: 10_000 });
30
26
 
31
27
  // The lines that are attribution, as an extended regex for `grep -iE`. The
32
28
  // same rule as lib/tasks/code-review.ts's ATTRIBUTION for PR bodies; a test
@@ -12,12 +12,10 @@
12
12
  */
13
13
 
14
14
  import { createHash } from "crypto";
15
- import { execFile } from "child_process";
16
- import { promisify } from "util";
17
15
  import fs from "fs";
18
16
  import path from "path";
17
+ import { git } from "./git-exec";
19
18
 
20
- const execFileAsync = promisify(execFile);
21
19
  const MANIFEST = "agentos-placed.json";
22
20
  // A copied folder bigger than this isn't recorded, so it keeps blocking.
23
21
  const MAX_FILES = 2000;
@@ -27,13 +25,8 @@ export interface Placed {
27
25
  files: Record<string, { size: number; sha: string }>;
28
26
  }
29
27
 
30
- async function gitText(cwd: string, args: string[]): Promise<string> {
31
- const { stdout } = await execFileAsync("git", ["-C", cwd, ...args], {
32
- timeout: 30000,
33
- maxBuffer: 16 * 1024 * 1024,
34
- });
35
- return stdout;
36
- }
28
+ const gitText = (cwd: string, args: string[]) =>
29
+ git(cwd, args, { timeout: 30000 });
37
30
 
38
31
  const manifestPath = async (worktree: string) =>
39
32
  path.join(
package/lib/worktrees.ts CHANGED
@@ -2,8 +2,6 @@
2
2
  * Git Worktree management for isolated feature development
3
3
  */
4
4
 
5
- import { execFile } from "child_process";
6
- import { promisify } from "util";
7
5
  import * as path from "path";
8
6
  import * as fs from "fs";
9
7
  import * as os from "os";
@@ -15,11 +13,10 @@ import {
15
13
  generateBranchName,
16
14
  } from "./git";
17
15
  import { installWorktreeHooks } from "./worktree-hooks";
18
-
19
- const execFileAsync = promisify(execFile);
16
+ import { gitResult, isGitError, worktreeList } from "./git-exec";
20
17
 
21
18
  const git = (cwd: string, args: string[], timeout: number) =>
22
- execFileAsync("git", ["-C", cwd, ...args], { timeout });
19
+ gitResult(cwd, args, { timeout });
23
20
 
24
21
  /**
25
22
  * The main checkout a worktree belongs to, or "" when it can't be read.
@@ -200,10 +197,7 @@ export function worktreeAddTimeout(
200
197
  return Math.min(MAX_ADD_TIMEOUT_MS, Math.round(ADD_TIMEOUT_MS * scale));
201
198
  }
202
199
 
203
- const isTimeout = (error: unknown) =>
204
- !!error &&
205
- typeof error === "object" &&
206
- (error as { killed?: boolean }).killed === true;
200
+ const isTimeout = (error: unknown) => isGitError(error) && error.timedOut;
207
201
 
208
202
  function describeAddError(error: unknown, timeout: number): Error {
209
203
  if (isTimeout(error))
@@ -406,40 +400,8 @@ export async function listWorktrees(projectPath: string): Promise<
406
400
  head: string;
407
401
  }>
408
402
  > {
409
- const resolvedProjectPath = resolvePath(projectPath);
410
-
411
403
  try {
412
- const { stdout } = await git(
413
- resolvedProjectPath,
414
- ["worktree", "list", "--porcelain"],
415
- 10000
416
- );
417
-
418
- const worktrees: Array<{ path: string; branch: string; head: string }> = [];
419
- const entries = stdout.split("\n\n").filter(Boolean);
420
-
421
- for (const entry of entries) {
422
- const lines = entry.split("\n");
423
- let worktreePath = "";
424
- let branch = "";
425
- let head = "";
426
-
427
- for (const line of lines) {
428
- if (line.startsWith("worktree ")) {
429
- worktreePath = line.slice(9);
430
- } else if (line.startsWith("branch ")) {
431
- branch = line.slice(7).replace("refs/heads/", "");
432
- } else if (line.startsWith("HEAD ")) {
433
- head = line.slice(5);
434
- }
435
- }
436
-
437
- if (worktreePath) {
438
- worktrees.push({ path: worktreePath, branch, head });
439
- }
440
- }
441
-
442
- return worktrees;
404
+ return await worktreeList(resolvePath(projectPath), { timeout: 10000 });
443
405
  } catch {
444
406
  return [];
445
407
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saadnvd1/agent-os",
3
- "version": "0.3.464",
3
+ "version": "0.3.466",
4
4
  "description": "Self-hosted web UI for managing Claude Code sessions",
5
5
  "bin": {
6
6
  "agent-os": "scripts/agent-os"