@laoyuehanni/dsh-git-worktree 0.4.1 → 0.4.3-dsh-0.1.2-alpha.5
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 +12 -0
- package/README.zh.md +12 -0
- package/lib/client.js +1073 -281
- package/lib/client.js.map +1 -1
- package/lib/git.d.ts +46 -2
- package/lib/git.js +72 -10
- package/lib/index.d.ts +3 -2
- package/lib/index.js +56 -17
- package/lib/routes.d.ts +55 -2
- package/lib/routes.js +178 -6
- package/lib/wire.d.ts +68 -0
- package/lib/wire.js +8 -0
- package/package.json +30 -17
package/lib/wire.d.ts
CHANGED
|
@@ -20,6 +20,14 @@ export declare const ROUTE_FETCH = "/plugin/git-worktree/fetch";
|
|
|
20
20
|
export declare const ROUTE_UPDATE = "/plugin/git-worktree/update";
|
|
21
21
|
/** POST ROUTE_PREFIX/group — git belonging facts for a batch of workspace paths. */
|
|
22
22
|
export declare const ROUTE_GROUP = "/plugin/git-worktree/group";
|
|
23
|
+
/** POST ROUTE_PREFIX/inspect — pre-delete facts for one worktree directory. */
|
|
24
|
+
export declare const ROUTE_INSPECT = "/plugin/git-worktree/inspect";
|
|
25
|
+
/** POST ROUTE_PREFIX/remove — delete one linked worktree (git registration + folder). */
|
|
26
|
+
export declare const ROUTE_REMOVE = "/plugin/git-worktree/remove";
|
|
27
|
+
/** POST ROUTE_PREFIX/exists — batch directory-existence probe (fs, no git). */
|
|
28
|
+
export declare const ROUTE_EXISTS = "/plugin/git-worktree/exists";
|
|
29
|
+
/** POST ROUTE_PREFIX/ensure-directory — mkdir -p a missing worktree storage slot. */
|
|
30
|
+
export declare const ROUTE_ENSURE_DIRECTORY = "/plugin/git-worktree/ensure-directory";
|
|
23
31
|
/** One selectable branch row. */
|
|
24
32
|
export interface BranchEntry {
|
|
25
33
|
/** Display name: a bare local name (`main`) or `<remote>/<name>`. */
|
|
@@ -156,3 +164,63 @@ export interface GroupWorkspacesResult {
|
|
|
156
164
|
/** Git facts per path; null marks a path outside any git repository. */
|
|
157
165
|
facts: Record<string, WorkspaceGitFacts | null>;
|
|
158
166
|
}
|
|
167
|
+
/** POST inspect request body. */
|
|
168
|
+
export interface InspectWorktreeBody {
|
|
169
|
+
/** The worktree directory to inspect (absolute). */
|
|
170
|
+
path: string;
|
|
171
|
+
}
|
|
172
|
+
/** POST inspect response body — the facts the remove-confirm dialog shows. */
|
|
173
|
+
export interface InspectWorktreeResult {
|
|
174
|
+
/** Uncommitted changes in the directory (staged + unstaged + untracked
|
|
175
|
+
* file rows of `git status --porcelain`). */
|
|
176
|
+
dirty: number;
|
|
177
|
+
/** Commits the checked-out branch is ahead of its upstream; absent = no
|
|
178
|
+
* upstream. Purely informational: the branch ref survives the removal, so
|
|
179
|
+
* these commits are NOT lost. */
|
|
180
|
+
ahead?: number;
|
|
181
|
+
}
|
|
182
|
+
/** POST remove request body. */
|
|
183
|
+
export interface RemoveWorktreeBody {
|
|
184
|
+
/** The linked worktree directory to delete (absolute). */
|
|
185
|
+
path: string;
|
|
186
|
+
/** True: force past uncommitted changes (the confirm dialog already
|
|
187
|
+
* showed the dirty count). */
|
|
188
|
+
force?: boolean;
|
|
189
|
+
}
|
|
190
|
+
/** POST remove response body. */
|
|
191
|
+
export interface RemoveWorktreeResult {
|
|
192
|
+
/** The removed worktree directory. */
|
|
193
|
+
path: string;
|
|
194
|
+
/** True when only a stale registration was pruned (the directory was
|
|
195
|
+
* already gone); false when `git worktree remove` deleted a live folder. */
|
|
196
|
+
pruned: boolean;
|
|
197
|
+
}
|
|
198
|
+
/** POST exists request body. */
|
|
199
|
+
export interface PathExistsBody {
|
|
200
|
+
/** Absolute directories to probe (deduped server-side). */
|
|
201
|
+
paths: string[];
|
|
202
|
+
}
|
|
203
|
+
/** POST exists response body — one entry per DISTINCT requested path; true =
|
|
204
|
+
* the path exists AND is a directory. The client gates the register action on
|
|
205
|
+
* this, so a missing folder never reaches the DSH workspace API. */
|
|
206
|
+
export interface PathExistsResult {
|
|
207
|
+
exists: Record<string, boolean>;
|
|
208
|
+
/** Per MISSING path: true when it sits DIRECTLY inside the plugin's
|
|
209
|
+
* worktree storage root — a slot this plugin planned, so rebuilding the
|
|
210
|
+
* empty directory is safe (historical sessions reattach automatically once
|
|
211
|
+
* realpath matches again). Absent paths and directories outside the root
|
|
212
|
+
* never appear here. */
|
|
213
|
+
rebuildable?: Record<string, boolean>;
|
|
214
|
+
}
|
|
215
|
+
/** POST ensure-directory request body. */
|
|
216
|
+
export interface EnsureDirectoryBody {
|
|
217
|
+
/** The missing directory to create (absolute; must sit directly inside the
|
|
218
|
+
* worktree storage root). */
|
|
219
|
+
path: string;
|
|
220
|
+
}
|
|
221
|
+
/** POST ensure-directory response body. */
|
|
222
|
+
export interface EnsureDirectoryResult {
|
|
223
|
+
/** Always true on 200 — the directory now exists (created, or already
|
|
224
|
+
* present as a directory). */
|
|
225
|
+
created: boolean;
|
|
226
|
+
}
|
package/lib/wire.js
CHANGED
|
@@ -20,3 +20,11 @@ export const ROUTE_FETCH = `${ROUTE_PREFIX}/fetch`;
|
|
|
20
20
|
export const ROUTE_UPDATE = `${ROUTE_PREFIX}/update`;
|
|
21
21
|
/** POST ROUTE_PREFIX/group — git belonging facts for a batch of workspace paths. */
|
|
22
22
|
export const ROUTE_GROUP = `${ROUTE_PREFIX}/group`;
|
|
23
|
+
/** POST ROUTE_PREFIX/inspect — pre-delete facts for one worktree directory. */
|
|
24
|
+
export const ROUTE_INSPECT = `${ROUTE_PREFIX}/inspect`;
|
|
25
|
+
/** POST ROUTE_PREFIX/remove — delete one linked worktree (git registration + folder). */
|
|
26
|
+
export const ROUTE_REMOVE = `${ROUTE_PREFIX}/remove`;
|
|
27
|
+
/** POST ROUTE_PREFIX/exists — batch directory-existence probe (fs, no git). */
|
|
28
|
+
export const ROUTE_EXISTS = `${ROUTE_PREFIX}/exists`;
|
|
29
|
+
/** POST ROUTE_PREFIX/ensure-directory — mkdir -p a missing worktree storage slot. */
|
|
30
|
+
export const ROUTE_ENSURE_DIRECTORY = `${ROUTE_PREFIX}/ensure-directory`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@laoyuehanni/dsh-git-worktree",
|
|
3
|
-
"version": "0.4.1",
|
|
3
|
+
"version": "0.4.3-dsh-0.1.2-alpha.5",
|
|
4
4
|
"description": "DSH plugin: branch visibility and git worktree isolation for Web UI sessions",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dsh",
|
|
@@ -46,7 +46,8 @@
|
|
|
46
46
|
],
|
|
47
47
|
"publishConfig": {
|
|
48
48
|
"registry": "https://registry.npmjs.org/",
|
|
49
|
-
"access": "public"
|
|
49
|
+
"access": "public",
|
|
50
|
+
"tag": "dsh-alpha"
|
|
50
51
|
},
|
|
51
52
|
"dsh": {
|
|
52
53
|
"bundle": {
|
|
@@ -55,11 +56,11 @@
|
|
|
55
56
|
"client": {
|
|
56
57
|
"platform": "web",
|
|
57
58
|
"inject": [
|
|
58
|
-
"@deepseek-ai/dsh-client-runtime",
|
|
59
59
|
"@deepseek-ai/dsh-client-ui-conversation",
|
|
60
60
|
"@deepseek-ai/dsh-client-ui-sidebar",
|
|
61
61
|
"@deepseek-ai/dsh-client-ui-settings",
|
|
62
|
-
"@deepseek-ai/dsh-client-ui-settings-plugins"
|
|
62
|
+
"@deepseek-ai/dsh-client-ui-settings-plugins",
|
|
63
|
+
"@deepseek-ai/dsh-client-ui-workspace"
|
|
63
64
|
]
|
|
64
65
|
}
|
|
65
66
|
},
|
|
@@ -74,27 +75,39 @@
|
|
|
74
75
|
},
|
|
75
76
|
"peerDependencies": {
|
|
76
77
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
77
|
-
"@deepseek-ai/dsh-host-webserver": "
|
|
78
|
-
"@deepseek-ai/dsh-settings": "
|
|
78
|
+
"@deepseek-ai/dsh-host-webserver": ">=0.1.2-alpha.4 <0.2.0",
|
|
79
|
+
"@deepseek-ai/dsh-settings": ">=0.1.2-alpha.4 <0.2.0",
|
|
79
80
|
"@deepseek-ai/schemastery": "^3.18.1"
|
|
80
81
|
},
|
|
81
82
|
"devDependencies": {
|
|
82
|
-
"@deepseek-ai/cordis": "^4.0.
|
|
83
|
-
"@deepseek-ai/dsh-api-
|
|
84
|
-
"@deepseek-ai/dsh-
|
|
85
|
-
"@deepseek-ai/dsh-
|
|
86
|
-
"@deepseek-ai/dsh-
|
|
87
|
-
"@deepseek-ai/dsh-client-
|
|
88
|
-
"@deepseek-ai/dsh-client-
|
|
89
|
-
"@deepseek-ai/dsh-client-
|
|
90
|
-
"@deepseek-ai/dsh-client-ui-
|
|
91
|
-
"@deepseek-ai/dsh-client-ui-
|
|
92
|
-
"@deepseek-ai/dsh-
|
|
83
|
+
"@deepseek-ai/cordis": "^4.0.2",
|
|
84
|
+
"@deepseek-ai/dsh-api-gateway": "^0.1.2-alpha.5",
|
|
85
|
+
"@deepseek-ai/dsh-api-remotes": "^0.1.2-alpha.5",
|
|
86
|
+
"@deepseek-ai/dsh-api-session-controller": "^0.1.2-alpha.5",
|
|
87
|
+
"@deepseek-ai/dsh-api-workspace-controller": "^0.1.2-alpha.5",
|
|
88
|
+
"@deepseek-ai/dsh-client-locale": "^0.1.2-alpha.5",
|
|
89
|
+
"@deepseek-ai/dsh-client-connection": "^0.1.2-alpha.5",
|
|
90
|
+
"@deepseek-ai/dsh-client-store": "^0.1.2-alpha.5",
|
|
91
|
+
"@deepseek-ai/dsh-client-ui-conversation": "^0.1.2-alpha.5",
|
|
92
|
+
"@deepseek-ai/dsh-client-ui-primitives": "^0.1.2-alpha.5",
|
|
93
|
+
"@deepseek-ai/dsh-client-ui-renderer": "^0.1.2-alpha.5",
|
|
94
|
+
"@deepseek-ai/dsh-client-ui-settings": "^0.1.2-alpha.5",
|
|
95
|
+
"@deepseek-ai/dsh-client-ui-settings-plugins": "^0.1.2-alpha.5",
|
|
96
|
+
"@deepseek-ai/dsh-client-ui-session": "^0.1.2-alpha.5",
|
|
97
|
+
"@deepseek-ai/dsh-client-ui-sidebar": "^0.1.2-alpha.5",
|
|
98
|
+
"@deepseek-ai/dsh-client-ui-slots": "^0.1.2-alpha.5",
|
|
99
|
+
"@deepseek-ai/dsh-client-ui-workspace": "^0.1.2-alpha.5",
|
|
100
|
+
"@deepseek-ai/dsh-host-webserver": "^0.1.2-alpha.5",
|
|
101
|
+
"@deepseek-ai/dsh-session": "^0.1.2-alpha.5",
|
|
102
|
+
"@deepseek-ai/dsh-settings": "^0.1.2-alpha.5",
|
|
103
|
+
"@deepseek-ai/dsh-util-workspace-path": "^0.1.2-alpha.5",
|
|
104
|
+
"@deepseek-ai/schemastery": "^3.18.2",
|
|
93
105
|
"@types/node": "^24.13.3",
|
|
94
106
|
"@types/react": "~18.3.1",
|
|
95
107
|
"@types/react-dom": "~18.3.1",
|
|
96
108
|
"playwright-core": "^1.55.1",
|
|
97
109
|
"react": "^18.2.0",
|
|
110
|
+
"react-dom": "^18.2.0",
|
|
98
111
|
"tsdown": "^0.14.0",
|
|
99
112
|
"typescript": "^5.9.3",
|
|
100
113
|
"vitest": "^3.2.4"
|