## Public API Report File for "@grackle-ai/plugin-core"

> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).

```ts

import { cleanupLifecycleStream } from '@grackle-ai/core';
import type { ConnectRouter } from '@connectrpc/connect';
import type { DispatchQueueRow } from '@grackle-ai/database';
import type { Disposable as Disposable_2 } from '@grackle-ai/core';
import { ensureLifecycleStream } from '@grackle-ai/core';
import type { EnvironmentRow } from '@grackle-ai/database';
import type { EnvironmentStatus } from '@grackle-ai/common';
import type { GrackleEventType } from '@grackle-ai/core';
import type { PluginContext } from '@grackle-ai/core';
import type { ReconciliationPhase } from '@grackle-ai/core';
import { resolveAncestorEnvironmentId } from '@grackle-ai/core';
import { ServiceCollector } from '@grackle-ai/core';
import type { SessionRow } from '@grackle-ai/database';
import type { TaskRow } from '@grackle-ai/database';
import type { TaskStatusResult } from '@grackle-ai/core';
import { toDialableHost } from '@grackle-ai/core';
import { VALID_PIPE_MODES } from '@grackle-ai/core';
import { validatePipeInputs } from '@grackle-ai/core';

export { cleanupLifecycleStream }

// @public
export function createCoreCollector(): ServiceCollector;

// @public
export function createDefaultCollector(): ServiceCollector;

// @public
export function createDispatchPhase(deps: DispatchPhaseDeps): ReconciliationPhase;

// @public
export function createEnvironmentReconciliationPhase(deps: EnvironmentReconciliationDeps): ReconciliationPhase;

// @public
export function createEscalationAutoSubscriber(ctx: PluginContext): Disposable_2;

// @public
export function createLifecycleSubscriber(ctx: PluginContext): Disposable_2;

// @public
export function createOrchestrationCollector(): ServiceCollector;

// @public
export function createOrphanPhase(deps: OrphanPhaseDeps): ReconciliationPhase;

// @public
export function createOrphanReparentSubscriber(ctx: PluginContext): Disposable_2;

// @public
export function createRootTaskBootSubscriber(ctx: PluginContext, deps: RootTaskBootDeps): Disposable_2;

// @public
export function createSigchldSubscriber(ctx: PluginContext): Disposable_2;

// @public
export interface DispatchPhaseDeps {
    dequeueEntry: (taskId: string) => void;
    environmentExists: (environmentId: string) => boolean;
    getTask: (taskId: string) => TaskRow | undefined;
    hasCapacity: (environmentId: string) => boolean;
    isEnvironmentConnected: (environmentId: string) => boolean;
    isTaskEligible: (taskId: string) => boolean;
    listPendingEntries: () => DispatchQueueRow[];
    resolveEnvironment: (task: TaskRow) => string | undefined;
    startTaskSession: (task: TaskRow, options?: {
        personaId?: string;
        environmentId?: string;
        notes?: string;
    }) => Promise<string | undefined>;
}

export { ensureLifecycleStream }

// @public
export interface EnvironmentReconciliationDeps {
    emit: (type: GrackleEventType, payload: Record<string, unknown>) => void;
    listConnectionIds: () => Set<string>;
    listEnvironments: () => EnvironmentRow[];
    removeConnection: (environmentId: string) => void;
    updateEnvironmentStatus: (id: string, status: EnvironmentStatus) => void;
}

// @public
export function killSessionAndCleanup(session: SessionRow): void;

// @public
export const lifecycleCleanupPhase: ReconciliationPhase;

// @public
export interface OrphanPhaseDeps {
    emit: (type: GrackleEventType, payload: Record<string, unknown>) => void;
    listAllTasks: () => TaskRow[];
    reparentTask: (taskId: string, newParentTaskId: string) => void;
}

// @public
export const PLUGIN_REGISTRY: ReadonlyArray<PluginRegistryEntry>;

// @public
export interface PluginRegistryEntry {
    defaultEnabled: boolean;
    description: string;
    name: string;
    required: boolean;
}

// @public
export function registerGrackleRoutes(router: ConnectRouter): void;

export { resolveAncestorEnvironmentId }

// @public
export interface RootTaskBootDeps {
    computeTaskStatus: (storedStatus: string, sessions: Pick<SessionRow, "id" | "status" | "startedAt">[]) => TaskStatusResult;
    findFirstConnectedEnvironment: () => EnvironmentRow | undefined;
    getLatestSessionForTask: (taskId: string) => SessionRow | undefined;
    getTask: (id: string) => TaskRow | undefined;
    isOnboarded?: () => boolean;
    listSessionsForTask: (taskId: string) => Pick<SessionRow, "id" | "status" | "startedAt">[];
    reanimateAgent: (sessionId: string) => SessionRow;
    startTaskSession: (task: TaskRow, options?: {
        environmentId?: string;
        notes?: string;
    }) => Promise<string | undefined>;
}

// @public
export function setLoadedPluginNames(names: Set<string>): void;

export { toDialableHost }

// @public
export function transferAllPipeSubscriptions(deadParentTaskId: string, grandparentTaskId: string): void;

export { VALID_PIPE_MODES }

export { validatePipeInputs }

// (No @packageDocumentation comment for this package)

```
