@zenera/cli 1.1.24 → 1.1.26

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 (199) hide show
  1. package/README.md +65 -0
  2. package/dist/ask.js +28 -5
  3. package/dist/banner.js +2 -2
  4. package/dist/batch.d.ts +6 -0
  5. package/dist/batch.js +76 -1
  6. package/dist/catalog.d.ts +31 -1
  7. package/dist/catalog.js +140 -7
  8. package/dist/commands/index.js +2 -0
  9. package/dist/commands/inspect.d.ts +52 -2
  10. package/dist/commands/inspect.js +220 -31
  11. package/dist/commands/memory.js +156 -32
  12. package/dist/commands/meta.js +333 -24
  13. package/dist/commands/models.js +97 -12
  14. package/dist/commands/open.js +4 -4
  15. package/dist/commands/run.js +38 -4
  16. package/dist/commands/sandbox.js +148 -16
  17. package/dist/commands/view.d.ts +8 -0
  18. package/dist/commands/view.js +114 -0
  19. package/dist/engine.d.ts +8 -1
  20. package/dist/engine.js +7 -0
  21. package/dist/eventlog.d.ts +64 -0
  22. package/dist/eventlog.js +170 -0
  23. package/dist/liveness.d.ts +7 -0
  24. package/dist/liveness.js +35 -3
  25. package/dist/main.js +0 -0
  26. package/dist/meta/editor.d.ts +9 -0
  27. package/dist/meta/editor.js +43 -0
  28. package/dist/meta/finetune/analyze-brief.d.ts +26 -0
  29. package/dist/meta/finetune/analyze-brief.js +131 -0
  30. package/dist/meta/finetune/apply-brief.d.ts +23 -0
  31. package/dist/meta/finetune/apply-brief.js +247 -0
  32. package/dist/meta/finetune/brief.d.ts +45 -0
  33. package/dist/meta/finetune/brief.js +158 -0
  34. package/dist/meta/finetune/children.d.ts +8 -0
  35. package/dist/meta/finetune/children.js +76 -0
  36. package/dist/meta/finetune/command.d.ts +30 -0
  37. package/dist/meta/finetune/command.js +516 -0
  38. package/dist/meta/finetune/cost.d.ts +46 -0
  39. package/dist/meta/finetune/cost.js +105 -0
  40. package/dist/meta/finetune/dataset/anchors.d.ts +41 -0
  41. package/dist/meta/finetune/dataset/anchors.js +239 -0
  42. package/dist/meta/finetune/dataset/changes.d.ts +36 -0
  43. package/dist/meta/finetune/dataset/changes.js +319 -0
  44. package/dist/meta/finetune/dataset/command.d.ts +17 -0
  45. package/dist/meta/finetune/dataset/command.js +1011 -0
  46. package/dist/meta/finetune/dataset/drift.d.ts +33 -0
  47. package/dist/meta/finetune/dataset/drift.js +71 -0
  48. package/dist/meta/finetune/dataset/export.d.ts +26 -0
  49. package/dist/meta/finetune/dataset/export.js +51 -0
  50. package/dist/meta/finetune/dataset/index.d.ts +2 -0
  51. package/dist/meta/finetune/dataset/index.js +2 -0
  52. package/dist/meta/finetune/dataset/sample.d.ts +50 -0
  53. package/dist/meta/finetune/dataset/sample.js +197 -0
  54. package/dist/meta/finetune/dataset/schema.d.ts +33 -0
  55. package/dist/meta/finetune/dataset/schema.js +216 -0
  56. package/dist/meta/finetune/dataset/store.d.ts +35 -0
  57. package/dist/meta/finetune/dataset/store.js +177 -0
  58. package/dist/meta/finetune/dataset/types.d.ts +127 -0
  59. package/dist/meta/finetune/dataset/types.js +39 -0
  60. package/dist/meta/finetune/failure.d.ts +15 -0
  61. package/dist/meta/finetune/failure.js +26 -0
  62. package/dist/meta/finetune/feedback.d.ts +57 -0
  63. package/dist/meta/finetune/feedback.js +104 -0
  64. package/dist/meta/finetune/guard.d.ts +29 -0
  65. package/dist/meta/finetune/guard.js +104 -0
  66. package/dist/meta/finetune/improvements.d.ts +98 -0
  67. package/dist/meta/finetune/improvements.js +501 -0
  68. package/dist/meta/finetune/index.d.ts +2 -0
  69. package/dist/meta/finetune/index.js +2 -0
  70. package/dist/meta/finetune/journal.d.ts +35 -0
  71. package/dist/meta/finetune/journal.js +135 -0
  72. package/dist/meta/finetune/live.d.ts +84 -0
  73. package/dist/meta/finetune/live.js +272 -0
  74. package/dist/meta/finetune/loop.d.ts +3 -0
  75. package/dist/meta/finetune/loop.js +163 -0
  76. package/dist/meta/finetune/memories.d.ts +47 -0
  77. package/dist/meta/finetune/memories.js +154 -0
  78. package/dist/meta/finetune/recheck.d.ts +58 -0
  79. package/dist/meta/finetune/recheck.js +311 -0
  80. package/dist/meta/finetune/report.d.ts +40 -0
  81. package/dist/meta/finetune/report.js +1397 -0
  82. package/dist/meta/finetune/retry.d.ts +24 -0
  83. package/dist/meta/finetune/retry.js +96 -0
  84. package/dist/meta/finetune/sampler.d.ts +18 -0
  85. package/dist/meta/finetune/sampler.js +47 -0
  86. package/dist/meta/finetune/system.d.ts +27 -0
  87. package/dist/meta/finetune/system.js +132 -0
  88. package/dist/meta/finetune/train.d.ts +43 -0
  89. package/dist/meta/finetune/train.js +425 -0
  90. package/dist/meta/finetune/tui.d.ts +16 -0
  91. package/dist/meta/finetune/tui.js +316 -0
  92. package/dist/meta/finetune/tuning.d.ts +193 -0
  93. package/dist/meta/finetune/tuning.js +308 -0
  94. package/dist/meta/finetune/usage.d.ts +66 -0
  95. package/dist/meta/finetune/usage.js +260 -0
  96. package/dist/meta/finetune/view.d.ts +9 -0
  97. package/dist/meta/finetune/view.js +27 -0
  98. package/dist/meta/host.d.ts +15 -0
  99. package/dist/meta/host.js +21 -0
  100. package/dist/meta/index.d.ts +11 -0
  101. package/dist/meta/index.js +11 -0
  102. package/dist/meta/launch.d.ts +81 -0
  103. package/dist/meta/launch.js +286 -0
  104. package/dist/meta/model.d.ts +44 -0
  105. package/dist/meta/model.js +119 -0
  106. package/dist/meta/prompts.d.ts +18 -0
  107. package/dist/meta/prompts.js +61 -0
  108. package/dist/meta/relay.d.ts +20 -0
  109. package/dist/meta/relay.js +123 -0
  110. package/dist/meta/tokens.d.ts +52 -0
  111. package/dist/meta/tokens.js +226 -0
  112. package/dist/meta/window.d.ts +61 -0
  113. package/dist/meta/window.js +198 -0
  114. package/dist/meta/wire.d.ts +42 -0
  115. package/dist/meta/wire.js +129 -0
  116. package/dist/meta.d.ts +71 -1
  117. package/dist/meta.js +303 -6
  118. package/dist/modelref.d.ts +16 -0
  119. package/dist/modelref.js +41 -0
  120. package/dist/narrate.js +5 -2
  121. package/dist/podman.d.ts +26 -0
  122. package/dist/podman.js +83 -3
  123. package/dist/projects.d.ts +0 -5
  124. package/dist/projects.js +2 -15
  125. package/dist/resources.d.ts +215 -0
  126. package/dist/resources.js +856 -0
  127. package/dist/sandbox.d.ts +2 -0
  128. package/dist/sandbox.js +10 -3
  129. package/dist/scaffold.d.ts +15 -7
  130. package/dist/scaffold.js +24 -67
  131. package/dist/session.js +4 -29
  132. package/dist/term.d.ts +2 -0
  133. package/dist/term.js +11 -2
  134. package/dist/trace.d.ts +5 -0
  135. package/dist/trace.js +107 -7
  136. package/dist/tui/app.js +19 -5
  137. package/dist/tui/links.d.ts +27 -0
  138. package/dist/tui/links.js +142 -0
  139. package/dist/tui/models.d.ts +35 -0
  140. package/dist/tui/models.js +447 -0
  141. package/dist/tui/sandbox.d.ts +10 -0
  142. package/dist/tui/sandbox.js +131 -0
  143. package/dist/tui/wrap.d.ts +5 -0
  144. package/dist/tui/wrap.js +12 -0
  145. package/dist/usage.d.ts +78 -0
  146. package/dist/usage.js +51 -0
  147. package/package.json +4 -2
  148. package/templates/editor/.github/copilot-instructions.md +60 -145
  149. package/templates/editor/.github/prompts/analyze.prompt.md +33 -0
  150. package/templates/editor/.github/prompts/dataset.prompt.md +108 -0
  151. package/templates/editor/.github/prompts/finetune-apply.prompt.md +270 -0
  152. package/templates/editor/.github/prompts/finetune.prompt.md +691 -198
  153. package/templates/editor/.github/prompts/new-agent.prompt.md +3 -1
  154. package/templates/editor/.github/prompts/new-skill.prompt.md +2 -0
  155. package/templates/editor/.github/prompts/project-review.prompt.md +5 -4
  156. package/templates/editor/.github/skills/zen-analyze-run/SKILL.md +588 -0
  157. package/templates/editor/.github/skills/zen-cli/SKILL.md +9 -1
  158. package/templates/editor/.github/skills/zen-cli/references/dataset.md +34 -0
  159. package/templates/editor/.github/skills/zen-cli/references/finetune.md +137 -0
  160. package/templates/editor/.github/skills/zen-cli/references/inspect.md +63 -11
  161. package/templates/editor/.github/skills/zen-cli/references/memory.md +33 -10
  162. package/templates/editor/.github/skills/zen-cli/references/meta.md +61 -0
  163. package/templates/editor/.github/skills/zen-cli/references/models.md +5 -1
  164. package/templates/editor/.github/skills/zen-cli/references/projects.md +4 -6
  165. package/templates/editor/.github/skills/zen-cli/references/rag.md +24 -6
  166. package/templates/editor/.github/skills/zen-cli/references/sandbox.md +35 -14
  167. package/templates/editor/.github/skills/zen-code-python/SKILL.md +123 -0
  168. package/templates/editor/.github/skills/zen-code-python/references/code_python.md +48 -0
  169. package/templates/editor/.github/skills/zen-dataset/SKILL.md +253 -0
  170. package/templates/editor/.github/skills/zen-finetune/SKILL.md +1492 -660
  171. package/templates/editor/.github/skills/zen-finetune/references/readme-template.md +268 -0
  172. package/templates/editor/.github/skills/zen-finetune/scripts/batch.mjs +390 -0
  173. package/templates/editor/.github/skills/zen-finetune/scripts/difficult.mjs +243 -0
  174. package/templates/editor/.github/skills/zen-finetune/scripts/memory.mjs +280 -0
  175. package/templates/editor/.github/skills/zen-finetune/scripts/next.mjs +398 -0
  176. package/templates/editor/.github/skills/zen-finetune/scripts/report.mjs +797 -0
  177. package/templates/editor/.github/skills/zen-finetune/scripts/select.mjs +354 -0
  178. package/templates/editor/.github/skills/zen-finetune/scripts/usage.mjs +722 -0
  179. package/templates/editor/.github/skills/zen-inspect/SKILL.md +74 -26
  180. package/templates/editor/.github/skills/zen-inspect-ask/SKILL.md +271 -0
  181. package/templates/editor/.github/skills/zen-instructions/SKILL.md +4 -12
  182. package/templates/editor/.github/skills/zen-memory/SKILL.md +82 -53
  183. package/templates/editor/.github/skills/zen-rag-docs/SKILL.md +20 -8
  184. package/templates/editor/.github/skills/zen-review/SKILL.md +8 -31
  185. package/templates/editor/.github/skills/zen-review/scripts/check-paths.sh +5 -5
  186. package/templates/editor/.github/skills/zen-review/scripts/review.sh +3 -12
  187. package/templates/editor/.github/skills/zen-sandbox/SKILL.md +9 -4
  188. package/templates/editor/.github/skills/zen-sandbox-capacity/SKILL.md +2 -2
  189. package/templates/editor/.github/skills/zen-spec-sync/SKILL.md +2 -4
  190. package/templates/editor/.github/skills/zen-topology/SKILL.md +283 -0
  191. package/templates/editor/.vscode/settings.json +1 -0
  192. package/templates/project/agents/files-instructions.md +29 -20
  193. package/templates/project/agents/fork-instructions.md +78 -28
  194. package/templates/project/agents/memory-instructions.md +222 -494
  195. package/templates/project/agents/tools-instructions.md +14 -4
  196. package/templates/project/gitignore +2 -0
  197. package/templates/editor/.github/skills/zen-finetune/scripts/collect.sh +0 -432
  198. package/templates/editor/.github/skills/zen-finetune/scripts/sample.sh +0 -199
  199. package/templates/editor/.github/skills/zen-memory/scripts/check-instructions.sh +0 -116
@@ -0,0 +1,319 @@
1
+ import { invalidError } from "../../host.js";
2
+ import { canonical, Sources } from "./anchors.js";
3
+ import { anchorText, CONTENT_FIELDS, RESTART_FIELDS, sameAnchor, } from "./types.js";
4
+ const same = (a, b) => canonical(a ?? null) === canonical(b ?? null);
5
+ /**
6
+ * Rubric items keep their ids across edits, so a note saying `r3 failed` still
7
+ * means the same line. An explicit id wins; otherwise the same words are the
8
+ * same item; anything else is new.
9
+ */
10
+ export function assignRubric(before, proposed) {
11
+ const known = new Map(before.map((item) => [item.id, item]));
12
+ const taken = new Set();
13
+ let next = before.reduce((max, item) => Math.max(max, Number(/^r(\d+)$/.exec(item.id)?.[1] ?? 0)), 0);
14
+ const pending = [];
15
+ const out = proposed.map((item, index) => {
16
+ if (item.id && known.has(item.id) && !taken.has(item.id)) {
17
+ taken.add(item.id);
18
+ return { id: item.id, text: item.text };
19
+ }
20
+ pending.push({ index, text: item.text });
21
+ return undefined;
22
+ });
23
+ for (const { index, text } of pending) {
24
+ const match = before.find((item) => !taken.has(item.id) && item.text === text);
25
+ if (match) {
26
+ taken.add(match.id);
27
+ out[index] = { id: match.id, text };
28
+ }
29
+ }
30
+ return out.map((item, index) => {
31
+ if (item) {
32
+ return item;
33
+ }
34
+ let id;
35
+ do {
36
+ id = `r${++next}`;
37
+ } while (taken.has(id));
38
+ taken.add(id);
39
+ return { id, text: proposed[index].text };
40
+ });
41
+ }
42
+ function rubricChanges(before, after) {
43
+ const was = new Map(before.map((i) => [i.id, i.text]));
44
+ const now = new Map(after.map((i) => [i.id, i.text]));
45
+ const out = [];
46
+ for (const [id, text] of now) {
47
+ if (!was.has(id)) {
48
+ out.push({ path: `rubric/${id}`, to: text });
49
+ }
50
+ else if (was.get(id) !== text) {
51
+ out.push({ path: `rubric/${id}`, from: was.get(id), to: text });
52
+ }
53
+ }
54
+ for (const [id, text] of was) {
55
+ if (!now.has(id)) {
56
+ out.push({ path: `rubric/${id}`, from: text });
57
+ }
58
+ }
59
+ if (out.length === 0 &&
60
+ !same(before.map((i) => i.id), after.map((i) => i.id))) {
61
+ out.push({ path: 'rubric', from: before.map((i) => i.id), to: after.map((i) => i.id) });
62
+ }
63
+ return out;
64
+ }
65
+ const withoutHash = (c) => c.source
66
+ ? { file: c.source.file, ...(c.source.anchor ? { anchor: c.source.anchor } : {}) }
67
+ : undefined;
68
+ function fieldChanges(before, after) {
69
+ const out = [];
70
+ for (const field of CONTENT_FIELDS) {
71
+ if (field === 'rubric') {
72
+ out.push(...rubricChanges(before.rubric, after.rubric));
73
+ continue;
74
+ }
75
+ const from = field === 'source' ? withoutHash(before) : before[field];
76
+ const to = field === 'source' ? withoutHash(after) : after[field];
77
+ if (!same(from, to)) {
78
+ out.push({
79
+ path: field,
80
+ ...(from !== undefined ? { from } : {}),
81
+ ...(to !== undefined ? { to } : {}),
82
+ });
83
+ }
84
+ }
85
+ return out;
86
+ }
87
+ const restarts = (changes) => changes.some((c) => RESTART_FIELDS.some((f) => c.path === f || c.path.startsWith(`${f}/`)));
88
+ /** Fills in each case's source hash; a source that cannot be found is refused. */
89
+ function hashSources(sources, nexts) {
90
+ const issues = [];
91
+ for (const { after } of nexts) {
92
+ if (!after.source || after.status !== 'active') {
93
+ continue;
94
+ }
95
+ const found = sources.section(after.source.file, after.source.anchor);
96
+ if (!found.found) {
97
+ issues.push(`${after.id}: ${after.source.file} ${anchorText(after.source.anchor)} — ${found.why}`);
98
+ continue;
99
+ }
100
+ after.source = { ...after.source, sha256: found.sha256 };
101
+ }
102
+ if (issues.length > 0) {
103
+ throw invalidError(`${issues.length} source${issues.length === 1 ? '' : 's'} could not be found\n ${issues.join('\n ')}`, 'name a heading path or pointer that exists exactly once; nothing was written');
104
+ }
105
+ }
106
+ /**
107
+ * A file's hash is what lets a drift check skip it, so it only moves forward
108
+ * once the file is settled: every case read from it matches its section, and
109
+ * every section is a case or ignored. A partial apply that left one drifted case
110
+ * behind must leave the file looking moved, or that case is never looked at again.
111
+ */
112
+ function manifestFor(store, sources, finals, ignored = store.manifest.ignored) {
113
+ const byFile = new Map();
114
+ for (const c of finals) {
115
+ if (c.status === 'active' && c.source) {
116
+ byFile.set(c.source.file, [...(byFile.get(c.source.file) ?? []), c]);
117
+ }
118
+ }
119
+ for (const i of ignored) {
120
+ byFile.set(i.file, byFile.get(i.file) ?? []);
121
+ }
122
+ const hashed = {};
123
+ for (const [file, cases] of [...byFile].sort(([a], [b]) => a.localeCompare(b))) {
124
+ const now = sources.hash(file);
125
+ const was = store.manifest.sources[file]?.sha256;
126
+ if (!now) {
127
+ continue;
128
+ }
129
+ const settled = now === was ||
130
+ (cases.every((c) => {
131
+ const found = sources.section(file, c.source.anchor);
132
+ return found.found && found.sha256 === c.source.sha256;
133
+ }) &&
134
+ sources
135
+ .uncovered(file, [
136
+ ...cases.map((c) => c.source.anchor),
137
+ ...ignored.filter((i) => i.file === file).map((i) => i.anchor),
138
+ ])
139
+ .every((a) => ignored.some((i) => i.file === file && sameAnchor(i.anchor, a))));
140
+ if (settled) {
141
+ hashed[file] = { sha256: now };
142
+ }
143
+ else if (was) {
144
+ hashed[file] = { sha256: was };
145
+ }
146
+ }
147
+ return { ...store.manifest, sources: hashed, ignored };
148
+ }
149
+ function finish(store, sources, nexts, why, by) {
150
+ hashSources(sources, nexts);
151
+ const rev = store.manifest.revision + 1;
152
+ const at = new Date().toISOString();
153
+ const rows = [];
154
+ const refreshed = [];
155
+ const unchanged = [];
156
+ const revision = {
157
+ rev,
158
+ at,
159
+ why,
160
+ by,
161
+ added: [],
162
+ updated: [],
163
+ retired: [],
164
+ restored: [],
165
+ restarted: [],
166
+ };
167
+ for (const { before, after } of nexts) {
168
+ if (!before) {
169
+ const added = { ...after, rev };
170
+ rows.push({ type: 'change', rev, at, op: 'add', changes: [], why, by, case: added });
171
+ revision.added.push(after.id);
172
+ continue;
173
+ }
174
+ const changes = fieldChanges(before, after);
175
+ let op;
176
+ if (before.status !== after.status) {
177
+ op = after.status === 'retired' ? 'retire' : 'restore';
178
+ changes.unshift({ path: 'status', from: before.status, to: after.status });
179
+ }
180
+ else if (changes.length > 0) {
181
+ op = 'update';
182
+ }
183
+ if (!op) {
184
+ if (before.source?.sha256 !== after.source?.sha256) {
185
+ refreshed.push({ ...after, rev: before.rev });
186
+ }
187
+ else {
188
+ unchanged.push(after.id);
189
+ }
190
+ continue;
191
+ }
192
+ const written = { ...after, rev };
193
+ rows.push({ type: 'change', rev, at, op, changes, why, by, case: written });
194
+ if (op === 'retire') {
195
+ revision.retired.push(after.id);
196
+ }
197
+ else if (op === 'restore') {
198
+ revision.restored.push(after.id);
199
+ }
200
+ else {
201
+ revision.updated.push(after.id);
202
+ }
203
+ if (op !== 'retire' && restarts(changes)) {
204
+ revision.restarted.push(after.id);
205
+ }
206
+ }
207
+ const touched = new Map([...rows.map((r) => r.case), ...refreshed].map((c) => [c.id, c]));
208
+ const finals = store.all().map((c) => touched.get(c.id) ?? c);
209
+ for (const c of touched.values()) {
210
+ if (!finals.some((f) => f.id === c.id)) {
211
+ finals.push(c);
212
+ }
213
+ }
214
+ return {
215
+ rev,
216
+ rows,
217
+ refreshed,
218
+ unchanged,
219
+ revision,
220
+ manifest: manifestFor(store, sources, finals),
221
+ };
222
+ }
223
+ // ---------------------------------------------------------------------------
224
+ // The writes
225
+ // ---------------------------------------------------------------------------
226
+ function fromProposal(p, before) {
227
+ const after = {
228
+ id: p.id,
229
+ rev: before?.rev ?? 0,
230
+ status: 'active',
231
+ ...(p.class !== undefined ? { class: p.class } : {}),
232
+ ...(p.complexity !== undefined ? { complexity: p.complexity } : {}),
233
+ ...(p.tags !== undefined ? { tags: p.tags } : {}),
234
+ input: p.input,
235
+ rubric: assignRubric(before?.rubric ?? [], p.rubric),
236
+ ...(p.expected !== undefined ? { expected: p.expected } : {}),
237
+ ...(p.notes !== undefined ? { notes: p.notes } : {}),
238
+ ...(p.source !== undefined ? { source: { ...p.source } } : {}),
239
+ };
240
+ for (const field of before?.overrides ?? []) {
241
+ const kept = before[field];
242
+ if (kept === undefined) {
243
+ delete after[field];
244
+ }
245
+ else {
246
+ after[field] = kept;
247
+ }
248
+ }
249
+ if (before?.overrides?.length) {
250
+ after.overrides = before.overrides;
251
+ }
252
+ return after;
253
+ }
254
+ /**
255
+ * A proposal, applied. Whole by default: an active case the proposal does not
256
+ * name is retired. `partial` touches only the cases it names — what a refresh
257
+ * of a few drifted sections writes.
258
+ */
259
+ export function planApply(store, proposed, options) {
260
+ const sources = new Sources(store.root);
261
+ const named = new Set(proposed.map((p) => p.id));
262
+ const nexts = proposed.map((p) => {
263
+ const before = store.get(p.id);
264
+ return { before, after: fromProposal(p, before) };
265
+ });
266
+ if (!options.partial) {
267
+ for (const c of store.all()) {
268
+ if (c.status === 'active' && !named.has(c.id)) {
269
+ nexts.push({ before: c, after: { ...c, status: 'retired' } });
270
+ }
271
+ }
272
+ }
273
+ return finish(store, sources, nexts, options.why, options.by);
274
+ }
275
+ /** One case, changed by hand. `override` keeps the change through later re-extractions. */
276
+ export function planEdit(store, id, edit, options) {
277
+ const before = store.get(id);
278
+ if (!before) {
279
+ throw invalidError(`no case ${id}`, 'see: zen meta dataset ls');
280
+ }
281
+ const after = edit(structuredClone(before));
282
+ if (options.override?.length) {
283
+ after.overrides = [...new Set([...(before.overrides ?? []), ...options.override])].sort();
284
+ }
285
+ return finish(store, new Sources(store.root), [{ before, after }], options.why, options.by);
286
+ }
287
+ export function planStatus(store, ids, status, options) {
288
+ const nexts = ids.map((id) => {
289
+ const before = store.get(id);
290
+ if (!before) {
291
+ throw invalidError(`no case ${id}`, 'see: zen meta dataset ls --status all');
292
+ }
293
+ return { before, after: { ...before, status } };
294
+ });
295
+ return finish(store, new Sources(store.root), nexts, options.why, options.by);
296
+ }
297
+ /** The ignore list changed: no case moves, so no revision; the manifest is rewritten. */
298
+ export function planIgnored(store, ignored) {
299
+ const sources = new Sources(store.root);
300
+ return {
301
+ rev: store.manifest.revision,
302
+ rows: [],
303
+ refreshed: [],
304
+ unchanged: [],
305
+ revision: {
306
+ rev: store.manifest.revision,
307
+ at: new Date().toISOString(),
308
+ why: '',
309
+ by: { host: '' },
310
+ added: [],
311
+ updated: [],
312
+ retired: [],
313
+ restored: [],
314
+ restarted: [],
315
+ },
316
+ manifest: manifestFor(store, sources, store.all(), ignored),
317
+ };
318
+ }
319
+ //# sourceMappingURL=changes.js.map
@@ -0,0 +1,17 @@
1
+ export declare const DATASET_USAGE = "zen meta dataset <verb> [args] [options]";
2
+ export declare const DATASET_HELP: string[];
3
+ export declare const DATASET_SUMMARY = "The cases the project is evaluated on: read from sources, revised, sampled.";
4
+ /** The page `zen meta dataset --help` prints. */
5
+ export declare const DATASET_DETAILS: string[];
6
+ export interface DatasetContext {
7
+ readonly args: readonly string[];
8
+ readonly json: boolean;
9
+ readonly cwd: string;
10
+ }
11
+ /** Only the project flag, read ahead of resolving the project the rest is about. */
12
+ export declare function datasetProjectFlag(args: readonly string[]): string | undefined;
13
+ export declare function runDataset(ctx: DatasetContext, project: {
14
+ dir: string;
15
+ name: string;
16
+ }): Promise<void>;
17
+ //# sourceMappingURL=command.d.ts.map