nx-kv 0.63.0 → 0.64.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.
- package/CHANGELOG.md +29 -0
- package/assets/nx-kv/references/A03-/346/226/207/346/241/243/344/270/216/345/275/222/345/261/236.md +6 -5
- package/package.json +2 -2
- package/src/core/attachmentdb/docs.ts +3 -6
- package/src/core/attachmentdb/query.ts +2 -2
- package/src/core/attachmentdb/relations.ts +36 -21
- package/src/core/db/import-json/refs.ts +17 -19
- package/src/core/db/import-json/repos.ts +4 -8
- package/src/core/db/migrations/index.ts +2 -0
- package/src/core/db/migrations/v13.sql +24 -0
- package/src/core/db/seed-templates.ts +15 -4
- package/src/core/db/version.ts +3 -1
- package/src/modules/docs/actions/_manifest.generated.ts +0 -3
- package/src/modules/docs/actions/doc-attach.ts +0 -1
- package/src/modules/docs/actions/docs-bindings.ts +2 -5
- package/src/modules/docs/actions/docs-link.ts +1 -2
- package/src/modules/docs/attach.ts +1 -36
- package/src/modules/docs/bound-docs.ts +2 -2
- package/src/modules/docs/brief.ts +0 -2
- package/src/modules/docs/docref.ts +7 -17
- package/src/modules/docs/knowledge-md.ts +1 -1
- package/src/modules/docs/knowledge.ts +48 -45
- package/src/modules/docs/ref-sync.ts +1 -5
- package/src/modules/docs/refs.ts +7 -10
- package/src/modules/docs/service.ts +1 -3
- package/src/modules/localtask/actions/localtask-config.ts +19 -58
- package/src/modules/localtask/actions/localtask-prune.ts +7 -2
- package/src/modules/localtask/repo/open.ts +0 -4
- package/src/modules/localtask/repo/settings.ts +20 -196
- package/src/modules/localtask/task-lifecycle.ts +7 -9
- package/src/modules/localtask/task-templates.ts +4 -4
- package/src/modules/localtask/task-view.ts +4 -0
- package/src/modules/localtask/topics.ts +30 -28
- package/src/modules/promptplug/actions/_manifest.generated.ts +0 -3
- package/src/modules/promptplug/actions/prompt-registry.ts +19 -30
- package/src/modules/promptplug/base.ts +69 -25
- package/src/modules/promptplug/compose.ts +40 -23
- package/src/modules/promptplug/factory.ts +91 -59
- package/src/modules/promptplug/index.ts +25 -11
- package/src/modules/promptplug/plugins/ack.ts +28 -0
- package/src/modules/promptplug/plugins/attachment.ts +237 -19
- package/src/modules/promptplug/plugins/context.ts +124 -30
- package/src/modules/promptplug/plugins/doneguard.ts +33 -0
- package/src/modules/promptplug/plugins/ext.ts +34 -11
- package/src/modules/promptplug/plugins/getloop.ts +29 -8
- package/src/modules/promptplug/plugins/goal-shape.ts +34 -0
- package/src/modules/promptplug/plugins/goalhint.ts +33 -0
- package/src/modules/promptplug/plugins/timecheck.ts +33 -0
- package/src/modules/promptplug/registry.ts +99 -0
- package/src/modules/promptplug/schema-bridge.ts +77 -13
- package/src/modules/repos/actions/board-rekey.ts +1 -1
- package/src/modules/repos/actions/repo-doc-add.ts +2 -3
- package/src/modules/repos/boards/core.ts +1 -13
- package/src/modules/repos/boards/docs.ts +2 -12
- package/src/modules/repos/boards/members.ts +2 -14
- package/src/modules/repos/boards/transfer.ts +2 -11
- package/src/modules/repos/keys.ts +4 -11
- package/src/modules/repos/repo/refs.ts +3 -5
- package/src/modules/repos/repo/repos.ts +12 -13
- package/src/modules/repos/repo/rows.ts +2 -8
- package/src/modules/repos/service/context.ts +0 -2
- package/src/modules/repos/service/crud.ts +1 -4
- package/src/modules/repos/service/store.ts +6 -7
- package/src/modules/repos/transfer/export.ts +3 -8
- package/src/modules/repos/transfer/import.ts +0 -13
- package/src/modules/repos/transfer/layout.ts +2 -2
- package/src/modules/tasktool/attach-template.ts +3 -3
- package/src/modules/tasktool/groupctx.ts +4 -5
- package/src/modules/tasktool/plugins/waitgoal-config.ts +5 -6
- package/src/modules/tasktool/preview.ts +20 -23
- package/src/modules/tasktool/wait.ts +24 -46
- package/src/modules/templates/actions/_manifest.generated.ts +3 -0
- package/src/modules/templates/actions/templates-reorder.ts +28 -0
- package/src/modules/templates/repo/templates.ts +32 -2
- package/src/modules/templates/service.ts +45 -0
- package/src/shared/prompt-blocks.ts +7 -173
- package/src/shared/prompt-plugin.ts +79 -59
- package/src/web/frontend/App.tsx +27 -1
- package/src/web/frontend/api/cli-tree.json +20 -35
- package/src/web/frontend/api/client.generated.ts +22 -32
- package/src/web/frontend/components/Introduction/rail.tsx +2 -2
- package/src/web/frontend/components/Introduction/use-intro.ts +2 -5
- package/src/web/frontend/components/bindings/bind-tags.tsx +1 -3
- package/src/web/frontend/components/list-search.tsx +37 -0
- package/src/web/frontend/components/md/attach-area.tsx +10 -15
- package/src/web/frontend/components/md/live-block.tsx +5 -14
- package/src/web/frontend/components/md/md-panes.tsx +3 -19
- package/src/web/frontend/modules/list-filter.ts +37 -0
- package/src/web/frontend/modules/md/fill-session.ts +36 -0
- package/src/web/frontend/modules/md/manage-session.ts +24 -0
- package/src/web/frontend/modules/md/new-task-from-template.ts +22 -0
- package/src/web/frontend/modules/md/styles/editor.css +5 -12
- package/src/web/frontend/modules/md/styles/shell.css +4 -0
- package/src/web/frontend/modules/md/task-intent.ts +29 -0
- package/src/web/frontend/modules/md/use-templates.ts +8 -0
- package/src/web/frontend/modules/prompts/template-preview.ts +12 -20
- package/src/web/frontend/modules/refs/api.ts +0 -1
- package/src/web/frontend/page/dir/index.tsx +20 -5
- package/src/web/frontend/page/dir/task-actions.ts +14 -0
- package/src/web/frontend/page/dir/task-preview-modal.tsx +1 -1
- package/src/web/frontend/page/dir/task.tsx +19 -0
- package/src/web/frontend/page/doc/api.ts +2 -3
- package/src/web/frontend/page/doc/bindings.tsx +46 -16
- package/src/web/frontend/page/doc/index.tsx +3 -4
- package/src/web/frontend/page/group/index.tsx +65 -117
- package/src/web/frontend/page/refs/index.tsx +27 -3
- package/src/web/frontend/page/refs/style.css +3 -0
- package/src/web/frontend/page/repos/bind-modals.tsx +18 -2
- package/src/web/frontend/page/repos/board-admin.tsx +1 -1
- package/src/web/frontend/page/repos/index.tsx +4 -8
- package/src/web/frontend/page/repos/ref-block.tsx +5 -12
- package/src/web/frontend/page/repos/ref-panel.tsx +3 -4
- package/src/web/frontend/page/repos/repo-form-modal.tsx +1 -8
- package/src/web/frontend/page/repos/repo-table.tsx +4 -29
- package/src/web/frontend/page/repos/use-repos-derive.ts +4 -5
- package/src/web/frontend/page/settings/api.ts +7 -15
- package/src/web/frontend/page/settings/prompt-templates-section.tsx +261 -289
- package/src/web/frontend/page/settings/prompt-vars.ts +56 -0
- package/src/web/frontend/page/settings/style.css +46 -64
- package/src/web/frontend/page/templates/fill.tsx +124 -0
- package/src/web/frontend/page/templates/index.tsx +11 -0
- package/src/web/frontend/page/templates/manage.tsx +218 -0
- package/src/web/frontend/page/templates/style.css +46 -0
- package/src/web/frontend/page/templates/template-list.tsx +58 -54
- package/src/web/frontend/refs/api.ts +0 -2
- package/src/web/frontend/routes/route-eq.ts +22 -0
- package/src/web/frontend/routes/templates.ts +20 -0
- package/src/web/frontend/style.css +1 -0
- package/src/web/frontend/styles/list-search.css +44 -0
- package/src/web/frontend/types.ts +5 -1
- package/src/web/public/assets/{bar-CYWfxHfm.js → bar-j14ON7uZ.js} +1 -1
- package/src/web/public/assets/{composer-launch-Bor4ngrQ.js → composer-launch-DRi9mZE1.js} +1 -1
- package/src/web/public/assets/{composer-panel-C7mNI7EW.js → composer-panel-swmDqlPw.js} +1 -1
- package/src/web/public/assets/dir-DhsB1ZhL.js +3 -0
- package/src/web/public/assets/doc-D4po3sDc.js +6 -0
- package/src/web/public/assets/fill-session-fHxQHFaD.js +1 -0
- package/src/web/public/assets/group-BxmSNzIB.js +1 -0
- package/src/web/public/assets/index-CMjG5NVU.js +2 -0
- package/src/web/public/assets/index-uMjSWNVr.css +1 -0
- package/src/web/public/assets/list-filter-D-x94TvA.js +1 -0
- package/src/web/public/assets/manage-session-CS8UvmUd.js +1 -0
- package/src/web/public/assets/md-history-CZUF_FhN.js +39 -0
- package/src/web/public/assets/new-task-from-template-DDWu4yR4.js +1 -0
- package/src/web/public/assets/refs-TuuoaRs7.js +2 -0
- package/src/web/public/assets/refs-zSA2k_45.css +1 -0
- package/src/web/public/assets/render-template-body-bXdedFig.js +1 -0
- package/src/web/public/assets/repo-form-modal-BD4N37MI.js +1 -0
- package/src/web/public/assets/repos-BPeuX4N9.js +12 -0
- package/src/web/public/assets/settings-CZJaKLZW.js +1 -0
- package/src/web/public/assets/settings-Cc6puKd5.css +1 -0
- package/src/web/public/assets/task-DgbbF5gy.js +11 -0
- package/src/web/public/assets/task-intent-CX5DZccN.js +1 -0
- package/src/web/public/assets/{task-utils-DpnPjZKJ.js → task-utils-bJH1-Cjy.js} +1 -1
- package/src/web/public/assets/templates-CBXlwyof.js +11 -0
- package/src/web/public/assets/templates-plA8R7jJ.css +1 -0
- package/src/web/public/assets/use-rail-drag-ufwy2XZB.js +1 -0
- package/src/web/public/index.html +8 -6
- package/src/modules/docs/actions/doc-attach-note.ts +0 -32
- package/src/modules/promptplug/Template/blockTemplates.json +0 -90
- package/src/modules/promptplug/actions/prompt-order.ts +0 -38
- package/src/modules/promptplug/ensure.ts +0 -57
- package/src/modules/promptplug/keys.ts +0 -9
- package/src/modules/promptplug/plugins/readonly-blocks.ts +0 -75
- package/src/modules/promptplug/template-bundle.ts +0 -59
- package/src/web/frontend/modules/md/template-locks.ts +0 -105
- package/src/web/frontend/page/settings/prompt-editor.tsx +0 -279
- package/src/web/frontend/page/settings/prompt-rail.tsx +0 -170
- package/src/web/public/assets/dir-CcffxXL2.js +0 -3
- package/src/web/public/assets/doc-BxWVzWkw.js +0 -6
- package/src/web/public/assets/group-C5Yu3oJr.js +0 -1
- package/src/web/public/assets/index-BvyZ1MA2.js +0 -2
- package/src/web/public/assets/index-Cp-TtHyA.css +0 -1
- package/src/web/public/assets/md-history-DejKuR12.js +0 -39
- package/src/web/public/assets/refs-DJdKV8_H.css +0 -1
- package/src/web/public/assets/refs-VbDnDTV0.js +0 -2
- package/src/web/public/assets/repo-form-modal-Dkdvu_uN.js +0 -1
- package/src/web/public/assets/repos-CY0eZheu.js +0 -16
- package/src/web/public/assets/settings-AwzLRYUu.css +0 -1
- package/src/web/public/assets/settings-D3T-vgCl.js +0 -1
- package/src/web/public/assets/task-CkCD82h_.js +0 -11
- package/src/web/public/assets/templates-BcuCbT4U.js +0 -10
- package/src/web/public/assets/templates-gNdtaMI2.css +0 -1
- package/src/web/public/assets/use-rail-drag-DMvr8-GE.js +0 -1
|
@@ -14,7 +14,6 @@ import type {
|
|
|
14
14
|
} from '../../../modules/bundled/actions/_manifest.generated.js';
|
|
15
15
|
import type {
|
|
16
16
|
DocAttachAction,
|
|
17
|
-
DocAttachNoteAction,
|
|
18
17
|
DocAttachmentsAction,
|
|
19
18
|
DocDetachAction,
|
|
20
19
|
DocGetAction,
|
|
@@ -77,7 +76,6 @@ import type {
|
|
|
77
76
|
LocaltaskUpdateAction,
|
|
78
77
|
} from '../../../modules/localtask/actions/_manifest.generated.js';
|
|
79
78
|
import type {
|
|
80
|
-
PromptOrderAction,
|
|
81
79
|
PromptRegistryAction,
|
|
82
80
|
} from '../../../modules/promptplug/actions/_manifest.generated.js';
|
|
83
81
|
import type {
|
|
@@ -149,6 +147,7 @@ import type {
|
|
|
149
147
|
TemplatesDefaultAction,
|
|
150
148
|
TemplatesListAction,
|
|
151
149
|
TemplatesRemoveAction,
|
|
150
|
+
TemplatesReorderAction,
|
|
152
151
|
TemplatesUpdateAction,
|
|
153
152
|
} from '../../../modules/templates/actions/_manifest.generated.js';
|
|
154
153
|
|
|
@@ -202,7 +201,7 @@ export interface ApiClient {
|
|
|
202
201
|
clone(input: z.input<InstanceType<typeof RepoCloneAction>['_input']>): Promise<Awaited<ReturnType<InstanceType<typeof RepoCloneAction>['run']>>>;
|
|
203
202
|
/** 探测目录的 git remote(添加仓库前自动填充远程地址;只读) */
|
|
204
203
|
detect(input: z.input<InstanceType<typeof RepoDetectAction>['_input']>): Promise<Awaited<ReturnType<InstanceType<typeof RepoDetectAction>['run']>>>;
|
|
205
|
-
/** 给项目加一篇介绍文档:--ref <refId> | --path <外部绝对路径>(同 ref 重复添加 =
|
|
204
|
+
/** 给项目加一篇介绍文档:--ref <refId> | --path <外部绝对路径>(同 ref 重复添加 = 移到末尾) */
|
|
206
205
|
docAdd(input: z.input<InstanceType<typeof RepoDocAddAction>['_input']>): Promise<Awaited<ReturnType<InstanceType<typeof RepoDocAddAction>['run']>>>;
|
|
207
206
|
/** 列出项目的介绍文档集(主篇 + 其余各篇,refId + desc) */
|
|
208
207
|
docList(input: z.input<InstanceType<typeof RepoDocListAction>['_input']>): Promise<Awaited<ReturnType<InstanceType<typeof RepoDocListAction>['run']>>>;
|
|
@@ -254,8 +253,6 @@ export interface ApiClient {
|
|
|
254
253
|
scan(input?: z.input<InstanceType<typeof RepoScanAction>['_input']>): Promise<Awaited<ReturnType<InstanceType<typeof RepoScanAction>['run']>>>;
|
|
255
254
|
/** 修改仓库路径 / 名称 / 备注 / 类型 / 远程地址 / key;--get-loop* 配置项目级「持续 get」(waitgoal:该项目 get 无任务时阻塞等人回填;指令文案在 设置 → 提示词模板 → 持续 get,仓库侧只有开关 + 分钟)。描述已改为文档,不再经这里改 */
|
|
256
255
|
repoUpdate(input: z.input<InstanceType<typeof RepoUpdateAction>['_input']>): Promise<Awaited<ReturnType<InstanceType<typeof RepoUpdateAction>['run']>>>;
|
|
257
|
-
/** 改一条附件绑定的说明(desc):--attachment <资源 id> --note <说明>(只动说明,角色/位置不变) */
|
|
258
|
-
attachNote(input: z.input<InstanceType<typeof DocAttachNoteAction>['_input']>): Promise<Awaited<ReturnType<InstanceType<typeof DocAttachNoteAction>['run']>>>;
|
|
259
256
|
/** 给文档挂资源:--path / --fileId / --url / --task / --doc / --mdfile / --folder 之一;默认追加进正文,--no-embed 只挂附件区(不写正文) */
|
|
260
257
|
attach(input: z.input<InstanceType<typeof DocAttachAction>['_input']>): Promise<Awaited<ReturnType<InstanceType<typeof DocAttachAction>['run']>>>;
|
|
261
258
|
/** 这篇文档用了哪些资源(ref_attach:图片/文件/URL/内部 task、ref 引用) */
|
|
@@ -286,7 +283,7 @@ export interface ApiClient {
|
|
|
286
283
|
gc(input?: z.input<InstanceType<typeof DocsGcAction>['_input']>): Promise<Awaited<ReturnType<InstanceType<typeof DocsGcAction>['run']>>>;
|
|
287
284
|
/** 双链索引(docId + 文件名;前端点击 [[..]] 前拉一次;解析规则见 core/wikilink.js) */
|
|
288
285
|
index(): Promise<Awaited<ReturnType<InstanceType<typeof DocsIndexAction>['run']>>>;
|
|
289
|
-
/** 维护组的附加文档列表(--ref <refId> | --path
|
|
286
|
+
/** 维护组的附加文档列表(--ref <refId> | --path <外部路径>;--remove <序号> 移除;--before <序号> 插位;同 ref 重复添加 = 移位) */
|
|
290
287
|
link(input: z.input<InstanceType<typeof DocsLinkAction>['_input']>): Promise<Awaited<ReturnType<InstanceType<typeof DocsLinkAction>['run']>>>;
|
|
291
288
|
/** 把某一篇设为主篇:原主篇退回附加篇(不丢归属),目标从附加篇摘出(不会出现两份) */
|
|
292
289
|
main(input?: z.input<InstanceType<typeof DocsMainAction>['_input']>): Promise<Awaited<ReturnType<InstanceType<typeof DocsMainAction>['run']>>>;
|
|
@@ -297,7 +294,7 @@ export interface ApiClient {
|
|
|
297
294
|
/** 向某主题(工作目录)的队列回填一条任务(正文可多行;--file <文件|-> 从文件/标准输入读,长文本不必靠引号硬拼;有 wait 在等则即时投递,否则排队);--global 推到全局共享池;--duration 给任务带时间目标(领取即计时,完成前必须 check);--board/--project 让任务带工作组语义(正文 frontmatter:board + project + 双方介绍引用),并落进该项目的队列;正文自带 frontmatter 时同样认归属——补介绍引用,落点跟到项目队列(显式给过 --cwd 时不挪窝) */
|
|
298
295
|
localtaskAdd(input?: z.input<InstanceType<typeof LocaltaskAddAction>['_input']>): Promise<Awaited<ReturnType<InstanceType<typeof LocaltaskAddAction>['run']>>>;
|
|
299
296
|
/** 改一条附件绑定的说明(desc):--attachment <资源 id> --note <说明>(只动说明,角色/位置不变) */
|
|
300
|
-
|
|
297
|
+
attachNote(input: z.input<InstanceType<typeof LocaltaskAttachNoteAction>['_input']>): Promise<Awaited<ReturnType<InstanceType<typeof LocaltaskAttachNoteAction>['run']>>>;
|
|
301
298
|
/** 给任务挂附件:--path 存本机附件仓 / --fileId 引用已有附件 / --url / --task(同主题任务)/ --ref(文档)/ --mdfile(本地 md 指针)/ --folder(本地文件夹路径);默认嵌进正文,--no-embed 只挂到附件区(不写正文),--ref 加 --inline 文档进原文(交付带全文) */
|
|
302
299
|
localtaskAttach(input: z.input<InstanceType<typeof LocaltaskAttachAction>['_input']>): Promise<Awaited<ReturnType<InstanceType<typeof LocaltaskAttachAction>['run']>>>;
|
|
303
300
|
/** 列出某条任务引用的附件(正文里的  嵌入),以及本地是否已有(给 agent 直接读本地文件) */
|
|
@@ -316,7 +313,7 @@ export interface ApiClient {
|
|
|
316
313
|
localtaskClone(input: z.input<InstanceType<typeof LocaltaskCloneAction>['_input']>): Promise<Awaited<ReturnType<InstanceType<typeof LocaltaskCloneAction>['run']>>>;
|
|
317
314
|
/** 批量收口还没结束的任务(按 --ids,定位到 --cwd 主题或 --key):不要求先领取;--status done 写完成总结,cancelled 只改状态;待领取与已领取都能收(已领取的 agent 侧回执会被忽略),已完成/已取消跳过 */
|
|
318
315
|
closeMany(input: z.input<InstanceType<typeof LocaltaskCloseManyAction>['_input']>): Promise<Awaited<ReturnType<InstanceType<typeof LocaltaskCloseManyAction>['run']>>>;
|
|
319
|
-
/** 配置等待超时(秒)/
|
|
316
|
+
/** 配置等待超时(秒)/ 系统上下文追加模式(提示词模板正文固定在插件类里,不再可配) */
|
|
320
317
|
config(input?: z.input<InstanceType<typeof LocaltaskConfigAction>['_input']>): Promise<Awaited<ReturnType<InstanceType<typeof LocaltaskConfigAction>['run']>>>;
|
|
321
318
|
/** 解除任务与附件的关系(默认只解除关系,资源进孤儿池);--purge 在无人引用时连资源行与本机字节一起删 */
|
|
322
319
|
localtaskDetach(input: z.input<InstanceType<typeof LocaltaskDetachAction>['_input']>): Promise<Awaited<ReturnType<InstanceType<typeof LocaltaskDetachAction>['run']>>>;
|
|
@@ -336,7 +333,7 @@ export interface ApiClient {
|
|
|
336
333
|
presence(): Promise<Awaited<ReturnType<InstanceType<typeof LocaltaskPresenceAction>['run']>>>;
|
|
337
334
|
/** 预览一条任务在 get/wait 时的交付提示词(只读:不领取、不写盘、不启动计时、不为附件发网);草稿用 --text 直接预览 */
|
|
338
335
|
preview(input?: z.input<InstanceType<typeof LocaltaskPreviewAction>['_input']>): Promise<Awaited<ReturnType<InstanceType<typeof LocaltaskPreviewAction>['run']>>>;
|
|
339
|
-
/**
|
|
336
|
+
/** 清理旧脏数据(旧模型无目录主题、空主题;--missing-dir 连目录已不存在的主题一起清;等待中一律保留) */
|
|
340
337
|
localtaskPrune(input?: z.input<InstanceType<typeof LocaltaskPruneAction>['_input']>): Promise<Awaited<ReturnType<InstanceType<typeof LocaltaskPruneAction>['run']>>>;
|
|
341
338
|
/** 删除一条任务(按 --id,定位到 --cwd 主题或 --key);删除是**可恢复**的(软删除),加 --purge 彻底清除 */
|
|
342
339
|
localtaskRemove(input: z.input<InstanceType<typeof LocaltaskRemoveAction>['_input']>): Promise<Awaited<ReturnType<InstanceType<typeof LocaltaskRemoveAction>['run']>>>;
|
|
@@ -384,6 +381,8 @@ export interface ApiClient {
|
|
|
384
381
|
templatesList(input?: z.input<InstanceType<typeof TemplatesListAction>['_input']>): Promise<Awaited<ReturnType<InstanceType<typeof TemplatesListAction>['run']>>>;
|
|
385
382
|
/** 删除任务模板(内置默认模板不可删;删的是默认模板则默认回落到内置) */
|
|
386
383
|
templatesRemove(input: z.input<InstanceType<typeof TemplatesRemoveAction>['_input']>): Promise<Awaited<ReturnType<InstanceType<typeof TemplatesRemoveAction>['run']>>>;
|
|
384
|
+
/** 调整任务模板顺序(--ids a,b,c 按新序落库 sort_order;未列出的模板保持原位) */
|
|
385
|
+
templatesReorder(input: z.input<InstanceType<typeof TemplatesReorderAction>['_input']>): Promise<Awaited<ReturnType<InstanceType<typeof TemplatesReorderAction>['run']>>>;
|
|
387
386
|
/** 编辑任务模板(--name 改名 / --body 改正文 / --scope 改可见域,只改传入项;多行正文用 --body-file;内置模板的正文也可改) */
|
|
388
387
|
templatesUpdate(input: z.input<InstanceType<typeof TemplatesUpdateAction>['_input']>): Promise<Awaited<ReturnType<InstanceType<typeof TemplatesUpdateAction>['run']>>>;
|
|
389
388
|
/** 取附件本体:面板内联预览;CLI 打印本机路径 */
|
|
@@ -404,9 +403,7 @@ export interface ApiClient {
|
|
|
404
403
|
install(input?: z.input<InstanceType<typeof BundledInstallAction>['_input']>): Promise<Awaited<ReturnType<InstanceType<typeof BundledInstallAction>['run']>>>;
|
|
405
404
|
/** 列出包内自带 skill(含文件数与描述)+ 默认装哪个 + 有哪些 group */
|
|
406
405
|
bundledList(): Promise<Awaited<ReturnType<InstanceType<typeof BundledListAction>['run']>>>;
|
|
407
|
-
/**
|
|
408
|
-
order(input: z.input<InstanceType<typeof PromptOrderAction>['_input']>): Promise<Awaited<ReturnType<InstanceType<typeof PromptOrderAction>['run']>>>;
|
|
409
|
-
/** 提示词插件注册表:8 段的生效模板 / 变量目录 / 顺序位(三端同源,uiDescriptor 派生) */
|
|
406
|
+
/** 提示词插件注册表:按时机链(get / check / done)列出插件的内置模板 / 变量目录 / 链内顺序 */
|
|
410
407
|
registry(): Promise<Awaited<ReturnType<InstanceType<typeof PromptRegistryAction>['run']>>>;
|
|
411
408
|
}
|
|
412
409
|
|
|
@@ -556,7 +553,7 @@ export function createApiClient(transport: Transport): ApiClient {
|
|
|
556
553
|
async docAdd(input: z.input<InstanceType<typeof RepoDocAddAction>['_input']>) {
|
|
557
554
|
const inp = input ?? ({} as z.input<InstanceType<typeof RepoDocAddAction>['_input']>);
|
|
558
555
|
const path = `/api/repos/docs`;
|
|
559
|
-
const body = { "id": inp["id"], "ref": inp["ref"], "path": inp["path"]
|
|
556
|
+
const body = { "id": inp["id"], "ref": inp["ref"], "path": inp["path"] };
|
|
560
557
|
return (await transport.request("POST", path, body)) as Awaited<ReturnType<InstanceType<typeof RepoDocAddAction>['run']>>;
|
|
561
558
|
},
|
|
562
559
|
// action: repo.doc.list
|
|
@@ -757,18 +754,11 @@ export function createApiClient(transport: Transport): ApiClient {
|
|
|
757
754
|
const body = { "path": inp["path"], "name": inp["name"], "icon": inp["icon"], "desc": inp["desc"], "notes": inp["notes"], "type": inp["type"], "remote": inp["remote"], "key": inp["key"], "key-custom": inp["key-custom"], "get-loop": inp["get-loop"], "get-loop-minutes": inp["get-loop-minutes"] };
|
|
758
755
|
return (await transport.request("PATCH", path, body)) as Awaited<ReturnType<InstanceType<typeof RepoUpdateAction>['run']>>;
|
|
759
756
|
},
|
|
760
|
-
// action: doc.attach-note
|
|
761
|
-
async attachNote(input: z.input<InstanceType<typeof DocAttachNoteAction>['_input']>) {
|
|
762
|
-
const inp = input ?? ({} as z.input<InstanceType<typeof DocAttachNoteAction>['_input']>);
|
|
763
|
-
const path = `/api/docs/attach-note`;
|
|
764
|
-
const body = { "ref": inp["ref"], "attachment": inp["attachment"], "note": inp["note"] };
|
|
765
|
-
return (await transport.request("PATCH", path, body)) as Awaited<ReturnType<InstanceType<typeof DocAttachNoteAction>['run']>>;
|
|
766
|
-
},
|
|
767
757
|
// action: doc.attach
|
|
768
758
|
async attach(input: z.input<InstanceType<typeof DocAttachAction>['_input']>) {
|
|
769
759
|
const inp = input ?? ({} as z.input<InstanceType<typeof DocAttachAction>['_input']>);
|
|
770
760
|
const path = `/api/docs/attach`;
|
|
771
|
-
const body = { "ref": inp["ref"], "path": inp["path"], "fileId": inp["fileId"], "url": inp["url"], "task": inp["task"], "doc": inp["doc"], "mdfile": inp["mdfile"], "folder": inp["folder"], "name": inp["name"], "
|
|
761
|
+
const body = { "ref": inp["ref"], "path": inp["path"], "fileId": inp["fileId"], "url": inp["url"], "task": inp["task"], "doc": inp["doc"], "mdfile": inp["mdfile"], "folder": inp["folder"], "name": inp["name"], "noEmbed": inp["noEmbed"], "no-embed": inp["no-embed"] };
|
|
772
762
|
return (await transport.request("POST", path, body)) as Awaited<ReturnType<InstanceType<typeof DocAttachAction>['run']>>;
|
|
773
763
|
},
|
|
774
764
|
// action: doc.attachments
|
|
@@ -891,7 +881,7 @@ export function createApiClient(transport: Transport): ApiClient {
|
|
|
891
881
|
async link(input: z.input<InstanceType<typeof DocsLinkAction>['_input']>) {
|
|
892
882
|
const inp = input ?? ({} as z.input<InstanceType<typeof DocsLinkAction>['_input']>);
|
|
893
883
|
const path = `/api/docs/link`;
|
|
894
|
-
const body = { "board": inp["board"], "ref": inp["ref"], "path": inp["path"], "
|
|
884
|
+
const body = { "board": inp["board"], "ref": inp["ref"], "path": inp["path"], "remove": inp["remove"], "before": inp["before"] };
|
|
895
885
|
return (await transport.request("POST", path, body)) as Awaited<ReturnType<InstanceType<typeof DocsLinkAction>['run']>>;
|
|
896
886
|
},
|
|
897
887
|
// action: docs.main
|
|
@@ -926,7 +916,7 @@ export function createApiClient(transport: Transport): ApiClient {
|
|
|
926
916
|
return (await transport.request("POST", path, body)) as Awaited<ReturnType<InstanceType<typeof LocaltaskAddAction>['run']>>;
|
|
927
917
|
},
|
|
928
918
|
// action: localtask.attach-note
|
|
929
|
-
async
|
|
919
|
+
async attachNote(input: z.input<InstanceType<typeof LocaltaskAttachNoteAction>['_input']>) {
|
|
930
920
|
const inp = input ?? ({} as z.input<InstanceType<typeof LocaltaskAttachNoteAction>['_input']>);
|
|
931
921
|
const path = `/api/localtasks/attach-note`;
|
|
932
922
|
const body = { "id": inp["id"], "cwd": inp["cwd"], "key": inp["key"], "attachment": inp["attachment"], "note": inp["note"] };
|
|
@@ -1012,7 +1002,7 @@ export function createApiClient(transport: Transport): ApiClient {
|
|
|
1012
1002
|
async config(input?: z.input<InstanceType<typeof LocaltaskConfigAction>['_input']>) {
|
|
1013
1003
|
const inp = input ?? ({} as z.input<InstanceType<typeof LocaltaskConfigAction>['_input']>);
|
|
1014
1004
|
const path = `/api/localtasks/setting`;
|
|
1015
|
-
const body = { "timeout": inp["timeout"], "
|
|
1005
|
+
const body = { "timeout": inp["timeout"], "append-mode": inp["append-mode"], "appendMode": inp["appendMode"] };
|
|
1016
1006
|
return (await transport.request("PATCH", path, body)) as Awaited<ReturnType<InstanceType<typeof LocaltaskConfigAction>['run']>>;
|
|
1017
1007
|
},
|
|
1018
1008
|
// action: localtask.detach
|
|
@@ -1089,7 +1079,7 @@ export function createApiClient(transport: Transport): ApiClient {
|
|
|
1089
1079
|
async localtaskPrune(input?: z.input<InstanceType<typeof LocaltaskPruneAction>['_input']>) {
|
|
1090
1080
|
const inp = input ?? ({} as z.input<InstanceType<typeof LocaltaskPruneAction>['_input']>);
|
|
1091
1081
|
const path = `/api/localtasks/prune`;
|
|
1092
|
-
const body = { "all-finished": inp["all-finished"], "dry-run": inp["dry-run"] };
|
|
1082
|
+
const body = { "all-finished": inp["all-finished"], "dry-run": inp["dry-run"], "missing-dir": inp["missing-dir"] };
|
|
1093
1083
|
return (await transport.request("POST", path, body)) as Awaited<ReturnType<InstanceType<typeof LocaltaskPruneAction>['run']>>;
|
|
1094
1084
|
},
|
|
1095
1085
|
// action: localtask.remove
|
|
@@ -1275,6 +1265,13 @@ export function createApiClient(transport: Transport): ApiClient {
|
|
|
1275
1265
|
const path = `/api/templates/${encodeURIComponent(String(inp["id"]))}`;
|
|
1276
1266
|
return (await transport.request("DELETE", path, undefined)) as Awaited<ReturnType<InstanceType<typeof TemplatesRemoveAction>['run']>>;
|
|
1277
1267
|
},
|
|
1268
|
+
// action: templates.reorder
|
|
1269
|
+
async templatesReorder(input: z.input<InstanceType<typeof TemplatesReorderAction>['_input']>) {
|
|
1270
|
+
const inp = input ?? ({} as z.input<InstanceType<typeof TemplatesReorderAction>['_input']>);
|
|
1271
|
+
const path = `/api/templates/reorder`;
|
|
1272
|
+
const body = { "ids": inp["ids"] };
|
|
1273
|
+
return (await transport.request("PATCH", path, body)) as Awaited<ReturnType<InstanceType<typeof TemplatesReorderAction>['run']>>;
|
|
1274
|
+
},
|
|
1278
1275
|
// action: templates.update
|
|
1279
1276
|
async templatesUpdate(input: z.input<InstanceType<typeof TemplatesUpdateAction>['_input']>) {
|
|
1280
1277
|
const inp = input ?? ({} as z.input<InstanceType<typeof TemplatesUpdateAction>['_input']>);
|
|
@@ -1347,13 +1344,6 @@ export function createApiClient(transport: Transport): ApiClient {
|
|
|
1347
1344
|
const path = `/api/bundled`;
|
|
1348
1345
|
return (await transport.request("GET", path)) as Awaited<ReturnType<InstanceType<typeof BundledListAction>['run']>>;
|
|
1349
1346
|
},
|
|
1350
|
-
// action: prompt.order
|
|
1351
|
-
async order(input: z.input<InstanceType<typeof PromptOrderAction>['_input']>) {
|
|
1352
|
-
const inp = input ?? ({} as z.input<InstanceType<typeof PromptOrderAction>['_input']>);
|
|
1353
|
-
const path = `/api/prompt/order`;
|
|
1354
|
-
const body = { "order": inp["order"] };
|
|
1355
|
-
return (await transport.request("PUT", path, body)) as Awaited<ReturnType<InstanceType<typeof PromptOrderAction>['run']>>;
|
|
1356
|
-
},
|
|
1357
1347
|
// action: prompt.registry
|
|
1358
1348
|
async registry() {
|
|
1359
1349
|
const path = `/api/prompt/registry`;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// 简介 / 文档右侧滚动目录:竖轨 + 展开名单 + 补充文档。
|
|
2
|
-
// links 形状统一:[{ docId, label,
|
|
2
|
+
// links 形状统一:[{ docId, label, main? }]
|
|
3
3
|
//
|
|
4
4
|
// 轨可拖动(2026-11-12 反馈「无法拖动」):汉堡钮 = 拖把,与任务页 ack 轨
|
|
5
5
|
// 共用 components/use-rail-drag.ts 的同一套语义(>4px 算拖、双击回默认位、
|
|
@@ -172,7 +172,7 @@ export default function IntroRail({
|
|
|
172
172
|
key={d.docId}
|
|
173
173
|
type="button"
|
|
174
174
|
className={'doc-rail-row' + (d.docId === activeDocId ? ' on' : '')}
|
|
175
|
-
title={d.
|
|
175
|
+
title={d.label}
|
|
176
176
|
disabled={!onOpenDoc}
|
|
177
177
|
onClick={() => onOpenDoc && onOpenDoc(d.docId)}
|
|
178
178
|
>
|
|
@@ -14,7 +14,6 @@ export type IntroKind = 'repo' | 'board';
|
|
|
14
14
|
export interface IntroLink {
|
|
15
15
|
docId: string;
|
|
16
16
|
label: string;
|
|
17
|
-
note?: string;
|
|
18
17
|
main?: boolean;
|
|
19
18
|
}
|
|
20
19
|
|
|
@@ -27,14 +26,12 @@ export interface IntroDocEntry {
|
|
|
27
26
|
docId?: string;
|
|
28
27
|
title?: string;
|
|
29
28
|
desc?: string;
|
|
30
|
-
note?: string;
|
|
31
29
|
[k: string]: any;
|
|
32
30
|
}
|
|
33
31
|
|
|
34
32
|
/** 仓库所属组的一行(owner.boards[]:组内描述文档的定位来源)。 */
|
|
35
33
|
export interface IntroScopedBoard {
|
|
36
34
|
name?: string;
|
|
37
|
-
note?: string;
|
|
38
35
|
/** 组内描述文档(ref:<refId>) */
|
|
39
36
|
noteDocId?: string;
|
|
40
37
|
[k: string]: any;
|
|
@@ -127,11 +124,11 @@ export function useIntro({ kind, owner, model }: UseIntroArgs): IntroApi {
|
|
|
127
124
|
const mid = linkDocId(main);
|
|
128
125
|
setMainDocId(mid || docRef);
|
|
129
126
|
if (mid && main) {
|
|
130
|
-
out.push({ docId: mid, label: labelOf(main, '主篇'),
|
|
127
|
+
out.push({ docId: mid, label: labelOf(main, '主篇'), main: true });
|
|
131
128
|
}
|
|
132
129
|
for (const l of extras) {
|
|
133
130
|
const id = linkDocId(l);
|
|
134
|
-
if (id) out.push({ docId: id, label: labelOf(l, '补充'),
|
|
131
|
+
if (id) out.push({ docId: id, label: labelOf(l, '补充'), main: false });
|
|
135
132
|
}
|
|
136
133
|
setLinks(out);
|
|
137
134
|
};
|
|
@@ -17,8 +17,6 @@ export interface BindTagItem {
|
|
|
17
17
|
kind: 'repo' | 'group';
|
|
18
18
|
/** position=0 的主篇(不可解绑) */
|
|
19
19
|
main?: boolean;
|
|
20
|
-
/** 附加项的备注(渲染成「附加 · note」) */
|
|
21
|
-
note?: string;
|
|
22
20
|
/** 完整名字(悬停) */
|
|
23
21
|
title?: string;
|
|
24
22
|
/** 有则渲染 ×(解绑不删文档) */
|
|
@@ -26,7 +24,7 @@ export interface BindTagItem {
|
|
|
26
24
|
}
|
|
27
25
|
|
|
28
26
|
export function BindTag({ t }: { t: BindTagItem }) {
|
|
29
|
-
const role = t.main ? '主篇' :
|
|
27
|
+
const role = t.main ? '主篇' : '附加';
|
|
30
28
|
return (
|
|
31
29
|
<span
|
|
32
30
|
className={'nb-tag nb-' + t.kind + (t.main ? ' nb-main' : '')}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// 列表搜索框(#149 全局统一形态):受控输入 + 命中计数 + 清空按钮。
|
|
2
|
+
//
|
|
3
|
+
// 抽出来是为了让「文档列表 / 归属 / 加绑宿主 / 参考仓库勾选」等所有列表
|
|
4
|
+
// 长得一样、行为一样;匹配规则由 modules/list-filter.ts 的纯函数负责,
|
|
5
|
+
// 这里只管交互形态。图标走 components/icons 的搜索图标(内联 SVG / currentColor)。
|
|
6
|
+
import { Icon } from './icons.jsx';
|
|
7
|
+
|
|
8
|
+
export function ListSearch({ value, onChange, placeholder, count, title, className }: {
|
|
9
|
+
value: string;
|
|
10
|
+
onChange: (v: string) => void;
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
/** 有关键词时显示的命中数 */
|
|
13
|
+
count?: number;
|
|
14
|
+
title?: string;
|
|
15
|
+
className?: string;
|
|
16
|
+
}) {
|
|
17
|
+
const label = title || '搜索';
|
|
18
|
+
return (
|
|
19
|
+
<label className={'nx-list-search' + (className ? ' ' + className : '')} title={title || '输入关键词过滤列表'}>
|
|
20
|
+
<Icon name="search" size={13} />
|
|
21
|
+
<input
|
|
22
|
+
value={value}
|
|
23
|
+
placeholder={placeholder || '搜索…'}
|
|
24
|
+
aria-label={label}
|
|
25
|
+
onChange={(e) => onChange(e.target.value)}
|
|
26
|
+
/>
|
|
27
|
+
{value && count !== undefined ? <span className="nx-list-search-n">{count}</span> : null}
|
|
28
|
+
{value ? (
|
|
29
|
+
<button type="button" className="nx-list-search-x" title="清空搜索" aria-label="清空搜索" onClick={() => onChange('')}>
|
|
30
|
+
×
|
|
31
|
+
</button>
|
|
32
|
+
) : null}
|
|
33
|
+
</label>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export default ListSearch;
|
|
@@ -157,7 +157,7 @@ function renderItem(a: NormalizedAttachment, { onRemove, onPreview, onPreviewMd,
|
|
|
157
157
|
|
|
158
158
|
{a.kind === 'ref' ? (
|
|
159
159
|
<span className="att-item-acts">
|
|
160
|
-
<button type="button" className="att-act" title="改这条绑定的一行说明(交付清单会透出)" onClick={() => onEditNote
|
|
160
|
+
{onEditNote ? <button type="button" className="att-act" title="改这条绑定的一行说明(交付清单会透出)" onClick={() => onEditNote(a)}>✎ 说明</button> : null}
|
|
161
161
|
<button type="button" className="att-act" title="换成另一篇文档(替换这条绑定)" onClick={() => onReplace?.(a)}>⇄ 更换</button>
|
|
162
162
|
</span>
|
|
163
163
|
) : null}
|
|
@@ -267,27 +267,22 @@ export default function AttachArea({
|
|
|
267
267
|
}
|
|
268
268
|
};
|
|
269
269
|
|
|
270
|
-
//
|
|
270
|
+
// 改一条任务绑定的说明(仅任务侧;文档侧 note 已随 v13 删除)
|
|
271
271
|
const editNote = async (item: NormalizedAttachment | null) => {
|
|
272
|
-
if (!item) return;
|
|
272
|
+
if (!item || host === 'doc') return;
|
|
273
273
|
try {
|
|
274
|
-
// useDialog 仍是 JS 模块:dialog 返回 Promise<unknown>,约定是 string(单输入)或 { value
|
|
274
|
+
// useDialog 仍是 JS 模块:dialog 返回 Promise<unknown>,约定是 string(单输入)或 { value }
|
|
275
275
|
const res = await dialog({
|
|
276
276
|
title: `说明 · ${item.name}`,
|
|
277
277
|
input: true,
|
|
278
278
|
placeholder: '这一行里大概是什么(交付清单会透出给 agent)',
|
|
279
279
|
value: item.note || '',
|
|
280
280
|
okText: '保存说明',
|
|
281
|
-
}) as string | { value?: string
|
|
281
|
+
}) as string | { value?: string } | null;
|
|
282
282
|
if (res === null) return;
|
|
283
|
-
const note = typeof res === 'string' ? res : (res &&
|
|
284
|
-
const
|
|
285
|
-
|
|
286
|
-
: '/api/localtasks/attach-note';
|
|
287
|
-
const body = host === 'doc'
|
|
288
|
-
? { attachment: item.id, note }
|
|
289
|
-
: { id: Number(hostId), ...(hostKey ? { key: hostKey } : hostCwd ? { cwd: hostCwd } : {}), attachment: item.id, note };
|
|
290
|
-
await api(path, { method: 'PATCH', body });
|
|
283
|
+
const note = typeof res === 'string' ? res : (res && res.value) || '';
|
|
284
|
+
const body = { id: Number(hostId), ...(hostKey ? { key: hostKey } : hostCwd ? { cwd: hostCwd } : {}), attachment: item.id, note };
|
|
285
|
+
await api('/api/localtasks/attach-note', { method: 'PATCH', body });
|
|
291
286
|
toast(note ? `已保存说明:${note}` : '已清空说明');
|
|
292
287
|
await load();
|
|
293
288
|
onChanged?.();
|
|
@@ -401,14 +396,14 @@ export default function AttachArea({
|
|
|
401
396
|
{inline.length ? (
|
|
402
397
|
<div className="att-section">
|
|
403
398
|
<div className="att-section-head">{AREA_LABEL.inline}<span className="att-section-hint">正文里的引用,删正文行会跟着消失</span></div>
|
|
404
|
-
{inline.map((a) => renderItem(a, { onRemove: setRemoveOf, onPreview: setPreview, onPreviewMd: openMd, onOpenTask, onOpenDoc, onEditNote: editNote, onReplace: startReplace, key: a.id }))}
|
|
399
|
+
{inline.map((a) => renderItem(a, { onRemove: setRemoveOf, onPreview: setPreview, onPreviewMd: openMd, onOpenTask, onOpenDoc, onEditNote: host === 'task' ? editNote : undefined, onReplace: startReplace, key: a.id }))}
|
|
405
400
|
</div>
|
|
406
401
|
) : null}
|
|
407
402
|
|
|
408
403
|
{area.length ? (
|
|
409
404
|
<div className="att-section">
|
|
410
405
|
<div className="att-section-head">{AREA_LABEL.area}<span className="att-section-hint">不依赖正文,删正文行也不会丢</span></div>
|
|
411
|
-
{area.map((a) => renderItem(a, { onRemove: setRemoveOf, onPreview: setPreview, onPreviewMd: openMd, onOpenTask, onOpenDoc, onEditNote: editNote, onReplace: startReplace, key: a.id }))}
|
|
406
|
+
{area.map((a) => renderItem(a, { onRemove: setRemoveOf, onPreview: setPreview, onPreviewMd: openMd, onOpenTask, onOpenDoc, onEditNote: host === 'task' ? editNote : undefined, onReplace: startReplace, key: a.id }))}
|
|
412
407
|
</div>
|
|
413
408
|
) : null}
|
|
414
409
|
|
|
@@ -33,9 +33,7 @@ interface LiveBlockProps {
|
|
|
33
33
|
rail?: ReactNode;
|
|
34
34
|
/** 拖拽落点指示:插到本块之前还是之后(null = 不是落点) */
|
|
35
35
|
dropEdge?: 'before' | 'after' | null;
|
|
36
|
-
/**
|
|
37
|
-
locked?: boolean;
|
|
38
|
-
/** 模板插槽块:可编辑,但加视觉标记(这里是要填内容的地方)。 */
|
|
36
|
+
/** 模板插槽块:可编辑,但加视觉标记(这里是要填内容的地方)。仅模板编辑页会传。 */
|
|
39
37
|
slot?: boolean;
|
|
40
38
|
}
|
|
41
39
|
|
|
@@ -57,7 +55,6 @@ export default function LiveBlock({
|
|
|
57
55
|
pendingFormatRef,
|
|
58
56
|
rail = null,
|
|
59
57
|
dropEdge = null,
|
|
60
|
-
locked = false,
|
|
61
58
|
slot = false,
|
|
62
59
|
}: LiveBlockProps) {
|
|
63
60
|
const taRef = useRef<HTMLTextAreaElement | null>(null);
|
|
@@ -106,7 +103,7 @@ export default function LiveBlock({
|
|
|
106
103
|
// 拖拽落点指示(拖拽排序时由父组件的列表级 dragover 算出)
|
|
107
104
|
const dropCls = dropEdge ? ` is-drop-${dropEdge}` : '';
|
|
108
105
|
|
|
109
|
-
if (focused
|
|
106
|
+
if (focused) {
|
|
110
107
|
return (
|
|
111
108
|
<div className={`mdw-lp-block is-edit kind-${kind}${dropCls}`} data-i={index}>
|
|
112
109
|
{rail}
|
|
@@ -148,27 +145,21 @@ export default function LiveBlock({
|
|
|
148
145
|
|
|
149
146
|
return (
|
|
150
147
|
<div
|
|
151
|
-
className={`mdw-lp-block is-view kind-${kind}${isEmptyBlock(text) ? ' is-empty' : ''}${hit ? ' is-hit' : ''}${dropCls}${
|
|
148
|
+
className={`mdw-lp-block is-view kind-${kind}${isEmptyBlock(text) ? ' is-empty' : ''}${hit ? ' is-hit' : ''}${dropCls}${slot ? ' is-slot' : ''}`}
|
|
152
149
|
data-i={index}
|
|
153
150
|
role="button"
|
|
154
|
-
tabIndex={
|
|
155
|
-
aria-readonly={locked || undefined}
|
|
156
|
-
title={locked ? '模板骨架:只读(要改这段,请去任务模板里改)' : undefined}
|
|
151
|
+
tabIndex={0}
|
|
157
152
|
onClick={(e) => {
|
|
158
|
-
// 模板骨架块不可进编辑态:点击不再冒泡到「聚焦」逻辑(勾选框也不响应)
|
|
159
|
-
if (locked) return;
|
|
160
153
|
onViewClick(e, index);
|
|
161
154
|
}}
|
|
162
155
|
onKeyDown={(e) => {
|
|
163
|
-
if (locked) return;
|
|
164
156
|
if (e.key === 'Enter' || e.key === ' ') {
|
|
165
157
|
e.preventDefault();
|
|
166
158
|
onFocus(index);
|
|
167
159
|
}
|
|
168
160
|
}}
|
|
169
161
|
>
|
|
170
|
-
{
|
|
171
|
-
{locked && <span className="mdw-lp-lock" aria-hidden>模板</span>}
|
|
162
|
+
{rail}
|
|
172
163
|
{slot && <span className="mdw-lp-slot" aria-hidden>插槽</span>}
|
|
173
164
|
{html ? (
|
|
174
165
|
<div className="mdw-lp-view" dangerouslySetInnerHTML={{ __html: html }} />
|
|
@@ -21,7 +21,6 @@ import {
|
|
|
21
21
|
useEffect,
|
|
22
22
|
useImperativeHandle,
|
|
23
23
|
useLayoutEffect,
|
|
24
|
-
useMemo,
|
|
25
24
|
useRef,
|
|
26
25
|
} from 'react';
|
|
27
26
|
import type {
|
|
@@ -58,9 +57,8 @@ import {
|
|
|
58
57
|
toggleNthTodo,
|
|
59
58
|
} from '../../modules/md/md-edit-ops.js';
|
|
60
59
|
import { isFrontmatterBlock, normalizeBlockText } from '../../modules/md/md-parse.js';
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
import { useApp } from '../../app-context.jsx';
|
|
60
|
+
// #151:槽位/模板骨架只读已从任务编辑器移除——模板生成的正文是纯文本,
|
|
61
|
+
// 编辑页不再派生任何「模板/插槽」概念(tplSlotBlocks 仅供模板**编辑**页用)。
|
|
64
62
|
import type { Attachment } from './attach-common.js';
|
|
65
63
|
|
|
66
64
|
export { MdPanes, ModeSeg } from './md-panes-root.jsx';
|
|
@@ -183,19 +181,6 @@ function LivePreview({
|
|
|
183
181
|
// 拖拽排序:落点判定在列表级(一个 dragover 管整张列表),把手在块侧栏里
|
|
184
182
|
const drag = useBlockDrag(moveBlock);
|
|
185
183
|
|
|
186
|
-
// 模板生成的任务(正文 frontmatter 的 `template: <id>`):骨架块只读、插槽块可编辑。
|
|
187
|
-
// 纯派生——锁定范围由「模板当下的正文 + 这条任务的正文」算出来,模板改了自动跟随;
|
|
188
|
-
// 不是模板任务(没有该键)就完全不锁,编辑器行为与以前一致。
|
|
189
|
-
const app = useApp();
|
|
190
|
-
const locks = useMemo(() => {
|
|
191
|
-
const id = templateIdOf(body);
|
|
192
|
-
if (!id) return null;
|
|
193
|
-
const tplBody = (app.tpl?.templates || []).find((t) => t.id === id)?.body || '';
|
|
194
|
-
if (!String(tplBody).trim()) return null;
|
|
195
|
-
const r = computeTemplateLocks(body, tplBody);
|
|
196
|
-
return r.locked.size || r.slots.size ? r : null;
|
|
197
|
-
}, [body, app.tpl?.templates]);
|
|
198
|
-
|
|
199
184
|
// ── 跨块选区(#124):块粒度的「统一删除」────────────────────────────
|
|
200
185
|
// 视图块是渲染好的 HTML,选区字符偏移无法精确映射回各块源码(markdown
|
|
201
186
|
// 标记在渲染时被剥掉)——沿用本编辑器一贯的保守口径(#98 同源):**升到
|
|
@@ -429,8 +414,7 @@ function LivePreview({
|
|
|
429
414
|
text={b}
|
|
430
415
|
focused={focus === i}
|
|
431
416
|
hit={hitBlock === i}
|
|
432
|
-
|
|
433
|
-
slot={!!(locks?.slots.has(i) || tplSlotBlocks?.has(i))}
|
|
417
|
+
slot={!!tplSlotBlocks?.has(i)}
|
|
434
418
|
attachments={attachments}
|
|
435
419
|
pendingSelRef={pendingSelRef}
|
|
436
420
|
pendingFormatRef={pendingFormatRef}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// 列表关键词过滤(#149 全局统一口径,纯函数)。
|
|
2
|
+
//
|
|
3
|
+
// 全站所有「列表 + 搜索框」共用这一份匹配规则:空格分词 AND、大小写不敏感、
|
|
4
|
+
// 多字段命中任一即可。与 modules/board/task-search.ts 的口径一致,但这里的
|
|
5
|
+
// 字段由调用方声明(标题 / 副标题 / key / 归属…),不绑死某种行类型。
|
|
6
|
+
// 不碰网络、不碰 React,可直接单测(tests/unit/list-filter.test.mjs)。
|
|
7
|
+
|
|
8
|
+
/** 行 → 可搜索字段。空串 / null / undefined 自动跳过。 */
|
|
9
|
+
export type SearchFields<T> = (row: T) => Array<string | number | null | undefined>;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* 按关键词过滤列表,保持原序。
|
|
13
|
+
* - q 为空(含纯空白)→ 原样返回;
|
|
14
|
+
* - 空格分词后每个词都要命中(AND),命中面是 fields(row) 的任意一项(OR);
|
|
15
|
+
* - 不做正则、不做通配符,避免用户输入 `(` 之类直接抛错。
|
|
16
|
+
*/
|
|
17
|
+
export function filterByKeyword<T>(
|
|
18
|
+
rows: readonly T[] | null | undefined,
|
|
19
|
+
q: unknown,
|
|
20
|
+
fields: SearchFields<T>
|
|
21
|
+
): T[] {
|
|
22
|
+
const list = Array.isArray(rows) ? Array.from(rows) : [];
|
|
23
|
+
const raw = String(q ?? '').trim().toLowerCase();
|
|
24
|
+
if (!raw) return list;
|
|
25
|
+
const tokens = raw.split(/\s+/).filter(Boolean);
|
|
26
|
+
return list.filter((row) => {
|
|
27
|
+
const hay = fields(row)
|
|
28
|
+
.map((v) => String(v ?? '').toLowerCase())
|
|
29
|
+
.filter(Boolean);
|
|
30
|
+
return tokens.every((t) => hay.some((h) => h.includes(t)));
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** 关键词是否非空(给 UI 决定要不要显示清空按钮 / 命中计数)。 */
|
|
35
|
+
export function hasQuery(q: unknown): boolean {
|
|
36
|
+
return String(q ?? '').trim().length > 0;
|
|
37
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// 参数填写页的一次性会话(#151):从「新建任务」下拉点带槽位的模板时建立,
|
|
2
|
+
// 路由只带 sessionId(#/templates/fill/<id>),上下文放这里,避免给 AppRoute 加
|
|
3
|
+
// 一堆一次性的 query 键。会话是内存态——这是中间页,刷新即丢是可接受的。
|
|
4
|
+
export interface FillSession {
|
|
5
|
+
templateId: string;
|
|
6
|
+
/** 可见域三把钥匙(用于主题级模板管理返回等,当前主要供展示) */
|
|
7
|
+
topic?: string;
|
|
8
|
+
group?: string;
|
|
9
|
+
repo?: string;
|
|
10
|
+
/** 新建落点:dirKey 开目录任务页;groupId 开组锚定页 */
|
|
11
|
+
dirKey?: string;
|
|
12
|
+
groupId?: string;
|
|
13
|
+
/** 任务正文 frontmatter 的归属(组任务路由用) */
|
|
14
|
+
board?: string;
|
|
15
|
+
project?: string;
|
|
16
|
+
/** 填完是否直接提交落库(false = 进编辑页保留草稿) */
|
|
17
|
+
submit?: boolean;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
let seq = 0;
|
|
21
|
+
const sessions = new Map<string, FillSession>();
|
|
22
|
+
|
|
23
|
+
export function putFillSession(session: FillSession): string {
|
|
24
|
+
seq += 1;
|
|
25
|
+
const id = `fill_${Date.now().toString(36)}_${seq}`;
|
|
26
|
+
sessions.set(id, { ...session });
|
|
27
|
+
return id;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function getFillSession(id: unknown): FillSession | undefined {
|
|
31
|
+
return sessions.get(String(id || ''));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function dropFillSession(id: unknown): void {
|
|
35
|
+
sessions.delete(String(id || ''));
|
|
36
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// 主题级模板管理页的一次性会话(#151):「管理模板…」从某个 topic 的下拉进入,
|
|
2
|
+
// 只显示/管理这个 topic 下可见的模板。路由只带 sessionId,避免给 AppRoute 加
|
|
3
|
+
// 一次性的 group/repo query 键。
|
|
4
|
+
export interface ManageSession {
|
|
5
|
+
topic?: string;
|
|
6
|
+
group?: string;
|
|
7
|
+
repo?: string;
|
|
8
|
+
/** 展示用标题前缀(目录名 / 组名) */
|
|
9
|
+
label?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
let seq = 0;
|
|
13
|
+
const sessions = new Map<string, ManageSession>();
|
|
14
|
+
|
|
15
|
+
export function putManageSession(session: ManageSession): string {
|
|
16
|
+
seq += 1;
|
|
17
|
+
const id = `mng_${Date.now().toString(36)}_${seq}`;
|
|
18
|
+
sessions.set(id, { ...session });
|
|
19
|
+
return id;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function getManageSession(id: unknown): ManageSession | undefined {
|
|
23
|
+
return sessions.get(String(id || ''));
|
|
24
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// 「按模板新建任务」的统一入口(#151):模板正文里有 {{槽位}} 时先去参数填写
|
|
2
|
+
// 中间页,否则直接走原来的纯文本草稿路径。目录页与组页共用这一层,避免两版
|
|
3
|
+
// 下拉又漂移(用户明确要求「以 repo 那个为准」)。
|
|
4
|
+
import { putFillSession, type FillSession } from './fill-session.js';
|
|
5
|
+
import { templateSlots } from '../prompts/template-preview.js';
|
|
6
|
+
|
|
7
|
+
interface NavApp {
|
|
8
|
+
onNavigate?: (hash: string) => void;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/** 含有槽位 → 已转向参数页并返回 true;无槽位 → 调用方继续原来的新建路径。 */
|
|
12
|
+
export function startFillIfSlotted(
|
|
13
|
+
tpl: { id?: string; body?: unknown } | null | undefined,
|
|
14
|
+
ctx: Omit<FillSession, 'templateId'>,
|
|
15
|
+
app: NavApp,
|
|
16
|
+
): boolean {
|
|
17
|
+
const slots = templateSlots(tpl?.body);
|
|
18
|
+
if (!slots.length || !tpl?.id) return false;
|
|
19
|
+
const sessionId = putFillSession({ ...ctx, templateId: String(tpl.id) });
|
|
20
|
+
app.onNavigate?.(`#/templates/fill/${sessionId}`);
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
@@ -342,21 +342,14 @@
|
|
|
342
342
|
.mdw-block-rail{left:auto;right:0;top:-10px}
|
|
343
343
|
}
|
|
344
344
|
|
|
345
|
-
/* ───
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
徽标默认不显示,悬停才出——常驻角标会让整页像调试视图。 */
|
|
349
|
-
.mdw-lp-block.is-locked{
|
|
350
|
-
padding-left:10px;
|
|
351
|
-
cursor:default;
|
|
352
|
-
box-shadow:inset 3px 0 0 var(--line-strong,#C9C6BE);
|
|
353
|
-
background:linear-gradient(90deg, rgba(22,24,28,.05), transparent 40%);
|
|
354
|
-
}
|
|
345
|
+
/* ─── 模板编辑页的插槽标记 ──────────────────────────────────────────────
|
|
346
|
+
#151 起任务编辑器不再有「骨架只读 / 插槽」概念——模板只在**生成任务正文之前**
|
|
347
|
+
存在,生成后就是纯文本。这里只剩模板编辑页给自己用的插槽左线 + 角标。 */
|
|
355
348
|
.mdw-lp-block.is-slot{
|
|
356
349
|
padding-left:10px;
|
|
357
350
|
box-shadow:inset 2px 0 0 var(--mdw-accent-line,#B7D4C8);
|
|
358
351
|
}
|
|
359
|
-
.mdw-lp-
|
|
352
|
+
.mdw-lp-slot{
|
|
360
353
|
position:absolute;right:0;top:0;
|
|
361
354
|
font:500 9.5px/1.6 system-ui,-apple-system,sans-serif;
|
|
362
355
|
padding:0 6px;border-radius:999px;
|
|
@@ -364,4 +357,4 @@
|
|
|
364
357
|
opacity:0;transition:opacity .12s;pointer-events:none;user-select:none;
|
|
365
358
|
}
|
|
366
359
|
.mdw-lp-slot{color:var(--mdw-accent,#2F6F5E);border-color:var(--mdw-accent-line,#B7D4C8);background:var(--mdw-accent-soft,#E8F2EE)}
|
|
367
|
-
.mdw-lp-block:hover .mdw-lp-
|
|
360
|
+
.mdw-lp-block:hover .mdw-lp-slot{opacity:1}
|