@ordewell/core 0.4.0 → 0.4.2

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.
package/dist/index.d.mts CHANGED
@@ -537,6 +537,11 @@ interface UserSettings {
537
537
  enabled: boolean;
538
538
  };
539
539
  modelAllowlist?: Record<string, string[]>;
540
+ /**
541
+ * Runners the user picked for planning. Absent — not empty — is what falls
542
+ * back to the environment's defaults; `[]` is a deliberate "none of them".
543
+ */
544
+ enabledRunners?: string[];
540
545
  }
541
546
  /**
542
547
  * Where the user's toggles live. `ORDEWELL_SETTINGS_PATH` overrides it so several
@@ -570,6 +575,8 @@ declare class SettingsService {
570
575
  setResearchSubagents(enabled: boolean): void;
571
576
  getModelAllowlist(runner: string): string[] | undefined;
572
577
  setModelAllowlist(runner: string, ids: string[] | undefined): void;
578
+ getEnabledRunners(): string[] | undefined;
579
+ setEnabledRunners(ids: string[]): void;
573
580
  private load;
574
581
  private persist;
575
582
  }
@@ -762,29 +769,33 @@ declare class HeadlessSession extends AbstractTerminalSession {
762
769
  private process;
763
770
  private outputBuffer;
764
771
  constructor(id: string, taskId: string, spawnImpl: SpawnFn);
772
+ get isStarted(): boolean;
765
773
  start(launch: LaunchPlan, cwd: string, resolvedPath: string, env?: Record<string, string>): void;
766
774
  kill(): void;
767
775
  getOutput(): string;
768
776
  write(text: string): void;
769
777
  }
778
+ type RunnerSpawnOptions = Parameters<ITerminalRunner['spawn']>[0];
779
+ /** Everything needed to start one runner process, resolved before any child exists. */
780
+ interface PreparedLaunch {
781
+ launch: LaunchPlan;
782
+ resolvedPath: string;
783
+ env: Record<string, string>;
784
+ /** True when the invocation was wrapped in `script` to allocate a PTY. */
785
+ pty: boolean;
786
+ }
770
787
  declare class HeadlessRunner extends AbstractRunner<HeadlessSession> {
771
788
  private spawnImpl;
772
789
  private hasScriptCmd;
773
790
  private resolvePath;
774
791
  private launchDeps;
792
+ /** Session shape when the caller names none; the VS Code runner overrides it to interactive. */
793
+ protected readonly defaultHeadless: boolean;
775
794
  constructor(deps?: HeadlessRunnerDeps);
776
- spawn(opts: {
777
- taskId: string;
778
- runner: string;
779
- prompt: string;
780
- modelId?: string;
781
- thinkingEffort?: string;
782
- modelVariants?: string[];
783
- mode?: string;
784
- headless?: boolean;
785
- cwd: string;
786
- registry?: RunnerRegistry;
787
- }): Promise<ITerminalSession>;
795
+ protected createSession(id: string, taskId: string): HeadlessSession;
796
+ /** Everything up to, but not including, spawning — so a surface that owns its own child reaches the same decisions. */
797
+ protected prepareLaunch(opts: RunnerSpawnOptions): Promise<PreparedLaunch>;
798
+ spawn(opts: RunnerSpawnOptions): Promise<ITerminalSession>;
788
799
  }
789
800
 
790
801
  /**
@@ -2698,6 +2709,30 @@ declare function buildRunnerInvocation(opts: {
2698
2709
  registry: RunnerRegistry;
2699
2710
  }): RunnerInvocation;
2700
2711
 
2712
+ interface PriorOutput {
2713
+ order: number;
2714
+ title: string;
2715
+ reviewReason: string;
2716
+ logTail: string;
2717
+ }
2718
+ declare function summarizeOutput(reviewReason: string | undefined, output: string): {
2719
+ reviewReason: string;
2720
+ logTail: string;
2721
+ capturedAt: string;
2722
+ };
2723
+ declare function collectDirectDependencyOutputs(task: Task, allTasks: Task[]): PriorOutput[];
2724
+ declare function renderPriorOutputs(outputs: PriorOutput[]): string;
2725
+ declare function augmentPromptWithPriorOutputs(task: Task, allTasks: Task[]): string;
2726
+ declare function renderPlanMap(allTasks: Task[], currentTaskId: string, opts?: {
2727
+ maxEntries?: number;
2728
+ }): string;
2729
+ interface ComposeOptions {
2730
+ planMapEnabled?: boolean;
2731
+ planMapMaxEntries?: number;
2732
+ tddEnabled?: boolean;
2733
+ }
2734
+ declare function composeAugmentedPrompt(task: Task, allTasks: Task[], opts?: ComposeOptions): string;
2735
+
2701
2736
  type ExecFileFn = (command: string, args: string[]) => Promise<{
2702
2737
  stdout: string;
2703
2738
  stderr: string;
@@ -2987,4 +3022,4 @@ declare function sanitizeSlug(raw: string): string;
2987
3022
  /** Save the PRD to `<workspace>/.scratch/<slug>/PRD.md` (to-prd native convention). */
2988
3023
  declare function savePrdMarkdown(workspace: string, slug: string, markdown: string): string;
2989
3024
 
2990
- export { ALL_PROVIDERS, AUTO_COMMANDS, AbstractRunner, AbstractTerminalSession, ActiveTaskSession, type AgentAdapter, type AgentAdapterFactory, type AgentEvent, type AgentProcessDeps, type AgentStartOptions, AiProvider, ApprovalKind, ApprovalMode, ApprovalRequest, ApprovalSource, BaseAiService, BaseConfig, BaseFileSystem, CLAUDE_CODE_MANIFEST, CLI_PROVIDERS, CMD_EXE_MAX_COMMAND_LINE, CORE_PLANNER_PROMPT, type CappedRows, type CheckpointListener, ClaudeCodeAdapter, CliAgentAiService, type CliAgentAiServiceDeps, CodexAdapter, type CommandClassification, CommandLineTooLongError, type CommandTier, ConsoleLogger, ContextCollector, ConversationMessage, type ConversationRequest, type ConversationTurn, DiscoveredModel, EmbeddedNewlineError, EnvConfig, type ExecFileFn, type ExecImpl, FindSymbolOptions, FsPluginStore, GIT_READONLY_SUBCOMMANDS, GeminiService, GlobOptions, type GrepInvocation, GrepOptions, HeadlessRunner, type HeadlessRunnerDeps, type IAiService, IApproval, IConfig, IFileSystem, type ILogger, type INotification, IPluginStore, ITerminalRunner, ITerminalSession, JSON_REPAIR_INSTRUCTION, type KillTreeDeps, type LaunchDeps, type LaunchPlan, LegacyPlanState, LineBuffer, type MappedTool, ModelResolver, type ModelResolverDeps, type ModifyPlanRequest, type NotificationAction, OPENCODE_MANIFEST, OpenAiService, OpenCodeAdapter, type OrchestratorObserver, OrchestratorOption, PROVIDER_DETECT_PRIORITY, PROVIDER_LABEL, PROVIDER_PRIORITY, PROVIDER_SHORT_LABEL, type PendingApproval, PendingApprovals, type PendingApprovalsOptions, PlanParseError, type PlanRequest, PlanState, PlanStatus, PlanStore, Planner, type PlannerReplyClassification, type PlannerRuntimeToggles, type PrdBlock, type ProbeFn, ProviderModelLists, type ProviderRegistration, QueuedMessage, REFUSED_COMMANDS, ReadFileOpts, type RepairLoopOpts, type RepairVerdict, type ResearchChat, ResearchLogEntry, ResearchProgress, type ResearchShell, type ResearchShellDeps, ResearchStep, ResearchToolType, type ResearchTurn, ResolveContext, type RunnerCatalog, RunnerId, RunnerInstallation, RunnerInvocation, type RunnerMode, RunnerModeInfo, RunnerPluginManifest, RunnerRegistry, STATE_DIR, SYMBOL_LANGUAGES, type SerializedPlan, type SerializedTask, type SerializedTaskStatus, Session, type SessionBroadcaster, type SessionData, type SessionDeps, type SessionMessage, type SessionMeta, type SessionPlanner, type SessionRuntimeSettings, SettingsService, type ShellDialect, type SpawnSpec, StdioAgentAdapter, TRUNCATED_PLAN_REPAIR_INSTRUCTION, Task, TaskOp, TaskOrchestrator, TaskSnapshot, TmuxRunner, type TmuxRunnerDeps, type ToolCall, ToolOutcome, type ToolResult, type UserSettings, Verdict, VerdictEngine, type VerdictListener, WINDOWS_MAX_COMMAND_LINE, applyHeadLimit, augmentedPath, buildConversationSystemPrompt, buildFallbackGrepArgs, buildGlobArgs, buildGrepArgs, buildMergePrompt, buildModifyDuringExecutionPrompt, buildModifyPlanPrompt, buildPlanWithResults, buildResearchPrompt, buildResearchToolsPrompt, buildRunnerInvocation, buildShellInvocation, buildSplitPrompt, buildSubagentSystemPrompt, clampThinkingEffort, classifyCommand, classifyPlannerReply, clearAugmentedPathCache, clearResearchShellCache, clearState, coerceAssignments, configuredProviders, createAiService, defaultLogger, definitionPattern, deleteSession, discoverGeminiModels, effectiveAllowlist, ensureDir, executionLogBlock, executionSummary, extractPrdBlock, filterFallbackByAnchoredInclude, filterModelsForPrompt, formatSearchOutput, generatePlanWithRepair, getLatestSession, getProviderMeta, getSettingsPath, getStateDir, grantScopeFor, hasTmux, includeGlobFor, isCliProvider, isOpenAiProvider, killTree, languageForId, listSessions, loadSession, loadSessionPlanState, loadState, mapAgentTool, modelContextBlock, modifyValidationFeedback, normalizeAgentArgs, normalizeGeminiModel, pendingEditRulesBlock, planDirectLaunch, planShellLaunch, posixShellQuote, prefixModelId, providerForRunner, reEmitPlanPrompt, reEmitTaskOpsPrompt, referencePattern, repairLoop, researchShellWarning, researchToolsPath, resolveArgs, resolveProviderFromPrefix, resolveResearchShell, resolveWithin, retargetTaskRunner, runnerAssignment, runnerForProvider, sanitizeSlug, savePrdMarkdown, saveSession, saveState, serializePlan, serializeTask, serializeTaskStatus, sessionRuntimeSettings, stateExists, stripAnsi, stripModelPrefix, taskOpsRejectedPrompt, tmuxSessionName, tmuxSocketName, tmuxWindowName, truncatedPlanReEmitPrompt, wellKnownBinDirs, windowsCommandLine, withPath, wrapWithPty };
3025
+ export { ALL_PROVIDERS, AUTO_COMMANDS, AbstractRunner, AbstractTerminalSession, ActiveTaskSession, type AgentAdapter, type AgentAdapterFactory, type AgentEvent, type AgentProcessDeps, type AgentStartOptions, AiProvider, ApprovalKind, ApprovalMode, ApprovalRequest, ApprovalSource, BaseAiService, BaseConfig, BaseFileSystem, CLAUDE_CODE_MANIFEST, CLI_PROVIDERS, CMD_EXE_MAX_COMMAND_LINE, CORE_PLANNER_PROMPT, type CappedRows, type CheckpointListener, ClaudeCodeAdapter, CliAgentAiService, type CliAgentAiServiceDeps, CodexAdapter, type CommandClassification, CommandLineTooLongError, type CommandTier, type ComposeOptions, ConsoleLogger, ContextCollector, ConversationMessage, type ConversationRequest, type ConversationTurn, DiscoveredModel, EmbeddedNewlineError, EnvConfig, type ExecFileFn, type ExecImpl, FindSymbolOptions, FsPluginStore, GIT_READONLY_SUBCOMMANDS, GeminiService, GlobOptions, type GrepInvocation, GrepOptions, HeadlessRunner, type HeadlessRunnerDeps, HeadlessSession, type IAiService, IApproval, IConfig, IFileSystem, type ILogger, type INotification, IPluginStore, ITerminalRunner, ITerminalSession, JSON_REPAIR_INSTRUCTION, type KillTreeDeps, type LaunchDeps, type LaunchPlan, LegacyPlanState, LineBuffer, type MappedTool, ModelResolver, type ModelResolverDeps, type ModifyPlanRequest, type NotificationAction, OPENCODE_MANIFEST, OpenAiService, OpenCodeAdapter, type OrchestratorObserver, OrchestratorOption, PROVIDER_DETECT_PRIORITY, PROVIDER_LABEL, PROVIDER_PRIORITY, PROVIDER_SHORT_LABEL, type PendingApproval, PendingApprovals, type PendingApprovalsOptions, PlanParseError, type PlanRequest, PlanState, PlanStatus, PlanStore, Planner, type PlannerReplyClassification, type PlannerRuntimeToggles, type PrdBlock, type PreparedLaunch, type PriorOutput, type ProbeFn, ProviderModelLists, type ProviderRegistration, QueuedMessage, REFUSED_COMMANDS, ReadFileOpts, type RepairLoopOpts, type RepairVerdict, type ResearchChat, ResearchLogEntry, ResearchProgress, type ResearchShell, type ResearchShellDeps, ResearchStep, ResearchToolType, type ResearchTurn, ResolveContext, type RunnerCatalog, RunnerId, RunnerInstallation, RunnerInvocation, type RunnerMode, RunnerModeInfo, RunnerPluginManifest, RunnerRegistry, type RunnerSpawnOptions, STATE_DIR, SYMBOL_LANGUAGES, type SerializedPlan, type SerializedTask, type SerializedTaskStatus, Session, type SessionBroadcaster, type SessionData, type SessionDeps, type SessionMessage, type SessionMeta, type SessionPlanner, type SessionRuntimeSettings, SettingsService, type ShellDialect, type SpawnSpec, StdioAgentAdapter, TRUNCATED_PLAN_REPAIR_INSTRUCTION, Task, TaskOp, TaskOrchestrator, TaskSnapshot, TmuxRunner, type TmuxRunnerDeps, type ToolCall, ToolOutcome, type ToolResult, type UserSettings, Verdict, VerdictEngine, type VerdictListener, WINDOWS_MAX_COMMAND_LINE, applyHeadLimit, augmentPromptWithPriorOutputs, augmentedPath, buildConversationSystemPrompt, buildFallbackGrepArgs, buildGlobArgs, buildGrepArgs, buildMergePrompt, buildModifyDuringExecutionPrompt, buildModifyPlanPrompt, buildPlanWithResults, buildResearchPrompt, buildResearchToolsPrompt, buildRunnerInvocation, buildShellInvocation, buildSplitPrompt, buildSubagentSystemPrompt, clampThinkingEffort, classifyCommand, classifyPlannerReply, clearAugmentedPathCache, clearResearchShellCache, clearState, coerceAssignments, collectDirectDependencyOutputs, composeAugmentedPrompt, configuredProviders, createAiService, defaultLogger, definitionPattern, deleteSession, discoverGeminiModels, effectiveAllowlist, ensureDir, executionLogBlock, executionSummary, extractPrdBlock, filterFallbackByAnchoredInclude, filterModelsForPrompt, formatSearchOutput, generatePlanWithRepair, getLatestSession, getProviderMeta, getSettingsPath, getStateDir, grantScopeFor, hasTmux, includeGlobFor, isCliProvider, isOpenAiProvider, killTree, languageForId, listSessions, loadSession, loadSessionPlanState, loadState, mapAgentTool, modelContextBlock, modifyValidationFeedback, normalizeAgentArgs, normalizeGeminiModel, pendingEditRulesBlock, planDirectLaunch, planShellLaunch, posixShellQuote, prefixModelId, providerForRunner, reEmitPlanPrompt, reEmitTaskOpsPrompt, referencePattern, renderPlanMap, renderPriorOutputs, repairLoop, researchShellWarning, researchToolsPath, resolveArgs, resolveProviderFromPrefix, resolveResearchShell, resolveWithin, retargetTaskRunner, runnerAssignment, runnerForProvider, sanitizeSlug, savePrdMarkdown, saveSession, saveState, serializePlan, serializeTask, serializeTaskStatus, sessionRuntimeSettings, stateExists, stripAnsi, stripModelPrefix, summarizeOutput, taskOpsRejectedPrompt, tmuxSessionName, tmuxSocketName, tmuxWindowName, truncatedPlanReEmitPrompt, wellKnownBinDirs, windowsCommandLine, withPath, wrapWithPty };
package/dist/index.d.ts CHANGED
@@ -537,6 +537,11 @@ interface UserSettings {
537
537
  enabled: boolean;
538
538
  };
539
539
  modelAllowlist?: Record<string, string[]>;
540
+ /**
541
+ * Runners the user picked for planning. Absent — not empty — is what falls
542
+ * back to the environment's defaults; `[]` is a deliberate "none of them".
543
+ */
544
+ enabledRunners?: string[];
540
545
  }
541
546
  /**
542
547
  * Where the user's toggles live. `ORDEWELL_SETTINGS_PATH` overrides it so several
@@ -570,6 +575,8 @@ declare class SettingsService {
570
575
  setResearchSubagents(enabled: boolean): void;
571
576
  getModelAllowlist(runner: string): string[] | undefined;
572
577
  setModelAllowlist(runner: string, ids: string[] | undefined): void;
578
+ getEnabledRunners(): string[] | undefined;
579
+ setEnabledRunners(ids: string[]): void;
573
580
  private load;
574
581
  private persist;
575
582
  }
@@ -762,29 +769,33 @@ declare class HeadlessSession extends AbstractTerminalSession {
762
769
  private process;
763
770
  private outputBuffer;
764
771
  constructor(id: string, taskId: string, spawnImpl: SpawnFn);
772
+ get isStarted(): boolean;
765
773
  start(launch: LaunchPlan, cwd: string, resolvedPath: string, env?: Record<string, string>): void;
766
774
  kill(): void;
767
775
  getOutput(): string;
768
776
  write(text: string): void;
769
777
  }
778
+ type RunnerSpawnOptions = Parameters<ITerminalRunner['spawn']>[0];
779
+ /** Everything needed to start one runner process, resolved before any child exists. */
780
+ interface PreparedLaunch {
781
+ launch: LaunchPlan;
782
+ resolvedPath: string;
783
+ env: Record<string, string>;
784
+ /** True when the invocation was wrapped in `script` to allocate a PTY. */
785
+ pty: boolean;
786
+ }
770
787
  declare class HeadlessRunner extends AbstractRunner<HeadlessSession> {
771
788
  private spawnImpl;
772
789
  private hasScriptCmd;
773
790
  private resolvePath;
774
791
  private launchDeps;
792
+ /** Session shape when the caller names none; the VS Code runner overrides it to interactive. */
793
+ protected readonly defaultHeadless: boolean;
775
794
  constructor(deps?: HeadlessRunnerDeps);
776
- spawn(opts: {
777
- taskId: string;
778
- runner: string;
779
- prompt: string;
780
- modelId?: string;
781
- thinkingEffort?: string;
782
- modelVariants?: string[];
783
- mode?: string;
784
- headless?: boolean;
785
- cwd: string;
786
- registry?: RunnerRegistry;
787
- }): Promise<ITerminalSession>;
795
+ protected createSession(id: string, taskId: string): HeadlessSession;
796
+ /** Everything up to, but not including, spawning — so a surface that owns its own child reaches the same decisions. */
797
+ protected prepareLaunch(opts: RunnerSpawnOptions): Promise<PreparedLaunch>;
798
+ spawn(opts: RunnerSpawnOptions): Promise<ITerminalSession>;
788
799
  }
789
800
 
790
801
  /**
@@ -2698,6 +2709,30 @@ declare function buildRunnerInvocation(opts: {
2698
2709
  registry: RunnerRegistry;
2699
2710
  }): RunnerInvocation;
2700
2711
 
2712
+ interface PriorOutput {
2713
+ order: number;
2714
+ title: string;
2715
+ reviewReason: string;
2716
+ logTail: string;
2717
+ }
2718
+ declare function summarizeOutput(reviewReason: string | undefined, output: string): {
2719
+ reviewReason: string;
2720
+ logTail: string;
2721
+ capturedAt: string;
2722
+ };
2723
+ declare function collectDirectDependencyOutputs(task: Task, allTasks: Task[]): PriorOutput[];
2724
+ declare function renderPriorOutputs(outputs: PriorOutput[]): string;
2725
+ declare function augmentPromptWithPriorOutputs(task: Task, allTasks: Task[]): string;
2726
+ declare function renderPlanMap(allTasks: Task[], currentTaskId: string, opts?: {
2727
+ maxEntries?: number;
2728
+ }): string;
2729
+ interface ComposeOptions {
2730
+ planMapEnabled?: boolean;
2731
+ planMapMaxEntries?: number;
2732
+ tddEnabled?: boolean;
2733
+ }
2734
+ declare function composeAugmentedPrompt(task: Task, allTasks: Task[], opts?: ComposeOptions): string;
2735
+
2701
2736
  type ExecFileFn = (command: string, args: string[]) => Promise<{
2702
2737
  stdout: string;
2703
2738
  stderr: string;
@@ -2987,4 +3022,4 @@ declare function sanitizeSlug(raw: string): string;
2987
3022
  /** Save the PRD to `<workspace>/.scratch/<slug>/PRD.md` (to-prd native convention). */
2988
3023
  declare function savePrdMarkdown(workspace: string, slug: string, markdown: string): string;
2989
3024
 
2990
- export { ALL_PROVIDERS, AUTO_COMMANDS, AbstractRunner, AbstractTerminalSession, ActiveTaskSession, type AgentAdapter, type AgentAdapterFactory, type AgentEvent, type AgentProcessDeps, type AgentStartOptions, AiProvider, ApprovalKind, ApprovalMode, ApprovalRequest, ApprovalSource, BaseAiService, BaseConfig, BaseFileSystem, CLAUDE_CODE_MANIFEST, CLI_PROVIDERS, CMD_EXE_MAX_COMMAND_LINE, CORE_PLANNER_PROMPT, type CappedRows, type CheckpointListener, ClaudeCodeAdapter, CliAgentAiService, type CliAgentAiServiceDeps, CodexAdapter, type CommandClassification, CommandLineTooLongError, type CommandTier, ConsoleLogger, ContextCollector, ConversationMessage, type ConversationRequest, type ConversationTurn, DiscoveredModel, EmbeddedNewlineError, EnvConfig, type ExecFileFn, type ExecImpl, FindSymbolOptions, FsPluginStore, GIT_READONLY_SUBCOMMANDS, GeminiService, GlobOptions, type GrepInvocation, GrepOptions, HeadlessRunner, type HeadlessRunnerDeps, type IAiService, IApproval, IConfig, IFileSystem, type ILogger, type INotification, IPluginStore, ITerminalRunner, ITerminalSession, JSON_REPAIR_INSTRUCTION, type KillTreeDeps, type LaunchDeps, type LaunchPlan, LegacyPlanState, LineBuffer, type MappedTool, ModelResolver, type ModelResolverDeps, type ModifyPlanRequest, type NotificationAction, OPENCODE_MANIFEST, OpenAiService, OpenCodeAdapter, type OrchestratorObserver, OrchestratorOption, PROVIDER_DETECT_PRIORITY, PROVIDER_LABEL, PROVIDER_PRIORITY, PROVIDER_SHORT_LABEL, type PendingApproval, PendingApprovals, type PendingApprovalsOptions, PlanParseError, type PlanRequest, PlanState, PlanStatus, PlanStore, Planner, type PlannerReplyClassification, type PlannerRuntimeToggles, type PrdBlock, type ProbeFn, ProviderModelLists, type ProviderRegistration, QueuedMessage, REFUSED_COMMANDS, ReadFileOpts, type RepairLoopOpts, type RepairVerdict, type ResearchChat, ResearchLogEntry, ResearchProgress, type ResearchShell, type ResearchShellDeps, ResearchStep, ResearchToolType, type ResearchTurn, ResolveContext, type RunnerCatalog, RunnerId, RunnerInstallation, RunnerInvocation, type RunnerMode, RunnerModeInfo, RunnerPluginManifest, RunnerRegistry, STATE_DIR, SYMBOL_LANGUAGES, type SerializedPlan, type SerializedTask, type SerializedTaskStatus, Session, type SessionBroadcaster, type SessionData, type SessionDeps, type SessionMessage, type SessionMeta, type SessionPlanner, type SessionRuntimeSettings, SettingsService, type ShellDialect, type SpawnSpec, StdioAgentAdapter, TRUNCATED_PLAN_REPAIR_INSTRUCTION, Task, TaskOp, TaskOrchestrator, TaskSnapshot, TmuxRunner, type TmuxRunnerDeps, type ToolCall, ToolOutcome, type ToolResult, type UserSettings, Verdict, VerdictEngine, type VerdictListener, WINDOWS_MAX_COMMAND_LINE, applyHeadLimit, augmentedPath, buildConversationSystemPrompt, buildFallbackGrepArgs, buildGlobArgs, buildGrepArgs, buildMergePrompt, buildModifyDuringExecutionPrompt, buildModifyPlanPrompt, buildPlanWithResults, buildResearchPrompt, buildResearchToolsPrompt, buildRunnerInvocation, buildShellInvocation, buildSplitPrompt, buildSubagentSystemPrompt, clampThinkingEffort, classifyCommand, classifyPlannerReply, clearAugmentedPathCache, clearResearchShellCache, clearState, coerceAssignments, configuredProviders, createAiService, defaultLogger, definitionPattern, deleteSession, discoverGeminiModels, effectiveAllowlist, ensureDir, executionLogBlock, executionSummary, extractPrdBlock, filterFallbackByAnchoredInclude, filterModelsForPrompt, formatSearchOutput, generatePlanWithRepair, getLatestSession, getProviderMeta, getSettingsPath, getStateDir, grantScopeFor, hasTmux, includeGlobFor, isCliProvider, isOpenAiProvider, killTree, languageForId, listSessions, loadSession, loadSessionPlanState, loadState, mapAgentTool, modelContextBlock, modifyValidationFeedback, normalizeAgentArgs, normalizeGeminiModel, pendingEditRulesBlock, planDirectLaunch, planShellLaunch, posixShellQuote, prefixModelId, providerForRunner, reEmitPlanPrompt, reEmitTaskOpsPrompt, referencePattern, repairLoop, researchShellWarning, researchToolsPath, resolveArgs, resolveProviderFromPrefix, resolveResearchShell, resolveWithin, retargetTaskRunner, runnerAssignment, runnerForProvider, sanitizeSlug, savePrdMarkdown, saveSession, saveState, serializePlan, serializeTask, serializeTaskStatus, sessionRuntimeSettings, stateExists, stripAnsi, stripModelPrefix, taskOpsRejectedPrompt, tmuxSessionName, tmuxSocketName, tmuxWindowName, truncatedPlanReEmitPrompt, wellKnownBinDirs, windowsCommandLine, withPath, wrapWithPty };
3025
+ export { ALL_PROVIDERS, AUTO_COMMANDS, AbstractRunner, AbstractTerminalSession, ActiveTaskSession, type AgentAdapter, type AgentAdapterFactory, type AgentEvent, type AgentProcessDeps, type AgentStartOptions, AiProvider, ApprovalKind, ApprovalMode, ApprovalRequest, ApprovalSource, BaseAiService, BaseConfig, BaseFileSystem, CLAUDE_CODE_MANIFEST, CLI_PROVIDERS, CMD_EXE_MAX_COMMAND_LINE, CORE_PLANNER_PROMPT, type CappedRows, type CheckpointListener, ClaudeCodeAdapter, CliAgentAiService, type CliAgentAiServiceDeps, CodexAdapter, type CommandClassification, CommandLineTooLongError, type CommandTier, type ComposeOptions, ConsoleLogger, ContextCollector, ConversationMessage, type ConversationRequest, type ConversationTurn, DiscoveredModel, EmbeddedNewlineError, EnvConfig, type ExecFileFn, type ExecImpl, FindSymbolOptions, FsPluginStore, GIT_READONLY_SUBCOMMANDS, GeminiService, GlobOptions, type GrepInvocation, GrepOptions, HeadlessRunner, type HeadlessRunnerDeps, HeadlessSession, type IAiService, IApproval, IConfig, IFileSystem, type ILogger, type INotification, IPluginStore, ITerminalRunner, ITerminalSession, JSON_REPAIR_INSTRUCTION, type KillTreeDeps, type LaunchDeps, type LaunchPlan, LegacyPlanState, LineBuffer, type MappedTool, ModelResolver, type ModelResolverDeps, type ModifyPlanRequest, type NotificationAction, OPENCODE_MANIFEST, OpenAiService, OpenCodeAdapter, type OrchestratorObserver, OrchestratorOption, PROVIDER_DETECT_PRIORITY, PROVIDER_LABEL, PROVIDER_PRIORITY, PROVIDER_SHORT_LABEL, type PendingApproval, PendingApprovals, type PendingApprovalsOptions, PlanParseError, type PlanRequest, PlanState, PlanStatus, PlanStore, Planner, type PlannerReplyClassification, type PlannerRuntimeToggles, type PrdBlock, type PreparedLaunch, type PriorOutput, type ProbeFn, ProviderModelLists, type ProviderRegistration, QueuedMessage, REFUSED_COMMANDS, ReadFileOpts, type RepairLoopOpts, type RepairVerdict, type ResearchChat, ResearchLogEntry, ResearchProgress, type ResearchShell, type ResearchShellDeps, ResearchStep, ResearchToolType, type ResearchTurn, ResolveContext, type RunnerCatalog, RunnerId, RunnerInstallation, RunnerInvocation, type RunnerMode, RunnerModeInfo, RunnerPluginManifest, RunnerRegistry, type RunnerSpawnOptions, STATE_DIR, SYMBOL_LANGUAGES, type SerializedPlan, type SerializedTask, type SerializedTaskStatus, Session, type SessionBroadcaster, type SessionData, type SessionDeps, type SessionMessage, type SessionMeta, type SessionPlanner, type SessionRuntimeSettings, SettingsService, type ShellDialect, type SpawnSpec, StdioAgentAdapter, TRUNCATED_PLAN_REPAIR_INSTRUCTION, Task, TaskOp, TaskOrchestrator, TaskSnapshot, TmuxRunner, type TmuxRunnerDeps, type ToolCall, ToolOutcome, type ToolResult, type UserSettings, Verdict, VerdictEngine, type VerdictListener, WINDOWS_MAX_COMMAND_LINE, applyHeadLimit, augmentPromptWithPriorOutputs, augmentedPath, buildConversationSystemPrompt, buildFallbackGrepArgs, buildGlobArgs, buildGrepArgs, buildMergePrompt, buildModifyDuringExecutionPrompt, buildModifyPlanPrompt, buildPlanWithResults, buildResearchPrompt, buildResearchToolsPrompt, buildRunnerInvocation, buildShellInvocation, buildSplitPrompt, buildSubagentSystemPrompt, clampThinkingEffort, classifyCommand, classifyPlannerReply, clearAugmentedPathCache, clearResearchShellCache, clearState, coerceAssignments, collectDirectDependencyOutputs, composeAugmentedPrompt, configuredProviders, createAiService, defaultLogger, definitionPattern, deleteSession, discoverGeminiModels, effectiveAllowlist, ensureDir, executionLogBlock, executionSummary, extractPrdBlock, filterFallbackByAnchoredInclude, filterModelsForPrompt, formatSearchOutput, generatePlanWithRepair, getLatestSession, getProviderMeta, getSettingsPath, getStateDir, grantScopeFor, hasTmux, includeGlobFor, isCliProvider, isOpenAiProvider, killTree, languageForId, listSessions, loadSession, loadSessionPlanState, loadState, mapAgentTool, modelContextBlock, modifyValidationFeedback, normalizeAgentArgs, normalizeGeminiModel, pendingEditRulesBlock, planDirectLaunch, planShellLaunch, posixShellQuote, prefixModelId, providerForRunner, reEmitPlanPrompt, reEmitTaskOpsPrompt, referencePattern, renderPlanMap, renderPriorOutputs, repairLoop, researchShellWarning, researchToolsPath, resolveArgs, resolveProviderFromPrefix, resolveResearchShell, resolveWithin, retargetTaskRunner, runnerAssignment, runnerForProvider, sanitizeSlug, savePrdMarkdown, saveSession, saveState, serializePlan, serializeTask, serializeTaskStatus, sessionRuntimeSettings, stateExists, stripAnsi, stripModelPrefix, summarizeOutput, taskOpsRejectedPrompt, tmuxSessionName, tmuxSocketName, tmuxWindowName, truncatedPlanReEmitPrompt, wellKnownBinDirs, windowsCommandLine, withPath, wrapWithPty };
package/dist/index.js CHANGED
@@ -56,6 +56,7 @@ __export(index_exports, {
56
56
  GREP_DEFAULT_HEAD_LIMIT: () => GREP_DEFAULT_HEAD_LIMIT,
57
57
  GeminiService: () => GeminiService,
58
58
  HeadlessRunner: () => HeadlessRunner,
59
+ HeadlessSession: () => HeadlessSession,
59
60
  JSON_REPAIR_INSTRUCTION: () => JSON_REPAIR_INSTRUCTION,
60
61
  LineBuffer: () => LineBuffer,
61
62
  ModelCatalog: () => ModelCatalog,
@@ -91,6 +92,7 @@ __export(index_exports, {
91
92
  addTaskToPlan: () => addTaskToPlan,
92
93
  applyHeadLimit: () => applyHeadLimit,
93
94
  applyTaskOps: () => applyTaskOps,
95
+ augmentPromptWithPriorOutputs: () => augmentPromptWithPriorOutputs,
94
96
  augmentedPath: () => augmentedPath,
95
97
  buildConversationSystemPrompt: () => buildConversationSystemPrompt,
96
98
  buildFallbackGrepArgs: () => buildFallbackGrepArgs,
@@ -123,7 +125,9 @@ __export(index_exports, {
123
125
  clearResearchShellCache: () => clearResearchShellCache,
124
126
  clearState: () => clearState,
125
127
  coerceAssignments: () => coerceAssignments,
128
+ collectDirectDependencyOutputs: () => collectDirectDependencyOutputs,
126
129
  collectProviderCredentials: () => collectProviderCredentials,
130
+ composeAugmentedPrompt: () => composeAugmentedPrompt,
127
131
  configuredProviders: () => configuredProviders,
128
132
  createAiService: () => createAiService,
129
133
  createEmptyPlan: () => createEmptyPlan,
@@ -190,6 +194,8 @@ __export(index_exports, {
190
194
  reEmitTaskOpsPrompt: () => reEmitTaskOpsPrompt,
191
195
  referencePattern: () => referencePattern,
192
196
  removeTaskFromPlan: () => removeTaskFromPlan,
197
+ renderPlanMap: () => renderPlanMap,
198
+ renderPriorOutputs: () => renderPriorOutputs,
193
199
  renumberTasks: () => renumberTasks,
194
200
  repairLoop: () => repairLoop,
195
201
  researchShellWarning: () => researchShellWarning,
@@ -219,6 +225,7 @@ __export(index_exports, {
219
225
  stripModelNoise: () => stripModelNoise,
220
226
  stripModelPrefix: () => stripModelPrefix,
221
227
  stripTrailingCommas: () => stripTrailingCommas,
228
+ summarizeOutput: () => summarizeOutput,
222
229
  summarizeToolCall: () => summarizeToolCall,
223
230
  taskOpsRejectedPrompt: () => taskOpsRejectedPrompt,
224
231
  textHasTaskOps: () => textHasTaskOps,
@@ -5599,6 +5606,14 @@ ${tail}`;
5599
5606
 
5600
5607
  ${blocks.join("\n\n")}`;
5601
5608
  }
5609
+ function augmentPromptWithPriorOutputs(task, allTasks) {
5610
+ const basePrompt = task.prompt ?? "";
5611
+ const outputs = collectDirectDependencyOutputs(task, allTasks);
5612
+ if (outputs.length === 0) return basePrompt;
5613
+ return `${renderPriorOutputs(outputs)}
5614
+
5615
+ ${basePrompt}`;
5616
+ }
5602
5617
  function planMapStatus(task, isCurrent) {
5603
5618
  if (isCurrent) return "NOW";
5604
5619
  if (task.status === "completed") return "done";
@@ -11641,7 +11656,11 @@ var HeadlessSession = class extends AbstractTerminalSession {
11641
11656
  spawnImpl;
11642
11657
  process = null;
11643
11658
  outputBuffer = "";
11659
+ get isStarted() {
11660
+ return this.process !== null;
11661
+ }
11644
11662
  start(launch, cwd, resolvedPath, env) {
11663
+ if (this.exited || this.process) return;
11645
11664
  this.process = this.spawnImpl(launch.file, launch.args, {
11646
11665
  env: withPath(process.env, resolvedPath, env),
11647
11666
  stdio: ["pipe", "pipe", "pipe"],
@@ -11670,6 +11689,7 @@ Process error: ${err.message}
11670
11689
  }
11671
11690
  kill() {
11672
11691
  killTree(this.process);
11692
+ if (!this.process) this.baseHandleExit(-1);
11673
11693
  }
11674
11694
  getOutput() {
11675
11695
  return this.outputBuffer;
@@ -11685,6 +11705,8 @@ var HeadlessRunner = class extends AbstractRunner {
11685
11705
  hasScriptCmd;
11686
11706
  resolvePath;
11687
11707
  launchDeps;
11708
+ /** Session shape when the caller names none; the VS Code runner overrides it to interactive. */
11709
+ defaultHeadless = true;
11688
11710
  constructor(deps = {}) {
11689
11711
  super();
11690
11712
  this.spawnImpl = deps.spawnImpl ?? import_child_process6.spawn;
@@ -11692,9 +11714,12 @@ var HeadlessRunner = class extends AbstractRunner {
11692
11714
  this.resolvePath = deps.resolvePath ?? augmentedPath;
11693
11715
  this.launchDeps = { resolvePath: this.resolvePath, ...deps.launchDeps };
11694
11716
  }
11695
- async spawn(opts) {
11696
- const id = `ordewell-${opts.taskId.slice(0, 8)}`;
11697
- const session = new HeadlessSession(id, opts.taskId, this.spawnImpl);
11717
+ createSession(id, taskId) {
11718
+ return new HeadlessSession(id, taskId, this.spawnImpl);
11719
+ }
11720
+ /** Everything up to, but not including, spawning — so a surface that owns its own child reaches the same decisions. */
11721
+ async prepareLaunch(opts) {
11722
+ const headless = opts.headless ?? this.defaultHeadless;
11698
11723
  const invocation = buildRunnerInvocation({
11699
11724
  runner: opts.runner,
11700
11725
  prompt: opts.prompt,
@@ -11702,21 +11727,27 @@ var HeadlessRunner = class extends AbstractRunner {
11702
11727
  thinkingEffort: opts.thinkingEffort,
11703
11728
  modelVariants: opts.modelVariants,
11704
11729
  mode: opts.mode,
11705
- headless: opts.headless ?? true,
11730
+ headless,
11706
11731
  registry: opts.registry
11707
11732
  });
11708
11733
  const manifest = opts.registry?.get(opts.runner)?.manifest;
11709
- const requiresTty = manifest?.runner.requiresTty === true && this.hasScriptCmd();
11710
- const modeStr = opts.mode === "plan" ? "plan" : "build";
11711
- console.error(`[headless] Starting ${opts.runner} [${modeStr}] (${opts.modelId || "default"}) for task ${opts.taskId.slice(0, 8)}${requiresTty ? " (PTY)" : ""}`);
11734
+ const pty = (manifest?.runner.requiresTty === true || !headless) && this.hasScriptCmd();
11712
11735
  const resolvedPath = await this.resolvePath();
11713
- const { command, args } = requiresTty ? wrapWithPty(invocation.command, invocation.args) : { command: invocation.command, args: invocation.args };
11714
- session.start(
11715
- await planDirectLaunch(command, args, this.launchDeps),
11716
- opts.cwd,
11736
+ const { command, args } = pty ? wrapWithPty(invocation.command, invocation.args) : { command: invocation.command, args: invocation.args };
11737
+ return {
11738
+ launch: await planDirectLaunch(command, args, this.launchDeps),
11717
11739
  resolvedPath,
11718
- invocation.env
11719
- );
11740
+ env: invocation.env,
11741
+ pty
11742
+ };
11743
+ }
11744
+ async spawn(opts) {
11745
+ const id = `ordewell-${opts.taskId.slice(0, 8)}`;
11746
+ const session = this.createSession(id, opts.taskId);
11747
+ const prepared = await this.prepareLaunch(opts);
11748
+ const modeStr = opts.mode === "plan" ? "plan" : "build";
11749
+ console.error(`[headless] Starting ${opts.runner} [${modeStr}] (${opts.modelId || "default"}) for task ${opts.taskId.slice(0, 8)}${prepared.pty ? " (PTY)" : ""}`);
11750
+ session.start(prepared.launch, opts.cwd, prepared.resolvedPath, prepared.env);
11720
11751
  this.registerSession(id, session);
11721
11752
  return session;
11722
11753
  }
@@ -12684,6 +12715,14 @@ var SettingsService = class {
12684
12715
  }
12685
12716
  this.persist();
12686
12717
  }
12718
+ getEnabledRunners() {
12719
+ return this.getAll().enabledRunners;
12720
+ }
12721
+ setEnabledRunners(ids) {
12722
+ this.getAll();
12723
+ this.cache.enabledRunners = [...ids];
12724
+ this.persist();
12725
+ }
12687
12726
  load() {
12688
12727
  try {
12689
12728
  if (fs8.existsSync(this.filePath)) {
@@ -12701,6 +12740,9 @@ var SettingsService = class {
12701
12740
  if (raw.modelAllowlist !== void 0) {
12702
12741
  settings.modelAllowlist = raw.modelAllowlist;
12703
12742
  }
12743
+ if (Array.isArray(raw.enabledRunners)) {
12744
+ settings.enabledRunners = raw.enabledRunners.map(String);
12745
+ }
12704
12746
  return settings;
12705
12747
  }
12706
12748
  } catch {
@@ -12744,6 +12786,7 @@ var SettingsService = class {
12744
12786
  GREP_DEFAULT_HEAD_LIMIT,
12745
12787
  GeminiService,
12746
12788
  HeadlessRunner,
12789
+ HeadlessSession,
12747
12790
  JSON_REPAIR_INSTRUCTION,
12748
12791
  LineBuffer,
12749
12792
  ModelCatalog,
@@ -12779,6 +12822,7 @@ var SettingsService = class {
12779
12822
  addTaskToPlan,
12780
12823
  applyHeadLimit,
12781
12824
  applyTaskOps,
12825
+ augmentPromptWithPriorOutputs,
12782
12826
  augmentedPath,
12783
12827
  buildConversationSystemPrompt,
12784
12828
  buildFallbackGrepArgs,
@@ -12811,7 +12855,9 @@ var SettingsService = class {
12811
12855
  clearResearchShellCache,
12812
12856
  clearState,
12813
12857
  coerceAssignments,
12858
+ collectDirectDependencyOutputs,
12814
12859
  collectProviderCredentials,
12860
+ composeAugmentedPrompt,
12815
12861
  configuredProviders,
12816
12862
  createAiService,
12817
12863
  createEmptyPlan,
@@ -12878,6 +12924,8 @@ var SettingsService = class {
12878
12924
  reEmitTaskOpsPrompt,
12879
12925
  referencePattern,
12880
12926
  removeTaskFromPlan,
12927
+ renderPlanMap,
12928
+ renderPriorOutputs,
12881
12929
  renumberTasks,
12882
12930
  repairLoop,
12883
12931
  researchShellWarning,
@@ -12907,6 +12955,7 @@ var SettingsService = class {
12907
12955
  stripModelNoise,
12908
12956
  stripModelPrefix,
12909
12957
  stripTrailingCommas,
12958
+ summarizeOutput,
12910
12959
  summarizeToolCall,
12911
12960
  taskOpsRejectedPrompt,
12912
12961
  textHasTaskOps,