@sylphx/sdk 0.31.0 → 0.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/README.md +111 -4
  2. package/dist/access.d.ts +112 -17
  3. package/dist/access.js +101 -7
  4. package/dist/access.js.map +1 -1
  5. package/dist/ai.d.ts +1 -2
  6. package/dist/ai.js +2 -3
  7. package/dist/ai.js.map +1 -1
  8. package/dist/artifacts.d.ts +1 -1
  9. package/dist/artifacts.js +2 -2
  10. package/dist/assets.d.ts +447 -0
  11. package/dist/assets.js +266 -0
  12. package/dist/assets.js.map +1 -0
  13. package/dist/auth/client.d.ts +239 -0
  14. package/dist/auth/client.js +337 -0
  15. package/dist/auth/client.js.map +1 -0
  16. package/dist/auth/verify.d.ts +38 -3
  17. package/dist/auth/verify.js +58 -8
  18. package/dist/auth/verify.js.map +1 -1
  19. package/dist/auth.d.ts +455 -7
  20. package/dist/auth.js +416 -5
  21. package/dist/auth.js.map +1 -1
  22. package/dist/billing.d.ts +13 -13
  23. package/dist/billing.js +5 -5
  24. package/dist/broker.d.ts +5 -4
  25. package/dist/broker.js +3 -3
  26. package/dist/broker.js.map +1 -1
  27. package/dist/build.d.ts +4 -4
  28. package/dist/build.js +3 -3
  29. package/dist/common.d.ts +1 -1
  30. package/dist/common.js +1 -1
  31. package/dist/config/flags.d.ts +140 -0
  32. package/dist/config/flags.js +462 -0
  33. package/dist/config/flags.js.map +1 -0
  34. package/dist/config.d.ts +380 -15
  35. package/dist/config.js +283 -5
  36. package/dist/config.js.map +1 -1
  37. package/dist/connections.d.ts +6 -6
  38. package/dist/connections.js +3 -3
  39. package/dist/data.d.ts +560 -7
  40. package/dist/data.js +510 -4
  41. package/dist/data.js.map +1 -1
  42. package/dist/entitlement.d.ts +10 -8
  43. package/dist/entitlement.js +3 -4
  44. package/dist/entitlement.js.map +1 -1
  45. package/dist/events/realtime.d.ts +69 -0
  46. package/dist/events/realtime.js +107 -0
  47. package/dist/events/realtime.js.map +1 -0
  48. package/dist/events/webhooks.d.ts +40 -0
  49. package/dist/events/webhooks.js +110 -0
  50. package/dist/events/webhooks.js.map +1 -0
  51. package/dist/events.d.ts +369 -22
  52. package/dist/events.js +311 -8
  53. package/dist/events.js.map +1 -1
  54. package/dist/hosting.d.ts +13 -14
  55. package/dist/hosting.js +3 -4
  56. package/dist/hosting.js.map +1 -1
  57. package/dist/ids.d.ts +837 -0
  58. package/dist/ids.js +287 -0
  59. package/dist/ids.js.map +1 -0
  60. package/dist/index.d.ts +12 -1
  61. package/dist/index.js +16 -2
  62. package/dist/index.js.map +1 -1
  63. package/dist/keys.d.ts +2 -2
  64. package/dist/keys.js +3 -3
  65. package/dist/localization.d.ts +663 -0
  66. package/dist/localization.js +491 -0
  67. package/dist/localization.js.map +1 -0
  68. package/dist/methods.js +1719 -124
  69. package/dist/methods.js.map +1 -1
  70. package/dist/money.d.ts +1406 -0
  71. package/dist/money.js +1090 -0
  72. package/dist/money.js.map +1 -0
  73. package/dist/network.d.ts +4 -5
  74. package/dist/network.js +3 -4
  75. package/dist/network.js.map +1 -1
  76. package/dist/notify.d.ts +321 -124
  77. package/dist/notify.js +223 -73
  78. package/dist/notify.js.map +1 -1
  79. package/dist/observability.d.ts +184 -7
  80. package/dist/observability.js +156 -8
  81. package/dist/observability.js.map +1 -1
  82. package/dist/release.d.ts +14 -15
  83. package/dist/release.js +3 -4
  84. package/dist/release.js.map +1 -1
  85. package/dist/runners.d.ts +2 -3
  86. package/dist/runners.js +3 -4
  87. package/dist/runners.js.map +1 -1
  88. package/dist/runtime.d.ts +5 -1
  89. package/dist/runtime.js +7 -3
  90. package/dist/runtime.js.map +1 -1
  91. package/dist/sandboxes.d.ts +64 -20
  92. package/dist/sandboxes.js +9 -4
  93. package/dist/sandboxes.js.map +1 -1
  94. package/dist/secrets.d.ts +6 -6
  95. package/dist/secrets.js +4 -4
  96. package/dist/workflows.d.ts +850 -12
  97. package/dist/workflows.js +672 -3
  98. package/dist/workflows.js.map +1 -1
  99. package/package.json +1 -1
@@ -1,6 +1,15 @@
1
1
  import * as runtime from './runtime.js';
2
2
  import './common.js';
3
3
  import type * as common from './common.js';
4
+ /** The request of AddDistributedRunShards. */
5
+ export interface AddDistributedRunShardsRequest {
6
+ /** The name of the distributed run; its manifest must be open. */
7
+ name: string;
8
+ /** The shards to append. */
9
+ shards?: ShardInput[];
10
+ /** Close the manifest: the run ends once its shards are done. */
11
+ close?: boolean;
12
+ }
4
13
  /** A child Run's place in its batch. */
5
14
  export interface BatchPosition {
6
15
  /** The parent batch Run. */
@@ -17,6 +26,20 @@ export interface CalendarSpec {
17
26
  /** IANA time zone; default `UTC`. */
18
27
  timeZone?: string;
19
28
  }
29
+ /** The request of CancelDistributedRun. */
30
+ export interface CancelDistributedRunRequest {
31
+ /** The name of the distributed run. */
32
+ name: string;
33
+ /** Why the run is cancelled. */
34
+ reason?: string;
35
+ }
36
+ /** The request of CancelJobRun. */
37
+ export interface CancelJobRunRequest {
38
+ /** The name of the job run. */
39
+ name: string;
40
+ /** Why the run is cancelled. */
41
+ reason?: string;
42
+ }
20
43
  /** The request of CancelRun. */
21
44
  export interface CancelRunRequest {
22
45
  /** The name of the run. */
@@ -24,6 +47,50 @@ export interface CancelRunRequest {
24
47
  /** Why the Run is cancelled. */
25
48
  reason?: string;
26
49
  }
50
+ /** The request of CreateDistributedJob. */
51
+ export interface CreateDistributedJobRequest {
52
+ /** The parent to create in. */
53
+ parent: string;
54
+ /** The distributed job id, the final name segment: `[a-z][a-z0-9-]{0,62}`. */
55
+ distributedJobId?: string;
56
+ /** The distributed job to create; only caller-writable fields are read. */
57
+ distributedJob: DistributedJob;
58
+ /** Validate and return the result without writing anything. */
59
+ validateOnly?: boolean;
60
+ }
61
+ /** The request of CreateDistributedRun. */
62
+ export interface CreateDistributedRunRequest {
63
+ /** The distributed job to run. */
64
+ parent: string;
65
+ /** The run id, the final name segment; the server assigns one when empty. */
66
+ distributedRunId?: string;
67
+ /** The run to start: `args`, `env`, `shards` and `open_manifest`. */
68
+ distributedRun: DistributedRun;
69
+ /** Validate and return the result without starting anything. */
70
+ validateOnly?: boolean;
71
+ }
72
+ /** The request of CreateJob. */
73
+ export interface CreateJobRequest {
74
+ /** The parent to create in. */
75
+ parent: string;
76
+ /** The job id, the final name segment: `[a-z0-9-]{1,63}`. */
77
+ jobId?: string;
78
+ /** The job to create; only caller-writable fields are read. */
79
+ job: Job;
80
+ /** Validate and return the result without writing anything. */
81
+ validateOnly?: boolean;
82
+ }
83
+ /** The request of CreateJobRun. */
84
+ export interface CreateJobRunRequest {
85
+ /** The job to run. */
86
+ parent: string;
87
+ /** The run id, the final name segment; the server assigns one when empty. */
88
+ jobRunId?: string;
89
+ /** The run to start: `args` and `env` override the Job's for this run. */
90
+ jobRun: JobRun;
91
+ /** Validate and return the result without starting anything. */
92
+ validateOnly?: boolean;
93
+ }
27
94
  /** The request of CreateRun. */
28
95
  export interface CreateRunRequest {
29
96
  /** The parent to create in. */
@@ -63,6 +130,38 @@ export interface CreateWorkflowRequest {
63
130
  /** Validate and return the result without writing anything. */
64
131
  validateOnly?: boolean;
65
132
  }
133
+ /** The request of DeleteDistributedJob. */
134
+ export interface DeleteDistributedJobRequest {
135
+ /** The name of the distributed job to delete. */
136
+ name: string;
137
+ /** Delete only if the current etag matches. */
138
+ etag?: string;
139
+ /** Succeed when the distributed job does not exist. */
140
+ allowMissing?: boolean;
141
+ /** Validate without deleting anything. */
142
+ validateOnly?: boolean;
143
+ /**
144
+ * Also cancel active runs; without it a job with an active run fails with
145
+ * INVALID_STATE.
146
+ */
147
+ force?: boolean;
148
+ }
149
+ /** The request of DeleteJob. */
150
+ export interface DeleteJobRequest {
151
+ /** The name of the job to delete. */
152
+ name: string;
153
+ /** Delete only if the current etag matches. */
154
+ etag?: string;
155
+ /** Succeed when the job does not exist. */
156
+ allowMissing?: boolean;
157
+ /** Validate without deleting anything. */
158
+ validateOnly?: boolean;
159
+ /**
160
+ * Also cancel active runs and delete Schedules targeting the job; without
161
+ * it a job with an active run or a Schedule fails with INVALID_STATE.
162
+ */
163
+ force?: boolean;
164
+ }
66
165
  /** The request of DeleteSchedule. */
67
166
  export interface DeleteScheduleRequest {
68
167
  /** The name of the schedule to delete. */
@@ -90,6 +189,132 @@ export interface DeleteWorkflowRequest {
90
189
  */
91
190
  force?: boolean;
92
191
  }
192
+ /**
193
+ * A DistributedJob runs one container image on many workers at once
194
+ * (run-distributed-jobs.md §4). A run splits its work into shards that
195
+ * workers lease from a queue; the worker pool grows and shrinks with the
196
+ * capacity Kueue admits, and a preempted shard goes back to the queue.
197
+ */
198
+ export interface DistributedJob {
199
+ /** `orgs/{org}/projects/{project}/envs/{env}/distributed_jobs/{distributed_job}`. */
200
+ name?: string;
201
+ /** `djob_<cell><ulid>`; never reused. */
202
+ readonly uid?: string;
203
+ /** Resource metadata. */
204
+ meta?: common.ResourceMeta;
205
+ /** Desired state. */
206
+ spec?: DistributedJobSpec;
207
+ /** Observed state. */
208
+ readonly status?: DistributedJobStatus;
209
+ }
210
+ /** DistributedJobSpec is the caller-writable state of a DistributedJob. */
211
+ export interface DistributedJobSpec {
212
+ /**
213
+ * The worker container: its image, command, env and instance type.
214
+ * `timeout` is the longest one worker lives, so the pool turns over;
215
+ * `max_retries` and `concurrency` do not apply.
216
+ */
217
+ worker?: JobSpec;
218
+ /** Price and preemption class; default scavenger. */
219
+ workerClass?: WorkerClass;
220
+ /** Elastic bounds of the worker pool. */
221
+ scale?: WorkerScale;
222
+ /** Local scratch disk at `/scratch` per worker, GiB; 0 is none. */
223
+ scratchGib?: number;
224
+ /** A run that brings no shards of its own gets this many index-only shards. */
225
+ shardCount?: string;
226
+ /** The longest one lease may live without the shard ending; default 30m. */
227
+ shardTimeout?: string;
228
+ /** Attempts a shard gets after a failure; a preemption is not one. Default 3. */
229
+ shardRetries?: number;
230
+ /** Failed shards the run tolerates before it fails; default 0. */
231
+ maxFailedShards?: string;
232
+ /** The whole run's deadline; default 48h. */
233
+ runTimeout?: string;
234
+ /** `data://<bucket>/<prefix>/`: checkpoints go under `<run>/<shard>/`. */
235
+ checkpointUri?: string;
236
+ /** `data://<bucket>/<prefix>/`: outputs go under `<run>/<shard>/`. */
237
+ outputUri?: string;
238
+ }
239
+ /** DistributedJobStatus is the observed state of a DistributedJob. */
240
+ export interface DistributedJobStatus {
241
+ /** The generation this status was computed from. */
242
+ readonly observedGeneration?: string;
243
+ /** Ready, Reconciling, Stalled. */
244
+ readonly conditions?: common.Condition[];
245
+ }
246
+ /**
247
+ * A DistributedRun is one start of a DistributedJob: a queue of shards and
248
+ * the workers that drain it.
249
+ */
250
+ export interface DistributedRun {
251
+ /** `orgs/{org}/projects/{project}/envs/{env}/distributed_jobs/{distributed_job}/distributed_runs/{distributed_run}`. */
252
+ name?: string;
253
+ /** `drun_<cell><ulid>`; never reused. */
254
+ readonly uid?: string;
255
+ /** Resource metadata. */
256
+ meta?: common.ResourceMeta;
257
+ /** The DistributedJob generation the run pinned. */
258
+ readonly jobGeneration?: string;
259
+ /** The run's lifecycle state. */
260
+ readonly state?: DistributedRunState;
261
+ /** Whether more shards may still be added (`:addShards`). */
262
+ readonly manifestOpen?: boolean;
263
+ /** Why the run failed or was refused, when it did. */
264
+ readonly message?: string;
265
+ /** When the run was accepted. */
266
+ readonly createTime?: string;
267
+ /** When the first worker started. */
268
+ readonly startTime?: string;
269
+ /** When the run closed. */
270
+ readonly endTime?: string;
271
+ /** Shards by state. */
272
+ readonly shardCounts?: ShardCounts;
273
+ /** Workers by state. */
274
+ readonly workerCounts?: WorkerCounts;
275
+ /** Metered usage across workers. */
276
+ readonly usage?: DistributedRunUsage;
277
+ /** Arguments of every worker of this run (the job's when empty). */
278
+ args?: string[];
279
+ /** Environment overrides of this run. */
280
+ env?: Record<string, string>;
281
+ /**
282
+ * The run's own shards (the customer's planner output); without them the
283
+ * job's `shard_count` makes index-only shards.
284
+ */
285
+ shards?: ShardInput[];
286
+ /** Keep the manifest open: `:addShards` appends until it is closed. */
287
+ openManifest?: boolean;
288
+ }
289
+ /** Metered usage of a DistributedRun. */
290
+ export interface DistributedRunUsage {
291
+ /** Summed worker run time from container start to exit. */
292
+ readonly workerDuration?: string;
293
+ /** The price class the workers ran in. */
294
+ readonly workerClass?: WorkerClass;
295
+ /** The instance type the workers ran on. */
296
+ readonly instanceType?: string;
297
+ }
298
+ /** The request of GetDistributedJob. */
299
+ export interface GetDistributedJobRequest {
300
+ /** The name of the distributed job to get. */
301
+ name: string;
302
+ }
303
+ /** The request of GetDistributedRun. */
304
+ export interface GetDistributedRunRequest {
305
+ /** The name of the distributed run to get. */
306
+ name: string;
307
+ }
308
+ /** The request of GetJob. */
309
+ export interface GetJobRequest {
310
+ /** The name of the job to get. */
311
+ name: string;
312
+ }
313
+ /** The request of GetJobRun. */
314
+ export interface GetJobRunRequest {
315
+ /** The name of the job run to get. */
316
+ name: string;
317
+ }
93
318
  /** The request of GetRun. */
94
319
  export interface GetRunRequest {
95
320
  /** The name of the run to get. */
@@ -112,6 +337,221 @@ export interface IntervalSpec {
112
337
  /** Phase offset within each period. */
113
338
  offset?: string;
114
339
  }
340
+ /**
341
+ * A Job runs a container to completion: the project's image, a command, an
342
+ * exit status, logs, and metered usage (docs/services/workflows/jobs.md). It
343
+ * takes no HTTP handler and no worker. A Schedule may target it; every start
344
+ * is a JobRun.
345
+ */
346
+ export interface Job {
347
+ /** `orgs/{org}/projects/{project}/envs/{env}/jobs/{job}`. */
348
+ name?: string;
349
+ /** `job_<cell><ulid>`; never reused. */
350
+ readonly uid?: string;
351
+ /** Resource metadata. */
352
+ meta?: common.ResourceMeta;
353
+ /** Desired state. */
354
+ spec?: JobSpec;
355
+ /** Observed state. */
356
+ readonly status?: JobStatus;
357
+ }
358
+ /** One line a JobRun's container wrote. */
359
+ export interface JobLogLine {
360
+ /** When the line was written. */
361
+ readonly writeTime?: string;
362
+ /** The attempt that wrote it, from 1. */
363
+ readonly attempt?: number;
364
+ /** `stdout` or `stderr`. */
365
+ readonly stream?: string;
366
+ /** The line, without its trailing newline. */
367
+ readonly text?: string;
368
+ }
369
+ /**
370
+ * A JobRun is one start of a Job: queued until the environment's quota admits
371
+ * it, then one attempt per try until an exit of 0, the retries run out, the
372
+ * deadline passes, or it is cancelled.
373
+ */
374
+ export interface JobRun {
375
+ /** `orgs/{org}/projects/{project}/envs/{env}/jobs/{job}/job_runs/{job_run}`. */
376
+ name?: string;
377
+ /** `jrun_<cell><ulid>`; never reused. */
378
+ readonly uid?: string;
379
+ /** Resource metadata. */
380
+ meta?: common.ResourceMeta;
381
+ /** The Job generation the run pinned. */
382
+ readonly jobGeneration?: string;
383
+ /** The image digest the run executes. */
384
+ readonly resolvedImage?: string;
385
+ /** Arguments of this run (the Job's when empty). */
386
+ args?: string[];
387
+ /** Environment overrides of this run. */
388
+ env?: Record<string, string>;
389
+ /** The run's lifecycle state. */
390
+ readonly state?: JobRunState;
391
+ /** The last attempt's exit code, once it exited. */
392
+ readonly exitCode?: number;
393
+ /** Attempts made so far. */
394
+ readonly attemptCount?: number;
395
+ /**
396
+ * Why the last attempt ended other than by exiting, for example
397
+ * `OOMKilled` or `Evicted`.
398
+ */
399
+ readonly terminationReason?: string;
400
+ /** Set when a Schedule fire started the run. */
401
+ readonly scheduleFire?: ScheduleFireRef;
402
+ /** When the run was accepted. */
403
+ readonly createTime?: string;
404
+ /** When the first attempt started. */
405
+ readonly startTime?: string;
406
+ /** When the run closed. */
407
+ readonly endTime?: string;
408
+ /** Metered usage across attempts. */
409
+ readonly usage?: JobRunUsage;
410
+ /** Why the run failed or was refused, when it did. */
411
+ readonly message?: string;
412
+ /**
413
+ * Start no earlier than this: set it directly, or through `start_delay`;
414
+ * at most 365 days ahead. A run cancelled before then makes no attempt.
415
+ */
416
+ scheduleTime?: string;
417
+ /** Start no earlier than this long after the request. */
418
+ startDelay?: string;
419
+ }
420
+ /** Metered usage of a JobRun. */
421
+ export interface JobRunUsage {
422
+ /**
423
+ * Summed wall time of every attempt from start to exit; billed as this
424
+ * duration on `instance_type` (`workflows.job.seconds`).
425
+ */
426
+ readonly billedDuration?: string;
427
+ /** The instance type the attempts ran on. */
428
+ readonly instanceType?: string;
429
+ }
430
+ /** JobSpec is the caller-writable state of a Job. */
431
+ export interface JobSpec {
432
+ /**
433
+ * The Hosting Service whose env and Secret bindings every run takes, and
434
+ * whose live Release image it runs unless `image` or `build` names another,
435
+ * so a Job never runs code the environment does not serve.
436
+ */
437
+ service?: string;
438
+ /**
439
+ * A digest-pinned image from this org's Artifacts, in place of the
440
+ * service's image. Exclusive with `build`.
441
+ */
442
+ image?: string;
443
+ /** The entrypoint; empty keeps the image's. */
444
+ command?: string[];
445
+ /** Arguments; a run may replace them. */
446
+ args?: string[];
447
+ /** Environment overrides on top of the service's env and Secret bindings. */
448
+ env?: Record<string, string>;
449
+ /** A Hosting instance type; default `standard`. */
450
+ instanceType?: string;
451
+ /** One attempt's deadline, 10s to 24h; default 1h. */
452
+ timeout?: string;
453
+ /** Re-runs after a non-zero exit, 0 to 10; backoff 30s doubling. */
454
+ maxRetries?: number;
455
+ /** What a start does while a run is active; default forbid. */
456
+ concurrency?: JobConcurrency;
457
+ /**
458
+ * A build the project declares: its latest built image, in place of the
459
+ * service's; the image needs no running service of its own. Exclusive with
460
+ * `image`.
461
+ */
462
+ build?: string;
463
+ }
464
+ /** JobStatus is the observed state of a Job. */
465
+ export interface JobStatus {
466
+ /** The generation this status was computed from. */
467
+ readonly observedGeneration?: string;
468
+ /** Ready, Reconciling, Stalled. */
469
+ readonly conditions?: common.Condition[];
470
+ /** The image digest the next run uses. */
471
+ readonly resolvedImage?: string;
472
+ /** The most recent run. */
473
+ readonly lastRun?: string;
474
+ }
475
+ /** The request of ListDistributedJobs. */
476
+ export interface ListDistributedJobsRequest {
477
+ /** The parent to list in. */
478
+ parent: string;
479
+ /** At most this many; default 50, clamped to 1000. */
480
+ pageSize?: number;
481
+ /** `next_page_token` of the previous page. */
482
+ pageToken?: string;
483
+ /** AIP-160 filter over labels and filterable fields. */
484
+ filter?: string;
485
+ /** AIP-132 ordering over filterable fields. */
486
+ orderBy?: string;
487
+ }
488
+ /** The response of ListDistributedJobs. */
489
+ export interface ListDistributedJobsResponse {
490
+ /** The page. */
491
+ distributedJobs?: DistributedJob[];
492
+ /** The token of the next page; empty on the last page. */
493
+ nextPageToken?: string;
494
+ }
495
+ /** The request of ListDistributedRuns. */
496
+ export interface ListDistributedRunsRequest {
497
+ /** The parent to list in. */
498
+ parent: string;
499
+ /** At most this many; default 50, clamped to 1000. */
500
+ pageSize?: number;
501
+ /** `next_page_token` of the previous page. */
502
+ pageToken?: string;
503
+ /** AIP-160 filter over labels and filterable fields. */
504
+ filter?: string;
505
+ /** AIP-132 ordering over filterable fields. */
506
+ orderBy?: string;
507
+ }
508
+ /** The response of ListDistributedRuns. */
509
+ export interface ListDistributedRunsResponse {
510
+ /** The page. */
511
+ distributedRuns?: DistributedRun[];
512
+ /** The token of the next page; empty on the last page. */
513
+ nextPageToken?: string;
514
+ }
515
+ /** The request of ListJobRuns. */
516
+ export interface ListJobRunsRequest {
517
+ /** The parent to list in. */
518
+ parent: string;
519
+ /** At most this many; default 50, clamped to 1000. */
520
+ pageSize?: number;
521
+ /** `next_page_token` of the previous page. */
522
+ pageToken?: string;
523
+ /** AIP-160 filter over labels and filterable fields. */
524
+ filter?: string;
525
+ /** AIP-132 ordering over filterable fields. */
526
+ orderBy?: string;
527
+ }
528
+ /** The response of ListJobRuns. */
529
+ export interface ListJobRunsResponse {
530
+ /** The page. */
531
+ jobRuns?: JobRun[];
532
+ /** The token of the next page; empty on the last page. */
533
+ nextPageToken?: string;
534
+ }
535
+ /** The request of ListJobs. */
536
+ export interface ListJobsRequest {
537
+ /** The parent to list in. */
538
+ parent: string;
539
+ /** At most this many; default 50, clamped to 1000. */
540
+ pageSize?: number;
541
+ /** `next_page_token` of the previous page. */
542
+ pageToken?: string;
543
+ /** AIP-160 filter over labels and filterable fields. */
544
+ filter?: string;
545
+ /** AIP-132 ordering over filterable fields. */
546
+ orderBy?: string;
547
+ }
548
+ /** The response of ListJobs. */
549
+ export interface ListJobsResponse {
550
+ /** The page. */
551
+ jobs?: Job[];
552
+ /** The token of the next page; empty on the last page. */
553
+ nextPageToken?: string;
554
+ }
115
555
  /** The request of ListRuns. */
116
556
  export interface ListRunsRequest {
117
557
  /** The parent to list in. */
@@ -183,6 +623,65 @@ export interface PauseScheduleRequest {
183
623
  /** Validate without writing anything. */
184
624
  validateOnly?: boolean;
185
625
  }
626
+ /** The request of ReadDistributedRunShards. */
627
+ export interface ReadDistributedRunShardsRequest {
628
+ /** The name of the distributed run. */
629
+ name: string;
630
+ /** At most this many; default 100, clamped to 1000. */
631
+ pageSize?: number;
632
+ /** `next_page_token` of the previous page. */
633
+ pageToken?: string;
634
+ /** Only shards in this state; unset reads every shard. */
635
+ stateFilter?: ShardState;
636
+ }
637
+ /** The response of ReadDistributedRunShards. */
638
+ export interface ReadDistributedRunShardsResponse {
639
+ /** The page, in queue order. */
640
+ shards?: Shard[];
641
+ /** The token of the next page; empty on the last page. */
642
+ nextPageToken?: string;
643
+ }
644
+ /** The request of ReadDistributedRunWorkers. */
645
+ export interface ReadDistributedRunWorkersRequest {
646
+ /** The name of the distributed run. */
647
+ name: string;
648
+ /** At most this many; default 100, clamped to 1000. */
649
+ pageSize?: number;
650
+ /** `next_page_token` of the previous page. */
651
+ pageToken?: string;
652
+ }
653
+ /** The response of ReadDistributedRunWorkers. */
654
+ export interface ReadDistributedRunWorkersResponse {
655
+ /** The page, oldest first. */
656
+ workers?: Worker[];
657
+ /** The token of the next page; empty on the last page. */
658
+ nextPageToken?: string;
659
+ }
660
+ /** The request of ReadJobRunLogs. */
661
+ export interface ReadJobRunLogsRequest {
662
+ /** The name of the job run. */
663
+ name: string;
664
+ /** At most this many lines; default 500, clamped to 5000. */
665
+ pageSize?: number;
666
+ /** `next_page_token` of the previous page. */
667
+ pageToken?: string;
668
+ /**
669
+ * On a running run, wait up to this long (at most 30s) for new lines
670
+ * before returning an empty page.
671
+ */
672
+ wait?: string;
673
+ }
674
+ /** The response of ReadJobRunLogs. */
675
+ export interface ReadJobRunLogsResponse {
676
+ /** The page, oldest first. */
677
+ lines?: JobLogLine[];
678
+ /**
679
+ * The token of the next page. It is set while the run can still write, so
680
+ * a follower keeps polling; empty once the run closed and every line was
681
+ * read.
682
+ */
683
+ nextPageToken?: string;
684
+ }
186
685
  /** The request of ReadRunHistory. */
187
686
  export interface ReadRunHistoryRequest {
188
687
  /** The name of the run. */
@@ -220,10 +719,9 @@ export interface RetryPolicy {
220
719
  maxInterval?: string;
221
720
  }
222
721
  /**
223
- * A Run is one execution of a Workflow, read from the engine
224
- * (workflows-on-temporal.md §6.3). Create starts it: the same
225
- * `Idempotency-Key` and input return the same Run, a changed input under the
226
- * same key is refused. A Run ends `succeeded` only from its handler's recorded
722
+ * A Run is one execution of a Workflow, read from the engine. Create starts
723
+ * it: the same `Idempotency-Key` and input return the same Run, a changed
724
+ * input under the same key is refused. A Run ends `succeeded` only from its handler's recorded
227
725
  * result, and `cancelled` only from an authenticated cancel the handler
228
726
  * acknowledged or a Run that never started.
229
727
  */
@@ -256,6 +754,12 @@ export interface Run {
256
754
  readonly output?: Record<string, unknown>;
257
755
  /** The failure, once `failed` or `timed_out`. */
258
756
  readonly error?: RunError;
757
+ /**
758
+ * When the first invocation is due: set it directly, or through
759
+ * `start_delay`; at most 365 days ahead. A Run cancelled before then closes
760
+ * `cancelled` with no invocation.
761
+ */
762
+ scheduleTime?: string;
259
763
  }
260
764
  /** Why a Run failed. */
261
765
  export interface RunError {
@@ -287,9 +791,9 @@ export interface RunHistoryEvent {
287
791
  readonly details?: Record<string, unknown>;
288
792
  }
289
793
  /**
290
- * A Schedule starts Runs of a Workflow on a calendar or an interval
291
- * (workflows-on-temporal.md §6.2). Every fire is an engine timer; `(schedule,
292
- * intended time)` is the Run identity, so one instant starts at most one Run.
794
+ * A Schedule starts Runs of a Workflow on a calendar or an interval. Every
795
+ * fire is an engine timer; `(schedule, intended time)` is the Run identity, so
796
+ * one instant starts at most one Run.
293
797
  * A fire is not a Run result.
294
798
  */
295
799
  export interface Schedule {
@@ -359,6 +863,47 @@ export interface ServiceHandler {
359
863
  /** The request path, for example `/api/sylphx/workflows`. */
360
864
  path?: string;
361
865
  }
866
+ /**
867
+ * One unit of a DistributedRun's work, leased by one worker at a time. A
868
+ * lease that stops heartbeating returns the shard without counting an
869
+ * attempt. Shards are read as a paged view of their run (`:readShards`).
870
+ */
871
+ export interface Shard {
872
+ /** The shard id, unique in its run. */
873
+ readonly id?: string;
874
+ /** Order in the run's queue, from 0. */
875
+ readonly seq?: string;
876
+ /** The shard's state. */
877
+ readonly state?: ShardState;
878
+ /** Attempts counted so far (failures and timeouts, not preemptions). */
879
+ readonly attempts?: number;
880
+ /** The worker holding or last holding the lease. */
881
+ readonly worker?: string;
882
+ /** What the worker reported at `complete`, any JSON. */
883
+ readonly outputs?: unknown;
884
+ /** The last failure's message. */
885
+ readonly error?: string;
886
+ }
887
+ /** Shards of a DistributedRun by state. */
888
+ export interface ShardCounts {
889
+ /** Waiting to be leased. */
890
+ readonly pending?: string;
891
+ /** Held by a worker. */
892
+ readonly leased?: string;
893
+ /** Completed. */
894
+ readonly succeeded?: string;
895
+ /** Out of attempts. */
896
+ readonly failed?: string;
897
+ /** Every shard of the run. */
898
+ readonly total?: string;
899
+ }
900
+ /** One shard as a run is started with it or appended to. */
901
+ export interface ShardInput {
902
+ /** The shard id, unique in the run; the server assigns one when empty. */
903
+ id?: string;
904
+ /** What the worker gets as its input, any JSON. */
905
+ input?: unknown;
906
+ }
362
907
  /** The request of SignalRun. */
363
908
  export interface SignalRunRequest {
364
909
  /** The name of the run. */
@@ -382,6 +927,28 @@ export interface StartRunBatchResponse {
382
927
  /** The parent batch Run. */
383
928
  run?: Run;
384
929
  }
930
+ /** The request of UpdateDistributedJob. */
931
+ export interface UpdateDistributedJobRequest {
932
+ /** The distributed job to update; `name` identifies it. */
933
+ distributedJob: DistributedJob;
934
+ /** The fields to write; unset writes every populated field. */
935
+ updateMask?: string;
936
+ /** Create the distributed job when it does not exist (declarative upsert). */
937
+ allowMissing?: boolean;
938
+ /** Validate and return the result without writing anything. */
939
+ validateOnly?: boolean;
940
+ }
941
+ /** The request of UpdateJob. */
942
+ export interface UpdateJobRequest {
943
+ /** The job to update; `name` identifies it. */
944
+ job: Job;
945
+ /** The fields to write; unset writes every populated field. */
946
+ updateMask?: string;
947
+ /** Create the job when it does not exist (declarative upsert). */
948
+ allowMissing?: boolean;
949
+ /** Validate and return the result without writing anything. */
950
+ validateOnly?: boolean;
951
+ }
385
952
  /** The request of UpdateSchedule. */
386
953
  export interface UpdateScheduleRequest {
387
954
  /** The schedule to update; `name` identifies it. */
@@ -411,11 +978,49 @@ export interface WaitRunRequest {
411
978
  /** How long to wait; default 30s, at most 60s. */
412
979
  timeout?: string;
413
980
  }
981
+ /**
982
+ * One container of a DistributedRun's worker pool, read as a paged view of
983
+ * its run (`:readWorkers`).
984
+ */
985
+ export interface Worker {
986
+ /** The worker id in its run, `w<n>`. */
987
+ readonly id?: string;
988
+ /** The worker's state. */
989
+ readonly state?: WorkerState;
990
+ /** The job that runs it. */
991
+ readonly job?: string;
992
+ /** Why it ended, for example `Completed`, `Preempted` or `OOMKilled`. */
993
+ readonly reason?: string;
994
+ /** When its container started. */
995
+ readonly startTime?: string;
996
+ /** When its container ended. */
997
+ readonly endTime?: string;
998
+ /** Billed run time. */
999
+ readonly duration?: string;
1000
+ }
1001
+ /** Workers of a DistributedRun by state. */
1002
+ export interface WorkerCounts {
1003
+ /** Every worker the run created. */
1004
+ readonly created?: string;
1005
+ /** Waiting for Kueue to admit them. */
1006
+ readonly waiting?: string;
1007
+ /** Running. */
1008
+ readonly running?: string;
1009
+ /** Ended. */
1010
+ readonly ended?: string;
1011
+ }
1012
+ /** Elastic bounds of a DistributedJob's worker pool. */
1013
+ export interface WorkerScale {
1014
+ /** Workers kept while shards remain; default 1. */
1015
+ minWorkers?: number;
1016
+ /** The most workers at once; the Cell and the org quota cap it too. Default 1. */
1017
+ maxWorkers?: number;
1018
+ }
414
1019
  /**
415
1020
  * A Workflow is durable work a customer declares: the handler each step of a
416
- * Run invokes, and its retry and timeout policy (workflows-on-temporal.md
417
- * §6.1). A Workflow write never starts, completes, or cancels a Run; a Run
418
- * pins the Workflow generation it started from.
1021
+ * Run invokes, and its retry and timeout policy. A Workflow write never
1022
+ * starts, completes, or cancels a Run; a Run pins the Workflow generation it
1023
+ * started from.
419
1024
  */
420
1025
  export interface Workflow {
421
1026
  /** `orgs/{org}/projects/{project}/envs/{env}/workflows/{workflow}`. */
@@ -466,18 +1071,29 @@ export interface WorkflowTimeouts {
466
1071
  }
467
1072
  /** How one invocation attempt ended (workflows-on-temporal.md §7.3). */
468
1073
  export type AttemptOutcome = 'invoked' | 'protocol_error' | 'rejected' | 'retryable' | 'unreached' | 'unknown' | 'unsigned' | (string & {});
1074
+ /** The lifecycle state of a DistributedRun. */
1075
+ export type DistributedRunState = 'queued' | 'running' | 'draining' | 'succeeded' | 'failed' | 'cancelled' | 'timed_out' | (string & {});
469
1076
  /** What one Schedule fire did. */
470
1077
  export type FireOutcome = 'started' | 'skipped' | 'buffered' | (string & {});
1078
+ /** What a Job start does while one of its runs is active. */
1079
+ export type JobConcurrency = 'forbid' | 'queue' | 'allow' | (string & {});
1080
+ /** The lifecycle state of a JobRun. */
1081
+ export type JobRunState = 'queued' | 'running' | 'succeeded' | 'failed' | 'cancelled' | 'timed_out' | (string & {});
471
1082
  /** What a Schedule fire does while a previous Run is still running. */
472
1083
  export type OverlapPolicy = 'skip' | 'buffer_one' | 'buffer_all' | 'cancel_other' | 'allow' | (string & {});
473
1084
  /** What a Run history event records. */
474
1085
  export type RunHistoryEventKind = 'run_started' | 'invocation' | 'step_completed' | 'sleep_started' | 'signal_received' | 'child_started' | 'cancel_requested' | 'run_closed' | (string & {});
475
1086
  /** The lifecycle state of a Run. */
476
1087
  export type RunState = 'running' | 'succeeded' | 'failed' | 'cancelled' | 'timed_out' | (string & {});
1088
+ /** The state of a Shard. */
1089
+ export type ShardState = 'pending' | 'leased' | 'succeeded' | 'failed' | (string & {});
1090
+ /** Price and preemption class of distributed job workers (run-distributed-jobs.md §6). */
1091
+ export type WorkerClass = 'scavenger' | 'standard' | (string & {});
1092
+ /** The state of a Worker. */
1093
+ export type WorkerState = 'pending' | 'queued' | 'running' | 'ended' | (string & {});
477
1094
  /**
478
1095
  * WorkflowsService is Sylphx Workflows: durable execution, schedules, timers,
479
- * and runs (docs/services/workflows/vision.md, workflows-on-temporal.md §6).
480
- * Workflows is the one writer of these types.
1096
+ * and runs. Workflows is the one writer of these types.
481
1097
  *
482
1098
  * Namespace of Sylphx Workflows on `Sylphx`.
483
1099
  */
@@ -488,6 +1104,14 @@ export declare class WorkflowsApi {
488
1104
  readonly schedules: SchedulesCollection;
489
1105
  /** The `runs` collection. */
490
1106
  readonly runs: RunsCollection;
1107
+ /** The `jobs` collection. */
1108
+ readonly jobs: JobsCollection;
1109
+ /** The `job_runs` collection. */
1110
+ readonly jobRuns: JobRunsCollection;
1111
+ /** The `distributed_jobs` collection. */
1112
+ readonly distributedJobs: DistributedJobsCollection;
1113
+ /** The `distributed_runs` collection. */
1114
+ readonly distributedRuns: DistributedRunsCollection;
491
1115
  constructor(client: runtime.Client);
492
1116
  }
493
1117
  /** `workflows` of Sylphx Workflows: Resource type `workflows.sylphx.com/Workflow`. */
@@ -676,3 +1300,217 @@ export declare class RunsCollection {
676
1300
  */
677
1301
  readHistory(request: ReadRunHistoryRequest): Promise<ReadRunHistoryResponse>;
678
1302
  }
1303
+ /** `jobs` of Sylphx Workflows: Resource type `workflows.sylphx.com/Job`. */
1304
+ export declare class JobsCollection {
1305
+ private readonly client;
1306
+ constructor(client: runtime.Client);
1307
+ /**
1308
+ * Gets a job.
1309
+ *
1310
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/jobs/*}` · permission `workflows:read` · effect `read`
1311
+ *
1312
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
1313
+ */
1314
+ get(request: GetJobRequest): Promise<Job>;
1315
+ /**
1316
+ * Lists jobs.
1317
+ *
1318
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/jobs` · permission `workflows:read` · effect `read`
1319
+ *
1320
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
1321
+ */
1322
+ list(request: ListJobsRequest): Promise<ListJobsResponse>;
1323
+ /** Every item of every page of `list`. */
1324
+ listAll(request: ListJobsRequest): AsyncGenerator<Job>;
1325
+ /**
1326
+ * Creates a job.
1327
+ *
1328
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/jobs` · permission `workflows:write` · effect `write`
1329
+ *
1330
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `PLAN_LIMIT_REACHED`.
1331
+ */
1332
+ create(request: CreateJobRequest): Promise<runtime.Operation<Job>>;
1333
+ /**
1334
+ * Updates a job. Runs already started keep the generation they pinned.
1335
+ *
1336
+ * `PATCH /v1/{job.name=orgs/*\/projects/*\/envs/*\/jobs/*}` · permission `workflows:write` · effect `write`
1337
+ *
1338
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
1339
+ */
1340
+ update(request: UpdateJobRequest): Promise<runtime.Operation<Job>>;
1341
+ /**
1342
+ * Deletes a job.
1343
+ *
1344
+ * `DELETE /v1/{name=orgs/*\/projects/*\/envs/*\/jobs/*}` · permission `workflows:write` · effect `destructive`
1345
+ *
1346
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
1347
+ */
1348
+ delete(request: DeleteJobRequest): Promise<runtime.Operation<Record<string, never>>>;
1349
+ }
1350
+ /** `job_runs` of Sylphx Workflows: Resource type `workflows.sylphx.com/JobRun`. */
1351
+ export declare class JobRunsCollection {
1352
+ private readonly client;
1353
+ constructor(client: runtime.Client);
1354
+ /**
1355
+ * Starts a run of a Job now. The same `Idempotency-Key` returns the same
1356
+ * run for 24h; a Schedule fire uses `{job}:{intended time}`. With
1357
+ * concurrency `forbid`, a start while a run is active fails with
1358
+ * INVALID_STATE.
1359
+ *
1360
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*\/jobs/*}/job_runs` · permission `workflows:run` · effect `write`
1361
+ *
1362
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `INVALID_STATE`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `PLAN_LIMIT_REACHED`.
1363
+ */
1364
+ create(request: CreateJobRunRequest): Promise<JobRun>;
1365
+ /**
1366
+ * Gets a job run.
1367
+ *
1368
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/jobs/*\/job_runs/*}` · permission `workflows:read` · effect `read`
1369
+ *
1370
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
1371
+ */
1372
+ get(request: GetJobRunRequest): Promise<JobRun>;
1373
+ /**
1374
+ * Lists a job's runs, newest first.
1375
+ *
1376
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*\/jobs/*}/job_runs` · permission `workflows:read` · effect `read`
1377
+ *
1378
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
1379
+ */
1380
+ list(request: ListJobRunsRequest): Promise<ListJobRunsResponse>;
1381
+ /** Every item of every page of `list`. */
1382
+ listAll(request: ListJobRunsRequest): AsyncGenerator<JobRun>;
1383
+ /**
1384
+ * Cancels a job run: SIGTERM, then SIGKILL after 30s. A closed run fails
1385
+ * with INVALID_STATE.
1386
+ *
1387
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/jobs/*\/job_runs/*}:cancel` · permission `workflows:run` · effect `destructive`
1388
+ *
1389
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
1390
+ */
1391
+ cancel(request: CancelJobRunRequest): Promise<JobRun>;
1392
+ /**
1393
+ * Reads a page of a job run's log lines, oldest first. With `wait`, an
1394
+ * empty page on a running run waits up to that long for new lines, so a
1395
+ * client follows the log by passing each `next_page_token` back.
1396
+ *
1397
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/jobs/*\/job_runs/*}:readLogs` · permission `workflows:read` · effect `read`
1398
+ *
1399
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `PAGE_TOKEN_MISMATCH`.
1400
+ */
1401
+ readLogs(request: ReadJobRunLogsRequest): Promise<ReadJobRunLogsResponse>;
1402
+ }
1403
+ /** `distributed_jobs` of Sylphx Workflows: Resource type `workflows.sylphx.com/DistributedJob`. */
1404
+ export declare class DistributedJobsCollection {
1405
+ private readonly client;
1406
+ constructor(client: runtime.Client);
1407
+ /**
1408
+ * Gets a distributed job.
1409
+ *
1410
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/distributed_jobs/*}` · permission `workflows:read` · effect `read`
1411
+ *
1412
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
1413
+ */
1414
+ get(request: GetDistributedJobRequest): Promise<DistributedJob>;
1415
+ /**
1416
+ * Lists distributed jobs.
1417
+ *
1418
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/distributed_jobs` · permission `workflows:read` · effect `read`
1419
+ *
1420
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
1421
+ */
1422
+ list(request: ListDistributedJobsRequest): Promise<ListDistributedJobsResponse>;
1423
+ /** Every item of every page of `list`. */
1424
+ listAll(request: ListDistributedJobsRequest): AsyncGenerator<DistributedJob>;
1425
+ /**
1426
+ * Creates a distributed job.
1427
+ *
1428
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/distributed_jobs` · permission `workflows:write` · effect `write`
1429
+ *
1430
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `PLAN_LIMIT_REACHED`.
1431
+ */
1432
+ create(request: CreateDistributedJobRequest): Promise<runtime.Operation<DistributedJob>>;
1433
+ /**
1434
+ * Updates a distributed job. Runs already started keep the generation they
1435
+ * pinned.
1436
+ *
1437
+ * `PATCH /v1/{distributed_job.name=orgs/*\/projects/*\/envs/*\/distributed_jobs/*}` · permission `workflows:write` · effect `write`
1438
+ *
1439
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
1440
+ */
1441
+ update(request: UpdateDistributedJobRequest): Promise<runtime.Operation<DistributedJob>>;
1442
+ /**
1443
+ * Deletes a distributed job.
1444
+ *
1445
+ * `DELETE /v1/{name=orgs/*\/projects/*\/envs/*\/distributed_jobs/*}` · permission `workflows:write` · effect `destructive`
1446
+ *
1447
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
1448
+ */
1449
+ delete(request: DeleteDistributedJobRequest): Promise<runtime.Operation<Record<string, never>>>;
1450
+ }
1451
+ /** `distributed_runs` of Sylphx Workflows: Resource type `workflows.sylphx.com/DistributedRun`. */
1452
+ export declare class DistributedRunsCollection {
1453
+ private readonly client;
1454
+ constructor(client: runtime.Client);
1455
+ /**
1456
+ * Starts a run of a distributed job. The same `Idempotency-Key` returns the
1457
+ * same run for 24h.
1458
+ *
1459
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*\/distributed_jobs/*}/distributed_runs` · permission `workflows:run` · effect `write`
1460
+ *
1461
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `INVALID_STATE`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `PLAN_LIMIT_REACHED`.
1462
+ */
1463
+ create(request: CreateDistributedRunRequest): Promise<DistributedRun>;
1464
+ /**
1465
+ * Gets a distributed run: its state, shard and worker counts, and usage.
1466
+ *
1467
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/distributed_jobs/*\/distributed_runs/*}` · permission `workflows:read` · effect `read`
1468
+ *
1469
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
1470
+ */
1471
+ get(request: GetDistributedRunRequest): Promise<DistributedRun>;
1472
+ /**
1473
+ * Lists a distributed job's runs, newest first.
1474
+ *
1475
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*\/distributed_jobs/*}/distributed_runs` · permission `workflows:read` · effect `read`
1476
+ *
1477
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
1478
+ */
1479
+ list(request: ListDistributedRunsRequest): Promise<ListDistributedRunsResponse>;
1480
+ /** Every item of every page of `list`. */
1481
+ listAll(request: ListDistributedRunsRequest): AsyncGenerator<DistributedRun>;
1482
+ /**
1483
+ * Cancels a distributed run: workers get SIGTERM and 30s, then leases are
1484
+ * released; finished shards are kept. A closed run fails with INVALID_STATE.
1485
+ *
1486
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/distributed_jobs/*\/distributed_runs/*}:cancel` · permission `workflows:run` · effect `destructive`
1487
+ *
1488
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
1489
+ */
1490
+ cancel(request: CancelDistributedRunRequest): Promise<DistributedRun>;
1491
+ /**
1492
+ * Appends shards to a run started with an open manifest; `close` ends the
1493
+ * manifest, and the run ends once those shards are done.
1494
+ *
1495
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/distributed_jobs/*\/distributed_runs/*}:addShards` · permission `workflows:run` · effect `write`
1496
+ *
1497
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
1498
+ */
1499
+ addShards(request: AddDistributedRunShardsRequest): Promise<DistributedRun>;
1500
+ /**
1501
+ * Reads a page of the run's shards, in queue order.
1502
+ *
1503
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/distributed_jobs/*\/distributed_runs/*}:readShards` · permission `workflows:read` · effect `read`
1504
+ *
1505
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`, `RESOURCE_NOT_FOUND`.
1506
+ */
1507
+ readShards(request: ReadDistributedRunShardsRequest): Promise<ReadDistributedRunShardsResponse>;
1508
+ /**
1509
+ * Reads a page of the run's workers.
1510
+ *
1511
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/distributed_jobs/*\/distributed_runs/*}:readWorkers` · permission `workflows:read` · effect `read`
1512
+ *
1513
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`, `RESOURCE_NOT_FOUND`.
1514
+ */
1515
+ readWorkers(request: ReadDistributedRunWorkersRequest): Promise<ReadDistributedRunWorkersResponse>;
1516
+ }