@archildata/api-types 0.0.46 → 0.0.47

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 (2) hide show
  1. package/index.d.ts +147 -7
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -418,6 +418,55 @@ export interface paths {
418
418
  patch?: never;
419
419
  trace?: never;
420
420
  };
421
+ "/api/images": {
422
+ parameters: {
423
+ query?: never;
424
+ header?: never;
425
+ path?: never;
426
+ cookie?: never;
427
+ };
428
+ get?: never;
429
+ put?: never;
430
+ /**
431
+ * Build a sandbox image
432
+ * @description Starts pulling and converting an OCI image, or joins the build already
433
+ * running for it. Poll the image until it is `ready`, then pass its
434
+ * `image_id` when creating a sandbox. Requesting the same `source` again
435
+ * returns the same image. A finished tag rebuilds, since the tag may have
436
+ * moved; until the rebuild is `ready`, new sandboxes boot the previous
437
+ * `digest`. A finished digest reference returns immediately.
438
+ * `registry_auth` pulls from a private registry, and a private image is
439
+ * visible only to its account. The credentials are passed to the build
440
+ * and never stored. A failed build, or a build whose runtime host does
441
+ * not answer, builds again on the next request.
442
+ */
443
+ post: operations["createImage"];
444
+ delete?: never;
445
+ options?: never;
446
+ head?: never;
447
+ patch?: never;
448
+ trace?: never;
449
+ };
450
+ "/api/images/{image_id}": {
451
+ parameters: {
452
+ query?: never;
453
+ header?: never;
454
+ path?: never;
455
+ cookie?: never;
456
+ };
457
+ /**
458
+ * Get a sandbox image
459
+ * @description Reports build progress. A build its runtime host failed or lost reports `failed` with `failure_reason: interrupted`; one whose host does not answer stays `building`. Request the image again to rebuild either.
460
+ */
461
+ get: operations["getImage"];
462
+ put?: never;
463
+ post?: never;
464
+ delete?: never;
465
+ options?: never;
466
+ head?: never;
467
+ patch?: never;
468
+ trace?: never;
469
+ };
421
470
  "/api/sandboxes": {
422
471
  parameters: {
423
472
  query?: never;
@@ -993,8 +1042,10 @@ export interface components {
993
1042
  idle_ttl_seconds: number;
994
1043
  /** @description Maximum number of concurrently attached process sessions. Detached processes and one-shot process controls do not count. */
995
1044
  max_concurrent_execs: number;
996
- /** @description OCI reference requested when the sandbox was created. */
1045
+ /** @description OCI reference requested when the sandbox was created. Empty for a sandbox created from `image_id`. */
997
1046
  base_image: string;
1047
+ /** @description Image digest the sandbox was created from, if any. */
1048
+ image_digest?: string;
998
1049
  /**
999
1050
  * @description Sandbox CPU architecture.
1000
1051
  * @enum {string}
@@ -1120,6 +1171,44 @@ export interface components {
1120
1171
  success: boolean;
1121
1172
  data: components["schemas"]["SandboxConnection"];
1122
1173
  };
1174
+ RegistryAuth: {
1175
+ username: string;
1176
+ /** @description Password or access token, such as a GitHub personal access token with `read:packages`. */
1177
+ password: string;
1178
+ };
1179
+ CreateImageRequest: {
1180
+ /** @description Linux OCI image reference. Docker shorthand and tags are accepted. */
1181
+ source: string;
1182
+ registry_auth?: components["schemas"]["RegistryAuth"];
1183
+ };
1184
+ /** @enum {string} */
1185
+ ImageState: "building" | "ready" | "failed";
1186
+ Image: {
1187
+ image_id: string;
1188
+ /** @description Normalized OCI reference the image is pulled from. */
1189
+ source: string;
1190
+ /** @description Whether the image is pulled with registry credentials. */
1191
+ private: boolean;
1192
+ status: components["schemas"]["ImageState"];
1193
+ /** @description The most recent successful build. Sandboxes created from this `image_id` boot it, and keep it after the image is rebuilt. */
1194
+ digest?: string;
1195
+ /** @description The pulled manifest, as `repository@sha256:...`. */
1196
+ canonical_source?: string;
1197
+ /**
1198
+ * @description Set when `failed`. `invalid_source`: the registry reported the image missing or denied access, so requesting it again will not help. `interrupted`: the build did not finish; request the image again.
1199
+ * @enum {string}
1200
+ */
1201
+ failure_reason?: "invalid_source" | "interrupted";
1202
+ /** Format: date-time */
1203
+ created_at: string;
1204
+ /** Format: date-time */
1205
+ updated_at: string;
1206
+ };
1207
+ ApiResponse_Image: {
1208
+ /** @example true */
1209
+ success: boolean;
1210
+ data: components["schemas"]["Image"];
1211
+ };
1123
1212
  ApiResponse_Sandbox: {
1124
1213
  /** @example true */
1125
1214
  success: boolean;
@@ -1137,11 +1226,10 @@ export interface components {
1137
1226
  vcpu_count: number;
1138
1227
  /** @default 2048 */
1139
1228
  mem_size_mib: number;
1140
- /**
1141
- * @description Public Linux OCI image reference. Docker shorthand and tags are accepted; the selected platform manifest is pinned at creation.
1142
- * @default ubuntu:26.04
1143
- */
1144
- base_image: string;
1229
+ /** @description Public Linux OCI image reference. Docker shorthand and tags are accepted; the selected platform manifest is pinned at creation. Defaults to `ubuntu:26.04` when neither this nor `image_id` is set. Mutually exclusive with `image_id`. */
1230
+ base_image?: string;
1231
+ /** @description An image from the images API, for images that need registry credentials. The sandbox boots the image's current `digest`. Mutually exclusive with `base_image`. */
1232
+ image_id?: string;
1145
1233
  /** @description TCP ports to expose publicly when the sandbox is created. */
1146
1234
  ports?: number[];
1147
1235
  /**
@@ -2846,6 +2934,58 @@ export interface operations {
2846
2934
  500: components["responses"]["InternalError"];
2847
2935
  };
2848
2936
  };
2937
+ createImage: {
2938
+ parameters: {
2939
+ query?: never;
2940
+ header?: never;
2941
+ path?: never;
2942
+ cookie?: never;
2943
+ };
2944
+ requestBody: {
2945
+ content: {
2946
+ "application/json": components["schemas"]["CreateImageRequest"];
2947
+ };
2948
+ };
2949
+ responses: {
2950
+ /** @description The image build is running or finished */
2951
+ 202: {
2952
+ headers: {
2953
+ [name: string]: unknown;
2954
+ };
2955
+ content: {
2956
+ "application/json": components["schemas"]["ApiResponse_Image"];
2957
+ };
2958
+ };
2959
+ 400: components["responses"]["ValidationError"];
2960
+ 401: components["responses"]["Unauthorized"];
2961
+ 500: components["responses"]["InternalError"];
2962
+ };
2963
+ };
2964
+ getImage: {
2965
+ parameters: {
2966
+ query?: never;
2967
+ header?: never;
2968
+ path: {
2969
+ image_id: string;
2970
+ };
2971
+ cookie?: never;
2972
+ };
2973
+ requestBody?: never;
2974
+ responses: {
2975
+ /** @description The sandbox image */
2976
+ 200: {
2977
+ headers: {
2978
+ [name: string]: unknown;
2979
+ };
2980
+ content: {
2981
+ "application/json": components["schemas"]["ApiResponse_Image"];
2982
+ };
2983
+ };
2984
+ 401: components["responses"]["Unauthorized"];
2985
+ 404: components["responses"]["NotFound"];
2986
+ 500: components["responses"]["InternalError"];
2987
+ };
2988
+ };
2849
2989
  listSandboxes: {
2850
2990
  parameters: {
2851
2991
  query?: {
@@ -2900,7 +3040,7 @@ export interface operations {
2900
3040
  400: components["responses"]["ValidationError"];
2901
3041
  401: components["responses"]["Unauthorized"];
2902
3042
  404: components["responses"]["NotFound"];
2903
- /** @description The requested sandbox name already exists in the account */
3043
+ /** @description The requested sandbox name already exists in the account, or the requested `image_id` has no finished build yet */
2904
3044
  409: {
2905
3045
  headers: {
2906
3046
  [name: string]: unknown;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@archildata/api-types",
3
- "version": "0.0.46",
3
+ "version": "0.0.47",
4
4
  "description": "API types for the Archil control plane",
5
5
  "type": "module",
6
6
  "types": "index.d.ts",