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,15 +1,15 @@
|
|
|
1
1
|
// (#54 自 service.js 拆出)单条任务的查/增/改:getTask、addTask(waiter 唤醒链 +
|
|
2
2
|
// 全局池 FIFO 投递 + ignoredCwd 如实回带)、updateTask(正文/时间目标/DAG 依赖/改归属搬家)。
|
|
3
|
-
import { badInput, notFound } from '
|
|
4
|
-
import { parseFrontmatter, preserveFrontmatter } from '
|
|
5
|
-
import { sanitizeTaskGoal } from '
|
|
6
|
-
import { normalizeBlockBy, isReadyToClaim } from '
|
|
7
|
-
import { MAX_TEXT, normalizeSummary, normalizeText } from '
|
|
8
|
-
import { openLocaltaskStore as openStore, topics as topicsRepo, tasks as tasksRepo, links as linksRepo, txw as tx, db } from '
|
|
9
|
-
import { GLOBAL_KEY, GLOBAL_NAME, GLOBAL_CWD, isGlobalKey, normalizeCwd, resolveTaskKey, topicKeyFor } from '
|
|
3
|
+
import { badInput, notFound } from '../../../core/errors.js';
|
|
4
|
+
import { parseFrontmatter, preserveFrontmatter } from '../../../shared/frontmatter.js';
|
|
5
|
+
import { sanitizeTaskGoal } from '../../goals/taskgoal.js';
|
|
6
|
+
import { normalizeBlockBy, isReadyToClaim } from '../dag.js';
|
|
7
|
+
import { MAX_TEXT, normalizeSummary, normalizeText } from '../infra/store-io.js';
|
|
8
|
+
import { openLocaltaskStore as openStore, topics as topicsRepo, tasks as tasksRepo, links as linksRepo, txw as tx, db } from '../infra/repo/index.js';
|
|
9
|
+
import { GLOBAL_KEY, GLOBAL_NAME, GLOBAL_CWD, isGlobalKey, normalizeCwd, resolveTaskKey, topicKeyFor } from '../paths.js';
|
|
10
10
|
import { normalizeTask, foreignResolver, queueRelationsOf, relocateTask, resolveForkRef } from './task-view.js';
|
|
11
|
-
import { takeTopicWaiter, takeGlobalWaiter } from '
|
|
12
|
-
import { presence as presenceRepo } from '
|
|
11
|
+
import { takeTopicWaiter, takeGlobalWaiter } from '../waiters.js';
|
|
12
|
+
import { presence as presenceRepo } from '../infra/repo/index.js';
|
|
13
13
|
|
|
14
14
|
/** 任务寻址入参(--cwd/--key + --id)。 */
|
|
15
15
|
export interface TaskAddress {
|
|
@@ -69,7 +69,7 @@ export async function getTask({ cwd: rawCwd, key: rawKey, id }: TaskAddress = {}
|
|
|
69
69
|
const t = topicsRepo.getTopic(key);
|
|
70
70
|
const task = t && t.tasks.find((x: any) => Number(x.id) === want);
|
|
71
71
|
if (!task) {
|
|
72
|
-
const { notFound } = await import('
|
|
72
|
+
const { notFound } = await import('../../../core/errors.js');
|
|
73
73
|
throw notFound(`主题「${t ? t.name : cwd}」里没有 #${want} 任务`);
|
|
74
74
|
}
|
|
75
75
|
// key 一并回带:附件标注按 (topic.key, seq) 查 task_attach,不必再反查队列。
|
|
@@ -247,7 +247,7 @@ export async function addTask({
|
|
|
247
247
|
// DAG 单一写路径:闸门/依赖经 Mutator 投影(fail-open,不挡入队)
|
|
248
248
|
if (!toGlobal && (task.blocksFollowing || (task.blockBy && task.blockBy.length))) {
|
|
249
249
|
try {
|
|
250
|
-
const { syncNewTaskDag } = await import('
|
|
250
|
+
const { syncNewTaskDag } = await import('../infra/writes.js');
|
|
251
251
|
await syncNewTaskDag(key, task);
|
|
252
252
|
} catch {
|
|
253
253
|
/* ignore */
|
|
@@ -308,7 +308,7 @@ export async function updateTask({
|
|
|
308
308
|
const t = topicsRepo.getTopic(key);
|
|
309
309
|
const task = t && t.tasks.find((x: any) => Number(x.id) === want);
|
|
310
310
|
if (!task) {
|
|
311
|
-
const { notFound } = await import('
|
|
311
|
+
const { notFound } = await import('../../../core/errors.js');
|
|
312
312
|
throw notFound(`主题「${t ? t.name : cwd}」里没有 #${want} 任务`);
|
|
313
313
|
}
|
|
314
314
|
let goalChanged: string | null = null; // 'set' | 'cleared' | null(render 与前端提示用)
|
|
@@ -416,7 +416,7 @@ export async function updateTask({
|
|
|
416
416
|
});
|
|
417
417
|
if (hasDagInput) {
|
|
418
418
|
try {
|
|
419
|
-
const { syncTaskDagUpdate } = await import('
|
|
419
|
+
const { syncTaskDagUpdate } = await import('../infra/writes.js');
|
|
420
420
|
await syncTaskDagUpdate(host.key, Number(hostTask.id), { blockBy, clearBlockBy, blocksFollowing });
|
|
421
421
|
} catch {
|
|
422
422
|
/* fail-open */
|
|
@@ -527,7 +527,7 @@ export async function setPlanStatus({
|
|
|
527
527
|
if (target === 'pending' && from !== 'plan') {
|
|
528
528
|
throw badInput(`只有草稿能转回待领取(#${want} 现在是 ${from})`);
|
|
529
529
|
}
|
|
530
|
-
const updated = tasksRepo.
|
|
530
|
+
const updated = tasksRepo.switchPlanStatus(t!.id, want, target as 'plan' | 'pending');
|
|
531
531
|
if (!updated) throw notFound(`任务不存在: #${want}`);
|
|
532
532
|
topicsRepo.updateTopic(key, { bumpRevision: true });
|
|
533
533
|
return {
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
// T03:写入走 repo.tasks / repo.topics 的窄方法。**顺序(优先级)不在 seq 里** ——
|
|
5
5
|
// seq 是对外编号、不可变(trg_tasks_identity 锁死),拖动排序改的是
|
|
6
6
|
// topics.ext.ext_task_order(JSON 数组序的等价物,见 repo/topics.js 顶部说明)。
|
|
7
|
-
import { badInput, notFound as notFoundImpl } from '
|
|
8
|
-
import { normalizeCwd, resolveTaskKey } from '
|
|
9
|
-
import { openLocaltaskStore as openStore, topics as topicsRepo, tasks as tasksRepo, txw as tx } from '
|
|
7
|
+
import { badInput, notFound as notFoundImpl } from '../../../core/errors.js';
|
|
8
|
+
import { normalizeCwd, resolveTaskKey } from '../paths.js';
|
|
9
|
+
import { openLocaltaskStore as openStore, topics as topicsRepo, tasks as tasksRepo, txw as tx } from '../infra/repo/index.js';
|
|
10
10
|
import { normalizeTask, topicView } from './task-view.js';
|
|
11
11
|
|
|
12
12
|
/** 任务操作的公共入参(--cwd/--key + id(s))。 */
|
|
@@ -192,7 +192,7 @@ export async function cancelTasks({ cwd: rawCwd, key: rawKey, ids }: CancelClose
|
|
|
192
192
|
});
|
|
193
193
|
continue;
|
|
194
194
|
}
|
|
195
|
-
const next = tasksRepo.
|
|
195
|
+
const next = tasksRepo.tombstoneAsCancelled(topicId!, want);
|
|
196
196
|
cancelled.push(normalizeTask(next));
|
|
197
197
|
}
|
|
198
198
|
if (cancelled.length) topicsRepo.updateTopic(key, { bumpRevision: true });
|
|
@@ -15,7 +15,7 @@ export const DEFAULT_ACK_PROMPT =
|
|
|
15
15
|
import {
|
|
16
16
|
DEFAULT_APPEND_MODE,
|
|
17
17
|
APPEND_MODES,
|
|
18
|
-
} from '
|
|
18
|
+
} from '../../../shared/prompt-blocks.js';
|
|
19
19
|
|
|
20
20
|
/** 交付上下文模板(任务 #62)的长度上限——防把整本书塞进设置。 */
|
|
21
21
|
export const MAX_DELIVERY_TEMPLATE_LEN = 8000;
|
|
@@ -31,7 +31,7 @@ export function clampDeliveryTemplate(v: unknown): string {
|
|
|
31
31
|
// ─── 附件段提示词(settings.attachTemplate,任务 #82)──────────────────
|
|
32
32
|
//
|
|
33
33
|
// 交付里的〔附件〕段(附件清单 + 本地路径 + 拉取 SOP)原先硬编码在
|
|
34
|
-
//
|
|
34
|
+
// localtask/attach.ts 的 attachmentInstruction。模板化后:
|
|
35
35
|
// - 空串 = 用内置默认(**不是关掉**——附件段带本地路径,关掉 agent 就找不到文件);
|
|
36
36
|
// - 新语法:{{task.id}} {{task.text}} {{attach.count}}、
|
|
37
37
|
// `{{#each attach.list}}`(按 kind 分支的结构化清单 + 各类型子对象);
|
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
// normalizeTask(含 ready 徽标)、topicView、跨队列依赖解析器(foreignResolver)、
|
|
3
3
|
// 队列内关系清单(queueRelationsOf)与搬家(relocateTask)。
|
|
4
4
|
import { existsSync } from 'node:fs';
|
|
5
|
-
import { badInput, notFound } from '
|
|
6
|
-
import { sanitizeTaskGoal } from '
|
|
7
|
-
import { normalizeBlockBy, isReadyToClaim } from '
|
|
8
|
-
import { isGlobalKey, topicKeyFor, resolveTaskKey } from '
|
|
9
|
-
import { parseStampMs, stampNow } from '
|
|
10
|
-
import { topics as topicsRepo, tasks as tasksRepo, links as linksRepo, db } from '
|
|
11
|
-
import { parseFrontmatter } from '
|
|
12
|
-
import { isPending } from '
|
|
13
|
-
import type { ReadyOpts } from '
|
|
14
|
-
import type { TaskObject } from '
|
|
15
|
-
import type { ChainLinkNode } from '
|
|
5
|
+
import { badInput, notFound } from '../../../core/errors.js';
|
|
6
|
+
import { sanitizeTaskGoal } from '../../goals/taskgoal.js';
|
|
7
|
+
import { normalizeBlockBy, isReadyToClaim } from '../dag.js';
|
|
8
|
+
import { isGlobalKey, topicKeyFor, resolveTaskKey } from '../paths.js';
|
|
9
|
+
import { parseStampMs, stampNow } from '../infra/store-io.js';
|
|
10
|
+
import { topics as topicsRepo, tasks as tasksRepo, links as linksRepo, db } from '../infra/repo/index.js';
|
|
11
|
+
import { parseFrontmatter } from '../../../shared/frontmatter.js';
|
|
12
|
+
import { isPending } from '../../../shared/task-status.js';
|
|
13
|
+
import type { ReadyOpts } from '../../../core/workflow/readiness.js';
|
|
14
|
+
import type { TaskObject } from '../infra/repo/rows.js';
|
|
15
|
+
import type { ChainLinkNode } from '../infra/repo/links.js';
|
|
16
16
|
|
|
17
17
|
/** normalizeTask / topicView 的入参任务行(JSON 形态 → any)。 */
|
|
18
18
|
export type TaskInput = any;
|
|
@@ -111,10 +111,11 @@ export function relocateTask(fromTopic: any, seq: number | string, moveTo: any):
|
|
|
111
111
|
});
|
|
112
112
|
const newId = inserted.id;
|
|
113
113
|
|
|
114
|
-
// 2.
|
|
114
|
+
// 2. 源任务定格:status 走 tombstone 语义函数(原子守卫,done 保持 done);
|
|
115
|
+
// 软删与"搬去哪了"审计字段照旧走通用 patch——它们不是状态。
|
|
116
|
+
tasksRepo.tombstoneAsCancelled(fromTopic.id, oldSeq);
|
|
115
117
|
tasksRepo.updateTask(fromTopic.id, oldSeq, {
|
|
116
118
|
deletedAt: stampNow(),
|
|
117
|
-
status: 'cancelled',
|
|
118
119
|
moveFrom: { key: toKey, seq: newId, at: stampNow() },
|
|
119
120
|
});
|
|
120
121
|
|
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
// T03:存储切到 repo/(SQLite)。本文件不再直接读写任何存储形状 ——
|
|
5
5
|
// 读走 repo.topics 的 JSON 形态投影,写走窄方法(一个动作一个事务)。
|
|
6
6
|
import { existsSync } from 'node:fs';
|
|
7
|
-
import { badInput } from '
|
|
8
|
-
import { normalizeCwd } from '
|
|
9
|
-
import { normalizeSummary } from '
|
|
10
|
-
import { openLocaltaskStore as openStore, topics as topicsRepo, settings as settingsRepo, txw as tx } from '
|
|
11
|
-
import { DEFAULT_TIMEOUT_SEC, MAX_TIMEOUT_SEC } from '
|
|
7
|
+
import { badInput } from '../../../core/errors.js';
|
|
8
|
+
import { normalizeCwd } from '../paths.js';
|
|
9
|
+
import { normalizeSummary } from '../infra/store-io.js';
|
|
10
|
+
import { openLocaltaskStore as openStore, topics as topicsRepo, settings as settingsRepo, txw as tx } from '../infra/repo/index.js';
|
|
11
|
+
import { DEFAULT_TIMEOUT_SEC, MAX_TIMEOUT_SEC } from '../infra/repo/settings.js';
|
|
12
12
|
import { foreignResolver, isPending, topicView } from './task-view.js';
|
|
13
|
-
import { stripFrontmatter } from '
|
|
13
|
+
import { stripFrontmatter } from '../../../shared/frontmatter.js';
|
|
14
14
|
import { deleteGuard } from './deletion.js';
|
|
15
|
-
import { repoContextIndex, repoCtxOf } from '
|
|
15
|
+
import { repoContextIndex, repoCtxOf } from '../infra/repo-ctx.js';
|
|
16
16
|
|
|
17
17
|
/** addTopic / pruneTopics 等主题操作的入参(HTTP/CLI body → any)。 */
|
|
18
18
|
export type TopicOpInput = any;
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
// 任务搬进新项目的登记路径队列(service 的 moveTo),frontmatter 的介绍引用一并刷新。
|
|
10
10
|
// 落点解析与 add.js 共用同一份实现(board-target.resolveGroupTarget + group-store),
|
|
11
11
|
// 不另起炉灶。
|
|
12
|
-
import { badInput } from '
|
|
13
|
-
import { applyGroupFields, parseFrontmatter, preserveFrontmatter } from '
|
|
14
|
-
import { resolveGroupTarget } from '../
|
|
15
|
-
import * as service from '../
|
|
16
|
-
import { normalizedGroupStore } from '
|
|
12
|
+
import { badInput } from '../../../core/errors.js';
|
|
13
|
+
import { applyGroupFields, parseFrontmatter, preserveFrontmatter } from '../../../shared/frontmatter.js';
|
|
14
|
+
import { resolveGroupTarget } from '../ops/board-target.js';
|
|
15
|
+
import * as service from '../service.js';
|
|
16
|
+
import { normalizedGroupStore } from '../ops/group-store.js';
|
|
17
17
|
|
|
18
18
|
/** 改任务 / 重开的参数(透传 localtask/service,形状由 service 层校验;寻址三件套对齐 TaskAddress) */
|
|
19
19
|
export interface UpdateTaskParams {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//
|
|
1
|
+
// localtask/attach-resource.ts —— 附件的「资源视图模型」:关系表行 → 展示/取用信息。
|
|
2
2
|
//
|
|
3
3
|
// 资源类型只有五种(用户口径):file(含图片)/ url / task / ref / mdfile。
|
|
4
4
|
// 旧数据里 kind='image' 或没有 kind 的一律按 file 处理(向后兼容)。
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
// file 型资源的可达性(本机副本绝对路径 vs 仅 fileId)由 fileStateOf 给出,
|
|
9
9
|
// 调用方(attach.js 的编排层)负责把本机附件仓的命中结果喂进来。
|
|
10
10
|
import { existsSync } from 'node:fs';
|
|
11
|
-
import { isImageName } from '
|
|
12
|
-
import { stripFrontmatter } from '
|
|
11
|
+
import { isImageName } from '../../../core/filekind.js';
|
|
12
|
+
import { stripFrontmatter } from '../../../shared/frontmatter.js';
|
|
13
13
|
|
|
14
14
|
const KIND_LABEL: Record<string, string> = { file: '附件', url: '链接', task: '任务', ref: '文档', mdfile: 'md', folder: '文件夹' };
|
|
15
15
|
const IMAGE_LABEL = '图片';
|
|
@@ -338,7 +338,7 @@ export function resourceOf(row: any, lookups: ResourceLookups = {}): any {
|
|
|
338
338
|
|
|
339
339
|
// ref:文档库里的文档(v7 起 ref 是 DB 实体,没有物理路径)。
|
|
340
340
|
// 标题口径(#168):**文档标题**(正文首行的 # 标题)优先 —— 服务端在标注层
|
|
341
|
-
// (
|
|
341
|
+
// (attach.ts 的 annotateRefTitles)读库补上并覆盖 title/name;
|
|
342
342
|
// 这里先给 desc / 名字占位,读不到标题时前端回落它。
|
|
343
343
|
const info = lookups.refs && lookups.refs.get(String(meta.refId || row.targetKey || ''));
|
|
344
344
|
const refId = String(meta.refId || row.targetKey || (info && info.refId) || '');
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
//
|
|
1
|
+
// localtask/attach-template.ts —— 交付 instruction〔附件〕段的模板 ctx 与渲染。
|
|
2
2
|
//
|
|
3
3
|
// 输出由模板渲染(内置 DEFAULT_ATTACH_TEMPLATE 或配置模板),保证「配置模板」与
|
|
4
4
|
// 「内置默认」走同一份 ctx、同一套口径;渲染失败时用最朴素的逐条文本兜底
|
|
5
5
|
// (fail-open:附件路径必须到达 agent,模板写错不许吞掉附件信息)。
|
|
6
|
-
import { renderInstruction } from '
|
|
7
|
-
import { isImageName } from '
|
|
6
|
+
import { renderInstruction } from '../../../core/instruction-template.js';
|
|
7
|
+
import { isImageName } from '../../../core/filekind.js';
|
|
8
8
|
import { hostOfUrl, kindLabelOf, ORIGIN_LABEL, sizeTextOf, STATUS_LABEL } from './attach-resource.js';
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//
|
|
1
|
+
// localtask/attach.ts —— 本地任务链路的附件编排(标注 / 追加 / 清单)。
|
|
2
2
|
//
|
|
3
3
|
// 背景(任务 #15「localtask 附件功能未实现」):web 编辑器已把附件以
|
|
4
4
|
// `` 嵌进正文,但链路的 **agent 侧**对不上——get/wait 交付的
|
|
@@ -21,12 +21,12 @@
|
|
|
21
21
|
// 本文件只做编排——标注、挂载、清单、解除。
|
|
22
22
|
import { readFile } from 'node:fs/promises';
|
|
23
23
|
import { basename, resolve as resolvePath } from 'node:path';
|
|
24
|
-
import { badInput } from '
|
|
25
|
-
import { contentTypeOf, isImageName } from '
|
|
26
|
-
import { localIndex as localStoreIndex, localResolve, localUpload } from '
|
|
27
|
-
import { getDb } from '
|
|
28
|
-
import { tx } from '
|
|
29
|
-
import { attachmentsRootFromEnv } from '
|
|
24
|
+
import { badInput } from '../../../core/errors.js';
|
|
25
|
+
import { contentTypeOf, isImageName } from '../../../core/filekind.js';
|
|
26
|
+
import { localIndex as localStoreIndex, localResolve, localUpload } from '../../../core/localatt.js';
|
|
27
|
+
import { getDb } from '../../../core/db/index.js';
|
|
28
|
+
import { tx } from '../../../core/db/tx.js';
|
|
29
|
+
import { attachmentsRootFromEnv } from '../../../core/paths.js';
|
|
30
30
|
import {
|
|
31
31
|
deleteAttachment,
|
|
32
32
|
ensureRefAttachment,
|
|
@@ -41,8 +41,8 @@ import {
|
|
|
41
41
|
unlinkAttachment,
|
|
42
42
|
updateAttachmentNote,
|
|
43
43
|
upsertFileAttachment,
|
|
44
|
-
} from '
|
|
45
|
-
import * as service from '../
|
|
44
|
+
} from '../../../core/attachmentdb.js';
|
|
45
|
+
import * as service from '../service.js';
|
|
46
46
|
import { inlineDocContent } from './doc-inline.js';
|
|
47
47
|
import { fileStateOf, resourceOf, targetLookupsOf, type ResourceLookups } from './attach-resource.js';
|
|
48
48
|
|
|
@@ -52,7 +52,7 @@ export { attachmentInstruction, attachInstructionOf, attachTemplateCtx } from '.
|
|
|
52
52
|
// shared 在模块互依禁列里 → 动态 import(与 getloop/add 的 reposStore 同一惯例)。
|
|
53
53
|
let todoAttach: any = null;
|
|
54
54
|
async function todoAttachMod(): Promise<any> {
|
|
55
|
-
if (!todoAttach) todoAttach = await import('
|
|
55
|
+
if (!todoAttach) todoAttach = await import('../../../shared/attach.js');
|
|
56
56
|
return todoAttach;
|
|
57
57
|
}
|
|
58
58
|
|
|
@@ -79,7 +79,7 @@ async function annotateRefTitles(attachments: any[]): Promise<any[]> {
|
|
|
79
79
|
if (!refs.length) return attachments;
|
|
80
80
|
let titles = new Map<string, string>();
|
|
81
81
|
try {
|
|
82
|
-
const { refTitlesOf } = await import('
|
|
82
|
+
const { refTitlesOf } = await import('../../docs/brief.js');
|
|
83
83
|
titles = await refTitlesOf(refs);
|
|
84
84
|
} catch {
|
|
85
85
|
titles = new Map();
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
// 为什么不能从 cwd 反推项目:--cwd 是「队列地址」,--project 是「归属」——
|
|
24
24
|
// 两件事。反推等于让地址决定归属,用户以为在挂项目,实际被目录牵着走。
|
|
25
25
|
// 组内任务必须显式指明组内项目:归属不明就不该静默落在某个目录。
|
|
26
|
-
import { badInput } from '
|
|
26
|
+
import { badInput } from '../../../core/errors.js';
|
|
27
27
|
|
|
28
28
|
/** 归一化后的看板形状(外部 JSON → any)。 */
|
|
29
29
|
export type BoardLike = any;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//
|
|
1
|
+
// localtask/doc-inline.ts —— 任务级文档绑定的「进原文」(#162)。
|
|
2
2
|
//
|
|
3
3
|
// role='doc' 的 kind=ref 附件 = **文档资料绑定**:交付时把文档全文附进 instruction,
|
|
4
4
|
// 而不是只给一条 `docs get` 命令——agent 少跑一轮 nx-kv(任务原文口径:
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
// 经 `readMdfile`(唯一文件读入口)取正文;没登记 → 显式提示 + 给登记命令;
|
|
11
11
|
// - fail-open:读不到 → 内容留空,清单与取用命令照给,绝不拖垮领取。
|
|
12
12
|
import { MAX_INLINE_DOC_CHARS } from './attach-resource.js';
|
|
13
|
-
import { findMdfileByPath, noBodyReason, readMdfile, refDocById } from '
|
|
14
|
-
import { getDb } from '
|
|
13
|
+
import { findMdfileByPath, noBodyReason, readMdfile, refDocById } from '../../../core/attachmentdb.js';
|
|
14
|
+
import { getDb } from '../../../core/db/index.js';
|
|
15
15
|
|
|
16
16
|
/** 外部 md 正文:只认已登记的 mdfile(唯一文件读入口)。 */
|
|
17
17
|
function readExternalViaMdfile(db: any, locator: string): string | null {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
// repos[i] = { key, name, path }
|
|
10
10
|
let reposMod: any = null;
|
|
11
11
|
async function reposStore(): Promise<any> {
|
|
12
|
-
if (!reposMod) reposMod = await import('
|
|
12
|
+
if (!reposMod) reposMod = await import('../../repos/service.js');
|
|
13
13
|
return reposMod;
|
|
14
14
|
}
|
|
15
15
|
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
// 领取(含阻塞等待子功能)+ 内嵌弹窗。
|
|
3
3
|
//
|
|
4
4
|
// 解决的问题:agent 在一个对话里需要用户继续给任务时,不必结束本轮、等用户去
|
|
5
|
-
// 原始输入框打字,而是把 `nx-kv localtask
|
|
5
|
+
// 原始输入框打字,而是把 `nx-kv localtask get --cwd "<工作目录>" --timeout N`
|
|
6
6
|
// 当作 **本轮最后一个动作**调用——命令阻塞、自动打开浏览器弹窗;用户在弹窗/面板回填,
|
|
7
7
|
// 命令解除阻塞、把新任务作为结果返回给 agent,agent 接着干。
|
|
8
8
|
//
|
|
9
9
|
// 关键设计:
|
|
10
|
-
// 1. **工作目录即主题,主题拥有队列。**
|
|
11
|
-
// 作为主题 key
|
|
10
|
+
// 1. **工作目录即主题,主题拥有队列。** get 传入工作目录(默认进程 cwd),归一化后
|
|
11
|
+
// 作为主题 key;同一目录的多次阻塞领取共用同一个任务队列,
|
|
12
12
|
// 不同目录 → 不同主题 → 队列互不串。任务可在一个主题队列里逐条堆积,agent 按序领取。
|
|
13
13
|
// 2. **全局主题兜底(工作窃取)。** 除按目录划分的本地队列外,还有一个跨目录共享的
|
|
14
14
|
// 「全局主题」(key '__GLOBAL__'):本地队列取不到 pending 时,任何 wait 都自动去
|
|
@@ -29,11 +29,11 @@
|
|
|
29
29
|
// 本文件曾是 2400+ 行的 god-file,已按分节拆成本目录的兄弟文件;这里只做
|
|
30
30
|
// **门面再导出**——对外 API 路径('./service.js' 静态引用与动态 import)全部
|
|
31
31
|
// 不变;模块内部依赖方向(单向无环)见各文件头注释。
|
|
32
|
-
export * from './task-templates.js';
|
|
32
|
+
export * from './lifecycle/task-templates.js';
|
|
33
33
|
export * from './paths.js';
|
|
34
|
-
export * from './store-io.js';
|
|
34
|
+
export * from './infra/store-io.js';
|
|
35
35
|
// 存储仓储(T03):reset 仅测试用(清空库);repo 是窄方法的命名空间聚合。
|
|
36
|
-
export { resetLocaltaskStore, closeDb, default as repo } from './repo/index.js';
|
|
36
|
+
export { resetLocaltaskStore, closeDb, default as repo } from './infra/repo/index.js';
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
39
|
* 只读快照:把库投成旧 JSON store 的形状({ version, settings, topics: {key: topic} })。
|
|
@@ -41,20 +41,20 @@ export { resetLocaltaskStore, closeDb, default as repo } from './repo/index.js';
|
|
|
41
41
|
* **没有 saveStore**:写路径必须走 repo 窄方法,「读全表→改→整表重写」被禁止。
|
|
42
42
|
*/
|
|
43
43
|
export async function loadStore(): Promise<Record<string, any>> {
|
|
44
|
-
const repo = await import('./repo/index.js');
|
|
44
|
+
const repo = await import('./infra/repo/index.js');
|
|
45
45
|
repo.openLocaltaskStore();
|
|
46
46
|
const map: Record<string, any> = {};
|
|
47
47
|
for (const t of repo.topics.listTopics()) map[t.key] = t;
|
|
48
48
|
return { version: 4, settings: repo.settings.getLtSettings(), topics: map };
|
|
49
49
|
}
|
|
50
|
-
export * from './repo-ctx.js';
|
|
51
|
-
export * from './task-view.js';
|
|
50
|
+
export * from './infra/repo-ctx.js';
|
|
51
|
+
export * from './lifecycle/task-view.js';
|
|
52
52
|
export * from './waiters.js';
|
|
53
53
|
export * from './waiting.js';
|
|
54
|
-
export * from './deletion.js';
|
|
55
|
-
export * from './task-lifecycle.js';
|
|
56
|
-
export * from './topics.js';
|
|
57
|
-
export * from './task-ops.js';
|
|
58
|
-
export * from './task-remove.js';
|
|
59
|
-
export * from './panel-presence.js';
|
|
60
|
-
export * from './events.js';
|
|
54
|
+
export * from './lifecycle/deletion.js';
|
|
55
|
+
export * from './lifecycle/task-lifecycle.js';
|
|
56
|
+
export * from './lifecycle/topics.js';
|
|
57
|
+
export * from './lifecycle/task-ops.js';
|
|
58
|
+
export * from './lifecycle/task-remove.js';
|
|
59
|
+
export * from './ui/panel-presence.js';
|
|
60
|
+
export * from './infra/events.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// action 的人读输出(render)函数(自 index.js 拆出):CLI 与 HTTP 共用同一份措辞。
|
|
2
2
|
// STATUS_TAG 来自同构词表(src/shared/task-status.js):CLI 与面板共用一份措辞。
|
|
3
|
-
import { STATUS_TAG } from '
|
|
4
|
-
import { deliveryBodyText } from '
|
|
3
|
+
import { STATUS_TAG } from '../../../shared/task-status.js';
|
|
4
|
+
import { deliveryBodyText } from '../../../shared/delivery-text.js';
|
|
5
5
|
|
|
6
6
|
// 渲染入参都是 action 结果对象(HTTP/CLI body 透传)→ any。
|
|
7
7
|
export type RenderInput = any;
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
//
|
|
17
17
|
// 与 wait 的关系:wait 等待期间主题是 waiting 的 → 第 2 条否决,面板不会释放;
|
|
18
18
|
// wait 结束后若用户把页面关了,才会在宽限期后释放;下一次 wait 再拉起新实例。
|
|
19
|
-
import { countWaitingTopics, panelPresence } from '
|
|
19
|
+
import { countWaitingTopics, panelPresence } from '../service.js';
|
|
20
20
|
|
|
21
21
|
export const PANEL_IDLE_DEFAULTS = {
|
|
22
22
|
// 见过面板之后:连续多久没有任何面板请求(且无活标签)就认为「页关掉了」。
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
import http from 'node:http';
|
|
5
5
|
import { readFileSync } from 'node:fs';
|
|
6
6
|
import { join } from 'node:path';
|
|
7
|
-
import { APP_DIR, DEFAULT_PORT } from '
|
|
8
|
-
import { atomicWriteTextSync } from '
|
|
9
|
-
import { openLocaltaskStore as openStore, topics as topicsRepo } from '
|
|
10
|
-
import { isLiveWaiting } from '
|
|
7
|
+
import { APP_DIR, DEFAULT_PORT } from '../../../core/paths.js';
|
|
8
|
+
import { atomicWriteTextSync } from '../../../core/atomic-file.js';
|
|
9
|
+
import { openLocaltaskStore as openStore, topics as topicsRepo } from '../infra/repo/index.js';
|
|
10
|
+
import { isLiveWaiting } from '../lifecycle/task-view.js';
|
|
11
11
|
// ─── 面板空闲自释放所需的观测接口(panel-guard.js 调用)────────────
|
|
12
12
|
|
|
13
13
|
// 当前有多少主题「真的在等待」——常驻面板的空闲自释放据此否决退出:
|
|
@@ -193,7 +193,7 @@ async function fetchPanelPresence(timeoutMs: number = 900, port: number = DEFAUL
|
|
|
193
193
|
*
|
|
194
194
|
* SSE 活标签(用户停在「本地任务」页)**或** 面板最近有请求(用户停在任意页,
|
|
195
195
|
* App 壳每 15s 打 /api/ping 兜底)都算「面板开着」→ 1;都没有 → 0。
|
|
196
|
-
* 旧口径只数 SSE:用户一切到别的页(SSE
|
|
196
|
+
* 旧口径只数 SSE:用户一切到别的页(SSE 单视图挂载,切页即断)等待就误判
|
|
197
197
|
* 「没开」,于是重复开标签——这正是本次修复的根因。
|
|
198
198
|
*
|
|
199
199
|
* 任何探测失败都按 0 处理(保守地开一次页),绝不因探测失败而阻塞 wait。
|
|
@@ -321,7 +321,7 @@ export function readPanelRegistry(): PanelRegistryEntry[] {
|
|
|
321
321
|
return readAllPanels();
|
|
322
322
|
}
|
|
323
323
|
|
|
324
|
-
// 复查节奏与重开上限(REVIEW_MS
|
|
324
|
+
// 复查节奏与重开上限(REVIEW_MS 已随阻塞编排迁往 claim/wait.ts)。
|
|
325
325
|
const REOPEN_COOLDOWN_MS = 20_000;
|
|
326
326
|
// 一次 wait 最多开 3 个窗口:够救「手滑关掉」,又不至于在浏览器拦截脚本时刷屏。
|
|
327
327
|
const MAX_WINDOW_OPENS = 3;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
// ─── 进程内 waiter:key -> { resolve(task), summary, by } ───────────────
|
|
9
9
|
//
|
|
10
10
|
// 注册表**留在 localtask**(addTask 的唤醒路径要认领它),但注册/取走以 API 导出——
|
|
11
|
-
//
|
|
11
|
+
// get 的阻塞编排住在 claim/wait.ts,通过这组 API 挂钩,不碰队列内部。
|
|
12
12
|
|
|
13
13
|
/** 主题级 waiter 条目(resolve 回调收 JSON 形态任务)。 */
|
|
14
14
|
export interface TopicWaiterEntry {
|
|
@@ -20,7 +20,7 @@ export interface TopicWaiterEntry {
|
|
|
20
20
|
|
|
21
21
|
const waiters = new Map<string, TopicWaiterEntry>();
|
|
22
22
|
|
|
23
|
-
/**
|
|
23
|
+
/** get 编排侧:登记「本目录有阻塞中的 waiter」(同 key 旧登记被覆盖)。 */
|
|
24
24
|
export function registerTopicWaiter(key: string, entry: TopicWaiterEntry): void {
|
|
25
25
|
waiters.set(key, entry);
|
|
26
26
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
// finally 不会执行,waiting:true 会永久残留;独立成表后残留只污染这张小表,
|
|
7
7
|
// 整表清空即可,不会让队列本身看起来像有人在等。
|
|
8
8
|
import { isGlobalKey, GLOBAL_NAME, resolveTopicKey } from './paths.js';
|
|
9
|
-
import { openLocaltaskStore as openStore, presence as presenceRepo, topics as topicsRepo, txw as tx } from './repo/index.js';
|
|
9
|
+
import { openLocaltaskStore as openStore, presence as presenceRepo, topics as topicsRepo, txw as tx } from './infra/repo/index.js';
|
|
10
10
|
|
|
11
11
|
// 在库里把某主题置为等待/结束,并刷新现状。
|
|
12
12
|
// waitingSince 是「等待起点」,面板据此显示「已等多久」——waitingUntil(截止时刻)
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
//
|
|
3
3
|
// 单独成文件的原因:actions/ 下的 action 经 _manifest.generated.ts 被 index.ts
|
|
4
4
|
// 装配,若 action 反向 import index.js 就形成 TDZ 回环——工厂是 actions 与
|
|
5
|
-
//
|
|
5
|
+
// claim 共同的依赖终点,不含任何装配代码。
|
|
6
6
|
//
|
|
7
|
-
// 依赖方向(设计内):
|
|
7
|
+
// 依赖方向(设计内):claim 是唯一消费方——领域取数(readGroupContext /
|
|
8
8
|
// attachTemplateCtx / pendingQueueInfo / getloop 指令渲染)由宿主完成,以 `Supply`
|
|
9
9
|
// 形式交给插件;插件在自己的 buildData() 里 await supplied() 后只做变换。
|
|
10
10
|
// promptplug 不 import 其他模块。
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
// promptplug 装配:模块元信息 + action 清单装配。
|
|
2
2
|
//
|
|
3
3
|
// 插件工厂 / 注册表 / 字段目录在 factory.ts + registry.ts(actions 经 manifest 引
|
|
4
|
-
// 工厂,不能回环引本文件)。依赖方向(设计内):
|
|
4
|
+
// 工厂,不能回环引本文件)。依赖方向(设计内):claim 是唯一消费方——宿主完成
|
|
5
5
|
// 领域取数,以 Supply 形式注入插件;插件在自己的 buildData() 里变换。
|
|
6
|
-
// promptplug 不 import 其他模块(
|
|
6
|
+
// promptplug 不 import 其他模块(claim/host.ts 的交付组装同样只收宿主取好的数据)。
|
|
7
7
|
import { ModuleBase } from '../../runtime/types/module.js';
|
|
8
8
|
import { zodActionsOf, type ZodBoundAction } from '../../runtime/action-decorator.js';
|
|
9
9
|
import { container, type Container } from '../../runtime/container.js';
|
|
10
10
|
import { ACTIONS } from './actions/_manifest.generated.js';
|
|
11
11
|
|
|
12
|
-
// 装配无关的公开面(
|
|
12
|
+
// 装配无关的公开面(claim / settings.ts 从这里拿)
|
|
13
13
|
export {
|
|
14
14
|
activeTemplateOf,
|
|
15
15
|
blockLabelOf,
|
|
@@ -37,8 +37,8 @@ export { compose } from './compose.js';
|
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
39
|
* 提示词插件模块:注册表外露(prompt.registry)。
|
|
40
|
-
* 业务面(compose / buildPlugins)由
|
|
41
|
-
* (
|
|
40
|
+
* 业务面(compose / buildPlugins)由 claim 域直接消费——这是设计内依赖
|
|
41
|
+
* (claim → promptplug)。本模块不 import 任何其他模块(组装核已迁到 claim/assemble.ts)。
|
|
42
42
|
*/
|
|
43
43
|
export class PromptplugModule extends ModuleBase {
|
|
44
44
|
override readonly id = 'promptplug';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// attachment 插件(order 20):附件识别。
|
|
2
2
|
//
|
|
3
|
-
// 数据变换(attachTemplateCtx)留在
|
|
3
|
+
// 数据变换(attachTemplateCtx)留在 localtask/attach-template.ts —— 它依赖
|
|
4
4
|
// attach-resource 的标注工具链(kind 归一 / 可读性探测 / 取用命令),随插件搬会
|
|
5
5
|
// 牵动三处引用。插件消费宿主标注后的 attach 对象,**schema 逐字对齐它的真实形状**。
|
|
6
6
|
//
|