@archildata/api-types 0.0.97 → 0.0.99

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 +130 -3
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -840,6 +840,26 @@ export interface paths {
840
840
  patch?: never;
841
841
  trace?: never;
842
842
  };
843
+ "/api/exec/{execId}": {
844
+ parameters: {
845
+ query?: never;
846
+ header?: never;
847
+ path?: never;
848
+ cookie?: never;
849
+ };
850
+ /**
851
+ * Get an exec's status and result
852
+ * @description `wait` waits up to that many seconds for the exec to end.
853
+ */
854
+ get: operations["getExec"];
855
+ put?: never;
856
+ post?: never;
857
+ delete?: never;
858
+ options?: never;
859
+ head?: never;
860
+ patch?: never;
861
+ trace?: never;
862
+ };
843
863
  "/api/tokens": {
844
864
  parameters: {
845
865
  query?: never;
@@ -3221,6 +3241,16 @@ export interface components {
3221
3241
  /** @description Memory in MiB for the command's VM. Defaults to 4096. Billed as described for `vcpuCount`. */
3222
3242
  memSizeMib?: number;
3223
3243
  network?: components["schemas"]["ExecNetwork"];
3244
+ /**
3245
+ * @description How long the command may run. A request waits up to 4.5 minutes for the result, then answers 202 with the exec's ID.
3246
+ * @default 300
3247
+ */
3248
+ timeoutSeconds: number;
3249
+ /**
3250
+ * @description Answer 202 with the exec's ID instead of waiting for the result.
3251
+ * @default false
3252
+ */
3253
+ async: boolean;
3224
3254
  };
3225
3255
  ExecDiskResult: {
3226
3256
  /**
@@ -3252,6 +3282,38 @@ export interface components {
3252
3282
  */
3253
3283
  executeMs: number;
3254
3284
  };
3285
+ ApiResponse_ExecAccepted: {
3286
+ /** @example true */
3287
+ success: boolean;
3288
+ data: {
3289
+ execId: string;
3290
+ /** @enum {string} */
3291
+ status: "running";
3292
+ };
3293
+ };
3294
+ ExecStatus: {
3295
+ execId: string;
3296
+ /**
3297
+ * @description `completed` when the command exited, whatever its exit code; `failed` when it timed out or couldn't run.
3298
+ * @enum {string}
3299
+ */
3300
+ status: "running" | "stopping" | "completed" | "failed";
3301
+ /** @description The command's exit code, once `completed` */
3302
+ exitCode?: number;
3303
+ /** @description The first 4 MiB of the command's output, once `completed` */
3304
+ stdout?: string;
3305
+ /** @description The first 4 MiB of the command's error output, once `completed` */
3306
+ stderr?: string;
3307
+ /** @description Why the exec `failed` */
3308
+ error?: string;
3309
+ /** @description How long the command ran */
3310
+ executeMs?: number;
3311
+ };
3312
+ ApiResponse_ExecStatus: {
3313
+ /** @example true */
3314
+ success: boolean;
3315
+ data: components["schemas"]["ExecStatus"];
3316
+ };
3255
3317
  ApiResponse_ExecDisk: {
3256
3318
  /** @example true */
3257
3319
  success: boolean;
@@ -3260,8 +3322,9 @@ export interface components {
3260
3322
  ExecRequest: {
3261
3323
  /**
3262
3324
  * @description Map of relative path under `/mnt/archil` to the disk to mount
3263
- * there. At least one entry is required. Relative paths must be
3264
- * non-empty, non-absolute, and contain no `.` or `..` segments.
3325
+ * there. Relative paths must be non-empty, non-absolute, and contain
3326
+ * no `.` or `..` segments. Running without disks needs the
3327
+ * `sandbox:manage:create` permission.
3265
3328
  *
3266
3329
  * Each value is either a plain disk ID string (mounts the disk's
3267
3330
  * root, read-write) or an object that additionally selects a
@@ -3282,7 +3345,7 @@ export interface components {
3282
3345
  * }
3283
3346
  * }
3284
3347
  */
3285
- disks: {
3348
+ disks?: {
3286
3349
  [key: string]: string | components["schemas"]["ExecMount"];
3287
3350
  };
3288
3351
  /**
@@ -3299,6 +3362,16 @@ export interface components {
3299
3362
  /** @description Memory in MiB for the command's VM. Defaults to 4096. Billed as described for `vcpuCount`. */
3300
3363
  memSizeMib?: number;
3301
3364
  network?: components["schemas"]["ExecNetwork"];
3365
+ /**
3366
+ * @description How long the command may run. A request waits up to 4.5 minutes for the result, then answers 202 with the exec's ID.
3367
+ * @default 300
3368
+ */
3369
+ timeoutSeconds: number;
3370
+ /**
3371
+ * @description Answer 202 with the exec's ID instead of waiting for the result.
3372
+ * @default false
3373
+ */
3374
+ async: boolean;
3302
3375
  };
3303
3376
  /**
3304
3377
  * @description Network policy for the command's container, using the sandbox egress
@@ -5285,6 +5358,15 @@ export interface operations {
5285
5358
  "application/json": components["schemas"]["ApiResponse_ExecDisk"];
5286
5359
  };
5287
5360
  };
5361
+ /** @description The command is still running. Get its result from `GET /api/exec/{execId}`. */
5362
+ 202: {
5363
+ headers: {
5364
+ [name: string]: unknown;
5365
+ };
5366
+ content: {
5367
+ "application/json": components["schemas"]["ApiResponse_ExecAccepted"];
5368
+ };
5369
+ };
5288
5370
  400: components["responses"]["ValidationError"];
5289
5371
  401: components["responses"]["Unauthorized"];
5290
5372
  403: components["responses"]["ToolCallAllowanceExhausted"];
@@ -5394,6 +5476,15 @@ export interface operations {
5394
5476
  "application/json": components["schemas"]["ApiResponse_Exec"];
5395
5477
  };
5396
5478
  };
5479
+ /** @description The command is still running. Get its result from `GET /api/exec/{execId}`. */
5480
+ 202: {
5481
+ headers: {
5482
+ [name: string]: unknown;
5483
+ };
5484
+ content: {
5485
+ "application/json": components["schemas"]["ApiResponse_ExecAccepted"];
5486
+ };
5487
+ };
5397
5488
  400: components["responses"]["ValidationError"];
5398
5489
  401: components["responses"]["Unauthorized"];
5399
5490
  403: components["responses"]["ToolCallAllowanceExhausted"];
@@ -5419,6 +5510,42 @@ export interface operations {
5419
5510
  };
5420
5511
  };
5421
5512
  };
5513
+ getExec: {
5514
+ parameters: {
5515
+ query?: {
5516
+ wait?: number;
5517
+ };
5518
+ header?: never;
5519
+ path: {
5520
+ execId: string;
5521
+ };
5522
+ cookie?: never;
5523
+ };
5524
+ requestBody?: never;
5525
+ responses: {
5526
+ /** @description The exec's status, and its result once it has one */
5527
+ 200: {
5528
+ headers: {
5529
+ [name: string]: unknown;
5530
+ };
5531
+ content: {
5532
+ "application/json": components["schemas"]["ApiResponse_ExecStatus"];
5533
+ };
5534
+ };
5535
+ 400: components["responses"]["ValidationError"];
5536
+ 401: components["responses"]["Unauthorized"];
5537
+ /** @description Not allowed to access this exec */
5538
+ 403: {
5539
+ headers: {
5540
+ [name: string]: unknown;
5541
+ };
5542
+ content: {
5543
+ "application/json": components["schemas"]["ErrorResponse"];
5544
+ };
5545
+ };
5546
+ 404: components["responses"]["NotFound"];
5547
+ };
5548
+ };
5422
5549
  listApiTokens: {
5423
5550
  parameters: {
5424
5551
  query?: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@archildata/api-types",
3
- "version": "0.0.97",
3
+ "version": "0.0.99",
4
4
  "description": "Public API types for Archil",
5
5
  "type": "module",
6
6
  "types": "index.d.ts",