import type { ConfigManager } from '../config/manager.js'; import type { ProviderRegistry } from '../providers/registry.js'; import type { ContentPart, LLMProvider } from '../providers/interface.js'; import type { CacheHitTracker } from '../providers/cache-strategy.js'; import type { SessionLineageTracker } from './session-lineage.js'; import type { IdempotencyStore } from '../runtime/idempotency/index.js'; import type { AdaptivePlanner } from './adaptive-planner.js'; import type { ExecutionPlanManager } from './execution-plan.js'; import type { SessionMemoryStore } from './session-memory.js'; import type { FavoritesStore } from '../providers/favorites.js'; import type { TurnKnowledgeRegistrySource, TurnCodeIndexSource } from '../agents/turn-knowledge-injection.js'; import type { CodeIndexReindexScheduler } from '../state/code-index-reindex.js'; export type OrchestratorCoreServices = { configManager?: Pick | undefined; providerRegistry?: ProviderRegistry | undefined; cacheHitTracker?: Pick | undefined; sessionLineageTracker?: SessionLineageTracker | undefined; idempotencyStore?: IdempotencyStore | undefined; planManager?: Pick; adaptivePlanner?: Pick; sessionMemoryStore?: Pick | undefined; favoritesStore?: Pick | undefined; /** * Narrow injection seam for the MAIN interactive session's per-turn * passive knowledge injection (see core/orchestrator-turn-loop.ts). Optional/undefined * is a hard no-op, the feature never runs and the base system prompt is * byte-identical, matching the agent path's `memoryRegistry` semantics. Wired * in post-construction via `Orchestrator.setCoreServices({ memoryRegistry })` since, * like `sessionMemoryStore`/`planManager` above, it is not required at construction * time. */ memoryRegistry?: TurnKnowledgeRegistrySource | undefined; /** * Stage B code-index injection seam for the MAIN interactive session. Optional/ * undefined is a hard no-op (memory-only injection, base prompt byte-identical). Whether code * hits are actually injected is additionally gated by the `agent-passive-code-injection` * gate (off by default via agents.passiveInjection.code) and `isCodeInjectionSettingEnabled` below, both must hold. */ codeIndex?: TurnCodeIndexSource | undefined; /** * Live gate for the embedder's storage.codeIndexEnabled setting. Undefined defaults to * "allowed", the capability gate alone then governs. ANDed with the gate each turn so a runtime * toggle of either takes effect without reconstructing the orchestrator. */ isCodeInjectionSettingEnabled?: (() => boolean) | undefined; /** * Stage B tool-site reindex scheduler. Optional/undefined is a hard no-op. When wired, * a successful write/edit tool call schedules a debounced incremental reindex of the touched * path(s) (never blocking the tool result). */ codeIndexReindexScheduler?: Pick | undefined; /** * The daemon's live-turn controls holder (control-plane * SessionLiveTurnControlsHolder, typed structurally to keep core free of a * control-plane import). When wired via setCoreServices, the orchestrator * binds itself so remote surfaces can cancel one in-flight tool call and * list/edit/delete queued mid-turn messages over the operator wire; dispose() * unbinds. Optional/undefined is a hard no-op. */ sessionLiveTurnControls?: LiveTurnControlsBinding | undefined; }; /** The structural slice of the live-turn controls an Orchestrator provides. */ export interface OrchestratorLiveTurnControls { cancelToolCall(callId: string): boolean; listQueuedMessages(): ReadonlyArray<{ readonly id: string; readonly queuedAt: number; readonly text: string; }>; editQueuedMessage(id: string, text: string): boolean; deleteQueuedMessage(id: string): boolean; } /** Structural mirror of control-plane SessionLiveTurnControlsHolder (bind/unbind). */ export interface LiveTurnControlsBinding { bind(controls: OrchestratorLiveTurnControls): void; unbind(controls: OrchestratorLiveTurnControls): void; } export declare function normalizeUsage(usage: Awaited>['usage']): Awaited>['usage']; export declare function estimateFreshTurnInputTokens(lastInputTokens: number, currentEstimatedTokens: number, text: string, content?: ContentPart[]): number; export declare function getSessionLineageTracker(services: OrchestratorCoreServices, ownedSessionLineageTracker: SessionLineageTracker): SessionLineageTracker; export declare function getIdempotencyStore(services: OrchestratorCoreServices, ownedIdempotencyStore: IdempotencyStore): IdempotencyStore; export declare function requireConfigManager(services: OrchestratorCoreServices): Pick; export declare function requireProviderRegistry(services: OrchestratorCoreServices): ProviderRegistry; export declare function getCacheHitTracker(services: OrchestratorCoreServices, ownedCacheHitTracker: Pick): Pick; export declare function createEmitterContext(sessionId: string, turnId: string): import('../runtime/emitters/index.js').EmitterContext; //# sourceMappingURL=orchestrator-runtime.d.ts.map