@slopus/happy-agent-client 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/README.md +17 -0
  2. package/dist/HappyAgentApiError.d.ts +41 -0
  3. package/dist/HappyAgentApiError.d.ts.map +1 -0
  4. package/dist/HappyAgentApiError.js +57 -0
  5. package/dist/HappyAgentApiError.js.map +1 -0
  6. package/dist/HappyAgentClient.d.ts +256 -0
  7. package/dist/HappyAgentClient.d.ts.map +1 -0
  8. package/dist/HappyAgentClient.js +739 -0
  9. package/dist/HappyAgentClient.js.map +1 -0
  10. package/dist/endpointUrl.d.ts +14 -0
  11. package/dist/endpointUrl.d.ts.map +1 -0
  12. package/dist/endpointUrl.js +27 -0
  13. package/dist/endpointUrl.js.map +1 -0
  14. package/dist/index.d.ts +26 -0
  15. package/dist/index.d.ts.map +1 -0
  16. package/dist/index.js +22 -0
  17. package/dist/index.js.map +1 -0
  18. package/dist/protocol/agents.d.ts +116 -0
  19. package/dist/protocol/agents.d.ts.map +1 -0
  20. package/dist/protocol/agents.js +3 -0
  21. package/dist/protocol/agents.js.map +1 -0
  22. package/dist/protocol/bootstrap.d.ts +28 -0
  23. package/dist/protocol/bootstrap.d.ts.map +1 -0
  24. package/dist/protocol/bootstrap.js +3 -0
  25. package/dist/protocol/bootstrap.js.map +1 -0
  26. package/dist/protocol/common.d.ts +104 -0
  27. package/dist/protocol/common.d.ts.map +1 -0
  28. package/dist/protocol/common.js +92 -0
  29. package/dist/protocol/common.js.map +1 -0
  30. package/dist/protocol/daemon.d.ts +486 -0
  31. package/dist/protocol/daemon.d.ts.map +1 -0
  32. package/dist/protocol/daemon.js +210 -0
  33. package/dist/protocol/daemon.js.map +1 -0
  34. package/dist/protocol/events.d.ts +208 -0
  35. package/dist/protocol/events.d.ts.map +1 -0
  36. package/dist/protocol/events.js +9 -0
  37. package/dist/protocol/events.js.map +1 -0
  38. package/dist/protocol/files.d.ts +74 -0
  39. package/dist/protocol/files.d.ts.map +1 -0
  40. package/dist/protocol/files.js +8 -0
  41. package/dist/protocol/files.js.map +1 -0
  42. package/dist/protocol/git.d.ts +55 -0
  43. package/dist/protocol/git.d.ts.map +1 -0
  44. package/dist/protocol/git.js +3 -0
  45. package/dist/protocol/git.js.map +1 -0
  46. package/dist/protocol/messages.d.ts +210 -0
  47. package/dist/protocol/messages.d.ts.map +1 -0
  48. package/dist/protocol/messages.js +8 -0
  49. package/dist/protocol/messages.js.map +1 -0
  50. package/dist/protocol/processes.d.ts +26 -0
  51. package/dist/protocol/processes.d.ts.map +1 -0
  52. package/dist/protocol/processes.js +3 -0
  53. package/dist/protocol/processes.js.map +1 -0
  54. package/dist/protocol/profile.d.ts +40 -0
  55. package/dist/protocol/profile.d.ts.map +1 -0
  56. package/dist/protocol/profile.js +23 -0
  57. package/dist/protocol/profile.js.map +1 -0
  58. package/dist/protocol/projects.d.ts +377 -0
  59. package/dist/protocol/projects.d.ts.map +1 -0
  60. package/dist/protocol/projects.js +107 -0
  61. package/dist/protocol/projects.js.map +1 -0
  62. package/dist/protocol/questions.d.ts +54 -0
  63. package/dist/protocol/questions.d.ts.map +1 -0
  64. package/dist/protocol/questions.js +3 -0
  65. package/dist/protocol/questions.js.map +1 -0
  66. package/dist/protocol/terminals.d.ts +50 -0
  67. package/dist/protocol/terminals.d.ts.map +1 -0
  68. package/dist/protocol/terminals.js +3 -0
  69. package/dist/protocol/terminals.js.map +1 -0
  70. package/dist/protocol/usage.d.ts +27 -0
  71. package/dist/protocol/usage.d.ts.map +1 -0
  72. package/dist/protocol/usage.js +9 -0
  73. package/dist/protocol/usage.js.map +1 -0
  74. package/dist/protocol/workspaces.d.ts +216 -0
  75. package/dist/protocol/workspaces.d.ts.map +1 -0
  76. package/dist/protocol/workspaces.js +87 -0
  77. package/dist/protocol/workspaces.js.map +1 -0
  78. package/dist/readEventStream.d.ts +19 -0
  79. package/dist/readEventStream.d.ts.map +1 -0
  80. package/dist/readEventStream.js +46 -0
  81. package/dist/readEventStream.js.map +1 -0
  82. package/dist/readSseFrames.d.ts +20 -0
  83. package/dist/readSseFrames.d.ts.map +1 -0
  84. package/dist/readSseFrames.js +77 -0
  85. package/dist/readSseFrames.js.map +1 -0
  86. package/dist/requestOptions.d.ts +44 -0
  87. package/dist/requestOptions.d.ts.map +1 -0
  88. package/dist/requestOptions.js +9 -0
  89. package/dist/requestOptions.js.map +1 -0
  90. package/package.json +42 -0
@@ -0,0 +1,377 @@
1
+ /** Projects: a folder registered with the daemon, or a repository it cloned. */
2
+ import { type Static } from "@sinclair/typebox";
3
+ import type { Agent } from "./agents.js";
4
+ /** Where a cloned project came from; `null` for a registered local folder. */
5
+ export declare const remoteSourceSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
6
+ kind: import("@sinclair/typebox").TLiteral<"github">;
7
+ repository: import("@sinclair/typebox").TString;
8
+ }>, import("@sinclair/typebox").TObject<{
9
+ kind: import("@sinclair/typebox").TLiteral<"git">;
10
+ url: import("@sinclair/typebox").TString;
11
+ }>]>;
12
+ export type RemoteSource = Static<typeof remoteSourceSchema>;
13
+ /**
14
+ * The project picture.
15
+ *
16
+ * The built-in home project — the user's machine outside any repository —
17
+ * carries `{ kind: "home" }` and has no image bytes to fetch.
18
+ */
19
+ export declare const projectAvatarSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
20
+ kind: import("@sinclair/typebox").TLiteral<"image">;
21
+ source: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"user">, import("@sinclair/typebox").TLiteral<"generated">]>;
22
+ thumbhash: import("@sinclair/typebox").TString;
23
+ }>, import("@sinclair/typebox").TObject<{
24
+ kind: import("@sinclair/typebox").TLiteral<"home">;
25
+ }>]>;
26
+ export type ProjectAvatar = Static<typeof projectAvatarSchema>;
27
+ export declare const projectSettingsSchema: import("@sinclair/typebox").TObject<{
28
+ /** Where new workspaces of this project run. */
29
+ defaultWorkspaceCompute: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
30
+ type: import("@sinclair/typebox").TLiteral<"host">;
31
+ }>, import("@sinclair/typebox").TObject<{
32
+ image: import("@sinclair/typebox").TString;
33
+ type: import("@sinclair/typebox").TLiteral<"docker">;
34
+ }>]>;
35
+ }>;
36
+ export type ProjectSettings = Static<typeof projectSettingsSchema>;
37
+ /** The project object. A project is also the root workspace of its tree. */
38
+ export declare const projectSchema: import("@sinclair/typebox").TObject<{
39
+ /** Ordered top-level agents rooted directly in this project workspace. */
40
+ agents: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnsafe<Agent>>;
41
+ archivedAt: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TInteger, import("@sinclair/typebox").TNull]>;
42
+ avatar: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
43
+ kind: import("@sinclair/typebox").TLiteral<"image">;
44
+ source: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"user">, import("@sinclair/typebox").TLiteral<"generated">]>;
45
+ thumbhash: import("@sinclair/typebox").TString;
46
+ }>, import("@sinclair/typebox").TObject<{
47
+ kind: import("@sinclair/typebox").TLiteral<"home">;
48
+ }>]>, import("@sinclair/typebox").TNull]>;
49
+ compute: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
50
+ path: import("@sinclair/typebox").TString;
51
+ type: import("@sinclair/typebox").TLiteral<"host">;
52
+ }>, import("@sinclair/typebox").TObject<{
53
+ image: import("@sinclair/typebox").TString;
54
+ type: import("@sinclair/typebox").TLiteral<"docker">;
55
+ }>]>;
56
+ createdAt: import("@sinclair/typebox").TInteger;
57
+ defaultBranch: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
58
+ description: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
59
+ /** `null` when the folder is not a Git repository. */
60
+ git: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
61
+ ahead: import("@sinclair/typebox").TInteger;
62
+ behind: import("@sinclair/typebox").TInteger;
63
+ branch: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>>;
64
+ detached: import("@sinclair/typebox").TBoolean;
65
+ head: import("@sinclair/typebox").TString;
66
+ upstream: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
67
+ }>, import("@sinclair/typebox").TNull]>;
68
+ id: import("@sinclair/typebox").TString;
69
+ initialization: import("@sinclair/typebox").TObject<{
70
+ attempt: import("@sinclair/typebox").TInteger;
71
+ error: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
72
+ status: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"initializing">, import("@sinclair/typebox").TLiteral<"ready">, import("@sinclair/typebox").TLiteral<"failed">]>;
73
+ }>;
74
+ name: import("@sinclair/typebox").TString;
75
+ /** Where the name came from; a user-chosen name is never derived over. */
76
+ nameSource: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"folder">, import("@sinclair/typebox").TLiteral<"user">]>;
77
+ /** An opaque sort key; clients order projects by comparing these strings. */
78
+ orderKey: import("@sinclair/typebox").TString;
79
+ remoteSource: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
80
+ kind: import("@sinclair/typebox").TLiteral<"github">;
81
+ repository: import("@sinclair/typebox").TString;
82
+ }>, import("@sinclair/typebox").TObject<{
83
+ kind: import("@sinclair/typebox").TLiteral<"git">;
84
+ url: import("@sinclair/typebox").TString;
85
+ }>]>, import("@sinclair/typebox").TNull]>;
86
+ settings: import("@sinclair/typebox").TObject<{
87
+ /** Where new workspaces of this project run. */
88
+ defaultWorkspaceCompute: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
89
+ type: import("@sinclair/typebox").TLiteral<"host">;
90
+ }>, import("@sinclair/typebox").TObject<{
91
+ image: import("@sinclair/typebox").TString;
92
+ type: import("@sinclair/typebox").TLiteral<"docker">;
93
+ }>]>;
94
+ }>;
95
+ status: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"active">, import("@sinclair/typebox").TLiteral<"archived">]>;
96
+ updatedAt: import("@sinclair/typebox").TInteger;
97
+ version: import("@sinclair/typebox").TString;
98
+ /** Whether child workspaces can be created as Git worktrees. */
99
+ worktreeSupport: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"supported">, import("@sinclair/typebox").TLiteral<"unsupported">, import("@sinclair/typebox").TLiteral<"unknown">]>;
100
+ /** Accompanies `worktreeSupport` of `"unsupported"`. */
101
+ worktreeUnsupportedReason: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
102
+ }>;
103
+ export type Project = Static<typeof projectSchema>;
104
+ /** `GET /v0/projects` */
105
+ export declare const projectListResponseSchema: import("@sinclair/typebox").TObject<{
106
+ projects: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
107
+ /** Ordered top-level agents rooted directly in this project workspace. */
108
+ agents: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnsafe<Agent>>;
109
+ archivedAt: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TInteger, import("@sinclair/typebox").TNull]>;
110
+ avatar: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
111
+ kind: import("@sinclair/typebox").TLiteral<"image">;
112
+ source: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"user">, import("@sinclair/typebox").TLiteral<"generated">]>;
113
+ thumbhash: import("@sinclair/typebox").TString;
114
+ }>, import("@sinclair/typebox").TObject<{
115
+ kind: import("@sinclair/typebox").TLiteral<"home">;
116
+ }>]>, import("@sinclair/typebox").TNull]>;
117
+ compute: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
118
+ path: import("@sinclair/typebox").TString;
119
+ type: import("@sinclair/typebox").TLiteral<"host">;
120
+ }>, import("@sinclair/typebox").TObject<{
121
+ image: import("@sinclair/typebox").TString;
122
+ type: import("@sinclair/typebox").TLiteral<"docker">;
123
+ }>]>;
124
+ createdAt: import("@sinclair/typebox").TInteger;
125
+ defaultBranch: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
126
+ description: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
127
+ /** `null` when the folder is not a Git repository. */
128
+ git: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
129
+ ahead: import("@sinclair/typebox").TInteger;
130
+ behind: import("@sinclair/typebox").TInteger;
131
+ branch: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>>;
132
+ detached: import("@sinclair/typebox").TBoolean;
133
+ head: import("@sinclair/typebox").TString;
134
+ upstream: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
135
+ }>, import("@sinclair/typebox").TNull]>;
136
+ id: import("@sinclair/typebox").TString;
137
+ initialization: import("@sinclair/typebox").TObject<{
138
+ attempt: import("@sinclair/typebox").TInteger;
139
+ error: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
140
+ status: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"initializing">, import("@sinclair/typebox").TLiteral<"ready">, import("@sinclair/typebox").TLiteral<"failed">]>;
141
+ }>;
142
+ name: import("@sinclair/typebox").TString;
143
+ /** Where the name came from; a user-chosen name is never derived over. */
144
+ nameSource: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"folder">, import("@sinclair/typebox").TLiteral<"user">]>;
145
+ /** An opaque sort key; clients order projects by comparing these strings. */
146
+ orderKey: import("@sinclair/typebox").TString;
147
+ remoteSource: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
148
+ kind: import("@sinclair/typebox").TLiteral<"github">;
149
+ repository: import("@sinclair/typebox").TString;
150
+ }>, import("@sinclair/typebox").TObject<{
151
+ kind: import("@sinclair/typebox").TLiteral<"git">;
152
+ url: import("@sinclair/typebox").TString;
153
+ }>]>, import("@sinclair/typebox").TNull]>;
154
+ settings: import("@sinclair/typebox").TObject<{
155
+ /** Where new workspaces of this project run. */
156
+ defaultWorkspaceCompute: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
157
+ type: import("@sinclair/typebox").TLiteral<"host">;
158
+ }>, import("@sinclair/typebox").TObject<{
159
+ image: import("@sinclair/typebox").TString;
160
+ type: import("@sinclair/typebox").TLiteral<"docker">;
161
+ }>]>;
162
+ }>;
163
+ status: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"active">, import("@sinclair/typebox").TLiteral<"archived">]>;
164
+ updatedAt: import("@sinclair/typebox").TInteger;
165
+ version: import("@sinclair/typebox").TString;
166
+ /** Whether child workspaces can be created as Git worktrees. */
167
+ worktreeSupport: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"supported">, import("@sinclair/typebox").TLiteral<"unsupported">, import("@sinclair/typebox").TLiteral<"unknown">]>;
168
+ /** Accompanies `worktreeSupport` of `"unsupported"`. */
169
+ worktreeUnsupportedReason: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
170
+ }>>;
171
+ }>;
172
+ export type ProjectListResponse = Static<typeof projectListResponseSchema>;
173
+ /** Every single-project route answers with this. */
174
+ export declare const projectResponseSchema: import("@sinclair/typebox").TObject<{
175
+ project: import("@sinclair/typebox").TObject<{
176
+ /** Ordered top-level agents rooted directly in this project workspace. */
177
+ agents: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnsafe<Agent>>;
178
+ archivedAt: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TInteger, import("@sinclair/typebox").TNull]>;
179
+ avatar: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
180
+ kind: import("@sinclair/typebox").TLiteral<"image">;
181
+ source: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"user">, import("@sinclair/typebox").TLiteral<"generated">]>;
182
+ thumbhash: import("@sinclair/typebox").TString;
183
+ }>, import("@sinclair/typebox").TObject<{
184
+ kind: import("@sinclair/typebox").TLiteral<"home">;
185
+ }>]>, import("@sinclair/typebox").TNull]>;
186
+ compute: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
187
+ path: import("@sinclair/typebox").TString;
188
+ type: import("@sinclair/typebox").TLiteral<"host">;
189
+ }>, import("@sinclair/typebox").TObject<{
190
+ image: import("@sinclair/typebox").TString;
191
+ type: import("@sinclair/typebox").TLiteral<"docker">;
192
+ }>]>;
193
+ createdAt: import("@sinclair/typebox").TInteger;
194
+ defaultBranch: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
195
+ description: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
196
+ /** `null` when the folder is not a Git repository. */
197
+ git: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
198
+ ahead: import("@sinclair/typebox").TInteger;
199
+ behind: import("@sinclair/typebox").TInteger;
200
+ branch: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>>;
201
+ detached: import("@sinclair/typebox").TBoolean;
202
+ head: import("@sinclair/typebox").TString;
203
+ upstream: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
204
+ }>, import("@sinclair/typebox").TNull]>;
205
+ id: import("@sinclair/typebox").TString;
206
+ initialization: import("@sinclair/typebox").TObject<{
207
+ attempt: import("@sinclair/typebox").TInteger;
208
+ error: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
209
+ status: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"initializing">, import("@sinclair/typebox").TLiteral<"ready">, import("@sinclair/typebox").TLiteral<"failed">]>;
210
+ }>;
211
+ name: import("@sinclair/typebox").TString;
212
+ /** Where the name came from; a user-chosen name is never derived over. */
213
+ nameSource: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"folder">, import("@sinclair/typebox").TLiteral<"user">]>;
214
+ /** An opaque sort key; clients order projects by comparing these strings. */
215
+ orderKey: import("@sinclair/typebox").TString;
216
+ remoteSource: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
217
+ kind: import("@sinclair/typebox").TLiteral<"github">;
218
+ repository: import("@sinclair/typebox").TString;
219
+ }>, import("@sinclair/typebox").TObject<{
220
+ kind: import("@sinclair/typebox").TLiteral<"git">;
221
+ url: import("@sinclair/typebox").TString;
222
+ }>]>, import("@sinclair/typebox").TNull]>;
223
+ settings: import("@sinclair/typebox").TObject<{
224
+ /** Where new workspaces of this project run. */
225
+ defaultWorkspaceCompute: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
226
+ type: import("@sinclair/typebox").TLiteral<"host">;
227
+ }>, import("@sinclair/typebox").TObject<{
228
+ image: import("@sinclair/typebox").TString;
229
+ type: import("@sinclair/typebox").TLiteral<"docker">;
230
+ }>]>;
231
+ }>;
232
+ status: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"active">, import("@sinclair/typebox").TLiteral<"archived">]>;
233
+ updatedAt: import("@sinclair/typebox").TInteger;
234
+ version: import("@sinclair/typebox").TString;
235
+ /** Whether child workspaces can be created as Git worktrees. */
236
+ worktreeSupport: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"supported">, import("@sinclair/typebox").TLiteral<"unsupported">, import("@sinclair/typebox").TLiteral<"unknown">]>;
237
+ /** Accompanies `worktreeSupport` of `"unsupported"`. */
238
+ worktreeUnsupportedReason: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
239
+ }>;
240
+ }>;
241
+ export type ProjectResponse = Static<typeof projectResponseSchema>;
242
+ /** `PUT /v0/projects/:projectId/settings` */
243
+ export declare const projectSettingsResponseSchema: import("@sinclair/typebox").TObject<{
244
+ project: import("@sinclair/typebox").TObject<{
245
+ /** Ordered top-level agents rooted directly in this project workspace. */
246
+ agents: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnsafe<Agent>>;
247
+ archivedAt: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TInteger, import("@sinclair/typebox").TNull]>;
248
+ avatar: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
249
+ kind: import("@sinclair/typebox").TLiteral<"image">;
250
+ source: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"user">, import("@sinclair/typebox").TLiteral<"generated">]>;
251
+ thumbhash: import("@sinclair/typebox").TString;
252
+ }>, import("@sinclair/typebox").TObject<{
253
+ kind: import("@sinclair/typebox").TLiteral<"home">;
254
+ }>]>, import("@sinclair/typebox").TNull]>;
255
+ compute: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
256
+ path: import("@sinclair/typebox").TString;
257
+ type: import("@sinclair/typebox").TLiteral<"host">;
258
+ }>, import("@sinclair/typebox").TObject<{
259
+ image: import("@sinclair/typebox").TString;
260
+ type: import("@sinclair/typebox").TLiteral<"docker">;
261
+ }>]>;
262
+ createdAt: import("@sinclair/typebox").TInteger;
263
+ defaultBranch: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
264
+ description: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
265
+ /** `null` when the folder is not a Git repository. */
266
+ git: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
267
+ ahead: import("@sinclair/typebox").TInteger;
268
+ behind: import("@sinclair/typebox").TInteger;
269
+ branch: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>>;
270
+ detached: import("@sinclair/typebox").TBoolean;
271
+ head: import("@sinclair/typebox").TString;
272
+ upstream: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
273
+ }>, import("@sinclair/typebox").TNull]>;
274
+ id: import("@sinclair/typebox").TString;
275
+ initialization: import("@sinclair/typebox").TObject<{
276
+ attempt: import("@sinclair/typebox").TInteger;
277
+ error: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
278
+ status: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"initializing">, import("@sinclair/typebox").TLiteral<"ready">, import("@sinclair/typebox").TLiteral<"failed">]>;
279
+ }>;
280
+ name: import("@sinclair/typebox").TString;
281
+ /** Where the name came from; a user-chosen name is never derived over. */
282
+ nameSource: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"folder">, import("@sinclair/typebox").TLiteral<"user">]>;
283
+ /** An opaque sort key; clients order projects by comparing these strings. */
284
+ orderKey: import("@sinclair/typebox").TString;
285
+ remoteSource: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
286
+ kind: import("@sinclair/typebox").TLiteral<"github">;
287
+ repository: import("@sinclair/typebox").TString;
288
+ }>, import("@sinclair/typebox").TObject<{
289
+ kind: import("@sinclair/typebox").TLiteral<"git">;
290
+ url: import("@sinclair/typebox").TString;
291
+ }>]>, import("@sinclair/typebox").TNull]>;
292
+ settings: import("@sinclair/typebox").TObject<{
293
+ /** Where new workspaces of this project run. */
294
+ defaultWorkspaceCompute: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
295
+ type: import("@sinclair/typebox").TLiteral<"host">;
296
+ }>, import("@sinclair/typebox").TObject<{
297
+ image: import("@sinclair/typebox").TString;
298
+ type: import("@sinclair/typebox").TLiteral<"docker">;
299
+ }>]>;
300
+ }>;
301
+ status: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"active">, import("@sinclair/typebox").TLiteral<"archived">]>;
302
+ updatedAt: import("@sinclair/typebox").TInteger;
303
+ version: import("@sinclair/typebox").TString;
304
+ /** Whether child workspaces can be created as Git worktrees. */
305
+ worktreeSupport: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"supported">, import("@sinclair/typebox").TLiteral<"unsupported">, import("@sinclair/typebox").TLiteral<"unknown">]>;
306
+ /** Accompanies `worktreeSupport` of `"unsupported"`. */
307
+ worktreeUnsupportedReason: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
308
+ }>;
309
+ settings: import("@sinclair/typebox").TObject<{
310
+ /** Where new workspaces of this project run. */
311
+ defaultWorkspaceCompute: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
312
+ type: import("@sinclair/typebox").TLiteral<"host">;
313
+ }>, import("@sinclair/typebox").TObject<{
314
+ image: import("@sinclair/typebox").TString;
315
+ type: import("@sinclair/typebox").TLiteral<"docker">;
316
+ }>]>;
317
+ }>;
318
+ }>;
319
+ export type ProjectSettingsResponse = Static<typeof projectSettingsResponseSchema>;
320
+ /** `POST /v0/projects` — registers an existing local folder. */
321
+ export declare const registerProjectRequestSchema: import("@sinclair/typebox").TObject<{
322
+ /** The folder to register. Must exist and be a directory. */
323
+ path: import("@sinclair/typebox").TString;
324
+ /** Optional client-supplied ID, for callers that need it before the answer. */
325
+ projectId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
326
+ mutationId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
327
+ }>;
328
+ export type RegisterProjectRequest = Static<typeof registerProjectRequestSchema>;
329
+ /** `POST /v0/projects/clone` */
330
+ export declare const cloneProjectRequestSchema: import("@sinclair/typebox").TObject<{
331
+ /** The folder name for the clone. */
332
+ name: import("@sinclair/typebox").TString;
333
+ projectId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
334
+ mutationId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
335
+ /** Names the stored credential kind to clone with. */
336
+ secret: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
337
+ kind: import("@sinclair/typebox").TLiteral<"github">;
338
+ }>>;
339
+ source: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
340
+ kind: import("@sinclair/typebox").TLiteral<"github">;
341
+ repository: import("@sinclair/typebox").TString;
342
+ }>, import("@sinclair/typebox").TObject<{
343
+ kind: import("@sinclair/typebox").TLiteral<"git">;
344
+ url: import("@sinclair/typebox").TString;
345
+ }>]>;
346
+ }>;
347
+ export type CloneProjectRequest = Static<typeof cloneProjectRequestSchema>;
348
+ /** `PATCH /v0/projects/:projectId` */
349
+ export declare const renameProjectRequestSchema: import("@sinclair/typebox").TObject<{
350
+ mutationId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
351
+ name: import("@sinclair/typebox").TString;
352
+ }>;
353
+ export type RenameProjectRequest = Static<typeof renameProjectRequestSchema>;
354
+ /** `PUT /v0/projects/:projectId/settings` */
355
+ export declare const replaceProjectSettingsRequestSchema: import("@sinclair/typebox").TObject<{
356
+ defaultWorkspaceCompute: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
357
+ type: import("@sinclair/typebox").TLiteral<"host">;
358
+ }>, import("@sinclair/typebox").TObject<{
359
+ image: import("@sinclair/typebox").TString;
360
+ type: import("@sinclair/typebox").TLiteral<"docker">;
361
+ }>]>;
362
+ mutationId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
363
+ }>;
364
+ export type ReplaceProjectSettingsRequest = Static<typeof replaceProjectSettingsRequestSchema>;
365
+ /** `POST /v0/projects/:projectId/reorder` */
366
+ export declare const reorderProjectRequestSchema: import("@sinclair/typebox").TObject<{
367
+ /** The project to place this one after, or `null` to move it first. */
368
+ afterId: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
369
+ mutationId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
370
+ }>;
371
+ export type ReorderProjectRequest = Static<typeof reorderProjectRequestSchema>;
372
+ /** `POST /v0/projects/:projectId/archive` */
373
+ export declare const archiveProjectRequestSchema: import("@sinclair/typebox").TObject<{
374
+ mutationId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
375
+ }>;
376
+ export type ArchiveProjectRequest = Static<typeof archiveProjectRequestSchema>;
377
+ //# sourceMappingURL=projects.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"projects.d.ts","sourceRoot":"","sources":["../../sources/protocol/projects.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAEhF,OAAO,EAAE,KAAK,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAatD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEzC,8EAA8E;AAC9E,eAAO,MAAM,kBAAkB;;;;;;IAG7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE7D;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB;;;;;;IAO9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAE/D,eAAO,MAAM,qBAAqB;IAC9B,gDAAgD;;;;;;;EAElD,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEnE,4EAA4E;AAC5E,eAAO,MAAM,aAAa;IACtB,0EAA0E;;;;;;;;;;;;;;;;;;;;IAQ1E,sDAAsD;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E;;;EAGjF,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAEjF,gCAAgC;AAChC,eAAO,MAAM,yBAAyB;IAClC,qCAAqC;;;;IAIrC,sDAAsD;;;;;;;;;;;EAGxD,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE3E,sCAAsC;AACtC,eAAO,MAAM,0BAA0B;;;EAGrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE7E,6CAA6C;AAC7C,eAAO,MAAM,mCAAmC;;;;;;;;EAG9C,CAAC;AACH,MAAM,MAAM,6BAA6B,GAAG,MAAM,CAAC,OAAO,mCAAmC,CAAC,CAAC;AAE/F,6CAA6C;AAC7C,eAAO,MAAM,2BAA2B;IACpC,uEAAuE;;;EAGzE,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAE/E,6CAA6C;AAC7C,eAAO,MAAM,2BAA2B;;EAEtC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,OAAO,2BAA2B,CAAC,CAAC"}
@@ -0,0 +1,107 @@
1
+ /** Projects: a folder registered with the daemon, or a repository it cloned. */
2
+ import { Type } from "@sinclair/typebox";
3
+ import { computeSchema, computeSelectionSchema, cuid2Schema, gitSummarySchema, initializationStateSchema, mutationIdSchema, Nullable, resourceVersionSchema, timestampSchema, } from "./common.js";
4
+ /** Where a cloned project came from; `null` for a registered local folder. */
5
+ export const remoteSourceSchema = Type.Union([
6
+ Type.Object({ kind: Type.Literal("github"), repository: Type.String() }),
7
+ Type.Object({ kind: Type.Literal("git"), url: Type.String() }),
8
+ ]);
9
+ /**
10
+ * The project picture.
11
+ *
12
+ * The built-in home project — the user's machine outside any repository —
13
+ * carries `{ kind: "home" }` and has no image bytes to fetch.
14
+ */
15
+ export const projectAvatarSchema = Type.Union([
16
+ Type.Object({
17
+ kind: Type.Literal("image"),
18
+ source: Type.Union([Type.Literal("user"), Type.Literal("generated")]),
19
+ thumbhash: Type.String(),
20
+ }),
21
+ Type.Object({ kind: Type.Literal("home") }),
22
+ ]);
23
+ export const projectSettingsSchema = Type.Object({
24
+ /** Where new workspaces of this project run. */
25
+ defaultWorkspaceCompute: computeSelectionSchema,
26
+ });
27
+ /** The project object. A project is also the root workspace of its tree. */
28
+ export const projectSchema = Type.Object({
29
+ /** Ordered top-level agents rooted directly in this project workspace. */
30
+ agents: Type.Array(Type.Unsafe({ type: "object" })),
31
+ archivedAt: Nullable(timestampSchema),
32
+ avatar: Nullable(projectAvatarSchema),
33
+ compute: computeSchema,
34
+ createdAt: timestampSchema,
35
+ defaultBranch: Nullable(Type.String()),
36
+ description: Nullable(Type.String()),
37
+ /** `null` when the folder is not a Git repository. */
38
+ git: Nullable(gitSummarySchema),
39
+ id: cuid2Schema,
40
+ initialization: initializationStateSchema,
41
+ name: Type.String(),
42
+ /** Where the name came from; a user-chosen name is never derived over. */
43
+ nameSource: Type.Union([Type.Literal("folder"), Type.Literal("user")]),
44
+ /** An opaque sort key; clients order projects by comparing these strings. */
45
+ orderKey: Type.String(),
46
+ remoteSource: Nullable(remoteSourceSchema),
47
+ settings: projectSettingsSchema,
48
+ status: Type.Union([Type.Literal("active"), Type.Literal("archived")]),
49
+ updatedAt: timestampSchema,
50
+ version: resourceVersionSchema,
51
+ /** Whether child workspaces can be created as Git worktrees. */
52
+ worktreeSupport: Type.Union([
53
+ Type.Literal("supported"),
54
+ Type.Literal("unsupported"),
55
+ Type.Literal("unknown"),
56
+ ]),
57
+ /** Accompanies `worktreeSupport` of `"unsupported"`. */
58
+ worktreeUnsupportedReason: Type.Optional(Type.String()),
59
+ });
60
+ /** `GET /v0/projects` */
61
+ export const projectListResponseSchema = Type.Object({ projects: Type.Array(projectSchema) });
62
+ /** Every single-project route answers with this. */
63
+ export const projectResponseSchema = Type.Object({ project: projectSchema });
64
+ /** `PUT /v0/projects/:projectId/settings` */
65
+ export const projectSettingsResponseSchema = Type.Object({
66
+ project: projectSchema,
67
+ settings: projectSettingsSchema,
68
+ });
69
+ /** `POST /v0/projects` — registers an existing local folder. */
70
+ export const registerProjectRequestSchema = Type.Object({
71
+ /** The folder to register. Must exist and be a directory. */
72
+ path: Type.String(),
73
+ /** Optional client-supplied ID, for callers that need it before the answer. */
74
+ projectId: Type.Optional(cuid2Schema),
75
+ mutationId: Type.Optional(mutationIdSchema),
76
+ });
77
+ /** `POST /v0/projects/clone` */
78
+ export const cloneProjectRequestSchema = Type.Object({
79
+ /** The folder name for the clone. */
80
+ name: Type.String(),
81
+ projectId: Type.Optional(cuid2Schema),
82
+ mutationId: Type.Optional(mutationIdSchema),
83
+ /** Names the stored credential kind to clone with. */
84
+ secret: Type.Optional(Type.Object({ kind: Type.Literal("github") })),
85
+ source: remoteSourceSchema,
86
+ });
87
+ /** `PATCH /v0/projects/:projectId` */
88
+ export const renameProjectRequestSchema = Type.Object({
89
+ mutationId: Type.Optional(mutationIdSchema),
90
+ name: Type.String(),
91
+ });
92
+ /** `PUT /v0/projects/:projectId/settings` */
93
+ export const replaceProjectSettingsRequestSchema = Type.Object({
94
+ defaultWorkspaceCompute: computeSelectionSchema,
95
+ mutationId: Type.Optional(mutationIdSchema),
96
+ });
97
+ /** `POST /v0/projects/:projectId/reorder` */
98
+ export const reorderProjectRequestSchema = Type.Object({
99
+ /** The project to place this one after, or `null` to move it first. */
100
+ afterId: Nullable(cuid2Schema),
101
+ mutationId: Type.Optional(mutationIdSchema),
102
+ });
103
+ /** `POST /v0/projects/:projectId/archive` */
104
+ export const archiveProjectRequestSchema = Type.Object({
105
+ mutationId: Type.Optional(mutationIdSchema),
106
+ });
107
+ //# sourceMappingURL=projects.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"projects.js","sourceRoot":"","sources":["../../sources/protocol/projects.ts"],"names":[],"mappings":"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,CAAC;IACpE,MAAM,EAAE,kBAAkB;CAC7B,CAAC,CAAC;AAGH,sCAAsC;AACtC,MAAM,CAAC,MAAM,0BAA0B,GAAG,IAAI,CAAC,MAAM,CAAC;IAClD,UAAU,EAAE,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC;IAC3C,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE;CACtB,CAAC,CAAC;AAGH,6CAA6C;AAC7C,MAAM,CAAC,MAAM,mCAAmC,GAAG,IAAI,CAAC,MAAM,CAAC;IAC3D,uBAAuB,EAAE,sBAAsB;IAC/C,UAAU,EAAE,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC;CAC9C,CAAC,CAAC;AAGH,6CAA6C;AAC7C,MAAM,CAAC,MAAM,2BAA2B,GAAG,IAAI,CAAC,MAAM,CAAC;IACnD,uEAAuE;IACvE,OAAO,EAAE,QAAQ,CAAC,WAAW,CAAC;IAC9B,UAAU,EAAE,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC;CAC9C,CAAC,CAAC;AAGH,6CAA6C;AAC7C,MAAM,CAAC,MAAM,2BAA2B,GAAG,IAAI,CAAC,MAAM,CAAC;IACnD,UAAU,EAAE,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC;CAC9C,CAAC,CAAC"}
@@ -0,0 +1,54 @@
1
+ /** Questions: a run that cannot proceed without the person. */
2
+ import type { Cuid2, ResourceVersion, Timestamp } from "./common.js";
3
+ /** One option the person picks from. */
4
+ export interface QuestionOption {
5
+ label: string;
6
+ description: string;
7
+ }
8
+ /** One prompt inside a question. */
9
+ export interface QuestionPrompt {
10
+ id: Cuid2;
11
+ /** A short label for the prompt. */
12
+ header: string;
13
+ question: string;
14
+ multiSelect: boolean;
15
+ /** Possibly empty, and then the answer is free text. */
16
+ options: QuestionOption[];
17
+ }
18
+ /** The question object. An agent has at most one open at a time. */
19
+ export interface Question {
20
+ id: Cuid2;
21
+ agentId: Cuid2;
22
+ /** Whose run is waiting. */
23
+ runId: Cuid2;
24
+ /** `"canceled"` means the run stopped needing the answer. */
25
+ status: "pending" | "answered" | "canceled";
26
+ /** One or more prompts, answered together. */
27
+ questions: QuestionPrompt[];
28
+ /** When the agent proceeds on its own; `null` waits indefinitely. */
29
+ autoResolveAt: Timestamp | null;
30
+ /** `null` while pending; a map from prompt ID to the chosen values. */
31
+ answers: Record<string, string[]> | null;
32
+ version: ResourceVersion;
33
+ createdAt: Timestamp;
34
+ answeredAt: Timestamp | null;
35
+ }
36
+ /** `GET /v0/agents/:agentId/question` — `null` when nothing is pending. */
37
+ export interface PendingQuestionResponse {
38
+ question: Question | null;
39
+ }
40
+ /** `POST /v0/agents/:agentId/question/:questionId/answer` */
41
+ export interface QuestionResponse {
42
+ question: Question;
43
+ }
44
+ /** `POST /v0/agents/:agentId/question/:questionId/answer` */
45
+ export interface AnswerQuestionRequest {
46
+ /**
47
+ * Each prompt ID mapped to the person's values. A value matching an option
48
+ * label is a selection; any other string is free text. Every prompt must
49
+ * receive at least one value.
50
+ */
51
+ answers: Record<string, string[]>;
52
+ mutationId?: string;
53
+ }
54
+ //# sourceMappingURL=questions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"questions.d.ts","sourceRoot":"","sources":["../../sources/protocol/questions.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAE/D,OAAO,KAAK,EAAE,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAErE,wCAAwC;AACxC,MAAM,WAAW,cAAc;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;CACvB;AAED,oCAAoC;AACpC,MAAM,WAAW,cAAc;IAC3B,EAAE,EAAE,KAAK,CAAC;IACV,oCAAoC;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;IACrB,wDAAwD;IACxD,OAAO,EAAE,cAAc,EAAE,CAAC;CAC7B;AAED,oEAAoE;AACpE,MAAM,WAAW,QAAQ;IACrB,EAAE,EAAE,KAAK,CAAC;IACV,OAAO,EAAE,KAAK,CAAC;IACf,4BAA4B;IAC5B,KAAK,EAAE,KAAK,CAAC;IACb,6DAA6D;IAC7D,MAAM,EAAE,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;IAC5C,8CAA8C;IAC9C,SAAS,EAAE,cAAc,EAAE,CAAC;IAC5B,qEAAqE;IACrE,aAAa,EAAE,SAAS,GAAG,IAAI,CAAC;IAChC,uEAAuE;IACvE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,GAAG,IAAI,CAAC;IACzC,OAAO,EAAE,eAAe,CAAC;IACzB,SAAS,EAAE,SAAS,CAAC;IACrB,UAAU,EAAE,SAAS,GAAG,IAAI,CAAC;CAChC;AAED,2EAA2E;AAC3E,MAAM,WAAW,uBAAuB;IACpC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAC;CAC7B;AAED,6DAA6D;AAC7D,MAAM,WAAW,gBAAgB;IAC7B,QAAQ,EAAE,QAAQ,CAAC;CACtB;AAED,6DAA6D;AAC7D,MAAM,WAAW,qBAAqB;IAClC;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB"}
@@ -0,0 +1,3 @@
1
+ /** Questions: a run that cannot proceed without the person. */
2
+ export {};
3
+ //# sourceMappingURL=questions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"questions.js","sourceRoot":"","sources":["../../sources/protocol/questions.ts"],"names":[],"mappings":"AAAA,+DAA+D"}
@@ -0,0 +1,50 @@
1
+ /** Terminals: interactive shells belonging to a workspace, not to any agent. */
2
+ import type { Cuid2, MutationId, ResourceVersion } from "./common.js";
3
+ /**
4
+ * The terminal object.
5
+ *
6
+ * No terminal route carries screen contents: the picture and everything typed
7
+ * into it travel over the attachment WebSocket.
8
+ */
9
+ export interface Terminal {
10
+ id: Cuid2;
11
+ workspaceId: Cuid2;
12
+ status: "running" | "exited";
13
+ /** Set once the terminal exited. */
14
+ exitCode: number | null;
15
+ cols: number;
16
+ rows: number;
17
+ /** Settled at creation and never changed; it seeds every replica's emulator. */
18
+ colorScheme: "dark" | "light";
19
+ /** Changes whenever a new process backs the terminal. */
20
+ epoch: string;
21
+ version: ResourceVersion;
22
+ }
23
+ /** `GET /v0/workspaces/:workspaceId/terminals` */
24
+ export interface TerminalListResponse {
25
+ terminals: Terminal[];
26
+ }
27
+ /** Every single-terminal route answers with this. */
28
+ export interface TerminalResponse {
29
+ terminal: Terminal;
30
+ }
31
+ /** `POST /v0/workspaces/:workspaceId/terminals` — every field is optional. */
32
+ export interface OpenTerminalRequest {
33
+ shell?: string;
34
+ /** What to run instead of an interactive shell; the shell still hosts it. */
35
+ command?: string;
36
+ /** Absolute, or relative to the workspace folder; defaults to the folder. */
37
+ cwd?: string;
38
+ cols?: number;
39
+ rows?: number;
40
+ maxScrollback?: number;
41
+ colorScheme?: "dark" | "light";
42
+ mutationId?: MutationId;
43
+ }
44
+ /** `PATCH /v0/workspaces/:workspaceId/terminals/:terminalId` */
45
+ export interface ResizeTerminalRequest {
46
+ cols: number;
47
+ rows: number;
48
+ mutationId?: MutationId;
49
+ }
50
+ //# sourceMappingURL=terminals.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"terminals.d.ts","sourceRoot":"","sources":["../../sources/protocol/terminals.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAEhF,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEtE;;;;;GAKG;AACH,MAAM,WAAW,QAAQ;IACrB,EAAE,EAAE,KAAK,CAAC;IACV,WAAW,EAAE,KAAK,CAAC;IACnB,MAAM,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC7B,oCAAoC;IACpC,QAAQ,EAAE,MAAM,GAAG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