@yolk_vat-y/dsh-project-memory 0.6.12 → 0.7.1
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 +68 -20
- package/README.md +14 -105
- package/README.zh-CN.md +14 -105
- package/client/client.js +311 -163
- package/client/client.js.map +1 -1
- package/package.json +8 -8
- package/scripts/file-peak.mjs +1 -1
- package/scripts/tool-schema-size.mjs +1 -1
- package/skills/project-memory/SKILL.md +1 -1
- package/skills/project-memory/scripts/pm-digest.mjs +20 -6
- package/src/audit.js +10 -2
- package/src/auto-inject.js +124 -38
- package/src/client/MemoryView.tsx +121 -51
- package/src/client/TaskCommandNode.tsx +6 -4
- package/src/client/TaskComponents.tsx +14 -26
- package/src/client/TaskPanel.tsx +44 -23
- package/src/client/client.ts +4 -7
- package/src/client/i18n.ts +29 -0
- package/src/client/kind-label.js +38 -0
- package/src/client/paging.js +1 -14
- package/src/client/settings-card.tsx +9 -0
- package/src/client/slash.ts +4 -15
- package/src/client/task-data-store.ts +57 -7
- package/src/client/task-hooks.ts +0 -2
- package/src/client/task-scope.js +16 -1
- package/src/client/task-ui-store.ts +1 -1
- package/src/commands/insight-actions.js +85 -60
- package/src/commands/task-actions.js +7 -5
- package/src/commands/tasks.js +34 -10
- package/src/doc-index.js +3 -1
- package/src/enhancer.js +0 -12
- package/src/index-failures.js +1 -1
- package/src/index-pipeline.js +11 -2
- package/src/index.js +60 -14
- package/src/inject-visible.js +282 -0
- package/src/insight-store.js +129 -32
- package/src/lazy.js +29 -23
- package/src/llm-route.js +1 -1
- package/src/ops.js +18 -5
- package/src/parsers/pdfjs-parser.js +3 -33
- package/src/project-memory-service.js +195 -0
- package/src/project-profile.js +0 -4
- package/src/setup/taskbridge.js +38 -6
- package/src/store.js +638 -135
- package/src/symbols.js +2 -4
- package/src/tools/forget.js +3 -6
- package/src/tools/index-doc.js +61 -18
- package/src/tools/index-repo.js +16 -12
- package/src/tools/lesson-tools.js +5 -5
- package/src/tools/output.js +28 -0
- package/src/tools/query-memory.js +6 -9
- package/src/tools/remember.js +3 -6
- package/src/tools/stats.js +3 -6
- package/src/tools/task-tools.js +15 -8
- package/src/tools/watch-repo.js +15 -12
- package/src/util/flush.js +1 -1
- package/src/util/fs.js +135 -20
- package/src/util/message-source.js +20 -0
- package/src/util/relative-time.js +24 -0
- package/src/util/search.js +0 -1
- package/src/util/task-view.js +8 -15
- package/src/vector-index.js +2 -2
- package/src/watch.js +25 -8
- package/client/client.d.ts +0 -27
- package/client/client.d.ts.map +0 -1
- package/client/style.css +0 -395
package/client/client.js
CHANGED
|
@@ -4,7 +4,7 @@ window.__ModuleLoader__.load({
|
|
|
4
4
|
var module = { exports: {} };
|
|
5
5
|
var exports = module.exports;
|
|
6
6
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
7
|
-
|
|
7
|
+
// \0rolldown/runtime.js
|
|
8
8
|
var __create = Object.create;
|
|
9
9
|
var __defProp = Object.defineProperty;
|
|
10
10
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -25,12 +25,11 @@ window.__ModuleLoader__.load({
|
|
|
25
25
|
value: mod,
|
|
26
26
|
enumerable: true
|
|
27
27
|
}) : target, mod));
|
|
28
|
-
//#endregion
|
|
29
28
|
let react = require("react");
|
|
30
29
|
let _deepseek_ai_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
31
30
|
_deepseek_ai_dsh_client_ui_primitives = __toESM(_deepseek_ai_dsh_client_ui_primitives, 1);
|
|
32
31
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
33
|
-
|
|
32
|
+
// src/client/icons.ts
|
|
34
33
|
/**
|
|
35
34
|
* 宿主图标兼容层(dsh 0.1.5 ↔ 0.1.7+)。
|
|
36
35
|
*
|
|
@@ -81,8 +80,7 @@ window.__ModuleLoader__.load({
|
|
|
81
80
|
const IconChecklistOutline16 = icon("IconChecklistOutline14", "IconChecklistOutlineRegular", 14);
|
|
82
81
|
const IconLightOutline16 = icon("IconLightOutline16", "IconLightOutlineRegular", 16);
|
|
83
82
|
const IconGlobeOutline16 = icon("IconGlobeOutline14", "IconGlobeOutlineRegular", 14);
|
|
84
|
-
|
|
85
|
-
//#region src/client/locales.ts
|
|
83
|
+
// src/client/locales.ts
|
|
86
84
|
/**
|
|
87
85
|
* Locale dictionaries for Task Panel
|
|
88
86
|
*/
|
|
@@ -293,8 +291,7 @@ window.__ModuleLoader__.load({
|
|
|
293
291
|
return text;
|
|
294
292
|
};
|
|
295
293
|
}
|
|
296
|
-
|
|
297
|
-
//#region src/client/services.ts
|
|
294
|
+
// src/client/services.ts
|
|
298
295
|
/**
|
|
299
296
|
* Client 服务软探测 —— 顶层 `inject` 是「整半边静默消失」的开关,这里把它降级成运行时探测。
|
|
300
297
|
*
|
|
@@ -408,8 +405,31 @@ window.__ModuleLoader__.load({
|
|
|
408
405
|
if (handle !== null && typeof handle === "object" && typeof handle.unref === "function") handle.unref();
|
|
409
406
|
} catch {}
|
|
410
407
|
}
|
|
411
|
-
|
|
412
|
-
|
|
408
|
+
// src/client/i18n.ts
|
|
409
|
+
/**
|
|
410
|
+
* client 半边唯一的「按宿主语言取翻译函数」入口。
|
|
411
|
+
*
|
|
412
|
+
* 为什么单独一个模块:同一段「软读 locale 服务 → 中文用 zh、其余(含服务缺失)用 en →
|
|
413
|
+
* createTranslate」原先在 TaskPanel.tsx(getT)与 slash.ts(translator)各写一份。
|
|
414
|
+
* 语言判据是产品语义而不是某次渲染的局部细节:两份副本各自演化时,面板会中文、
|
|
415
|
+
* `/` 菜单却英文,而且看起来都"正常"。收敛到这里,只保留一个事实。
|
|
416
|
+
*
|
|
417
|
+
* 语义(刻意定死):
|
|
418
|
+
* - 只认 `active === 'zh'`;其它值(en / 未知 / 缺失 locale 服务)一律英文——
|
|
419
|
+
* 与旧实现一致,也不把"未知语言"猜成中文;
|
|
420
|
+
* - `service()` 是软探测,宿主没有 locale 服务时这里不抛错,面板照常渲染英文。
|
|
421
|
+
* @module dsh-project-memory/client/i18n
|
|
422
|
+
*/
|
|
423
|
+
/**
|
|
424
|
+
* 当前宿主语言对应的翻译函数。
|
|
425
|
+
* @param ctx - client 上下文(缺失/贫服务宿主也能调用)。
|
|
426
|
+
* @returns 翻译函数;语言服务不可读时退回英文。
|
|
427
|
+
*/
|
|
428
|
+
function translatorFor(ctx) {
|
|
429
|
+
const active = service(ctx, "locale")?.getSnapshot?.()?.active;
|
|
430
|
+
return createTranslate(active === "zh" ? zh : en);
|
|
431
|
+
}
|
|
432
|
+
// src/client/commands.ts
|
|
413
433
|
/**
|
|
414
434
|
* 客户端命令调用层:所有 `remote.commands.execute` 只走这里。
|
|
415
435
|
*
|
|
@@ -477,8 +497,7 @@ window.__ModuleLoader__.load({
|
|
|
477
497
|
if (timer !== null) clearTimeout(timer);
|
|
478
498
|
}
|
|
479
499
|
}
|
|
480
|
-
|
|
481
|
-
//#region src/client/task-scope.js
|
|
500
|
+
// src/client/task-scope.js
|
|
482
501
|
/**
|
|
483
502
|
* 跨标签页任务广播的**项目作用域**判定(纯函数,无 React / 无 BroadcastChannel 依赖)。
|
|
484
503
|
*
|
|
@@ -500,7 +519,20 @@ window.__ModuleLoader__.load({
|
|
|
500
519
|
function broadcastAppliesTo(localRoot, incomingRoot) {
|
|
501
520
|
if (typeof incomingRoot !== "string" || incomingRoot === "") return false;
|
|
502
521
|
if (typeof localRoot !== "string" || localRoot === "") return false;
|
|
503
|
-
return localRoot === incomingRoot;
|
|
522
|
+
return rootKey(localRoot) === rootKey(incomingRoot);
|
|
523
|
+
}
|
|
524
|
+
/** Windows/macOS 的文件系统大小写不敏感;Linux 上不能把两个只差大小写的根当成一个。 */
|
|
525
|
+
function caseInsensitiveFs() {
|
|
526
|
+
const platform = typeof navigator !== "undefined" ? String(navigator.platform || "") : "";
|
|
527
|
+
if (/win/i.test(platform) || /mac/i.test(platform)) return true;
|
|
528
|
+
const ua = typeof navigator !== "undefined" ? String(navigator.userAgent || "") : "";
|
|
529
|
+
return /Windows|Macintosh/i.test(ua);
|
|
530
|
+
}
|
|
531
|
+
/** 根的规范键:统一分隔符、去掉末尾分隔符;大小写不敏感平台再折叠大小写。 */
|
|
532
|
+
function rootKey(root) {
|
|
533
|
+
let key = String(root).replace(/\\/g, "/");
|
|
534
|
+
if (key.length > 1) key = key.replace(/\/+$/, "");
|
|
535
|
+
return caseInsensitiveFs() ? key.toLowerCase() : key;
|
|
504
536
|
}
|
|
505
537
|
/**
|
|
506
538
|
* 从 `/tasks` 载荷里取项目根(旧宿主没有该键)。
|
|
@@ -510,8 +542,7 @@ window.__ModuleLoader__.load({
|
|
|
510
542
|
function payloadRoot(value) {
|
|
511
543
|
return typeof value === "string" && value !== "" ? value : null;
|
|
512
544
|
}
|
|
513
|
-
|
|
514
|
-
//#region src/client/task-data-store.ts
|
|
545
|
+
// src/client/task-data-store.ts
|
|
515
546
|
/**
|
|
516
547
|
* Task Data Store — 仅管服务端同步的数据(tasks、boundTaskId、archivedCount)
|
|
517
548
|
* - 单向数据流:命令执行结果 → setTasks → 广播给其他标签页
|
|
@@ -540,12 +571,14 @@ window.__ModuleLoader__.load({
|
|
|
540
571
|
return null;
|
|
541
572
|
}
|
|
542
573
|
}
|
|
543
|
-
const SYNC_CHANNEL = typeof window !== "undefined" ? new BroadcastChannel("dsh-pm-tasks-data") : null;
|
|
574
|
+
const SYNC_CHANNEL = typeof window !== "undefined" && typeof BroadcastChannel !== "undefined" ? new BroadcastChannel("dsh-pm-tasks-data") : null;
|
|
544
575
|
let dataState = {
|
|
545
576
|
tasks: [],
|
|
546
577
|
boundTaskId: null,
|
|
547
578
|
archivedCount: 0,
|
|
548
579
|
root: null,
|
|
580
|
+
sessionId: null,
|
|
581
|
+
lastSyncAt: 0,
|
|
549
582
|
lastUpdate: 0
|
|
550
583
|
};
|
|
551
584
|
const dataListeners = /* @__PURE__ */ new Set();
|
|
@@ -556,30 +589,38 @@ window.__ModuleLoader__.load({
|
|
|
556
589
|
boundTaskId: patch?.boundTaskId ?? null,
|
|
557
590
|
archivedCount: typeof patch?.archivedCount === "number" ? patch.archivedCount : 0,
|
|
558
591
|
root: payloadRoot(patch?.root),
|
|
592
|
+
sessionId: typeof patch?.sessionId === "string" && patch.sessionId ? patch.sessionId : null,
|
|
593
|
+
lastSyncAt: typeof patch?.lastSyncAt === "number" ? patch.lastSyncAt : 0,
|
|
559
594
|
lastUpdate: typeof patch?.lastUpdate === "number" ? patch.lastUpdate : 0
|
|
560
595
|
};
|
|
561
596
|
for (const listener of dataListeners) listener();
|
|
562
597
|
}
|
|
563
|
-
function broadcastDataUpdate(tasks, archivedCount, root) {
|
|
598
|
+
function broadcastDataUpdate(tasks, archivedCount, root, boundTaskId, sessionId, sentAt) {
|
|
564
599
|
if (!SYNC_CHANNEL) return;
|
|
565
600
|
SYNC_CHANNEL.postMessage({
|
|
566
601
|
type: "PROJECT_TASKS_UPDATED",
|
|
567
602
|
payload: {
|
|
568
603
|
tasks: Array.isArray(tasks) ? tasks : [],
|
|
569
604
|
archivedCount,
|
|
570
|
-
root
|
|
605
|
+
root,
|
|
606
|
+
boundTaskId,
|
|
607
|
+
sessionId,
|
|
608
|
+
sentAt
|
|
571
609
|
}
|
|
572
610
|
});
|
|
573
611
|
}
|
|
574
612
|
if (SYNC_CHANNEL) SYNC_CHANNEL.onmessage = (event) => {
|
|
575
613
|
const msg = event.data;
|
|
576
614
|
if (msg?.type !== "PROJECT_TASKS_UPDATED" || !msg.payload) return;
|
|
577
|
-
const { tasks, archivedCount, root } = msg.payload;
|
|
615
|
+
const { tasks, archivedCount, root, boundTaskId, sessionId, sentAt } = msg.payload;
|
|
578
616
|
if (!broadcastAppliesTo(dataState.root, root)) return;
|
|
617
|
+
if (typeof sentAt === "number" && sentAt < dataState.lastSyncAt) return;
|
|
579
618
|
setDataState((prev) => ({
|
|
580
619
|
...prev,
|
|
581
620
|
tasks: Array.isArray(tasks) ? tasks : [],
|
|
582
621
|
archivedCount: typeof archivedCount === "number" ? archivedCount : prev.archivedCount,
|
|
622
|
+
...sessionId && prev.sessionId && sessionId === prev.sessionId ? { boundTaskId: typeof boundTaskId === "string" ? boundTaskId : null } : {},
|
|
623
|
+
lastSyncAt: typeof sentAt === "number" ? sentAt : prev.lastSyncAt,
|
|
583
624
|
lastUpdate: Date.now()
|
|
584
625
|
}));
|
|
585
626
|
};
|
|
@@ -598,14 +639,18 @@ window.__ModuleLoader__.load({
|
|
|
598
639
|
const nextTasks = payload.tasks || [];
|
|
599
640
|
const nextArchived = payload.archivedCount ?? 0;
|
|
600
641
|
const nextRoot = payloadRoot(payload.root);
|
|
642
|
+
const nextSession = payload.sessionId === void 0 ? dataState.sessionId : typeof payload.sessionId === "string" && payload.sessionId ? payload.sessionId : null;
|
|
643
|
+
const sentAt = Date.now();
|
|
601
644
|
setDataState({
|
|
602
645
|
tasks: nextTasks,
|
|
603
646
|
boundTaskId: payload.boundTaskId ?? null,
|
|
604
647
|
archivedCount: nextArchived,
|
|
605
648
|
root: nextRoot,
|
|
606
|
-
|
|
649
|
+
sessionId: nextSession,
|
|
650
|
+
lastSyncAt: sentAt,
|
|
651
|
+
lastUpdate: sentAt
|
|
607
652
|
});
|
|
608
|
-
broadcastDataUpdate(nextTasks, nextArchived, nextRoot);
|
|
653
|
+
broadcastDataUpdate(nextTasks, nextArchived, nextRoot, payload.boundTaskId ?? null, nextSession, sentAt);
|
|
609
654
|
},
|
|
610
655
|
reset() {
|
|
611
656
|
setDataState({
|
|
@@ -613,6 +658,8 @@ window.__ModuleLoader__.load({
|
|
|
613
658
|
boundTaskId: null,
|
|
614
659
|
archivedCount: 0,
|
|
615
660
|
root: null,
|
|
661
|
+
sessionId: null,
|
|
662
|
+
lastSyncAt: 0,
|
|
616
663
|
lastUpdate: 0
|
|
617
664
|
});
|
|
618
665
|
}
|
|
@@ -624,10 +671,9 @@ window.__ModuleLoader__.load({
|
|
|
624
671
|
function useTaskDataActions() {
|
|
625
672
|
return taskDataStore.actions;
|
|
626
673
|
}
|
|
627
|
-
|
|
628
|
-
//#region src/client/task-ui-store.ts
|
|
674
|
+
// src/client/task-ui-store.ts
|
|
629
675
|
/**
|
|
630
|
-
* Task UI Store — 仅管本地 UI 状态(closed、minimized、position、
|
|
676
|
+
* Task UI Store — 仅管本地 UI 状态(closed、minimized、position、expandedTaskIds、theme、showHints)
|
|
631
677
|
* - 持久化到 localStorage(key: dsh-pm-task-panel-ui)
|
|
632
678
|
* - 不跨标签页同步(每个标签页独立)
|
|
633
679
|
* - 启动/刷新强制 closed: true,面板默认不显示
|
|
@@ -824,8 +870,44 @@ window.__ModuleLoader__.load({
|
|
|
824
870
|
function useTaskUIActions() {
|
|
825
871
|
return taskUIStore.actions;
|
|
826
872
|
}
|
|
827
|
-
|
|
828
|
-
|
|
873
|
+
// src/client/kind-label.js
|
|
874
|
+
/**
|
|
875
|
+
* 记忆 kind 的展示名(纯函数、零依赖,面板卡片与记忆视图共用)。
|
|
876
|
+
*
|
|
877
|
+
* 为什么单独一个模块:同一份「kind → 词典 key」映射原先在两处各抄一份
|
|
878
|
+
* (TaskComponents.tsx 的 insightKindLabel、MemoryView.tsx 的 kindText,逐字相同)。
|
|
879
|
+
* 新增 kind 时漏改一处,两个界面就会对同一条记忆显示不同的标签;而词典 key 本身
|
|
880
|
+
* 是 locales.ts 的一等公民(`mem.kind.*` 中英两份),映射不该散落在组件里。
|
|
881
|
+
*
|
|
882
|
+
* 语义(刻意定死,边缘输入也用测试钉住):
|
|
883
|
+
* - 四个合法 kind 一律走 `t(key)`,语言切换由词典自己负责;
|
|
884
|
+
* - 其余值**原样返回**(字符串化),绝不回退到某个默认 kind —— 脏数据要让调用方看见;
|
|
885
|
+
* - 用 `hasOwn` 而不是 `map[kind] ?? kind` 查表:`kind: '__proto__'` / `'constructor'`
|
|
886
|
+
* 在对象字面量上会命中原型成员(返回函数/对象),React 渲染对象会直接抛
|
|
887
|
+
* "Objects are not valid as a React child"。非 kind 的键必须当成非法值处理。
|
|
888
|
+
* @module dsh-project-memory/client/kind-label
|
|
889
|
+
*/
|
|
890
|
+
/** kind → 词典 key(唯一一份;与 locales.ts 的 `mem.kind.*` 一一对应)。 */
|
|
891
|
+
const KIND_LABEL_KEYS = Object.freeze({
|
|
892
|
+
lesson: "mem.kind.lesson",
|
|
893
|
+
decision: "mem.kind.decision",
|
|
894
|
+
procedure: "mem.kind.procedure",
|
|
895
|
+
experience: "mem.kind.experience"
|
|
896
|
+
});
|
|
897
|
+
/**
|
|
898
|
+
* 一条记忆的 kind 展示名。
|
|
899
|
+
* @param {unknown} kind - 记忆条目的 kind(可能是缺失/脏值)。
|
|
900
|
+
* @param {any} t - 翻译函数。这里刻意不收窄成 `(key: string) => string`:组件的 t 是
|
|
901
|
+
* `ReturnType<typeof createTranslate>`(key 为词典字面量并集),收窄会让严格模式下的
|
|
902
|
+
* 函数参数逆变检查拒绝调用;key 本身由本模块掌管,调用方只需要"能翻译一个字符串 key"。
|
|
903
|
+
* @returns {string} 本地化后的标签;非法 kind 原样字符串化。
|
|
904
|
+
*/
|
|
905
|
+
function insightKindLabel(kind, t) {
|
|
906
|
+
const key = typeof kind === "string" && Object.hasOwn(KIND_LABEL_KEYS, kind) ? KIND_LABEL_KEYS[kind] : null;
|
|
907
|
+
if (key === null) return String(kind ?? "");
|
|
908
|
+
return t(key);
|
|
909
|
+
}
|
|
910
|
+
// src/client/task-hooks.ts
|
|
829
911
|
/**
|
|
830
912
|
* Task Panel Hooks — 步骤拖拽交互逻辑(useTaskDrag)。
|
|
831
913
|
* 只依赖 react + task-data-store 类型,不碰数据/UI store。
|
|
@@ -841,7 +923,7 @@ window.__ModuleLoader__.load({
|
|
|
841
923
|
* (插入自身前后)/按钮输入等控件上 → 取消;
|
|
842
924
|
* - 350ms 内原地松手 = 普通点击,不产生幽灵;Esc → 取消。
|
|
843
925
|
*/
|
|
844
|
-
function useTaskDrag(taskId,
|
|
926
|
+
function useTaskDrag(taskId, isBound, onReorder) {
|
|
845
927
|
const [dragState, setDragState] = (0, react.useState)(null);
|
|
846
928
|
const [dropTargetIndex, setDropTargetIndex] = (0, react.useState)(null);
|
|
847
929
|
const dragRef = (0, react.useRef)(dragState);
|
|
@@ -982,8 +1064,32 @@ window.__ModuleLoader__.load({
|
|
|
982
1064
|
cancelDrag
|
|
983
1065
|
};
|
|
984
1066
|
}
|
|
985
|
-
|
|
986
|
-
|
|
1067
|
+
// src/util/relative-time.js
|
|
1068
|
+
/**
|
|
1069
|
+
* 相对时间(中文)的唯一实现:面板、`list_tasks`、`/tasks` 共用。
|
|
1070
|
+
*
|
|
1071
|
+
* 两处调用方对"时间坏掉"的期待不同,所以 fallback 是参数而不是第二份实现:
|
|
1072
|
+
* - 服务端把条目交给模型,省略时间会像"没有时间信息",默认 `'未知'`;
|
|
1073
|
+
* - 面板是给人看的,时间坏了就留空,不显示脏字。
|
|
1074
|
+
*
|
|
1075
|
+
* 客户端旧副本用 `new Date(iso).getTime()` 直接算 diff:非法 ISO 得到 NaN,一路比较都不成立,
|
|
1076
|
+
* 最后渲染成 "NaN天前"。收敛到这一份后,非法/缺失时间一律走 fallback(而不是各写一套判据)。
|
|
1077
|
+
* @param {string} [iso] ISO 时间戳
|
|
1078
|
+
* @param {string} [fallback] 解析失败时的文案
|
|
1079
|
+
* @returns {string}
|
|
1080
|
+
*/
|
|
1081
|
+
function timeAgo(iso, fallback = "未知") {
|
|
1082
|
+
const t = Date.parse(iso ?? "");
|
|
1083
|
+
if (!Number.isFinite(t)) return fallback;
|
|
1084
|
+
const diff = Date.now() - t;
|
|
1085
|
+
const m = Math.floor(diff / 6e4);
|
|
1086
|
+
if (m < 1) return "刚刚";
|
|
1087
|
+
if (m < 60) return `${m}分钟前`;
|
|
1088
|
+
const h = Math.floor(m / 60);
|
|
1089
|
+
if (h < 24) return `${h}小时前`;
|
|
1090
|
+
return `${Math.floor(h / 24)}天前`;
|
|
1091
|
+
}
|
|
1092
|
+
// \0dsh-css:src/client/TaskPanel.module.css.mjs
|
|
987
1093
|
const css$2 = ".i54Wjq_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 i54Wjq_panelIn;display:flex;position:fixed;overflow:hidden;box-shadow:0 12px 32px #00000029,0 2px 8px #00000014}@keyframes i54Wjq_panelIn{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}.i54Wjq_dragHandle{cursor:grab;z-index:1;justify-content:center;align-items:center;height:12px;display:flex;position:absolute;top:0;left:0;right:0}.i54Wjq_dragHandle:active{cursor:grabbing}.i54Wjq_handleGrip{background:var(--dsw-alias-separator-primary,#7f7f7f59);opacity:.8;border-radius:2px;width:32px;height:3px}.i54Wjq_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}.i54Wjq_headerLeft{align-items:center;gap:6px;min-width:0;display:flex}.i54Wjq_headerIcon{color:var(--dsw-alias-label-secondary);flex:none}.i54Wjq_headerTitle{color:var(--dsw-alias-label-primary);white-space:nowrap;margin:0;font-size:13px;font-weight:600;line-height:20px}.i54Wjq_headerRight{align-items:center;gap:2px;margin-left:auto;display:flex}.i54Wjq_hintsOff{opacity:.45}.i54Wjq_hintsOff:hover{opacity:.75}.i54Wjq_counts{color:var(--dsw-alias-label-tertiary);white-space:nowrap;margin-right:4px;font-size:11px;line-height:16px}.i54Wjq_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}.i54Wjq_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}.i54Wjq_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}.i54Wjq_emptyState{text-align:center;color:var(--dsw-alias-label-secondary);padding:36px 24px 30px}.i54Wjq_emptyTitle{color:var(--dsw-alias-label-primary);margin:0 0 6px;font-size:13px;font-weight:600}.i54Wjq_emptyDesc{color:var(--dsw-alias-label-tertiary);margin:0;font-size:12px;line-height:20px}.i54Wjq_syncHint{color:var(--dsw-alias-label-dimmed);justify-content:center;align-items:center;gap:6px;margin:10px 0 0;font-size:11px;display:flex}.i54Wjq_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}.i54Wjq_cardBound{border-color:var(--dsw-alias-border-l3,#7f7f7f59);box-shadow:inset 0 0 0 .5px var(--dsw-alias-border-l3,transparent)}.i54Wjq_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}.i54Wjq_cardHead:hover{background:var(--dsw-alias-interactive-bg-hover,#7f7f7f14)}.i54Wjq_cardTitleRow{align-items:center;gap:6px;min-width:0;display:flex}.i54Wjq_cardTitle{color:var(--dsw-alias-label-primary);white-space:nowrap;text-overflow:ellipsis;font-size:13px;font-weight:500;line-height:20px;overflow:hidden}.i54Wjq_cardMeta{color:var(--dsw-alias-label-tertiary);flex:none;align-items:center;gap:8px;display:flex}.i54Wjq_progressText{font-variant-numeric:tabular-nums;color:var(--dsw-alias-label-secondary);font-size:11px;line-height:16px}.i54Wjq_updated{color:var(--dsw-alias-label-dimmed);font-size:10px;line-height:14px}.i54Wjq_chevron{color:var(--dsw-alias-label-tertiary);display:inline-flex}.i54Wjq_track{background:var(--dsw-alias-interactive-bg-hover,#7f7f7f1f);border-radius:1px;height:2px;margin:0 10px 6px;overflow:hidden}.i54Wjq_trackFill{background:var(--dsw-alias-label-primary-bluish,var(--dsw-alias-button-primary-fill,#3a6ef5));border-radius:1px;height:100%;transition:width .2s}.i54Wjq_cardBody{border-top:1px solid var(--dsw-alias-border-l1,#7f7f7f24);overscroll-behavior:contain;max-height:300px;padding:8px 10px 10px;overflow-y:auto}.i54Wjq_section{margin-bottom:8px}.i54Wjq_section:last-child{margin-bottom:0}.i54Wjq_sectionLabel{color:var(--dsw-alias-label-secondary);align-items:center;gap:6px;margin-bottom:4px;font-size:11px;line-height:16px;display:flex}.i54Wjq_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}.i54Wjq_stepsList{flex-direction:column;gap:1px;margin:0;padding:0;list-style:none;display:flex}.i54Wjq_stepRow{align-items:flex-start;gap:7px;padding:3px 2px;display:flex}.i54Wjq_stepRow>svg{flex:none;margin-top:2px}.i54Wjq_stepDone{color:var(--dsw-alias-label-dimmed)}.i54Wjq_stepRun{color:var(--dsw-alias-label-primary-bluish,#3a6ef5)}.i54Wjq_stepPending{background:var(--dsw-alias-border-l3,#7f7f7f80);border-radius:50%;flex:none;width:8px;height:8px;margin:5px 3px}.i54Wjq_stepContent{color:var(--dsw-alias-label-secondary);word-break:break-word;white-space:pre-wrap;font-size:12px;line-height:20px}.i54Wjq_stepContentDone{color:var(--dsw-alias-label-dimmed);text-decoration:line-through}.i54Wjq_stepContentRun{color:var(--dsw-alias-label-primary)}.i54Wjq_muted{color:var(--dsw-alias-label-dimmed);font-size:11px;line-height:18px}.i54Wjq_filesList{flex-direction:column;margin:0;padding:0;list-style:none;display:flex}.i54Wjq_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}.i54Wjq_fileRow:hover{background:var(--dsw-alias-interactive-bg-hover,#7f7f7f14)}.i54Wjq_fileDot{background:var(--dsw-alias-border-l3,#7f7f7f80);border-radius:50%;flex:none;width:5px;height:5px}.i54Wjq_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}.i54Wjq_fileLine{color:var(--dsw-alias-label-dimmed);flex:none;font-size:10px;line-height:18px}.i54Wjq_cardFooter{gap:6px;margin-top:8px;display:flex}@media (prefers-reduced-motion:reduce){.i54Wjq_panel{animation:none}.i54Wjq_trackFill,.i54Wjq_card{transition:none}}.i54Wjq_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}.i54Wjq_miniBar:active{cursor:grabbing}.i54Wjq_miniBar:hover{background:var(--dsw-alias-interactive-bg-hover,#7f7f7f14)}.i54Wjq_miniIcon{color:var(--dsw-alias-label-secondary);flex:none}.i54Wjq_miniText{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.i54Wjq_miniChevron{color:var(--dsw-alias-label-tertiary);flex:none}.i54Wjq_taskList{flex:auto;min-height:0}.i54Wjq_card{flex-direction:column;display:flex}.i54Wjq_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}.i54Wjq_stepToggle{cursor:pointer;background:0 0;border:none;border-radius:4px;flex:none;align-items:center;margin-top:2px;padding:0;display:inline-flex}.i54Wjq_stepToggle:hover{background:var(--dsw-alias-interactive-bg-hover,#7f7f7f1f)}.i54Wjq_stepToggle:disabled{cursor:default;opacity:.5}.i54Wjq_stepEditable{cursor:text;border-radius:3px}.i54Wjq_stepEditable:hover{outline:1px dashed var(--dsw-alias-border-l3,#7f7f7f66);outline-offset:1px}.i54Wjq_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}.i54Wjq_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}.i54Wjq_editorArea:focus{border-color:var(--dsw-alias-border-l3,#7f7f7f99);outline:none}.i54Wjq_stepDragging{opacity:.3;background:var(--dsw-alias-interactive-bg-hover,#7f7f7f14)}.i54Wjq_cardTitleEditable{cursor:text;border-radius:3px}.i54Wjq_cardTitleEditable:hover{outline:1px dashed var(--dsw-alias-border-l3,#7f7f7f66);outline-offset:1px}.i54Wjq_panel[data-theme=glass],.i54Wjq_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)}.i54Wjq_panel[data-theme=glass] .i54Wjq_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)}.i54Wjq_panel[data-theme=glass] .i54Wjq_cardBody{border-top-color:color-mix(in srgb, var(--dsw-alias-border-l1,#7f7f7f24) 60%, transparent)}@media (prefers-reduced-transparency:reduce){.i54Wjq_panel[data-theme=glass],.i54Wjq_miniBar[data-theme=glass]{background:var(--dsw-alias-bg-layer-2,#fff);-webkit-backdrop-filter:none;backdrop-filter:none}.i54Wjq_panel[data-theme=glass] .i54Wjq_card{background:var(--dsw-alias-bg-base,transparent)}}@supports not ((-webkit-backdrop-filter:blur(1px)) or (backdrop-filter:blur(1px))){.i54Wjq_panel[data-theme=glass],.i54Wjq_miniBar[data-theme=glass]{background:var(--dsw-alias-bg-layer-2,#fff)}}.i54Wjq_panel[data-theme=brutal]{box-shadow:none;border-width:1px;border-radius:6px}.i54Wjq_panel[data-theme=brutal] .i54Wjq_card{border:1px solid var(--dsw-alias-border-l3,#7f7f7f6b);background:var(--dsw-alias-bg-base,transparent);box-shadow:none;border-radius:3px}.i54Wjq_panel[data-theme=brutal] .i54Wjq_cardHead{padding:7px 10px 6px}.i54Wjq_panel[data-theme=brutal] .i54Wjq_cardTitle{letter-spacing:.01em;font-weight:650}.i54Wjq_panel[data-theme=brutal] .i54Wjq_headerTitle{letter-spacing:.03em}.i54Wjq_panel[data-theme=brutal] .i54Wjq_boundBadge{border-radius:2px}.i54Wjq_panel[data-theme=brutal] .i54Wjq_track{border-radius:0;height:3px}.i54Wjq_panel[data-theme=brutal] .i54Wjq_trackFill{border-radius:0}.i54Wjq_panel[data-theme=brutal] .i54Wjq_cardBody{border-top:1px solid var(--dsw-alias-border-l2,#7f7f7f3d)}.i54Wjq_panel[data-theme=mono] .i54Wjq_headerTitle,.i54Wjq_panel[data-theme=mono] .i54Wjq_counts,.i54Wjq_panel[data-theme=mono] .i54Wjq_cardTitle,.i54Wjq_panel[data-theme=mono] .i54Wjq_progressText,.i54Wjq_panel[data-theme=mono] .i54Wjq_stepContent,.i54Wjq_panel[data-theme=mono] .i54Wjq_filePath{font-family:ui-monospace,SF Mono,Menlo,Consolas,Liberation Mono,monospace}.i54Wjq_panel[data-theme=mono] .i54Wjq_cardTitle{font-size:12px}.i54Wjq_panel[data-theme=mono] .i54Wjq_stepContent{font-size:11.5px}.i54Wjq_panel[data-theme=mono] .i54Wjq_card{border-radius:5px}.i54Wjq_panel[data-theme=mono] .i54Wjq_trackFill{border-radius:0}.i54Wjq_panel[data-theme=mono] .i54Wjq_stepPending{border-radius:1px}.i54Wjq_panel[data-theme=mono] .i54Wjq_updated{letter-spacing:.02em}.i54Wjq_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}.i54Wjq_headerIcon{color:var(--dsw-alias-label-secondary);flex:none;display:block}.i54Wjq_headerLeft{min-width:0}.i54Wjq_headerTitle{text-overflow:ellipsis;flex:0 auto;min-width:0;overflow:hidden}.i54Wjq_headerRight{min-width:0}.i54Wjq_counts{text-overflow:ellipsis;flex:none;max-width:45%;margin-left:auto;overflow:hidden}.i54Wjq_dragGhost{pointer-events:none;z-index:9999;transition:left 50ms,top 50ms;position:fixed;transform:translate(-50%,-50%)}.i54Wjq_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}.i54Wjq_dragGhostContent{text-overflow:ellipsis;word-break:break-word;flex:1;min-width:0;overflow:hidden}.i54Wjq_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}.i54Wjq_dragGhostClose:hover{opacity:1;color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-interactive-bg-hover,#7f7f7f1f)}.i54Wjq_dropTargetBefore{position:relative}.i54Wjq_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 i54Wjq_dropPulse;position:absolute;top:-1px;left:0;right:0}.i54Wjq_dropTargetAfter{position:relative}.i54Wjq_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 i54Wjq_dropPulse;position:absolute;bottom:-1px;left:0;right:0}@keyframes i54Wjq_dropPulse{0%,to{opacity:.6}50%{opacity:1}}.i54Wjq_memoryPane{flex-direction:column;gap:6px;max-height:480px;padding:8px 10px 10px;display:flex;overflow:auto}.i54Wjq_memToolbar{justify-content:space-between;align-items:center;gap:8px;display:flex}.i54Wjq_memCount{opacity:.75;font-size:12px;font-weight:600}.i54Wjq_memList{flex-direction:column;gap:6px;display:flex}.i54Wjq_memSentinel{flex:none;height:1px}.i54Wjq_memFooter{flex-direction:column;align-items:center;gap:4px;padding:6px 0 2px;font-size:12px;display:flex}.i54Wjq_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}.i54Wjq_memRowArchived{opacity:.55}.i54Wjq_memRowMain{flex-direction:column;gap:2px;display:flex}.i54Wjq_memTitle{word-break:break-word;align-items:flex-start;gap:6px;font-size:13px;line-height:1.35;display:flex}.i54Wjq_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}.i54Wjq_memMeta{flex-wrap:wrap;align-items:center;gap:4px;display:flex}.i54Wjq_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}.i54Wjq_badgeDraft{color:#b26a00;background:#ffb40029}.i54Wjq_badgeArchived{opacity:.8}.i54Wjq_memBody{opacity:.8;word-break:break-word;font-size:12px}.i54Wjq_memActs{flex-wrap:wrap;gap:4px;display:flex}.i54Wjq_memToolbarActs{align-items:center;gap:6px;display:flex}.i54Wjq_memNew{border:1px solid var(--dsw-border-weak,#80808040);border-radius:6px;flex-direction:column;gap:6px;padding:8px;display:flex}.i54Wjq_memNewRow{align-items:center;gap:8px;display:flex}.i54Wjq_memLabel{opacity:.8;align-items:center;gap:6px;font-size:12px;display:inline-flex}.i54Wjq_memNew select,.i54Wjq_memNew textarea{box-sizing:border-box;width:100%}";
|
|
988
1094
|
const tagId$2 = "@yolk_vat-y/dsh-project-memory/TaskPanel.module.css";
|
|
989
1095
|
if (typeof document !== "undefined") {
|
|
@@ -1088,30 +1194,11 @@ window.__ModuleLoader__.load({
|
|
|
1088
1194
|
"trackFill": "i54Wjq_trackFill",
|
|
1089
1195
|
"updated": "i54Wjq_updated"
|
|
1090
1196
|
};
|
|
1091
|
-
|
|
1092
|
-
//#region src/client/TaskComponents.tsx
|
|
1197
|
+
// src/client/TaskComponents.tsx
|
|
1093
1198
|
/**
|
|
1094
1199
|
* Task Panel Presentational 组件 — MiniBar(折叠迷你条)与 TaskCard(任务卡)。
|
|
1095
1200
|
* 纯渲染 + 卡片局部行内编辑/拖拽状态,动作经 props 回调交给容器(TaskPanel.tsx)。
|
|
1096
1201
|
*/
|
|
1097
|
-
function insightKindLabel(kind, t) {
|
|
1098
|
-
return {
|
|
1099
|
-
lesson: t("mem.kind.lesson"),
|
|
1100
|
-
decision: t("mem.kind.decision"),
|
|
1101
|
-
procedure: t("mem.kind.procedure"),
|
|
1102
|
-
experience: t("mem.kind.experience")
|
|
1103
|
-
}[kind] ?? kind;
|
|
1104
|
-
}
|
|
1105
|
-
function timeAgo(iso) {
|
|
1106
|
-
if (!iso) return "";
|
|
1107
|
-
const diff = Date.now() - new Date(iso).getTime();
|
|
1108
|
-
const m = Math.floor(diff / 6e4);
|
|
1109
|
-
if (m < 1) return "刚刚";
|
|
1110
|
-
if (m < 60) return `${m}分钟前`;
|
|
1111
|
-
const h = Math.floor(m / 60);
|
|
1112
|
-
if (h < 24) return `${h}小时前`;
|
|
1113
|
-
return `${Math.floor(h / 24)}天前`;
|
|
1114
|
-
}
|
|
1115
1202
|
function StepIcon({ status }) {
|
|
1116
1203
|
if (status === "completed") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconCheckOutline16, { className: TaskPanel_module_css_default.stepDone });
|
|
1117
1204
|
if (status === "in_progress") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconPlayOutline16, { className: TaskPanel_module_css_default.stepRun });
|
|
@@ -1124,7 +1211,7 @@ window.__ModuleLoader__.load({
|
|
|
1124
1211
|
* 数值是可感知与可靠性的折中:太小慢速双击会失效,太大单击会显“肉”。
|
|
1125
1212
|
*/
|
|
1126
1213
|
const CLICK_SINGLE_DELAY_MS = 250;
|
|
1127
|
-
function InlineEditor({ value, className, maxRows = 8, onValueChange, onCommit, onCancel }) {
|
|
1214
|
+
function InlineEditor({ value, className, maxRows = 8, disabled = false, onValueChange, onCommit, onCancel }) {
|
|
1128
1215
|
const ref = (0, react.useRef)(null);
|
|
1129
1216
|
(0, react.useLayoutEffect)(() => {
|
|
1130
1217
|
const el = ref.current;
|
|
@@ -1145,6 +1232,7 @@ window.__ModuleLoader__.load({
|
|
|
1145
1232
|
rows: 1,
|
|
1146
1233
|
value,
|
|
1147
1234
|
autoFocus: true,
|
|
1235
|
+
disabled,
|
|
1148
1236
|
spellCheck: false,
|
|
1149
1237
|
onChange: (e) => onValueChange(e.target.value),
|
|
1150
1238
|
onFocus: (e) => {
|
|
@@ -1231,19 +1319,21 @@ window.__ModuleLoader__.load({
|
|
|
1231
1319
|
}
|
|
1232
1320
|
function TaskCard({ task, isBound, expanded, onToggleExpand, onSwitch, onUnbind, onArchive, onRename, onEditStep, onCycleStatus, onReorderSteps, onInsightAction, showHints, syncing, t }) {
|
|
1233
1321
|
const steps = task.steps || [];
|
|
1234
|
-
const { dragState, dropTargetIndex, startDrag, cancelDrag } = useTaskDrag(task.id,
|
|
1322
|
+
const { dragState, dropTargetIndex, startDrag, cancelDrag } = useTaskDrag(task.id, isBound, onReorderSteps);
|
|
1235
1323
|
const [stepEdit, setStepEdit] = (0, react.useState)(null);
|
|
1236
1324
|
const [titleEdit, setTitleEdit] = (0, react.useState)(null);
|
|
1237
1325
|
const done = steps.filter((s) => s.status === "completed").length;
|
|
1238
1326
|
const pct = steps.length > 0 ? Math.round(done / steps.length * 100) : 0;
|
|
1239
1327
|
const commitStepEdit = (index) => {
|
|
1240
1328
|
if (!stepEdit || stepEdit.index !== index) return;
|
|
1329
|
+
if (syncing) return;
|
|
1241
1330
|
const value = stepEdit.value;
|
|
1242
1331
|
setStepEdit(null);
|
|
1243
1332
|
onEditStep(index, value);
|
|
1244
1333
|
};
|
|
1245
1334
|
const commitTitleEdit = () => {
|
|
1246
1335
|
if (titleEdit === null) return;
|
|
1336
|
+
if (syncing) return;
|
|
1247
1337
|
const value = titleEdit.value;
|
|
1248
1338
|
setTitleEdit(null);
|
|
1249
1339
|
onRename(value);
|
|
@@ -1302,6 +1392,7 @@ window.__ModuleLoader__.load({
|
|
|
1302
1392
|
className: TaskPanel_module_css_default.editorArea,
|
|
1303
1393
|
value: titleEdit.value,
|
|
1304
1394
|
maxRows: 4,
|
|
1395
|
+
disabled: syncing,
|
|
1305
1396
|
onValueChange: (value) => setTitleEdit({ value }),
|
|
1306
1397
|
onCommit: commitTitleEdit,
|
|
1307
1398
|
onCancel: () => setTitleEdit(null)
|
|
@@ -1312,7 +1403,7 @@ window.__ModuleLoader__.load({
|
|
|
1312
1403
|
onDoubleClick: (e) => {
|
|
1313
1404
|
e.preventDefault();
|
|
1314
1405
|
e.stopPropagation();
|
|
1315
|
-
if (isBound) setTitleEdit({ value: String(task.title ?? "") });
|
|
1406
|
+
if (isBound && !syncing) setTitleEdit({ value: String(task.title ?? "") });
|
|
1316
1407
|
},
|
|
1317
1408
|
children: task.title
|
|
1318
1409
|
})]
|
|
@@ -1329,7 +1420,7 @@ window.__ModuleLoader__.load({
|
|
|
1329
1420
|
}),
|
|
1330
1421
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1331
1422
|
className: TaskPanel_module_css_default.updated,
|
|
1332
|
-
children: timeAgo(task.updatedAt || task.lastActiveAt)
|
|
1423
|
+
children: timeAgo(task.updatedAt || task.lastActiveAt, "")
|
|
1333
1424
|
}),
|
|
1334
1425
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1335
1426
|
className: TaskPanel_module_css_default.chevron,
|
|
@@ -1386,6 +1477,7 @@ window.__ModuleLoader__.load({
|
|
|
1386
1477
|
className: TaskPanel_module_css_default.editorArea,
|
|
1387
1478
|
value: stepEdit.value,
|
|
1388
1479
|
maxRows: 10,
|
|
1480
|
+
disabled: syncing,
|
|
1389
1481
|
onValueChange: (value) => setStepEdit({
|
|
1390
1482
|
index: i,
|
|
1391
1483
|
value
|
|
@@ -1397,7 +1489,7 @@ window.__ModuleLoader__.load({
|
|
|
1397
1489
|
title: isBound && showHints ? t("step.edit-hint") : void 0,
|
|
1398
1490
|
onDoubleClick: (e) => {
|
|
1399
1491
|
e.stopPropagation();
|
|
1400
|
-
if (isBound) setStepEdit({
|
|
1492
|
+
if (isBound && !syncing) setStepEdit({
|
|
1401
1493
|
index: i,
|
|
1402
1494
|
value: String(step.content ?? "")
|
|
1403
1495
|
});
|
|
@@ -1556,6 +1648,7 @@ window.__ModuleLoader__.load({
|
|
|
1556
1648
|
]
|
|
1557
1649
|
});
|
|
1558
1650
|
}
|
|
1651
|
+
// src/client/paging.js
|
|
1559
1652
|
/** 预取提前量:哨兵进入视口**下方 600px** 就开始取下一页,数据在滚到底之前到位。 */
|
|
1560
1653
|
const PREFETCH_MARGIN = "600px 0px";
|
|
1561
1654
|
/**
|
|
@@ -1569,7 +1662,7 @@ window.__ModuleLoader__.load({
|
|
|
1569
1662
|
return `/tasks insight list ${scope} ${offset} ${limit}`;
|
|
1570
1663
|
}
|
|
1571
1664
|
/**
|
|
1572
|
-
* 追加一页并**按 id 去重**。去重是必需的:前缀重放(见
|
|
1665
|
+
* 追加一页并**按 id 去重**。去重是必需的:前缀重放(见 MemoryView.loadPrefix)与并发
|
|
1573
1666
|
* 刷新都可能让同一 id 出现两次,重复行带重复按钮,点错一个就是误删。
|
|
1574
1667
|
* @param {ReadonlyArray<{id?: string}>} prev - 已渲染条目。
|
|
1575
1668
|
* @param {ReadonlyArray<{id?: string}>} page - 新到的一页。
|
|
@@ -1583,20 +1676,6 @@ window.__ModuleLoader__.load({
|
|
|
1583
1676
|
return [...prev, ...fresh];
|
|
1584
1677
|
}
|
|
1585
1678
|
/**
|
|
1586
|
-
* 动作(archive/delete/promote…)之后的重载窗口:刷新**已加载的整个前缀**而非重置成第一页(否则
|
|
1587
|
-
* 会把正在看第 5 页的用户弹回顶部);用 offset 分页而非 keyset 游标正是为了让"把 0..N 重取一遍"
|
|
1588
|
-
* 可行。**上限**:宿主单页最多 {@link HOST_PAGE_MAX} 条且静默截断,`limit` 在这里夹住,余下的由 `nextOffset` 追加。
|
|
1589
|
-
* @param {number} loadedCount - 当前已渲染条数。
|
|
1590
|
-
* @param {number} [pageSize] - 每页条数下界,保证至少取一页。
|
|
1591
|
-
* @returns {{offset: number, limit: number}} 重放请求窗口(limit ≤ HOST_PAGE_MAX)。
|
|
1592
|
-
*/
|
|
1593
|
-
function reloadWindowRequest(loadedCount, pageSize = 30) {
|
|
1594
|
-
return {
|
|
1595
|
-
offset: 0,
|
|
1596
|
-
limit: Math.min(200, Math.max(pageSize, Number.isFinite(loadedCount) && loadedCount > 0 ? Math.floor(loadedCount) : 0))
|
|
1597
|
-
};
|
|
1598
|
-
}
|
|
1599
|
-
/**
|
|
1600
1679
|
* 把宿主载荷归一成窗口状态,兼容三种形态:新宿主分页(有 `total` + `nextOffset`)、新宿主不
|
|
1601
1680
|
* 分页(省略 limit,`nextOffset === null`)、老宿主/老 bundle(两个字段都没有 → 视为一次给全)。
|
|
1602
1681
|
* @param {any} data - 已解析的 JSON 载荷。
|
|
@@ -1674,11 +1753,10 @@ window.__ModuleLoader__.load({
|
|
|
1674
1753
|
}
|
|
1675
1754
|
};
|
|
1676
1755
|
}
|
|
1677
|
-
|
|
1678
|
-
//#region src/client/MemoryView.tsx
|
|
1756
|
+
// src/client/MemoryView.tsx
|
|
1679
1757
|
/**
|
|
1680
1758
|
* Memory View — 记忆三作用域列表(Task 草稿 / Project / Global)
|
|
1681
|
-
* 数据通道与任务面板一致:remote.commands.execute 执行
|
|
1759
|
+
* 数据通道与任务面板一致:remote.commands.execute 执行 `/tasks insight …`,取 JSON 载荷。
|
|
1682
1760
|
* 动作:confirm(草稿审核) / promote(向上提升) / demote(向下降级,需绑定任务) / archive / restore / delete
|
|
1683
1761
|
*
|
|
1684
1762
|
* 列表是**增量加载**的:首屏只取 PAGE_SIZE 条,滚到底前 600px 预取下一页追加。
|
|
@@ -1705,6 +1783,11 @@ window.__ModuleLoader__.load({
|
|
|
1705
1783
|
}
|
|
1706
1784
|
return hit;
|
|
1707
1785
|
}
|
|
1786
|
+
/** 动作会跨 scope 改变列表:整份失效本 session/root 的缓存,否则目标页 30s 内仍显示旧列表。 */
|
|
1787
|
+
function invalidateInsightCache(sessionId, root) {
|
|
1788
|
+
const prefix = `${sessionId || ""}|${root || ""}|`;
|
|
1789
|
+
for (const key of [...insightCache.keys()]) if (key.startsWith(prefix)) insightCache.delete(key);
|
|
1790
|
+
}
|
|
1708
1791
|
function writeInsightCache(sessionId, scope, root, boundTaskId, rows, total, nextOffset) {
|
|
1709
1792
|
const key = insightCacheKey(sessionId, scope, root, boundTaskId);
|
|
1710
1793
|
insightCache.delete(key);
|
|
@@ -1746,21 +1829,15 @@ window.__ModuleLoader__.load({
|
|
|
1746
1829
|
return null;
|
|
1747
1830
|
}
|
|
1748
1831
|
}
|
|
1749
|
-
function kindText(kind, t) {
|
|
1750
|
-
return {
|
|
1751
|
-
lesson: t("mem.kind.lesson"),
|
|
1752
|
-
decision: t("mem.kind.decision"),
|
|
1753
|
-
procedure: t("mem.kind.procedure"),
|
|
1754
|
-
experience: t("mem.kind.experience")
|
|
1755
|
-
}[kind] ?? kind;
|
|
1756
|
-
}
|
|
1757
1832
|
function MemoryView({ ctx, sessionId, scope, root, boundTaskId, showHints, t }) {
|
|
1758
1833
|
const [rows, setRows] = (0, react.useState)([]);
|
|
1759
1834
|
const [total, setTotal] = (0, react.useState)(0);
|
|
1835
|
+
const totalRef = (0, react.useRef)(0);
|
|
1760
1836
|
const [nextOffset, setNextOffset] = (0, react.useState)(null);
|
|
1761
1837
|
const [error, setError] = (0, react.useState)(null);
|
|
1762
1838
|
const [loading, setLoading] = (0, react.useState)(false);
|
|
1763
1839
|
const [loadingMore, setLoadingMore] = (0, react.useState)(false);
|
|
1840
|
+
const failedPageRef = (0, react.useRef)(null);
|
|
1764
1841
|
const [showSpinner, setShowSpinner] = (0, react.useState)(false);
|
|
1765
1842
|
const [busy, setBusy] = (0, react.useState)(false);
|
|
1766
1843
|
const [showNew, setShowNew] = (0, react.useState)(false);
|
|
@@ -1776,29 +1853,14 @@ window.__ModuleLoader__.load({
|
|
|
1776
1853
|
const scrollRef = (0, react.useRef)(null);
|
|
1777
1854
|
const sentinelRef = (0, react.useRef)(null);
|
|
1778
1855
|
const runLine = (0, react.useCallback)(async (line) => {
|
|
1779
|
-
const
|
|
1780
|
-
|
|
1856
|
+
const result = await invokeCommand(ctx, sessionId, line);
|
|
1857
|
+
return result.ok ? {
|
|
1858
|
+
ok: true,
|
|
1859
|
+
text: result.text
|
|
1860
|
+
} : {
|
|
1781
1861
|
ok: false,
|
|
1782
|
-
text:
|
|
1862
|
+
text: result.error || "command failed"
|
|
1783
1863
|
};
|
|
1784
|
-
try {
|
|
1785
|
-
const envelope = await commands.execute(sessionId, line, []);
|
|
1786
|
-
const execution = envelope && typeof envelope === "object" && "value" in envelope ? envelope.value : envelope;
|
|
1787
|
-
const result = execution?.result ?? execution;
|
|
1788
|
-
if (result?.kind === "error") return {
|
|
1789
|
-
ok: false,
|
|
1790
|
-
text: result.text ?? "command error"
|
|
1791
|
-
};
|
|
1792
|
-
return {
|
|
1793
|
-
ok: true,
|
|
1794
|
-
text: result?.text ?? ""
|
|
1795
|
-
};
|
|
1796
|
-
} catch (err) {
|
|
1797
|
-
return {
|
|
1798
|
-
ok: false,
|
|
1799
|
-
text: String(err?.message ?? err)
|
|
1800
|
-
};
|
|
1801
|
-
}
|
|
1802
1864
|
}, [ctx, sessionId]);
|
|
1803
1865
|
const gateRef = (0, react.useRef)(null);
|
|
1804
1866
|
if (gateRef.current === null) gateRef.current = createRequestGate();
|
|
@@ -1806,41 +1868,75 @@ window.__ModuleLoader__.load({
|
|
|
1806
1868
|
(0, react.useEffect)(() => {
|
|
1807
1869
|
scopeRef.current = scope;
|
|
1808
1870
|
}, [scope]);
|
|
1871
|
+
(0, react.useEffect)(() => {
|
|
1872
|
+
setShowNew(false);
|
|
1873
|
+
setEditingId(null);
|
|
1874
|
+
setForm({
|
|
1875
|
+
title: "",
|
|
1876
|
+
kind: "lesson",
|
|
1877
|
+
body: "",
|
|
1878
|
+
steps: "",
|
|
1879
|
+
trigger: ""
|
|
1880
|
+
});
|
|
1881
|
+
setSavedTip(null);
|
|
1882
|
+
}, [
|
|
1883
|
+
scope,
|
|
1884
|
+
sessionId,
|
|
1885
|
+
root
|
|
1886
|
+
]);
|
|
1809
1887
|
/**
|
|
1810
1888
|
* 取一页并落到状态里。
|
|
1811
1889
|
* @param offset 起始下标。
|
|
1812
1890
|
* @param limit 本页条数。
|
|
1813
1891
|
* @param append true=追加到已渲染列表;false=替换成这一页(首屏或前缀重放)。
|
|
1892
|
+
* @param opts.prefix 前缀重放时忽略 total 变化(由调用方连续取页直到目标条数)。
|
|
1893
|
+
* @returns 本页条数与下一页 offset;请求被取代/失败时为 null。
|
|
1814
1894
|
*/
|
|
1815
|
-
const load = (0, react.useCallback)(async (offset, limit, append) => {
|
|
1895
|
+
const load = (0, react.useCallback)(async (offset, limit, append, opts = {}) => {
|
|
1816
1896
|
if (!sessionId) {
|
|
1817
1897
|
setRows([]);
|
|
1818
1898
|
setTotal(0);
|
|
1819
1899
|
setNextOffset(null);
|
|
1820
1900
|
setError(null);
|
|
1821
1901
|
setLoading(false);
|
|
1822
|
-
|
|
1902
|
+
failedPageRef.current = null;
|
|
1903
|
+
return null;
|
|
1823
1904
|
}
|
|
1824
1905
|
const requestedScope = scopeRef.current;
|
|
1825
1906
|
const key = `${requestedScope}|${offset}|${limit}|${append}`;
|
|
1826
1907
|
const ticket = gateRef.current.begin(key);
|
|
1827
|
-
if (ticket === false) return;
|
|
1908
|
+
if (ticket === false) return null;
|
|
1828
1909
|
if (!append) setLoading(true);
|
|
1829
1910
|
setLoadingMore(append);
|
|
1830
1911
|
setError(null);
|
|
1831
1912
|
const spinner = window.setTimeout(() => setShowSpinner(true), 150);
|
|
1832
1913
|
try {
|
|
1833
1914
|
const res = await runLine(insightListLine(requestedScope, offset, limit));
|
|
1834
|
-
if (gateRef.current.isStale(ticket, requestedScope, scopeRef.current)) return;
|
|
1915
|
+
if (gateRef.current.isStale(ticket, requestedScope, scopeRef.current)) return null;
|
|
1835
1916
|
if (!res.ok) {
|
|
1917
|
+
failedPageRef.current = {
|
|
1918
|
+
offset,
|
|
1919
|
+
append
|
|
1920
|
+
};
|
|
1836
1921
|
setError(res.text);
|
|
1837
|
-
return;
|
|
1922
|
+
return null;
|
|
1838
1923
|
}
|
|
1839
1924
|
const parsed = parseInsightPayloadText(res.text);
|
|
1840
1925
|
if (!parsed) {
|
|
1926
|
+
failedPageRef.current = {
|
|
1927
|
+
offset,
|
|
1928
|
+
append
|
|
1929
|
+
};
|
|
1841
1930
|
setError("unparsable payload");
|
|
1842
|
-
return;
|
|
1931
|
+
return null;
|
|
1932
|
+
}
|
|
1933
|
+
if (append && !opts.prefix && parsed.total !== totalRef.current) {
|
|
1934
|
+
totalRef.current = parsed.total;
|
|
1935
|
+
loadRef.current(0, 30, false);
|
|
1936
|
+
return null;
|
|
1843
1937
|
}
|
|
1938
|
+
failedPageRef.current = null;
|
|
1939
|
+
totalRef.current = parsed.total;
|
|
1844
1940
|
setRows((prev) => {
|
|
1845
1941
|
const next = append ? appendUnique(prev, parsed.items) : parsed.items;
|
|
1846
1942
|
writeInsightCache(sessionId, requestedScope, root, boundTaskId, next, parsed.total, parsed.nextOffset);
|
|
@@ -1848,6 +1944,10 @@ window.__ModuleLoader__.load({
|
|
|
1848
1944
|
});
|
|
1849
1945
|
setTotal(parsed.total);
|
|
1850
1946
|
setNextOffset(parsed.nextOffset);
|
|
1947
|
+
return {
|
|
1948
|
+
count: parsed.items.length,
|
|
1949
|
+
nextOffset: parsed.nextOffset
|
|
1950
|
+
};
|
|
1851
1951
|
} finally {
|
|
1852
1952
|
window.clearTimeout(spinner);
|
|
1853
1953
|
if (gateRef.current.end(key, ticket)) {
|
|
@@ -1869,13 +1969,20 @@ window.__ModuleLoader__.load({
|
|
|
1869
1969
|
(0, react.useEffect)(() => {
|
|
1870
1970
|
setRows([]);
|
|
1871
1971
|
setTotal(0);
|
|
1972
|
+
totalRef.current = 0;
|
|
1872
1973
|
setNextOffset(null);
|
|
1873
1974
|
setError(null);
|
|
1975
|
+
failedPageRef.current = null;
|
|
1874
1976
|
if (!sessionId) return;
|
|
1875
1977
|
const cached = readInsightCache(sessionId, scope, root, boundTaskId);
|
|
1876
1978
|
if (cached) {
|
|
1979
|
+
const gate = gateRef.current;
|
|
1980
|
+
const key = `cache|${scope}|${root || ""}|${boundTaskId || ""}`;
|
|
1981
|
+
const ticket = gate.begin(key);
|
|
1982
|
+
if (ticket !== false) gate.end(key, ticket);
|
|
1877
1983
|
setRows(cached.rows);
|
|
1878
1984
|
setTotal(cached.total);
|
|
1985
|
+
totalRef.current = cached.total;
|
|
1879
1986
|
setNextOffset(cached.nextOffset);
|
|
1880
1987
|
setLoading(false);
|
|
1881
1988
|
setLoadingMore(false);
|
|
@@ -1904,11 +2011,25 @@ window.__ModuleLoader__.load({
|
|
|
1904
2011
|
}, [nextOffset, rows.length]);
|
|
1905
2012
|
/**
|
|
1906
2013
|
* 重载**已加载的整个前缀**(不是重置成第一页):动作之后用户的位置不该跳回顶部。
|
|
2014
|
+
* 宿主单页上限是 HOST_PAGE_MAX,超过它时必须连续拉多页,否则一次动作会把 500 条
|
|
2015
|
+
* 已加载列表截回 200 条(旧实现说的“余下由 nextOffset 追加”,
|
|
2016
|
+
* 但替换式加载不会自动追加)。
|
|
1907
2017
|
*/
|
|
2018
|
+
const loadPrefix = (0, react.useCallback)(async (desired) => {
|
|
2019
|
+
const target = Math.max(30, desired || 0);
|
|
2020
|
+
let offset = 0;
|
|
2021
|
+
let loaded = 0;
|
|
2022
|
+
for (let guard = 0; guard < 100 && loaded < target; guard++) {
|
|
2023
|
+
const win = await loadRef.current(offset, Math.min(200, target - loaded), offset !== 0, { prefix: true });
|
|
2024
|
+
if (!win) break;
|
|
2025
|
+
loaded += win.count;
|
|
2026
|
+
if (win.nextOffset === null) break;
|
|
2027
|
+
offset = win.nextOffset;
|
|
2028
|
+
}
|
|
2029
|
+
}, []);
|
|
1908
2030
|
const reloadWindow = (0, react.useCallback)(async () => {
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
}, [rows.length]);
|
|
2031
|
+
await loadPrefix(rows.length);
|
|
2032
|
+
}, [loadPrefix, rows.length]);
|
|
1912
2033
|
const act = async (action, id) => {
|
|
1913
2034
|
if (busy) return;
|
|
1914
2035
|
setBusy(true);
|
|
@@ -1917,7 +2038,10 @@ window.__ModuleLoader__.load({
|
|
|
1917
2038
|
const line = `/tasks insight ${action} ${scope} ${id}${action === "demote" && scope === "project" && boundTaskId ? ` ${boundTaskId}` : ""}`;
|
|
1918
2039
|
const res = await runLine(line);
|
|
1919
2040
|
if (!res.ok) setError(res.text);
|
|
1920
|
-
else
|
|
2041
|
+
else {
|
|
2042
|
+
invalidateInsightCache(sessionId, root);
|
|
2043
|
+
await reloadWindow();
|
|
2044
|
+
}
|
|
1921
2045
|
} finally {
|
|
1922
2046
|
setBusy(false);
|
|
1923
2047
|
}
|
|
@@ -1979,17 +2103,22 @@ window.__ModuleLoader__.load({
|
|
|
1979
2103
|
title,
|
|
1980
2104
|
kind: form.kind
|
|
1981
2105
|
};
|
|
1982
|
-
if (
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
if (form.kind === "lesson") fields.fix = form.body.trim();
|
|
1987
|
-
else if (form.kind === "decision") fields.reason = form.body.trim();
|
|
1988
|
-
else if (form.kind === "experience") fields.solution = form.body.trim();
|
|
1989
|
-
else fields.body = form.body.trim();
|
|
2106
|
+
if (!editingId) {
|
|
2107
|
+
if (form.kind === "lesson") fields.pattern = title;
|
|
2108
|
+
if (form.kind === "decision") fields.choice = title;
|
|
2109
|
+
if (form.kind === "experience") fields.problem = title;
|
|
1990
2110
|
}
|
|
1991
|
-
if (form.kind
|
|
1992
|
-
|
|
2111
|
+
if (form.kind !== "procedure" && (editingId || form.body.trim())) {
|
|
2112
|
+
const body = form.body.trim();
|
|
2113
|
+
if (form.kind === "lesson") fields.fix = body;
|
|
2114
|
+
else if (form.kind === "decision") fields.reason = body;
|
|
2115
|
+
else if (form.kind === "experience") fields.solution = body;
|
|
2116
|
+
else fields.body = body;
|
|
2117
|
+
}
|
|
2118
|
+
const editingRow = editingId ? rows.find((r) => r.id === editingId) : null;
|
|
2119
|
+
const stepsTruncated = Boolean(editingId && (editingRow?.stepsTotal ?? 0) > 50);
|
|
2120
|
+
if (form.kind === "procedure" && (editingId || form.steps.trim()) && !stepsTruncated) fields.steps = form.steps.split("\n").map((s) => s.trim()).filter(Boolean);
|
|
2121
|
+
if (form.kind === "procedure" && (editingId || form.trigger.trim())) fields.trigger = { keywords: form.trigger.split(/[,,]/).map((s) => s.trim()).filter(Boolean) };
|
|
1993
2122
|
const line = editingId ? `/tasks insight edit ${scope} ${editingId} ${JSON.stringify(fields)}` : `/tasks insight save ${scope} ${JSON.stringify(fields)}`;
|
|
1994
2123
|
const res = await runLine(line);
|
|
1995
2124
|
if (!res.ok) setError(res.text);
|
|
@@ -1997,6 +2126,7 @@ window.__ModuleLoader__.load({
|
|
|
1997
2126
|
setSavedTip(t("mem.saved"));
|
|
1998
2127
|
closeForm();
|
|
1999
2128
|
window.setTimeout(() => setSavedTip(null), 2500);
|
|
2129
|
+
invalidateInsightCache(sessionId, root);
|
|
2000
2130
|
await reloadWindow();
|
|
2001
2131
|
}
|
|
2002
2132
|
} finally {
|
|
@@ -2141,7 +2271,11 @@ window.__ModuleLoader__.load({
|
|
|
2141
2271
|
variant: "outline",
|
|
2142
2272
|
size: "sm",
|
|
2143
2273
|
disabled: loading || loadingMore,
|
|
2144
|
-
onClick: () =>
|
|
2274
|
+
onClick: () => {
|
|
2275
|
+
const failed = failedPageRef.current;
|
|
2276
|
+
if (failed) loadRef.current(failed.offset, 30, failed.append);
|
|
2277
|
+
else reloadWindow();
|
|
2278
|
+
},
|
|
2145
2279
|
children: t("mem.retry")
|
|
2146
2280
|
})
|
|
2147
2281
|
]
|
|
@@ -2167,7 +2301,7 @@ window.__ModuleLoader__.load({
|
|
|
2167
2301
|
className: TaskPanel_module_css_default.memTitle,
|
|
2168
2302
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2169
2303
|
className: TaskPanel_module_css_default.kindBadge,
|
|
2170
|
-
children:
|
|
2304
|
+
children: insightKindLabel(row.kind, t)
|
|
2171
2305
|
}), row.title || row.body]
|
|
2172
2306
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
2173
2307
|
className: TaskPanel_module_css_default.memMeta,
|
|
@@ -2299,8 +2433,7 @@ window.__ModuleLoader__.load({
|
|
|
2299
2433
|
]
|
|
2300
2434
|
});
|
|
2301
2435
|
}
|
|
2302
|
-
|
|
2303
|
-
//#region src/client/session-id.js
|
|
2436
|
+
// src/client/session-id.js
|
|
2304
2437
|
/**
|
|
2305
2438
|
* 会话列表快照 → 当前会话 id(宿主版本兼容层)。
|
|
2306
2439
|
*
|
|
@@ -2379,8 +2512,7 @@ window.__ModuleLoader__.load({
|
|
|
2379
2512
|
const chosen = rows.find((row) => !row.blank) ?? rows[0];
|
|
2380
2513
|
return chosen ? chosen.id : null;
|
|
2381
2514
|
}
|
|
2382
|
-
|
|
2383
|
-
//#region src/client/TaskPanel.tsx
|
|
2515
|
+
// src/client/TaskPanel.tsx
|
|
2384
2516
|
/**
|
|
2385
2517
|
* Task Panel — dsh web `shell.overlay` 浮动任务面板。
|
|
2386
2518
|
* Container 组件:负责数据获取、命令桥接、状态协调
|
|
@@ -2392,9 +2524,6 @@ window.__ModuleLoader__.load({
|
|
|
2392
2524
|
"completed"
|
|
2393
2525
|
];
|
|
2394
2526
|
const VIEW_CYCLE = PANEL_VIEWS;
|
|
2395
|
-
function getT(ctx) {
|
|
2396
|
-
return createTranslate(service(ctx, "locale")?.getSnapshot?.()?.active === "zh" ? zh : en);
|
|
2397
|
-
}
|
|
2398
2527
|
function useSessionId(ctx) {
|
|
2399
2528
|
const [, force] = (0, react.useState)(0);
|
|
2400
2529
|
(0, react.useEffect)(() => {
|
|
@@ -2426,13 +2555,16 @@ window.__ModuleLoader__.load({
|
|
|
2426
2555
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PanelErrorBoundary, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TaskPanelView, { ctx }) });
|
|
2427
2556
|
}
|
|
2428
2557
|
function TaskPanelView({ ctx }) {
|
|
2429
|
-
const t =
|
|
2558
|
+
const t = translatorFor(ctx);
|
|
2430
2559
|
const data = useTaskData();
|
|
2431
2560
|
const ui = useTaskUI();
|
|
2432
2561
|
const degraded = missingServices(ctx);
|
|
2433
2562
|
const sessionId = useSessionId(ctx);
|
|
2434
2563
|
const [syncing, setSyncing] = (0, react.useState)(false);
|
|
2435
2564
|
const syncingRef = (0, react.useRef)(false);
|
|
2565
|
+
const pendingRefreshRef = (0, react.useRef)(false);
|
|
2566
|
+
const sessionIdRef = (0, react.useRef)(sessionId);
|
|
2567
|
+
sessionIdRef.current = sessionId;
|
|
2436
2568
|
const [syncedAt, setSyncedAt] = (0, react.useState)(0);
|
|
2437
2569
|
const [syncError, setSyncError] = (0, react.useState)(null);
|
|
2438
2570
|
const showHints = ui.showHints;
|
|
@@ -2447,14 +2579,16 @@ window.__ModuleLoader__.load({
|
|
|
2447
2579
|
const tasks = Array.isArray(data.tasks) ? data.tasks : [];
|
|
2448
2580
|
const activeTasks = tasks.filter((task) => !task.archived);
|
|
2449
2581
|
const boundTask = data.boundTaskId ? tasks.find((task) => task.id === data.boundTaskId) ?? null : null;
|
|
2450
|
-
const applyPayload = (text) => {
|
|
2582
|
+
const applyPayload = (text, requestSessionId) => {
|
|
2583
|
+
if (requestSessionId !== sessionIdRef.current) return false;
|
|
2451
2584
|
const parsed = parseTaskPayloadText(text);
|
|
2452
2585
|
if (!parsed) return false;
|
|
2453
2586
|
dataActions.setTasks({
|
|
2454
2587
|
tasks: parsed.tasks,
|
|
2455
2588
|
boundTaskId: parsed.boundId,
|
|
2456
2589
|
archivedCount: parsed.archived,
|
|
2457
|
-
root: parsed.root
|
|
2590
|
+
root: parsed.root,
|
|
2591
|
+
sessionId
|
|
2458
2592
|
});
|
|
2459
2593
|
setSyncedAt(Date.now());
|
|
2460
2594
|
setSyncError(null);
|
|
@@ -2466,7 +2600,7 @@ window.__ModuleLoader__.load({
|
|
|
2466
2600
|
setSyncError(result.error === "no-channel" ? t("panel.no-channel") : result.error || t("panel.sync-failed"));
|
|
2467
2601
|
return false;
|
|
2468
2602
|
}
|
|
2469
|
-
return applyPayload(result.text);
|
|
2603
|
+
return applyPayload(result.text, sessionId);
|
|
2470
2604
|
};
|
|
2471
2605
|
const withLock = async (fn) => {
|
|
2472
2606
|
if (syncingRef.current) return;
|
|
@@ -2477,6 +2611,10 @@ window.__ModuleLoader__.load({
|
|
|
2477
2611
|
} finally {
|
|
2478
2612
|
syncingRef.current = false;
|
|
2479
2613
|
setSyncing(false);
|
|
2614
|
+
if (pendingRefreshRef.current) {
|
|
2615
|
+
pendingRefreshRef.current = false;
|
|
2616
|
+
refreshRef.current();
|
|
2617
|
+
}
|
|
2480
2618
|
}
|
|
2481
2619
|
};
|
|
2482
2620
|
/**
|
|
@@ -2491,6 +2629,10 @@ window.__ModuleLoader__.load({
|
|
|
2491
2629
|
* 它们各自会推宿主清单(adoptStepsToSession),不需要巡检式补写。
|
|
2492
2630
|
*/
|
|
2493
2631
|
const refresh = async () => {
|
|
2632
|
+
if (syncingRef.current) {
|
|
2633
|
+
pendingRefreshRef.current = true;
|
|
2634
|
+
return;
|
|
2635
|
+
}
|
|
2494
2636
|
await withLock(() => runLine("/tasks"));
|
|
2495
2637
|
};
|
|
2496
2638
|
const handleAction = async (verb, taskId) => {
|
|
@@ -2498,7 +2640,8 @@ window.__ModuleLoader__.load({
|
|
|
2498
2640
|
};
|
|
2499
2641
|
const handleInsightTask = async (action, id) => {
|
|
2500
2642
|
await withLock(async () => {
|
|
2501
|
-
await runLine(`/tasks insight ${action} task ${id}`);
|
|
2643
|
+
if (!await runLine(`/tasks insight ${action} task ${id}`)) return;
|
|
2644
|
+
invalidateInsightCache(sessionId, data.root ?? null);
|
|
2502
2645
|
await runLine("/tasks");
|
|
2503
2646
|
});
|
|
2504
2647
|
};
|
|
@@ -2559,7 +2702,6 @@ window.__ModuleLoader__.load({
|
|
|
2559
2702
|
const onMove = (ev) => {
|
|
2560
2703
|
if (!drag.current) return;
|
|
2561
2704
|
const width = panelRef.current?.offsetWidth ?? 380;
|
|
2562
|
-
panelRef.current?.offsetHeight;
|
|
2563
2705
|
const x = Math.max(8, Math.min(window.innerWidth - width - 8, ev.clientX - drag.current.dx));
|
|
2564
2706
|
const y = Math.max(8, Math.min(window.innerHeight - 64, ev.clientY - drag.current.dy));
|
|
2565
2707
|
dragPosRef.current = {
|
|
@@ -2586,8 +2728,15 @@ window.__ModuleLoader__.load({
|
|
|
2586
2728
|
refreshRef.current = () => {
|
|
2587
2729
|
refresh();
|
|
2588
2730
|
};
|
|
2731
|
+
const syncedSessionRef = (0, react.useRef)(null);
|
|
2589
2732
|
(0, react.useEffect)(() => {
|
|
2590
|
-
if (ui.closed || !sessionId
|
|
2733
|
+
if (ui.closed || !sessionId) return;
|
|
2734
|
+
if (syncedSessionRef.current !== sessionId) {
|
|
2735
|
+
syncedSessionRef.current = sessionId;
|
|
2736
|
+
dataActions.reset();
|
|
2737
|
+
refreshRef.current();
|
|
2738
|
+
return;
|
|
2739
|
+
}
|
|
2591
2740
|
if (Date.now() - Math.max(data.lastUpdate, syncedAt) < 5e3) return;
|
|
2592
2741
|
refreshRef.current();
|
|
2593
2742
|
}, [
|
|
@@ -2610,7 +2759,9 @@ window.__ModuleLoader__.load({
|
|
|
2610
2759
|
}
|
|
2611
2760
|
const doneCount = activeTasks.filter((task) => {
|
|
2612
2761
|
const steps = task.steps || [];
|
|
2613
|
-
|
|
2762
|
+
const totalSteps = task.totals?.steps ?? steps.length;
|
|
2763
|
+
const done = task.totals?.completedSteps ?? steps.filter((s) => s.status === "completed").length;
|
|
2764
|
+
return totalSteps > 0 && done === totalSteps;
|
|
2614
2765
|
}).length;
|
|
2615
2766
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2616
2767
|
className: TaskPanel_module_css_default.panel,
|
|
@@ -2756,7 +2907,6 @@ window.__ModuleLoader__.load({
|
|
|
2756
2907
|
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2757
2908
|
className: TaskPanel_module_css_default.taskList,
|
|
2758
2909
|
children: [activeTasks.map((task) => {
|
|
2759
|
-
task.steps;
|
|
2760
2910
|
const expanded = ui.expandedTaskIds.includes(task.id);
|
|
2761
2911
|
const isBound = data.boundTaskId === task.id;
|
|
2762
2912
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TaskCard, {
|
|
@@ -2784,8 +2934,7 @@ window.__ModuleLoader__.load({
|
|
|
2784
2934
|
]
|
|
2785
2935
|
});
|
|
2786
2936
|
}
|
|
2787
|
-
|
|
2788
|
-
//#region \0dsh-css:src/client/TaskCommandNode.module.css.mjs
|
|
2937
|
+
// \0dsh-css:src/client/TaskCommandNode.module.css.mjs
|
|
2789
2938
|
const css$1 = "._9r5h7a_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}._9r5h7a_row[data-variant=ok]{color:var(--dsw-alias-label-secondary)}._9r5h7a_row[data-variant=error]{color:var(--dsw-alias-state-warn-label,#b7791f)}._9r5h7a_row[data-variant=running]{color:var(--dsw-alias-label-dimmed)}._9r5h7a_icon{color:var(--dsw-alias-label-tertiary);flex:none}";
|
|
2790
2939
|
const tagId$1 = "@yolk_vat-y/dsh-project-memory/TaskCommandNode.module.css";
|
|
2791
2940
|
if (typeof document !== "undefined") {
|
|
@@ -2804,11 +2953,10 @@ window.__ModuleLoader__.load({
|
|
|
2804
2953
|
"icon": "_9r5h7a_icon",
|
|
2805
2954
|
"row": "_9r5h7a_row"
|
|
2806
2955
|
};
|
|
2807
|
-
|
|
2808
|
-
//#region src/client/TaskCommandNode.tsx
|
|
2956
|
+
// src/client/TaskCommandNode.tsx
|
|
2809
2957
|
/**
|
|
2810
|
-
* /tasks
|
|
2811
|
-
*
|
|
2958
|
+
* /tasks(含 /tasks insight …)与旧版 /task、/insight 节点的渲染器(conversation.chat.commandview)。
|
|
2959
|
+
* 列表型命令只显示一行摘要;记忆动作类只显示一句结果——
|
|
2812
2960
|
* 目的:大 JSON 载荷绝不整段渲染进对话(否则切视图会刷屏)。
|
|
2813
2961
|
*/
|
|
2814
2962
|
function TaskCommandNode({ node }) {
|
|
@@ -2860,11 +3008,13 @@ window.__ModuleLoader__.load({
|
|
|
2860
3008
|
if (isList && (isInsight ? parsedInsights : parsedTasks)) return null;
|
|
2861
3009
|
if (isInsight) {
|
|
2862
3010
|
const note = String(text ?? "").split("\n")[0].slice(0, 120);
|
|
3011
|
+
const label = name === "insight" ? "/insight" : "/tasks insight";
|
|
2863
3012
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2864
3013
|
className: TaskCommandNode_module_css_default.row,
|
|
2865
3014
|
"data-variant": "ok",
|
|
2866
3015
|
children: [
|
|
2867
|
-
|
|
3016
|
+
label,
|
|
3017
|
+
" ",
|
|
2868
3018
|
insightVerb,
|
|
2869
3019
|
" ",
|
|
2870
3020
|
note || "已完成"
|
|
@@ -2893,8 +3043,7 @@ window.__ModuleLoader__.load({
|
|
|
2893
3043
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconFolderOpenOutline16, { className: TaskCommandNode_module_css_default.icon }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: label })]
|
|
2894
3044
|
});
|
|
2895
3045
|
}
|
|
2896
|
-
|
|
2897
|
-
//#region src/client/ShowTaskPanelNode.tsx
|
|
3046
|
+
// src/client/ShowTaskPanelNode.tsx
|
|
2898
3047
|
/**
|
|
2899
3048
|
* `show_task_panel` 工具调用的会话内视图 —— 它的作用就是**把面板打开**。
|
|
2900
3049
|
*
|
|
@@ -2943,8 +3092,7 @@ window.__ModuleLoader__.load({
|
|
|
2943
3092
|
if (typeof keep === "function") keep(off);
|
|
2944
3093
|
});
|
|
2945
3094
|
}
|
|
2946
|
-
|
|
2947
|
-
//#region src/client/slash.ts
|
|
3095
|
+
// src/client/slash.ts
|
|
2948
3096
|
/** 源的稳定标识:同一 trigger 内唯一,重复注册会抛错。 */
|
|
2949
3097
|
const SLASH_SOURCE_NAME = "project-memory";
|
|
2950
3098
|
/** 菜单三行。顺序即渲染顺序;标题复用面板已有的 view.* 文案,保证与面板视图名一致。 */
|
|
@@ -2979,10 +3127,6 @@ window.__ModuleLoader__.load({
|
|
|
2979
3127
|
view: "global"
|
|
2980
3128
|
}
|
|
2981
3129
|
];
|
|
2982
|
-
/** 按当前语言取翻译函数。 */
|
|
2983
|
-
function translator(ctx) {
|
|
2984
|
-
return createTranslate(service(ctx, "locale")?.getSnapshot?.()?.active === "zh" ? zh : en);
|
|
2985
|
-
}
|
|
2986
3130
|
/**
|
|
2987
3131
|
* 一轮候选:把三行装配成菜单行,再按查询与位置过滤。
|
|
2988
3132
|
* 三行都不接参数(动作全在面板卡片里),所以位置过滤只做一件事:非 leading 位置不弹这一整组
|
|
@@ -3052,7 +3196,7 @@ window.__ModuleLoader__.load({
|
|
|
3052
3196
|
* @returns 触发器源;只依赖宿主的公开契约字段。
|
|
3053
3197
|
*/
|
|
3054
3198
|
function createSlashSource(ctx, deps) {
|
|
3055
|
-
const t =
|
|
3199
|
+
const t = translatorFor(ctx);
|
|
3056
3200
|
return {
|
|
3057
3201
|
trigger: "/",
|
|
3058
3202
|
name: SLASH_SOURCE_NAME,
|
|
@@ -3062,8 +3206,7 @@ window.__ModuleLoader__.load({
|
|
|
3062
3206
|
onPick: (pick) => dispatchSlashPick(t, deps, pick)
|
|
3063
3207
|
};
|
|
3064
3208
|
}
|
|
3065
|
-
|
|
3066
|
-
//#region \0dsh-css:src/client/SettingsCard.module.css.mjs
|
|
3209
|
+
// \0dsh-css:src/client/SettingsCard.module.css.mjs
|
|
3067
3210
|
const css = ".CSjuLW_card{box-sizing:border-box;border:.5px solid var(--dsw-alias-settings-card-stroke,var(--dsw-alias-border-l4,#00000029));border-radius:var(--dsw-radius-lg,16px);background:var(--dsw-alias-bg-layer-3,#fff);transition:border-color .16s,background .16s}.CSjuLW_card:hover{border-color:var(--dsw-alias-label-dimmed,#c8ccd4)}.CSjuLW_cardOpen{background:var(--dsw-alias-bg-layer-2,#f7f8fa);border-color:var(--dsw-alias-label-dimmed,#c8ccd4)}.CSjuLW_header{-webkit-appearance:none;appearance:none;border-radius:inherit;width:100%;font:inherit;color:inherit;text-align:left;cursor:pointer;background:0 0;border:0;align-items:center;gap:12px;padding:14px 16px;display:flex}.CSjuLW_header:focus-visible{outline:2px solid var(--dsw-alias-brand-primary,#4f6ef7);outline-offset:-2px}.CSjuLW_headText{flex-direction:column;flex:1;gap:4px;min-width:0;display:flex}.CSjuLW_name{color:var(--dsw-alias-label-primary,#1f2328);font-size:15px;font-weight:600;line-height:1.4}.CSjuLW_desc{color:var(--dsw-alias-label-tertiary,#8b93a1);font-size:13px;line-height:1.5}.CSjuLW_unsaved{color:var(--dsw-alias-label-secondary,#6b7280);background:var(--dsw-alias-bg-module-platform,#eef0f4);border-radius:9px;flex:none;padding:0 6px;font-size:11px;font-weight:600;line-height:17px}.CSjuLW_chevron{color:var(--dsw-alias-label-tertiary,#8b93a1);flex:none;transition:transform .16s;display:inline-flex}.CSjuLW_chevronOpen{transform:rotate(180deg)}.CSjuLW_body{border-top:1px solid var(--dsw-alias-border-l2,#e5e7eb);margin:0 16px;padding-bottom:8px}.CSjuLW_row{align-items:center;gap:12px;padding:12px 0;display:flex}.CSjuLW_row+.CSjuLW_row{border-top:1px solid var(--dsw-alias-border-l2,#e5e7eb)}.CSjuLW_labelBox{flex-direction:column;flex:1;gap:3px;min-width:0;display:flex}.CSjuLW_label{color:var(--dsw-alias-label-primary,#1f2328);font-size:13px;line-height:20px}.CSjuLW_hint{color:var(--dsw-alias-label-tertiary,#8b93a1);font-size:12px;line-height:18px}.CSjuLW_control{flex:none;align-items:center;gap:6px;display:flex}.CSjuLW_number{box-sizing:border-box;border:1px solid var(--dsw-alias-border-l2,#d1d5db);background:var(--dsw-alias-bg-layer-3,#fff);width:84px;font:inherit;color:var(--dsw-alias-label-primary,#1f2328);text-align:right;border-radius:7px;padding:6px 8px;font-size:12px;line-height:18px}.CSjuLW_number:disabled{opacity:.5;cursor:default}.CSjuLW_number:focus{border-color:var(--dsw-alias-brand-primary,#4f6ef7);outline:2px solid color-mix(in srgb, var(--dsw-alias-brand-primary,#4f6ef7) 18%, transparent)}.CSjuLW_number[aria-invalid=true]{border-color:var(--dsw-alias-state-error-primary,#dc2626)}.CSjuLW_unit{color:var(--dsw-alias-label-tertiary,#8b93a1);font-size:12px;line-height:18px}.CSjuLW_actions{border-top:1px solid var(--dsw-alias-border-l2,#e5e7eb);justify-content:flex-end;align-items:center;gap:8px;padding:12px 0 4px;display:flex}.CSjuLW_failed{min-width:0;color:var(--dsw-alias-label-error,#dc2626);flex:1;margin:0;font-size:12px;line-height:18px}.CSjuLW_notice{color:var(--dsw-alias-label-tertiary,#8b93a1);margin:0;padding:12px 0;font-size:12px;line-height:18px}";
|
|
3068
3211
|
const tagId = "@yolk_vat-y/dsh-project-memory/SettingsCard.module.css";
|
|
3069
3212
|
if (typeof document !== "undefined") {
|
|
@@ -3100,8 +3243,7 @@ window.__ModuleLoader__.load({
|
|
|
3100
3243
|
"unit": "CSjuLW_unit",
|
|
3101
3244
|
"unsaved": "CSjuLW_unsaved"
|
|
3102
3245
|
};
|
|
3103
|
-
|
|
3104
|
-
//#region src/client/settings-card.tsx
|
|
3246
|
+
// src/client/settings-card.tsx
|
|
3105
3247
|
/**
|
|
3106
3248
|
* 插件详情页上的「常用设置」卡片。
|
|
3107
3249
|
*
|
|
@@ -3373,6 +3515,14 @@ window.__ModuleLoader__.load({
|
|
|
3373
3515
|
*/
|
|
3374
3516
|
function registerSettingsCard(ctx) {
|
|
3375
3517
|
if (typeof ctx?.inject !== "function") return;
|
|
3518
|
+
if (service(ctx, "configForms")) {
|
|
3519
|
+
const missing = [
|
|
3520
|
+
"slots",
|
|
3521
|
+
"configForms",
|
|
3522
|
+
"locale"
|
|
3523
|
+
].filter((name) => !service(ctx, name));
|
|
3524
|
+
if (missing.length) console.warn(`[${SETTINGS_NS}] settings card unavailable: missing client service(s) ${missing.join(", ")}`);
|
|
3525
|
+
}
|
|
3376
3526
|
try {
|
|
3377
3527
|
ctx.inject([
|
|
3378
3528
|
"slots",
|
|
@@ -3428,8 +3578,7 @@ window.__ModuleLoader__.load({
|
|
|
3428
3578
|
inject: () => controller.inject()
|
|
3429
3579
|
}, SettingsCard))));
|
|
3430
3580
|
}
|
|
3431
|
-
|
|
3432
|
-
//#region src/client/client.ts
|
|
3581
|
+
// src/client/client.ts
|
|
3433
3582
|
/**
|
|
3434
3583
|
* dsh-project-memory Client Entry
|
|
3435
3584
|
*
|
|
@@ -3531,9 +3680,9 @@ window.__ModuleLoader__.load({
|
|
|
3531
3680
|
id: "dsh-project-memory-task-panel",
|
|
3532
3681
|
order: 100
|
|
3533
3682
|
}, () => (0, react.createElement)(TaskPanelEntry, { ctx })));
|
|
3534
|
-
|
|
3683
|
+
slots.inject("conversation.chat.commandview", () => register({
|
|
3535
3684
|
name: "conversation.chat.commandview",
|
|
3536
|
-
key
|
|
3685
|
+
key: "tasks"
|
|
3537
3686
|
}, TaskCommandNode));
|
|
3538
3687
|
registerShowTaskPanelView(slots, keep);
|
|
3539
3688
|
} catch (err) {
|
|
@@ -3568,7 +3717,6 @@ window.__ModuleLoader__.load({
|
|
|
3568
3717
|
registerSettingsCard(ctx);
|
|
3569
3718
|
reportDegradedLater(ctx);
|
|
3570
3719
|
}
|
|
3571
|
-
//#endregion
|
|
3572
3720
|
exports.apply = apply;
|
|
3573
3721
|
exports.inject = inject;
|
|
3574
3722
|
exports.name = name;
|