import { type McpServerUsageInput, type ResourceRef, type WorkspaceEntryInput } from "@stigmer/sdk";
import { type HarnessOption } from "../models/harness";
/** Shared fields present in both variants of {@link CreateSessionInput}. */
export interface SharedSessionFields {
    /** Organization slug for the new session. */
    readonly org: string;
    /** Workspace source entries to attach to the session. */
    readonly workspaceEntries?: WorkspaceEntryInput[];
    /** Initial conversation subject (defaults to `PENDING_SUBJECT`). */
    readonly subject?: string;
    /** MCP server configurations to include for tool access. */
    readonly mcpServerUsages?: McpServerUsageInput[];
    /** Skill references to enable for executions in this session. */
    readonly skillRefs?: ResourceRef[];
    /**
     * Runner to bind this session to.
     *
     * When set, all executions in the session are routed to this runner's
     * task queue. When omitted, the backend auto-selects a runner (session
     * auto-bind in OSS, cloud auto-provisioning in Cloud).
     */
    readonly runnerId?: string;
    /**
     * Execution harness for this session.
     *
     * Determines which execution engine processes agent activities.
     * Immutable after the first execution runs. Defaults to `"native"`.
     */
    readonly harness?: HarnessOption;
}
/**
 * Input for creating a session. Exactly one agent resolution strategy
 * must be provided:
 *
 * - **`agentInstanceId`** — Use a pre-provisioned AgentInstance directly.
 * - **`agentRef`** — Resolve the agent's default instance via
 *   `agent.getByReference()`.
 *
 * Providing both is a type error. Platform builders who need the
 * backend's implicit agent resolution can use `@stigmer/sdk`'s
 * `session.create()` directly.
 */
export type CreateSessionInput = SharedSessionFields & ({
    /** Pre-provisioned AgentInstance ID to bind the session to. */
    readonly agentInstanceId: string;
    /** @internal Discriminant — excluded when `agentInstanceId` is provided. */
    readonly agentRef?: never;
} | {
    /** Agent blueprint reference resolved to its default instance at creation time. */
    readonly agentRef: ResourceRef;
    /** @internal Discriminant — excluded when `agentRef` is provided. */
    readonly agentInstanceId?: never;
});
/** Resolved output of {@link UseCreateSessionReturn.create}. */
export interface CreateSessionResult {
    /** Server-assigned identifier for the newly created Session. */
    readonly sessionId: string;
}
/** Return value of {@link useCreateSession}. */
export interface UseCreateSessionReturn {
    /** Create a Session from the given input. Resolves with the new session ID. */
    readonly create: (input: CreateSessionInput) => Promise<CreateSessionResult>;
    /** `true` while the create RPC is in flight. */
    readonly isCreating: boolean;
    /** Error from the last failed create attempt, or `null` when healthy. */
    readonly error: Error | null;
    /** Reset the error state to `null`. */
    readonly clearError: () => void;
}
/**
 * Behavior hook that wraps `session.create()` with loading/error state.
 *
 * Creates a Session — the conversation context that holds workspace
 * entries, thread state, and sandbox references.
 *
 * Exactly one agent resolution strategy must be provided:
 *
 * 1. **`agentInstanceId`** — Use a pre-provisioned instance directly.
 *    Typical for platform builders who manage instances programmatically.
 * 2. **`agentRef`** — Resolve the agent's default instance via
 *    `agent.getByReference()`. Useful when you know the agent slug
 *    but not the instance ID.
 *
 * This hook maps 1:1 to the Session aggregate. To start the first
 * execution within the session, compose with {@link useCreateAgentExecution}.
 *
 * @example
 * ```tsx
 * // Platform builder: pre-provisioned instance
 * const { create } = useCreateSession();
 * await create({ org: "acme", agentInstanceId: "inst-abc123" });
 * ```
 *
 * @example
 * ```tsx
 * // Agent reference: resolves to the agent's default instance
 * const { create } = useCreateSession();
 * await create({
 *   org: "acme",
 *   agentRef: { org: "acme", slug: "code-reviewer" },
 * });
 * ```
 */
export declare function useCreateSession(): UseCreateSessionReturn;
//# sourceMappingURL=useCreateSession.d.ts.map