You've already forked agentic-coding-workflow
修改
This commit is contained in:
+28
-19
@@ -75,27 +75,30 @@ const (
|
||||
CodeWebhookNotConfigured Code = "webhook.not_configured"
|
||||
|
||||
// ACP 域
|
||||
CodeAcpAgentKindNotFound Code = "acp.agent_kind_not_found"
|
||||
CodeAcpAgentKindDisabled Code = "acp.agent_kind_disabled"
|
||||
CodeAcpAgentKindInUse Code = "acp.agent_kind_in_use"
|
||||
CodeAcpSessionNotFound Code = "acp.session_not_found"
|
||||
CodeAcpSessionQuotaExceeded Code = "acp.session_quota_exceeded"
|
||||
CodeAcpSessionNotOwned Code = "acp.session_not_owned"
|
||||
CodeAcpSessionTerminated Code = "acp.session_terminated"
|
||||
CodeAcpSessionBranchConflict Code = "acp.session_branch_conflict"
|
||||
CodeAcpSpawnFailed Code = "acp.spawn_failed"
|
||||
CodeAcpHandshakeTimeout Code = "acp.handshake_timeout"
|
||||
CodeAcpFsPathOutsideWorktree Code = "acp.fs_path_outside_worktree"
|
||||
CodeAcpAgentKindNotFound Code = "acp.agent_kind_not_found"
|
||||
CodeAcpAgentKindDisabled Code = "acp.agent_kind_disabled"
|
||||
CodeAcpAgentKindInUse Code = "acp.agent_kind_in_use"
|
||||
CodeAcpSessionNotFound Code = "acp.session_not_found"
|
||||
CodeAcpSessionQuotaExceeded Code = "acp.session_quota_exceeded"
|
||||
CodeAcpSessionNotOwned Code = "acp.session_not_owned"
|
||||
CodeAcpSessionTerminated Code = "acp.session_terminated"
|
||||
CodeAcpSessionBranchConflict Code = "acp.session_branch_conflict"
|
||||
CodeAcpSpawnFailed Code = "acp.spawn_failed"
|
||||
CodeAcpHandshakeTimeout Code = "acp.handshake_timeout"
|
||||
CodeAcpFsPathOutsideWorktree Code = "acp.fs_path_outside_worktree"
|
||||
CodeAcpPermissionNotFound Code = "acp.permission_not_found"
|
||||
CodeAcpPermissionAlreadyDecided Code = "acp.permission_already_decided"
|
||||
CodeAcpPermissionInvalidOption Code = "acp.permission_invalid_option"
|
||||
|
||||
// MCP 域
|
||||
CodeMcpTokenInvalid Code = "mcp.token_invalid"
|
||||
CodeMcpTokenRevoked Code = "mcp.token_revoked"
|
||||
CodeMcpTokenExpired Code = "mcp.token_expired"
|
||||
CodeMcpTokenNotFound Code = "mcp.token_not_found"
|
||||
CodeMcpTokenScopeViolation Code = "mcp.token_scope_violation"
|
||||
CodeMcpTokenNameRequired Code = "mcp.token_name_required"
|
||||
CodeMcpTokenExpiresRequired Code = "mcp.token_expires_required"
|
||||
CodeMcpRateLimited Code = "mcp.rate_limited"
|
||||
CodeMcpTokenInvalid Code = "mcp.token_invalid"
|
||||
CodeMcpTokenRevoked Code = "mcp.token_revoked"
|
||||
CodeMcpTokenExpired Code = "mcp.token_expired"
|
||||
CodeMcpTokenNotFound Code = "mcp.token_not_found"
|
||||
CodeMcpTokenScopeViolation Code = "mcp.token_scope_violation"
|
||||
CodeMcpTokenNameRequired Code = "mcp.token_name_required"
|
||||
CodeMcpTokenExpiresRequired Code = "mcp.token_expires_required"
|
||||
CodeMcpRateLimited Code = "mcp.rate_limited"
|
||||
)
|
||||
|
||||
// AppError is the application's structured error type. It carries a stable
|
||||
@@ -218,6 +221,12 @@ func HTTPStatus(code Code) int {
|
||||
return http.StatusBadGateway
|
||||
case CodeAcpFsPathOutsideWorktree:
|
||||
return http.StatusInternalServerError
|
||||
case CodeAcpPermissionNotFound:
|
||||
return http.StatusNotFound
|
||||
case CodeAcpPermissionAlreadyDecided:
|
||||
return http.StatusConflict
|
||||
case CodeAcpPermissionInvalidOption:
|
||||
return http.StatusBadRequest
|
||||
case CodeWebhookNotConfigured:
|
||||
return http.StatusServiceUnavailable
|
||||
case CodeMcpTokenInvalid, CodeMcpTokenRevoked, CodeMcpTokenExpired:
|
||||
|
||||
@@ -11,17 +11,18 @@ import (
|
||||
)
|
||||
|
||||
type AcpAgentKind struct {
|
||||
ID pgtype.UUID `json:"id"`
|
||||
Name string `json:"name"`
|
||||
DisplayName string `json:"display_name"`
|
||||
Description string `json:"description"`
|
||||
BinaryPath string `json:"binary_path"`
|
||||
Args []string `json:"args"`
|
||||
EncryptedEnv []byte `json:"encrypted_env"`
|
||||
Enabled bool `json:"enabled"`
|
||||
CreatedBy pgtype.UUID `json:"created_by"`
|
||||
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
||||
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
||||
ID pgtype.UUID `json:"id"`
|
||||
Name string `json:"name"`
|
||||
DisplayName string `json:"display_name"`
|
||||
Description string `json:"description"`
|
||||
BinaryPath string `json:"binary_path"`
|
||||
Args []string `json:"args"`
|
||||
EncryptedEnv []byte `json:"encrypted_env"`
|
||||
Enabled bool `json:"enabled"`
|
||||
CreatedBy pgtype.UUID `json:"created_by"`
|
||||
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
||||
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
||||
ToolAllowlist []string `json:"tool_allowlist"`
|
||||
}
|
||||
|
||||
type AcpEvent struct {
|
||||
@@ -36,6 +37,20 @@ type AcpEvent struct {
|
||||
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
||||
}
|
||||
|
||||
type AcpPermissionRequest struct {
|
||||
ID pgtype.UUID `json:"id"`
|
||||
SessionID pgtype.UUID `json:"session_id"`
|
||||
AgentRequestID string `json:"agent_request_id"`
|
||||
ToolName string `json:"tool_name"`
|
||||
ToolCall []byte `json:"tool_call"`
|
||||
Options []byte `json:"options"`
|
||||
Status string `json:"status"`
|
||||
ChosenOptionID *string `json:"chosen_option_id"`
|
||||
DecidedBy pgtype.UUID `json:"decided_by"`
|
||||
DecidedAt pgtype.Timestamptz `json:"decided_at"`
|
||||
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
||||
}
|
||||
|
||||
type AcpSession struct {
|
||||
ID pgtype.UUID `json:"id"`
|
||||
WorkspaceID pgtype.UUID `json:"workspace_id"`
|
||||
@@ -269,6 +284,7 @@ type User struct {
|
||||
IsAdmin bool `json:"is_admin"`
|
||||
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
||||
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
||||
Enabled bool `json:"enabled"`
|
||||
}
|
||||
|
||||
type UserSession struct {
|
||||
|
||||
Reference in New Issue
Block a user