dsh-git-worktree 0.7.1 → 0.7.3
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/CHANGELOG.md +33 -0
- package/NOTICE +1 -1
- package/README.en.md +45 -41
- package/README.md +45 -41
- package/lib/adapters/registry.js +29 -0
- package/lib/adapters/registry.js.map +1 -1
- package/lib/client/console-remote/index.d.ts +2 -2
- package/lib/client/pre-session/PreSessionWorktreeToggle.js +27 -11
- package/lib/client/pre-session/PreSessionWorktreeToggle.js.map +1 -1
- package/lib/client/workspace-sidebar/index.js.map +1 -1
- package/lib/client.js +435 -147
- package/lib/console-host/projection.js +1 -1
- package/lib/console-host/projection.js.map +1 -1
- package/lib/session-checkout-module.js +4 -1
- package/lib/session-checkout-module.js.map +1 -1
- package/package.json +32 -19
- package/scripts/check-publish.mjs +35 -13
- package/scripts/workspace-sidebar-upstream.mjs +13 -11
package/lib/client.js
CHANGED
|
@@ -33,8 +33,10 @@ let react_jsx_runtime = require("react/jsx-runtime");
|
|
|
33
33
|
react_jsx_runtime = __toESM(react_jsx_runtime);
|
|
34
34
|
let __deepseek_ai_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
35
35
|
__deepseek_ai_dsh_client_ui_primitives = __toESM(__deepseek_ai_dsh_client_ui_primitives);
|
|
36
|
-
let
|
|
37
|
-
|
|
36
|
+
let __deepseek_ai_cordis = require("@deepseek-ai/cordis");
|
|
37
|
+
__deepseek_ai_cordis = __toESM(__deepseek_ai_cordis);
|
|
38
|
+
let __deepseek_ai_dsh_client_store = require("@deepseek-ai/dsh-client-store");
|
|
39
|
+
__deepseek_ai_dsh_client_store = __toESM(__deepseek_ai_dsh_client_store);
|
|
38
40
|
|
|
39
41
|
//#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/core.js
|
|
40
42
|
var _a$1;
|
|
@@ -8317,8 +8319,13 @@ function PreSessionWorktreeToggle({ sessionId, session, input, inputActions, ada
|
|
|
8317
8319
|
const outcome = await adapter.current({ sessionId });
|
|
8318
8320
|
if (!outcome.ok) {
|
|
8319
8321
|
setTarget(null);
|
|
8320
|
-
|
|
8321
|
-
|
|
8322
|
+
if (outcome.error.code === "not_git_repository") {
|
|
8323
|
+
setState("unsupported");
|
|
8324
|
+
setError(null);
|
|
8325
|
+
} else {
|
|
8326
|
+
setState("error");
|
|
8327
|
+
setError(`${outcome.error.code}: ${outcome.error.message}`);
|
|
8328
|
+
}
|
|
8322
8329
|
return;
|
|
8323
8330
|
}
|
|
8324
8331
|
setTarget(outcome.value.target);
|
|
@@ -8327,12 +8334,21 @@ function PreSessionWorktreeToggle({ sessionId, session, input, inputActions, ada
|
|
|
8327
8334
|
(0, react.useEffect)(() => {
|
|
8328
8335
|
if (!blank) return;
|
|
8329
8336
|
let active = true;
|
|
8337
|
+
setTarget(null);
|
|
8338
|
+
setPendingInput(null);
|
|
8339
|
+
setState("loading");
|
|
8340
|
+
setError(null);
|
|
8330
8341
|
adapter.current({ sessionId }).then((outcome) => {
|
|
8331
8342
|
if (!active) return;
|
|
8332
8343
|
if (!outcome.ok) {
|
|
8333
8344
|
setTarget(null);
|
|
8334
|
-
|
|
8335
|
-
|
|
8345
|
+
if (outcome.error.code === "not_git_repository") {
|
|
8346
|
+
setState("unsupported");
|
|
8347
|
+
setError(null);
|
|
8348
|
+
} else {
|
|
8349
|
+
setState("error");
|
|
8350
|
+
setError(`${outcome.error.code}: ${outcome.error.message}`);
|
|
8351
|
+
}
|
|
8336
8352
|
return;
|
|
8337
8353
|
}
|
|
8338
8354
|
setTarget(outcome.value.target);
|
|
@@ -8347,14 +8363,15 @@ function PreSessionWorktreeToggle({ sessionId, session, input, inputActions, ada
|
|
|
8347
8363
|
blank,
|
|
8348
8364
|
sessionId
|
|
8349
8365
|
]);
|
|
8350
|
-
if (!blank) return null;
|
|
8366
|
+
if (!blank || state === "loading" || state === "unsupported") return null;
|
|
8367
|
+
if (target?.state === "local" && !target.capabilities.create) return null;
|
|
8351
8368
|
const selected = target?.state !== void 0 && target.state !== "local";
|
|
8352
8369
|
const canCreate = target?.state === "local" && target.capabilities.create;
|
|
8353
|
-
const busy = state === "
|
|
8370
|
+
const busy = state === "preparing";
|
|
8354
8371
|
const retryingLookup = state === "error" && target === null;
|
|
8355
8372
|
const disabled = busy || selected || !canCreate && !retryingLookup || input.phase !== "plain";
|
|
8356
8373
|
const checked = selected || pendingInput !== null || state === "preparing";
|
|
8357
|
-
const status = state === "preparing" ? "正在创建…" : selected ? "已创建" : pendingInput !== null ? "待确认" : state === "
|
|
8374
|
+
const status = state === "preparing" ? "正在创建…" : selected ? "已创建" : pendingInput !== null ? "待确认" : state === "error" ? "重试" : "Local";
|
|
8358
8375
|
const beginConfirmation = async () => {
|
|
8359
8376
|
if (disabled) return;
|
|
8360
8377
|
if (retryingLookup) {
|
|
@@ -9657,7 +9674,8 @@ const TARGET_CONSOLE_STYLES = String.raw`
|
|
|
9657
9674
|
//#endregion
|
|
9658
9675
|
//#region \0virtual:dsh-official-workspace-client
|
|
9659
9676
|
const modules = {
|
|
9660
|
-
"@deepseek-ai/
|
|
9677
|
+
"@deepseek-ai/cordis": __deepseek_ai_cordis,
|
|
9678
|
+
"@deepseek-ai/dsh-client-store": __deepseek_ai_dsh_client_store,
|
|
9661
9679
|
"react/jsx-runtime": react_jsx_runtime,
|
|
9662
9680
|
"react": react,
|
|
9663
9681
|
"@deepseek-ai/dsh-client-ui-primitives": __deepseek_ai_dsh_client_ui_primitives
|
|
@@ -9666,10 +9684,158 @@ const official = ((require$1) => {
|
|
|
9666
9684
|
var module$1 = { exports: {} };
|
|
9667
9685
|
var exports$1 = module$1.exports;
|
|
9668
9686
|
Object.defineProperty(exports$1, Symbol.toStringTag, { value: "Module" });
|
|
9669
|
-
let
|
|
9687
|
+
let _deepseek_ai_cordis = require$1("@deepseek-ai/cordis");
|
|
9688
|
+
let _deepseek_ai_dsh_client_store = require$1("@deepseek-ai/dsh-client-store");
|
|
9670
9689
|
let react_jsx_runtime$1 = require$1("react/jsx-runtime");
|
|
9671
9690
|
let react$1 = require$1("react");
|
|
9672
9691
|
let _deepseek_ai_dsh_client_ui_primitives = require$1("@deepseek-ai/dsh-client-ui-primitives");
|
|
9692
|
+
/** Workspace archive and directory UI capability. */
|
|
9693
|
+
/** Structured directory failure exposed to directory UI consumers. */
|
|
9694
|
+
var DirectoryBrowseError = class extends Error {
|
|
9695
|
+
rpcError;
|
|
9696
|
+
name = "DirectoryBrowseError";
|
|
9697
|
+
/** @param rpcError - Host directory business failure. */
|
|
9698
|
+
constructor(rpcError) {
|
|
9699
|
+
super(`directory browse failed: ${rpcError.code}: ${rpcError.message}`);
|
|
9700
|
+
this.rpcError = rpcError;
|
|
9701
|
+
}
|
|
9702
|
+
};
|
|
9703
|
+
/** Implements Workspace archive and directory UI operations. */
|
|
9704
|
+
var UiWorkspaceService = class extends _deepseek_ai_cordis.Service {
|
|
9705
|
+
directoryPicker;
|
|
9706
|
+
workspaces;
|
|
9707
|
+
sessions;
|
|
9708
|
+
connecting = /* @__PURE__ */ new Map();
|
|
9709
|
+
/**
|
|
9710
|
+
* @param ctx - Client root Context.
|
|
9711
|
+
* @param directoryPicker - the directory-picking Remote namespace.
|
|
9712
|
+
* @param workspaces - pure Workspace Controller.
|
|
9713
|
+
* @param sessions - pure Session Controller.
|
|
9714
|
+
*/
|
|
9715
|
+
constructor(ctx, directoryPicker, workspaces, sessions) {
|
|
9716
|
+
super(ctx, "uiWorkspace");
|
|
9717
|
+
this.directoryPicker = directoryPicker;
|
|
9718
|
+
this.workspaces = workspaces;
|
|
9719
|
+
this.sessions = sessions;
|
|
9720
|
+
ctx.effect(() => this.watchNavigation(), "ui-workspace: Workspace navigation policy");
|
|
9721
|
+
}
|
|
9722
|
+
async connectWorkspace(workspaceId) {
|
|
9723
|
+
const workspace = this.workspaces.list.getSnapshot().items.find((item) => item.workspaceId === workspaceId);
|
|
9724
|
+
if (workspace === void 0) throw new Error(`uiWorkspace.connectWorkspace: unknown workspace ${workspaceId}`);
|
|
9725
|
+
const inflight = this.connecting.get(workspaceId);
|
|
9726
|
+
if (inflight !== void 0) return inflight;
|
|
9727
|
+
const archived = this.workspaces.list.getSnapshot().archivedSessionIds;
|
|
9728
|
+
const sessions = this.sessions.list.getSnapshot();
|
|
9729
|
+
for (const id of sessions.ids) {
|
|
9730
|
+
const summary = sessions.byId[id];
|
|
9731
|
+
if (summary !== void 0 && summary.blank && summary.cwd === workspace.path && workspace.sessionIds.includes(summary.id) && !archived.includes(summary.id)) return summary.id;
|
|
9732
|
+
}
|
|
9733
|
+
const attempt$1 = this.sessions.create({ workspaceId }).finally(() => {
|
|
9734
|
+
this.connecting.delete(workspaceId);
|
|
9735
|
+
});
|
|
9736
|
+
this.connecting.set(workspaceId, attempt$1);
|
|
9737
|
+
return attempt$1;
|
|
9738
|
+
}
|
|
9739
|
+
startSession(workspaceId) {
|
|
9740
|
+
const workspace = this.workspaces.list.getSnapshot();
|
|
9741
|
+
const sessions = this.sessions.list.getSnapshot();
|
|
9742
|
+
const current = sessions.current;
|
|
9743
|
+
const currentWorkspaceId = current === void 0 ? void 0 : workspace.items.find((item) => item.sessionIds.includes(current))?.workspaceId;
|
|
9744
|
+
const recent = workspace.phase === "ready" && sessions.phase === "ready" ? recentWorkspace(workspace.items, sessions.byId) : void 0;
|
|
9745
|
+
const target = workspaceId ?? currentWorkspaceId ?? recent;
|
|
9746
|
+
if (target === void 0) {
|
|
9747
|
+
this.sessions.clear();
|
|
9748
|
+
return;
|
|
9749
|
+
}
|
|
9750
|
+
this.connectWorkspace(target).then((sessionId) => {
|
|
9751
|
+
this.sessions.open(sessionId);
|
|
9752
|
+
}, (reason) => {
|
|
9753
|
+
console.warn("new session failed:", reason);
|
|
9754
|
+
});
|
|
9755
|
+
}
|
|
9756
|
+
async archiveSession(sessionId) {
|
|
9757
|
+
await this.workspaces.archiveSession(sessionId);
|
|
9758
|
+
}
|
|
9759
|
+
async pickDirectory() {
|
|
9760
|
+
const result = await this.directoryPicker.pick();
|
|
9761
|
+
if (!result.ok) throw new Error(`directory picker failed: ${result.error.message}`);
|
|
9762
|
+
return result.value;
|
|
9763
|
+
}
|
|
9764
|
+
async listDirectory(path, signal) {
|
|
9765
|
+
const result = await this.directoryPicker.list(path, signal);
|
|
9766
|
+
if (!result.ok) throw new DirectoryBrowseError(result.error);
|
|
9767
|
+
return result.value;
|
|
9768
|
+
}
|
|
9769
|
+
async createDirectory(path, name) {
|
|
9770
|
+
const result = await this.directoryPicker.createDirectory(path, name);
|
|
9771
|
+
if (!result.ok) throw new DirectoryBrowseError(result.error);
|
|
9772
|
+
return result.value;
|
|
9773
|
+
}
|
|
9774
|
+
watchNavigation() {
|
|
9775
|
+
let initial = "waiting";
|
|
9776
|
+
let disposed = false;
|
|
9777
|
+
const reconcile = () => {
|
|
9778
|
+
if (disposed) return;
|
|
9779
|
+
if (this.clearArchivedCurrent()) return;
|
|
9780
|
+
if (initial !== "waiting") return;
|
|
9781
|
+
const workspace = this.workspaces.list.getSnapshot();
|
|
9782
|
+
const sessions = this.sessions.list.getSnapshot();
|
|
9783
|
+
if (workspace.phase !== "ready" || sessions.phase !== "ready") return;
|
|
9784
|
+
if (sessions.current !== void 0) {
|
|
9785
|
+
initial = "done";
|
|
9786
|
+
return;
|
|
9787
|
+
}
|
|
9788
|
+
const target = recentWorkspace(workspace.items, sessions.byId);
|
|
9789
|
+
if (target === void 0) {
|
|
9790
|
+
initial = "done";
|
|
9791
|
+
return;
|
|
9792
|
+
}
|
|
9793
|
+
initial = "connecting";
|
|
9794
|
+
this.connectWorkspace(target).then((sessionId) => {
|
|
9795
|
+
if (disposed) return;
|
|
9796
|
+
if (this.sessions.list.getSnapshot().current === void 0) this.sessions.open(sessionId);
|
|
9797
|
+
initial = "done";
|
|
9798
|
+
}, (reason) => {
|
|
9799
|
+
if (disposed) return;
|
|
9800
|
+
initial = "waiting";
|
|
9801
|
+
console.warn("initial workspace selection failed:", reason);
|
|
9802
|
+
});
|
|
9803
|
+
};
|
|
9804
|
+
const disposeWorkspaces = this.workspaces.list.subscribe(reconcile);
|
|
9805
|
+
const disposeSessions = this.sessions.list.subscribe(reconcile);
|
|
9806
|
+
reconcile();
|
|
9807
|
+
return () => {
|
|
9808
|
+
disposed = true;
|
|
9809
|
+
disposeSessions();
|
|
9810
|
+
disposeWorkspaces();
|
|
9811
|
+
};
|
|
9812
|
+
}
|
|
9813
|
+
/** @returns true when an archived current selection was cleared. */
|
|
9814
|
+
clearArchivedCurrent() {
|
|
9815
|
+
const current = this.sessions.list.getSnapshot().current;
|
|
9816
|
+
if (current === void 0 || !this.workspaces.list.getSnapshot().archivedSessionIds.includes(current)) return false;
|
|
9817
|
+
this.sessions.clear();
|
|
9818
|
+
return true;
|
|
9819
|
+
}
|
|
9820
|
+
};
|
|
9821
|
+
/** Stable tie-breaking follows Host Workspace order. */
|
|
9822
|
+
function recentWorkspace(workspaces, sessions) {
|
|
9823
|
+
let selected;
|
|
9824
|
+
let selectedTime = Number.NEGATIVE_INFINITY;
|
|
9825
|
+
for (const workspace of workspaces) {
|
|
9826
|
+
let latest = Number.NEGATIVE_INFINITY;
|
|
9827
|
+
for (const sessionId of workspace.sessionIds) {
|
|
9828
|
+
const session = sessions[sessionId];
|
|
9829
|
+
if (session !== void 0) latest = Math.max(latest, session.updatedAt);
|
|
9830
|
+
}
|
|
9831
|
+
if (latest === Number.NEGATIVE_INFINITY) latest = Date.parse(workspace.createdAt);
|
|
9832
|
+
if (selected === void 0 || latest > selectedTime) {
|
|
9833
|
+
selected = workspace.workspaceId;
|
|
9834
|
+
selectedTime = latest;
|
|
9835
|
+
}
|
|
9836
|
+
}
|
|
9837
|
+
return selected;
|
|
9838
|
+
}
|
|
9673
9839
|
/**
|
|
9674
9840
|
* The workspace browser's viewing store: the session-list grouping mode,
|
|
9675
9841
|
* persisted across reloads. Module level exports the factory only (a
|
|
@@ -9684,7 +9850,7 @@ const official = ((require$1) => {
|
|
|
9684
9850
|
* @returns the store handle (spec + type + identity + factory in one).
|
|
9685
9851
|
*/
|
|
9686
9852
|
function createWorkspaceViewStore() {
|
|
9687
|
-
return (0,
|
|
9853
|
+
return (0, _deepseek_ai_dsh_client_store.defineStore)({
|
|
9688
9854
|
init: () => ({
|
|
9689
9855
|
groupBy: "workspace",
|
|
9690
9856
|
orderBy: "updated",
|
|
@@ -9732,18 +9898,78 @@ const official = ((require$1) => {
|
|
|
9732
9898
|
for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
9733
9899
|
return n;
|
|
9734
9900
|
}
|
|
9735
|
-
/**
|
|
9736
|
-
|
|
9901
|
+
/**
|
|
9902
|
+
* Browser-safe Workspace path and display helpers.
|
|
9903
|
+
* @module @deepseek-ai/dsh-util-workspace-path
|
|
9904
|
+
*/
|
|
9905
|
+
/** Whether a path uses a Windows drive or UNC prefix. */
|
|
9906
|
+
function isWindowsStylePath(value) {
|
|
9907
|
+
return /^[A-Za-z]:[/\\]/.test(value) || value.startsWith("\\\\");
|
|
9908
|
+
}
|
|
9909
|
+
/**
|
|
9910
|
+
* Abbreviate a POSIX home directory for display.
|
|
9911
|
+
* @param path - Absolute or already-short display path.
|
|
9912
|
+
* @param home - Host account home; absent skips abbreviation.
|
|
9913
|
+
* @returns `~` or `~/…` for the POSIX home and its descendants, otherwise `path`.
|
|
9914
|
+
*/
|
|
9915
|
+
function abbreviateHomePath(path, home) {
|
|
9916
|
+
if (home === void 0 || home === "") return path;
|
|
9917
|
+
if (isWindowsStylePath(path) || isWindowsStylePath(home)) return path;
|
|
9918
|
+
const root = home.replace(/\/+$/, "");
|
|
9919
|
+
if (root === "" || root === "/") return path;
|
|
9920
|
+
if (path.replace(/\/+$/, "") === root) return "~";
|
|
9921
|
+
if (path.startsWith(`${root}/`)) return `~${path.slice(root.length)}`;
|
|
9922
|
+
return path;
|
|
9923
|
+
}
|
|
9924
|
+
/**
|
|
9925
|
+
* Read the final non-empty segment of a Workspace path for display.
|
|
9926
|
+
* Workspace-label surfaces use this helper instead of deriving another basename.
|
|
9927
|
+
* @param path - Workspace directory path using POSIX or Windows separators.
|
|
9928
|
+
* @returns the final segment, or an empty string for a separator-only path.
|
|
9929
|
+
*/
|
|
9930
|
+
function workspaceTitleOf(path) {
|
|
9931
|
+
const trimmed = path.replace(/[/\\]+$/, "");
|
|
9932
|
+
const separator = Math.max(trimmed.lastIndexOf("/"), trimmed.lastIndexOf("\\"));
|
|
9933
|
+
return trimmed.slice(separator + 1);
|
|
9934
|
+
}
|
|
9935
|
+
/** UI Workspace-owned projection of descendant counts from Session summaries. */
|
|
9936
|
+
/**
|
|
9937
|
+
* Index uninterrupted subagent descendants under each ancestor.
|
|
9938
|
+
* @param summaries - Session summaries keyed by id.
|
|
9939
|
+
* @returns descendant totals keyed by possible parent id.
|
|
9940
|
+
*/
|
|
9941
|
+
function indexSubagentDescendants(summaries) {
|
|
9942
|
+
const indexed = /* @__PURE__ */ new Map();
|
|
9943
|
+
for (const descendant of Object.values(summaries)) {
|
|
9944
|
+
if (descendant.origin !== "subagent") continue;
|
|
9945
|
+
const seen = /* @__PURE__ */ new Set();
|
|
9946
|
+
let current = descendant;
|
|
9947
|
+
while (current?.origin === "subagent" && current.parentId !== void 0 && !seen.has(current.id)) {
|
|
9948
|
+
seen.add(current.id);
|
|
9949
|
+
const aggregate = indexed.get(current.parentId);
|
|
9950
|
+
if (aggregate === void 0) indexed.set(current.parentId, {
|
|
9951
|
+
count: 1,
|
|
9952
|
+
runningCount: descendant.running ? 1 : 0
|
|
9953
|
+
});
|
|
9954
|
+
else {
|
|
9955
|
+
aggregate.count += 1;
|
|
9956
|
+
if (descendant.running) aggregate.runningCount += 1;
|
|
9957
|
+
}
|
|
9958
|
+
current = summaries[current.parentId];
|
|
9959
|
+
}
|
|
9960
|
+
}
|
|
9961
|
+
return indexed;
|
|
9962
|
+
}
|
|
9737
9963
|
/**
|
|
9738
9964
|
* Directory display label: basename of the path (both separators accepted).
|
|
9739
9965
|
* Ungrouped-bucket fallback for surfaces without a workspace title.
|
|
9740
9966
|
* @param cwd - directory path, or undefined for the ungrouped bucket.
|
|
9741
|
-
* @returns basename, the raw cwd when it has no basename, or
|
|
9967
|
+
* @returns basename, the raw cwd when it has no basename, or an empty ungrouped marker.
|
|
9742
9968
|
*/
|
|
9743
9969
|
function workspaceLabel(cwd) {
|
|
9744
|
-
if (cwd === void 0 || cwd === "") return
|
|
9745
|
-
const base = cwd
|
|
9746
|
-
return base !==
|
|
9970
|
+
if (cwd === void 0 || cwd === "") return "";
|
|
9971
|
+
const base = workspaceTitleOf(cwd);
|
|
9972
|
+
return base !== "" ? base : cwd;
|
|
9747
9973
|
}
|
|
9748
9974
|
/** Recency comparator: newest first, id as the deterministic tiebreak (ids are unique per group). */
|
|
9749
9975
|
function byRecency(a, b) {
|
|
@@ -9765,7 +9991,11 @@ const official = ((require$1) => {
|
|
|
9765
9991
|
* and the renderer localizes its display label.
|
|
9766
9992
|
*/
|
|
9767
9993
|
function sessionTitle(session) {
|
|
9768
|
-
return session.blank ? "
|
|
9994
|
+
return session.blank ? "" : session.displayTitle;
|
|
9995
|
+
}
|
|
9996
|
+
/** The list projection alone owns the best-effort active-Schedule indicator. */
|
|
9997
|
+
function hasActiveSchedule(session) {
|
|
9998
|
+
return (session.projectionValues?.schedule?.length ?? 0) > 0;
|
|
9769
9999
|
}
|
|
9770
10000
|
/** Build one group without projecting session lineage into presentation. */
|
|
9771
10001
|
function buildGroup(key, workspaceId, cwd, createdAt, label, members, order) {
|
|
@@ -9820,10 +10050,20 @@ const official = ((require$1) => {
|
|
|
9820
10050
|
groups.push(group);
|
|
9821
10051
|
}
|
|
9822
10052
|
const stray = list.ids.map((id) => list.byId[id]).filter((s) => s !== void 0 && !accounted.has(s.id) && sessionVisible(s, list.current, archived));
|
|
9823
|
-
if (stray.length > 0) groups.push(buildGroup("", void 0, void 0, void 0,
|
|
10053
|
+
if (stray.length > 0) groups.push(buildGroup("", void 0, void 0, void 0, "", ungroupedOrder === void 0 ? stray : orderedUngrouped(stray, ungroupedOrder), ungroupedOrder === void 0 ? "recency" : "account"));
|
|
9824
10054
|
return groups;
|
|
9825
10055
|
}
|
|
9826
|
-
|
|
10056
|
+
/** Keep navigation presentation independent from domain-owned interaction objects. */
|
|
10057
|
+
function visiblePendingKind(kind) {
|
|
10058
|
+
switch (kind) {
|
|
10059
|
+
case "approval":
|
|
10060
|
+
case "plan-review":
|
|
10061
|
+
case "question": return kind;
|
|
10062
|
+
default: return;
|
|
10063
|
+
}
|
|
10064
|
+
}
|
|
10065
|
+
function sessionNode(s, descendants, pendingInteractions) {
|
|
10066
|
+
const pendingInteraction = visiblePendingKind(pendingInteractions.get(s.id)?.kind);
|
|
9827
10067
|
return {
|
|
9828
10068
|
id: s.id,
|
|
9829
10069
|
title: sessionTitle(s),
|
|
@@ -9831,9 +10071,10 @@ const official = ((require$1) => {
|
|
|
9831
10071
|
running: s.running,
|
|
9832
10072
|
runningSubagentCount: descendants.get(s.id)?.runningCount ?? 0,
|
|
9833
10073
|
completed: s.completed === true,
|
|
10074
|
+
hasActiveSchedule: hasActiveSchedule(s),
|
|
9834
10075
|
updatedAt: s.updatedAt,
|
|
9835
10076
|
...s.__dshGitWorktree === void 0 ? {} : { __dshGitWorktree: s.__dshGitWorktree },
|
|
9836
|
-
...
|
|
10077
|
+
...pendingInteraction === void 0 ? {} : { pendingInteraction }
|
|
9837
10078
|
};
|
|
9838
10079
|
}
|
|
9839
10080
|
/**
|
|
@@ -9847,13 +10088,14 @@ const official = ((require$1) => {
|
|
|
9847
10088
|
* @param list - sessions list snapshot (`current` feeds containsCurrent).
|
|
9848
10089
|
* @param workspaces - real workspaces in stable Host order.
|
|
9849
10090
|
* @param archivedSessionIds - registry-global archive set.
|
|
10091
|
+
* @param pendingInteractions - pending UI interactions by Session.
|
|
9850
10092
|
* @param view - local expansion arrays.
|
|
9851
10093
|
* @returns group sections in render order.
|
|
9852
10094
|
*/
|
|
9853
|
-
function deriveGroups(list, workspaces, archivedSessionIds, view) {
|
|
10095
|
+
function deriveGroups(list, workspaces, archivedSessionIds, pendingInteractions, view) {
|
|
9854
10096
|
const archived = new Set(archivedSessionIds);
|
|
9855
10097
|
const expandedGroups = new Set(view.expandedGroups);
|
|
9856
|
-
const descendants =
|
|
10098
|
+
const descendants = indexSubagentDescendants(list.byId);
|
|
9857
10099
|
const currentGroup = list.current === void 0 ? void 0 : workspaces.find((w) => w.sessionIds.includes(list.current))?.workspaceId ?? "";
|
|
9858
10100
|
const groups = [];
|
|
9859
10101
|
for (const g of groupByWorkspace(list, workspaces, archived, view.ungroupedOrder)) {
|
|
@@ -9868,7 +10110,7 @@ const official = ((require$1) => {
|
|
|
9868
10110
|
sessionCount: g.sessions.length,
|
|
9869
10111
|
expanded,
|
|
9870
10112
|
containsCurrent: g.key === currentGroup,
|
|
9871
|
-
sessions: expanded ? g.sessions.map((session) => sessionNode(session, descendants)) : []
|
|
10113
|
+
sessions: expanded ? g.sessions.map((session) => sessionNode(session, descendants, pendingInteractions)) : []
|
|
9872
10114
|
});
|
|
9873
10115
|
}
|
|
9874
10116
|
return groups;
|
|
@@ -9880,11 +10122,12 @@ const official = ((require$1) => {
|
|
|
9880
10122
|
* (see {@link deriveSearchResults}).
|
|
9881
10123
|
* @param list - sessions list snapshot.
|
|
9882
10124
|
* @param archivedSessionIds - registry-global archive set.
|
|
10125
|
+
* @param pendingInteractions - pending UI interactions by Session.
|
|
9883
10126
|
* @returns flat rows in render order.
|
|
9884
10127
|
*/
|
|
9885
|
-
function deriveFlat(list, archivedSessionIds) {
|
|
10128
|
+
function deriveFlat(list, archivedSessionIds, pendingInteractions) {
|
|
9886
10129
|
const archived = new Set(archivedSessionIds);
|
|
9887
|
-
const descendants =
|
|
10130
|
+
const descendants = indexSubagentDescendants(list.byId);
|
|
9888
10131
|
const rows = [];
|
|
9889
10132
|
for (const id of list.ids) {
|
|
9890
10133
|
const s = list.byId[id];
|
|
@@ -9892,7 +10135,7 @@ const official = ((require$1) => {
|
|
|
9892
10135
|
rows.push(s);
|
|
9893
10136
|
}
|
|
9894
10137
|
rows.sort(byRecency);
|
|
9895
|
-
return rows.map((session) => sessionNode(session, descendants));
|
|
10138
|
+
return rows.map((session) => sessionNode(session, descendants, pendingInteractions));
|
|
9896
10139
|
}
|
|
9897
10140
|
/**
|
|
9898
10141
|
* Merge immediate title/Workspace substring matches with ranked Host content
|
|
@@ -9902,18 +10145,19 @@ const official = ((require$1) => {
|
|
|
9902
10145
|
* @param workspaces - Workspace membership and display labels.
|
|
9903
10146
|
* @param query - caller text; surrounding whitespace is ignored.
|
|
9904
10147
|
* @param archivedSessionIds - registry-global archive set (members never match).
|
|
10148
|
+
* @param pendingInteractions - pending UI interactions by Session.
|
|
9905
10149
|
* @param content - ranked Host content-search page.
|
|
9906
10150
|
* @param limit - protocol-owned maximum merged row count.
|
|
9907
10151
|
* @returns bounded deduplicated flat rows and a refine-query hint bit.
|
|
9908
10152
|
*/
|
|
9909
|
-
function deriveSearchResults(list, workspaces, query, archivedSessionIds, content, limit) {
|
|
10153
|
+
function deriveSearchResults(list, workspaces, query, archivedSessionIds, pendingInteractions, content, limit) {
|
|
9910
10154
|
const q = query.trim().toLowerCase();
|
|
9911
10155
|
if (q === "") return {
|
|
9912
10156
|
items: [],
|
|
9913
10157
|
hasMore: false
|
|
9914
10158
|
};
|
|
9915
10159
|
const archived = new Set(archivedSessionIds);
|
|
9916
|
-
const descendants =
|
|
10160
|
+
const descendants = indexSubagentDescendants(list.byId);
|
|
9917
10161
|
const workspaceBySession = /* @__PURE__ */ new Map();
|
|
9918
10162
|
for (const workspace of workspaces) for (const sessionId of workspace.sessionIds) if (!workspaceBySession.has(sessionId)) workspaceBySession.set(sessionId, workspace.title);
|
|
9919
10163
|
const labelOf = (summary) => workspaceBySession.get(summary.id) ?? workspaceLabel(summary.cwd);
|
|
@@ -9941,6 +10185,7 @@ const official = ((require$1) => {
|
|
|
9941
10185
|
return {
|
|
9942
10186
|
items: ordered.slice(0, limit).map((summary) => {
|
|
9943
10187
|
const match = contentBySession.get(summary.id);
|
|
10188
|
+
const pendingInteraction = visiblePendingKind(pendingInteractions.get(summary.id)?.kind);
|
|
9944
10189
|
return {
|
|
9945
10190
|
id: summary.id,
|
|
9946
10191
|
title: sessionTitle(summary),
|
|
@@ -9948,52 +10193,16 @@ const official = ((require$1) => {
|
|
|
9948
10193
|
running: summary.running,
|
|
9949
10194
|
runningSubagentCount: descendants.get(summary.id)?.runningCount ?? 0,
|
|
9950
10195
|
...summary.__dshGitWorktree === void 0 ? {} : { __dshGitWorktree: summary.__dshGitWorktree },
|
|
9951
|
-
...
|
|
10196
|
+
...pendingInteraction === void 0 ? {} : { pendingInteraction },
|
|
9952
10197
|
completed: summary.completed === true,
|
|
10198
|
+
hasActiveSchedule: hasActiveSchedule(summary),
|
|
9953
10199
|
...match === void 0 ? {} : { snippet: match.snippet }
|
|
9954
10200
|
};
|
|
9955
10201
|
}),
|
|
9956
10202
|
hasMore: content.hasMore || ordered.length > limit
|
|
9957
10203
|
};
|
|
9958
10204
|
}
|
|
9959
|
-
|
|
9960
|
-
* Compact relative time for session rows, as a structured bucket the
|
|
9961
|
-
* renderer localizes ("now"/"5min"/"3h"/"2d"/"4mo"/"1y" in en).
|
|
9962
|
-
* @param updatedAt - epoch ms of the session's last activity.
|
|
9963
|
-
* @param now - current epoch ms (injected for pure rendering).
|
|
9964
|
-
* @returns the row's trailing time bucket and magnitude.
|
|
9965
|
-
*/
|
|
9966
|
-
function relativeTime(updatedAt, now) {
|
|
9967
|
-
const MIN = 6e4;
|
|
9968
|
-
const HOUR = 36e5;
|
|
9969
|
-
const DAY = 864e5;
|
|
9970
|
-
const diff = Math.max(0, now - updatedAt);
|
|
9971
|
-
if (diff < MIN) return {
|
|
9972
|
-
unit: "now",
|
|
9973
|
-
n: 0
|
|
9974
|
-
};
|
|
9975
|
-
if (diff < HOUR) return {
|
|
9976
|
-
unit: "minutes",
|
|
9977
|
-
n: Math.floor(diff / MIN)
|
|
9978
|
-
};
|
|
9979
|
-
if (diff < DAY) return {
|
|
9980
|
-
unit: "hours",
|
|
9981
|
-
n: Math.floor(diff / HOUR)
|
|
9982
|
-
};
|
|
9983
|
-
if (diff < 30 * DAY) return {
|
|
9984
|
-
unit: "days",
|
|
9985
|
-
n: Math.floor(diff / DAY)
|
|
9986
|
-
};
|
|
9987
|
-
if (diff < 365 * DAY) return {
|
|
9988
|
-
unit: "months",
|
|
9989
|
-
n: Math.floor(diff / (30 * DAY))
|
|
9990
|
-
};
|
|
9991
|
-
return {
|
|
9992
|
-
unit: "years",
|
|
9993
|
-
n: Math.floor(diff / (365 * DAY))
|
|
9994
|
-
};
|
|
9995
|
-
}
|
|
9996
|
-
const css$2 = ".YDXeBa_projectRow,.YDXeBa_sessionRow{cursor:pointer;user-select:none;color:var(--dsw-alias-label-primary);border-radius:8px;align-items:center;gap:6px;padding:0 8px;display:flex}.YDXeBa_projectRow:hover,.YDXeBa_sessionRow:hover,.YDXeBa_sessionRow.YDXeBa_selected{background:var(--dsw-alias-interactive-bg-hover)}.YDXeBa_searchResultRow{box-sizing:border-box;cursor:pointer;text-align:left;width:100%;min-height:48px;color:var(--dsw-alias-label-primary);background:0 0;border:none;border-radius:8px;flex-direction:column;align-items:stretch;padding:4px 8px;display:flex}.YDXeBa_searchResultRow:hover,.YDXeBa_searchResultRow.YDXeBa_selected{background:var(--dsw-alias-interactive-bg-hover)}.YDXeBa_searchResultHeading{align-items:center;min-width:0;display:flex}.YDXeBa_searchResultTitle{text-overflow:ellipsis;white-space:nowrap;min-width:0;margin-left:4px;font-size:14px;line-height:20px;overflow:hidden}.YDXeBa_searchResultMeta{align-items:center;gap:6px;min-width:0;margin-left:20px;display:flex}.YDXeBa_searchResultWorkspace,.YDXeBa_searchResultSnippet{text-overflow:ellipsis;white-space:nowrap;font-size:12px;line-height:17px;overflow:hidden}.YDXeBa_searchResultWorkspace{max-width:40%;color:var(--dsw-alias-label-tertiary);flex:none}.YDXeBa_searchResultSnippet{min-width:0;color:var(--dsw-alias-label-secondary);flex:1}.YDXeBa_projectRow{box-sizing:border-box;align-items:center;height:34px}.YDXeBa_projectRow .YDXeBa_rowActions{height:20px}.YDXeBa_sessionRow{height:32px;animation:YDXeBa_row-in .15s var(--ds-ease-in-out);gap:0}.YDXeBa_sessionRow .YDXeBa_title{margin:0 6px 0 4px}.YDXeBa_flatSessionRowWithoutStatus .YDXeBa_title{margin-left:0}@keyframes YDXeBa_row-in{0%{opacity:0}}.YDXeBa_slot{width:16px;height:20px;color:var(--dsw-alias-label-tertiary);flex:none;justify-content:center;align-items:center;display:inline-flex}.YDXeBa_visuallyHidden{clip:rect(0 0 0 0);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}.YDXeBa_folderActive{color:var(--dsw-alias-state-business-primary)}.YDXeBa_projectRow .YDXeBa_chevron{display:none}.YDXeBa_projectRow:hover .YDXeBa_chevron{display:inline-flex}.YDXeBa_projectRow:hover .YDXeBa_folder{display:none}.YDXeBa_arrow{transition:transform .15s var(--ds-ease-in-out)}.YDXeBa_arrowOpen{transform:rotate(90deg)}.YDXeBa_projectText{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.YDXeBa_title{text-overflow:ellipsis;white-space:nowrap;min-width:0;font-size:14px;line-height:20px;overflow:hidden}.YDXeBa_renameInput{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-button-elevated-fill);min-width:0;color:inherit;border-radius:4px;outline:none;padding:0 2px;font-size:14px;line-height:20px}.YDXeBa_sessionRow .YDXeBa_title{flex:1}.YDXeBa_meta{text-overflow:ellipsis;white-space:nowrap;color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:20px;overflow:hidden}.YDXeBa_time{color:var(--dsw-alias-label-tertiary);flex:none;font-size:12px;line-height:20px}.YDXeBa_dot{flex:none}.YDXeBa_rowActions{flex:none;align-items:center;gap:12px;display:none}.YDXeBa_projectRow:hover .YDXeBa_rowActions,.YDXeBa_sessionRow:hover .YDXeBa_rowActions,.YDXeBa_projectRow.YDXeBa_menuOpen .YDXeBa_rowActions,.YDXeBa_sessionRow.YDXeBa_menuOpen .YDXeBa_rowActions{display:inline-flex}.YDXeBa_sessionRow:hover .YDXeBa_time,.YDXeBa_sessionRow.YDXeBa_menuOpen .YDXeBa_time{display:none}.YDXeBa_projectRow.YDXeBa_menuOpen,.YDXeBa_sessionRow.YDXeBa_menuOpen{background:var(--dsw-alias-interactive-bg-hover)}.YDXeBa_sessionRow.YDXeBa_dropBefore,.YDXeBa_sessionRow.YDXeBa_dropAfter{position:relative}.YDXeBa_sessionRow.YDXeBa_dropBefore:before,.YDXeBa_sessionRow.YDXeBa_dropAfter:after{content:\"\";z-index:1;background:linear-gradient(55deg, transparent calc(50% - 1px), var(--dsw-alias-state-business-primary) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)) 0 0 / 5px 7px no-repeat, linear-gradient(125deg, transparent calc(50% - 1px), var(--dsw-alias-state-business-primary) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)) 0 5px / 5px 7px no-repeat, linear-gradient(var(--dsw-alias-state-business-primary) 0 0) 4px 5px / calc(100% - 4px) 2px no-repeat;pointer-events:none;height:12px;position:absolute;left:0;right:4px}.YDXeBa_sessionRow.YDXeBa_dropBefore:before{top:-7px}.YDXeBa_sessionRow.YDXeBa_dropAfter:after{bottom:-7px}.YDXeBa_hoverContent{flex-direction:column;gap:8px;display:flex}.YDXeBa_hoverTitle{color:#fff;overflow-wrap:break-word;font-size:14px;line-height:20px}.YDXeBa_hoverPath{color:#cfd3d6;word-break:break-all;font-size:12px;line-height:16px}.YDXeBa_hoverTime{color:#cfd3d6;font-size:12px;line-height:16px}.YDXeBa_hoverStatus{color:#adb2b8;align-items:center;gap:8px;font-size:12px;line-height:20px;display:flex}.YDXeBa_iconButton{cursor:pointer;width:16px;height:16px;color:var(--dsw-alias-label-tertiary);background:0 0;border:none;border-radius:4px;flex:none;justify-content:center;align-items:center;padding:0;display:inline-flex}.YDXeBa_iconButton:hover{color:var(--dsw-alias-label-primary)}.YDXeBa_chevron{color:var(--dsw-alias-label-caption)}@media (prefers-reduced-motion:reduce){.YDXeBa_sessionRow,.YDXeBa_arrow{transition:none;animation:none}}";
|
|
10205
|
+
const css$2 = ".YDXeBa_projectRow,.YDXeBa_sessionRow{cursor:pointer;user-select:none;color:var(--dsw-alias-label-primary);border-radius:8px;align-items:center;gap:6px;padding:0 8px;display:flex}.YDXeBa_projectRow:hover,.YDXeBa_sessionRow:hover,.YDXeBa_sessionRow.YDXeBa_selected{background:var(--dsw-alias-interactive-bg-hover)}.YDXeBa_searchResultRow{box-sizing:border-box;cursor:pointer;text-align:left;width:100%;min-height:48px;color:var(--dsw-alias-label-primary);background:0 0;border:none;border-radius:8px;flex-direction:column;align-items:stretch;padding:4px 8px;display:flex}.YDXeBa_searchResultRow:hover,.YDXeBa_searchResultRow.YDXeBa_selected{background:var(--dsw-alias-interactive-bg-hover)}.YDXeBa_searchResultHeading{align-items:center;min-width:0;display:flex}.YDXeBa_searchResultTitle{text-overflow:ellipsis;white-space:nowrap;flex:0 auto;min-width:0;margin-left:4px;font-size:14px;line-height:20px;overflow:hidden}.YDXeBa_searchResultMeta{align-items:center;gap:6px;min-width:0;margin-left:20px;display:flex}.YDXeBa_searchResultWorkspace,.YDXeBa_searchResultSnippet{text-overflow:ellipsis;white-space:nowrap;font-size:12px;line-height:17px;overflow:hidden}.YDXeBa_searchResultWorkspace{max-width:40%;color:var(--dsw-alias-label-tertiary);flex:none}.YDXeBa_searchResultSnippet{min-width:0;color:var(--dsw-alias-label-secondary);flex:1}.YDXeBa_projectRow{box-sizing:border-box;align-items:center;height:34px}.YDXeBa_projectRow .YDXeBa_rowActions{height:20px}.YDXeBa_sessionRow{height:32px;animation:YDXeBa_row-in .15s var(--ds-ease-in-out);gap:0}.YDXeBa_sessionRow .YDXeBa_title{margin:0 6px 0 4px}.YDXeBa_flatSessionRowWithoutStatus .YDXeBa_title{margin-left:0}@keyframes YDXeBa_row-in{0%{opacity:0}}.YDXeBa_slot{width:16px;height:20px;color:var(--dsw-alias-label-tertiary);flex:none;justify-content:center;align-items:center;display:inline-flex}.YDXeBa_visuallyHidden{clip:rect(0 0 0 0);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}.YDXeBa_folderActive{color:var(--dsw-alias-state-business-primary)}.YDXeBa_projectRow .YDXeBa_chevron{display:none}.YDXeBa_projectRow:hover .YDXeBa_chevron{display:inline-flex}.YDXeBa_projectRow:hover .YDXeBa_folder{display:none}.YDXeBa_arrow{transition:transform .15s var(--ds-ease-in-out)}.YDXeBa_arrowOpen{transform:rotate(90deg)}.YDXeBa_projectText{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.YDXeBa_title{text-overflow:ellipsis;white-space:nowrap;min-width:0;font-size:14px;line-height:20px;overflow:hidden}.YDXeBa_renameInput{border:.5px solid var(--dsw-alias-border-l4);background:var(--dsw-alias-button-elevated-fill);min-width:0;color:inherit;border-radius:4px;outline:none;padding:0 2px;font-size:14px;line-height:20px}.YDXeBa_sessionRow .YDXeBa_title{flex:1}.YDXeBa_meta{text-overflow:ellipsis;white-space:nowrap;color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:20px;overflow:hidden}.YDXeBa_time{color:var(--dsw-alias-label-tertiary);flex:none;font-size:12px;line-height:20px}.YDXeBa_scheduleIndicator{width:16px;height:20px;color:var(--dsw-alias-label-tertiary);flex:none;justify-content:center;align-items:center;margin-right:6px;display:inline-flex}.YDXeBa_searchScheduleIndicator{margin-left:4px;margin-right:0}.YDXeBa_dot{flex:none}.YDXeBa_rowActions{flex:none;align-items:center;gap:12px;display:none}.YDXeBa_projectRow:hover .YDXeBa_rowActions,.YDXeBa_sessionRow:hover .YDXeBa_rowActions,.YDXeBa_projectRow.YDXeBa_menuOpen .YDXeBa_rowActions,.YDXeBa_sessionRow.YDXeBa_menuOpen .YDXeBa_rowActions{display:inline-flex}.YDXeBa_sessionRow:hover .YDXeBa_time,.YDXeBa_sessionRow.YDXeBa_menuOpen .YDXeBa_time{display:none}.YDXeBa_projectRow.YDXeBa_menuOpen,.YDXeBa_sessionRow.YDXeBa_menuOpen{background:var(--dsw-alias-interactive-bg-hover)}.YDXeBa_sessionRow.YDXeBa_dropBefore,.YDXeBa_sessionRow.YDXeBa_dropAfter{position:relative}.YDXeBa_sessionRow.YDXeBa_dropBefore:before,.YDXeBa_sessionRow.YDXeBa_dropAfter:after{content:\"\";z-index:1;background:linear-gradient(55deg, transparent calc(50% - 1px), var(--dsw-alias-state-business-primary) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)) 0 0 / 5px 7px no-repeat, linear-gradient(125deg, transparent calc(50% - 1px), var(--dsw-alias-state-business-primary) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)) 0 5px / 5px 7px no-repeat, linear-gradient(var(--dsw-alias-state-business-primary) 0 0) 4px 5px / calc(100% - 4px) 2px no-repeat;pointer-events:none;height:12px;position:absolute;left:0;right:4px}.YDXeBa_sessionRow.YDXeBa_dropBefore:before{top:-7px}.YDXeBa_sessionRow.YDXeBa_dropAfter:after{bottom:-7px}.YDXeBa_hoverContent{flex-direction:column;gap:8px;display:flex}.YDXeBa_hoverTitle{color:#fff;overflow-wrap:break-word;font-size:14px;line-height:20px}.YDXeBa_hoverPath{color:#cfd3d6;word-break:break-all;font-size:12px;line-height:16px}.YDXeBa_hoverTime{color:#cfd3d6;font-size:12px;line-height:16px}.YDXeBa_hoverStatus{color:#adb2b8;align-items:center;gap:8px;font-size:12px;line-height:20px;display:flex}.YDXeBa_iconButton{cursor:pointer;width:16px;height:16px;color:var(--dsw-alias-label-tertiary);background:0 0;border:none;border-radius:4px;flex:none;justify-content:center;align-items:center;padding:0;display:inline-flex}.YDXeBa_iconButton:hover{color:var(--dsw-alias-label-primary)}.YDXeBa_chevron{color:var(--dsw-alias-label-caption)}@media (prefers-reduced-motion:reduce){.YDXeBa_sessionRow,.YDXeBa_arrow{transition:none;animation:none}}";
|
|
9997
10206
|
const tagId$2 = "@deepseek-ai/dsh-client-ui-workspace/Rows.module.css";
|
|
9998
10207
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$2) + "]") === null) {
|
|
9999
10208
|
const tag = document.createElement("style");
|
|
@@ -10025,12 +10234,14 @@ const official = ((require$1) => {
|
|
|
10025
10234
|
"renameInput": "YDXeBa_renameInput",
|
|
10026
10235
|
"row-in": "YDXeBa_row-in",
|
|
10027
10236
|
"rowActions": "YDXeBa_rowActions",
|
|
10237
|
+
"scheduleIndicator": "YDXeBa_scheduleIndicator",
|
|
10028
10238
|
"searchResultHeading": "YDXeBa_searchResultHeading",
|
|
10029
10239
|
"searchResultMeta": "YDXeBa_searchResultMeta",
|
|
10030
10240
|
"searchResultRow": "YDXeBa_searchResultRow",
|
|
10031
10241
|
"searchResultSnippet": "YDXeBa_searchResultSnippet",
|
|
10032
10242
|
"searchResultTitle": "YDXeBa_searchResultTitle",
|
|
10033
10243
|
"searchResultWorkspace": "YDXeBa_searchResultWorkspace",
|
|
10244
|
+
"searchScheduleIndicator": "YDXeBa_searchScheduleIndicator",
|
|
10034
10245
|
"selected": "YDXeBa_selected",
|
|
10035
10246
|
"sessionRow": "YDXeBa_sessionRow",
|
|
10036
10247
|
"slot": "YDXeBa_slot",
|
|
@@ -10051,12 +10262,12 @@ const official = ((require$1) => {
|
|
|
10051
10262
|
}
|
|
10052
10263
|
/** Localized compact relative time ("刚刚"/"5分钟" in zh, "now"/"5min" in en). */
|
|
10053
10264
|
function timeLabel(updatedAt, now, t) {
|
|
10054
|
-
const { unit, n } = relativeTime(updatedAt, now);
|
|
10265
|
+
const { unit, n } = (0, _deepseek_ai_dsh_client_ui_primitives.relativeTime)(updatedAt, now);
|
|
10055
10266
|
return unit === "now" ? t("time.now") : t(`time.${unit}`, { n });
|
|
10056
10267
|
}
|
|
10057
10268
|
/** Hover-card variant: distances wrap in the ago template; the now bucket stays bare (no "now ago"). */
|
|
10058
10269
|
function hoverTimeLabel(updatedAt, now, t) {
|
|
10059
|
-
const { unit, n } = relativeTime(updatedAt, now);
|
|
10270
|
+
const { unit, n } = (0, _deepseek_ai_dsh_client_ui_primitives.relativeTime)(updatedAt, now);
|
|
10060
10271
|
return unit === "now" ? t("time.now") : t("time.ago", { t: t(`time.${unit}`, { n }) });
|
|
10061
10272
|
}
|
|
10062
10273
|
/**
|
|
@@ -10165,7 +10376,7 @@ const official = ((require$1) => {
|
|
|
10165
10376
|
items: workspaceMenuItems,
|
|
10166
10377
|
onSelect: (id) => {
|
|
10167
10378
|
setMenuOpen(false);
|
|
10168
|
-
/* v8 ignore next --
|
|
10379
|
+
/* v8 ignore next -- Menu can emit only the rename and delete rows supplied above. */
|
|
10169
10380
|
if (id !== "rename" && id !== "delete") return;
|
|
10170
10381
|
if (id === "rename") actions.rename();
|
|
10171
10382
|
else actions.delete();
|
|
@@ -10200,7 +10411,7 @@ const official = ((require$1) => {
|
|
|
10200
10411
|
anchor: ownRow,
|
|
10201
10412
|
content: (0, react_jsx_runtime$1.jsx)(WorkspaceHoverContent, {
|
|
10202
10413
|
label: row.label,
|
|
10203
|
-
cwd: row.cwd === void 0 ? void 0 :
|
|
10414
|
+
cwd: row.cwd === void 0 ? void 0 : abbreviateHomePath(row.cwd, home),
|
|
10204
10415
|
createdAt: row.createdAt,
|
|
10205
10416
|
t
|
|
10206
10417
|
}),
|
|
@@ -10271,6 +10482,17 @@ const official = ((require$1) => {
|
|
|
10271
10482
|
children: status.label
|
|
10272
10483
|
}, status.label))] });
|
|
10273
10484
|
}
|
|
10485
|
+
/** Non-interactive active-Schedule marker; the enclosing row remains the only action. */
|
|
10486
|
+
function ActiveScheduleIndicator({ t, search = false }) {
|
|
10487
|
+
const label = t("schedule.active");
|
|
10488
|
+
return (0, react_jsx_runtime$1.jsx)("span", {
|
|
10489
|
+
className: clsx(Rows_module_css_default.scheduleIndicator, search && Rows_module_css_default.searchScheduleIndicator),
|
|
10490
|
+
role: "img",
|
|
10491
|
+
"aria-label": label,
|
|
10492
|
+
title: label,
|
|
10493
|
+
children: (0, react_jsx_runtime$1.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconAlarmClockOutline16, {})
|
|
10494
|
+
});
|
|
10495
|
+
}
|
|
10274
10496
|
function managedWorktreeDecoration(node, t) {
|
|
10275
10497
|
const value = node.__dshGitWorktree;
|
|
10276
10498
|
if (value?.kind !== "managed-worktree" || typeof value.state !== "string") return void 0;
|
|
@@ -10358,13 +10580,17 @@ const official = ((require$1) => {
|
|
|
10358
10580
|
(0, react_jsx_runtime$1.jsx)("span", {
|
|
10359
10581
|
className: Rows_module_css_default.searchResultTitle,
|
|
10360
10582
|
children: result.title
|
|
10583
|
+
}),
|
|
10584
|
+
result.hasActiveSchedule && (0, react_jsx_runtime$1.jsx)(ActiveScheduleIndicator, {
|
|
10585
|
+
t,
|
|
10586
|
+
search: true
|
|
10361
10587
|
})
|
|
10362
10588
|
]
|
|
10363
10589
|
}), (0, react_jsx_runtime$1.jsxs)("span", {
|
|
10364
10590
|
className: Rows_module_css_default.searchResultMeta,
|
|
10365
10591
|
children: [(0, react_jsx_runtime$1.jsx)("span", {
|
|
10366
10592
|
className: Rows_module_css_default.searchResultWorkspace,
|
|
10367
|
-
children: result.workspace
|
|
10593
|
+
children: result.workspace || t("group.ungrouped")
|
|
10368
10594
|
}), result.snippet !== void 0 && (0, react_jsx_runtime$1.jsx)("span", {
|
|
10369
10595
|
className: Rows_module_css_default.searchResultSnippet,
|
|
10370
10596
|
children: result.snippet
|
|
@@ -10453,6 +10679,7 @@ const official = ((require$1) => {
|
|
|
10453
10679
|
className: Rows_module_css_default.title,
|
|
10454
10680
|
children: title
|
|
10455
10681
|
}),
|
|
10682
|
+
row.hasActiveSchedule && (0, react_jsx_runtime$1.jsx)(ActiveScheduleIndicator, { t }),
|
|
10456
10683
|
!row.blank && (0, react_jsx_runtime$1.jsx)("span", {
|
|
10457
10684
|
className: Rows_module_css_default.time,
|
|
10458
10685
|
children: timeLabel(row.updatedAt, now, t)
|
|
@@ -10664,7 +10891,7 @@ const official = ((require$1) => {
|
|
|
10664
10891
|
onClose
|
|
10665
10892
|
});
|
|
10666
10893
|
}
|
|
10667
|
-
const css = ".
|
|
10894
|
+
const css = ".bhn1Oq_root{--dsh-session-list-edge-inset:var(--dsh-sidebar-inline-padding);--dsh-session-list-scrollbar-width:8px;--dsh-session-list-scrollbar-offset:2px;box-sizing:border-box;min-height:0;padding-right:var(--dsh-session-list-edge-inset);flex-direction:column;flex:1;display:flex}.bhn1Oq_root.bhn1Oq_rail{padding-right:0}.bhn1Oq_iconButton{corner-shape:round;cursor:pointer;width:28px;height:28px;color:var(--dsw-alias-label-secondary);background:0 0;border:none;border-radius:50%;flex:none;justify-content:center;align-items:center;padding:0;display:inline-flex}.bhn1Oq_iconButton:hover{background:var(--dsw-alias-interactive-bg-hover)}.bhn1Oq_sectionHeader{box-sizing:border-box;height:36px;color:var(--dsw-alias-label-tertiary);border-radius:12px;flex:none;justify-content:flex-end;align-items:center;gap:4px;margin-bottom:4px;padding-left:4px;display:flex;overflow:hidden}.bhn1Oq_root:not(.bhn1Oq_rail) .bhn1Oq_sectionHeader{margin-top:2px;margin-right:-4px}.bhn1Oq_sectionLabel{white-space:nowrap;opacity:1;visibility:visible;min-width:0;max-width:45%;transition:max-width .18s var(--ds-ease-in-out), margin-right .18s var(--ds-ease-in-out), opacity .12s var(--ds-ease-in-out), transform .18s var(--ds-ease-in-out), visibility 0s linear;flex:none;line-height:20px;overflow:hidden}.bhn1Oq_sectionLabelHidden{opacity:0;visibility:hidden;max-width:0;margin-right:-4px;transition-delay:0s,0s,0s,0s,.18s;transform:translate(-4px)}.bhn1Oq_searchSlot{box-sizing:border-box;min-width:0;max-width:28px;transition:max-width .18s var(--ds-ease-in-out), padding-left .18s var(--ds-ease-in-out);flex:1;align-items:center;margin-left:auto;padding-left:0;display:flex}.bhn1Oq_searchSlotExpanded{max-width:100%;padding-left:0}.bhn1Oq_headerActions{opacity:1;visibility:visible;max-width:60px;transition:max-width .18s var(--ds-ease-in-out), opacity .12s var(--ds-ease-in-out), transform .18s var(--ds-ease-in-out), visibility 0s linear;flex:none;align-items:center;gap:4px;display:flex;overflow:hidden}.bhn1Oq_headerActionsHidden{opacity:0;visibility:hidden;pointer-events:none;max-width:0;transition-delay:0s,0s,0s,.18s;transform:translate(4px)}.bhn1Oq_search{box-sizing:border-box;corner-shape:round;cursor:text;width:100%;height:28px;color:var(--dsw-alias-label-secondary);transition:width .18s var(--ds-ease-in-out), padding .18s var(--ds-ease-in-out), border-color .18s var(--ds-ease-in-out), background-color .18s var(--ds-ease-in-out);background:0 0;border:none;border-radius:50%;flex:none;align-items:center;gap:0;margin:0;padding:0;display:flex;overflow:hidden}.bhn1Oq_searchExpanded{border:.5px solid var(--dsw-alias-border-l4);width:calc(100% + 4px);height:30px;color:var(--dsw-alias-label-caption);background:0 0;border-radius:10px;margin-inline:-2px;padding:0 4px 0 0}.bhn1Oq_searchButton{corner-shape:round;cursor:pointer;width:28px;height:28px;color:inherit;background:0 0;border:none;border-radius:50%;flex:none;justify-content:center;align-items:center;padding:0;display:inline-flex}.bhn1Oq_searchExpanded .bhn1Oq_searchButton{width:28px;height:30px}.bhn1Oq_searchButton:hover{background:var(--dsw-alias-interactive-bg-hover)}.bhn1Oq_searchExpanded .bhn1Oq_searchButton:hover{background:0 0}.bhn1Oq_searchInput{opacity:0;pointer-events:none;width:0;min-width:0;color:var(--dsw-alias-label-primary);transition:opacity .12s var(--ds-ease-in-out);background:0 0;border:none;outline:none;flex:1;font-size:13px;line-height:18px}.bhn1Oq_searchExpanded .bhn1Oq_searchInput{opacity:1;pointer-events:auto;margin-left:-2px}.bhn1Oq_searchInput::placeholder{color:var(--dsw-alias-label-tertiary)}.bhn1Oq_clearButton{corner-shape:round;cursor:pointer;width:24px;height:24px;color:var(--dsw-alias-label-secondary);background:0 0;border:none;border-radius:50%;flex:none;justify-content:center;align-items:center;padding:0;display:inline-flex}.bhn1Oq_clearButton:hover{background:var(--dsw-alias-interactive-bg-hover)}.bhn1Oq_rail .bhn1Oq_sectionHeader{justify-content:flex-start;gap:0;margin-bottom:12px;padding-left:0}.bhn1Oq_rail .bhn1Oq_headerActions{max-width:none}.bhn1Oq_rail .bhn1Oq_iconButton{width:36px;height:36px;color:var(--dsw-alias-label-primary)}.bhn1Oq_rail .bhn1Oq_search{background:0 0;border-color:#0000;gap:0;width:36px;height:36px;margin:0 0 12px;padding:0}.bhn1Oq_rail .bhn1Oq_searchButton{width:36px;height:36px;color:var(--dsw-alias-label-primary)}.bhn1Oq_rail .bhn1Oq_searchButton:hover{background:var(--dsw-alias-interactive-bg-hover)}.bhn1Oq_listArea{min-height:0;margin-left:-4px;margin-right:calc(-1 * var(--dsh-session-list-edge-inset));flex-direction:column;flex:1;padding-left:4px;display:flex;overflow:visible}.bhn1Oq_rail .bhn1Oq_listArea{margin-left:0;margin-right:0;padding-left:0}.bhn1Oq_treeBody{flex-direction:column;flex:1;min-height:0;display:flex;position:relative}.bhn1Oq_fade{left:0;right:var(--dsh-session-list-edge-inset);background:linear-gradient(to bottom, transparent, var(--dsw-specific-sidebar-fill));pointer-events:none;height:24px;position:absolute;bottom:0}.bhn1Oq_wide{animation:bhn1Oq_wide-in .2s var(--ds-ease-in-out)}@keyframes bhn1Oq_wide-in{0%{opacity:0}}.bhn1Oq_list{min-height:0;margin-left:-4px;margin-right:var(--dsh-session-list-scrollbar-offset);padding-left:4px;padding-right:calc(var(--dsh-session-list-edge-inset) - var(--dsh-session-list-scrollbar-width) - var(--dsh-session-list-scrollbar-offset));scrollbar-gutter:stable;flex:1;padding-bottom:16px;overflow-y:auto}.bhn1Oq_flatList>*+*,.bhn1Oq_searchTree>[role=treeitem]+[role=treeitem],.bhn1Oq_groupSection>*+*{margin-top:2px}.bhn1Oq_searchStatus,.bhn1Oq_searchWarning{color:var(--dsw-alias-label-tertiary);padding:10px 12px;font-size:12px;line-height:18px}.bhn1Oq_searchWarning{color:var(--dsw-alias-label-secondary)}.bhn1Oq_groupSection{position:relative}.bhn1Oq_groupSection+.bhn1Oq_groupSection{margin-top:4px}.bhn1Oq_listTopDropIndicator,.bhn1Oq_workspaceDropBefore:before,.bhn1Oq_workspaceDropAfter:after{content:\"\";z-index:1;background:linear-gradient(55deg, transparent calc(50% - 1px), var(--dsw-alias-state-business-primary) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)) 0 0 / 5px 7px no-repeat, linear-gradient(125deg, transparent calc(50% - 1px), var(--dsw-alias-state-business-primary) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)) 0 5px / 5px 7px no-repeat, linear-gradient(var(--dsw-alias-state-business-primary) 0 0) 4px 5px / calc(100% - 4px) 2px no-repeat;pointer-events:none;height:12px;position:absolute;left:0;right:0}.bhn1Oq_listTopDropIndicator{top:-8px;left:0;right:var(--dsh-session-list-edge-inset)}.bhn1Oq_listTopDropActive>.bhn1Oq_workspaceDropBefore:first-child:before{display:none}.bhn1Oq_workspaceDropBefore:before{top:-8px}.bhn1Oq_workspaceDropAfter:after{bottom:-8px}.bhn1Oq_sessionOverflowButton{cursor:pointer;text-align:left;width:100%;height:28px;color:var(--dsw-alias-label-tertiary);background:0 0;border:none;border-radius:8px;padding:0 12px 0 28px;font-size:12px}.bhn1Oq_groupSection>.bhn1Oq_sessionOverflowButton{margin-top:0}.bhn1Oq_sessionOverflowButton:hover{color:var(--dsw-alias-label-secondary);background:0 0}.bhn1Oq_empty{color:var(--dsw-alias-label-tertiary);padding:16px 12px;font-size:13px}.bhn1Oq_renameInput{box-sizing:border-box;border:.5px solid var(--dsw-alias-border-l4);width:100%;height:44px;color:var(--dsw-alias-label-primary);background:0 0;border-radius:22px;outline:none;padding:7px 14px;font-size:14px;font-weight:400;line-height:22px}.bhn1Oq_renameInput:disabled{color:var(--dsw-alias-label-dimmed)}.bhn1Oq_renameError{color:var(--dsw-alias-state-error-primary);margin-top:8px;font-size:12px;line-height:18px}.bhn1Oq_deleteAction:not(:disabled){color:var(--dsw-alias-state-error-primary)}.bhn1Oq_deleteStatus{color:var(--dsw-alias-label-secondary);font-size:12px;line-height:18px}@media (prefers-reduced-motion:reduce){.bhn1Oq_wide{animation:none}.bhn1Oq_search,.bhn1Oq_sectionLabel,.bhn1Oq_searchSlot,.bhn1Oq_searchInput,.bhn1Oq_headerActions{transition:none}}";
|
|
10668
10895
|
const tagId = "@deepseek-ai/dsh-client-ui-workspace/WorkspaceBrowser.module.css";
|
|
10669
10896
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
|
|
10670
10897
|
const tag = document.createElement("style");
|
|
@@ -10674,42 +10901,42 @@ const official = ((require$1) => {
|
|
|
10674
10901
|
document.head.appendChild(tag);
|
|
10675
10902
|
}
|
|
10676
10903
|
var WorkspaceBrowser_module_css_default = {
|
|
10677
|
-
"clearButton": "
|
|
10678
|
-
"deleteAction": "
|
|
10679
|
-
"deleteStatus": "
|
|
10680
|
-
"empty": "
|
|
10681
|
-
"fade": "
|
|
10682
|
-
"flatList": "
|
|
10683
|
-
"groupSection": "
|
|
10684
|
-
"headerActions": "
|
|
10685
|
-
"headerActionsHidden": "
|
|
10686
|
-
"iconButton": "
|
|
10687
|
-
"list": "
|
|
10688
|
-
"listArea": "
|
|
10689
|
-
"listTopDropActive": "
|
|
10690
|
-
"listTopDropIndicator": "
|
|
10691
|
-
"rail": "
|
|
10692
|
-
"renameError": "
|
|
10693
|
-
"renameInput": "
|
|
10694
|
-
"root": "
|
|
10695
|
-
"search": "
|
|
10696
|
-
"searchButton": "
|
|
10697
|
-
"searchExpanded": "
|
|
10698
|
-
"searchInput": "
|
|
10699
|
-
"searchSlot": "
|
|
10700
|
-
"searchSlotExpanded": "
|
|
10701
|
-
"searchStatus": "
|
|
10702
|
-
"searchTree": "
|
|
10703
|
-
"searchWarning": "
|
|
10704
|
-
"sectionHeader": "
|
|
10705
|
-
"sectionLabel": "
|
|
10706
|
-
"sectionLabelHidden": "
|
|
10707
|
-
"sessionOverflowButton": "
|
|
10708
|
-
"treeBody": "
|
|
10709
|
-
"wide": "
|
|
10710
|
-
"wide-in": "
|
|
10711
|
-
"workspaceDropAfter": "
|
|
10712
|
-
"workspaceDropBefore": "
|
|
10904
|
+
"clearButton": "bhn1Oq_clearButton",
|
|
10905
|
+
"deleteAction": "bhn1Oq_deleteAction",
|
|
10906
|
+
"deleteStatus": "bhn1Oq_deleteStatus",
|
|
10907
|
+
"empty": "bhn1Oq_empty",
|
|
10908
|
+
"fade": "bhn1Oq_fade",
|
|
10909
|
+
"flatList": "bhn1Oq_flatList",
|
|
10910
|
+
"groupSection": "bhn1Oq_groupSection",
|
|
10911
|
+
"headerActions": "bhn1Oq_headerActions",
|
|
10912
|
+
"headerActionsHidden": "bhn1Oq_headerActionsHidden",
|
|
10913
|
+
"iconButton": "bhn1Oq_iconButton",
|
|
10914
|
+
"list": "bhn1Oq_list",
|
|
10915
|
+
"listArea": "bhn1Oq_listArea",
|
|
10916
|
+
"listTopDropActive": "bhn1Oq_listTopDropActive",
|
|
10917
|
+
"listTopDropIndicator": "bhn1Oq_listTopDropIndicator",
|
|
10918
|
+
"rail": "bhn1Oq_rail",
|
|
10919
|
+
"renameError": "bhn1Oq_renameError",
|
|
10920
|
+
"renameInput": "bhn1Oq_renameInput",
|
|
10921
|
+
"root": "bhn1Oq_root",
|
|
10922
|
+
"search": "bhn1Oq_search",
|
|
10923
|
+
"searchButton": "bhn1Oq_searchButton",
|
|
10924
|
+
"searchExpanded": "bhn1Oq_searchExpanded",
|
|
10925
|
+
"searchInput": "bhn1Oq_searchInput",
|
|
10926
|
+
"searchSlot": "bhn1Oq_searchSlot",
|
|
10927
|
+
"searchSlotExpanded": "bhn1Oq_searchSlotExpanded",
|
|
10928
|
+
"searchStatus": "bhn1Oq_searchStatus",
|
|
10929
|
+
"searchTree": "bhn1Oq_searchTree",
|
|
10930
|
+
"searchWarning": "bhn1Oq_searchWarning",
|
|
10931
|
+
"sectionHeader": "bhn1Oq_sectionHeader",
|
|
10932
|
+
"sectionLabel": "bhn1Oq_sectionLabel",
|
|
10933
|
+
"sectionLabelHidden": "bhn1Oq_sectionLabelHidden",
|
|
10934
|
+
"sessionOverflowButton": "bhn1Oq_sessionOverflowButton",
|
|
10935
|
+
"treeBody": "bhn1Oq_treeBody",
|
|
10936
|
+
"wide": "bhn1Oq_wide",
|
|
10937
|
+
"wide-in": "bhn1Oq_wide-in",
|
|
10938
|
+
"workspaceDropAfter": "bhn1Oq_workspaceDropAfter",
|
|
10939
|
+
"workspaceDropBefore": "bhn1Oq_workspaceDropBefore"
|
|
10713
10940
|
};
|
|
10714
10941
|
/**
|
|
10715
10942
|
* The workspace/session browsing region filling the sidebar shell's
|
|
@@ -10733,6 +10960,20 @@ const official = ((require$1) => {
|
|
|
10733
10960
|
const SEARCH_QUERY_MAX_CODE_UNITS = 500;
|
|
10734
10961
|
/** Session rows visible per Workspace before the local overflow control. */
|
|
10735
10962
|
const COLLAPSED_SESSION_LIMIT = 5;
|
|
10963
|
+
/** Fold one Workspace without charging its provisional New Session against the ordinary-row limit. */
|
|
10964
|
+
function collapsedSessionRows(sessions) {
|
|
10965
|
+
let ordinaryCount = 0;
|
|
10966
|
+
const rows = sessions.filter((session) => {
|
|
10967
|
+
if (session.blank) return true;
|
|
10968
|
+
if (ordinaryCount >= COLLAPSED_SESSION_LIMIT) return false;
|
|
10969
|
+
ordinaryCount += 1;
|
|
10970
|
+
return true;
|
|
10971
|
+
});
|
|
10972
|
+
return {
|
|
10973
|
+
rows,
|
|
10974
|
+
hiddenCount: sessions.length - rows.length
|
|
10975
|
+
};
|
|
10976
|
+
}
|
|
10736
10977
|
/** Keep controlled input and RPC payload inside the session.search wire contract. */
|
|
10737
10978
|
function sanitizeSearchQuery(value) {
|
|
10738
10979
|
const withoutNul = value.replaceAll("\0", "");
|
|
@@ -10893,8 +11134,9 @@ const official = ((require$1) => {
|
|
|
10893
11134
|
return e.clientY < rect.top + rect.height / 2 ? "before" : "after";
|
|
10894
11135
|
}
|
|
10895
11136
|
/** The scrolling session tree; unmounting drops the sessions subscription and expand-all state. */
|
|
10896
|
-
function SessionTree({ useSessions, startSession, open, forkSession, workspaces, archivedSessionIds, onRenameRequest, onDeleteRequest, onSessionRename, onSessionArchive, insertWorkspaceBefore, insertSessionBefore, orderBy, groupExpansion, setGroupExpanded, sessionOrderByAccount, sessionUpdatedAtByAccount, syncSessionOrderAccount, setSessionOrder, home, t }) {
|
|
11137
|
+
function SessionTree({ useSessions, useSessionPendingInteraction, startSession, open, forkSession, workspaces, archivedSessionIds, onRenameRequest, onDeleteRequest, onSessionRename, onSessionArchive, insertWorkspaceBefore, insertSessionBefore, orderBy, groupExpansion, setGroupExpanded, sessionOrderByAccount, sessionUpdatedAtByAccount, syncSessionOrderAccount, setSessionOrder, home, t }) {
|
|
10897
11138
|
const list = useSessions((s) => s);
|
|
11139
|
+
const pendingInteractions = useSessionPendingInteraction((s) => s);
|
|
10898
11140
|
const current = list.current;
|
|
10899
11141
|
const [expandedSessionGroups, setExpandedSessionGroups] = (0, react$1.useState)([]);
|
|
10900
11142
|
const [drag, setDrag] = (0, react$1.useState)(null);
|
|
@@ -10961,13 +11203,14 @@ const official = ((require$1) => {
|
|
|
10961
11203
|
});
|
|
10962
11204
|
}, [sessionOrderByAccount, workspaces]);
|
|
10963
11205
|
const orderedUngroupedSessionIds = (0, react$1.useMemo)(() => reconciledSessionOrder(ungroupedSessionIds, sessionOrderByAccount[""]), [sessionOrderByAccount, ungroupedSessionIds]);
|
|
10964
|
-
const groups = (0, react$1.useMemo)(() => deriveGroups(list, orderedWorkspaces, archivedSessionIds, {
|
|
11206
|
+
const groups = (0, react$1.useMemo)(() => deriveGroups(list, orderedWorkspaces, archivedSessionIds, pendingInteractions, {
|
|
10965
11207
|
expandedGroups,
|
|
10966
11208
|
...sessionOrderByAccount[""] === void 0 ? {} : { ungroupedOrder: sessionOrderByAccount[""] }
|
|
10967
11209
|
}), [
|
|
10968
11210
|
list,
|
|
10969
11211
|
orderedWorkspaces,
|
|
10970
11212
|
archivedSessionIds,
|
|
11213
|
+
pendingInteractions,
|
|
10971
11214
|
expandedGroups,
|
|
10972
11215
|
sessionOrderByAccount
|
|
10973
11216
|
]);
|
|
@@ -10978,18 +11221,40 @@ const official = ((require$1) => {
|
|
|
10978
11221
|
setDrag(null);
|
|
10979
11222
|
const group = groups.find((candidate) => candidate.key === activeDrag.accountKey);
|
|
10980
11223
|
if (group === void 0) return;
|
|
10981
|
-
const
|
|
11224
|
+
const sessionsExpanded = expandedSessionGroups.includes(group.key);
|
|
11225
|
+
const renderedSessions = sessionsExpanded ? group.sessions : collapsedSessionRows(group.sessions).rows;
|
|
11226
|
+
const targetIndex = renderedSessions.findIndex((session) => session.id === over.id);
|
|
10982
11227
|
if (targetIndex === -1) return;
|
|
10983
|
-
const
|
|
10984
|
-
if (
|
|
10985
|
-
const
|
|
10986
|
-
const
|
|
10987
|
-
if (
|
|
11228
|
+
const sourceIndex = renderedSessions.findIndex((session) => session.id === activeDrag.sessionId);
|
|
11229
|
+
if (over.id === activeDrag.sessionId) return;
|
|
11230
|
+
const withoutSource = renderedSessions.filter((session) => session.id !== activeDrag.sessionId);
|
|
11231
|
+
const targetWithoutSourceIndex = withoutSource.findIndex((session) => session.id === over.id);
|
|
11232
|
+
if (targetWithoutSourceIndex === -1) return;
|
|
11233
|
+
const visibleInsertAt = over.half === "before" ? targetWithoutSourceIndex : targetWithoutSourceIndex + 1;
|
|
11234
|
+
if (sourceIndex !== -1 && visibleInsertAt === sourceIndex) return;
|
|
10988
11235
|
const accountSessionIds = activeDrag.accountKey === "" ? orderedUngroupedSessionIds : orderedWorkspaces.find((workspace) => workspace.workspaceId === activeDrag.accountKey)?.sessionIds;
|
|
10989
11236
|
if (accountSessionIds === void 0) return;
|
|
10990
11237
|
const nextOrder = accountSessionIds.filter((id) => id !== activeDrag.sessionId);
|
|
11238
|
+
let anchor;
|
|
11239
|
+
if (sessionsExpanded) anchor = over.half === "before" ? over.id : renderedSessions[targetIndex + 1]?.id;
|
|
11240
|
+
else {
|
|
11241
|
+
const previousVisible = withoutSource[visibleInsertAt - 1]?.id;
|
|
11242
|
+
if (previousVisible === void 0) anchor = nextOrder[0];
|
|
11243
|
+
else {
|
|
11244
|
+
const previousIndex = nextOrder.indexOf(previousVisible);
|
|
11245
|
+
if (previousIndex === -1) return;
|
|
11246
|
+
anchor = nextOrder[previousIndex + 1];
|
|
11247
|
+
}
|
|
11248
|
+
}
|
|
10991
11249
|
const insertAt = anchor === void 0 ? nextOrder.length : nextOrder.indexOf(anchor);
|
|
10992
11250
|
nextOrder.splice(insertAt === -1 ? nextOrder.length : insertAt, 0, activeDrag.sessionId);
|
|
11251
|
+
if (!sessionsExpanded && sourceIndex !== -1) {
|
|
11252
|
+
const nodes = new Map(group.sessions.map((node) => [node.id, node]));
|
|
11253
|
+
if (!collapsedSessionRows(nextOrder.flatMap((id) => {
|
|
11254
|
+
const node = nodes.get(id);
|
|
11255
|
+
return node === void 0 ? [] : [node];
|
|
11256
|
+
})).rows.some((node) => node.id === activeDrag.sessionId)) return;
|
|
11257
|
+
}
|
|
10993
11258
|
setSessionOrder(activeDrag.accountKey, nextOrder.map((id) => id));
|
|
10994
11259
|
if (orderBy === "updated" || activeDrag.accountKey === "") return;
|
|
10995
11260
|
insertSessionBefore(activeDrag.accountKey, activeDrag.sessionId, anchor).catch((reason) => {
|
|
@@ -11028,6 +11293,8 @@ const official = ((require$1) => {
|
|
|
11028
11293
|
children: t("empty.none")
|
|
11029
11294
|
}), groups.map((group) => {
|
|
11030
11295
|
const workspaceId = group.workspaceId;
|
|
11296
|
+
const collapsed = collapsedSessionRows(group.sessions);
|
|
11297
|
+
const sessionsExpanded = expandedSessionGroups.includes(group.key);
|
|
11031
11298
|
const workspaceMarker = workspaceId !== void 0 && workspaceDrag?.over?.id === workspaceId ? workspaceDrag.over.half : null;
|
|
11032
11299
|
const workspaceDragProps = workspaceId === void 0 ? void 0 : {
|
|
11033
11300
|
start: () => {
|
|
@@ -11097,7 +11364,7 @@ const official = ((require$1) => {
|
|
|
11097
11364
|
}
|
|
11098
11365
|
}
|
|
11099
11366
|
}),
|
|
11100
|
-
(
|
|
11367
|
+
(sessionsExpanded ? group.sessions : collapsed.rows).map((node) => {
|
|
11101
11368
|
const sameGroupDrag = drag !== null && drag.accountKey === group.key;
|
|
11102
11369
|
return (0, react_jsx_runtime$1.jsx)(SessionNodeItem, {
|
|
11103
11370
|
node,
|
|
@@ -11145,14 +11412,14 @@ const official = ((require$1) => {
|
|
|
11145
11412
|
t
|
|
11146
11413
|
}, node.id);
|
|
11147
11414
|
}),
|
|
11148
|
-
|
|
11415
|
+
collapsed.hiddenCount > 0 && (0, react_jsx_runtime$1.jsx)("button", {
|
|
11149
11416
|
type: "button",
|
|
11150
11417
|
className: WorkspaceBrowser_module_css_default.sessionOverflowButton,
|
|
11151
|
-
"aria-expanded":
|
|
11418
|
+
"aria-expanded": sessionsExpanded,
|
|
11152
11419
|
onClick: () => {
|
|
11153
11420
|
setExpandedSessionGroups((keys) => toggled(keys, group.key));
|
|
11154
11421
|
},
|
|
11155
|
-
children:
|
|
11422
|
+
children: sessionsExpanded ? t("sessions.collapse") : t("sessions.expand", { n: collapsed.hiddenCount })
|
|
11156
11423
|
})
|
|
11157
11424
|
]
|
|
11158
11425
|
}, group.key);
|
|
@@ -11163,9 +11430,14 @@ const official = ((require$1) => {
|
|
|
11163
11430
|
});
|
|
11164
11431
|
}
|
|
11165
11432
|
/** The flat "In one list" body: every session is one draggable top-level row. */
|
|
11166
|
-
function FlatList({ useSessions, open, forkSession, onSessionRename, onSessionArchive, archivedSessionIds, orderBy, sessionOrderByAccount, sessionUpdatedAtByAccount, syncSessionOrderAccount, setSessionOrder, t }) {
|
|
11433
|
+
function FlatList({ useSessions, useSessionPendingInteraction, open, forkSession, onSessionRename, onSessionArchive, archivedSessionIds, orderBy, sessionOrderByAccount, sessionUpdatedAtByAccount, syncSessionOrderAccount, setSessionOrder, t }) {
|
|
11167
11434
|
const list = useSessions((s) => s);
|
|
11168
|
-
const
|
|
11435
|
+
const pendingInteractions = useSessionPendingInteraction((s) => s);
|
|
11436
|
+
const baseRows = (0, react$1.useMemo)(() => deriveFlat(list, archivedSessionIds, pendingInteractions), [
|
|
11437
|
+
list,
|
|
11438
|
+
archivedSessionIds,
|
|
11439
|
+
pendingInteractions
|
|
11440
|
+
]);
|
|
11169
11441
|
const sessionIds = (0, react$1.useMemo)(() => baseRows.map((row) => row.id), [baseRows]);
|
|
11170
11442
|
const previousOrderBy = (0, react$1.useRef)(orderBy);
|
|
11171
11443
|
(0, react$1.useEffect)(() => {
|
|
@@ -11281,19 +11553,21 @@ const official = ((require$1) => {
|
|
|
11281
11553
|
});
|
|
11282
11554
|
}
|
|
11283
11555
|
/** Flat search body: local metadata matches plus the current Host result page. */
|
|
11284
|
-
function SearchResults({ useSessions, open, workspaces, archivedSessionIds, query, remote, resultLimit, t }) {
|
|
11556
|
+
function SearchResults({ useSessions, useSessionPendingInteraction, open, workspaces, archivedSessionIds, query, remote, resultLimit, t }) {
|
|
11285
11557
|
const list = useSessions((s) => s);
|
|
11558
|
+
const pendingInteractions = useSessionPendingInteraction((s) => s);
|
|
11286
11559
|
const currentRemote = remote.query === query ? remote : {
|
|
11287
11560
|
query,
|
|
11288
11561
|
status: "loading",
|
|
11289
11562
|
items: [],
|
|
11290
11563
|
hasMore: false
|
|
11291
11564
|
};
|
|
11292
|
-
const results = (0, react$1.useMemo)(() => deriveSearchResults(list, workspaces, query, archivedSessionIds, currentRemote, resultLimit), [
|
|
11565
|
+
const results = (0, react$1.useMemo)(() => deriveSearchResults(list, workspaces, query, archivedSessionIds, pendingInteractions, currentRemote, resultLimit), [
|
|
11293
11566
|
list,
|
|
11294
11567
|
workspaces,
|
|
11295
11568
|
query,
|
|
11296
11569
|
archivedSessionIds,
|
|
11570
|
+
pendingInteractions,
|
|
11297
11571
|
currentRemote,
|
|
11298
11572
|
resultLimit
|
|
11299
11573
|
]);
|
|
@@ -11342,8 +11616,8 @@ const official = ((require$1) => {
|
|
|
11342
11616
|
* @param props - composed slot props (shell owner share + store + injected actions).
|
|
11343
11617
|
* @returns the region element tree.
|
|
11344
11618
|
*/
|
|
11345
|
-
function WorkspaceBrowser({ wide, expandSidebar, useSessions, useWorkspaces, useStore, actions, startSession, open, renameSession, forkSession, renameWorkspace, deleteWorkspace, insertWorkspaceBefore, archiveSession, insertSessionBefore, createWorkspace, searchSessions, searchResultLimit, useDirectoryFlow,
|
|
11346
|
-
const home =
|
|
11619
|
+
function WorkspaceBrowser({ wide, expandSidebar, useSessions, useSessionPendingInteraction, useWorkspaces, useStore, actions, startSession, open, renameSession, forkSession, renameWorkspace, deleteWorkspace, insertWorkspaceBefore, archiveSession, insertSessionBefore, createWorkspace, searchSessions, searchResultLimit, useDirectoryFlow, useHostInfo, renderSlot, t }) {
|
|
11620
|
+
const home = useHostInfo((info) => info.home);
|
|
11347
11621
|
const workspaces = useWorkspaces((state) => state.items);
|
|
11348
11622
|
const workspacePhase = useWorkspaces((state) => state.phase);
|
|
11349
11623
|
const archivedSessionIds = useWorkspaces((state) => state.archivedSessionIds);
|
|
@@ -11364,7 +11638,8 @@ const official = ((require$1) => {
|
|
|
11364
11638
|
promotedBlank.current = void 0;
|
|
11365
11639
|
return;
|
|
11366
11640
|
}
|
|
11367
|
-
|
|
11641
|
+
const promoted = promotedBlank.current;
|
|
11642
|
+
if (promoted !== void 0 && promoted.sessionId === currentBlankSessionId && promoted.accountKey === currentBlankAccount) return;
|
|
11368
11643
|
promotedBlank.current = {
|
|
11369
11644
|
sessionId: currentBlankSessionId,
|
|
11370
11645
|
accountKey: currentBlankAccount
|
|
@@ -11710,6 +11985,7 @@ const official = ((require$1) => {
|
|
|
11710
11985
|
className: WorkspaceBrowser_module_css_default.listArea,
|
|
11711
11986
|
children: wide && (normalizedQuery !== "" ? (0, react_jsx_runtime$1.jsx)(SearchResults, {
|
|
11712
11987
|
useSessions,
|
|
11988
|
+
useSessionPendingInteraction,
|
|
11713
11989
|
open,
|
|
11714
11990
|
workspaces,
|
|
11715
11991
|
archivedSessionIds,
|
|
@@ -11719,6 +11995,7 @@ const official = ((require$1) => {
|
|
|
11719
11995
|
t
|
|
11720
11996
|
}) : groupBy === "flat" ? (0, react_jsx_runtime$1.jsx)(FlatList, {
|
|
11721
11997
|
useSessions,
|
|
11998
|
+
useSessionPendingInteraction,
|
|
11722
11999
|
open,
|
|
11723
12000
|
forkSession,
|
|
11724
12001
|
onSessionRename,
|
|
@@ -11732,6 +12009,7 @@ const official = ((require$1) => {
|
|
|
11732
12009
|
t
|
|
11733
12010
|
}) : (0, react_jsx_runtime$1.jsx)(SessionTree, {
|
|
11734
12011
|
useSessions,
|
|
12012
|
+
useSessionPendingInteraction,
|
|
11735
12013
|
onSessionRename,
|
|
11736
12014
|
onSessionArchive,
|
|
11737
12015
|
forkSession,
|
|
@@ -11967,6 +12245,7 @@ const official = ((require$1) => {
|
|
|
11967
12245
|
"status.planReview": "计划待审",
|
|
11968
12246
|
"status.waitingAnswer": "等待回答",
|
|
11969
12247
|
"status.completed": "已完成",
|
|
12248
|
+
"schedule.active": "有活动定时任务",
|
|
11970
12249
|
"hover.created": "创建于 {time}",
|
|
11971
12250
|
"hover.copied": "已复制",
|
|
11972
12251
|
"date.ymd": "{y}年{m}月{d}日",
|
|
@@ -12040,6 +12319,7 @@ const official = ((require$1) => {
|
|
|
12040
12319
|
"status.planReview": "Plan awaiting review",
|
|
12041
12320
|
"status.waitingAnswer": "Waiting for answer",
|
|
12042
12321
|
"status.completed": "Completed",
|
|
12322
|
+
"schedule.active": "Has active scheduled task",
|
|
12043
12323
|
"hover.created": "Created {time}",
|
|
12044
12324
|
"hover.copied": "Copied",
|
|
12045
12325
|
"date.ymd": "{y}-{m}-{d}",
|
|
@@ -12066,7 +12346,8 @@ const official = ((require$1) => {
|
|
|
12066
12346
|
"sessions",
|
|
12067
12347
|
"workspaces",
|
|
12068
12348
|
"locale",
|
|
12069
|
-
"
|
|
12349
|
+
"remote",
|
|
12350
|
+
"remote.directoryPicker"
|
|
12070
12351
|
];
|
|
12071
12352
|
/**
|
|
12072
12353
|
* Register the browser and picker once their slot declarations are on the
|
|
@@ -12075,13 +12356,16 @@ const official = ((require$1) => {
|
|
|
12075
12356
|
* @param ctx - client root context.
|
|
12076
12357
|
*/
|
|
12077
12358
|
function apply$3(ctx) {
|
|
12078
|
-
const
|
|
12359
|
+
const sessions = ctx.get("sessions");
|
|
12360
|
+
const workspaces = ctx.get("workspaces");
|
|
12361
|
+
const uiWorkspace = new UiWorkspaceService(ctx, ctx.remote.directoryPicker, workspaces, sessions);
|
|
12362
|
+
ctx.slots.provideRoot({ hooks: { workspaces: workspaces.list } });
|
|
12079
12363
|
ctx.effect(() => ctx.locale.register(NS, {
|
|
12080
12364
|
zh,
|
|
12081
12365
|
en
|
|
12082
12366
|
}), "ui-workspace: dictionaries");
|
|
12083
12367
|
const searchSessions = async (query, signal) => {
|
|
12084
|
-
const result = await
|
|
12368
|
+
const result = await sessions.search(query, signal);
|
|
12085
12369
|
if (!result.ok) throw new Error(result.error.message);
|
|
12086
12370
|
return result.value;
|
|
12087
12371
|
};
|
|
@@ -12090,53 +12374,57 @@ const official = ((require$1) => {
|
|
|
12090
12374
|
subscribe: (listener) => ctx.slots.subscribe(hole, listener)
|
|
12091
12375
|
});
|
|
12092
12376
|
const browserFlowSource = flowSource("sidebar.workspaces.directoryFlow");
|
|
12377
|
+
const hostInfo = {
|
|
12378
|
+
getSnapshot: () => ctx.remote.$host,
|
|
12379
|
+
subscribe: (listener) => ctx.on("connection/reset", listener)
|
|
12380
|
+
};
|
|
12093
12381
|
const pickerFlowSource = flowSource("conversation.hero.workspace.directoryFlow");
|
|
12094
12382
|
const browserInjected = () => ({
|
|
12095
12383
|
startSession: (workspaceId) => {
|
|
12096
|
-
|
|
12384
|
+
uiWorkspace.startSession(workspaceId);
|
|
12097
12385
|
},
|
|
12098
12386
|
open: (sessionId) => {
|
|
12099
|
-
|
|
12387
|
+
sessions.open(sessionId);
|
|
12100
12388
|
},
|
|
12101
12389
|
searchSessions,
|
|
12102
|
-
searchResultLimit:
|
|
12390
|
+
searchResultLimit: sessions.searchResultLimit,
|
|
12103
12391
|
renameSession: async (sessionId, title) => {
|
|
12104
|
-
const session =
|
|
12392
|
+
const session = sessions.binding(sessionId)?.session;
|
|
12105
12393
|
if (session === void 0) throw new Error(`unknown session "${sessionId}"`);
|
|
12106
12394
|
const result = await session.rename(title);
|
|
12107
12395
|
if (!result.ok) throw new Error(result.error.message);
|
|
12108
12396
|
},
|
|
12109
12397
|
forkSession: (sessionId) => {
|
|
12110
|
-
|
|
12398
|
+
sessions.fork({
|
|
12111
12399
|
sessionId,
|
|
12112
12400
|
increaseTitle: true
|
|
12113
12401
|
}).then((childId) => {
|
|
12114
|
-
|
|
12402
|
+
sessions.open(childId);
|
|
12115
12403
|
}).catch(() => {});
|
|
12116
12404
|
},
|
|
12117
12405
|
renameWorkspace: async (workspaceId, title) => {
|
|
12118
|
-
await
|
|
12406
|
+
await workspaces.rename(workspaceId, title);
|
|
12119
12407
|
},
|
|
12120
12408
|
deleteWorkspace: async (workspaceId) => {
|
|
12121
|
-
await
|
|
12409
|
+
await workspaces.delete(workspaceId);
|
|
12122
12410
|
},
|
|
12123
12411
|
insertWorkspaceBefore: async (workspaceId, beforeWorkspaceId) => {
|
|
12124
|
-
await
|
|
12412
|
+
await workspaces.insertBefore(workspaceId, beforeWorkspaceId);
|
|
12125
12413
|
},
|
|
12126
12414
|
archiveSession: async (sessionId) => {
|
|
12127
|
-
await
|
|
12415
|
+
await uiWorkspace.archiveSession(sessionId);
|
|
12128
12416
|
},
|
|
12129
12417
|
insertSessionBefore: async (workspaceId, sessionId, beforeSessionId) => {
|
|
12130
|
-
await
|
|
12418
|
+
await workspaces.insertSessionBefore(workspaceId, sessionId, beforeSessionId);
|
|
12131
12419
|
},
|
|
12132
|
-
createWorkspace: (input) =>
|
|
12420
|
+
createWorkspace: (input) => workspaces.create(input),
|
|
12133
12421
|
hooks: {
|
|
12134
12422
|
directoryFlow: browserFlowSource,
|
|
12135
|
-
|
|
12423
|
+
hostInfo
|
|
12136
12424
|
}
|
|
12137
12425
|
});
|
|
12138
12426
|
const pickerInjected = () => ({
|
|
12139
|
-
createWorkspace: (input) =>
|
|
12427
|
+
createWorkspace: (input) => workspaces.create(input),
|
|
12140
12428
|
hooks: { directoryFlow: pickerFlowSource }
|
|
12141
12429
|
});
|
|
12142
12430
|
ctx.slots.inject("sidebar.workspaces", () => ctx.slots.register({
|