@alienplatform/core 1.3.5 → 1.4.0
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/.turbo/turbo-build.log +15 -15
- package/AGENTS.md +3 -3
- package/dist/index.d.ts +22033 -2518
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +212 -66
- package/dist/index.js.map +1 -1
- package/dist/stack.js +4467 -706
- package/dist/stack.js.map +1 -1
- package/dist/tests/index.d.ts +1 -1
- package/dist/tests/index.js +1 -1
- package/dist/tests/index.js.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/__snapshots__/stack.test.ts.snap +23 -15
- package/src/__tests__/error.test.ts +1 -1
- package/src/__tests__/stack.test.ts +42 -23
- package/src/container.ts +21 -8
- package/src/daemon.ts +170 -0
- package/src/error.ts +2 -2
- package/src/generated/index.ts +391 -9
- package/src/generated/schemas/agentStatus.json +1 -1
- package/src/generated/schemas/alienEvent.json +1 -1
- package/src/generated/schemas/artifactRegistryHeartbeatData.json +1 -0
- package/src/generated/schemas/artifactRegistryHeartbeatStatus.json +1 -0
- package/src/generated/schemas/awsArtifactRegistryImportData.json +1 -0
- package/src/generated/schemas/awsBuildImportData.json +1 -0
- package/src/generated/schemas/awsCodeBuildHeartbeatData.json +1 -0
- package/src/generated/schemas/awsComputeClusterHeartbeatData.json +1 -0
- package/src/generated/schemas/awsComputeClusterImportData.json +1 -0
- package/src/generated/schemas/awsDaemonHeartbeatData.json +1 -0
- package/src/generated/schemas/awsDynamoDbKeySchemaElement.json +1 -0
- package/src/generated/schemas/awsDynamoDbKvHeartbeatData.json +1 -0
- package/src/generated/schemas/awsEcrArtifactRegistryHeartbeatData.json +1 -0
- package/src/generated/schemas/awsEcrRepositoryHeartbeatData.json +1 -0
- package/src/generated/schemas/awsIamRoleServiceAccountHeartbeatData.json +1 -0
- package/src/generated/schemas/awsKvImportData.json +1 -0
- package/src/generated/schemas/awsLambdaWorkerHeartbeatData.json +1 -0
- package/src/generated/schemas/awsNetworkImportData.json +1 -0
- package/src/generated/schemas/awsParameterStoreVaultHeartbeatData.json +1 -0
- package/src/generated/schemas/awsPermissionEffect.json +1 -0
- package/src/generated/schemas/awsPlatformPermission.json +1 -1
- package/src/generated/schemas/awsQueueImportData.json +1 -0
- package/src/generated/schemas/awsRemoteStackManagementHeartbeatData.json +1 -0
- package/src/generated/schemas/awsRemoteStackManagementImportData.json +1 -0
- package/src/generated/schemas/awsS3StorageHeartbeatData.json +1 -0
- package/src/generated/schemas/awsServiceAccountImportData.json +1 -0
- package/src/generated/schemas/awsSqsQueueHeartbeatData.json +1 -0
- package/src/generated/schemas/awsStorageImportData.json +1 -0
- package/src/generated/schemas/awsVaultImportData.json +1 -0
- package/src/generated/schemas/awsVpcNetworkHeartbeatData.json +1 -0
- package/src/generated/schemas/awsWorkerImportData.json +1 -0
- package/src/generated/schemas/azureArtifactRegistryImportData.json +1 -0
- package/src/generated/schemas/azureBlobStorageHeartbeatData.json +1 -0
- package/src/generated/schemas/azureBuildImportData.json +1 -0
- package/src/generated/schemas/azureComputeClusterHeartbeatData.json +1 -0
- package/src/generated/schemas/azureComputeClusterImportData.json +1 -0
- package/src/generated/schemas/azureContainerAppsBuildHeartbeatData.json +1 -0
- package/src/generated/schemas/azureContainerAppsEnvironmentHeartbeatData.json +1 -0
- package/src/generated/schemas/azureContainerAppsEnvironmentHeartbeatStatus.json +1 -0
- package/src/generated/schemas/azureContainerAppsEnvironmentImportData.json +1 -0
- package/src/generated/schemas/azureContainerAppsEnvironmentWorkloadProfile.json +1 -0
- package/src/generated/schemas/azureContainerAppsWorkerHeartbeatData.json +1 -0
- package/src/generated/schemas/azureContainerRegistryHeartbeatData.json +1 -0
- package/src/generated/schemas/azureDaemonHeartbeatData.json +1 -0
- package/src/generated/schemas/azureKeyVaultHeartbeatData.json +1 -0
- package/src/generated/schemas/azureKvImportData.json +1 -0
- package/src/generated/schemas/azureManagedIdentityServiceAccountHeartbeatData.json +1 -0
- package/src/generated/schemas/azureManagementConfig.json +1 -1
- package/src/generated/schemas/azureNetworkImportData.json +1 -0
- package/src/generated/schemas/azurePlatformPermission.json +1 -1
- package/src/generated/schemas/azureQueueImportData.json +1 -0
- package/src/generated/schemas/azureRemoteStackManagementHeartbeatData.json +1 -0
- package/src/generated/schemas/azureRemoteStackManagementImportData.json +1 -0
- package/src/generated/schemas/azureResourceGroupHeartbeatData.json +1 -0
- package/src/generated/schemas/azureResourceGroupHeartbeatStatus.json +1 -0
- package/src/generated/schemas/azureResourceGroupImportData.json +1 -0
- package/src/generated/schemas/azureResourceProviderActivationHeartbeatData.json +1 -0
- package/src/generated/schemas/azureServiceAccountImportData.json +1 -0
- package/src/generated/schemas/azureServiceActivationImportData.json +1 -0
- package/src/generated/schemas/azureServiceBusNamespaceHeartbeatData.json +1 -0
- package/src/generated/schemas/azureServiceBusNamespaceImportData.json +1 -0
- package/src/generated/schemas/azureServiceBusQueueHeartbeatData.json +1 -0
- package/src/generated/schemas/azureStorageAccountEndpoints.json +1 -0
- package/src/generated/schemas/azureStorageAccountHeartbeatData.json +1 -0
- package/src/generated/schemas/azureStorageAccountImportData.json +1 -0
- package/src/generated/schemas/azureStorageImportData.json +1 -0
- package/src/generated/schemas/azureTableKvHeartbeatData.json +1 -0
- package/src/generated/schemas/azureVaultImportData.json +1 -0
- package/src/generated/schemas/azureVnetNetworkHeartbeatData.json +1 -0
- package/src/generated/schemas/azureWorkerImportData.json +1 -0
- package/src/generated/schemas/baseResource.json +1 -1
- package/src/generated/schemas/baseResourceOutputs.json +1 -1
- package/src/generated/schemas/build.json +1 -1
- package/src/generated/schemas/buildHeartbeatData.json +1 -0
- package/src/generated/schemas/buildHeartbeatStatus.json +1 -0
- package/src/generated/schemas/computeCapacityBlocker.json +1 -0
- package/src/generated/schemas/computeCapacityBlockerCategory.json +1 -0
- package/src/generated/schemas/computeCapacityGroupStatus.json +1 -0
- package/src/generated/schemas/computeCapacityRecommendation.json +1 -0
- package/src/generated/schemas/computeClusterHeartbeatData.json +1 -0
- package/src/generated/schemas/computeClusterHeartbeatStatus.json +1 -0
- package/src/generated/schemas/container.json +1 -1
- package/src/generated/schemas/containerHeartbeatData.json +1 -0
- package/src/generated/schemas/containerOutputs.json +1 -1
- package/src/generated/schemas/containerStatus.json +1 -1
- package/src/generated/schemas/customCertificateConfig.json +1 -1
- package/src/generated/schemas/customDomainConfig.json +1 -1
- package/src/generated/schemas/daemon.json +1 -0
- package/src/generated/schemas/daemonCode.json +1 -0
- package/src/generated/schemas/daemonHeartbeatData.json +1 -0
- package/src/generated/schemas/daemonOutputs.json +1 -0
- package/src/generated/schemas/devResourceInfo.json +1 -1
- package/src/generated/schemas/devStatus.json +1 -1
- package/src/generated/schemas/domainSettings.json +1 -1
- package/src/generated/schemas/eventChange.json +1 -1
- package/src/generated/schemas/gcpArtifactRegistryHeartbeatData.json +1 -0
- package/src/generated/schemas/gcpArtifactRegistryImportData.json +1 -0
- package/src/generated/schemas/gcpBuildImportData.json +1 -0
- package/src/generated/schemas/gcpCloudBuildHeartbeatData.json +1 -0
- package/src/generated/schemas/gcpCloudRunWorkerHeartbeatData.json +1 -0
- package/src/generated/schemas/gcpCloudStorageHeartbeatData.json +1 -0
- package/src/generated/schemas/gcpComputeClusterHeartbeatData.json +1 -0
- package/src/generated/schemas/gcpComputeClusterImportData.json +1 -0
- package/src/generated/schemas/gcpDaemonHeartbeatData.json +1 -0
- package/src/generated/schemas/gcpFirestoreKvHeartbeatData.json +1 -0
- package/src/generated/schemas/gcpKvImportData.json +1 -0
- package/src/generated/schemas/gcpNetworkImportData.json +1 -0
- package/src/generated/schemas/gcpPlatformPermission.json +1 -1
- package/src/generated/schemas/gcpPubSubQueueHeartbeatData.json +1 -0
- package/src/generated/schemas/gcpQueueImportData.json +1 -0
- package/src/generated/schemas/gcpRemoteStackManagementHeartbeatData.json +1 -0
- package/src/generated/schemas/gcpRemoteStackManagementImportData.json +1 -0
- package/src/generated/schemas/gcpSecretManagerVaultHeartbeatData.json +1 -0
- package/src/generated/schemas/gcpServiceAccountHeartbeatData.json +1 -0
- package/src/generated/schemas/gcpServiceAccountImportData.json +1 -0
- package/src/generated/schemas/gcpServiceActivationImportData.json +1 -0
- package/src/generated/schemas/gcpServiceUsageActivationHeartbeatData.json +1 -0
- package/src/generated/schemas/gcpStorageImportData.json +1 -0
- package/src/generated/schemas/gcpVaultImportData.json +1 -0
- package/src/generated/schemas/gcpVpcNetworkHeartbeatData.json +1 -0
- package/src/generated/schemas/gcpWorkerImportData.json +1 -0
- package/src/generated/schemas/heartbeatBackend.json +1 -0
- package/src/generated/schemas/heartbeatCollectionIssue.json +1 -0
- package/src/generated/schemas/heartbeatCollectionIssueReason.json +1 -0
- package/src/generated/schemas/heartbeatIssueSeverity.json +1 -0
- package/src/generated/schemas/horizonContainerHeartbeatData.json +1 -0
- package/src/generated/schemas/horizonWorkloadSchedulingMode.json +1 -0
- package/src/generated/schemas/importSourceKind.json +1 -0
- package/src/generated/schemas/importedResource.json +1 -0
- package/src/generated/schemas/ingress.json +1 -1
- package/src/generated/schemas/kubernetesBuildHeartbeatData.json +1 -0
- package/src/generated/schemas/kubernetesCertificateMode.json +1 -0
- package/src/generated/schemas/kubernetesCloudReference.json +1 -0
- package/src/generated/schemas/kubernetesClusterHeartbeatData.json +1 -0
- package/src/generated/schemas/kubernetesClusterNodeStatus.json +1 -0
- package/src/generated/schemas/kubernetesClusterOwnership.json +1 -0
- package/src/generated/schemas/kubernetesClusterSettings.json +1 -0
- package/src/generated/schemas/kubernetesContainerHeartbeatData.json +1 -0
- package/src/generated/schemas/kubernetesCustomCertificateConfig.json +1 -0
- package/src/generated/schemas/kubernetesDaemonHeartbeatData.json +1 -0
- package/src/generated/schemas/kubernetesEventInvolvedObject.json +1 -0
- package/src/generated/schemas/kubernetesEventSnapshot.json +1 -0
- package/src/generated/schemas/kubernetesEventSource.json +1 -0
- package/src/generated/schemas/kubernetesExposureSettings.json +1 -0
- package/src/generated/schemas/kubernetesGatewayRouteProfile.json +1 -0
- package/src/generated/schemas/kubernetesIngressRouteProfile.json +1 -0
- package/src/generated/schemas/kubernetesNodeConditionStatus.json +1 -0
- package/src/generated/schemas/kubernetesNodeResources.json +1 -0
- package/src/generated/schemas/kubernetesNodeUsage.json +1 -0
- package/src/generated/schemas/kubernetesOwnerReference.json +1 -0
- package/src/generated/schemas/kubernetesPodRuntimeUnitStatus.json +1 -0
- package/src/generated/schemas/kubernetesRouteProfile.json +1 -0
- package/src/generated/schemas/kubernetesRouteProviderOptions.json +1 -0
- package/src/generated/schemas/kubernetesSecretVaultHeartbeatData.json +1 -0
- package/src/generated/schemas/kubernetesSettings.json +1 -0
- package/src/generated/schemas/kubernetesTlsSecretRef.json +1 -0
- package/src/generated/schemas/kubernetesWorkerHeartbeatData.json +1 -0
- package/src/generated/schemas/kubernetesWorkloadCondition.json +1 -0
- package/src/generated/schemas/kubernetesWorkloadKind.json +1 -0
- package/src/generated/schemas/kubernetesWorkloadStatus.json +1 -0
- package/src/generated/schemas/kvHeartbeatData.json +1 -0
- package/src/generated/schemas/kvHeartbeatStatus.json +1 -0
- package/src/generated/schemas/localArtifactRegistryHeartbeatData.json +1 -0
- package/src/generated/schemas/localComputeClusterHeartbeatData.json +1 -0
- package/src/generated/schemas/localContainerHeartbeatData.json +1 -0
- package/src/generated/schemas/localDaemonHeartbeatData.json +1 -0
- package/src/generated/schemas/localKvHeartbeatData.json +1 -0
- package/src/generated/schemas/localQueueHeartbeatData.json +1 -0
- package/src/generated/schemas/localRuntimeEventSnapshot.json +1 -0
- package/src/generated/schemas/localRuntimeEventSubject.json +1 -0
- package/src/generated/schemas/localRuntimeUnitKind.json +1 -0
- package/src/generated/schemas/localRuntimeUnitStatus.json +1 -0
- package/src/generated/schemas/localServiceAccountHeartbeatData.json +1 -0
- package/src/generated/schemas/localStorageHeartbeatData.json +1 -0
- package/src/generated/schemas/localVaultHeartbeatData.json +1 -0
- package/src/generated/schemas/localWorkerHeartbeatData.json +1 -0
- package/src/generated/schemas/managedRuntimeEventInvolvedObject.json +1 -0
- package/src/generated/schemas/managedRuntimeEventSnapshot.json +1 -0
- package/src/generated/schemas/managedRuntimeEventSource.json +1 -0
- package/src/generated/schemas/managedRuntimeUnitStatus.json +1 -0
- package/src/generated/schemas/managementConfig.json +1 -1
- package/src/generated/schemas/managementPermissions.json +1 -1
- package/src/generated/schemas/metricSample.json +1 -0
- package/src/generated/schemas/metricUnit.json +1 -0
- package/src/generated/schemas/networkHeartbeatData.json +1 -0
- package/src/generated/schemas/networkHeartbeatStatus.json +1 -0
- package/src/generated/schemas/observedCounts.json +1 -0
- package/src/generated/schemas/observedHealth.json +1 -0
- package/src/generated/schemas/permissionGrant.json +1 -1
- package/src/generated/schemas/permissionProfile.json +1 -1
- package/src/generated/schemas/permissionSet.json +1 -1
- package/src/generated/schemas/permissionSetReference.json +1 -1
- package/src/generated/schemas/permissionsConfig.json +1 -1
- package/src/generated/schemas/persistentStorage.json +1 -1
- package/src/generated/schemas/platformPermissions.json +1 -1
- package/src/generated/schemas/providerFleetStatus.json +1 -0
- package/src/generated/schemas/providerLifecycleState.json +1 -0
- package/src/generated/schemas/queueHeartbeatData.json +1 -0
- package/src/generated/schemas/queueHeartbeatStatus.json +1 -0
- package/src/generated/schemas/rawHeartbeatSnippet.json +1 -0
- package/src/generated/schemas/rawHeartbeatSnippetFormat.json +1 -0
- package/src/generated/schemas/readinessProbe.json +1 -1
- package/src/generated/schemas/remoteStackManagementHeartbeatData.json +1 -0
- package/src/generated/schemas/remoteStackManagementHeartbeatStatus.json +1 -0
- package/src/generated/schemas/resourceEntry.json +1 -1
- package/src/generated/schemas/resourceHeartbeat.json +1 -0
- package/src/generated/schemas/resourceHeartbeatData.json +1 -0
- package/src/generated/schemas/resourceRef.json +1 -1
- package/src/generated/schemas/resourceType.json +1 -1
- package/src/generated/schemas/serviceAccount.json +1 -1
- package/src/generated/schemas/serviceAccountHeartbeatData.json +1 -0
- package/src/generated/schemas/serviceAccountHeartbeatStatus.json +1 -0
- package/src/generated/schemas/serviceActivationHeartbeatData.json +1 -0
- package/src/generated/schemas/serviceActivationHeartbeatStatus.json +1 -0
- package/src/generated/schemas/stack.json +1 -1
- package/src/generated/schemas/stackImportRequest.json +1 -0
- package/src/generated/schemas/stackImportResponse.json +1 -0
- package/src/generated/schemas/stackResourceState.json +1 -1
- package/src/generated/schemas/stackSettings.json +1 -1
- package/src/generated/schemas/stackState.json +1 -1
- package/src/generated/schemas/storageHeartbeatData.json +1 -0
- package/src/generated/schemas/storageHeartbeatStatus.json +1 -0
- package/src/generated/schemas/value.json +1 -0
- package/src/generated/schemas/vault.json +1 -1
- package/src/generated/schemas/vaultHeartbeatData.json +1 -0
- package/src/generated/schemas/vaultHeartbeatStatus.json +1 -0
- package/src/generated/schemas/worker.json +1 -0
- package/src/generated/schemas/workerCode.json +1 -0
- package/src/generated/schemas/workerHeartbeatData.json +1 -0
- package/src/generated/schemas/workerOutputs.json +1 -0
- package/src/generated/schemas/workerTrigger.json +1 -0
- package/src/generated/schemas/workloadHeartbeatStatus.json +1 -0
- package/src/generated/schemas/workloadReplicaStatus.json +1 -0
- package/src/generated/zod/agent-status-schema.ts +1 -1
- package/src/generated/zod/alien-event-schema.ts +5 -4
- package/src/generated/zod/artifact-registry-heartbeat-data-schema.ts +22 -0
- package/src/generated/zod/artifact-registry-heartbeat-status-schema.ts +26 -0
- package/src/generated/zod/aws-artifact-registry-import-data-schema.ts +21 -0
- package/src/generated/zod/aws-build-import-data-schema.ts +19 -0
- package/src/generated/zod/aws-code-build-heartbeat-data-schema.ts +35 -0
- package/src/generated/zod/aws-compute-cluster-heartbeat-data-schema.ts +37 -0
- package/src/generated/zod/aws-compute-cluster-import-data-schema.ts +17 -0
- package/src/generated/zod/aws-daemon-heartbeat-data-schema.ts +35 -0
- package/src/generated/zod/aws-dynamo-db-key-schema-element-schema.ts +13 -0
- package/src/generated/zod/aws-dynamo-db-kv-heartbeat-data-schema.ts +38 -0
- package/src/generated/zod/aws-ecr-artifact-registry-heartbeat-data-schema.ts +27 -0
- package/src/generated/zod/aws-ecr-repository-heartbeat-data-schema.ts +20 -0
- package/src/generated/zod/aws-iam-role-service-account-heartbeat-data-schema.ts +34 -0
- package/src/generated/zod/aws-kv-import-data-schema.ts +16 -0
- package/src/generated/zod/aws-lambda-worker-heartbeat-data-schema.ts +34 -0
- package/src/generated/zod/aws-network-import-data-schema.ts +26 -0
- package/src/generated/zod/aws-parameter-store-vault-heartbeat-data-schema.ts +27 -0
- package/src/generated/zod/aws-permission-effect-schema.ts +10 -0
- package/src/generated/zod/aws-platform-permission-schema.ts +7 -1
- package/src/generated/zod/aws-queue-import-data-schema.ts +17 -0
- package/src/generated/zod/aws-remote-stack-management-heartbeat-data-schema.ts +18 -0
- package/src/generated/zod/aws-remote-stack-management-import-data-schema.ts +17 -0
- package/src/generated/zod/aws-s3-storage-heartbeat-data-schema.ts +31 -0
- package/src/generated/zod/aws-service-account-import-data-schema.ts +17 -0
- package/src/generated/zod/aws-sqs-queue-heartbeat-data-schema.ts +38 -0
- package/src/generated/zod/aws-storage-import-data-schema.ts +16 -0
- package/src/generated/zod/aws-vault-import-data-schema.ts +17 -0
- package/src/generated/zod/aws-vpc-network-heartbeat-data-schema.ts +26 -0
- package/src/generated/zod/aws-worker-import-data-schema.ts +25 -0
- package/src/generated/zod/azure-artifact-registry-import-data-schema.ts +20 -0
- package/src/generated/zod/azure-blob-storage-heartbeat-data-schema.ts +43 -0
- package/src/generated/zod/azure-build-import-data-schema.ts +21 -0
- package/src/generated/zod/azure-compute-cluster-heartbeat-data-schema.ts +37 -0
- package/src/generated/zod/azure-compute-cluster-import-data-schema.ts +17 -0
- package/src/generated/zod/azure-container-apps-build-heartbeat-data-schema.ts +20 -0
- package/src/generated/zod/azure-container-apps-environment-heartbeat-data-schema.ts +32 -0
- package/src/generated/zod/azure-container-apps-environment-heartbeat-status-schema.ts +26 -0
- package/src/generated/zod/azure-container-apps-environment-import-data-schema.ts +20 -0
- package/src/generated/zod/azure-container-apps-environment-workload-profile-schema.ts +15 -0
- package/src/generated/zod/azure-container-apps-worker-heartbeat-data-schema.ts +25 -0
- package/src/generated/zod/azure-container-registry-heartbeat-data-schema.ts +41 -0
- package/src/generated/zod/azure-daemon-heartbeat-data-schema.ts +35 -0
- package/src/generated/zod/azure-key-vault-heartbeat-data-schema.ts +31 -0
- package/src/generated/zod/azure-kv-import-data-schema.ts +19 -0
- package/src/generated/zod/azure-managed-identity-service-account-heartbeat-data-schema.ts +30 -0
- package/src/generated/zod/azure-management-config-schema.ts +3 -4
- package/src/generated/zod/azure-network-import-data-schema.ts +22 -0
- package/src/generated/zod/azure-platform-permission-schema.ts +3 -1
- package/src/generated/zod/azure-queue-import-data-schema.ts +18 -0
- package/src/generated/zod/azure-remote-stack-management-heartbeat-data-schema.ts +22 -0
- package/src/generated/zod/azure-remote-stack-management-import-data-schema.ts +21 -0
- package/src/generated/zod/azure-resource-group-heartbeat-data-schema.ts +22 -0
- package/src/generated/zod/azure-resource-group-heartbeat-status-schema.ts +26 -0
- package/src/generated/zod/azure-resource-group-import-data-schema.ts +17 -0
- package/src/generated/zod/azure-resource-provider-activation-heartbeat-data-schema.ts +21 -0
- package/src/generated/zod/azure-service-account-import-data-schema.ts +20 -0
- package/src/generated/zod/azure-service-activation-import-data-schema.ts +17 -0
- package/src/generated/zod/azure-service-bus-namespace-heartbeat-data-schema.ts +34 -0
- package/src/generated/zod/azure-service-bus-namespace-import-data-schema.ts +18 -0
- package/src/generated/zod/azure-service-bus-queue-heartbeat-data-schema.ts +46 -0
- package/src/generated/zod/azure-storage-account-endpoints-schema.ts +17 -0
- package/src/generated/zod/azure-storage-account-heartbeat-data-schema.ts +42 -0
- package/src/generated/zod/azure-storage-account-import-data-schema.ts +22 -0
- package/src/generated/zod/azure-storage-import-data-schema.ts +18 -0
- package/src/generated/zod/azure-table-kv-heartbeat-data-schema.ts +26 -0
- package/src/generated/zod/azure-vault-import-data-schema.ts +18 -0
- package/src/generated/zod/azure-vnet-network-heartbeat-data-schema.ts +27 -0
- package/src/generated/zod/azure-worker-import-data-schema.ts +18 -0
- package/src/generated/zod/build-heartbeat-data-schema.ts +22 -0
- package/src/generated/zod/build-heartbeat-status-schema.ts +26 -0
- package/src/generated/zod/compute-capacity-blocker-category-schema.ts +10 -0
- package/src/generated/zod/compute-capacity-blocker-schema.ts +19 -0
- package/src/generated/zod/compute-capacity-group-status-schema.ts +25 -0
- package/src/generated/zod/compute-capacity-recommendation-schema.ts +18 -0
- package/src/generated/zod/compute-cluster-heartbeat-data-schema.ts +22 -0
- package/src/generated/zod/compute-cluster-heartbeat-status-schema.ts +26 -0
- package/src/generated/zod/container-heartbeat-data-schema.ts +19 -0
- package/src/generated/zod/container-outputs-schema.ts +2 -2
- package/src/generated/zod/container-schema.ts +3 -3
- package/src/generated/zod/container-status-schema.ts +2 -2
- package/src/generated/zod/custom-certificate-config-schema.ts +4 -0
- package/src/generated/zod/daemon-code-schema.ts +20 -0
- package/src/generated/zod/daemon-heartbeat-data-schema.ts +25 -0
- package/src/generated/zod/daemon-outputs-schema.ts +13 -0
- package/src/generated/zod/daemon-schema.ts +35 -0
- package/src/generated/zod/dev-resource-info-schema.ts +1 -1
- package/src/generated/zod/gcp-artifact-registry-heartbeat-data-schema.ts +35 -0
- package/src/generated/zod/gcp-artifact-registry-import-data-schema.ts +21 -0
- package/src/generated/zod/gcp-build-import-data-schema.ts +22 -0
- package/src/generated/zod/gcp-cloud-build-heartbeat-data-schema.ts +20 -0
- package/src/generated/zod/gcp-cloud-run-worker-heartbeat-data-schema.ts +29 -0
- package/src/generated/zod/gcp-cloud-storage-heartbeat-data-schema.ts +33 -0
- package/src/generated/zod/gcp-compute-cluster-heartbeat-data-schema.ts +37 -0
- package/src/generated/zod/gcp-compute-cluster-import-data-schema.ts +17 -0
- package/src/generated/zod/gcp-daemon-heartbeat-data-schema.ts +35 -0
- package/src/generated/zod/gcp-firestore-kv-heartbeat-data-schema.ts +32 -0
- package/src/generated/zod/gcp-kv-import-data-schema.ts +17 -0
- package/src/generated/zod/gcp-network-import-data-schema.ts +22 -0
- package/src/generated/zod/gcp-platform-permission-schema.ts +3 -1
- package/src/generated/zod/gcp-pub-sub-queue-heartbeat-data-schema.ts +54 -0
- package/src/generated/zod/gcp-queue-import-data-schema.ts +19 -0
- package/src/generated/zod/gcp-remote-stack-management-heartbeat-data-schema.ts +19 -0
- package/src/generated/zod/gcp-remote-stack-management-import-data-schema.ts +19 -0
- package/src/generated/zod/gcp-secret-manager-vault-heartbeat-data-schema.ts +19 -0
- package/src/generated/zod/gcp-service-account-heartbeat-data-schema.ts +28 -0
- package/src/generated/zod/gcp-service-account-import-data-schema.ts +18 -0
- package/src/generated/zod/gcp-service-activation-import-data-schema.ts +17 -0
- package/src/generated/zod/gcp-service-usage-activation-heartbeat-data-schema.ts +22 -0
- package/src/generated/zod/gcp-storage-import-data-schema.ts +18 -0
- package/src/generated/zod/gcp-vault-import-data-schema.ts +16 -0
- package/src/generated/zod/gcp-vpc-network-heartbeat-data-schema.ts +25 -0
- package/src/generated/zod/gcp-worker-import-data-schema.ts +23 -0
- package/src/generated/zod/heartbeat-backend-schema.ts +10 -0
- package/src/generated/zod/heartbeat-collection-issue-reason-schema.ts +10 -0
- package/src/generated/zod/heartbeat-collection-issue-schema.ts +21 -0
- package/src/generated/zod/heartbeat-issue-severity-schema.ts +10 -0
- package/src/generated/zod/horizon-container-heartbeat-data-schema.ts +41 -0
- package/src/generated/zod/horizon-workload-scheduling-mode-schema.ts +10 -0
- package/src/generated/zod/import-source-kind-schema.ts +13 -0
- package/src/generated/zod/imported-resource-schema.ts +22 -0
- package/src/generated/zod/index.ts +391 -9
- package/src/generated/zod/ingress-schema.ts +2 -2
- package/src/generated/zod/kubernetes-build-heartbeat-data-schema.ts +28 -0
- package/src/generated/zod/kubernetes-certificate-mode-schema.ts +30 -0
- package/src/generated/zod/kubernetes-cloud-reference-schema.ts +21 -0
- package/src/generated/zod/kubernetes-cluster-heartbeat-data-schema.ts +41 -0
- package/src/generated/zod/kubernetes-cluster-node-status-schema.ts +35 -0
- package/src/generated/zod/kubernetes-cluster-ownership-schema.ts +13 -0
- package/src/generated/zod/kubernetes-cluster-settings-schema.ts +23 -0
- package/src/generated/zod/kubernetes-container-heartbeat-data-schema.ts +45 -0
- package/src/generated/zod/kubernetes-custom-certificate-config-schema.ts +15 -0
- package/src/generated/zod/kubernetes-daemon-heartbeat-data-schema.ts +42 -0
- package/src/generated/zod/kubernetes-event-involved-object-schema.ts +18 -0
- package/src/generated/zod/kubernetes-event-snapshot-schema.ts +30 -0
- package/src/generated/zod/kubernetes-event-source-schema.ts +13 -0
- package/src/generated/zod/kubernetes-exposure-settings-schema.ts +34 -0
- package/src/generated/zod/kubernetes-gateway-route-profile-schema.ts +27 -0
- package/src/generated/zod/kubernetes-ingress-route-profile-schema.ts +26 -0
- package/src/generated/zod/kubernetes-node-condition-status-schema.ts +15 -0
- package/src/generated/zod/kubernetes-node-resources-schema.ts +19 -0
- package/src/generated/zod/kubernetes-node-usage-schema.ts +18 -0
- package/src/generated/zod/kubernetes-owner-reference-schema.ts +15 -0
- package/src/generated/zod/kubernetes-pod-runtime-unit-status-schema.ts +31 -0
- package/src/generated/zod/kubernetes-route-profile-schema.ts +19 -0
- package/src/generated/zod/kubernetes-route-provider-options-schema.ts +27 -0
- package/src/generated/zod/kubernetes-secret-vault-heartbeat-data-schema.ts +18 -0
- package/src/generated/zod/kubernetes-settings-schema.ts +22 -0
- package/src/generated/zod/kubernetes-tls-secret-ref-schema.ts +16 -0
- package/src/generated/zod/kubernetes-worker-heartbeat-data-schema.ts +46 -0
- package/src/generated/zod/kubernetes-workload-condition-schema.ts +16 -0
- package/src/generated/zod/kubernetes-workload-kind-schema.ts +10 -0
- package/src/generated/zod/kubernetes-workload-status-schema.ts +22 -0
- package/src/generated/zod/kv-heartbeat-data-schema.ts +22 -0
- package/src/generated/zod/kv-heartbeat-status-schema.ts +26 -0
- package/src/generated/zod/local-artifact-registry-heartbeat-data-schema.ts +17 -0
- package/src/generated/zod/local-compute-cluster-heartbeat-data-schema.ts +30 -0
- package/src/generated/zod/local-container-heartbeat-data-schema.ts +39 -0
- package/src/generated/zod/local-daemon-heartbeat-data-schema.ts +30 -0
- package/src/generated/zod/local-kv-heartbeat-data-schema.ts +20 -0
- package/src/generated/zod/local-queue-heartbeat-data-schema.ts +18 -0
- package/src/generated/zod/local-runtime-event-snapshot-schema.ts +26 -0
- package/src/generated/zod/local-runtime-event-subject-schema.ts +14 -0
- package/src/generated/zod/local-runtime-unit-kind-schema.ts +10 -0
- package/src/generated/zod/local-runtime-unit-status-schema.ts +28 -0
- package/src/generated/zod/local-service-account-heartbeat-data-schema.ts +17 -0
- package/src/generated/zod/local-storage-heartbeat-data-schema.ts +20 -0
- package/src/generated/zod/local-vault-heartbeat-data-schema.ts +21 -0
- package/src/generated/zod/local-worker-heartbeat-data-schema.ts +35 -0
- package/src/generated/zod/managed-runtime-event-involved-object-schema.ts +20 -0
- package/src/generated/zod/managed-runtime-event-snapshot-schema.ts +34 -0
- package/src/generated/zod/managed-runtime-event-source-schema.ts +13 -0
- package/src/generated/zod/managed-runtime-unit-status-schema.ts +34 -0
- package/src/generated/zod/metric-sample-schema.ts +16 -0
- package/src/generated/zod/metric-unit-schema.ts +10 -0
- package/src/generated/zod/network-heartbeat-data-schema.ts +19 -0
- package/src/generated/zod/network-heartbeat-status-schema.ts +26 -0
- package/src/generated/zod/observed-counts-schema.ts +14 -0
- package/src/generated/zod/observed-health-schema.ts +10 -0
- package/src/generated/zod/permission-grant-schema.ts +3 -1
- package/src/generated/zod/persistent-storage-schema.ts +2 -5
- package/src/generated/zod/provider-fleet-status-schema.ts +16 -0
- package/src/generated/zod/provider-lifecycle-state-schema.ts +10 -0
- package/src/generated/zod/queue-heartbeat-data-schema.ts +22 -0
- package/src/generated/zod/queue-heartbeat-status-schema.ts +26 -0
- package/src/generated/zod/raw-heartbeat-snippet-format-schema.ts +10 -0
- package/src/generated/zod/raw-heartbeat-snippet-schema.ts +19 -0
- package/src/generated/zod/readiness-probe-schema.ts +2 -2
- package/src/generated/zod/remote-stack-management-heartbeat-data-schema.ts +19 -0
- package/src/generated/zod/remote-stack-management-heartbeat-status-schema.ts +26 -0
- package/src/generated/zod/resource-heartbeat-data-schema.ts +124 -0
- package/src/generated/zod/resource-heartbeat-schema.ts +34 -0
- package/src/generated/zod/service-account-heartbeat-data-schema.ts +22 -0
- package/src/generated/zod/service-account-heartbeat-status-schema.ts +26 -0
- package/src/generated/zod/service-activation-heartbeat-data-schema.ts +16 -0
- package/src/generated/zod/service-activation-heartbeat-status-schema.ts +26 -0
- package/src/generated/zod/stack-import-request-schema.ts +46 -0
- package/src/generated/zod/stack-import-response-schema.ts +24 -0
- package/src/generated/zod/stack-resource-state-schema.ts +5 -2
- package/src/generated/zod/stack-schema.ts +5 -1
- package/src/generated/zod/stack-settings-schema.ts +4 -0
- package/src/generated/zod/storage-heartbeat-data-schema.ts +22 -0
- package/src/generated/zod/storage-heartbeat-status-schema.ts +26 -0
- package/src/generated/zod/value-schema.ts +10 -0
- package/src/generated/zod/vault-heartbeat-data-schema.ts +25 -0
- package/src/generated/zod/vault-heartbeat-status-schema.ts +26 -0
- package/src/generated/zod/vault-schema.ts +2 -2
- package/src/generated/zod/{function-code-schema.ts → worker-code-schema.ts} +4 -4
- package/src/generated/zod/worker-heartbeat-data-schema.ts +25 -0
- package/src/generated/zod/{function-outputs-schema.ts → worker-outputs-schema.ts} +6 -6
- package/src/generated/zod/worker-schema.ts +43 -0
- package/src/generated/zod/{function-trigger-schema.ts → worker-trigger-schema.ts} +4 -4
- package/src/generated/zod/workload-heartbeat-status-schema.ts +26 -0
- package/src/generated/zod/workload-replica-status-schema.ts +17 -0
- package/src/get-resource-outputs.ts +4 -4
- package/src/index.ts +310 -1
- package/src/resource.ts +1 -1
- package/src/service-account.ts +2 -2
- package/src/stack.ts +11 -1
- package/src/vault.ts +1 -1
- package/src/{function.ts → worker.ts} +63 -64
- package/src/generated/schemas/function.json +0 -1
- package/src/generated/schemas/functionCode.json +0 -1
- package/src/generated/schemas/functionOutputs.json +0 -1
- package/src/generated/schemas/functionTrigger.json +0 -1
- package/src/generated/zod/function-schema.ts +0 -43
package/dist/tests/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ declare function getStackState(): {
|
|
|
12
12
|
status: "pending" | "provisioning" | "provision-failed" | "running" | "updating" | "update-failed" | "deleting" | "delete-failed" | "deleted" | "refresh-failed";
|
|
13
13
|
type: string;
|
|
14
14
|
_internal?: any;
|
|
15
|
+
controllerPlatform?: "aws" | "gcp" | "azure" | "kubernetes" | "local" | "test" | null | undefined;
|
|
15
16
|
dependencies?: {
|
|
16
17
|
id: string;
|
|
17
18
|
type: string;
|
|
@@ -26,7 +27,6 @@ declare function getStackState(): {
|
|
|
26
27
|
httpStatusCode?: number | null | undefined;
|
|
27
28
|
source?: any;
|
|
28
29
|
} | null | undefined;
|
|
29
|
-
isExternallyProvisioned?: boolean | undefined;
|
|
30
30
|
lastFailedState?: any;
|
|
31
31
|
lifecycle?: "frozen" | "live" | null | undefined;
|
|
32
32
|
outputs?: {
|
package/dist/tests/index.js
CHANGED
package/dist/tests/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/tests/index.ts"],"sourcesContent":["import { StackStateSchema } from \"../stack.js\"\n\n// Utility to get stack state in an Alien integration test\nexport function getStackState() {\n return StackStateSchema.parse(JSON.parse(process.env.ALIEN_STACK_STATE!))\n}\n"],"mappings":";;AAGA,SAAgB,gBAAgB;
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/tests/index.ts"],"sourcesContent":["import { StackStateSchema } from \"../stack.js\"\n\n// Utility to get stack state in an Alien integration test\nexport function getStackState() {\n return StackStateSchema.parse(JSON.parse(process.env.ALIEN_STACK_STATE!))\n}\n"],"mappings":";;AAGA,SAAgB,gBAAgB;CAC9B,OAAO,iBAAiB,MAAM,KAAK,MAAM,QAAQ,IAAI,iBAAkB,CAAC;AAC1E"}
|
package/package.json
CHANGED
|
@@ -28,6 +28,7 @@ exports[`ArtifactRegistry resource configuration > can be used in stack permissi
|
|
|
28
28
|
"image": "docker.io/library/rust:latest",
|
|
29
29
|
"type": "image",
|
|
30
30
|
},
|
|
31
|
+
"commandsEnabled": false,
|
|
31
32
|
"environment": {},
|
|
32
33
|
"id": "registry-user",
|
|
33
34
|
"ingress": "private",
|
|
@@ -35,7 +36,8 @@ exports[`ArtifactRegistry resource configuration > can be used in stack permissi
|
|
|
35
36
|
"memoryMb": 256,
|
|
36
37
|
"permissions": "execution",
|
|
37
38
|
"timeoutSeconds": 180,
|
|
38
|
-
"
|
|
39
|
+
"triggers": [],
|
|
40
|
+
"type": "worker",
|
|
39
41
|
},
|
|
40
42
|
"dependencies": [],
|
|
41
43
|
"lifecycle": "live",
|
|
@@ -98,7 +100,7 @@ exports[`Permissions system > creates a stack with custom permission sets 1`] =
|
|
|
98
100
|
"management": {
|
|
99
101
|
"extend": {
|
|
100
102
|
"*": [
|
|
101
|
-
"
|
|
103
|
+
"worker/management",
|
|
102
104
|
],
|
|
103
105
|
},
|
|
104
106
|
},
|
|
@@ -134,20 +136,22 @@ exports[`Permissions system > creates a stack with custom permission sets 1`] =
|
|
|
134
136
|
},
|
|
135
137
|
},
|
|
136
138
|
"resources": {
|
|
137
|
-
"test-
|
|
139
|
+
"test-worker": {
|
|
138
140
|
"config": {
|
|
139
141
|
"code": {
|
|
140
142
|
"image": "docker.io/library/rust:latest",
|
|
141
143
|
"type": "image",
|
|
142
144
|
},
|
|
145
|
+
"commandsEnabled": false,
|
|
143
146
|
"environment": {},
|
|
144
|
-
"id": "test-
|
|
147
|
+
"id": "test-worker",
|
|
145
148
|
"ingress": "private",
|
|
146
149
|
"links": [],
|
|
147
150
|
"memoryMb": 256,
|
|
148
151
|
"permissions": "execution",
|
|
149
152
|
"timeoutSeconds": 180,
|
|
150
|
-
"
|
|
153
|
+
"triggers": [],
|
|
154
|
+
"type": "worker",
|
|
151
155
|
},
|
|
152
156
|
"dependencies": [],
|
|
153
157
|
"lifecycle": "live",
|
|
@@ -163,7 +167,7 @@ exports[`Stack builder validation > builds and validates a complex stack with pe
|
|
|
163
167
|
"management": {
|
|
164
168
|
"extend": {
|
|
165
169
|
"*": [
|
|
166
|
-
"
|
|
170
|
+
"worker/management",
|
|
167
171
|
"storage/management",
|
|
168
172
|
],
|
|
169
173
|
},
|
|
@@ -191,16 +195,17 @@ exports[`Stack builder validation > builds and validates a complex stack with pe
|
|
|
191
195
|
"dependencies": [],
|
|
192
196
|
"lifecycle": "frozen",
|
|
193
197
|
},
|
|
194
|
-
"my-test-
|
|
198
|
+
"my-test-worker": {
|
|
195
199
|
"config": {
|
|
196
200
|
"code": {
|
|
197
201
|
"image": "docker.io/library/rust:latest",
|
|
198
202
|
"type": "image",
|
|
199
203
|
},
|
|
204
|
+
"commandsEnabled": false,
|
|
200
205
|
"environment": {
|
|
201
206
|
"RUST_LOG": "info,alien_runtime_test_server=debug,alien_runtime=debug",
|
|
202
207
|
},
|
|
203
|
-
"id": "my-test-
|
|
208
|
+
"id": "my-test-worker",
|
|
204
209
|
"ingress": "public",
|
|
205
210
|
"links": [
|
|
206
211
|
{
|
|
@@ -211,7 +216,8 @@ exports[`Stack builder validation > builds and validates a complex stack with pe
|
|
|
211
216
|
"memoryMb": 512,
|
|
212
217
|
"permissions": "execution",
|
|
213
218
|
"timeoutSeconds": 30,
|
|
214
|
-
"
|
|
219
|
+
"triggers": [],
|
|
220
|
+
"type": "worker",
|
|
215
221
|
},
|
|
216
222
|
"dependencies": [],
|
|
217
223
|
"lifecycle": "live",
|
|
@@ -294,27 +300,27 @@ exports[`Stack builder validation > builds and validates a stack with Build and
|
|
|
294
300
|
}
|
|
295
301
|
`;
|
|
296
302
|
|
|
297
|
-
exports[`Stack builder validation > builds and validates a stack with
|
|
303
|
+
exports[`Stack builder validation > builds and validates a stack with worker source 1`] = `
|
|
298
304
|
{
|
|
299
305
|
"id": "my-source-stack",
|
|
300
306
|
"permissions": {
|
|
301
307
|
"management": {
|
|
302
308
|
"extend": {
|
|
303
309
|
"*": [
|
|
304
|
-
"
|
|
310
|
+
"worker/management",
|
|
305
311
|
],
|
|
306
312
|
},
|
|
307
313
|
},
|
|
308
314
|
"profiles": {
|
|
309
315
|
"execution": {
|
|
310
316
|
"*": [
|
|
311
|
-
"
|
|
317
|
+
"worker/execute",
|
|
312
318
|
],
|
|
313
319
|
},
|
|
314
320
|
},
|
|
315
321
|
},
|
|
316
322
|
"resources": {
|
|
317
|
-
"my-source-
|
|
323
|
+
"my-source-worker": {
|
|
318
324
|
"config": {
|
|
319
325
|
"code": {
|
|
320
326
|
"src": "./app",
|
|
@@ -323,14 +329,16 @@ exports[`Stack builder validation > builds and validates a stack with function s
|
|
|
323
329
|
},
|
|
324
330
|
"type": "source",
|
|
325
331
|
},
|
|
332
|
+
"commandsEnabled": false,
|
|
326
333
|
"environment": {},
|
|
327
|
-
"id": "my-source-
|
|
334
|
+
"id": "my-source-worker",
|
|
328
335
|
"ingress": "private",
|
|
329
336
|
"links": [],
|
|
330
337
|
"memoryMb": 256,
|
|
331
338
|
"permissions": "execution",
|
|
332
339
|
"timeoutSeconds": 15,
|
|
333
|
-
"
|
|
340
|
+
"triggers": [],
|
|
341
|
+
"type": "worker",
|
|
334
342
|
},
|
|
335
343
|
"dependencies": [],
|
|
336
344
|
"lifecycle": "live",
|
|
@@ -332,7 +332,7 @@ describe("AlienError.from() with random JS objects", async () => {
|
|
|
332
332
|
|
|
333
333
|
expect(alienError.code).toBe("GENERIC_ERROR")
|
|
334
334
|
expect(alienError.context?.errorType).toBe("Function")
|
|
335
|
-
// Note:
|
|
335
|
+
// Note: JS functions get serialized differently by serialize-error
|
|
336
336
|
})
|
|
337
337
|
})
|
|
338
338
|
|
|
@@ -1,18 +1,37 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest"
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { WorkerSchema } from "../generated/index.js"
|
|
4
4
|
import * as alien from "../index.js"
|
|
5
5
|
|
|
6
|
-
// Shared image URI for
|
|
6
|
+
// Shared image URI for workers in tests
|
|
7
7
|
const SHARED_IMAGE = "docker.io/library/rust:latest"
|
|
8
8
|
|
|
9
9
|
describe("Stack builder validation", () => {
|
|
10
|
+
it("builds a stateful container with persistent storage options", () => {
|
|
11
|
+
const postgres = new alien.Container("postgres")
|
|
12
|
+
.code({ type: "image", image: "postgres:16-alpine" })
|
|
13
|
+
.cpu(0.5)
|
|
14
|
+
.memory("512Mi")
|
|
15
|
+
.port(5432)
|
|
16
|
+
.permissions("database")
|
|
17
|
+
.persistentStorage("20Gi", {
|
|
18
|
+
mountPath: "/var/lib/postgresql/data",
|
|
19
|
+
})
|
|
20
|
+
.build()
|
|
21
|
+
|
|
22
|
+
expect(postgres.config.stateful).toBe(true)
|
|
23
|
+
expect(postgres.config.persistentStorage).toEqual({
|
|
24
|
+
size: "20Gi",
|
|
25
|
+
mountPath: "/var/lib/postgresql/data",
|
|
26
|
+
})
|
|
27
|
+
})
|
|
28
|
+
|
|
10
29
|
it("builds and validates a complex stack with permissions", () => {
|
|
11
30
|
// Storage bucket
|
|
12
31
|
const storage = new alien.Storage("my-test-bucket").publicRead(true).build()
|
|
13
32
|
|
|
14
|
-
// Main application
|
|
15
|
-
const
|
|
33
|
+
// Main application worker with permissions
|
|
34
|
+
const worker = new alien.Worker("my-test-worker")
|
|
16
35
|
.code({ type: "image", image: SHARED_IMAGE })
|
|
17
36
|
.memoryMb(512)
|
|
18
37
|
.timeoutSeconds(30)
|
|
@@ -26,7 +45,7 @@ describe("Stack builder validation", () => {
|
|
|
26
45
|
|
|
27
46
|
const stack = new alien.Stack("my-test-stack")
|
|
28
47
|
.add(storage, "frozen")
|
|
29
|
-
.add(
|
|
48
|
+
.add(worker, "live")
|
|
30
49
|
.permissions({
|
|
31
50
|
profiles: {
|
|
32
51
|
execution: {
|
|
@@ -36,7 +55,7 @@ describe("Stack builder validation", () => {
|
|
|
36
55
|
},
|
|
37
56
|
management: {
|
|
38
57
|
extend: {
|
|
39
|
-
"*": ["
|
|
58
|
+
"*": ["worker/management", "storage/management"],
|
|
40
59
|
},
|
|
41
60
|
},
|
|
42
61
|
})
|
|
@@ -45,7 +64,7 @@ describe("Stack builder validation", () => {
|
|
|
45
64
|
// Basic assertions
|
|
46
65
|
expect(stack.id).toBe("my-test-stack")
|
|
47
66
|
expect(stack.resources).toHaveProperty("my-test-bucket")
|
|
48
|
-
expect(stack.resources).toHaveProperty("my-test-
|
|
67
|
+
expect(stack.resources).toHaveProperty("my-test-worker")
|
|
49
68
|
expect(stack.permissions?.profiles).toHaveProperty("execution")
|
|
50
69
|
expect(stack.permissions?.management).toHaveProperty("extend")
|
|
51
70
|
|
|
@@ -112,8 +131,8 @@ describe("Stack builder validation", () => {
|
|
|
112
131
|
expect(stack).toMatchSnapshot()
|
|
113
132
|
})
|
|
114
133
|
|
|
115
|
-
it("builds and validates a stack with
|
|
116
|
-
const
|
|
134
|
+
it("builds and validates a stack with worker source", () => {
|
|
135
|
+
const workerWithSource = new alien.Worker("my-source-worker")
|
|
117
136
|
.code({
|
|
118
137
|
type: "source",
|
|
119
138
|
src: "./app",
|
|
@@ -126,27 +145,27 @@ describe("Stack builder validation", () => {
|
|
|
126
145
|
.build()
|
|
127
146
|
|
|
128
147
|
const stack = new alien.Stack("my-source-stack")
|
|
129
|
-
.add(
|
|
148
|
+
.add(workerWithSource, "live")
|
|
130
149
|
.permissions({
|
|
131
150
|
profiles: {
|
|
132
151
|
execution: {
|
|
133
|
-
"*": ["
|
|
152
|
+
"*": ["worker/execute"],
|
|
134
153
|
},
|
|
135
154
|
},
|
|
136
155
|
management: {
|
|
137
156
|
extend: {
|
|
138
|
-
"*": ["
|
|
157
|
+
"*": ["worker/management"],
|
|
139
158
|
},
|
|
140
159
|
},
|
|
141
160
|
})
|
|
142
161
|
.build()
|
|
143
162
|
|
|
144
163
|
expect(stack.id).toBe("my-source-stack")
|
|
145
|
-
expect(stack.resources).toHaveProperty("my-source-
|
|
146
|
-
const resourceInStack = stack.resources["my-source-
|
|
164
|
+
expect(stack.resources).toHaveProperty("my-source-worker")
|
|
165
|
+
const resourceInStack = stack.resources["my-source-worker"]
|
|
147
166
|
expect(resourceInStack).toBeDefined()
|
|
148
|
-
const
|
|
149
|
-
expect(
|
|
167
|
+
const workerConfigFromStack = WorkerSchema.parse(resourceInStack!.config)
|
|
168
|
+
expect(workerConfigFromStack.code.type).toBe("source")
|
|
150
169
|
|
|
151
170
|
expect(stack).toMatchSnapshot()
|
|
152
171
|
})
|
|
@@ -170,15 +189,15 @@ describe("Permissions system", () => {
|
|
|
170
189
|
},
|
|
171
190
|
}
|
|
172
191
|
|
|
173
|
-
// Create a
|
|
174
|
-
const
|
|
192
|
+
// Create a worker with permissions
|
|
193
|
+
const worker = new alien.Worker("test-worker")
|
|
175
194
|
.code({ type: "image", image: SHARED_IMAGE })
|
|
176
195
|
.permissions("execution")
|
|
177
196
|
.build()
|
|
178
197
|
|
|
179
198
|
// Create stack with both string and custom permission sets
|
|
180
199
|
const stack = new alien.Stack("permissions-stack")
|
|
181
|
-
.add(
|
|
200
|
+
.add(worker, "live")
|
|
182
201
|
.permissions({
|
|
183
202
|
profiles: {
|
|
184
203
|
execution: {
|
|
@@ -187,7 +206,7 @@ describe("Permissions system", () => {
|
|
|
187
206
|
},
|
|
188
207
|
management: {
|
|
189
208
|
extend: {
|
|
190
|
-
"*": ["
|
|
209
|
+
"*": ["worker/management"],
|
|
191
210
|
},
|
|
192
211
|
},
|
|
193
212
|
})
|
|
@@ -195,7 +214,7 @@ describe("Permissions system", () => {
|
|
|
195
214
|
|
|
196
215
|
// Verify the stack is properly configured
|
|
197
216
|
expect(stack.id).toBe("permissions-stack")
|
|
198
|
-
expect(stack.resources).toHaveProperty("test-
|
|
217
|
+
expect(stack.resources).toHaveProperty("test-worker")
|
|
199
218
|
expect(stack.permissions?.profiles).toHaveProperty("execution")
|
|
200
219
|
expect(stack.permissions?.management).toHaveProperty("extend")
|
|
201
220
|
|
|
@@ -282,14 +301,14 @@ describe("ArtifactRegistry resource configuration", () => {
|
|
|
282
301
|
it("can be used in stack permissions", () => {
|
|
283
302
|
const registry = new alien.ArtifactRegistry("protected-registry").build()
|
|
284
303
|
|
|
285
|
-
const
|
|
304
|
+
const worker = new alien.Worker("registry-user")
|
|
286
305
|
.code({ type: "image", image: SHARED_IMAGE })
|
|
287
306
|
.permissions("execution")
|
|
288
307
|
.build()
|
|
289
308
|
|
|
290
309
|
const stack = new alien.Stack("registry-stack")
|
|
291
310
|
.add(registry, "frozen")
|
|
292
|
-
.add(
|
|
311
|
+
.add(worker, "live")
|
|
293
312
|
.permissions({
|
|
294
313
|
profiles: {
|
|
295
314
|
execution: {
|
package/src/container.ts
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
type ContainerGpuSpec,
|
|
6
6
|
ContainerSchema,
|
|
7
7
|
type HealthCheck,
|
|
8
|
+
type PersistentStorage,
|
|
8
9
|
type ResourceSpec,
|
|
9
10
|
type ResourceType,
|
|
10
11
|
} from "./generated/index.js"
|
|
@@ -32,12 +33,21 @@ export {
|
|
|
32
33
|
ContainerAutoscalingSchema,
|
|
33
34
|
} from "./generated/index.js"
|
|
34
35
|
|
|
36
|
+
export interface PersistentStorageOptions {
|
|
37
|
+
/**
|
|
38
|
+
* Mount path inside the container.
|
|
39
|
+
*
|
|
40
|
+
* Defaults to `/data`.
|
|
41
|
+
*/
|
|
42
|
+
mountPath?: string
|
|
43
|
+
}
|
|
44
|
+
|
|
35
45
|
/**
|
|
36
46
|
* Represents a long-running container workload.
|
|
37
47
|
*
|
|
38
48
|
* Containers run on compute instances (EC2, GCE, Azure VMs) and are orchestrated
|
|
39
|
-
* by
|
|
40
|
-
* databases, and background workers.
|
|
49
|
+
* by the managed container backend. They're designed for always-on workloads
|
|
50
|
+
* like web services, APIs, databases, and background workers.
|
|
41
51
|
*/
|
|
42
52
|
export class Container {
|
|
43
53
|
private _config: Partial<ContainerConfig> = {
|
|
@@ -45,7 +55,7 @@ export class Container {
|
|
|
45
55
|
ports: [],
|
|
46
56
|
environment: {},
|
|
47
57
|
stateful: false,
|
|
48
|
-
// cluster is optional - if not set,
|
|
58
|
+
// cluster is optional - if not set, ComputeClusterMutation will auto-assign
|
|
49
59
|
}
|
|
50
60
|
|
|
51
61
|
/**
|
|
@@ -67,7 +77,7 @@ export class Container {
|
|
|
67
77
|
|
|
68
78
|
/**
|
|
69
79
|
* Sets the container cluster this container runs on.
|
|
70
|
-
* @param clusterId The
|
|
80
|
+
* @param clusterId The ComputeCluster resource ID.
|
|
71
81
|
* @returns The Container builder instance.
|
|
72
82
|
*/
|
|
73
83
|
public cluster(clusterId: string): this {
|
|
@@ -280,16 +290,19 @@ export class Container {
|
|
|
280
290
|
}
|
|
281
291
|
|
|
282
292
|
/**
|
|
283
|
-
* Configures persistent storage
|
|
293
|
+
* Configures persistent storage and marks the container stateful.
|
|
284
294
|
* Data survives container restarts.
|
|
285
295
|
* @param size Storage size (e.g., "100Gi", "500Gi", "1Ti").
|
|
296
|
+
* @param options Optional mount path.
|
|
286
297
|
* @returns The Container builder instance.
|
|
287
298
|
*/
|
|
288
|
-
public persistentStorage(size: string): this {
|
|
289
|
-
|
|
299
|
+
public persistentStorage(size: string, options: PersistentStorageOptions = {}): this {
|
|
300
|
+
const persistentStorage: PersistentStorage = {
|
|
290
301
|
size,
|
|
291
|
-
mountPath: "/data",
|
|
302
|
+
mountPath: options.mountPath ?? "/data",
|
|
292
303
|
}
|
|
304
|
+
|
|
305
|
+
this._config.persistentStorage = persistentStorage
|
|
293
306
|
this._config.stateful = true
|
|
294
307
|
return this
|
|
295
308
|
}
|
package/src/daemon.ts
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type DaemonCode,
|
|
3
|
+
type Daemon as DaemonConfig,
|
|
4
|
+
DaemonSchema,
|
|
5
|
+
type ResourceSpec,
|
|
6
|
+
type ResourceType,
|
|
7
|
+
} from "./generated/index.js"
|
|
8
|
+
import { Resource } from "./resource.js"
|
|
9
|
+
|
|
10
|
+
export type {
|
|
11
|
+
Daemon as DaemonConfig,
|
|
12
|
+
DaemonCode,
|
|
13
|
+
DaemonOutputs,
|
|
14
|
+
ResourceSpec,
|
|
15
|
+
} from "./generated/index.js"
|
|
16
|
+
export {
|
|
17
|
+
DaemonCodeSchema,
|
|
18
|
+
DaemonSchema as DaemonConfigSchema,
|
|
19
|
+
DaemonOutputsSchema,
|
|
20
|
+
} from "./generated/index.js"
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Represents a resident process that runs once per eligible machine or node.
|
|
24
|
+
*
|
|
25
|
+
* Daemons are intended for long-lived background processes such as endpoint
|
|
26
|
+
* agents and local side services.
|
|
27
|
+
*/
|
|
28
|
+
export class Daemon {
|
|
29
|
+
private _config: Partial<DaemonConfig> = {
|
|
30
|
+
links: [],
|
|
31
|
+
environment: {},
|
|
32
|
+
cpu: { min: "0.1", desired: "0.1" },
|
|
33
|
+
memory: { min: "128Mi", desired: "128Mi" },
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Creates a new Daemon builder.
|
|
38
|
+
* @param id Identifier for the daemon. Must contain only alphanumeric characters, hyphens, and underscores ([A-Za-z0-9-_]). Maximum 64 characters.
|
|
39
|
+
*/
|
|
40
|
+
constructor(id: string) {
|
|
41
|
+
this._config.id = id
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Returns a ResourceType representing any daemon resource.
|
|
46
|
+
* Used for creating permission targets that apply to all daemon resources.
|
|
47
|
+
* @returns The "daemon" resource type.
|
|
48
|
+
*/
|
|
49
|
+
public static any(): ResourceType {
|
|
50
|
+
return "daemon"
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Sets the code for the daemon, either a pre-built image or source code to be built.
|
|
55
|
+
* @param code The daemon code configuration.
|
|
56
|
+
* @returns The Daemon builder instance.
|
|
57
|
+
*/
|
|
58
|
+
public code(code: DaemonCode): this {
|
|
59
|
+
this._config.code = code
|
|
60
|
+
return this
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Sets the ComputeCluster this daemon runs on for AWS/GCP/Azure deployments.
|
|
65
|
+
* Kubernetes and Local deployments ignore this field.
|
|
66
|
+
*/
|
|
67
|
+
public cluster(clusterId: string): this {
|
|
68
|
+
this._config.cluster = clusterId
|
|
69
|
+
return this
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Sets CPU resources for each daemon instance.
|
|
74
|
+
*/
|
|
75
|
+
public cpu(value: number | ResourceSpec): this {
|
|
76
|
+
if (typeof value === "number") {
|
|
77
|
+
this._config.cpu = { min: value.toString(), desired: value.toString() }
|
|
78
|
+
} else {
|
|
79
|
+
this._config.cpu = value
|
|
80
|
+
}
|
|
81
|
+
return this
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Sets memory resources for each daemon instance.
|
|
86
|
+
*/
|
|
87
|
+
public memory(size: string): this {
|
|
88
|
+
this._config.memory = { min: size, desired: size }
|
|
89
|
+
return this
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Sets the backend pool/capacity group for daemon placement.
|
|
94
|
+
*/
|
|
95
|
+
public pool(pool: string): this {
|
|
96
|
+
this._config.pool = pool
|
|
97
|
+
return this
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Overrides the image default command.
|
|
102
|
+
*/
|
|
103
|
+
public command(command: string[]): this {
|
|
104
|
+
this._config.command = command
|
|
105
|
+
return this
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Sets key-value pairs as environment variables for the daemon.
|
|
110
|
+
* @param env A map of environment variable names to their values.
|
|
111
|
+
* @returns The Daemon builder instance.
|
|
112
|
+
*/
|
|
113
|
+
public environment(env: Record<string, string>): this {
|
|
114
|
+
this._config.environment = env
|
|
115
|
+
return this
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Links another resource to this daemon.
|
|
120
|
+
* This makes the linked resource accessible to the daemon, often by injecting
|
|
121
|
+
* environment variables or granting permissions.
|
|
122
|
+
* @param resource The resource to link.
|
|
123
|
+
* @returns The Daemon builder instance.
|
|
124
|
+
*/
|
|
125
|
+
public link(resource: Resource): this {
|
|
126
|
+
if (!this._config.links) {
|
|
127
|
+
this._config.links = []
|
|
128
|
+
}
|
|
129
|
+
this._config.links.push(resource.ref())
|
|
130
|
+
return this
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Assigns a permission profile to this daemon.
|
|
135
|
+
* The profile defines the permissions granted to this daemon when interacting
|
|
136
|
+
* with other cloud resources.
|
|
137
|
+
* @param permissions The permission profile name.
|
|
138
|
+
* @returns The Daemon builder instance.
|
|
139
|
+
*/
|
|
140
|
+
public permissions(permissions: string): this {
|
|
141
|
+
this._config.permissions = permissions
|
|
142
|
+
return this
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Enables or disables the Commands protocol for the daemon.
|
|
147
|
+
* When enabled, the runtime polls the manager for pending commands and executes registered handlers.
|
|
148
|
+
* Default: false.
|
|
149
|
+
* @param enabled Whether to enable commands for this daemon.
|
|
150
|
+
* @returns The Daemon builder instance.
|
|
151
|
+
*/
|
|
152
|
+
public commandsEnabled(enabled: boolean): this {
|
|
153
|
+
this._config.commandsEnabled = enabled
|
|
154
|
+
return this
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Builds and validates the daemon configuration.
|
|
159
|
+
* @returns An immutable Resource representing the configured daemon.
|
|
160
|
+
* @throws Error if the daemon configuration is invalid.
|
|
161
|
+
*/
|
|
162
|
+
public build(): Resource {
|
|
163
|
+
const config = DaemonSchema.parse(this._config)
|
|
164
|
+
|
|
165
|
+
return new Resource({
|
|
166
|
+
type: "daemon",
|
|
167
|
+
...config,
|
|
168
|
+
})
|
|
169
|
+
}
|
|
170
|
+
}
|
package/src/error.ts
CHANGED
|
@@ -88,7 +88,7 @@ export interface AlienErrorMetadata<TContext extends z.ZodTypeAny> {
|
|
|
88
88
|
internal: boolean
|
|
89
89
|
/** HTTP status code for API responses */
|
|
90
90
|
httpStatusCode?: number
|
|
91
|
-
/**
|
|
91
|
+
/** Worker to generate human-readable error message from context */
|
|
92
92
|
message: (context: z.infer<TContext>) => string
|
|
93
93
|
}
|
|
94
94
|
|
|
@@ -315,7 +315,7 @@ export class AlienError<TContext extends z.ZodTypeAny = z.ZodAny> extends Error
|
|
|
315
315
|
return "undefined"
|
|
316
316
|
}
|
|
317
317
|
|
|
318
|
-
// Try to get constructor name first (for Arrays,
|
|
318
|
+
// Try to get constructor name first (for Arrays, Workers, custom classes, etc.)
|
|
319
319
|
if (error?.constructor?.name) {
|
|
320
320
|
return error.constructor.name
|
|
321
321
|
}
|