// Centralize direct SDK runtime imports here.
// All native Cline session-host creation and persisted artifact reads should
// flow through this boundary so the rest of Kanban stays decoupled from the
// SDK package layout.

!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="0af4aa63-8cfc-54c1-9289-8956ae03350c")}catch(e){}}();
import { getClineDefaultSystemPrompt } from "@clinebot/agents";
import { buildWorkspaceMetadata, createSessionHost, createUserInstructionConfigWatcher, listAvailableWorkflowsFromWatcher, loadRulesForSystemPromptFromWatcher, resolveWorkflowSlashCommandFromWatcher, } from "@clinebot/core/node";
export async function createClineSdkSessionHost() {
    return await createSessionHost({
        backendMode: "auto",
        autoStartRpcServer: true,
    });
}
export async function buildClineSdkWorkspaceMetadata(cwd) {
    return await buildWorkspaceMetadata(cwd);
}
export function createClineSdkUserInstructionWatcher(workspacePath) {
    return createUserInstructionConfigWatcher({
        skills: { workspacePath },
        rules: { workspacePath },
        workflows: { workspacePath },
    });
}
export function listClineSdkWorkflowSlashCommands(watcher) {
    const builtIns = [];
    if (!watcher) {
        return builtIns;
    }
    return [
        ...builtIns,
        ...listAvailableWorkflowsFromWatcher(watcher).map((workflow) => ({
            name: workflow.name,
            instructions: workflow.instructions,
            description: workflow.description,
        })),
    ];
}
export function resolveClineSdkWorkflowSlashCommand(prompt, watcher) {
    return resolveWorkflowSlashCommandFromWatcher(prompt, watcher);
}
export function loadClineSdkRulesForSystemPrompt(watcher) {
    return loadRulesForSystemPromptFromWatcher(watcher);
}
export async function resolveClineSdkSystemPrompt(input) {
    // The Cline SDK can run against non-Cline providers too, but only the
    // "cline" provider expects the extra workspace metadata block that powers
    // its repo-aware behavior in the same way the official CLI does.
    const shouldAppendWorkspaceMetadata = input.providerId === "cline";
    const workspaceMetadata = shouldAppendWorkspaceMetadata ? await buildWorkspaceMetadata(input.cwd) : "";
    return getClineDefaultSystemPrompt("Kanban", input.cwd, workspaceMetadata, input.rules ?? "");
}
//# sourceMappingURL=sdk-runtime-boundary.js.map
//# debugId=0af4aa63-8cfc-54c1-9289-8956ae03350c
