Files
kandev/apps/backend/pkg/websocket/actions.go
T
João Salavisa 1b58a64fd8 feat(automations): /settings/automations with run-mode + per-automation config (#1016)
* feat: add automation system with triggers, backend-driven metadata, and PR association

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(automations): execution_mode + flat /settings/automations

Layered on top of #406's automation subsystem:

- Add execution_mode to Automation (task | run, default task). Run-mode
  firings create an ephemeral kanban-hidden task tagged with
  origin=automation_run. The session pipeline still runs against it, but
  users surface them through the AutomationRun history instead of the
  kanban. Pragmatic shim while AutomationRun-as-true-session-owner is
  deferred to a follow-up.

- Thread IsEphemeral + Origin through ReviewTaskRequest +
  reviewTaskCreatorAdapter so the orchestrator can create the hidden
  task in one call.

- Run-mode always auto-starts (the user never sees the task to drag).

- Flat /settings/automations route replaces the per-workspace sidebar
  entry. Picks the only workspace, shows a picker for many, or shows
  a CTA for zero workspaces.

- Editor exposes execution mode + table shows it as a badge column.

Spec at docs/specs/office/automations-settings.md documents the design,
deferred items, and scenarios.

* feat(automations): per-automation repository picker

Adds a repository_id field on Automation so users can pin scheduled and
webhook automations to a specific workspace repository instead of always
falling through to "first repo". github_pr triggers ignore the field and
keep using the PR's own repo — the editor disables the picker with a
hint when a PR trigger is selected.

Backend:
- repository_id column folded into the canonical CREATE TABLE (no
  migration needed — PR #406 introduces the table).
- RepositoryID threaded through model, DTOs, store INSERT/UPDATE, and
  service.CreateAutomation.
- resolveAutomationRepository prefers the explicit ID, falls back to
  workspace-first on empty.

Frontend:
- repository_id on the Automation TS type + Create/Update payloads.
- Repository SelectField in ConfigSection backed by useRepositories;
  "Auto" sentinel represents the empty/fallback choice.
- Disabled with help-text for github_pr triggers.

* feat(automations): repo picker shows discovered repos too

Matches the task-creation dialog's UX: the editor's repository picker
now lists registered workspace repos AND filesystem-discovered repos
under the workspace's roots. Picking a discovered repo registers it
with the workspace at save time (via createRepositoryAction), captures
the new id, and writes it onto the automation. After the first save
the picker selection is promoted from "discovered" to "registered" so
re-saving doesn't re-register.

Form state holds a RepositorySelection union (auto | registered |
discovered) rather than a plain id string so the picker can carry the
metadata needed to register.

github_pr triggers still disable the picker — PR events always override
any configured repo with the PR's own.

* fix(automations): add idempotent ALTERs for in-branch columns

The canonical CREATE TABLE covers fresh installs, but `CREATE TABLE
IF NOT EXISTS` is a no-op for DBs already initialised from an earlier
commit on this branch (PR #406's original schema). Without these
ALTERs, dev DBs created before execution_mode + repository_id existed
on the row hit "no such column" errors.

Three idempotent ALTERs: task_title_template, execution_mode,
repository_id. SQLite returns a duplicate-column error when the column
already exists; we swallow it.

* fix(automations): use generateUUID in non-secure contexts

crypto.randomUUID is only defined in secure contexts (HTTPS or
localhost). PR #406's editor used it directly, which throws "crypto.
randomUUID is not a function" when the app is reached via a plain
hostname like nova:58204. Switch to lib/utils.generateUUID, which
falls back to a Math.random-based implementation when crypto isn't
available.

* fix(automations): polish run-mode lifecycle, validation, and editor UX

Run-mode automations were partly broken end-to-end:
- workflow_id was sent for ephemeral tasks (rejected by task service)
  and was required by the editor + automation service, so "Create
  Automation" was always disabled and silently failed
- a permission_request hanging the agent left the run pinned at
  task_created forever; nothing reaped the ephemeral worktree
- trigger config inputs (cron, branches, authors) did not re-sync
  with the loaded automation on page reload
- runs row never linked back to the underlying task for task-mode
  automations, and the table header highlighted on hover

Backend
- skip workflow fields in CreateReviewTask / StartTask for run-mode
- relax automation.Service.CreateAutomation: workflow only required
  for task-mode
- auto-reject permission prompts on ephemeral automation tasks and
  mark the AutomationRun failed with the requested action
- on agent completion / failure for ephemeral automation tasks,
  flip the run to succeeded/failed and remove the worktree + branch
  immediately (new RunStatusSucceeded + MarkRunSucceededByTaskID)
- wire worktree.Manager into the orchestrator service

Frontend
- show Execution Mode first; hide Workflow / Workflow Step in run-mode
- canSave no longer requires workflow in run-mode
- surface save errors via toast instead of silent failure
- sync trigger-config local input state with loaded prop value
- runs table: clickable row → /tasks/<id> for task-mode runs,
  non-clickable in run-mode; suppress header hover

* fix(automations): address PR review feedback

Backend
- automation/scheduler.go: parseCronFields returns an error for
  unsupported expressions instead of silently defaulting to hourly
- automation/webhook.go: constant-time secret compare, header-only
  (no more ?secret= query param), reject with 409 when no enabled
  webhook trigger exists
- automation/service.go: enforce max_concurrent_runs in FireTrigger
  via maybeSkipForConcurrencyCap (records a skipped run when capped)
- cmd/kandev/e2e_reset.go: surface automation delete errors as 500
  instead of swallowing them
- orchestrator/event_handlers_git.go: auto-reject permission with
  cancelled=true so the message status is "rejected" and the session
  isn't flipped back to running
- orchestrator/event_handlers_agent.go: finalizeAutomationRunIfEphemeral
  now runs at the top of handleAgentFailed, before the resume/recoverable
  early returns, so session-backed run-mode failures get cleaned up

Frontend
- state/slices/automations/automations-slice.ts: declare _get/_api so
  the call site's arity matches and CodeQL stops flagging ignored
  trailing arguments
- automations/schedule-selector.tsx: clearing the input now propagates
  ""; cron is trimmed before validation+save
- automations/triggers-section.tsx: switching to webhook mode deletes
  the existing scheduled/condition triggers so they don't keep firing
  hidden in the background
- automations/trigger-configs/github-ci-config.tsx: useEffect re-sync
  for checkNames, matching the other trigger configs
- hooks/domains/settings/use-automations.ts: per-workspace fetch via
  loadedWorkspaceRef + render-safe loadedWorkspaceId state;
  inFlightWorkspaceRef discards stale responses after workspace switch

---------

Co-authored-by: Carlos Florêncio <carlosmflorencio@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Kandev Agent <agent@kandev.dev>
2026-05-22 22:01:59 +01:00

491 lines
22 KiB
Go

package websocket
// Action constants for WebSocket messages
const (
// Health
ActionHealthCheck = "health.check"
// Workflow actions
ActionWorkflowList = "workflow.list"
ActionWorkflowCreate = "workflow.create"
ActionWorkflowGet = "workflow.get"
ActionWorkflowUpdate = "workflow.update"
ActionWorkflowDelete = "workflow.delete"
ActionWorkflowReorder = "workflow.reorder"
// Workspace actions
ActionWorkspaceList = "workspace.list"
ActionWorkspaceCreate = "workspace.create"
ActionWorkspaceGet = "workspace.get"
ActionWorkspaceUpdate = "workspace.update"
ActionWorkspaceDelete = "workspace.delete"
// Repository actions
ActionRepositoryList = "repository.list"
ActionRepositoryCreate = "repository.create"
ActionRepositoryGet = "repository.get"
ActionRepositoryUpdate = "repository.update"
ActionRepositoryDelete = "repository.delete"
// Repository Script actions
ActionRepositoryScriptList = "repository.script.list"
ActionRepositoryScriptCreate = "repository.script.create"
ActionRepositoryScriptGet = "repository.script.get"
ActionRepositoryScriptUpdate = "repository.script.update"
ActionRepositoryScriptDelete = "repository.script.delete"
// Executor actions
ActionExecutorList = "executor.list"
ActionExecutorCreate = "executor.create"
ActionExecutorGet = "executor.get"
ActionExecutorUpdate = "executor.update"
ActionExecutorDelete = "executor.delete"
// Executor profile actions
ActionExecutorProfileList = "executor.profile.list"
ActionExecutorProfileListAll = "executor.profile.list_all"
ActionExecutorProfileCreate = "executor.profile.create"
ActionExecutorProfileGet = "executor.profile.get"
ActionExecutorProfileUpdate = "executor.profile.update"
ActionExecutorProfileDelete = "executor.profile.delete"
// Environment actions
ActionEnvironmentList = "environment.list"
ActionEnvironmentCreate = "environment.create"
ActionEnvironmentGet = "environment.get"
ActionEnvironmentUpdate = "environment.update"
ActionEnvironmentDelete = "environment.delete"
// Task actions
ActionTaskList = "task.list"
ActionTaskCreate = "task.create"
ActionTaskGet = "task.get"
ActionTaskUpdate = "task.update"
ActionTaskDelete = "task.delete"
ActionTaskMove = "task.move"
ActionTaskState = "task.state"
ActionTaskArchive = "task.archive"
ActionTaskPlanCreate = "task.plan.create"
ActionTaskPlanGet = "task.plan.get"
ActionTaskPlanUpdate = "task.plan.update"
ActionTaskPlanDelete = "task.plan.delete"
ActionTaskPlanRevisionsList = "task.plan.revisions.list"
ActionTaskPlanRevisionGet = "task.plan.revision.get"
ActionTaskPlanRevert = "task.plan.revert"
ActionTaskSessionList = "task.session.list"
ActionTaskSessionStatus = "task.session.status"
// Unified session launch
ActionSessionLaunch = "session.launch"
ActionSessionEnsure = "session.ensure"
ActionSessionRecover = "session.recover"
ActionSessionResetContext = "session.reset_context"
ActionSessionStop = "session.stop"
ActionSessionDelete = "session.delete"
ActionSessionSetPrimary = "session.set_primary"
ActionSessionSetPlanMode = "session.set_plan_mode"
// Agent actions
ActionAgentList = "agent.list"
ActionAgentLaunch = "agent.launch"
ActionAgentStatus = "agent.status"
ActionAgentLogs = "agent.logs"
ActionAgentStop = "agent.stop"
ActionAgentPrompt = "agent.prompt"
ActionAgentCancel = "agent.cancel"
ActionTaskSession = "task.session"
ActionAgentTypes = "agent.types"
// Agent passthrough actions
ActionAgentStdin = "agent.stdin" // Send input to agent process stdin (passthrough mode)
ActionAgentStdout = "agent.stdout" // Agent stdout notification (passthrough mode)
ActionAgentResize = "agent.resize" // Resize agent PTY (passthrough mode)
// Orchestrator actions
ActionOrchestratorStatus = "orchestrator.status"
ActionOrchestratorQueue = "orchestrator.queue"
ActionOrchestratorStop = "orchestrator.stop"
// Message Queue actions
ActionMessageQueueAdd = "message.queue.add"
ActionMessageQueueCancel = "message.queue.cancel" // Clears the entire queue for a session
ActionMessageQueueGet = "message.queue.get"
ActionMessageQueueUpdate = "message.queue.update"
ActionMessageQueueAppend = "message.queue.append"
ActionMessageQueueRemove = "message.queue.remove" // Delete a single entry by id
ActionMessageQueueStatusChanged = "message.queue.status_changed" // Notification: queue status changed
// Workflow template/step actions
ActionWorkflowTemplateList = "workflow.template.list"
ActionWorkflowTemplateGet = "workflow.template.get"
ActionWorkflowStepList = "workflow.step.list"
ActionWorkflowStepGet = "workflow.step.get"
ActionWorkflowStepCreate = "workflow.step.create"
ActionWorkflowHistoryList = "workflow.history.list"
// Subscription actions
ActionTaskSubscribe = "task.subscribe"
ActionTaskUnsubscribe = "task.unsubscribe"
ActionSessionSubscribe = "session.subscribe"
ActionSessionUnsubscribe = "session.unsubscribe"
// Focus signals are layered on top of subscriptions to indicate which
// session the user is actively viewing (task details page or task panel),
// vs merely subscribed (sidebar diff badges). Drives backend polling tier.
ActionSessionFocus = "session.focus"
ActionSessionUnfocus = "session.unfocus"
ActionUserSubscribe = "user.subscribe"
ActionUserUnsubscribe = "user.unsubscribe"
ActionRunSubscribe = "run.subscribe"
ActionRunUnsubscribe = "run.unsubscribe"
// Message actions
ActionMessageAdd = "message.add"
ActionMessageGet = "message.get"
ActionMessageList = "message.list"
ActionMessageSearch = "message.search"
// Notification actions (server -> client)
ActionACPProgress = "acp.progress"
ActionACPLog = "acp.log"
ActionACPResult = "acp.result"
ActionACPError = "acp.error"
ActionACPStatus = "acp.status"
ActionACPHeartbeat = "acp.heartbeat"
ActionTaskCreated = "task.created"
ActionTaskUpdated = "task.updated"
ActionTaskDeleted = "task.deleted"
ActionTaskStateChanged = "task.state_changed"
ActionTaskPlanCreated = "task.plan.created"
ActionTaskPlanUpdated = "task.plan.updated"
ActionTaskPlanDeleted = "task.plan.deleted"
ActionTaskPlanRevisionCreated = "task.plan.revision.created"
ActionTaskPlanReverted = "task.plan.reverted"
ActionAgentUpdated = "agent.updated"
ActionAgentAvailableUpdated = "agent.available.updated"
ActionAgentInstallStarted = "agent.install.started"
ActionAgentInstallOutput = "agent.install.output"
ActionAgentInstallFinished = "agent.install.finished"
ActionWorkspaceCreated = "workspace.created"
ActionWorkspaceUpdated = "workspace.updated"
ActionWorkspaceDeleted = "workspace.deleted"
ActionWorkflowCreated = "workflow.created"
ActionWorkflowUpdated = "workflow.updated"
ActionWorkflowDeleted = "workflow.deleted"
ActionWorkflowStepCreated = "workflow.step.created"
ActionWorkflowStepUpdated = "workflow.step.updated"
ActionWorkflowStepDeleted = "workflow.step.deleted"
ActionSessionMessageAdded = "session.message.added"
ActionSessionMessageUpdated = "session.message.updated"
ActionSessionStateChanged = "session.state_changed"
ActionSessionWaitingForInput = "session.waiting_for_input"
ActionSessionAgentctlStarting = "session.agentctl_starting"
ActionSessionAgentctlReady = "session.agentctl_ready"
ActionSessionAgentctlError = "session.agentctl_error"
ActionSessionTurnStarted = "session.turn.started"
ActionSessionTurnCompleted = "session.turn.completed"
ActionSessionAvailableCommands = "session.available_commands"
ActionSessionModeChanged = "session.mode_changed"
ActionSessionAgentCapabilities = "session.agent_capabilities"
ActionSessionModelsUpdated = "session.models_updated"
ActionSessionSetMode = "session.set_mode"
ActionSessionTodosUpdated = "session.todos_updated"
ActionSessionPromptUsage = "session.prompt_usage"
ActionSessionPollModeChanged = "session.poll_mode_changed"
ActionInputRequested = "input.requested"
ActionRepositoryCreated = "repository.created"
ActionRepositoryUpdated = "repository.updated"
ActionRepositoryDeleted = "repository.deleted"
ActionRepositoryScriptCreated = "repository.script.created"
ActionRepositoryScriptUpdated = "repository.script.updated"
ActionRepositoryScriptDeleted = "repository.script.deleted"
ActionExecutorCreated = "executor.created"
ActionExecutorUpdated = "executor.updated"
ActionExecutorDeleted = "executor.deleted"
ActionEnvironmentCreated = "environment.created"
ActionEnvironmentUpdated = "environment.updated"
ActionEnvironmentDeleted = "environment.deleted"
ActionExecutorProfileCreated = "executor.profile.created"
ActionExecutorProfileUpdated = "executor.profile.updated"
ActionExecutorProfileDeleted = "executor.profile.deleted"
ActionExecutorPrepareProgress = "executor.prepare.progress"
ActionExecutorPrepareCompleted = "executor.prepare.completed"
ActionAgentProfileDeleted = "agent.profile.deleted"
ActionAgentProfileCreated = "agent.profile.created"
ActionAgentProfileUpdated = "agent.profile.updated"
// Permission request actions (agent -> user -> agent)
ActionPermissionRequested = "permission.requested" // Agent requesting permission
ActionPermissionRespond = "permission.respond" // User responding to permission request
// Workspace file operations
ActionWorkspaceFileTreeGet = "workspace.tree.get"
ActionWorkspaceFileContentGet = "workspace.file.get"
ActionWorkspaceFileContentGetRef = "workspace.file.get_at_ref"
ActionWorkspaceFileContentUpdate = "workspace.file.update"
ActionWorkspaceFileCreate = "workspace.file.create"
ActionWorkspaceFileDelete = "workspace.file.delete"
ActionWorkspaceFileRename = "workspace.file.rename"
ActionWorkspaceFilesSearch = "workspace.files.search"
ActionWorkspaceFileChanges = "session.workspace.file.changes" // Notification
// Shell actions
ActionShellStatus = "session.shell.status" // Get shell status
ActionShellSubscribe = "shell.subscribe" // Subscribe to shell output
ActionShellInput = "shell.input" // Send input to shell
ActionSessionShellOutput = "session.shell.output" // Shell output notification (also used for exit with type: "exit")
// User shell actions (independent terminal tabs)
ActionUserShellList = "user_shell.list" // List running user shells for a session
ActionUserShellCreate = "user_shell.create" // Create a new user shell terminal (assigns ID and label)
ActionUserShellStop = "user_shell.stop" // Stop a user shell terminal
// Session file review actions
ActionSessionFileReviewGet = "session.file_review.get" // Get all file reviews for a session
ActionSessionFileReviewUpdate = "session.file_review.update" // Upsert a single file review
ActionSessionFileReviewReset = "session.file_review.reset" // Delete all reviews for a session
// Session git actions (requests)
ActionSessionGitSnapshots = "session.git.snapshots" // Get git snapshots for a session
ActionSessionGitCommits = "session.git.commits" // Get commits for a session
ActionSessionCumulativeDiff = "session.cumulative_diff" // Get cumulative diff from base branch
ActionSessionCommitDiff = "session.commit_diff" // Get diff for a specific commit
// Session git event (unified notification)
ActionSessionGitEvent = "session.git.event" // Notification: unified git event
// Process runner actions
ActionSessionProcessOutput = "session.process.output"
ActionSessionProcessStatus = "session.process.status"
// Git worktree actions
ActionWorktreePull = "worktree.pull" // Pull from remote
ActionWorktreePush = "worktree.push" // Push to remote
ActionWorktreeRebase = "worktree.rebase" // Rebase onto base branch
ActionWorktreeMerge = "worktree.merge" // Merge base branch into worktree
ActionWorktreeAbort = "worktree.abort" // Abort in-progress merge or rebase
ActionWorktreeCommit = "worktree.commit" // Commit changes
ActionWorktreeStage = "worktree.stage" // Stage files for commit
ActionWorktreeUnstage = "worktree.unstage" // Unstage files from index
ActionWorktreeDiscard = "worktree.discard" // Discard changes to files
ActionWorktreeCreatePR = "worktree.create_pr" // Create a pull request
ActionWorktreeRevertCommit = "worktree.revert_commit" // Revert a commit (staged, no new commit)
ActionWorktreeRenameBranch = "worktree.rename_branch" // Rename the current branch
ActionWorktreeReset = "worktree.reset" // Reset HEAD to a commit (soft/hard)
// User actions
ActionUserGet = "user.get"
ActionUserSettingsUpdate = "user.settings.update"
ActionUserSettingsUpdated = "user.settings.updated"
// VS Code server actions
ActionVscodeStart = "vscode.start" // Start code-server for a session
ActionVscodeStop = "vscode.stop" // Stop code-server for a session
ActionVscodeStatus = "vscode.status" // Get code-server status for a session
ActionVscodeOpenFile = "vscode.openFile" // Open a file in code-server for a session
// Port actions
ActionPortList = "port.list" // List listening ports on a remote executor
ActionPortTunnelStart = "port.tunnel.start" // Start a port tunnel
ActionPortTunnelStop = "port.tunnel.stop" // Stop a port tunnel
ActionPortTunnelList = "port.tunnel.list" // List active port tunnels
// Secret actions
ActionSecretList = "secrets.list"
ActionSecretCreate = "secrets.create"
ActionSecretUpdate = "secrets.update"
ActionSecretDelete = "secrets.delete"
ActionSecretReveal = "secrets.reveal"
// Sprites actions
ActionSpritesStatus = "sprites.status"
ActionSpritesInstancesList = "sprites.instances.list"
ActionSpritesInstancesDestroy = "sprites.instances.destroy"
ActionSpritesTest = "sprites.test"
ActionSpritesNetworkPolicyGet = "sprites.network_policy.get"
ActionSpritesNetworkPolicyUpdate = "sprites.network_policy.update"
// MCP tool actions (agentctl -> backend via WS tunnel)
ActionMCPListWorkspaces = "mcp.list_workspaces"
ActionMCPListWorkflows = "mcp.list_workflows"
ActionMCPListWorkflowSteps = "mcp.list_workflow_steps"
ActionMCPListRepositories = "mcp.list_repositories"
ActionMCPListTasks = "mcp.list_tasks"
ActionMCPCreateTask = "mcp.create_task"
ActionMCPUpdateTask = "mcp.update_task"
ActionMCPAskUserQuestion = "mcp.ask_user_question"
ActionMCPCreateTaskPlan = "mcp.create_task_plan"
ActionMCPGetTaskPlan = "mcp.get_task_plan"
ActionMCPUpdateTaskPlan = "mcp.update_task_plan"
ActionMCPDeleteTaskPlan = "mcp.delete_task_plan"
ActionMCPClarificationTimeout = "mcp.clarification_timeout"
// Office task handoffs (cross-task context).
ActionMCPListRelatedTasks = "mcp.list_related_tasks"
ActionMCPListTaskDocuments = "mcp.list_task_documents"
ActionMCPGetTaskDocument = "mcp.get_task_document"
ActionMCPWriteTaskDocument = "mcp.write_task_document"
// Config-mode MCP actions (agent-native configuration)
ActionMCPCreateWorkflow = "mcp.create_workflow"
ActionMCPUpdateWorkflow = "mcp.update_workflow"
ActionMCPDeleteWorkflow = "mcp.delete_workflow"
ActionMCPCreateWorkflowStep = "mcp.create_workflow_step"
ActionMCPUpdateWorkflowStep = "mcp.update_workflow_step"
ActionMCPDeleteWorkflowStep = "mcp.delete_workflow_step"
ActionMCPReorderWorkflowStep = "mcp.reorder_workflow_steps"
ActionMCPListAgents = "mcp.list_agents"
ActionMCPUpdateAgent = "mcp.update_agent"
ActionMCPListAgentProfiles = "mcp.list_agent_profiles"
ActionMCPCreateAgentProfile = "mcp.create_agent_profile"
ActionMCPUpdateAgentProfile = "mcp.update_agent_profile"
ActionMCPDeleteAgentProfile = "mcp.delete_agent_profile"
ActionMCPGetMcpConfig = "mcp.get_mcp_config"
ActionMCPUpdateMcpConfig = "mcp.update_mcp_config"
ActionMCPListExecutors = "mcp.list_executors"
ActionMCPListExecutorProfiles = "mcp.list_executor_profiles"
ActionMCPCreateExecutorProfile = "mcp.create_executor_profile"
ActionMCPUpdateExecutorProfile = "mcp.update_executor_profile"
ActionMCPDeleteExecutorProfile = "mcp.delete_executor_profile"
ActionMCPMoveTask = "mcp.move_task"
ActionMCPDeleteTask = "mcp.delete_task"
ActionMCPArchiveTask = "mcp.archive_task"
ActionMCPUpdateTaskState = "mcp.update_task_state"
ActionMCPMessageTask = "mcp.message_task"
ActionMCPGetTaskConversation = "mcp.get_task_conversation"
)
// GitHub integration actions
const (
ActionGitHubStatus = "github.status"
ActionGitHubTaskPRsList = "github.task_prs.list"
ActionGitHubTaskPRGet = "github.task_pr.get"
ActionGitHubPRFeedbackGet = "github.pr_feedback.get"
ActionGitHubReviewWatchesList = "github.review_watches.list"
ActionGitHubReviewWatchCreate = "github.review_watches.create"
ActionGitHubReviewWatchUpdate = "github.review_watches.update"
ActionGitHubReviewWatchDelete = "github.review_watches.delete"
ActionGitHubReviewTrigger = "github.review_watches.trigger"
ActionGitHubReviewTriggerAll = "github.review_watches.trigger_all"
ActionGitHubPRWatchesList = "github.pr_watches.list"
ActionGitHubPRWatchDelete = "github.pr_watches.delete"
ActionGitHubPRFilesGet = "github.pr_files.get"
ActionGitHubPRCommitsGet = "github.pr_commits.get"
ActionGitHubTaskPRUpdated = "github.task_pr.updated" // Notification
ActionGitHubRateLimitUpdated = "github.rate_limit.updated" // Notification
ActionGitHubPRFeedbackNotify = "github.pr_feedback.notify" // Notification
ActionGitHubNewReviewPRNotify = "github.new_review_pr.notify" // Notification
ActionGitHubTaskPRSync = "github.task_pr.sync"
ActionGitHubStats = "github.stats"
ActionGitHubCheckSessionPR = "github.check_session_pr"
// Issue watch actions
ActionGitHubIssueWatchesList = "github.issue_watches.list"
ActionGitHubIssueWatchCreate = "github.issue_watches.create"
ActionGitHubIssueWatchUpdate = "github.issue_watches.update"
ActionGitHubIssueWatchDelete = "github.issue_watches.delete"
ActionGitHubIssueTrigger = "github.issue_watches.trigger"
ActionGitHubIssueTriggerAll = "github.issue_watches.trigger_all"
ActionGitHubNewIssueNotify = "github.new_issue.notify" // Notification
// Action preset actions for the /github page quick-launch prompts.
ActionGitHubActionPresetsList = "github.action_presets.list"
ActionGitHubActionPresetsUpdate = "github.action_presets.update"
ActionGitHubActionPresetsReset = "github.action_presets.reset"
// Manual cleanup sweeps over all dedup rows (review/issue). Used by the
// settings-page button so users can drain piled-up tasks on demand.
ActionGitHubCleanupReviewTasks = "github.cleanup.review_tasks"
ActionGitHubCleanupIssueTasks = "github.cleanup.issue_tasks"
)
// Jira integration actions
const (
ActionJiraConfigGet = "jira.config.get"
ActionJiraConfigSet = "jira.config.set"
ActionJiraConfigDelete = "jira.config.delete"
ActionJiraConfigTest = "jira.config.test"
ActionJiraTicketGet = "jira.ticket.get"
ActionJiraTicketTransition = "jira.ticket.transition"
ActionJiraProjectsList = "jira.projects.list"
)
// Linear integration actions
const (
ActionLinearConfigGet = "linear.config.get"
ActionLinearConfigSet = "linear.config.set"
ActionLinearConfigDelete = "linear.config.delete"
ActionLinearConfigTest = "linear.config.test"
ActionLinearIssueGet = "linear.issue.get"
ActionLinearIssueTransition = "linear.issue.transition"
ActionLinearTeamsList = "linear.teams.list"
)
// Slack integration actions
const (
ActionSlackConfigGet = "slack.config.get"
ActionSlackConfigSet = "slack.config.set"
ActionSlackConfigDelete = "slack.config.delete"
ActionSlackConfigTest = "slack.config.test"
)
// Office notification actions (server -> client)
const (
ActionOfficeTaskUpdated = "office.task.updated"
ActionOfficeTaskCreated = "office.task.created"
ActionOfficeTaskMoved = "office.task.moved"
ActionOfficeTaskStatus = "office.task.status_changed"
ActionOfficeTaskDecision = "office.task.decision_recorded"
ActionOfficeTaskReview = "office.task.review_requested"
ActionOfficeCommentCreated = "office.comment.created"
ActionOfficeAgentCompleted = "office.agent.completed"
ActionOfficeAgentFailed = "office.agent.failed"
ActionOfficeAgentUpdated = "office.agent.updated"
ActionOfficeApprovalCreated = "office.approval.created"
ActionOfficeApprovalResolved = "office.approval.resolved"
ActionOfficeCostRecorded = "office.cost.recorded"
ActionOfficeRunQueued = "office.run.queued"
ActionOfficeRunProcessed = "office.run.processed"
ActionOfficeRoutineTriggered = "office.routine.triggered"
ActionOfficeActivityCreated = "office.activity.created"
ActionRunEventAppended = "run.event.appended"
// Office provider-routing events.
ActionOfficeProviderHealthChanged = "office.provider.health_changed"
ActionOfficeRouteAttemptAppended = "office.route_attempt.appended"
ActionOfficeRoutingSettingsUpdated = "office.routing.settings_updated"
)
// Automation actions
const (
ActionAutomationList = "automation.list"
ActionAutomationGet = "automation.get"
ActionAutomationCreate = "automation.create"
ActionAutomationUpdate = "automation.update"
ActionAutomationDelete = "automation.delete"
ActionAutomationEnable = "automation.enable"
ActionAutomationDisable = "automation.disable"
ActionAutomationTrigger = "automation.trigger"
ActionAutomationRunsList = "automation.runs.list"
ActionAutomationTriggerAdd = "automation.trigger.add"
ActionAutomationTriggerUpdate = "automation.trigger.update"
ActionAutomationTriggerDelete = "automation.trigger.delete"
ActionAutomationTriggerTypes = "automation.trigger_types"
)
// Error codes
const (
ErrorCodeBadRequest = "BAD_REQUEST"
ErrorCodeNotFound = "NOT_FOUND"
ErrorCodeInternalError = "INTERNAL_ERROR"
ErrorCodeUnauthorized = "UNAUTHORIZED"
ErrorCodeForbidden = "FORBIDDEN"
ErrorCodeValidation = "VALIDATION_ERROR"
ErrorCodeUnknownAction = "UNKNOWN_ACTION"
)