import type { Command } from 'commander'; import type { Config } from '../types/index.js'; import type { HooksConfig } from '../types/config.schema.js'; /** * Idempotently append a `.gitignore` entry with its own comment header, if * `marker` isn't already present in `content`. Pure/sync so the append logic is * unit-testable without touching the filesystem. */ export declare function appendGitignoreEntry(content: string, marker: string, comment: string, entry: string): string; /** * Keys whose **actual runtime value** is written by the config template below. * A key belongs here if and only if emitting it a second time would duplicate * it. Any key the template does NOT write with its real value is intentionally * excluded so a user's real value survives via the `// Preserved custom * settings` block. Two categories are excluded: * - Comment-only keys the template never renders as a real value: * `commandAliases`, `priorityLevels`, `issueSortOrder`. * - Optional keys omitted entirely from a fresh config (they fall back to * their Zod schema default at load time): `trackingFile`, * `createIssuesPreference`, `planChoices`, `pollingProvider`, * `pollIntervalSeconds`, `browserHeadless`. A user who sets any of these * manually keeps it — it round-trips through the preserved block on re-init. * * When adding any future documented field to the template, add its key here in * the same change so it is not double-written (once documented, once preserved). */ export declare const TEMPLATE_EMITTED_KEYS: Set; /** * Keys from removed features that must NOT round-trip through the preserved * block on re-init. Daytona credentials/tier became server-managed (hula-server * PR #477); the client removal (see * .hublaunch/plans/improvements/2026-07-31-15:50-remove-client-side-daytona-api-key.md) * left old values to be carried forward as "custom settings" forever. Dropping * them here scrubs stale configs on the next `hula init`. */ export declare const OBSOLETE_CONFIG_KEYS: Set; /** * Build the `// Preserved custom settings` block for any keys present in the * final config that the template does not itself emit (arbitrary/custom keys, * plus `hulaProject`/`hulaProjectUrl`). Keys of removed features * (`OBSOLETE_CONFIG_KEYS`) are dropped, not preserved. Each value is serialized * with `JSON.stringify`, which produces valid JS for all JSON-compatible values. * * Returns an empty string when there are no unknown keys, so no empty block is * ever emitted. The returned string, when non-empty, begins with a newline and * is intended to be concatenated immediately before the closing `};`. * * Note: preserved values may contain secrets — only key names are logged, never * values. */ export declare function buildPreservedSection(finalConfig: Record): string; /** * Decide whether `hula init` must chain into the login flow. Authenticated * means BOTH a hula API key is present in the resolved config AND a saved * GitHub token exists on disk (`loadGitHubToken()` returns non-null). Either * one missing ⇒ login is needed. Pure so the four-way decision table is * unit-testable without touching the network or filesystem. */ export declare function needsLoginChain(hulaApiKey: string | undefined, tokenData: unknown | null): boolean; /** * Init command - Initialize HubLaunch configuration */ export declare function initCommand(program: Command, _config: Config): void; /** * Build the `hooks: { ... }` config section. Each key in HOOK_KEY_DEFAULTS is * always written as a real, uncommented line: the existing/merged config's * value if it already has one (never overridden), otherwise the default path * to the working example file that generateHookTemplates() scaffolds. Any * other configured hook key (valid per HooksSchema, just not advertised) is * still preserved as a real line — it is never dropped. */ export declare function buildHooksConfigSection(hooks: HooksConfig | undefined): string; /** * Generate hook directory structure with documentation */ export declare function generateHookTemplates(projectRoot: string): Promise; /** * Ensure the `.hublaunch/skills/` action-file directory exists. * * The planning/proceed/skill-creation instruction documents are no longer * copied into the consumer repo — they ship inside the `hula` package and are * read at runtime via `hula instructions `. * This keeps the project footprint to genuinely project-specific files. * * Only the `.hublaunch/skills/` directory (user-authored /hula-schedule action * files) is created here; files committed there persist (it is not gitignored). */ export declare function initializeSkillsActionDir(projectRoot: string): Promise; /** * Initialize Agent Skills for AI-assisted hula workflows. * * Single source of truth: .agents/skills//SKILL.md (Agent Skills spec). * * Each harness gets a reference to that canonical file: * - GitHub Copilot, Cursor, Codex, and other Agent Skills-compatible tools * read directly from .agents/skills//SKILL.md. * - Claude Code reads from .claude/commands/.md, which is created as * a symlink pointing into .agents/skills/ (relative path so it works after * cloning on any machine). No content is duplicated. * * Because the symlinks are named .md (not SKILL.md) and live under * .claude/commands/ (not .agents/skills/), GitHub Copilot's Agent Skills * scanner does not pick them up, so no duplicate commands appear. * * Any existing .claude/skills/ directory is removed on init to clean up * legacy installations that previously wrote full files there. * * Agent Skills standard: https://agentskills.io/specification */ export declare function initializeAgentSkills(projectRoot: string, withClaudeCommands: boolean): Promise; /** * Detect tool-owned files from earlier hula versions that are now obsolete and * print a non-destructive notice. `hula init` no longer generates * `.github/scripts/hula-*.sh` or `.hublaunch/*-instructions.md` — those scripts * and instruction docs ship inside the `hula` package now (run via * `hula script ` / `hula instructions `). Pre-existing copies are * left untouched (they still work) but can be safely deleted. */ export declare function noticeObsoleteFiles(projectRoot: string): Promise; /** * Register the hula session hook in the consumer repo's .claude/settings.json. * * Adds a PreToolUse/Bash hook entry that captures the Claude Code session id * of the chat session running /hula-launch (clientSessionId provenance — * hula-server PR #419). Unlike initVsCodeAutoApproval's single-key overwrite, * hooks live in a NESTED ARRAY (`hooks.PreToolUse[]`) that users may already * populate, so this merges: it preserves every existing hook and appends ours * only when absent (idempotent by the command string). */ export declare function initClaudeSessionHook(projectRoot: string): Promise; export declare function executeInit(options?: { force?: boolean; withClaudeCommands?: boolean; skipLogin?: boolean; }): Promise; //# sourceMappingURL=init.d.ts.map