spawnfile 0.1.14 → 0.1.17
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/README.md +60 -159
- package/dist/audit/checksShared.d.ts +1 -1
- package/dist/auth/importers.d.ts +10 -0
- package/dist/auth/importers.js +29 -4
- package/dist/auth/index.d.ts +2 -0
- package/dist/auth/index.js +1 -0
- package/dist/auth/paths.d.ts +1 -1
- package/dist/auth/profileStore.js +9 -9
- package/dist/auth/targetSecretSourceFsIdentity.d.ts +40 -0
- package/dist/auth/targetSecretSourceFsIdentity.js +42 -0
- package/dist/auth/targetSecretSourceFsPublish.d.ts +2 -0
- package/dist/auth/targetSecretSourceFsPublish.js +3 -1
- package/dist/auth/targetSecretSourceFsPublishImmutable.d.ts +2 -1
- package/dist/auth/targetSecretSourceFsPublishImmutable.js +104 -71
- package/dist/auth/targetSecretSourceFsRead.js +5 -14
- package/dist/auth/trainingAuth.d.ts +21 -0
- package/dist/auth/trainingAuth.js +86 -0
- package/dist/auth/types.d.ts +1 -1
- package/dist/cli/authCommands.d.ts +1 -1
- package/dist/cli/authCommands.js +9 -0
- package/dist/cli/canaryCutoverCommand.d.ts +2 -0
- package/dist/cli/canaryCutoverCommand.js +30 -0
- package/dist/cli/capabilitiesCommand.d.ts +3 -0
- package/dist/cli/capabilitiesCommand.js +12 -0
- package/dist/cli/capabilitiesReceipt.d.ts +56 -0
- package/dist/cli/capabilitiesReceipt.js +56 -0
- package/dist/cli/compileBuildCommands.js +13 -0
- package/dist/cli/composedLifecycleContractSet.d.ts +21 -0
- package/dist/cli/composedLifecycleContractSet.js +204 -0
- package/dist/cli/devCommands.js +2 -0
- package/dist/cli/downCommand.js +19 -8
- package/dist/cli/evidenceExportHelperCommand.d.ts +13 -0
- package/dist/cli/evidenceExportHelperCommand.js +51 -0
- package/dist/cli/index.js +12 -3
- package/dist/cli/lifecycleMachine.d.ts +7 -1
- package/dist/cli/lifecycleMachine.js +2 -2
- package/dist/cli/paideiaDelegation.d.ts +17 -0
- package/dist/cli/paideiaDelegation.js +210 -0
- package/dist/cli/paideiaSupervisor.d.ts +17 -0
- package/dist/cli/paideiaSupervisor.js +48 -0
- package/dist/cli/productStateCloneCommand.d.ts +2 -0
- package/dist/cli/productStateCloneCommand.js +34 -0
- package/dist/cli/runCli.d.ts +13 -3
- package/dist/cli/runCli.js +37 -9
- package/dist/cli/targetCommands.d.ts +4 -7
- package/dist/cli/targetCommands.js +16 -46
- package/dist/cli/targetConfigPreparedPlan.d.ts +3 -0
- package/dist/cli/targetConfigPreparedPlan.js +74 -0
- package/dist/cli/targetConfigResolver.d.ts +3 -0
- package/dist/cli/targetConfigResolver.js +111 -0
- package/dist/cli/targetConfigResolverCommand.d.ts +6 -0
- package/dist/cli/targetConfigResolverCommand.js +43 -0
- package/dist/cli/targetConfigResolverContracts.d.ts +56 -0
- package/dist/cli/targetConfigResolverContracts.js +30 -0
- package/dist/cli/targetConfigResolverDocker.d.ts +4 -0
- package/dist/cli/targetConfigResolverDocker.js +47 -0
- package/dist/cli/targetConfigResolverValidation.d.ts +10 -0
- package/dist/cli/targetConfigResolverValidation.js +94 -0
- package/dist/cli/targetDefaultAuthorities.d.ts +2 -0
- package/dist/cli/targetDefaultAuthorities.js +3 -0
- package/dist/cli/targetDefaultConfig.d.ts +7 -0
- package/dist/cli/targetDefaultConfig.js +22 -5
- package/dist/cli/targetDefaultConfigStdin.js +7 -1
- package/dist/cli/targetDefaultHandlerFactory.js +23 -2
- package/dist/cli/targetDefaultHandlers.d.ts +2 -2
- package/dist/cli/targetProductionCommands.d.ts +5 -0
- package/dist/cli/targetProductionCommands.js +45 -0
- package/dist/cli/trainCommand.d.ts +3 -0
- package/dist/cli/trainCommand.js +61 -0
- package/dist/cli/upCommand.js +35 -6
- package/dist/cli/upLifecycleRecovery.d.ts +2 -2
- package/dist/cli/upLifecycleRecovery.js +188 -44
- package/dist/cli/usageCommand.d.ts +40 -0
- package/dist/cli/usageCommand.js +284 -0
- package/dist/cli/usageCommandLive.d.ts +84 -0
- package/dist/cli/usageCommandLive.js +95 -0
- package/dist/cli/usageDeploymentSource.d.ts +9 -0
- package/dist/cli/usageDeploymentSource.js +22 -0
- package/dist/cli/workspaceResourceMigrationCommand.d.ts +8 -0
- package/dist/cli/workspaceResourceMigrationCommand.js +36 -0
- package/dist/compiler/buildCompilePlanTeams.d.ts +1 -1
- package/dist/compiler/buildCompilePlanTeams.js +6 -1
- package/dist/compiler/compilePlanHelpers.js +3 -0
- package/dist/compiler/compileProject.d.ts +2 -0
- package/dist/compiler/compileProject.js +5 -1
- package/dist/compiler/compileProjectSupport.js +9 -0
- package/dist/compiler/containerArtifacts.d.ts +3 -1
- package/dist/compiler/containerArtifacts.js +92 -40
- package/dist/compiler/containerArtifactsPlans.d.ts +1 -1
- package/dist/compiler/containerArtifactsPlans.js +24 -7
- package/dist/compiler/containerArtifactsRender.d.ts +2 -1
- package/dist/compiler/containerArtifactsRender.js +91 -58
- package/dist/compiler/containerArtifactsTypes.d.ts +8 -0
- package/dist/compiler/containerBackedMountRender.d.ts +56 -0
- package/dist/compiler/containerBackedMountRender.js +101 -0
- package/dist/compiler/containerDaimonBrokerRender.d.ts +112 -0
- package/dist/compiler/containerDaimonBrokerRender.js +191 -0
- package/dist/compiler/containerDaimonGrokWorkerProvisioning.d.ts +38 -0
- package/dist/compiler/containerDaimonGrokWorkerProvisioning.js +108 -0
- package/dist/compiler/containerDaimonGrokWorkerRender.d.ts +172 -0
- package/dist/compiler/containerDaimonGrokWorkerRender.js +268 -0
- package/dist/compiler/containerDaimonOwnershipGuardRender.d.ts +12 -0
- package/dist/compiler/containerDaimonOwnershipGuardRender.js +191 -0
- package/dist/compiler/containerDaimonUidEntrypointRender.d.ts +24 -0
- package/dist/compiler/containerDaimonUidEntrypointRender.js +297 -0
- package/dist/compiler/containerEntrypointRender.d.ts +7 -0
- package/dist/compiler/containerEntrypointRender.js +28 -22
- package/dist/compiler/containerPersistentMounts.d.ts +30 -0
- package/dist/compiler/containerPersistentMounts.js +66 -0
- package/dist/compiler/containerReadinessPaths.d.ts +1 -0
- package/dist/compiler/containerReadinessPaths.js +1 -0
- package/dist/compiler/containerRuntimeLinkMaterializer.d.ts +2 -0
- package/dist/compiler/containerRuntimeLinkMaterializer.js +12 -0
- package/dist/compiler/containerRuntimeReadinessRender.d.ts +7 -0
- package/dist/compiler/containerRuntimeReadinessRender.js +40 -0
- package/dist/compiler/containerStateOwnershipRender.d.ts +4 -0
- package/dist/compiler/containerStateOwnershipRender.js +75 -0
- package/dist/compiler/containerTargetResources.d.ts +22 -1
- package/dist/compiler/containerTargetResources.js +94 -2
- package/dist/compiler/containerVolumeBootstrap.d.ts +3 -0
- package/dist/compiler/containerVolumeBootstrap.js +3 -0
- package/dist/compiler/containerWorkspaceResourceRender.js +49 -1
- package/dist/compiler/daimonTelemetryArtifacts.d.ts +2 -2
- package/dist/compiler/daimonTelemetryArtifacts.js +5 -10
- package/dist/compiler/deploymentLineage.d.ts +40 -0
- package/dist/compiler/deploymentLineage.js +50 -0
- package/dist/compiler/index.d.ts +3 -0
- package/dist/compiler/index.js +3 -0
- package/dist/compiler/initProject.d.ts +2 -0
- package/dist/compiler/initProject.js +39 -1
- package/dist/compiler/localMoltnetAuthority.d.ts +64 -0
- package/dist/compiler/localMoltnetAuthority.js +177 -0
- package/dist/compiler/memoryArtifacts.d.ts +1 -1
- package/dist/compiler/memoryArtifacts.js +108 -32
- package/dist/compiler/modelEnv.d.ts +5 -0
- package/dist/compiler/modelEnv.js +8 -2
- package/dist/compiler/moltnetArtifactPaths.d.ts +17 -12
- package/dist/compiler/moltnetArtifactPaths.js +17 -15
- package/dist/compiler/moltnetArtifactTypes.d.ts +10 -0
- package/dist/compiler/moltnetArtifacts.d.ts +1 -1
- package/dist/compiler/moltnetArtifacts.js +52 -12
- package/dist/compiler/moltnetBinaries.d.ts +16 -4
- package/dist/compiler/moltnetBinaries.js +46 -6
- package/dist/compiler/moltnetClientConfig.js +1 -1
- package/dist/compiler/moltnetConfigLowering.d.ts +3 -1
- package/dist/compiler/moltnetConfigLowering.js +30 -6
- package/dist/compiler/moltnetNodeConfig.js +1 -1
- package/dist/compiler/moltnetReleaseAuthority.d.ts +24 -1
- package/dist/compiler/moltnetReleaseAuthority.js +33 -4
- package/dist/compiler/moltnetRepresentativeResolution.d.ts +1 -1
- package/dist/compiler/moltnetRepresentativeResolution.js +2 -2
- package/dist/compiler/moltnetResolution.js +9 -15
- package/dist/compiler/moltnetRoomMemberships.js +20 -5
- package/dist/compiler/moltnetRoomPolicyCompatibility.d.ts +1 -1
- package/dist/compiler/moltnetRoomPolicyCompatibility.js +3 -1
- package/dist/compiler/moltnetRuntimeConfig.d.ts +1 -1
- package/dist/compiler/moltnetRuntimeConfig.js +22 -2
- package/dist/compiler/moltnetServerPlans.js +19 -0
- package/dist/compiler/organizationExternalParticipants.d.ts +3 -0
- package/dist/compiler/organizationExternalParticipants.js +176 -0
- package/dist/compiler/organizationIdentity.d.ts +3 -9
- package/dist/compiler/organizationIdentity.js +37 -270
- package/dist/compiler/organizationIdentityGraph.d.ts +15 -0
- package/dist/compiler/organizationIdentityGraph.js +115 -0
- package/dist/compiler/organizationReadyEvidence.d.ts +8 -0
- package/dist/compiler/organizationReadyEvidence.js +23 -3
- package/dist/compiler/runProject.d.ts +4 -2
- package/dist/compiler/runProject.js +32 -6
- package/dist/compiler/runProjectAuth.d.ts +3 -1
- package/dist/compiler/runProjectAuth.js +19 -3
- package/dist/compiler/runProjectDaimonCodexDocker.d.ts +3 -0
- package/dist/compiler/runProjectDaimonCodexDocker.js +36 -0
- package/dist/compiler/runProjectDocker.d.ts +8 -4
- package/dist/compiler/runProjectDocker.js +43 -18
- package/dist/compiler/runProjectDockerDaimonGuards.d.ts +15 -0
- package/dist/compiler/runProjectDockerDaimonGuards.js +122 -0
- package/dist/compiler/runProjectDockerReservation.d.ts +3 -0
- package/dist/compiler/runProjectDockerReservation.js +118 -0
- package/dist/compiler/runProjectLifecycle.js +1 -1
- package/dist/compiler/training/broker/declaration.d.ts +45 -0
- package/dist/compiler/training/broker/declaration.js +55 -0
- package/dist/compiler/training/broker/entrypoint.d.ts +39 -0
- package/dist/compiler/training/broker/entrypoint.js +111 -0
- package/dist/compiler/training/broker/index.d.ts +10 -0
- package/dist/compiler/training/broker/index.js +10 -0
- package/dist/compiler/training/broker/main.d.ts +2 -0
- package/dist/compiler/training/broker/main.js +14 -0
- package/dist/compiler/training/broker/paths.d.ts +196 -0
- package/dist/compiler/training/broker/paths.js +241 -0
- package/dist/compiler/training/broker/processes.d.ts +42 -0
- package/dist/compiler/training/broker/processes.js +99 -0
- package/dist/compiler/training/broker/projection.d.ts +51 -0
- package/dist/compiler/training/broker/projection.js +76 -0
- package/dist/compiler/training/broker/provisioning.d.ts +87 -0
- package/dist/compiler/training/broker/provisioning.js +213 -0
- package/dist/compiler/training/broker/receipt.d.ts +77 -0
- package/dist/compiler/training/broker/receipt.js +110 -0
- package/dist/compiler/training/broker/registration.d.ts +41 -0
- package/dist/compiler/training/broker/registration.js +102 -0
- package/dist/compiler/training/broker/runtime.d.ts +25 -0
- package/dist/compiler/training/broker/runtime.js +173 -0
- package/dist/compiler/training/broker/seccompRoutes.d.ts +31 -0
- package/dist/compiler/training/broker/seccompRoutes.js +36 -0
- package/dist/compiler/training/broker/supervisor.d.ts +109 -0
- package/dist/compiler/training/broker/supervisor.js +173 -0
- package/dist/compiler/training/container/contract.d.ts +31 -0
- package/dist/compiler/training/container/contract.js +33 -0
- package/dist/compiler/training/container/index.d.ts +4 -0
- package/dist/compiler/training/container/index.js +2 -0
- package/dist/compiler/training/container/launch.d.ts +18 -0
- package/dist/compiler/training/container/launch.js +173 -0
- package/dist/compiler/training/container/prepare.d.ts +8 -0
- package/dist/compiler/training/container/prepare.js +80 -0
- package/dist/compiler/training/container/process.d.ts +14 -0
- package/dist/compiler/training/container/process.js +70 -0
- package/dist/compiler/training/container/security.d.ts +36 -0
- package/dist/compiler/training/container/security.js +58 -0
- package/dist/compiler/training/context.d.ts +7 -0
- package/dist/compiler/training/context.js +93 -0
- package/dist/compiler/training/contract.d.ts +142 -0
- package/dist/compiler/training/contract.js +34 -0
- package/dist/compiler/training/index.d.ts +4 -0
- package/dist/compiler/training/index.js +3 -0
- package/dist/compiler/training/preparation/assets/Dockerfile +98 -0
- package/dist/compiler/training/preparation/assets/package-lock.json +3787 -0
- package/dist/compiler/training/preparation/broker.d.ts +21 -0
- package/dist/compiler/training/preparation/broker.js +43 -0
- package/dist/compiler/training/preparation/contextModes.d.ts +12 -0
- package/dist/compiler/training/preparation/contextModes.js +38 -0
- package/dist/compiler/training/preparation/contract.d.ts +182 -0
- package/dist/compiler/training/preparation/contract.js +94 -0
- package/dist/compiler/training/preparation/copyAssets.d.ts +1 -0
- package/dist/compiler/training/preparation/copyAssets.js +8 -0
- package/dist/compiler/training/preparation/daimonParent.d.ts +42 -0
- package/dist/compiler/training/preparation/daimonParent.js +114 -0
- package/dist/compiler/training/preparation/files.d.ts +25 -0
- package/dist/compiler/training/preparation/files.js +85 -0
- package/dist/compiler/training/preparation/image.d.ts +28 -0
- package/dist/compiler/training/preparation/image.js +102 -0
- package/dist/compiler/training/preparation/index.d.ts +3 -0
- package/dist/compiler/training/preparation/index.js +2 -0
- package/dist/compiler/training/preparation/inputs.d.ts +23 -0
- package/dist/compiler/training/preparation/inputs.js +93 -0
- package/dist/compiler/training/preparation/prepare.d.ts +33 -0
- package/dist/compiler/training/preparation/prepare.js +186 -0
- package/dist/compiler/training/preparation/scratch.d.ts +19 -0
- package/dist/compiler/training/preparation/scratch.js +48 -0
- package/dist/compiler/training/repair/compatibility.d.ts +11 -0
- package/dist/compiler/training/repair/compatibility.js +34 -0
- package/dist/compiler/training/repair/contract.d.ts +506 -0
- package/dist/compiler/training/repair/contract.js +31 -0
- package/dist/compiler/training/repair/index.d.ts +3 -0
- package/dist/compiler/training/repair/index.js +3 -0
- package/dist/compiler/training/repair/prepare.d.ts +230 -0
- package/dist/compiler/training/repair/prepare.js +74 -0
- package/dist/compiler/training/repair/witness.d.ts +203 -0
- package/dist/compiler/training/repair/witness.js +42 -0
- package/dist/compiler/types.d.ts +2 -0
- package/dist/compiler/upProject.d.ts +26 -1
- package/dist/compiler/upProject.js +117 -178
- package/dist/compiler/upProjectHandoff.d.ts +62 -0
- package/dist/compiler/upProjectHandoff.js +204 -0
- package/dist/compiler/upReceipt.js +49 -4
- package/dist/compiler/updateProjectModels.js +1 -0
- package/dist/compiler/view/types.d.ts +1 -1
- package/dist/compiler/workspaceBundleArtifacts.d.ts +3 -0
- package/dist/compiler/workspaceBundleArtifacts.js +106 -0
- package/dist/compiler/workspaceResources.d.ts +4 -1
- package/dist/compiler/workspaceResources.js +12 -7
- package/dist/deployment/artifactsExportPlan.js +51 -1
- package/dist/deployment/canaryCutover.d.ts +42 -0
- package/dist/deployment/canaryCutover.js +140 -0
- package/dist/deployment/candidateDiagnostics.d.ts +15 -0
- package/dist/deployment/candidateDiagnostics.js +90 -0
- package/dist/deployment/dockerLogs.js +4 -1
- package/dist/deployment/dockerManager.js +9 -3
- package/dist/deployment/dockerProbeGateway.d.ts +17 -0
- package/dist/deployment/dockerProbeGateway.js +17 -2
- package/dist/deployment/downDeployment.d.ts +5 -0
- package/dist/deployment/downDeployment.js +109 -8
- package/dist/deployment/downReceiptTypes.d.ts +17 -2
- package/dist/deployment/downReceiptTypes.js +17 -2
- package/dist/deployment/index.d.ts +4 -0
- package/dist/deployment/index.js +4 -0
- package/dist/deployment/lifecycleCompletionContracts.d.ts +66 -0
- package/dist/deployment/lifecycleCompletionContracts.js +34 -0
- package/dist/deployment/lifecycleCompletionPaths.d.ts +4 -1
- package/dist/deployment/lifecycleCompletionPaths.js +3 -0
- package/dist/deployment/lifecycleCompletionPublication.d.ts +2 -0
- package/dist/deployment/lifecycleCompletionPublication.js +18 -4
- package/dist/deployment/lifecycleCompletionStore.d.ts +1 -1
- package/dist/deployment/lifecycleCompletionStore.js +7 -7
- package/dist/deployment/lifecycleUpRecords.d.ts +11 -0
- package/dist/deployment/lifecycleUpRecords.js +127 -0
- package/dist/deployment/native/AGENTS.md +11 -0
- package/dist/deployment/native/rename-noreplace-arm64 +0 -0
- package/dist/deployment/native/rename-noreplace-arm64.provenance.json +1 -0
- package/dist/deployment/native/rename-noreplace-x64 +0 -0
- package/dist/deployment/native/rename-noreplace-x64.provenance.json +1 -0
- package/dist/deployment/noReplaceActivation.d.ts +17 -0
- package/dist/deployment/noReplaceActivation.js +50 -0
- package/dist/deployment/organizationHandoffAuthorityFsBudget.d.ts +110 -0
- package/dist/deployment/organizationHandoffAuthorityFsBudget.js +156 -0
- package/dist/deployment/organizationHandoffAuthorityFsClient.js +82 -27
- package/dist/deployment/organizationHandoffAuthorityFsElection.d.ts +21 -0
- package/dist/deployment/organizationHandoffAuthorityFsElection.js +57 -0
- package/dist/deployment/organizationHandoffAuthorityFsWorker.js +254 -108
- package/dist/deployment/organizationHandoffAuthorityFsWorkerStall.fixture.d.ts +1 -0
- package/dist/deployment/organizationHandoffAuthorityFsWorkerStall.fixture.js +16 -0
- package/dist/deployment/organizationHandoffAuthorityStore.js +14 -7
- package/dist/deployment/organizationHandoffAuthorityTypes.d.ts +2 -2
- package/dist/deployment/organizationHandoffAuthorityTypes.js +2 -1
- package/dist/deployment/organizationReady.d.ts +2 -0
- package/dist/deployment/organizationReady.js +36 -4
- package/dist/deployment/productStateClone.d.ts +43 -0
- package/dist/deployment/productStateClone.js +319 -0
- package/dist/deployment/upLifecycleRecoveryState.d.ts +23 -0
- package/dist/deployment/upLifecycleRecoveryState.js +12 -0
- package/dist/deployment/upReceiptTypes.d.ts +32 -6
- package/dist/deployment/upReceiptTypes.js +29 -2
- package/dist/deployment/workspaceResourceMigration.d.ts +55 -0
- package/dist/deployment/workspaceResourceMigration.js +315 -0
- package/dist/dev/project.d.ts +7 -0
- package/dist/dev/project.js +9 -0
- package/dist/distribution/consumeImage.d.ts +2 -0
- package/dist/distribution/consumeImage.js +98 -73
- package/dist/distribution/consumeImageDaimonDocker.d.ts +3 -0
- package/dist/distribution/consumeImageDaimonDocker.js +45 -0
- package/dist/distribution/consumeImageLifecycle.d.ts +17 -0
- package/dist/distribution/consumeImageLifecycle.js +231 -0
- package/dist/distribution/consumeImageSupport.d.ts +12 -0
- package/dist/distribution/consumeImageSupport.js +15 -0
- package/dist/distribution/distributionReportSchema.d.ts +11 -1
- package/dist/distribution/distributionReportSchema.js +15 -2
- package/dist/distribution/dockerRunner.d.ts +6 -1
- package/dist/distribution/dockerRunner.js +31 -4
- package/dist/distribution/imageRuntimeAuth.d.ts +9 -1
- package/dist/distribution/imageRuntimeAuth.js +70 -1
- package/dist/distribution/index.d.ts +1 -1
- package/dist/distribution/index.js +1 -1
- package/dist/distribution/preflight.js +5 -1
- package/dist/distribution/types.d.ts +14 -1
- package/dist/distribution/types.js +3 -0
- package/dist/evidenceExportHelper/boundedExecutor.d.ts +3 -0
- package/dist/evidenceExportHelper/boundedExecutor.js +33 -0
- package/dist/evidenceExportHelper/helperProgram.mjs +156 -0
- package/dist/evidenceExportHelper/index.d.ts +4 -0
- package/dist/evidenceExportHelper/index.js +4 -0
- package/dist/evidenceExportHelper/preparedAuthority.d.ts +64 -0
- package/dist/evidenceExportHelper/preparedAuthority.js +228 -0
- package/dist/evidenceExportHelper/preparedBuilder.d.ts +10 -0
- package/dist/evidenceExportHelper/preparedBuilder.js +183 -0
- package/dist/evidenceExportHelper/preparedBuilderTypes.d.ts +19 -0
- package/dist/evidenceExportHelper/preparedBuilderTypes.js +1 -0
- package/dist/evidenceExportHelper/recipe.d.ts +7 -0
- package/dist/evidenceExportHelper/recipe.js +83 -0
- package/dist/filesystem/io.d.ts +2 -0
- package/dist/filesystem/io.js +16 -1
- package/dist/manifest/executionSchemas.d.ts +27 -0
- package/dist/manifest/executionSchemas.js +21 -2
- package/dist/manifest/mcpSchemas.d.ts +1 -0
- package/dist/manifest/mcpSchemas.js +3 -0
- package/dist/manifest/renderSpawnfileNetworks.js +11 -0
- package/dist/manifest/renderSpawnfileWorkspace.js +5 -0
- package/dist/manifest/scheduleSchemas.d.ts +3 -1
- package/dist/manifest/scheduleSchemas.js +91 -5
- package/dist/manifest/schemas.d.ts +237 -12
- package/dist/manifest/schemas.js +5 -2
- package/dist/manifest/teamNetworkAccessSchemas.d.ts +5 -1
- package/dist/manifest/teamNetworkAccessSchemas.js +11 -0
- package/dist/manifest/teamNetworkAuthSchemas.d.ts +1 -1
- package/dist/manifest/teamNetworkSchemas.d.ts +17 -3
- package/dist/manifest/teamNetworkSchemas.js +19 -1
- package/dist/manifest/teamNetworkServerSchemas.d.ts +8 -3
- package/dist/manifest/teamNetworkServerSchemas.js +18 -2
- package/dist/manifest/workspaceSchemas.d.ts +16 -0
- package/dist/manifest/workspaceSchemas.js +11 -0
- package/dist/report/types.d.ts +34 -4
- package/dist/runtime/common.d.ts +28 -1
- package/dist/runtime/common.js +33 -3
- package/dist/runtime/container.js +49 -33
- package/dist/runtime/daimon/adapter.d.ts +14 -0
- package/dist/runtime/daimon/adapter.js +243 -0
- package/dist/runtime/daimon/attention.d.ts +8 -0
- package/dist/runtime/daimon/attention.js +32 -0
- package/dist/runtime/daimon/config.d.ts +25 -0
- package/dist/runtime/daimon/config.js +272 -0
- package/dist/runtime/daimon/contractManifest.d.ts +295 -0
- package/dist/runtime/daimon/contractManifest.js +319 -0
- package/dist/runtime/daimon/grokModel.d.ts +19 -0
- package/dist/runtime/daimon/grokModel.js +33 -0
- package/dist/runtime/daimon/grokWorkerConfigBytes.d.ts +26 -0
- package/dist/runtime/daimon/grokWorkerConfigBytes.js +36 -0
- package/dist/runtime/daimon/grokWorkerContract.d.ts +22 -0
- package/dist/runtime/daimon/grokWorkerContract.js +48 -0
- package/dist/runtime/daimon/memory.d.ts +57 -0
- package/dist/runtime/daimon/memory.js +125 -0
- package/dist/runtime/daimon/runAuth.d.ts +51 -0
- package/dist/runtime/daimon/runAuth.js +279 -0
- package/dist/runtime/daimon/runtimeIdentity.d.ts +22 -0
- package/dist/runtime/daimon/runtimeIdentity.js +22 -0
- package/dist/runtime/daimon/scheduleAuthority.d.ts +3 -0
- package/dist/runtime/daimon/scheduleAuthority.js +17 -0
- package/dist/runtime/index.d.ts +4 -0
- package/dist/runtime/index.js +4 -0
- package/dist/runtime/install.d.ts +3 -0
- package/dist/runtime/install.js +3 -0
- package/dist/runtime/localDaimonAuthority.d.ts +11 -0
- package/dist/runtime/localDaimonAuthority.js +77 -0
- package/dist/runtime/mnemeMcp.d.ts +13 -0
- package/dist/runtime/mnemeMcp.js +26 -0
- package/dist/runtime/openclaw/adapter.js +2 -2
- package/dist/runtime/pi/adapter.d.ts +0 -1
- package/dist/runtime/pi/adapter.js +2 -6
- package/dist/runtime/pi/appCliSource.js +1 -1
- package/dist/runtime/pi/appScheduleSource.js +6 -2
- package/dist/runtime/pi/appTemplateTypes.d.ts +1 -1
- package/dist/runtime/picoclaw/adapter.js +2 -2
- package/dist/runtime/registry.d.ts +3 -0
- package/dist/runtime/registry.js +19 -2
- package/dist/runtime/scheduleUtils.d.ts +1 -0
- package/dist/runtime/scheduleUtils.js +5 -1
- package/dist/runtime/types.d.ts +25 -0
- package/dist/runtime/usageLedger.d.ts +158 -0
- package/dist/runtime/usageLedger.js +269 -0
- package/dist/runtime/usageLedgerRead.d.ts +48 -0
- package/dist/runtime/usageLedgerRead.js +102 -0
- package/dist/runtime/usageRequestLedger.d.ts +42 -0
- package/dist/runtime/usageRequestLedger.js +72 -0
- package/dist/shared/daimonCodexDocker.d.ts +32 -0
- package/dist/shared/daimonCodexDocker.js +120 -0
- package/dist/shared/daimonGrokSeccompProfile.d.ts +10 -0
- package/dist/shared/daimonGrokSeccompProfile.js +11 -0
- package/dist/shared/index.d.ts +2 -0
- package/dist/shared/index.js +2 -0
- package/dist/shared/types.d.ts +1 -1
- package/dist/shared/volumeNames.d.ts +6 -0
- package/dist/shared/volumeNames.js +14 -0
- package/dist/target/dockerArtifactsProvider.js +34 -7
- package/dist/target/dockerBaseImage.d.ts +2 -0
- package/dist/target/dockerBaseImage.js +11 -0
- package/dist/target/dockerCommandExecutor.d.ts +11 -0
- package/dist/target/dockerCommandExecutor.js +53 -2
- package/dist/target/dockerCommandExecutorCore.d.ts +2 -1
- package/dist/target/dockerCommandExecutorCore.js +4 -2
- package/dist/target/dockerPublicArtifactSnapshot.d.ts +3 -3
- package/dist/target/dockerPublicArtifactSnapshot.js +17 -33
- package/dist/target/dockerTarget.d.ts +1 -0
- package/dist/target/dockerTargetBinding.d.ts +1 -2
- package/dist/target/dockerTargetBinding.js +2 -3
- package/dist/target/dockerTargetExecFile.d.ts +19 -0
- package/dist/target/dockerTargetExecFile.js +194 -0
- package/dist/target/dockerWorldServiceProvider.d.ts +4 -0
- package/dist/target/dockerWorldServiceProvider.js +13 -1
- package/dist/target/evidenceExport.d.ts +3 -1
- package/dist/target/evidenceExport.js +12 -3
- package/dist/target/evidenceExportOperationsTestKit.js +3 -3
- package/dist/target/evidenceExportProvider.d.ts +2 -0
- package/dist/target/evidenceExportProvider.js +15 -5
- package/dist/target/publicArtifactSnapshot.d.ts +31 -0
- package/dist/target/publicArtifactSnapshot.js +37 -3
- package/examples/README.md +45 -0
- package/examples/agent-with-subagents/AGENTS.md +3 -0
- package/examples/agent-with-subagents/Spawnfile +30 -0
- package/examples/agent-with-subagents/subagents/critic/AGENTS.md +3 -0
- package/examples/agent-with-subagents/subagents/critic/Spawnfile +15 -0
- package/examples/agent-with-subagents/subagents/researcher/AGENTS.md +3 -0
- package/examples/agent-with-subagents/subagents/researcher/Spawnfile +17 -0
- package/examples/daimon-org/Spawnfile +68 -0
- package/examples/daimon-org/TEAM.md +4 -0
- package/examples/daimon-org/agents/mapper/AGENTS.md +4 -0
- package/examples/daimon-org/agents/mapper/Spawnfile +37 -0
- package/examples/daimon-org/shared/skills/file-note/SKILL.md +9 -0
- package/examples/daimon-org/teams/review/Spawnfile +53 -0
- package/examples/daimon-org/teams/review/agents/reviewer/AGENTS.md +4 -0
- package/examples/daimon-org/teams/review/agents/reviewer/Spawnfile +37 -0
- package/examples/daimon-public-host/AGENTS.md +3 -0
- package/examples/daimon-public-host/Spawnfile +21 -0
- package/examples/distribution-org/Spawnfile +43 -0
- package/examples/distribution-org/TEAM.md +4 -0
- package/examples/distribution-org/agents/coordinator/AGENTS.md +1 -0
- package/examples/distribution-org/agents/coordinator/Spawnfile +20 -0
- package/examples/distribution-org/agents/researcher/AGENTS.md +1 -0
- package/examples/distribution-org/agents/researcher/Spawnfile +20 -0
- package/examples/jungian-daimon-org/Spawnfile +41 -0
- package/examples/jungian-daimon-org/TEAM.md +21 -0
- package/examples/jungian-daimon-org/teams/luna/Spawnfile +47 -0
- package/examples/jungian-daimon-org/teams/luna/TEAM.md +4 -0
- package/examples/jungian-daimon-org/teams/luna/agents/animus/AGENTS.md +10 -0
- package/examples/jungian-daimon-org/teams/luna/agents/animus/Spawnfile +33 -0
- package/examples/jungian-daimon-org/teams/luna/agents/representative/AGENTS.md +21 -0
- package/examples/jungian-daimon-org/teams/luna/agents/representative/Spawnfile +30 -0
- package/examples/jungian-daimon-org/teams/luna/agents/shadow/AGENTS.md +10 -0
- package/examples/jungian-daimon-org/teams/luna/agents/shadow/Spawnfile +33 -0
- package/examples/jungian-daimon-org/teams/selene/Spawnfile +47 -0
- package/examples/jungian-daimon-org/teams/selene/TEAM.md +4 -0
- package/examples/jungian-daimon-org/teams/selene/agents/animus/AGENTS.md +10 -0
- package/examples/jungian-daimon-org/teams/selene/agents/animus/Spawnfile +33 -0
- package/examples/jungian-daimon-org/teams/selene/agents/representative/AGENTS.md +19 -0
- package/examples/jungian-daimon-org/teams/selene/agents/representative/Spawnfile +33 -0
- package/examples/jungian-daimon-org/teams/selene/agents/shadow/AGENTS.md +10 -0
- package/examples/jungian-daimon-org/teams/selene/agents/shadow/Spawnfile +30 -0
- package/examples/mixed-runtime-org/Spawnfile +71 -0
- package/examples/mixed-runtime-org/TEAM.md +8 -0
- package/examples/mixed-runtime-org/agents/analyst/AGENTS.md +8 -0
- package/examples/mixed-runtime-org/agents/analyst/Spawnfile +27 -0
- package/examples/mixed-runtime-org/agents/conductor/AGENTS.md +8 -0
- package/examples/mixed-runtime-org/agents/conductor/Spawnfile +27 -0
- package/examples/mixed-runtime-org/agents/localist/AGENTS.md +7 -0
- package/examples/mixed-runtime-org/agents/localist/Spawnfile +50 -0
- package/examples/moltnet-team-chat/Spawnfile +43 -0
- package/examples/moltnet-team-chat/TEAM.md +5 -0
- package/examples/moltnet-team-chat/agents/coordinator/AGENTS.md +9 -0
- package/examples/moltnet-team-chat/agents/coordinator/Spawnfile +26 -0
- package/examples/moltnet-team-chat/teams/analysis/Spawnfile +23 -0
- package/examples/moltnet-team-chat/teams/analysis/TEAM.md +3 -0
- package/examples/moltnet-team-chat/teams/analysis/agents/observer/AGENTS.md +5 -0
- package/examples/moltnet-team-chat/teams/analysis/agents/observer/Spawnfile +19 -0
- package/examples/moltnet-team-chat/teams/analysis/agents/representative/AGENTS.md +5 -0
- package/examples/moltnet-team-chat/teams/analysis/agents/representative/Spawnfile +19 -0
- package/examples/moltnet-team-chat/teams/field/Spawnfile +41 -0
- package/examples/moltnet-team-chat/teams/field/TEAM.md +3 -0
- package/examples/moltnet-team-chat/teams/field/agents/observer/AGENTS.md +5 -0
- package/examples/moltnet-team-chat/teams/field/agents/observer/Spawnfile +26 -0
- package/examples/moltnet-team-chat/teams/field/agents/representative/AGENTS.md +11 -0
- package/examples/moltnet-team-chat/teams/field/agents/representative/Spawnfile +26 -0
- package/examples/single-agent/AGENTS.md +3 -0
- package/examples/single-agent/HEARTBEAT.md +3 -0
- package/examples/single-agent/IDENTITY.md +3 -0
- package/examples/single-agent/MEMORY.md +3 -0
- package/examples/single-agent/SOUL.md +3 -0
- package/examples/single-agent/Spawnfile +41 -0
- package/examples/single-agent/skills/web_search/SKILL.md +6 -0
- package/moltnet-releases.json +5 -4
- package/package.json +36 -9
- package/runtimes.yaml +5 -2
- package/dist/cli/targetWorldClockCrossProcess.test-helper.d.ts +0 -13
- package/dist/cli/targetWorldClockCrossProcess.test-helper.js +0 -109
- package/dist/deployment/providerRuntimeBoundaryScanner.test-helper.d.ts +0 -8
- package/dist/deployment/providerRuntimeBoundaryScanner.test-helper.js +0 -60
- package/dist/deployment/simfileFixtureBoundary.test-helper.d.ts +0 -8
- package/dist/deployment/simfileFixtureBoundary.test-helper.js +0 -103
- package/dist/ownership/simfileRunOperatorInputs.d.ts +0 -103
- package/dist/ownership/simfileRunOperatorInputs.js +0 -139
- package/dist/target/cleanupRunDocker.test-helper.d.ts +0 -67
- package/dist/target/cleanupRunDocker.test-helper.js +0 -238
|
@@ -7,6 +7,7 @@ import { assertRuntimeCanCompile, createRuntimeLifecycleDiagnostics, getRuntimeA
|
|
|
7
7
|
import { buildCompilePlan } from "./buildCompilePlan.js";
|
|
8
8
|
import { createContainerArtifacts } from "./containerArtifacts.js";
|
|
9
9
|
import { stageRuntimePackageOverrides } from "./containerPackageOverrides.js";
|
|
10
|
+
import { stageWorkspaceBundles } from "./workspaceBundleArtifacts.js";
|
|
10
11
|
import { augmentNodeReports } from "./compileProjectReports.js";
|
|
11
12
|
import { enforcePolicy } from "./compileProjectPolicy.js";
|
|
12
13
|
import { injectMoltnetWorkspaceFiles, injectTeamCompileSupportFiles, prepareTeamCompileSupport, writeEmittedFiles } from "./compileProjectSupport.js";
|
|
@@ -171,7 +172,7 @@ export const compileProject = async (inputPath, options = {}) => {
|
|
|
171
172
|
for (const compiled of compiledNodes) {
|
|
172
173
|
enforcePolicy(compiled.report, compiled.value.policyMode, compiled.value.policyOnDegrade);
|
|
173
174
|
}
|
|
174
|
-
const moltnetArtifacts = await generateMoltnetArtifacts(plan);
|
|
175
|
+
const moltnetArtifacts = await generateMoltnetArtifacts(plan, options.deploymentLineage);
|
|
175
176
|
const moltnetRelease = moltnetArtifacts
|
|
176
177
|
? await stageMoltnetBinaries(outputDirectory, {
|
|
177
178
|
architecture: options.containerArchitecture
|
|
@@ -179,10 +180,13 @@ export const compileProject = async (inputPath, options = {}) => {
|
|
|
179
180
|
: undefined;
|
|
180
181
|
await injectMoltnetWorkspaceFiles(outputDirectory, compiledNodes, moltnetArtifacts);
|
|
181
182
|
const resolvedRuntimePackageOverrides = await stageRuntimePackageOverrides(outputDirectory, options.runtimePackageOverrides);
|
|
183
|
+
const hasWorkspaceBundles = await stageWorkspaceBundles(outputDirectory, plan);
|
|
182
184
|
const generatedAt = new Date().toISOString();
|
|
183
185
|
const containerArtifacts = await createContainerArtifacts(plan, compiledNodes, {
|
|
186
|
+
deploymentLineage: options.deploymentLineage,
|
|
184
187
|
generatedAt,
|
|
185
188
|
hasStagedMoltnetBinaries: Boolean(moltnetRelease),
|
|
189
|
+
hasWorkspaceBundles,
|
|
186
190
|
moltnet: moltnetArtifacts,
|
|
187
191
|
moltnetRelease,
|
|
188
192
|
runtimePackageOverrides: resolvedRuntimePackageOverrides,
|
|
@@ -100,6 +100,15 @@ export const injectMoltnetWorkspaceFiles = async (outputDirectory, compiledNodes
|
|
|
100
100
|
upsertEmittedFile(compiled.emittedFiles, file);
|
|
101
101
|
}
|
|
102
102
|
await writeEmittedFiles(runtimeOutputDirectory, moltnetClientConfigFiles);
|
|
103
|
+
// Daimon agents talk Moltnet through the native moltnet_send/moltnet_read
|
|
104
|
+
// tools, and the moltnet CLI is not authenticated inside a Daimon
|
|
105
|
+
// workspace. Installing its skill there only teaches the agent a shell
|
|
106
|
+
// path that fails before it falls back to the tools it already has, so
|
|
107
|
+
// Daimon skips the skill install entirely; .moltnet/config.json above is
|
|
108
|
+
// still emitted since the native tools read it.
|
|
109
|
+
if (compiled.value.runtime.name === "daimon") {
|
|
110
|
+
continue;
|
|
111
|
+
}
|
|
103
112
|
if (!moltnetCliCommand) {
|
|
104
113
|
moltnetCliCommand = await resolveMoltnetCliCommand();
|
|
105
114
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type RuntimeContainerPackageOverrides } from "../runtime/index.js";
|
|
2
2
|
import type { MoltnetArtifacts } from "./moltnetArtifacts.js";
|
|
3
3
|
import type { MoltnetReleaseIdentity } from "./moltnetBinaries.js";
|
|
4
4
|
import type { CompiledNodeArtifact, GeneratedContainerArtifacts } from "./containerArtifactsTypes.js";
|
|
@@ -6,8 +6,10 @@ import type { CompilePlan } from "./types.js";
|
|
|
6
6
|
import { type ResolvedWorldBindings } from "./worldBindings.js";
|
|
7
7
|
export type { CompiledNodeArtifact, GeneratedContainerArtifacts } from "./containerArtifactsTypes.js";
|
|
8
8
|
export interface ContainerArtifactOptions {
|
|
9
|
+
deploymentLineage?: string;
|
|
9
10
|
generatedAt?: string;
|
|
10
11
|
hasStagedMoltnetBinaries?: boolean;
|
|
12
|
+
hasWorkspaceBundles?: boolean;
|
|
11
13
|
moltnet?: MoltnetArtifacts | null;
|
|
12
14
|
moltnetRelease?: MoltnetReleaseIdentity;
|
|
13
15
|
worldBindings?: ResolvedWorldBindings;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
2
|
import { buildDistributionReport, createDistributionImageLabels, DISTRIBUTION_REPORT_OUTPUT_FILE, normalizeProjectLabelSlug, WORLD_BINDINGS_IMAGE_PATH } from "../distribution/index.js";
|
|
3
|
+
import { DAIMON_LOCAL_RUNTIME_IDENTITY_ENV, loadLocalDaimonRuntimeIdentity } from "../runtime/index.js";
|
|
3
4
|
import { SpawnfileError } from "../shared/index.js";
|
|
4
5
|
import { createMoltnetSummary, createOrganizationSummary } from "./containerArtifactSummaries.js";
|
|
5
6
|
import { createEnvVariableMap, createRuntimeTargetPlans } from "./containerArtifactsPlans.js";
|
|
@@ -7,9 +8,57 @@ import { createDockerIgnoreContent } from "./dockerBuildContext.js";
|
|
|
7
8
|
import { createDaimonTelemetryArtifacts } from "./daimonTelemetryArtifacts.js";
|
|
8
9
|
import { createRootfsFiles, renderDockerfile, renderEntrypoint, renderEnvExample } from "./containerArtifactsRender.js";
|
|
9
10
|
import { createMemoryArtifactBundle } from "./memoryArtifacts.js";
|
|
11
|
+
import { resolveWorkspaceResourceVolumes } from "./containerTargetResources.js";
|
|
12
|
+
import { mergePersistentMounts } from "./containerPersistentMounts.js";
|
|
10
13
|
import { SIMFILE_WORLD_BINDINGS_VERSION, WORLD_BINDINGS_OUTPUT_FILE } from "./worldBindings.js";
|
|
14
|
+
/**
|
|
15
|
+
* Enforces the `specs/SURFACES.md` Moltnet/daimon promise: "A release without
|
|
16
|
+
* `daimon-bridge` is rejected; the public pi-only release cannot be relabeled
|
|
17
|
+
* as dual-capability."
|
|
18
|
+
*
|
|
19
|
+
* A daimon Moltnet attachment lowers a node runtime config of
|
|
20
|
+
* `kind: "daimon"` carrying `agent_id`, `token_env`, and `receipt_store_path`
|
|
21
|
+
* (`./moltnetRuntimeConfig.ts`). No published Moltnet release implements that
|
|
22
|
+
* kind -- `pkg/bridgeconfig` has no `RuntimeDaimon` through the latest tag, and
|
|
23
|
+
* `pkg/nodeconfig` decodes with `DisallowUnknownFields()`, so the node exits on
|
|
24
|
+
* `agent_id` at strict decode, before `Validate()` is even reached. The
|
|
25
|
+
* entrypoint launches `moltnet node <config> &` and then `wait -n`
|
|
26
|
+
* (`./containerEntrypointRender.ts`), so that exit tears the whole container
|
|
27
|
+
* down. Both a locally built Moltnet (`./localMoltnetAuthority.ts`) and, since
|
|
28
|
+
* the v0.1.18 pin, the published authority (`./moltnetReleaseAuthority.ts`) can
|
|
29
|
+
* advertise `daimon-bridge`; anything older, including every release through
|
|
30
|
+
* v0.1.17, advertises only `pi-bridge` and is still rejected here.
|
|
31
|
+
*
|
|
32
|
+
* This throws rather than warning, which is the opposite call from the other
|
|
33
|
+
* unlowerable-declaration diagnostics in this compiler. Those keep working
|
|
34
|
+
* projects compiling; here every affected project is already broken, and the
|
|
35
|
+
* failure it replaces is an opaque JSON decode error at container boot.
|
|
36
|
+
*
|
|
37
|
+
* `receiptStorePath` is set on a node plan if and only if the attached agent's
|
|
38
|
+
* runtime is daimon (`./moltnetArtifacts.ts`), so it is the exact daimon
|
|
39
|
+
* signal on an already-resolved plan.
|
|
40
|
+
*/
|
|
41
|
+
const assertMoltnetDaimonBridgeCapability = (moltnet, release) => {
|
|
42
|
+
const daimonNetworks = [...new Set((moltnet?.nodePlans ?? [])
|
|
43
|
+
.filter((nodePlan) => nodePlan.receiptStorePath !== undefined)
|
|
44
|
+
.map((nodePlan) => nodePlan.networkId))].sort();
|
|
45
|
+
if (daimonNetworks.length === 0)
|
|
46
|
+
return;
|
|
47
|
+
const capabilities = release?.capabilities ?? [];
|
|
48
|
+
if (capabilities.includes("daimon-bridge"))
|
|
49
|
+
return;
|
|
50
|
+
throw new SpawnfileError("compile_error", `Moltnet release ${release?.version ?? "(unstaged)"} does not advertise the daimon-bridge capability, but `
|
|
51
|
+
+ `${daimonNetworks.length} network attachment(s) lower a daimon runtime bridge (${daimonNetworks.join(", ")}). `
|
|
52
|
+
+ "The published release implements pi-bridge only and rejects a daimon node config at strict JSON decode, so "
|
|
53
|
+
+ "the container would exit at boot. Build Moltnet locally (scripts/build-local-moltnet.ts, then "
|
|
54
|
+
+ "SPAWNFILE_LOCAL_MOLTNET_RELEASE_DIR with SPAWNFILE_ALLOW_LOCAL_E2E=1) to stage a daimon-bridge release, or "
|
|
55
|
+
+ "remove the Moltnet attachment from the daimon agent(s).");
|
|
56
|
+
};
|
|
11
57
|
export const createContainerArtifacts = async (plan, compiledNodes, options = {}) => {
|
|
12
|
-
|
|
58
|
+
assertMoltnetDaimonBridgeCapability(options.moltnet, options.moltnetRelease);
|
|
59
|
+
const localDaimonIdentityPath = process.env[DAIMON_LOCAL_RUNTIME_IDENTITY_ENV]?.trim();
|
|
60
|
+
const localDaimonIdentity = localDaimonIdentityPath ? await loadLocalDaimonRuntimeIdentity(localDaimonIdentityPath) : undefined;
|
|
61
|
+
const runtimePlans = await createRuntimeTargetPlans(plan, compiledNodes, options.worldBindings, options.deploymentLineage);
|
|
13
62
|
const daimonTelemetryArtifacts = createDaimonTelemetryArtifacts(plan, runtimePlans, compiledNodes);
|
|
14
63
|
const envVariableMap = createEnvVariableMap(compiledNodes, runtimePlans, options.moltnet);
|
|
15
64
|
const projectedWorldTokenEnvNames = [...new Set(runtimePlans.flatMap((runtimePlan) => runtimePlan.worldTokenEnvNames ?? []))].sort();
|
|
@@ -45,50 +94,23 @@ export const createContainerArtifacts = async (plan, compiledNodes, options = {}
|
|
|
45
94
|
.filter((variable) => variable.required && variable.categories.includes("runtime"))
|
|
46
95
|
.map((variable) => variable.name)
|
|
47
96
|
.sort();
|
|
48
|
-
const memoryArtifacts = createMemoryArtifactBundle(plan);
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
const existing = persistentMountsById.get(mount.id);
|
|
52
|
-
if (existing) {
|
|
53
|
-
if (existing.mount_path !== mount.mount_path || existing.volume_name !== mount.volume_name) {
|
|
54
|
-
throw new Error(`Container persistent mount ${mount.id} resolves to conflicting targets`);
|
|
55
|
-
}
|
|
56
|
-
continue;
|
|
57
|
-
}
|
|
58
|
-
persistentMountsById.set(mount.id, {
|
|
59
|
-
mount_path: mount.mount_path,
|
|
60
|
-
reason: mount.reason,
|
|
61
|
-
volume_name: mount.volume_name
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
const persistentMounts = [
|
|
97
|
+
const memoryArtifacts = createMemoryArtifactBundle(plan, options.deploymentLineage);
|
|
98
|
+
const { resources: resolvedWorkspaceResources, mounts: workspaceResourceMounts } = resolveWorkspaceResourceVolumes(runtimePlans);
|
|
99
|
+
const persistentMountCandidates = [
|
|
65
100
|
...memoryArtifacts.mounts,
|
|
101
|
+
...workspaceResourceMounts,
|
|
66
102
|
...daimonTelemetryArtifacts.mounts,
|
|
103
|
+
...runtimePlans.flatMap((runtimePlan) => runtimePlan.persistentMounts ?? []),
|
|
67
104
|
...((options.moltnet?.persistentMounts ?? []).map((mount) => ({
|
|
105
|
+
...(mount.declaredVolumeName ? { declared_volume_name: mount.declaredVolumeName } : {}),
|
|
68
106
|
id: mount.id,
|
|
107
|
+
...(mount.lifecycle ? { lifecycle: mount.lifecycle } : {}),
|
|
69
108
|
mount_path: mount.mountPath,
|
|
70
109
|
reason: mount.reason,
|
|
71
110
|
volume_name: mount.volumeName
|
|
72
111
|
})))
|
|
73
|
-
]
|
|
74
|
-
|
|
75
|
-
.filter((mount) => {
|
|
76
|
-
const existing = persistentMountsById.get(mount.id);
|
|
77
|
-
if (existing) {
|
|
78
|
-
if (existing.mount_path === mount.mount_path &&
|
|
79
|
-
existing.volume_name === mount.volume_name &&
|
|
80
|
-
existing.reason === mount.reason) {
|
|
81
|
-
return true;
|
|
82
|
-
}
|
|
83
|
-
throw new Error(`Container persistent mount ${mount.id} resolves to conflicting targets`);
|
|
84
|
-
}
|
|
85
|
-
persistentMountsById.set(mount.id, {
|
|
86
|
-
mount_path: mount.mount_path,
|
|
87
|
-
reason: mount.reason,
|
|
88
|
-
volume_name: mount.volume_name
|
|
89
|
-
});
|
|
90
|
-
return true;
|
|
91
|
-
});
|
|
112
|
+
];
|
|
113
|
+
const persistentMounts = mergePersistentMounts(persistentMountCandidates);
|
|
92
114
|
const runtimeInternalPorts = runtimePlans.flatMap((plan) => plan.port ? [plan.port] : []);
|
|
93
115
|
const internalPorts = [...new Set([...runtimeInternalPorts, ...(options.moltnet?.ports ?? [])])].sort((left, right) => left - right);
|
|
94
116
|
const runtimePublishedPorts = runtimePlans.flatMap((plan) => plan.publishedPort ? [plan.publishedPort] : []);
|
|
@@ -136,7 +158,14 @@ export const createContainerArtifacts = async (plan, compiledNodes, options = {}
|
|
|
136
158
|
link_path: resource.linkPath,
|
|
137
159
|
mode: resource.mode,
|
|
138
160
|
mount: resource.mount,
|
|
139
|
-
|
|
161
|
+
mount_path: resource.linkPath,
|
|
162
|
+
replacement_sentinel: resource.replacementSentinel ? {
|
|
163
|
+
path: resource.replacementSentinel,
|
|
164
|
+
result: "verified_on_startup"
|
|
165
|
+
} : undefined,
|
|
166
|
+
resolved_identity: resource.resolvedIdentity,
|
|
167
|
+
sharing: resource.sharing,
|
|
168
|
+
volume_name: resource.volumeName ?? null
|
|
140
169
|
}
|
|
141
170
|
]))).values()
|
|
142
171
|
].sort((left, right) => left.link_path.localeCompare(right.link_path) || left.id.localeCompare(right.id));
|
|
@@ -173,10 +202,19 @@ export const createContainerArtifacts = async (plan, compiledNodes, options = {}
|
|
|
173
202
|
modelAuthMethods: mergedModelAuthMethods,
|
|
174
203
|
moltnetNetworks,
|
|
175
204
|
organization,
|
|
205
|
+
// The report deliberately omits the compiler-DERIVED volume name: it
|
|
206
|
+
// encodes the creator's plan root and deployment lineage and is private to
|
|
207
|
+
// that host. An author-DECLARED name is different — it is part of the
|
|
208
|
+
// declaration the image publishes, so a consumer must honour it verbatim
|
|
209
|
+
// or an operator who pre-created that volume silently gets an empty one.
|
|
176
210
|
persistentMounts: persistentMounts.map((mount) => ({
|
|
211
|
+
...(mount.declared_volume_name
|
|
212
|
+
? { declared_volume_name: mount.declared_volume_name }
|
|
213
|
+
: {}),
|
|
177
214
|
durability: "persistent",
|
|
178
215
|
id: mount.id,
|
|
179
216
|
kind: "volume",
|
|
217
|
+
...(mount.lifecycle ? { lifecycle: mount.lifecycle } : {}),
|
|
180
218
|
target: mount.mount_path
|
|
181
219
|
})),
|
|
182
220
|
portMappings,
|
|
@@ -194,7 +232,13 @@ export const createContainerArtifacts = async (plan, compiledNodes, options = {}
|
|
|
194
232
|
});
|
|
195
233
|
const distributionLabels = createDistributionImageLabels(projectSlug, distributionReport.compile_fingerprint);
|
|
196
234
|
const files = [
|
|
197
|
-
...createRootfsFiles(runtimePlans),
|
|
235
|
+
...createRootfsFiles(runtimePlans, persistentMounts.map((mount) => mount.mount_path), options.moltnet
|
|
236
|
+
? {
|
|
237
|
+
externalParticipantArtifacts: options.moltnet.externalParticipantArtifacts,
|
|
238
|
+
nodePlans: options.moltnet.nodePlans,
|
|
239
|
+
serverPlans: options.moltnet.serverPlans
|
|
240
|
+
}
|
|
241
|
+
: undefined, persistentMounts),
|
|
198
242
|
...(options.moltnet?.files ?? []),
|
|
199
243
|
...(options.worldBindings
|
|
200
244
|
? [{ content: options.worldBindings.canonicalBytes, mode: 0o600, path: WORLD_BINDINGS_OUTPUT_FILE }]
|
|
@@ -214,6 +258,7 @@ export const createContainerArtifacts = async (plan, compiledNodes, options = {}
|
|
|
214
258
|
},
|
|
215
259
|
hasMoltnet: Boolean(options.moltnet),
|
|
216
260
|
hasStagedMoltnetBinaries: options.hasStagedMoltnetBinaries,
|
|
261
|
+
hasWorkspaceBundles: options.hasWorkspaceBundles,
|
|
217
262
|
...(options.moltnet
|
|
218
263
|
? {
|
|
219
264
|
moltnet: {
|
|
@@ -236,7 +281,9 @@ export const createContainerArtifacts = async (plan, compiledNodes, options = {}
|
|
|
236
281
|
nodePlans: options.moltnet.nodePlans,
|
|
237
282
|
serverPlans: options.moltnet.serverPlans
|
|
238
283
|
}
|
|
239
|
-
: undefined
|
|
284
|
+
: undefined,
|
|
285
|
+
persistentMounts,
|
|
286
|
+
persistentMountPaths: persistentMounts.map((mount) => mount.mount_path)
|
|
240
287
|
}),
|
|
241
288
|
path: "entrypoint.sh"
|
|
242
289
|
},
|
|
@@ -270,6 +317,11 @@ export const createContainerArtifacts = async (plan, compiledNodes, options = {}
|
|
|
270
317
|
entrypoint: "entrypoint.sh",
|
|
271
318
|
env_example: ".env.example",
|
|
272
319
|
internal_ports: internalPorts,
|
|
320
|
+
...(localDaimonIdentity ? { local_daimon_runtime: {
|
|
321
|
+
capability_receipt_sha256: localDaimonIdentity.capabilityReceipt,
|
|
322
|
+
image_reference: localDaimonIdentity.imageReference,
|
|
323
|
+
registry_authority: localDaimonIdentity.registryAuthority
|
|
324
|
+
} } : {}),
|
|
273
325
|
model_secrets_required: modelSecretsRequired,
|
|
274
326
|
...(moltnetSummary ? { moltnet: moltnetSummary } : {}),
|
|
275
327
|
port_mappings: portMappings,
|
|
@@ -3,4 +3,4 @@ import type { MoltnetArtifacts } from "./moltnetArtifacts.js";
|
|
|
3
3
|
import type { CompilePlan } from "./types.js";
|
|
4
4
|
import { type ResolvedWorldBindings } from "./worldBindings.js";
|
|
5
5
|
export declare const createEnvVariableMap: (compiledNodes: CompiledNodeArtifact[], runtimePlans: RuntimeTargetPlan[], moltnet?: MoltnetArtifacts | null) => Map<string, ContainerEnvVariable>;
|
|
6
|
-
export declare const createRuntimeTargetPlans: (plan: CompilePlan, compiledNodes: CompiledNodeArtifact[], worldBindings?: ResolvedWorldBindings) => Promise<RuntimeTargetPlan[]>;
|
|
6
|
+
export declare const createRuntimeTargetPlans: (plan: CompilePlan, compiledNodes: CompiledNodeArtifact[], worldBindings?: ResolvedWorldBindings, deploymentLineage?: string) => Promise<RuntimeTargetPlan[]>;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { createRuntimeInstallRecipe, getRuntimeAdapter } from "../runtime/index.js";
|
|
2
|
+
import { resolveNoopolisRunId } from "../runtime/index.js";
|
|
2
3
|
import { listAgentSurfaceSecretNames } from "./agentSurfaces.js";
|
|
3
4
|
import { resolveTargetResources } from "./containerTargetResources.js";
|
|
4
5
|
import { assertTargetHasConfig, createDefaultTargets, resolveInstancePaths, resolveTargetConfigEnvBindings, resolveTargetEnvFiles, resolveTargetExposure, resolveTargetModelAuthMethods, resolveTargetModelSecrets, resolveTargetPackages } from "./containerTargetPlanResolution.js";
|
|
5
6
|
import { listExecutionModelSecretNames } from "./modelEnv.js";
|
|
7
|
+
import { createPersistentVolumeName } from "./moltnetArtifactPaths.js";
|
|
8
|
+
import { createExclusiveReattachVolumeName } from "../shared/index.js";
|
|
6
9
|
import { findWorldBindingForNode } from "./worldBindings.js";
|
|
7
10
|
export const createEnvVariableMap = (compiledNodes, runtimePlans, moltnet) => {
|
|
8
11
|
const variables = new Map();
|
|
@@ -32,8 +35,10 @@ export const createEnvVariableMap = (compiledNodes, runtimePlans, moltnet) => {
|
|
|
32
35
|
if (node.value.kind === "agent") {
|
|
33
36
|
for (const secret of node.value.secrets)
|
|
34
37
|
registerSecret(secret);
|
|
35
|
-
|
|
36
|
-
|
|
38
|
+
if (node.runtimeName !== "daimon") {
|
|
39
|
+
for (const secretName of listExecutionModelSecretNames(node.value.execution)) {
|
|
40
|
+
register(secretName, true, `Model provider auth for ${secretName}`, "model");
|
|
41
|
+
}
|
|
37
42
|
}
|
|
38
43
|
for (const secretName of listAgentSurfaceSecretNames(node.value.surfaces)) {
|
|
39
44
|
register(secretName, true, "Bot token for declared agent surfaces", "surface");
|
|
@@ -58,14 +63,15 @@ export const createEnvVariableMap = (compiledNodes, runtimePlans, moltnet) => {
|
|
|
58
63
|
}
|
|
59
64
|
return variables;
|
|
60
65
|
};
|
|
61
|
-
export const createRuntimeTargetPlans = async (plan, compiledNodes, worldBindings) => {
|
|
66
|
+
export const createRuntimeTargetPlans = async (plan, compiledNodes, worldBindings, deploymentLineage = "compile") => {
|
|
62
67
|
const runtimeNames = Object.keys(plan.runtimes).sort();
|
|
68
|
+
const runId = resolveNoopolisRunId(process.env);
|
|
63
69
|
const runtimePlans = [];
|
|
64
70
|
for (const runtimeName of runtimeNames) {
|
|
65
71
|
const adapter = getRuntimeAdapter(runtimeName);
|
|
66
72
|
const recipe = await createRuntimeInstallRecipe(runtimeName);
|
|
67
73
|
const targetInputs = compiledNodes
|
|
68
|
-
.filter((node) => node.runtimeName === runtimeName && node.emittedFiles.length > 0)
|
|
74
|
+
.filter((node) => node.runtimeName === runtimeName && (node.emittedFiles.length > 0 || runtimeName === "daimon"))
|
|
69
75
|
.map((node) => {
|
|
70
76
|
const id = node.id ?? `${node.kind}:${node.slug}`;
|
|
71
77
|
const worldBinding = node.kind === "agent"
|
|
@@ -89,19 +95,30 @@ export const createRuntimeTargetPlans = async (plan, compiledNodes, worldBinding
|
|
|
89
95
|
runtimePlans.push({
|
|
90
96
|
configEnvBindings: resolveTargetConfigEnvBindings(adapter.container, target) ?? [],
|
|
91
97
|
...(target.engineByNodeId ? { engineByNodeId: target.engineByNodeId } : {}),
|
|
98
|
+
...(target.grokModelByNodeId ? { grokModelByNodeId: target.grokModelByNodeId } : {}),
|
|
92
99
|
envFiles: resolveTargetEnvFiles(instancePaths.configPath, target),
|
|
93
100
|
packages: resolveTargetPackages(target, targetInputs),
|
|
94
101
|
id: target.id,
|
|
95
102
|
instancePaths,
|
|
96
103
|
meta: adapter.container,
|
|
97
|
-
modelAuthMethods: resolveTargetModelAuthMethods(target, targetInputs),
|
|
98
|
-
modelSecretsRequired: resolveTargetModelSecrets(target, targetInputs),
|
|
104
|
+
modelAuthMethods: runtimeName === "daimon" ? {} : resolveTargetModelAuthMethods(target, targetInputs),
|
|
105
|
+
modelSecretsRequired: runtimeName === "daimon" ? [] : resolveTargetModelSecrets(target, targetInputs),
|
|
106
|
+
...(target.opaqueMountTargets ? { opaqueMountTargets: [...target.opaqueMountTargets].sort() } : {}),
|
|
107
|
+
...(target.persistentMounts ? { persistentMounts: target.persistentMounts.map((mount) => ({
|
|
108
|
+
id: mount.id,
|
|
109
|
+
...(mount.lifecycle ? { lifecycle: mount.lifecycle } : {}),
|
|
110
|
+
mount_path: mount.mountPath.replaceAll("<instance-root>", instancePaths.instanceRoot),
|
|
111
|
+
reason: mount.reason,
|
|
112
|
+
volume_name: mount.lifecycle === "exclusive-reattach"
|
|
113
|
+
? createExclusiveReattachVolumeName(`${plan.root}\0${deploymentLineage}`, mount.id)
|
|
114
|
+
: createPersistentVolumeName(plan.root, mount.id, runId)
|
|
115
|
+
})).sort((left, right) => left.id.localeCompare(right.id)) } : {}),
|
|
99
116
|
port: adapter.container.port ? adapter.container.port + (index * portStride) : undefined,
|
|
100
117
|
publishedPort: resolveTargetExposure(target, targetInputs) && adapter.container.port
|
|
101
118
|
? adapter.container.port + (index * portStride)
|
|
102
119
|
: undefined,
|
|
103
120
|
recipeEnv: recipe.env,
|
|
104
|
-
resources: resolveTargetResources(target, targetInputs, instancePaths, adapter.container),
|
|
121
|
+
resources: resolveTargetResources(target, targetInputs, instancePaths, adapter.container, plan.root, deploymentLineage),
|
|
105
122
|
runtimeName,
|
|
106
123
|
runtimeRoot: recipe.runtimeRoot,
|
|
107
124
|
sourceIds: [...(target.sourceIds ?? [])].sort(),
|
|
@@ -3,6 +3,7 @@ import type { ContainerEnvVariable, RuntimeTargetPlan } from "./containerArtifac
|
|
|
3
3
|
import type { EntrypointOptions } from "./containerEntrypointRender.js";
|
|
4
4
|
export { renderEntrypoint } from "./containerEntrypointRender.js";
|
|
5
5
|
export type { EntrypointOptions } from "./containerEntrypointRender.js";
|
|
6
|
+
import type { BackedMountRequirement } from "./containerBackedMountRender.js";
|
|
6
7
|
export declare const renderEnvExample: (variables: ContainerEnvVariable[]) => string;
|
|
7
8
|
export interface DockerfileDistributionOptions {
|
|
8
9
|
labels: Record<string, string>;
|
|
@@ -13,4 +14,4 @@ export declare const renderDockerfile: (runtimePlans: RuntimeTargetPlan[], optio
|
|
|
13
14
|
distribution?: DockerfileDistributionOptions;
|
|
14
15
|
runtimePackageOverrides?: RuntimeContainerPackageOverrides;
|
|
15
16
|
}) => Promise<string>;
|
|
16
|
-
export declare const createRootfsFiles: (runtimePlans: RuntimeTargetPlan[]) => EmittedFile[];
|
|
17
|
+
export declare const createRootfsFiles: (runtimePlans: RuntimeTargetPlan[], persistentMountPaths?: string[], moltnet?: EntrypointOptions["moltnet"], persistentMounts?: readonly BackedMountRequirement[]) => EmittedFile[];
|
|
@@ -3,30 +3,20 @@ import { DISTRIBUTION_REPORT_IMAGE_PATH, WORLD_BINDINGS_IMAGE_PATH } from "../di
|
|
|
3
3
|
import { createRuntimeInstallRecipe } from "../runtime/index.js";
|
|
4
4
|
import { SpawnfileError } from "../shared/index.js";
|
|
5
5
|
export { renderEntrypoint } from "./containerEntrypointRender.js";
|
|
6
|
+
import { DAIMON_RUNTIME_UID, DAIMON_UID_ENTRYPOINT_PATH, renderDaimonUidEntrypoint } from "./containerDaimonUidEntrypointRender.js";
|
|
7
|
+
import { createStateOwnershipCommand } from "./containerStateOwnershipRender.js";
|
|
8
|
+
import { RUNTIME_LINK_MATERIALIZER_PATH, renderRuntimeLinkMaterializer } from "./containerRuntimeLinkMaterializer.js";
|
|
6
9
|
import { MOLTNET_BIN_DIRECTORY, MOLTNET_BINARY_NAMES } from "./moltnetBinaries.js";
|
|
7
10
|
import { collectPackagesByManager, createAptPackageInstallItem, createNpmPackageInstallCommand, createNpmPackageInstallItem, createPackageInstallCommand, createPipxPackageInstallCommand, createPipxPackageInstallItem, getNpmInstallItemName } from "./containerPackageRender.js";
|
|
8
11
|
const CONTAINER_ROOTFS_ROOT = "container/rootfs";
|
|
9
12
|
const GATEWAY_PORT_PLACEHOLDER = "<gateway-port>";
|
|
10
13
|
const WORKSPACE_PLACEHOLDER = "<workspace-path>";
|
|
11
14
|
const RUNTIME_ROOT_PLACEHOLDER = "<runtime-root>";
|
|
15
|
+
const PREBUILT_FINAL_SYSTEM_DEPS_BY_RUNTIME = {
|
|
16
|
+
daimon: new Set(["bubblewrap", "dbus-daemon", "gnome-keyring", "util-linux"])
|
|
17
|
+
};
|
|
12
18
|
const shellQuote = (value) => `'${value.replace(/'/g, `'\"'\"'`)}'`;
|
|
13
19
|
const extractNodeMajorVersion = (image) => Number(image.match(/^node:(\d+)/)?.[1] ?? "0");
|
|
14
|
-
const createStateOwnershipCommand = (persistentMountPaths = []) => {
|
|
15
|
-
const mountPaths = [...new Set(persistentMountPaths)].sort();
|
|
16
|
-
const mkdirPaths = [...new Set(["/var/lib/spawnfile", ...mountPaths])].sort();
|
|
17
|
-
const markerCommands = mountPaths.map((mountPath) => `touch ${shellQuote(path.posix.join(mountPath, ".spawnfile-volume-init"))}`);
|
|
18
|
-
const chownPaths = [
|
|
19
|
-
...new Set([
|
|
20
|
-
"/var/lib/spawnfile",
|
|
21
|
-
...mountPaths.filter((mountPath) => !mountPath.startsWith("/var/lib/spawnfile/"))
|
|
22
|
-
])
|
|
23
|
-
].sort();
|
|
24
|
-
return [
|
|
25
|
-
`mkdir -p ${mkdirPaths.map(shellQuote).join(" ")}`,
|
|
26
|
-
...markerCommands,
|
|
27
|
-
`chown -R spawnfile:spawnfile ${chownPaths.map(shellQuote).join(" ")}`
|
|
28
|
-
].join(" && ");
|
|
29
|
-
};
|
|
30
20
|
const selectBaseImage = (runtimePlans, runtimeRecipes) => {
|
|
31
21
|
const recipeBaseImages = [
|
|
32
22
|
...new Set(runtimeRecipes.flatMap((recipe) => recipe.baseImage ? [recipe.baseImage] : []))
|
|
@@ -74,6 +64,7 @@ export const renderDockerfile = async (runtimePlans, options = {}) => {
|
|
|
74
64
|
throw new SpawnfileError("compile_error", "Moltnet must be supplied as a pinned, digest-verified, pi-bridge-stamped release; unpinned latest installation is disabled");
|
|
75
65
|
}
|
|
76
66
|
const runtimeNames = [...new Set(runtimePlans.map((plan) => plan.runtimeName))];
|
|
67
|
+
const hasDaimon = runtimeNames.includes("daimon");
|
|
77
68
|
const runtimeRecipes = await Promise.all(runtimeNames.map((runtimeName) => createRuntimeInstallRecipe(runtimeName, { packageOverrides: options.runtimePackageOverrides })));
|
|
78
69
|
const recipeByRuntimeName = new Map(runtimeRecipes.map((recipe) => [recipe.runtimeName, recipe]));
|
|
79
70
|
const baseImage = selectBaseImage(runtimePlans, runtimeRecipes);
|
|
@@ -82,10 +73,14 @@ export const renderDockerfile = async (runtimePlans, options = {}) => {
|
|
|
82
73
|
&& plan.configPath !== null
|
|
83
74
|
&& plan.secretPatches.length > 0);
|
|
84
75
|
const needsGit = runtimePlans.some((plan) => (plan.resources ?? []).some((resource) => resource.kind === "git"));
|
|
76
|
+
const needsBundle = runtimePlans.some((plan) => (plan.resources ?? []).some((resource) => resource.kind === "bundle"));
|
|
85
77
|
const systemDeps = [
|
|
86
78
|
...new Set([
|
|
87
|
-
...runtimePlans.flatMap((plan) => recipeByRuntimeName.get(plan.runtimeName)?.baseImage
|
|
79
|
+
...runtimePlans.flatMap((plan) => recipeByRuntimeName.get(plan.runtimeName)?.baseImage
|
|
80
|
+
? plan.meta.systemDeps.filter((dependency) => PREBUILT_FINAL_SYSTEM_DEPS_BY_RUNTIME[plan.runtimeName]?.has(dependency))
|
|
81
|
+
: plan.meta.systemDeps),
|
|
88
82
|
...(needsGit ? ["git"] : []),
|
|
83
|
+
...(needsBundle ? ["tar"] : []),
|
|
89
84
|
...(needsJsonEnvWriter ? ["python3"] : [])
|
|
90
85
|
])
|
|
91
86
|
].sort();
|
|
@@ -124,6 +119,8 @@ export const renderDockerfile = async (runtimePlans, options = {}) => {
|
|
|
124
119
|
if (options.hasMoltnet && options.hasStagedMoltnetBinaries) {
|
|
125
120
|
lines.push(`COPY ${MOLTNET_BIN_DIRECTORY}/ /usr/local/bin/`, `RUN chmod +x ${MOLTNET_BINARY_NAMES.map((binaryName) => `/usr/local/bin/${binaryName}`).join(" ")}`, "");
|
|
126
121
|
}
|
|
122
|
+
if (options.hasWorkspaceBundles)
|
|
123
|
+
lines.push("COPY container/workspace-bundles/ /opt/spawnfile/workspace-bundles/", "");
|
|
127
124
|
for (const recipe of runtimeRecipes) {
|
|
128
125
|
for (const copyCommand of recipe.copyCommands) {
|
|
129
126
|
lines.push(copyCommand);
|
|
@@ -133,8 +130,19 @@ export const renderDockerfile = async (runtimePlans, options = {}) => {
|
|
|
133
130
|
}
|
|
134
131
|
lines.push("");
|
|
135
132
|
}
|
|
136
|
-
lines.push(
|
|
137
|
-
|
|
133
|
+
lines.push(hasDaimon
|
|
134
|
+
? `RUN if ! getent group spawnfile >/dev/null 2>&1; then groupadd --gid ${DAIMON_RUNTIME_UID} spawnfile; fi && if ! id -u spawnfile >/dev/null 2>&1; then useradd --uid ${DAIMON_RUNTIME_UID} --gid spawnfile --create-home --home-dir /home/spawnfile --shell /bin/bash spawnfile; fi`
|
|
135
|
+
: 'RUN if ! id -u spawnfile >/dev/null 2>&1; then useradd --create-home --home-dir /home/spawnfile --shell /bin/bash spawnfile; fi', "");
|
|
136
|
+
lines.push("COPY container/rootfs/ /", ...(hasDaimon
|
|
137
|
+
? ["RUN chown root:root /var /var/lib /var/lib/spawnfile && chmod 755 /var /var/lib && chmod 711 /var/lib/spawnfile"]
|
|
138
|
+
: []), "COPY .env.example /opt/spawnfile/.env.example", 'COPY entrypoint.sh /opt/spawnfile/entrypoint.sh', `RUN chmod +x /opt/spawnfile/entrypoint.sh${hasDaimon ? ` ${DAIMON_UID_ENTRYPOINT_PATH}` : ""}${hasDaimon ? " && chmod 711 /opt /opt/spawnfile" : ""}`);
|
|
139
|
+
if (hasDaimon) {
|
|
140
|
+
for (const runtimeRoot of [...new Set(runtimePlans
|
|
141
|
+
.filter((plan) => plan.runtimeName === "daimon")
|
|
142
|
+
.map((plan) => plan.runtimeRoot))].sort()) {
|
|
143
|
+
lines.push(`RUN node ${shellQuote(RUNTIME_LINK_MATERIALIZER_PATH)} ${shellQuote(runtimeRoot)} && rm ${shellQuote(RUNTIME_LINK_MATERIALIZER_PATH)} && test -d ${shellQuote(runtimeRoot)} && test ! -L ${shellQuote(runtimeRoot)} && test -z "$(find -P ${shellQuote(runtimeRoot)} \\( -type l -o ! -user root -o ! -group root \\) -print -quit)" && chmod 711 /opt/spawnfile/runtime-installs ${shellQuote(runtimeRoot)} && find -P ${shellQuote(runtimeRoot)} -type d -exec chmod 711 {} + && find -P ${shellQuote(runtimeRoot)} -type f -perm /111 -exec chmod 555 {} + && find -P ${shellQuote(runtimeRoot)} -type f ! -perm /111 -exec chmod 444 {} + && chmod 555 ${shellQuote(path.posix.join(runtimeRoot, "daimon-start.sh"))}`);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
138
146
|
const postRootfsCommands = [
|
|
139
147
|
...new Set(runtimePlans.flatMap((plan) => plan.meta.postRootfsCommands ?? []))
|
|
140
148
|
];
|
|
@@ -151,48 +159,73 @@ export const renderDockerfile = async (runtimePlans, options = {}) => {
|
|
|
151
159
|
.sort(([left], [right]) => left.localeCompare(right))
|
|
152
160
|
.map(([name, value]) => `LABEL ${name}=${shellQuote(value)}`));
|
|
153
161
|
}
|
|
154
|
-
lines.push(`RUN ${createStateOwnershipCommand(options.persistentMountPaths)}`);
|
|
162
|
+
lines.push(`RUN ${createStateOwnershipCommand(runtimePlans, options.persistentMountPaths, options.moltnet)}`);
|
|
155
163
|
if (exposedPorts.length > 0) {
|
|
156
164
|
lines.push(`EXPOSE ${exposedPorts.join(" ")}`);
|
|
157
165
|
}
|
|
158
|
-
|
|
159
|
-
|
|
166
|
+
if (hasDaimon) {
|
|
167
|
+
const daimonConfig = runtimePlans.find((plan) => plan.runtimeName === "daimon")?.instancePaths.configPath;
|
|
168
|
+
if (!daimonConfig)
|
|
169
|
+
throw new Error("Daimon container plan is missing its runtime config path");
|
|
170
|
+
const healthProgram = "const fs=require('node:fs');const c=JSON.parse(fs.readFileSync(process.argv[1],'utf8'));fetch(`http://127.0.0.1:${c.host.port}/healthz`).then(async r=>{if(!r.ok||JSON.stringify(await r.json())!==JSON.stringify({status:'ok'}))process.exit(1)}).catch(()=>process.exit(1))";
|
|
171
|
+
lines.push(`HEALTHCHECK --interval=5s --timeout=3s --start-period=10s --retries=12 CMD ["node","-e",${JSON.stringify(healthProgram)},${JSON.stringify(daimonConfig)}]`);
|
|
172
|
+
}
|
|
173
|
+
lines.push(hasDaimon ? "USER root" : "USER spawnfile");
|
|
174
|
+
lines.push(hasDaimon
|
|
175
|
+
? `ENTRYPOINT ["${DAIMON_UID_ENTRYPOINT_PATH}"]`
|
|
176
|
+
: 'ENTRYPOINT ["/opt/spawnfile/entrypoint.sh"]');
|
|
160
177
|
return `${lines.join("\n").trimEnd()}\n`;
|
|
161
178
|
};
|
|
162
|
-
export const createRootfsFiles = (runtimePlans
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
179
|
+
export const createRootfsFiles = (runtimePlans, persistentMountPaths = [], moltnet, persistentMounts = []) => {
|
|
180
|
+
const files = runtimePlans.flatMap((plan) => plan.targetFiles.map((file) => {
|
|
181
|
+
const renderedContent = file.content
|
|
182
|
+
.replaceAll("<config-path>", plan.instancePaths.configPath)
|
|
183
|
+
.replaceAll(WORKSPACE_PLACEHOLDER, plan.instancePaths.workspacePath)
|
|
184
|
+
.replaceAll("<instance-root>", plan.instancePaths.instanceRoot ?? "")
|
|
185
|
+
.replaceAll(RUNTIME_ROOT_PLACEHOLDER, plan.runtimeRoot)
|
|
186
|
+
.replaceAll(`"${GATEWAY_PORT_PLACEHOLDER}"`, plan.port ? String(plan.port) : "0")
|
|
187
|
+
.replaceAll(GATEWAY_PORT_PLACEHOLDER, plan.port ? String(plan.port) : "");
|
|
188
|
+
if (file.path === plan.meta.configFileName) {
|
|
189
|
+
return {
|
|
190
|
+
content: renderedContent,
|
|
191
|
+
path: `${CONTAINER_ROOTFS_ROOT}${plan.instancePaths.configPath}`
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
if (file.path.startsWith("runtime/")) {
|
|
195
|
+
const relativeRuntimePath = file.path.slice("runtime/".length);
|
|
196
|
+
return {
|
|
197
|
+
content: renderedContent,
|
|
198
|
+
path: `${CONTAINER_ROOTFS_ROOT}${path.posix.join(plan.runtimeRoot, relativeRuntimePath)}`
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
if (file.path.startsWith("workspace/")) {
|
|
202
|
+
const relativeWorkspacePath = file.path.slice("workspace/".length);
|
|
203
|
+
return {
|
|
204
|
+
content: file.content,
|
|
205
|
+
path: `${CONTAINER_ROOTFS_ROOT}${path.posix.join(plan.instancePaths.workspacePath, relativeWorkspacePath)}`
|
|
206
|
+
};
|
|
190
207
|
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
})
|
|
208
|
+
if (file.path.startsWith("home/")) {
|
|
209
|
+
if (!plan.instancePaths.homePath) {
|
|
210
|
+
throw new SpawnfileError("runtime_error", `Container target ${plan.id} for ${plan.runtimeName} emitted home-scoped files without a home path`);
|
|
211
|
+
}
|
|
212
|
+
const relativeHomePath = file.path.slice("home/".length);
|
|
213
|
+
return {
|
|
214
|
+
content: file.content,
|
|
215
|
+
path: `${CONTAINER_ROOTFS_ROOT}${path.posix.join(plan.instancePaths.homePath, relativeHomePath)}`
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
throw new SpawnfileError("runtime_error", `Container target ${plan.id} for ${plan.runtimeName} emitted unsupported path ${file.path}`);
|
|
219
|
+
}));
|
|
220
|
+
return runtimePlans.some((plan) => plan.runtimeName === "daimon")
|
|
221
|
+
? [{
|
|
222
|
+
content: renderRuntimeLinkMaterializer(),
|
|
223
|
+
mode: 0o600,
|
|
224
|
+
path: `${CONTAINER_ROOTFS_ROOT}${RUNTIME_LINK_MATERIALIZER_PATH}`
|
|
225
|
+
}, {
|
|
226
|
+
content: renderDaimonUidEntrypoint(runtimePlans, persistentMountPaths, moltnet, persistentMounts),
|
|
227
|
+
mode: 0o755,
|
|
228
|
+
path: `${CONTAINER_ROOTFS_ROOT}${DAIMON_UID_ENTRYPOINT_PATH}`
|
|
229
|
+
}, ...files]
|
|
230
|
+
: files;
|
|
231
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { DistributionReport } from "../distribution/index.js";
|
|
2
2
|
import type { ContainerReport } from "../report/index.js";
|
|
3
|
+
import type { ContainerPersistentMountReport } from "../report/index.js";
|
|
3
4
|
import type { EmittedFile, RuntimeContainerConfigEnvBinding, RuntimeContainerMeta } from "../runtime/index.js";
|
|
4
5
|
import type { ModelAuthMethod } from "../shared/index.js";
|
|
5
6
|
import type { ResolvedAgentNode, ResolvedPackage, ResolvedTeamNode } from "./types.js";
|
|
@@ -17,6 +18,11 @@ export interface RuntimeTargetPlan {
|
|
|
17
18
|
/** Passthrough of `ContainerTarget.engineByNodeId` (see `runtime/types.ts`), for
|
|
18
19
|
* `containerArtifacts.ts` to stamp onto `ContainerRuntimeInstanceReport.engine_by_node_id`. */
|
|
19
20
|
engineByNodeId?: Record<string, string>;
|
|
21
|
+
/** Passthrough of `ContainerTarget.grokModelByNodeId` for the Daimon broker worker render. */
|
|
22
|
+
grokModelByNodeId?: Record<string, {
|
|
23
|
+
model: string;
|
|
24
|
+
reasoningEffort: string;
|
|
25
|
+
}>;
|
|
20
26
|
packages?: ResolvedPackage[];
|
|
21
27
|
envFiles: Array<{
|
|
22
28
|
envName: string;
|
|
@@ -32,6 +38,8 @@ export interface RuntimeTargetPlan {
|
|
|
32
38
|
meta: RuntimeContainerMeta;
|
|
33
39
|
modelAuthMethods: Record<string, ModelAuthMethod>;
|
|
34
40
|
modelSecretsRequired: string[];
|
|
41
|
+
opaqueMountTargets?: string[];
|
|
42
|
+
persistentMounts?: ContainerPersistentMountReport[];
|
|
35
43
|
port?: number;
|
|
36
44
|
publishedPort?: number;
|
|
37
45
|
/**
|