workspace.ts 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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 WorkspaceConversation {
  15. id: string
  16. kind: 'direct' | 'group'
  17. name: string
  18. avatar: string
  19. memberIds: string[]
  20. instructions: string
  21. administratorId: string
  22. mode: 'host' | 'free'
  23. autoReplyIds: string[]
  24. maxReplyRounds: number
  25. archived: boolean
  26. pinned: boolean
  27. readSeq: number
  28. lastSeq: number
  29. lastMessageAt?: number
  30. preview: string
  31. activeRunId?: string
  32. activeAgentId?: string
  33. activeRunStatus?: WorkspaceRun['status']
  34. createdAt: number
  35. updatedAt: number
  36. }
  37. export interface WorkspaceFile {
  38. id: string
  39. name: string
  40. mimeType: string
  41. size: number
  42. createdAt: number
  43. sourcePath?: string
  44. conversationId?: string
  45. messageId?: string
  46. profile?: string
  47. sender: 'user' | 'agent'
  48. }
  49. export interface WorkspaceMessage {
  50. id: string
  51. conversationId: string
  52. seq: number
  53. role: 'user' | 'assistant' | 'system'
  54. agentId?: string
  55. agentName?: string
  56. content: string
  57. reasoning: string
  58. runId?: string
  59. status: 'queued' | 'streaming' | 'complete' | 'failed' | 'interrupted' | 'uncertain'
  60. attachments: WorkspaceFile[]
  61. tools: Array<Record<string, unknown>>
  62. createdAt: number
  63. }
  64. export interface WorkspaceRun {
  65. id: string
  66. conversationId: string
  67. messageId: string
  68. mentionIds: string[]
  69. activeAgentId?: string
  70. status: 'queued' | 'running' | 'waiting' | 'complete' | 'failed' | 'interrupted' | 'uncertain'
  71. round: number
  72. error?: string
  73. createdAt: number
  74. updatedAt: number
  75. }
  76. export interface WorkspaceInteraction {
  77. id: string
  78. conversationId: string
  79. runId: string
  80. agentId: string
  81. kind: 'approval' | 'clarification'
  82. message: string
  83. choices: string[]
  84. resolved: boolean
  85. }
  86. export interface WorkspaceEvent {
  87. seq: number
  88. type: string
  89. conversationId?: string
  90. data: unknown
  91. }
  92. export interface WorkspaceSource {
  93. nodeId: string
  94. profile: string
  95. name: string
  96. }