@blaxel/core 0.3.26-preview.312 → 0.3.26-preview.313

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.
@@ -801,7 +801,7 @@ const listImages = (options) => {
801
801
  exports.listImages = listImages;
802
802
  /**
803
803
  * Build a container image
804
- * Builds a container image without creating a deployment. Returns a presigned URL for uploading source code. After upload, the image will be built and stored in the registry, but no agent, function, sandbox, or job will be created or updated.
804
+ * Builds or imports a container image without creating a deployment. Provide a registry image reference to download and convert an existing image, or omit image to receive a presigned URL for uploading source code. Registry imports can specify memoryMb and volumeMb for the import worker. These settings do not change the resources of workloads using the image.
805
805
  */
806
806
  const createImage = (options) => {
807
807
  return (options.client ?? client_gen_1.client).post({
@@ -2448,7 +2448,7 @@ const getTemplate = (options) => {
2448
2448
  exports.getTemplate = getTemplate;
2449
2449
  /**
2450
2450
  * List workspace team members
2451
- * Returns all team members in the workspace including their roles (admin or member) and invitation status.
2451
+ * Returns all team members in the workspace including their roles (admin, member or viewer) and invitation status.
2452
2452
  */
2453
2453
  const listWorkspaceUsers = (options) => {
2454
2454
  return (options?.client ?? client_gen_1.client).get({
@@ -30,8 +30,8 @@ function missingCredentialsMessage() {
30
30
  return "No Blaxel credentials found. Set the BL_API_KEY and BL_WORKSPACE environment variables, or run `bl login`.";
31
31
  }
32
32
  // Build info - these placeholders are replaced at build time by build:replace-imports
33
- const BUILD_VERSION = "0.3.26-preview.312";
34
- const BUILD_COMMIT = "45891cd9862d690bb6532b5758e75084083d511f";
33
+ const BUILD_VERSION = "0.3.26-preview.313";
34
+ const BUILD_COMMIT = "74b7740c0709370950088f3244fe2eeb2e970fca";
35
35
  const BUILD_SENTRY_DSN = "https://fd5e60e1c9820e1eef5ccebb84a07127@o4508714045276160.ingest.us.sentry.io/4510465864564736";
36
36
  const BLAXEL_API_VERSION = "2026-09-22";
37
37
  // Bun < 1.3.11 never sends connection-level WINDOW_UPDATE: the pooled h2
@@ -1,13 +1,14 @@
1
1
  "use strict";
2
2
  // This file is auto-generated by @hey-api/openapi-ts
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.getWatchFilesystemByPath = exports.postUpgrade = exports.postProcessByIdentifierStdin = exports.deleteProcessByIdentifierStdin = exports.getProcessByIdentifierLogsStream = exports.getProcessByIdentifierLogs = exports.deleteProcessByIdentifierKill = exports.getProcessByIdentifier = exports.deleteProcessByIdentifier = exports.postProcess = exports.getProcess = exports.putNetworkTunnelConfig = exports.deleteNetworkTunnel = exports.getNetworkProcessByPidPorts = exports.postNetworkProcessByPidMonitor = exports.deleteNetworkProcessByPidMonitor = exports.getHealth = exports.putFilesystemTreeByPath = exports.getFilesystemTreeByPath = exports.deleteFilesystemTreeByPath = exports.putFilesystemByPath = exports.getFilesystemByPath = exports.deleteFilesystemByPath = exports.getFilesystemSearchByPath = exports.postFilesystemMultipartInitiateByPath = exports.getFilesystemMultipartByUploadIdParts = exports.putFilesystemMultipartByUploadIdPart = exports.postFilesystemMultipartByUploadIdComplete = exports.deleteFilesystemMultipartByUploadIdAbort = exports.getFilesystemMultipart = exports.getFilesystemFindByPath = exports.getFilesystemContentSearchByPath = exports.postEnvironmentReload = exports.deleteDrivesMountByMountPath = exports.postDrivesMount = exports.getDrivesMount = exports.getCodegenRerankingByPath = exports.putCodegenFastapplyByPath = exports.getArchiveStatus = exports.postArchiveResume = exports.postArchiveExport = void 0;
4
+ exports.getWatchFilesystemByPath = exports.postUpgrade = exports.postProcessByIdentifierStdin = exports.deleteProcessByIdentifierStdin = exports.getProcessByIdentifierLogsStream = exports.getProcessByIdentifierLogs = exports.deleteProcessByIdentifierKill = exports.getProcessByIdentifier = exports.deleteProcessByIdentifier = exports.postProcess = exports.getProcess = exports.putNetworkTunnelConfig = exports.deleteNetworkTunnel = exports.getNetworkProcessByPidPorts = exports.postNetworkProcessByPidMonitor = exports.deleteNetworkProcessByPidMonitor = exports.getHealth = exports.putFilesystemTreeByPath = exports.getFilesystemTreeByPath = exports.deleteFilesystemTreeByPath = exports.putFilesystemByPath = exports.headFilesystemByPath = exports.getFilesystemByPath = exports.deleteFilesystemByPath = exports.getFilesystemSearchByPath = exports.postFilesystemMultipartInitiateByPath = exports.getFilesystemMultipartByUploadIdParts = exports.putFilesystemMultipartByUploadIdPart = exports.postFilesystemMultipartByUploadIdComplete = exports.deleteFilesystemMultipartByUploadIdAbort = exports.getFilesystemMultipart = exports.getFilesystemFindByPath = exports.getFilesystemContentSearchByPath = exports.postEnvironmentReload = exports.deleteDrivesMountByMountPath = exports.postDrivesMount = exports.getDrivesMount = exports.getCodegenRerankingByPath = exports.putCodegenFastapplyByPath = exports.getArchiveStatus = exports.postArchiveResume = exports.postArchiveExport = void 0;
5
5
  const client_fetch_1 = require("@hey-api/client-fetch");
6
6
  const client_gen_1 = require("./client.gen");
7
7
  /**
8
8
  * Export the filesystem changes to a presigned URL
9
9
  * Archives everything the sandbox changed on top of its base image and streams it, uncompressed, to a presigned S3 PUT URL. The memory of the sandbox is not archived.
10
10
  * The sandbox is quiesced first: the process list is saved (unless saveProcesses is false), every process is stopped, and the API then refuses the calls that would write to the filesystem. The freeze is not lifted afterwards, since an exported sandbox is meant to be restored elsewhere; call POST /archive/resume to lift it.
11
+ * A sandbox still frozen by an earlier export is exported as it is, with the process list that export saved.
11
12
  * Use dryRun to get the archive's content and exact size without stopping anything and without uploading.
12
13
  * Set async to start the export and answer immediately, which is what archiving a large filesystem needs: the export then reports itself through GET /archive/status.
13
14
  */
@@ -205,7 +206,7 @@ const postEnvironmentReload = (options) => {
205
206
  exports.postEnvironmentReload = postEnvironmentReload;
206
207
  /**
207
208
  * Search for text content in files
208
- * Searches for text content inside files using ripgrep. Returns matching lines with context.
209
+ * Searches for text content inside files. Returns each matching line, with the lines around it when contextLines is set.
209
210
  */
210
211
  const getFilesystemContentSearchByPath = (options) => {
211
212
  return (options.client ?? client_gen_1.client).get({
@@ -404,6 +405,23 @@ const getFilesystemByPath = (options) => {
404
405
  });
405
406
  };
406
407
  exports.getFilesystemByPath = getFilesystemByPath;
408
+ /**
409
+ * Stat a file or directory
410
+ * Returns the metadata of a file or directory as headers, with no body. This checks stat availability, not permission to read file contents or list a directory. When the path does not exist or its metadata cannot be accessed, the response is an empty 200 without the X-File-Type header.
411
+ */
412
+ const headFilesystemByPath = (options) => {
413
+ return (options.client ?? client_gen_1.client).head({
414
+ security: [
415
+ {
416
+ scheme: 'bearer',
417
+ type: 'http'
418
+ }
419
+ ],
420
+ url: '/filesystem/{path}',
421
+ ...options
422
+ });
423
+ };
424
+ exports.headFilesystemByPath = headFilesystemByPath;
407
425
  /**
408
426
  * Create or update a file or directory
409
427
  * Create or update a file or directory.
@@ -707,7 +725,10 @@ exports.getProcessByIdentifierLogs = getProcessByIdentifierLogs;
707
725
  /**
708
726
  * Stream process logs in real time
709
727
  * Streams the stdout and stderr output of a process in real time: the output so far, then live output as the process writes it. Closes when the process exits or the client disconnects.
710
- * Each output line starts with `stdout:` or `stderr:` and keeps its trailing newline. A partial line (e.g. a prompt) is sent as soon as it is written; when the process completes it, the rest follows without a new prefix. `[keepalive]` lines are sent every 30 seconds.
728
+ * By default, output is plain text with `stdout:` or `stderr:` prefixes at the start of each source stream's lines. Partial lines (e.g. prompts) are sent without waiting for a newline; their continuations have no new prefix. The other stream is not held back while a line is incomplete, and chronological order across stdout and stderr is not guaranteed.
729
+ * This format does not provide unambiguous framing: output from the other stream, or a `[keepalive]` marker sent every 30 seconds, can appear inside an unfinished line. A later continuation can therefore lack a prefix identifying its source. Do not rely on this text stream to reconstruct stdout and stderr separately; request NDJSON for source-preserving streaming, or use GET /process/{identifier}/logs for separate output snapshots.
730
+ * With `Accept: application/x-ndjson`, each line is a JSON object with `type` (`stdout`, `stderr`, `keepalive`, `restart`, `truncated`, or `error`) and optional `data`. Output records retain source identity and original bytes, including partial lines and newlines, for both retained history and live output. For `encoding: "base64"`, decode `data` before concatenating bytes per source; this occurs for binary data or a UTF-8 character split across chunks. Chunk boundaries are arbitrary and ordering is collection order, not a strict chronology across streams.
731
+ * `keepalive` has no output data. A quiet active stream sends an initial keepalive after attachment so clients can receive the response before sending stdin; subsequent keepalives are sent every 30 seconds. `restart` carries a supervisor restart notice, not process output. `truncated` reports a retention or slow-reader gap and must not be appended to stdout/stderr. `error` reports a streaming failure. The connection ends after the final process exit, including automatic restarts; there is no `result` record. Older processes without structured history return HTTP 409 for NDJSON; their text stream remains available.
711
732
  */
712
733
  const getProcessByIdentifierLogsStream = (options) => {
713
734
  return (options.client ?? client_gen_1.client).get({
@@ -787,7 +808,10 @@ const postUpgrade = (options) => {
787
808
  exports.postUpgrade = postUpgrade;
788
809
  /**
789
810
  * Stream file modification events in a directory
790
- * Streams the path of modified files (one per line) in the given directory. Closes when the client disconnects.
811
+ * Streams change events for a directory until the client disconnects.
812
+ *
813
+ * The body is JSON lines (sent with `Content-Type: text/plain`): one event object per line, e.g. `{"op":"WRITE","name":"main.go","path":"/app/src","error":null}`. `op` is the fsnotify operation (CREATE, WRITE, REMOVE, RENAME or CHMOD, several can be joined with `|`), `name` the base name of the changed entry, `path` the directory containing it, and `error` is always null. A `[keepalive]` line (not JSON) is sent every 30 seconds.
814
+ * Only the directory's direct entries are watched. To also watch every subdirectory, including ones created later, end the path with `**`. The stream reports subsequent changes without an initial snapshot. When a new directory is detected, synthetic CREATE events are emitted for entries already present inside it to cover changes before its watch was registered.
791
815
  */
792
816
  const getWatchFilesystemByPath = (options) => {
793
817
  return (options.client ?? client_gen_1.client).get({
@@ -262,7 +262,7 @@ export declare const listImages: <ThrowOnError extends boolean = false>(options?
262
262
  }, unknown, ThrowOnError>;
263
263
  /**
264
264
  * Build a container image
265
- * Builds a container image without creating a deployment. Returns a presigned URL for uploading source code. After upload, the image will be built and stored in the registry, but no agent, function, sandbox, or job will be created or updated.
265
+ * Builds or imports a container image without creating a deployment. Provide a registry image reference to download and convert an existing image, or omit image to receive a presigned URL for uploading source code. Registry imports can specify memoryMb and volumeMb for the import worker. These settings do not change the resources of workloads using the image.
266
266
  */
267
267
  export declare const createImage: <ThrowOnError extends boolean = false>(options: Options<CreateImageData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<{
268
268
  image?: string;
@@ -664,6 +664,7 @@ export declare const getWorkspaceServiceAccounts: <ThrowOnError extends boolean
664
664
  created_at?: string;
665
665
  description?: string;
666
666
  name?: string;
667
+ role?: string;
667
668
  updated_at?: string;
668
669
  }[], unknown, ThrowOnError>;
669
670
  /**
@@ -676,6 +677,7 @@ export declare const createWorkspaceServiceAccount: <ThrowOnError extends boolea
676
677
  created_at?: string;
677
678
  description?: string;
678
679
  name?: string;
680
+ role?: string;
679
681
  updated_at?: string;
680
682
  }, unknown, ThrowOnError>;
681
683
  /**
@@ -698,6 +700,7 @@ export declare const updateWorkspaceServiceAccount: <ThrowOnError extends boolea
698
700
  created_at?: string;
699
701
  description?: string;
700
702
  name?: string;
703
+ role?: string;
701
704
  updated_at?: string;
702
705
  }, unknown, ThrowOnError>;
703
706
  /**
@@ -752,7 +755,7 @@ export declare const listTemplates: <ThrowOnError extends boolean = false>(optio
752
755
  export declare const getTemplate: <ThrowOnError extends boolean = false>(options: Options<GetTemplateData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen.js").Template, unknown, ThrowOnError>;
753
756
  /**
754
757
  * List workspace team members
755
- * Returns all team members in the workspace including their roles (admin or member) and invitation status.
758
+ * Returns all team members in the workspace including their roles (admin, member or viewer) and invitation status.
756
759
  */
757
760
  export declare const listWorkspaceUsers: <ThrowOnError extends boolean = false>(options?: Options<ListWorkspaceUsersData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen.js").WorkspaceUser[], unknown, ThrowOnError>;
758
761
  /**
@@ -1041,7 +1041,7 @@ export type ExpirationPolicy = {
1041
1041
  */
1042
1042
  type?: 'ttl-idle' | 'ttl-max-age' | 'date';
1043
1043
  /**
1044
- * Duration value for TTL policies (e.g., '30m', '24h', '7d') or ISO 8601 date for date policies
1044
+ * Duration value for TTL policies (e.g., '30m', '24h', '7d', minimum '5m') or ISO 8601 date for date policies
1045
1045
  */
1046
1046
  value?: string;
1047
1047
  };
@@ -1223,9 +1223,9 @@ export type GroupWorkspaceMapping = {
1223
1223
  */
1224
1224
  groupName?: string;
1225
1225
  /**
1226
- * Role to assign in this workspace (admin or member)
1226
+ * Role to assign in this workspace (admin, member or viewer)
1227
1227
  */
1228
- role?: 'admin' | 'member';
1228
+ role?: 'admin' | 'member' | 'viewer';
1229
1229
  };
1230
1230
  export type Image = {
1231
1231
  metadata: ImageMetadata;
@@ -1715,10 +1715,18 @@ export type JobExecutionSpec = {
1715
1715
  * Number of parallel tasks
1716
1716
  */
1717
1717
  parallelism?: number;
1718
+ /**
1719
+ * Number of tasks of this execution
1720
+ */
1721
+ taskCount?: number;
1718
1722
  /**
1719
1723
  * List of execution tasks
1720
1724
  */
1721
1725
  tasks?: Array<JobExecutionTask>;
1726
+ /**
1727
+ * Where this execution's task list is stored (server-managed)
1728
+ */
1729
+ readonly tasksRef?: string;
1722
1730
  /**
1723
1731
  * Job timeout in seconds (captured at execution creation time)
1724
1732
  */
@@ -1742,6 +1750,10 @@ export type JobExecutionSpecWritable = {
1742
1750
  * Number of parallel tasks
1743
1751
  */
1744
1752
  parallelism?: number;
1753
+ /**
1754
+ * Number of tasks of this execution
1755
+ */
1756
+ taskCount?: number;
1745
1757
  /**
1746
1758
  * List of execution tasks
1747
1759
  */
@@ -3666,6 +3678,14 @@ export type SandboxDefinition = {
3666
3678
  * Icon of the definition
3667
3679
  */
3668
3680
  icon?: string;
3681
+ /**
3682
+ * Nonempty dark-mode icon URL in responses. Blank inputs use the resolved light-mode icon.
3683
+ */
3684
+ iconDark?: string;
3685
+ /**
3686
+ * Nonempty light-mode icon URL in responses. Blank inputs use icon, iconDark, then the default Hub icon.
3687
+ */
3688
+ iconLight?: string;
3669
3689
  /**
3670
3690
  * Image of the Sandbox definition
3671
3691
  */
@@ -3743,6 +3763,7 @@ export type SandboxForkRequest = {
3743
3763
  * Environment variables the fork runs with, on top of the ones the source has. A variable the source already carries takes this value in the fork, one it does not is added, and every other variable of the source is kept.
3744
3764
  */
3745
3765
  envs?: Array<Env>;
3766
+ lifecycle?: SandboxLifecycle;
3746
3767
  /**
3747
3768
  * Port to expose from the sandbox
3748
3769
  */
@@ -3889,7 +3910,7 @@ export type SandboxRuntime = {
3889
3910
  */
3890
3911
  expires?: string;
3891
3912
  /**
3892
- * Extra arguments for kernel selection. Supported keys: 'iptables', 'nfs' (mk3.0), 'tun' and 'android' (mk3.1). The android variant includes tun and iptables and cannot be combined with nfs. Android requests are rejected if routing selects mk3.0. Values: 'enabled' or 'disabled'. Determines which kernel variant the workload runs on. Immutable after creation.
3913
+ * Extra arguments for kernel selection. Supported keys: 'iptables', 'nfs' (mk3.0), 'tun', 'android' and 'landlock' (mk3.1). The android variant includes tun and iptables and cannot be combined with nfs. The landlock variant enables the Landlock LSM, includes tun and iptables, and cannot be combined with android or nfs. Android and landlock requests are rejected if routing selects mk3.0. Values: 'enabled' or 'disabled'. Determines which kernel variant the workload runs on. Immutable after creation.
3893
3914
  */
3894
3915
  extraArgs?: {
3895
3916
  [key: string]: string;
@@ -3908,7 +3929,7 @@ export type SandboxRuntime = {
3908
3929
  */
3909
3930
  terminationGracePeriodSeconds?: number;
3910
3931
  /**
3911
- * Max-age from creation: the sandbox is deleted this long after it is created, regardless of activity (not an idle timeout). Units s, m, h, d, w (e.g., '30m', '24h', '7d', '2w'). For idle-based cleanup, use a lifecycle expiration policy of type ttl-idle.
3932
+ * Max-age from creation: the sandbox is deleted this long after it is created, regardless of activity (not an idle timeout). Units s, m, h, d, w (e.g., '30m', '24h', '7d', '2w'), minimum '5m'. For idle-based cleanup, use a lifecycle expiration policy of type ttl-idle.
3912
3933
  */
3913
3934
  ttl?: string;
3914
3935
  };
@@ -4501,6 +4522,10 @@ export type TriggerConfiguration = {
4501
4522
  * The tasks configuration of the cronjob
4502
4523
  */
4503
4524
  tasks?: Array<TriggerConfigurationTask>;
4525
+ /**
4526
+ * Where this trigger's task list is stored (server-managed)
4527
+ */
4528
+ readonly tasksRef?: string;
4504
4529
  /**
4505
4530
  * The timeout in seconds for async triggers (max 900s, MK3 only)
4506
4531
  */
@@ -4813,6 +4838,10 @@ export type Workspace = TimeFields & OwnerFields & {
4813
4838
  * Workspace account id
4814
4839
  */
4815
4840
  accountId?: string;
4841
+ /**
4842
+ * Baseten team this workspace was provisioned for; absent on native workspaces
4843
+ */
4844
+ readonly basetenTeamId?: string;
4816
4845
  /**
4817
4846
  * Workspace display name
4818
4847
  */
@@ -4993,6 +5022,10 @@ export type WorkspaceUser = {
4993
5022
  * Workspace user given name
4994
5023
  */
4995
5024
  given_name?: string;
5025
+ /**
5026
+ * Whether the user has at least one verified MFA factor. Omitted when the caller is not entitled to see it (only workspace admins and owners see other members' MFA status) and for pending invitations, which have no account yet.
5027
+ */
5028
+ mfa_enabled?: boolean;
4996
5029
  /**
4997
5030
  * Workspace user role
4998
5031
  */
@@ -6353,14 +6386,22 @@ export type ListImagesResponses = {
6353
6386
  export type ListImagesResponse = ListImagesResponses[keyof ListImagesResponses];
6354
6387
  export type CreateImageData = {
6355
6388
  body: {
6389
+ /**
6390
+ * Docker configuration JSON containing credentials for the source registry.
6391
+ */
6392
+ dockerConfig?: string;
6356
6393
  /**
6357
6394
  * Runtime generation (e.g., mk3). Defaults to mk3 if not specified.
6358
6395
  */
6359
6396
  generation?: string;
6360
6397
  /**
6361
- * A pre-built Docker image reference (e.g., docker.io/myorg/myimage:latest). When provided, the build step is skipped and the image is used directly as the source for the resource runtime.
6398
+ * A pre-built Docker image reference (e.g., docker.io/myorg/myimage:latest). References with a registry hostname start an asynchronous import that downloads and converts the image for the resource runtime.
6362
6399
  */
6363
6400
  image?: string;
6401
+ /**
6402
+ * Memory for the registry import worker in MiB. Only supported when image is a registry reference. When omitted, the platform default is used.
6403
+ */
6404
+ memoryMb?: number;
6364
6405
  /**
6365
6406
  * Name of the image to build
6366
6407
  */
@@ -6369,6 +6410,14 @@ export type CreateImageData = {
6369
6410
  * Resource type (agent, function, sandbox, job)
6370
6411
  */
6371
6412
  resourceType: string;
6413
+ /**
6414
+ * Tag for the imported image. Only supported when image is a registry reference. When omitted, a tag is derived from the build inputs. Tags are immutable, so a tag that already exists is rejected. latest, pending and failed are reserved.
6415
+ */
6416
+ tag?: string;
6417
+ /**
6418
+ * Temporary scratch disk for the registry import worker in MiB. Only supported when image is a registry reference. When omitted, the platform default is used. Set to 0 to use memory-backed scratch. Positive values are not supported for HIPAA workspaces.
6419
+ */
6420
+ volumeMb?: number;
6372
6421
  };
6373
6422
  path?: never;
6374
6423
  query?: never;
@@ -6379,6 +6428,10 @@ export type CreateImageErrors = {
6379
6428
  * invalid request
6380
6429
  */
6381
6430
  400: unknown;
6431
+ /**
6432
+ * the requested tag already exists
6433
+ */
6434
+ 409: unknown;
6382
6435
  };
6383
6436
  export type CreateImageResponses = {
6384
6437
  /**
@@ -7804,7 +7857,7 @@ export type CreateSandboxData = {
7804
7857
  path?: never;
7805
7858
  query?: {
7806
7859
  /**
7807
- * If true, return existing sandbox instead of 409 error when sandbox exists and is not in FAILED/TERMINATED/TERMINATING state
7860
+ * If true, return the existing sandbox instead of a 409 when one with this name is alive. A name held by a FAILED or TERMINATED sandbox is reused, and a deletion or a concurrent creation still in flight is waited for (with backoff) so the response is the sandbox, not a conflict to retry.
7808
7861
  */
7809
7862
  createIfNotExist?: boolean;
7810
7863
  };
@@ -8713,6 +8766,10 @@ export type GetWorkspaceServiceAccountsResponses = {
8713
8766
  * Service account name
8714
8767
  */
8715
8768
  name?: string;
8769
+ /**
8770
+ * Role of the service account in the workspace
8771
+ */
8772
+ role?: string;
8716
8773
  /**
8717
8774
  * Last update timestamp
8718
8775
  */
@@ -8730,6 +8787,10 @@ export type CreateWorkspaceServiceAccountData = {
8730
8787
  * Service account name
8731
8788
  */
8732
8789
  name: string;
8790
+ /**
8791
+ * Role of the service account in the workspace. Defaults to admin on creation; unchanged on update when omitted.
8792
+ */
8793
+ role?: 'viewer' | 'member' | 'admin';
8733
8794
  };
8734
8795
  path?: never;
8735
8796
  query?: never;
@@ -8760,6 +8821,10 @@ export type CreateWorkspaceServiceAccountResponses = {
8760
8821
  * Service account name
8761
8822
  */
8762
8823
  name?: string;
8824
+ /**
8825
+ * Role of the service account in the workspace
8826
+ */
8827
+ role?: string;
8763
8828
  /**
8764
8829
  * Last update timestamp
8765
8830
  */
@@ -8816,6 +8881,10 @@ export type UpdateWorkspaceServiceAccountData = {
8816
8881
  * Service account name
8817
8882
  */
8818
8883
  name?: string;
8884
+ /**
8885
+ * Role of the service account in the workspace. Defaults to admin on creation; unchanged on update when omitted.
8886
+ */
8887
+ role?: 'viewer' | 'member' | 'admin';
8819
8888
  };
8820
8889
  path: {
8821
8890
  /**
@@ -8847,6 +8916,10 @@ export type UpdateWorkspaceServiceAccountResponses = {
8847
8916
  * Service account name
8848
8917
  */
8849
8918
  name?: string;
8919
+ /**
8920
+ * Role of the service account in the workspace
8921
+ */
8922
+ role?: string;
8850
8923
  /**
8851
8924
  * Last update timestamp
8852
8925
  */
@@ -1,5 +1,5 @@
1
1
  import { type Options as ClientOptions, type TDataShape, type Client } from '@hey-api/client-fetch';
2
- import type { PostArchiveExportData, PostArchiveExportResponse, PostArchiveResumeData, GetArchiveStatusData, PutCodegenFastapplyByPathData, GetCodegenRerankingByPathData, GetDrivesMountData, PostDrivesMountData, DeleteDrivesMountByMountPathData, PostEnvironmentReloadData, GetFilesystemContentSearchByPathData, GetFilesystemFindByPathData, GetFilesystemMultipartData, DeleteFilesystemMultipartByUploadIdAbortData, PostFilesystemMultipartByUploadIdCompleteData, PutFilesystemMultipartByUploadIdPartData, GetFilesystemMultipartByUploadIdPartsData, PostFilesystemMultipartInitiateByPathData, GetFilesystemSearchByPathData, DeleteFilesystemByPathData, GetFilesystemByPathData, PutFilesystemByPathData, DeleteFilesystemTreeByPathData, GetFilesystemTreeByPathData, PutFilesystemTreeByPathData, GetHealthData, DeleteNetworkProcessByPidMonitorData, PostNetworkProcessByPidMonitorData, GetNetworkProcessByPidPortsData, DeleteNetworkTunnelData, PutNetworkTunnelConfigData, GetProcessData, PostProcessData, DeleteProcessByIdentifierData, GetProcessByIdentifierData, DeleteProcessByIdentifierKillData, GetProcessByIdentifierLogsData, GetProcessByIdentifierLogsStreamData, DeleteProcessByIdentifierStdinData, PostProcessByIdentifierStdinData, PostUpgradeData, GetWatchFilesystemByPathData } from './types.gen';
2
+ import type { PostArchiveExportData, PostArchiveExportResponse, PostArchiveResumeData, GetArchiveStatusData, PutCodegenFastapplyByPathData, GetCodegenRerankingByPathData, GetDrivesMountData, PostDrivesMountData, DeleteDrivesMountByMountPathData, PostEnvironmentReloadData, GetFilesystemContentSearchByPathData, GetFilesystemFindByPathData, GetFilesystemMultipartData, DeleteFilesystemMultipartByUploadIdAbortData, PostFilesystemMultipartByUploadIdCompleteData, PutFilesystemMultipartByUploadIdPartData, GetFilesystemMultipartByUploadIdPartsData, PostFilesystemMultipartInitiateByPathData, GetFilesystemSearchByPathData, DeleteFilesystemByPathData, GetFilesystemByPathData, HeadFilesystemByPathData, PutFilesystemByPathData, DeleteFilesystemTreeByPathData, GetFilesystemTreeByPathData, PutFilesystemTreeByPathData, GetHealthData, DeleteNetworkProcessByPidMonitorData, PostNetworkProcessByPidMonitorData, GetNetworkProcessByPidPortsData, DeleteNetworkTunnelData, PutNetworkTunnelConfigData, GetProcessData, PostProcessData, DeleteProcessByIdentifierData, GetProcessByIdentifierData, DeleteProcessByIdentifierKillData, GetProcessByIdentifierLogsData, GetProcessByIdentifierLogsStreamData, DeleteProcessByIdentifierStdinData, PostProcessByIdentifierStdinData, PostUpgradeData, GetWatchFilesystemByPathData } from './types.gen';
3
3
  export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = ClientOptions<TData, ThrowOnError> & {
4
4
  /**
5
5
  * You can provide a client instance returned by `createClient()` instead of
@@ -17,6 +17,7 @@ export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends
17
17
  * Export the filesystem changes to a presigned URL
18
18
  * Archives everything the sandbox changed on top of its base image and streams it, uncompressed, to a presigned S3 PUT URL. The memory of the sandbox is not archived.
19
19
  * The sandbox is quiesced first: the process list is saved (unless saveProcesses is false), every process is stopped, and the API then refuses the calls that would write to the filesystem. The freeze is not lifted afterwards, since an exported sandbox is meant to be restored elsewhere; call POST /archive/resume to lift it.
20
+ * A sandbox still frozen by an earlier export is exported as it is, with the process list that export saved.
20
21
  * Use dryRun to get the archive's content and exact size without stopping anything and without uploading.
21
22
  * Set async to start the export and answer immediately, which is what archiving a large filesystem needs: the export then reports itself through GET /archive/status.
22
23
  */
@@ -94,7 +95,7 @@ export declare const deleteDrivesMountByMountPath: <ThrowOnError extends boolean
94
95
  export declare const postEnvironmentReload: <ThrowOnError extends boolean = false>(options?: Options<PostEnvironmentReloadData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").HandlerReloadResponse, import("./types.gen").ErrorResponse, ThrowOnError>;
95
96
  /**
96
97
  * Search for text content in files
97
- * Searches for text content inside files using ripgrep. Returns matching lines with context.
98
+ * Searches for text content inside files. Returns each matching line, with the lines around it when contextLines is set.
98
99
  */
99
100
  export declare const getFilesystemContentSearchByPath: <ThrowOnError extends boolean = false>(options: Options<GetFilesystemContentSearchByPathData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").ContentSearchResponse, import("./types.gen").ErrorResponse, ThrowOnError>;
100
101
  /**
@@ -148,6 +149,11 @@ export declare const deleteFilesystemByPath: <ThrowOnError extends boolean = fal
148
149
  * Get content of a file or listing of a directory. Use Accept header to control response format for files.
149
150
  */
150
151
  export declare const getFilesystemByPath: <ThrowOnError extends boolean = false>(options: Options<GetFilesystemByPathData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").File | import("./types.gen").Directory | import("./types.gen").FileWithContent | Blob, import("./types.gen").ErrorResponse, ThrowOnError>;
152
+ /**
153
+ * Stat a file or directory
154
+ * Returns the metadata of a file or directory as headers, with no body. This checks stat availability, not permission to read file contents or list a directory. When the path does not exist or its metadata cannot be accessed, the response is an empty 200 without the X-File-Type header.
155
+ */
156
+ export declare const headFilesystemByPath: <ThrowOnError extends boolean = false>(options: Options<HeadFilesystemByPathData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<unknown, unknown, ThrowOnError>;
151
157
  /**
152
158
  * Create or update a file or directory
153
159
  * Create or update a file or directory.
@@ -166,12 +172,12 @@ export declare const deleteFilesystemTreeByPath: <ThrowOnError extends boolean =
166
172
  * Get directory tree
167
173
  * Get a recursive directory tree structure starting from the specified path
168
174
  */
169
- export declare const getFilesystemTreeByPath: <ThrowOnError extends boolean = false>(options: Options<GetFilesystemTreeByPathData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").File | import("./types.gen").Directory | import("./types.gen").FileWithContent | Blob, import("./types.gen").ErrorResponse, ThrowOnError>;
175
+ export declare const getFilesystemTreeByPath: <ThrowOnError extends boolean = false>(options: Options<GetFilesystemTreeByPathData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").Directory, import("./types.gen").ErrorResponse, ThrowOnError>;
170
176
  /**
171
177
  * Create or update directory tree
172
178
  * Create or update multiple files within a directory tree structure. Idempotent: existing files are overwritten, so retrying the same request is safe.
173
179
  */
174
- export declare const putFilesystemTreeByPath: <ThrowOnError extends boolean = false>(options: Options<PutFilesystemTreeByPathData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").File | import("./types.gen").Directory | import("./types.gen").FileWithContent | Blob, import("./types.gen").ErrorResponse, ThrowOnError>;
180
+ export declare const putFilesystemTreeByPath: <ThrowOnError extends boolean = false>(options: Options<PutFilesystemTreeByPathData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").Directory, import("./types.gen").ErrorResponse, ThrowOnError>;
175
181
  /**
176
182
  * Health check
177
183
  * Returns health status and system information including upgrade count and binary details
@@ -245,7 +251,10 @@ export declare const getProcessByIdentifierLogs: <ThrowOnError extends boolean =
245
251
  /**
246
252
  * Stream process logs in real time
247
253
  * Streams the stdout and stderr output of a process in real time: the output so far, then live output as the process writes it. Closes when the process exits or the client disconnects.
248
- * Each output line starts with `stdout:` or `stderr:` and keeps its trailing newline. A partial line (e.g. a prompt) is sent as soon as it is written; when the process completes it, the rest follows without a new prefix. `[keepalive]` lines are sent every 30 seconds.
254
+ * By default, output is plain text with `stdout:` or `stderr:` prefixes at the start of each source stream's lines. Partial lines (e.g. prompts) are sent without waiting for a newline; their continuations have no new prefix. The other stream is not held back while a line is incomplete, and chronological order across stdout and stderr is not guaranteed.
255
+ * This format does not provide unambiguous framing: output from the other stream, or a `[keepalive]` marker sent every 30 seconds, can appear inside an unfinished line. A later continuation can therefore lack a prefix identifying its source. Do not rely on this text stream to reconstruct stdout and stderr separately; request NDJSON for source-preserving streaming, or use GET /process/{identifier}/logs for separate output snapshots.
256
+ * With `Accept: application/x-ndjson`, each line is a JSON object with `type` (`stdout`, `stderr`, `keepalive`, `restart`, `truncated`, or `error`) and optional `data`. Output records retain source identity and original bytes, including partial lines and newlines, for both retained history and live output. For `encoding: "base64"`, decode `data` before concatenating bytes per source; this occurs for binary data or a UTF-8 character split across chunks. Chunk boundaries are arbitrary and ordering is collection order, not a strict chronology across streams.
257
+ * `keepalive` has no output data. A quiet active stream sends an initial keepalive after attachment so clients can receive the response before sending stdin; subsequent keepalives are sent every 30 seconds. `restart` carries a supervisor restart notice, not process output. `truncated` reports a retention or slow-reader gap and must not be appended to stdout/stderr. `error` reports a streaming failure. The connection ends after the final process exit, including automatic restarts; there is no `result` record. Older processes without structured history return HTTP 409 for NDJSON; their text stream remains available.
249
258
  */
250
259
  export declare const getProcessByIdentifierLogsStream: <ThrowOnError extends boolean = false>(options: Options<GetProcessByIdentifierLogsStreamData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<string, import("./types.gen").ErrorResponse, ThrowOnError>;
251
260
  /**
@@ -269,6 +278,9 @@ export declare const postProcessByIdentifierStdin: <ThrowOnError extends boolean
269
278
  export declare const postUpgrade: <ThrowOnError extends boolean = false>(options?: Options<PostUpgradeData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").SuccessResponse, import("./types.gen").ErrorResponse, ThrowOnError>;
270
279
  /**
271
280
  * Stream file modification events in a directory
272
- * Streams the path of modified files (one per line) in the given directory. Closes when the client disconnects.
281
+ * Streams change events for a directory until the client disconnects.
282
+ *
283
+ * The body is JSON lines (sent with `Content-Type: text/plain`): one event object per line, e.g. `{"op":"WRITE","name":"main.go","path":"/app/src","error":null}`. `op` is the fsnotify operation (CREATE, WRITE, REMOVE, RENAME or CHMOD, several can be joined with `|`), `name` the base name of the changed entry, `path` the directory containing it, and `error` is always null. A `[keepalive]` line (not JSON) is sent every 30 seconds.
284
+ * Only the directory's direct entries are watched. To also watch every subdirectory, including ones created later, end the path with `**`. The stream reports subsequent changes without an initial snapshot. When a new directory is detected, synthetic CREATE events are emitted for entries already present inside it to cover changes before its watch was registered.
273
285
  */
274
286
  export declare const getWatchFilesystemByPath: <ThrowOnError extends boolean = false>(options: Options<GetWatchFilesystemByPathData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<string, import("./types.gen").ErrorResponse, ThrowOnError>;
@@ -51,6 +51,9 @@ export type ArchiveManifest = {
51
51
  };
52
52
  export type ContentSearchMatch = {
53
53
  column: number;
54
+ /**
55
+ * The matching line with up to contextLines lines before and after it, newline-separated; omitted when contextLines is 0
56
+ */
54
57
  context?: string;
55
58
  line: number;
56
59
  path: string;
@@ -350,6 +353,9 @@ export type PortMonitorRequest = {
350
353
  callback?: string;
351
354
  };
352
355
  export type ProcessLogs = {
356
+ /**
357
+ * Concatenation of the returned stdout followed by the returned stderr. Output from the two streams is not interleaved.
358
+ */
353
359
  logs: string;
354
360
  stderr: string;
355
361
  stdout: string;
@@ -590,7 +596,7 @@ export type PostArchiveExportErrors = {
590
596
  */
591
597
  400: ErrorResponse;
592
598
  /**
593
- * An export is already in progress
599
+ * An export is already in progress, or the sandbox is frozen for a restore
594
600
  */
595
601
  409: ErrorResponse;
596
602
  /**
@@ -870,6 +876,10 @@ export type GetFilesystemContentSearchByPathData = {
870
876
  * Comma-separated directory names to skip (default: node_modules,vendor,.git,dist,build,target,__pycache__,.venv,.next,coverage)
871
877
  */
872
878
  excludeDirs?: string;
879
+ /**
880
+ * Lines to include before and after each match in its context field (default: 0, max: 20; invalid values count as 0)
881
+ */
882
+ contextLines?: number;
873
883
  };
874
884
  url: '/filesystem-content-search/{path}';
875
885
  };
@@ -1276,6 +1286,23 @@ export type GetFilesystemByPathResponses = {
1276
1286
  200: Directory | FileWithContent | (Blob | File);
1277
1287
  };
1278
1288
  export type GetFilesystemByPathResponse = GetFilesystemByPathResponses[keyof GetFilesystemByPathResponses];
1289
+ export type HeadFilesystemByPathData = {
1290
+ body?: never;
1291
+ path: {
1292
+ /**
1293
+ * File or directory path
1294
+ */
1295
+ path: string;
1296
+ };
1297
+ query?: never;
1298
+ url: '/filesystem/{path}';
1299
+ };
1300
+ export type HeadFilesystemByPathResponses = {
1301
+ /**
1302
+ * Path metadata (X-File-Type is set only when stat succeeds)
1303
+ */
1304
+ 200: unknown;
1305
+ };
1279
1306
  export type PutFilesystemByPathData = {
1280
1307
  /**
1281
1308
  * File or directory details
@@ -1380,7 +1407,7 @@ export type GetFilesystemTreeByPathResponses = {
1380
1407
  /**
1381
1408
  * Directory tree
1382
1409
  */
1383
- 200: Directory | FileWithContent | (Blob | File);
1410
+ 200: Directory;
1384
1411
  };
1385
1412
  export type GetFilesystemTreeByPathResponse = GetFilesystemTreeByPathResponses[keyof GetFilesystemTreeByPathResponses];
1386
1413
  export type PutFilesystemTreeByPathData = {
@@ -1416,7 +1443,7 @@ export type PutFilesystemTreeByPathResponses = {
1416
1443
  /**
1417
1444
  * Updated directory tree
1418
1445
  */
1419
- 200: Directory | FileWithContent | (Blob | File);
1446
+ 200: Directory;
1420
1447
  };
1421
1448
  export type PutFilesystemTreeByPathResponse = PutFilesystemTreeByPathResponses[keyof PutFilesystemTreeByPathResponses];
1422
1449
  export type GetHealthData = {
@@ -1765,6 +1792,12 @@ export type GetProcessByIdentifierLogsResponses = {
1765
1792
  export type GetProcessByIdentifierLogsResponse = GetProcessByIdentifierLogsResponses[keyof GetProcessByIdentifierLogsResponses];
1766
1793
  export type GetProcessByIdentifierLogsStreamData = {
1767
1794
  body?: never;
1795
+ headers?: {
1796
+ /**
1797
+ * Explicit application/x-ndjson opts into structured records; absent or wildcard Accept retains text/plain. Supported explicit media types honor q weights, preferring NDJSON on a tie.
1798
+ */
1799
+ Accept?: string;
1800
+ };
1768
1801
  path: {
1769
1802
  /**
1770
1803
  * Process identifier (PID or name)
@@ -1775,14 +1808,18 @@ export type GetProcessByIdentifierLogsStreamData = {
1775
1808
  url: '/process/{identifier}/logs/stream';
1776
1809
  };
1777
1810
  export type GetProcessByIdentifierLogsStreamErrors = {
1811
+ /**
1812
+ * Invalid process identifier
1813
+ */
1814
+ 400: ErrorResponse;
1778
1815
  /**
1779
1816
  * Process not found
1780
1817
  */
1781
1818
  404: ErrorResponse;
1782
1819
  /**
1783
- * Unprocessable entity
1820
+ * Structured history unavailable for this older process
1784
1821
  */
1785
- 422: ErrorResponse;
1822
+ 409: ErrorResponse;
1786
1823
  /**
1787
1824
  * Internal server error
1788
1825
  */
@@ -1791,7 +1828,7 @@ export type GetProcessByIdentifierLogsStreamErrors = {
1791
1828
  export type GetProcessByIdentifierLogsStreamError = GetProcessByIdentifierLogsStreamErrors[keyof GetProcessByIdentifierLogsStreamErrors];
1792
1829
  export type GetProcessByIdentifierLogsStreamResponses = {
1793
1830
  /**
1794
- * Process output, each line prefixed with stdout: or stderr:
1831
+ * Process output as prefixed text or NDJSON records
1795
1832
  */
1796
1833
  200: string;
1797
1834
  };
@@ -1896,13 +1933,13 @@ export type GetWatchFilesystemByPathData = {
1896
1933
  body?: never;
1897
1934
  path: {
1898
1935
  /**
1899
- * Directory path to watch
1936
+ * Directory path to watch (append ** to watch subdirectories)
1900
1937
  */
1901
1938
  path: string;
1902
1939
  };
1903
1940
  query?: {
1904
1941
  /**
1905
- * Ignore patterns (comma-separated)
1942
+ * Comma-separated substrings; events whose full path contains one are skipped
1906
1943
  */
1907
1944
  ignore?: string;
1908
1945
  };
@@ -1921,7 +1958,7 @@ export type GetWatchFilesystemByPathErrors = {
1921
1958
  export type GetWatchFilesystemByPathError = GetWatchFilesystemByPathErrors[keyof GetWatchFilesystemByPathErrors];
1922
1959
  export type GetWatchFilesystemByPathResponses = {
1923
1960
  /**
1924
- * Stream of modified file paths, one per line
1961
+ * JSON lines stream of change events
1925
1962
  */
1926
1963
  200: string;
1927
1964
  };