|
1 | | -import type { Branch } from '../branching'; |
2 | | -import { z } from 'zod'; |
3 | | - |
4 | | -// Message Context Types |
5 | | -export enum MessageContextType { |
6 | | - FILE = 'file', |
7 | | - HIGHLIGHT = 'highlight', |
8 | | - IMAGE = 'image', |
9 | | - ERROR = 'error', |
10 | | - BRANCH = 'branch', |
11 | | - AGENT_RULE = 'agent_rule', |
12 | | -} |
13 | | - |
14 | | -type BaseMessageContext = { |
15 | | - type: MessageContextType; |
16 | | - content: string; |
17 | | - displayName: string; |
18 | | -}; |
19 | | - |
20 | | -export type FileMessageContext = BaseMessageContext & { |
21 | | - type: MessageContextType.FILE; |
22 | | - path: string; |
23 | | - branchId: string; |
24 | | -}; |
25 | | - |
26 | | -export type HighlightMessageContext = BaseMessageContext & { |
27 | | - type: MessageContextType.HIGHLIGHT; |
28 | | - path: string; |
29 | | - start: number; |
30 | | - end: number; |
31 | | - oid?: string; |
32 | | - branchId: string; |
33 | | -}; |
34 | | - |
35 | | -export type ImageMessageContext = BaseMessageContext & { |
36 | | - type: MessageContextType.IMAGE; |
37 | | - mimeType: string; |
38 | | - id?: string; |
39 | | - source: 'external' | 'local'; |
40 | | - path?: string; |
41 | | - branchId?: string; |
42 | | -}; |
43 | | - |
44 | | -export type ErrorMessageContext = BaseMessageContext & { |
45 | | - type: MessageContextType.ERROR; |
46 | | - branchId: string; |
47 | | -}; |
48 | | - |
49 | | -export type BranchMessageContext = BaseMessageContext & { |
50 | | - type: MessageContextType.BRANCH; |
51 | | - branch: Branch; |
52 | | -}; |
53 | | - |
54 | | -export type AgentRuleMessageContext = BaseMessageContext & { |
55 | | - type: MessageContextType.AGENT_RULE; |
56 | | - path: string; |
57 | | -}; |
58 | | - |
59 | | -export type MessageContext = |
60 | | - | FileMessageContext |
61 | | - | HighlightMessageContext |
62 | | - | ImageMessageContext |
63 | | - | ErrorMessageContext |
64 | | - | BranchMessageContext |
65 | | - | AgentRuleMessageContext; |
66 | | - |
67 | | -// Message Checkpoint Types |
68 | | -export enum MessageCheckpointType { |
69 | | - GIT = 'git', |
70 | | -} |
71 | | - |
72 | | -interface BaseMessageCheckpoint { |
73 | | - type: MessageCheckpointType; |
74 | | - createdAt: Date; |
75 | | -} |
76 | | - |
77 | | -export interface GitMessageCheckpoint extends BaseMessageCheckpoint { |
78 | | - type: MessageCheckpointType.GIT; |
79 | | - oid: string; |
80 | | - branchId?: string; |
81 | | -} |
82 | | - |
83 | | -export type MessageCheckpoints = GitMessageCheckpoint; |
84 | | - |
85 | | -// Agent Types |
86 | | -export enum AgentType { |
87 | | - ROOT = "root", |
88 | | - USER = "user", |
89 | | -} |
90 | | - |
91 | | -// Chat Suggestion |
92 | | -export interface ChatSuggestion { |
93 | | - title: string; |
94 | | - prompt: string; |
95 | | -} |
96 | | - |
97 | | -export const ChatSuggestionsSchema = z.object({ |
98 | | - suggestions: z.array(z.object({ |
99 | | - title: z.string(), |
100 | | - prompt: z.string(), |
101 | | - })), |
102 | | -}); |
103 | | - |
104 | | -// Message parts type (generic - actual structure defined by AI SDK) |
105 | | -export type MessagePart = any; |
| 1 | +export * from './conversation/'; |
| 2 | +export * from './message/'; |
| 3 | +export * from './response'; |
| 4 | +export * from './suggestion'; |
0 commit comments