import type { AgentExecution } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/api_pb";
import type { ExecutionArtifact } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/artifact_pb";
/**
 * The session's current plan: the published plan artifact (a `*.plan.md` FILE)
 * of the most recent execution that produced one, plus the execution it belongs
 * to (artifact content RPCs are execution-scoped).
 */
export interface SessionPlan {
    /** ID of the execution that published the plan. */
    readonly executionId: string;
    /** The published plan artifact (`*.plan.md`). */
    readonly artifact: ExecutionArtifact;
}
/**
 * Legacy plan filename. Detection-only: {@link isPlanArtifactName} still
 * accepts this exact name so plans published before named artifacts existed
 * keep working. The runner never freshly emits it (a titleless plan falls back
 * to a bare `<id>.plan.md`). Kept in sync with the runner's
 * `PLAN_ARTIFACT_NAME` (shared/plan-artifact.ts).
 */
export declare const PLAN_ARTIFACT_NAME = "plan.md";
/**
 * Suffix every named plan artifact carries (`<slug>_<id>.plan.md`, or a bare
 * `<id>.plan.md` when untitled). The runner derives the slug from the plan's
 * title and the `<id>` from its content hash; detection keys on this suffix.
 * Kept in sync with the runner's `PLAN_ARTIFACT_SUFFIX` (shared/plan-artifact.ts)
 * — the runner and browser SDK have disjoint module graphs, so the constant is
 * duplicated by design, mirroring {@link PLAN_ARTIFACT_NAME}.
 */
export declare const PLAN_ARTIFACT_SUFFIX = ".plan.md";
/**
 * Returns `true` when a filename is a plan's: the legacy exact `plan.md`, or
 * any `*.plan.md`. Accepting the legacy name keeps plans published before named
 * artifacts existed detectable.
 */
export declare function isPlanArtifactName(name: string): boolean;
/**
 * Returns `true` when an artifact is the published plan: a FILE artifact whose
 * name satisfies {@link isPlanArtifactName}.
 *
 * Detection is by convention — the same lightweight, content-free approach used
 * for skill packages ({@link isSkillPackage}) — so the UI never needs an extra
 * RPC to know a plan exists. The plan's text is fetched on demand via
 * {@link useArtifactContent} only when the user expands the Plan card.
 */
export declare function isPlanArtifact(artifact: ExecutionArtifact): boolean;
/**
 * Finds the plan artifact on a completed execution, or `undefined` when none
 * was published (older executions, or a plan that failed to upload).
 *
 * Returns the latest `plan.md` if more than one is present — the runner
 * replaces rather than appends, so this is defensive.
 */
export declare function findPlanArtifact(execution: AgentExecution | null | undefined): ExecutionArtifact | undefined;
/**
 * Finds the session's LATEST plan across all executions — the plan the panel's
 * plan document tab edits and the "Build" action implements. Executions are
 * scanned newest-first (the array is chronological), mirroring the thread's
 * latest-plan-owns-the-build-action rule so every surface agrees on which
 * plan is current.
 *
 * Returns `undefined` when no execution in the session published a plan.
 */
export declare function findLatestSessionPlan(executions: readonly AgentExecution[]): SessionPlan | undefined;
//# sourceMappingURL=detect-plan-artifact.d.ts.map