workspace.ts 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. /** Application-owned identities. Hermes profile/session IDs never identify a chat. */
  2. export interface WorkspaceAgent {
  3. id: string
  4. name: string
  5. avatar: string
  6. instructions: string
  7. nodeId: string
  8. profile: string
  9. archived: boolean
  10. revision: number
  11. createdAt: number
  12. updatedAt: number
  13. }
  14. export interface WorkspaceMemberRole {
  15. name: string
  16. description: string
  17. }
  18. export interface WorkspaceConversation {
  19. id: string
  20. kind: 'direct' | 'group'
  21. name: string
  22. avatar: string
  23. memberIds: string[]
  24. memberRoles?: Record<string, WorkspaceMemberRole>
  25. instructions: string
  26. administratorId: string
  27. mode: 'host' | 'free'
  28. autoReplyIds: string[]
  29. maxReplyRounds: number
  30. archived: boolean
  31. pinned: boolean
  32. readSeq: number
  33. lastSeq: number
  34. lastMessageAt?: number
  35. preview: string
  36. previewAgentId?: string
  37. activeRunId?: string
  38. activeAgentId?: string
  39. activeRunStatus?: WorkspaceRun['status']
  40. activeAgentStates?: Record<string, 'running' | 'waiting' | 'uncertain' | 'queued'>
  41. avatarSignals?: Record<string, { id: string; state: 'success' | 'failure'; at: number }>
  42. queuedMessageCount?: number
  43. unreadCount?: number
  44. createdAt: number
  45. updatedAt: number
  46. }
  47. export interface WorkspaceFile {
  48. id: string
  49. name: string
  50. mimeType: string
  51. size: number
  52. createdAt: number
  53. sourcePath?: string
  54. conversationId?: string
  55. messageId?: string
  56. profile?: string
  57. sender: 'user' | 'agent'
  58. }
  59. export interface WorkspaceMessage {
  60. id: string
  61. conversationId: string
  62. seq: number
  63. role: 'user' | 'assistant' | 'system'
  64. agentId?: string
  65. agentName?: string
  66. content: string
  67. reasoning: string
  68. runId?: string
  69. taskId?: string
  70. visible?: boolean
  71. error?: string
  72. status: 'queued' | 'streaming' | 'complete' | 'failed' | 'interrupted' | 'uncertain'
  73. attachments: WorkspaceFile[]
  74. tools: Array<Record<string, unknown>>
  75. createdAt: number
  76. }
  77. export interface WorkspaceRun {
  78. id: string
  79. conversationId: string
  80. messageId: string
  81. mentionIds: string[]
  82. activeAgentId?: string
  83. status: 'queued' | 'running' | 'waiting' | 'complete' | 'failed' | 'interrupted' | 'uncertain'
  84. round: number
  85. error?: string
  86. stopRequested?: boolean
  87. createdAt: number
  88. updatedAt: number
  89. }
  90. export interface WorkspaceInteraction {
  91. id: string
  92. conversationId: string
  93. runId: string
  94. agentId: string
  95. kind: 'approval' | 'clarification'
  96. message: string
  97. choices: string[]
  98. resolved: boolean
  99. }
  100. export interface WorkspaceEvent {
  101. seq: number
  102. type: string
  103. conversationId?: string
  104. data: unknown
  105. }
  106. export interface WorkspaceSource {
  107. nodeId: string
  108. profile: string
  109. name: string
  110. }