@joshski/dust 0.1.41 → 0.1.42

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 +14 -12
  2. package/package.json +1 -1
package/dist/dust.js CHANGED
@@ -1118,10 +1118,10 @@ async function run(prompt, options = {}, dependencies = defaultRunnerDependencie
1118
1118
  import { spawn as nodeSpawn2 } from "node:child_process";
1119
1119
 
1120
1120
  // lib/cli/commands/focus.ts
1121
- function buildImplementationInstructions(bin, hooksInstalled) {
1121
+ function buildImplementationInstructions(bin, hooksInstalled, taskTitle) {
1122
1122
  const steps = [];
1123
1123
  let step = 1;
1124
- steps.push(`Note: Skip the \`${bin} agent\` step - your task has already been specified below.`, "");
1124
+ steps.push(`Note: Do NOT run \`${bin} agent\`.`, "");
1125
1125
  steps.push(`${step}. Run \`${bin} check\` to verify the project is in a good state`);
1126
1126
  step++;
1127
1127
  steps.push(`${step}. Implement the task`);
@@ -1130,7 +1130,8 @@ function buildImplementationInstructions(bin, hooksInstalled) {
1130
1130
  steps.push(`${step}. Run \`${bin} check\` before committing`);
1131
1131
  step++;
1132
1132
  }
1133
- steps.push(`${step}. Create a single atomic commit that includes:`, " - All implementation changes", " - Deletion of the completed task file", " - Updates to any facts that changed", " - Deletion of the idea file that spawned this task (if remaining scope exists, create new ideas for it)", "", ' Use the task title as the commit message. Task titles are written in imperative form, which is the recommended style for git commit messages. Do not add prefixes like "Complete task:" - use the title directly.', "", ' Example: If the task title is "Add validation for user input", the commit message should be:', " ```", " Add validation for user input", " ```", "");
1133
+ const commitMessageLine = taskTitle ? ` Use this exact commit message: "${taskTitle}". Do not add any prefix.` : ' Use the task title as the commit message. Do not add prefixes like "Complete task:" - use the title directly.';
1134
+ steps.push(`${step}. Create a single atomic commit that includes:`, " - All implementation changes", " - Deletion of the completed task file", " - Updates to any facts that changed", " - Deletion of the idea file that spawned this task (if remaining scope exists, create new ideas for it)", "", commitMessageLine, "");
1134
1135
  step++;
1135
1136
  steps.push(`${step}. Push your commit to the remote repository`);
1136
1137
  steps.push("");
@@ -1333,7 +1334,7 @@ async function runOneIteration(dependencies, loopDependencies, onLoopEvent, onAg
1333
1334
  type: "loop.sync_skipped",
1334
1335
  reason: pullResult.message
1335
1336
  });
1336
- const prompt2 = `Note: Skip the \`dust agent\` step - your task has already been specified below.
1337
+ const prompt2 = `Note: Do NOT run \`dust agent\`.
1337
1338
 
1338
1339
  git pull failed with the following error:
1339
1340
 
@@ -1383,14 +1384,14 @@ Make sure the repository is in a clean state and synced with remote before finis
1383
1384
  onLoopEvent({ type: "loop.tasks_found" });
1384
1385
  const taskContent = await dependencies.fileSystem.readFile(`${dependencies.context.cwd}/${task.path}`);
1385
1386
  const { dustCommand, installCommand = "npm install" } = dependencies.settings;
1386
- const instructions = buildImplementationInstructions(dustCommand, true);
1387
+ const instructions = buildImplementationInstructions(dustCommand, true, task.title ?? undefined);
1387
1388
  const prompt = `Run \`${installCommand}\` to install dependencies, then implement the following task.
1388
1389
 
1389
- ## Task: ${task.title}
1390
-
1391
1390
  The following is the contents of the task file \`${task.path}\`:
1392
1391
 
1392
+ ----------
1393
1393
  ${taskContent}
1394
+ ----------
1394
1395
 
1395
1396
  When the task is complete, delete the task file \`${task.path}\`.
1396
1397
 
@@ -2478,9 +2479,10 @@ function createKeypressHandler(useTUI, state, onQuit, options) {
2478
2479
  onQuit();
2479
2480
  };
2480
2481
  }
2481
- async function resolveToken(commandArgs, authDeps, context) {
2482
- if (commandArgs[0]) {
2483
- return commandArgs[0];
2482
+ async function resolveToken(authDeps, context) {
2483
+ const envToken = process.env.DUST_BUCKET_TOKEN;
2484
+ if (envToken) {
2485
+ return envToken;
2484
2486
  }
2485
2487
  const stored = await loadStoredToken(authDeps.fileSystem, authDeps.getHomeDir());
2486
2488
  if (stored) {
@@ -2498,8 +2500,8 @@ async function resolveToken(commandArgs, authDeps, context) {
2498
2500
  }
2499
2501
  }
2500
2502
  async function bucket(dependencies, bucketDeps = createDefaultBucketDependencies()) {
2501
- const { arguments: commandArgs, context, fileSystem } = dependencies;
2502
- const token = await resolveToken(commandArgs, bucketDeps.auth, context);
2503
+ const { context, fileSystem } = dependencies;
2504
+ const token = await resolveToken(bucketDeps.auth, context);
2503
2505
  if (!token) {
2504
2506
  return { exitCode: 1 };
2505
2507
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@joshski/dust",
3
- "version": "0.1.41",
3
+ "version": "0.1.42",
4
4
  "description": "Flow state for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {