modal 0.10.1 → 0.10.2-dev.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/dist/index.d.ts CHANGED
@@ -267,10 +267,16 @@ declare enum GPUType {
267
267
  declare enum IdentityProviderType {
268
268
  IDENTITY_PROVIDER_TYPE_UNSPECIFIED = 0,
269
269
  IDENTITY_PROVIDER_TYPE_GITHUB = 1,
270
- IDENTITY_PROVIDER_TYPE_OKTA = 2,
270
+ IDENTITY_PROVIDER_TYPE_SAML = 2,
271
271
  IDENTITY_PROVIDER_TYPE_GOOGLE_OAUTH = 3,
272
272
  UNRECOGNIZED = -1
273
273
  }
274
+ declare enum LLMEngine {
275
+ LLM_ENGINE_UNSPECIFIED = 0,
276
+ LLM_ENGINE_SGLANG = 1,
277
+ LLM_ENGINE_VLLM = 2,
278
+ UNRECOGNIZED = -1
279
+ }
274
280
  declare enum MemberRole {
275
281
  MEMBER_ROLE_UNSPECIFIED = 0,
276
282
  MEMBER_ROLE_USER = 1,
@@ -340,6 +346,13 @@ declare enum SeekWhence {
340
346
  SEEK_END = 2,
341
347
  UNRECOGNIZED = -1
342
348
  }
349
+ declare enum ServerInferenceStatsStatus {
350
+ SERVER_INFERENCE_STATS_STATUS_UNSPECIFIED = 0,
351
+ SERVER_INFERENCE_STATS_STATUS_AVAILABLE = 1,
352
+ SERVER_INFERENCE_STATS_STATUS_NO_DATA = 2,
353
+ SERVER_INFERENCE_STATS_STATUS_UNAVAILABLE = 3,
354
+ UNRECOGNIZED = -1
355
+ }
343
356
  declare enum SystemErrorCode {
344
357
  SYSTEM_ERROR_CODE_UNSPECIFIED = 0,
345
358
  /** SYSTEM_ERROR_CODE_PERM - EPERM: Operation not permitted */
@@ -422,6 +435,12 @@ declare enum WebhookType {
422
435
  WEBHOOK_TYPE_WEB_SERVER = 4,
423
436
  UNRECOGNIZED = -1
424
437
  }
438
+ declare enum BlobUploadResult_Outcome {
439
+ OUTCOME_UNSPECIFIED = 0,
440
+ OUTCOME_SUCCESS = 1,
441
+ OUTCOME_FAILURE = 2,
442
+ UNRECOGNIZED = -1
443
+ }
425
444
  declare enum ClassParameterInfo_ParameterSerializationFormat {
426
445
  PARAM_SERIALIZATION_FORMAT_UNSPECIFIED = 0,
427
446
  /** PARAM_SERIALIZATION_FORMAT_PICKLE - legacy format - pickle of (args, kwargs) tuple */
@@ -543,6 +562,8 @@ interface AppCountLogsRequest {
543
562
  until: Date | undefined;
544
563
  bucketSecs: number;
545
564
  source: FileDescriptor;
565
+ /** Restrict logs to this exact Function ID, including when it is the base Function. */
566
+ parametrizedFunctionId: string;
546
567
  }
547
568
  declare const AppCountLogsRequest: MessageFns$1<AppCountLogsRequest>;
548
569
  interface AppCountLogsResponse {
@@ -621,6 +642,8 @@ interface AppFetchLogsRequest {
621
642
  taskId: string;
622
643
  sandboxId: string;
623
644
  searchText: string;
645
+ /** Restrict logs to this exact Function ID, including when it is the base Function. */
646
+ parametrizedFunctionId: string;
624
647
  }
625
648
  declare const AppFetchLogsRequest: MessageFns$1<AppFetchLogsRequest>;
626
649
  interface AppFetchLogsResponse {
@@ -649,8 +672,19 @@ interface AppGetInfoRequest {
649
672
  declare const AppGetInfoRequest: MessageFns$1<AppGetInfoRequest>;
650
673
  interface AppGetInfoResponse {
651
674
  info: AppHandleMetadata | undefined;
675
+ functionInfoSummaries: {
676
+ [key: string]: AppGetInfoResponse_FunctionInfoSummary;
677
+ };
652
678
  }
653
679
  declare const AppGetInfoResponse: MessageFns$1<AppGetInfoResponse>;
680
+ interface AppGetInfoResponse_FunctionInfoSummary {
681
+ gpuConfig: GPUConfig[];
682
+ schedule: Schedule | undefined;
683
+ /** True for Web Functions and classes with web methods; false for Servers. */
684
+ webFunction: boolean;
685
+ requiresProxyAuth?: boolean | undefined;
686
+ }
687
+ declare const AppGetInfoResponse_FunctionInfoSummary: MessageFns$1<AppGetInfoResponse_FunctionInfoSummary>;
654
688
  interface AppGetLayoutRequest {
655
689
  appId: string;
656
690
  }
@@ -933,6 +967,25 @@ interface AuthTokenGetResponse {
933
967
  token: string;
934
968
  }
935
969
  declare const AuthTokenGetResponse: MessageFns$1<AuthTokenGetResponse>;
970
+ /**
971
+ * Message representing the current (coalesced) state of the autoscaler configuration
972
+ * As well as the different sources that were used to create it.
973
+ */
974
+ interface AutoscalerConfiguration {
975
+ /** The settings that are currently in effect. */
976
+ settings: AutoscalerSettings | undefined;
977
+ /** For tracking the source of the overridden value; keys correspond to fields in `settings`. */
978
+ overrideEvents: {
979
+ [key: string]: UserActionInfo;
980
+ };
981
+ /** The default settings that are used when no static settings are provided and no overrides are in effect. */
982
+ defaultSettings: AutoscalerSettings | undefined;
983
+ /** The static settings that were used to initialize the configuration. */
984
+ staticSettings: AutoscalerSettings | undefined;
985
+ /** The merge of all overrides that were used to create the current configuration. */
986
+ overrideSettings: AutoscalerSettings | undefined;
987
+ }
988
+ declare const AutoscalerConfiguration: MessageFns$1<AutoscalerConfiguration>;
936
989
  /**
937
990
  * A collection of user-configurable settings for Function autoscaling
938
991
  * These are used for static configuration and for dynamic autoscaler updates
@@ -991,6 +1044,13 @@ interface BlobGetResponse {
991
1044
  downloadUrl: string;
992
1045
  }
993
1046
  declare const BlobGetResponse: MessageFns$1<BlobGetResponse>;
1047
+ interface BlobUploadResult {
1048
+ /** The blob id (from BlobCreateResponse) that this upload attempt targeted. */
1049
+ blobId: string;
1050
+ outcome: BlobUploadResult_Outcome;
1051
+ throughputBytesS: number;
1052
+ }
1053
+ declare const BlobUploadResult: MessageFns$1<BlobUploadResult>;
994
1054
  interface BuildFunction {
995
1055
  definition: string;
996
1056
  globals: Uint8Array;
@@ -2382,6 +2442,14 @@ interface FunctionGetResponse {
2382
2442
  function: FunctionData | undefined;
2383
2443
  }
2384
2444
  declare const FunctionGetResponse: MessageFns$1<FunctionGetResponse>;
2445
+ interface FunctionGetSchedulingParamsRequest {
2446
+ functionId: string;
2447
+ }
2448
+ declare const FunctionGetSchedulingParamsRequest: MessageFns$1<FunctionGetSchedulingParamsRequest>;
2449
+ interface FunctionGetSchedulingParamsResponse {
2450
+ autoscalerConfiguration: AutoscalerConfiguration | undefined;
2451
+ }
2452
+ declare const FunctionGetSchedulingParamsResponse: MessageFns$1<FunctionGetSchedulingParamsResponse>;
2385
2453
  interface FunctionGetSerializedRequest {
2386
2454
  functionId: string;
2387
2455
  }
@@ -2475,6 +2543,8 @@ interface FunctionHandleMetadata {
2475
2543
  supportedInputFormats: DataFormat[];
2476
2544
  supportedOutputFormats: DataFormat[];
2477
2545
  appId: string;
2546
+ /** The base Function ID for a variant, or the Function's own ID otherwise. */
2547
+ baseFunctionId: string;
2478
2548
  }
2479
2549
  declare const FunctionHandleMetadata: MessageFns$1<FunctionHandleMetadata>;
2480
2550
  interface FunctionInput {
@@ -2562,6 +2632,7 @@ interface FunctionPutInputsItem {
2562
2632
  input: FunctionInput | undefined;
2563
2633
  r2Failed: boolean;
2564
2634
  r2ThroughputBytesS: number;
2635
+ blobUploadResults: BlobUploadResult[];
2565
2636
  }
2566
2637
  declare const FunctionPutInputsItem: MessageFns$1<FunctionPutInputsItem>;
2567
2638
  interface FunctionPutInputsRequest {
@@ -3178,25 +3249,25 @@ interface OutboundPolicy {
3178
3249
  declare const OutboundPolicy: MessageFns$1<OutboundPolicy>;
3179
3250
  interface OutboundPolicy_HeaderReplacement {
3180
3251
  /**
3181
- * Domain that the header replacement is scoped to. Supports wildcards in
3252
+ * Domain that the header replacements are scoped to. Supports wildcards in
3182
3253
  * subdomain positions.
3183
3254
  */
3184
3255
  domain: string;
3185
- /** Header name to replace. */
3186
- headerName: string;
3187
3256
  /**
3188
- * Header value to replace.
3189
- *
3190
- * Supports templating with keys in a given secret_id: a $-prefixed key
3191
- * name in the secret will be replaced with the secret value. Literal $
3192
- * characters can be represented by two dollars: `$$`.
3257
+ * Reference to a secret usable in the header value templates. Can be
3258
+ * empty if no secret value is used.
3193
3259
  */
3194
- headerValue: string;
3260
+ secretId: string;
3195
3261
  /**
3196
- * Reference to a secret to use in the header_value template. Can be empty
3197
- * if no secret value is used in header_value.
3262
+ * Header name -> header value.
3263
+ *
3264
+ * Values support templating with keys in the stanza's secret_id: a
3265
+ * $-prefixed key name in the secret will be replaced with the secret
3266
+ * value. Literal $ characters can be represented by two dollars: `$$`.
3198
3267
  */
3199
- secretId: string;
3268
+ headers: {
3269
+ [key: string]: string;
3270
+ };
3200
3271
  }
3201
3272
  declare const OutboundPolicy_HeaderReplacement: MessageFns$1<OutboundPolicy_HeaderReplacement>;
3202
3273
  interface PTYInfo {
@@ -3571,6 +3642,13 @@ interface Sandbox$1 {
3571
3642
  inboundCidrAllowlist: string[];
3572
3643
  environmentVariables: StringMap | undefined;
3573
3644
  outboundPolicy?: OutboundPolicy | undefined;
3645
+ /**
3646
+ * If set, the sandbox's main container is served an X.509-SVID over a
3647
+ * SPIFFE Workload API socket, addressed by SPIFFE_ENDPOINT_SOCKET. The
3648
+ * certificate federates into a cloud account (AWS IAM Roles Anywhere).
3649
+ * Sidecars are not served one.
3650
+ */
3651
+ includeX509Svid: boolean;
3574
3652
  }
3575
3653
  declare const Sandbox$1: MessageFns$1<Sandbox$1>;
3576
3654
  interface SandboxContainerCreateV2Request {
@@ -4011,6 +4089,71 @@ interface SecretUpdateRequest_Update {
4011
4089
  value?: string | undefined;
4012
4090
  }
4013
4091
  declare const SecretUpdateRequest_Update: MessageFns$1<SecretUpdateRequest_Update>;
4092
+ interface ServerGetTimeRangeStatsRequest {
4093
+ functionId: string;
4094
+ /** Inclusive. */
4095
+ since: Date | undefined;
4096
+ /** Exclusive. */
4097
+ until: Date | undefined;
4098
+ /** Filter stats for a specific container */
4099
+ containerId?: string | undefined;
4100
+ }
4101
+ declare const ServerGetTimeRangeStatsRequest: MessageFns$1<ServerGetTimeRangeStatsRequest>;
4102
+ interface ServerGetTimeRangeStatsResponse {
4103
+ /** Inclusive. */
4104
+ since: Date | undefined;
4105
+ /** Exclusive. */
4106
+ until: Date | undefined;
4107
+ requestCount: number;
4108
+ requestCountByStatusCode: ServerGetTimeRangeStatsResponse_ServerStatusCodeCount[];
4109
+ requestRatePerSecond: number;
4110
+ /** Metrics include request_latency, subject to change as requirements evolve. */
4111
+ requestPercentileStats: {
4112
+ [key: string]: StatsPercentileDistribution;
4113
+ };
4114
+ /**
4115
+ * Metrics include startup_time, cpu_usage, memory_usage, and
4116
+ * gpu_utilization, subject to change as requirements evolve.
4117
+ */
4118
+ containerPercentileStats: {
4119
+ [key: string]: StatsPercentileDistribution;
4120
+ };
4121
+ /** Absent when the image does not contain a supported inference engine. */
4122
+ inference: ServerGetTimeRangeStatsResponse_ServerInferenceStats | undefined;
4123
+ /**
4124
+ * Container lifecycle counts. Started and errored containers are counted when
4125
+ * the corresponding event occurs in the requested time range. Creating containers
4126
+ * were enqueued but had not started or finished at the exclusive end of the range.
4127
+ */
4128
+ containerStartedCount: number;
4129
+ containerErrorCount: number;
4130
+ containerCreatingAtEndCount: number;
4131
+ }
4132
+ declare const ServerGetTimeRangeStatsResponse: MessageFns$1<ServerGetTimeRangeStatsResponse>;
4133
+ interface ServerGetTimeRangeStatsResponse_ServerInferenceStats {
4134
+ engine: LLMEngine;
4135
+ status: ServerInferenceStatsStatus;
4136
+ /**
4137
+ * Metrics include time_to_first_token, inter_token_latency, and
4138
+ * end_to_end_latency, subject to change as requirements evolve.
4139
+ */
4140
+ percentileStats: {
4141
+ [key: string]: StatsPercentileDistribution;
4142
+ };
4143
+ /**
4144
+ * Metrics include input_tokens_per_second, cached_input_tokens_per_second,
4145
+ * and output_tokens_per_second, subject to change as requirements evolve.
4146
+ */
4147
+ scalarStats: {
4148
+ [key: string]: number;
4149
+ };
4150
+ }
4151
+ declare const ServerGetTimeRangeStatsResponse_ServerInferenceStats: MessageFns$1<ServerGetTimeRangeStatsResponse_ServerInferenceStats>;
4152
+ interface ServerGetTimeRangeStatsResponse_ServerStatusCodeCount {
4153
+ statusCode: number;
4154
+ count: number;
4155
+ }
4156
+ declare const ServerGetTimeRangeStatsResponse_ServerStatusCodeCount: MessageFns$1<ServerGetTimeRangeStatsResponse_ServerStatusCodeCount>;
4014
4157
  interface ServiceUser {
4015
4158
  name: string;
4016
4159
  tokenId: string;
@@ -4362,6 +4505,15 @@ interface UploadUrlList {
4362
4505
  items: string[];
4363
4506
  }
4364
4507
  declare const UploadUrlList: MessageFns$1<UploadUrlList>;
4508
+ /** Used for capturing context about an action performed by a user */
4509
+ interface UserActionInfo {
4510
+ userId: string;
4511
+ serviceUserId: string;
4512
+ timestamp: number;
4513
+ /** Resolved display name, could be a user or service user. */
4514
+ requestedBy: string;
4515
+ }
4516
+ declare const UserActionInfo: MessageFns$1<UserActionInfo>;
4365
4517
  interface UserGroupEnvironmentSetRequest {
4366
4518
  environmentId: string;
4367
4519
  userGroupId: string;
@@ -4683,10 +4835,13 @@ interface WebhookToken {
4683
4835
  tokenId: string;
4684
4836
  createdAt: number;
4685
4837
  scoped: boolean;
4838
+ name: string;
4839
+ createdBy: UserIdentity | undefined;
4686
4840
  }
4687
4841
  declare const WebhookToken: MessageFns$1<WebhookToken>;
4688
4842
  interface WebhookTokenCreateRequest {
4689
4843
  scoped: boolean;
4844
+ name: string;
4690
4845
  }
4691
4846
  declare const WebhookTokenCreateRequest: MessageFns$1<WebhookTokenCreateRequest>;
4692
4847
  interface WebhookTokenEnvironmentAddRequest {
@@ -4813,6 +4968,18 @@ interface WorkspaceSetDefaultEnvironmentRequest {
4813
4968
  environmentName: string;
4814
4969
  }
4815
4970
  declare const WorkspaceSetDefaultEnvironmentRequest: MessageFns$1<WorkspaceSetDefaultEnvironmentRequest>;
4971
+ interface WorkspaceSetDefaultEnvironmentSettingsRequest {
4972
+ /**
4973
+ * Omitted = no-op. INHERIT clears the workspace default so environments
4974
+ * with no override have no block. Rejects UNSPECIFIED.
4975
+ */
4976
+ blockUnauthenticatedResources?: EnvironmentBlockUnauthenticatedResources | undefined;
4977
+ }
4978
+ declare const WorkspaceSetDefaultEnvironmentSettingsRequest: MessageFns$1<WorkspaceSetDefaultEnvironmentSettingsRequest>;
4979
+ interface WorkspaceSetDefaultEnvironmentSettingsResponse {
4980
+ defaultEnvironmentSettings: EnvironmentSettings | undefined;
4981
+ }
4982
+ declare const WorkspaceSetDefaultEnvironmentSettingsResponse: MessageFns$1<WorkspaceSetDefaultEnvironmentSettingsResponse>;
4816
4983
  interface WorkspaceSetImageBuilderVersionRequest {
4817
4984
  newImageBuilderVersion: string;
4818
4985
  }
@@ -5689,6 +5856,14 @@ declare const ModalClientDefinition: {
5689
5856
  readonly responseStream: false;
5690
5857
  readonly options: {};
5691
5858
  };
5859
+ readonly functionGetSchedulingParams: {
5860
+ readonly name: "FunctionGetSchedulingParams";
5861
+ readonly requestType: MessageFns$1<FunctionGetSchedulingParamsRequest>;
5862
+ readonly requestStream: false;
5863
+ readonly responseType: MessageFns$1<FunctionGetSchedulingParamsResponse>;
5864
+ readonly responseStream: false;
5865
+ readonly options: {};
5866
+ };
5692
5867
  readonly functionGetSerialized: {
5693
5868
  readonly name: "FunctionGetSerialized";
5694
5869
  readonly requestType: MessageFns$1<FunctionGetSerializedRequest>;
@@ -6363,6 +6538,15 @@ declare const ModalClientDefinition: {
6363
6538
  readonly responseStream: false;
6364
6539
  readonly options: {};
6365
6540
  };
6541
+ /** Servers */
6542
+ readonly serverGetTimeRangeStats: {
6543
+ readonly name: "ServerGetTimeRangeStats";
6544
+ readonly requestType: MessageFns$1<ServerGetTimeRangeStatsRequest>;
6545
+ readonly requestStream: false;
6546
+ readonly responseType: MessageFns$1<ServerGetTimeRangeStatsResponse>;
6547
+ readonly responseStream: false;
6548
+ readonly options: {};
6549
+ };
6366
6550
  /** Service users */
6367
6551
  readonly serviceUserList: {
6368
6552
  readonly name: "ServiceUserList";
@@ -6813,6 +6997,14 @@ declare const ModalClientDefinition: {
6813
6997
  readonly responseStream: false;
6814
6998
  readonly options: {};
6815
6999
  };
7000
+ readonly workspaceSetDefaultEnvironmentSettings: {
7001
+ readonly name: "WorkspaceSetDefaultEnvironmentSettings";
7002
+ readonly requestType: MessageFns$1<WorkspaceSetDefaultEnvironmentSettingsRequest>;
7003
+ readonly requestStream: false;
7004
+ readonly responseType: MessageFns$1<WorkspaceSetDefaultEnvironmentSettingsResponse>;
7005
+ readonly responseStream: false;
7006
+ readonly options: {};
7007
+ };
6816
7008
  readonly workspaceSetImageBuilderVersion: {
6817
7009
  readonly name: "WorkspaceSetImageBuilderVersion";
6818
7010
  readonly requestType: MessageFns$1<WorkspaceSetImageBuilderVersionRequest>;
@@ -8490,6 +8682,8 @@ declare class SandboxFilesystem {
8490
8682
  type SandboxSidecarCommandRouter = Pick<TaskCommandRouterClientImpl, "containerCreate" | "containerGet" | "containerList" | "containerTerminate" | "containerWait" | "mountDirectory" | "snapshotDirectory" | "unmountDirectory">;
8491
8683
  type SandboxSidecarAccess = {
8492
8684
  client: ModalClient;
8685
+ sandboxId: string;
8686
+ ensureAttached(): void;
8493
8687
  exec(command: string[], params: SandboxExecParams | undefined, containerId: string): Promise<ContainerProcess>;
8494
8688
  commandRouter(): Promise<[string, SandboxSidecarCommandRouter]>;
8495
8689
  reloadVolumes(containerId: string, params: SidecarReloadVolumesParams | undefined): Promise<void>;