nx-kv 0.65.3 → 0.66.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +40 -0
- package/README.md +15 -37
- package/assets/nx-kv/QUICKSTART.md +110 -0
- package/assets/nx-kv/SKILL.md +7 -2
- package/assets/nx-kv/references/A02-/346/217/220/344/272/244/344/273/273/345/212/241.md +59 -4
- package/assets/nx-kv/references/A05-/344/273/273/345/212/241/351/223/276/344/270/216/345/217/215/351/246/210/346/261/207/346/200/273.md +1 -1
- package/assets/nx-kv/references/A06-/345/217/202/350/200/203/344/273/223/345/272/223/351/251/261/345/212/250/347/232/204/345/274/200/345/217/221.md +143 -0
- package/assets/nx-kv/references/A07-/344/273/273/345/212/241/351/223/276/345/233/236/351/241/276/344/270/216/346/243/200/347/264/242.md +86 -0
- package/assets/nx-kv/references/B02-CLI/351/200/237/346/237/245.md +1 -2
- package/package.json +2 -2
- package/src/core/config.ts +72 -0
- package/src/core/db/driver.ts +1 -1
- package/src/core/db/migrations/index.ts +2 -0
- package/src/core/db/migrations/v14.sql +37 -0
- package/src/core/db/version.ts +1 -1
- package/src/core/instruction-template.ts +1 -1
- package/src/core/workflow/project.ts +1 -1
- package/src/core/workflow/types.ts +2 -2
- package/src/modules/bundled/actions/_manifest.generated.ts +12 -12
- package/src/modules/bundled/actions/{bundled-get.ts → skill-get.ts} +4 -4
- package/src/modules/bundled/actions/{bundled-groups.ts → skill-groups.ts} +4 -4
- package/src/modules/bundled/actions/{bundled-install.ts → skill-install.ts} +4 -4
- package/src/modules/bundled/actions/{bundled-list.ts → skill-list.ts} +4 -4
- package/src/modules/claim/actions/_manifest.generated.ts +3 -6
- package/src/modules/claim/actions/{localtask-claim.ts → localtask-get.ts} +18 -9
- package/src/modules/claim/actions/localtask-preview.ts +2 -2
- package/src/modules/{delivery → claim}/assemble.ts +3 -3
- package/src/modules/claim/get.ts +3 -4
- package/src/modules/{delivery → claim}/groupctx.ts +4 -7
- package/src/modules/{delivery → claim}/host.ts +4 -4
- package/src/modules/claim/index.ts +2 -2
- package/src/modules/claim/panel-escort.ts +2 -2
- package/src/modules/claim/params.ts +2 -2
- package/src/modules/{delivery → claim}/preview.ts +3 -3
- package/src/modules/claim/wait.ts +19 -19
- package/src/modules/claim/waitgoal-config.ts +1 -22
- package/src/modules/docs/actions/_manifest.generated.ts +49 -37
- package/src/modules/docs/actions/{doc-attach.ts → docs-attach.ts} +4 -4
- package/src/modules/docs/actions/{doc-attachments.ts → docs-attachments.ts} +4 -4
- package/src/modules/docs/actions/{doc-detach.ts → docs-detach.ts} +4 -4
- package/src/modules/docs/actions/{doc-get.ts → docs-get.ts} +4 -4
- package/src/modules/docs/actions/{doc-link-file.ts → docs-link-file.ts} +3 -3
- package/src/modules/docs/actions/{doc-list.ts → docs-list.ts} +4 -4
- package/src/modules/docs/actions/{doc-mdfile.ts → docs-mdfile.ts} +3 -3
- package/src/modules/docs/actions/{doc-mdfiles.ts → docs-mdfiles.ts} +3 -3
- package/src/modules/docs/actions/{docs-notebind.ts → docs-note-bind.ts} +3 -3
- package/src/modules/docs/actions/{doc-ref.ts → docs-ref.ts} +4 -4
- package/src/modules/docs/actions/{doc-remove.ts → docs-remove.ts} +4 -4
- package/src/modules/docs/actions/{doc-update.ts → docs-set.ts} +4 -4
- package/src/modules/docs/actions/{doc-unbind.ts → docs-unbind.ts} +4 -4
- package/src/modules/{repos → docs}/actions/repo-doc-add.ts +3 -2
- package/src/modules/{repos → docs}/actions/repo-doc-list.ts +3 -2
- package/src/modules/{repos → docs}/actions/repo-doc-remove.ts +3 -2
- package/src/modules/{repos → docs}/actions/repo-knowledge.ts +3 -2
- package/src/modules/docs/host-scrub.ts +1 -1
- package/src/modules/docs/index.ts +1 -1
- package/src/modules/docs/knowledge.ts +8 -16
- package/src/modules/goals/actions/timegoal-check.ts +1 -1
- package/src/modules/goals/actions/timegoal-clear.ts +1 -1
- package/src/modules/goals/actions/timegoal-list.ts +1 -1
- package/src/modules/goals/actions/timegoal-log.ts +1 -1
- package/src/modules/goals/actions/timegoal-set.ts +1 -1
- package/src/modules/goals/actions/timegoal-show.ts +1 -1
- package/src/modules/goals/actions/timegoal-update.ts +1 -1
- package/src/modules/goals/plugins/timegoal-cwd-store.ts +1 -1
- package/src/modules/goals/plugins/timegoal-store.ts +3 -3
- package/src/modules/goals/plugins/timegoal-task-store.ts +2 -2
- package/src/modules/{localtask → goals}/support.ts +3 -1
- package/src/modules/localtask/actions/_manifest.generated.ts +14 -14
- package/src/modules/localtask/actions/localtask-add.ts +3 -3
- package/src/modules/localtask/actions/localtask-attach-note.ts +1 -1
- package/src/modules/localtask/actions/localtask-attach.ts +1 -1
- package/src/modules/localtask/actions/localtask-attachments.ts +2 -2
- package/src/modules/localtask/actions/{localtask-cancelMany.ts → localtask-cancel-many.ts} +3 -3
- package/src/modules/localtask/actions/localtask-cancel.ts +1 -1
- package/src/modules/localtask/actions/localtask-chain.ts +1 -1
- package/src/modules/localtask/actions/{localtask-closeMany.ts → localtask-close-many.ts} +3 -3
- package/src/modules/localtask/actions/localtask-detach.ts +2 -2
- package/src/modules/localtask/actions/localtask-done.ts +1 -1
- package/src/modules/localtask/actions/localtask-list.ts +1 -1
- package/src/modules/localtask/actions/{localtask-removeMany.ts → localtask-remove-many.ts} +3 -3
- package/src/modules/localtask/actions/localtask-reopen.ts +5 -5
- package/src/modules/localtask/actions/{localtask-get.ts → localtask-show.ts} +17 -8
- package/src/modules/localtask/actions/localtask-tasks.ts +19 -4
- package/src/modules/localtask/actions/{localtask-timegoalLog.ts → localtask-timegoal-log.ts} +3 -3
- package/src/modules/localtask/actions/{localtask-topic-removeMany.ts → localtask-topic-remove-many.ts} +4 -4
- package/src/modules/localtask/actions/localtask-update.ts +2 -2
- package/src/modules/localtask/{bus → infra/bus}/index.ts +1 -1
- package/src/modules/localtask/{engine.ts → infra/engine.ts} +1 -1
- package/src/modules/localtask/{events.ts → infra/events.ts} +3 -3
- package/src/modules/localtask/{mutator → infra/mutator}/index.ts +2 -2
- package/src/modules/localtask/{mutator → infra/mutator}/validate.ts +4 -4
- package/src/modules/localtask/{repo → infra/repo}/goals.ts +2 -2
- package/src/modules/localtask/{repo → infra/repo}/index.ts +1 -1
- package/src/modules/localtask/{repo → infra/repo}/links.ts +3 -3
- package/src/modules/localtask/{repo → infra/repo}/open.ts +4 -4
- package/src/modules/localtask/{repo → infra/repo}/presence.ts +1 -1
- package/src/modules/localtask/{repo → infra/repo}/rows.ts +1 -1
- package/src/modules/localtask/{repo → infra/repo}/settings.ts +9 -6
- package/src/modules/localtask/{repo → infra/repo}/snapshot.ts +9 -7
- package/src/modules/localtask/{repo → infra/repo}/tasks.ts +82 -4
- package/src/modules/localtask/{repo → infra/repo}/topics.ts +3 -3
- package/src/modules/localtask/{repo-ctx.ts → infra/repo-ctx.ts} +1 -1
- package/src/modules/localtask/{scheduler → infra/scheduler}/index.ts +1 -1
- package/src/modules/localtask/{scheduler → infra/scheduler}/state-drive.ts +4 -4
- package/src/modules/localtask/{store → infra/store}/file-adapter.ts +2 -2
- package/src/modules/localtask/{store → infra/store}/index.ts +4 -4
- package/src/modules/localtask/{store → infra/store}/memory-adapter.ts +2 -2
- package/src/modules/localtask/{store-io.ts → infra/store-io.ts} +1 -1
- package/src/modules/localtask/{writes.ts → infra/writes.ts} +3 -3
- package/src/modules/localtask/{add.ts → lifecycle/add.ts} +5 -5
- package/src/modules/localtask/{deletion.ts → lifecycle/deletion.ts} +4 -4
- package/src/modules/localtask/{task-lifecycle.ts → lifecycle/task-lifecycle.ts} +27 -24
- package/src/modules/localtask/{task-ops.ts → lifecycle/task-ops.ts} +19 -18
- package/src/modules/localtask/{task-remove.ts → lifecycle/task-remove.ts} +5 -5
- package/src/modules/localtask/{task-templates.ts → lifecycle/task-templates.ts} +2 -2
- package/src/modules/localtask/{task-view.ts → lifecycle/task-view.ts} +39 -13
- package/src/modules/localtask/{topics.ts → lifecycle/topics.ts} +7 -7
- package/src/modules/localtask/{update.ts → lifecycle/update.ts} +5 -5
- package/src/modules/{delivery → localtask/ops}/attach-resource.ts +4 -4
- package/src/modules/{delivery → localtask/ops}/attach-template.ts +3 -3
- package/src/modules/{delivery → localtask/ops}/attach.ts +11 -11
- package/src/modules/localtask/{board-target.ts → ops/board-target.ts} +1 -1
- package/src/modules/{delivery → localtask/ops}/doc-inline.ts +3 -3
- package/src/modules/localtask/{group-store.ts → ops/group-store.ts} +1 -1
- package/src/modules/localtask/service.ts +16 -16
- package/src/modules/localtask/{action-render.ts → ui/action-render.ts} +18 -4
- package/src/modules/localtask/{contract-views.ts → ui/contract-views.ts} +9 -4
- package/src/modules/localtask/{panel-guard.ts → ui/panel-guard.ts} +1 -1
- package/src/modules/localtask/{panel-presence.ts → ui/panel-presence.ts} +6 -6
- package/src/modules/localtask/waiters.ts +2 -2
- package/src/modules/localtask/waiting.ts +1 -1
- package/src/modules/promptplug/factory.ts +2 -2
- package/src/modules/promptplug/index.ts +5 -5
- package/src/modules/promptplug/plugins/attachment.ts +1 -1
- package/src/modules/promptplug/plugins/context.ts +9 -20
- package/src/modules/promptplug/plugins/goal-prompt.ts +1 -1
- package/src/modules/promptplug/template-store.ts +163 -58
- package/src/modules/repos/actions/_manifest.generated.ts +0 -12
- package/src/modules/repos/service/crud.ts +1 -1
- package/src/modules/setting/actions/setting-set.ts +1 -0
- package/src/modules/setting/service.ts +15 -1
- package/src/modules/templates/actions/_manifest.generated.ts +18 -18
- package/src/modules/templates/actions/{templates-add.ts → template-add.ts} +4 -4
- package/src/modules/templates/actions/{templates-default.ts → template-default.ts} +4 -4
- package/src/modules/templates/actions/{templates-list.ts → template-list.ts} +4 -4
- package/src/modules/templates/actions/{templates-remove.ts → template-remove.ts} +4 -4
- package/src/modules/templates/actions/{templates-reorder.ts → template-reorder.ts} +4 -4
- package/src/modules/templates/actions/{templates-update.ts → template-update.ts} +4 -4
- package/src/runtime/cli.ts +1 -1
- package/src/runtime/registry.ts +0 -2
- package/src/{modules/delivery → shared}/delivery-text.ts +5 -4
- package/src/shared/feedback-text.ts +80 -20
- package/src/shared/task-status.ts +42 -0
- package/src/web/frontend/App.tsx +10 -9
- package/src/web/frontend/api/cli-tree.json +307 -322
- package/src/web/frontend/api/client.generated.ts +285 -283
- package/src/web/frontend/components/doc/doc-head.tsx +1 -1
- package/src/web/frontend/components/layout/crumbs.ts +3 -9
- package/src/web/frontend/components/md/{attach-area.tsx → attachments/attach-area.tsx} +5 -5
- package/src/web/frontend/components/md/{attach-bar.tsx → attachments/attach-bar.tsx} +1 -1
- package/src/web/frontend/components/md/{attach-common.ts → attachments/attach-common.ts} +1 -1
- package/src/web/frontend/components/md/{attach-modal.tsx → attachments/attach-modal.tsx} +4 -4
- package/src/web/frontend/components/md/{attach-picker.tsx → attachments/attach-picker.tsx} +4 -4
- package/src/web/frontend/components/md/{attachments.ts → attachments/attachments.ts} +1 -1
- package/src/web/frontend/components/md/{composer-launch.ts → composer/composer-launch.ts} +3 -3
- package/src/web/frontend/components/md/{composer-panel.tsx → composer/composer-panel.tsx} +12 -12
- package/src/web/frontend/components/md/{use-live-preview.ts → hooks/use-live-preview.ts} +8 -8
- package/src/web/frontend/components/md/{use-slash-menu.ts → hooks/use-slash-menu.ts} +4 -4
- package/src/web/frontend/components/md/{use-source-editor.ts → hooks/use-source-editor.ts} +7 -7
- package/src/web/frontend/components/md/{sel-menu.tsx → menus/sel-menu.tsx} +1 -1
- package/src/web/frontend/components/md/model/autolink-angle/index.ts +20 -0
- package/src/web/frontend/components/md/model/code/index.ts +30 -0
- package/src/web/frontend/components/md/model/divider/index.ts +19 -0
- package/src/web/frontend/components/md/model/emphasis/index.ts +21 -0
- package/src/web/frontend/components/md/model/escape/index.ts +35 -0
- package/src/web/frontend/components/md/model/footnote/index.ts +77 -0
- package/src/web/frontend/components/md/model/heading/index.ts +19 -0
- package/src/web/frontend/components/md/model/highlight/index.ts +10 -0
- package/src/web/frontend/components/md/model/image/index.ts +31 -0
- package/src/web/frontend/components/md/model/inline-scan.ts +47 -0
- package/src/web/frontend/components/md/model/link-ref/index.ts +41 -0
- package/src/web/frontend/components/md/model/list-common.ts +97 -0
- package/src/web/frontend/components/md/model/math/index.ts +70 -0
- package/src/web/frontend/components/md/model/math/latex.ts +106 -0
- package/src/web/frontend/components/md/model/ordered-list/index.ts +27 -0
- package/src/web/frontend/components/md/model/paragraph/index.ts +19 -0
- package/src/web/frontend/components/md/model/quote/index.ts +63 -0
- package/src/web/frontend/components/md/model/registry.ts +74 -0
- package/src/web/frontend/components/md/model/table/index.ts +100 -0
- package/src/web/frontend/components/md/model/types.ts +92 -0
- package/src/web/frontend/components/md/model/unordered-list/index.ts +37 -0
- package/src/web/frontend/components/md/{live-block.tsx → panes/live-block.tsx} +3 -3
- package/src/web/frontend/components/md/{md-panes-helpers.ts → panes/md-panes-helpers.ts} +15 -4
- package/src/web/frontend/components/md/{md-panes-keys.ts → panes/md-panes-keys.ts} +3 -3
- package/src/web/frontend/components/md/{md-panes-root.tsx → panes/md-panes-root.tsx} +2 -2
- package/src/web/frontend/components/md/{md-panes.tsx → panes/md-panes.tsx} +12 -12
- package/src/web/frontend/components/md/{ack-rail.tsx → rails/ack-rail.tsx} +2 -2
- package/src/web/frontend/components/md/{block-rail.tsx → rails/block-rail.tsx} +2 -2
- package/src/web/frontend/components/md/{doc-outline-rail.tsx → rails/doc-outline-rail.tsx} +1 -1
- package/src/web/frontend/components/md/{shortcut-sheet.tsx → shell/shortcut-sheet.tsx} +1 -1
- package/src/web/frontend/components/md/{tool-bar.tsx → shell/tool-bar.tsx} +5 -7
- package/src/web/frontend/components/md/standalone/task-chain-graph.tsx +194 -0
- package/src/web/frontend/components/md/{task-chain.tsx → standalone/task-chain.tsx} +34 -11
- package/src/web/frontend/components/md/{template-editor.tsx → standalone/template-editor.tsx} +2 -2
- package/src/web/frontend/components/repos/get-loop-members.tsx +54 -0
- package/src/web/frontend/components/repos/get-loop-modal.tsx +6 -4
- package/src/web/frontend/components/sidebar/brand-row.tsx +30 -0
- package/src/web/frontend/components/sidebar/drag.ts +53 -1
- package/src/web/frontend/components/sidebar/index.tsx +121 -62
- package/src/web/frontend/components/sidebar/model.ts +102 -7
- package/src/web/frontend/components/sidebar/ns-add-modal.tsx +81 -0
- package/src/web/frontend/components/sidebar/ns-dialogs.tsx +67 -0
- package/src/web/frontend/components/sidebar/ns-manage-modal.tsx +56 -0
- package/src/web/frontend/components/sidebar/ns-modal.tsx +58 -0
- package/src/web/frontend/components/sidebar/ns-observe-modal.tsx +36 -0
- package/src/web/frontend/components/sidebar/ns-picker.tsx +134 -0
- package/src/web/frontend/components/sidebar/ns-row.tsx +70 -0
- package/src/web/frontend/components/sidebar/row-menu.tsx +39 -5
- package/src/web/frontend/components/sidebar/search-row.tsx +37 -0
- package/src/web/frontend/components/sidebar/use-ns.ts +178 -0
- package/src/web/frontend/components/sidebar/use-sidebar-ns.ts +64 -0
- package/src/web/frontend/components/task-panel/task-row.tsx +26 -0
- package/src/web/frontend/components/tool-acts/bar.tsx +7 -7
- package/src/web/frontend/components/tool-acts/modules.ts +7 -4
- package/src/web/frontend/components/use-rail-drag.ts +1 -1
- package/src/web/frontend/modules/board/ack-nodes.ts +11 -14
- package/src/web/frontend/modules/board/ack-rail-pos.ts +1 -1
- package/src/web/frontend/modules/board/reopen-text.ts +5 -0
- package/src/web/frontend/modules/board/task-search.ts +43 -0
- package/src/web/frontend/modules/md/attach-mention.ts +2 -2
- package/src/web/frontend/modules/md/doc-store.ts +2 -2
- package/src/web/frontend/modules/md/md-blocks.ts +18 -1
- package/src/web/frontend/modules/md/md-edit-ops.ts +18 -3
- package/src/web/frontend/modules/md/md-render.ts +108 -179
- package/src/web/frontend/modules/md/styles/docs.css +89 -0
- package/src/web/frontend/modules/md/styles/editor.css +33 -7
- package/src/web/frontend/modules/md/styles/panels.css +107 -2
- package/src/web/frontend/page/dir/landing.tsx +35 -0
- package/src/web/frontend/page/dir/task-actions.ts +2 -2
- package/src/web/frontend/page/dir/task-chain.ts +5 -2
- package/src/web/frontend/page/dir/task-dock-panel.tsx +19 -28
- package/src/web/frontend/page/dir/task-feedback.ts +4 -4
- package/src/web/frontend/page/dir/task-utils.ts +19 -3
- package/src/web/frontend/page/dir/task.tsx +16 -13
- package/src/web/frontend/page/doc/doc-dock.tsx +1 -1
- package/src/web/frontend/page/doc/index.tsx +4 -4
- package/src/web/frontend/page/group/index.tsx +47 -2
- package/src/web/frontend/page/progress/api.ts +5 -0
- package/src/web/frontend/page/progress/chain-view.tsx +108 -0
- package/src/web/frontend/page/progress/index.tsx +210 -152
- package/src/web/frontend/page/repos/index.tsx +0 -11
- package/src/web/frontend/page/repos/repo-table.tsx +1 -20
- package/src/web/frontend/page/settings/api.ts +0 -4
- package/src/web/frontend/page/settings/index.tsx +1 -12
- package/src/web/frontend/page/settings/prompt-template-editor.tsx +1 -1
- package/src/web/frontend/page/settings/prompt-templates-section.tsx +1 -1
- package/src/web/frontend/page/templates/index.tsx +3 -3
- package/src/web/frontend/page/templates/manage.tsx +1 -1
- package/src/web/frontend/panels.tsx +2 -8
- package/src/web/frontend/prefs.ts +4 -3
- package/src/web/frontend/registry.ts +0 -1
- package/src/web/frontend/routes/index.ts +1 -2
- package/src/web/frontend/routes/static.ts +0 -1
- package/src/web/frontend/styles-v2/dag.css +17 -2
- package/src/web/frontend/styles-v2/dir.css +0 -36
- package/src/web/frontend/styles-v2/sidebar.css +92 -1
- package/src/web/frontend/types.ts +22 -1
- package/src/web/frontend/use-ns-persist.ts +63 -0
- package/src/web/frontend/workspace/areas.ts +1 -3
- package/src/web/frontend/workspace/panels.ts +1 -1
- package/src/web/public/assets/bar-Dy_QDX2h.js +1 -0
- package/src/web/public/assets/board-view-Cm8189wG.js +1 -0
- package/src/web/public/assets/composer-launch-B7DH53Yf.js +1 -0
- package/src/web/public/assets/composer-panel-CWFFEe5a.js +1 -0
- package/src/web/public/assets/dag-DjtLPr3j.js +1 -0
- package/src/web/public/assets/dir-DPboO_1M.js +3 -0
- package/src/web/public/assets/doc-_iteSM2X.js +6 -0
- package/src/web/public/assets/get-loop-modal-BW2dD9kv.js +2 -0
- package/src/web/public/assets/group-UEOT29Zq.js +1 -0
- package/src/web/public/assets/index-BpNXBbNQ.css +1 -0
- package/src/web/public/assets/index-BxrcTrww.js +3 -0
- package/src/web/public/assets/md-history-Bj790fdn.js +46 -0
- package/src/web/public/assets/progress-MPse2JLQ.js +3 -0
- package/src/web/public/assets/refs-DiIPoqnJ.js +2 -0
- package/src/web/public/assets/{repo-form-modal-Dg3hJWUV.js → repo-form-modal-CNLYR12c.js} +1 -1
- package/src/web/public/assets/repos-BGx-yAXd.js +12 -0
- package/src/web/public/assets/route-crumb-DX9C4jmQ.js +1 -0
- package/src/web/public/assets/settings-buy_qJGW.js +1 -0
- package/src/web/public/assets/task-DHlwHURz.js +13 -0
- package/src/web/public/assets/task-status-Cjsm0xF7.js +7 -0
- package/src/web/public/assets/task-utils-CJfMODCP.js +13 -0
- package/src/web/public/assets/templates-DdMaVWok.js +10 -0
- package/src/web/public/assets/tool-bar-D5wLBLRl.js +28 -0
- package/src/web/public/assets/use-rail-drag-CNOHXWng.js +1 -0
- package/src/web/public/index.html +11 -13
- package/src/modules/claim/actions/localtask-wait.ts +0 -41
- package/src/modules/delivery/index.ts +0 -18
- package/src/web/frontend/modules/md/progress-chain.ts +0 -34
- package/src/web/frontend/page/overview/api.ts +0 -29
- package/src/web/frontend/page/overview/index.tsx +0 -378
- package/src/web/frontend/page/settings/sidebar-section.tsx +0 -75
- package/src/web/public/assets/bar-Dc5Tq1eE.js +0 -1
- package/src/web/public/assets/board-view-BVennxTs.js +0 -1
- package/src/web/public/assets/composer-launch-fp2IzGzQ.js +0 -1
- package/src/web/public/assets/composer-panel-Dh681iO6.js +0 -1
- package/src/web/public/assets/dag-DnaU0I_z.js +0 -1
- package/src/web/public/assets/dir-d16q1GLe.js +0 -3
- package/src/web/public/assets/doc-DRSKD0Re.js +0 -6
- package/src/web/public/assets/frontmatter-CN6IlxWU.js +0 -2
- package/src/web/public/assets/group-Dc3ZgW24.js +0 -1
- package/src/web/public/assets/index-BIVxGd6t.css +0 -1
- package/src/web/public/assets/index-Bg0m8gbJ.js +0 -2
- package/src/web/public/assets/md-history-DNtgaIdH.js +0 -39
- package/src/web/public/assets/md-parse-C9Vd6ejP.js +0 -2
- package/src/web/public/assets/model-CtG2jIDv.js +0 -2
- package/src/web/public/assets/overview-C68QpcT9.js +0 -1
- package/src/web/public/assets/progress-CEmAFxo9.js +0 -3
- package/src/web/public/assets/refs-TzxZYy7T.js +0 -2
- package/src/web/public/assets/repos-uNqSR5YB.js +0 -12
- package/src/web/public/assets/route-crumb-C4DgkJ8G.js +0 -1
- package/src/web/public/assets/settings-BzIllshQ.js +0 -1
- package/src/web/public/assets/status-tag-8cLH8hl9.js +0 -1
- package/src/web/public/assets/task-DuFOXLPC.js +0 -11
- package/src/web/public/assets/task-row-CRjuAfKW.js +0 -1
- package/src/web/public/assets/task-utils-DAPxKm4c.js +0 -12
- package/src/web/public/assets/templates-DNiGvmdq.js +0 -10
- package/src/web/public/assets/use-rail-drag-DxIYcszo.js +0 -1
- package/src/web/public/assets/workspace-DojQ3RP4.js +0 -28
- /package/src/modules/localtask/{store → infra/store}/topic-adapter.ts +0 -0
- /package/src/modules/localtask/{action-flags.ts → ui/action-flags.ts} +0 -0
- /package/src/web/frontend/components/md/{use-block-drag.ts → hooks/use-block-drag.ts} +0 -0
- /package/src/web/frontend/components/md/{slash-menu.tsx → menus/slash-menu.tsx} +0 -0
- /package/src/web/frontend/components/md/{doc-keys.ts → panes/doc-keys.ts} +0 -0
- /package/src/web/frontend/components/md/{find-bar.tsx → shell/find-bar.tsx} +0 -0
- /package/src/web/frontend/components/md/{status-bar.tsx → shell/status-bar.tsx} +0 -0
- /package/src/web/public/assets/{md-history-CLIs9Dr0.css → tool-bar-CLIs9Dr0.css} +0 -0
|
@@ -1,20 +1,48 @@
|
|
|
1
|
-
// 段模板的用户数据(#161):每段可有多条模板,启用哪条自己挑。
|
|
1
|
+
// 段模板的用户数据(#161 / #238):每段可有多条模板,启用哪条自己挑。
|
|
2
2
|
//
|
|
3
3
|
// 真相仍是插件类里的 `templates`(出厂内置,代码即真相);这里只存**用户层**:
|
|
4
4
|
// - items:用户添加/复制的模板条目(builtin 永远在插件类里,不落盘)
|
|
5
5
|
// - activeId:该段当前启用的模板('builtin' 或用户条目 id)
|
|
6
6
|
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
7
|
+
// 落点(#238 起):settings 表,**一段一个键** `prompt.tpl.<segment>`,值是
|
|
8
|
+
// `{ activeId, items[] }` 的 JSON。为什么按段拆而不是整份 Store 一个键:
|
|
9
|
+
// - 写一段只碰一个键。整份键的「读全量 → 改一段 → 写全量」在并发下是典型
|
|
10
|
+
// lost update:A 改 ack、B 改 timecheck,后提交的把前一个抹掉。
|
|
11
|
+
// - 读也小:装配时 `activeTemplateTextOf(id)` 每轮会被调十几次,按段取只解析
|
|
12
|
+
// 这一小段,不再解析全量。
|
|
10
13
|
//
|
|
11
|
-
//
|
|
12
|
-
|
|
14
|
+
// 为什么不再细到「一条模板一个键」:settings 的硬规则(schema G2)是「凡需要
|
|
15
|
+
// 出现在 WHERE 里的东西不许进 settings」,前缀列举只给整表导出/清理用。按条目
|
|
16
|
+
// 拆键后「列某段的条目」只能靠前缀扫,等于把 k/v 当表查;且 activeId 与条目会
|
|
17
|
+
// 散在多键,删除/启用要跨键维护一致。**段**正好是「按键精确取值」的粒度。
|
|
18
|
+
//
|
|
19
|
+
// 迁移(两条来源,都只跑一次,按库路径记账):
|
|
20
|
+
// 1. `prompt.tplStore`(本方案第一版写的整份键)→ 拆成按段键后删掉旧键;
|
|
21
|
+
// 2. `~/.nx-kv/promptplug-templates.json`(#238 之前的裸文件)→ 写成按段键,
|
|
22
|
+
// 文件改名 `.migrated`(不删,留档)。
|
|
23
|
+
import { existsSync, readFileSync, renameSync } from 'node:fs';
|
|
13
24
|
import { join } from 'node:path';
|
|
14
25
|
import { APP_DIR } from '../../core/paths.js';
|
|
26
|
+
import { dbPath, openStore } from '../../core/db/index.js';
|
|
27
|
+
import { deleteSettingRaw, readSettingRaw, writeSettingRaw } from '../../core/db/settings.js';
|
|
28
|
+
import { tx } from '../../core/db/tx.js';
|
|
29
|
+
import type { DbApi } from '../../core/db/driver.js';
|
|
30
|
+
import { allPluginIds } from './registry.js';
|
|
15
31
|
import type { TemplateText } from './base.js';
|
|
16
32
|
|
|
17
|
-
|
|
33
|
+
/** 按段键的前缀(导出/清理可据此列举;读取只用精确键)。 */
|
|
34
|
+
export const SEGMENT_KEY_PREFIX = 'prompt.tpl.';
|
|
35
|
+
|
|
36
|
+
/** 某段在 settings 里的键。 */
|
|
37
|
+
export function segmentKey(segment: string): string {
|
|
38
|
+
return `${SEGMENT_KEY_PREFIX}${segment}`;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** 第一版方案用的「整份 Store」键;只作迁移源,不再写入。 */
|
|
42
|
+
export const WHOLE_STORE_KEY = 'prompt.tplStore';
|
|
43
|
+
|
|
44
|
+
/** #238 之前的老落点;只作迁移源,不再写入。 */
|
|
45
|
+
const LEGACY_FILE = join(APP_DIR, 'promptplug-templates.json');
|
|
18
46
|
|
|
19
47
|
export interface UserTemplate extends TemplateText {
|
|
20
48
|
/** 创建时间(epoch ms;排序/展示用) */
|
|
@@ -33,51 +61,135 @@ const DEFAULT_SEGMENT: SegmentTemplates = { activeId: 'builtin', items: [] };
|
|
|
33
61
|
|
|
34
62
|
type Store = Record<string, SegmentTemplates>;
|
|
35
63
|
|
|
36
|
-
function
|
|
64
|
+
function emptySegment(): SegmentTemplates {
|
|
65
|
+
return { ...DEFAULT_SEGMENT, items: [] };
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function cloneSegment(seg: SegmentTemplates): SegmentTemplates {
|
|
69
|
+
return { ...seg, items: [...seg.items] };
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** 外部数据边界:单段逐项校验(脏条目丢掉,缺 activeId 按 builtin)。 */
|
|
73
|
+
function normalizeSegment(raw: unknown): SegmentTemplates {
|
|
74
|
+
const seg = (raw && typeof raw === 'object' ? raw : {}) as Record<string, any>;
|
|
75
|
+
const items = Array.isArray(seg.items)
|
|
76
|
+
? (seg.items.filter(
|
|
77
|
+
(t: any) => t && typeof t.text === 'string' && typeof t.id === 'string' && t.id !== 'builtin',
|
|
78
|
+
) as UserTemplate[])
|
|
79
|
+
: [];
|
|
80
|
+
return { activeId: typeof seg.activeId === 'string' ? seg.activeId : 'builtin', items };
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** 整份 Store(迁移源用):逐段走同一套校验。 */
|
|
84
|
+
function normalizeStore(raw: unknown): Store {
|
|
85
|
+
if (!raw || typeof raw !== 'object') return {};
|
|
86
|
+
const out: Store = {};
|
|
87
|
+
for (const [id, seg] of Object.entries(raw as Record<string, any>)) {
|
|
88
|
+
if (!seg || typeof seg !== 'object') continue;
|
|
89
|
+
out[id] = normalizeSegment(seg);
|
|
90
|
+
}
|
|
91
|
+
return out;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/** 写一段(单事务、IMMEDIATE —— 与 core/config.ts 的偏好写入同款)。 */
|
|
95
|
+
function writeSegment(segment: string, seg: SegmentTemplates, conn?: DbApi): void {
|
|
96
|
+
const write = (c: DbApi) => writeSettingRaw(c, segmentKey(segment), seg);
|
|
97
|
+
if (conn) {
|
|
98
|
+
write(conn);
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
tx((c) => write(c), { db: openStore(), mode: 'IMMEDIATE' });
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// 迁移做过一次的库路径(env 换库时要重跑;迁移本身幂等)。
|
|
105
|
+
let migratedFor: string | null = null;
|
|
106
|
+
|
|
107
|
+
/** 把一个整份 Store 摊成按段键(同事务删旧键)。返回是否真处理过。 */
|
|
108
|
+
function splitWholeStoreKey(db: DbApi): boolean {
|
|
109
|
+
const old = readSettingRaw(db, WHOLE_STORE_KEY);
|
|
110
|
+
if (old === undefined) return false;
|
|
111
|
+
const store = normalizeStore(old);
|
|
112
|
+
const entries = Object.entries(store);
|
|
113
|
+
tx(
|
|
114
|
+
(conn) => {
|
|
115
|
+
for (const [seg, data] of entries) writeSegment(seg, data, conn);
|
|
116
|
+
deleteSettingRaw(conn, WHOLE_STORE_KEY);
|
|
117
|
+
},
|
|
118
|
+
{ db, mode: 'IMMEDIATE' },
|
|
119
|
+
);
|
|
120
|
+
return true;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/** legacy JSON → 按段键,成功后改名 `.migrated`。 */
|
|
124
|
+
function importLegacyFile(db: DbApi): void {
|
|
125
|
+
if (!existsSync(LEGACY_FILE)) return;
|
|
126
|
+
let store: Store;
|
|
37
127
|
try {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
activeId: typeof (seg as SegmentTemplates).activeId === 'string' ? (seg as SegmentTemplates).activeId : 'builtin',
|
|
52
|
-
items,
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
return out;
|
|
128
|
+
store = normalizeStore(JSON.parse(readFileSync(LEGACY_FILE, 'utf8')));
|
|
129
|
+
} catch {
|
|
130
|
+
return; // 老文件坏了:不迁移,等人工处理
|
|
131
|
+
}
|
|
132
|
+
const entries = Object.entries(store);
|
|
133
|
+
tx(
|
|
134
|
+
(conn) => {
|
|
135
|
+
for (const [seg, data] of entries) writeSegment(seg, data, conn);
|
|
136
|
+
},
|
|
137
|
+
{ db, mode: 'IMMEDIATE' },
|
|
138
|
+
);
|
|
139
|
+
try {
|
|
140
|
+
renameSync(LEGACY_FILE, `${LEGACY_FILE}.migrated`);
|
|
56
141
|
} catch {
|
|
57
|
-
|
|
142
|
+
// 改名失败不影响正确性:数据已在库,下次读到非空键就不会再导
|
|
58
143
|
}
|
|
59
144
|
}
|
|
60
145
|
|
|
61
|
-
|
|
146
|
+
/** 首次读写某段之前跑一次迁移(按库路径记账,失败不记账)。 */
|
|
147
|
+
function ensureMigrated(db: DbApi): void {
|
|
148
|
+
const path = dbPath();
|
|
149
|
+
if (migratedFor === path) return;
|
|
150
|
+
// 整份键比裸文件新:先摊它;摊到了就不再碰裸文件(避免用旧数据盖掉新数据)。
|
|
151
|
+
if (!splitWholeStoreKey(db)) importLegacyFile(db);
|
|
152
|
+
migratedFor = path;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/** 读一段的原始数据(undefined = 这个段从来没被写过)。 */
|
|
156
|
+
function readSegmentRaw(segment: string): SegmentTemplates | undefined {
|
|
157
|
+
const db = openStore();
|
|
158
|
+
ensureMigrated(db);
|
|
159
|
+
const raw = readSettingRaw(db, segmentKey(segment));
|
|
160
|
+
return raw === undefined ? undefined : normalizeSegment(raw);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* 读一段。**每次现读,不缓存**(设置页改完,下一次装配立即生效)。
|
|
165
|
+
* 读失败(库打不开 / 值损坏)回落默认段 —— 装配永远拿得到可用数据。
|
|
166
|
+
*/
|
|
167
|
+
function readSegment(segment: string): SegmentTemplates {
|
|
62
168
|
try {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
writeFileSync(tmp, JSON.stringify(store, null, 2), 'utf8');
|
|
66
|
-
renameSync(tmp, FILE);
|
|
169
|
+
const seg = readSegmentRaw(segment);
|
|
170
|
+
return seg ? cloneSegment(seg) : emptySegment();
|
|
67
171
|
} catch {
|
|
68
|
-
|
|
172
|
+
return emptySegment();
|
|
69
173
|
}
|
|
70
174
|
}
|
|
71
175
|
|
|
72
176
|
/** 某段的用户层模板数据(无记录 → 默认:启用 builtin、无条目)。 */
|
|
73
177
|
export function segmentTemplatesOf(id: string): SegmentTemplates {
|
|
74
|
-
|
|
75
|
-
return seg ? { ...seg, items: [...seg.items] } : { ...DEFAULT_SEGMENT, items: [] };
|
|
178
|
+
return readSegment(id);
|
|
76
179
|
}
|
|
77
180
|
|
|
78
|
-
/**
|
|
181
|
+
/** 全部段的用户层模板数据(设置页一次拉全;只列注册表里的段,不扫前缀)。 */
|
|
79
182
|
export function allSegmentTemplates(): Record<string, SegmentTemplates> {
|
|
80
|
-
|
|
183
|
+
const out: Record<string, SegmentTemplates> = {};
|
|
184
|
+
try {
|
|
185
|
+
for (const id of allPluginIds()) {
|
|
186
|
+
const seg = readSegmentRaw(id);
|
|
187
|
+
if (seg) out[id] = seg;
|
|
188
|
+
}
|
|
189
|
+
} catch {
|
|
190
|
+
return out;
|
|
191
|
+
}
|
|
192
|
+
return out;
|
|
81
193
|
}
|
|
82
194
|
|
|
83
195
|
export interface UpsertTemplateInput {
|
|
@@ -91,8 +203,7 @@ export interface UpsertTemplateInput {
|
|
|
91
203
|
|
|
92
204
|
/** 添加 / 更新一条用户模板;返回该段最新数据。 */
|
|
93
205
|
export function upsertTemplate({ segment, id, name, text }: UpsertTemplateInput): SegmentTemplates {
|
|
94
|
-
const
|
|
95
|
-
const seg = store[segment] || { ...DEFAULT_SEGMENT, items: [] };
|
|
206
|
+
const seg = readSegment(segment);
|
|
96
207
|
const body = String(text ?? '');
|
|
97
208
|
const title = String(name ?? '').trim() || '未命名模板';
|
|
98
209
|
const now = Date.now();
|
|
@@ -107,39 +218,33 @@ export function upsertTemplate({ segment, id, name, text }: UpsertTemplateInput)
|
|
|
107
218
|
seg.items.push({ id: nid, name: title, text: body, createdAt: now });
|
|
108
219
|
seg.activeId = nid; // 新建即启用(复制后修改的直感)
|
|
109
220
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
return { ...seg, items: [...seg.items] };
|
|
221
|
+
writeSegment(segment, seg);
|
|
222
|
+
return cloneSegment(seg);
|
|
113
223
|
}
|
|
114
224
|
|
|
115
225
|
/** 删除一条用户模板;删的是启用条目时回落 builtin。 */
|
|
116
226
|
export function deleteTemplate(segment: string, id: string): SegmentTemplates {
|
|
117
|
-
const
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
writeStore(store);
|
|
124
|
-
}
|
|
125
|
-
return segmentTemplatesOf(segment);
|
|
227
|
+
const seg = readSegmentRaw(segment);
|
|
228
|
+
if (!seg) return emptySegment(); // 从没写过这个段:不为了「删空」去建键
|
|
229
|
+
seg.items = seg.items.filter((t) => t.id !== id);
|
|
230
|
+
if (seg.activeId === id) seg.activeId = 'builtin';
|
|
231
|
+
writeSegment(segment, seg);
|
|
232
|
+
return cloneSegment(seg);
|
|
126
233
|
}
|
|
127
234
|
|
|
128
235
|
/** 切换某段启用的模板('builtin' 或用户条目 id;非法 id 静默回落 builtin)。 */
|
|
129
236
|
export function activateTemplate(segment: string, id: string): SegmentTemplates {
|
|
130
|
-
const
|
|
131
|
-
const seg = store[segment] || { ...DEFAULT_SEGMENT, items: [] };
|
|
237
|
+
const seg = readSegment(segment);
|
|
132
238
|
const key = String(id ?? '') || 'builtin';
|
|
133
239
|
seg.activeId = key === 'builtin' || seg.items.some((t) => t.id === key) ? key : 'builtin';
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
return { ...seg, items: [...seg.items] };
|
|
240
|
+
writeSegment(segment, seg);
|
|
241
|
+
return cloneSegment(seg);
|
|
137
242
|
}
|
|
138
243
|
|
|
139
244
|
/** 某段当前**启用模板的正文**(装配时传给插件构造;builtin → '' 用类内默认)。 */
|
|
140
245
|
export function activeTemplateTextOf(id: string): string {
|
|
141
|
-
const seg =
|
|
142
|
-
if (
|
|
246
|
+
const seg = readSegment(id);
|
|
247
|
+
if (seg.activeId === 'builtin') return '';
|
|
143
248
|
const hit = seg.items.find((t) => t.id === seg.activeId);
|
|
144
249
|
return hit ? String(hit.text ?? '') : '';
|
|
145
250
|
}
|
|
@@ -23,9 +23,6 @@ import { RepoBindTopicsAction } from './repo-bind-topics.js';
|
|
|
23
23
|
import { RepoBindAction } from './repo-bind.js';
|
|
24
24
|
import { RepoCloneAction } from './repo-clone.js';
|
|
25
25
|
import { RepoDetectAction } from './repo-detect.js';
|
|
26
|
-
import { RepoDocAddAction } from './repo-doc-add.js';
|
|
27
|
-
import { RepoDocListAction } from './repo-doc-list.js';
|
|
28
|
-
import { RepoDocRemoveAction } from './repo-doc-remove.js';
|
|
29
26
|
import { RepoExportAction } from './repo-export.js';
|
|
30
27
|
import { RepoGetAction } from './repo-get.js';
|
|
31
28
|
import { RepoImportDiffAction } from './repo-import-diff.js';
|
|
@@ -33,7 +30,6 @@ import { RepoImportAction } from './repo-import.js';
|
|
|
33
30
|
import { RepoKeyMigrateAction } from './repo-key-migrate.js';
|
|
34
31
|
import { RepoKeyRefreshAction } from './repo-key-refresh.js';
|
|
35
32
|
import { RepoKeySetAction } from './repo-key-set.js';
|
|
36
|
-
import { RepoKnowledgeAction } from './repo-knowledge.js';
|
|
37
33
|
import { RepoListAction } from './repo-list.js';
|
|
38
34
|
import { RepoOpenAction } from './repo-open.js';
|
|
39
35
|
import { RepoRefAddAction } from './repo-ref-add.js';
|
|
@@ -69,9 +65,6 @@ export const ACTIONS: readonly (new (deps: Container) => ActionBase)[] = [
|
|
|
69
65
|
RepoBindAction,
|
|
70
66
|
RepoCloneAction,
|
|
71
67
|
RepoDetectAction,
|
|
72
|
-
RepoDocAddAction,
|
|
73
|
-
RepoDocListAction,
|
|
74
|
-
RepoDocRemoveAction,
|
|
75
68
|
RepoExportAction,
|
|
76
69
|
RepoGetAction,
|
|
77
70
|
RepoImportDiffAction,
|
|
@@ -79,7 +72,6 @@ export const ACTIONS: readonly (new (deps: Container) => ActionBase)[] = [
|
|
|
79
72
|
RepoKeyMigrateAction,
|
|
80
73
|
RepoKeyRefreshAction,
|
|
81
74
|
RepoKeySetAction,
|
|
82
|
-
RepoKnowledgeAction,
|
|
83
75
|
RepoListAction,
|
|
84
76
|
RepoOpenAction,
|
|
85
77
|
RepoRefAddAction,
|
|
@@ -115,9 +107,6 @@ export { RepoBindTopicsAction };
|
|
|
115
107
|
export { RepoBindAction };
|
|
116
108
|
export { RepoCloneAction };
|
|
117
109
|
export { RepoDetectAction };
|
|
118
|
-
export { RepoDocAddAction };
|
|
119
|
-
export { RepoDocListAction };
|
|
120
|
-
export { RepoDocRemoveAction };
|
|
121
110
|
export { RepoExportAction };
|
|
122
111
|
export { RepoGetAction };
|
|
123
112
|
export { RepoImportDiffAction };
|
|
@@ -125,7 +114,6 @@ export { RepoImportAction };
|
|
|
125
114
|
export { RepoKeyMigrateAction };
|
|
126
115
|
export { RepoKeyRefreshAction };
|
|
127
116
|
export { RepoKeySetAction };
|
|
128
|
-
export { RepoKnowledgeAction };
|
|
129
117
|
export { RepoListAction };
|
|
130
118
|
export { RepoOpenAction };
|
|
131
119
|
export { RepoRefAddAction };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// 仓库登记 CRUD:清单、登记、更新、删除、单条查询、key 定位。
|
|
2
2
|
import { resolve } from 'node:path';
|
|
3
3
|
import { badInput, notFound, conflict } from '../../../core/errors.js';
|
|
4
|
-
import { sanitizeGetLoop } from '
|
|
4
|
+
import { sanitizeGetLoop } from '../../../core/config.js';
|
|
5
5
|
import repoLayer from '../repo/index.js';
|
|
6
6
|
import { loadStore, mutateStore } from './store.js';
|
|
7
7
|
import {
|
|
@@ -12,6 +12,7 @@ const input = z.object({
|
|
|
12
12
|
gitRepoRoot: z.string().optional().describe("参考仓库存储根目录(非 C 盘;空 = clone 参考仓库被拒绝)"),
|
|
13
13
|
gitDevRoot: z.string().optional().describe("导入布局时开发仓库的默认克隆根(空 = 只登记不克隆)"),
|
|
14
14
|
orphanTtlDays: z.number().int().min(1).max(3650).optional().describe("无归属 ref 的保留天数(默认 3;到期由例行维护软删空壳)"),
|
|
15
|
+
sidebarNamespaces: z.unknown().optional().describe("侧栏命名空间配置 JSON:{ groups: [{ id, name, items, collapsed?, pinned? }], focus };CLI 可传 JSON 字符串"),
|
|
15
16
|
});
|
|
16
17
|
|
|
17
18
|
export class SettingSetAction extends ActionBase<typeof input> {
|
|
@@ -9,6 +9,7 @@ import { loadConfig, saveConfig } from '../../core/config.js';
|
|
|
9
9
|
import { attachmentsRootFromEnv } from '../../core/paths.js';
|
|
10
10
|
import { localDir } from '../../core/localatt.js';
|
|
11
11
|
import { badInput } from '../../core/errors.js';
|
|
12
|
+
import type { SidebarNsState } from '../../core/config.js';
|
|
12
13
|
|
|
13
14
|
/** `setting get` 的结果形状(含派生字段)。 */
|
|
14
15
|
export interface SettingsView {
|
|
@@ -18,6 +19,8 @@ export interface SettingsView {
|
|
|
18
19
|
gitDevRoot: string;
|
|
19
20
|
/** 无归属 ref 的保留天数(到期清理;默认 3) */
|
|
20
21
|
orphanTtlDays: number;
|
|
22
|
+
/** #180:侧栏命名空间(分组 + 当前聚焦);CLI/面板都从这里读写 */
|
|
23
|
+
sidebarNamespaces: SidebarNsState;
|
|
21
24
|
}
|
|
22
25
|
|
|
23
26
|
export async function getSettings(): Promise<SettingsView> {
|
|
@@ -30,6 +33,7 @@ export async function getSettings(): Promise<SettingsView> {
|
|
|
30
33
|
gitRepoRoot: cfg.gitRepoRoot,
|
|
31
34
|
gitDevRoot: cfg.gitDevRoot,
|
|
32
35
|
orphanTtlDays: cfg.orphanTtlDays,
|
|
36
|
+
sidebarNamespaces: cfg.sidebarNamespaces,
|
|
33
37
|
};
|
|
34
38
|
}
|
|
35
39
|
|
|
@@ -37,6 +41,8 @@ export async function setSettings(patch: {
|
|
|
37
41
|
gitRepoRoot?: unknown;
|
|
38
42
|
gitDevRoot?: unknown;
|
|
39
43
|
orphanTtlDays?: unknown;
|
|
44
|
+
/** #180:CLI 可传 JSON 字符串或对象;HTTP 直接传对象 */
|
|
45
|
+
sidebarNamespaces?: unknown;
|
|
40
46
|
} = {}): Promise<SettingsView> {
|
|
41
47
|
const body: Record<string, unknown> = {};
|
|
42
48
|
if (patch.gitRepoRoot !== undefined) body.gitRepoRoot = String(patch.gitRepoRoot || '').trim();
|
|
@@ -48,9 +54,16 @@ export async function setSettings(patch: {
|
|
|
48
54
|
}
|
|
49
55
|
body.orphanTtlDays = n;
|
|
50
56
|
}
|
|
57
|
+
if (patch.sidebarNamespaces !== undefined) {
|
|
58
|
+
let raw = patch.sidebarNamespaces;
|
|
59
|
+
if (typeof raw === 'string') {
|
|
60
|
+
try { raw = JSON.parse(raw); } catch { throw badInput('sidebarNamespaces 不是合法 JSON'); }
|
|
61
|
+
}
|
|
62
|
+
body.sidebarNamespaces = raw;
|
|
63
|
+
}
|
|
51
64
|
if (!Object.keys(body).length) {
|
|
52
65
|
throw badInput(
|
|
53
|
-
'没有要改的设置:--gitRepoRoot <参考仓库根目录> / --gitDevRoot <开发仓库克隆根> / --orphanTtlDays <天数>'
|
|
66
|
+
'没有要改的设置:--gitRepoRoot <参考仓库根目录> / --gitDevRoot <开发仓库克隆根> / --orphanTtlDays <天数> / --sidebarNamespaces <JSON>'
|
|
54
67
|
);
|
|
55
68
|
}
|
|
56
69
|
await saveConfig({ ...(await loadConfig()), ...body });
|
|
@@ -64,5 +77,6 @@ export function renderSettings(d: SettingsView): string {
|
|
|
64
77
|
`参考仓库存储根: ${d.gitRepoRoot || '(未设置 —— clone 参考仓库前先 nx-kv setting set --gitRepoRoot <非C盘目录>)'}`,
|
|
65
78
|
`开发仓库克隆根: ${d.gitDevRoot || '(未设置 —— 导入布局时开发仓库只登记不克隆)'}`,
|
|
66
79
|
`孤儿文档保留: ${d.orphanTtlDays} 天(无归属 ref 到期后软删;有正文的不自动删)`,
|
|
80
|
+
`侧栏命名空间: ${d.sidebarNamespaces.groups.length} 个分组(当前:${d.sidebarNamespaces.focus || '默认'})`,
|
|
67
81
|
].filter(Boolean).join('\n');
|
|
68
82
|
}
|
|
@@ -6,27 +6,27 @@
|
|
|
6
6
|
|
|
7
7
|
import type { ActionBase } from '../../../runtime/action-base.js';
|
|
8
8
|
import type { Container } from '../../../runtime/container.js';
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
9
|
+
import { TemplateAddAction } from './template-add.js';
|
|
10
|
+
import { TemplateDefaultAction } from './template-default.js';
|
|
11
|
+
import { TemplateListAction } from './template-list.js';
|
|
12
|
+
import { TemplateRemoveAction } from './template-remove.js';
|
|
13
|
+
import { TemplateReorderAction } from './template-reorder.js';
|
|
14
|
+
import { TemplateUpdateAction } from './template-update.js';
|
|
15
15
|
|
|
16
16
|
/** 本模块的全部 action 类(容器按这个顺序建实例)。 */
|
|
17
17
|
export const ACTIONS: readonly (new (deps: Container) => ActionBase)[] = [
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
TemplateAddAction,
|
|
19
|
+
TemplateDefaultAction,
|
|
20
|
+
TemplateListAction,
|
|
21
|
+
TemplateRemoveAction,
|
|
22
|
+
TemplateReorderAction,
|
|
23
|
+
TemplateUpdateAction,
|
|
24
24
|
];
|
|
25
25
|
|
|
26
26
|
// 再导出类本身:前端 apiclient 的返回类型从这里 type-only 引用(实现即契约)。
|
|
27
|
-
export {
|
|
28
|
-
export {
|
|
29
|
-
export {
|
|
30
|
-
export {
|
|
31
|
-
export {
|
|
32
|
-
export {
|
|
27
|
+
export { TemplateAddAction };
|
|
28
|
+
export { TemplateDefaultAction };
|
|
29
|
+
export { TemplateListAction };
|
|
30
|
+
export { TemplateRemoveAction };
|
|
31
|
+
export { TemplateReorderAction };
|
|
32
|
+
export { TemplateUpdateAction };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//
|
|
1
|
+
// template.add —— 由 .tool/migrate-module.mjs 从 legacy 形态迁来(模板形态:一条 action 一个文件)。
|
|
2
2
|
//
|
|
3
3
|
// 契约(zod schema)就声明在本文件里——入参类型由基类泛型模板封装;本文件只做「声明 + 实现」,业务在服务层。
|
|
4
4
|
import { action } from '../../../runtime/action-decorator.js';
|
|
@@ -9,7 +9,7 @@ import { } from 'node:path';
|
|
|
9
9
|
import { parseScope, topicFromCwd } from '../support.js';
|
|
10
10
|
const service: any = serviceNs;
|
|
11
11
|
|
|
12
|
-
/**
|
|
12
|
+
/** template.add 的入参契约(CLI 与 HTTP 共用同一份)。 */
|
|
13
13
|
const input = z.object({
|
|
14
14
|
name: z.string(),
|
|
15
15
|
body: z.string().optional().describe("模板正文(Markdown;首行写 `# 标题` 则提交时作为任务标题)"),
|
|
@@ -22,9 +22,9 @@ const input = z.object({
|
|
|
22
22
|
cwd: z.string().optional().describe("同 --topic,但给工作目录(按目录派生主题 key)"),
|
|
23
23
|
});
|
|
24
24
|
|
|
25
|
-
export class
|
|
25
|
+
export class TemplateAddAction extends ActionBase<typeof input> {
|
|
26
26
|
@action({
|
|
27
|
-
id: '
|
|
27
|
+
id: 'template.add',
|
|
28
28
|
cli: ['template', 'add'],
|
|
29
29
|
http: ['POST', '/api/templates'],
|
|
30
30
|
summary: '新增任务模板(--body 给 Markdown 正文;多行正文用 --body-file <文件> 或 --body - 读管道;--setDefault 同时设为默认;--scope 设可见域、--topic 记创建主题并默认仅该主题可见)',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//
|
|
1
|
+
// template.default —— 由 .tool/migrate-module.mjs 从 legacy 形态迁来(模板形态:一条 action 一个文件)。
|
|
2
2
|
//
|
|
3
3
|
// 契约(zod schema)就声明在本文件里——入参类型由基类泛型模板封装;本文件只做「声明 + 实现」,业务在服务层。
|
|
4
4
|
import { action } from '../../../runtime/action-decorator.js';
|
|
@@ -9,7 +9,7 @@ import { } from 'node:path';
|
|
|
9
9
|
import { parseScope } from '../support.js';
|
|
10
10
|
const service: any = serviceNs;
|
|
11
11
|
|
|
12
|
-
/**
|
|
12
|
+
/** template.default 的入参契约(CLI 与 HTTP 共用同一份)。 */
|
|
13
13
|
const input = z.object({
|
|
14
14
|
id: z.string(),
|
|
15
15
|
name: z.string().optional().describe("新名字(配合 --body/--scope 时改默认模板本身)"),
|
|
@@ -17,9 +17,9 @@ const input = z.object({
|
|
|
17
17
|
scope: z.unknown().optional().describe("可见域(#128):* / topic:<key> / repo:<key> / group:<key>,JSON 数组或逗号短写"),
|
|
18
18
|
});
|
|
19
19
|
|
|
20
|
-
export class
|
|
20
|
+
export class TemplateDefaultAction extends ActionBase<typeof input> {
|
|
21
21
|
@action({
|
|
22
|
-
id: '
|
|
22
|
+
id: 'template.default',
|
|
23
23
|
cli: ['template', 'default'],
|
|
24
24
|
http: ['PATCH', '/api/templates/default'],
|
|
25
25
|
summary: '设置默认模板(新建页的起始正文换成它);带 --body/--name/--scope 则改默认模板本身',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//
|
|
1
|
+
// template.list —— 由 .tool/migrate-module.mjs 从 legacy 形态迁来(模板形态:一条 action 一个文件)。
|
|
2
2
|
//
|
|
3
3
|
// 契约(zod schema)就声明在本文件里——入参类型由基类泛型模板封装;本文件只做「声明 + 实现」,业务在服务层。
|
|
4
4
|
import { action } from '../../../runtime/action-decorator.js';
|
|
@@ -8,16 +8,16 @@ import * as serviceNs from '../service.js';
|
|
|
8
8
|
import { renderList } from '../support.js';
|
|
9
9
|
const service: any = serviceNs;
|
|
10
10
|
|
|
11
|
-
/**
|
|
11
|
+
/** template.list 的入参契约(CLI 与 HTTP 共用同一份)。 */
|
|
12
12
|
const input = z.object({
|
|
13
13
|
topic: z.string().optional().describe("按队列 topics.key 过滤(可与 --group/--repo 组合;响应带 scoped:true)"),
|
|
14
14
|
group: z.string().optional().describe("按项目组 repos.key 过滤(#132:组本身是可见主体,与 topic/repo 平级)"),
|
|
15
15
|
repo: z.string().optional().describe("按项目 repos.key 过滤"),
|
|
16
16
|
});
|
|
17
17
|
|
|
18
|
-
export class
|
|
18
|
+
export class TemplateListAction extends ActionBase<typeof input> {
|
|
19
19
|
@action({
|
|
20
|
-
id: '
|
|
20
|
+
id: 'template.list',
|
|
21
21
|
cli: ['template', 'list'],
|
|
22
22
|
http: ['GET', '/api/templates'],
|
|
23
23
|
summary: '列出任务模板(含默认模板 id;新建页的起始正文按默认模板取)',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//
|
|
1
|
+
// template.remove —— 由 .tool/migrate-module.mjs 从 legacy 形态迁来(模板形态:一条 action 一个文件)。
|
|
2
2
|
//
|
|
3
3
|
// 契约(zod schema)就声明在本文件里——入参类型由基类泛型模板封装;本文件只做「声明 + 实现」,业务在服务层。
|
|
4
4
|
import { action } from '../../../runtime/action-decorator.js';
|
|
@@ -8,14 +8,14 @@ import * as serviceNs from '../service.js';
|
|
|
8
8
|
import { } from 'node:path';
|
|
9
9
|
const service: any = serviceNs;
|
|
10
10
|
|
|
11
|
-
/**
|
|
11
|
+
/** template.remove 的入参契约(CLI 与 HTTP 共用同一份)。 */
|
|
12
12
|
const input = z.object({
|
|
13
13
|
id: z.string(),
|
|
14
14
|
});
|
|
15
15
|
|
|
16
|
-
export class
|
|
16
|
+
export class TemplateRemoveAction extends ActionBase<typeof input> {
|
|
17
17
|
@action({
|
|
18
|
-
id: '
|
|
18
|
+
id: 'template.remove',
|
|
19
19
|
cli: ['template', 'remove'],
|
|
20
20
|
http: ['DELETE', '/api/templates/:id'],
|
|
21
21
|
summary: '删除任务模板(内置默认模板不可删;删的是默认模板则默认回落到内置)',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//
|
|
1
|
+
// template.reorder —— #151:topic 管理页拖拽排序落库。
|
|
2
2
|
//
|
|
3
3
|
// 契约(zod schema)声明在本文件,业务在服务层。ids 是 newtask 类目模板的
|
|
4
4
|
// 完整期望顺序(前端拖完后按新序传进来);不在 ids 里的行被挪到末尾。
|
|
@@ -8,14 +8,14 @@ import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
|
|
|
8
8
|
import * as serviceNs from '../service.js';
|
|
9
9
|
const service: any = serviceNs;
|
|
10
10
|
|
|
11
|
-
/**
|
|
11
|
+
/** template.reorder 的入参契约(CLI 与 HTTP 共用同一份)。 */
|
|
12
12
|
const input = z.object({
|
|
13
13
|
ids: z.array(z.string()).describe("模板 id 的完整有序数组(CLI 用 --ids a,b,c 逗号分隔)"),
|
|
14
14
|
});
|
|
15
15
|
|
|
16
|
-
export class
|
|
16
|
+
export class TemplateReorderAction extends ActionBase<typeof input> {
|
|
17
17
|
@action({
|
|
18
|
-
id: '
|
|
18
|
+
id: 'template.reorder',
|
|
19
19
|
cli: ['template', 'reorder'],
|
|
20
20
|
http: ['PATCH', '/api/templates/reorder'],
|
|
21
21
|
summary: '调整任务模板顺序(--ids a,b,c 按新序落库 sort_order;未列出的模板保持原位)',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//
|
|
1
|
+
// template.update —— 由 .tool/migrate-module.mjs 从 legacy 形态迁来(模板形态:一条 action 一个文件)。
|
|
2
2
|
//
|
|
3
3
|
// 契约(zod schema)就声明在本文件里——入参类型由基类泛型模板封装;本文件只做「声明 + 实现」,业务在服务层。
|
|
4
4
|
import { action } from '../../../runtime/action-decorator.js';
|
|
@@ -9,7 +9,7 @@ import { } from 'node:path';
|
|
|
9
9
|
import { parseScope } from '../support.js';
|
|
10
10
|
const service: any = serviceNs;
|
|
11
11
|
|
|
12
|
-
/**
|
|
12
|
+
/** template.update 的入参契约(CLI 与 HTTP 共用同一份)。 */
|
|
13
13
|
const input = z.object({
|
|
14
14
|
id: z.string(),
|
|
15
15
|
name: z.string().optional().describe("新名字(不传保持不变)"),
|
|
@@ -19,9 +19,9 @@ const input = z.object({
|
|
|
19
19
|
scope: z.unknown().optional().describe("可见域(#128):* / topic:<key> / repo:<key> / group:<key>,JSON 数组或逗号短写(不传保持不变)"),
|
|
20
20
|
});
|
|
21
21
|
|
|
22
|
-
export class
|
|
22
|
+
export class TemplateUpdateAction extends ActionBase<typeof input> {
|
|
23
23
|
@action({
|
|
24
|
-
id: '
|
|
24
|
+
id: 'template.update',
|
|
25
25
|
cli: ['template', 'update'],
|
|
26
26
|
http: ['PATCH', '/api/templates/:id'],
|
|
27
27
|
summary: '编辑任务模板(--name 改名 / --body 改正文 / --scope 改可见域,只改传入项;多行正文用 --body-file;内置模板的正文也可改)',
|
package/src/runtime/cli.ts
CHANGED
|
@@ -347,7 +347,7 @@ function fail(err: unknown, json: boolean): void {
|
|
|
347
347
|
|
|
348
348
|
async function cmdServe(ctx: ServeCtx): Promise<void> {
|
|
349
349
|
const { startServer } = await import('./server.js');
|
|
350
|
-
const { startPanelIdleGuard } = await import('../modules/localtask/panel-guard.js');
|
|
350
|
+
const { startPanelIdleGuard } = await import('../modules/localtask/ui/panel-guard.js');
|
|
351
351
|
const { registerPanel, unregisterPanel, notePanelRequest } = await import(
|
|
352
352
|
'../modules/localtask/service.js'
|
|
353
353
|
);
|
package/src/runtime/registry.ts
CHANGED
|
@@ -29,7 +29,6 @@ import systemModule from '../modules/system/index.js';
|
|
|
29
29
|
import setting from '../modules/setting/index.js';
|
|
30
30
|
import localtask from '../modules/localtask/index.js';
|
|
31
31
|
import claim from '../modules/claim/index.js';
|
|
32
|
-
import delivery from '../modules/delivery/index.js';
|
|
33
32
|
import goals from '../modules/goals/index.js';
|
|
34
33
|
import repos from '../modules/repos/index.js';
|
|
35
34
|
import docs from '../modules/docs/index.js';
|
|
@@ -44,7 +43,6 @@ const MODULE_LIST: readonly AnyModule[] = [
|
|
|
44
43
|
setting,
|
|
45
44
|
localtask,
|
|
46
45
|
claim,
|
|
47
|
-
delivery,
|
|
48
46
|
goals,
|
|
49
47
|
repos,
|
|
50
48
|
docs,
|