nx-kv 0.65.3 → 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.
- package/CHANGELOG.md +20 -0
- package/README.md +15 -37
- package/assets/nx-kv/QUICKSTART.md +110 -0
- 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
- package/assets/nx-kv/references/B02-CLI/351/200/237/346/237/245.md +1 -2
- package/package.json +1 -1
- package/src/core/config.ts +23 -0
- package/src/core/instruction-template.ts +1 -1
- package/src/core/workflow/project.ts +1 -1
- package/src/core/workflow/types.ts +1 -1
- package/src/modules/claim/actions/_manifest.generated.ts +0 -3
- package/src/modules/claim/actions/localtask-claim.ts +3 -3
- package/src/modules/claim/actions/localtask-preview.ts +2 -2
- package/src/modules/{delivery → claim}/assemble.ts +3 -3
- package/src/modules/claim/get.ts +3 -4
- package/src/modules/{delivery → claim}/groupctx.ts +4 -7
- package/src/modules/{delivery → claim}/host.ts +4 -4
- package/src/modules/claim/index.ts +1 -1
- package/src/modules/claim/panel-escort.ts +1 -1
- package/src/modules/claim/params.ts +2 -2
- package/src/modules/{delivery → claim}/preview.ts +3 -3
- package/src/modules/claim/wait.ts +14 -14
- package/src/modules/claim/waitgoal-config.ts +1 -22
- package/src/modules/docs/actions/_manifest.generated.ts +12 -0
- package/src/modules/{repos → docs}/actions/repo-doc-add.ts +3 -2
- package/src/modules/{repos → docs}/actions/repo-doc-list.ts +3 -2
- package/src/modules/{repos → docs}/actions/repo-doc-remove.ts +3 -2
- package/src/modules/{repos → docs}/actions/repo-knowledge.ts +3 -2
- package/src/modules/docs/knowledge.ts +8 -16
- package/src/modules/goals/actions/timegoal-check.ts +1 -1
- package/src/modules/goals/actions/timegoal-clear.ts +1 -1
- package/src/modules/goals/actions/timegoal-list.ts +1 -1
- package/src/modules/goals/actions/timegoal-log.ts +1 -1
- package/src/modules/goals/actions/timegoal-set.ts +1 -1
- package/src/modules/goals/actions/timegoal-show.ts +1 -1
- package/src/modules/goals/actions/timegoal-update.ts +1 -1
- package/src/modules/goals/plugins/timegoal-cwd-store.ts +1 -1
- package/src/modules/goals/plugins/timegoal-store.ts +3 -3
- package/src/modules/goals/plugins/timegoal-task-store.ts +2 -2
- package/src/modules/{localtask → goals}/support.ts +3 -1
- package/src/modules/localtask/actions/localtask-add.ts +3 -3
- package/src/modules/localtask/actions/localtask-attach-note.ts +1 -1
- package/src/modules/localtask/actions/localtask-attach.ts +1 -1
- package/src/modules/localtask/actions/localtask-attachments.ts +2 -2
- package/src/modules/localtask/actions/localtask-cancel.ts +1 -1
- package/src/modules/localtask/actions/localtask-chain.ts +1 -1
- package/src/modules/localtask/actions/localtask-detach.ts +2 -2
- package/src/modules/localtask/actions/localtask-done.ts +1 -1
- package/src/modules/localtask/actions/localtask-get.ts +3 -3
- package/src/modules/localtask/actions/localtask-list.ts +1 -1
- package/src/modules/localtask/actions/localtask-reopen.ts +5 -5
- package/src/modules/localtask/actions/localtask-topic-removeMany.ts +1 -1
- package/src/modules/localtask/actions/localtask-update.ts +2 -2
- package/src/modules/localtask/{bus → infra/bus}/index.ts +1 -1
- package/src/modules/localtask/{engine.ts → infra/engine.ts} +1 -1
- package/src/modules/localtask/{events.ts → infra/events.ts} +3 -3
- package/src/modules/localtask/{mutator → infra/mutator}/index.ts +2 -2
- package/src/modules/localtask/{mutator → infra/mutator}/validate.ts +4 -4
- package/src/modules/localtask/{repo → infra/repo}/goals.ts +2 -2
- package/src/modules/localtask/{repo → infra/repo}/index.ts +1 -1
- package/src/modules/localtask/{repo → infra/repo}/links.ts +2 -2
- package/src/modules/localtask/{repo → infra/repo}/open.ts +4 -4
- package/src/modules/localtask/{repo → infra/repo}/presence.ts +1 -1
- package/src/modules/localtask/{repo → infra/repo}/rows.ts +1 -1
- package/src/modules/localtask/{repo → infra/repo}/settings.ts +5 -5
- package/src/modules/localtask/{repo → infra/repo}/snapshot.ts +9 -7
- package/src/modules/localtask/{repo → infra/repo}/tasks.ts +82 -4
- package/src/modules/localtask/{repo → infra/repo}/topics.ts +3 -3
- package/src/modules/localtask/{repo-ctx.ts → infra/repo-ctx.ts} +1 -1
- package/src/modules/localtask/{scheduler → infra/scheduler}/index.ts +1 -1
- package/src/modules/localtask/{scheduler → infra/scheduler}/state-drive.ts +4 -4
- package/src/modules/localtask/{store → infra/store}/file-adapter.ts +2 -2
- package/src/modules/localtask/{store → infra/store}/index.ts +4 -4
- package/src/modules/localtask/{store → infra/store}/memory-adapter.ts +2 -2
- package/src/modules/localtask/{store-io.ts → infra/store-io.ts} +1 -1
- package/src/modules/localtask/{writes.ts → infra/writes.ts} +3 -3
- package/src/modules/localtask/{add.ts → lifecycle/add.ts} +5 -5
- package/src/modules/localtask/{deletion.ts → lifecycle/deletion.ts} +4 -4
- package/src/modules/localtask/{task-lifecycle.ts → lifecycle/task-lifecycle.ts} +16 -17
- package/src/modules/localtask/{task-ops.ts → lifecycle/task-ops.ts} +14 -14
- package/src/modules/localtask/{task-remove.ts → lifecycle/task-remove.ts} +4 -4
- package/src/modules/localtask/{task-templates.ts → lifecycle/task-templates.ts} +2 -2
- package/src/modules/localtask/{task-view.ts → lifecycle/task-view.ts} +14 -13
- package/src/modules/localtask/{topics.ts → lifecycle/topics.ts} +7 -7
- package/src/modules/localtask/{update.ts → lifecycle/update.ts} +5 -5
- package/src/modules/{delivery → localtask/ops}/attach-resource.ts +4 -4
- package/src/modules/{delivery → localtask/ops}/attach-template.ts +3 -3
- package/src/modules/{delivery → localtask/ops}/attach.ts +11 -11
- package/src/modules/localtask/{board-target.ts → ops/board-target.ts} +1 -1
- package/src/modules/{delivery → localtask/ops}/doc-inline.ts +3 -3
- package/src/modules/localtask/{group-store.ts → ops/group-store.ts} +1 -1
- package/src/modules/localtask/service.ts +16 -16
- package/src/modules/localtask/{action-render.ts → ui/action-render.ts} +2 -2
- package/src/modules/localtask/{panel-guard.ts → ui/panel-guard.ts} +1 -1
- package/src/modules/localtask/{panel-presence.ts → ui/panel-presence.ts} +6 -6
- package/src/modules/localtask/waiters.ts +2 -2
- package/src/modules/localtask/waiting.ts +1 -1
- package/src/modules/promptplug/factory.ts +2 -2
- package/src/modules/promptplug/index.ts +5 -5
- package/src/modules/promptplug/plugins/attachment.ts +1 -1
- package/src/modules/promptplug/plugins/context.ts +9 -20
- package/src/modules/repos/actions/_manifest.generated.ts +0 -12
- package/src/modules/repos/service/crud.ts +1 -1
- package/src/runtime/cli.ts +1 -1
- package/src/runtime/registry.ts +0 -2
- package/src/{modules/delivery → shared}/delivery-text.ts +5 -4
- package/src/shared/feedback-text.ts +80 -20
- package/src/shared/task-status.ts +42 -0
- package/src/web/frontend/api/cli-tree.json +73 -88
- package/src/web/frontend/api/client.generated.ts +51 -51
- package/src/web/frontend/modules/board/ack-nodes.ts +10 -13
- package/src/web/frontend/modules/board/reopen-text.ts +5 -0
- package/src/web/frontend/modules/md/styles/editor.css +8 -0
- package/src/web/public/assets/{bar-Dc5Tq1eE.js → bar-kaVB6FAa.js} +1 -1
- package/src/web/public/assets/{board-view-BVennxTs.js → board-view-Cwot54HC.js} +1 -1
- package/src/web/public/assets/{composer-launch-fp2IzGzQ.js → composer-launch-BMTU-BD9.js} +1 -1
- package/src/web/public/assets/{composer-panel-Dh681iO6.js → composer-panel-BF6gjNXv.js} +1 -1
- package/src/web/public/assets/{dag-DnaU0I_z.js → dag-BRE33yI8.js} +1 -1
- package/src/web/public/assets/dir-B0IW4NIn.js +3 -0
- package/src/web/public/assets/{doc-DRSKD0Re.js → doc-DsRb-4WT.js} +1 -1
- package/src/web/public/assets/frontmatter-Bcseml1q.js +2 -0
- package/src/web/public/assets/{group-Dc3ZgW24.js → group-CS8VP6z0.js} +1 -1
- package/src/web/public/assets/{index-Bg0m8gbJ.js → index-BT2y9cTX.js} +2 -2
- package/src/web/public/assets/{index-BIVxGd6t.css → index-DSAamoav.css} +1 -1
- package/src/web/public/assets/{md-history-DNtgaIdH.js → md-history-CJ1N9-Jf.js} +1 -1
- package/src/web/public/assets/{md-parse-C9Vd6ejP.js → md-parse-DAYCREP1.js} +1 -1
- package/src/web/public/assets/{model-CtG2jIDv.js → model-TD5kGXzR.js} +1 -1
- package/src/web/public/assets/{overview-C68QpcT9.js → overview-Bsq58sDd.js} +1 -1
- package/src/web/public/assets/{progress-CEmAFxo9.js → progress-B4DfpsyS.js} +1 -1
- package/src/web/public/assets/{refs-TzxZYy7T.js → refs-DIiA_49Z.js} +1 -1
- package/src/web/public/assets/{repo-form-modal-Dg3hJWUV.js → repo-form-modal-DChK4NSX.js} +1 -1
- package/src/web/public/assets/{repos-uNqSR5YB.js → repos-PGFYkUgf.js} +1 -1
- package/src/web/public/assets/{route-crumb-C4DgkJ8G.js → route-crumb-SiMi2C_T.js} +1 -1
- package/src/web/public/assets/{status-tag-8cLH8hl9.js → status-tag-C9YVBvQh.js} +1 -1
- package/src/web/public/assets/task-BL5uxmJh.js +11 -0
- package/src/web/public/assets/{task-row-CRjuAfKW.js → task-row-cE7qblNK.js} +1 -1
- package/src/web/public/assets/{task-utils-DAPxKm4c.js → task-utils-cBR6Gj_c.js} +8 -7
- package/src/web/public/assets/{templates-DNiGvmdq.js → templates-Cfn3Xmsf.js} +3 -3
- package/src/web/public/assets/{use-rail-drag-DxIYcszo.js → use-rail-drag-Boxl7pOG.js} +1 -1
- package/src/web/public/index.html +11 -11
- package/src/modules/claim/actions/localtask-wait.ts +0 -41
- package/src/modules/delivery/index.ts +0 -18
- package/src/web/public/assets/dir-d16q1GLe.js +0 -3
- package/src/web/public/assets/frontmatter-CN6IlxWU.js +0 -2
- package/src/web/public/assets/task-DuFOXLPC.js +0 -11
- /package/src/modules/localtask/{store → infra/store}/topic-adapter.ts +0 -0
- /package/src/modules/localtask/{action-flags.ts → ui/action-flags.ts} +0 -0
- /package/src/modules/localtask/{contract-views.ts → ui/contract-views.ts} +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
// claim/wait.ts ——
|
|
1
|
+
// claim/wait.ts —— get 的阻塞编排(从 localtask/service.js 整体迁入)。
|
|
2
2
|
//
|
|
3
3
|
// 边界(claim = 领取域,localtask = 队列本体):
|
|
4
4
|
// - 队列读写、唤醒注册表、presence/面板注册表都在 localtask(serve 路由与
|
|
5
5
|
// panel-guard 的一半也长在那边),这里只做**队列编排**:快路径领取 → 阻塞窗口
|
|
6
6
|
// (跨进程轮询 / goal 到点收尾 / 用户关闭)。
|
|
7
|
-
// -
|
|
7
|
+
// - 交付组装在本域 host.ts(宿主取数 → promptplug 的 assembleDelivery)——
|
|
8
8
|
// 本文件在拿到任务的那一刻调 buildTaskDelivery,不碰模板与渲染。
|
|
9
9
|
// - 面板随行(确保主面板 / 深链 / 窗口重开防风暴)已拆到 panel-escort.js——
|
|
10
10
|
// 这里只经 escortPanel({ stop() }) 一点相接。
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
unregisterTopicWaiter,
|
|
31
31
|
} from '../localtask/service.js';
|
|
32
32
|
import { ensureMainPanel, deepLinkUrl, escortPanel } from './panel-escort.js';
|
|
33
|
-
import { buildTaskDelivery } from '
|
|
33
|
+
import { buildTaskDelivery } from './host.js';
|
|
34
34
|
import * as timegoal from '../goals/timegoal.js';
|
|
35
35
|
|
|
36
36
|
// 跨进程兜底轮询间隔(只定这里的读取节奏;队列写入节奏与它无关)
|
|
@@ -38,9 +38,9 @@ const POLL_MS = 500;
|
|
|
38
38
|
|
|
39
39
|
// ─── 时间目标探针(阻塞期间到点自动收尾本轮) ────────────────────────
|
|
40
40
|
//
|
|
41
|
-
//
|
|
41
|
+
// 与时间目标的融合(fail-open:timegoal 坏了绝不拖垮阻塞等待):
|
|
42
42
|
// - 阻塞期间到点 → 本轮立刻收尾(goalPoll,见 waitForTask);
|
|
43
|
-
// - 返回时刻把目标状态渲染进 instruction(goal
|
|
43
|
+
// - 返回时刻把目标状态渲染进 instruction(goal 段)——那半边在本域 host.ts。
|
|
44
44
|
// 探针按 key 服务于 500ms 轮询。读取时机是**阻塞开始**不是返回时刻:
|
|
45
45
|
// 只认「等待开始时还在跑」的目标,已到点的不参与自动取消。
|
|
46
46
|
|
|
@@ -76,7 +76,7 @@ export interface WaitForTaskOptions {
|
|
|
76
76
|
params?: Record<string, string>;
|
|
77
77
|
/** get 的「直接领」形态:没有 pending 立即空手而回,不开窗不阻塞 */
|
|
78
78
|
instant?: boolean;
|
|
79
|
-
/** 项目级「持续 get」开关(仅 get/preview
|
|
79
|
+
/** 项目级「持续 get」开关(仅 get/preview 传;关闭 → 不出现该区块) */
|
|
80
80
|
getLoopEnabled?: boolean;
|
|
81
81
|
/** 项目级阻塞窗口(分钟):进 getloop 模板 ctx,让 agent 知道每轮会等多久 */
|
|
82
82
|
getLoopWaitMinutes?: number;
|
|
@@ -102,7 +102,7 @@ export async function waitForTask({
|
|
|
102
102
|
onReady,
|
|
103
103
|
params = {}, // 外部参数(平面扩展):进交付模板的 ctx(--param k=v)
|
|
104
104
|
instant = false, // get 的「直接领」形态:没有 pending 立即空手而回,不开窗不阻塞
|
|
105
|
-
getLoopEnabled = false, // 项目级「持续 get」开关(仅 get/preview
|
|
105
|
+
getLoopEnabled = false, // 项目级「持续 get」开关(仅 get/preview 传;关闭 → 不出现该区块)
|
|
106
106
|
getLoopWaitMinutes = 0, // 项目级阻塞窗口(分钟):进 getloop 模板 ctx,让 agent 知道每轮会等多久
|
|
107
107
|
}: WaitForTaskOptions = {}): Promise<Record<string, any>> {
|
|
108
108
|
// paths.normalizeCwd 的 @returns 标注漏了 name(运行时恒返回 {cwd, name, key})
|
|
@@ -111,7 +111,7 @@ export async function waitForTask({
|
|
|
111
111
|
// 领取方身份:记进 task.claimedBy(事后能看出"这条被谁领的")
|
|
112
112
|
const by = { key, cwd, name };
|
|
113
113
|
// 仓库上下文:这个目录属于哪个已登记仓库、周围关联哪些看板。
|
|
114
|
-
//
|
|
114
|
+
// 跟着领取结果一起给出去 —— agent 领到任务就知道自己的" surroundings"。
|
|
115
115
|
const repoIndex = await repoContextIndex();
|
|
116
116
|
const repoCtx = repoCtxOf(repoIndex, cwd);
|
|
117
117
|
|
|
@@ -131,7 +131,7 @@ export async function waitForTask({
|
|
|
131
131
|
return { status: 'ok', key, cwd, name, summary, ...delivery, queued: true, source: 'local', repo: repoCtx };
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
-
// 1b. 本地空 →
|
|
134
|
+
// 1b. 本地空 → 去全局主题(共享池)领。这是所有领取的**无条件默认兜底**:
|
|
135
135
|
// 与是否显式传 --cwd 无关——本地取不到就一定来全局扫一眼,全局也没有才阻塞。
|
|
136
136
|
// (防止调用方习惯性传 cwd 导致共享池永远无人领取。)
|
|
137
137
|
// instant(localtask get 默认形态):两处快路径都没货 → 立即返回,不进阻塞窗口。
|
|
@@ -161,21 +161,21 @@ export async function waitForTask({
|
|
|
161
161
|
// 1c. 这个目录的时间目标**还在跑** → 记下它的截止时刻。
|
|
162
162
|
// 等待期间一旦越过这个时刻,本轮立刻收尾(见下方 goalPoll)。
|
|
163
163
|
// 目标早就过期的(reached)不记:那是"这一局已经结束了",
|
|
164
|
-
// 该由 agent 自己的 `timegoal check`
|
|
164
|
+
// 该由 agent 自己的 `timegoal check` 去处理,不该把阻塞等待焊死在这个目录上。
|
|
165
165
|
const goalDeadlineMs = await readGoalDeadlineMs(key);
|
|
166
166
|
|
|
167
167
|
// 2. 没有 pending → 复用常驻主面板(不再起随机端口临时弹窗):
|
|
168
168
|
// a) 确保主面板在跑(不存在就 detached 拉起 serve --no-open --auto-exit);
|
|
169
169
|
// b) 探测活动 SSE 连接:有活标签就不开新页(避免 Edge 重复开标签);
|
|
170
170
|
// 没活标签就 openBrowser 深链到当前主题。
|
|
171
|
-
//
|
|
171
|
+
// 失败只降级为纯阻塞——绝不抛错中断等待。
|
|
172
172
|
// --no-open 模式(冒烟/CI)不发起任何面板相关动作:不开浏览器、不拉起 serve、不开 SSE。
|
|
173
173
|
// 这样可避免在测试里 spawn 出一堆孤儿进程占着 7877 端口。
|
|
174
174
|
const panelInfo = open
|
|
175
175
|
? await ensureMainPanel()
|
|
176
176
|
: { running: false, started: false, port: 0, url: '' };
|
|
177
177
|
// 活性判据:「本地任务」页的活动 SSE 标签,或面板停在任意页(App 壳 ping 兜底)。
|
|
178
|
-
// 只认 SSE
|
|
178
|
+
// 只认 SSE 的旧口径在用户切到别的页时会误判「没开」,于是每次等待都重开一个标签。
|
|
179
179
|
const presence = panelInfo.running ? await probeEffectivePresence() : 0;
|
|
180
180
|
const deepLink = deepLinkUrl(key, panelInfo.port || DEFAULT_PORT);
|
|
181
181
|
|
|
@@ -187,7 +187,7 @@ export async function waitForTask({
|
|
|
187
187
|
registerTopicWaiter(key, {
|
|
188
188
|
resolve: (task: any) => resolveOutcome({ kind: 'task', task, delivered: true }),
|
|
189
189
|
});
|
|
190
|
-
// 全局兜底:同进程有人 addTask({global:true}) 时按 FIFO
|
|
190
|
+
// 全局兜底:同进程有人 addTask({global:true}) 时按 FIFO 唤醒本轮等待
|
|
191
191
|
const unregisterGlobal = registerGlobalWaiter(
|
|
192
192
|
(task: any) => resolveOutcome({ kind: 'task', task, delivered: true, source: 'global' }),
|
|
193
193
|
summary,
|
|
@@ -249,7 +249,7 @@ export async function waitForTask({
|
|
|
249
249
|
try {
|
|
250
250
|
await onReady({ addr: deepLink, key, cwd, name, summary });
|
|
251
251
|
} catch {
|
|
252
|
-
/*
|
|
252
|
+
/* 钩子异常不得影响本次等待 */
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
255
|
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
// 且交付文本带「不断调用 get,直到 get 超时」那段指令(提示词增强,文案见全局区块)。
|
|
17
17
|
//
|
|
18
18
|
// repos 在模块互依禁列里 → 动态 import(与 localtask→timegoal 探针同一惯例)。
|
|
19
|
-
|
|
19
|
+
// sanitizeGetLoop 已下沉 core/config.ts(repos 与 claim 共用),本文件只留读取。
|
|
20
20
|
|
|
21
21
|
/** 阻塞窗口默认 10 分钟(上限仍受 wait 的 600s 夹制)。#230 起循环文案唯一真相在 getloop 插件类。 */
|
|
22
22
|
export const GET_LOOP_DEFAULT_MINUTES = 10; // 阻塞窗口默认 10 分钟(上限仍受 wait 的 600s 夹制)
|
|
@@ -34,27 +34,6 @@ async function reposStore(): Promise<any> {
|
|
|
34
34
|
return reposMod;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
/**
|
|
38
|
-
* repo update --get-loop* 的落库校验:null/false = 关闭清除;true = 开(默认分钟)。
|
|
39
|
-
*
|
|
40
|
-
* 只认 `{ enabled, waitMinutes }`:#182 起 `template` 不在契约里,传了也忽略
|
|
41
|
-
* (老数据带着它进来时同样被剥掉,等于顺手做了一次清理)。
|
|
42
|
-
*/
|
|
43
|
-
export function sanitizeGetLoop(raw: unknown): Record<string, unknown> | null {
|
|
44
|
-
if (raw === undefined || raw === null || raw === false) return null;
|
|
45
|
-
if (raw === true) return { enabled: true };
|
|
46
|
-
if (typeof raw !== 'object') throw badInput('getLoop 必须是 { enabled, waitMinutes? }');
|
|
47
|
-
const decl = raw as Record<string, any>;
|
|
48
|
-
const out: Record<string, unknown> = {};
|
|
49
|
-
if (decl.enabled !== undefined) out.enabled = decl.enabled === true || decl.enabled === 'on' || decl.enabled === 'true';
|
|
50
|
-
const n = Number(decl.waitMinutes);
|
|
51
|
-
// #112:0 是合法值(= get 没任务时不阻塞,立即返回 timeout);只挡负数与非数字
|
|
52
|
-
if (decl.waitMinutes !== undefined && decl.waitMinutes !== null && decl.waitMinutes !== '' && Number.isFinite(n) && n >= 0) {
|
|
53
|
-
out.waitMinutes = Math.min(Math.floor(n), 600);
|
|
54
|
-
}
|
|
55
|
-
if (!Object.keys(out).length) return null;
|
|
56
|
-
return out;
|
|
57
|
-
}
|
|
58
37
|
|
|
59
38
|
/** 按工作目录读项目级 getLoop;目录未登记 / 未开启 → { enabled:false }。读取失败同样降级。 */
|
|
60
39
|
export async function getLoopForCwd(cwd: unknown): Promise<GetLoopState> {
|
|
@@ -27,6 +27,10 @@ import { DocsMainAction } from './docs-main.js';
|
|
|
27
27
|
import { DocsNotebindAction } from './docs-notebind.js';
|
|
28
28
|
import { DocsOrphansPurgeAction } from './docs-orphans-purge.js';
|
|
29
29
|
import { DocsOrphansAction } from './docs-orphans.js';
|
|
30
|
+
import { RepoDocAddAction } from './repo-doc-add.js';
|
|
31
|
+
import { RepoDocListAction } from './repo-doc-list.js';
|
|
32
|
+
import { RepoDocRemoveAction } from './repo-doc-remove.js';
|
|
33
|
+
import { RepoKnowledgeAction } from './repo-knowledge.js';
|
|
30
34
|
|
|
31
35
|
/** 本模块的全部 action 类(容器按这个顺序建实例)。 */
|
|
32
36
|
export const ACTIONS: readonly (new (deps: Container) => ActionBase)[] = [
|
|
@@ -51,6 +55,10 @@ export const ACTIONS: readonly (new (deps: Container) => ActionBase)[] = [
|
|
|
51
55
|
DocsNotebindAction,
|
|
52
56
|
DocsOrphansPurgeAction,
|
|
53
57
|
DocsOrphansAction,
|
|
58
|
+
RepoDocAddAction,
|
|
59
|
+
RepoDocListAction,
|
|
60
|
+
RepoDocRemoveAction,
|
|
61
|
+
RepoKnowledgeAction,
|
|
54
62
|
];
|
|
55
63
|
|
|
56
64
|
// 再导出类本身:前端 apiclient 的返回类型从这里 type-only 引用(实现即契约)。
|
|
@@ -75,3 +83,7 @@ export { DocsMainAction };
|
|
|
75
83
|
export { DocsNotebindAction };
|
|
76
84
|
export { DocsOrphansPurgeAction };
|
|
77
85
|
export { DocsOrphansAction };
|
|
86
|
+
export { RepoDocAddAction };
|
|
87
|
+
export { RepoDocListAction };
|
|
88
|
+
export { RepoDocRemoveAction };
|
|
89
|
+
export { RepoKnowledgeAction };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
// repo.doc.add ——
|
|
1
|
+
// repo.doc.add —— 2026-11-19 归位到 docs 域(实现在 docs/refs.ts 与 docs/knowledge.ts,
|
|
2
|
+
// 此前声明留在 repos 造成 repos→docs 的跨域依赖)。action id / cli / http 契约不变。
|
|
2
3
|
//
|
|
3
4
|
// 契约(zod schema)就声明在本文件里——入参类型由基类泛型模板封装;本文件只做「声明 + 实现」,业务在服务层。
|
|
4
5
|
import { action } from '../../../runtime/action-decorator.js';
|
|
5
6
|
import { z } from 'zod';
|
|
6
7
|
import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
|
|
7
|
-
import { addRepoDoc as _addRepoDoc } from '
|
|
8
|
+
import { addRepoDoc as _addRepoDoc } from '../refs.js';
|
|
8
9
|
const addRepoDoc: any = _addRepoDoc;
|
|
9
10
|
|
|
10
11
|
/** repo.doc.add 的入参契约(CLI 与 HTTP 共用同一份)。 */
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
// repo.doc.list ——
|
|
1
|
+
// repo.doc.list —— 2026-11-19 归位到 docs 域(实现在 docs/refs.ts 与 docs/knowledge.ts,
|
|
2
|
+
// 此前声明留在 repos 造成 repos→docs 的跨域依赖)。action id / cli / http 契约不变。
|
|
2
3
|
//
|
|
3
4
|
// 契约(zod schema)就声明在本文件里——入参类型由基类泛型模板封装;本文件只做「声明 + 实现」,业务在服务层。
|
|
4
5
|
import { action } from '../../../runtime/action-decorator.js';
|
|
5
6
|
import { z } from 'zod';
|
|
6
7
|
import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
|
|
7
|
-
import { listRepoDocs as _listRepoDocs } from '
|
|
8
|
+
import { listRepoDocs as _listRepoDocs } from '../refs.js';
|
|
8
9
|
const listRepoDocs: any = _listRepoDocs;
|
|
9
10
|
|
|
10
11
|
/** repo.doc.list 的入参契约(CLI 与 HTTP 共用同一份)。 */
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
// repo.doc.remove ——
|
|
1
|
+
// repo.doc.remove —— 2026-11-19 归位到 docs 域(实现在 docs/refs.ts 与 docs/knowledge.ts,
|
|
2
|
+
// 此前声明留在 repos 造成 repos→docs 的跨域依赖)。action id / cli / http 契约不变。
|
|
2
3
|
//
|
|
3
4
|
// 契约(zod schema)就声明在本文件里——入参类型由基类泛型模板封装;本文件只做「声明 + 实现」,业务在服务层。
|
|
4
5
|
import { action } from '../../../runtime/action-decorator.js';
|
|
5
6
|
import { z } from 'zod';
|
|
6
7
|
import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
|
|
7
|
-
import { removeRepoDoc as _removeRepoDoc } from '
|
|
8
|
+
import { removeRepoDoc as _removeRepoDoc } from '../refs.js';
|
|
8
9
|
const removeRepoDoc: any = _removeRepoDoc;
|
|
9
10
|
|
|
10
11
|
/** repo.doc.remove 的入参契约(CLI 与 HTTP 共用同一份)。 */
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
// repo.knowledge ——
|
|
1
|
+
// repo.knowledge —— 2026-11-19 归位到 docs 域(实现在 docs/refs.ts 与 docs/knowledge.ts,
|
|
2
|
+
// 此前声明留在 repos 造成 repos→docs 的跨域依赖)。action id / cli / http 契约不变。
|
|
2
3
|
//
|
|
3
4
|
// 契约(zod schema)就声明在本文件里——入参类型由基类泛型模板封装;本文件只做「声明 + 实现」,业务在服务层。
|
|
4
5
|
import { action } from '../../../runtime/action-decorator.js';
|
|
5
6
|
import { z } from 'zod';
|
|
6
7
|
import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
|
|
7
|
-
import { repoKnowledge as _repoKnowledge } from '
|
|
8
|
+
import { repoKnowledge as _repoKnowledge } from '../knowledge.js';
|
|
8
9
|
const repoKnowledge: any = _repoKnowledge;
|
|
9
10
|
|
|
10
11
|
/** repo.knowledge 的入参契约(CLI 与 HTTP 共用同一份)。 */
|
|
@@ -267,8 +267,9 @@ export async function repoKnowledge(locator?: string, { md = false }: { md?: boo
|
|
|
267
267
|
/**
|
|
268
268
|
* **项目组上下文**(交付层用):某个工作目录所属仓库所在的项目组材料。
|
|
269
269
|
*
|
|
270
|
-
*
|
|
271
|
-
*
|
|
270
|
+
* 只取交付时必须带上的部分——项目介绍、组定位、组介绍、兄弟成员、
|
|
271
|
+
* 组绑定参考文件的可读路径。(组内描述 note 已随模板上下文清理移除,
|
|
272
|
+
* 不再读绑定文档。)
|
|
272
273
|
*/
|
|
273
274
|
export async function groupContextFor(cwd: unknown, { board = '' }: { board?: string } = {}): Promise<GroupContextResult | null> {
|
|
274
275
|
const { loadStore, deriveKey, boardKeyOf, boardRepoKeys, normalizePathKey } = await reposBridge();
|
|
@@ -355,20 +356,13 @@ export async function groupContextFor(cwd: unknown, { board = '' }: { board?: st
|
|
|
355
356
|
body: '',
|
|
356
357
|
};
|
|
357
358
|
});
|
|
358
|
-
//
|
|
359
|
-
const
|
|
360
|
-
const noteOwn = noteDocs[0] || null;
|
|
361
|
-
// 兄弟成员(组内各仓库的组内描述)
|
|
362
|
-
const peers: Array<{ name: string; note: string; path: string }> = [];
|
|
359
|
+
// 兄弟成员(组内各仓库;组内描述 note 已移除,不再逐成员读绑定文档)
|
|
360
|
+
const peers: Array<{ name: string; path: string }> = [];
|
|
363
361
|
for (const mkey of members) {
|
|
364
|
-
const mr = s.repos.find((x: any) => deriveKey(x) === mkey);
|
|
365
|
-
const mname = mr ? mr.name : mkey;
|
|
366
362
|
if (mkey === rk) continue;
|
|
367
|
-
const
|
|
368
|
-
const peer = peerDocs[0];
|
|
363
|
+
const mr = s.repos.find((x: any) => deriveKey(x) === mkey);
|
|
369
364
|
peers.push({
|
|
370
|
-
name:
|
|
371
|
-
note: (peer && peer.body) || '',
|
|
365
|
+
name: mr ? mr.name : mkey,
|
|
372
366
|
path: (mr && mr.path) || '',
|
|
373
367
|
});
|
|
374
368
|
}
|
|
@@ -378,7 +372,6 @@ export async function groupContextFor(cwd: unknown, { board = '' }: { board?: st
|
|
|
378
372
|
desc: b.desc || '',
|
|
379
373
|
intro,
|
|
380
374
|
introSet: { main: null, extras: [], count: 0 },
|
|
381
|
-
note: (noteOwn && noteOwn.body) || '',
|
|
382
375
|
peers,
|
|
383
376
|
docLinks,
|
|
384
377
|
refRepos: (Array.isArray(b.refs) ? b.refs : []).map((l: any) => refRepoItemOf(l.id)).filter(Boolean) as Array<{ key: string; name: string; path: string }>,
|
|
@@ -406,8 +399,7 @@ export interface GroupContextGroup {
|
|
|
406
399
|
desc: string;
|
|
407
400
|
intro: ContextIntro;
|
|
408
401
|
introSet: IntroSet;
|
|
409
|
-
|
|
410
|
-
peers: Array<{ name: string; path: string; note: string }>;
|
|
402
|
+
peers: Array<{ name: string; path: string }>;
|
|
411
403
|
docLinks: BoundDoc[];
|
|
412
404
|
refRepos: Array<{ key: string; name: string; path: string }>;
|
|
413
405
|
}
|
|
@@ -6,7 +6,7 @@ import { z } from 'zod';
|
|
|
6
6
|
import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
|
|
7
7
|
import * as serviceNs from '../timegoal.js';
|
|
8
8
|
import { badInput as _badInput } from '../../../core/errors.js';
|
|
9
|
-
import { renderCheck } from '
|
|
9
|
+
import { renderCheck } from '../support.js';
|
|
10
10
|
const service: any = serviceNs;
|
|
11
11
|
const badInput: any = _badInput;
|
|
12
12
|
|
|
@@ -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 '../timegoal.js';
|
|
8
|
-
import { renderClear } from '
|
|
8
|
+
import { renderClear } from '../support.js';
|
|
9
9
|
const service: any = serviceNs;
|
|
10
10
|
|
|
11
11
|
/** timegoal.clear 的入参契约(CLI 与 HTTP 共用同一份)。 */
|
|
@@ -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 '../timegoal.js';
|
|
8
|
-
import { renderList } from '
|
|
8
|
+
import { renderList } from '../support.js';
|
|
9
9
|
const service: any = serviceNs;
|
|
10
10
|
|
|
11
11
|
/** timegoal.list 的入参契约(CLI 与 HTTP 共用同一份)。 */
|
|
@@ -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 '../timegoal.js';
|
|
8
|
-
import { fmtDur } from '
|
|
8
|
+
import { fmtDur } from '../support.js';
|
|
9
9
|
const service: any = serviceNs;
|
|
10
10
|
|
|
11
11
|
/** timegoal.log 的入参契约(CLI 与 HTTP 共用同一份)。 */
|
|
@@ -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 '../timegoal.js';
|
|
8
|
-
import { renderSet } from '
|
|
8
|
+
import { renderSet } from '../support.js';
|
|
9
9
|
const service: any = serviceNs;
|
|
10
10
|
|
|
11
11
|
/** timegoal.set 的入参契约(CLI 与 HTTP 共用同一份)。 */
|
|
@@ -6,7 +6,7 @@ import { z } from 'zod';
|
|
|
6
6
|
import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
|
|
7
7
|
import * as serviceNs from '../timegoal.js';
|
|
8
8
|
import { badInput as _badInput } from '../../../core/errors.js';
|
|
9
|
-
import { renderShow } from '
|
|
9
|
+
import { renderShow } from '../support.js';
|
|
10
10
|
const service: any = serviceNs;
|
|
11
11
|
const badInput: any = _badInput;
|
|
12
12
|
|
|
@@ -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 '../timegoal.js';
|
|
8
|
-
import { renderUpdate } from '
|
|
8
|
+
import { renderUpdate } from '../support.js';
|
|
9
9
|
const service: any = serviceNs;
|
|
10
10
|
|
|
11
11
|
/** timegoal.update 的入参契约(CLI 与 HTTP 共用同一份)。 */
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
import { badInput } from '../../../core/errors.js';
|
|
15
15
|
import { readSettingRaw, writeSettingRaw, deleteSettingRaw, listSettingsByPrefix } from '../../../core/db/settings.js';
|
|
16
16
|
import { tx } from '../../../core/db/index.js';
|
|
17
|
-
import { db as ltDb } from '../../localtask/repo/open.js';
|
|
17
|
+
import { db as ltDb } from '../../localtask/infra/repo/open.js';
|
|
18
18
|
import { nowMs } from '../../../core/db/time.js';
|
|
19
19
|
import {
|
|
20
20
|
archiveRetentionSec,
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
// 模块边界:
|
|
26
26
|
// - 本族只 import core(db / errors / topic-key)与 localtask/repo/goals.js
|
|
27
27
|
// (叶子仓储,不构成环);localtask 反向引用本模块的出口在 taskgoal.js。
|
|
28
|
-
// -
|
|
28
|
+
// - 与领取流程互不感知:timegoal 不阻塞、不依赖面板是否存在,
|
|
29
29
|
// agent 按 `reached` 自行决定下一轮动作。
|
|
30
30
|
//
|
|
31
31
|
// 本文件是**对外入口**:实现按职责拆进同目录三个 *-store 文件,这里 re-export
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
import { tx } from '../../../core/db/index.js';
|
|
34
34
|
import { deleteSettingRaw, listSettingsByPrefix } from '../../../core/db/settings.js';
|
|
35
35
|
import { nowMs } from '../../../core/db/time.js';
|
|
36
|
-
import { db as ltDb } from '../../localtask/repo/open.js';
|
|
37
|
-
import * as goalsRepo from '../../localtask/repo/goals.js';
|
|
36
|
+
import { db as ltDb } from '../../localtask/infra/repo/open.js';
|
|
37
|
+
import * as goalsRepo from '../../localtask/infra/repo/goals.js';
|
|
38
38
|
import { evalTimegoal } from './timegoal-core-store.js';
|
|
39
39
|
import { CWD_GOAL_PREFIX, blobToGoalView } from './timegoal-cwd-store.js';
|
|
40
40
|
import { goalRowToGoal, goalRowToView } from './timegoal-task-store.js';
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
// goal_checks 行的 summary 存当轮总结(纯文本;旧库 JSON 编码在读取侧兼容,见 goals.js)。
|
|
8
8
|
import { badInput } from '../../../core/errors.js';
|
|
9
9
|
import { tx } from '../../../core/db/index.js';
|
|
10
|
-
import { db as ltDb } from '../../localtask/repo/open.js';
|
|
10
|
+
import { db as ltDb } from '../../localtask/infra/repo/open.js';
|
|
11
11
|
import { nowMs } from '../../../core/db/time.js';
|
|
12
|
-
import * as goalsRepo from '../../localtask/repo/goals.js';
|
|
12
|
+
import * as goalsRepo from '../../localtask/infra/repo/goals.js';
|
|
13
13
|
import {
|
|
14
14
|
TASK_GOAL_PROMPT_TEMPLATE,
|
|
15
15
|
customGoalPromptOf,
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
//
|
|
1
|
+
// goals 模块的辅助函数/常量:timegoal 各 action 的人读渲染函数。
|
|
2
|
+
// 原在 localtask/support.ts(legacy 迁移时顺手放在那里),但 7 个导出只被 goals 用——
|
|
3
|
+
// 2026-11-19 归位到本域,消掉 goals→localtask 的 7 条静态依赖。
|
|
2
4
|
//
|
|
3
5
|
// 参数与返回值暂用宽松类型(迁移期),服务层类型化推进时逐个收紧。
|
|
4
6
|
export function renderSet(d: any) {
|
|
@@ -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 { renderAdd as _renderAdd } from '../action-render.js';
|
|
7
|
+
import { renderAdd as _renderAdd } from '../ui/action-render.js';
|
|
8
8
|
import { existsSync, readFileSync } from 'node:fs';
|
|
9
9
|
import { resolve } from 'node:path';
|
|
10
10
|
import { badInput } from '../../../core/errors.js';
|
|
@@ -33,7 +33,7 @@ async function readTaskBody(
|
|
|
33
33
|
if (!existsSync(abs)) throw badInput('任务正文文件不存在: ' + abs);
|
|
34
34
|
return readFileSync(abs, 'utf8');
|
|
35
35
|
}
|
|
36
|
-
import { addView } from '../contract-views.js';
|
|
36
|
+
import { addView } from '../ui/contract-views.js';
|
|
37
37
|
const renderAdd: any = _renderAdd;
|
|
38
38
|
|
|
39
39
|
/** localtask.add 的入参契约(CLI 与 HTTP 共用同一份)。 */
|
|
@@ -79,7 +79,7 @@ export class LocaltaskAddAction extends ActionBase<typeof input> {
|
|
|
79
79
|
// 派任务编排已迁 localtask/add.ts(派任务编排归 localtask 域;命令名不变)。
|
|
80
80
|
// 落点判定(--board/--project 严格口径 / 正文 frontmatter fail-open)只此一份实现,
|
|
81
81
|
// CLI、HTTP、面板提交同走这一条链路。
|
|
82
|
-
const { submitTask } = await (import('../add.js') as any);
|
|
82
|
+
const { submitTask } = await (import('../lifecycle/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('
|
|
28
|
+
const { noteTaskAttachment } = await (import('../ops/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('
|
|
40
|
+
const { attachToTask } = await (import('../ops/attach.js') as any);
|
|
41
41
|
return attachToTask({
|
|
42
42
|
id: ctx.id,
|
|
43
43
|
cwd: ctx.cwd,
|
|
@@ -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('
|
|
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('
|
|
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('
|
|
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("
|
|
18
|
-
feedbackHeading: z.string().optional().describe("
|
|
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('../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,
|
|
@@ -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
|
|