/** * Central definition of the document filename-part constraints the CLI enforces, * so that document-part validation stays in sync across the * `document create` / `skill create` commands and the build-time bundle validation * that runs on deploy/publish. * * A bundled document is stored under its id as the file name (see * `bundle-documents.ts` / `bundle-skills.ts`), and the app-registry install * validation ("Invalid app structure") rejects a file name longer than 50 * characters, so the id is capped at 50. The `type` / `extension` parts are only * validated for the filename character set and a generous length limit. */ /** * Maximum length of a document id (the `` filename part / skill-derived id). * Confirmed against the app-registry install validation, which rejects a bundled * file name longer than 50 characters ("Document filename exceeds maximum length * of 50 characters"). This is the only length limit the backend applies to the id; * the manifest has no separate name-length rule. */ export declare const DOCUMENT_ID_MAX_LENGTH = 50; /** * Maximum length of a document type (the `` filename part). * Confirmed against the app-manifest validation, which rejects a type longer * than 128 characters ("'documents.' must NOT have more than 128 characters"). */ export declare const DOCUMENT_TYPE_MAX_LENGTH = 128; /** * Maximum length of a document file extension (the optional `` filename * part). The extension is not sent to the backend, so this keeps the original * CLI-only limit of 50 rather than following the backend `type` limit. */ export declare const DOCUMENT_EXTENSION_MAX_LENGTH = 50; /** * Maximum length of a ready-made document's `description`. Confirmed against the * app-manifest validation, which rejects a description longer than 256 characters * ("'documents.' must NOT have more than 256 characters"). */ export declare const DOCUMENT_DESCRIPTION_MAX_LENGTH = 256; /** * Characters allowed in a document id/type/extension. The dot is excluded on * purpose: it separates the `..` parts of a document * filename, so it can never appear inside a single part. */ export declare const ALLOWED_PART_CHARS: RegExp; /** * Validates a document id (the `` filename part, and the id derived for a * bundled skill document): only `A-Z a-z 0-9 -`, 1-50 characters. */ export declare function isValidDocumentId(id: string): boolean; /** * Validates a document type (the `` filename part): only `A-Z a-z 0-9 -`, * up to {@link DOCUMENT_TYPE_MAX_LENGTH} characters. */ export declare function isValidDocumentType(type: string): boolean; /** * Validates a document file extension (the optional `` filename part): * only `A-Z a-z 0-9 -`, up to {@link DOCUMENT_EXTENSION_MAX_LENGTH} characters. */ export declare function isValidDocumentExtension(extension: string): boolean; /** * File types a skill reference may use. Everything under `references/` is surfaced to the * AI agent as a markdown document, so anything that is not already text the agent can read * is rejected - by `skill add-reference` when the file is scaffolded, and again by the * build-time bundle validation that runs on deploy/publish. */ export declare const SUPPORTED_REFERENCE_EXTENSIONS: string[]; /** * Builds the error message shown when a reference uses an unsupported file type. Shared so * `skill add-reference` and the deploy/publish bundle validation phrase it identically. */ export declare const UNSUPPORTED_REFERENCE_EXTENSION: (fileName: string) => string; /** * Renders the document name a reference file is surfaced under: always `.md`, regardless of * its real extension, because every document handed to the AI agent is consumed as markdown. * Shared so `skill add-reference` rejects a name clash up front on exactly the name the * deploy/publish bundle validation would later reject. */ export declare function toReferenceDocumentName(fileName: string): string; /** Validates that a reference filename ends in one of {@link SUPPORTED_REFERENCE_EXTENSIONS}. */ export declare function isSupportedReferenceExtension(fileName: string): boolean; /** * Returns the filenames out of `existingFileNames` that resolve to the same document name * as `fileName`, e.g. an existing `config.json` for a `config.yaml`. Unsupported file types * are ignored because they are rejected on their file type alone. */ export declare function findClashingReferenceNames(fileName: string, existingFileNames: string[]): string[]; /** * Builds the error message shown when several references of one skill resolve to the same * document name. Shared so `skill add-reference` rejects a clash up front in the same words * the deploy/publish bundle validation would later use. Sorted so the listed files do not * depend on the order they were discovered in. */ export declare const CLASHING_REFERENCE_NAMES: (fileNames: string[]) => string;