@yolk_vat-y/dsh-project-memory 0.6.2 → 0.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +178 -7
- package/README.md +26 -23
- package/README.zh-CN.md +24 -21
- package/client/client.js +432 -248
- package/client/client.js.map +1 -1
- package/package.json +3 -2
- package/scripts/bench-synthetic.mjs +22 -11
- package/src/audit.js +36 -32
- package/src/auto-inject.js +44 -23
- package/src/client/MemoryView.tsx +72 -4
- package/src/client/ShowTaskPanelNode.tsx +8 -5
- package/src/client/TaskCommandNode.tsx +23 -17
- package/src/client/TaskComponents.tsx +18 -3
- package/src/client/TaskPanel.tsx +60 -89
- package/src/client/client.ts +26 -6
- package/src/client/commands.ts +67 -0
- package/src/client/task-data-store.ts +33 -14
- package/src/client/task-scope.js +32 -0
- package/src/client/task-ui-store.ts +15 -2
- package/src/commands/insight-actions.js +5 -1
- package/src/commands/task-actions.js +59 -4
- package/src/commands/tasks.js +5 -2
- package/src/index.js +12 -0
- package/src/insight-store.js +286 -84
- package/src/lazy.js +3 -1
- package/src/ops.js +14 -3
- package/src/readiness.js +1 -1
- package/src/recall.js +76 -30
- package/src/setup/taskbridge.js +34 -3
- package/src/store.js +329 -46
- package/src/tools/forget.js +31 -8
- package/src/tools/index-doc.js +3 -5
- package/src/tools/index-repo.js +10 -11
- package/src/tools/lesson-tools.js +25 -35
- package/src/tools/query-memory.js +87 -29
- package/src/tools/remember.js +14 -11
- package/src/tools/stats.js +31 -4
- package/src/tools/task-tools.js +11 -12
- package/src/tools/watch-repo.js +3 -5
- package/src/types.js +9 -4
- package/src/util/fs.js +128 -1
- package/src/util/search.js +6 -27
- package/src/vector-index.js +175 -22
- package/src/watch.js +2 -2
package/client/client.js
CHANGED
|
@@ -379,6 +379,108 @@ window.__ModuleLoader__.load({
|
|
|
379
379
|
} catch {}
|
|
380
380
|
}
|
|
381
381
|
//#endregion
|
|
382
|
+
//#region src/client/commands.ts
|
|
383
|
+
/**
|
|
384
|
+
* 客户端命令调用层:所有 `remote.commands.execute` 只走这里。
|
|
385
|
+
*
|
|
386
|
+
* 三件事必须集中在一处,否则每个调用点都会各漏一项:
|
|
387
|
+
* - 超时/取消(宿主 RPC 不返回时不能把面板永久锁死);
|
|
388
|
+
* - 信封解析(宿主 `{ok:false,error}` 与 `{ok:true,value}` 是两种形状);
|
|
389
|
+
* - 错误归一(调用点只关心 ok/text/error,不重复猜)。
|
|
390
|
+
*/
|
|
391
|
+
function errorText(value) {
|
|
392
|
+
if (typeof value === "string") return value;
|
|
393
|
+
if (value && typeof value === "object") {
|
|
394
|
+
const record = value;
|
|
395
|
+
if (typeof record.message === "string" && record.message) return record.message;
|
|
396
|
+
if (typeof record.code === "string" && record.code) return record.code;
|
|
397
|
+
}
|
|
398
|
+
return "";
|
|
399
|
+
}
|
|
400
|
+
/**
|
|
401
|
+
* 执行一条 `/tasks` 命令。
|
|
402
|
+
* @param ctx client 上下文(服务一律软探测)
|
|
403
|
+
* @param sessionId 当前会话;为空表示没有可用数据通道
|
|
404
|
+
* @param line 完整命令行(以 `/tasks` 开头)
|
|
405
|
+
* @param timeoutMs 超时;到点 abort,调用方拿到可重试的错误态
|
|
406
|
+
*/
|
|
407
|
+
async function invokeCommand(ctx, sessionId, line, timeoutMs = 15e3) {
|
|
408
|
+
const commands = service(ctx, "remote.commands");
|
|
409
|
+
if (!sessionId || !commands || typeof commands.execute !== "function") return {
|
|
410
|
+
ok: false,
|
|
411
|
+
text: "",
|
|
412
|
+
error: "no-channel"
|
|
413
|
+
};
|
|
414
|
+
const controller = typeof AbortController === "function" ? new AbortController() : null;
|
|
415
|
+
const timer = controller ? setTimeout(() => controller.abort(), timeoutMs) : null;
|
|
416
|
+
try {
|
|
417
|
+
const response = await commands.execute(sessionId, line, [], controller?.signal);
|
|
418
|
+
const envelope = response && typeof response === "object" ? response : null;
|
|
419
|
+
if (envelope && envelope.ok === false) return {
|
|
420
|
+
ok: false,
|
|
421
|
+
text: "",
|
|
422
|
+
error: errorText(envelope.error) || "command rejected"
|
|
423
|
+
};
|
|
424
|
+
const execution = envelope && "value" in envelope ? envelope.value : envelope;
|
|
425
|
+
if (execution === void 0 || execution === null) return {
|
|
426
|
+
ok: false,
|
|
427
|
+
text: "",
|
|
428
|
+
error: "unknown or malformed command"
|
|
429
|
+
};
|
|
430
|
+
const result = execution.result ?? execution;
|
|
431
|
+
if (result?.kind === "error") return {
|
|
432
|
+
ok: false,
|
|
433
|
+
text: "",
|
|
434
|
+
error: String(result.text ?? "command error")
|
|
435
|
+
};
|
|
436
|
+
return {
|
|
437
|
+
ok: true,
|
|
438
|
+
text: typeof result?.text === "string" ? result.text : ""
|
|
439
|
+
};
|
|
440
|
+
} catch (err) {
|
|
441
|
+
return {
|
|
442
|
+
ok: false,
|
|
443
|
+
text: "",
|
|
444
|
+
error: controller?.signal.aborted === true ? "command timed out" : String(err?.message ?? err)
|
|
445
|
+
};
|
|
446
|
+
} finally {
|
|
447
|
+
if (timer !== null) clearTimeout(timer);
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
//#endregion
|
|
451
|
+
//#region src/client/task-scope.js
|
|
452
|
+
/**
|
|
453
|
+
* 跨标签页任务广播的**项目作用域**判定(纯函数,无 React / 无 BroadcastChannel 依赖)。
|
|
454
|
+
*
|
|
455
|
+
* 为什么需要它:同步频道名是固定的(同一浏览器同源的所有 dsh 页面共用一个
|
|
456
|
+
* `dsh-pm-tasks-data`),而消息体只带任务数组。没有作用域判定时,在 A 项目点一下刷新,
|
|
457
|
+
* B 项目的标签页面板就会被贴上 A 的任务列表——它自己保留着 B 的 `boundTaskId`,
|
|
458
|
+
* 于是表现为"绑定莫名丢了"。频道名不能按项目拆:项目根是数据到达后才知道的,
|
|
459
|
+
* 而 `new BroadcastChannel` 在模块加载期就要定名。
|
|
460
|
+
*
|
|
461
|
+
* 判据刻意**严格**:消息里没有根、或本页还没确定根,都不接受。
|
|
462
|
+
* - 无根:老宿主/老 bundle 的载荷,宁可不同步也不猜;
|
|
463
|
+
* - 本页未知根:它自己那一次 `/tasks` 会决定归属,不先借别人的数据(避免短暂显示错项目)。
|
|
464
|
+
* 两侧都已知且相等时才接受——这正是"同一项目的两个标签页"。
|
|
465
|
+
*
|
|
466
|
+
* @param {string|null|undefined} localRoot - 本页当前数据的项目根(未同步过为 null)
|
|
467
|
+
* @param {unknown} incomingRoot - 广播消息里的项目根
|
|
468
|
+
* @returns {boolean} true = 这条广播属于同一个项目,可以套用
|
|
469
|
+
*/
|
|
470
|
+
function broadcastAppliesTo(localRoot, incomingRoot) {
|
|
471
|
+
if (typeof incomingRoot !== "string" || incomingRoot === "") return false;
|
|
472
|
+
if (typeof localRoot !== "string" || localRoot === "") return false;
|
|
473
|
+
return localRoot === incomingRoot;
|
|
474
|
+
}
|
|
475
|
+
/**
|
|
476
|
+
* 从 `/tasks` 载荷里取项目根(旧宿主没有该键)。
|
|
477
|
+
* @param {unknown} value - `payload.root`
|
|
478
|
+
* @returns {string|null} 非空字符串才算根
|
|
479
|
+
*/
|
|
480
|
+
function payloadRoot(value) {
|
|
481
|
+
return typeof value === "string" && value !== "" ? value : null;
|
|
482
|
+
}
|
|
483
|
+
//#endregion
|
|
382
484
|
//#region src/client/task-data-store.ts
|
|
383
485
|
/**
|
|
384
486
|
* Task Data Store — 仅管服务端同步的数据(tasks、boundTaskId、archivedCount)
|
|
@@ -401,7 +503,8 @@ window.__ModuleLoader__.load({
|
|
|
401
503
|
return {
|
|
402
504
|
tasks: data.tasks,
|
|
403
505
|
boundId: data.boundId ?? null,
|
|
404
|
-
archived: data.archived ?? 0
|
|
506
|
+
archived: data.archived ?? 0,
|
|
507
|
+
root: payloadRoot(data.root)
|
|
405
508
|
};
|
|
406
509
|
} catch {
|
|
407
510
|
return null;
|
|
@@ -412,6 +515,7 @@ window.__ModuleLoader__.load({
|
|
|
412
515
|
tasks: [],
|
|
413
516
|
boundTaskId: null,
|
|
414
517
|
archivedCount: 0,
|
|
518
|
+
root: null,
|
|
415
519
|
lastUpdate: 0
|
|
416
520
|
};
|
|
417
521
|
const dataListeners = /* @__PURE__ */ new Set();
|
|
@@ -421,31 +525,33 @@ window.__ModuleLoader__.load({
|
|
|
421
525
|
tasks: Array.isArray(patch?.tasks) ? patch.tasks : [],
|
|
422
526
|
boundTaskId: patch?.boundTaskId ?? null,
|
|
423
527
|
archivedCount: typeof patch?.archivedCount === "number" ? patch.archivedCount : 0,
|
|
528
|
+
root: payloadRoot(patch?.root),
|
|
424
529
|
lastUpdate: typeof patch?.lastUpdate === "number" ? patch.lastUpdate : 0
|
|
425
530
|
};
|
|
426
531
|
for (const listener of dataListeners) listener();
|
|
427
532
|
}
|
|
428
|
-
function broadcastDataUpdate(tasks, archivedCount) {
|
|
533
|
+
function broadcastDataUpdate(tasks, archivedCount, root) {
|
|
429
534
|
if (!SYNC_CHANNEL) return;
|
|
430
535
|
SYNC_CHANNEL.postMessage({
|
|
431
536
|
type: "PROJECT_TASKS_UPDATED",
|
|
432
537
|
payload: {
|
|
433
538
|
tasks: Array.isArray(tasks) ? tasks : [],
|
|
434
|
-
archivedCount
|
|
539
|
+
archivedCount,
|
|
540
|
+
root
|
|
435
541
|
}
|
|
436
542
|
});
|
|
437
543
|
}
|
|
438
544
|
if (SYNC_CHANNEL) SYNC_CHANNEL.onmessage = (event) => {
|
|
439
545
|
const msg = event.data;
|
|
440
|
-
if (msg?.type
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
}
|
|
546
|
+
if (msg?.type !== "PROJECT_TASKS_UPDATED" || !msg.payload) return;
|
|
547
|
+
const { tasks, archivedCount, root } = msg.payload;
|
|
548
|
+
if (!broadcastAppliesTo(dataState.root, root)) return;
|
|
549
|
+
setDataState((prev) => ({
|
|
550
|
+
...prev,
|
|
551
|
+
tasks: Array.isArray(tasks) ? tasks : [],
|
|
552
|
+
archivedCount: typeof archivedCount === "number" ? archivedCount : prev.archivedCount,
|
|
553
|
+
lastUpdate: Date.now()
|
|
554
|
+
}));
|
|
449
555
|
};
|
|
450
556
|
const taskDataStore = {
|
|
451
557
|
subscribe(listener) {
|
|
@@ -461,19 +567,22 @@ window.__ModuleLoader__.load({
|
|
|
461
567
|
setTasks(payload) {
|
|
462
568
|
const nextTasks = payload.tasks || [];
|
|
463
569
|
const nextArchived = payload.archivedCount ?? 0;
|
|
570
|
+
const nextRoot = payloadRoot(payload.root);
|
|
464
571
|
setDataState({
|
|
465
572
|
tasks: nextTasks,
|
|
466
573
|
boundTaskId: payload.boundTaskId ?? null,
|
|
467
574
|
archivedCount: nextArchived,
|
|
575
|
+
root: nextRoot,
|
|
468
576
|
lastUpdate: Date.now()
|
|
469
577
|
});
|
|
470
|
-
broadcastDataUpdate(nextTasks, nextArchived);
|
|
578
|
+
broadcastDataUpdate(nextTasks, nextArchived, nextRoot);
|
|
471
579
|
},
|
|
472
580
|
reset() {
|
|
473
581
|
setDataState({
|
|
474
582
|
tasks: [],
|
|
475
583
|
boundTaskId: null,
|
|
476
584
|
archivedCount: 0,
|
|
585
|
+
root: null,
|
|
477
586
|
lastUpdate: 0
|
|
478
587
|
});
|
|
479
588
|
}
|
|
@@ -518,6 +627,18 @@ window.__ModuleLoader__.load({
|
|
|
518
627
|
y: 0
|
|
519
628
|
};
|
|
520
629
|
}
|
|
630
|
+
/** 位置必须留在视口内:换小屏/拔掉外接屏后,持久化的坐标可能已经看不见。 */
|
|
631
|
+
function clampPosition(value) {
|
|
632
|
+
if (typeof window === "undefined") return defaultPosition();
|
|
633
|
+
const pos = value;
|
|
634
|
+
const x = Number(pos?.x);
|
|
635
|
+
const y = Number(pos?.y);
|
|
636
|
+
if (!Number.isFinite(x) || !Number.isFinite(y)) return defaultPosition();
|
|
637
|
+
return {
|
|
638
|
+
x: Math.max(8, Math.min(x, window.innerWidth - 80)),
|
|
639
|
+
y: Math.max(8, Math.min(y, window.innerHeight - 40))
|
|
640
|
+
};
|
|
641
|
+
}
|
|
521
642
|
/**
|
|
522
643
|
* 启动时的初始状态:
|
|
523
644
|
* - closed 恒为 true(不读取 localStorage 的 closed),刷新后面板隐藏;
|
|
@@ -530,7 +651,7 @@ window.__ModuleLoader__.load({
|
|
|
530
651
|
const parsed = JSON.parse(saved);
|
|
531
652
|
return {
|
|
532
653
|
expandedTaskIds: Array.isArray(parsed.expandedTaskIds) ? parsed.expandedTaskIds : [],
|
|
533
|
-
panelPosition: parsed.panelPosition
|
|
654
|
+
panelPosition: clampPosition(parsed.panelPosition),
|
|
534
655
|
minimized: parsed.minimized !== false,
|
|
535
656
|
closed: true,
|
|
536
657
|
theme: typeof parsed.theme === "string" ? parsed.theme : "native",
|
|
@@ -590,7 +711,7 @@ window.__ModuleLoader__.load({
|
|
|
590
711
|
setPanelPosition(pos) {
|
|
591
712
|
setUIState({
|
|
592
713
|
...uiState,
|
|
593
|
-
panelPosition: pos
|
|
714
|
+
panelPosition: clampPosition(pos)
|
|
594
715
|
});
|
|
595
716
|
},
|
|
596
717
|
open() {
|
|
@@ -832,105 +953,110 @@ window.__ModuleLoader__.load({
|
|
|
832
953
|
};
|
|
833
954
|
}
|
|
834
955
|
//#endregion
|
|
835
|
-
//#region \0dsh-css:src
|
|
836
|
-
const css$1 = ".eCBeua_panel{pointer-events:auto;background:var(--dsw-alias-bg-layer-2,var(--dsw-alias-bg-base,#fff));border:1px solid var(--dsw-alias-border-l2,#7f7f7f4d);border-radius:14px;flex-direction:column;width:380px;max-width:calc(100vw - 24px);max-height:min(70vh,640px);font-family:inherit;animation:.18s ease-out eCBeua_panelIn;display:flex;position:fixed;overflow:hidden;box-shadow:0 12px 32px #00000029,0 2px 8px #00000014}@keyframes eCBeua_panelIn{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}.eCBeua_dragHandle{cursor:grab;z-index:1;justify-content:center;align-items:center;height:12px;display:flex;position:absolute;top:0;left:0;right:0}.eCBeua_dragHandle:active{cursor:grabbing}.eCBeua_handleGrip{background:var(--dsw-alias-separator-primary,#7f7f7f59);opacity:.8;border-radius:2px;width:32px;height:3px}.eCBeua_header{border-bottom:1px solid var(--dsw-alias-border-l1,#7f7f7f2e);-webkit-user-select:none;user-select:none;justify-content:space-between;align-items:center;gap:8px;padding:10px 10px 8px 14px;display:flex}.eCBeua_headerLeft{align-items:center;gap:6px;min-width:0;display:flex}.eCBeua_headerIcon{color:var(--dsw-alias-label-secondary);flex:none}.eCBeua_headerTitle{color:var(--dsw-alias-label-primary);white-space:nowrap;margin:0;font-size:13px;font-weight:600;line-height:20px}.eCBeua_headerRight{align-items:center;gap:2px;margin-left:auto;display:flex}.eCBeua_hintsOff{opacity:.45}.eCBeua_hintsOff:hover{opacity:.75}.eCBeua_counts{color:var(--dsw-alias-label-tertiary);white-space:nowrap;margin-right:4px;font-size:11px;line-height:16px}.eCBeua_boundBadge{color:var(--dsw-alias-label-primary-foreground,#fff);background:var(--dsw-alias-button-primary-fill,#3a6ef5);white-space:nowrap;border-radius:7px;flex:none;padding:0 6px;font-size:10px;line-height:14px}.eCBeua_notice{color:var(--dsw-alias-state-warn-label,#b7791f);background:var(--dsw-alias-interactive-bg-hover,#7f7f7f1a);word-break:break-all;border-radius:8px;margin:8px 12px 0;padding:6px 10px;font-size:12px;line-height:18px}.eCBeua_taskList{scrollbar-width:thin;scrollbar-color:var(--dsw-alias-scrollbar-bg-l2,transparent) transparent;flex-direction:column;gap:6px;padding:8px;display:flex;overflow-y:auto}.eCBeua_emptyState{text-align:center;color:var(--dsw-alias-label-secondary);padding:36px 24px 30px}.eCBeua_emptyTitle{color:var(--dsw-alias-label-primary);margin:0 0 6px;font-size:13px;font-weight:600}.eCBeua_emptyDesc{color:var(--dsw-alias-label-tertiary);margin:0;font-size:12px;line-height:20px}.eCBeua_syncHint{color:var(--dsw-alias-label-dimmed);justify-content:center;align-items:center;gap:6px;margin:10px 0 0;font-size:11px;display:flex}.eCBeua_card{border:1px solid var(--dsw-alias-border-l1,#7f7f7f29);background:var(--dsw-alias-bg-base,transparent);content-visibility:auto;contain-intrinsic-size:auto 140px;border-radius:10px;transition:border-color .15s;overflow:hidden}.eCBeua_cardBound{border-color:var(--dsw-alias-border-l3,#7f7f7f59);box-shadow:inset 0 0 0 .5px var(--dsw-alias-border-l3,transparent)}.eCBeua_cardHead{cursor:pointer;text-align:left;background:0 0;border:none;justify-content:space-between;align-items:center;gap:8px;width:100%;padding:8px 10px 7px;display:flex}.eCBeua_cardHead:hover{background:var(--dsw-alias-interactive-bg-hover,#7f7f7f14)}.eCBeua_cardTitleRow{align-items:center;gap:6px;min-width:0;display:flex}.eCBeua_cardTitle{color:var(--dsw-alias-label-primary);white-space:nowrap;text-overflow:ellipsis;font-size:13px;font-weight:500;line-height:20px;overflow:hidden}.eCBeua_cardMeta{color:var(--dsw-alias-label-tertiary);flex:none;align-items:center;gap:8px;display:flex}.eCBeua_progressText{font-variant-numeric:tabular-nums;color:var(--dsw-alias-label-secondary);font-size:11px;line-height:16px}.eCBeua_updated{color:var(--dsw-alias-label-dimmed);font-size:10px;line-height:14px}.eCBeua_chevron{color:var(--dsw-alias-label-tertiary);display:inline-flex}.eCBeua_track{background:var(--dsw-alias-interactive-bg-hover,#7f7f7f1f);border-radius:1px;height:2px;margin:0 10px 6px;overflow:hidden}.eCBeua_trackFill{background:var(--dsw-alias-label-primary-bluish,var(--dsw-alias-button-primary-fill,#3a6ef5));border-radius:1px;height:100%;transition:width .2s}.eCBeua_cardBody{border-top:1px solid var(--dsw-alias-border-l1,#7f7f7f24);overscroll-behavior:contain;max-height:300px;padding:8px 10px 10px;overflow-y:auto}.eCBeua_section{margin-bottom:8px}.eCBeua_section:last-child{margin-bottom:0}.eCBeua_sectionLabel{color:var(--dsw-alias-label-secondary);align-items:center;gap:6px;margin-bottom:4px;font-size:11px;line-height:16px;display:flex}.eCBeua_sectionCount{background:var(--dsw-alias-interactive-bg-hover,#7f7f7f1a);color:var(--dsw-alias-label-tertiary);border-radius:6px;padding:0 5px;font-size:10px;line-height:14px}.eCBeua_stepsList{flex-direction:column;gap:1px;margin:0;padding:0;list-style:none;display:flex}.eCBeua_stepRow{align-items:flex-start;gap:7px;padding:3px 2px;display:flex}.eCBeua_stepRow>svg{flex:none;margin-top:2px}.eCBeua_stepDone{color:var(--dsw-alias-label-dimmed)}.eCBeua_stepRun{color:var(--dsw-alias-label-primary-bluish,#3a6ef5)}.eCBeua_stepPending{background:var(--dsw-alias-border-l3,#7f7f7f80);border-radius:50%;flex:none;width:8px;height:8px;margin:5px 3px}.eCBeua_stepContent{color:var(--dsw-alias-label-secondary);word-break:break-word;white-space:pre-wrap;font-size:12px;line-height:20px}.eCBeua_stepContentDone{color:var(--dsw-alias-label-dimmed);text-decoration:line-through}.eCBeua_stepContentRun{color:var(--dsw-alias-label-primary)}.eCBeua_muted{color:var(--dsw-alias-label-dimmed);font-size:11px;line-height:18px}.eCBeua_filesList{flex-direction:column;margin:0;padding:0;list-style:none;display:flex}.eCBeua_fileRow{cursor:pointer;text-align:left;background:0 0;border:none;border-radius:6px;align-items:center;gap:6px;width:100%;padding:3px 4px;display:flex}.eCBeua_fileRow:hover{background:var(--dsw-alias-interactive-bg-hover,#7f7f7f14)}.eCBeua_fileDot{background:var(--dsw-alias-border-l3,#7f7f7f80);border-radius:50%;flex:none;width:5px;height:5px}.eCBeua_filePath{color:var(--dsw-alias-label-secondary);white-space:nowrap;text-overflow:ellipsis;text-align:left;direction:rtl;font-family:ui-monospace,SF Mono,Menlo,Consolas,monospace;font-size:11px;line-height:18px;overflow:hidden}.eCBeua_fileLine{color:var(--dsw-alias-label-dimmed);flex:none;font-size:10px;line-height:18px}.eCBeua_cardFooter{gap:6px;margin-top:8px;display:flex}@media (prefers-reduced-motion:reduce){.eCBeua_panel{animation:none}.eCBeua_trackFill,.eCBeua_card{transition:none}}.eCBeua_miniBar{border:1px solid var(--dsw-alias-border-l3,#7f7f7f4d);background:var(--dsw-alias-bg-layer-2,var(--dsw-alias-bg-base,#fff));max-width:min(46vw,340px);height:34px;color:var(--dsw-alias-label-primary);cursor:grab;-webkit-user-select:none;user-select:none;pointer-events:auto;border-radius:999px;align-items:center;gap:7px;padding:0 12px;font-size:12px;line-height:18px;transition:background .15s,border-color .15s;display:inline-flex;position:fixed;box-shadow:0 6px 20px #00000024,0 1px 4px #00000014}.eCBeua_miniBar:active{cursor:grabbing}.eCBeua_miniBar:hover{background:var(--dsw-alias-interactive-bg-hover,#7f7f7f14)}.eCBeua_miniIcon{color:var(--dsw-alias-label-secondary);flex:none}.eCBeua_miniText{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.eCBeua_miniChevron{color:var(--dsw-alias-label-tertiary);flex:none}.eCBeua_taskList{flex:auto;min-height:0}.eCBeua_card{flex-direction:column;display:flex}.eCBeua_boundaryFallback{border:1px solid var(--dsw-alias-border-l3,#7f7f7f4d);background:var(--dsw-alias-bg-layer-2,#fff);color:var(--dsw-alias-label-secondary);cursor:pointer;pointer-events:auto;border-radius:999px;padding:4px 10px;font-size:12px;line-height:18px;position:fixed;top:64px;right:16px}.eCBeua_stepToggle{cursor:pointer;background:0 0;border:none;border-radius:4px;flex:none;align-items:center;margin-top:2px;padding:0;display:inline-flex}.eCBeua_stepToggle:hover{background:var(--dsw-alias-interactive-bg-hover,#7f7f7f1f)}.eCBeua_stepToggle:disabled{cursor:default;opacity:.5}.eCBeua_stepEditable{cursor:text;border-radius:3px}.eCBeua_stepEditable:hover{outline:1px dashed var(--dsw-alias-border-l3,#7f7f7f66);outline-offset:1px}.eCBeua_stepInput{box-sizing:border-box;width:auto;min-width:0;font:inherit;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-base,transparent);border:1px solid var(--dsw-alias-border-l3,#7f7f7f73);border-radius:5px;flex:auto;padding:0 5px;font-size:12px;line-height:20px}.eCBeua_editorArea{box-sizing:border-box;min-width:0;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-base,transparent);border:1px solid var(--dsw-alias-border-l3,#7f7f7f73);resize:none;vertical-align:middle;cursor:text;white-space:pre-wrap;word-break:break-word;border-radius:5px;flex:1;margin:0;padding:2px 5px;font-family:inherit;font-size:12px;line-height:20px;overflow:hidden}.eCBeua_editorArea:focus{border-color:var(--dsw-alias-border-l3,#7f7f7f99);outline:none}.eCBeua_stepDragging{opacity:.3;background:var(--dsw-alias-interactive-bg-hover,#7f7f7f14)}.eCBeua_cardTitleEditable{cursor:text;border-radius:3px}.eCBeua_cardTitleEditable:hover{outline:1px dashed var(--dsw-alias-border-l3,#7f7f7f66);outline-offset:1px}.eCBeua_panel[data-theme=glass],.eCBeua_miniBar[data-theme=glass]{background:color-mix(in srgb, var(--dsw-alias-bg-layer-2,#fff) 90%, transparent);-webkit-backdrop-filter:blur(18px)saturate(1.2);border:1px solid color-mix(in srgb, var(--dsw-alias-border-l2,#7f7f7f4d) 80%, transparent)}.eCBeua_panel[data-theme=glass] .eCBeua_card{background:color-mix(in srgb, var(--dsw-alias-bg-base,transparent) 84%, transparent);border-color:color-mix(in srgb, var(--dsw-alias-border-l1,#7f7f7f29) 60%, transparent)}.eCBeua_panel[data-theme=glass] .eCBeua_cardBody{border-top-color:color-mix(in srgb, var(--dsw-alias-border-l1,#7f7f7f24) 60%, transparent)}@media (prefers-reduced-transparency:reduce){.eCBeua_panel[data-theme=glass],.eCBeua_miniBar[data-theme=glass]{background:var(--dsw-alias-bg-layer-2,#fff);-webkit-backdrop-filter:none;backdrop-filter:none}.eCBeua_panel[data-theme=glass] .eCBeua_card{background:var(--dsw-alias-bg-base,transparent)}}@supports not ((-webkit-backdrop-filter:blur(1px)) or (backdrop-filter:blur(1px))){.eCBeua_panel[data-theme=glass],.eCBeua_miniBar[data-theme=glass]{background:var(--dsw-alias-bg-layer-2,#fff)}}.eCBeua_panel[data-theme=brutal]{box-shadow:none;border-width:1px;border-radius:6px}.eCBeua_panel[data-theme=brutal] .eCBeua_card{border:1px solid var(--dsw-alias-border-l3,#7f7f7f6b);background:var(--dsw-alias-bg-base,transparent);box-shadow:none;border-radius:3px}.eCBeua_panel[data-theme=brutal] .eCBeua_cardHead{padding:7px 10px 6px}.eCBeua_panel[data-theme=brutal] .eCBeua_cardTitle{letter-spacing:.01em;font-weight:650}.eCBeua_panel[data-theme=brutal] .eCBeua_headerTitle{letter-spacing:.03em}.eCBeua_panel[data-theme=brutal] .eCBeua_boundBadge{border-radius:2px}.eCBeua_panel[data-theme=brutal] .eCBeua_track{border-radius:0;height:3px}.eCBeua_panel[data-theme=brutal] .eCBeua_trackFill{border-radius:0}.eCBeua_panel[data-theme=brutal] .eCBeua_cardBody{border-top:1px solid var(--dsw-alias-border-l2,#7f7f7f3d)}.eCBeua_panel[data-theme=mono] .eCBeua_headerTitle,.eCBeua_panel[data-theme=mono] .eCBeua_counts,.eCBeua_panel[data-theme=mono] .eCBeua_cardTitle,.eCBeua_panel[data-theme=mono] .eCBeua_progressText,.eCBeua_panel[data-theme=mono] .eCBeua_stepContent,.eCBeua_panel[data-theme=mono] .eCBeua_filePath{font-family:ui-monospace,SF Mono,Menlo,Consolas,Liberation Mono,monospace}.eCBeua_panel[data-theme=mono] .eCBeua_cardTitle{font-size:12px}.eCBeua_panel[data-theme=mono] .eCBeua_stepContent{font-size:11.5px}.eCBeua_panel[data-theme=mono] .eCBeua_card{border-radius:5px}.eCBeua_panel[data-theme=mono] .eCBeua_trackFill{border-radius:0}.eCBeua_panel[data-theme=mono] .eCBeua_stepPending{border-radius:1px}.eCBeua_panel[data-theme=mono] .eCBeua_updated{letter-spacing:.02em}.eCBeua_headerIconBtn{color:inherit;cursor:pointer;background:0 0;border:none;border-radius:0;flex:none;justify-content:center;align-items:center;margin:0;padding:0;display:inline-flex}.eCBeua_headerIcon{color:var(--dsw-alias-label-secondary);flex:none;display:block}.eCBeua_headerLeft{min-width:0}.eCBeua_headerTitle{text-overflow:ellipsis;flex:0 auto;min-width:0;overflow:hidden}.eCBeua_headerRight{min-width:0}.eCBeua_counts{text-overflow:ellipsis;flex:none;max-width:45%;margin-left:auto;overflow:hidden}.eCBeua_dragGhost{pointer-events:none;z-index:9999;transition:left 50ms,top 50ms;position:fixed;transform:translate(-50%,-50%)}.eCBeua_dragGhostCard{background:var(--dsw-alias-bg-layer-2,var(--dsw-alias-bg-base,#fff));border:1px solid var(--dsw-alias-border-l3,#7f7f7f59);color:var(--dsw-alias-label-primary);white-space:nowrap;border-radius:8px;align-items:center;gap:8px;max-width:280px;padding:8px 12px;font-size:12px;line-height:20px;display:inline-flex;transform:scale(.9);box-shadow:0 8px 24px #0000002e,0 2px 8px #0000001a}.eCBeua_dragGhostContent{text-overflow:ellipsis;word-break:break-word;flex:1;min-width:0;overflow:hidden}.eCBeua_dragGhostClose{width:20px;height:20px;color:var(--dsw-alias-label-tertiary);cursor:pointer;opacity:.6;background:0 0;border:none;border-radius:4px;flex:none;justify-content:center;align-items:center;margin-left:8px;font-size:16px;line-height:1;transition:opacity .15s,background .15s,color .15s;display:inline-flex}.eCBeua_dragGhostClose:hover{opacity:1;color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-interactive-bg-hover,#7f7f7f1f)}.eCBeua_dropTargetBefore{position:relative}.eCBeua_dropTargetBefore:before{content:\"\";background:var(--dsw-alias-button-primary-fill,#3a6ef5);height:2px;box-shadow:0 0 4px var(--dsw-alias-button-primary-fill,#3a6ef5);border-radius:1px;animation:.8s ease-in-out infinite eCBeua_dropPulse;position:absolute;top:-1px;left:0;right:0}.eCBeua_dropTargetAfter{position:relative}.eCBeua_dropTargetAfter:after{content:\"\";background:var(--dsw-alias-button-primary-fill,#3a6ef5);height:2px;box-shadow:0 0 4px var(--dsw-alias-button-primary-fill,#3a6ef5);border-radius:1px;animation:.8s ease-in-out infinite eCBeua_dropPulse;position:absolute;bottom:-1px;left:0;right:0}@keyframes eCBeua_dropPulse{0%,to{opacity:.6}50%{opacity:1}}.eCBeua_memoryPane{flex-direction:column;gap:6px;max-height:480px;padding:8px 10px 10px;display:flex;overflow:auto}.eCBeua_memToolbar{justify-content:space-between;align-items:center;gap:8px;display:flex}.eCBeua_memCount{opacity:.75;font-size:12px;font-weight:600}.eCBeua_memList{flex-direction:column;gap:6px;display:flex}.eCBeua_memSentinel{flex:none;height:1px}.eCBeua_memFooter{flex-direction:column;align-items:center;gap:4px;padding:6px 0 2px;font-size:12px;display:flex}.eCBeua_memRow{border:1px solid var(--dsw-border-weak,#80808040);background:color-mix(in srgb, var(--dsw-bg-secondary,#f5f5f5) 45%, transparent);content-visibility:auto;contain-intrinsic-size:auto 76px;border-radius:6px;flex-direction:column;gap:4px;padding:6px 8px;display:flex}.eCBeua_memRowArchived{opacity:.55}.eCBeua_memRowMain{flex-direction:column;gap:2px;display:flex}.eCBeua_memTitle{word-break:break-word;align-items:flex-start;gap:6px;font-size:13px;line-height:1.35;display:flex}.eCBeua_kindBadge{background:var(--dsw-accent-soft,#5078ff26);color:var(--dsw-accent,#4d6bfe);border-radius:4px;flex:none;padding:0 5px;font-size:11px;line-height:1.5}.eCBeua_memMeta{flex-wrap:wrap;align-items:center;gap:4px;display:flex}.eCBeua_badge{background:color-mix(in srgb, var(--dsw-fg,#222) 8%, transparent);border-radius:4px;padding:0 5px;font-size:11px;line-height:1.5}.eCBeua_badgeDraft{color:#b26a00;background:#ffb40029}.eCBeua_badgeArchived{opacity:.8}.eCBeua_memBody{opacity:.8;word-break:break-word;font-size:12px}.eCBeua_memActs{flex-wrap:wrap;gap:4px;display:flex}.eCBeua_memToolbarActs{align-items:center;gap:6px;display:flex}.eCBeua_memNew{border:1px solid var(--dsw-border-weak,#80808040);border-radius:6px;flex-direction:column;gap:6px;padding:8px;display:flex}.eCBeua_memNewRow{align-items:center;gap:8px;display:flex}.eCBeua_memLabel{opacity:.8;align-items:center;gap:6px;font-size:12px;display:inline-flex}.eCBeua_memNew select,.eCBeua_memNew textarea{box-sizing:border-box;width:100%}";
|
|
956
|
+
//#region \0dsh-css:src/client/TaskPanel.module.css.mjs
|
|
957
|
+
const css$1 = ".vZSZnG_panel{pointer-events:auto;background:var(--dsw-alias-bg-layer-2,var(--dsw-alias-bg-base,#fff));border:1px solid var(--dsw-alias-border-l2,#7f7f7f4d);border-radius:14px;flex-direction:column;width:380px;max-width:calc(100vw - 24px);max-height:min(70vh,640px);font-family:inherit;animation:.18s ease-out vZSZnG_panelIn;display:flex;position:fixed;overflow:hidden;box-shadow:0 12px 32px #00000029,0 2px 8px #00000014}@keyframes vZSZnG_panelIn{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}.vZSZnG_dragHandle{cursor:grab;z-index:1;justify-content:center;align-items:center;height:12px;display:flex;position:absolute;top:0;left:0;right:0}.vZSZnG_dragHandle:active{cursor:grabbing}.vZSZnG_handleGrip{background:var(--dsw-alias-separator-primary,#7f7f7f59);opacity:.8;border-radius:2px;width:32px;height:3px}.vZSZnG_header{border-bottom:1px solid var(--dsw-alias-border-l1,#7f7f7f2e);-webkit-user-select:none;user-select:none;justify-content:space-between;align-items:center;gap:8px;padding:10px 10px 8px 14px;display:flex}.vZSZnG_headerLeft{align-items:center;gap:6px;min-width:0;display:flex}.vZSZnG_headerIcon{color:var(--dsw-alias-label-secondary);flex:none}.vZSZnG_headerTitle{color:var(--dsw-alias-label-primary);white-space:nowrap;margin:0;font-size:13px;font-weight:600;line-height:20px}.vZSZnG_headerRight{align-items:center;gap:2px;margin-left:auto;display:flex}.vZSZnG_hintsOff{opacity:.45}.vZSZnG_hintsOff:hover{opacity:.75}.vZSZnG_counts{color:var(--dsw-alias-label-tertiary);white-space:nowrap;margin-right:4px;font-size:11px;line-height:16px}.vZSZnG_boundBadge{color:var(--dsw-alias-label-primary-foreground,#fff);background:var(--dsw-alias-button-primary-fill,#3a6ef5);white-space:nowrap;border-radius:7px;flex:none;padding:0 6px;font-size:10px;line-height:14px}.vZSZnG_notice{color:var(--dsw-alias-state-warn-label,#b7791f);background:var(--dsw-alias-interactive-bg-hover,#7f7f7f1a);word-break:break-all;border-radius:8px;margin:8px 12px 0;padding:6px 10px;font-size:12px;line-height:18px}.vZSZnG_taskList{scrollbar-width:thin;scrollbar-color:var(--dsw-alias-scrollbar-bg-l2,transparent) transparent;flex-direction:column;gap:6px;padding:8px;display:flex;overflow-y:auto}.vZSZnG_emptyState{text-align:center;color:var(--dsw-alias-label-secondary);padding:36px 24px 30px}.vZSZnG_emptyTitle{color:var(--dsw-alias-label-primary);margin:0 0 6px;font-size:13px;font-weight:600}.vZSZnG_emptyDesc{color:var(--dsw-alias-label-tertiary);margin:0;font-size:12px;line-height:20px}.vZSZnG_syncHint{color:var(--dsw-alias-label-dimmed);justify-content:center;align-items:center;gap:6px;margin:10px 0 0;font-size:11px;display:flex}.vZSZnG_card{border:1px solid var(--dsw-alias-border-l1,#7f7f7f29);background:var(--dsw-alias-bg-base,transparent);content-visibility:auto;contain-intrinsic-size:auto 140px;border-radius:10px;transition:border-color .15s;overflow:hidden}.vZSZnG_cardBound{border-color:var(--dsw-alias-border-l3,#7f7f7f59);box-shadow:inset 0 0 0 .5px var(--dsw-alias-border-l3,transparent)}.vZSZnG_cardHead{cursor:pointer;text-align:left;background:0 0;border:none;justify-content:space-between;align-items:center;gap:8px;width:100%;padding:8px 10px 7px;display:flex}.vZSZnG_cardHead:hover{background:var(--dsw-alias-interactive-bg-hover,#7f7f7f14)}.vZSZnG_cardTitleRow{align-items:center;gap:6px;min-width:0;display:flex}.vZSZnG_cardTitle{color:var(--dsw-alias-label-primary);white-space:nowrap;text-overflow:ellipsis;font-size:13px;font-weight:500;line-height:20px;overflow:hidden}.vZSZnG_cardMeta{color:var(--dsw-alias-label-tertiary);flex:none;align-items:center;gap:8px;display:flex}.vZSZnG_progressText{font-variant-numeric:tabular-nums;color:var(--dsw-alias-label-secondary);font-size:11px;line-height:16px}.vZSZnG_updated{color:var(--dsw-alias-label-dimmed);font-size:10px;line-height:14px}.vZSZnG_chevron{color:var(--dsw-alias-label-tertiary);display:inline-flex}.vZSZnG_track{background:var(--dsw-alias-interactive-bg-hover,#7f7f7f1f);border-radius:1px;height:2px;margin:0 10px 6px;overflow:hidden}.vZSZnG_trackFill{background:var(--dsw-alias-label-primary-bluish,var(--dsw-alias-button-primary-fill,#3a6ef5));border-radius:1px;height:100%;transition:width .2s}.vZSZnG_cardBody{border-top:1px solid var(--dsw-alias-border-l1,#7f7f7f24);overscroll-behavior:contain;max-height:300px;padding:8px 10px 10px;overflow-y:auto}.vZSZnG_section{margin-bottom:8px}.vZSZnG_section:last-child{margin-bottom:0}.vZSZnG_sectionLabel{color:var(--dsw-alias-label-secondary);align-items:center;gap:6px;margin-bottom:4px;font-size:11px;line-height:16px;display:flex}.vZSZnG_sectionCount{background:var(--dsw-alias-interactive-bg-hover,#7f7f7f1a);color:var(--dsw-alias-label-tertiary);border-radius:6px;padding:0 5px;font-size:10px;line-height:14px}.vZSZnG_stepsList{flex-direction:column;gap:1px;margin:0;padding:0;list-style:none;display:flex}.vZSZnG_stepRow{align-items:flex-start;gap:7px;padding:3px 2px;display:flex}.vZSZnG_stepRow>svg{flex:none;margin-top:2px}.vZSZnG_stepDone{color:var(--dsw-alias-label-dimmed)}.vZSZnG_stepRun{color:var(--dsw-alias-label-primary-bluish,#3a6ef5)}.vZSZnG_stepPending{background:var(--dsw-alias-border-l3,#7f7f7f80);border-radius:50%;flex:none;width:8px;height:8px;margin:5px 3px}.vZSZnG_stepContent{color:var(--dsw-alias-label-secondary);word-break:break-word;white-space:pre-wrap;font-size:12px;line-height:20px}.vZSZnG_stepContentDone{color:var(--dsw-alias-label-dimmed);text-decoration:line-through}.vZSZnG_stepContentRun{color:var(--dsw-alias-label-primary)}.vZSZnG_muted{color:var(--dsw-alias-label-dimmed);font-size:11px;line-height:18px}.vZSZnG_filesList{flex-direction:column;margin:0;padding:0;list-style:none;display:flex}.vZSZnG_fileRow{cursor:pointer;text-align:left;background:0 0;border:none;border-radius:6px;align-items:center;gap:6px;width:100%;padding:3px 4px;display:flex}.vZSZnG_fileRow:hover{background:var(--dsw-alias-interactive-bg-hover,#7f7f7f14)}.vZSZnG_fileDot{background:var(--dsw-alias-border-l3,#7f7f7f80);border-radius:50%;flex:none;width:5px;height:5px}.vZSZnG_filePath{color:var(--dsw-alias-label-secondary);white-space:nowrap;text-overflow:ellipsis;text-align:left;direction:rtl;font-family:ui-monospace,SF Mono,Menlo,Consolas,monospace;font-size:11px;line-height:18px;overflow:hidden}.vZSZnG_fileLine{color:var(--dsw-alias-label-dimmed);flex:none;font-size:10px;line-height:18px}.vZSZnG_cardFooter{gap:6px;margin-top:8px;display:flex}@media (prefers-reduced-motion:reduce){.vZSZnG_panel{animation:none}.vZSZnG_trackFill,.vZSZnG_card{transition:none}}.vZSZnG_miniBar{border:1px solid var(--dsw-alias-border-l3,#7f7f7f4d);background:var(--dsw-alias-bg-layer-2,var(--dsw-alias-bg-base,#fff));max-width:min(46vw,340px);height:34px;color:var(--dsw-alias-label-primary);cursor:grab;-webkit-user-select:none;user-select:none;pointer-events:auto;border-radius:999px;align-items:center;gap:7px;padding:0 12px;font-size:12px;line-height:18px;transition:background .15s,border-color .15s;display:inline-flex;position:fixed;box-shadow:0 6px 20px #00000024,0 1px 4px #00000014}.vZSZnG_miniBar:active{cursor:grabbing}.vZSZnG_miniBar:hover{background:var(--dsw-alias-interactive-bg-hover,#7f7f7f14)}.vZSZnG_miniIcon{color:var(--dsw-alias-label-secondary);flex:none}.vZSZnG_miniText{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.vZSZnG_miniChevron{color:var(--dsw-alias-label-tertiary);flex:none}.vZSZnG_taskList{flex:auto;min-height:0}.vZSZnG_card{flex-direction:column;display:flex}.vZSZnG_boundaryFallback{border:1px solid var(--dsw-alias-border-l3,#7f7f7f4d);background:var(--dsw-alias-bg-layer-2,#fff);color:var(--dsw-alias-label-secondary);cursor:pointer;pointer-events:auto;border-radius:999px;padding:4px 10px;font-size:12px;line-height:18px;position:fixed;top:64px;right:16px}.vZSZnG_stepToggle{cursor:pointer;background:0 0;border:none;border-radius:4px;flex:none;align-items:center;margin-top:2px;padding:0;display:inline-flex}.vZSZnG_stepToggle:hover{background:var(--dsw-alias-interactive-bg-hover,#7f7f7f1f)}.vZSZnG_stepToggle:disabled{cursor:default;opacity:.5}.vZSZnG_stepEditable{cursor:text;border-radius:3px}.vZSZnG_stepEditable:hover{outline:1px dashed var(--dsw-alias-border-l3,#7f7f7f66);outline-offset:1px}.vZSZnG_stepInput{box-sizing:border-box;width:auto;min-width:0;font:inherit;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-base,transparent);border:1px solid var(--dsw-alias-border-l3,#7f7f7f73);border-radius:5px;flex:auto;padding:0 5px;font-size:12px;line-height:20px}.vZSZnG_editorArea{box-sizing:border-box;min-width:0;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-base,transparent);border:1px solid var(--dsw-alias-border-l3,#7f7f7f73);resize:none;vertical-align:middle;cursor:text;white-space:pre-wrap;word-break:break-word;border-radius:5px;flex:1;margin:0;padding:2px 5px;font-family:inherit;font-size:12px;line-height:20px;overflow:hidden}.vZSZnG_editorArea:focus{border-color:var(--dsw-alias-border-l3,#7f7f7f99);outline:none}.vZSZnG_stepDragging{opacity:.3;background:var(--dsw-alias-interactive-bg-hover,#7f7f7f14)}.vZSZnG_cardTitleEditable{cursor:text;border-radius:3px}.vZSZnG_cardTitleEditable:hover{outline:1px dashed var(--dsw-alias-border-l3,#7f7f7f66);outline-offset:1px}.vZSZnG_panel[data-theme=glass],.vZSZnG_miniBar[data-theme=glass]{background:color-mix(in srgb, var(--dsw-alias-bg-layer-2,#fff) 90%, transparent);-webkit-backdrop-filter:blur(18px)saturate(1.2);border:1px solid color-mix(in srgb, var(--dsw-alias-border-l2,#7f7f7f4d) 80%, transparent)}.vZSZnG_panel[data-theme=glass] .vZSZnG_card{background:color-mix(in srgb, var(--dsw-alias-bg-base,transparent) 84%, transparent);border-color:color-mix(in srgb, var(--dsw-alias-border-l1,#7f7f7f29) 60%, transparent)}.vZSZnG_panel[data-theme=glass] .vZSZnG_cardBody{border-top-color:color-mix(in srgb, var(--dsw-alias-border-l1,#7f7f7f24) 60%, transparent)}@media (prefers-reduced-transparency:reduce){.vZSZnG_panel[data-theme=glass],.vZSZnG_miniBar[data-theme=glass]{background:var(--dsw-alias-bg-layer-2,#fff);-webkit-backdrop-filter:none;backdrop-filter:none}.vZSZnG_panel[data-theme=glass] .vZSZnG_card{background:var(--dsw-alias-bg-base,transparent)}}@supports not ((-webkit-backdrop-filter:blur(1px)) or (backdrop-filter:blur(1px))){.vZSZnG_panel[data-theme=glass],.vZSZnG_miniBar[data-theme=glass]{background:var(--dsw-alias-bg-layer-2,#fff)}}.vZSZnG_panel[data-theme=brutal]{box-shadow:none;border-width:1px;border-radius:6px}.vZSZnG_panel[data-theme=brutal] .vZSZnG_card{border:1px solid var(--dsw-alias-border-l3,#7f7f7f6b);background:var(--dsw-alias-bg-base,transparent);box-shadow:none;border-radius:3px}.vZSZnG_panel[data-theme=brutal] .vZSZnG_cardHead{padding:7px 10px 6px}.vZSZnG_panel[data-theme=brutal] .vZSZnG_cardTitle{letter-spacing:.01em;font-weight:650}.vZSZnG_panel[data-theme=brutal] .vZSZnG_headerTitle{letter-spacing:.03em}.vZSZnG_panel[data-theme=brutal] .vZSZnG_boundBadge{border-radius:2px}.vZSZnG_panel[data-theme=brutal] .vZSZnG_track{border-radius:0;height:3px}.vZSZnG_panel[data-theme=brutal] .vZSZnG_trackFill{border-radius:0}.vZSZnG_panel[data-theme=brutal] .vZSZnG_cardBody{border-top:1px solid var(--dsw-alias-border-l2,#7f7f7f3d)}.vZSZnG_panel[data-theme=mono] .vZSZnG_headerTitle,.vZSZnG_panel[data-theme=mono] .vZSZnG_counts,.vZSZnG_panel[data-theme=mono] .vZSZnG_cardTitle,.vZSZnG_panel[data-theme=mono] .vZSZnG_progressText,.vZSZnG_panel[data-theme=mono] .vZSZnG_stepContent,.vZSZnG_panel[data-theme=mono] .vZSZnG_filePath{font-family:ui-monospace,SF Mono,Menlo,Consolas,Liberation Mono,monospace}.vZSZnG_panel[data-theme=mono] .vZSZnG_cardTitle{font-size:12px}.vZSZnG_panel[data-theme=mono] .vZSZnG_stepContent{font-size:11.5px}.vZSZnG_panel[data-theme=mono] .vZSZnG_card{border-radius:5px}.vZSZnG_panel[data-theme=mono] .vZSZnG_trackFill{border-radius:0}.vZSZnG_panel[data-theme=mono] .vZSZnG_stepPending{border-radius:1px}.vZSZnG_panel[data-theme=mono] .vZSZnG_updated{letter-spacing:.02em}.vZSZnG_headerIconBtn{color:inherit;cursor:pointer;background:0 0;border:none;border-radius:0;flex:none;justify-content:center;align-items:center;margin:0;padding:0;display:inline-flex}.vZSZnG_headerIcon{color:var(--dsw-alias-label-secondary);flex:none;display:block}.vZSZnG_headerLeft{min-width:0}.vZSZnG_headerTitle{text-overflow:ellipsis;flex:0 auto;min-width:0;overflow:hidden}.vZSZnG_headerRight{min-width:0}.vZSZnG_counts{text-overflow:ellipsis;flex:none;max-width:45%;margin-left:auto;overflow:hidden}.vZSZnG_dragGhost{pointer-events:none;z-index:9999;transition:left 50ms,top 50ms;position:fixed;transform:translate(-50%,-50%)}.vZSZnG_dragGhostCard{background:var(--dsw-alias-bg-layer-2,var(--dsw-alias-bg-base,#fff));border:1px solid var(--dsw-alias-border-l3,#7f7f7f59);color:var(--dsw-alias-label-primary);white-space:nowrap;border-radius:8px;align-items:center;gap:8px;max-width:280px;padding:8px 12px;font-size:12px;line-height:20px;display:inline-flex;transform:scale(.9);box-shadow:0 8px 24px #0000002e,0 2px 8px #0000001a}.vZSZnG_dragGhostContent{text-overflow:ellipsis;word-break:break-word;flex:1;min-width:0;overflow:hidden}.vZSZnG_dragGhostClose{width:20px;height:20px;color:var(--dsw-alias-label-tertiary);cursor:pointer;opacity:.6;background:0 0;border:none;border-radius:4px;flex:none;justify-content:center;align-items:center;margin-left:8px;font-size:16px;line-height:1;transition:opacity .15s,background .15s,color .15s;display:inline-flex}.vZSZnG_dragGhostClose:hover{opacity:1;color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-interactive-bg-hover,#7f7f7f1f)}.vZSZnG_dropTargetBefore{position:relative}.vZSZnG_dropTargetBefore:before{content:\"\";background:var(--dsw-alias-button-primary-fill,#3a6ef5);height:2px;box-shadow:0 0 4px var(--dsw-alias-button-primary-fill,#3a6ef5);border-radius:1px;animation:.8s ease-in-out infinite vZSZnG_dropPulse;position:absolute;top:-1px;left:0;right:0}.vZSZnG_dropTargetAfter{position:relative}.vZSZnG_dropTargetAfter:after{content:\"\";background:var(--dsw-alias-button-primary-fill,#3a6ef5);height:2px;box-shadow:0 0 4px var(--dsw-alias-button-primary-fill,#3a6ef5);border-radius:1px;animation:.8s ease-in-out infinite vZSZnG_dropPulse;position:absolute;bottom:-1px;left:0;right:0}@keyframes vZSZnG_dropPulse{0%,to{opacity:.6}50%{opacity:1}}.vZSZnG_memoryPane{flex-direction:column;gap:6px;max-height:480px;padding:8px 10px 10px;display:flex;overflow:auto}.vZSZnG_memToolbar{justify-content:space-between;align-items:center;gap:8px;display:flex}.vZSZnG_memCount{opacity:.75;font-size:12px;font-weight:600}.vZSZnG_memList{flex-direction:column;gap:6px;display:flex}.vZSZnG_memSentinel{flex:none;height:1px}.vZSZnG_memFooter{flex-direction:column;align-items:center;gap:4px;padding:6px 0 2px;font-size:12px;display:flex}.vZSZnG_memRow{border:1px solid var(--dsw-border-weak,#80808040);background:color-mix(in srgb, var(--dsw-bg-secondary,#f5f5f5) 45%, transparent);content-visibility:auto;contain-intrinsic-size:auto 76px;border-radius:6px;flex-direction:column;gap:4px;padding:6px 8px;display:flex}.vZSZnG_memRowArchived{opacity:.55}.vZSZnG_memRowMain{flex-direction:column;gap:2px;display:flex}.vZSZnG_memTitle{word-break:break-word;align-items:flex-start;gap:6px;font-size:13px;line-height:1.35;display:flex}.vZSZnG_kindBadge{background:var(--dsw-accent-soft,#5078ff26);color:var(--dsw-accent,#4d6bfe);border-radius:4px;flex:none;padding:0 5px;font-size:11px;line-height:1.5}.vZSZnG_memMeta{flex-wrap:wrap;align-items:center;gap:4px;display:flex}.vZSZnG_badge{background:color-mix(in srgb, var(--dsw-fg,#222) 8%, transparent);border-radius:4px;padding:0 5px;font-size:11px;line-height:1.5}.vZSZnG_badgeDraft{color:#b26a00;background:#ffb40029}.vZSZnG_badgeArchived{opacity:.8}.vZSZnG_memBody{opacity:.8;word-break:break-word;font-size:12px}.vZSZnG_memActs{flex-wrap:wrap;gap:4px;display:flex}.vZSZnG_memToolbarActs{align-items:center;gap:6px;display:flex}.vZSZnG_memNew{border:1px solid var(--dsw-border-weak,#80808040);border-radius:6px;flex-direction:column;gap:6px;padding:8px;display:flex}.vZSZnG_memNewRow{align-items:center;gap:8px;display:flex}.vZSZnG_memLabel{opacity:.8;align-items:center;gap:6px;font-size:12px;display:inline-flex}.vZSZnG_memNew select,.vZSZnG_memNew textarea{box-sizing:border-box;width:100%}";
|
|
837
958
|
const tagId$1 = "@yolk_vat-y/dsh-project-memory/TaskPanel.module.css";
|
|
838
|
-
if (typeof document !== "undefined"
|
|
839
|
-
const
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
959
|
+
if (typeof document !== "undefined") {
|
|
960
|
+
const selector = "style[data-plugin-css=" + JSON.stringify(tagId$1) + "]";
|
|
961
|
+
const existing = document.querySelector(selector);
|
|
962
|
+
if (existing) existing.textContent = css$1;
|
|
963
|
+
else {
|
|
964
|
+
const tag = document.createElement("style");
|
|
965
|
+
tag.dataset.plugin = "@yolk_vat-y/dsh-project-memory";
|
|
966
|
+
tag.dataset.pluginCss = tagId$1;
|
|
967
|
+
tag.textContent = css$1;
|
|
968
|
+
document.head.appendChild(tag);
|
|
969
|
+
}
|
|
844
970
|
}
|
|
845
971
|
var TaskPanel_module_css_default = {
|
|
846
|
-
"badge": "
|
|
847
|
-
"badgeArchived": "
|
|
848
|
-
"badgeDraft": "
|
|
849
|
-
"boundBadge": "
|
|
850
|
-
"boundaryFallback": "
|
|
851
|
-
"card": "
|
|
852
|
-
"cardBody": "
|
|
853
|
-
"cardBound": "
|
|
854
|
-
"cardFooter": "
|
|
855
|
-
"cardHead": "
|
|
856
|
-
"cardMeta": "
|
|
857
|
-
"cardTitle": "
|
|
858
|
-
"cardTitleEditable": "
|
|
859
|
-
"cardTitleRow": "
|
|
860
|
-
"chevron": "
|
|
861
|
-
"counts": "
|
|
862
|
-
"dragGhost": "
|
|
863
|
-
"dragGhostCard": "
|
|
864
|
-
"dragGhostClose": "
|
|
865
|
-
"dragGhostContent": "
|
|
866
|
-
"dragHandle": "
|
|
867
|
-
"dropPulse": "
|
|
868
|
-
"dropTargetAfter": "
|
|
869
|
-
"dropTargetBefore": "
|
|
870
|
-
"editorArea": "
|
|
871
|
-
"emptyDesc": "
|
|
872
|
-
"emptyState": "
|
|
873
|
-
"emptyTitle": "
|
|
874
|
-
"fileDot": "
|
|
875
|
-
"fileLine": "
|
|
876
|
-
"filePath": "
|
|
877
|
-
"fileRow": "
|
|
878
|
-
"filesList": "
|
|
879
|
-
"handleGrip": "
|
|
880
|
-
"header": "
|
|
881
|
-
"headerIcon": "
|
|
882
|
-
"headerIconBtn": "
|
|
883
|
-
"headerLeft": "
|
|
884
|
-
"headerRight": "
|
|
885
|
-
"headerTitle": "
|
|
886
|
-
"hintsOff": "
|
|
887
|
-
"kindBadge": "
|
|
888
|
-
"memActs": "
|
|
889
|
-
"memBody": "
|
|
890
|
-
"memCount": "
|
|
891
|
-
"memFooter": "
|
|
892
|
-
"memLabel": "
|
|
893
|
-
"memList": "
|
|
894
|
-
"memMeta": "
|
|
895
|
-
"memNew": "
|
|
896
|
-
"memNewRow": "
|
|
897
|
-
"memRow": "
|
|
898
|
-
"memRowArchived": "
|
|
899
|
-
"memRowMain": "
|
|
900
|
-
"memSentinel": "
|
|
901
|
-
"memTitle": "
|
|
902
|
-
"memToolbar": "
|
|
903
|
-
"memToolbarActs": "
|
|
904
|
-
"memoryPane": "
|
|
905
|
-
"miniBar": "
|
|
906
|
-
"miniChevron": "
|
|
907
|
-
"miniIcon": "
|
|
908
|
-
"miniText": "
|
|
909
|
-
"muted": "
|
|
910
|
-
"notice": "
|
|
911
|
-
"panel": "
|
|
912
|
-
"panelIn": "
|
|
913
|
-
"progressText": "
|
|
914
|
-
"section": "
|
|
915
|
-
"sectionCount": "
|
|
916
|
-
"sectionLabel": "
|
|
917
|
-
"stepContent": "
|
|
918
|
-
"stepContentDone": "
|
|
919
|
-
"stepContentRun": "
|
|
920
|
-
"stepDone": "
|
|
921
|
-
"stepDragging": "
|
|
922
|
-
"stepEditable": "
|
|
923
|
-
"stepInput": "
|
|
924
|
-
"stepPending": "
|
|
925
|
-
"stepRow": "
|
|
926
|
-
"stepRun": "
|
|
927
|
-
"stepToggle": "
|
|
928
|
-
"stepsList": "
|
|
929
|
-
"syncHint": "
|
|
930
|
-
"taskList": "
|
|
931
|
-
"track": "
|
|
932
|
-
"trackFill": "
|
|
933
|
-
"updated": "
|
|
972
|
+
"badge": "vZSZnG_badge",
|
|
973
|
+
"badgeArchived": "vZSZnG_badgeArchived",
|
|
974
|
+
"badgeDraft": "vZSZnG_badgeDraft",
|
|
975
|
+
"boundBadge": "vZSZnG_boundBadge",
|
|
976
|
+
"boundaryFallback": "vZSZnG_boundaryFallback",
|
|
977
|
+
"card": "vZSZnG_card",
|
|
978
|
+
"cardBody": "vZSZnG_cardBody",
|
|
979
|
+
"cardBound": "vZSZnG_cardBound",
|
|
980
|
+
"cardFooter": "vZSZnG_cardFooter",
|
|
981
|
+
"cardHead": "vZSZnG_cardHead",
|
|
982
|
+
"cardMeta": "vZSZnG_cardMeta",
|
|
983
|
+
"cardTitle": "vZSZnG_cardTitle",
|
|
984
|
+
"cardTitleEditable": "vZSZnG_cardTitleEditable",
|
|
985
|
+
"cardTitleRow": "vZSZnG_cardTitleRow",
|
|
986
|
+
"chevron": "vZSZnG_chevron",
|
|
987
|
+
"counts": "vZSZnG_counts",
|
|
988
|
+
"dragGhost": "vZSZnG_dragGhost",
|
|
989
|
+
"dragGhostCard": "vZSZnG_dragGhostCard",
|
|
990
|
+
"dragGhostClose": "vZSZnG_dragGhostClose",
|
|
991
|
+
"dragGhostContent": "vZSZnG_dragGhostContent",
|
|
992
|
+
"dragHandle": "vZSZnG_dragHandle",
|
|
993
|
+
"dropPulse": "vZSZnG_dropPulse",
|
|
994
|
+
"dropTargetAfter": "vZSZnG_dropTargetAfter",
|
|
995
|
+
"dropTargetBefore": "vZSZnG_dropTargetBefore",
|
|
996
|
+
"editorArea": "vZSZnG_editorArea",
|
|
997
|
+
"emptyDesc": "vZSZnG_emptyDesc",
|
|
998
|
+
"emptyState": "vZSZnG_emptyState",
|
|
999
|
+
"emptyTitle": "vZSZnG_emptyTitle",
|
|
1000
|
+
"fileDot": "vZSZnG_fileDot",
|
|
1001
|
+
"fileLine": "vZSZnG_fileLine",
|
|
1002
|
+
"filePath": "vZSZnG_filePath",
|
|
1003
|
+
"fileRow": "vZSZnG_fileRow",
|
|
1004
|
+
"filesList": "vZSZnG_filesList",
|
|
1005
|
+
"handleGrip": "vZSZnG_handleGrip",
|
|
1006
|
+
"header": "vZSZnG_header",
|
|
1007
|
+
"headerIcon": "vZSZnG_headerIcon",
|
|
1008
|
+
"headerIconBtn": "vZSZnG_headerIconBtn",
|
|
1009
|
+
"headerLeft": "vZSZnG_headerLeft",
|
|
1010
|
+
"headerRight": "vZSZnG_headerRight",
|
|
1011
|
+
"headerTitle": "vZSZnG_headerTitle",
|
|
1012
|
+
"hintsOff": "vZSZnG_hintsOff",
|
|
1013
|
+
"kindBadge": "vZSZnG_kindBadge",
|
|
1014
|
+
"memActs": "vZSZnG_memActs",
|
|
1015
|
+
"memBody": "vZSZnG_memBody",
|
|
1016
|
+
"memCount": "vZSZnG_memCount",
|
|
1017
|
+
"memFooter": "vZSZnG_memFooter",
|
|
1018
|
+
"memLabel": "vZSZnG_memLabel",
|
|
1019
|
+
"memList": "vZSZnG_memList",
|
|
1020
|
+
"memMeta": "vZSZnG_memMeta",
|
|
1021
|
+
"memNew": "vZSZnG_memNew",
|
|
1022
|
+
"memNewRow": "vZSZnG_memNewRow",
|
|
1023
|
+
"memRow": "vZSZnG_memRow",
|
|
1024
|
+
"memRowArchived": "vZSZnG_memRowArchived",
|
|
1025
|
+
"memRowMain": "vZSZnG_memRowMain",
|
|
1026
|
+
"memSentinel": "vZSZnG_memSentinel",
|
|
1027
|
+
"memTitle": "vZSZnG_memTitle",
|
|
1028
|
+
"memToolbar": "vZSZnG_memToolbar",
|
|
1029
|
+
"memToolbarActs": "vZSZnG_memToolbarActs",
|
|
1030
|
+
"memoryPane": "vZSZnG_memoryPane",
|
|
1031
|
+
"miniBar": "vZSZnG_miniBar",
|
|
1032
|
+
"miniChevron": "vZSZnG_miniChevron",
|
|
1033
|
+
"miniIcon": "vZSZnG_miniIcon",
|
|
1034
|
+
"miniText": "vZSZnG_miniText",
|
|
1035
|
+
"muted": "vZSZnG_muted",
|
|
1036
|
+
"notice": "vZSZnG_notice",
|
|
1037
|
+
"panel": "vZSZnG_panel",
|
|
1038
|
+
"panelIn": "vZSZnG_panelIn",
|
|
1039
|
+
"progressText": "vZSZnG_progressText",
|
|
1040
|
+
"section": "vZSZnG_section",
|
|
1041
|
+
"sectionCount": "vZSZnG_sectionCount",
|
|
1042
|
+
"sectionLabel": "vZSZnG_sectionLabel",
|
|
1043
|
+
"stepContent": "vZSZnG_stepContent",
|
|
1044
|
+
"stepContentDone": "vZSZnG_stepContentDone",
|
|
1045
|
+
"stepContentRun": "vZSZnG_stepContentRun",
|
|
1046
|
+
"stepDone": "vZSZnG_stepDone",
|
|
1047
|
+
"stepDragging": "vZSZnG_stepDragging",
|
|
1048
|
+
"stepEditable": "vZSZnG_stepEditable",
|
|
1049
|
+
"stepInput": "vZSZnG_stepInput",
|
|
1050
|
+
"stepPending": "vZSZnG_stepPending",
|
|
1051
|
+
"stepRow": "vZSZnG_stepRow",
|
|
1052
|
+
"stepRun": "vZSZnG_stepRun",
|
|
1053
|
+
"stepToggle": "vZSZnG_stepToggle",
|
|
1054
|
+
"stepsList": "vZSZnG_stepsList",
|
|
1055
|
+
"syncHint": "vZSZnG_syncHint",
|
|
1056
|
+
"taskList": "vZSZnG_taskList",
|
|
1057
|
+
"track": "vZSZnG_track",
|
|
1058
|
+
"trackFill": "vZSZnG_trackFill",
|
|
1059
|
+
"updated": "vZSZnG_updated"
|
|
934
1060
|
};
|
|
935
1061
|
//#endregion
|
|
936
1062
|
//#region src/client/TaskComponents.tsx
|
|
@@ -1053,7 +1179,14 @@ window.__ModuleLoader__.load({
|
|
|
1053
1179
|
},
|
|
1054
1180
|
"data-theme": theme === "native" ? void 0 : theme,
|
|
1055
1181
|
onMouseDown,
|
|
1182
|
+
onKeyDown: (e) => {
|
|
1183
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
1184
|
+
e.preventDefault();
|
|
1185
|
+
open();
|
|
1186
|
+
}
|
|
1187
|
+
},
|
|
1056
1188
|
role: "button",
|
|
1189
|
+
tabIndex: 0,
|
|
1057
1190
|
title: showHints ? hint : void 0,
|
|
1058
1191
|
"aria-label": hint,
|
|
1059
1192
|
children: [
|
|
@@ -1114,9 +1247,17 @@ window.__ModuleLoader__.load({
|
|
|
1114
1247
|
"data-task-id": task.id,
|
|
1115
1248
|
className: `${TaskPanel_module_css_default.card}${isBound ? ` ${TaskPanel_module_css_default.cardBound}` : ""}`,
|
|
1116
1249
|
children: [
|
|
1117
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("
|
|
1250
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1118
1251
|
className: TaskPanel_module_css_default.cardHead,
|
|
1252
|
+
role: "button",
|
|
1253
|
+
tabIndex: 0,
|
|
1119
1254
|
onClick: handleHeadClick,
|
|
1255
|
+
onKeyDown: (e) => {
|
|
1256
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
1257
|
+
e.preventDefault();
|
|
1258
|
+
handleHeadClick(e);
|
|
1259
|
+
}
|
|
1260
|
+
},
|
|
1120
1261
|
onMouseDownCapture: () => {
|
|
1121
1262
|
if (titleEdit !== null) suppressHeadClick.current = true;
|
|
1122
1263
|
},
|
|
@@ -1527,6 +1668,42 @@ window.__ModuleLoader__.load({
|
|
|
1527
1668
|
* 列表是**增量加载**的:首屏只取 PAGE_SIZE 条,滚到底前 600px 预取下一页追加。
|
|
1528
1669
|
* 分页的决策逻辑在 ./paging.js(纯函数,可单测),本组件只把它接到渲染上。
|
|
1529
1670
|
*/
|
|
1671
|
+
/**
|
|
1672
|
+
* 切页缓存:任务/项目/全局三页在同一个面板里来回切时,30 秒内直接复用上一份列表,
|
|
1673
|
+
* 不再发 /tasks insight list。宿主每次命令都会在会话里留一个 command 节点,
|
|
1674
|
+
* 而"切回刚才那页"并不需要重新证明数据没变;动作之后的 reloadWindow 会更新缓存。
|
|
1675
|
+
*/
|
|
1676
|
+
const INSIGHT_CACHE_TTL_MS = 3e4;
|
|
1677
|
+
const INSIGHT_CACHE_MAX = 12;
|
|
1678
|
+
const insightCache = /* @__PURE__ */ new Map();
|
|
1679
|
+
function insightCacheKey(sessionId, scope, root, boundTaskId) {
|
|
1680
|
+
return `${sessionId || ""}|${root || ""}|${scope}|${boundTaskId || ""}`;
|
|
1681
|
+
}
|
|
1682
|
+
function readInsightCache(sessionId, scope, root, boundTaskId) {
|
|
1683
|
+
const key = insightCacheKey(sessionId, scope, root, boundTaskId);
|
|
1684
|
+
const hit = insightCache.get(key);
|
|
1685
|
+
if (!hit) return null;
|
|
1686
|
+
if (Date.now() - hit.at > INSIGHT_CACHE_TTL_MS) {
|
|
1687
|
+
insightCache.delete(key);
|
|
1688
|
+
return null;
|
|
1689
|
+
}
|
|
1690
|
+
return hit;
|
|
1691
|
+
}
|
|
1692
|
+
function writeInsightCache(sessionId, scope, root, boundTaskId, rows, total, nextOffset) {
|
|
1693
|
+
const key = insightCacheKey(sessionId, scope, root, boundTaskId);
|
|
1694
|
+
insightCache.delete(key);
|
|
1695
|
+
insightCache.set(key, {
|
|
1696
|
+
rows,
|
|
1697
|
+
total,
|
|
1698
|
+
nextOffset,
|
|
1699
|
+
at: Date.now()
|
|
1700
|
+
});
|
|
1701
|
+
while (insightCache.size > INSIGHT_CACHE_MAX) {
|
|
1702
|
+
const oldest = insightCache.keys().next().value;
|
|
1703
|
+
if (oldest === void 0) break;
|
|
1704
|
+
insightCache.delete(oldest);
|
|
1705
|
+
}
|
|
1706
|
+
}
|
|
1530
1707
|
function parseInsightPayloadText(text) {
|
|
1531
1708
|
if (!text) return null;
|
|
1532
1709
|
let jsonBlock = null;
|
|
@@ -1561,7 +1738,7 @@ window.__ModuleLoader__.load({
|
|
|
1561
1738
|
experience: t("mem.kind.experience")
|
|
1562
1739
|
}[kind] ?? kind;
|
|
1563
1740
|
}
|
|
1564
|
-
function MemoryView({ ctx, sessionId, scope, boundTaskId, showHints, t }) {
|
|
1741
|
+
function MemoryView({ ctx, sessionId, scope, root, boundTaskId, showHints, t }) {
|
|
1565
1742
|
const [rows, setRows] = (0, react.useState)([]);
|
|
1566
1743
|
const [total, setTotal] = (0, react.useState)(0);
|
|
1567
1744
|
const [nextOffset, setNextOffset] = (0, react.useState)(null);
|
|
@@ -1648,7 +1825,11 @@ window.__ModuleLoader__.load({
|
|
|
1648
1825
|
setError("unparsable payload");
|
|
1649
1826
|
return;
|
|
1650
1827
|
}
|
|
1651
|
-
setRows((prev) =>
|
|
1828
|
+
setRows((prev) => {
|
|
1829
|
+
const next = append ? appendUnique(prev, parsed.items) : parsed.items;
|
|
1830
|
+
writeInsightCache(sessionId, requestedScope, root, boundTaskId, next, parsed.total, parsed.nextOffset);
|
|
1831
|
+
return next;
|
|
1832
|
+
});
|
|
1652
1833
|
setTotal(parsed.total);
|
|
1653
1834
|
setNextOffset(parsed.nextOffset);
|
|
1654
1835
|
} finally {
|
|
@@ -1659,7 +1840,12 @@ window.__ModuleLoader__.load({
|
|
|
1659
1840
|
setLoadingMore(false);
|
|
1660
1841
|
}
|
|
1661
1842
|
}
|
|
1662
|
-
}, [
|
|
1843
|
+
}, [
|
|
1844
|
+
runLine,
|
|
1845
|
+
sessionId,
|
|
1846
|
+
root,
|
|
1847
|
+
boundTaskId
|
|
1848
|
+
]);
|
|
1663
1849
|
const loadRef = (0, react.useRef)(load);
|
|
1664
1850
|
(0, react.useEffect)(() => {
|
|
1665
1851
|
loadRef.current = load;
|
|
@@ -1670,6 +1856,16 @@ window.__ModuleLoader__.load({
|
|
|
1670
1856
|
setNextOffset(null);
|
|
1671
1857
|
setError(null);
|
|
1672
1858
|
if (!sessionId) return;
|
|
1859
|
+
const cached = readInsightCache(sessionId, scope, root, boundTaskId);
|
|
1860
|
+
if (cached) {
|
|
1861
|
+
setRows(cached.rows);
|
|
1862
|
+
setTotal(cached.total);
|
|
1863
|
+
setNextOffset(cached.nextOffset);
|
|
1864
|
+
setLoading(false);
|
|
1865
|
+
setLoadingMore(false);
|
|
1866
|
+
setShowSpinner(false);
|
|
1867
|
+
return;
|
|
1868
|
+
}
|
|
1673
1869
|
loadRef.current(0, 30, false);
|
|
1674
1870
|
}, [scope, sessionId]);
|
|
1675
1871
|
(0, react.useEffect)(() => {
|
|
@@ -1989,7 +2185,7 @@ window.__ModuleLoader__.load({
|
|
|
1989
2185
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1990
2186
|
className: TaskPanel_module_css_default.memActs,
|
|
1991
2187
|
children: [
|
|
1992
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
2188
|
+
scope !== "task" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
1993
2189
|
variant: "outline",
|
|
1994
2190
|
size: "sm",
|
|
1995
2191
|
disabled: busy,
|
|
@@ -2215,6 +2411,7 @@ window.__ModuleLoader__.load({
|
|
|
2215
2411
|
const degraded = missingServices(ctx);
|
|
2216
2412
|
const sessionId = useSessionId(ctx);
|
|
2217
2413
|
const [syncing, setSyncing] = (0, react.useState)(false);
|
|
2414
|
+
const syncingRef = (0, react.useRef)(false);
|
|
2218
2415
|
const [syncedAt, setSyncedAt] = (0, react.useState)(0);
|
|
2219
2416
|
const [syncError, setSyncError] = (0, react.useState)(null);
|
|
2220
2417
|
const showHints = ui.showHints;
|
|
@@ -2235,115 +2432,84 @@ window.__ModuleLoader__.load({
|
|
|
2235
2432
|
dataActions.setTasks({
|
|
2236
2433
|
tasks: parsed.tasks,
|
|
2237
2434
|
boundTaskId: parsed.boundId,
|
|
2238
|
-
archivedCount: parsed.archived
|
|
2435
|
+
archivedCount: parsed.archived,
|
|
2436
|
+
root: parsed.root
|
|
2239
2437
|
});
|
|
2240
2438
|
setSyncedAt(Date.now());
|
|
2241
2439
|
setSyncError(null);
|
|
2242
2440
|
return true;
|
|
2243
2441
|
};
|
|
2244
2442
|
const runLine = async (line) => {
|
|
2245
|
-
const
|
|
2246
|
-
if (!
|
|
2247
|
-
setSyncError(t("panel.no-channel"));
|
|
2443
|
+
const result = await invokeCommand(ctx, sessionId, line);
|
|
2444
|
+
if (!result.ok) {
|
|
2445
|
+
setSyncError(result.error === "no-channel" ? t("panel.no-channel") : result.error || t("panel.sync-failed"));
|
|
2248
2446
|
return false;
|
|
2249
2447
|
}
|
|
2250
|
-
|
|
2251
|
-
try {
|
|
2252
|
-
response = await commands.execute(sessionId, line, []);
|
|
2253
|
-
} catch (err) {
|
|
2254
|
-
setSyncError(String(err?.message ?? err));
|
|
2255
|
-
return false;
|
|
2256
|
-
}
|
|
2257
|
-
const envelope = response;
|
|
2258
|
-
const execution = envelope && typeof envelope === "object" && "value" in envelope ? envelope.value : envelope;
|
|
2259
|
-
const result = execution?.result ?? execution;
|
|
2260
|
-
if (result?.kind === "error") {
|
|
2261
|
-
setSyncError(result.text ?? "command error");
|
|
2262
|
-
return false;
|
|
2263
|
-
}
|
|
2264
|
-
return applyPayload(result?.text);
|
|
2448
|
+
return applyPayload(result.text);
|
|
2265
2449
|
};
|
|
2266
|
-
const
|
|
2267
|
-
if (
|
|
2450
|
+
const withLock = async (fn) => {
|
|
2451
|
+
if (syncingRef.current) return;
|
|
2452
|
+
syncingRef.current = true;
|
|
2268
2453
|
setSyncing(true);
|
|
2269
2454
|
try {
|
|
2270
|
-
|
|
2271
|
-
await runLine("/tasks");
|
|
2272
|
-
const newBoundId = taskDataStore.getSnapshot().boundTaskId;
|
|
2273
|
-
if (newBoundId && newBoundId !== prevBoundId) await runLine(`/tasks switch ${newBoundId}`);
|
|
2455
|
+
await fn();
|
|
2274
2456
|
} finally {
|
|
2457
|
+
syncingRef.current = false;
|
|
2275
2458
|
setSyncing(false);
|
|
2276
2459
|
}
|
|
2277
2460
|
};
|
|
2461
|
+
/**
|
|
2462
|
+
* 只取数据,**不**顺手 switch。
|
|
2463
|
+
*
|
|
2464
|
+
* 旧实现在这里补一次 `/tasks switch <boundId>`(条件是"新 boundId 与内存里的不同"),
|
|
2465
|
+
* 意图是刷新后让宿主 todo 跟随绑定任务。但那是多余的:宿主的 todo 清单是
|
|
2466
|
+
* `sessionProjections` 里的 `todos` 单元(由 `todo/write` 事件折叠而来),重启/换标签页
|
|
2467
|
+
* 都会从会话日志重建,不需要谁再推一次;而 switch 会 `session.append('todo/write')`,
|
|
2468
|
+
* 于是"打开面板/切一次会话"就写一次会话历史(还顺手刷新任务的 lastActiveAt)。
|
|
2469
|
+
* 真正的绑定动作都有明确入口:`select_task`、`/tasks switch`、面板卡片的切换按钮,
|
|
2470
|
+
* 它们各自会推宿主清单(adoptStepsToSession),不需要巡检式补写。
|
|
2471
|
+
*/
|
|
2472
|
+
const refresh = async () => {
|
|
2473
|
+
await withLock(() => runLine("/tasks"));
|
|
2474
|
+
};
|
|
2278
2475
|
const handleAction = async (verb, taskId) => {
|
|
2279
|
-
|
|
2280
|
-
setSyncing(true);
|
|
2281
|
-
try {
|
|
2282
|
-
await runLine(`/tasks ${verb} ${taskId}`);
|
|
2283
|
-
} finally {
|
|
2284
|
-
setSyncing(false);
|
|
2285
|
-
}
|
|
2476
|
+
await withLock(() => runLine(`/tasks ${verb} ${taskId}`));
|
|
2286
2477
|
};
|
|
2287
2478
|
const handleInsightTask = async (action, id) => {
|
|
2288
|
-
|
|
2289
|
-
setSyncing(true);
|
|
2290
|
-
try {
|
|
2479
|
+
await withLock(async () => {
|
|
2291
2480
|
await runLine(`/tasks insight ${action} task ${id}`);
|
|
2292
|
-
await
|
|
2293
|
-
}
|
|
2294
|
-
setSyncing(false);
|
|
2295
|
-
}
|
|
2296
|
-
};
|
|
2297
|
-
const pushSteps = (taskId, steps) => {
|
|
2298
|
-
runLine(`/tasks todos ${JSON.stringify(steps.map((s) => ({
|
|
2299
|
-
content: s.content,
|
|
2300
|
-
status: s.status
|
|
2301
|
-
})))}`);
|
|
2481
|
+
await runLine("/tasks");
|
|
2482
|
+
});
|
|
2302
2483
|
};
|
|
2303
2484
|
const cycleStatus = (taskId, index) => {
|
|
2304
2485
|
const task = data.tasks.find((tt) => tt.id === taskId);
|
|
2305
2486
|
if (!task) return;
|
|
2306
|
-
const
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
return {
|
|
2310
|
-
...s,
|
|
2311
|
-
status: STATUS_CYCLE[(cur + 1) % STATUS_CYCLE.length]
|
|
2312
|
-
};
|
|
2313
|
-
});
|
|
2314
|
-
pushSteps(taskId, next);
|
|
2487
|
+
const cur = STATUS_CYCLE.indexOf((task.steps || [])[index]?.status);
|
|
2488
|
+
const next = STATUS_CYCLE[(cur + 1) % STATUS_CYCLE.length];
|
|
2489
|
+
withLock(() => runLine(`/tasks step ${taskId} ${index} ${next}`));
|
|
2315
2490
|
};
|
|
2316
2491
|
const commitStepText = (taskId, index, value) => {
|
|
2317
2492
|
const task = data.tasks.find((tt) => tt.id === taskId);
|
|
2318
2493
|
const trimmed = value.trim();
|
|
2319
2494
|
if (!task) return;
|
|
2320
2495
|
if ((task.steps || [])[index]?.content === trimmed || !trimmed) return;
|
|
2321
|
-
|
|
2322
|
-
...s,
|
|
2323
|
-
content: trimmed
|
|
2324
|
-
} : s);
|
|
2325
|
-
pushSteps(taskId, next);
|
|
2496
|
+
withLock(() => runLine(`/tasks step-text ${taskId} ${index} ${JSON.stringify(trimmed)}`));
|
|
2326
2497
|
};
|
|
2327
2498
|
const reorderSteps = (taskId, fromIndex, toIndex) => {
|
|
2328
2499
|
if (fromIndex === toIndex) return;
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
const steps = [...task.steps || []];
|
|
2332
|
-
const [moved] = steps.splice(fromIndex, 1);
|
|
2333
|
-
const targetIndex = toIndex > fromIndex ? toIndex - 1 : toIndex;
|
|
2334
|
-
steps.splice(targetIndex, 0, moved);
|
|
2335
|
-
pushSteps(taskId, steps);
|
|
2500
|
+
if (!data.tasks.find((tt) => tt.id === taskId)) return;
|
|
2501
|
+
withLock(() => runLine(`/tasks step-move ${taskId} ${fromIndex} ${toIndex}`));
|
|
2336
2502
|
};
|
|
2337
2503
|
const commitTitle = (taskId, value) => {
|
|
2338
2504
|
const task = data.tasks.find((tt) => tt.id === taskId);
|
|
2339
2505
|
const trimmed = value.trim();
|
|
2340
2506
|
if (!task) return;
|
|
2341
2507
|
if (task.title === trimmed || !trimmed) return;
|
|
2342
|
-
runLine(`/tasks rename ${taskId} ${JSON.stringify(trimmed)}`);
|
|
2508
|
+
withLock(() => runLine(`/tasks rename ${taskId} ${JSON.stringify(trimmed)}`));
|
|
2343
2509
|
};
|
|
2344
2510
|
const expand = () => {
|
|
2345
2511
|
uiActions.open();
|
|
2346
|
-
if (Date.now() - Math.max(data.lastUpdate, syncedAt) >
|
|
2512
|
+
if (Date.now() - Math.max(data.lastUpdate, syncedAt) > 5e3) refresh();
|
|
2347
2513
|
};
|
|
2348
2514
|
const THEMES = [
|
|
2349
2515
|
"native",
|
|
@@ -2359,6 +2525,8 @@ window.__ModuleLoader__.load({
|
|
|
2359
2525
|
};
|
|
2360
2526
|
const panelRef = (0, react.useRef)(null);
|
|
2361
2527
|
const drag = (0, react.useRef)(null);
|
|
2528
|
+
const [dragPos, setDragPos] = (0, react.useState)(null);
|
|
2529
|
+
const dragPosRef = (0, react.useRef)(null);
|
|
2362
2530
|
const handleDragStart = (e) => {
|
|
2363
2531
|
if (e.target !== e.currentTarget) return;
|
|
2364
2532
|
const rect = panelRef.current?.getBoundingClientRect();
|
|
@@ -2373,7 +2541,11 @@ window.__ModuleLoader__.load({
|
|
|
2373
2541
|
panelRef.current?.offsetHeight;
|
|
2374
2542
|
const x = Math.max(8, Math.min(window.innerWidth - width - 8, ev.clientX - drag.current.dx));
|
|
2375
2543
|
const y = Math.max(8, Math.min(window.innerHeight - 64, ev.clientY - drag.current.dy));
|
|
2376
|
-
|
|
2544
|
+
dragPosRef.current = {
|
|
2545
|
+
x,
|
|
2546
|
+
y
|
|
2547
|
+
};
|
|
2548
|
+
setDragPos({
|
|
2377
2549
|
x,
|
|
2378
2550
|
y
|
|
2379
2551
|
});
|
|
@@ -2382,30 +2554,25 @@ window.__ModuleLoader__.load({
|
|
|
2382
2554
|
drag.current = null;
|
|
2383
2555
|
window.removeEventListener("mousemove", onMove);
|
|
2384
2556
|
window.removeEventListener("mouseup", onUp);
|
|
2557
|
+
if (dragPosRef.current) uiActions.setPanelPosition(dragPosRef.current);
|
|
2558
|
+
dragPosRef.current = null;
|
|
2559
|
+
setDragPos(null);
|
|
2385
2560
|
};
|
|
2386
2561
|
window.addEventListener("mousemove", onMove);
|
|
2387
2562
|
window.addEventListener("mouseup", onUp);
|
|
2388
2563
|
};
|
|
2564
|
+
const refreshRef = (0, react.useRef)(() => {});
|
|
2565
|
+
refreshRef.current = () => {
|
|
2566
|
+
refresh();
|
|
2567
|
+
};
|
|
2389
2568
|
(0, react.useEffect)(() => {
|
|
2390
|
-
if (!sessionId) return;
|
|
2391
|
-
if (
|
|
2392
|
-
|
|
2393
|
-
(0, react.useEffect)(() => {
|
|
2394
|
-
const ctxWithEvents = ctx;
|
|
2395
|
-
const handler = () => {
|
|
2396
|
-
uiActions.open();
|
|
2397
|
-
if (Date.now() - Math.max(data.lastUpdate, syncedAt) > 3e4) refresh();
|
|
2398
|
-
};
|
|
2399
|
-
ctxWithEvents?.events?.on?.("dsh:task-panel:show", handler);
|
|
2400
|
-
return () => {
|
|
2401
|
-
ctxWithEvents?.events?.off?.("dsh:task-panel:show", handler);
|
|
2402
|
-
};
|
|
2569
|
+
if (ui.closed || !sessionId || ui.view !== "task") return;
|
|
2570
|
+
if (Date.now() - Math.max(data.lastUpdate, syncedAt) < 5e3) return;
|
|
2571
|
+
refreshRef.current();
|
|
2403
2572
|
}, [
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
syncedAt,
|
|
2408
|
-
refresh
|
|
2573
|
+
ui.closed,
|
|
2574
|
+
ui.view,
|
|
2575
|
+
sessionId
|
|
2409
2576
|
]);
|
|
2410
2577
|
if (ui.closed) return null;
|
|
2411
2578
|
if (ui.minimized) {
|
|
@@ -2428,8 +2595,8 @@ window.__ModuleLoader__.load({
|
|
|
2428
2595
|
className: TaskPanel_module_css_default.panel,
|
|
2429
2596
|
ref: panelRef,
|
|
2430
2597
|
style: {
|
|
2431
|
-
left: ui.panelPosition.x,
|
|
2432
|
-
top: ui.panelPosition.y
|
|
2598
|
+
left: (dragPos ?? ui.panelPosition).x,
|
|
2599
|
+
top: (dragPos ?? ui.panelPosition).y
|
|
2433
2600
|
},
|
|
2434
2601
|
"data-theme": style === "native" ? void 0 : style,
|
|
2435
2602
|
children: [
|
|
@@ -2545,6 +2712,7 @@ window.__ModuleLoader__.load({
|
|
|
2545
2712
|
ctx,
|
|
2546
2713
|
sessionId,
|
|
2547
2714
|
scope: view,
|
|
2715
|
+
root: data.root ?? null,
|
|
2548
2716
|
boundTaskId: data.boundTaskId,
|
|
2549
2717
|
showHints,
|
|
2550
2718
|
t
|
|
@@ -2596,19 +2764,24 @@ window.__ModuleLoader__.load({
|
|
|
2596
2764
|
});
|
|
2597
2765
|
}
|
|
2598
2766
|
//#endregion
|
|
2599
|
-
//#region \0dsh-css:src
|
|
2600
|
-
const css = ".
|
|
2767
|
+
//#region \0dsh-css:src/client/TaskCommandNode.module.css.mjs
|
|
2768
|
+
const css = ".TPe-xa_row{max-width:100%;color:var(--dsw-alias-label-tertiary);white-space:nowrap;text-overflow:ellipsis;align-items:center;gap:6px;padding:2px 0;font-size:12px;line-height:20px;display:inline-flex;overflow:hidden}.TPe-xa_row[data-variant=ok]{color:var(--dsw-alias-label-secondary)}.TPe-xa_row[data-variant=error]{color:var(--dsw-alias-state-warn-label,#b7791f)}.TPe-xa_row[data-variant=running]{color:var(--dsw-alias-label-dimmed)}.TPe-xa_icon{color:var(--dsw-alias-label-tertiary);flex:none}";
|
|
2601
2769
|
const tagId = "@yolk_vat-y/dsh-project-memory/TaskCommandNode.module.css";
|
|
2602
|
-
if (typeof document !== "undefined"
|
|
2603
|
-
const
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2770
|
+
if (typeof document !== "undefined") {
|
|
2771
|
+
const selector = "style[data-plugin-css=" + JSON.stringify(tagId) + "]";
|
|
2772
|
+
const existing = document.querySelector(selector);
|
|
2773
|
+
if (existing) existing.textContent = css;
|
|
2774
|
+
else {
|
|
2775
|
+
const tag = document.createElement("style");
|
|
2776
|
+
tag.dataset.plugin = "@yolk_vat-y/dsh-project-memory";
|
|
2777
|
+
tag.dataset.pluginCss = tagId;
|
|
2778
|
+
tag.textContent = css;
|
|
2779
|
+
document.head.appendChild(tag);
|
|
2780
|
+
}
|
|
2608
2781
|
}
|
|
2609
2782
|
var TaskCommandNode_module_css_default = {
|
|
2610
|
-
"icon": "
|
|
2611
|
-
"row": "
|
|
2783
|
+
"icon": "TPe-xa_icon",
|
|
2784
|
+
"row": "TPe-xa_row"
|
|
2612
2785
|
};
|
|
2613
2786
|
//#endregion
|
|
2614
2787
|
//#region src/client/TaskCommandNode.tsx
|
|
@@ -2620,18 +2793,24 @@ window.__ModuleLoader__.load({
|
|
|
2620
2793
|
function TaskCommandNode({ node }) {
|
|
2621
2794
|
const name = node?.name ?? "task";
|
|
2622
2795
|
const outcome = node?.outcome ?? null;
|
|
2623
|
-
const
|
|
2624
|
-
const
|
|
2796
|
+
const tokens = (typeof node?.args === "string" ? node.args : "").trim().split(/\s+/).filter(Boolean);
|
|
2797
|
+
const verb = tokens[0] ?? "";
|
|
2798
|
+
const sub = tokens[1] ?? "";
|
|
2799
|
+
const isTasks = name === "tasks";
|
|
2800
|
+
const isInsight = name === "insight" || isTasks && verb === "insight";
|
|
2801
|
+
const insightVerb = name === "insight" ? verb : sub;
|
|
2802
|
+
const isList = isInsight ? name === "insight" ? !verb || verb === "list" : sub === "list" : isTasks && !verb;
|
|
2625
2803
|
const text = outcome?.text ?? "";
|
|
2626
|
-
const parsedTasks =
|
|
2627
|
-
const parsedInsights =
|
|
2804
|
+
const parsedTasks = isInsight ? null : parseTaskPayloadText(text);
|
|
2805
|
+
const parsedInsights = isInsight ? parseInsightPayloadText(text) : null;
|
|
2628
2806
|
const live = (0, react.useRef)(outcome === null);
|
|
2629
2807
|
(0, react.useEffect)(() => {
|
|
2630
2808
|
if (!parsedTasks || !live.current) return;
|
|
2631
2809
|
taskDataStore.actions.setTasks({
|
|
2632
2810
|
tasks: parsedTasks.tasks,
|
|
2633
2811
|
boundTaskId: parsedTasks.boundId,
|
|
2634
|
-
archivedCount: parsedTasks.archived
|
|
2812
|
+
archivedCount: parsedTasks.archived,
|
|
2813
|
+
root: parsedTasks.root
|
|
2635
2814
|
});
|
|
2636
2815
|
if (isList) taskUIStore.actions.open();
|
|
2637
2816
|
}, [text]);
|
|
@@ -2657,29 +2836,15 @@ window.__ModuleLoader__.load({
|
|
|
2657
2836
|
]
|
|
2658
2837
|
});
|
|
2659
2838
|
}
|
|
2660
|
-
if (
|
|
2661
|
-
|
|
2662
|
-
const scope = parsedInsights.scope;
|
|
2663
|
-
const count = parsedInsights.count ?? parsedInsights.items.length;
|
|
2664
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2665
|
-
className: TaskCommandNode_module_css_default.row,
|
|
2666
|
-
"data-variant": "ok",
|
|
2667
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconFolderOpenOutline16, { className: TaskCommandNode_module_css_default.icon }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [
|
|
2668
|
-
"记忆 ",
|
|
2669
|
-
scope,
|
|
2670
|
-
" · ",
|
|
2671
|
-
count,
|
|
2672
|
-
" 条 · 已同步到记忆视图"
|
|
2673
|
-
] })]
|
|
2674
|
-
});
|
|
2675
|
-
}
|
|
2839
|
+
if (isList && (isInsight ? parsedInsights : parsedTasks)) return null;
|
|
2840
|
+
if (isInsight) {
|
|
2676
2841
|
const note = String(text ?? "").split("\n")[0].slice(0, 120);
|
|
2677
2842
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2678
2843
|
className: TaskCommandNode_module_css_default.row,
|
|
2679
2844
|
"data-variant": "ok",
|
|
2680
2845
|
children: [
|
|
2681
2846
|
"/insight ",
|
|
2682
|
-
|
|
2847
|
+
insightVerb,
|
|
2683
2848
|
" ",
|
|
2684
2849
|
note || "已完成"
|
|
2685
2850
|
]
|
|
@@ -2748,11 +2913,14 @@ window.__ModuleLoader__.load({
|
|
|
2748
2913
|
return null;
|
|
2749
2914
|
}
|
|
2750
2915
|
/** 把 `show_task_panel` 的视图注册进宿主的 `tool.call.toolview` 槽。 */
|
|
2751
|
-
function registerShowTaskPanelView(slots) {
|
|
2752
|
-
slots.inject("tool.call.toolview", () =>
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2916
|
+
function registerShowTaskPanelView(slots, keep) {
|
|
2917
|
+
slots.inject("tool.call.toolview", () => {
|
|
2918
|
+
const off = slots.register({
|
|
2919
|
+
name: "tool.call.toolview",
|
|
2920
|
+
key: "show_task_panel"
|
|
2921
|
+
}, ShowTaskPanelNode);
|
|
2922
|
+
if (typeof keep === "function") keep(off);
|
|
2923
|
+
});
|
|
2756
2924
|
}
|
|
2757
2925
|
//#endregion
|
|
2758
2926
|
//#region src/client/slash.ts
|
|
@@ -2958,33 +3126,49 @@ window.__ModuleLoader__.load({
|
|
|
2958
3126
|
* @param ctx - client 根上下文
|
|
2959
3127
|
*/
|
|
2960
3128
|
function registerTaskPanel(ctx) {
|
|
2961
|
-
const mount = (slots) => {
|
|
3129
|
+
const mount = (slots, effect) => {
|
|
2962
3130
|
if (!slots || typeof slots.inject !== "function") {
|
|
2963
3131
|
console.warn(`[${NS}] host has no slots service — task panel disabled`);
|
|
2964
3132
|
return;
|
|
2965
3133
|
}
|
|
3134
|
+
const keep = (off) => {
|
|
3135
|
+
if (typeof off !== "function") return;
|
|
3136
|
+
const dispose = () => {
|
|
3137
|
+
try {
|
|
3138
|
+
off();
|
|
3139
|
+
} catch {}
|
|
3140
|
+
};
|
|
3141
|
+
if (typeof effect === "function") effect(() => dispose);
|
|
3142
|
+
};
|
|
3143
|
+
const register = (spec, component) => {
|
|
3144
|
+
try {
|
|
3145
|
+
keep(slots.register(spec, component));
|
|
3146
|
+
} catch (err) {
|
|
3147
|
+
console.warn(`[${NS}] slot registration failed:`, err);
|
|
3148
|
+
}
|
|
3149
|
+
};
|
|
2966
3150
|
try {
|
|
2967
|
-
slots.inject("shell.overlay", () =>
|
|
3151
|
+
slots.inject("shell.overlay", () => register({
|
|
2968
3152
|
name: "shell.overlay",
|
|
2969
3153
|
id: "dsh-project-memory-task-panel",
|
|
2970
3154
|
order: 100
|
|
2971
3155
|
}, () => (0, react.createElement)(TaskPanelEntry, { ctx })));
|
|
2972
|
-
for (const key of ["tasks"]) slots.inject("conversation.chat.commandview", () =>
|
|
3156
|
+
for (const key of ["tasks"]) slots.inject("conversation.chat.commandview", () => register({
|
|
2973
3157
|
name: "conversation.chat.commandview",
|
|
2974
3158
|
key
|
|
2975
3159
|
}, TaskCommandNode));
|
|
2976
|
-
registerShowTaskPanelView(slots);
|
|
3160
|
+
registerShowTaskPanelView(slots, keep);
|
|
2977
3161
|
} catch (err) {
|
|
2978
3162
|
console.warn(`[${NS}] task panel registration failed:`, err);
|
|
2979
3163
|
}
|
|
2980
3164
|
};
|
|
2981
3165
|
if (typeof ctx?.inject === "function") try {
|
|
2982
|
-
ctx.inject(["slots"], (scope) => mount(scope?.slots ?? service(ctx, "slots")));
|
|
3166
|
+
ctx.inject(["slots"], (scope) => mount(scope?.slots ?? service(ctx, "slots"), scope?.effect));
|
|
2983
3167
|
return;
|
|
2984
3168
|
} catch (err) {
|
|
2985
3169
|
console.warn(`[${NS}] slots injection failed:`, err);
|
|
2986
3170
|
}
|
|
2987
|
-
mount(service(ctx, "slots"));
|
|
3171
|
+
mount(service(ctx, "slots"), typeof ctx?.effect === "function" ? ctx.effect.bind(ctx) : void 0);
|
|
2988
3172
|
}
|
|
2989
3173
|
/**
|
|
2990
3174
|
* 过了宽限期仍然读不到必需服务时,打**一条**点名缺失项的告警。
|