# User Quick Actions — per-user saved prompt shortcuts

# Scope discriminates between the Threads-footer (default) and the
# Tasks-footer lists. Existing actions backfill to "thread".
enum QuickActionScope {
  thread
  task
}

type UserQuickAction {
  id: ID!
  userId: ID!
  tenantId: ID!
  title: String!
  prompt: String!
  workspaceAgentId: ID
  scope: QuickActionScope!
  sortOrder: Int!
  createdAt: AWSDateTime!
  updatedAt: AWSDateTime!
}

input CreateQuickActionInput {
  tenantId: ID!
  title: String!
  prompt: String!
  workspaceAgentId: ID
  scope: QuickActionScope
  sortOrder: Int
}

input UpdateQuickActionInput {
  title: String
  prompt: String
  workspaceAgentId: ID
  scope: QuickActionScope
  sortOrder: Int
}

input ReorderQuickActionsInput {
  tenantId: ID!
  scope: QuickActionScope
  orderedIds: [ID!]!
}

extend type Query {
  # Scope defaults to "thread" server-side when omitted so older clients
  # continue to see the Threads list.
  userQuickActions(tenantId: ID!, scope: QuickActionScope): [UserQuickAction!]!
}

extend type Mutation {
  createQuickAction(input: CreateQuickActionInput!): UserQuickAction!
  updateQuickAction(id: ID!, input: UpdateQuickActionInput!): UserQuickAction!
  deleteQuickAction(id: ID!): Boolean!
  reorderQuickActions(input: ReorderQuickActionsInput!): [UserQuickAction!]!
}
