6dd0d7ffa4
- Add permission stream support to backend agentctl client - StreamPermissions() connects to permission WebSocket - RespondToPermission() sends responses via HTTP POST - PermissionNotification type for permission request data - Connect lifecycle manager to permission stream - handlePermissionStream() receives permission requests - publishPermissionRequest() forwards to event bus - RespondToPermission() and RespondToPermissionByTaskID() methods - Add WebSocket handler for permission.respond action - Validates task_id, pending_id, option_id - Routes response through orchestrator → executor → lifecycle manager - Add permission WebSocket actions - ActionPermissionRequested for notifications - ActionPermissionRespond for user responses - Update executor interface with RespondToPermissionByTaskID() - Update mock implementations in tests - Add permission response test to e2e-test.sh - Fix e2e-test.sh ID extraction (strip newlines) The full permission flow is now wired up: agent → agentctl → backend → frontend → user → backend → agentctl → agent Auto-approve mode is still enabled by default until frontend is ready.
106 lines
3.4 KiB
Go
106 lines
3.4 KiB
Go
package websocket
|
|
|
|
// Action constants for WebSocket messages
|
|
const (
|
|
// Health
|
|
ActionHealthCheck = "health.check"
|
|
|
|
// Board actions
|
|
ActionBoardList = "board.list"
|
|
ActionBoardCreate = "board.create"
|
|
ActionBoardGet = "board.get"
|
|
ActionBoardUpdate = "board.update"
|
|
ActionBoardDelete = "board.delete"
|
|
|
|
// Workspace actions
|
|
ActionWorkspaceList = "workspace.list"
|
|
ActionWorkspaceCreate = "workspace.create"
|
|
ActionWorkspaceGet = "workspace.get"
|
|
ActionWorkspaceUpdate = "workspace.update"
|
|
ActionWorkspaceDelete = "workspace.delete"
|
|
|
|
// Column actions
|
|
ActionColumnList = "column.list"
|
|
ActionColumnCreate = "column.create"
|
|
ActionColumnGet = "column.get"
|
|
ActionColumnUpdate = "column.update"
|
|
ActionColumnDelete = "column.delete"
|
|
|
|
// Task actions
|
|
ActionTaskList = "task.list"
|
|
ActionTaskCreate = "task.create"
|
|
ActionTaskGet = "task.get"
|
|
ActionTaskUpdate = "task.update"
|
|
ActionTaskDelete = "task.delete"
|
|
ActionTaskMove = "task.move"
|
|
ActionTaskState = "task.state"
|
|
ActionTaskLogs = "task.logs"
|
|
|
|
// Agent actions
|
|
ActionAgentList = "agent.list"
|
|
ActionAgentLaunch = "agent.launch"
|
|
ActionAgentStatus = "agent.status"
|
|
ActionAgentLogs = "agent.logs"
|
|
ActionAgentStop = "agent.stop"
|
|
ActionAgentPrompt = "agent.prompt"
|
|
ActionAgentCancel = "agent.cancel"
|
|
ActionAgentSession = "agent.session"
|
|
ActionAgentTypes = "agent.types"
|
|
|
|
// Orchestrator actions
|
|
ActionOrchestratorStatus = "orchestrator.status"
|
|
ActionOrchestratorQueue = "orchestrator.queue"
|
|
ActionOrchestratorTrigger = "orchestrator.trigger"
|
|
ActionOrchestratorStart = "orchestrator.start"
|
|
ActionOrchestratorStop = "orchestrator.stop"
|
|
ActionOrchestratorPause = "orchestrator.pause"
|
|
ActionOrchestratorResume = "orchestrator.resume"
|
|
ActionOrchestratorPrompt = "orchestrator.prompt"
|
|
ActionOrchestratorComplete = "orchestrator.complete"
|
|
|
|
// Subscription actions
|
|
ActionTaskSubscribe = "task.subscribe"
|
|
ActionTaskUnsubscribe = "task.unsubscribe"
|
|
|
|
// Comment actions
|
|
ActionCommentAdd = "comment.add"
|
|
ActionCommentGet = "comment.get"
|
|
ActionCommentList = "comment.list"
|
|
|
|
// Notification actions (server -> client)
|
|
ActionACPProgress = "acp.progress"
|
|
ActionACPLog = "acp.log"
|
|
ActionACPResult = "acp.result"
|
|
ActionACPError = "acp.error"
|
|
ActionACPStatus = "acp.status"
|
|
ActionACPHeartbeat = "acp.heartbeat"
|
|
ActionTaskUpdated = "task.updated"
|
|
ActionAgentUpdated = "agent.updated"
|
|
ActionWorkspaceCreated = "workspace.created"
|
|
ActionWorkspaceUpdated = "workspace.updated"
|
|
ActionWorkspaceDeleted = "workspace.deleted"
|
|
ActionBoardCreated = "board.created"
|
|
ActionBoardUpdated = "board.updated"
|
|
ActionBoardDeleted = "board.deleted"
|
|
ActionColumnCreated = "column.created"
|
|
ActionColumnUpdated = "column.updated"
|
|
ActionColumnDeleted = "column.deleted"
|
|
ActionCommentAdded = "comment.added"
|
|
ActionInputRequested = "input.requested"
|
|
|
|
// Permission request actions (agent -> user -> agent)
|
|
ActionPermissionRequested = "permission.requested" // Agent requesting permission
|
|
ActionPermissionRespond = "permission.respond" // User responding to permission request
|
|
)
|
|
|
|
// Error codes
|
|
const (
|
|
ErrorCodeBadRequest = "BAD_REQUEST"
|
|
ErrorCodeNotFound = "NOT_FOUND"
|
|
ErrorCodeInternalError = "INTERNAL_ERROR"
|
|
ErrorCodeUnauthorized = "UNAUTHORIZED"
|
|
ErrorCodeForbidden = "FORBIDDEN"
|
|
ErrorCodeValidation = "VALIDATION_ERROR"
|
|
ErrorCodeUnknownAction = "UNKNOWN_ACTION"
|
|
)
|