export const RPC_METHODS = {
    SPAWN_HAPPY_SESSION: 'spawn-happy-session',
    STOP_SESSION: 'stop-session',
    STOP_DAEMON: 'stop-daemon',
    DAEMON_EXECUTION_RUNS_LIST: 'daemon.executionRuns.list',
    DAEMON_TERMINAL_ENSURE: 'daemon.terminal.ensure',
    DAEMON_TERMINAL_STREAM_READ: 'daemon.terminal.stream.read',
    DAEMON_TERMINAL_INPUT: 'daemon.terminal.input',
    DAEMON_TERMINAL_RESIZE: 'daemon.terminal.resize',
    DAEMON_TERMINAL_CLOSE: 'daemon.terminal.close',
    DAEMON_TERMINAL_RESTART: 'daemon.terminal.restart',
    DAEMON_MEMORY_SEARCH: 'daemon.memory.search',
    DAEMON_MEMORY_GET_WINDOW: 'daemon.memory.getWindow',
    DAEMON_MEMORY_ENSURE_UP_TO_DATE: 'daemon.memory.ensureUpToDate',
    DAEMON_MEMORY_STATUS: 'daemon.memory.status',
    DAEMON_MEMORY_SETTINGS_GET: 'daemon.memory.settings.get',
    DAEMON_MEMORY_SETTINGS_SET: 'daemon.memory.settings.set',
    DAEMON_MCP_SERVERS_TEST: 'daemon.mcpServers.test',
    DAEMON_MCP_SERVERS_DETECT: 'daemon.mcpServers.detect',
    DAEMON_MCP_SERVERS_PREVIEW: 'daemon.mcpServers.preview',
    DAEMON_BULK_TRANSFER_UPLOAD_INIT: 'daemon.bulkTransfer.upload.init',
    DAEMON_BULK_TRANSFER_UPLOAD_CHUNK: 'daemon.bulkTransfer.upload.chunk',
    DAEMON_BULK_TRANSFER_UPLOAD_FINALIZE: 'daemon.bulkTransfer.upload.finalize',
    DAEMON_BULK_TRANSFER_UPLOAD_ABORT: 'daemon.bulkTransfer.upload.abort',
    DAEMON_BULK_TRANSFER_DOWNLOAD_INIT: 'daemon.bulkTransfer.download.init',
    DAEMON_BULK_TRANSFER_DOWNLOAD_CHUNK: 'daemon.bulkTransfer.download.chunk',
    DAEMON_BULK_TRANSFER_DOWNLOAD_FINALIZE: 'daemon.bulkTransfer.download.finalize',
    DAEMON_BULK_TRANSFER_DOWNLOAD_ABORT: 'daemon.bulkTransfer.download.abort',
    DAEMON_PROMPT_ASSETS_LIST_TYPES: 'daemon.promptAssets.listTypes',
    DAEMON_PROMPT_ASSETS_DISCOVER: 'daemon.promptAssets.discover',
    DAEMON_PROMPT_ASSETS_UPLOAD_INIT: 'daemon.promptAssets.upload.init',
    DAEMON_PROMPT_ASSETS_UPLOAD_CHUNK: 'daemon.promptAssets.upload.chunk',
    DAEMON_PROMPT_ASSETS_UPLOAD_FINALIZE: 'daemon.promptAssets.upload.finalize',
    DAEMON_PROMPT_ASSETS_UPLOAD_ABORT: 'daemon.promptAssets.upload.abort',
    DAEMON_PROMPT_ASSETS_DOWNLOAD_INIT: 'daemon.promptAssets.download.init',
    DAEMON_PROMPT_ASSETS_DOWNLOAD_CHUNK: 'daemon.promptAssets.download.chunk',
    DAEMON_PROMPT_ASSETS_DOWNLOAD_FINALIZE: 'daemon.promptAssets.download.finalize',
    DAEMON_PROMPT_ASSETS_DOWNLOAD_ABORT: 'daemon.promptAssets.download.abort',
    DAEMON_PROMPT_ASSETS_DELETE: 'daemon.promptAssets.delete',
    DAEMON_PROMPT_REGISTRY_LIST_ADAPTERS: 'daemon.promptRegistry.listAdapters',
    DAEMON_PROMPT_REGISTRY_LIST_SOURCES: 'daemon.promptRegistry.listSources',
    DAEMON_PROMPT_REGISTRY_SCAN_SOURCE: 'daemon.promptRegistry.scanSource',
    DAEMON_PROMPT_REGISTRY_DOWNLOAD_INIT: 'daemon.promptRegistry.download.init',
    DAEMON_PROMPT_REGISTRY_DOWNLOAD_CHUNK: 'daemon.promptRegistry.download.chunk',
    DAEMON_PROMPT_REGISTRY_DOWNLOAD_FINALIZE: 'daemon.promptRegistry.download.finalize',
    DAEMON_PROMPT_REGISTRY_DOWNLOAD_ABORT: 'daemon.promptRegistry.download.abort',
    DAEMON_PROMPT_REGISTRY_INSTALL: 'daemon.promptRegistry.install',
    DAEMON_DIRECT_SESSIONS_CANDIDATES_LIST: 'daemon.directSessions.candidates.list',
    DAEMON_DIRECT_SESSION_LINK_ENSURE: 'daemon.directSessions.link.ensure',
    DAEMON_DIRECT_SESSION_STATUS_GET: 'daemon.directSessions.status.get',
    DAEMON_DIRECT_SESSION_TRANSCRIPT_PAGE: 'daemon.directSessions.transcript.page',
    DAEMON_DIRECT_SESSION_TRANSCRIPT_READ_AFTER: 'daemon.directSessions.transcript.readAfter',
    DAEMON_DIRECT_SESSION_TAKEOVER: 'daemon.directSessions.takeover',
    DAEMON_DIRECT_SESSION_TAKEOVER_PERSIST: 'daemon.directSessions.takeoverPersist',
    DAEMON_SESSION_HANDOFF_START: 'daemon.sessionHandoff.start',
    DAEMON_SESSION_HANDOFF_PREPARE_TARGET: 'daemon.sessionHandoff.prepareTarget',
    DAEMON_SESSION_HANDOFF_PREPARE_TARGET_RESULT_GET: 'daemon.sessionHandoff.prepareTargetResult.get',
    DAEMON_SESSION_HANDOFF_COMMIT: 'daemon.sessionHandoff.commit',
    DAEMON_SESSION_HANDOFF_ABORT: 'daemon.sessionHandoff.abort',
    DAEMON_SESSION_HANDOFF_STATUS_GET: 'daemon.sessionHandoff.status.get',
    SESSION_CONTINUE_WITH_REPLAY: 'session.continueWithReplay',
    SESSION_FORK: 'session.fork',
    BASH: 'bash',
    PREVIEW_ENV: 'preview-env',
    READ_FILE: 'readFile',
    WRITE_FILE: 'writeFile',
    CREATE_DIRECTORY: 'createDirectory',
    LIST_DIRECTORY: 'listDirectory',
    GET_DIRECTORY_TREE: 'getDirectoryTree',
    DAEMON_FILESYSTEM_LIST_ROOTS: 'daemon.filesystem.listRoots',
    DAEMON_FILESYSTEM_LIST_DIRECTORY: 'daemon.filesystem.listDirectory',
    STAT_FILE: 'statFile',
    RENAME_PATH: 'renamePath',
    DELETE_PATH: 'deletePath',
    RIPGREP: 'ripgrep',
    DIFFTASTIC: 'difftastic',
    SESSION_LOG_TAIL: 'session.log.tail',
    SCM_BACKEND_DESCRIBE: 'scm.backend.describe',
    SCM_STATUS_SNAPSHOT: 'scm.status.snapshot',
    SCM_DIFF_FILE: 'scm.diff.file',
    SCM_DIFF_COMMIT: 'scm.diff.commit',
    SCM_CHANGE_INCLUDE: 'scm.change.include',
    SCM_CHANGE_EXCLUDE: 'scm.change.exclude',
    SCM_CHANGE_DISCARD: 'scm.change.discard',
    SCM_COMMIT_CREATE: 'scm.commit.create',
    SCM_COMMIT_BACKOUT: 'scm.commit.backout',
    SCM_LOG_LIST: 'scm.log.list',
    SCM_BRANCH_LIST: 'scm.branch.list',
    SCM_BRANCH_CREATE: 'scm.branch.create',
    SCM_BRANCH_CHECKOUT: 'scm.branch.checkout',
    SCM_WORKTREE_CREATE: 'scm.worktree.create',
    SCM_WORKTREE_REMOVE: 'scm.worktree.remove',
    SCM_WORKTREE_PRUNE: 'scm.worktree.prune',
    SCM_REMOTE_FETCH: 'scm.remote.fetch',
    SCM_REMOTE_PUSH: 'scm.remote.push',
    SCM_REMOTE_PULL: 'scm.remote.pull',
    SCM_REMOTE_PUBLISH: 'scm.remote.publish',
    SCM_STASH_LIST: 'scm.stash.list',
    SCM_STASH_DROP: 'scm.stash.drop',
    SCM_STASH_POP: 'scm.stash.pop',
    SCM_STASH_APPLY: 'scm.stash.apply',
    SCM_STASH_SHOW: 'scm.stash.show',
    KILL_SESSION: 'killSession',
    CAPABILITIES_DESCRIBE: 'capabilities.describe',
    CAPABILITIES_DETECT: 'capabilities.detect',
    CAPABILITIES_INVOKE: 'capabilities.invoke',
    BUGREPORT_COLLECT_DIAGNOSTICS: 'bugreport.collectDiagnostics',
    BUGREPORT_GET_LOG_TAIL: 'bugreport.getLogTail',
    BUGREPORT_UPLOAD_ARTIFACT: 'bugreport.uploadArtifact',
};
export const RPC_ERROR_CODES = {
    METHOD_NOT_AVAILABLE: 'RPC_METHOD_NOT_AVAILABLE',
    METHOD_NOT_FOUND: 'RPC_METHOD_NOT_FOUND',
};
export const RPC_ERROR_MESSAGES = {
    METHOD_NOT_AVAILABLE: 'RPC method not available',
    METHOD_NOT_FOUND: 'Method not found',
};
// Session-scoped RPC method names (used with `${sessionId}:${method}` over socket RPC).
export const SESSION_RPC_METHODS = {
    SESSION_USER_MESSAGE_SEND: 'session.userMessage.send',
    EXECUTION_RUN_START: 'execution.run.start',
    EXECUTION_RUN_ENSURE: 'execution.run.ensure',
    EXECUTION_RUN_ENSURE_OR_START: 'execution.run.ensureOrStart',
    EXECUTION_RUN_SEND: 'execution.run.send',
    EXECUTION_RUN_STREAM_START: 'execution.run.stream.start',
    EXECUTION_RUN_STREAM_READ: 'execution.run.stream.read',
    EXECUTION_RUN_STREAM_CANCEL: 'execution.run.stream.cancel',
    EXECUTION_RUN_STOP: 'execution.run.stop',
    EXECUTION_RUN_LIST: 'execution.run.list',
    EXECUTION_RUN_GET: 'execution.run.get',
    EXECUTION_RUN_ACTION: 'execution.run.action',
    SESSION_ROLLBACK: 'session.rollback',
    EPHEMERAL_TASK_RUN: 'ephemeral.task.run',
};
export function isRpcMethodNotFoundResult(value) {
    if (!value || typeof value !== 'object')
        return false;
    const maybe = value;
    if (maybe.errorCode === RPC_ERROR_CODES.METHOD_NOT_FOUND)
        return true;
    return maybe.error === RPC_ERROR_MESSAGES.METHOD_NOT_FOUND;
}
//# sourceMappingURL=rpc.js.map