/** * GSD Tools Bridge — programmatic access to GSD planning operations. * * By default routes commands through the SDK **query registry** (same handlers as * `gsd-sdk query`) so `PhaseRunner`, `InitRunner`, and `GSD` share contracts with * the typed CLI. Runner hot-path helpers (`initPhaseOp`, `phasePlanIndex`, * `phaseComplete`, `initNewProject`, `configSet`, `commit`) call * `registry.dispatch()` with canonical keys when native query is active, avoiding * repeated argv resolution. When a workstream is set, dispatches to `gsd-tools.cjs` so * workstream env stays aligned with CJS. */ import type { InitNewProjectInfo, PhaseOpInfo, PhasePlanIndex, RoadmapAnalysis } from './types.js'; import type { GSDEventStream } from './event-stream.js'; import { type RuntimeBridgeOptions } from './query-runtime-bridge.js'; export { GSDToolsError } from './gsd-tools-error.js'; export declare class GSDTools { private readonly projectDir; private readonly gsdToolsPath; private readonly timeoutMs; private readonly workstream?; private readonly bridge; private readonly preferNativeQuery; private readonly commandExecutor; private readonly hotpathMethods; constructor(opts: { projectDir: string; gsdToolsPath?: string; timeoutMs?: number; workstream?: string; /** When set, mutation handlers emit the same events as `gsd-sdk query`. */ eventStream?: GSDEventStream; /** Correlation id for mutation events when `eventStream` is set. */ sessionId?: string; /** * When true (default), route known commands through the SDK query registry. * Set false in tests that substitute a mock `gsdToolsPath` script. */ preferNativeQuery?: boolean; /** When true, fail if a command has no native registry adapter. */ strictSdk?: boolean; /** Explicit subprocess bridge policy. Default false for SDK-native mode. */ allowFallbackToSubprocess?: boolean; /** Structured runtime bridge dispatch observability callback. */ onDispatchEvent?: RuntimeBridgeOptions['onDispatchEvent']; }); private shouldUseNativeQuery; private nativeMatch; private dispatchNativeHotpath; private executeWithToolsError; /** * Execute a gsd-tools command and return parsed JSON output. * Handles the `@file:` prefix pattern for large results. */ exec(command: string, args?: string[]): Promise; /** * Execute a gsd-tools command and return raw stdout without JSON parsing. * Use for commands like `config-set` that return plain text, not JSON. */ execRaw(command: string, args?: string[]): Promise; stateLoad(): Promise; roadmapAnalyze(): Promise; phaseComplete(phase: string): Promise; commit(message: string, files?: string[]): Promise; verifySummary(path: string): Promise; initExecutePhase(phase: string): Promise; /** * Query phase state from gsd-tools.cjs `init phase-op`. * Returns a typed PhaseOpInfo describing what exists on disk for this phase. */ initPhaseOp(phaseNumber: string): Promise; /** * Get a config value via the `config-get` surface (CJS and registry use the same key path). */ configGet(key: string): Promise; /** * Begin phase state tracking in gsd-tools.cjs. */ stateBeginPhase(phaseNumber: string): Promise; /** * Get the plan index for a phase, grouping plans into dependency waves. * Returns typed PhasePlanIndex with wave assignments and completion status. */ phasePlanIndex(phaseNumber: string): Promise; /** * Query new-project init state from gsd-tools.cjs `init new-project`. * Returns project metadata, model configs, brownfield detection, etc. */ initNewProject(): Promise; /** * Set a config value via gsd-tools.cjs `config-set`. * Handles type coercion (booleans, numbers, JSON) on the gsd-tools side. * Note: config-set returns `key=value` text, not JSON, so we use execRaw. */ configSet(key: string, value: string): Promise; } export { resolveGsdToolsPath } from './query-gsd-tools-path.js'; //# sourceMappingURL=gsd-tools.d.ts.map