// This file is auto-generated by @hey-api/openapi-ts
import { client } from "./client.gen.js";
import { buildClientParams } from "./client/index.js";
class HeyApiClient {
    client;
    constructor(args) {
        this.client = args?.client ?? client;
    }
}
class HeyApiRegistry {
    defaultKey = "default";
    instances = new Map();
    get(key) {
        const instance = this.instances.get(key ?? this.defaultKey);
        if (!instance) {
            throw new Error(`No SDK client found. Create one with "new KiloClient()" to fix this error.`);
        }
        return instance;
    }
    set(value, key) {
        this.instances.set(key ?? this.defaultKey, value);
    }
}
export class Auth extends HeyApiClient {
    /**
     * Remove auth credentials
     *
     * Remove authentication credentials
     */
    remove(parameters, options) {
        const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "providerID" }] }]);
        return (options?.client ?? this.client).delete({
            url: "/auth/{providerID}",
            ...options,
            ...params,
        });
    }
    /**
     * Set auth credentials
     *
     * Set authentication credentials
     */
    set(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "providerID" },
                    { key: "auth", map: "body" },
                ],
            },
        ]);
        return (options?.client ?? this.client).put({
            url: "/auth/{providerID}",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
}
export class App extends HeyApiClient {
    /**
     * Write log
     *
     * Write a log entry to the server logs with specified level and metadata.
     */
    log(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "body", key: "service" },
                    { in: "body", key: "level" },
                    { in: "body", key: "message" },
                    { in: "body", key: "extra" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/log",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
    /**
     * List agents
     *
     * Get a list of all available AI agents in the Kilo system.
     */
    agents(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/agent",
            ...options,
            ...params,
        });
    }
    /**
     * List skills
     *
     * Get a list of all available skills in the Kilo system.
     */
    skills(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/skill",
            ...options,
            ...params,
        });
    }
}
export class Config extends HeyApiClient {
    /**
     * Get global configuration
     *
     * Retrieve the current global Kilo configuration settings and preferences.
     */
    get(options) {
        return (options?.client ?? this.client).get({
            url: "/global/config",
            ...options,
        });
    }
    /**
     * Update global configuration
     *
     * Update global Kilo configuration settings and preferences.
     */
    update(parameters, options) {
        const params = buildClientParams([parameters], [{ args: [{ key: "config", map: "body" }] }]);
        return (options?.client ?? this.client).patch({
            url: "/global/config",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
}
export class Global extends HeyApiClient {
    /**
     * Get health
     *
     * Get health information about the Kilo server.
     */
    health(options) {
        return (options?.client ?? this.client).get({
            url: "/global/health",
            ...options,
        });
    }
    /**
     * Get global events
     *
     * Subscribe to global events from the Kilo system using server-sent events.
     */
    event(options) {
        return (options?.client ?? this.client).sse.get({
            url: "/global/event",
            ...options,
        });
    }
    /**
     * Dispose instance
     *
     * Clean up and dispose all Kilo instances, releasing all resources.
     */
    dispose(options) {
        return (options?.client ?? this.client).post({
            url: "/global/dispose",
            ...options,
        });
    }
    /**
     * Upgrade kilo
     *
     * Upgrade kilo to the specified version or latest if not specified.
     */
    upgrade(parameters, options) {
        const params = buildClientParams([parameters], [{ args: [{ in: "body", key: "target" }] }]);
        return (options?.client ?? this.client).post({
            url: "/global/upgrade",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
    _config;
    get config() {
        return (this._config ??= new Config({ client: this.client }));
    }
}
export class Event extends HeyApiClient {
    /**
     * Subscribe to events
     *
     * Get events
     */
    subscribe(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).sse.get({
            url: "/event",
            ...options,
            ...params,
        });
    }
}
export class Config2 extends HeyApiClient {
    /**
     * Get configuration
     *
     * Retrieve the current Kilo configuration settings and preferences.
     */
    get(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/config",
            ...options,
            ...params,
        });
    }
    /**
     * Update configuration
     *
     * Update Kilo configuration settings and preferences.
     */
    update(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { key: "config", map: "body" },
                ],
            },
        ]);
        return (options?.client ?? this.client).patch({
            url: "/config",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
    /**
     * Get config warnings
     *
     * Get warnings generated during config loading (e.g., invalid JSON, schema errors).
     */
    warnings(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/config/warnings",
            ...options,
            ...params,
        });
    }
    /**
     * List config providers
     *
     * Get a list of all configured AI providers and their default models.
     */
    providers(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/config/providers",
            ...options,
            ...params,
        });
    }
}
export class Console extends HeyApiClient {
    /**
     * Get active Console provider metadata
     *
     * Get the active Console org name and the set of provider IDs managed by that Console org.
     */
    get(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/experimental/console",
            ...options,
            ...params,
        });
    }
    /**
     * List switchable Console orgs
     *
     * Get the available Console orgs across logged-in accounts, including the current active org.
     */
    listOrgs(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/experimental/console/orgs",
            ...options,
            ...params,
        });
    }
    /**
     * Switch active Console org
     *
     * Persist a new active Console account/org selection for the current local Kilo state.
     */
    switchOrg(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "body", key: "accountID" },
                    { in: "body", key: "orgID" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/experimental/console/switch",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
}
export class Session extends HeyApiClient {
    /**
     * List sessions
     *
     * Get a list of all Kilo sessions across projects, sorted by most recently updated. Archived sessions are excluded by default.
     */
    list(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "query", key: "projectID" },
                    { in: "query", key: "worktrees" },
                    { in: "query", key: "roots" },
                    { in: "query", key: "start" },
                    { in: "query", key: "cursor" },
                    { in: "query", key: "search" },
                    { in: "query", key: "limit" },
                    { in: "query", key: "archived" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/experimental/session",
            ...options,
            ...params,
        });
    }
}
export class Resource extends HeyApiClient {
    /**
     * Get MCP resources
     *
     * Get all available MCP resources from connected servers. Optionally filter by name.
     */
    list(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/experimental/resource",
            ...options,
            ...params,
        });
    }
}
export class Adapter extends HeyApiClient {
    /**
     * List workspace adapters
     *
     * List all available workspace adapters for the current project.
     */
    list(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/experimental/workspace/adapter",
            ...options,
            ...params,
        });
    }
}
export class Workspace extends HeyApiClient {
    /**
     * List workspaces
     *
     * List all workspaces.
     */
    list(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/experimental/workspace",
            ...options,
            ...params,
        });
    }
    /**
     * Create workspace
     *
     * Create a workspace for the current project.
     */
    create(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "body", key: "id" },
                    { in: "body", key: "type" },
                    { in: "body", key: "branch" },
                    { in: "body", key: "extra" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/experimental/workspace",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
    /**
     * Workspace status
     *
     * Get connection status for workspaces in the current project.
     */
    status(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/experimental/workspace/status",
            ...options,
            ...params,
        });
    }
    /**
     * Remove workspace
     *
     * Remove an existing workspace.
     */
    remove(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "id" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).delete({
            url: "/experimental/workspace/{id}",
            ...options,
            ...params,
        });
    }
    /**
     * Warp session into workspace
     *
     * Move a session's sync history into the target workspace, or detach it to the local project.
     */
    warp(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "body", key: "id" },
                    { in: "body", key: "sessionID" },
                    { in: "body", key: "copyChanges" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/experimental/workspace/warp",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
    _adapter;
    get adapter() {
        return (this._adapter ??= new Adapter({ client: this.client }));
    }
}
export class Experimental extends HeyApiClient {
    _console;
    get console() {
        return (this._console ??= new Console({ client: this.client }));
    }
    _session;
    get session() {
        return (this._session ??= new Session({ client: this.client }));
    }
    _resource;
    get resource() {
        return (this._resource ??= new Resource({ client: this.client }));
    }
    _workspace;
    get workspace() {
        return (this._workspace ??= new Workspace({ client: this.client }));
    }
}
export class Tool extends HeyApiClient {
    /**
     * List tools
     *
     * Get a list of available tools with their JSON schema parameters for a specific provider and model combination.
     */
    list(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "query", key: "provider" },
                    { in: "query", key: "model" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/experimental/tool",
            ...options,
            ...params,
        });
    }
    /**
     * List tool IDs
     *
     * Get a list of all available tool IDs, including both built-in tools and dynamically registered tools.
     */
    ids(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/experimental/tool/ids",
            ...options,
            ...params,
        });
    }
}
export class Worktree extends HeyApiClient {
    /**
     * Remove worktree
     *
     * Remove a git worktree and delete its branch.
     */
    remove(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { key: "worktreeRemoveInput", map: "body" },
                ],
            },
        ]);
        return (options?.client ?? this.client).delete({
            url: "/experimental/worktree",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
    /**
     * List worktrees
     *
     * List all sandbox worktrees for the current project.
     */
    list(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/experimental/worktree",
            ...options,
            ...params,
        });
    }
    /**
     * Create worktree
     *
     * Create a new git worktree for the current project and run any configured startup scripts.
     */
    create(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { key: "worktreeCreateInput", map: "body" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/experimental/worktree",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
    /**
     * Reset worktree
     *
     * Reset a worktree branch to the primary default branch.
     */
    reset(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { key: "worktreeResetInput", map: "body" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/experimental/worktree/reset",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
    /**
     * Get worktree diff
     *
     * Get file diffs for a worktree compared to its base branch. Includes uncommitted changes.
     */
    diff(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "query", key: "base" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/experimental/worktree/diff",
            ...options,
            ...params,
        });
    }
    /**
     * Get worktree diff summary
     *
     * Get lightweight file diff metadata for a worktree compared to its base branch.
     */
    diffSummary(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "query", key: "base" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/experimental/worktree/diff/summary",
            ...options,
            ...params,
        });
    }
    /**
     * Get worktree diff detail
     *
     * Get full diff contents for one worktree file compared to its base branch.
     */
    diffFile(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "query", key: "base" },
                    { in: "query", key: "file" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/experimental/worktree/diff/file",
            ...options,
            ...params,
        });
    }
}
export class Find extends HeyApiClient {
    /**
     * Find text
     *
     * Search for text patterns across files in the project using ripgrep.
     */
    text(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "query", key: "pattern" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/find",
            ...options,
            ...params,
        });
    }
    /**
     * Find files
     *
     * Search for files or directories by name or pattern in the project directory.
     */
    files(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "query", key: "query" },
                    { in: "query", key: "dirs" },
                    { in: "query", key: "type" },
                    { in: "query", key: "limit" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/find/file",
            ...options,
            ...params,
        });
    }
    /**
     * Find symbols
     *
     * Search for workspace symbols like functions, classes, and variables using LSP.
     */
    symbols(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "query", key: "query" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/find/symbol",
            ...options,
            ...params,
        });
    }
}
export class File extends HeyApiClient {
    /**
     * List files
     *
     * List files and directories in a specified path.
     */
    list(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "query", key: "path" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/file",
            ...options,
            ...params,
        });
    }
    /**
     * Read file
     *
     * Read the content of a specified file.
     */
    read(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "query", key: "path" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/file/content",
            ...options,
            ...params,
        });
    }
    /**
     * Get file status
     *
     * Get the git status of all files in the project.
     */
    status(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/file/status",
            ...options,
            ...params,
        });
    }
}
export class Instance extends HeyApiClient {
    /**
     * Dispose instance
     *
     * Clean up and dispose the current Kilo instance, releasing all resources.
     */
    dispose(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/instance/dispose",
            ...options,
            ...params,
        });
    }
}
export class Path extends HeyApiClient {
    /**
     * Get paths
     *
     * Retrieve the current working directory and related path information for the Kilo instance.
     */
    get(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/path",
            ...options,
            ...params,
        });
    }
}
export class Diff extends HeyApiClient {
    /**
     * Get raw VCS diff
     *
     * Retrieve a raw patch for current uncommitted changes.
     */
    raw(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/vcs/diff/raw",
            ...options,
            ...params,
        });
    }
}
export class Vcs extends HeyApiClient {
    /**
     * Get VCS info
     *
     * Retrieve version control system (VCS) information for the current project, such as git branch.
     */
    get(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/vcs",
            ...options,
            ...params,
        });
    }
    /**
     * Get VCS status
     *
     * Retrieve changed files in the current working tree without patches.
     */
    status(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/vcs/status",
            ...options,
            ...params,
        });
    }
    /**
     * Get VCS diff
     *
     * Retrieve the current git diff for the working tree or against the default branch.
     */
    diff(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "query", key: "mode" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/vcs/diff",
            ...options,
            ...params,
        });
    }
    /**
     * Apply VCS patch
     *
     * Apply a raw patch to the current working tree.
     */
    apply(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "body", key: "patch" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/vcs/apply",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
    _diff;
    get diff2() {
        return (this._diff ??= new Diff({ client: this.client }));
    }
}
export class Command extends HeyApiClient {
    /**
     * List commands
     *
     * Get a list of all available commands in the Kilo system.
     */
    list(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/command",
            ...options,
            ...params,
        });
    }
}
export class Lsp extends HeyApiClient {
    /**
     * Get LSP status
     *
     * Get LSP server status
     */
    status(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/lsp",
            ...options,
            ...params,
        });
    }
}
export class Formatter extends HeyApiClient {
    /**
     * Get formatter status
     *
     * Get formatter status
     */
    status(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/formatter",
            ...options,
            ...params,
        });
    }
}
export class Auth2 extends HeyApiClient {
    /**
     * Remove MCP OAuth
     *
     * Remove OAuth credentials for an MCP server.
     */
    remove(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "name" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).delete({
            url: "/mcp/{name}/auth",
            ...options,
            ...params,
        });
    }
    /**
     * Start MCP OAuth
     *
     * Start OAuth authentication flow for a Model Context Protocol (MCP) server.
     */
    start(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "name" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/mcp/{name}/auth",
            ...options,
            ...params,
        });
    }
    /**
     * Complete MCP OAuth
     *
     * Complete OAuth authentication for a Model Context Protocol (MCP) server using the authorization code.
     */
    callback(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "name" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "body", key: "code" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/mcp/{name}/auth/callback",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
    /**
     * Authenticate MCP OAuth
     *
     * Start OAuth flow and wait for callback (opens browser).
     */
    authenticate(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "name" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/mcp/{name}/auth/authenticate",
            ...options,
            ...params,
        });
    }
}
export class Mcp extends HeyApiClient {
    /**
     * Get MCP status
     *
     * Get the status of all Model Context Protocol (MCP) servers.
     */
    status(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/mcp",
            ...options,
            ...params,
        });
    }
    /**
     * Add MCP server
     *
     * Dynamically add a new Model Context Protocol (MCP) server to the system.
     */
    add(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "body", key: "name" },
                    { in: "body", key: "config" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/mcp",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
    /**
     * Connect an MCP server.
     */
    connect(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "name" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/mcp/{name}/connect",
            ...options,
            ...params,
        });
    }
    /**
     * Disconnect an MCP server.
     */
    disconnect(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "name" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/mcp/{name}/disconnect",
            ...options,
            ...params,
        });
    }
    _auth;
    get auth() {
        return (this._auth ??= new Auth2({ client: this.client }));
    }
}
export class Project extends HeyApiClient {
    /**
     * List all projects
     *
     * Get a list of projects that have been opened with Kilo.
     */
    list(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/project",
            ...options,
            ...params,
        });
    }
    /**
     * Get current project
     *
     * Retrieve the currently active project that Kilo is working with.
     */
    current(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/project/current",
            ...options,
            ...params,
        });
    }
    /**
     * Initialize git repository
     *
     * Create a git repository for the current project and return the refreshed project info.
     */
    initGit(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/project/git/init",
            ...options,
            ...params,
        });
    }
    /**
     * Update project
     *
     * Update project properties such as name, icon, and commands.
     */
    update(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "projectID" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "body", key: "name" },
                    { in: "body", key: "icon" },
                    { in: "body", key: "commands" },
                ],
            },
        ]);
        return (options?.client ?? this.client).patch({
            url: "/project/{projectID}",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
}
export class Pty extends HeyApiClient {
    /**
     * List available shells
     *
     * Get a list of available shells on the system.
     */
    shells(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/pty/shells",
            ...options,
            ...params,
        });
    }
    /**
     * List PTY sessions
     *
     * Get a list of all active pseudo-terminal (PTY) sessions managed by Kilo.
     */
    list(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/pty",
            ...options,
            ...params,
        });
    }
    /**
     * Create PTY session
     *
     * Create a new pseudo-terminal (PTY) session for running shell commands and processes.
     */
    create(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "body", key: "command" },
                    { in: "body", key: "args" },
                    { in: "body", key: "cwd" },
                    { in: "body", key: "title" },
                    { in: "body", key: "env" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/pty",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
    /**
     * Remove PTY session
     *
     * Remove and terminate a specific pseudo-terminal (PTY) session.
     */
    remove(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "ptyID" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).delete({
            url: "/pty/{ptyID}",
            ...options,
            ...params,
        });
    }
    /**
     * Get PTY session
     *
     * Retrieve detailed information about a specific pseudo-terminal (PTY) session.
     */
    get(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "ptyID" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/pty/{ptyID}",
            ...options,
            ...params,
        });
    }
    /**
     * Update PTY session
     *
     * Update properties of an existing pseudo-terminal (PTY) session.
     */
    update(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "ptyID" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "body", key: "title" },
                    { in: "body", key: "size" },
                ],
            },
        ]);
        return (options?.client ?? this.client).put({
            url: "/pty/{ptyID}",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
    /**
     * Create PTY WebSocket token
     *
     * Create a short-lived ticket for opening a PTY WebSocket connection.
     */
    connectToken(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "ptyID" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/pty/{ptyID}/connect-token",
            ...options,
            ...params,
        });
    }
    /**
     * Connect to PTY session
     *
     * Establish a WebSocket connection to interact with a pseudo-terminal (PTY) session in real-time.
     */
    connect(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "ptyID" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/pty/{ptyID}/connect",
            ...options,
            ...params,
        });
    }
}
export class Question extends HeyApiClient {
    /**
     * List pending questions
     *
     * Get all pending question requests across all sessions.
     */
    list(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/question",
            ...options,
            ...params,
        });
    }
    /**
     * Reply to question request
     *
     * Provide answers to a question request from the AI assistant.
     */
    reply(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "requestID" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "body", key: "answers" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/question/{requestID}/reply",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
    /**
     * Reject question request
     *
     * Reject a question request from the AI assistant.
     */
    reject(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "requestID" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/question/{requestID}/reject",
            ...options,
            ...params,
        });
    }
}
export class Permission extends HeyApiClient {
    /**
     * List pending permissions
     *
     * Get all pending permission requests across all sessions.
     */
    list(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/permission",
            ...options,
            ...params,
        });
    }
    /**
     * Respond to permission request
     *
     * Approve or deny a permission request from the AI assistant.
     */
    reply(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "requestID" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "body", key: "reply" },
                    { in: "body", key: "message" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/permission/{requestID}/reply",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
    /**
     * Save always-allow/deny permission rules
     *
     * Save approved/denied always-rules for a pending permission request.
     */
    saveAlwaysRules(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "requestID" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "body", key: "approvedAlways" },
                    { in: "body", key: "deniedAlways" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/permission/{requestID}/always-rules",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
    /**
     * Allow everything
     *
     * Enable or disable allowing all permissions without prompts.
     */
    allowEverything(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "body", key: "enable" },
                    { in: "body", key: "requestID" },
                    { in: "body", key: "sessionID" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/permission/allow-everything",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
    /**
     * Respond to permission
     *
     * Approve or deny a permission request from the AI assistant.
     *
     * @deprecated
     */
    respond(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "sessionID" },
                    { in: "path", key: "permissionID" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "body", key: "response" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/session/{sessionID}/permissions/{permissionID}",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
}
export class Oauth extends HeyApiClient {
    /**
     * Start OAuth authorization
     *
     * Start the OAuth authorization flow for a provider.
     */
    authorize(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "providerID" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "body", key: "method" },
                    { in: "body", key: "inputs" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/provider/{providerID}/oauth/authorize",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
    /**
     * Handle OAuth callback
     *
     * Handle the OAuth callback from a provider after user authorization.
     */
    callback(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "providerID" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "body", key: "method" },
                    { in: "body", key: "code" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/provider/{providerID}/oauth/callback",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
}
export class Provider extends HeyApiClient {
    /**
     * List providers
     *
     * Get a list of all available AI providers, including both available and connected ones.
     */
    list(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/provider",
            ...options,
            ...params,
        });
    }
    /**
     * Get provider auth methods
     *
     * Retrieve available authentication methods for all AI providers.
     */
    auth(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/provider/auth",
            ...options,
            ...params,
        });
    }
    _oauth;
    get oauth() {
        return (this._oauth ??= new Oauth({ client: this.client }));
    }
}
export class Session2 extends HeyApiClient {
    /**
     * List sessions
     *
     * Get a list of all Kilo sessions, sorted by most recently updated.
     */
    list(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "query", key: "scope" },
                    { in: "query", key: "path" },
                    { in: "query", key: "roots" },
                    { in: "query", key: "start" },
                    { in: "query", key: "search" },
                    { in: "query", key: "limit" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/session",
            ...options,
            ...params,
        });
    }
    /**
     * Create session
     *
     * Create a new Kilo session for interacting with AI assistants and managing conversations.
     */
    create(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "body", key: "parentID" },
                    { in: "body", key: "title" },
                    { in: "body", key: "agent" },
                    { in: "body", key: "model" },
                    { in: "body", key: "permission" },
                    { in: "body", key: "platform" },
                    { in: "body", key: "workspaceID" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/session",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
    /**
     * Get session status
     *
     * Retrieve the current status of all sessions, including active, idle, and completed states.
     */
    status(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/session/status",
            ...options,
            ...params,
        });
    }
    /**
     * Delete session
     *
     * Delete a session and permanently remove all associated data, including messages and history.
     */
    delete(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "sessionID" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).delete({
            url: "/session/{sessionID}",
            ...options,
            ...params,
        });
    }
    /**
     * Get session
     *
     * Retrieve detailed information about a specific Kilo session.
     */
    get(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "sessionID" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/session/{sessionID}",
            ...options,
            ...params,
        });
    }
    /**
     * Update session
     *
     * Update properties of an existing session, such as title or other metadata.
     */
    update(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "sessionID" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "body", key: "title" },
                    { in: "body", key: "permission" },
                    { in: "body", key: "time" },
                ],
            },
        ]);
        return (options?.client ?? this.client).patch({
            url: "/session/{sessionID}",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
    /**
     * Get session children
     *
     * Retrieve all child sessions that were forked from the specified parent session.
     */
    children(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "sessionID" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/session/{sessionID}/children",
            ...options,
            ...params,
        });
    }
    /**
     * Get session todos
     *
     * Retrieve the todo list associated with a specific session, showing tasks and action items.
     */
    todo(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "sessionID" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/session/{sessionID}/todo",
            ...options,
            ...params,
        });
    }
    /**
     * Get message diff
     *
     * Get the file changes (diff) that resulted from a specific user message in the session.
     */
    diff(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "sessionID" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "query", key: "messageID" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/session/{sessionID}/diff",
            ...options,
            ...params,
        });
    }
    /**
     * Get session messages
     *
     * Retrieve all messages in a session, including user prompts and AI responses.
     */
    messages(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "sessionID" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "query", key: "limit" },
                    { in: "query", key: "before" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/session/{sessionID}/message",
            ...options,
            ...params,
        });
    }
    /**
     * Send message
     *
     * Create and send a new message to a session, streaming the AI response.
     */
    prompt(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "sessionID" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "body", key: "messageID" },
                    { in: "body", key: "model" },
                    { in: "body", key: "agent" },
                    { in: "body", key: "noReply" },
                    { in: "body", key: "tools" },
                    { in: "body", key: "format" },
                    { in: "body", key: "system" },
                    { in: "body", key: "variant" },
                    { in: "body", key: "editorContext" },
                    { in: "body", key: "parts" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/session/{sessionID}/message",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
    /**
     * Delete message
     *
     * Permanently delete a specific message and all of its parts from a session without reverting file changes.
     */
    deleteMessage(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "sessionID" },
                    { in: "path", key: "messageID" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).delete({
            url: "/session/{sessionID}/message/{messageID}",
            ...options,
            ...params,
        });
    }
    /**
     * Get message
     *
     * Retrieve a specific message from a session by its message ID.
     */
    message(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "sessionID" },
                    { in: "path", key: "messageID" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/session/{sessionID}/message/{messageID}",
            ...options,
            ...params,
        });
    }
    /**
     * Fork session
     *
     * Create a new session by forking an existing session at a specific message point.
     */
    fork(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "sessionID" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "body", key: "messageID" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/session/{sessionID}/fork",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
    /**
     * Abort session
     *
     * Abort an active session and stop any ongoing AI processing or command execution.
     */
    abort(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "sessionID" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/session/{sessionID}/abort",
            ...options,
            ...params,
        });
    }
    /**
     * Initialize session
     *
     * Analyze the current application and create an AGENTS.md file with project-specific agent configurations.
     */
    init(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "sessionID" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "body", key: "modelID" },
                    { in: "body", key: "providerID" },
                    { in: "body", key: "messageID" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/session/{sessionID}/init",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
    /**
     * Unshare session
     *
     * Remove the shareable link for a session, making it private again.
     */
    unshare(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "sessionID" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).delete({
            url: "/session/{sessionID}/share",
            ...options,
            ...params,
        });
    }
    /**
     * Share session
     *
     * Create a shareable link for a session, allowing others to view the conversation.
     */
    share(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "sessionID" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/session/{sessionID}/share",
            ...options,
            ...params,
        });
    }
    /**
     * Summarize session
     *
     * Generate a concise summary of the session using AI compaction to preserve key information.
     */
    summarize(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "sessionID" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "body", key: "providerID" },
                    { in: "body", key: "modelID" },
                    { in: "body", key: "auto" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/session/{sessionID}/summarize",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
    /**
     * Send async message
     *
     * Create and send a new message to a session asynchronously, starting the session if needed and returning immediately.
     */
    promptAsync(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "sessionID" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "body", key: "messageID" },
                    { in: "body", key: "model" },
                    { in: "body", key: "agent" },
                    { in: "body", key: "noReply" },
                    { in: "body", key: "tools" },
                    { in: "body", key: "format" },
                    { in: "body", key: "system" },
                    { in: "body", key: "variant" },
                    { in: "body", key: "editorContext" },
                    { in: "body", key: "parts" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/session/{sessionID}/prompt_async",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
    /**
     * Send command
     *
     * Send a new command to a session for execution by the AI assistant.
     */
    command(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "sessionID" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "body", key: "messageID" },
                    { in: "body", key: "agent" },
                    { in: "body", key: "model" },
                    { in: "body", key: "arguments" },
                    { in: "body", key: "command" },
                    { in: "body", key: "variant" },
                    { in: "body", key: "parts" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/session/{sessionID}/command",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
    /**
     * Run shell command
     *
     * Execute a shell command within the session context and return the AI's response.
     */
    shell(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "sessionID" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "body", key: "messageID" },
                    { in: "body", key: "agent" },
                    { in: "body", key: "model" },
                    { in: "body", key: "command" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/session/{sessionID}/shell",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
    /**
     * Revert message
     *
     * Revert a specific message in a session, undoing its effects and restoring the previous state.
     */
    revert(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "sessionID" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "body", key: "messageID" },
                    { in: "body", key: "partID" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/session/{sessionID}/revert",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
    /**
     * Restore reverted messages
     *
     * Restore all previously reverted messages in a session.
     */
    unrevert(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "sessionID" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/session/{sessionID}/unrevert",
            ...options,
            ...params,
        });
    }
    /**
     * Set viewed sessions
     *
     * Notify the server which sessions the user is currently viewing, or clear all.
     */
    viewed(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "body", key: "focused" },
                    { in: "body", key: "open" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/session/viewed",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
}
export class Part extends HeyApiClient {
    /**
     * Delete a part from a message.
     */
    delete(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "sessionID" },
                    { in: "path", key: "messageID" },
                    { in: "path", key: "partID" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).delete({
            url: "/session/{sessionID}/message/{messageID}/part/{partID}",
            ...options,
            ...params,
        });
    }
    /**
     * Update a part in a message.
     */
    update(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "sessionID" },
                    { in: "path", key: "messageID" },
                    { in: "path", key: "partID" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { key: "part", map: "body" },
                ],
            },
        ]);
        return (options?.client ?? this.client).patch({
            url: "/session/{sessionID}/message/{messageID}/part/{partID}",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
}
export class History extends HeyApiClient {
    /**
     * List sync events
     *
     * List sync events for all aggregates. Keys are aggregate IDs the client already knows about, values are the last known sequence ID. Events with seq > value are returned for those aggregates. Aggregates not listed in the input get their full history.
     */
    list(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { key: "body", map: "body" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/sync/history",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
}
export class Sync extends HeyApiClient {
    /**
     * Start workspace sync
     *
     * Start sync loops for workspaces in the current project that have active sessions.
     */
    start(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/sync/start",
            ...options,
            ...params,
        });
    }
    /**
     * Replay sync events
     *
     * Validate and replay a complete sync event history.
     */
    replay(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    {
                        in: "query",
                        key: "query_directory",
                        map: "directory",
                    },
                    { in: "query", key: "workspace" },
                    {
                        in: "body",
                        key: "body_directory",
                        map: "directory",
                    },
                    { in: "body", key: "events" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/sync/replay",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
    /**
     * Steal session into workspace
     *
     * Update a session to belong to the current workspace through the sync event system.
     */
    steal(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "body", key: "sessionID" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/sync/steal",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
    _history;
    get history() {
        return (this._history ??= new History({ client: this.client }));
    }
}
export class Session3 extends HeyApiClient {
    /**
     * List v2 sessions
     *
     * Retrieve sessions in the requested order. Items keep that order across pages; use cursor.next or cursor.previous to move through the ordered list.
     */
    list(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/api/session",
            ...options,
            ...params,
        });
    }
    /**
     * Send v2 message
     *
     * Create a v2 session message and queue it for the agent loop.
     */
    prompt(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "sessionID" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "body", key: "prompt" },
                    { in: "body", key: "delivery" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/api/session/{sessionID}/prompt",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
    /**
     * Compact v2 session
     *
     * Compact a v2 session conversation.
     */
    compact(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "sessionID" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/api/session/{sessionID}/compact",
            ...options,
            ...params,
        });
    }
    /**
     * Wait for v2 session
     *
     * Wait for a v2 session agent loop to become idle.
     */
    wait(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "sessionID" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/api/session/{sessionID}/wait",
            ...options,
            ...params,
        });
    }
    /**
     * Get v2 session context
     *
     * Retrieve the active context messages for a v2 session (all messages after the last compaction).
     */
    context(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "sessionID" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/api/session/{sessionID}/context",
            ...options,
            ...params,
        });
    }
    /**
     * Get v2 session messages
     *
     * Retrieve projected v2 messages for a session. Items keep the requested order across pages; use cursor.next or cursor.previous to move through the ordered timeline.
     */
    messages(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "sessionID" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/api/session/{sessionID}/message",
            ...options,
            ...params,
        });
    }
}
export class V2 extends HeyApiClient {
    _session;
    get session() {
        return (this._session ??= new Session3({ client: this.client }));
    }
}
export class Control extends HeyApiClient {
    /**
     * Get next TUI request
     *
     * Retrieve the next TUI request from the queue for processing.
     */
    next(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/tui/control/next",
            ...options,
            ...params,
        });
    }
    /**
     * Submit TUI response
     *
     * Submit a response to the TUI request queue to complete a pending request.
     */
    response(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { key: "body", map: "body" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/tui/control/response",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
}
export class Tui extends HeyApiClient {
    /**
     * Append TUI prompt
     *
     * Append prompt to the TUI.
     */
    appendPrompt(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "body", key: "text" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/tui/append-prompt",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
    /**
     * Open help dialog
     *
     * Open the help dialog in the TUI to display user assistance information.
     */
    openHelp(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/tui/open-help",
            ...options,
            ...params,
        });
    }
    /**
     * Open sessions dialog
     *
     * Open the session dialog.
     */
    openSessions(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/tui/open-sessions",
            ...options,
            ...params,
        });
    }
    /**
     * Open themes dialog
     *
     * Open the theme dialog.
     */
    openThemes(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/tui/open-themes",
            ...options,
            ...params,
        });
    }
    /**
     * Open models dialog
     *
     * Open the model dialog.
     */
    openModels(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/tui/open-models",
            ...options,
            ...params,
        });
    }
    /**
     * Submit TUI prompt
     *
     * Submit the prompt.
     */
    submitPrompt(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/tui/submit-prompt",
            ...options,
            ...params,
        });
    }
    /**
     * Clear TUI prompt
     *
     * Clear the prompt.
     */
    clearPrompt(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/tui/clear-prompt",
            ...options,
            ...params,
        });
    }
    /**
     * Execute TUI command
     *
     * Execute a TUI command.
     */
    executeCommand(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "body", key: "command" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/tui/execute-command",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
    /**
     * Show TUI toast
     *
     * Show a toast notification in the TUI.
     */
    showToast(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "body", key: "title" },
                    { in: "body", key: "message" },
                    { in: "body", key: "variant" },
                    { in: "body", key: "duration" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/tui/show-toast",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
    /**
     * Publish TUI event
     *
     * Publish a TUI event.
     */
    publish(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { key: "body", map: "body" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/tui/publish",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
    /**
     * Select session
     *
     * Navigate the TUI to display the specified session.
     */
    selectSession(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "body", key: "sessionID" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/tui/select-session",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
    _control;
    get control() {
        return (this._control ??= new Control({ client: this.client }));
    }
}
export class BackgroundProcess extends HeyApiClient {
    /**
     * List background processes
     *
     * List tracked background processes for the current instance.
     */
    list(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/background-process",
            ...options,
            ...params,
        });
    }
    /**
     * Get background process
     *
     * Get status and retained output for one background process.
     */
    get(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "processID" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/background-process/{processID}",
            ...options,
            ...params,
        });
    }
    /**
     * Get background process logs
     *
     * Get the retained output tail for one background process.
     */
    logs(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "processID" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/background-process/{processID}/logs",
            ...options,
            ...params,
        });
    }
    /**
     * Stop background process
     *
     * Terminate a background process and its child process tree.
     */
    stop(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "processID" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/background-process/{processID}/stop",
            ...options,
            ...params,
        });
    }
    /**
     * Restart background process
     *
     * Stop and restart a background process with its original command.
     */
    restart(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "processID" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/background-process/{processID}/restart",
            ...options,
            ...params,
        });
    }
    /**
     * Stop session background processes
     *
     * Terminate and forget all background processes associated with one session.
     */
    stopSession(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "sessionID" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/background-process/session/{sessionID}/stop",
            ...options,
            ...params,
        });
    }
}
export class CommitMessage extends HeyApiClient {
    /**
     * Generate commit message
     *
     * Generate a commit message using AI based on the current git diff.
     */
    generate(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "body", key: "path" },
                    { in: "body", key: "selectedFiles" },
                    { in: "body", key: "previousMessage" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/commit-message",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
}
export class EnhancePrompt extends HeyApiClient {
    /**
     * Enhance prompt
     *
     * Rewrite a user's draft prompt into a clearer, more specific, and more effective prompt.
     */
    enhance(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "body", key: "text" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/enhance-prompt",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
}
export class Indexing extends HeyApiClient {
    /**
     * Get indexing status
     *
     * Retrieve the current code indexing status for the active project.
     */
    status(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/indexing/status",
            ...options,
            ...params,
        });
    }
}
export class Audio extends HeyApiClient {
    /**
     * Speech to text transcription
     *
     * Proxy an audio transcription request to the Kilo Gateway
     */
    transcriptions(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "body", key: "model" },
                    { in: "body", key: "input_audio" },
                    { in: "body", key: "language" },
                    { in: "body", key: "temperature" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/kilo/audio/transcriptions",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
}
export class Organization extends HeyApiClient {
    /**
     * Update Kilo Gateway organization
     *
     * Switch to a different Kilo Gateway organization
     */
    set(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "body", key: "organizationId" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/kilo/organization",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
}
export class Claw extends HeyApiClient {
    /**
     * Get KiloClaw instance status
     *
     * Fetch the user's KiloClaw instance status via the KiloClaw worker
     */
    status(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/kilo/claw/status",
            ...options,
            ...params,
        });
    }
    /**
     * Get KiloClaw chat credentials
     *
     * Returns the bearer token and endpoint URLs the client uses to talk to the Kilo Chat worker and the Event Service. The bearer is the user's existing long-lived Kilo JWT — kilo-chat and event-service both verify it directly with NEXTAUTH_SECRET, so no separate token mint is needed.
     */
    chatCredentials(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/kilo/claw/chat-credentials",
            ...options,
            ...params,
        });
    }
}
export class Session4 extends HeyApiClient {
    /**
     * Get cloud session
     *
     * Fetch full session data from the Kilo cloud for preview
     */
    get(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "id" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/kilo/cloud/session/{id}",
            ...options,
            ...params,
        });
    }
    /**
     * Import session from cloud
     *
     * Download a cloud-synced session and write it to local storage with fresh IDs.
     */
    import(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "body", key: "sessionId" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/kilo/cloud/session/import",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
}
export class Cloud extends HeyApiClient {
    _session;
    get session() {
        return (this._session ??= new Session4({ client: this.client }));
    }
}
export class Kilo extends HeyApiClient {
    /**
     * Get Kilo Gateway profile
     *
     * Fetch user profile and organizations from Kilo Gateway
     */
    profile(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/kilo/profile",
            ...options,
            ...params,
        });
    }
    /**
     * Get organization custom modes
     *
     * Fetch custom modes defined for the current organization
     */
    modes(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/kilo/modes",
            ...options,
            ...params,
        });
    }
    /**
     * FIM completion
     *
     * Proxy a Fill-in-the-Middle completion request to the Kilo Gateway
     */
    fim(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "body", key: "prefix" },
                    { in: "body", key: "suffix" },
                    { in: "body", key: "provider" },
                    { in: "body", key: "model" },
                    { in: "body", key: "maxTokens" },
                    { in: "body", key: "temperature" },
                ],
            },
        ]);
        return (options?.client ?? this.client).sse.post({
            url: "/kilo/fim",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
    /**
     * Next Edit completion
     *
     * Proxy a Mercury-style Next Edit request. The client supplies structured editor context; the gateway assembles the sentinel-tagged prompt and forwards to the upstream edit endpoint.
     */
    edit(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "body", key: "provider" },
                    { in: "body", key: "model" },
                    { in: "body", key: "maxTokens" },
                    { in: "body", key: "currentFilePath" },
                    { in: "body", key: "currentFileContent" },
                    { in: "body", key: "cursorLine" },
                    { in: "body", key: "cursorCharacter" },
                    { in: "body", key: "editableRegionStartLine" },
                    { in: "body", key: "editableRegionEndLine" },
                    { in: "body", key: "recentlyViewedSnippets" },
                    { in: "body", key: "editDiffHistory" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/kilo/edit",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
    /**
     * Get Kilo notifications
     *
     * Fetch notifications from Kilo Gateway for CLI display
     */
    notifications(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/kilo/notifications",
            ...options,
            ...params,
        });
    }
    /**
     * Get cloud sessions
     *
     * Fetch cloud CLI sessions from Kilo API
     */
    cloudSessions(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "query", key: "cursor" },
                    { in: "query", key: "limit" },
                    { in: "query", key: "gitUrl" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/kilo/cloud-sessions",
            ...options,
            ...params,
        });
    }
    _audio;
    get audio() {
        return (this._audio ??= new Audio({ client: this.client }));
    }
    _organization;
    get organization() {
        return (this._organization ??= new Organization({ client: this.client }));
    }
    _claw;
    get claw() {
        return (this._claw ??= new Claw({ client: this.client }));
    }
    _cloud;
    get cloud() {
        return (this._cloud ??= new Cloud({ client: this.client }));
    }
}
export class Heap extends HeyApiClient {
    /**
     * Write heap snapshot
     *
     * Write a heap snapshot for the CLI process to the log directory.
     */
    snapshot(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/kilocode/heap/snapshot",
            ...options,
            ...params,
        });
    }
}
export class SessionImport extends HeyApiClient {
    /**
     * Insert project for session import
     *
     * Insert or update a project row used by legacy session import.
     */
    project(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "body", key: "id" },
                    { in: "body", key: "worktree" },
                    { in: "body", key: "vcs" },
                    { in: "body", key: "name" },
                    { in: "body", key: "iconUrl" },
                    { in: "body", key: "iconColor" },
                    { in: "body", key: "timeCreated" },
                    { in: "body", key: "timeUpdated" },
                    { in: "body", key: "timeInitialized" },
                    { in: "body", key: "sandboxes" },
                    { in: "body", key: "commands" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/kilocode/session-import/project",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
    /**
     * Insert session for session import
     *
     * Insert or update a session row used by legacy session import.
     */
    session(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    {
                        in: "query",
                        key: "query_directory",
                        map: "directory",
                    },
                    { in: "query", key: "workspace" },
                    { in: "body", key: "id" },
                    { in: "body", key: "projectID" },
                    { in: "body", key: "force" },
                    { in: "body", key: "workspaceID" },
                    { in: "body", key: "parentID" },
                    { in: "body", key: "slug" },
                    {
                        in: "body",
                        key: "body_directory",
                        map: "directory",
                    },
                    { in: "body", key: "title" },
                    { in: "body", key: "version" },
                    { in: "body", key: "shareURL" },
                    { in: "body", key: "summary" },
                    { in: "body", key: "revert" },
                    { in: "body", key: "permission" },
                    { in: "body", key: "timeCreated" },
                    { in: "body", key: "timeUpdated" },
                    { in: "body", key: "timeCompacting" },
                    { in: "body", key: "timeArchived" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/kilocode/session-import/session",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
    /**
     * Insert message for session import
     *
     * Insert or update a message row used by legacy session import.
     */
    message(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "body", key: "id" },
                    { in: "body", key: "sessionID" },
                    { in: "body", key: "timeCreated" },
                    { in: "body", key: "data" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/kilocode/session-import/message",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
    /**
     * Insert part for session import
     *
     * Insert or update a part row used by legacy session import.
     */
    part(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "body", key: "id" },
                    { in: "body", key: "messageID" },
                    { in: "body", key: "sessionID" },
                    { in: "body", key: "timeCreated" },
                    { in: "body", key: "data" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/kilocode/session-import/part",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
}
export class Kilocode extends HeyApiClient {
    /**
     * Remove a skill
     *
     * Remove a skill by deleting its directory from disk and clearing it from cache.
     */
    removeSkill(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "body", key: "location" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/kilocode/skill/remove",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
    /**
     * Remove a custom agent
     *
     * Remove a custom (non-native) agent by deleting its markdown file from disk and refreshing state.
     */
    removeAgent(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "body", key: "name" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/kilocode/agent/remove",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
    _heap;
    get heap() {
        return (this._heap ??= new Heap({ client: this.client }));
    }
    _sessionImport;
    get sessionImport() {
        return (this._sessionImport ??= new SessionImport({ client: this.client }));
    }
}
export class Network extends HeyApiClient {
    /**
     * List pending network waits
     *
     * Get all pending network reconnect requests across all sessions.
     */
    list(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/network",
            ...options,
            ...params,
        });
    }
    /**
     * Resume after network wait
     *
     * Resume a pending session after reconnecting network-dependent services.
     */
    reply(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "requestID" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/network/{requestID}/reply",
            ...options,
            ...params,
        });
    }
    /**
     * Reject network resume request
     *
     * Stop a pending session instead of resuming after network reconnect.
     */
    reject(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "requestID" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/network/{requestID}/reject",
            ...options,
            ...params,
        });
    }
}
export class Remote extends HeyApiClient {
    /**
     * Enable remote connection
     *
     * Enable WebSocket connection to UserConnectionDO for real-time session relay and commands.
     */
    enable(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/remote/enable",
            ...options,
            ...params,
        });
    }
    /**
     * Disable remote connection
     *
     * Close the remote WebSocket connection to UserConnectionDO.
     */
    disable(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/remote/disable",
            ...options,
            ...params,
        });
    }
    /**
     * Get remote connection status
     *
     * Get the current state of the remote WebSocket connection.
     */
    status(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/remote/status",
            ...options,
            ...params,
        });
    }
}
export class Suggestion extends HeyApiClient {
    /**
     * List pending suggestions
     *
     * Get all pending suggestion requests across all sessions.
     */
    list(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).get({
            url: "/suggestion",
            ...options,
            ...params,
        });
    }
    /**
     * Accept suggestion request
     *
     * Accept a suggestion request from the AI assistant.
     */
    accept(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "requestID" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "body", key: "index" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/suggestion/{requestID}/accept",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
    /**
     * Dismiss suggestion request
     *
     * Dismiss a suggestion request from the AI assistant.
     */
    dismiss(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "path", key: "requestID" },
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/suggestion/{requestID}/dismiss",
            ...options,
            ...params,
        });
    }
}
export class Telemetry extends HeyApiClient {
    /**
     * Capture telemetry event
     *
     * Forward a telemetry event to PostHog via kilo-telemetry.
     */
    capture(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "body", key: "event" },
                    { in: "body", key: "properties" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/telemetry/capture",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
    /**
     * Set PostHog telemetry enabled state
     *
     * Update the PostHog client's opt-in/out state at runtime. The CLI reads KILO_TELEMETRY_LEVEL once at spawn — this route lets clients (e.g. the VS Code extension) propagate runtime telemetry consent changes.
     */
    setEnabled(parameters, options) {
        const params = buildClientParams([parameters], [
            {
                args: [
                    { in: "query", key: "directory" },
                    { in: "query", key: "workspace" },
                    { in: "body", key: "enabled" },
                ],
            },
        ]);
        return (options?.client ?? this.client).post({
            url: "/telemetry/setEnabled",
            ...options,
            ...params,
            headers: {
                "Content-Type": "application/json",
                ...options?.headers,
                ...params.headers,
            },
        });
    }
}
export class KiloClient extends HeyApiClient {
    static __registry = new HeyApiRegistry();
    constructor(args) {
        super(args);
        KiloClient.__registry.set(this, args?.key);
    }
    _auth;
    get auth() {
        return (this._auth ??= new Auth({ client: this.client }));
    }
    _app;
    get app() {
        return (this._app ??= new App({ client: this.client }));
    }
    _global;
    get global() {
        return (this._global ??= new Global({ client: this.client }));
    }
    _event;
    get event() {
        return (this._event ??= new Event({ client: this.client }));
    }
    _config;
    get config() {
        return (this._config ??= new Config2({ client: this.client }));
    }
    _experimental;
    get experimental() {
        return (this._experimental ??= new Experimental({ client: this.client }));
    }
    _tool;
    get tool() {
        return (this._tool ??= new Tool({ client: this.client }));
    }
    _worktree;
    get worktree() {
        return (this._worktree ??= new Worktree({ client: this.client }));
    }
    _find;
    get find() {
        return (this._find ??= new Find({ client: this.client }));
    }
    _file;
    get file() {
        return (this._file ??= new File({ client: this.client }));
    }
    _instance;
    get instance() {
        return (this._instance ??= new Instance({ client: this.client }));
    }
    _path;
    get path() {
        return (this._path ??= new Path({ client: this.client }));
    }
    _vcs;
    get vcs() {
        return (this._vcs ??= new Vcs({ client: this.client }));
    }
    _command;
    get command() {
        return (this._command ??= new Command({ client: this.client }));
    }
    _lsp;
    get lsp() {
        return (this._lsp ??= new Lsp({ client: this.client }));
    }
    _formatter;
    get formatter() {
        return (this._formatter ??= new Formatter({ client: this.client }));
    }
    _mcp;
    get mcp() {
        return (this._mcp ??= new Mcp({ client: this.client }));
    }
    _project;
    get project() {
        return (this._project ??= new Project({ client: this.client }));
    }
    _pty;
    get pty() {
        return (this._pty ??= new Pty({ client: this.client }));
    }
    _question;
    get question() {
        return (this._question ??= new Question({ client: this.client }));
    }
    _permission;
    get permission() {
        return (this._permission ??= new Permission({ client: this.client }));
    }
    _provider;
    get provider() {
        return (this._provider ??= new Provider({ client: this.client }));
    }
    _session;
    get session() {
        return (this._session ??= new Session2({ client: this.client }));
    }
    _part;
    get part() {
        return (this._part ??= new Part({ client: this.client }));
    }
    _sync;
    get sync() {
        return (this._sync ??= new Sync({ client: this.client }));
    }
    _v2;
    get v2() {
        return (this._v2 ??= new V2({ client: this.client }));
    }
    _tui;
    get tui() {
        return (this._tui ??= new Tui({ client: this.client }));
    }
    _backgroundProcess;
    get backgroundProcess() {
        return (this._backgroundProcess ??= new BackgroundProcess({ client: this.client }));
    }
    _commitMessage;
    get commitMessage() {
        return (this._commitMessage ??= new CommitMessage({ client: this.client }));
    }
    _enhancePrompt;
    get enhancePrompt() {
        return (this._enhancePrompt ??= new EnhancePrompt({ client: this.client }));
    }
    _indexing;
    get indexing() {
        return (this._indexing ??= new Indexing({ client: this.client }));
    }
    _kilo;
    get kilo() {
        return (this._kilo ??= new Kilo({ client: this.client }));
    }
    _kilocode;
    get kilocode() {
        return (this._kilocode ??= new Kilocode({ client: this.client }));
    }
    _network;
    get network() {
        return (this._network ??= new Network({ client: this.client }));
    }
    _remote;
    get remote() {
        return (this._remote ??= new Remote({ client: this.client }));
    }
    _suggestion;
    get suggestion() {
        return (this._suggestion ??= new Suggestion({ client: this.client }));
    }
    _telemetry;
    get telemetry() {
        return (this._telemetry ??= new Telemetry({ client: this.client }));
    }
}
