/**
 * System agents responsible for creating each resource type.
 *
 * Keys match {@link DraftResourceType}; values are {@link ResourceRef}
 * objects pointing to Stigmer's built-in creator agents.
 */
export const CREATOR_AGENTS = {
    agent: { org: "stigmer", slug: "agent-creator" },
    skill: { org: "stigmer", slug: "skill-creator" },
    "mcp-server": { org: "stigmer", slug: "mcp-server-creator" },
};
const VALID_TYPES = new Set(Object.keys(CREATOR_AGENTS));
/**
 * Validate a string as a recognized {@link DraftResourceType}.
 *
 * Returns the validated type or `null` if unrecognized.
 */
export function parseDraftType(value) {
    if (value !== null && VALID_TYPES.has(value)) {
        return value;
    }
    return null;
}
/**
 * Parse draft session parameters from standard `URLSearchParams`.
 *
 * Returns `null` when no valid `draft` param is present. When `editOrg`
 * and `editSlug` are both present, the returned object includes an
 * `editRef` indicating this is an edit session rather than a create session.
 *
 * Works identically with Next.js `useSearchParams()` or react-router's
 * `useSearchParams()` — both return standard `URLSearchParams`.
 */
export function parseDraftParams(searchParams) {
    const draftType = parseDraftType(searchParams.get("draft"));
    if (!draftType)
        return null;
    const editOrg = searchParams.get("editOrg");
    const editSlug = searchParams.get("editSlug");
    if (editOrg && editSlug) {
        return { draftType, editRef: { org: editOrg, slug: editSlug } };
    }
    return { draftType };
}
//# sourceMappingURL=draft.js.map