@cjhyy/code-shell-core 0.6.0-rc.13 → 0.6.0-rc.15

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 (87) hide show
  1. package/dist/capability-control/service.d.ts +2 -0
  2. package/dist/capability-control/service.js +4 -2
  3. package/dist/cc-orchestrator/codex-session-history.js +1 -1
  4. package/dist/cc-orchestrator/external-agent-bindings.js +1 -1
  5. package/dist/cc-orchestrator/external-agent-session-store.js +3 -1
  6. package/dist/cc-orchestrator/session-history.js +2 -2
  7. package/dist/cli/agent-server-stdio.js +7 -2
  8. package/dist/context/compaction.d.ts +8 -1
  9. package/dist/context/compaction.js +49 -4
  10. package/dist/context/manager.d.ts +11 -2
  11. package/dist/context/manager.js +64 -3
  12. package/dist/credentials/inject-credential-tool.d.ts +3 -1
  13. package/dist/credentials/inject-credential-tool.js +29 -10
  14. package/dist/credentials/use-credential-tool.d.ts +1 -0
  15. package/dist/credentials/use-credential-tool.js +3 -0
  16. package/dist/engine/engine.d.ts +9 -0
  17. package/dist/engine/engine.js +96 -17
  18. package/dist/engine/turn-loop.d.ts +3 -1
  19. package/dist/engine/turn-loop.js +4 -2
  20. package/dist/engine/types.d.ts +8 -0
  21. package/dist/git/worktree/crud.d.ts +69 -0
  22. package/dist/git/worktree/crud.js +206 -0
  23. package/dist/git/worktree/diff.d.ts +14 -0
  24. package/dist/git/worktree/diff.js +82 -0
  25. package/dist/git/worktree/git-exec.d.ts +7 -0
  26. package/dist/git/worktree/git-exec.js +51 -0
  27. package/dist/git/worktree/index.d.ts +5 -0
  28. package/dist/git/worktree/index.js +5 -0
  29. package/dist/git/worktree/query.d.ts +42 -0
  30. package/dist/git/worktree/query.js +121 -0
  31. package/dist/git/worktree/slug.d.ts +11 -0
  32. package/dist/git/worktree/slug.js +58 -0
  33. package/dist/git/worktree.d.ts +1 -127
  34. package/dist/git/worktree.js +5 -464
  35. package/dist/index.d.ts +28 -27
  36. package/dist/index.js +24 -24
  37. package/dist/plugins/installer/checkUpdate.d.ts +4 -1
  38. package/dist/plugins/installer/checkUpdate.js +4 -2
  39. package/dist/plugins/installer/install.js +2 -0
  40. package/dist/plugins/installer/parseSource.d.ts +4 -1
  41. package/dist/plugins/installer/parseSource.js +28 -10
  42. package/dist/plugins/installer/update.d.ts +4 -1
  43. package/dist/plugins/installer/update.js +5 -3
  44. package/dist/plugins/parseMarketplaceInput.d.ts +4 -1
  45. package/dist/plugins/parseMarketplaceInput.js +4 -3
  46. package/dist/preset/index.d.ts +1 -0
  47. package/dist/preset/index.js +6 -0
  48. package/dist/prompt/sections/base.md +1 -1
  49. package/dist/protocol/chat-session-manager.js +7 -0
  50. package/dist/protocol/server.d.ts +10 -0
  51. package/dist/protocol/server.js +88 -4
  52. package/dist/protocol/types.d.ts +6 -0
  53. package/dist/protocol/types.js +2 -0
  54. package/dist/runtime/background-shell.js +2 -3
  55. package/dist/services/auto-dream.d.ts +15 -4
  56. package/dist/services/auto-dream.js +20 -20
  57. package/dist/services/dream-consolidation.d.ts +2 -3
  58. package/dist/services/dream-consolidation.js +65 -15
  59. package/dist/services/extract-memories.d.ts +14 -5
  60. package/dist/services/extract-memories.js +20 -3
  61. package/dist/services/global-dream-promotion.d.ts +23 -0
  62. package/dist/services/global-dream-promotion.js +112 -0
  63. package/dist/services/memory-orchestrator.js +347 -34
  64. package/dist/session/memory.d.ts +56 -17
  65. package/dist/session/memory.js +337 -78
  66. package/dist/session/session-manager.d.ts +1 -1
  67. package/dist/session/session-manager.js +6 -6
  68. package/dist/session/transcript.d.ts +1 -1
  69. package/dist/session/transcript.js +17 -5
  70. package/dist/settings/manager.js +43 -12
  71. package/dist/settings/schema.d.ts +21 -0
  72. package/dist/settings/schema.js +12 -0
  73. package/dist/tool-system/builtin/index.js +18 -8
  74. package/dist/tool-system/builtin/memory.js +40 -8
  75. package/dist/tool-system/builtin/view-image.d.ts +2 -2
  76. package/dist/tool-system/builtin/view-image.js +100 -19
  77. package/dist/tool-system/builtin/worktree.d.ts +2 -0
  78. package/dist/tool-system/builtin/worktree.js +59 -11
  79. package/dist/tool-system/context.d.ts +11 -1
  80. package/dist/tool-system/mcp-manager.d.ts +8 -5
  81. package/dist/tool-system/mcp-manager.js +85 -55
  82. package/dist/tool-system/path-policy.d.ts +2 -0
  83. package/dist/tool-system/path-policy.js +28 -12
  84. package/dist/tool-system/workspace-bridge.d.ts +11 -0
  85. package/dist/tool-system/workspace-bridge.js +1 -0
  86. package/dist/types.d.ts +14 -0
  87. package/package.json +1 -1
@@ -0,0 +1,51 @@
1
+ import { execFile, execFileSync } from "node:child_process";
2
+ import { promisify } from "node:util";
3
+ import { resolveExecutable } from "../../utils/exec.js";
4
+ // git resolved via PATH×PATHEXT on Windows (.cmd/.exe shim); no-op on POSIX.
5
+ export const GIT_BIN = resolveExecutable("git");
6
+ const execFileAsync = promisify(execFile);
7
+ export async function execGit(cwd, args, timeout = 10000) {
8
+ const { stdout } = await execFileAsync(GIT_BIN, args, {
9
+ cwd,
10
+ encoding: "utf-8",
11
+ timeout,
12
+ });
13
+ return stdout;
14
+ }
15
+ export function execGitSync(cwd, args, timeout = 10000) {
16
+ return execFileSync(GIT_BIN, args, {
17
+ cwd,
18
+ encoding: "utf-8",
19
+ timeout,
20
+ });
21
+ }
22
+ export async function gitOutput(cwd, args, timeout = 10000) {
23
+ try {
24
+ return await execGit(cwd, args, timeout);
25
+ }
26
+ catch {
27
+ return undefined;
28
+ }
29
+ }
30
+ export function gitOutputSync(cwd, args, timeout = 10000) {
31
+ try {
32
+ return execGitSync(cwd, args, timeout);
33
+ }
34
+ catch {
35
+ return undefined;
36
+ }
37
+ }
38
+ export function gitErrorMessage(err) {
39
+ const stderr = err.stderr;
40
+ if (Buffer.isBuffer(stderr)) {
41
+ const msg = stderr.toString("utf-8").trim();
42
+ if (msg)
43
+ return msg;
44
+ }
45
+ if (typeof stderr === "string" && stderr.trim())
46
+ return stderr.trim();
47
+ return err instanceof Error ? err.message : String(err);
48
+ }
49
+ export function normalizeBranchName(branch) {
50
+ return branch.replace(/^refs\/heads\//, "");
51
+ }
@@ -0,0 +1,5 @@
1
+ export * from "./git-exec.js";
2
+ export * from "./slug.js";
3
+ export * from "./diff.js";
4
+ export * from "./query.js";
5
+ export * from "./crud.js";
@@ -0,0 +1,5 @@
1
+ export * from "./git-exec.js";
2
+ export * from "./slug.js";
3
+ export * from "./diff.js";
4
+ export * from "./query.js";
5
+ export * from "./crud.js";
@@ -0,0 +1,42 @@
1
+ import type { SessionWorkspace } from "../../types.js";
2
+ import { type WorktreeDiffSummary } from "./diff.js";
3
+ export interface WorktreeWorkspaceOwner {
4
+ sessionId: string;
5
+ workspace?: SessionWorkspace;
6
+ }
7
+ export interface ListWorktreesFastOptions {
8
+ currentSessionId?: string;
9
+ workspaceOwners?: WorktreeWorkspaceOwner[];
10
+ owners?: WorktreeWorkspaceOwner[];
11
+ prefix?: string;
12
+ }
13
+ export interface ListWorktreesOptions extends ListWorktreesFastOptions {
14
+ includeDiffSummary?: boolean;
15
+ }
16
+ export interface WorktreeInfo {
17
+ path: string;
18
+ branch: string;
19
+ head: string;
20
+ isMain?: boolean;
21
+ isManaged?: boolean;
22
+ diff?: WorktreeDiffSummary;
23
+ occupiedBySessionIds?: string[];
24
+ occupiedByOtherSession?: boolean;
25
+ }
26
+ /**
27
+ * Find the canonical git root (resolves worktree -> main repo).
28
+ */
29
+ export declare function findGitRoot(cwd: string): Promise<string>;
30
+ export declare function findMainWorktreeRoot(cwd: string): Promise<string>;
31
+ export declare function findWorktreeForBranch(cwd: string, branch: string): Promise<string | undefined>;
32
+ export declare function assertBranchNotCheckedOut(cwd: string, branch: string): Promise<void>;
33
+ export declare function branchExists(cwd: string, branch: string): Promise<boolean>;
34
+ export declare function isGitWorktreeRoot(cwd: string): Promise<boolean>;
35
+ export declare function currentBranch(cwd: string): Promise<string | undefined>;
36
+ export declare function listWorktreesFast(cwd: string, opts?: ListWorktreesFastOptions): Promise<WorktreeInfo[]>;
37
+ /**
38
+ * List active worktrees. Kept for internal/test compatibility; use
39
+ * listWorktreesFast for UI lists that should not block on diff work.
40
+ */
41
+ export declare function listWorktrees(cwd: string, opts?: ListWorktreesOptions): Promise<WorktreeInfo[]>;
42
+ export declare function ownersForWorktree(path: string, owners: WorktreeWorkspaceOwner[]): string[];
@@ -0,0 +1,121 @@
1
+ import { existsSync } from "node:fs";
2
+ import { dirname, join, resolve } from "node:path";
3
+ import { getWorktreeDiff } from "./diff.js";
4
+ import { execGit, gitOutput, normalizeBranchName } from "./git-exec.js";
5
+ import { isManagedWorktreeBranch } from "./slug.js";
6
+ /**
7
+ * Find the canonical git root (resolves worktree -> main repo).
8
+ */
9
+ export async function findGitRoot(cwd) {
10
+ return await findMainWorktreeRoot(cwd);
11
+ }
12
+ export async function findMainWorktreeRoot(cwd) {
13
+ const commonDir = (await execGit(cwd, ["rev-parse", "--path-format=absolute", "--git-common-dir"], 5000)).trim();
14
+ return dirname(commonDir);
15
+ }
16
+ export async function findWorktreeForBranch(cwd, branch) {
17
+ const normalized = normalizeBranchName(branch);
18
+ return (await listWorktreesFast(cwd)).find((entry) => entry.branch === normalized)?.path;
19
+ }
20
+ export async function assertBranchNotCheckedOut(cwd, branch) {
21
+ const existingPath = await findWorktreeForBranch(cwd, branch);
22
+ if (existingPath) {
23
+ throw new Error(`branch ${normalizeBranchName(branch)} already checked out at ${existingPath}`);
24
+ }
25
+ }
26
+ export async function branchExists(cwd, branch) {
27
+ const out = await gitOutput(cwd, ["branch", "--list", normalizeBranchName(branch)], 10000);
28
+ return (out?.trim().length ?? 0) > 0;
29
+ }
30
+ export async function isGitWorktreeRoot(cwd) {
31
+ if (!existsSync(join(cwd, ".git")))
32
+ return false;
33
+ try {
34
+ const inside = (await execGit(cwd, ["rev-parse", "--is-inside-work-tree"], 5000)).trim();
35
+ if (inside !== "true")
36
+ return false;
37
+ const topLevel = (await execGit(cwd, ["rev-parse", "--path-format=absolute", "--show-toplevel"], 5000)).trim();
38
+ return resolve(topLevel) === resolve(cwd);
39
+ }
40
+ catch {
41
+ return false;
42
+ }
43
+ }
44
+ export async function currentBranch(cwd) {
45
+ const branch = (await gitOutput(cwd, ["branch", "--show-current"], 5000))?.trim();
46
+ return branch || undefined;
47
+ }
48
+ export async function listWorktreesFast(cwd, opts = {}) {
49
+ let raw;
50
+ try {
51
+ raw = (await execGit(cwd, ["worktree", "list", "--porcelain"], 10000)).trim();
52
+ }
53
+ catch {
54
+ return [];
55
+ }
56
+ if (!raw)
57
+ return [];
58
+ const entries = [];
59
+ let current = { path: "", branch: "", head: "" };
60
+ for (const line of raw.split("\n")) {
61
+ if (line.startsWith("worktree ")) {
62
+ if (current.path)
63
+ entries.push(current);
64
+ current = { path: line.slice(9), branch: "", head: "" };
65
+ }
66
+ else if (line.startsWith("HEAD ")) {
67
+ current.head = line.slice(5, 13);
68
+ }
69
+ else if (line.startsWith("branch ")) {
70
+ current.branch = normalizeBranchName(line.slice(7));
71
+ }
72
+ }
73
+ if (current.path)
74
+ entries.push(current);
75
+ let mainRoot = "";
76
+ try {
77
+ mainRoot = await findMainWorktreeRoot(cwd);
78
+ }
79
+ catch {
80
+ mainRoot = entries[0]?.path ?? "";
81
+ }
82
+ const owners = opts.workspaceOwners ?? opts.owners ?? [];
83
+ return entries.map((entry) => {
84
+ const ownerIds = ownersForWorktree(entry.path, owners);
85
+ return {
86
+ ...entry,
87
+ ...(mainRoot ? { isMain: resolve(entry.path) === resolve(mainRoot) } : {}),
88
+ isManaged: Boolean(entry.branch) && isManagedWorktreeBranch(entry.branch, opts.prefix),
89
+ ...(ownerIds.length > 0
90
+ ? {
91
+ occupiedBySessionIds: ownerIds,
92
+ occupiedByOtherSession: ownerIds.some((id) => id !== opts.currentSessionId),
93
+ }
94
+ : {}),
95
+ };
96
+ });
97
+ }
98
+ /**
99
+ * List active worktrees. Kept for internal/test compatibility; use
100
+ * listWorktreesFast for UI lists that should not block on diff work.
101
+ */
102
+ export async function listWorktrees(cwd, opts = {}) {
103
+ const entries = await listWorktreesFast(cwd, opts);
104
+ if (!opts.includeDiffSummary)
105
+ return entries;
106
+ return Promise.all(entries.map(async (entry) => ({
107
+ ...entry,
108
+ diff: await getWorktreeDiff(entry.path),
109
+ })));
110
+ }
111
+ export function ownersForWorktree(path, owners) {
112
+ const target = resolve(path);
113
+ return owners
114
+ .filter((owner) => {
115
+ const workspace = owner.workspace;
116
+ if (!workspace)
117
+ return false;
118
+ return resolve(workspace.root) === target;
119
+ })
120
+ .map((owner) => owner.sessionId);
121
+ }
@@ -0,0 +1,11 @@
1
+ export declare const DEFAULT_WORKTREE_BRANCH_PREFIX = "worktree/";
2
+ export declare const HISTORICAL_WORKTREE_BRANCH_PREFIX = "worktree/";
3
+ /**
4
+ * Validate worktree slug to prevent path traversal attacks.
5
+ */
6
+ export declare function validateWorktreeSlug(slug: string): void;
7
+ export declare function normalizeWorktreeBranchPrefix(prefix?: string | undefined): string;
8
+ export declare function isValidWorktreeBranchPrefix(prefix: string): boolean;
9
+ export declare function applyPrefix(prefix: string | undefined, slug: string, sessionId: string): string;
10
+ export declare function managedBranchPrefixes(prefix?: string): string[];
11
+ export declare function isManagedWorktreeBranch(branch: string, prefix?: string): boolean;
@@ -0,0 +1,58 @@
1
+ export const DEFAULT_WORKTREE_BRANCH_PREFIX = "worktree/";
2
+ export const HISTORICAL_WORKTREE_BRANCH_PREFIX = "worktree/";
3
+ /**
4
+ * Validate worktree slug to prevent path traversal attacks.
5
+ */
6
+ export function validateWorktreeSlug(slug) {
7
+ if (slug.trim().length === 0)
8
+ throw new Error("Worktree slug cannot be empty");
9
+ if (slug.length > 64)
10
+ throw new Error("Worktree slug too long (max 64 chars)");
11
+ if (/[^a-zA-Z0-9._-]/.test(slug))
12
+ throw new Error("Worktree slug contains invalid characters");
13
+ if (slug.startsWith(".") || slug.includes(".."))
14
+ throw new Error("Worktree slug cannot start with '.' or contain '..'");
15
+ }
16
+ export function normalizeWorktreeBranchPrefix(prefix = DEFAULT_WORKTREE_BRANCH_PREFIX) {
17
+ const raw = (prefix ?? DEFAULT_WORKTREE_BRANCH_PREFIX).trim();
18
+ if (!isValidWorktreeBranchPrefix(raw)) {
19
+ throw new Error(`Invalid worktree branch prefix: ${prefix ?? ""}`);
20
+ }
21
+ return raw.endsWith("/") ? raw : `${raw}/`;
22
+ }
23
+ export function isValidWorktreeBranchPrefix(prefix) {
24
+ const raw = prefix.trim();
25
+ if (!raw)
26
+ return false;
27
+ if (raw.startsWith("/") || raw.includes("//"))
28
+ return false;
29
+ if (raw.includes("..") || raw.includes("@{"))
30
+ return false;
31
+ if (/[\x00-\x20~^:?*[\]\\]/.test(raw))
32
+ return false;
33
+ const withoutTrailingSlash = raw.endsWith("/") ? raw.slice(0, -1) : raw;
34
+ if (!withoutTrailingSlash)
35
+ return false;
36
+ return withoutTrailingSlash.split("/").every((part) => {
37
+ if (!part)
38
+ return false;
39
+ if (part.startsWith(".") || part.endsWith("."))
40
+ return false;
41
+ if (part.endsWith(".lock"))
42
+ return false;
43
+ return true;
44
+ });
45
+ }
46
+ export function applyPrefix(prefix, slug, sessionId) {
47
+ validateWorktreeSlug(slug);
48
+ return `${normalizeWorktreeBranchPrefix(prefix)}${slug}-${sessionId.slice(0, 8)}`;
49
+ }
50
+ export function managedBranchPrefixes(prefix) {
51
+ const configured = normalizeWorktreeBranchPrefix(prefix);
52
+ return configured === HISTORICAL_WORKTREE_BRANCH_PREFIX
53
+ ? [configured]
54
+ : [configured, HISTORICAL_WORKTREE_BRANCH_PREFIX];
55
+ }
56
+ export function isManagedWorktreeBranch(branch, prefix) {
57
+ return managedBranchPrefixes(prefix).some((candidate) => branch.startsWith(candidate));
58
+ }
@@ -1,127 +1 @@
1
- /**
2
- * Git worktree management — create/remove isolated worktrees for agents.
3
- */
4
- import type { SandboxBackend } from "../tool-system/sandbox/index.js";
5
- import type { SessionWorkspace } from "../types.js";
6
- export interface WorktreeSession {
7
- originalCwd: string;
8
- worktreePath: string;
9
- worktreeName: string;
10
- worktreeBranch: string;
11
- originalBranch?: string;
12
- sessionId: string;
13
- createdAt: number;
14
- }
15
- /** Per-platform setup/cleanup scripts (a project's localEnvironment). */
16
- export interface PlatformScripts {
17
- default?: string;
18
- macos?: string;
19
- linux?: string;
20
- windows?: string;
21
- }
22
- /**
23
- * Pick the setup/cleanup script for the running platform, falling back to
24
- * `default`. Empty/whitespace-only scripts are treated as absent so a project
25
- * can leave a platform key blank without spawning an empty shell. `platform`
26
- * defaults to `process.platform` so callers usually omit it; tests pass a
27
- * fixed value.
28
- */
29
- export declare function selectPlatformScript(scripts: PlatformScripts | undefined, platform?: NodeJS.Platform): string | undefined;
30
- /**
31
- * Validate worktree slug to prevent path traversal attacks.
32
- */
33
- export declare function validateWorktreeSlug(slug: string): void;
34
- /**
35
- * Find the canonical git root (resolves worktree → main repo).
36
- */
37
- export declare function findGitRoot(cwd: string): string;
38
- export declare function findMainWorktreeRoot(cwd: string): string;
39
- export declare function findWorktreeForBranch(cwd: string, branch: string): string | undefined;
40
- export declare function assertBranchNotCheckedOut(cwd: string, branch: string): void;
41
- export declare function branchExists(cwd: string, branch: string): boolean;
42
- export declare function isGitWorktreeRoot(cwd: string): boolean;
43
- export declare function currentBranch(cwd: string): string | undefined;
44
- /**
45
- * Create an isolated git worktree for an agent session.
46
- */
47
- export declare function createWorktree(cwd: string, slug: string, sessionId: string): WorktreeSession;
48
- export interface WorktreeSetupResult {
49
- /** True if no setup script was configured for this platform (nothing ran). */
50
- skipped: boolean;
51
- /** True if a script ran and exited 0. */
52
- ok: boolean;
53
- /** Combined stdout/stderr, for surfacing to the user on failure. */
54
- output: string;
55
- /** Exit code when a script ran; undefined when skipped. */
56
- exitCode?: number | null;
57
- }
58
- /**
59
- * Run a project's `localEnvironment.setupScripts` once, in the freshly-created
60
- * worktree's root, right after `git worktree add`. This mirrors Codex's
61
- * local-environment semantics: setup belongs to the *worktree* lifecycle, not
62
- * the conversation — it runs when the isolated copy is born so e.g. `bun
63
- * install` or `cp .env.example .env` happens before the agent works there.
64
- *
65
- * Failure is non-fatal by design (Beta decision 2026-06-08, "警告但继续"): a
66
- * broken setup script shouldn't strand the agent outside a worktree it already
67
- * created. The caller surfaces `output` as a warning and proceeds. cleanup
68
- * scripts are intentionally NOT auto-run on exit (same decision).
69
- *
70
- * Reuses the same sandbox + env primitives as the Bash tool so the setup
71
- * command sees the project's `localEnvironment.env` and runs under the same
72
- * isolation the agent's later commands will.
73
- */
74
- export declare function runWorktreeSetup(worktreePath: string, script: string | undefined, opts?: {
75
- sandbox?: SandboxBackend;
76
- shellEnv?: Record<string, string>;
77
- timeoutMs?: number;
78
- signal?: AbortSignal;
79
- }): Promise<WorktreeSetupResult>;
80
- export interface RemoveWorktreeResult {
81
- /** True once `git worktree remove` completed and the directory is gone. */
82
- dirRemoved: boolean;
83
- /** The branch targeted for deletion when removeBranch=true. */
84
- branch?: string;
85
- /** True when removeBranch=true and branch deletion completed. */
86
- branchDeleted?: boolean;
87
- /** Non-empty when the worktree directory is gone but branch deletion failed. */
88
- branchError?: string;
89
- }
90
- /**
91
- * Remove a worktree and optionally its branch.
92
- */
93
- export declare function removeWorktree(worktreePath: string, removeBranch?: boolean): RemoveWorktreeResult;
94
- export declare function worktreeHasUncommittedChanges(worktreePath: string): boolean;
95
- export declare function worktreeHasUncommittedOrAheadChanges(worktreePath: string, baseRef?: string): boolean;
96
- export interface WorktreeDiffSummary {
97
- /** Best-effort base used for the branch comparison, usually main/master. */
98
- baseRef?: string;
99
- /** Unique files changed either by commits ahead of base or by uncommitted changes. */
100
- changedFiles: number;
101
- /** Commits reachable from HEAD but not from baseRef. */
102
- aheadCommits: number;
103
- /** True when `git status --porcelain` reports local changes. */
104
- hasUncommittedChanges: boolean;
105
- }
106
- export interface WorktreeWorkspaceOwner {
107
- sessionId: string;
108
- workspace?: SessionWorkspace;
109
- }
110
- export interface ListWorktreesOptions {
111
- includeDiffSummary?: boolean;
112
- currentSessionId?: string;
113
- workspaceOwners?: WorktreeWorkspaceOwner[];
114
- }
115
- export interface WorktreeInfo {
116
- path: string;
117
- branch: string;
118
- head: string;
119
- isMain?: boolean;
120
- diff?: WorktreeDiffSummary;
121
- occupiedBySessionIds?: string[];
122
- occupiedByOtherSession?: boolean;
123
- }
124
- /**
125
- * List active worktrees.
126
- */
127
- export declare function listWorktrees(cwd: string, opts?: ListWorktreesOptions): WorktreeInfo[];
1
+ export * from "./worktree/index.js";