-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtypes.go
More file actions
137 lines (113 loc) · 3.86 KB
/
Copy pathtypes.go
File metadata and controls
137 lines (113 loc) · 3.86 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
package agents
import "net/http"
// --- Sandbox types ---
type CreateSandboxRequest struct {
Agent string `json:"agent"`
Files map[string]string `json:"files,omitempty"`
Envs map[string]string `json:"envs,omitempty"`
Setup []string `json:"setup,omitempty"`
TimeoutMs *int `json:"timeoutMs,omitempty"`
NetworkAllowOut []string `json:"networkAllowOut,omitempty"`
NetworkDenyOut []string `json:"networkDenyOut,omitempty"`
}
type Sandbox struct {
ID string `json:"id"`
SandboxID string `json:"sandboxId"`
Status string `json:"status"`
CreatedAt string `json:"createdAt"`
}
type SandboxDetail struct {
ID string `json:"id"`
SandboxID string `json:"sandboxId"`
Status string `json:"status"`
Error *string `json:"error,omitempty"`
Agent SandboxAgent `json:"agent"`
Threads []ThreadSummary `json:"threads"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
type SandboxAgent struct {
Slug string `json:"slug"`
Name string `json:"name"`
}
// --- Thread types ---
type ThreadSummary struct {
ID string `json:"id"`
Name *string `json:"name,omitempty"`
Status string `json:"status"`
CreatedAt string `json:"createdAt"`
}
type Thread struct {
ID string `json:"id"`
Name *string `json:"name,omitempty"`
Status string `json:"status"`
Messages interface{} `json:"messages,omitempty"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
type RunThreadMessage struct {
ID string `json:"id,omitempty"`
Role string `json:"role"`
Parts []map[string]interface{} `json:"parts"`
}
// AgentRequestOptions holds per-invocation agent configuration options.
type AgentRequestOptions struct {
Model string `json:"model,omitempty"`
SystemPrompt any `json:"systemPrompt,omitempty"`
MaxTurns int `json:"maxTurns,omitempty"`
MaxBudgetUsd float64 `json:"maxBudgetUsd,omitempty"`
PermissionMode string `json:"permissionMode,omitempty"`
DisallowedTools []string `json:"disallowedTools,omitempty"`
}
type RunThreadRequest struct {
Agent string `json:"agent"`
Messages []RunThreadMessage `json:"messages"`
SandboxID string `json:"sandboxId,omitempty"`
ThreadID string `json:"threadId,omitempty"`
Name string `json:"name,omitempty"`
Options *AgentRequestOptions `json:"options,omitempty"`
}
type RunThreadResult struct {
SandboxID string `json:"sandboxId"`
ThreadID string `json:"threadId"`
Response *http.Response `json:"-"`
ResumeURL string `json:"resumeUrl"`
}
// --- Token types ---
type CreateTokenRequest struct {
Agent string `json:"agent,omitempty"`
UserID string `json:"userId,omitempty"`
ExpiresIn string `json:"expiresIn,omitempty"`
}
type Token struct {
Token string `json:"token"`
ExpiresAt string `json:"expiresAt"`
}
// --- File types ---
type FileContent struct {
Path string `json:"path"`
Content string `json:"content"`
}
// --- Exec types ---
type ExecRequest struct {
SandboxID string `json:"sandboxId"`
Command string `json:"command"`
Cwd string `json:"cwd,omitempty"`
Envs map[string]string `json:"envs,omitempty"`
TimeoutMs *int `json:"timeoutMs,omitempty"`
}
type ExecResult struct {
ExitCode int `json:"exitCode"`
Stdout string `json:"stdout"`
Stderr string `json:"stderr"`
}
// --- Git types ---
type GitCloneRequest struct {
URL string `json:"url"`
Path string `json:"path,omitempty"`
Token string `json:"token,omitempty"`
Depth *int `json:"depth,omitempty"`
}
type GitCloneResult struct {
Path string `json:"path"`
}