@william2000/dsh-nova-ui-task-board 0.3.0 → 0.3.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/LICENSE +202 -0
- package/README.md +34 -74
- package/cordis.patch.yml +0 -6
- package/lib/client.js +4 -5924
- package/lib/index.js +11 -4950
- package/lib/types/client/NovaPluginsSection.d.ts +0 -23
- package/lib/types/client/NovaTaskBoardSettingsCard.d.ts +0 -8
- package/lib/types/client/apply-guard.d.ts +0 -20
- package/lib/types/client/board/ConfirmDialog.d.ts +0 -3
- package/lib/types/client/board/ConfirmTaskDialog.d.ts +0 -1
- package/lib/types/client/board/ConvertTaskModal.d.ts +0 -4
- package/lib/types/client/board/NewTaskModal.d.ts +0 -1
- package/lib/types/client/board/RequirementSplitModal.d.ts +0 -4
- package/lib/types/client/board/SplitConfirmDialog.d.ts +0 -2
- package/lib/types/client/board/TaskBoard.d.ts +0 -5
- package/lib/types/client/board/TaskCard.d.ts +0 -23
- package/lib/types/client/board/TaskDetail.d.ts +0 -1
- package/lib/types/client/board/status-key.d.ts +0 -5
- package/lib/types/client/board-controller.d.ts +0 -159
- package/lib/types/client/board-mount.d.ts +0 -7
- package/lib/types/client/chat-integration.d.ts +0 -64
- package/lib/types/client/drag-utils.d.ts +0 -52
- package/lib/types/client/filter.d.ts +0 -22
- package/lib/types/client/grouping.d.ts +0 -39
- package/lib/types/client/host-api.d.ts +0 -44
- package/lib/types/client/index.d.ts +0 -21
- package/lib/types/client/legacy-store.d.ts +0 -22
- package/lib/types/client/locales.d.ts +0 -22
- package/lib/types/client/schedule-presets.d.ts +0 -9
- package/lib/types/client/sidebar-entry-core.d.ts +0 -33
- package/lib/types/client/sidebar-entry.d.ts +0 -16
- package/lib/types/core/context.d.ts +0 -77
- package/lib/types/core/cron.d.ts +0 -42
- package/lib/types/core/migrate.d.ts +0 -31
- package/lib/types/core/model.d.ts +0 -263
- package/lib/types/core/recovery.d.ts +0 -18
- package/lib/types/core/split.d.ts +0 -55
- package/lib/types/core/transitions.d.ts +0 -349
- package/lib/types/dsh-home.d.ts +0 -16
- package/lib/types/host-automation.d.ts +0 -40
- package/lib/types/host-ledger.d.ts +0 -104
- package/lib/types/host-routes.d.ts +0 -42
- package/lib/types/host-runner.d.ts +0 -85
- package/lib/types/host-service.d.ts +0 -219
- package/lib/types/index.d.ts +0 -61
- package/lib/types/loopback.d.ts +0 -18
- package/lib/types/mount-once.d.ts +0 -8
- package/lib/types/protocol.d.ts +0 -75
- package/package.json +16 -5
- package/lib/client.js.map +0 -1
- package/lib/types/client/PlaceholderBoard.d.ts +0 -9
|
@@ -1,78 +1,26 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 看板拖拽纯函数(T009 §12.10,D10)。
|
|
3
|
-
*
|
|
4
|
-
* - 合法性(§10.2/§11.2):running 不可作为拖拽来源/目标;跨列拖拽 = move,
|
|
5
|
-
* 目标仅限 backlog/todo(backlog↔todo 互移、done/failed 拖回 backlog/todo 为
|
|
6
|
-
* 重开);同列拖拽 = reorder(各列均可列内排序);拖到 running 等非法目标被
|
|
7
|
-
* 拒绝并提示;
|
|
8
|
-
* - 落位下标语义(与 Host transitions.applyReposition 一致):浏览器提交的
|
|
9
|
-
* `order` = 0-based 插入下标,基准是**剔除拖拽卡片后的目标列**(按 order 稳定
|
|
10
|
-
* 升序)——锚定卡片(before/after)或组尾/列尾(end)换算成该列表的下标;
|
|
11
|
-
* 过滤状态下「列尾」按可见列表最后一张卡在基准列表中的位置定位(先过滤后排序
|
|
12
|
-
* /分组展示,§12.10);
|
|
13
|
-
* - action 构建:同列 → `reorder`(分组视图跨组落位携带归属变更:项目模式
|
|
14
|
-
* project=组名/''(清除);标签模式 tags 使目标标签成为首选或移除首选);
|
|
15
|
-
* 跨列 → `move`(可选 order 落位,done/failed 重开由状态机守卫);
|
|
16
|
-
* - 全部为纯函数,可脱离宿主单测(验收 3)。
|
|
17
|
-
*/
|
|
18
1
|
import type { TaskRecord, TaskStatus } from '../core/model.ts';
|
|
19
2
|
import type { TaskBoardAction } from '../protocol.ts';
|
|
20
3
|
import { type GroupMode } from './grouping.ts';
|
|
21
|
-
/** 拖拽提交的 action 判别联合(buildDropAction 只产出 reorder/move 两种)。 */
|
|
22
4
|
export type DropAction = Extract<TaskBoardAction, {
|
|
23
5
|
kind: 'reorder';
|
|
24
6
|
}> | Extract<TaskBoardAction, {
|
|
25
7
|
kind: 'move';
|
|
26
8
|
}>;
|
|
27
|
-
/** 拖拽来源(dragstart 时记录;分组视图记录起始组 key 以判定跨组)。 */
|
|
28
9
|
export interface DragOrigin {
|
|
29
10
|
taskId: string;
|
|
30
11
|
fromStatus: TaskStatus;
|
|
31
12
|
fromTags: readonly string[];
|
|
32
|
-
/** 分组视图下起始组的 key('' = 未分类);手动模式 undefined。 */
|
|
33
13
|
fromGroupKey?: string;
|
|
34
14
|
}
|
|
35
|
-
/** 落位方式:锚定卡片之前/之后,或组尾/列尾。 */
|
|
36
15
|
export type DropPosition = 'before' | 'after' | 'end';
|
|
37
|
-
/** 拖拽目标(dragover/drop 时计算)。 */
|
|
38
16
|
export interface DropTarget {
|
|
39
|
-
/** 目标列。 */
|
|
40
17
|
status: TaskStatus;
|
|
41
|
-
/** 分组视图目标组的 key('' = 未分类);手动模式 undefined。 */
|
|
42
18
|
groupKey?: string;
|
|
43
|
-
/** 锚定卡片 id(落在卡片上时);否则为组尾/列尾。 */
|
|
44
19
|
anchorId?: string;
|
|
45
|
-
/** 落位方式:锚定卡片存在时 before/after;否则 end。 */
|
|
46
20
|
position: DropPosition;
|
|
47
21
|
}
|
|
48
|
-
/**
|
|
49
|
-
* 拖拽合法性(§10.2/§11.2):running 不可作目标;同列 = 列内排序;跨列目标仅限
|
|
50
|
-
* backlog/todo(done/failed 拖回为重开)。proposed/归档不可作为来源由调用方
|
|
51
|
-
* (卡片 draggable=false)保证。
|
|
52
|
-
*/
|
|
53
22
|
export declare function isLegalDrop(origin: DragOrigin, targetStatus: TaskStatus): boolean;
|
|
54
|
-
/**
|
|
55
|
-
* 计算落位下标(0-based,基准 = 剔除拖拽卡片后的目标列,按 order 稳定升序;
|
|
56
|
-
* 与 Host applyReposition 的 insert 基准一致):
|
|
57
|
-
* - 锚定卡片:卡片下标(after +1);
|
|
58
|
-
* - 分组视图组尾:目标组最后一张卡下标 +1(组空回退列尾);
|
|
59
|
-
* - 列尾:可见列表最后一张卡下标 +1(过滤定位;无可见卡则列尾)。
|
|
60
|
-
*/
|
|
61
23
|
export declare function computeDropIndex(restColumn: readonly TaskRecord[], target: DropTarget, mode: GroupMode, lastVisibleId?: string): number;
|
|
62
|
-
/**
|
|
63
|
-
* 可见列表内的落位下标(拖拽 pending 渲染用;list = 目标列/目标组的可见列表,
|
|
64
|
-
* **已剔除拖拽卡片**):锚定卡片 before/after,否则列表尾。
|
|
65
|
-
*/
|
|
66
24
|
export declare function visibleDropIndex(list: readonly TaskRecord[], target: DropTarget): number;
|
|
67
|
-
/**
|
|
68
|
-
* 构建拖拽提交的 action(§11.2/D10):
|
|
69
|
-
* - 同列 → `reorder`(status 与来源一致;分组视图跨组落位携带归属变更——
|
|
70
|
-
* 项目模式 project = 组名 / ''(清除);标签模式 tags 使目标标签成为首选或
|
|
71
|
-
* 移除首选(未分类));
|
|
72
|
-
* - 跨列 → `move`(status 为目标列 + 落位下标,缺省语义由 Host 追加末尾;
|
|
73
|
-
* done/failed 重开不触发执行)。
|
|
74
|
-
* 非法目标/拖到自己返回 undefined(调用方提示拒绝)。
|
|
75
|
-
*/
|
|
76
25
|
export declare function buildDropAction(origin: DragOrigin, target: DropTarget, mode: GroupMode, tasks: readonly TaskRecord[], lastVisibleId?: string): DropAction | undefined;
|
|
77
|
-
/** 拖拽目标组的归属变换后的行(pending 渲染预览,与提交的 reorder 补丁一致)。 */
|
|
78
26
|
export declare function pendingTaskView(task: TaskRecord, target: DropTarget, mode: GroupMode): TaskRecord;
|
|
@@ -1,16 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 看板过滤纯函数(T008 §12.8,D9)。
|
|
3
|
-
*
|
|
4
|
-
* - 过滤维度:文本搜索(标题/描述,大小写不敏感)+ 项目(单选)+ 标签(多选);
|
|
5
|
-
* - 语义:多条件(文本/项目/标签)之间 AND;同一条件内标签为 OR(命中任一
|
|
6
|
-
* 标签即通过);项目为单选精确匹配(`none` = 仅无项目任务);
|
|
7
|
-
* - 过滤跨列生效(主看板/归档视图由调用方先筛视图再调本函数);过滤状态仅
|
|
8
|
-
* 会话级记忆(刷新重置,不做持久化,P4 再考虑);
|
|
9
|
-
* - 全部为纯函数(无 fs、无 DOM、无运行时依赖),可脱离宿主单测
|
|
10
|
-
* (验收 3:过滤逻辑纯函数)。
|
|
11
|
-
*/
|
|
12
1
|
import type { TaskRecord } from '../core/model.ts';
|
|
13
|
-
/** 项目过滤值:`all` = 不限;`none` = 仅无项目任务;`name` = 精确项目名。 */
|
|
14
2
|
export type ProjectFilterValue = {
|
|
15
3
|
kind: 'all';
|
|
16
4
|
} | {
|
|
@@ -19,24 +7,14 @@ export type ProjectFilterValue = {
|
|
|
19
7
|
kind: 'name';
|
|
20
8
|
name: string;
|
|
21
9
|
};
|
|
22
|
-
/** 过滤状态(会话级记忆;刷新重置,不做持久化)。 */
|
|
23
10
|
export interface TaskFilter {
|
|
24
|
-
/** 文本搜索(标题/描述,大小写不敏感;空 = 不限制)。 */
|
|
25
11
|
query: string;
|
|
26
|
-
/** 项目过滤(缺省/`all` = 不限)。 */
|
|
27
12
|
project: ProjectFilterValue;
|
|
28
|
-
/** 标签过滤:空数组 = 不限;非空 = 命中任一标签(同一条件内 OR)。 */
|
|
29
13
|
tags: readonly string[];
|
|
30
14
|
}
|
|
31
|
-
/** 空过滤(看板初始状态)。 */
|
|
32
15
|
export declare const EMPTY_FILTER: TaskFilter;
|
|
33
|
-
/** 单条任务是否命中过滤(多条件 AND、标签内 OR)。 */
|
|
34
16
|
export declare function matchesFilter(task: TaskRecord, filter: TaskFilter): boolean;
|
|
35
|
-
/** 对任务集执行过滤(保持入参顺序与对象引用,memo 边界不受影响)。 */
|
|
36
17
|
export declare function filterTasks(tasks: readonly TaskRecord[], filter: TaskFilter): TaskRecord[];
|
|
37
|
-
/** 过滤是否处于激活状态(任一维度有约束;用于「清除全部」显隐与命中计数)。 */
|
|
38
18
|
export declare function isFilterActive(filter: TaskFilter): boolean;
|
|
39
|
-
/** 从任务集推导去重后的项目名列表(过滤下拉选项),按 zh locale 排序。 */
|
|
40
19
|
export declare function distinctProjects(tasks: readonly TaskRecord[]): string[];
|
|
41
|
-
/** 从任务集推导去重后的标签列表(多选 chips 选项),按 zh locale 排序。 */
|
|
42
20
|
export declare function distinctTags(tasks: readonly TaskRecord[]): string[];
|
|
@@ -1,54 +1,15 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 看板列内分组/排序纯函数(T009 §12.10,D10)。
|
|
3
|
-
*
|
|
4
|
-
* - 排序视图模式(看板顶部切换,会话级记忆、刷新重置):手动顺序(默认,完全按
|
|
5
|
-
* order)/ 按项目分组 / 按标签分组;
|
|
6
|
-
* - 分组是视图层能力,不改底层 order 与归属数据(归属变更经 reorder/update 落账);
|
|
7
|
-
* - 按项目分组:组头 = 项目名,无 `project` 的任务归「未分类」组,组内按 order
|
|
8
|
-
* 升序;按标签分组:组头 = 标签,任务按全部 `tags` 多归组展示(一个任务可出现
|
|
9
|
-
* 在多个标签组),无标签任务归「未分类」组,组内按 order 升序;
|
|
10
|
-
* - 排序必须与 Host 端 transitions.byOrderStable 完全一致(order 升序,
|
|
11
|
-
* createdAt/id 决胜),否则浏览器计算的落位下标与 Host 重算不一致;
|
|
12
|
-
* - 全部为纯函数(无 fs、无 DOM、无运行时依赖),可脱离宿主单测
|
|
13
|
-
* (验收 3:分组视图过滤/归组逻辑)。
|
|
14
|
-
*/
|
|
15
1
|
import type { TaskRecord } from '../core/model.ts';
|
|
16
|
-
/** 排序视图模式(§12.10:看板顶部切换,会话级记忆、刷新重置)。 */
|
|
17
2
|
export type GroupMode = 'manual' | 'project' | 'tag';
|
|
18
|
-
/** 全部模式(顶部切换按钮按此顺序渲染)。 */
|
|
19
3
|
export declare const GROUP_MODES: readonly GroupMode[];
|
|
20
|
-
/**
|
|
21
|
-
* 「未分类」组的哨兵 key。项目名/标签经 trim 后非空(normalizeOptionalString /
|
|
22
|
-
* normalizeTags 丢弃空白项),空串不可能与真实归属冲突,安全用作哨兵。
|
|
23
|
-
*/
|
|
24
4
|
export declare const UNGROUPED = "";
|
|
25
|
-
/** 一个分组(组头 = label;组内任务按 order 升序)。 */
|
|
26
5
|
export interface TaskGroup {
|
|
27
|
-
/** 稳定 key:项目名 / 标签名 / UNGROUPED(未分类)。 */
|
|
28
6
|
key: string;
|
|
29
|
-
/** 展示名(未分类由调用方渲染为「未分类」文案)。 */
|
|
30
7
|
label: string;
|
|
31
8
|
tasks: TaskRecord[];
|
|
32
9
|
}
|
|
33
|
-
/** 与 Host transitions.byOrderStable 一致的列内排序(order 升序,createdAt/id 决胜)。 */
|
|
34
10
|
export declare function byOrderStable(a: TaskRecord, b: TaskRecord): number;
|
|
35
|
-
/** 列内任务按 order 升序排序(原数组不改动)。 */
|
|
36
11
|
export declare function sortByOrder(tasks: readonly TaskRecord[]): TaskRecord[];
|
|
37
|
-
/** 任务在给定视图模式下的组 key(手动模式无组概念,返回 undefined)。 */
|
|
38
12
|
export declare function groupKeyOf(task: TaskRecord, mode: GroupMode): string | undefined;
|
|
39
|
-
/** 任务是否属于某个组(按模式解释 key:项目精确匹配 / 标签命中 / 未分类无归属)。 */
|
|
40
13
|
export declare function groupContains(task: TaskRecord, groupKey: string, mode: GroupMode): boolean;
|
|
41
|
-
/**
|
|
42
|
-
* 拖拽目标组的归属变换(视图层预览用,与提交的 reorder 归属补丁一致,§12.10):
|
|
43
|
-
* - 按项目分组:拖到组 G → project = G;拖到「未分类」→ 清除 project;
|
|
44
|
-
* - 按标签分组:拖到组 G → G 成为首选标签(tags[0],G 已含于 tags 时仅调整顺序);
|
|
45
|
-
* 拖到「未分类」→ 移除首选标签(tags.shift(),若 tags 为空则归「未分类」);
|
|
46
|
-
* - 手动模式或非组落位 → 原样返回。
|
|
47
|
-
*/
|
|
48
14
|
export declare function applyOwnershipTransform(task: TaskRecord, groupKey: string | undefined, mode: GroupMode): TaskRecord;
|
|
49
|
-
/**
|
|
50
|
-
* 分组(§12.10):项目/标签模式下的归组展示,组内按 order 升序;标签模式多归组
|
|
51
|
-
* (一个任务可出现在其全部标签组),无标签归「未分类」;未分类组恒在最后。
|
|
52
|
-
* 手动模式不分组(调用方直接 sortByOrder)。
|
|
53
|
-
*/
|
|
54
15
|
export declare function groupTasks(tasks: readonly TaskRecord[], mode: Exclude<GroupMode, 'manual'>): TaskGroup[];
|
|
@@ -1,58 +1,20 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 浏览器 ↔ Host 的同源传输层(T004 §11.1/§11.3/§12 实时同步)。
|
|
3
|
-
*
|
|
4
|
-
* 三个端点(与 T003 host-routes 一一对应):
|
|
5
|
-
* - `GET /api/nova-task-board/state` 全量快照(含 tasks),`no-store` 防缓存;
|
|
6
|
-
* - `POST /api/nova-task-board/action` 幂等信封 `{requestId, action}`,返回新快照;
|
|
7
|
-
* - `GET /api/nova-task-board/events` SSE 只推 `{revision, scheduler, power}`
|
|
8
|
-
* (15s 心跳),revision 变化才由控制器重拉 state。
|
|
9
|
-
*
|
|
10
|
-
* 同步契约(§17 一致性):浏览器不先写未确认状态——本层只是传输,动作是否生效
|
|
11
|
-
* 以 Host 返回的快照为准;SSE 连接中断时浏览器 EventSource 自动重连,重连成功
|
|
12
|
-
* (onopen)与页面重新可见(visibilitychange → visible)都会触发一次全量重拉。
|
|
13
|
-
*
|
|
14
|
-
* v1 迁移(§11.2 import / §9.5):首次加载若本地仍有 v1 回退数据且尚未导入
|
|
15
|
-
* 本项目账本(按 ledgerId 记 marker),则用一次性 sourceId/requestId 提交
|
|
16
|
-
* `import` action;marker 只在 Host 确认(返回快照)后写入,原 v1 值永不删除。
|
|
17
|
-
* 迁移键用本项目专属前缀 `dsh.novaTaskBoard.*`,避免与参考实现自己的
|
|
18
|
-
* `dsh.taskBoard.v2.*` 迁移标记互踩(AGENTS.md D2/D3)。
|
|
19
|
-
*/
|
|
20
1
|
import type { TaskRecord } from '../core/model.ts';
|
|
21
2
|
import { type TaskBoardAction, type TaskBoardEventPayload, type TaskBoardSnapshot } from '../protocol.ts';
|
|
22
|
-
/** 单次 Host 请求超时(§17 性能边界;超时按传输错误暴露,可重试)。 */
|
|
23
3
|
export declare const REQUEST_TIMEOUT_MS = 15000;
|
|
24
|
-
/**
|
|
25
|
-
* Host 业务拒绝(HTTP 4xx,§11.1):与传输层错误区分——业务拒绝由操作修正,
|
|
26
|
-
* 重试无意义;错误条据此**不显示「重试连接 Host」**,只对传输失败(网络/
|
|
27
|
-
* 超时/解析)保留重试入口(board-controller 按 instanceof 判定 retryable)。
|
|
28
|
-
*/
|
|
29
4
|
export declare class TaskBoardRequestError extends Error {
|
|
30
5
|
readonly status: number;
|
|
31
6
|
constructor(message: string, status: number);
|
|
32
7
|
}
|
|
33
|
-
/** 浏览器存储的读写面(localStorage;测试注入 fake)。 */
|
|
34
8
|
export interface MarkerStorage {
|
|
35
9
|
getItem(key: string): string | null;
|
|
36
10
|
setItem(key: string, value: string): void;
|
|
37
11
|
}
|
|
38
|
-
/** 传输层对外契约:控制器只依赖这四个方法(结构面,测试可注入 fake)。 */
|
|
39
12
|
export interface TaskBoardHostTransport {
|
|
40
|
-
/** 首次同步:先拉全量 state,必要时顺带做一次 v1 一次性迁移(§11.2 import)。 */
|
|
41
13
|
bootstrap(legacy: readonly TaskRecord[]): Promise<TaskBoardSnapshot>;
|
|
42
|
-
/** 全量快照。 */
|
|
43
14
|
state(): Promise<TaskBoardSnapshot>;
|
|
44
|
-
/** 提交幂等动作,返回 Host 确认后的新快照(不先写未确认状态)。 */
|
|
45
15
|
action(action: TaskBoardAction): Promise<TaskBoardSnapshot>;
|
|
46
|
-
/**
|
|
47
|
-
* 订阅实时事件。listener 带载荷 = SSE 帧(revision/scheduler/power);不带
|
|
48
|
-
* 载荷 = 同步信号(重连成功/页面重新可见),控制器据此重拉全量。
|
|
49
|
-
*/
|
|
50
16
|
subscribe(listener: (event?: TaskBoardEventPayload) => void): () => void;
|
|
51
17
|
}
|
|
52
|
-
/**
|
|
53
|
-
* 真实 HTTP + SSE 传输(同源 `/api/nova-task-board/*`)。
|
|
54
|
-
* @param markers - 迁移标记存储(缺省用全局 localStorage)。
|
|
55
|
-
*/
|
|
56
18
|
export declare class HttpTaskBoardHostTransport implements TaskBoardHostTransport {
|
|
57
19
|
private readonly markers;
|
|
58
20
|
constructor(markers?: MarkerStorage | undefined);
|
|
@@ -60,12 +22,6 @@ export declare class HttpTaskBoardHostTransport implements TaskBoardHostTranspor
|
|
|
60
22
|
state(): Promise<TaskBoardSnapshot>;
|
|
61
23
|
action(action: TaskBoardAction): Promise<TaskBoardSnapshot>;
|
|
62
24
|
private post;
|
|
63
|
-
/** 同源 fetch,带超时(超时按传输错误抛,控制器转为可重试的错误条)。 */
|
|
64
25
|
private request;
|
|
65
|
-
/**
|
|
66
|
-
* SSE 订阅:消息帧解析为 `{revision, scheduler, power}`(解析失败按同步信号
|
|
67
|
-
* 处理,重拉兜底);`onopen`(含断线重连成功)与页面重新可见 → 同步信号,
|
|
68
|
-
* 控制器据此重拉全量 state。
|
|
69
|
-
*/
|
|
70
26
|
subscribe(listener: (event?: TaskBoardEventPayload) => void): () => void;
|
|
71
27
|
}
|
|
@@ -3,19 +3,10 @@ import type { ClientContext } from '@deepseek-ai/dsh-client-runtime/client';
|
|
|
3
3
|
import { type NovaPluginsKey, type NovaTaskBoardKey } from './locales.ts';
|
|
4
4
|
declare module '@deepseek-ai/dsh-client-ui-slots' {
|
|
5
5
|
interface LocaleNamespaceMap {
|
|
6
|
-
/** Nova task-board surface copy. */
|
|
7
6
|
'nova-task-board': NovaTaskBoardKey;
|
|
8
|
-
/** Locale copy of the "Nova 插件" settings section heading/lede. */
|
|
9
7
|
'nova-plugins': NovaPluginsKey;
|
|
10
8
|
}
|
|
11
9
|
interface SlotMap {
|
|
12
|
-
/**
|
|
13
|
-
* The child slot the "Nova 插件" section declares. The dsh-nova-ui family
|
|
14
|
-
* plugins contribute their configuration cards here — NOT into the
|
|
15
|
-
* reference `web-ui.plugin.item` child of the "Web UI 插件" group, which
|
|
16
|
-
* `@linxin666/dsh-web-ui` owns (AGENTS.md D4). Spelled here with the same
|
|
17
|
-
* shape so this package can register without depending on the group plugin.
|
|
18
|
-
*/
|
|
19
10
|
'nova.plugin.item': {
|
|
20
11
|
kind: 'list';
|
|
21
12
|
scope: 'root';
|
|
@@ -23,27 +14,15 @@ declare module '@deepseek-ai/dsh-client-ui-slots' {
|
|
|
23
14
|
};
|
|
24
15
|
}
|
|
25
16
|
}
|
|
26
|
-
/** Owner share of a plugin card (the section supplies nothing). */
|
|
27
17
|
export interface NovaPluginItemOwnerProps {
|
|
28
|
-
/** Marker field: card owner props are intentionally empty. */
|
|
29
18
|
children?: never;
|
|
30
19
|
}
|
|
31
20
|
declare module '@deepseek-ai/cordis' {
|
|
32
21
|
interface Context {
|
|
33
|
-
/**
|
|
34
|
-
* Optional rc.6 compatibility binder provided by dsh-web-ui-settings;
|
|
35
|
-
* absent when that group plugin is not installed, so callers fall back to
|
|
36
|
-
* the official settings scope.
|
|
37
|
-
*/
|
|
38
22
|
webUiSettings?: {
|
|
39
23
|
bind<S>(spec: SettingsScopeSpec<S>): SettingsScope<S>;
|
|
40
24
|
};
|
|
41
25
|
}
|
|
42
26
|
}
|
|
43
|
-
/** Required services (fiber inject waiting — the runtime must be up first). */
|
|
44
27
|
export declare const inject: readonly ["slots", "sessions", "workspaces", "connection", "settingsScope", "locale", "remote"];
|
|
45
|
-
/**
|
|
46
|
-
* Mount the nova task board (T004 真实看板).
|
|
47
|
-
* @param ctx - client root context.
|
|
48
|
-
*/
|
|
49
28
|
export declare function apply(ctx: ClientContext): void;
|
|
@@ -1,28 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* v1 只读回退数据读取(T004 §12 范围项 8:UI 层对 v1 只读回退数据可正常展示)。
|
|
3
|
-
*
|
|
4
|
-
* 参考实现的旧浏览器账本写在 localStorage `dsh.taskBoard.v1`(键名由其
|
|
5
|
-
* `DEFAULT_STORAGE_KEY` 定义,与宿主/参考实现共享同一浏览器源)。本项目与其
|
|
6
|
-
* 共存(AGENTS.md D3):读取该键做一次性迁移,但**绝不删除原值**——迁移后它
|
|
7
|
-
* 仍是只读回退副本;迁移经 Host 的 `import` action 落进本项目自己的账本
|
|
8
|
-
* (`$DSH_HOME/nova-ui/task-board/`,AGENTS.md D2),写入方只有 Host。
|
|
9
|
-
*
|
|
10
|
-
* 行解析走本项目 core/model 的 `normalizeTask`(宽松归一化:未知字段剥离、
|
|
11
|
-
* 状态回退 todo、坏 schedule 修复或丢弃、不丢行),单条坏行被丢弃而不阻断
|
|
12
|
-
* 整批——Host 侧 `import` 是严格逐行校验,任何坏行都会让整批 import 被拒,
|
|
13
|
-
* 所以浏览器侧先做一次宽松过滤,保证一条陈旧坏数据不阻断迁移。
|
|
14
|
-
*/
|
|
15
1
|
import type { TaskRecord } from '../core/model.ts';
|
|
16
|
-
/** 参考实现的 v1 浏览器账本键(只读来源;其内部键名 `dsh.taskBoard.v1`)。 */
|
|
17
2
|
export declare const LEGACY_V1_STORAGE_KEY = "dsh.taskBoard.v1";
|
|
18
|
-
/** 浏览器 localStorage 的读取面(测试注入 fake)。 */
|
|
19
3
|
export interface LegacyStorage {
|
|
20
4
|
getItem(key: string): string | null;
|
|
21
5
|
}
|
|
22
|
-
/**
|
|
23
|
-
* 读取并宽松归一化 v1 回退数据。存储缺失/损坏/非数组 → [](降级为空账本,
|
|
24
|
-
* 绝不抛错拖垮看板启动);数组内逐行 normalizeTask,坏行丢弃。
|
|
25
|
-
* @param storage - 存储面(缺省用全局 localStorage;非浏览器环境为 undefined → [])。
|
|
26
|
-
* @param key - 覆盖存储键(测试用)。
|
|
27
|
-
*/
|
|
28
6
|
export declare function readLegacyV1Tasks(storage?: LegacyStorage | undefined, key?: string): TaskRecord[];
|
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Nova task-board copy: zh-first dictionaries with an English fallback,
|
|
3
|
-
* selected by the document language. Kept dependency-free (no dsh locale
|
|
4
|
-
* service) so the DOM-injected entry row and the standalone board tree share
|
|
5
|
-
* one tiny lookup. Key set 以 zh 为准,en 对齐(对齐参考实现的组织方式)。
|
|
6
|
-
*
|
|
7
|
-
* T004 补全看板/详情/新建/状态/执行设置文案;定时编辑器(T006/T007)与
|
|
8
|
-
* 待确认列(T011)的编辑/确认文案随对应任务补充。
|
|
9
|
-
*/
|
|
10
|
-
/** zh dictionary (key-set source of truth). */
|
|
11
1
|
export declare const zh: {
|
|
12
2
|
'entry.label': string;
|
|
13
3
|
'board.title': string;
|
|
@@ -200,25 +190,13 @@ export declare const zh: {
|
|
|
200
190
|
'settings.notExposed': string;
|
|
201
191
|
'settings.readOnly': string;
|
|
202
192
|
};
|
|
203
|
-
/** en dictionary, complete against the zh key set. */
|
|
204
193
|
export declare const en: Record<keyof typeof zh, string>;
|
|
205
|
-
/** The dictionary key union. */
|
|
206
194
|
export type NovaTaskBoardKey = keyof typeof zh;
|
|
207
|
-
/** Active dictionary, picked by the document language at call time. */
|
|
208
195
|
export declare function dictionary(): Record<NovaTaskBoardKey, string>;
|
|
209
|
-
/** Translate a key with optional {name} template params. */
|
|
210
196
|
export declare function t(key: NovaTaskBoardKey, params?: Record<string, string>): string;
|
|
211
|
-
/**
|
|
212
|
-
* Locale dictionary for the "Nova 插件" settings section (the first-level nav
|
|
213
|
-
* entry that hosts the dsh-nova-ui family plugin cards). Kept as its own
|
|
214
|
-
* namespace (`nova-plugins`) so the section copy never collides with the
|
|
215
|
-
* task-board card's `nova-task-board` namespace (AGENTS.md D4). Key set 以 zh 为准。
|
|
216
|
-
*/
|
|
217
197
|
export declare const groupZh: {
|
|
218
198
|
title: string;
|
|
219
199
|
description: string;
|
|
220
200
|
};
|
|
221
|
-
/** en dictionary, complete against the groupZh key set. */
|
|
222
201
|
export declare const groupEn: Record<keyof typeof groupZh, string>;
|
|
223
|
-
/** The "Nova 插件" section dictionary key union. */
|
|
224
202
|
export type NovaPluginsKey = keyof typeof groupZh;
|
|
@@ -1,20 +1,11 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 定时编辑器共享预设(T006 §12.3 cron 周期定时「预设」下拉 + T007 §12.3 一次性
|
|
3
|
-
* 计划「快捷预设」):cron 表达式 → locale 文案键;one-shot 快捷预设 → 相对
|
|
4
|
-
* 当前时刻的计算函数(Host 本地时区)。详情页定时编辑器共用。
|
|
5
|
-
*/
|
|
6
1
|
import type { NovaTaskBoardKey } from './locales.ts';
|
|
7
|
-
/** 常用 cron 定时预设(cron → locale label)。 */
|
|
8
2
|
export declare const SCHEDULE_PRESETS: ReadonlyArray<{
|
|
9
3
|
cron: string;
|
|
10
4
|
label: NovaTaskBoardKey;
|
|
11
5
|
}>;
|
|
12
|
-
/** 一次性计划快捷预设(T007 §12.3:label → 相对 now 的 runAt 计算)。 */
|
|
13
6
|
export declare const ONE_SHOT_PRESETS: ReadonlyArray<{
|
|
14
7
|
label: NovaTaskBoardKey;
|
|
15
8
|
at: (now: number) => number;
|
|
16
9
|
}>;
|
|
17
|
-
/** 本地毫秒时间戳 → `datetime-local` 输入值(YYYY-MM-DDTHH:mm,Host 本地时区)。 */
|
|
18
10
|
export declare function toLocalInputValue(ms: number): string;
|
|
19
|
-
/** `datetime-local` 输入值 → 本地毫秒时间戳(解析失败返回 undefined)。 */
|
|
20
11
|
export declare function fromLocalInputValue(value: string): number | undefined;
|
|
@@ -1,54 +1,21 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Nova sidebar entry injection core (adapted from the reference dsh-web-ui
|
|
3
|
-
* shared/client/sidebar-entry-core.ts; mechanism identical, attributes
|
|
4
|
-
* namespaced to data-dsh-nova-* for coexistence, AGENTS.md D3).
|
|
5
|
-
*
|
|
6
|
-
* dsh's sidebar shell exposes no slot an external plugin can register into,
|
|
7
|
-
* so the entry row is injected between the shell's New Session button and the
|
|
8
|
-
* workspace browser. The injection self-heals: a MutationObserver watches the
|
|
9
|
-
* sidebar root and re-inserts the row whenever a React re-render displaces it
|
|
10
|
-
* (re-insertion happens in the same frame, before paint, so no flicker).
|
|
11
|
-
*
|
|
12
|
-
* The row is plain DOM (no React tree) so it can never disturb the shell's
|
|
13
|
-
* reconciliation; the view it toggles is a separate root owned by the caller.
|
|
14
|
-
*/
|
|
15
|
-
/** Per-package configuration for one sidebar entry row. */
|
|
16
1
|
export interface NovaSidebarEntryOptions {
|
|
17
|
-
/** Full attribute name identifying the injected row (idempotency key). */
|
|
18
2
|
rowAttribute: string;
|
|
19
|
-
/** CSS selector matching the injected row. */
|
|
20
3
|
rowSelector: string;
|
|
21
|
-
/** L2 semantic-attribute plugin id (data-dsh-plugin value). */
|
|
22
4
|
plugin?: string;
|
|
23
|
-
/** Inline icon markup (matches the shell's 16px nav-icon look). */
|
|
24
5
|
icon: string;
|
|
25
|
-
/** CSS module class names for the row and its two spans (entry / entryIcon / entryLabel). */
|
|
26
6
|
css: Record<string, string>;
|
|
27
|
-
/** Localized row label (aria-label + visible text). */
|
|
28
7
|
label(): string;
|
|
29
|
-
/** Optional localized tooltip (title attribute). */
|
|
30
8
|
tooltip?(): string;
|
|
31
|
-
/** Click action (open/toggle the owning panel). */
|
|
32
9
|
onToggle(): void;
|
|
33
|
-
/** Family-block position: 'before' inserts ahead of sibling plugin rows, 'after' behind them. */
|
|
34
10
|
position: 'before' | 'after';
|
|
35
|
-
/** Selectors of the sibling plugin entry rows this package orders against (its own row included). */
|
|
36
11
|
familySelectors: readonly string[];
|
|
37
|
-
/** Optional active-state bridge; highlights the row while the panel is open. */
|
|
38
12
|
active?: {
|
|
39
13
|
subscribe(listener: () => void): () => void;
|
|
40
14
|
isOpen(): boolean;
|
|
41
15
|
};
|
|
42
|
-
/** Optional numeric badge (T011 §12.7 未确认候选数角标); hidden at 0. */
|
|
43
16
|
badge?: {
|
|
44
17
|
subscribe(listener: () => void): () => void;
|
|
45
18
|
count(): number;
|
|
46
19
|
};
|
|
47
20
|
}
|
|
48
|
-
/**
|
|
49
|
-
* Mount the sidebar entry, waiting for the shell to render and self-healing
|
|
50
|
-
* on later React re-renders.
|
|
51
|
-
* @param options - the row's attribute/icon/copy/action/ordering configuration.
|
|
52
|
-
* @returns disposer removing the entry and its observers.
|
|
53
|
-
*/
|
|
54
21
|
export declare function mountSidebarEntry(options: NovaSidebarEntryOptions): () => void;
|
|
@@ -1,19 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Sidebar entry injection — package-specific wiring over the shared core.
|
|
3
|
-
*
|
|
4
|
-
* The entry row is injected between the shell's New Session button and the
|
|
5
|
-
* workspace browser (data-dsh-nova-taskboard-entry, nova- 前缀与参考实现
|
|
6
|
-
* data-dsh-taskboard-entry 区分,见 AGENTS.md D3)。The row is plain DOM (no
|
|
7
|
-
* React tree); the board view it toggles is a separate React root mounted in
|
|
8
|
-
* the center column (see board-mount.tsx).
|
|
9
|
-
*/
|
|
10
1
|
import type { BoardController } from './board-controller.ts';
|
|
11
|
-
/** Stable data attribute identifying the injected entry row. */
|
|
12
2
|
export declare const ENTRY_SELECTOR = "[data-dsh-nova-taskboard-entry]";
|
|
13
|
-
/**
|
|
14
|
-
* Mount the sidebar entry, waiting for the shell to render and self-healing
|
|
15
|
-
* on later React re-renders.
|
|
16
|
-
* @param controller - the board controller the entry toggles.
|
|
17
|
-
* @returns disposer removing the entry and its observers.
|
|
18
|
-
*/
|
|
19
3
|
export declare function mountSidebarEntry(controller: BoardController): () => void;
|
|
@@ -1,58 +1,19 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 上下文闭环与自动收集的纯函数(DSH-REQ-001 §14.3/§9.5,T010/P3)。
|
|
3
|
-
*
|
|
4
|
-
* 本模块只做「无副作用」的转换与判定,全部可脱离宿主单测:
|
|
5
|
-
* - **清洗(§14.3 安全红线)**:`sanitizeCollectedText` 剥离控制字符、封顶长度;
|
|
6
|
-
* 自动收集/评论内容一律先清洗再落账;
|
|
7
|
-
* - **人工审核闸门(§14.3)**:`isAutoCollected` 判定自动收集来源
|
|
8
|
-
* (github_issue / bookmark_collector);未 promote(仍在 backlog)前不可
|
|
9
|
-
* 执行/不可定时(守卫落在 transitions 层,见 canRunTask / set-schedule /
|
|
10
|
-
* set-one-shot);
|
|
11
|
-
* - **收集映射**:GitHub Issue / 书签条目 → 标准化的 backlog `TaskRecord`
|
|
12
|
-
* (source/metadata 写入,供去重与追溯);`collectorDedupKey`/`hasCollected`
|
|
13
|
-
* 提供按 (source, metadata.url) 的幂等去重;
|
|
14
|
-
* - **上下文注入(§14.3/§9.5,B5 调研落定)**:`composeInjectionContext` 只带
|
|
15
|
-
* 摘要 + 必要片段(goal/lastAiSummary/latestUserFeedback/relatedLinks),
|
|
16
|
-
* `CONTEXT_INJECTION_BUDGET` 给出逐字段与总量 token 预算;`composePrompt`
|
|
17
|
-
* 在有快照的任务 Prompt 尾部追加注入块——后续调用只使用摘要与必要片段,
|
|
18
|
-
* 不再把全量历史/描述灌给 agent。
|
|
19
|
-
*
|
|
20
|
-
* 收集器的 I/O(GitHub API 拉取、书签文件读取)与账本落账在 host-automation.ts
|
|
21
|
-
* / host-service.ts,本层只产出数据。
|
|
22
|
-
*/
|
|
23
1
|
import type { AutomationRule, TaskRecord, TaskSource } from './model.ts';
|
|
24
|
-
/** 自动收集来源(§14.3:只进 backlog,必须人工 promote 才可执行)。 */
|
|
25
2
|
export declare const AUTO_COLLECTED_SOURCES: readonly TaskSource[];
|
|
26
|
-
/** 是否自动收集来源(人工审核闸门的判据之一)。 */
|
|
27
3
|
export declare function isAutoCollected(task: Pick<TaskRecord, 'source'>): boolean;
|
|
28
|
-
/**
|
|
29
|
-
* 清洗文本(§14.3):剥离控制字符(保留 \n \t)、trim、长度封顶。
|
|
30
|
-
* 用于自动收集的标题/描述、评论正文等一切外部输入。
|
|
31
|
-
*/
|
|
32
4
|
export declare function sanitizeCollectedText(text: unknown, maxLength?: number): string;
|
|
33
|
-
/** 收集去重键(§14.1/14.2):同来源同 URL 视为同一条外部内容。 */
|
|
34
5
|
export declare function collectorDedupKey(source: TaskSource, metadata: Record<string, string> | undefined): string | undefined;
|
|
35
|
-
/** 账本中是否已存在同 (source, url) 的收集任务(去重判定,Host 落账前调用)。 */
|
|
36
6
|
export declare function hasCollected(tasks: readonly TaskRecord[], source: TaskSource, metadata: Record<string, string> | undefined): boolean;
|
|
37
|
-
/** GitHub 标签命中判定(§14.1 过滤器):规则标签非空时,Issue 至少命中一个(大小写不敏感)。 */
|
|
38
7
|
export declare function matchesGithubLabels(issueLabels: readonly string[] | undefined, ruleLabels: readonly string[]): boolean;
|
|
39
|
-
/** 从 Issue 载荷/API 响应的 labels 提取标签名数组(string 或 {name} 两种形态)。 */
|
|
40
8
|
export declare function issueLabelNames(issue: GithubIssueLike): string[];
|
|
41
|
-
/** 收集任务的最小输入面(title/description 已清洗,metadata 已归置)。 */
|
|
42
9
|
export interface CollectedTaskInput {
|
|
43
10
|
title: string;
|
|
44
11
|
description: string;
|
|
45
12
|
source: TaskSource;
|
|
46
13
|
metadata: Record<string, string>;
|
|
47
14
|
}
|
|
48
|
-
/**
|
|
49
|
-
* 由收集输入构造一条标准的 backlog 任务(§14.3:只进 backlog;prompt 回退用
|
|
50
|
-
* 标题——promote 到 todo 后执行即以标题为 Prompt;tags 默认 [] 待人工标注)。
|
|
51
|
-
*/
|
|
52
15
|
export declare function newCollectedTask(input: CollectedTaskInput, id: string, now: number, order: number): TaskRecord;
|
|
53
|
-
/** GitHub Issue 的最小结构面(webhook 载荷 / API 响应的共同子集)。 */
|
|
54
16
|
export interface GithubIssueLike {
|
|
55
|
-
/** Issue 编号(webhook 恒有;API 恒有)。 */
|
|
56
17
|
number?: number;
|
|
57
18
|
title?: string;
|
|
58
19
|
html_url?: string;
|
|
@@ -61,7 +22,6 @@ export interface GithubIssueLike {
|
|
|
61
22
|
name?: string;
|
|
62
23
|
} | string>;
|
|
63
24
|
}
|
|
64
|
-
/** GitHub webhook `issues` 事件载荷的最小结构面(§14.1)。 */
|
|
65
25
|
export interface GithubWebhookIssuePayload {
|
|
66
26
|
action?: string;
|
|
67
27
|
issue?: GithubIssueLike;
|
|
@@ -69,60 +29,26 @@ export interface GithubWebhookIssuePayload {
|
|
|
69
29
|
full_name?: string;
|
|
70
30
|
};
|
|
71
31
|
}
|
|
72
|
-
/**
|
|
73
|
-
* 严格解析 GitHub webhook `issues` 事件载荷(§14.1):只消费已知字段、未知
|
|
74
|
-
* 字段剥离(载荷为外部输入,永不被解释为任务字段);结构非法返回 undefined。
|
|
75
|
-
* 收集内容(标题/正文)在映射时经 sanitizeCollectedText 清洗(§14.3)。
|
|
76
|
-
*/
|
|
77
32
|
export declare function parseGithubWebhookPayload(value: unknown): GithubWebhookIssuePayload | undefined;
|
|
78
|
-
/**
|
|
79
|
-
* GitHub Issue → 收集任务输入(§14.1):标题/描述清洗、来源链接等写入
|
|
80
|
-
* metadata(url/externalId/repo/labels),供去重与追溯。
|
|
81
|
-
*/
|
|
82
33
|
export declare function githubIssueToCollectedTaskInput(issue: GithubIssueLike, repo: string | undefined): CollectedTaskInput;
|
|
83
|
-
/** 书签收件箱条目(§14.2:JSONL 一行一条;浏览器书签导出/手动维护均可)。 */
|
|
84
34
|
export interface BookmarkEntry {
|
|
85
35
|
title?: string;
|
|
86
36
|
url?: string;
|
|
87
37
|
note?: string;
|
|
88
38
|
}
|
|
89
|
-
/** 书签条目 → 收集任务输入(§14.2):URL 缺失丢弃;标题回退用 URL。 */
|
|
90
39
|
export declare function bookmarkEntryToCollectedTaskInput(entry: BookmarkEntry): CollectedTaskInput | undefined;
|
|
91
|
-
/** 解析书签收件箱文件(JSONL:每行一个 JSON 对象;空行/非法行跳过)。 */
|
|
92
40
|
export declare function parseBookmarkEntries(content: string): BookmarkEntry[];
|
|
93
|
-
/**
|
|
94
|
-
* 注入 token 预算(B5 调研结论:Host 侧摘取 + 固定预算,避免把全量上下文灌给
|
|
95
|
-
* agent)。逐字段上限 + 注入块总量上限(约 400 token,中文按 0.6 token/字)。
|
|
96
|
-
*/
|
|
97
41
|
export declare const CONTEXT_INJECTION_BUDGET: {
|
|
98
|
-
/** goal 上限(字符)。 */
|
|
99
42
|
readonly goalMax: 200;
|
|
100
|
-
/** lastAiSummary 上限(字符)。 */
|
|
101
43
|
readonly summaryMax: 600;
|
|
102
|
-
/** latestUserFeedback 上限(字符)。 */
|
|
103
44
|
readonly feedbackMax: 300;
|
|
104
|
-
/** relatedLinks 合计上限(字符)。 */
|
|
105
45
|
readonly linksMax: 400;
|
|
106
|
-
/** 注入块总量上限(字符)。 */
|
|
107
46
|
readonly totalMax: 1500;
|
|
108
47
|
};
|
|
109
|
-
/** 任务最近一条 user_feedback 评论的正文(供快照 latestUserFeedback)。 */
|
|
110
48
|
export declare function latestUserFeedback(task: TaskRecord): string | undefined;
|
|
111
|
-
/** 截断文本到上限(中文友好:按字符计)。 */
|
|
112
49
|
export declare function truncateText(text: string, max: number): string;
|
|
113
|
-
/**
|
|
114
|
-
* 组合注入块(B5):只带摘要与必要片段——goal / lastAiSummary /
|
|
115
|
-
* latestUserFeedback / relatedLinks,逐字段按预算截断,总量再封顶。
|
|
116
|
-
* 快照不存在或无可注入内容时返回 undefined(不追加注入)。
|
|
117
|
-
*/
|
|
118
50
|
export declare function composeInjectionContext(task: TaskRecord): string | undefined;
|
|
119
|
-
/**
|
|
120
|
-
* 执行 Prompt 合成(B5 落定,runner.launch 使用):基线为任务 Prompt(空则
|
|
121
|
-
* 回退标题);任务有上下文快照时在尾部追加注入块——后续调用只使用摘要与
|
|
122
|
-
* 必要片段。无快照的任务行为与 T005 完全一致(不影响既有执行语义)。
|
|
123
|
-
*/
|
|
124
51
|
export declare function composePrompt(task: TaskRecord): string;
|
|
125
|
-
/** 快照字段可注入子集(service 结算时由 Host 合成更新,见 host-service.ts)。 */
|
|
126
52
|
export interface ContextSnapshotPatch {
|
|
127
53
|
goal?: string;
|
|
128
54
|
keyDecisions?: string[];
|
|
@@ -131,9 +57,6 @@ export interface ContextSnapshotPatch {
|
|
|
131
57
|
latestUserFeedback?: string;
|
|
132
58
|
relatedLinks?: string[];
|
|
133
59
|
}
|
|
134
|
-
/** 从快照补丁构造 Host 侧结算后快照更新(B5:只覆盖可注入字段)。 */
|
|
135
60
|
export declare function contextPatchFromSettle(task: TaskRecord, lastAiSummary: string | undefined): ContextSnapshotPatch;
|
|
136
|
-
/** 上下文快照的数组字段归一化(跨模块共用:去空、去重、封顶)。 */
|
|
137
61
|
export declare function normalizeSnapshotList(value: readonly string[] | undefined): string[];
|
|
138
|
-
/** 从 AutomationRule 读取收集来源配置(带默认值)。 */
|
|
139
62
|
export declare function ruleConfig(rule: AutomationRule, key: string, fallback?: string): string | undefined;
|