nx-kv 0.48.1 → 0.48.2
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/package.json +1 -1
- package/src/modules/auth/actions/auth-login.ts +11 -4
- package/src/modules/auth/actions/auth-logout.ts +9 -4
- package/src/modules/auth/actions/auth-me.ts +9 -4
- package/src/modules/auth/actions/auth-status.ts +9 -4
- package/src/modules/bundled/actions/bundled-get.ts +12 -4
- package/src/modules/bundled/actions/bundled-groups.ts +9 -4
- package/src/modules/bundled/actions/bundled-install.ts +13 -4
- package/src/modules/bundled/actions/bundled-list.ts +9 -4
- package/src/modules/db/actions/db-backup.ts +10 -4
- package/src/modules/db/actions/db-migrate.ts +10 -4
- package/src/modules/db/actions/db-status.ts +9 -4
- package/src/modules/db/actions/db-verify.ts +9 -4
- package/src/modules/docs/actions/doc-add.ts +12 -4
- package/src/modules/docs/actions/doc-attach-note.ts +11 -4
- package/src/modules/docs/actions/doc-attach.ts +18 -4
- package/src/modules/docs/actions/doc-attachments.ts +9 -4
- package/src/modules/docs/actions/doc-detach.ts +11 -4
- package/src/modules/docs/actions/doc-get.ts +9 -4
- package/src/modules/docs/actions/doc-list.ts +9 -4
- package/src/modules/docs/actions/doc-remove.ts +9 -4
- package/src/modules/docs/actions/doc-update.ts +12 -4
- package/src/modules/docs/actions/docs-bind.ts +13 -4
- package/src/modules/docs/actions/docs-index.ts +9 -4
- package/src/modules/docs/actions/docs-link.ts +14 -4
- package/src/modules/docs/actions/docs-notebind.ts +13 -4
- package/src/modules/docs/actions/docs-seed.ts +9 -4
- package/src/modules/file/actions/file-content.ts +10 -4
- package/src/modules/file/actions/file-get.ts +10 -4
- package/src/modules/file/actions/file-list.ts +11 -4
- package/src/modules/file/actions/file-orphans.ts +9 -4
- package/src/modules/file/actions/file-prune.ts +10 -4
- package/src/modules/file/actions/file-remove.ts +10 -4
- package/src/modules/file/actions/file-sync.ts +13 -4
- package/src/modules/file/actions/file-upload.ts +15 -4
- package/src/modules/localtask/actions/localtask-add.ts +24 -4
- package/src/modules/localtask/actions/localtask-attach-note.ts +13 -4
- package/src/modules/localtask/actions/localtask-attach.ts +22 -4
- package/src/modules/localtask/actions/localtask-attachments.ts +11 -4
- package/src/modules/localtask/actions/localtask-cancel.ts +10 -4
- package/src/modules/localtask/actions/localtask-cancelMany.ts +11 -4
- package/src/modules/localtask/actions/localtask-chain.ts +11 -4
- package/src/modules/localtask/actions/localtask-claim.ts +12 -4
- package/src/modules/localtask/actions/localtask-clone.ts +11 -4
- package/src/modules/localtask/actions/localtask-closeMany.ts +13 -4
- package/src/modules/localtask/actions/localtask-config.ts +19 -4
- package/src/modules/localtask/actions/localtask-detach.ts +13 -4
- package/src/modules/localtask/actions/localtask-done.ts +12 -4
- package/src/modules/localtask/actions/localtask-events.ts +12 -4
- package/src/modules/localtask/actions/localtask-fork.ts +11 -4
- package/src/modules/localtask/actions/localtask-get.ts +11 -4
- package/src/modules/localtask/actions/localtask-importRemote.ts +13 -4
- package/src/modules/localtask/actions/localtask-list.ts +9 -4
- package/src/modules/localtask/actions/localtask-presence.ts +9 -4
- package/src/modules/localtask/actions/localtask-preview.ts +13 -4
- package/src/modules/localtask/actions/localtask-prune.ts +10 -4
- package/src/modules/localtask/actions/localtask-remove.ts +12 -4
- package/src/modules/localtask/actions/localtask-removeMany.ts +12 -4
- package/src/modules/localtask/actions/localtask-reopen.ts +17 -4
- package/src/modules/localtask/actions/localtask-reorder.ts +15 -4
- package/src/modules/localtask/actions/localtask-task-restore.ts +11 -4
- package/src/modules/localtask/actions/localtask-timegoalLog.ts +11 -4
- package/src/modules/localtask/actions/localtask-topic-add.ts +10 -4
- package/src/modules/localtask/actions/localtask-topic-remove.ts +11 -4
- package/src/modules/localtask/actions/localtask-topic-removeMany.ts +12 -4
- package/src/modules/localtask/actions/localtask-update.ts +22 -4
- package/src/modules/localtask/actions/localtask-wait.ts +13 -4
- package/src/modules/localtask/actions/task-move.ts +21 -4
- package/src/modules/repos/actions/board-add.ts +10 -4
- package/src/modules/repos/actions/board-assign.ts +12 -4
- package/src/modules/repos/actions/board-export.ts +9 -4
- package/src/modules/repos/actions/board-get.ts +9 -4
- package/src/modules/repos/actions/board-import.ts +9 -4
- package/src/modules/repos/actions/board-list.ts +9 -4
- package/src/modules/repos/actions/board-note.ts +11 -4
- package/src/modules/repos/actions/board-prefix.ts +10 -4
- package/src/modules/repos/actions/board-prune.ts +11 -4
- package/src/modules/repos/actions/board-rekey.ts +11 -4
- package/src/modules/repos/actions/board-remove.ts +9 -4
- package/src/modules/repos/actions/board-update.ts +11 -4
- package/src/modules/repos/actions/repo-add.ts +17 -4
- package/src/modules/repos/actions/repo-bind-topics.ts +10 -4
- package/src/modules/repos/actions/repo-bind.ts +12 -4
- package/src/modules/repos/actions/repo-clone.ts +14 -4
- package/src/modules/repos/actions/repo-detect.ts +9 -4
- package/src/modules/repos/actions/repo-doc-add.ts +15 -4
- package/src/modules/repos/actions/repo-doc-list.ts +9 -4
- package/src/modules/repos/actions/repo-doc-remove.ts +10 -4
- package/src/modules/repos/actions/repo-export.ts +12 -4
- package/src/modules/repos/actions/repo-get.ts +9 -4
- package/src/modules/repos/actions/repo-import-diff.ts +10 -4
- package/src/modules/repos/actions/repo-import.ts +14 -4
- package/src/modules/repos/actions/repo-key-migrate.ts +9 -4
- package/src/modules/repos/actions/repo-key-refresh.ts +11 -4
- package/src/modules/repos/actions/repo-key-set.ts +11 -4
- package/src/modules/repos/actions/repo-knowledge.ts +10 -4
- package/src/modules/repos/actions/repo-list.ts +9 -4
- package/src/modules/repos/actions/repo-open.ts +9 -4
- package/src/modules/repos/actions/repo-ref-add.ts +13 -4
- package/src/modules/repos/actions/repo-ref-backfill.ts +10 -4
- package/src/modules/repos/actions/repo-ref-check.ts +9 -4
- package/src/modules/repos/actions/repo-ref-clone.ts +16 -4
- package/src/modules/repos/actions/repo-ref-note.ts +12 -4
- package/src/modules/repos/actions/repo-ref-of.ts +9 -4
- package/src/modules/repos/actions/repo-ref-sync.ts +10 -4
- package/src/modules/repos/actions/repo-remote-check.ts +10 -4
- package/src/modules/repos/actions/repo-remote-list.ts +9 -4
- package/src/modules/repos/actions/repo-remote-pick.ts +10 -4
- package/src/modules/repos/actions/repo-remote.ts +11 -4
- package/src/modules/repos/actions/repo-remove.ts +9 -4
- package/src/modules/repos/actions/repo-scan.ts +11 -4
- package/src/modules/repos/actions/repo-update.ts +21 -4
- package/src/modules/setting/actions/setting-get.ts +9 -4
- package/src/modules/setting/actions/setting-set.ts +12 -4
- package/src/modules/system/actions/bootstrap.ts +7 -4
- package/src/modules/system/actions/health.ts +6 -3
- package/src/modules/system/actions/routes.ts +11 -3
- package/src/modules/system/routes.ts +1 -1
- package/src/modules/tasktool/actions/timegoal-check.ts +11 -4
- package/src/modules/tasktool/actions/timegoal-clear.ts +9 -4
- package/src/modules/tasktool/actions/timegoal-list.ts +9 -4
- package/src/modules/tasktool/actions/timegoal-log.ts +9 -4
- package/src/modules/tasktool/actions/timegoal-prune.ts +9 -4
- package/src/modules/tasktool/actions/timegoal-set.ts +11 -4
- package/src/modules/tasktool/actions/timegoal-show.ts +10 -4
- package/src/modules/tasktool/actions/timegoal-update.ts +11 -4
- package/src/modules/templates/actions/templates-add.ts +17 -4
- package/src/modules/templates/actions/templates-default.ts +13 -4
- package/src/modules/templates/actions/templates-list.ts +11 -4
- package/src/modules/templates/actions/templates-remove.ts +9 -4
- package/src/modules/templates/actions/templates-update.ts +15 -4
- package/src/modules/todo/actions/group-add.ts +10 -4
- package/src/modules/todo/actions/group-current.ts +9 -4
- package/src/modules/todo/actions/group-get.ts +9 -4
- package/src/modules/todo/actions/group-list.ts +9 -4
- package/src/modules/todo/actions/group-members.ts +9 -4
- package/src/modules/todo/actions/group-remove.ts +9 -4
- package/src/modules/todo/actions/group-update.ts +11 -4
- package/src/modules/todo/actions/group-use.ts +9 -4
- package/src/modules/todo/actions/prompt-get.ts +10 -4
- package/src/modules/todo/actions/prompt-remove.ts +10 -4
- package/src/modules/todo/actions/prompt-set.ts +11 -4
- package/src/modules/todo/actions/todo-add.ts +11 -4
- package/src/modules/todo/actions/todo-archive.ts +10 -4
- package/src/modules/todo/actions/todo-attach.ts +17 -4
- package/src/modules/todo/actions/todo-attachments.ts +12 -4
- package/src/modules/todo/actions/todo-done.ts +13 -4
- package/src/modules/todo/actions/todo-freeze.ts +12 -4
- package/src/modules/todo/actions/todo-get.ts +12 -4
- package/src/modules/todo/actions/todo-list.ts +11 -4
- package/src/modules/todo/actions/todo-remove.ts +12 -4
- package/src/modules/todo/actions/todo-unfreeze.ts +12 -4
- package/src/modules/todo/actions/todo-update.ts +15 -4
- package/src/modules/todo/actions/topic-add.ts +10 -4
- package/src/modules/todo/actions/topic-list.ts +9 -4
- package/src/modules/todo/actions/topic-remove.ts +10 -4
- package/src/runtime/action-decorator.ts +2 -2
- package/src/runtime/codegen.ts +26 -41
- package/src/runtime/registry.ts +2 -2
- package/src/web/frontend/api/client.generated.ts +384 -532
- package/src/web/frontend/page/cloud/api.ts +99 -0
- package/src/web/frontend/page/cloud/index.tsx +13 -32
- package/src/web/frontend/page/dag/api.ts +20 -0
- package/src/web/frontend/page/dag/index.tsx +2 -5
- package/src/web/frontend/page/dir/api.ts +135 -0
- package/src/web/frontend/page/dir/index.tsx +37 -57
- package/src/web/frontend/page/dir/task-actions.ts +39 -59
- package/src/web/frontend/page/dir/task-chain.ts +2 -2
- package/src/web/frontend/page/dir/task-feedback.ts +19 -23
- package/src/web/frontend/page/dir/task-goal.ts +3 -3
- package/src/web/frontend/page/dir/task.tsx +3 -3
- package/src/web/frontend/page/doc/api.ts +82 -0
- package/src/web/frontend/page/doc/index.tsx +29 -32
- package/src/web/frontend/page/group/api.ts +24 -0
- package/src/web/frontend/page/group/index.tsx +7 -16
- package/src/web/frontend/page/overview/api.ts +16 -0
- package/src/web/frontend/page/overview/index.tsx +2 -2
- package/src/web/frontend/page/progress/api.ts +20 -0
- package/src/web/frontend/page/progress/index.tsx +3 -6
- package/src/web/frontend/page/refs/api.ts +14 -0
- package/src/web/frontend/page/refs/index.tsx +2 -4
- package/src/web/frontend/page/repos/api.ts +197 -0
- package/src/web/frontend/page/repos/bind-modals.tsx +4 -7
- package/src/web/frontend/page/repos/board-admin.tsx +6 -6
- package/src/web/frontend/page/repos/doc-search-modal.tsx +4 -4
- package/src/web/frontend/page/repos/index.tsx +10 -14
- package/src/web/frontend/page/repos/pending-section.tsx +7 -13
- package/src/web/frontend/page/repos/ref-panel.tsx +9 -14
- package/src/web/frontend/page/repos/remote-modal.tsx +4 -28
- package/src/web/frontend/page/repos/repo-form-modal.tsx +4 -4
- package/src/web/frontend/page/settings/api.ts +29 -0
- package/src/web/frontend/page/settings/index.tsx +3 -3
- package/src/web/frontend/page/settings/prompt-templates-section.tsx +4 -4
- package/src/web/frontend/page/settings/sidebar-section.tsx +2 -2
- package/src/web/public/assets/Introduction-Du_dycft.js +6 -0
- package/src/web/public/assets/{bar-B9WWmCpt.js → bar-B52NTf_v.js} +1 -1
- package/src/web/public/assets/cloud-Droja_aT.js +3 -0
- package/src/web/public/assets/{composer-panel-ByezS8Xv.js → composer-panel-DpiU2h50.js} +1 -1
- package/src/web/public/assets/dag-Ca-wjIxQ.js +1 -0
- package/src/web/public/assets/{deleted-panel-BcbtctNF.js → deleted-panel-K9GgfR8t.js} +1 -1
- package/src/web/public/assets/dir-DacRpcBt.js +5 -0
- package/src/web/public/assets/group-TPuU-QVc.js +2 -0
- package/src/web/public/assets/{index-D8MvtVAm.js → index-BkLkooKe.js} +2 -2
- package/src/web/public/assets/{md-history-BqZvzWiD.js → md-history-0GBWw4qr.js} +1 -1
- package/src/web/public/assets/overview-B3kHI66i.js +1 -0
- package/src/web/public/assets/progress-CdhFz0Lz.js +3 -0
- package/src/web/public/assets/refs-BDxfuH6R.js +1 -0
- package/src/web/public/assets/repos-C8jRM7wS.js +15 -0
- package/src/web/public/assets/{route-crumb-CWVu80du.js → route-crumb-QvahotvN.js} +1 -1
- package/src/web/public/assets/settings-BBcdGLTc.js +1 -0
- package/src/web/public/assets/{status-tag-DRl9E2Os.js → status-tag-BheHByek.js} +1 -1
- package/src/web/public/assets/task-CUkQaLBZ.js +11 -0
- package/src/web/public/assets/task-utils-_JAWRAz6.js +12 -0
- package/src/web/public/assets/{templates-Df__0k-F.js → templates-CbRyW3PJ.js} +1 -1
- package/src/web/public/assets/{tool-bar-Cv7f6p4v.js → tool-bar-BAmT-BI-.js} +1 -1
- package/src/web/public/index.html +1 -1
- package/src/modules/auth/schemas.ts +0 -27
- package/src/modules/bundled/schemas.ts +0 -32
- package/src/modules/db/schemas.ts +0 -27
- package/src/modules/docs/schemas.ts +0 -107
- package/src/modules/file/schemas.ts +0 -61
- package/src/modules/localtask/schemas.ts +0 -310
- package/src/modules/repos/schemas.ts +0 -310
- package/src/modules/setting/schemas.ts +0 -18
- package/src/modules/system/schemas.ts +0 -30
- package/src/modules/tasktool/schemas.ts +0 -52
- package/src/modules/templates/schemas.ts +0 -50
- package/src/modules/todo/schemas.ts +0 -177
- package/src/web/public/assets/Introduction-aQCeCLrV.js +0 -6
- package/src/web/public/assets/cloud-C4b8SU7C.js +0 -3
- package/src/web/public/assets/dag-jvrjx4i7.js +0 -1
- package/src/web/public/assets/dir-B82XBb1J.js +0 -5
- package/src/web/public/assets/group-BPUOO_QM.js +0 -2
- package/src/web/public/assets/overview-DMihuyzh.js +0 -1
- package/src/web/public/assets/progress-D-rMgz3w.js +0 -3
- package/src/web/public/assets/refs-D21jmrn6.js +0 -1
- package/src/web/public/assets/repos-B94tMDGs.js +0 -15
- package/src/web/public/assets/settings-DgTt4JG5.js +0 -1
- package/src/web/public/assets/task-B2x5GoV3.js +0 -11
- package/src/web/public/assets/task-utils-By8gLpHY.js +0 -12
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as e,h as t,l as n,m as r,p as i,u as a,y as o}from"./task-status-DSrx0i66.js";import{n as s}from"./app-context-BASCGAA-.js";import{n as c,o as l}from"./index-BkLkooKe.js";import{n as u,o as d,r as f,s as p,t as m}from"./prompt-blocks-BovFd039.js";var h=o(e(),1);function g(){return r(`/api/setting`)}function _(e){return r(`/api/setting`,{method:`POST`,body:e})}function v(){return r(`/api/localtasks`)}function y(e){return r(`/api/localtasks/setting`,{method:`PATCH`,body:e})}function b(){return Promise.all([r(`/api/repos`),r(`/api/boards`)])}var x={context:[{label:`项目`,items:[[`repo.name`,`项目名`],[`repo.intro`,`项目介绍正文`],[`repo.introPath`,`介绍全文路径`],[`repo.docs`,`补充文档(可循环 path/tag/note)`],[`repo.docCount`,`补充文档数`],[`repo.refRepos`,`本仓库直接绑定的参考仓库(repos 中 type=ref,不是文档库 refs;可循环 name/path/note)`],[`repo.refRepoCount`,`本仓库直接绑定的参考仓库数`]]},{label:`组`,items:[[`group.name`,`组名`],[`group.desc`,`组定位`],[`group.intro`,`组介绍正文`],[`group.note`,`本项目在组里的位置`],[`group.peers`,`组内成员(可循环 name/note)`],[`group.docs`,`组绑定参考文件(可循环)`],[`group.refRepos`,`本组绑定的参考仓库(repos 中 type=ref,不是文档库 refs;可循环 name/path/note)`],[`group.refRepoCount`,`本组绑定的参考仓库数`],[`groups`,`其余组(可循环 name/desc/path)`]]},{label:`参考仓库`,items:[[`refRepos.list`,`直接绑定 ∪ 组级绑定的去重并集(repos 中 type=ref,不是文档库 refs;可循环 name/path/note)`],[`refRepos.count`,`去重并集的条目数(无绑定时为 0,整段不出现)`]]},{label:`通用`,items:[[`task.id`,`任务号`],[`task.text`,`任务原文`],[`params`,`外部参数(k=v)`]]}],attachment:[{label:`统计`,items:[[`attach.count`,`附件总数`],[`attach.inlineCount`,`正文内嵌数量`],[`attach.areaCount`,`附件区数量`],[`attach.hasInline`,`是否有正文内嵌`],[`attach.hasArea`,`是否有附件区条目`],[`attach.needsSyncCount`,`需要同步到本地的文件数`]]},{label:`附件条目(通用,attach.list 内循环)`,items:[[`kind`,`类型:file / url / task / ref`],[`kindLabel`,`类型显示名:附件/图片/链接/任务/文档`],[`name`,`展示名(任务型为实时标题,不是正文)`],[`size`,`字节数`],[`sizeText`,`可读大小(1.2 MB)`],[`mime`,`MIME 类型`],[`storage`,`存储来源:local / cloud / url / internal`],[`role`,`关系角色:inline / reference / doc / attach`],[`origin`,`来源:inline(正文内嵌)/ area(附件区)`],[`originLabel`,`来源显示名`],[`usage`,`取用说明(按类型生成,含确切命令)`],[`cmd`,`取用命令(file 未同步 / task / ref;url 为空)`],[`locator`,`简短定位串(路径 / 链接 / #seq 标题 / 文档路径)`],[`isImage`,`是否图片(kind=file 的子类型)`],[`needsSync`,`该条是否需要先同步到本地`]]},{label:`文件型(kind=file)· file 子对象`,items:[[`file.localPath`,`本地绝对路径(已同步时才有值)`],[`file.fileId`,`资源 id(未同步时用它拉取)`],[`file.exists`,`本机盘上是否已有副本`],[`file.syncCmd`,`未同步时的命令:nx-kv file sync --ids <fileId>`],[`localPath`,`file.localPath 的平铺别名(旧模板兼容)`],[`fileId`,`file.fileId 的平铺别名`]]},{label:`链接型(kind=url)· url 子对象`,items:[[`url.href`,`可访问的完整链接,可直接抓取`],[`url.host`,`链接域名(host)`],[`href`,`url.href 的平铺别名`],[`host`,`url.host 的平铺别名`],[`urlText`,`链接字符串别名`]]},{label:`任务型(kind=task)· task 子对象`,items:[[`task.taskId`,`本机 tasks.id(join 用;任务被清理后为 0)`],[`task.topicKey`,`任务所在 topic key`],[`task.topicName`,`任务所在 topic 名`],[`task.seq`,`topic 内编号(对外显示的任务号)`],[`task.title`,`实时标题(正文首行,不是正文)`],[`task.status`,`实时状态:pending/claimed/done/cancelled`],[`task.statusLabel`,`状态显示名`],[`task.address`,`地址 topicKey:seq`],[`task.storedAddress`,`附件行里存的旧地址(搬家前)`],[`task.addressDrift`,`地址是否已漂移(任务搬过 topic)`],[`task.resolved`,`正文当前是否可读`],[`task.purged`,`目标任务是否已被清理`],[`task.deleted`,`目标任务是否已软删`],[`task.showCmd`,`取正文命令:nx-kv localtask show --id <seq> --key <topicKey>`],[`seq`,`task.seq 的平铺别名`],[`title`,`task.title 的平铺别名`],[`showCmd`,`task.showCmd 的平铺别名`]]},{label:`文档型(kind=ref)· ref 子对象`,items:[[`ref.refId`,`refs 表 id`],[`ref.title`,`文档标题`],[`ref.relPath`,`文档相对路径 / 外部 md 绝对路径`],[`ref.readCmd`,`读取命令:nx-kv docs get rel:<路径>(或 path:<绝对路径>)`],[`refId`,`ref.refId 的平铺别名`],[`relPath`,`ref.relPath 的平铺别名`],[`readCmd`,`ref.readCmd 的平铺别名`]]},{label:`同步汇总`,items:[[`attach.syncSummary.text`,`本次批量同步的一行汇总`],[`attach.syncSummary.dir`,`同步目录`],[`attach.syncSummary.downloaded`,`已下载数`],[`attach.syncSummary.skipped`,`跳过数`],[`attach.syncSummary.failureCount`,`失败数`]]},{label:`通用`,items:[[`task.id`,`任务号`],[`task.text`,`任务原文(交付模板等处仍在用)`]]}],timecheck:[{label:`时间目标`,items:[[`goal.check`,`时间检查指令(任务级;每轮 check 按当下模板渲染)`],[`goal.statusLine`,`目录级目标状态行`],[`goal.name`,`目标名`],[`goal.goalKey`,`任务级目标 key(check --task 用)`],[`goal.durationHuman`,`持续时长(人话,如 2 小时)`],[`goal.durationSec`,`持续秒数`],[`goal.deadline`,`截止时间`],[`goal.remainingSec`,`剩余秒数`],[`goal.remainingHuman`,`剩余时长(人话)`],[`goal.remainingMin`,`剩余分钟(向上取整)`],[`goal.elapsedHuman`,`已过时长(人话)`],[`goal.elapsedSec`,`已过秒数`],[`goal.overtimeSec`,`超时秒数`],[`goal.reached`,`是否到点`],[`goal.extra`,`发布方附加要求(领取后可动态改)`]]},{label:`通用`,items:[[`task.id`,`任务号`],[`task.text`,`任务实时原文`]]}],goalhint:[{label:`时间目标上下文(任务级)`,items:[[`goal.goalKey`,`任务级目标 key(check --task 用)`],[`goal.durationHuman`,`持续时长(人话)`],[`goal.durationSec`,`持续秒数`],[`goal.startedAt`,`开始计时时间`],[`goal.deadline`,`截止时间`],[`goal.remainingHuman`,`剩余时长(人话)`],[`goal.remainingSec`,`剩余秒数`],[`goal.elapsedHuman`,`已过时长(人话)`],[`goal.elapsedSec`,`已过秒数`],[`goal.overtimeSec`,`超时秒数`],[`goal.reached`,`是否到点`],[`goal.extra`,`发布方附加要求(领取后可动态改)`]]},{label:`任务`,items:[[`task.id`,`任务号`],[`task.text`,`任务实时原文(check 返回对象同样可用)`]]}],doneguard:[{label:`时间目标上下文(任务级)`,items:[[`goal.blocked`,`恒为 true(只在这条拦截路径上出现,交付渲染时整段省略)`],[`goal.goalKey`,`任务级目标 key(check --task 用)`],[`goal.durationHuman`,`持续时长(人话)`],[`goal.durationSec`,`持续秒数`],[`goal.startedAt`,`开始计时时间`],[`goal.deadline`,`截止时间`],[`goal.remainingHuman`,`剩余时长(人话)`],[`goal.remainingSec`,`剩余秒数`],[`goal.elapsedHuman`,`已过时长(人话)`],[`goal.elapsedSec`,`已过秒数`]]},{label:`任务`,items:[[`task.id`,`任务号`],[`task.text`,`任务实时原文`]]},{label:`可用的 helper(与所有区块同一套)`,items:[[`percent goal.elapsedSec goal.durationSec`,`已用百分比(0 位小数;可加第三参控制小数位)`],[`gte a b / gt / lt / lte / eq / ne / between v min max`,`比较,返回布尔,可直接进 {{#if}}`],[`and / or / not`,`逻辑`],[`add / sub / mul / div / mod / round / floor / ceil / ratio / clamp`,`数值计算(坏输入输出 NaN,不抛错)`],[`includes / length / default`,`字符串`],[`formatDuration`,`秒数转人话`]]}],ext:[{label:`队列`,items:[[`ext.topic`,`主题 / 队列名`],[`ext.count`,`待领取任务数`],[`ext.list`,`待领取清单(可循环 id/title/topic)`]]},{label:`通用`,items:[[`task.id`,`任务号`]]}],ack:[{label:`通用`,items:[[`task.id`,`任务号`],[`task.text`,`任务原文`],[`source`,`任务来源(local/global)`],[`summary`,`领取方现状`],[`name`,`领取方名字`],[`cwd`,`领取方目录`],[`params`,`外部参数(k=v)`]]}],getloop:[{label:`持续 get`,items:[[`getloop.text`,`持续 get 指令正文`],[`getloop.waitMinutes`,`单轮等待分钟数`]]},{label:`通用`,items:[[`task.id`,`任务号`]]}]},S=t();function C({blockId:e}){let t=x[e]||[];return t.length?(0,S.jsxs)(`div`,{className:`setp-params`,"aria-label":`可使用参数`,children:[(0,S.jsx)(`div`,{className:`setp-params-head`,children:`可使用参数`}),t.map(e=>(0,S.jsxs)(`div`,{className:`setp-params-row`,children:[(0,S.jsx)(`span`,{className:`setp-params-label`,children:e.label}),(0,S.jsx)(`div`,{className:`setp-params-items`,children:e.items.map(([e,t])=>(0,S.jsxs)(`span`,{className:`setp-param`,children:[(0,S.jsx)(`code`,{children:e}),(0,S.jsx)(`span`,{children:t})]},e))})]},e.label))]}):null}function w(){return`bt_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,7)}`}function T(e){return u.find(t=>t.id===e)||u[0]}function E(e,t){return e[t]}function D(e,t,n){let r=E(e,t);return r.list.find(e=>e.id===n)||r.list.find(e=>e.id===r.active)||r.list[0]}function O(){let e=i(),{dialog:t,node:r}=n(),[a,o]=(0,h.useState)(null),[s,c]=(0,h.useState)(u[0].id),[l,g]=(0,h.useState)(null),[_,b]=(0,h.useState)(!1),x=(e,t=null)=>{o(t=>({lists:e,appendMode:t?.appendMode??`xml`}));let n=t||(l&&l.blockId===s?l:null),r=n?.blockId||s,i=D(e,r,n?.id||E(e,r).active);g({blockId:r,id:i.id,name:i.name,template:i.template})},O=()=>{v().then(e=>{let t=e?.settings||{},n=d(t.blockTemplates),r=t.appendMode===`plain`?`plain`:`xml`;o({lists:n,appendMode:r});let i=u[0],a=D(n,i.id,E(n,i.id).active);c(i.id),g({blockId:i.id,id:a.id,name:a.name,template:a.template})}).catch(t=>e(`读取失败:`+(t.message||t)))};if((0,h.useEffect)(O,[]),!a)return(0,S.jsx)(`div`,{className:`setp-note`,children:`读取提示词模板…`});let k=T(s),A=m.find(e=>e.id===a.appendMode)||m[0],j=E(a.lists,s),M=l?.id===f,N=async(t,n,r=null)=>{if(!_){b(!0);try{let i=await y({method:`PATCH`,body:{blockTemplates:t}});x(d(i?.blockTemplates),r),e(n)}catch(t){e(String(t.message||t))}finally{b(!1)}}},P=()=>JSON.parse(JSON.stringify(a.lists)),F=e=>{if(_)return;c(e);let t=D(a.lists,e,E(a.lists,e).active);g({blockId:e,id:t.id,name:t.name,template:t.template})},I=e=>{let t=D(a.lists,s,e);g({blockId:s,id:t.id,name:t.name,template:t.template})},L=e=>g(t=>t&&{...t,...e}),R=()=>{if(!l)return;if(M){e(`系统内置模板不可编辑;请先「复制」一份再改`);return}let t=String(l.name||``).trim().slice(0,60)||`未命名模板`,n=String(l.template??``),r=P(),i=E(r,s),a=i.list.findIndex(e=>e.id===l.id),o={id:l.id,name:t,template:n,builtin:!1};a>=0?i.list[a]=o:i.list.push(o),N(r,`已保存模板(当前生效项保存后立即生效)`,{blockId:s,id:l.id})},z=()=>{if(_)return;let e=P(),t={id:w(),name:`新模板`,template:``,builtin:!1};E(e,s).list.push(t),N(e,`已新建模板,填写后保存,再点「启用」`,{blockId:s,id:t.id})},B=e=>{if(_)return;let t=typeof e==`string`?e:``,n=D(a.lists,s,t),r=P(),i={id:w(),name:`${n.name||`模板`} 副本`.slice(0,60),template:n.template||``,builtin:!1};E(r,s).list.push(i),N(r,`已复制模板`,{blockId:s,id:i.id})},V=()=>{if(_||M||!l)return;let e=String(l.name||``).trim().slice(0,60)||`未命名模板`,t=P(),n=E(t,s),r=n.list.findIndex(e=>e.id===l.id),i={id:l.id,name:e,template:String(l.template??``),builtin:!1};r>=0?n.list[r]=i:n.list.push(i),n.active=l.id,N(t,`已保存并启用「${e}」`,{blockId:s,id:l.id})},H=e=>{if(_||e===j.active)return;let t=P();E(t,s).active=e,N(t,`已启用「${D(a.lists,s,e).name}」`,{blockId:s,id:e})},U=async n=>{if(_)return;if(n===`builtin`){e(`系统内置模板不可删除`);return}let r=D(a.lists,s,n);if(!await t({title:`删除模板?`,message:`将删除「${r.name}」,保存后不可恢复。该区块的系统内置模板会保留。`,okText:`删除`,danger:!0}))return;let i=P(),o=E(i,s);o.list=o.list.filter(e=>e.id!==n),o.active===n&&(o.active=f),N(i,`已删除模板,当前生效项已回落到系统内置`)},W=()=>{if(_||j.active===`builtin`)return;let e=P();E(e,s).active=f,N(e,`已恢复系统内置模板`,{blockId:s,id:f})},G=async t=>{if(!(_||t===a.appendMode)){b(!0);try{let n=await y({method:`PATCH`,body:{appendMode:t}});o(e=>e&&{...e,appendMode:n?.appendMode===`plain`?`plain`:`xml`}),e(`已保存追加模式(全局生效)`)}catch(t){e(String(t.message||t))}finally{b(!1)}}};return(0,S.jsxs)(`div`,{className:`setp-tpl-editor`,children:[(0,S.jsxs)(`div`,{className:`setp-tpl-head`,children:[(0,S.jsx)(`span`,{className:`setp-tpl-head-label`,children:`系统提示词追加方式`}),(0,S.jsx)(`div`,{className:`setp-seg`,role:`group`,"aria-label":`系统提示词追加方式`,children:m.map(e=>(0,S.jsx)(`button`,{type:`button`,className:`setp-seg-btn`+(a.appendMode===e.id?` is-on`:``),"aria-pressed":a.appendMode===e.id,title:e.desc,disabled:_,onClick:()=>G(e.id),children:e.label},e.id))}),(0,S.jsx)(`span`,{className:`setp-note`,children:A.desc})]}),(0,S.jsx)(`nav`,{className:`setp-block-tabs`,"aria-label":`提示词区块`,children:u.map(e=>{let t=D(a.lists,e.id,E(a.lists,e.id).active);return(0,S.jsxs)(`button`,{type:`button`,className:`setp-block-tab`+(e.id===s?` is-on`:``),disabled:_,onClick:()=>F(e.id),children:[(0,S.jsx)(`span`,{children:e.label}),(0,S.jsx)(`small`,{children:t.builtin?`系统内置`:t.name})]},e.id)})}),(0,S.jsxs)(`div`,{className:`setp-block-card`,children:[(0,S.jsxs)(`div`,{className:`setp-block-card-head`,children:[(0,S.jsxs)(`div`,{className:`setp-block-card-title`,children:[(0,S.jsx)(`b`,{children:k.label}),(0,S.jsx)(`span`,{className:`setp-note`,children:k.desc})]}),(0,S.jsxs)(`div`,{className:`setp-block-card-actions`,children:[(0,S.jsx)(p,{variant:`secondary`,disabled:_,onClick:z,children:`新建模板`}),(0,S.jsx)(p,{variant:`secondary`,disabled:_||j.active===`builtin`,onClick:W,children:`恢复内置`})]})]}),(0,S.jsx)(`div`,{className:`setp-tpl-list`,role:`listbox`,"aria-label":`${k.label}模板列表`,children:j.list.map(e=>{let t=e.id===j.active,n=e.id===l?.id;return(0,S.jsxs)(`div`,{className:`setp-tpl-pick${t?` is-on`:``}${n?` is-sel`:``}`,children:[(0,S.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":t,className:`setp-tpl-name`,title:e.name,onClick:()=>I(e.id),children:[(0,S.jsx)(`span`,{className:`setp-tpl-name-text`,children:e.name}),e.builtin&&(0,S.jsx)(`span`,{className:`setp-badge`,children:`内置`}),t&&(0,S.jsx)(`span`,{className:`setp-badge`,children:`启用中`})]}),(0,S.jsx)(p,{variant:`secondary`,className:`setp-tpl-act`,disabled:_,title:e.builtin?`复制系统内置模板`:`复制该模板`,onClick:()=>B(e.id),children:`复制`}),(0,S.jsx)(p,{variant:`secondary`,className:`setp-tpl-act`,disabled:_||t,title:`设为该区块当前生效模板`,onClick:()=>H(e.id),children:`启用`}),(0,S.jsx)(p,{variant:`secondary`,danger:!0,className:`setp-tpl-act`,disabled:_||e.builtin,title:e.builtin?`系统内置模板不可删除`:`删除该模板`,onClick:()=>U(e.id),children:`删除`})]},e.id)})}),l&&(0,S.jsxs)(`div`,{className:`setp-tpl-editor-box`,children:[(0,S.jsxs)(`div`,{className:`setp-tpl-editor-head`,children:[(0,S.jsx)(`span`,{children:M?`系统内置`:`编辑 · ${l.name||`未命名模板`}`}),(0,S.jsx)(`span`,{className:`setp-note`,children:l.id===j.active?`当前生效,保存后立即参与领取`:`未启用;保存后可点「启用」`})]}),!M&&(0,S.jsxs)(`div`,{className:`setp-row`,children:[(0,S.jsx)(`span`,{children:`模板名`}),(0,S.jsx)(`div`,{className:`setp-input`,children:(0,S.jsx)(`input`,{value:l.name,maxLength:60,disabled:_,onChange:e=>L({name:e.target.value})})})]}),(0,S.jsx)(`textarea`,{className:`setp-area setp-tpl-textarea`,value:l.template,readOnly:M,spellCheck:!1,disabled:_,placeholder:M?``:`在这里写该区块的模板`,onChange:e=>L({template:e.target.value})}),(0,S.jsx)(C,{blockId:s}),(0,S.jsxs)(`div`,{className:`setp-proj-a`,children:[M?(0,S.jsx)(p,{variant:`secondary`,disabled:_,onClick:B,children:`复制为我的模板`}):(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(p,{variant:`primary`,disabled:_,onClick:R,children:`保存`}),(0,S.jsx)(p,{variant:`secondary`,disabled:_,onClick:O,children:`撤销改动`}),l.id!==j.active&&(0,S.jsx)(p,{variant:`secondary`,disabled:_,onClick:V,children:`保存并启用`})]}),(0,S.jsx)(`span`,{className:`spacer`})]})]})]}),r]})}var k={topic:`目录`,repo:`项目`,group:`组`};function A(){let e=s(),t=e.rows||[],n=e.repoData?.repos||[],r=e.repoData?.boards||[];return(0,h.useMemo)(()=>{let e=new Map;for(let n of t)n&&n.key&&e.set(String(n.key),n.name||n.key);let i=new Map;for(let e of n)e&&e.key&&(e.type||`repo`)!==`group`&&i.set(String(e.key),e.name||e.key);let a=new Map;for(let e of n)e&&(e.type||``)===`group`&&e.key&&a.set(String(e.key),e.name||e.key);for(let e of r){let t=String(e&&(e.key||e.id)||``);t&&a.set(t,e&&e.name||t)}return{topicByKey:e,repoByKey:i,groupByKey:a,topics:t,repos:n,boards:r}},[t,n,r])}function j(e,t){if(e===`*`)return`全局`;let n=String(e).indexOf(`:`);if(n<0)return String(e);let r=String(e).slice(0,n),i=String(e).slice(n+1),a=k[r]||r,o=``;return r===`topic`?o=t.topicByKey.get(i)||``:r===`repo`?o=t.repoByKey.get(i)||``:r===`group`&&(o=t.groupByKey.get(i)||``),o?`${a} · ${o}`:`${a} ${/^[0-9a-f]{16}$/.test(i)?`${i.slice(0,6)}…`:i}`}function M({scope:e,onChange:t,originTopic:n=``,catalog:r,classPrefix:a=`setp`}){let o=i(),s=A(),c=r||s,[l,u]=(0,h.useState)(null),d=Array.isArray(e)?e:[],f=d.includes(`*`),p=d.filter(e=>e!==`*`),m=a,g=n?c.topicByKey.get(n)||(/^[0-9a-f]{16}$/.test(n)?`${n.slice(0,6)}…`:n):``,_=async e=>{try{await t(e)}catch(e){o(String(e.message||e))}},v=async e=>{if(d.includes(e)){o(`已经在可见范围里了`),u(null);return}await _([...d,e]),u(null)},y=(0,h.useMemo)(()=>{if(l===`topic`)return(c.topics||[]).filter(e=>e&&e.key).map(e=>({entry:`topic:${e.key}`,label:e.name||e.key,sub:e.cwd||``}));if(l===`repo`)return(c.repos||[]).filter(e=>e&&e.key&&(e.type||`repo`)!==`group`&&e.key!==`__unbound__`).map(e=>({entry:`repo:${e.key}`,label:e.name||e.key,sub:e.key}));if(l===`group`){let e=new Set,t=[];for(let n of c.repos||[])n&&(n.type||``)===`group`&&n.key&&!e.has(n.key)&&(e.add(n.key),t.push({entry:`group:${n.key}`,label:n.name||n.key,sub:n.key}));for(let n of c.boards||[]){let r=n&&(n.key||n.id);r&&!e.has(r)&&(e.add(r),t.push({entry:`group:${r}`,label:n&&n.name||r,sub:String(r)}))}return t}return[]},[l,c]);return(0,S.jsxs)(`div`,{className:`${m}-scope-block`,children:[(0,S.jsx)(`div`,{className:`${m}-scope`,children:d.map(e=>(0,S.jsxs)(`button`,{type:`button`,className:`${m}-scope-chip on`,title:`${e} —— 点击移除`,onClick:()=>_(d.filter(t=>t!==e)),children:[j(e,c),` ×`]},e))}),(0,S.jsxs)(`div`,{className:`${m}-scope-add`,children:[(0,S.jsx)(`span`,{className:`${m}-scope-add-label`,children:`添加`}),(0,S.jsx)(`button`,{type:`button`,className:`${m}-scope-add-btn`,disabled:f,title:f?`已绑定全局`:`加上「全局」绑定(与目录/项目/组平级)`,onClick:()=>!f&&_([`*`,...p]),children:`全局`}),[`topic`,`repo`,`group`].map(e=>(0,S.jsx)(`button`,{type:`button`,className:`${m}-scope-add-btn`+(l===e?` on`:``),onClick:()=>u(l===e?null:e),children:k[e]},e)),g?(0,S.jsxs)(`span`,{className:`${m}-scope-origin`,title:`创建于主题 ${n}`,children:[`创建于 `,g]}):null]}),l&&(0,S.jsx)(`div`,{className:`${m}-scope-pick`,role:`listbox`,"aria-label":`选择可见对象`,children:y.length?y.map(e=>(0,S.jsxs)(`button`,{type:`button`,className:`${m}-scope-pick-it`,disabled:d.includes(e.entry),title:e.sub||e.entry,onClick:()=>v(e.entry),children:[(0,S.jsx)(`span`,{className:`${m}-scope-pick-name`,children:e.label}),d.includes(e.entry)?(0,S.jsx)(`span`,{className:`${m}-scope-pick-done`,children:`已加`}):null]},e.entry)):(0,S.jsx)(`div`,{className:`${m}-scope-pick-empty`,children:`暂无可选项`})})]})}function N({openTemplateEditor:e}){let t=c(),r=i(),{dialog:a,node:o}=n(),s=t.templates||[],[l,u]=(0,h.useState)(null),[d,f]=(0,h.useState)(!1);if(t.unsupported)return(0,S.jsx)(`div`,{className:`setp-note`,children:`当前服务比面板旧——重启面板后才有模板功能。`});let m=async(e,t)=>{if(!d){f(!0);try{await e(),t&&r(t)}catch(e){r(String(e.message||e))}finally{f(!1)}}},g=async e=>{await a({title:`删除模板「${e.name}」`,danger:!0,okText:`删除`})&&(await m(()=>t.remove(e.id),`已删除「${e.name}」`),l===e.id&&u(null))};return(0,S.jsxs)(`div`,{className:`setp-tpl setp-tpl-cards`,children:[o,!s.length&&(0,S.jsx)(`div`,{className:`setp-note`,children:`还没有模板(内置默认模板加载中…)。`}),s.map(n=>{let r=n.id===t.defaultId,i=l===n.id;return(0,S.jsxs)(`div`,{className:`setp-tpl-card`+(r?` is-default`:``),children:[(0,S.jsxs)(`div`,{className:`setp-tpl-card-head`,children:[(0,S.jsx)(`span`,{className:`setp-tpl-card-name`,children:n.name}),r&&(0,S.jsx)(`span`,{className:`setp-badge`,children:`默认`}),n.builtin&&(0,S.jsx)(`span`,{className:`setp-badge soft`,children:`内置`})]}),i&&(0,S.jsx)(`div`,{className:`setp-tpl-card-scope`,children:(0,S.jsx)(M,{scope:n.scope,originTopic:n.originTopic,onChange:e=>t.update(n.id,{scope:e})})}),(0,S.jsxs)(`div`,{className:`setp-tpl-card-foot`,children:[(0,S.jsx)(`span`,{className:`grow`}),(0,S.jsx)(p,{variant:`secondary`,disabled:d,onClick:()=>u(i?null:n.id),children:`可见绑定`}),(0,S.jsx)(p,{variant:`secondary`,disabled:d,onClick:()=>e?.({id:n.id,name:n.name,mode:`edit`}),children:`编辑`}),!r&&(0,S.jsx)(p,{variant:`secondary`,disabled:d,onClick:()=>m(()=>t.setDefault(n.id),`默认模板已设为「${n.name}」`),children:`设为默认`}),!n.builtin&&(0,S.jsx)(p,{variant:`secondary`,disabled:d,onClick:()=>g(n),children:`删除`})]})]},n.id)}),(0,S.jsx)(`div`,{className:`setp-tpl-card-new`,children:(0,S.jsx)(p,{variant:`secondary`,disabled:d,onClick:()=>e?.({mode:`new`,scope:[]}),children:`+ 新建模板`})})]})}function P(){let e=i(),t=s(),n=t.patchPrefs,[r,a]=(0,h.useState)([]),[o,c]=(0,h.useState)([]),[l,u]=(0,h.useState)([]),d=(0,h.useCallback)(()=>{b().then(([e,n])=>{a(Array.isArray(e)?e:e?.repos||[]),c(Array.isArray(n)?n:n?.boards||[]),u(t.prefs?.hidden||[])}).catch(t=>e(`读取失败:`+(t.message||t)))},[e,t.prefs]);(0,h.useEffect)(()=>{d()},[d]);let f=e=>{let r=t.prefs?.hidden||[],i=r.includes(e)?r.filter(t=>t!==e):[...r,e];n&&n({hidden:i}),u(i)},p=(e,t,n,r)=>(0,S.jsx)(`div`,{className:`setp-row`,children:(0,S.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:8,cursor:`pointer`},children:[(0,S.jsx)(`input`,{type:`checkbox`,checked:!l.includes(t),onChange:()=>f(t)}),(0,S.jsx)(`span`,{children:n}),r?(0,S.jsx)(`span`,{className:`mono faint`,children:r}):null]})},e+`:`+t);return(0,S.jsxs)(`div`,{className:`setp-side`,children:[(0,S.jsx)(`div`,{className:`setp-note`,children:`勾掉的项目组 / 项目不在侧边栏显示(登记与数据都留着,随时勾回来)。`}),(0,S.jsx)(`div`,{className:`setp-row`,children:(0,S.jsx)(`span`,{children:`项目组(指针)`})}),o.map(e=>p(`board`,e.key||e.id,e.name,`${(e.repos||[]).length} 个模块`)),!o.length&&(0,S.jsx)(`div`,{className:`setp-note`,children:`还没有项目组。`}),(0,S.jsx)(`div`,{className:`setp-row`,children:(0,S.jsx)(`span`,{children:`项目 / 仓库(模块)`})}),r.map(e=>p(`repo`,e.key||e.id,e.name,e.path)),!r.length&&(0,S.jsx)(`div`,{className:`setp-note`,children:`还没有登记仓库。`})]})}var F=[{id:`pref`,label:`偏好`,icon:`flow`},{id:`work`,label:`工作区`,icon:`sidebar`},{id:`cloud`,label:`云端与存储`,icon:`cloud`},{id:`taskTemplates`,label:`任务模板`,icon:`list`},{id:`prompts`,label:`提示词模板`,icon:`flow`},{id:`sidebar`,label:`侧栏显示`,icon:`sidebar`}];function I(){let e=s(),t=i(),{dialog:r,node:o}=n(),c=e.prefs,u=e.patchPrefs||(()=>{}),d=e.model,[f,m]=(0,h.useState)(`pref`),[v,y]=(0,h.useState)(null),[b,x]=(0,h.useState)(!1),C=(0,h.useCallback)(async()=>{try{y(await g())}catch(e){t(`读取设置失败:`+(e.message||e))}},[t]);(0,h.useEffect)(()=>{C()},[C]);let w=e=>e().catch(e=>t(String(e.message||e))),T=e=>w(async()=>{x(!0);try{y(await _(e)),t(`已保存`)}finally{x(!1)}}),E={pref:(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`div`,{className:`setp-row`,children:[(0,S.jsx)(`span`,{children:`侧边栏默认收起`}),(0,S.jsxs)(`button`,{className:`toggle`+(c?.defaultFolded?` on`:``),onClick:()=>u({defaultFolded:!c?.defaultFolded}),children:[(0,S.jsx)(`span`,{className:`dot`}),c?.defaultFolded?`开`:`关`]})]}),(c?.hidden||[]).length>0&&(0,S.jsxs)(`div`,{className:`setp-row`,children:[(0,S.jsxs)(`span`,{children:[`隐藏仓库 `,c?.hidden?.length,` 个`]}),(0,S.jsx)(p,{variant:`secondary`,onClick:()=>u({hidden:[]}),children:`恢复显示`})]})]}),work:(0,S.jsx)(S.Fragment,{children:(0,S.jsxs)(`div`,{className:`setp-row`,children:[(0,S.jsx)(`span`,{children:`布局`}),(0,S.jsx)(p,{variant:`secondary`,onClick:async()=>{await r({title:`重置为初始两栏`,message:`丢掉存下来的布局,回到初始的两栏(目录 + 开始)?`,okText:`重置`})&&e.shell&&e.shell.resetLayout()},children:`重置为初始两栏`})]})}),cloud:(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`div`,{className:`setp-row`,children:[(0,S.jsx)(`span`,{children:`读任务时自动下载附件`}),(0,S.jsxs)(`button`,{className:`toggle`+(v&&v.autoSyncAttachments?` on`:``),disabled:!v||b,onClick:()=>v&&T({autoSyncAttachments:!v.autoSyncAttachments}),children:[(0,S.jsx)(`span`,{className:`dot`}),v&&v.autoSyncAttachments?`开`:`关`]})]}),(0,S.jsxs)(`div`,{className:`setp-row`,children:[(0,S.jsx)(`span`,{children:`附件目录`}),(0,S.jsxs)(`span`,{className:`setp-input`,children:[(0,S.jsx)(`input`,{value:v&&v.attachmentsDir||``,placeholder:`(默认 ~/.nx-kv/attachments/)`,onChange:e=>y(t=>({...t||{},attachmentsDir:e.target.value}))}),(0,S.jsx)(p,{variant:`secondary`,disabled:!v||b,onClick:()=>v&&T({attachmentsDir:v.attachmentsDir}),children:`保存`})]})]}),(0,S.jsxs)(`div`,{className:`setp-row`,children:[(0,S.jsx)(`span`,{children:`参考仓库存储根`}),(0,S.jsxs)(`span`,{className:`setp-input`,children:[(0,S.jsx)(`input`,{value:v&&v.gitRepoRoot||``,placeholder:`(未设置 —— clone 参考仓库前先设)`,onChange:e=>y(t=>({...t||{},gitRepoRoot:e.target.value}))}),(0,S.jsx)(p,{variant:`secondary`,disabled:!v||b,onClick:()=>v&&T({gitRepoRoot:v.gitRepoRoot}),children:`保存`})]})]}),(0,S.jsxs)(`div`,{className:`setp-row`,children:[(0,S.jsx)(`span`,{children:`开发仓库克隆根`}),(0,S.jsxs)(`span`,{className:`setp-input`,children:[(0,S.jsx)(`input`,{value:v&&v.gitDevRoot||``,placeholder:`(未设置 —— 导入布局时只登记不克隆)`,onChange:e=>y(t=>({...t||{},gitDevRoot:e.target.value}))}),(0,S.jsx)(p,{variant:`secondary`,disabled:!v||b,onClick:()=>v&&T({gitDevRoot:v.gitDevRoot}),children:`保存`})]})]})]}),taskTemplates:(0,S.jsx)(N,{openTemplateEditor:e=>{d&&l(d,e||{})}}),prompts:(0,S.jsx)(O,{}),sidebar:(0,S.jsx)(P,{})};return(0,S.jsxs)(`div`,{className:`setp`,children:[(0,S.jsx)(`nav`,{className:`setp-nav`,"aria-label":`设置分区`,children:F.map(e=>(0,S.jsxs)(`button`,{className:`setp-navitem`+(f===e.id?` on`:``),"aria-current":f===e.id,onClick:()=>m(e.id),children:[(0,S.jsx)(a,{name:e.icon,size:14}),(0,S.jsx)(`span`,{children:e.label})]},e.id))}),(0,S.jsxs)(`div`,{className:`setp-body`,children:[(0,S.jsx)(`div`,{className:`setp-h`,children:F.find(e=>e.id===f)?.label}),E[f]]}),o]})}export{I as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as e}from"./task-status-DSrx0i66.js";import{b as t,v as n,y as r}from"./index-
|
|
1
|
+
import{h as e}from"./task-status-DSrx0i66.js";import{b as t,v as n,y as r}from"./index-BkLkooKe.js";var i=e();function a({t:e,short:a=!1,className:o=``,title:s}){let c=t(e);return(0,i.jsx)(`span`,{className:`tstat tstat-`+c+(a?` tstat-short`:``)+(o?` `+o:``),title:s||(a?n(e):void 0),children:a?r(e):n(e)})}export{a as t};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{g as e,h as t,l as n,o as r,p as i,u as a,y as o}from"./task-status-DSrx0i66.js";import{r as s,t as c,v as l}from"./workspace-4tw7trV7.js";import{n as u}from"./app-context-BASCGAA-.js";import{n as d,r as f,t as p}from"./frontmatter-CLLxCmTv.js";import{a as m,g as h,h as g,i as _,m as v,n as y,p as b,r as x,t as S,u as C}from"./md-history-0GBWw4qr.js";import{a as w,r as T}from"./md-parse-b6GY5eBl.js";import{t as E}from"./board-view-DABoVkaA.js";import{c as D,d as O,f as k,h as ee,l as A,m as j,p as M,s as te,u as N}from"./index-BkLkooKe.js";import{t as P}from"./status-tag-BheHByek.js";import{a as F,i as I,n as L,o as R}from"./composer-launch-mK9Nr6mZ.js";import{t as ne}from"./route-crumb-QvahotvN.js";import{S as re,_ as z,a as B,b as ie,c as V,d as ae,f as H,g as oe,h as U,l as se,m as ce,n as W,o as le,p as G,r as K,s as ue,t as de,v as q,y as fe}from"./task-utils-_JAWRAz6.js";import{n as pe,u as me}from"./tool-bar-BAmT-BI-.js";var J=o(e(),1),he=/^>\s*\[![A-Za-z][\w-]*\][ \t]*(.*)$/,ge=/完成总结/,_e=/反馈/,ve=/第\s*(\d+)\s*轮/;function ye(e){let t=String(e??``).split(`
|
|
2
|
+
`),n=t[0],r=n?n.match(he):null;if(!r)return null;let i=t.slice(1).map(e=>e.replace(/^>[ \t]?/,``)).filter(e=>e.trim()!==``).join(`
|
|
3
|
+
`);return{title:String(r[1]??``).trim(),body:i}}function be(e){let t=v(String(e??``));if(!t.length)return[];let n=[],r=null,i=``;return t.forEach((e,t)=>{let a=String(e||``).trim(),o=ye(a);if(o&&ge.test(o.title)){let e=Number((o.title.match(ve)||[])[1]);r={round:Number.isFinite(e)&&e>0?e:n.length+1,blockIndex:t,feedbackBlockIndex:-1,ackText:o.body,feedbackText:``},n.push(r),i=`ack`;return}if(a===`## 上一轮完成总结`){r={round:n.length+1,blockIndex:t,feedbackBlockIndex:-1,ackText:``,feedbackText:``},n.push(r),i=`ack`;return}if(o&&_e.test(o.title)){r&&i===`ack`&&(r.feedbackBlockIndex=t,r.feedbackText=o.body,i=`feedback`);return}if(a===`## 验收反馈`){r&&i===`ack`&&(r.feedbackBlockIndex=t,i=`feedback`);return}a&&r&&(i===`ack`?r.ackText+=(r.ackText?`
|
|
4
|
+
`:``)+a:r.feedbackText+=(r.feedbackText?`
|
|
5
|
+
`:``)+a)}),n.filter(e=>e.ackText!==``)}function xe(e){let t=String(e?.ackText||``).split(`
|
|
6
|
+
`).map(e=>e.replace(/^#+\s*/,``).replace(/\*\*/g,``).trim()).find(e=>e!==``);if(!t)return`第 ${e?.round??1} 轮`;let n=t.length>24?`${t.slice(0,24)}…`:t;return`第 ${e?.round??1} 轮 · ${n}`}var Se=`nx-kv-ack-rail-pos`;function Ce(e={}){let{x:t,y:n,parentW:r,parentH:i,railW:a=0,railH:o=0,margin:s=8}=e||{};if(![t,n,r,i].every(e=>Number.isFinite(e)))return null;let c=Number(t),l=Number(n),u=Number(r),d=Number(i),f=Math.max(s,u-a-s),p=Math.max(s,d-o-s);return{x:Math.min(f,Math.max(s,c)),y:Math.min(p,Math.max(s,l))}}function we(){try{let e=JSON.parse(localStorage.getItem(Se)||`null`);if(!e||typeof e!=`object`)return null;let t=Number(e.x),n=Number(e.y);return!Number.isFinite(t)||!Number.isFinite(n)?null:{x:t,y:n}}catch{return null}}function Te(e){try{e?localStorage.setItem(Se,JSON.stringify({x:Math.round(e.x),y:Math.round(e.y)})):localStorage.removeItem(Se)}catch{}}var Y=t(),Ee=4;function De(e,t,n){return!e||t<0?null:e.querySelector(`.mdw-lp-block[data-i="${t}"]`)||[...Array.from(e.querySelectorAll(`h2`)).filter(e=>(e.textContent||``).trim()===`上一轮完成总结`),...Array.from(e.querySelectorAll(`.md-callout-t`)).filter(e=>/完成总结/.test(e.textContent||``))].sort((e,t)=>e.compareDocumentPosition(t)&4?-1:1)[n]||null}function Oe({nodes:e=[],scrollRoot:t=null,onJump:n=null}){let[r,i]=(0,J.useState)(!1),[a,o]=(0,J.useState)(0),[s,c]=(0,J.useState)(()=>we()),[l,u]=(0,J.useState)(!1),d=(0,J.useRef)(null),f=(0,J.useRef)(null),p=(0,J.useRef)(!1);(0,J.useEffect)(()=>{let e=d.current,t=e&&e.parentElement;if(!e||!t)return;let n=()=>{c(n=>{if(!n)return n;let r=t.getBoundingClientRect(),i=e.getBoundingClientRect(),a=Ce({x:n.x,y:n.y,parentW:r.width,parentH:r.height,railW:i.width,railH:i.height});return a&&(a.x!==n.x||a.y!==n.y)?a:n})};return n(),window.addEventListener(`resize`,n,{passive:!0}),()=>window.removeEventListener(`resize`,n)},[]);let m=(0,J.useCallback)(e=>{if(e.pointerType===`mouse`&&e.button!==0)return;let t=d.current,n=t&&t.parentElement;if(!t||!n)return;let r=t.style.bottom;t.style.bottom=`auto`;let i=t.getBoundingClientRect();r?t.style.bottom=r:t.style.bottom=``;let a=n.getBoundingClientRect();f.current={pointerId:e.pointerId,startX:e.clientX,startY:e.clientY,startLeft:i.left-a.left,startTop:i.top-a.top,parentW:a.width,parentH:a.height,railW:i.width,railH:i.height,moved:!1};try{e.currentTarget.setPointerCapture(e.pointerId)}catch{}},[]),h=(0,J.useCallback)(e=>{let t=f.current;if(!t||e.pointerId!==t.pointerId)return;let n=e.clientX-t.startX,r=e.clientY-t.startY;if(!t.moved){if(Math.hypot(n,r)<Ee)return;t.moved=!0,p.current=!0,u(!0),document.body.style.userSelect=`none`}let i=Ce({x:t.startLeft+n,y:t.startTop+r,parentW:t.parentW,parentH:t.parentH,railW:t.railW,railH:t.railH});i&&(t.last=i,c(i))},[]),g=(0,J.useCallback)(e=>{let t=f.current;t&&e.pointerId===t.pointerId&&(f.current=null,t.moved&&(u(!1),document.body.style.userSelect=``,Te(t.last)))},[]),_=(0,J.useCallback)(()=>{c(null),Te(null)},[]),v=(0,J.useMemo)(()=>(e||[]).map(e=>({...e,title:xe(e)})),[e]);(0,J.useEffect)(()=>{let e=t;if(!e||!v.length)return;let n=()=>{let t=e.getBoundingClientRect(),n=0;for(let r of v){let i=De(e,r.blockIndex,r.round-1);i&&i.getBoundingClientRect().top-t.top<=40&&(n=r.round)}o(n)};return n(),e.addEventListener(`scroll`,n,{passive:!0}),()=>e.removeEventListener(`scroll`,n)},[t,v]);let y=(0,J.useCallback)(e=>{let r=t,i=r?De(r,e.blockIndex,e.round-1):null;i&&(i.scrollIntoView({behavior:`smooth`,block:`start`}),o(e.round)),n?.(e)},[t,n]);return v.length?(0,Y.jsxs)(`aside`,{ref:d,className:`doc-rail ack-rail`+(r?` open`:``)+(l?` dragging`:``),style:s?{left:s.x,top:s.y,right:`auto`,bottom:`auto`}:void 0,"aria-label":`验收轮次`,children:[(0,Y.jsxs)(`button`,{type:`button`,className:`doc-rail-menu`,title:r?`收起轮次(双击回默认位)`:`展开轮次 · 按住拖动 · 双击回默认位`,"aria-expanded":r,onClick:()=>{if(p.current){p.current=!1;return}i(e=>!e)},onPointerDown:m,onPointerMove:h,onPointerUp:g,onPointerCancel:g,onDoubleClick:_,children:[(0,Y.jsx)(`span`,{}),(0,Y.jsx)(`span`,{}),(0,Y.jsx)(`span`,{})]}),(0,Y.jsx)(`div`,{className:`doc-rail-ticks`,role:`navigation`,"aria-label":`验收轮次`,children:v.map(e=>(0,Y.jsx)(`button`,{type:`button`,className:`doc-rail-tick`+(a===e.round?` on`:``),style:{"--tw":`18px`},title:e.title,"aria-current":a===e.round?`true`:void 0,onClick:()=>y(e)},e.round))}),r&&(0,Y.jsx)(`div`,{className:`doc-rail-panel`,children:(0,Y.jsxs)(`div`,{className:`doc-rail-sec`,children:[(0,Y.jsx)(`div`,{className:`doc-rail-sec-lab`,children:`验收轮次`}),v.map(e=>(0,Y.jsxs)(`button`,{type:`button`,className:`doc-rail-row`+(a===e.round?` on`:``),title:e.ackText,onClick:()=>y(e),children:[`第 `,e.round,` 轮`]},e.round))]})})]}):null}var ke=[{op:`bold`,label:`B`,title:`粗体`,cls:`b`},{op:`italic`,label:`I`,title:`斜体`,cls:`i`},{op:`code`,label:`</>`,title:`代码`,cls:`code`},{op:`link`,label:`链`,title:`链接`,cls:`link`}];function Ae({at:e,onFormat:t,onCopy:n,onCompose:r,onDelete:i}){if(!e)return null;let a=e.kind||`task`,o=a===`format`||a===`both`;return(0,Y.jsx)(`div`,{id:`mdw-sel-menu`,className:`mdw-sel-menu open kind-${a}`,style:{left:e.x,top:e.y},role:`menu`,onMouseDown:e=>{e.target.closest?.(`textarea, input, button`)||e.preventDefault()},children:o?(0,Y.jsxs)(`div`,{className:`mdw-sel-fmt`,role:`group`,"aria-label":`选区格式`,children:[ke.map(e=>(0,Y.jsx)(`button`,{type:`button`,className:`mdw-sel-fmt-btn ${e.cls}`,title:e.title,onClick:()=>t?.(e.op),children:e.label},e.op)),(0,Y.jsx)(`span`,{className:`mdw-sel-sep`,"aria-hidden":!0}),(0,Y.jsx)(`button`,{type:`button`,className:`mdw-sel-fmt-btn`,title:`复制`,onClick:n,children:`复制`}),(0,Y.jsx)(`span`,{className:`mdw-sel-sep`,"aria-hidden":!0}),(0,Y.jsx)(`button`,{type:`button`,className:`mdw-sel-fmt-btn comment`,title:`评论 → 打开 md 编辑面板`,onClick:()=>r?.(),children:`评论`})]}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`div`,{className:`cap`,children:`选区`}),(0,Y.jsx)(`button`,{type:`button`,onClick:()=>r?.(),children:`评论`}),(0,Y.jsx)(`div`,{className:`sep`}),(0,Y.jsx)(`button`,{type:`button`,onClick:n,children:`复制选区`}),i?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`div`,{className:`sep`}),(0,Y.jsx)(`button`,{type:`button`,className:`danger`,title:`删除选区触到的整段块`,onClick:i,children:`删除选区`})]}):null]})})}var je=[{title:`格式`,items:[[`Ctrl/⌘ B`,`粗体`],[`Ctrl/⌘ I`,`斜体`],[`Ctrl/⌘ E`,`行内代码`],[`Ctrl/⌘ K`,`链接`],[`1 – 6`,`正文 / 标题 / 小标题 / 列表 / 待办 / 引用`]]},{title:`编辑`,items:[[`/`,`行首唤起命令菜单`],[`Tab / ⇧Tab`,`缩进 / 反缩进`],[`Enter`,`新建块(列表自动续行)`],[`⇧Enter`,`块内软换行`],[`Ctrl/⌘ Z`,`撤销`],[`Ctrl/⌘ ⇧Z`,`重做`]]},{title:`导航与文件`,items:[[`Ctrl/⌘ F`,`查找(Enter 下一个,F3 继续)`],[`Ctrl/⌘ S`,`保存并同步`],[`Ctrl/⌘ ⇧ O`,`评论任务:右侧并排打开原文`],[`Ctrl/⌘ /`,`打开 / 关闭本速查`],[`Enter(标题内)`,`跳到正文`]]}];function Me({onClose:e}){return(0,Y.jsx)(r,{title:`快捷键`,onClose:e,size:`lg`,className:`mdw-sheet`,children:(0,Y.jsx)(`div`,{className:`mdw-sheet-cols`,children:je.map(e=>(0,Y.jsxs)(`section`,{className:e.title===`导航与文件`?`wide`:void 0,children:[(0,Y.jsx)(`h4`,{children:e.title}),(0,Y.jsx)(`dl`,{children:e.items.map(([e,t])=>(0,Y.jsxs)(`div`,{className:`mdw-sheet-row`,children:[(0,Y.jsx)(`dt`,{children:(0,Y.jsx)(`kbd`,{children:e})}),(0,Y.jsx)(`dd`,{children:t})]},e))})]},e.title))})})}var Ne={origin:`起点`,reopen:`反馈`,comment:`评论`,current:`当前`};function X({nodes:e=[],onOpenNode:t}){return e.length?(0,Y.jsx)(`ol`,{className:`mdw-chain-list`,"aria-label":`任务链节点`,children:e.map((n,r)=>{let i=n.current?`current`:`t-${n.dirKey||``}-${n.id??n.taskId??r}`,a=Ne[n.kind||``]||n.kind||`?`,o=n.excerpt||n.feedback||a,s=[n.taskId==null?null:`#${n.taskId}`,n.at||null,n.attachmentCount?`📎${n.attachmentCount}`:null].filter(Boolean).join(` · `);return(0,Y.jsxs)(`li`,{className:`mdw-chain-li${n.current?` is-current`:``}`,children:[(0,Y.jsxs)(`div`,{className:`mdw-chain-rail`,"aria-hidden":!0,children:[(0,Y.jsx)(`span`,{className:`mdw-chain-dot`}),r<e.length-1?(0,Y.jsx)(`span`,{className:`mdw-chain-line`}):null]}),(0,Y.jsxs)(`button`,{type:`button`,className:`mdw-chain-card${n.kind===`comment`?` is-comment`:``}`,title:n.current?`当前任务(本页)`:`查看:${o}`,disabled:!!n.current,onClick:()=>{n.current||t?.(n)},children:[(0,Y.jsx)(`span`,{className:`mdw-chain-kind`,children:a}),(0,Y.jsx)(`span`,{className:`mdw-chain-ex`,children:o||`—`}),s?(0,Y.jsx)(`span`,{className:`mdw-chain-meta`,children:s}):null]})]},i)})}):(0,Y.jsx)(`div`,{className:`mdw-chain-empty muted`,children:`这条任务还没有链(反馈 / 评论派生后会出现)`})}function Pe({open:e,nodes:t,onOpenNode:n,onClose:i}){return e?(0,Y.jsxs)(r,{title:`任务链`,onClose:i,size:`md`,className:`mdw-chain-modal`,children:[(0,Y.jsx)(`p`,{className:`mdw-chain-hint`,children:`从早到晚排列。点非当前节点可在旁路打开内容。`}),(0,Y.jsx)(X,{nodes:t,onOpenNode:e=>{n?.(e),i?.()}})]}):null}function Fe(){let[e,t]=(0,J.useState)(()=>localStorage.getItem(`nxkv.taskDockOpen`)!==`0`),[n,r]=(0,J.useState)(()=>localStorage.getItem(`nxkv.taskDockTab`)||`attach`),[i,a]=(0,J.useState)(()=>{let e=Number(localStorage.getItem(`nxkv.taskDockH`));return Number.isFinite(e)&&e>=96?e:176}),o=(0,J.useRef)(i);o.current=i;let s=(0,J.useRef)(null),[c,l]=(0,J.useState)(!1),u=(0,J.useRef)(176);return(0,J.useEffect)(()=>{localStorage.setItem(`nxkv.taskDockOpen`,e?`1`:`0`)},[e]),(0,J.useEffect)(()=>{localStorage.setItem(`nxkv.taskDockTab`,n)},[n]),{dockOpen:e,setDockOpen:t,dockTab:n,setDockTab:r,dockH:i,dockHRef:o,dockRef:s,dockMax:c,setDockMax:l,dockPrevHRef:u,showDockTab:(0,J.useCallback)(e=>{r(e),t(!0)},[]),onDockDragStart:(0,J.useCallback)(t=>{if(!e)return;t.preventDefault(),l(!1);let n=t.clientY,r=o.current,i=s.current?.parentElement?.clientHeight||window.innerHeight,c=e=>Math.max(96,Math.min(Math.round(i*.62),Math.round(e))),u=e=>{let t=c(r-(e.clientY-n));o.current=t,a(t)},d=()=>{window.removeEventListener(`mousemove`,u),window.removeEventListener(`mouseup`,d),document.body.style.userSelect=``,document.body.style.cursor=``,localStorage.setItem(`nxkv.taskDockH`,String(o.current))};document.body.style.userSelect=`none`,document.body.style.cursor=`row-resize`,window.addEventListener(`mousemove`,u),window.addEventListener(`mouseup`,d)},[e]),toggleDockMax:(0,J.useCallback)(()=>{if(c){a(u.current),l(!1);return}u.current=o.current;let e=s.current?.parentElement?.clientHeight||window.innerHeight,t=Math.max(96,Math.round(e*.62));o.current=t,a(t),l(!0)},[c])}}function Ie({id:e,isDraft:t,topicKey:n,task:r,taskRow:i}){let[a,o]=(0,J.useState)(null);(0,J.useEffect)(()=>{o(null)},[e]);let s=i?.timegoal||null,c=a||{duration:s?.duration||``,prompt:s?.prompt||``},l=t||!!i&&i.status===`pending`,u=t||!!i&&i.status!==`done`&&i.status!==`cancelled`&&(i.status===`pending`||!!s),d=!t&&!!s&&r!=null,[f,p]=(0,J.useState)({busy:!1,error:``,data:null}),m=(0,J.useCallback)(()=>{if(t||!n||r==null)return;p(e=>({...e,busy:!0,error:``}));let e=new URLSearchParams({id:String(r),key:String(n)});U(e.toString()).then(e=>p(t=>({...t,data:e,busy:!1}))).catch(e=>p(t=>({...t,busy:!1,error:String(e.message||e)})))},[t,n,r]);return(0,J.useEffect)(()=>{d&&m()},[d,m]),{goalDraft:a,setGoalDraft:o,goal:c,goalEditable:l,goalPromptEditable:u,declaredGoal:s,goalLog:f,loadGoalLog:m,canShowGoalLog:d}}function Le({isDraft:e,task:t,taskRow:n,topicKey:r,topic:i,isGlobal:a,groupAnchored:o,groupId:s,app:l,model:u,historyId:d,toast:f}){let[p,m]=(0,J.useState)(null);(0,J.useEffect)(()=>{if(e||t==null||/^draft/i.test(String(t))){m(null);return}let n=!1,r=a?`key=${encodeURIComponent(E)}&id=${Number(t)}`:`cwd=${encodeURIComponent(i?.cwd||``)}&id=${Number(t)}`;return z(r).then(e=>{n||m(e)}).catch(()=>{n||m(null)}),()=>{n=!0}},[e,t,a,i?.cwd,n?.history?.length,n?.forkOf,n?.reopenCount]);let h=(0,J.useMemo)(()=>{if(e||!n)return[];let i=(String(n.text||``).split(`
|
|
7
|
+
`).map(e=>e.trim()).find(Boolean)||``).replace(/^#+\s*/,``).slice(0,100),a=Array.isArray(n.history)?n.history:[];if(a.length){let e=a.map(e=>({historyId:e.id,kind:e.kind,at:e.at,excerpt:e.excerpt||e.feedback||``,feedback:e.feedback,quote:e.quote,attachmentCount:(e.attachments||[]).length,current:!1}));return e.push({historyId:null,kind:`current`,at:n.lastReopenedAt||n.createdAt||``,excerpt:i,attachmentCount:0,current:!0}),e}let o=Array.isArray(p?.ancestors)?[...p.ancestors].reverse():[],s=Array.isArray(p?.children)?p.children:[];if(!o.length&&!s.length&&!n.forkOf)return[];let c=[];for(let e of o)e.missing||c.push({historyId:null,kind:e.forkKind||`origin`,at:e.createdAt||``,excerpt:e.excerpt||`#${e.id}`,attachmentCount:0,current:!1,taskId:e.id,dirKey:e.key});c.push({historyId:null,kind:`current`,at:n.createdAt||``,excerpt:i,attachmentCount:0,current:!0,taskId:Number(t),dirKey:r||`__GLOBAL__`});for(let e of s)c.push({historyId:null,kind:e.forkKind||`comment`,at:e.createdAt||``,excerpt:e.excerpt||`#${e.id}`,attachmentCount:0,current:!1,taskId:e.id,dirKey:e.key});return c},[e,n,p,t,r]),g=(0,J.useMemo)(()=>{if(d==null||!n)return null;let e=Number(d);return(n.history||[]).find(t=>Number(t.id)===e)||null},[d,n]),_=Array.isArray(p?.children)?p.children:[],v=_.length===0,y=_.length?_[_.length-1]??null:null;return{chainApi:p,chainNodes:h,historyNode:g,chainChildren:_,isChainTip:v,latestChild:y,openLatestRound:(0,J.useCallback)(()=>{y&&l.openPage&&(o?l.openPage({groupId:s,task:String(y.id),name:`#${y.id}`}):l.openPage({dirKey:String(y.key||r||`__GLOBAL__`),task:String(y.id),name:`#${y.id}`}))},[y,l.openPage,o,s,r]),openHistoryBeside:(0,J.useCallback)(n=>{let i=u||l.model;if(i&&!e){if(n?.current){f(`当前节点就是本页`);return}if(n?.historyId!=null){c(i,{component:`page`,name:`链 #${t} · ${n.kind||n.historyId}`,config:{dirKey:r||`__GLOBAL__`,task:String(t),historyId:Number(n.historyId)}});return}if(n?.taskId!=null&&n?.dirKey){c(i,{component:`page`,name:n.excerpt?String(n.excerpt).slice(0,24):`#${n.taskId}`,config:{dirKey:String(n.dirKey),task:String(n.taskId)}});return}f(`这个节点没有可打开的内容`)}},[u,l.model,e,r,t,f])}}function Re({id:e}){let[t,n]=(0,J.useState)(null),r=(0,J.useRef)(``);return(0,J.useEffect)(()=>{n(null),r.current=``},[e]),(0,J.useEffect)(()=>{let e=()=>n(null);return document.addEventListener(`scroll`,e,!0),()=>document.removeEventListener(`scroll`,e,!0)},[]),{selMenu:t,setSelMenu:n,lastSel:r,placeSelMenu:(0,J.useCallback)((e,t,i,a,o={})=>{r.current=t,n({kind:e,text:t,...o,x:Math.min(window.innerWidth-300,Math.max(8,i)),y:Math.min(window.innerHeight-240,Math.max(8,a))})},[]),onEditorTextSel:(0,J.useCallback)(e=>{if(!e?.text||e.text.length<1){n(null);return}r.current=e.text,n({kind:`format`,text:e.text,x:Math.min(window.innerWidth-300,Math.max(8,e.x)),y:Math.min(window.innerHeight-240,Math.max(8,e.y))})},[]),closeSelMenu:(0,J.useCallback)(()=>{n(null),r.current=``},[])}}function ze({id:e,taskRow:t,dockTab:n,dockOpen:r}){let[i,a]=(0,J.useState)(!1),[o,s]=(0,J.useState)(!1),c=(0,J.useRef)(null),l=String(t?.roundSummary||``).length>140;return(0,J.useEffect)(()=>{a(!1),s(!1)},[e,t?.roundSummary]),(0,J.useLayoutEffect)(()=>{let e=c.current;if(!e){s(!1);return}let t=()=>{i||s(e.scrollHeight>e.clientHeight+1)};t();let n=requestAnimationFrame(t),r=typeof ResizeObserver<`u`?new ResizeObserver(t):null;return r?.observe(e),()=>{cancelAnimationFrame(n),r?.disconnect()}},[i,t?.roundSummary,t?.completedAt,n,r]),{ackOpen:i,setAckOpen:a,ackOverflow:o,reviewSumRef:c,ackLong:l}}function Be({doc:e,id:t,isDraft:n,task:r,taskRow:a,topicKey:o,topic:c,isGlobal:u,boardCtx:m,docFm:h,groupAnchored:_,groupId:v,rows:y,app:x,model:C,tabId:D,tpl:ee,refreshLocal:A,markDirty:P,histRef:L,editorApiRef:R,attachAreaRef:ne,setDirty:z,goal:B,goalEditable:ie,goalPromptEditable:V,declaredGoal:oe,guard:U,dialog:W,showDockTab:le}){let G=i(),K=(0,J.useCallback)((e,t)=>{let n=(e||``).trim()||`未命名任务`,r=p(t),i=Object.keys(r).length>0,a=d(t);return a=g(a),a=/^#\s+/m.test(a)?a.replace(/^#\s+.+$/m,`# ${n}`):`# ${n}\n\n${a}`,i?f(a,r):a},[]),ue=(0,J.useCallback)(()=>{let e=(B.duration||``).trim(),t=(B.prompt||``).trim();if(t&&!e)return{error:`时间目标要填时长(如 2h / 90m);只写附加要求无效`};if(!n){let n=oe?.duration||``,r=oe?.prompt||``,i=e!==n;return!i&&t===r?{}:i?ie?e?{duration:e,goalPrompt:t}:{clearGoal:!0}:{error:`已领取计时,时长不可改(附加要求仍可直接改)`}:V?{goalPrompt:t}:{}}return e?{duration:e,goalPrompt:t}:{}},[B,ie,V,n,oe]),de=(0,J.useCallback)(()=>U(async()=>{if(!e)return;let i=(e.title||``).trim()||`未命名任务`,a=p(e.body),s=K(i,e.body),d=a.project?y.find(e=>!e.isGlobal&&e.repo&&e.repo.key===a.project):null,f=!!(m&&a.project&&m.members.some(e=>e.key===a.project)),h=ue();if(h.error){G(h.error);return}if(!n){let n=await q({cwd:u?d?d.cwd:void 0:c?.cwd,key:u&&!d?E:void 0,id:Number(r),text:s,...h});if(n?.moved){let a=n.key||o,c=String(n.task?.id??r),u=te(j(a),c);F(c,e.attachments),k(t,u,{title:i,body:n.task?.text||s}),C&&D&&C.doAction(l.updateNodeAttributes(D,{config:_?{groupId:v,task:c}:{dirKey:a,task:c}})),x.onNavigate&&x.onNavigate(_?`#/group/${encodeURIComponent(v||``)}?task=${encodeURIComponent(c)}`:`#/dir/${encodeURIComponent(a||``)}?task=${encodeURIComponent(c)}`),z(!1),S(L.current,u),G(`已改归属项目:任务迁到「${n.name}」#${c}`),A?.();return}F(r,e.attachments),M(t,{title:i,body:s}),z(!1),S(L.current,t),G(h.clearGoal?`已同步 MD · 时间目标已清除`:h.duration?`已同步 MD · 时间目标已更新`:`已同步 MD`),A?.();return}let g=await se({...f?{text:s,board:m.board.id,project:a.project}:a.project?{text:s,project:a.project}:u?{global:!0,text:s}:{cwd:c?.cwd,text:s},...h}),b=g?.task?.id??g?.id;if(b!=null){let n=g?.key||o,r=j(n);F(b,e.attachments);let a=te(r,String(b));k(t,a,{title:i,body:s}),C&&D&&C.doAction(l.updateNodeAttributes(D,{config:_?{groupId:v,task:String(b)}:{dirKey:n,task:String(b)}})),x.onNavigate&&x.onNavigate(_?`#/group/${encodeURIComponent(v||``)}?task=${encodeURIComponent(String(b))}`:`#/dir/${encodeURIComponent(n||``)}?task=${encodeURIComponent(String(b))}`),z(!1),S(L.current,a)}G(`已提交:${T(i)}`),A?.()}),[e,t,n,r,o,c,u,m,_,v,y,x,C,D,A,L,z,K,ue,U,G]),fe=(0,J.useCallback)(async e=>{let t=await e.text(),n=e.name.replace(/\.md$/i,``);await U(async()=>{let r=t.startsWith(`#`)?t:`# ${n}\n\n${t}`,i=await se(u?{global:!0,text:r}:{cwd:c?.cwd,text:r});G(`已导入:${e.name}`),A?.();let a=i?.task?.id??i?.id;a!=null&&x.openPage&&(_?x.openPage({groupId:v,task:String(a),name:`#${a}`}):x.openPage({dirKey:o,task:String(a),name:`#${a}`}))})},[u,_,h.project,c?.cwd,o,v,x,A,U,G]),pe=(0,J.useCallback)(async()=>{if(!e||n)return;let t=e.title||`#${r}`;await W({title:`删除任务「${t}」`,message:`软删除:CLI localtask task restore 可恢复。`,danger:!0,okText:`删除`})&&U(async()=>{await re(u?{key:E,id:Number(r)}:{cwd:c?.cwd,id:Number(r)}),G(`已删除「${t}」`),C&&D&&C.doAction(l.deleteTab(D)),A?.()})},[e,n,r,u,c,C,D,A,U,G,W]),me=!n&&!!a&&a.status===`pending`;return{composeText:K,goalPatchOf:ue,submit:de,importMd:fe,delTask:pe,canClosePending:me,closeTask:(0,J.useCallback)(t=>{me&&U(async()=>{let n=e?.title||`#${r}`,i=u?{key:E}:{cwd:c?.cwd};if(t===`done`){let e=await W({title:`标为完成「${n}」`,message:`任务还没被领取。确认把当前正文视为已完成?可写一句完成总结。`,input:!0,placeholder:`完成总结(可选;留空使用默认说明)`,okText:`标为完成`});if(e==null)return;await H({...i,ids:[Number(r)],status:`done`,summary:String(e).trim()}),G(`已标为完成 #${r}`)}else{if(!await W({title:`取消任务「${n}」`,message:`只处理待领取任务。取消为终态,原文留档。`,danger:!0,okText:`取消任务`}))return;await H({...i,ids:[Number(r)],status:`cancelled`}),G(`已取消 #${r}`)}A?.()})},[me,e,r,u,c,A,U,G,W]),addFiles:(0,J.useCallback)(async(i,a={})=>{if(!e)return;let{items:o,imageInserts:s,fileInserts:l}=await I(i),d=O(t)||e,f=d.body||``,p=s.join(``),m=f,h=null;if(p){let e=b(f,p,a);m=e.body,h=e.insertAt+p.length}l.length&&(m=b(m,l.join(``),{}).body);let g={};if(m!==f&&(g.body=m),o.length&&(g.attachments=[...d.attachments||[],...o]),Object.keys(g).length){if(M(t,g),a.mode===`edit`&&h!=null&&requestAnimationFrame(()=>{R.current?.focus?.();let e=document.querySelector(`.mdw-editor`);if(e)try{e.setSelectionRange(h,h)}catch{}}),!n){g.attachments&&F(r,g.attachments);let e=K(d.title,g.body||m);M(t,{body:e,title:w(e)});try{await q({cwd:u?void 0:c?.cwd,key:u?E:void 0,id:Number(r),text:e}),z(!1),A?.(),G(o.length?`已添加附件并同步(${o.length})`:`已同步附件`)}catch(e){P(),G(`附件已插入,同步失败:${e.message||e}`)}return}P()}},[e,t,n,r,c,u,z,A,P,K,R,G]),newTask:(0,J.useCallback)(()=>{let e=N(),t=te(j(_?v:o),e),n={};m&&m.board&&m.board.id&&(n.board=m.board.id),h.project&&(n.project=h.project),M(t,{title:``,body:f(ee?ee.defaultBody():``,n)}),x.openPage&&x.openPage(_?{groupId:v,task:e,name:`新任务`}:{dirKey:o,task:e,name:`新任务`})},[m,h.project,_,v,o,x,ee]),cloneCur:(0,J.useCallback)(()=>{if(n||r==null||/^draft/i.test(String(r))){G(`草稿没有可克隆的队列任务`);return}U(async()=>{let t=await ae(u?{id:Number(r)}:{id:Number(r),cwd:c?.cwd});G(`已克隆为新任务 #${t.task?.id??t.id}`),A?.();let n=t?.task?.id??t?.id;n!=null&&x.openPage&&(_?x.openPage({groupId:v,task:String(n),name:`${(e?.title||`任务`).slice(0,30)}(克隆)`}):x.openPage({dirKey:o,task:String(n),name:`${(e?.title||`任务`).slice(0,30)}(克隆)`}))})},[n,r,u,c,_,v,o,x,e,A,U,G]),forkCur:(0,J.useCallback)(()=>{if(n||r==null||/^draft/i.test(String(r))){G(`草稿没有可 Fork 的队列任务`);return}U(async()=>{let t=await ce(u?{id:Number(r)}:{id:Number(r),cwd:c?.cwd});G(`已 Fork 为新任务 #${t.task?.id??t.id}(保留任务链)`),A?.();let n=t?.task?.id??t?.id;n!=null&&x.openPage&&(_?x.openPage({groupId:v,task:String(n),name:`${(e?.title||`任务`).slice(0,30)}(Fork)`}):x.openPage({dirKey:o,task:String(n),name:`${(e?.title||`任务`).slice(0,30)}(Fork)`}))})},[n,r,u,c,_,v,o,x,e,A,U,G]),openProgress:(0,J.useCallback)(()=>{let e=C||x.model;if(!e)return;let t=h&&h.board?String(h.board):``;s(e,{component:`progress`,name:`进程`,config:t?{groupKey:t,task:r==null?void 0:String(r)}:{dirKey:o||`__GLOBAL__`,task:r==null?void 0:String(r)},location:`right`})},[C,x.model,h,r,o]),openAttachPanel:(0,J.useCallback)(()=>{le(`attach`),setTimeout(()=>ne.current?.open(),0)},[le,ne])}}function Ve({doc:e,isDraft:t,task:n,taskRow:r,topicKey:a,topic:o,isGlobal:s,dirKey:c,groupAnchored:u,groupId:d,app:f,model:p,tabId:m,refreshLocal:h,closeSelMenu:g,lastSel:_,selMenu:v,dirty:y,setDirty:b,guard:x}){let S=i(),C=(0,J.useCallback)(async()=>{if(t||n==null||/^draft/i.test(String(n)))return null;let e=s?`key=${encodeURIComponent(E)}&id=${Number(n)}`:`cwd=${encodeURIComponent(o?.cwd||``)}&id=${Number(n)}`;return G(e).catch(()=>null)},[t,n,s,o?.cwd]),T=(0,J.useCallback)(()=>{let t=p||f.model;t&&L(t,{mode:`feedback`,taskLabel:n==null?``:`#`+n,taskTitle:String(e?.title||``).replace(/^#+\s*/,``),prevQuote:String(r?.roundSummary||``).trim()||String(e?.body||``).trim().slice(0,400),src:{dirKey:a||c||`__GLOBAL__`,task:String(n),name:`原文 #${n}`},onSubmit:e=>D(e)})},[p,f.model,n,e,r,a,c]),D=(0,J.useCallback)(({text:i,attachments:c=[],inserts:l=``}={})=>{let p=String(i||``).trim();if(g(),!p&&!(c&&c.length)){S(`写一下反馈`);return}let m=e?.title||`#${n}`;x(async()=>{let i=await C(),g=String(i?.text??``).trim()||String(e?.body??``).trim();if(!g&&!t){S(`拿不到任务当前正文,已取消反馈(防止丢内容)`);return}let _=p||`(见附件)`;l&&(_=`${_}${l}`);let v={base:g,feedback:_,ackSummary:i?.roundSummary||r?.roundSummary||``,feedbackHeading:le,bold:!0},y=B(v),b=!t&&n!=null&&!/^draft/i.test(String(n))?{forkOf:String(n),forkKind:`reopen`}:{},x=await se(s?{global:!0,text:y,...b}:{cwd:o?.cwd,text:y,...b}),T=String(x?.task?.id??x?.id??``);if(!T){S(`反馈已提交,但未拿到新任务编号`),h?.();return}let E=x?.key||a;M(te(j(E),T),{title:w(y),body:y}),c?.length&&F(T,c),S(`已反馈「${m}」→ 新任务 #${T}`),h?.(),f.openPage&&(u?f.openPage({groupId:d,task:T,name:`${m.slice(0,24)}(反馈)`}):f.openPage({dirKey:E,task:T,name:`${m.slice(0,24)}(反馈)`}))})},[e,n,r,t,s,o,a,u,d,f,h,g,x,S,C]),O=(0,J.useCallback)(({text:r,attachments:i=[],inserts:c=``,quote:u}={})=>{let d=String(r||``).trim(),f=String(u||_.current||``).trim();if(g(),!d&&!(i&&i.length)){S(`写一下要提的问题`);return}if(!f&&!d){S(`先划选一段再评论`);return}if(t||n==null||/^draft/i.test(String(n))){S(`草稿先提交成任务再评论`);return}let v=e?.title||`#${n}`;x(async()=>{let t=!y&&!c&&!(i&&i.length),r;if(!t){let t=await C(),n=String(t?.text??``).trim()||String(e?.body??``).trim();if(!n){S(`拿不到任务当前正文,已取消评论(防止丢内容)`);return}let i={base:n,feedback:[V(f),d||`(见附件)`,c].filter(Boolean).join(`
|
|
8
|
+
|
|
9
|
+
`),ackSummary:``,feedbackHeading:ue,bold:!1};r=B(i)}let u=await fe({...s?{key:E}:{cwd:o?.cwd},id:Number(n),...r?{text:r}:{},kind:`comment`,quote:f,feedback:d,attachments:(i||[]).map(e=>({id:e.id,name:e.name,type:e.type,size:e.size,url:e.url||``}))}),g=u?.key||a,_=String(u?.task?.id??n),x=String(u?.task?.text??r??``);x&&M(te(j(g),_),{title:w(x),body:x}),i?.length&&F(_,[...e?.attachments||[],...i]),p&&m&&g!==a&&p.doAction(l.updateNodeAttributes(m,{config:{dirKey:g,task:_}})),b(!1),S(`已回写评论「${v}」#${_}`),h?.()})},[e,n,t,s,o,a,p,m,h,g,_,y,b,x,S,C]);return{fetchServerTask:C,openFeedback:T,spawnFeedbackTask:D,submitCommentInPlace:O,openCommentFromToolbar:(0,J.useCallback)(()=>{let t=String(window.getSelection()||``).trim()||(v?.text?String(v.text):``);if(!t){S(`先划选一段再评论`);return}_.current=t;let r=p||f.model;r&&(L(r,{mode:`comment`,quote:t,taskLabel:n==null?``:`#`+n,taskTitle:String(e?.title||``).replace(/^#+\s*/,``),src:{dirKey:a||c||`__GLOBAL__`,task:String(n),name:`原文 #${n}`},onSubmit:e=>O({...e,quote:t})}),g())},[e,n,a,c,p,f.model,_,v,O,g,S])}}function He({doc:e,beside:t,topicKey:n,topic:r,task:i,app:a}){let o=(0,J.useMemo)(()=>e?p(e.body):{},[e&&e.body]);return{docFm:o,parentRef:(0,J.useMemo)(()=>{if(t)return null;let a=String(o.parent||``).trim(),s=String(o.parentDir||n||``).trim();if(a&&!/^draft/i.test(a))return{dirKey:s||n,task:a,name:`#${a}`};let c=String(e?.body||``).match(/>\s*锚定自「([^」]+)」/);if(!c)return null;let l=c[1];if(!l)return null;let u=l.trim(),d=(r?.tasks||[]).find(e=>String(e.id)===String(i)?!1:w(e.text||``)===u||String(e.text||``).includes(`# ${u}`));return d?{dirKey:n,task:String(d.id),name:`#${d.id}`}:null},[t,o.parent,o.parentDir,e?.body,n,r,i]),boardCtx:(0,J.useMemo)(()=>{let e=o.board;if(!e)return null;let t=(a.repoData&&a.repoData.boards||[]).find(t=>t.id===e||t.key===e||t.name===e);if(!t)return null;let n=a.repoData&&a.repoData.repos||[],r=new Map(n.map(e=>[e.key,e]));return{board:t,members:(t.repos||[]).map(e=>r.get(e.key)).filter(e=>!!e).map(e=>({key:e.key,name:e.name}))}},[o.board,a.repoData])}}var Ue=r;function We({state:e,onClose:t}){let n=i(),r=e?.data,a=async()=>{try{await navigator.clipboard.writeText(String(r?.rendered||``)),n(`已复制原文`)}catch{n(`复制失败(剪贴板不可用)`)}},o=r?.switches||{},s=r?[`ack ${o.ack?.on?`开(${o.ack.count} 条)`:`关`}`,`交付上下文 ${o.deliveryTemplate?.custom?`自定义`:`内置默认`}`,`持续 get ${r.getLoop?.enabled?`开(${r.getLoop.waitMinutes} 分钟)`:`关`}`].join(` · `):``,c=r?`预览:agent 执行 get 会收到的提示词${r.task?.id?` · #${r.task.id}`:` · 草稿`}`:`预览:agent 执行 get 会收到的提示词`;return(0,Y.jsxs)(Ue,{title:c,size:`wide`,onClose:t,footer:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`span`,{className:`mdw-prev-hint`,children:`与 CLI 取任务共用同一份排版;不含「已取得下一条任务…」头部行。`}),(0,Y.jsx)(`span`,{className:`grow`}),(0,Y.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:a,disabled:!r,children:`复制原文`}),(0,Y.jsx)(`button`,{type:`button`,className:`btn sm`,onClick:t,children:`关闭`})]}),children:[e.busy&&(0,Y.jsx)(`div`,{className:`mdw-prev-note`,children:`渲染中…`}),e.error&&(0,Y.jsxs)(`div`,{className:`mdw-prev-note`,children:[`预览失败:`,e.error,/接口不存在/.test(String(e.error))&&(0,Y.jsx)(`div`,{className:`mdw-prev-hint`,children:`本机面板服务较旧:重启面板(结束当前 serve 进程后重新启动)即可生效,刷新页面不够。`})]}),r&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`pre`,{className:`mdw-prev-body`,children:r.rendered||``}),r.segments?.length?(0,Y.jsxs)(`details`,{className:`mdw-prev-seg`,children:[(0,Y.jsxs)(`summary`,{children:[`段落来源(`,r.segments.length,` 段)`]}),(0,Y.jsx)(`ol`,{children:r.segments.map((e,t)=>(0,Y.jsxs)(`li`,{children:[(0,Y.jsx)(`span`,{className:`mdw-prev-seg-lab`,children:e.label}),(0,Y.jsxs)(`span`,{className:`mdw-prev-seg-n`,children:[String(e.text||``).length,` 字`]})]},t))}),(0,Y.jsx)(`div`,{className:`mdw-prev-note`,children:`改这些段去「设置 → 提示词 / 模板」;「持续 get」在项目级设置里。`})]}):(0,Y.jsx)(`div`,{className:`mdw-prev-note`,children:`当前没有任何模板段:交付时就只有任务正文。`}),(0,Y.jsx)(`div`,{className:`mdw-prev-switch`,children:s})]})]})}var Ge=me;function Ke({dockOpen:e,dockTab:t,dockH:n,dockRef:r,dockMax:i,showDockTab:o,onDockDragStart:c,toggleDockMax:l,setDockOpen:u,canShowGoalLog:d,goalLog:f,openGoalLog:p,isDraft:m,task:h,topic:g,topicKey:_,isGlobal:v,doc:y,id:b,model:x,app:S,refreshLocal:w,markDirty:T,saveDoc:D,persistAtt:O,attachAreaRef:k,reviewBarRef:ee,reviewSumRef:A,taskRow:j,ackOpen:M,setAckOpen:te,ackOverflow:N,ackLong:P,ackHtml:F,isChainTip:I,latestChild:L,openFeedback:ne,openLatestRound:re}){return e?(0,Y.jsxs)(`div`,{className:`mdw-dock`,ref:r,style:{height:`${n}px`},children:[(0,Y.jsx)(`div`,{className:`mdw-dock-drag`,role:`separator`,"aria-orientation":`horizontal`,title:`上下拖动调整信息面板高度(双击最大化 / 还原)`,onMouseDown:c,onDoubleClick:l}),(0,Y.jsxs)(`div`,{className:`mdw-dock-head`,children:[(0,Y.jsxs)(`div`,{className:`mdw-dock-tabs`,role:`tablist`,"aria-label":`信息面板`,children:[(0,Y.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":t===`attach`,className:`mdw-dock-tab${t===`attach`?` is-on`:``}`,onClick:()=>o(`attach`),children:`附件`}),d?(0,Y.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":t===`check`,className:`mdw-dock-tab${t===`check`?` is-on`:``}`,onClick:p,children:[`check`,(0,Y.jsx)(`span`,{className:`mdw-dock-tab-num`,children:f.data?.count??0})]}):null,(0,Y.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":t===`feedback`,className:`mdw-dock-tab${t===`feedback`?` is-on`:``}`,onClick:()=>o(`feedback`),children:`反馈`})]}),(0,Y.jsxs)(`div`,{className:`mdw-dock-acts`,children:[(0,Y.jsx)(`button`,{type:`button`,className:`mdw-dock-act`,onClick:l,title:i?`还原面板高度`:`最大化面板高度`,"aria-label":i?`还原面板高度`:`最大化面板高度`,children:(0,Y.jsx)(a,{name:i?`collapse`:`expand`,title:void 0})}),(0,Y.jsx)(`button`,{type:`button`,className:`mdw-dock-act`,onClick:()=>u(!1),title:`关闭面板(底部状态栏仍保留入口)`,"aria-label":`关闭面板`,children:(0,Y.jsx)(a,{name:`x`,title:void 0})})]})]}),(0,Y.jsxs)(`div`,{className:`mdw-dock-body`,children:[t===`attach`?m?(0,Y.jsx)(R,{attachments:y.attachments,onRemove:e=>{let t=(y.attachments||[]).filter(t=>t.id!==e);T(),D(b,{attachments:t}),m||O(h,t)}}):g?(0,Y.jsx)(Ge,{ref:k,host:`task`,hostId:Number(h),hostKey:v?E:void 0,hostCwd:v?void 0:g.cwd,allow:{file:!0,url:!0,task:!0,ref:!0},taskOptions:(g.tasks||[]).map(e=>({id:e.id,text:e.text,status:e.status})),onChanged:w,onOpenTask:e=>{S.openPage&&e&&e.seq!=null&&S.openPage({dirKey:e.key||_,task:String(e.seq),name:`#${e.seq}`})},onOpenDoc:e=>{let t=C(e);x&&t&&s(x,{component:`doc`,name:e.split(`/`).pop()||e,config:{docId:t},location:`center`})}}):(0,Y.jsx)(`div`,{className:`mdw-dock-empty`,children:`没有可挂载附件的上下文。`}):null,t===`check`?(0,Y.jsxs)(`div`,{className:`mdw-dock-check`,children:[f.busy&&!f.data?(0,Y.jsx)(`div`,{className:`mdw-dock-empty`,children:`读取中…`}):null,f.error?(0,Y.jsxs)(`div`,{className:`mdw-dock-empty`,children:[`读取失败:`,f.error]}):null,f.data?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`div`,{className:`mdw-dock-meta mono`,children:[`时间目标 ${f.data.duration||`—`}`,f.data.startedAt?` · 开始 ${f.data.startedAt}`:``,f.data.deadline?` · 截止 ${f.data.deadline}`:` · 尚未开始计时`,f.data.archived?` · 已归档`:``,` · ${f.data.count||0} 轮`]}),(f.data.count||0)>0?(0,Y.jsx)(`div`,{className:`mdw-goal-log`,children:f.data.entries.map((e,t)=>(0,Y.jsxs)(`div`,{className:`mdw-goal-log-row`,children:[(0,Y.jsxs)(`div`,{className:`mdw-goal-log-head mono`,children:[`R`,t+1,` · `,e.checkedAt,` · `,e.reached?`已到点`:`未到点`,` · 已用`,` `,W(e.elapsedSec),` · 剩余 `,W(e.remainingSec)]}),e.summary?(0,Y.jsx)(`div`,{className:`mdw-goal-log-body`,children:e.summary}):null,e.progress?(0,Y.jsx)(`div`,{className:`mdw-goal-log-prog`,children:e.progress}):null]},`${e.checkedAt}-${t}`))}):(0,Y.jsx)(`div`,{className:`mdw-dock-empty`,children:`还没有 check 记录——任务领取后每轮 check 会出现在这里。`})]}):null]}):null,t===`feedback`?!m&&j?.completedAt?(0,Y.jsxs)(`div`,{className:`mdw-review`,ref:ee,children:[(0,Y.jsxs)(`div`,{className:`mdw-review-main`,children:[(0,Y.jsx)(`span`,{className:`mdw-review-badge`,children:`已完成 · 等待验收`}),(0,Y.jsx)(`span`,{className:`mdw-review-at mono`,children:j.completedAt}),j.roundSummary?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`div`,{ref:A,className:`mdw-review-sum${M?` is-open`:``}`,title:M||!(N||P)?`agent 的完成总结(ack)`:`点击下方展开全文`,dangerouslySetInnerHTML:{__html:F}}),(N||P||M)&&(0,Y.jsx)(`button`,{type:`button`,className:`mdw-review-more`,onClick:()=>te(e=>!e),children:M?`收起`:`展开全文`})]}):null]}),(0,Y.jsx)(`div`,{className:`mdw-review-acts`,children:I?(0,Y.jsx)(`button`,{type:`button`,className:`ghost`,onClick:ne,title:`新开一条任务携带反馈(原任务不动)`,children:`反馈`}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`span`,{className:`mdw-review-later`,title:`这条任务已有后续轮次——在旧轮次上反馈会把链分叉,请到最新一轮反馈`,children:`已进入后续轮次`}),L?(0,Y.jsxs)(`button`,{type:`button`,className:`ghost`,onClick:re,title:`到最新一轮 #${L.id} 反馈`,children:[`去最新一轮 #`,L.id]}):null]})})]}):(0,Y.jsx)(`div`,{className:`mdw-dock-empty`,children:`任务完成后,agent 的完成总结会显示在这里。`}):null]})]}):null}function qe({dockOpen:e,dockTab:t,showDockTab:n,setDockOpen:r,canShowGoalLog:i,goalLog:o,openGoalLog:s,isDraft:c,taskRow:l}){return(0,Y.jsxs)(`div`,{className:`mdw-sbar`,children:[(0,Y.jsxs)(`button`,{type:`button`,className:`mdw-sbar-item${e&&t===`attach`?` is-on`:``}`,onClick:()=>n(`attach`),title:`附件(点击展开信息面板)`,children:[(0,Y.jsx)(a,{name:`list`,title:void 0}),(0,Y.jsx)(`span`,{className:`mdw-sbar-lab`,children:`附件`})]}),i?(0,Y.jsxs)(`button`,{type:`button`,className:`mdw-sbar-item${e&&t===`check`?` is-on`:``}`,onClick:s,title:`时间目标每轮 check(点击展开信息面板)`,children:[(0,Y.jsx)(a,{name:`clock`,title:void 0}),(0,Y.jsx)(`span`,{className:`mdw-sbar-lab`,children:`check`}),(0,Y.jsx)(`span`,{className:`mdw-sbar-num`,children:o.data?.count??0})]}):null,(0,Y.jsxs)(`button`,{type:`button`,className:`mdw-sbar-item${e&&t===`feedback`?` is-on`:``}`,onClick:()=>n(`feedback`),title:`完成总结 / 反馈(点击展开信息面板)`,children:[(0,Y.jsx)(a,{name:`edit`,title:void 0}),(0,Y.jsx)(`span`,{className:`mdw-sbar-lab`,children:`反馈`})]}),(0,Y.jsx)(`span`,{className:`mdw-sbar-grow`}),!c&&l?(0,Y.jsx)(`span`,{className:`mdw-sbar-stat`,title:`任务状态`,children:(0,Y.jsx)(P,{t:l,title:void 0})}):null,(0,Y.jsx)(`button`,{type:`button`,className:`mdw-sbar-chev${e?` is-open`:``}`,onClick:()=>r(e=>!e),title:e?`收起信息面板`:`展开信息面板`,"aria-expanded":e,"aria-label":e?`收起信息面板`:`展开信息面板`,children:(0,Y.jsx)(a,{name:`chevron`,title:void 0})})]})}function Je({goal:e,setGoalDraft:t,goalEditable:n,goalPromptEditable:r,declaredGoal:i,openGoalLog:a,markDirty:o,task:s}){let c=(e.duration||``).trim(),l=(e.prompt||``).trim(),u=!!r;return{goalBadge:c||l?{label:`⏱ ${c||`目标`}`,title:l||(n?`任务级时间目标(在「更多」里设置;领取即计时)`:`已领取计时,时长不可改(附加要求仍可编辑)`)}:null,goalMenu:n||u||i?(0,Y.jsxs)(`div`,{className:`mdw-goal-menu`,children:[(0,Y.jsx)(`div`,{className:`mdw-goal-menu-lab`,children:`时间目标`}),n?(0,Y.jsx)(`input`,{className:`mdw-goal-dur mono`,value:e.duration,placeholder:`2h / 90m / 30分钟,留空不带`,onChange:n=>{t({...e,duration:n.target.value}),o()}}):(0,Y.jsxs)(`span`,{className:`mdw-goal-ro mono`,title:`已领取计时,时长不可改`,children:[i?.duration||`—`,` · 已领取计时`]}),u?(0,Y.jsx)(`input`,{className:`mdw-goal-prompt`,value:e.prompt,placeholder:`附加要求(可选;领取后仍可改,下一轮 check 即生效)`,onChange:n=>{t({...e,prompt:n.target.value}),o()}}):i?.prompt?(0,Y.jsx)(`span`,{className:`mdw-goal-ro`,title:`任务已到终态,附加要求不可改`,children:i.prompt}):null,i&&s!=null?(0,Y.jsx)(`button`,{type:`button`,className:`ghost`,onClick:a,title:`查看时间目标的每轮 check 记录`,children:`查看每轮 check 日志`}):null]}):null}}var Ye={origin:`起点`,reopen:`反馈`,comment:`评论`};function Xe({historyId:e,historyNode:t,closeBesideSelf:n}){let r=Ye[String(t?.kind??``)]||`节点`,i=t?K(t.text||``,t.attachments||[]):``;return(0,Y.jsxs)(`div`,{className:`mdw is-beside`,children:[(0,Y.jsxs)(`div`,{className:`mdw-beside-h`,children:[(0,Y.jsxs)(`span`,{className:`mdw-beside-lab`,children:[`链节点 · `,r,` #`,e]}),(0,Y.jsx)(`span`,{className:`grow`}),(0,Y.jsx)(`button`,{type:`button`,className:`iconbtn`,title:`关闭`,"aria-label":`关闭`,onClick:n,children:`×`})]}),(0,Y.jsx)(`div`,{className:`mdw-hist-ro`,children:t?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`div`,{className:`mdw-hist-meta`,children:[(0,Y.jsx)(`span`,{children:t.at||`—`}),t.quote?(0,Y.jsxs)(`span`,{children:[`锚定:`,t.quote.slice(0,80)]}):null,t.feedback?(0,Y.jsxs)(`span`,{children:[`反馈:`,t.feedback.slice(0,80)]}):null,t.summary?(0,Y.jsxs)(`span`,{children:[`上轮总结:`,t.summary.slice(0,80)]}):null]}),(0,Y.jsx)(`article`,{className:`md-body`,dangerouslySetInnerHTML:{__html:i||`<p class="muted">(空)</p>`}})]}):(0,Y.jsxs)(`div`,{className:`muted`,children:[`找不到链节点 #`,e]})})]})}function Ze({boardCtx:e,docFm:t,goalEditable:n,doc:r,id:i,markDirty:a}){if(!e)return null;let o=e.members.find(e=>e.key===t.project);return(0,Y.jsxs)(`div`,{className:`mdw-goal`,children:[(0,Y.jsx)(`span`,{className:`mdw-goal-lab`,title:`归属项目(限本组成员):决定提交进哪个项目的队列;由组面板「新增任务」创建时自动携带本组语义`,children:`归属项目`}),n?(0,Y.jsx)(`select`,{className:`mdw-proj-pick`,value:t.project||``,onChange:n=>{M(i,{body:f(r.body,{...t,board:e.board.id,project:n.target.value})}),a()},children:e.members.map(e=>(0,Y.jsx)(`option`,{value:e.key,children:e.name},e.key))}):(0,Y.jsx)(`span`,{className:`mdw-proj-ro`,title:`归属项目(在本组创建时写入,随任务走)`,children:o?.name||t.project||`—`})]})}function Qe({task:e,app:t,groupAnchored:n,groupId:r,isGlobal:i,dirKey:a}){return(0,Y.jsx)(`div`,{className:`mdw`,children:(0,Y.jsxs)(`div`,{className:`pad stack`,children:[(0,Y.jsx)(`div`,{children:(0,Y.jsxs)(`strong`,{children:[`找不到任务 #`,e]})}),(0,Y.jsx)(`div`,{className:`hint`,children:`它可能已被删除(软删除可用 nx-kv localtask task restore 恢复),或这个深链写错了。`}),(0,Y.jsx)(`div`,{children:(0,Y.jsx)(`button`,{className:`btn ghost sm`,onClick:()=>t.onNavigate&&t.onNavigate(n?`#/group/`+encodeURIComponent(r||``):i?`#/global`:`#/dir/`+encodeURIComponent(a||``)),children:`回到目录`})})]})})}function $e({onClose:e}){return(0,Y.jsxs)(`div`,{className:`mdw-beside-h`,children:[(0,Y.jsx)(`span`,{className:`mdw-beside-lab`,children:`原文(旁路)`}),(0,Y.jsx)(`span`,{className:`grow`}),(0,Y.jsx)(`button`,{type:`button`,className:`iconbtn`,title:`关闭原文面板`,"aria-label":`关闭原文面板`,onClick:e,children:`×`})]})}var et=Pe;function Z({dirKey:e,groupId:t,task:r,beside:a=!1,tabId:o,model:s,historyId:d=null}){let p=u(),g=i(),{dialog:b,node:S}=n(),C=p.rows||[],T=p.refreshLocal,O=p.tpl,k=!(!t||e),N=(0,J.useMemo)(()=>k?de(C,p.repoData&&p.repoData.boards||[],t,r):null,[k,C,p.repoData,t,r]),P=N&&N.topic&&N.topic.key||e||``,I=!k&&(!P||P===`__GLOBAL__`),R=A(r),re=j(k&&R?t:P),z=te(re,r),B=(0,J.useMemo)(()=>k?N&&N.topic||null:I?C.find(e=>e.isGlobal)||null:C.find(e=>e.key===P)||null,[C,P,I,k,N]),V=(0,J.useMemo)(()=>(B?.tasks||[]).find(e=>String(e.id)===String(r))||null,[B,r]),ae=ee(),H=ae[z]||null,U=H&&H.mode===`edit`?`edit`:`split`,{dockOpen:se,setDockOpen:ce,dockTab:W,dockH:le,dockRef:G,dockMax:ue,showDockTab:q,onDockDragStart:fe,toggleDockMax:me}=Fe(),{goalDraft:he,setGoalDraft:ge,goal:_e,goalEditable:ve,goalPromptEditable:ye,declaredGoal:xe,goalLog:Se,loadGoalLog:Ce,canShowGoalLog:we}=Ie({id:z,isDraft:R,topicKey:P,task:r,taskRow:V}),{chainNodes:Te,historyNode:Ee,isChainTip:De,latestChild:ke,openLatestRound:je,openHistoryBeside:Ne}=Le({isDraft:R,task:r,taskRow:V,topicKey:P,topic:B,isGlobal:I,groupAnchored:k,groupId:t,app:p,model:s||null,historyId:d,toast:g}),{selMenu:X,setSelMenu:Pe,lastSel:Ue,placeSelMenu:Ge,onEditorTextSel:Ye,closeSelMenu:Z}=Re({id:z}),{ackOpen:tt,setAckOpen:nt,ackOverflow:rt,reviewSumRef:it,ackLong:at}=ze({id:z,taskRow:V,dockTab:W,dockOpen:se}),[ot,st]=(0,J.useState)(null),[ct,lt]=(0,J.useState)(!1),[ut,dt]=(0,J.useState)(!1),[ft,pt]=(0,J.useState)(!1),mt=(0,J.useRef)(null),ht=(0,J.useRef)(null),gt=(0,J.useRef)(null),_t=(0,J.useRef)(null),vt=(0,J.useRef)(null),yt=(0,J.useRef)(null),bt=(0,J.useRef)(new Map),[xt,St]=(0,J.useState)([]);(0,J.useEffect)(()=>{let e=!0,t=V;if(!t||!t.id)return;let n=new URLSearchParams({id:String(t.id)});return P?n.set(`key`,P):t.cwd&&n.set(`cwd`,t.cwd),oe(n.toString()).then(t=>{e&&St(t&&(t.attachments||t.data?.attachments)||[])}).catch(()=>{e&&St([])}),()=>{e=!1}},[V,P]);let Ct=(0,J.useMemo)(()=>H?K(h(H.body),xt.length?xt:H.attachments):``,[H,xt]),wt=(0,J.useMemo)(()=>V?.roundSummary?K(V.roundSummary):``,[V?.roundSummary]),Tt=(0,J.useMemo)(()=>H?be(H.body):[],[H&&H.body]),[Et,Dt]=(0,J.useState)(null);(0,J.useEffect)(()=>{let e=_t.current;if(!e)return;let t=()=>e.closest(`.mdw-lp`)||e.closest(`.mdw-preview`)||null;Dt(t());let n=typeof MutationObserver<`u`?new MutationObserver(()=>Dt(t())):null;return n?.observe(e,{childList:!0,subtree:!0}),()=>n?.disconnect()},[H&&H.mode]);let Ot=(0,J.useCallback)(e=>e().catch(e=>g(String(e.message||e))),[g]),Q=(0,J.useCallback)(()=>pt(!0),[]),{docFm:kt,parentRef:$,boardCtx:At}=He({doc:H,beside:a,topicKey:P,topic:B,task:r,app:p});(0,J.useEffect)(()=>{ae[z]||(R?D(z,{title:``,body:O?k?f(O.defaultBody(),{board:t}):O.defaultBody():``}):V&&D(z,{title:w(V.text),body:V.text}))},[z,R,V,k,t]);let{composeText:jt,submit:Mt,importMd:Nt,delTask:Pt,canClosePending:Ft,closeTask:It,addFiles:Lt,newTask:Rt,cloneCur:zt,forkCur:Bt,openProgress:Vt,openAttachPanel:Ht}=Be({doc:H,id:z,isDraft:R,task:r,taskRow:V,topicKey:P,topic:B,isGlobal:I,boardCtx:At,docFm:kt,groupAnchored:k,groupId:t,rows:C,app:p,model:s||null,tabId:o,tpl:O,refreshLocal:T,markDirty:Q,histRef:bt,editorApiRef:yt,attachAreaRef:gt,setDirty:pt,goal:_e,goalEditable:ve,goalPromptEditable:ye,declaredGoal:xe,guard:Ot,dialog:b,showDockTab:q}),{openFeedback:Ut,submitCommentInPlace:Wt,openCommentFromToolbar:Gt}=Ve({doc:H,isDraft:R,task:r,taskRow:V,topicKey:P,topic:B,isGlobal:I,dirKey:e,groupAnchored:k,groupId:t,app:p,model:s||null,tabId:o,refreshLocal:T,closeSelMenu:Z,lastSel:Ue,selMenu:X,dirty:ft,setDirty:pt,guard:Ot}),Kt=(0,J.useCallback)(()=>{q(`check`),Ce()},[q,Ce]),{goalBadge:qt,goalMenu:Jt}=Je({goal:_e,goalDraft:he,setGoalDraft:ge,goalEditable:ve,goalPromptEditable:ye,declaredGoal:xe,openGoalLog:Kt,markDirty:Q,task:r}),Yt=(0,J.useCallback)(()=>{st({busy:!0});let e={cwd:I?B?.cwd||void 0:B?.cwd,key:I?E:P,...R?{text:jt((H?.title||``).trim()||`未命名任务`,H?.body||``)}:{id:Number(r)}};ie(e).then(e=>st({data:e})).catch(e=>st({error:String(e.message||e)}))},[I,B?.cwd,P,R,H?.title,H?.body,r,jt]),Xt=(e,t=`typing`)=>{if(!H)return;y(bt.current,z,{title:H.title,body:H.body},t),Q();let n={title:e};U!==`split`&&/^# (?!#)/m.test(H.body)&&(n.body=H.body.replace(/^# (?!#).+$/m,`# ${e||`未命名任务`}`)),M(z,n)},Zt=(e,t=`op`)=>{if(!H)return;y(bt.current,z,{title:H.title,body:H.body},t),Q();let n={body:e};U!==`split`&&(n.title=w(e)),M(z,n)},Qt=()=>{if(!H)return;let e=_(bt.current,z,{title:H.title,body:H.body});e&&(M(z,{title:e.title,body:e.body}),Q(),requestAnimationFrame(()=>yt.current?.caretFromDiff?.(H.body,e.body)))},$t=()=>{if(!H)return;let e=x(bt.current,z,{title:H.title,body:H.body});e&&(M(z,{title:e.title,body:e.body}),Q(),requestAnimationFrame(()=>yt.current?.caretFromDiff?.(H.body,e.body)))},en=e=>{if(!H||U===`edit`)return;let t=e.target instanceof Element?e.target:null;if(t?.closest(`#mdw-sel-menu`)||t?.closest(`textarea`))return;let n=window.getSelection(),r=String(n||``).trim();if(!r||r.length<1){Pe(null);return}if(!n)return;if(!_t.current?.contains(n.anchorNode)){Pe(null);return}let i=e=>e?.nodeType===3?e.parentElement:e,a=i(n.anchorNode)?.closest?.(`.mdw-lp-block`),o=i(n.focusNode)?.closest?.(`.mdw-lp-block`),s=null;if(a&&o&&a!==o&&_t.current?.contains(o)){let e=Number(a.getAttribute(`data-i`)),t=Number(o.getAttribute(`data-i`));Number.isInteger(e)&&Number.isInteger(t)&&e!==t&&(s=[Math.min(e,t),Math.max(e,t)])}let c=n.getRangeAt(0),l=c.getClientRects(),u=l[l.length-1]??c.getBoundingClientRect();Ge(`task`,r,u.right-60,u.bottom+8,s?{blockRange:s}:{})},tn=(0,J.useCallback)(()=>{if(!$){g(`这条任务没有可定位的原文`);return}let e=s||p.model;e&&c(e,{component:`page`,name:$.name||`原文 ${$.task}`,config:{dirKey:$.dirKey,task:String($.task)}})},[$,s,p.model,g]),nn=(0,J.useCallback)(()=>{let e=s||p.model;e&&o&&e.doAction(l.deleteTab(o))},[s,p.model,o]),rn=e=>{ht.current&&(ht.current.accept=e),ht.current?.click()};return(0,J.useEffect)(()=>{if(!$||a)return;let e=e=>{(e.ctrlKey||e.metaKey)&&e.shiftKey&&String(e.key||``).toLowerCase()===`o`&&(e.preventDefault(),tn())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[$,a,tn]),d==null?H?(0,Y.jsxs)(`div`,{className:`mdw${a?` is-beside`:``}`,"data-mode":U,onMouseUp:en,children:[S,ot&&(0,Y.jsx)(We,{state:ot,onClose:()=>st(null)}),(0,Y.jsx)(et,{open:ut,nodes:Te,onOpenNode:Ne,onClose:()=>dt(!1)}),a&&(0,Y.jsx)($e,{onClose:nn}),(0,Y.jsxs)(`div`,{className:`mdw-main`,children:[(0,Y.jsxs)(`div`,{className:`mdw-top`,children:[(0,Y.jsx)(ne,{}),(0,Y.jsxs)(`div`,{className:`mdw-head`,children:[(0,Y.jsx)(`div`,{className:`mdw-title`,children:R?H.title||`新 MD 任务`:H.title||`任务`}),(0,Y.jsxs)(`div`,{className:`mdw-path`,children:[I?`全局任务池`:B?.cwd||B?.name||`—`,R?` / (${r})`:` / #${r}`,ft?` · 未保存`:``]})]})]}),(0,Y.jsx)(Ze,{boardCtx:At,docFm:kt,goalEditable:ve,doc:H,id:z,markDirty:Q}),(0,Y.jsx)(pe,{mode:U,onMode:e=>M(z,{mode:e}),showMark:U!==`edit`,submitLabel:R?`提交为任务`:`保存并同步`,onNew:Rt,onSubmit:Mt,onChain:R?null:()=>dt(!0),onPreview:Yt,onImg:()=>rn(`image/*`),onAtt:()=>R?rn(`image/*,.pdf,.zip,.txt,.json,.csv`):Ht(),onImport:()=>mt.current?.click(),onClone:R?null:zt,onFork:R?null:Bt,onComplete:Ft?()=>It(`done`):null,onCancelTask:Ft?()=>It(`cancel`):null,onMark:Gt,onDraft:()=>g(`草稿随页签保留(刷新后需从侧栏或页签重新打开)`),onDelete:R?null:Pt,onOverview:()=>p.onNavigate&&p.onNavigate(`#/overview`),onProg:Vt,onSource:$?tn:null,onShortcuts:()=>lt(!0),goalBadge:qt,goalMenu:Jt}),(0,Y.jsx)(m,{ref:_t,mode:U,title:H.title,body:H.body,previewHtml:Ct,onTitle:Xt,onBody:Zt,attachments:xt.length?[...H.attachments,...xt]:H.attachments,docKey:z,editorApiRef:yt,onFiles:Lt,onTextSel:Ye,onSave:Mt,onUndo:Qt,onRedo:$t,onCloseSelMenu:Z,attachHost:R?null:{host:`task`,hostId:Number(r),hostKey:I?E:void 0,hostCwd:I?void 0:B?.cwd,allow:{file:!0,url:!0,task:!0,ref:!0},taskOptions:(B?.tasks||[]).map(e=>({id:e.id,text:e.text,status:e.status}))}}),(0,Y.jsx)(Ke,{dockOpen:se,dockTab:W,dockH:le,dockRef:G,dockMax:ue,showDockTab:q,onDockDragStart:fe,toggleDockMax:me,setDockOpen:ce,canShowGoalLog:we,goalLog:Se,openGoalLog:Kt,isDraft:R,task:r,topic:B,topicKey:P,isGlobal:I,doc:H,id:z,model:s||null,app:p,refreshLocal:T,markDirty:Q,saveDoc:M,persistAtt:F,attachAreaRef:gt,reviewBarRef:vt,reviewSumRef:it,taskRow:V,ackOpen:tt,setAckOpen:nt,ackOverflow:rt,ackLong:at,ackHtml:wt,isChainTip:De,latestChild:ke,openFeedback:Ut,openLatestRound:je}),(0,Y.jsx)(qe,{dockOpen:se,dockTab:W,showDockTab:q,setDockOpen:ce,canShowGoalLog:we,goalLog:Se,openGoalLog:Kt,isDraft:R,taskRow:V})]}),(0,Y.jsx)(Oe,{nodes:Tt,scrollRoot:Et}),(0,Y.jsx)(Ae,{at:X,onFormat:e=>{yt.current?.format?.(e),Z()},onCompose:()=>{let t=s||p.model;if(!t)return;let n=String(X?.text||Ue.current||``);L(t,{mode:`comment`,quote:n,taskLabel:r==null?``:`#`+r,taskTitle:String(H?.title||``).replace(/^#+\s*/,``),src:{dirKey:P||e||`__GLOBAL__`,task:String(r),name:`原文 #${r}`},onSubmit:e=>Wt({...e,quote:n})}),Z()},onCopy:()=>{let e=X?.blockRange,t=``;if(e&&H){let n=v(H.body);e[1]<n.length&&(t=n.slice(e[0],e[1]+1).filter(e=>String(e??``).trim()).join(`
|
|
10
|
+
|
|
11
|
+
`))}navigator.clipboard?.writeText(t||Ue.current||X?.text||``),g(`已复制`),Z()},onDelete:X?.blockRange?()=>{let e=X.blockRange;e&&(yt.current?.deleteBlockRange?.(e[0],e[1])?g(`已删除 ${e[1]-e[0]+1} 个块(Ctrl+Z 可撤销)`):g(`选区已失效`),Z())}:void 0}),(0,Y.jsx)(`input`,{ref:ht,type:`file`,multiple:!0,hidden:!0,onChange:e=>{let t=Array.from(e.target.files||[]);e.target.value=``,t.length&&Lt(t)}}),(0,Y.jsx)(`input`,{ref:mt,type:`file`,accept:`.md,text/markdown,text/plain`,hidden:!0,onChange:e=>{let t=e.target.files?.[0];e.target.value=``,t&&Nt(t)}}),ct&&(0,Y.jsx)(Me,{onClose:()=>lt(!1)})]}):p.localReady===!1||R?(0,Y.jsx)(`div`,{className:`mdw`,children:(0,Y.jsx)(`div`,{className:`pad muted`,children:`载入中…`})}):(0,Y.jsx)(Qe,{task:r,app:p,groupAnchored:k,groupId:t,isGlobal:I,dirKey:e}):(0,Y.jsx)(Xe,{historyId:d,historyNode:Ee,closeBesideSelf:nn})}export{Z as default};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import{m as e}from"./task-status-DSrx0i66.js";import{v as t}from"./md-history-0GBWw4qr.js";import{n,o as r}from"./board-view-DABoVkaA.js";function i(t){return e(`/api/localtasks/chain?${t}`)}function a(t){return e(`/api/localtasks/timegoal-log?${t}`)}function o(t){return e(`/api/localtasks/reorder`,{method:`PATCH`,body:t})}function s(t){return e(`/api/localtasks/item`,{method:`PATCH`,body:t})}function c(t){return e(`/api/localtasks/item?${t}`).catch(()=>null)}function l(t){return e(`/api/localtasks`,{method:`POST`,body:t})}function u(t){return e(`/api/localtasks/reopen`,{method:`POST`,body:t})}function d(t){return e(`/api/localtasks/item`,{method:`DELETE`,body:t})}function f(t){return e(`/api/localtasks/items`,{method:`DELETE`,body:t})}function p(t){return e(`/api/localtasks/items/cancel`,{method:`POST`,body:t})}function m(t){return e(`/api/localtasks/items/close`,{method:`POST`,body:t})}function h(t){return e(`/api/localtasks/tasks/restore`,{method:`POST`,body:t})}function g(t){return e(`/api/localtasks/clone`,{method:`POST`,body:t})}function _(t){return e(`/api/localtasks/fork`,{method:`POST`,body:t})}function v(t){return e(`/api/localtasks/attachments?${t}`)}function y(t){return e(`/api/localtasks/preview`,{method:`POST`,body:t})}var b=`## 验收反馈`,x=`## 反馈修改`;function S(e){return String(e??``).split(`
|
|
2
|
+
`).map(e=>e.trim()?`**${e}**`:e).join(`
|
|
3
|
+
`)}function C(e){let t=String(e??``).trim();return t?`> 锚定:\n> ${t.replace(/\n/g,`
|
|
4
|
+
> `)}`:``}var w=`NOTE`,T=`WARNING`,E=/完成总结/,D=/第\s*(\d+)\s*轮/,O=/^>\s*\[![A-Za-z][\w-]*\][ \t]*(.*)$/;function k(e){return`第 ${Number(e)||1} 轮 · 完成总结`}function A(e){return`第 ${Number(e)||1} 轮 · 验收反馈`}function j(e){return String(e??``).split(`
|
|
5
|
+
`).map(e=>e.trim()?`> ${e}`:`>`).join(`
|
|
6
|
+
`)}function M({round:e,ack:t}={}){let n=String(t??``).trim();return n?`> [!${w}] ${k(e)}\n${j(n)}`:``}function N({round:e,quote:t,feedback:n,bold:r=!1}={}){let i=String(n??``).trim();if(!i)return``;let a=r?S(i):i,o=C(t),s=o?`${o.replace(/^> ?/gm,``)}\n\n${a}`:a;return`> [!${T}] ${A(e)}\n${j(s)}`}function P(e){let t=String(e??``),n=0,r=0,i=t.match(/^## 上一轮完成总结\s*$/gm);n+=i?i.length:0;for(let e of t.matchAll(/^>\s*\[![A-Za-z][\w-]*\][ \t]*(.*)$/gm)){let t=String(e[1]??``);if(!E.test(t))continue;n+=1;let i=t.match(D);i&&(r=Math.max(r,Number(i[1])))}return Math.max(n,r)}function F(e){return P(e)+1}function I(e,t){let n=String(e??``),r=String(t??``).trim();if(!r||!n)return!1;if(n.includes(`## 上一轮完成总结\n\n${r}`))return!0;let i=n.split(`
|
|
7
|
+
`);for(let e=0;e<i.length;e++){let t=(i[e]??``).match(O);if(!t||!E.test(String(t[1]??``)))continue;let n=[];for(let t=e+1;t<i.length&&(i[t]??``).startsWith(`>`);t++)n.push((i[t]??``).replace(/^>[ \t]?/,``));if(n.join(`
|
|
8
|
+
`).trim()===r)return!0}return!1}function L({base:e,ack:t,quote:n,feedback:r,bold:i=!0,round:a}={}){let o=String(e??``).trimEnd(),s=Number(a)||F(o),c=[];o&&c.push(o);let l=String(t??``).trim();l&&!I(o,l)&&c.push(M({round:s,ack:l}));let u=N({round:s,quote:n,feedback:r,bold:i});return u&&c.push(u),c.length?`${c.join(`
|
|
9
|
+
|
|
10
|
+
`)}\n`:``}function R({base:e,feedback:t,ackSummary:n,feedbackHeading:r=b,bold:i=!0,round:a}={}){if(String(r??``)===`## 反馈修改`){let n=[],a=String(e??``).trim();a&&n.push(a);let o=String(t??``).trim();return o&&n.push(`${r}\n\n${i?S(o):o}`),n.length?`${n.join(`
|
|
11
|
+
|
|
12
|
+
`)}\n`:``}return L({base:e,ack:n,feedback:t,bold:i,round:a})}function z(e){let t=Math.max(0,Number(e)||0);return t>=3600?`${Math.floor(t/3600)}h ${Math.floor(t%3600/60)}m`:t>=60?`${Math.floor(t/60)}m ${t%60}s`:`${t}s`}var B=t,V=r,H=n;function U(e,t,n,r){return H(e,t,n,r)}export{o as C,d as S,i as _,R as a,y as b,C as c,g as d,m as f,v as g,a as h,V as i,l,_ as m,z as n,b as o,c as p,B as r,x as s,U as t,p as u,s as v,h as w,f as x,u as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as e,h as t,p as n,y as r}from"./task-status-DSrx0i66.js";import{n as i,v as a}from"./workspace-4tw7trV7.js";import{n as o}from"./app-context-BASCGAA-.js";import{a as s,i as c,n as l,r as u,t as d,v as f}from"./md-history-
|
|
1
|
+
import{g as e,h as t,p as n,y as r}from"./task-status-DSrx0i66.js";import{n as i,v as a}from"./workspace-4tw7trV7.js";import{n as o}from"./app-context-BASCGAA-.js";import{a as s,i as c,n as l,r as u,t as d,v as f}from"./md-history-0GBWw4qr.js";import{i as p,t as m}from"./index-BkLkooKe.js";import{t as h}from"./route-crumb-QvahotvN.js";var g=r(e(),1),_=t(),v=e=>`tpl:${e||`new`}`;function y({templateId:e,initialName:t,initialBody:r,isNew:i,onSave:a,onClose:o,busy:p}){let m=n(),[y,b]=(0,g.useState)(t||``),[x,S]=(0,g.useState)(r||``),[C,w]=(0,g.useState)(`split`),[T,E]=(0,g.useState)(!1),D=(0,g.useRef)(null),O=(0,g.useRef)(new Map),k=v(i?`new`:e),A=(0,g.useMemo)(()=>f(x||``),[x]),j=(e,t,n=`typing`)=>{l(O.current,k,{title:y,body:x},n),b(e),S(t),E(!0)},M=(e,t=`typing`)=>j(e,x,t),N=(e,t=`op`)=>j(y,e,t),P=()=>{let e=c(O.current,k,{title:y,body:x});e&&(b(e.title||``),S(e.body||``),E(!0))},F=()=>{let e=u(O.current,k,{title:y,body:x});e&&(b(e.title||``),S(e.body||``),E(!0))},I=async()=>{if(!(y||``).trim()){m(`模板名不能为空(标题即名称)`);return}await a({name:y.trim(),body:x}),d(O.current,k),E(!1)};return(0,_.jsx)(`div`,{className:`mdw mdw-tpl-edpage`,"data-mode":C,children:(0,_.jsxs)(`div`,{className:`mdw-main`,children:[(0,_.jsxs)(`div`,{className:`mdw-top`,children:[(0,_.jsx)(h,{}),(0,_.jsxs)(`div`,{className:`mdw-head`,children:[(0,_.jsx)(`div`,{className:`mdw-title`,children:i?`新建模板`:`编辑模板`}),(0,_.jsxs)(`div`,{className:`mdw-path`,children:[`任务模板`,y?` / ${y}`:``,T?` · 未保存`:``]})]})]}),(0,_.jsxs)(`div`,{className:`mdw-toolbar`,children:[(0,_.jsx)(`div`,{className:`mdw-toolbar-left`,children:(0,_.jsx)(`div`,{className:`seg`,role:`group`,"aria-label":`编辑模式`,children:[{id:`split`,label:`并排`},{id:`edit`,label:`源码`}].map(e=>(0,_.jsx)(`button`,{type:`button`,className:C===e.id?`on`:``,onClick:()=>w(e.id),children:e.label},e.id))})}),(0,_.jsxs)(`div`,{className:`mdw-actions`,role:`group`,"aria-label":`模板操作`,children:[(0,_.jsx)(`button`,{type:`button`,className:`btn ghost sm`,disabled:p,onClick:o,children:`关闭`}),(0,_.jsx)(`button`,{type:`button`,className:`btn sm primary`,disabled:p||!T,onClick:I,children:i?`创建`:`保存`})]})]}),(0,_.jsx)(s,{mode:C,title:y,body:x,previewHtml:A,onTitle:M,onBody:N,docKey:k,editorApiRef:D,onSave:I,onUndo:P,onRedo:F,attachments:[]})]})})}function b({config:e,model:t,tabId:r}){let s=o(),c=s.tpl,l=n(),[u,d]=(0,g.useState)(!1),f=e||{},v=(f.mode||(f.id?`edit`:``))===`new`,b=f.id||``,x=()=>{let e=m();if(e&&s.onNavigate){s.onNavigate(e);return}if(s.onNavigate){s.onNavigate(`#/overview`);return}if(t&&r)try{t.doAction(a.deleteTab(r))}catch{}};if(!c)return(0,_.jsxs)(`div`,{className:`mdw-tpl-panel`,children:[(0,_.jsx)(h,{}),(0,_.jsx)(`div`,{className:`pad muted`,children:`模板服务未就绪 —— 面板还在装载。`})]});if(!v&&!b)return(0,_.jsxs)(`div`,{className:`mdw-tpl-panel`,children:[(0,_.jsx)(h,{}),(0,_.jsxs)(`div`,{className:`pad stack`,children:[(0,_.jsx)(`div`,{children:`模板在「设置 → 任务模板」管理;这里只承载全屏编辑。`}),(0,_.jsx)(`div`,{children:(0,_.jsx)(`button`,{type:`button`,className:`btn primary`,onClick:()=>{t&&i(t,{component:`settings`,name:`设置`,config:{}}),x()},children:`打开设置`})})]})]});let S=v?null:(c.templates||[]).find(e=>e.id===b);if(!v&&!S)return(0,_.jsxs)(`div`,{className:`mdw-tpl-panel`,children:[(0,_.jsx)(h,{}),(0,_.jsxs)(`div`,{className:`pad muted`,children:[`找不到模板「`,b,`」——可能已删除。`]})]});let C=async({name:e,body:t})=>{d(!0);try{if(v){let n={};Array.isArray(f.scope)&&(n.scope=f.scope),f.topic&&(n.topic=f.topic),await c.add(e,t,!1,n),l(`已创建模板`)}else await c.update(b,{name:e,body:t}),l(`已保存模板`);x()}catch(e){l(String(e.message||e))}finally{d(!1)}},w=v?f.name||``:S?.name??``,T=v?``:p(S?.body||``,S?.values||{});return(0,_.jsx)(y,{templateId:b,initialName:w,initialBody:T,isNew:v,busy:u,onSave:C,onClose:x},v?`new:${f.topic||``}:${(f.scope||[]).join(`,`)}`:b)}export{b as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as e,h as t,l as n,m as r,o as i,p as a,y as o}from"./task-status-DSrx0i66.js";import{w as s}from"./workspace-4tw7trV7.js";import{c,d as l,f as u,l as d,o as f,s as p}from"./md-history-BqZvzWiD.js";import{n as m,o as h}from"./upload-BcMhRsMn.js";var g=o(e(),1),_=t(),v=i,y={position:(e,t)=>(e.position||0)-(t.position||0)||String(e.id).localeCompare(String(t.id)),name:(e,t)=>String(e.name||``).localeCompare(String(t.name||``)),kind:(e,t)=>String(e.kind).localeCompare(String(t.kind))||String(e.name||``).localeCompare(String(t.name||``))};function b(e,{onRemove:t,onPreview:n,onOpenTask:r,onOpenDoc:i,onEditNote:a,onReplace:o}){let s=e.kind===`image`?d(e.id):``;return(0,_.jsxs)(`div`,{className:`att-item att-kind-${e.kind}`,children:[e.kind===`image`?(0,_.jsx)(`button`,{type:`button`,className:`att-thumb`,onClick:()=>n({src:s,name:e.name}),title:`点击看大图`,children:(0,_.jsx)(`img`,{src:s,alt:e.name,loading:`lazy`})}):(0,_.jsx)(`span`,{className:`att-kind-badge`,children:c(e.kind)}),(0,_.jsxs)(`span`,{className:`att-item-main`,children:[e.kind===`task`?(0,_.jsx)(`button`,{type:`button`,className:`att-link`,title:`跳转到任务 #${e.targetSeq??``}`,onClick:()=>r?.({key:e.targetKey,seq:e.targetSeq}),children:e.name}):e.kind===`ref`?(0,_.jsx)(`button`,{type:`button`,className:`att-link`,title:e.locator||e.targetRef||`打开文档`,onClick:()=>i?.(e.locator||e.targetRef),children:e.name}):e.kind===`url`?(0,_.jsx)(`a`,{className:`att-link`,href:e.url,target:`_blank`,rel:`noreferrer`,title:e.url,children:e.name}):(0,_.jsx)(`span`,{className:`att-item-name`,title:e.name,children:e.name}),(0,_.jsxs)(`span`,{className:`att-item-meta`,children:[e.sizeText?(0,_.jsx)(`span`,{children:e.sizeText}):null,e.note?(0,_.jsx)(`span`,{className:`att-note`,children:e.note}):null]})]}),e.kind===`file`||e.kind===`image`?(0,_.jsxs)(`span`,{className:`att-item-acts`,children:[(0,_.jsx)(`a`,{className:`att-act`,href:d(e.id),target:`_blank`,rel:`noreferrer`,children:`打开`}),(0,_.jsx)(`a`,{className:`att-act`,href:d(e.id),download:e.name,children:`下载`})]}):null,e.kind===`ref`?(0,_.jsxs)(`span`,{className:`att-item-acts`,children:[(0,_.jsx)(`button`,{type:`button`,className:`att-act`,title:`改这条绑定的一行说明(交付清单会透出)`,onClick:()=>a?.(e),children:`✎ 说明`}),(0,_.jsx)(`button`,{type:`button`,className:`att-act`,title:`换成另一篇文档(替换这条绑定)`,onClick:()=>o?.(e),children:`⇄ 更换`})]}):null,(0,_.jsx)(`button`,{type:`button`,className:`att-x`,"aria-label":`移除 ${e.name}`,onClick:()=>t(e),children:`×`})]},e.id)}function x({host:e=`task`,hostId:t,hostKey:i,hostCwd:o,refId:s,allow:c={file:!0,url:!0,task:!1,ref:!1},taskOptions:d=[],docOptions:x,disabled:S=!1,disabledText:C=`提交任务后可以在这里挂附件(当前是草稿)。`,openRef:w,onChanged:T,onOpenTask:E,onOpenDoc:D}){let O=a(),{dialog:k,node:A}=n(),[j,M]=(0,g.useState)([]),[N,P]=(0,g.useState)(!1),[F,I]=(0,g.useState)(``),[L,R]=(0,g.useState)(!1),[z,B]=(0,g.useState)(!1),[V,H]=(0,g.useState)(!1),[U,W]=(0,g.useState)(`position`),[G,K]=(0,g.useState)(null),[q,J]=(0,g.useState)(null),[Y,ee]=(0,g.useState)(!1),[X,Z]=(0,g.useState)(null),Q=(0,g.useMemo)(()=>l(e,{hostId:t,hostKey:i,hostCwd:o,refId:s}),[e,t,i,o,s]),$=(0,g.useCallback)(async()=>{if(S){M([]);return}P(!0),I(``);try{let e=await Q.list();M((e.attachments||[]).map(u))}catch(e){I(String(e.message||e))}finally{P(!1)}},[Q,S]);(0,g.useEffect)(()=>{$()},[$]),(0,g.useImperativeHandle)(w,()=>({open:()=>R(!0),refresh:$}),[$]),(0,g.useEffect)(()=>{if(!X)return;let e=e=>{e.key===`Escape`&&Z(null)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[X]);let te=(0,g.useMemo)(()=>[...j].sort(y[U]||y.position),[j,U]),ne=te.filter(e=>e.area===`inline`),re=te.filter(e=>e.area===`area`),ie=async(e,t)=>{if(S)return;let n=m(t),r=n.length?n:[...e||[]].filter(e=>e&&e.size>0);if(!r.length)return;H(!0);let i=0;for(let e of r)try{let t=await h(e,{local:!0}),n=t.fileId||t.id;if(!n)throw Error(`上传未返回 fileId`);await Q.attach({fileId:n,name:t.name}),i+=1}catch(t){O(`「${e.name||`文件`}」添加失败:${t.message||t}`)}H(!1),i&&(O(`已挂到附件区 ${i} 个文件`),await $(),T?.())},ae=async n=>{if(n)try{let a=await k({title:`说明 · ${n.name}`,input:!0,placeholder:`这一行里大概是什么(交付清单会透出给 agent)`,value:n.note||``,okText:`保存说明`});if(a===null)return;let c=typeof a==`string`?a:a&&(a.value||a.note)||``,l=e===`doc`?`/api/docs/attach-note?ref=${encodeURIComponent(String(s||``))}`:`/api/localtasks/attach-note`,u=e===`doc`?{attachment:n.id,note:c}:{id:Number(t),...i?{key:i}:o?{cwd:o}:{},attachment:n.id,note:c};await r(l,{method:`PATCH`,body:u}),O(c?`已保存说明:${c}`:`已清空说明`),await $(),T?.()}catch(e){O(`改说明失败:${e.message||e}`)}},oe=e=>{e&&(J(e),R(!0))},se=async e=>{let t=G;if(t){ee(!0);try{await Q.detach(t.id,!!e),K(null),O(e?`已移除并删除资源:${t.name}`:`已解除关联:${t.name}`),await $(),T?.()}catch(e){O(`移除失败:${e.message||e}`)}finally{ee(!1)}}},ce=!N&&!F&&!j.length;return(0,_.jsxs)(`div`,{className:`att-area${S?` is-disabled`:``}`,onDragOver:e=>{!S&&[...e.dataTransfer?.types||[]].includes(`Files`)&&(e.preventDefault(),B(!0))},onDragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||B(!1)},onDrop:e=>{B(!1),!S&&[...e.dataTransfer?.types||[]].includes(`Files`)&&(e.preventDefault(),ie(null,e))},children:[A,(0,_.jsxs)(`div`,{className:`att-area-head`+(z&&!S?` is-over`:``),children:[(0,_.jsxs)(`span`,{className:`att-area-title`,children:[`附件`,j.length?(0,_.jsx)(`span`,{className:`att-count`,children:j.length}):null,V?(0,_.jsx)(`span`,{className:`att-area-note`,children:`上传中…`}):null]}),(0,_.jsxs)(`span`,{className:`att-area-acts`,children:[j.length?(0,_.jsxs)(`select`,{className:`att-sort`,value:U,onChange:e=>W(e.target.value),"aria-label":`附件排序`,children:[(0,_.jsx)(`option`,{value:`position`,children:`按添加顺序`}),(0,_.jsx)(`option`,{value:`name`,children:`按名称`}),(0,_.jsx)(`option`,{value:`kind`,children:`按类型`})]}):null,(0,_.jsx)(`button`,{type:`button`,className:`btn ghost att-add-btn`,disabled:S,onClick:()=>R(!0),children:`添加附件`})]})]}),S?(0,_.jsx)(`div`,{className:`att-empty`,children:C}):null,N?(0,_.jsx)(`div`,{className:`att-empty`,children:`加载附件…`}):null,F?(0,_.jsxs)(`div`,{className:`att-empty att-err-text`,children:[`附件加载失败:`,F]}):null,ce?(0,_.jsx)(`div`,{className:`att-empty`,children:`还没有附件。拖文件到这里,或点「添加附件」——只挂附件区,不写正文。`}):null,ne.length?(0,_.jsxs)(`div`,{className:`att-section`,children:[(0,_.jsxs)(`div`,{className:`att-section-head`,children:[p.inline,(0,_.jsx)(`span`,{className:`att-section-hint`,children:`正文里的引用,删正文行会跟着消失`})]}),ne.map(e=>b(e,{onRemove:K,onPreview:Z,onOpenTask:E,onOpenDoc:D,onEditNote:ae,onReplace:oe,key:e.id}))]}):null,re.length?(0,_.jsxs)(`div`,{className:`att-section`,children:[(0,_.jsxs)(`div`,{className:`att-section-head`,children:[p.area,(0,_.jsx)(`span`,{className:`att-section-hint`,children:`不依赖正文,删正文行也不会丢`})]}),re.map(e=>b(e,{onRemove:K,onPreview:Z,onOpenTask:E,onOpenDoc:D,onEditNote:ae,onReplace:oe,key:e.id}))]}):null,(0,_.jsx)(f,{open:L,host:e,hostId:t,hostKey:i,hostCwd:o,refId:s,allow:c,taskOptions:d,docOptions:x,replaceAttachment:q?q.id:null,replaceNote:q&&q.note||``,onClose:()=>{R(!1),J(null)},onDone:async()=>{J(null),await $(),T?.()}}),G?(0,_.jsx)(v,{title:`移除附件`,size:`sm`,busy:Y,onClose:Y?void 0:()=>K(null),footer:(0,_.jsxs)(`div`,{className:`att-foot`,children:[(0,_.jsx)(`button`,{type:`button`,className:`btn ghost`,disabled:Y,onClick:()=>K(null),children:`取消`}),(0,_.jsx)(`button`,{type:`button`,className:`btn`,disabled:Y,onClick:()=>se(!1),children:`只解除关联`}),(0,_.jsx)(`button`,{type:`button`,className:`btn danger`,disabled:Y,onClick:()=>se(!0),children:G.kind===`file`?`连文件一起删`:`连资源一起删`})]}),children:(0,_.jsxs)(`div`,{className:`att-confirm`,children:[(0,_.jsx)(`div`,{className:`att-confirm-name`,children:G.name}),(0,_.jsxs)(`div`,{className:`att-confirm-text`,children:[`只解除关联:从这份`,e===`task`?`任务`:`文档`,`的附件清单里移除,资源仍留在孤儿池,可被重新挂载。 连资源一起删:在本机没有其它任务/文档引用它时,删除资源行(本机文件同时删字节);仍被引用时只解除关联。`]})]})}):null,X?(0,_.jsx)(`div`,{className:`att-lightbox`,role:`dialog`,"aria-label":`图片预览`,onMouseDown:e=>{e.target===e.currentTarget&&Z(null)},children:(0,_.jsxs)(`div`,{className:`att-lightbox-card`,children:[(0,_.jsxs)(`div`,{className:`att-lightbox-head`,children:[(0,_.jsx)(`span`,{className:`att-lightbox-name`,children:X.name}),(0,_.jsx)(`a`,{className:`att-lightbox-open`,href:X.src,target:`_blank`,rel:`noreferrer`,children:`新窗口打开`}),(0,_.jsx)(`button`,{type:`button`,className:`pp-x`,"aria-label":`关闭`,onClick:()=>Z(null),children:`×`})]}),(0,_.jsx)(`img`,{className:`att-lightbox-img`,src:X.src,alt:X.name})]})}):null]})}var S=s(),C=[{id:`new`,label:`+ 新建页`,section:`primary`,noHide:!0},{id:`import`,label:`导入`,section:`bar`},{id:`progress`,label:`进程`,section:`bar`},{id:`orch`,label:`编排`,section:`bar`},{id:`more`,label:`更多`,section:`bar`,noHide:!0},{id:`deleted`,label:`已删除任务`,section:`more`},{id:`refs`,label:`查看列表`,section:`more`}],w=[{id:`new`,label:`+ 新增任务`,section:`primary`,noHide:!0},{id:`progress`,label:`进程`,section:`bar`},{id:`addMember`,label:`添加成员`,section:`bar`},{id:`orch`,label:`编排`,section:`bar`},{id:`more`,label:`更多`,section:`bar`,noHide:!0},{id:`deleted`,label:`已删除任务`,section:`more`},{id:`refs`,label:`查看列表`,section:`more`}],T=[{id:`new`,label:`新任务`,section:`primary`,noHide:!0},{id:`submit`,label:`提交`,section:`primary`,noHide:!0},{id:`more`,label:`更多`,section:`bar`,noHide:!0},{id:`mode`,label:`源码模式`,section:`more`,menuGroup:`edit`},{id:`img`,label:`插入图片`,section:`more`,menuGroup:`edit`},{id:`att`,label:`添加附件`,section:`more`,menuGroup:`edit`},{id:`import`,label:`导入`,section:`more`,menuGroup:`edit`},{id:`draft`,label:`存草稿`,section:`more`,menuGroup:`edit`},{id:`chain`,label:`任务链`,section:`more`,menuGroup:`task`},{id:`clone`,label:`克隆任务`,section:`more`,menuGroup:`task`},{id:`fork`,label:`Fork 任务`,section:`more`,menuGroup:`task`},{id:`complete`,label:`标为完成`,section:`more`,menuGroup:`task`},{id:`cancel-task`,label:`取消任务`,section:`more`,menuGroup:`task`,danger:!0},{id:`mark`,label:`评论`,section:`more`,menuGroup:`task`},{id:`delete`,label:`删除`,section:`more`,menuGroup:`task`,danger:!0},{id:`preview`,label:`预览提示词`,section:`more`,menuGroup:`view`},{id:`overview`,label:`总览`,section:`more`,menuGroup:`view`},{id:`prog`,label:`进程`,section:`more`,menuGroup:`view`},{id:`source`,label:`原文`,section:`more`,menuGroup:`view`},{id:`shortcuts`,label:`快捷键`,section:`more`,menuGroup:`view`}],E=[{id:`save`,label:`保存`,section:`primary`,noHide:!0},{id:`more`,label:`更多`,section:`bar`,noHide:!0},{id:`mode`,label:`源码模式`,section:`more`,menuGroup:`edit`},{id:`rename`,label:`重命名`,section:`more`,menuGroup:`doc`},{id:`delete`,label:`删除`,section:`more`,menuGroup:`doc`,danger:!0},{id:`list`,label:`文字列表`,section:`more`,menuGroup:`view`}],D=[{id:`add`,label:`登记仓库`,section:`primary`,noHide:!0},{id:`more`,label:`更多`,section:`bar`,noHide:!0},{id:`boards`,label:`分组管理`,section:`more`,menuGroup:`manage`},{id:`refs`,label:`参考仓库管理`,section:`more`,menuGroup:`manage`},{id:`transfer`,label:`导入导出`,section:`more`,menuGroup:`manage`}],O=[{id:`edit`,label:`编辑`,section:`bar`},{id:`open`,label:`打开`,section:`bar`},{id:`del`,label:`删除`,section:`bar`,danger:!0},{id:`more`,label:`更多`,section:`bar`,noHide:!0},{id:`getloop`,label:`持续 get…`,section:`more`,menuGroup:`repo`},{id:`remote`,label:`对齐 remote`,section:`more`,menuGroup:`repo`}],k={dir:Object.fromEntries(C.map(e=>[e.id,e])),group:Object.fromEntries(w.map(e=>[e.id,e])),task:Object.fromEntries(T.map(e=>[e.id,e])),doc:Object.fromEntries(E.map(e=>[e.id,e])),repos:Object.fromEntries(D.map(e=>[e.id,e])),"repos-row":Object.fromEntries(O.map(e=>[e.id,e]))};function A(e){return e===`group`?w:e===`task`?T:e===`doc`?E:e===`repos`?D:e===`repos-row`?O:C}function j(e,t){return k[e]&&k[e][t]||{}}function M(e,t){let n=j(e,t);return String(n.section||``).startsWith(`more`)||!!n.defaultInMore}function N(e,t){return j(e,t.id).noHide?!0:t.visible===void 0?!M(e,t.id):t.visible!==!1}function P(e,t){return t.id===`more`||j(e,t.id).noHide?!1:!N(e,t)}function F(e,t){let n=A(e),r=new Set(n.map(e=>e.id)),i=new Set,a=[];for(let n of t||[]){if(!n||!n.id||!r.has(n.id)||i.has(n.id))continue;i.add(n.id);let t=j(e,n.id);a.push(t.noHide?{...n,visible:!0}:n)}for(let t of n)i.has(t.id)||a.push({id:t.id,visible:t.noHide?!0:!M(e,t.id)});let o=a.findIndex(e=>e.id===`more`);if(o>=0&&o<a.length-1){let[t]=a.splice(o,1),n=a.length;for(let t=0;t<a.length;t++){let r=a[t];if(r&&M(e,r.id)&&!N(e,r)){n=t;break}}t&&a.splice(n,0,t)}return a}function I(e){return F(e,A(e).map(t=>({id:t.id,visible:t.noHide?!0:!M(e,t.id)})))}var L=e=>`nx-kv-tb-${e}`;function R(e){let[t,n]=(0,g.useState)(()=>{try{let t=JSON.parse(localStorage.getItem(L(e))??`null`);if(Array.isArray(t))return F(e,t)}catch{}return I(e)});return(0,g.useEffect)(()=>{try{localStorage.setItem(L(e),JSON.stringify(t))}catch{}},[t,e]),{layout:t,setLayout:n,resetLayout:()=>n(I(e))}}function z(e,t){return!!j(e,t).lockLast}function B(e,t,n){return e.map(e=>e.id===t?{...e,...n}:e)}function V(e,t,{id:n,anchorId:r=null,after:i=!1,visible:a}){let o=t.findIndex(e=>e.id===n);if(o<0||z(e,n))return t;let s={...t[o]};a!==void 0&&(s.visible=j(e,n).noHide?!0:!!a);let c=t.filter((e,t)=>t!==o),l;if(r===n)l=o;else if(r){let e=c.findIndex(e=>e.id===r);l=e<0?c.length:e+ +!!i}else{let e=c.findIndex(e=>e.id===`more`);l=e>=0?e:c.length}let u=c.findIndex(t=>z(e,t.id));u>=0&&l>u&&(l=u);let d=c.slice();return d.splice(l,0,s),d}function H(e,t,n,r){let i=t.filter(t=>N(e,t)&&!z(e,t.id)),a=i.findIndex(e=>e.id===n);if(a<0)return t;let o=a+r;if(o<0||o>=i.length)return t;let s=i[o];return V(e,t,{id:n,anchorId:s.id,after:r>0})}function U({kind:e,layout:t,setLayout:n,onClose:r}){let[i,a]=(0,g.useState)(()=>t.map(e=>({...e}))),[o,s]=(0,g.useState)(null),[c,l]=(0,g.useState)(null),u=(0,g.useRef)(null),d=i.filter(t=>N(e,t)),f=i.filter(t=>P(e,t)),p=d.filter(t=>!z(e,t.id)),m=()=>{let t=u.current;return t&&!z(e,t.id)?t:null},h=(t,n)=>{z(e,n.id)||(u.current={id:n.id,onBar:N(e,n)},l(n.id),t.dataTransfer&&(t.dataTransfer.effectAllowed=`move`,t.dataTransfer.setData(`text/plain`,n.id)))},v=()=>{u.current=null,l(null),s(null)},y=(t,n)=>{a(r=>V(e,r,{...n,id:t.id,visible:t.onBar===!1||n.visible}))},b=e=>{let t=e.clientY;for(let n of e.currentTarget.querySelectorAll(`[data-row-id]`)){let e=n.getBoundingClientRect(),r=n.dataset.rowId??null;if(t<e.top)return{anchorId:r,after:!1};if(t<=e.bottom)return{anchorId:r,after:t>e.top+e.height/2}}return{anchorId:null,after:!1}},x=e=>{let t=m();if(!t)return;e.preventDefault();let n=b(e);s(n.anchorId?n.anchorId===t.id?null:`row:${n.anchorId}:${n.after?`after`:`before`}`:`zone:bar:end`)},S=e=>{e.preventDefault();let t=b(e),n=m();v(),n&&y(n,{anchorId:t.anchorId,after:t.after,visible:!0})},C=e=>{e.currentTarget.contains(e.relatedTarget)||s(e=>e&&e.startsWith(`zone:`)?null:e)},w=t=>{let n=m();n&&!j(e,n.id).noHide&&(t.preventDefault(),s(`menu`))},T=t=>{t.preventDefault();let n=m();v(),n&&!j(e,n.id).noHide&&a(e=>B(e,n.id,{visible:!1}))},E=e=>{e.currentTarget.contains(e.relatedTarget)||s(e=>e===`menu`?null:e)},D=e=>{let t=e.currentTarget.getBoundingClientRect();return(e.clientX-t.left)/(t.width||1)>.5},O=(e,t)=>{let n=m();n&&n.id!==e.id&&(t.preventDefault(),s(`chip:${e.id}:${D(t)?`after`:`before`}`))},k=(e,t)=>{let n=D(t);t.preventDefault();let r=m();v(),r&&y(r,{anchorId:e.id,after:n,visible:!0})},A=t=>{j(e,t).noHide||a(n=>{let r=n.find(e=>e.id===t);return B(n,t,{visible:!(r&&N(e,r))})})},M=(t,n)=>a(r=>H(e,r,t.id,n)),F=(e,t)=>{t.altKey&&(t.key===`ArrowUp`?(t.preventDefault(),M(e,-1)):t.key===`ArrowDown`&&(t.preventDefault(),M(e,1)))},L=()=>{n(i),r()},R=()=>a(I(e)),U=(t,n)=>{let r=o===`row:${t.id}:before`?` drop-before`:o===`row:${t.id}:after`?` drop-after`:``;return[`tlp-row`,n?``:`off`,z(e,t.id)?`lock`:``,c===t.id?`dragging`:``,r].filter(Boolean).join(` `)};return(0,_.jsxs)(`div`,{className:`tlp-panel`,role:`dialog`,"aria-label":`自定义工具栏`,children:[(0,_.jsxs)(`div`,{className:`tlp-head`,children:[(0,_.jsx)(`b`,{children:`自定义工具栏`}),(0,_.jsx)(`span`,{className:`tlp-head-sub`,children:`拖拽排序;关显隐 → 收入「更多」`})]}),(0,_.jsxs)(`div`,{className:`tlp-body`,children:[(0,_.jsxs)(`div`,{className:`tlp-section tlp-span`,children:[(0,_.jsx)(`div`,{className:`tlp-section-label`,children:`预览(可直接拖动这里的按钮排序)`}),(0,_.jsx)(`div`,{className:`tlp-preview`,role:`list`,"data-testid":`tlp-preview`,children:d.map(t=>{let n=o===`chip:${t.id}:before`?` drop-before`:o===`chip:${t.id}:after`?` drop-after`:``;return(0,_.jsx)(`span`,{className:[`tlp-chip`,j(e,t.id).section===`primary`?`primary`:``,c===t.id?`dragging`:``,n].filter(Boolean).join(` `),draggable:!z(e,t.id),role:`listitem`,onDragStart:e=>h(e,t),onDragEnd:v,onDragOver:e=>O(t,e),onDrop:e=>k(t,e),children:j(e,t.id).label||t.id},t.id)})})]}),(0,_.jsxs)(`div`,{className:`tlp-section`,children:[(0,_.jsx)(`div`,{className:`tlp-section-label`,children:`工具栏 · 拖进来即排序(行上/下半 = 前/后)`}),(0,_.jsxs)(`div`,{className:`tlp-list`+(o===`zone:bar:end`?` drop-on`:``),role:`list`,onDragOver:x,onDragLeave:C,onDrop:S,children:[p.length===0&&d.every(t=>z(e,t.id))?(0,_.jsx)(`div`,{className:`tlp-empty`,children:`空 —— 把「更多」里的项拖到这里`}):null,d.map(t=>{let n=j(e,t.id),r=p.findIndex(e=>e.id===t.id);return(0,_.jsxs)(`div`,{className:U(t,!0),draggable:!z(e,t.id),"data-row-id":t.id,tabIndex:z(e,t.id)?void 0:0,role:`listitem`,"aria-label":`${n.label||t.id}:拖动排序,Alt+上下换位`,onKeyDown:e=>F(t,e),onDragStart:e=>h(e,t),onDragEnd:v,children:[(0,_.jsx)(`span`,{className:`tlp-hnd`,title:z(e,t.id)?`锁定`:`拖动排序`,children:z(e,t.id)?`·`:`⋮⋮`}),(0,_.jsx)(`input`,{type:`checkbox`,checked:!0,disabled:!!n.noHide,onChange:()=>A(t.id),title:n.noHide?`不可隐藏`:`收入「更多」`}),(0,_.jsxs)(`span`,{className:`tlp-nm`,children:[n.label||t.id,n.noHide?(0,_.jsx)(`span`,{className:`tlp-sub`,children:`固定显示`}):null]}),z(e,t.id)?null:(0,_.jsxs)(`span`,{className:`tlp-acts`,children:[(0,_.jsx)(`button`,{type:`button`,className:`btn ghost sm`,disabled:r<=0,title:`上移`,onClick:()=>M(t,-1),children:`↑`}),(0,_.jsx)(`button`,{type:`button`,className:`btn ghost sm`,disabled:r<0||r>=p.length-1,title:`下移`,onClick:()=>M(t,1),children:`↓`})]})]},t.id)})]})]}),(0,_.jsxs)(`div`,{className:`tlp-section`,children:[(0,_.jsx)(`div`,{className:`tlp-section-label`,children:`更多菜单(拖到上方 = 显示到工具栏;拖回这里 = 收入更多)`}),(0,_.jsxs)(`div`,{className:`tlp-list tlp-menu`+(o===`menu`?` dropping`:``),role:`list`,onDragOver:w,onDragLeave:E,onDrop:T,children:[f.map(t=>{let n=j(e,t.id);return(0,_.jsxs)(`div`,{className:U(t,!1),draggable:!0,role:`listitem`,onDragStart:e=>h(e,t),onDragEnd:v,children:[(0,_.jsx)(`span`,{className:`tlp-hnd`,title:`拖到上方工具栏 = 显示`,children:`⋮⋮`}),(0,_.jsx)(`input`,{type:`checkbox`,checked:!1,onChange:()=>A(t.id),title:`显示到工具栏`}),(0,_.jsx)(`span`,{className:`tlp-nm`,children:n.label||t.id})]},t.id)}),(0,_.jsx)(`div`,{className:`tlp-drop-hint`,role:`presentation`,children:o===`menu`?`松手 = 收入「更多」`:f.length?`把项拖到上方工具栏区域 = 显示到工具栏`:`工具栏上的按钮拖到这里即可收入「更多」`})]})]})]}),(0,_.jsxs)(`div`,{className:`tlp-foot`,children:[(0,_.jsx)(`span`,{className:`tlp-equiv`,children:`保存到本机 localStorage(每种工具区各存一份)`}),(0,_.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:R,children:`恢复默认`}),(0,_.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:r,children:`取消`}),(0,_.jsx)(`button`,{type:`button`,className:`btn sm primary`,onClick:L,children:`保存`})]})]})}var W=`task`,G=[{id:`edit`,label:`编辑`},{id:`task`,label:`任务`},{id:`view`,label:`查看`}];function K(){let[e,t]=(0,g.useState)(!1),[n,r]=(0,g.useState)({x:0,y:0}),i=(0,g.useRef)(null),a=(0,g.useRef)(null);return(0,g.useEffect)(()=>{if(!e)return;let n=e=>{let n=e.target;i.current?.contains(n)||a.current?.contains(n)||t(!1)};return document.addEventListener(`mousedown`,n),()=>document.removeEventListener(`mousedown`,n)},[e]),{open:e,setOpen:t,pos:n,setPos:r,ref:i,menuRef:a}}function q({menu:e,className:t=``,style:n,children:r}){return e.open?(0,S.createPortal)((0,_.jsx)(`div`,{className:`mdw-fmt-menu${t?` ${t}`:``}`,role:`menu`,ref:e.menuRef,style:{position:`fixed`,...e.pos,...n},children:r}),document.body):null}function J(e,t,n=`left`){let r=t.currentTarget.getBoundingClientRect(),i=r.bottom+4;e.setPos(n===`left`?{left:r.left,top:i}:{left:`auto`,right:Math.max(8,window.innerWidth-r.right),top:i}),e.setOpen(e=>!e)}function Y({mode:e,onMode:t,showMark:n,submitLabel:r,onNew:i,onSubmit:a,onChain:o,onPreview:s,onImg:c,onAtt:l,onImport:u,onClone:d,onFork:f,onComplete:p,onCancelTask:m,onMark:h,onDraft:v,onDelete:y,onOverview:b,onProg:x,onSource:C,onShortcuts:w,goalBadge:T,goalMenu:E}){let D=K(),{layout:O,setLayout:k}=R(W),[A,M]=(0,g.useState)(!1);(0,g.useEffect)(()=>{D.setOpen(!1)},[e]);let F={new:i&&{label:`新任务`,run:i},submit:{label:r||`提交`,run:a,primary:!0},mode:t&&{label:e===`edit`?`返回实时预览`:`源码模式`,hint:e===`edit`?`当前`:``,run:()=>t?.(e===`edit`?`split`:`edit`)},img:c&&{label:`插入图片`,run:c},att:l&&{label:`添加附件`,run:l},import:u&&e!==`split`?{label:`导入`,run:u}:null,draft:v&&e!==`split`?{label:`存草稿`,run:v}:null,chain:o&&{label:`任务链`,run:o},clone:d&&{label:`克隆任务`,run:d},fork:f&&{label:`Fork 任务`,run:f},complete:p&&{label:`标为完成`,run:p},"cancel-task":m&&{label:`取消任务`,run:m,danger:!0},mark:n&&h?{label:`评论`,run:h}:null,delete:y&&{label:`删除`,run:y,danger:!0},preview:s&&{label:`预览提示词`,run:s},overview:b&&{label:`总览`,run:b},prog:x&&{label:`进程`,run:x},source:C&&{label:`原文`,run:C},shortcuts:w&&{label:`快捷键`,run:w}},I=e=>e===`more`||!!F[e],L=O.filter(e=>N(W,e)&&I(e.id)),z=O.filter(e=>P(W,e)&&I(e.id)),B=e=>{F[e]?.run?.(),D.setOpen(!1)},V=e=>{if(e===`more`)return(0,_.jsx)(`div`,{className:`mdw-actions-more`,ref:D.ref,children:(0,_.jsx)(`button`,{type:`button`,className:`btn ghost sm${D.open?` on`:``}`,title:`更多操作`,"aria-expanded":D.open,"aria-haspopup":`menu`,onClick:e=>J(D,e,`right`),children:`更多`})},`more`);let t=F[e];return t?(0,_.jsx)(`button`,{type:`button`,className:t.primary?`btn sm primary`:`btn ghost sm`,onClick:()=>B(e),children:t.label},e):null},H=G.map(e=>({...e,items:z.filter(t=>j(W,t.id).menuGroup===e.id)})).filter(e=>e.items.length),Y=z.filter(e=>!j(W,e.id).menuGroup);return(0,_.jsxs)(`div`,{className:`mdw-toolbar`,children:[(0,_.jsx)(`div`,{className:`mdw-toolbar-left`,children:T&&(0,_.jsx)(`button`,{type:`button`,className:`mdw-goal-badge`,title:T.title,"aria-haspopup":`menu`,"aria-expanded":D.open,onClick:e=>J(D,e,`right`),children:T.label})}),(0,_.jsxs)(`div`,{className:`mdw-actions`,role:`group`,"aria-label":`任务操作`,children:[L.map(e=>V(e.id)),(0,_.jsxs)(q,{menu:D,className:`mdw-act-menu`,children:[E,E&&(0,_.jsx)(`div`,{className:`mdw-fmt-menu-sep`,role:`separator`}),H.map(e=>(0,_.jsxs)(`div`,{className:`mdw-fmt-menu-group`,role:`group`,"aria-label":e.label,children:[(0,_.jsx)(`div`,{className:`mdw-fmt-menu-cap`,children:e.label}),e.items.map(e=>{let t=F[e.id],n=t?.danger||j(W,e.id).danger;return(0,_.jsxs)(`button`,{type:`button`,role:`menuitem`,className:`mdw-fmt-menu-item`+(n?` danger`:``),onClick:()=>B(e.id),children:[t?.label||j(W,e.id).label||e.id,t?.hint?(0,_.jsx)(`span`,{className:`hint`,children:t.hint}):null]},e.id)})]},e.id)),Y.map(e=>{let t=F[e.id];return(0,_.jsx)(`button`,{type:`button`,role:`menuitem`,className:`mdw-fmt-menu-item`+(t?.danger||j(W,e.id).danger?` danger`:``),onClick:()=>B(e.id),children:t?.label||j(W,e.id).label||e.id},e.id)}),(0,_.jsx)(`div`,{className:`mdw-fmt-menu-sep`,role:`separator`}),(0,_.jsx)(`button`,{type:`button`,role:`menuitem`,className:`mdw-fmt-menu-item`,onClick:()=>{D.setOpen(!1),M(!0)},children:`自定义工具栏…`})]})]}),A&&(0,S.createPortal)((0,_.jsx)(`div`,{className:`ta-panel-mask`,onClick:()=>M(!1),children:(0,_.jsx)(`div`,{className:`ta-panel-wrap`,onClick:e=>e.stopPropagation(),children:(0,_.jsx)(U,{kind:W,layout:O,setLayout:k,onClose:()=>M(!1)})})}),document.body)]})}export{U as a,j as c,K as i,N as l,Y as n,R as o,J as r,P as s,q as t,x as u};
|
|
1
|
+
import{g as e,h as t,l as n,m as r,o as i,p as a,y as o}from"./task-status-DSrx0i66.js";import{w as s}from"./workspace-4tw7trV7.js";import{c,d as l,f as u,l as d,o as f,s as p}from"./md-history-0GBWw4qr.js";import{n as m,o as h}from"./upload-BcMhRsMn.js";var g=o(e(),1),_=t(),v=i,y={position:(e,t)=>(e.position||0)-(t.position||0)||String(e.id).localeCompare(String(t.id)),name:(e,t)=>String(e.name||``).localeCompare(String(t.name||``)),kind:(e,t)=>String(e.kind).localeCompare(String(t.kind))||String(e.name||``).localeCompare(String(t.name||``))};function b(e,{onRemove:t,onPreview:n,onOpenTask:r,onOpenDoc:i,onEditNote:a,onReplace:o}){let s=e.kind===`image`?d(e.id):``;return(0,_.jsxs)(`div`,{className:`att-item att-kind-${e.kind}`,children:[e.kind===`image`?(0,_.jsx)(`button`,{type:`button`,className:`att-thumb`,onClick:()=>n({src:s,name:e.name}),title:`点击看大图`,children:(0,_.jsx)(`img`,{src:s,alt:e.name,loading:`lazy`})}):(0,_.jsx)(`span`,{className:`att-kind-badge`,children:c(e.kind)}),(0,_.jsxs)(`span`,{className:`att-item-main`,children:[e.kind===`task`?(0,_.jsx)(`button`,{type:`button`,className:`att-link`,title:`跳转到任务 #${e.targetSeq??``}`,onClick:()=>r?.({key:e.targetKey,seq:e.targetSeq}),children:e.name}):e.kind===`ref`?(0,_.jsx)(`button`,{type:`button`,className:`att-link`,title:e.locator||e.targetRef||`打开文档`,onClick:()=>i?.(e.locator||e.targetRef),children:e.name}):e.kind===`url`?(0,_.jsx)(`a`,{className:`att-link`,href:e.url,target:`_blank`,rel:`noreferrer`,title:e.url,children:e.name}):(0,_.jsx)(`span`,{className:`att-item-name`,title:e.name,children:e.name}),(0,_.jsxs)(`span`,{className:`att-item-meta`,children:[e.sizeText?(0,_.jsx)(`span`,{children:e.sizeText}):null,e.note?(0,_.jsx)(`span`,{className:`att-note`,children:e.note}):null]})]}),e.kind===`file`||e.kind===`image`?(0,_.jsxs)(`span`,{className:`att-item-acts`,children:[(0,_.jsx)(`a`,{className:`att-act`,href:d(e.id),target:`_blank`,rel:`noreferrer`,children:`打开`}),(0,_.jsx)(`a`,{className:`att-act`,href:d(e.id),download:e.name,children:`下载`})]}):null,e.kind===`ref`?(0,_.jsxs)(`span`,{className:`att-item-acts`,children:[(0,_.jsx)(`button`,{type:`button`,className:`att-act`,title:`改这条绑定的一行说明(交付清单会透出)`,onClick:()=>a?.(e),children:`✎ 说明`}),(0,_.jsx)(`button`,{type:`button`,className:`att-act`,title:`换成另一篇文档(替换这条绑定)`,onClick:()=>o?.(e),children:`⇄ 更换`})]}):null,(0,_.jsx)(`button`,{type:`button`,className:`att-x`,"aria-label":`移除 ${e.name}`,onClick:()=>t(e),children:`×`})]},e.id)}function x({host:e=`task`,hostId:t,hostKey:i,hostCwd:o,refId:s,allow:c={file:!0,url:!0,task:!1,ref:!1},taskOptions:d=[],docOptions:x,disabled:S=!1,disabledText:C=`提交任务后可以在这里挂附件(当前是草稿)。`,openRef:w,onChanged:T,onOpenTask:E,onOpenDoc:D}){let O=a(),{dialog:k,node:A}=n(),[j,M]=(0,g.useState)([]),[N,P]=(0,g.useState)(!1),[F,I]=(0,g.useState)(``),[L,R]=(0,g.useState)(!1),[z,B]=(0,g.useState)(!1),[V,H]=(0,g.useState)(!1),[U,W]=(0,g.useState)(`position`),[G,K]=(0,g.useState)(null),[q,J]=(0,g.useState)(null),[Y,ee]=(0,g.useState)(!1),[X,Z]=(0,g.useState)(null),Q=(0,g.useMemo)(()=>l(e,{hostId:t,hostKey:i,hostCwd:o,refId:s}),[e,t,i,o,s]),$=(0,g.useCallback)(async()=>{if(S){M([]);return}P(!0),I(``);try{let e=await Q.list();M((e.attachments||[]).map(u))}catch(e){I(String(e.message||e))}finally{P(!1)}},[Q,S]);(0,g.useEffect)(()=>{$()},[$]),(0,g.useImperativeHandle)(w,()=>({open:()=>R(!0),refresh:$}),[$]),(0,g.useEffect)(()=>{if(!X)return;let e=e=>{e.key===`Escape`&&Z(null)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[X]);let te=(0,g.useMemo)(()=>[...j].sort(y[U]||y.position),[j,U]),ne=te.filter(e=>e.area===`inline`),re=te.filter(e=>e.area===`area`),ie=async(e,t)=>{if(S)return;let n=m(t),r=n.length?n:[...e||[]].filter(e=>e&&e.size>0);if(!r.length)return;H(!0);let i=0;for(let e of r)try{let t=await h(e,{local:!0}),n=t.fileId||t.id;if(!n)throw Error(`上传未返回 fileId`);await Q.attach({fileId:n,name:t.name}),i+=1}catch(t){O(`「${e.name||`文件`}」添加失败:${t.message||t}`)}H(!1),i&&(O(`已挂到附件区 ${i} 个文件`),await $(),T?.())},ae=async n=>{if(n)try{let a=await k({title:`说明 · ${n.name}`,input:!0,placeholder:`这一行里大概是什么(交付清单会透出给 agent)`,value:n.note||``,okText:`保存说明`});if(a===null)return;let c=typeof a==`string`?a:a&&(a.value||a.note)||``,l=e===`doc`?`/api/docs/attach-note?ref=${encodeURIComponent(String(s||``))}`:`/api/localtasks/attach-note`,u=e===`doc`?{attachment:n.id,note:c}:{id:Number(t),...i?{key:i}:o?{cwd:o}:{},attachment:n.id,note:c};await r(l,{method:`PATCH`,body:u}),O(c?`已保存说明:${c}`:`已清空说明`),await $(),T?.()}catch(e){O(`改说明失败:${e.message||e}`)}},oe=e=>{e&&(J(e),R(!0))},se=async e=>{let t=G;if(t){ee(!0);try{await Q.detach(t.id,!!e),K(null),O(e?`已移除并删除资源:${t.name}`:`已解除关联:${t.name}`),await $(),T?.()}catch(e){O(`移除失败:${e.message||e}`)}finally{ee(!1)}}},ce=!N&&!F&&!j.length;return(0,_.jsxs)(`div`,{className:`att-area${S?` is-disabled`:``}`,onDragOver:e=>{!S&&[...e.dataTransfer?.types||[]].includes(`Files`)&&(e.preventDefault(),B(!0))},onDragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||B(!1)},onDrop:e=>{B(!1),!S&&[...e.dataTransfer?.types||[]].includes(`Files`)&&(e.preventDefault(),ie(null,e))},children:[A,(0,_.jsxs)(`div`,{className:`att-area-head`+(z&&!S?` is-over`:``),children:[(0,_.jsxs)(`span`,{className:`att-area-title`,children:[`附件`,j.length?(0,_.jsx)(`span`,{className:`att-count`,children:j.length}):null,V?(0,_.jsx)(`span`,{className:`att-area-note`,children:`上传中…`}):null]}),(0,_.jsxs)(`span`,{className:`att-area-acts`,children:[j.length?(0,_.jsxs)(`select`,{className:`att-sort`,value:U,onChange:e=>W(e.target.value),"aria-label":`附件排序`,children:[(0,_.jsx)(`option`,{value:`position`,children:`按添加顺序`}),(0,_.jsx)(`option`,{value:`name`,children:`按名称`}),(0,_.jsx)(`option`,{value:`kind`,children:`按类型`})]}):null,(0,_.jsx)(`button`,{type:`button`,className:`btn ghost att-add-btn`,disabled:S,onClick:()=>R(!0),children:`添加附件`})]})]}),S?(0,_.jsx)(`div`,{className:`att-empty`,children:C}):null,N?(0,_.jsx)(`div`,{className:`att-empty`,children:`加载附件…`}):null,F?(0,_.jsxs)(`div`,{className:`att-empty att-err-text`,children:[`附件加载失败:`,F]}):null,ce?(0,_.jsx)(`div`,{className:`att-empty`,children:`还没有附件。拖文件到这里,或点「添加附件」——只挂附件区,不写正文。`}):null,ne.length?(0,_.jsxs)(`div`,{className:`att-section`,children:[(0,_.jsxs)(`div`,{className:`att-section-head`,children:[p.inline,(0,_.jsx)(`span`,{className:`att-section-hint`,children:`正文里的引用,删正文行会跟着消失`})]}),ne.map(e=>b(e,{onRemove:K,onPreview:Z,onOpenTask:E,onOpenDoc:D,onEditNote:ae,onReplace:oe,key:e.id}))]}):null,re.length?(0,_.jsxs)(`div`,{className:`att-section`,children:[(0,_.jsxs)(`div`,{className:`att-section-head`,children:[p.area,(0,_.jsx)(`span`,{className:`att-section-hint`,children:`不依赖正文,删正文行也不会丢`})]}),re.map(e=>b(e,{onRemove:K,onPreview:Z,onOpenTask:E,onOpenDoc:D,onEditNote:ae,onReplace:oe,key:e.id}))]}):null,(0,_.jsx)(f,{open:L,host:e,hostId:t,hostKey:i,hostCwd:o,refId:s,allow:c,taskOptions:d,docOptions:x,replaceAttachment:q?q.id:null,replaceNote:q&&q.note||``,onClose:()=>{R(!1),J(null)},onDone:async()=>{J(null),await $(),T?.()}}),G?(0,_.jsx)(v,{title:`移除附件`,size:`sm`,busy:Y,onClose:Y?void 0:()=>K(null),footer:(0,_.jsxs)(`div`,{className:`att-foot`,children:[(0,_.jsx)(`button`,{type:`button`,className:`btn ghost`,disabled:Y,onClick:()=>K(null),children:`取消`}),(0,_.jsx)(`button`,{type:`button`,className:`btn`,disabled:Y,onClick:()=>se(!1),children:`只解除关联`}),(0,_.jsx)(`button`,{type:`button`,className:`btn danger`,disabled:Y,onClick:()=>se(!0),children:G.kind===`file`?`连文件一起删`:`连资源一起删`})]}),children:(0,_.jsxs)(`div`,{className:`att-confirm`,children:[(0,_.jsx)(`div`,{className:`att-confirm-name`,children:G.name}),(0,_.jsxs)(`div`,{className:`att-confirm-text`,children:[`只解除关联:从这份`,e===`task`?`任务`:`文档`,`的附件清单里移除,资源仍留在孤儿池,可被重新挂载。 连资源一起删:在本机没有其它任务/文档引用它时,删除资源行(本机文件同时删字节);仍被引用时只解除关联。`]})]})}):null,X?(0,_.jsx)(`div`,{className:`att-lightbox`,role:`dialog`,"aria-label":`图片预览`,onMouseDown:e=>{e.target===e.currentTarget&&Z(null)},children:(0,_.jsxs)(`div`,{className:`att-lightbox-card`,children:[(0,_.jsxs)(`div`,{className:`att-lightbox-head`,children:[(0,_.jsx)(`span`,{className:`att-lightbox-name`,children:X.name}),(0,_.jsx)(`a`,{className:`att-lightbox-open`,href:X.src,target:`_blank`,rel:`noreferrer`,children:`新窗口打开`}),(0,_.jsx)(`button`,{type:`button`,className:`pp-x`,"aria-label":`关闭`,onClick:()=>Z(null),children:`×`})]}),(0,_.jsx)(`img`,{className:`att-lightbox-img`,src:X.src,alt:X.name})]})}):null]})}var S=s(),C=[{id:`new`,label:`+ 新建页`,section:`primary`,noHide:!0},{id:`import`,label:`导入`,section:`bar`},{id:`progress`,label:`进程`,section:`bar`},{id:`orch`,label:`编排`,section:`bar`},{id:`more`,label:`更多`,section:`bar`,noHide:!0},{id:`deleted`,label:`已删除任务`,section:`more`},{id:`refs`,label:`查看列表`,section:`more`}],w=[{id:`new`,label:`+ 新增任务`,section:`primary`,noHide:!0},{id:`progress`,label:`进程`,section:`bar`},{id:`addMember`,label:`添加成员`,section:`bar`},{id:`orch`,label:`编排`,section:`bar`},{id:`more`,label:`更多`,section:`bar`,noHide:!0},{id:`deleted`,label:`已删除任务`,section:`more`},{id:`refs`,label:`查看列表`,section:`more`}],T=[{id:`new`,label:`新任务`,section:`primary`,noHide:!0},{id:`submit`,label:`提交`,section:`primary`,noHide:!0},{id:`more`,label:`更多`,section:`bar`,noHide:!0},{id:`mode`,label:`源码模式`,section:`more`,menuGroup:`edit`},{id:`img`,label:`插入图片`,section:`more`,menuGroup:`edit`},{id:`att`,label:`添加附件`,section:`more`,menuGroup:`edit`},{id:`import`,label:`导入`,section:`more`,menuGroup:`edit`},{id:`draft`,label:`存草稿`,section:`more`,menuGroup:`edit`},{id:`chain`,label:`任务链`,section:`more`,menuGroup:`task`},{id:`clone`,label:`克隆任务`,section:`more`,menuGroup:`task`},{id:`fork`,label:`Fork 任务`,section:`more`,menuGroup:`task`},{id:`complete`,label:`标为完成`,section:`more`,menuGroup:`task`},{id:`cancel-task`,label:`取消任务`,section:`more`,menuGroup:`task`,danger:!0},{id:`mark`,label:`评论`,section:`more`,menuGroup:`task`},{id:`delete`,label:`删除`,section:`more`,menuGroup:`task`,danger:!0},{id:`preview`,label:`预览提示词`,section:`more`,menuGroup:`view`},{id:`overview`,label:`总览`,section:`more`,menuGroup:`view`},{id:`prog`,label:`进程`,section:`more`,menuGroup:`view`},{id:`source`,label:`原文`,section:`more`,menuGroup:`view`},{id:`shortcuts`,label:`快捷键`,section:`more`,menuGroup:`view`}],E=[{id:`save`,label:`保存`,section:`primary`,noHide:!0},{id:`more`,label:`更多`,section:`bar`,noHide:!0},{id:`mode`,label:`源码模式`,section:`more`,menuGroup:`edit`},{id:`rename`,label:`重命名`,section:`more`,menuGroup:`doc`},{id:`delete`,label:`删除`,section:`more`,menuGroup:`doc`,danger:!0},{id:`list`,label:`文字列表`,section:`more`,menuGroup:`view`}],D=[{id:`add`,label:`登记仓库`,section:`primary`,noHide:!0},{id:`more`,label:`更多`,section:`bar`,noHide:!0},{id:`boards`,label:`分组管理`,section:`more`,menuGroup:`manage`},{id:`refs`,label:`参考仓库管理`,section:`more`,menuGroup:`manage`},{id:`transfer`,label:`导入导出`,section:`more`,menuGroup:`manage`}],O=[{id:`edit`,label:`编辑`,section:`bar`},{id:`open`,label:`打开`,section:`bar`},{id:`del`,label:`删除`,section:`bar`,danger:!0},{id:`more`,label:`更多`,section:`bar`,noHide:!0},{id:`getloop`,label:`持续 get…`,section:`more`,menuGroup:`repo`},{id:`remote`,label:`对齐 remote`,section:`more`,menuGroup:`repo`}],k={dir:Object.fromEntries(C.map(e=>[e.id,e])),group:Object.fromEntries(w.map(e=>[e.id,e])),task:Object.fromEntries(T.map(e=>[e.id,e])),doc:Object.fromEntries(E.map(e=>[e.id,e])),repos:Object.fromEntries(D.map(e=>[e.id,e])),"repos-row":Object.fromEntries(O.map(e=>[e.id,e]))};function A(e){return e===`group`?w:e===`task`?T:e===`doc`?E:e===`repos`?D:e===`repos-row`?O:C}function j(e,t){return k[e]&&k[e][t]||{}}function M(e,t){let n=j(e,t);return String(n.section||``).startsWith(`more`)||!!n.defaultInMore}function N(e,t){return j(e,t.id).noHide?!0:t.visible===void 0?!M(e,t.id):t.visible!==!1}function P(e,t){return t.id===`more`||j(e,t.id).noHide?!1:!N(e,t)}function F(e,t){let n=A(e),r=new Set(n.map(e=>e.id)),i=new Set,a=[];for(let n of t||[]){if(!n||!n.id||!r.has(n.id)||i.has(n.id))continue;i.add(n.id);let t=j(e,n.id);a.push(t.noHide?{...n,visible:!0}:n)}for(let t of n)i.has(t.id)||a.push({id:t.id,visible:t.noHide?!0:!M(e,t.id)});let o=a.findIndex(e=>e.id===`more`);if(o>=0&&o<a.length-1){let[t]=a.splice(o,1),n=a.length;for(let t=0;t<a.length;t++){let r=a[t];if(r&&M(e,r.id)&&!N(e,r)){n=t;break}}t&&a.splice(n,0,t)}return a}function I(e){return F(e,A(e).map(t=>({id:t.id,visible:t.noHide?!0:!M(e,t.id)})))}var L=e=>`nx-kv-tb-${e}`;function R(e){let[t,n]=(0,g.useState)(()=>{try{let t=JSON.parse(localStorage.getItem(L(e))??`null`);if(Array.isArray(t))return F(e,t)}catch{}return I(e)});return(0,g.useEffect)(()=>{try{localStorage.setItem(L(e),JSON.stringify(t))}catch{}},[t,e]),{layout:t,setLayout:n,resetLayout:()=>n(I(e))}}function z(e,t){return!!j(e,t).lockLast}function B(e,t,n){return e.map(e=>e.id===t?{...e,...n}:e)}function V(e,t,{id:n,anchorId:r=null,after:i=!1,visible:a}){let o=t.findIndex(e=>e.id===n);if(o<0||z(e,n))return t;let s={...t[o]};a!==void 0&&(s.visible=j(e,n).noHide?!0:!!a);let c=t.filter((e,t)=>t!==o),l;if(r===n)l=o;else if(r){let e=c.findIndex(e=>e.id===r);l=e<0?c.length:e+ +!!i}else{let e=c.findIndex(e=>e.id===`more`);l=e>=0?e:c.length}let u=c.findIndex(t=>z(e,t.id));u>=0&&l>u&&(l=u);let d=c.slice();return d.splice(l,0,s),d}function H(e,t,n,r){let i=t.filter(t=>N(e,t)&&!z(e,t.id)),a=i.findIndex(e=>e.id===n);if(a<0)return t;let o=a+r;if(o<0||o>=i.length)return t;let s=i[o];return V(e,t,{id:n,anchorId:s.id,after:r>0})}function U({kind:e,layout:t,setLayout:n,onClose:r}){let[i,a]=(0,g.useState)(()=>t.map(e=>({...e}))),[o,s]=(0,g.useState)(null),[c,l]=(0,g.useState)(null),u=(0,g.useRef)(null),d=i.filter(t=>N(e,t)),f=i.filter(t=>P(e,t)),p=d.filter(t=>!z(e,t.id)),m=()=>{let t=u.current;return t&&!z(e,t.id)?t:null},h=(t,n)=>{z(e,n.id)||(u.current={id:n.id,onBar:N(e,n)},l(n.id),t.dataTransfer&&(t.dataTransfer.effectAllowed=`move`,t.dataTransfer.setData(`text/plain`,n.id)))},v=()=>{u.current=null,l(null),s(null)},y=(t,n)=>{a(r=>V(e,r,{...n,id:t.id,visible:t.onBar===!1||n.visible}))},b=e=>{let t=e.clientY;for(let n of e.currentTarget.querySelectorAll(`[data-row-id]`)){let e=n.getBoundingClientRect(),r=n.dataset.rowId??null;if(t<e.top)return{anchorId:r,after:!1};if(t<=e.bottom)return{anchorId:r,after:t>e.top+e.height/2}}return{anchorId:null,after:!1}},x=e=>{let t=m();if(!t)return;e.preventDefault();let n=b(e);s(n.anchorId?n.anchorId===t.id?null:`row:${n.anchorId}:${n.after?`after`:`before`}`:`zone:bar:end`)},S=e=>{e.preventDefault();let t=b(e),n=m();v(),n&&y(n,{anchorId:t.anchorId,after:t.after,visible:!0})},C=e=>{e.currentTarget.contains(e.relatedTarget)||s(e=>e&&e.startsWith(`zone:`)?null:e)},w=t=>{let n=m();n&&!j(e,n.id).noHide&&(t.preventDefault(),s(`menu`))},T=t=>{t.preventDefault();let n=m();v(),n&&!j(e,n.id).noHide&&a(e=>B(e,n.id,{visible:!1}))},E=e=>{e.currentTarget.contains(e.relatedTarget)||s(e=>e===`menu`?null:e)},D=e=>{let t=e.currentTarget.getBoundingClientRect();return(e.clientX-t.left)/(t.width||1)>.5},O=(e,t)=>{let n=m();n&&n.id!==e.id&&(t.preventDefault(),s(`chip:${e.id}:${D(t)?`after`:`before`}`))},k=(e,t)=>{let n=D(t);t.preventDefault();let r=m();v(),r&&y(r,{anchorId:e.id,after:n,visible:!0})},A=t=>{j(e,t).noHide||a(n=>{let r=n.find(e=>e.id===t);return B(n,t,{visible:!(r&&N(e,r))})})},M=(t,n)=>a(r=>H(e,r,t.id,n)),F=(e,t)=>{t.altKey&&(t.key===`ArrowUp`?(t.preventDefault(),M(e,-1)):t.key===`ArrowDown`&&(t.preventDefault(),M(e,1)))},L=()=>{n(i),r()},R=()=>a(I(e)),U=(t,n)=>{let r=o===`row:${t.id}:before`?` drop-before`:o===`row:${t.id}:after`?` drop-after`:``;return[`tlp-row`,n?``:`off`,z(e,t.id)?`lock`:``,c===t.id?`dragging`:``,r].filter(Boolean).join(` `)};return(0,_.jsxs)(`div`,{className:`tlp-panel`,role:`dialog`,"aria-label":`自定义工具栏`,children:[(0,_.jsxs)(`div`,{className:`tlp-head`,children:[(0,_.jsx)(`b`,{children:`自定义工具栏`}),(0,_.jsx)(`span`,{className:`tlp-head-sub`,children:`拖拽排序;关显隐 → 收入「更多」`})]}),(0,_.jsxs)(`div`,{className:`tlp-body`,children:[(0,_.jsxs)(`div`,{className:`tlp-section tlp-span`,children:[(0,_.jsx)(`div`,{className:`tlp-section-label`,children:`预览(可直接拖动这里的按钮排序)`}),(0,_.jsx)(`div`,{className:`tlp-preview`,role:`list`,"data-testid":`tlp-preview`,children:d.map(t=>{let n=o===`chip:${t.id}:before`?` drop-before`:o===`chip:${t.id}:after`?` drop-after`:``;return(0,_.jsx)(`span`,{className:[`tlp-chip`,j(e,t.id).section===`primary`?`primary`:``,c===t.id?`dragging`:``,n].filter(Boolean).join(` `),draggable:!z(e,t.id),role:`listitem`,onDragStart:e=>h(e,t),onDragEnd:v,onDragOver:e=>O(t,e),onDrop:e=>k(t,e),children:j(e,t.id).label||t.id},t.id)})})]}),(0,_.jsxs)(`div`,{className:`tlp-section`,children:[(0,_.jsx)(`div`,{className:`tlp-section-label`,children:`工具栏 · 拖进来即排序(行上/下半 = 前/后)`}),(0,_.jsxs)(`div`,{className:`tlp-list`+(o===`zone:bar:end`?` drop-on`:``),role:`list`,onDragOver:x,onDragLeave:C,onDrop:S,children:[p.length===0&&d.every(t=>z(e,t.id))?(0,_.jsx)(`div`,{className:`tlp-empty`,children:`空 —— 把「更多」里的项拖到这里`}):null,d.map(t=>{let n=j(e,t.id),r=p.findIndex(e=>e.id===t.id);return(0,_.jsxs)(`div`,{className:U(t,!0),draggable:!z(e,t.id),"data-row-id":t.id,tabIndex:z(e,t.id)?void 0:0,role:`listitem`,"aria-label":`${n.label||t.id}:拖动排序,Alt+上下换位`,onKeyDown:e=>F(t,e),onDragStart:e=>h(e,t),onDragEnd:v,children:[(0,_.jsx)(`span`,{className:`tlp-hnd`,title:z(e,t.id)?`锁定`:`拖动排序`,children:z(e,t.id)?`·`:`⋮⋮`}),(0,_.jsx)(`input`,{type:`checkbox`,checked:!0,disabled:!!n.noHide,onChange:()=>A(t.id),title:n.noHide?`不可隐藏`:`收入「更多」`}),(0,_.jsxs)(`span`,{className:`tlp-nm`,children:[n.label||t.id,n.noHide?(0,_.jsx)(`span`,{className:`tlp-sub`,children:`固定显示`}):null]}),z(e,t.id)?null:(0,_.jsxs)(`span`,{className:`tlp-acts`,children:[(0,_.jsx)(`button`,{type:`button`,className:`btn ghost sm`,disabled:r<=0,title:`上移`,onClick:()=>M(t,-1),children:`↑`}),(0,_.jsx)(`button`,{type:`button`,className:`btn ghost sm`,disabled:r<0||r>=p.length-1,title:`下移`,onClick:()=>M(t,1),children:`↓`})]})]},t.id)})]})]}),(0,_.jsxs)(`div`,{className:`tlp-section`,children:[(0,_.jsx)(`div`,{className:`tlp-section-label`,children:`更多菜单(拖到上方 = 显示到工具栏;拖回这里 = 收入更多)`}),(0,_.jsxs)(`div`,{className:`tlp-list tlp-menu`+(o===`menu`?` dropping`:``),role:`list`,onDragOver:w,onDragLeave:E,onDrop:T,children:[f.map(t=>{let n=j(e,t.id);return(0,_.jsxs)(`div`,{className:U(t,!1),draggable:!0,role:`listitem`,onDragStart:e=>h(e,t),onDragEnd:v,children:[(0,_.jsx)(`span`,{className:`tlp-hnd`,title:`拖到上方工具栏 = 显示`,children:`⋮⋮`}),(0,_.jsx)(`input`,{type:`checkbox`,checked:!1,onChange:()=>A(t.id),title:`显示到工具栏`}),(0,_.jsx)(`span`,{className:`tlp-nm`,children:n.label||t.id})]},t.id)}),(0,_.jsx)(`div`,{className:`tlp-drop-hint`,role:`presentation`,children:o===`menu`?`松手 = 收入「更多」`:f.length?`把项拖到上方工具栏区域 = 显示到工具栏`:`工具栏上的按钮拖到这里即可收入「更多」`})]})]})]}),(0,_.jsxs)(`div`,{className:`tlp-foot`,children:[(0,_.jsx)(`span`,{className:`tlp-equiv`,children:`保存到本机 localStorage(每种工具区各存一份)`}),(0,_.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:R,children:`恢复默认`}),(0,_.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:r,children:`取消`}),(0,_.jsx)(`button`,{type:`button`,className:`btn sm primary`,onClick:L,children:`保存`})]})]})}var W=`task`,G=[{id:`edit`,label:`编辑`},{id:`task`,label:`任务`},{id:`view`,label:`查看`}];function K(){let[e,t]=(0,g.useState)(!1),[n,r]=(0,g.useState)({x:0,y:0}),i=(0,g.useRef)(null),a=(0,g.useRef)(null);return(0,g.useEffect)(()=>{if(!e)return;let n=e=>{let n=e.target;i.current?.contains(n)||a.current?.contains(n)||t(!1)};return document.addEventListener(`mousedown`,n),()=>document.removeEventListener(`mousedown`,n)},[e]),{open:e,setOpen:t,pos:n,setPos:r,ref:i,menuRef:a}}function q({menu:e,className:t=``,style:n,children:r}){return e.open?(0,S.createPortal)((0,_.jsx)(`div`,{className:`mdw-fmt-menu${t?` ${t}`:``}`,role:`menu`,ref:e.menuRef,style:{position:`fixed`,...e.pos,...n},children:r}),document.body):null}function J(e,t,n=`left`){let r=t.currentTarget.getBoundingClientRect(),i=r.bottom+4;e.setPos(n===`left`?{left:r.left,top:i}:{left:`auto`,right:Math.max(8,window.innerWidth-r.right),top:i}),e.setOpen(e=>!e)}function Y({mode:e,onMode:t,showMark:n,submitLabel:r,onNew:i,onSubmit:a,onChain:o,onPreview:s,onImg:c,onAtt:l,onImport:u,onClone:d,onFork:f,onComplete:p,onCancelTask:m,onMark:h,onDraft:v,onDelete:y,onOverview:b,onProg:x,onSource:C,onShortcuts:w,goalBadge:T,goalMenu:E}){let D=K(),{layout:O,setLayout:k}=R(W),[A,M]=(0,g.useState)(!1);(0,g.useEffect)(()=>{D.setOpen(!1)},[e]);let F={new:i&&{label:`新任务`,run:i},submit:{label:r||`提交`,run:a,primary:!0},mode:t&&{label:e===`edit`?`返回实时预览`:`源码模式`,hint:e===`edit`?`当前`:``,run:()=>t?.(e===`edit`?`split`:`edit`)},img:c&&{label:`插入图片`,run:c},att:l&&{label:`添加附件`,run:l},import:u&&e!==`split`?{label:`导入`,run:u}:null,draft:v&&e!==`split`?{label:`存草稿`,run:v}:null,chain:o&&{label:`任务链`,run:o},clone:d&&{label:`克隆任务`,run:d},fork:f&&{label:`Fork 任务`,run:f},complete:p&&{label:`标为完成`,run:p},"cancel-task":m&&{label:`取消任务`,run:m,danger:!0},mark:n&&h?{label:`评论`,run:h}:null,delete:y&&{label:`删除`,run:y,danger:!0},preview:s&&{label:`预览提示词`,run:s},overview:b&&{label:`总览`,run:b},prog:x&&{label:`进程`,run:x},source:C&&{label:`原文`,run:C},shortcuts:w&&{label:`快捷键`,run:w}},I=e=>e===`more`||!!F[e],L=O.filter(e=>N(W,e)&&I(e.id)),z=O.filter(e=>P(W,e)&&I(e.id)),B=e=>{F[e]?.run?.(),D.setOpen(!1)},V=e=>{if(e===`more`)return(0,_.jsx)(`div`,{className:`mdw-actions-more`,ref:D.ref,children:(0,_.jsx)(`button`,{type:`button`,className:`btn ghost sm${D.open?` on`:``}`,title:`更多操作`,"aria-expanded":D.open,"aria-haspopup":`menu`,onClick:e=>J(D,e,`right`),children:`更多`})},`more`);let t=F[e];return t?(0,_.jsx)(`button`,{type:`button`,className:t.primary?`btn sm primary`:`btn ghost sm`,onClick:()=>B(e),children:t.label},e):null},H=G.map(e=>({...e,items:z.filter(t=>j(W,t.id).menuGroup===e.id)})).filter(e=>e.items.length),Y=z.filter(e=>!j(W,e.id).menuGroup);return(0,_.jsxs)(`div`,{className:`mdw-toolbar`,children:[(0,_.jsx)(`div`,{className:`mdw-toolbar-left`,children:T&&(0,_.jsx)(`button`,{type:`button`,className:`mdw-goal-badge`,title:T.title,"aria-haspopup":`menu`,"aria-expanded":D.open,onClick:e=>J(D,e,`right`),children:T.label})}),(0,_.jsxs)(`div`,{className:`mdw-actions`,role:`group`,"aria-label":`任务操作`,children:[L.map(e=>V(e.id)),(0,_.jsxs)(q,{menu:D,className:`mdw-act-menu`,children:[E,E&&(0,_.jsx)(`div`,{className:`mdw-fmt-menu-sep`,role:`separator`}),H.map(e=>(0,_.jsxs)(`div`,{className:`mdw-fmt-menu-group`,role:`group`,"aria-label":e.label,children:[(0,_.jsx)(`div`,{className:`mdw-fmt-menu-cap`,children:e.label}),e.items.map(e=>{let t=F[e.id],n=t?.danger||j(W,e.id).danger;return(0,_.jsxs)(`button`,{type:`button`,role:`menuitem`,className:`mdw-fmt-menu-item`+(n?` danger`:``),onClick:()=>B(e.id),children:[t?.label||j(W,e.id).label||e.id,t?.hint?(0,_.jsx)(`span`,{className:`hint`,children:t.hint}):null]},e.id)})]},e.id)),Y.map(e=>{let t=F[e.id];return(0,_.jsx)(`button`,{type:`button`,role:`menuitem`,className:`mdw-fmt-menu-item`+(t?.danger||j(W,e.id).danger?` danger`:``),onClick:()=>B(e.id),children:t?.label||j(W,e.id).label||e.id},e.id)}),(0,_.jsx)(`div`,{className:`mdw-fmt-menu-sep`,role:`separator`}),(0,_.jsx)(`button`,{type:`button`,role:`menuitem`,className:`mdw-fmt-menu-item`,onClick:()=>{D.setOpen(!1),M(!0)},children:`自定义工具栏…`})]})]}),A&&(0,S.createPortal)((0,_.jsx)(`div`,{className:`ta-panel-mask`,onClick:()=>M(!1),children:(0,_.jsx)(`div`,{className:`ta-panel-wrap`,onClick:e=>e.stopPropagation(),children:(0,_.jsx)(U,{kind:W,layout:O,setLayout:k,onClose:()=>M(!1)})})}),document.body)]})}export{U as a,j as c,K as i,N as l,Y as n,R as o,J as r,P as s,q as t,x as u};
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
<!-- .ico 兜底:浏览器不认上面的 <link> 时会自己请求 /favicon.ico -->
|
|
13
13
|
<link rel="icon" type="image/x-icon" href="/favicon.ico">
|
|
14
14
|
<link rel="apple-touch-icon" sizes="512x512" href="/logo-rounded.png">
|
|
15
|
-
<script type="module" crossorigin src="/assets/index-
|
|
15
|
+
<script type="module" crossorigin src="/assets/index-BkLkooKe.js"></script>
|
|
16
16
|
<link rel="modulepreload" crossorigin href="/assets/task-status-DSrx0i66.js">
|
|
17
17
|
<link rel="modulepreload" crossorigin href="/assets/workspace-4tw7trV7.js">
|
|
18
18
|
<link rel="modulepreload" crossorigin href="/assets/app-context-BASCGAA-.js">
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
// auth 模块的 zod 契约:每个 action 一份入参 schema。
|
|
2
|
-
//
|
|
3
|
-
// 由 .tool/migrate-module.mjs 从 legacy flags 表机械迁来;命名约定 <camelCase(actionId)>Input
|
|
4
|
-
// (codegen 靠它自动拼 import 名)。
|
|
5
|
-
import { z } from 'zod';
|
|
6
|
-
|
|
7
|
-
// ---- auth.login ----
|
|
8
|
-
export const authLoginInput = z.object({
|
|
9
|
-
email: z.string(),
|
|
10
|
-
password: z.string().optional().describe("密码(省略则交互式隐藏输入)"),
|
|
11
|
-
baseUrl: z.string().optional().describe("后端地址,覆盖默认"),
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
// ---- auth.logout ----
|
|
15
|
-
export const authLogoutInput = z.object({
|
|
16
|
-
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
// ---- auth.status ----
|
|
20
|
-
export const authStatusInput = z.object({
|
|
21
|
-
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
// ---- auth.me ----
|
|
25
|
-
export const authMeInput = z.object({
|
|
26
|
-
|
|
27
|
-
});
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
// bundled 模块的 zod 契约:每个 action 一份入参 schema。
|
|
2
|
-
//
|
|
3
|
-
// 由 .tool/migrate-module.mjs 从 legacy flags 表机械迁来;命名约定 <camelCase(actionId)>Input
|
|
4
|
-
// (codegen 靠它自动拼 import 名)。
|
|
5
|
-
import { z } from 'zod';
|
|
6
|
-
|
|
7
|
-
// ---- bundled.list ----
|
|
8
|
-
export const bundledListInput = z.object({
|
|
9
|
-
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
// ---- bundled.groups ----
|
|
13
|
-
export const bundledGroupsInput = z.object({
|
|
14
|
-
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
// ---- bundled.install ----
|
|
18
|
-
export const bundledInstallInput = z.object({
|
|
19
|
-
name: z.string().optional(),
|
|
20
|
-
group: z.string().optional().describe("groups.json 里的组名(与 <name> 互斥)"),
|
|
21
|
-
to: z.string().optional(),
|
|
22
|
-
force: z.boolean().optional(),
|
|
23
|
-
all: z.boolean().optional().describe("装 assets/ 下的全部内置 skill(隐式覆盖,不需要 --force)"),
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
// ---- bundled.get ----
|
|
27
|
-
export const bundledGetInput = z.object({
|
|
28
|
-
name: z.string().optional(),
|
|
29
|
-
ref: z.string().optional(),
|
|
30
|
-
group: z.string().optional().describe("groups.json 里的组名(与 <name> 互斥)"),
|
|
31
|
-
to: z.string().optional(),
|
|
32
|
-
});
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
// db 模块的 zod 契约:每个 action 一份入参 schema。
|
|
2
|
-
//
|
|
3
|
-
// 由 .tool/migrate-module.mjs 从 legacy flags 表机械迁来;命名约定 <camelCase(actionId)>Input
|
|
4
|
-
// (codegen 靠它自动拼 import 名)。
|
|
5
|
-
import { z } from 'zod';
|
|
6
|
-
|
|
7
|
-
// ---- db.status ----
|
|
8
|
-
export const dbStatusInput = z.object({
|
|
9
|
-
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
// ---- db.migrate ----
|
|
13
|
-
export const dbMigrateInput = z.object({
|
|
14
|
-
'dry-run': z.boolean().optional().describe("演练:事务末尾回滚,库与 JSON 都不改"),
|
|
15
|
-
apply: z.boolean().optional().describe("显式执行(默认就是执行,此标志让脚本自证意图)"),
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
// ---- db.verify ----
|
|
19
|
-
export const dbVerifyInput = z.object({
|
|
20
|
-
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
// ---- db.backup ----
|
|
24
|
-
export const dbBackupInput = z.object({
|
|
25
|
-
dir: z.string().optional().describe("备份目录(缺省 ~/.nx-kv/backups/)"),
|
|
26
|
-
keep: z.number().default(5).describe("保留最近几份(0 = 不清理)"),
|
|
27
|
-
});
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
// docs 模块的 zod 契约:每个 action 一份入参 schema。
|
|
2
|
-
//
|
|
3
|
-
// 由 .tool/migrate-module.mjs 从 legacy flags 表机械迁来;命名约定 <camelCase(actionId)>Input
|
|
4
|
-
// (codegen 靠它自动拼 import 名)。
|
|
5
|
-
import { z } from 'zod';
|
|
6
|
-
|
|
7
|
-
// ---- doc.list ----
|
|
8
|
-
export const docListInput = z.object({
|
|
9
|
-
external: z.boolean().optional().describe("附带外部绑定闭包内的文档与绑定清单"),
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
// ---- doc.get ----
|
|
13
|
-
export const docGetInput = z.object({
|
|
14
|
-
ref: z.string(),
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
// ---- doc.add ----
|
|
18
|
-
export const docAddInput = z.object({
|
|
19
|
-
rel: z.string(),
|
|
20
|
-
body: z.string().optional().describe("Markdown 正文"),
|
|
21
|
-
bodyFile: z.string().optional().describe("从文件读正文(--body 优先);`-` = 读标准输入"),
|
|
22
|
-
'body-file': z.string().optional().describe("同 --bodyFile(连字符写法)"),
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
// ---- doc.update ----
|
|
26
|
-
export const docUpdateInput = z.object({
|
|
27
|
-
ref: z.string(),
|
|
28
|
-
body: z.string().optional().describe("Markdown 全文"),
|
|
29
|
-
bodyFile: z.string().optional().describe("从文件读全文(--body 优先);`-` = 读标准输入"),
|
|
30
|
-
'body-file': z.string().optional().describe("同 --bodyFile(连字符写法)"),
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
// ---- doc.remove ----
|
|
34
|
-
export const docRemoveInput = z.object({
|
|
35
|
-
ref: z.string(),
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
// ---- doc.attachments ----
|
|
39
|
-
export const docAttachmentsInput = z.object({
|
|
40
|
-
ref: z.string(),
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
// ---- doc.attach ----
|
|
44
|
-
export const docAttachInput = z.object({
|
|
45
|
-
ref: z.string(),
|
|
46
|
-
path: z.string().optional().describe("本机文件路径(落本机附件仓)"),
|
|
47
|
-
fileId: z.string().optional().describe("已有附件 id"),
|
|
48
|
-
url: z.string().optional().describe("外部链接(http/https)"),
|
|
49
|
-
task: z.string().optional().describe("任务全局 id(kind=task)"),
|
|
50
|
-
doc: z.string().optional().describe("另一篇文档的 ref/path(kind=ref)"),
|
|
51
|
-
name: z.string().optional().describe("显示名(默认取文件名/原名)"),
|
|
52
|
-
note: z.string().optional().describe("附件区备注"),
|
|
53
|
-
noEmbed: z.boolean().optional().describe("只写 ref_attach(role=attach),不改正文"),
|
|
54
|
-
'no-embed': z.boolean().optional().describe("同 --noEmbed"),
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
// ---- doc.attach-note ----
|
|
58
|
-
export const docAttachNoteInput = z.object({
|
|
59
|
-
ref: z.string(),
|
|
60
|
-
attachment: z.string().describe("资源 id(见 docs attachments)"),
|
|
61
|
-
note: z.string().optional().describe("说明文字(留空 = 清掉)"),
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
// ---- doc.detach ----
|
|
65
|
-
export const docDetachInput = z.object({
|
|
66
|
-
ref: z.string(),
|
|
67
|
-
attachment: z.string().describe("资源 id(见 docs attachments)"),
|
|
68
|
-
purge: z.boolean().optional().describe("连资源与字节一起删(仍被引用时拒绝)"),
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
// ---- docs.seed ----
|
|
72
|
-
export const docsSeedInput = z.object({
|
|
73
|
-
apply: z.boolean().optional().describe("执行播种(缺省只预览)"),
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
// ---- docs.bind ----
|
|
77
|
-
export const docsBindInput = z.object({
|
|
78
|
-
repo: z.string().optional().describe("仓库(id / key / 路径 / 名称)"),
|
|
79
|
-
board: z.string().optional().describe("看板(id / key / 名称)"),
|
|
80
|
-
rel: z.string().optional().describe("自有树内路径(如 repo/github.com/me/x.md)"),
|
|
81
|
-
path: z.string().optional().describe("外部文件/目录绝对路径(如 Obsidian vault;只读,不进 zip)"),
|
|
82
|
-
reset: z.boolean().optional().describe("拆掉覆盖,回到约定路径"),
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
// ---- docs.notebind ----
|
|
86
|
-
export const docsNotebindInput = z.object({
|
|
87
|
-
board: z.string(),
|
|
88
|
-
repo: z.string().describe("仓库(id / key / 路径 / 名称)"),
|
|
89
|
-
rel: z.string().optional().describe("自有树内路径"),
|
|
90
|
-
path: z.string().optional().describe("外部文件/目录绝对路径(只读)"),
|
|
91
|
-
reset: z.boolean().optional().describe("拆掉覆盖,回到约定路径"),
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
// ---- docs.link ----
|
|
95
|
-
export const docsLinkInput = z.object({
|
|
96
|
-
board: z.string(),
|
|
97
|
-
doc: z.string().optional().describe("自有树路径 = 自有文档;盘符/绝对路径 = 外部只读引用"),
|
|
98
|
-
note: z.string().optional().describe("条目说明"),
|
|
99
|
-
tag: z.string().optional().describe("分类标签(如 qa;简介行渲染成小 chip;空串 = 清掉)"),
|
|
100
|
-
remove: z.number().optional().describe("移除第 N 条(1 起)"),
|
|
101
|
-
before: z.number().optional().describe("插到第 N 条之前(缺省追加到末尾)"),
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
// ---- docs.index ----
|
|
105
|
-
export const docsIndexInput = z.object({
|
|
106
|
-
|
|
107
|
-
});
|