@sylphx/sdk 0.31.0 → 0.32.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.
- package/README.md +131 -4
- package/dist/access.d.ts +146 -17
- package/dist/access.js +114 -8
- package/dist/access.js.map +1 -1
- package/dist/agents.d.ts +1564 -0
- package/dist/agents.js +1096 -0
- package/dist/agents.js.map +1 -0
- package/dist/ai.d.ts +1 -2
- package/dist/ai.js +2 -3
- package/dist/ai.js.map +1 -1
- package/dist/artifacts.d.ts +1 -1
- package/dist/artifacts.js +2 -2
- package/dist/assets.d.ts +447 -0
- package/dist/assets.js +266 -0
- package/dist/assets.js.map +1 -0
- package/dist/auth/client.d.ts +239 -0
- package/dist/auth/client.js +337 -0
- package/dist/auth/client.js.map +1 -0
- package/dist/auth/end-user-keys-mock.d.ts +83 -0
- package/dist/auth/end-user-keys-mock.js +427 -0
- package/dist/auth/end-user-keys-mock.js.map +1 -0
- package/dist/auth/end-user-keys.d.ts +219 -0
- package/dist/auth/end-user-keys.js +240 -0
- package/dist/auth/end-user-keys.js.map +1 -0
- package/dist/auth/verify.d.ts +38 -3
- package/dist/auth/verify.js +58 -8
- package/dist/auth/verify.js.map +1 -1
- package/dist/auth.d.ts +656 -9
- package/dist/auth.js +563 -6
- package/dist/auth.js.map +1 -1
- package/dist/billing.d.ts +99 -21
- package/dist/billing.js +43 -5
- package/dist/billing.js.map +1 -1
- package/dist/broker.d.ts +5 -4
- package/dist/broker.js +3 -3
- package/dist/broker.js.map +1 -1
- package/dist/build.d.ts +362 -29
- package/dist/build.js +302 -10
- package/dist/build.js.map +1 -1
- package/dist/common.d.ts +1 -1
- package/dist/common.js +1 -1
- package/dist/config/flags.d.ts +140 -0
- package/dist/config/flags.js +462 -0
- package/dist/config/flags.js.map +1 -0
- package/dist/config.d.ts +380 -15
- package/dist/config.js +283 -5
- package/dist/config.js.map +1 -1
- package/dist/connections.d.ts +6 -6
- package/dist/connections.js +3 -3
- package/dist/data.d.ts +612 -7
- package/dist/data.js +566 -4
- package/dist/data.js.map +1 -1
- package/dist/entitlement.d.ts +10 -8
- package/dist/entitlement.js +3 -4
- package/dist/entitlement.js.map +1 -1
- package/dist/events/realtime.d.ts +69 -0
- package/dist/events/realtime.js +107 -0
- package/dist/events/realtime.js.map +1 -0
- package/dist/events/webhooks.d.ts +40 -0
- package/dist/events/webhooks.js +110 -0
- package/dist/events/webhooks.js.map +1 -0
- package/dist/events.d.ts +369 -22
- package/dist/events.js +311 -8
- package/dist/events.js.map +1 -1
- package/dist/flags.d.ts +18 -0
- package/dist/flags.js +44 -0
- package/dist/flags.js.map +1 -0
- package/dist/hosting.d.ts +13 -14
- package/dist/hosting.js +3 -4
- package/dist/hosting.js.map +1 -1
- package/dist/ids.d.ts +987 -0
- package/dist/ids.js +317 -0
- package/dist/ids.js.map +1 -0
- package/dist/index.d.ts +25 -1
- package/dist/index.js +34 -2
- package/dist/index.js.map +1 -1
- package/dist/keys.d.ts +2 -2
- package/dist/keys.js +3 -3
- package/dist/knowledge.d.ts +1192 -0
- package/dist/knowledge.js +1002 -0
- package/dist/knowledge.js.map +1 -0
- package/dist/localization.d.ts +663 -0
- package/dist/localization.js +491 -0
- package/dist/localization.js.map +1 -0
- package/dist/methods.js +3251 -133
- package/dist/methods.js.map +1 -1
- package/dist/money.d.ts +3086 -0
- package/dist/money.js +2358 -0
- package/dist/money.js.map +1 -0
- package/dist/network.d.ts +4 -5
- package/dist/network.js +3 -4
- package/dist/network.js.map +1 -1
- package/dist/notify.d.ts +667 -125
- package/dist/notify.js +471 -73
- package/dist/notify.js.map +1 -1
- package/dist/observability.d.ts +322 -7
- package/dist/observability.js +244 -8
- package/dist/observability.js.map +1 -1
- package/dist/realtime.d.ts +404 -0
- package/dist/realtime.js +312 -0
- package/dist/realtime.js.map +1 -0
- package/dist/release.d.ts +14 -15
- package/dist/release.js +3 -4
- package/dist/release.js.map +1 -1
- package/dist/runners.d.ts +2 -3
- package/dist/runners.js +3 -4
- package/dist/runners.js.map +1 -1
- package/dist/runtime.d.ts +5 -1
- package/dist/runtime.js +7 -3
- package/dist/runtime.js.map +1 -1
- package/dist/sandboxes.d.ts +64 -20
- package/dist/sandboxes.js +9 -4
- package/dist/sandboxes.js.map +1 -1
- package/dist/secrets.d.ts +342 -6
- package/dist/secrets.js +271 -4
- package/dist/secrets.js.map +1 -1
- package/dist/workflows.d.ts +969 -15
- package/dist/workflows.js +815 -6
- package/dist/workflows.js.map +1 -1
- package/package.json +2 -2
package/dist/build.d.ts
CHANGED
|
@@ -2,9 +2,11 @@ import * as runtime from './runtime.js';
|
|
|
2
2
|
import './common.js';
|
|
3
3
|
import type * as common from './common.js';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* A Build runs one command or builds one image over one input. The input is
|
|
6
|
+
* a commit (read through the Broker at that exact commit) or a tree uploaded
|
|
7
|
+
* to the org's store; the output is the command's exit code and named
|
|
8
|
+
* artifacts, or an image with an SBOM and signed provenance. A Build is
|
|
9
|
+
* immutable once created; it ends with its output or a typed failure.
|
|
8
10
|
*/
|
|
9
11
|
export interface Build {
|
|
10
12
|
/** `orgs/{org}/projects/{project}/builds/{build}`. */
|
|
@@ -18,8 +20,17 @@ export interface Build {
|
|
|
18
20
|
/** Observed state. */
|
|
19
21
|
readonly status?: BuildStatus;
|
|
20
22
|
}
|
|
23
|
+
/** BuildArtifact is one file a command kept. */
|
|
24
|
+
export interface BuildArtifact {
|
|
25
|
+
/** The path relative to the input root. */
|
|
26
|
+
readonly path?: string;
|
|
27
|
+
/** The content digest, `<sha256 hex>/<size in bytes>`, in the org's store. */
|
|
28
|
+
readonly digest?: string;
|
|
29
|
+
/** The size in bytes. */
|
|
30
|
+
readonly sizeBytes?: string;
|
|
31
|
+
}
|
|
21
32
|
/**
|
|
22
|
-
* A BuildCache is a per-project
|
|
33
|
+
* A BuildCache is a per-project cache. It makes builds faster and never
|
|
23
34
|
* changes their result; a missing or unreachable cache only slows a build.
|
|
24
35
|
*/
|
|
25
36
|
export interface BuildCache {
|
|
@@ -51,8 +62,43 @@ export interface BuildCacheStatus {
|
|
|
51
62
|
readonly lastUseTime?: string;
|
|
52
63
|
}
|
|
53
64
|
/**
|
|
54
|
-
*
|
|
55
|
-
*
|
|
65
|
+
* The request of BuildImage. Its options are the BuildSpec's, by the same
|
|
66
|
+
* names.
|
|
67
|
+
*/
|
|
68
|
+
export interface BuildImageRequest {
|
|
69
|
+
/** The project to build in. */
|
|
70
|
+
parent: string;
|
|
71
|
+
/** A commit, read through the Broker at that exact commit. */
|
|
72
|
+
source?: BuildSource;
|
|
73
|
+
/** An uploaded tree. */
|
|
74
|
+
tree?: BuildTree;
|
|
75
|
+
/** The image to build. */
|
|
76
|
+
image?: ImageTarget;
|
|
77
|
+
/** The machine size; default `[build] size`, else STANDARD. */
|
|
78
|
+
size?: BuildSize;
|
|
79
|
+
/** The time limit; default 1 hour. */
|
|
80
|
+
timeout?: string;
|
|
81
|
+
/** Internet hosts the build may reach; empty means in-cell only. */
|
|
82
|
+
allowHosts?: string[];
|
|
83
|
+
/** The BuildCache to use; default the project's `default` cache. */
|
|
84
|
+
cache?: string;
|
|
85
|
+
/** The id segment of the Build's name; the server assigns one when unset. */
|
|
86
|
+
buildId?: string;
|
|
87
|
+
/** Validate and return the result without writing anything. */
|
|
88
|
+
validateOnly?: boolean;
|
|
89
|
+
}
|
|
90
|
+
/** BuildLogLine is one line of a build's log. */
|
|
91
|
+
export interface BuildLogLine {
|
|
92
|
+
/** When the line was written. */
|
|
93
|
+
readonly writeTime?: string;
|
|
94
|
+
/** `stdout` or `stderr`. */
|
|
95
|
+
readonly stream?: string;
|
|
96
|
+
/** The line, without its trailing newline. */
|
|
97
|
+
readonly text?: string;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* BuildOutput is what a Build wrote to Kernel Artifacts, by digest: the
|
|
101
|
+
* image fields for an image, `exit_code` and `artifacts` for a command.
|
|
56
102
|
*/
|
|
57
103
|
export interface BuildOutput {
|
|
58
104
|
/** The image reference: `registry.sylphx.net/<path>@sha256:<hex>`. */
|
|
@@ -63,8 +109,12 @@ export interface BuildOutput {
|
|
|
63
109
|
readonly sbomDigest?: string;
|
|
64
110
|
/** The signed SLSA provenance Artifact digest. */
|
|
65
111
|
readonly provenanceDigest?: string;
|
|
66
|
-
/** The
|
|
112
|
+
/** The artifact in Sylphx Artifacts that holds the three. */
|
|
67
113
|
readonly artifact?: string;
|
|
114
|
+
/** The command's own exit code. */
|
|
115
|
+
readonly exitCode?: number;
|
|
116
|
+
/** The files the command's `artifacts` globs matched, by digest. */
|
|
117
|
+
readonly artifacts?: BuildArtifact[];
|
|
68
118
|
}
|
|
69
119
|
/**
|
|
70
120
|
* BuildSource is the exact source a Build reads, fetched at `commit`
|
|
@@ -79,23 +129,30 @@ export interface BuildSource {
|
|
|
79
129
|
/** The directory inside the repository to build; default the root. */
|
|
80
130
|
rootDirectory?: string;
|
|
81
131
|
}
|
|
82
|
-
/** BuildSpec is the caller-writable state of a Build. */
|
|
132
|
+
/** BuildSpec is the caller-writable state of a Build: one input, one output. */
|
|
83
133
|
export interface BuildSpec {
|
|
84
|
-
/**
|
|
134
|
+
/** A commit, read through the Broker at that exact commit. */
|
|
85
135
|
source?: BuildSource;
|
|
86
|
-
/**
|
|
87
|
-
* A Dockerfile path relative to the root directory; unset lets the zero-
|
|
88
|
-
* config frontend detect the stack.
|
|
89
|
-
*/
|
|
90
|
-
dockerfile?: string;
|
|
91
|
-
/** The Dockerfile stage to build. */
|
|
92
|
-
target?: string;
|
|
93
|
-
/** The class, `sylphx-<os>-<size>`; default `sylphx-linux-standard`. */
|
|
94
|
-
buildClass?: string;
|
|
95
|
-
/** Build arguments. Secret values bind through Kernel Secrets, never here. */
|
|
96
|
-
buildArgs?: Record<string, string>;
|
|
97
136
|
/** The BuildCache to read and write; default the project's `default` cache. */
|
|
98
137
|
cache?: string;
|
|
138
|
+
/** A tree uploaded to the org's store, by its root digest. */
|
|
139
|
+
tree?: BuildTree;
|
|
140
|
+
/** An OCI image with an SBOM and signed provenance. */
|
|
141
|
+
image?: ImageTarget;
|
|
142
|
+
/** One command's exit code and the artifacts it names. */
|
|
143
|
+
command?: CommandTarget;
|
|
144
|
+
/** The machine size; default `[build] size`, else STANDARD. */
|
|
145
|
+
size?: BuildSize;
|
|
146
|
+
/**
|
|
147
|
+
* The time limit; default 1 hour, at most 6 hours. A command that reaches
|
|
148
|
+
* it is killed and the Build ends with BUILD_FAILURE_TIMEOUT.
|
|
149
|
+
*/
|
|
150
|
+
timeout?: string;
|
|
151
|
+
/**
|
|
152
|
+
* Internet hosts the build may reach. Empty means in-cell only: the
|
|
153
|
+
* mirrors and the store. Default `[build] allow_hosts`.
|
|
154
|
+
*/
|
|
155
|
+
allowHosts?: string[];
|
|
99
156
|
}
|
|
100
157
|
/** BuildStatus is the observed state of a Build. */
|
|
101
158
|
export interface BuildStatus {
|
|
@@ -107,7 +164,10 @@ export interface BuildStatus {
|
|
|
107
164
|
readonly state?: BuildState;
|
|
108
165
|
/** Why the build failed, when `state` is FAILED. */
|
|
109
166
|
readonly failure?: BuildFailure;
|
|
110
|
-
/**
|
|
167
|
+
/**
|
|
168
|
+
* The result: an image when `state` is SUCCEEDED; for a command, set
|
|
169
|
+
* whenever the command ran, whatever its exit code.
|
|
170
|
+
*/
|
|
111
171
|
readonly output?: BuildOutput;
|
|
112
172
|
/** The Sandboxes lease the build ran on. */
|
|
113
173
|
readonly lease?: string;
|
|
@@ -117,6 +177,22 @@ export interface BuildStatus {
|
|
|
117
177
|
readonly endTime?: string;
|
|
118
178
|
/** Where the build log is read, through Observability. */
|
|
119
179
|
readonly logUri?: string;
|
|
180
|
+
/** Whether the build took a warm workspace of the same repository. */
|
|
181
|
+
readonly workspace?: BuildWorkspace;
|
|
182
|
+
/**
|
|
183
|
+
* Bytes the client uploaded for this build: the blobs of the tree the
|
|
184
|
+
* org's store lacked.
|
|
185
|
+
*/
|
|
186
|
+
readonly bytesUp?: string;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* BuildTree is a tree uploaded to the org's store: the REAPI v2 `Directory`
|
|
190
|
+
* layout, identified by the digest of its root. The client uploads only the
|
|
191
|
+
* blobs the store lacks.
|
|
192
|
+
*/
|
|
193
|
+
export interface BuildTree {
|
|
194
|
+
/** The root `Directory` digest, `<sha256 hex>/<size in bytes>`. */
|
|
195
|
+
rootDigest?: string;
|
|
120
196
|
}
|
|
121
197
|
/** The request of CancelBuild. */
|
|
122
198
|
export interface CancelBuildRequest {
|
|
@@ -127,6 +203,16 @@ export interface CancelBuildRequest {
|
|
|
127
203
|
/** Validate without acting. */
|
|
128
204
|
validateOnly?: boolean;
|
|
129
205
|
}
|
|
206
|
+
/** CommandTarget runs one command over the input, like the local command. */
|
|
207
|
+
export interface CommandTarget {
|
|
208
|
+
/** The program and its arguments. Use `["bash", "-lc", "…"]` for a shell. */
|
|
209
|
+
argv?: string[];
|
|
210
|
+
/**
|
|
211
|
+
* Globs, relative to the input root, of files kept after the command ends,
|
|
212
|
+
* whatever its exit code (test reports, coverage).
|
|
213
|
+
*/
|
|
214
|
+
artifacts?: string[];
|
|
215
|
+
}
|
|
130
216
|
/** The request of CreateBuild. */
|
|
131
217
|
export interface CreateBuildRequest {
|
|
132
218
|
/** The parent to create in. */
|
|
@@ -162,6 +248,23 @@ export interface GetBuildRequest {
|
|
|
162
248
|
/** The name of the build to get. */
|
|
163
249
|
name: string;
|
|
164
250
|
}
|
|
251
|
+
/** ImageTarget builds an OCI image. */
|
|
252
|
+
export interface ImageTarget {
|
|
253
|
+
/**
|
|
254
|
+
* The `sylphx.toml` service whose `dockerfile` and `context` apply; unset
|
|
255
|
+
* reads the fields below or lets the zero-config frontend detect the stack.
|
|
256
|
+
*/
|
|
257
|
+
service?: string;
|
|
258
|
+
/**
|
|
259
|
+
* A Dockerfile path relative to the input root; unset lets the zero-config
|
|
260
|
+
* frontend detect the stack.
|
|
261
|
+
*/
|
|
262
|
+
dockerfile?: string;
|
|
263
|
+
/** The Dockerfile stage to build. */
|
|
264
|
+
target?: string;
|
|
265
|
+
/** Build arguments. Secret values bind through `[build.secrets]`, never here. */
|
|
266
|
+
buildArgs?: Record<string, string>;
|
|
267
|
+
}
|
|
165
268
|
/** The request of ListBuildCaches. */
|
|
166
269
|
export interface ListBuildCachesRequest {
|
|
167
270
|
/** The parent to list in. */
|
|
@@ -202,6 +305,87 @@ export interface ListBuildsResponse {
|
|
|
202
305
|
/** The token of the next page; empty on the last page. */
|
|
203
306
|
nextPageToken?: string;
|
|
204
307
|
}
|
|
308
|
+
/** The request of MintBuildCacheEnv. */
|
|
309
|
+
export interface MintBuildCacheEnvRequest {
|
|
310
|
+
/** The name of the build cache. */
|
|
311
|
+
name: string;
|
|
312
|
+
/** What the token may do; default READ. */
|
|
313
|
+
access?: BuildCacheAccess;
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* The response of MintBuildCacheEnv: what a build that runs elsewhere sets
|
|
317
|
+
* to reach the cache.
|
|
318
|
+
*/
|
|
319
|
+
export interface MintBuildCacheEnvResponse {
|
|
320
|
+
/**
|
|
321
|
+
* Environment variables by name: `SCCACHE_WEBDAV_ENDPOINT`,
|
|
322
|
+
* `SCCACHE_WEBDAV_TOKEN`, `TURBO_API`, `TURBO_TEAM`, `TURBO_TOKEN`,
|
|
323
|
+
* `SYLPHX_CRATES_MIRROR`.
|
|
324
|
+
*/
|
|
325
|
+
env?: Record<string, string>;
|
|
326
|
+
/** When the token in `env` stops verifying. */
|
|
327
|
+
expireTime?: string;
|
|
328
|
+
}
|
|
329
|
+
/** The request of PurgeBuildCache. */
|
|
330
|
+
export interface PurgeBuildCacheRequest {
|
|
331
|
+
/** The name of the build cache to empty. */
|
|
332
|
+
name: string;
|
|
333
|
+
/** Purge only if the current etag matches. */
|
|
334
|
+
etag?: string;
|
|
335
|
+
/** Validate without purging anything. */
|
|
336
|
+
validateOnly?: boolean;
|
|
337
|
+
}
|
|
338
|
+
/** The request of ReadBuildLogs. */
|
|
339
|
+
export interface ReadBuildLogsRequest {
|
|
340
|
+
/** The name of the build. */
|
|
341
|
+
name: string;
|
|
342
|
+
/** At most this many lines; default 500, clamped to 5000. */
|
|
343
|
+
pageSize?: number;
|
|
344
|
+
/** `next_page_token` of the previous page. */
|
|
345
|
+
pageToken?: string;
|
|
346
|
+
/**
|
|
347
|
+
* On a running build, wait up to this long (at most 30s) for new lines
|
|
348
|
+
* before returning an empty page.
|
|
349
|
+
*/
|
|
350
|
+
wait?: string;
|
|
351
|
+
}
|
|
352
|
+
/** The response of ReadBuildLogs. */
|
|
353
|
+
export interface ReadBuildLogsResponse {
|
|
354
|
+
/** The page, oldest first. */
|
|
355
|
+
lines?: BuildLogLine[];
|
|
356
|
+
/**
|
|
357
|
+
* The token of the next page. It is set while the build can still write,
|
|
358
|
+
* so a follower keeps polling; empty once the build is final and every
|
|
359
|
+
* line was read.
|
|
360
|
+
*/
|
|
361
|
+
nextPageToken?: string;
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* The request of RunBuild. Its options are the BuildSpec's, by the same
|
|
365
|
+
* names.
|
|
366
|
+
*/
|
|
367
|
+
export interface RunBuildRequest {
|
|
368
|
+
/** The project to run in. */
|
|
369
|
+
parent: string;
|
|
370
|
+
/** The uploaded tree to run over. */
|
|
371
|
+
tree: BuildTree;
|
|
372
|
+
/** The program and its arguments. */
|
|
373
|
+
command: string[];
|
|
374
|
+
/** Globs of files kept after the command ends, whatever its exit code. */
|
|
375
|
+
artifacts?: string[];
|
|
376
|
+
/** The machine size; default `[build] size`, else STANDARD. */
|
|
377
|
+
size?: BuildSize;
|
|
378
|
+
/** The time limit; default 1 hour. */
|
|
379
|
+
timeout?: string;
|
|
380
|
+
/** Internet hosts the command may reach; empty means in-cell only. */
|
|
381
|
+
allowHosts?: string[];
|
|
382
|
+
/** The BuildCache to use; default the project's `default` cache. */
|
|
383
|
+
cache?: string;
|
|
384
|
+
/** The id segment of the Build's name; the server assigns one when unset. */
|
|
385
|
+
buildId?: string;
|
|
386
|
+
/** Validate and return the result without writing anything. */
|
|
387
|
+
validateOnly?: boolean;
|
|
388
|
+
}
|
|
205
389
|
/** The request of UpdateBuildCache. */
|
|
206
390
|
export interface UpdateBuildCacheRequest {
|
|
207
391
|
/** The build cache to update; `name` identifies it. */
|
|
@@ -213,23 +397,113 @@ export interface UpdateBuildCacheRequest {
|
|
|
213
397
|
/** Validate and return the result without writing anything. */
|
|
214
398
|
validateOnly?: boolean;
|
|
215
399
|
}
|
|
400
|
+
/**
|
|
401
|
+
* BuildCacheAccess is what a cache token may do. A token from an uploaded
|
|
402
|
+
* tree or a laptop writes only the `dev` scope.
|
|
403
|
+
*/
|
|
404
|
+
export type BuildCacheAccess = 'read' | 'read_write' | (string & {});
|
|
216
405
|
/** BuildFailure is the typed reason a Build ended without a result. */
|
|
217
|
-
export type BuildFailure = 'source_unavailable' | 'build_error' | 'no_capacity' | 'class_not_offered' | 'signing_unavailable' | 'timeout' | (string & {});
|
|
406
|
+
export type BuildFailure = 'source_unavailable' | 'build_error' | 'no_capacity' | 'class_not_offered' | 'signing_unavailable' | 'timeout' | 'setup_failed' | (string & {});
|
|
407
|
+
/** BuildSize is the machine a build runs on. */
|
|
408
|
+
export type BuildSize = 'standard' | 'large' | 'xlarge' | (string & {});
|
|
218
409
|
/** BuildState is the lifecycle of a Build. */
|
|
219
410
|
export type BuildState = 'queued' | 'running' | 'succeeded' | 'failed' | 'cancelled' | (string & {});
|
|
411
|
+
/** BuildWorkspace says whether a build started from a warm workspace. */
|
|
412
|
+
export type BuildWorkspace = 'warm' | 'cold' | (string & {});
|
|
220
413
|
/**
|
|
221
|
-
* BuildService is Sylphx Build:
|
|
222
|
-
*
|
|
223
|
-
*
|
|
414
|
+
* BuildService is Sylphx Build: one command or one image over a commit or an
|
|
415
|
+
* uploaded tree, on an offline build lease beside a warm workspace, with one
|
|
416
|
+
* cache per project. Images carry an SBOM and signed SLSA provenance, all
|
|
417
|
+
* written to Sylphx Artifacts by digest.
|
|
224
418
|
*
|
|
225
419
|
* Namespace of Sylphx Build on `Sylphx`.
|
|
226
420
|
*/
|
|
227
421
|
export declare class BuildApi {
|
|
422
|
+
private readonly client;
|
|
228
423
|
/** The `builds` collection. */
|
|
229
424
|
readonly builds: BuildsCollection;
|
|
230
425
|
/** The `build_caches` collection. */
|
|
231
426
|
readonly buildCaches: BuildCachesCollection;
|
|
427
|
+
/** The `build.cache` handle. */
|
|
428
|
+
readonly cache: BuildCacheHandle;
|
|
429
|
+
/** The `build.caches` handle. */
|
|
430
|
+
readonly caches: BuildCachesHandle;
|
|
431
|
+
/** The `build.logs` handle. */
|
|
432
|
+
readonly logs: BuildLogsHandle;
|
|
232
433
|
constructor(client: runtime.Client);
|
|
434
|
+
/**
|
|
435
|
+
* Runs one command over an uploaded tree and settles with its exit code,
|
|
436
|
+
* like the local command. A caller that gets a failure before the command
|
|
437
|
+
* started (BUILD_FAILURE_SETUP_FAILED, NO_CAPACITY) may build locally.
|
|
438
|
+
*
|
|
439
|
+
* `POST /v1/{parent=orgs/*\/projects/*}/builds:run` · permission `build:run` · effect `write`
|
|
440
|
+
*
|
|
441
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `PLAN_LIMIT_REACHED`, `SPEND_LIMIT_REACHED`.
|
|
442
|
+
*
|
|
443
|
+
* Short name of `sx.build.builds.run`.
|
|
444
|
+
*/
|
|
445
|
+
run(request: RunBuildRequest): Promise<runtime.Operation<Build>>;
|
|
446
|
+
/**
|
|
447
|
+
* Builds an image, with an SBOM and signed provenance, from a commit or an
|
|
448
|
+
* uploaded tree.
|
|
449
|
+
*
|
|
450
|
+
* `POST /v1/{parent=orgs/*\/projects/*}/builds:buildImage` · permission `build:run` · effect `write`
|
|
451
|
+
*
|
|
452
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `PLAN_LIMIT_REACHED`, `SPEND_LIMIT_REACHED`.
|
|
453
|
+
*
|
|
454
|
+
* Short name of `sx.build.builds.buildImage`.
|
|
455
|
+
*/
|
|
456
|
+
image(request: BuildImageRequest): Promise<runtime.Operation<Build>>;
|
|
457
|
+
}
|
|
458
|
+
/** The `build.cache` handle of Sylphx Build. */
|
|
459
|
+
export declare class BuildCacheHandle {
|
|
460
|
+
private readonly client;
|
|
461
|
+
constructor(client: runtime.Client);
|
|
462
|
+
/**
|
|
463
|
+
* Mints the settings a build that runs elsewhere (a laptop, a CI runner)
|
|
464
|
+
* uses to reach the cache: the sccache, Turbo and crates mirror doors and a
|
|
465
|
+
* short-lived token, as environment variables.
|
|
466
|
+
*
|
|
467
|
+
* `POST /v1/{name=orgs/*\/projects/*\/build_caches/*}:mintEnv` · permission `build:run` · effect `write`
|
|
468
|
+
*
|
|
469
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
|
|
470
|
+
*
|
|
471
|
+
* Short name of `sx.build.buildCaches.mintEnv`.
|
|
472
|
+
*/
|
|
473
|
+
env(request: MintBuildCacheEnvRequest): Promise<MintBuildCacheEnvResponse>;
|
|
474
|
+
}
|
|
475
|
+
/** The `build.caches` handle of Sylphx Build. */
|
|
476
|
+
export declare class BuildCachesHandle {
|
|
477
|
+
private readonly client;
|
|
478
|
+
constructor(client: runtime.Client);
|
|
479
|
+
/**
|
|
480
|
+
* Empties a build cache and keeps the cache. The undo is that the next
|
|
481
|
+
* build refills it.
|
|
482
|
+
*
|
|
483
|
+
* `POST /v1/{name=orgs/*\/projects/*\/build_caches/*}:purge` · permission `build:write` · effect `destructive`
|
|
484
|
+
*
|
|
485
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
|
|
486
|
+
*
|
|
487
|
+
* Short name of `sx.build.buildCaches.purge`.
|
|
488
|
+
*/
|
|
489
|
+
purge(request: PurgeBuildCacheRequest): Promise<runtime.Operation<BuildCache>>;
|
|
490
|
+
}
|
|
491
|
+
/** The `build.logs` handle of Sylphx Build. */
|
|
492
|
+
export declare class BuildLogsHandle {
|
|
493
|
+
private readonly client;
|
|
494
|
+
constructor(client: runtime.Client);
|
|
495
|
+
/**
|
|
496
|
+
* Reads a page of a build's log lines, oldest first. With `wait`, an empty
|
|
497
|
+
* page on a running build waits up to that long for new lines, so a client
|
|
498
|
+
* follows the log by passing each `next_page_token` back.
|
|
499
|
+
*
|
|
500
|
+
* `GET /v1/{name=orgs/*\/projects/*\/builds/*}:readLogs` · permission `build:read` · effect `read`
|
|
501
|
+
*
|
|
502
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `PAGE_TOKEN_MISMATCH`.
|
|
503
|
+
*
|
|
504
|
+
* Short name of `sx.build.builds.readLogs`.
|
|
505
|
+
*/
|
|
506
|
+
read(request: ReadBuildLogsRequest): Promise<ReadBuildLogsResponse>;
|
|
233
507
|
}
|
|
234
508
|
/** `builds` of Sylphx Build: Resource type `build.sylphx.com/Build`. */
|
|
235
509
|
export declare class BuildsCollection {
|
|
@@ -254,10 +528,11 @@ export declare class BuildsCollection {
|
|
|
254
528
|
/** Every item of every page of `list`. */
|
|
255
529
|
listAll(request: ListBuildsRequest): AsyncGenerator<Build>;
|
|
256
530
|
/**
|
|
257
|
-
* Creates a build
|
|
258
|
-
*
|
|
531
|
+
* Creates a build: one command or one image over a commit or a tree. The
|
|
532
|
+
* Operation is done when the build reaches a final state. `run` and
|
|
533
|
+
* `image` are the short forms.
|
|
259
534
|
*
|
|
260
|
-
* `POST /v1/{parent=orgs/*\/projects/*}/builds` · permission `build:
|
|
535
|
+
* `POST /v1/{parent=orgs/*\/projects/*}/builds` · permission `build:run` · effect `write`
|
|
261
536
|
*
|
|
262
537
|
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `PLAN_LIMIT_REACHED`, `SPEND_LIMIT_REACHED`.
|
|
263
538
|
*/
|
|
@@ -266,11 +541,46 @@ export declare class BuildsCollection {
|
|
|
266
541
|
* Cancels a queued or running Build; its lease is released and nothing
|
|
267
542
|
* is published.
|
|
268
543
|
*
|
|
269
|
-
* `POST /v1/{name=orgs/*\/projects/*\/builds/*}:cancel` · permission `build:
|
|
544
|
+
* `POST /v1/{name=orgs/*\/projects/*\/builds/*}:cancel` · permission `build:run` · effect `destructive`
|
|
270
545
|
*
|
|
271
546
|
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
|
|
272
547
|
*/
|
|
273
548
|
cancel(request: CancelBuildRequest): Promise<runtime.Operation<Build>>;
|
|
549
|
+
/**
|
|
550
|
+
* Runs one command over an uploaded tree and settles with its exit code,
|
|
551
|
+
* like the local command. A caller that gets a failure before the command
|
|
552
|
+
* started (BUILD_FAILURE_SETUP_FAILED, NO_CAPACITY) may build locally.
|
|
553
|
+
*
|
|
554
|
+
* `POST /v1/{parent=orgs/*\/projects/*}/builds:run` · permission `build:run` · effect `write`
|
|
555
|
+
*
|
|
556
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `PLAN_LIMIT_REACHED`, `SPEND_LIMIT_REACHED`.
|
|
557
|
+
*
|
|
558
|
+
* Also `sx.build.run`.
|
|
559
|
+
*/
|
|
560
|
+
run(request: RunBuildRequest): Promise<runtime.Operation<Build>>;
|
|
561
|
+
/**
|
|
562
|
+
* Builds an image, with an SBOM and signed provenance, from a commit or an
|
|
563
|
+
* uploaded tree.
|
|
564
|
+
*
|
|
565
|
+
* `POST /v1/{parent=orgs/*\/projects/*}/builds:buildImage` · permission `build:run` · effect `write`
|
|
566
|
+
*
|
|
567
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `PLAN_LIMIT_REACHED`, `SPEND_LIMIT_REACHED`.
|
|
568
|
+
*
|
|
569
|
+
* Also `sx.build.image`.
|
|
570
|
+
*/
|
|
571
|
+
buildImage(request: BuildImageRequest): Promise<runtime.Operation<Build>>;
|
|
572
|
+
/**
|
|
573
|
+
* Reads a page of a build's log lines, oldest first. With `wait`, an empty
|
|
574
|
+
* page on a running build waits up to that long for new lines, so a client
|
|
575
|
+
* follows the log by passing each `next_page_token` back.
|
|
576
|
+
*
|
|
577
|
+
* `GET /v1/{name=orgs/*\/projects/*\/builds/*}:readLogs` · permission `build:read` · effect `read`
|
|
578
|
+
*
|
|
579
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `PAGE_TOKEN_MISMATCH`.
|
|
580
|
+
*
|
|
581
|
+
* Also `sx.build.logs.read`.
|
|
582
|
+
*/
|
|
583
|
+
readLogs(request: ReadBuildLogsRequest): Promise<ReadBuildLogsResponse>;
|
|
274
584
|
}
|
|
275
585
|
/** `build_caches` of Sylphx Build: Resource type `build.sylphx.com/BuildCache`. */
|
|
276
586
|
export declare class BuildCachesCollection {
|
|
@@ -310,4 +620,27 @@ export declare class BuildCachesCollection {
|
|
|
310
620
|
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
|
|
311
621
|
*/
|
|
312
622
|
delete(request: DeleteBuildCacheRequest): Promise<Record<string, never>>;
|
|
623
|
+
/**
|
|
624
|
+
* Mints the settings a build that runs elsewhere (a laptop, a CI runner)
|
|
625
|
+
* uses to reach the cache: the sccache, Turbo and crates mirror doors and a
|
|
626
|
+
* short-lived token, as environment variables.
|
|
627
|
+
*
|
|
628
|
+
* `POST /v1/{name=orgs/*\/projects/*\/build_caches/*}:mintEnv` · permission `build:run` · effect `write`
|
|
629
|
+
*
|
|
630
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
|
|
631
|
+
*
|
|
632
|
+
* Also `sx.build.cache.env`.
|
|
633
|
+
*/
|
|
634
|
+
mintEnv(request: MintBuildCacheEnvRequest): Promise<MintBuildCacheEnvResponse>;
|
|
635
|
+
/**
|
|
636
|
+
* Empties a build cache and keeps the cache. The undo is that the next
|
|
637
|
+
* build refills it.
|
|
638
|
+
*
|
|
639
|
+
* `POST /v1/{name=orgs/*\/projects/*\/build_caches/*}:purge` · permission `build:write` · effect `destructive`
|
|
640
|
+
*
|
|
641
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
|
|
642
|
+
*
|
|
643
|
+
* Also `sx.build.caches.purge`.
|
|
644
|
+
*/
|
|
645
|
+
purge(request: PurgeBuildCacheRequest): Promise<runtime.Operation<BuildCache>>;
|
|
313
646
|
}
|