Files
hapi/shared/src/rpcMethods.ts
T
AnanovoandGitHub 46bae9b0f1 fix(codex): fork archived sessions without reopening the source (#2231)
* fix(codex): fork archived sessions without reopening the source

* fix(codex): reconcile interrupted archived fork recovery

* fix(codex): release rejected forks and serialize source startup

* fix(codex): fence unconfirmed resume startup across retries

* test(codex): validate durable resume recovery and serialize archive

* fix(codex): block local resume of pending archived fork sources

* fix(hub): coalesce concurrent resume requests to preserve idempotent startup

* fix(hub): bypass startup coalescing for PTY sessions
2026-11-01 09:55:01 +08:00

83 lines
3.4 KiB
TypeScript

export const RPC_METHODS = {
Permission: 'permission',
Abort: 'abort',
Switch: 'switch',
SetSessionConfig: 'set-session-config',
KillSession: 'killSession',
HandoffLocal: 'handoff-local',
SpawnHappySession: 'spawn-happy-session',
StopSession: 'stop-session',
StopRunner: 'stop-runner',
ListMachineDirectory: 'list-directory',
PathExists: 'path-exists',
AgentAvailability: 'agent-availability',
CursorChatStoreStatus: 'cursor-chat-store-status',
GitStatus: 'git-status',
GitDiffNumstat: 'git-diff-numstat',
GitDiffFile: 'git-diff-file',
ReadFile: 'readFile',
ReadGeneratedImage: 'readGeneratedImage',
WriteFile: 'writeFile',
ListDirectory: 'listDirectory',
StatFiles: 'statFiles',
GetDirectoryTree: 'getDirectoryTree',
UploadFile: 'uploadFile',
DeleteUpload: 'deleteUpload',
WorkspaceReadFile: 'workspace-read-file',
WorkspaceListDirectory: 'workspace-list-directory',
WorkspaceStatFiles: 'workspace-stat-files',
WorkspaceGitStatus: 'workspace-git-status',
WorkspaceGitDiffNumstat: 'workspace-git-diff-numstat',
WorkspaceGitDiffFile: 'workspace-git-diff-file',
WorkspaceRipgrep: 'workspace-ripgrep',
Ripgrep: 'ripgrep',
Difftastic: 'difftastic',
Bash: 'bash',
ListSlashCommands: 'listSlashCommands',
ListSkills: 'listSkills',
ListCodexModels: 'listCodexModels',
ListPiModelsForMachine: 'listPiModelsForMachine',
ListCodexSessions: 'listCodexSessions',
ArchiveCodexSession: 'archiveCodexSession',
ListCursorModels: 'listCursorModels',
ListPiModels: 'listPiModels',
ListPiSessions: 'listPiSessions',
ListOpencodeModels: 'listOpencodeModels',
ListOpencodeModelVariants: 'listOpencodeModelVariants',
ListOpencodeSessions: 'listOpencodeSessions',
ListOpencodeModelsForCwd: 'listOpencodeModelsForCwd',
ListGrokModelsForCwd: 'listGrokModelsForCwd',
ListGrokModels: 'listGrokModels',
ListGrokReasoningEffortOptions: 'listGrokReasoningEffortOptions',
ListCopilotModelsForCwd: 'listCopilotModelsForCwd',
ListCopilotModels: 'listCopilotModels',
ListKimiModelsForCwd: 'listKimiModelsForCwd',
ListKimiModels: 'listKimiModels',
ListDshModels: 'listDshModels',
ListDshModelsForMachine: 'listDshModelsForMachine',
ListOpencodeReasoningEffortOptions: 'listOpencodeReasoningEffortOptions',
ListAgyModels: 'listAgyModels',
ListClaudeModels: 'listClaudeModels',
/** Deliver one queued message into the active Pi turn (native steer). */
SteerQueuedMessage: 'steer-queued-message',
ForkConversation: 'fork-conversation',
ForkArchivedCodex: 'fork-archived-codex',
RewindConversation: 'rewind-conversation',
ClearConversation: 'clear-conversation',
ImplementCodexPlan: 'implement-codex-plan',
} as const
export const RPC_TARGET_MISSING_ERROR_CODE = 'rpc_target_missing' as const
/**
* Thrown by a permission handler's handleMissingPendingResponse when a
* Permission RPC response arrives for a request the CLI no longer has
* pending (already answered, or canceled on the agent side). Shared so the
* hub can match on the specific message rather than treating any error on
* this RPC method as "not found" — see RpcGateway.approvePermission/
* denyPermission.
*/
export const PERMISSION_REQUEST_NOT_FOUND_MESSAGE = 'Permission request not found or already resolved' as const
export type RpcMethod = typeof RPC_METHODS[keyof typeof RPC_METHODS]