-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathcommandcode.go
More file actions
77 lines (69 loc) · 2.43 KB
/
Copy pathcommandcode.go
File metadata and controls
77 lines (69 loc) · 2.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
package api
// CommandCode API types (internal)
type CCToolOutput struct {
Type string `json:"type"`
Value string `json:"value"`
}
type CCContentPart struct {
Type string `json:"type"`
Text *string `json:"text,omitempty"`
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
Input any `json:"input,omitempty"`
ToolCallID *string `json:"toolCallId,omitempty"`
ToolName *string `json:"toolName,omitempty"`
Output *CCToolOutput `json:"output,omitempty"`
ToolUseID *string `json:"tool_use_id,omitempty"`
Content any `json:"content,omitempty"`
}
type CCMessage struct {
Role string `json:"role"`
Content []CCContentPart `json:"content"`
}
type CCChatParams struct {
Model string `json:"model"`
Messages []CCMessage `json:"messages"`
Tools []any `json:"tools"`
System string `json:"system"`
MaxTokens int `json:"max_tokens"`
Temperature float64 `json:"temperature"`
Stream bool `json:"stream"`
Reasoning string `json:"reasoning,omitempty"`
}
type CCConfig struct {
WorkingDir string `json:"workingDir"`
Date string `json:"date"`
Environment string `json:"environment"`
Structure []string `json:"structure"`
IsGitRepo bool `json:"isGitRepo"`
CurrentBranch string `json:"currentBranch"`
MainBranch string `json:"mainBranch"`
GitStatus string `json:"gitStatus"`
RecentCommits []string `json:"recentCommits"`
}
type CCRequestBody struct {
Config CCConfig `json:"config"`
Memory string `json:"memory"`
Taste string `json:"taste"`
Skills string `json:"skills"`
Params CCChatParams `json:"params"`
ThreadID string `json:"threadId"`
}
type CCStreamEvent struct {
Type string `json:"type"`
Text string `json:"text"`
ID string `json:"id"`
Delta string `json:"delta"`
Input map[string]any `json:"input"`
ToolCallID string `json:"toolCallId"`
ToolName string `json:"toolName"`
FinishReason string `json:"finishReason"`
Error *struct {
Message string `json:"message"`
StatusCode *int `json:"statusCode"`
} `json:"error"`
TotalUsage *struct {
InputTokens int `json:"inputTokens"`
OutputTokens int `json:"outputTokens"`
} `json:"totalUsage"`
}