@joshski/dust 0.1.37 → 0.1.38

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 (2) hide show
  1. package/dist/dust.js +12 -12
  2. package/package.json +1 -1
package/dist/dust.js CHANGED
@@ -702,7 +702,7 @@ function rawEventToAgentEvent(rawEvent) {
702
702
  function formatAgentEvent(event) {
703
703
  switch (event.type) {
704
704
  case "agent-session-started":
705
- return "\uD83E\uDD16 Starting Claude...";
705
+ return `\uD83E\uDD16 Starting Claude: ${event.title}`;
706
706
  case "agent-session-ended":
707
707
  return event.success ? "\uD83E\uDD16 Claude session ended (success)" : `\uD83E\uDD16 Claude session ended (error: ${event.error})`;
708
708
  case "agent-session-activity":
@@ -1330,7 +1330,10 @@ async function runOneIteration(dependencies, loopDependencies, onLoopEvent, onAg
1330
1330
  type: "loop.sync_skipped",
1331
1331
  reason: pullResult.message
1332
1332
  });
1333
- onAgentEvent?.({ type: "agent-session-started" });
1333
+ onAgentEvent?.({
1334
+ type: "agent-session-started",
1335
+ title: "Resolving git conflict"
1336
+ });
1334
1337
  const prompt2 = `git pull failed with the following error:
1335
1338
 
1336
1339
  ${pullResult.message}
@@ -1369,9 +1372,12 @@ Make sure the repository is in a clean state and synced with remote before finis
1369
1372
  onLoopEvent({ type: "loop.no_tasks" });
1370
1373
  return "no_tasks";
1371
1374
  }
1372
- onLoopEvent({ type: "loop.tasks_found" });
1373
- onAgentEvent?.({ type: "agent-session-started" });
1374
1375
  const task = tasks[0];
1376
+ onLoopEvent({ type: "loop.tasks_found" });
1377
+ onAgentEvent?.({
1378
+ type: "agent-session-started",
1379
+ title: task.title ?? task.path
1380
+ });
1375
1381
  const taskContent = await dependencies.fileSystem.readFile(`${dependencies.context.cwd}/${task.path}`);
1376
1382
  const { dustCommand, installCommand = "npm install" } = dependencies.settings;
1377
1383
  const instructions = buildImplementationInstructions(dustCommand, true);
@@ -1453,14 +1459,11 @@ async function loopClaude(dependencies, loopDependencies = createDefaultDependen
1453
1459
  const iterationOptions = {};
1454
1460
  if (eventsUrl) {
1455
1461
  iterationOptions.onRawEvent = (rawEvent) => {
1456
- if (typeof rawEvent.session_id === "string" && rawEvent.session_id) {
1457
- agentSessionId = rawEvent.session_id;
1458
- }
1459
1462
  onAgentEvent(rawEventToAgentEvent(rawEvent));
1460
1463
  };
1461
1464
  }
1462
1465
  while (completedIterations < maxIterations) {
1463
- agentSessionId = undefined;
1466
+ agentSessionId = crypto.randomUUID();
1464
1467
  const result = await runOneIteration(dependencies, loopDependencies, onLoopEvent, onAgentEvent, iterationOptions);
1465
1468
  if (result === "no_tasks") {
1466
1469
  await loopDependencies.sleep(SLEEP_INTERVAL_MS);
@@ -1618,12 +1621,9 @@ async function runRepositoryLoop(repoState, repoDeps, sendEvent, sessionId) {
1618
1621
  }
1619
1622
  };
1620
1623
  while (!repoState.stopRequested) {
1621
- agentSessionId = undefined;
1624
+ agentSessionId = crypto.randomUUID();
1622
1625
  const result = await runOneIteration(commandDeps, loopDeps, onLoopEvent, onAgentEvent, {
1623
1626
  onRawEvent: (rawEvent) => {
1624
- if (typeof rawEvent.session_id === "string" && rawEvent.session_id) {
1625
- agentSessionId = rawEvent.session_id;
1626
- }
1627
1627
  onAgentEvent(rawEventToAgentEvent(rawEvent));
1628
1628
  }
1629
1629
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@joshski/dust",
3
- "version": "0.1.37",
3
+ "version": "0.1.38",
4
4
  "description": "Flow state for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {