@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.
Files changed (479) hide show
  1. package/.turbo/turbo-build.log +15 -15
  2. package/AGENTS.md +3 -3
  3. package/dist/index.d.ts +22033 -2518
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.js +212 -66
  6. package/dist/index.js.map +1 -1
  7. package/dist/stack.js +4467 -706
  8. package/dist/stack.js.map +1 -1
  9. package/dist/tests/index.d.ts +1 -1
  10. package/dist/tests/index.js +1 -1
  11. package/dist/tests/index.js.map +1 -1
  12. package/package.json +1 -1
  13. package/src/__tests__/__snapshots__/stack.test.ts.snap +23 -15
  14. package/src/__tests__/error.test.ts +1 -1
  15. package/src/__tests__/stack.test.ts +42 -23
  16. package/src/container.ts +21 -8
  17. package/src/daemon.ts +170 -0
  18. package/src/error.ts +2 -2
  19. package/src/generated/index.ts +391 -9
  20. package/src/generated/schemas/agentStatus.json +1 -1
  21. package/src/generated/schemas/alienEvent.json +1 -1
  22. package/src/generated/schemas/artifactRegistryHeartbeatData.json +1 -0
  23. package/src/generated/schemas/artifactRegistryHeartbeatStatus.json +1 -0
  24. package/src/generated/schemas/awsArtifactRegistryImportData.json +1 -0
  25. package/src/generated/schemas/awsBuildImportData.json +1 -0
  26. package/src/generated/schemas/awsCodeBuildHeartbeatData.json +1 -0
  27. package/src/generated/schemas/awsComputeClusterHeartbeatData.json +1 -0
  28. package/src/generated/schemas/awsComputeClusterImportData.json +1 -0
  29. package/src/generated/schemas/awsDaemonHeartbeatData.json +1 -0
  30. package/src/generated/schemas/awsDynamoDbKeySchemaElement.json +1 -0
  31. package/src/generated/schemas/awsDynamoDbKvHeartbeatData.json +1 -0
  32. package/src/generated/schemas/awsEcrArtifactRegistryHeartbeatData.json +1 -0
  33. package/src/generated/schemas/awsEcrRepositoryHeartbeatData.json +1 -0
  34. package/src/generated/schemas/awsIamRoleServiceAccountHeartbeatData.json +1 -0
  35. package/src/generated/schemas/awsKvImportData.json +1 -0
  36. package/src/generated/schemas/awsLambdaWorkerHeartbeatData.json +1 -0
  37. package/src/generated/schemas/awsNetworkImportData.json +1 -0
  38. package/src/generated/schemas/awsParameterStoreVaultHeartbeatData.json +1 -0
  39. package/src/generated/schemas/awsPermissionEffect.json +1 -0
  40. package/src/generated/schemas/awsPlatformPermission.json +1 -1
  41. package/src/generated/schemas/awsQueueImportData.json +1 -0
  42. package/src/generated/schemas/awsRemoteStackManagementHeartbeatData.json +1 -0
  43. package/src/generated/schemas/awsRemoteStackManagementImportData.json +1 -0
  44. package/src/generated/schemas/awsS3StorageHeartbeatData.json +1 -0
  45. package/src/generated/schemas/awsServiceAccountImportData.json +1 -0
  46. package/src/generated/schemas/awsSqsQueueHeartbeatData.json +1 -0
  47. package/src/generated/schemas/awsStorageImportData.json +1 -0
  48. package/src/generated/schemas/awsVaultImportData.json +1 -0
  49. package/src/generated/schemas/awsVpcNetworkHeartbeatData.json +1 -0
  50. package/src/generated/schemas/awsWorkerImportData.json +1 -0
  51. package/src/generated/schemas/azureArtifactRegistryImportData.json +1 -0
  52. package/src/generated/schemas/azureBlobStorageHeartbeatData.json +1 -0
  53. package/src/generated/schemas/azureBuildImportData.json +1 -0
  54. package/src/generated/schemas/azureComputeClusterHeartbeatData.json +1 -0
  55. package/src/generated/schemas/azureComputeClusterImportData.json +1 -0
  56. package/src/generated/schemas/azureContainerAppsBuildHeartbeatData.json +1 -0
  57. package/src/generated/schemas/azureContainerAppsEnvironmentHeartbeatData.json +1 -0
  58. package/src/generated/schemas/azureContainerAppsEnvironmentHeartbeatStatus.json +1 -0
  59. package/src/generated/schemas/azureContainerAppsEnvironmentImportData.json +1 -0
  60. package/src/generated/schemas/azureContainerAppsEnvironmentWorkloadProfile.json +1 -0
  61. package/src/generated/schemas/azureContainerAppsWorkerHeartbeatData.json +1 -0
  62. package/src/generated/schemas/azureContainerRegistryHeartbeatData.json +1 -0
  63. package/src/generated/schemas/azureDaemonHeartbeatData.json +1 -0
  64. package/src/generated/schemas/azureKeyVaultHeartbeatData.json +1 -0
  65. package/src/generated/schemas/azureKvImportData.json +1 -0
  66. package/src/generated/schemas/azureManagedIdentityServiceAccountHeartbeatData.json +1 -0
  67. package/src/generated/schemas/azureManagementConfig.json +1 -1
  68. package/src/generated/schemas/azureNetworkImportData.json +1 -0
  69. package/src/generated/schemas/azurePlatformPermission.json +1 -1
  70. package/src/generated/schemas/azureQueueImportData.json +1 -0
  71. package/src/generated/schemas/azureRemoteStackManagementHeartbeatData.json +1 -0
  72. package/src/generated/schemas/azureRemoteStackManagementImportData.json +1 -0
  73. package/src/generated/schemas/azureResourceGroupHeartbeatData.json +1 -0
  74. package/src/generated/schemas/azureResourceGroupHeartbeatStatus.json +1 -0
  75. package/src/generated/schemas/azureResourceGroupImportData.json +1 -0
  76. package/src/generated/schemas/azureResourceProviderActivationHeartbeatData.json +1 -0
  77. package/src/generated/schemas/azureServiceAccountImportData.json +1 -0
  78. package/src/generated/schemas/azureServiceActivationImportData.json +1 -0
  79. package/src/generated/schemas/azureServiceBusNamespaceHeartbeatData.json +1 -0
  80. package/src/generated/schemas/azureServiceBusNamespaceImportData.json +1 -0
  81. package/src/generated/schemas/azureServiceBusQueueHeartbeatData.json +1 -0
  82. package/src/generated/schemas/azureStorageAccountEndpoints.json +1 -0
  83. package/src/generated/schemas/azureStorageAccountHeartbeatData.json +1 -0
  84. package/src/generated/schemas/azureStorageAccountImportData.json +1 -0
  85. package/src/generated/schemas/azureStorageImportData.json +1 -0
  86. package/src/generated/schemas/azureTableKvHeartbeatData.json +1 -0
  87. package/src/generated/schemas/azureVaultImportData.json +1 -0
  88. package/src/generated/schemas/azureVnetNetworkHeartbeatData.json +1 -0
  89. package/src/generated/schemas/azureWorkerImportData.json +1 -0
  90. package/src/generated/schemas/baseResource.json +1 -1
  91. package/src/generated/schemas/baseResourceOutputs.json +1 -1
  92. package/src/generated/schemas/build.json +1 -1
  93. package/src/generated/schemas/buildHeartbeatData.json +1 -0
  94. package/src/generated/schemas/buildHeartbeatStatus.json +1 -0
  95. package/src/generated/schemas/computeCapacityBlocker.json +1 -0
  96. package/src/generated/schemas/computeCapacityBlockerCategory.json +1 -0
  97. package/src/generated/schemas/computeCapacityGroupStatus.json +1 -0
  98. package/src/generated/schemas/computeCapacityRecommendation.json +1 -0
  99. package/src/generated/schemas/computeClusterHeartbeatData.json +1 -0
  100. package/src/generated/schemas/computeClusterHeartbeatStatus.json +1 -0
  101. package/src/generated/schemas/container.json +1 -1
  102. package/src/generated/schemas/containerHeartbeatData.json +1 -0
  103. package/src/generated/schemas/containerOutputs.json +1 -1
  104. package/src/generated/schemas/containerStatus.json +1 -1
  105. package/src/generated/schemas/customCertificateConfig.json +1 -1
  106. package/src/generated/schemas/customDomainConfig.json +1 -1
  107. package/src/generated/schemas/daemon.json +1 -0
  108. package/src/generated/schemas/daemonCode.json +1 -0
  109. package/src/generated/schemas/daemonHeartbeatData.json +1 -0
  110. package/src/generated/schemas/daemonOutputs.json +1 -0
  111. package/src/generated/schemas/devResourceInfo.json +1 -1
  112. package/src/generated/schemas/devStatus.json +1 -1
  113. package/src/generated/schemas/domainSettings.json +1 -1
  114. package/src/generated/schemas/eventChange.json +1 -1
  115. package/src/generated/schemas/gcpArtifactRegistryHeartbeatData.json +1 -0
  116. package/src/generated/schemas/gcpArtifactRegistryImportData.json +1 -0
  117. package/src/generated/schemas/gcpBuildImportData.json +1 -0
  118. package/src/generated/schemas/gcpCloudBuildHeartbeatData.json +1 -0
  119. package/src/generated/schemas/gcpCloudRunWorkerHeartbeatData.json +1 -0
  120. package/src/generated/schemas/gcpCloudStorageHeartbeatData.json +1 -0
  121. package/src/generated/schemas/gcpComputeClusterHeartbeatData.json +1 -0
  122. package/src/generated/schemas/gcpComputeClusterImportData.json +1 -0
  123. package/src/generated/schemas/gcpDaemonHeartbeatData.json +1 -0
  124. package/src/generated/schemas/gcpFirestoreKvHeartbeatData.json +1 -0
  125. package/src/generated/schemas/gcpKvImportData.json +1 -0
  126. package/src/generated/schemas/gcpNetworkImportData.json +1 -0
  127. package/src/generated/schemas/gcpPlatformPermission.json +1 -1
  128. package/src/generated/schemas/gcpPubSubQueueHeartbeatData.json +1 -0
  129. package/src/generated/schemas/gcpQueueImportData.json +1 -0
  130. package/src/generated/schemas/gcpRemoteStackManagementHeartbeatData.json +1 -0
  131. package/src/generated/schemas/gcpRemoteStackManagementImportData.json +1 -0
  132. package/src/generated/schemas/gcpSecretManagerVaultHeartbeatData.json +1 -0
  133. package/src/generated/schemas/gcpServiceAccountHeartbeatData.json +1 -0
  134. package/src/generated/schemas/gcpServiceAccountImportData.json +1 -0
  135. package/src/generated/schemas/gcpServiceActivationImportData.json +1 -0
  136. package/src/generated/schemas/gcpServiceUsageActivationHeartbeatData.json +1 -0
  137. package/src/generated/schemas/gcpStorageImportData.json +1 -0
  138. package/src/generated/schemas/gcpVaultImportData.json +1 -0
  139. package/src/generated/schemas/gcpVpcNetworkHeartbeatData.json +1 -0
  140. package/src/generated/schemas/gcpWorkerImportData.json +1 -0
  141. package/src/generated/schemas/heartbeatBackend.json +1 -0
  142. package/src/generated/schemas/heartbeatCollectionIssue.json +1 -0
  143. package/src/generated/schemas/heartbeatCollectionIssueReason.json +1 -0
  144. package/src/generated/schemas/heartbeatIssueSeverity.json +1 -0
  145. package/src/generated/schemas/horizonContainerHeartbeatData.json +1 -0
  146. package/src/generated/schemas/horizonWorkloadSchedulingMode.json +1 -0
  147. package/src/generated/schemas/importSourceKind.json +1 -0
  148. package/src/generated/schemas/importedResource.json +1 -0
  149. package/src/generated/schemas/ingress.json +1 -1
  150. package/src/generated/schemas/kubernetesBuildHeartbeatData.json +1 -0
  151. package/src/generated/schemas/kubernetesCertificateMode.json +1 -0
  152. package/src/generated/schemas/kubernetesCloudReference.json +1 -0
  153. package/src/generated/schemas/kubernetesClusterHeartbeatData.json +1 -0
  154. package/src/generated/schemas/kubernetesClusterNodeStatus.json +1 -0
  155. package/src/generated/schemas/kubernetesClusterOwnership.json +1 -0
  156. package/src/generated/schemas/kubernetesClusterSettings.json +1 -0
  157. package/src/generated/schemas/kubernetesContainerHeartbeatData.json +1 -0
  158. package/src/generated/schemas/kubernetesCustomCertificateConfig.json +1 -0
  159. package/src/generated/schemas/kubernetesDaemonHeartbeatData.json +1 -0
  160. package/src/generated/schemas/kubernetesEventInvolvedObject.json +1 -0
  161. package/src/generated/schemas/kubernetesEventSnapshot.json +1 -0
  162. package/src/generated/schemas/kubernetesEventSource.json +1 -0
  163. package/src/generated/schemas/kubernetesExposureSettings.json +1 -0
  164. package/src/generated/schemas/kubernetesGatewayRouteProfile.json +1 -0
  165. package/src/generated/schemas/kubernetesIngressRouteProfile.json +1 -0
  166. package/src/generated/schemas/kubernetesNodeConditionStatus.json +1 -0
  167. package/src/generated/schemas/kubernetesNodeResources.json +1 -0
  168. package/src/generated/schemas/kubernetesNodeUsage.json +1 -0
  169. package/src/generated/schemas/kubernetesOwnerReference.json +1 -0
  170. package/src/generated/schemas/kubernetesPodRuntimeUnitStatus.json +1 -0
  171. package/src/generated/schemas/kubernetesRouteProfile.json +1 -0
  172. package/src/generated/schemas/kubernetesRouteProviderOptions.json +1 -0
  173. package/src/generated/schemas/kubernetesSecretVaultHeartbeatData.json +1 -0
  174. package/src/generated/schemas/kubernetesSettings.json +1 -0
  175. package/src/generated/schemas/kubernetesTlsSecretRef.json +1 -0
  176. package/src/generated/schemas/kubernetesWorkerHeartbeatData.json +1 -0
  177. package/src/generated/schemas/kubernetesWorkloadCondition.json +1 -0
  178. package/src/generated/schemas/kubernetesWorkloadKind.json +1 -0
  179. package/src/generated/schemas/kubernetesWorkloadStatus.json +1 -0
  180. package/src/generated/schemas/kvHeartbeatData.json +1 -0
  181. package/src/generated/schemas/kvHeartbeatStatus.json +1 -0
  182. package/src/generated/schemas/localArtifactRegistryHeartbeatData.json +1 -0
  183. package/src/generated/schemas/localComputeClusterHeartbeatData.json +1 -0
  184. package/src/generated/schemas/localContainerHeartbeatData.json +1 -0
  185. package/src/generated/schemas/localDaemonHeartbeatData.json +1 -0
  186. package/src/generated/schemas/localKvHeartbeatData.json +1 -0
  187. package/src/generated/schemas/localQueueHeartbeatData.json +1 -0
  188. package/src/generated/schemas/localRuntimeEventSnapshot.json +1 -0
  189. package/src/generated/schemas/localRuntimeEventSubject.json +1 -0
  190. package/src/generated/schemas/localRuntimeUnitKind.json +1 -0
  191. package/src/generated/schemas/localRuntimeUnitStatus.json +1 -0
  192. package/src/generated/schemas/localServiceAccountHeartbeatData.json +1 -0
  193. package/src/generated/schemas/localStorageHeartbeatData.json +1 -0
  194. package/src/generated/schemas/localVaultHeartbeatData.json +1 -0
  195. package/src/generated/schemas/localWorkerHeartbeatData.json +1 -0
  196. package/src/generated/schemas/managedRuntimeEventInvolvedObject.json +1 -0
  197. package/src/generated/schemas/managedRuntimeEventSnapshot.json +1 -0
  198. package/src/generated/schemas/managedRuntimeEventSource.json +1 -0
  199. package/src/generated/schemas/managedRuntimeUnitStatus.json +1 -0
  200. package/src/generated/schemas/managementConfig.json +1 -1
  201. package/src/generated/schemas/managementPermissions.json +1 -1
  202. package/src/generated/schemas/metricSample.json +1 -0
  203. package/src/generated/schemas/metricUnit.json +1 -0
  204. package/src/generated/schemas/networkHeartbeatData.json +1 -0
  205. package/src/generated/schemas/networkHeartbeatStatus.json +1 -0
  206. package/src/generated/schemas/observedCounts.json +1 -0
  207. package/src/generated/schemas/observedHealth.json +1 -0
  208. package/src/generated/schemas/permissionGrant.json +1 -1
  209. package/src/generated/schemas/permissionProfile.json +1 -1
  210. package/src/generated/schemas/permissionSet.json +1 -1
  211. package/src/generated/schemas/permissionSetReference.json +1 -1
  212. package/src/generated/schemas/permissionsConfig.json +1 -1
  213. package/src/generated/schemas/persistentStorage.json +1 -1
  214. package/src/generated/schemas/platformPermissions.json +1 -1
  215. package/src/generated/schemas/providerFleetStatus.json +1 -0
  216. package/src/generated/schemas/providerLifecycleState.json +1 -0
  217. package/src/generated/schemas/queueHeartbeatData.json +1 -0
  218. package/src/generated/schemas/queueHeartbeatStatus.json +1 -0
  219. package/src/generated/schemas/rawHeartbeatSnippet.json +1 -0
  220. package/src/generated/schemas/rawHeartbeatSnippetFormat.json +1 -0
  221. package/src/generated/schemas/readinessProbe.json +1 -1
  222. package/src/generated/schemas/remoteStackManagementHeartbeatData.json +1 -0
  223. package/src/generated/schemas/remoteStackManagementHeartbeatStatus.json +1 -0
  224. package/src/generated/schemas/resourceEntry.json +1 -1
  225. package/src/generated/schemas/resourceHeartbeat.json +1 -0
  226. package/src/generated/schemas/resourceHeartbeatData.json +1 -0
  227. package/src/generated/schemas/resourceRef.json +1 -1
  228. package/src/generated/schemas/resourceType.json +1 -1
  229. package/src/generated/schemas/serviceAccount.json +1 -1
  230. package/src/generated/schemas/serviceAccountHeartbeatData.json +1 -0
  231. package/src/generated/schemas/serviceAccountHeartbeatStatus.json +1 -0
  232. package/src/generated/schemas/serviceActivationHeartbeatData.json +1 -0
  233. package/src/generated/schemas/serviceActivationHeartbeatStatus.json +1 -0
  234. package/src/generated/schemas/stack.json +1 -1
  235. package/src/generated/schemas/stackImportRequest.json +1 -0
  236. package/src/generated/schemas/stackImportResponse.json +1 -0
  237. package/src/generated/schemas/stackResourceState.json +1 -1
  238. package/src/generated/schemas/stackSettings.json +1 -1
  239. package/src/generated/schemas/stackState.json +1 -1
  240. package/src/generated/schemas/storageHeartbeatData.json +1 -0
  241. package/src/generated/schemas/storageHeartbeatStatus.json +1 -0
  242. package/src/generated/schemas/value.json +1 -0
  243. package/src/generated/schemas/vault.json +1 -1
  244. package/src/generated/schemas/vaultHeartbeatData.json +1 -0
  245. package/src/generated/schemas/vaultHeartbeatStatus.json +1 -0
  246. package/src/generated/schemas/worker.json +1 -0
  247. package/src/generated/schemas/workerCode.json +1 -0
  248. package/src/generated/schemas/workerHeartbeatData.json +1 -0
  249. package/src/generated/schemas/workerOutputs.json +1 -0
  250. package/src/generated/schemas/workerTrigger.json +1 -0
  251. package/src/generated/schemas/workloadHeartbeatStatus.json +1 -0
  252. package/src/generated/schemas/workloadReplicaStatus.json +1 -0
  253. package/src/generated/zod/agent-status-schema.ts +1 -1
  254. package/src/generated/zod/alien-event-schema.ts +5 -4
  255. package/src/generated/zod/artifact-registry-heartbeat-data-schema.ts +22 -0
  256. package/src/generated/zod/artifact-registry-heartbeat-status-schema.ts +26 -0
  257. package/src/generated/zod/aws-artifact-registry-import-data-schema.ts +21 -0
  258. package/src/generated/zod/aws-build-import-data-schema.ts +19 -0
  259. package/src/generated/zod/aws-code-build-heartbeat-data-schema.ts +35 -0
  260. package/src/generated/zod/aws-compute-cluster-heartbeat-data-schema.ts +37 -0
  261. package/src/generated/zod/aws-compute-cluster-import-data-schema.ts +17 -0
  262. package/src/generated/zod/aws-daemon-heartbeat-data-schema.ts +35 -0
  263. package/src/generated/zod/aws-dynamo-db-key-schema-element-schema.ts +13 -0
  264. package/src/generated/zod/aws-dynamo-db-kv-heartbeat-data-schema.ts +38 -0
  265. package/src/generated/zod/aws-ecr-artifact-registry-heartbeat-data-schema.ts +27 -0
  266. package/src/generated/zod/aws-ecr-repository-heartbeat-data-schema.ts +20 -0
  267. package/src/generated/zod/aws-iam-role-service-account-heartbeat-data-schema.ts +34 -0
  268. package/src/generated/zod/aws-kv-import-data-schema.ts +16 -0
  269. package/src/generated/zod/aws-lambda-worker-heartbeat-data-schema.ts +34 -0
  270. package/src/generated/zod/aws-network-import-data-schema.ts +26 -0
  271. package/src/generated/zod/aws-parameter-store-vault-heartbeat-data-schema.ts +27 -0
  272. package/src/generated/zod/aws-permission-effect-schema.ts +10 -0
  273. package/src/generated/zod/aws-platform-permission-schema.ts +7 -1
  274. package/src/generated/zod/aws-queue-import-data-schema.ts +17 -0
  275. package/src/generated/zod/aws-remote-stack-management-heartbeat-data-schema.ts +18 -0
  276. package/src/generated/zod/aws-remote-stack-management-import-data-schema.ts +17 -0
  277. package/src/generated/zod/aws-s3-storage-heartbeat-data-schema.ts +31 -0
  278. package/src/generated/zod/aws-service-account-import-data-schema.ts +17 -0
  279. package/src/generated/zod/aws-sqs-queue-heartbeat-data-schema.ts +38 -0
  280. package/src/generated/zod/aws-storage-import-data-schema.ts +16 -0
  281. package/src/generated/zod/aws-vault-import-data-schema.ts +17 -0
  282. package/src/generated/zod/aws-vpc-network-heartbeat-data-schema.ts +26 -0
  283. package/src/generated/zod/aws-worker-import-data-schema.ts +25 -0
  284. package/src/generated/zod/azure-artifact-registry-import-data-schema.ts +20 -0
  285. package/src/generated/zod/azure-blob-storage-heartbeat-data-schema.ts +43 -0
  286. package/src/generated/zod/azure-build-import-data-schema.ts +21 -0
  287. package/src/generated/zod/azure-compute-cluster-heartbeat-data-schema.ts +37 -0
  288. package/src/generated/zod/azure-compute-cluster-import-data-schema.ts +17 -0
  289. package/src/generated/zod/azure-container-apps-build-heartbeat-data-schema.ts +20 -0
  290. package/src/generated/zod/azure-container-apps-environment-heartbeat-data-schema.ts +32 -0
  291. package/src/generated/zod/azure-container-apps-environment-heartbeat-status-schema.ts +26 -0
  292. package/src/generated/zod/azure-container-apps-environment-import-data-schema.ts +20 -0
  293. package/src/generated/zod/azure-container-apps-environment-workload-profile-schema.ts +15 -0
  294. package/src/generated/zod/azure-container-apps-worker-heartbeat-data-schema.ts +25 -0
  295. package/src/generated/zod/azure-container-registry-heartbeat-data-schema.ts +41 -0
  296. package/src/generated/zod/azure-daemon-heartbeat-data-schema.ts +35 -0
  297. package/src/generated/zod/azure-key-vault-heartbeat-data-schema.ts +31 -0
  298. package/src/generated/zod/azure-kv-import-data-schema.ts +19 -0
  299. package/src/generated/zod/azure-managed-identity-service-account-heartbeat-data-schema.ts +30 -0
  300. package/src/generated/zod/azure-management-config-schema.ts +3 -4
  301. package/src/generated/zod/azure-network-import-data-schema.ts +22 -0
  302. package/src/generated/zod/azure-platform-permission-schema.ts +3 -1
  303. package/src/generated/zod/azure-queue-import-data-schema.ts +18 -0
  304. package/src/generated/zod/azure-remote-stack-management-heartbeat-data-schema.ts +22 -0
  305. package/src/generated/zod/azure-remote-stack-management-import-data-schema.ts +21 -0
  306. package/src/generated/zod/azure-resource-group-heartbeat-data-schema.ts +22 -0
  307. package/src/generated/zod/azure-resource-group-heartbeat-status-schema.ts +26 -0
  308. package/src/generated/zod/azure-resource-group-import-data-schema.ts +17 -0
  309. package/src/generated/zod/azure-resource-provider-activation-heartbeat-data-schema.ts +21 -0
  310. package/src/generated/zod/azure-service-account-import-data-schema.ts +20 -0
  311. package/src/generated/zod/azure-service-activation-import-data-schema.ts +17 -0
  312. package/src/generated/zod/azure-service-bus-namespace-heartbeat-data-schema.ts +34 -0
  313. package/src/generated/zod/azure-service-bus-namespace-import-data-schema.ts +18 -0
  314. package/src/generated/zod/azure-service-bus-queue-heartbeat-data-schema.ts +46 -0
  315. package/src/generated/zod/azure-storage-account-endpoints-schema.ts +17 -0
  316. package/src/generated/zod/azure-storage-account-heartbeat-data-schema.ts +42 -0
  317. package/src/generated/zod/azure-storage-account-import-data-schema.ts +22 -0
  318. package/src/generated/zod/azure-storage-import-data-schema.ts +18 -0
  319. package/src/generated/zod/azure-table-kv-heartbeat-data-schema.ts +26 -0
  320. package/src/generated/zod/azure-vault-import-data-schema.ts +18 -0
  321. package/src/generated/zod/azure-vnet-network-heartbeat-data-schema.ts +27 -0
  322. package/src/generated/zod/azure-worker-import-data-schema.ts +18 -0
  323. package/src/generated/zod/build-heartbeat-data-schema.ts +22 -0
  324. package/src/generated/zod/build-heartbeat-status-schema.ts +26 -0
  325. package/src/generated/zod/compute-capacity-blocker-category-schema.ts +10 -0
  326. package/src/generated/zod/compute-capacity-blocker-schema.ts +19 -0
  327. package/src/generated/zod/compute-capacity-group-status-schema.ts +25 -0
  328. package/src/generated/zod/compute-capacity-recommendation-schema.ts +18 -0
  329. package/src/generated/zod/compute-cluster-heartbeat-data-schema.ts +22 -0
  330. package/src/generated/zod/compute-cluster-heartbeat-status-schema.ts +26 -0
  331. package/src/generated/zod/container-heartbeat-data-schema.ts +19 -0
  332. package/src/generated/zod/container-outputs-schema.ts +2 -2
  333. package/src/generated/zod/container-schema.ts +3 -3
  334. package/src/generated/zod/container-status-schema.ts +2 -2
  335. package/src/generated/zod/custom-certificate-config-schema.ts +4 -0
  336. package/src/generated/zod/daemon-code-schema.ts +20 -0
  337. package/src/generated/zod/daemon-heartbeat-data-schema.ts +25 -0
  338. package/src/generated/zod/daemon-outputs-schema.ts +13 -0
  339. package/src/generated/zod/daemon-schema.ts +35 -0
  340. package/src/generated/zod/dev-resource-info-schema.ts +1 -1
  341. package/src/generated/zod/gcp-artifact-registry-heartbeat-data-schema.ts +35 -0
  342. package/src/generated/zod/gcp-artifact-registry-import-data-schema.ts +21 -0
  343. package/src/generated/zod/gcp-build-import-data-schema.ts +22 -0
  344. package/src/generated/zod/gcp-cloud-build-heartbeat-data-schema.ts +20 -0
  345. package/src/generated/zod/gcp-cloud-run-worker-heartbeat-data-schema.ts +29 -0
  346. package/src/generated/zod/gcp-cloud-storage-heartbeat-data-schema.ts +33 -0
  347. package/src/generated/zod/gcp-compute-cluster-heartbeat-data-schema.ts +37 -0
  348. package/src/generated/zod/gcp-compute-cluster-import-data-schema.ts +17 -0
  349. package/src/generated/zod/gcp-daemon-heartbeat-data-schema.ts +35 -0
  350. package/src/generated/zod/gcp-firestore-kv-heartbeat-data-schema.ts +32 -0
  351. package/src/generated/zod/gcp-kv-import-data-schema.ts +17 -0
  352. package/src/generated/zod/gcp-network-import-data-schema.ts +22 -0
  353. package/src/generated/zod/gcp-platform-permission-schema.ts +3 -1
  354. package/src/generated/zod/gcp-pub-sub-queue-heartbeat-data-schema.ts +54 -0
  355. package/src/generated/zod/gcp-queue-import-data-schema.ts +19 -0
  356. package/src/generated/zod/gcp-remote-stack-management-heartbeat-data-schema.ts +19 -0
  357. package/src/generated/zod/gcp-remote-stack-management-import-data-schema.ts +19 -0
  358. package/src/generated/zod/gcp-secret-manager-vault-heartbeat-data-schema.ts +19 -0
  359. package/src/generated/zod/gcp-service-account-heartbeat-data-schema.ts +28 -0
  360. package/src/generated/zod/gcp-service-account-import-data-schema.ts +18 -0
  361. package/src/generated/zod/gcp-service-activation-import-data-schema.ts +17 -0
  362. package/src/generated/zod/gcp-service-usage-activation-heartbeat-data-schema.ts +22 -0
  363. package/src/generated/zod/gcp-storage-import-data-schema.ts +18 -0
  364. package/src/generated/zod/gcp-vault-import-data-schema.ts +16 -0
  365. package/src/generated/zod/gcp-vpc-network-heartbeat-data-schema.ts +25 -0
  366. package/src/generated/zod/gcp-worker-import-data-schema.ts +23 -0
  367. package/src/generated/zod/heartbeat-backend-schema.ts +10 -0
  368. package/src/generated/zod/heartbeat-collection-issue-reason-schema.ts +10 -0
  369. package/src/generated/zod/heartbeat-collection-issue-schema.ts +21 -0
  370. package/src/generated/zod/heartbeat-issue-severity-schema.ts +10 -0
  371. package/src/generated/zod/horizon-container-heartbeat-data-schema.ts +41 -0
  372. package/src/generated/zod/horizon-workload-scheduling-mode-schema.ts +10 -0
  373. package/src/generated/zod/import-source-kind-schema.ts +13 -0
  374. package/src/generated/zod/imported-resource-schema.ts +22 -0
  375. package/src/generated/zod/index.ts +391 -9
  376. package/src/generated/zod/ingress-schema.ts +2 -2
  377. package/src/generated/zod/kubernetes-build-heartbeat-data-schema.ts +28 -0
  378. package/src/generated/zod/kubernetes-certificate-mode-schema.ts +30 -0
  379. package/src/generated/zod/kubernetes-cloud-reference-schema.ts +21 -0
  380. package/src/generated/zod/kubernetes-cluster-heartbeat-data-schema.ts +41 -0
  381. package/src/generated/zod/kubernetes-cluster-node-status-schema.ts +35 -0
  382. package/src/generated/zod/kubernetes-cluster-ownership-schema.ts +13 -0
  383. package/src/generated/zod/kubernetes-cluster-settings-schema.ts +23 -0
  384. package/src/generated/zod/kubernetes-container-heartbeat-data-schema.ts +45 -0
  385. package/src/generated/zod/kubernetes-custom-certificate-config-schema.ts +15 -0
  386. package/src/generated/zod/kubernetes-daemon-heartbeat-data-schema.ts +42 -0
  387. package/src/generated/zod/kubernetes-event-involved-object-schema.ts +18 -0
  388. package/src/generated/zod/kubernetes-event-snapshot-schema.ts +30 -0
  389. package/src/generated/zod/kubernetes-event-source-schema.ts +13 -0
  390. package/src/generated/zod/kubernetes-exposure-settings-schema.ts +34 -0
  391. package/src/generated/zod/kubernetes-gateway-route-profile-schema.ts +27 -0
  392. package/src/generated/zod/kubernetes-ingress-route-profile-schema.ts +26 -0
  393. package/src/generated/zod/kubernetes-node-condition-status-schema.ts +15 -0
  394. package/src/generated/zod/kubernetes-node-resources-schema.ts +19 -0
  395. package/src/generated/zod/kubernetes-node-usage-schema.ts +18 -0
  396. package/src/generated/zod/kubernetes-owner-reference-schema.ts +15 -0
  397. package/src/generated/zod/kubernetes-pod-runtime-unit-status-schema.ts +31 -0
  398. package/src/generated/zod/kubernetes-route-profile-schema.ts +19 -0
  399. package/src/generated/zod/kubernetes-route-provider-options-schema.ts +27 -0
  400. package/src/generated/zod/kubernetes-secret-vault-heartbeat-data-schema.ts +18 -0
  401. package/src/generated/zod/kubernetes-settings-schema.ts +22 -0
  402. package/src/generated/zod/kubernetes-tls-secret-ref-schema.ts +16 -0
  403. package/src/generated/zod/kubernetes-worker-heartbeat-data-schema.ts +46 -0
  404. package/src/generated/zod/kubernetes-workload-condition-schema.ts +16 -0
  405. package/src/generated/zod/kubernetes-workload-kind-schema.ts +10 -0
  406. package/src/generated/zod/kubernetes-workload-status-schema.ts +22 -0
  407. package/src/generated/zod/kv-heartbeat-data-schema.ts +22 -0
  408. package/src/generated/zod/kv-heartbeat-status-schema.ts +26 -0
  409. package/src/generated/zod/local-artifact-registry-heartbeat-data-schema.ts +17 -0
  410. package/src/generated/zod/local-compute-cluster-heartbeat-data-schema.ts +30 -0
  411. package/src/generated/zod/local-container-heartbeat-data-schema.ts +39 -0
  412. package/src/generated/zod/local-daemon-heartbeat-data-schema.ts +30 -0
  413. package/src/generated/zod/local-kv-heartbeat-data-schema.ts +20 -0
  414. package/src/generated/zod/local-queue-heartbeat-data-schema.ts +18 -0
  415. package/src/generated/zod/local-runtime-event-snapshot-schema.ts +26 -0
  416. package/src/generated/zod/local-runtime-event-subject-schema.ts +14 -0
  417. package/src/generated/zod/local-runtime-unit-kind-schema.ts +10 -0
  418. package/src/generated/zod/local-runtime-unit-status-schema.ts +28 -0
  419. package/src/generated/zod/local-service-account-heartbeat-data-schema.ts +17 -0
  420. package/src/generated/zod/local-storage-heartbeat-data-schema.ts +20 -0
  421. package/src/generated/zod/local-vault-heartbeat-data-schema.ts +21 -0
  422. package/src/generated/zod/local-worker-heartbeat-data-schema.ts +35 -0
  423. package/src/generated/zod/managed-runtime-event-involved-object-schema.ts +20 -0
  424. package/src/generated/zod/managed-runtime-event-snapshot-schema.ts +34 -0
  425. package/src/generated/zod/managed-runtime-event-source-schema.ts +13 -0
  426. package/src/generated/zod/managed-runtime-unit-status-schema.ts +34 -0
  427. package/src/generated/zod/metric-sample-schema.ts +16 -0
  428. package/src/generated/zod/metric-unit-schema.ts +10 -0
  429. package/src/generated/zod/network-heartbeat-data-schema.ts +19 -0
  430. package/src/generated/zod/network-heartbeat-status-schema.ts +26 -0
  431. package/src/generated/zod/observed-counts-schema.ts +14 -0
  432. package/src/generated/zod/observed-health-schema.ts +10 -0
  433. package/src/generated/zod/permission-grant-schema.ts +3 -1
  434. package/src/generated/zod/persistent-storage-schema.ts +2 -5
  435. package/src/generated/zod/provider-fleet-status-schema.ts +16 -0
  436. package/src/generated/zod/provider-lifecycle-state-schema.ts +10 -0
  437. package/src/generated/zod/queue-heartbeat-data-schema.ts +22 -0
  438. package/src/generated/zod/queue-heartbeat-status-schema.ts +26 -0
  439. package/src/generated/zod/raw-heartbeat-snippet-format-schema.ts +10 -0
  440. package/src/generated/zod/raw-heartbeat-snippet-schema.ts +19 -0
  441. package/src/generated/zod/readiness-probe-schema.ts +2 -2
  442. package/src/generated/zod/remote-stack-management-heartbeat-data-schema.ts +19 -0
  443. package/src/generated/zod/remote-stack-management-heartbeat-status-schema.ts +26 -0
  444. package/src/generated/zod/resource-heartbeat-data-schema.ts +124 -0
  445. package/src/generated/zod/resource-heartbeat-schema.ts +34 -0
  446. package/src/generated/zod/service-account-heartbeat-data-schema.ts +22 -0
  447. package/src/generated/zod/service-account-heartbeat-status-schema.ts +26 -0
  448. package/src/generated/zod/service-activation-heartbeat-data-schema.ts +16 -0
  449. package/src/generated/zod/service-activation-heartbeat-status-schema.ts +26 -0
  450. package/src/generated/zod/stack-import-request-schema.ts +46 -0
  451. package/src/generated/zod/stack-import-response-schema.ts +24 -0
  452. package/src/generated/zod/stack-resource-state-schema.ts +5 -2
  453. package/src/generated/zod/stack-schema.ts +5 -1
  454. package/src/generated/zod/stack-settings-schema.ts +4 -0
  455. package/src/generated/zod/storage-heartbeat-data-schema.ts +22 -0
  456. package/src/generated/zod/storage-heartbeat-status-schema.ts +26 -0
  457. package/src/generated/zod/value-schema.ts +10 -0
  458. package/src/generated/zod/vault-heartbeat-data-schema.ts +25 -0
  459. package/src/generated/zod/vault-heartbeat-status-schema.ts +26 -0
  460. package/src/generated/zod/vault-schema.ts +2 -2
  461. package/src/generated/zod/{function-code-schema.ts → worker-code-schema.ts} +4 -4
  462. package/src/generated/zod/worker-heartbeat-data-schema.ts +25 -0
  463. package/src/generated/zod/{function-outputs-schema.ts → worker-outputs-schema.ts} +6 -6
  464. package/src/generated/zod/worker-schema.ts +43 -0
  465. package/src/generated/zod/{function-trigger-schema.ts → worker-trigger-schema.ts} +4 -4
  466. package/src/generated/zod/workload-heartbeat-status-schema.ts +26 -0
  467. package/src/generated/zod/workload-replica-status-schema.ts +17 -0
  468. package/src/get-resource-outputs.ts +4 -4
  469. package/src/index.ts +310 -1
  470. package/src/resource.ts +1 -1
  471. package/src/service-account.ts +2 -2
  472. package/src/stack.ts +11 -1
  473. package/src/vault.ts +1 -1
  474. package/src/{function.ts → worker.ts} +63 -64
  475. package/src/generated/schemas/function.json +0 -1
  476. package/src/generated/schemas/functionCode.json +0 -1
  477. package/src/generated/schemas/functionOutputs.json +0 -1
  478. package/src/generated/schemas/functionTrigger.json +0 -1
  479. package/src/generated/zod/function-schema.ts +0 -43
@@ -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?: {
@@ -1,4 +1,4 @@
1
- import { gt as StackStateSchema } from "../stack.js";
1
+ import { di as StackStateSchema } from "../stack.js";
2
2
  //#region src/tests/index.ts
3
3
  function getStackState() {
4
4
  return StackStateSchema.parse(JSON.parse(process.env.ALIEN_STACK_STATE));
@@ -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;AAC9B,QAAO,iBAAiB,MAAM,KAAK,MAAM,QAAQ,IAAI,kBAAmB,CAAC"}
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alienplatform/core",
3
- "version": "1.3.5",
3
+ "version": "1.4.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -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
- "type": "function",
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
- "function/management",
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-function": {
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-function",
147
+ "id": "test-worker",
145
148
  "ingress": "private",
146
149
  "links": [],
147
150
  "memoryMb": 256,
148
151
  "permissions": "execution",
149
152
  "timeoutSeconds": 180,
150
- "type": "function",
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
- "function/management",
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-function": {
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-function",
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
- "type": "function",
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 function source 1`] = `
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
- "function/management",
310
+ "worker/management",
305
311
  ],
306
312
  },
307
313
  },
308
314
  "profiles": {
309
315
  "execution": {
310
316
  "*": [
311
- "function/execute",
317
+ "worker/execute",
312
318
  ],
313
319
  },
314
320
  },
315
321
  },
316
322
  "resources": {
317
- "my-source-function": {
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-function",
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
- "type": "function",
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: Functions get serialized differently by serialize-error
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 { FunctionSchema } from "../generated/index.js"
3
+ import { WorkerSchema } from "../generated/index.js"
4
4
  import * as alien from "../index.js"
5
5
 
6
- // Shared image URI for functions in tests
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 function with permissions
15
- const func = new alien.Function("my-test-function")
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(func, "live")
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
- "*": ["function/management", "storage/management"],
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-function")
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 function source", () => {
116
- const funcWithSource = new alien.Function("my-source-function")
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(funcWithSource, "live")
148
+ .add(workerWithSource, "live")
130
149
  .permissions({
131
150
  profiles: {
132
151
  execution: {
133
- "*": ["function/execute"],
152
+ "*": ["worker/execute"],
134
153
  },
135
154
  },
136
155
  management: {
137
156
  extend: {
138
- "*": ["function/management"],
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-function")
146
- const resourceInStack = stack.resources["my-source-function"]
164
+ expect(stack.resources).toHaveProperty("my-source-worker")
165
+ const resourceInStack = stack.resources["my-source-worker"]
147
166
  expect(resourceInStack).toBeDefined()
148
- const functionConfigFromStack = FunctionSchema.parse(resourceInStack!.config)
149
- expect(functionConfigFromStack.code.type).toBe("source")
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 function with permissions
174
- const func = new alien.Function("test-function")
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(func, "live")
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
- "*": ["function/management"],
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-function")
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 func = new alien.Function("registry-user")
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(func, "live")
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 Horizon. They're designed for always-on workloads like web services, APIs,
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, ContainerClusterMutation will auto-assign
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 ContainerCluster resource ID.
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 (requires stateful=true).
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
- this._config.persistentStorage = {
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
- /** Function to generate human-readable error message from context */
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, Functions, custom classes, etc.)
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
  }