@alienplatform/core 3.3.34 → 3.3.35

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.js CHANGED
@@ -780,6 +780,9 @@ const EcrArtifactRegistryBindingSchema = z$2.object({
780
780
  },
781
781
  get "repositoryPrefix"() {
782
782
  return BindingValueStringSchema.describe("Represents a value that can be either a concrete value, a template expression,\nor a reference to a Kubernetes Secret");
783
+ },
784
+ get "sandboxRepositoryPrefix"() {
785
+ return z$2.union([BindingValueStringSchema, z$2.null()]).optional();
783
786
  }
784
787
  }).describe("AWS ECR (Elastic Container Registry) binding configuration");
785
788
  //#endregion
@@ -1836,6 +1839,23 @@ const AwsMicrovmSandboxHeartbeatDataSchema = z$2.object({
1836
1839
  }
1837
1840
  }).describe("AWS: the image a sandbox runs from, and the lifecycle state AWS reports for it.");
1838
1841
  //#endregion
1842
+ //#region src/generated/zod/aws-sandbox-network-schema.ts
1843
+ /**
1844
+ * Generated by Kubb (https://kubb.dev/).
1845
+ * Do not edit manually.
1846
+ */
1847
+ /**
1848
+ * @description Setup network coordinates; the deployment controller verifies actual EC2 routes and CIDRs.
1849
+ */
1850
+ const AwsSandboxNetworkSchema = z$2.object({
1851
+ "gatewayCidrs": z$2.array(z$2.string()).describe("Only destinations permitted by the connector security group."),
1852
+ "gatewaySubnetIds": z$2.array(z$2.string()).describe("Dedicated NAT-routed subnets for the gateway's internal load balancer."),
1853
+ "sandboxCidrs": z$2.array(z$2.string()).describe("Source ranges permitted on the gateway proxy port."),
1854
+ "sandboxSubnetIds": z$2.array(z$2.string()).describe("Route-less connector subnet identifiers."),
1855
+ "vpcCidrs": z$2.array(z$2.string()).describe("Every associated VPC IPv4 range, denied by the gateway."),
1856
+ "workloadCidrs": z$2.array(z$2.string()).describe("Source ranges permitted on the gateway admin port.")
1857
+ }).describe("Setup network coordinates; the deployment controller verifies actual EC2 routes and CIDRs.");
1858
+ //#endregion
1839
1859
  //#region src/generated/zod/aws-network-import-data-schema.ts
1840
1860
  /**
1841
1861
  * Generated by Kubb (https://kubb.dev/).
@@ -1847,6 +1867,7 @@ const AwsMicrovmSandboxHeartbeatDataSchema = z$2.object({
1847
1867
  const AwsNetworkImportDataSchema = z$2.object({
1848
1868
  "availabilityZones": z$2.array(z$2.string()).describe("Availability zone names used by created or BYO subnets."),
1849
1869
  "cidrBlock": z$2.string().describe("VPC CIDR block when the VPC is created by this stack.").nullish(),
1870
+ "egressPublicIps": z$2.optional(z$2.array(z$2.string()).describe("Public addresses allocated to this deployment's NAT; empty when unknown.")),
1850
1871
  "eipAllocationId": z$2.string().describe("Elastic IP allocation ID backing the NAT gateway.").nullish(),
1851
1872
  "internetGatewayId": z$2.string().describe("Internet gateway ID when created by this stack.").nullish(),
1852
1873
  "isByoVpc": z$2.boolean().describe("True when the VPC is owned outside this stack."),
@@ -1855,6 +1876,9 @@ const AwsNetworkImportDataSchema = z$2.object({
1855
1876
  "privateSubnetIds": z$2.array(z$2.string()).describe("Private subnet IDs."),
1856
1877
  "publicRouteTableId": z$2.string().describe("Public route table ID.").nullish(),
1857
1878
  "publicSubnetIds": z$2.array(z$2.string()).describe("Public subnet IDs."),
1879
+ get "sandboxNetwork"() {
1880
+ return z$2.union([AwsSandboxNetworkSchema, z$2.null()]).optional();
1881
+ },
1858
1882
  "securityGroupId": z$2.string().describe("Security group ID for private workloads.").nullish(),
1859
1883
  "subnetsByFailureDomain": z$2.optional(z$2.object({}).catchall(z$2.lazy(() => AwsFailureDomainSubnetsSchema).describe("AWS subnets grouped by their real availability zone.")).describe("Exact subnet membership keyed by real availability zone.")),
1860
1884
  "vpcId": z$2.string().describe("VPC ID. Absent when default-VPC mode defers lookup to AWS at runtime.").nullish()
@@ -2161,7 +2185,7 @@ const AwsS3StorageHeartbeatDataSchema = z$2.object({
2161
2185
  "versioningStatus": z$2.string().nullish()
2162
2186
  });
2163
2187
  z$2.object({
2164
- "allowEgress": z$2.optional(z$2.boolean().describe("Whether the declaration asked for open egress.\n\nThe controller builds the binding from this, and an empty connector list cannot be read\nwithout it: a stripped `deny` import would otherwise look exactly like an open sandbox.")),
2188
+ "allowEgress": z$2.optional(z$2.boolean().describe("Whether sessions use native cloud internet without a deployment gateway.\nIsolated sessions must instead name their setup-owned connector.")),
2165
2189
  "buildRoleArn": z$2.string().describe("Role the controller passes to `CreateMicrovmImage`. Setup owns it because\n`sandbox/provision` grants the controller `iam:PassRole` and no `iam:CreateRole`.").nullish(),
2166
2190
  "bundleUri": z$2.string().describe("Bundle the controller builds the image from. Only a runtime-provisioned sandbox carries it.").nullish(),
2167
2191
  "egressConnectorArns": z$2.optional(z$2.array(z$2.string()).describe("Egress network connectors. Deleting one while MicroVMs still reference it breaks their\nnetworking, so teardown needs them named rather than rediscovered.")),
@@ -4206,6 +4230,16 @@ const ContainerCodeSchema = z$2.union([z$2.object({
4206
4230
  "type": z$2.enum(["source"])
4207
4231
  })]).describe("Specifies the source of the container's executable code.");
4208
4232
  //#endregion
4233
+ //#region src/generated/zod/container-egress-schema.ts
4234
+ /**
4235
+ * Generated by Kubb (https://kubb.dev/).
4236
+ * Do not edit manually.
4237
+ */
4238
+ /**
4239
+ * @description Outbound network restriction enforced outside the container.\nInternet access also permits this container\'s own replicas on declared TCP ports,\nown-service discovery, and the credential proxy for its own identity.\nAbsence preserves the runtime\'s existing full-network behavior.
4240
+ */
4241
+ const ContainerEgressSchema = z$2.enum(["internet"]).describe("Outbound network restriction enforced outside the container.\nInternet access also permits this container's own replicas on declared TCP ports,\nown-service discovery, and the credential proxy for its own identity.\nAbsence preserves the runtime's existing full-network behavior.");
4242
+ //#endregion
4209
4243
  //#region src/generated/zod/container-gpu-spec-schema.ts
4210
4244
  /**
4211
4245
  * Generated by Kubb (https://kubb.dev/).
@@ -4670,6 +4704,7 @@ const ContainerOutputsSchema = z$2.object({
4670
4704
  "currentReplicas": z$2.int().min(0).describe("Number of current replicas"),
4671
4705
  "desiredReplicas": z$2.int().min(0).describe("Desired number of replicas"),
4672
4706
  "internalDns": z$2.string().describe("Internal DNS name (e.g., \"api.svc\")"),
4707
+ "internalUrls": z$2.optional(z$2.object({}).catchall(z$2.string()).describe("Internal URLs keyed by port for cluster members and linking resources.")),
4673
4708
  "name": z$2.string().describe("Container name in the managed container backend"),
4674
4709
  "publicEndpoints": z$2.optional(z$2.object({}).catchall(z$2.lazy(() => PublicEndpointOutputSchema).describe("Runtime-resolved public endpoint metadata.")).describe("Public endpoints resolved for this container.")),
4675
4710
  get "replicas"() {
@@ -4891,6 +4926,9 @@ const ContainerSchema = z$2.object({
4891
4926
  get "cpu"() {
4892
4927
  return ResourceSpecSchema.describe("Resource specification with min/desired values.");
4893
4928
  },
4929
+ get "egress"() {
4930
+ return z$2.union([ContainerEgressSchema, z$2.null()]).optional();
4931
+ },
4894
4932
  "environment": z$2.optional(z$2.object({}).catchall(z$2.string()).describe("Environment variables")),
4895
4933
  "ephemeralStorage": z$2.string().describe("Ephemeral storage requirement (e.g., \"10Gi\")").nullish(),
4896
4934
  get "gpu"() {
@@ -4921,7 +4959,7 @@ const ContainerSchema = z$2.object({
4921
4959
  },
4922
4960
  "pool": z$2.string().describe("Capacity group to run on (must exist in the cluster)\nIf not specified, containers are scheduled to any available group.").nullish(),
4923
4961
  get "ports"() {
4924
- return z$2.array(ContainerPortSchema.describe("Container port configuration.")).describe("Internal container ports (at least one required).");
4962
+ return z$2.array(ContainerPortSchema.describe("Container port configuration.")).describe("Ports reachable by compute-cluster members and resources that link to this container.");
4925
4963
  },
4926
4964
  get "publicEndpoints"() {
4927
4965
  return z$2.array(PublicEndpointSchema.describe("Public endpoint configuration for port-backed workload resources.")).describe("Public endpoints exposed by the container.").optional();
@@ -4995,6 +5033,12 @@ const CreateCommandResponseSchema = z$2.object({
4995
5033
  return z$2.union([StorageUploadSchema, z$2.null()]).optional();
4996
5034
  }
4997
5035
  }).describe("Response to command creation");
5036
+ z$2.object({
5037
+ "startedAt": z$2.iso.datetime().describe("First credential failure in this phase; subsequent attempts keep this timestamp."),
5038
+ get "status"() {
5039
+ return DeploymentStatusSchema.describe("Deployment status in the deployment lifecycle.\n\nFor observe-only deployments with no release or stack state, `Running`\nmeans the Operator is attached. Connectivity comes from `lastHeartbeatAt`;\nresource health comes from inventory and resource heartbeat data.");
5040
+ }
5041
+ }).describe("A credential outage's durable retry window, scoped to its deployment phase.");
4998
5042
  //#endregion
4999
5043
  //#region src/generated/zod/gcp-custom-certificate-config-schema.ts
5000
5044
  /**
@@ -5584,6 +5628,16 @@ const DynamodbKvBindingSchema = z$2.object({
5584
5628
  }
5585
5629
  }).describe("AWS DynamoDB KV binding configuration");
5586
5630
  //#endregion
5631
+ //#region src/generated/zod/egress-policy-schema.ts
5632
+ /**
5633
+ * Generated by Kubb (https://kubb.dev/).
5634
+ * Do not edit manually.
5635
+ */
5636
+ /**
5637
+ * @description Per-sandbox outbound policy. Mail ports 25, 465 and 587 require an explicit allowlist port, such as smtp.example.com:587; internet and portless targets exclude them. This protects the deployment\'s shared outbound IP from mail abuse and blocklisting that could disrupt every tenant.
5638
+ */
5639
+ const EgressPolicySchema = z$2.union([z$2.object({ "allow": z$2.array(z$2.string()).min(0).max(4096) }), z$2.enum(["internet"])]).describe("Per-sandbox outbound policy. Mail ports 25, 465 and 587 require an explicit allowlist port, such as smtp.example.com:587; internet and portless targets exclude them. This protects the deployment's shared outbound IP from mail abuse and blocklisting that could disrupt every tenant.");
5640
+ //#endregion
5587
5641
  //#region src/generated/zod/email-dkim-token-schema.ts
5588
5642
  /**
5589
5643
  * Generated by Kubb (https://kubb.dev/).
@@ -7339,6 +7393,14 @@ const LeaseRequestSchema = z$2.object({
7339
7393
  const LeaseResponseSchema = z$2.object({ get "leases"() {
7340
7394
  return z$2.array(LeaseInfoSchema.describe("Lease information")).describe("Acquired leases (empty array if none available)");
7341
7395
  } }).describe("Response to lease acquisition");
7396
+ z$2.union([
7397
+ z$2.object({ "mode": z$2.enum(["deny"]) }),
7398
+ z$2.object({ "mode": z$2.enum(["allow"]) }),
7399
+ z$2.object({
7400
+ "domains": z$2.array(z$2.string()),
7401
+ "mode": z$2.enum(["allowDomains"])
7402
+ })
7403
+ ]).describe("Deprecated object declarations preserve their released backend behavior.");
7342
7404
  //#endregion
7343
7405
  //#region src/generated/zod/lifecycle-rule-schema.ts
7344
7406
  /**
@@ -8296,17 +8358,14 @@ const SandboxCodeSchema = z$2.union([z$2.object({
8296
8358
  * Generated by Kubb (https://kubb.dev/).
8297
8359
  * Do not edit manually.
8298
8360
  */
8299
- /**
8300
- * @description Outbound network policy for a sandbox.
8301
- */
8302
- const SandboxEgressSchema = z$2.union([
8361
+ const SandboxEgressSchema = z$2.union([z$2.union([
8303
8362
  z$2.object({ "mode": z$2.enum(["deny"]) }),
8304
8363
  z$2.object({ "mode": z$2.enum(["allow"]) }),
8305
8364
  z$2.object({
8306
- "domains": z$2.array(z$2.string()).describe("Hostnames the sandbox may reach"),
8365
+ "domains": z$2.array(z$2.string()),
8307
8366
  "mode": z$2.enum(["allowDomains"])
8308
8367
  })
8309
- ]).describe("Outbound network policy for a sandbox.");
8368
+ ]), z$2.enum(["none", "internet"])]);
8310
8369
  //#endregion
8311
8370
  //#region src/generated/zod/sandbox-lifecycle-policy-schema.ts
8312
8371
  /**
@@ -8363,8 +8422,11 @@ const SandboxSchema = z$2.object({
8363
8422
  get "code"() {
8364
8423
  return SandboxCodeSchema.describe("Specifies where the sandbox's root filesystem comes from.");
8365
8424
  },
8425
+ get "defaultPolicy"() {
8426
+ return z$2.union([EgressPolicySchema, z$2.null()]).optional();
8427
+ },
8366
8428
  get "egress"() {
8367
- return SandboxEgressSchema.describe("Outbound network policy for a sandbox.");
8429
+ return SandboxEgressSchema.describe("Outbound network policy");
8368
8430
  },
8369
8431
  "id": z$2.string().describe("Identifier for the sandbox. Must contain only alphanumeric characters, hyphens, and\nunderscores ([A-Za-z0-9-_]). Maximum 64 characters."),
8370
8432
  get "lifecycle"() {
@@ -10178,7 +10240,8 @@ var Container = class extends ResourceBuilder {
10178
10240
  }
10179
10241
  /**
10180
10242
  * Adds an internal-only port to the container.
10181
- * Automatically creates DNS records for service discovery.
10243
+ * Reachable by this compute cluster and every resource that links to this container.
10244
+ * A link grants access to all declared ports; users need a publicEndpoint.
10182
10245
  * @param port Port number (e.g., 3000, 8080, 5432).
10183
10246
  * @returns The Container builder instance.
10184
10247
  */
@@ -10227,6 +10290,17 @@ var Container = class extends ResourceBuilder {
10227
10290
  return this;
10228
10291
  }
10229
10292
  /**
10293
+ * Allows public addresses and DNS, this container's own replicas on declared
10294
+ * TCP ports, and the platform credential proxy for its own identity.
10295
+ * Service discovery resolves only this container's own service.
10296
+ * Requires security.profile = "restricted"; unsupported backends refuse the
10297
+ * plan. Without this setting, existing full network access is unchanged.
10298
+ */
10299
+ egress(policy) {
10300
+ this._config.egress = policy;
10301
+ return this;
10302
+ }
10303
+ /**
10230
10304
  * Makes an HTTP port reachable from your control plane through the manager.
10231
10305
  *
10232
10306
  * Requests to `https://<manager>/v1/deployments/<deployment>/tunnels/<container>/...`
@@ -11219,19 +11293,8 @@ var Queue = class extends ResourceBuilder {
11219
11293
  * An isolated environment for running untrusted code.
11220
11294
  *
11221
11295
  * The declaration provisions a durable parent; individual sandboxes are created and destroyed
11222
- * at runtime through the binding. Backends differ:
11223
- * - AWS: Lambda MicroVMs on Firecracker, with an Alien agent inside the image
11224
- * - Azure: Container Apps Sandboxes, whose data plane implements the API natively
11225
- * - GCP: Cloud Run sandboxes launched inside the workload's own instance
11226
- * - Kubernetes: pods under a sandboxed runtime class (gVisor or Kata)
11227
- * - Local: Docker, which shares a kernel and is therefore development-only for untrusted code
11228
- *
11229
- * Capabilities are not uniform. Call `capabilities()` on the binding and branch, or handle the
11230
- * typed error — an unsupported capability never silently succeeds. Notably GCP cannot
11231
- * reconnect to a sandbox (its id is scoped to one Cloud Run instance), Azure matches egress hostnames and AWS can pin their IPv4 addresses with privilegedSupervisor, no platform can snapshot a sandbox, and only AWS
11232
- * and Local run a command under a different identity than the process supervising it. Elsewhere the
11233
- * command shares the supervisor's user, so it can read the supervisor's environment and
11234
- * signal it, and the container is the isolation boundary.
11296
+ * at runtime through the binding. Runtime policies control each sandbox independently.
11297
+ * Unsupported policies are refused when planning the stack.
11235
11298
  *
11236
11299
  * Limits are enforced ceilings, not scheduling hints, and are validated when the stack is
11237
11300
  * planned. A platform that cannot enforce them rejects the sandbox rather than ignoring them.
@@ -11269,15 +11332,27 @@ var Sandbox = class extends ResourceBuilder {
11269
11332
  return this;
11270
11333
  }
11271
11334
  /**
11272
- * Sets the outbound network policy.
11335
+ * "none" disables outbound networking. "internet" opts into the deployment
11336
+ * gateway, public addresses only, a fixed outbound IP, connection logs and
11337
+ * per-sandbox runtime policies. Opting in requires updating deployment setup.
11338
+ * Legacy object values retain their released backend behavior and do not
11339
+ * opt into the gateway. They are deprecated in favor of the new values.
11273
11340
  */
11274
11341
  egress(egress) {
11275
11342
  this._config.egress = egress;
11276
11343
  return this;
11277
11344
  }
11278
- /** Fixes the unprivileged command identity and lets Alien's supervisor enforce egress. */
11279
- privilegedSupervisor(supervisor) {
11280
- this._config.privilegedSupervisor = supervisor;
11345
+ /**
11346
+ * @deprecated Existing supervisor enforcement is preserved. The new
11347
+ * egress("internet") enables gateway enforcement and the supervisor automatically.
11348
+ */
11349
+ privilegedSupervisor(settings) {
11350
+ this._config.privilegedSupervisor = settings;
11351
+ return this;
11352
+ }
11353
+ /** Sets the runtime policy used when create omits one; requires egress("internet"). */
11354
+ defaultPolicy(policy) {
11355
+ this._config.defaultPolicy = policy;
11281
11356
  return this;
11282
11357
  }
11283
11358
  /**