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
package/src/core/config.ts
CHANGED
|
@@ -12,12 +12,15 @@ import { readSettingRaw, writeSettingRaw } from './db/settings.js';
|
|
|
12
12
|
import { tx } from './db/tx.js';
|
|
13
13
|
import { openStore } from './db/index.js';
|
|
14
14
|
import { nowMs } from './db/time.js';
|
|
15
|
+
import { badInput } from './errors.js';
|
|
15
16
|
|
|
16
17
|
/** 进 settings 表(`app.*` 前缀)的偏好字段。 */
|
|
17
18
|
export const PREF_KEYS = Object.freeze([
|
|
18
19
|
'gitRepoRoot',
|
|
19
20
|
'gitDevRoot',
|
|
20
21
|
'orphanTtlDays',
|
|
22
|
+
// #180:侧边栏命名空间配置(JSON 对象:groups + focus)——用户明确要求落 settings 表
|
|
23
|
+
'sidebarNamespaces',
|
|
21
24
|
] as const);
|
|
22
25
|
|
|
23
26
|
/** 孤儿 ref 的默认保留天数(可配置;0 或非法值回落为它)。 */
|
|
@@ -28,12 +31,57 @@ const ORPHAN_TTL_MAX_DAYS = 3650;
|
|
|
28
31
|
/** settings 表里偏好字段的键名。 */
|
|
29
32
|
export const APP_SETTING_KEYS = Object.freeze(PREF_KEYS.map((k) => 'app.' + k));
|
|
30
33
|
|
|
34
|
+
/** #180:侧栏命名空间配置(落 settings 表的单个 JSON 字段)。 */
|
|
35
|
+
export interface SidebarNsConfig {
|
|
36
|
+
id: string;
|
|
37
|
+
name: string;
|
|
38
|
+
items: string[];
|
|
39
|
+
collapsed?: boolean;
|
|
40
|
+
pinned?: boolean;
|
|
41
|
+
}
|
|
42
|
+
export interface SidebarNsState {
|
|
43
|
+
groups: SidebarNsConfig[];
|
|
44
|
+
focus: string;
|
|
45
|
+
}
|
|
46
|
+
export const EMPTY_SIDEBAR_NS = (): SidebarNsState => ({ groups: [], focus: '' });
|
|
47
|
+
|
|
48
|
+
/** namespace JSON 归一:脏数据(非对象 / 超量 / 非法 items)不炸读取,逐层 sanitize。 */
|
|
49
|
+
function normalizeSidebarNs(raw: unknown): SidebarNsState {
|
|
50
|
+
const base = EMPTY_SIDEBAR_NS();
|
|
51
|
+
if (!raw || typeof raw !== 'object') return base;
|
|
52
|
+
const d = raw as Record<string, unknown>;
|
|
53
|
+
const rawGroups = Array.isArray(d.groups) ? d.groups.slice(0, 200) : [];
|
|
54
|
+
const groups: SidebarNsConfig[] = [];
|
|
55
|
+
const ids = new Set<string>();
|
|
56
|
+
for (const g of rawGroups) {
|
|
57
|
+
if (!g || typeof g !== 'object') continue;
|
|
58
|
+
const item = g as Record<string, unknown>;
|
|
59
|
+
const id = String(item.id || '').trim().slice(0, 120);
|
|
60
|
+
const name = String(item.name || '').trim().slice(0, 60);
|
|
61
|
+
if (!id || !name || ids.has(id)) continue;
|
|
62
|
+
ids.add(id);
|
|
63
|
+
const items = Array.isArray(item.items)
|
|
64
|
+
? [...new Set(
|
|
65
|
+
item.items
|
|
66
|
+
.map((k) => String(k || '').trim().slice(0, 300))
|
|
67
|
+
// #180:早期拖拽把 'repo:<key>' 写进了 items,读取时归一成裸 key(与面板口径一致)
|
|
68
|
+
.map((k) => (k.startsWith('repo:') ? k.slice(5) : k))
|
|
69
|
+
.filter(Boolean)
|
|
70
|
+
)].slice(0, 1000)
|
|
71
|
+
: [];
|
|
72
|
+
groups.push({ id, name, items, ...(item.collapsed === true ? { collapsed: true } : {}), ...(item.pinned === true ? { pinned: true } : {}) });
|
|
73
|
+
}
|
|
74
|
+
return { groups, focus: String(d.focus || '').trim().slice(0, 120) };
|
|
75
|
+
}
|
|
76
|
+
|
|
31
77
|
/** 归一后的本机偏好形状。 */
|
|
32
78
|
export interface AppConfig {
|
|
33
79
|
gitRepoRoot: string;
|
|
34
80
|
gitDevRoot: string;
|
|
35
81
|
/** 孤儿 ref 到期天数(默认 3;范围 1–3650)。 */
|
|
36
82
|
orphanTtlDays: number;
|
|
83
|
+
/** #180:侧栏命名空间配置(settings 表 JSON,一个字段管分组 + 当前聚焦)。 */
|
|
84
|
+
sidebarNamespaces: SidebarNsState;
|
|
37
85
|
}
|
|
38
86
|
|
|
39
87
|
const EMPTY = (): AppConfig => ({
|
|
@@ -44,6 +92,7 @@ const EMPTY = (): AppConfig => ({
|
|
|
44
92
|
gitDevRoot: '',
|
|
45
93
|
// 无任何归属的 ref 保留天数;到期由 serve 例行维护 / docs orphans purge 清理。
|
|
46
94
|
orphanTtlDays: DEFAULT_ORPHAN_TTL_DAYS,
|
|
95
|
+
sidebarNamespaces: EMPTY_SIDEBAR_NS(),
|
|
47
96
|
});
|
|
48
97
|
|
|
49
98
|
/** TTL 天数归一:非数字 / 越界一律回落默认值。 */
|
|
@@ -66,6 +115,7 @@ function normalize(data: unknown): AppConfig {
|
|
|
66
115
|
gitRepoRoot: String(d.gitRepoRoot || ''),
|
|
67
116
|
gitDevRoot: String(d.gitDevRoot || ''),
|
|
68
117
|
orphanTtlDays: normalizeTtlDays(d.orphanTtlDays),
|
|
118
|
+
sidebarNamespaces: normalizeSidebarNs(d.sidebarNamespaces),
|
|
69
119
|
};
|
|
70
120
|
}
|
|
71
121
|
|
|
@@ -94,6 +144,28 @@ function writePrefs(next: AppConfig): void {
|
|
|
94
144
|
);
|
|
95
145
|
}
|
|
96
146
|
|
|
147
|
+
/**
|
|
148
|
+
* 项目级「持续 get」的落库校验(claim/waitgoal-config 与 repos 登记共用)。
|
|
149
|
+
* null/false = 关闭清除;true = 开(默认分钟)。
|
|
150
|
+
* 只认 `{ enabled, waitMinutes }`:#182 起 `template` 不在契约里,传了也忽略
|
|
151
|
+
* (老数据带着它进来时自然被剥掉,等于顺手做了一次清理)。
|
|
152
|
+
*/
|
|
153
|
+
export function sanitizeGetLoop(raw: unknown): Record<string, unknown> | null {
|
|
154
|
+
if (raw === undefined || raw === null || raw === false) return null;
|
|
155
|
+
if (raw === true) return { enabled: true };
|
|
156
|
+
if (typeof raw !== 'object') throw badInput('getLoop 必须是 { enabled, waitMinutes? }');
|
|
157
|
+
const decl = raw as Record<string, any>;
|
|
158
|
+
const out: Record<string, unknown> = {};
|
|
159
|
+
if (decl.enabled !== undefined) out.enabled = decl.enabled === true || decl.enabled === 'on' || decl.enabled === 'true';
|
|
160
|
+
const n = Number(decl.waitMinutes);
|
|
161
|
+
// #112:0 是合法值(= get 没任务时不阻塞,立即返回 timeout);只挡负数与非数字
|
|
162
|
+
if (decl.waitMinutes !== undefined && decl.waitMinutes !== null && decl.waitMinutes !== '' && Number.isFinite(n) && n >= 0) {
|
|
163
|
+
out.waitMinutes = Math.min(Math.floor(n), 600);
|
|
164
|
+
}
|
|
165
|
+
if (!Object.keys(out).length) return null;
|
|
166
|
+
return out;
|
|
167
|
+
}
|
|
168
|
+
|
|
97
169
|
export async function loadConfig(): Promise<AppConfig> {
|
|
98
170
|
cache = normalize(readPrefs());
|
|
99
171
|
return cache;
|
package/src/core/db/driver.ts
CHANGED
|
@@ -245,7 +245,7 @@ function decorateOpenError(err: any, dbPath: string): AppError {
|
|
|
245
245
|
const raw = String((err && err.message) || err || '未知错误');
|
|
246
246
|
const hint = /unable to open database file/i.test(raw)
|
|
247
247
|
? '目录不可写 / 文件被占用 / 盘符不存在都会报这句'
|
|
248
|
-
: '若是「另一个进程正在用这个库」,先停掉那个 serve 或改用 HTTP 领取(POST /api/localtasks/
|
|
248
|
+
: '若是「另一个进程正在用这个库」,先停掉那个 serve 或改用 HTTP 领取(POST /api/localtasks/get)';
|
|
249
249
|
const e = new AppError(
|
|
250
250
|
CODES.INTERNAL,
|
|
251
251
|
`打开库失败: ${dbPath}(errcode=${Number.isFinite(code) ? code : '?'}):${raw}\n${hint}。` +
|
|
@@ -64,6 +64,7 @@ export const DIRECT_EDGES: MigrationStep[] = [
|
|
|
64
64
|
{ from: 10, to: 11, file: 'v11.sql', title: '孤儿 ref 失绑计时(orphan_since)与到期清理留痕(ref_gc_log)', apply: migrateOrphanRefs },
|
|
65
65
|
{ from: 11, to: 12, file: 'v12.sql', title: '去掉分类标签概念(删 ref_bindings.tag)' },
|
|
66
66
|
{ from: 12, to: 13, file: 'v13.sql', title: '去掉关系表上的业务 note(4 张表 drop note 列)' },
|
|
67
|
+
{ from: 13, to: 14, file: 'v14.sql', title: 'task_links.type 扩 fork(任务链四类节点:评论/反馈/重开/分支)' },
|
|
67
68
|
];
|
|
68
69
|
|
|
69
70
|
// 人读版本说明(docs/decisions 是决策的唯一权威位置,里面对应一份 date 化的 .md)
|
|
@@ -81,6 +82,7 @@ export const VERSION_NOTES = {
|
|
|
81
82
|
11: 'docs/decisions/versions/2026-11-15-v11.md',
|
|
82
83
|
12: 'docs/decisions/versions/2026-11-16-v12.md',
|
|
83
84
|
13: 'docs/decisions/versions/2026-11-17-v13.md',
|
|
85
|
+
14: 'docs/decisions/versions/2026-11-22-v14.md',
|
|
84
86
|
};
|
|
85
87
|
|
|
86
88
|
const keyOf = (from: number, to: number): string => `${from}->${to}`;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
-- schema v14:task_links.type 扩 'fork'(#177 任务链四类节点可区分)
|
|
2
|
+
--
|
|
3
|
+
-- 用户场景(原文):任务 1 上「评论两个 + fork 一个」,完成后再「反馈」——
|
|
4
|
+
-- 节点 1 下面应该有四个子节点:两个并行评论、一个 fork、一个反馈,类型各自可辨。
|
|
5
|
+
-- 旧约束只有 comment / reopen / feedback,fork 只能被记成 comment(分不清
|
|
6
|
+
-- 「谁只是复制了一份来另起分支」 vs 「谁是一条批注」)——链的语义丢了。
|
|
7
|
+
--
|
|
8
|
+
-- fork 的口径:从某任务**复制正文另起一条并行任务**(源任务不动、不进取代链),
|
|
9
|
+
-- 典型用途「这条先放一放,我另开一条独立线做」。它是四类节点之一,必须落 type。
|
|
10
|
+
--
|
|
11
|
+
-- SQLite 不能 ALTER CHECK → 12-step 重建 task_links。关系表无子引用(没有别的表
|
|
12
|
+
-- REFERENCES task_links),直接建新表 → 拷数据 → 换名即可。
|
|
13
|
+
--
|
|
14
|
+
-- @decision docs/decisions/versions/2026-11-22-v14.md
|
|
15
|
+
PRAGMA defer_foreign_keys = ON;
|
|
16
|
+
|
|
17
|
+
CREATE TABLE task_links_new (
|
|
18
|
+
src_id INTEGER NOT NULL REFERENCES tasks(id) ON DELETE CASCADE, -- 派生出的新任务
|
|
19
|
+
dst_id INTEGER NOT NULL REFERENCES tasks(id) ON DELETE CASCADE, -- 来源任务
|
|
20
|
+
type TEXT NOT NULL CHECK (type IN ('comment','reopen','feedback','fork')),
|
|
21
|
+
note TEXT NOT NULL DEFAULT '',
|
|
22
|
+
created_at INTEGER NOT NULL,
|
|
23
|
+
PRIMARY KEY (src_id, dst_id, type),
|
|
24
|
+
CHECK (src_id <> dst_id)
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
INSERT INTO task_links_new (src_id, dst_id, type, note, created_at)
|
|
28
|
+
SELECT src_id, dst_id, type, note, created_at FROM task_links;
|
|
29
|
+
|
|
30
|
+
-- @decision docs/decisions/versions/2026-11-22-v14.md
|
|
31
|
+
DROP TABLE task_links;
|
|
32
|
+
|
|
33
|
+
ALTER TABLE task_links_new RENAME TO task_links;
|
|
34
|
+
|
|
35
|
+
-- 与 v1 同口径的索引(一父约束 + 反查子任务)
|
|
36
|
+
CREATE UNIQUE INDEX ux_task_links_parent ON task_links (src_id);
|
|
37
|
+
CREATE INDEX ix_task_links_children ON task_links (dst_id);
|
package/src/core/db/version.ts
CHANGED
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
// 关系描述文档的定位不走 tag:desc 就在 ref 上。
|
|
41
41
|
// v13(2026-11-17):彻底删除「关系表上的业务 note」概念——4 张关系表 drop note 列。
|
|
42
42
|
// 关系表本身就表达多对多;文档描述走 ref.desc + 正文标题,参考仓库描述走绑定 ref 的文档。
|
|
43
|
-
export const CURRENT_SCHEMA_VERSION =
|
|
43
|
+
export const CURRENT_SCHEMA_VERSION = 14;
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
46
|
* 运行时最低 Node 版本。
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// 指令模板渲染 —— Handlebars 4.x 的薄封装(core 层)。
|
|
2
2
|
//
|
|
3
3
|
// 选型(为什么是 Handlebars):
|
|
4
|
-
// - 同步渲染:`compile()` 返回的模板函数是纯同步的,
|
|
4
|
+
// - 同步渲染:`compile()` 返回的模板函数是纯同步的,get 的交付链路不需要
|
|
5
5
|
// async 渲染(Nunjucks 的 API 偏异步、要包一层 Promise,EJS 干脆是「模板即
|
|
6
6
|
// JS」,安全与可读性都差);
|
|
7
7
|
// - 原生 `{{#if}}` / `{{#each}}`(含 `{{else}}`、`{{@first}}`),成员 / 文档 /
|
|
@@ -104,5 +104,5 @@ function syncTaskFromNode(task: any, node: WfNode): void {
|
|
|
104
104
|
// 词表见 src/shared/task-status.js:claimed = 已领取、还没交付
|
|
105
105
|
task.status = 'claimed';
|
|
106
106
|
}
|
|
107
|
-
// pending/ready:不改 status(领取态由
|
|
107
|
+
// pending/ready:不改 status(领取态由 get 管;ready 由 isReadyToClaim 现算)
|
|
108
108
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// 对照参考方案(Node+TS DAG 动态工作流)在 nx-kv 上的映射:
|
|
4
4
|
// workflowId → 主题 key(cwd 归一化 / repos key;全局 '__GLOBAL__')
|
|
5
5
|
// submit(init) → localtask add(只入队,不构造全图)
|
|
6
|
-
// get(id,node?) → 引擎门(#237 已删除;现役领取走 localtask.claim
|
|
6
|
+
// get(id,node?) → 引擎门(#237 已删除;现役领取走 localtask.get,即 claim 域)
|
|
7
7
|
// Node → localtask 一条任务(id 数字;状态用 status+completedAt)
|
|
8
8
|
// Edge / blockBy → task.blockBy[] + task.blocksFollowing(闸门)
|
|
9
9
|
// blockgoal → scope=control;onSchedule 决定后继是否 ready(见 localtask/dag.js)
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
//
|
|
21
21
|
// 工程约束(相对参考方案的刻意偏离):
|
|
22
22
|
// - 仓库保持 JS ESM + JSDoc,不上平行 TypeScript 引擎
|
|
23
|
-
// - 契约落在 core/;业务仍在 modules/localtask + modules/claim + modules/
|
|
23
|
+
// - 契约落在 core/;业务仍在 modules/localtask + modules/claim + modules/goals(三域分工)
|
|
24
24
|
// - 存储沿用本机 JSON 主题快照;RedisAdapter 属阶段 6,不挡主线
|
|
25
25
|
// - 目标目录规范见同目录 layout.js(禁止平行 src/{facade,store,mutator,…})
|
|
26
26
|
|
|
@@ -6,21 +6,21 @@
|
|
|
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 {
|
|
9
|
+
import { SkillGetAction } from './skill-get.js';
|
|
10
|
+
import { SkillGroupsAction } from './skill-groups.js';
|
|
11
|
+
import { SkillInstallAction } from './skill-install.js';
|
|
12
|
+
import { SkillListAction } from './skill-list.js';
|
|
13
13
|
|
|
14
14
|
/** 本模块的全部 action 类(容器按这个顺序建实例)。 */
|
|
15
15
|
export const ACTIONS: readonly (new (deps: Container) => ActionBase)[] = [
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
SkillGetAction,
|
|
17
|
+
SkillGroupsAction,
|
|
18
|
+
SkillInstallAction,
|
|
19
|
+
SkillListAction,
|
|
20
20
|
];
|
|
21
21
|
|
|
22
22
|
// 再导出类本身:前端 apiclient 的返回类型从这里 type-only 引用(实现即契约)。
|
|
23
|
-
export {
|
|
24
|
-
export {
|
|
25
|
-
export {
|
|
26
|
-
export {
|
|
23
|
+
export { SkillGetAction };
|
|
24
|
+
export { SkillGroupsAction };
|
|
25
|
+
export { SkillInstallAction };
|
|
26
|
+
export { SkillListAction };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//
|
|
1
|
+
// skill.get —— 由 .tool/migrate-module.mjs 从 legacy 形态迁来(模板形态:一条 action 一个文件)。
|
|
2
2
|
//
|
|
3
3
|
// 契约(zod schema)就声明在本文件里——入参类型由基类泛型模板封装;本文件只做「声明 + 实现」,业务在服务层。
|
|
4
4
|
import { action } from '../../../runtime/action-decorator.js';
|
|
@@ -8,7 +8,7 @@ import * as serviceNs from '../service.js';
|
|
|
8
8
|
import { exclusive, renderContent } from '../support.js';
|
|
9
9
|
const service: any = serviceNs;
|
|
10
10
|
|
|
11
|
-
/**
|
|
11
|
+
/** skill.get 的入参契约(CLI 与 HTTP 共用同一份)。 */
|
|
12
12
|
const input = z.object({
|
|
13
13
|
name: z.string().optional(),
|
|
14
14
|
ref: z.string().optional(),
|
|
@@ -16,9 +16,9 @@ const input = z.object({
|
|
|
16
16
|
to: z.string().optional(),
|
|
17
17
|
});
|
|
18
18
|
|
|
19
|
-
export class
|
|
19
|
+
export class SkillGetAction extends ActionBase<typeof input> {
|
|
20
20
|
@action({
|
|
21
|
-
id: '
|
|
21
|
+
id: 'skill.get',
|
|
22
22
|
cli: ['skill', 'get'],
|
|
23
23
|
http: ['GET', '/api/bundled/content'],
|
|
24
24
|
summary: '输出内置 skill 全文(prefix + sentinel + 正文 + install 状态),并顺手装到本机',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//
|
|
1
|
+
// skill.groups —— 由 .tool/migrate-module.mjs 从 legacy 形态迁来(模板形态:一条 action 一个文件)。
|
|
2
2
|
//
|
|
3
3
|
// 契约(zod schema)就声明在本文件里——入参类型由基类泛型模板封装;本文件只做「声明 + 实现」,业务在服务层。
|
|
4
4
|
import { action } from '../../../runtime/action-decorator.js';
|
|
@@ -7,14 +7,14 @@ import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
|
|
|
7
7
|
import * as serviceNs from '../service.js';
|
|
8
8
|
const service: any = serviceNs;
|
|
9
9
|
|
|
10
|
-
/**
|
|
10
|
+
/** skill.groups 的入参契约(CLI 与 HTTP 共用同一份)。 */
|
|
11
11
|
const input = z.object({
|
|
12
12
|
|
|
13
13
|
});
|
|
14
14
|
|
|
15
|
-
export class
|
|
15
|
+
export class SkillGroupsAction extends ActionBase<typeof input> {
|
|
16
16
|
@action({
|
|
17
|
-
id: '
|
|
17
|
+
id: 'skill.groups',
|
|
18
18
|
cli: [['skill', 'groups'], ['bundled', 'groups']],
|
|
19
19
|
http: ['GET', '/api/bundled/groups'],
|
|
20
20
|
summary: '列出可装的 group(groups.json 的组名 → 它包含哪些 skill)',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//
|
|
1
|
+
// skill.install —— 由 .tool/migrate-module.mjs 从 legacy 形态迁来(模板形态:一条 action 一个文件)。
|
|
2
2
|
//
|
|
3
3
|
// 契约(zod schema)就声明在本文件里——入参类型由基类泛型模板封装;本文件只做「声明 + 实现」,业务在服务层。
|
|
4
4
|
import { action } from '../../../runtime/action-decorator.js';
|
|
@@ -8,7 +8,7 @@ import * as serviceNs from '../service.js';
|
|
|
8
8
|
import { exclusive, renderScoped } from '../support.js';
|
|
9
9
|
const service: any = serviceNs;
|
|
10
10
|
|
|
11
|
-
/**
|
|
11
|
+
/** skill.install 的入参契约(CLI 与 HTTP 共用同一份)。 */
|
|
12
12
|
const input = z.object({
|
|
13
13
|
name: z.string().optional(),
|
|
14
14
|
group: z.string().optional().describe("groups.json 里的组名(与 <name> 互斥)"),
|
|
@@ -17,9 +17,9 @@ const input = z.object({
|
|
|
17
17
|
all: z.boolean().optional().describe("装 assets/ 下的全部内置 skill(隐式覆盖,不需要 --force)"),
|
|
18
18
|
});
|
|
19
19
|
|
|
20
|
-
export class
|
|
20
|
+
export class SkillInstallAction extends ActionBase<typeof input> {
|
|
21
21
|
@action({
|
|
22
|
-
id: '
|
|
22
|
+
id: 'skill.install',
|
|
23
23
|
cli: ['skill', 'install'],
|
|
24
24
|
http: ['POST', '/api/bundled/install'],
|
|
25
25
|
summary: '安装内置 skill 到 skills 目录(默认 nx-kv → ~/.claude/skills;--group <key> 一键装一组;--all 装全部并直接覆盖)',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//
|
|
1
|
+
// skill.list —— 由 .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 { renderList } from '../support.js';
|
|
9
9
|
const service: any = serviceNs;
|
|
10
10
|
|
|
11
|
-
/**
|
|
11
|
+
/** skill.list 的入参契约(CLI 与 HTTP 共用同一份)。 */
|
|
12
12
|
const input = z.object({
|
|
13
13
|
|
|
14
14
|
});
|
|
15
15
|
|
|
16
|
-
export class
|
|
16
|
+
export class SkillListAction extends ActionBase<typeof input> {
|
|
17
17
|
@action({
|
|
18
|
-
id: '
|
|
18
|
+
id: 'skill.list',
|
|
19
19
|
cli: [['skill', 'list'], ['skill', 'install', '--list'], ['bundled', 'list']],
|
|
20
20
|
http: ['GET', '/api/bundled'],
|
|
21
21
|
summary: '列出包内自带 skill(含文件数与描述)+ 默认装哪个 + 有哪些 group',
|
|
@@ -6,18 +6,15 @@
|
|
|
6
6
|
|
|
7
7
|
import type { ActionBase } from '../../../runtime/action-base.js';
|
|
8
8
|
import type { Container } from '../../../runtime/container.js';
|
|
9
|
-
import {
|
|
9
|
+
import { LocaltaskGetAction } from './localtask-get.js';
|
|
10
10
|
import { LocaltaskPreviewAction } from './localtask-preview.js';
|
|
11
|
-
import { LocaltaskWaitAction } from './localtask-wait.js';
|
|
12
11
|
|
|
13
12
|
/** 本模块的全部 action 类(容器按这个顺序建实例)。 */
|
|
14
13
|
export const ACTIONS: readonly (new (deps: Container) => ActionBase)[] = [
|
|
15
|
-
|
|
14
|
+
LocaltaskGetAction,
|
|
16
15
|
LocaltaskPreviewAction,
|
|
17
|
-
LocaltaskWaitAction,
|
|
18
16
|
];
|
|
19
17
|
|
|
20
18
|
// 再导出类本身:前端 apiclient 的返回类型从这里 type-only 引用(实现即契约)。
|
|
21
|
-
export {
|
|
19
|
+
export { LocaltaskGetAction };
|
|
22
20
|
export { LocaltaskPreviewAction };
|
|
23
|
-
export { LocaltaskWaitAction };
|
|
@@ -1,26 +1,35 @@
|
|
|
1
|
-
// localtask.
|
|
1
|
+
// localtask.get —— 领取任务(CLI `localtask get` / HTTP POST /api/localtasks/get)。
|
|
2
|
+
//
|
|
3
|
+
// id / cli / http 三层同词表,都以 CLI 动词 **get** 为基准。
|
|
4
|
+
// 注:CRUD 词表的「查(单条)」位(X.get)对本资源由 registry.test.mjs 的
|
|
5
|
+
// crudIdOf 覆盖映射到 localtask.show(查看,CLI `localtask show`)——
|
|
6
|
+
// localtask 的 get id 让位给「领取」,是刻意约定,不是漏配。
|
|
7
|
+
//
|
|
8
|
+
// 领取编排(阻塞窗口 / getLoop / 交付组装)在本模块 claim/,队列原语在
|
|
9
|
+
// localtask/lifecycle 的 claimFirstPending。
|
|
10
|
+
// 由 .tool/migrate-module.mjs 从 legacy 形态迁来(模板形态:一条 action 一个文件)。
|
|
2
11
|
//
|
|
3
12
|
// 契约(zod schema)就声明在本文件里——入参类型由基类泛型模板封装;本文件只做「声明 + 实现」,业务在服务层。
|
|
4
13
|
import { action } from '../../../runtime/action-decorator.js';
|
|
5
14
|
import { z } from 'zod';
|
|
6
15
|
import { ActionBase, type ActionInput, type ActionRunMeta } from '../../../runtime/action-base.js';
|
|
7
|
-
import { renderWait as _renderWait } from '../../localtask/action-render.js';
|
|
8
|
-
import { claimView } from '../../localtask/contract-views.js';
|
|
16
|
+
import { renderWait as _renderWait } from '../../localtask/ui/action-render.js';
|
|
17
|
+
import { claimView } from '../../localtask/ui/contract-views.js';
|
|
9
18
|
const renderWait: any = _renderWait;
|
|
10
19
|
|
|
11
|
-
/** localtask.
|
|
20
|
+
/** localtask.get(领取)的入参契约(CLI 与 HTTP 共用同一份)。 */
|
|
12
21
|
const input = z.object({
|
|
13
22
|
cwd: z.string().optional(),
|
|
14
|
-
timeout: z.number().optional().describe("阻塞上限(秒):显式给定时,即使项目没开「持续 get
|
|
23
|
+
timeout: z.number().optional().describe("阻塞上限(秒):显式给定时,即使项目没开「持续 get」也会阻塞这么久;缺省则立即返回 timeout"),
|
|
15
24
|
'no-open': z.boolean().optional().describe("不自动打开浏览器(测试用)"),
|
|
16
25
|
param: z.array(z.string()).optional().describe("外部参数(平面扩展):k=v,可重复或逗号分隔;进交付模板 ctx,模板里 {{k}} / {{params.k}} 取"),
|
|
17
26
|
});
|
|
18
27
|
|
|
19
|
-
export class
|
|
28
|
+
export class LocaltaskGetAction extends ActionBase<typeof input> {
|
|
20
29
|
@action({
|
|
21
|
-
id: 'localtask.
|
|
30
|
+
id: 'localtask.get',
|
|
22
31
|
cli: ['localtask', 'get'],
|
|
23
|
-
http: ['POST', '/api/localtasks/
|
|
32
|
+
http: ['POST', '/api/localtasks/get'],
|
|
24
33
|
summary: '领取任务:有任务立即领(含任务级 timegoal 的 check 指令);没任务默认立即返回 timeout,项目开启「持续 get」后自动唤起阻塞窗口等人回填',
|
|
25
34
|
input,
|
|
26
35
|
output: claimView,
|
|
@@ -43,6 +52,6 @@ export class LocaltaskClaimAction extends ActionBase<typeof input> {
|
|
|
43
52
|
// 纯附加字段 —— CLI 的 --json 与 HTTP 响应原有键一个不少,只是多了 taskId。
|
|
44
53
|
if (r && r.task && r.task.id != null) r.taskId = r.task.id;
|
|
45
54
|
return r;
|
|
46
|
-
|
|
55
|
+
|
|
47
56
|
}
|
|
48
57
|
}
|
|
@@ -6,7 +6,7 @@ import { z } from 'zod';
|
|
|
6
6
|
import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
|
|
7
7
|
import * as serviceNs from '../../localtask/service.js';
|
|
8
8
|
import { badInput as _badInput } from '../../../core/errors.js';
|
|
9
|
-
import { renderPreview as _renderPreview } from '../../localtask/action-render.js';
|
|
9
|
+
import { renderPreview as _renderPreview } from '../../localtask/ui/action-render.js';
|
|
10
10
|
const service: any = serviceNs;
|
|
11
11
|
const badInput: any = _badInput;
|
|
12
12
|
const renderPreview: any = _renderPreview;
|
|
@@ -31,7 +31,7 @@ export class LocaltaskPreviewAction extends ActionBase<typeof input> {
|
|
|
31
31
|
})
|
|
32
32
|
override async run(ctx: ActionInput<this['_input']>) {
|
|
33
33
|
|
|
34
|
-
const { previewTaskDelivery } = await (import('
|
|
34
|
+
const { previewTaskDelivery } = await (import('../preview.js') as any);
|
|
35
35
|
const { parseParams } = await (import('../params.js') as any);
|
|
36
36
|
const draftText: any = ctx.text === undefined || ctx.text === null ? '' : String(ctx.text);
|
|
37
37
|
if (!draftText.trim() && (ctx.id === undefined || ctx.id === null)) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
//
|
|
1
|
+
// claim/assemble.ts —— 交付组装(assembleDelivery):seed 构造 + 三链合并 + compose。
|
|
2
2
|
//
|
|
3
3
|
// 这是「一条交付提示词怎么拼出来」的**唯一实现**(#227 重构:原样从 claim/wait.ts
|
|
4
|
-
// 的 buildTaskDelivery 下半段收编进来)。宿主(
|
|
4
|
+
// 的 buildTaskDelivery 下半段收编进来)。宿主(claim/host.ts)完成领域取数
|
|
5
5
|
// (附件标注 / 时间目标起表 / 组上下文 / 队列余量)后,把取好的数据装进
|
|
6
6
|
// DeliveryHostData 交到这里;本文件不再碰任何业务模块——promptplug 不 import
|
|
7
7
|
// 其他模块的边界保持不变。
|
|
@@ -42,7 +42,7 @@ export function flatParamsOf(params?: Record<string, string>): Record<string, un
|
|
|
42
42
|
return flat;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
/** 宿主取好的领域数据(取数细节见
|
|
45
|
+
/** 宿主取好的领域数据(取数细节见 claim/host.ts——本文件不做任何 IO)。 */
|
|
46
46
|
export interface DeliveryHostData {
|
|
47
47
|
/** 标注后的任务行(id / text);无任务 → null(指令段也照常渲染) */
|
|
48
48
|
task: any | null;
|
package/src/modules/claim/get.ts
CHANGED
|
@@ -9,9 +9,8 @@
|
|
|
9
9
|
// - 领到任务的交付文本追加「不要结束,反复调用 get 直到超时」的项目模板
|
|
10
10
|
// (提示词增强,基于项目;占位符见 core/instruction-template.js)。
|
|
11
11
|
//
|
|
12
|
-
//
|
|
13
|
-
//
|
|
14
|
-
// get 后由系统负责把循环指令带进交付文本,agent 不用自己记)。
|
|
12
|
+
// 语义:get = 「领活」(kv-localget 的语义,项目开启持续 get 后由系统负责把
|
|
13
|
+
// 循环指令带进交付文本,agent 不用自己记);阻塞等待统一走 `get --timeout`。
|
|
15
14
|
import { waitForTask } from './wait.js';
|
|
16
15
|
import { getLoopForCwd, type GetLoopState } from './waitgoal-config.js';
|
|
17
16
|
|
|
@@ -32,7 +31,7 @@ export async function getTask({ cwd, timeoutSec, open = true, params, instant }:
|
|
|
32
31
|
// 请求,到点返回 timeout),不是让 agent 睡。窗口配 0 = 不阻塞,没活立即 timeout。
|
|
33
32
|
const minutes = loop.enabled ? Number(loop.waitMinutes) || 0 : 0;
|
|
34
33
|
// #123:显式 --timeout 就是「阻塞等这个上限」——不再要求项目先开「持续 get」。
|
|
35
|
-
//
|
|
34
|
+
// 阻塞等待只有一条路(get + 参数);不再保留任何别名入口。
|
|
36
35
|
const explicitWait = timeoutSec !== undefined && timeoutSec !== null && Number(timeoutSec) > 0;
|
|
37
36
|
const r = await waitForTask({
|
|
38
37
|
cwd,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//
|
|
1
|
+
// claim/groupctx.ts —— **项目组上下文封装**(交付层)。
|
|
2
2
|
//
|
|
3
3
|
// todo.md 的原文口径:
|
|
4
4
|
// 「如果是获得在项目组的仓库的一个任务,该对返回的提示词进行封装,就比如说返回
|
|
@@ -8,8 +8,7 @@
|
|
|
8
8
|
// 也就是说:agent 领到「组内某个仓库」的任务时,除了任务本身,还要知道
|
|
9
9
|
// - 这个项目是干什么的(项目介绍)
|
|
10
10
|
// - 这个组是干什么的(组介绍 md / 组描述)
|
|
11
|
-
// -
|
|
12
|
-
// - 组里还有谁、各自什么角色(兄弟仓库的组内描述)
|
|
11
|
+
// - 组里还有谁(兄弟成员;组内描述 note 已随模板上下文清理移除)
|
|
13
12
|
// - 组的参考文件在哪(自有树路径 / 外部绝对路径——agent 可直接读盘)
|
|
14
13
|
//
|
|
15
14
|
// 任务原文(task.text)**不被改写**:上下文一律进 instruction 字段(与收尾指令、
|
|
@@ -54,8 +53,7 @@ interface GroupCtxGroup {
|
|
|
54
53
|
desc?: string;
|
|
55
54
|
intro?: IntroDoc;
|
|
56
55
|
introSet?: IntroSet | null;
|
|
57
|
-
|
|
58
|
-
peers?: { name: string; note?: string; path?: string }[];
|
|
56
|
+
peers?: { name: string; path?: string }[];
|
|
59
57
|
docLinks?: DocLink[];
|
|
60
58
|
}
|
|
61
59
|
|
|
@@ -154,11 +152,10 @@ export function renderGroupContext(ctx: GroupContext | null): string {
|
|
|
154
152
|
if (g.intro && g.intro.body) {
|
|
155
153
|
lines.push(...introLines('组介绍', g.intro, g.introSet ?? null));
|
|
156
154
|
}
|
|
157
|
-
if (g.note) lines.push(`本项目在组里的位置:${g.note}`);
|
|
158
155
|
if (g.peers && g.peers.length) {
|
|
159
156
|
lines.push('组内成员:');
|
|
160
157
|
for (const p of g.peers) {
|
|
161
|
-
lines.push(` - ${p.name}
|
|
158
|
+
lines.push(` - ${p.name}${p.path ? `(${p.path})` : ''}`);
|
|
162
159
|
}
|
|
163
160
|
}
|
|
164
161
|
if (g.docLinks && g.docLinks.length) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//
|
|
1
|
+
// claim/host.ts —— 交付宿主:领域取数 → Supply → promptplug 的 assembleDelivery。
|
|
2
2
|
//
|
|
3
3
|
// #227 重构:从 wait.ts 拆出。wait.ts 只剩阻塞编排(跨进程轮询 / goal 到点收尾 /
|
|
4
4
|
// 面板随行),本文件专管「交付一条任务时要把哪些领域数据取齐」:
|
|
@@ -21,7 +21,7 @@ import { formatDuration, formatGoalTiming } from '../../core/instruction-templat
|
|
|
21
21
|
import { parseFrontmatter } from '../../shared/frontmatter.js';
|
|
22
22
|
import { getSettings, isGlobalKey, pendingQueueInfo } from '../localtask/service.js';
|
|
23
23
|
import { assembleDelivery, type AssembledDelivery } from './assemble.js';
|
|
24
|
-
import { annotateTaskDelivery, attachTemplateCtx } from '
|
|
24
|
+
import { annotateTaskDelivery, attachTemplateCtx } from '../localtask/ops/attach.js';
|
|
25
25
|
import { readGroupContext } from './groupctx.js';
|
|
26
26
|
import { ensureTaskGoal, previewTaskGoal } from '../goals/taskgoal.js';
|
|
27
27
|
import * as timegoal from '../goals/timegoal.js';
|
|
@@ -82,7 +82,7 @@ export function enrichGoalTiming(g: any): any {
|
|
|
82
82
|
return g;
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
//
|
|
85
|
+
// get **返回时刻**的目标上下文(渲染 instruction 用)。fail-open:加载失败 /
|
|
86
86
|
// 读不到 / 没目标 / 出错 → null,instruction 照常渲染(goal 段被整段丢弃)。
|
|
87
87
|
// 绝不写盘:showTimegoal 走 loadRecycledStore({persist:false})——timegoals.json
|
|
88
88
|
// 字节数不变,goal-expiry 单测字节比对钉着。
|
|
@@ -110,7 +110,7 @@ async function readGoalCtx(cwd: unknown): Promise<Record<string, any> | null> {
|
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
-
// 组装
|
|
113
|
+
// 组装 get 返回的任务载荷 + 指令。**单一路径**:
|
|
114
114
|
// 所有段落(上下文 / 附件 / 时间目标 / ack / 持续 get)一律进返回载荷的
|
|
115
115
|
// instruction 字段;task.text 始终是库存原文,绝不把系统提示词拼进正文。
|
|
116
116
|
// 旧 rule 区块已删除:done 指令与收尾要求统一由 ack 区块承载。
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// claim 模块(模板形态):任务系统的核心动词——领取。
|
|
2
2
|
//
|
|
3
|
-
// 领取链在这里闭环:
|
|
4
|
-
// → getTask → waitForTask(阻塞窗口)→
|
|
3
|
+
// 领取链在这里闭环:get action(CLI `localtask get` / HTTP POST `/api/localtasks/get`)
|
|
4
|
+
// → getTask → waitForTask(阻塞窗口)→ 交付组装(本域 host + promptplug 的 assemble)。
|
|
5
5
|
// 持续 get(waitgoal)配置也在本域:项目级开关 + 阻塞分钟数。
|
|
6
6
|
import { ModuleBase } from '../../runtime/types/module.js';
|
|
7
7
|
import { zodActionsOf, type ZodBoundAction } from '../../runtime/action-decorator.js';
|
|
@@ -23,11 +23,11 @@ function panelOrigin(port: unknown): string {
|
|
|
23
23
|
// 深链到面板目录工作台并定位当前主题(key 必有;key 缺失时落总览兜底)。
|
|
24
24
|
// 端口取实际发现的面板(可能不是默认端口)。经典看板 #/localtask 已下线。
|
|
25
25
|
export function deepLinkUrl(key: unknown, port: unknown): string {
|
|
26
|
-
const page = key ? `#/dir/${encodeURIComponent(String(key))}` : '#/
|
|
26
|
+
const page = key ? `#/dir/${encodeURIComponent(String(key))}` : '#/repos';
|
|
27
27
|
return `${panelOrigin(port)}/${page}`;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
// 本仓库/已安装包的 CLI 入口(src/modules
|
|
30
|
+
// 本仓库/已安装包的 CLI 入口(src/modules/<域>/ 上三级到包根)。
|
|
31
31
|
function binCliPath(): string {
|
|
32
32
|
return fileURLToPath(new URL('../../../bin/kv.mjs', import.meta.url));
|
|
33
33
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// claim/params.ts —— **外部参数(平面扩展)**的解析(任务 #62)。
|
|
2
2
|
//
|
|
3
|
-
// 领取任务的引擎(get
|
|
4
|
-
// nx-kv localtask
|
|
3
|
+
// 领取任务的引擎(get)支持往交付模板的 ctx 里塞**任意**外部参数:
|
|
4
|
+
// nx-kv localtask get --cwd "<dir>" --param lane=payment --param retry=2
|
|
5
5
|
//
|
|
6
6
|
// 模板里两种取法都能用:
|
|
7
7
|
// {{lane}} 平铺(顶层)——外部参数直接占一个键
|