/**
 * TPS.4 — first-run topic-create step for the chat-setup wizard.
 *
 * Slots between WIZ.3 (executePlan: writes models.yaml + chat_agent.yaml)
 * and WIZ.4 (runChannelTestStep). When the user has a Telegram supergroup
 * configured, offers to auto-create a forum topic for the current
 * workspace + bind it via TPS.3's `resolveOrCreateTopic`. Opt-out (default
 * = yes). On accept, the workspace's per-project `chat-routing.json` gets
 * an `auto_bound` block + the new topic_id added to `inbound_topic_ids`,
 * so the next WIZ.4 test (and subsequent agent traffic) lands in the
 * freshly-bound topic.
 *
 * Why not import `resolveOrCreateTopic` statically: `src.legacy/` is
 * excluded from `tsconfig.json`. The whole-tree typecheck can't see legacy
 * exports, and `tsconfig.build.json` doesn't emit them either. We load
 * the legacy module at runtime via a path computed from `import.meta.url`
 * — the runtime location is `dist/chat/daemon/workspace-topic.js` (built
 * by the ad-hoc `pnpm exec tsc src.legacy/...` invocation documented in
 * `src.legacy/chat/adapters/telegram.ts`). Tests inject a fake
 * `resolveOrCreateTopic` via the `deps` interface and bypass the loader.
 *
 * Never throws past the wizard — mirrors WIZ.4's contract. Every failure
 * prints a recovery hint via `note()` and returns. The WIZ.3 writes are
 * already on disk by the time this step runs; failure here leaves the
 * user with a working config minus the auto-binding.
 */
import type { ChatDaemonState } from './chat_state.js';
export interface ResolveTopicArgs {
    workspaceUuid: string;
    workspacePath: string;
    chatId: string;
    mode: 'wizard' | 'auto-boot' | 'manual';
    dataRoot?: string;
}
export interface ResolveTopicResult {
    topicId: number;
    topicName: string;
    created: boolean;
}
export type ResolveOrCreateTopicFn = (args: ResolveTopicArgs) => Promise<ResolveTopicResult>;
export interface TopicCreateDeps {
    /** WIZ.2 daemon snapshot — same source the WIZ.4 sibling uses. */
    daemonState: ChatDaemonState;
    /** Cwd-walk start (test injection). Defaults to process.cwd(). */
    cwd?: string;
    /** Env override sink (test injection). Defaults to process.env. */
    env?: NodeJS.ProcessEnv;
    /**
     * Override the topic-resolver (test injection). Defaults to the
     * runtime-loaded `resolveOrCreateTopic` from `dist/chat/daemon/
     * workspace-topic.js`. Tests substitute a stub here to avoid both the
     * dist dependency and the daemon RPC round-trip.
     */
    resolveOrCreateTopic?: ResolveOrCreateTopicFn;
    /**
     * Override the routing-read function (test injection). Defaults to
     * reading `~/.opensquid/projects/<uuid>/chat-routing.json`.
     */
    loadRouting?: (uuid: string) => Promise<ProjectChatRouting | null>;
}
export interface ProjectChatRouting {
    telegram?: {
        report_channel?: string;
        report_topic_id?: number;
        inbound_chat_ids?: string[];
        inbound_topic_ids?: number[];
        auto_bound?: {
            workspace_path: string;
            workspace_uuid: string;
            topic_id: number;
            topic_name: string;
            created_at: string;
            created_by: string;
        };
    };
    discord?: {
        report_channel?: string;
    };
    slack?: {
        report_channel?: string;
    };
}
export declare function runTopicCreateStep(deps: TopicCreateDeps): Promise<void>;
//# sourceMappingURL=topic_create_step.d.ts.map