/** * Fully-qualified agent/package names. * * bare — own enabled copy, then shared * __shared:[:] the deployment-wide copy, explicitly * :[:] a named owner's copy * * ── The collision this module exists to manage ────────────────────────── * * `a:b` was ALREADY meaningful before namespaces: the agent resolver reads it * as `namespace:agentName` (a plugin's `plugin.json` name). §9 wants the same * syntax to mean `owner:package`. Both readings are legitimate and neither can * be dropped without breaking something. * * So this parser never guesses. A two-segment name is reported as AMBIGUOUS — * carrying both readings — and the caller resolves in a defined order * (namespace first, preserving today's behaviour, then owner). Only forms that * are structurally unmistakable are classified outright: * * - a `__`-prefixed first segment is a RESERVED SENTINEL, so `__shared:x` * can only ever be an FQN; * - three segments end in a semver, which namespaces never had. * * ── Why `__` is reserved ──────────────────────────────────────────────── * * `__shared` has to be unforgeable: if a user could register the subject * `__shared`, or publish a package under it, they would capture every * unqualified reference that meant "the deployment's copy". Reserving the * whole prefix (not just the one token) keeps future sentinels mintable at * zero cost — and per §15 A10, a name may DENY but must never GRANT, which is * exactly how this is used: `__shared` selects a scope, it never confers rights. * * @module */ /** The reserved sentinel for the deployment-wide namespace. */ export declare const SHARED_SENTINEL = "__shared"; /** Any name starting with this is reserved for the platform. */ export declare const RESERVED_PREFIX = "__"; export type AgentFqnKind = "bare" | "shared" | "owner" | "ambiguous" | "invalid"; export interface AgentFqn { kind: AgentFqnKind; /** The package/agent name — always present except for `invalid`. */ name: string; /** Owner segment as written, for `owner` (and the owner reading of `ambiguous`). */ ownerRef?: string; /** Namespace reading of an ambiguous two-segment name. */ namespaceRef?: string; /** Pinned version, when the caller named one. */ semver?: string; /** Why the input was rejected. Present only for `invalid`. */ reason?: string; } /** * Is this name reserved for the platform? * * Used at BOTH gates the design names: package publish, and user registration. * Checking only one of them would leave the sentinel forgeable from the other * side. */ export declare function isReservedName(value: string): boolean; export declare function isSemver(value: string): boolean; /** * Parse a possibly-qualified agent or package reference. * * Never throws: an unusable input comes back as `kind: "invalid"` with a * reason, because these strings arrive from models and users alike and a * parser that throws on hostile input is a denial-of-service in the turn loop. */ export declare function parseAgentFqn(raw: string): AgentFqn; /** Render a parsed reference back to its canonical string, for display. */ export declare function formatAgentFqn(fqn: AgentFqn): string; //# sourceMappingURL=agent-fqn.d.ts.map