# API Reference Generated by [forge-ts](https://github.com/kryptobaseddev/forge-ts) from `.`. ## Table of Contents - [Functions](#functions) - [`getCurrentUser()`](#getcurrentuser) - [`appendAuditEvent()`](#appendauditevent) - [`readAuditLog()`](#readauditlog) - [`formatAuditEvent()`](#formatauditevent) - [`createBypass()`](#createbypass) - [`getActiveBypasses()`](#getactivebypasses) - [`isRuleBypassed()`](#isrulebypassed) - [`getRemainingBudget()`](#getremainingbudget) - [`expireOldBypasses()`](#expireoldbypasses) - [`defineConfig()`](#defineconfig) - [`defaultConfig()`](#defaultconfig) - [`loadConfig()`](#loadconfig) - [`readLockFile()`](#readlockfile) - [`writeLockFile()`](#writelockfile) - [`removeLockFile()`](#removelockfile) - [`createLockManifest()`](#createlockmanifest) - [`validateAgainstLock()`](#validateagainstlock) - [`resolveVisibility()`](#resolvevisibility) - [`meetsVisibility()`](#meetsvisibility) - [`filterByVisibility()`](#filterbyvisibility) - [`clearTSDocConfigCache()`](#cleartsdocconfigcache) - [`loadTSDocConfiguration()`](#loadtsdocconfiguration) - [`createWalker()`](#createwalker) - [`signatureToSchema()`](#signaturetoschema) - [`extractSDKTypes()`](#extractsdktypes) - [`generateOpenAPISpec()`](#generateopenapispec) - [`buildReference()`](#buildreference) - [`generateApi()`](#generateapi) - [`signatureToSchema()`](#signaturetoschema) - [`extractSDKTypes()`](#extractsdktypes) - [`generateOpenAPISpec()`](#generateopenapispec) - [`buildReference()`](#buildreference) - [`generateApi()`](#generateapi) - [`configureLogger()`](#configurelogger) - [`emitResult()`](#emitresult) - [`resolveExitCode()`](#resolveexitcode) - [`runAudit()`](#runaudit) - [`runBarometer()`](#runbarometer) - [`runBarometerScore()`](#runbarometerscore) - [`discoverGuides()`](#discoverguides) - [`serializeMarkdown()`](#serializemarkdown) - [`textP()`](#textp) - [`boldIntroP()`](#boldintrop) - [`textListItem()`](#textlistitem) - [`rawBlock()`](#rawblock) - [`truncate()`](#truncate) - [`toAnchor()`](#toanchor) - [`slugLink()`](#sluglink) - [`parseFrontmatter()`](#parsefrontmatter) - [`stringifyWithFrontmatter()`](#stringifywithfrontmatter) - [`stripFrontmatter()`](#stripfrontmatter) - [`parseInline()`](#parseinline) - [`parseBlocks()`](#parseblocks) - [`sanitizeForMdx()`](#sanitizeformdx) - [`updateAutoSections()`](#updateautosections) - [`stubHash()`](#stubhash) - [`isStubModified()`](#isstubmodified) - [`updateStubSections()`](#updatestubsections) - [`escapeMdx()`](#escapemdx) - [`groupSymbolsByPackage()`](#groupsymbolsbypackage) - [`generateDocSite()`](#generatedocsite) - [`registerAdapter()`](#registeradapter) - [`getAdapter()`](#getadapter) - [`getAvailableTargets()`](#getavailabletargets) - [`generateCKM()`](#generateckm) - [`generateLlmsTxt()`](#generatellmstxt) - [`generateLlmsFullTxt()`](#generatellmsfulltxt) - [`generateMarkdown()`](#generatemarkdown) - [`syncReadme()`](#syncreadme) - [`generateSkillPackage()`](#generateskillpackage) - [`generateSkillMd()`](#generateskillmd) - [`generateSSGConfigs()`](#generatessgconfigs) - [`generate()`](#generate) - [`runBuild()`](#runbuild) - [`runBypassCreate()`](#runbypasscreate) - [`runBypassStatus()`](#runbypassstatus) - [`findDeprecatedUsages()`](#finddeprecatedusages) - [`enforce()`](#enforce) - [`formatResults()`](#formatresults) - [`getStagedFiles()`](#getstagedfiles) - [`runCheck()`](#runcheck) - [`runDocsDev()`](#rundocsdev) - [`readPkgJson()`](#readpkgjson) - [`serializePkgJson()`](#serializepkgjson) - [`writePkgJson()`](#writepkgjson) - [`addScripts()`](#addscripts) - [`detectHookManager()`](#detecthookmanager) - [`generateHuskyHook()`](#generatehuskyhook) - [`generateHuskyPrePushHook()`](#generatehuskyprepushhook) - [`generateLefthookBlock()`](#generatelefthookblock) - [`detectVersionGuard()`](#detectversionguard) - [`runInitHooks()`](#runinithooks) - [`detectEnvironment()`](#detectenvironment) - [`buildTsdocContent()`](#buildtsdoccontent) - [`runInitProject()`](#runinitproject) - [`runDoctor()`](#rundoctor) - [`runInitDocs()`](#runinitdocs) - [`runLock()`](#runlock) - [`runPrepublish()`](#runprepublish) - [`extractExamples()`](#extractexamples) - [`generateTestFiles()`](#generatetestfiles) - [`runTests()`](#runtests) - [`doctest()`](#doctest) - [`runTest()`](#runtest) - [`runUnlock()`](#rununlock) - [`extractExamples()`](#extractexamples) - [`generateTestFiles()`](#generatetestfiles) - [`runTests()`](#runtests) - [`doctest()`](#doctest) - [`findDeprecatedUsages()`](#finddeprecatedusages) - [`enforce()`](#enforce) - [`formatResults()`](#formatresults) - [Interfaces](#interfaces) - [`AuditEvent`](#auditevent) - [`ReadAuditOptions`](#readauditoptions) - [`BypassConfig`](#bypassconfig) - [`BypassRecord`](#bypassrecord) - [`ForgeSymbol`](#forgesymbol) - [`EnforceRules`](#enforcerules) - [`ForgeConfig`](#forgeconfig) - [`ForgeResult`](#forgeresult) - [`ForgeError`](#forgeerror) - [`ForgeWarning`](#forgewarning) - [`ForgeLockManifest`](#forgelockmanifest) - [`LockViolation`](#lockviolation) - [`OpenAPISchemaObject`](#openapischemaobject) - [`OpenAPIInfoObject`](#openapiinfoobject) - [`OpenAPITagObject`](#openapitagobject) - [`OpenAPIPathItemObject`](#openapipathitemobject) - [`OpenAPIOperationObject`](#openapioperationobject) - [`OpenAPIParameterObject`](#openapiparameterobject) - [`OpenAPIEncodingObject`](#openapiencodingobject) - [`OpenAPIMediaTypeObject`](#openapimediatypeobject) - [`OpenAPIResponseObject`](#openapiresponseobject) - [`OpenAPIDocument`](#openapidocument) - [`ASTWalker`](#astwalker) - [`SDKProperty`](#sdkproperty) - [`SDKType`](#sdktype) - [`ReferenceEntry`](#referenceentry) - [`SDKProperty`](#sdkproperty) - [`SDKType`](#sdktype) - [`ReferenceEntry`](#referenceentry) - [`ForgeLoggerOptions`](#forgeloggeroptions) - [`CommandOutput`](#commandoutput) - [`ForgeCliError`](#forgeclierror) - [`ForgeCliWarning`](#forgecliwarning) - [`OutputFlags`](#outputflags) - [`AuditArgs`](#auditargs) - [`AuditResult`](#auditresult) - [`BarometerSource`](#barometersource) - [`BarometerQuestion`](#barometerquestion) - [`BarometerRatingBand`](#barometerratingband) - [`BarometerInstructions`](#barometerinstructions) - [`BarometerResult`](#barometerresult) - [`BarometerScoredAnswer`](#barometerscoredanswer) - [`BarometerScoreResult`](#barometerscoreresult) - [`BarometerArgs`](#barometerargs) - [`DiscoveredGuide`](#discoveredguide) - [`MdText`](#mdtext) - [`MdInlineCode`](#mdinlinecode) - [`MdStrong`](#mdstrong) - [`MdEmphasis`](#mdemphasis) - [`MdLink`](#mdlink) - [`MdHeading`](#mdheading) - [`MdParagraph`](#mdparagraph) - [`MdCode`](#mdcode) - [`MdBlockquote`](#mdblockquote) - [`MdHtml`](#mdhtml) - [`MdThematicBreak`](#mdthematicbreak) - [`MdListItem`](#mdlistitem) - [`MdList`](#mdlist) - [`MdTableCell`](#mdtablecell) - [`MdTableRow`](#mdtablerow) - [`MdTable`](#mdtable) - [`MdRoot`](#mdroot) - [`FrontmatterResult`](#frontmatterresult) - [`DocPage`](#docpage) - [`SiteGeneratorOptions`](#sitegeneratoroptions) - [`GeneratedFile`](#generatedfile) - [`SSGStyleGuide`](#ssgstyleguide) - [`ScaffoldManifest`](#scaffoldmanifest) - [`AdapterContext`](#adaptercontext) - [`DevServerCommand`](#devservercommand) - [`SSGAdapter`](#ssgadapter) - [`MarkdownOptions`](#markdownoptions) - [`ReadmeSyncOptions`](#readmesyncoptions) - [`SkillPackage`](#skillpackage) - [`SSGConfigFile`](#ssgconfigfile) - [`GenerateOptions`](#generateoptions) - [`BuildArgs`](#buildargs) - [`BuildStep`](#buildstep) - [`BuildResult`](#buildresult) - [`BypassCreateResult`](#bypasscreateresult) - [`BypassStatusResult`](#bypassstatusresult) - [`DeprecatedUsage`](#deprecatedusage) - [`FormatOptions`](#formatoptions) - [`CheckArgs`](#checkargs) - [`CheckFileError`](#checkfileerror) - [`CheckFileWarning`](#checkfilewarning) - [`CheckFileGroup`](#checkfilegroup) - [`CheckRuleCount`](#checkrulecount) - [`CheckTriage`](#checktriage) - [`CheckPage`](#checkpage) - [`CheckResult`](#checkresult) - [`PkgJson`](#pkgjson) - [`InitHooksResult`](#inithooksresult) - [`InitHooksArgs`](#inithooksargs) - [`InitProjectEnvironment`](#initprojectenvironment) - [`InitProjectResult`](#initprojectresult) - [`InitProjectArgs`](#initprojectargs) - [`DoctorCheckResult`](#doctorcheckresult) - [`DoctorResult`](#doctorresult) - [`DoctorArgs`](#doctorargs) - [`InitDocsResult`](#initdocsresult) - [`InitDocsArgs`](#initdocsargs) - [`LockResult`](#lockresult) - [`PrepublishResult`](#prepublishresult) - [`PrepublishArgs`](#prepublishargs) - [`ExtractedExample`](#extractedexample) - [`GeneratorOptions`](#generatoroptions) - [`VirtualTestFile`](#virtualtestfile) - [`RunResult`](#runresult) - [`TestCaseResult`](#testcaseresult) - [`TestArgs`](#testargs) - [`TestFailure`](#testfailure) - [`TestResult`](#testresult) - [`UnlockResult`](#unlockresult) - [`ExtractedExample`](#extractedexample) - [`GeneratorOptions`](#generatoroptions) - [`VirtualTestFile`](#virtualtestfile) - [`RunResult`](#runresult) - [`TestCaseResult`](#testcaseresult) - [`DeprecatedUsage`](#deprecatedusage) - [`FormatOptions`](#formatoptions) - [Types](#types) - [`AuditEventType`](#auditeventtype) - [`RuleSeverity`](#ruleseverity) - [`GuideSource`](#guidesource) - [`MdPhrasing`](#mdphrasing) - [`MdBlock`](#mdblock) - [`SSGTarget`](#ssgtarget) - [`CKMConcept`](#ckmconcept) - [`CKMOperation`](#ckmoperation) - [`CKMConstraint`](#ckmconstraint) - [`CKMWorkflow`](#ckmworkflow) - [`CKMConfigEntry`](#ckmconfigentry) - [`CKMManifest`](#ckmmanifest) - [`HookManager`](#hookmanager) - [`DoctorCheckStatus`](#doctorcheckstatus) - [Enums](#enums) - [`Visibility`](#visibility) - [Variables](#variables) - [`RULE_GROUP_MAP`](#rulegroupmap) - [`forgeLogger`](#forgelogger) - [`auditCommand`](#auditcommand) - [`barometerCommand`](#barometercommand) - [`md`](#md) - [`DEFAULT_TARGET`](#defaulttarget) - [`mintlifyAdapter`](#mintlifyadapter) - [`docusaurusAdapter`](#docusaurusadapter) - [`nextraAdapter`](#nextraadapter) - [`vitepressAdapter`](#vitepressadapter) - [`fumadocsAdapter`](#fumadocsadapter) - [`buildCommand`](#buildcommand) - [`bypassCommand`](#bypasscommand) - [`checkCommand`](#checkcommand) - [`docsDevCommand`](#docsdevcommand) - [`initHooksCommand`](#inithookscommand) - [`initProjectCommand`](#initprojectcommand) - [`doctorCommand`](#doctorcommand) - [`initDocsCommand`](#initdocscommand) - [`initCommand`](#initcommand) - [`lockCommand`](#lockcommand) - [`prepublishCommand`](#prepublishcommand) - [`testCommand`](#testcommand) - [`unlockCommand`](#unlockcommand) ## Functions ### `getCurrentUser()` *Defined in `packages/core/src/audit.ts:73`* ```typescript () => string ``` Returns the current OS username, or "unknown" if unavailable. **Returns**: The OS username string. **Examples** ```typescript import { getCurrentUser } from "@forge-ts/core/audit"; const user = getCurrentUser(); // e.g. "alice" ``` ### `appendAuditEvent()` *Defined in `packages/core/src/audit.ts:103`* ```typescript (rootDir: string, event: AuditEvent) => void ``` Appends a single audit event to the `.forge-audit.jsonl` file. **Parameters** - `rootDir` — Absolute path to the project root directory. - `event` — The audit event to record. **Examples** ```typescript import { appendAuditEvent } from "@forge-ts/core"; const event = { timestamp: new Date().toISOString(), event: "config.lock" as const, user: "alice", reason: "Stabilize", details: {} }; appendAuditEvent("/path/to/project", event); ``` ### `readAuditLog()` *Defined in `packages/core/src/audit.ts:146`* ```typescript (rootDir: string, options?: ReadAuditOptions) => AuditEvent[] ``` Reads the `.forge-audit.jsonl` file and returns parsed audit events. **Parameters** - `rootDir` — Absolute path to the project root directory. - `options` — Optional limit and event type filter. **Returns**: Array of audit events, newest first. **Examples** ```typescript import { readAuditLog } from "@forge-ts/core"; const events = readAuditLog("/path/to/project", { limit: 10 }); console.log(events.length); // up to 10 ``` ### `formatAuditEvent()` *Defined in `packages/core/src/audit.ts:192`* ```typescript (event: AuditEvent) => string ``` Formats a single audit event as a human-readable string. **Parameters** - `event` — The audit event to format. **Returns**: A single-line human-readable representation. **Examples** ```typescript import { formatAuditEvent } from "@forge-ts/core"; const event = { timestamp: "2026-03-21T12:00:00.000Z", event: "config.lock" as const, user: "alice", reason: "Stabilize", details: {} }; const line = formatAuditEvent(event); console.log(line); ``` ### `createBypass()` *Defined in `packages/core/src/bypass.ts:175`* ```typescript (rootDir: string, reason: string, rule?: string, config?: Partial) => BypassRecord ``` Creates a new bypass record, writes it to `.forge-bypass.json`, and appends an audit event. **Parameters** - `rootDir` — Absolute path to the project root directory. - `reason` — Mandatory justification for the bypass. - `rule` — Specific rule code to bypass (e.g., "E009"), or "all". Defaults to "all". - `config` — Optional bypass budget configuration overrides. **Returns**: The created bypass record. **Throws** - Error when the daily bypass budget is exhausted. **Examples** ```typescript import { createBypass } from "@forge-ts/core"; const bypass = createBypass("/path/to/project", "hotfix for release", "E009", { dailyBudget: 5, durationHours: 12 }); console.log(bypass.id); ``` ### `getActiveBypasses()` *Defined in `packages/core/src/bypass.ts:243`* ```typescript (rootDir: string) => BypassRecord[] ``` Returns all currently active (non-expired) bypass records. **Parameters** - `rootDir` — Absolute path to the project root directory. **Returns**: Array of active bypass records. **Examples** ```typescript import { getActiveBypasses } from "@forge-ts/core"; const active = getActiveBypasses("/path/to/project"); console.log(`${active.length} active bypass(es)`); ``` ### `isRuleBypassed()` *Defined in `packages/core/src/bypass.ts:269`* ```typescript (rootDir: string, ruleCode: string) => boolean ``` Checks whether a specific rule has an active bypass. **Parameters** - `rootDir` — Absolute path to the project root directory. - `ruleCode` — The rule code to check (e.g., "E009", "E010"). **Returns**: `true` if the rule is currently bypassed. **Examples** ```typescript import { isRuleBypassed } from "@forge-ts/core"; if (isRuleBypassed("/path/to/project", "E009")) { console.log("E009 is currently bypassed"); } ``` ### `getRemainingBudget()` *Defined in `packages/core/src/bypass.ts:296`* ```typescript (rootDir: string, config?: Partial) => number ``` Returns the number of bypass budget slots remaining for today. **Parameters** - `rootDir` — Absolute path to the project root directory. - `config` — Optional bypass budget configuration overrides. **Returns**: Number of remaining bypass slots for today. **Examples** ```typescript import { getRemainingBudget } from "@forge-ts/core"; const remaining = getRemainingBudget("/path/to/project", { dailyBudget: 5, durationHours: 24 }); console.log(`${remaining} bypass(es) remaining today`); ``` ### `expireOldBypasses()` *Defined in `packages/core/src/bypass.ts:324`* ```typescript (rootDir: string) => number ``` Removes expired bypass records from `.forge-bypass.json`. **Parameters** - `rootDir` — Absolute path to the project root directory. **Returns**: The number of expired records removed. **Examples** ```typescript import { expireOldBypasses } from "@forge-ts/core"; const removed = expireOldBypasses("/path/to/project"); console.log(`${removed} expired bypass(es) removed`); ``` ### `defineConfig()` *Defined in `packages/core/src/config.ts:66`* ```typescript (config: Partial) => Partial ``` Type-safe helper for defining a partial forge-ts configuration. **Parameters** - `config` — Partial configuration overrides. **Returns**: The same object (identity function for type checking). **Examples** ```typescript import { defineConfig } from "@forge-ts/core"; const config = { outDir: "docs", enforce: { strict: true } }; export default defineConfig(config); ``` ### `defaultConfig()` *Defined in `packages/core/src/config.ts:90`* ```typescript (rootDir: string) => ForgeConfig ``` Constructs a sensible default `ForgeConfig` rooted at `rootDir`. **Parameters** - `rootDir` — Absolute path to the project root. **Returns**: A fully-populated default configuration. **Examples** ```typescript import { defaultConfig } from "@forge-ts/core"; const config = defaultConfig("/path/to/project"); console.log(config.enforce.enabled); // true ``` ### `loadConfig()` *Defined in `packages/core/src/config.ts:546`* ```typescript (rootDir?: string) => Promise ``` Loads the forge-ts configuration for a project. **Parameters** - `rootDir` — The project root to search for config. Defaults to `process.cwd()`. **Returns**: A fully-resolved `ForgeConfig`. **Examples** ```typescript import { loadConfig } from "@forge-ts/core"; const config = await loadConfig("/path/to/project"); // config is fully resolved with defaults ``` ### `readLockFile()` *Defined in `packages/core/src/lock.ts:96`* ```typescript (rootDir: string) => ForgeLockManifest | null ``` Reads the `.forge-lock.json` file from the given project root. **Parameters** - `rootDir` — Absolute path to the project root. **Returns**: The parsed lock manifest, or `null` if no lock file exists or is invalid. **Examples** ```typescript import { readLockFile } from "@forge-ts/core"; const lock = readLockFile("/path/to/project"); if (lock) { console.log(`Locked at ${lock.lockedAt} by ${lock.lockedBy}`); } ``` ### `writeLockFile()` *Defined in `packages/core/src/lock.ts:130`* ```typescript (rootDir: string, manifest: ForgeLockManifest) => void ``` Writes a `ForgeLockManifest` to `.forge-lock.json` in the project root. **Parameters** - `rootDir` — Absolute path to the project root. - `manifest` — The lock manifest to write. **Examples** ```typescript import { writeLockFile, createLockManifest, loadConfig } from "@forge-ts/core"; const config = await loadConfig("/path/to/project"); const manifest = createLockManifest(config, "alice"); writeLockFile("/path/to/project", manifest); ``` ### `removeLockFile()` *Defined in `packages/core/src/lock.ts:153`* ```typescript (rootDir: string) => boolean ``` Removes the `.forge-lock.json` file from the project root. **Parameters** - `rootDir` — Absolute path to the project root. **Returns**: `true` if the file existed and was removed, `false` otherwise. **Examples** ```typescript import { removeLockFile } from "@forge-ts/core"; const removed = removeLockFile("/path/to/project"); console.log(removed ? "Lock removed" : "No lock file found"); ``` ### `createLockManifest()` *Defined in `packages/core/src/lock.ts:188`* ```typescript (config: ForgeConfig, lockedBy?: string) => ForgeLockManifest ``` Creates a `ForgeLockManifest` from the current project config. **Parameters** - `config` — The fully-resolved `ForgeConfig` to snapshot. - `lockedBy` — Identifier of the user or agent creating the lock. Defaults to `"forge-ts lock"`. **Returns**: A new lock manifest ready to be written with `writeLockFile`. **Examples** ```typescript import { createLockManifest, loadConfig } from "@forge-ts/core"; const config = await loadConfig(); const manifest = createLockManifest(config, "alice"); console.log(manifest.config.rules); ``` ### `validateAgainstLock()` *Defined in `packages/core/src/lock.ts:256`* ```typescript (config: ForgeConfig, lock: ForgeLockManifest) => LockViolation[] ``` Validates the current config against a locked manifest. **Parameters** - `config` — The current fully-resolved `ForgeConfig`. - `lock` — The lock manifest to validate against. **Returns**: An array of `LockViolation` entries. Empty means no weakening detected. **Examples** ```typescript import { validateAgainstLock, readLockFile, loadConfig } from "@forge-ts/core"; const config = await loadConfig(); const lock = readLockFile(config.rootDir); if (lock) { const violations = validateAgainstLock(config, lock); for (const v of violations) { console.error(`LOCK VIOLATION: ${v.message}`); } } ``` ### `resolveVisibility()` *Defined in `packages/core/src/visibility.ts:32`* ```typescript (tags: Record | undefined) => Visibility ``` Determines the visibility level of a symbol from its TSDoc release tags. **Parameters** - `tags` — The parsed `tags` map from `ForgeSymbol.documentation`. **Returns**: The resolved `Visibility` value. **Examples** ```typescript import { resolveVisibility } from "@forge-ts/core"; const vis = resolveVisibility({ internal: [] }); // vis === Visibility.Internal ``` ### `meetsVisibility()` *Defined in `packages/core/src/visibility.ts:78`* ```typescript (candidate: Visibility | "public" | "beta" | "internal" | "private", minVisibility: Visibility | "public" | "beta" | "internal" | "private") => boolean ``` Returns whether `candidate` meets or exceeds the required minimum visibility. **Parameters** - `candidate` — The visibility of the symbol being tested. - `minVisibility` — The minimum visibility threshold. **Returns**: `true` if `candidate` is at least as visible as `minVisibility`. **Examples** ```typescript import { meetsVisibility, Visibility } from "@forge-ts/core"; meetsVisibility(Visibility.Public, Visibility.Public); // true meetsVisibility(Visibility.Internal, Visibility.Public); // false meetsVisibility("public", "beta"); // true (string literals also accepted) ``` ### `filterByVisibility()` *Defined in `packages/core/src/visibility.ts:105`* ```typescript (symbols: ForgeSymbol[], minVisibility: Visibility | "public" | "beta" | "internal" | "private") => ForgeSymbol[] ``` Filters an array of `ForgeSymbol` objects to only include symbols whose visibility meets or exceeds `minVisibility`. **Parameters** - `symbols` — The full list of symbols to filter. - `minVisibility` — The minimum visibility threshold to keep. **Returns**: A new array containing only symbols that pass the visibility check. **Examples** ```typescript import { filterByVisibility, Visibility } from "@forge-ts/core"; const publicOnly = filterByVisibility(symbols, Visibility.Public); ``` ### `clearTSDocConfigCache()` *Defined in `packages/core/src/walker.ts:37`* ```typescript () => void ``` Clears the TSDoc configuration cache. Intended for use in tests only. ### `loadTSDocConfiguration()` *Defined in `packages/core/src/walker.ts:57`* ```typescript (folderPath: string) => TSDocConfiguration ``` Resolve the TSDoc configuration to use when parsing comments in files under `folderPath`. If a `tsdoc.json` file exists in or above the folder and can be loaded without errors, its settings are applied to a fresh `TSDocConfiguration` via `TSDocConfigFile.configureParser()`. Otherwise the default `TSDocConfiguration` is returned (backward-compatible behaviour). Results are cached per folder path so the file system is only consulted once per unique directory. **Parameters** - `folderPath` — Absolute directory path of the source file being parsed. **Returns**: A configured `TSDocConfiguration` instance. ### `createWalker()` *Defined in `packages/core/src/walker.ts:808`* ```typescript (config: ForgeConfig) => ASTWalker ``` Creates an `ASTWalker` configured for the given forge config. **Parameters** - `config` — The resolved `ForgeConfig` for the project. **Returns**: An `ASTWalker` instance whose `walk()` method performs the extraction. **Examples** ```typescript import { loadConfig, createWalker } from "@forge-ts/core"; const config = await loadConfig(); const walker = createWalker(config); const symbols = walker.walk(); console.log(`Found ${symbols.length} symbols`); ``` ### `signatureToSchema()` *Defined in `packages/api/src/schema-mapper.ts:30`* ```typescript (signature: string) => OpenAPISchemaObject ``` Maps a TypeScript type signature string to an OpenAPI 3.2 schema object. Handles common primitives, arrays, unions, `Record`, and falls back to `{ type: "object" }` for anything it cannot parse. **Parameters** - `signature` — A TypeScript type signature string, e.g. `"string"`, `"number[]"`, `"string | number"`, `"Record"`. **Returns**: An OpenAPI schema object. **Examples** ```typescript import { signatureToSchema } from "@forge-ts/api"; const schema = signatureToSchema("string[]"); // { type: "array", items: { type: "string" } } ``` ### `extractSDKTypes()` *Defined in `packages/api/src/sdk-extractor.ts:64`* ```typescript (symbols: ForgeSymbol[]) => SDKType[] ``` Extracts SDK-relevant types (interfaces, type aliases, classes, enums) from a list of `ForgeSymbol` objects. Only exported symbols whose visibility is not `Visibility.Internal` or `Visibility.Private` are included. **Parameters** - `symbols` — The symbols produced by the core AST walker. **Returns**: An array of `SDKType` objects for public-facing type definitions. **Examples** ```typescript import { extractSDKTypes } from "@forge-ts/api"; const sdkTypes = extractSDKTypes(symbols); console.log(sdkTypes.length); // number of public SDK types ``` ### `generateOpenAPISpec()` *Defined in `packages/api/src/openapi.ts:50`* ```typescript (config: ForgeConfig, sdkTypes: SDKType[], symbols?: ForgeSymbol[]) => OpenAPIDocument ``` Generates a production-quality OpenAPI 3.2 document from the extracted SDK types. The document is populated with: - An `info` block sourced from the config or reasonable defaults. - A `components.schemas` section with one schema per exported type. - `tags` derived from unique source file paths (grouping by file). - Visibility filtering: `@internal` symbols are never emitted. - HTTP paths are extracted from `@route` tags and appropriately mapped. **Parameters** - `config` — The resolved `ForgeConfig`. - `sdkTypes` — SDK types to include as component schemas. - `symbols` — Raw symbols used to extract HTTP route paths from `@route` tags. **Returns**: An `OpenAPIDocument` object. **Examples** ```typescript import { generateOpenAPISpec } from "@forge-ts/api"; import { extractSDKTypes } from "@forge-ts/api"; const spec = generateOpenAPISpec(config, extractSDKTypes(symbols), symbols); console.log(spec.openapi); // "3.2.0" ``` ### `buildReference()` *Defined in `packages/api/src/reference.ts:58`* ```typescript (symbols: ForgeSymbol[]) => ReferenceEntry[] ``` Builds a structured API reference from a list of exported symbols. Unlike the minimal stub, this version includes nested children (class methods, interface properties) and all available TSDoc metadata. Symbols with `Visibility.Internal` or `Visibility.Private` are excluded from the top-level results. Children with private/internal visibility are also filtered out. **Parameters** - `symbols` — All symbols from the AST walker. **Returns**: An array of `ReferenceEntry` objects sorted by name. **Examples** ```typescript import { buildReference } from "@forge-ts/api"; const entries = buildReference(symbols); console.log(entries[0].name); // first symbol name, alphabetically ``` ### `generateApi()` *Defined in `packages/api/src/index.ts:96`* ```typescript (config: ForgeConfig) => Promise ``` Runs the API generation pipeline: walk → extract → generate → write. **Parameters** - `config` — The resolved `ForgeConfig` for the project. The relevant fields are `config.api.openapiPath` (output destination), `config.rootDir`, and `config.tsconfig`. **Returns**: A `ForgeResult` whose `success` field is `true` when the spec was written without error. `symbols` contains the full symbol graph from the walk step. `errors` and `warnings` are empty on success; file-system or walker errors are thrown rather than returned. **Examples** ```typescript import { loadConfig } from "@forge-ts/core"; import { generateApi } from "@forge-ts/api"; const config = await loadConfig(); const result = await generateApi(config); console.log(result.success); // true if the spec was written successfully ``` ### `signatureToSchema()` *Defined in `packages/api/src/src/schema-mapper.ts:32`* ```typescript (signature: string) => OpenAPISchemaObject ``` Maps a TypeScript type signature string to an OpenAPI 3.2 schema object. Handles common primitives, arrays, unions, `Record`, and falls back to `{ type: "object" }` for anything it cannot parse. **Parameters** - `signature` — A TypeScript type signature string, e.g. `"string"`, `"number[]"`, `"string | number"`, `"Record"`. **Returns**: An OpenAPI schema object. **Examples** ```typescript import { signatureToSchema } from "@forge-ts/api"; const schema = signatureToSchema("string[]"); // { type: "array", items: { type: "string" } } ``` ### `extractSDKTypes()` *Defined in `packages/api/src/src/sdk-extractor.ts:85`* ```typescript (symbols: ForgeSymbol[]) => SDKType[] ``` Extracts SDK-relevant types (interfaces, type aliases, classes, enums) from a list of `ForgeSymbol` objects. Only exported symbols whose visibility is not `Visibility.Internal` or `Visibility.Private` are included. **Parameters** - `symbols` — The symbols produced by the core AST walker. **Returns**: An array of `SDKType` objects for public-facing type definitions. **Examples** ```typescript import { extractSDKTypes } from "@forge-ts/api"; const sdkTypes = extractSDKTypes(symbols); console.log(sdkTypes.length); // number of public SDK types ``` ### `generateOpenAPISpec()` *Defined in `packages/api/src/src/openapi.ts:53`* ```typescript (config: ForgeConfig, sdkTypes: SDKType[], symbols?: ForgeSymbol[]) => OpenAPIDocument ``` Generates a production-quality OpenAPI 3.2 document from the extracted SDK types. The document is populated with: - An `info` block sourced from the config or reasonable defaults. - A `components.schemas` section with one schema per exported type. - `tags` derived from unique source file paths (grouping by file). - Visibility filtering: `@internal` symbols are never emitted. - HTTP paths are extracted from `@route` tags and appropriately mapped. **Parameters** - `config` — The resolved `ForgeConfig`. - `sdkTypes` — SDK types to include as component schemas. - `symbols` — Raw symbols used to extract HTTP route paths from `@route` tags. **Returns**: An `OpenAPIDocument` object. **Examples** ```typescript import { generateOpenAPISpec } from "@forge-ts/api"; import { extractSDKTypes } from "@forge-ts/api"; const spec = generateOpenAPISpec(config, extractSDKTypes(symbols), symbols); console.log(spec.openapi); // "3.2.0" ``` ### `buildReference()` *Defined in `packages/api/src/src/reference.ts:87`* ```typescript (symbols: ForgeSymbol[]) => ReferenceEntry[] ``` Builds a structured API reference from a list of exported symbols. Unlike the minimal stub, this version includes nested children (class methods, interface properties) and all available TSDoc metadata. Symbols with `Visibility.Internal` or `Visibility.Private` are excluded from the top-level results. Children with private/internal visibility are also filtered out. **Parameters** - `symbols` — All symbols from the AST walker. **Returns**: An array of `ReferenceEntry` objects sorted by name. **Examples** ```typescript import { buildReference } from "@forge-ts/api"; const entries = buildReference(symbols); console.log(entries[0].name); // first symbol name, alphabetically ``` ### `generateApi()` *Defined in `packages/api/src/src/index.ts:41`* ```typescript (config: ForgeConfig) => Promise ``` Runs the API generation pipeline: walk → extract → generate → write. **Parameters** - `config` — The resolved `ForgeConfig` for the project. **Returns**: A `ForgeResult` with success/failure and any diagnostics. **Examples** ```typescript import { generateApi } from "@forge-ts/api"; const result = await generateApi(config); console.log(result.success); // true if spec was written successfully ``` ### `configureLogger()` *Defined in `packages/cli/src/forge-logger.ts:74`* ```typescript (options: ForgeLoggerOptions) => void ``` Configures the global `forgeLogger` based on CLI flags. Call this once at the start of a command's `run()` handler to align consola's output level with the user's intent: - `quiet` or `json` sets level to 0 (silent) so only LAFS output appears. - `verbose` sets level to 4 (debug) for maximum detail. - Default level is 3 (info) which covers info, warn, error, and success. **Parameters** - `options` — Flag-driven configuration. **Examples** ```typescript import { configureLogger, forgeLogger } from "./forge-logger.js"; configureLogger({ quiet: args.quiet, json: args.json, verbose: args.verbose }); forgeLogger.info("This respects the configured level"); ``` ### `emitResult()` *Defined in `packages/cli/src/output.ts:99`* ```typescript (output: CommandOutput, flags: OutputFlags, humanFormatter: (data: T, output: CommandOutput) => string) => void ``` Wraps a command result in a LAFS envelope and emits it. Output format is determined by LAFS flag resolution: - TTY terminals default to human-readable output. - Non-TTY (piped, CI, agents) defaults to JSON. - Explicit `--json` or `--human` flags always take precedence. On failure, the full result is included alongside the error so agents get actionable data (e.g., suggestedFix) in a single response. **Parameters** - `output` — Typed result from the command. - `flags` — Output format flags from citty args. - `humanFormatter` — Produces a human-readable string for TTY consumers. **Examples** ```typescript import { emitResult } from "@forge-ts/cli/output"; emitResult(output, { human: true }, (data) => `Done: ${data.summary.duration}ms`); ``` ### `resolveExitCode()` *Defined in `packages/cli/src/output.ts:182`* ```typescript (output: CommandOutput) => number ``` Returns the LAFS-compliant exit code for a command output. **Parameters** - `output` — Typed result from the command. **Returns**: `0` on success, `1` on validation/check failure. ### `runAudit()` *Defined in `packages/cli/src/commands/audit.ts:73`* ```typescript (args: AuditArgs) => CommandOutput ``` Reads the audit log and returns a typed command output. **Parameters** - `args` — CLI arguments for the audit command. **Returns**: A typed `CommandOutput`. **Examples** ```typescript import { runAudit } from "@forge-ts/cli/commands/audit"; const output = await runAudit({ cwd: process.cwd(), limit: 10 }); console.log(output.data.count); // number of events returned ``` ### `runBarometer()` *Defined in `packages/cli/src/commands/barometer.ts:834`* ```typescript (args: BarometerArgs) => Promise> ``` Runs the barometer generation pass. Loads the project config, walks the symbol graph, extracts testable facts from five categories, generates questions with ground-truth answers, and writes the result to `.forge/barometer.json`. **Parameters** - `args` — CLI arguments for the barometer command. **Returns**: A typed `CommandOutput`. **Examples** ```typescript import { runBarometer } from "@forge-ts/cli/commands/barometer"; const output = await runBarometer({ cwd: process.cwd() }); console.log(`Generated ${output.data.questions.length} questions`); ``` ### `runBarometerScore()` *Defined in `packages/cli/src/commands/barometer.ts:1040`* ```typescript (args: { cwd?: string; answersPath: string; }) => Promise> ``` Scores agent answers against the barometer answer key. **Parameters** - `args` — CLI arguments including project root and path to agent answers file. **Returns**: A typed `CommandOutput`. **Examples** ```typescript import { runBarometerScore } from "@forge-ts/cli/commands/barometer"; const output = await runBarometerScore({ answersPath: "answers.json" }); console.log(`Score: ${output.data.score}%`); ``` ### `discoverGuides()` *Defined in `packages/gen/src/guide-discovery.ts:255`* ```typescript (symbolsByPackage: Map, config: ForgeConfig) => DiscoveredGuide[] ``` Analyze the symbol graph and discover guides using multiple heuristics. Each heuristic produces zero or more `DiscoveredGuide` entries. When multiple heuristics produce a guide with the same slug, the first one wins (priority order: guide-tag, config-interface, error-types, category, entry-point). **Parameters** - `symbolsByPackage` — Symbols grouped by package name. - `config` — The resolved forge-ts configuration. **Returns**: An array of discovered guides, deduplicated by slug. **Examples** ```typescript import { discoverGuides } from "@forge-ts/gen"; const guides = discoverGuides(symbolsByPackage, config); console.log(guides.map(g => g.slug)); ``` ### `serializeMarkdown()` *Defined in `packages/gen/src/mdast-builders.ts:296`* ```typescript (tree: MdRoot) => string ``` Serialize an mdast tree to a well-formed markdown string. Uses remark-stringify with GFM table support. The serializer handles all escaping (pipes in table cells, special characters in text, etc.) so callers never need manual escape functions. **Parameters** - `tree` — The mdast root node to serialize. **Returns**: The serialized markdown string. **Examples** ```typescript const output = serializeMarkdown(md.root(md.heading(1, md.text("Hello")))); console.log(output); // "# Hello\n" ``` ### `textP()` *Defined in `packages/gen/src/mdast-builders.ts:318`* ```typescript (value: string) => MdParagraph ``` Shorthand: paragraph containing a single text node. **Parameters** - `value` — The plain text content. **Returns**: An MdParagraph wrapping a single MdText child. **Examples** ```typescript const node = textP("Hello world"); // { type: "paragraph", children: [{ type: "text", value: "Hello world" }] } ``` ### `boldIntroP()` *Defined in `packages/gen/src/mdast-builders.ts:337`* ```typescript (bold: string, rest: string) => MdParagraph ``` Shorthand: paragraph with bold intro text followed by regular text. **Parameters** - `bold` — Text to render in bold at the start. - `rest` — Plain text appended after the bold segment. **Returns**: An MdParagraph with a strong child followed by a text child. **Examples** ```typescript const node = boldIntroP("Note: ", "this is important."); // renders as **Note: **this is important. ``` ### `textListItem()` *Defined in `packages/gen/src/mdast-builders.ts:355`* ```typescript (value: string) => MdListItem ``` Shorthand: list item containing a single text paragraph. **Parameters** - `value` — The plain text content of the list item. **Returns**: An MdListItem wrapping a single text paragraph. **Examples** ```typescript const item = textListItem("First item"); const list = md.list([item, textListItem("Second item")]); ``` ### `rawBlock()` *Defined in `packages/gen/src/mdast-builders.ts:377`* ```typescript (markdown: string) => MdHtml ``` Wrap a raw markdown string as an HTML node. Use for TSDoc content that may contain markdown formatting (backticks, bold, links) which should pass through to the output verbatim rather than being escaped by the serializer. **Parameters** - `markdown` — The raw markdown/HTML string to pass through unescaped. **Returns**: An MdHtml node wrapping the raw content. **Examples** ```typescript const badge = rawBlock("![badge](https://img.shields.io/badge/ok-green)"); const tree = md.root(badge); ``` ### `truncate()` *Defined in `packages/gen/src/mdast-builders.ts:399`* ```typescript (text: string, maxLen?: number) => string ``` Truncate a string to at most maxLen chars. Avoids cutting inside backtick-delimited code spans to prevent broken inline code that would cause escaping issues. **Parameters** - `text` — The string to truncate. - `maxLen` — Maximum allowed length (including the trailing `...`). **Returns**: The original string if within maxLen, or a truncated version with `...`. **Examples** ```typescript truncate("A very long description of the API", 20); // "A very long descr..." ``` ### `toAnchor()` *Defined in `packages/gen/src/mdast-builders.ts:429`* ```typescript (text: string) => string ``` Convert a label to a GitHub-compatible anchor slug. **Parameters** - `text` — The heading or label text to slugify. **Returns**: A lowercase, hyphen-separated anchor string. **Examples** ```typescript toAnchor("My Function()"); // "my-function" ``` ### `slugLink()` *Defined in `packages/gen/src/mdast-builders.ts:452`* ```typescript (path: string) => string ``` Strip extension from a link path and normalize to a slug. Produces bare slug links compatible with Mintlify and most SSGs. **Parameters** - `path` — The relative file path (e.g., `"./packages/core/index.md"`). **Returns**: An absolute slug path (e.g., `"/packages/core/index"`). **Examples** ```typescript slugLink("./packages/core/index.md"); // "/packages/core/index" ``` ### `parseFrontmatter()` *Defined in `packages/gen/src/markdown-utils.ts:130`* ```typescript (content: string) => FrontmatterResult ``` Parse frontmatter from markdown/MDX content. Uses gray-matter for robust YAML parsing — handles multi-line values, quoted strings, and edge cases that regex-based stripping misses. **Parameters** - `content` — The full file content including frontmatter. **Returns**: The body (without frontmatter) and the parsed data object. **Examples** ```ts const { body, data } = parseFrontmatter("---\ntitle: Hello\n---\n# Body"); // data.title === "Hello", body === "# Body" ``` ### `stringifyWithFrontmatter()` *Defined in `packages/gen/src/markdown-utils.ts:163`* ```typescript (body: string, data: Record) => string ``` Serialize content with frontmatter prepended. Produces the standard format: **Parameters** - `body` — The markdown body content (without frontmatter). - `data` — The frontmatter fields to serialize. **Returns**: The combined frontmatter + body string. **Examples** ```ts const output = stringifyWithFrontmatter("# Hello", { title: "Greeting" }); // "---\ntitle: Greeting\n---\n\n# Hello\n" ``` ### `stripFrontmatter()` *Defined in `packages/gen/src/markdown-utils.ts:190`* ```typescript (content: string) => string ``` Strip frontmatter from content, returning only the body. **Parameters** - `content` — The full file content including frontmatter. **Returns**: The body content without the frontmatter block. **Examples** ```ts const body = stripFrontmatter("---\ntitle: Hello\n---\n# Content"); // body === "# Content" ``` ### `parseInline()` *Defined in `packages/gen/src/markdown-utils.ts:226`* ```typescript (markdown: string) => MdPhrasing[] ``` Parse a markdown string and extract inline (phrasing) content. Use for TSDoc text that may contain backtick code, bold, links, etc. The returned nodes can be spread into paragraphs, table cells, or any other context that accepts inline content. This prevents double-escaping: backticks become proper `inlineCode` nodes instead of text that gets escaped by the serializer. **Parameters** - `markdown` — The TSDoc content string (may contain markdown). **Returns**: Array of inline mdast nodes. **Examples** ```ts const nodes = parseInline("Use `forEach` for iteration"); // Returns [text("Use "), inlineCode("forEach"), text(" for iteration")] ``` ### `parseBlocks()` *Defined in `packages/gen/src/markdown-utils.ts:258`* ```typescript (markdown: string) => MdBlock[] ``` Parse a markdown string and extract block-level content. Use for multi-line TSDoc content that may contain headings, lists, blockquotes, code blocks, etc. **Parameters** - `markdown` — The markdown string to parse. **Returns**: Array of block-level mdast nodes. **Examples** ```ts const blocks = parseBlocks("# Title\n\nSome paragraph text."); // Returns [heading(1, "Title"), paragraph("Some paragraph text.")] ``` ### `sanitizeForMdx()` *Defined in `packages/gen/src/markdown-utils.ts:348`* ```typescript (content: string) => string ``` Sanitize markdown content for MDX compatibility using AST-aware processing. Parses the document with remark to understand its structure, then applies targeted string replacements only to text and HTML comment nodes — code blocks, inline code, and frontmatter are automatically preserved. Transformations applied outside code: - HTML comments to MDX comments - Curly braces in text escaped (prevents MDX expression parsing) - Angle brackets around word chars escaped (prevents JSX tag parsing) **Parameters** - `content` — The markdown content to sanitize. **Returns**: The sanitized content safe for MDX consumption. **Examples** ```ts const safe = sanitizeForMdx("Value is and {x}"); // "Value is <T> and \\{x\\}" ``` ### `updateAutoSections()` *Defined in `packages/gen/src/markdown-utils.ts:491`* ```typescript (existing: string, generated: string) => string | null ``` Updates auto-enriched sections in an existing stub file. Uses AST-aware parsing to find FORGE:AUTO markers, ensuring markers inside code blocks are never accidentally matched. Replaces content between `` and `` markers (or their MDX comment equivalents) with fresh content from the newly generated version. Manual content outside markers is preserved exactly — no reformatting. **Parameters** - `existing` — The current file content on disk. - `generated` — The freshly generated content with updated markers. **Returns**: The merged content, or null if no markers were found to update. ### `stubHash()` *Defined in `packages/gen/src/markdown-utils.ts:533`* ```typescript (content: string) => string ``` Compute a short fingerprint hash for content change detection. Uses a simple DJB2-style hash converted to base-36 and truncated to 8 characters. This is NOT cryptographic — just a quick fingerprint to detect whether generated content has been manually edited. **Parameters** - `content` — The content to hash. **Returns**: An 8-character alphanumeric hash string. ### `isStubModified()` *Defined in `packages/gen/src/markdown-utils.ts:670`* ```typescript (existingContent: string, stubId: string, _generatedContent: string) => boolean ``` Checks if a FORGE:STUB section has been modified by the user. Compares the embedded hash (from the FORGE:STUB-HASH comment) against a freshly computed hash of the current inner content (with the hash comment itself stripped out). If the hashes diverge — meaning the user edited the content — or the hash comment was removed, the section is considered modified and should be preserved. **Parameters** - `existingContent` — The full document content on disk. - `stubId` — The identifier of the FORGE:STUB section. - `_generatedContent` — Unused; kept for API symmetry. Detection is purely hash-based. **Returns**: `true` if the user has modified the stub (preserve it), `false` if unmodified (safe to regenerate). **Examples** ```ts const doc = "\n\noriginal\n"; isStubModified(doc, "api", ""); // false — hash still matches ``` ### `updateStubSections()` *Defined in `packages/gen/src/markdown-utils.ts:717`* ```typescript (existingContent: string, stubs: Array<{ id: string; content: string; }>) => string ``` Updates FORGE:STUB sections in existing content. Behavior for each stub: - If the stub doesn't exist yet, appends it at the end of the content. - If the stub exists but is unmodified (hash matches generated content), regenerates it. - If the stub exists and was modified by user (hash mismatch), PRESERVES user content. Each generated stub includes a `FORGE:STUB-HASH` comment containing a fingerprint of the generated content. On subsequent builds, this hash is compared to determine whether the user has made edits. **Parameters** - `existingContent` — The current file content on disk. - `stubs` — Array of stub definitions with their IDs and generated content. **Returns**: The updated content with stubs inserted or refreshed as needed. **Examples** ```ts const updated = updateStubSections(existingMdx, [ { id: "api-table", content: "| Method | Description |\n|---|---|" }, ]); ``` ### `escapeMdx()` *Defined in `packages/gen/src/site-generator.ts:98`* ```typescript (text: string) => string ``` Escape MDX-unsafe characters in text that appears outside code fences. MDX parses `` as JSX tags and `{expr}` as JS expressions. In documentation content (summaries, descriptions, table cells), these come from TypeScript generics (`Array`) and TSDoc inline tags (`{@link Foo}`). We escape them so MDX treats them as literal text. This is exported so SSG adapters can apply it during page transformation. **Parameters** - `text` — Raw text that may contain MDX-unsafe characters. **Returns**: The input string with `{`, `}`, `<`, and `>` escaped for safe MDX rendering. **Examples** ```typescript const safe = escapeMdx("Array"); console.log(safe); // "Array<string>" ``` ### `groupSymbolsByPackage()` *Defined in `packages/gen/src/site-generator.ts:199`* ```typescript (symbols: ForgeSymbol[], rootDir: string) => Map ``` Groups symbols by their package based on file path. For monorepos (symbols under `packages//`) the package name is derived from the directory segment immediately after `packages/`. For non-monorepo projects all symbols fall under the project name. **Parameters** - `symbols` — All extracted symbols. - `rootDir` — Absolute path to the project root. **Returns**: A map from package name to symbol list. **Examples** ```typescript import { groupSymbolsByPackage } from "@forge-ts/gen"; const grouped = groupSymbolsByPackage(symbols, "/path/to/project"); console.log(grouped.has("core")); // true for monorepo ``` ### `generateDocSite()` *Defined in `packages/gen/src/site-generator.ts:1780`* ```typescript (symbolsByPackage: Map, config: ForgeConfig, options: SiteGeneratorOptions) => DocPage[] ``` Generates a full multi-page documentation site from symbols grouped by package. Follows a 5-stage information architecture: 1. ORIENT — Landing page, Getting Started 2. LEARN — Concepts (stub) 3. BUILD — Guides (stub) 4. REFERENCE — API Reference, Types, Configuration, Changelog 5. COMMUNITY — FAQ, Contributing (stubs) **Parameters** - `symbolsByPackage` — Symbols grouped by package name. - `config` — The resolved `ForgeConfig`. - `options` — Site generation options. **Returns**: An array of `DocPage` objects ready to be written to disk. **Examples** ```typescript import { generateDocSite, groupSymbolsByPackage } from "@forge-ts/gen"; const grouped = groupSymbolsByPackage(symbols, config.rootDir); const pages = generateDocSite(grouped, config, { format: "markdown", projectName: "my-project" }); console.log(pages.length > 0); // true ``` ### `registerAdapter()` *Defined in `packages/gen/src/adapters/registry.ts:22`* ```typescript (adapter: SSGAdapter) => void ``` Register an SSG adapter. Called once per provider at module load time. **Parameters** - `adapter` — The adapter to register. **Examples** ```typescript import { registerAdapter } from "@forge-ts/gen"; registerAdapter(mintlifyAdapter); ``` ### `getAdapter()` *Defined in `packages/gen/src/adapters/registry.ts:44`* ```typescript (target: SSGTarget) => SSGAdapter ``` Get a registered adapter by target name. Throws if the target is not registered. **Parameters** - `target` — The SSG target identifier. **Returns**: The registered `SSGAdapter` for the given target. **Throws** - `Error` if the target is not registered. **Examples** ```typescript import { getAdapter } from "@forge-ts/gen"; const adapter = getAdapter("mintlify"); ``` ### `getAvailableTargets()` *Defined in `packages/gen/src/adapters/registry.ts:68`* ```typescript () => SSGTarget[] ``` Get all registered adapter targets. **Returns**: An array of all registered `SSGTarget` identifiers. **Examples** ```typescript import { getAvailableTargets } from "@forge-ts/gen"; const targets = getAvailableTargets(); // ["mintlify", "docusaurus", ...] ``` ### `generateCKM()` *Defined in `packages/gen/src/ckm-generator.ts:685`* ```typescript (symbols: ForgeSymbol[], config: ForgeConfig) => CkmManifest ``` Generates a Codebase Knowledge Manifest from the symbol graph. **Parameters** - `symbols` — All symbols extracted from the project. - `config` — The resolved `ForgeConfig` for the project. **Returns**: A complete `CKMManifest` ready for JSON serialization. **Examples** ```typescript import { generateCKM } from "@forge-ts/gen"; const manifest = generateCKM(symbols, config); console.log(JSON.stringify(manifest, null, 2)); ``` ### `generateLlmsTxt()` *Defined in `packages/gen/src/llms.ts:92`* ```typescript (symbols: ForgeSymbol[], config: ForgeConfig) => string ``` Generates an `llms.txt` routing manifest from the extracted symbols. The file follows the llms.txt specification: a compact, structured overview designed to help large language models navigate a project's documentation. Symbols are grouped by package with summaries. **Parameters** - `symbols` — The symbols to include. - `config` — The resolved `ForgeConfig`. **Returns**: The generated `llms.txt` content as a string. **Examples** ```typescript import { generateLlmsTxt } from "@forge-ts/gen"; const txt = generateLlmsTxt(symbols, config); console.log(txt.startsWith("# ")); // true ``` ### `generateLlmsFullTxt()` *Defined in `packages/gen/src/llms.ts:310`* ```typescript (symbols: ForgeSymbol[], config: ForgeConfig) => string ``` Generates an `llms-full.txt` dense context file from the extracted symbols. Unlike `llms.txt`, this file contains complete documentation for every exported symbol, intended for LLM ingestion that requires full context. Symbols are grouped by package with summaries. **Parameters** - `symbols` — The symbols to include. - `config` — The resolved `ForgeConfig`. **Returns**: The generated `llms-full.txt` content as a string. **Examples** ```typescript import { generateLlmsFullTxt } from "@forge-ts/gen"; const fullTxt = generateLlmsFullTxt(symbols, config); console.log(fullTxt.includes("Full Context")); // true ``` ### `generateMarkdown()` *Defined in `packages/gen/src/markdown.ts:237`* ```typescript (symbols: ForgeSymbol[], config: ForgeConfig, options?: MarkdownOptions) => string ``` Generates a Markdown (or MDX) string from a list of symbols. **Parameters** - `symbols` — The symbols to document. - `config` — The resolved `ForgeConfig`. - `options` — Rendering options. **Returns**: The generated Markdown string. **Examples** ```typescript import { generateMarkdown } from "@forge-ts/gen"; const md = generateMarkdown(symbols, config, { mdx: false }); console.log(md.startsWith("# API Reference")); // true ``` ### `syncReadme()` *Defined in `packages/gen/src/readme-sync.ts:109`* ```typescript (readmePath: string, symbols: ForgeSymbol[], options?: ReadmeSyncOptions) => Promise ``` Injects a summary of exported symbols into a `README.md` file. The content is placed between `` and `` comment markers. If neither marker exists, the summary is appended to the end of the file. **Parameters** - `readmePath` — Absolute path to the `README.md` to update. - `symbols` — Symbols to summarise in the README. - `options` — Options controlling sync behaviour. **Returns**: `true` if the file was modified, `false` otherwise. **Examples** ```typescript import { syncReadme } from "@forge-ts/gen"; const modified = await syncReadme("/path/to/README.md", symbols); console.log(modified); // true if README was updated ``` ### `generateSkillPackage()` *Defined in `packages/gen/src/skill.ts:821`* ```typescript (symbols: ForgeSymbol[], config: ForgeConfig) => SkillPackage ``` Generates an agentskills.io-compliant skill package for ANY TypeScript project. All content is derived from the project's exported symbols and metadata. No hardcoded project-specific content. Works for any project that forge-ts analyzes. **Parameters** - `symbols` — All symbols from the project. - `config` — The resolved forge-ts config. **Returns**: A `SkillPackage` describing the directory and its files. **Examples** ```typescript import { generateSkillPackage } from "@forge-ts/gen"; const pkg = generateSkillPackage(symbols, config); console.log(pkg.directoryName); // "my-lib" console.log(pkg.files.map(f => f.path)); // ["SKILL.md", "references/API-REFERENCE.md", ...] ``` ### `generateSkillMd()` *Defined in `packages/gen/src/skill.ts:859`* ```typescript (symbols: ForgeSymbol[], config: ForgeConfig) => string ``` Generates a SKILL.md string following the Agent Skills specification. Generic for any TypeScript project — content derived from symbols. **Parameters** - `symbols` — All symbols from the project. - `config` — The resolved forge-ts config. **Returns**: The SKILL.md content as a string. **Examples** ```typescript import { generateSkillMd } from "@forge-ts/gen"; const skill = generateSkillMd(symbols, config); ``` ### `generateSSGConfigs()` *Defined in `packages/gen/src/ssg-config.ts:274`* ```typescript (pages: DocPage[], target: "docusaurus" | "mintlify" | "nextra" | "vitepress", projectName: string) => SSGConfigFile[] ``` Generate navigation configuration file(s) for the given SSG target. Returns one file for most targets, but multiple files for Nextra (which uses per-directory `_meta.json` files). **Parameters** - `pages` — The `DocPage` array produced by `generateDocSite`. - `target` — The SSG target. - `projectName` — The project name (used in config metadata). **Returns**: An array of `SSGConfigFile` objects ready to be written to disk. **Examples** ```typescript import { generateSSGConfigs } from "@forge-ts/gen"; const configs = generateSSGConfigs(pages, "vitepress", "my-project"); console.log(configs[0].path); // ".vitepress/sidebar.json" ``` ### `generate()` *Defined in `packages/gen/src/index.ts:173`* ```typescript (config: ForgeConfig, options?: GenerateOptions) => Promise ``` Runs the full documentation generation pipeline: walk → render → write. Auto-generated pages are always regenerated from source code on each run. Stub pages (concepts, guides, FAQ, contributing, changelog) are written only the first time, preserving manual edits across subsequent builds. Pass `{ forceStubs: true }` to reset stubs to their scaffolded state. **Parameters** - `config` — The resolved `ForgeConfig` for the project. - `options` — Optional generation flags (see `GenerateOptions`). **Returns**: A `ForgeResult` whose `writtenFiles` lists every path written. `success` is always `true` on normal completion; file-system errors throw. **Examples** ```typescript import { loadConfig } from "@forge-ts/core"; import { generate } from "@forge-ts/gen"; const config = await loadConfig(); const result = await generate(config); console.log(`Wrote ${result.writtenFiles?.length ?? 0} files`); ``` ### `runBuild()` *Defined in `packages/cli/src/commands/build.ts:97`* ```typescript (args: BuildArgs) => Promise> ``` Runs the full build pipeline and returns a typed command output. **Parameters** - `args` — CLI arguments for the build command. **Returns**: A typed `CommandOutput`. **Examples** ```typescript import { runBuild } from "@forge-ts/cli/commands/build"; const output = await runBuild({ cwd: process.cwd() }); console.log(output.success); // true if all steps succeeded ``` ### `runBypassCreate()` *Defined in `packages/cli/src/commands/bypass.ts:88`* ```typescript (args: { cwd?: string; reason: string; rule?: string; }) => Promise> ``` Runs the bypass creation: creates a new bypass record with budget enforcement. **Parameters** - `args` — CLI arguments for the bypass command. **Returns**: A typed `CommandOutput`. **Examples** ```typescript import { runBypassCreate } from "@forge-ts/cli/commands/bypass"; const output = await runBypassCreate({ cwd: process.cwd(), reason: "hotfix for release", rule: "E009", }); console.log(output.data.remainingBudget); ``` ### `runBypassStatus()` *Defined in `packages/cli/src/commands/bypass.ts:152`* ```typescript (args: { cwd?: string; }) => Promise> ``` Runs the bypass status query: shows active bypasses and remaining budget. **Parameters** - `args` — CLI arguments for the bypass status command. **Returns**: A typed `CommandOutput`. **Examples** ```typescript import { runBypassStatus } from "@forge-ts/cli/commands/bypass"; const output = await runBypassStatus({ cwd: process.cwd() }); console.log(output.data.activeBypasses.length); ``` ### `findDeprecatedUsages()` *Defined in `packages/enforcer/src/deprecation-tracker.ts:32`* ```typescript (symbols: ForgeSymbol[]) => DeprecatedUsage[] ``` Scans symbols for imports of deprecated exports from other packages. **Parameters** - `symbols` — All symbols from the walker across the entire project. **Returns**: Array of deprecated usages found. **Examples** ```typescript import { findDeprecatedUsages } from "@forge-ts/enforcer"; const usages = findDeprecatedUsages(symbols); console.log(usages.length); // number of deprecated cross-package imports ``` ### `enforce()` *Defined in `packages/enforcer/src/enforcer.ts:416`* ```typescript (config: ForgeConfig) => Promise ``` Runs the TSDoc enforcement pass against a project. The enforcer walks all exported symbols that meet the configured minimum visibility threshold and emits diagnostics for any documentation deficiencies it finds. ### Error codes | Code | Severity | Condition | |------|----------|-----------| | E001 | error | Exported symbol is missing a TSDoc summary. | | E002 | error | Function/method parameter lacks a `@param` tag. | | E003 | error | Non-void function/method lacks a `@returns` tag. | | E004 | error | Exported function/method is missing an `@example` block. | | E005 | error | Package entry point (index.ts) is missing `@packageDocumentation`. | | E006 | error | Public/protected class member is missing a TSDoc comment. | | E007 | error | Interface/type alias property is missing a TSDoc comment. | | W001 | warning | TSDoc comment contains parse errors. | | W002 | warning | Function body throws but has no `@throws` tag. | | W003 | warning | `@deprecated` tag is present without explanation. | | W006 | warning | TSDoc parser-level syntax error (invalid tag, malformed block, etc.). | | E009 | error | tsconfig.json required strict-mode flag is missing or disabled (guard). | | E010 | error | Config drift: a rule severity is weaker than the locked value. | | E013 | error | Exported function/class is missing a `@remarks` block. | | E014 | warn | Optional property of interface/type is missing `@defaultValue`. | | E015 | error | Generic symbol is missing `@typeParam` for a type parameter. | | W005 | warn | Symbol references other symbols via `{@link}` but has no `@see` tags. | | W007 | warn | Guide FORGE:AUTO section references a symbol that no longer exists. | | W008 | warn | Exported public symbol is not mentioned in any guide page. | | E017 | error | `@internal` symbol re-exported through public barrel (index.ts). | | E018 | warn | `@route`-tagged function missing `@response` tag. | | W009 | warn | `{@inheritDoc}` references a symbol that does not exist. | | W010 | warn | `@breaking` tag present without `@migration` path. | | W011 | warn | New public export missing `@since` version tag. | | E019 | error | Non-test file contains `@ts-expect-error` / `@ts-expect-error`. | | E020 | error | Exported symbol has `any` in its public API signature. | | W012 | warn | `{@link}` display text appears stale relative to target summary. | | W013 | warn | `@example` block may be stale (arg count mismatch). | | W014 | warn | `@param` name in TSDoc doesn't match actual parameter name. | | W015 | warn | `@param` count in TSDoc doesn't match actual parameter count. | | W016 | warn | `@returns` tag on a void/Promise function. | | W017 | warn | `@remarks` block is empty or contains only placeholder text. | | W018 | warn | `@operation`-tagged function missing required CKM docs (`@param`, `@returns`, `@remarks`, `@example`). | | W019 | warn | CKM tag (`@operation`, `@constraint`, `@workflow`, `@concept`) has insufficient content. | | W020 | warn | `@constraint`-tagged symbol missing `@throws` to document constraint violation. | When `config.enforce.strict` is `true` all warnings are promoted to errors. **Parameters** - `config` — The resolved `ForgeConfig` for the project. **Returns**: A `ForgeResult` describing which symbols passed or failed. **Examples** ```typescript import { loadConfig } from "@forge-ts/core"; import { enforce } from "@forge-ts/enforcer"; const config = await loadConfig(); const result = await enforce(config); if (!result.success) { console.error(`${result.errors.length} errors found`); } ``` ### `formatResults()` *Defined in `packages/enforcer/src/formatter.ts:108`* ```typescript (result: ForgeResult, options: FormatOptions) => string ``` Formats a `ForgeResult` into a human-readable string suitable for printing to a terminal. Diagnostics are grouped by source file. Each file heading shows the relative-ish path, followed by indented error and warning lines. A summary line is appended at the end. **Parameters** - `result` — The result produced by `enforce`. - `options` — Rendering options (colours, verbosity). **Returns**: A formatted string ready to write to stdout or stderr. **Examples** ```typescript import { enforce } from "@forge-ts/enforcer"; import { formatResults } from "@forge-ts/enforcer"; import { loadConfig } from "@forge-ts/core"; const config = await loadConfig(); const result = await enforce(config); console.log(formatResults(result, { colors: true, verbose: false })); ``` ### `getStagedFiles()` *Defined in `packages/cli/src/commands/check.ts:175`* ```typescript (cwd: string) => string[] | null ``` Returns the list of staged .ts/.tsx files (relative paths) by querying git. Returns `null` when git is unavailable or the working directory is not a git repository. Deleted files are excluded. The command is a fixed string with no interpolated user input, so shell injection is not a concern here. **Parameters** - `cwd` — Working directory for the git command. **Returns**: Array of relative file paths, or `null` on failure. ### `runCheck()` *Defined in `packages/cli/src/commands/check.ts:465`* ```typescript (args: CheckArgs) => Promise> ``` Runs the TSDoc enforcement pass and returns a typed command output. **Parameters** - `args` — CLI arguments for the check command. **Returns**: A typed `CommandOutput`. **Examples** ```typescript import { runCheck } from "@forge-ts/cli/commands/check"; const output = await runCheck({ cwd: process.cwd() }); console.log(output.data.summary.errors); // number of TSDoc errors found ``` ### `runDocsDev()` *Defined in `packages/cli/src/commands/docs-dev.ts:37`* ```typescript (args: { cwd?: string; target?: string; port?: string; }) => Promise ``` Starts the local dev server for the configured SSG target. Reads `gen.ssgTarget` from the forge-ts config, resolves the adapter, and spawns the platform's dev server in the output directory. **Parameters** - `args` — Command arguments. **Returns**: A promise that resolves when the server exits. **Examples** ```typescript import { runDocsDev } from "@forge-ts/cli"; await runDocsDev({ cwd: "./my-project" }); ``` ### `readPkgJson()` *Defined in `packages/cli/src/pkg-json.ts:52`* ```typescript (rootDir: string) => PkgJson | null ``` Read and parse package.json from a project root. Detects indent style and trailing newline for lossless round-tripping. Returns `null` if the file doesn't exist or can't be parsed. **Parameters** - `rootDir` — Absolute path to the project root. **Returns**: Parsed package.json with formatting metadata, or null. ### `serializePkgJson()` *Defined in `packages/cli/src/pkg-json.ts:78`* ```typescript (pkg: PkgJson) => string ``` Serialize a package.json object preserving original formatting. **Parameters** - `pkg` — The parsed package.json with formatting metadata. **Returns**: Formatted JSON string ready to write to disk. ### `writePkgJson()` *Defined in `packages/cli/src/pkg-json.ts:88`* ```typescript (pkg: PkgJson) => Promise ``` Write a modified package.json back to disk, preserving formatting. **Parameters** - `pkg` — The parsed and modified package.json. ### `addScripts()` *Defined in `packages/cli/src/pkg-json.ts:107`* ```typescript (pkg: PkgJson, scripts: Record) => string[] ``` Add scripts to package.json idempotently. Only adds scripts where the key doesn't already exist. Never overwrites existing script values. Returns the list of keys added. **Parameters** - `pkg` — The parsed package.json to modify (mutated in place). - `scripts` — Map of script key to command value. **Returns**: Array of script keys that were added (empty if all already existed). ### `detectHookManager()` *Defined in `packages/cli/src/commands/init-hooks.ts:104`* ```typescript (rootDir: string) => HookManager ``` Detects which hook manager is present in the project. Checks for: - husky: `.husky/` directory or `husky` in package.json devDependencies - lefthook: `lefthook.yml` or `lefthook` in package.json devDependencies **Parameters** - `rootDir` — Absolute path to the project root. **Returns**: The detected hook manager, or "none" if neither is found. **Examples** ```typescript import { detectHookManager } from "@forge-ts/cli/commands/init-hooks"; const manager = detectHookManager("/path/to/project"); console.log(manager); // "husky" | "lefthook" | "none" ``` ### `generateHuskyHook()` *Defined in `packages/cli/src/commands/init-hooks.ts:191`* ```typescript () => string ``` Generates the husky pre-commit hook file content (modern husky v9+). ### `generateHuskyPrePushHook()` *Defined in `packages/cli/src/commands/init-hooks.ts:199`* ```typescript () => string ``` Generates the husky pre-push hook file content (modern husky v9+). ### `generateLefthookBlock()` *Defined in `packages/cli/src/commands/init-hooks.ts:207`* ```typescript () => string ``` Generates the lefthook block with both pre-commit and pre-push sections. ### `detectVersionGuard()` *Defined in `packages/cli/src/commands/init-hooks.ts:249`* ```typescript (rootDir: string) => boolean ``` Checks whether a versionguard config file exists in the project root. When detected, forge-ts appends versionguard's hook lines to the generated hook files so both tools run cooperatively. **Parameters** - `rootDir` — Absolute path to the project root. **Returns**: True when a versionguard config file is found. **Examples** ```typescript import { detectVersionGuard } from "@forge-ts/cli/commands/init-hooks"; if (detectVersionGuard("/path/to/project")) { console.log("VersionGuard detected — adding cooperative hooks"); } ``` ### `runInitHooks()` *Defined in `packages/cli/src/commands/init-hooks.ts:278`* ```typescript (args: InitHooksArgs) => Promise> ``` Scaffolds git hook integration for the project. Detects the hook manager (husky or lefthook), generates appropriate hook files, and reports what was written. **Parameters** - `args` — CLI arguments for the init hooks command. **Returns**: A typed `CommandOutput`. **Examples** ```typescript import { runInitHooks } from "@forge-ts/cli/commands/init-hooks"; const output = await runInitHooks({ cwd: "/my/project" }); console.log(output.data.files); // [".husky/pre-commit"] ``` ### `detectEnvironment()` *Defined in `packages/cli/src/commands/init-project.ts:137`* ```typescript (rootDir: string) => InitProjectEnvironment ``` Detects the project environment by checking for files and dependencies. **Parameters** - `rootDir` — Absolute path to the project root. **Returns**: The detected environment. ### `buildTsdocContent()` *Defined in `packages/cli/src/commands/init-project.ts:237`* ```typescript (customTags?: Array<{ tagName: string; syntaxKind: "block" | "inline" | "modifier"; }>) => string ``` Builds tsdoc.json content, merging in customTags from the forge config. When `customTags` is non-empty, the written tsdoc.json includes both `tagDefinitions` and `supportForTags` entries so that the TSDoc parser (and any editor extensions) recognise the custom tags. **Parameters** - `customTags` — Custom tag definitions from `ForgeConfig.tsdoc.customTags`. **Returns**: A JSON string for tsdoc.json. ### `runInitProject()` *Defined in `packages/cli/src/commands/init-project.ts:301`* ```typescript (args: InitProjectArgs) => Promise> ``` Runs the full project init flow. **Parameters** - `args` — CLI arguments for the init command. **Returns**: A typed `CommandOutput`. **Examples** ```typescript import { runInitProject } from "@forge-ts/cli/commands/init-project"; const output = await runInitProject({ cwd: process.cwd() }); console.log(output.data.created); // ["forge-ts.config.ts", "tsdoc.json"] ``` ### `runDoctor()` *Defined in `packages/cli/src/commands/doctor.ts:161`* ```typescript (args: DoctorArgs) => Promise> ``` Runs the doctor integrity check flow. **Parameters** - `args` — CLI arguments for the doctor command. **Returns**: A typed `CommandOutput`. **Examples** ```typescript import { runDoctor } from "@forge-ts/cli/commands/doctor"; const output = await runDoctor({ cwd: process.cwd(), fix: false }); console.log(output.data.summary); // { passed: 7, warnings: 2, errors: 1, info: 0 } ``` ### `runInitDocs()` *Defined in `packages/cli/src/commands/init-docs.ts:99`* ```typescript (args: InitDocsArgs) => Promise> ``` Scaffolds a documentation site for the target SSG platform. Resolves the target from args, validates it, checks for an existing scaffold, calls the adapter's `scaffold()` method, and writes all files produced by the manifest to `outDir`. **Parameters** - `args` — CLI arguments for the init docs command. **Returns**: A typed `CommandOutput`. **Examples** ```typescript import { runInitDocs } from "@forge-ts/cli/commands/init-docs"; const output = await runInitDocs({ target: "mintlify", cwd: process.cwd() }); console.log(output.data.files); // list of created file paths ``` ### `runLock()` *Defined in `packages/cli/src/commands/lock.ts:73`* ```typescript (args: { cwd?: string; }) => Promise> ``` Runs the lock command: reads current config and creates `.forge-lock.json`. **Parameters** - `args` — CLI arguments for the lock command. **Returns**: A typed `CommandOutput`. **Examples** ```typescript import { runLock } from "@forge-ts/cli/commands/lock"; const output = await runLock({ cwd: process.cwd() }); console.log(output.data.locked.rules); // number of rules locked ``` ### `runPrepublish()` *Defined in `packages/cli/src/commands/prepublish.ts:118`* ```typescript (args: PrepublishArgs) => Promise> ``` Runs the prepublish safety gate: check then build. If the check step fails, the build step is skipped entirely. Both steps use the same project root (cwd). **Parameters** - `args` — CLI arguments for the prepublish command. **Returns**: A typed `CommandOutput`. **Examples** ```typescript import { runPrepublish } from "@forge-ts/cli/commands/prepublish"; const output = await runPrepublish({ cwd: process.cwd() }); if (!output.success) process.exit(1); ``` ### `extractExamples()` *Defined in `packages/doctest/src/extractor.ts:41`* ```typescript (symbols: ForgeSymbol[]) => ExtractedExample[] ``` Extracts all `@example` blocks from a list of `ForgeSymbol` objects. **Parameters** - `symbols` — The symbols produced by the core AST walker. **Returns**: A flat array of `ExtractedExample` objects, one per code block. **Examples** ```typescript import { createWalker, loadConfig } from "@forge-ts/core"; import { extractExamples } from "@forge-ts/doctest"; const config = await loadConfig(); const symbols = createWalker(config).walk(); const examples = extractExamples(symbols); console.log(`Found ${examples.length} examples`); ``` ### `generateTestFiles()` *Defined in `packages/doctest/src/generator.ts:151`* ```typescript (examples: ExtractedExample[], options: GeneratorOptions) => VirtualTestFile[] ``` Generates a virtual test file for a set of extracted examples. Each example is wrapped in an `it()` block using the Node built-in `node:test` runner so that no additional test framework is required. Auto-imports the tested symbol from the source file, processes `// =>` assertion patterns, and appends an inline source map. **Parameters** - `examples` — Examples to include in the generated file. - `options` — Output configuration. **Returns**: An array of `VirtualTestFile` objects (one per source file). **Examples** ```typescript import { generateTestFiles } from "@forge-ts/doctest"; const files = generateTestFiles(examples, { cacheDir: "/tmp/doctest-cache" }); console.log(`Generated ${files.length} test file(s)`); ``` ### `runTests()` *Defined in `packages/doctest/src/runner.ts:103`* ```typescript (files: VirtualTestFile[]) => Promise ``` Writes virtual test files to disk and executes them with Node 24 native TypeScript support (`--experimental-strip-types --test`). **Parameters** - `files` — The virtual test files to write and run. **Returns**: A `RunResult` summarising the test outcome. **Examples** ```typescript import { runTests } from "@forge-ts/doctest"; const result = await runTests(virtualFiles); if (!result.success) { console.error(`${result.failed} doctest(s) failed`); } ``` ### `doctest()` *Defined in `packages/doctest/src/index.ts:104`* ```typescript (config: ForgeConfig) => Promise ``` Runs the full doctest pipeline: extract → generate → run. **Parameters** - `config` — The resolved `ForgeConfig` for the project. The `config.doctest.cacheDir` field controls where generated test files are written; all other doctest behaviour uses `config.rootDir` and `config.tsconfig`. **Returns**: A `ForgeResult` whose `success` field is `true` only when every extracted example passes. `errors` contains `D001`/`D002` diagnostics on failure; `symbols` is the full symbol graph from the walk step. **Examples** ```typescript import { loadConfig } from "@forge-ts/core"; import { doctest } from "@forge-ts/doctest"; const config = await loadConfig(); const result = await doctest(config); if (!result.success) { console.error(`${result.errors.length} doctest failure(s)`); process.exit(1); } ``` ### `runTest()` *Defined in `packages/cli/src/commands/test.ts:74`* ```typescript (args: TestArgs) => Promise> ``` Runs the doctest pipeline and returns a typed command output. **Parameters** - `args` — CLI arguments for the test command. **Returns**: A typed `CommandOutput`. **Examples** ```typescript import { runTest } from "@forge-ts/cli/commands/test"; const output = await runTest({ cwd: process.cwd() }); console.log(output.data.summary.passed); // number of passing doctests ``` ### `runUnlock()` *Defined in `packages/cli/src/commands/unlock.ts:62`* ```typescript (args: { cwd?: string; reason: string; }) => Promise> ``` Runs the unlock command: removes `.forge-lock.json` with a mandatory reason. **Parameters** - `args` — CLI arguments for the unlock command. **Returns**: A typed `CommandOutput`. **Examples** ```typescript import { runUnlock } from "@forge-ts/cli/commands/unlock"; const output = await runUnlock({ cwd: process.cwd(), reason: "Relaxing rules for migration" }); console.log(output.data.success); // true ``` ### `extractExamples()` *Defined in `packages/doctest/src/src/extractor.ts:45`* ```typescript (symbols: ForgeSymbol[]) => ExtractedExample[] ``` Extracts all `@example` blocks from a list of `ForgeSymbol` objects. **Parameters** - `symbols` — The symbols produced by the core AST walker. **Returns**: A flat array of `ExtractedExample` objects, one per code block. **Examples** ```typescript import { createWalker, loadConfig } from "@forge-ts/core"; import { extractExamples } from "@forge-ts/doctest"; const config = await loadConfig(); const symbols = createWalker(config).walk(); const examples = extractExamples(symbols); console.log(`Found ${examples.length} examples`); ``` ### `generateTestFiles()` *Defined in `packages/doctest/src/src/generator.ts:155`* ```typescript (examples: ExtractedExample[], options: GeneratorOptions) => VirtualTestFile[] ``` Generates a virtual test file for a set of extracted examples. Each example is wrapped in an `it()` block using the Node built-in `node:test` runner so that no additional test framework is required. Auto-imports the tested symbol from the source file, processes `// =>` assertion patterns, and appends an inline source map. **Parameters** - `examples` — Examples to include in the generated file. - `options` — Output configuration. **Returns**: An array of `VirtualTestFile` objects (one per source file). **Examples** ```typescript import { generateTestFiles } from "@forge-ts/doctest"; const files = generateTestFiles(examples, opts); console.log(`Generated ${files.length} test file(s)`); ``` ### `runTests()` *Defined in `packages/doctest/src/src/runner.ts:111`* ```typescript (files: VirtualTestFile[]) => Promise ``` Writes virtual test files to disk and executes them with Node 24 native TypeScript support (`--experimental-strip-types --test`). **Parameters** - `files` — The virtual test files to write and run. **Returns**: A `RunResult` summarising the test outcome. **Examples** ```typescript import { runTests } from "@forge-ts/doctest"; const result = await runTests(virtualFiles); if (!result.success) { console.error(`${result.failed} doctest(s) failed`); } ``` ### `doctest()` *Defined in `packages/doctest/src/src/index.ts:47`* ```typescript (config: ForgeConfig) => Promise ``` Runs the full doctest pipeline: extract → generate → run. **Parameters** - `config` — The resolved `ForgeConfig` for the project. **Returns**: A `ForgeResult` with success/failure and any diagnostics. **Examples** ```typescript import { loadConfig } from "@forge-ts/core"; import { doctest } from "@forge-ts/doctest"; const config = await loadConfig(); const result = await doctest(config); if (!result.success) { console.error(`${result.errors.length} doctest failure(s)`); } ``` ### `findDeprecatedUsages()` *Defined in `packages/enforcer/src/src/deprecation-tracker.ts:34`* ```typescript (symbols: ForgeSymbol[]) => DeprecatedUsage[] ``` Scans symbols for imports of deprecated exports from other packages. **Parameters** - `symbols` — All symbols from the walker across the entire project. **Returns**: Array of deprecated usages found. **Examples** ```typescript import { findDeprecatedUsages } from "@forge-ts/enforcer"; const usages = findDeprecatedUsages(symbols); console.log(`${usages.length} deprecated import(s)`); ``` ### `enforce()` *Defined in `packages/enforcer/src/src/enforcer.ts:367`* ```typescript (config: ForgeConfig) => Promise ``` Runs the TSDoc enforcement pass against a project. The enforcer walks all exported symbols that meet the configured minimum visibility threshold and emits diagnostics for any documentation deficiencies it finds. ### Error codes | Code | Severity | Condition | |------|----------|-----------| | E001 | error | Exported symbol is missing a TSDoc summary. | | E002 | error | Function/method parameter lacks a `@param` tag. | | E003 | error | Non-void function/method lacks a `@returns` tag. | | E004 | error | Exported function/method is missing an `@example` block. | | E005 | error | Package entry point (index.ts) is missing `@packageDocumentation`. | | E006 | error | Public/protected class member is missing a TSDoc comment. | | E007 | error | Interface/type alias property is missing a TSDoc comment. | | W001 | warning | TSDoc comment contains parse errors. | | W002 | warning | Function body throws but has no `@throws` tag. | | W003 | warning | `@deprecated` tag is present without explanation. | | W006 | warning | TSDoc parser-level syntax error (invalid tag, malformed block, etc.). | | E009 | error | tsconfig.json required strict-mode flag is missing or disabled (guard). | | E010 | error | Config drift: a rule severity is weaker than the locked value. | | E013 | error | Exported function/class is missing a `@remarks` block. | | E014 | warn | Optional property of interface/type is missing `@defaultValue`. | | E015 | error | Generic symbol is missing `@typeParam` for a type parameter. | | W005 | warn | Symbol references other symbols via `{@link}` but has no `@see` tags. | | W007 | warn | Guide FORGE:AUTO section references a symbol that no longer exists. | | W008 | warn | Exported public symbol is not mentioned in any guide page. | | E017 | error | `@internal` symbol re-exported through public barrel (index.ts). | | E018 | warn | `@route`-tagged function missing `@response` tag. | | W009 | warn | `{@inheritDoc}` references a symbol that does not exist. | | W010 | warn | `@breaking` tag present without `@migration` path. | | W011 | warn | New public export missing `@since` version tag. | | E019 | error | Non-test file contains `@ts-expect-error` / `@ts-expect-error`. | | E020 | error | Exported symbol has `any` in its public API signature. | | W012 | warn | `{@link}` display text appears stale relative to target summary. | | W013 | warn | `@example` block may be stale (arg count mismatch). | When `config.enforce.strict` is `true` all warnings are promoted to errors. **Parameters** - `config` — The resolved `ForgeConfig` for the project. **Returns**: A `ForgeResult` describing which symbols passed or failed. **Examples** ```typescript import { loadConfig } from "@forge-ts/core"; import { enforce } from "@forge-ts/enforcer"; const config = await loadConfig(); const result = await enforce(config); if (!result.success) { console.error(`${result.errors.length} errors found`); } ``` ### `formatResults()` *Defined in `packages/enforcer/src/src/formatter.ts:114`* ```typescript (result: ForgeResult, options: FormatOptions) => string ``` Formats a `ForgeResult` into a human-readable string suitable for printing to a terminal. Diagnostics are grouped by source file. Each file heading shows the relative-ish path, followed by indented error and warning lines. A summary line is appended at the end. **Parameters** - `result` — The result produced by `enforce`. - `options` — Rendering options (colours, verbosity). **Returns**: A formatted string ready to write to stdout or stderr. **Examples** ```typescript import { enforce } from "@forge-ts/enforcer"; import { formatResults } from "@forge-ts/enforcer"; import { loadConfig } from "@forge-ts/core"; const config = await loadConfig(); const result = await enforce(config); console.log(formatResults(result, opts)); ``` ## Interfaces ### `AuditEvent` *Defined in `packages/core/src/audit.ts:39`* ```typescript AuditEvent ``` A single audit event recorded in the forge-ts audit trail. #### `timestamp` *Defined in `packages/core/src/audit.ts:41`* ```typescript string ``` ISO 8601 timestamp of when the event occurred. #### `event` *Defined in `packages/core/src/audit.ts:43`* ```typescript AuditEventType ``` Discriminated event type. #### `user` *Defined in `packages/core/src/audit.ts:45`* ```typescript string ``` OS username of the actor (falls back to "unknown"). #### `reason` *Defined in `packages/core/src/audit.ts:50`* ```typescript string | undefined ``` Mandatory for lock/unlock/bypass events; optional otherwise. #### `details` *Defined in `packages/core/src/audit.ts:52`* ```typescript Record ``` Event-specific payload. ### `ReadAuditOptions` *Defined in `packages/core/src/audit.ts:114`* ```typescript ReadAuditOptions ``` Options for reading the audit log. #### `limit` *Defined in `packages/core/src/audit.ts:119`* ```typescript number | undefined ``` Maximum number of events to return. #### `eventType` *Defined in `packages/core/src/audit.ts:124`* ```typescript AuditEventType | undefined ``` Filter to a single event type. ### `BypassConfig` *Defined in `packages/core/src/bypass.ts:31`* ```typescript BypassConfig ``` Configuration for the bypass budget system. #### `dailyBudget` *Defined in `packages/core/src/bypass.ts:33`* ```typescript number ``` Maximum number of bypasses allowed per calendar day. Default: 3 #### `durationHours` *Defined in `packages/core/src/bypass.ts:35`* ```typescript number ``` Duration in hours before a bypass automatically expires. Default: 24 ### `BypassRecord` *Defined in `packages/core/src/bypass.ts:44`* ```typescript BypassRecord ``` A single bypass record stored in `.forge-bypass.json`. #### `id` *Defined in `packages/core/src/bypass.ts:46`* ```typescript string ``` Unique identifier for this bypass. #### `createdAt` *Defined in `packages/core/src/bypass.ts:48`* ```typescript string ``` ISO 8601 timestamp when the bypass was created. #### `expiresAt` *Defined in `packages/core/src/bypass.ts:50`* ```typescript string ``` ISO 8601 timestamp when the bypass expires. #### `reason` *Defined in `packages/core/src/bypass.ts:52`* ```typescript string ``` Mandatory justification for why the bypass was created. #### `rule` *Defined in `packages/core/src/bypass.ts:54`* ```typescript string ``` Specific rule code bypassed (e.g., "E009"), or "all" for a blanket bypass. #### `user` *Defined in `packages/core/src/bypass.ts:56`* ```typescript string ``` OS username of the actor who created the bypass. ### `ForgeSymbol` *Defined in `packages/core/src/types.ts:19`* ```typescript ForgeSymbol ``` A single extracted and annotated symbol from the TypeScript AST. #### `name` *Defined in `packages/core/src/types.ts:21`* ```typescript string ``` The declared name of the symbol. #### `kind` *Defined in `packages/core/src/types.ts:23`* ```typescript "function" | "class" | "interface" | "type" | "enum" | "variable" | "method" | "property" | "file" ``` The syntactic kind of the symbol. #### `visibility` *Defined in `packages/core/src/types.ts:34`* ```typescript Visibility ``` Resolved visibility from TSDoc release tags. #### `filePath` *Defined in `packages/core/src/types.ts:36`* ```typescript string ``` Absolute path to the source file. #### `line` *Defined in `packages/core/src/types.ts:38`* ```typescript number ``` 1-based line number of the declaration. #### `column` *Defined in `packages/core/src/types.ts:40`* ```typescript number ``` 0-based column of the declaration. #### `documentation` *Defined in `packages/core/src/types.ts:45`* ```typescript { summary?: string; remarks?: string; params?: Array<{ name: string; description: string; type?: string; }>; returns?: { description: string; type?: string; }; throws?: Array<{ type?: string; description: string; }>; examples?: Array<{ code: string; language: string; line: number; }>; tags?: Record; deprecated?: string; links?: Array<{ target: string; line: number; text?: string; }>; parseMessages?: Array<{ messageId: string; text: string; line: number; }>; } | undefined ``` Parsed TSDoc documentation, if present. #### `signature` *Defined in `packages/core/src/types.ts:64`* ```typescript string | undefined ``` Human-readable type signature of the symbol. #### `children` *Defined in `packages/core/src/types.ts:69`* ```typescript ForgeSymbol[] | undefined ``` Child symbols (e.g., class members, enum values). #### `exported` *Defined in `packages/core/src/types.ts:71`* ```typescript boolean ``` Whether this symbol is part of the public module exports. ### `EnforceRules` *Defined in `packages/core/src/types.ts:92`* ```typescript EnforceRules ``` Per-rule severity configuration for the TSDoc enforcer. 40 rules across 5 layers: API (E001-E008, W003-W004), Dev (E013-E015, E017-E018, W005-W006, W009), Consumer (E016, W007-W008, W010-W011), LLM Anti-Pattern (E019-E020, W012-W013), Staleness (W014-W017), CKM Truthfulness (W018-W020). #### `"require-summary"` *Defined in `packages/core/src/types.ts:94`* ```typescript RuleSeverity ``` E001: Exported symbol missing TSDoc summary. #### `"require-param"` *Defined in `packages/core/src/types.ts:96`* ```typescript RuleSeverity ``` E002: Function parameter missing `\@param` tag. #### `"require-returns"` *Defined in `packages/core/src/types.ts:98`* ```typescript RuleSeverity ``` E003: Non-void function missing `\@returns` tag. #### `"require-example"` *Defined in `packages/core/src/types.ts:100`* ```typescript RuleSeverity ``` E004: Exported function missing `\@example` block. #### `"require-package-doc"` *Defined in `packages/core/src/types.ts:102`* ```typescript RuleSeverity ``` E005: Entry point missing `\@packageDocumentation`. #### `"require-class-member-doc"` *Defined in `packages/core/src/types.ts:104`* ```typescript RuleSeverity ``` E006: Class member missing documentation. #### `"require-interface-member-doc"` *Defined in `packages/core/src/types.ts:106`* ```typescript RuleSeverity ``` E007: Interface/type member missing documentation. #### `"require-tsdoc-syntax"` *Defined in `packages/core/src/types.ts:108`* ```typescript RuleSeverity ``` W006: TSDoc syntax parse error (invalid tag, malformed block, etc.). #### `"require-remarks"` *Defined in `packages/core/src/types.ts:110`* ```typescript RuleSeverity ``` E013: Exported function/class is missing a `\@remarks` block. #### `"require-default-value"` *Defined in `packages/core/src/types.ts:112`* ```typescript RuleSeverity ``` E014: Optional property with default is missing `\@defaultValue`. #### `"require-type-param"` *Defined in `packages/core/src/types.ts:114`* ```typescript RuleSeverity ``` E015: Generic symbol is missing `\@typeParam` for its type parameters. #### `"require-see"` *Defined in `packages/core/src/types.ts:116`* ```typescript RuleSeverity ``` W005: Symbol references other symbols via `\@link` but has no `\@see` tags. #### `"require-release-tag"` *Defined in `packages/core/src/types.ts:118`* ```typescript RuleSeverity ``` E016: Exported symbol is missing a release tag (`\@public`, `\@beta`, `\@internal`). #### `"require-fresh-guides"` *Defined in `packages/core/src/types.ts:120`* ```typescript RuleSeverity ``` W007: Guide FORGE:AUTO section references a symbol that no longer exists or has changed. #### `"require-guide-coverage"` *Defined in `packages/core/src/types.ts:122`* ```typescript RuleSeverity ``` W008: Exported public symbol is not mentioned in any guide page. #### `"require-internal-boundary"` *Defined in `packages/core/src/types.ts:124`* ```typescript RuleSeverity ``` E017: `\@internal` symbol re-exported through public barrel (index.ts). #### `"require-route-response"` *Defined in `packages/core/src/types.ts:126`* ```typescript RuleSeverity ``` E018: `\@route`-tagged function missing `\@response` tag. #### `"require-inheritdoc-source"` *Defined in `packages/core/src/types.ts:128`* ```typescript RuleSeverity ``` W009: `\@inheritDoc` references a symbol that does not exist. #### `"require-migration-path"` *Defined in `packages/core/src/types.ts:130`* ```typescript RuleSeverity ``` W010: `\@breaking` without `\@migration` path. #### `"require-since"` *Defined in `packages/core/src/types.ts:132`* ```typescript RuleSeverity ``` W011: New public export missing `\@since` version tag. #### `"require-fresh-examples"` *Defined in `packages/core/src/types.ts:134`* ```typescript RuleSeverity ``` W013: `\@example` block may be stale — function call arg count mismatches parameter count. #### `"require-no-ts-ignore"` *Defined in `packages/core/src/types.ts:136`* ```typescript RuleSeverity ``` E019: Non-test file contains ts-ignore or ts-expect-error directive. #### `"require-no-any-in-api"` *Defined in `packages/core/src/types.ts:138`* ```typescript RuleSeverity ``` E020: Exported symbol has `any` in its public API signature. #### `"require-fresh-link-text"` *Defined in `packages/core/src/types.ts:140`* ```typescript RuleSeverity ``` W012: `\@link` display text appears stale relative to target summary. #### `"require-fresh-params"` *Defined in `packages/core/src/types.ts:142`* ```typescript RuleSeverity ``` W014: `\@param` name in TSDoc does not match actual parameter name in signature. #### `"require-param-count"` *Defined in `packages/core/src/types.ts:144`* ```typescript RuleSeverity ``` W015: `\@param` count in TSDoc does not match actual parameter count in signature. #### `"require-fresh-returns"` *Defined in `packages/core/src/types.ts:146`* ```typescript RuleSeverity ``` W016: `\@returns` tag present on a void/Promisevoid function. #### `"require-meaningful-remarks"` *Defined in `packages/core/src/types.ts:148`* ```typescript RuleSeverity ``` W017: `\@remarks` block is empty or contains only placeholder text. #### `"require-operation-completeness"` *Defined in `packages/core/src/types.ts:150`* ```typescript RuleSeverity ``` W018: `\@operation`-tagged function missing required CKM documentation (`\@param`, `\@returns`, `\@remarks`, `\@example`). #### `"require-ckm-tag-content"` *Defined in `packages/core/src/types.ts:152`* ```typescript RuleSeverity ``` W019: CKM tag (`\@operation`, `\@constraint`, `\@workflow`, `\@concept`) has empty or insufficient content. #### `"require-constraint-throws"` *Defined in `packages/core/src/types.ts:154`* ```typescript RuleSeverity ``` W020: `\@constraint`-tagged symbol missing `\@throws` to document constraint violation error. ### `ForgeConfig` *Defined in `packages/core/src/types.ts:182`* ```typescript ForgeConfig ``` Full configuration for a forge-ts run. **Examples** ```typescript // forge-ts.config.ts import { defineConfig } from "@forge-ts/core"; export default defineConfig({ outDir: "docs/generated", enforce: { strict: true }, gen: { formats: ["mdx"], ssgTarget: "fumadocs" }, }); ``` #### `rootDir` *Defined in `packages/core/src/types.ts:194`* ```typescript string ``` Root directory of the project. #### `tsconfig` *Defined in `packages/core/src/types.ts:206`* ```typescript string ``` Path to the `tsconfig.json` used for TypeScript compilation and type resolution. #### `outDir` *Defined in `packages/core/src/types.ts:220`* ```typescript string ``` Output directory for all generated documentation artifacts. #### `enforce` *Defined in `packages/core/src/types.ts:234`* ```typescript { enabled: boolean; minVisibility: Visibility | "public" | "beta" | "internal" | "private"; strict: boolean; rules: EnforceRules; ignoreFile?: string; } ``` Enforcement configuration — controls which TSDoc rules run and at what severity. #### `doctest` *Defined in `packages/core/src/types.ts:337`* ```typescript { enabled: boolean; cacheDir: string; } ``` DocTest configuration — controls execution of `@example` blocks as live tests. #### `api` *Defined in `packages/core/src/types.ts:375`* ```typescript { enabled: boolean; openapi: boolean; openapiPath: string; } ``` API generation configuration — controls OpenAPI spec output. #### `gen` *Defined in `packages/core/src/types.ts:422`* ```typescript { enabled: boolean; formats: Array<"markdown" | "mdx">; llmsTxt: boolean; readmeSync: boolean; ssgTarget?: "docusaurus" | "mintlify" | "nextra" | "vitepress" | "fumadocs"; ckm?: boolean; } ``` Documentation generation configuration — controls what files are written by `forge gen`. #### `skill` *Defined in `packages/core/src/types.ts:523`* ```typescript { enabled?: boolean; customSections?: Array<{ heading: string; content: string; }>; extraGotchas?: string[]; } ``` SKILL.md generation settings. #### `tsdoc` *Defined in `packages/core/src/types.ts:579`* ```typescript { writeConfig: boolean; customTags: Array<{ tagName: string; syntaxKind: "block" | "inline" | "modifier"; }>; enforce: { core: "error" | "warn" | "off"; extended: "error" | "warn" | "off"; discretionary: "error" | "warn" | "off"; }; } ``` TSDoc ecosystem configuration — tag definitions and group-level enforcement. #### `bypass` *Defined in `packages/core/src/types.ts:682`* ```typescript { dailyBudget: number; durationHours: number; } ``` Bypass budget — controls how many temporary rule suppressions are allowed. #### `guides` *Defined in `packages/core/src/types.ts:719`* ```typescript { enabled: boolean; autoDiscover: boolean; custom: Array<{ slug: string; title: string; sources: string[]; }>; } ``` Guide generation configuration — controls intelligent guide page output. #### `guards` *Defined in `packages/core/src/types.ts:788`* ```typescript { tsconfig: { enabled: boolean; requiredFlags: string[]; }; biome: { enabled: boolean; lockedRules: string[]; }; packageJson: { enabled: boolean; minNodeVersion: string; requiredFields: string[]; }; } ``` Downstream config drift guards — validate tooling config files stay in sync. #### `_configWarnings` *Defined in `packages/core/src/types.ts:918`* ```typescript string[] | undefined ``` Warnings generated during config loading (e.g., unknown keys, failed imports). #### `project` *Defined in `packages/core/src/types.ts:931`* ```typescript { repository?: string; homepage?: string; packageName?: string; description?: string; version?: string; bin?: Record; scripts?: Record; keywords?: string[]; } ``` Project metadata — auto-detected from `package.json` when not provided. ### `ForgeResult` *Defined in `packages/core/src/types.ts:1040`* ```typescript ForgeResult ``` The result of a forge-ts compilation pass. #### `success` *Defined in `packages/core/src/types.ts:1042`* ```typescript boolean ``` Whether the run succeeded without errors. #### `symbols` *Defined in `packages/core/src/types.ts:1044`* ```typescript ForgeSymbol[] ``` All symbols extracted during this run. #### `errors` *Defined in `packages/core/src/types.ts:1046`* ```typescript ForgeError[] ``` Errors that caused or would cause failure. #### `warnings` *Defined in `packages/core/src/types.ts:1048`* ```typescript ForgeWarning[] ``` Non-fatal warnings. #### `duration` *Defined in `packages/core/src/types.ts:1050`* ```typescript number ``` Wall-clock duration of the run in milliseconds. #### `writtenFiles` *Defined in `packages/core/src/types.ts:1055`* ```typescript string[] | undefined ``` Absolute paths of files written during this run (populated by gen). ### `ForgeError` *Defined in `packages/core/src/types.ts:1063`* ```typescript ForgeError ``` A diagnostic error produced during a forge-ts run. #### `code` *Defined in `packages/core/src/types.ts:1065`* ```typescript string ``` Machine-readable error code (e.g. "E001"). #### `message` *Defined in `packages/core/src/types.ts:1067`* ```typescript string ``` Human-readable description of the error. #### `filePath` *Defined in `packages/core/src/types.ts:1069`* ```typescript string ``` Absolute path of the file where the error occurred. #### `line` *Defined in `packages/core/src/types.ts:1071`* ```typescript number ``` 1-based line number. #### `column` *Defined in `packages/core/src/types.ts:1073`* ```typescript number ``` 0-based column. #### `suggestedFix` *Defined in `packages/core/src/types.ts:1078`* ```typescript string | undefined ``` Suggested fix for the agent — exact TSDoc block to add. #### `symbolName` *Defined in `packages/core/src/types.ts:1083`* ```typescript string | undefined ``` The symbol name that needs fixing. #### `symbolKind` *Defined in `packages/core/src/types.ts:1088`* ```typescript string | undefined ``` The symbol kind (function, class, interface, etc.). ### `ForgeWarning` *Defined in `packages/core/src/types.ts:1096`* ```typescript ForgeWarning ``` A diagnostic warning produced during a forge-ts run. #### `code` *Defined in `packages/core/src/types.ts:1098`* ```typescript string ``` Machine-readable warning code (e.g. "W001"). #### `message` *Defined in `packages/core/src/types.ts:1100`* ```typescript string ``` Human-readable description of the warning. #### `filePath` *Defined in `packages/core/src/types.ts:1102`* ```typescript string ``` Absolute path of the file where the warning occurred. #### `line` *Defined in `packages/core/src/types.ts:1104`* ```typescript number ``` 1-based line number. #### `column` *Defined in `packages/core/src/types.ts:1106`* ```typescript number ``` 0-based column. ### `ForgeLockManifest` *Defined in `packages/core/src/lock.ts:37`* ```typescript ForgeLockManifest ``` Manifest stored in `.forge-lock.json`. Captures a point-in-time snapshot of the project's forge-ts configuration so that future runs can detect when settings have been weakened. #### `version` *Defined in `packages/core/src/lock.ts:39`* ```typescript string ``` Schema version of the lock manifest. #### `lockedAt` *Defined in `packages/core/src/lock.ts:41`* ```typescript string ``` ISO-8601 timestamp when the lock was created. #### `lockedBy` *Defined in `packages/core/src/lock.ts:43`* ```typescript string ``` Identifier of the user or agent that created the lock. #### `config` *Defined in `packages/core/src/lock.ts:45`* ```typescript { rules: Record; tsconfig?: Record; biome?: Record; } ``` Snapshot of locked configuration values. ### `LockViolation` *Defined in `packages/core/src/lock.ts:61`* ```typescript LockViolation ``` A single violation found when comparing current config against the lock. #### `field` *Defined in `packages/core/src/lock.ts:63`* ```typescript string ``` Dot-path of the config field that changed (e.g., "rules.require-summary"). #### `locked` *Defined in `packages/core/src/lock.ts:65`* ```typescript string ``` The value stored in the lock file. #### `current` *Defined in `packages/core/src/lock.ts:67`* ```typescript string ``` The current value in the live config. #### `message` *Defined in `packages/core/src/lock.ts:69`* ```typescript string ``` Human-readable explanation of the violation. ### `OpenAPISchemaObject` *Defined in `packages/core/src/openapi-types.ts:16`* ```typescript OpenAPISchemaObject ``` OpenAPI 3.2 schema object. #### `type` *Defined in `packages/core/src/openapi-types.ts:21`* ```typescript "string" | "number" | "boolean" | "object" | "integer" | "array" | "null" | undefined ``` The data type of the schema (e.g., "string", "number", "object", "array"). #### `format` *Defined in `packages/core/src/openapi-types.ts:26`* ```typescript string | undefined ``` A format hint for the data type (e.g., "int32", "date-time", "email", "uuid"). #### `description` *Defined in `packages/core/src/openapi-types.ts:31`* ```typescript string | undefined ``` A human-readable description of the schema's purpose or constraints. #### `properties` *Defined in `packages/core/src/openapi-types.ts:36`* ```typescript Record | undefined ``` Property definitions for object-type schemas. Maps each property name to its schema. #### `required` *Defined in `packages/core/src/openapi-types.ts:41`* ```typescript string[] | undefined ``` List of property names that must be present on the object. #### `items` *Defined in `packages/core/src/openapi-types.ts:46`* ```typescript OpenAPISchemaObject | undefined ``` Schema definition for the elements of an array-type schema. Required when `type` is "array". #### `additionalProperties` *Defined in `packages/core/src/openapi-types.ts:51`* ```typescript boolean | OpenAPISchemaObject | undefined ``` Controls whether additional properties are allowed (`true`/`false`) or defines their schema. #### `enum` *Defined in `packages/core/src/openapi-types.ts:56`* ```typescript (string | number | boolean)[] | undefined ``` Restricts the value to one of the listed constants. #### `oneOf` *Defined in `packages/core/src/openapi-types.ts:61`* ```typescript OpenAPISchemaObject[] | undefined ``` Validates the value against exactly one of the listed sub-schemas. #### `allOf` *Defined in `packages/core/src/openapi-types.ts:66`* ```typescript OpenAPISchemaObject[] | undefined ``` Validates the value against all of the listed sub-schemas (intersection). #### `anyOf` *Defined in `packages/core/src/openapi-types.ts:71`* ```typescript OpenAPISchemaObject[] | undefined ``` Validates the value against at least one of the listed sub-schemas. #### `nullable` *Defined in `packages/core/src/openapi-types.ts:76`* ```typescript boolean | undefined ``` Indicates that the value may be `null` in addition to its declared type. #### `deprecated` *Defined in `packages/core/src/openapi-types.ts:81`* ```typescript boolean | undefined ``` Marks the schema as deprecated, signalling that it may be removed in a future version. #### `default` *Defined in `packages/core/src/openapi-types.ts:86`* ```typescript string | number | boolean | null | undefined ``` The default value to use when the property is absent. #### `$ref` *Defined in `packages/core/src/openapi-types.ts:91`* ```typescript string | undefined ``` A JSON Reference (`$ref`) pointing to another schema definition in the document. ### `OpenAPIInfoObject` *Defined in `packages/core/src/openapi-types.ts:99`* ```typescript OpenAPIInfoObject ``` OpenAPI 3.2 info object. #### `title` *Defined in `packages/core/src/openapi-types.ts:101`* ```typescript string ``` The human-readable name of the API. #### `version` *Defined in `packages/core/src/openapi-types.ts:103`* ```typescript string ``` The version string for the API (e.g., "1.0.0"). #### `description` *Defined in `packages/core/src/openapi-types.ts:108`* ```typescript string | undefined ``` A detailed description of the API, supporting CommonMark markdown. #### `summary` *Defined in `packages/core/src/openapi-types.ts:113`* ```typescript string | undefined ``` A short summary of the API, intended for display in tooling. #### `license` *Defined in `packages/core/src/openapi-types.ts:118`* ```typescript { name: string; url?: string; identifier?: string; } | undefined ``` Licensing information for the exposed API, including name, URL, and SPDX identifier. ### `OpenAPITagObject` *Defined in `packages/core/src/openapi-types.ts:126`* ```typescript OpenAPITagObject ``` OpenAPI 3.2 tag object. #### `name` *Defined in `packages/core/src/openapi-types.ts:128`* ```typescript string ``` The name of the tag, used to group operations in the document. #### `description` *Defined in `packages/core/src/openapi-types.ts:133`* ```typescript string | undefined ``` An optional description of the tag, supporting CommonMark markdown. ### `OpenAPIPathItemObject` *Defined in `packages/core/src/openapi-types.ts:141`* ```typescript OpenAPIPathItemObject ``` OpenAPI 3.2 path item object. #### `summary` *Defined in `packages/core/src/openapi-types.ts:146`* ```typescript string | undefined ``` A short summary of the path item, intended for tooling display. #### `description` *Defined in `packages/core/src/openapi-types.ts:151`* ```typescript string | undefined ``` A detailed description of the path item, supporting CommonMark markdown. #### `get` *Defined in `packages/core/src/openapi-types.ts:156`* ```typescript OpenAPIOperationObject | undefined ``` The operation definition for HTTP GET requests to this path. #### `post` *Defined in `packages/core/src/openapi-types.ts:161`* ```typescript OpenAPIOperationObject | undefined ``` The operation definition for HTTP POST requests to this path. #### `put` *Defined in `packages/core/src/openapi-types.ts:166`* ```typescript OpenAPIOperationObject | undefined ``` The operation definition for HTTP PUT requests to this path. #### `delete` *Defined in `packages/core/src/openapi-types.ts:171`* ```typescript OpenAPIOperationObject | undefined ``` The operation definition for HTTP DELETE requests to this path. #### `patch` *Defined in `packages/core/src/openapi-types.ts:176`* ```typescript OpenAPIOperationObject | undefined ``` The operation definition for HTTP PATCH requests to this path. #### `options` *Defined in `packages/core/src/openapi-types.ts:181`* ```typescript OpenAPIOperationObject | undefined ``` The operation definition for HTTP OPTIONS requests to this path. #### `head` *Defined in `packages/core/src/openapi-types.ts:186`* ```typescript OpenAPIOperationObject | undefined ``` The operation definition for HTTP HEAD requests to this path. #### `trace` *Defined in `packages/core/src/openapi-types.ts:191`* ```typescript OpenAPIOperationObject | undefined ``` The operation definition for HTTP TRACE requests to this path. #### `query` *Defined in `packages/core/src/openapi-types.ts:196`* ```typescript OpenAPIOperationObject | undefined ``` The operation definition for HTTP QUERY requests to this path (OpenAPI 3.2 extension). #### `additionalOperations` *Defined in `packages/core/src/openapi-types.ts:201`* ```typescript Record | undefined ``` Additional non-standard HTTP method operations keyed by method name. ### `OpenAPIOperationObject` *Defined in `packages/core/src/openapi-types.ts:209`* ```typescript OpenAPIOperationObject ``` OpenAPI 3.2 operation object. #### `operationId` *Defined in `packages/core/src/openapi-types.ts:214`* ```typescript string | undefined ``` A unique string identifier for the operation, used by tooling to reference it. #### `summary` *Defined in `packages/core/src/openapi-types.ts:219`* ```typescript string | undefined ``` A short, human-readable summary of what the operation does. #### `description` *Defined in `packages/core/src/openapi-types.ts:224`* ```typescript string | undefined ``` A detailed description of the operation's behaviour, supporting CommonMark markdown. #### `tags` *Defined in `packages/core/src/openapi-types.ts:229`* ```typescript string[] | undefined ``` A list of tag names that logically group this operation in documentation and tooling. #### `parameters` *Defined in `packages/core/src/openapi-types.ts:234`* ```typescript OpenAPIParameterObject[] | undefined ``` The list of parameters applicable to this operation. #### `responses` *Defined in `packages/core/src/openapi-types.ts:239`* ```typescript Record | undefined ``` The possible responses returned by this operation, keyed by HTTP status code or "default". ### `OpenAPIParameterObject` *Defined in `packages/core/src/openapi-types.ts:247`* ```typescript OpenAPIParameterObject ``` OpenAPI 3.2 parameter object. #### `name` *Defined in `packages/core/src/openapi-types.ts:249`* ```typescript string ``` The name of the parameter, case-sensitive. #### `in` *Defined in `packages/core/src/openapi-types.ts:251`* ```typescript "query" | "header" | "path" | "cookie" | "querystring" ``` The location of the parameter: path, query, header, cookie, or querystring. #### `description` *Defined in `packages/core/src/openapi-types.ts:256`* ```typescript string | undefined ``` A human-readable description of the parameter's purpose, supporting CommonMark markdown. #### `required` *Defined in `packages/core/src/openapi-types.ts:261`* ```typescript boolean | undefined ``` Whether the parameter is mandatory. Required for `in: "path"` parameters. #### `schema` *Defined in `packages/core/src/openapi-types.ts:266`* ```typescript OpenAPISchemaObject | undefined ``` The schema defining the type and constraints of the parameter value. #### `deprecated` *Defined in `packages/core/src/openapi-types.ts:271`* ```typescript boolean | undefined ``` Marks the parameter as deprecated; clients should avoid using it. ### `OpenAPIEncodingObject` *Defined in `packages/core/src/openapi-types.ts:279`* ```typescript OpenAPIEncodingObject ``` OpenAPI 3.2 encoding object. #### `contentType` *Defined in `packages/core/src/openapi-types.ts:284`* ```typescript string | undefined ``` The MIME type to use for encoding a specific property (e.g., "application/json"). #### `headers` *Defined in `packages/core/src/openapi-types.ts:289`* ```typescript Record | undefined ``` Additional headers to send alongside the encoded part, keyed by header name. #### `style` *Defined in `packages/core/src/openapi-types.ts:294`* ```typescript string | undefined ``` The serialization style for the encoded value (e.g., "form", "spaceDelimited"). #### `explode` *Defined in `packages/core/src/openapi-types.ts:299`* ```typescript boolean | undefined ``` Whether arrays and objects should be exploded into separate query parameters. #### `allowReserved` *Defined in `packages/core/src/openapi-types.ts:304`* ```typescript boolean | undefined ``` Whether reserved characters in the encoded value should be allowed without percent-encoding. ### `OpenAPIMediaTypeObject` *Defined in `packages/core/src/openapi-types.ts:312`* ```typescript OpenAPIMediaTypeObject ``` OpenAPI 3.2 media type object. #### `schema` *Defined in `packages/core/src/openapi-types.ts:317`* ```typescript OpenAPISchemaObject | undefined ``` The schema defining the structure and type of the media type's payload. #### `encoding` *Defined in `packages/core/src/openapi-types.ts:322`* ```typescript Record | undefined ``` Encoding information for specific properties of a `multipart` or `application/x-www-form-urlencoded` request body. ### `OpenAPIResponseObject` *Defined in `packages/core/src/openapi-types.ts:330`* ```typescript OpenAPIResponseObject ``` OpenAPI 3.2 response object. #### `description` *Defined in `packages/core/src/openapi-types.ts:332`* ```typescript string ``` A required human-readable description of the response, supporting CommonMark markdown. #### `headers` *Defined in `packages/core/src/openapi-types.ts:337`* ```typescript Record | undefined ``` HTTP headers returned with this response, keyed by header name. #### `content` *Defined in `packages/core/src/openapi-types.ts:342`* ```typescript Record | undefined ``` The response body content, keyed by media type (e.g., "application/json"). ### `OpenAPIDocument` *Defined in `packages/core/src/openapi-types.ts:350`* ```typescript OpenAPIDocument ``` Complete OpenAPI 3.2 document. #### `openapi` *Defined in `packages/core/src/openapi-types.ts:352`* ```typescript "3.2.0" ``` The OpenAPI specification version this document conforms to. Must be "3.2.0". #### `$self` *Defined in `packages/core/src/openapi-types.ts:357`* ```typescript string | undefined ``` An optional self-referencing URL for this document, used for tooling and resolution. #### `info` *Defined in `packages/core/src/openapi-types.ts:359`* ```typescript OpenAPIInfoObject ``` Metadata about the API including title, version, and description. #### `paths` *Defined in `packages/core/src/openapi-types.ts:361`* ```typescript Record ``` The available paths and their operations, keyed by path template (e.g., `/users/\{id\}`). #### `components` *Defined in `packages/core/src/openapi-types.ts:363`* ```typescript { schemas: Record; mediaTypes?: Record; } ``` Reusable schema and media type definitions shared across the document. #### `tags` *Defined in `packages/core/src/openapi-types.ts:371`* ```typescript OpenAPITagObject[] | undefined ``` A list of tags used to group operations, with optional descriptions. ### `ASTWalker` *Defined in `packages/core/src/walker.ts:114`* ```typescript ASTWalker ``` The return type of `createWalker`. #### `walk()` *Defined in `packages/core/src/walker.ts:119`* ```typescript () => ForgeSymbol[] ``` Walk all source files referenced by the configured tsconfig and return one `ForgeSymbol` per exported declaration. ### `SDKProperty` *Defined in `packages/api/src/sdk-extractor.ts:8`* ```typescript SDKProperty ``` A single property extracted from an interface or class symbol. #### `name` *Defined in `packages/api/src/sdk-extractor.ts:10`* ```typescript string ``` The property name. #### `type` *Defined in `packages/api/src/sdk-extractor.ts:12`* ```typescript string ``` The TypeScript type string of the property. #### `description` *Defined in `packages/api/src/sdk-extractor.ts:14`* ```typescript string | undefined ``` TSDoc summary for this property. #### `required` *Defined in `packages/api/src/sdk-extractor.ts:16`* ```typescript boolean ``` Whether the property is required (not optional). #### `deprecated` *Defined in `packages/api/src/sdk-extractor.ts:18`* ```typescript string | undefined ``` Deprecation notice, if present. ### `SDKType` *Defined in `packages/api/src/sdk-extractor.ts:25`* ```typescript SDKType ``` An SDK type descriptor extracted from the symbol graph. #### `name` *Defined in `packages/api/src/sdk-extractor.ts:27`* ```typescript string ``` The symbol name. #### `kind` *Defined in `packages/api/src/sdk-extractor.ts:29`* ```typescript "class" | "interface" | "type" | "enum" ``` Syntactic kind of the type. #### `signature` *Defined in `packages/api/src/sdk-extractor.ts:31`* ```typescript string | undefined ``` Human-readable type signature. #### `description` *Defined in `packages/api/src/sdk-extractor.ts:33`* ```typescript string | undefined ``` TSDoc summary. #### `deprecated` *Defined in `packages/api/src/sdk-extractor.ts:35`* ```typescript string | undefined ``` Deprecation notice, if present. #### `visibility` *Defined in `packages/api/src/sdk-extractor.ts:37`* ```typescript Visibility ``` Resolved visibility level. #### `properties` *Defined in `packages/api/src/sdk-extractor.ts:39`* ```typescript SDKProperty[] ``` Extracted properties (for interfaces, classes) or values (for enums). #### `sourceFile` *Defined in `packages/api/src/sdk-extractor.ts:41`* ```typescript string ``` Absolute path to the source file. ### `ReferenceEntry` *Defined in `packages/api/src/reference.ts:8`* ```typescript ReferenceEntry ``` A single entry in the generated API reference. #### `name` *Defined in `packages/api/src/reference.ts:10`* ```typescript string ``` Symbol name. #### `kind` *Defined in `packages/api/src/reference.ts:12`* ```typescript "function" | "class" | "interface" | "type" | "enum" | "variable" | "method" | "property" | "file" ``` Symbol kind. #### `summary` *Defined in `packages/api/src/reference.ts:14`* ```typescript string | undefined ``` TSDoc summary. #### `signature` *Defined in `packages/api/src/reference.ts:16`* ```typescript string | undefined ``` Human-readable type signature. #### `visibility` *Defined in `packages/api/src/reference.ts:18`* ```typescript Visibility ``` Resolved visibility level. #### `deprecated` *Defined in `packages/api/src/reference.ts:20`* ```typescript string | undefined ``` Deprecation notice, if present. #### `params` *Defined in `packages/api/src/reference.ts:22`* ```typescript { name: string; description: string; type?: string; }[] | undefined ``` Documented parameters. #### `returns` *Defined in `packages/api/src/reference.ts:24`* ```typescript { description: string; type?: string; } | undefined ``` Documented return value. #### `throws` *Defined in `packages/api/src/reference.ts:26`* ```typescript { type?: string; description: string; }[] | undefined ``` Documented thrown exceptions. #### `examples` *Defined in `packages/api/src/reference.ts:28`* ```typescript { code: string; language: string; }[] | undefined ``` Code examples from TSDoc `@example` tags. #### `children` *Defined in `packages/api/src/reference.ts:30`* ```typescript ReferenceEntry[] | undefined ``` Nested child symbols (class methods, interface properties, enum members). #### `location` *Defined in `packages/api/src/reference.ts:32`* ```typescript { filePath: string; line: number; } ``` Source file location. ### `SDKProperty` *Defined in `packages/api/src/src/sdk-extractor.ts:9`* ```typescript SDKProperty ``` A single property extracted from an interface or class symbol. #### `name` *Defined in `packages/api/src/src/sdk-extractor.ts:11`* ```typescript string ``` The property name. #### `type` *Defined in `packages/api/src/src/sdk-extractor.ts:13`* ```typescript string ``` The TypeScript type string of the property. #### `description` *Defined in `packages/api/src/src/sdk-extractor.ts:18`* ```typescript string | undefined ``` TSDoc summary for this property. #### `required` *Defined in `packages/api/src/src/sdk-extractor.ts:20`* ```typescript boolean ``` Whether the property is required (not optional). #### `deprecated` *Defined in `packages/api/src/src/sdk-extractor.ts:25`* ```typescript string | undefined ``` Deprecation notice, if present. ### `SDKType` *Defined in `packages/api/src/src/sdk-extractor.ts:33`* ```typescript SDKType ``` An SDK type descriptor extracted from the symbol graph. #### `name` *Defined in `packages/api/src/src/sdk-extractor.ts:35`* ```typescript string ``` The symbol name. #### `kind` *Defined in `packages/api/src/src/sdk-extractor.ts:37`* ```typescript "class" | "interface" | "type" | "enum" ``` Syntactic kind of the type. #### `signature` *Defined in `packages/api/src/src/sdk-extractor.ts:42`* ```typescript string | undefined ``` Human-readable type signature. #### `description` *Defined in `packages/api/src/src/sdk-extractor.ts:47`* ```typescript string | undefined ``` TSDoc summary. #### `deprecated` *Defined in `packages/api/src/src/sdk-extractor.ts:52`* ```typescript string | undefined ``` Deprecation notice, if present. #### `visibility` *Defined in `packages/api/src/src/sdk-extractor.ts:54`* ```typescript Visibility ``` Resolved visibility level. #### `properties` *Defined in `packages/api/src/src/sdk-extractor.ts:56`* ```typescript SDKProperty[] ``` Extracted properties (for interfaces, classes) or values (for enums). #### `sourceFile` *Defined in `packages/api/src/src/sdk-extractor.ts:58`* ```typescript string ``` Absolute path to the source file. ### `ReferenceEntry` *Defined in `packages/api/src/src/reference.ts:9`* ```typescript ReferenceEntry ``` A single entry in the generated API reference. #### `name` *Defined in `packages/api/src/src/reference.ts:11`* ```typescript string ``` Symbol name. #### `kind` *Defined in `packages/api/src/src/reference.ts:13`* ```typescript "function" | "class" | "interface" | "type" | "enum" | "variable" | "method" | "property" | "file" ``` Symbol kind. #### `summary` *Defined in `packages/api/src/src/reference.ts:18`* ```typescript string | undefined ``` TSDoc summary. #### `signature` *Defined in `packages/api/src/src/reference.ts:23`* ```typescript string | undefined ``` Human-readable type signature. #### `visibility` *Defined in `packages/api/src/src/reference.ts:25`* ```typescript Visibility ``` Resolved visibility level. #### `deprecated` *Defined in `packages/api/src/src/reference.ts:30`* ```typescript string | undefined ``` Deprecation notice, if present. #### `params` *Defined in `packages/api/src/src/reference.ts:35`* ```typescript { name: string; description: string; type?: string; }[] | undefined ``` Documented parameters. #### `returns` *Defined in `packages/api/src/src/reference.ts:40`* ```typescript { description: string; type?: string; } | undefined ``` Documented return value. #### `throws` *Defined in `packages/api/src/src/reference.ts:45`* ```typescript { type?: string; description: string; }[] | undefined ``` Documented thrown exceptions. #### `examples` *Defined in `packages/api/src/src/reference.ts:50`* ```typescript { code: string; language: string; }[] | undefined ``` Code examples from TSDoc `@example` tags. #### `children` *Defined in `packages/api/src/src/reference.ts:55`* ```typescript ReferenceEntry[] | undefined ``` Nested child symbols (class methods, interface properties, enum members). #### `location` *Defined in `packages/api/src/src/reference.ts:57`* ```typescript { filePath: string; line: number; } ``` Source file location. ### `ForgeLoggerOptions` *Defined in `packages/cli/src/forge-logger.ts:45`* ```typescript ForgeLoggerOptions ``` Options for configuring the forge-ts logger at CLI startup. #### `quiet` *Defined in `packages/cli/src/forge-logger.ts:47`* ```typescript boolean | undefined ``` Suppress all consola output (--quiet flag). #### `json` *Defined in `packages/cli/src/forge-logger.ts:49`* ```typescript boolean | undefined ``` JSON output mode (--json flag). LAFS handles JSON; suppress consola. #### `verbose` *Defined in `packages/cli/src/forge-logger.ts:51`* ```typescript boolean | undefined ``` Enable debug-level output (--verbose flag). ### `CommandOutput` *Defined in `packages/cli/src/output.ts:19`* ```typescript CommandOutput ``` Typed result from a forge-ts command. #### `operation` *Defined in `packages/cli/src/output.ts:21`* ```typescript string ``` Name of the command that produced this output (e.g., "check", "build"). #### `success` *Defined in `packages/cli/src/output.ts:23`* ```typescript boolean ``` Whether the command completed successfully. #### `data` *Defined in `packages/cli/src/output.ts:25`* ```typescript T ``` Strongly-typed command-specific result payload. #### `errors` *Defined in `packages/cli/src/output.ts:27`* ```typescript ForgeCliError[] | undefined ``` Structured errors produced by the command, if any. #### `warnings` *Defined in `packages/cli/src/output.ts:29`* ```typescript ForgeCliWarning[] | undefined ``` Structured warnings produced by the command, if any. #### `duration` *Defined in `packages/cli/src/output.ts:31`* ```typescript number | undefined ``` Wall-clock duration of the command in milliseconds. ### `ForgeCliError` *Defined in `packages/cli/src/output.ts:35`* ```typescript ForgeCliError ``` Structured error for CLI commands. #### `code` *Defined in `packages/cli/src/output.ts:37`* ```typescript string ``` Machine-readable error code (e.g., "E004"). #### `message` *Defined in `packages/cli/src/output.ts:39`* ```typescript string ``` Human-readable error description. #### `filePath` *Defined in `packages/cli/src/output.ts:41`* ```typescript string | undefined ``` Absolute path to the source file containing the error, if applicable. #### `line` *Defined in `packages/cli/src/output.ts:43`* ```typescript number | undefined ``` 1-based line number of the error, if applicable. #### `column` *Defined in `packages/cli/src/output.ts:45`* ```typescript number | undefined ``` 0-based column number of the error, if applicable. ### `ForgeCliWarning` *Defined in `packages/cli/src/output.ts:49`* ```typescript ForgeCliWarning ``` Structured warning for CLI commands. #### `code` *Defined in `packages/cli/src/output.ts:51`* ```typescript string ``` Machine-readable warning code. #### `message` *Defined in `packages/cli/src/output.ts:53`* ```typescript string ``` Human-readable warning description. #### `filePath` *Defined in `packages/cli/src/output.ts:55`* ```typescript string | undefined ``` Absolute path to the source file containing the warning, if applicable. #### `line` *Defined in `packages/cli/src/output.ts:57`* ```typescript number | undefined ``` 1-based line number of the warning, if applicable. #### `column` *Defined in `packages/cli/src/output.ts:59`* ```typescript number | undefined ``` 0-based column number of the warning, if applicable. ### `OutputFlags` *Defined in `packages/cli/src/output.ts:63`* ```typescript OutputFlags ``` Output format flags passed through from citty args. #### `json` *Defined in `packages/cli/src/output.ts:65`* ```typescript boolean | undefined ``` Emit output as a LAFS JSON envelope instead of human-readable text. #### `human` *Defined in `packages/cli/src/output.ts:67`* ```typescript boolean | undefined ``` Emit output as formatted human-readable text. #### `quiet` *Defined in `packages/cli/src/output.ts:69`* ```typescript boolean | undefined ``` Suppress all output regardless of format. #### `mvi` *Defined in `packages/cli/src/output.ts:71`* ```typescript string | undefined ``` MVI verbosity level: "minimal", "standard", or "full". ### `AuditArgs` *Defined in `packages/cli/src/commands/audit.ts:30`* ```typescript AuditArgs ``` Arguments for the `audit` command. #### `cwd` *Defined in `packages/cli/src/commands/audit.ts:32`* ```typescript string | undefined ``` Project root directory (default: cwd). #### `limit` *Defined in `packages/cli/src/commands/audit.ts:34`* ```typescript number | undefined ``` Maximum number of events to display (default: 20). #### `type` *Defined in `packages/cli/src/commands/audit.ts:36`* ```typescript AuditEventType | undefined ``` Filter events by type. ### `AuditResult` *Defined in `packages/cli/src/commands/audit.ts:44`* ```typescript AuditResult ``` Typed result for the `audit` command. #### `success` *Defined in `packages/cli/src/commands/audit.ts:46`* ```typescript boolean ``` Whether the audit log was read successfully. #### `count` *Defined in `packages/cli/src/commands/audit.ts:48`* ```typescript number ``` Number of events returned. #### `events` *Defined in `packages/cli/src/commands/audit.ts:50`* ```typescript AuditEvent[] ``` The audit events, newest first. ### `BarometerSource` *Defined in `packages/cli/src/commands/barometer.ts:51`* ```typescript BarometerSource ``` Source provenance for a barometer question. #### `symbol` *Defined in `packages/cli/src/commands/barometer.ts:53`* ```typescript string ``` Symbol name the fact was extracted from. #### `file` *Defined in `packages/cli/src/commands/barometer.ts:55`* ```typescript string ``` Relative file path where the symbol is declared. #### `field` *Defined in `packages/cli/src/commands/barometer.ts:57`* ```typescript string ``` Which field on the symbol yielded the fact (e.g. "signature", "remarks"). ### `BarometerQuestion` *Defined in `packages/cli/src/commands/barometer.ts:65`* ```typescript BarometerQuestion ``` A single barometer question with its ground-truth answer. #### `id` *Defined in `packages/cli/src/commands/barometer.ts:67`* ```typescript string ``` Unique question identifier (e.g. "Q001"). #### `category` *Defined in `packages/cli/src/commands/barometer.ts:69`* ```typescript "signature" | "remarks" | "config" | "architecture" | "rules" ``` Fact extraction category. #### `difficulty` *Defined in `packages/cli/src/commands/barometer.ts:71`* ```typescript "easy" | "medium" | "hard" ``` Difficulty rating. #### `question` *Defined in `packages/cli/src/commands/barometer.ts:73`* ```typescript string ``` The question text. #### `answer` *Defined in `packages/cli/src/commands/barometer.ts:75`* ```typescript string ``` Ground-truth answer derived from source code. #### `source` *Defined in `packages/cli/src/commands/barometer.ts:77`* ```typescript BarometerSource ``` Provenance information linking back to the source. ### `BarometerRatingBand` *Defined in `packages/cli/src/commands/barometer.ts:85`* ```typescript BarometerRatingBand ``` A single rating band in the barometer scoring rubric. #### `min` *Defined in `packages/cli/src/commands/barometer.ts:87`* ```typescript number ``` Minimum score (inclusive) for this band. #### `max` *Defined in `packages/cli/src/commands/barometer.ts:89`* ```typescript number ``` Maximum score (inclusive) for this band. #### `rating` *Defined in `packages/cli/src/commands/barometer.ts:91`* ```typescript string ``` Short label for this band. #### `description` *Defined in `packages/cli/src/commands/barometer.ts:93`* ```typescript string ``` Description of what this band means. ### `BarometerInstructions` *Defined in `packages/cli/src/commands/barometer.ts:102`* ```typescript BarometerInstructions ``` Agent instructions included in `--questions-only` output. #### `task` *Defined in `packages/cli/src/commands/barometer.ts:104`* ```typescript string ``` Task description for the agent. #### `docsPath` *Defined in `packages/cli/src/commands/barometer.ts:106`* ```typescript string ``` Path to generated documentation the agent should use. #### `responseFormat` *Defined in `packages/cli/src/commands/barometer.ts:108`* ```typescript { description: string; example: { answers: Array<{ id: string; answer: string; }>; }; } ``` Expected response format. ### `BarometerResult` *Defined in `packages/cli/src/commands/barometer.ts:121`* ```typescript BarometerResult ``` Full barometer output written to `.forge/barometer.json`. #### `$schema` *Defined in `packages/cli/src/commands/barometer.ts:123`* ```typescript string ``` JSON schema URL. #### `version` *Defined in `packages/cli/src/commands/barometer.ts:125`* ```typescript string ``` Barometer format version. #### `project` *Defined in `packages/cli/src/commands/barometer.ts:127`* ```typescript string ``` Project name from package.json or config. #### `generated` *Defined in `packages/cli/src/commands/barometer.ts:129`* ```typescript string ``` ISO 8601 timestamp of when the barometer was generated. #### `symbolCount` *Defined in `packages/cli/src/commands/barometer.ts:131`* ```typescript number ``` Total number of exported symbols analyzed. #### `questions` *Defined in `packages/cli/src/commands/barometer.ts:133`* ```typescript BarometerQuestion[] ``` Generated questions with ground-truth answers. #### `rubric` *Defined in `packages/cli/src/commands/barometer.ts:135`* ```typescript { scale: BarometerRatingBand[]; scoring: string; } ``` Scoring rubric for evaluating documentation effectiveness. #### `instructions` *Defined in `packages/cli/src/commands/barometer.ts:142`* ```typescript BarometerInstructions | undefined ``` Agent instructions — present only in `--questions-only` output. ### `BarometerScoredAnswer` *Defined in `packages/cli/src/commands/barometer.ts:151`* ```typescript BarometerScoredAnswer ``` A single scored answer in the barometer score output. #### `id` *Defined in `packages/cli/src/commands/barometer.ts:153`* ```typescript string ``` Question ID. #### `expected` *Defined in `packages/cli/src/commands/barometer.ts:155`* ```typescript string ``` Expected answer from the answer key. #### `got` *Defined in `packages/cli/src/commands/barometer.ts:157`* ```typescript string ``` Agent's submitted answer. #### `verdict` *Defined in `packages/cli/src/commands/barometer.ts:159`* ```typescript "correct" | "partial" | "wrong" ``` Scoring verdict. #### `category` *Defined in `packages/cli/src/commands/barometer.ts:161`* ```typescript string ``` Question category for aggregate analysis. ### `BarometerScoreResult` *Defined in `packages/cli/src/commands/barometer.ts:170`* ```typescript BarometerScoreResult ``` Full barometer score output. #### `score` *Defined in `packages/cli/src/commands/barometer.ts:172`* ```typescript number ``` Score as a percentage (0-100). #### `rating` *Defined in `packages/cli/src/commands/barometer.ts:174`* ```typescript string ``` Rating band label (e.g. "Elite SSoT"). #### `ratingDescription` *Defined in `packages/cli/src/commands/barometer.ts:176`* ```typescript string ``` Rating band description. #### `correct` *Defined in `packages/cli/src/commands/barometer.ts:178`* ```typescript number ``` Number of fully correct answers. #### `partial` *Defined in `packages/cli/src/commands/barometer.ts:180`* ```typescript number ``` Number of partially correct answers. #### `wrong` *Defined in `packages/cli/src/commands/barometer.ts:182`* ```typescript number ``` Number of wrong answers. #### `total` *Defined in `packages/cli/src/commands/barometer.ts:184`* ```typescript number ``` Total questions scored. #### `missed` *Defined in `packages/cli/src/commands/barometer.ts:186`* ```typescript BarometerScoredAnswer[] ``` Details for every non-correct answer. ### `BarometerArgs` *Defined in `packages/cli/src/commands/barometer.ts:194`* ```typescript BarometerArgs ``` Arguments for the `barometer` command. #### `cwd` *Defined in `packages/cli/src/commands/barometer.ts:196`* ```typescript string | undefined ``` Project root directory (default: cwd). #### `questionsOnly` *Defined in `packages/cli/src/commands/barometer.ts:198`* ```typescript boolean | undefined ``` Output only questions (no answers) for test agents. #### `mvi` *Defined in `packages/cli/src/commands/barometer.ts:200`* ```typescript string | undefined ``` MVI verbosity level for structured output. ### `DiscoveredGuide` *Defined in `packages/gen/src/guide-discovery.ts:32`* ```typescript DiscoveredGuide ``` A guide discovered from the symbol graph by code analysis heuristics. #### `slug` *Defined in `packages/gen/src/guide-discovery.ts:34`* ```typescript string ``` URL-safe slug (e.g. "configuration", "error-handling"). #### `title` *Defined in `packages/gen/src/guide-discovery.ts:36`* ```typescript string ``` Human-readable title (e.g. "Configuration Guide"). #### `description` *Defined in `packages/gen/src/guide-discovery.ts:38`* ```typescript string ``` Short description of the guide's content. #### `source` *Defined in `packages/gen/src/guide-discovery.ts:40`* ```typescript GuideSource ``` Which heuristic discovered this guide. #### `symbols` *Defined in `packages/gen/src/guide-discovery.ts:42`* ```typescript ForgeSymbol[] ``` The symbols that contribute content to this guide. ### `MdText` *Defined in `packages/gen/src/mdast-builders.ts:20`* ```typescript MdText ``` Inline leaf node: literal text. #### `type` *Defined in `packages/gen/src/mdast-builders.ts:22`* ```typescript "text" ``` Node discriminant — always `"text"`. #### `value` *Defined in `packages/gen/src/mdast-builders.ts:24`* ```typescript string ``` The raw text content. ### `MdInlineCode` *Defined in `packages/gen/src/mdast-builders.ts:28`* ```typescript MdInlineCode ``` Inline leaf node: code span. #### `type` *Defined in `packages/gen/src/mdast-builders.ts:30`* ```typescript "inlineCode" ``` Node discriminant — always `"inlineCode"`. #### `value` *Defined in `packages/gen/src/mdast-builders.ts:32`* ```typescript string ``` The code span content (without surrounding backticks). ### `MdStrong` *Defined in `packages/gen/src/mdast-builders.ts:36`* ```typescript MdStrong ``` Inline container: strong emphasis (bold). #### `type` *Defined in `packages/gen/src/mdast-builders.ts:38`* ```typescript "strong" ``` Node discriminant — always `"strong"`. #### `children` *Defined in `packages/gen/src/mdast-builders.ts:40`* ```typescript MdPhrasing[] ``` Inline content rendered in bold. ### `MdEmphasis` *Defined in `packages/gen/src/mdast-builders.ts:44`* ```typescript MdEmphasis ``` Inline container: emphasis (italic). #### `type` *Defined in `packages/gen/src/mdast-builders.ts:46`* ```typescript "emphasis" ``` Node discriminant — always `"emphasis"`. #### `children` *Defined in `packages/gen/src/mdast-builders.ts:48`* ```typescript MdPhrasing[] ``` Inline content rendered in italic. ### `MdLink` *Defined in `packages/gen/src/mdast-builders.ts:52`* ```typescript MdLink ``` Inline container: hyperlink. #### `type` *Defined in `packages/gen/src/mdast-builders.ts:54`* ```typescript "link" ``` Node discriminant — always `"link"`. #### `url` *Defined in `packages/gen/src/mdast-builders.ts:56`* ```typescript string ``` The link destination URL. #### `children` *Defined in `packages/gen/src/mdast-builders.ts:58`* ```typescript MdPhrasing[] ``` Inline content rendered as the link text. ### `MdHeading` *Defined in `packages/gen/src/mdast-builders.ts:65`* ```typescript MdHeading ``` Block node: heading (depth 1-6). #### `type` *Defined in `packages/gen/src/mdast-builders.ts:67`* ```typescript "heading" ``` Node discriminant — always `"heading"`. #### `depth` *Defined in `packages/gen/src/mdast-builders.ts:69`* ```typescript 1 | 2 | 3 | 4 | 5 | 6 ``` Heading level: 1 for `#`, 2 for `##`, up to 6 for `######`. #### `children` *Defined in `packages/gen/src/mdast-builders.ts:71`* ```typescript MdPhrasing[] ``` Inline content of the heading. ### `MdParagraph` *Defined in `packages/gen/src/mdast-builders.ts:75`* ```typescript MdParagraph ``` Block node: paragraph. #### `type` *Defined in `packages/gen/src/mdast-builders.ts:77`* ```typescript "paragraph" ``` Node discriminant — always `"paragraph"`. #### `children` *Defined in `packages/gen/src/mdast-builders.ts:79`* ```typescript MdPhrasing[] ``` Inline content of the paragraph. ### `MdCode` *Defined in `packages/gen/src/mdast-builders.ts:83`* ```typescript MdCode ``` Block node: fenced code block. #### `type` *Defined in `packages/gen/src/mdast-builders.ts:85`* ```typescript "code" ``` Node discriminant — always `"code"`. #### `lang` *Defined in `packages/gen/src/mdast-builders.ts:90`* ```typescript string | null | undefined ``` Language tag for syntax highlighting. #### `value` *Defined in `packages/gen/src/mdast-builders.ts:92`* ```typescript string ``` The code content (without the fence delimiters). ### `MdBlockquote` *Defined in `packages/gen/src/mdast-builders.ts:96`* ```typescript MdBlockquote ``` Block node: blockquote. #### `type` *Defined in `packages/gen/src/mdast-builders.ts:98`* ```typescript "blockquote" ``` Node discriminant — always `"blockquote"`. #### `children` *Defined in `packages/gen/src/mdast-builders.ts:100`* ```typescript MdBlock[] ``` Block-level content inside the quote. ### `MdHtml` *Defined in `packages/gen/src/mdast-builders.ts:104`* ```typescript MdHtml ``` Block node: raw HTML (including comments). #### `type` *Defined in `packages/gen/src/mdast-builders.ts:106`* ```typescript "html" ``` Node discriminant — always `"html"`. #### `value` *Defined in `packages/gen/src/mdast-builders.ts:108`* ```typescript string ``` The raw HTML string. ### `MdThematicBreak` *Defined in `packages/gen/src/mdast-builders.ts:112`* ```typescript MdThematicBreak ``` Block node: horizontal rule. #### `type` *Defined in `packages/gen/src/mdast-builders.ts:114`* ```typescript "thematicBreak" ``` Node discriminant — always `"thematicBreak"`. ### `MdListItem` *Defined in `packages/gen/src/mdast-builders.ts:118`* ```typescript MdListItem ``` List item container. #### `type` *Defined in `packages/gen/src/mdast-builders.ts:120`* ```typescript "listItem" ``` Node discriminant — always `"listItem"`. #### `spread` *Defined in `packages/gen/src/mdast-builders.ts:125`* ```typescript boolean | undefined ``` Whether blank lines separate this item's children. #### `children` *Defined in `packages/gen/src/mdast-builders.ts:127`* ```typescript MdBlock[] ``` Block-level content of the list item. ### `MdList` *Defined in `packages/gen/src/mdast-builders.ts:131`* ```typescript MdList ``` Block node: ordered or unordered list. #### `type` *Defined in `packages/gen/src/mdast-builders.ts:133`* ```typescript "list" ``` Node discriminant — always `"list"`. #### `ordered` *Defined in `packages/gen/src/mdast-builders.ts:138`* ```typescript boolean | undefined ``` `true` for numbered lists, `false` for bullet lists. #### `spread` *Defined in `packages/gen/src/mdast-builders.ts:143`* ```typescript boolean | undefined ``` Whether blank lines separate list items. #### `children` *Defined in `packages/gen/src/mdast-builders.ts:145`* ```typescript MdListItem[] ``` The list items. ### `MdTableCell` *Defined in `packages/gen/src/mdast-builders.ts:149`* ```typescript MdTableCell ``` GFM table cell. #### `type` *Defined in `packages/gen/src/mdast-builders.ts:151`* ```typescript "tableCell" ``` Node discriminant — always `"tableCell"`. #### `children` *Defined in `packages/gen/src/mdast-builders.ts:153`* ```typescript MdPhrasing[] ``` Inline content of the cell. ### `MdTableRow` *Defined in `packages/gen/src/mdast-builders.ts:157`* ```typescript MdTableRow ``` GFM table row. #### `type` *Defined in `packages/gen/src/mdast-builders.ts:159`* ```typescript "tableRow" ``` Node discriminant — always `"tableRow"`. #### `children` *Defined in `packages/gen/src/mdast-builders.ts:161`* ```typescript MdTableCell[] ``` Cells in this row. ### `MdTable` *Defined in `packages/gen/src/mdast-builders.ts:165`* ```typescript MdTable ``` GFM table. #### `type` *Defined in `packages/gen/src/mdast-builders.ts:167`* ```typescript "table" ``` Node discriminant — always `"table"`. #### `align` *Defined in `packages/gen/src/mdast-builders.ts:172`* ```typescript ("left" | "center" | "right" | null)[] | undefined ``` Column alignment directives for each column. #### `children` *Defined in `packages/gen/src/mdast-builders.ts:174`* ```typescript MdTableRow[] ``` Rows of the table (first row is the header). ### `MdRoot` *Defined in `packages/gen/src/mdast-builders.ts:189`* ```typescript MdRoot ``` Document root. #### `type` *Defined in `packages/gen/src/mdast-builders.ts:191`* ```typescript "root" ``` Node discriminant — always `"root"`. #### `children` *Defined in `packages/gen/src/mdast-builders.ts:193`* ```typescript MdBlock[] ``` Top-level block content of the document. ### `FrontmatterResult` *Defined in `packages/gen/src/markdown-utils.ts:30`* ```typescript FrontmatterResult ``` Result of parsing frontmatter from markdown/MDX content. #### `body` *Defined in `packages/gen/src/markdown-utils.ts:32`* ```typescript string ``` The body content without the frontmatter block. #### `data` *Defined in `packages/gen/src/markdown-utils.ts:34`* ```typescript Record ``` The parsed frontmatter data as a key-value map. ### `DocPage` *Defined in `packages/gen/src/site-generator.ts:23`* ```typescript DocPage ``` A single generated documentation page. #### `path` *Defined in `packages/gen/src/site-generator.ts:25`* ```typescript string ``` Relative path from outDir (e.g., "packages/core/index.md") #### `content` *Defined in `packages/gen/src/site-generator.ts:27`* ```typescript string ``` Page content (Markdown or MDX) #### `frontmatter` *Defined in `packages/gen/src/site-generator.ts:29`* ```typescript Record ``` Frontmatter fields #### `stub` *Defined in `packages/gen/src/site-generator.ts:37`* ```typescript boolean | undefined ``` When true, this page is scaffolding intended for human/agent editing. Stub pages are created only on the first build and never overwritten, preserving manual edits across subsequent `forge-ts build` runs. Auto-generated pages (stub=false) are always regenerated from source. ### `SiteGeneratorOptions` *Defined in `packages/gen/src/site-generator.ts:44`* ```typescript SiteGeneratorOptions ``` Options controlling the doc site generator. #### `format` *Defined in `packages/gen/src/site-generator.ts:46`* ```typescript "markdown" | "mdx" ``` Output format #### `ssgTarget` *Defined in `packages/gen/src/site-generator.ts:51`* ```typescript "docusaurus" | "mintlify" | "nextra" | "vitepress" | "fumadocs" | undefined ``` SSG target for frontmatter. #### `projectName` *Defined in `packages/gen/src/site-generator.ts:53`* ```typescript string ``` Project name #### `projectDescription` *Defined in `packages/gen/src/site-generator.ts:58`* ```typescript string | undefined ``` Project description. #### `repositoryUrl` *Defined in `packages/gen/src/site-generator.ts:63`* ```typescript string | undefined ``` Repository URL (auto-detected from package.json). #### `packageName` *Defined in `packages/gen/src/site-generator.ts:68`* ```typescript string | undefined ``` npm package name for install commands. ### `GeneratedFile` *Defined in `packages/gen/src/adapters/types.ts:14`* ```typescript GeneratedFile ``` A file to write to disk during scaffolding or generation. #### `path` *Defined in `packages/gen/src/adapters/types.ts:16`* ```typescript string ``` Relative path from the docs output directory. #### `content` *Defined in `packages/gen/src/adapters/types.ts:18`* ```typescript string ``` File content (string for text). #### `stub` *Defined in `packages/gen/src/adapters/types.ts:26`* ```typescript boolean | undefined ``` When true, this file is scaffolding intended for human/agent editing. Stub files are created only on the first build and never overwritten, preserving manual edits across subsequent `forge-ts build` runs. Callers should check this flag and skip writing if the file exists. ### `SSGStyleGuide` *Defined in `packages/gen/src/adapters/types.ts:33`* ```typescript SSGStyleGuide ``` Style guide configuration for the SSG target. #### `pageExtension` *Defined in `packages/gen/src/adapters/types.ts:35`* ```typescript "mdx" | "md" ``` File extension for doc pages. #### `supportsMdx` *Defined in `packages/gen/src/adapters/types.ts:37`* ```typescript boolean ``` Whether the target supports MDX components. #### `requiresFrontmatter` *Defined in `packages/gen/src/adapters/types.ts:39`* ```typescript boolean ``` Whether frontmatter is required on every page. #### `maxHeadingDepth` *Defined in `packages/gen/src/adapters/types.ts:41`* ```typescript number ``` Maximum recommended heading depth. #### `defaultImports` *Defined in `packages/gen/src/adapters/types.ts:43`* ```typescript string[] ``` Component imports to add at top of MDX files (if supportsMdx). #### `codeBlockLanguage` *Defined in `packages/gen/src/adapters/types.ts:45`* ```typescript "typescript" | "ts" | "tsx" ``` Code block language for TypeScript examples. ### `ScaffoldManifest` *Defined in `packages/gen/src/adapters/types.ts:52`* ```typescript ScaffoldManifest ``` Scaffold manifest describing what `init docs` creates. #### `target` *Defined in `packages/gen/src/adapters/types.ts:54`* ```typescript SSGTarget ``` The SSG target this manifest is for. #### `files` *Defined in `packages/gen/src/adapters/types.ts:56`* ```typescript GeneratedFile[] ``` Files that will be created. #### `dependencies` *Defined in `packages/gen/src/adapters/types.ts:58`* ```typescript Record ``` npm dependencies to install. #### `devDependencies` *Defined in `packages/gen/src/adapters/types.ts:60`* ```typescript Record ``` npm devDependencies to install. #### `scripts` *Defined in `packages/gen/src/adapters/types.ts:62`* ```typescript Record ``` Scripts to add to package.json. #### `instructions` *Defined in `packages/gen/src/adapters/types.ts:64`* ```typescript string[] ``` Post-scaffold instructions for the user. ### `AdapterContext` *Defined in `packages/gen/src/adapters/types.ts:71`* ```typescript AdapterContext ``` Context passed to adapter methods. #### `config` *Defined in `packages/gen/src/adapters/types.ts:73`* ```typescript ForgeConfig ``` Resolved forge-ts configuration. #### `projectName` *Defined in `packages/gen/src/adapters/types.ts:75`* ```typescript string ``` Project name (from package.json or directory). #### `projectDescription` *Defined in `packages/gen/src/adapters/types.ts:80`* ```typescript string | undefined ``` Project description. #### `pages` *Defined in `packages/gen/src/adapters/types.ts:82`* ```typescript DocPage[] ``` The generated doc pages (from site-generator). #### `symbols` *Defined in `packages/gen/src/adapters/types.ts:84`* ```typescript ForgeSymbol[] ``` All symbols extracted from the project. #### `outDir` *Defined in `packages/gen/src/adapters/types.ts:86`* ```typescript string ``` Output directory for generated docs. ### `DevServerCommand` *Defined in `packages/gen/src/adapters/types.ts:93`* ```typescript DevServerCommand ``` Command to start a local dev server for doc preview. #### `bin` *Defined in `packages/gen/src/adapters/types.ts:95`* ```typescript string ``` The binary to execute (e.g., "npx", "node"). #### `args` *Defined in `packages/gen/src/adapters/types.ts:97`* ```typescript string[] ``` Arguments to pass to the binary. #### `cwd` *Defined in `packages/gen/src/adapters/types.ts:99`* ```typescript string ``` Working directory to run from. #### `label` *Defined in `packages/gen/src/adapters/types.ts:101`* ```typescript string ``` Human-readable label for the command. #### `url` *Defined in `packages/gen/src/adapters/types.ts:103`* ```typescript string ``` The URL the dev server will be available at. ### `SSGAdapter` *Defined in `packages/gen/src/adapters/types.ts:119`* ```typescript SSGAdapter ``` The central SSG adapter interface. Every doc platform provider implements this contract. One file per provider. No shared mutable state. **Examples** ```typescript import { getAdapter } from "@forge-ts/gen"; const adapter = getAdapter("mintlify"); const files = adapter.transformPages(pages, context); ``` #### `target` *Defined in `packages/gen/src/adapters/types.ts:121`* ```typescript SSGTarget ``` Unique target identifier. #### `displayName` *Defined in `packages/gen/src/adapters/types.ts:124`* ```typescript string ``` Human-readable display name. #### `styleGuide` *Defined in `packages/gen/src/adapters/types.ts:127`* ```typescript SSGStyleGuide ``` Style guide for this platform. #### `scaffold()` *Defined in `packages/gen/src/adapters/types.ts:144`* ```typescript (context: AdapterContext) => ScaffoldManifest ``` Generate the complete scaffold for a new doc site. Called by `forge-ts init docs --target `. Returns all files, dependencies, and scripts needed. **Parameters** - `context` — The adapter context for the current project. **Returns**: A `ScaffoldManifest` with files, deps, and instructions. **Examples** ```typescript import { getAdapter } from "@forge-ts/gen"; const adapter = getAdapter("mintlify"); const manifest = adapter.scaffold(context); console.log(manifest.files.length); ``` #### `transformPages()` *Defined in `packages/gen/src/adapters/types.ts:162`* ```typescript (pages: DocPage[], context: AdapterContext) => GeneratedFile[] ``` Transform generic DocPages into platform-specific pages. Adds correct frontmatter, component imports, file extensions. Called during `forge-ts build`. **Parameters** - `pages` — The generic doc pages to transform. - `context` — The adapter context for the current project. **Returns**: An array of `GeneratedFile` objects ready to write. **Examples** ```typescript import { getAdapter } from "@forge-ts/gen"; const adapter = getAdapter("docusaurus"); const files = adapter.transformPages(pages, context); console.log(files[0].path.endsWith(".mdx")); // true ``` #### `generateConfig()` *Defined in `packages/gen/src/adapters/types.ts:179`* ```typescript (context: AdapterContext) => GeneratedFile[] ``` Generate platform-specific configuration files. e.g., mint.json, sidebars.js, \_meta.json, .vitepress/config.ts Called during `forge-ts build`. **Parameters** - `context` — The adapter context for the current project. **Returns**: An array of `GeneratedFile` objects ready to write. **Examples** ```typescript import { getAdapter } from "@forge-ts/gen"; const adapter = getAdapter("vitepress"); const configs = adapter.generateConfig(context); console.log(configs[0].path); // ".vitepress/sidebar.json" ``` #### `getDevCommand()` *Defined in `packages/gen/src/adapters/types.ts:195`* ```typescript (outDir: string) => DevServerCommand ``` Get the command to start the local dev server for this platform. Called by `forge-ts docs dev`. **Parameters** - `outDir` — The docs output directory. **Returns**: The shell command and args to spawn, plus a display label. **Examples** ```typescript import { getAdapter } from "@forge-ts/gen"; const adapter = getAdapter("mintlify"); const cmd = adapter.getDevCommand("./docs"); // { bin: "npx", args: ["@mintlify/cli", "dev"], cwd: "./docs" } ``` #### `detectExisting()` *Defined in `packages/gen/src/adapters/types.ts:211`* ```typescript (outDir: string) => Promise ``` Check if a scaffold already exists in the output directory. Used for safety checks before init or target change. **Parameters** - `outDir` — The output directory to inspect. **Returns**: `true` if a scaffold marker file already exists. **Examples** ```typescript import { getAdapter } from "@forge-ts/gen"; const adapter = getAdapter("mintlify"); const exists = await adapter.detectExisting("./docs"); if (exists) console.log("Scaffold already present"); ``` ### `MarkdownOptions` *Defined in `packages/gen/src/markdown.ts:17`* ```typescript MarkdownOptions ``` Options controlling Markdown output. #### `mdx` *Defined in `packages/gen/src/markdown.ts:22`* ```typescript boolean | undefined ``` Whether to use MDX syntax (default: Markdown). ### `ReadmeSyncOptions` *Defined in `packages/gen/src/readme-sync.ts:17`* ```typescript ReadmeSyncOptions ``` Options controlling README sync behaviour. #### `badge` *Defined in `packages/gen/src/readme-sync.ts:22`* ```typescript boolean | undefined ``` Include a "Documented with forge-ts" badge above the API table. #### `includeExamples` *Defined in `packages/gen/src/readme-sync.ts:27`* ```typescript boolean | undefined ``` Include first ### `SkillPackage` *Defined in `packages/gen/src/skill.ts:791`* ```typescript SkillPackage ``` A generated skill package following the agentskills.io directory structure. Contains SKILL.md plus optional references and scripts files. #### `directoryName` *Defined in `packages/gen/src/skill.ts:793`* ```typescript string ``` The skill directory name (lowercase, hyphens only, max 64 chars). #### `files` *Defined in `packages/gen/src/skill.ts:795`* ```typescript { path: string; content: string; }[] ``` Files to write inside the skill directory. ### `SSGConfigFile` *Defined in `packages/gen/src/ssg-config.ts:7`* ```typescript SSGConfigFile ``` A single generated SSG configuration file. #### `path` *Defined in `packages/gen/src/ssg-config.ts:9`* ```typescript string ``` Relative path from outDir (e.g., "mint.json", "\_meta.json") #### `content` *Defined in `packages/gen/src/ssg-config.ts:11`* ```typescript string ``` File content ### `GenerateOptions` *Defined in `packages/gen/src/index.ts:109`* ```typescript GenerateOptions ``` Options for the generation pipeline. #### `forceStubs` *Defined in `packages/gen/src/index.ts:122`* ```typescript boolean | undefined ``` When true, overwrite stub pages even if they already exist on disk. Normally stub pages (concepts, guides, faq, contributing, changelog) are only created on the first build to preserve manual edits. Use this to reset stubs to their scaffolding state. **Examples** ```typescript await generate(config, { forceStubs: true }); ``` ### `BuildArgs` *Defined in `packages/cli/src/commands/build.ts:18`* ```typescript BuildArgs ``` Arguments for the `build` command. #### `cwd` *Defined in `packages/cli/src/commands/build.ts:20`* ```typescript string | undefined ``` Project root directory (default: cwd). #### `skipApi` *Defined in `packages/cli/src/commands/build.ts:22`* ```typescript boolean | undefined ``` Skip API generation even if enabled in config. #### `skipGen` *Defined in `packages/cli/src/commands/build.ts:24`* ```typescript boolean | undefined ``` Skip doc generation even if enabled in config. #### `forceStubs` *Defined in `packages/cli/src/commands/build.ts:31`* ```typescript boolean | undefined ``` Overwrite stub pages even if they already exist on disk. Normally stub pages (concepts, guides, faq, contributing, changelog) are only created on the first build to preserve manual edits. Use this to reset stubs to their scaffolding state. #### `mvi` *Defined in `packages/cli/src/commands/build.ts:33`* ```typescript string | undefined ``` MVI verbosity level for structured output. ### `BuildStep` *Defined in `packages/cli/src/commands/build.ts:40`* ```typescript BuildStep ``` A single step in the build pipeline. #### `name` *Defined in `packages/cli/src/commands/build.ts:42`* ```typescript string ``` Internal step name, e.g. "api" or "gen". #### `status` *Defined in `packages/cli/src/commands/build.ts:44`* ```typescript "success" | "skipped" | "failed" ``` Outcome of this step. #### `outputPath` *Defined in `packages/cli/src/commands/build.ts:46`* ```typescript string | undefined ``` Path to the primary output file produced by this step, if applicable. #### `duration` *Defined in `packages/cli/src/commands/build.ts:48`* ```typescript number | undefined ``` Wall-clock duration of this step in milliseconds. #### `errors` *Defined in `packages/cli/src/commands/build.ts:50`* ```typescript ForgeCliError[] | undefined ``` Errors produced by this step when status is "failed". ### `BuildResult` *Defined in `packages/cli/src/commands/build.ts:57`* ```typescript BuildResult ``` Typed result for the `build` command. #### `success` *Defined in `packages/cli/src/commands/build.ts:59`* ```typescript boolean ``` Whether the build succeeded. #### `summary` *Defined in `packages/cli/src/commands/build.ts:61`* ```typescript { steps: number; succeeded: number; failed: number; duration: number; } ``` Aggregate pipeline counts — always present. #### `steps` *Defined in `packages/cli/src/commands/build.ts:72`* ```typescript BuildStep[] ``` Per-step details. #### `generatedFiles` *Defined in `packages/cli/src/commands/build.ts:74`* ```typescript string[] | undefined ``` Files written during the build — present at standard and full MVI levels. ### `BypassCreateResult` *Defined in `packages/cli/src/commands/bypass.ts:36`* ```typescript BypassCreateResult ``` Typed result for the `bypass` command when creating a bypass. #### `success` *Defined in `packages/cli/src/commands/bypass.ts:38`* ```typescript boolean ``` Whether the bypass was successfully created. #### `bypass` *Defined in `packages/cli/src/commands/bypass.ts:40`* ```typescript BypassRecord ``` The bypass record that was created. #### `remainingBudget` *Defined in `packages/cli/src/commands/bypass.ts:42`* ```typescript number ``` Number of remaining bypass slots for today after creation. #### `dailyBudget` *Defined in `packages/cli/src/commands/bypass.ts:44`* ```typescript number ``` The configured daily budget. ### `BypassStatusResult` *Defined in `packages/cli/src/commands/bypass.ts:51`* ```typescript BypassStatusResult ``` Typed result for the `bypass --status` command. #### `success` *Defined in `packages/cli/src/commands/bypass.ts:53`* ```typescript boolean ``` Always true for status queries. #### `activeBypasses` *Defined in `packages/cli/src/commands/bypass.ts:55`* ```typescript BypassRecord[] ``` Active (non-expired) bypass records. #### `remainingBudget` *Defined in `packages/cli/src/commands/bypass.ts:57`* ```typescript number ``` Number of remaining bypass slots for today. #### `dailyBudget` *Defined in `packages/cli/src/commands/bypass.ts:59`* ```typescript number ``` The configured daily budget. #### `expiredRemoved` *Defined in `packages/cli/src/commands/bypass.ts:61`* ```typescript number ``` Number of expired bypasses that were cleaned up. ### `DeprecatedUsage` *Defined in `packages/enforcer/src/deprecation-tracker.ts:4`* ```typescript DeprecatedUsage ``` A detected usage of a deprecated symbol. #### `deprecatedSymbol` *Defined in `packages/enforcer/src/deprecation-tracker.ts:6`* ```typescript string ``` The deprecated symbol being consumed. #### `sourcePackage` *Defined in `packages/enforcer/src/deprecation-tracker.ts:8`* ```typescript string ``` The package that exports the deprecated symbol. #### `consumingFile` *Defined in `packages/enforcer/src/deprecation-tracker.ts:10`* ```typescript string ``` The file importing the deprecated symbol. #### `line` *Defined in `packages/enforcer/src/deprecation-tracker.ts:12`* ```typescript number ``` Line number of the import. #### `deprecationMessage` *Defined in `packages/enforcer/src/deprecation-tracker.ts:14`* ```typescript string ``` The deprecation message. ### `FormatOptions` *Defined in `packages/enforcer/src/formatter.ts:11`* ```typescript FormatOptions ``` Options that control how `formatResults` renders its output. #### `colors` *Defined in `packages/enforcer/src/formatter.ts:13`* ```typescript boolean ``` Emit ANSI colour escape sequences when `true`. #### `verbose` *Defined in `packages/enforcer/src/formatter.ts:18`* ```typescript boolean ``` When `true`, include the symbol's type signature alongside each diagnostic so the reader has immediate context. ### `CheckArgs` *Defined in `packages/cli/src/commands/check.ts:11`* ```typescript CheckArgs ``` Arguments for the `check` command. #### `cwd` *Defined in `packages/cli/src/commands/check.ts:13`* ```typescript string | undefined ``` Project root directory (default: cwd). #### `strict` *Defined in `packages/cli/src/commands/check.ts:15`* ```typescript boolean | undefined ``` Exit with non-zero code on warnings as well as errors. #### `verbose` *Defined in `packages/cli/src/commands/check.ts:17`* ```typescript boolean | undefined ``` Include symbol signatures alongside diagnostics. #### `mvi` *Defined in `packages/cli/src/commands/check.ts:19`* ```typescript string | undefined ``` MVI verbosity level for structured output. #### `rule` *Defined in `packages/cli/src/commands/check.ts:21`* ```typescript string | undefined ``` Filter errors to a specific rule code (e.g., "E001"). #### `file` *Defined in `packages/cli/src/commands/check.ts:23`* ```typescript string | undefined ``` Filter errors to a specific file path (substring match). #### `staged` *Defined in `packages/cli/src/commands/check.ts:25`* ```typescript boolean | undefined ``` Only check symbols from git-staged .ts/.tsx files. #### `limit` *Defined in `packages/cli/src/commands/check.ts:27`* ```typescript number | undefined ``` Maximum number of file groups to return in byFile (default: 20). #### `offset` *Defined in `packages/cli/src/commands/check.ts:29`* ```typescript number | undefined ``` Offset into the byFile list for pagination (default: 0). ### `CheckFileError` *Defined in `packages/cli/src/commands/check.ts:36`* ```typescript CheckFileError ``` A single error entry within a file group. #### `code` *Defined in `packages/cli/src/commands/check.ts:38`* ```typescript string ``` Machine-readable error code. #### `symbol` *Defined in `packages/cli/src/commands/check.ts:40`* ```typescript string ``` Symbol name that needs fixing. #### `kind` *Defined in `packages/cli/src/commands/check.ts:42`* ```typescript string ``` Symbol kind (function, class, interface, etc.). #### `line` *Defined in `packages/cli/src/commands/check.ts:44`* ```typescript number ``` 1-based line number of the error. #### `message` *Defined in `packages/cli/src/commands/check.ts:46`* ```typescript string ``` Human-readable description. #### `suggestedFix` *Defined in `packages/cli/src/commands/check.ts:48`* ```typescript string | undefined ``` Exact TSDoc block to add (present at full MVI or with --rule/--file filters). #### `agentAction` *Defined in `packages/cli/src/commands/check.ts:50`* ```typescript string | undefined ``` Recommended agent action. ### `CheckFileWarning` *Defined in `packages/cli/src/commands/check.ts:57`* ```typescript CheckFileWarning ``` A single warning entry within a file group. #### `code` *Defined in `packages/cli/src/commands/check.ts:59`* ```typescript string ``` Machine-readable warning code. #### `symbol` *Defined in `packages/cli/src/commands/check.ts:61`* ```typescript string ``` Symbol name that generated the warning. #### `kind` *Defined in `packages/cli/src/commands/check.ts:63`* ```typescript string ``` Symbol kind (function, class, interface, etc.). #### `line` *Defined in `packages/cli/src/commands/check.ts:65`* ```typescript number ``` 1-based line number of the warning. #### `message` *Defined in `packages/cli/src/commands/check.ts:67`* ```typescript string ``` Human-readable description. ### `CheckFileGroup` *Defined in `packages/cli/src/commands/check.ts:74`* ```typescript CheckFileGroup ``` Errors and warnings grouped by file. #### `file` *Defined in `packages/cli/src/commands/check.ts:76`* ```typescript string ``` Absolute path to the source file. #### `errors` *Defined in `packages/cli/src/commands/check.ts:78`* ```typescript CheckFileError[] ``` Errors in this file. #### `warnings` *Defined in `packages/cli/src/commands/check.ts:80`* ```typescript CheckFileWarning[] ``` Warnings in this file. ### `CheckRuleCount` *Defined in `packages/cli/src/commands/check.ts:87`* ```typescript CheckRuleCount ``` Error breakdown by rule code, sorted by count descending. #### `code` *Defined in `packages/cli/src/commands/check.ts:89`* ```typescript string ``` Machine-readable rule code (e.g., "E001"). #### `rule` *Defined in `packages/cli/src/commands/check.ts:91`* ```typescript string ``` Human-readable rule name (e.g., "require-summary"). #### `count` *Defined in `packages/cli/src/commands/check.ts:93`* ```typescript number ``` Number of violations. #### `files` *Defined in `packages/cli/src/commands/check.ts:95`* ```typescript number ``` Number of unique files affected by this rule. ### `CheckTriage` *Defined in `packages/cli/src/commands/check.ts:103`* ```typescript CheckTriage ``` Triage data for prioritizing fixes. Always present when the check has errors, bounded in size (\~9 rules + top 20 files). #### `byRule` *Defined in `packages/cli/src/commands/check.ts:105`* ```typescript CheckRuleCount[] ``` Error counts by rule, sorted descending. #### `topFiles` *Defined in `packages/cli/src/commands/check.ts:107`* ```typescript { file: string; errors: number; warnings: number; }[] ``` Top files by error count (max 20). #### `fixOrder` *Defined in `packages/cli/src/commands/check.ts:109`* ```typescript { code: string; rule: string; count: number; files: number; }[] ``` Suggested fix order: rules sorted by fewest files affected first (quick wins). ### `CheckPage` *Defined in `packages/cli/src/commands/check.ts:116`* ```typescript CheckPage ``` Pagination metadata for byFile results. #### `offset` *Defined in `packages/cli/src/commands/check.ts:118`* ```typescript number ``` Current offset. #### `limit` *Defined in `packages/cli/src/commands/check.ts:120`* ```typescript number ``` Page size. #### `hasMore` *Defined in `packages/cli/src/commands/check.ts:122`* ```typescript boolean ``` Whether more results exist beyond this page. #### `total` *Defined in `packages/cli/src/commands/check.ts:124`* ```typescript number ``` Total number of file groups (after filters). ### `CheckResult` *Defined in `packages/cli/src/commands/check.ts:131`* ```typescript CheckResult ``` Typed result for the `check` command. #### `success` *Defined in `packages/cli/src/commands/check.ts:133`* ```typescript boolean ``` Whether the check passed without errors. #### `summary` *Defined in `packages/cli/src/commands/check.ts:135`* ```typescript { errors: number; warnings: number; files: number; symbols: number; duration: number; } ``` Aggregate counts — always present regardless of MVI level. #### `triage` *Defined in `packages/cli/src/commands/check.ts:148`* ```typescript CheckTriage | undefined ``` Triage data for prioritizing fixes — present when errors 0 (except minimal). #### `byFile` *Defined in `packages/cli/src/commands/check.ts:150`* ```typescript CheckFileGroup[] | undefined ``` Per-file breakdown — present at standard and full MVI levels, paginated. #### `page` *Defined in `packages/cli/src/commands/check.ts:152`* ```typescript CheckPage | undefined ``` Pagination metadata when byFile is paginated. #### `filters` *Defined in `packages/cli/src/commands/check.ts:154`* ```typescript { rule?: string; file?: string; } | undefined ``` Active filters applied to this result. #### `nextCommand` *Defined in `packages/cli/src/commands/check.ts:156`* ```typescript string | undefined ``` CLI command hint for the agent to run next. ### `PkgJson` *Defined in `packages/cli/src/pkg-json.ts:25`* ```typescript PkgJson ``` Parsed package.json with formatting metadata for lossless round-tripping. #### `path` *Defined in `packages/cli/src/pkg-json.ts:27`* ```typescript string ``` Absolute path to the file. #### `raw` *Defined in `packages/cli/src/pkg-json.ts:29`* ```typescript string ``` Raw file content as read from disk. #### `obj` *Defined in `packages/cli/src/pkg-json.ts:31`* ```typescript Record ``` Parsed JSON object. #### `indent` *Defined in `packages/cli/src/pkg-json.ts:33`* ```typescript string ``` Detected indent string (tabs or spaces). #### `trailingNewline` *Defined in `packages/cli/src/pkg-json.ts:35`* ```typescript boolean ``` Whether the original file ended with a newline. ### `InitHooksResult` *Defined in `packages/cli/src/commands/init-hooks.ts:46`* ```typescript InitHooksResult ``` Result of the `init hooks` command. **Examples** ```typescript import { runInitHooks } from "@forge-ts/cli/commands/init-hooks"; const output = await runInitHooks({ cwd: process.cwd() }); console.log(output.data.hookManager); // "husky" | "lefthook" | "none" ``` #### `success` *Defined in `packages/cli/src/commands/init-hooks.ts:48`* ```typescript boolean ``` Whether the hook scaffolding succeeded. #### `hookManager` *Defined in `packages/cli/src/commands/init-hooks.ts:50`* ```typescript HookManager ``` The detected or chosen hook manager. #### `summary` *Defined in `packages/cli/src/commands/init-hooks.ts:52`* ```typescript { filesWritten: number; filesSkipped: number; } ``` Summary of what was created. #### `files` *Defined in `packages/cli/src/commands/init-hooks.ts:59`* ```typescript string[] ``` Relative paths of all files written. #### `instructions` *Defined in `packages/cli/src/commands/init-hooks.ts:61`* ```typescript string[] ``` Post-scaffold instructions for the user. ### `InitHooksArgs` *Defined in `packages/cli/src/commands/init-hooks.ts:68`* ```typescript InitHooksArgs ``` Arguments for the `init hooks` command. #### `cwd` *Defined in `packages/cli/src/commands/init-hooks.ts:70`* ```typescript string | undefined ``` Project root directory (default: cwd). #### `force` *Defined in `packages/cli/src/commands/init-hooks.ts:72`* ```typescript boolean | undefined ``` Force overwrite existing hook files. #### `mvi` *Defined in `packages/cli/src/commands/init-hooks.ts:74`* ```typescript string | undefined ``` MVI verbosity level for structured output. ### `InitProjectEnvironment` *Defined in `packages/cli/src/commands/init-project.ts:37`* ```typescript InitProjectEnvironment ``` Detected project environment from Step 1 of the init flow. #### `packageJsonExists` *Defined in `packages/cli/src/commands/init-project.ts:39`* ```typescript boolean ``` Whether package.json exists. #### `tsconfigExists` *Defined in `packages/cli/src/commands/init-project.ts:41`* ```typescript boolean ``` Whether tsconfig.json exists. #### `biomeDetected` *Defined in `packages/cli/src/commands/init-project.ts:43`* ```typescript boolean ``` Whether biome.json or biome.jsonc exists. #### `typescriptVersion` *Defined in `packages/cli/src/commands/init-project.ts:45`* ```typescript string | null ``` TypeScript version from dependencies, or null if not found. #### `hookManager` *Defined in `packages/cli/src/commands/init-project.ts:47`* ```typescript "husky" | "lefthook" | "none" ``` Detected hook manager. #### `monorepo` *Defined in `packages/cli/src/commands/init-project.ts:49`* ```typescript boolean ``` Whether the project is a monorepo. #### `monorepoType` *Defined in `packages/cli/src/commands/init-project.ts:51`* ```typescript "pnpm" | "npm/yarn" | null ``` Monorepo type if detected. ### `InitProjectResult` *Defined in `packages/cli/src/commands/init-project.ts:65`* ```typescript InitProjectResult ``` Result of the `init` (project setup) command. **Examples** ```typescript import { runInitProject } from "@forge-ts/cli/commands/init-project"; const output = await runInitProject({ cwd: process.cwd() }); console.log(output.data.created); // list of created files ``` #### `success` *Defined in `packages/cli/src/commands/init-project.ts:67`* ```typescript boolean ``` Whether the init succeeded. #### `created` *Defined in `packages/cli/src/commands/init-project.ts:69`* ```typescript string[] ``` Files that were created. #### `skipped` *Defined in `packages/cli/src/commands/init-project.ts:71`* ```typescript string[] ``` Files that already existed and were skipped. #### `warnings` *Defined in `packages/cli/src/commands/init-project.ts:73`* ```typescript string[] ``` Warning messages collected during init. #### `environment` *Defined in `packages/cli/src/commands/init-project.ts:75`* ```typescript InitProjectEnvironment ``` Detected project environment. #### `nextSteps` *Defined in `packages/cli/src/commands/init-project.ts:77`* ```typescript string[] ``` Next steps for the user. #### `scriptsAdded` *Defined in `packages/cli/src/commands/init-project.ts:79`* ```typescript string[] ``` Scripts that were added to package.json (empty if none were added). ### `InitProjectArgs` *Defined in `packages/cli/src/commands/init-project.ts:86`* ```typescript InitProjectArgs ``` Arguments for the `init` (project setup) command. #### `cwd` *Defined in `packages/cli/src/commands/init-project.ts:88`* ```typescript string | undefined ``` Project root directory (default: cwd). #### `mvi` *Defined in `packages/cli/src/commands/init-project.ts:90`* ```typescript string | undefined ``` MVI verbosity level for structured output. ### `DoctorCheckResult` *Defined in `packages/cli/src/commands/doctor.ts:36`* ```typescript DoctorCheckResult ``` Result of a single doctor check. #### `name` *Defined in `packages/cli/src/commands/doctor.ts:38`* ```typescript string ``` Name of the check. #### `status` *Defined in `packages/cli/src/commands/doctor.ts:40`* ```typescript DoctorCheckStatus ``` Status of the check. #### `message` *Defined in `packages/cli/src/commands/doctor.ts:42`* ```typescript string ``` Human-readable message. #### `fixable` *Defined in `packages/cli/src/commands/doctor.ts:44`* ```typescript boolean ``` Whether this issue can be auto-fixed with --fix. ### `DoctorResult` *Defined in `packages/cli/src/commands/doctor.ts:58`* ```typescript DoctorResult ``` Result of the `doctor` command. **Examples** ```typescript import { runDoctor } from "@forge-ts/cli/commands/doctor"; const output = await runDoctor({ cwd: process.cwd() }); console.log(output.data.summary.passed); // number of passed checks ``` #### `success` *Defined in `packages/cli/src/commands/doctor.ts:60`* ```typescript boolean ``` Whether all checks passed without errors. #### `checks` *Defined in `packages/cli/src/commands/doctor.ts:62`* ```typescript DoctorCheckResult[] ``` Individual check results. #### `summary` *Defined in `packages/cli/src/commands/doctor.ts:64`* ```typescript { passed: number; warnings: number; errors: number; info: number; } ``` Summary counts. #### `fixed` *Defined in `packages/cli/src/commands/doctor.ts:71`* ```typescript string[] ``` Files that were fixed (only populated when --fix is used). ### `DoctorArgs` *Defined in `packages/cli/src/commands/doctor.ts:78`* ```typescript DoctorArgs ``` Arguments for the `doctor` command. #### `cwd` *Defined in `packages/cli/src/commands/doctor.ts:80`* ```typescript string | undefined ``` Project root directory (default: cwd). #### `fix` *Defined in `packages/cli/src/commands/doctor.ts:82`* ```typescript boolean | undefined ``` Auto-fix resolvable issues. #### `mvi` *Defined in `packages/cli/src/commands/doctor.ts:84`* ```typescript string | undefined ``` MVI verbosity level for structured output. ### `InitDocsResult` *Defined in `packages/cli/src/commands/init-docs.ts:38`* ```typescript InitDocsResult ``` Result of the `init docs` command. **Examples** ```typescript import { runInitDocs } from "@forge-ts/cli/commands/init-docs"; const output = await runInitDocs({ target: "mintlify" }); console.log(output.data.summary.filesCreated); // number of files written ``` #### `success` *Defined in `packages/cli/src/commands/init-docs.ts:40`* ```typescript boolean ``` Whether the scaffold succeeded. #### `target` *Defined in `packages/cli/src/commands/init-docs.ts:42`* ```typescript SSGTarget ``` The SSG target that was scaffolded. #### `summary` *Defined in `packages/cli/src/commands/init-docs.ts:44`* ```typescript { filesCreated: number; dependencies: number; scripts: number; } ``` Summary of what was created. #### `files` *Defined in `packages/cli/src/commands/init-docs.ts:53`* ```typescript string[] ``` Relative paths of all files created. #### `instructions` *Defined in `packages/cli/src/commands/init-docs.ts:55`* ```typescript string[] ``` Post-scaffold instructions for the user. ### `InitDocsArgs` *Defined in `packages/cli/src/commands/init-docs.ts:62`* ```typescript InitDocsArgs ``` Arguments for the `init docs` command. #### `target` *Defined in `packages/cli/src/commands/init-docs.ts:64`* ```typescript string | undefined ``` SSG target to scaffold. Defaults to `DEFAULT_TARGET`. #### `cwd` *Defined in `packages/cli/src/commands/init-docs.ts:66`* ```typescript string | undefined ``` Project root directory (default: cwd). #### `outDir` *Defined in `packages/cli/src/commands/init-docs.ts:68`* ```typescript string | undefined ``` Output directory for the doc site (default: outDir from config or ./docs). #### `force` *Defined in `packages/cli/src/commands/init-docs.ts:70`* ```typescript boolean | undefined ``` Overwrite an existing scaffold without prompting. #### `mvi` *Defined in `packages/cli/src/commands/init-docs.ts:72`* ```typescript string | undefined ``` MVI verbosity level for structured output. ### `LockResult` *Defined in `packages/cli/src/commands/lock.ts:31`* ```typescript LockResult ``` Typed result for the `lock` command. #### `success` *Defined in `packages/cli/src/commands/lock.ts:33`* ```typescript boolean ``` Whether the lock was successfully created. #### `lockFile` *Defined in `packages/cli/src/commands/lock.ts:35`* ```typescript string ``` Path to the lock file that was written. #### `lockedAt` *Defined in `packages/cli/src/commands/lock.ts:37`* ```typescript string ``` ISO-8601 timestamp when the lock was created. #### `lockedBy` *Defined in `packages/cli/src/commands/lock.ts:39`* ```typescript string ``` Identifier of who created the lock. #### `locked` *Defined in `packages/cli/src/commands/lock.ts:41`* ```typescript { rules: number; tsconfig: boolean; biome: boolean; } ``` Summary of what was locked. #### `overwrote` *Defined in `packages/cli/src/commands/lock.ts:50`* ```typescript boolean ``` Whether a previous lock file was overwritten. ### `PrepublishResult` *Defined in `packages/cli/src/commands/prepublish.ts:40`* ```typescript PrepublishResult ``` Typed result for the `prepublish` command. **Examples** ```typescript import { runPrepublish } from "@forge-ts/cli/commands/prepublish"; const output = await runPrepublish({ cwd: process.cwd() }); console.log(output.data.check.success); // true if check passed console.log(output.data.build?.success); // true if build passed ``` #### `success` *Defined in `packages/cli/src/commands/prepublish.ts:42`* ```typescript boolean ``` Whether both check and build passed. #### `summary` *Defined in `packages/cli/src/commands/prepublish.ts:44`* ```typescript { steps: number; passed: number; failed: number; duration: number; } ``` Summary of the prepublish pipeline. #### `check` *Defined in `packages/cli/src/commands/prepublish.ts:55`* ```typescript { success: boolean; errors: number; warnings: number; duration: number; } ``` Result of the check step. #### `build` *Defined in `packages/cli/src/commands/prepublish.ts:66`* ```typescript { success: boolean; steps: number; succeeded: number; failed: number; duration: number; } | undefined ``` Result of the build step (absent if check failed and build was skipped). #### `skippedReason` *Defined in `packages/cli/src/commands/prepublish.ts:79`* ```typescript string | undefined ``` If check failed, the reason build was skipped. ### `PrepublishArgs` *Defined in `packages/cli/src/commands/prepublish.ts:86`* ```typescript PrepublishArgs ``` Arguments for the `prepublish` command. #### `cwd` *Defined in `packages/cli/src/commands/prepublish.ts:88`* ```typescript string | undefined ``` Project root directory (default: cwd). #### `strict` *Defined in `packages/cli/src/commands/prepublish.ts:90`* ```typescript boolean | undefined ``` Treat warnings as errors during the check step. #### `mvi` *Defined in `packages/cli/src/commands/prepublish.ts:92`* ```typescript string | undefined ``` MVI verbosity level for structured output. ### `ExtractedExample` *Defined in `packages/doctest/src/extractor.ts:7`* ```typescript ExtractedExample ``` A single extracted `@example` block ready for test generation. #### `symbolName` *Defined in `packages/doctest/src/extractor.ts:9`* ```typescript string ``` The symbol this example belongs to. #### `filePath` *Defined in `packages/doctest/src/extractor.ts:11`* ```typescript string ``` Absolute path to the source file. #### `line` *Defined in `packages/doctest/src/extractor.ts:13`* ```typescript number ``` 1-based line number of the `@example` tag. #### `code` *Defined in `packages/doctest/src/extractor.ts:15`* ```typescript string ``` The raw code inside the fenced block. #### `language` *Defined in `packages/doctest/src/extractor.ts:17`* ```typescript string ``` The language identifier (e.g. `"typescript"`). #### `index` *Defined in `packages/doctest/src/extractor.ts:19`* ```typescript number ``` Sequential index among examples for this symbol. ### `GeneratorOptions` *Defined in `packages/doctest/src/generator.ts:8`* ```typescript GeneratorOptions ``` Options for virtual test file generation. #### `cacheDir` *Defined in `packages/doctest/src/generator.ts:10`* ```typescript string ``` Directory where virtual test files will be written. ### `VirtualTestFile` *Defined in `packages/doctest/src/generator.ts:17`* ```typescript VirtualTestFile ``` A generated virtual test file. #### `path` *Defined in `packages/doctest/src/generator.ts:19`* ```typescript string ``` Absolute path where the file will be written. #### `content` *Defined in `packages/doctest/src/generator.ts:21`* ```typescript string ``` File contents (valid TypeScript). ### `RunResult` *Defined in `packages/doctest/src/runner.ts:10`* ```typescript RunResult ``` Result of running the generated test files. #### `success` *Defined in `packages/doctest/src/runner.ts:12`* ```typescript boolean ``` Whether all tests passed. #### `passed` *Defined in `packages/doctest/src/runner.ts:14`* ```typescript number ``` Number of tests that passed. #### `failed` *Defined in `packages/doctest/src/runner.ts:16`* ```typescript number ``` Number of tests that failed. #### `output` *Defined in `packages/doctest/src/runner.ts:18`* ```typescript string ``` Combined stdout + stderr output from the test runner. #### `tests` *Defined in `packages/doctest/src/runner.ts:20`* ```typescript TestCaseResult[] ``` Individual test results with name and status. ### `TestCaseResult` *Defined in `packages/doctest/src/runner.ts:27`* ```typescript TestCaseResult ``` The result of a single test case. #### `name` *Defined in `packages/doctest/src/runner.ts:29`* ```typescript string ``` The full test name as reported by the runner. #### `passed` *Defined in `packages/doctest/src/runner.ts:31`* ```typescript boolean ``` Whether this test passed. #### `sourceFile` *Defined in `packages/doctest/src/runner.ts:33`* ```typescript string | undefined ``` The source file this test was generated from, if determinable. ### `TestArgs` *Defined in `packages/cli/src/commands/test.ts:10`* ```typescript TestArgs ``` Arguments for the `test` command. #### `cwd` *Defined in `packages/cli/src/commands/test.ts:12`* ```typescript string | undefined ``` Project root directory (default: cwd). #### `mvi` *Defined in `packages/cli/src/commands/test.ts:14`* ```typescript string | undefined ``` MVI verbosity level for structured output. ### `TestFailure` *Defined in `packages/cli/src/commands/test.ts:21`* ```typescript TestFailure ``` A single test failure entry, included at standard and full MVI levels. #### `symbol` *Defined in `packages/cli/src/commands/test.ts:23`* ```typescript string ``` Symbol name where the doctest failed. #### `file` *Defined in `packages/cli/src/commands/test.ts:25`* ```typescript string ``` Absolute path to the source file. #### `line` *Defined in `packages/cli/src/commands/test.ts:27`* ```typescript number ``` 1-based line number of the failing example. #### `message` *Defined in `packages/cli/src/commands/test.ts:29`* ```typescript string ``` Human-readable failure message. ### `TestResult` *Defined in `packages/cli/src/commands/test.ts:36`* ```typescript TestResult ``` Typed result for the `test` command. #### `success` *Defined in `packages/cli/src/commands/test.ts:38`* ```typescript boolean ``` Whether all doctests passed. #### `summary` *Defined in `packages/cli/src/commands/test.ts:40`* ```typescript { passed: number; failed: number; total: number; duration: number; } ``` Aggregate counts — always present regardless of MVI level. #### `failures` *Defined in `packages/cli/src/commands/test.ts:51`* ```typescript TestFailure[] | undefined ``` Per-failure details — present at standard and full MVI levels. ### `UnlockResult` *Defined in `packages/cli/src/commands/unlock.ts:31`* ```typescript UnlockResult ``` Typed result for the `unlock` command. #### `success` *Defined in `packages/cli/src/commands/unlock.ts:33`* ```typescript boolean ``` Whether the unlock was successful. #### `reason` *Defined in `packages/cli/src/commands/unlock.ts:35`* ```typescript string ``` The reason provided for unlocking. #### `previousLockedBy` *Defined in `packages/cli/src/commands/unlock.ts:37`* ```typescript string | null ``` Who originally locked the config, if known. #### `previousLockedAt` *Defined in `packages/cli/src/commands/unlock.ts:39`* ```typescript string | null ``` When the config was originally locked, if known. ### `ExtractedExample` *Defined in `packages/doctest/src/src/extractor.ts:8`* ```typescript ExtractedExample ``` A single extracted `@example` block ready for test generation. #### `symbolName` *Defined in `packages/doctest/src/src/extractor.ts:10`* ```typescript string ``` The symbol this example belongs to. #### `filePath` *Defined in `packages/doctest/src/src/extractor.ts:12`* ```typescript string ``` Absolute path to the source file. #### `line` *Defined in `packages/doctest/src/src/extractor.ts:14`* ```typescript number ``` 1-based line number of the `@example` tag. #### `code` *Defined in `packages/doctest/src/src/extractor.ts:16`* ```typescript string ``` The raw code inside the fenced block. #### `language` *Defined in `packages/doctest/src/src/extractor.ts:18`* ```typescript string ``` The language identifier (e.g. `"typescript"`). #### `index` *Defined in `packages/doctest/src/src/extractor.ts:20`* ```typescript number ``` Sequential index among examples for this symbol. ### `GeneratorOptions` *Defined in `packages/doctest/src/src/generator.ts:9`* ```typescript GeneratorOptions ``` Options for virtual test file generation. #### `cacheDir` *Defined in `packages/doctest/src/src/generator.ts:11`* ```typescript string ``` Directory where virtual test files will be written. ### `VirtualTestFile` *Defined in `packages/doctest/src/src/generator.ts:19`* ```typescript VirtualTestFile ``` A generated virtual test file. #### `path` *Defined in `packages/doctest/src/src/generator.ts:21`* ```typescript string ``` Absolute path where the file will be written. #### `content` *Defined in `packages/doctest/src/src/generator.ts:23`* ```typescript string ``` File contents (valid TypeScript). ### `RunResult` *Defined in `packages/doctest/src/src/runner.ts:11`* ```typescript RunResult ``` Result of running the generated test files. #### `success` *Defined in `packages/doctest/src/src/runner.ts:13`* ```typescript boolean ``` Whether all tests passed. #### `passed` *Defined in `packages/doctest/src/src/runner.ts:15`* ```typescript number ``` Number of tests that passed. #### `failed` *Defined in `packages/doctest/src/src/runner.ts:17`* ```typescript number ``` Number of tests that failed. #### `output` *Defined in `packages/doctest/src/src/runner.ts:19`* ```typescript string ``` Combined stdout + stderr output from the test runner. #### `tests` *Defined in `packages/doctest/src/src/runner.ts:21`* ```typescript TestCaseResult[] ``` Individual test results with name and status. ### `TestCaseResult` *Defined in `packages/doctest/src/src/runner.ts:29`* ```typescript TestCaseResult ``` The result of a single test case. #### `name` *Defined in `packages/doctest/src/src/runner.ts:31`* ```typescript string ``` The full test name as reported by the runner. #### `passed` *Defined in `packages/doctest/src/src/runner.ts:33`* ```typescript boolean ``` Whether this test passed. #### `sourceFile` *Defined in `packages/doctest/src/src/runner.ts:38`* ```typescript string | undefined ``` The source file this test was generated from, if determinable. ### `DeprecatedUsage` *Defined in `packages/enforcer/src/src/deprecation-tracker.ts:4`* ```typescript DeprecatedUsage ``` A detected usage of a deprecated symbol. #### `deprecatedSymbol` *Defined in `packages/enforcer/src/src/deprecation-tracker.ts:6`* ```typescript string ``` The deprecated symbol being consumed. #### `sourcePackage` *Defined in `packages/enforcer/src/src/deprecation-tracker.ts:8`* ```typescript string ``` The package that exports the deprecated symbol. #### `consumingFile` *Defined in `packages/enforcer/src/src/deprecation-tracker.ts:10`* ```typescript string ``` The file importing the deprecated symbol. #### `line` *Defined in `packages/enforcer/src/src/deprecation-tracker.ts:12`* ```typescript number ``` Line number of the import. #### `deprecationMessage` *Defined in `packages/enforcer/src/src/deprecation-tracker.ts:14`* ```typescript string ``` The deprecation message. ### `FormatOptions` *Defined in `packages/enforcer/src/src/formatter.ts:13`* ```typescript FormatOptions ``` Options that control how `formatResults` renders its output. #### `colors` *Defined in `packages/enforcer/src/src/formatter.ts:15`* ```typescript boolean ``` Emit ANSI colour escape sequences when `true`. #### `verbose` *Defined in `packages/enforcer/src/src/formatter.ts:20`* ```typescript boolean ``` When `true`, include the symbol's type signature alongside each diagnostic so the reader has immediate context. ## Types ### `AuditEventType` *Defined in `packages/core/src/audit.ts:25`* ```typescript AuditEventType ``` Discriminated event types recorded in the audit trail. ### `RuleSeverity` *Defined in `packages/core/src/types.ts:82`* ```typescript RuleSeverity ``` Severity level for an individual enforcement rule. - `"error"` — violation fails the build. - `"warn"` — violation is reported but does not fail the build. - `"off"` — rule is disabled entirely. ### `GuideSource` *Defined in `packages/gen/src/guide-discovery.ts:21`* ```typescript GuideSource ``` The source heuristic that discovered a guide. ### `MdPhrasing` *Defined in `packages/gen/src/mdast-builders.ts:62`* ```typescript MdPhrasing ``` Union of all inline (phrasing) content types. ### `MdBlock` *Defined in `packages/gen/src/mdast-builders.ts:178`* ```typescript MdBlock ``` Union of all block content types. ### `SSGTarget` *Defined in `packages/gen/src/adapters/types.ts:8`* ```typescript SSGTarget ``` Supported SSG target identifiers. ### `CKMConcept` *Defined in `packages/gen/src/ckm-generator.ts:40`* ```typescript CkmConcept ``` A domain concept extracted from the codebase. ### `CKMOperation` *Defined in `packages/gen/src/ckm-generator.ts:52`* ```typescript CkmOperation ``` A user-facing operation extracted from the codebase. ### `CKMConstraint` *Defined in `packages/gen/src/ckm-generator.ts:58`* ```typescript CkmConstraint ``` An enforced constraint or validation rule extracted from the codebase. ### `CKMWorkflow` *Defined in `packages/gen/src/ckm-generator.ts:64`* ```typescript CkmWorkflow ``` A multi-step workflow for achieving a common goal. ### `CKMConfigEntry` *Defined in `packages/gen/src/ckm-generator.ts:70`* ```typescript CkmConfigEntry ``` A single entry in the configuration schema. ### `CKMManifest` *Defined in `packages/gen/src/ckm-generator.ts:81`* ```typescript CkmManifest ``` The top-level Codebase Knowledge Manifest (v2). ### `HookManager` *Defined in `packages/cli/src/commands/init-hooks.ts:33`* ```typescript HookManager ``` Detected hook manager in the project. ### `DoctorCheckStatus` *Defined in `packages/cli/src/commands/doctor.ts:29`* ```typescript DoctorCheckStatus ``` Status of a single doctor check. ## Enums ### `Visibility` *Defined in `packages/core/src/types.ts:7`* ```typescript Visibility ``` Visibility levels for exported symbols. Derived from TSDoc release tags (`@public`, `@beta`, `@internal`). #### `Public` *Defined in `packages/core/src/types.ts:8`* ```typescript Visibility.Public ``` #### `Beta` *Defined in `packages/core/src/types.ts:9`* ```typescript Visibility.Beta ``` #### `Internal` *Defined in `packages/core/src/types.ts:10`* ```typescript Visibility.Internal ``` #### `Private` *Defined in `packages/core/src/types.ts:11`* ```typescript Visibility.Private ``` ## Variables ### `RULE_GROUP_MAP` *Defined in `packages/core/src/config.ts:23`* ```typescript Partial> ``` Maps each rule key in `EnforceRules` to its TSDoc standardisation group. - **core**: Tags defined in the TSDoc core standard (`@param`, `@returns`, etc.). - **extended**: Tags from the extended standard (`@example`, `@defaultValue`, etc.). - **discretionary**: Release-tag family (`@public`, `@beta`, `@internal`). - Rules not listed here are **guard rules** and are not affected by group settings. ### `forgeLogger` *Defined in `packages/cli/src/forge-logger.ts:32`* ```typescript import("consola").ConsolaInstance ``` Pre-configured consola instance branded for forge-ts. **Examples** ```typescript import { forgeLogger } from "./forge-logger.js"; forgeLogger.info("Checking 42 files..."); forgeLogger.success("All checks passed"); forgeLogger.warn("Deprecated import detected"); forgeLogger.error("Build failed"); forgeLogger.debug("Resolved config from forge-ts.config.ts"); ``` ### `auditCommand` *Defined in `packages/cli/src/commands/audit.ts:140`* ```typescript import("citty").CommandDef<{ readonly cwd: { readonly type: "string"; readonly description: "Project root directory"; }; readonly limit: { readonly type: "string"; readonly description: "Maximum events to display (default: 20)"; }; readonly type: { readonly type: "string"; readonly description: "Filter by event type (config.lock, config.unlock, config.drift, bypass.create, bypass.expire, rule.change)"; }; readonly json: { readonly type: "boolean"; readonly description: "Output as LAFS JSON envelope (agent-friendly)"; readonly default: false; }; readonly human: { readonly type: "boolean"; readonly description: "Output as formatted text (default for TTY)"; readonly default: false; }; readonly quiet: { readonly type: "boolean"; readonly description: "Suppress non-essential output"; readonly default: false; }; }> ``` Citty command definition for `forge-ts audit`. ### `barometerCommand` *Defined in `packages/cli/src/commands/barometer.ts:1315`* ```typescript import("citty").CommandDef<{ readonly cwd: { readonly type: "string"; readonly description: "Project root directory"; }; readonly "questions-only": { readonly type: "boolean"; readonly description: "Redact answers and include agent instructions for testing"; readonly default: false; }; readonly json: { readonly type: "boolean"; readonly description: "Output as LAFS JSON envelope"; readonly default: false; }; readonly human: { readonly type: "boolean"; readonly description: "Output as formatted text"; readonly default: false; }; readonly quiet: { readonly type: "boolean"; readonly description: "Suppress non-essential output"; readonly default: false; }; readonly mvi: { readonly type: "string"; readonly description: "MVI verbosity level: minimal, standard, full"; }; }> ``` Citty command definition for `forge-ts barometer`. Generates a documentation effectiveness test (questions + answers + rubric) from the project's source code. Includes a `score` subcommand for evaluating agent answers. **Examples** ```typescript import { barometerCommand } from "@forge-ts/cli/commands/barometer"; // Registered as a top-level subcommand of `forge-ts` ``` ### `md` *Defined in `packages/gen/src/mdast-builders.ts:214`* ```typescript { text: (value: string) => MdText; inlineCode: (value: string) => MdInlineCode; strong: (...children: MdPhrasing[]) => MdStrong; emphasis: (...children: MdPhrasing[]) => MdEmphasis; link: (url: string, ...children: MdPhrasing[]) => MdLink; heading: (depth: 1 | 2 | 3 | 4 | 5 | 6, ...children: MdPhrasing[]) => MdHeading; paragraph: (...children: MdPhrasing[]) => MdParagraph; code: (lang: string, value: string) => MdCode; blockquote: (...children: MdBlock[]) => MdBlockquote; html: (value: string) => MdHtml; thematicBreak: () => MdThematicBreak; listItem: (...children: MdBlock[]) => MdListItem; list: (items: MdListItem[], ordered?: boolean) => MdList; tableCell: (...children: MdPhrasing[]) => MdTableCell; tableRow: (...cells: MdTableCell[]) => MdTableRow; table: (align: ("left" | "center" | "right" | null)[] | null, ...rows: MdTableRow[]) => MdTable; root: (...children: MdBlock[]) => MdRoot; } ``` Concise factory functions for building mdast nodes. Usage: ### `DEFAULT_TARGET` *Defined in `packages/gen/src/adapters/registry.ts:76`* ```typescript SSGTarget ``` The default SSG target when none is specified. ### `mintlifyAdapter` *Defined in `packages/gen/src/adapters/mintlify.ts:174`* ```typescript SSGAdapter ``` Mintlify SSG adapter. Implements the `SSGAdapter` contract for the Mintlify platform. **Examples** ```typescript import { getAdapter } from "@forge-ts/gen"; const adapter = getAdapter("mintlify"); const configs = adapter.generateConfig(context); console.log(configs[0].path); // "docs.json" ``` ### `docusaurusAdapter` *Defined in `packages/gen/src/adapters/docusaurus.ts:193`* ```typescript SSGAdapter ``` Docusaurus SSG adapter. Implements the `SSGAdapter` contract for the Docusaurus platform. **Examples** ```typescript import { getAdapter } from "@forge-ts/gen"; const adapter = getAdapter("docusaurus"); const configs = adapter.generateConfig(context); console.log(configs[0].path); // "sidebars.ts" ``` ### `nextraAdapter` *Defined in `packages/gen/src/adapters/nextra.ts:241`* ```typescript SSGAdapter ``` Nextra SSG adapter (v4, App Router). Implements the `SSGAdapter` contract for the Nextra platform. **Examples** ```typescript import { getAdapter } from "@forge-ts/gen"; const adapter = getAdapter("nextra"); const configs = adapter.generateConfig(context); console.log(configs[0].path); // "content/_meta.js" ``` ### `vitepressAdapter` *Defined in `packages/gen/src/adapters/vitepress.ts:170`* ```typescript SSGAdapter ``` VitePress SSG adapter. Implements the `SSGAdapter` contract for the VitePress platform. **Examples** ```typescript import { getAdapter } from "@forge-ts/gen"; const adapter = getAdapter("vitepress"); const configs = adapter.generateConfig(context); console.log(configs[0].path); // ".vitepress/config.mts" ``` ### `fumadocsAdapter` *Defined in `packages/gen/src/adapters/fumadocs.ts:373`* ```typescript SSGAdapter ``` Fumadocs SSG adapter (App Router, content/docs layout). Implements the `SSGAdapter` contract for the Fumadocs platform. **Examples** ```typescript import { getAdapter } from "@forge-ts/gen"; const adapter = getAdapter("fumadocs"); const configs = adapter.generateConfig(context); console.log(configs[0].path); // "content/docs/meta.json" ``` ### `buildCommand` *Defined in `packages/cli/src/commands/build.ts:213`* ```typescript import("citty").CommandDef<{ readonly cwd: { readonly type: "string"; readonly description: "Project root directory"; }; readonly "skip-api": { readonly type: "boolean"; readonly description: "Skip OpenAPI generation"; readonly default: false; }; readonly "skip-gen": { readonly type: "boolean"; readonly description: "Skip doc generation"; readonly default: false; }; readonly "force-stubs": { readonly type: "boolean"; readonly description: "Overwrite stub pages even if they exist (reset to scaffolding)"; readonly default: false; }; readonly json: { readonly type: "boolean"; readonly description: "Output as LAFS JSON envelope (agent-friendly)"; readonly default: false; }; readonly human: { readonly type: "boolean"; readonly description: "Output as formatted text (default for TTY)"; readonly default: false; }; readonly quiet: { readonly type: "boolean"; readonly description: "Suppress non-essential output"; readonly default: false; }; readonly mvi: { readonly type: "string"; readonly description: "MVI verbosity level: minimal, standard, full"; }; }> ``` Citty command definition for `forge-ts build`. ### `bypassCommand` *Defined in `packages/cli/src/commands/bypass.ts:240`* ```typescript import("citty").CommandDef<{ readonly cwd: { readonly type: "string"; readonly description: "Project root directory"; }; readonly reason: { readonly type: "string"; readonly description: "Mandatory justification for bypassing rules"; }; readonly rule: { readonly type: "string"; readonly description: "Specific rule code to bypass (e.g., \"E009\"). Defaults to \"all\""; }; readonly status: { readonly type: "boolean"; readonly description: "Show active bypasses and remaining budget"; readonly default: false; }; readonly json: { readonly type: "boolean"; readonly description: "Output as LAFS JSON envelope (agent-friendly)"; readonly default: false; }; readonly human: { readonly type: "boolean"; readonly description: "Output as formatted text (default for TTY)"; readonly default: false; }; readonly quiet: { readonly type: "boolean"; readonly description: "Suppress non-essential output"; readonly default: false; }; }> ``` Citty command definition for `forge-ts bypass`. ### `checkCommand` *Defined in `packages/cli/src/commands/check.ts:663`* ```typescript import("citty").CommandDef<{ readonly cwd: { readonly type: "string"; readonly description: "Project root directory"; }; readonly strict: { readonly type: "boolean"; readonly description: "Treat warnings as errors"; readonly default: false; }; readonly verbose: { readonly type: "boolean"; readonly description: "Show detailed output"; readonly default: false; }; readonly rule: { readonly type: "string"; readonly description: "Filter by rule code (e.g., E001, W004)"; }; readonly file: { readonly type: "string"; readonly description: "Filter by file path (substring match)"; }; readonly staged: { readonly type: "boolean"; readonly description: "Only check symbols from git-staged .ts/.tsx files"; readonly default: false; }; readonly limit: { readonly type: "string"; readonly description: "Max file groups in output (default: 20)"; }; readonly offset: { readonly type: "string"; readonly description: "Skip N file groups for pagination (default: 0)"; }; readonly json: { readonly type: "boolean"; readonly description: "Output as LAFS JSON envelope (agent-friendly)"; readonly default: false; }; readonly human: { readonly type: "boolean"; readonly description: "Output as formatted text (default for TTY)"; readonly default: false; }; readonly quiet: { readonly type: "boolean"; readonly description: "Suppress non-essential output"; readonly default: false; }; readonly mvi: { readonly type: "string"; readonly description: "MVI verbosity level: minimal, standard, full"; }; }> ``` Citty command definition for `forge-ts check`. ### `docsDevCommand` *Defined in `packages/cli/src/commands/docs-dev.ts:88`* ```typescript import("citty").CommandDef<{ readonly cwd: { readonly type: "string"; readonly description: "Project root directory"; }; readonly target: { readonly type: "string"; readonly description: "SSG target override (reads from config by default)"; }; readonly port: { readonly type: "string"; readonly description: "Port for the dev server"; }; }> ``` Citty command definition for `forge-ts docs dev`. **Examples** ```typescript import { docsDevCommand } from "@forge-ts/cli"; ``` ### `initHooksCommand` *Defined in `packages/cli/src/commands/init-hooks.ts:536`* ```typescript import("citty").CommandDef<{ readonly cwd: { readonly type: "string"; readonly description: "Project root directory"; }; readonly force: { readonly type: "boolean"; readonly description: "Overwrite existing hook files"; readonly default: false; }; readonly json: { readonly type: "boolean"; readonly description: "Output as LAFS JSON envelope"; readonly default: false; }; readonly human: { readonly type: "boolean"; readonly description: "Output as formatted text"; readonly default: false; }; readonly quiet: { readonly type: "boolean"; readonly description: "Suppress non-essential output"; readonly default: false; }; readonly mvi: { readonly type: "string"; readonly description: "MVI verbosity level: minimal, standard, full"; }; }> ``` Citty command definition for `forge-ts init hooks`. Scaffolds git hook integration for the project by detecting the hook manager (husky or lefthook) and generating pre-commit hooks. **Examples** ```typescript import { initHooksCommand } from "@forge-ts/cli/commands/init-hooks"; // Registered as a subcommand of `forge-ts init` ``` ### `initProjectCommand` *Defined in `packages/cli/src/commands/init-project.ts:615`* ```typescript import("citty").CommandDef<{ readonly cwd: { readonly type: "string"; readonly description: "Project root directory"; }; readonly json: { readonly type: "boolean"; readonly description: "Output as LAFS JSON envelope"; readonly default: false; }; readonly human: { readonly type: "boolean"; readonly description: "Output as formatted text"; readonly default: false; }; readonly quiet: { readonly type: "boolean"; readonly description: "Suppress non-essential output"; readonly default: false; }; readonly mvi: { readonly type: "string"; readonly description: "MVI verbosity level: minimal, standard, full"; }; }> ``` Citty command definition for `forge-ts init` (bare — full project setup). Detects the project environment, writes default configuration files, validates tsconfig/package.json, and reports a summary. **Examples** ```typescript import { initProjectCommand } from "@forge-ts/cli/commands/init-project"; // Registered as the default handler for `forge-ts init` ``` ### `doctorCommand` *Defined in `packages/cli/src/commands/doctor.ts:761`* ```typescript import("citty").CommandDef<{ readonly cwd: { readonly type: "string"; readonly description: "Project root directory"; }; readonly fix: { readonly type: "boolean"; readonly description: "Auto-fix resolvable issues"; readonly default: false; }; readonly json: { readonly type: "boolean"; readonly description: "Output as LAFS JSON envelope"; readonly default: false; }; readonly human: { readonly type: "boolean"; readonly description: "Output as formatted text"; readonly default: false; }; readonly quiet: { readonly type: "boolean"; readonly description: "Suppress non-essential output"; readonly default: false; }; readonly mvi: { readonly type: "string"; readonly description: "MVI verbosity level: minimal, standard, full"; }; }> ``` Citty command definition for `forge-ts doctor`. Performs project integrity checks and optionally auto-fixes resolvable issues with `--fix`. **Examples** ```typescript import { doctorCommand } from "@forge-ts/cli/commands/doctor"; // Registered as a top-level subcommand of `forge-ts` ``` ### `initDocsCommand` *Defined in `packages/cli/src/commands/init-docs.ts:302`* ```typescript import("citty").CommandDef<{ readonly target: { readonly type: "string"; readonly description: `SSG target: ${string} (default: docusaurus)` | `SSG target: ${string} (default: mintlify)` | `SSG target: ${string} (default: nextra)` | `SSG target: ${string} (default: vitepress)` | `SSG target: ${string} (default: fumadocs)`; }; readonly cwd: { readonly type: "string"; readonly description: "Project root directory"; }; readonly "out-dir": { readonly type: "string"; readonly description: "Output directory for doc site (default: ./docs)"; }; readonly force: { readonly type: "boolean"; readonly description: "Overwrite existing scaffold"; readonly default: false; }; readonly json: { readonly type: "boolean"; readonly description: "Output as LAFS JSON envelope"; readonly default: false; }; readonly human: { readonly type: "boolean"; readonly description: "Output as formatted text"; readonly default: false; }; readonly quiet: { readonly type: "boolean"; readonly description: "Suppress non-essential output"; readonly default: false; }; readonly mvi: { readonly type: "string"; readonly description: "MVI verbosity level: minimal, standard, full"; }; }> ``` Citty command definition for `forge-ts init docs`. Scaffolds a complete documentation site for the target SSG platform. Use `--json` for LAFS JSON envelope output (agent/CI-friendly). **Examples** ```typescript import { initDocsCommand } from "@forge-ts/cli/commands/init-docs"; // Registered automatically as a subcommand of `forge-ts init` ``` ### `initCommand` *Defined in `packages/cli/src/commands/init-docs.ts:390`* ```typescript import("citty").CommandDef ``` Citty command definition for `forge-ts init`. Exposes subcommands for scaffolding project artefacts. **Examples** ```typescript import { initCommand } from "@forge-ts/cli/commands/init-docs"; // Registered automatically as a subcommand of `forge-ts` ``` ### `lockCommand` *Defined in `packages/cli/src/commands/lock.ts:154`* ```typescript import("citty").CommandDef<{ readonly cwd: { readonly type: "string"; readonly description: "Project root directory"; }; readonly json: { readonly type: "boolean"; readonly description: "Output as LAFS JSON envelope (agent-friendly)"; readonly default: false; }; readonly human: { readonly type: "boolean"; readonly description: "Output as formatted text (default for TTY)"; readonly default: false; }; readonly quiet: { readonly type: "boolean"; readonly description: "Suppress non-essential output"; readonly default: false; }; }> ``` Citty command definition for `forge-ts lock`. ### `prepublishCommand` *Defined in `packages/cli/src/commands/prepublish.ts:267`* ```typescript import("citty").CommandDef<{ readonly cwd: { readonly type: "string"; readonly description: "Project root directory"; }; readonly strict: { readonly type: "boolean"; readonly description: "Treat warnings as errors during check"; readonly default: false; }; readonly json: { readonly type: "boolean"; readonly description: "Output as LAFS JSON envelope (agent-friendly)"; readonly default: false; }; readonly human: { readonly type: "boolean"; readonly description: "Output as formatted text (default for TTY)"; readonly default: false; }; readonly quiet: { readonly type: "boolean"; readonly description: "Suppress non-essential output"; readonly default: false; }; readonly mvi: { readonly type: "string"; readonly description: "MVI verbosity level: minimal, standard, full"; }; }> ``` Citty command definition for `forge-ts prepublish`. Runs check then build as a publish safety gate. Add to package.json as: `"prepublishOnly": "forge-ts prepublish"` **Examples** ```typescript import { prepublishCommand } from "@forge-ts/cli/commands/prepublish"; // Registered as `forge-ts prepublish` ``` ### `testCommand` *Defined in `packages/cli/src/commands/test.ts:131`* ```typescript import("citty").CommandDef<{ readonly cwd: { readonly type: "string"; readonly description: "Project root directory"; }; readonly json: { readonly type: "boolean"; readonly description: "Output as LAFS JSON envelope (agent-friendly)"; readonly default: false; }; readonly human: { readonly type: "boolean"; readonly description: "Output as formatted text (default for TTY)"; readonly default: false; }; readonly quiet: { readonly type: "boolean"; readonly description: "Suppress non-essential output"; readonly default: false; }; readonly mvi: { readonly type: "string"; readonly description: "MVI verbosity level: minimal, standard, full"; }; }> ``` Citty command definition for `forge-ts test`. ### `unlockCommand` *Defined in `packages/cli/src/commands/unlock.ts:176`* ```typescript import("citty").CommandDef<{ readonly cwd: { readonly type: "string"; readonly description: "Project root directory"; }; readonly reason: { readonly type: "string"; readonly description: "Mandatory reason for unlocking (audit trail)"; readonly required: true; }; readonly json: { readonly type: "boolean"; readonly description: "Output as LAFS JSON envelope (agent-friendly)"; readonly default: false; }; readonly human: { readonly type: "boolean"; readonly description: "Output as formatted text (default for TTY)"; readonly default: false; }; readonly quiet: { readonly type: "boolean"; readonly description: "Suppress non-essential output"; readonly default: false; }; }> ``` Citty command definition for `forge-ts unlock`.