/** * v1.3.2 §9.5 — unified id / naming rules. * * Every first-class asset (skill · agent · workflow · cron) shares one id * convention: lowercase kebab-case, bounded length, no reserved words, no * collision with an existing id. Before this module each validator re-declared * the same `^[a-z0-9]+(?:-[a-z0-9]+)*$` regex and length/reserved checks. This * is the single source of truth; validators keep emitting their own domain * codes (CRON_ID_MALFORMED / WF_ID_MALFORMED / NAME_MALFORMED …) but derive * the verdict here. * * Pure — no fs, no domain types. */ /** kebab-case: lowercase alphanumeric segments joined by single hyphens. */ export declare const KEBAB_RE: RegExp; /** Default id length ceiling (matches the skill name limit). */ export declare const DEFAULT_NAME_MAX = 64; export declare function isKebabCase(s: string): boolean; export declare function isReserved(id: string, reserved?: ReadonlySet): boolean; /** * v1.3.6 §3.2 — brand-reserved words that may not appear in any asset id. * Anthropic Agent Skills policy reserves these for first-party use; SoloSquad * mirrors it so bundled/org ids never collide with the platform namespace. */ export declare const RESERVED_WORDS: readonly string[]; /** True when `id` contains a brand-reserved word (case-insensitive substring). */ export declare function hasReservedWord(id: string): boolean; /** Does `id` collide with an already-taken id? */ export declare function collides(id: string, taken: ReadonlySet): boolean; /** * Slugify arbitrary text into a kebab-case id — for scaffolding/create paths. * Lowercases, replaces runs of non-alphanumerics with a single hyphen, trims * leading/trailing hyphens, and clamps to `maxLen` (without leaving a trailing * hyphen). Returns `fallback` when nothing usable remains. */ export declare function normalizeToKebab(input: string, maxLen?: number, fallback?: string): string; export type IdProblem = "empty" | "malformed" | "too_long" | "reserved"; export interface IdRule { /** Max length (default {@link DEFAULT_NAME_MAX}). */ maxLen?: number; /** Reserved ids that may not be used. */ reserved?: ReadonlySet; } /** * Evaluate an id against the shared convention. Returns the problems found (in * a stable order) so a caller can map each to its own domain code, e.g.: * * for (const p of checkId(def.id, { reserved })) * if (p === "malformed") f.error({ code: "CRON_ID_MALFORMED", ... }); * * `empty` and `malformed` are mutually exclusive; `too_long`/`reserved` may * accompany `malformed` (a long reserved non-kebab id reports all three). */ export declare function checkId(id: string | undefined, rule?: IdRule): IdProblem[];