@joshski/dust 0.1.47 → 0.1.49

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/dist/dust.js CHANGED
@@ -2182,6 +2182,10 @@ async function runRepositoryLoop(repoState, repoDeps, sendEvent, sessionId) {
2182
2182
  }
2183
2183
  });
2184
2184
  if (result === "no_tasks") {
2185
+ if (repoState.taskAvailablePending) {
2186
+ repoState.taskAvailablePending = false;
2187
+ continue;
2188
+ }
2185
2189
  await new Promise((resolve) => {
2186
2190
  repoState.wakeUp = () => {
2187
2191
  repoState.wakeUp = undefined;
@@ -3000,7 +3004,13 @@ function connectWebSocket(token, state, bucketDependencies, context, fileSystem,
3000
3004
  for (const repoData of repos) {
3001
3005
  if (typeof repoData === "object" && repoData !== null && "name" in repoData && "hasTask" in repoData && repoData.hasTask) {
3002
3006
  const repoState = state.repositories.get(repoData.name);
3003
- repoState?.wakeUp?.();
3007
+ if (repoState) {
3008
+ if (repoState.wakeUp) {
3009
+ repoState.wakeUp();
3010
+ } else {
3011
+ repoState.taskAvailablePending = true;
3012
+ }
3013
+ }
3004
3014
  }
3005
3015
  }
3006
3016
  }).catch((error) => {
@@ -3010,7 +3020,13 @@ function connectWebSocket(token, state, bucketDependencies, context, fileSystem,
3010
3020
  const repoName = message.repository;
3011
3021
  if (typeof repoName === "string") {
3012
3022
  const repoState = state.repositories.get(repoName);
3013
- repoState?.wakeUp?.();
3023
+ if (repoState) {
3024
+ if (repoState.wakeUp) {
3025
+ repoState.wakeUp();
3026
+ } else {
3027
+ repoState.taskAvailablePending = true;
3028
+ }
3029
+ }
3014
3030
  }
3015
3031
  }
3016
3032
  } catch {
@@ -144,7 +144,7 @@ async function createCaptureIdeaTask(fileSystem, dustPath, options) {
144
144
  const filePath2 = `${dustPath}/tasks/${filename2}`;
145
145
  const content2 = `# ${taskTitle2}
146
146
 
147
- Research this idea thoroughly, review \`.dust/goals/\` and \`.dust/facts/\` for relevant context, then create one or more narrowly-scoped task files in \`.dust/tasks/\`. Each task should deliver a thin but complete vertical slice of working software.
147
+ Research this idea thoroughly, then create one or more narrowly-scoped task files in \`.dust/tasks/\`. Review \`.dust/goals/\` and \`.dust/facts/\` for relevant context. Each task should deliver a thin but complete vertical slice of working software.
148
148
 
149
149
  ## Idea Description
150
150
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@joshski/dust",
3
- "version": "0.1.47",
3
+ "version": "0.1.49",
4
4
  "description": "Flow state for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {