Unify agent flavor definitions

This commit is contained in:
weishu
2026-05-21 10:23:57 +08:00
parent 15113668cc
commit 9698aa9f4c
11 changed files with 27 additions and 18 deletions
+6 -2
View File
@@ -1,3 +1,5 @@
import { z } from 'zod'
/**
* @description The legacy payload type identifier used for all generic agent messages.
* Changing this value will affect the communication schema between CLI, Hub, and Web.
@@ -5,6 +7,10 @@
*/
export const AGENT_MESSAGE_PAYLOAD_TYPE = 'codex' as const
export const AGENT_FLAVORS = ['claude', 'codex', 'cursor', 'gemini', 'opencode'] as const
export type AgentFlavor = typeof AGENT_FLAVORS[number]
export const AgentFlavorSchema = z.enum(AGENT_FLAVORS)
export const CLAUDE_PERMISSION_MODES = ['default', 'acceptEdits', 'bypassPermissions', 'plan'] as const
export type ClaudePermissionMode = typeof CLAUDE_PERMISSION_MODES[number]
@@ -35,8 +41,6 @@ export const PERMISSION_MODES = [
] as const
export type PermissionMode = typeof PERMISSION_MODES[number]
export type AgentFlavor = 'claude' | 'codex' | 'gemini' | 'opencode' | 'cursor'
export const PERMISSION_MODE_LABELS: Record<PermissionMode, string> = {
default: 'Default',
acceptEdits: 'Accept Edits',
+1 -2
View File
@@ -1,7 +1,6 @@
import { z } from 'zod'
import { CodexCollaborationModeSchema, PermissionModeSchema } from './schemas'
export const AgentFlavorSchema = z.enum(['claude', 'codex', 'gemini', 'opencode', 'cursor'])
import { AgentFlavorSchema } from './modes'
export const LocalResumeTargetSchema = z.object({
sessionId: z.string().min(1),