import type { ProjectType, ScaffoldInputs } from "./index.js"; import type { ScaffoldFile } from "./scaffolders/common.js"; /** * Schema version of the descriptor document itself. Bump on any BREAKING change * to the shape (a removed field, a renamed field, a changed meaning). Adding an * optional field is not breaking and does not bump it. */ export declare const DESCRIPTOR_VERSION = 1; /** The emitted file's path, relative to the project root. */ export declare const DESCRIPTOR_PATH = "z2w-project.json"; /** * The CLOSED task vocabulary. See design rule 2 above. * * Deliberately at the repo root and NOT under a dotfolder: Finder hides * dotfolders, and this ecosystem has already lost time to exactly that (Kerry * could not open `~/.cache/z2w-coordination`, which is why the bulletin clone * grew a visible Desktop symlink). A descriptor a human cannot see is a * descriptor a human cannot correct. */ export declare const TASK_VERBS: readonly ["dev", "build", "test", "typecheck", "lint", "deploy", "migrate", "seed"]; export type TaskVerb = (typeof TASK_VERBS)[number]; /** * How dangerous running the task is, for an autonomy classifier that must decide * whether to run it unattended. * * - `read-only` — inspects the tree and writes nothing an operator would miss. * - `local-write` — writes to the working tree or binds a local port. Reversible * with `git checkout` / killing a process. * - `remote-write`— reaches a system outside this machine: a production deploy, * a live database, a third-party API. NOT reversible by the * agent that ran it. * * 🔴 Classified CONSERVATIVELY, and the asymmetry is deliberate. Understating a * class is the error that costs something irreversible; overstating it costs one * confirmation prompt. So `test` is `local-write` rather than `read-only` even * though most suites touch nothing, and `migrate` is `remote-write` even when it * is pointed at a dev branch. [[unknown-means-denied]] */ export declare const SAFETY_CLASSES: readonly ["read-only", "local-write", "remote-write"]; export type SafetyClass = (typeof SAFETY_CLASSES)[number]; /** * The safety class of each verb. A property of the VERB, which is the whole * reason the vocabulary is closed — an open vocabulary could not have this table. */ export declare const VERB_SAFETY: Readonly>; export interface ProjectTask { /** The exact command to run, from the project root. */ command: string; /** How dangerous it is — see {@link SafetyClass}. */ safety: SafetyClass; } /** * How the `tasks` map was derived. Present so a consumer can tell "this project * genuinely has no runnable tasks" from "nothing looked". See design rule 3. */ export type TaskSource = "package.json-scripts" | "pyproject" | "static-site" | "none"; export interface ProjectDescriptor { descriptorVersion: number; slug: string; description: string; projectType: ProjectType; /** Who produced this file, and when. Both are needed to judge staleness. */ generatedBy: string; generatedOn: string; stack: { runtime: "node" | "python" | "php" | "static" | "none"; database: string; hasWebUi: boolean; hasCron: boolean; }; repo: { host: "github"; org: string; name: string; url: string; }; deploy: { /** `null` where the scaffold genuinely does not determine one. */ target: string | null; }; coordination: { participates: boolean; /** `null` when this project does not participate in the bulletin. */ bulletinRepo: string | null; bulletinFile: string | null; agentIdentifier: string | null; }; taskSource: TaskSource; tasks: Partial>; } /** * Compose the descriptor for a completed scaffold. * * `files` must be the FULL emitted file list — the derivation reads it, so * calling this before the type-specific files are appended would silently * produce an empty `tasks` map. */ export declare function buildProjectDescriptor(inputs: ScaffoldInputs, files: readonly ScaffoldFile[], opts?: { date?: string; cliVersion?: string; }): ProjectDescriptor; /** The descriptor as an emittable {@link ScaffoldFile}. */ export declare function descriptorFile(inputs: ScaffoldInputs, files: readonly ScaffoldFile[], opts?: { date?: string; cliVersion?: string; }): ScaffoldFile;