@toshicloud/sdk 0.2.0 → 0.3.1

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 (53) hide show
  1. package/README.md +74 -18
  2. package/dist/client.d.ts +111 -18
  3. package/dist/client.js +82 -16
  4. package/dist/errors.d.ts +9 -1
  5. package/dist/errors.js +22 -0
  6. package/dist/execute.d.ts +3 -2
  7. package/dist/execute.js +3 -3
  8. package/dist/gen/toshi/workspace/v1/artifacts_pb.d.ts +25 -23
  9. package/dist/gen/toshi/workspace/v1/artifacts_pb.js +7 -7
  10. package/dist/gen/toshi/workspace/v1/audit_events_pb.d.ts +297 -0
  11. package/dist/gen/toshi/workspace/v1/audit_events_pb.js +37 -0
  12. package/dist/gen/toshi/workspace/v1/channels_pb.d.ts +2713 -0
  13. package/dist/gen/toshi/workspace/v1/channels_pb.js +336 -0
  14. package/dist/gen/toshi/workspace/v1/display_pb.d.ts +35 -11
  15. package/dist/gen/toshi/workspace/v1/display_pb.js +2 -2
  16. package/dist/gen/toshi/workspace/v1/fillers_pb.d.ts +920 -0
  17. package/dist/gen/toshi/workspace/v1/fillers_pb.js +94 -0
  18. package/dist/gen/toshi/workspace/v1/hostjobs_pb.d.ts +2048 -0
  19. package/dist/gen/toshi/workspace/v1/hostjobs_pb.js +226 -0
  20. package/dist/gen/toshi/workspace/v1/hosts_pb.d.ts +2135 -0
  21. package/dist/gen/toshi/workspace/v1/hosts_pb.js +301 -0
  22. package/dist/gen/toshi/workspace/v1/projects_pb.d.ts +157 -3
  23. package/dist/gen/toshi/workspace/v1/projects_pb.js +2 -2
  24. package/dist/gen/toshi/workspace/v1/recordings_pb.d.ts +76 -0
  25. package/dist/gen/toshi/workspace/v1/recordings_pb.js +1 -1
  26. package/dist/gen/toshi/workspace/v1/secrets_pb.d.ts +175 -23
  27. package/dist/gen/toshi/workspace/v1/secrets_pb.js +9 -9
  28. package/dist/gen/toshi/workspace/v1/storage_providers_pb.d.ts +717 -0
  29. package/dist/gen/toshi/workspace/v1/storage_providers_pb.js +74 -0
  30. package/dist/gen/toshi/workspace/v1/tokens_pb.d.ts +518 -0
  31. package/dist/gen/toshi/workspace/v1/tokens_pb.js +88 -0
  32. package/dist/gen/toshi/workspace/v1/volumes_pb.d.ts +39 -1
  33. package/dist/gen/toshi/workspace/v1/volumes_pb.js +2 -2
  34. package/dist/gen/toshi/workspace/v1/webhook_pb.d.ts +62 -18
  35. package/dist/gen/toshi/workspace/v1/webhook_pb.js +3 -3
  36. package/dist/gen/toshi/workspace/v1/workloads_pb.d.ts +2858 -0
  37. package/dist/gen/toshi/workspace/v1/workloads_pb.js +261 -0
  38. package/dist/gen/toshi/workspace/v1/workspace_pb.d.ts +1377 -2130
  39. package/dist/gen/toshi/workspace/v1/workspace_pb.js +235 -272
  40. package/dist/gen/toshi/workspace/v1/workspace_service_pb.d.ts +3719 -0
  41. package/dist/gen/toshi/workspace/v1/workspace_service_pb.js +270 -0
  42. package/dist/index.d.ts +14 -2
  43. package/dist/index.js +13 -1
  44. package/dist/output.d.ts +3 -2
  45. package/dist/output.js +2 -2
  46. package/dist/retry.js +116 -30
  47. package/dist/run.d.ts +10 -0
  48. package/dist/run.js +175 -0
  49. package/dist/wait.d.ts +10 -5
  50. package/dist/wait.js +23 -11
  51. package/dist/watch.d.ts +14 -6
  52. package/dist/watch.js +138 -85
  53. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
- import type { GenEnum, GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2";
2
- import type { Duration, DurationJson, FieldMask, FieldMaskJson, Timestamp, TimestampJson } from "@bufbuild/protobuf/wkt";
1
+ import type { GenEnum, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2";
2
+ import type { Duration, DurationJson, Timestamp, TimestampJson } from "@bufbuild/protobuf/wkt";
3
3
  import type { RecordingKind, RecordingKindJson } from "./recordings_pb.js";
4
4
  import type { Message } from "@bufbuild/protobuf";
5
5
  /**
@@ -7,2145 +7,1617 @@ import type { Message } from "@bufbuild/protobuf";
7
7
  */
8
8
  export declare const file_toshi_workspace_v1_workspace: GenFile;
9
9
  /**
10
- * Workload is one unit of work of any kind.
10
+ * Job runs one command once and ends.
11
11
  *
12
- * @generated from message toshi.workspace.v1.Workload
12
+ * @generated from message toshi.workspace.v1.Job
13
13
  */
14
- export type Workload = Message<"toshi.workspace.v1.Workload"> & {
14
+ export type Job = Message<"toshi.workspace.v1.Job"> & {
15
15
  /**
16
- * Assigned by the server; unique within the workspace.
16
+ * Assigned by the server; unique within the workspace, among its jobs,
17
+ * sandboxes and services.
17
18
  *
18
19
  * @generated from field: string id = 1;
19
20
  */
20
21
  id: string;
21
22
  /**
22
- * Follows from which spec is set.
23
- *
24
- * @generated from field: toshi.workspace.v1.WorkloadKind kind = 2;
25
- */
26
- kind: WorkloadKind;
27
- /**
28
- * The kind-specific spec, as created.
29
- *
30
- * @generated from oneof toshi.workspace.v1.Workload.spec
31
- */
32
- spec: {
33
- /**
34
- * @generated from field: toshi.workspace.v1.JobSpec job = 3;
35
- */
36
- value: JobSpec;
37
- case: "job";
38
- } | {
39
- /**
40
- * @generated from field: toshi.workspace.v1.SandboxSpec sandbox = 4;
41
- */
42
- value: SandboxSpec;
43
- case: "sandbox";
44
- } | {
45
- /**
46
- * @generated from field: toshi.workspace.v1.ServiceSpec service = 5;
47
- */
48
- value: ServiceSpec;
49
- case: "service";
50
- } | {
51
- case: undefined;
52
- value?: undefined;
53
- };
54
- /**
55
- * @generated from field: toshi.workspace.v1.WorkloadStatus status = 6;
56
- */
57
- status?: WorkloadStatus | undefined;
58
- /**
59
- * @generated from field: string project = 7;
23
+ * @generated from field: string project = 2;
60
24
  */
61
25
  project: string;
62
26
  /**
63
- * @generated from field: string environment = 8;
27
+ * @generated from field: string environment = 3;
64
28
  */
65
29
  environment: string;
66
30
  /**
67
- * Free-form labels, set at create and changed by PatchWorkload.
31
+ * Free-form labels, set at create and changed by UpdateJob.
68
32
  *
69
- * @generated from field: map<string, string> labels = 9;
33
+ * @generated from field: map<string, string> labels = 4;
70
34
  */
71
35
  labels: {
72
36
  [key: string]: string;
73
37
  };
38
+ /**
39
+ * The job as created.
40
+ *
41
+ * @generated from field: toshi.workspace.v1.JobSpec spec = 5;
42
+ */
43
+ spec?: JobSpec | undefined;
44
+ /**
45
+ * @generated from field: toshi.workspace.v1.JobStatus status = 6;
46
+ */
47
+ status?: JobStatus | undefined;
74
48
  /**
75
49
  * What it records of its runs, fixed at create: never UNSPECIFIED.
76
50
  *
77
- * @generated from field: toshi.workspace.v1.RecordingPolicy recording = 10;
51
+ * @generated from field: toshi.workspace.v1.RecordingPolicy recording = 7;
78
52
  */
79
53
  recording: RecordingPolicy;
80
54
  };
81
55
  /**
82
- * Workload is one unit of work of any kind.
56
+ * Job runs one command once and ends.
83
57
  *
84
- * @generated from message toshi.workspace.v1.Workload
58
+ * @generated from message toshi.workspace.v1.Job
85
59
  */
86
- export type WorkloadJson = {
60
+ export type JobJson = {
87
61
  /**
88
- * Assigned by the server; unique within the workspace.
62
+ * Assigned by the server; unique within the workspace, among its jobs,
63
+ * sandboxes and services.
89
64
  *
90
65
  * @generated from field: string id = 1;
91
66
  */
92
67
  id?: string;
93
68
  /**
94
- * Follows from which spec is set.
95
- *
96
- * @generated from field: toshi.workspace.v1.WorkloadKind kind = 2;
97
- */
98
- kind?: WorkloadKindJson;
99
- /**
100
- * @generated from field: toshi.workspace.v1.JobSpec job = 3;
101
- */
102
- job?: JobSpecJson;
103
- /**
104
- * @generated from field: toshi.workspace.v1.SandboxSpec sandbox = 4;
105
- */
106
- sandbox?: SandboxSpecJson;
107
- /**
108
- * @generated from field: toshi.workspace.v1.ServiceSpec service = 5;
109
- */
110
- service?: ServiceSpecJson;
111
- /**
112
- * @generated from field: toshi.workspace.v1.WorkloadStatus status = 6;
113
- */
114
- status?: WorkloadStatusJson;
115
- /**
116
- * @generated from field: string project = 7;
69
+ * @generated from field: string project = 2;
117
70
  */
118
71
  project?: string;
119
72
  /**
120
- * @generated from field: string environment = 8;
73
+ * @generated from field: string environment = 3;
121
74
  */
122
75
  environment?: string;
123
76
  /**
124
- * Free-form labels, set at create and changed by PatchWorkload.
77
+ * Free-form labels, set at create and changed by UpdateJob.
125
78
  *
126
- * @generated from field: map<string, string> labels = 9;
79
+ * @generated from field: map<string, string> labels = 4;
127
80
  */
128
81
  labels?: {
129
82
  [key: string]: string;
130
83
  };
84
+ /**
85
+ * The job as created.
86
+ *
87
+ * @generated from field: toshi.workspace.v1.JobSpec spec = 5;
88
+ */
89
+ spec?: JobSpecJson;
90
+ /**
91
+ * @generated from field: toshi.workspace.v1.JobStatus status = 6;
92
+ */
93
+ status?: JobStatusJson;
131
94
  /**
132
95
  * What it records of its runs, fixed at create: never UNSPECIFIED.
133
96
  *
134
- * @generated from field: toshi.workspace.v1.RecordingPolicy recording = 10;
97
+ * @generated from field: toshi.workspace.v1.RecordingPolicy recording = 7;
135
98
  */
136
99
  recording?: RecordingPolicyJson;
137
100
  };
138
101
  /**
139
- * Describes the message toshi.workspace.v1.Workload.
140
- * Use `create(WorkloadSchema)` to create a new message.
102
+ * Describes the message toshi.workspace.v1.Job.
103
+ * Use `create(JobSchema)` to create a new message.
141
104
  */
142
- export declare const WorkloadSchema: GenMessage<Workload, {
143
- jsonType: WorkloadJson;
105
+ export declare const JobSchema: GenMessage<Job, {
106
+ jsonType: JobJson;
144
107
  }>;
145
108
  /**
146
- * JobSpec is a job: one command, run once.
109
+ * JobStatus is a job's state and when it got there.
147
110
  *
148
- * @generated from message toshi.workspace.v1.JobSpec
111
+ * @generated from message toshi.workspace.v1.JobStatus
149
112
  */
150
- export type JobSpec = Message<"toshi.workspace.v1.JobSpec"> & {
113
+ export type JobStatus = Message<"toshi.workspace.v1.JobStatus"> & {
151
114
  /**
152
- * @generated from field: toshi.workspace.v1.Command command = 1;
115
+ * @generated from field: toshi.workspace.v1.JobState state = 1;
153
116
  */
154
- command?: Command | undefined;
117
+ state: JobState;
155
118
  /**
156
- * What in its workspace the job uses. Checked at create
157
- * against the job's project and environment, and fixed when the job
158
- * starts; GetWorkloadResponse.bound shows what each was fixed to.
119
+ * Set once the state is ENDED: EXITED, CANCELLED or FAILED.
159
120
  *
160
- * @generated from field: repeated toshi.workspace.v1.Binding bindings = 2;
121
+ * @generated from field: toshi.workspace.v1.EndReason end_reason = 2;
161
122
  */
162
- bindings: Binding[];
123
+ endReason: EndReason;
124
+ /**
125
+ * The most recent error Toshi met running the job.
126
+ *
127
+ * @generated from field: toshi.workspace.v1.Error last_error = 3;
128
+ */
129
+ lastError?: Error | undefined;
130
+ /**
131
+ * @generated from field: google.protobuf.Timestamp created_at = 4;
132
+ */
133
+ createdAt?: Timestamp | undefined;
134
+ /**
135
+ * @generated from field: google.protobuf.Timestamp queued_at = 5;
136
+ */
137
+ queuedAt?: Timestamp | undefined;
138
+ /**
139
+ * @generated from field: google.protobuf.Timestamp started_at = 6;
140
+ */
141
+ startedAt?: Timestamp | undefined;
142
+ /**
143
+ * @generated from field: google.protobuf.Timestamp ended_at = 7;
144
+ */
145
+ endedAt?: Timestamp | undefined;
146
+ /**
147
+ * When anything in the job last changed.
148
+ *
149
+ * @generated from field: google.protobuf.Timestamp updated_at = 8;
150
+ */
151
+ updatedAt?: Timestamp | undefined;
152
+ /**
153
+ * The command's exit status, set when end_reason is EXITED.
154
+ *
155
+ * @generated from field: optional int32 exit_code = 9;
156
+ */
157
+ exitCode?: number | undefined;
163
158
  };
164
159
  /**
165
- * JobSpec is a job: one command, run once.
160
+ * JobStatus is a job's state and when it got there.
166
161
  *
167
- * @generated from message toshi.workspace.v1.JobSpec
162
+ * @generated from message toshi.workspace.v1.JobStatus
168
163
  */
169
- export type JobSpecJson = {
164
+ export type JobStatusJson = {
170
165
  /**
171
- * @generated from field: toshi.workspace.v1.Command command = 1;
166
+ * @generated from field: toshi.workspace.v1.JobState state = 1;
172
167
  */
173
- command?: CommandJson;
168
+ state?: JobStateJson;
174
169
  /**
175
- * What in its workspace the job uses. Checked at create
176
- * against the job's project and environment, and fixed when the job
177
- * starts; GetWorkloadResponse.bound shows what each was fixed to.
170
+ * Set once the state is ENDED: EXITED, CANCELLED or FAILED.
178
171
  *
179
- * @generated from field: repeated toshi.workspace.v1.Binding bindings = 2;
172
+ * @generated from field: toshi.workspace.v1.EndReason end_reason = 2;
180
173
  */
181
- bindings?: BindingJson[];
174
+ endReason?: EndReasonJson;
175
+ /**
176
+ * The most recent error Toshi met running the job.
177
+ *
178
+ * @generated from field: toshi.workspace.v1.Error last_error = 3;
179
+ */
180
+ lastError?: ErrorJson;
181
+ /**
182
+ * @generated from field: google.protobuf.Timestamp created_at = 4;
183
+ */
184
+ createdAt?: TimestampJson;
185
+ /**
186
+ * @generated from field: google.protobuf.Timestamp queued_at = 5;
187
+ */
188
+ queuedAt?: TimestampJson;
189
+ /**
190
+ * @generated from field: google.protobuf.Timestamp started_at = 6;
191
+ */
192
+ startedAt?: TimestampJson;
193
+ /**
194
+ * @generated from field: google.protobuf.Timestamp ended_at = 7;
195
+ */
196
+ endedAt?: TimestampJson;
197
+ /**
198
+ * When anything in the job last changed.
199
+ *
200
+ * @generated from field: google.protobuf.Timestamp updated_at = 8;
201
+ */
202
+ updatedAt?: TimestampJson;
203
+ /**
204
+ * The command's exit status, set when end_reason is EXITED.
205
+ *
206
+ * @generated from field: optional int32 exit_code = 9;
207
+ */
208
+ exitCode?: number;
182
209
  };
183
210
  /**
184
- * Describes the message toshi.workspace.v1.JobSpec.
185
- * Use `create(JobSpecSchema)` to create a new message.
211
+ * Describes the message toshi.workspace.v1.JobStatus.
212
+ * Use `create(JobStatusSchema)` to create a new message.
186
213
  */
187
- export declare const JobSpecSchema: GenMessage<JobSpec, {
188
- jsonType: JobSpecJson;
214
+ export declare const JobStatusSchema: GenMessage<JobStatus, {
215
+ jsonType: JobStatusJson;
189
216
  }>;
190
217
  /**
191
- * Binding is one binding a workload declares.
218
+ * Sandbox runs until it is deleted or its time limit passes.
192
219
  *
193
- * @generated from message toshi.workspace.v1.Binding
220
+ * @generated from message toshi.workspace.v1.Sandbox
194
221
  */
195
- export type Binding = Message<"toshi.workspace.v1.Binding"> & {
222
+ export type Sandbox = Message<"toshi.workspace.v1.Sandbox"> & {
196
223
  /**
197
- * Names the binding in the workload: a lowercase DNS label, unique in
198
- * the workload.
224
+ * Assigned by the server; unique within the workspace, among its jobs,
225
+ * sandboxes and services.
199
226
  *
200
- * @generated from field: string name = 1;
227
+ * @generated from field: string id = 1;
201
228
  */
202
- name: string;
229
+ id: string;
203
230
  /**
204
- * What the binding is to. Set exactly one.
231
+ * @generated from field: string project = 2;
232
+ */
233
+ project: string;
234
+ /**
235
+ * @generated from field: string environment = 3;
236
+ */
237
+ environment: string;
238
+ /**
239
+ * Free-form labels, set at create and changed by UpdateSandbox.
205
240
  *
206
- * @generated from oneof toshi.workspace.v1.Binding.target
241
+ * @generated from field: map<string, string> labels = 4;
207
242
  */
208
- target: {
209
- /**
210
- * A channel of a service of the workload's project and environment.
211
- *
212
- * @generated from field: toshi.workspace.v1.ServiceChannel service = 2;
213
- */
214
- value: ServiceChannel;
215
- case: "service";
216
- } | {
217
- /**
218
- * The secret set of the workload's environment.
219
- *
220
- * @generated from field: toshi.workspace.v1.EnvironmentSecrets secrets = 3;
221
- */
222
- value: EnvironmentSecrets;
223
- case: "secrets";
224
- } | {
225
- case: undefined;
226
- value?: undefined;
243
+ labels: {
244
+ [key: string]: string;
227
245
  };
246
+ /**
247
+ * The sandbox as created, with max_duration as UpdateSandbox last raised
248
+ * it.
249
+ *
250
+ * @generated from field: toshi.workspace.v1.SandboxSpec spec = 5;
251
+ */
252
+ spec?: SandboxSpec | undefined;
253
+ /**
254
+ * @generated from field: toshi.workspace.v1.SandboxStatus status = 6;
255
+ */
256
+ status?: SandboxStatus | undefined;
257
+ /**
258
+ * What it records of its runs, fixed at create: never UNSPECIFIED.
259
+ *
260
+ * @generated from field: toshi.workspace.v1.RecordingPolicy recording = 7;
261
+ */
262
+ recording: RecordingPolicy;
228
263
  };
229
264
  /**
230
- * Binding is one binding a workload declares.
265
+ * Sandbox runs until it is deleted or its time limit passes.
231
266
  *
232
- * @generated from message toshi.workspace.v1.Binding
267
+ * @generated from message toshi.workspace.v1.Sandbox
233
268
  */
234
- export type BindingJson = {
269
+ export type SandboxJson = {
235
270
  /**
236
- * Names the binding in the workload: a lowercase DNS label, unique in
237
- * the workload.
271
+ * Assigned by the server; unique within the workspace, among its jobs,
272
+ * sandboxes and services.
238
273
  *
239
- * @generated from field: string name = 1;
274
+ * @generated from field: string id = 1;
240
275
  */
241
- name?: string;
276
+ id?: string;
242
277
  /**
243
- * A channel of a service of the workload's project and environment.
278
+ * @generated from field: string project = 2;
279
+ */
280
+ project?: string;
281
+ /**
282
+ * @generated from field: string environment = 3;
283
+ */
284
+ environment?: string;
285
+ /**
286
+ * Free-form labels, set at create and changed by UpdateSandbox.
244
287
  *
245
- * @generated from field: toshi.workspace.v1.ServiceChannel service = 2;
288
+ * @generated from field: map<string, string> labels = 4;
246
289
  */
247
- service?: ServiceChannelJson;
290
+ labels?: {
291
+ [key: string]: string;
292
+ };
248
293
  /**
249
- * The secret set of the workload's environment.
294
+ * The sandbox as created, with max_duration as UpdateSandbox last raised
295
+ * it.
250
296
  *
251
- * @generated from field: toshi.workspace.v1.EnvironmentSecrets secrets = 3;
297
+ * @generated from field: toshi.workspace.v1.SandboxSpec spec = 5;
252
298
  */
253
- secrets?: EnvironmentSecretsJson;
299
+ spec?: SandboxSpecJson;
300
+ /**
301
+ * @generated from field: toshi.workspace.v1.SandboxStatus status = 6;
302
+ */
303
+ status?: SandboxStatusJson;
304
+ /**
305
+ * What it records of its runs, fixed at create: never UNSPECIFIED.
306
+ *
307
+ * @generated from field: toshi.workspace.v1.RecordingPolicy recording = 7;
308
+ */
309
+ recording?: RecordingPolicyJson;
254
310
  };
255
311
  /**
256
- * Describes the message toshi.workspace.v1.Binding.
257
- * Use `create(BindingSchema)` to create a new message.
312
+ * Describes the message toshi.workspace.v1.Sandbox.
313
+ * Use `create(SandboxSchema)` to create a new message.
258
314
  */
259
- export declare const BindingSchema: GenMessage<Binding, {
260
- jsonType: BindingJson;
315
+ export declare const SandboxSchema: GenMessage<Sandbox, {
316
+ jsonType: SandboxJson;
261
317
  }>;
262
318
  /**
263
- * ServiceChannel is a channel of a service, by the service's name and the
264
- * channel's name in its recipe, as a recipe's uses names it:
265
- * "<service>.<channel>".
319
+ * SandboxStatus is a sandbox's state and when it got there.
266
320
  *
267
- * @generated from message toshi.workspace.v1.ServiceChannel
321
+ * @generated from message toshi.workspace.v1.SandboxStatus
268
322
  */
269
- export type ServiceChannel = Message<"toshi.workspace.v1.ServiceChannel"> & {
323
+ export type SandboxStatus = Message<"toshi.workspace.v1.SandboxStatus"> & {
270
324
  /**
271
- * @generated from field: string service = 1;
325
+ * @generated from field: toshi.workspace.v1.SandboxState state = 1;
272
326
  */
273
- service: string;
327
+ state: SandboxState;
274
328
  /**
275
- * @generated from field: string channel = 2;
329
+ * Set once the state is ENDED: STOPPED or FAILED.
330
+ *
331
+ * @generated from field: toshi.workspace.v1.EndReason end_reason = 2;
276
332
  */
277
- channel: string;
278
- };
279
- /**
280
- * ServiceChannel is a channel of a service, by the service's name and the
281
- * channel's name in its recipe, as a recipe's uses names it:
282
- * "<service>.<channel>".
283
- *
284
- * @generated from message toshi.workspace.v1.ServiceChannel
285
- */
286
- export type ServiceChannelJson = {
333
+ endReason: EndReason;
287
334
  /**
288
- * @generated from field: string service = 1;
335
+ * The most recent error Toshi met running the sandbox.
336
+ *
337
+ * @generated from field: toshi.workspace.v1.Error last_error = 3;
289
338
  */
290
- service?: string;
339
+ lastError?: Error | undefined;
291
340
  /**
292
- * @generated from field: string channel = 2;
341
+ * @generated from field: google.protobuf.Timestamp created_at = 4;
293
342
  */
294
- channel?: string;
295
- };
296
- /**
297
- * Describes the message toshi.workspace.v1.ServiceChannel.
298
- * Use `create(ServiceChannelSchema)` to create a new message.
299
- */
300
- export declare const ServiceChannelSchema: GenMessage<ServiceChannel, {
301
- jsonType: ServiceChannelJson;
302
- }>;
303
- /**
304
- * EnvironmentSecrets binds the secret set of the workload's environment,
305
- * with the project's shared keys. The set must grant the workload's kind.
306
- *
307
- * @generated from message toshi.workspace.v1.EnvironmentSecrets
308
- */
309
- export type EnvironmentSecrets = Message<"toshi.workspace.v1.EnvironmentSecrets"> & {};
310
- /**
311
- * EnvironmentSecrets binds the secret set of the workload's environment,
312
- * with the project's shared keys. The set must grant the workload's kind.
313
- *
314
- * @generated from message toshi.workspace.v1.EnvironmentSecrets
315
- */
316
- export type EnvironmentSecretsJson = {};
317
- /**
318
- * Describes the message toshi.workspace.v1.EnvironmentSecrets.
319
- * Use `create(EnvironmentSecretsSchema)` to create a new message.
320
- */
321
- export declare const EnvironmentSecretsSchema: GenMessage<EnvironmentSecrets, {
322
- jsonType: EnvironmentSecretsJson;
323
- }>;
324
- /**
325
- * BoundBinding is a binding as it was fixed when its workload started.
326
- * A later change or delete of the target leaves it as it is.
327
- *
328
- * @generated from message toshi.workspace.v1.BoundBinding
329
- */
330
- export type BoundBinding = Message<"toshi.workspace.v1.BoundBinding"> & {
331
- /**
332
- * @generated from field: string name = 1;
333
- */
334
- name: string;
343
+ createdAt?: Timestamp | undefined;
335
344
  /**
336
- * @generated from oneof toshi.workspace.v1.BoundBinding.target
345
+ * @generated from field: google.protobuf.Timestamp queued_at = 5;
337
346
  */
338
- target: {
339
- /**
340
- * @generated from field: toshi.workspace.v1.BoundService service = 2;
341
- */
342
- value: BoundService;
343
- case: "service";
344
- } | {
345
- /**
346
- * @generated from field: toshi.workspace.v1.BoundSecrets secrets = 3;
347
- */
348
- value: BoundSecrets;
349
- case: "secrets";
350
- } | {
351
- case: undefined;
352
- value?: undefined;
353
- };
347
+ queuedAt?: Timestamp | undefined;
354
348
  /**
355
- * @generated from field: google.protobuf.Timestamp taken_at = 4;
349
+ * @generated from field: google.protobuf.Timestamp started_at = 6;
356
350
  */
357
- takenAt?: Timestamp | undefined;
358
- };
359
- /**
360
- * BoundBinding is a binding as it was fixed when its workload started.
361
- * A later change or delete of the target leaves it as it is.
362
- *
363
- * @generated from message toshi.workspace.v1.BoundBinding
364
- */
365
- export type BoundBindingJson = {
351
+ startedAt?: Timestamp | undefined;
366
352
  /**
367
- * @generated from field: string name = 1;
353
+ * @generated from field: google.protobuf.Timestamp ended_at = 7;
368
354
  */
369
- name?: string;
355
+ endedAt?: Timestamp | undefined;
370
356
  /**
371
- * @generated from field: toshi.workspace.v1.BoundService service = 2;
357
+ * When anything in the sandbox last changed.
358
+ *
359
+ * @generated from field: google.protobuf.Timestamp updated_at = 8;
372
360
  */
373
- service?: BoundServiceJson;
361
+ updatedAt?: Timestamp | undefined;
374
362
  /**
375
- * @generated from field: toshi.workspace.v1.BoundSecrets secrets = 3;
363
+ * Why it was stopped, set once it has ended: with STOPPED, and with
364
+ * FAILED when it failed after a stop was asked.
365
+ *
366
+ * @generated from field: toshi.workspace.v1.StopReason stop_reason = 9;
376
367
  */
377
- secrets?: BoundSecretsJson;
368
+ stopReason: StopReason;
378
369
  /**
379
- * @generated from field: google.protobuf.Timestamp taken_at = 4;
370
+ * While it runs, its previews: one for each of its http channels served
371
+ * at a hostname of its own, the channel `preview` among them. Empty
372
+ * while the control plane serves no previews. Making or deleting such a
373
+ * channel changes the sandbox, so WatchSandboxes sends it again.
374
+ *
375
+ * @generated from field: repeated toshi.workspace.v1.SandboxPreview previews = 10;
380
376
  */
381
- takenAt?: TimestampJson;
377
+ previews: SandboxPreview[];
382
378
  };
383
379
  /**
384
- * Describes the message toshi.workspace.v1.BoundBinding.
385
- * Use `create(BoundBindingSchema)` to create a new message.
386
- */
387
- export declare const BoundBindingSchema: GenMessage<BoundBinding, {
388
- jsonType: BoundBindingJson;
389
- }>;
390
- /**
391
- * BoundService is a service channel as it was when the workload started.
380
+ * SandboxStatus is a sandbox's state and when it got there.
392
381
  *
393
- * @generated from message toshi.workspace.v1.BoundService
382
+ * @generated from message toshi.workspace.v1.SandboxStatus
394
383
  */
395
- export type BoundService = Message<"toshi.workspace.v1.BoundService"> & {
384
+ export type SandboxStatusJson = {
396
385
  /**
397
- * @generated from field: string service = 1;
386
+ * @generated from field: toshi.workspace.v1.SandboxState state = 1;
398
387
  */
399
- service: string;
388
+ state?: SandboxStateJson;
400
389
  /**
401
- * The service's workload ID.
390
+ * Set once the state is ENDED: STOPPED or FAILED.
402
391
  *
403
- * @generated from field: string service_id = 2;
392
+ * @generated from field: toshi.workspace.v1.EndReason end_reason = 2;
404
393
  */
405
- serviceId: string;
394
+ endReason?: EndReasonJson;
406
395
  /**
407
- * The service's revision that was current.
396
+ * The most recent error Toshi met running the sandbox.
408
397
  *
409
- * @generated from field: int64 revision = 3;
398
+ * @generated from field: toshi.workspace.v1.Error last_error = 3;
410
399
  */
411
- revision: bigint;
400
+ lastError?: ErrorJson;
412
401
  /**
413
- * @generated from field: string channel = 4;
402
+ * @generated from field: google.protobuf.Timestamp created_at = 4;
414
403
  */
415
- channel: string;
404
+ createdAt?: TimestampJson;
416
405
  /**
417
- * The channel's shape and, for an http channel, its guest port.
418
- *
419
- * @generated from field: string shape = 5;
406
+ * @generated from field: google.protobuf.Timestamp queued_at = 5;
420
407
  */
421
- shape: string;
408
+ queuedAt?: TimestampJson;
422
409
  /**
423
- * @generated from field: int32 port = 6;
410
+ * @generated from field: google.protobuf.Timestamp started_at = 6;
424
411
  */
425
- port: number;
412
+ startedAt?: TimestampJson;
426
413
  /**
427
- * What the channel accepts from the caller: "workload_identity", a
428
- * connect credential signed by the workload identity issuer
429
- * naming audience and this binding. Minted when the job's command
430
- * starts, and passed only to that command.
414
+ * @generated from field: google.protobuf.Timestamp ended_at = 7;
415
+ */
416
+ endedAt?: TimestampJson;
417
+ /**
418
+ * When anything in the sandbox last changed.
431
419
  *
432
- * @generated from field: string credential = 7;
420
+ * @generated from field: google.protobuf.Timestamp updated_at = 8;
433
421
  */
434
- credential: string;
422
+ updatedAt?: TimestampJson;
435
423
  /**
436
- * @generated from field: string audience = 8;
424
+ * Why it was stopped, set once it has ended: with STOPPED, and with
425
+ * FAILED when it failed after a stop was asked.
426
+ *
427
+ * @generated from field: toshi.workspace.v1.StopReason stop_reason = 9;
437
428
  */
438
- audience: string;
429
+ stopReason?: StopReasonJson;
439
430
  /**
440
- * The id (jti) of the connect credential minted for this binding. Never
441
- * the credential.
431
+ * While it runs, its previews: one for each of its http channels served
432
+ * at a hostname of its own, the channel `preview` among them. Empty
433
+ * while the control plane serves no previews. Making or deleting such a
434
+ * channel changes the sandbox, so WatchSandboxes sends it again.
442
435
  *
443
- * @generated from field: string credential_id = 9;
436
+ * @generated from field: repeated toshi.workspace.v1.SandboxPreview previews = 10;
444
437
  */
445
- credentialId: string;
438
+ previews?: SandboxPreviewJson[];
446
439
  };
447
440
  /**
448
- * BoundService is a service channel as it was when the workload started.
441
+ * Describes the message toshi.workspace.v1.SandboxStatus.
442
+ * Use `create(SandboxStatusSchema)` to create a new message.
443
+ */
444
+ export declare const SandboxStatusSchema: GenMessage<SandboxStatus, {
445
+ jsonType: SandboxStatusJson;
446
+ }>;
447
+ /**
448
+ * Service is a long-running service, started, stopped, woken and held.
449
449
  *
450
- * @generated from message toshi.workspace.v1.BoundService
450
+ * @generated from message toshi.workspace.v1.Service
451
451
  */
452
- export type BoundServiceJson = {
452
+ export type Service = Message<"toshi.workspace.v1.Service"> & {
453
453
  /**
454
- * @generated from field: string service = 1;
454
+ * Assigned by the server; unique within the workspace, among its jobs,
455
+ * sandboxes and services.
456
+ *
457
+ * @generated from field: string id = 1;
455
458
  */
456
- service?: string;
459
+ id: string;
457
460
  /**
458
- * The service's workload ID.
461
+ * @generated from field: string project = 2;
462
+ */
463
+ project: string;
464
+ /**
465
+ * @generated from field: string environment = 3;
466
+ */
467
+ environment: string;
468
+ /**
469
+ * Free-form labels, set at create and changed by UpdateService.
459
470
  *
460
- * @generated from field: string service_id = 2;
471
+ * @generated from field: map<string, string> labels = 4;
461
472
  */
462
- serviceId?: string;
473
+ labels: {
474
+ [key: string]: string;
475
+ };
463
476
  /**
464
- * The service's revision that was current.
477
+ * The service as ServiceSpec describes its answers.
465
478
  *
466
- * @generated from field: int64 revision = 3;
479
+ * @generated from field: toshi.workspace.v1.ServiceSpec spec = 5;
467
480
  */
468
- revision?: string;
481
+ spec?: ServiceSpec | undefined;
469
482
  /**
470
- * @generated from field: string channel = 4;
483
+ * @generated from field: toshi.workspace.v1.ServiceStatus status = 6;
471
484
  */
472
- channel?: string;
485
+ status?: ServiceStatus | undefined;
486
+ };
487
+ /**
488
+ * Service is a long-running service, started, stopped, woken and held.
489
+ *
490
+ * @generated from message toshi.workspace.v1.Service
491
+ */
492
+ export type ServiceJson = {
473
493
  /**
474
- * The channel's shape and, for an http channel, its guest port.
494
+ * Assigned by the server; unique within the workspace, among its jobs,
495
+ * sandboxes and services.
475
496
  *
476
- * @generated from field: string shape = 5;
497
+ * @generated from field: string id = 1;
477
498
  */
478
- shape?: string;
499
+ id?: string;
479
500
  /**
480
- * @generated from field: int32 port = 6;
501
+ * @generated from field: string project = 2;
481
502
  */
482
- port?: number;
503
+ project?: string;
483
504
  /**
484
- * What the channel accepts from the caller: "workload_identity", a
485
- * connect credential signed by the workload identity issuer
486
- * naming audience and this binding. Minted when the job's command
487
- * starts, and passed only to that command.
488
- *
489
- * @generated from field: string credential = 7;
505
+ * @generated from field: string environment = 3;
490
506
  */
491
- credential?: string;
507
+ environment?: string;
492
508
  /**
493
- * @generated from field: string audience = 8;
509
+ * Free-form labels, set at create and changed by UpdateService.
510
+ *
511
+ * @generated from field: map<string, string> labels = 4;
494
512
  */
495
- audience?: string;
513
+ labels?: {
514
+ [key: string]: string;
515
+ };
496
516
  /**
497
- * The id (jti) of the connect credential minted for this binding. Never
498
- * the credential.
517
+ * The service as ServiceSpec describes its answers.
499
518
  *
500
- * @generated from field: string credential_id = 9;
519
+ * @generated from field: toshi.workspace.v1.ServiceSpec spec = 5;
501
520
  */
502
- credentialId?: string;
521
+ spec?: ServiceSpecJson;
522
+ /**
523
+ * @generated from field: toshi.workspace.v1.ServiceStatus status = 6;
524
+ */
525
+ status?: ServiceStatusJson;
503
526
  };
504
527
  /**
505
- * Describes the message toshi.workspace.v1.BoundService.
506
- * Use `create(BoundServiceSchema)` to create a new message.
528
+ * Describes the message toshi.workspace.v1.Service.
529
+ * Use `create(ServiceSchema)` to create a new message.
507
530
  */
508
- export declare const BoundServiceSchema: GenMessage<BoundService, {
509
- jsonType: BoundServiceJson;
531
+ export declare const ServiceSchema: GenMessage<Service, {
532
+ jsonType: ServiceJson;
510
533
  }>;
511
534
  /**
512
- * BoundSecrets is the environment's secret set as it was when the
513
- * workload started: which keys, from which set, at which version. Never
514
- * a value.
535
+ * ServiceStatus is a service's state and when it got there.
515
536
  *
516
- * @generated from message toshi.workspace.v1.BoundSecrets
537
+ * @generated from message toshi.workspace.v1.ServiceStatus
517
538
  */
518
- export type BoundSecrets = Message<"toshi.workspace.v1.BoundSecrets"> & {
539
+ export type ServiceStatus = Message<"toshi.workspace.v1.ServiceStatus"> & {
519
540
  /**
520
- * @generated from field: string set_id = 1;
541
+ * @generated from field: toshi.workspace.v1.ServiceState state = 1;
521
542
  */
522
- setId: string;
543
+ state: ServiceState;
523
544
  /**
524
- * @generated from field: repeated toshi.workspace.v1.BoundKey keys = 2;
545
+ * Set once the state is ENDED: STOPPED or FAILED.
546
+ *
547
+ * @generated from field: toshi.workspace.v1.EndReason end_reason = 2;
525
548
  */
526
- keys: BoundKey[];
527
- };
528
- /**
529
- * BoundSecrets is the environment's secret set as it was when the
530
- * workload started: which keys, from which set, at which version. Never
531
- * a value.
532
- *
533
- * @generated from message toshi.workspace.v1.BoundSecrets
534
- */
535
- export type BoundSecretsJson = {
549
+ endReason: EndReason;
536
550
  /**
537
- * @generated from field: string set_id = 1;
551
+ * The most recent error Toshi met running the service.
552
+ *
553
+ * @generated from field: toshi.workspace.v1.Error last_error = 3;
538
554
  */
539
- setId?: string;
555
+ lastError?: Error | undefined;
540
556
  /**
541
- * @generated from field: repeated toshi.workspace.v1.BoundKey keys = 2;
557
+ * @generated from field: google.protobuf.Timestamp created_at = 4;
542
558
  */
543
- keys?: BoundKeyJson[];
544
- };
545
- /**
546
- * Describes the message toshi.workspace.v1.BoundSecrets.
547
- * Use `create(BoundSecretsSchema)` to create a new message.
548
- */
549
- export declare const BoundSecretsSchema: GenMessage<BoundSecrets, {
550
- jsonType: BoundSecretsJson;
551
- }>;
552
- /**
553
- * @generated from message toshi.workspace.v1.BoundKey
554
- */
555
- export type BoundKey = Message<"toshi.workspace.v1.BoundKey"> & {
559
+ createdAt?: Timestamp | undefined;
556
560
  /**
557
- * The set the key is in: the environment's set or the project's shared
558
- * set.
559
- *
560
- * @generated from field: string set_id = 1;
561
+ * @generated from field: google.protobuf.Timestamp queued_at = 5;
561
562
  */
562
- setId: string;
563
+ queuedAt?: Timestamp | undefined;
563
564
  /**
564
- * @generated from field: string name = 2;
565
+ * @generated from field: google.protobuf.Timestamp started_at = 6;
565
566
  */
566
- name: string;
567
+ startedAt?: Timestamp | undefined;
567
568
  /**
568
- * @generated from field: int64 version = 3;
569
+ * @generated from field: google.protobuf.Timestamp ended_at = 7;
569
570
  */
570
- version: bigint;
571
+ endedAt?: Timestamp | undefined;
572
+ /**
573
+ * When anything in the service last changed.
574
+ *
575
+ * @generated from field: google.protobuf.Timestamp updated_at = 8;
576
+ */
577
+ updatedAt?: Timestamp | undefined;
571
578
  };
572
579
  /**
573
- * @generated from message toshi.workspace.v1.BoundKey
580
+ * ServiceStatus is a service's state and when it got there.
581
+ *
582
+ * @generated from message toshi.workspace.v1.ServiceStatus
574
583
  */
575
- export type BoundKeyJson = {
584
+ export type ServiceStatusJson = {
576
585
  /**
577
- * The set the key is in: the environment's set or the project's shared
578
- * set.
579
- *
580
- * @generated from field: string set_id = 1;
586
+ * @generated from field: toshi.workspace.v1.ServiceState state = 1;
581
587
  */
582
- setId?: string;
588
+ state?: ServiceStateJson;
583
589
  /**
584
- * @generated from field: string name = 2;
585
- */
586
- name?: string;
587
- /**
588
- * @generated from field: int64 version = 3;
589
- */
590
- version?: string;
591
- };
592
- /**
593
- * Describes the message toshi.workspace.v1.BoundKey.
594
- * Use `create(BoundKeySchema)` to create a new message.
595
- */
596
- export declare const BoundKeySchema: GenMessage<BoundKey, {
597
- jsonType: BoundKeyJson;
598
- }>;
599
- /**
600
- * SandboxSpec is a sandbox: a VM that runs until its owner
601
- * deletes it or Toshi stops it.
602
- *
603
- * @generated from message toshi.workspace.v1.SandboxSpec
604
- */
605
- export type SandboxSpec = Message<"toshi.workspace.v1.SandboxSpec"> & {
606
- /**
607
- * The runner size of its VM, as a job's runs-on label names one, for
608
- * example "toshi-linux-2x". Required.
609
- *
610
- * @generated from field: string size = 1;
611
- */
612
- size: string;
613
- /**
614
- * How long it may run, in whole minutes. Unset, it runs until the plan's
615
- * sandbox cap passes, or until it is stopped when the plan sets none. It
616
- * cannot be longer than the plan's cap. Its owner can raise it while the
617
- * sandbox runs (PatchWorkload).
618
- *
619
- * @generated from field: google.protobuf.Duration max_duration = 2;
620
- */
621
- maxDuration?: Duration | undefined;
622
- /**
623
- * What in its workspace the sandbox uses: only the secret set
624
- * of its environment. Checked at create and fixed when the sandbox
625
- * starts; each Execute gets the fixed values in its command's
626
- * environment.
627
- *
628
- * @generated from field: repeated toshi.workspace.v1.Binding bindings = 3;
629
- */
630
- bindings: Binding[];
631
- /**
632
- * Create only: the id of a state volume of the sandbox's project to
633
- * attach to it, which it mounts when it starts. A volume of another
634
- * project, or one attached or held elsewhere, fails the create with
635
- * FAILED_PRECONDITION. Answers carry the id the create named, even after
636
- * a detach; VolumeService answers what a volume is attached to now.
637
- *
638
- * @generated from field: string state_volume_id = 4;
639
- */
640
- stateVolumeId: string;
641
- };
642
- /**
643
- * SandboxSpec is a sandbox: a VM that runs until its owner
644
- * deletes it or Toshi stops it.
645
- *
646
- * @generated from message toshi.workspace.v1.SandboxSpec
647
- */
648
- export type SandboxSpecJson = {
649
- /**
650
- * The runner size of its VM, as a job's runs-on label names one, for
651
- * example "toshi-linux-2x". Required.
652
- *
653
- * @generated from field: string size = 1;
654
- */
655
- size?: string;
656
- /**
657
- * How long it may run, in whole minutes. Unset, it runs until the plan's
658
- * sandbox cap passes, or until it is stopped when the plan sets none. It
659
- * cannot be longer than the plan's cap. Its owner can raise it while the
660
- * sandbox runs (PatchWorkload).
661
- *
662
- * @generated from field: google.protobuf.Duration max_duration = 2;
663
- */
664
- maxDuration?: DurationJson;
665
- /**
666
- * What in its workspace the sandbox uses: only the secret set
667
- * of its environment. Checked at create and fixed when the sandbox
668
- * starts; each Execute gets the fixed values in its command's
669
- * environment.
670
- *
671
- * @generated from field: repeated toshi.workspace.v1.Binding bindings = 3;
672
- */
673
- bindings?: BindingJson[];
674
- /**
675
- * Create only: the id of a state volume of the sandbox's project to
676
- * attach to it, which it mounts when it starts. A volume of another
677
- * project, or one attached or held elsewhere, fails the create with
678
- * FAILED_PRECONDITION. Answers carry the id the create named, even after
679
- * a detach; VolumeService answers what a volume is attached to now.
680
- *
681
- * @generated from field: string state_volume_id = 4;
682
- */
683
- stateVolumeId?: string;
684
- };
685
- /**
686
- * Describes the message toshi.workspace.v1.SandboxSpec.
687
- * Use `create(SandboxSpecSchema)` to create a new message.
688
- */
689
- export declare const SandboxSpecSchema: GenMessage<SandboxSpec, {
690
- jsonType: SandboxSpecJson;
691
- }>;
692
- /**
693
- * ServiceSpec is a service. Its fields are set wherever a service's
694
- * workload is answered: every workload and service call's answer, the
695
- * workload events and the webhook deliveries. A create sets name, size,
696
- * mode, recipe, state_volume and bindings and ignores revision and
697
- * template; answers leave recipe, state_volume and bindings empty. An
698
- * event carries the spec as of its own write; an event written before
699
- * events carried it has none.
700
- *
701
- * @generated from message toshi.workspace.v1.ServiceSpec
702
- */
703
- export type ServiceSpec = Message<"toshi.workspace.v1.ServiceSpec"> & {
704
- /**
705
- * The runner size its runs are placed by, for example "toshi-linux-2x".
706
- * Empty in a create takes the configured default size.
707
- *
708
- * @generated from field: string size = 1;
709
- */
710
- size: string;
711
- /**
712
- * How it runs; set in a create, where UNSPECIFIED is always-on, and
713
- * with SetServiceMode.
714
- *
715
- * @generated from field: toshi.workspace.v1.ServiceMode mode = 2;
716
- */
717
- mode: ServiceMode;
718
- /**
719
- * The number of its current revision: its next run runs that recipe.
720
- *
721
- * @generated from field: int64 revision = 3;
722
- */
723
- revision: bigint;
724
- /**
725
- * Its name, a lower-case DNS label, unique among the tenant's services
726
- * that are not deleted, whatever their project or environment. Set in
727
- * a create; answers carry it.
728
- *
729
- * @generated from field: string name = 4;
730
- */
731
- name: string;
732
- /**
733
- * The template its recipe starts from: "agent", "mcp-server",
734
- * "model-server", "database", "browser", "dev-server", "media-server",
735
- * "proxy" or "custom". Set by the server; ignored in a request.
736
- *
737
- * @generated from field: string template = 5;
738
- */
739
- template: string;
740
- /**
741
- * Create only: the recipe of revision 1, in TOML. Answers leave it
742
- * empty.
743
- *
744
- * @generated from field: string recipe = 6;
745
- */
746
- recipe: string;
747
- /**
748
- * Create only: a state volume made with the service. Answers leave it
749
- * unset.
750
- *
751
- * @generated from field: toshi.workspace.v1.StateVolumeSpec state_volume = 7;
752
- */
753
- stateVolume?: StateVolumeSpec | undefined;
754
- /**
755
- * Create only: the service's bindings, secret sets only. Answers leave
756
- * them empty.
757
- *
758
- * @generated from field: repeated toshi.workspace.v1.Binding bindings = 8;
759
- */
760
- bindings: Binding[];
761
- /**
762
- * Whether a started on-demand service is asleep: no run is live, and
763
- * nothing keeps it awake. Set by the server; ignored in a request.
764
- *
765
- * @generated from field: bool sleeping = 9;
766
- */
767
- sleeping: boolean;
768
- /**
769
- * Until when a started on-demand service stays awake with no hold;
770
- * unset for an always-on service. Set by the server; ignored in a
771
- * request.
772
- *
773
- * @generated from field: google.protobuf.Timestamp awake_until = 10;
774
- */
775
- awakeUntil?: Timestamp | undefined;
776
- };
777
- /**
778
- * ServiceSpec is a service. Its fields are set wherever a service's
779
- * workload is answered: every workload and service call's answer, the
780
- * workload events and the webhook deliveries. A create sets name, size,
781
- * mode, recipe, state_volume and bindings and ignores revision and
782
- * template; answers leave recipe, state_volume and bindings empty. An
783
- * event carries the spec as of its own write; an event written before
784
- * events carried it has none.
785
- *
786
- * @generated from message toshi.workspace.v1.ServiceSpec
787
- */
788
- export type ServiceSpecJson = {
789
- /**
790
- * The runner size its runs are placed by, for example "toshi-linux-2x".
791
- * Empty in a create takes the configured default size.
792
- *
793
- * @generated from field: string size = 1;
794
- */
795
- size?: string;
796
- /**
797
- * How it runs; set in a create, where UNSPECIFIED is always-on, and
798
- * with SetServiceMode.
799
- *
800
- * @generated from field: toshi.workspace.v1.ServiceMode mode = 2;
801
- */
802
- mode?: ServiceModeJson;
803
- /**
804
- * The number of its current revision: its next run runs that recipe.
805
- *
806
- * @generated from field: int64 revision = 3;
807
- */
808
- revision?: string;
809
- /**
810
- * Its name, a lower-case DNS label, unique among the tenant's services
811
- * that are not deleted, whatever their project or environment. Set in
812
- * a create; answers carry it.
813
- *
814
- * @generated from field: string name = 4;
815
- */
816
- name?: string;
817
- /**
818
- * The template its recipe starts from: "agent", "mcp-server",
819
- * "model-server", "database", "browser", "dev-server", "media-server",
820
- * "proxy" or "custom". Set by the server; ignored in a request.
821
- *
822
- * @generated from field: string template = 5;
823
- */
824
- template?: string;
825
- /**
826
- * Create only: the recipe of revision 1, in TOML. Answers leave it
827
- * empty.
828
- *
829
- * @generated from field: string recipe = 6;
830
- */
831
- recipe?: string;
832
- /**
833
- * Create only: a state volume made with the service. Answers leave it
834
- * unset.
835
- *
836
- * @generated from field: toshi.workspace.v1.StateVolumeSpec state_volume = 7;
837
- */
838
- stateVolume?: StateVolumeSpecJson;
839
- /**
840
- * Create only: the service's bindings, secret sets only. Answers leave
841
- * them empty.
842
- *
843
- * @generated from field: repeated toshi.workspace.v1.Binding bindings = 8;
844
- */
845
- bindings?: BindingJson[];
846
- /**
847
- * Whether a started on-demand service is asleep: no run is live, and
848
- * nothing keeps it awake. Set by the server; ignored in a request.
849
- *
850
- * @generated from field: bool sleeping = 9;
851
- */
852
- sleeping?: boolean;
853
- /**
854
- * Until when a started on-demand service stays awake with no hold;
855
- * unset for an always-on service. Set by the server; ignored in a
856
- * request.
857
- *
858
- * @generated from field: google.protobuf.Timestamp awake_until = 10;
859
- */
860
- awakeUntil?: TimestampJson;
861
- };
862
- /**
863
- * Describes the message toshi.workspace.v1.ServiceSpec.
864
- * Use `create(ServiceSpecSchema)` to create a new message.
865
- */
866
- export declare const ServiceSpecSchema: GenMessage<ServiceSpec, {
867
- jsonType: ServiceSpecJson;
868
- }>;
869
- /**
870
- * StateVolumeSpec is the state volume a service is created with: it is
871
- * named after the service.
872
- *
873
- * @generated from message toshi.workspace.v1.StateVolumeSpec
874
- */
875
- export type StateVolumeSpec = Message<"toshi.workspace.v1.StateVolumeSpec"> & {
876
- /**
877
- * The volume's size cap, in bytes.
878
- *
879
- * @generated from field: int64 size_cap_bytes = 1;
880
- */
881
- sizeCapBytes: bigint;
882
- };
883
- /**
884
- * StateVolumeSpec is the state volume a service is created with: it is
885
- * named after the service.
886
- *
887
- * @generated from message toshi.workspace.v1.StateVolumeSpec
888
- */
889
- export type StateVolumeSpecJson = {
890
- /**
891
- * The volume's size cap, in bytes.
892
- *
893
- * @generated from field: int64 size_cap_bytes = 1;
894
- */
895
- sizeCapBytes?: string;
896
- };
897
- /**
898
- * Describes the message toshi.workspace.v1.StateVolumeSpec.
899
- * Use `create(StateVolumeSpecSchema)` to create a new message.
900
- */
901
- export declare const StateVolumeSpecSchema: GenMessage<StateVolumeSpec, {
902
- jsonType: StateVolumeSpecJson;
903
- }>;
904
- /**
905
- * Command is a program to run in a workload's VM. argv is not passed
906
- * through a shell.
907
- *
908
- * @generated from message toshi.workspace.v1.Command
909
- */
910
- export type Command = Message<"toshi.workspace.v1.Command"> & {
911
- /**
912
- * The program and its arguments; argv[0] is looked up on the PATH.
913
- *
914
- * @generated from field: repeated string argv = 1;
915
- */
916
- argv: string[];
917
- /**
918
- * Added to the environment the command starts with.
919
- *
920
- * @generated from field: map<string, string> env = 2;
921
- */
922
- env: {
923
- [key: string]: string;
924
- };
925
- /**
926
- * The working directory; empty means the VM's default.
927
- *
928
- * @generated from field: string cwd = 3;
929
- */
930
- cwd: string;
931
- };
932
- /**
933
- * Command is a program to run in a workload's VM. argv is not passed
934
- * through a shell.
935
- *
936
- * @generated from message toshi.workspace.v1.Command
937
- */
938
- export type CommandJson = {
939
- /**
940
- * The program and its arguments; argv[0] is looked up on the PATH.
941
- *
942
- * @generated from field: repeated string argv = 1;
943
- */
944
- argv?: string[];
945
- /**
946
- * Added to the environment the command starts with.
947
- *
948
- * @generated from field: map<string, string> env = 2;
949
- */
950
- env?: {
951
- [key: string]: string;
952
- };
953
- /**
954
- * The working directory; empty means the VM's default.
955
- *
956
- * @generated from field: string cwd = 3;
957
- */
958
- cwd?: string;
959
- };
960
- /**
961
- * Describes the message toshi.workspace.v1.Command.
962
- * Use `create(CommandSchema)` to create a new message.
963
- */
964
- export declare const CommandSchema: GenMessage<Command, {
965
- jsonType: CommandJson;
966
- }>;
967
- /**
968
- * WorkloadStatus is a workload's state and when it got there.
969
- *
970
- * @generated from message toshi.workspace.v1.WorkloadStatus
971
- */
972
- export type WorkloadStatus = Message<"toshi.workspace.v1.WorkloadStatus"> & {
973
- /**
974
- * @generated from field: toshi.workspace.v1.WorkloadState state = 1;
975
- */
976
- state: WorkloadState;
977
- /**
978
- * Set once the state is ENDED.
979
- *
980
- * @generated from field: toshi.workspace.v1.EndReason end_reason = 2;
981
- */
982
- endReason: EndReason;
983
- /**
984
- * A job's exit status, set when end_reason is EXITED.
985
- *
986
- * @generated from field: optional int32 exit_code = 3;
987
- */
988
- exitCode?: number | undefined;
989
- /**
990
- * The most recent error Toshi met running the workload.
991
- *
992
- * @generated from field: toshi.workspace.v1.Error last_error = 4;
993
- */
994
- lastError?: Error | undefined;
995
- /**
996
- * @generated from field: google.protobuf.Timestamp created_at = 5;
997
- */
998
- createdAt?: Timestamp | undefined;
999
- /**
1000
- * @generated from field: google.protobuf.Timestamp queued_at = 6;
1001
- */
1002
- queuedAt?: Timestamp | undefined;
1003
- /**
1004
- * @generated from field: google.protobuf.Timestamp started_at = 7;
1005
- */
1006
- startedAt?: Timestamp | undefined;
1007
- /**
1008
- * @generated from field: google.protobuf.Timestamp ended_at = 8;
1009
- */
1010
- endedAt?: Timestamp | undefined;
1011
- /**
1012
- * When anything in the workload last changed.
1013
- *
1014
- * @generated from field: google.protobuf.Timestamp updated_at = 9;
1015
- */
1016
- updatedAt?: Timestamp | undefined;
1017
- /**
1018
- * Why a sandbox was stopped, set once it has ended: with STOPPED, and
1019
- * with FAILED when it failed after a stop was asked.
1020
- *
1021
- * @generated from field: toshi.workspace.v1.StopReason stop_reason = 10;
1022
- */
1023
- stopReason: StopReason;
1024
- /**
1025
- * A running sandbox's previews: one for each of its http channels served
1026
- * at a hostname of its own, the channel `preview` among them. Empty for
1027
- * a job, and while the control plane serves no previews. Making or
1028
- * deleting such a channel changes the workload, so WatchWorkloads sends
1029
- * it again.
1030
- *
1031
- * @generated from field: repeated toshi.workspace.v1.SandboxPreview previews = 11;
1032
- */
1033
- previews: SandboxPreview[];
1034
- };
1035
- /**
1036
- * WorkloadStatus is a workload's state and when it got there.
1037
- *
1038
- * @generated from message toshi.workspace.v1.WorkloadStatus
1039
- */
1040
- export type WorkloadStatusJson = {
1041
- /**
1042
- * @generated from field: toshi.workspace.v1.WorkloadState state = 1;
1043
- */
1044
- state?: WorkloadStateJson;
1045
- /**
1046
- * Set once the state is ENDED.
1047
- *
1048
- * @generated from field: toshi.workspace.v1.EndReason end_reason = 2;
590
+ * Set once the state is ENDED: STOPPED or FAILED.
591
+ *
592
+ * @generated from field: toshi.workspace.v1.EndReason end_reason = 2;
1049
593
  */
1050
594
  endReason?: EndReasonJson;
1051
595
  /**
1052
- * A job's exit status, set when end_reason is EXITED.
1053
- *
1054
- * @generated from field: optional int32 exit_code = 3;
1055
- */
1056
- exitCode?: number;
1057
- /**
1058
- * The most recent error Toshi met running the workload.
596
+ * The most recent error Toshi met running the service.
1059
597
  *
1060
- * @generated from field: toshi.workspace.v1.Error last_error = 4;
598
+ * @generated from field: toshi.workspace.v1.Error last_error = 3;
1061
599
  */
1062
600
  lastError?: ErrorJson;
1063
601
  /**
1064
- * @generated from field: google.protobuf.Timestamp created_at = 5;
602
+ * @generated from field: google.protobuf.Timestamp created_at = 4;
1065
603
  */
1066
604
  createdAt?: TimestampJson;
1067
605
  /**
1068
- * @generated from field: google.protobuf.Timestamp queued_at = 6;
606
+ * @generated from field: google.protobuf.Timestamp queued_at = 5;
1069
607
  */
1070
608
  queuedAt?: TimestampJson;
1071
609
  /**
1072
- * @generated from field: google.protobuf.Timestamp started_at = 7;
610
+ * @generated from field: google.protobuf.Timestamp started_at = 6;
1073
611
  */
1074
612
  startedAt?: TimestampJson;
1075
613
  /**
1076
- * @generated from field: google.protobuf.Timestamp ended_at = 8;
614
+ * @generated from field: google.protobuf.Timestamp ended_at = 7;
1077
615
  */
1078
616
  endedAt?: TimestampJson;
1079
617
  /**
1080
- * When anything in the workload last changed.
618
+ * When anything in the service last changed.
1081
619
  *
1082
- * @generated from field: google.protobuf.Timestamp updated_at = 9;
620
+ * @generated from field: google.protobuf.Timestamp updated_at = 8;
1083
621
  */
1084
622
  updatedAt?: TimestampJson;
1085
- /**
1086
- * Why a sandbox was stopped, set once it has ended: with STOPPED, and
1087
- * with FAILED when it failed after a stop was asked.
1088
- *
1089
- * @generated from field: toshi.workspace.v1.StopReason stop_reason = 10;
1090
- */
1091
- stopReason?: StopReasonJson;
1092
- /**
1093
- * A running sandbox's previews: one for each of its http channels served
1094
- * at a hostname of its own, the channel `preview` among them. Empty for
1095
- * a job, and while the control plane serves no previews. Making or
1096
- * deleting such a channel changes the workload, so WatchWorkloads sends
1097
- * it again.
1098
- *
1099
- * @generated from field: repeated toshi.workspace.v1.SandboxPreview previews = 11;
1100
- */
1101
- previews?: SandboxPreviewJson[];
1102
623
  };
1103
624
  /**
1104
- * Describes the message toshi.workspace.v1.WorkloadStatus.
1105
- * Use `create(WorkloadStatusSchema)` to create a new message.
625
+ * Describes the message toshi.workspace.v1.ServiceStatus.
626
+ * Use `create(ServiceStatusSchema)` to create a new message.
1106
627
  */
1107
- export declare const WorkloadStatusSchema: GenMessage<WorkloadStatus, {
1108
- jsonType: WorkloadStatusJson;
628
+ export declare const ServiceStatusSchema: GenMessage<ServiceStatus, {
629
+ jsonType: ServiceStatusJson;
1109
630
  }>;
1110
631
  /**
1111
- * SandboxPreview is where a browser opens one http channel of a sandbox.
632
+ * JobSpec is a job: one command, run once.
1112
633
  *
1113
- * @generated from message toshi.workspace.v1.SandboxPreview
634
+ * @generated from message toshi.workspace.v1.JobSpec
1114
635
  */
1115
- export type SandboxPreview = Message<"toshi.workspace.v1.SandboxPreview"> & {
636
+ export type JobSpec = Message<"toshi.workspace.v1.JobSpec"> & {
1116
637
  /**
1117
- * The channel's name; `preview` for the port the sandbox's image
1118
- * declares.
1119
- *
1120
- * @generated from field: string channel = 1;
638
+ * @generated from field: toshi.workspace.v1.Command command = 1;
1121
639
  */
1122
- channel: string;
640
+ command?: Command | undefined;
1123
641
  /**
1124
- * The guest port the channel reaches.
642
+ * What in its workspace the job uses. Checked at create
643
+ * against the job's project and environment, and fixed when the job
644
+ * starts; GetJobResponse.bound shows what each was fixed to.
1125
645
  *
1126
- * @generated from field: int32 port = 2;
646
+ * @generated from field: repeated toshi.workspace.v1.Binding bindings = 2;
1127
647
  */
1128
- port: number;
648
+ bindings: Binding[];
1129
649
  /**
1130
- * The preview's origin, a scheme and a hostname without a path.
650
+ * The runner size the job runs at, a Linux size such as
651
+ * "toshi-linux-2x": jobs run on Linux guests only. Empty in a create
652
+ * takes the configured default size. Another value fails the create with
653
+ * INVALID_ARGUMENT.
1131
654
  *
1132
- * @generated from field: string url = 3;
655
+ * @generated from field: string size = 3;
1133
656
  */
1134
- url: string;
657
+ size: string;
1135
658
  };
1136
659
  /**
1137
- * SandboxPreview is where a browser opens one http channel of a sandbox.
660
+ * JobSpec is a job: one command, run once.
1138
661
  *
1139
- * @generated from message toshi.workspace.v1.SandboxPreview
662
+ * @generated from message toshi.workspace.v1.JobSpec
1140
663
  */
1141
- export type SandboxPreviewJson = {
664
+ export type JobSpecJson = {
1142
665
  /**
1143
- * The channel's name; `preview` for the port the sandbox's image
1144
- * declares.
1145
- *
1146
- * @generated from field: string channel = 1;
666
+ * @generated from field: toshi.workspace.v1.Command command = 1;
1147
667
  */
1148
- channel?: string;
668
+ command?: CommandJson;
1149
669
  /**
1150
- * The guest port the channel reaches.
670
+ * What in its workspace the job uses. Checked at create
671
+ * against the job's project and environment, and fixed when the job
672
+ * starts; GetJobResponse.bound shows what each was fixed to.
1151
673
  *
1152
- * @generated from field: int32 port = 2;
674
+ * @generated from field: repeated toshi.workspace.v1.Binding bindings = 2;
1153
675
  */
1154
- port?: number;
676
+ bindings?: BindingJson[];
1155
677
  /**
1156
- * The preview's origin, a scheme and a hostname without a path.
678
+ * The runner size the job runs at, a Linux size such as
679
+ * "toshi-linux-2x": jobs run on Linux guests only. Empty in a create
680
+ * takes the configured default size. Another value fails the create with
681
+ * INVALID_ARGUMENT.
1157
682
  *
1158
- * @generated from field: string url = 3;
683
+ * @generated from field: string size = 3;
1159
684
  */
1160
- url?: string;
685
+ size?: string;
1161
686
  };
1162
687
  /**
1163
- * Describes the message toshi.workspace.v1.SandboxPreview.
1164
- * Use `create(SandboxPreviewSchema)` to create a new message.
688
+ * Describes the message toshi.workspace.v1.JobSpec.
689
+ * Use `create(JobSpecSchema)` to create a new message.
1165
690
  */
1166
- export declare const SandboxPreviewSchema: GenMessage<SandboxPreview, {
1167
- jsonType: SandboxPreviewJson;
691
+ export declare const JobSpecSchema: GenMessage<JobSpec, {
692
+ jsonType: JobSpecJson;
1168
693
  }>;
1169
694
  /**
1170
- * Error is a failure carried in a resource rather than returned by a call.
695
+ * Binding is one binding a workload declares.
1171
696
  *
1172
- * @generated from message toshi.workspace.v1.Error
697
+ * @generated from message toshi.workspace.v1.Binding
1173
698
  */
1174
- export type Error = Message<"toshi.workspace.v1.Error"> & {
699
+ export type Binding = Message<"toshi.workspace.v1.Binding"> & {
1175
700
  /**
1176
- * A Connect error code name, such as "unavailable".
701
+ * Names the binding in the workload: a lowercase DNS label, unique in
702
+ * the workload.
1177
703
  *
1178
- * @generated from field: string code = 1;
704
+ * @generated from field: string name = 1;
1179
705
  */
1180
- code: string;
706
+ name: string;
1181
707
  /**
1182
- * @generated from field: string message = 2;
708
+ * What the binding is to. Set exactly one.
709
+ *
710
+ * @generated from oneof toshi.workspace.v1.Binding.target
1183
711
  */
1184
- message: string;
712
+ target: {
713
+ /**
714
+ * A channel of a service of the workload's project and environment.
715
+ *
716
+ * @generated from field: toshi.workspace.v1.ServiceChannel service = 2;
717
+ */
718
+ value: ServiceChannel;
719
+ case: "service";
720
+ } | {
721
+ /**
722
+ * The secret set of the workload's environment.
723
+ *
724
+ * @generated from field: toshi.workspace.v1.EnvironmentSecrets secrets = 3;
725
+ */
726
+ value: EnvironmentSecrets;
727
+ case: "secrets";
728
+ } | {
729
+ case: undefined;
730
+ value?: undefined;
731
+ };
1185
732
  };
1186
733
  /**
1187
- * Error is a failure carried in a resource rather than returned by a call.
734
+ * Binding is one binding a workload declares.
1188
735
  *
1189
- * @generated from message toshi.workspace.v1.Error
736
+ * @generated from message toshi.workspace.v1.Binding
1190
737
  */
1191
- export type ErrorJson = {
738
+ export type BindingJson = {
1192
739
  /**
1193
- * A Connect error code name, such as "unavailable".
740
+ * Names the binding in the workload: a lowercase DNS label, unique in
741
+ * the workload.
1194
742
  *
1195
- * @generated from field: string code = 1;
743
+ * @generated from field: string name = 1;
744
+ */
745
+ name?: string;
746
+ /**
747
+ * A channel of a service of the workload's project and environment.
748
+ *
749
+ * @generated from field: toshi.workspace.v1.ServiceChannel service = 2;
1196
750
  */
1197
- code?: string;
751
+ service?: ServiceChannelJson;
1198
752
  /**
1199
- * @generated from field: string message = 2;
753
+ * The secret set of the workload's environment.
754
+ *
755
+ * @generated from field: toshi.workspace.v1.EnvironmentSecrets secrets = 3;
1200
756
  */
1201
- message?: string;
757
+ secrets?: EnvironmentSecretsJson;
1202
758
  };
1203
759
  /**
1204
- * Describes the message toshi.workspace.v1.Error.
1205
- * Use `create(ErrorSchema)` to create a new message.
760
+ * Describes the message toshi.workspace.v1.Binding.
761
+ * Use `create(BindingSchema)` to create a new message.
1206
762
  */
1207
- export declare const ErrorSchema: GenMessage<Error, {
1208
- jsonType: ErrorJson;
763
+ export declare const BindingSchema: GenMessage<Binding, {
764
+ jsonType: BindingJson;
1209
765
  }>;
1210
766
  /**
1211
- * Output is what a job's command wrote, returned with the call that waited
1212
- * for it.
767
+ * ServiceChannel is a channel of a service, by the service's name and the
768
+ * channel's name in its recipe, as a recipe's uses names it:
769
+ * "<service>.<channel>".
1213
770
  *
1214
- * @generated from message toshi.workspace.v1.Output
771
+ * @generated from message toshi.workspace.v1.ServiceChannel
1215
772
  */
1216
- export type Output = Message<"toshi.workspace.v1.Output"> & {
1217
- /**
1218
- * @generated from field: bytes stdout = 1;
1219
- */
1220
- stdout: Uint8Array;
773
+ export type ServiceChannel = Message<"toshi.workspace.v1.ServiceChannel"> & {
1221
774
  /**
1222
- * @generated from field: bytes stderr = 2;
775
+ * @generated from field: string service = 1;
1223
776
  */
1224
- stderr: Uint8Array;
777
+ service: string;
1225
778
  /**
1226
- * True when the server kept only the start of a stream.
1227
- *
1228
- * @generated from field: bool truncated = 3;
779
+ * @generated from field: string channel = 2;
1229
780
  */
1230
- truncated: boolean;
781
+ channel: string;
1231
782
  };
1232
783
  /**
1233
- * Output is what a job's command wrote, returned with the call that waited
1234
- * for it.
784
+ * ServiceChannel is a channel of a service, by the service's name and the
785
+ * channel's name in its recipe, as a recipe's uses names it:
786
+ * "<service>.<channel>".
1235
787
  *
1236
- * @generated from message toshi.workspace.v1.Output
788
+ * @generated from message toshi.workspace.v1.ServiceChannel
1237
789
  */
1238
- export type OutputJson = {
1239
- /**
1240
- * @generated from field: bytes stdout = 1;
1241
- */
1242
- stdout?: string;
790
+ export type ServiceChannelJson = {
1243
791
  /**
1244
- * @generated from field: bytes stderr = 2;
792
+ * @generated from field: string service = 1;
1245
793
  */
1246
- stderr?: string;
794
+ service?: string;
1247
795
  /**
1248
- * True when the server kept only the start of a stream.
1249
- *
1250
- * @generated from field: bool truncated = 3;
796
+ * @generated from field: string channel = 2;
1251
797
  */
1252
- truncated?: boolean;
798
+ channel?: string;
1253
799
  };
1254
800
  /**
1255
- * Describes the message toshi.workspace.v1.Output.
1256
- * Use `create(OutputSchema)` to create a new message.
801
+ * Describes the message toshi.workspace.v1.ServiceChannel.
802
+ * Use `create(ServiceChannelSchema)` to create a new message.
1257
803
  */
1258
- export declare const OutputSchema: GenMessage<Output, {
1259
- jsonType: OutputJson;
804
+ export declare const ServiceChannelSchema: GenMessage<ServiceChannel, {
805
+ jsonType: ServiceChannelJson;
1260
806
  }>;
1261
807
  /**
1262
- * @generated from message toshi.workspace.v1.CreateWorkloadRequest
808
+ * EnvironmentSecrets binds the secret set of the workload's environment,
809
+ * with the project's shared keys. The set must grant the workload's kind.
810
+ *
811
+ * @generated from message toshi.workspace.v1.EnvironmentSecrets
1263
812
  */
1264
- export type CreateWorkloadRequest = Message<"toshi.workspace.v1.CreateWorkloadRequest"> & {
1265
- /**
1266
- * @generated from field: string project = 1;
1267
- */
1268
- project: string;
813
+ export type EnvironmentSecrets = Message<"toshi.workspace.v1.EnvironmentSecrets"> & {};
814
+ /**
815
+ * EnvironmentSecrets binds the secret set of the workload's environment,
816
+ * with the project's shared keys. The set must grant the workload's kind.
817
+ *
818
+ * @generated from message toshi.workspace.v1.EnvironmentSecrets
819
+ */
820
+ export type EnvironmentSecretsJson = {};
821
+ /**
822
+ * Describes the message toshi.workspace.v1.EnvironmentSecrets.
823
+ * Use `create(EnvironmentSecretsSchema)` to create a new message.
824
+ */
825
+ export declare const EnvironmentSecretsSchema: GenMessage<EnvironmentSecrets, {
826
+ jsonType: EnvironmentSecretsJson;
827
+ }>;
828
+ /**
829
+ * BoundBinding is a binding as it was fixed when its workload started.
830
+ * A later change or delete of the target leaves it as it is.
831
+ *
832
+ * @generated from message toshi.workspace.v1.BoundBinding
833
+ */
834
+ export type BoundBinding = Message<"toshi.workspace.v1.BoundBinding"> & {
1269
835
  /**
1270
- * @generated from field: string environment = 2;
836
+ * @generated from field: string name = 1;
1271
837
  */
1272
- environment: string;
838
+ name: string;
1273
839
  /**
1274
- * Exactly one is set; it names the kind.
1275
- *
1276
- * @generated from oneof toshi.workspace.v1.CreateWorkloadRequest.spec
840
+ * @generated from oneof toshi.workspace.v1.BoundBinding.target
1277
841
  */
1278
- spec: {
1279
- /**
1280
- * @generated from field: toshi.workspace.v1.JobSpec job = 3;
1281
- */
1282
- value: JobSpec;
1283
- case: "job";
1284
- } | {
842
+ target: {
1285
843
  /**
1286
- * @generated from field: toshi.workspace.v1.SandboxSpec sandbox = 4;
844
+ * @generated from field: toshi.workspace.v1.BoundService service = 2;
1287
845
  */
1288
- value: SandboxSpec;
1289
- case: "sandbox";
846
+ value: BoundService;
847
+ case: "service";
1290
848
  } | {
1291
849
  /**
1292
- * @generated from field: toshi.workspace.v1.ServiceSpec service = 5;
850
+ * @generated from field: toshi.workspace.v1.BoundSecrets secrets = 3;
1293
851
  */
1294
- value: ServiceSpec;
1295
- case: "service";
852
+ value: BoundSecrets;
853
+ case: "secrets";
1296
854
  } | {
1297
855
  case: undefined;
1298
856
  value?: undefined;
1299
857
  };
1300
858
  /**
1301
- * @generated from field: map<string, string> labels = 6;
859
+ * @generated from field: google.protobuf.Timestamp taken_at = 4;
1302
860
  */
1303
- labels: {
1304
- [key: string]: string;
1305
- };
861
+ takenAt?: Timestamp | undefined;
862
+ };
863
+ /**
864
+ * BoundBinding is a binding as it was fixed when its workload started.
865
+ * A later change or delete of the target leaves it as it is.
866
+ *
867
+ * @generated from message toshi.workspace.v1.BoundBinding
868
+ */
869
+ export type BoundBindingJson = {
1306
870
  /**
1307
- * Required: the same key on every retry of this create.
1308
- *
1309
- * @generated from field: string request_key = 7;
871
+ * @generated from field: string name = 1;
1310
872
  */
1311
- requestKey: string;
873
+ name?: string;
1312
874
  /**
1313
- * For a job: block until it ends, at most this long. Zero returns at once.
1314
- * Set for another kind it fails with INVALID_ARGUMENT.
1315
- *
1316
- * @generated from field: google.protobuf.Duration wait_for_end = 8;
875
+ * @generated from field: toshi.workspace.v1.BoundService service = 2;
1317
876
  */
1318
- waitForEnd?: Duration | undefined;
877
+ service?: BoundServiceJson;
1319
878
  /**
1320
- * What the workload records of its runs. UNSPECIFIED takes the default
1321
- * RecordingPolicy names.
1322
- *
1323
- * @generated from field: toshi.workspace.v1.RecordingPolicy recording = 9;
879
+ * @generated from field: toshi.workspace.v1.BoundSecrets secrets = 3;
1324
880
  */
1325
- recording: RecordingPolicy;
881
+ secrets?: BoundSecretsJson;
882
+ /**
883
+ * @generated from field: google.protobuf.Timestamp taken_at = 4;
884
+ */
885
+ takenAt?: TimestampJson;
1326
886
  };
1327
887
  /**
1328
- * @generated from message toshi.workspace.v1.CreateWorkloadRequest
888
+ * Describes the message toshi.workspace.v1.BoundBinding.
889
+ * Use `create(BoundBindingSchema)` to create a new message.
890
+ */
891
+ export declare const BoundBindingSchema: GenMessage<BoundBinding, {
892
+ jsonType: BoundBindingJson;
893
+ }>;
894
+ /**
895
+ * BoundService is a service channel as it was when the workload started.
896
+ *
897
+ * @generated from message toshi.workspace.v1.BoundService
1329
898
  */
1330
- export type CreateWorkloadRequestJson = {
899
+ export type BoundService = Message<"toshi.workspace.v1.BoundService"> & {
1331
900
  /**
1332
- * @generated from field: string project = 1;
901
+ * @generated from field: string service = 1;
1333
902
  */
1334
- project?: string;
903
+ service: string;
1335
904
  /**
1336
- * @generated from field: string environment = 2;
905
+ * The service's workload ID.
906
+ *
907
+ * @generated from field: string service_id = 2;
1337
908
  */
1338
- environment?: string;
909
+ serviceId: string;
1339
910
  /**
1340
- * @generated from field: toshi.workspace.v1.JobSpec job = 3;
911
+ * The service's revision that was current.
912
+ *
913
+ * @generated from field: int64 revision = 3;
1341
914
  */
1342
- job?: JobSpecJson;
915
+ revision: bigint;
1343
916
  /**
1344
- * @generated from field: toshi.workspace.v1.SandboxSpec sandbox = 4;
917
+ * @generated from field: string channel = 4;
1345
918
  */
1346
- sandbox?: SandboxSpecJson;
919
+ channel: string;
1347
920
  /**
1348
- * @generated from field: toshi.workspace.v1.ServiceSpec service = 5;
921
+ * The channel's shape and, for an http channel, its guest port.
922
+ *
923
+ * @generated from field: string shape = 5;
1349
924
  */
1350
- service?: ServiceSpecJson;
925
+ shape: string;
1351
926
  /**
1352
- * @generated from field: map<string, string> labels = 6;
927
+ * @generated from field: int32 port = 6;
1353
928
  */
1354
- labels?: {
1355
- [key: string]: string;
1356
- };
929
+ port: number;
1357
930
  /**
1358
- * Required: the same key on every retry of this create.
931
+ * What the channel accepts from the caller: "workload_identity", a
932
+ * connect credential signed by the workload identity issuer
933
+ * naming audience and this binding. Minted when the job's command
934
+ * starts, and passed only to that command.
1359
935
  *
1360
- * @generated from field: string request_key = 7;
936
+ * @generated from field: string credential = 7;
1361
937
  */
1362
- requestKey?: string;
938
+ credential: string;
1363
939
  /**
1364
- * For a job: block until it ends, at most this long. Zero returns at once.
1365
- * Set for another kind it fails with INVALID_ARGUMENT.
1366
- *
1367
- * @generated from field: google.protobuf.Duration wait_for_end = 8;
940
+ * @generated from field: string audience = 8;
1368
941
  */
1369
- waitForEnd?: DurationJson;
942
+ audience: string;
1370
943
  /**
1371
- * What the workload records of its runs. UNSPECIFIED takes the default
1372
- * RecordingPolicy names.
944
+ * The id (jti) of the connect credential minted for this binding. Never
945
+ * the credential.
1373
946
  *
1374
- * @generated from field: toshi.workspace.v1.RecordingPolicy recording = 9;
947
+ * @generated from field: string credential_id = 9;
1375
948
  */
1376
- recording?: RecordingPolicyJson;
949
+ credentialId: string;
1377
950
  };
1378
951
  /**
1379
- * Describes the message toshi.workspace.v1.CreateWorkloadRequest.
1380
- * Use `create(CreateWorkloadRequestSchema)` to create a new message.
1381
- */
1382
- export declare const CreateWorkloadRequestSchema: GenMessage<CreateWorkloadRequest, {
1383
- jsonType: CreateWorkloadRequestJson;
1384
- }>;
1385
- /**
1386
- * @generated from message toshi.workspace.v1.CreateWorkloadResponse
952
+ * BoundService is a service channel as it was when the workload started.
953
+ *
954
+ * @generated from message toshi.workspace.v1.BoundService
1387
955
  */
1388
- export type CreateWorkloadResponse = Message<"toshi.workspace.v1.CreateWorkloadResponse"> & {
956
+ export type BoundServiceJson = {
1389
957
  /**
1390
- * @generated from field: toshi.workspace.v1.Workload workload = 1;
958
+ * @generated from field: string service = 1;
1391
959
  */
1392
- workload?: Workload | undefined;
960
+ service?: string;
1393
961
  /**
1394
- * Set when wait_for_end was set and the job had ended when the call
1395
- * answered.
962
+ * The service's workload ID.
1396
963
  *
1397
- * @generated from field: toshi.workspace.v1.Output output = 2;
1398
- */
1399
- output?: Output | undefined;
1400
- };
1401
- /**
1402
- * @generated from message toshi.workspace.v1.CreateWorkloadResponse
1403
- */
1404
- export type CreateWorkloadResponseJson = {
1405
- /**
1406
- * @generated from field: toshi.workspace.v1.Workload workload = 1;
964
+ * @generated from field: string service_id = 2;
1407
965
  */
1408
- workload?: WorkloadJson;
966
+ serviceId?: string;
1409
967
  /**
1410
- * Set when wait_for_end was set and the job had ended when the call
1411
- * answered.
968
+ * The service's revision that was current.
1412
969
  *
1413
- * @generated from field: toshi.workspace.v1.Output output = 2;
970
+ * @generated from field: int64 revision = 3;
1414
971
  */
1415
- output?: OutputJson;
1416
- };
1417
- /**
1418
- * Describes the message toshi.workspace.v1.CreateWorkloadResponse.
1419
- * Use `create(CreateWorkloadResponseSchema)` to create a new message.
1420
- */
1421
- export declare const CreateWorkloadResponseSchema: GenMessage<CreateWorkloadResponse, {
1422
- jsonType: CreateWorkloadResponseJson;
1423
- }>;
1424
- /**
1425
- * @generated from message toshi.workspace.v1.GetWorkloadRequest
1426
- */
1427
- export type GetWorkloadRequest = Message<"toshi.workspace.v1.GetWorkloadRequest"> & {
972
+ revision?: string;
1428
973
  /**
1429
- * @generated from field: string project = 1;
974
+ * @generated from field: string channel = 4;
1430
975
  */
1431
- project: string;
976
+ channel?: string;
1432
977
  /**
1433
- * @generated from field: string environment = 2;
978
+ * The channel's shape and, for an http channel, its guest port.
979
+ *
980
+ * @generated from field: string shape = 5;
1434
981
  */
1435
- environment: string;
982
+ shape?: string;
1436
983
  /**
1437
- * @generated from field: string id = 3;
984
+ * @generated from field: int32 port = 6;
1438
985
  */
1439
- id: string;
1440
- };
1441
- /**
1442
- * @generated from message toshi.workspace.v1.GetWorkloadRequest
1443
- */
1444
- export type GetWorkloadRequestJson = {
986
+ port?: number;
1445
987
  /**
1446
- * @generated from field: string project = 1;
988
+ * What the channel accepts from the caller: "workload_identity", a
989
+ * connect credential signed by the workload identity issuer
990
+ * naming audience and this binding. Minted when the job's command
991
+ * starts, and passed only to that command.
992
+ *
993
+ * @generated from field: string credential = 7;
1447
994
  */
1448
- project?: string;
995
+ credential?: string;
1449
996
  /**
1450
- * @generated from field: string environment = 2;
997
+ * @generated from field: string audience = 8;
1451
998
  */
1452
- environment?: string;
999
+ audience?: string;
1453
1000
  /**
1454
- * @generated from field: string id = 3;
1001
+ * The id (jti) of the connect credential minted for this binding. Never
1002
+ * the credential.
1003
+ *
1004
+ * @generated from field: string credential_id = 9;
1455
1005
  */
1456
- id?: string;
1006
+ credentialId?: string;
1457
1007
  };
1458
1008
  /**
1459
- * Describes the message toshi.workspace.v1.GetWorkloadRequest.
1460
- * Use `create(GetWorkloadRequestSchema)` to create a new message.
1009
+ * Describes the message toshi.workspace.v1.BoundService.
1010
+ * Use `create(BoundServiceSchema)` to create a new message.
1461
1011
  */
1462
- export declare const GetWorkloadRequestSchema: GenMessage<GetWorkloadRequest, {
1463
- jsonType: GetWorkloadRequestJson;
1012
+ export declare const BoundServiceSchema: GenMessage<BoundService, {
1013
+ jsonType: BoundServiceJson;
1464
1014
  }>;
1465
1015
  /**
1466
- * @generated from message toshi.workspace.v1.GetWorkloadResponse
1016
+ * BoundSecrets is the environment's secret set as it was when the
1017
+ * workload started: which keys, from which set, at which version. Never
1018
+ * a value.
1019
+ *
1020
+ * @generated from message toshi.workspace.v1.BoundSecrets
1467
1021
  */
1468
- export type GetWorkloadResponse = Message<"toshi.workspace.v1.GetWorkloadResponse"> & {
1022
+ export type BoundSecrets = Message<"toshi.workspace.v1.BoundSecrets"> & {
1469
1023
  /**
1470
- * @generated from field: toshi.workspace.v1.Workload workload = 1;
1024
+ * @generated from field: string set_id = 1;
1471
1025
  */
1472
- workload?: Workload | undefined;
1026
+ setId: string;
1473
1027
  /**
1474
- * The workload's bindings as they were fixed when it started, in name
1475
- * order; empty before it started.
1476
- *
1477
- * @generated from field: repeated toshi.workspace.v1.BoundBinding bound = 2;
1028
+ * @generated from field: repeated toshi.workspace.v1.BoundKey keys = 2;
1478
1029
  */
1479
- bound: BoundBinding[];
1030
+ keys: BoundKey[];
1480
1031
  };
1481
1032
  /**
1482
- * @generated from message toshi.workspace.v1.GetWorkloadResponse
1033
+ * BoundSecrets is the environment's secret set as it was when the
1034
+ * workload started: which keys, from which set, at which version. Never
1035
+ * a value.
1036
+ *
1037
+ * @generated from message toshi.workspace.v1.BoundSecrets
1483
1038
  */
1484
- export type GetWorkloadResponseJson = {
1039
+ export type BoundSecretsJson = {
1485
1040
  /**
1486
- * @generated from field: toshi.workspace.v1.Workload workload = 1;
1041
+ * @generated from field: string set_id = 1;
1487
1042
  */
1488
- workload?: WorkloadJson;
1043
+ setId?: string;
1489
1044
  /**
1490
- * The workload's bindings as they were fixed when it started, in name
1491
- * order; empty before it started.
1492
- *
1493
- * @generated from field: repeated toshi.workspace.v1.BoundBinding bound = 2;
1045
+ * @generated from field: repeated toshi.workspace.v1.BoundKey keys = 2;
1494
1046
  */
1495
- bound?: BoundBindingJson[];
1047
+ keys?: BoundKeyJson[];
1496
1048
  };
1497
1049
  /**
1498
- * Describes the message toshi.workspace.v1.GetWorkloadResponse.
1499
- * Use `create(GetWorkloadResponseSchema)` to create a new message.
1050
+ * Describes the message toshi.workspace.v1.BoundSecrets.
1051
+ * Use `create(BoundSecretsSchema)` to create a new message.
1500
1052
  */
1501
- export declare const GetWorkloadResponseSchema: GenMessage<GetWorkloadResponse, {
1502
- jsonType: GetWorkloadResponseJson;
1053
+ export declare const BoundSecretsSchema: GenMessage<BoundSecrets, {
1054
+ jsonType: BoundSecretsJson;
1503
1055
  }>;
1504
1056
  /**
1505
- * @generated from message toshi.workspace.v1.ListWorkloadsRequest
1057
+ * @generated from message toshi.workspace.v1.BoundKey
1506
1058
  */
1507
- export type ListWorkloadsRequest = Message<"toshi.workspace.v1.ListWorkloadsRequest"> & {
1508
- /**
1509
- * @generated from field: string project = 1;
1510
- */
1511
- project: string;
1512
- /**
1513
- * @generated from field: string environment = 2;
1514
- */
1515
- environment: string;
1516
- /**
1517
- * Empty matches every kind.
1518
- *
1519
- * @generated from field: repeated toshi.workspace.v1.WorkloadKind kinds = 3;
1520
- */
1521
- kinds: WorkloadKind[];
1522
- /**
1523
- * Empty matches every state.
1524
- *
1525
- * @generated from field: repeated toshi.workspace.v1.WorkloadState states = 4;
1526
- */
1527
- states: WorkloadState[];
1059
+ export type BoundKey = Message<"toshi.workspace.v1.BoundKey"> & {
1528
1060
  /**
1529
- * The most workloads in one page; zero lets the server choose.
1061
+ * The set the key is in: the environment's set or the project's shared
1062
+ * set.
1530
1063
  *
1531
- * @generated from field: int32 page_size = 5;
1064
+ * @generated from field: string set_id = 1;
1532
1065
  */
1533
- pageSize: number;
1066
+ setId: string;
1534
1067
  /**
1535
- * From an earlier response's next_page_token; empty for the first page.
1536
- *
1537
- * @generated from field: string page_token = 6;
1068
+ * @generated from field: string name = 2;
1538
1069
  */
1539
- pageToken: string;
1070
+ name: string;
1540
1071
  /**
1541
- * Only the workloads that carry every one of these labels, each with
1542
- * exactly this value. A workload without one of the keys never matches,
1543
- * even when the value given is empty. No labels matches every workload.
1544
- *
1545
- * @generated from field: map<string, string> labels = 7;
1072
+ * @generated from field: int64 version = 3;
1546
1073
  */
1547
- labels: {
1548
- [key: string]: string;
1549
- };
1074
+ version: bigint;
1550
1075
  };
1551
1076
  /**
1552
- * @generated from message toshi.workspace.v1.ListWorkloadsRequest
1077
+ * @generated from message toshi.workspace.v1.BoundKey
1553
1078
  */
1554
- export type ListWorkloadsRequestJson = {
1079
+ export type BoundKeyJson = {
1555
1080
  /**
1556
- * @generated from field: string project = 1;
1081
+ * The set the key is in: the environment's set or the project's shared
1082
+ * set.
1083
+ *
1084
+ * @generated from field: string set_id = 1;
1557
1085
  */
1558
- project?: string;
1086
+ setId?: string;
1559
1087
  /**
1560
- * @generated from field: string environment = 2;
1088
+ * @generated from field: string name = 2;
1561
1089
  */
1562
- environment?: string;
1090
+ name?: string;
1563
1091
  /**
1564
- * Empty matches every kind.
1565
- *
1566
- * @generated from field: repeated toshi.workspace.v1.WorkloadKind kinds = 3;
1092
+ * @generated from field: int64 version = 3;
1567
1093
  */
1568
- kinds?: WorkloadKindJson[];
1094
+ version?: string;
1095
+ };
1096
+ /**
1097
+ * Describes the message toshi.workspace.v1.BoundKey.
1098
+ * Use `create(BoundKeySchema)` to create a new message.
1099
+ */
1100
+ export declare const BoundKeySchema: GenMessage<BoundKey, {
1101
+ jsonType: BoundKeyJson;
1102
+ }>;
1103
+ /**
1104
+ * SandboxSpec is a sandbox: a VM that runs until its owner
1105
+ * deletes it or Toshi stops it.
1106
+ *
1107
+ * @generated from message toshi.workspace.v1.SandboxSpec
1108
+ */
1109
+ export type SandboxSpec = Message<"toshi.workspace.v1.SandboxSpec"> & {
1569
1110
  /**
1570
- * Empty matches every state.
1111
+ * The runner size of its VM, as a job's runs-on label names one, for
1112
+ * example "toshi-linux-2x". Required.
1571
1113
  *
1572
- * @generated from field: repeated toshi.workspace.v1.WorkloadState states = 4;
1114
+ * @generated from field: string size = 1;
1573
1115
  */
1574
- states?: WorkloadStateJson[];
1116
+ size: string;
1575
1117
  /**
1576
- * The most workloads in one page; zero lets the server choose.
1118
+ * How long it may run, in whole minutes. Unset, it runs until the plan's
1119
+ * sandbox cap passes, or until it is stopped when the plan sets none. It
1120
+ * cannot be longer than the plan's cap. Its owner can raise it while the
1121
+ * sandbox runs (UpdateSandbox).
1577
1122
  *
1578
- * @generated from field: int32 page_size = 5;
1123
+ * @generated from field: google.protobuf.Duration max_duration = 2;
1579
1124
  */
1580
- pageSize?: number;
1125
+ maxDuration?: Duration | undefined;
1581
1126
  /**
1582
- * From an earlier response's next_page_token; empty for the first page.
1127
+ * What in its workspace the sandbox uses: only the secret set
1128
+ * of its environment. Checked at create and fixed when the sandbox
1129
+ * starts; each Execute gets the fixed values in its command's
1130
+ * environment.
1583
1131
  *
1584
- * @generated from field: string page_token = 6;
1132
+ * @generated from field: repeated toshi.workspace.v1.Binding bindings = 3;
1585
1133
  */
1586
- pageToken?: string;
1134
+ bindings: Binding[];
1587
1135
  /**
1588
- * Only the workloads that carry every one of these labels, each with
1589
- * exactly this value. A workload without one of the keys never matches,
1590
- * even when the value given is empty. No labels matches every workload.
1136
+ * Create only: the id of a state volume of the sandbox's project to
1137
+ * attach to it, which it mounts when it starts. A volume of another
1138
+ * project, or one attached or held elsewhere, fails the create with
1139
+ * FAILED_PRECONDITION. Answers carry the id the create named, even after
1140
+ * a detach; VolumeService answers what a volume is attached to now.
1591
1141
  *
1592
- * @generated from field: map<string, string> labels = 7;
1142
+ * @generated from field: string state_volume_id = 4;
1593
1143
  */
1594
- labels?: {
1595
- [key: string]: string;
1596
- };
1144
+ stateVolumeId: string;
1597
1145
  };
1598
1146
  /**
1599
- * Describes the message toshi.workspace.v1.ListWorkloadsRequest.
1600
- * Use `create(ListWorkloadsRequestSchema)` to create a new message.
1601
- */
1602
- export declare const ListWorkloadsRequestSchema: GenMessage<ListWorkloadsRequest, {
1603
- jsonType: ListWorkloadsRequestJson;
1604
- }>;
1605
- /**
1606
- * @generated from message toshi.workspace.v1.ListWorkloadsResponse
1147
+ * SandboxSpec is a sandbox: a VM that runs until its owner
1148
+ * deletes it or Toshi stops it.
1149
+ *
1150
+ * @generated from message toshi.workspace.v1.SandboxSpec
1607
1151
  */
1608
- export type ListWorkloadsResponse = Message<"toshi.workspace.v1.ListWorkloadsResponse"> & {
1609
- /**
1610
- * @generated from field: repeated toshi.workspace.v1.Workload workloads = 1;
1611
- */
1612
- workloads: Workload[];
1152
+ export type SandboxSpecJson = {
1613
1153
  /**
1614
- * Empty on the last page.
1154
+ * The runner size of its VM, as a job's runs-on label names one, for
1155
+ * example "toshi-linux-2x". Required.
1615
1156
  *
1616
- * @generated from field: string next_page_token = 2;
1157
+ * @generated from field: string size = 1;
1617
1158
  */
1618
- nextPageToken: string;
1159
+ size?: string;
1619
1160
  /**
1620
- * The event log's position when the first page was read; every page of
1621
- * the list returns it. WatchWorkloads from this cursor shows every change
1622
- * after the list.
1161
+ * How long it may run, in whole minutes. Unset, it runs until the plan's
1162
+ * sandbox cap passes, or until it is stopped when the plan sets none. It
1163
+ * cannot be longer than the plan's cap. Its owner can raise it while the
1164
+ * sandbox runs (UpdateSandbox).
1623
1165
  *
1624
- * @generated from field: string cursor = 3;
1625
- */
1626
- cursor: string;
1627
- };
1628
- /**
1629
- * @generated from message toshi.workspace.v1.ListWorkloadsResponse
1630
- */
1631
- export type ListWorkloadsResponseJson = {
1632
- /**
1633
- * @generated from field: repeated toshi.workspace.v1.Workload workloads = 1;
1166
+ * @generated from field: google.protobuf.Duration max_duration = 2;
1634
1167
  */
1635
- workloads?: WorkloadJson[];
1168
+ maxDuration?: DurationJson;
1636
1169
  /**
1637
- * Empty on the last page.
1170
+ * What in its workspace the sandbox uses: only the secret set
1171
+ * of its environment. Checked at create and fixed when the sandbox
1172
+ * starts; each Execute gets the fixed values in its command's
1173
+ * environment.
1638
1174
  *
1639
- * @generated from field: string next_page_token = 2;
1175
+ * @generated from field: repeated toshi.workspace.v1.Binding bindings = 3;
1640
1176
  */
1641
- nextPageToken?: string;
1177
+ bindings?: BindingJson[];
1642
1178
  /**
1643
- * The event log's position when the first page was read; every page of
1644
- * the list returns it. WatchWorkloads from this cursor shows every change
1645
- * after the list.
1179
+ * Create only: the id of a state volume of the sandbox's project to
1180
+ * attach to it, which it mounts when it starts. A volume of another
1181
+ * project, or one attached or held elsewhere, fails the create with
1182
+ * FAILED_PRECONDITION. Answers carry the id the create named, even after
1183
+ * a detach; VolumeService answers what a volume is attached to now.
1646
1184
  *
1647
- * @generated from field: string cursor = 3;
1185
+ * @generated from field: string state_volume_id = 4;
1648
1186
  */
1649
- cursor?: string;
1187
+ stateVolumeId?: string;
1650
1188
  };
1651
1189
  /**
1652
- * Describes the message toshi.workspace.v1.ListWorkloadsResponse.
1653
- * Use `create(ListWorkloadsResponseSchema)` to create a new message.
1190
+ * Describes the message toshi.workspace.v1.SandboxSpec.
1191
+ * Use `create(SandboxSpecSchema)` to create a new message.
1654
1192
  */
1655
- export declare const ListWorkloadsResponseSchema: GenMessage<ListWorkloadsResponse, {
1656
- jsonType: ListWorkloadsResponseJson;
1193
+ export declare const SandboxSpecSchema: GenMessage<SandboxSpec, {
1194
+ jsonType: SandboxSpecJson;
1657
1195
  }>;
1658
1196
  /**
1659
- * @generated from message toshi.workspace.v1.PatchWorkloadRequest
1197
+ * ServiceSpec is a service. Its fields are set wherever a service's
1198
+ * workload is answered: every workload and service call's answer, the
1199
+ * workload events and the webhook deliveries. A create sets name, size,
1200
+ * mode, recipe, state_volume and bindings and ignores revision and
1201
+ * template; answers leave recipe, state_volume and bindings empty. An
1202
+ * event carries the spec as of its own write; an event written before
1203
+ * events carried it has none.
1204
+ *
1205
+ * @generated from message toshi.workspace.v1.ServiceSpec
1660
1206
  */
1661
- export type PatchWorkloadRequest = Message<"toshi.workspace.v1.PatchWorkloadRequest"> & {
1662
- /**
1663
- * @generated from field: string project = 1;
1664
- */
1665
- project: string;
1666
- /**
1667
- * @generated from field: string environment = 2;
1668
- */
1669
- environment: string;
1670
- /**
1671
- * @generated from field: string id = 3;
1672
- */
1673
- id: string;
1207
+ export type ServiceSpec = Message<"toshi.workspace.v1.ServiceSpec"> & {
1674
1208
  /**
1675
- * Carries the new values of the fields update_mask names.
1209
+ * The runner size its runs are placed by, for example "toshi-linux-2x".
1210
+ * Empty in a create takes the configured default size.
1676
1211
  *
1677
- * @generated from field: toshi.workspace.v1.Workload workload = 4;
1678
- */
1679
- workload?: Workload | undefined;
1680
- /**
1681
- * @generated from field: google.protobuf.FieldMask update_mask = 5;
1212
+ * @generated from field: string size = 1;
1682
1213
  */
1683
- updateMask?: FieldMask | undefined;
1214
+ size: string;
1684
1215
  /**
1685
- * @generated from field: string request_key = 6;
1216
+ * How it runs; set in a create, where UNSPECIFIED is always-on, and
1217
+ * with SetServiceMode.
1218
+ *
1219
+ * @generated from field: toshi.workspace.v1.ServiceMode mode = 2;
1686
1220
  */
1687
- requestKey: string;
1688
- };
1689
- /**
1690
- * @generated from message toshi.workspace.v1.PatchWorkloadRequest
1691
- */
1692
- export type PatchWorkloadRequestJson = {
1221
+ mode: ServiceMode;
1693
1222
  /**
1694
- * @generated from field: string project = 1;
1223
+ * The number of its current revision: its next run runs that recipe.
1224
+ *
1225
+ * @generated from field: int64 revision = 3;
1695
1226
  */
1696
- project?: string;
1227
+ revision: bigint;
1697
1228
  /**
1698
- * @generated from field: string environment = 2;
1229
+ * Its name, a lower-case DNS label, unique among the tenant's services
1230
+ * that are not deleted, whatever their project or environment. Set in
1231
+ * a create; answers carry it.
1232
+ *
1233
+ * @generated from field: string name = 4;
1699
1234
  */
1700
- environment?: string;
1235
+ name: string;
1701
1236
  /**
1702
- * @generated from field: string id = 3;
1237
+ * The template its recipe starts from: "agent", "mcp-server",
1238
+ * "model-server", "database", "browser", "dev-server", "media-server",
1239
+ * "proxy" or "custom". Set by the server; ignored in a request.
1240
+ *
1241
+ * @generated from field: string template = 5;
1703
1242
  */
1704
- id?: string;
1243
+ template: string;
1705
1244
  /**
1706
- * Carries the new values of the fields update_mask names.
1245
+ * Create only: the recipe of revision 1, in TOML. Answers leave it
1246
+ * empty.
1707
1247
  *
1708
- * @generated from field: toshi.workspace.v1.Workload workload = 4;
1248
+ * @generated from field: string recipe = 6;
1709
1249
  */
1710
- workload?: WorkloadJson;
1250
+ recipe: string;
1711
1251
  /**
1712
- * @generated from field: google.protobuf.FieldMask update_mask = 5;
1252
+ * Create only: a state volume made with the service. Answers leave it
1253
+ * unset.
1254
+ *
1255
+ * @generated from field: toshi.workspace.v1.StateVolumeSpec state_volume = 7;
1713
1256
  */
1714
- updateMask?: FieldMaskJson;
1257
+ stateVolume?: StateVolumeSpec | undefined;
1715
1258
  /**
1716
- * @generated from field: string request_key = 6;
1259
+ * Create only: the service's bindings, secret sets only. Answers leave
1260
+ * them empty.
1261
+ *
1262
+ * @generated from field: repeated toshi.workspace.v1.Binding bindings = 8;
1717
1263
  */
1718
- requestKey?: string;
1719
- };
1720
- /**
1721
- * Describes the message toshi.workspace.v1.PatchWorkloadRequest.
1722
- * Use `create(PatchWorkloadRequestSchema)` to create a new message.
1723
- */
1724
- export declare const PatchWorkloadRequestSchema: GenMessage<PatchWorkloadRequest, {
1725
- jsonType: PatchWorkloadRequestJson;
1726
- }>;
1727
- /**
1728
- * @generated from message toshi.workspace.v1.PatchWorkloadResponse
1729
- */
1730
- export type PatchWorkloadResponse = Message<"toshi.workspace.v1.PatchWorkloadResponse"> & {
1264
+ bindings: Binding[];
1731
1265
  /**
1732
- * @generated from field: toshi.workspace.v1.Workload workload = 1;
1266
+ * Whether a started on-demand service is asleep: no run is live, and
1267
+ * nothing keeps it awake. Set by the server; ignored in a request.
1268
+ *
1269
+ * @generated from field: bool sleeping = 9;
1733
1270
  */
1734
- workload?: Workload | undefined;
1271
+ sleeping: boolean;
1735
1272
  /**
1736
- * Set when the mask names "sandbox.max_duration": completes successfully
1737
- * when the sandbox's host acknowledges the new limit in time.
1273
+ * Until when a started on-demand service stays awake with no hold;
1274
+ * unset for an always-on service. Set by the server; ignored in a
1275
+ * request.
1738
1276
  *
1739
- * @generated from field: toshi.workspace.v1.Operation operation = 2;
1277
+ * @generated from field: google.protobuf.Timestamp awake_until = 10;
1740
1278
  */
1741
- operation?: Operation | undefined;
1279
+ awakeUntil?: Timestamp | undefined;
1742
1280
  };
1743
1281
  /**
1744
- * @generated from message toshi.workspace.v1.PatchWorkloadResponse
1282
+ * ServiceSpec is a service. Its fields are set wherever a service's
1283
+ * workload is answered: every workload and service call's answer, the
1284
+ * workload events and the webhook deliveries. A create sets name, size,
1285
+ * mode, recipe, state_volume and bindings and ignores revision and
1286
+ * template; answers leave recipe, state_volume and bindings empty. An
1287
+ * event carries the spec as of its own write; an event written before
1288
+ * events carried it has none.
1289
+ *
1290
+ * @generated from message toshi.workspace.v1.ServiceSpec
1745
1291
  */
1746
- export type PatchWorkloadResponseJson = {
1292
+ export type ServiceSpecJson = {
1747
1293
  /**
1748
- * @generated from field: toshi.workspace.v1.Workload workload = 1;
1294
+ * The runner size its runs are placed by, for example "toshi-linux-2x".
1295
+ * Empty in a create takes the configured default size.
1296
+ *
1297
+ * @generated from field: string size = 1;
1749
1298
  */
1750
- workload?: WorkloadJson;
1299
+ size?: string;
1751
1300
  /**
1752
- * Set when the mask names "sandbox.max_duration": completes successfully
1753
- * when the sandbox's host acknowledges the new limit in time.
1301
+ * How it runs; set in a create, where UNSPECIFIED is always-on, and
1302
+ * with SetServiceMode.
1754
1303
  *
1755
- * @generated from field: toshi.workspace.v1.Operation operation = 2;
1304
+ * @generated from field: toshi.workspace.v1.ServiceMode mode = 2;
1756
1305
  */
1757
- operation?: OperationJson;
1758
- };
1759
- /**
1760
- * Describes the message toshi.workspace.v1.PatchWorkloadResponse.
1761
- * Use `create(PatchWorkloadResponseSchema)` to create a new message.
1762
- */
1763
- export declare const PatchWorkloadResponseSchema: GenMessage<PatchWorkloadResponse, {
1764
- jsonType: PatchWorkloadResponseJson;
1765
- }>;
1766
- /**
1767
- * @generated from message toshi.workspace.v1.DeleteWorkloadRequest
1768
- */
1769
- export type DeleteWorkloadRequest = Message<"toshi.workspace.v1.DeleteWorkloadRequest"> & {
1306
+ mode?: ServiceModeJson;
1770
1307
  /**
1771
- * @generated from field: string project = 1;
1308
+ * The number of its current revision: its next run runs that recipe.
1309
+ *
1310
+ * @generated from field: int64 revision = 3;
1772
1311
  */
1773
- project: string;
1312
+ revision?: string;
1774
1313
  /**
1775
- * @generated from field: string environment = 2;
1314
+ * Its name, a lower-case DNS label, unique among the tenant's services
1315
+ * that are not deleted, whatever their project or environment. Set in
1316
+ * a create; answers carry it.
1317
+ *
1318
+ * @generated from field: string name = 4;
1776
1319
  */
1777
- environment: string;
1320
+ name?: string;
1778
1321
  /**
1779
- * @generated from field: string id = 3;
1322
+ * The template its recipe starts from: "agent", "mcp-server",
1323
+ * "model-server", "database", "browser", "dev-server", "media-server",
1324
+ * "proxy" or "custom". Set by the server; ignored in a request.
1325
+ *
1326
+ * @generated from field: string template = 5;
1780
1327
  */
1781
- id: string;
1328
+ template?: string;
1782
1329
  /**
1783
- * @generated from field: string request_key = 4;
1330
+ * Create only: the recipe of revision 1, in TOML. Answers leave it
1331
+ * empty.
1332
+ *
1333
+ * @generated from field: string recipe = 6;
1784
1334
  */
1785
- requestKey: string;
1786
- };
1787
- /**
1788
- * @generated from message toshi.workspace.v1.DeleteWorkloadRequest
1789
- */
1790
- export type DeleteWorkloadRequestJson = {
1335
+ recipe?: string;
1791
1336
  /**
1792
- * @generated from field: string project = 1;
1337
+ * Create only: a state volume made with the service. Answers leave it
1338
+ * unset.
1339
+ *
1340
+ * @generated from field: toshi.workspace.v1.StateVolumeSpec state_volume = 7;
1793
1341
  */
1794
- project?: string;
1342
+ stateVolume?: StateVolumeSpecJson;
1795
1343
  /**
1796
- * @generated from field: string environment = 2;
1344
+ * Create only: the service's bindings, secret sets only. Answers leave
1345
+ * them empty.
1346
+ *
1347
+ * @generated from field: repeated toshi.workspace.v1.Binding bindings = 8;
1797
1348
  */
1798
- environment?: string;
1349
+ bindings?: BindingJson[];
1799
1350
  /**
1800
- * @generated from field: string id = 3;
1351
+ * Whether a started on-demand service is asleep: no run is live, and
1352
+ * nothing keeps it awake. Set by the server; ignored in a request.
1353
+ *
1354
+ * @generated from field: bool sleeping = 9;
1801
1355
  */
1802
- id?: string;
1356
+ sleeping?: boolean;
1803
1357
  /**
1804
- * @generated from field: string request_key = 4;
1358
+ * Until when a started on-demand service stays awake with no hold;
1359
+ * unset for an always-on service. Set by the server; ignored in a
1360
+ * request.
1361
+ *
1362
+ * @generated from field: google.protobuf.Timestamp awake_until = 10;
1805
1363
  */
1806
- requestKey?: string;
1364
+ awakeUntil?: TimestampJson;
1807
1365
  };
1808
1366
  /**
1809
- * Describes the message toshi.workspace.v1.DeleteWorkloadRequest.
1810
- * Use `create(DeleteWorkloadRequestSchema)` to create a new message.
1367
+ * Describes the message toshi.workspace.v1.ServiceSpec.
1368
+ * Use `create(ServiceSpecSchema)` to create a new message.
1811
1369
  */
1812
- export declare const DeleteWorkloadRequestSchema: GenMessage<DeleteWorkloadRequest, {
1813
- jsonType: DeleteWorkloadRequestJson;
1370
+ export declare const ServiceSpecSchema: GenMessage<ServiceSpec, {
1371
+ jsonType: ServiceSpecJson;
1814
1372
  }>;
1815
1373
  /**
1816
- * @generated from message toshi.workspace.v1.DeleteWorkloadResponse
1374
+ * StateVolumeSpec is the state volume a service is created with: it is
1375
+ * named after the service.
1376
+ *
1377
+ * @generated from message toshi.workspace.v1.StateVolumeSpec
1817
1378
  */
1818
- export type DeleteWorkloadResponse = Message<"toshi.workspace.v1.DeleteWorkloadResponse"> & {
1379
+ export type StateVolumeSpec = Message<"toshi.workspace.v1.StateVolumeSpec"> & {
1819
1380
  /**
1820
- * @generated from field: toshi.workspace.v1.Operation operation = 1;
1381
+ * The volume's size cap, in bytes.
1382
+ *
1383
+ * @generated from field: int64 size_cap_bytes = 1;
1821
1384
  */
1822
- operation?: Operation | undefined;
1385
+ sizeCapBytes: bigint;
1823
1386
  };
1824
1387
  /**
1825
- * @generated from message toshi.workspace.v1.DeleteWorkloadResponse
1388
+ * StateVolumeSpec is the state volume a service is created with: it is
1389
+ * named after the service.
1390
+ *
1391
+ * @generated from message toshi.workspace.v1.StateVolumeSpec
1826
1392
  */
1827
- export type DeleteWorkloadResponseJson = {
1393
+ export type StateVolumeSpecJson = {
1828
1394
  /**
1829
- * @generated from field: toshi.workspace.v1.Operation operation = 1;
1395
+ * The volume's size cap, in bytes.
1396
+ *
1397
+ * @generated from field: int64 size_cap_bytes = 1;
1830
1398
  */
1831
- operation?: OperationJson;
1399
+ sizeCapBytes?: string;
1832
1400
  };
1833
1401
  /**
1834
- * Describes the message toshi.workspace.v1.DeleteWorkloadResponse.
1835
- * Use `create(DeleteWorkloadResponseSchema)` to create a new message.
1402
+ * Describes the message toshi.workspace.v1.StateVolumeSpec.
1403
+ * Use `create(StateVolumeSpecSchema)` to create a new message.
1836
1404
  */
1837
- export declare const DeleteWorkloadResponseSchema: GenMessage<DeleteWorkloadResponse, {
1838
- jsonType: DeleteWorkloadResponseJson;
1405
+ export declare const StateVolumeSpecSchema: GenMessage<StateVolumeSpec, {
1406
+ jsonType: StateVolumeSpecJson;
1839
1407
  }>;
1840
1408
  /**
1841
- * @generated from message toshi.workspace.v1.CancelWorkloadRequest
1409
+ * Command is a program to run in a workload's VM. argv is not passed
1410
+ * through a shell.
1411
+ *
1412
+ * @generated from message toshi.workspace.v1.Command
1842
1413
  */
1843
- export type CancelWorkloadRequest = Message<"toshi.workspace.v1.CancelWorkloadRequest"> & {
1414
+ export type Command = Message<"toshi.workspace.v1.Command"> & {
1844
1415
  /**
1845
- * @generated from field: string project = 1;
1416
+ * The program and its arguments; argv[0] is looked up on the PATH.
1417
+ *
1418
+ * @generated from field: repeated string argv = 1;
1846
1419
  */
1847
- project: string;
1420
+ argv: string[];
1848
1421
  /**
1849
- * @generated from field: string environment = 2;
1422
+ * Added to the environment the command starts with.
1423
+ *
1424
+ * @generated from field: map<string, string> env = 2;
1850
1425
  */
1851
- environment: string;
1426
+ env: {
1427
+ [key: string]: string;
1428
+ };
1852
1429
  /**
1853
- * @generated from field: string id = 3;
1430
+ * The working directory; empty means the VM's default.
1431
+ *
1432
+ * @generated from field: string cwd = 3;
1854
1433
  */
1855
- id: string;
1434
+ cwd: string;
1856
1435
  };
1857
1436
  /**
1858
- * @generated from message toshi.workspace.v1.CancelWorkloadRequest
1437
+ * Command is a program to run in a workload's VM. argv is not passed
1438
+ * through a shell.
1439
+ *
1440
+ * @generated from message toshi.workspace.v1.Command
1859
1441
  */
1860
- export type CancelWorkloadRequestJson = {
1861
- /**
1862
- * @generated from field: string project = 1;
1863
- */
1864
- project?: string;
1865
- /**
1866
- * @generated from field: string environment = 2;
1867
- */
1868
- environment?: string;
1442
+ export type CommandJson = {
1869
1443
  /**
1870
- * @generated from field: string id = 3;
1444
+ * The program and its arguments; argv[0] is looked up on the PATH.
1445
+ *
1446
+ * @generated from field: repeated string argv = 1;
1871
1447
  */
1872
- id?: string;
1873
- };
1874
- /**
1875
- * Describes the message toshi.workspace.v1.CancelWorkloadRequest.
1876
- * Use `create(CancelWorkloadRequestSchema)` to create a new message.
1877
- */
1878
- export declare const CancelWorkloadRequestSchema: GenMessage<CancelWorkloadRequest, {
1879
- jsonType: CancelWorkloadRequestJson;
1880
- }>;
1881
- /**
1882
- * @generated from message toshi.workspace.v1.CancelWorkloadResponse
1883
- */
1884
- export type CancelWorkloadResponse = Message<"toshi.workspace.v1.CancelWorkloadResponse"> & {
1448
+ argv?: string[];
1885
1449
  /**
1886
- * @generated from field: toshi.workspace.v1.Workload workload = 1;
1450
+ * Added to the environment the command starts with.
1451
+ *
1452
+ * @generated from field: map<string, string> env = 2;
1887
1453
  */
1888
- workload?: Workload | undefined;
1889
- };
1890
- /**
1891
- * @generated from message toshi.workspace.v1.CancelWorkloadResponse
1892
- */
1893
- export type CancelWorkloadResponseJson = {
1454
+ env?: {
1455
+ [key: string]: string;
1456
+ };
1894
1457
  /**
1895
- * @generated from field: toshi.workspace.v1.Workload workload = 1;
1458
+ * The working directory; empty means the VM's default.
1459
+ *
1460
+ * @generated from field: string cwd = 3;
1896
1461
  */
1897
- workload?: WorkloadJson;
1462
+ cwd?: string;
1898
1463
  };
1899
1464
  /**
1900
- * Describes the message toshi.workspace.v1.CancelWorkloadResponse.
1901
- * Use `create(CancelWorkloadResponseSchema)` to create a new message.
1465
+ * Describes the message toshi.workspace.v1.Command.
1466
+ * Use `create(CommandSchema)` to create a new message.
1902
1467
  */
1903
- export declare const CancelWorkloadResponseSchema: GenMessage<CancelWorkloadResponse, {
1904
- jsonType: CancelWorkloadResponseJson;
1468
+ export declare const CommandSchema: GenMessage<Command, {
1469
+ jsonType: CommandJson;
1905
1470
  }>;
1906
1471
  /**
1907
- * @generated from message toshi.workspace.v1.WaitWorkloadRequest
1472
+ * SandboxPreview is where a browser opens one http channel of a sandbox.
1473
+ *
1474
+ * @generated from message toshi.workspace.v1.SandboxPreview
1908
1475
  */
1909
- export type WaitWorkloadRequest = Message<"toshi.workspace.v1.WaitWorkloadRequest"> & {
1910
- /**
1911
- * @generated from field: string project = 1;
1912
- */
1913
- project: string;
1914
- /**
1915
- * @generated from field: string environment = 2;
1916
- */
1917
- environment: string;
1918
- /**
1919
- * @generated from field: string id = 3;
1920
- */
1921
- id: string;
1922
- /**
1923
- * Return once the workload is in any of these states; empty means ENDED.
1924
- *
1925
- * @generated from field: repeated toshi.workspace.v1.WorkloadState states = 4;
1926
- */
1927
- states: WorkloadState[];
1476
+ export type SandboxPreview = Message<"toshi.workspace.v1.SandboxPreview"> & {
1928
1477
  /**
1929
- * The longest to block.
1478
+ * The channel's name; `preview` for the port the sandbox's image
1479
+ * declares.
1930
1480
  *
1931
- * @generated from field: google.protobuf.Duration timeout = 5;
1932
- */
1933
- timeout?: Duration | undefined;
1934
- };
1935
- /**
1936
- * @generated from message toshi.workspace.v1.WaitWorkloadRequest
1937
- */
1938
- export type WaitWorkloadRequestJson = {
1939
- /**
1940
- * @generated from field: string project = 1;
1941
- */
1942
- project?: string;
1943
- /**
1944
- * @generated from field: string environment = 2;
1945
- */
1946
- environment?: string;
1947
- /**
1948
- * @generated from field: string id = 3;
1481
+ * @generated from field: string channel = 1;
1949
1482
  */
1950
- id?: string;
1483
+ channel: string;
1951
1484
  /**
1952
- * Return once the workload is in any of these states; empty means ENDED.
1485
+ * The guest port the channel reaches.
1953
1486
  *
1954
- * @generated from field: repeated toshi.workspace.v1.WorkloadState states = 4;
1487
+ * @generated from field: int32 port = 2;
1955
1488
  */
1956
- states?: WorkloadStateJson[];
1489
+ port: number;
1957
1490
  /**
1958
- * The longest to block.
1491
+ * The preview's origin, a scheme and a hostname without a path.
1959
1492
  *
1960
- * @generated from field: google.protobuf.Duration timeout = 5;
1493
+ * @generated from field: string url = 3;
1961
1494
  */
1962
- timeout?: DurationJson;
1495
+ url: string;
1963
1496
  };
1964
1497
  /**
1965
- * Describes the message toshi.workspace.v1.WaitWorkloadRequest.
1966
- * Use `create(WaitWorkloadRequestSchema)` to create a new message.
1967
- */
1968
- export declare const WaitWorkloadRequestSchema: GenMessage<WaitWorkloadRequest, {
1969
- jsonType: WaitWorkloadRequestJson;
1970
- }>;
1971
- /**
1972
- * @generated from message toshi.workspace.v1.WaitWorkloadResponse
1498
+ * SandboxPreview is where a browser opens one http channel of a sandbox.
1499
+ *
1500
+ * @generated from message toshi.workspace.v1.SandboxPreview
1973
1501
  */
1974
- export type WaitWorkloadResponse = Message<"toshi.workspace.v1.WaitWorkloadResponse"> & {
1975
- /**
1976
- * @generated from field: toshi.workspace.v1.Workload workload = 1;
1977
- */
1978
- workload?: Workload | undefined;
1502
+ export type SandboxPreviewJson = {
1979
1503
  /**
1980
- * False when the bound passed first.
1504
+ * The channel's name; `preview` for the port the sandbox's image
1505
+ * declares.
1981
1506
  *
1982
- * @generated from field: bool reached = 2;
1507
+ * @generated from field: string channel = 1;
1983
1508
  */
1984
- reached: boolean;
1985
- };
1986
- /**
1987
- * @generated from message toshi.workspace.v1.WaitWorkloadResponse
1988
- */
1989
- export type WaitWorkloadResponseJson = {
1509
+ channel?: string;
1990
1510
  /**
1991
- * @generated from field: toshi.workspace.v1.Workload workload = 1;
1511
+ * The guest port the channel reaches.
1512
+ *
1513
+ * @generated from field: int32 port = 2;
1992
1514
  */
1993
- workload?: WorkloadJson;
1515
+ port?: number;
1994
1516
  /**
1995
- * False when the bound passed first.
1517
+ * The preview's origin, a scheme and a hostname without a path.
1996
1518
  *
1997
- * @generated from field: bool reached = 2;
1519
+ * @generated from field: string url = 3;
1998
1520
  */
1999
- reached?: boolean;
1521
+ url?: string;
2000
1522
  };
2001
1523
  /**
2002
- * Describes the message toshi.workspace.v1.WaitWorkloadResponse.
2003
- * Use `create(WaitWorkloadResponseSchema)` to create a new message.
1524
+ * Describes the message toshi.workspace.v1.SandboxPreview.
1525
+ * Use `create(SandboxPreviewSchema)` to create a new message.
2004
1526
  */
2005
- export declare const WaitWorkloadResponseSchema: GenMessage<WaitWorkloadResponse, {
2006
- jsonType: WaitWorkloadResponseJson;
1527
+ export declare const SandboxPreviewSchema: GenMessage<SandboxPreview, {
1528
+ jsonType: SandboxPreviewJson;
2007
1529
  }>;
2008
1530
  /**
2009
- * @generated from message toshi.workspace.v1.WatchWorkloadsRequest
1531
+ * Error is a failure carried in a resource rather than returned by a call.
1532
+ *
1533
+ * @generated from message toshi.workspace.v1.Error
2010
1534
  */
2011
- export type WatchWorkloadsRequest = Message<"toshi.workspace.v1.WatchWorkloadsRequest"> & {
2012
- /**
2013
- * @generated from field: string project = 1;
2014
- */
2015
- project: string;
2016
- /**
2017
- * @generated from field: string environment = 2;
2018
- */
2019
- environment: string;
2020
- /**
2021
- * Empty matches every kind.
2022
- *
2023
- * @generated from field: repeated toshi.workspace.v1.WorkloadKind kinds = 3;
2024
- */
2025
- kinds: WorkloadKind[];
1535
+ export type Error = Message<"toshi.workspace.v1.Error"> & {
2026
1536
  /**
2027
- * Changes after this position; empty starts at the oldest event the log
2028
- * keeps. A cursor older than that event fails with OUT_OF_RANGE.
1537
+ * A Connect error code name, such as "unavailable".
2029
1538
  *
2030
- * @generated from field: string cursor = 4;
1539
+ * @generated from field: string code = 1;
2031
1540
  */
2032
- cursor: string;
1541
+ code: string;
2033
1542
  /**
2034
- * Ask for keepalives: a message with only keepalive set whenever the
2035
- * stream has sent nothing for an interval the server sets (30
2036
- * seconds by default). Without it the stream sends changes only.
2037
- *
2038
- * @generated from field: bool keepalive = 5;
1543
+ * @generated from field: string message = 2;
2039
1544
  */
2040
- keepalive: boolean;
1545
+ message: string;
2041
1546
  };
2042
1547
  /**
2043
- * @generated from message toshi.workspace.v1.WatchWorkloadsRequest
1548
+ * Error is a failure carried in a resource rather than returned by a call.
1549
+ *
1550
+ * @generated from message toshi.workspace.v1.Error
2044
1551
  */
2045
- export type WatchWorkloadsRequestJson = {
2046
- /**
2047
- * @generated from field: string project = 1;
2048
- */
2049
- project?: string;
2050
- /**
2051
- * @generated from field: string environment = 2;
2052
- */
2053
- environment?: string;
2054
- /**
2055
- * Empty matches every kind.
2056
- *
2057
- * @generated from field: repeated toshi.workspace.v1.WorkloadKind kinds = 3;
2058
- */
2059
- kinds?: WorkloadKindJson[];
1552
+ export type ErrorJson = {
2060
1553
  /**
2061
- * Changes after this position; empty starts at the oldest event the log
2062
- * keeps. A cursor older than that event fails with OUT_OF_RANGE.
1554
+ * A Connect error code name, such as "unavailable".
2063
1555
  *
2064
- * @generated from field: string cursor = 4;
1556
+ * @generated from field: string code = 1;
2065
1557
  */
2066
- cursor?: string;
1558
+ code?: string;
2067
1559
  /**
2068
- * Ask for keepalives: a message with only keepalive set whenever the
2069
- * stream has sent nothing for an interval the server sets (30
2070
- * seconds by default). Without it the stream sends changes only.
2071
- *
2072
- * @generated from field: bool keepalive = 5;
1560
+ * @generated from field: string message = 2;
2073
1561
  */
2074
- keepalive?: boolean;
1562
+ message?: string;
2075
1563
  };
2076
1564
  /**
2077
- * Describes the message toshi.workspace.v1.WatchWorkloadsRequest.
2078
- * Use `create(WatchWorkloadsRequestSchema)` to create a new message.
1565
+ * Describes the message toshi.workspace.v1.Error.
1566
+ * Use `create(ErrorSchema)` to create a new message.
2079
1567
  */
2080
- export declare const WatchWorkloadsRequestSchema: GenMessage<WatchWorkloadsRequest, {
2081
- jsonType: WatchWorkloadsRequestJson;
1568
+ export declare const ErrorSchema: GenMessage<Error, {
1569
+ jsonType: ErrorJson;
2082
1570
  }>;
2083
1571
  /**
2084
- * @generated from message toshi.workspace.v1.WatchWorkloadsResponse
1572
+ * Output is what a job's command wrote, returned with the call that waited
1573
+ * for it.
1574
+ *
1575
+ * @generated from message toshi.workspace.v1.Output
2085
1576
  */
2086
- export type WatchWorkloadsResponse = Message<"toshi.workspace.v1.WatchWorkloadsResponse"> & {
2087
- /**
2088
- * The event that recorded the change.
2089
- *
2090
- * @generated from field: toshi.workspace.v1.EventType type = 1;
2091
- */
2092
- type: EventType;
1577
+ export type Output = Message<"toshi.workspace.v1.Output"> & {
2093
1578
  /**
2094
- * The workload after the change.
2095
- *
2096
- * @generated from field: toshi.workspace.v1.Workload workload = 2;
1579
+ * @generated from field: bytes stdout = 1;
2097
1580
  */
2098
- workload?: Workload | undefined;
1581
+ stdout: Uint8Array;
2099
1582
  /**
2100
- * Resume after this change.
2101
- *
2102
- * @generated from field: string cursor = 3;
1583
+ * @generated from field: bytes stderr = 2;
2103
1584
  */
2104
- cursor: string;
1585
+ stderr: Uint8Array;
2105
1586
  /**
2106
- * Set on a keepalive, with every other field empty. Only a request
2107
- * with keepalive set gets one.
1587
+ * True when the server kept only the start of a stream.
2108
1588
  *
2109
- * @generated from field: toshi.workspace.v1.Keepalive keepalive = 4;
1589
+ * @generated from field: bool truncated = 3;
2110
1590
  */
2111
- keepalive?: Keepalive | undefined;
1591
+ truncated: boolean;
2112
1592
  };
2113
1593
  /**
2114
- * @generated from message toshi.workspace.v1.WatchWorkloadsResponse
1594
+ * Output is what a job's command wrote, returned with the call that waited
1595
+ * for it.
1596
+ *
1597
+ * @generated from message toshi.workspace.v1.Output
2115
1598
  */
2116
- export type WatchWorkloadsResponseJson = {
2117
- /**
2118
- * The event that recorded the change.
2119
- *
2120
- * @generated from field: toshi.workspace.v1.EventType type = 1;
2121
- */
2122
- type?: EventTypeJson;
1599
+ export type OutputJson = {
2123
1600
  /**
2124
- * The workload after the change.
2125
- *
2126
- * @generated from field: toshi.workspace.v1.Workload workload = 2;
1601
+ * @generated from field: bytes stdout = 1;
2127
1602
  */
2128
- workload?: WorkloadJson;
1603
+ stdout?: string;
2129
1604
  /**
2130
- * Resume after this change.
2131
- *
2132
- * @generated from field: string cursor = 3;
1605
+ * @generated from field: bytes stderr = 2;
2133
1606
  */
2134
- cursor?: string;
1607
+ stderr?: string;
2135
1608
  /**
2136
- * Set on a keepalive, with every other field empty. Only a request
2137
- * with keepalive set gets one.
1609
+ * True when the server kept only the start of a stream.
2138
1610
  *
2139
- * @generated from field: toshi.workspace.v1.Keepalive keepalive = 4;
1611
+ * @generated from field: bool truncated = 3;
2140
1612
  */
2141
- keepalive?: KeepaliveJson;
1613
+ truncated?: boolean;
2142
1614
  };
2143
1615
  /**
2144
- * Describes the message toshi.workspace.v1.WatchWorkloadsResponse.
2145
- * Use `create(WatchWorkloadsResponseSchema)` to create a new message.
1616
+ * Describes the message toshi.workspace.v1.Output.
1617
+ * Use `create(OutputSchema)` to create a new message.
2146
1618
  */
2147
- export declare const WatchWorkloadsResponseSchema: GenMessage<WatchWorkloadsResponse, {
2148
- jsonType: WatchWorkloadsResponseJson;
1619
+ export declare const OutputSchema: GenMessage<Output, {
1620
+ jsonType: OutputJson;
2149
1621
  }>;
2150
1622
  /**
2151
1623
  * @generated from message toshi.workspace.v1.WatchOutputRequest
@@ -3002,9 +2474,11 @@ export type ExecuteStart = Message<"toshi.workspace.v1.ExecuteStart"> & {
3002
2474
  */
3003
2475
  environment: string;
3004
2476
  /**
3005
- * @generated from field: string workload_id = 3;
2477
+ * The sandbox the command runs in.
2478
+ *
2479
+ * @generated from field: string sandbox_id = 3;
3006
2480
  */
3007
- workloadId: string;
2481
+ sandboxId: string;
3008
2482
  /**
3009
2483
  * @generated from field: toshi.workspace.v1.Command command = 4;
3010
2484
  */
@@ -3033,9 +2507,11 @@ export type ExecuteStartJson = {
3033
2507
  */
3034
2508
  environment?: string;
3035
2509
  /**
3036
- * @generated from field: string workload_id = 3;
2510
+ * The sandbox the command runs in.
2511
+ *
2512
+ * @generated from field: string sandbox_id = 3;
3037
2513
  */
3038
- workloadId?: string;
2514
+ sandboxId?: string;
3039
2515
  /**
3040
2516
  * @generated from field: toshi.workspace.v1.Command command = 4;
3041
2517
  */
@@ -3529,12 +3005,28 @@ export type Event = Message<"toshi.workspace.v1.Event"> & {
3529
3005
  */
3530
3006
  payload: {
3531
3007
  /**
3532
- * The workload after the change, for the WORKLOAD_* types.
3008
+ * The job after the change, for the WORKLOAD_* types of a job.
3009
+ *
3010
+ * @generated from field: toshi.workspace.v1.Job job = 13;
3011
+ */
3012
+ value: Job;
3013
+ case: "job";
3014
+ } | {
3015
+ /**
3016
+ * The sandbox after the change, for the WORKLOAD_* types of a sandbox.
3533
3017
  *
3534
- * @generated from field: toshi.workspace.v1.Workload workload = 7;
3018
+ * @generated from field: toshi.workspace.v1.Sandbox sandbox = 14;
3535
3019
  */
3536
- value: Workload;
3537
- case: "workload";
3020
+ value: Sandbox;
3021
+ case: "sandbox";
3022
+ } | {
3023
+ /**
3024
+ * The service after the change, for the WORKLOAD_* types of a service.
3025
+ *
3026
+ * @generated from field: toshi.workspace.v1.Service service = 15;
3027
+ */
3028
+ value: Service;
3029
+ case: "service";
3538
3030
  } | {
3539
3031
  /**
3540
3032
  * For the EXECUTION_* types.
@@ -3616,11 +3108,23 @@ export type EventJson = {
3616
3108
  */
3617
3109
  cursor?: string;
3618
3110
  /**
3619
- * The workload after the change, for the WORKLOAD_* types.
3111
+ * The job after the change, for the WORKLOAD_* types of a job.
3112
+ *
3113
+ * @generated from field: toshi.workspace.v1.Job job = 13;
3114
+ */
3115
+ job?: JobJson;
3116
+ /**
3117
+ * The sandbox after the change, for the WORKLOAD_* types of a sandbox.
3118
+ *
3119
+ * @generated from field: toshi.workspace.v1.Sandbox sandbox = 14;
3120
+ */
3121
+ sandbox?: SandboxJson;
3122
+ /**
3123
+ * The service after the change, for the WORKLOAD_* types of a service.
3620
3124
  *
3621
- * @generated from field: toshi.workspace.v1.Workload workload = 7;
3125
+ * @generated from field: toshi.workspace.v1.Service service = 15;
3622
3126
  */
3623
- workload?: WorkloadJson;
3127
+ service?: ServiceJson;
3624
3128
  /**
3625
3129
  * For the EXECUTION_* types.
3626
3130
  *
@@ -3809,12 +3313,14 @@ export type ListEventsRequest = Message<"toshi.workspace.v1.ListEventsRequest">
3809
3313
  */
3810
3314
  workloadId: string;
3811
3315
  /**
3812
- * Events after this position; empty starts at the oldest event the log
3813
- * keeps. A cursor older than that event fails with OUT_OF_RANGE.
3316
+ * From an earlier response's next_page_token or cursor, or an event's
3317
+ * cursor: the events after that position. Empty starts at the oldest
3318
+ * event the log keeps; a position older than that event fails with
3319
+ * OUT_OF_RANGE.
3814
3320
  *
3815
- * @generated from field: string cursor = 4;
3321
+ * @generated from field: string page_token = 4;
3816
3322
  */
3817
- cursor: string;
3323
+ pageToken: string;
3818
3324
  /**
3819
3325
  * The most events in one page; zero lets the server choose.
3820
3326
  *
@@ -3841,12 +3347,14 @@ export type ListEventsRequestJson = {
3841
3347
  */
3842
3348
  workloadId?: string;
3843
3349
  /**
3844
- * Events after this position; empty starts at the oldest event the log
3845
- * keeps. A cursor older than that event fails with OUT_OF_RANGE.
3350
+ * From an earlier response's next_page_token or cursor, or an event's
3351
+ * cursor: the events after that position. Empty starts at the oldest
3352
+ * event the log keeps; a position older than that event fails with
3353
+ * OUT_OF_RANGE.
3846
3354
  *
3847
- * @generated from field: string cursor = 4;
3355
+ * @generated from field: string page_token = 4;
3848
3356
  */
3849
- cursor?: string;
3357
+ pageToken?: string;
3850
3358
  /**
3851
3359
  * The most events in one page; zero lets the server choose.
3852
3360
  *
@@ -3870,12 +3378,19 @@ export type ListEventsResponse = Message<"toshi.workspace.v1.ListEventsResponse"
3870
3378
  */
3871
3379
  events: Event[];
3872
3380
  /**
3873
- * The position after the last event returned, or the cursor asked for
3874
- * when there were none: pass it to the next call.
3381
+ * The position after the last event returned, or the page_token asked
3382
+ * for when there were none. WatchEvents from this cursor shows every
3383
+ * event after this page.
3875
3384
  *
3876
3385
  * @generated from field: string cursor = 2;
3877
3386
  */
3878
3387
  cursor: string;
3388
+ /**
3389
+ * Empty on the last page.
3390
+ *
3391
+ * @generated from field: string next_page_token = 3;
3392
+ */
3393
+ nextPageToken: string;
3879
3394
  };
3880
3395
  /**
3881
3396
  * @generated from message toshi.workspace.v1.ListEventsResponse
@@ -3886,12 +3401,19 @@ export type ListEventsResponseJson = {
3886
3401
  */
3887
3402
  events?: EventJson[];
3888
3403
  /**
3889
- * The position after the last event returned, or the cursor asked for
3890
- * when there were none: pass it to the next call.
3404
+ * The position after the last event returned, or the page_token asked
3405
+ * for when there were none. WatchEvents from this cursor shows every
3406
+ * event after this page.
3891
3407
  *
3892
3408
  * @generated from field: string cursor = 2;
3893
3409
  */
3894
3410
  cursor?: string;
3411
+ /**
3412
+ * Empty on the last page.
3413
+ *
3414
+ * @generated from field: string next_page_token = 3;
3415
+ */
3416
+ nextPageToken?: string;
3895
3417
  };
3896
3418
  /**
3897
3419
  * Describes the message toshi.workspace.v1.ListEventsResponse.
@@ -4083,9 +3605,11 @@ export type PreviewShareLink = Message<"toshi.workspace.v1.PreviewShareLink"> &
4083
3605
  */
4084
3606
  id: string;
4085
3607
  /**
4086
- * @generated from field: string workload_id = 2;
3608
+ * The sandbox whose preview the link opens.
3609
+ *
3610
+ * @generated from field: string sandbox_id = 2;
4087
3611
  */
4088
- workloadId: string;
3612
+ sandboxId: string;
4089
3613
  /**
4090
3614
  * @generated from field: toshi.workspace.v1.PreviewShareLinkState state = 3;
4091
3615
  */
@@ -4156,9 +3680,11 @@ export type PreviewShareLinkJson = {
4156
3680
  */
4157
3681
  id?: string;
4158
3682
  /**
4159
- * @generated from field: string workload_id = 2;
3683
+ * The sandbox whose preview the link opens.
3684
+ *
3685
+ * @generated from field: string sandbox_id = 2;
4160
3686
  */
4161
- workloadId?: string;
3687
+ sandboxId?: string;
4162
3688
  /**
4163
3689
  * @generated from field: toshi.workspace.v1.PreviewShareLinkState state = 3;
4164
3690
  */
@@ -4237,9 +3763,9 @@ export type CreatePreviewShareLinkRequest = Message<"toshi.workspace.v1.CreatePr
4237
3763
  /**
4238
3764
  * The sandbox whose preview the link opens.
4239
3765
  *
4240
- * @generated from field: string workload_id = 3;
3766
+ * @generated from field: string sandbox_id = 3;
4241
3767
  */
4242
- workloadId: string;
3768
+ sandboxId: string;
4243
3769
  /**
4244
3770
  * How long the link stays valid, at most the plan's maximum; unset is
4245
3771
  * 24 hours, or the plan's maximum when that is shorter.
@@ -4292,9 +3818,9 @@ export type CreatePreviewShareLinkRequestJson = {
4292
3818
  /**
4293
3819
  * The sandbox whose preview the link opens.
4294
3820
  *
4295
- * @generated from field: string workload_id = 3;
3821
+ * @generated from field: string sandbox_id = 3;
4296
3822
  */
4297
- workloadId?: string;
3823
+ sandboxId?: string;
4298
3824
  /**
4299
3825
  * How long the link stays valid, at most the plan's maximum; unset is
4300
3826
  * 24 hours, or the plan's maximum when that is shorter.
@@ -4377,9 +3903,21 @@ export type ListPreviewShareLinksRequest = Message<"toshi.workspace.v1.ListPrevi
4377
3903
  */
4378
3904
  environment: string;
4379
3905
  /**
4380
- * @generated from field: string workload_id = 3;
3906
+ * @generated from field: string sandbox_id = 3;
4381
3907
  */
4382
- workloadId: string;
3908
+ sandboxId: string;
3909
+ /**
3910
+ * The most share links in one page; zero lets the server choose.
3911
+ *
3912
+ * @generated from field: int32 page_size = 4;
3913
+ */
3914
+ pageSize: number;
3915
+ /**
3916
+ * From an earlier response's next_page_token; empty for the first page.
3917
+ *
3918
+ * @generated from field: string page_token = 5;
3919
+ */
3920
+ pageToken: string;
4383
3921
  };
4384
3922
  /**
4385
3923
  * @generated from message toshi.workspace.v1.ListPreviewShareLinksRequest
@@ -4394,9 +3932,21 @@ export type ListPreviewShareLinksRequestJson = {
4394
3932
  */
4395
3933
  environment?: string;
4396
3934
  /**
4397
- * @generated from field: string workload_id = 3;
3935
+ * @generated from field: string sandbox_id = 3;
4398
3936
  */
4399
- workloadId?: string;
3937
+ sandboxId?: string;
3938
+ /**
3939
+ * The most share links in one page; zero lets the server choose.
3940
+ *
3941
+ * @generated from field: int32 page_size = 4;
3942
+ */
3943
+ pageSize?: number;
3944
+ /**
3945
+ * From an earlier response's next_page_token; empty for the first page.
3946
+ *
3947
+ * @generated from field: string page_token = 5;
3948
+ */
3949
+ pageToken?: string;
4400
3950
  };
4401
3951
  /**
4402
3952
  * Describes the message toshi.workspace.v1.ListPreviewShareLinksRequest.
@@ -4413,6 +3963,12 @@ export type ListPreviewShareLinksResponse = Message<"toshi.workspace.v1.ListPrev
4413
3963
  * @generated from field: repeated toshi.workspace.v1.PreviewShareLink share_links = 1;
4414
3964
  */
4415
3965
  shareLinks: PreviewShareLink[];
3966
+ /**
3967
+ * Empty on the last page.
3968
+ *
3969
+ * @generated from field: string next_page_token = 2;
3970
+ */
3971
+ nextPageToken: string;
4416
3972
  };
4417
3973
  /**
4418
3974
  * @generated from message toshi.workspace.v1.ListPreviewShareLinksResponse
@@ -4422,6 +3978,12 @@ export type ListPreviewShareLinksResponseJson = {
4422
3978
  * @generated from field: repeated toshi.workspace.v1.PreviewShareLink share_links = 1;
4423
3979
  */
4424
3980
  shareLinks?: PreviewShareLinkJson[];
3981
+ /**
3982
+ * Empty on the last page.
3983
+ *
3984
+ * @generated from field: string next_page_token = 2;
3985
+ */
3986
+ nextPageToken?: string;
4425
3987
  };
4426
3988
  /**
4427
3989
  * Describes the message toshi.workspace.v1.ListPreviewShareLinksResponse.
@@ -4443,9 +4005,9 @@ export type RevokePreviewShareLinkRequest = Message<"toshi.workspace.v1.RevokePr
4443
4005
  */
4444
4006
  environment: string;
4445
4007
  /**
4446
- * @generated from field: string workload_id = 3;
4008
+ * @generated from field: string sandbox_id = 3;
4447
4009
  */
4448
- workloadId: string;
4010
+ sandboxId: string;
4449
4011
  /**
4450
4012
  * @generated from field: string share_link_id = 4;
4451
4013
  */
@@ -4464,9 +4026,9 @@ export type RevokePreviewShareLinkRequestJson = {
4464
4026
  */
4465
4027
  environment?: string;
4466
4028
  /**
4467
- * @generated from field: string workload_id = 3;
4029
+ * @generated from field: string sandbox_id = 3;
4468
4030
  */
4469
- workloadId?: string;
4031
+ sandboxId?: string;
4470
4032
  /**
4471
4033
  * @generated from field: string share_link_id = 4;
4472
4034
  */
@@ -4562,18 +4124,22 @@ export declare const StartServiceRequestSchema: GenMessage<StartServiceRequest,
4562
4124
  */
4563
4125
  export type StartServiceResponse = Message<"toshi.workspace.v1.StartServiceResponse"> & {
4564
4126
  /**
4565
- * @generated from field: toshi.workspace.v1.Workload workload = 1;
4127
+ * The service after the start.
4128
+ *
4129
+ * @generated from field: toshi.workspace.v1.Service service = 2;
4566
4130
  */
4567
- workload?: Workload | undefined;
4131
+ service?: Service | undefined;
4568
4132
  };
4569
4133
  /**
4570
4134
  * @generated from message toshi.workspace.v1.StartServiceResponse
4571
4135
  */
4572
4136
  export type StartServiceResponseJson = {
4573
4137
  /**
4574
- * @generated from field: toshi.workspace.v1.Workload workload = 1;
4138
+ * The service after the start.
4139
+ *
4140
+ * @generated from field: toshi.workspace.v1.Service service = 2;
4575
4141
  */
4576
- workload?: WorkloadJson;
4142
+ service?: ServiceJson;
4577
4143
  };
4578
4144
  /**
4579
4145
  * Describes the message toshi.workspace.v1.StartServiceResponse.
@@ -4636,18 +4202,22 @@ export declare const StopServiceRequestSchema: GenMessage<StopServiceRequest, {
4636
4202
  */
4637
4203
  export type StopServiceResponse = Message<"toshi.workspace.v1.StopServiceResponse"> & {
4638
4204
  /**
4639
- * @generated from field: toshi.workspace.v1.Workload workload = 1;
4205
+ * The service after the stop.
4206
+ *
4207
+ * @generated from field: toshi.workspace.v1.Service service = 2;
4640
4208
  */
4641
- workload?: Workload | undefined;
4209
+ service?: Service | undefined;
4642
4210
  };
4643
4211
  /**
4644
4212
  * @generated from message toshi.workspace.v1.StopServiceResponse
4645
4213
  */
4646
4214
  export type StopServiceResponseJson = {
4647
4215
  /**
4648
- * @generated from field: toshi.workspace.v1.Workload workload = 1;
4216
+ * The service after the stop.
4217
+ *
4218
+ * @generated from field: toshi.workspace.v1.Service service = 2;
4649
4219
  */
4650
- workload?: WorkloadJson;
4220
+ service?: ServiceJson;
4651
4221
  };
4652
4222
  /**
4653
4223
  * Describes the message toshi.workspace.v1.StopServiceResponse.
@@ -4722,18 +4292,22 @@ export declare const SetServiceModeRequestSchema: GenMessage<SetServiceModeReque
4722
4292
  */
4723
4293
  export type SetServiceModeResponse = Message<"toshi.workspace.v1.SetServiceModeResponse"> & {
4724
4294
  /**
4725
- * @generated from field: toshi.workspace.v1.Workload workload = 1;
4295
+ * The service after the change.
4296
+ *
4297
+ * @generated from field: toshi.workspace.v1.Service service = 2;
4726
4298
  */
4727
- workload?: Workload | undefined;
4299
+ service?: Service | undefined;
4728
4300
  };
4729
4301
  /**
4730
4302
  * @generated from message toshi.workspace.v1.SetServiceModeResponse
4731
4303
  */
4732
4304
  export type SetServiceModeResponseJson = {
4733
4305
  /**
4734
- * @generated from field: toshi.workspace.v1.Workload workload = 1;
4306
+ * The service after the change.
4307
+ *
4308
+ * @generated from field: toshi.workspace.v1.Service service = 2;
4735
4309
  */
4736
- workload?: WorkloadJson;
4310
+ service?: ServiceJson;
4737
4311
  };
4738
4312
  /**
4739
4313
  * Describes the message toshi.workspace.v1.SetServiceModeResponse.
@@ -4796,18 +4370,22 @@ export declare const WakeServiceRequestSchema: GenMessage<WakeServiceRequest, {
4796
4370
  */
4797
4371
  export type WakeServiceResponse = Message<"toshi.workspace.v1.WakeServiceResponse"> & {
4798
4372
  /**
4799
- * @generated from field: toshi.workspace.v1.Workload workload = 1;
4373
+ * The service after the wake.
4374
+ *
4375
+ * @generated from field: toshi.workspace.v1.Service service = 2;
4800
4376
  */
4801
- workload?: Workload | undefined;
4377
+ service?: Service | undefined;
4802
4378
  };
4803
4379
  /**
4804
4380
  * @generated from message toshi.workspace.v1.WakeServiceResponse
4805
4381
  */
4806
4382
  export type WakeServiceResponseJson = {
4807
4383
  /**
4808
- * @generated from field: toshi.workspace.v1.Workload workload = 1;
4384
+ * The service after the wake.
4385
+ *
4386
+ * @generated from field: toshi.workspace.v1.Service service = 2;
4809
4387
  */
4810
- workload?: WorkloadJson;
4388
+ service?: ServiceJson;
4811
4389
  };
4812
4390
  /**
4813
4391
  * Describes the message toshi.workspace.v1.WakeServiceResponse.
@@ -4881,27 +4459,31 @@ export declare const HoldServiceRequestSchema: GenMessage<HoldServiceRequest, {
4881
4459
  * @generated from message toshi.workspace.v1.HoldServiceResponse
4882
4460
  */
4883
4461
  export type HoldServiceResponse = Message<"toshi.workspace.v1.HoldServiceResponse"> & {
4884
- /**
4885
- * @generated from field: toshi.workspace.v1.Workload workload = 1;
4886
- */
4887
- workload?: Workload | undefined;
4888
4462
  /**
4889
4463
  * @generated from field: toshi.workspace.v1.ServiceHold hold = 2;
4890
4464
  */
4891
4465
  hold?: ServiceHold | undefined;
4466
+ /**
4467
+ * The service after the hold.
4468
+ *
4469
+ * @generated from field: toshi.workspace.v1.Service service = 3;
4470
+ */
4471
+ service?: Service | undefined;
4892
4472
  };
4893
4473
  /**
4894
4474
  * @generated from message toshi.workspace.v1.HoldServiceResponse
4895
4475
  */
4896
4476
  export type HoldServiceResponseJson = {
4897
- /**
4898
- * @generated from field: toshi.workspace.v1.Workload workload = 1;
4899
- */
4900
- workload?: WorkloadJson;
4901
4477
  /**
4902
4478
  * @generated from field: toshi.workspace.v1.ServiceHold hold = 2;
4903
4479
  */
4904
4480
  hold?: ServiceHoldJson;
4481
+ /**
4482
+ * The service after the hold.
4483
+ *
4484
+ * @generated from field: toshi.workspace.v1.Service service = 3;
4485
+ */
4486
+ service?: ServiceJson;
4905
4487
  };
4906
4488
  /**
4907
4489
  * Describes the message toshi.workspace.v1.HoldServiceResponse.
@@ -5009,18 +4591,22 @@ export declare const ReleaseServiceRequestSchema: GenMessage<ReleaseServiceReque
5009
4591
  */
5010
4592
  export type ReleaseServiceResponse = Message<"toshi.workspace.v1.ReleaseServiceResponse"> & {
5011
4593
  /**
5012
- * @generated from field: toshi.workspace.v1.Workload workload = 1;
4594
+ * The service after the release.
4595
+ *
4596
+ * @generated from field: toshi.workspace.v1.Service service = 2;
5013
4597
  */
5014
- workload?: Workload | undefined;
4598
+ service?: Service | undefined;
5015
4599
  };
5016
4600
  /**
5017
4601
  * @generated from message toshi.workspace.v1.ReleaseServiceResponse
5018
4602
  */
5019
4603
  export type ReleaseServiceResponseJson = {
5020
4604
  /**
5021
- * @generated from field: toshi.workspace.v1.Workload workload = 1;
4605
+ * The service after the release.
4606
+ *
4607
+ * @generated from field: toshi.workspace.v1.Service service = 2;
5022
4608
  */
5023
- workload?: WorkloadJson;
4609
+ service?: ServiceJson;
5024
4610
  };
5025
4611
  /**
5026
4612
  * Describes the message toshi.workspace.v1.ReleaseServiceResponse.
@@ -5046,11 +4632,17 @@ export type ListServiceRunsRequest = Message<"toshi.workspace.v1.ListServiceRuns
5046
4632
  */
5047
4633
  id: string;
5048
4634
  /**
5049
- * How many of the newest runs to return, at most 100; 0 returns 20.
4635
+ * The most runs in one page; zero lets the server choose.
5050
4636
  *
5051
4637
  * @generated from field: int32 page_size = 4;
5052
4638
  */
5053
4639
  pageSize: number;
4640
+ /**
4641
+ * From an earlier response's next_page_token; empty for the first page.
4642
+ *
4643
+ * @generated from field: string page_token = 5;
4644
+ */
4645
+ pageToken: string;
5054
4646
  };
5055
4647
  /**
5056
4648
  * @generated from message toshi.workspace.v1.ListServiceRunsRequest
@@ -5069,11 +4661,17 @@ export type ListServiceRunsRequestJson = {
5069
4661
  */
5070
4662
  id?: string;
5071
4663
  /**
5072
- * How many of the newest runs to return, at most 100; 0 returns 20.
4664
+ * The most runs in one page; zero lets the server choose.
5073
4665
  *
5074
4666
  * @generated from field: int32 page_size = 4;
5075
4667
  */
5076
4668
  pageSize?: number;
4669
+ /**
4670
+ * From an earlier response's next_page_token; empty for the first page.
4671
+ *
4672
+ * @generated from field: string page_token = 5;
4673
+ */
4674
+ pageToken?: string;
5077
4675
  };
5078
4676
  /**
5079
4677
  * Describes the message toshi.workspace.v1.ListServiceRunsRequest.
@@ -5089,7 +4687,13 @@ export type ListServiceRunsResponse = Message<"toshi.workspace.v1.ListServiceRun
5089
4687
  /**
5090
4688
  * @generated from field: repeated toshi.workspace.v1.ServiceRun runs = 1;
5091
4689
  */
5092
- runs: ServiceRun[];
4690
+ runs: ServiceRun[];
4691
+ /**
4692
+ * Empty on the last page.
4693
+ *
4694
+ * @generated from field: string next_page_token = 2;
4695
+ */
4696
+ nextPageToken: string;
5093
4697
  };
5094
4698
  /**
5095
4699
  * @generated from message toshi.workspace.v1.ListServiceRunsResponse
@@ -5099,6 +4703,12 @@ export type ListServiceRunsResponseJson = {
5099
4703
  * @generated from field: repeated toshi.workspace.v1.ServiceRun runs = 1;
5100
4704
  */
5101
4705
  runs?: ServiceRunJson[];
4706
+ /**
4707
+ * Empty on the last page.
4708
+ *
4709
+ * @generated from field: string next_page_token = 2;
4710
+ */
4711
+ nextPageToken?: string;
5102
4712
  };
5103
4713
  /**
5104
4714
  * Describes the message toshi.workspace.v1.ListServiceRunsResponse.
@@ -5248,96 +4858,6 @@ export type ServiceRunJson = {
5248
4858
  export declare const ServiceRunSchema: GenMessage<ServiceRun, {
5249
4859
  jsonType: ServiceRunJson;
5250
4860
  }>;
5251
- /**
5252
- * WorkloadKind says how a workload runs and ends.
5253
- *
5254
- * @generated from enum toshi.workspace.v1.WorkloadKind
5255
- */
5256
- export declare enum WorkloadKind {
5257
- /**
5258
- * @generated from enum value: WORKLOAD_KIND_UNSPECIFIED = 0;
5259
- */
5260
- UNSPECIFIED = 0,
5261
- /**
5262
- * Starts, runs its command and ends on its own.
5263
- *
5264
- * @generated from enum value: WORKLOAD_KIND_JOB = 1;
5265
- */
5266
- JOB = 1,
5267
- /**
5268
- * Runs until its owner stops it.
5269
- *
5270
- * @generated from enum value: WORKLOAD_KIND_SANDBOX = 2;
5271
- */
5272
- SANDBOX = 2,
5273
- /**
5274
- * A long-running service.
5275
- *
5276
- * @generated from enum value: WORKLOAD_KIND_SERVICE = 3;
5277
- */
5278
- SERVICE = 3
5279
- }
5280
- /**
5281
- * WorkloadKind says how a workload runs and ends.
5282
- *
5283
- * @generated from enum toshi.workspace.v1.WorkloadKind
5284
- */
5285
- export type WorkloadKindJson = "WORKLOAD_KIND_UNSPECIFIED" | "WORKLOAD_KIND_JOB" | "WORKLOAD_KIND_SANDBOX" | "WORKLOAD_KIND_SERVICE";
5286
- /**
5287
- * Describes the enum toshi.workspace.v1.WorkloadKind.
5288
- */
5289
- export declare const WorkloadKindSchema: GenEnum<WorkloadKind, WorkloadKindJson>;
5290
- /**
5291
- * WorkloadState is where a workload is in its life. Every kind shares it. A
5292
- * workload can skip a state: a job cancelled while queued ends without
5293
- * running.
5294
- *
5295
- * @generated from enum toshi.workspace.v1.WorkloadState
5296
- */
5297
- export declare enum WorkloadState {
5298
- /**
5299
- * @generated from enum value: WORKLOAD_STATE_UNSPECIFIED = 0;
5300
- */
5301
- UNSPECIFIED = 0,
5302
- /**
5303
- * Recorded, not yet waiting for capacity.
5304
- *
5305
- * @generated from enum value: WORKLOAD_STATE_CREATED = 1;
5306
- */
5307
- CREATED = 1,
5308
- /**
5309
- * Waiting for capacity.
5310
- *
5311
- * @generated from enum value: WORKLOAD_STATE_QUEUED = 2;
5312
- */
5313
- QUEUED = 2,
5314
- /**
5315
- * Its VM is up: a job's command is running, a sandbox or service is
5316
- * serving.
5317
- *
5318
- * @generated from enum value: WORKLOAD_STATE_RUNNING = 3;
5319
- */
5320
- RUNNING = 3,
5321
- /**
5322
- * It ended; the status's end_reason says how. An ended workload does not
5323
- * run again.
5324
- *
5325
- * @generated from enum value: WORKLOAD_STATE_ENDED = 4;
5326
- */
5327
- ENDED = 4
5328
- }
5329
- /**
5330
- * WorkloadState is where a workload is in its life. Every kind shares it. A
5331
- * workload can skip a state: a job cancelled while queued ends without
5332
- * running.
5333
- *
5334
- * @generated from enum toshi.workspace.v1.WorkloadState
5335
- */
5336
- export type WorkloadStateJson = "WORKLOAD_STATE_UNSPECIFIED" | "WORKLOAD_STATE_CREATED" | "WORKLOAD_STATE_QUEUED" | "WORKLOAD_STATE_RUNNING" | "WORKLOAD_STATE_ENDED";
5337
- /**
5338
- * Describes the enum toshi.workspace.v1.WorkloadState.
5339
- */
5340
- export declare const WorkloadStateSchema: GenEnum<WorkloadState, WorkloadStateJson>;
5341
4861
  /**
5342
4862
  * EndReason says how a workload ended.
5343
4863
  *
@@ -5441,6 +4961,152 @@ export type StopReasonJson = "STOP_REASON_UNSPECIFIED" | "STOP_REASON_OWNER" | "
5441
4961
  * Describes the enum toshi.workspace.v1.StopReason.
5442
4962
  */
5443
4963
  export declare const StopReasonSchema: GenEnum<StopReason, StopReasonJson>;
4964
+ /**
4965
+ * JobState is where a job is in its life. A job can skip a state: one
4966
+ * cancelled while queued ends without running.
4967
+ *
4968
+ * @generated from enum toshi.workspace.v1.JobState
4969
+ */
4970
+ export declare enum JobState {
4971
+ /**
4972
+ * @generated from enum value: JOB_STATE_UNSPECIFIED = 0;
4973
+ */
4974
+ UNSPECIFIED = 0,
4975
+ /**
4976
+ * Recorded, not yet waiting for capacity.
4977
+ *
4978
+ * @generated from enum value: JOB_STATE_CREATED = 1;
4979
+ */
4980
+ CREATED = 1,
4981
+ /**
4982
+ * Waiting for capacity.
4983
+ *
4984
+ * @generated from enum value: JOB_STATE_QUEUED = 2;
4985
+ */
4986
+ QUEUED = 2,
4987
+ /**
4988
+ * Its VM is up and its command is running.
4989
+ *
4990
+ * @generated from enum value: JOB_STATE_RUNNING = 3;
4991
+ */
4992
+ RUNNING = 3,
4993
+ /**
4994
+ * It ended; the status's end_reason says how. An ended job does not run
4995
+ * again.
4996
+ *
4997
+ * @generated from enum value: JOB_STATE_ENDED = 4;
4998
+ */
4999
+ ENDED = 4
5000
+ }
5001
+ /**
5002
+ * JobState is where a job is in its life. A job can skip a state: one
5003
+ * cancelled while queued ends without running.
5004
+ *
5005
+ * @generated from enum toshi.workspace.v1.JobState
5006
+ */
5007
+ export type JobStateJson = "JOB_STATE_UNSPECIFIED" | "JOB_STATE_CREATED" | "JOB_STATE_QUEUED" | "JOB_STATE_RUNNING" | "JOB_STATE_ENDED";
5008
+ /**
5009
+ * Describes the enum toshi.workspace.v1.JobState.
5010
+ */
5011
+ export declare const JobStateSchema: GenEnum<JobState, JobStateJson>;
5012
+ /**
5013
+ * SandboxState is where a sandbox is in its life. A sandbox can skip a
5014
+ * state: one deleted while queued ends without running.
5015
+ *
5016
+ * @generated from enum toshi.workspace.v1.SandboxState
5017
+ */
5018
+ export declare enum SandboxState {
5019
+ /**
5020
+ * @generated from enum value: SANDBOX_STATE_UNSPECIFIED = 0;
5021
+ */
5022
+ UNSPECIFIED = 0,
5023
+ /**
5024
+ * Recorded, not yet waiting for capacity.
5025
+ *
5026
+ * @generated from enum value: SANDBOX_STATE_CREATED = 1;
5027
+ */
5028
+ CREATED = 1,
5029
+ /**
5030
+ * Waiting for capacity.
5031
+ *
5032
+ * @generated from enum value: SANDBOX_STATE_QUEUED = 2;
5033
+ */
5034
+ QUEUED = 2,
5035
+ /**
5036
+ * Its VM is up and serving.
5037
+ *
5038
+ * @generated from enum value: SANDBOX_STATE_RUNNING = 3;
5039
+ */
5040
+ RUNNING = 3,
5041
+ /**
5042
+ * It ended; the status's end_reason says how. An ended sandbox does not
5043
+ * run again.
5044
+ *
5045
+ * @generated from enum value: SANDBOX_STATE_ENDED = 4;
5046
+ */
5047
+ ENDED = 4
5048
+ }
5049
+ /**
5050
+ * SandboxState is where a sandbox is in its life. A sandbox can skip a
5051
+ * state: one deleted while queued ends without running.
5052
+ *
5053
+ * @generated from enum toshi.workspace.v1.SandboxState
5054
+ */
5055
+ export type SandboxStateJson = "SANDBOX_STATE_UNSPECIFIED" | "SANDBOX_STATE_CREATED" | "SANDBOX_STATE_QUEUED" | "SANDBOX_STATE_RUNNING" | "SANDBOX_STATE_ENDED";
5056
+ /**
5057
+ * Describes the enum toshi.workspace.v1.SandboxState.
5058
+ */
5059
+ export declare const SandboxStateSchema: GenEnum<SandboxState, SandboxStateJson>;
5060
+ /**
5061
+ * ServiceState is where a service is in its life. Unlike a job or a
5062
+ * sandbox, a service moves back: StopService returns it to CREATED, and an
5063
+ * on-demand service that sleeps returns to CREATED until it is woken.
5064
+ *
5065
+ * @generated from enum toshi.workspace.v1.ServiceState
5066
+ */
5067
+ export declare enum ServiceState {
5068
+ /**
5069
+ * @generated from enum value: SERVICE_STATE_UNSPECIFIED = 0;
5070
+ */
5071
+ UNSPECIFIED = 0,
5072
+ /**
5073
+ * Recorded, and not started or asleep.
5074
+ *
5075
+ * @generated from enum value: SERVICE_STATE_CREATED = 1;
5076
+ */
5077
+ CREATED = 1,
5078
+ /**
5079
+ * A run is waiting for capacity.
5080
+ *
5081
+ * @generated from enum value: SERVICE_STATE_QUEUED = 2;
5082
+ */
5083
+ QUEUED = 2,
5084
+ /**
5085
+ * A run's VM is up and serving.
5086
+ *
5087
+ * @generated from enum value: SERVICE_STATE_RUNNING = 3;
5088
+ */
5089
+ RUNNING = 3,
5090
+ /**
5091
+ * It ended; the status's end_reason says how. An ended service does not
5092
+ * run again.
5093
+ *
5094
+ * @generated from enum value: SERVICE_STATE_ENDED = 4;
5095
+ */
5096
+ ENDED = 4
5097
+ }
5098
+ /**
5099
+ * ServiceState is where a service is in its life. Unlike a job or a
5100
+ * sandbox, a service moves back: StopService returns it to CREATED, and an
5101
+ * on-demand service that sleeps returns to CREATED until it is woken.
5102
+ *
5103
+ * @generated from enum toshi.workspace.v1.ServiceState
5104
+ */
5105
+ export type ServiceStateJson = "SERVICE_STATE_UNSPECIFIED" | "SERVICE_STATE_CREATED" | "SERVICE_STATE_QUEUED" | "SERVICE_STATE_RUNNING" | "SERVICE_STATE_ENDED";
5106
+ /**
5107
+ * Describes the enum toshi.workspace.v1.ServiceState.
5108
+ */
5109
+ export declare const ServiceStateSchema: GenEnum<ServiceState, ServiceStateJson>;
5444
5110
  /**
5445
5111
  * RecordingPolicy is what a workload records of its runs.
5446
5112
  *
@@ -5712,422 +5378,3 @@ export type ServiceRunStateJson = "SERVICE_RUN_STATE_UNSPECIFIED" | "SERVICE_RUN
5712
5378
  * Describes the enum toshi.workspace.v1.ServiceRunState.
5713
5379
  */
5714
5380
  export declare const ServiceRunStateSchema: GenEnum<ServiceRunState, ServiceRunStateJson>;
5715
- /**
5716
- * WorkspaceService is the Workspace API. The caller's credential
5717
- * names the workspace; every request names the project and the environment
5718
- * in its project and environment fields, and a call that leaves either empty
5719
- * fails with INVALID_ARGUMENT. The environment is one of the project's
5720
- * environments; a project or environment the workspace does not
5721
- * have is NOT_FOUND. A workload, execution, operation or event of another
5722
- * project or environment is NOT_FOUND.
5723
- *
5724
- * Every mutating call takes a request_key. A key is bound to the workspace,
5725
- * the call and the request's payload: a retry with the same key and the same
5726
- * payload returns what the first call returned and starts nothing new; the
5727
- * same key with a different payload fails with FAILED_PRECONDITION.
5728
- * CreateWorkload requires a key: a create without one fails with
5729
- * INVALID_ARGUMENT. For the other calls an empty key means no retry
5730
- * protection. CancelWorkload takes none: a repeat of it changes nothing.
5731
- *
5732
- * A caller over its rate limit gets RESOURCE_EXHAUSTED with a
5733
- * google.rpc.RetryInfo detail: the delay before a retry, on every protocol.
5734
- * The same whole seconds are in a Retry-After response header on Connect and
5735
- * gRPC-Web calls and on gRPC streams, and in the trailing metadata of a gRPC
5736
- * unary call.
5737
- *
5738
- * @generated from service toshi.workspace.v1.WorkspaceService
5739
- */
5740
- export declare const WorkspaceService: GenService<{
5741
- /**
5742
- * CreateWorkload creates a workload of the kind its spec names and returns
5743
- * it. With wait_for_end set, a job's call blocks until the job ends or the
5744
- * bound passes. If the job has ended when the call answers, the answer
5745
- * carries its exit status and output without a second read; otherwise it
5746
- * carries the job as it is and no output, and no later call returns it.
5747
- *
5748
- * @generated from rpc toshi.workspace.v1.WorkspaceService.CreateWorkload
5749
- */
5750
- createWorkload: {
5751
- methodKind: "unary";
5752
- input: typeof CreateWorkloadRequestSchema;
5753
- output: typeof CreateWorkloadResponseSchema;
5754
- };
5755
- /**
5756
- * GetWorkload returns one workload. An unknown ID fails with NOT_FOUND.
5757
- *
5758
- * @generated from rpc toshi.workspace.v1.WorkspaceService.GetWorkload
5759
- */
5760
- getWorkload: {
5761
- methodKind: "unary";
5762
- input: typeof GetWorkloadRequestSchema;
5763
- output: typeof GetWorkloadResponseSchema;
5764
- };
5765
- /**
5766
- * ListWorkloads returns the workloads that match every filter that is set,
5767
- * oldest first, a page at a time. A page token from one call stays valid
5768
- * while workloads are created: a later page never repeats or skips a
5769
- * workload of an earlier one.
5770
- *
5771
- * @generated from rpc toshi.workspace.v1.WorkspaceService.ListWorkloads
5772
- */
5773
- listWorkloads: {
5774
- methodKind: "unary";
5775
- input: typeof ListWorkloadsRequestSchema;
5776
- output: typeof ListWorkloadsResponseSchema;
5777
- };
5778
- /**
5779
- * PatchWorkload changes the fields the mask names and returns the workload.
5780
- * "labels" can be changed on any workload. "sandbox.max_duration" raises a
5781
- * running sandbox's limit and must be the only path: the new limit, in
5782
- * whole minutes from the sandbox's start, above its current one and no
5783
- * longer than the plan's sandbox cap. The response then carries an
5784
- * operation, which completes successfully when the sandbox's host
5785
- * acknowledges the new limit in time and the sandbox still runs with no
5786
- * stop asked for; until then the workload shows the current one. The
5787
- * operation fails with UNAVAILABLE when the host does not acknowledge the
5788
- * limit in time, and with FAILED_PRECONDITION when the sandbox stops
5789
- * first; the limit the control plane records is then unchanged. A host
5790
- * that applied the new limit but whose acknowledgment was lost can keep
5791
- * it until it takes the old limit back or the sandbox stops. A sandbox
5792
- * that is not running, has a stop asked for, has no limit of its own or
5793
- * has a raise pending, or whose host's agent cannot take a new limit,
5794
- * fails with FAILED_PRECONDITION. Another path fails with
5795
- * INVALID_ARGUMENT.
5796
- *
5797
- * @generated from rpc toshi.workspace.v1.WorkspaceService.PatchWorkload
5798
- */
5799
- patchWorkload: {
5800
- methodKind: "unary";
5801
- input: typeof PatchWorkloadRequestSchema;
5802
- output: typeof PatchWorkloadResponseSchema;
5803
- };
5804
- /**
5805
- * DeleteWorkload ends a workload that has not ended and then removes it.
5806
- * A job is cancelled, a sandbox or service is stopped, and every execution
5807
- * in it is cancelled. It returns an operation that is done once the
5808
- * workload is removed; GetWorkload then fails with NOT_FOUND, and the event
5809
- * log keeps its events.
5810
- *
5811
- * @generated from rpc toshi.workspace.v1.WorkspaceService.DeleteWorkload
5812
- */
5813
- deleteWorkload: {
5814
- methodKind: "unary";
5815
- input: typeof DeleteWorkloadRequestSchema;
5816
- output: typeof DeleteWorkloadResponseSchema;
5817
- };
5818
- /**
5819
- * CancelWorkload cancels a job that has not ended and returns it. The job
5820
- * is kept: it ends with END_REASON_CANCELLED, and GetWorkload and
5821
- * ListWorkloads return it. A job whose command has not started ends at
5822
- * once, and the answer carries the end; a job whose command runs ends
5823
- * once its host has stopped it, and WaitWorkload waits for that end.
5824
- * Every execution in the job is cancelled. A call for a job that has
5825
- * ended changes nothing and returns the job as it is. An unknown ID fails
5826
- * with NOT_FOUND; a sandbox or service fails with INVALID_ARGUMENT, since
5827
- * DeleteWorkload stops one.
5828
- *
5829
- * @generated from rpc toshi.workspace.v1.WorkspaceService.CancelWorkload
5830
- */
5831
- cancelWorkload: {
5832
- methodKind: "unary";
5833
- input: typeof CancelWorkloadRequestSchema;
5834
- output: typeof CancelWorkloadResponseSchema;
5835
- };
5836
- /**
5837
- * WaitWorkload blocks until the workload is in one of the states asked for
5838
- * or the bound passes, whichever is first, and returns the workload as it
5839
- * then is. Passing the bound is not an error: reached is false, and the
5840
- * caller asks again. The server may wait less than the bound asked for.
5841
- *
5842
- * @generated from rpc toshi.workspace.v1.WorkspaceService.WaitWorkload
5843
- */
5844
- waitWorkload: {
5845
- methodKind: "unary";
5846
- input: typeof WaitWorkloadRequestSchema;
5847
- output: typeof WaitWorkloadResponseSchema;
5848
- };
5849
- /**
5850
- * WatchWorkloads streams each change to a workload as the event log
5851
- * records it, from the position after a cursor, then as changes happen.
5852
- * A cursor from ListWorkloads, ListEvents or an earlier message resumes
5853
- * with no change missed and none repeated, while the log still keeps the
5854
- * events after it; an older cursor fails with OUT_OF_RANGE.
5855
- *
5856
- * @generated from rpc toshi.workspace.v1.WorkspaceService.WatchWorkloads
5857
- */
5858
- watchWorkloads: {
5859
- methodKind: "server_streaming";
5860
- input: typeof WatchWorkloadsRequestSchema;
5861
- output: typeof WatchWorkloadsResponseSchema;
5862
- };
5863
- /**
5864
- * WatchOutput streams a job's standard output and error while it runs:
5865
- * the bytes the server holds from the offsets asked for, then each write
5866
- * as it happens, and last how the job ended. A job that has not started
5867
- * yet is waited for. The server holds the first 1 MiB of each stream, as
5868
- * for CreateWorkload's output, and only while the job runs: a job whose
5869
- * output this server no longer holds (it has ended) or never held (its
5870
- * command runs on another server) fails with FAILED_PRECONDITION, and a
5871
- * job that ends while the call is answered is followed to its end. A
5872
- * sandbox or service fails with INVALID_ARGUMENT.
5873
- * A reader never slows or cancels the job: each reads what the server
5874
- * holds at its own pace.
5875
- *
5876
- * @generated from rpc toshi.workspace.v1.WorkspaceService.WatchOutput
5877
- */
5878
- watchOutput: {
5879
- methodKind: "server_streaming";
5880
- input: typeof WatchOutputRequestSchema;
5881
- output: typeof WatchOutputResponseSchema;
5882
- };
5883
- /**
5884
- * WatchTelemetry streams a sandbox's resource samples as its host reports
5885
- * them, in cursor order: the samples kept after a cursor, then each one as
5886
- * it is stored. Each sample stored takes the next cursor, also one timed
5887
- * before a sample already sent. Last comes an end, once the sandbox has
5888
- * ended and every sample still kept that was stored before it ended has
5889
- * been sent. A host can report a sample after the end: a watch resumed
5890
- * from the last cursor returns it, then ends again. A sandbox that has
5891
- * not started yet is waited for. A job or service fails with
5892
- * INVALID_ARGUMENT.
5893
- *
5894
- * @generated from rpc toshi.workspace.v1.WorkspaceService.WatchTelemetry
5895
- */
5896
- watchTelemetry: {
5897
- methodKind: "server_streaming";
5898
- input: typeof WatchTelemetryRequestSchema;
5899
- output: typeof WatchTelemetryResponseSchema;
5900
- };
5901
- /**
5902
- * WatchGuestLog streams what a sandbox's VM writes to its serial console:
5903
- * the bytes its host keeps from a cursor on, then each write as it
5904
- * happens, until the sandbox ends. The host keeps the newest part of the
5905
- * console; bytes it no longer keeps are skipped, and the next chunk's
5906
- * offset shows the gap. A slow reader does not block the VM's console
5907
- * writes; bytes rotated out before it reads them are skipped. A sandbox
5908
- * that has not started yet is waited for, and so is an empty console. A
5909
- * sandbox that has ended, or whose host keeps no console log, fails with
5910
- * FAILED_PRECONDITION. A job or service fails with INVALID_ARGUMENT.
5911
- *
5912
- * @generated from rpc toshi.workspace.v1.WorkspaceService.WatchGuestLog
5913
- */
5914
- watchGuestLog: {
5915
- methodKind: "server_streaming";
5916
- input: typeof WatchGuestLogRequestSchema;
5917
- output: typeof WatchGuestLogResponseSchema;
5918
- };
5919
- /**
5920
- * Execute starts a command in a running workload. The first request
5921
- * carries the start message; later requests carry standard input. The
5922
- * stream answers with the execution's ID, then its standard output and
5923
- * error as they are written, and ends with its exit status. A workload
5924
- * that is not running fails with FAILED_PRECONDITION. A server may cancel
5925
- * an execution whose client stops reading its output.
5926
- *
5927
- * @generated from rpc toshi.workspace.v1.WorkspaceService.Execute
5928
- */
5929
- execute: {
5930
- methodKind: "bidi_streaming";
5931
- input: typeof ExecuteRequestSchema;
5932
- output: typeof ExecuteResponseSchema;
5933
- };
5934
- /**
5935
- * CancelExecution stops an execution. Its Execute stream ends with an exit
5936
- * that says it was cancelled. Cancelling an execution that has ended
5937
- * changes nothing. It returns once the execution has ended, whether or not
5938
- * the Execute stream's client still reads it.
5939
- *
5940
- * @generated from rpc toshi.workspace.v1.WorkspaceService.CancelExecution
5941
- */
5942
- cancelExecution: {
5943
- methodKind: "unary";
5944
- input: typeof CancelExecutionRequestSchema;
5945
- output: typeof CancelExecutionResponseSchema;
5946
- };
5947
- /**
5948
- * GetOperation returns one operation. An unknown ID fails with NOT_FOUND.
5949
- *
5950
- * @generated from rpc toshi.workspace.v1.WorkspaceService.GetOperation
5951
- */
5952
- getOperation: {
5953
- methodKind: "unary";
5954
- input: typeof GetOperationRequestSchema;
5955
- output: typeof GetOperationResponseSchema;
5956
- };
5957
- /**
5958
- * WaitOperation blocks until the operation is done or the bound passes,
5959
- * whichever is first, and returns it. Passing the bound is not an error:
5960
- * the operation comes back not done, and the caller asks again. The server
5961
- * may wait less than the bound asked for.
5962
- *
5963
- * @generated from rpc toshi.workspace.v1.WorkspaceService.WaitOperation
5964
- */
5965
- waitOperation: {
5966
- methodKind: "unary";
5967
- input: typeof WaitOperationRequestSchema;
5968
- output: typeof WaitOperationResponseSchema;
5969
- };
5970
- /**
5971
- * ListEvents returns the events after a cursor, oldest first, a page at a
5972
- * time, for a client that polls or catches up after downtime.
5973
- *
5974
- * @generated from rpc toshi.workspace.v1.WorkspaceService.ListEvents
5975
- */
5976
- listEvents: {
5977
- methodKind: "unary";
5978
- input: typeof ListEventsRequestSchema;
5979
- output: typeof ListEventsResponseSchema;
5980
- };
5981
- /**
5982
- * WatchEvents streams the events after a cursor, then each new event as
5983
- * it is written, for a client that stays connected.
5984
- *
5985
- * @generated from rpc toshi.workspace.v1.WorkspaceService.WatchEvents
5986
- */
5987
- watchEvents: {
5988
- methodKind: "server_streaming";
5989
- input: typeof WatchEventsRequestSchema;
5990
- output: typeof WatchEventsResponseSchema;
5991
- };
5992
- /**
5993
- * CreatePreviewShareLink mints a share link for one of a running
5994
- * sandbox's previews: the channel `preview`, served at the sandbox's own
5995
- * hostname, unless the request names another of its http channels. The
5996
- * link is a signed link that admits one device, the first to open it,
5997
- * until it expires, carries its byte cap or is revoked, and only at that
5998
- * channel's hostname. The link is in this answer only. The sandbox must
5999
- * be running with that preview open, or the call fails with
6000
- * FAILED_PRECONDITION, as it does when the workspace's plan turns share
6001
- * links off. A channel or port the sandbox has no http channel for fails
6002
- * with NOT_FOUND; a channel that is not http, a port outside 1 to 65535,
6003
- * or an expiry or a byte cap above the plan's, with INVALID_ARGUMENT.
6004
- *
6005
- * @generated from rpc toshi.workspace.v1.WorkspaceService.CreatePreviewShareLink
6006
- */
6007
- createPreviewShareLink: {
6008
- methodKind: "unary";
6009
- input: typeof CreatePreviewShareLinkRequestSchema;
6010
- output: typeof CreatePreviewShareLinkResponseSchema;
6011
- };
6012
- /**
6013
- * ListPreviewShareLinks returns a sandbox's share links, for all of its
6014
- * previews, the oldest first, never with the link itself.
6015
- *
6016
- * @generated from rpc toshi.workspace.v1.WorkspaceService.ListPreviewShareLinks
6017
- */
6018
- listPreviewShareLinks: {
6019
- methodKind: "unary";
6020
- input: typeof ListPreviewShareLinksRequestSchema;
6021
- output: typeof ListPreviewShareLinksResponseSchema;
6022
- };
6023
- /**
6024
- * RevokePreviewShareLink revokes a share link: it admits no device
6025
- * again, and its open connections end within seconds. Revoking a link
6026
- * that was revoked or has ended returns it as it is.
6027
- *
6028
- * @generated from rpc toshi.workspace.v1.WorkspaceService.RevokePreviewShareLink
6029
- */
6030
- revokePreviewShareLink: {
6031
- methodKind: "unary";
6032
- input: typeof RevokePreviewShareLinkRequestSchema;
6033
- output: typeof RevokePreviewShareLinkResponseSchema;
6034
- };
6035
- /**
6036
- * StartService starts a service. An always-on service's workload
6037
- * moves from CREATED to QUEUED and its first run is queued as a job on
6038
- * a host, placed by the service's size; the run's start moves the
6039
- * workload to RUNNING. While the service is started, a run that ends is
6040
- * followed by another. An on-demand service is started asleep: it runs
6041
- * only once WakeService, a hold or a connect on one of its channels
6042
- * wakes it, and sleeps again when it has been idle for its recipe's
6043
- * idle period. Starting a started service returns it as it is. A size
6044
- * that is not a Linux one and a start past the plan's shared services
6045
- * fail with FAILED_PRECONDITION.
6046
- *
6047
- * @generated from rpc toshi.workspace.v1.WorkspaceService.StartService
6048
- */
6049
- startService: {
6050
- methodKind: "unary";
6051
- input: typeof StartServiceRequestSchema;
6052
- output: typeof StartServiceResponseSchema;
6053
- };
6054
- /**
6055
- * StopService stops a service: its workload moves back to CREATED and
6056
- * its live run is stopped. Stopping a service that is not started
6057
- * returns it as it is.
6058
- *
6059
- * @generated from rpc toshi.workspace.v1.WorkspaceService.StopService
6060
- */
6061
- stopService: {
6062
- methodKind: "unary";
6063
- input: typeof StopServiceRequestSchema;
6064
- output: typeof StopServiceResponseSchema;
6065
- };
6066
- /**
6067
- * SetServiceMode sets a service's mode. A started service stays
6068
- * started: set to ON_DEMAND, it sleeps once it is idle; set to
6069
- * ALWAYS_ON while asleep, its next run is queued.
6070
- *
6071
- * @generated from rpc toshi.workspace.v1.WorkspaceService.SetServiceMode
6072
- */
6073
- setServiceMode: {
6074
- methodKind: "unary";
6075
- input: typeof SetServiceModeRequestSchema;
6076
- output: typeof SetServiceModeResponseSchema;
6077
- };
6078
- /**
6079
- * WakeService wakes a started on-demand service that is asleep: its
6080
- * workload moves from CREATED to QUEUED and a run is queued, placed as a
6081
- * start is. A wake keeps the service awake for its recipe's idle period;
6082
- * waking an awake one extends that. The answer does not wait for the run
6083
- * to be ready: its ServiceRun's ready_at says when it is. Waking a
6084
- * started always-on service returns it as it is; a service that is not
6085
- * started fails with FAILED_PRECONDITION.
6086
- *
6087
- * @generated from rpc toshi.workspace.v1.WorkspaceService.WakeService
6088
- */
6089
- wakeService: {
6090
- methodKind: "unary";
6091
- input: typeof WakeServiceRequestSchema;
6092
- output: typeof WakeServiceResponseSchema;
6093
- };
6094
- /**
6095
- * HoldService takes or renews the caller's hold on a started service:
6096
- * while any hold is live, an on-demand service does not sleep, and a
6097
- * hold on one that is asleep wakes it. Each caller has one hold per
6098
- * service, live until its time to live runs out or ReleaseService drops
6099
- * it. A hold gives no access to the service. A service that is not
6100
- * started fails with FAILED_PRECONDITION, and a time to live above an
6101
- * hour with INVALID_ARGUMENT.
6102
- *
6103
- * @generated from rpc toshi.workspace.v1.WorkspaceService.HoldService
6104
- */
6105
- holdService: {
6106
- methodKind: "unary";
6107
- input: typeof HoldServiceRequestSchema;
6108
- output: typeof HoldServiceResponseSchema;
6109
- };
6110
- /**
6111
- * ReleaseService drops the caller's hold on a service. Releasing a hold
6112
- * the caller does not have returns the service as it is.
6113
- *
6114
- * @generated from rpc toshi.workspace.v1.WorkspaceService.ReleaseService
6115
- */
6116
- releaseService: {
6117
- methodKind: "unary";
6118
- input: typeof ReleaseServiceRequestSchema;
6119
- output: typeof ReleaseServiceResponseSchema;
6120
- };
6121
- /**
6122
- * ListServiceRuns returns a service's runs, the newest first: each run
6123
- * is a job on a host, of the revision that was current when it was
6124
- * queued.
6125
- *
6126
- * @generated from rpc toshi.workspace.v1.WorkspaceService.ListServiceRuns
6127
- */
6128
- listServiceRuns: {
6129
- methodKind: "unary";
6130
- input: typeof ListServiceRunsRequestSchema;
6131
- output: typeof ListServiceRunsResponseSchema;
6132
- };
6133
- }>;