nx-kv 0.65.2 → 0.65.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (176) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/README.md +15 -37
  3. package/assets/nx-kv/QUICKSTART.md +110 -0
  4. package/assets/nx-kv/references/A05-/344/273/273/345/212/241/351/223/276/344/270/216/345/217/215/351/246/210/346/261/207/346/200/273.md +1 -1
  5. package/assets/nx-kv/references/B02-CLI/351/200/237/346/237/245.md +1 -2
  6. package/package.json +1 -1
  7. package/src/core/config.ts +23 -0
  8. package/src/core/db/settings.ts +1 -1
  9. package/src/core/instruction-template.ts +2 -2
  10. package/src/core/workflow/plugin-registry.ts +1 -1
  11. package/src/core/workflow/project.ts +1 -1
  12. package/src/core/workflow/types.ts +4 -4
  13. package/src/modules/claim/actions/_manifest.generated.ts +20 -0
  14. package/src/modules/{localtask → claim}/actions/localtask-claim.ts +5 -5
  15. package/src/modules/{localtask → claim}/actions/localtask-preview.ts +4 -4
  16. package/src/modules/{promptplug/delivery.ts → claim/assemble.ts} +6 -6
  17. package/src/modules/{tasktool → claim}/get.ts +5 -6
  18. package/src/modules/{tasktool → claim}/groupctx.ts +4 -7
  19. package/src/modules/{tasktool/delivery.ts → claim/host.ts} +7 -7
  20. package/src/modules/claim/index.ts +25 -0
  21. package/src/modules/{tasktool → claim}/panel-escort.ts +2 -2
  22. package/src/modules/{tasktool → claim}/params.ts +3 -3
  23. package/src/modules/{tasktool → claim}/preview.ts +5 -5
  24. package/src/modules/{tasktool → claim}/wait.ts +17 -17
  25. package/src/modules/{tasktool/plugins → claim}/waitgoal-config.ts +3 -24
  26. package/src/modules/docs/actions/_manifest.generated.ts +12 -0
  27. package/src/modules/{repos → docs}/actions/repo-doc-add.ts +3 -2
  28. package/src/modules/{repos → docs}/actions/repo-doc-list.ts +3 -2
  29. package/src/modules/{repos → docs}/actions/repo-doc-remove.ts +3 -2
  30. package/src/modules/{repos → docs}/actions/repo-knowledge.ts +3 -2
  31. package/src/modules/docs/knowledge.ts +8 -16
  32. package/src/modules/goals/index.ts +25 -0
  33. package/src/modules/{tasktool → goals}/plugins/discover.ts +3 -3
  34. package/src/modules/{tasktool → goals}/plugins/index.ts +0 -2
  35. package/src/modules/{tasktool → goals}/plugins/taskgoal-store.ts +2 -2
  36. package/src/modules/{tasktool → goals}/plugins/timegoal-cwd-store.ts +1 -1
  37. package/src/modules/{tasktool → goals}/plugins/timegoal-store.ts +3 -3
  38. package/src/modules/{tasktool → goals}/plugins/timegoal-task-store.ts +2 -2
  39. package/src/modules/{tasktool → goals}/support.ts +3 -1
  40. package/src/modules/localtask/actions/_manifest.generated.ts +0 -9
  41. package/src/modules/localtask/actions/localtask-add.ts +4 -4
  42. package/src/modules/localtask/actions/localtask-attach-note.ts +1 -1
  43. package/src/modules/localtask/actions/localtask-attach.ts +1 -1
  44. package/src/modules/localtask/actions/localtask-attachments.ts +2 -2
  45. package/src/modules/localtask/actions/localtask-cancel.ts +1 -1
  46. package/src/modules/localtask/actions/localtask-chain.ts +1 -1
  47. package/src/modules/localtask/actions/localtask-detach.ts +2 -2
  48. package/src/modules/localtask/actions/localtask-done.ts +1 -1
  49. package/src/modules/localtask/actions/localtask-get.ts +3 -3
  50. package/src/modules/localtask/actions/localtask-list.ts +1 -1
  51. package/src/modules/localtask/actions/localtask-reopen.ts +5 -5
  52. package/src/modules/localtask/actions/localtask-timegoalLog.ts +1 -1
  53. package/src/modules/localtask/actions/localtask-topic-removeMany.ts +1 -1
  54. package/src/modules/localtask/actions/localtask-update.ts +3 -3
  55. package/src/modules/localtask/{bus → infra/bus}/index.ts +1 -1
  56. package/src/modules/localtask/{engine.ts → infra/engine.ts} +1 -1
  57. package/src/modules/localtask/{events.ts → infra/events.ts} +3 -3
  58. package/src/modules/localtask/{mutator → infra/mutator}/index.ts +2 -2
  59. package/src/modules/localtask/{mutator → infra/mutator}/validate.ts +4 -4
  60. package/src/modules/localtask/{repo → infra/repo}/goals.ts +2 -2
  61. package/src/modules/localtask/{repo → infra/repo}/index.ts +1 -1
  62. package/src/modules/localtask/{repo → infra/repo}/links.ts +2 -2
  63. package/src/modules/localtask/{repo → infra/repo}/open.ts +4 -4
  64. package/src/modules/localtask/{repo → infra/repo}/presence.ts +1 -1
  65. package/src/modules/localtask/{repo → infra/repo}/rows.ts +1 -1
  66. package/src/modules/localtask/{repo → infra/repo}/settings.ts +5 -5
  67. package/src/modules/localtask/{repo → infra/repo}/snapshot.ts +9 -7
  68. package/src/modules/localtask/{repo → infra/repo}/tasks.ts +82 -4
  69. package/src/modules/localtask/{repo → infra/repo}/topics.ts +3 -3
  70. package/src/modules/localtask/{repo-ctx.ts → infra/repo-ctx.ts} +1 -1
  71. package/src/modules/localtask/{scheduler → infra/scheduler}/index.ts +1 -1
  72. package/src/modules/localtask/{scheduler → infra/scheduler}/state-drive.ts +4 -4
  73. package/src/modules/localtask/{store → infra/store}/file-adapter.ts +2 -2
  74. package/src/modules/localtask/{store → infra/store}/index.ts +4 -4
  75. package/src/modules/localtask/{store → infra/store}/memory-adapter.ts +2 -2
  76. package/src/modules/localtask/{store-io.ts → infra/store-io.ts} +1 -1
  77. package/src/modules/localtask/{writes.ts → infra/writes.ts} +3 -3
  78. package/src/modules/{tasktool → localtask/lifecycle}/add.ts +8 -8
  79. package/src/modules/localtask/{deletion.ts → lifecycle/deletion.ts} +4 -4
  80. package/src/modules/localtask/{task-lifecycle.ts → lifecycle/task-lifecycle.ts} +18 -19
  81. package/src/modules/localtask/{task-ops.ts → lifecycle/task-ops.ts} +14 -14
  82. package/src/modules/localtask/{task-remove.ts → lifecycle/task-remove.ts} +4 -4
  83. package/src/modules/localtask/{task-templates.ts → lifecycle/task-templates.ts} +2 -2
  84. package/src/modules/localtask/{task-view.ts → lifecycle/task-view.ts} +14 -13
  85. package/src/modules/localtask/{topics.ts → lifecycle/topics.ts} +7 -7
  86. package/src/modules/{tasktool → localtask/lifecycle}/update.ts +6 -6
  87. package/src/modules/{tasktool → localtask/ops}/attach-resource.ts +4 -4
  88. package/src/modules/{tasktool → localtask/ops}/attach-template.ts +3 -3
  89. package/src/modules/{tasktool → localtask/ops}/attach.ts +11 -11
  90. package/src/modules/localtask/{board-target.ts → ops/board-target.ts} +1 -1
  91. package/src/modules/{tasktool → localtask/ops}/doc-inline.ts +3 -3
  92. package/src/modules/{tasktool → localtask/ops}/group-store.ts +3 -3
  93. package/src/modules/localtask/service.ts +16 -16
  94. package/src/modules/localtask/{action-render.ts → ui/action-render.ts} +2 -2
  95. package/src/modules/localtask/{panel-guard.ts → ui/panel-guard.ts} +1 -1
  96. package/src/modules/localtask/{panel-presence.ts → ui/panel-presence.ts} +7 -7
  97. package/src/modules/localtask/waiters.ts +2 -2
  98. package/src/modules/localtask/waiting.ts +1 -1
  99. package/src/modules/promptplug/factory.ts +2 -2
  100. package/src/modules/promptplug/index.ts +5 -7
  101. package/src/modules/promptplug/plugins/attachment.ts +1 -1
  102. package/src/modules/promptplug/plugins/context.ts +9 -20
  103. package/src/modules/promptplug/plugins/goal-prompt.ts +1 -1
  104. package/src/modules/repos/actions/_manifest.generated.ts +0 -12
  105. package/src/modules/repos/service/crud.ts +1 -1
  106. package/src/runtime/cli.ts +1 -1
  107. package/src/runtime/registry.ts +4 -2
  108. package/src/{modules/tasktool → shared}/delivery-text.ts +5 -4
  109. package/src/shared/feedback-text.ts +80 -20
  110. package/src/shared/task-status.ts +42 -0
  111. package/src/web/frontend/api/cli-tree.json +202 -217
  112. package/src/web/frontend/api/client.generated.ts +141 -139
  113. package/src/web/frontend/modules/board/ack-nodes.ts +10 -13
  114. package/src/web/frontend/modules/board/reopen-text.ts +5 -0
  115. package/src/web/frontend/modules/md/styles/editor.css +8 -0
  116. package/src/web/public/assets/{bar-Dc5Tq1eE.js → bar-kaVB6FAa.js} +1 -1
  117. package/src/web/public/assets/{board-view-BVennxTs.js → board-view-Cwot54HC.js} +1 -1
  118. package/src/web/public/assets/{composer-launch-fp2IzGzQ.js → composer-launch-BMTU-BD9.js} +1 -1
  119. package/src/web/public/assets/{composer-panel-Dh681iO6.js → composer-panel-BF6gjNXv.js} +1 -1
  120. package/src/web/public/assets/{dag-DnaU0I_z.js → dag-BRE33yI8.js} +1 -1
  121. package/src/web/public/assets/dir-B0IW4NIn.js +3 -0
  122. package/src/web/public/assets/{doc-DRSKD0Re.js → doc-DsRb-4WT.js} +1 -1
  123. package/src/web/public/assets/frontmatter-Bcseml1q.js +2 -0
  124. package/src/web/public/assets/{group-Dc3ZgW24.js → group-CS8VP6z0.js} +1 -1
  125. package/src/web/public/assets/{index-Bg0m8gbJ.js → index-BT2y9cTX.js} +2 -2
  126. package/src/web/public/assets/{index-BIVxGd6t.css → index-DSAamoav.css} +1 -1
  127. package/src/web/public/assets/{md-history-DNtgaIdH.js → md-history-CJ1N9-Jf.js} +1 -1
  128. package/src/web/public/assets/{md-parse-C9Vd6ejP.js → md-parse-DAYCREP1.js} +1 -1
  129. package/src/web/public/assets/{model-CtG2jIDv.js → model-TD5kGXzR.js} +1 -1
  130. package/src/web/public/assets/{overview-C68QpcT9.js → overview-Bsq58sDd.js} +1 -1
  131. package/src/web/public/assets/{progress-CEmAFxo9.js → progress-B4DfpsyS.js} +1 -1
  132. package/src/web/public/assets/{refs-TzxZYy7T.js → refs-DIiA_49Z.js} +1 -1
  133. package/src/web/public/assets/{repo-form-modal-Dg3hJWUV.js → repo-form-modal-DChK4NSX.js} +1 -1
  134. package/src/web/public/assets/{repos-uNqSR5YB.js → repos-PGFYkUgf.js} +1 -1
  135. package/src/web/public/assets/{route-crumb-C4DgkJ8G.js → route-crumb-SiMi2C_T.js} +1 -1
  136. package/src/web/public/assets/{status-tag-8cLH8hl9.js → status-tag-C9YVBvQh.js} +1 -1
  137. package/src/web/public/assets/task-BL5uxmJh.js +11 -0
  138. package/src/web/public/assets/{task-row-CRjuAfKW.js → task-row-cE7qblNK.js} +1 -1
  139. package/src/web/public/assets/{task-utils-DAPxKm4c.js → task-utils-cBR6Gj_c.js} +8 -7
  140. package/src/web/public/assets/{templates-DNiGvmdq.js → templates-Cfn3Xmsf.js} +3 -3
  141. package/src/web/public/assets/{use-rail-drag-DxIYcszo.js → use-rail-drag-Boxl7pOG.js} +1 -1
  142. package/src/web/public/index.html +11 -11
  143. package/src/core/workflow/edges.ts +0 -28
  144. package/src/core/workflow/layout.ts +0 -118
  145. package/src/modules/localtask/actions/localtask-wait.ts +0 -41
  146. package/src/modules/tasktool/facade/get.ts +0 -54
  147. package/src/modules/tasktool/facade/index.ts +0 -4
  148. package/src/modules/tasktool/facade/submit.ts +0 -61
  149. package/src/modules/tasktool/facade/wait.ts +0 -3
  150. package/src/modules/tasktool/getloop.ts +0 -2
  151. package/src/modules/tasktool/index.ts +0 -24
  152. package/src/modules/tasktool/plugins/runtime.ts +0 -73
  153. package/src/modules/tasktool/plugins/waitgoal.ts +0 -71
  154. package/src/web/public/assets/dir-d16q1GLe.js +0 -3
  155. package/src/web/public/assets/frontmatter-CN6IlxWU.js +0 -2
  156. package/src/web/public/assets/task-DuFOXLPC.js +0 -11
  157. /package/src/modules/{tasktool → goals}/actions/_manifest.generated.ts +0 -0
  158. /package/src/modules/{tasktool → goals}/actions/timegoal-check.ts +0 -0
  159. /package/src/modules/{tasktool → goals}/actions/timegoal-clear.ts +0 -0
  160. /package/src/modules/{tasktool → goals}/actions/timegoal-list.ts +0 -0
  161. /package/src/modules/{tasktool → goals}/actions/timegoal-log.ts +0 -0
  162. /package/src/modules/{tasktool → goals}/actions/timegoal-prune.ts +0 -0
  163. /package/src/modules/{tasktool → goals}/actions/timegoal-set.ts +0 -0
  164. /package/src/modules/{tasktool → goals}/actions/timegoal-show.ts +0 -0
  165. /package/src/modules/{tasktool → goals}/actions/timegoal-update.ts +0 -0
  166. /package/src/modules/{tasktool → goals}/plugins/base.ts +0 -0
  167. /package/src/modules/{tasktool → goals}/plugins/blockgoal.ts +0 -0
  168. /package/src/modules/{tasktool → goals}/plugins/container.ts +0 -0
  169. /package/src/modules/{tasktool → goals}/plugins/taskgoal.ts +0 -0
  170. /package/src/modules/{tasktool → goals}/plugins/timegoal-core-store.ts +0 -0
  171. /package/src/modules/{tasktool → goals}/plugins/timegoal.ts +0 -0
  172. /package/src/modules/{tasktool → goals}/taskgoal.ts +0 -0
  173. /package/src/modules/{tasktool → goals}/timegoal.ts +0 -0
  174. /package/src/modules/localtask/{store → infra/store}/topic-adapter.ts +0 -0
  175. /package/src/modules/localtask/{action-flags.ts → ui/action-flags.ts} +0 -0
  176. /package/src/modules/localtask/{contract-views.ts → ui/contract-views.ts} +0 -0
@@ -4,7 +4,7 @@
4
4
  import { action } from '../../../runtime/action-decorator.js';
5
5
  import { z } from 'zod';
6
6
  import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
7
- import { renderTaskAttachments as _renderTaskAttachments } from '../action-render.js';
7
+ import { renderTaskAttachments as _renderTaskAttachments } from '../ui/action-render.js';
8
8
  const renderTaskAttachments: any = _renderTaskAttachments;
9
9
 
10
10
  /** localtask.attachments 的入参契约(CLI 与 HTTP 共用同一份)。 */
@@ -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('../ops/attach.js') as any);
29
29
  return listTaskAttachments({ id: ctx.id, cwd: ctx.cwd, key: ctx.key });
30
30
 
31
31
  }
@@ -5,7 +5,7 @@ import { action } from '../../../runtime/action-decorator.js';
5
5
  import { z } from 'zod';
6
6
  import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
7
7
  import * as serviceNs from '../service.js';
8
- import { renderCancel as _renderCancel } from '../action-render.js';
8
+ import { renderCancel as _renderCancel } from '../ui/action-render.js';
9
9
  const service: any = serviceNs;
10
10
  const renderCancel: any = _renderCancel;
11
11
 
@@ -5,7 +5,7 @@ import { action } from '../../../runtime/action-decorator.js';
5
5
  import { z } from 'zod';
6
6
  import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
7
7
  import * as serviceNs from '../service.js';
8
- import { renderChain as _renderChain } from '../action-render.js';
8
+ import { renderChain as _renderChain } from '../ui/action-render.js';
9
9
  const service: any = serviceNs;
10
10
  const renderChain: any = _renderChain;
11
11
 
@@ -4,7 +4,7 @@
4
4
  import { action } from '../../../runtime/action-decorator.js';
5
5
  import { z } from 'zod';
6
6
  import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
7
- import { renderDetach as _renderDetach } from '../action-render.js';
7
+ import { renderDetach as _renderDetach } from '../ui/action-render.js';
8
8
  const renderDetach: any = _renderDetach;
9
9
 
10
10
  /** localtask.detach 的入参契约(CLI 与 HTTP 共用同一份)。 */
@@ -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('../ops/attach.js') as any);
31
31
  return detachTaskAttachment({
32
32
  id: ctx.id,
33
33
  cwd: ctx.cwd,
@@ -5,7 +5,7 @@ import { action } from '../../../runtime/action-decorator.js';
5
5
  import { z } from 'zod';
6
6
  import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
7
7
  import * as serviceNs from '../service.js';
8
- import { doneView } from '../contract-views.js';
8
+ import { doneView } from '../ui/contract-views.js';
9
9
  const service: any = serviceNs;
10
10
 
11
11
  /** localtask.done 的入参契约(CLI 与 HTTP 共用同一份)。 */
@@ -5,8 +5,8 @@ import { action } from '../../../runtime/action-decorator.js';
5
5
  import { z } from 'zod';
6
6
  import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
7
7
  import * as serviceNs from '../service.js';
8
- import { renderTask as _renderTask } from '../action-render.js';
9
- import { taskView } from '../contract-views.js';
8
+ import { renderTask as _renderTask } from '../ui/action-render.js';
9
+ import { taskView } from '../ui/contract-views.js';
10
10
  const service: any = serviceNs;
11
11
  const renderTask: any = _renderTask;
12
12
 
@@ -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('../ops/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 }
@@ -5,7 +5,7 @@ import { action } from '../../../runtime/action-decorator.js';
5
5
  import { z } from 'zod';
6
6
  import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
7
7
  import * as serviceNs from '../service.js';
8
- import { renderOverview as _renderOverview } from '../action-render.js';
8
+ import { renderOverview as _renderOverview } from '../ui/action-render.js';
9
9
  const service: any = serviceNs;
10
10
  const renderOverview: any = _renderOverview;
11
11
 
@@ -4,18 +4,18 @@
4
4
  import { action } from '../../../runtime/action-decorator.js';
5
5
  import { z } from 'zod';
6
6
  import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
7
- import { reopenView } from '../contract-views.js';
7
+ import { reopenView } from '../ui/contract-views.js';
8
8
 
9
9
  /** localtask.reopen 的入参契约(CLI 与 HTTP 共用同一份)。 */
10
10
  const input = z.object({
11
11
  id: z.number().describe("任务编号"),
12
12
  cwd: z.string().optional(),
13
13
  key: z.string().optional(),
14
- text: z.string().optional().describe("下一轮任务正文(Markdown;保住 frontmatter);不给则继承旧正文,只带 --feedback 时追加完成总结+反馈段"),
14
+ text: z.string().optional().describe("下一轮任务正文(Markdown;保住 frontmatter);不给则继承旧正文,只带 --feedback 时追加轮次 callout([!NOTE] 完成总结 + [!WARNING] 验收反馈)"),
15
15
  kind: z.string().optional().describe("reopen(验收反馈,默认)或 comment(划选评论)"),
16
16
  quote: z.string().optional().describe("划选原文(comment 时)"),
17
- feedback: z.string().optional().describe("用户反馈原文;派生出的新任务正文会追加反馈段(base = 服务端最新正文,防连续评论丢内容)"),
18
- feedbackHeading: z.string().optional().describe("追加反馈段的段名(缺省 comment=## 反馈修改 / reopen=## 验收反馈)"),
17
+ feedback: z.string().optional().describe("用户反馈原文;派生出的新任务正文会追加 [!WARNING] 验收反馈 callout(base = 服务端最新正文,防连续评论丢内容)"),
18
+ feedbackHeading: z.string().optional().describe("反馈段形态:comment=旧段名 ## 反馈修改(不进轮次);reopen=轮次 callout([!NOTE] 完成总结 + [!WARNING] 验收反馈,标题含轮次号)"),
19
19
  feedbackBold: z.boolean().optional().describe("追加的反馈是否逐行加粗(缺省 comment=false / reopen=true)"),
20
20
  });
21
21
 
@@ -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('../lifecycle/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
  }
@@ -5,7 +5,7 @@ import { action } from '../../../runtime/action-decorator.js';
5
5
  import { z } from 'zod';
6
6
  import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
7
7
  import * as serviceNs from '../service.js';
8
- import { renderRemoveMany as _renderRemoveMany } from '../action-render.js';
8
+ import { renderRemoveMany as _renderRemoveMany } from '../ui/action-render.js';
9
9
  const service: any = serviceNs;
10
10
  const renderRemoveMany: any = _renderRemoveMany;
11
11
 
@@ -4,7 +4,7 @@
4
4
  import { action } from '../../../runtime/action-decorator.js';
5
5
  import { z } from 'zod';
6
6
  import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
7
- import { updateView } from '../contract-views.js';
7
+ import { updateView } from '../ui/contract-views.js';
8
8
 
9
9
  /** localtask.update 的入参契约(CLI 与 HTTP 共用同一份)。 */
10
10
  const input = z.object({
@@ -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('../lifecycle/update.js') as any);
68
68
  const r: any = await editTask({
69
69
  id: ctx.id,
70
70
  text: ctx.text,
@@ -1,4 +1,4 @@
1
- import { EVENTS } from '../../../core/workflow/event-names.js';
1
+ import { EVENTS } from '../../../../core/workflow/event-names.js';
2
2
 
3
3
  /** 订阅回调(事件负载不设类型约束:进程内总线,发什么听什么)。 */
4
4
  export type EventListener = (payload: unknown) => void;
@@ -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,10 +1,10 @@
1
1
  // (#54 自 service.js 拆出)等待生命周期事件流:轮询 store,从 waiting/waitingUntil 与
2
2
  // 已领取数的变化里派生 waiting/reminder/resolved 事件;SSE(streamEventsSSE)与
3
3
  // CLI(NDJSON)共用 watchEvents 生成器。
4
- import { isGlobalKey, normalizeCwd } from './paths.js';
4
+ import { isGlobalKey, normalizeCwd } from '../paths.js';
5
5
  import { openLocaltaskStore as openStore, topics as topicsRepo } from './repo/index.js';
6
- import { deadlineMsOf } from './task-view.js';
7
- import { addEventStreamConn } from './panel-presence.js';
6
+ import { deadlineMsOf } from '../lifecycle/task-view.js';
7
+ import { addEventStreamConn } from '../ui/panel-presence.js';
8
8
  // ─── 等待生命周期事件流(主面板及时通知,避免用户漏过超时)────────────
9
9
  //
10
10
  // wait 与常驻主面板通常是两个进程,内存 EventEmitter 跨不过进程,所以事件流
@@ -6,7 +6,7 @@ import {
6
6
  findNode,
7
7
  wouldCreateCycle,
8
8
  } from './validate.js';
9
- import type { WorkflowSnapshot } from '../../../core/workflow/types.js';
9
+ import type { WorkflowSnapshot } from '../../../../core/workflow/types.js';
10
10
 
11
11
  /** mutator 依赖的快照存储(store/index.js 的 createSnapshotStore 出站形状)。 */
12
12
  export type SnapshotStoreLike = ReturnType<typeof import('../store/index.js').createSnapshotStore>;
@@ -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,7 +1,7 @@
1
- import { assertPluginSpec } from '../../../core/workflow/plugin-registry.js';
2
- import { isGateNode } from '../../../core/workflow/types.js';
3
- import { wouldCycleAfterLink } from '../../../shared/graph.js';
4
- import type { WorkflowSnapshot, WfNode, PluginSpec } from '../../../core/workflow/types.js';
1
+ import { assertPluginSpec } from '../../../../core/workflow/plugin-registry.js';
2
+ import { isGateNode } from '../../../../core/workflow/types.js';
3
+ import { wouldCycleAfterLink } from '../../../../shared/graph.js';
4
+ import type { WorkflowSnapshot, WfNode, PluginSpec } from '../../../../core/workflow/types.js';
5
5
 
6
6
  /** assertPluginSpec 归一化后的插件规格(原样透传,不收紧)。 */
7
7
  type NormalizedSpec = ReturnType<typeof assertPluginSpec>;
@@ -13,8 +13,8 @@
13
13
  // 旧库可能存过 JSON `{summary, progress}` 编码(progress 已废)——读取侧做
14
14
  // 兼容解析(见 timegoal-task-store.getTaskGoalLog),新写入一律纯文本。
15
15
  import { db, txw } from './open.js';
16
- import { nowMs } from '../../../core/db/time.js';
17
- import type { DbApi } from '../../../core/db/driver.js';
16
+ import { nowMs } from '../../../../core/db/time.js';
17
+ import type { DbApi } from '../../../../core/db/driver.js';
18
18
 
19
19
  /** goal / check 行(库行 → any)。 */
20
20
  export type GoalRow = Record<string, any>;
@@ -24,7 +24,7 @@ export {
24
24
  links,
25
25
  createDbTopicAdapter,
26
26
  };
27
- export { closeDb, isStoreOpen } from '../../../core/db/index.js';
27
+ export { closeDb, isStoreOpen } from '../../../../core/db/index.js';
28
28
 
29
29
  /** 便捷聚合:`repo.topics.ensureTopic(...)` / `repo.tasks.claimTask(...)`。 */
30
30
  export default {
@@ -13,8 +13,8 @@
13
13
  // 读形状:`chainOf` 一次递归查询拿整条链(祖先 + 自己 + 后代),
14
14
  // 列表页的"这条派生了几个"用 childrenCount(走 ix_task_links_children)。
15
15
  import { db, txw } from './open.js';
16
- import { badInput, notFound } from '../../../core/errors.js';
17
- import type { DbApi } from '../../../core/db/driver.js';
16
+ import { badInput, notFound } from '../../../../core/errors.js';
17
+ import type { DbApi } from '../../../../core/db/driver.js';
18
18
 
19
19
  /** 合法的派生类型(与 schema CHECK 同口径,写前校验给可读报错)。 */
20
20
  export const LINK_TYPES = Object.freeze(['comment', 'reopen', 'feedback']);
@@ -12,10 +12,10 @@
12
12
  // `<dir>` 为 home —— 约 25 个既有测试文件靠它隔离
13
13
  import { rmSync } from 'node:fs';
14
14
  import { dirname, join } from 'node:path';
15
- import { openStore, getDb, closeDb, isStoreOpen, tx } from '../../../core/db/index.js';
16
- import { checkNodeVersion } from '../../../core/db/version.js';
17
- import type { DbApi } from '../../../core/db/driver.js';
18
- import type { TxOptions } from '../../../core/db/tx.js';
15
+ import { openStore, getDb, closeDb, isStoreOpen, tx } from '../../../../core/db/index.js';
16
+ import { checkNodeVersion } from '../../../../core/db/version.js';
17
+ import type { DbApi } from '../../../../core/db/driver.js';
18
+ import type { TxOptions } from '../../../../core/db/tx.js';
19
19
 
20
20
  /** 当前连接是按哪个库路径打开的(env 变了要关旧开新;null = 尚未打开)。 */
21
21
  let openedFor: string | null | undefined = null;
@@ -5,7 +5,7 @@
5
5
  // 可以整表清空,不会让队列本身看起来像有人在等。
6
6
  // 判据始终两条:waiting=1 **且** until_ms > now(isLiveWaiting,task-view.js)。
7
7
  import { db, txw } from './open.js';
8
- import { nowMs } from '../../../core/db/time.js';
8
+ import { nowMs } from '../../../../core/db/time.js';
9
9
  import { getTopicRow, updateTopic } from './topics.js';
10
10
 
11
11
  /** setPresence 的入参形状。 */
@@ -18,7 +18,7 @@
18
18
  // reopenCount → tasks.round - 1 (round = 重开次数 + 1,schema 语义)
19
19
  // blockBy 本地数字 → task_deps 行;"key:id" 跨队列引用 → ext.ext_deps_foreign
20
20
  // 其余低频字段(history / forkOf / timegoal / trashIndex / claimedFrom…)→ tasks.ext
21
- import { msToStamp, parseStampMs, nowMs } from '../../../core/db/time.js';
21
+ import { msToStamp, parseStampMs, nowMs } from '../../../../core/db/time.js';
22
22
 
23
23
  /** ext 的键名集中在这里(散着写迟早拼错一个)。 */
24
24
  export const EXT = Object.freeze({
@@ -10,15 +10,15 @@
10
10
  // 也没有从库里派生出来的镜像——要用正文就读插件类(activeTemplateOf)。
11
11
  // - 因此本文件只剩两个真正可写的键:`lt.timeoutSec` 与 `lt.appendMode`。
12
12
  import { db, txw } from './open.js';
13
- import { nowMs } from '../../../core/db/time.js';
13
+ import { nowMs } from '../../../../core/db/time.js';
14
14
  import {
15
15
  DEFAULT_TIMEOUT_SEC,
16
16
  MAX_TIMEOUT_SEC,
17
17
  clampTimeoutSec,
18
18
  } from '../store-io.js';
19
- import { clampAppendMode } from '../task-templates.js';
20
- import type { DbApi } from '../../../core/db/driver.js';
21
- import { activeTemplateOf } from '../../promptplug/index.js';
19
+ import { clampAppendMode } from '../../lifecycle/task-templates.js';
20
+ import type { DbApi } from '../../../../core/db/driver.js';
21
+ import { activeTemplateOf } from '../../../promptplug/index.js';
22
22
 
23
23
  const KEYS = {
24
24
  timeoutSec: 'lt.timeoutSec',
@@ -93,4 +93,4 @@ export function settingsView(): Record<string, any> {
93
93
  }
94
94
 
95
95
  export { DEFAULT_TIMEOUT_SEC, MAX_TIMEOUT_SEC } from '../store-io.js';
96
- export { DEFAULT_ACK_PROMPT } from '../task-templates.js';
96
+ export { DEFAULT_ACK_PROMPT } from '../../lifecycle/task-templates.js';
@@ -16,13 +16,13 @@
16
16
  // 闸门推出来的边不写 blockBy(由 blocksFollowing 表达)
17
17
  // 改动这两处语义时必须同步改 core/workflow/project.js(那边管 JSON 时代的口径)。
18
18
  import { db, txw } from './open.js';
19
- import { nowMs } from '../../../core/db/time.js';
19
+ import { nowMs } from '../../../../core/db/time.js';
20
20
  import { parseExt, TOPIC_EXT } from './rows.js';
21
21
  import { ensureTopic, updateTopic, getTopicRow } from './topics.js';
22
- import { listTaskRowsByTopic, insertTask, updateTask } from './tasks.js';
23
- import { topicToSnapshot } from '../../../core/workflow/project.js';
24
- import type { DbApi } from '../../../core/db/driver.js';
25
- import type { WorkflowSnapshot } from '../../../core/workflow/types.js';
22
+ import { listTaskRowsByTopic, insertTask, updateTask, alignClaimedFromSnapshot as repoAlignClaimedFromSnapshot } from './tasks.js';
23
+ import { topicToSnapshot } from '../../../../core/workflow/project.js';
24
+ import type { DbApi } from '../../../../core/db/driver.js';
25
+ import type { WorkflowSnapshot } from '../../../../core/workflow/types.js';
26
26
  import type { TopicRow } from './topics.js';
27
27
 
28
28
  /** 运行时快照允许挂 meta(cwd/name 落点;WorkflowSnapshot 类型未收编该字段)。 */
@@ -128,7 +128,7 @@ export function createDbTopicAdapter(): DbTopicAdapter {
128
128
  }
129
129
  }
130
130
 
131
- // ② 闸门 / 节点状态 → 行字段
131
+ // ② 闸门 / 节点状态 → 行字段(status 对齐走语义函数,其余字段走通用 patch)
132
132
  for (const node of snapshot.nodes || []) {
133
133
  const task = byId.get(String(node.id));
134
134
  if (!task) continue;
@@ -136,7 +136,9 @@ export function createDbTopicAdapter(): DbTopicAdapter {
136
136
  if (node.state === 'success') {
137
137
  if (!task.completedAt) patch.completedAt = nowStamp();
138
138
  } else if (node.state === 'running') {
139
- if (task.status !== 'claimed' && task.status !== 'done') patch.status = 'claimed';
139
+ // 外部 DAG 说在跑 → 本地对齐成 claimed(原子守卫;done/cancelled 不动)。
140
+ // 这是「对齐外部事实」不是「推进任务」,所以不走 claimTask。
141
+ repoAlignClaimedFromSnapshot(topic.id, Number(task.id));
140
142
  }
141
143
  const next = updateTask(topic.id, task.id, patch);
142
144
  if (next) byId.set(String(node.id), next);
@@ -10,10 +10,10 @@
10
10
  // 3. **队列顺序不在这里**:seq 是对外编号、不可变(trg_tasks_identity 锁死),
11
11
  // 顺序在 topics.ext.ext_task_order(见 repo/topics.js 顶部说明)。
12
12
  import { db, txw } from './open.js';
13
- import { nowMs } from '../../../core/db/time.js';
13
+ import { nowMs } from '../../../../core/db/time.js';
14
14
  import { EXT, parseExt, jsonText, rowToTask, splitTaskFields } from './rows.js';
15
- import { syncTaskAttachments } from '../../../core/attachmentdb.js';
16
- import type { DbApi } from '../../../core/db/driver.js';
15
+ import { syncTaskAttachments } from '../../../../core/attachmentdb.js';
16
+ import type { DbApi } from '../../../../core/db/driver.js';
17
17
  import type { TaskObject } from './rows.js';
18
18
 
19
19
  /** 任务行查询结果:原始 DB 行 + JSON 形态任务。 */
@@ -310,9 +310,86 @@ export function closeOpenTask(topicId: number, seq: number, { status = 'done', f
310
310
  });
311
311
  }
312
312
 
313
+ /**
314
+ * 定格为 cancelled(重开派生 / 搬家 tombstone / 批量取消共用)。
315
+ *
316
+ * 语义:**非终态一律定格**(pending / claimed / plan → cancelled;done 保持 done——
317
+ * 上一轮的交付事实不因重开而消失)。状态写入是带守卫的原子 UPDATE
318
+ * (`WHERE status NOT IN ('done','cancelled')`),并发下重复定格第二次拿 null。
319
+ * `extra` 是 tombstone 的审计字段(supersededBy / moveFrom),走 ext 合并——
320
+ * 它们不是状态,即使行已是 cancelled 也照写(重开一条已取消的任务要留派生标记)。
321
+ */
322
+ export function tombstoneAsCancelled(
323
+ topicId: number,
324
+ seq: number,
325
+ extra: { supersededBy?: unknown; moveFrom?: unknown; deletedAtMs?: number } = {},
326
+ ): TaskObject | null {
327
+ return txw((conn) => {
328
+ const cur = getTaskRow(topicId, seq, conn);
329
+ if (!cur) return null;
330
+ if (cur.task.status !== 'cancelled') {
331
+ const at = nowMs();
332
+ const r = conn.run(
333
+ `UPDATE tasks SET status = 'cancelled',
334
+ deleted_at = COALESCE(:del, deleted_at),
335
+ version = version + 1, updated_at = :at
336
+ WHERE topic_id = :t AND seq = :s AND status NOT IN ('done', 'cancelled')`,
337
+ { t: topicId, s: seq, del: extra.deletedAtMs ?? null, at }
338
+ );
339
+ if (Number(r.changes) !== 1) return null;
340
+ }
341
+ const extPatch: Record<string, unknown> = {};
342
+ if (extra.supersededBy !== undefined) extPatch[EXT.SUPERSEDED_BY] = extra.supersededBy;
343
+ if (extra.moveFrom !== undefined) extPatch[EXT.MOVE_FROM] = extra.moveFrom;
344
+ if (Object.keys(extPatch).length) mergeExt(conn, topicId, seq, extPatch);
345
+ return getTaskRow(topicId, seq, conn)!.task;
346
+ });
347
+ }
348
+
349
+ /**
350
+ * #126 草稿双向切换:pending ↔ plan,其余状态一律拒绝。
351
+ * 调用方(task-ops.setPlanStatus)负责产出友好的错误文案;这里的 WHERE 守卫
352
+ * 是并发层的最后防线——两个进程同时切同一条,只有一个 UPDATE 生效。
353
+ */
354
+ export function switchPlanStatus(topicId: number, seq: number, to: 'plan' | 'pending'): TaskObject | null {
355
+ const from = to === 'plan' ? 'pending' : 'plan';
356
+ return txw((conn) => {
357
+ const r = conn.run(
358
+ `UPDATE tasks SET status = :to, version = version + 1, updated_at = :at
359
+ WHERE topic_id = :t AND seq = :s AND status = :from AND deleted_at IS NULL`,
360
+ { t: topicId, s: seq, to, from, at: nowMs() }
361
+ );
362
+ if (Number(r.changes) !== 1) return null;
363
+ return getTaskRow(topicId, seq, conn)!.task;
364
+ });
365
+ }
366
+
367
+ /**
368
+ * 引擎快照对齐:外部 DAG 说节点在跑(node.state === 'running'),本地还没对齐
369
+ * 就单向推成 claimed。这是「对齐外部事实」不是「推进任务」——不走 claimTask,
370
+ * 因为没有领取人 / 摘要可写(见 tests/unit 的 snapshot 对齐用例)。
371
+ * 守卫与跃迁表一致:done / cancelled 不许被对齐改写,已是 claimed 幂等跳过。
372
+ */
373
+ export function alignClaimedFromSnapshot(topicId: number, seq: number): boolean {
374
+ return txw((conn) => {
375
+ const r = conn.run(
376
+ `UPDATE tasks SET status = 'claimed', claimed_at = :at, version = version + 1, updated_at = :at
377
+ WHERE topic_id = :t AND seq = :s AND status NOT IN ('claimed', 'done')`,
378
+ { t: topicId, s: seq, at: nowMs() }
379
+ );
380
+ return Number(r.changes) === 1;
381
+ });
382
+ }
383
+
313
384
  /**
314
385
  * 字段级更新(reopen / update / 软删 / 恢复都用它)。
315
386
  * `patch` 是 JSON 形态的字段子集;写不进任何列的低频字段进 ext。
387
+ *
388
+ * **status 不在可更新列里**(2026-11-19 收敛):状态流转只能走上面的语义函数
389
+ * (tombstoneAsCancelled / switchPlanStatus / alignClaimedFromSnapshot)或
390
+ * claimTask / completeTask / closeOpenTask 的带守卫 UPDATE。这样「所有状态
391
+ * 修改必然经过守卫」成为结构约束,不再依赖调用方自觉。
392
+ *
316
393
  * @returns {object|null} 更新后的 JSON 形态任务
317
394
  */
318
395
  export function updateTask(topicId: number, seq: number, patch: TaskPatch = {}): TaskObject | null {
@@ -325,7 +402,8 @@ export function updateTask(topicId: number, seq: number, patch: TaskPatch = {}):
325
402
  const params: Record<string, any> = { t: topicId, s: seq, at: nowMs() };
326
403
  const colMap: Record<string, string> = {
327
404
  body: 'body',
328
- status: 'status',
405
+ // status 刻意不在列:状态流转只能走本文件的语义函数(见上方 updateTask 注释),
406
+ // 通用 patch 若能直写 status,「带守卫 UPDATE」就成了可绕过的摆设。
329
407
  feedback: 'feedback',
330
408
  claimedAtMs: 'claimed_at',
331
409
  doneAtMs: 'done_at',
@@ -1,11 +1,11 @@
1
1
  // 主题仓储(topics + topic_presence 的窄方法)。
2
2
 
3
3
  import { db, txw } from './open.js';
4
- import { nowMs, msToStamp } from '../../../core/db/time.js';
5
- import { GLOBAL_TOPIC_KEY } from '../../../core/topic-key.js';
4
+ import { nowMs, msToStamp } from '../../../../core/db/time.js';
5
+ import { GLOBAL_TOPIC_KEY } from '../../../../core/topic-key.js';
6
6
  import { TOPIC_EXT, parseExt, jsonText } from './rows.js';
7
7
  import { listTaskRowsByTopic, listAllTaskRows } from './tasks.js';
8
- import type { DbApi } from '../../../core/db/driver.js';
8
+ import type { DbApi } from '../../../../core/db/driver.js';
9
9
  import type { TaskObject } from './rows.js';
10
10
 
11
11
  const SENTINEL_REPO = '__unbound__';
@@ -19,7 +19,7 @@ export interface RepoContextIndex {
19
19
  let reposMod: ReposModule = null;
20
20
  export async function repoContextIndex(): Promise<RepoContextIndex | null> {
21
21
  try {
22
- if (!reposMod) reposMod = await import('../repos/service.js');
22
+ if (!reposMod) reposMod = await import('../../repos/service.js');
23
23
  return { mod: reposMod, map: await reposMod.contextMap() };
24
24
  } catch {
25
25
  return null;
@@ -1,7 +1,7 @@
1
1
  // Scheduler —— 听 bus → 拓扑就绪;永不调用 onGet
2
2
  import { EVENTS } from '../bus/index.js';
3
3
  import { driveReadyStates } from './state-drive.js';
4
- import type { WorkflowSnapshot } from '../../../core/workflow/types.js';
4
+ import type { WorkflowSnapshot } from '../../../../core/workflow/types.js';
5
5
  import type { SnapshotStoreLike } from '../mutator/index.js';
6
6
 
7
7
  /** createEventBus 的出站形状。 */
@@ -1,7 +1,7 @@
1
- import { isNodeReady } from '../../../core/workflow/readiness.js';
2
- import type { WfGraph } from '../../../core/workflow/readiness.js';
3
- import { isBarrierOpen } from '../../tasktool/plugins/blockgoal.js';
4
- import type { WorkflowSnapshot } from '../../../core/workflow/types.js';
1
+ import { isNodeReady } from '../../../../core/workflow/readiness.js';
2
+ import type { WfGraph } from '../../../../core/workflow/readiness.js';
3
+ import { isBarrierOpen } from '../../../goals/plugins/blockgoal.js';
4
+ import type { WorkflowSnapshot } from '../../../../core/workflow/types.js';
5
5
 
6
6
  /** driveReadyStates 的出站形状。 */
7
7
  export interface DriveResult {
@@ -1,7 +1,7 @@
1
1
  import { mkdir, readFile, rename, writeFile } from 'node:fs/promises';
2
2
  import { dirname, join } from 'node:path';
3
- import { APP_DIR } from '../../../core/paths.js';
4
- import type { WorkflowSnapshot } from '../../../core/workflow/types.js';
3
+ import { APP_DIR } from '../../../../core/paths.js';
4
+ import type { WorkflowSnapshot } from '../../../../core/workflow/types.js';
5
5
 
6
6
  function defaultDir(): string {
7
7
  return process.env.NX_KV_WORKFLOW_STORE || join(APP_DIR, 'workflows');
@@ -3,11 +3,11 @@ import crypto from 'node:crypto';
3
3
  import { createMemoryAdapter } from './memory-adapter.js';
4
4
  import { createFileAdapter } from './file-adapter.js';
5
5
 
6
- /** @typedef {import('../../../core/workflow/types.js').WorkflowSnapshot} WorkflowSnapshot */
7
- /** @typedef {import('../../../core/workflow/types.js').InitMeta} InitMeta */
6
+ /** @typedef {import('../../../../core/workflow/types.js').WorkflowSnapshot} WorkflowSnapshot */
7
+ /** @typedef {import('../../../../core/workflow/types.js').InitMeta} InitMeta */
8
8
 
9
- import type { WorkflowSnapshot } from '../../../core/workflow/types.js';
10
- import type { InitMeta } from '../../../core/workflow/types.js';
9
+ import type { WorkflowSnapshot } from '../../../../core/workflow/types.js';
10
+ import type { InitMeta } from '../../../../core/workflow/types.js';
11
11
 
12
12
  /** 运行时快照允许挂 `meta`(InitMeta.cwd / meta 落点;WorkflowSnapshot 类型未收编该字段)。 */
13
13
  type SnapWithMeta = WorkflowSnapshot & { meta?: Record<string, unknown> };
@@ -1,6 +1,6 @@
1
- /** @typedef {import('../../../core/workflow/types.js').WorkflowSnapshot} WorkflowSnapshot */
1
+ /** @typedef {import('../../../../core/workflow/types.js').WorkflowSnapshot} WorkflowSnapshot */
2
2
 
3
- import type { WorkflowSnapshot } from '../../../core/workflow/types.js';
3
+ import type { WorkflowSnapshot } from '../../../../core/workflow/types.js';
4
4
 
5
5
  /** 快照存储适配器接口:get/set/has/delete 四件套 + clear(file/memory 三实现可互换)。 */
6
6
  export interface SnapshotAdapter {
@@ -10,7 +10,7 @@
10
10
  // loadStore() / saveStore(data) / topicOf(store,...) / nextTaskId(tasks)
11
11
  // —— 任何「读全表到内存 → 改 → 整表重写」的写法都被禁止:那会把 SQLite 的
12
12
  // 行级守卫(claim 的 WHERE status='pending')退化成「最后写入者赢」。
13
- import { badInput } from '../../core/errors.js';
13
+ import { badInput } from '../../../core/errors.js';
14
14
 
15
15
  export const DEFAULT_TIMEOUT_MS = 180_000; // 阻塞默认 3 分钟(推荐值)
16
16
  export const DEFAULT_TIMEOUT_SEC = 180; // 推荐阻塞时长(3 分钟)
@@ -1,9 +1,9 @@
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
- import { normalizeBlockBy, parseDepRef } from '../../core/workflow/readiness.js';
6
- import { isGateNode } from '../../core/workflow/types.js';
5
+ import { normalizeBlockBy, parseDepRef } from '../../../core/workflow/readiness.js';
6
+ import { isGateNode } from '../../../core/workflow/types.js';
7
7
  import type { DagMutator } from './mutator/index.js';
8
8
  import type { SnapshotStoreLike } from './mutator/index.js';
9
9