import { AssistantMode, BuiltInAssistantMode, ProductAssistantMode } from './types'; export { isBuiltInAssistantMode } from './modeCopy'; /** * Which strings may name an assistant mode. * * Built-in ids are the `BuiltInAssistantMode` union. Everything else is a * PRODUCT-declared id (see `ProductAssistantMode`) and must pass the checks * below before shared code will provision, reuse, time or label a sandbox for it. */ /** * Lowercase kebab-case: `general`, `api-calls`, `vibe-plugins` all fit, and so * does every product persona the sandbox service knows today. * * ★ Not cosmetic. The id is interpolated into the sandbox NAME * (`ai-assistant--`, a DNS-1123 label on the Kubernetes backend), * stamped into its metadata, sent as `AI_ASSISTANT_MODE`, and becomes the last * segment of the `mode.` i18n key — where a `.` would split the key and a * capital or space would make it unseedable. */ export declare const PRODUCT_ASSISTANT_MODE_ID_PATTERN: RegExp; /** * `ai-assistant-` (13) + id + `-` + 13-digit epoch ms must stay within the * 63-character label limit: 63 - 27 = 36, rounded down for headroom. */ export declare const PRODUCT_ASSISTANT_MODE_ID_MAX_LENGTH = 32; /** * The built-in mode `value` extends with a `-` segment (`general-docs` → * `general`), or undefined. * * ★★ Such an id is refused. Its sandboxes would be named * `ai-assistant-general-docs-`, which starts with the built-in's * `ai-assistant-general-` — the prefix legacy built-in sandboxes are still * recognised by. Metadata now decides first (`resolveSandboxAssistantMode`), so * this is the second wall: no id a product can declare is a name-prefix * collision with a built-in in the first place. */ export declare function builtInModeExtendedBy(value: string): BuiltInAssistantMode | undefined; /** * A well-formed id that is NOT built in and does not extend a built-in's name — * i.e. one only a product can declare. */ export declare function isProductAssistantModeId(value: unknown): value is ProductAssistantMode; /** Built in, or a well-formed product id. Says nothing about whether it is OFFERED. */ export declare function isAssistantModeId(value: unknown): value is AssistantMode; /** * Admit a backend mode id a product offers — the one way to obtain a * `ProductAssistantMode`. * * ```ts * const NODE_BUILDER = declareAssistantMode("acme-node"); * const modes = [{ id: NODE_BUILDER, label: "Build a node", producesArtifacts: true, streamBudgetMs: 600_000, ... }]; * ``` * * ★ Throws rather than returning null: this runs once at module load in the * product, where a thrown error is a failed build or a red test, not a user-facing * crash — and a mode that silently failed to declare would vanish from the panel. * * ★ A declared mode gets NO authority. It never receives the user's tokens, never * runs read-only or write-gated, and runs on the proxy-token artifact image; see * `sandboxBaseModeFor` and `forwardsUserTokensToSandbox`. Authority is granted * only by being `assistant` or `api-calls`, which is a fe-libs change. * * @throws when `id` is a built-in mode (use it directly), extends a built-in's * name (`general-docs`), or is not a valid id. */ export declare function declareAssistantMode(id: string): ProductAssistantMode; //# sourceMappingURL=modeIds.d.ts.map