workspaceKnowledge.ts 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /** Bot-mode state only. File-backed records never inherit a Hermes Profile ID. */
  2. export type MemoryScope = 'agent' | 'user' | 'project'
  3. export interface WorkspaceProject {
  4. id: string
  5. name: string
  6. description: string
  7. memberIds: string[]
  8. groupIds: string[]
  9. revision: number
  10. archived: boolean
  11. createdAt: number
  12. updatedAt: number
  13. }
  14. export interface WorkspaceMemorySource { messageId: string; conversationId: string; taskId?: string; quote?: string }
  15. export interface WorkspaceMemory {
  16. id: string
  17. scope: MemoryScope
  18. agentId: string
  19. projectId?: string
  20. content: string
  21. topic?: string
  22. tier: 'profile' | 'log' | 'note'
  23. origin: 'explicit' | 'synthesis' | 'manual'
  24. sources: WorkspaceMemorySource[]
  25. revision: number
  26. createdAt: number
  27. updatedAt: number
  28. conflict?: boolean
  29. }
  30. export interface WorkspaceMemoryRevision {
  31. id: string
  32. memoryId: string
  33. revision: number
  34. operation: 'write' | 'forget'
  35. actor: string
  36. at: number
  37. before?: WorkspaceMemory
  38. after?: WorkspaceMemory
  39. }
  40. export interface WorkspaceMemoryJob {
  41. id: string
  42. agentId: string
  43. projectId?: string
  44. runId: string
  45. relatedRunIds?: string[]
  46. sourceMessageId: string
  47. status: 'pending' | 'running' | 'complete' | 'failed' | 'skipped'
  48. attempts: number
  49. nextAt: number
  50. createdAt: number
  51. updatedAt: number
  52. error?: string
  53. }
  54. export interface WorkspacePeerMessage {
  55. id: string
  56. chainId: string
  57. fromAgentId: string
  58. toAgentId?: string
  59. targetGroupId?: string
  60. originConversationId: string
  61. originTaskId?: string
  62. originProjectId?: string
  63. sourceRunId: string
  64. conversationId: string
  65. taskId?: string
  66. replyTo?: string
  67. content: string
  68. fileIds: string[]
  69. depth: number
  70. priority: boolean
  71. status: 'queued' | 'running' | 'waiting' | 'complete' | 'failed' | 'stopped'
  72. runId?: string
  73. error?: string
  74. createdAt: number
  75. updatedAt: number
  76. }