@joshski/dust 0.1.32 → 0.1.33

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.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Dust
1
+ # Dust
2
2
 
3
3
  **Flow state for AI coding agents.**
4
4
 
@@ -5,6 +5,10 @@ export interface IdeaInProgress {
5
5
  taskSlug: string;
6
6
  ideaTitle: string;
7
7
  }
8
+ export interface ParsedCaptureIdeaTask {
9
+ ideaTitle: string;
10
+ ideaDescription: string;
11
+ }
8
12
  export declare function findAllCaptureIdeaTasks(fileSystem: FileSystem, dustPath: string): Promise<IdeaInProgress[]>;
9
13
  /**
10
14
  * Converts a markdown title to the expected filename using deterministic rules:
@@ -39,3 +43,4 @@ export declare function createRefineIdeaTask(fileSystem: FileSystem, dustPath: s
39
43
  export declare function decomposeIdea(fileSystem: FileSystem, dustPath: string, options: DecomposeIdeaOptions): Promise<CreateIdeaTransitionTaskResult>;
40
44
  export declare function createShelveIdeaTask(fileSystem: FileSystem, dustPath: string, ideaSlug: string, description?: string): Promise<CreateIdeaTransitionTaskResult>;
41
45
  export declare function createCaptureIdeaTask(fileSystem: FileSystem, dustPath: string, title: string, description: string): Promise<CreateIdeaTransitionTaskResult>;
46
+ export declare function parseCaptureIdeaTask(fileSystem: FileSystem, dustPath: string, taskSlug: string): Promise<ParsedCaptureIdeaTask | null>;
@@ -136,17 +136,57 @@ async function createCaptureIdeaTask(fileSystem, dustPath, title, description) {
136
136
  const filePath = `${dustPath}/tasks/${filename}`;
137
137
  const ideaFilename = titleToFilename(title);
138
138
  const ideaPath = `.dust/ideas/${ideaFilename}`;
139
- const content = renderTask(taskTitle, `Research this idea thoroughly, then create an idea file at \`${ideaPath}\`. Read the codebase for relevant context, flesh out the description, and identify any ambiguity. Where aspects are unclear or could go multiple ways, add open questions to the idea file. Review \`.dust/goals/\` and \`.dust/facts/\` for relevant context. The idea should have the title "${title}" and start from the following description:`, [
140
- `Idea file exists at ${ideaPath}`,
141
- `Idea file has an H1 title matching "${title}"`,
142
- "Idea includes relevant context from codebase exploration",
143
- "Open questions are added for any ambiguous or underspecified aspects"
144
- ], { description });
139
+ const content = `# ${taskTitle}
140
+
141
+ Research this idea thoroughly, then create an idea file at \`${ideaPath}\`. Read the codebase for relevant context, flesh out the description, and identify any ambiguity. Where aspects are unclear or could go multiple ways, add open questions to the idea file. Review \`.dust/goals/\` and \`.dust/facts/\` for relevant context.
142
+
143
+ ## Idea Description
144
+
145
+ ${description}
146
+
147
+ ## Goals
148
+
149
+ (none)
150
+
151
+ ## Blocked By
152
+
153
+ (none)
154
+
155
+ ## Definition of Done
156
+
157
+ - [ ] Idea file exists at ${ideaPath}
158
+ - [ ] Idea file has an H1 title matching "${title}"
159
+ - [ ] Idea includes relevant context from codebase exploration
160
+ - [ ] Open questions are added for any ambiguous or underspecified aspects
161
+ `;
145
162
  await fileSystem.writeFile(filePath, content);
146
163
  return { filePath };
147
164
  }
165
+ async function parseCaptureIdeaTask(fileSystem, dustPath, taskSlug) {
166
+ const filePath = `${dustPath}/tasks/${taskSlug}.md`;
167
+ if (!fileSystem.exists(filePath)) {
168
+ return null;
169
+ }
170
+ const content = await fileSystem.readFile(filePath);
171
+ const titleMatch = content.match(/^#\s+(.+)$/m);
172
+ if (!titleMatch) {
173
+ return null;
174
+ }
175
+ const title = titleMatch[1].trim();
176
+ if (!title.startsWith(CAPTURE_IDEA_PREFIX)) {
177
+ return null;
178
+ }
179
+ const ideaTitle = title.slice(CAPTURE_IDEA_PREFIX.length);
180
+ const descriptionMatch = content.match(/^## Idea Description\n\n([\s\S]*?)\n\n## /m);
181
+ if (!descriptionMatch) {
182
+ return null;
183
+ }
184
+ const ideaDescription = descriptionMatch[1];
185
+ return { ideaTitle, ideaDescription };
186
+ }
148
187
  export {
149
188
  titleToFilename,
189
+ parseCaptureIdeaTask,
150
190
  findWorkflowTaskForIdea,
151
191
  findAllCaptureIdeaTasks,
152
192
  decomposeIdea,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@joshski/dust",
3
- "version": "0.1.32",
3
+ "version": "0.1.33",
4
4
  "description": "Flow state for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {