nx-kv 0.65.2 → 0.65.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/package.json +1 -1
  3. package/src/core/db/settings.ts +1 -1
  4. package/src/core/instruction-template.ts +1 -1
  5. package/src/core/workflow/plugin-registry.ts +1 -1
  6. package/src/core/workflow/types.ts +4 -4
  7. package/src/modules/claim/actions/_manifest.generated.ts +23 -0
  8. package/src/modules/{localtask → claim}/actions/localtask-claim.ts +4 -4
  9. package/src/modules/{localtask → claim}/actions/localtask-preview.ts +4 -4
  10. package/src/modules/{localtask → claim}/actions/localtask-wait.ts +4 -4
  11. package/src/modules/{tasktool → claim}/get.ts +2 -2
  12. package/src/modules/claim/index.ts +25 -0
  13. package/src/modules/{tasktool → claim}/panel-escort.ts +2 -2
  14. package/src/modules/{tasktool → claim}/params.ts +1 -1
  15. package/src/modules/{tasktool → claim}/wait.ts +5 -5
  16. package/src/modules/{tasktool/plugins → claim}/waitgoal-config.ts +3 -3
  17. package/src/modules/{promptplug/delivery.ts → delivery/assemble.ts} +5 -5
  18. package/src/modules/{tasktool → delivery}/attach-resource.ts +2 -2
  19. package/src/modules/{tasktool → delivery}/attach-template.ts +1 -1
  20. package/src/modules/{tasktool → delivery}/attach.ts +1 -1
  21. package/src/modules/{tasktool → delivery}/delivery-text.ts +2 -2
  22. package/src/modules/{tasktool → delivery}/doc-inline.ts +1 -1
  23. package/src/modules/{tasktool → delivery}/groupctx.ts +1 -1
  24. package/src/modules/{tasktool/delivery.ts → delivery/host.ts} +4 -4
  25. package/src/modules/delivery/index.ts +18 -0
  26. package/src/modules/{tasktool → delivery}/preview.ts +4 -4
  27. package/src/modules/{tasktool → goals}/actions/timegoal-check.ts +1 -1
  28. package/src/modules/{tasktool → goals}/actions/timegoal-clear.ts +1 -1
  29. package/src/modules/{tasktool → goals}/actions/timegoal-list.ts +1 -1
  30. package/src/modules/{tasktool → goals}/actions/timegoal-log.ts +1 -1
  31. package/src/modules/{tasktool → goals}/actions/timegoal-set.ts +1 -1
  32. package/src/modules/{tasktool → goals}/actions/timegoal-show.ts +1 -1
  33. package/src/modules/{tasktool → goals}/actions/timegoal-update.ts +1 -1
  34. package/src/modules/goals/index.ts +25 -0
  35. package/src/modules/{tasktool → goals}/plugins/discover.ts +3 -3
  36. package/src/modules/{tasktool → goals}/plugins/index.ts +0 -2
  37. package/src/modules/{tasktool → goals}/plugins/taskgoal-store.ts +2 -2
  38. package/src/modules/localtask/action-render.ts +1 -1
  39. package/src/modules/localtask/actions/_manifest.generated.ts +0 -9
  40. package/src/modules/localtask/actions/localtask-add.ts +2 -2
  41. package/src/modules/localtask/actions/localtask-attach-note.ts +1 -1
  42. package/src/modules/localtask/actions/localtask-attach.ts +1 -1
  43. package/src/modules/localtask/actions/localtask-attachments.ts +1 -1
  44. package/src/modules/localtask/actions/localtask-detach.ts +1 -1
  45. package/src/modules/localtask/actions/localtask-get.ts +1 -1
  46. package/src/modules/localtask/actions/localtask-reopen.ts +1 -1
  47. package/src/modules/localtask/actions/localtask-timegoalLog.ts +1 -1
  48. package/src/modules/localtask/actions/localtask-update.ts +2 -2
  49. package/src/modules/{tasktool → localtask}/add.ts +3 -3
  50. package/src/modules/localtask/engine.ts +1 -1
  51. package/src/modules/{tasktool → localtask}/group-store.ts +2 -2
  52. package/src/modules/localtask/mutator/index.ts +1 -1
  53. package/src/modules/localtask/panel-presence.ts +2 -2
  54. package/src/modules/localtask/scheduler/state-drive.ts +1 -1
  55. package/src/modules/{tasktool → localtask}/support.ts +1 -1
  56. package/src/modules/localtask/task-lifecycle.ts +4 -4
  57. package/src/modules/localtask/task-ops.ts +1 -1
  58. package/src/modules/localtask/task-templates.ts +1 -1
  59. package/src/modules/localtask/task-view.ts +1 -1
  60. package/src/modules/{tasktool → localtask}/update.ts +1 -1
  61. package/src/modules/localtask/waiters.ts +1 -1
  62. package/src/modules/localtask/writes.ts +1 -1
  63. package/src/modules/promptplug/factory.ts +2 -2
  64. package/src/modules/promptplug/index.ts +4 -6
  65. package/src/modules/promptplug/plugins/attachment.ts +1 -1
  66. package/src/modules/promptplug/plugins/context.ts +1 -1
  67. package/src/modules/promptplug/plugins/goal-prompt.ts +1 -1
  68. package/src/modules/repos/service/crud.ts +1 -1
  69. package/src/runtime/registry.ts +6 -2
  70. package/src/web/frontend/api/cli-tree.json +138 -138
  71. package/src/web/frontend/api/client.generated.ts +90 -88
  72. package/src/core/workflow/edges.ts +0 -28
  73. package/src/core/workflow/layout.ts +0 -118
  74. package/src/modules/tasktool/facade/get.ts +0 -54
  75. package/src/modules/tasktool/facade/index.ts +0 -4
  76. package/src/modules/tasktool/facade/submit.ts +0 -61
  77. package/src/modules/tasktool/facade/wait.ts +0 -3
  78. package/src/modules/tasktool/getloop.ts +0 -2
  79. package/src/modules/tasktool/index.ts +0 -24
  80. package/src/modules/tasktool/plugins/runtime.ts +0 -73
  81. package/src/modules/tasktool/plugins/waitgoal.ts +0 -71
  82. /package/src/modules/{tasktool → goals}/actions/_manifest.generated.ts +0 -0
  83. /package/src/modules/{tasktool → goals}/actions/timegoal-prune.ts +0 -0
  84. /package/src/modules/{tasktool → goals}/plugins/base.ts +0 -0
  85. /package/src/modules/{tasktool → goals}/plugins/blockgoal.ts +0 -0
  86. /package/src/modules/{tasktool → goals}/plugins/container.ts +0 -0
  87. /package/src/modules/{tasktool → goals}/plugins/taskgoal.ts +0 -0
  88. /package/src/modules/{tasktool → goals}/plugins/timegoal-core-store.ts +0 -0
  89. /package/src/modules/{tasktool → goals}/plugins/timegoal-cwd-store.ts +0 -0
  90. /package/src/modules/{tasktool → goals}/plugins/timegoal-store.ts +0 -0
  91. /package/src/modules/{tasktool → goals}/plugins/timegoal-task-store.ts +0 -0
  92. /package/src/modules/{tasktool → goals}/plugins/timegoal.ts +0 -0
  93. /package/src/modules/{tasktool → goals}/taskgoal.ts +0 -0
  94. /package/src/modules/{tasktool → goals}/timegoal.ts +0 -0
@@ -1,7 +1,7 @@
1
1
  // action 的人读输出(render)函数(自 index.js 拆出):CLI 与 HTTP 共用同一份措辞。
2
2
  // STATUS_TAG 来自同构词表(src/shared/task-status.js):CLI 与面板共用一份措辞。
3
3
  import { STATUS_TAG } from '../../shared/task-status.js';
4
- import { deliveryBodyText } from '../tasktool/delivery-text.js';
4
+ import { deliveryBodyText } from '../delivery/delivery-text.js';
5
5
 
6
6
  // 渲染入参都是 action 结果对象(HTTP/CLI body 透传)→ any。
7
7
  export type RenderInput = any;
@@ -14,7 +14,6 @@ import { LocaltaskBoardTasksAction } from './localtask-boardtasks.js';
14
14
  import { LocaltaskCancelAction } from './localtask-cancel.js';
15
15
  import { LocaltaskCancelManyAction } from './localtask-cancelMany.js';
16
16
  import { LocaltaskChainAction } from './localtask-chain.js';
17
- import { LocaltaskClaimAction } from './localtask-claim.js';
18
17
  import { LocaltaskCloneAction } from './localtask-clone.js';
19
18
  import { LocaltaskCloseManyAction } from './localtask-closeMany.js';
20
19
  import { LocaltaskConfigAction } from './localtask-config.js';
@@ -26,7 +25,6 @@ import { LocaltaskGetAction } from './localtask-get.js';
26
25
  import { LocaltaskListAction } from './localtask-list.js';
27
26
  import { LocaltaskPlanAction } from './localtask-plan.js';
28
27
  import { LocaltaskPresenceAction } from './localtask-presence.js';
29
- import { LocaltaskPreviewAction } from './localtask-preview.js';
30
28
  import { LocaltaskPruneAction } from './localtask-prune.js';
31
29
  import { LocaltaskRemoveAction } from './localtask-remove.js';
32
30
  import { LocaltaskRemoveManyAction } from './localtask-removeMany.js';
@@ -39,7 +37,6 @@ import { LocaltaskTopicAddAction } from './localtask-topic-add.js';
39
37
  import { LocaltaskTopicRemoveAction } from './localtask-topic-remove.js';
40
38
  import { LocaltaskTopicRemoveManyAction } from './localtask-topic-removeMany.js';
41
39
  import { LocaltaskUpdateAction } from './localtask-update.js';
42
- import { LocaltaskWaitAction } from './localtask-wait.js';
43
40
 
44
41
  /** 本模块的全部 action 类(容器按这个顺序建实例)。 */
45
42
  export const ACTIONS: readonly (new (deps: Container) => ActionBase)[] = [
@@ -51,7 +48,6 @@ export const ACTIONS: readonly (new (deps: Container) => ActionBase)[] = [
51
48
  LocaltaskCancelAction,
52
49
  LocaltaskCancelManyAction,
53
50
  LocaltaskChainAction,
54
- LocaltaskClaimAction,
55
51
  LocaltaskCloneAction,
56
52
  LocaltaskCloseManyAction,
57
53
  LocaltaskConfigAction,
@@ -63,7 +59,6 @@ export const ACTIONS: readonly (new (deps: Container) => ActionBase)[] = [
63
59
  LocaltaskListAction,
64
60
  LocaltaskPlanAction,
65
61
  LocaltaskPresenceAction,
66
- LocaltaskPreviewAction,
67
62
  LocaltaskPruneAction,
68
63
  LocaltaskRemoveAction,
69
64
  LocaltaskRemoveManyAction,
@@ -76,7 +71,6 @@ export const ACTIONS: readonly (new (deps: Container) => ActionBase)[] = [
76
71
  LocaltaskTopicRemoveAction,
77
72
  LocaltaskTopicRemoveManyAction,
78
73
  LocaltaskUpdateAction,
79
- LocaltaskWaitAction,
80
74
  ];
81
75
 
82
76
  // 再导出类本身:前端 apiclient 的返回类型从这里 type-only 引用(实现即契约)。
@@ -88,7 +82,6 @@ export { LocaltaskBoardTasksAction };
88
82
  export { LocaltaskCancelAction };
89
83
  export { LocaltaskCancelManyAction };
90
84
  export { LocaltaskChainAction };
91
- export { LocaltaskClaimAction };
92
85
  export { LocaltaskCloneAction };
93
86
  export { LocaltaskCloseManyAction };
94
87
  export { LocaltaskConfigAction };
@@ -100,7 +93,6 @@ export { LocaltaskGetAction };
100
93
  export { LocaltaskListAction };
101
94
  export { LocaltaskPlanAction };
102
95
  export { LocaltaskPresenceAction };
103
- export { LocaltaskPreviewAction };
104
96
  export { LocaltaskPruneAction };
105
97
  export { LocaltaskRemoveAction };
106
98
  export { LocaltaskRemoveManyAction };
@@ -113,4 +105,3 @@ export { LocaltaskTopicAddAction };
113
105
  export { LocaltaskTopicRemoveAction };
114
106
  export { LocaltaskTopicRemoveManyAction };
115
107
  export { LocaltaskUpdateAction };
116
- export { LocaltaskWaitAction };
@@ -76,10 +76,10 @@ export class LocaltaskAddAction extends ActionBase<typeof input> {
76
76
  const body = await readTaskBody(ctx, meta);
77
77
  if (!body.trim()) throw badInput('任务正文为空:给 "<正文>" 或 --file <文件>');
78
78
 
79
- // 派任务编排已迁 tasktool/add.js(任务工具语义归 tasktool;命令名不变)。
79
+ // 派任务编排已迁 localtask/add.ts(派任务编排归 localtask 域;命令名不变)。
80
80
  // 落点判定(--board/--project 严格口径 / 正文 frontmatter fail-open)只此一份实现,
81
81
  // CLI、HTTP、面板提交同走这一条链路。
82
- const { submitTask } = await (import('../../tasktool/add.js') as any);
82
+ const { submitTask } = await (import('../add.js') as any);
83
83
  const rawBlock: any = ctx.blockBy ?? ctx['block-by'];
84
84
  // 支持本地 id 与跨队列 "topicKey:id"(组编排边);空 → undefined
85
85
  const { normalizeBlockBy } = await (import('../dag.js') as any);
@@ -25,7 +25,7 @@ export class LocaltaskAttachNoteAction extends ActionBase<typeof input> {
25
25
  })
26
26
  override async run(ctx: ActionInput<this['_input']>) {
27
27
 
28
- const { noteTaskAttachment } = await (import('../../tasktool/attach.js') as any);
28
+ const { noteTaskAttachment } = await (import('../../delivery/attach.js') as any);
29
29
  return noteTaskAttachment({
30
30
  id: ctx.id,
31
31
  cwd: ctx.cwd,
@@ -37,7 +37,7 @@ export class LocaltaskAttachAction extends ActionBase<typeof input> {
37
37
  })
38
38
  override async run(ctx: ActionInput<this['_input']>) {
39
39
 
40
- const { attachToTask } = await (import('../../tasktool/attach.js') as any);
40
+ const { attachToTask } = await (import('../../delivery/attach.js') as any);
41
41
  return attachToTask({
42
42
  id: ctx.id,
43
43
  cwd: ctx.cwd,
@@ -25,7 +25,7 @@ export class LocaltaskAttachmentsAction extends ActionBase<typeof input> {
25
25
  })
26
26
  override async run(ctx: ActionInput<this['_input']>) {
27
27
 
28
- const { listTaskAttachments } = await (import('../../tasktool/attach.js') as any);
28
+ const { listTaskAttachments } = await (import('../../delivery/attach.js') as any);
29
29
  return listTaskAttachments({ id: ctx.id, cwd: ctx.cwd, key: ctx.key });
30
30
 
31
31
  }
@@ -27,7 +27,7 @@ export class LocaltaskDetachAction extends ActionBase<typeof input> {
27
27
  })
28
28
  override async run(ctx: ActionInput<this['_input']>) {
29
29
 
30
- const { detachTaskAttachment } = await (import('../../tasktool/attach.js') as any);
30
+ const { detachTaskAttachment } = await (import('../../delivery/attach.js') as any);
31
31
  return detachTaskAttachment({
32
32
  id: ctx.id,
33
33
  cwd: ctx.cwd,
@@ -32,7 +32,7 @@ export class LocaltaskGetAction extends ActionBase<typeof input> {
32
32
  const task: any = await service.getTask({ id: ctx.id, cwd: ctx.cwd, key: ctx.key });
33
33
  // 附件标注(任务 #15):解析正文嵌入 + 按设置自动下载 + 标本地路径。
34
34
  // fail-open:标注坏了照常返回任务本体。
35
- const { annotateTaskDelivery } = await (import('../../tasktool/attach.js') as any);
35
+ const { annotateTaskDelivery } = await (import('../../delivery/attach.js') as any);
36
36
  const att: any = await annotateTaskDelivery(task).catch(() => null);
37
37
  return att
38
38
  ? { ...task, attachments: att.task.attachments }
@@ -34,7 +34,7 @@ export class LocaltaskReopenAction extends ActionBase<typeof input> {
34
34
  override async run(ctx: ActionInput<this['_input']>) {
35
35
 
36
36
  // 重开也可能带着改过的归属(--text 的 frontmatter.project 变了)→ 同样搬家
37
- const { reopenTask } = await (import('../../tasktool/update.js') as any);
37
+ const { reopenTask } = await (import('../update.js') as any);
38
38
  return reopenTask({
39
39
  id: ctx.id,
40
40
  cwd: ctx.cwd,
@@ -37,7 +37,7 @@ export class LocaltaskTimegoalLogAction extends ActionBase<typeof input> {
37
37
  override async run(ctx: ActionInput<this['_input']>) {
38
38
 
39
39
  const topicKey: any = ctx.key || service.normalizeCwd(ctx.cwd).key;
40
- const { getTaskGoalLog } = await (import('../../tasktool/timegoal.js') as any);
40
+ const { getTaskGoalLog } = await (import('../../goals/timegoal.js') as any);
41
41
  return getTaskGoalLog({ topicKey, taskId: ctx.id });
42
42
 
43
43
  }
@@ -63,8 +63,8 @@ export class LocaltaskUpdateAction extends ActionBase<typeof input> {
63
63
  );
64
64
  }
65
65
  // 改归属即搬家(任务 #43):正文 effective project 变了 → 任务迁到新项目的队列。
66
- // 编排在 tasktool/update.js,与派任务(tasktool/add.js)同一套落点判定。
67
- const { updateTask: editTask } = await (import('../../tasktool/update.js') as any);
66
+ // 编排在 localtask/update.ts,与派任务(localtask/add.ts)同一套落点判定。
67
+ const { updateTask: editTask } = await (import('../update.js') as any);
68
68
  const r: any = await editTask({
69
69
  id: ctx.id,
70
70
  text: ctx.text,
@@ -1,6 +1,6 @@
1
- // tasktool/add.js —— 「派任务」的编排(从 localtask/index.js 的 action run 整体迁入)。
1
+ // localtask/add.ts —— 「派任务」的编排(从 localtask/index.js 的 action run 整体迁入)。
2
2
  //
3
- // 边界(与 get.js / wait.js 同一条分工:tasktool = 任务工具语义,localtask = 队列本体):
3
+ // 边界(与 claim/get.js 同一条分工:localtask = 队列本体 + 派任务编排):
4
4
  // 队列读写、落盘、唤醒注册表都在 localtask/service.js;这里只做**编排**——
5
5
  // 落点与 frontmatter 的统一解析 → 任务级 timegoal 声明归一 → 委托 service.addTask
6
6
  // 入队(有 wait 在等则即时投递)。
@@ -13,7 +13,7 @@
13
13
  //(认得出归属就补介绍引用、落点跟到项目队列)。
14
14
  //
15
15
  // 至此三个任务动词(领 get / 等 wait / 派 add)同构:action 层一律一行委托,
16
- // 编排住在 tasktool/<动词>.js,队列本体只有 service.js 一处。
16
+ // 编排住在本域(add.js / update.js),队列本体只有 service.js 一处。
17
17
  import { badInput } from '../../core/errors.js';
18
18
  import { addTask, normalizeCwd } from '../localtask/service.js';
19
19
  import { applyGroupFields, parseFrontmatter } from '../../shared/frontmatter.js';
@@ -1,5 +1,5 @@
1
1
  // 主题队列上的引擎装配:SnapshotStore(topic) + bus + mutator + scheduler
2
- import '../tasktool/plugins/index.js'; // IoC:加载即注册全部 goal
2
+ import '../goals/plugins/index.js'; // IoC:加载即注册全部 goal
3
3
  import { createEventBus } from './bus/index.js';
4
4
  import { createDagMutator } from './mutator/index.js';
5
5
  import type { DagMutator } from './mutator/index.js';
@@ -1,8 +1,8 @@
1
- // tasktool/group-store.js —— 仓库/看板登记的**归一化视图**(board + repos)。
1
+ // localtask/group-store.ts —— 仓库/看板登记的**归一化视图**(board + repos)。
2
2
  //
3
3
  // 派任务(add.js)与改任务(update.js)共用一份落点判定:`--project/--board` 要
4
4
  // 解析成「项目登记的路径」才能定落点,而 repos 模块在**模块互依禁列**里
5
- //(localtask/tasktool 不能静态引它)→ 动态 import(add.js 既有惯例)。
5
+ //(localtask 不能静态引它)→ 动态 import(add.js 既有惯例)。
6
6
  //
7
7
  // 输入是 raw repos store,输出喂给 board-target.js 的 resolveGroupTarget:
8
8
  // boards[i] = { id, name, key, memberKeys: string[] } ← 成员键(不是 repoIds)
@@ -98,7 +98,7 @@ export function createDagMutator({ store, bus }: DagMutatorDeps): DagMutator {
98
98
  async bindPlugin(workflowId: string, target: DagMutatorTargetInput, spec: any): Promise<WorkflowSnapshot> {
99
99
  // target: { workflow: true } | { nodeId }
100
100
  // 动态加载 plugins 桶 → IoC 自注册;再调 onBind 规范化 config
101
- const { getPlugin } = await import('../../tasktool/plugins/index.js');
101
+ const { getPlugin } = await import('../../goals/plugins/index.js');
102
102
  return mutate(workflowId, (draft) => {
103
103
  const ctx = { snapshot: Object.freeze(structuredClone(draft)) };
104
104
  if (target?.workflow) {
@@ -1,6 +1,6 @@
1
1
  // (#54 自 service.js 拆出)面板 presence 观测与注册表:SSE 连接计数(含心跳剔除)、
2
2
  // 常驻主面板发现(APP_DIR/panels.json 登记)、逐端口活性探测、窗口重开节流判据
3
- // shouldReopenWindow(panel-guard 与 tasktool/panel-escort 用)。
3
+ // shouldReopenWindow(panel-guard 与 claim/panel-escort 用)。
4
4
  import http from 'node:http';
5
5
  import { readFileSync } from 'node:fs';
6
6
  import { join } from 'node:path';
@@ -321,7 +321,7 @@ export function readPanelRegistry(): PanelRegistryEntry[] {
321
321
  return readAllPanels();
322
322
  }
323
323
 
324
- // 复查节奏与重开上限(REVIEW_MS 已随 wait 编排迁往 tasktool/wait.js)。
324
+ // 复查节奏与重开上限(REVIEW_MS 已随 wait 编排迁往 claim/wait.ts)。
325
325
  const REOPEN_COOLDOWN_MS = 20_000;
326
326
  // 一次 wait 最多开 3 个窗口:够救「手滑关掉」,又不至于在浏览器拦截脚本时刷屏。
327
327
  const MAX_WINDOW_OPENS = 3;
@@ -1,6 +1,6 @@
1
1
  import { isNodeReady } from '../../../core/workflow/readiness.js';
2
2
  import type { WfGraph } from '../../../core/workflow/readiness.js';
3
- import { isBarrierOpen } from '../../tasktool/plugins/blockgoal.js';
3
+ import { isBarrierOpen } from '../../goals/plugins/blockgoal.js';
4
4
  import type { WorkflowSnapshot } from '../../../core/workflow/types.js';
5
5
 
6
6
  /** driveReadyStates 的出站形状。 */
@@ -1,4 +1,4 @@
1
- // tasktool 模块的辅助函数/常量(legacy 形态里与 action 表同文件,迁来时一并搬到这里)。
1
+ // localtask 模块的辅助函数/常量(legacy 形态里与 action 表同文件,迁来时一并搬到这里)。
2
2
  //
3
3
  // 参数与返回值暂用宽松类型(迁移期),服务层类型化推进时逐个收紧。
4
4
  export function renderSet(d: any) {
@@ -349,8 +349,8 @@ export async function completeTask({ cwd: rawCwd, key: rawKey, id, summary: rawS
349
349
  }
350
350
  let goal: Record<string, any> | null = null;
351
351
  if (task.timegoal) {
352
- // 门禁:查任务级 goal。动态 import——tasktool/wait.js 静态引用本模块,这里走动态避免环。
353
- const { taskGoalState, recordTaskCheck } = await import('../tasktool/taskgoal.js');
352
+ // 门禁:查任务级 goal。动态 import——claim/wait.ts 静态引用本模块,这里走动态避免环。
353
+ const { taskGoalState, recordTaskCheck } = await import('../goals/taskgoal.js');
354
354
  const st = await taskGoalState({ topicKey: key, taskId: want });
355
355
  if (st.hasGoal && !st.reached) {
356
356
  // 「未到点就想 done」的拦截提示(#90):模板与其它区块同源,是 doneguard
@@ -455,5 +455,5 @@ export async function completeTask({ cwd: rawCwd, key: rawKey, id, summary: rawS
455
455
  // 那不是"到点自动取消",那是把目录焊死了。这种情况该由 agent 自己的
456
456
  // `timegoal check`(reached:true)去处理。
457
457
  //
458
- // (goal 探针与目标上下文已随 wait 编排迁往 tasktool/wait.js——任务工具语义归
459
- // tasktool,队列本体不再依赖 timegoal 模块。)
458
+ // (goal 探针与目标上下文已随 wait 编排迁往 claim/wait.ts——任务工具语义归
459
+ // goals 域,队列本体不再依赖 timegoal 模块。)
@@ -2,7 +2,7 @@
2
2
  // 全局池 FIFO 投递 + ignoredCwd 如实回带)、updateTask(正文/时间目标/DAG 依赖/改归属搬家)。
3
3
  import { badInput, notFound } from '../../core/errors.js';
4
4
  import { parseFrontmatter, preserveFrontmatter } from '../../shared/frontmatter.js';
5
- import { sanitizeTaskGoal } from '../tasktool/taskgoal.js';
5
+ import { sanitizeTaskGoal } from '../goals/taskgoal.js';
6
6
  import { normalizeBlockBy, isReadyToClaim } from './dag.js';
7
7
  import { MAX_TEXT, normalizeSummary, normalizeText } from './store-io.js';
8
8
  import { openLocaltaskStore as openStore, topics as topicsRepo, tasks as tasksRepo, links as linksRepo, txw as tx, db } from './repo/index.js';
@@ -31,7 +31,7 @@ export function clampDeliveryTemplate(v: unknown): string {
31
31
  // ─── 附件段提示词(settings.attachTemplate,任务 #82)──────────────────
32
32
  //
33
33
  // 交付里的〔附件〕段(附件清单 + 本地路径 + 拉取 SOP)原先硬编码在
34
- // tasktool/attach.js 的 attachmentInstruction。模板化后:
34
+ // delivery/attach.ts 的 attachmentInstruction。模板化后:
35
35
  // - 空串 = 用内置默认(**不是关掉**——附件段带本地路径,关掉 agent 就找不到文件);
36
36
  // - 新语法:{{task.id}} {{task.text}} {{attach.count}}、
37
37
  // `{{#each attach.list}}`(按 kind 分支的结构化清单 + 各类型子对象);
@@ -3,7 +3,7 @@
3
3
  // 队列内关系清单(queueRelationsOf)与搬家(relocateTask)。
4
4
  import { existsSync } from 'node:fs';
5
5
  import { badInput, notFound } from '../../core/errors.js';
6
- import { sanitizeTaskGoal } from '../tasktool/taskgoal.js';
6
+ import { sanitizeTaskGoal } from '../goals/taskgoal.js';
7
7
  import { normalizeBlockBy, isReadyToClaim } from './dag.js';
8
8
  import { isGlobalKey, topicKeyFor, resolveTaskKey } from './paths.js';
9
9
  import { parseStampMs, stampNow } from './store-io.js';
@@ -1,4 +1,4 @@
1
- // tasktool/update.js —— 「改任务」的编排:改正文 + **改归属项目即搬家**。
1
+ // localtask/update.ts —— 「改任务」的编排:改正文 + **改归属项目即搬家**。
2
2
  //
3
3
  // 派任务(add.js 的 submitTask)有一条铁律:**归属决定落点**——`--project X` 的任务
4
4
  // 落进 X 的登记路径队列。但这条规则此前只在提交那一刻生效:用户提交后发现归属填错、
@@ -8,7 +8,7 @@
8
8
  // ─── 进程内 waiter:key -> { resolve(task), summary, by } ───────────────
9
9
  //
10
10
  // 注册表**留在 localtask**(addTask 的唤醒路径要认领它),但注册/取走以 API 导出——
11
- // wait/get 的阻塞编排住在 tasktool/wait.js,通过这组 API 挂钩,不碰队列内部。
11
+ // wait/get 的阻塞编排住在 claim/wait.ts,通过这组 API 挂钩,不碰队列内部。
12
12
 
13
13
  /** 主题级 waiter 条目(resolve 回调收 JSON 形态任务)。 */
14
14
  export interface TopicWaiterEntry {
@@ -1,6 +1,6 @@
1
1
  // 日常 DAG 写路径 —— 一律经 Mutator(单一写入口),再投影回主题任务行。
2
2
  // 跨队列依赖("topicKey:id")只落在任务行 blockBy,不进本 topic 引擎节点图。
3
- import '../tasktool/plugins/index.js';
3
+ import '../goals/plugins/index.js';
4
4
  import { createTopicEngine } from './engine.js';
5
5
  import { normalizeBlockBy, parseDepRef } from '../../core/workflow/readiness.js';
6
6
  import { isGateNode } from '../../core/workflow/types.js';
@@ -2,9 +2,9 @@
2
2
  //
3
3
  // 单独成文件的原因:actions/ 下的 action 经 _manifest.generated.ts 被 index.ts
4
4
  // 装配,若 action 反向 import index.js 就形成 TDZ 回环——工厂是 actions 与
5
- // tasktool 共同的依赖终点,不含任何装配代码。
5
+ // delivery 共同的依赖终点,不含任何装配代码。
6
6
  //
7
- // 依赖方向(设计内):tasktool 是唯一消费方——领域取数(readGroupContext /
7
+ // 依赖方向(设计内):delivery 是唯一消费方——领域取数(readGroupContext /
8
8
  // attachTemplateCtx / pendingQueueInfo / getloop 指令渲染)由宿主完成,以 `Supply`
9
9
  // 形式交给插件;插件在自己的 buildData() 里 await supplied() 后只做变换。
10
10
  // promptplug 不 import 其他模块。
@@ -1,7 +1,7 @@
1
1
  // promptplug 装配:模块元信息 + action 清单装配。
2
2
  //
3
3
  // 插件工厂 / 注册表 / 字段目录在 factory.ts + registry.ts(actions 经 manifest 引
4
- // 工厂,不能回环引本文件)。依赖方向(设计内):tasktool 是唯一消费方——宿主完成
4
+ // 工厂,不能回环引本文件)。依赖方向(设计内):delivery 是唯一消费方——宿主完成
5
5
  // 领域取数,以 Supply 形式注入插件;插件在自己的 buildData() 里变换。
6
6
  // promptplug 不 import 其他模块(delivery.ts 的交付组装同样只收宿主取好的数据)。
7
7
  import { ModuleBase } from '../../runtime/types/module.js';
@@ -9,7 +9,7 @@ import { zodActionsOf, type ZodBoundAction } from '../../runtime/action-decorato
9
9
  import { container, type Container } from '../../runtime/container.js';
10
10
  import { ACTIONS } from './actions/_manifest.generated.js';
11
11
 
12
- // 装配无关的公开面(tasktool / settings.ts 从这里拿)
12
+ // 装配无关的公开面(delivery / settings.ts 从这里拿)
13
13
  export {
14
14
  activeTemplateOf,
15
15
  blockLabelOf,
@@ -34,13 +34,11 @@ export {
34
34
  export { PLUGIN_GROUPS } from './base.js';
35
35
  export type { PluginGroup, TemplateText } from './base.js';
36
36
  export { compose } from './compose.js';
37
- export { assembleDelivery, flatParamsOf, DELIVERY_SEGMENTS } from './delivery.js';
38
- export type { AssembledDelivery, DeliveryHostData } from './delivery.js';
39
37
 
40
38
  /**
41
39
  * 提示词插件模块:注册表外露(prompt.registry)。
42
- * 业务面(compose / buildPlugins)由 tasktool 直接消费——这是设计内依赖
43
- * (tasktool → promptplug)。
40
+ * 业务面(compose / buildPlugins)由 delivery 域直接消费——这是设计内依赖
41
+ * (delivery → promptplug)。本模块不 import 任何其他模块(组装核已迁到 delivery/assemble.ts)。
44
42
  */
45
43
  export class PromptplugModule extends ModuleBase {
46
44
  override readonly id = 'promptplug';
@@ -1,6 +1,6 @@
1
1
  // attachment 插件(order 20):附件识别。
2
2
  //
3
- // 数据变换(attachTemplateCtx)留在 tasktool/attach-template.ts —— 它依赖
3
+ // 数据变换(attachTemplateCtx)留在 delivery/attach-template.ts —— 它依赖
4
4
  // attach-resource 的标注工具链(kind 归一 / 可读性探测 / 取用命令),随插件搬会
5
5
  // 牵动三处引用。插件消费宿主标注后的 attach 对象,**schema 逐字对齐它的真实形状**。
6
6
  //
@@ -1,5 +1,5 @@
1
1
  // context 插件(order 10):组 / 项目上下文。
2
- // data() 搬自 tasktool/delivery-template.ts 的 deliveryCtxOf(原文件随 S1 删除),
2
+ // data() 搬自 delivery/assemble.ts 的 deliveryCtxOf(原文件随 S1 删除),
3
3
  // 口径注释一并迁入——#81 空壳组过滤、#104 已登记无介绍可见、参考仓库去重并集。
4
4
  import { z } from 'zod';
5
5
  import { PromptPlugin, supplied, type Supply, type TemplateText } from '../base.js';
@@ -2,7 +2,7 @@
2
2
  //
3
3
  // 为什么在 promptplug(#227 重构):模板正文归提示词模板体系(出厂正文 / 兜底文案
4
4
  // 都在 promptplug/plugins/ 下);taskgoal-store(领取路径)与 timegoal-task-store
5
- // (check 路径)作为 tasktool 宿主从这里取用——依赖方向单一(tasktool → promptplug),
5
+ // (check 路径)作为 goals 域宿主从这里取用——依赖方向单一(goals → promptplug),
6
6
  // 两边变量口径永远一致,也不再依赖「模板夹在两个互相 import 的 store 之间」来防环。
7
7
  //
8
8
  // goals.prompt 落库的是**模板原文**(占位符保留),渲染发生在:
@@ -1,7 +1,7 @@
1
1
  // 仓库登记 CRUD:清单、登记、更新、删除、单条查询、key 定位。
2
2
  import { resolve } from 'node:path';
3
3
  import { badInput, notFound, conflict } from '../../../core/errors.js';
4
- import { sanitizeGetLoop } from '../../tasktool/getloop.js';
4
+ import { sanitizeGetLoop } from '../../claim/waitgoal-config.js';
5
5
  import repoLayer from '../repo/index.js';
6
6
  import { loadStore, mutateStore } from './store.js';
7
7
  import {
@@ -28,7 +28,9 @@ import { readFileSync } from 'node:fs';
28
28
  import systemModule from '../modules/system/index.js';
29
29
  import setting from '../modules/setting/index.js';
30
30
  import localtask from '../modules/localtask/index.js';
31
- import tasktool from '../modules/tasktool/index.js';
31
+ import claim from '../modules/claim/index.js';
32
+ import delivery from '../modules/delivery/index.js';
33
+ import goals from '../modules/goals/index.js';
32
34
  import repos from '../modules/repos/index.js';
33
35
  import docs from '../modules/docs/index.js';
34
36
  import file from '../modules/file/index.js';
@@ -41,7 +43,9 @@ const MODULE_LIST: readonly AnyModule[] = [
41
43
  systemModule,
42
44
  setting,
43
45
  localtask,
44
- tasktool,
46
+ claim,
47
+ delivery,
48
+ goals,
45
49
  repos,
46
50
  docs,
47
51
  file,