agentTasks.ts 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. export interface TaskOrigin {
  2. conversationId: string
  3. conversationTaskId?: string
  4. runId: string
  5. agentId: string
  6. }
  7. export interface AgentGoal {
  8. id: string
  9. conversationId: string
  10. coordinatorId: string
  11. authorityRevision: number
  12. authorizationVersion?: number
  13. activation?: number
  14. objective: string
  15. acceptanceCriteria: string[]
  16. /** Changes only when acceptance criteria change, independently of progress. */
  17. acceptanceRevision?: number
  18. status: 'running' | 'review' | 'waiting' | 'blocked' | 'complete' | 'cancelling' | 'cancelled'
  19. origin: TaskOrigin
  20. result?: string
  21. checks?: Array<{ criterion: number; passed: boolean; evidence: string }>
  22. artifactIds: string[]
  23. revision: number
  24. automaticWakes: number
  25. reviewRunId?: string
  26. reportingRunId?: string
  27. lastReviewedBatch?: string
  28. createdAt: number
  29. updatedAt: number
  30. }
  31. export interface AgentAssignment {
  32. id: string
  33. goalId: string
  34. conversationId: string
  35. agentId: string
  36. title: string
  37. brief: string
  38. acceptanceCriteria: string[]
  39. dependsOn: string[]
  40. status: 'pending' | 'running' | 'review' | 'complete' | 'failed' | 'blocked' | 'cancelling' | 'cancelled'
  41. attempt: number
  42. maxAttempts?: number
  43. /** Server-owned source run for this assignment and its retries. */
  44. sourceRunId?: string
  45. runId?: string
  46. result?: string
  47. review?: string
  48. artifactIds: string[]
  49. createdAt: number
  50. updatedAt: number
  51. }
  52. export interface TaskDelivery {
  53. id: string
  54. goalId: string
  55. kind: 'review' | 'terminal'
  56. status: 'pending' | 'delivered' | 'suppressed'
  57. targetConversationId: string
  58. targetTaskId?: string
  59. runId?: string
  60. createdAt: number
  61. }