@joshski/dust 0.1.96 → 0.1.98

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.
@@ -12,9 +12,11 @@ import { type AuthConfig, type RuntimeConfig, type SessionConfig } from '../env-
12
12
  import type { ToolExecutionRequest, ToolExecutionResult } from './command-events-proxy';
13
13
  import { type BucketEmitFn, type SendEventFn } from './events';
14
14
  import { type LogBuffer } from './log-buffer';
15
+ import { type RepositoryLifecycleState } from './repository-lifecycle';
15
16
  import type { ToolDefinition } from './server-messages';
16
17
  export { cloneRepository, getRepoPath, removeRepository, } from './repository-git';
17
18
  export { runRepositoryLoop } from './repository-loop';
19
+ export type { RepositoryLifecycleState } from './repository-lifecycle';
18
20
  export interface Repository {
19
21
  name: string;
20
22
  gitUrl: string;
@@ -26,13 +28,11 @@ export interface Repository {
26
28
  export interface RepositoryState {
27
29
  repository: Repository;
28
30
  path: string;
29
- loopPromise: Promise<void> | null;
30
- stopRequested: boolean;
31
31
  logBuffer: LogBuffer;
32
+ lifecycle: RepositoryLifecycleState;
32
33
  agentStatus: 'idle' | 'busy';
33
34
  wakeUp?: () => void;
34
35
  taskAvailablePending?: boolean;
35
- cancelCurrentIteration?: () => void;
36
36
  }
37
37
  /**
38
38
  * Interface for the subset of bucket state needed by repository management.
@@ -64,9 +64,11 @@ export interface RepositoryDependencies {
64
64
  forwardToolExecution?: (request: ToolExecutionRequest) => Promise<ToolExecutionResult>;
65
65
  /** Mark a tool family as revealed (for progressive disclosure) */
66
66
  revealFamily?: (familyName: string) => void;
67
+ /** Shell runner for pre-flight commands (install, check) */
68
+ shellRunner?: import('../cli/process-runner').ShellRunner;
67
69
  }
68
70
  /**
69
- * Start (or restart) the per-repository loop and keep loopPromise state accurate.
71
+ * Start (or restart) the per-repository loop and keep lifecycle state accurate.
70
72
  */
71
73
  export declare function startRepositoryLoop(repoState: RepositoryState, repoDeps: RepositoryDependencies, sendEvent?: SendEventFn, sessionId?: string): void;
72
74
  export declare function createDefaultRepositoryDependencies(fileSystem: FileSystem): RepositoryDependencies;
@@ -7,5 +7,5 @@
7
7
  * Usage: dust focus "add login box"
8
8
  */
9
9
  import type { CommandDependencies, CommandResult } from '../types';
10
- export declare function buildImplementationInstructions(bin: string, hooksInstalled: boolean, taskTitle?: string, taskPath?: string, installCommand?: string): string;
10
+ export declare function buildImplementationInstructions(bin: string, hooksInstalled: boolean, taskTitle?: string, taskPath?: string, installCommand?: string, skipPreflightSteps?: boolean): string;
11
11
  export declare function focus(dependencies: CommandDependencies): Promise<CommandResult>;
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Shared process runner utilities for buffered command execution.
3
+ *
4
+ * Provides a unified interface for running shell commands and git commands
5
+ * with buffered output capture.
6
+ */
7
+ import { type ChildProcess } from 'node:child_process';
8
+ export interface ProcessResult {
9
+ exitCode: number;
10
+ output: string;
11
+ timedOut?: boolean;
12
+ }
13
+ type SpawnFn = (command: string, commandArguments: string[], options: {
14
+ cwd: string;
15
+ shell?: boolean;
16
+ }) => ChildProcess;
17
+ /**
18
+ * Creates a buffered process runner for executing shell commands.
19
+ * Commands are run with shell: true for command string interpretation.
20
+ */
21
+ export interface ShellRunner {
22
+ run: (command: string, cwd: string, timeoutMs?: number) => Promise<ProcessResult>;
23
+ }
24
+ export declare function createShellRunner(spawnFn: SpawnFn): ShellRunner;
25
+ export declare const defaultShellRunner: ShellRunner;
26
+ /**
27
+ * Creates a buffered process runner for executing git commands.
28
+ * Git is run directly without shell interpretation.
29
+ */
30
+ export interface GitRunner {
31
+ run: (gitArguments: string[], cwd: string) => Promise<ProcessResult>;
32
+ }
33
+ export declare function createGitRunner(spawnFn: SpawnFn): GitRunner;
34
+ export declare const defaultGitRunner: GitRunner;
35
+ export {};