/** * Shared utilities, constants, and types used across init write-* modules. */ import type { Command } from '../types.js'; import type { WorkerRow } from './generated-counts.js'; export declare const MAX_EXEC_FILE_BYTES: number; /** * i-041/i-117: the generated CLAUDE.md / CAPABILITIES.md CLI-commands table * used to hardcode each command's subcommand count (drifts every release — * real init/agent/monoswarm/mcp counts were all wrong at 091d8e05c). Reading * `command.subcommands.length` directly from the live `Command` object * fixes that, but `subcommands` is typed optional on `Command` — a command * with none is a real, honest 0, not a type error to paper over. */ export declare function subcommandCount(command: Command): number; /** * Renders the `| name | priority | description |` markdown rows for the * Background Workers table in both CLAUDE.md and CAPABILITIES.md, from * generated-counts.ts's WORKER_ROWS (derived from WORKER_CONFIGS at * doc-generation time). * * i-035 reviewer finding (MAJOR 1): deriving the worker *count* did not fix * the worker *table* underneath it — it was a hand-maintained list of 14 * names, 6 of which don't exist (`hooks worker run ` errors on them) * and one real worker (`reflexion`) it never listed. The heading number and * the row list must come from the same source or they will disagree again. */ export declare function workerTableRows(rows: WorkerRow[]): string; /** * Probe whether an optionalDependency actually resolved in this install * (npm silently skips optionalDependencies it can't satisfy — see * docs/AUDIT-BACKLOG.md P1-1/P1-23). Used to caveat generated docs instead * of presenting these features as unconditionally working. * * i-041/i-117: `require.resolve` (via `createRequire`) cannot satisfy a * package whose `exports` map gates its root entry behind an `import` * condition only — `@monoes/hooks` and `monofence-ai` both do — so it always * threw for them, reporting "unavailable" even when correctly installed. * `import.meta.resolve()` resolves both require- and import-only export * shapes; it is synchronous and throws on failure (not a truthiness check), * so the try/catch shape here is unchanged. The sole helper for this * question — claudemd-generator.ts's detectOptionalPackages() calls this * rather than re-implementing its own resolver. */ export declare function _isOptionalPackageResolvable(pkg: string): boolean; /** * #420: the file URL of @monoes/monograph's public entry, resolved from the * CLI's own dependencies, or null when it cannot be loaded. Deep paths such as * `@monoes/monograph/dist/src/index.js` are not in its `exports` map * (ERR_PACKAGE_PATH_NOT_EXPORTED), and its root entry is import-only, so this * goes through `import.meta.resolve()` on the package name. */ export declare function resolveMonographEntryUrl(): string | null; /** * Find source helpers directory. * Validates that the directory contains hook-handler.cjs AND its required * subdirectory files (utils/telemetry.cjs etc.) to avoid accepting a partial * or corrupted source that would reproduce the missing-utils/ bug class. */ export declare function findSourceHelpersDir(sourceBaseDir?: string): string | null; /** Helper-dir files generated per project, never copied from the package: * a shipped skill index lists the package's skills, not the project's. */ export declare const GENERATED_HELPERS: Set; /** * (Re)generates `/.claude/helpers/skill-registry.json` from the * project's skill trees, ~/.claude/skills and the Org library, with the * package's bundled builder. Returns its entry counts (`total` includes Org * skills, `user` the ~/.claude/skills ones), or null when the builder is * unavailable. */ export declare function regenerateSkillIndex(targetDir: string, sourceHelpersDir?: string | null): { total: number; user: number; } | null; /** * Find source .claude directory for statusline files */ export declare function findSourceClaudeDir(sourceBaseDir?: string): string | null; /** * Find source directory for skills/commands/agents */ export declare function findSourceDir(type: 'skills' | 'commands' | 'agents', sourceBaseDir?: string): string | null; export * from './asset-maps.js'; export * from './fs-helpers.js'; export * from './init-manifest.js'; export { mergeGeneratedBlock } from './managed-block.js'; //# sourceMappingURL=shared.d.ts.map