@planu/cli 8.8.0 → 8.10.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 (39) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +9 -3
  3. package/dist/sdd-engine/canonical-tools.d.ts +38 -0
  4. package/dist/sdd-engine/canonical-tools.js +105 -2
  5. package/dist/sdd-engine/catalogue-presentation.d.ts +23 -0
  6. package/dist/sdd-engine/catalogue-presentation.js +123 -0
  7. package/dist/sdd-engine/client-workspace.d.ts +8 -1
  8. package/dist/sdd-engine/client-workspace.js +168 -1
  9. package/dist/sdd-engine/completion-snapshot.d.ts +2 -1
  10. package/dist/sdd-engine/completion-snapshot.js +81 -23
  11. package/dist/sdd-engine/contracts.d.ts +2 -24
  12. package/dist/sdd-engine/contracts.js +5 -19
  13. package/dist/sdd-engine/feature-authority.d.ts +3 -2
  14. package/dist/sdd-engine/feature-authority.js +29 -1
  15. package/dist/sdd-engine/host-rule-pack.js +16 -4
  16. package/dist/sdd-engine/host-skill-reader.d.ts +12 -11
  17. package/dist/sdd-engine/host-skill-reader.js +235 -225
  18. package/dist/sdd-engine/source-descriptor.d.ts +3 -0
  19. package/dist/sdd-engine/source-descriptor.js +356 -0
  20. package/dist/sdd-engine/tools/execution-tools.d.ts +2 -1
  21. package/dist/sdd-engine/tools/execution-tools.js +58 -33
  22. package/dist/sdd-engine/tools/feature-store.d.ts +6 -6
  23. package/dist/sdd-engine/tools/feature-store.js +188 -84
  24. package/dist/sdd-engine/tools/workspace-tools.d.ts +2 -1
  25. package/dist/sdd-engine/tools/workspace-tools.js +44 -35
  26. package/dist/sdd-engine/tools.js +4 -2
  27. package/dist/sdd-engine/workspace-init.d.ts +6 -0
  28. package/dist/sdd-engine/workspace-init.js +92 -2
  29. package/dist/sdd-engine/workspace-root.d.ts +33 -7
  30. package/dist/sdd-engine/workspace-root.js +222 -139
  31. package/dist/types/completion.d.ts +46 -2
  32. package/dist/types/resume-views.d.ts +36 -1
  33. package/dist/types/sdd-engine.d.ts +35 -61
  34. package/dist/types/verification.d.ts +59 -0
  35. package/package.json +2 -2
  36. package/templates/AGENTS.md +4 -0
  37. package/templates/host/planu-sdd.md +4 -0
  38. package/templates/skills/preflight-guardian.md +4 -0
  39. package/templates/skills/spec-executor.md +4 -0
@@ -0,0 +1,356 @@
1
+ import { createHash } from 'node:crypto';
2
+ import { constants } from 'node:fs';
3
+ import { lstat, open, realpath } from 'node:fs/promises';
4
+ import { join, relative, resolve, sep } from 'node:path';
5
+ function sameIdentity(a, b) {
6
+ return (a.dev === b.dev && a.ino === b.ino && a.mode === b.mode && a.uid === b.uid && a.gid === b.gid);
7
+ }
8
+ function sameFile(a, b) {
9
+ return (sameIdentity(a, b) &&
10
+ a.nlink === b.nlink &&
11
+ a.size === b.size &&
12
+ a.mtimeNs === b.mtimeNs &&
13
+ a.ctimeNs === b.ctimeNs);
14
+ }
15
+ function safeFile(stat) {
16
+ return stat.isFile() && !stat.isSymbolicLink() && stat.nlink === 1n;
17
+ }
18
+ function safeOwned(stat, profile) {
19
+ return (safeFile(stat) &&
20
+ (profile !== 'catalogue' ||
21
+ (typeof process.getuid === 'function' && stat.uid === BigInt(process.getuid()))));
22
+ }
23
+ function errorCause(error, observed) {
24
+ const code = typeof error === 'object' && error !== null && 'code' in error ? error.code : undefined;
25
+ switch (code) {
26
+ case 'ENOENT':
27
+ return observed ? 'unstable' : 'not_found';
28
+ case 'EACCES':
29
+ case 'EPERM':
30
+ return 'access_denied';
31
+ case 'ELOOP':
32
+ case 'ENOTDIR':
33
+ return 'unsafe_path';
34
+ default:
35
+ return 'read_failed';
36
+ }
37
+ }
38
+ class DescriptorFailure extends Error {
39
+ reason;
40
+ constructor(reason) {
41
+ super(reason);
42
+ this.reason = reason;
43
+ }
44
+ }
45
+ function tuple(stat) {
46
+ return [stat.dev, stat.ino, stat.mode, stat.uid, stat.gid].map(String);
47
+ }
48
+ function digest(value) {
49
+ return createHash('sha256').update(JSON.stringify(value)).digest('hex');
50
+ }
51
+ class Descriptor {
52
+ lexicalRoot;
53
+ local;
54
+ profile;
55
+ signal;
56
+ directories = [];
57
+ root = '';
58
+ target = '';
59
+ opened;
60
+ handle;
61
+ observed = false;
62
+ bank;
63
+ bytes = 0;
64
+ calls = 0;
65
+ accepting = false;
66
+ pending = false;
67
+ observation = Promise.resolve();
68
+ failure;
69
+ constructor(lexicalRoot, local, profile, signal) {
70
+ this.lexicalRoot = lexicalRoot;
71
+ this.local = local;
72
+ this.profile = profile;
73
+ this.signal = signal;
74
+ }
75
+ deny(reason) {
76
+ throw new DescriptorFailure(reason);
77
+ }
78
+ abort() {
79
+ if (this.signal?.aborted) {
80
+ this.deny('cancelled');
81
+ }
82
+ }
83
+ async checked(operation) {
84
+ this.abort();
85
+ try {
86
+ return await operation();
87
+ }
88
+ finally {
89
+ this.abort();
90
+ }
91
+ }
92
+ async directoriesStable() {
93
+ if (this.root && (await this.checked(() => realpath(this.lexicalRoot))) !== this.root) {
94
+ return false;
95
+ }
96
+ for (const directory of this.directories) {
97
+ const current = await this.checked(() => lstat(directory.path, { bigint: true }));
98
+ if (!current.isDirectory() ||
99
+ current.isSymbolicLink() ||
100
+ !sameIdentity(directory.stat, current)) {
101
+ return false;
102
+ }
103
+ }
104
+ return true;
105
+ }
106
+ projection() {
107
+ const first = this.directories[0];
108
+ if (!first) {
109
+ this.deny('unsafe_path');
110
+ }
111
+ const rootHash = digest(['planu.source-root.v1', this.root, ...tuple(first.stat)]);
112
+ const ancestors = this.directories
113
+ .slice(1)
114
+ .map(({ path, stat }) => [relative(this.root, path), ...tuple(stat)]);
115
+ const file = this.opened;
116
+ return Object.freeze({
117
+ size: Number(file.size),
118
+ rootIdentitySha256: rootHash,
119
+ snapshotSha256: digest([
120
+ 'planu.source-snapshot.v1',
121
+ rootHash,
122
+ ancestors,
123
+ this.local,
124
+ [...tuple(file), ...[file.nlink, file.size, file.mtimeNs, file.ctimeNs].map(String)],
125
+ ]),
126
+ });
127
+ }
128
+ async capture() {
129
+ this.root = await this.checked(() => realpath(this.lexicalRoot));
130
+ let current = this.root;
131
+ for (const component of this.local.split(sep)) {
132
+ const stat = await this.checked(() => lstat(current, { bigint: true }));
133
+ if (!stat.isDirectory() || stat.isSymbolicLink()) {
134
+ this.deny('unsafe_path');
135
+ }
136
+ this.directories.push({ path: current, stat });
137
+ current = join(current, component);
138
+ }
139
+ this.target = current;
140
+ return this.captureFile(current);
141
+ }
142
+ async captureFile(current) {
143
+ const before = await this.checked(() => lstat(current, { bigint: true }));
144
+ this.observed = true;
145
+ if (!safeOwned(before, this.profile)) {
146
+ this.deny('unsafe_path');
147
+ }
148
+ if (typeof this.profile === 'number' && before.size > BigInt(this.profile)) {
149
+ this.deny('over_limit');
150
+ }
151
+ if (before.size < 0n || before.size > BigInt(Number.MAX_SAFE_INTEGER)) {
152
+ this.deny('read_failed');
153
+ }
154
+ await this.checked(async () => {
155
+ this.handle = await open(current, constants.O_RDONLY | constants.O_NOFOLLOW | constants.O_NONBLOCK);
156
+ });
157
+ const opened = await this.checked(() => this.requireHandle().stat({ bigint: true }));
158
+ if (!safeOwned(opened, this.profile)) {
159
+ this.deny('unsafe_path');
160
+ }
161
+ if (!sameFile(before, opened)) {
162
+ this.deny('unstable');
163
+ }
164
+ if (typeof this.profile === 'number' && opened.size > BigInt(this.profile)) {
165
+ this.deny('over_limit');
166
+ }
167
+ this.opened = opened;
168
+ if (!(await this.directoriesStable()) ||
169
+ (await this.checked(() => realpath(current))) !== current) {
170
+ this.deny('unstable');
171
+ }
172
+ const named = await this.checked(() => lstat(current, { bigint: true }));
173
+ if (!safeFile(named) || !sameFile(opened, named)) {
174
+ this.deny('unstable');
175
+ }
176
+ return this.projection();
177
+ }
178
+ requireHandle() {
179
+ if (!this.handle) {
180
+ this.deny('read_failed');
181
+ }
182
+ return this.handle;
183
+ }
184
+ invalidCatalogueRead(position, length) {
185
+ return (this.profile === 'catalogue' &&
186
+ (position !== this.bytes || position >= Number(this.opened.size) || length > 4096));
187
+ }
188
+ validateRead(position, length, capacity) {
189
+ if (!Number.isSafeInteger(position) ||
190
+ position < 0 ||
191
+ !Number.isSafeInteger(length) ||
192
+ length <= 0 ||
193
+ !Number.isSafeInteger(position + length) ||
194
+ (this.profile !== 'catalogue' && this.bytes >= capacity) ||
195
+ this.invalidCatalogueRead(position, length)) {
196
+ this.deny('read_failed');
197
+ }
198
+ if (this.profile === 'source' &&
199
+ (position >= Number(this.opened.size) || length > 4096 || this.calls >= 64)) {
200
+ this.deny('read_failed');
201
+ }
202
+ }
203
+ async executeRead(position, length) {
204
+ this.abort();
205
+ const capacity = this.profile === 'source' ? 65_536 : this.profile === 'catalogue' ? 4096 : this.profile;
206
+ this.validateRead(position, length, capacity);
207
+ const amount = Math.min(length, this.profile === 'catalogue' ? capacity : capacity - this.bytes, typeof this.profile !== 'number' ? Number(this.opened.size) - position : length);
208
+ const bank = (this.bank ??= Buffer.alloc(capacity));
209
+ const start = this.profile === 'catalogue' ? 0 : this.bytes;
210
+ const result = await this.checked(async () => {
211
+ this.calls++;
212
+ const read = await this.requireHandle().read(bank, start, amount, position);
213
+ this.bytes += read.bytesRead;
214
+ return read;
215
+ });
216
+ if (result.bytesRead === 0 && typeof this.profile !== 'number') {
217
+ this.deny('unstable');
218
+ }
219
+ return bank.subarray(start, this.profile === 'catalogue' ? result.bytesRead : this.bytes);
220
+ }
221
+ read = (position, length) => {
222
+ if (!this.accepting || this.pending || this.failure !== undefined) {
223
+ const error = new DescriptorFailure('read_failed');
224
+ this.failure ??= error;
225
+ const rejected = Promise.reject(error);
226
+ void rejected.catch(() => undefined);
227
+ return rejected;
228
+ }
229
+ this.pending = true;
230
+ const operation = Promise.resolve().then(() => this.executeRead(position, length));
231
+ this.observation = operation.then(() => {
232
+ this.pending = false;
233
+ }, (error) => {
234
+ this.failure ??= error;
235
+ this.pending = false;
236
+ });
237
+ return operation;
238
+ };
239
+ async revalidate() {
240
+ const after = await this.checked(() => this.requireHandle().stat({ bigint: true }));
241
+ const named = await this.checked(() => lstat(this.target, { bigint: true }));
242
+ if (typeof this.profile === 'number' &&
243
+ (after.size > BigInt(this.profile) || named.size > BigInt(this.profile))) {
244
+ this.deny('over_limit');
245
+ }
246
+ if (!sameFile(this.opened, after) ||
247
+ !sameFile(after, named) ||
248
+ !safeFile(named) ||
249
+ (this.profile !== 'source' && after.size !== BigInt(this.bytes)) ||
250
+ !(await this.directoriesStable()) ||
251
+ (await this.checked(() => realpath(this.target))) !== this.target) {
252
+ this.deny('unstable');
253
+ }
254
+ }
255
+ async failureCause(error) {
256
+ if (error instanceof DescriptorFailure) {
257
+ return error.reason;
258
+ }
259
+ const cause = errorCause(error, this.observed);
260
+ try {
261
+ if (!(await this.directoriesStable())) {
262
+ return 'unstable';
263
+ }
264
+ return cause === 'not_found' && !this.directories.length ? 'unsafe_path' : cause;
265
+ }
266
+ catch {
267
+ return this.signal?.aborted ? 'cancelled' : 'unstable';
268
+ }
269
+ }
270
+ async run(callback) {
271
+ let result;
272
+ try {
273
+ const snapshot = await this.capture();
274
+ this.accepting = true;
275
+ let value;
276
+ let callbackError;
277
+ let callbackFailed = false;
278
+ try {
279
+ value = await callback({ snapshot, read: this.read });
280
+ }
281
+ catch (error) {
282
+ callbackError = error;
283
+ callbackFailed = true;
284
+ }
285
+ this.accepting = false;
286
+ await this.observation;
287
+ if (callbackFailed) {
288
+ throw new DescriptorFailure(await this.failureCause(callbackError));
289
+ }
290
+ if (this.failure !== undefined) {
291
+ throw new DescriptorFailure(await this.failureCause(this.failure));
292
+ }
293
+ await this.revalidate();
294
+ result = { ok: true, value: value };
295
+ }
296
+ catch (error) {
297
+ result = { ok: false, cause: await this.failureCause(error) };
298
+ }
299
+ finally {
300
+ this.accepting = false;
301
+ try {
302
+ await this.handle?.close();
303
+ }
304
+ catch {
305
+ result = { ok: false, cause: 'read_failed' };
306
+ }
307
+ this.handle = undefined;
308
+ this.bank = undefined;
309
+ }
310
+ if (this.failure !== undefined && result.ok) {
311
+ result = { ok: false, cause: await this.failureCause(this.failure) };
312
+ }
313
+ if (this.signal?.aborted) {
314
+ return { ok: false, cause: 'cancelled' };
315
+ }
316
+ return result;
317
+ }
318
+ }
319
+ function sourceContainsNul(profile, local) {
320
+ return typeof profile !== 'number' && local.includes('\0');
321
+ }
322
+ function supportedProfile(profile) {
323
+ return (profile === 'source' ||
324
+ profile === 'catalogue' ||
325
+ (typeof profile === 'number' &&
326
+ Number.isSafeInteger(profile) &&
327
+ profile >= 0 &&
328
+ profile <= 65_536));
329
+ }
330
+ function missingCapability(profile) {
331
+ return ((profile === 'source' || profile === 'catalogue') &&
332
+ (!constants.O_NOFOLLOW ||
333
+ !constants.O_NONBLOCK ||
334
+ (profile === 'catalogue' && typeof process.getuid !== 'function')));
335
+ }
336
+ export function withSourceDescriptor(workspaceRoot, local, callback, profile = 'source', signal) {
337
+ if (signal?.aborted) {
338
+ return Promise.resolve({ ok: false, cause: 'cancelled' });
339
+ }
340
+ if (missingCapability(profile)) {
341
+ return Promise.resolve({ ok: false, cause: 'capability_unavailable' });
342
+ }
343
+ if (!supportedProfile(profile)) {
344
+ return Promise.resolve({ ok: false, cause: 'read_failed' });
345
+ }
346
+ if (sourceContainsNul(profile, local)) {
347
+ return Promise.resolve({ ok: false, cause: 'unsafe_path' });
348
+ }
349
+ if (!local ||
350
+ local.split(sep).some((part) => !part || part === '.' || part === '..') ||
351
+ resolve(local) === local) {
352
+ return Promise.resolve({ ok: false, cause: 'unsafe_path' });
353
+ }
354
+ return new Descriptor(resolve(workspaceRoot), local, profile, signal).run(callback);
355
+ }
356
+ //# sourceMappingURL=source-descriptor.js.map
@@ -3,5 +3,6 @@ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
3
3
  import { TaskWindowManager } from '../task-window.js';
4
4
  export { sliceNumberedSource } from '../task-content.js';
5
5
  import type { SddWorkspaceHandle } from '../../types/sdd-engine.js';
6
- export declare function registerExecutionTools(server: McpServer, workspace: SddWorkspaceHandle, policy?: VerificationPolicy): TaskWindowManager;
6
+ import { ReadCursorCodec } from '../workspace-root.js';
7
+ export declare function registerExecutionTools(server: McpServer, workspace: SddWorkspaceHandle, policy?: VerificationPolicy, codec?: ReadCursorCodec): TaskWindowManager;
7
8
  //# sourceMappingURL=execution-tools.d.ts.map
@@ -9,15 +9,16 @@ import { parseManifestContent, parseVerificationReceiptPolicy, toPosixPath, } fr
9
9
  import { getReceiptActiveTask } from '../verification-receipts.js';
10
10
  import { captureVerificationRoot, checkReceiptPatchTarget } from '../verification-inputs.js';
11
11
  import { patchMutationError } from '../task-failures.js';
12
- import { formatResult } from './compact-result.js';
12
+ import { formatCompactResult, formatResult } from './compact-result.js';
13
+ import { readBoundedSource } from '../host-skill-reader.js';
13
14
  import { acquireCompletionLease } from '../completion-guard.js';
14
15
  import { captureCompletionSnapshot, revalidateCompletionSnapshot } from '../completion-snapshot.js';
15
- import { homeFallbackFailure, readTextInsideWorkspace } from '../workspace-root.js';
16
+ import { homeFallbackFailure, readTextInsideWorkspace, ReadCursorCodec, } from '../workspace-root.js';
16
17
  import { guardFailure } from '../feature-authority.js';
17
- export function registerExecutionTools(server, workspace, policy) {
18
+ export function registerExecutionTools(server, workspace, policy, codec = new ReadCursorCodec()) {
18
19
  const taskWindow = new TaskWindowManager(policy);
19
20
  registerReadArtifactTool(server, workspace);
20
- registerReadFileSliceTool(server, workspace);
21
+ registerReadFileSliceTool(server, workspace, codec);
21
22
  registerGetActiveTaskTool(server, workspace, taskWindow);
22
23
  registerApplyPatchTool(server, workspace);
23
24
  registerCompleteTaskTool(server, workspace, taskWindow);
@@ -52,13 +53,16 @@ function registerReadArtifactTool(server, workspace) {
52
53
  return { content: [{ type: 'text', text: read.text }] };
53
54
  });
54
55
  }
55
- function registerReadFileSliceTool(server, workspace) {
56
+ function registerReadFileSliceTool(server, workspace, codec) {
56
57
  server.registerTool('sdd_read_file_slice', {
57
58
  annotations: TOOL_ANNOTATIONS.sdd_read_file_slice,
58
59
  description: 'Reads an exact line slice from a target file to optimize token usage.',
59
60
  inputSchema: ReadFileSliceInputSchema.shape,
60
- }, async (rawArgs) => {
61
+ }, async (rawArgs, extra) => {
61
62
  const args = ReadFileSliceInputSchema.parse(rawArgs);
63
+ if (args.view !== undefined || args.cursor !== undefined) {
64
+ return executeBoundedSlice(workspace, args, codec, extra.signal);
65
+ }
62
66
  const resolved = await workspace.resolve();
63
67
  const homeError = homeFallbackFailure(resolved, 'sdd_read_file_slice');
64
68
  if (homeError) {
@@ -67,6 +71,39 @@ function registerReadFileSliceTool(server, workspace) {
67
71
  return executeReadFileSlice(resolved.workspaceRoot, args.path, args.start_line, args.end_line);
68
72
  });
69
73
  }
74
+ function boundedFailure(reason) {
75
+ return formatCompactResult({
76
+ success: false,
77
+ error: {
78
+ code: reason === 'cancelled' ? 'ERR_VERIFICATION_FAILED' : 'ERR_INVALID_SLICE',
79
+ message: 'Bounded source read is unavailable.',
80
+ trigger: 'sdd_read_file_slice',
81
+ details: { reason, nextAction: reason === 'cancelled' ? 'retry_read' : 'inspect_artifacts' },
82
+ },
83
+ });
84
+ }
85
+ async function executeBoundedSlice(workspace, args, codec, signal) {
86
+ const aborted = () => signal.aborted;
87
+ if (aborted()) {
88
+ return boundedFailure('cancelled');
89
+ }
90
+ let resolved;
91
+ try {
92
+ resolved = await workspace.resolve();
93
+ }
94
+ catch {
95
+ return boundedFailure(aborted() ? 'cancelled' : 'slice_unavailable');
96
+ }
97
+ if (aborted()) {
98
+ return boundedFailure('cancelled');
99
+ }
100
+ const homeError = homeFallbackFailure(resolved, 'sdd_read_file_slice');
101
+ if (homeError) {
102
+ return formatCompactResult(homeError);
103
+ }
104
+ const result = await readBoundedSource(resolved.workspaceRoot, args, codec, signal);
105
+ return aborted() ? boundedFailure('cancelled') : formatCompactResult(result);
106
+ }
70
107
  function registerGetActiveTaskTool(server, workspace, taskWindow) {
71
108
  server.registerTool('sdd_get_active_task', {
72
109
  annotations: TOOL_ANNOTATIONS.sdd_get_active_task,
@@ -137,16 +174,20 @@ function registerCompleteTaskTool(server, workspace, taskWindow) {
137
174
  return formatResult(result);
138
175
  });
139
176
  }
177
+ function invalidLineRange(startLine, endLine, totalLines) {
178
+ return formatResult({
179
+ success: false,
180
+ error: {
181
+ code: 'ERR_INVALID_SLICE',
182
+ message: `Invalid line range: ${startLine} to ${endLine}.`,
183
+ trigger: 'sdd_read_file_slice',
184
+ ...(totalLines === undefined ? {} : { details: { totalLines } }),
185
+ },
186
+ });
187
+ }
140
188
  async function executeReadFileSlice(workspaceRoot, relPath, startLine, endLine) {
141
189
  if (startLine > endLine || startLine < 1) {
142
- return formatResult({
143
- success: false,
144
- error: {
145
- code: 'ERR_INVALID_SLICE',
146
- message: `Invalid line range: ${startLine} to ${endLine}.`,
147
- trigger: 'sdd_read_file_slice',
148
- },
149
- });
190
+ return invalidLineRange(startLine, endLine);
150
191
  }
151
192
  const read = await readTextInsideWorkspace(workspaceRoot, path.resolve(workspaceRoot, path.normalize(relPath)));
152
193
  if (!read.ok) {
@@ -163,26 +204,10 @@ async function executeReadFileSlice(workspaceRoot, relPath, startLine, endLine)
163
204
  }
164
205
  const sliced = sliceNumberedSource(read.text, startLine, endLine);
165
206
  if (!sliced.ok) {
166
- return formatResult({
167
- success: false,
168
- error: {
169
- code: 'ERR_INVALID_SLICE',
170
- message: `Invalid line range: ${startLine} to ${endLine}.`,
171
- trigger: 'sdd_read_file_slice',
172
- details: { totalLines: sliced.totalLines },
173
- },
174
- });
207
+ return invalidLineRange(startLine, endLine, sliced.totalLines);
175
208
  }
176
- return formatResult({
177
- success: true,
178
- data: {
179
- totalLines: sliced.totalLines,
180
- startLine: sliced.startLine,
181
- endLine: sliced.endLine,
182
- truncated: sliced.truncated,
183
- text: sliced.text,
184
- },
185
- });
209
+ const { ok: _ok, ...data } = sliced;
210
+ return formatResult({ success: true, data });
186
211
  }
187
212
  async function executeApplyPatch(workspaceRoot, args) {
188
213
  try {
@@ -1,11 +1,11 @@
1
- import type { FeatureSummary, SddFailure, SddResult } from '../../types/sdd-engine.js';
1
+ import type { CataloguePageV1, FeatureSummary, ListFeaturesInput, SddFailure, SddResult } from '../../types/sdd-engine.js';
2
+ import type { ReadCursorCodec } from '../workspace-root.js';
2
3
  import type { TaskWindowManager } from '../task-window.js';
3
- export declare function createExplicitFeatureDirectory(featDir: string, featureId: string): Promise<SddFailure | null>;
4
- export declare function reserveAutomaticFeatureDirectory(featuresDir: string, title: string): Promise<{
5
- featureId: string;
6
- featDir: string;
7
- }>;
4
+ export { createExplicitFeatureDirectory, reserveAutomaticFeatureDirectory, } from '../workspace-init.js';
8
5
  export declare function collectFeatures(featuresDir: string, taskWindow: TaskWindowManager, statusFilter?: 'all' | 'planning' | 'executing' | 'done'): Promise<SddResult<FeatureSummary[]>>;
9
6
  export declare function featurePathFailure(workspaceRoot: string, directory: string, trigger: string): Promise<SddFailure | null>;
10
7
  export declare function writeFeatureArtifacts(featDir: string, id: string, title: string): Promise<void>;
8
+ export declare function readFeatureCatalogue(workspaceRoot: string, input: ListFeaturesInput, codec: ReadCursorCodec, signal?: AbortSignal): Promise<SddResult<{
9
+ catalogue: CataloguePageV1;
10
+ }>>;
11
11
  //# sourceMappingURL=feature-store.d.ts.map