dsh-sidebar-view 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/client.js ADDED
@@ -0,0 +1,4661 @@
1
+ window.__ModuleLoader__.load({id:"dsh-sidebar-view",factory:require=>{var module={exports:{}};var exports=module.exports;
2
+ ;try{console.info('[dsh-sidebar-view] build 2026-11-18T12:34:38.217Z')}catch(e){}
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __export = (target, all) => {
10
+ for (var name2 in all)
11
+ __defProp(target, name2, { get: all[name2], enumerable: true });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from))
16
+ if (!__hasOwnProp.call(to, key) && key !== except)
17
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
+ }
19
+ return to;
20
+ };
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
+ // If the importer is in node compatibility mode or this is not an ESM
23
+ // file that has been converted to a CommonJS file using a Babel-
24
+ // compatible transform (i.e. "__esModule" has not been set), then set
25
+ // "default" to the CommonJS "module.exports" for node compatibility.
26
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
+ mod
28
+ ));
29
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
+
31
+ // src/client/index.ts
32
+ var index_exports = {};
33
+ __export(index_exports, {
34
+ apply: () => apply,
35
+ inject: () => inject,
36
+ name: () => name
37
+ });
38
+ module.exports = __toCommonJS(index_exports);
39
+
40
+ // src/client/seat.tsx
41
+ var React = __toESM(require("react"), 1);
42
+
43
+ // src/browser/rows/WorkspaceBrowser.tsx
44
+ var import_react4 = require("react");
45
+
46
+ // node_modules/clsx/dist/clsx.mjs
47
+ function r(e) {
48
+ var t, f, n = "";
49
+ if ("string" == typeof e || "number" == typeof e) n += e;
50
+ else if ("object" == typeof e) if (Array.isArray(e)) {
51
+ var o = e.length;
52
+ for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
53
+ } else for (f in e) e[f] && (n && (n += " "), n += f);
54
+ return n;
55
+ }
56
+ function clsx() {
57
+ for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
58
+ return n;
59
+ }
60
+ var clsx_default = clsx;
61
+
62
+ // src/browser/rows/WorkspaceDialogs.tsx
63
+ var import_react = require("react");
64
+ var import_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
65
+
66
+ // src/browser/rows/WorkspaceBrowser.module.css
67
+ var WorkspaceBrowser_default = {
68
+ root: "WorkspaceBrowser_root",
69
+ rail: "WorkspaceBrowser_rail",
70
+ searchExpanded: "WorkspaceBrowser_searchExpanded",
71
+ iconButton: "WorkspaceBrowser_iconButton",
72
+ searchButton: "WorkspaceBrowser_searchButton",
73
+ clearButton: "WorkspaceBrowser_clearButton",
74
+ viewOptionsMenu: "WorkspaceBrowser_viewOptionsMenu",
75
+ sectionHeader: "WorkspaceBrowser_sectionHeader",
76
+ searchSpacingMotion: "WorkspaceBrowser_searchSpacingMotion",
77
+ sectionLabel: "WorkspaceBrowser_sectionLabel",
78
+ sectionLabelHidden: "WorkspaceBrowser_sectionLabelHidden",
79
+ searchSlot: "WorkspaceBrowser_searchSlot",
80
+ searchSlotExpanded: "WorkspaceBrowser_searchSlotExpanded",
81
+ headerActions: "WorkspaceBrowser_headerActions",
82
+ headerActionsHidden: "WorkspaceBrowser_headerActionsHidden",
83
+ search: "WorkspaceBrowser_search",
84
+ searchInput: "WorkspaceBrowser_searchInput",
85
+ statusTabs: "WorkspaceBrowser_statusTabs",
86
+ statusTab: "WorkspaceBrowser_statusTab",
87
+ statusTabActive: "WorkspaceBrowser_statusTabActive",
88
+ statusTabCount: "WorkspaceBrowser_statusTabCount",
89
+ listArea: "WorkspaceBrowser_listArea",
90
+ treeBody: "WorkspaceBrowser_treeBody",
91
+ wide: "WorkspaceBrowser_wide",
92
+ "wide-in": "WorkspaceBrowser_wide-in",
93
+ list: "WorkspaceBrowser_list",
94
+ flatList: "WorkspaceBrowser_flatList",
95
+ searchTree: "WorkspaceBrowser_searchTree",
96
+ groupSection: "WorkspaceBrowser_groupSection",
97
+ searchStatus: "WorkspaceBrowser_searchStatus",
98
+ skeletonRow: "WorkspaceBrowser_skeletonRow",
99
+ skeletonDot: "WorkspaceBrowser_skeletonDot",
100
+ skeletonBars: "WorkspaceBrowser_skeletonBars",
101
+ skeletonBar: "WorkspaceBrowser_skeletonBar",
102
+ "search-skeleton": "WorkspaceBrowser_search-skeleton",
103
+ skeletonBarWide: "WorkspaceBrowser_skeletonBarWide",
104
+ listTopDropIndicator: "WorkspaceBrowser_listTopDropIndicator",
105
+ workspaceDropBefore: "WorkspaceBrowser_workspaceDropBefore",
106
+ workspaceDropAfter: "WorkspaceBrowser_workspaceDropAfter",
107
+ listTopDropActive: "WorkspaceBrowser_listTopDropActive",
108
+ sessionOverflowButton: "WorkspaceBrowser_sessionOverflowButton",
109
+ empty: "WorkspaceBrowser_empty",
110
+ emptyState: "WorkspaceBrowser_emptyState",
111
+ emptyAction: "WorkspaceBrowser_emptyAction",
112
+ renameInput: "WorkspaceBrowser_renameInput",
113
+ renameError: "WorkspaceBrowser_renameError",
114
+ deleteAction: "WorkspaceBrowser_deleteAction",
115
+ deleteStatus: "WorkspaceBrowser_deleteStatus",
116
+ archiveActivity: "WorkspaceBrowser_archiveActivity"
117
+ };
118
+
119
+ // src/browser/rows/WorkspaceDialogs.tsx
120
+ var import_jsx_runtime = require("react/jsx-runtime");
121
+ function WorkspaceDialogs({ request, workspaces, renameWorkspace, deleteWorkspace, settleWorkspaceAction, t }) {
122
+ const composingRef = (0, import_react.useRef)(false);
123
+ const renameTarget = request.action === "rename" ? request : null;
124
+ const [renameDraft, setRenameDraft] = (0, import_react.useState)(request.displayTitle);
125
+ const [renaming, setRenaming] = (0, import_react.useState)(false);
126
+ const [renameError, setRenameError] = (0, import_react.useState)(null);
127
+ const renameTrimmed = renameDraft.trim();
128
+ const renameDuplicate = renameTarget !== null && renameTrimmed !== "" && workspaces.some((w) => w.workspaceId !== renameTarget.workspaceId && w.title === renameTrimmed);
129
+ const renameBlocked = renaming || renameTrimmed === "" || renameTarget === null || renameTrimmed === renameTarget.storedTitle || renameDuplicate;
130
+ const closeRename = () => {
131
+ if (renaming) return;
132
+ settleWorkspaceAction();
133
+ setRenameError(null);
134
+ };
135
+ const confirmRename = () => {
136
+ if (renameBlocked) return;
137
+ setRenaming(true);
138
+ setRenameError(null);
139
+ renameWorkspace(renameTarget.workspaceId, renameTrimmed).then(() => {
140
+ setRenaming(false);
141
+ settleWorkspaceAction();
142
+ }).catch((reason) => {
143
+ setRenaming(false);
144
+ setRenameError(reason instanceof Error ? reason.message : String(reason));
145
+ });
146
+ };
147
+ const deleteTarget = request.action === "delete" ? request : null;
148
+ const [deleting, setDeleting] = (0, import_react.useState)(false);
149
+ const [deleteCommittedId, setDeleteCommittedId] = (0, import_react.useState)(null);
150
+ const [deleteError, setDeleteError] = (0, import_react.useState)(null);
151
+ (0, import_react.useEffect)(() => {
152
+ if (deleteCommittedId === null || workspaces.some((workspace) => workspace.workspaceId === deleteCommittedId)) return;
153
+ setDeleting(false);
154
+ setDeleteCommittedId(null);
155
+ settleWorkspaceAction();
156
+ }, [deleteCommittedId, workspaces, settleWorkspaceAction]);
157
+ const closeDelete = () => {
158
+ if (deleting) return;
159
+ settleWorkspaceAction();
160
+ setDeleteError(null);
161
+ };
162
+ const confirmDelete = () => {
163
+ if (deleting || deleteTarget === null) return;
164
+ setDeleting(true);
165
+ setDeleteCommittedId(null);
166
+ setDeleteError(null);
167
+ deleteWorkspace(deleteTarget.workspaceId).then(() => {
168
+ setDeleteCommittedId(deleteTarget.workspaceId);
169
+ }).catch((reason) => {
170
+ setDeleting(false);
171
+ setDeleteError(reason instanceof Error ? reason.message : String(reason));
172
+ });
173
+ };
174
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
175
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
176
+ import_dsh_client_ui_primitives.Modal,
177
+ {
178
+ open: renameTarget !== null,
179
+ onClose: closeRename,
180
+ closeLabel: t("close"),
181
+ title: t("rename.workspace.title"),
182
+ footer: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
183
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.Button, { variant: "outline", disabled: renaming, onClick: closeRename, children: t("cancel") }),
184
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.Button, { variant: "primary", disabled: renameBlocked, onClick: confirmRename, children: t("rename") })
185
+ ] }),
186
+ children: [
187
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
188
+ "input",
189
+ {
190
+ className: WorkspaceBrowser_default.renameInput,
191
+ value: renameDraft,
192
+ "aria-label": t("field.workspaceName"),
193
+ "data-modal-autofocus": true,
194
+ disabled: renaming,
195
+ onFocus: (e) => {
196
+ e.target.select();
197
+ },
198
+ onChange: (e) => {
199
+ setRenameDraft(e.target.value);
200
+ setRenameError(null);
201
+ },
202
+ onCompositionStart: () => {
203
+ composingRef.current = true;
204
+ },
205
+ onCompositionEnd: () => {
206
+ composingRef.current = false;
207
+ },
208
+ onKeyDown: (e) => {
209
+ if (e.key === "Enter" && !composingRef.current) {
210
+ e.preventDefault();
211
+ confirmRename();
212
+ }
213
+ }
214
+ }
215
+ ),
216
+ renameDuplicate && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: WorkspaceBrowser_default.renameError, role: "alert", children: t("conflict.named", { name: renameTrimmed }) }),
217
+ renameError !== null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: WorkspaceBrowser_default.renameError, role: "alert", children: renameError })
218
+ ]
219
+ }
220
+ ),
221
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
222
+ import_dsh_client_ui_primitives.Modal,
223
+ {
224
+ open: deleteTarget !== null,
225
+ onClose: closeDelete,
226
+ closeLabel: t("close"),
227
+ title: t("delete.workspace"),
228
+ ...deleteTarget === null ? {} : { description: t("delete.desc", { name: deleteTarget.displayTitle }) },
229
+ footer: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
230
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.Button, { variant: "outline", disabled: deleting, onClick: closeDelete, children: t("cancel") }),
231
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
232
+ import_dsh_client_ui_primitives.Button,
233
+ {
234
+ variant: "outline",
235
+ className: WorkspaceBrowser_default.deleteAction,
236
+ disabled: deleting,
237
+ onClick: confirmDelete,
238
+ children: t("delete.workspace")
239
+ }
240
+ )
241
+ ] }),
242
+ children: [
243
+ deleting && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: WorkspaceBrowser_default.deleteStatus, role: "status", children: t("delete.pending") }),
244
+ deleteError !== null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: WorkspaceBrowser_default.renameError, role: "alert", children: deleteError })
245
+ ]
246
+ }
247
+ )
248
+ ] });
249
+ }
250
+
251
+ // src/browser/rows/WorkspaceBrowser.tsx
252
+ var import_dsh_client_ui_primitives4 = require("@deepseek-ai/dsh-client-ui-primitives");
253
+
254
+ // node_modules/@deepseek-ai/dsh-api-workspace-controller/lib/types/default-workspace.js
255
+ var DEFAULT_WORKSPACE_DIRECTORY = "default-workspace";
256
+ function workspaceDisplayTitle(title, localizedDefault) {
257
+ return title === DEFAULT_WORKSPACE_DIRECTORY ? localizedDefault : title;
258
+ }
259
+
260
+ // node_modules/@deepseek-ai/dsh-util-values/lib/index.js
261
+ var SIMPLE_ESCAPES = {
262
+ '"': '"',
263
+ "\\": "\\",
264
+ "/": "/",
265
+ b: "\b",
266
+ f: "\f",
267
+ n: "\n",
268
+ r: "\r",
269
+ t: " "
270
+ };
271
+ var CONTENT_ESCAPE = /[\\\u0000-\u001f]/u;
272
+ function isWhitespace(c) {
273
+ return c === " " || c === "\n" || c === "\r" || c === " ";
274
+ }
275
+ function isHex(c) {
276
+ return c >= "0" && c <= "9" || c >= "a" && c <= "f" || c >= "A" && c <= "F";
277
+ }
278
+ var PartialArguments = class PartialArguments2 {
279
+ /** The view of a call with no arguments available. */
280
+ static EMPTY = PartialArguments2.fromObject({});
281
+ /**
282
+ * View finished argument text without scanning it until a reader asks.
283
+ * @param text - the complete argument JSON text.
284
+ * @returns a sealed view.
285
+ */
286
+ static fromText(text) {
287
+ const view = new PartialArguments2();
288
+ view.append(text);
289
+ view.sealed = true;
290
+ return view;
291
+ }
292
+ /**
293
+ * View an already parsed argument payload, such as a PTC dispatch object.
294
+ * @param value - the parsed argument value.
295
+ * @returns a sealed view; a non-object payload has no fields.
296
+ */
297
+ static fromObject(value) {
298
+ const view = new PartialArguments2();
299
+ view.object = typeof value === "object" && value !== null && !Array.isArray(value) ? value : {};
300
+ view.sealed = true;
301
+ return view;
302
+ }
303
+ /**
304
+ * The source: text so far or a parsed object, plus whether it can still grow.
305
+ * These are the only enumerable fields, so two views over the same source
306
+ * compare equal structurally however far each has been read.
307
+ */
308
+ chunks = [];
309
+ object;
310
+ sealed = false;
311
+ #ends = [];
312
+ #size = 0;
313
+ #consumed = 0;
314
+ #mode = "root";
315
+ #escape = false;
316
+ #keyStart = 0;
317
+ #keyEscaped = false;
318
+ #key = "";
319
+ #current = null;
320
+ #nestedEnds = [];
321
+ #nestedInString = false;
322
+ #invalidAt;
323
+ #invalidValue = false;
324
+ #entries = /* @__PURE__ */ new Map();
325
+ #order = [];
326
+ #reads = /* @__PURE__ */ new Map();
327
+ /** Whether this view rejects further appends; does not scan text or register reads. */
328
+ get isSealed() {
329
+ return this.sealed;
330
+ }
331
+ /** Whether indexing or a content read found invalid JSON; unread value contents are not validated. */
332
+ get invalid() {
333
+ this.scan();
334
+ return this.#mode === "invalid" || this.#invalidValue;
335
+ }
336
+ /**
337
+ * Retain streamed argument text without scanning or comparing observed answers.
338
+ * @param fragment - the text following every fragment appended before.
339
+ */
340
+ append(fragment) {
341
+ if (this.sealed) throw new Error("PartialArguments: cannot append to a sealed view");
342
+ if (fragment.length === 0) return;
343
+ this.chunks.push(fragment);
344
+ this.#size += fragment.length;
345
+ this.#ends.push(this.#size);
346
+ }
347
+ /**
348
+ * Reconcile a streamed prefix with authoritative complete text without joining the fragments.
349
+ * @param text - the final argument text, which replaces missing or conflicting deltas.
350
+ * @returns this view sealed with its caches retained when every character matches; otherwise a new sealed view.
351
+ */
352
+ settle(text) {
353
+ if (this.object !== void 0 || text.length !== this.#size) return PartialArguments2.fromText(text);
354
+ let offset = 0;
355
+ for (const chunk of this.chunks) {
356
+ if (!text.startsWith(chunk, offset)) return PartialArguments2.fromText(text);
357
+ offset += chunk.length;
358
+ }
359
+ this.chunks = text.length === 0 ? [] : [text];
360
+ this.#ends = text.length === 0 ? [] : [text.length];
361
+ this.sealed = true;
362
+ return this;
363
+ }
364
+ /**
365
+ * Compare observed answers and advance their publication baseline. Unread views remain unscanned.
366
+ * @returns whether any observed answer changed since its first read or the preceding refresh.
367
+ */
368
+ refresh() {
369
+ if (this.#reads.size === 0) return false;
370
+ this.scan();
371
+ let changed = false;
372
+ let completions = false;
373
+ for (const read of this.#reads.values()) {
374
+ if (read.completion) {
375
+ completions = true;
376
+ continue;
377
+ }
378
+ changed = this.refreshRead(read) || changed;
379
+ }
380
+ if (completions) {
381
+ for (const read of this.#reads.values()) if (read.completion) changed = this.refreshRead(read) || changed;
382
+ }
383
+ if (this.sealed) this.#reads.clear();
384
+ return changed;
385
+ }
386
+ refreshRead(read) {
387
+ const now = read.answer();
388
+ if (Object.is(now, read.last)) return false;
389
+ read.last = now;
390
+ return true;
391
+ }
392
+ /**
393
+ * Check whether no further fields can arrive.
394
+ * @returns whether the outer object closed, indexing failed, or the view is sealed; unread values are not validated.
395
+ */
396
+ closed() {
397
+ return this.remember("closed", "", () => this.closedNow());
398
+ }
399
+ /**
400
+ * List discovered fields in first-appearance order.
401
+ * @returns top-level keys seen so far, in first-appearance order.
402
+ */
403
+ keys() {
404
+ return this.remember("keys", "", () => this.keysNow(), (keys) => keys.length);
405
+ }
406
+ /**
407
+ * Check whether a top-level field has appeared.
408
+ * @param key - argument name.
409
+ * @returns whether the field has appeared (a string opened or another value began).
410
+ */
411
+ has(key) {
412
+ return this.remember("has", key, () => this.hasNow(key));
413
+ }
414
+ /**
415
+ * Check whether a field's closing delimiter has arrived, without validating its contents.
416
+ * @param key - argument name.
417
+ * @returns whether its delimiter arrived and no content reader has reported an error for this value.
418
+ */
419
+ complete(key) {
420
+ return this.remember("complete", key, () => this.completeNow(key));
421
+ }
422
+ /**
423
+ * Read string length without materializing its text.
424
+ * @param key - argument name.
425
+ * @param options - change granularity for a streaming string.
426
+ * @returns decoded UTF-16 length of the string field so far; undefined when absent or not a string.
427
+ */
428
+ stringLength(key, options) {
429
+ const step = Math.max(1, Math.floor(options?.step ?? 1));
430
+ const offset = options?.offset ?? 0;
431
+ return this.remember(`length:${step}:${offset}`, key, () => this.lengthNow(key), (length) => length === void 0 ? void 0 : Math.ceil((length + offset) / step));
432
+ }
433
+ /**
434
+ * Check a string against a decoded UTF-16 length limit without materializing it.
435
+ * @param key - argument name.
436
+ * @param maxLength - decoded UTF-16 limit, floored to at least zero.
437
+ * @returns whether the string is longer than the limit; false when absent or not a string.
438
+ */
439
+ stringExceeds(key, maxLength) {
440
+ const limit = Math.max(0, Math.floor(maxLength));
441
+ return this.remember(`exceeds:${limit}`, key, () => (this.lengthNow(key, limit + 1) ?? 0) > limit);
442
+ }
443
+ /**
444
+ * Read a decoded string, including a streaming prefix.
445
+ * @param key - argument name.
446
+ * @returns the string field's decoded text so far; undefined when absent or not a string.
447
+ */
448
+ text(key) {
449
+ return this.remember("text", key, () => this.textNow(key));
450
+ }
451
+ /**
452
+ * Read at most the first decoded UTF-16 units of a string.
453
+ * @param key - argument name.
454
+ * @param maxLength - maximum decoded UTF-16 length, floored to at least one.
455
+ * @returns the bounded string prefix; undefined when absent or not a string.
456
+ */
457
+ textPrefix(key, maxLength) {
458
+ const limit = Math.max(1, Math.floor(maxLength));
459
+ return this.remember(`prefix:${limit}`, key, () => this.textPrefixNow(key, limit));
460
+ }
461
+ /**
462
+ * Read a completed non-string argument.
463
+ * @param key - argument name.
464
+ * @returns the parsed non-string value once it closed; undefined while open, absent, or a string.
465
+ */
466
+ value(key) {
467
+ return this.remember("value", key, () => this.valueNow(key));
468
+ }
469
+ /** Answer a question and, on a streaming view, remember it for change detection. */
470
+ remember(kind, key, read, comparison) {
471
+ this.scan();
472
+ const result = read();
473
+ if (!this.sealed) {
474
+ const id = `${kind}/${key}`;
475
+ if (!this.#reads.has(id)) this.#reads.set(id, {
476
+ completion: kind === "complete",
477
+ answer: comparison === void 0 ? read : () => comparison(read()),
478
+ last: comparison === void 0 ? result : comparison(result)
479
+ });
480
+ }
481
+ return result;
482
+ }
483
+ closedNow() {
484
+ return this.sealed || this.#mode === "closed" || this.#mode === "invalid";
485
+ }
486
+ keysNow() {
487
+ return this.object === void 0 ? this.#order : Object.keys(this.object);
488
+ }
489
+ hasNow(key) {
490
+ return this.object === void 0 ? this.#entries.has(key) : Object.hasOwn(this.object, key);
491
+ }
492
+ completeNow(key) {
493
+ if (this.object !== void 0) return Object.hasOwn(this.object, key);
494
+ const entry = this.#entries.get(key);
495
+ return entry !== void 0 && entry.end >= 0 && (entry.kind === "string" ? entry.invalidAt === void 0 : !entry.invalid);
496
+ }
497
+ lengthNow(key, limit = Number.POSITIVE_INFINITY) {
498
+ if (this.object !== void 0) {
499
+ const field = Object.hasOwn(this.object, key) ? this.object[key] : void 0;
500
+ return typeof field === "string" ? field.length : void 0;
501
+ }
502
+ const entry = this.#entries.get(key);
503
+ if (entry?.kind !== "string") return void 0;
504
+ if (entry.text !== void 0 && entry.text.at === entry.end) return entry.text.length;
505
+ const read = entry.length ??= {
506
+ at: entry.start,
507
+ length: 0,
508
+ text: ""
509
+ };
510
+ this.readString(entry, read, limit, false);
511
+ return read.length;
512
+ }
513
+ textNow(key) {
514
+ if (this.object !== void 0) {
515
+ const field = Object.hasOwn(this.object, key) ? this.object[key] : void 0;
516
+ return typeof field === "string" ? field : void 0;
517
+ }
518
+ const entry = this.#entries.get(key);
519
+ if (entry?.kind !== "string") return void 0;
520
+ if (entry.text === void 0 && entry.end >= 0 && entry.needsDecoding && entry.invalidAt === void 0) {
521
+ let text;
522
+ try {
523
+ text = JSON.parse(`"${this.slice(entry.start, entry.end)}"`);
524
+ } catch (_error) {
525
+ }
526
+ if (text !== void 0) entry.text = {
527
+ at: entry.end,
528
+ length: text.length,
529
+ text
530
+ };
531
+ }
532
+ const read = entry.text ??= {
533
+ at: entry.start,
534
+ length: 0,
535
+ text: ""
536
+ };
537
+ this.readString(entry, read, Number.POSITIVE_INFINITY, true);
538
+ return read.text;
539
+ }
540
+ textPrefixNow(key, maxLength) {
541
+ if (this.object !== void 0) {
542
+ const field = Object.hasOwn(this.object, key) ? this.object[key] : void 0;
543
+ return typeof field === "string" ? field.slice(0, maxLength) : void 0;
544
+ }
545
+ const entry = this.#entries.get(key);
546
+ if (entry?.kind !== "string") return void 0;
547
+ const prefixes = entry.prefixes ??= /* @__PURE__ */ new Map();
548
+ let read = prefixes.get(maxLength);
549
+ if (read === void 0) {
550
+ read = {
551
+ at: entry.start,
552
+ length: 0,
553
+ text: ""
554
+ };
555
+ prefixes.set(maxLength, read);
556
+ }
557
+ this.readString(entry, read, maxLength, true);
558
+ return read.text;
559
+ }
560
+ valueNow(key) {
561
+ if (this.object !== void 0) {
562
+ if (!Object.hasOwn(this.object, key)) return void 0;
563
+ const field = this.object[key];
564
+ return typeof field === "string" ? void 0 : field;
565
+ }
566
+ const entry = this.#entries.get(key);
567
+ if (entry?.kind !== "value" || entry.end < 0 || entry.invalid) return void 0;
568
+ if (entry.parsed === void 0) try {
569
+ entry.parsed = JSON.parse(this.slice(entry.start, entry.end));
570
+ } catch (_error) {
571
+ entry.invalid = true;
572
+ this.#invalidValue = true;
573
+ }
574
+ return entry.parsed;
575
+ }
576
+ chunkAt(at) {
577
+ let low = 0;
578
+ let high = this.#ends.length;
579
+ while (low < high) {
580
+ const mid = low + high >>> 1;
581
+ if (this.#ends[mid] <= at) low = mid + 1;
582
+ else high = mid;
583
+ }
584
+ return low;
585
+ }
586
+ /** Materialize only a requested range, never the cumulative source. */
587
+ slice(start, end) {
588
+ if (start >= end) return "";
589
+ const first = this.chunkAt(start);
590
+ const last = this.chunkAt(end - 1);
591
+ const base = first === 0 ? 0 : this.#ends[first - 1];
592
+ if (first === last) return this.chunks[first].slice(start - base, end - base);
593
+ const parts = [this.chunks[first].slice(start - base)];
594
+ for (let i = first + 1; i < last; i++) parts.push(this.chunks[i]);
595
+ parts.push(this.chunks[last].slice(0, end - this.#ends[last - 1]));
596
+ return parts.join("");
597
+ }
598
+ readString(entry, read, limit, materialize) {
599
+ const end = Math.min(entry.end < 0 ? this.#consumed : entry.end, entry.invalidAt ?? Number.POSITIVE_INFINITY, this.#invalidAt ?? Number.POSITIVE_INFINITY);
600
+ if (!entry.needsDecoding) {
601
+ const length = Math.min(end - read.at, limit - read.length);
602
+ if (length <= 0) return;
603
+ if (materialize) read.text += this.slice(read.at, read.at + length);
604
+ read.at += length;
605
+ read.length += length;
606
+ return;
607
+ }
608
+ let chunkIndex = this.chunkAt(read.at);
609
+ while (read.at < end && read.length < limit) {
610
+ const base = chunkIndex === 0 ? 0 : this.#ends[chunkIndex - 1];
611
+ const chunk = this.chunks[chunkIndex];
612
+ const remaining = chunk.slice(read.at - base, Math.min(chunk.length, end - base));
613
+ const boundary = remaining.search(CONTENT_ESCAPE);
614
+ const length = Math.min(boundary < 0 ? remaining.length : boundary, limit - read.length);
615
+ if (length > 0) {
616
+ if (materialize) read.text += remaining.slice(0, length);
617
+ read.at += length;
618
+ read.length += length;
619
+ if (read.at === base + chunk.length) chunkIndex++;
620
+ continue;
621
+ }
622
+ const type = remaining.length > 1 ? remaining[1] : read.at + 1 < end ? this.chunks[chunkIndex + 1][0] : void 0;
623
+ let decoded;
624
+ let width = 2;
625
+ if (remaining[0] === "\\" && type === void 0 && entry.end < 0) return;
626
+ if (remaining[0] === "\\" && type === "u") {
627
+ const hex = this.slice(read.at + 2, Math.min(end, read.at + 6));
628
+ let valid = true;
629
+ for (let i = 0; i < hex.length; i++) if (!isHex(hex[i])) valid = false;
630
+ if (valid) {
631
+ if (hex.length < 4 && entry.end < 0) return;
632
+ if (hex.length === 4) decoded = String.fromCharCode(Number.parseInt(hex, 16));
633
+ }
634
+ width = 6;
635
+ } else if (remaining[0] === "\\" && type !== void 0) decoded = SIMPLE_ESCAPES[type];
636
+ if (decoded === void 0) {
637
+ entry.invalidAt = read.at;
638
+ this.#invalidValue = true;
639
+ return;
640
+ }
641
+ if (materialize) read.text += decoded;
642
+ read.length++;
643
+ read.at += width;
644
+ while (chunkIndex < this.chunks.length && read.at >= this.#ends[chunkIndex]) chunkIndex++;
645
+ }
646
+ }
647
+ /** Locate new field ranges without decoding or parsing their contents. */
648
+ scan() {
649
+ if (this.object !== void 0 || this.#consumed === this.#size) return;
650
+ for (let i = this.chunkAt(this.#consumed); i < this.chunks.length && this.#invalidAt === void 0; i++) {
651
+ const pending = this.chunks[i];
652
+ const base = i === 0 ? 0 : this.#ends[i - 1];
653
+ for (let index = this.#consumed - base; index < pending.length && this.#mode !== "invalid"; index++) {
654
+ if (this.#mode === "string" || this.#mode === "nested" && this.#nestedInString) {
655
+ const end = this.stringBoundary(pending, index);
656
+ this.#consumed += end - index;
657
+ index = end;
658
+ if (index === pending.length) break;
659
+ }
660
+ this.step(pending[index], this.#consumed);
661
+ this.#consumed++;
662
+ }
663
+ }
664
+ }
665
+ /** Only raw quotes and their preceding backslash runs can terminate a string. */
666
+ stringBoundary(fragment, start) {
667
+ let at = start;
668
+ while (true) {
669
+ const quote = fragment.indexOf('"', at);
670
+ const end = quote < 0 ? fragment.length : quote;
671
+ if (this.#mode === "string") {
672
+ const entry = this.#current;
673
+ if (!entry.needsDecoding && CONTENT_ESCAPE.test(fragment.slice(at, end))) entry.needsDecoding = true;
674
+ }
675
+ let slashStart = end;
676
+ while (slashStart > at && fragment[slashStart - 1] === "\\") slashStart--;
677
+ const escaped = (end - slashStart) % 2 === 1 !== (slashStart === at && this.#escape);
678
+ this.#escape = quote < 0 && escaped;
679
+ if (quote < 0 || !escaped) return end;
680
+ at = quote + 1;
681
+ }
682
+ }
683
+ step(c, at) {
684
+ switch (this.#mode) {
685
+ case "root":
686
+ if (isWhitespace(c)) return;
687
+ if (c === "{") {
688
+ this.#mode = "key-or-end";
689
+ return;
690
+ }
691
+ this.fail();
692
+ return;
693
+ case "key-or-end":
694
+ if (isWhitespace(c)) return;
695
+ if (c === "}") {
696
+ this.#mode = "closed";
697
+ return;
698
+ }
699
+ if (c === '"') {
700
+ this.beginKey(at);
701
+ return;
702
+ }
703
+ this.fail();
704
+ return;
705
+ case "key-only":
706
+ if (isWhitespace(c)) return;
707
+ if (c === '"') {
708
+ this.beginKey(at);
709
+ return;
710
+ }
711
+ this.fail();
712
+ return;
713
+ case "key":
714
+ this.stepKey(c, at);
715
+ return;
716
+ case "colon":
717
+ if (isWhitespace(c)) return;
718
+ if (c === ":") {
719
+ this.#mode = "value";
720
+ return;
721
+ }
722
+ this.fail();
723
+ return;
724
+ case "value":
725
+ this.beginValue(c, at);
726
+ return;
727
+ case "string": {
728
+ const entry = this.#current;
729
+ entry.end = at;
730
+ this.#current = null;
731
+ this.#mode = "comma-or-end";
732
+ return;
733
+ }
734
+ case "scalar":
735
+ this.stepScalar(c, at);
736
+ return;
737
+ case "nested":
738
+ this.stepNested(c, at);
739
+ return;
740
+ case "comma-or-end":
741
+ if (isWhitespace(c)) return;
742
+ if (c === ",") {
743
+ this.#mode = "key-only";
744
+ return;
745
+ }
746
+ if (c === "}") {
747
+ this.#mode = "closed";
748
+ return;
749
+ }
750
+ this.fail();
751
+ return;
752
+ case "closed":
753
+ if (isWhitespace(c)) return;
754
+ this.fail();
755
+ return;
756
+ /* v8 ignore next 2 -- scan() stops stepping once the view is invalid. */
757
+ case "invalid":
758
+ return;
759
+ /* v8 ignore next 2 -- Every scanner mode has a handler above. */
760
+ default:
761
+ assertNever(this.#mode);
762
+ }
763
+ }
764
+ fail() {
765
+ this.#invalidAt = this.#consumed;
766
+ this.#mode = "invalid";
767
+ this.#current = null;
768
+ }
769
+ beginKey(at) {
770
+ this.#mode = "key";
771
+ this.#keyStart = at + 1;
772
+ this.#keyEscaped = false;
773
+ this.#escape = false;
774
+ }
775
+ stepKey(c, at) {
776
+ if (c < " ") {
777
+ this.fail();
778
+ return;
779
+ }
780
+ if (this.#escape) {
781
+ this.#escape = false;
782
+ return;
783
+ }
784
+ if (c === "\\") {
785
+ this.#escape = true;
786
+ this.#keyEscaped = true;
787
+ return;
788
+ }
789
+ if (c !== '"') return;
790
+ const raw = this.slice(this.#keyStart, at);
791
+ if (this.#keyEscaped) try {
792
+ this.#key = JSON.parse(`"${raw}"`);
793
+ } catch (_error) {
794
+ this.fail();
795
+ return;
796
+ }
797
+ else this.#key = raw;
798
+ this.#mode = "colon";
799
+ }
800
+ open(entry) {
801
+ if (!this.#entries.has(this.#key)) this.#order.push(this.#key);
802
+ this.#entries.set(this.#key, entry);
803
+ this.#current = entry;
804
+ }
805
+ beginValue(c, at) {
806
+ if (isWhitespace(c)) return;
807
+ if (c === '"') {
808
+ this.open({
809
+ kind: "string",
810
+ start: at + 1,
811
+ end: -1,
812
+ needsDecoding: false,
813
+ invalidAt: void 0,
814
+ length: void 0,
815
+ text: void 0,
816
+ prefixes: void 0
817
+ });
818
+ this.#escape = false;
819
+ this.#mode = "string";
820
+ return;
821
+ }
822
+ if (c === "}" || c === "," || c === ":" || c === "]") {
823
+ this.fail();
824
+ return;
825
+ }
826
+ this.open({
827
+ kind: "value",
828
+ start: at,
829
+ end: -1,
830
+ parsed: void 0,
831
+ invalid: false
832
+ });
833
+ if (c === "{" || c === "[") {
834
+ this.#mode = "nested";
835
+ this.#nestedEnds = [c === "{" ? "}" : "]"];
836
+ this.#nestedInString = false;
837
+ this.#escape = false;
838
+ return;
839
+ }
840
+ this.#mode = "scalar";
841
+ }
842
+ stepScalar(c, at) {
843
+ if (c !== "," && c !== "}" && !isWhitespace(c)) return;
844
+ this.closeValue(at);
845
+ this.#mode = c === "," ? "key-only" : c === "}" ? "closed" : "comma-or-end";
846
+ }
847
+ stepNested(c, at) {
848
+ if (this.#nestedInString) {
849
+ this.#nestedInString = false;
850
+ return;
851
+ }
852
+ if (c === '"') {
853
+ this.#nestedInString = true;
854
+ return;
855
+ }
856
+ if (c === "{" || c === "[") {
857
+ this.#nestedEnds.push(c === "{" ? "}" : "]");
858
+ return;
859
+ }
860
+ if (c === "}" || c === "]") {
861
+ if (this.#nestedEnds.pop() !== c) {
862
+ this.fail();
863
+ return;
864
+ }
865
+ if (this.#nestedEnds.length === 0) {
866
+ this.closeValue(at + 1);
867
+ this.#mode = "comma-or-end";
868
+ }
869
+ }
870
+ }
871
+ closeValue(end) {
872
+ const entry = this.#current;
873
+ entry.end = end;
874
+ this.#current = null;
875
+ }
876
+ };
877
+ function assertNever(value, context) {
878
+ const rendered = JSON.stringify(value) ?? String(value);
879
+ throw new Error(`unreachable variant${context ? ` in ${context}` : ""}: ${rendered}`);
880
+ }
881
+
882
+ // node_modules/@deepseek-ai/dsh-util-workspace-path/lib/index.js
883
+ function isWindowsStylePath(value) {
884
+ return /^[A-Za-z]:[/\\]/.test(value) || value.startsWith("\\\\");
885
+ }
886
+ function abbreviateHomePath(path, home) {
887
+ if (home === void 0 || home === "") return path;
888
+ if (isWindowsStylePath(path) || isWindowsStylePath(home)) return path;
889
+ const root = home.replace(/\/+$/, "");
890
+ if (root === "" || root === "/") return path;
891
+ if (path.replace(/\/+$/, "") === root) return "~";
892
+ if (path.startsWith(`${root}/`)) return `~${path.slice(root.length)}`;
893
+ return path;
894
+ }
895
+ function workspaceTitleOf(path) {
896
+ const trimmed = path.replace(/[/\\]+$/, "");
897
+ const separator = Math.max(trimmed.lastIndexOf("/"), trimmed.lastIndexOf("\\"));
898
+ return trimmed.slice(separator + 1);
899
+ }
900
+
901
+ // src/browser/tree.ts
902
+ var UNGROUPED_KEY = "";
903
+ function owningGroupKey(workspaces, sessionId) {
904
+ return workspaces.find((workspace) => workspace.sessionIds.includes(sessionId))?.workspaceId ?? UNGROUPED_KEY;
905
+ }
906
+ function mainSessionId(list) {
907
+ return Object.values(list.byId).find((session) => (session.retainedBy.mainView ?? 0) > 0)?.id;
908
+ }
909
+ function matchesStatusFilter(node, filter) {
910
+ switch (filter) {
911
+ case "all":
912
+ return true;
913
+ case "running":
914
+ return node.running || node.runningSubagentCount > 0;
915
+ case "pending":
916
+ return node.pendingInteraction !== void 0;
917
+ case "unread":
918
+ return node.completed;
919
+ /* v8 ignore next 2 -- closed-union backstop; only reached if the filter is forged */
920
+ default:
921
+ return assertNever(filter);
922
+ }
923
+ }
924
+ function workspaceLabel(cwd) {
925
+ if (cwd === void 0 || cwd === "") return "";
926
+ const base = workspaceTitleOf(cwd);
927
+ return base !== "" ? base : cwd;
928
+ }
929
+ function orderByRecency(sessionIds, summaries) {
930
+ return sessionIds.flatMap((id) => {
931
+ const summary = summaries[id];
932
+ if (summary === void 0) return [];
933
+ return [{ id, rank: summary.updatedAt }];
934
+ }).sort((a, b) => {
935
+ if (a.rank !== b.rank) return b.rank - a.rank;
936
+ return a.id < b.id ? -1 : 1;
937
+ }).map((member) => member.id);
938
+ }
939
+ function reconcileManualOrder(memberIds, savedOrder, summaries, rowState) {
940
+ const members = new Map(memberIds.map((id) => [id, id]));
941
+ const included = /* @__PURE__ */ new Set();
942
+ const ordered = [];
943
+ for (const key of savedOrder ?? []) {
944
+ const id = members.get(key);
945
+ if (id === void 0 || included.has(key)) continue;
946
+ ordered.push(id);
947
+ included.add(key);
948
+ }
949
+ const archived = new Set(rowState?.archivedSessionIds);
950
+ const pins = [];
951
+ for (const sessionId of rowState?.pinnedSessionIds ?? []) {
952
+ const id = members.get(sessionId);
953
+ if (id === void 0 || included.has(id) || archived.has(id) || summaries[id] === void 0) continue;
954
+ pins.push(id);
955
+ included.add(id);
956
+ }
957
+ const ordinary = [];
958
+ const archives = [];
959
+ for (const id of orderByRecency([...members.values()].filter((id2) => !included.has(id2)), summaries)) {
960
+ if (archived.has(id)) archives.push(id);
961
+ else ordinary.push(id);
962
+ }
963
+ return [...pins, ...ordered, ...ordinary, ...archives];
964
+ }
965
+ function pinCurrentBlank(order, currentBlank) {
966
+ if (currentBlank === void 0) return [...order];
967
+ return [currentBlank, ...order.filter((id) => id !== currentBlank)];
968
+ }
969
+ function sessionVisible(session, current, archived, archivedFilter) {
970
+ if (session.origin === "subagent") return false;
971
+ if (session.blank && session.id !== current) return false;
972
+ switch (archivedFilter) {
973
+ case "default":
974
+ return !archived.has(session.id);
975
+ case "show":
976
+ return true;
977
+ case "only":
978
+ return archived.has(session.id);
979
+ /* v8 ignore next 2 -- closed-union backstop; only reached if the filter is forged */
980
+ default:
981
+ return assertNever(archivedFilter);
982
+ }
983
+ }
984
+ function sectionMembers(members, pinned, archived) {
985
+ const placeholders = [];
986
+ const leading = [];
987
+ const rest = [];
988
+ for (const member of members) {
989
+ if (member.blank) placeholders.push(member);
990
+ else if (!archived.has(member.id) && pinned.has(member.id)) leading.push(member);
991
+ else rest.push(member);
992
+ }
993
+ return [...placeholders, ...leading, ...rest];
994
+ }
995
+ function sessionTitle(session) {
996
+ return session.blank ? "" : session.title?.trim() ?? "";
997
+ }
998
+ function buildGroup(key, workspaceId, cwd, createdAt, label, members) {
999
+ return { key, workspaceId, cwd, createdAt, label, sessions: [...members] };
1000
+ }
1001
+ function orderedUngrouped(members, stored, summaries) {
1002
+ const byId = new Map(members.map((session) => [session.id, session]));
1003
+ const ids = stored === void 0 ? orderByRecency(members.map((session) => session.id), summaries) : reconcileManualOrder(members.map((session) => session.id), stored, summaries);
1004
+ return ids.flatMap((id) => {
1005
+ const session = byId.get(id);
1006
+ return session === void 0 ? [] : [session];
1007
+ });
1008
+ }
1009
+ function groupByWorkspace(list, workspaces, archived, archivedFilter, ungroupedOrder) {
1010
+ const current = mainSessionId(list);
1011
+ const groups = [];
1012
+ const accounted = /* @__PURE__ */ new Set();
1013
+ for (const workspace of workspaces) {
1014
+ const members = [];
1015
+ for (const id of workspace.sessionIds) {
1016
+ const summary = list.byId[id];
1017
+ if (summary === void 0) continue;
1018
+ accounted.add(id);
1019
+ if (!sessionVisible(summary, current, archived, archivedFilter)) continue;
1020
+ members.push(summary);
1021
+ }
1022
+ if (archivedFilter === "only" && members.length === 0) continue;
1023
+ groups.push(buildGroup(
1024
+ workspace.workspaceId,
1025
+ workspace.workspaceId,
1026
+ workspace.path,
1027
+ Date.parse(workspace.createdAt),
1028
+ workspace.title,
1029
+ members
1030
+ ));
1031
+ }
1032
+ const stray = list.ids.map((id) => list.byId[id]).filter((s) => s !== void 0 && !accounted.has(s.id) && sessionVisible(s, current, archived, archivedFilter));
1033
+ if (stray.length > 0) {
1034
+ groups.push(buildGroup(
1035
+ UNGROUPED_KEY,
1036
+ void 0,
1037
+ void 0,
1038
+ void 0,
1039
+ "",
1040
+ orderedUngrouped(stray, ungroupedOrder, list.byId)
1041
+ ));
1042
+ }
1043
+ return groups;
1044
+ }
1045
+ function visiblePendingKind(kind) {
1046
+ switch (kind) {
1047
+ case "approval":
1048
+ case "plan-review":
1049
+ case "question":
1050
+ return kind;
1051
+ default:
1052
+ return void 0;
1053
+ }
1054
+ }
1055
+ function runningChildCount(list, parentId, statuses) {
1056
+ return list.projectionsBySession[parentId]?.values.subagentCatalog?.reduce(
1057
+ (count, child) => count + ((statuses.get(child.id)?.running ?? list.byId[child.id]?.running) === true ? 1 : 0),
1058
+ 0
1059
+ ) ?? 0;
1060
+ }
1061
+ function sessionNode(s, list, statuses, pinned, archived) {
1062
+ const status = statuses.get(s.id);
1063
+ const pendingInteraction = visiblePendingKind(status?.pendingInteraction?.kind);
1064
+ return {
1065
+ id: s.id,
1066
+ title: sessionTitle(s),
1067
+ blank: s.blank,
1068
+ running: status?.running ?? s.running,
1069
+ runningSubagentCount: runningChildCount(list, s.id, statuses),
1070
+ completed: status?.completionUnread === true,
1071
+ pinned: !archived.has(s.id) && pinned.has(s.id),
1072
+ archived: archived.has(s.id),
1073
+ updatedAt: s.updatedAt,
1074
+ ...s.cwd === void 0 || s.cwd === "" ? {} : { cwd: s.cwd },
1075
+ ...pendingInteraction === void 0 ? {} : { pendingInteraction }
1076
+ };
1077
+ }
1078
+ function deriveGroups(list, workspaces, rowState, statuses, view) {
1079
+ const archived = new Set(rowState.archivedSessionIds);
1080
+ const pinned = new Set(rowState.pinnedSessionIds);
1081
+ const expandedGroups = new Set(view.expandedGroups);
1082
+ const statusFilter = view.statusFilter ?? "all";
1083
+ const current = mainSessionId(list);
1084
+ const currentGroup = current === void 0 ? void 0 : owningGroupKey(workspaces, current);
1085
+ const groups = [];
1086
+ for (const g of groupByWorkspace(list, workspaces, archived, rowState.archivedFilter, view.ungroupedOrder)) {
1087
+ const expanded = expandedGroups.has(g.key);
1088
+ const sessions = expanded ? sectionMembers(g.sessions, pinned, archived).map((session) => sessionNode(session, list, statuses, pinned, archived)).filter((node) => matchesStatusFilter(node, statusFilter)) : [];
1089
+ if (statusFilter !== "all" && sessions.length === 0) continue;
1090
+ groups.push({
1091
+ key: g.key,
1092
+ workspaceId: g.workspaceId,
1093
+ cwd: g.cwd,
1094
+ createdAt: g.createdAt,
1095
+ label: g.label,
1096
+ sessionCount: statusFilter === "all" ? g.sessions.length : sessions.length,
1097
+ expanded,
1098
+ containsCurrent: g.key === currentGroup,
1099
+ sessions
1100
+ });
1101
+ }
1102
+ return groups;
1103
+ }
1104
+ function sessionMemberIds(list) {
1105
+ return visibleSessionIds(list, [], "show");
1106
+ }
1107
+ function visibleSessionIds(list, archivedSessionIds, archivedFilter) {
1108
+ const archived = new Set(archivedSessionIds);
1109
+ const current = mainSessionId(list);
1110
+ return list.ids.filter((id) => {
1111
+ const s = list.byId[id];
1112
+ return s !== void 0 && sessionVisible(s, current, archived, archivedFilter);
1113
+ });
1114
+ }
1115
+ function deriveFlat(list, sessionIds, rowState, statuses, statusFilter = "all") {
1116
+ const archived = new Set(rowState.archivedSessionIds);
1117
+ const pinned = new Set(rowState.pinnedSessionIds);
1118
+ const current = mainSessionId(list);
1119
+ const members = sessionIds.flatMap((id) => {
1120
+ const session = list.byId[id];
1121
+ return session !== void 0 && sessionVisible(session, current, archived, rowState.archivedFilter) ? [session] : [];
1122
+ });
1123
+ return sectionMembers(members, pinned, archived).map((session) => sessionNode(session, list, statuses, pinned, archived)).filter((node) => matchesStatusFilter(node, statusFilter));
1124
+ }
1125
+ var TIME_BUCKET_ORDER = ["pinned", "today", "yesterday", "week", "earlier"];
1126
+ function startOfLocalDay(now) {
1127
+ const day = new Date(now);
1128
+ day.setHours(0, 0, 0, 0);
1129
+ return day.getTime();
1130
+ }
1131
+ function shiftLocalDays(start, days) {
1132
+ const day = new Date(start);
1133
+ day.setDate(day.getDate() + days);
1134
+ return day.getTime();
1135
+ }
1136
+ function sessionTimeBucket(updatedAt, now) {
1137
+ const today = startOfLocalDay(now);
1138
+ if (updatedAt >= today) return "today";
1139
+ if (updatedAt >= shiftLocalDays(today, -1)) return "yesterday";
1140
+ const weekday = (new Date(now).getDay() + 6) % 7;
1141
+ if (updatedAt >= shiftLocalDays(today, -weekday)) return "week";
1142
+ return "earlier";
1143
+ }
1144
+ function deriveTimeGroups(list, sessionIds, rowState, statuses, view) {
1145
+ const rows = deriveFlat(list, sessionIds, rowState, statuses, view.statusFilter ?? "all");
1146
+ const byBucket = /* @__PURE__ */ new Map();
1147
+ for (const row of rows) {
1148
+ const key = row.pinned ? "pinned" : row.blank ? "today" : sessionTimeBucket(row.updatedAt, view.now);
1149
+ const bucket = byBucket.get(key);
1150
+ if (bucket === void 0) byBucket.set(key, [row]);
1151
+ else bucket.push(row);
1152
+ }
1153
+ const expandedBuckets = view.expandedBuckets === void 0 ? void 0 : new Set(view.expandedBuckets);
1154
+ const groups = [];
1155
+ for (const key of TIME_BUCKET_ORDER) {
1156
+ const members = byBucket.get(key);
1157
+ if (members === void 0 || members.length === 0) continue;
1158
+ const expanded = expandedBuckets === void 0 || expandedBuckets.has(key);
1159
+ groups.push({
1160
+ key,
1161
+ sessionCount: members.length,
1162
+ expanded,
1163
+ sessions: expanded ? members : []
1164
+ });
1165
+ }
1166
+ return groups;
1167
+ }
1168
+ function deriveSearchResults(list, workspaces, query, archivedSessionIds, archivedFilter, statuses, content, limit) {
1169
+ const q = query.trim().toLowerCase();
1170
+ if (q === "") return { items: [], hasMore: false };
1171
+ const archived = new Set(archivedSessionIds);
1172
+ const current = mainSessionId(list);
1173
+ const workspaceBySession = /* @__PURE__ */ new Map();
1174
+ for (const workspace of workspaces) {
1175
+ for (const sessionId of workspace.sessionIds) {
1176
+ if (!workspaceBySession.has(sessionId)) workspaceBySession.set(sessionId, workspace.title);
1177
+ }
1178
+ }
1179
+ const labelOf = (summary) => workspaceBySession.get(summary.id) ?? workspaceLabel(summary.cwd);
1180
+ const contentBySession = /* @__PURE__ */ new Map();
1181
+ for (const item of content.items) {
1182
+ if (!contentBySession.has(item.sessionId)) contentBySession.set(item.sessionId, item);
1183
+ }
1184
+ const local = [];
1185
+ for (const id of list.ids) {
1186
+ const summary = list.byId[id];
1187
+ if (summary === void 0 || summary.blank || !sessionVisible(summary, current, archived, archivedFilter)) continue;
1188
+ if (sessionTitle(summary).toLowerCase().includes(q) || labelOf(summary).toLowerCase().includes(q) || summary.id.toLowerCase().includes(q)) {
1189
+ local.push(summary);
1190
+ }
1191
+ }
1192
+ const localById = new Map(local.map((summary) => [summary.id, summary]));
1193
+ const orderedLocal = orderByRecency(local.map((summary) => summary.id), list.byId).map((id) => localById.get(id));
1194
+ const ordered = [];
1195
+ const included = /* @__PURE__ */ new Set();
1196
+ const include = (summary) => {
1197
+ if (included.has(summary.id)) return;
1198
+ included.add(summary.id);
1199
+ ordered.push(summary);
1200
+ };
1201
+ for (const summary of orderedLocal) include(summary);
1202
+ for (const item of content.items) {
1203
+ const summary = list.byId[item.sessionId];
1204
+ if (summary !== void 0 && !summary.blank && sessionVisible(summary, current, archived, archivedFilter)) include(summary);
1205
+ }
1206
+ return {
1207
+ items: ordered.slice(0, limit).map((summary) => {
1208
+ const match = contentBySession.get(summary.id);
1209
+ const status = statuses.get(summary.id);
1210
+ const pendingInteraction = visiblePendingKind(status?.pendingInteraction?.kind);
1211
+ return {
1212
+ id: summary.id,
1213
+ title: sessionTitle(summary),
1214
+ workspace: labelOf(summary),
1215
+ running: status?.running ?? summary.running,
1216
+ runningSubagentCount: runningChildCount(list, summary.id, statuses),
1217
+ ...pendingInteraction === void 0 ? {} : { pendingInteraction },
1218
+ completed: status?.completionUnread === true,
1219
+ archived: archived.has(summary.id),
1220
+ ...match === void 0 ? {} : { snippet: match.snippet }
1221
+ };
1222
+ }),
1223
+ hasMore: content.hasMore || ordered.length > limit
1224
+ };
1225
+ }
1226
+ function folderPath(path) {
1227
+ const windows = /^[A-Za-z]:[/\\]/.test(path) || path.startsWith("\\\\");
1228
+ return (windows ? path.replaceAll("\\", "/") : path).replace(/\/+$/, "");
1229
+ }
1230
+ function owningParentFolder(path, parents) {
1231
+ const child = folderPath(path);
1232
+ let owner;
1233
+ let length = -1;
1234
+ for (const parent of parents) {
1235
+ const root = folderPath(parent);
1236
+ if (root.length > length && child !== root && child.startsWith(`${root}/`)) {
1237
+ owner = parent;
1238
+ length = root.length;
1239
+ }
1240
+ }
1241
+ return owner;
1242
+ }
1243
+
1244
+ // src/browser/rows/Rows.tsx
1245
+ var import_react2 = require("react");
1246
+ var import_dsh_client_ui_primitives2 = require("@deepseek-ai/dsh-client-ui-primitives");
1247
+
1248
+ // src/browser/rows/Rows.module.css
1249
+ var Rows_default = {
1250
+ projectRow: "Rows_projectRow",
1251
+ sessionRow: "Rows_sessionRow",
1252
+ selected: "Rows_selected",
1253
+ dragPreview: "Rows_dragPreview",
1254
+ searchResultRow: "Rows_searchResultRow",
1255
+ searchResultHeading: "Rows_searchResultHeading",
1256
+ searchResultTitle: "Rows_searchResultTitle",
1257
+ searchResultMeta: "Rows_searchResultMeta",
1258
+ searchResultWorkspace: "Rows_searchResultWorkspace",
1259
+ searchResultSnippet: "Rows_searchResultSnippet",
1260
+ rowActions: "Rows_rowActions",
1261
+ title: "Rows_title",
1262
+ slot: "Rows_slot",
1263
+ visuallyHidden: "Rows_visuallyHidden",
1264
+ folderActive: "Rows_folderActive",
1265
+ chevron: "Rows_chevron",
1266
+ folder: "Rows_folder",
1267
+ arrow: "Rows_arrow",
1268
+ arrowOpen: "Rows_arrowOpen",
1269
+ projectText: "Rows_projectText",
1270
+ renameInput: "Rows_renameInput",
1271
+ meta: "Rows_meta",
1272
+ time: "Rows_time",
1273
+ pinIndicator: "Rows_pinIndicator",
1274
+ archived: "Rows_archived",
1275
+ dot: "Rows_dot",
1276
+ menuOpen: "Rows_menuOpen",
1277
+ rowQuickActions: "Rows_rowQuickActions",
1278
+ rowResting: "Rows_rowResting",
1279
+ timestamp: "Rows_timestamp",
1280
+ pinnedAction: "Rows_pinnedAction",
1281
+ dropBefore: "Rows_dropBefore",
1282
+ dropAfter: "Rows_dropAfter",
1283
+ hoverContent: "Rows_hoverContent",
1284
+ hoverTitle: "Rows_hoverTitle",
1285
+ hoverPath: "Rows_hoverPath",
1286
+ hoverTime: "Rows_hoverTime",
1287
+ hoverStatus: "Rows_hoverStatus",
1288
+ hoverArchived: "Rows_hoverArchived",
1289
+ iconButton: "Rows_iconButton",
1290
+ bucketRow: "Rows_bucketRow",
1291
+ workspaceChip: "Rows_workspaceChip"
1292
+ };
1293
+
1294
+ // src/browser/rows/Rows.tsx
1295
+ var import_jsx_runtime2 = require("react/jsx-runtime");
1296
+ var DRAG_PREVIEW_PROPERTIES = [
1297
+ "--dsh-sidebar-row-padding",
1298
+ "--dsh-sidebar-label-gap",
1299
+ "--dsh-sidebar-paint-inset"
1300
+ ];
1301
+ function displayTitle(node, t) {
1302
+ return node.blank ? t("session.new") : node.title || t("session.untitled");
1303
+ }
1304
+ var MIN_TITLE_REVEAL_PX = 8;
1305
+ var TITLE_MARQUEE_PX_PER_MS = 0.03;
1306
+ function placeTitle(title, left, range) {
1307
+ if (typeof title.scrollTo === "function") title.scrollTo({ left, behavior: "instant" });
1308
+ else title.scrollLeft = left;
1309
+ if (left > 0) title.dataset.scrolled = "";
1310
+ else delete title.dataset.scrolled;
1311
+ if (left < range) title.dataset.clipped = "";
1312
+ else delete title.dataset.clipped;
1313
+ }
1314
+ function restTitle(title) {
1315
+ if (typeof title.scrollTo === "function") title.scrollTo({ left: 0, behavior: "instant" });
1316
+ else title.scrollLeft = 0;
1317
+ delete title.dataset.scrolled;
1318
+ delete title.dataset.clipped;
1319
+ }
1320
+ function useTitleMarquee(title) {
1321
+ const frame = (0, import_react2.useRef)(0);
1322
+ const revealing = (0, import_react2.useRef)(false);
1323
+ (0, import_react2.useEffect)(() => () => {
1324
+ cancelAnimationFrame(frame.current);
1325
+ }, []);
1326
+ return (0, import_react2.useMemo)(() => ({
1327
+ enter: (event) => {
1328
+ if (event?.pointerType === "touch") return;
1329
+ if (title.current === null) return;
1330
+ if (revealing.current) return;
1331
+ revealing.current = true;
1332
+ const element = title.current;
1333
+ const range = element.scrollWidth - element.clientWidth;
1334
+ if (range <= MIN_TITLE_REVEAL_PX) return;
1335
+ if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
1336
+ placeTitle(element, range, range);
1337
+ return;
1338
+ }
1339
+ cancelAnimationFrame(frame.current);
1340
+ let previous;
1341
+ let position = 0;
1342
+ const step = (now) => {
1343
+ position += previous === void 0 ? 0 : (now - previous) * TITLE_MARQUEE_PX_PER_MS;
1344
+ previous = now;
1345
+ placeTitle(element, Math.min(position, range), range);
1346
+ if (position < range) frame.current = requestAnimationFrame(step);
1347
+ };
1348
+ frame.current = requestAnimationFrame(step);
1349
+ },
1350
+ leave: () => {
1351
+ revealing.current = false;
1352
+ cancelAnimationFrame(frame.current);
1353
+ if (title.current === null) return;
1354
+ restTitle(title.current);
1355
+ }
1356
+ }), [title]);
1357
+ }
1358
+ function timeLabel(updatedAt, now, t) {
1359
+ const { unit, n } = (0, import_dsh_client_ui_primitives2.relativeTime)(updatedAt, now);
1360
+ return unit === "now" ? t("time.now") : t(`time.${unit}`, { n });
1361
+ }
1362
+ function hoverTimeLabel(updatedAt, now, t) {
1363
+ const { unit, n } = (0, import_dsh_client_ui_primitives2.relativeTime)(updatedAt, now);
1364
+ return unit === "now" ? t("time.now") : t("time.ago", { t: t(`time.${unit}`, { n }) });
1365
+ }
1366
+ function createdLabel(createdAt, t) {
1367
+ const d = new Date(createdAt);
1368
+ const pad2 = (v) => String(v).padStart(2, "0");
1369
+ const date = t("date.ymd", { y: d.getFullYear(), m: d.getMonth() + 1, d: d.getDate() });
1370
+ return t("hover.created", { time: `${date} ${pad2(d.getHours())}:${pad2(d.getMinutes())}` });
1371
+ }
1372
+ function WorkspaceHoverContent({ label, cwd, createdAt, t }) {
1373
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: Rows_default.hoverContent, children: [
1374
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: Rows_default.hoverTitle, children: label }),
1375
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: Rows_default.hoverPath, children: cwd }),
1376
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: Rows_default.hoverTime, children: createdLabel(createdAt, t) })
1377
+ ] });
1378
+ }
1379
+ function rowHalf(e) {
1380
+ const rect = e.currentTarget.getBoundingClientRect();
1381
+ return e.clientY < rect.top + rect.height / 2 ? "before" : "after";
1382
+ }
1383
+ function ProjectRowItem(props) {
1384
+ const workspaceId = props.group.workspaceId;
1385
+ return workspaceId === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(UngroupedProjectRow, { ...props }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(WorkspaceProjectRow, { ...props, workspaceId });
1386
+ }
1387
+ function UngroupedProjectRow(props) {
1388
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ProjectRow, { ...props, actions: { reorder: false } });
1389
+ }
1390
+ function WorkspaceProjectRow({ workspaceId, ...props }) {
1391
+ const { useWorkspaceAccess } = props;
1392
+ const create = useWorkspaceAccess(workspaceId, "session/create");
1393
+ const actions = {
1394
+ create: create ? () => {
1395
+ props.onCreate(workspaceId);
1396
+ } : void 0,
1397
+ reorder: useWorkspaceAccess(workspaceId, "workspace/insertBefore")
1398
+ };
1399
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ProjectRow, { ...props, actions });
1400
+ }
1401
+ function ProjectRow({
1402
+ group,
1403
+ containsCurrentDescendant = false,
1404
+ onToggle,
1405
+ drag: offeredDrag,
1406
+ home,
1407
+ newShortcut,
1408
+ t,
1409
+ actions,
1410
+ renderFactorySlot,
1411
+ useContextMenuTarget,
1412
+ useContextMenu
1413
+ }) {
1414
+ const { getTriggerProps } = useContextMenu();
1415
+ const drag = actions.reorder ? offeredDrag : void 0;
1416
+ const create = actions.create;
1417
+ const row = group;
1418
+ const label = row.workspaceId === void 0 ? t("group.ungrouped") : row.label;
1419
+ const active = containsCurrentDescendant || group.expanded && group.containsCurrent;
1420
+ const menuOpen = useContextMenuTarget((target) => target?.kind === "workspace" && target.value.workspaceId === row.workspaceId);
1421
+ const dragPreview = (0, import_dsh_client_ui_primitives2.useRowDragPreview)(Rows_default.dragPreview, DRAG_PREVIEW_PROPERTIES);
1422
+ const workspaceMenuTarget = row.workspaceId !== void 0 && row.cwd !== void 0 ? { workspaceId: row.workspaceId, path: row.cwd } : void 0;
1423
+ const ownRow = /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
1424
+ "div",
1425
+ {
1426
+ className: clsx_default(Rows_default.projectRow, menuOpen && Rows_default.menuOpen),
1427
+ "data-row-key": `workspace:${group.key}`,
1428
+ role: "treeitem",
1429
+ "aria-expanded": row.expanded,
1430
+ onClick: onToggle,
1431
+ ...getTriggerProps(workspaceMenuTarget === void 0 ? void 0 : { kind: "workspace", value: { ...workspaceMenuTarget, displayTitle: label } }),
1432
+ draggable: drag !== void 0,
1433
+ onDragStart: drag === void 0 ? void 0 : (e) => {
1434
+ e.dataTransfer.effectAllowed = "move";
1435
+ e.dataTransfer.setData("text/plain", row.key);
1436
+ drag.start();
1437
+ dragPreview.start(e);
1438
+ },
1439
+ onDragEnd: () => {
1440
+ if (dragPreview.clear()) drag?.end();
1441
+ },
1442
+ children: [
1443
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: clsx_default(Rows_default.slot, Rows_default.folder, active && Rows_default.folderActive), children: row.expanded ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives2.IconFolderOpenRegular, {}) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives2.IconFolderCloseRegular, {}) }),
1444
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: clsx_default(Rows_default.slot, Rows_default.chevron), children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives2.IconTriangleRightFillRegular, { className: clsx_default(Rows_default.arrow, row.expanded && Rows_default.arrowOpen) }) }),
1445
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: Rows_default.projectText, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: Rows_default.title, children: label }) }),
1446
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { className: Rows_default.rowActions, children: [
1447
+ workspaceMenuTarget !== void 0 && renderFactorySlot("contextMenu.button", {
1448
+ target: { kind: "workspace", value: { ...workspaceMenuTarget, displayTitle: label } },
1449
+ label: t("actions.workspace.aria", { name: label }),
1450
+ className: Rows_default.iconButton
1451
+ }),
1452
+ create !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives2.Tooltip, { label: t("actions.newSession"), shortcutKeys: newShortcut?.keys, side: "bottom", align: "end", delayMs: 500, portal: true, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1453
+ "button",
1454
+ {
1455
+ type: "button",
1456
+ className: Rows_default.iconButton,
1457
+ "aria-keyshortcuts": newShortcut?.aria,
1458
+ "aria-label": t("actions.newSession.aria", { name: label }),
1459
+ onClick: (e) => {
1460
+ e.stopPropagation();
1461
+ create();
1462
+ },
1463
+ children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives2.IconNewChatOutlineRegular, { size: 14 })
1464
+ }
1465
+ ) })
1466
+ ] })
1467
+ ]
1468
+ }
1469
+ );
1470
+ if (row.createdAt === void 0) return ownRow;
1471
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1472
+ import_dsh_client_ui_primitives2.HoverCard,
1473
+ {
1474
+ anchor: ownRow,
1475
+ content: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1476
+ WorkspaceHoverContent,
1477
+ {
1478
+ label: row.label,
1479
+ cwd: row.cwd === void 0 ? void 0 : abbreviateHomePath(row.cwd, home),
1480
+ createdAt: row.createdAt,
1481
+ t
1482
+ }
1483
+ ),
1484
+ openDelayMs: 800,
1485
+ grouped: true,
1486
+ disabled: menuOpen,
1487
+ copyText: row.cwd,
1488
+ copyLabel: t("copy"),
1489
+ copiedLabel: t("hover.copied")
1490
+ }
1491
+ );
1492
+ }
1493
+ function TimeBucketRowItem({ label, count, expanded, onToggle, rowKey }) {
1494
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
1495
+ "div",
1496
+ {
1497
+ className: clsx_default(Rows_default.projectRow, Rows_default.bucketRow),
1498
+ "data-row-key": `bucket:${rowKey}`,
1499
+ role: "treeitem",
1500
+ "aria-expanded": expanded,
1501
+ onClick: onToggle,
1502
+ children: [
1503
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: clsx_default(Rows_default.slot, Rows_default.chevron), children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives2.IconTriangleRightFillRegular, { className: clsx_default(Rows_default.arrow, expanded && Rows_default.arrowOpen) }) }),
1504
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: Rows_default.projectText, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: Rows_default.title, children: label }) }),
1505
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: Rows_default.meta, children: count })
1506
+ ]
1507
+ }
1508
+ );
1509
+ }
1510
+ function assertNever2(value) {
1511
+ throw new Error(`unknown pending interaction: ${String(value)}`);
1512
+ }
1513
+ function sessionStatuses(node, t) {
1514
+ const subagents = node.runningSubagentCount === 0 ? void 0 : {
1515
+ state: "ongoing",
1516
+ label: t(
1517
+ node.runningSubagentCount === 1 ? "status.subagentsRunning.one" : "status.subagentsRunning.other",
1518
+ { n: node.runningSubagentCount }
1519
+ )
1520
+ };
1521
+ let pending;
1522
+ switch (node.pendingInteraction) {
1523
+ case "approval":
1524
+ pending = {
1525
+ state: "warning",
1526
+ label: t("status.waitingApproval"),
1527
+ trailingLabel: t("status.compact.approval")
1528
+ };
1529
+ break;
1530
+ case "plan-review":
1531
+ pending = {
1532
+ state: "warning",
1533
+ label: t("status.planReview"),
1534
+ trailingLabel: t("status.compact.planReview")
1535
+ };
1536
+ break;
1537
+ case "question":
1538
+ pending = {
1539
+ state: "warning",
1540
+ label: t("status.waitingAnswer"),
1541
+ trailingLabel: t("status.compact.answer")
1542
+ };
1543
+ break;
1544
+ case void 0:
1545
+ break;
1546
+ /* v8 ignore next -- closed PendingInteractionStatus union */
1547
+ default:
1548
+ return assertNever2(node.pendingInteraction);
1549
+ }
1550
+ if (pending !== void 0) return subagents === void 0 ? [pending] : [pending, subagents];
1551
+ if (node.running) {
1552
+ const primary = { state: "ongoing", label: t("status.running") };
1553
+ return subagents === void 0 ? [primary] : [primary, subagents];
1554
+ }
1555
+ if (subagents !== void 0) return [subagents];
1556
+ if (node.completed) return [{ state: "done", label: t("status.completed") }];
1557
+ return [{ state: "idle", label: t("status.idle") }];
1558
+ }
1559
+ function SessionStatusDots({ statuses }) {
1560
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
1561
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives2.StateDot, { state: statuses[0].state }),
1562
+ statuses.map((status) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: Rows_default.visuallyHidden, children: status.label }, status.label))
1563
+ ] });
1564
+ }
1565
+ function PinnedIndicator({ t }) {
1566
+ const label = t("row.pinned");
1567
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: Rows_default.pinIndicator, role: "img", "aria-label": label, title: label, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives2.IconPinFillRegular, { size: 14 }) });
1568
+ }
1569
+ function SessionHoverContent({ node, cwd, now, renderSlot, t }) {
1570
+ const statuses = sessionStatuses(node, t).filter((status) => !(node.archived && (status.state === "done" || status.state === "idle")));
1571
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: Rows_default.hoverContent, children: [
1572
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: Rows_default.hoverTitle, children: displayTitle(node, t) }),
1573
+ cwd !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: Rows_default.hoverPath, children: cwd }),
1574
+ !node.blank && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: Rows_default.hoverTime, children: hoverTimeLabel(node.updatedAt, now, t) }),
1575
+ renderSlot("sidebar.session.row.hover", { sessionId: node.id }),
1576
+ statuses.map((status) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: Rows_default.hoverStatus, children: [
1577
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives2.StateDot, { state: status.state }),
1578
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: status.label })
1579
+ ] }, status.label)),
1580
+ node.archived && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: clsx_default(Rows_default.hoverStatus, Rows_default.hoverArchived), children: [
1581
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives2.IconArchiveOutlineRegular, { size: 14 }),
1582
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: t("row.archived") })
1583
+ ] })
1584
+ ] });
1585
+ }
1586
+ function SearchResultItem({
1587
+ result,
1588
+ currentId,
1589
+ onOpen,
1590
+ onUnarchive,
1591
+ useSessionAccess,
1592
+ t
1593
+ }) {
1594
+ const selected = result.id === currentId;
1595
+ const canUnarchive = useSessionAccess(result.id, "workspace/unarchiveSession");
1596
+ const statuses = sessionStatuses(result, t);
1597
+ const primaryStatus = statuses[0];
1598
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
1599
+ "div",
1600
+ {
1601
+ className: clsx_default(Rows_default.searchResultRow, selected && Rows_default.selected, result.archived && Rows_default.archived),
1602
+ role: "treeitem",
1603
+ "aria-selected": selected,
1604
+ "aria-description": result.archived ? t("toast.archivedNotOpenable") : void 0,
1605
+ onClick: () => {
1606
+ onOpen(result.id);
1607
+ },
1608
+ children: [
1609
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { className: Rows_default.searchResultHeading, children: [
1610
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: Rows_default.slot, children: !result.archived && primaryStatus.state !== "idle" && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(SessionStatusDots, { statuses }) }),
1611
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: Rows_default.searchResultTitle, children: result.title || t("session.untitled") }),
1612
+ result.archived && canUnarchive && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: Rows_default.rowActions, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives2.Tooltip, { label: t("actions.unarchive"), side: "bottom", align: "end", delayMs: 500, portal: true, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1613
+ "button",
1614
+ {
1615
+ type: "button",
1616
+ className: Rows_default.iconButton,
1617
+ "aria-label": t("menu.unarchiveSession"),
1618
+ onClick: (e) => {
1619
+ e.stopPropagation();
1620
+ onUnarchive(result.id);
1621
+ },
1622
+ children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives2.IconUnarchiveOutlineRegular, { size: 14 })
1623
+ }
1624
+ ) }) })
1625
+ ] }),
1626
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { className: Rows_default.searchResultMeta, children: [
1627
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: Rows_default.searchResultWorkspace, children: result.workspace || t("group.ungrouped") }),
1628
+ result.snippet !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: Rows_default.searchResultSnippet, children: result.snippet })
1629
+ ] })
1630
+ ]
1631
+ }
1632
+ );
1633
+ }
1634
+ function SessionNodeItem({
1635
+ node,
1636
+ currentId,
1637
+ now,
1638
+ onOpen,
1639
+ onRenameRequest,
1640
+ renderSlot,
1641
+ renderFactorySlot,
1642
+ useContextMenuTarget,
1643
+ useContextMenu,
1644
+ onReveal,
1645
+ drag,
1646
+ home,
1647
+ useSessionAccess,
1648
+ t,
1649
+ workspaceLabel: workspaceLabel2
1650
+ }) {
1651
+ const { getTriggerProps } = useContextMenu();
1652
+ const row = node;
1653
+ const title = displayTitle(node, t);
1654
+ const selected = node.id === currentId;
1655
+ const statuses = sessionStatuses(node, t);
1656
+ const primaryStatus = statuses[0];
1657
+ const showStatus = primaryStatus.state !== "idle";
1658
+ const renamable = useSessionAccess(node.id, "session/rename");
1659
+ const reorderable = useSessionAccess(node.id, "workspace/insertSessionBefore");
1660
+ const draggable = drag !== void 0 && reorderable && !row.blank && !row.archived;
1661
+ const menuOpen = useContextMenuTarget((target) => target?.kind === "session" && target.value.sessionId === node.id);
1662
+ const dragPreview = (0, import_dsh_client_ui_primitives2.useRowDragPreview)(Rows_default.dragPreview, DRAG_PREVIEW_PROPERTIES);
1663
+ const rowRef = (0, import_react2.useRef)(null);
1664
+ const titleRef = (0, import_react2.useRef)(null);
1665
+ const renameArmed = (0, import_react2.useRef)(false);
1666
+ const disarmRename = (0, import_react2.useRef)(() => {
1667
+ renameArmed.current = false;
1668
+ }).current;
1669
+ const marquee = useTitleMarquee(titleRef);
1670
+ (0, import_react2.useEffect)(() => {
1671
+ if (menuOpen || rowRef.current?.matches(":hover")) marquee.enter();
1672
+ else marquee.leave();
1673
+ }, [menuOpen, marquee]);
1674
+ (0, import_react2.useEffect)(() => {
1675
+ if (onReveal === void 0) return;
1676
+ rowRef.current?.scrollIntoView({ block: "nearest" });
1677
+ onReveal();
1678
+ }, [onReveal]);
1679
+ const ownRow = /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
1680
+ "div",
1681
+ {
1682
+ ref: rowRef,
1683
+ "data-row-key": `session:${node.id}`,
1684
+ className: clsx_default(
1685
+ Rows_default.sessionRow,
1686
+ selected && Rows_default.selected,
1687
+ menuOpen && Rows_default.menuOpen,
1688
+ row.archived && Rows_default.archived,
1689
+ drag?.marker === "before" && Rows_default.dropBefore,
1690
+ drag?.marker === "after" && Rows_default.dropAfter
1691
+ ),
1692
+ role: "treeitem",
1693
+ "aria-selected": selected,
1694
+ "aria-description": row.archived ? t("toast.archivedNotOpenable") : void 0,
1695
+ tabIndex: 0,
1696
+ onClick: () => {
1697
+ onOpen(node.id);
1698
+ },
1699
+ ...getTriggerProps(row.blank ? void 0 : { kind: "session", value: { sessionId: node.id, displayTitle: row.title } }, { onKeyDown: (event) => {
1700
+ if (event.target !== event.currentTarget || event.key !== "Enter" && event.key !== " ") return;
1701
+ if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) return;
1702
+ event.preventDefault();
1703
+ onOpen(node.id);
1704
+ } }),
1705
+ onPointerEnter: marquee.enter,
1706
+ onPointerLeave: () => {
1707
+ if (!menuOpen) marquee.leave();
1708
+ },
1709
+ draggable,
1710
+ onDragStart: !draggable ? void 0 : (e) => {
1711
+ e.dataTransfer.effectAllowed = "move";
1712
+ e.dataTransfer.setData("text/plain", node.id);
1713
+ drag.start();
1714
+ dragPreview.start(e);
1715
+ },
1716
+ onDragEnd: () => {
1717
+ if (dragPreview.clear()) drag?.end();
1718
+ },
1719
+ onDragOver: drag === void 0 ? void 0 : (e) => {
1720
+ if (!drag.active) return;
1721
+ e.preventDefault();
1722
+ e.dataTransfer.dropEffect = "move";
1723
+ drag.hover(rowHalf(e));
1724
+ },
1725
+ onDrop: drag === void 0 ? void 0 : (e) => {
1726
+ if (!drag.active) return;
1727
+ e.preventDefault();
1728
+ drag.drop(rowHalf(e));
1729
+ },
1730
+ children: [
1731
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: Rows_default.slot, children: !row.archived && !row.blank && (showStatus ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(SessionStatusDots, { statuses }) : renderSlot("sidebar.session.row.leading", { sessionId: node.id })) }),
1732
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1733
+ "span",
1734
+ {
1735
+ ref: titleRef,
1736
+ className: Rows_default.title,
1737
+ onMouseDown: (e) => {
1738
+ if (e.detail !== 1) return;
1739
+ renameArmed.current = true;
1740
+ window.addEventListener("blur", disarmRename, { once: true });
1741
+ },
1742
+ onDoubleClick: row.blank || !renamable ? void 0 : (e) => {
1743
+ e.stopPropagation();
1744
+ if (!renameArmed.current) return;
1745
+ renameArmed.current = false;
1746
+ onRenameRequest(node.id, row.title);
1747
+ },
1748
+ children: title
1749
+ }
1750
+ ),
1751
+ !row.blank && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { className: Rows_default.rowResting, children: [
1752
+ workspaceLabel2 !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: Rows_default.workspaceChip, title: workspaceLabel2, children: workspaceLabel2 }),
1753
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1754
+ "span",
1755
+ {
1756
+ className: clsx_default(Rows_default.time, primaryStatus.trailingLabel === void 0 && Rows_default.timestamp),
1757
+ "aria-hidden": primaryStatus.trailingLabel === void 0 ? void 0 : true,
1758
+ children: primaryStatus.trailingLabel ?? timeLabel(row.updatedAt, now, t)
1759
+ }
1760
+ ),
1761
+ renderSlot("sidebar.session.row.trailing", { sessionId: node.id }),
1762
+ row.pinned && !row.archived && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(PinnedIndicator, { t })
1763
+ ] }),
1764
+ !row.blank && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { className: Rows_default.rowActions, onClick: (e) => {
1765
+ e.stopPropagation();
1766
+ }, children: [
1767
+ renderFactorySlot("contextMenu.button", {
1768
+ target: { kind: "session", value: { sessionId: node.id, displayTitle: row.title } },
1769
+ label: t("actions.session.aria", { name: title }),
1770
+ className: Rows_default.iconButton
1771
+ }),
1772
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: Rows_default.rowQuickActions, children: renderSlot("sidebar.workspaces.session.row.action", { sessionId: node.id, displayTitle: row.title }) })
1773
+ ] })
1774
+ ]
1775
+ }
1776
+ );
1777
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1778
+ import_dsh_client_ui_primitives2.HoverCard,
1779
+ {
1780
+ anchor: ownRow,
1781
+ content: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1782
+ SessionHoverContent,
1783
+ {
1784
+ node,
1785
+ cwd: row.cwd === void 0 ? void 0 : abbreviateHomePath(row.cwd, home),
1786
+ now,
1787
+ renderSlot,
1788
+ t
1789
+ }
1790
+ ),
1791
+ openDelayMs: 800,
1792
+ grouped: true,
1793
+ disabled: menuOpen || drag?.active === true,
1794
+ copyText: row.blank || row.title === "" ? void 0 : row.title,
1795
+ copyLabel: t("copy"),
1796
+ copiedLabel: t("hover.copied")
1797
+ }
1798
+ );
1799
+ }
1800
+
1801
+ // src/browser/stores.ts
1802
+ var import_dsh_client_store = require("@deepseek-ai/dsh-client-store");
1803
+ var FLAT_SESSION_ORDER_KEY = "__flat_session_order__";
1804
+
1805
+ // src/browser/WorkspacePicker.tsx
1806
+ var import_react3 = require("react");
1807
+ var import_dsh_client_ui_primitives3 = require("@deepseek-ai/dsh-client-ui-primitives");
1808
+
1809
+ // src/browser/path-suffix.ts
1810
+ function distinguishingPathSuffixes(workspaces) {
1811
+ const rows = workspaces.map((workspace) => ({ ...workspace, parts: workspace.path.split(/([\\/])/) }));
1812
+ const suffix = (parts, count) => parts.slice(-(2 * count - 1)).join("");
1813
+ const suffixes = /* @__PURE__ */ new Map();
1814
+ for (const row of rows) {
1815
+ const peers = rows.filter((other) => other !== row && other.title === row.title);
1816
+ if (peers.length === 0) continue;
1817
+ let count = 1;
1818
+ while (2 * count - 1 < row.parts.length && (suffix(row.parts, count) === "" || peers.some((peer) => suffix(peer.parts, count) === suffix(row.parts, count)))) count++;
1819
+ suffixes.set(row.id, suffix(row.parts, count));
1820
+ }
1821
+ return suffixes;
1822
+ }
1823
+
1824
+ // src/browser/WorkspacePicker.module.css
1825
+ var WorkspacePicker_default = {
1826
+ modalAction: "WorkspacePicker_modalAction",
1827
+ modalError: "WorkspacePicker_modalError",
1828
+ menuStatus: "WorkspacePicker_menuStatus",
1829
+ pathSuffix: "WorkspacePicker_pathSuffix",
1830
+ disambiguated: "WorkspacePicker_disambiguated",
1831
+ title: "WorkspacePicker_title"
1832
+ };
1833
+
1834
+ // src/browser/WorkspacePicker.tsx
1835
+ var import_jsx_runtime3 = require("react/jsx-runtime");
1836
+ var ADD_WORKSPACE = "::add-workspace";
1837
+ function WorkspacePickFlow({
1838
+ t,
1839
+ open,
1840
+ anchorRef,
1841
+ useWorkspaces,
1842
+ createWorkspace,
1843
+ useDirectoryFlow,
1844
+ renderDirectoryFlow,
1845
+ onPick,
1846
+ onClose,
1847
+ addOnly = false,
1848
+ onBusyChange,
1849
+ side = "bottom",
1850
+ selectedId
1851
+ }) {
1852
+ const absentAnchor = (0, import_react3.useRef)(null);
1853
+ const workspaceSnapshot = useWorkspaces((state) => state);
1854
+ const workspaces = workspaceSnapshot.items;
1855
+ const [errorOpen, setErrorOpen] = (0, import_react3.useState)(false);
1856
+ const [modalError, setModalError] = (0, import_react3.useState)(null);
1857
+ const [flowOpen, setFlowOpen] = (0, import_react3.useState)(false);
1858
+ const [pickingFolder, setPickingFolder] = (0, import_react3.useState)(false);
1859
+ const flowBusy = flowOpen || pickingFolder;
1860
+ (0, import_react3.useEffect)(() => {
1861
+ onBusyChange?.(flowBusy);
1862
+ }, [flowBusy, onBusyChange]);
1863
+ const flowAvailable = useDirectoryFlow((occupied) => occupied);
1864
+ (0, import_react3.useEffect)(() => {
1865
+ if (flowOpen && !flowAvailable) setFlowOpen(false);
1866
+ }, [flowOpen, flowAvailable]);
1867
+ const addEntries = flowAvailable ? [{ id: ADD_WORKSPACE, label: t("menu.addWorkspace"), icon: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_dsh_client_ui_primitives3.IconPlusOutlineRegular, { size: 16 }), disabled: flowBusy }] : [];
1868
+ const pinAdd = !addOnly && workspaces.length > 0;
1869
+ const defaultWorkspaceName = t("workspace.defaultName");
1870
+ const listed = (0, import_react3.useMemo)(() => {
1871
+ if (!pinAdd) return [];
1872
+ const rows = workspaces.map((workspace) => ({
1873
+ id: workspace.workspaceId,
1874
+ title: workspaceDisplayTitle(workspace.title, defaultWorkspaceName),
1875
+ path: workspace.path
1876
+ }));
1877
+ const suffixes = distinguishingPathSuffixes(rows);
1878
+ return rows.map((row) => ({ ...row, suffix: suffixes.get(row.id) }));
1879
+ }, [pinAdd, workspaces, defaultWorkspaceName]);
1880
+ const items = pinAdd ? listed.map(({ id, title, path, suffix }) => ({
1881
+ id,
1882
+ // The title gives way first, so the suffix that tells the rows apart
1883
+ // stays visible; the native tooltip carries the full path.
1884
+ label: suffix === void 0 ? title : /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { className: WorkspacePicker_default.disambiguated, title: path, children: [
1885
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: WorkspacePicker_default.title, children: title }),
1886
+ " ",
1887
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: WorkspacePicker_default.pathSuffix, children: suffix })
1888
+ ] }),
1889
+ icon: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_dsh_client_ui_primitives3.IconFolderCloseRegular, { size: 16 }),
1890
+ disabled: flowBusy
1891
+ })) : addEntries;
1892
+ const menuIsEmpty = items.length === 0;
1893
+ const closeModal = () => {
1894
+ setErrorOpen(false);
1895
+ setModalError(null);
1896
+ };
1897
+ const adoptDirectory = (path) => createWorkspace({ path }).then((workspace) => {
1898
+ setFlowOpen(false);
1899
+ onPick(workspace.workspaceId);
1900
+ }).catch((reason) => {
1901
+ setModalError(reason instanceof Error ? reason.message : String(reason));
1902
+ setFlowOpen(false);
1903
+ setErrorOpen(true);
1904
+ });
1905
+ const openDirectoryFlow = (0, import_react3.useCallback)(() => {
1906
+ onClose();
1907
+ setErrorOpen(false);
1908
+ setModalError(null);
1909
+ setFlowOpen(true);
1910
+ }, [onClose]);
1911
+ const listSettled = addOnly || workspaceSnapshot.phase === "ready";
1912
+ const addIsTheOnlyEntry = !pinAdd && listSettled && addEntries.length === 1;
1913
+ (0, import_react3.useEffect)(() => {
1914
+ if (open && addIsTheOnlyEntry && !flowBusy) openDirectoryFlow();
1915
+ }, [open, addIsTheOnlyEntry, flowBusy, openDirectoryFlow]);
1916
+ const flowOwner = {
1917
+ open: flowOpen,
1918
+ busy: pickingFolder,
1919
+ onPicked: (path) => {
1920
+ setPickingFolder(true);
1921
+ void adoptDirectory(path).finally(() => {
1922
+ setPickingFolder(false);
1923
+ });
1924
+ },
1925
+ onCancel: () => {
1926
+ setFlowOpen(false);
1927
+ },
1928
+ onError: (message) => {
1929
+ setFlowOpen(false);
1930
+ setModalError(message);
1931
+ setErrorOpen(true);
1932
+ }
1933
+ };
1934
+ const handleSelect = (id) => {
1935
+ if (id === ADD_WORKSPACE) {
1936
+ openDirectoryFlow();
1937
+ return;
1938
+ }
1939
+ onPick(id);
1940
+ };
1941
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
1942
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1943
+ import_dsh_client_ui_primitives3.Menu,
1944
+ {
1945
+ open: open && !addIsTheOnlyEntry && !menuIsEmpty,
1946
+ anchor: null,
1947
+ items,
1948
+ ...pinAdd ? { footer: addEntries } : {},
1949
+ selectedId,
1950
+ onSelect: handleSelect,
1951
+ onClose,
1952
+ side,
1953
+ portal: true,
1954
+ anchorRef: anchorRef ?? absentAnchor
1955
+ }
1956
+ ),
1957
+ open && !addIsTheOnlyEntry && !menuIsEmpty && workspaceSnapshot.phase === "pending" && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: WorkspacePicker_default.menuStatus, role: "status", children: t("picker.loading") }),
1958
+ renderDirectoryFlow(flowOwner),
1959
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1960
+ import_dsh_client_ui_primitives3.Modal,
1961
+ {
1962
+ open: errorOpen,
1963
+ onClose: closeModal,
1964
+ closeLabel: t("close"),
1965
+ title: t("folderError.title"),
1966
+ footer: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
1967
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_dsh_client_ui_primitives3.Button, { variant: "outline", className: WorkspacePicker_default.modalAction, onClick: closeModal, children: t("cancel") }),
1968
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_dsh_client_ui_primitives3.Button, { variant: "primary", className: WorkspacePicker_default.modalAction, disabled: !flowAvailable, onClick: openDirectoryFlow, children: t("folderError.retry") })
1969
+ ] }),
1970
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: WorkspacePicker_default.modalError, role: "alert", children: modalError })
1971
+ }
1972
+ )
1973
+ ] });
1974
+ }
1975
+
1976
+ // src/browser/rows/WorkspaceBrowser.tsx
1977
+ var import_jsx_runtime4 = require("react/jsx-runtime");
1978
+ var EXPAND_SLIDE_MS = 300;
1979
+ var SEARCH_DEBOUNCE_MS = 250;
1980
+ var SEARCH_QUERY_MAX_CODE_UNITS = 500;
1981
+ var SESSION_WATERMARK_BASE = 5;
1982
+ var SESSION_WATERMARK_AUTO_MAX = 50;
1983
+ function watermarkRows(sessions, watermark) {
1984
+ let count = 0;
1985
+ const rows = sessions.filter((session) => {
1986
+ if (session.blank) return true;
1987
+ count += 1;
1988
+ return count <= watermark;
1989
+ });
1990
+ return { rows, hiddenCount: sessions.length - rows.length };
1991
+ }
1992
+ function requiredWatermark(sessions, current, revealSessionId) {
1993
+ let index = 0;
1994
+ let required = 0;
1995
+ for (const session of sessions) {
1996
+ if (session.blank) continue;
1997
+ index += 1;
1998
+ const attention = index <= SESSION_WATERMARK_AUTO_MAX && (session.running || session.runningSubagentCount > 0 || session.pendingInteraction !== void 0 || session.completed || session.id === current);
1999
+ if (attention || session.id === revealSessionId) required = index;
2000
+ }
2001
+ return required;
2002
+ }
2003
+ function raiseWatermarks(marks, required) {
2004
+ let raised = marks;
2005
+ for (const [key, watermark] of required) {
2006
+ if (watermark > (raised[key] ?? SESSION_WATERMARK_BASE)) raised = { ...raised, [key]: watermark };
2007
+ }
2008
+ return raised;
2009
+ }
2010
+ function sanitizeSearchQuery(value) {
2011
+ const withoutNul = value.replaceAll("\0", "");
2012
+ if (withoutNul.length <= SEARCH_QUERY_MAX_CODE_UNITS) return withoutNul;
2013
+ let end = SEARCH_QUERY_MAX_CODE_UNITS;
2014
+ const last = withoutNul.charCodeAt(end - 1);
2015
+ const next = withoutNul.charCodeAt(end);
2016
+ if (last >= 55296 && last <= 56319 && next >= 56320 && next <= 57343) end--;
2017
+ return withoutNul.slice(0, end);
2018
+ }
2019
+ function useNativeDragAcceptance(active) {
2020
+ (0, import_react4.useEffect)(() => {
2021
+ if (!active) return;
2022
+ const acceptDrag = (event) => {
2023
+ event.preventDefault();
2024
+ if (event.dataTransfer !== null) event.dataTransfer.dropEffect = "move";
2025
+ };
2026
+ const acceptDrop = (event) => {
2027
+ event.preventDefault();
2028
+ };
2029
+ document.addEventListener("dragover", acceptDrag);
2030
+ document.addEventListener("drop", acceptDrop);
2031
+ return () => {
2032
+ document.removeEventListener("dragover", acceptDrag);
2033
+ document.removeEventListener("drop", acceptDrop);
2034
+ };
2035
+ }, [active]);
2036
+ }
2037
+ function ViewOptionsMenu({ groupBy, orderBy, archivedFilter, onGroupPick, onOrderPick, onArchivedFilterPick, t }) {
2038
+ const [open, setOpen] = (0, import_react4.useState)(false);
2039
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
2040
+ import_dsh_client_ui_primitives4.Menu,
2041
+ {
2042
+ open,
2043
+ onClose: () => {
2044
+ setOpen(false);
2045
+ },
2046
+ items: [
2047
+ { type: "label", id: "group-by", text: t("groupBy.label") },
2048
+ { id: "workspace", label: t("groupBy.workspace"), icon: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives4.IconFolderCloseRegular, {}) },
2049
+ { id: "workspace-tree", label: t("groupBy.workspaceTree"), icon: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives4.IconWorkspaceTreeOutlineRegular, {}) },
2050
+ { id: "flat", label: t("groupBy.flat"), icon: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives4.IconFlatListOutlineRegular, {}) },
2051
+ { id: "time", label: t("groupBy.time"), icon: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives4.IconClockOutlineRegular, {}) },
2052
+ { type: "separator", id: "order-by-separator" },
2053
+ { type: "label", id: "order-by", text: t("orderBy.label") },
2054
+ { id: "manual", label: t("orderBy.manual"), icon: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives4.IconChevronsUpDownOutlineRegular, {}) },
2055
+ { id: "updated", label: t("orderBy.updated"), icon: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives4.IconClockOutlineRegular, {}) },
2056
+ { type: "separator", id: "archived-filter-separator" },
2057
+ { type: "label", id: "filter-by", text: t("filterBy.label") },
2058
+ { id: "hide-archived", label: t("viewOptions.hideArchived"), icon: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives4.IconArchiveOffOutlineRegular, {}) },
2059
+ { id: "show-archived", label: t("viewOptions.showArchived"), icon: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives4.IconQueueOutlineRegular, {}) },
2060
+ { id: "only-archived", label: t("viewOptions.onlyArchived"), icon: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives4.IconArchiveCheckOutlineRegular, {}) }
2061
+ ],
2062
+ selectedIds: [
2063
+ groupBy,
2064
+ orderBy,
2065
+ { default: "hide-archived", show: "show-archived", only: "only-archived" }[archivedFilter]
2066
+ ],
2067
+ onSelect: (id) => {
2068
+ if (id === "workspace" || id === "workspace-tree" || id === "flat" || id === "time") onGroupPick(id);
2069
+ else if (id === "manual" || id === "updated") onOrderPick(id);
2070
+ else if (id === "hide-archived") onArchivedFilterPick("default");
2071
+ else if (id === "show-archived") onArchivedFilterPick("show");
2072
+ else if (id === "only-archived") onArchivedFilterPick("only");
2073
+ setOpen(false);
2074
+ },
2075
+ align: "end",
2076
+ dense: true,
2077
+ listClassName: WorkspaceBrowser_default.viewOptionsMenu,
2078
+ portal: true,
2079
+ anchor: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives4.Tooltip, { label: t("viewOptions.label"), side: "bottom", delayMs: 500, portal: true, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
2080
+ "button",
2081
+ {
2082
+ type: "button",
2083
+ className: clsx_default(WorkspaceBrowser_default.iconButton, WorkspaceBrowser_default.wide),
2084
+ "aria-label": t("viewOptions.label"),
2085
+ onClick: () => {
2086
+ setOpen((v) => !v);
2087
+ },
2088
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives4.IconSlidersTwoOutlineRegular, {})
2089
+ }
2090
+ ) })
2091
+ }
2092
+ );
2093
+ }
2094
+ function sessionDragOrder(order, rows, drag, over) {
2095
+ const source = rows.find((row) => row.id === drag.sessionId);
2096
+ const target = rows.find((row) => row.id === over.id);
2097
+ if (source === void 0 || target === void 0 || source.blank || source.pinned !== drag.pinned || target.pinned !== drag.pinned || source.id === target.id || !order.includes(source.id)) return;
2098
+ const section = rows.filter((row) => row.pinned === drag.pinned);
2099
+ const sourceIndex = section.findIndex((row) => row.id === source.id);
2100
+ const withoutSource = section.filter((row) => row.id !== source.id);
2101
+ const insertAt = withoutSource.findIndex((row) => row.id === target.id) + (over.half === "after" ? 1 : 0);
2102
+ if (insertAt === sourceIndex) return;
2103
+ const next = order.filter((id) => id !== source.id);
2104
+ const targetIndex = next.indexOf(target.id);
2105
+ if (targetIndex === -1) return;
2106
+ next.splice(targetIndex + (over.half === "after" ? 1 : 0), 0, source.id);
2107
+ return pinCurrentBlank(next, rows.find((row) => row.blank)?.id);
2108
+ }
2109
+ function workspaceGroupHalf(e) {
2110
+ const rect = e.currentTarget.getBoundingClientRect();
2111
+ return e.clientY < rect.top + rect.height / 2 ? "before" : "after";
2112
+ }
2113
+ function EmptySessions({ rowState, statusFilter, onLeaveArchivedOnly, t }) {
2114
+ const archivedOnly = rowState.archivedFilter === "only";
2115
+ const filtered = !archivedOnly && statusFilter !== void 0 && statusFilter !== "all";
2116
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: WorkspaceBrowser_default.emptyState, "data-row-key": "empty", children: [
2117
+ archivedOnly ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives4.IconArchiveOutlineRegular, { size: 24 }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives4.IconQueueOutlineRegular, { size: 24 }),
2118
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { children: archivedOnly ? t("empty.noneArchived") : filtered ? t("empty.noMatches") : t("empty.none") }),
2119
+ archivedOnly && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", className: WorkspaceBrowser_default.emptyAction, onClick: onLeaveArchivedOnly, children: t("empty.viewOthers") })
2120
+ ] });
2121
+ }
2122
+ function SessionTree({
2123
+ list,
2124
+ useSessionStatus,
2125
+ startSession,
2126
+ open,
2127
+ workspaces,
2128
+ ungroupedSessionIds,
2129
+ rowState,
2130
+ onLeaveArchivedOnly,
2131
+ workspaceReady,
2132
+ animationResetKey,
2133
+ usePanelInfo,
2134
+ useSessionAccess,
2135
+ useWorkspaceAccess,
2136
+ onSessionRenameRequest,
2137
+ renderSlot,
2138
+ renderFactorySlot,
2139
+ useContextMenuTarget,
2140
+ useContextMenu,
2141
+ insertWorkspaceBefore,
2142
+ nestWorkspaces,
2143
+ groupExpansion,
2144
+ setGroupExpanded,
2145
+ statusFilter,
2146
+ setSessionOrder,
2147
+ home,
2148
+ t,
2149
+ revealSessionId,
2150
+ onSessionRevealed,
2151
+ shortcuts
2152
+ }) {
2153
+ const panelActive = usePanelInfo((info) => info.activePanelId !== null);
2154
+ const statuses = useSessionStatus((s) => s);
2155
+ const current = panelActive ? void 0 : Object.values(list.byId).find((session) => (session.retainedBy.mainView ?? 0) > 0)?.id;
2156
+ const revealGroup = revealSessionId === void 0 || !workspaceReady ? void 0 : owningGroupKey(workspaces, revealSessionId);
2157
+ const [storedWatermarks, setStoredWatermarks] = (0, import_react4.useState)({});
2158
+ const [watermarkMotionKey, setWatermarkMotionKey] = (0, import_react4.useState)(0);
2159
+ const [drag, setDrag] = (0, import_react4.useState)(null);
2160
+ const sessionDropCommitted = (0, import_react4.useRef)(false);
2161
+ const [workspaceDrag, setWorkspaceDrag] = (0, import_react4.useState)(null);
2162
+ const workspaceDropCommitted = (0, import_react4.useRef)(false);
2163
+ const nativeDragActive = drag !== null || workspaceDrag !== null;
2164
+ useNativeDragAcceptance(nativeDragActive);
2165
+ const currentGroup = current === void 0 || !workspaceReady ? void 0 : owningGroupKey(workspaces, current);
2166
+ (0, import_react4.useEffect)(() => {
2167
+ if (current === void 0 || currentGroup === void 0 || Object.hasOwn(groupExpansion, currentGroup)) return;
2168
+ setGroupExpanded(currentGroup, true);
2169
+ }, [current, currentGroup, setGroupExpanded, groupExpansion]);
2170
+ const parents = (0, import_react4.useMemo)(() => {
2171
+ if (!nestWorkspaces) return /* @__PURE__ */ new Map();
2172
+ const keysByPath = new Map(workspaces.map((workspace) => [workspace.path, workspace.workspaceId]));
2173
+ const paths = [...keysByPath.keys()];
2174
+ return new Map(workspaces.map((workspace) => {
2175
+ const path = owningParentFolder(workspace.path, paths);
2176
+ return [workspace.workspaceId, path === void 0 ? void 0 : keysByPath.get(path)];
2177
+ }));
2178
+ }, [nestWorkspaces, workspaces]);
2179
+ const currentAncestors = (0, import_react4.useMemo)(() => {
2180
+ const keys = /* @__PURE__ */ new Set();
2181
+ for (let key = currentGroup === void 0 ? void 0 : parents.get(currentGroup); key !== void 0; key = parents.get(key)) {
2182
+ keys.add(key);
2183
+ }
2184
+ return keys;
2185
+ }, [currentGroup, parents]);
2186
+ const expandedGroups = (0, import_react4.useMemo)(() => {
2187
+ const ancestorKeys = new Set(parents.values());
2188
+ return [...workspaces.map((workspace) => workspace.workspaceId), UNGROUPED_KEY].filter((key) => groupExpansion[key] ?? ancestorKeys.has(key));
2189
+ }, [groupExpansion, parents, workspaces]);
2190
+ const groups = (0, import_react4.useMemo)(
2191
+ () => deriveGroups(list, workspaces, rowState, statuses, {
2192
+ expandedGroups,
2193
+ ungroupedOrder: ungroupedSessionIds,
2194
+ statusFilter
2195
+ }),
2196
+ [list, workspaces, rowState, statuses, expandedGroups, statusFilter, ungroupedSessionIds]
2197
+ );
2198
+ (0, import_react4.useEffect)(() => {
2199
+ for (let key = revealGroup; key !== void 0; key = parents.get(key)) {
2200
+ if (groupExpansion[key] === false || key === revealGroup && groupExpansion[key] !== true) {
2201
+ setGroupExpanded(key, true);
2202
+ }
2203
+ }
2204
+ }, [groupExpansion, parents, revealGroup, setGroupExpanded]);
2205
+ const baselines = new Map(groups.map((group) => [group.key, Math.max(SESSION_WATERMARK_BASE, requiredWatermark(
2206
+ group.sessions,
2207
+ current,
2208
+ group.key === revealGroup ? revealSessionId : void 0
2209
+ ))]));
2210
+ const foldedKeys = new Set(groups.filter((group) => !group.expanded).map((group) => group.key));
2211
+ const underFoldedAncestor = (key) => {
2212
+ for (let owner = parents.get(key); owner !== void 0; owner = parents.get(owner)) {
2213
+ if (foldedKeys.has(owner)) return true;
2214
+ }
2215
+ return false;
2216
+ };
2217
+ const requiredWatermarks = new Map([...baselines].filter(([key]) => !underFoldedAncestor(key)));
2218
+ const sessionWatermarks = raiseWatermarks(storedWatermarks, requiredWatermarks);
2219
+ if (sessionWatermarks !== storedWatermarks) setStoredWatermarks((marks) => raiseWatermarks(marks, requiredWatermarks));
2220
+ const dropWatermarks = (drop) => {
2221
+ if (!Object.keys(storedWatermarks).some(drop)) return;
2222
+ setStoredWatermarks((marks) => Object.fromEntries(Object.entries(marks).filter(([key]) => !drop(key))));
2223
+ setWatermarkMotionKey((key) => key + 1);
2224
+ };
2225
+ const withinGroup = (key, root) => {
2226
+ for (let owner = key; owner !== void 0; owner = parents.get(owner)) {
2227
+ if (owner === root) return true;
2228
+ }
2229
+ return false;
2230
+ };
2231
+ const now = Date.now();
2232
+ const commitSessionDrag = (activeDrag, over) => {
2233
+ if (sessionDropCommitted.current) return;
2234
+ sessionDropCommitted.current = true;
2235
+ setDrag(null);
2236
+ const group = groups.find((candidate) => candidate.key === activeDrag.accountKey);
2237
+ if (group === void 0) return;
2238
+ if (over.id === activeDrag.sessionId) return;
2239
+ const accountSessionIds = activeDrag.accountKey === UNGROUPED_KEY ? ungroupedSessionIds : workspaces.find((workspace) => workspace.workspaceId === activeDrag.accountKey)?.sessionIds;
2240
+ if (accountSessionIds === void 0) return;
2241
+ const renderedSessions = watermarkRows(group.sessions, sessionWatermarks[group.key] ?? SESSION_WATERMARK_BASE).rows;
2242
+ const nextOrder = sessionDragOrder(accountSessionIds, renderedSessions, activeDrag, over);
2243
+ if (nextOrder !== void 0) setSessionOrder(activeDrag.accountKey, nextOrder);
2244
+ };
2245
+ const commitWorkspaceDrag = (activeDrag, over) => {
2246
+ if (workspaceDropCommitted.current) return;
2247
+ workspaceDropCommitted.current = true;
2248
+ setWorkspaceDrag(null);
2249
+ const owner = parents.get(activeDrag.workspaceId);
2250
+ const siblings = workspaces.filter((workspace) => parents.get(workspace.workspaceId) === owner);
2251
+ const rowIndex = siblings.findIndex((workspace) => workspace.workspaceId === over.id);
2252
+ if (rowIndex === -1) return;
2253
+ const anchor = over.half === "before" ? over.id : siblings[rowIndex + 1]?.workspaceId;
2254
+ if (anchor === activeDrag.workspaceId) return;
2255
+ const sourceIndex = siblings.findIndex((workspace) => workspace.workspaceId === activeDrag.workspaceId);
2256
+ const anchorIndex = anchor === void 0 ? siblings.length : siblings.findIndex((workspace) => workspace.workspaceId === anchor);
2257
+ if (sourceIndex !== -1 && (anchorIndex === sourceIndex || anchorIndex === sourceIndex + 1)) return;
2258
+ insertWorkspaceBefore(activeDrag.workspaceId, anchor).catch((reason) => {
2259
+ console.warn("workspace reorder rejected:", reason);
2260
+ });
2261
+ };
2262
+ const childrenByParent = (0, import_react4.useMemo)(() => {
2263
+ const rendered = new Set(groups.map((group) => group.key));
2264
+ const children = /* @__PURE__ */ new Map();
2265
+ for (const group of groups) {
2266
+ let parent = parents.get(group.key);
2267
+ while (parent !== void 0 && !rendered.has(parent)) parent = parents.get(parent);
2268
+ const siblings = children.get(parent);
2269
+ if (siblings === void 0) children.set(parent, [group]);
2270
+ else siblings.push(group);
2271
+ }
2272
+ return children;
2273
+ }, [groups, parents]);
2274
+ const rootGroups = childrenByParent.get(void 0) ?? [];
2275
+ const workspaceDropAtListStart = rootGroups[0]?.workspaceId !== void 0 && workspaceDrag?.over?.id === rootGroups[0].workspaceId && workspaceDrag.over.half === "before";
2276
+ const rowKeys = groups.length === 0 ? ["empty"] : [];
2277
+ const renderGroup = (group, depth) => {
2278
+ const workspaceId = group.workspaceId;
2279
+ const children = childrenByParent.get(group.key) ?? [];
2280
+ const compatibleDrag = workspaceDrag !== null && parents.get(workspaceDrag.workspaceId) === parents.get(group.key);
2281
+ const watermark = sessionWatermarks[group.key] ?? SESSION_WATERMARK_BASE;
2282
+ const collapsed = watermarkRows(group.sessions, baselines.get(group.key) ?? SESSION_WATERMARK_BASE);
2283
+ const visible = watermarkRows(group.sessions, watermark);
2284
+ const sessionsExpanded = visible.hiddenCount === 0;
2285
+ rowKeys.push(`workspace:${group.key}`);
2286
+ const childRows = group.expanded ? children.map((child) => renderGroup(child, depth + 1)) : [];
2287
+ const sessions = visible.rows;
2288
+ for (const node of sessions) rowKeys.push(`session:${node.id}`);
2289
+ if (collapsed.hiddenCount > 0) rowKeys.push(`overflow:${group.key}`);
2290
+ const workspaceMarker = workspaceId !== void 0 && workspaceDrag?.over?.id === workspaceId ? workspaceDrag.over.half : null;
2291
+ const workspaceDragProps = workspaceId === void 0 ? void 0 : {
2292
+ start: () => {
2293
+ workspaceDropCommitted.current = false;
2294
+ setWorkspaceDrag({ workspaceId, over: null });
2295
+ },
2296
+ end: () => {
2297
+ if (workspaceDrag?.over !== null && workspaceDrag?.over !== void 0) {
2298
+ commitWorkspaceDrag(workspaceDrag, workspaceDrag.over);
2299
+ } else {
2300
+ setWorkspaceDrag(null);
2301
+ }
2302
+ workspaceDropCommitted.current = false;
2303
+ }
2304
+ };
2305
+ const hoverWorkspace = workspaceId === void 0 || !compatibleDrag ? void 0 : (half) => {
2306
+ setWorkspaceDrag((active) => active === null ? active : { ...active, over: { id: workspaceId, half } });
2307
+ };
2308
+ const dropWorkspace = workspaceId === void 0 || !compatibleDrag ? void 0 : (half) => {
2309
+ commitWorkspaceDrag(workspaceDrag, { id: workspaceId, half });
2310
+ };
2311
+ return (
2312
+ // Group section: header, descendant Workspaces, and own Session rows. The
2313
+ // inter-group breathing room is the section's own margin
2314
+ // (WorkspaceBrowser.module.css).
2315
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
2316
+ "div",
2317
+ {
2318
+ style: { "--dsh-workspace-indent": `${depth * 12}px` },
2319
+ className: clsx_default(
2320
+ WorkspaceBrowser_default.groupSection,
2321
+ workspaceMarker === "before" && WorkspaceBrowser_default.workspaceDropBefore,
2322
+ workspaceMarker === "after" && WorkspaceBrowser_default.workspaceDropAfter
2323
+ ),
2324
+ onDragOver: workspaceDrag === null ? void 0 : (e) => {
2325
+ e.preventDefault();
2326
+ if (hoverWorkspace === void 0 && parents.get(group.key) !== void 0) return;
2327
+ e.stopPropagation();
2328
+ if (hoverWorkspace === void 0) {
2329
+ e.dataTransfer.dropEffect = "none";
2330
+ if (workspaceDrag.over !== null) setWorkspaceDrag({ ...workspaceDrag, over: null });
2331
+ } else {
2332
+ e.dataTransfer.dropEffect = "move";
2333
+ hoverWorkspace(workspaceGroupHalf(e));
2334
+ }
2335
+ },
2336
+ onDrop: workspaceDrag === null ? void 0 : (e) => {
2337
+ e.preventDefault();
2338
+ if (dropWorkspace === void 0 && parents.get(group.key) !== void 0) return;
2339
+ e.stopPropagation();
2340
+ if (dropWorkspace === void 0) {
2341
+ workspaceDropCommitted.current = true;
2342
+ setWorkspaceDrag(null);
2343
+ } else {
2344
+ dropWorkspace(workspaceGroupHalf(e));
2345
+ }
2346
+ },
2347
+ children: [
2348
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
2349
+ ProjectRowItem,
2350
+ {
2351
+ newShortcut: shortcuts.find((row) => row.id === "session.new"),
2352
+ group,
2353
+ renderFactorySlot,
2354
+ useContextMenu,
2355
+ useContextMenuTarget,
2356
+ useWorkspaceAccess,
2357
+ containsCurrentDescendant: currentAncestors.has(group.key),
2358
+ home,
2359
+ t,
2360
+ onToggle: () => {
2361
+ if (group.expanded) dropWatermarks((key) => withinGroup(key, group.key));
2362
+ setGroupExpanded(group.key, !group.expanded);
2363
+ },
2364
+ onCreate: (workspaceId2) => {
2365
+ setGroupExpanded(group.key, true);
2366
+ startSession(workspaceId2);
2367
+ },
2368
+ drag: workspaceDragProps
2369
+ }
2370
+ ),
2371
+ childRows.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { role: "group", children: childRows }),
2372
+ sessions.map((node) => {
2373
+ const sameGroupDrag = drag !== null && drag.accountKey === group.key;
2374
+ const compatibleTarget = sameGroupDrag && drag.pinned === node.pinned;
2375
+ const normalizeHalf = (half) => node.blank ? "after" : half;
2376
+ const dragProps = {
2377
+ start: () => {
2378
+ sessionDropCommitted.current = false;
2379
+ setDrag({ accountKey: group.key, sessionId: node.id, pinned: node.pinned, over: null });
2380
+ },
2381
+ active: compatibleTarget,
2382
+ marker: sameGroupDrag && drag.over?.id === node.id ? drag.over.half : null,
2383
+ hover: (half) => {
2384
+ setDrag((d) => d === null ? d : {
2385
+ ...d,
2386
+ over: { id: node.id, half: normalizeHalf(half) }
2387
+ });
2388
+ },
2389
+ drop: (half) => {
2390
+ if (drag === null) return;
2391
+ commitSessionDrag(drag, { id: node.id, half: normalizeHalf(half) });
2392
+ },
2393
+ end: () => {
2394
+ if (drag?.over !== null && drag?.over !== void 0) commitSessionDrag(drag, drag.over);
2395
+ else setDrag(null);
2396
+ sessionDropCommitted.current = false;
2397
+ }
2398
+ };
2399
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
2400
+ SessionNodeItem,
2401
+ {
2402
+ node,
2403
+ currentId: current,
2404
+ now,
2405
+ onOpen: open,
2406
+ onRenameRequest: onSessionRenameRequest,
2407
+ renderSlot,
2408
+ renderFactorySlot,
2409
+ useContextMenu,
2410
+ useContextMenuTarget,
2411
+ onReveal: node.id === revealSessionId && group.key === revealGroup ? () => {
2412
+ onSessionRevealed(node.id);
2413
+ } : void 0,
2414
+ drag: dragProps,
2415
+ home,
2416
+ useSessionAccess,
2417
+ t
2418
+ },
2419
+ node.id
2420
+ );
2421
+ }),
2422
+ collapsed.hiddenCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
2423
+ "button",
2424
+ {
2425
+ type: "button",
2426
+ className: WorkspaceBrowser_default.sessionOverflowButton,
2427
+ "data-row-key": `overflow:${group.key}`,
2428
+ "aria-expanded": sessionsExpanded,
2429
+ onClick: () => {
2430
+ if (sessionsExpanded) {
2431
+ dropWatermarks((key) => key === group.key);
2432
+ return;
2433
+ }
2434
+ setStoredWatermarks((marks) => ({
2435
+ ...marks,
2436
+ [group.key]: visible.hiddenCount <= SESSION_WATERMARK_BASE ? Infinity : watermark + SESSION_WATERMARK_BASE
2437
+ }));
2438
+ setWatermarkMotionKey((key) => key + 1);
2439
+ },
2440
+ children: sessionsExpanded ? t("sessions.collapse") : t("sessions.expand", { n: visible.hiddenCount })
2441
+ }
2442
+ )
2443
+ ]
2444
+ },
2445
+ group.key
2446
+ )
2447
+ );
2448
+ };
2449
+ const groupRows = rootGroups.map((group) => renderGroup(group, 0));
2450
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_dsh_client_ui_primitives4.HoverCardGroup, { className: clsx_default(WorkspaceBrowser_default.treeBody, WorkspaceBrowser_default.wide), children: [
2451
+ workspaceDropAtListStart && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: WorkspaceBrowser_default.listTopDropIndicator, "aria-hidden": "true" }),
2452
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
2453
+ import_dsh_client_ui_primitives4.AnimatedRows,
2454
+ {
2455
+ className: clsx_default(WorkspaceBrowser_default.list, workspaceDropAtListStart && WorkspaceBrowser_default.listTopDropActive),
2456
+ role: "tree",
2457
+ label: t("section.sessions"),
2458
+ rowKeys,
2459
+ ready: list.phase === "ready" && workspaceReady && !nativeDragActive,
2460
+ resetKey: JSON.stringify([animationResetKey, watermarkMotionKey]),
2461
+ children: [
2462
+ groups.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(EmptySessions, { rowState, statusFilter, onLeaveArchivedOnly, t }),
2463
+ groupRows
2464
+ ]
2465
+ }
2466
+ )
2467
+ ] });
2468
+ }
2469
+ function FlatList({
2470
+ list,
2471
+ sessionIds,
2472
+ rowState,
2473
+ onLeaveArchivedOnly,
2474
+ useSessionStatus,
2475
+ useSessionAccess,
2476
+ open,
2477
+ onSessionRenameRequest,
2478
+ usePanelInfo,
2479
+ setSessionOrder,
2480
+ workspaceReady,
2481
+ animationResetKey,
2482
+ statusFilter,
2483
+ workspaceLabelOf,
2484
+ revealSessionId,
2485
+ onSessionRevealed,
2486
+ renderSlot,
2487
+ renderFactorySlot,
2488
+ useContextMenuTarget,
2489
+ useContextMenu,
2490
+ home,
2491
+ t
2492
+ }) {
2493
+ const panelActive = usePanelInfo((info) => info.activePanelId !== null);
2494
+ const statuses = useSessionStatus((s) => s);
2495
+ const rows = (0, import_react4.useMemo)(
2496
+ () => deriveFlat(list, sessionIds, rowState, statuses, statusFilter),
2497
+ [list, sessionIds, rowState, statuses, statusFilter]
2498
+ );
2499
+ const [drag, setDrag] = (0, import_react4.useState)(null);
2500
+ const dropCommitted = (0, import_react4.useRef)(false);
2501
+ useNativeDragAcceptance(drag !== null);
2502
+ const currentId = panelActive ? void 0 : Object.values(list.byId).find((session) => (session.retainedBy.mainView ?? 0) > 0)?.id;
2503
+ const commitDrag = (activeDrag, over) => {
2504
+ if (dropCommitted.current) return;
2505
+ dropCommitted.current = true;
2506
+ setDrag(null);
2507
+ const nextOrder = sessionDragOrder(sessionIds, rows, activeDrag, over);
2508
+ if (nextOrder !== void 0) setSessionOrder(FLAT_SESSION_ORDER_KEY, nextOrder);
2509
+ };
2510
+ const now = Date.now();
2511
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives4.HoverCardGroup, { className: clsx_default(WorkspaceBrowser_default.treeBody, WorkspaceBrowser_default.wide), children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
2512
+ import_dsh_client_ui_primitives4.AnimatedRows,
2513
+ {
2514
+ className: clsx_default(WorkspaceBrowser_default.list, WorkspaceBrowser_default.flatList),
2515
+ role: "tree",
2516
+ label: t("section.sessions"),
2517
+ rowKeys: rows.length === 0 ? ["empty"] : rows.map((row) => `session:${row.id}`),
2518
+ ready: list.phase === "ready" && workspaceReady && drag === null,
2519
+ resetKey: animationResetKey,
2520
+ children: [
2521
+ rows.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(EmptySessions, { rowState, statusFilter, onLeaveArchivedOnly, t }),
2522
+ rows.map((node) => {
2523
+ const active = drag !== null && drag.pinned === node.pinned;
2524
+ const normalizeHalf = (half) => node.blank ? "after" : half;
2525
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
2526
+ SessionNodeItem,
2527
+ {
2528
+ node,
2529
+ currentId,
2530
+ now,
2531
+ onOpen: open,
2532
+ onRenameRequest: onSessionRenameRequest,
2533
+ renderSlot,
2534
+ renderFactorySlot,
2535
+ useContextMenu,
2536
+ useContextMenuTarget,
2537
+ onReveal: node.id === revealSessionId ? () => {
2538
+ onSessionRevealed(node.id);
2539
+ } : void 0,
2540
+ useSessionAccess,
2541
+ workspaceLabel: workspaceLabelOf(node.id),
2542
+ drag: {
2543
+ start: () => {
2544
+ dropCommitted.current = false;
2545
+ setDrag({ accountKey: FLAT_SESSION_ORDER_KEY, sessionId: node.id, pinned: node.pinned, over: null });
2546
+ },
2547
+ active,
2548
+ marker: active && drag.over?.id === node.id ? drag.over.half : null,
2549
+ hover: (half) => {
2550
+ setDrag((current) => current === null ? current : {
2551
+ ...current,
2552
+ over: { id: node.id, half: normalizeHalf(half) }
2553
+ });
2554
+ },
2555
+ drop: (half) => {
2556
+ if (drag !== null) commitDrag(drag, { id: node.id, half: normalizeHalf(half) });
2557
+ },
2558
+ end: () => {
2559
+ if (drag?.over !== null && drag?.over !== void 0) commitDrag(drag, drag.over);
2560
+ else setDrag(null);
2561
+ dropCommitted.current = false;
2562
+ }
2563
+ },
2564
+ home,
2565
+ t
2566
+ },
2567
+ node.id
2568
+ );
2569
+ })
2570
+ ]
2571
+ }
2572
+ ) });
2573
+ }
2574
+ function TimeGroups({
2575
+ list,
2576
+ sessionIds,
2577
+ rowState,
2578
+ statusFilter,
2579
+ bucketExpansion,
2580
+ onToggleBucket,
2581
+ workspaceLabelOf,
2582
+ onLeaveArchivedOnly,
2583
+ useSessionStatus,
2584
+ useSessionAccess,
2585
+ open,
2586
+ onSessionRenameRequest,
2587
+ usePanelInfo,
2588
+ workspaceReady,
2589
+ animationResetKey,
2590
+ revealSessionId,
2591
+ onSessionRevealed,
2592
+ renderSlot,
2593
+ renderFactorySlot,
2594
+ useContextMenuTarget,
2595
+ useContextMenu,
2596
+ home,
2597
+ t,
2598
+ setSessionOrder
2599
+ }) {
2600
+ const panelActive = usePanelInfo((info) => info.activePanelId !== null);
2601
+ const statuses = useSessionStatus((s) => s);
2602
+ const now = Date.now();
2603
+ const expandedBuckets = (0, import_react4.useMemo)(
2604
+ () => TIME_BUCKET_ORDER.filter((key) => bucketExpansion[key] !== false),
2605
+ [bucketExpansion]
2606
+ );
2607
+ const groups = (0, import_react4.useMemo)(
2608
+ () => deriveTimeGroups(list, sessionIds, rowState, statuses, { expandedBuckets, now, statusFilter }),
2609
+ [expandedBuckets, list, now, rowState, sessionIds, statusFilter, statuses]
2610
+ );
2611
+ const currentId = panelActive ? void 0 : Object.values(list.byId).find((session) => (session.retainedBy.mainView ?? 0) > 0)?.id;
2612
+ const bucketOf = (0, import_react4.useMemo)(() => {
2613
+ const keys = /* @__PURE__ */ new Map();
2614
+ for (const group of groups) for (const session of group.sessions) keys.set(session.id, group.key);
2615
+ return keys;
2616
+ }, [groups]);
2617
+ const rows = (0, import_react4.useMemo)(() => groups.flatMap((group) => group.sessions), [groups]);
2618
+ const [drag, setDrag] = (0, import_react4.useState)(null);
2619
+ const dropCommitted = (0, import_react4.useRef)(false);
2620
+ useNativeDragAcceptance(drag !== null);
2621
+ const dragBucket = drag === null ? void 0 : bucketOf.get(drag.sessionId);
2622
+ const commitDrag = (activeDrag, over) => {
2623
+ if (dropCommitted.current) return;
2624
+ dropCommitted.current = true;
2625
+ setDrag(null);
2626
+ if (bucketOf.get(activeDrag.sessionId) !== bucketOf.get(over.id)) return;
2627
+ const nextOrder = sessionDragOrder(sessionIds, rows, activeDrag, over);
2628
+ if (nextOrder !== void 0) setSessionOrder(FLAT_SESSION_ORDER_KEY, nextOrder);
2629
+ };
2630
+ const rowKeys = [];
2631
+ for (const group of groups) {
2632
+ rowKeys.push(`bucket:${group.key}`);
2633
+ for (const session of group.sessions) rowKeys.push(`session:${session.id}`);
2634
+ }
2635
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives4.HoverCardGroup, { className: clsx_default(WorkspaceBrowser_default.treeBody, WorkspaceBrowser_default.wide), children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
2636
+ import_dsh_client_ui_primitives4.AnimatedRows,
2637
+ {
2638
+ className: clsx_default(WorkspaceBrowser_default.list, WorkspaceBrowser_default.flatList),
2639
+ role: "tree",
2640
+ label: t("section.sessions"),
2641
+ rowKeys: rowKeys.length === 0 ? ["empty"] : rowKeys,
2642
+ ready: list.phase === "ready" && workspaceReady && drag === null,
2643
+ resetKey: animationResetKey,
2644
+ children: [
2645
+ groups.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(EmptySessions, { rowState, statusFilter, onLeaveArchivedOnly, t }),
2646
+ groups.map((group) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react4.Fragment, { children: [
2647
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
2648
+ TimeBucketRowItem,
2649
+ {
2650
+ rowKey: group.key,
2651
+ label: t(`timeBucket.${group.key}`),
2652
+ count: group.sessionCount,
2653
+ expanded: group.expanded,
2654
+ onToggle: () => {
2655
+ onToggleBucket(group.key, !group.expanded);
2656
+ }
2657
+ }
2658
+ ),
2659
+ group.sessions.map((node) => {
2660
+ const active = drag !== null && dragBucket === group.key && drag.pinned === node.pinned;
2661
+ const half = (side) => node.blank ? "after" : side;
2662
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
2663
+ SessionNodeItem,
2664
+ {
2665
+ node,
2666
+ currentId,
2667
+ now,
2668
+ onOpen: open,
2669
+ onRenameRequest: onSessionRenameRequest,
2670
+ renderSlot,
2671
+ renderFactorySlot,
2672
+ useContextMenu,
2673
+ useContextMenuTarget,
2674
+ onReveal: node.id === revealSessionId ? () => {
2675
+ onSessionRevealed(node.id);
2676
+ } : void 0,
2677
+ useSessionAccess,
2678
+ workspaceLabel: workspaceLabelOf(node.id),
2679
+ drag: {
2680
+ start: () => {
2681
+ dropCommitted.current = false;
2682
+ setDrag({ accountKey: FLAT_SESSION_ORDER_KEY, sessionId: node.id, pinned: node.pinned, over: null });
2683
+ },
2684
+ active,
2685
+ marker: drag !== null && active && drag.over?.id === node.id ? drag.over.half : null,
2686
+ hover: (side) => {
2687
+ setDrag((current) => {
2688
+ if (current === null) return current;
2689
+ if (bucketOf.get(current.sessionId) !== group.key) {
2690
+ return current.over === null ? current : { ...current, over: null };
2691
+ }
2692
+ const next = { id: node.id, half: half(side) };
2693
+ if (current.over?.id === next.id && current.over.half === next.half) return current;
2694
+ return { ...current, over: next };
2695
+ });
2696
+ },
2697
+ drop: (side) => {
2698
+ if (drag === null) return;
2699
+ if (bucketOf.get(drag.sessionId) !== group.key) return;
2700
+ commitDrag(drag, { id: node.id, half: half(side) });
2701
+ },
2702
+ end: () => {
2703
+ if (drag?.over !== null && drag?.over !== void 0) commitDrag(drag, drag.over);
2704
+ else setDrag(null);
2705
+ dropCommitted.current = false;
2706
+ }
2707
+ },
2708
+ home,
2709
+ t
2710
+ },
2711
+ node.id
2712
+ );
2713
+ })
2714
+ ] }, group.key))
2715
+ ]
2716
+ }
2717
+ ) });
2718
+ }
2719
+ function StatusTabs({ counts, value, onChange, t }) {
2720
+ const tabs = [
2721
+ { id: "all", label: t("statusTab.all") },
2722
+ { id: "running", label: t("statusTab.running") },
2723
+ { id: "pending", label: t("statusTab.pending") },
2724
+ { id: "unread", label: t("statusTab.unread") }
2725
+ ];
2726
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: WorkspaceBrowser_default.statusTabs, role: "tablist", "aria-label": t("statusTabs.label"), children: tabs.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
2727
+ "button",
2728
+ {
2729
+ type: "button",
2730
+ role: "tab",
2731
+ "aria-selected": value === tab.id,
2732
+ className: clsx_default(WorkspaceBrowser_default.statusTab, value === tab.id && WorkspaceBrowser_default.statusTabActive),
2733
+ onClick: () => {
2734
+ onChange(tab.id);
2735
+ },
2736
+ children: [
2737
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: tab.label }),
2738
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: WorkspaceBrowser_default.statusTabCount, children: counts[tab.id] })
2739
+ ]
2740
+ },
2741
+ tab.id
2742
+ )) });
2743
+ }
2744
+ function SearchResults({
2745
+ useSessions,
2746
+ useSessionStatus,
2747
+ open,
2748
+ onUnarchive,
2749
+ workspaces,
2750
+ archivedSessionIds,
2751
+ archivedFilter,
2752
+ query,
2753
+ remote,
2754
+ resultLimit,
2755
+ usePanelInfo,
2756
+ useSessionAccess,
2757
+ t
2758
+ }) {
2759
+ const panelActive = usePanelInfo((info) => info.activePanelId !== null);
2760
+ const list = useSessions((s) => s);
2761
+ const statuses = useSessionStatus((s) => s);
2762
+ const currentRemote = remote.query === query ? remote : { query, status: "loading", items: [], hasMore: false };
2763
+ const results = (0, import_react4.useMemo)(
2764
+ () => deriveSearchResults(
2765
+ list,
2766
+ workspaces,
2767
+ query,
2768
+ archivedSessionIds,
2769
+ archivedFilter,
2770
+ statuses,
2771
+ currentRemote,
2772
+ resultLimit
2773
+ ),
2774
+ [list, workspaces, query, archivedSessionIds, archivedFilter, statuses, currentRemote, resultLimit]
2775
+ );
2776
+ const pending = currentRemote.status === "loading";
2777
+ const currentId = panelActive ? void 0 : Object.values(list.byId).find((session) => (session.retainedBy.mainView ?? 0) > 0)?.id;
2778
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: clsx_default(WorkspaceBrowser_default.treeBody, WorkspaceBrowser_default.wide), children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: WorkspaceBrowser_default.list, children: [
2779
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: WorkspaceBrowser_default.searchTree, role: "tree", "aria-label": t("search.results.aria"), children: results.items.map((result) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
2780
+ SearchResultItem,
2781
+ {
2782
+ result,
2783
+ currentId,
2784
+ onOpen: open,
2785
+ onUnarchive,
2786
+ useSessionAccess,
2787
+ t
2788
+ },
2789
+ result.id
2790
+ )) }),
2791
+ pending && /* Two skeleton rows on an empty list, one when local matches already
2792
+ show and only the content hits are outstanding. */
2793
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { role: "status", "aria-label": t("search.pending"), children: (results.items.length === 0 ? [0, 1] : [0]).map((i) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: WorkspaceBrowser_default.skeletonRow, "aria-hidden": "true", children: [
2794
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: WorkspaceBrowser_default.skeletonDot }),
2795
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { className: WorkspaceBrowser_default.skeletonBars, children: [
2796
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: WorkspaceBrowser_default.skeletonBar }),
2797
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: clsx_default(WorkspaceBrowser_default.skeletonBar, WorkspaceBrowser_default.skeletonBarWide) })
2798
+ ] })
2799
+ ] }, i)) }),
2800
+ !pending && results.items.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: WorkspaceBrowser_default.empty, children: t("search.noMatches") }),
2801
+ results.hasMore && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: WorkspaceBrowser_default.searchStatus, children: t("search.hasMore", { n: resultLimit }) })
2802
+ ] }) });
2803
+ }
2804
+ function WorkspaceBrowser({
2805
+ wide,
2806
+ usePanelInfo,
2807
+ expandSidebar,
2808
+ useSectionScroller,
2809
+ useSessions,
2810
+ useSessionStatus,
2811
+ useSessionAccess,
2812
+ useWorkspaceAccess,
2813
+ useWorkspaces,
2814
+ useStore,
2815
+ actions,
2816
+ startSession,
2817
+ open,
2818
+ requestSessionRename,
2819
+ notifyArchivedNotOpenable,
2820
+ renameWorkspace,
2821
+ useWorkspaceActionRequest,
2822
+ settleWorkspaceAction,
2823
+ deleteWorkspace,
2824
+ insertWorkspaceBefore,
2825
+ unarchiveSession,
2826
+ createWorkspace,
2827
+ searchSessions,
2828
+ searchResultLimit,
2829
+ useDirectoryFlow,
2830
+ useHostInfo,
2831
+ useShortcuts,
2832
+ useWorkspaceShortcuts,
2833
+ requestSearch,
2834
+ requestAddWorkspace,
2835
+ closeAddWorkspace,
2836
+ setDirectoryBusy,
2837
+ renderSlot,
2838
+ renderFactorySlot,
2839
+ useContextMenuTarget,
2840
+ useContextMenu,
2841
+ t
2842
+ }) {
2843
+ const home = useHostInfo((info) => info.home);
2844
+ const shortcuts = useShortcuts((rows) => rows);
2845
+ const searchShortcut = shortcuts.find((row) => row.id === "session.search");
2846
+ const addShortcut = shortcuts.find((row) => row.id === "workspace.add");
2847
+ const shortcutState = useWorkspaceShortcuts((state) => state);
2848
+ const list = useSessions((state) => state);
2849
+ const storedWorkspaces = useWorkspaces((state) => state.items);
2850
+ const defaultWorkspaceName = t("workspace.defaultName");
2851
+ const workspaces = (0, import_react4.useMemo)(
2852
+ () => storedWorkspaces.map((workspace) => ({
2853
+ ...workspace,
2854
+ title: workspaceDisplayTitle(workspace.title, defaultWorkspaceName)
2855
+ })),
2856
+ [storedWorkspaces, defaultWorkspaceName]
2857
+ );
2858
+ const workspacePhase = useWorkspaces((state) => state.phase);
2859
+ const workspaceStreamState = useWorkspaces((state) => state.state);
2860
+ const archivedSessionIds = useWorkspaces((state) => state.archivedSessionIds);
2861
+ const pinnedSessionIds = useWorkspaces((state) => state.pinnedSessionIds);
2862
+ const directoryFlowAvailable = useDirectoryFlow((occupied) => occupied);
2863
+ const groupBy = useStore((s) => s.groupBy);
2864
+ const orderBy = useStore((s) => s.orderBy);
2865
+ const archivedFilter = useStore((s) => s.archivedFilter ?? "default");
2866
+ const statusFilter = useStore((s) => s.statusFilter ?? "all");
2867
+ const timeBucketExpansion = useStore((s) => s.timeBucketExpansion ?? {});
2868
+ const groupExpansion = useStore((s) => s.groupExpansion);
2869
+ const sessionOrderByAccount = useStore((s) => s.sessionOrderByAccount);
2870
+ const guardedOpen = (sessionId) => {
2871
+ if (archivedSessionIds.includes(sessionId)) {
2872
+ notifyArchivedNotOpenable();
2873
+ return;
2874
+ }
2875
+ open(sessionId);
2876
+ };
2877
+ const leaveArchivedOnly = () => {
2878
+ actions.setArchivedFilter("default");
2879
+ };
2880
+ const workspaceReady = workspacePhase === "ready" && workspaceStreamState !== "loading";
2881
+ const mainSessionId2 = Object.values(list.byId).find((session) => (session.retainedBy.mainView ?? 0) > 0)?.id;
2882
+ const currentBlank = mainSessionId2 !== void 0 && list.byId[mainSessionId2]?.blank === true ? mainSessionId2 : void 0;
2883
+ const ungroupedMemberIds = (0, import_react4.useMemo)(() => {
2884
+ const accounted = new Set(workspaces.flatMap((workspace) => workspace.sessionIds));
2885
+ return list.ids.filter((id) => list.byId[id] !== void 0 && !accounted.has(id));
2886
+ }, [list, workspaces]);
2887
+ const orderState = (0, import_react4.useMemo)(
2888
+ () => ({ pinnedSessionIds, archivedSessionIds }),
2889
+ [archivedSessionIds, pinnedSessionIds]
2890
+ );
2891
+ const rowState = (0, import_react4.useMemo)(
2892
+ () => ({ ...orderState, archivedFilter }),
2893
+ [orderState, archivedFilter]
2894
+ );
2895
+ const flatMemberIds = (0, import_react4.useMemo)(() => sessionMemberIds(list), [list]);
2896
+ const orderedWorkspaces = (0, import_react4.useMemo)(() => workspaces.map((workspace) => {
2897
+ const memberIds = workspace.sessionIds;
2898
+ const baseOrder = orderBy === "updated" ? orderByRecency(memberIds, list.byId) : reconcileManualOrder(memberIds, sessionOrderByAccount[workspace.workspaceId], list.byId, orderState);
2899
+ return {
2900
+ ...workspace,
2901
+ sessionIds: pinCurrentBlank(
2902
+ baseOrder,
2903
+ currentBlank !== void 0 && memberIds.includes(currentBlank) ? currentBlank : void 0
2904
+ )
2905
+ };
2906
+ }), [currentBlank, list.byId, orderBy, orderState, sessionOrderByAccount, workspaces]);
2907
+ const orderedUngroupedSessionIds = (0, import_react4.useMemo)(() => {
2908
+ const baseOrder = orderBy === "updated" ? orderByRecency(ungroupedMemberIds, list.byId) : reconcileManualOrder(ungroupedMemberIds, sessionOrderByAccount[UNGROUPED_KEY], list.byId, orderState);
2909
+ return pinCurrentBlank(
2910
+ baseOrder,
2911
+ currentBlank !== void 0 && ungroupedMemberIds.includes(currentBlank) ? currentBlank : void 0
2912
+ );
2913
+ }, [currentBlank, list.byId, orderBy, orderState, sessionOrderByAccount, ungroupedMemberIds]);
2914
+ const orderedFlatSessionIds = (0, import_react4.useMemo)(() => {
2915
+ const baseOrder = orderBy === "updated" ? orderByRecency(flatMemberIds, list.byId) : reconcileManualOrder(flatMemberIds, sessionOrderByAccount[FLAT_SESSION_ORDER_KEY], list.byId, orderState);
2916
+ return pinCurrentBlank(
2917
+ baseOrder,
2918
+ currentBlank !== void 0 && flatMemberIds.includes(currentBlank) ? currentBlank : void 0
2919
+ );
2920
+ }, [currentBlank, flatMemberIds, list.byId, orderBy, orderState, sessionOrderByAccount]);
2921
+ const sessionStatuses2 = useSessionStatus((state) => state);
2922
+ const statusCounts = (0, import_react4.useMemo)(() => {
2923
+ const rows = deriveFlat(list, orderedFlatSessionIds, rowState, sessionStatuses2);
2924
+ return {
2925
+ all: rows.length,
2926
+ running: rows.filter((row) => matchesStatusFilter(row, "running")).length,
2927
+ pending: rows.filter((row) => matchesStatusFilter(row, "pending")).length,
2928
+ unread: rows.filter((row) => matchesStatusFilter(row, "unread")).length
2929
+ };
2930
+ }, [list, orderedFlatSessionIds, rowState, sessionStatuses2]);
2931
+ const workspaceLabelBySession = (0, import_react4.useMemo)(() => {
2932
+ const labels = /* @__PURE__ */ new Map();
2933
+ for (const workspace of workspaces) {
2934
+ for (const id of workspace.sessionIds) labels.set(id, workspace.title);
2935
+ }
2936
+ return labels;
2937
+ }, [workspaces]);
2938
+ const workspaceLabelOf = (0, import_react4.useCallback)(
2939
+ (id) => workspaceLabelBySession.get(id),
2940
+ [workspaceLabelBySession]
2941
+ );
2942
+ const activeSessionOrders = (0, import_react4.useMemo)(() => Object.fromEntries([
2943
+ ...orderedWorkspaces.map((workspace) => [workspace.workspaceId, workspace.sessionIds]),
2944
+ [UNGROUPED_KEY, orderedUngroupedSessionIds],
2945
+ [FLAT_SESSION_ORDER_KEY, orderedFlatSessionIds]
2946
+ ]), [orderedFlatSessionIds, orderedUngroupedSessionIds, orderedWorkspaces]);
2947
+ (0, import_react4.useEffect)(() => {
2948
+ if (workspacePhase !== "ready") return;
2949
+ actions.retainAccountKeys([
2950
+ UNGROUPED_KEY,
2951
+ FLAT_SESSION_ORDER_KEY,
2952
+ ...workspaces.map((workspace) => workspace.workspaceId)
2953
+ ]);
2954
+ }, [actions.retainAccountKeys, workspacePhase, workspaces]);
2955
+ (0, import_react4.useEffect)(() => {
2956
+ if (list.phase !== "ready" || workspaceReady || orderBy !== "manual" || currentBlank === void 0) return;
2957
+ const changed = {};
2958
+ for (const [key, ids] of Object.entries(activeSessionOrders)) {
2959
+ if (key !== FLAT_SESSION_ORDER_KEY && workspacePhase !== "ready") continue;
2960
+ const saved = sessionOrderByAccount[key] ?? [];
2961
+ if (ids[0] !== currentBlank || saved[0] === currentBlank) continue;
2962
+ changed[key] = [currentBlank, ...saved.filter((id) => id !== currentBlank)];
2963
+ }
2964
+ if (Object.keys(changed).length > 0) actions.syncSessionOrders(changed);
2965
+ }, [
2966
+ actions.syncSessionOrders,
2967
+ activeSessionOrders,
2968
+ currentBlank,
2969
+ list.phase,
2970
+ orderBy,
2971
+ sessionOrderByAccount,
2972
+ workspacePhase,
2973
+ workspaceReady
2974
+ ]);
2975
+ (0, import_react4.useEffect)(() => {
2976
+ if (list.phase !== "ready" || !workspaceReady || orderBy !== "manual" || currentBlank === void 0) return;
2977
+ const moved = Object.entries(activeSessionOrders).some(([key, ids]) => ids[0] === currentBlank && sessionOrderByAccount[key]?.[0] !== currentBlank);
2978
+ if (moved) actions.syncSessionOrders(activeSessionOrders);
2979
+ }, [
2980
+ actions.syncSessionOrders,
2981
+ activeSessionOrders,
2982
+ currentBlank,
2983
+ list.phase,
2984
+ orderBy,
2985
+ sessionOrderByAccount,
2986
+ workspaceReady
2987
+ ]);
2988
+ const saveSessionOrder = (accountKey, order) => {
2989
+ actions.setSessionOrder(accountKey, order, activeSessionOrders);
2990
+ };
2991
+ const [query, setQuery] = (0, import_react4.useState)("");
2992
+ const [searchExpanded, setSearchExpanded] = (0, import_react4.useState)(false);
2993
+ const [searchSpacingMotionEnabled, setSearchSpacingMotionEnabled] = (0, import_react4.useState)(false);
2994
+ const [searchOnExpand, setSearchOnExpand] = (0, import_react4.useState)(false);
2995
+ const [lastSearchRequest, setLastSearchRequest] = (0, import_react4.useState)(0);
2996
+ if (lastSearchRequest !== shortcutState.searchRequest) {
2997
+ setLastSearchRequest(shortcutState.searchRequest);
2998
+ if (shortcutState.searchRequest !== 0) {
2999
+ setSearchExpanded(true);
3000
+ setSearchSpacingMotionEnabled(wide);
3001
+ if (!wide) setSearchOnExpand(true);
3002
+ }
3003
+ }
3004
+ if (!wide && searchSpacingMotionEnabled) setSearchSpacingMotionEnabled(false);
3005
+ const changeSearchExpanded = (expanded) => {
3006
+ setSearchSpacingMotionEnabled(wide);
3007
+ setSearchExpanded(expanded);
3008
+ };
3009
+ const [revealSessionId, setRevealSessionId] = (0, import_react4.useState)(void 0);
3010
+ const normalizedQuery = sanitizeSearchQuery(query).trim();
3011
+ const [remoteSearch, setRemoteSearch] = (0, import_react4.useState)({
3012
+ query: "",
3013
+ status: "idle",
3014
+ items: [],
3015
+ hasMore: false
3016
+ });
3017
+ const searchRoot = (0, import_react4.useRef)(null);
3018
+ const searchInput = (0, import_react4.useRef)(null);
3019
+ const { bindScrollerRef } = useSectionScroller();
3020
+ const focusSearch = (0, import_react4.useCallback)(() => {
3021
+ searchInput.current?.focus({ preventScroll: true });
3022
+ }, []);
3023
+ const wsPickerOpen = shortcutState.addRequested;
3024
+ const wsPlusRef = (0, import_react4.useRef)(null);
3025
+ const workspaceActionRequest = useWorkspaceActionRequest((value) => value);
3026
+ const openSearchResult = (sessionId) => {
3027
+ if (archivedSessionIds.includes(sessionId)) {
3028
+ notifyArchivedNotOpenable();
3029
+ return;
3030
+ }
3031
+ setRevealSessionId(sessionId);
3032
+ setQuery("");
3033
+ changeSearchExpanded(false);
3034
+ open(sessionId);
3035
+ };
3036
+ const acknowledgeSessionReveal = (sessionId) => {
3037
+ setRevealSessionId((current) => current === sessionId ? void 0 : current);
3038
+ };
3039
+ (0, import_react4.useEffect)(() => {
3040
+ if (normalizedQuery !== "") setRevealSessionId(void 0);
3041
+ }, [normalizedQuery]);
3042
+ (0, import_react4.useEffect)(() => {
3043
+ if (wide && searchOnExpand) {
3044
+ const timer = window.setTimeout(() => {
3045
+ focusSearch();
3046
+ setSearchOnExpand(false);
3047
+ }, EXPAND_SLIDE_MS);
3048
+ return () => {
3049
+ window.clearTimeout(timer);
3050
+ };
3051
+ }
3052
+ }, [wide, searchOnExpand, focusSearch]);
3053
+ (0, import_react4.useEffect)(() => {
3054
+ if (shortcutState.searchRequest === 0) return;
3055
+ closeAddWorkspace();
3056
+ if (!wide || searchInput.current?.closest("[inert]")) {
3057
+ setSearchOnExpand(true);
3058
+ expandSidebar();
3059
+ } else focusSearch();
3060
+ }, [shortcutState.searchRequest, focusSearch]);
3061
+ (0, import_react4.useEffect)(() => {
3062
+ if (!wide || !searchExpanded || searchOnExpand) return;
3063
+ focusSearch();
3064
+ }, [wide, searchExpanded, searchOnExpand, focusSearch]);
3065
+ (0, import_react4.useEffect)(() => {
3066
+ if (!wide || !searchExpanded || searchOnExpand) return;
3067
+ const onClick = (event) => {
3068
+ if (!(event.target instanceof Node) || searchRoot.current?.contains(event.target) === true) return;
3069
+ searchInput.current?.blur();
3070
+ if (normalizedQuery !== "") return;
3071
+ changeSearchExpanded(false);
3072
+ };
3073
+ document.addEventListener("click", onClick);
3074
+ return () => {
3075
+ document.removeEventListener("click", onClick);
3076
+ };
3077
+ }, [normalizedQuery, wide, searchExpanded, searchOnExpand]);
3078
+ (0, import_react4.useEffect)(() => {
3079
+ if (normalizedQuery === "") {
3080
+ setRemoteSearch({ query: "", status: "idle", items: [], hasMore: false });
3081
+ return;
3082
+ }
3083
+ const controller = new AbortController();
3084
+ setRemoteSearch({
3085
+ query: normalizedQuery,
3086
+ status: "loading",
3087
+ items: [],
3088
+ hasMore: false
3089
+ });
3090
+ const timer = window.setTimeout(() => {
3091
+ searchSessions(normalizedQuery, controller.signal).then((result) => {
3092
+ if (controller.signal.aborted) return;
3093
+ setRemoteSearch({
3094
+ query: normalizedQuery,
3095
+ status: "ready",
3096
+ items: result.items,
3097
+ hasMore: result.hasMore
3098
+ });
3099
+ }).catch(() => {
3100
+ if (controller.signal.aborted) return;
3101
+ setRemoteSearch({
3102
+ query: normalizedQuery,
3103
+ status: "error",
3104
+ items: [],
3105
+ hasMore: false
3106
+ });
3107
+ });
3108
+ }, SEARCH_DEBOUNCE_MS);
3109
+ return () => {
3110
+ window.clearTimeout(timer);
3111
+ controller.abort();
3112
+ };
3113
+ }, [normalizedQuery, searchSessions]);
3114
+ const onSessionUnarchive = (sessionId) => {
3115
+ unarchiveSession(sessionId).catch((reason) => {
3116
+ console.warn("session unarchive rejected:", reason);
3117
+ });
3118
+ };
3119
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: clsx_default(WorkspaceBrowser_default.root, !wide && WorkspaceBrowser_default.rail), children: [
3120
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: clsx_default(WorkspaceBrowser_default.sectionHeader, wide && searchSpacingMotionEnabled && WorkspaceBrowser_default.searchSpacingMotion), "data-sidebar-workspace-header": "", children: [
3121
+ wide && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: clsx_default(WorkspaceBrowser_default.sectionLabel, WorkspaceBrowser_default.wide, searchExpanded && WorkspaceBrowser_default.sectionLabelHidden), children: groupBy === "flat" || groupBy === "time" ? t("section.sessions") : t("section.workspaces") }),
3122
+ wide && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: clsx_default(WorkspaceBrowser_default.searchSlot, searchExpanded && WorkspaceBrowser_default.searchSlotExpanded), children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
3123
+ "div",
3124
+ {
3125
+ ref: searchRoot,
3126
+ className: clsx_default(WorkspaceBrowser_default.search, searchExpanded && WorkspaceBrowser_default.searchExpanded),
3127
+ onClick: () => {
3128
+ closeAddWorkspace();
3129
+ changeSearchExpanded(true);
3130
+ focusSearch();
3131
+ },
3132
+ children: [
3133
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives4.Tooltip, { label: t("search"), shortcutKeys: searchShortcut?.keys, side: "bottom", delayMs: 500, disabled: searchExpanded, portal: true, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
3134
+ "button",
3135
+ {
3136
+ type: "button",
3137
+ className: WorkspaceBrowser_default.searchButton,
3138
+ "aria-label": t("search.sessions.aria"),
3139
+ "aria-keyshortcuts": searchShortcut?.aria,
3140
+ "aria-expanded": searchExpanded,
3141
+ onClick: () => {
3142
+ requestSearch();
3143
+ },
3144
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives4.IconSearchOutlineRegular, { size: searchExpanded ? 11 : 14 })
3145
+ }
3146
+ ) }),
3147
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
3148
+ "input",
3149
+ {
3150
+ ref: searchInput,
3151
+ className: WorkspaceBrowser_default.searchInput,
3152
+ type: "text",
3153
+ placeholder: t("search.placeholder"),
3154
+ maxLength: SEARCH_QUERY_MAX_CODE_UNITS,
3155
+ value: query,
3156
+ tabIndex: searchExpanded ? 0 : -1,
3157
+ onChange: (e) => {
3158
+ setQuery(sanitizeSearchQuery(e.target.value));
3159
+ },
3160
+ onKeyDown: (e) => {
3161
+ if (e.key !== "Escape") return;
3162
+ setQuery("");
3163
+ changeSearchExpanded(false);
3164
+ }
3165
+ }
3166
+ ),
3167
+ searchExpanded && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
3168
+ "button",
3169
+ {
3170
+ type: "button",
3171
+ className: WorkspaceBrowser_default.clearButton,
3172
+ "aria-label": t("search.clear"),
3173
+ onClick: (e) => {
3174
+ e.stopPropagation();
3175
+ setQuery("");
3176
+ changeSearchExpanded(false);
3177
+ },
3178
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives4.IconCloseFillRegular, {})
3179
+ }
3180
+ )
3181
+ ]
3182
+ }
3183
+ ) }),
3184
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: clsx_default(WorkspaceBrowser_default.headerActions, wide && searchExpanded && WorkspaceBrowser_default.headerActionsHidden), children: [
3185
+ wide && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
3186
+ ViewOptionsMenu,
3187
+ {
3188
+ groupBy,
3189
+ orderBy,
3190
+ archivedFilter,
3191
+ onGroupPick: actions.setGroupBy,
3192
+ onOrderPick: (mode) => {
3193
+ actions.setOrderBy(mode, activeSessionOrders);
3194
+ },
3195
+ onArchivedFilterPick: actions.setArchivedFilter,
3196
+ t
3197
+ }
3198
+ ),
3199
+ directoryFlowAvailable && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives4.Tooltip, { label: t("workspace.add"), shortcutKeys: addShortcut?.keys, side: "bottom", delayMs: 500, portal: true, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
3200
+ "button",
3201
+ {
3202
+ ref: wsPlusRef,
3203
+ type: "button",
3204
+ className: WorkspaceBrowser_default.iconButton,
3205
+ "aria-label": t("workspace.add"),
3206
+ "aria-keyshortcuts": addShortcut?.aria,
3207
+ onClick: () => {
3208
+ requestAddWorkspace();
3209
+ },
3210
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives4.IconProjectAddOutlineRegular, { size: wide ? 16 : 18 })
3211
+ }
3212
+ ) })
3213
+ ] }),
3214
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
3215
+ WorkspacePickFlow,
3216
+ {
3217
+ t,
3218
+ open: wsPickerOpen,
3219
+ anchorRef: wsPlusRef,
3220
+ useWorkspaces,
3221
+ createWorkspace,
3222
+ useDirectoryFlow,
3223
+ renderDirectoryFlow: (owner) => renderSlot("sidebar.workspaces.directoryFlow", owner),
3224
+ addOnly: true,
3225
+ onBusyChange: setDirectoryBusy,
3226
+ side: "right",
3227
+ onPick: (workspaceId) => {
3228
+ closeAddWorkspace();
3229
+ startSession(workspaceId, { clearPreviousDraft: false });
3230
+ },
3231
+ onClose: () => {
3232
+ closeAddWorkspace();
3233
+ }
3234
+ }
3235
+ )
3236
+ ] }),
3237
+ wide && !searchExpanded && normalizedQuery === "" && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(StatusTabs, { counts: statusCounts, value: statusFilter, onChange: actions.setStatusFilter, t }),
3238
+ !wide && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: WorkspaceBrowser_default.search, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives4.Tooltip, { label: t("search"), shortcutKeys: searchShortcut?.keys, portal: true, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
3239
+ "button",
3240
+ {
3241
+ type: "button",
3242
+ className: WorkspaceBrowser_default.searchButton,
3243
+ "aria-label": t("search.sessions.aria"),
3244
+ "aria-keyshortcuts": searchShortcut?.aria,
3245
+ onClick: () => {
3246
+ requestSearch();
3247
+ },
3248
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives4.IconSearchOutlineRegular, { size: 18 })
3249
+ }
3250
+ ) }) }),
3251
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { ref: wide ? bindScrollerRef : void 0, className: WorkspaceBrowser_default.listArea, "data-sidebar-list-area": "", children: wide && (normalizedQuery !== "" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
3252
+ SearchResults,
3253
+ {
3254
+ usePanelInfo,
3255
+ useSessionAccess,
3256
+ useSessions,
3257
+ useSessionStatus,
3258
+ open: openSearchResult,
3259
+ onUnarchive: onSessionUnarchive,
3260
+ workspaces,
3261
+ archivedSessionIds,
3262
+ archivedFilter,
3263
+ query: normalizedQuery,
3264
+ remote: remoteSearch,
3265
+ resultLimit: searchResultLimit,
3266
+ t
3267
+ }
3268
+ ) : groupBy === "time" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
3269
+ TimeGroups,
3270
+ {
3271
+ useSessionAccess,
3272
+ usePanelInfo,
3273
+ list,
3274
+ sessionIds: orderedFlatSessionIds,
3275
+ rowState,
3276
+ statusFilter,
3277
+ bucketExpansion: timeBucketExpansion,
3278
+ onToggleBucket: actions.setTimeBucketExpanded,
3279
+ workspaceLabelOf,
3280
+ onLeaveArchivedOnly: leaveArchivedOnly,
3281
+ setSessionOrder: saveSessionOrder,
3282
+ workspaceReady,
3283
+ animationResetKey: `${groupBy}/${orderBy}/${archivedFilter}/${statusFilter}`,
3284
+ useSessionStatus,
3285
+ open: guardedOpen,
3286
+ onSessionRenameRequest: requestSessionRename,
3287
+ renderSlot,
3288
+ renderFactorySlot,
3289
+ useContextMenu,
3290
+ useContextMenuTarget,
3291
+ revealSessionId,
3292
+ onSessionRevealed: acknowledgeSessionReveal,
3293
+ home,
3294
+ t
3295
+ }
3296
+ ) : groupBy === "flat" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
3297
+ FlatList,
3298
+ {
3299
+ useSessionAccess,
3300
+ usePanelInfo,
3301
+ list,
3302
+ sessionIds: orderedFlatSessionIds,
3303
+ rowState,
3304
+ statusFilter,
3305
+ workspaceLabelOf,
3306
+ onLeaveArchivedOnly: leaveArchivedOnly,
3307
+ workspaceReady,
3308
+ animationResetKey: `${groupBy}/${orderBy}/${archivedFilter}/${statusFilter}`,
3309
+ useSessionStatus,
3310
+ open: guardedOpen,
3311
+ onSessionRenameRequest: requestSessionRename,
3312
+ renderSlot,
3313
+ renderFactorySlot,
3314
+ useContextMenu,
3315
+ useContextMenuTarget,
3316
+ setSessionOrder: saveSessionOrder,
3317
+ revealSessionId,
3318
+ onSessionRevealed: acknowledgeSessionReveal,
3319
+ home,
3320
+ t
3321
+ }
3322
+ ) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
3323
+ SessionTree,
3324
+ {
3325
+ useSessionAccess,
3326
+ useWorkspaceAccess,
3327
+ usePanelInfo,
3328
+ list,
3329
+ shortcuts,
3330
+ useSessionStatus,
3331
+ onSessionRenameRequest: requestSessionRename,
3332
+ renderSlot,
3333
+ renderFactorySlot,
3334
+ useContextMenu,
3335
+ useContextMenuTarget,
3336
+ workspaces: orderedWorkspaces,
3337
+ ungroupedSessionIds: orderedUngroupedSessionIds,
3338
+ workspaceReady,
3339
+ nestWorkspaces: groupBy === "workspace-tree",
3340
+ animationResetKey: `${groupBy}/${orderBy}/${archivedFilter}/${statusFilter}`,
3341
+ statusFilter,
3342
+ groupExpansion,
3343
+ setGroupExpanded: actions.setGroupExpanded,
3344
+ setSessionOrder: saveSessionOrder,
3345
+ rowState,
3346
+ onLeaveArchivedOnly: leaveArchivedOnly,
3347
+ startSession,
3348
+ open: guardedOpen,
3349
+ insertWorkspaceBefore,
3350
+ revealSessionId,
3351
+ onSessionRevealed: acknowledgeSessionReveal,
3352
+ home,
3353
+ t
3354
+ }
3355
+ )) }),
3356
+ workspaceActionRequest !== null && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
3357
+ WorkspaceDialogs,
3358
+ {
3359
+ request: workspaceActionRequest,
3360
+ workspaces,
3361
+ renameWorkspace,
3362
+ deleteWorkspace,
3363
+ settleWorkspaceAction,
3364
+ t
3365
+ },
3366
+ `${workspaceActionRequest.action}/${workspaceActionRequest.workspaceId}`
3367
+ )
3368
+ ] });
3369
+ }
3370
+
3371
+ // src/browser/locales.ts
3372
+ var zh = {
3373
+ "defaultWorkspace.failed": "无法创建默认工作区,请通过“选择工作区”选择文件夹",
3374
+ "draft.workspaceRequired": "请先选择工作区",
3375
+ "draft.initializationFailed": "暂时无法填入草稿,请稍后重试",
3376
+ "group.ungrouped": "未分组",
3377
+ "session.new": "新会话",
3378
+ "session.untitled": "未命名",
3379
+ "shortcut.noSession": "请先选择一个会话",
3380
+ "shortcut.noPicker": "目录选择器不可用",
3381
+ "shortcut.directoryBusy": "正在选择或添加工作区",
3382
+ "shortcut.noCompletedTurn": "当前会话没有已结束的轮次",
3383
+ "shortcut.forkFailed": "无法分叉会话,请重试",
3384
+ "section.workspaces": "工作区",
3385
+ "section.sessions": "会话",
3386
+ "viewOptions.label": "视图选项",
3387
+ "groupBy.label": "分组方式",
3388
+ "groupBy.workspace": "按工作区",
3389
+ "groupBy.workspaceTree": "按工作区树",
3390
+ "groupBy.flat": "单列表",
3391
+ "groupBy.time": "按时间",
3392
+ "timeBucket.pinned": "置顶",
3393
+ "timeBucket.today": "今天",
3394
+ "timeBucket.yesterday": "昨天",
3395
+ "timeBucket.week": "本周",
3396
+ "timeBucket.earlier": "更早",
3397
+ "statusTabs.label": "按状态筛选",
3398
+ "statusTab.all": "全部",
3399
+ "statusTab.running": "运行中",
3400
+ "statusTab.pending": "待确认",
3401
+ "statusTab.unread": "待查看",
3402
+ "orderBy.label": "排序方式",
3403
+ "orderBy.manual": "手动排序",
3404
+ "orderBy.updated": "最近更新",
3405
+ "filterBy.label": "筛选会话",
3406
+ "viewOptions.hideArchived": "隐藏已归档",
3407
+ "viewOptions.showArchived": "全部对话(显示已归档)",
3408
+ "viewOptions.onlyArchived": "仅显示已归档",
3409
+ "sessions.expand": "展开其余 {n} 个会话",
3410
+ "sessions.collapse": "收起",
3411
+ "empty.none": "暂无会话",
3412
+ "empty.noneArchived": "暂无已归档会话",
3413
+ "empty.viewOthers": "查看其他会话",
3414
+ "empty.noMatches": "无匹配结果",
3415
+ "workspace.add": "添加工作区",
3416
+ "search.sessions.aria": "搜索会话",
3417
+ "search.placeholder": "搜索会话名称",
3418
+ "search.clear": "清除搜索",
3419
+ "search.results.aria": "搜索结果",
3420
+ "search.pending": "正在搜索会话历史…",
3421
+ "search.noMatches": "无匹配会话",
3422
+ "search.hasMore": "仅显示前 {n} 条结果,请缩小搜索范围。",
3423
+ "menu.addWorkspace": "添加工作区…",
3424
+ "picker.loading": "正在加载工作区…",
3425
+ "conflict.named": "已存在名为“{name}”的工作区。",
3426
+ "folderError.title": "无法打开文件夹",
3427
+ "folderError.retry": "重新选择",
3428
+ "rename": "重命名",
3429
+ "rename.workspace.title": "重命名工作区",
3430
+ "rename.session.title": "重命名会话",
3431
+ "field.workspaceName": "工作区名称",
3432
+ "field.sessionName": "会话名称",
3433
+ "delete.workspace": "删除工作区",
3434
+ "delete.desc": "将把“{name}”从工作区列表中移除。文件夹与会话记录会保留,其会话将显示在“未分组”下。",
3435
+ "delete.pending": "正在删除工作区…",
3436
+ "menu.fork": "分叉会话",
3437
+ "menu.archiveSession": "归档会话",
3438
+ "menu.unarchiveSession": "取消归档",
3439
+ "menu.pinSession": "置顶会话",
3440
+ "menu.unpinSession": "取消置顶",
3441
+ "menu.sessionId": "复制 Session ID",
3442
+ "toast.sessionIdCopied": "Session ID 已复制",
3443
+ "toast.sessionIdCopyFailed": "复制失败,请重试",
3444
+ "row.archived": "已归档",
3445
+ "row.pinned": "已置顶",
3446
+ "toast.archivedNotOpenable": "已归档对话暂时无法查看,请取消归档后查看",
3447
+ "toast.archived": "会话已归档,可",
3448
+ "toast.stoppedAndArchived": "已停止并归档,可",
3449
+ "archive.confirm.title": "停止并归档此会话?",
3450
+ "archive.confirm.desc": "“{title}”仍有正在进行的工作。归档会先停止这些工作;之后可在侧栏筛选“全部对话(显示已归档)”中恢复会话,被停止的工作不会自动继续。",
3451
+ "archive.confirm.activity": "将被停止的工作",
3452
+ "archive.confirm.turn": "进行中的回合",
3453
+ "archive.confirm.subagents.one": "{n} 个运行中的子智能体:{names}",
3454
+ "archive.confirm.subagents.other": "{n} 个运行中的子智能体:{names}",
3455
+ "archive.confirm.jobs.one": "{n} 个后台任务:{names}",
3456
+ "archive.confirm.jobs.other": "{n} 个后台任务:{names}",
3457
+ "archive.confirm.schedules.one": "{n} 条定时提醒:{names}",
3458
+ "archive.confirm.schedules.other": "{n} 条定时提醒:{names}",
3459
+ "archive.confirm.other.one": "{n} 项其他工作({kind})",
3460
+ "archive.confirm.other.other": "{n} 项其他工作({kind})",
3461
+ "archive.confirm.listSeparator": "、",
3462
+ "archive.confirm.action": "停止并归档",
3463
+ "archive.confirm.pending": "正在停止并归档…",
3464
+ "toast.archivedUndo": "撤销",
3465
+ "toast.archivedOr": "或",
3466
+ "toast.archivedFilter": "筛选已归档会话",
3467
+ "toast.pinFailed": "置顶失败,请稍后重试",
3468
+ "toast.unpinFailed": "取消置顶失败,请稍后重试",
3469
+ "toast.createFailed": "新建会话失败:{message}",
3470
+ "toast.forkRequiresOpen": "请先打开原会话完成迁移,再创建分支",
3471
+ "toast.openForkSource": "打开原会话",
3472
+ "sessions.count.one": "{n} 个会话",
3473
+ "sessions.count.other": "{n} 个会话",
3474
+ "actions.workspace.aria": "工作区“{name}”的操作",
3475
+ "actions.session.aria": "会话“{name}”的操作",
3476
+ "actions.archive": "归档会话",
3477
+ "actions.unarchive": "取消归档",
3478
+ "actions.pin": "置顶会话",
3479
+ "actions.unpin": "取消置顶",
3480
+ "actions.newSession": "新会话",
3481
+ "actions.newSession.aria": "在“{name}”中新建会话",
3482
+ "status.running": "进行中",
3483
+ "status.subagentsRunning.one": "{n} 个子智能体运行中",
3484
+ "status.subagentsRunning.other": "{n} 个子智能体运行中",
3485
+ "status.idle": "空闲",
3486
+ "status.waitingApproval": "等待审批",
3487
+ "status.planReview": "计划待审",
3488
+ "status.waitingAnswer": "等待回答",
3489
+ "status.compact.approval": "待审批",
3490
+ "status.compact.planReview": "计划待审",
3491
+ "status.compact.answer": "待回答",
3492
+ "status.completed": "已完成",
3493
+ "hover.created": "创建于 {time}",
3494
+ "hover.copied": "已复制",
3495
+ "date.ymd": "{y}年{m}月{d}日",
3496
+ "time.now": "刚刚",
3497
+ "time.minutes": "{n}分钟",
3498
+ "time.hours": "{n}小时",
3499
+ "time.days": "{n}天",
3500
+ "time.months": "{n}个月",
3501
+ "time.years": "{n}年",
3502
+ "time.ago": "{t}前"
3503
+ };
3504
+ var en = {
3505
+ "defaultWorkspace.failed": "Unable to create default workspace. Use Choose workspace to select a folder.",
3506
+ "draft.workspaceRequired": "Choose a workspace first.",
3507
+ "draft.initializationFailed": "Could not fill the draft. Please try again shortly.",
3508
+ "group.ungrouped": "Ungrouped",
3509
+ "session.new": "New Session",
3510
+ "session.untitled": "Untitled",
3511
+ "shortcut.noSession": "Select a session first",
3512
+ "shortcut.noPicker": "Directory picker unavailable",
3513
+ "shortcut.directoryBusy": "Selecting or adding a workspace",
3514
+ "shortcut.noCompletedTurn": "This session has no completed turn",
3515
+ "shortcut.forkFailed": "Could not fork the session. Try again.",
3516
+ "section.workspaces": "Workspaces",
3517
+ "section.sessions": "Sessions",
3518
+ "viewOptions.label": "View options",
3519
+ "groupBy.label": "Group by",
3520
+ "groupBy.workspace": "WorkSpace",
3521
+ "groupBy.workspaceTree": "Workspace Tree",
3522
+ "groupBy.flat": "In one list",
3523
+ "groupBy.time": "By time",
3524
+ "timeBucket.pinned": "Pinned",
3525
+ "timeBucket.today": "Today",
3526
+ "timeBucket.yesterday": "Yesterday",
3527
+ "timeBucket.week": "This week",
3528
+ "timeBucket.earlier": "Earlier",
3529
+ "statusTabs.label": "Filter by status",
3530
+ "statusTab.all": "All",
3531
+ "statusTab.running": "Running",
3532
+ "statusTab.pending": "Awaiting",
3533
+ "statusTab.unread": "Unread",
3534
+ "orderBy.label": "Order by",
3535
+ "orderBy.manual": "Manual",
3536
+ "orderBy.updated": "Last updated",
3537
+ "filterBy.label": "Filter sessions",
3538
+ "viewOptions.hideArchived": "Hide archived",
3539
+ "viewOptions.showArchived": "All conversations (show archived)",
3540
+ "viewOptions.onlyArchived": "Archived only",
3541
+ "sessions.expand": "Show {n} more sessions",
3542
+ "sessions.collapse": "Show less",
3543
+ "empty.none": "No sessions yet",
3544
+ "empty.noneArchived": "No archived sessions yet",
3545
+ "empty.viewOthers": "View other sessions",
3546
+ "empty.noMatches": "No matches",
3547
+ "workspace.add": "Add workspace",
3548
+ "search.sessions.aria": "Search sessions",
3549
+ "search.placeholder": "Search session names",
3550
+ "search.clear": "Clear search",
3551
+ "search.results.aria": "Search results",
3552
+ "search.pending": "Searching session history…",
3553
+ "search.noMatches": "No matching sessions",
3554
+ "search.hasMore": "Showing the first {n} results. Narrow your search.",
3555
+ "menu.addWorkspace": "Add workspace…",
3556
+ "picker.loading": "Loading workspaces…",
3557
+ "conflict.named": "A workspace named “{name}” already exists.",
3558
+ "folderError.title": "Couldn’t open folder",
3559
+ "folderError.retry": "Choose again",
3560
+ "rename": "Rename",
3561
+ "rename.workspace.title": "Rename workspace",
3562
+ "rename.session.title": "Rename session",
3563
+ "field.workspaceName": "Workspace name",
3564
+ "field.sessionName": "Session name",
3565
+ "delete.workspace": "Delete workspace",
3566
+ "delete.desc": "This removes “{name}” from the workspace list. The folder and session logs will be kept. Its sessions will appear under Ungrouped.",
3567
+ "delete.pending": "Deleting workspace…",
3568
+ "menu.fork": "Fork session",
3569
+ "menu.archiveSession": "Archive session",
3570
+ "menu.unarchiveSession": "Unarchive session",
3571
+ "menu.pinSession": "Pin session",
3572
+ "menu.unpinSession": "Unpin session",
3573
+ "menu.sessionId": "Copy Session ID",
3574
+ "toast.sessionIdCopied": "Session ID copied",
3575
+ "toast.sessionIdCopyFailed": "Copy failed. Try again.",
3576
+ "row.archived": "Archived",
3577
+ "row.pinned": "Pinned",
3578
+ "toast.archivedNotOpenable": "Archived sessions cannot be opened. Unarchive it to view.",
3579
+ "toast.archived": "Session archived. You can ",
3580
+ "toast.stoppedAndArchived": "Session stopped and archived. You can ",
3581
+ "archive.confirm.title": "Stop and archive this session?",
3582
+ "archive.confirm.desc": "“{title}” still has work in progress. Archiving stops it first; you can restore the session later from the “All conversations (show archived)” filter in the sidebar, and the stopped work will not resume on its own.",
3583
+ "archive.confirm.activity": "Work that will be stopped",
3584
+ "archive.confirm.turn": "The turn in progress",
3585
+ "archive.confirm.subagents.one": "{n} running subagent: {names}",
3586
+ "archive.confirm.subagents.other": "{n} running subagents: {names}",
3587
+ "archive.confirm.jobs.one": "{n} background job: {names}",
3588
+ "archive.confirm.jobs.other": "{n} background jobs: {names}",
3589
+ "archive.confirm.schedules.one": "{n} scheduled reminder: {names}",
3590
+ "archive.confirm.schedules.other": "{n} scheduled reminders: {names}",
3591
+ "archive.confirm.other.one": "{n} other item of work ({kind})",
3592
+ "archive.confirm.other.other": "{n} other items of work ({kind})",
3593
+ "archive.confirm.listSeparator": ", ",
3594
+ "archive.confirm.action": "Stop and archive",
3595
+ "archive.confirm.pending": "Stopping and archiving…",
3596
+ "toast.archivedUndo": "undo",
3597
+ "toast.archivedOr": " or ",
3598
+ "toast.archivedFilter": "filter archived sessions",
3599
+ "toast.pinFailed": "Pin failed. Try again later.",
3600
+ "toast.unpinFailed": "Unpin failed. Try again later.",
3601
+ "toast.createFailed": "New session failed: {message}",
3602
+ "toast.forkRequiresOpen": "Open the original session to complete migration before creating a branch.",
3603
+ "toast.openForkSource": "Open original session",
3604
+ "sessions.count.one": "{n} session",
3605
+ "sessions.count.other": "{n} sessions",
3606
+ "actions.workspace.aria": "Workspace actions for {name}",
3607
+ "actions.session.aria": "Session actions for {name}",
3608
+ "actions.archive": "Archive",
3609
+ "actions.unarchive": "Unarchive",
3610
+ "actions.pin": "Pin",
3611
+ "actions.unpin": "Unpin",
3612
+ "actions.newSession": "New session",
3613
+ "actions.newSession.aria": "New session in {name}",
3614
+ "status.running": "Running",
3615
+ "status.subagentsRunning.one": "{n} subagent running",
3616
+ "status.subagentsRunning.other": "{n} subagents running",
3617
+ "status.idle": "Idle",
3618
+ "status.waitingApproval": "Waiting for approval",
3619
+ "status.planReview": "Plan awaiting review",
3620
+ "status.waitingAnswer": "Waiting for answer",
3621
+ "status.compact.approval": "Approval",
3622
+ "status.compact.planReview": "Plan review",
3623
+ "status.compact.answer": "Answer",
3624
+ "status.completed": "Completed",
3625
+ "hover.created": "Created {time}",
3626
+ "hover.copied": "Copied",
3627
+ "date.ymd": "{y}-{m}-{d}",
3628
+ "time.now": "now",
3629
+ "time.minutes": "{n}min",
3630
+ "time.hours": "{n}h",
3631
+ "time.days": "{n}d",
3632
+ "time.months": "{n}mo",
3633
+ "time.years": "{n}y",
3634
+ "time.ago": "{t} ago"
3635
+ };
3636
+ var ja = {
3637
+ "defaultWorkspace.failed": "デフォルトのワークスペースを作成できません。ワークスペースを選択してフォルダーを選んでください。",
3638
+ "draft.workspaceRequired": "先にワークスペースを選択してください。",
3639
+ "draft.initializationFailed": "下書きを埋め込めませんでした。しばらくしてからもう一度お試しください。",
3640
+ "group.ungrouped": "グループなし",
3641
+ "session.new": "新しいセッション",
3642
+ "session.untitled": "無題",
3643
+ "shortcut.noSession": "先にセッションを選択してください",
3644
+ "shortcut.noPicker": "ディレクトリピッカーを利用できません",
3645
+ "shortcut.directoryBusy": "ワークスペースを選択または追加しています",
3646
+ "shortcut.noCompletedTurn": "このセッションには完了したターンがありません",
3647
+ "shortcut.forkFailed": "セッションをフォークできませんでした。もう一度お試しください。",
3648
+ "section.workspaces": "ワークスペース",
3649
+ "section.sessions": "セッション",
3650
+ "viewOptions.label": "表示オプション",
3651
+ "groupBy.label": "グループ化",
3652
+ "groupBy.workspace": "ワークスペース",
3653
+ "groupBy.workspaceTree": "ワークスペースツリー",
3654
+ "groupBy.flat": "1つのリスト",
3655
+ "groupBy.time": "時間別",
3656
+ "timeBucket.pinned": "ピン留め",
3657
+ "timeBucket.today": "今日",
3658
+ "timeBucket.yesterday": "昨日",
3659
+ "timeBucket.week": "今週",
3660
+ "timeBucket.earlier": "それ以前",
3661
+ "statusTabs.label": "ステータスで絞り込み",
3662
+ "statusTab.all": "すべて",
3663
+ "statusTab.running": "実行中",
3664
+ "statusTab.pending": "確認待ち",
3665
+ "statusTab.unread": "未読",
3666
+ "orderBy.label": "並び順",
3667
+ "orderBy.manual": "手動",
3668
+ "orderBy.updated": "最終更新",
3669
+ "filterBy.label": "セッションを絞り込む",
3670
+ "viewOptions.hideArchived": "アーカイブを非表示",
3671
+ "viewOptions.showArchived": "すべての会話(アーカイブを表示)",
3672
+ "viewOptions.onlyArchived": "アーカイブのみ",
3673
+ "sessions.expand": "さらに{n}件のセッションを表示",
3674
+ "sessions.collapse": "折りたたむ",
3675
+ "empty.none": "セッションはまだありません",
3676
+ "empty.noneArchived": "アーカイブされたセッションはまだありません",
3677
+ "empty.viewOthers": "他のセッションを表示",
3678
+ "empty.noMatches": "一致なし",
3679
+ "workspace.add": "ワークスペースを追加",
3680
+ "search.sessions.aria": "セッションを検索",
3681
+ "search.placeholder": "セッション名を検索",
3682
+ "search.clear": "検索をクリア",
3683
+ "search.results.aria": "検索結果",
3684
+ "search.pending": "セッション履歴を検索中…",
3685
+ "search.noMatches": "一致するセッションはありません",
3686
+ "search.hasMore": "最初の{n}件の結果を表示しています。検索を絞り込んでください。",
3687
+ "menu.addWorkspace": "ワークスペースを追加…",
3688
+ "picker.loading": "ワークスペースを読み込み中…",
3689
+ "conflict.named": "「{name}」という名前のワークスペースは既に存在します。",
3690
+ "folderError.title": "フォルダーを開けませんでした",
3691
+ "folderError.retry": "選び直す",
3692
+ "rename": "名前を変更",
3693
+ "rename.workspace.title": "ワークスペース名を変更",
3694
+ "rename.session.title": "セッション名を変更",
3695
+ "field.workspaceName": "ワークスペース名",
3696
+ "field.sessionName": "セッション名",
3697
+ "delete.workspace": "ワークスペースを削除",
3698
+ "delete.desc": "「{name}」をワークスペース一覧から削除します。フォルダとセッションログは保持されます。このワークスペースのセッションは「未分類」に表示されます。",
3699
+ "delete.pending": "ワークスペースを削除中…",
3700
+ "menu.fork": "セッションをフォーク",
3701
+ "menu.archiveSession": "セッションをアーカイブ",
3702
+ "menu.unarchiveSession": "セッションのアーカイブを解除",
3703
+ "menu.pinSession": "セッションをピン留め",
3704
+ "menu.unpinSession": "セッションのピン留めを解除",
3705
+ "menu.sessionId": "セッションIDをコピー",
3706
+ "toast.sessionIdCopied": "セッションIDをコピーしました",
3707
+ "toast.sessionIdCopyFailed": "コピーに失敗しました。もう一度お試しください。",
3708
+ "row.archived": "アーカイブ済み",
3709
+ "row.pinned": "ピン留め済み",
3710
+ "toast.archivedNotOpenable": "アーカイブ済みセッションは開けません。アーカイブを解除して表示してください。",
3711
+ "toast.archived": "セッションをアーカイブしました。",
3712
+ "toast.stoppedAndArchived": "セッションを停止してアーカイブしました。",
3713
+ "archive.confirm.title": "このセッションを停止してアーカイブしますか?",
3714
+ "archive.confirm.desc": "「{title}」には進行中の作業があります。アーカイブするとまず停止されます。セッションは後からサイドバーの「すべての会話(アーカイブを表示)」フィルターで復元できますが、停止された作業は自動的に再開されません。",
3715
+ "archive.confirm.activity": "停止される作業",
3716
+ "archive.confirm.turn": "進行中のターン",
3717
+ "archive.confirm.subagents.one": "実行中のサブエージェント {n} 件: {names}",
3718
+ "archive.confirm.subagents.other": "実行中のサブエージェント {n} 件: {names}",
3719
+ "archive.confirm.jobs.one": "バックグラウンドジョブ {n} 件: {names}",
3720
+ "archive.confirm.jobs.other": "バックグラウンドジョブ {n} 件: {names}",
3721
+ "archive.confirm.schedules.one": "スケジュールされたリマインダー {n} 件: {names}",
3722
+ "archive.confirm.schedules.other": "スケジュールされたリマインダー {n} 件: {names}",
3723
+ "archive.confirm.other.one": "その他の作業 {n} 件({kind})",
3724
+ "archive.confirm.other.other": "その他の作業 {n} 件({kind})",
3725
+ "archive.confirm.listSeparator": "、",
3726
+ "archive.confirm.action": "停止してアーカイブ",
3727
+ "archive.confirm.pending": "停止してアーカイブ中…",
3728
+ "toast.archivedUndo": "元に戻す",
3729
+ "toast.archivedOr": " または ",
3730
+ "toast.archivedFilter": "アーカイブ済みセッションを絞り込む",
3731
+ "toast.pinFailed": "ピン留めに失敗しました。後でもう一度お試しください。",
3732
+ "toast.unpinFailed": "ピン留めの解除に失敗しました。後でもう一度お試しください。",
3733
+ "toast.createFailed": "新しいセッションの作成に失敗しました: {message}",
3734
+ "toast.forkRequiresOpen": "ブランチを作成する前に、移行を完了するため元のセッションを開いてください。",
3735
+ "toast.openForkSource": "元のセッションを開く",
3736
+ "sessions.count.one": "セッション {n} 件",
3737
+ "sessions.count.other": "セッション {n} 件",
3738
+ "actions.workspace.aria": "{name} のワークスペース操作",
3739
+ "actions.session.aria": "{name} のセッション操作",
3740
+ "actions.archive": "アーカイブ",
3741
+ "actions.unarchive": "アーカイブを解除",
3742
+ "actions.pin": "ピン留め",
3743
+ "actions.unpin": "ピン留めを解除",
3744
+ "actions.newSession": "新しいセッション",
3745
+ "actions.newSession.aria": "{name} で新しいセッション",
3746
+ "status.running": "実行中",
3747
+ "status.subagentsRunning.one": "サブエージェント {n} 件が実行中",
3748
+ "status.subagentsRunning.other": "サブエージェント {n} 件が実行中",
3749
+ "status.idle": "待機中",
3750
+ "status.waitingApproval": "承認待ち",
3751
+ "status.planReview": "計画のレビュー待ち",
3752
+ "status.waitingAnswer": "回答待ち",
3753
+ "status.compact.approval": "承認",
3754
+ "status.compact.planReview": "計画レビュー",
3755
+ "status.compact.answer": "回答",
3756
+ "status.completed": "完了",
3757
+ "hover.created": "作成日時 {time}",
3758
+ "hover.copied": "コピーしました",
3759
+ "date.ymd": "{y}-{m}-{d}",
3760
+ "time.now": "今",
3761
+ "time.minutes": "{n}分",
3762
+ "time.hours": "{n}時間",
3763
+ "time.days": "{n}日",
3764
+ "time.months": "{n}か月",
3765
+ "time.years": "{n}年",
3766
+ "time.ago": "{t}前"
3767
+ };
3768
+ var es = {
3769
+ "defaultWorkspace.failed": "No se puede crear el espacio de trabajo predeterminado. Utilice Elegir espacio de trabajo para seleccionar una carpeta.",
3770
+ "draft.workspaceRequired": "Elija un espacio de trabajo primero.",
3771
+ "draft.initializationFailed": "No se pudo completar el borrador. Inténtelo de nuevo en breve.",
3772
+ "group.ungrouped": "Desagrupados",
3773
+ "session.new": "Nueva sesión",
3774
+ "session.untitled": "Sin título",
3775
+ "shortcut.noSession": "Seleccione una sesión primero",
3776
+ "shortcut.noPicker": "Selector de directorio no disponible",
3777
+ "shortcut.directoryBusy": "Seleccionar o agregar un espacio de trabajo",
3778
+ "shortcut.noCompletedTurn": "Esta sesión no tiene turno completo",
3779
+ "shortcut.forkFailed": "No se pudo bifurcar la sesión. Intentar otra vez.",
3780
+ "section.workspaces": "Espacios de trabajo",
3781
+ "section.sessions": "Sesiones",
3782
+ "viewOptions.label": "Ver opciones",
3783
+ "groupBy.label": "Agrupar por",
3784
+ "groupBy.workspace": "Espacio de trabajo",
3785
+ "groupBy.workspaceTree": "Árbol del espacio de trabajo",
3786
+ "groupBy.flat": "en una lista",
3787
+ "groupBy.time": "Por tiempo",
3788
+ "timeBucket.pinned": "Fijadas",
3789
+ "timeBucket.today": "Hoy",
3790
+ "timeBucket.yesterday": "Ayer",
3791
+ "timeBucket.week": "Esta semana",
3792
+ "timeBucket.earlier": "Anteriores",
3793
+ "statusTabs.label": "Filtrar por estado",
3794
+ "statusTab.all": "Todas",
3795
+ "statusTab.running": "En ejecución",
3796
+ "statusTab.pending": "Pendientes",
3797
+ "statusTab.unread": "Sin leer",
3798
+ "orderBy.label": "Ordenar por",
3799
+ "orderBy.manual": "manuales",
3800
+ "orderBy.updated": "Última actualización",
3801
+ "filterBy.label": "Filtrar sesiones",
3802
+ "viewOptions.hideArchived": "Ocultar archivado",
3803
+ "viewOptions.showArchived": "Todas las conversaciones (mostrar archivadas)",
3804
+ "viewOptions.onlyArchived": "Sólo archivado",
3805
+ "sessions.expand": "Mostrar {n} más sesiones",
3806
+ "sessions.collapse": "Mostrar menos",
3807
+ "empty.none": "Aún no hay sesiones",
3808
+ "empty.noneArchived": "Aún no hay sesiones archivadas",
3809
+ "empty.viewOthers": "Ver otras sesiones",
3810
+ "empty.noMatches": "No hay coincidencias",
3811
+ "workspace.add": "Agregar espacio de trabajo",
3812
+ "search.sessions.aria": "Buscar sesiones",
3813
+ "search.placeholder": "Buscar nombres de sesiones",
3814
+ "search.clear": "Borrar búsqueda",
3815
+ "search.results.aria": "Resultados de la búsqueda",
3816
+ "search.pending": "Buscando el historial de sesiones…",
3817
+ "search.noMatches": "No hay sesiones coincidentes",
3818
+ "search.hasMore": "Mostrando los primeros resultados de {n}. Limita tu búsqueda.",
3819
+ "menu.addWorkspace": "Agregar espacio de trabajo…",
3820
+ "picker.loading": "Cargando espacios de trabajo…",
3821
+ "conflict.named": 'Ya existe un espacio de trabajo denominado "{name}".',
3822
+ "folderError.title": "No se pudo abrir la carpeta",
3823
+ "folderError.retry": "Elige de nuevo",
3824
+ "rename": "Cambiar nombre",
3825
+ "rename.workspace.title": "Cambiar nombre del espacio de trabajo",
3826
+ "rename.session.title": "Cambiar nombre de sesión",
3827
+ "field.workspaceName": "Nombre del espacio de trabajo",
3828
+ "field.sessionName": "Nombre de la sesión",
3829
+ "delete.workspace": "Eliminar espacio de trabajo",
3830
+ "delete.desc": 'Esto elimina "{name}" de la lista de espacios de trabajo. Se conservarán los registros de carpetas y sesiones. Sus sesiones aparecerán en Desagrupadas.',
3831
+ "delete.pending": "Eliminando espacio de trabajo…",
3832
+ "menu.fork": "Crear una bifurcación de la sesión",
3833
+ "menu.archiveSession": "Sesión de archivo",
3834
+ "menu.unarchiveSession": "Desarchivar sesión",
3835
+ "menu.pinSession": "Fijar sesión",
3836
+ "menu.unpinSession": "Desfijar sesión",
3837
+ "menu.sessionId": "Copiar ID de sesión",
3838
+ "toast.sessionIdCopied": "ID de sesión copiada",
3839
+ "toast.sessionIdCopyFailed": "La copia falló. Intentar otra vez.",
3840
+ "row.archived": "Archivado",
3841
+ "row.pinned": "Fijado",
3842
+ "toast.archivedNotOpenable": "Las sesiones archivadas no se pueden abrir. Desarchivarlo para verlo.",
3843
+ "toast.archived": "Sesión archivada. tu puedes ",
3844
+ "toast.stoppedAndArchived": "Sesión detenida y archivada. tu puedes ",
3845
+ "archive.confirm.title": "¿Detener y archivar esta sesión?",
3846
+ "archive.confirm.desc": "“{title}” todavía tiene trabajo en progreso. Archivarlo lo detiene primero; puedes restaurar la sesión más tarde desde el filtro “Todas las conversaciones (mostrar archivadas)” en la barra lateral, y el trabajo detenido no se reanudará por sí solo.",
3847
+ "archive.confirm.activity": "Trabajo que será detenido",
3848
+ "archive.confirm.turn": "El turno en curso",
3849
+ "archive.confirm.subagents.one": "{n} ejecutando subagente: {names}",
3850
+ "archive.confirm.subagents.other": "{n} ejecutando subagentes: {names}",
3851
+ "archive.confirm.jobs.one": "Trabajo en segundo plano {n}: {names}",
3852
+ "archive.confirm.jobs.other": "Trabajos en segundo plano {n}: {names}",
3853
+ "archive.confirm.schedules.one": "Recordatorio programado {n}: {names}",
3854
+ "archive.confirm.schedules.other": "{n} recordatorios programados: {names}",
3855
+ "archive.confirm.other.one": "{n} otro elemento de trabajo ({kind})",
3856
+ "archive.confirm.other.other": "{n} otros elementos de trabajo ({kind})",
3857
+ "archive.confirm.listSeparator": ", ",
3858
+ "archive.confirm.action": "Detener y archivar",
3859
+ "archive.confirm.pending": "Deteniendo y archivando…",
3860
+ "toast.archivedUndo": "deshacer",
3861
+ "toast.archivedOr": " o ",
3862
+ "toast.archivedFilter": "filtrar sesiones archivadas",
3863
+ "toast.pinFailed": "No se pudo fijar. Inténtalo de nuevo más tarde.",
3864
+ "toast.unpinFailed": "No se pudo desfijar. Inténtalo de nuevo más tarde.",
3865
+ "toast.createFailed": "Nueva sesión falló: {message}",
3866
+ "toast.forkRequiresOpen": "Abra la sesión original para completar la migración antes de crear una rama.",
3867
+ "toast.openForkSource": "Abrir sesión original",
3868
+ "sessions.count.one": "Sesión {n}",
3869
+ "sessions.count.other": "Sesiones {n}",
3870
+ "actions.workspace.aria": "Acciones del espacio de trabajo para {name}",
3871
+ "actions.session.aria": "Acciones de sesión para {name}",
3872
+ "actions.archive": "Archivo",
3873
+ "actions.unarchive": "Desarchivar",
3874
+ "actions.pin": "Fijar",
3875
+ "actions.unpin": "Desfijar",
3876
+ "actions.newSession": "Nueva sesión",
3877
+ "actions.newSession.aria": "Nueva sesión en {name}",
3878
+ "status.running": "corriendo",
3879
+ "status.subagentsRunning.one": "Subagente {n} ejecutándose",
3880
+ "status.subagentsRunning.other": "Subagentes {n} ejecutándose",
3881
+ "status.idle": "inactivo",
3882
+ "status.waitingApproval": "Esperando aprobación",
3883
+ "status.planReview": "Plan pendiente de revisión",
3884
+ "status.waitingAnswer": "esperando respuesta",
3885
+ "status.compact.approval": "Aprobación",
3886
+ "status.compact.planReview": "Revisión del plan",
3887
+ "status.compact.answer": "respuesta",
3888
+ "status.completed": "Completado",
3889
+ "hover.created": "Creado {time}",
3890
+ "hover.copied": "Copiado",
3891
+ "date.ymd": "{y}-{m}-{d}",
3892
+ "time.now": "ahora",
3893
+ "time.minutes": "{n}min",
3894
+ "time.hours": "{n}h",
3895
+ "time.days": "{n}d",
3896
+ "time.months": "{n}mo",
3897
+ "time.years": "{n}y",
3898
+ "time.ago": "Hace {t}"
3899
+ };
3900
+ var fr = {
3901
+ "defaultWorkspace.failed": "Impossible de créer un espace de travail par défaut. Utilisez Choisir un espace de travail pour sélectionner un dossier.",
3902
+ "draft.workspaceRequired": "Choisissez d'abord un espace de travail.",
3903
+ "draft.initializationFailed": "Impossible de remplir le projet. Veuillez réessayer sous peu.",
3904
+ "group.ungrouped": "Non groupé",
3905
+ "session.new": "Nouvelle séance",
3906
+ "session.untitled": "Sans titre",
3907
+ "shortcut.noSession": "Sélectionnez d'abord une session",
3908
+ "shortcut.noPicker": "Sélecteur de répertoire indisponible",
3909
+ "shortcut.directoryBusy": "Sélection ou ajout d'un espace de travail",
3910
+ "shortcut.noCompletedTurn": "Cette session n'a pas de tour terminé",
3911
+ "shortcut.forkFailed": "Impossible de bifurquer la session. Essayer à nouveau.",
3912
+ "section.workspaces": "Espaces de travail",
3913
+ "section.sessions": "Séances",
3914
+ "viewOptions.label": "Afficher les options",
3915
+ "groupBy.label": "Regrouper par",
3916
+ "groupBy.workspace": "Espace de travail",
3917
+ "groupBy.workspaceTree": "Arborescence de l'espace de travail",
3918
+ "groupBy.flat": "Dans une liste",
3919
+ "groupBy.time": "Par date",
3920
+ "timeBucket.pinned": "Épinglées",
3921
+ "timeBucket.today": "Aujourd'hui",
3922
+ "timeBucket.yesterday": "Hier",
3923
+ "timeBucket.week": "Cette semaine",
3924
+ "timeBucket.earlier": "Plus anciennes",
3925
+ "statusTabs.label": "Filtrer par état",
3926
+ "statusTab.all": "Toutes",
3927
+ "statusTab.running": "En cours",
3928
+ "statusTab.pending": "En attente",
3929
+ "statusTab.unread": "Non lues",
3930
+ "orderBy.label": "Commander par",
3931
+ "orderBy.manual": "Manuel",
3932
+ "orderBy.updated": "Dernière mise à jour",
3933
+ "filterBy.label": "Filtrer les sessions",
3934
+ "viewOptions.hideArchived": "Masquer les archives",
3935
+ "viewOptions.showArchived": "Toutes les conversations (afficher les archives)",
3936
+ "viewOptions.onlyArchived": "Archivé uniquement",
3937
+ "sessions.expand": "Afficher {n} plus de sessions",
3938
+ "sessions.collapse": "Afficher moins",
3939
+ "empty.none": "Aucune séance pour l'instant",
3940
+ "empty.noneArchived": "Aucune session archivée pour l'instant",
3941
+ "empty.viewOthers": "Voir les autres séances",
3942
+ "empty.noMatches": "Aucune correspondance",
3943
+ "workspace.add": "Ajouter un espace de travail",
3944
+ "search.sessions.aria": "Rechercher des sessions",
3945
+ "search.placeholder": "Rechercher des noms de sessions",
3946
+ "search.clear": "Effacer la recherche",
3947
+ "search.results.aria": "Résultats de la recherche",
3948
+ "search.pending": "Recherche dans l'historique des sessions…",
3949
+ "search.noMatches": "Aucune session correspondante",
3950
+ "search.hasMore": "Affichage des premiers résultats {n}. Affinez votre recherche.",
3951
+ "menu.addWorkspace": "Ajouter un espace de travail…",
3952
+ "picker.loading": "Chargement des espaces de travail…",
3953
+ "conflict.named": "Un espace de travail nommé « {name} » existe déjà.",
3954
+ "folderError.title": "Impossible d'ouvrir le dossier",
3955
+ "folderError.retry": "Choisir à nouveau",
3956
+ "rename": "Renommer",
3957
+ "rename.workspace.title": "Renommer l'espace de travail",
3958
+ "rename.session.title": "Renommer la session",
3959
+ "field.workspaceName": "Nom de l'espace de travail",
3960
+ "field.sessionName": "Nom de la séance",
3961
+ "delete.workspace": "Supprimer l'espace de travail",
3962
+ "delete.desc": "Cela supprime « {name} » de la liste des espaces de travail. Les journaux de dossiers et de sessions seront conservés. Ses sessions apparaîtront sous Non groupées.",
3963
+ "delete.pending": "Suppression de l'espace de travail…",
3964
+ "menu.fork": "Créer une branche de la session",
3965
+ "menu.archiveSession": "Séance d'archivage",
3966
+ "menu.unarchiveSession": "Session de désarchivage",
3967
+ "menu.pinSession": "Épingler la session",
3968
+ "menu.unpinSession": "Désépingler la session",
3969
+ "menu.sessionId": "Copier l'ID de session",
3970
+ "toast.sessionIdCopied": "ID de session copié",
3971
+ "toast.sessionIdCopyFailed": "La copie a échoué. Essayer à nouveau.",
3972
+ "row.archived": "Archivé",
3973
+ "row.pinned": "Épinglé",
3974
+ "toast.archivedNotOpenable": "Les sessions archivées ne peuvent pas être ouvertes. Désarchivez-le pour le visualiser.",
3975
+ "toast.archived": "Séance archivée. Vous pouvez ",
3976
+ "toast.stoppedAndArchived": "Session arrêtée et archivée. Vous pouvez ",
3977
+ "archive.confirm.title": "Arrêter et archiver cette session ?",
3978
+ "archive.confirm.desc": "« {title} » a encore des travaux en cours. L'archivage l'arrête en premier ; vous pouvez restaurer la session plus tard à partir du filtre « Toutes les conversations (afficher les archives) » dans la barre latérale, et le travail arrêté ne reprendra pas de lui-même.",
3979
+ "archive.confirm.activity": "Travaux qui seront arrêtés",
3980
+ "archive.confirm.turn": "Le tour en cours",
3981
+ "archive.confirm.subagents.one": "Sous-agent en cours d'exécution {n} : {names}",
3982
+ "archive.confirm.subagents.other": "{n} exécutant des sous-agents : {names}",
3983
+ "archive.confirm.jobs.one": "Travail en arrière-plan {n} : {names}",
3984
+ "archive.confirm.jobs.other": "Travaux en arrière-plan {n} : {names}",
3985
+ "archive.confirm.schedules.one": "Rappel programmé {n} : {names}",
3986
+ "archive.confirm.schedules.other": "Rappels programmés {n} : {names}",
3987
+ "archive.confirm.other.one": "{n} autre élément de travail ({kind})",
3988
+ "archive.confirm.other.other": "{n} autres éléments de travail ({kind})",
3989
+ "archive.confirm.listSeparator": ", ",
3990
+ "archive.confirm.action": "Arrêter et archiver",
3991
+ "archive.confirm.pending": "Arrêt et archivage…",
3992
+ "toast.archivedUndo": "annuler",
3993
+ "toast.archivedOr": " ou ",
3994
+ "toast.archivedFilter": "filtrer les sessions archivées",
3995
+ "toast.pinFailed": "L’épinglage a échoué. Réessayez plus tard.",
3996
+ "toast.unpinFailed": "Impossible de désépingler. Réessayez plus tard.",
3997
+ "toast.createFailed": "Échec de la nouvelle session : {message}",
3998
+ "toast.forkRequiresOpen": "Ouvrez la session d'origine pour terminer la migration avant de créer une branche.",
3999
+ "toast.openForkSource": "Ouvrir la session originale",
4000
+ "sessions.count.one": "Séance {n}",
4001
+ "sessions.count.other": "Séances {n}",
4002
+ "actions.workspace.aria": "Actions de l'espace de travail pour {name}",
4003
+ "actions.session.aria": "Actions de session pour {name}",
4004
+ "actions.archive": "Archiver",
4005
+ "actions.unarchive": "Désarchiver",
4006
+ "actions.pin": "Épingler",
4007
+ "actions.unpin": "Désépingler",
4008
+ "actions.newSession": "Nouvelle séance",
4009
+ "actions.newSession.aria": "Nouvelle séance dans {name}",
4010
+ "status.running": "Courir",
4011
+ "status.subagentsRunning.one": "Sous-agent {n} en cours d'exécution",
4012
+ "status.subagentsRunning.other": "Sous-agents {n} en cours d'exécution",
4013
+ "status.idle": "Inactif",
4014
+ "status.waitingApproval": "En attente d'approbation",
4015
+ "status.planReview": "Plan en attente d'examen",
4016
+ "status.waitingAnswer": "En attente de réponse",
4017
+ "status.compact.approval": "Approbation",
4018
+ "status.compact.planReview": "Révision des plans",
4019
+ "status.compact.answer": "Réponse",
4020
+ "status.completed": "Terminé",
4021
+ "hover.created": "Créé {time}",
4022
+ "hover.copied": "Copié",
4023
+ "date.ymd": "{y}-{m}-{d}",
4024
+ "time.now": "maintenant",
4025
+ "time.minutes": "{n}min",
4026
+ "time.hours": "{n}h",
4027
+ "time.days": "{n}d",
4028
+ "time.months": "{n}mo",
4029
+ "time.years": "{n}y",
4030
+ "time.ago": "Il y a {t}"
4031
+ };
4032
+ var de = {
4033
+ "defaultWorkspace.failed": "Der Standardarbeitsbereich kann nicht erstellt werden. Verwenden Sie „Arbeitsbereich auswählen“, um einen Ordner auszuwählen.",
4034
+ "draft.workspaceRequired": "Wählen Sie zunächst einen Arbeitsbereich.",
4035
+ "draft.initializationFailed": "Der Entwurf konnte nicht ausgefüllt werden. Bitte versuchen Sie es in Kürze noch einmal.",
4036
+ "group.ungrouped": "Nicht gruppiert",
4037
+ "session.new": "Neue Sitzung",
4038
+ "session.untitled": "Ohne Titel",
4039
+ "shortcut.noSession": "Wählen Sie zunächst eine Sitzung aus",
4040
+ "shortcut.noPicker": "Verzeichnisauswahl nicht verfügbar",
4041
+ "shortcut.directoryBusy": "Auswählen oder Hinzufügen eines Arbeitsbereichs",
4042
+ "shortcut.noCompletedTurn": "Diese Sitzung hat keine abgeschlossene Runde",
4043
+ "shortcut.forkFailed": "Die Sitzung konnte nicht aufgeteilt werden. Versuchen Sie es erneut.",
4044
+ "section.workspaces": "Arbeitsbereiche",
4045
+ "section.sessions": "Sitzungen",
4046
+ "viewOptions.label": "Optionen anzeigen",
4047
+ "groupBy.label": "Gruppieren nach",
4048
+ "groupBy.workspace": "WorkSpace",
4049
+ "groupBy.workspaceTree": "Arbeitsbereichsbaum",
4050
+ "groupBy.flat": "In einer Liste",
4051
+ "groupBy.time": "Nach Zeit",
4052
+ "timeBucket.pinned": "Angeheftet",
4053
+ "timeBucket.today": "Heute",
4054
+ "timeBucket.yesterday": "Gestern",
4055
+ "timeBucket.week": "Diese Woche",
4056
+ "timeBucket.earlier": "Älter",
4057
+ "statusTabs.label": "Nach Status filtern",
4058
+ "statusTab.all": "Alle",
4059
+ "statusTab.running": "Laufend",
4060
+ "statusTab.pending": "Wartend",
4061
+ "statusTab.unread": "Ungelesen",
4062
+ "orderBy.label": "Bestellen nach",
4063
+ "orderBy.manual": "Handbuch",
4064
+ "orderBy.updated": "Zuletzt aktualisiert",
4065
+ "filterBy.label": "Sitzungen filtern",
4066
+ "viewOptions.hideArchived": "Archiviert ausblenden",
4067
+ "viewOptions.showArchived": "Alle Gespräche (archiviert anzeigen)",
4068
+ "viewOptions.onlyArchived": "Nur archiviert",
4069
+ "sessions.expand": "Weitere Sitzungen anzeigen {n}",
4070
+ "sessions.collapse": "Weniger anzeigen",
4071
+ "empty.none": "Noch keine Sitzungen",
4072
+ "empty.noneArchived": "Noch keine archivierten Sitzungen",
4073
+ "empty.viewOthers": "Andere Sitzungen anzeigen",
4074
+ "empty.noMatches": "Keine Übereinstimmungen",
4075
+ "workspace.add": "Arbeitsbereich hinzufügen",
4076
+ "search.sessions.aria": "Sitzungen suchen",
4077
+ "search.placeholder": "Suchen Sie nach Sitzungsnamen",
4078
+ "search.clear": "Suche löschen",
4079
+ "search.results.aria": "Suchergebnisse",
4080
+ "search.pending": "Sitzungsverlauf wird durchsucht…",
4081
+ "search.noMatches": "Keine passenden Sitzungen",
4082
+ "search.hasMore": "Zeigt die ersten {n}-Ergebnisse. Grenzen Sie Ihre Suche ein.",
4083
+ "menu.addWorkspace": "Arbeitsbereich hinzufügen…",
4084
+ "picker.loading": "Arbeitsbereiche werden geladen…",
4085
+ "conflict.named": "Ein Arbeitsbereich mit dem Namen „{name}“ ist bereits vorhanden.",
4086
+ "folderError.title": "Der Ordner konnte nicht geöffnet werden",
4087
+ "folderError.retry": "Wählen Sie erneut",
4088
+ "rename": "Umbenennen",
4089
+ "rename.workspace.title": "Arbeitsbereich umbenennen",
4090
+ "rename.session.title": "Sitzung umbenennen",
4091
+ "field.workspaceName": "Name des Arbeitsbereichs",
4092
+ "field.sessionName": "Sitzungsname",
4093
+ "delete.workspace": "Arbeitsbereich löschen",
4094
+ "delete.desc": "Dadurch wird „{name}“ aus der Arbeitsbereichsliste entfernt. Die Ordner- und Sitzungsprotokolle werden aufbewahrt. Seine Sitzungen werden unter „Nicht gruppiert“ angezeigt.",
4095
+ "delete.pending": "Arbeitsbereich wird gelöscht…",
4096
+ "menu.fork": "Sitzung abzweigen",
4097
+ "menu.archiveSession": "Archivsitzung",
4098
+ "menu.unarchiveSession": "Sitzung dearchivieren",
4099
+ "menu.pinSession": "Sitzung anheften",
4100
+ "menu.unpinSession": "Sitzung lösen",
4101
+ "menu.sessionId": "Sitzungs-ID kopieren",
4102
+ "toast.sessionIdCopied": "Sitzungs-ID kopiert",
4103
+ "toast.sessionIdCopyFailed": "Der Kopiervorgang ist fehlgeschlagen. Versuchen Sie es erneut.",
4104
+ "row.archived": "Archiviert",
4105
+ "row.pinned": "Angepinnt",
4106
+ "toast.archivedNotOpenable": "Archivierte Sitzungen können nicht geöffnet werden. Entpacken Sie es zur Ansicht.",
4107
+ "toast.archived": "Sitzung archiviert. Du kannst ",
4108
+ "toast.stoppedAndArchived": "Sitzung gestoppt und archiviert. Du kannst ",
4109
+ "archive.confirm.title": "Diese Sitzung stoppen und archivieren?",
4110
+ "archive.confirm.desc": "„{title}“ ist noch in Arbeit. Die Archivierung stoppt es zunächst; Sie können die Sitzung später über den Filter „Alle Konversationen (archivierte anzeigen)“ in der Seitenleiste wiederherstellen, und die angehaltene Arbeit wird nicht von alleine fortgesetzt.",
4111
+ "archive.confirm.activity": "Arbeiten, die gestoppt werden",
4112
+ "archive.confirm.turn": "Die laufende Runde",
4113
+ "archive.confirm.subagents.one": "{n}, laufender Subagent: {names}",
4114
+ "archive.confirm.subagents.other": "{n}, auf dem Subagenten ausgeführt werden: {names}",
4115
+ "archive.confirm.jobs.one": "{n} Hintergrundjob: {names}",
4116
+ "archive.confirm.jobs.other": "{n} Hintergrundjobs: {names}",
4117
+ "archive.confirm.schedules.one": "{n} geplante Erinnerung: {names}",
4118
+ "archive.confirm.schedules.other": "{n} geplante Erinnerungen: {names}",
4119
+ "archive.confirm.other.one": "{n} sonstiger Arbeitsgegenstand ({kind})",
4120
+ "archive.confirm.other.other": "{n} sonstige Arbeiten ({kind})",
4121
+ "archive.confirm.listSeparator": ", ",
4122
+ "archive.confirm.action": "Stoppen und archivieren",
4123
+ "archive.confirm.pending": "Stoppen und archivieren…",
4124
+ "toast.archivedUndo": "rückgängig machen",
4125
+ "toast.archivedOr": " oder ",
4126
+ "toast.archivedFilter": "Archivierte Sitzungen filtern",
4127
+ "toast.pinFailed": "Anheften fehlgeschlagen. Versuchen Sie es später erneut.",
4128
+ "toast.unpinFailed": "Lösen fehlgeschlagen. Versuchen Sie es später erneut.",
4129
+ "toast.createFailed": "Neue Sitzung fehlgeschlagen: {message}",
4130
+ "toast.forkRequiresOpen": "Öffnen Sie die ursprüngliche Sitzung, um die Migration abzuschließen, bevor Sie einen Zweig erstellen.",
4131
+ "toast.openForkSource": "Öffnen Sie die ursprüngliche Sitzung",
4132
+ "sessions.count.one": "{n}-Sitzung",
4133
+ "sessions.count.other": "{n}-Sitzungen",
4134
+ "actions.workspace.aria": "Arbeitsbereichsaktionen für {name}",
4135
+ "actions.session.aria": "Sitzungsaktionen für {name}",
4136
+ "actions.archive": "Archiv",
4137
+ "actions.unarchive": "Dearchivieren",
4138
+ "actions.pin": "Anheften",
4139
+ "actions.unpin": "Lösen",
4140
+ "actions.newSession": "Neue Sitzung",
4141
+ "actions.newSession.aria": "Neue Sitzung in {name}",
4142
+ "status.running": "Laufen",
4143
+ "status.subagentsRunning.one": "{n}-Subagent läuft",
4144
+ "status.subagentsRunning.other": "{n} Subagenten laufen",
4145
+ "status.idle": "Leerlauf",
4146
+ "status.waitingApproval": "Warten auf Genehmigung",
4147
+ "status.planReview": "Plan wartet auf Überprüfung",
4148
+ "status.waitingAnswer": "Warte auf Antwort",
4149
+ "status.compact.approval": "Zustimmung",
4150
+ "status.compact.planReview": "Planüberprüfung",
4151
+ "status.compact.answer": "Antwort",
4152
+ "status.completed": "Abgeschlossen",
4153
+ "hover.created": "Erstellt {time}",
4154
+ "hover.copied": "Kopiert",
4155
+ "date.ymd": "{y}-{m}-{d}",
4156
+ "time.now": "jetzt",
4157
+ "time.minutes": "{n}min",
4158
+ "time.hours": "{n}h",
4159
+ "time.days": "{n}d",
4160
+ "time.months": "{n}mo",
4161
+ "time.years": "{n}y",
4162
+ "time.ago": "Vor {t}"
4163
+ };
4164
+ var ru = {
4165
+ "defaultWorkspace.failed": "Невозможно создать рабочую область по умолчанию. Используйте «Выбрать рабочее пространство», чтобы выбрать папку.",
4166
+ "draft.workspaceRequired": "Сначала выберите рабочее место.",
4167
+ "draft.initializationFailed": "Не удалось заполнить черновик. Пожалуйста, повторите попытку в ближайшее время.",
4168
+ "group.ungrouped": "Разгруппировано",
4169
+ "session.new": "Новая сессия",
4170
+ "session.untitled": "Без названия",
4171
+ "shortcut.noSession": "Сначала выберите сеанс",
4172
+ "shortcut.noPicker": "Выбор каталога недоступен.",
4173
+ "shortcut.directoryBusy": "Выбор или добавление рабочего пространства",
4174
+ "shortcut.noCompletedTurn": "В этой сессии нет завершенных ходов",
4175
+ "shortcut.forkFailed": "Не удалось разветвить сеанс. Попробуйте еще раз.",
4176
+ "section.workspaces": "Рабочие пространства",
4177
+ "section.sessions": "Сессии",
4178
+ "viewOptions.label": "Посмотреть варианты",
4179
+ "groupBy.label": "Группировать по",
4180
+ "groupBy.workspace": "Рабочее пространство",
4181
+ "groupBy.workspaceTree": "Дерево рабочей области",
4182
+ "groupBy.flat": "В одном списке",
4183
+ "groupBy.time": "По времени",
4184
+ "timeBucket.pinned": "Закреплённые",
4185
+ "timeBucket.today": "Сегодня",
4186
+ "timeBucket.yesterday": "Вчера",
4187
+ "timeBucket.week": "На этой неделе",
4188
+ "timeBucket.earlier": "Раньше",
4189
+ "statusTabs.label": "Фильтр по статусу",
4190
+ "statusTab.all": "Все",
4191
+ "statusTab.running": "Активные",
4192
+ "statusTab.pending": "Ожидают",
4193
+ "statusTab.unread": "Непрочитанные",
4194
+ "orderBy.label": "Заказать по",
4195
+ "orderBy.manual": "Руководство",
4196
+ "orderBy.updated": "Последнее обновление",
4197
+ "filterBy.label": "Фильтровать сеансы",
4198
+ "viewOptions.hideArchived": "Скрыть в архиве",
4199
+ "viewOptions.showArchived": "Все разговоры (показать в архиве)",
4200
+ "viewOptions.onlyArchived": "Только в архиве",
4201
+ "sessions.expand": "Показать больше сеансов {n}",
4202
+ "sessions.collapse": "Показать меньше",
4203
+ "empty.none": "Сеансов пока нет",
4204
+ "empty.noneArchived": "Архивированных сессий пока нет",
4205
+ "empty.viewOthers": "Посмотреть другие сессии",
4206
+ "empty.noMatches": "Нет совпадений",
4207
+ "workspace.add": "Добавить рабочую область",
4208
+ "search.sessions.aria": "Поиск сеансов",
4209
+ "search.placeholder": "Поиск названий сеансов",
4210
+ "search.clear": "Очистить поиск",
4211
+ "search.results.aria": "Результаты поиска",
4212
+ "search.pending": "Поиск истории сеансов…",
4213
+ "search.noMatches": "Нет подходящих сеансов",
4214
+ "search.hasMore": "Показаны первые результаты {n}. Сузьте область поиска.",
4215
+ "menu.addWorkspace": "Добавить рабочее пространство…",
4216
+ "picker.loading": "Загрузка рабочих областей…",
4217
+ "conflict.named": "Рабочая область с именем «{name}» уже существует.",
4218
+ "folderError.title": "Не удалось открыть папку",
4219
+ "folderError.retry": "Выбрать еще раз",
4220
+ "rename": "Переименовать",
4221
+ "rename.workspace.title": "Переименовать рабочую область",
4222
+ "rename.session.title": "Переименовать сеанс",
4223
+ "field.workspaceName": "Имя рабочей области",
4224
+ "field.sessionName": "Имя сеанса",
4225
+ "delete.workspace": "Удалить рабочую область",
4226
+ "delete.desc": "Это удалит «{name}» из списка рабочей области. Журналы папок и сеансов будут сохранены. Его сеансы появятся в разделе «Разгруппировано».",
4227
+ "delete.pending": "Удаление рабочей области…",
4228
+ "menu.fork": "Создать ответвление сеанса",
4229
+ "menu.archiveSession": "Архив сеанса",
4230
+ "menu.unarchiveSession": "Разархивировать сеанс",
4231
+ "menu.pinSession": "Закрепить сеанс",
4232
+ "menu.unpinSession": "Открепить сеанс",
4233
+ "menu.sessionId": "Копировать идентификатор сеанса",
4234
+ "toast.sessionIdCopied": "Идентификатор сеанса скопирован.",
4235
+ "toast.sessionIdCopyFailed": "Копировать не удалось. Попробуйте еще раз.",
4236
+ "row.archived": "В архиве",
4237
+ "row.pinned": "Закреплено",
4238
+ "toast.archivedNotOpenable": "Архивированные сеансы невозможно открыть. Разархивируйте его для просмотра.",
4239
+ "toast.archived": "Сессия заархивирована. Вы можете ",
4240
+ "toast.stoppedAndArchived": "Сеанс остановлен и заархивирован. Вы можете ",
4241
+ "archive.confirm.title": "Остановить и заархивировать этот сеанс?",
4242
+ "archive.confirm.desc": "Над «{title}» все еще ведется работа. Архивирование останавливает его первым; восстановить сессию можно позже из фильтра «Все разговоры (показать в архиве)» в боковой панели, при этом остановленная работа не возобновится сама по себе.",
4243
+ "archive.confirm.activity": "Работа, которая будет остановлена",
4244
+ "archive.confirm.turn": "Текущий ход",
4245
+ "archive.confirm.subagents.one": "{n} работающий субагент: {names}",
4246
+ "archive.confirm.subagents.other": "{n} работающие субагенты: {names}",
4247
+ "archive.confirm.jobs.one": "{n} фоновое задание: {names}",
4248
+ "archive.confirm.jobs.other": "{n} фоновые задания: {names}",
4249
+ "archive.confirm.schedules.one": "Запланированное напоминание {n}: {names}",
4250
+ "archive.confirm.schedules.other": "Запланированные напоминания {n}: {names}",
4251
+ "archive.confirm.other.one": "{n} другой элемент работы ({kind})",
4252
+ "archive.confirm.other.other": "{n} прочие работы ({kind})",
4253
+ "archive.confirm.listSeparator": ", ",
4254
+ "archive.confirm.action": "Остановить и заархивировать",
4255
+ "archive.confirm.pending": "Остановка и архивирование…",
4256
+ "toast.archivedUndo": "отменить",
4257
+ "toast.archivedOr": " или ",
4258
+ "toast.archivedFilter": "фильтровать архивированные сеансы",
4259
+ "toast.pinFailed": "Не удалось закрепить. Повторите попытку позже.",
4260
+ "toast.unpinFailed": "Не удалось открепить. Повторите попытку позже.",
4261
+ "toast.createFailed": "Не удалось создать новый сеанс: {message}.",
4262
+ "toast.forkRequiresOpen": "Откройте исходный сеанс, чтобы завершить миграцию, прежде чем создавать ветку.",
4263
+ "toast.openForkSource": "Открыть исходный сеанс",
4264
+ "sessions.count.one": "Сеанс {n}",
4265
+ "sessions.count.other": "Сессии {n}",
4266
+ "actions.workspace.aria": "Действия рабочей области для {name}",
4267
+ "actions.session.aria": "Действия сеанса для {name}",
4268
+ "actions.archive": "Архив",
4269
+ "actions.unarchive": "Разархивировать",
4270
+ "actions.pin": "Закрепить",
4271
+ "actions.unpin": "Открепить",
4272
+ "actions.newSession": "Новая сессия",
4273
+ "actions.newSession.aria": "Новая сессия в {name}",
4274
+ "status.running": "Бег",
4275
+ "status.subagentsRunning.one": "Субагент {n} работает",
4276
+ "status.subagentsRunning.other": "Субагенты {n} работают",
4277
+ "status.idle": "Простой",
4278
+ "status.waitingApproval": "Ожидание одобрения",
4279
+ "status.planReview": "План ожидает рассмотрения",
4280
+ "status.waitingAnswer": "Ожидание ответа",
4281
+ "status.compact.approval": "Одобрение",
4282
+ "status.compact.planReview": "Обзор плана",
4283
+ "status.compact.answer": "Ответ",
4284
+ "status.completed": "Завершено",
4285
+ "hover.created": "Создано {time}",
4286
+ "hover.copied": "Скопировано",
4287
+ "date.ymd": "{y}-{m}-{d}",
4288
+ "time.now": "сейчас",
4289
+ "time.minutes": "{n}мин",
4290
+ "time.hours": "{n}h",
4291
+ "time.days": "{n}d",
4292
+ "time.months": "{n}mo",
4293
+ "time.years": "{n}y",
4294
+ "time.ago": "{t} назад"
4295
+ };
4296
+ var pt = {
4297
+ "defaultWorkspace.failed": "Não foi possível criar o espaço de trabalho padrão. Use Escolher espaço de trabalho para selecionar uma pasta.",
4298
+ "draft.workspaceRequired": "Escolha um espaço de trabalho primeiro.",
4299
+ "draft.initializationFailed": "Não foi possível preencher o rascunho. Por favor, tente novamente em breve.",
4300
+ "group.ungrouped": "Desagrupado",
4301
+ "session.new": "Nova sessão",
4302
+ "session.untitled": "Sem título",
4303
+ "shortcut.noSession": "Selecione uma sessão primeiro",
4304
+ "shortcut.noPicker": "Seletor de diretório indisponível",
4305
+ "shortcut.directoryBusy": "Selecionando ou adicionando um espaço de trabalho",
4306
+ "shortcut.noCompletedTurn": "Esta sessão não tem turno concluído",
4307
+ "shortcut.forkFailed": "Não foi possível bifurcar a sessão. Tente novamente.",
4308
+ "section.workspaces": "Espaços de trabalho",
4309
+ "section.sessions": "Sessões",
4310
+ "viewOptions.label": "Ver opções",
4311
+ "groupBy.label": "Agrupar por",
4312
+ "groupBy.workspace": "Espaço de trabalho",
4313
+ "groupBy.workspaceTree": "Árvore do espaço de trabalho",
4314
+ "groupBy.flat": "Em uma lista",
4315
+ "groupBy.time": "Por tempo",
4316
+ "timeBucket.pinned": "Fixadas",
4317
+ "timeBucket.today": "Hoje",
4318
+ "timeBucket.yesterday": "Ontem",
4319
+ "timeBucket.week": "Esta semana",
4320
+ "timeBucket.earlier": "Anteriores",
4321
+ "statusTabs.label": "Filtrar por status",
4322
+ "statusTab.all": "Todas",
4323
+ "statusTab.running": "Em execução",
4324
+ "statusTab.pending": "Aguardando",
4325
+ "statusTab.unread": "Não lidas",
4326
+ "orderBy.label": "Encomendar por",
4327
+ "orderBy.manual": "Manuais",
4328
+ "orderBy.updated": "Última atualização",
4329
+ "filterBy.label": "Filtrar sessões",
4330
+ "viewOptions.hideArchived": "Ocultar arquivado",
4331
+ "viewOptions.showArchived": "Todas as conversas (mostrar arquivadas)",
4332
+ "viewOptions.onlyArchived": "Somente arquivado",
4333
+ "sessions.expand": "Mostrar mais {n} sessões",
4334
+ "sessions.collapse": "Mostrar menos",
4335
+ "empty.none": "Ainda não há sessões",
4336
+ "empty.noneArchived": "Ainda não há sessões arquivadas",
4337
+ "empty.viewOthers": "Ver outras sessões",
4338
+ "empty.noMatches": "Nenhuma correspondência",
4339
+ "workspace.add": "Adicionar espaço de trabalho",
4340
+ "search.sessions.aria": "Buscar sessões",
4341
+ "search.placeholder": "Pesquisar nomes de sessões",
4342
+ "search.clear": "Limpar pesquisa",
4343
+ "search.results.aria": "Resultados da pesquisa",
4344
+ "search.pending": "Pesquisando histórico da sessão…",
4345
+ "search.noMatches": "Nenhuma sessão correspondente",
4346
+ "search.hasMore": "Mostrando os primeiros {n} resultados. Restrinja sua pesquisa.",
4347
+ "menu.addWorkspace": "Adicionar espaço de trabalho…",
4348
+ "picker.loading": "Carregando áreas de trabalho…",
4349
+ "conflict.named": "Já existe um espaço de trabalho chamado “{name}”.",
4350
+ "folderError.title": "Não foi possível abrir a pasta",
4351
+ "folderError.retry": "Escolha novamente",
4352
+ "rename": "Renomear",
4353
+ "rename.workspace.title": "Renomear espaço de trabalho",
4354
+ "rename.session.title": "Renomear sessão",
4355
+ "field.workspaceName": "Nome do espaço de trabalho",
4356
+ "field.sessionName": "Nome da sessão",
4357
+ "delete.workspace": "Excluir espaço de trabalho",
4358
+ "delete.desc": "Isso remove “{name}” da lista de espaços de trabalho. A pasta e os logs de sessão serão mantidos. Suas sessões aparecerão em Desagrupado.",
4359
+ "delete.pending": "Excluindo espaço de trabalho…",
4360
+ "menu.fork": "Bifurcar sessão",
4361
+ "menu.archiveSession": "Sessão de arquivamento",
4362
+ "menu.unarchiveSession": "Desarquivar sessão",
4363
+ "menu.pinSession": "Fixar sessão",
4364
+ "menu.unpinSession": "Desafixar sessão",
4365
+ "menu.sessionId": "Copiar ID da sessão",
4366
+ "toast.sessionIdCopied": "ID da sessão copiado",
4367
+ "toast.sessionIdCopyFailed": "Falha na cópia. Tente novamente.",
4368
+ "row.archived": "Arquivado",
4369
+ "row.pinned": "Fixado",
4370
+ "toast.archivedNotOpenable": "As sessões arquivadas não podem ser abertas. Desarquive-o para visualizar.",
4371
+ "toast.archived": "Sessão arquivada. Você pode ",
4372
+ "toast.stoppedAndArchived": "Sessão interrompida e arquivada. Você pode ",
4373
+ "archive.confirm.title": "Parar e arquivar esta sessão?",
4374
+ "archive.confirm.desc": "“{title}” ainda tem trabalho em andamento. O arquivamento interrompe primeiro; você pode restaurar a sessão posteriormente a partir do filtro “Todas as conversas (mostrar arquivadas)” na barra lateral, e o trabalho interrompido não será retomado por conta própria.",
4375
+ "archive.confirm.activity": "Obra que será interrompida",
4376
+ "archive.confirm.turn": "O turno em andamento",
4377
+ "archive.confirm.subagents.one": "{n} subagente em execução: {names}",
4378
+ "archive.confirm.subagents.other": "{n} executando subagentes: {names}",
4379
+ "archive.confirm.jobs.one": "{n} trabalho em segundo plano: {names}",
4380
+ "archive.confirm.jobs.other": "{n} trabalhos em segundo plano: {names}",
4381
+ "archive.confirm.schedules.one": "{n} lembrete programado: {names}",
4382
+ "archive.confirm.schedules.other": "{n} lembretes programados: {names}",
4383
+ "archive.confirm.other.one": "{n} outro item de trabalho ({kind})",
4384
+ "archive.confirm.other.other": "{n} outros itens de trabalho ({kind})",
4385
+ "archive.confirm.listSeparator": ", ",
4386
+ "archive.confirm.action": "Pare e arquive",
4387
+ "archive.confirm.pending": "Parando e arquivando…",
4388
+ "toast.archivedUndo": "desfazer",
4389
+ "toast.archivedOr": " ou ",
4390
+ "toast.archivedFilter": "filtrar sessões arquivadas",
4391
+ "toast.pinFailed": "Não foi possível fixar. Tente novamente mais tarde.",
4392
+ "toast.unpinFailed": "Não foi possível desafixar. Tente novamente mais tarde.",
4393
+ "toast.createFailed": "Falha na nova sessão: {message}",
4394
+ "toast.forkRequiresOpen": "Abra a sessão original para concluir a migração antes de criar uma ramificação.",
4395
+ "toast.openForkSource": "Abrir sessão original",
4396
+ "sessions.count.one": "{n} sessão",
4397
+ "sessions.count.other": "{n} sessões",
4398
+ "actions.workspace.aria": "Ações do espaço de trabalho para {name}",
4399
+ "actions.session.aria": "Ações de sessão para {name}",
4400
+ "actions.archive": "Arquivo",
4401
+ "actions.unarchive": "Desarquivar",
4402
+ "actions.pin": "Fixar",
4403
+ "actions.unpin": "Desafixar",
4404
+ "actions.newSession": "Nova sessão",
4405
+ "actions.newSession.aria": "Nova sessão em {name}",
4406
+ "status.running": "Correndo",
4407
+ "status.subagentsRunning.one": "{n} subagente em execução",
4408
+ "status.subagentsRunning.other": "{n} subagentes em execução",
4409
+ "status.idle": "Inativo",
4410
+ "status.waitingApproval": "Aguardando aprovação",
4411
+ "status.planReview": "Plano aguardando revisão",
4412
+ "status.waitingAnswer": "Esperando por resposta",
4413
+ "status.compact.approval": "Aprovação",
4414
+ "status.compact.planReview": "Revisão do plano",
4415
+ "status.compact.answer": "Resposta",
4416
+ "status.completed": "Concluído",
4417
+ "hover.created": "Criado {time}",
4418
+ "hover.copied": "Copiado",
4419
+ "date.ymd": "{y}-{m}-{d}",
4420
+ "time.now": "agora",
4421
+ "time.minutes": "{n}min",
4422
+ "time.hours": "{n}h",
4423
+ "time.days": "{n}d",
4424
+ "time.months": "{n} mês",
4425
+ "time.years": "{n}s",
4426
+ "time.ago": "{t} atrás"
4427
+ };
4428
+
4429
+ // src/client/seat.tsx
4430
+ var name = "dsh-sidebar-view";
4431
+ var inject = [
4432
+ "slots",
4433
+ "contextMenus",
4434
+ "sessions",
4435
+ "workspaces",
4436
+ "locale",
4437
+ "remote",
4438
+ "remote.directoryPicker",
4439
+ "layout",
4440
+ "shortcuts",
4441
+ "remoteAccess"
4442
+ ];
4443
+ var SLOT = "sidebar.workspaces";
4444
+ var PLUS_KEY = "dsh.workspace.view.sidebar-view.v1";
4445
+ var PLUS_INIT = { timeMode: false, statusFilter: "all", timeBucketExpansion: {} };
4446
+ function readPlus() {
4447
+ try {
4448
+ const raw = globalThis.localStorage?.getItem(PLUS_KEY);
4449
+ if (raw === null || raw === void 0) return PLUS_INIT;
4450
+ const parsed = JSON.parse(raw);
4451
+ return {
4452
+ timeMode: parsed.timeMode === true,
4453
+ statusFilter: typeof parsed.statusFilter === "string" ? parsed.statusFilter : "all",
4454
+ timeBucketExpansion: typeof parsed.timeBucketExpansion === "object" && parsed.timeBucketExpansion !== null ? parsed.timeBucketExpansion : {}
4455
+ };
4456
+ } catch {
4457
+ return PLUS_INIT;
4458
+ }
4459
+ }
4460
+ var plusState = readPlus();
4461
+ var plusListeners = /* @__PURE__ */ new Set();
4462
+ function plusSubscribe(fn) {
4463
+ plusListeners.add(fn);
4464
+ return () => {
4465
+ plusListeners.delete(fn);
4466
+ };
4467
+ }
4468
+ function setPlus(patch) {
4469
+ plusState = { ...plusState, ...patch };
4470
+ try {
4471
+ globalThis.localStorage?.setItem(PLUS_KEY, JSON.stringify(plusState));
4472
+ } catch {
4473
+ }
4474
+ for (const fn of [...plusListeners]) fn();
4475
+ }
4476
+ var PICKED = [
4477
+ "groupBy.time",
4478
+ "timeBucket.pinned",
4479
+ "timeBucket.today",
4480
+ "timeBucket.yesterday",
4481
+ "timeBucket.week",
4482
+ "timeBucket.earlier",
4483
+ "statusTabs.label",
4484
+ "statusTab.all",
4485
+ "statusTab.running",
4486
+ "statusTab.pending",
4487
+ "statusTab.unread",
4488
+ "empty.noMatches"
4489
+ ];
4490
+ function pick(dict) {
4491
+ const out = {};
4492
+ for (const key of PICKED) {
4493
+ const value = dict[key];
4494
+ if (value !== void 0) out[key] = value;
4495
+ }
4496
+ return out;
4497
+ }
4498
+ var SHIPPED_FLAT = {
4499
+ zh: "单列表",
4500
+ en: "In one list",
4501
+ ja: "単一リスト",
4502
+ es: "En una lista",
4503
+ fr: "Liste unique",
4504
+ de: "In einer Liste",
4505
+ ru: "Одним списком",
4506
+ pt: "Em uma lista"
4507
+ };
4508
+ var DICT_BY_LANG = {
4509
+ zh: pick(zh),
4510
+ en: pick(en),
4511
+ ja: pick(ja),
4512
+ es: pick(es),
4513
+ fr: pick(fr),
4514
+ de: pick(de),
4515
+ ru: pick(ru),
4516
+ pt: pick(pt)
4517
+ };
4518
+ var LANG_BY_FLAT = new Map(Object.entries(SHIPPED_FLAT).map(([lang, flat]) => [flat, DICT_BY_LANG[lang]]));
4519
+ function useCompositeT(shipped) {
4520
+ return React.useMemo(() => {
4521
+ let dict = DICT_BY_LANG.zh;
4522
+ try {
4523
+ const probe = shipped("groupBy.flat");
4524
+ dict = LANG_BY_FLAT.get(probe) ?? DICT_BY_LANG.zh;
4525
+ } catch {
4526
+ dict = DICT_BY_LANG.zh;
4527
+ }
4528
+ return (key, params) => {
4529
+ const local = dict[key];
4530
+ return local !== void 0 ? local : shipped(key, params);
4531
+ };
4532
+ }, [shipped]);
4533
+ }
4534
+ function makeSelectorHook(snapRef, hub) {
4535
+ const subscribe = (fn) => {
4536
+ hub.listeners.add(fn);
4537
+ return () => {
4538
+ hub.listeners.delete(fn);
4539
+ };
4540
+ };
4541
+ return function useStore(sel, eq) {
4542
+ const cache = React.useRef(void 0);
4543
+ const get = () => {
4544
+ const next = sel(snapRef.current);
4545
+ const prev = cache.current;
4546
+ if (prev !== void 0 && (prev.value === next || eq !== void 0 && eq(prev.value, next))) return prev.value;
4547
+ cache.current = { value: next };
4548
+ return next;
4549
+ };
4550
+ return React.useSyncExternalStore(subscribe, get);
4551
+ };
4552
+ }
4553
+ var SeatBoundary = class extends React.Component {
4554
+ state = { failed: false };
4555
+ static getDerivedStateFromError() {
4556
+ return { failed: true };
4557
+ }
4558
+ componentDidCatch(error) {
4559
+ try {
4560
+ console.error("[dsh-sidebar-view] seat crashed; falling back to the shipped browser", error);
4561
+ } catch {
4562
+ }
4563
+ }
4564
+ render() {
4565
+ return this.state.failed ? this.props.fallback : this.props.children;
4566
+ }
4567
+ };
4568
+ function Seat(props) {
4569
+ const { Shipped, ...rest } = props;
4570
+ const shippedState = rest.useStore((state) => state);
4571
+ const plus = React.useSyncExternalStore(plusSubscribe, () => plusState);
4572
+ const snapshot = React.useMemo(() => ({
4573
+ ...shippedState,
4574
+ groupBy: plus.timeMode ? "time" : shippedState["groupBy"],
4575
+ statusFilter: plus.statusFilter,
4576
+ timeBucketExpansion: plus.timeBucketExpansion
4577
+ }), [shippedState, plus]);
4578
+ const snapRef = React.useRef(snapshot);
4579
+ snapRef.current = snapshot;
4580
+ const hub = React.useRef({ listeners: /* @__PURE__ */ new Set() }).current;
4581
+ React.useEffect(() => {
4582
+ for (const fn of [...hub.listeners]) fn();
4583
+ }, [hub, snapshot]);
4584
+ const useStore = React.useMemo(() => makeSelectorHook(snapRef, hub), [hub, snapRef]);
4585
+ const shippedActions = rest.actions;
4586
+ const actions = React.useMemo(() => ({
4587
+ ...shippedActions,
4588
+ setGroupBy: (mode) => {
4589
+ if (mode === "time") {
4590
+ setPlus({ timeMode: true });
4591
+ return;
4592
+ }
4593
+ if (plusState.timeMode) setPlus({ timeMode: false });
4594
+ shippedActions["setGroupBy"]?.(mode);
4595
+ },
4596
+ setStatusFilter: (filter) => setPlus({ statusFilter: filter }),
4597
+ setTimeBucketExpanded: (key, expanded) => {
4598
+ setPlus({ timeBucketExpansion: { ...plusState.timeBucketExpansion, [key]: expanded } });
4599
+ }
4600
+ }), [shippedActions]);
4601
+ const t = useCompositeT(rest.t);
4602
+ return React.createElement(WorkspaceBrowser, {
4603
+ ...rest,
4604
+ useStore,
4605
+ actions,
4606
+ t
4607
+ });
4608
+ }
4609
+ function apply(ctx) {
4610
+ const slots = ctx.get("slots");
4611
+ if (slots === void 0) {
4612
+ console.info("[dsh-sidebar-view] slots service unavailable; leaving the shipped sidebar in place");
4613
+ return;
4614
+ }
4615
+ const seated = /* @__PURE__ */ new Map();
4616
+ const forceRerender = () => {
4617
+ try {
4618
+ const off = slots.register({ name: SLOT, id: "dsh-sidebar-view-repaint", priority: 9999 }, () => null);
4619
+ off();
4620
+ } catch {
4621
+ }
4622
+ };
4623
+ const seat = () => {
4624
+ const entry = slots.entries(SLOT)[0];
4625
+ if (entry === void 0 || seated.has(entry)) return;
4626
+ const Shipped = entry.component;
4627
+ if (typeof Shipped !== "function") return;
4628
+ const Seated = (props) => React.createElement(
4629
+ SeatBoundary,
4630
+ { fallback: React.createElement(Shipped, props) },
4631
+ React.createElement(Seat, { ...props, Shipped })
4632
+ );
4633
+ seated.set(entry, Shipped);
4634
+ entry.component = Seated;
4635
+ forceRerender();
4636
+ };
4637
+ seat();
4638
+ const timer = setTimeout(() => {
4639
+ seat();
4640
+ }, 1200);
4641
+ ctx.effect(() => slots.subscribe(SLOT, () => {
4642
+ seat();
4643
+ }), "dsh-sidebar-view: seat watcher");
4644
+ ctx.effect(() => () => {
4645
+ clearTimeout(timer);
4646
+ for (const [entry, Shipped] of seated) entry.component = Shipped;
4647
+ seated.clear();
4648
+ }, "dsh-sidebar-view: restore shipped component");
4649
+ }
4650
+
4651
+ ;(function () {
4652
+ var id = "dsh-sidebar-view"
4653
+ var existing = document.querySelector('style[data-plugin="' + id + '"]')
4654
+ if (existing) return
4655
+ var el = document.createElement('style')
4656
+ el.setAttribute('data-plugin', id)
4657
+ el.textContent = "/* src/browser/rows/WorkspaceBrowser.module.css */\n.WorkspaceBrowser_root {\n --workspace-toolbar-height: 36px;\n --workspace-toolbar-gap: 0px;\n position: relative;\n flex: 1;\n min-height: 0;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n}\n.WorkspaceBrowser_root:not(.WorkspaceBrowser_rail) {\n flex: none;\n max-height: 100cqh;\n}\n.WorkspaceBrowser_root:not(.WorkspaceBrowser_rail):has(.WorkspaceBrowser_searchExpanded) {\n height: 100cqh;\n}\n.WorkspaceBrowser_iconButton {\n flex: none;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n border: none;\n border-radius: var(--dsw-radius-sm);\n padding: 0;\n background: transparent;\n cursor: pointer;\n color: var(--dsw-alias-label-secondary);\n}\n.WorkspaceBrowser_iconButton:focus-visible,\n.WorkspaceBrowser_searchButton:focus-visible,\n.WorkspaceBrowser_clearButton:focus-visible {\n outline: var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color, var(--dsw-alias-state-business-primary));\n outline-offset: -2px;\n}\n@media (hover: hover) {\n .WorkspaceBrowser_iconButton:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n }\n}\n.WorkspaceBrowser_viewOptionsMenu {\n min-width: 200px;\n}\n.WorkspaceBrowser_sectionHeader {\n flex: none;\n display: flex;\n align-items: center;\n justify-content: flex-end;\n gap: 4px;\n height: var(--workspace-toolbar-height);\n padding-left: var(--dsh-sidebar-row-padding);\n margin-bottom: var(--workspace-toolbar-gap);\n box-sizing: border-box;\n border-radius: var(--dsw-radius-md);\n overflow: hidden;\n color: var(--dsw-alias-label-tertiary);\n}\n.WorkspaceBrowser_root:not(.WorkspaceBrowser_rail) .WorkspaceBrowser_sectionHeader.WorkspaceBrowser_searchSpacingMotion {\n transition:\n margin-right 180ms var(--ds-ease-in-out),\n padding-inline 180ms var(--ds-ease-in-out),\n gap 180ms var(--ds-ease-in-out);\n}\n.WorkspaceBrowser_root:not(.WorkspaceBrowser_rail) .WorkspaceBrowser_sectionHeader:not(:has(.WorkspaceBrowser_searchExpanded)) {\n margin-right: -4px;\n padding-right: 1px;\n}\n.WorkspaceBrowser_sectionLabel {\n position: relative;\n left: -1px;\n flex: none;\n max-width: 45%;\n min-width: 0;\n overflow: hidden;\n white-space: nowrap;\n line-height: 20px;\n opacity: 1;\n visibility: visible;\n transition:\n max-width 180ms var(--ds-ease-in-out),\n margin-right 180ms var(--ds-ease-in-out),\n opacity 120ms var(--ds-ease-in-out),\n transform 180ms var(--ds-ease-in-out),\n visibility 0s linear;\n}\n.WorkspaceBrowser_sectionLabelHidden {\n max-width: 0;\n margin-right: -4px;\n opacity: 0;\n transform: translateX(-4px);\n visibility: hidden;\n transition-delay:\n 0s,\n 0s,\n 0s,\n 0s,\n 180ms;\n}\n.WorkspaceBrowser_searchSlot {\n flex: 1;\n max-width: 28px;\n min-width: 0;\n display: flex;\n align-items: center;\n margin-left: auto;\n padding-left: 0;\n box-sizing: border-box;\n transition: max-width 180ms var(--ds-ease-in-out), padding-left 180ms var(--ds-ease-in-out);\n}\n.WorkspaceBrowser_searchSlotExpanded {\n max-width: 100%;\n padding-left: 0;\n}\n.WorkspaceBrowser_headerActions {\n flex: none;\n display: flex;\n align-items: center;\n gap: 4px;\n max-width: 60px;\n opacity: 1;\n overflow: hidden;\n visibility: visible;\n transition:\n max-width 180ms var(--ds-ease-in-out),\n opacity 120ms var(--ds-ease-in-out),\n transform 180ms var(--ds-ease-in-out),\n visibility 0s linear;\n}\n.WorkspaceBrowser_headerActionsHidden {\n max-width: 0;\n opacity: 0;\n transform: translateX(4px);\n visibility: hidden;\n pointer-events: none;\n transition-delay:\n 0s,\n 0s,\n 0s,\n 180ms;\n}\n.WorkspaceBrowser_search {\n flex: none;\n display: flex;\n align-items: center;\n gap: 0;\n width: 100%;\n height: 28px;\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n border: none;\n border-radius: var(--dsw-radius-sm);\n background: transparent;\n cursor: text;\n color: var(--dsw-alias-label-secondary);\n overflow: hidden;\n transition:\n width 180ms var(--ds-ease-in-out),\n padding 180ms var(--ds-ease-in-out),\n border-color 180ms var(--ds-ease-in-out),\n background-color 180ms var(--ds-ease-in-out);\n}\n.WorkspaceBrowser_root:not(.WorkspaceBrowser_rail) .WorkspaceBrowser_sectionHeader:has(.WorkspaceBrowser_searchExpanded) {\n margin-right: 0;\n padding-inline: calc(var(--dsh-sidebar-paint-inset) + 1px);\n gap: 0;\n}\n.WorkspaceBrowser_sectionHeader:has(.WorkspaceBrowser_searchExpanded) .WorkspaceBrowser_sectionLabelHidden {\n margin-right: 0;\n}\n.WorkspaceBrowser_searchExpanded {\n width: 100%;\n height: 32px;\n margin-inline: 0;\n padding: 0 4px 0 0;\n border: 0.5px solid var(--dsw-alias-border-l4);\n border-radius: var(--dsw-radius-md);\n background: transparent;\n color: var(--dsw-alias-label-caption);\n}\n.WorkspaceBrowser_searchButton {\n flex: none;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n border: none;\n border-radius: var(--dsw-radius-sm);\n padding: 0;\n background: transparent;\n cursor: pointer;\n color: inherit;\n}\n.WorkspaceBrowser_searchExpanded .WorkspaceBrowser_searchButton {\n width: 28px;\n height: 32px;\n}\n@media (hover: hover) {\n .WorkspaceBrowser_searchButton:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n }\n .WorkspaceBrowser_searchExpanded .WorkspaceBrowser_searchButton:hover {\n background: transparent;\n }\n}\n.WorkspaceBrowser_searchInput {\n flex: 1;\n width: 0;\n min-width: 0;\n border: none;\n outline: none;\n background: transparent;\n opacity: 0;\n pointer-events: none;\n font-size: 13px;\n line-height: 18px;\n color: var(--dsw-alias-label-primary);\n transition: opacity 120ms var(--ds-ease-in-out);\n}\n.WorkspaceBrowser_searchExpanded .WorkspaceBrowser_searchInput {\n margin-left: -2px;\n opacity: 1;\n pointer-events: auto;\n}\n.WorkspaceBrowser_searchInput::placeholder {\n color: var(--dsw-alias-label-tertiary);\n}\n.WorkspaceBrowser_clearButton {\n flex: none;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n height: 24px;\n border: none;\n border-radius: var(--dsw-radius-sm);\n padding: 0;\n background: transparent;\n cursor: pointer;\n color: var(--dsw-alias-label-secondary);\n}\n@media (hover: hover) {\n .WorkspaceBrowser_clearButton:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n }\n}\n.WorkspaceBrowser_rail .WorkspaceBrowser_sectionHeader {\n gap: 0;\n padding-left: 0;\n margin-bottom: 12px;\n justify-content: flex-start;\n}\n.WorkspaceBrowser_rail .WorkspaceBrowser_headerActions {\n max-width: none;\n}\n.WorkspaceBrowser_rail .WorkspaceBrowser_iconButton {\n width: 36px;\n height: 36px;\n border-radius: var(--dsw-radius-md);\n color: var(--dsw-alias-label-primary);\n}\n.WorkspaceBrowser_rail .WorkspaceBrowser_search {\n width: 36px;\n height: 36px;\n padding: 0;\n margin: 0 0 12px;\n gap: 0;\n border-radius: var(--dsw-radius-md);\n border-color: transparent;\n background: transparent;\n}\n.WorkspaceBrowser_rail .WorkspaceBrowser_searchButton {\n width: 36px;\n height: 36px;\n border-radius: var(--dsw-radius-md);\n color: var(--dsw-alias-label-primary);\n}\n@media (hover: hover) {\n .WorkspaceBrowser_rail .WorkspaceBrowser_searchButton:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n }\n}\n.WorkspaceBrowser_statusTabs {\n flex: none;\n display: flex;\n align-items: center;\n gap: 2px;\n height: 28px;\n padding-inline: var(--dsh-sidebar-row-padding);\n margin-bottom: 2px;\n overflow-x: auto;\n scrollbar-width: none;\n}\n.WorkspaceBrowser_statusTabs::-webkit-scrollbar {\n display: none;\n}\n.WorkspaceBrowser_statusTab {\n flex: none;\n display: inline-flex;\n align-items: center;\n gap: 4px;\n height: 22px;\n padding-inline: 8px;\n border: none;\n border-radius: var(--dsw-radius-md);\n background: transparent;\n color: var(--dsw-alias-label-tertiary);\n font: inherit;\n font-size: 12px;\n line-height: 22px;\n cursor: pointer;\n}\n.WorkspaceBrowser_statusTab:focus-visible {\n outline: var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color, var(--dsw-alias-state-business-primary));\n outline-offset: -1px;\n}\n.WorkspaceBrowser_statusTabActive,\n.WorkspaceBrowser_statusTabActive:focus-visible {\n background: var(--dsw-alias-interactive-bg-hover);\n color: var(--dsw-alias-label-primary);\n}\n.WorkspaceBrowser_statusTabCount {\n font-variant-numeric: tabular-nums;\n color: var(--dsw-alias-label-caption);\n}\n.WorkspaceBrowser_statusTabActive .WorkspaceBrowser_statusTabCount {\n color: var(--dsw-alias-label-secondary);\n}\n@media (hover: hover) {\n .WorkspaceBrowser_statusTab:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n }\n}\n.WorkspaceBrowser_listArea {\n flex: 1;\n min-height: 0;\n display: flex;\n flex-direction: column;\n overflow: visible;\n}\n.WorkspaceBrowser_root:not(.WorkspaceBrowser_rail) .WorkspaceBrowser_listArea {\n display: block;\n margin-left: -4px;\n margin-right: calc(2px - var(--dsh-sidebar-inline-padding));\n padding-left: 4px;\n padding-right: calc(var(--dsh-sidebar-inline-padding) - var(--dsh-scrollbar-width) - 2px);\n overflow-x: hidden;\n overflow-y: auto;\n scrollbar-gutter: stable;\n}\n@container scroll-state(scrollable: bottom) {\n .WorkspaceBrowser_root:not(.WorkspaceBrowser_rail) .WorkspaceBrowser_listArea {\n overflow-y: hidden;\n }\n}\n.WorkspaceBrowser_treeBody {\n flex: 1;\n min-height: 0;\n display: flex;\n flex-direction: column;\n position: relative;\n}\n.WorkspaceBrowser_wide {\n animation: WorkspaceBrowser_wide-in 200ms var(--ds-ease-in-out);\n}\n@keyframes WorkspaceBrowser_wide-in {\n from {\n opacity: 0;\n }\n}\n.WorkspaceBrowser_list {\n flex: 1;\n min-height: 0;\n overflow: visible;\n padding-bottom: 16px;\n}\n.WorkspaceBrowser_flatList > * + *,\n.WorkspaceBrowser_searchTree > [role=treeitem] + [role=treeitem],\n.WorkspaceBrowser_groupSection > * + * {\n margin-top: 2px;\n}\n.WorkspaceBrowser_searchStatus {\n padding: 10px 12px;\n font-size: 12px;\n line-height: 18px;\n color: var(--dsw-alias-label-tertiary);\n}\n.WorkspaceBrowser_skeletonRow {\n display: flex;\n align-items: flex-start;\n gap: var(--dsh-sidebar-label-gap);\n box-sizing: border-box;\n min-height: 48px;\n padding: 6px var(--dsh-sidebar-row-padding) 7px;\n}\n.WorkspaceBrowser_skeletonDot {\n flex: none;\n width: 16px;\n height: 16px;\n border-radius: 50%;\n corner-shape: round;\n}\n.WorkspaceBrowser_skeletonBars {\n flex: 1;\n min-width: 0;\n display: flex;\n flex-direction: column;\n gap: 6px;\n}\n.WorkspaceBrowser_skeletonDot,\n.WorkspaceBrowser_skeletonBar {\n background: var(--dsw-alias-bg-skeleton);\n animation: WorkspaceBrowser_search-skeleton 2s cubic-bezier(0.36, 0, 0.64, 1) infinite;\n}\n.WorkspaceBrowser_skeletonBar {\n width: 65%;\n height: 16px;\n border-radius: var(--dsw-radius-xs);\n}\n.WorkspaceBrowser_skeletonBarWide {\n width: 90%;\n height: 13px;\n}\n@keyframes WorkspaceBrowser_search-skeleton {\n 0% {\n opacity: 1;\n }\n 40% {\n opacity: 0.6;\n }\n 80%, 100% {\n opacity: 1;\n }\n}\n.WorkspaceBrowser_groupSection {\n position: relative;\n}\n.WorkspaceBrowser_groupSection + .WorkspaceBrowser_groupSection {\n margin-top: 4px;\n}\n.WorkspaceBrowser_listTopDropIndicator,\n.WorkspaceBrowser_workspaceDropBefore::before,\n.WorkspaceBrowser_workspaceDropAfter::after {\n content: \"\";\n position: absolute;\n z-index: 1;\n left: 0;\n right: 0;\n height: 12px;\n background:\n linear-gradient(\n 55deg,\n transparent calc(50% - 1px),\n var(--dsw-alias-state-business-primary) calc(50% - 1px) calc(50% + 1px),\n transparent calc(50% + 1px)) 0 0 / 5px 7px no-repeat,\n linear-gradient(\n 125deg,\n transparent calc(50% - 1px),\n var(--dsw-alias-state-business-primary) calc(50% - 1px) calc(50% + 1px),\n transparent calc(50% + 1px)) 0 5px / 5px 7px no-repeat,\n linear-gradient(var(--dsw-alias-state-business-primary) 0 0) 4px 5px / calc(100% - 4px) 2px no-repeat;\n pointer-events: none;\n}\n.WorkspaceBrowser_listTopDropIndicator {\n top: -8px;\n}\n.WorkspaceBrowser_listTopDropActive > .WorkspaceBrowser_workspaceDropBefore:first-child::before {\n display: none;\n}\n.WorkspaceBrowser_workspaceDropBefore::before {\n top: -8px;\n}\n.WorkspaceBrowser_workspaceDropAfter::after {\n bottom: -8px;\n}\n.WorkspaceBrowser_sessionOverflowButton {\n width: 100%;\n height: 28px;\n border: none;\n border-radius: var(--dsw-radius-sm);\n padding: 0 var(--dsh-sidebar-row-padding) 0 calc(var(--dsh-sidebar-row-padding) + 16px + var(--dsh-sidebar-label-gap) + var(--dsh-workspace-indent, 0px));\n background: transparent;\n cursor: pointer;\n text-align: left;\n font-size: 12px;\n color: var(--dsw-alias-label-tertiary);\n}\n.WorkspaceBrowser_groupSection > .WorkspaceBrowser_sessionOverflowButton {\n margin-top: 0;\n}\n@media (hover: hover) {\n .WorkspaceBrowser_sessionOverflowButton:hover {\n background: transparent;\n color: var(--dsw-alias-label-secondary);\n }\n}\n.WorkspaceBrowser_empty {\n padding: 16px 12px;\n color: var(--dsw-alias-label-tertiary);\n font-size: 13px;\n}\n.WorkspaceBrowser_emptyState {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 8px;\n margin-top: 80px;\n padding: 0 12px;\n color: var(--dsw-alias-label-tertiary);\n font-size: 13px;\n line-height: 20px;\n}\n.WorkspaceBrowser_emptyState > svg {\n margin-bottom: 4px;\n color: var(--dsw-alias-label-caption);\n}\n.WorkspaceBrowser_emptyAction {\n padding: 0;\n border: none;\n background: none;\n cursor: pointer;\n font-size: 13px;\n line-height: 20px;\n color: var(--dsw-alias-link);\n}\n.WorkspaceBrowser_renameInput {\n box-sizing: border-box;\n width: 100%;\n height: 44px;\n padding: 7px 14px;\n border: 0.5px solid var(--dsw-alias-border-l4);\n border-radius: var(--dsw-radius-lg);\n outline: none;\n background: transparent;\n font-size: 14px;\n font-weight: 400;\n line-height: 22px;\n color: var(--dsw-alias-label-primary);\n}\n.WorkspaceBrowser_renameInput:disabled {\n color: var(--dsw-alias-label-dimmed);\n}\n.WorkspaceBrowser_renameError {\n margin-top: 8px;\n font-size: 12px;\n line-height: 18px;\n color: var(--dsw-alias-state-error-primary);\n}\n.WorkspaceBrowser_deleteAction:not(:disabled) {\n color: var(--dsw-alias-state-error-primary);\n}\n.WorkspaceBrowser_deleteStatus {\n font-size: 12px;\n line-height: 18px;\n color: var(--dsw-alias-label-secondary);\n}\n.WorkspaceBrowser_archiveActivity {\n margin: 0 0 8px;\n padding-left: 18px;\n font-size: 13px;\n line-height: 20px;\n color: var(--dsw-alias-label-primary);\n}\n.WorkspaceBrowser_archiveActivity li {\n overflow-wrap: anywhere;\n}\n@media (pointer: coarse) {\n .WorkspaceBrowser_searchInput,\n .WorkspaceBrowser_renameInput {\n font-size: 16px;\n }\n}\n@media (prefers-reduced-motion: reduce) {\n .WorkspaceBrowser_wide {\n animation: none;\n }\n .WorkspaceBrowser_skeletonDot,\n .WorkspaceBrowser_skeletonBar {\n animation: none;\n }\n .WorkspaceBrowser_root:not(.WorkspaceBrowser_rail) .WorkspaceBrowser_sectionHeader.WorkspaceBrowser_searchSpacingMotion,\n .WorkspaceBrowser_search,\n .WorkspaceBrowser_sectionLabel,\n .WorkspaceBrowser_searchSlot,\n .WorkspaceBrowser_searchInput,\n .WorkspaceBrowser_headerActions {\n transition: none;\n }\n}\n\n/* src/browser/rows/Rows.module.css */\n.Rows_projectRow,\n.Rows_sessionRow {\n display: flex;\n align-items: center;\n gap: var(--dsh-sidebar-label-gap);\n border-radius: var(--dsw-radius-md);\n border-inline: var(--dsh-sidebar-paint-inset) solid transparent;\n background-clip: padding-box;\n box-sizing: border-box;\n padding: 0 8px;\n padding-inline-start: calc(var(--dsh-sidebar-row-padding) - var(--dsh-sidebar-paint-inset) + var(--dsh-workspace-indent, 0px));\n cursor: pointer;\n -webkit-user-select: none;\n user-select: none;\n color: var(--dsw-alias-label-primary);\n}\n@media (hover: hover) {\n .Rows_projectRow:hover {\n background-color: var(--dsw-alias-interactive-bg-hover);\n }\n}\n.Rows_sessionRow.Rows_selected {\n background-color: var(--dsw-alias-interactive-bg-hover);\n}\n.Rows_dragPreview {\n background: var(--dsw-specific-sidebar-fill);\n}\n.Rows_searchResultRow {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n width: 100%;\n min-height: 48px;\n box-sizing: border-box;\n border: none;\n border-radius: var(--dsw-radius-lg);\n padding: 4px calc(var(--dsh-sidebar-row-padding) - var(--dsh-sidebar-paint-inset));\n border-inline: var(--dsh-sidebar-paint-inset) solid transparent;\n background: transparent;\n background-clip: padding-box;\n cursor: pointer;\n text-align: left;\n color: var(--dsw-alias-label-primary);\n}\n@media (hover: hover) {\n .Rows_searchResultRow:hover {\n background-color: var(--dsw-alias-interactive-bg-hover);\n }\n}\n.Rows_searchResultRow.Rows_selected {\n background-color: var(--dsw-alias-interactive-bg-hover);\n}\n.Rows_searchResultHeading {\n display: flex;\n align-items: center;\n min-width: 0;\n}\n.Rows_searchResultTitle {\n flex: 0 1 auto;\n min-width: 0;\n margin: 0 var(--dsh-sidebar-label-gap);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: 14px;\n line-height: 20px;\n}\n.Rows_searchResultMeta {\n display: flex;\n align-items: center;\n gap: 6px;\n min-width: 0;\n margin-left: calc(16px + var(--dsh-sidebar-label-gap));\n}\n.Rows_searchResultWorkspace,\n.Rows_searchResultSnippet {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: 12px;\n line-height: 17px;\n}\n.Rows_searchResultWorkspace {\n flex: none;\n max-width: 40%;\n color: var(--dsw-alias-label-tertiary);\n}\n.Rows_searchResultWorkspace:only-child {\n max-width: 100%;\n}\n.Rows_searchResultSnippet {\n flex: 1;\n min-width: 0;\n color: var(--dsw-alias-label-secondary);\n}\n.Rows_projectRow {\n height: 32px;\n align-items: center;\n box-sizing: border-box;\n}\n.Rows_projectRow .Rows_rowActions {\n height: 20px;\n}\n.Rows_sessionRow {\n height: 32px;\n gap: 0;\n}\n.Rows_sessionRow .Rows_title {\n margin: 0 6px 0 var(--dsh-sidebar-label-gap);\n}\n.Rows_slot {\n flex: none;\n width: 16px;\n height: 20px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n color: var(--dsw-alias-label-tertiary);\n}\n.Rows_visuallyHidden {\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n clip: rect(0 0 0 0);\n white-space: nowrap;\n}\n.Rows_folderActive {\n color: var(--dsw-alias-state-business-primary);\n}\n.Rows_projectRow .Rows_chevron {\n display: none;\n}\n@media (hover: hover) {\n .Rows_projectRow:hover .Rows_chevron {\n display: inline-flex;\n }\n .Rows_projectRow:hover .Rows_folder {\n display: none;\n }\n}\n.Rows_arrow {\n transition: transform 150ms var(--ds-ease-in-out);\n}\n.Rows_arrowOpen {\n transform: rotate(90deg);\n}\n.Rows_projectText {\n flex: 1;\n min-width: 0;\n display: flex;\n flex-direction: column;\n gap: 2px;\n}\n.Rows_title {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: 14px;\n line-height: 20px;\n}\n.Rows_renameInput {\n min-width: 0;\n font-size: 14px;\n line-height: 20px;\n padding: 0 2px;\n border: 0.5px solid var(--dsw-alias-border-l4);\n border-radius: var(--dsw-radius-sm);\n background: var(--dsw-alias-button-elevated-fill);\n color: inherit;\n outline: none;\n}\n.Rows_sessionRow .Rows_title {\n flex: 1;\n}\n.Rows_sessionRow .Rows_title[data-scrolled] {\n mask-image:\n linear-gradient(\n to right,\n transparent,\n #000 12px);\n}\n.Rows_sessionRow .Rows_title[data-clipped] {\n mask-image:\n linear-gradient(\n to left,\n transparent,\n #000 12px);\n}\n.Rows_sessionRow .Rows_title[data-scrolled][data-clipped] {\n mask-image:\n linear-gradient(\n to right,\n transparent,\n #000 12px,\n #000 calc(100% - 12px),\n transparent);\n}\n.Rows_meta {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: 12px;\n line-height: 20px;\n color: var(--dsw-alias-label-tertiary);\n}\n.Rows_time {\n flex: none;\n font-size: 10px;\n line-height: 16px;\n color: var(--dsw-alias-label-tertiary);\n margin-inline-end: -1px;\n}\n.Rows_pinIndicator {\n display: inline-flex;\n flex: none;\n width: 16px;\n height: 20px;\n align-items: center;\n justify-content: center;\n margin-left: 6px;\n color: var(--dsw-alias-label-caption);\n}\n.Rows_sessionRow.Rows_archived .Rows_title,\n.Rows_searchResultRow.Rows_archived .Rows_searchResultTitle,\n.Rows_searchResultRow.Rows_archived .Rows_searchResultWorkspace,\n.Rows_searchResultRow.Rows_archived .Rows_searchResultSnippet {\n color: var(--dsw-alias-label-caption);\n}\n.Rows_dot {\n flex: none;\n}\n.Rows_rowActions {\n flex: none;\n display: none;\n align-items: center;\n gap: 13px;\n}\n@media (hover: hover) {\n .Rows_projectRow:hover .Rows_rowActions,\n .Rows_searchResultRow:hover .Rows_rowActions {\n display: inline-flex;\n }\n}\n.Rows_projectRow.Rows_menuOpen .Rows_rowActions {\n display: inline-flex;\n}\n.Rows_rowQuickActions {\n display: contents;\n}\n.Rows_searchResultHeading .Rows_rowActions {\n margin-left: auto;\n}\n.Rows_rowResting {\n flex: none;\n display: inline-flex;\n align-items: center;\n gap: 6px;\n color: var(--dsw-alias-label-tertiary);\n}\n.Rows_rowResting .Rows_pinIndicator {\n margin-left: 0;\n}\n@media (hover: hover) {\n .Rows_sessionRow:hover {\n background-color: var(--dsw-alias-interactive-bg-hover);\n }\n .Rows_sessionRow:hover .Rows_rowActions,\n .Rows_sessionRow.Rows_menuOpen .Rows_rowActions,\n html[data-input-modality=keyboard] .Rows_sessionRow:focus-within .Rows_rowActions {\n display: inline-flex;\n }\n .Rows_sessionRow:hover .Rows_rowResting,\n .Rows_sessionRow.Rows_menuOpen .Rows_rowResting,\n html[data-input-modality=keyboard] .Rows_sessionRow:focus-within .Rows_rowResting {\n display: none;\n }\n .Rows_sessionRow:hover .Rows_title,\n .Rows_sessionRow.Rows_menuOpen .Rows_title {\n text-overflow: clip;\n }\n}\n@media (hover: none) {\n .Rows_projectRow .Rows_rowActions,\n .Rows_searchResultRow .Rows_rowActions,\n .Rows_sessionRow .Rows_rowActions {\n display: inline-flex;\n }\n .Rows_sessionRow .Rows_timestamp,\n .Rows_sessionRow:has(.Rows_pinnedAction) .Rows_pinIndicator,\n .Rows_sessionRow .Rows_rowQuickActions > [data-slot] > :not(.Rows_pinnedAction),\n .Rows_projectRow[aria-expanded=false] .Rows_rowActions {\n display: none;\n }\n .Rows_sessionRow .Rows_pinnedAction {\n order: -1;\n }\n}\n.Rows_projectRow.Rows_menuOpen,\n.Rows_sessionRow.Rows_menuOpen {\n background-color: var(--dsw-alias-interactive-bg-hover);\n}\n.Rows_sessionRow.Rows_dropBefore,\n.Rows_sessionRow.Rows_dropAfter {\n position: relative;\n}\n.Rows_sessionRow.Rows_dropBefore::before,\n.Rows_sessionRow.Rows_dropAfter::after {\n content: \"\";\n position: absolute;\n z-index: 1;\n left: calc(-1 * var(--dsh-sidebar-paint-inset));\n right: calc(4px - var(--dsh-sidebar-paint-inset));\n height: 12px;\n background:\n linear-gradient(\n 55deg,\n transparent calc(50% - 1px),\n var(--dsw-alias-state-business-primary) calc(50% - 1px) calc(50% + 1px),\n transparent calc(50% + 1px)) 0 0 / 5px 7px no-repeat,\n linear-gradient(\n 125deg,\n transparent calc(50% - 1px),\n var(--dsw-alias-state-business-primary) calc(50% - 1px) calc(50% + 1px),\n transparent calc(50% + 1px)) 0 5px / 5px 7px no-repeat,\n linear-gradient(var(--dsw-alias-state-business-primary) 0 0) 4px 5px / calc(100% - 4px) 2px no-repeat;\n pointer-events: none;\n}\n.Rows_sessionRow.Rows_dropBefore::before {\n top: -7px;\n}\n.Rows_sessionRow.Rows_dropAfter::after {\n bottom: -7px;\n}\n.Rows_hoverContent {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n.Rows_hoverTitle {\n font-size: 14px;\n line-height: 20px;\n color: var(--dsw-alias-hovercard-label-primary);\n overflow-wrap: break-word;\n}\n.Rows_hoverPath {\n font-size: 12px;\n line-height: 16px;\n color: var(--dsw-alias-hovercard-label-secondary);\n word-break: break-all;\n}\n.Rows_hoverTime {\n font-size: 12px;\n line-height: 16px;\n color: var(--dsw-alias-hovercard-label-secondary);\n}\n.Rows_hoverStatus {\n display: flex;\n align-items: center;\n gap: 8px;\n font-size: 12px;\n line-height: 20px;\n color: var(--dsw-alias-hovercard-label-tertiary);\n}\n.Rows_hoverArchived svg {\n flex-shrink: 0;\n margin: 0 -4px;\n}\n.Rows_iconButton {\n flex: none;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n height: 24px;\n margin: -4px;\n border: none;\n border-radius: var(--dsw-radius-xs);\n padding: 0;\n background: transparent;\n cursor: pointer;\n color: var(--dsw-alias-label-tertiary);\n}\n.Rows_iconButton:focus-visible {\n outline-offset: -2px;\n}\n@media (hover: hover) {\n .Rows_iconButton:hover {\n color: var(--dsw-alias-label-primary);\n }\n}\n.Rows_chevron {\n color: var(--dsw-alias-label-caption);\n}\n.Rows_bucketRow .Rows_chevron {\n display: inline-flex;\n}\n.Rows_bucketRow .Rows_title {\n color: var(--dsw-alias-label-secondary);\n}\n.Rows_workspaceChip {\n flex: none;\n max-width: 72px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: 10px;\n line-height: 16px;\n color: var(--dsw-alias-label-tertiary);\n}\n@media (prefers-reduced-motion: reduce) {\n .Rows_arrow {\n animation: none;\n transition: none;\n }\n}\n\n/* src/browser/WorkspacePicker.module.css */\n.WorkspacePicker_modalAction {\n min-width: 72px;\n}\n.WorkspacePicker_modalError,\n.WorkspacePicker_menuStatus {\n margin-top: 8px;\n font-size: 12px;\n line-height: 18px;\n}\n.WorkspacePicker_modalError {\n color: var(--dsw-alias-state-error-primary);\n}\n.WorkspacePicker_menuStatus,\n.WorkspacePicker_pathSuffix {\n color: var(--dsw-alias-label-secondary);\n}\n.WorkspacePicker_disambiguated {\n display: flex;\n gap: 4px;\n min-width: 0;\n}\n.WorkspacePicker_title,\n.WorkspacePicker_pathSuffix {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.WorkspacePicker_pathSuffix {\n flex: none;\n max-width: 75%;\n}\n"
4658
+ document.head.append(el)
4659
+ })();
4660
+
4661
+ ;return module.exports}})