@codeasier/dsh-plugin-orca-projects 0.0.0-stage → 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/LICENSE +21 -0
- package/README.md +273 -2
- package/README.zh.md +108 -0
- package/client.js +4772 -0
- package/cordis.patch.yml +8 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.js +249 -0
- package/dist/index.js.map +1 -0
- package/icon.svg +7 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +7 -0
- package/package.json +86 -3
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Bundle layer for @codeasier/dsh-plugin-orca-projects.
|
|
2
|
+
#
|
|
3
|
+
# A bundle patch inserts rows. `config` is replaced wholesale by a profile
|
|
4
|
+
# override, so leave defaults to the Config schema and document the keys in
|
|
5
|
+
# README.md.
|
|
6
|
+
- insert:
|
|
7
|
+
- id: orca-projects
|
|
8
|
+
name: "@codeasier/dsh-plugin-orca-projects"
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Orca Projects — a Web/Desktop client plugin that replaces the shipped
|
|
3
|
+
* workspace browser with an Orca-like project sidebar.
|
|
4
|
+
*
|
|
5
|
+
* The browser half owns every visual contribution. This Host half contributes
|
|
6
|
+
* one authenticated fetch route used to consolidate Git worktrees under one
|
|
7
|
+
* project: the browser cannot read `.git` itself, so the Host resolves each
|
|
8
|
+
* registered workspace with {@link resolveRepositoryResults} and returns the
|
|
9
|
+
* repository identity, including checkouts recorded under `.git/worktrees` that
|
|
10
|
+
* DSH has not registered. The route is optional: without it the browser keeps
|
|
11
|
+
* the path-based fallback.
|
|
12
|
+
*
|
|
13
|
+
* @module @codeasier/dsh-plugin-orca-projects
|
|
14
|
+
*/
|
|
15
|
+
import { Context } from "@deepseek-ai/cordis";
|
|
16
|
+
/** Stable Loader identity; keep it equal to the patch row id. */
|
|
17
|
+
export declare const name = "orca-projects";
|
|
18
|
+
/** Exact authenticated route the browser half calls. */
|
|
19
|
+
export declare const REPOSITORY_ROUTE = "/api/orca-projects/resolve";
|
|
20
|
+
/**
|
|
21
|
+
* Register the repository-resolution route.
|
|
22
|
+
*
|
|
23
|
+
* `ctx.inject` waits for the Connection service instead of requiring it at
|
|
24
|
+
* Loader activation, so a Host profile without the Web transport simply keeps
|
|
25
|
+
* the browser-side fallback.
|
|
26
|
+
*
|
|
27
|
+
* @param ctx - the plugin context.
|
|
28
|
+
*/
|
|
29
|
+
export declare function apply(ctx: Context): void;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import { readFile, readdir, realpath, stat } from "node:fs/promises";
|
|
2
|
+
import { basename, dirname, isAbsolute, join, resolve, sep } from "node:path";
|
|
3
|
+
// src/repo.ts
|
|
4
|
+
/**
|
|
5
|
+
* Probe each workspace independently, retaining negative outcomes so the client
|
|
6
|
+
* can distinguish a confirmed ordinary directory from unavailable metadata.
|
|
7
|
+
* Missing paths and failed probes still permit the client's path fallback.
|
|
8
|
+
*/
|
|
9
|
+
async function resolveRepositoryResults(paths) {
|
|
10
|
+
const unique = [];
|
|
11
|
+
const seen = /* @__PURE__ */ new Set();
|
|
12
|
+
for (const path of paths) {
|
|
13
|
+
if (typeof path !== "string") continue;
|
|
14
|
+
const trimmed = path.trim();
|
|
15
|
+
if (!trimmed || seen.has(trimmed)) continue;
|
|
16
|
+
seen.add(trimmed);
|
|
17
|
+
unique.push(trimmed);
|
|
18
|
+
if (unique.length >= 500) break;
|
|
19
|
+
}
|
|
20
|
+
const worktreeCache = /* @__PURE__ */ new Map();
|
|
21
|
+
return Promise.all(unique.map((path) => resolveOne(path, worktreeCache)));
|
|
22
|
+
}
|
|
23
|
+
/** Resolve one workspace without conflating a failed probe with a negative one. */
|
|
24
|
+
async function resolveOne(path, worktreeCache) {
|
|
25
|
+
const absolute = normalizeInput(path);
|
|
26
|
+
const real = await safeRealpath(absolute);
|
|
27
|
+
const unresolved = (status) => ({
|
|
28
|
+
...identity(absolute, path, absolute, true, "main"),
|
|
29
|
+
status,
|
|
30
|
+
worktrees: []
|
|
31
|
+
});
|
|
32
|
+
try {
|
|
33
|
+
if (!(await stat(real)).isDirectory()) return unresolved("not-repository");
|
|
34
|
+
} catch (error) {
|
|
35
|
+
return unresolved(isMissing(error) ? "missing" : "error");
|
|
36
|
+
}
|
|
37
|
+
try {
|
|
38
|
+
const git = await stat(join(real, ".git"));
|
|
39
|
+
const repository = git.isDirectory() ? identity(real, path, real, true, "main") : git.isFile() ? await fromGitFile(real, path) : void 0;
|
|
40
|
+
if (!repository) return unresolved("error");
|
|
41
|
+
return {
|
|
42
|
+
...repository,
|
|
43
|
+
status: "repository",
|
|
44
|
+
worktrees: await discoverWorktrees(repository.root, worktreeCache)
|
|
45
|
+
};
|
|
46
|
+
} catch (error) {
|
|
47
|
+
return unresolved(isMissing(error) ? "not-repository" : "error");
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Enumerate the checkouts Git records for a repository by reading
|
|
52
|
+
* `<root>/.git/worktrees/<id>/gitdir` and `HEAD`. This finds linked worktrees
|
|
53
|
+
* even when DSH has never registered them as workspaces, and never invokes Git.
|
|
54
|
+
*
|
|
55
|
+
* @param root - canonical main checkout.
|
|
56
|
+
* @param cache - per-batch promise memo keyed by root.
|
|
57
|
+
* @returns the main checkout first, then each existing linked worktree.
|
|
58
|
+
*/
|
|
59
|
+
function discoverWorktrees(root, cache) {
|
|
60
|
+
const key = normalizePath(root);
|
|
61
|
+
const cached = cache.get(key);
|
|
62
|
+
if (cached) return cached;
|
|
63
|
+
const pending = readWorktrees(root);
|
|
64
|
+
cache.set(key, pending);
|
|
65
|
+
return pending;
|
|
66
|
+
}
|
|
67
|
+
/** Read the worktree administrative directory of one main checkout. */
|
|
68
|
+
async function readWorktrees(root) {
|
|
69
|
+
const gitDir = join(root, ".git");
|
|
70
|
+
const mainBranch = await readBranch(gitDir);
|
|
71
|
+
const main = {
|
|
72
|
+
path: root,
|
|
73
|
+
label: "main",
|
|
74
|
+
main: true,
|
|
75
|
+
...mainBranch === void 0 ? {} : { branch: mainBranch }
|
|
76
|
+
};
|
|
77
|
+
let entries;
|
|
78
|
+
try {
|
|
79
|
+
entries = await readdir(join(gitDir, "worktrees"), { withFileTypes: true });
|
|
80
|
+
} catch {
|
|
81
|
+
return [main];
|
|
82
|
+
}
|
|
83
|
+
const worktrees = [main];
|
|
84
|
+
const seen = /* @__PURE__ */ new Set([normalizePath(root)]);
|
|
85
|
+
for (const entry of entries) {
|
|
86
|
+
if (!entry.isDirectory()) continue;
|
|
87
|
+
const adminDir = join(gitDir, "worktrees", entry.name);
|
|
88
|
+
let rawGitFile;
|
|
89
|
+
try {
|
|
90
|
+
rawGitFile = (await readFile(join(adminDir, "gitdir"), "utf8")).trim();
|
|
91
|
+
} catch {
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
if (!rawGitFile) continue;
|
|
95
|
+
const gitFile = await safeRealpath(isAbsolute(rawGitFile) ? rawGitFile : resolve(adminDir, rawGitFile));
|
|
96
|
+
const checkout = normalizePath(dirname(gitFile));
|
|
97
|
+
if (seen.has(checkout)) continue;
|
|
98
|
+
try {
|
|
99
|
+
if (!(await stat(checkout)).isDirectory()) continue;
|
|
100
|
+
const marker = await readFile(join(checkout, ".git"), "utf8");
|
|
101
|
+
const match = /^\s*gitdir:\s*(.+?)\s*$/mu.exec(marker);
|
|
102
|
+
if (!match?.[1]) continue;
|
|
103
|
+
if (await safeRealpath(resolve(checkout, match[1])) !== await safeRealpath(adminDir)) continue;
|
|
104
|
+
} catch {
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
107
|
+
seen.add(checkout);
|
|
108
|
+
const branch = await readBranch(adminDir);
|
|
109
|
+
worktrees.push({
|
|
110
|
+
path: checkout,
|
|
111
|
+
label: basename(checkout) || entry.name,
|
|
112
|
+
main: false,
|
|
113
|
+
...branch === void 0 ? {} : { branch }
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
return worktrees;
|
|
117
|
+
}
|
|
118
|
+
/** Read a checkout's current branch name from its administrative `HEAD`. */
|
|
119
|
+
async function readBranch(dir) {
|
|
120
|
+
try {
|
|
121
|
+
const head = (await readFile(join(dir, "HEAD"), "utf8")).trim();
|
|
122
|
+
const match = /^ref:\s*refs\/heads\/(.+)$/u.exec(head);
|
|
123
|
+
if (match?.[1]) return match[1];
|
|
124
|
+
if (/^[0-9a-f]{7,40}$/iu.test(head)) return head.slice(0, 8);
|
|
125
|
+
} catch {}
|
|
126
|
+
}
|
|
127
|
+
/** ENOENT/ENOTDIR distinguish absence from access and other probe failures. */
|
|
128
|
+
function isMissing(error) {
|
|
129
|
+
const code = error?.code;
|
|
130
|
+
return code === "ENOENT" || code === "ENOTDIR";
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Read a linked worktree's `.git` file and follow its `commondir` back to the
|
|
134
|
+
* main checkout. Submodules point into `.git/modules/<name>` with no
|
|
135
|
+
* `commondir`; they stay projects of their own instead of merging into the
|
|
136
|
+
* enclosing repository.
|
|
137
|
+
*/
|
|
138
|
+
async function fromGitFile(real, requested) {
|
|
139
|
+
let text;
|
|
140
|
+
try {
|
|
141
|
+
text = await readFile(join(real, ".git"), "utf8");
|
|
142
|
+
} catch {
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
const match = /^\s*gitdir:\s*(.+?)\s*$/mu.exec(text);
|
|
146
|
+
if (!match?.[1]) return void 0;
|
|
147
|
+
const rawGitDir = match[1];
|
|
148
|
+
const gitDir = await safeRealpath(isAbsolute(rawGitDir) ? rawGitDir : resolve(real, rawGitDir));
|
|
149
|
+
if (gitDir.split(sep).join("/").includes("/.git/modules/")) return identity(real, requested, real, true, "main");
|
|
150
|
+
let commonDir;
|
|
151
|
+
try {
|
|
152
|
+
const common = (await readFile(join(gitDir, "commondir"), "utf8")).trim();
|
|
153
|
+
if (common) commonDir = await safeRealpath(resolve(gitDir, common));
|
|
154
|
+
} catch {}
|
|
155
|
+
const worktree = basename(real) || basename(gitDir) || "worktree";
|
|
156
|
+
if (commonDir !== void 0) {
|
|
157
|
+
const root = basename(commonDir) === ".git" ? dirname(commonDir) : commonDir;
|
|
158
|
+
return identity(root, requested, root, normalizePath(real) === normalizePath(root), normalizePath(real) === normalizePath(root) ? "main" : worktree);
|
|
159
|
+
}
|
|
160
|
+
if (basename(gitDir) === ".git") {
|
|
161
|
+
const root = dirname(gitDir);
|
|
162
|
+
return identity(root, requested, root, normalizePath(real) === normalizePath(root), normalizePath(real) === normalizePath(root) ? "main" : worktree);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
/** Build one identity record with a normalized title. */
|
|
166
|
+
function identity(key, requested, root, main, worktree) {
|
|
167
|
+
const canonicalKey = normalizePath(key);
|
|
168
|
+
const canonicalRoot = normalizePath(root);
|
|
169
|
+
return {
|
|
170
|
+
path: requested,
|
|
171
|
+
key: canonicalKey,
|
|
172
|
+
root: canonicalRoot,
|
|
173
|
+
title: basename(canonicalRoot) || canonicalRoot,
|
|
174
|
+
main,
|
|
175
|
+
worktree: worktree || "main"
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
/** Keep comparison stable across trailing separators and Windows separators. */
|
|
179
|
+
function normalizePath(value) {
|
|
180
|
+
const normalized = String(value || "").replace(/\\/gu, "/").replace(/\/+$/u, "");
|
|
181
|
+
return normalized === "" ? "/" : normalized;
|
|
182
|
+
}
|
|
183
|
+
/** Canonicalize an existing path, or return its absolute form when it is gone. */
|
|
184
|
+
async function safeRealpath(path) {
|
|
185
|
+
try {
|
|
186
|
+
return normalizePath(await realpath(path));
|
|
187
|
+
} catch {
|
|
188
|
+
return normalizePath(path);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
/** Resolve a possibly relative request against the host process directory. */
|
|
192
|
+
function normalizeInput(path) {
|
|
193
|
+
const text = String(path || "").trim();
|
|
194
|
+
return normalizePath(isAbsolute(text) ? text : resolve(text));
|
|
195
|
+
}
|
|
196
|
+
// src/index.ts
|
|
197
|
+
/** Stable Loader identity; keep it equal to the patch row id. */
|
|
198
|
+
const name = "orca-projects";
|
|
199
|
+
/** Exact authenticated route the browser half calls. */
|
|
200
|
+
const REPOSITORY_ROUTE = "/api/orca-projects/resolve";
|
|
201
|
+
/**
|
|
202
|
+
* Register the repository-resolution route.
|
|
203
|
+
*
|
|
204
|
+
* `ctx.inject` waits for the Connection service instead of requiring it at
|
|
205
|
+
* Loader activation, so a Host profile without the Web transport simply keeps
|
|
206
|
+
* the browser-side fallback.
|
|
207
|
+
*
|
|
208
|
+
* @param ctx - the plugin context.
|
|
209
|
+
*/
|
|
210
|
+
function apply(ctx) {
|
|
211
|
+
ctx.inject(["connection"], (scope) => {
|
|
212
|
+
const connection = scope.get("connection");
|
|
213
|
+
if (!connection?.fetch) return;
|
|
214
|
+
connection.fetch.register({
|
|
215
|
+
path: REPOSITORY_ROUTE,
|
|
216
|
+
methods: ["POST"],
|
|
217
|
+
requestBody: "buffered",
|
|
218
|
+
fetch: async (request) => {
|
|
219
|
+
let payload;
|
|
220
|
+
try {
|
|
221
|
+
payload = await request.json();
|
|
222
|
+
} catch {
|
|
223
|
+
return Response.json({ error: "body is not JSON" }, { status: 400 });
|
|
224
|
+
}
|
|
225
|
+
const paths = readPaths(payload);
|
|
226
|
+
if (paths === void 0) return Response.json({ error: "paths must be an array of directory strings" }, { status: 400 });
|
|
227
|
+
const repositories = await resolveRepositoryResults(paths);
|
|
228
|
+
return Response.json({ repositories });
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
/** Read a bounded `{ paths: string[] }` payload, or undefined when malformed. */
|
|
234
|
+
function readPaths(payload) {
|
|
235
|
+
if (!payload || typeof payload !== "object") return void 0;
|
|
236
|
+
const value = payload.paths;
|
|
237
|
+
if (!Array.isArray(value)) return void 0;
|
|
238
|
+
if (value.length > 500) return void 0;
|
|
239
|
+
const paths = [];
|
|
240
|
+
for (const entry of value) {
|
|
241
|
+
if (typeof entry !== "string") return void 0;
|
|
242
|
+
if (entry.length > 4096) return void 0;
|
|
243
|
+
paths.push(entry);
|
|
244
|
+
}
|
|
245
|
+
return paths;
|
|
246
|
+
}
|
|
247
|
+
export { REPOSITORY_ROUTE, apply, name };
|
|
248
|
+
|
|
249
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/repo.ts","../src/index.ts"],"sourcesContent":["/**\n * Repository identity for a DSH workspace directory.\n *\n * DSH registers one workspace per directory, so the main checkout and every\n * Git worktree show up as separate projects. The sidebar wants one project per\n * repository instead. This module resolves the small amount of Git metadata a\n * workspace root carries:\n *\n * - a normal checkout has a `.git` directory;\n * - a linked worktree, including Orca's `workspaces/<project>/<name>` layout,\n * has a `.git` file that points at `<main>/.git/worktrees/<name>`, plus a\n * `commondir` file whose parent is the main checkout.\n *\n * No Git executable is required and no directory is scanned recursively. A\n * workspace without a `.git` entry keeps its own path as identity, so a plain\n * subdirectory workspace is not silently merged into an enclosing repository.\n *\n * @module @codeasier/dsh-plugin-orca-projects\n */\n\nimport type { Dirent } from 'node:fs'\nimport { readdir, readFile, realpath, stat } from 'node:fs/promises'\nimport { basename, dirname, isAbsolute, join, resolve, sep } from 'node:path'\n\n/** One checkout discovered under a repository, registered in DSH or not. */\nexport interface RepositoryWorktree {\n /** Absolute checkout directory. */\n readonly path: string\n /** `main` or the checkout directory name. */\n readonly label: string\n /** Current branch, when Git records one. */\n readonly branch?: string\n /** Whether this checkout is the repository's main checkout. */\n readonly main: boolean\n}\n\n/** One workspace's repository identity, as sent to the browser half. */\nexport interface RepositoryIdentity {\n /** Workspace path exactly as requested. */\n readonly path: string\n /** Stable project key: the canonical main checkout, or the workspace path. */\n readonly key: string\n /** Project directory shown in the sidebar. */\n readonly root: string\n /** Display title derived from the repository directory. */\n readonly title: string\n /** Whether this workspace is the repository's main checkout. */\n readonly main: boolean\n /** `main` or the worktree name Git records for this checkout. */\n readonly worktree: string\n /** Every checkout Git records for this repository, including unregistered ones. */\n readonly worktrees: readonly RepositoryWorktree[]\n}\n\n/** Identity fields before repository-level worktree discovery. */\ntype RepositoryBase = Omit<RepositoryIdentity, 'worktrees'>\n\n/** Payload accepted by the `resolve` host method. */\nexport interface ResolveRepositoriesRequest {\n readonly paths: readonly string[]\n}\n\n/** A probe outcome; only confirmed non-repositories must disable path fallback. */\nexport interface RepositoryResolution extends RepositoryIdentity {\n readonly status: 'repository' | 'not-repository' | 'missing' | 'error'\n}\n\n/** Successful payload returned by the `resolve` host method. */\nexport interface ResolveRepositoriesResult {\n readonly repositories: readonly RepositoryResolution[]\n}\n\n/** Resolve only Git identities, preserving the original positive-only API. */\nexport async function resolveRepositories(paths: readonly string[]): Promise<RepositoryIdentity[]> {\n return (await resolveRepositoryResults(paths)).filter((entry) => entry.status === 'repository')\n}\n\n/**\n * Probe each workspace independently, retaining negative outcomes so the client\n * can distinguish a confirmed ordinary directory from unavailable metadata.\n * Missing paths and failed probes still permit the client's path fallback.\n */\nexport async function resolveRepositoryResults(\n paths: readonly string[],\n): Promise<RepositoryResolution[]> {\n const unique: string[] = []\n const seen = new Set<string>()\n for (const path of paths) {\n if (typeof path !== 'string') continue\n const trimmed = path.trim()\n if (!trimmed || seen.has(trimmed)) continue\n seen.add(trimmed)\n unique.push(trimmed)\n if (unique.length >= 500) break\n }\n const worktreeCache = new Map<string, Promise<readonly RepositoryWorktree[]>>()\n return Promise.all(unique.map((path) => resolveOne(path, worktreeCache)))\n}\n\n/** Resolve one workspace without conflating a failed probe with a negative one. */\nasync function resolveOne(\n path: string,\n worktreeCache: Map<string, Promise<readonly RepositoryWorktree[]>>,\n): Promise<RepositoryResolution> {\n const absolute = normalizeInput(path)\n const real = await safeRealpath(absolute)\n const unresolved = (status: RepositoryResolution['status']): RepositoryResolution => ({\n ...identity(absolute, path, absolute, true, 'main'),\n status,\n worktrees: [],\n })\n try {\n const directory = await stat(real)\n if (!directory.isDirectory()) return unresolved('not-repository')\n } catch (error) {\n return unresolved(isMissing(error) ? 'missing' : 'error')\n }\n try {\n const git = await stat(join(real, '.git'))\n const repository = git.isDirectory()\n ? identity(real, path, real, true, 'main')\n : git.isFile()\n ? await fromGitFile(real, path)\n : undefined\n if (!repository) return unresolved('error')\n return {\n ...repository,\n status: 'repository',\n worktrees: await discoverWorktrees(repository.root, worktreeCache),\n }\n } catch (error) {\n return unresolved(isMissing(error) ? 'not-repository' : 'error')\n }\n}\n\n/**\n * Enumerate the checkouts Git records for a repository by reading\n * `<root>/.git/worktrees/<id>/gitdir` and `HEAD`. This finds linked worktrees\n * even when DSH has never registered them as workspaces, and never invokes Git.\n *\n * @param root - canonical main checkout.\n * @param cache - per-batch promise memo keyed by root.\n * @returns the main checkout first, then each existing linked worktree.\n */\nfunction discoverWorktrees(\n root: string,\n cache: Map<string, Promise<readonly RepositoryWorktree[]>>,\n): Promise<readonly RepositoryWorktree[]> {\n const key = normalizePath(root)\n const cached = cache.get(key)\n if (cached) return cached\n const pending = readWorktrees(root)\n cache.set(key, pending)\n return pending\n}\n\n/** Read the worktree administrative directory of one main checkout. */\nasync function readWorktrees(root: string): Promise<readonly RepositoryWorktree[]> {\n const gitDir = join(root, '.git')\n const mainBranch = await readBranch(gitDir)\n const main: RepositoryWorktree = {\n path: root,\n label: 'main',\n main: true,\n ...(mainBranch === undefined ? {} : { branch: mainBranch }),\n }\n let entries: Dirent[]\n try {\n entries = await readdir(join(gitDir, 'worktrees'), { withFileTypes: true })\n } catch {\n return [main]\n }\n const worktrees = [main]\n const seen = new Set([normalizePath(root)])\n for (const entry of entries) {\n if (!entry.isDirectory()) continue\n const adminDir = join(gitDir, 'worktrees', entry.name)\n let rawGitFile: string\n try {\n rawGitFile = (await readFile(join(adminDir, 'gitdir'), 'utf8')).trim()\n } catch {\n continue\n }\n if (!rawGitFile) continue\n const gitFile = await safeRealpath(\n isAbsolute(rawGitFile) ? rawGitFile : resolve(adminDir, rawGitFile),\n )\n const checkoutPath = dirname(gitFile)\n const checkout = normalizePath(checkoutPath)\n if (seen.has(checkout)) continue\n try {\n const info = await stat(checkout)\n if (!info.isDirectory()) continue\n // A stale admin record can outlive its checkout or point at a reused path.\n const marker = await readFile(join(checkout, '.git'), 'utf8')\n const match = /^\\s*gitdir:\\s*(.+?)\\s*$/mu.exec(marker)\n if (!match?.[1]) continue\n const backlink = await safeRealpath(resolve(checkout, match[1]))\n if (backlink !== (await safeRealpath(adminDir))) continue\n } catch {\n continue\n }\n seen.add(checkout)\n const branch = await readBranch(adminDir)\n worktrees.push({\n path: checkout,\n label: basename(checkout) || entry.name,\n main: false,\n ...(branch === undefined ? {} : { branch }),\n })\n }\n return worktrees\n}\n\n/** Read a checkout's current branch name from its administrative `HEAD`. */\nasync function readBranch(dir: string): Promise<string | undefined> {\n try {\n const head = (await readFile(join(dir, 'HEAD'), 'utf8')).trim()\n const match = /^ref:\\s*refs\\/heads\\/(.+)$/u.exec(head)\n if (match?.[1]) return match[1]\n if (/^[0-9a-f]{7,40}$/iu.test(head)) return head.slice(0, 8)\n } catch {\n // Detached, unborn, or unreadable HEADs keep an empty branch label.\n }\n return undefined\n}\n\n/** ENOENT/ENOTDIR distinguish absence from access and other probe failures. */\nfunction isMissing(error: unknown): boolean {\n const code = (error as NodeJS.ErrnoException | null)?.code\n return code === 'ENOENT' || code === 'ENOTDIR'\n}\n\n/**\n * Read a linked worktree's `.git` file and follow its `commondir` back to the\n * main checkout. Submodules point into `.git/modules/<name>` with no\n * `commondir`; they stay projects of their own instead of merging into the\n * enclosing repository.\n */\nasync function fromGitFile(real: string, requested: string): Promise<RepositoryBase | undefined> {\n let text: string\n try {\n text = await readFile(join(real, '.git'), 'utf8')\n } catch {\n return undefined\n }\n const match = /^\\s*gitdir:\\s*(.+?)\\s*$/mu.exec(text)\n if (!match?.[1]) return undefined\n const rawGitDir = match[1]\n const gitDir = await safeRealpath(isAbsolute(rawGitDir) ? rawGitDir : resolve(real, rawGitDir))\n const posixGitDir = gitDir.split(sep).join('/')\n if (posixGitDir.includes('/.git/modules/')) {\n return identity(real, requested, real, true, 'main')\n }\n\n let commonDir: string | undefined\n try {\n const common = (await readFile(join(gitDir, 'commondir'), 'utf8')).trim()\n if (common) commonDir = await safeRealpath(resolve(gitDir, common))\n } catch {\n // A `.git` file without commondir is not a standard linked worktree.\n }\n\n const worktree = basename(real) || basename(gitDir) || 'worktree'\n if (commonDir !== undefined) {\n const main = basename(commonDir) === '.git'\n const root = main ? dirname(commonDir) : commonDir\n return identity(\n root,\n requested,\n root,\n normalizePath(real) === normalizePath(root),\n normalizePath(real) === normalizePath(root) ? 'main' : worktree,\n )\n }\n\n if (basename(gitDir) === '.git') {\n const root = dirname(gitDir)\n return identity(\n root,\n requested,\n root,\n normalizePath(real) === normalizePath(root),\n normalizePath(real) === normalizePath(root) ? 'main' : worktree,\n )\n }\n return undefined\n}\n\n/** Build one identity record with a normalized title. */\nfunction identity(\n key: string,\n requested: string,\n root: string,\n main: boolean,\n worktree: string,\n): RepositoryBase {\n const canonicalKey = normalizePath(key)\n const canonicalRoot = normalizePath(root)\n return {\n path: requested,\n key: canonicalKey,\n root: canonicalRoot,\n title: basename(canonicalRoot) || canonicalRoot,\n main,\n worktree: worktree || 'main',\n }\n}\n\n/** Keep comparison stable across trailing separators and Windows separators. */\nfunction normalizePath(value: string): string {\n const normalized = String(value || '')\n .replace(/\\\\/gu, '/')\n .replace(/\\/+$/u, '')\n return normalized === '' ? '/' : normalized\n}\n\n/** Canonicalize an existing path, or return its absolute form when it is gone. */\nasync function safeRealpath(path: string): Promise<string> {\n try {\n return normalizePath(await realpath(path))\n } catch {\n return normalizePath(path)\n }\n}\n\n/** Resolve a possibly relative request against the host process directory. */\nfunction normalizeInput(path: string): string {\n const text = String(path || '').trim()\n return normalizePath(isAbsolute(text) ? text : resolve(text))\n}\n","/**\n * Orca Projects — a Web/Desktop client plugin that replaces the shipped\n * workspace browser with an Orca-like project sidebar.\n *\n * The browser half owns every visual contribution. This Host half contributes\n * one authenticated fetch route used to consolidate Git worktrees under one\n * project: the browser cannot read `.git` itself, so the Host resolves each\n * registered workspace with {@link resolveRepositoryResults} and returns the\n * repository identity, including checkouts recorded under `.git/worktrees` that\n * DSH has not registered. The route is optional: without it the browser keeps\n * the path-based fallback.\n *\n * @module @codeasier/dsh-plugin-orca-projects\n */\n\nimport type { Context } from '@deepseek-ai/cordis'\n\nimport { resolveRepositoryResults } from './repo.js'\n\n/** Stable Loader identity; keep it equal to the patch row id. */\nexport const name = 'orca-projects'\n\n/** Exact authenticated route the browser half calls. */\nexport const REPOSITORY_ROUTE = '/api/orca-projects/resolve'\n\n/** The subset of the Host Connection service this plugin needs. */\ninterface ConnectionService {\n readonly fetch?: {\n register(route: {\n readonly path: string\n readonly methods: readonly ('GET' | 'HEAD' | 'POST')[]\n readonly requestBody: 'buffered' | 'streaming'\n readonly fetch: (request: Request) => Promise<Response>\n }): () => Promise<void>\n }\n}\n\n/**\n * Register the repository-resolution route.\n *\n * `ctx.inject` waits for the Connection service instead of requiring it at\n * Loader activation, so a Host profile without the Web transport simply keeps\n * the browser-side fallback.\n *\n * @param ctx - the plugin context.\n */\nexport function apply(ctx: Context): void {\n ctx.inject(['connection'], (scope) => {\n const connection = scope.get('connection') as ConnectionService | undefined\n if (!connection?.fetch) return\n connection.fetch.register({\n path: REPOSITORY_ROUTE,\n methods: ['POST'],\n requestBody: 'buffered',\n fetch: async (request) => {\n let payload: unknown\n try {\n payload = await request.json()\n } catch {\n return Response.json({ error: 'body is not JSON' }, { status: 400 })\n }\n const paths = readPaths(payload)\n if (paths === undefined) {\n return Response.json(\n { error: 'paths must be an array of directory strings' },\n { status: 400 },\n )\n }\n const repositories = await resolveRepositoryResults(paths)\n return Response.json({ repositories })\n },\n })\n })\n}\n\n/** Read a bounded `{ paths: string[] }` payload, or undefined when malformed. */\nfunction readPaths(payload: unknown): string[] | undefined {\n if (!payload || typeof payload !== 'object') return undefined\n const value = (payload as { paths?: unknown }).paths\n if (!Array.isArray(value)) return undefined\n if (value.length > 500) return undefined\n const paths: string[] = []\n for (const entry of value) {\n if (typeof entry !== 'string') return undefined\n if (entry.length > 4096) return undefined\n paths.push(entry)\n }\n return paths\n}\n"],"mappings":";;;;;;;;AAkFA,eAAsB,yBACpB,OACiC;CACjC,MAAM,SAAmB,CAAC;CAC1B,MAAM,uBAAO,IAAI,IAAY;CAC7B,KAAK,MAAM,QAAQ,OAAO;EACxB,IAAI,OAAO,SAAS,UAAU;EAC9B,MAAM,UAAU,KAAK,KAAK;EAC1B,IAAI,CAAC,WAAW,KAAK,IAAI,OAAO,GAAG;EACnC,KAAK,IAAI,OAAO;EAChB,OAAO,KAAK,OAAO;EACnB,IAAI,OAAO,UAAU,KAAK;CAC5B;CACA,MAAM,gCAAgB,IAAI,IAAoD;CAC9E,OAAO,QAAQ,IAAI,OAAO,KAAK,SAAS,WAAW,MAAM,aAAa,CAAC,CAAC;AAC1E;;AAGA,eAAe,WACb,MACA,eAC+B;CAC/B,MAAM,WAAW,eAAe,IAAI;CACpC,MAAM,OAAO,MAAM,aAAa,QAAQ;CACxC,MAAM,cAAc,YAAkE;EACpF,GAAG,SAAS,UAAU,MAAM,UAAU,MAAM,MAAM;EAClD;EACA,WAAW,CAAC;CACd;CACA,IAAI;EAEF,IAAI,EAAC,MADmB,KAAK,IAAI,EAAA,CAClB,YAAY,GAAG,OAAO,WAAW,gBAAgB;CAClE,SAAS,OAAO;EACd,OAAO,WAAW,UAAU,KAAK,IAAI,YAAY,OAAO;CAC1D;CACA,IAAI;EACF,MAAM,MAAM,MAAM,KAAK,KAAK,MAAM,MAAM,CAAC;EACzC,MAAM,aAAa,IAAI,YAAY,IAC/B,SAAS,MAAM,MAAM,MAAM,MAAM,MAAM,IACvC,IAAI,OAAO,IACT,MAAM,YAAY,MAAM,IAAI,IAC5B,KAAA;EACN,IAAI,CAAC,YAAY,OAAO,WAAW,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,MAAM,SAAS,MAAM,OAAO,KAAA;EAChC,MAAM,KAAK,KAAK;CAClB;CACA,OAAO;AACT"}
|
package/icon.svg
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" role="img" aria-label="Orca Projects plugin">
|
|
2
|
+
<rect width="64" height="64" rx="14" fill="#0f766e"/>
|
|
3
|
+
<path d="M24 18h10a8 8 0 0 1 8 8v2h3a5 5 0 0 1 0 10h-3v3a5 5 0 0 1-5 5H24a6 6 0 0 1-6-6V24a6 6 0 0 1 6-6Z" fill="#ffffff"/>
|
|
4
|
+
<circle cx="26" cy="28" r="2.4" fill="#0f766e"/>
|
|
5
|
+
<circle cx="34" cy="28" r="2.4" fill="#0f766e"/>
|
|
6
|
+
<path d="M25 38c2.2 2.4 4.8 3.6 7.8 3.6 2.6 0 4.8-.9 6.6-2.7" stroke="#0f766e" stroke-width="2.6" stroke-linecap="round" fill="none"/>
|
|
7
|
+
</svg>
|
package/locale/en.json
ADDED
package/locale/zh.json
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,89 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codeasier/dsh-plugin-orca-projects",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Orca-like project sidebar for the DSH Web and Desktop client: repository-aware worktree grouping, custom project groups, and a pinned session shelf.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"dsh-plugin",
|
|
7
|
+
"deepseek-harness",
|
|
8
|
+
"dsh",
|
|
9
|
+
"cordis",
|
|
10
|
+
"orca",
|
|
11
|
+
"projects",
|
|
12
|
+
"sidebar"
|
|
13
|
+
],
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"type": "module",
|
|
16
|
+
"main": "./dist/index.js",
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"default": "./dist/index.js"
|
|
22
|
+
},
|
|
23
|
+
"./cordis.patch.yml": "./cordis.patch.yml",
|
|
24
|
+
"./locale/*.json": "./locale/*.json",
|
|
25
|
+
"./icon": "./icon.svg",
|
|
26
|
+
"./package.json": "./package.json",
|
|
27
|
+
"./client": "./client.js"
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"dist",
|
|
31
|
+
"client.js",
|
|
32
|
+
"cordis.patch.yml",
|
|
33
|
+
"locale/*.json",
|
|
34
|
+
"icon.svg",
|
|
35
|
+
"README.md",
|
|
36
|
+
"LICENSE",
|
|
37
|
+
"README.zh.md"
|
|
38
|
+
],
|
|
39
|
+
"publishConfig": {
|
|
40
|
+
"access": "public"
|
|
41
|
+
},
|
|
42
|
+
"repository": {
|
|
43
|
+
"type": "git",
|
|
44
|
+
"url": "git+https://github.com/codeasier/dsh-plugins.git",
|
|
45
|
+
"directory": "packages/dsh-plugin-orca-projects"
|
|
46
|
+
},
|
|
47
|
+
"homepage": "https://github.com/codeasier/dsh-plugins/tree/main/packages/dsh-plugin-orca-projects#readme",
|
|
48
|
+
"bugs": {
|
|
49
|
+
"url": "https://github.com/codeasier/dsh-plugins/issues"
|
|
50
|
+
},
|
|
51
|
+
"engines": {
|
|
52
|
+
"node": ">=22.18.0",
|
|
53
|
+
"dsh": ">=0.2.2-rc.1 <0.3.0"
|
|
54
|
+
},
|
|
55
|
+
"dsh": {
|
|
56
|
+
"bundle": {
|
|
57
|
+
"patch": "./cordis.patch.yml"
|
|
58
|
+
},
|
|
59
|
+
"client": {
|
|
60
|
+
"platform": "web",
|
|
61
|
+
"immediately": true,
|
|
62
|
+
"inject": [
|
|
63
|
+
"@deepseek-ai/dsh-client-locale",
|
|
64
|
+
"@deepseek-ai/dsh-client-ui-sidebar",
|
|
65
|
+
"@deepseek-ai/dsh-client-ui-workspace",
|
|
66
|
+
"@deepseek-ai/dsh-client-ui-session",
|
|
67
|
+
"@deepseek-ai/dsh-client-ui-layout"
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"peerDependencies": {
|
|
72
|
+
"@deepseek-ai/cordis": ">=4.0.5 <5"
|
|
73
|
+
},
|
|
74
|
+
"devDependencies": {
|
|
75
|
+
"@deepseek-ai/cordis": "4.0.5",
|
|
76
|
+
"@types/react": "^18.2.0",
|
|
77
|
+
"@types/react-dom": "^18.2.0",
|
|
78
|
+
"react": "^18.2.0",
|
|
79
|
+
"react-dom": "^18.2.0"
|
|
80
|
+
},
|
|
81
|
+
"scripts": {
|
|
82
|
+
"build": "tsdown",
|
|
83
|
+
"dev": "tsdown --watch",
|
|
84
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
85
|
+
"test": "vitest run --config vitest.config.ts",
|
|
86
|
+
"test:watch": "vitest --config vitest.config.ts",
|
|
87
|
+
"pack:check": "node ../../scripts/check-pack.mjs ."
|
|
88
|
+
}
|
|
6
89
|
}
|