nx-kv 0.63.0 → 0.64.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.
Files changed (183) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/assets/nx-kv/references/A03-/346/226/207/346/241/243/344/270/216/345/275/222/345/261/236.md +6 -5
  3. package/package.json +2 -2
  4. package/src/core/attachmentdb/docs.ts +3 -6
  5. package/src/core/attachmentdb/query.ts +2 -2
  6. package/src/core/attachmentdb/relations.ts +36 -21
  7. package/src/core/db/import-json/refs.ts +17 -19
  8. package/src/core/db/import-json/repos.ts +4 -8
  9. package/src/core/db/migrations/index.ts +2 -0
  10. package/src/core/db/migrations/v13.sql +24 -0
  11. package/src/core/db/seed-templates.ts +15 -4
  12. package/src/core/db/version.ts +3 -1
  13. package/src/modules/docs/actions/_manifest.generated.ts +0 -3
  14. package/src/modules/docs/actions/doc-attach.ts +0 -1
  15. package/src/modules/docs/actions/docs-bindings.ts +2 -5
  16. package/src/modules/docs/actions/docs-link.ts +1 -2
  17. package/src/modules/docs/attach.ts +1 -36
  18. package/src/modules/docs/bound-docs.ts +2 -2
  19. package/src/modules/docs/brief.ts +0 -2
  20. package/src/modules/docs/docref.ts +7 -17
  21. package/src/modules/docs/knowledge-md.ts +1 -1
  22. package/src/modules/docs/knowledge.ts +48 -45
  23. package/src/modules/docs/ref-sync.ts +1 -5
  24. package/src/modules/docs/refs.ts +7 -10
  25. package/src/modules/docs/service.ts +1 -3
  26. package/src/modules/localtask/actions/localtask-config.ts +19 -58
  27. package/src/modules/localtask/actions/localtask-prune.ts +7 -2
  28. package/src/modules/localtask/repo/open.ts +0 -4
  29. package/src/modules/localtask/repo/settings.ts +20 -196
  30. package/src/modules/localtask/task-lifecycle.ts +7 -9
  31. package/src/modules/localtask/task-templates.ts +4 -4
  32. package/src/modules/localtask/task-view.ts +4 -0
  33. package/src/modules/localtask/topics.ts +30 -28
  34. package/src/modules/promptplug/actions/_manifest.generated.ts +0 -3
  35. package/src/modules/promptplug/actions/prompt-registry.ts +19 -30
  36. package/src/modules/promptplug/base.ts +69 -25
  37. package/src/modules/promptplug/compose.ts +40 -23
  38. package/src/modules/promptplug/factory.ts +91 -59
  39. package/src/modules/promptplug/index.ts +25 -11
  40. package/src/modules/promptplug/plugins/ack.ts +28 -0
  41. package/src/modules/promptplug/plugins/attachment.ts +237 -19
  42. package/src/modules/promptplug/plugins/context.ts +124 -30
  43. package/src/modules/promptplug/plugins/doneguard.ts +33 -0
  44. package/src/modules/promptplug/plugins/ext.ts +34 -11
  45. package/src/modules/promptplug/plugins/getloop.ts +29 -8
  46. package/src/modules/promptplug/plugins/goal-shape.ts +34 -0
  47. package/src/modules/promptplug/plugins/goalhint.ts +33 -0
  48. package/src/modules/promptplug/plugins/timecheck.ts +33 -0
  49. package/src/modules/promptplug/registry.ts +99 -0
  50. package/src/modules/promptplug/schema-bridge.ts +77 -13
  51. package/src/modules/repos/actions/board-rekey.ts +1 -1
  52. package/src/modules/repos/actions/repo-doc-add.ts +2 -3
  53. package/src/modules/repos/boards/core.ts +1 -13
  54. package/src/modules/repos/boards/docs.ts +2 -12
  55. package/src/modules/repos/boards/members.ts +2 -14
  56. package/src/modules/repos/boards/transfer.ts +2 -11
  57. package/src/modules/repos/keys.ts +4 -11
  58. package/src/modules/repos/repo/refs.ts +3 -5
  59. package/src/modules/repos/repo/repos.ts +12 -13
  60. package/src/modules/repos/repo/rows.ts +2 -8
  61. package/src/modules/repos/service/context.ts +0 -2
  62. package/src/modules/repos/service/crud.ts +1 -4
  63. package/src/modules/repos/service/store.ts +6 -7
  64. package/src/modules/repos/transfer/export.ts +3 -8
  65. package/src/modules/repos/transfer/import.ts +0 -13
  66. package/src/modules/repos/transfer/layout.ts +2 -2
  67. package/src/modules/tasktool/attach-template.ts +3 -3
  68. package/src/modules/tasktool/groupctx.ts +4 -5
  69. package/src/modules/tasktool/plugins/waitgoal-config.ts +5 -6
  70. package/src/modules/tasktool/preview.ts +20 -23
  71. package/src/modules/tasktool/wait.ts +24 -46
  72. package/src/modules/templates/actions/_manifest.generated.ts +3 -0
  73. package/src/modules/templates/actions/templates-reorder.ts +28 -0
  74. package/src/modules/templates/repo/templates.ts +32 -2
  75. package/src/modules/templates/service.ts +45 -0
  76. package/src/shared/prompt-blocks.ts +7 -173
  77. package/src/shared/prompt-plugin.ts +79 -59
  78. package/src/web/frontend/App.tsx +27 -1
  79. package/src/web/frontend/api/cli-tree.json +20 -35
  80. package/src/web/frontend/api/client.generated.ts +22 -32
  81. package/src/web/frontend/components/Introduction/rail.tsx +2 -2
  82. package/src/web/frontend/components/Introduction/use-intro.ts +2 -5
  83. package/src/web/frontend/components/bindings/bind-tags.tsx +1 -3
  84. package/src/web/frontend/components/list-search.tsx +37 -0
  85. package/src/web/frontend/components/md/attach-area.tsx +10 -15
  86. package/src/web/frontend/components/md/live-block.tsx +5 -14
  87. package/src/web/frontend/components/md/md-panes.tsx +3 -19
  88. package/src/web/frontend/modules/list-filter.ts +37 -0
  89. package/src/web/frontend/modules/md/fill-session.ts +36 -0
  90. package/src/web/frontend/modules/md/manage-session.ts +24 -0
  91. package/src/web/frontend/modules/md/new-task-from-template.ts +22 -0
  92. package/src/web/frontend/modules/md/styles/editor.css +5 -12
  93. package/src/web/frontend/modules/md/styles/shell.css +4 -0
  94. package/src/web/frontend/modules/md/task-intent.ts +29 -0
  95. package/src/web/frontend/modules/md/use-templates.ts +8 -0
  96. package/src/web/frontend/modules/prompts/template-preview.ts +12 -20
  97. package/src/web/frontend/modules/refs/api.ts +0 -1
  98. package/src/web/frontend/page/dir/index.tsx +20 -5
  99. package/src/web/frontend/page/dir/task-actions.ts +14 -0
  100. package/src/web/frontend/page/dir/task-preview-modal.tsx +1 -1
  101. package/src/web/frontend/page/dir/task.tsx +19 -0
  102. package/src/web/frontend/page/doc/api.ts +2 -3
  103. package/src/web/frontend/page/doc/bindings.tsx +46 -16
  104. package/src/web/frontend/page/doc/index.tsx +3 -4
  105. package/src/web/frontend/page/group/index.tsx +65 -117
  106. package/src/web/frontend/page/refs/index.tsx +27 -3
  107. package/src/web/frontend/page/refs/style.css +3 -0
  108. package/src/web/frontend/page/repos/bind-modals.tsx +18 -2
  109. package/src/web/frontend/page/repos/board-admin.tsx +1 -1
  110. package/src/web/frontend/page/repos/index.tsx +4 -8
  111. package/src/web/frontend/page/repos/ref-block.tsx +5 -12
  112. package/src/web/frontend/page/repos/ref-panel.tsx +3 -4
  113. package/src/web/frontend/page/repos/repo-form-modal.tsx +1 -8
  114. package/src/web/frontend/page/repos/repo-table.tsx +4 -29
  115. package/src/web/frontend/page/repos/use-repos-derive.ts +4 -5
  116. package/src/web/frontend/page/settings/api.ts +7 -15
  117. package/src/web/frontend/page/settings/prompt-templates-section.tsx +261 -289
  118. package/src/web/frontend/page/settings/prompt-vars.ts +56 -0
  119. package/src/web/frontend/page/settings/style.css +46 -64
  120. package/src/web/frontend/page/templates/fill.tsx +124 -0
  121. package/src/web/frontend/page/templates/index.tsx +11 -0
  122. package/src/web/frontend/page/templates/manage.tsx +218 -0
  123. package/src/web/frontend/page/templates/style.css +46 -0
  124. package/src/web/frontend/page/templates/template-list.tsx +58 -54
  125. package/src/web/frontend/refs/api.ts +0 -2
  126. package/src/web/frontend/routes/route-eq.ts +22 -0
  127. package/src/web/frontend/routes/templates.ts +20 -0
  128. package/src/web/frontend/style.css +1 -0
  129. package/src/web/frontend/styles/list-search.css +44 -0
  130. package/src/web/frontend/types.ts +5 -1
  131. package/src/web/public/assets/{bar-CYWfxHfm.js → bar-j14ON7uZ.js} +1 -1
  132. package/src/web/public/assets/{composer-launch-Bor4ngrQ.js → composer-launch-DRi9mZE1.js} +1 -1
  133. package/src/web/public/assets/{composer-panel-C7mNI7EW.js → composer-panel-swmDqlPw.js} +1 -1
  134. package/src/web/public/assets/dir-DhsB1ZhL.js +3 -0
  135. package/src/web/public/assets/doc-D4po3sDc.js +6 -0
  136. package/src/web/public/assets/fill-session-fHxQHFaD.js +1 -0
  137. package/src/web/public/assets/group-BxmSNzIB.js +1 -0
  138. package/src/web/public/assets/index-CMjG5NVU.js +2 -0
  139. package/src/web/public/assets/index-uMjSWNVr.css +1 -0
  140. package/src/web/public/assets/list-filter-D-x94TvA.js +1 -0
  141. package/src/web/public/assets/manage-session-CS8UvmUd.js +1 -0
  142. package/src/web/public/assets/md-history-CZUF_FhN.js +39 -0
  143. package/src/web/public/assets/new-task-from-template-DDWu4yR4.js +1 -0
  144. package/src/web/public/assets/refs-TuuoaRs7.js +2 -0
  145. package/src/web/public/assets/refs-zSA2k_45.css +1 -0
  146. package/src/web/public/assets/render-template-body-bXdedFig.js +1 -0
  147. package/src/web/public/assets/repo-form-modal-BD4N37MI.js +1 -0
  148. package/src/web/public/assets/repos-BPeuX4N9.js +12 -0
  149. package/src/web/public/assets/settings-CZJaKLZW.js +1 -0
  150. package/src/web/public/assets/settings-Cc6puKd5.css +1 -0
  151. package/src/web/public/assets/task-DgbbF5gy.js +11 -0
  152. package/src/web/public/assets/task-intent-CX5DZccN.js +1 -0
  153. package/src/web/public/assets/{task-utils-DpnPjZKJ.js → task-utils-bJH1-Cjy.js} +1 -1
  154. package/src/web/public/assets/templates-CBXlwyof.js +11 -0
  155. package/src/web/public/assets/templates-plA8R7jJ.css +1 -0
  156. package/src/web/public/assets/use-rail-drag-ufwy2XZB.js +1 -0
  157. package/src/web/public/index.html +8 -6
  158. package/src/modules/docs/actions/doc-attach-note.ts +0 -32
  159. package/src/modules/promptplug/Template/blockTemplates.json +0 -90
  160. package/src/modules/promptplug/actions/prompt-order.ts +0 -38
  161. package/src/modules/promptplug/ensure.ts +0 -57
  162. package/src/modules/promptplug/keys.ts +0 -9
  163. package/src/modules/promptplug/plugins/readonly-blocks.ts +0 -75
  164. package/src/modules/promptplug/template-bundle.ts +0 -59
  165. package/src/web/frontend/modules/md/template-locks.ts +0 -105
  166. package/src/web/frontend/page/settings/prompt-editor.tsx +0 -279
  167. package/src/web/frontend/page/settings/prompt-rail.tsx +0 -170
  168. package/src/web/public/assets/dir-CcffxXL2.js +0 -3
  169. package/src/web/public/assets/doc-BxWVzWkw.js +0 -6
  170. package/src/web/public/assets/group-C5Yu3oJr.js +0 -1
  171. package/src/web/public/assets/index-BvyZ1MA2.js +0 -2
  172. package/src/web/public/assets/index-Cp-TtHyA.css +0 -1
  173. package/src/web/public/assets/md-history-DejKuR12.js +0 -39
  174. package/src/web/public/assets/refs-DJdKV8_H.css +0 -1
  175. package/src/web/public/assets/refs-VbDnDTV0.js +0 -2
  176. package/src/web/public/assets/repo-form-modal-Dkdvu_uN.js +0 -1
  177. package/src/web/public/assets/repos-CY0eZheu.js +0 -16
  178. package/src/web/public/assets/settings-AwzLRYUu.css +0 -1
  179. package/src/web/public/assets/settings-D3T-vgCl.js +0 -1
  180. package/src/web/public/assets/task-CkCD82h_.js +0 -11
  181. package/src/web/public/assets/templates-BcuCbT4U.js +0 -10
  182. package/src/web/public/assets/templates-gNdtaMI2.css +0 -1
  183. package/src/web/public/assets/use-rail-drag-DMvr8-GE.js +0 -1
@@ -0,0 +1,34 @@
1
+ // 时间目标 / 当前任务 的共享 shape(timecheck · goalhint · doneguard · ack 共用)。
2
+ //
3
+ // 每个字段的 .describe() 就是设置页变量目录显示的含义(schema-bridge 读它当 label),
4
+ // 所以中文说明必须写在这里——别再单独维护一份变量表。
5
+ import { z } from 'zod';
6
+
7
+ export const goalShape = z
8
+ .looseObject({
9
+ name: z.string().optional().describe('时间目标名(如「验收窗口」)'),
10
+ deadline: z.string().optional().describe('截止时刻(YYYY-MM-DD HH:mm:ss)'),
11
+ prompt: z.string().optional().describe('目标的附加要求原文(领取时随 check 指令给出)'),
12
+ durationHuman: z.string().optional().describe('总时长(人话,如「2 小时」)'),
13
+ elapsedHuman: z.string().optional().describe('已过时长(人话)'),
14
+ remainingHuman: z.string().optional().describe('剩余时长(人话)'),
15
+ elapsedSec: z.number().optional().describe('已过秒数(给 helper 算比例用)'),
16
+ durationSec: z.number().optional().describe('总秒数'),
17
+ remainingSec: z.number().optional().describe('剩余秒数(到点后为 0)'),
18
+ overtimeSec: z.number().optional().describe('超时秒数(未到点为 0)'),
19
+ reached: z.boolean().optional().describe('是否已到点(到了就该收口)'),
20
+ blocked: z.boolean().optional().describe('是否被时间挡在 done 之外(完成门禁用)'),
21
+ goalKey: z.string().optional().describe('目标 id(timegoal check --task 用)'),
22
+ extra: z.string().optional().describe('领取后追加的要求(可动态改)'),
23
+ check: z.string().optional().describe('本轮检查指令整段文本(有任务级目标时才有)'),
24
+ statusLine: z.string().optional().describe('目录级目标的状态行(「剩余 12 分钟」)'),
25
+ })
26
+ .optional()
27
+ .nullable()
28
+ .describe('时间目标(任务级或目录级);没有目标 → null,三段都不输出');
29
+
30
+ export const taskShape = z
31
+ .looseObject({ id: z.number().describe('任务号'), text: z.string().describe('任务正文原文') })
32
+ .optional()
33
+ .nullable()
34
+ .describe('当前任务(seed,宿主传入)');
@@ -0,0 +1,33 @@
1
+ // goalhint 段(order 40 / check 链):时间目标的可算上下文(进度百分比 / 该收口还是继续)。
2
+ //
3
+ // 一个段一个文件:正文就是这个类里的 BUILTIN。
4
+ import { z } from 'zod';
5
+ import { PromptPlugin, type TemplateText } from '../base.js';
6
+ import { goalShape, taskShape } from './goal-shape.js';
7
+
8
+ const schema = z.strictObject({ goal: goalShape, task: taskShape });
9
+
10
+ const BUILTIN: TemplateText = {
11
+ id: 'builtin',
12
+ name: '系统内置',
13
+ text: `{{#if goal.check}}
14
+ 〔特殊功能提示 · 时间目标〕任务 #{{task.id}} 正在计时:持续 {{goal.durationHuman}},已过 {{goal.elapsedHuman}}({{percent goal.elapsedSec goal.durationSec}}%),{{#if goal.reached}}已到点(超时 {{formatDuration goal.overtimeSec}}){{else}}剩余 {{goal.remainingHuman}}{{/if}}。
15
+ {{#if goal.reached}}——时间已到:可以收口,把改动收敛成可交付状态,补验证与说明后按 ack 段 done。
16
+ {{else}}{{#if (gte (percent goal.elapsedSec goal.durationSec) 67)}}——已过 2/3:进入收尾整理(收敛改动 / 补验证 / 写清遗留),别开新战线。
17
+ {{else}}{{#if (gte (percent goal.elapsedSec goal.durationSec) 50)}}——已过半:先确认主线走到哪,剩余时间只做收尾必需项。
18
+ {{else}}——时间尚足:先做主线,再补细节。{{/if}}{{/if}}{{/if}}
19
+ {{/if}}`,
20
+ };
21
+
22
+ export class GoalhintPlugin extends PromptPlugin<typeof schema> {
23
+ readonly id = 'goalhint';
24
+ readonly order = 40;
25
+ readonly group = 'check' as const;
26
+ readonly tag = 'nx-kv.goalhint';
27
+ readonly label = '特殊功能提示(timegoal)';
28
+ readonly dataSchema = schema;
29
+ readonly templates = [BUILTIN];
30
+
31
+ constructor(template = '') { super(template); }
32
+ protected buildData() { return {} as never; }
33
+ }
@@ -0,0 +1,33 @@
1
+ // timecheck 段(order 30 / check 链):时间目标检查指令 / 状态行。
2
+ //
3
+ // 一个段一个文件:正文就是这个类里的 BUILTIN。
4
+ // 有任务级时间目标时给完整 check 指令;只有目录级目标时给一行状态。
5
+ import { z } from 'zod';
6
+ import { PromptPlugin, type TemplateText } from '../base.js';
7
+ import { goalShape } from './goal-shape.js';
8
+
9
+ const schema = z.strictObject({ goal: goalShape });
10
+
11
+ const BUILTIN: TemplateText = {
12
+ id: 'builtin',
13
+ name: '系统内置',
14
+ text: `{{#if goal.check}}
15
+ {{goal.check}}
16
+ {{/if}}
17
+ {{#if goal.statusLine}}
18
+ {{goal.statusLine}}
19
+ {{/if}}`,
20
+ };
21
+
22
+ export class TimecheckPlugin extends PromptPlugin<typeof schema> {
23
+ readonly id = 'timecheck';
24
+ readonly order = 30;
25
+ readonly group = 'check' as const;
26
+ readonly tag = 'nx-kv.timecheck';
27
+ readonly label = '时间目标检查';
28
+ readonly dataSchema = schema;
29
+ readonly templates = [BUILTIN];
30
+
31
+ constructor(template = '') { super(template); }
32
+ protected buildData() { return {} as never; }
33
+ }
@@ -0,0 +1,99 @@
1
+ // promptplug 注册表(#152):插件类的**唯一装配点**,也是 id / group / 顺序的派生源。
2
+ //
3
+ // 为什么是「一个数组 + 派生」而不是运行时扫描目录:本仓 node 侧是 tsc 打包产物,
4
+ // 没有运行时模块发现;再加一份 JSON 注册表就退回了 #152 要干掉的东西。
5
+ // 所以真相是这一个 `PLUGIN_CLASSES` 数组:加一个插件 = 写一个类 + 往这里加一行,
6
+ // 其余(id 清单 / 每个时机的链 / 字段目录 / 顺序位)全部由类声明派生。
7
+ //
8
+ // group 语义(用户口径「时机即 group」):
9
+ // get —— 领取交付时拼的那段(上下文 / 附件 / 队列 / ack / 持续 get)
10
+ // check —— 每轮检查时拼的那段(时间目标)
11
+ // done —— 尝试完成时拼的那段(完成门禁)
12
+ import type { AnyPromptPlugin } from '../../shared/prompt-plugin.js';
13
+ import { assertPluginList } from '../../shared/prompt-plugin.js';
14
+ import type { PluginGroup, TemplateText } from './base.js';
15
+ import { PLUGIN_GROUPS } from './base.js';
16
+ import { AttachmentPlugin } from './plugins/attachment.js';
17
+ import { ContextPlugin } from './plugins/context.js';
18
+ import { ExtPlugin } from './plugins/ext.js';
19
+ import { GetloopPlugin } from './plugins/getloop.js';
20
+ import { AckPlugin } from './plugins/ack.js';
21
+ import { DoneguardPlugin } from './plugins/doneguard.js';
22
+ import { GoalhintPlugin } from './plugins/goalhint.js';
23
+ import { TimecheckPlugin } from './plugins/timecheck.js';
24
+
25
+ /** 插件类(构造签名不统一:有的只吃模板,有的还要宿主 deps)。 */
26
+ type PluginCtor = new (template: string, deps?: any) => AnyPromptPlugin;
27
+
28
+ /**
29
+ * 全部插件类(**注册的唯一真相**)。
30
+ * 数组顺序无关——链内顺序由各类的 `order` 决定;这里只是人工阅读的排列。
31
+ */
32
+ export const PLUGIN_CLASSES: readonly PluginCtor[] = [
33
+ ContextPlugin,
34
+ AttachmentPlugin,
35
+ TimecheckPlugin,
36
+ GoalhintPlugin,
37
+ DoneguardPlugin,
38
+ ExtPlugin,
39
+ AckPlugin,
40
+ GetloopPlugin,
41
+ ] as unknown as readonly PluginCtor[];
42
+
43
+ let metas: AnyPromptPlugin[] | null = null;
44
+
45
+ /** 用空 deps 造元信息实例(只读声明面:id/order/group/tag/label/templates/schema)。 */
46
+ function allMetas(): AnyPromptPlugin[] {
47
+ if (!metas) metas = PLUGIN_CLASSES.map((Ctor) => new Ctor('', {}));
48
+ return metas;
49
+ }
50
+
51
+ /** 按 id 取元信息实例(不取数:buildData 永远不调)。 */
52
+ export function pluginMeta(id: string): AnyPromptPlugin | undefined {
53
+ const want = String(id || '');
54
+ return allMetas().find((p) => p.id === want);
55
+ }
56
+
57
+ let checked = false;
58
+
59
+ /**
60
+ * 全量不变量校验(id 唯一 / 链内 order 唯一 / 模板非空 / tag 合法 / 写回段不撞车)。
61
+ * 只跑一次:注册表是编译期常量,启动后不会变。
62
+ */
63
+ export function assertRegistry(): void {
64
+ if (checked) return;
65
+ assertPluginList(allMetas());
66
+ checked = true;
67
+ }
68
+
69
+ /** 某个时机的链(按 order 升序)。 */
70
+ export function groupPluginIds(group: PluginGroup): string[] {
71
+ return allMetas()
72
+ .filter((p) => p.group === group)
73
+ .sort((a, b) => a.order - b.order)
74
+ .map((p) => p.id);
75
+ }
76
+
77
+ /** 全部插件 id(按 group 再按 order 的稳定序)——uiDescriptor / 白名单共用。 */
78
+ export function allPluginIds(): string[] {
79
+ return PLUGIN_GROUPS.flatMap((g) => groupPluginIds(g));
80
+ }
81
+
82
+ /** 时机链索引:{ get: [...], check: [...], done: [...] }(注册表 / 设置页 / 预览共用)。 */
83
+ export function groupIndex(): Record<PluginGroup, string[]> {
84
+ const out = {} as Record<PluginGroup, string[]>;
85
+ for (const g of PLUGIN_GROUPS) out[g] = groupPluginIds(g);
86
+ return out;
87
+ }
88
+
89
+ /** 某插件的内置模板列表(至少一条;第一条 = 出厂默认)。 */
90
+ export function templatesOf(id: string): readonly TemplateText[] {
91
+ const p = pluginMeta(id);
92
+ return p ? p.templates : [];
93
+ }
94
+
95
+ /** 某插件所在的时机链。 */
96
+ export function groupOf(id: string): PluginGroup | '' {
97
+ const p = pluginMeta(id);
98
+ return p ? (p.group as PluginGroup) : '';
99
+ }
@@ -5,14 +5,18 @@
5
5
  // import 它过不了分层测试。这里自持一份最小实现,升级警戒同款:
6
6
  // _zod.def 是 zod 内部 API——zod 升级先看本文件与 runtime/zod-bridge.ts / codegen.ts。
7
7
  //
8
- // 下钻规则(两层):
8
+ // 下钻规则(三层):
9
9
  // - 顶层段(object)下钻到段内一级叶子:repo.name / attach.count / attach.list;
10
- // - 数组字段记 kind 'list'(元素不下钻——UI 变量目录不进到数组元素内部);
10
+ // - 数组字段记 kind 'list',并把**元素内部**再展开一层:`attach.list[].file.localPath`。
11
+ // `[]` 只是目录里的记法——模板里在 `{{#each attach.list}}` 内部写的是相对路径
12
+ // `{{file.localPath}}`,两者一眼能对上;
13
+ // - 联合(union / discriminatedUnion)取**各分支字段的并集**:多 kind 的结构
14
+ // (附件条目)不允许因为「它是 union」就在目录里消失。
11
15
  // - label 取 .describe() 的文本(zod-bridge 已验证该读取方式),无描述用字段名。
12
16
  import type { FieldDecl, PluginSchema } from '../../shared/prompt-plugin.js';
13
17
  import type { z } from 'zod';
14
18
 
15
- /** 拆掉 optional / nullable / default / nullable 外壳(zod v4 内部 API,见头注释警戒)。 */
19
+ /** 拆掉 optional / nullable / default 外壳(zod v4 内部 API,见头注释警戒)。 */
16
20
  function unwrap(field: unknown): { inner: unknown; optional: boolean } {
17
21
  let cur = field as { _zod?: { def?: Record<string, unknown> } };
18
22
  let optional = false;
@@ -34,8 +38,29 @@ function tagOf(inner: unknown): string {
34
38
  return String(tag || '');
35
39
  }
36
40
 
41
+ function defOf(inner: unknown): Record<string, unknown> | undefined {
42
+ return (inner as { _zod?: { def?: Record<string, unknown> } })?._zod?.def;
43
+ }
44
+
45
+ function isObjectTag(tag: string): boolean {
46
+ return tag === 'object' || tag === 'loose_object' || tag === 'strict_object';
47
+ }
48
+
49
+ function shapeOf(inner: unknown): Record<string, unknown> {
50
+ return (defOf(inner)?.shape ?? {}) as Record<string, unknown>;
51
+ }
52
+
53
+ function elementOf(inner: unknown): unknown {
54
+ return defOf(inner)?.element;
55
+ }
56
+
57
+ function optionsOf(inner: unknown): readonly unknown[] {
58
+ const o = defOf(inner)?.options;
59
+ return Array.isArray(o) ? o : [];
60
+ }
61
+
37
62
  function enumValuesOf(inner: unknown): string[] {
38
- const def = (inner as { _zod?: { def?: { entries?: Record<string, string> } } })?._zod?.def;
63
+ const def = defOf(inner) as { entries?: Record<string, string> } | undefined;
39
64
  return Object.values(def?.entries ?? {});
40
65
  }
41
66
 
@@ -44,33 +69,72 @@ function hintOf(field: unknown): string | undefined {
44
69
  return typeof d === 'string' && d ? d : undefined;
45
70
  }
46
71
 
47
- /** shape 递归下钻到段内一级叶子(深度 ≤2)。 */
72
+ /** shape 递归下钻(depth 是「还能往下拆几层 object」)。 */
48
73
  function walk(prefix: string, node: unknown, out: FieldDecl[], depth: number): void {
49
74
  const { inner } = unwrap(node);
50
75
  const hint = hintOf(node) || hintOf(inner);
51
76
  const label = hint || prefix;
52
77
  const tag = tagOf(inner);
53
- if (depth > 0 && (tag === 'object' || tag === 'loose_object' || tag === 'strict_object')) {
54
- const def = (inner as { _zod?: { def?: { shape?: Record<string, unknown> } } })?._zod?.def;
55
- const shape = (def?.shape ?? {}) as Record<string, unknown>;
56
- for (const [k, child] of Object.entries(shape)) walk(`${prefix}.${k}`, child, out, depth - 1);
78
+ const desc = hint && hint !== prefix ? { desc: hint } : {};
79
+
80
+ if (isObjectTag(tag)) {
81
+ const shape = shapeOf(inner);
82
+ if (depth > 0 && Object.keys(shape).length) {
83
+ for (const [k, child] of Object.entries(shape)) walk(`${prefix}.${k}`, child, out, depth - 1);
84
+ return;
85
+ }
86
+ // 空对象 / 深度用尽:记成本段本身(模板里可整体 {{#if x}})
87
+ out.push({ key: prefix, kind: 'string', label, ...desc });
57
88
  return;
58
89
  }
90
+
91
+ if (tag === 'array') {
92
+ out.push({ key: prefix, kind: 'list', label, ...desc });
93
+ // 元素内部多展开一层:attach.list[] → attach.list[].file.localPath
94
+ const el = elementOf(inner);
95
+ if (el !== undefined) walk(`${prefix}[]`, el, out, Math.max(depth, 1) + 1);
96
+ return;
97
+ }
98
+
99
+ if (tag === 'union') {
100
+ // 多分支取并集(discriminatedUnion 的每个 kind 都要在目录里可见)
101
+ const opts = optionsOf(inner);
102
+ if (!opts.length) {
103
+ out.push({ key: prefix, kind: 'string', label, ...desc });
104
+ return;
105
+ }
106
+ for (const opt of opts) walk(prefix, opt, out, depth);
107
+ return;
108
+ }
109
+
59
110
  let kind: FieldDecl['kind'] = 'string';
60
111
  let enumValues: readonly string[] | undefined;
61
112
  switch (tag) {
62
113
  case 'number': case 'int': kind = 'number'; break;
63
114
  case 'boolean': kind = 'boolean'; break;
64
115
  case 'enum': kind = 'enum'; enumValues = enumValuesOf(inner); break;
65
- case 'array': kind = 'list'; break;
66
116
  default: kind = 'string'; break; // string / literal / 其余 → 文本
67
117
  }
68
- out.push({ key: prefix, kind, label, ...(hint && hint !== prefix ? { desc: hint } : {}), ...(enumValues ? { enumValues } : {}) });
118
+ out.push({ key: prefix, kind, label, ...desc, ...(enumValues ? { enumValues } : {}) });
119
+ }
120
+
121
+ /** 同名字段去重:union 各分支会重复给公共字段,保留信息量更大的那条(带 enum 值优先)。 */
122
+ function dedupe(fields: FieldDecl[]): FieldDecl[] {
123
+ const byKey = new Map<string, FieldDecl>();
124
+ for (const f of fields) {
125
+ const prev = byKey.get(f.key);
126
+ if (!prev) {
127
+ byKey.set(f.key, f);
128
+ continue;
129
+ }
130
+ if (!prev.enumValues?.length && f.enumValues?.length) byKey.set(f.key, f);
131
+ }
132
+ return [...byKey.values()];
69
133
  }
70
134
 
71
135
  /**
72
136
  * zod strictObject shape → PluginSchema。
73
- * fields:顶层段 + 段内一级叶子(模板变量白名单与 UI 目录的唯一来源)。
137
+ * fields:顶层段 + 段内一级叶子(+ 数组元素内部一层)——模板变量白名单与 UI 目录的唯一来源。
74
138
  * blank:全字段声明 default 时可派生(safeParse({}));派生不出为 null(UI 不强求初值)。
75
139
  */
76
140
  export function pluginSchemaOf<S extends z.ZodObject<z.ZodRawShape>>(schema: S): PluginSchema<unknown> {
@@ -84,5 +148,5 @@ export function pluginSchemaOf<S extends z.ZodObject<z.ZodRawShape>>(schema: S):
84
148
  } catch {
85
149
  blank = null; // 有 required 字段 → 派生不出零 I/O 占位
86
150
  }
87
- return { fields, blank };
151
+ return { fields: dedupe(fields), blank };
88
152
  }
@@ -24,7 +24,7 @@ export class BoardRekeyAction extends ActionBase<typeof input> {
24
24
  input,
25
25
  render: (d: any) => {
26
26
  const where: any = d.boards.length > 1 ? `${d.boards.length} 个看板(${d.boards.join('、')})` : `组「${d.boardName}」`;
27
- return `已重绑 ${d.from} → ${d.to}(${where}${d.merged ? ',与已有成员合并' : ''}${d.movedNote ? ',组内描述已跟随' : ''}${d.relinked ? `,${d.relinked} 条绑定已改指` : ''})`;
27
+ return `已重绑 ${d.from} → ${d.to}(${where}${d.merged ? ',与已有成员合并' : ''}${d.movedDoc ? ',组内描述已跟随' : ''}${d.relinked ? `,${d.relinked} 条绑定已改指` : ''})`;
28
28
  },
29
29
  })
30
30
  override async run(ctx: ActionInput<this['_input']>) {
@@ -12,7 +12,6 @@ const input = z.object({
12
12
  id: z.string(),
13
13
  ref: z.string().optional().describe("文档 refId(ref_<16hex>)"),
14
14
  path: z.string().optional().describe("外部绝对路径(登记成 origin=external 的 ref)"),
15
- note: z.string().optional().describe("这篇的说明"),
16
15
  });
17
16
 
18
17
  export class RepoDocAddAction extends ActionBase<typeof input> {
@@ -20,14 +19,14 @@ export class RepoDocAddAction extends ActionBase<typeof input> {
20
19
  id: 'repo.doc.add',
21
20
  cli: ['repo', 'doc', 'add'],
22
21
  http: ['POST', '/api/repos/docs'],
23
- summary: '给项目加一篇介绍文档:--ref <refId> | --path <外部绝对路径>(同 ref 重复添加 = 更新注解)',
22
+ summary: '给项目加一篇介绍文档:--ref <refId> | --path <外部绝对路径>(同 ref 重复添加 = 移到末尾)',
24
23
  args: ['id'],
25
24
  input,
26
25
  render: (d: any) => `已加一篇介绍文档(共 ${d.count} 篇)`,
27
26
  })
28
27
  override async run(ctx: ActionInput<this['_input']>) {
29
28
 
30
- return addRepoDoc(ctx.id, { ref: ctx.ref, path: ctx.path, note: ctx.note });
29
+ return addRepoDoc(ctx.id, { ref: ctx.ref, path: ctx.path });
31
30
 
32
31
  }
33
32
  }
@@ -24,16 +24,9 @@ export interface IntroMainOut {
24
24
  docId: string;
25
25
  title: string;
26
26
  desc: string;
27
- note: string;
28
27
  }
29
28
 
30
- // 组内描述:同一个仓库在不同看板里的角色可以各不相同(「fr 组里它是 API 契约方」,
31
- // 「nx 组里它只是同族工具」),所以描述挂在**看板的成员关系**上(repoNotes,按 key),
32
- // 而不是仓库登记上。登记里的 desc 回答「这个仓库是干什么的」,
33
- // 组内描述回答「它在这个组里占什么位置、怎么配合」。
34
- export const noteOf = (b: BoardEntry, rkey: string): string => (b.repoNotes || {})[rkey] || '';
35
-
36
- /** 看板成员投影(memberView 的形状)。 */
29
+ /** 看板成员投影(memberView 的形状)。组内描述走绑定文档(noteDocId),不再有文本 note。 */
37
30
  export interface BoardMemberView {
38
31
  key: string;
39
32
  name: string;
@@ -41,7 +34,6 @@ export interface BoardMemberView {
41
34
  path: string;
42
35
  remote: string;
43
36
  type: string;
44
- note: string;
45
37
  /** 组内描述文档(ref:<refId>);没有绑定为空串 */
46
38
  noteDocId: string;
47
39
  /** 本地有没有这条登记 */
@@ -58,7 +50,6 @@ export interface BoardMemberView {
58
50
  * clonable = 有远程地址 → 可以一键 clone 补齐
59
51
  */
60
52
  function memberView(s: Store, b: BoardEntry, rkey: string, fallback: RepoHint | null): BoardMemberView {
61
- const note = noteOf(b, rkey);
62
53
  const local = s.repos.find((r) => deriveKey(r) === rkey);
63
54
  const base: BoardMemberView = {
64
55
  key: rkey,
@@ -67,7 +58,6 @@ function memberView(s: Store, b: BoardEntry, rkey: string, fallback: RepoHint |
67
58
  path: local ? local.path : '',
68
59
  remote: local ? local.remote || '' : (fallback && fallback.remote) || '',
69
60
  type: local ? local.type || 'dev' : (fallback && fallback.type) || 'dev',
70
- note,
71
61
  // 组内描述文档(ref:<refId>)——前端点开 doc 页签用
72
62
  noteDocId: (b.repoDocs || {})[rkey]?.ref ? 'ref:' + (b.repoDocs || {})[rkey].ref : '',
73
63
  present: !!local,
@@ -187,14 +177,12 @@ export async function getBoard(idOrKey: unknown): Promise<GetBoardResult> {
187
177
  docId: set.main.docId,
188
178
  title: set.main.title,
189
179
  desc: set.main.desc,
190
- note: set.main.note,
191
180
  } : null,
192
181
  introExtras: set.links.map((d) => ({
193
182
  refId: d.refId,
194
183
  docId: d.docId,
195
184
  title: d.title,
196
185
  desc: d.desc,
197
- note: d.note,
198
186
  name: d.title,
199
187
  })),
200
188
  introCount: set.count,
@@ -1,5 +1,4 @@
1
- // 组内描述(board note):描述 = 文档,绑定在 ref_bindings(type=group_repo);
2
- // repoNotes 只是列表用的一句话摘要(保存时同步)。
1
+ // 组内描述(board note):描述 = 文档,绑定在 ref_bindings(type=group_repo)。
3
2
  import {
4
3
  loadStore,
5
4
  storedBoardKey,
@@ -69,10 +68,7 @@ export async function setBoardRepoNote({ id, key, board, note }: SetBoardRepoNot
69
68
  }
70
69
  await mutateStore((draft) => {
71
70
  const target = findBoardIn(draft, board);
72
- if (target) {
73
- if (target.repoNotes) delete target.repoNotes[rkey];
74
- if (target.repoDocs) delete target.repoDocs[rkey];
75
- }
71
+ if (target && target.repoDocs) delete target.repoDocs[rkey];
76
72
  });
77
73
  return { ...info, note: '', refId: '' };
78
74
  }
@@ -82,11 +78,5 @@ export async function setBoardRepoNote({ id, key, board, note }: SetBoardRepoNot
82
78
  refId = created.refId;
83
79
  }
84
80
  await updateDoc({ ref: 'ref:' + refId, body });
85
- await mutateStore((draft) => {
86
- const target = findBoardIn(draft, board);
87
- if (!target) return;
88
- if (!target.repoNotes) target.repoNotes = {};
89
- target.repoNotes[rkey] = text.slice(0, 120);
90
- });
91
81
  return { ...info, note: text, refId };
92
82
  }
@@ -58,8 +58,6 @@ export async function assignRepo({ id, key, board, before, remove }: AssignRepoI
58
58
  const at = b.repoKeys.indexOf(rkey);
59
59
  if (at < 0) return;
60
60
  b.repoKeys.splice(at, 1);
61
- // 摘出成员时组内描述一起带走(它只对这个成员关系有意义)
62
- if (b.repoNotes) delete b.repoNotes[rkey];
63
61
  n += 1;
64
62
  };
65
63
  if (target) drop(target);
@@ -130,7 +128,6 @@ export interface RekeyMemberResult {
130
128
  from: string;
131
129
  to: string;
132
130
  merged: boolean;
133
- movedNote: boolean;
134
131
  movedDoc: boolean;
135
132
  relinked: number;
136
133
  }
@@ -154,8 +151,7 @@ export interface RekeyMemberInput {
154
151
  * {key: 占位 key})——方向反了:真实身份被降级成 local/xxx,再导出就把这个假
155
152
  * key 传播给所有人。正确的动作是改关系:把组里的 from 换成 to。
156
153
  *
157
- * 组内描述(repoNotes)与组内文档绑定(repoDocs)都挂在 key 上,必须跟着搬,
158
- * 否则描述留在原地变成孤儿。
154
+ * 组内文档绑定(repoDocs)挂在 key 上,必须跟着搬,否则文档绑定留在原地变成孤儿。
159
155
  */
160
156
  export async function rekeyMember({ board, from, to }: RekeyMemberInput = {}): Promise<RekeyMemberResult> {
161
157
  const src = normalizeKey(from);
@@ -173,7 +169,6 @@ export async function rekeyMember({ board, from, to }: RekeyMemberInput = {}): P
173
169
  // 不给 board = 全组重绑:假 key 是**身份**问题,同一个占位在几个组里都是假的,
174
170
  // 只改一个组会留下一半仍然「待初始化」的残局。给了 board 就只动那一个组。
175
171
  const targets: BoardEntry[] = board ? [b] : s.boards.filter((x) => boardRepoKeys(x, s).includes(src));
176
- let movedNote = false;
177
172
  let movedDoc = false;
178
173
  let mergedAny = false;
179
174
  let touched = 0;
@@ -186,12 +181,7 @@ export async function rekeyMember({ board, from, to }: RekeyMemberInput = {}): P
186
181
  if (dup) keys.splice(at, 1); // 目标已在组里 → 合并:只把占位摘掉
187
182
  else keys[at] = dst; // 原位替换,成员顺序不变
188
183
  mergedAny = mergedAny || dup;
189
- // 描述与文档绑定跟着 key 走(目标已有则保留目标自己的——它属于真实成员关系)
190
- if (t.repoNotes && t.repoNotes[src] !== undefined) {
191
- if ((!dup || t.repoNotes[dst] === undefined) && t.repoNotes[src]) t.repoNotes[dst] = t.repoNotes[src];
192
- delete t.repoNotes[src];
193
- movedNote = true;
194
- }
184
+ // 文档绑定跟着 key 走(目标已有则保留目标自己的——它属于真实成员关系)
195
185
  if (t.repoDocs && t.repoDocs[src] !== undefined) {
196
186
  if (!dup || t.repoDocs[dst] === undefined) t.repoDocs[dst] = t.repoDocs[src];
197
187
  delete t.repoDocs[src];
@@ -224,7 +214,6 @@ export async function rekeyMember({ board, from, to }: RekeyMemberInput = {}): P
224
214
  from: src,
225
215
  to: dst,
226
216
  merged: mergedAny,
227
- movedNote,
228
217
  movedDoc,
229
218
  relinked,
230
219
  };
@@ -288,7 +277,6 @@ export async function prunePlaceholders({ board, all = false, apply = false }: P
288
277
  if (!b) continue;
289
278
  if (!Array.isArray(b.repoKeys)) b.repoKeys = boardRepoKeys(b, cur);
290
279
  b.repoKeys = b.repoKeys.filter((k) => k !== it.key);
291
- if (b.repoNotes) delete b.repoNotes[it.key];
292
280
  if (b.repoDocs) delete b.repoDocs[it.key];
293
281
  if (b.repoHints) delete b.repoHints[it.key];
294
282
  }
@@ -11,7 +11,7 @@ import {
11
11
  findBoard,
12
12
  } from '../service.js';
13
13
  import { badInput } from '../../../core/errors.js';
14
- import { cleanText, hintOf, noteOf } from './core.js';
14
+ import { cleanText, hintOf } from './core.js';
15
15
  import type { RepoHint, Store } from '../repo/rows.js';
16
16
 
17
17
  /** importBoards 的单条未匹配记录。 */
@@ -87,11 +87,6 @@ export async function importBoards({ json }: { json?: unknown } = {}): Promise<I
87
87
  if (!b.repoHints) b.repoHints = {};
88
88
  b.repoHints[k] = Object.fromEntries(Object.entries(hint).filter(([, v]) => v));
89
89
  }
90
- const note = cleanText(e.note);
91
- if (note) {
92
- if (!b.repoNotes) b.repoNotes = {};
93
- b.repoNotes[k] = note;
94
- }
95
90
  }
96
91
  }
97
92
  return { created, merged, matched, unmatched };
@@ -104,8 +99,6 @@ export interface ExportBoardsRepoEntry {
104
99
  name: string;
105
100
  desc: string;
106
101
  remote: string;
107
- /** 组内描述(有才带) */
108
- note?: string;
109
102
  }
110
103
 
111
104
  /** exportBoards 的一条看板。 */
@@ -122,7 +115,7 @@ export interface ExportBoardsResult {
122
115
  boards: ExportBoardsBoard[];
123
116
  }
124
117
 
125
- // 导出:看板 + 仓库的 key/name/desc + 组内描述 note(可回灌给 import 的同一结构)
118
+ // 导出:看板 + 仓库的 key/name/desc(可回灌给 import 的同一结构)
126
119
  export async function exportBoards(): Promise<ExportBoardsResult> {
127
120
  const s: Store = await loadStore();
128
121
  return {
@@ -137,14 +130,12 @@ export async function exportBoards(): Promise<ExportBoardsResult> {
137
130
  repos: boardRepoKeys(b, s).map((rkey): ExportBoardsRepoEntry => {
138
131
  const r = s.repos.find((x) => deriveKey(x) === rkey);
139
132
  const hint: RepoHint = hintOf(b, rkey) || {};
140
- const note = noteOf(b, rkey);
141
133
  const entry: ExportBoardsRepoEntry = {
142
134
  key: rkey,
143
135
  name: r ? r.name : (hint.name || rkey),
144
136
  desc: r ? r.desc || '' : (hint.desc || ''),
145
137
  remote: r ? r.remote || '' : (hint.remote || ''),
146
138
  };
147
- if (note) entry.note = note;
148
139
  return entry;
149
140
  }),
150
141
  })),
@@ -162,7 +162,7 @@ export function renderRefresh(d: RefreshResult): string {
162
162
 
163
163
  // ─── 关系迁移:随机 id → key ────────────────────────────────────────────
164
164
  //
165
- // 存量数据里:board.repoIds 存随机 id、board.repoNotes 按 id、linked[].id 也是 id。
165
+ // 存量数据里:board.repoIds 存随机 id、linked[].id 也是 id。
166
166
  // 迁移把它们全部改成 key(仓库身份)。**幂等**:已经是 key 的不动,跑第二次无变化。
167
167
  //
168
168
  // 无法解析的(目标登记已不存在)不丢弃 —— 保留成占位 key,
@@ -182,18 +182,11 @@ export async function migrateRelations({ apply = false }: { apply?: boolean } =
182
182
  const keys: string[] = oldIds
183
183
  ? (oldIds.map((id) => idToKey.get(id)).filter(Boolean) as string[])
184
184
  : (Array.isArray(b.repoKeys) ? b.repoKeys.slice() : []);
185
- // repoNotes:按 id 存的改成按 key
186
- const notes: Record<string, string> = {};
187
- const oldNotes = b.repoNotes || {};
188
- for (const [k, v] of Object.entries(oldNotes)) {
189
- const nk = idToKey.get(k) || k; // id → key;已是 key 的原样
190
- notes[nk] = v;
191
- }
192
185
  // 被删仓库的成员(id 解析不到)→ 保留成占位 key(用 id 派生一个 local/ 前缀)
193
186
  const orphans = oldIds ? oldIds.filter((id) => !idToKey.has(id)) : [];
194
- const out: BoardEntry & { repoIds?: string[] } = { ...b, repoKeys: keys, repoNotes: notes };
187
+ const out: BoardEntry & { repoIds?: string[] } = { ...b, repoKeys: keys };
195
188
  delete out.repoIds;
196
- if (oldIds && (oldIds.length !== keys.length || Object.keys(oldNotes).length !== Object.keys(notes).length)) {
189
+ if (oldIds && oldIds.length !== keys.length) {
197
190
  changes.push({ board: b.name, key: bkey, members: keys.length, orphans: orphans.length });
198
191
  }
199
192
  return out;
@@ -230,7 +223,7 @@ export async function migrateRelations({ apply = false }: { apply?: boolean } =
230
223
  await service.mutateStore((cur: Store) => {
231
224
  cur.boards = boardsOut.map((b) => {
232
225
  const found: BoardEntry = cur.boards.find((x) => x.id === b.id) || ({} as BoardEntry);
233
- const next: BoardEntry & { repoIds?: string[] } = { ...found, repoKeys: b.repoKeys, repoNotes: b.repoNotes };
226
+ const next: BoardEntry & { repoIds?: string[] } = { ...found, repoKeys: b.repoKeys };
234
227
  delete next.repoIds;
235
228
  return next;
236
229
  });
@@ -22,7 +22,6 @@ interface BindingInput {
22
22
  refId?: unknown;
23
23
  type?: unknown;
24
24
  position?: number;
25
- note?: string;
26
25
  atMs: number;
27
26
  }
28
27
 
@@ -79,18 +78,17 @@ export function listOrphans(conn: DbApi = db()): Row[] {
79
78
  */
80
79
  export function putBinding(
81
80
  conn: DbApi,
82
- { repoKey, groupKey = null, refId, type, position = 0, note = '', atMs }: BindingInput
81
+ { repoKey, groupKey = null, refId, type, position = 0, atMs }: BindingInput
83
82
  ): void {
84
83
  conn.run(
85
- `INSERT OR IGNORE INTO ref_bindings (repo_key, group_key, ref_id, type, position, note, created_at)
86
- VALUES (:repo, :group, :ref, :type, :pos, :note, :at)`,
84
+ `INSERT OR IGNORE INTO ref_bindings (repo_key, group_key, ref_id, type, position, created_at)
85
+ VALUES (:repo, :group, :ref, :type, :pos, :at)`,
87
86
  {
88
87
  repo: String(repoKey || ''),
89
88
  group: groupKey == null ? null : String(groupKey),
90
89
  ref: String(refId || ''),
91
90
  type: String(type || 'repo'),
92
91
  pos: Number(position) || 0,
93
- note: String(note || ''),
94
92
  at: atMs,
95
93
  }
96
94
  );