nx-kv 0.48.1 → 0.48.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/package.json +1 -1
- package/src/modules/auth/actions/auth-login.ts +11 -4
- package/src/modules/auth/actions/auth-logout.ts +9 -4
- package/src/modules/auth/actions/auth-me.ts +9 -4
- package/src/modules/auth/actions/auth-status.ts +9 -4
- package/src/modules/bundled/actions/bundled-get.ts +12 -4
- package/src/modules/bundled/actions/bundled-groups.ts +9 -4
- package/src/modules/bundled/actions/bundled-install.ts +13 -4
- package/src/modules/bundled/actions/bundled-list.ts +9 -4
- package/src/modules/db/actions/db-backup.ts +10 -4
- package/src/modules/db/actions/db-migrate.ts +10 -4
- package/src/modules/db/actions/db-status.ts +9 -4
- package/src/modules/db/actions/db-verify.ts +9 -4
- package/src/modules/docs/actions/doc-add.ts +12 -4
- package/src/modules/docs/actions/doc-attach-note.ts +11 -4
- package/src/modules/docs/actions/doc-attach.ts +18 -4
- package/src/modules/docs/actions/doc-attachments.ts +9 -4
- package/src/modules/docs/actions/doc-detach.ts +11 -4
- package/src/modules/docs/actions/doc-get.ts +9 -4
- package/src/modules/docs/actions/doc-list.ts +9 -4
- package/src/modules/docs/actions/doc-remove.ts +9 -4
- package/src/modules/docs/actions/doc-update.ts +12 -4
- package/src/modules/docs/actions/docs-bind.ts +13 -4
- package/src/modules/docs/actions/docs-index.ts +9 -4
- package/src/modules/docs/actions/docs-link.ts +14 -4
- package/src/modules/docs/actions/docs-notebind.ts +13 -4
- package/src/modules/docs/actions/docs-seed.ts +9 -4
- package/src/modules/file/actions/file-content.ts +10 -4
- package/src/modules/file/actions/file-get.ts +10 -4
- package/src/modules/file/actions/file-list.ts +11 -4
- package/src/modules/file/actions/file-orphans.ts +9 -4
- package/src/modules/file/actions/file-prune.ts +10 -4
- package/src/modules/file/actions/file-remove.ts +10 -4
- package/src/modules/file/actions/file-sync.ts +13 -4
- package/src/modules/file/actions/file-upload.ts +15 -4
- package/src/modules/localtask/actions/localtask-add.ts +24 -4
- package/src/modules/localtask/actions/localtask-attach-note.ts +13 -4
- package/src/modules/localtask/actions/localtask-attach.ts +22 -4
- package/src/modules/localtask/actions/localtask-attachments.ts +11 -4
- package/src/modules/localtask/actions/localtask-cancel.ts +10 -4
- package/src/modules/localtask/actions/localtask-cancelMany.ts +11 -4
- package/src/modules/localtask/actions/localtask-chain.ts +11 -4
- package/src/modules/localtask/actions/localtask-claim.ts +12 -4
- package/src/modules/localtask/actions/localtask-clone.ts +11 -4
- package/src/modules/localtask/actions/localtask-closeMany.ts +13 -4
- package/src/modules/localtask/actions/localtask-config.ts +19 -4
- package/src/modules/localtask/actions/localtask-detach.ts +13 -4
- package/src/modules/localtask/actions/localtask-done.ts +12 -4
- package/src/modules/localtask/actions/localtask-events.ts +12 -4
- package/src/modules/localtask/actions/localtask-fork.ts +11 -4
- package/src/modules/localtask/actions/localtask-get.ts +11 -4
- package/src/modules/localtask/actions/localtask-importRemote.ts +13 -4
- package/src/modules/localtask/actions/localtask-list.ts +9 -4
- package/src/modules/localtask/actions/localtask-presence.ts +9 -4
- package/src/modules/localtask/actions/localtask-preview.ts +13 -4
- package/src/modules/localtask/actions/localtask-prune.ts +10 -4
- package/src/modules/localtask/actions/localtask-remove.ts +12 -4
- package/src/modules/localtask/actions/localtask-removeMany.ts +12 -4
- package/src/modules/localtask/actions/localtask-reopen.ts +17 -4
- package/src/modules/localtask/actions/localtask-reorder.ts +15 -4
- package/src/modules/localtask/actions/localtask-task-restore.ts +11 -4
- package/src/modules/localtask/actions/localtask-timegoalLog.ts +11 -4
- package/src/modules/localtask/actions/localtask-topic-add.ts +10 -4
- package/src/modules/localtask/actions/localtask-topic-remove.ts +11 -4
- package/src/modules/localtask/actions/localtask-topic-removeMany.ts +12 -4
- package/src/modules/localtask/actions/localtask-update.ts +22 -4
- package/src/modules/localtask/actions/localtask-wait.ts +13 -4
- package/src/modules/localtask/actions/task-move.ts +21 -4
- package/src/modules/repos/actions/board-add.ts +10 -4
- package/src/modules/repos/actions/board-assign.ts +12 -4
- package/src/modules/repos/actions/board-export.ts +9 -4
- package/src/modules/repos/actions/board-get.ts +9 -4
- package/src/modules/repos/actions/board-import.ts +9 -4
- package/src/modules/repos/actions/board-list.ts +9 -4
- package/src/modules/repos/actions/board-note.ts +11 -4
- package/src/modules/repos/actions/board-prefix.ts +10 -4
- package/src/modules/repos/actions/board-prune.ts +11 -4
- package/src/modules/repos/actions/board-rekey.ts +11 -4
- package/src/modules/repos/actions/board-remove.ts +9 -4
- package/src/modules/repos/actions/board-update.ts +11 -4
- package/src/modules/repos/actions/repo-add.ts +17 -4
- package/src/modules/repos/actions/repo-bind-topics.ts +10 -4
- package/src/modules/repos/actions/repo-bind.ts +12 -4
- package/src/modules/repos/actions/repo-clone.ts +14 -4
- package/src/modules/repos/actions/repo-detect.ts +9 -4
- package/src/modules/repos/actions/repo-doc-add.ts +15 -4
- package/src/modules/repos/actions/repo-doc-list.ts +9 -4
- package/src/modules/repos/actions/repo-doc-remove.ts +10 -4
- package/src/modules/repos/actions/repo-export.ts +12 -4
- package/src/modules/repos/actions/repo-get.ts +9 -4
- package/src/modules/repos/actions/repo-import-diff.ts +10 -4
- package/src/modules/repos/actions/repo-import.ts +14 -4
- package/src/modules/repos/actions/repo-key-migrate.ts +9 -4
- package/src/modules/repos/actions/repo-key-refresh.ts +11 -4
- package/src/modules/repos/actions/repo-key-set.ts +11 -4
- package/src/modules/repos/actions/repo-knowledge.ts +10 -4
- package/src/modules/repos/actions/repo-list.ts +9 -4
- package/src/modules/repos/actions/repo-open.ts +9 -4
- package/src/modules/repos/actions/repo-ref-add.ts +13 -4
- package/src/modules/repos/actions/repo-ref-backfill.ts +10 -4
- package/src/modules/repos/actions/repo-ref-check.ts +9 -4
- package/src/modules/repos/actions/repo-ref-clone.ts +16 -4
- package/src/modules/repos/actions/repo-ref-note.ts +12 -4
- package/src/modules/repos/actions/repo-ref-of.ts +9 -4
- package/src/modules/repos/actions/repo-ref-sync.ts +10 -4
- package/src/modules/repos/actions/repo-remote-check.ts +10 -4
- package/src/modules/repos/actions/repo-remote-list.ts +9 -4
- package/src/modules/repos/actions/repo-remote-pick.ts +10 -4
- package/src/modules/repos/actions/repo-remote.ts +11 -4
- package/src/modules/repos/actions/repo-remove.ts +9 -4
- package/src/modules/repos/actions/repo-scan.ts +11 -4
- package/src/modules/repos/actions/repo-update.ts +21 -4
- package/src/modules/setting/actions/setting-get.ts +9 -4
- package/src/modules/setting/actions/setting-set.ts +12 -4
- package/src/modules/system/actions/bootstrap.ts +7 -4
- package/src/modules/system/actions/health.ts +6 -3
- package/src/modules/system/actions/routes.ts +11 -3
- package/src/modules/system/routes.ts +1 -1
- package/src/modules/tasktool/actions/timegoal-check.ts +11 -4
- package/src/modules/tasktool/actions/timegoal-clear.ts +9 -4
- package/src/modules/tasktool/actions/timegoal-list.ts +9 -4
- package/src/modules/tasktool/actions/timegoal-log.ts +9 -4
- package/src/modules/tasktool/actions/timegoal-prune.ts +9 -4
- package/src/modules/tasktool/actions/timegoal-set.ts +11 -4
- package/src/modules/tasktool/actions/timegoal-show.ts +10 -4
- package/src/modules/tasktool/actions/timegoal-update.ts +11 -4
- package/src/modules/templates/actions/templates-add.ts +17 -4
- package/src/modules/templates/actions/templates-default.ts +13 -4
- package/src/modules/templates/actions/templates-list.ts +11 -4
- package/src/modules/templates/actions/templates-remove.ts +9 -4
- package/src/modules/templates/actions/templates-update.ts +15 -4
- package/src/modules/todo/actions/group-add.ts +10 -4
- package/src/modules/todo/actions/group-current.ts +9 -4
- package/src/modules/todo/actions/group-get.ts +9 -4
- package/src/modules/todo/actions/group-list.ts +9 -4
- package/src/modules/todo/actions/group-members.ts +9 -4
- package/src/modules/todo/actions/group-remove.ts +9 -4
- package/src/modules/todo/actions/group-update.ts +11 -4
- package/src/modules/todo/actions/group-use.ts +9 -4
- package/src/modules/todo/actions/prompt-get.ts +10 -4
- package/src/modules/todo/actions/prompt-remove.ts +10 -4
- package/src/modules/todo/actions/prompt-set.ts +11 -4
- package/src/modules/todo/actions/todo-add.ts +11 -4
- package/src/modules/todo/actions/todo-archive.ts +10 -4
- package/src/modules/todo/actions/todo-attach.ts +17 -4
- package/src/modules/todo/actions/todo-attachments.ts +12 -4
- package/src/modules/todo/actions/todo-done.ts +13 -4
- package/src/modules/todo/actions/todo-freeze.ts +12 -4
- package/src/modules/todo/actions/todo-get.ts +12 -4
- package/src/modules/todo/actions/todo-list.ts +11 -4
- package/src/modules/todo/actions/todo-remove.ts +12 -4
- package/src/modules/todo/actions/todo-unfreeze.ts +12 -4
- package/src/modules/todo/actions/todo-update.ts +15 -4
- package/src/modules/todo/actions/topic-add.ts +10 -4
- package/src/modules/todo/actions/topic-list.ts +9 -4
- package/src/modules/todo/actions/topic-remove.ts +10 -4
- package/src/runtime/action-decorator.ts +2 -2
- package/src/runtime/codegen.ts +26 -41
- package/src/runtime/registry.ts +2 -2
- package/src/web/frontend/api/client.generated.ts +384 -532
- package/src/web/frontend/page/cloud/api.ts +99 -0
- package/src/web/frontend/page/cloud/index.tsx +13 -32
- package/src/web/frontend/page/dag/api.ts +20 -0
- package/src/web/frontend/page/dag/index.tsx +2 -5
- package/src/web/frontend/page/dir/api.ts +135 -0
- package/src/web/frontend/page/dir/index.tsx +37 -57
- package/src/web/frontend/page/dir/task-actions.ts +39 -59
- package/src/web/frontend/page/dir/task-chain.ts +2 -2
- package/src/web/frontend/page/dir/task-feedback.ts +19 -23
- package/src/web/frontend/page/dir/task-goal.ts +3 -3
- package/src/web/frontend/page/dir/task.tsx +3 -3
- package/src/web/frontend/page/doc/api.ts +82 -0
- package/src/web/frontend/page/doc/index.tsx +29 -32
- package/src/web/frontend/page/group/api.ts +24 -0
- package/src/web/frontend/page/group/index.tsx +7 -16
- package/src/web/frontend/page/overview/api.ts +16 -0
- package/src/web/frontend/page/overview/index.tsx +2 -2
- package/src/web/frontend/page/progress/api.ts +20 -0
- package/src/web/frontend/page/progress/index.tsx +3 -6
- package/src/web/frontend/page/refs/api.ts +14 -0
- package/src/web/frontend/page/refs/index.tsx +2 -4
- package/src/web/frontend/page/repos/api.ts +197 -0
- package/src/web/frontend/page/repos/bind-modals.tsx +4 -7
- package/src/web/frontend/page/repos/board-admin.tsx +6 -6
- package/src/web/frontend/page/repos/doc-search-modal.tsx +4 -4
- package/src/web/frontend/page/repos/index.tsx +10 -14
- package/src/web/frontend/page/repos/pending-section.tsx +7 -13
- package/src/web/frontend/page/repos/ref-panel.tsx +9 -14
- package/src/web/frontend/page/repos/remote-modal.tsx +4 -28
- package/src/web/frontend/page/repos/repo-form-modal.tsx +4 -4
- package/src/web/frontend/page/settings/api.ts +29 -0
- package/src/web/frontend/page/settings/index.tsx +3 -3
- package/src/web/frontend/page/settings/prompt-templates-section.tsx +4 -4
- package/src/web/frontend/page/settings/sidebar-section.tsx +2 -2
- package/src/web/public/assets/Introduction-Du_dycft.js +6 -0
- package/src/web/public/assets/{bar-B9WWmCpt.js → bar-B52NTf_v.js} +1 -1
- package/src/web/public/assets/cloud-Droja_aT.js +3 -0
- package/src/web/public/assets/{composer-panel-ByezS8Xv.js → composer-panel-DpiU2h50.js} +1 -1
- package/src/web/public/assets/dag-Ca-wjIxQ.js +1 -0
- package/src/web/public/assets/{deleted-panel-BcbtctNF.js → deleted-panel-K9GgfR8t.js} +1 -1
- package/src/web/public/assets/dir-DacRpcBt.js +5 -0
- package/src/web/public/assets/group-TPuU-QVc.js +2 -0
- package/src/web/public/assets/{index-D8MvtVAm.js → index-BkLkooKe.js} +2 -2
- package/src/web/public/assets/{md-history-BqZvzWiD.js → md-history-0GBWw4qr.js} +1 -1
- package/src/web/public/assets/overview-B3kHI66i.js +1 -0
- package/src/web/public/assets/progress-CdhFz0Lz.js +3 -0
- package/src/web/public/assets/refs-BDxfuH6R.js +1 -0
- package/src/web/public/assets/repos-C8jRM7wS.js +15 -0
- package/src/web/public/assets/{route-crumb-CWVu80du.js → route-crumb-QvahotvN.js} +1 -1
- package/src/web/public/assets/settings-BBcdGLTc.js +1 -0
- package/src/web/public/assets/{status-tag-DRl9E2Os.js → status-tag-BheHByek.js} +1 -1
- package/src/web/public/assets/task-CUkQaLBZ.js +11 -0
- package/src/web/public/assets/task-utils-_JAWRAz6.js +12 -0
- package/src/web/public/assets/{templates-Df__0k-F.js → templates-CbRyW3PJ.js} +1 -1
- package/src/web/public/assets/{tool-bar-Cv7f6p4v.js → tool-bar-BAmT-BI-.js} +1 -1
- package/src/web/public/index.html +1 -1
- package/src/modules/auth/schemas.ts +0 -27
- package/src/modules/bundled/schemas.ts +0 -32
- package/src/modules/db/schemas.ts +0 -27
- package/src/modules/docs/schemas.ts +0 -107
- package/src/modules/file/schemas.ts +0 -61
- package/src/modules/localtask/schemas.ts +0 -310
- package/src/modules/repos/schemas.ts +0 -310
- package/src/modules/setting/schemas.ts +0 -18
- package/src/modules/system/schemas.ts +0 -30
- package/src/modules/tasktool/schemas.ts +0 -52
- package/src/modules/templates/schemas.ts +0 -50
- package/src/modules/todo/schemas.ts +0 -177
- package/src/web/public/assets/Introduction-aQCeCLrV.js +0 -6
- package/src/web/public/assets/cloud-C4b8SU7C.js +0 -3
- package/src/web/public/assets/dag-jvrjx4i7.js +0 -1
- package/src/web/public/assets/dir-B82XBb1J.js +0 -5
- package/src/web/public/assets/group-BPUOO_QM.js +0 -2
- package/src/web/public/assets/overview-DMihuyzh.js +0 -1
- package/src/web/public/assets/progress-D-rMgz3w.js +0 -3
- package/src/web/public/assets/refs-D21jmrn6.js +0 -1
- package/src/web/public/assets/repos-B94tMDGs.js +0 -15
- package/src/web/public/assets/settings-DgTt4JG5.js +0 -1
- package/src/web/public/assets/task-B2x5GoV3.js +0 -11
- package/src/web/public/assets/task-utils-By8gLpHY.js +0 -12
|
@@ -1,21 +1,26 @@
|
|
|
1
1
|
// doc.list —— 由 .tool/migrate-module.mjs 从 legacy 形态迁来(模板形态:一条 action 一个文件)。
|
|
2
2
|
//
|
|
3
|
-
//
|
|
3
|
+
// 契约(zod schema)就声明在本文件里——入参类型由基类泛型模板封装;本文件只做「声明 + 实现」,业务在服务层。
|
|
4
4
|
import { action } from '../../../runtime/action-decorator.js';
|
|
5
|
+
import { z } from 'zod';
|
|
5
6
|
import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
|
|
6
|
-
import { docListInput } from '../schemas.js';
|
|
7
7
|
import { listDocs as _listDocs } from '../service.js';
|
|
8
8
|
import { renderList as _renderList } from '../render.js';
|
|
9
9
|
const listDocs: any = _listDocs;
|
|
10
10
|
const renderList: any = _renderList;
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
/** doc.list 的入参契约(CLI 与 HTTP 共用同一份)。 */
|
|
13
|
+
const input = z.object({
|
|
14
|
+
external: z.boolean().optional().describe("附带外部绑定闭包内的文档与绑定清单"),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export class DocListAction extends ActionBase<typeof input> {
|
|
13
18
|
@action({
|
|
14
19
|
id: 'doc.list',
|
|
15
20
|
cli: ['docs', 'list'],
|
|
16
21
|
http: ['GET', '/api/docs'],
|
|
17
22
|
summary: '文档树索引(自有 + 可选外部;零副作用,双链解析的数据源)',
|
|
18
|
-
input
|
|
23
|
+
input,
|
|
19
24
|
render: renderList,
|
|
20
25
|
})
|
|
21
26
|
override async run(ctx: ActionInput<this['_input']>) {
|
|
@@ -1,20 +1,25 @@
|
|
|
1
1
|
// doc.remove —— 由 .tool/migrate-module.mjs 从 legacy 形态迁来(模板形态:一条 action 一个文件)。
|
|
2
2
|
//
|
|
3
|
-
//
|
|
3
|
+
// 契约(zod schema)就声明在本文件里——入参类型由基类泛型模板封装;本文件只做「声明 + 实现」,业务在服务层。
|
|
4
4
|
import { action } from '../../../runtime/action-decorator.js';
|
|
5
|
+
import { z } from 'zod';
|
|
5
6
|
import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
|
|
6
|
-
import { docRemoveInput } from '../schemas.js';
|
|
7
7
|
import { removeDoc as _removeDoc } from '../service.js';
|
|
8
8
|
const removeDoc: any = _removeDoc;
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
/** doc.remove 的入参契约(CLI 与 HTTP 共用同一份)。 */
|
|
11
|
+
const input = z.object({
|
|
12
|
+
ref: z.string(),
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export class DocRemoveAction extends ActionBase<typeof input> {
|
|
11
16
|
@action({
|
|
12
17
|
id: 'doc.remove',
|
|
13
18
|
cli: ['docs', 'remove'],
|
|
14
19
|
http: ['DELETE', '/api/docs/item'],
|
|
15
20
|
summary: '删除自有文档(外部绑定不可删)',
|
|
16
21
|
args: ['ref'],
|
|
17
|
-
input
|
|
22
|
+
input,
|
|
18
23
|
render: (d: any) => `已删除: ${d.rel}`,
|
|
19
24
|
})
|
|
20
25
|
override async run(ctx: ActionInput<this['_input']>) {
|
|
@@ -1,22 +1,30 @@
|
|
|
1
1
|
// doc.update —— 由 .tool/migrate-module.mjs 从 legacy 形态迁来(模板形态:一条 action 一个文件)。
|
|
2
2
|
//
|
|
3
|
-
//
|
|
3
|
+
// 契约(zod schema)就声明在本文件里——入参类型由基类泛型模板封装;本文件只做「声明 + 实现」,业务在服务层。
|
|
4
4
|
import { action } from '../../../runtime/action-decorator.js';
|
|
5
|
+
import { z } from 'zod';
|
|
5
6
|
import { ActionBase, type ActionInput, type ActionRunMeta } from '../../../runtime/action-base.js';
|
|
6
|
-
import { docUpdateInput } from '../schemas.js';
|
|
7
7
|
import { updateDoc as _updateDoc } from '../service.js';
|
|
8
8
|
import { renderWritten as _renderWritten } from '../render.js';
|
|
9
9
|
const updateDoc: any = _updateDoc;
|
|
10
10
|
const renderWritten: any = _renderWritten;
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
/** doc.update 的入参契约(CLI 与 HTTP 共用同一份)。 */
|
|
13
|
+
const input = z.object({
|
|
14
|
+
ref: z.string(),
|
|
15
|
+
body: z.string().optional().describe("Markdown 全文"),
|
|
16
|
+
bodyFile: z.string().optional().describe("从文件读全文(--body 优先);`-` = 读标准输入"),
|
|
17
|
+
'body-file': z.string().optional().describe("同 --bodyFile(连字符写法)"),
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export class DocUpdateAction extends ActionBase<typeof input> {
|
|
13
21
|
@action({
|
|
14
22
|
id: 'doc.update',
|
|
15
23
|
cli: ['docs', 'set'],
|
|
16
24
|
http: ['PATCH', '/api/docs/item'],
|
|
17
25
|
summary: '写文档正文(面板保存走这里;自有走 own 树、外部走绑定闭包内原文件;写盘后摘要回写 desc / 组内 note)',
|
|
18
26
|
args: ['ref'],
|
|
19
|
-
input
|
|
27
|
+
input,
|
|
20
28
|
render: renderWritten,
|
|
21
29
|
})
|
|
22
30
|
override async run(ctx: ActionInput<this['_input']>, opts: ActionRunMeta = {}) {
|
|
@@ -1,21 +1,30 @@
|
|
|
1
1
|
// docs.bind —— 由 .tool/migrate-module.mjs 从 legacy 形态迁来(模板形态:一条 action 一个文件)。
|
|
2
2
|
//
|
|
3
|
-
//
|
|
3
|
+
// 契约(zod schema)就声明在本文件里——入参类型由基类泛型模板封装;本文件只做「声明 + 实现」,业务在服务层。
|
|
4
4
|
import { action } from '../../../runtime/action-decorator.js';
|
|
5
|
+
import { z } from 'zod';
|
|
5
6
|
import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
|
|
6
|
-
import { docsBindInput } from '../schemas.js';
|
|
7
7
|
import * as refsNs from '../refs.js';
|
|
8
8
|
import { renderRef as _renderRef } from '../render.js';
|
|
9
9
|
const refs: any = refsNs;
|
|
10
10
|
const renderRef: any = _renderRef;
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
/** docs.bind 的入参契约(CLI 与 HTTP 共用同一份)。 */
|
|
13
|
+
const input = z.object({
|
|
14
|
+
repo: z.string().optional().describe("仓库(id / key / 路径 / 名称)"),
|
|
15
|
+
board: z.string().optional().describe("看板(id / key / 名称)"),
|
|
16
|
+
rel: z.string().optional().describe("自有树内路径(如 repo/github.com/me/x.md)"),
|
|
17
|
+
path: z.string().optional().describe("外部文件/目录绝对路径(如 Obsidian vault;只读,不进 zip)"),
|
|
18
|
+
reset: z.boolean().optional().describe("拆掉覆盖,回到约定路径"),
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export class DocsBindAction extends ActionBase<typeof input> {
|
|
13
22
|
@action({
|
|
14
23
|
id: 'docs.bind',
|
|
15
24
|
cli: ['docs', 'bind'],
|
|
16
25
|
http: ['POST', '/api/docs/bind'],
|
|
17
26
|
summary: '绑定项目/组介绍的文档覆盖(--repo 或 --board 二选一 + --rel <自有路径> | --path <外部文件/目录>;--reset 拆回约定路径)',
|
|
18
|
-
input
|
|
27
|
+
input,
|
|
19
28
|
render: renderRef,
|
|
20
29
|
})
|
|
21
30
|
override async run(ctx: ActionInput<this['_input']>) {
|
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
// docs.index —— 由 .tool/migrate-module.mjs 从 legacy 形态迁来(模板形态:一条 action 一个文件)。
|
|
2
2
|
//
|
|
3
|
-
//
|
|
3
|
+
// 契约(zod schema)就声明在本文件里——入参类型由基类泛型模板封装;本文件只做「声明 + 实现」,业务在服务层。
|
|
4
4
|
import { action } from '../../../runtime/action-decorator.js';
|
|
5
|
+
import { z } from 'zod';
|
|
5
6
|
import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
|
|
6
|
-
import { docsIndexInput } from '../schemas.js';
|
|
7
7
|
import * as linksNs from '../links.js';
|
|
8
8
|
const links: any = linksNs;
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
/** docs.index 的入参契约(CLI 与 HTTP 共用同一份)。 */
|
|
11
|
+
const input = z.object({
|
|
12
|
+
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export class DocsIndexAction extends ActionBase<typeof input> {
|
|
11
16
|
@action({
|
|
12
17
|
id: 'docs.index',
|
|
13
18
|
cli: ['docs', 'index'],
|
|
14
19
|
http: ['GET', '/api/docs/index'],
|
|
15
20
|
summary: '双链索引(docId + 文件名;前端点击 [[..]] 前拉一次;解析规则见 core/wikilink.js)',
|
|
16
|
-
input
|
|
21
|
+
input,
|
|
17
22
|
render: (d: any) => d.index.map((x: any) => ` ${x.name} → ${x.docId}`).join('\n') || '(空)',
|
|
18
23
|
})
|
|
19
24
|
override async run(_ctx: ActionInput<this['_input']>) {
|
|
@@ -1,22 +1,32 @@
|
|
|
1
1
|
// docs.link —— 由 .tool/migrate-module.mjs 从 legacy 形态迁来(模板形态:一条 action 一个文件)。
|
|
2
2
|
//
|
|
3
|
-
//
|
|
3
|
+
// 契约(zod schema)就声明在本文件里——入参类型由基类泛型模板封装;本文件只做「声明 + 实现」,业务在服务层。
|
|
4
4
|
import { action } from '../../../runtime/action-decorator.js';
|
|
5
|
+
import { z } from 'zod';
|
|
5
6
|
import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
|
|
6
|
-
import { docsLinkInput } from '../schemas.js';
|
|
7
7
|
import * as refsNs from '../refs.js';
|
|
8
8
|
import { renderLink as _renderLink } from '../render.js';
|
|
9
9
|
const refs: any = refsNs;
|
|
10
10
|
const renderLink: any = _renderLink;
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
/** docs.link 的入参契约(CLI 与 HTTP 共用同一份)。 */
|
|
13
|
+
const input = z.object({
|
|
14
|
+
board: z.string(),
|
|
15
|
+
doc: z.string().optional().describe("自有树路径 = 自有文档;盘符/绝对路径 = 外部只读引用"),
|
|
16
|
+
note: z.string().optional().describe("条目说明"),
|
|
17
|
+
tag: z.string().optional().describe("分类标签(如 qa;简介行渲染成小 chip;空串 = 清掉)"),
|
|
18
|
+
remove: z.number().optional().describe("移除第 N 条(1 起)"),
|
|
19
|
+
before: z.number().optional().describe("插到第 N 条之前(缺省追加到末尾)"),
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export class DocsLinkAction extends ActionBase<typeof input> {
|
|
13
23
|
@action({
|
|
14
24
|
id: 'docs.link',
|
|
15
25
|
cli: ['docs', 'link'],
|
|
16
26
|
http: ['POST', '/api/docs/link'],
|
|
17
27
|
summary: '维护组的附加文档列表(--doc <自有路径|绝对路径> + --note/--tag;--remove <序号> 移除;--before <序号> 插位;同 doc 重复添加 = 更新)',
|
|
18
28
|
args: ['board'],
|
|
19
|
-
input
|
|
29
|
+
input,
|
|
20
30
|
render: renderLink,
|
|
21
31
|
})
|
|
22
32
|
override async run(ctx: ActionInput<this['_input']>) {
|
|
@@ -1,22 +1,31 @@
|
|
|
1
1
|
// docs.notebind —— 由 .tool/migrate-module.mjs 从 legacy 形态迁来(模板形态:一条 action 一个文件)。
|
|
2
2
|
//
|
|
3
|
-
//
|
|
3
|
+
// 契约(zod schema)就声明在本文件里——入参类型由基类泛型模板封装;本文件只做「声明 + 实现」,业务在服务层。
|
|
4
4
|
import { action } from '../../../runtime/action-decorator.js';
|
|
5
|
+
import { z } from 'zod';
|
|
5
6
|
import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
|
|
6
|
-
import { docsNotebindInput } from '../schemas.js';
|
|
7
7
|
import * as refsNs from '../refs.js';
|
|
8
8
|
import { renderNoteRef as _renderNoteRef } from '../render.js';
|
|
9
9
|
const refs: any = refsNs;
|
|
10
10
|
const renderNoteRef: any = _renderNoteRef;
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
/** docs.notebind 的入参契约(CLI 与 HTTP 共用同一份)。 */
|
|
13
|
+
const input = z.object({
|
|
14
|
+
board: z.string(),
|
|
15
|
+
repo: z.string().describe("仓库(id / key / 路径 / 名称)"),
|
|
16
|
+
rel: z.string().optional().describe("自有树内路径"),
|
|
17
|
+
path: z.string().optional().describe("外部文件/目录绝对路径(只读)"),
|
|
18
|
+
reset: z.boolean().optional().describe("拆掉覆盖,回到约定路径"),
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export class DocsNotebindAction extends ActionBase<typeof input> {
|
|
13
22
|
@action({
|
|
14
23
|
id: 'docs.notebind',
|
|
15
24
|
cli: ['docs', 'note-bind'],
|
|
16
25
|
http: ['POST', '/api/docs/note-bind'],
|
|
17
26
|
summary: '绑定组内仓库描述的文档覆盖(--board <看板> --repo <仓库> + --rel/--path/--reset;仓库须为该组成员)',
|
|
18
27
|
args: ['board'],
|
|
19
|
-
input
|
|
28
|
+
input,
|
|
20
29
|
render: renderNoteRef,
|
|
21
30
|
})
|
|
22
31
|
override async run(ctx: ActionInput<this['_input']>) {
|
|
@@ -1,21 +1,26 @@
|
|
|
1
1
|
// docs.seed —— 由 .tool/migrate-module.mjs 从 legacy 形态迁来(模板形态:一条 action 一个文件)。
|
|
2
2
|
//
|
|
3
|
-
//
|
|
3
|
+
// 契约(zod schema)就声明在本文件里——入参类型由基类泛型模板封装;本文件只做「声明 + 实现」,业务在服务层。
|
|
4
4
|
import { action } from '../../../runtime/action-decorator.js';
|
|
5
|
+
import { z } from 'zod';
|
|
5
6
|
import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
|
|
6
|
-
import { docsSeedInput } from '../schemas.js';
|
|
7
7
|
import * as seedNs from '../seed.js';
|
|
8
8
|
import { renderSeed as _renderSeed } from '../render.js';
|
|
9
9
|
const seed: any = seedNs;
|
|
10
10
|
const renderSeed: any = _renderSeed;
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
/** docs.seed 的入参契约(CLI 与 HTTP 共用同一份)。 */
|
|
13
|
+
const input = z.object({
|
|
14
|
+
apply: z.boolean().optional().describe("执行播种(缺省只预览)"),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export class DocsSeedAction extends ActionBase<typeof input> {
|
|
13
18
|
@action({
|
|
14
19
|
id: 'docs.seed',
|
|
15
20
|
cli: ['docs', 'seed'],
|
|
16
21
|
http: ['POST', '/api/docs/seed'],
|
|
17
22
|
summary: '把仓库 desc / 看板 desc / 组内 note 字符串播种成约定路径的 md(缺省预览,--apply 执行;幂等)',
|
|
18
|
-
input
|
|
23
|
+
input,
|
|
19
24
|
render: renderSeed,
|
|
20
25
|
})
|
|
21
26
|
override async run(ctx: ActionInput<this['_input']>) {
|
|
@@ -1,20 +1,26 @@
|
|
|
1
1
|
// file.content —— 由 .tool/migrate-module.mjs 从 legacy 形态迁来(模板形态:一条 action 一个文件)。
|
|
2
2
|
//
|
|
3
|
-
//
|
|
3
|
+
// 契约(zod schema)就声明在本文件里——入参类型由基类泛型模板封装;本文件只做「声明 + 实现」,业务在服务层。
|
|
4
4
|
import { action } from '../../../runtime/action-decorator.js';
|
|
5
|
+
import { z } from 'zod';
|
|
5
6
|
import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
|
|
6
|
-
import { fileContentInput } from '../schemas.js';
|
|
7
7
|
import * as serviceNs from '../service.js';
|
|
8
8
|
const service: any = serviceNs;
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
/** file.content 的入参契约(CLI 与 HTTP 共用同一份)。 */
|
|
11
|
+
const input = z.object({
|
|
12
|
+
fileId: z.string(),
|
|
13
|
+
group: z.number().optional().describe("工作空间 id(默认取当前)"),
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export class FileContentAction extends ActionBase<typeof input> {
|
|
11
17
|
@action({
|
|
12
18
|
id: 'file.content',
|
|
13
19
|
cli: ['file', 'content'],
|
|
14
20
|
http: ['GET', '/api/file/content/:fileId'],
|
|
15
21
|
summary: '取附件本体:面板内联预览;CLI 打印出图地址与本地路径',
|
|
16
22
|
args: ['fileId'],
|
|
17
|
-
input
|
|
23
|
+
input,
|
|
18
24
|
render: (d: any) => service.renderContent(d),
|
|
19
25
|
stream: true,
|
|
20
26
|
})
|
|
@@ -1,20 +1,26 @@
|
|
|
1
1
|
// file.get —— 由 .tool/migrate-module.mjs 从 legacy 形态迁来(模板形态:一条 action 一个文件)。
|
|
2
2
|
//
|
|
3
|
-
//
|
|
3
|
+
// 契约(zod schema)就声明在本文件里——入参类型由基类泛型模板封装;本文件只做「声明 + 实现」,业务在服务层。
|
|
4
4
|
import { action } from '../../../runtime/action-decorator.js';
|
|
5
|
+
import { z } from 'zod';
|
|
5
6
|
import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
|
|
6
|
-
import { fileGetInput } from '../schemas.js';
|
|
7
7
|
import * as serviceNs from '../service.js';
|
|
8
8
|
const service: any = serviceNs;
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
/** file.get 的入参契约(CLI 与 HTTP 共用同一份)。 */
|
|
11
|
+
const input = z.object({
|
|
12
|
+
fileId: z.string(),
|
|
13
|
+
group: z.number().optional().describe("工作空间 id(默认取当前)"),
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export class FileGetAction extends ActionBase<typeof input> {
|
|
11
17
|
@action({
|
|
12
18
|
id: 'file.get',
|
|
13
19
|
cli: ['file', 'get'],
|
|
14
20
|
http: ['GET', '/api/file/item'],
|
|
15
21
|
summary: '查单个附件的元数据与本地路径',
|
|
16
22
|
args: ['fileId'],
|
|
17
|
-
input
|
|
23
|
+
input,
|
|
18
24
|
render: (d: any) => service.renderFileInfo(d),
|
|
19
25
|
})
|
|
20
26
|
override async run(ctx: ActionInput<this['_input']>) {
|
|
@@ -1,19 +1,26 @@
|
|
|
1
1
|
// file.list —— 由 .tool/migrate-module.mjs 从 legacy 形态迁来(模板形态:一条 action 一个文件)。
|
|
2
2
|
//
|
|
3
|
-
//
|
|
3
|
+
// 契约(zod schema)就声明在本文件里——入参类型由基类泛型模板封装;本文件只做「声明 + 实现」,业务在服务层。
|
|
4
4
|
import { action } from '../../../runtime/action-decorator.js';
|
|
5
|
+
import { z } from 'zod';
|
|
5
6
|
import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
|
|
6
|
-
import { fileListInput } from '../schemas.js';
|
|
7
7
|
import * as serviceNs from '../service.js';
|
|
8
8
|
const service: any = serviceNs;
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
/** file.list 的入参契约(CLI 与 HTTP 共用同一份)。 */
|
|
11
|
+
const input = z.object({
|
|
12
|
+
group: z.number().optional().describe("工作空间 id(默认取当前)"),
|
|
13
|
+
limit: z.number().default(100),
|
|
14
|
+
offset: z.number().default(0),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export class FileListAction extends ActionBase<typeof input> {
|
|
11
18
|
@action({
|
|
12
19
|
id: 'file.list',
|
|
13
20
|
cli: ['file', 'list'],
|
|
14
21
|
http: ['GET', '/api/file'],
|
|
15
22
|
summary: '列出当前用户空间的附件(含本地已同步路径)',
|
|
16
|
-
input
|
|
23
|
+
input,
|
|
17
24
|
render: (d: any) => service.renderFileList(d),
|
|
18
25
|
})
|
|
19
26
|
override async run(ctx: ActionInput<this['_input']>) {
|
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
// file.orphans —— 由 .tool/migrate-module.mjs 从 legacy 形态迁来(模板形态:一条 action 一个文件)。
|
|
2
2
|
//
|
|
3
|
-
//
|
|
3
|
+
// 契约(zod schema)就声明在本文件里——入参类型由基类泛型模板封装;本文件只做「声明 + 实现」,业务在服务层。
|
|
4
4
|
import { action } from '../../../runtime/action-decorator.js';
|
|
5
|
+
import { z } from 'zod';
|
|
5
6
|
import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
|
|
6
|
-
import { fileOrphansInput } from '../schemas.js';
|
|
7
7
|
import * as serviceNs from '../service.js';
|
|
8
8
|
const service: any = serviceNs;
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
/** file.orphans 的入参契约(CLI 与 HTTP 共用同一份)。 */
|
|
11
|
+
const input = z.object({
|
|
12
|
+
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export class FileOrphansAction extends ActionBase<typeof input> {
|
|
11
16
|
@action({
|
|
12
17
|
id: 'file.orphans',
|
|
13
18
|
cli: ['file', 'orphans'],
|
|
14
19
|
http: ['GET', '/api/file/orphans'],
|
|
15
20
|
summary: '列出无主资源(没有任何任务/文档关系边;删任务、删文档、删正文行之后用)',
|
|
16
|
-
input
|
|
21
|
+
input,
|
|
17
22
|
render: (d: any) => service.renderOrphans(d),
|
|
18
23
|
})
|
|
19
24
|
override async run(_ctx: ActionInput<this['_input']>) {
|
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
// file.prune —— 由 .tool/migrate-module.mjs 从 legacy 形态迁来(模板形态:一条 action 一个文件)。
|
|
2
2
|
//
|
|
3
|
-
//
|
|
3
|
+
// 契约(zod schema)就声明在本文件里——入参类型由基类泛型模板封装;本文件只做「声明 + 实现」,业务在服务层。
|
|
4
4
|
import { action } from '../../../runtime/action-decorator.js';
|
|
5
|
+
import { z } from 'zod';
|
|
5
6
|
import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
|
|
6
|
-
import { filePruneInput } from '../schemas.js';
|
|
7
7
|
import * as serviceNs from '../service.js';
|
|
8
8
|
const service: any = serviceNs;
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
/** file.prune 的入参契约(CLI 与 HTTP 共用同一份)。 */
|
|
11
|
+
const input = z.object({
|
|
12
|
+
'dry-run': z.boolean().optional().describe("只列清单不删除"),
|
|
13
|
+
dryRun: z.boolean().optional().describe("同 --dry-run(HTTP body 用)"),
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export class FilePruneAction extends ActionBase<typeof input> {
|
|
11
17
|
@action({
|
|
12
18
|
id: 'file.prune',
|
|
13
19
|
cli: ['file', 'prune'],
|
|
14
20
|
http: ['POST', '/api/file/prune'],
|
|
15
21
|
summary: '回收无主资源(DB 行 + 附件根目录内的本机/镜像字节;仍被引用的不删)',
|
|
16
|
-
input
|
|
22
|
+
input,
|
|
17
23
|
render: (d: any) => service.renderPrune(d),
|
|
18
24
|
})
|
|
19
25
|
override async run(ctx: ActionInput<this['_input']>) {
|
|
@@ -1,20 +1,26 @@
|
|
|
1
1
|
// file.remove —— 由 .tool/migrate-module.mjs 从 legacy 形态迁来(模板形态:一条 action 一个文件)。
|
|
2
2
|
//
|
|
3
|
-
//
|
|
3
|
+
// 契约(zod schema)就声明在本文件里——入参类型由基类泛型模板封装;本文件只做「声明 + 实现」,业务在服务层。
|
|
4
4
|
import { action } from '../../../runtime/action-decorator.js';
|
|
5
|
+
import { z } from 'zod';
|
|
5
6
|
import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
|
|
6
|
-
import { fileRemoveInput } from '../schemas.js';
|
|
7
7
|
import * as serviceNs from '../service.js';
|
|
8
8
|
const service: any = serviceNs;
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
/** file.remove 的入参契约(CLI 与 HTTP 共用同一份)。 */
|
|
11
|
+
const input = z.object({
|
|
12
|
+
fileId: z.string(),
|
|
13
|
+
group: z.number().optional().describe("工作空间 id(默认取当前)"),
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export class FileRemoveAction extends ActionBase<typeof input> {
|
|
11
17
|
@action({
|
|
12
18
|
id: 'file.remove',
|
|
13
19
|
cli: ['file', 'remove'],
|
|
14
20
|
http: ['DELETE', '/api/file/item'],
|
|
15
21
|
summary: '删除附件(后端软删;本地副本要清用 file sync --prune)',
|
|
16
22
|
args: ['fileId'],
|
|
17
|
-
input
|
|
23
|
+
input,
|
|
18
24
|
render: (d: any) => service.renderRemove(d),
|
|
19
25
|
})
|
|
20
26
|
override async run(ctx: ActionInput<this['_input']>) {
|
|
@@ -1,19 +1,28 @@
|
|
|
1
1
|
// file.sync —— 由 .tool/migrate-module.mjs 从 legacy 形态迁来(模板形态:一条 action 一个文件)。
|
|
2
2
|
//
|
|
3
|
-
//
|
|
3
|
+
// 契约(zod schema)就声明在本文件里——入参类型由基类泛型模板封装;本文件只做「声明 + 实现」,业务在服务层。
|
|
4
4
|
import { action } from '../../../runtime/action-decorator.js';
|
|
5
|
+
import { z } from 'zod';
|
|
5
6
|
import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
|
|
6
|
-
import { fileSyncInput } from '../schemas.js';
|
|
7
7
|
import * as serviceNs from '../service.js';
|
|
8
8
|
const service: any = serviceNs;
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
/** file.sync 的入参契约(CLI 与 HTTP 共用同一份)。 */
|
|
11
|
+
const input = z.object({
|
|
12
|
+
ids: z.array(z.string()).optional().describe("只同步这些 fileId(逗号分隔)"),
|
|
13
|
+
dir: z.string().optional().describe("本地目录(默认 ~/.nx-kv/attachments/<工作空间>/)"),
|
|
14
|
+
prune: z.boolean().optional().describe("删掉本地已不在后端的文件(仅全量同步时生效)"),
|
|
15
|
+
dryRun: z.boolean().optional().describe("只列出将下载什么,不落盘"),
|
|
16
|
+
group: z.number().optional().describe("工作空间 id(默认取当前)"),
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export class FileSyncAction extends ActionBase<typeof input> {
|
|
11
20
|
@action({
|
|
12
21
|
id: 'file.sync',
|
|
13
22
|
cli: ['file', 'sync'],
|
|
14
23
|
http: ['POST', '/api/file/sync'],
|
|
15
24
|
summary: '把附件同步到本机(默认全部;--ids 只同步指定附件)——为了不再依赖网络读附件',
|
|
16
|
-
input
|
|
25
|
+
input,
|
|
17
26
|
render: (d: any) => service.renderSync(d),
|
|
18
27
|
})
|
|
19
28
|
override async run(ctx: ActionInput<this['_input']>) {
|
|
@@ -1,19 +1,30 @@
|
|
|
1
1
|
// file.upload —— 由 .tool/migrate-module.mjs 从 legacy 形态迁来(模板形态:一条 action 一个文件)。
|
|
2
2
|
//
|
|
3
|
-
//
|
|
3
|
+
// 契约(zod schema)就声明在本文件里——入参类型由基类泛型模板封装;本文件只做「声明 + 实现」,业务在服务层。
|
|
4
4
|
import { action } from '../../../runtime/action-decorator.js';
|
|
5
|
+
import { z } from 'zod';
|
|
5
6
|
import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
|
|
6
|
-
import { fileUploadInput } from '../schemas.js';
|
|
7
7
|
import * as serviceNs from '../service.js';
|
|
8
8
|
const service: any = serviceNs;
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
/** file.upload 的入参契约(CLI 与 HTTP 共用同一份)。 */
|
|
11
|
+
const input = z.object({
|
|
12
|
+
path: z.string().optional().describe("本机文件路径"),
|
|
13
|
+
content: z.string().optional().describe("base64 内容(面板上传用,可为 data URL)"),
|
|
14
|
+
name: z.string().optional().describe("文件名(content 上传时必填)"),
|
|
15
|
+
contentType: z.string().optional().describe("覆盖 Content-Type(默认按扩展名猜)"),
|
|
16
|
+
local: z.boolean().optional().describe("存本机附件仓(~/.nx-kv/attachments/local/),不碰云端"),
|
|
17
|
+
accessLevel: z.enum(["public", "private", "protected"]).default('public').describe("出图权限;public 才能被 <img> 直接预览(--local 时无意义)"),
|
|
18
|
+
group: z.number().optional().describe("工作空间 id(默认取当前)"),
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export class FileUploadAction extends ActionBase<typeof input> {
|
|
11
22
|
@action({
|
|
12
23
|
id: 'file.upload',
|
|
13
24
|
cli: ['file', 'upload'],
|
|
14
25
|
http: ['POST', '/api/file'],
|
|
15
26
|
summary: '上传附件(--local 存本机附件仓,本地任务贴图用;默认传当前用户空间的云端图床)',
|
|
16
|
-
input
|
|
27
|
+
input,
|
|
17
28
|
render: (d: any) => service.renderUpload(d),
|
|
18
29
|
})
|
|
19
30
|
override async run(ctx: ActionInput<this['_input']>) {
|
|
@@ -1,20 +1,40 @@
|
|
|
1
1
|
// localtask.add —— 由 .tool/migrate-module.mjs 从 legacy 形态迁来(模板形态:一条 action 一个文件)。
|
|
2
2
|
//
|
|
3
|
-
//
|
|
3
|
+
// 契约(zod schema)就声明在本文件里——入参类型由基类泛型模板封装;本文件只做「声明 + 实现」,业务在服务层。
|
|
4
4
|
import { action } from '../../../runtime/action-decorator.js';
|
|
5
|
+
import { z } from 'zod';
|
|
5
6
|
import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
|
|
6
|
-
import { localtaskAddInput } from '../schemas.js';
|
|
7
7
|
import { renderAdd as _renderAdd } from '../action-render.js';
|
|
8
8
|
const renderAdd: any = _renderAdd;
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
/** localtask.add 的入参契约(CLI 与 HTTP 共用同一份)。 */
|
|
11
|
+
const input = z.object({
|
|
12
|
+
text: z.string(),
|
|
13
|
+
cwd: z.string().optional().describe("工作目录(作为主题;默认当前目录)。归属由 --project 决定:给了 --project 就用它推导落点,这里再给且不一致会报错"),
|
|
14
|
+
summary: z.string().optional().describe("顺带刷新该主题的当前现状(可选)"),
|
|
15
|
+
global: z.boolean().optional().describe("推到全局主题(共享池):任何目录的 wait 在本地空时自动领取;--cwd 被忽略"),
|
|
16
|
+
board: z.string().optional().describe("工作组(看板)id / key / 名称:任务正文自动带上 frontmatter(board + 组介绍引用),该任务才会出现在组面板里;必须同时给 --project 指明归属项目"),
|
|
17
|
+
project: z.string().optional().describe("归属项目(仓库 key / 名称 / 路径):任务挂在哪个项目上,落点目录由它推导,frontmatter 带上 project + 项目介绍引用;配 --board 时必须是该组成员"),
|
|
18
|
+
duration: z.string().optional().describe("时间目标时长(2h / 90m / 5小时):领取即计时,未到点不许标完成"),
|
|
19
|
+
'goal-prompt': z.string().optional().describe("时间目标的附加要求(随 check 指令一起固化,可省)"),
|
|
20
|
+
goalPrompt: z.string().optional().describe("同 --goal-prompt(驼峰写法)"),
|
|
21
|
+
'block-by': z.string().optional().describe("DAG 依赖:逗号分隔的任务 id(如 12,13)——这些任务全部完成后本条才可领取"),
|
|
22
|
+
blockBy: z.string().optional().describe("同 --block-by(驼峰 / HTTP body)"),
|
|
23
|
+
gate: z.boolean().optional().describe("闸门任务:自身未完成(无 completedAt)时,队列里排在它后面的 pending 都不可领"),
|
|
24
|
+
'fork-of': z.string().optional().describe("任务链(#69):这条任务从哪条派生——裸数字=同主题父任务编号,或 \"key:id\"=跨主题;父任务必须存在"),
|
|
25
|
+
forkOf: z.string().optional().describe("同 --fork-of(驼峰 / HTTP body)"),
|
|
26
|
+
'fork-kind': z.string().optional().describe("派生种类:comment(评论/随手派生,默认)或 reopen(验收反馈重开)"),
|
|
27
|
+
forkKind: z.string().optional().describe("同 --fork-kind(驼峰写法)"),
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export class LocaltaskAddAction extends ActionBase<typeof input> {
|
|
11
31
|
@action({
|
|
12
32
|
id: 'localtask.add',
|
|
13
33
|
cli: ['localtask', 'add'],
|
|
14
34
|
http: ['POST', '/api/localtasks'],
|
|
15
35
|
summary: '向某主题(工作目录)的队列回填一条任务(有 wait 在等则即时投递,否则排队);--global 推到全局共享池;--duration 给任务带时间目标(领取即计时,完成前必须 check);--board/--project 让任务带工作组语义(正文 frontmatter:board + project + 双方介绍引用),并落进该项目的队列;正文自带 frontmatter 时同样认归属——补介绍引用,落点跟到项目队列(显式给过 --cwd 时不挪窝)',
|
|
16
36
|
args: ['text'],
|
|
17
|
-
input
|
|
37
|
+
input,
|
|
18
38
|
render: renderAdd,
|
|
19
39
|
})
|
|
20
40
|
override async run(ctx: ActionInput<this['_input']>) {
|
|
@@ -1,17 +1,26 @@
|
|
|
1
1
|
// localtask.attach-note —— 由 .tool/migrate-module.mjs 从 legacy 形态迁来(模板形态:一条 action 一个文件)。
|
|
2
2
|
//
|
|
3
|
-
//
|
|
3
|
+
// 契约(zod schema)就声明在本文件里——入参类型由基类泛型模板封装;本文件只做「声明 + 实现」,业务在服务层。
|
|
4
4
|
import { action } from '../../../runtime/action-decorator.js';
|
|
5
|
+
import { z } from 'zod';
|
|
5
6
|
import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
|
|
6
|
-
import { localtaskAttachNoteInput } from '../schemas.js';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
/** localtask.attach-note 的入参契约(CLI 与 HTTP 共用同一份)。 */
|
|
9
|
+
const input = z.object({
|
|
10
|
+
id: z.number().describe("任务编号"),
|
|
11
|
+
cwd: z.string().optional(),
|
|
12
|
+
key: z.string().optional(),
|
|
13
|
+
attachment: z.string().describe("资源 id(见 localtask attachments)"),
|
|
14
|
+
note: z.string().optional().describe("说明文字(留空 = 清掉)"),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export class LocaltaskAttachNoteAction extends ActionBase<typeof input> {
|
|
9
18
|
@action({
|
|
10
19
|
id: 'localtask.attach-note',
|
|
11
20
|
cli: ['localtask', 'attach-note'],
|
|
12
21
|
http: ['PATCH', '/api/localtasks/attach-note'],
|
|
13
22
|
summary: '改一条附件绑定的说明(desc):--attachment <资源 id> --note <说明>(只动说明,角色/位置不变)',
|
|
14
|
-
input
|
|
23
|
+
input,
|
|
15
24
|
render: (d: any) => `已更新 ${d.attachment} 的说明:${d.note || '(清空)'}`,
|
|
16
25
|
})
|
|
17
26
|
override async run(ctx: ActionInput<this['_input']>) {
|