@joshski/dust 0.1.80 → 0.1.81

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.
@@ -11,10 +11,12 @@ import type { CommandDependencies } from '../cli/types';
11
11
  export declare function getRepoPath(repoName: string, reposDir: string): string;
12
12
  /**
13
13
  * Clone a repository to a temporary directory.
14
+ * Tries HTTPS first, falls back to SSH if available and HTTPS fails.
14
15
  */
15
16
  export declare function cloneRepository(repository: {
16
17
  name: string;
17
18
  gitUrl: string;
19
+ gitSshUrl?: string;
18
20
  }, targetPath: string, spawn: typeof nodeSpawn, context: CommandDependencies['context']): Promise<boolean>;
19
21
  /**
20
22
  * Remove a repository directory.
@@ -14,6 +14,7 @@ export { runRepositoryLoop } from './repository-loop';
14
14
  export interface Repository {
15
15
  name: string;
16
16
  gitUrl: string;
17
+ gitSshUrl?: string;
17
18
  url: string;
18
19
  id: number;
19
20
  agentProvider?: string;
package/dist/dust.js CHANGED
@@ -318,7 +318,7 @@ async function loadSettings(cwd, fileSystem) {
318
318
  }
319
319
 
320
320
  // lib/version.ts
321
- var DUST_VERSION = "0.1.80";
321
+ var DUST_VERSION = "0.1.81";
322
322
 
323
323
  // lib/session.ts
324
324
  var DUST_UNATTENDED = "DUST_UNATTENDED";
@@ -2481,9 +2481,9 @@ function getRepoPath(repoName, reposDir) {
2481
2481
  const safeName = repoName.replace(/[^a-zA-Z0-9-_/]/g, "-");
2482
2482
  return join7(reposDir, safeName);
2483
2483
  }
2484
- async function cloneRepository(repository, targetPath, spawn, context) {
2484
+ function cloneWithUrl(url, targetPath, spawn) {
2485
2485
  return new Promise((resolve) => {
2486
- const proc = spawn("git", ["clone", repository.gitUrl, targetPath], {
2486
+ const proc = spawn("git", ["clone", url, targetPath], {
2487
2487
  stdio: ["ignore", "pipe", "pipe"],
2488
2488
  env: {
2489
2489
  ...process.env,
@@ -2496,19 +2496,30 @@ async function cloneRepository(repository, targetPath, spawn, context) {
2496
2496
  stderr += data.toString();
2497
2497
  });
2498
2498
  proc.on("close", (code) => {
2499
- if (code === 0) {
2500
- resolve(true);
2501
- } else {
2502
- context.stderr(`Failed to clone ${repository.name}: ${stderr.trim()}`);
2503
- resolve(false);
2504
- }
2499
+ resolve({ success: code === 0, stderr: stderr.trim() });
2505
2500
  });
2506
2501
  proc.on("error", (error) => {
2507
- context.stderr(`Failed to clone ${repository.name}: ${error.message}`);
2508
- resolve(false);
2502
+ resolve({ success: false, stderr: error.message });
2509
2503
  });
2510
2504
  });
2511
2505
  }
2506
+ async function cloneRepository(repository, targetPath, spawn, context) {
2507
+ const httpsResult = await cloneWithUrl(repository.gitUrl, targetPath, spawn);
2508
+ if (httpsResult.success) {
2509
+ return true;
2510
+ }
2511
+ if (repository.gitSshUrl) {
2512
+ context.stderr(`HTTPS clone failed for ${repository.name}, trying SSH: ${httpsResult.stderr}`);
2513
+ const sshResult = await cloneWithUrl(repository.gitSshUrl, targetPath, spawn);
2514
+ if (sshResult.success) {
2515
+ return true;
2516
+ }
2517
+ context.stderr(`Failed to clone ${repository.name} via SSH: ${sshResult.stderr}`);
2518
+ return false;
2519
+ }
2520
+ context.stderr(`Failed to clone ${repository.name}: ${httpsResult.stderr}`);
2521
+ return false;
2522
+ }
2512
2523
  async function removeRepository(path, spawn, context) {
2513
2524
  return new Promise((resolve) => {
2514
2525
  const proc = spawn("rm", ["-rf", path], {
@@ -3693,6 +3704,9 @@ function parseServerMessage(data) {
3693
3704
  url: repo.url,
3694
3705
  hasTask: repo.hasTask
3695
3706
  };
3707
+ if (typeof repo.gitSshUrl === "string") {
3708
+ item.gitSshUrl = repo.gitSshUrl;
3709
+ }
3696
3710
  if (typeof repo.agentProvider === "string") {
3697
3711
  item.agentProvider = repo.agentProvider;
3698
3712
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@joshski/dust",
3
- "version": "0.1.80",
3
+ "version": "0.1.81",
4
4
  "description": "Flow state for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {