nx-kv 0.64.0 → 0.65.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 (151) hide show
  1. package/CHANGELOG.md +70 -0
  2. package/assets/nx-kv/SKILL.md +5 -2
  3. package/assets/nx-kv/references/A03-/346/226/207/346/241/243/344/270/216/345/275/222/345/261/236.md +6 -0
  4. package/assets/nx-kv/references/A04-/344/273/223/345/272/223/344/270/216/351/241/271/347/233/256/347/273/204.md +79 -6
  5. package/assets/nx-kv/templates/ref-main-doc.md +46 -0
  6. package/package.json +1 -1
  7. package/src/core/db/seed-templates.ts +2 -86
  8. package/src/modules/localtask/task-lifecycle.ts +1 -1
  9. package/src/modules/promptplug/actions/_manifest.generated.ts +9 -0
  10. package/src/modules/promptplug/actions/prompt-registry.ts +4 -1
  11. package/src/modules/promptplug/actions/prompt-template-activate.ts +31 -0
  12. package/src/modules/promptplug/actions/prompt-template-delete.ts +30 -0
  13. package/src/modules/promptplug/actions/prompt-template-save.ts +52 -0
  14. package/src/modules/promptplug/delivery.ts +151 -0
  15. package/src/modules/promptplug/factory.ts +16 -8
  16. package/src/modules/promptplug/index.ts +3 -1
  17. package/src/modules/promptplug/plugins/doneguard.ts +3 -0
  18. package/src/modules/promptplug/plugins/getloop.ts +8 -7
  19. package/src/modules/{tasktool/plugins/goal-template.ts → promptplug/plugins/goal-prompt.ts} +57 -4
  20. package/src/modules/promptplug/plugins/goal-shape.ts +17 -0
  21. package/src/modules/promptplug/plugins/goalhint.ts +22 -9
  22. package/src/modules/promptplug/plugins/timecheck.ts +25 -14
  23. package/src/modules/promptplug/registry.ts +3 -3
  24. package/src/modules/promptplug/template-store.ts +145 -0
  25. package/src/modules/tasktool/delivery.ts +231 -0
  26. package/src/modules/tasktool/get.ts +2 -2
  27. package/src/modules/tasktool/plugins/taskgoal-store.ts +28 -22
  28. package/src/modules/tasktool/plugins/timegoal-task-store.ts +70 -5
  29. package/src/modules/tasktool/plugins/waitgoal-config.ts +1 -25
  30. package/src/modules/tasktool/plugins/waitgoal.ts +0 -4
  31. package/src/modules/tasktool/preview.ts +3 -4
  32. package/src/modules/tasktool/wait.ts +16 -284
  33. package/src/modules/templates/actions/templates-default.ts +2 -5
  34. package/src/modules/templates/actions/templates-update.ts +1 -3
  35. package/src/modules/templates/service.ts +11 -13
  36. package/src/modules/templates/support.ts +0 -15
  37. package/src/web/frontend/App.tsx +0 -12
  38. package/src/web/frontend/api/cli-tree.json +58 -0
  39. package/src/web/frontend/api/client.generated.ts +32 -2
  40. package/src/web/frontend/components/doc/doc-head.tsx +13 -4
  41. package/src/web/frontend/components/icons.tsx +9 -199
  42. package/src/web/frontend/components/md/live-block.tsx +1 -5
  43. package/src/web/frontend/components/md/md-panes-root.tsx +0 -4
  44. package/src/web/frontend/components/md/md-panes.tsx +1 -11
  45. package/src/web/frontend/components/md/tool-bar.tsx +9 -0
  46. package/src/web/frontend/components/sidebar/index.tsx +13 -2
  47. package/src/web/frontend/components/sidebar/model.ts +3 -0
  48. package/src/web/frontend/components/tool-acts/bar.tsx +40 -29
  49. package/src/web/frontend/components/tool-acts/layout-panel.tsx +7 -3
  50. package/src/web/frontend/components/tool-acts/modules.ts +53 -51
  51. package/src/web/frontend/components/tool-acts/style.css +7 -3
  52. package/src/web/frontend/modules/md/styles/docs.css +0 -7
  53. package/src/web/frontend/modules/md/styles/editor.css +0 -17
  54. package/src/web/frontend/modules/md/styles/shell.css +3 -0
  55. package/src/web/frontend/modules/md/use-templates.ts +3 -13
  56. package/src/web/frontend/page/dir/index.tsx +3 -15
  57. package/src/web/frontend/page/dir/task-actions.ts +1 -16
  58. package/src/web/frontend/page/dir/task.tsx +2 -16
  59. package/src/web/frontend/page/group/index.tsx +6 -19
  60. package/src/web/frontend/page/repos/branch-persist.ts +32 -0
  61. package/src/web/frontend/page/repos/icons.tsx +47 -229
  62. package/src/web/frontend/page/repos/index.tsx +12 -8
  63. package/src/web/frontend/page/repos/repo-table.tsx +24 -3
  64. package/src/web/frontend/page/settings/api.ts +20 -0
  65. package/src/web/frontend/page/settings/index.tsx +1 -1
  66. package/src/web/frontend/page/settings/prompt-template-editor.tsx +180 -0
  67. package/src/web/frontend/page/settings/prompt-templates-section.tsx +39 -34
  68. package/src/web/frontend/page/settings/style.css +30 -0
  69. package/src/web/frontend/page/templates/index.tsx +5 -54
  70. package/src/web/frontend/page/templates/manage.tsx +1 -5
  71. package/src/web/frontend/page/templates/style.css +1 -43
  72. package/src/web/frontend/page/templates/template-list.tsx +7 -15
  73. package/src/web/frontend/routes/route-eq.ts +2 -3
  74. package/src/web/frontend/routes/static.ts +2 -2
  75. package/src/web/frontend/routes/templates.ts +0 -10
  76. package/src/web/frontend/styles/repos.css +22 -0
  77. package/src/web/frontend/styles-v2/shell.css +7 -0
  78. package/src/web/frontend/svghub/catalog-act.ts +168 -0
  79. package/src/web/frontend/svghub/catalog-doc.ts +102 -0
  80. package/src/web/frontend/svghub/catalog-nav.ts +192 -0
  81. package/src/web/frontend/svghub/catalog-repo.ts +102 -0
  82. package/src/web/frontend/svghub/catalog-state.ts +70 -0
  83. package/src/web/frontend/svghub/icon.tsx +95 -0
  84. package/src/web/frontend/svghub/index.ts +66 -0
  85. package/src/web/frontend/svghub/serialize.ts +39 -0
  86. package/src/web/frontend/svghub/types.ts +67 -0
  87. package/src/web/frontend/types.ts +2 -1
  88. package/src/web/public/assets/app-context-BqCBcDsx.js +1 -0
  89. package/src/web/public/assets/bar-Dc5Tq1eE.js +1 -0
  90. package/src/web/public/assets/{button-BEWXOABr.js → button-3JlUeln_.js} +1 -1
  91. package/src/web/public/assets/{composer-launch-DRi9mZE1.js → composer-launch-fp2IzGzQ.js} +1 -1
  92. package/src/web/public/assets/{composer-panel-swmDqlPw.js → composer-panel-Dh681iO6.js} +1 -1
  93. package/src/web/public/assets/dag-DnaU0I_z.js +1 -0
  94. package/src/web/public/assets/dir-d16q1GLe.js +3 -0
  95. package/src/web/public/assets/doc-DRSKD0Re.js +6 -0
  96. package/src/web/public/assets/group-Dc3ZgW24.js +1 -0
  97. package/src/web/public/assets/index-BIVxGd6t.css +1 -0
  98. package/src/web/public/assets/index-Bg0m8gbJ.js +2 -0
  99. package/src/web/public/assets/{list-filter-D-x94TvA.js → list-filter-CWxiOSg_.js} +1 -1
  100. package/src/web/public/assets/md-history-CLIs9Dr0.css +1 -0
  101. package/src/web/public/assets/md-history-DNtgaIdH.js +39 -0
  102. package/src/web/public/assets/{member-picker-Cvbv24IK.js → member-picker-BZgE3HGb.js} +1 -1
  103. package/src/web/public/assets/model-CtG2jIDv.js +2 -0
  104. package/src/web/public/assets/{overview-CctJfO3D.js → overview-C68QpcT9.js} +1 -1
  105. package/src/web/public/assets/popup-DZ2Khv2c.js +1 -0
  106. package/src/web/public/assets/progress-CEmAFxo9.js +3 -0
  107. package/src/web/public/assets/refs-TzxZYy7T.js +2 -0
  108. package/src/web/public/assets/repo-form-modal-Dg3hJWUV.js +1 -0
  109. package/src/web/public/assets/repos-uNqSR5YB.js +12 -0
  110. package/src/web/public/assets/{route-crumb-BcDPd7Ht.js → route-crumb-C4DgkJ8G.js} +1 -1
  111. package/src/web/public/assets/{settings-Cc6puKd5.css → settings-BWHjNegB.css} +1 -1
  112. package/src/web/public/assets/settings-BzIllshQ.js +1 -0
  113. package/src/web/public/assets/{status-tag-BD_0iWMB.js → status-tag-8cLH8hl9.js} +1 -1
  114. package/src/web/public/assets/task-DuFOXLPC.js +11 -0
  115. package/src/web/public/assets/{task-row-CQgzQmzu.js → task-row-CRjuAfKW.js} +1 -1
  116. package/src/web/public/assets/{task-utils-bJH1-Cjy.js → task-utils-DAPxKm4c.js} +1 -1
  117. package/src/web/public/assets/templates-CwYDIBYn.css +1 -0
  118. package/src/web/public/assets/templates-DNiGvmdq.js +10 -0
  119. package/src/web/public/assets/{use-rail-drag-ufwy2XZB.js → use-rail-drag-DxIYcszo.js} +1 -1
  120. package/src/web/public/assets/{workspace-D3jbcTwf.js → workspace-DojQ3RP4.js} +2 -2
  121. package/src/web/public/index.html +15 -16
  122. package/src/web/frontend/modules/md/fill-session.ts +0 -36
  123. package/src/web/frontend/modules/md/new-task-from-template.ts +0 -22
  124. package/src/web/frontend/modules/md/task-intent.ts +0 -29
  125. package/src/web/frontend/modules/prompts/render-template-body.ts +0 -14
  126. package/src/web/frontend/modules/prompts/template-preview.ts +0 -62
  127. package/src/web/frontend/page/templates/fill.tsx +0 -124
  128. package/src/web/public/assets/app-context-DDQnrPSP.js +0 -1
  129. package/src/web/public/assets/bar-j14ON7uZ.js +0 -1
  130. package/src/web/public/assets/dag-BzdFYMml.js +0 -1
  131. package/src/web/public/assets/dir-DhsB1ZhL.js +0 -3
  132. package/src/web/public/assets/doc-D4po3sDc.js +0 -6
  133. package/src/web/public/assets/fill-session-fHxQHFaD.js +0 -1
  134. package/src/web/public/assets/group-BxmSNzIB.js +0 -1
  135. package/src/web/public/assets/index-CMjG5NVU.js +0 -2
  136. package/src/web/public/assets/index-uMjSWNVr.css +0 -1
  137. package/src/web/public/assets/md-history-1h2zairf.css +0 -1
  138. package/src/web/public/assets/md-history-CZUF_FhN.js +0 -39
  139. package/src/web/public/assets/model-Cc2EoUQp.js +0 -2
  140. package/src/web/public/assets/new-task-from-template-DDWu4yR4.js +0 -1
  141. package/src/web/public/assets/popup-D8KWI6-Q.js +0 -1
  142. package/src/web/public/assets/progress-CawQRCQf.js +0 -3
  143. package/src/web/public/assets/refs-TuuoaRs7.js +0 -2
  144. package/src/web/public/assets/render-template-body-bXdedFig.js +0 -1
  145. package/src/web/public/assets/repo-form-modal-BD4N37MI.js +0 -1
  146. package/src/web/public/assets/repos-BPeuX4N9.js +0 -12
  147. package/src/web/public/assets/settings-CZJaKLZW.js +0 -1
  148. package/src/web/public/assets/task-DgbbF5gy.js +0 -11
  149. package/src/web/public/assets/task-intent-CX5DZccN.js +0 -1
  150. package/src/web/public/assets/templates-CBXlwyof.js +0 -11
  151. package/src/web/public/assets/templates-plA8R7jJ.css +0 -1
@@ -0,0 +1,145 @@
1
+ // 段模板的用户数据(#161):每段可有多条模板,启用哪条自己挑。
2
+ //
3
+ // 真相仍是插件类里的 `templates`(出厂内置,代码即真相);这里只存**用户层**:
4
+ // - items:用户添加/复制的模板条目(builtin 永远在插件类里,不落盘)
5
+ // - activeId:该段当前启用的模板('builtin' 或用户条目 id)
6
+ //
7
+ // 为什么 JSON 而不是 DB:段模板是**显示态偏好**(跟侧边栏 prefs 同级),不是
8
+ // 业务数据——换库不迁移、跨机器不同步都可接受;JSON 一个文件看得见摸得着。
9
+ // localStorage 缺席的是浏览器端;这是宿主端文件,用 APP_DIR 落盘。
10
+ //
11
+ // 并发:单进程 serve 读写足够;写入走临时文件 + rename 原子替换。
12
+ import { existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from 'node:fs';
13
+ import { join } from 'node:path';
14
+ import { APP_DIR } from '../../core/paths.js';
15
+ import type { TemplateText } from './base.js';
16
+
17
+ const FILE = join(APP_DIR, 'promptplug-templates.json');
18
+
19
+ export interface UserTemplate extends TemplateText {
20
+ /** 创建时间(epoch ms;排序/展示用) */
21
+ createdAt: number;
22
+ }
23
+
24
+ /** 某一段的用户层模板数据。 */
25
+ export interface SegmentTemplates {
26
+ /** 当前启用的模板 id('builtin' = 出厂第一条;缺省 = builtin) */
27
+ activeId: string;
28
+ /** 用户条目(出厂 builtin 不在内) */
29
+ items: UserTemplate[];
30
+ }
31
+
32
+ const DEFAULT_SEGMENT: SegmentTemplates = { activeId: 'builtin', items: [] };
33
+
34
+ type Store = Record<string, SegmentTemplates>;
35
+
36
+ function readStore(): Store {
37
+ try {
38
+ if (!existsSync(FILE)) return {};
39
+ const raw = JSON.parse(readFileSync(FILE, 'utf8')) as Store;
40
+ if (!raw || typeof raw !== 'object') return {};
41
+ // 外部数据边界:逐段校验后才收(脏段丢掉用默认)
42
+ const out: Store = {};
43
+ for (const [id, seg] of Object.entries(raw)) {
44
+ if (!seg || typeof seg !== 'object') continue;
45
+ const items = Array.isArray((seg as SegmentTemplates).items)
46
+ ? (seg as SegmentTemplates).items.filter(
47
+ (t) => t && typeof t.text === 'string' && typeof t.id === 'string' && t.id !== 'builtin',
48
+ )
49
+ : [];
50
+ out[id] = {
51
+ activeId: typeof (seg as SegmentTemplates).activeId === 'string' ? (seg as SegmentTemplates).activeId : 'builtin',
52
+ items,
53
+ };
54
+ }
55
+ return out;
56
+ } catch {
57
+ return {}; // 损坏不炸宿主:全部回落 builtin
58
+ }
59
+ }
60
+
61
+ function writeStore(store: Store): void {
62
+ try {
63
+ mkdirSync(APP_DIR, { recursive: true });
64
+ const tmp = `${FILE}.tmp`;
65
+ writeFileSync(tmp, JSON.stringify(store, null, 2), 'utf8');
66
+ renameSync(tmp, FILE);
67
+ } catch {
68
+ // 落盘失败不炸宿主(只读盘 / 隐私目录等):本次修改内存可见,重启即失
69
+ }
70
+ }
71
+
72
+ /** 某段的用户层模板数据(无记录 → 默认:启用 builtin、无条目)。 */
73
+ export function segmentTemplatesOf(id: string): SegmentTemplates {
74
+ const seg = readStore()[id];
75
+ return seg ? { ...seg, items: [...seg.items] } : { ...DEFAULT_SEGMENT, items: [] };
76
+ }
77
+
78
+ /** 全部段的用户层模板数据(设置页一次拉全)。 */
79
+ export function allSegmentTemplates(): Record<string, SegmentTemplates> {
80
+ return readStore();
81
+ }
82
+
83
+ export interface UpsertTemplateInput {
84
+ /** 段(插件 id) */
85
+ segment: string;
86
+ /** 条目 id;缺 = 新建 */
87
+ id?: string;
88
+ name?: string;
89
+ text: string;
90
+ }
91
+
92
+ /** 添加 / 更新一条用户模板;返回该段最新数据。 */
93
+ export function upsertTemplate({ segment, id, name, text }: UpsertTemplateInput): SegmentTemplates {
94
+ const store = readStore();
95
+ const seg = store[segment] || { ...DEFAULT_SEGMENT, items: [] };
96
+ const body = String(text ?? '');
97
+ const title = String(name ?? '').trim() || '未命名模板';
98
+ const now = Date.now();
99
+ const key = id && !String(id).startsWith('u_') && id !== 'builtin' ? `u_${id}` : String(id ?? '');
100
+ const hit = key ? seg.items.find((t) => t.id === key) : undefined;
101
+ if (hit) {
102
+ hit.name = title;
103
+ hit.text = body;
104
+ if (seg.activeId === hit.id) seg.activeId = hit.id; // 编辑启用中的模板即时生效
105
+ } else {
106
+ const nid = `u_${now.toString(36)}_${Math.random().toString(36).slice(2, 6)}`;
107
+ seg.items.push({ id: nid, name: title, text: body, createdAt: now });
108
+ seg.activeId = nid; // 新建即启用(复制后修改的直感)
109
+ }
110
+ store[segment] = seg;
111
+ writeStore(store);
112
+ return { ...seg, items: [...seg.items] };
113
+ }
114
+
115
+ /** 删除一条用户模板;删的是启用条目时回落 builtin。 */
116
+ export function deleteTemplate(segment: string, id: string): SegmentTemplates {
117
+ const store = readStore();
118
+ const seg = store[segment];
119
+ if (seg) {
120
+ seg.items = seg.items.filter((t) => t.id !== id);
121
+ if (seg.activeId === id) seg.activeId = 'builtin';
122
+ store[segment] = seg;
123
+ writeStore(store);
124
+ }
125
+ return segmentTemplatesOf(segment);
126
+ }
127
+
128
+ /** 切换某段启用的模板('builtin' 或用户条目 id;非法 id 静默回落 builtin)。 */
129
+ export function activateTemplate(segment: string, id: string): SegmentTemplates {
130
+ const store = readStore();
131
+ const seg = store[segment] || { ...DEFAULT_SEGMENT, items: [] };
132
+ const key = String(id ?? '') || 'builtin';
133
+ seg.activeId = key === 'builtin' || seg.items.some((t) => t.id === key) ? key : 'builtin';
134
+ store[segment] = seg;
135
+ writeStore(store);
136
+ return { ...seg, items: [...seg.items] };
137
+ }
138
+
139
+ /** 某段当前**启用模板的正文**(装配时传给插件构造;builtin → '' 用类内默认)。 */
140
+ export function activeTemplateTextOf(id: string): string {
141
+ const seg = readStore()[id];
142
+ if (!seg || seg.activeId === 'builtin') return '';
143
+ const hit = seg.items.find((t) => t.id === seg.activeId);
144
+ return hit ? String(hit.text ?? '') : '';
145
+ }
@@ -0,0 +1,231 @@
1
+ // tasktool/delivery.ts —— 交付宿主:领域取数 → Supply → promptplug 的 assembleDelivery。
2
+ //
3
+ // #227 重构:从 wait.ts 拆出。wait.ts 只剩阻塞编排(跨进程轮询 / goal 到点收尾 /
4
+ // 面板随行),本文件专管「交付一条任务时要把哪些领域数据取齐」:
5
+ // ① 附件标注(annotateTaskDelivery → attachTemplateCtx)
6
+ // ② 任务级 timegoal 起表(领取即计时;preview 走只读版)
7
+ // ③ 组上下文(readGroupContext,按正文 frontmatter 的 board 决定组材料)
8
+ // ④ 目录级 goal 上下文(readGoalCtx)+ 时间运算字段补齐(enrichGoalTiming)
9
+ // ⑤ 队列余量(pendingQueueInfo)
10
+ // 之后把数据装进 DeliveryHostData,调 promptplug/delivery.ts 的 assembleDelivery
11
+ // 完成组装——模板正文、变量、三链合并、渲染全部在 promptplug。
12
+ // 任何异常都降级为「只回任务」——wait 绝不能因渲染挂掉(fail-open 纪律)。
13
+ //
14
+ // preview / trace(任务 #65「预览 get 提示词」):
15
+ // preview=true → **零副作用**:不启动任务级 timegoal 计时、不写库、不领取;
16
+ // timegoal 的 check 指令用声明现算(与真实领取同一份)。其余渲染路径与真实领取
17
+ // 完全同一条代码,所以预览出来的字符串就是 agent 会拿到的那一份。
18
+ // trace=[] → 按顺序记下每一段的来源(谁贡献的、开关是否开着),供面板展示
19
+ // 「这段是哪来的」。真实领取不传 trace,行为与改造前逐字节一致。
20
+ import { formatDuration, formatGoalTiming } from '../../core/instruction-template.js';
21
+ import { parseFrontmatter } from '../../shared/frontmatter.js';
22
+ import { getSettings, isGlobalKey, pendingQueueInfo } from '../localtask/service.js';
23
+ import { assembleDelivery, type AssembledDelivery } from '../promptplug/delivery.js';
24
+ import { annotateTaskDelivery, attachTemplateCtx } from './attach.js';
25
+ import { readGroupContext } from './groupctx.js';
26
+ import { ensureTaskGoal, previewTaskGoal } from './taskgoal.js';
27
+ import * as timegoal from './timegoal.js';
28
+
29
+ export interface DeliveryOptions {
30
+ source?: string;
31
+ summary?: unknown;
32
+ cwd?: unknown;
33
+ name?: unknown;
34
+ topicKey?: unknown;
35
+ params?: Record<string, string>;
36
+ preview?: boolean;
37
+ trace?: import('../promptplug/compose.js').RenderTraceEntry[];
38
+ getLoopEnabled?: boolean;
39
+ getLoopWaitMinutes?: number;
40
+ }
41
+
42
+ // 「YYYY-MM-DD HH:mm:ss」→ epoch ms(任务级 goal 的起点 = consumedAt);解析不了返回 NaN
43
+ function parseStampMs(v: unknown): number {
44
+ const m = /^(\d{4})-(\d{2})-(\d{2})[ T](\d{2}):(\d{2}):(\d{2})$/.exec(String(v || ''));
45
+ if (!m) return NaN;
46
+ return new Date(Number(m?.[1]), Number(m?.[2]) - 1, Number(m?.[3]), Number(m?.[4]), Number(m?.[5]), Number(m?.[6])).getTime();
47
+ }
48
+
49
+ // goal 上下文的**时间运算字段**统一在这里补齐(任务 #82:模板层要能拿剩余/超时做运算,
50
+ // 不能只有人话的 remainingHuman)。目录级 show 自带 reached/remainingSec/overtimeSec;
51
+ // 任务级只有 deadline 戳——同式解析补算。缺哪个补哪个,已有的不覆盖。
52
+ export function enrichGoalTiming(g: any): any {
53
+ if (!g) return g;
54
+ let { remainingSec, overtimeSec, reached } = g;
55
+ remainingSec = Number(remainingSec);
56
+ overtimeSec = Number(overtimeSec);
57
+ if (!Number.isFinite(remainingSec) && !Number.isFinite(overtimeSec)) {
58
+ const ms = parseStampMs(g.deadline);
59
+ if (Number.isFinite(ms)) {
60
+ const diff = Math.round((ms - Date.now()) / 1000);
61
+ remainingSec = diff >= 0 ? diff : 0;
62
+ overtimeSec = diff >= 0 ? 0 : -diff;
63
+ }
64
+ }
65
+ if (reached === undefined) {
66
+ if (Number.isFinite(overtimeSec)) reached = overtimeSec > 0;
67
+ else if (Number.isFinite(remainingSec)) reached = remainingSec <= 0;
68
+ }
69
+ if (Number.isFinite(remainingSec)) {
70
+ g.remainingSec = remainingSec;
71
+ g.remainingMin = Math.ceil(remainingSec / 60);
72
+ }
73
+ if (Number.isFinite(overtimeSec)) g.overtimeSec = overtimeSec;
74
+ if (reached !== undefined) g.reached = reached;
75
+ // 任务 #87:模板里要能直接写「持续 {{goal.durationHuman}}」——人话时长统一在这里补。
76
+ if (Number.isFinite(Number(g.durationSec)) && Number(g.durationSec) > 0) {
77
+ g.durationHuman = g.durationHuman || formatDuration(Number(g.durationSec));
78
+ }
79
+ if (Number.isFinite(Number(g.elapsedSec))) {
80
+ g.elapsedHuman = g.elapsedHuman || formatDuration(Number(g.elapsedSec));
81
+ }
82
+ return g;
83
+ }
84
+
85
+ // wait/get **返回时刻**的目标上下文(渲染 instruction 用)。fail-open:加载失败 /
86
+ // 读不到 / 没目标 / 出错 → null,instruction 照常渲染(goal 段被整段丢弃)。
87
+ // 绝不写盘:showTimegoal 走 loadRecycledStore({persist:false})——timegoals.json
88
+ // 字节数不变,goal-expiry 单测字节比对钉着。
89
+ async function readGoalCtx(cwd: unknown): Promise<Record<string, any> | null> {
90
+ if (!cwd || isGlobalKey(cwd)) return null; // cwd 是路径,isGlobalKey 恒 false——纯防御
91
+ try {
92
+ const show = await timegoal.showTimegoal({ cwd });
93
+ if (!show || !show.hasGoal) return null;
94
+ const g = show.goal || {};
95
+ return {
96
+ name: g.name || show.name || '',
97
+ deadline: g.deadline || '',
98
+ prompt: g.prompt || '',
99
+ reached: !!show.reached,
100
+ remainingSec: show.remainingSec,
101
+ overtimeSec: show.overtimeSec,
102
+ remainingHuman: formatGoalTiming({
103
+ reached: show.reached,
104
+ remainingSec: show.remainingSec,
105
+ overtimeSec: show.overtimeSec,
106
+ }),
107
+ };
108
+ } catch {
109
+ return null;
110
+ }
111
+ }
112
+
113
+ // 组装 wait/get 返回的任务载荷 + 指令。**单一路径**:
114
+ // 所有段落(上下文 / 附件 / 时间目标 / ack / 持续 get)一律进返回载荷的
115
+ // instruction 字段;task.text 始终是库存原文,绝不把系统提示词拼进正文。
116
+ // 旧 rule 区块已删除:done 指令与收尾要求统一由 ack 区块承载。
117
+ export async function buildTaskDelivery(
118
+ task: any,
119
+ { source, summary, cwd, name, topicKey, params, preview = false, trace, getLoopEnabled = false, getLoopWaitMinutes = 0 }: DeliveryOptions = {},
120
+ ): Promise<Record<string, any>> {
121
+ // 附件标注(任务 #15:正文里的 ![名](fileId) 嵌入 → 附件清单 + 本地路径)。
122
+ // fail-open:标注失败绝不拖垮交付;正文没有引用时 annotateTaskDelivery 返回
123
+ // null,载荷与改造前**逐字节一致**(与 localtask 读任务的同一条纪律)。
124
+ let att: any = null;
125
+ try {
126
+ // inlineDocs(#162):文档资料绑定(role=doc)随交付带全文——只读盘(自有树 /
127
+ // 绑定闭包),预览同样安全;读不到内容留空,不阻断交付。
128
+ const a = await annotateTaskDelivery(task, { topicKey, inlineDocs: true });
129
+ if (a) {
130
+ task = a.task;
131
+ att = a;
132
+ }
133
+ } catch {
134
+ /* 标注失败照常交付(agent 还能从正文里的嵌入自行处理) */
135
+ }
136
+ try {
137
+ // 任务级 timegoal(发布带 --duration):**领取即计时**——这里起表(幂等),
138
+ // goal 上下文换成任务级(prompt = check 指令,固化进 timegoal 存储,之后每轮原文回显)。
139
+ // 目录级 goal 仍作兜底:任务没带时间目标时,渲染等待方目录的目标状态。
140
+ let taskGoalCtx: any = null;
141
+ if (task && task.timegoal && topicKey) {
142
+ const title = (String(task.text || '')
143
+ .split('\n')
144
+ .map((l) => l.trim())
145
+ .find(Boolean) || `任务 #${task.id}`).slice(0, 40);
146
+ // 预览走只读版本:同一份 check 指令文本,但不落盘、不起表
147
+ taskGoalCtx = preview
148
+ ? await previewTaskGoal({ topicKey, taskId: task.id, cwd, name: title, timegoal: task.timegoal, text: task.text })
149
+ : await ensureTaskGoal({
150
+ topicKey,
151
+ taskId: task.id,
152
+ cwd,
153
+ name: title,
154
+ text: task.text,
155
+ timegoal: task.timegoal,
156
+ startedAtMs: parseStampMs(task.consumedAt) || undefined,
157
+ });
158
+ }
159
+ const goal = enrichGoalTiming(taskGoalCtx || (await readGoalCtx(cwd)));
160
+
161
+ // 项目组上下文(组概念 + 本项目位置 + 兄弟成员 + 参考文件地址):只进 instruction。
162
+ // #64 作用域:组材料只挂**组任务**(正文 frontmatter 带 board);单 repo 主题里
163
+ // 提交的纯项目任务只带项目介绍,不把所属组的材料挂进来。
164
+ const boardMark = String(parseFrontmatter(String((task && task.text) || '')).board || '').trim();
165
+ const groupCtx = await readGroupContext(cwd as string, { board: boardMark });
166
+ const settings: any = (await getSettings().catch(() => null)) || {};
167
+
168
+ // ── 插件化组装(promptplug):宿主完成领域取数,插件 data() 做同步变换 ──
169
+ // 任务级 goal → 完整 check 指令;目录级 goal → 状态行(二者都进 timecheck 段)。
170
+ const goalCheck = taskGoalCtx ? taskGoalCtx.prompt : null;
171
+ const goalStatus = !taskGoalCtx && goal
172
+ ? `〔时间目标「${goal.name || ''}」${goal.remainingHuman || ''}〕`
173
+ : null;
174
+ const goalCtx = goal
175
+ ? {
176
+ ...goal,
177
+ // 任务 #87:goal.extra(附加要求,领取后可动态改)与 goalKey 供模板直接引用
178
+ extra: taskGoalCtx ? taskGoalCtx.extra || '' : '',
179
+ goalKey: taskGoalCtx ? taskGoalCtx.goalKey || '' : '',
180
+ check: goalCheck || '',
181
+ statusLine: goalStatus || '',
182
+ }
183
+ : null;
184
+ const attach = att ? attachTemplateCtx(att.task.attachments).attach : null;
185
+
186
+ // ext(队列余量):同主题还有多少待领取任务 + 标题。现算(同主题一次读取);
187
+ // 读取失败不阻断领取:按缺失处理,并把原因记进 renderWarnings。
188
+ let queueInfo: { topic: string; count: number; list: { id: number; title: string }[] } | null = null;
189
+ const hostWarnings: import('../promptplug/compose.js').RenderWarning[] = [];
190
+ try {
191
+ const q = await pendingQueueInfo(topicKey as string, task && task.id);
192
+ if (q && q.count > 0) queueInfo = { topic: q.topic, count: q.count, list: q.list };
193
+ } catch (e) {
194
+ hostWarnings.push({
195
+ block: 'ext',
196
+ label: '待领取队列(ext)',
197
+ message: String((e as Error).message || e).replace(/\s+/g, ' ').trim(),
198
+ });
199
+ }
200
+
201
+ const delivery: AssembledDelivery = await assembleDelivery({
202
+ task,
203
+ attachCtx: attach,
204
+ goalCtx,
205
+ groupCtx,
206
+ queueInfo,
207
+ getLoopEnabled,
208
+ getLoopWaitMinutes,
209
+ params,
210
+ appendMode: settings.appendMode,
211
+ source: source || '',
212
+ summary,
213
+ cwd,
214
+ name,
215
+ hostWarnings,
216
+ trace,
217
+ });
218
+ const warnField = delivery.renderWarnings.length ? { renderWarnings: delivery.renderWarnings } : {};
219
+ if (!delivery.instruction) {
220
+ return { task, ...warnField };
221
+ }
222
+ return {
223
+ task,
224
+ instruction: delivery.instruction,
225
+ coversBody: delivery.coversBody,
226
+ ...warnField,
227
+ };
228
+ } catch {
229
+ return { task };
230
+ }
231
+ }
@@ -13,7 +13,7 @@
13
13
  // 唯一合法出口是 timeout);get = 「领活」(kv-localget 的语义,项目开启持续
14
14
  // get 后由系统负责把循环指令带进交付文本,agent 不用自己记)。
15
15
  import { waitForTask } from './wait.js';
16
- import { getLoopForCwd, getLoopInstruction, type GetLoopState } from './getloop.js';
16
+ import { getLoopForCwd, type GetLoopState } from './getloop.js';
17
17
 
18
18
  export interface GetTaskOptions {
19
19
  cwd?: string;
@@ -44,7 +44,7 @@ export async function getTask({ cwd, timeoutSec, open = true, params, instant }:
44
44
  open,
45
45
  instant: instant === undefined ? (explicitWait ? false : !loop.enabled || minutes <= 0) : !!instant,
46
46
  params: params || {}, // 外部参数(平面扩展)进交付模板
47
- getLoopTpl: getLoopInstruction(loop),
47
+ getLoopEnabled: !!loop.enabled,
48
48
  getLoopWaitMinutes: minutes,
49
49
  });
50
50
  if (r.status !== 'ok' || !r.task) return r;
@@ -16,11 +16,12 @@
16
16
  // 本文件不依赖 localtask(纯 timegoal 存储 + core),localtask 反过来引用这里。
17
17
  import { badInput } from '../../../core/errors.js';
18
18
  import {
19
- TASK_GOAL_PROMPT_TEMPLATE,
20
- renderTaskGoalPrompt,
19
+ customGoalPromptOf,
20
+ renderCustomGoalPrompt,
21
21
  taskGoalTemplateCtx,
22
- } from './goal-template.js';
22
+ } from '../../promptplug/plugins/goal-prompt.js';
23
23
  import { MAX_PROMPT, parseDuration, startTaskGoal, taskGoalState, taskGoalKey, recordTaskCheck } from './timegoal-store.js';
24
+ import { checkHistoryOfTask } from './timegoal-task-store.js';
24
25
 
25
26
  export interface TaskGoalDeclaration {
26
27
  duration?: unknown;
@@ -73,8 +74,10 @@ export async function ensureTaskGoal(p: EnsureTaskGoalParams = {}): Promise<Reco
73
74
  return null;
74
75
  }
75
76
  const goalKey = taskGoalKey(topicKey, taskId);
76
- // 落库的是**模板**(占位符保留),交付时用领取那一刻的 ctx 渲染。
77
- const promptTemplate = TASK_GOAL_PROMPT_TEMPLATE;
77
+ // #161:出厂指令正文搬进 timecheck 段模板(所见即所得,设置页可编辑)。
78
+ // goals.prompt 只存**用户自定义**(timegoal set/update --prompt)——落库出厂
79
+ // 原文会让「段模板编辑」对这些行永远失效(段模板被 goal.check 双层遮住)。
80
+ const promptTemplate = '';
78
81
  const r = await startTaskGoal({
79
82
  topicKey,
80
83
  taskId,
@@ -96,15 +99,22 @@ export async function ensureTaskGoal(p: EnsureTaskGoalParams = {}): Promise<Reco
96
99
  startedAt: g.startedAt || g.started_at,
97
100
  deadline: g.deadline,
98
101
  nowMs: Date.now(),
102
+ history: checkHistoryOfTask(taskId),
99
103
  });
100
104
  return {
101
105
  name: g.name,
102
106
  deadline: g.deadline,
103
- // check 指令用同一套模板渲染:之后每轮 check 会按当下 ctx 重新渲染(任务 #87)
104
- prompt: renderTaskGoalPrompt(ctx, g.prompt || promptTemplate),
105
- promptTemplate: g.prompt || promptTemplate,
107
+ // #161:只有**用户自定义**的 prompt 才进 goal.check(出厂正文在 timecheck 段模板里,
108
+ // 设置页编辑即生效);每轮 check 会按当下 ctx 重新渲染(任务 #87)。
109
+ prompt: renderCustomGoalPrompt(ctx, g.prompt),
110
+ promptTemplate: customGoalPromptOf(g.prompt),
106
111
  goalKey: g.key || goalKey,
107
112
  durationSec: g.durationSec || durationSec,
113
+ // check 段(进度行)与 doneguard 段在 get 交付里也渲染——时间量 / check 历史按领取当下补齐
114
+ elapsedSec: ctx.goal.elapsedSec,
115
+ remainingSec: ctx.goal.remainingSec,
116
+ sinceLastCheckSec: ctx.goal.sinceLastCheckSec,
117
+ checks: ctx.goal.checks,
108
118
  extra: extra || '',
109
119
  };
110
120
  }
@@ -146,33 +156,29 @@ export async function previewTaskGoal({ topicKey, taskId, name, timegoal, text }
146
156
  startedAt: g.startedAt || g.started_at,
147
157
  deadline: g.deadline,
148
158
  nowMs: Date.now(),
159
+ history: checkHistoryOfTask(taskId),
149
160
  });
150
161
  return {
151
162
  name: g.name || name || `任务 #${taskId}`,
152
163
  deadline: g.deadline || '',
153
- prompt: renderTaskGoalPrompt(ctx, g.prompt),
154
- promptTemplate: g.prompt || '',
164
+ prompt: renderCustomGoalPrompt(ctx, g.prompt),
165
+ promptTemplate: customGoalPromptOf(g.prompt),
155
166
  goalKey: g.key || goalKey,
156
167
  durationSec: g.durationSec || durationSec,
168
+ elapsedSec: ctx.goal.elapsedSec,
169
+ remainingSec: ctx.goal.remainingSec,
170
+ sinceLastCheckSec: ctx.goal.sinceLastCheckSec,
171
+ checks: ctx.goal.checks,
157
172
  extra: timegoal.prompt || '',
158
173
  started: true,
159
174
  };
160
175
  }
161
- const ctx = taskGoalTemplateCtx({
162
- taskId,
163
- taskText: text,
164
- goalKey,
165
- durationSec,
166
- extra: timegoal.prompt,
167
- startedAt: Date.now(),
168
- deadline: Date.now() + durationSec * 1000,
169
- nowMs: Date.now(),
170
- });
176
+ // #161:出厂正文在 timecheck 段模板里——未起表的预览不需要 ctx(prompt 恒空)
171
177
  return {
172
178
  name: name || `任务 #${taskId}`,
173
179
  deadline: '',
174
- prompt: renderTaskGoalPrompt(ctx),
175
- promptTemplate: TASK_GOAL_PROMPT_TEMPLATE,
180
+ prompt: '',
181
+ promptTemplate: '',
176
182
  goalKey,
177
183
  durationSec,
178
184
  extra: timegoal.prompt || '',
@@ -11,9 +11,15 @@ import { db as ltDb } from '../../localtask/repo/open.js';
11
11
  import { nowMs } from '../../../core/db/time.js';
12
12
  import * as goalsRepo from '../../localtask/repo/goals.js';
13
13
  import {
14
+ TASK_GOAL_PROMPT_TEMPLATE,
15
+ customGoalPromptOf,
16
+ renderCustomGoalPrompt,
14
17
  renderTaskGoalPrompt,
15
18
  taskGoalTemplateCtx,
16
- } from './goal-template.js';
19
+ } from '../../promptplug/plugins/goal-prompt.js';
20
+ import type { GoalCheckRecord } from '../../promptplug/plugins/goal-prompt.js';
21
+ import { compose } from '../../promptplug/compose.js';
22
+ import { buildPlugins } from '../../promptplug/factory.js';
17
23
  import {
18
24
  clampDuration,
19
25
  durationLabel,
@@ -178,7 +184,7 @@ export async function checkGoalByKey(rawKey: unknown, { summary: rawSummary }: C
178
184
  const summary = normalizeLogField(rawSummary, 'summary', 2000);
179
185
  const parsed = parseTaskGoalKey(key);
180
186
  if (!parsed) throw badInput('goal key 不合法(应为 task:<topicKey>:<seq>): ' + key);
181
- return tx(
187
+ const payload = await tx(
182
188
  (conn) => {
183
189
  const row = goalsRepo.getGoalRowByTaskKey(parsed.topicKey, parsed.seq, conn);
184
190
  if (!row) {
@@ -200,6 +206,52 @@ export async function checkGoalByKey(rawKey: unknown, { summary: rawSummary }: C
200
206
  },
201
207
  { db: ltDb(), mode: 'IMMEDIATE' }
202
208
  );
209
+ // #161:CLI 的「本轮提示词」与 get 交付**同源**——走 promptplug check 链
210
+ // (timecheck / goalhint 段模板)实时渲染;设置页编辑这些段模板后立即生效。
211
+ // 自定义 prompt 作为 goal.check 进 seed(timecheck 段的 if 分支输出)。
212
+ if (payload && payload.hasGoal !== false && payload.goal) {
213
+ payload.promptRendered = await renderGoalChainPrompt(payload);
214
+ }
215
+ return payload;
216
+ }
217
+
218
+ /**
219
+ * check 链渲染(#161):timecheck / goalhint 段模板按当下 ctx 合并渲染。
220
+ * 链渲染失败(段模板被改坏等)退回出厂指令文本——check 绝不能因为渲染
221
+ * 失败拿不到提示词。
222
+ */
223
+ async function renderGoalChainPrompt(payload: Record<string, any>): Promise<string> {
224
+ const seed = {
225
+ task: payload.task || null,
226
+ goal: { ...(payload.goal || {}), check: payload.promptRendered || '', statusLine: '' },
227
+ };
228
+ try {
229
+ return (await compose({ plugins: buildPlugins('check'), group: 'check', seed })).trim();
230
+ } catch {
231
+ // 段模板被改坏时退回出厂指令文本(TASK_GOAL_PROMPT_TEMPLATE 显式引用)
232
+ return renderTaskGoalPrompt({ task: seed.task, goal: seed.goal }, TASK_GOAL_PROMPT_TEMPLATE);
233
+ }
234
+ }
235
+
236
+ /**
237
+ * 某任务 goal 的**已有**检查流水(旧→新;#161):get 交付 / 预览渲染 goal ctx 时
238
+ * 喂给模板(goal.checks / goal.sinceLastCheckSec)。没起表 → 空数组。
239
+ */
240
+ export function checkHistoryOfTask(taskId: unknown): GoalCheckRecord[] {
241
+ try {
242
+ const row = goalsRepo.getGoalByTask(Number(taskId), ltDb());
243
+ if (!row) return [];
244
+ return (goalsRepo.listChecks(Number(row.id), ltDb()) || []).map((c: any) => ({
245
+ atMs: Number(c.at),
246
+ elapsedSec: Number(c.elapsed_sec) || 0,
247
+ remainingSec: Number(c.remaining_sec) || 0,
248
+ overtimeSec: Number(c.overtime_sec) || 0,
249
+ reached: Number(c.reached) === 1,
250
+ summary: String(c.summary || ''),
251
+ }));
252
+ } catch {
253
+ return []; // 历史读不到不拖垮交付
254
+ }
203
255
  }
204
256
 
205
257
  /** 任务级 check 的共同实现:写一条 goal_checks 流水 + 组装返回(summary 由 normalizeLogField 归一为 string)。 */
@@ -213,6 +265,16 @@ function applyGoalCheck(conn: any, row: any, parsed: { topicKey: string; seq: nu
213
265
  row.state = 'archived';
214
266
  row.updated_at = at;
215
267
  }
268
+ // #161:本轮**之前**的检查流水(append 之前查 = 天然不含本次)——进模板变量域
269
+ // (goal.checks 列表 + goal.sinceLastCheckSec),供「检查太频繁 → 严重警告」分支。
270
+ const history = (goalsRepo.listChecks(Number(row.id), conn) || []).map((c: any) => ({
271
+ atMs: Number(c.at),
272
+ elapsedSec: Number(c.elapsed_sec) || 0,
273
+ remainingSec: Number(c.remaining_sec) || 0,
274
+ overtimeSec: Number(c.overtime_sec) || 0,
275
+ reached: Number(c.reached) === 1,
276
+ summary: String(c.summary || ''),
277
+ }));
216
278
  goalsRepo.appendCheck(conn, {
217
279
  goalId: Number(row.id),
218
280
  atMs: at,
@@ -251,12 +313,15 @@ function applyGoalCheck(conn: any, row: any, parsed: { topicKey: string; seq: nu
251
313
  deadline: row.deadline,
252
314
  nowMs: at,
253
315
  check: { summary, at: checkedAt, count: totalChecks },
316
+ history,
254
317
  });
255
- const promptTemplate = String(row.prompt || '');
318
+ // #161:出厂正文已搬进 timecheck 段模板——goals.prompt 只存用户自定义;
319
+ // 自定义的实时渲染先算好(会作为 goal.check 进链渲染的 seed)。
320
+ const promptTemplate = customGoalPromptOf(row.prompt);
256
321
  return {
257
322
  ...result,
258
- prompt: promptTemplate, // 模板原文(占位符保留)
259
- promptRendered: renderTaskGoalPrompt(ctx, promptTemplate), // 本轮实时渲染(CLI 展示用)
323
+ prompt: promptTemplate, // 自定义模板原文(占位符保留;未自定义 = '')
324
+ promptRendered: renderCustomGoalPrompt(ctx, promptTemplate), // 自定义部分的实时渲染
260
325
  task: { id: taskSeq, text: String((taskRow && taskRow.body) || '') },
261
326
  goal: ctx.goal,
262
327
  summary,
@@ -18,18 +18,7 @@
18
18
  // repos 在模块互依禁列里 → 动态 import(与 localtask→timegoal 探针同一惯例)。
19
19
  import { badInput } from '../../../core/errors.js';
20
20
 
21
- /**
22
- * 持续 get 内文的默认文案(#152 起模板正文的唯一真相是插件类:getloop 插件的内置
23
- * 模板 = `{{#if getloop}}\n<本段>\n{{/if}}`,这里是其中的**内文**,由
24
- * getLoopInstruction() 渲染后作为 loopText 供给插件)。改文案请改插件类。
25
- */
26
- export const DEFAULT_GETLOOP_INSTRUCTION =
27
- '{{#if task}}不要直接结束本轮:完成上面的任务({{task.id}})之后,继续调用 nx-kv localtask get 领取下一条任务。队列里有活会立即返回;{{#if (gt getloop.waitMinutes 0)}}没活时每次最多阻塞 {{getloop.waitMinutes}} 分钟,直到 get 返回 timeout 为止。{{/if}}{{/if}}';
28
-
29
- // 持续 get 内文的默认文案:**唯一来源在本文件**(hook 侧注入 getloop 插件的 loopText),
30
- // 全局「提示词模板 → 持续 get」区块的内置模板与它逐字同源(单测钉住)。
31
- export const DEFAULT_GET_LOOP_TEMPLATE = DEFAULT_GETLOOP_INSTRUCTION;
32
-
21
+ /** 阻塞窗口默认 10 分钟(上限仍受 wait 的 600s 夹制)。#230 起循环文案唯一真相在 getloop 插件类。 */
33
22
  export const GET_LOOP_DEFAULT_MINUTES = 10; // 阻塞窗口默认 10 分钟(上限仍受 wait 的 600s 夹制)
34
23
 
35
24
  /** getLoopForCwd 返回的项目级配置形态(#182 起没有 template:文案归全局区块)。 */
@@ -38,19 +27,6 @@ export interface GetLoopState {
38
27
  waitMinutes?: number;
39
28
  }
40
29
 
41
- /**
42
- * 项目开启「持续 get」→ 交出那段循环指令(交给交付编排当 getloop 区块的内文)。
43
- *
44
- * #182 起**不再读仓库里的自定义模板**:文案只有共享层那一份,用户要改就到
45
- * 设置 → 提示词模板 → 持续 get 区块改(那里是唯一出口)。
46
- *
47
- * @param loop 项目级 getLoop 配置
48
- * @returns 可渲染的模板文本;未开启时返回空串(该区块整段不出现)
49
- */
50
- export function getLoopInstruction(loop: { enabled?: unknown } | null | undefined): string {
51
- if (!loop || !loop.enabled) return '';
52
- return DEFAULT_GET_LOOP_TEMPLATE;
53
- }
54
30
 
55
31
  let reposMod: any = null;
56
32
  async function reposStore(): Promise<any> {
@@ -4,16 +4,12 @@ import {
4
4
  GET_LOOP_DEFAULT_MINUTES,
5
5
  sanitizeGetLoop,
6
6
  getLoopForCwd,
7
- getLoopInstruction,
8
- DEFAULT_GET_LOOP_TEMPLATE,
9
7
  } from './waitgoal-config.js';
10
8
 
11
9
  export {
12
10
  GET_LOOP_DEFAULT_MINUTES,
13
11
  sanitizeGetLoop,
14
12
  getLoopForCwd,
15
- getLoopInstruction,
16
- DEFAULT_GET_LOOP_TEMPLATE,
17
13
  };
18
14
 
19
15
  class WaitGoalPlugin extends BasePlugin {