import type { AgentInput, McpServerInput } from "@stigmer/sdk";
/**
 * Result of parsing a Stigmer resource YAML into an SDK input type.
 *
 * Discriminated on `kind` so consumers can narrow to the specific input:
 *
 * ```ts
 * const parsed = parseResourceYaml(content, "my-org");
 * if (parsed.kind === "Agent") {
 *   // parsed.input is AgentInput
 * }
 * ```
 */
export type ParsedResource = {
    /** The parsed resource is an Agent blueprint. */
    readonly kind: "Agent";
    /** SDK input suitable for `stigmer.agent.apply()`. */
    readonly input: AgentInput;
} | {
    /** The parsed resource is an MCP server definition. */
    readonly kind: "McpServer";
    /** SDK input suitable for `stigmer.mcpServer.apply()`. */
    readonly input: McpServerInput;
};
/**
 * Parses a Stigmer resource YAML string into the corresponding SDK input
 * type for use with `stigmer.agent.apply()` or `stigmer.mcpServer.apply()`.
 *
 * Handles the conversion from proto-style snake_case YAML field names to
 * the camelCase TypeScript SDK input types, including nested structures
 * like `mcp_server_usages`, `sub_agents`, and `env`.
 *
 * The `org` parameter **always overrides** `metadata.org` in the YAML.
 * This matches the UX intent of "Apply to [my-org]" — the user explicitly
 * chooses the target organization.
 *
 * **Throws** with descriptive, user-facing error messages when the YAML
 * is malformed or missing required fields. These messages are designed
 * for display in error UI components.
 *
 * @param content - Raw YAML content string (typically from {@link useArtifactContent}).
 * @param org - Target organization slug. Overrides `metadata.org` in the YAML.
 * @returns A discriminated union with the parsed SDK input.
 * @throws {Error} When the content is not valid YAML, not a recognized
 *   Stigmer resource, or is missing required fields.
 *
 * @example
 * ```ts
 * import { parseResourceYaml } from "@stigmer/react";
 *
 * const parsed = parseResourceYaml(yamlContent, "my-org");
 * if (parsed.kind === "Agent") {
 *   await stigmer.agent.apply(parsed.input);
 * } else {
 *   await stigmer.mcpServer.apply(parsed.input);
 * }
 * ```
 *
 * @see {@link useApplyResource} for the React hook that wraps this function
 * @see {@link detectStigmerResource} for lightweight detection without full parsing
 */
export declare function parseResourceYaml(content: string, org: string): ParsedResource;
//# sourceMappingURL=parse-resource-yaml.d.ts.map