nx-kv 0.66.2 → 0.67.0

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 (153) hide show
  1. package/CHANGELOG.md +69 -0
  2. package/assets/nx-kv/references/A02-/346/217/220/344/272/244/344/273/273/345/212/241.md +6 -7
  3. package/assets/nx-kv/references/A03-/346/226/207/346/241/243/344/270/216/345/275/222/345/261/236.md +1 -1
  4. package/assets/nx-kv/references/B02-CLI/351/200/237/346/237/245.md +2 -2
  5. package/package.json +1 -1
  6. package/src/core/attachmentdb/ids.ts +14 -1
  7. package/src/core/attachmentdb/query.ts +0 -38
  8. package/src/core/attachmentdb/repo.ts +98 -0
  9. package/src/core/attachmentdb.ts +5 -1
  10. package/src/core/db/import-json/tasks.ts +10 -9
  11. package/src/core/db/import-json.ts +16 -6
  12. package/src/core/db/index.ts +1 -1
  13. package/src/core/db/migrations/index.ts +2 -0
  14. package/src/core/db/migrations/v15.sql +88 -0
  15. package/src/core/db/verify.ts +7 -3
  16. package/src/core/db/version.ts +4 -1
  17. package/src/core/topic-key.ts +5 -8
  18. package/src/core/workflow/readiness.ts +1 -1
  19. package/src/core/workflow/types.ts +1 -1
  20. package/src/modules/claim/assemble.ts +0 -5
  21. package/src/modules/claim/host.ts +2 -4
  22. package/src/modules/claim/preview.ts +0 -1
  23. package/src/modules/claim/wait.ts +9 -49
  24. package/src/modules/docs/actions/docs-detach.ts +1 -2
  25. package/src/modules/docs/attach.ts +3 -17
  26. package/src/modules/docs/render.ts +4 -13
  27. package/src/modules/localtask/actions/localtask-add.ts +1 -3
  28. package/src/modules/localtask/actions/localtask-attach.ts +4 -2
  29. package/src/modules/localtask/actions/localtask-boardtasks.ts +0 -1
  30. package/src/modules/localtask/actions/localtask-clone.ts +1 -1
  31. package/src/modules/localtask/actions/localtask-config.ts +2 -11
  32. package/src/modules/localtask/actions/localtask-detach.ts +1 -3
  33. package/src/modules/localtask/infra/events.ts +5 -5
  34. package/src/modules/localtask/infra/repo/rows.ts +0 -1
  35. package/src/modules/localtask/infra/repo/settings.ts +1 -9
  36. package/src/modules/localtask/infra/repo/topics.ts +0 -4
  37. package/src/modules/localtask/lifecycle/add.ts +2 -9
  38. package/src/modules/localtask/lifecycle/deletion.ts +7 -15
  39. package/src/modules/localtask/lifecycle/task-lifecycle.ts +2 -2
  40. package/src/modules/localtask/lifecycle/task-ops.ts +14 -56
  41. package/src/modules/localtask/lifecycle/task-templates.ts +0 -13
  42. package/src/modules/localtask/lifecycle/task-view.ts +2 -3
  43. package/src/modules/localtask/lifecycle/topics.ts +3 -8
  44. package/src/modules/localtask/ops/attach-resource.ts +46 -4
  45. package/src/modules/localtask/ops/attach-template.ts +73 -3
  46. package/src/modules/localtask/ops/attach.ts +45 -18
  47. package/src/modules/localtask/paths.ts +7 -17
  48. package/src/modules/localtask/service.ts +3 -7
  49. package/src/modules/localtask/ui/action-flags.ts +2 -2
  50. package/src/modules/localtask/ui/action-render.ts +7 -19
  51. package/src/modules/localtask/waiting.ts +1 -8
  52. package/src/modules/promptplug/compose.ts +1 -3
  53. package/src/modules/promptplug/plugins/attachment.ts +56 -6
  54. package/src/modules/promptplug/plugins/context.ts +11 -2
  55. package/src/modules/promptplug/template-store.ts +25 -3
  56. package/src/modules/templates/scope.ts +1 -1
  57. package/src/shared/prompt-blocks.ts +2 -23
  58. package/src/web/frontend/App.tsx +4 -9
  59. package/src/web/frontend/api/cli-tree.json +6 -6
  60. package/src/web/frontend/api/client.generated.ts +11 -11
  61. package/src/web/frontend/api/tasks.ts +117 -0
  62. package/src/web/frontend/components/Introduction/index.tsx +50 -3
  63. package/src/web/frontend/components/Introduction/style.css +6 -0
  64. package/src/web/frontend/components/Introduction/use-intro.ts +25 -0
  65. package/src/web/frontend/components/md/attachments/attach-area.tsx +9 -11
  66. package/src/web/frontend/components/md/attachments/attach-common.ts +12 -5
  67. package/src/web/frontend/components/md/attachments/attach-modal.tsx +54 -9
  68. package/src/web/frontend/components/md/attachments/attach-repo-pick.tsx +48 -0
  69. package/src/web/frontend/components/sidebar/index.tsx +52 -48
  70. package/src/web/frontend/components/sidebar/model.ts +16 -32
  71. package/src/web/frontend/components/sidebar/queue-nav.ts +3 -4
  72. package/src/web/frontend/components/sidebar/row-menu.tsx +1 -1
  73. package/src/web/frontend/components/sidebar/task-children.tsx +53 -32
  74. package/src/web/frontend/{page/dir → components/task-panel}/dag-editor.tsx +1 -1
  75. package/src/web/frontend/components/task-panel/task-ops.ts +299 -0
  76. package/src/web/frontend/components/task-panel/task-page.tsx +495 -0
  77. package/src/web/frontend/components/tool-acts/modules.ts +3 -0
  78. package/src/web/frontend/modules/board/board-view.ts +2 -56
  79. package/src/web/frontend/modules/md/doc-store.ts +2 -3
  80. package/src/web/frontend/page/dag/head-bar.tsx +0 -1
  81. package/src/web/frontend/page/dag/index.tsx +1 -4
  82. package/src/web/frontend/page/dag/model.ts +0 -1
  83. package/src/web/frontend/page/dir/api.ts +4 -108
  84. package/src/web/frontend/page/dir/index.tsx +161 -348
  85. package/src/web/frontend/page/dir/task-actions.ts +20 -32
  86. package/src/web/frontend/page/dir/task-board-section.tsx +3 -0
  87. package/src/web/frontend/page/dir/task-chain.ts +6 -10
  88. package/src/web/frontend/page/dir/task-dock-panel.tsx +3 -6
  89. package/src/web/frontend/page/dir/task-feedback.ts +9 -17
  90. package/src/web/frontend/page/dir/task-not-found.tsx +2 -3
  91. package/src/web/frontend/page/dir/task-utils.ts +0 -1
  92. package/src/web/frontend/page/dir/task.tsx +14 -18
  93. package/src/web/frontend/page/doc/doc-dock.tsx +1 -1
  94. package/src/web/frontend/page/group/api.ts +3 -21
  95. package/src/web/frontend/page/group/group-project-memo.ts +41 -0
  96. package/src/web/frontend/page/group/index.tsx +289 -429
  97. package/src/web/frontend/page/progress/index.tsx +7 -12
  98. package/src/web/frontend/page/settings/api.ts +1 -2
  99. package/src/web/frontend/page/settings/prompt-templates-section.tsx +12 -44
  100. package/src/web/frontend/panels.tsx +1 -1
  101. package/src/web/frontend/registry.ts +1 -2
  102. package/src/web/frontend/route-map.ts +0 -1
  103. package/src/web/frontend/routes/dir.ts +1 -4
  104. package/src/web/frontend/routes/keys.ts +5 -3
  105. package/src/web/frontend/svghub/catalog-nav.ts +8 -11
  106. package/src/web/public/assets/app-context-CngKv8Tc.js +1 -0
  107. package/src/web/public/assets/{bar-Dy_QDX2h.js → bar-C0Q_Qe4z.js} +1 -1
  108. package/src/web/public/assets/board-view-C8OQhkyi.js +1 -0
  109. package/src/web/public/assets/{button-3JlUeln_.js → button-Cs6w2CDi.js} +1 -1
  110. package/src/web/public/assets/{composer-launch-B7DH53Yf.js → composer-launch-BF3_hyn5.js} +1 -1
  111. package/src/web/public/assets/{composer-panel-Cj1J16r-.js → composer-panel-D6vBrzCs.js} +1 -1
  112. package/src/web/public/assets/{dag-DXRPHVl8.js → dag-CZF6sV2_.js} +1 -1
  113. package/src/web/public/assets/dir-6RhnWw1E.js +1 -0
  114. package/src/web/public/assets/doc-CVIVBV6n.js +6 -0
  115. package/src/web/public/assets/doc-DgYKv2wo.css +1 -0
  116. package/src/web/public/assets/group-AF62Z-_G.js +1 -0
  117. package/src/web/public/assets/group-project-memo-G-O6sPRw.js +1 -0
  118. package/src/web/public/assets/index-Bposj22Z.js +3 -0
  119. package/src/web/public/assets/{list-filter-CWxiOSg_.js → list-search-DFvFY408.js} +1 -1
  120. package/src/web/public/assets/md-history-COQu16vy.js +47 -0
  121. package/src/web/public/assets/{member-picker-BZgE3HGb.js → member-picker-CHX0nS0O.js} +1 -1
  122. package/src/web/public/assets/popup-dBtYqEM1.js +1 -0
  123. package/src/web/public/assets/progress-CDh6DY7g.js +3 -0
  124. package/src/web/public/assets/refs-t79ynSY8.js +2 -0
  125. package/src/web/public/assets/reopen-text-B2d9SZi0.js +13 -0
  126. package/src/web/public/assets/{repo-form-modal-CNLYR12c.js → repo-form-modal-dZqpHyUj.js} +1 -1
  127. package/src/web/public/assets/{repos-BGx-yAXd.js → repos-DdhOQJqF.js} +9 -9
  128. package/src/web/public/assets/{route-crumb-DX9C4jmQ.js → route-crumb-BKq2jry0.js} +1 -1
  129. package/src/web/public/assets/settings-Bk3clN2f.js +1 -0
  130. package/src/web/public/assets/task-C8nax2rT.js +13 -0
  131. package/src/web/public/assets/task-ops-D6E_TgEC.js +2 -0
  132. package/src/web/public/assets/task-utils-Dh33OFKe.js +1 -0
  133. package/src/web/public/assets/{templates-Co1Qb1aA.js → templates-Dusbff7Z.js} +3 -3
  134. package/src/web/public/assets/{tool-bar-D5wLBLRl.js → tool-bar-DPXnjdQF.js} +2 -2
  135. package/src/web/public/assets/use-rail-drag-B6J0iqFK.js +1 -0
  136. package/src/web/public/index.html +13 -13
  137. package/src/web/frontend/page/dir/landing.tsx +0 -553
  138. package/src/web/public/assets/app-context-BqCBcDsx.js +0 -1
  139. package/src/web/public/assets/board-view-Cm8189wG.js +0 -1
  140. package/src/web/public/assets/dir-_M1ciSxM.js +0 -3
  141. package/src/web/public/assets/doc-Iuxssa-b.css +0 -1
  142. package/src/web/public/assets/doc-_iteSM2X.js +0 -6
  143. package/src/web/public/assets/get-loop-modal-DlAfqJMz.js +0 -2
  144. package/src/web/public/assets/group-CH8qe-eg.js +0 -1
  145. package/src/web/public/assets/index-Cui4IuGj.js +0 -3
  146. package/src/web/public/assets/md-history-Bj790fdn.js +0 -46
  147. package/src/web/public/assets/popup-DZ2Khv2c.js +0 -1
  148. package/src/web/public/assets/progress-MPse2JLQ.js +0 -3
  149. package/src/web/public/assets/refs-DiIPoqnJ.js +0 -2
  150. package/src/web/public/assets/settings-Pt4YgGdY.js +0 -1
  151. package/src/web/public/assets/task-DOIIpQ4X.js +0 -13
  152. package/src/web/public/assets/task-utils-CJfMODCP.js +0 -13
  153. package/src/web/public/assets/use-rail-drag-CNOHXWng.js +0 -1
@@ -18,7 +18,6 @@ export interface DagNode extends LocalTask {
18
18
  timegoal?: { duration?: string } | null;
19
19
  topicKey: string;
20
20
  topicCwd?: string;
21
- topicIsGlobal?: boolean;
22
21
  projectName?: string;
23
22
  nodeKey: string;
24
23
  }
@@ -2,30 +2,13 @@
2
2
  // 这里的函数,不直接调 api()(模板约定)。
3
3
  //
4
4
  // 只搬调用不改语义:路径 / 方法 / body 与收口前逐字一致。
5
- // scope:主题定位二选一——{ cwd } 或 { key }(全局池用 key=__GLOBAL__)。
5
+ // #251 起任务 CRUD / 批量那一组下沉到 api/tasks.ts(组页与任务页模板共用),
6
+ // 这里 re-export 保持既有 import 面不变。
6
7
  import { api } from '../../api/client.js';
8
+ import type { TaskMutationResult } from '../../api/tasks.js';
7
9
  import type { ChainApi, GoalLogData } from './task-utils.js';
8
10
 
9
- /** 主题定位:cwd(目录主题)或 key(含全局池)。 */
10
- export type TaskScope = { cwd?: string; key?: string };
11
-
12
- /** 变更类返回的公共形状:task=落地后的任务;key/moved/name=落点与归属迁移提示。 */
13
- export interface TaskMutationResult {
14
- task?: { id?: number | string; text?: string };
15
- id?: number | string;
16
- key?: string;
17
- moved?: boolean;
18
- name?: string;
19
- }
20
-
21
- /** 批量操作返回:count=处理条数;skipped/missing=跳过 / 未找到的编号。 */
22
- export interface TaskBulkResult {
23
- count?: number;
24
- skipped?: Array<number | string>;
25
- missing?: Array<number | string>;
26
- /** closeMany 专用:本轮收口里「原本已被领取」的编号(#184 面板提示用)。 */
27
- claimedClosed?: Array<number | string>;
28
- }
11
+ export * from '../../api/tasks.js';
29
12
 
30
13
  /** 任务链(GET /api/localtasks/chain?<q>)。 */
31
14
  export function getTaskChain(query: string): Promise<ChainApi> {
@@ -37,93 +20,6 @@ export function getGoalLog(query: string): Promise<GoalLogData> {
37
20
  return api(`/api/localtasks/timegoal-log?${query}`);
38
21
  }
39
22
 
40
- /** 队列内调序(PATCH /api/localtasks/reorder;beforeId / afterId 二选一)。 */
41
- export function reorderTask(
42
- body: TaskScope & { id: number; beforeId?: number | string; afterId?: number | string },
43
- ): Promise<unknown> {
44
- return api('/api/localtasks/reorder', { method: 'PATCH', body });
45
- }
46
-
47
- export interface PatchTaskItemBody extends TaskScope {
48
- id: number;
49
- text?: string;
50
- gate?: boolean;
51
- blockBy?: string | number[];
52
- duration?: string;
53
- clearGoal?: boolean;
54
- goalPrompt?: string;
55
- summary?: string;
56
- [k: string]: unknown;
57
- }
58
-
59
- /** 编辑单个本地任务(PATCH /api/localtasks/item;CLI localtask update 等价)。 */
60
- export function patchTaskItem(body: PatchTaskItemBody): Promise<TaskMutationResult> {
61
- return api('/api/localtasks/item', { method: 'PATCH', body });
62
- }
63
-
64
- /**
65
- * 按查询串查单条任务(GET /api/localtasks/item?<q>)。
66
- * 找不到或出错返回 null(调用方以 null 判「没有这条」)。
67
- */
68
- export function findTaskItem(query: string): Promise<any> {
69
- return api(`/api/localtasks/item?${query}`).catch(() => null);
70
- }
71
-
72
- export interface AddTaskBody extends TaskScope {
73
- global?: boolean;
74
- text: string;
75
- forkOf?: string;
76
- forkKind?: string;
77
- board?: string;
78
- project?: string;
79
- [k: string]: unknown;
80
- }
81
-
82
- /** 加任务(POST /api/localtasks;CLI localtask add 等价)。 */
83
- export function addTask(body: AddTaskBody): Promise<any> {
84
- return api('/api/localtasks', { method: 'POST', body });
85
- }
86
-
87
- /**
88
- * #126:在 pending ↔ plan 之间切换一条任务(PATCH /api/localtasks/plan)。
89
- * plan 是不进队列的临时草稿,get/wait 都领不到;转回 pending 才重新排队。
90
- */
91
- export function setPlanStatus(body: TaskScope & { id: number; to: 'plan' | 'pending' }): Promise<any> {
92
- return api('/api/localtasks/plan', { method: 'PATCH', body });
93
- }
94
-
95
- /** 重开 / 追加反馈(POST /api/localtasks/reopen;kind=reopen|comment)。 */
96
- export function postReopen(body: Record<string, unknown>): Promise<TaskMutationResult> {
97
- return api('/api/localtasks/reopen', { method: 'POST', body });
98
- }
99
-
100
- /** 删除单个本地任务(DELETE /api/localtasks/item;purge=true 彻底删除)。 */
101
- export function removeTaskItem(body: TaskScope & { id: number; purge?: boolean }): Promise<unknown> {
102
- return api('/api/localtasks/item', { method: 'DELETE', body });
103
- }
104
-
105
- /** 批量软删除(DELETE /api/localtasks/items)。 */
106
- export function removeManyTasks(body: TaskScope & { ids: unknown[] }): Promise<TaskBulkResult> {
107
- return api('/api/localtasks/items', { method: 'DELETE', body });
108
- }
109
-
110
- /** 批量取消(POST /api/localtasks/items/cancel)。 */
111
- export function cancelManyTasks(body: TaskScope & { ids: unknown[] }): Promise<TaskBulkResult> {
112
- return api('/api/localtasks/items/cancel', { method: 'POST', body });
113
- }
114
-
115
- /** 批量收口(POST /api/localtasks/items/close;status=done|cancelled)。 */
116
- export function closeManyTasks(
117
- body: TaskScope & { ids: unknown[]; status: string; summary?: string },
118
- ): Promise<TaskBulkResult> {
119
- return api('/api/localtasks/items/close', { method: 'POST', body });
120
- }
121
-
122
- /** 恢复软删除的任务(POST /api/localtasks/tasks/restore)。 */
123
- export function restoreTaskItem(body: TaskScope & { id: number }): Promise<unknown> {
124
- return api('/api/localtasks/tasks/restore', { method: 'POST', body });
125
- }
126
-
127
23
  /** 克隆任务(POST /api/localtasks/clone)。 */
128
24
  export function cloneTask(body: { id: number; cwd?: string }): Promise<TaskMutationResult> {
129
25
  return api('/api/localtasks/clone', { method: 'POST', body });