@sudocode-ai/local-server 0.1.0
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 +19 -0
- package/dist/cli.d.ts +7 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +105 -0
- package/dist/cli.js.map +7 -0
- package/dist/execution/engine/engine.d.ts +103 -0
- package/dist/execution/engine/engine.d.ts.map +1 -0
- package/dist/execution/engine/simple-engine.d.ts +190 -0
- package/dist/execution/engine/simple-engine.d.ts.map +1 -0
- package/dist/execution/engine/types.d.ts +116 -0
- package/dist/execution/engine/types.d.ts.map +1 -0
- package/dist/execution/output/ag-ui-adapter.d.ts +176 -0
- package/dist/execution/output/ag-ui-adapter.d.ts.map +1 -0
- package/dist/execution/output/ag-ui-integration.d.ts +96 -0
- package/dist/execution/output/ag-ui-integration.d.ts.map +1 -0
- package/dist/execution/output/claude-code-output-processor.d.ts +321 -0
- package/dist/execution/output/claude-code-output-processor.d.ts.map +1 -0
- package/dist/execution/output/index.d.ts +18 -0
- package/dist/execution/output/index.d.ts.map +1 -0
- package/dist/execution/output/types.d.ts +421 -0
- package/dist/execution/output/types.d.ts.map +1 -0
- package/dist/execution/process/builders/claude.d.ts +86 -0
- package/dist/execution/process/builders/claude.d.ts.map +1 -0
- package/dist/execution/process/index.d.ts +15 -0
- package/dist/execution/process/index.d.ts.map +1 -0
- package/dist/execution/process/manager.d.ts +133 -0
- package/dist/execution/process/manager.d.ts.map +1 -0
- package/dist/execution/process/simple-manager.d.ts +102 -0
- package/dist/execution/process/simple-manager.d.ts.map +1 -0
- package/dist/execution/process/types.d.ts +105 -0
- package/dist/execution/process/types.d.ts.map +1 -0
- package/dist/execution/process/utils.d.ts +53 -0
- package/dist/execution/process/utils.d.ts.map +1 -0
- package/dist/execution/resilience/circuit-breaker.d.ts +170 -0
- package/dist/execution/resilience/circuit-breaker.d.ts.map +1 -0
- package/dist/execution/resilience/executor.d.ts +109 -0
- package/dist/execution/resilience/executor.d.ts.map +1 -0
- package/dist/execution/resilience/index.d.ts +14 -0
- package/dist/execution/resilience/index.d.ts.map +1 -0
- package/dist/execution/resilience/resilient-executor.d.ts +86 -0
- package/dist/execution/resilience/resilient-executor.d.ts.map +1 -0
- package/dist/execution/resilience/retry.d.ts +161 -0
- package/dist/execution/resilience/retry.d.ts.map +1 -0
- package/dist/execution/resilience/types.d.ts +226 -0
- package/dist/execution/resilience/types.d.ts.map +1 -0
- package/dist/execution/transport/event-buffer.d.ts +119 -0
- package/dist/execution/transport/event-buffer.d.ts.map +1 -0
- package/dist/execution/transport/index.d.ts +10 -0
- package/dist/execution/transport/index.d.ts.map +1 -0
- package/dist/execution/transport/sse-transport.d.ts +146 -0
- package/dist/execution/transport/sse-transport.d.ts.map +1 -0
- package/dist/execution/transport/transport-manager.d.ts +176 -0
- package/dist/execution/transport/transport-manager.d.ts.map +1 -0
- package/dist/execution/workflow/index.d.ts +13 -0
- package/dist/execution/workflow/index.d.ts.map +1 -0
- package/dist/execution/workflow/linear-orchestrator.d.ts +216 -0
- package/dist/execution/workflow/linear-orchestrator.d.ts.map +1 -0
- package/dist/execution/workflow/memory-storage.d.ts +54 -0
- package/dist/execution/workflow/memory-storage.d.ts.map +1 -0
- package/dist/execution/workflow/orchestrator.d.ts +158 -0
- package/dist/execution/workflow/orchestrator.d.ts.map +1 -0
- package/dist/execution/workflow/types.d.ts +172 -0
- package/dist/execution/workflow/types.d.ts.map +1 -0
- package/dist/execution/workflow/utils.d.ts +89 -0
- package/dist/execution/workflow/utils.d.ts.map +1 -0
- package/dist/execution/worktree/config.d.ts +74 -0
- package/dist/execution/worktree/config.d.ts.map +1 -0
- package/dist/execution/worktree/git-cli.d.ts +151 -0
- package/dist/execution/worktree/git-cli.d.ts.map +1 -0
- package/dist/execution/worktree/index.d.ts +16 -0
- package/dist/execution/worktree/index.d.ts.map +1 -0
- package/dist/execution/worktree/manager.d.ts +184 -0
- package/dist/execution/worktree/manager.d.ts.map +1 -0
- package/dist/execution/worktree/types.d.ts +90 -0
- package/dist/execution/worktree/types.d.ts.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +104 -0
- package/dist/index.js.map +7 -0
- package/dist/public/assets/index-C4SmlXoo.js +568 -0
- package/dist/public/assets/index-C4SmlXoo.js.map +1 -0
- package/dist/public/assets/index-DE59j7ti.css +1 -0
- package/dist/public/assets/react-vendor-LX0UoTxg.js +60 -0
- package/dist/public/assets/react-vendor-LX0UoTxg.js.map +1 -0
- package/dist/public/assets/ui-vendor-_cxVHaqZ.js +54 -0
- package/dist/public/assets/ui-vendor-_cxVHaqZ.js.map +1 -0
- package/dist/public/favicon.ico +0 -0
- package/dist/public/index.html +16 -0
- package/dist/public/logo.png +0 -0
- package/dist/routes/executions-stream.d.ts +24 -0
- package/dist/routes/executions-stream.d.ts.map +1 -0
- package/dist/routes/executions.d.ts +19 -0
- package/dist/routes/executions.d.ts.map +1 -0
- package/dist/routes/feedback.d.ts +7 -0
- package/dist/routes/feedback.d.ts.map +1 -0
- package/dist/routes/issues.d.ts +7 -0
- package/dist/routes/issues.d.ts.map +1 -0
- package/dist/routes/relationships.d.ts +7 -0
- package/dist/routes/relationships.d.ts.map +1 -0
- package/dist/routes/specs.d.ts +7 -0
- package/dist/routes/specs.d.ts.map +1 -0
- package/dist/services/db.d.ts +33 -0
- package/dist/services/db.d.ts.map +1 -0
- package/dist/services/execution-lifecycle.d.ts +108 -0
- package/dist/services/execution-lifecycle.d.ts.map +1 -0
- package/dist/services/execution-service.d.ts +185 -0
- package/dist/services/execution-service.d.ts.map +1 -0
- package/dist/services/executions.d.ts +59 -0
- package/dist/services/executions.d.ts.map +1 -0
- package/dist/services/export.d.ts +24 -0
- package/dist/services/export.d.ts.map +1 -0
- package/dist/services/feedback.d.ts +40 -0
- package/dist/services/feedback.d.ts.map +1 -0
- package/dist/services/issues.d.ts +27 -0
- package/dist/services/issues.d.ts.map +1 -0
- package/dist/services/prompt-template-engine.d.ts +108 -0
- package/dist/services/prompt-template-engine.d.ts.map +1 -0
- package/dist/services/prompt-templates.d.ts +97 -0
- package/dist/services/prompt-templates.d.ts.map +1 -0
- package/dist/services/relationships.d.ts +35 -0
- package/dist/services/relationships.d.ts.map +1 -0
- package/dist/services/specs.d.ts +27 -0
- package/dist/services/specs.d.ts.map +1 -0
- package/dist/services/watcher.d.ts +50 -0
- package/dist/services/watcher.d.ts.map +1 -0
- package/dist/services/websocket.d.ts +127 -0
- package/dist/services/websocket.d.ts.map +1 -0
- package/dist/utils/sudocode-dir.d.ts +6 -0
- package/dist/utils/sudocode-dir.d.ts.map +1 -0
- package/package.json +74 -0
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Worktree Manager
|
|
3
|
+
*
|
|
4
|
+
* Manages git worktrees for session isolation.
|
|
5
|
+
*
|
|
6
|
+
* WORKTREE ISOLATION:
|
|
7
|
+
* ===================
|
|
8
|
+
* Each worktree created by this manager is completely isolated from the main
|
|
9
|
+
* repository. This prevents race conditions and unexpected modifications during
|
|
10
|
+
* concurrent executions.
|
|
11
|
+
*
|
|
12
|
+
* Isolation is achieved through:
|
|
13
|
+
* 1. Local database (.sudocode/cache.db) in each worktree
|
|
14
|
+
* 2. Synced JSONL files with latest state (including uncommitted changes)
|
|
15
|
+
* 3. Claude config (.claude/config.json) that forces MCP to use local database
|
|
16
|
+
*
|
|
17
|
+
* Key Benefit: Multiple executions can run concurrently without interfering
|
|
18
|
+
* with each other or the main repository. All MCP/CLI operations in a worktree
|
|
19
|
+
* stay contained within that worktree.
|
|
20
|
+
*
|
|
21
|
+
* See setupWorktreeEnvironment() method for detailed implementation.
|
|
22
|
+
*
|
|
23
|
+
* @module execution/worktree/manager
|
|
24
|
+
*/
|
|
25
|
+
import type { WorktreeCreateParams, WorktreeConfig, WorktreeInfo } from "./types.js";
|
|
26
|
+
import { type IGitCli } from "./git-cli.js";
|
|
27
|
+
/**
|
|
28
|
+
* IWorktreeManager - Interface for worktree management
|
|
29
|
+
*
|
|
30
|
+
* Provides methods for creating, validating, and cleaning up git worktrees.
|
|
31
|
+
* Implementations must handle race conditions with locking.
|
|
32
|
+
*/
|
|
33
|
+
export interface IWorktreeManager {
|
|
34
|
+
/**
|
|
35
|
+
* Create a new worktree for a session
|
|
36
|
+
*
|
|
37
|
+
* @param params - Worktree creation parameters
|
|
38
|
+
* @returns Promise that resolves when worktree is created
|
|
39
|
+
* @throws WorktreeError if creation fails
|
|
40
|
+
*/
|
|
41
|
+
createWorktree(params: WorktreeCreateParams): Promise<void>;
|
|
42
|
+
/**
|
|
43
|
+
* Ensure worktree exists, recreating if necessary
|
|
44
|
+
* Uses locking to prevent race conditions
|
|
45
|
+
*
|
|
46
|
+
* @param repoPath - Path to the main git repository
|
|
47
|
+
* @param branchName - Branch name for the worktree
|
|
48
|
+
* @param worktreePath - Where the worktree should exist
|
|
49
|
+
* @returns Promise that resolves when worktree exists
|
|
50
|
+
* @throws WorktreeError if ensure fails
|
|
51
|
+
*/
|
|
52
|
+
ensureWorktreeExists(repoPath: string, branchName: string, worktreePath: string): Promise<void>;
|
|
53
|
+
/**
|
|
54
|
+
* Clean up a worktree (filesystem + git metadata)
|
|
55
|
+
*
|
|
56
|
+
* @param worktreePath - Path to the worktree to cleanup
|
|
57
|
+
* @param repoPath - Optional path to repository (will try to infer if not provided)
|
|
58
|
+
* @returns Promise that resolves when cleanup is complete
|
|
59
|
+
* @throws WorktreeError if cleanup fails
|
|
60
|
+
*/
|
|
61
|
+
cleanupWorktree(worktreePath: string, repoPath?: string): Promise<void>;
|
|
62
|
+
/**
|
|
63
|
+
* Check if worktree is properly set up
|
|
64
|
+
* Validates both filesystem existence and git metadata registration
|
|
65
|
+
*
|
|
66
|
+
* @param repoPath - Path to the main git repository
|
|
67
|
+
* @param worktreePath - Path to check
|
|
68
|
+
* @returns Promise resolving to true if valid, false otherwise
|
|
69
|
+
*/
|
|
70
|
+
isWorktreeValid(repoPath: string, worktreePath: string): Promise<boolean>;
|
|
71
|
+
/**
|
|
72
|
+
* List all worktrees for a repository
|
|
73
|
+
*
|
|
74
|
+
* @param repoPath - Path to the main git repository
|
|
75
|
+
* @returns Promise resolving to list of worktree info
|
|
76
|
+
* @throws WorktreeError if listing fails
|
|
77
|
+
*/
|
|
78
|
+
listWorktrees(repoPath: string): Promise<WorktreeInfo[]>;
|
|
79
|
+
/**
|
|
80
|
+
* Get the current configuration
|
|
81
|
+
*
|
|
82
|
+
* @returns Current worktree configuration
|
|
83
|
+
*/
|
|
84
|
+
getConfig(): WorktreeConfig;
|
|
85
|
+
/**
|
|
86
|
+
* Check if a path is a valid git repository
|
|
87
|
+
*
|
|
88
|
+
* @param repoPath - Path to check
|
|
89
|
+
* @returns Promise resolving to true if valid repo, false otherwise
|
|
90
|
+
*/
|
|
91
|
+
isValidRepo(repoPath: string): Promise<boolean>;
|
|
92
|
+
/**
|
|
93
|
+
* List all branches in a repository
|
|
94
|
+
*
|
|
95
|
+
* @param repoPath - Path to the git repository
|
|
96
|
+
* @returns Promise resolving to array of branch names
|
|
97
|
+
*/
|
|
98
|
+
listBranches(repoPath: string): Promise<string[]>;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* WorktreeManager - Implementation of IWorktreeManager
|
|
102
|
+
*
|
|
103
|
+
* Manages git worktrees with proper locking, cleanup, and error recovery.
|
|
104
|
+
* Uses git CLI commands for reliability.
|
|
105
|
+
*/
|
|
106
|
+
export declare class WorktreeManager implements IWorktreeManager {
|
|
107
|
+
/** Per-path locks to prevent concurrent operations */
|
|
108
|
+
private locks;
|
|
109
|
+
/** Configuration loaded from .sudocode/config.json */
|
|
110
|
+
private config;
|
|
111
|
+
/** Git CLI wrapper */
|
|
112
|
+
private git;
|
|
113
|
+
/**
|
|
114
|
+
* Create a new WorktreeManager
|
|
115
|
+
*
|
|
116
|
+
* @param config - Worktree configuration
|
|
117
|
+
* @param git - Optional git CLI implementation (defaults to GitCli)
|
|
118
|
+
*/
|
|
119
|
+
constructor(config: WorktreeConfig, git?: IGitCli);
|
|
120
|
+
/**
|
|
121
|
+
* Get or create a lock for a specific path
|
|
122
|
+
*
|
|
123
|
+
* @param path - Path to lock
|
|
124
|
+
* @returns Mutex for the path
|
|
125
|
+
*/
|
|
126
|
+
private getLock;
|
|
127
|
+
createWorktree(params: WorktreeCreateParams): Promise<void>;
|
|
128
|
+
/**
|
|
129
|
+
* Setup isolated environment for worktree
|
|
130
|
+
*
|
|
131
|
+
* WORKTREE ISOLATION ARCHITECTURE:
|
|
132
|
+
* ================================
|
|
133
|
+
* Problem: Previously, MCP/CLI tools running in worktrees would search upward
|
|
134
|
+
* and find the main repository's database, causing race conditions and
|
|
135
|
+
* unexpected modifications to the main repo during execution.
|
|
136
|
+
*
|
|
137
|
+
* Solution: Each worktree gets its own isolated environment:
|
|
138
|
+
* - Local database (.sudocode/cache.db in worktree)
|
|
139
|
+
* - Synced JSONL files with latest state (including uncommitted changes)
|
|
140
|
+
* - Claude config that forces MCP to use the local database
|
|
141
|
+
*
|
|
142
|
+
* Benefits:
|
|
143
|
+
* - Worktree operations never affect main repository
|
|
144
|
+
* - Multiple executions can run concurrently without conflicts
|
|
145
|
+
* - Worktree gets consistent state (newly created issues are available)
|
|
146
|
+
* - Easy to inspect/debug worktree state after execution
|
|
147
|
+
*
|
|
148
|
+
* Flow:
|
|
149
|
+
* 1. Git creates worktree → checks out files from committed git tree
|
|
150
|
+
* 2. This method runs → copies latest JSONL (including uncommitted changes)
|
|
151
|
+
* 3. Initializes local DB from JSONL → worktree has complete state
|
|
152
|
+
* 4. Creates .claude/config.json → MCP uses local DB via env vars
|
|
153
|
+
* 5. Claude runs → all MCP operations stay in worktree
|
|
154
|
+
* 6. (Future) Merge worktree changes back to main after execution
|
|
155
|
+
*
|
|
156
|
+
* @param repoPath - Path to the main git repository
|
|
157
|
+
* @param worktreePath - Path to the worktree directory
|
|
158
|
+
*/
|
|
159
|
+
private setupWorktreeEnvironment;
|
|
160
|
+
ensureWorktreeExists(repoPath: string, branchName: string, worktreePath: string): Promise<void>;
|
|
161
|
+
cleanupWorktree(worktreePath: string, repoPath?: string): Promise<void>;
|
|
162
|
+
isWorktreeValid(repoPath: string, worktreePath: string): Promise<boolean>;
|
|
163
|
+
listWorktrees(repoPath: string): Promise<WorktreeInfo[]>;
|
|
164
|
+
getConfig(): WorktreeConfig;
|
|
165
|
+
isValidRepo(repoPath: string): Promise<boolean>;
|
|
166
|
+
listBranches(repoPath: string): Promise<string[]>;
|
|
167
|
+
/**
|
|
168
|
+
* Recreate a worktree (internal method)
|
|
169
|
+
*
|
|
170
|
+
* @param repoPath - Path to repository
|
|
171
|
+
* @param branchName - Branch name
|
|
172
|
+
* @param worktreePath - Worktree path
|
|
173
|
+
*/
|
|
174
|
+
private recreateWorktree;
|
|
175
|
+
/**
|
|
176
|
+
* Infer git repository path from a worktree
|
|
177
|
+
* Uses git rev-parse --git-common-dir
|
|
178
|
+
*
|
|
179
|
+
* @param worktreePath - Path to worktree
|
|
180
|
+
* @returns Repository path or undefined
|
|
181
|
+
*/
|
|
182
|
+
private inferRepoPath;
|
|
183
|
+
}
|
|
184
|
+
//# sourceMappingURL=manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../../src/execution/worktree/manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAKH,OAAO,KAAK,EACV,oBAAoB,EACpB,cAAc,EACd,YAAY,EACb,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAU,KAAK,OAAO,EAAE,MAAM,cAAc,CAAC;AAKpD;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;;;OAMG;IACH,cAAc,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE5D;;;;;;;;;OASG;IACH,oBAAoB,CAClB,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjB;;;;;;;OAOG;IACH,eAAe,CAAC,YAAY,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAExE;;;;;;;OAOG;IACH,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAE1E;;;;;;OAMG;IACH,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;IAEzD;;;;OAIG;IACH,SAAS,IAAI,cAAc,CAAC;IAE5B;;;;;OAKG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAEhD;;;;;OAKG;IACH,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;CACnD;AAED;;;;;GAKG;AACH,qBAAa,eAAgB,YAAW,gBAAgB;IACtD,sDAAsD;IACtD,OAAO,CAAC,KAAK,CAA4B;IAEzC,sDAAsD;IACtD,OAAO,CAAC,MAAM,CAAiB;IAE/B,sBAAsB;IACtB,OAAO,CAAC,GAAG,CAAU;IAErB;;;;;OAKG;gBACS,MAAM,EAAE,cAAc,EAAE,GAAG,CAAC,EAAE,OAAO;IAKjD;;;;;OAKG;IACH,OAAO,CAAC,OAAO;IAST,cAAc,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;IAgEjE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;YACW,wBAAwB;IAkIhC,oBAAoB,CACxB,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,IAAI,CAAC;IAkBV,eAAe,CACnB,YAAY,EAAE,MAAM,EACpB,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,IAAI,CAAC;IA0FV,eAAe,CACnB,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,OAAO,CAAC;IA6Bb,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAI9D,SAAS,IAAI,cAAc;IAIrB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAI/C,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAIvD;;;;;;OAMG;YACW,gBAAgB;IAwE9B;;;;;;OAMG;YACW,aAAa;CA0B5B"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Worktree Types
|
|
3
|
+
*
|
|
4
|
+
* Type definitions for worktree management system.
|
|
5
|
+
*
|
|
6
|
+
* @module execution/worktree/types
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Worktree creation parameters
|
|
10
|
+
*/
|
|
11
|
+
export interface WorktreeCreateParams {
|
|
12
|
+
/** Path to the main git repository */
|
|
13
|
+
repoPath: string;
|
|
14
|
+
/** Branch name for the worktree */
|
|
15
|
+
branchName: string;
|
|
16
|
+
/** Where to create the worktree */
|
|
17
|
+
worktreePath: string;
|
|
18
|
+
/** Branch to base the new branch on */
|
|
19
|
+
baseBranch: string;
|
|
20
|
+
/** Whether to create the branch */
|
|
21
|
+
createBranch: boolean;
|
|
22
|
+
/** Commit SHA to branch from */
|
|
23
|
+
commitSha?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Worktree information returned from git worktree list
|
|
27
|
+
*/
|
|
28
|
+
export interface WorktreeInfo {
|
|
29
|
+
/** Path to the worktree */
|
|
30
|
+
path: string;
|
|
31
|
+
/** Branch name */
|
|
32
|
+
branch: string;
|
|
33
|
+
/** Git commit hash */
|
|
34
|
+
commit: string;
|
|
35
|
+
/** Whether this is the main worktree */
|
|
36
|
+
isMain: boolean;
|
|
37
|
+
/** Whether the worktree is locked */
|
|
38
|
+
isLocked: boolean;
|
|
39
|
+
/** Reason for lock (if locked) */
|
|
40
|
+
lockReason?: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Worktree configuration (will be implemented in ISSUE-111)
|
|
44
|
+
* Placeholder type for now
|
|
45
|
+
*/
|
|
46
|
+
export interface WorktreeConfig {
|
|
47
|
+
/** Where to store worktrees */
|
|
48
|
+
worktreeStoragePath: string;
|
|
49
|
+
/** Auto-create branches for new sessions */
|
|
50
|
+
autoCreateBranches: boolean;
|
|
51
|
+
/** Auto-delete branches when session is cleaned up */
|
|
52
|
+
autoDeleteBranches: boolean;
|
|
53
|
+
/** Use sparse-checkout for worktrees */
|
|
54
|
+
enableSparseCheckout: boolean;
|
|
55
|
+
/** Patterns for sparse-checkout */
|
|
56
|
+
sparseCheckoutPatterns?: string[];
|
|
57
|
+
/** Branch naming prefix */
|
|
58
|
+
branchPrefix: string;
|
|
59
|
+
/** Cleanup orphaned worktrees on server startup */
|
|
60
|
+
cleanupOrphanedWorktreesOnStartup: boolean;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Worktree manager errors
|
|
64
|
+
*/
|
|
65
|
+
export declare class WorktreeError extends Error {
|
|
66
|
+
code: WorktreeErrorCode;
|
|
67
|
+
cause?: Error | undefined;
|
|
68
|
+
constructor(message: string, code: WorktreeErrorCode, cause?: Error | undefined);
|
|
69
|
+
}
|
|
70
|
+
export declare enum WorktreeErrorCode {
|
|
71
|
+
/** Git operation failed */
|
|
72
|
+
GIT_ERROR = "GIT_ERROR",
|
|
73
|
+
/** Worktree path already exists */
|
|
74
|
+
PATH_EXISTS = "PATH_EXISTS",
|
|
75
|
+
/** Worktree path not found */
|
|
76
|
+
PATH_NOT_FOUND = "PATH_NOT_FOUND",
|
|
77
|
+
/** Invalid path */
|
|
78
|
+
INVALID_PATH = "INVALID_PATH",
|
|
79
|
+
/** Branch not found */
|
|
80
|
+
BRANCH_NOT_FOUND = "BRANCH_NOT_FOUND",
|
|
81
|
+
/** Repository error */
|
|
82
|
+
REPOSITORY_ERROR = "REPOSITORY_ERROR",
|
|
83
|
+
/** Configuration error */
|
|
84
|
+
CONFIG_ERROR = "CONFIG_ERROR",
|
|
85
|
+
/** Locking error */
|
|
86
|
+
LOCK_ERROR = "LOCK_ERROR",
|
|
87
|
+
/** Cleanup failed */
|
|
88
|
+
CLEANUP_FAILED = "CLEANUP_FAILED"
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/execution/worktree/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,sCAAsC;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,mCAAmC;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,mCAAmC;IACnC,YAAY,EAAE,MAAM,CAAC;IACrB,uCAAuC;IACvC,UAAU,EAAE,MAAM,CAAC;IACnB,mCAAmC;IACnC,YAAY,EAAE,OAAO,CAAC;IACtB,gCAAgC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,2BAA2B;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,kBAAkB;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,sBAAsB;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,wCAAwC;IACxC,MAAM,EAAE,OAAO,CAAC;IAChB,qCAAqC;IACrC,QAAQ,EAAE,OAAO,CAAC;IAClB,kCAAkC;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,+BAA+B;IAC/B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,4CAA4C;IAC5C,kBAAkB,EAAE,OAAO,CAAC;IAC5B,sDAAsD;IACtD,kBAAkB,EAAE,OAAO,CAAC;IAC5B,wCAAwC;IACxC,oBAAoB,EAAE,OAAO,CAAC;IAC9B,mCAAmC;IACnC,sBAAsB,CAAC,EAAE,MAAM,EAAE,CAAC;IAClC,2BAA2B;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,mDAAmD;IACnD,iCAAiC,EAAE,OAAO,CAAC;CAC5C;AAED;;GAEG;AACH,qBAAa,aAAc,SAAQ,KAAK;IAG7B,IAAI,EAAE,iBAAiB;IACvB,KAAK,CAAC,EAAE,KAAK;gBAFpB,OAAO,EAAE,MAAM,EACR,IAAI,EAAE,iBAAiB,EACvB,KAAK,CAAC,EAAE,KAAK,YAAA;CAKvB;AAED,oBAAY,iBAAiB;IAC3B,2BAA2B;IAC3B,SAAS,cAAc;IACvB,mCAAmC;IACnC,WAAW,gBAAgB;IAC3B,8BAA8B;IAC9B,cAAc,mBAAmB;IACjC,mBAAmB;IACnB,YAAY,iBAAiB;IAC7B,uBAAuB;IACvB,gBAAgB,qBAAqB;IACrC,uBAAuB;IACvB,gBAAgB,qBAAqB;IACrC,0BAA0B;IAC1B,YAAY,iBAAiB;IAC7B,oBAAoB;IACpB,UAAU,eAAe;IACzB,qBAAqB;IACrB,cAAc,mBAAmB;CAClC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type Database from "better-sqlite3";
|
|
2
|
+
import { TransportManager } from "./execution/transport/transport-manager.js";
|
|
3
|
+
declare const app: import("express-serve-static-core").Express;
|
|
4
|
+
declare let db: Database.Database;
|
|
5
|
+
declare let transportManager: TransportManager;
|
|
6
|
+
export default app;
|
|
7
|
+
export { db, transportManager };
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAgB3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AAkB9E,QAAA,MAAM,GAAG,6CAAY,CAAC;AAetB,QAAA,IAAI,EAAE,EAAG,QAAQ,CAAC,QAAQ,CAAC;AAE3B,QAAA,IAAI,gBAAgB,EAAG,gBAAgB,CAAC;AAkYxC,eAAe,GAAG,CAAC;AACnB,OAAO,EAAE,EAAE,EAAE,gBAAgB,EAAE,CAAC"}
|