chore(release): 1.5.0 #6
|
|
@ -18,9 +18,9 @@
|
|||
{
|
||||
"id": "workspace-groups-remote",
|
||||
"package": "workspace-groups-remote",
|
||||
"version": "1.1.1",
|
||||
"version": "1.2.0",
|
||||
"sourceRepo": "DeepsSeekHarness/workspace-groups-remote",
|
||||
"sourceCommit": "80537fff863a637d0c848b3d64a1748a9f4cac55",
|
||||
"sourceCommit": "99a8c811a4061443c5aed29a2ee0dae634a331c3",
|
||||
"vendorPath": "vendor/workspace-groups-remote"
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "qq-dsh",
|
||||
"version": "1.4.1",
|
||||
"description": "QQ-dsh 鈥?personal DSH plugin bundle: sansheng-liubu workbench + dsh-brain (LongMemory bridge, skill sync) + workspace-groups-remote (grouped workspaces + remote SSH) + dsh-better-chat (approval Enter/Esc), in one install.",
|
||||
"version": "1.5.0",
|
||||
"description": "QQ-dsh 閳?personal DSH plugin bundle: sansheng-liubu workbench + dsh-brain (LongMemory bridge, skill sync) + workspace-groups-remote (grouped workspaces + remote SSH) + dsh-better-chat (approval Enter/Esc), in one install.",
|
||||
"type": "module",
|
||||
"main": "index.js",
|
||||
"exports": {
|
||||
|
|
|
|||
|
|
@ -1479,22 +1479,14 @@ window.__ModuleLoader__.load({
|
|||
const labels = memberFolderLabels(entry);
|
||||
const title = workspaceTitle.trim();
|
||||
if (title !== "") labels.set(workspacePath, title);
|
||||
const nameOf = (value) => value.replace(/[((][^))]*[))]/gu, "").trim();
|
||||
const baseName = nameOf(title);
|
||||
new Set((entry?.members ?? []).map((member) => member.path));
|
||||
const mergedMembers = /* @__PURE__ */ new Set();
|
||||
if (baseName !== "") {
|
||||
for (const member of entry?.members ?? []) if (nameOf(labels.get(member.path) ?? folderLabel(member.path)) === baseName) mergedMembers.add(member.path);
|
||||
}
|
||||
const isMergedMember = (path) => [...mergedMembers].some((member) => samePath(member, path));
|
||||
const extras = effectiveFolders(workspacePath, entry).slice(1).filter((path) => !isMergedMember(path));
|
||||
const extras = effectiveFolders(workspacePath, entry).slice(1);
|
||||
if (extras.length === 0) return { sessions };
|
||||
const root = rootOf(workspacePath, entry);
|
||||
const base = [];
|
||||
const byFolder = /* @__PURE__ */ new Map();
|
||||
for (const node of sessions) {
|
||||
const owner = folderOfCwd(list.byId[node.id]?.cwd, workspacePath, entry);
|
||||
if (samePath(owner, workspacePath) || isMergedMember(owner)) {
|
||||
if (samePath(owner, workspacePath)) {
|
||||
base.push(node);
|
||||
continue;
|
||||
}
|
||||
|
|
@ -4365,7 +4357,7 @@ window.__ModuleLoader__.load({
|
|||
if (picked === base) return "";
|
||||
return picked.startsWith(`${base}/`) ? picked.slice(base.length + 1) : null;
|
||||
}
|
||||
function FoldersDialog({ workspace, entry, t, busy, canOpen, remote, ownerRemotePath, profiles, profilesError, knownWorkspaceIds, onClose, onAddFolder, onAddRemote, onAddSubpath, onSetRoot, onRemove, onOpenFolder }) {
|
||||
function FoldersDialog({ workspace, entry, t, busy, canOpen, remote, ownerRemotePath, profiles, profilesError, knownWorkspaceIds, onClose, onBuildFarm, onAddFolder, onAddRemote, onAddSubpath, onSetRoot, onRemove, onOpenFolder }) {
|
||||
const folders = effectiveFolders(workspace.path, entry);
|
||||
const root = rootOf(workspace.path, entry);
|
||||
const [addMode, setAddMode] = (0, react.useState)("local");
|
||||
|
|
@ -4600,6 +4592,30 @@ window.__ModuleLoader__.load({
|
|||
})
|
||||
]
|
||||
}),
|
||||
extraFolders && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
||||
className: "wgFolderMerge",
|
||||
children: [
|
||||
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
||||
className: "wgFolderSectionTitle",
|
||||
children: t("folder.mergeTitle")
|
||||
}),
|
||||
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
||||
type: "button",
|
||||
className: "wgFolderPick",
|
||||
disabled: busy,
|
||||
onClick: onBuildFarm,
|
||||
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
||||
className: "wgFolderPickPlus",
|
||||
"aria-hidden": true,
|
||||
children: "⇄"
|
||||
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("folder.mergeAction") })]
|
||||
}),
|
||||
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
||||
className: "wgFolderHint",
|
||||
children: t("folder.mergeHint")
|
||||
})
|
||||
]
|
||||
}),
|
||||
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
||||
className: "wgFolderAdd",
|
||||
children: [
|
||||
|
|
@ -4862,6 +4878,70 @@ window.__ModuleLoader__.load({
|
|||
]
|
||||
});
|
||||
}
|
||||
// src/client/folders-farm.ts
|
||||
/**
|
||||
* Client side of the farm route.
|
||||
*
|
||||
* A farm is one real directory holding a link per project folder, so a session
|
||||
* can read and write all of them at once. The host owns the filesystem work;
|
||||
* this module only speaks the two requests, and never assumes success: every
|
||||
* failure comes back as an Error with the host's own message.
|
||||
*/
|
||||
const FARM_ROUTE = "/workspace-groups/farm";
|
||||
const FARM_TIMEOUT_MS = 2e4;
|
||||
function hostMessage(body, fallback) {
|
||||
if (typeof body === "object" && body !== null) {
|
||||
const message = body.error;
|
||||
if (typeof message === "string" && message !== "") return message;
|
||||
}
|
||||
return fallback;
|
||||
}
|
||||
async function failure(response, action) {
|
||||
let body;
|
||||
try {
|
||||
body = await response.json();
|
||||
} catch {
|
||||
body = null;
|
||||
}
|
||||
return new Error(hostMessage(body, `${action}: HTTP ${response.status}`));
|
||||
}
|
||||
function parseFarm(body) {
|
||||
if (typeof body !== "object" || body === null) return null;
|
||||
const source = body;
|
||||
if (typeof source.path !== "string" || source.path === "") return null;
|
||||
if (!Array.isArray(source.links)) return null;
|
||||
const links = [];
|
||||
for (const entry of source.links) {
|
||||
if (typeof entry !== "object" || entry === null) return null;
|
||||
const link = entry;
|
||||
if (typeof link.name !== "string" || link.name === "") return null;
|
||||
if (typeof link.target !== "string" || link.target === "") return null;
|
||||
links.push({
|
||||
name: link.name,
|
||||
target: link.target
|
||||
});
|
||||
}
|
||||
return {
|
||||
path: source.path,
|
||||
links
|
||||
};
|
||||
}
|
||||
/** Build a farm for `folders`; the host refuses to reuse an existing one. */
|
||||
async function buildFarm(name, folders, fetchImpl = fetch) {
|
||||
const response = await fetchImpl(FARM_ROUTE, {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({
|
||||
name,
|
||||
folders
|
||||
}),
|
||||
signal: AbortSignal.timeout(FARM_TIMEOUT_MS)
|
||||
});
|
||||
if (!response.ok) throw await failure(response, "POST /workspace-groups/farm");
|
||||
const parsed = parseFarm(await response.json());
|
||||
if (parsed === null) throw new Error("POST /workspace-groups/farm: malformed response");
|
||||
return parsed;
|
||||
}
|
||||
// src/client/quick.ts
|
||||
/** A session row eligible for quick switching: running, top-level, real. */
|
||||
function quickEligible(summary) {
|
||||
|
|
@ -6799,6 +6879,31 @@ window.__ModuleLoader__.load({
|
|||
writeFolderEntry(workspaceId, setRoot(entryFor(foldersDoc, workspaceId), path));
|
||||
};
|
||||
/**
|
||||
* Gather this project's folders into one link directory and register it as a
|
||||
* workspace, so one session reaches all of them. The folders themselves are
|
||||
* never copied, moved or deleted; the farm holds links only.
|
||||
*/
|
||||
const buildFarmFor = async (workspaceId) => {
|
||||
if (foldersBusy) return;
|
||||
const workspace = workspaces.find((item) => item.workspaceId === workspaceId);
|
||||
if (workspace === void 0) return;
|
||||
const folders = effectiveFolders(workspace.path, entryFor(foldersDoc, workspaceId));
|
||||
if (folders.length < 2) {
|
||||
notifyFolder(t("folder.emptyHint"));
|
||||
return;
|
||||
}
|
||||
setFoldersBusy(true);
|
||||
try {
|
||||
const farm = await buildFarm(workspace.title, folders);
|
||||
await createWorkspace({ path: farm.path });
|
||||
notifyFolder(`${t("folder.mergeDone")} ${farm.path}`);
|
||||
} catch (reason) {
|
||||
notifyFolder(`${t("folder.mergeFailed")}: ${reason instanceof Error ? reason.message : String(reason)}`);
|
||||
} finally {
|
||||
setFoldersBusy(false);
|
||||
}
|
||||
};
|
||||
/**
|
||||
* Remove one folder from a project. With `deleteRecord` set — only the
|
||||
* folder dialog offers it, behind an explicit confirm — a remote member's
|
||||
* backing record is deleted through the SSH plugin as well (record, native
|
||||
|
|
@ -7926,6 +8031,9 @@ window.__ModuleLoader__.load({
|
|||
t,
|
||||
busy: foldersBusy,
|
||||
canOpen: openFolderPath !== void 0,
|
||||
onBuildFarm: () => {
|
||||
buildFarmFor(foldersTarget);
|
||||
},
|
||||
remote: isRemoteWorkspace(workspace),
|
||||
ownerRemotePath: foldersOwnerRemote,
|
||||
profiles: remoteProfiles,
|
||||
|
|
@ -8545,6 +8653,11 @@ window.__ModuleLoader__.load({
|
|||
"folder.sectionList": "项目文件夹",
|
||||
"folder.sectionAdd": "添加文件夹",
|
||||
"folder.emptyHint": "还没有额外文件夹。下面挂一个目录,它的会话会独立运行,模型也能直接读到里面的文件。",
|
||||
"folder.mergeTitle": "合并成一个总文件夹",
|
||||
"folder.mergeAction": "生成总文件夹并添加为工作区",
|
||||
"folder.mergeHint": "在旁边建一个目录,用链接把这些文件夹放进去,再注册成工作区。不复制、不移动原文件夹;之后在这个工作区里的会话可以同时读写它们。",
|
||||
"folder.mergeDone": "已生成总文件夹:",
|
||||
"folder.mergeFailed": "生成总文件夹失败",
|
||||
"folder.base": "基础文件夹",
|
||||
"folder.setRoot": "设为根目录",
|
||||
"folder.rootBadge": "根目录",
|
||||
|
|
@ -8735,6 +8848,11 @@ window.__ModuleLoader__.load({
|
|||
"folder.sectionList": "Project folders",
|
||||
"folder.sectionAdd": "Add a folder",
|
||||
"folder.emptyHint": "No extra folders yet. A folder added below runs its sessions on its own, so the agent can read the files inside it directly.",
|
||||
"folder.mergeTitle": "Merge into one folder",
|
||||
"folder.mergeAction": "Create the merged folder as a workspace",
|
||||
"folder.mergeHint": "Builds one directory that links these folders side by side and registers it as a workspace. Nothing is copied or moved; sessions in that workspace can read and write all of them.",
|
||||
"folder.mergeDone": "Merged folder created: ",
|
||||
"folder.mergeFailed": "Could not build the merged folder",
|
||||
"folder.base": "Base folder",
|
||||
"folder.setRoot": "Set as root",
|
||||
"folder.rootBadge": "Root",
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { lstat, mkdir, open, readFile, rename, unlink } from "node:fs/promises";
|
||||
import { dirname, resolve } from "node:path";
|
||||
import { lstat, mkdir, open, readFile, readdir, realpath, rename, rmdir, stat, symlink, unlink } from "node:fs/promises";
|
||||
import { basename, dirname, isAbsolute, join, relative, resolve } from "node:path";
|
||||
import { homedir } from "node:os";
|
||||
// node_modules/.pnpm/js-yaml@4.3.2/node_modules/js-yaml/dist/js-yaml.mjs
|
||||
function getDefaultExportFromCjs(x) {
|
||||
|
|
@ -3345,6 +3345,155 @@ async function writeFoldersDocument(path, document) {
|
|||
throw error;
|
||||
}
|
||||
}
|
||||
// src/host-farm.ts
|
||||
/**
|
||||
* A farm gathers several project folders into one real directory, so a single
|
||||
* session can read and write all of them.
|
||||
*
|
||||
* A session's file scope is its workspace directory, so "one project, several
|
||||
* folders" needs one directory that contains all of them. The farm is that
|
||||
* directory: every entry is a link (a junction on Windows, a directory symlink
|
||||
* elsewhere) to a folder the user already owns. Nothing is copied or moved, and
|
||||
* the user's folders keep their own life.
|
||||
*
|
||||
* Deletion is the dangerous half. A recursive delete that followed a link would
|
||||
* erase the user's real folder, so {@link removeFarm} only ever unlinks entries
|
||||
* that are links, and refuses as soon as it meets a real directory.
|
||||
*/
|
||||
/** Characters Windows refuses in a name, plus control characters. */
|
||||
const RESERVED_CHARS = /[\u005C\u002F:*?"<>|\u0000-\u001f]/gu;
|
||||
/** Device names Windows refuses as a whole entry name. */
|
||||
const RESERVED_NAMES = /^(con|prn|aux|nul|com[1-9]|lpt[1-9])(\..*)?$/iu;
|
||||
const MAX_NAME_LENGTH = 64;
|
||||
const WINDOWS = process.platform === "win32";
|
||||
function dshHome() {
|
||||
const configured = process.env.DSH_HOME;
|
||||
return configured === void 0 || configured.trim() === "" ? join(homedir(), ".dsh") : configured;
|
||||
}
|
||||
/** Root that holds every farm: `$DSH_HOME/workspace-groups/farms`. */
|
||||
function defaultFarmRoot() {
|
||||
return resolve(dshHome(), "workspace-groups", "farms");
|
||||
}
|
||||
/** One directory-safe name for a farm, derived from a workspace title. */
|
||||
function farmDirectoryName(title) {
|
||||
const cleaned = title.replace(RESERVED_CHARS, " ").replace(/\s+/gu, " ").trim().replace(/[. ]+$/u, "").slice(0, MAX_NAME_LENGTH).trim().replace(/[. ]+$/u, "");
|
||||
if (cleaned === "") return "farm";
|
||||
return RESERVED_NAMES.test(cleaned) ? `_${cleaned}` : cleaned;
|
||||
}
|
||||
function linkNameFor(target, taken) {
|
||||
const raw = basename(target).replace(RESERVED_CHARS, " ").replace(/\s+/gu, " ").trim() || "folder";
|
||||
const base = RESERVED_NAMES.test(raw) ? `_${raw}` : raw;
|
||||
let name = base;
|
||||
let suffix = 2;
|
||||
while (taken.has(name.toLowerCase())) {
|
||||
name = `${base} (${suffix})`;
|
||||
suffix += 1;
|
||||
}
|
||||
taken.add(name.toLowerCase());
|
||||
return name;
|
||||
}
|
||||
/**
|
||||
* Delete one farm entry, and only one.
|
||||
*
|
||||
* A junction reports as a symbolic link to `lstat` but is a reparse point that
|
||||
* `unlink` refuses; a directory symlink on POSIX removes fine with `unlink`. A
|
||||
* real directory is never touched.
|
||||
*/
|
||||
async function unlinkEntry(path) {
|
||||
const info = await lstat(path);
|
||||
if (info.isDirectory() && !info.isSymbolicLink()) throw new Error(`farm: refusing to delete a real directory: ${path}`);
|
||||
try {
|
||||
await unlink(path);
|
||||
} catch {
|
||||
await rmdir(path);
|
||||
}
|
||||
}
|
||||
async function discard(path) {
|
||||
let entries;
|
||||
try {
|
||||
entries = await readdir(path);
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
for (const entry of entries) try {
|
||||
await unlinkEntry(join(path, entry));
|
||||
} catch {}
|
||||
try {
|
||||
await rmdir(path);
|
||||
} catch {}
|
||||
}
|
||||
/** Resolve and validate one folder the user asked to gather. */
|
||||
async function resolveFolder(raw) {
|
||||
if (typeof raw !== "string" || raw.trim() === "") throw new Error("farm: empty folder path");
|
||||
if (!isAbsolute(raw)) throw new Error(`farm: folder must be an absolute path: ${raw}`);
|
||||
let real;
|
||||
try {
|
||||
real = await realpath(raw);
|
||||
} catch {
|
||||
throw new Error(`farm: folder does not exist: ${raw}`);
|
||||
}
|
||||
if (!(await stat(real)).isDirectory()) throw new Error(`farm: not a directory: ${raw}`);
|
||||
return real;
|
||||
}
|
||||
/**
|
||||
* Build a farm for `folders` under `defaultFarmRoot()`.
|
||||
*
|
||||
* Refuses to reuse an existing farm directory: a silent merge into a directory
|
||||
* that already holds links would hide which entries this call owns.
|
||||
*/
|
||||
async function buildFarm(input) {
|
||||
const seen = /* @__PURE__ */ new Set();
|
||||
const targets = [];
|
||||
for (const raw of input.folders) {
|
||||
const target = await resolveFolder(raw);
|
||||
const key = WINDOWS ? target.toLowerCase() : target;
|
||||
if (seen.has(key)) continue;
|
||||
seen.add(key);
|
||||
targets.push(target);
|
||||
}
|
||||
if (targets.length < 2) throw new Error("farm: needs at least two distinct folders");
|
||||
const root = defaultFarmRoot();
|
||||
const path = join(root, farmDirectoryName(String(input.name)));
|
||||
await mkdir(root, { recursive: true });
|
||||
try {
|
||||
await mkdir(path);
|
||||
} catch (error) {
|
||||
if (error.code === "EEXIST") throw new Error(`farm: already exists, remove it first: ${path}`);
|
||||
throw new Error(`farm: cannot create ${path}: ${error instanceof Error ? error.message : String(error)}`);
|
||||
}
|
||||
const taken = /* @__PURE__ */ new Set();
|
||||
const links = [];
|
||||
try {
|
||||
for (const target of targets) {
|
||||
const name = linkNameFor(target, taken);
|
||||
await symlink(target, join(path, name), WINDOWS ? "junction" : "dir");
|
||||
links.push({
|
||||
name,
|
||||
target
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
await discard(path);
|
||||
throw new Error(`farm: cannot link into ${path}: ${error instanceof Error ? error.message : String(error)}`);
|
||||
}
|
||||
return {
|
||||
path,
|
||||
links
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Remove a farm this module built. Only entries under `defaultFarmRoot()` are
|
||||
* accepted, and only links are unlinked: a real directory aborts the removal.
|
||||
*/
|
||||
async function removeFarm(farmPath) {
|
||||
const root = defaultFarmRoot();
|
||||
const target = resolve(farmPath);
|
||||
const inside = relative(root, target);
|
||||
if (inside === "" || inside.startsWith("..") || isAbsolute(inside)) throw new Error(`farm: not a farm directory: ${farmPath}`);
|
||||
const entries = await readdir(target);
|
||||
for (const entry of entries) await unlinkEntry(join(target, entry));
|
||||
await rmdir(target);
|
||||
}
|
||||
// src/index.ts
|
||||
/** Plugin identity for cordis.yml rows. */
|
||||
const name = "workspace-groups-local";
|
||||
|
|
@ -3660,5 +3809,65 @@ function apply(ctx) {
|
|||
res.end(body);
|
||||
}
|
||||
}), "@dsh-xhl/workspace-groups: /workspace-groups/folders route");
|
||||
ctx.effect(() => ctx.webServer.register({
|
||||
kind: "exact",
|
||||
path: "/workspace-groups/farm",
|
||||
handler: async (req, res) => {
|
||||
if (req.method === "POST") {
|
||||
let raw;
|
||||
try {
|
||||
raw = JSON.parse(await readBody(req, MAX_MANUAL_BODY_BYTES));
|
||||
} catch (error) {
|
||||
writeError(res, error instanceof HttpError ? error.status : 400, `workspace-groups: ${error instanceof Error ? error.message : String(error)}`);
|
||||
return;
|
||||
}
|
||||
const body = raw;
|
||||
if (body === null || typeof body !== "object" || !Array.isArray(body.folders)) {
|
||||
writeError(res, 400, "workspace-groups: farm needs { name, folders: string[] }");
|
||||
return;
|
||||
}
|
||||
let result;
|
||||
try {
|
||||
result = await buildFarm({
|
||||
name: typeof body.name === "string" ? body.name : "farm",
|
||||
folders: body.folders
|
||||
});
|
||||
} catch (error) {
|
||||
writeError(res, 400, `workspace-groups: ${error instanceof Error ? error.message : String(error)}`);
|
||||
return;
|
||||
}
|
||||
const payload = JSON.stringify(result);
|
||||
res.writeHead(200, {
|
||||
"Content-Type": "application/json; charset=utf-8",
|
||||
"Cache-Control": "no-store",
|
||||
"Content-Length": Buffer.byteLength(payload)
|
||||
});
|
||||
res.end(payload);
|
||||
return;
|
||||
}
|
||||
if (req.method === "DELETE") {
|
||||
const target = new URL(req.url ?? "/", "http://localhost").searchParams.get("path");
|
||||
if (target === null || target.trim() === "") {
|
||||
writeError(res, 400, "workspace-groups: farm needs ?path=");
|
||||
return;
|
||||
}
|
||||
try {
|
||||
await removeFarm(target);
|
||||
} catch (error) {
|
||||
writeError(res, 400, `workspace-groups: ${error instanceof Error ? error.message : String(error)}`);
|
||||
return;
|
||||
}
|
||||
const payload = JSON.stringify({ ok: true });
|
||||
res.writeHead(200, {
|
||||
"Content-Type": "application/json; charset=utf-8",
|
||||
"Cache-Control": "no-store",
|
||||
"Content-Length": Buffer.byteLength(payload)
|
||||
});
|
||||
res.end(payload);
|
||||
return;
|
||||
}
|
||||
writeError(res, 405, "method not allowed");
|
||||
}
|
||||
}), "@dsh-xhl/workspace-groups: /workspace-groups/farm route");
|
||||
}
|
||||
export { apply, inject, name };
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import type { WorkspaceView } from '@deepseek-ai/dsh-api-workspace-controller/cl
|
|||
import { type WorkspaceFolderEntry } from '../core/folders.ts';
|
||||
import type { GroupsBrowserProps } from './contract.ts';
|
||||
import { type RemoteProfileSummary } from './folder-directory.ts';
|
||||
export declare function FoldersDialog({ workspace, entry, t, busy, canOpen, remote, ownerRemotePath, profiles, profilesError, knownWorkspaceIds, onClose, onAddFolder, onAddRemote, onAddSubpath, onSetRoot, onRemove, onOpenFolder }: {
|
||||
export declare function FoldersDialog({ workspace, entry, t, busy, canOpen, remote, ownerRemotePath, profiles, profilesError, knownWorkspaceIds, onClose, onBuildFarm, onAddFolder, onAddRemote, onAddSubpath, onSetRoot, onRemove, onOpenFolder }: {
|
||||
workspace: WorkspaceView;
|
||||
entry: WorkspaceFolderEntry | undefined;
|
||||
t: GroupsBrowserProps['t'];
|
||||
|
|
@ -18,6 +18,11 @@ export declare function FoldersDialog({ workspace, entry, t, busy, canOpen, remo
|
|||
/** Live workspace ids, so a member whose workspace is gone can say so. */
|
||||
knownWorkspaceIds: readonly string[];
|
||||
onClose: () => void;
|
||||
/**
|
||||
* Gather this project's folders into one link directory and register it as a
|
||||
* workspace, so a single session can read and write all of them.
|
||||
*/
|
||||
onBuildFarm: () => void;
|
||||
/** Pick any directory (local or an already-mirrored cloud folder). */
|
||||
onAddFolder: () => void;
|
||||
/** Register one cloud folder: returns true once it is stored. */
|
||||
|
|
|
|||
|
|
@ -0,0 +1,24 @@
|
|||
/**
|
||||
* Client side of the farm route.
|
||||
*
|
||||
* A farm is one real directory holding a link per project folder, so a session
|
||||
* can read and write all of them at once. The host owns the filesystem work;
|
||||
* this module only speaks the two requests, and never assumes success: every
|
||||
* failure comes back as an Error with the host's own message.
|
||||
*/
|
||||
export declare const FARM_ROUTE = "/workspace-groups/farm";
|
||||
export interface FarmLink {
|
||||
/** Entry name inside the farm directory. */
|
||||
readonly name: string;
|
||||
/** Absolute real path of the folder it points at. */
|
||||
readonly target: string;
|
||||
}
|
||||
export interface FarmResult {
|
||||
/** Absolute path of the farm directory. */
|
||||
readonly path: string;
|
||||
readonly links: readonly FarmLink[];
|
||||
}
|
||||
/** Build a farm for `folders`; the host refuses to reuse an existing one. */
|
||||
export declare function buildFarm(name: string, folders: readonly string[], fetchImpl?: typeof fetch): Promise<FarmResult>;
|
||||
/** Remove a farm; only its links are unlinked, never a real folder. */
|
||||
export declare function removeFarm(farmPath: string, fetchImpl?: typeof fetch): Promise<void>;
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
*/
|
||||
import type { LocaleDictOf } from '@deepseek-ai/dsh-client-ui-slots';
|
||||
/** Dictionary keys of the workspaceGroups namespace (single source of truth). */
|
||||
export type WorkspaceGroupsKey = 'section.workspaces' | 'section.sessions' | 'search' | 'search.placeholder' | 'search.clear' | 'search.noMatches' | 'search.unavailable' | 'search.pending' | 'search.hasMore' | 'search.results.aria' | 'workspace.add' | 'workspace.addBusy' | 'workspace.addError' | 'workspace.addErrorTitle' | 'workspace.rename' | 'workspace.delete' | 'workspace.deleteTitle' | 'workspace.deleteConfirm' | 'workspace.deleteCancel' | 'workspace.renaming' | 'workspace.deleting' | 'workspace.renameTitle' | 'workspace.renamePlaceholder' | 'workspace.renameConfirm' | 'workspace.renameCancel' | 'workspace.moveOutOfGroup' | 'workspace.openInFolder' | 'workspace.openInFolderError' | 'folder.title' | 'folder.manage' | 'folder.listAria' | 'folder.sectionList' | 'folder.sectionAdd' | 'folder.emptyHint' | 'folder.base' | 'folder.setRoot' | 'folder.rootBadge' | 'folder.remove' | 'folder.add' | 'folder.done' | 'folder.duplicate' | 'folder.conflict' | 'folder.removeError' | 'folder.removeRemotePrompt' | 'folder.removeRemoteDelete' | 'folder.removeRemoteOnly' | 'folder.addError' | 'folder.sessionError' | 'folder.saveError' | 'folder.notReady' | 'folder.remoteSessionUnsupported' | 'folder.remoteHint' | 'folder.remoteNeedsSubpath' | 'folder.subpathLabel' | 'folder.subpathPlaceholder' | 'folder.addSubpath' | 'folder.subpathInvalid' | 'folder.cloudSection' | 'folder.profileLabel' | 'folder.remotePathLabel' | 'folder.remotePathPlaceholder' | 'folder.remotePathOrName' | 'folder.createAndAdd' | 'folder.cloudNoteBoth' | 'folder.addRemote' | 'folder.noProfiles' | 'folder.profilesError' | 'folder.cloudTag' | 'folder.localTag' | 'folder.memberMissing' | 'folder.memberNested' | 'folder.alreadyRoot' | 'folder.addAria' | 'folder.tabLocal' | 'folder.tabCloud' | 'folder.pickLocal' | 'folder.localNote' | 'folder.localIntoRemote' | 'folder.cloudNote' | 'folder.browse' | 'folder.browseTitle' | 'folder.browseListAria' | 'folder.browseNote' | 'folder.browseFailed' | 'folder.chooseHere' | 'folder.up' | 'folder.home' | 'folder.refresh' | 'folder.loading' | 'folder.loadingState' | 'folder.loadError' | 'folder.refreshError' | 'folder.retry' | 'folder.retryDraft' | 'folder.discardDraft' | 'folder.conflictDetail' | 'folder.emptyDir' | 'group.create' | 'group.createTitle' | 'group.createPlaceholder' | 'group.createConfirm' | 'group.createCancel' | 'group.rename' | 'group.renameTitle' | 'group.renameConfirm' | 'group.delete' | 'group.deleteTitle' | 'group.deleteConfirm' | 'group.deleteCancel' | 'group.nameDuplicate' | 'group.nameReserved' | 'group.pin' | 'group.unpin' | 'group.pinned' | 'group.appearance' | 'group.appearanceTitle' | 'group.appearanceDone' | 'group.color' | 'group.colorDefault' | 'group.icon' | 'group.iconDefault' | 'group.iconCustom' | 'group.iconInvalid' | 'group.icon.section.common' | 'group.icon.section.lab' | 'group.icon.section.materials' | 'group.icon.section.characterization' | 'group.icon.section.devices' | 'group.icon.section.emoji' | 'color.red' | 'color.orange' | 'color.amber' | 'color.green' | 'color.teal' | 'color.blue' | 'color.indigo' | 'color.purple' | 'color.pink' | 'color.gray' | 'section.topLevel' | 'section.defaultWorkspace' | 'manual.saveError' | 'manual.conflict' | 'session.new' | 'session.rename' | 'session.archive' | 'session.fork' | 'session.renameTitle' | 'session.renamePlaceholder' | 'session.renameConfirm' | 'session.renameCancel' | 'session.renaming' | 'uncategorized' | 'empty.none' | 'empty.noWorkspaces' | 'close' | 'cancel' | 'confirm' | 'retry' | 'configUnavailable' | 'collapse' | 'expandMore' | 'newSession' | 'quick.title' | 'quick.tab.workspaces' | 'quick.tab.sessions' | 'quick.search.placeholder' | 'quick.search.sessions' | 'quick.empty.workspaces' | 'quick.action.newSession' | 'quick.action.running' | 'quick.action.noneRunning' | 'quick.empty.sessions' | 'quick.select.hint' | 'quick.hint' | 'tabs.aria' | 'tabs.close' | 'tabs.archive' | 'tabs.pin' | 'tabs.unpin' | 'tabs.pinned' | 'tabs.rename' | 'tabs.renameSession' | 'tabs.renamePlaceholder' | 'tabs.closeOthers' | 'tabs.closeRight' | 'tabs.dragHint';
|
||||
export type WorkspaceGroupsKey = 'section.workspaces' | 'section.sessions' | 'search' | 'search.placeholder' | 'search.clear' | 'search.noMatches' | 'search.unavailable' | 'search.pending' | 'search.hasMore' | 'search.results.aria' | 'workspace.add' | 'workspace.addBusy' | 'workspace.addError' | 'workspace.addErrorTitle' | 'workspace.rename' | 'workspace.delete' | 'workspace.deleteTitle' | 'workspace.deleteConfirm' | 'workspace.deleteCancel' | 'workspace.renaming' | 'workspace.deleting' | 'workspace.renameTitle' | 'workspace.renamePlaceholder' | 'workspace.renameConfirm' | 'workspace.renameCancel' | 'workspace.moveOutOfGroup' | 'workspace.openInFolder' | 'workspace.openInFolderError' | 'folder.title' | 'folder.manage' | 'folder.listAria' | 'folder.sectionList' | 'folder.sectionAdd' | 'folder.emptyHint' | 'folder.mergeTitle' | 'folder.mergeAction' | 'folder.mergeHint' | 'folder.mergeDone' | 'folder.mergeFailed' | 'folder.base' | 'folder.setRoot' | 'folder.rootBadge' | 'folder.remove' | 'folder.add' | 'folder.done' | 'folder.duplicate' | 'folder.conflict' | 'folder.removeError' | 'folder.removeRemotePrompt' | 'folder.removeRemoteDelete' | 'folder.removeRemoteOnly' | 'folder.addError' | 'folder.sessionError' | 'folder.saveError' | 'folder.notReady' | 'folder.remoteSessionUnsupported' | 'folder.remoteHint' | 'folder.remoteNeedsSubpath' | 'folder.subpathLabel' | 'folder.subpathPlaceholder' | 'folder.addSubpath' | 'folder.subpathInvalid' | 'folder.cloudSection' | 'folder.profileLabel' | 'folder.remotePathLabel' | 'folder.remotePathPlaceholder' | 'folder.remotePathOrName' | 'folder.createAndAdd' | 'folder.cloudNoteBoth' | 'folder.addRemote' | 'folder.noProfiles' | 'folder.profilesError' | 'folder.cloudTag' | 'folder.localTag' | 'folder.memberMissing' | 'folder.memberNested' | 'folder.alreadyRoot' | 'folder.addAria' | 'folder.tabLocal' | 'folder.tabCloud' | 'folder.pickLocal' | 'folder.localNote' | 'folder.localIntoRemote' | 'folder.cloudNote' | 'folder.browse' | 'folder.browseTitle' | 'folder.browseListAria' | 'folder.browseNote' | 'folder.browseFailed' | 'folder.chooseHere' | 'folder.up' | 'folder.home' | 'folder.refresh' | 'folder.loading' | 'folder.loadingState' | 'folder.loadError' | 'folder.refreshError' | 'folder.retry' | 'folder.retryDraft' | 'folder.discardDraft' | 'folder.conflictDetail' | 'folder.emptyDir' | 'group.create' | 'group.createTitle' | 'group.createPlaceholder' | 'group.createConfirm' | 'group.createCancel' | 'group.rename' | 'group.renameTitle' | 'group.renameConfirm' | 'group.delete' | 'group.deleteTitle' | 'group.deleteConfirm' | 'group.deleteCancel' | 'group.nameDuplicate' | 'group.nameReserved' | 'group.pin' | 'group.unpin' | 'group.pinned' | 'group.appearance' | 'group.appearanceTitle' | 'group.appearanceDone' | 'group.color' | 'group.colorDefault' | 'group.icon' | 'group.iconDefault' | 'group.iconCustom' | 'group.iconInvalid' | 'group.icon.section.common' | 'group.icon.section.lab' | 'group.icon.section.materials' | 'group.icon.section.characterization' | 'group.icon.section.devices' | 'group.icon.section.emoji' | 'color.red' | 'color.orange' | 'color.amber' | 'color.green' | 'color.teal' | 'color.blue' | 'color.indigo' | 'color.purple' | 'color.pink' | 'color.gray' | 'section.topLevel' | 'section.defaultWorkspace' | 'manual.saveError' | 'manual.conflict' | 'session.new' | 'session.rename' | 'session.archive' | 'session.fork' | 'session.renameTitle' | 'session.renamePlaceholder' | 'session.renameConfirm' | 'session.renameCancel' | 'session.renaming' | 'uncategorized' | 'empty.none' | 'empty.noWorkspaces' | 'close' | 'cancel' | 'confirm' | 'retry' | 'configUnavailable' | 'collapse' | 'expandMore' | 'newSession' | 'quick.title' | 'quick.tab.workspaces' | 'quick.tab.sessions' | 'quick.search.placeholder' | 'quick.search.sessions' | 'quick.empty.workspaces' | 'quick.action.newSession' | 'quick.action.running' | 'quick.action.noneRunning' | 'quick.empty.sessions' | 'quick.select.hint' | 'quick.hint' | 'tabs.aria' | 'tabs.close' | 'tabs.archive' | 'tabs.pin' | 'tabs.unpin' | 'tabs.pinned' | 'tabs.rename' | 'tabs.renameSession' | 'tabs.renamePlaceholder' | 'tabs.closeOthers' | 'tabs.closeRight' | 'tabs.dragHint';
|
||||
export type WorkspaceGroupsDict = LocaleDictOf<'workspaceGroups'>;
|
||||
/** Simplified Chinese dictionary. */
|
||||
export declare const zh: WorkspaceGroupsDict;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,30 @@
|
|||
export interface FarmLink {
|
||||
/** Entry name inside the farm directory. */
|
||||
readonly name: string;
|
||||
/** Absolute real path of the folder it points at. */
|
||||
readonly target: string;
|
||||
}
|
||||
export interface FarmResult {
|
||||
/** Absolute path of the farm directory. */
|
||||
readonly path: string;
|
||||
readonly links: readonly FarmLink[];
|
||||
}
|
||||
/** Root that holds every farm: `$DSH_HOME/workspace-groups/farms`. */
|
||||
export declare function defaultFarmRoot(): string;
|
||||
/** One directory-safe name for a farm, derived from a workspace title. */
|
||||
export declare function farmDirectoryName(title: string): string;
|
||||
/**
|
||||
* Build a farm for `folders` under `defaultFarmRoot()`.
|
||||
*
|
||||
* Refuses to reuse an existing farm directory: a silent merge into a directory
|
||||
* that already holds links would hide which entries this call owns.
|
||||
*/
|
||||
export declare function buildFarm(input: {
|
||||
name: string;
|
||||
folders: readonly unknown[];
|
||||
}): Promise<FarmResult>;
|
||||
/**
|
||||
* Remove a farm this module built. Only entries under `defaultFarmRoot()` are
|
||||
* accepted, and only links are unlinked: a real directory aborts the removal.
|
||||
*/
|
||||
export declare function removeFarm(farmPath: string): Promise<void>;
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "workspace-groups-remote",
|
||||
"version": "1.1.1",
|
||||
"version": "1.2.0",
|
||||
"description": "Merged DSH bundle: the workspace-groups sidebar manager (category -> project -> session grouped tree, session tab strip) plus dsh-remote-ssh (VSCode Remote-SSH-like remote development: remote workspaces, file access, integrated terminal) in one installable package.",
|
||||
"keywords": [
|
||||
"dsh",
|
||||
|
|
|
|||
Loading…
Reference in New Issue