@alienplatform/core 3.3.33 → 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
  /**
@@ -5350,6 +5394,38 @@ const DaemonSchema = z$2.object({
5350
5394
  "stopGracePeriodSeconds": z$2.int().min(1).max(86400).describe("Grace period in seconds for stopping daemon instances during updates, drains, and deletes.\n\nWhen omitted, the runtime backend applies its default. Valid values are\n1 second through 24 hours.").nullish()
5351
5395
  });
5352
5396
  //#endregion
5397
+ //#region src/generated/zod/deployer-secret-command-variants-schema.ts
5398
+ /**
5399
+ * Generated by Kubb (https://kubb.dev/).
5400
+ * Do not edit manually.
5401
+ */
5402
+ /**
5403
+ * @description Commands for a shell family. Values are never sent to the control plane.
5404
+ */
5405
+ const DeployerSecretCommandVariantsSchema = z$2.object({
5406
+ "inline": z$2.string().describe("Command with a visible value placeholder; shell history can retain it."),
5407
+ "prompt": z$2.string().describe("Hidden-input command, without the value in shell history or process arguments.")
5408
+ }).describe("Commands for a shell family. Values are never sent to the control plane.");
5409
+ //#endregion
5410
+ //#region src/generated/zod/deployer-secret-commands-schema.ts
5411
+ /**
5412
+ * Generated by Kubb (https://kubb.dev/).
5413
+ * Do not edit manually.
5414
+ */
5415
+ /**
5416
+ * @description Shell-specific instructions generated beside the secret location.
5417
+ */
5418
+ const DeployerSecretCommandsSchema = z$2.object({
5419
+ "checkCommand": z$2.string().describe("Read-only identity check, valid in both shell families.").nullish(),
5420
+ "target": z$2.string().describe("Expected account, project, subscription or Kubernetes namespace.").nullish(),
5421
+ get "unix"() {
5422
+ return DeployerSecretCommandVariantsSchema.describe("Commands for a shell family. Values are never sent to the control plane.");
5423
+ },
5424
+ get "windows"() {
5425
+ return DeployerSecretCommandVariantsSchema.describe("Commands for a shell family. Values are never sent to the control plane.");
5426
+ }
5427
+ }).describe("Shell-specific instructions generated beside the secret location.");
5428
+ //#endregion
5353
5429
  //#region src/generated/zod/deployer-secret-store-schema.ts
5354
5430
  /**
5355
5431
  * Generated by Kubb (https://kubb.dev/).
@@ -5375,7 +5451,10 @@ const DeployerSecretStoreSchema = z$2.enum([
5375
5451
  * @description Where a deployer writes a vault-native secret.
5376
5452
  */
5377
5453
  const DeployerSecretLocationSchema = z$2.object({
5378
- "cliCommand": z$2.string().describe("Command that writes the value, with `<VALUE>` in place of the secret."),
5454
+ "cliCommand": z$2.string().describe("Command that prompts without echoing and writes the value through stdin."),
5455
+ get "commands"() {
5456
+ return z$2.union([DeployerSecretCommandsSchema, z$2.null()]).optional();
5457
+ },
5379
5458
  "consoleUrl": z$2.string().describe("Cloud console page where the secret is created, when the store has one.").nullish(),
5380
5459
  "deleteCommand": z$2.string().describe("Command that deletes the secret. Deleting a deployment keeps the\nsecrets the deployer wrote, since Alien never owned their values.").nullish(),
5381
5460
  "name": z$2.string().describe("Full name of the secret in that store."),
@@ -5549,6 +5628,16 @@ const DynamodbKvBindingSchema = z$2.object({
5549
5628
  }
5550
5629
  }).describe("AWS DynamoDB KV binding configuration");
5551
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
5552
5641
  //#region src/generated/zod/email-dkim-token-schema.ts
5553
5642
  /**
5554
5643
  * Generated by Kubb (https://kubb.dev/).
@@ -7304,6 +7393,14 @@ const LeaseRequestSchema = z$2.object({
7304
7393
  const LeaseResponseSchema = z$2.object({ get "leases"() {
7305
7394
  return z$2.array(LeaseInfoSchema.describe("Lease information")).describe("Acquired leases (empty array if none available)");
7306
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.");
7307
7404
  //#endregion
7308
7405
  //#region src/generated/zod/lifecycle-rule-schema.ts
7309
7406
  /**
@@ -8261,17 +8358,14 @@ const SandboxCodeSchema = z$2.union([z$2.object({
8261
8358
  * Generated by Kubb (https://kubb.dev/).
8262
8359
  * Do not edit manually.
8263
8360
  */
8264
- /**
8265
- * @description Outbound network policy for a sandbox.
8266
- */
8267
- const SandboxEgressSchema = z$2.union([
8361
+ const SandboxEgressSchema = z$2.union([z$2.union([
8268
8362
  z$2.object({ "mode": z$2.enum(["deny"]) }),
8269
8363
  z$2.object({ "mode": z$2.enum(["allow"]) }),
8270
8364
  z$2.object({
8271
- "domains": z$2.array(z$2.string()).describe("Hostnames the sandbox may reach"),
8365
+ "domains": z$2.array(z$2.string()),
8272
8366
  "mode": z$2.enum(["allowDomains"])
8273
8367
  })
8274
- ]).describe("Outbound network policy for a sandbox.");
8368
+ ]), z$2.enum(["none", "internet"])]);
8275
8369
  //#endregion
8276
8370
  //#region src/generated/zod/sandbox-lifecycle-policy-schema.ts
8277
8371
  /**
@@ -8328,8 +8422,11 @@ const SandboxSchema = z$2.object({
8328
8422
  get "code"() {
8329
8423
  return SandboxCodeSchema.describe("Specifies where the sandbox's root filesystem comes from.");
8330
8424
  },
8425
+ get "defaultPolicy"() {
8426
+ return z$2.union([EgressPolicySchema, z$2.null()]).optional();
8427
+ },
8331
8428
  get "egress"() {
8332
- return SandboxEgressSchema.describe("Outbound network policy for a sandbox.");
8429
+ return SandboxEgressSchema.describe("Outbound network policy");
8333
8430
  },
8334
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."),
8335
8432
  get "lifecycle"() {
@@ -10143,7 +10240,8 @@ var Container = class extends ResourceBuilder {
10143
10240
  }
10144
10241
  /**
10145
10242
  * Adds an internal-only port to the container.
10146
- * 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.
10147
10245
  * @param port Port number (e.g., 3000, 8080, 5432).
10148
10246
  * @returns The Container builder instance.
10149
10247
  */
@@ -10192,6 +10290,17 @@ var Container = class extends ResourceBuilder {
10192
10290
  return this;
10193
10291
  }
10194
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
+ /**
10195
10304
  * Makes an HTTP port reachable from your control plane through the manager.
10196
10305
  *
10197
10306
  * Requests to `https://<manager>/v1/deployments/<deployment>/tunnels/<container>/...`
@@ -11184,19 +11293,8 @@ var Queue = class extends ResourceBuilder {
11184
11293
  * An isolated environment for running untrusted code.
11185
11294
  *
11186
11295
  * The declaration provisions a durable parent; individual sandboxes are created and destroyed
11187
- * at runtime through the binding. Backends differ:
11188
- * - AWS: Lambda MicroVMs on Firecracker, with an Alien agent inside the image
11189
- * - Azure: Container Apps Sandboxes, whose data plane implements the API natively
11190
- * - GCP: Cloud Run sandboxes launched inside the workload's own instance
11191
- * - Kubernetes: pods under a sandboxed runtime class (gVisor or Kata)
11192
- * - Local: Docker, which shares a kernel and is therefore development-only for untrusted code
11193
- *
11194
- * Capabilities are not uniform. Call `capabilities()` on the binding and branch, or handle the
11195
- * typed error — an unsupported capability never silently succeeds. Notably GCP cannot
11196
- * 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
11197
- * and Local run a command under a different identity than the process supervising it. Elsewhere the
11198
- * command shares the supervisor's user, so it can read the supervisor's environment and
11199
- * 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.
11200
11298
  *
11201
11299
  * Limits are enforced ceilings, not scheduling hints, and are validated when the stack is
11202
11300
  * planned. A platform that cannot enforce them rejects the sandbox rather than ignoring them.
@@ -11234,15 +11332,27 @@ var Sandbox = class extends ResourceBuilder {
11234
11332
  return this;
11235
11333
  }
11236
11334
  /**
11237
- * 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.
11238
11340
  */
11239
11341
  egress(egress) {
11240
11342
  this._config.egress = egress;
11241
11343
  return this;
11242
11344
  }
11243
- /** Fixes the unprivileged command identity and lets Alien's supervisor enforce egress. */
11244
- privilegedSupervisor(supervisor) {
11245
- 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;
11246
11356
  return this;
11247
11357
  }
11248
11358
  /**