nx-kv 0.48.0 → 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.
Files changed (242) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/package.json +1 -1
  3. package/src/modules/auth/actions/auth-login.ts +13 -6
  4. package/src/modules/auth/actions/auth-logout.ts +11 -6
  5. package/src/modules/auth/actions/auth-me.ts +11 -6
  6. package/src/modules/auth/actions/auth-status.ts +11 -6
  7. package/src/modules/bundled/actions/bundled-get.ts +14 -6
  8. package/src/modules/bundled/actions/bundled-groups.ts +11 -6
  9. package/src/modules/bundled/actions/bundled-install.ts +15 -6
  10. package/src/modules/bundled/actions/bundled-list.ts +11 -6
  11. package/src/modules/db/actions/db-backup.ts +12 -6
  12. package/src/modules/db/actions/db-migrate.ts +12 -6
  13. package/src/modules/db/actions/db-status.ts +11 -6
  14. package/src/modules/db/actions/db-verify.ts +11 -6
  15. package/src/modules/docs/actions/doc-add.ts +14 -6
  16. package/src/modules/docs/actions/doc-attach-note.ts +13 -6
  17. package/src/modules/docs/actions/doc-attach.ts +20 -6
  18. package/src/modules/docs/actions/doc-attachments.ts +11 -6
  19. package/src/modules/docs/actions/doc-detach.ts +13 -6
  20. package/src/modules/docs/actions/doc-get.ts +11 -6
  21. package/src/modules/docs/actions/doc-list.ts +11 -6
  22. package/src/modules/docs/actions/doc-remove.ts +11 -6
  23. package/src/modules/docs/actions/doc-update.ts +14 -6
  24. package/src/modules/docs/actions/docs-bind.ts +15 -6
  25. package/src/modules/docs/actions/docs-index.ts +11 -6
  26. package/src/modules/docs/actions/docs-link.ts +16 -6
  27. package/src/modules/docs/actions/docs-notebind.ts +15 -6
  28. package/src/modules/docs/actions/docs-seed.ts +11 -6
  29. package/src/modules/file/actions/file-content.ts +18 -10
  30. package/src/modules/file/actions/file-get.ts +12 -6
  31. package/src/modules/file/actions/file-list.ts +13 -6
  32. package/src/modules/file/actions/file-orphans.ts +11 -6
  33. package/src/modules/file/actions/file-prune.ts +12 -6
  34. package/src/modules/file/actions/file-remove.ts +12 -6
  35. package/src/modules/file/actions/file-sync.ts +15 -6
  36. package/src/modules/file/actions/file-upload.ts +17 -6
  37. package/src/modules/localtask/actions/localtask-add.ts +26 -6
  38. package/src/modules/localtask/actions/localtask-attach-note.ts +15 -6
  39. package/src/modules/localtask/actions/localtask-attach.ts +24 -6
  40. package/src/modules/localtask/actions/localtask-attachments.ts +13 -6
  41. package/src/modules/localtask/actions/localtask-cancel.ts +12 -6
  42. package/src/modules/localtask/actions/localtask-cancelMany.ts +13 -6
  43. package/src/modules/localtask/actions/localtask-chain.ts +13 -6
  44. package/src/modules/localtask/actions/localtask-claim.ts +14 -6
  45. package/src/modules/localtask/actions/localtask-clone.ts +13 -6
  46. package/src/modules/localtask/actions/localtask-closeMany.ts +15 -6
  47. package/src/modules/localtask/actions/localtask-config.ts +23 -8
  48. package/src/modules/localtask/actions/localtask-detach.ts +15 -6
  49. package/src/modules/localtask/actions/localtask-done.ts +14 -6
  50. package/src/modules/localtask/actions/localtask-events.ts +19 -9
  51. package/src/modules/localtask/actions/localtask-fork.ts +13 -6
  52. package/src/modules/localtask/actions/localtask-get.ts +13 -6
  53. package/src/modules/localtask/actions/localtask-importRemote.ts +20 -9
  54. package/src/modules/localtask/actions/localtask-list.ts +11 -6
  55. package/src/modules/localtask/actions/localtask-presence.ts +11 -6
  56. package/src/modules/localtask/actions/localtask-preview.ts +15 -6
  57. package/src/modules/localtask/actions/localtask-prune.ts +12 -6
  58. package/src/modules/localtask/actions/localtask-remove.ts +14 -6
  59. package/src/modules/localtask/actions/localtask-removeMany.ts +14 -6
  60. package/src/modules/localtask/actions/localtask-reopen.ts +22 -7
  61. package/src/modules/localtask/actions/localtask-reorder.ts +17 -6
  62. package/src/modules/localtask/actions/localtask-task-restore.ts +13 -6
  63. package/src/modules/localtask/actions/localtask-timegoalLog.ts +13 -6
  64. package/src/modules/localtask/actions/localtask-topic-add.ts +12 -6
  65. package/src/modules/localtask/actions/localtask-topic-remove.ts +13 -6
  66. package/src/modules/localtask/actions/localtask-topic-removeMany.ts +14 -6
  67. package/src/modules/localtask/actions/localtask-update.ts +24 -6
  68. package/src/modules/localtask/actions/localtask-wait.ts +15 -6
  69. package/src/modules/localtask/actions/task-move.ts +23 -6
  70. package/src/modules/repos/actions/board-add.ts +12 -6
  71. package/src/modules/repos/actions/board-assign.ts +14 -6
  72. package/src/modules/repos/actions/board-export.ts +11 -6
  73. package/src/modules/repos/actions/board-get.ts +11 -6
  74. package/src/modules/repos/actions/board-import.ts +17 -7
  75. package/src/modules/repos/actions/board-list.ts +11 -6
  76. package/src/modules/repos/actions/board-note.ts +13 -6
  77. package/src/modules/repos/actions/board-prefix.ts +12 -6
  78. package/src/modules/repos/actions/board-prune.ts +13 -6
  79. package/src/modules/repos/actions/board-rekey.ts +13 -6
  80. package/src/modules/repos/actions/board-remove.ts +11 -6
  81. package/src/modules/repos/actions/board-update.ts +13 -6
  82. package/src/modules/repos/actions/repo-add.ts +19 -6
  83. package/src/modules/repos/actions/repo-bind-topics.ts +12 -6
  84. package/src/modules/repos/actions/repo-bind.ts +14 -6
  85. package/src/modules/repos/actions/repo-clone.ts +16 -6
  86. package/src/modules/repos/actions/repo-detect.ts +11 -6
  87. package/src/modules/repos/actions/repo-doc-add.ts +17 -6
  88. package/src/modules/repos/actions/repo-doc-list.ts +11 -6
  89. package/src/modules/repos/actions/repo-doc-remove.ts +12 -6
  90. package/src/modules/repos/actions/repo-export.ts +14 -6
  91. package/src/modules/repos/actions/repo-get.ts +11 -6
  92. package/src/modules/repos/actions/repo-import-diff.ts +12 -6
  93. package/src/modules/repos/actions/repo-import.ts +16 -6
  94. package/src/modules/repos/actions/repo-key-migrate.ts +11 -6
  95. package/src/modules/repos/actions/repo-key-refresh.ts +13 -6
  96. package/src/modules/repos/actions/repo-key-set.ts +13 -6
  97. package/src/modules/repos/actions/repo-knowledge.ts +12 -6
  98. package/src/modules/repos/actions/repo-list.ts +11 -6
  99. package/src/modules/repos/actions/repo-open.ts +11 -6
  100. package/src/modules/repos/actions/repo-ref-add.ts +15 -6
  101. package/src/modules/repos/actions/repo-ref-backfill.ts +12 -6
  102. package/src/modules/repos/actions/repo-ref-check.ts +11 -6
  103. package/src/modules/repos/actions/repo-ref-clone.ts +18 -6
  104. package/src/modules/repos/actions/repo-ref-note.ts +14 -6
  105. package/src/modules/repos/actions/repo-ref-of.ts +11 -6
  106. package/src/modules/repos/actions/repo-ref-sync.ts +12 -6
  107. package/src/modules/repos/actions/repo-remote-check.ts +12 -6
  108. package/src/modules/repos/actions/repo-remote-list.ts +11 -6
  109. package/src/modules/repos/actions/repo-remote-pick.ts +12 -6
  110. package/src/modules/repos/actions/repo-remote.ts +13 -6
  111. package/src/modules/repos/actions/repo-remove.ts +11 -6
  112. package/src/modules/repos/actions/repo-scan.ts +13 -6
  113. package/src/modules/repos/actions/repo-update.ts +23 -6
  114. package/src/modules/setting/actions/setting-get.ts +11 -6
  115. package/src/modules/setting/actions/setting-set.ts +14 -6
  116. package/src/modules/system/actions/bootstrap.ts +9 -7
  117. package/src/modules/system/actions/health.ts +8 -6
  118. package/src/modules/system/actions/routes.ts +13 -6
  119. package/src/modules/system/routes.ts +1 -1
  120. package/src/modules/tasktool/actions/timegoal-check.ts +13 -6
  121. package/src/modules/tasktool/actions/timegoal-clear.ts +11 -6
  122. package/src/modules/tasktool/actions/timegoal-list.ts +11 -6
  123. package/src/modules/tasktool/actions/timegoal-log.ts +11 -6
  124. package/src/modules/tasktool/actions/timegoal-prune.ts +11 -6
  125. package/src/modules/tasktool/actions/timegoal-set.ts +13 -6
  126. package/src/modules/tasktool/actions/timegoal-show.ts +12 -6
  127. package/src/modules/tasktool/actions/timegoal-update.ts +13 -6
  128. package/src/modules/templates/actions/templates-add.ts +19 -6
  129. package/src/modules/templates/actions/templates-default.ts +15 -6
  130. package/src/modules/templates/actions/templates-list.ts +13 -6
  131. package/src/modules/templates/actions/templates-remove.ts +11 -6
  132. package/src/modules/templates/actions/templates-update.ts +17 -6
  133. package/src/modules/todo/actions/group-add.ts +12 -6
  134. package/src/modules/todo/actions/group-current.ts +11 -6
  135. package/src/modules/todo/actions/group-get.ts +11 -6
  136. package/src/modules/todo/actions/group-list.ts +11 -6
  137. package/src/modules/todo/actions/group-members.ts +11 -6
  138. package/src/modules/todo/actions/group-remove.ts +11 -6
  139. package/src/modules/todo/actions/group-update.ts +13 -6
  140. package/src/modules/todo/actions/group-use.ts +11 -6
  141. package/src/modules/todo/actions/prompt-get.ts +12 -6
  142. package/src/modules/todo/actions/prompt-remove.ts +12 -6
  143. package/src/modules/todo/actions/prompt-set.ts +13 -6
  144. package/src/modules/todo/actions/todo-add.ts +13 -6
  145. package/src/modules/todo/actions/todo-archive.ts +12 -6
  146. package/src/modules/todo/actions/todo-attach.ts +19 -6
  147. package/src/modules/todo/actions/todo-attachments.ts +14 -6
  148. package/src/modules/todo/actions/todo-done.ts +15 -6
  149. package/src/modules/todo/actions/todo-freeze.ts +14 -6
  150. package/src/modules/todo/actions/todo-get.ts +14 -6
  151. package/src/modules/todo/actions/todo-list.ts +13 -6
  152. package/src/modules/todo/actions/todo-remove.ts +14 -6
  153. package/src/modules/todo/actions/todo-unfreeze.ts +14 -6
  154. package/src/modules/todo/actions/todo-update.ts +17 -6
  155. package/src/modules/todo/actions/topic-add.ts +12 -6
  156. package/src/modules/todo/actions/topic-list.ts +11 -6
  157. package/src/modules/todo/actions/topic-remove.ts +12 -6
  158. package/src/runtime/action-base.ts +41 -1
  159. package/src/runtime/action-decorator.ts +28 -13
  160. package/src/runtime/codegen.ts +26 -41
  161. package/src/runtime/registry.ts +2 -2
  162. package/src/web/frontend/api/client.generated.ts +550 -698
  163. package/src/web/frontend/page/cloud/api.ts +99 -0
  164. package/src/web/frontend/page/cloud/index.tsx +13 -32
  165. package/src/web/frontend/page/dag/api.ts +20 -0
  166. package/src/web/frontend/page/dag/index.tsx +2 -5
  167. package/src/web/frontend/page/dir/api.ts +135 -0
  168. package/src/web/frontend/page/dir/index.tsx +37 -57
  169. package/src/web/frontend/page/dir/task-actions.ts +39 -59
  170. package/src/web/frontend/page/dir/task-chain.ts +2 -2
  171. package/src/web/frontend/page/dir/task-feedback.ts +19 -23
  172. package/src/web/frontend/page/dir/task-goal.ts +3 -3
  173. package/src/web/frontend/page/dir/task.tsx +3 -3
  174. package/src/web/frontend/page/doc/api.ts +82 -0
  175. package/src/web/frontend/page/doc/index.tsx +29 -32
  176. package/src/web/frontend/page/group/api.ts +24 -0
  177. package/src/web/frontend/page/group/index.tsx +7 -16
  178. package/src/web/frontend/page/overview/api.ts +16 -0
  179. package/src/web/frontend/page/overview/index.tsx +2 -2
  180. package/src/web/frontend/page/progress/api.ts +20 -0
  181. package/src/web/frontend/page/progress/index.tsx +3 -6
  182. package/src/web/frontend/page/refs/api.ts +14 -0
  183. package/src/web/frontend/page/refs/index.tsx +2 -4
  184. package/src/web/frontend/page/repos/api.ts +197 -0
  185. package/src/web/frontend/page/repos/bind-modals.tsx +4 -7
  186. package/src/web/frontend/page/repos/board-admin.tsx +6 -6
  187. package/src/web/frontend/page/repos/doc-search-modal.tsx +4 -4
  188. package/src/web/frontend/page/repos/index.tsx +10 -14
  189. package/src/web/frontend/page/repos/pending-section.tsx +7 -13
  190. package/src/web/frontend/page/repos/ref-panel.tsx +9 -14
  191. package/src/web/frontend/page/repos/remote-modal.tsx +4 -28
  192. package/src/web/frontend/page/repos/repo-form-modal.tsx +4 -4
  193. package/src/web/frontend/page/settings/api.ts +29 -0
  194. package/src/web/frontend/page/settings/index.tsx +3 -3
  195. package/src/web/frontend/page/settings/prompt-templates-section.tsx +4 -4
  196. package/src/web/frontend/page/settings/sidebar-section.tsx +2 -2
  197. package/src/web/public/assets/Introduction-Du_dycft.js +6 -0
  198. package/src/web/public/assets/{bar-B9WWmCpt.js → bar-B52NTf_v.js} +1 -1
  199. package/src/web/public/assets/cloud-Droja_aT.js +3 -0
  200. package/src/web/public/assets/{composer-panel-ByezS8Xv.js → composer-panel-DpiU2h50.js} +1 -1
  201. package/src/web/public/assets/dag-Ca-wjIxQ.js +1 -0
  202. package/src/web/public/assets/{deleted-panel-BcbtctNF.js → deleted-panel-K9GgfR8t.js} +1 -1
  203. package/src/web/public/assets/dir-DacRpcBt.js +5 -0
  204. package/src/web/public/assets/group-TPuU-QVc.js +2 -0
  205. package/src/web/public/assets/{index-D8MvtVAm.js → index-BkLkooKe.js} +2 -2
  206. package/src/web/public/assets/{md-history-BqZvzWiD.js → md-history-0GBWw4qr.js} +1 -1
  207. package/src/web/public/assets/overview-B3kHI66i.js +1 -0
  208. package/src/web/public/assets/progress-CdhFz0Lz.js +3 -0
  209. package/src/web/public/assets/refs-BDxfuH6R.js +1 -0
  210. package/src/web/public/assets/repos-C8jRM7wS.js +15 -0
  211. package/src/web/public/assets/{route-crumb-CWVu80du.js → route-crumb-QvahotvN.js} +1 -1
  212. package/src/web/public/assets/settings-BBcdGLTc.js +1 -0
  213. package/src/web/public/assets/{status-tag-DRl9E2Os.js → status-tag-BheHByek.js} +1 -1
  214. package/src/web/public/assets/task-CUkQaLBZ.js +11 -0
  215. package/src/web/public/assets/task-utils-_JAWRAz6.js +12 -0
  216. package/src/web/public/assets/{templates-Df__0k-F.js → templates-CbRyW3PJ.js} +1 -1
  217. package/src/web/public/assets/{tool-bar-Cv7f6p4v.js → tool-bar-BAmT-BI-.js} +1 -1
  218. package/src/web/public/index.html +1 -1
  219. package/src/modules/auth/schemas.ts +0 -27
  220. package/src/modules/bundled/schemas.ts +0 -32
  221. package/src/modules/db/schemas.ts +0 -27
  222. package/src/modules/docs/schemas.ts +0 -107
  223. package/src/modules/file/schemas.ts +0 -61
  224. package/src/modules/localtask/schemas.ts +0 -310
  225. package/src/modules/repos/schemas.ts +0 -310
  226. package/src/modules/setting/schemas.ts +0 -18
  227. package/src/modules/system/schemas.ts +0 -29
  228. package/src/modules/tasktool/schemas.ts +0 -52
  229. package/src/modules/templates/schemas.ts +0 -50
  230. package/src/modules/todo/schemas.ts +0 -177
  231. package/src/web/public/assets/Introduction-aQCeCLrV.js +0 -6
  232. package/src/web/public/assets/cloud-C4b8SU7C.js +0 -3
  233. package/src/web/public/assets/dag-jvrjx4i7.js +0 -1
  234. package/src/web/public/assets/dir-B82XBb1J.js +0 -5
  235. package/src/web/public/assets/group-BPUOO_QM.js +0 -2
  236. package/src/web/public/assets/overview-DMihuyzh.js +0 -1
  237. package/src/web/public/assets/progress-D-rMgz3w.js +0 -3
  238. package/src/web/public/assets/refs-D21jmrn6.js +0 -1
  239. package/src/web/public/assets/repos-B94tMDGs.js +0 -15
  240. package/src/web/public/assets/settings-DgTt4JG5.js +0 -1
  241. package/src/web/public/assets/task-B2x5GoV3.js +0 -11
  242. package/src/web/public/assets/task-utils-By8gLpHY.js +0 -12
@@ -1,25 +1,30 @@
1
1
  // repo.get —— 由 .tool/migrate-module.mjs 从 legacy 形态迁来(模板形态:一条 action 一个文件)。
2
2
  //
3
- // 契约常量在 ../schemas.ts(zod);本文件只做「声明 + 实现」,业务在服务层。
3
+ // 契约(zod schema)就声明在本文件里——入参类型由基类泛型模板封装;本文件只做「声明 + 实现」,业务在服务层。
4
4
  import { action } from '../../../runtime/action-decorator.js';
5
- import { ActionBase } from '../../../runtime/action-base.js';
6
- import { repoGetInput } from '../schemas.js';
5
+ import { z } from 'zod';
6
+ import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
7
7
  import * as serviceNs from '../service.js';
8
8
  import { renderRepo as _renderRepo } from '../cli/render.js';
9
9
  const service: any = serviceNs;
10
10
  const renderRepo: any = _renderRepo;
11
11
 
12
- export class RepoGetAction extends ActionBase {
12
+ /** repo.get 的入参契约(CLI 与 HTTP 共用同一份)。 */
13
+ const input = z.object({
14
+ id: z.string(),
15
+ });
16
+
17
+ export class RepoGetAction extends ActionBase<typeof input> {
13
18
  @action({
14
19
  id: 'repo.get',
15
20
  cli: ['repo', 'get'],
16
21
  http: ['GET', '/api/repos/:id'],
17
22
  summary: '查看单个仓库的登记信息',
18
23
  args: ['id'],
19
- input: repoGetInput,
24
+ input,
20
25
  render: renderRepo,
21
26
  })
22
- async get(ctx: any) {
27
+ override async run(ctx: ActionInput<this['_input']>) {
23
28
 
24
29
  return service.getRepo(ctx.id);
25
30
 
@@ -1,25 +1,31 @@
1
1
  // repo.import.diff —— 由 .tool/migrate-module.mjs 从 legacy 形态迁来(模板形态:一条 action 一个文件)。
2
2
  //
3
- // 契约常量在 ../schemas.ts(zod);本文件只做「声明 + 实现」,业务在服务层。
3
+ // 契约(zod schema)就声明在本文件里——入参类型由基类泛型模板封装;本文件只做「声明 + 实现」,业务在服务层。
4
4
  import { action } from '../../../runtime/action-decorator.js';
5
- import { ActionBase } from '../../../runtime/action-base.js';
6
- import { repoImportDiffInput } from '../schemas.js';
5
+ import { z } from 'zod';
6
+ import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
7
7
  import * as transferNs from '../transfer.js';
8
8
  import { readLayout as _readLayout } from '../cli/render.js';
9
9
  const transfer: any = transferNs;
10
10
  const readLayout: any = _readLayout;
11
11
 
12
- export class RepoImportDiffAction extends ActionBase {
12
+ /** repo.import.diff 的入参契约(CLI 与 HTTP 共用同一份)。 */
13
+ const input = z.object({
14
+ file: z.string().optional(),
15
+ json: z.string().optional().describe("(面板)直接给布局 JSON"),
16
+ });
17
+
18
+ export class RepoImportDiffAction extends ActionBase<typeof input> {
13
19
  @action({
14
20
  id: 'repo.import.diff',
15
21
  cli: ['repo', 'import', '--diff'],
16
22
  http: ['POST', '/api/repos/import/diff'],
17
23
  summary: '导入前的差异检查:逐条给出 新增/有差异/一致/本地未拥有(零副作用)',
18
24
  args: ['file'],
19
- input: repoImportDiffInput,
25
+ input,
20
26
  render: (d: any) => transfer.renderDiff(d),
21
27
  })
22
- async diff(ctx: any) {
28
+ override async run(ctx: ActionInput<this['_input']>) {
23
29
 
24
30
  const { json, docsFiles } = await readLayout(ctx);
25
31
  return transfer.diffImport(json, docsFiles);
@@ -1,25 +1,35 @@
1
1
  // repo.import —— 由 .tool/migrate-module.mjs 从 legacy 形态迁来(模板形态:一条 action 一个文件)。
2
2
  //
3
- // 契约常量在 ../schemas.ts(zod);本文件只做「声明 + 实现」,业务在服务层。
3
+ // 契约(zod schema)就声明在本文件里——入参类型由基类泛型模板封装;本文件只做「声明 + 实现」,业务在服务层。
4
4
  import { action } from '../../../runtime/action-decorator.js';
5
- import { ActionBase } from '../../../runtime/action-base.js';
6
- import { repoImportInput } from '../schemas.js';
5
+ import { z } from 'zod';
6
+ import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
7
7
  import * as transferNs from '../transfer.js';
8
8
  import { readLayout as _readLayout } from '../cli/render.js';
9
9
  const transfer: any = transferNs;
10
10
  const readLayout: any = _readLayout;
11
11
 
12
- export class RepoImportAction extends ActionBase {
12
+ /** repo.import 的入参契约(CLI 与 HTTP 共用同一份)。 */
13
+ const input = z.object({
14
+ file: z.string().optional(),
15
+ json: z.string().optional().describe("(面板)直接给布局 JSON"),
16
+ strategy: z.enum(["ours", "overwrite", "duplicate"]).default('ours').describe("冲突方案:保留本地 / 覆盖 / 另存 key-import-N"),
17
+ select: z.array(z.string()).optional().describe("只处理这些仓库 key(逗号分隔;空 = 全部)"),
18
+ boards: z.array(z.string()).optional().describe("只处理这些看板 key(逗号分隔;空 = 全部)"),
19
+ clone: z.enum(["all", "dev", "ref", "none"]).optional().describe("要克隆哪些(默认 none = 只登记)"),
20
+ });
21
+
22
+ export class RepoImportAction extends ActionBase<typeof input> {
13
23
  @action({
14
24
  id: 'repo.import',
15
25
  cli: ['repo', 'import'],
16
26
  http: ['POST', '/api/repos/import'],
17
27
  summary: '导入仓库布局(--strategy ours|overwrite|duplicate;--select 按 key 挑;--clone 选克隆范围)',
18
28
  args: ['file'],
19
- input: repoImportInput,
29
+ input,
20
30
  render: (d: any) => transfer.renderResult(d),
21
31
  })
22
- async import(ctx: any) {
32
+ override async run(ctx: ActionInput<this['_input']>) {
23
33
 
24
34
  const { json, docsFiles } = await readLayout(ctx);
25
35
  return transfer.repoImport({
@@ -1,22 +1,27 @@
1
1
  // repo.key.migrate —— 由 .tool/migrate-module.mjs 从 legacy 形态迁来(模板形态:一条 action 一个文件)。
2
2
  //
3
- // 契约常量在 ../schemas.ts(zod);本文件只做「声明 + 实现」,业务在服务层。
3
+ // 契约(zod schema)就声明在本文件里——入参类型由基类泛型模板封装;本文件只做「声明 + 实现」,业务在服务层。
4
4
  import { action } from '../../../runtime/action-decorator.js';
5
- import { ActionBase } from '../../../runtime/action-base.js';
6
- import { repoKeyMigrateInput } from '../schemas.js';
5
+ import { z } from 'zod';
6
+ import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
7
7
  import * as keysNs from '../keys.js';
8
8
  const keys: any = keysNs;
9
9
 
10
- export class RepoKeyMigrateAction extends ActionBase {
10
+ /** repo.key.migrate 的入参契约(CLI 与 HTTP 共用同一份)。 */
11
+ const input = z.object({
12
+ apply: z.boolean().optional().describe("写回磁盘(缺省只预览)"),
13
+ });
14
+
15
+ export class RepoKeyMigrateAction extends ActionBase<typeof input> {
11
16
  @action({
12
17
  id: 'repo.key.migrate',
13
18
  cli: ['repo', 'key', 'migrate'],
14
19
  http: ['POST', '/api/repos/key/migrate'],
15
20
  summary: '把内部关系(看板成员/绑定)从随机 id 改写成 key(幂等;--apply 落盘)',
16
- input: repoKeyMigrateInput,
21
+ input,
17
22
  render: (d: any) => keys.renderMigrate(d),
18
23
  })
19
- async migrate(ctx: any) {
24
+ override async run(ctx: ActionInput<this['_input']>) {
20
25
 
21
26
  return keys.migrateRelations({ apply: ctx.apply === true });
22
27
 
@@ -1,23 +1,30 @@
1
1
  // repo.key.refresh —— 由 .tool/migrate-module.mjs 从 legacy 形态迁来(模板形态:一条 action 一个文件)。
2
2
  //
3
- // 契约常量在 ../schemas.ts(zod);本文件只做「声明 + 实现」,业务在服务层。
3
+ // 契约(zod schema)就声明在本文件里——入参类型由基类泛型模板封装;本文件只做「声明 + 实现」,业务在服务层。
4
4
  import { action } from '../../../runtime/action-decorator.js';
5
- import { ActionBase } from '../../../runtime/action-base.js';
6
- import { repoKeyRefreshInput } from '../schemas.js';
5
+ import { z } from 'zod';
6
+ import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
7
7
  import * as keysNs from '../keys.js';
8
8
  const keys: any = keysNs;
9
9
 
10
- export class RepoKeyRefreshAction extends ActionBase {
10
+ /** repo.key.refresh 的入参契约(CLI 与 HTTP 共用同一份)。 */
11
+ const input = z.object({
12
+ id: z.string().optional(),
13
+ all: z.boolean().optional().describe("刷新全部仓库"),
14
+ apply: z.boolean().optional().describe("把建议写回(自定义 key 只更新 remote,不覆盖 key)"),
15
+ });
16
+
17
+ export class RepoKeyRefreshAction extends ActionBase<typeof input> {
11
18
  @action({
12
19
  id: 'repo.key.refresh',
13
20
  cli: ['repo', 'key', 'refresh'],
14
21
  http: ['POST', '/api/repos/key/refresh'],
15
22
  summary: '刷新仓库 key:扫描 git remote(SSH 优先),提示可更新的 key/远程地址;--apply 落盘',
16
23
  args: ['id'],
17
- input: repoKeyRefreshInput,
24
+ input,
18
25
  render: (d: any) => keys.renderRefresh(d),
19
26
  })
20
- async refresh(ctx: any) {
27
+ override async run(ctx: ActionInput<this['_input']>) {
21
28
 
22
29
  return keys.refreshKeys({ id: ctx.id, all: ctx.all === true, apply: ctx.apply === true });
23
30
 
@@ -1,25 +1,32 @@
1
1
  // repo.key.set —— 由 .tool/migrate-module.mjs 从 legacy 形态迁来(模板形态:一条 action 一个文件)。
2
2
  //
3
- // 契约常量在 ../schemas.ts(zod);本文件只做「声明 + 实现」,业务在服务层。
3
+ // 契约(zod schema)就声明在本文件里——入参类型由基类泛型模板封装;本文件只做「声明 + 实现」,业务在服务层。
4
4
  import { action } from '../../../runtime/action-decorator.js';
5
- import { ActionBase } from '../../../runtime/action-base.js';
6
- import { repoKeySetInput } from '../schemas.js';
5
+ import { z } from 'zod';
6
+ import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
7
7
  import * as serviceNs from '../service.js';
8
8
  import { badInput as _badInput } from '../../../core/errors.js';
9
9
  const service: any = serviceNs;
10
10
  const badInput: any = _badInput;
11
11
 
12
- export class RepoKeySetAction extends ActionBase {
12
+ /** repo.key.set 的入参契约(CLI 与 HTTP 共用同一份)。 */
13
+ const input = z.object({
14
+ id: z.string(),
15
+ key: z.string().optional(),
16
+ follow: z.boolean().optional().describe("取消自定义:key 重新跟随远程地址派生"),
17
+ });
18
+
19
+ export class RepoKeySetAction extends ActionBase<typeof input> {
13
20
  @action({
14
21
  id: 'repo.key.set',
15
22
  cli: ['repo', 'key', 'set'],
16
23
  http: ['POST', '/api/repos/key'],
17
24
  summary: '设置自定义 key(全局唯一,不跟随远程地址自动变);--follow 恢复为跟随 remote',
18
25
  args: ['id', 'key'],
19
- input: repoKeySetInput,
26
+ input,
20
27
  render: (r: any) => `已设 key: ${r.name} -> ${r.key}${r.keyCustom ? '(自定义)' : '(跟随远程地址)'}`,
21
28
  })
22
- async set(ctx: any) {
29
+ override async run(ctx: ActionInput<this['_input']>) {
23
30
 
24
31
  if (ctx.follow) {
25
32
  await service.updateRepo(ctx.id, { keyCustom: false, key: '' });
@@ -1,20 +1,26 @@
1
1
  // repo.knowledge —— 由 .tool/migrate-module.mjs 从 legacy 形态迁来(模板形态:一条 action 一个文件)。
2
2
  //
3
- // 契约常量在 ../schemas.ts(zod);本文件只做「声明 + 实现」,业务在服务层。
3
+ // 契约(zod schema)就声明在本文件里——入参类型由基类泛型模板封装;本文件只做「声明 + 实现」,业务在服务层。
4
4
  import { action } from '../../../runtime/action-decorator.js';
5
- import { ActionBase } from '../../../runtime/action-base.js';
6
- import { repoKnowledgeInput } from '../schemas.js';
5
+ import { z } from 'zod';
6
+ import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
7
7
  import { repoKnowledge as _repoKnowledge } from '../../docs/knowledge.js';
8
8
  const repoKnowledge: any = _repoKnowledge;
9
9
 
10
- export class RepoKnowledgeAction extends ActionBase {
10
+ /** repo.knowledge 的入参契约(CLI 与 HTTP 共用同一份)。 */
11
+ const input = z.object({
12
+ id: z.string().optional(),
13
+ md: z.boolean().optional().describe("输出拼装好的单篇 markdown(字段名 md),get 封装直接可用"),
14
+ });
15
+
16
+ export class RepoKnowledgeAction extends ActionBase<typeof input> {
11
17
  @action({
12
18
  id: 'repo.knowledge',
13
19
  cli: ['repo', 'knowledge'],
14
20
  http: ['GET', '/api/repos/knowledge'],
15
21
  summary: '取仓库完整知识:项目介绍 + 所属组(介绍/组内描述/绑定文档)+ 参考仓库(--md 拼成单篇 markdown;缺省当前目录)',
16
22
  args: ['id'],
17
- input: repoKnowledgeInput,
23
+ input,
18
24
  render: (d: any) => {
19
25
  if (d.md) return d.md;
20
26
  const lines: any = [`【${d.repo.name}】${d.repo.key}${d.repo.desc ? ` —— ${d.repo.desc}` : ''}`];
@@ -35,7 +41,7 @@ export class RepoKnowledgeAction extends ActionBase {
35
41
  return lines.join('\n');
36
42
  },
37
43
  })
38
- async knowledge(ctx: any) {
44
+ override async run(ctx: ActionInput<this['_input']>) {
39
45
 
40
46
  return repoKnowledge(ctx.id || process.cwd(), { md: ctx.md === true });
41
47
 
@@ -1,24 +1,29 @@
1
1
  // repo.list —— 由 .tool/migrate-module.mjs 从 legacy 形态迁来(模板形态:一条 action 一个文件)。
2
2
  //
3
- // 契约常量在 ../schemas.ts(zod);本文件只做「声明 + 实现」,业务在服务层。
3
+ // 契约(zod schema)就声明在本文件里——入参类型由基类泛型模板封装;本文件只做「声明 + 实现」,业务在服务层。
4
4
  import { action } from '../../../runtime/action-decorator.js';
5
- import { ActionBase } from '../../../runtime/action-base.js';
6
- import { repoListInput } from '../schemas.js';
5
+ import { z } from 'zod';
6
+ import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
7
7
  import * as serviceNs from '../service.js';
8
8
  import { renderRepoList as _renderRepoList } from '../cli/render.js';
9
9
  const service: any = serviceNs;
10
10
  const renderRepoList: any = _renderRepoList;
11
11
 
12
- export class RepoListAction extends ActionBase {
12
+ /** repo.list 的入参契约(CLI 与 HTTP 共用同一份)。 */
13
+ const input = z.object({
14
+ type: z.enum(["dev", "ref"]).optional().describe("只看某类:dev=开发仓库,ref=参考仓库"),
15
+ });
16
+
17
+ export class RepoListAction extends ActionBase<typeof input> {
13
18
  @action({
14
19
  id: 'repo.list',
15
20
  cli: ['repo', 'list'],
16
21
  http: ['GET', '/api/repos'],
17
22
  summary: '仓库清单(本地任务的主题会按路径匹配到这里,取它的上下文)',
18
- input: repoListInput,
23
+ input,
19
24
  render: renderRepoList,
20
25
  })
21
- async list(ctx: any) {
26
+ override async run(ctx: ActionInput<this['_input']>) {
22
27
 
23
28
  return service.listRepos().then((list: any) => (ctx.type ? list.filter((r: any) => (r.type || 'dev') === ctx.type) : list));
24
29
 
@@ -1,23 +1,28 @@
1
1
  // repo.open —— 由 .tool/migrate-module.mjs 从 legacy 形态迁来(模板形态:一条 action 一个文件)。
2
2
  //
3
- // 契约常量在 ../schemas.ts(zod);本文件只做「声明 + 实现」,业务在服务层。
3
+ // 契约(zod schema)就声明在本文件里——入参类型由基类泛型模板封装;本文件只做「声明 + 实现」,业务在服务层。
4
4
  import { action } from '../../../runtime/action-decorator.js';
5
- import { ActionBase } from '../../../runtime/action-base.js';
6
- import { repoOpenInput } from '../schemas.js';
5
+ import { z } from 'zod';
6
+ 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
- export class RepoOpenAction extends ActionBase {
10
+ /** repo.open 的入参契约(CLI 与 HTTP 共用同一份)。 */
11
+ const input = z.object({
12
+ id: z.string(),
13
+ });
14
+
15
+ export class RepoOpenAction extends ActionBase<typeof input> {
11
16
  @action({
12
17
  id: 'repo.open',
13
18
  cli: ['repo', 'open'],
14
19
  http: ['POST', '/api/repos/open'],
15
20
  summary: '在系统文件管理器中打开',
16
21
  args: ['id'],
17
- input: repoOpenInput,
22
+ input,
18
23
  render: (d: any) => `已打开: ${d.opened}`,
19
24
  })
20
- async open(ctx: any) {
25
+ override async run(ctx: ActionInput<this['_input']>) {
21
26
 
22
27
  return service.repoOpen(ctx.id);
23
28
 
@@ -1,23 +1,32 @@
1
1
  // repo.ref.add —— 由 .tool/migrate-module.mjs 从 legacy 形态迁来(模板形态:一条 action 一个文件)。
2
2
  //
3
- // 契约常量在 ../schemas.ts(zod);本文件只做「声明 + 实现」,业务在服务层。
3
+ // 契约(zod schema)就声明在本文件里——入参类型由基类泛型模板封装;本文件只做「声明 + 实现」,业务在服务层。
4
4
  import { action } from '../../../runtime/action-decorator.js';
5
- import { ActionBase } from '../../../runtime/action-base.js';
6
- import { repoRefAddInput } from '../schemas.js';
5
+ import { z } from 'zod';
6
+ import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
7
7
  import * as refNs from '../ref.js';
8
8
  const ref: any = refNs;
9
9
 
10
- export class RepoRefAddAction extends ActionBase {
10
+ /** repo.ref.add 的入参契约(CLI 与 HTTP 共用同一份)。 */
11
+ const input = z.object({
12
+ path: z.string(),
13
+ remote: z.string().optional().describe("远程地址(目录没有 origin 时必给)"),
14
+ name: z.string().optional(),
15
+ desc: z.string().optional(),
16
+ notes: z.string().optional(),
17
+ });
18
+
19
+ export class RepoRefAddAction extends ActionBase<typeof input> {
11
20
  @action({
12
21
  id: 'repo.ref.add',
13
22
  cli: ['repo', 'ref', 'add'],
14
23
  http: ['POST', '/api/repos/ref/add'],
15
24
  summary: '把一个已存在的 checkout 登记为参考仓库(不 clone;remote 缺省读 origin)',
16
25
  args: ['path'],
17
- input: repoRefAddInput,
26
+ input,
18
27
  render: (r: any) => `已登记参考仓库: ${r.name} -> ${r.path}`,
19
28
  })
20
- async add(ctx: any) {
29
+ override async run(ctx: ActionInput<this['_input']>) {
21
30
 
22
31
  return ref.registerRef(ctx);
23
32
 
@@ -1,25 +1,31 @@
1
1
  // repo.ref.backfill —— 由 .tool/migrate-module.mjs 从 legacy 形态迁来(模板形态:一条 action 一个文件)。
2
2
  //
3
- // 契约常量在 ../schemas.ts(zod);本文件只做「声明 + 实现」,业务在服务层。
3
+ // 契约(zod schema)就声明在本文件里——入参类型由基类泛型模板封装;本文件只做「声明 + 实现」,业务在服务层。
4
4
  import { action } from '../../../runtime/action-decorator.js';
5
- import { ActionBase } from '../../../runtime/action-base.js';
6
- import { repoRefBackfillInput } from '../schemas.js';
5
+ import { z } from 'zod';
6
+ import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
7
7
  import * as refBackfillNs from '../ref-backfill.js';
8
8
  import { renderBackfill as _renderBackfill } from '../cli/render.js';
9
9
  const refBackfill: any = refBackfillNs;
10
10
  const renderBackfill: any = _renderBackfill;
11
11
 
12
- export class RepoRefBackfillAction extends ActionBase {
12
+ /** repo.ref.backfill 的入参契约(CLI 与 HTTP 共用同一份)。 */
13
+ const input = z.object({
14
+ from: z.string(),
15
+ 'dry-run': z.boolean().optional().describe("只算差异,不落盘"),
16
+ });
17
+
18
+ export class RepoRefBackfillAction extends ActionBase<typeof input> {
13
19
  @action({
14
20
  id: 'repo.ref.backfill',
15
21
  cli: ['repo', 'ref', 'backfill'],
16
22
  http: null,
17
23
  summary: '从 v3 快照补录仓库级参考绑定(幂等、可重复;与组级绑定并存;--dry-run 只预览)',
18
24
  args: ['from'],
19
- input: repoRefBackfillInput,
25
+ input,
20
26
  render: renderBackfill,
21
27
  })
22
- async backfill(ctx: any) {
28
+ override async run(ctx: ActionInput<this['_input']>) {
23
29
 
24
30
  return refBackfill.backfillRepoLinks({ from: ctx.from, dryRun: ctx['dry-run'] === true });
25
31
 
@@ -1,24 +1,29 @@
1
1
  // repo.ref.check —— 由 .tool/migrate-module.mjs 从 legacy 形态迁来(模板形态:一条 action 一个文件)。
2
2
  //
3
- // 契约常量在 ../schemas.ts(zod);本文件只做「声明 + 实现」,业务在服务层。
3
+ // 契约(zod schema)就声明在本文件里——入参类型由基类泛型模板封装;本文件只做「声明 + 实现」,业务在服务层。
4
4
  import { action } from '../../../runtime/action-decorator.js';
5
- import { ActionBase } from '../../../runtime/action-base.js';
6
- import { repoRefCheckInput } from '../schemas.js';
5
+ import { z } from 'zod';
6
+ import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
7
7
  import * as refNs from '../ref.js';
8
8
  import { renderRefCheck as _renderRefCheck } from '../cli/render.js';
9
9
  const ref: any = refNs;
10
10
  const renderRefCheck: any = _renderRefCheck;
11
11
 
12
- export class RepoRefCheckAction extends ActionBase {
12
+ /** repo.ref.check 的入参契约(CLI 与 HTTP 共用同一份)。 */
13
+ const input = z.object({
14
+
15
+ });
16
+
17
+ export class RepoRefCheckAction extends ActionBase<typeof input> {
13
18
  @action({
14
19
  id: 'repo.ref.check',
15
20
  cli: ['repo', 'ref', 'check'],
16
21
  http: ['GET', '/api/repos/ref/check'],
17
22
  summary: '检查参考仓库完整性:目录/.git/origin 一致性 + 组级/仓库级绑定死链(零副作用)',
18
- input: repoRefCheckInput,
23
+ input,
19
24
  render: renderRefCheck,
20
25
  })
21
- async check(_ctx: any) {
26
+ override async run(_ctx: ActionInput<this['_input']>) {
22
27
 
23
28
  return ref.checkRefs();
24
29
 
@@ -1,25 +1,37 @@
1
1
  // repo.ref.clone —— 由 .tool/migrate-module.mjs 从 legacy 形态迁来(模板形态:一条 action 一个文件)。
2
2
  //
3
- // 契约常量在 ../schemas.ts(zod);本文件只做「声明 + 实现」,业务在服务层。
3
+ // 契约(zod schema)就声明在本文件里——入参类型由基类泛型模板封装;本文件只做「声明 + 实现」,业务在服务层。
4
4
  import { action } from '../../../runtime/action-decorator.js';
5
- import { ActionBase } from '../../../runtime/action-base.js';
6
- import { repoRefCloneInput } from '../schemas.js';
5
+ import { z } from 'zod';
6
+ import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
7
7
  import * as refNs from '../ref.js';
8
8
  import { renderClone as _renderClone } from '../cli/render.js';
9
9
  const ref: any = refNs;
10
10
  const renderClone: any = _renderClone;
11
11
 
12
- export class RepoRefCloneAction extends ActionBase {
12
+ /** repo.ref.clone 的入参契约(CLI 与 HTTP 共用同一份)。 */
13
+ const input = z.object({
14
+ url: z.string(),
15
+ name: z.string().optional().describe("名称(缺省取 URL 末段)"),
16
+ desc: z.string().optional().describe("一句话描述(它参考什么)"),
17
+ notes: z.string().optional(),
18
+ board: z.array(z.string()).optional().describe("顺手挂到看板(id 可多个,逗号分隔)"),
19
+ bind: z.array(z.string()).optional().describe("绑定的开发仓库(id/路径/名称,可多个,逗号分隔)"),
20
+ depth: z.number().default(1).describe("浅克隆深度(默认 1)"),
21
+ 'no-bind': z.boolean().optional().describe("关闭自动绑定(默认绑当前目录命中的开发仓库)"),
22
+ });
23
+
24
+ export class RepoRefCloneAction extends ActionBase<typeof input> {
13
25
  @action({
14
26
  id: 'repo.ref.clone',
15
27
  cli: ['repo', 'ref', 'clone'],
16
28
  http: ['POST', '/api/repos/ref/clone'],
17
29
  summary: '克隆远程仓库为参考仓库(落到 gitRepoRoot,登记 + 可选绑定当前目录的开发仓库)',
18
30
  args: ['url'],
19
- input: repoRefCloneInput,
31
+ input,
20
32
  render: renderClone,
21
33
  })
22
- async clone(ctx: any) {
34
+ override async run(ctx: ActionInput<this['_input']>) {
23
35
 
24
36
  return ref.cloneRef({
25
37
  url: ctx.url,
@@ -1,23 +1,31 @@
1
1
  // repo.ref.note —— 由 .tool/migrate-module.mjs 从 legacy 形态迁来(模板形态:一条 action 一个文件)。
2
2
  //
3
- // 契约常量在 ../schemas.ts(zod);本文件只做「声明 + 实现」,业务在服务层。
3
+ // 契约(zod schema)就声明在本文件里——入参类型由基类泛型模板封装;本文件只做「声明 + 实现」,业务在服务层。
4
4
  import { action } from '../../../runtime/action-decorator.js';
5
- import { ActionBase } from '../../../runtime/action-base.js';
6
- import { repoRefNoteInput } from '../schemas.js';
5
+ import { z } from 'zod';
6
+ import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
7
7
  import * as refNs from '../ref.js';
8
8
  const ref: any = refNs;
9
9
 
10
- export class RepoRefNoteAction extends ActionBase {
10
+ /** repo.ref.note 的入参契约(CLI 与 HTTP 共用同一份)。 */
11
+ const input = z.object({
12
+ id: z.string(),
13
+ repo: z.string().optional().describe("开发仓库(id/路径/名称)—— 写仓库级绑定的描述"),
14
+ board: z.string().optional().describe("组 id/key/名称(与 --repo 二选一)—— 写组级绑定的描述"),
15
+ note: z.string().optional().describe("绑定描述(多行可含关键路径/关键词;留空 = 清除)"),
16
+ });
17
+
18
+ export class RepoRefNoteAction extends ActionBase<typeof input> {
11
19
  @action({
12
20
  id: 'repo.ref.note',
13
21
  cli: ['repo', 'ref', 'note'],
14
22
  http: ['POST', '/api/repos/ref/note'],
15
23
  summary: '写/清绑定描述:这个参考在该组/该仓库里参考什么(--note 留空 = 清除)',
16
24
  args: ['id'],
17
- input: repoRefNoteInput,
25
+ input,
18
26
  render: (d: any) => `${d.note ? '已写' : '已清除'}绑定描述: ${d.name} @ ${d.group ? `组「${d.group}」` : `仓库「${d.repo}」`}`,
19
27
  })
20
- async note(ctx: any) {
28
+ override async run(ctx: ActionInput<this['_input']>) {
21
29
 
22
30
  return ref.setLinkNote(ctx);
23
31
 
@@ -1,25 +1,30 @@
1
1
  // repo.ref.of —— 由 .tool/migrate-module.mjs 从 legacy 形态迁来(模板形态:一条 action 一个文件)。
2
2
  //
3
- // 契约常量在 ../schemas.ts(zod);本文件只做「声明 + 实现」,业务在服务层。
3
+ // 契约(zod schema)就声明在本文件里——入参类型由基类泛型模板封装;本文件只做「声明 + 实现」,业务在服务层。
4
4
  import { action } from '../../../runtime/action-decorator.js';
5
- import { ActionBase } from '../../../runtime/action-base.js';
6
- import { repoRefOfInput } from '../schemas.js';
5
+ import { z } from 'zod';
6
+ import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
7
7
  import * as refNs from '../ref.js';
8
8
  import { renderRefsOf as _renderRefsOf } from '../cli/render.js';
9
9
  const ref: any = refNs;
10
10
  const renderRefsOf: any = _renderRefsOf;
11
11
 
12
- export class RepoRefOfAction extends ActionBase {
12
+ /** repo.ref.of 的入参契约(CLI 与 HTTP 共用同一份)。 */
13
+ const input = z.object({
14
+ id: z.string().optional(),
15
+ });
16
+
17
+ export class RepoRefOfAction extends ActionBase<typeof input> {
13
18
  @action({
14
19
  id: 'repo.ref.of',
15
20
  cli: ['repo', 'ref', 'of'],
16
21
  http: ['GET', '/api/repos/ref/of'],
17
22
  summary: '查某仓库(缺省当前目录)的参考仓库:直接绑定到本仓库的 + 所属组绑定的,两类并列',
18
23
  args: ['id'],
19
- input: repoRefOfInput,
24
+ input,
20
25
  render: renderRefsOf,
21
26
  })
22
- async of(ctx: any) {
27
+ override async run(ctx: ActionInput<this['_input']>) {
23
28
 
24
29
  return ref.refReposOfRepo(ctx.id || process.cwd());
25
30
 
@@ -1,25 +1,31 @@
1
1
  // repo.ref.sync —— 由 .tool/migrate-module.mjs 从 legacy 形态迁来(模板形态:一条 action 一个文件)。
2
2
  //
3
- // 契约常量在 ../schemas.ts(zod);本文件只做「声明 + 实现」,业务在服务层。
3
+ // 契约(zod schema)就声明在本文件里——入参类型由基类泛型模板封装;本文件只做「声明 + 实现」,业务在服务层。
4
4
  import { action } from '../../../runtime/action-decorator.js';
5
- import { ActionBase } from '../../../runtime/action-base.js';
6
- import { repoRefSyncInput } from '../schemas.js';
5
+ import { z } from 'zod';
6
+ import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
7
7
  import * as refNs from '../ref.js';
8
8
  import { renderRefSync as _renderRefSync } from '../cli/render.js';
9
9
  const ref: any = refNs;
10
10
  const renderRefSync: any = _renderRefSync;
11
11
 
12
- export class RepoRefSyncAction extends ActionBase {
12
+ /** repo.ref.sync 的入参契约(CLI 与 HTTP 共用同一份)。 */
13
+ const input = z.object({
14
+ id: z.string().optional(),
15
+ all: z.boolean().optional().describe("同步全部参考仓库"),
16
+ });
17
+
18
+ export class RepoRefSyncAction extends ActionBase<typeof input> {
13
19
  @action({
14
20
  id: 'repo.ref.sync',
15
21
  cli: ['repo', 'ref', 'sync'],
16
22
  http: ['POST', '/api/repos/ref/sync'],
17
23
  summary: '同步参考仓库(git pull --ff-only;--all 同步全部)',
18
24
  args: ['id'],
19
- input: repoRefSyncInput,
25
+ input,
20
26
  render: (d: any) => (d.results ? renderRefSync(d) : `已同步: ${d.name}(${d.status}${d.output ? ' — ' + d.output.split('\n')[0] : ''})`),
21
27
  })
22
- async sync(ctx: any) {
28
+ override async run(ctx: ActionInput<this['_input']>) {
23
29
 
24
30
  return (ctx.all ? ref.syncAllRefs() : ref.syncRef(ctx.id));
25
31