import type { PanelManagerLike } from '../host-ui.js'; import type { ConfigManager } from '../../config/index.js'; import type { ServiceRegistry } from '../../config/service-registry.js'; import type { SubscriptionManager } from '../../config/subscriptions.js'; import type { SecretsManager } from '../../config/secrets.js'; import type { AutomationManager } from '../../automation/index.js'; import type { ApprovalBroker, SharedSessionBroker } from '../../control-plane/index.js'; import type { DistributedRuntimeManager } from '../remote/distributed-runtime.js'; import type { RemoteRunnerRegistry } from '../remote/runner-registry.js'; import type { RemoteSupervisor } from '../remote/supervisor.js'; import type { ProviderRegistry } from '../../providers/registry.js'; import type { RuntimeStore } from '../store/index.js'; import type { RuntimeEventBus, RuntimeEventDomain } from '../events/index.js'; import type { ProviderAccountSnapshot } from '../provider-accounts/registry.js'; import type { UserAuthManager } from '../../security/user-auth.js'; import { type RecoveryFileInfo } from '../session-persistence.js'; import type { SessionSurface } from '../session-surface.js'; import { type ManagedWorktreeMeta, type WorktreeOwnershipSummary } from '../worktree/registry.js'; import type { ManagedRollbackRecord, SettingsConflictRecord, StagedManagedBundle } from '../settings/control-plane-store.js'; import type { FeatureFlagManager } from '../feature-flags/index.js'; import { type SecuritySettingReport } from '../security-settings.js'; /** * Everything the service needs that is NOT about where files live. The storage * scope is bolted on separately below, because it comes in two mutually * exclusive shapes. */ export interface IntegrationHelpersServices { readonly runtimeStore: RuntimeStore; readonly runtimeBus: RuntimeEventBus; readonly configManager?: ConfigManager | undefined; readonly featureFlags?: FeatureFlagManager | undefined; readonly getConversationTitle?: (() => string | undefined) | undefined; readonly automationManager: AutomationManager; readonly approvalBroker: ApprovalBroker; readonly sessionBroker: SharedSessionBroker; readonly distributedRuntime: DistributedRuntimeManager; readonly remoteRunnerRegistry: RemoteRunnerRegistry; readonly remoteSupervisor: RemoteSupervisor; readonly panelManager: PanelManagerLike; readonly localUserAuthManager: UserAuthManager; readonly providerRegistry: ProviderRegistry; readonly serviceRegistry: ServiceRegistry; readonly subscriptionManager: SubscriptionManager; readonly secretsManager: SecretsManager; } /** * Legacy construction scope: the loose `workingDirectory` / `homeDirectory` * pair, passed straight through to session-persistence's legacy call form. * Unchanged, byte-for-byte, for every existing caller. `surface` is declared * as `undefined` here purely so this shape and the surface shape below are * mutually exclusive at the type level, the same discriminated-union pattern * session-persistence-scope.ts uses for its own options. */ export interface IntegrationHelpersLegacyScope { readonly workingDirectory: string; readonly homeDirectory: string; readonly surface?: undefined; } /** * Surface construction scope: a declare-once `SessionSurface`. Every * persistence read this service performs then resolves through the SAME * surface-scoped paths the product writes with, which is the whole point. * A surface-scoped product constructed with the loose fields instead got its * continuity answers from the unscoped legacy directories, i.e. from paths * nothing had written to. */ export interface IntegrationHelpersSurfaceScope { readonly surface: SessionSurface; readonly workingDirectory?: undefined; readonly homeDirectory?: undefined; } export type IntegrationHelpersContext = (IntegrationHelpersServices & IntegrationHelpersLegacyScope) | (IntegrationHelpersServices & IntegrationHelpersSurfaceScope); export interface PanelSnapshot { readonly id: string; readonly name: string; readonly category: string; readonly description: string; readonly open: boolean; } export interface SettingsSnapshotUnavailable { readonly available: false; readonly reason: string; } export interface SettingsSnapshotAvailable { readonly available: true; readonly liveKeyCount: number; readonly profileCount: number; readonly managedLockCount: number; readonly resolvedCounts: Readonly>; readonly conflicts: readonly SettingsConflictRecord[]; readonly recentFailures: readonly { readonly surface: string; readonly message: string; readonly timestamp: number; }[]; readonly stagedManagedBundle?: StagedManagedBundle | undefined; readonly rollbackHistory: readonly ManagedRollbackRecord[]; } export type SettingsSnapshot = SettingsSnapshotUnavailable | SettingsSnapshotAvailable; export interface ContinuitySnapshot { readonly sessionId: string; readonly status: string; readonly recoveryState: string; readonly lastSessionPointer: string | null; /** * Whether a crash snapshot would be OFFERED right now, `checkRecoveryFile`'s * answer, not a bare `existsSync`. A snapshot a live process is still * rewriting, or one its own session already superseded with a clean save, * reports false while its file sits on disk. That is the question worth * asking here; "a file exists somewhere" is not. */ readonly recoveryFilePresent: boolean; readonly recoveryFile: RecoveryFileInfo | null; } export interface WorktreeSnapshot { readonly summary: WorktreeOwnershipSummary; readonly records: readonly ManagedWorktreeMeta[]; } export declare class IntegrationHelperService { private readonly context; constructor(context: IntegrationHelpersContext); getRuntimeStore(): RuntimeStore; getContext(): IntegrationHelpersContext; /** * The scope every session-persistence call in this service passes along: * the construction-time `SessionSurface` when there is one, otherwise the * legacy `workingDirectory` / `homeDirectory` pair verbatim. Resolved in one * place so no call site can reach for the wrong pair of paths. */ private persistenceOptions; /** * The project root, from whichever construction shape was used. A * `SessionSurface` carries its own `workingDirectory`, so surface-scoped * callers do not pass one separately. */ private projectWorkingDirectory; buildReview(): { readonly apiFamilies: readonly string[]; readonly routes: readonly string[]; readonly sessions: number; readonly tasks: number; readonly pendingApprovals: number; readonly remoteContracts: number; readonly panels: number; }; getSessionSnapshot(): Record; getTaskSnapshot(): Record; getAutomationSnapshot(): Record; getRouteSnapshot(): Record; getApprovalSnapshot(): Record; getSessionBrokerSnapshot(): Record; getDeliverySnapshot(): Record; getRemoteSnapshot(): Record; getHealthSnapshot(): Record; getAccountsSnapshot(): Promise; getSettingsSnapshot(): SettingsSnapshot; getSecuritySettingsReport(): readonly SecuritySettingReport[]; getLocalAuthSnapshot(): Record; getContinuitySnapshot(): ContinuitySnapshot; getWorktreeSnapshot(): WorktreeSnapshot; getIntelligenceSnapshot(): Record; listPanels(): PanelSnapshot[]; openPanel(id: string, pane?: 'top' | 'bottom'): boolean; createEventStream(request: Request, domains: readonly RuntimeEventDomain[]): Response; } //# sourceMappingURL=helpers.d.ts.map