import { r as DaoCoreConfig } from "./types.daocore-kp8IyikH.js";
import { a as StatefulBindingTargetDescriptor, i as ConfiguredBindingResolution } from "./binding-types-BEiQZMNP.js";

//#region src/channels/plugins/stateful-target-drivers.d.ts
type StatefulBindingTargetReadyResult = {
  ok: true;
} | {
  ok: false;
  error: string;
};
type StatefulBindingTargetSessionResult = {
  ok: true;
  sessionKey: string;
} | {
  ok: false;
  sessionKey: string;
  error: string;
};
type StatefulBindingTargetResetResult = {
  ok: true;
} | {
  ok: false;
  skipped?: boolean;
  error?: string;
};
type StatefulBindingTargetDriver = {
  id: string;
  ensureReady: (params: {
    cfg: DaoCoreConfig;
    bindingResolution: ConfiguredBindingResolution;
  }) => Promise<StatefulBindingTargetReadyResult>;
  ensureSession: (params: {
    cfg: DaoCoreConfig;
    bindingResolution: ConfiguredBindingResolution;
  }) => Promise<StatefulBindingTargetSessionResult>;
  resolveTargetBySessionKey?: (params: {
    cfg: DaoCoreConfig;
    sessionKey: string;
  }) => StatefulBindingTargetDescriptor | null;
  resetInPlace?: (params: {
    cfg: DaoCoreConfig;
    sessionKey: string;
    bindingTarget: StatefulBindingTargetDescriptor;
    reason: "new" | "reset";
    commandSource?: string;
  }) => Promise<StatefulBindingTargetResetResult>;
};
//#endregion
export { StatefulBindingTargetSessionResult as i, StatefulBindingTargetReadyResult as n, StatefulBindingTargetResetResult as r, StatefulBindingTargetDriver as t };