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
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { execFile as execFileCallback } from "node:child_process";
|
|
2
|
+
import { promisify } from "node:util";
|
|
3
|
+
import { SpawnfileError } from "../shared/index.js";
|
|
4
|
+
const execFile = promisify(execFileCallback);
|
|
5
|
+
const parseDockerContextHost = (stdout) => {
|
|
6
|
+
const trimmed = stdout.trim();
|
|
7
|
+
if (!trimmed)
|
|
8
|
+
return null;
|
|
9
|
+
try {
|
|
10
|
+
const parsed = JSON.parse(trimmed);
|
|
11
|
+
return typeof parsed === "string" ? parsed : null;
|
|
12
|
+
}
|
|
13
|
+
catch {
|
|
14
|
+
return trimmed;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
const resolveDockerContextHost = async (invocation, context) => {
|
|
18
|
+
const { stdout } = await execFile(invocation.command, [
|
|
19
|
+
"context", "inspect", context, "--format", "{{json .Endpoints.docker.Host}}"
|
|
20
|
+
], { cwd: invocation.cwd, timeout: 10_000 });
|
|
21
|
+
return parseDockerContextHost(stdout);
|
|
22
|
+
};
|
|
23
|
+
const resolveActiveDockerContext = async (invocation) => {
|
|
24
|
+
const { stdout } = await execFile(invocation.command, ["context", "show"], {
|
|
25
|
+
cwd: invocation.cwd,
|
|
26
|
+
timeout: 10_000
|
|
27
|
+
});
|
|
28
|
+
const context = stdout.trim();
|
|
29
|
+
if (!context || /\s/u.test(context)) {
|
|
30
|
+
throw new SpawnfileError("validation_error", "Unable to attest the active Docker context for opaque Daimon credentials");
|
|
31
|
+
}
|
|
32
|
+
return context;
|
|
33
|
+
};
|
|
34
|
+
const resolveDockerDaemonEndpoint = async (invocation) => {
|
|
35
|
+
if (invocation.dockerContext)
|
|
36
|
+
return resolveDockerContextHost(invocation, invocation.dockerContext);
|
|
37
|
+
if (invocation.dockerHost)
|
|
38
|
+
return invocation.dockerHost;
|
|
39
|
+
const ambientContext = process.env.DOCKER_CONTEXT?.trim();
|
|
40
|
+
if (ambientContext)
|
|
41
|
+
return resolveDockerContextHost(invocation, ambientContext);
|
|
42
|
+
const ambientHost = process.env.DOCKER_HOST?.trim();
|
|
43
|
+
if (ambientHost)
|
|
44
|
+
return ambientHost;
|
|
45
|
+
return resolveDockerContextHost(invocation, await resolveActiveDockerContext(invocation));
|
|
46
|
+
};
|
|
47
|
+
const isLocalDockerEndpoint = (host) => {
|
|
48
|
+
if (host.startsWith("/"))
|
|
49
|
+
return true;
|
|
50
|
+
if (host.startsWith("unix://")) {
|
|
51
|
+
try {
|
|
52
|
+
const endpoint = new URL(host);
|
|
53
|
+
return endpoint.host === "" && endpoint.pathname.startsWith("/");
|
|
54
|
+
}
|
|
55
|
+
catch {
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return host.startsWith("npipe:////./pipe/") || host.startsWith("npipe://./pipe/");
|
|
60
|
+
};
|
|
61
|
+
const explicitLocalEndpoint = (endpoint) => endpoint.startsWith("/") ? `unix://${endpoint}` : endpoint;
|
|
62
|
+
const withPinnedDockerEndpoint = (invocation, endpoint) => {
|
|
63
|
+
const run = invocation.args.indexOf("run");
|
|
64
|
+
if (run < 0) {
|
|
65
|
+
throw new SpawnfileError("validation_error", "Unable to pin Docker daemon endpoint for opaque Daimon credentials");
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
...invocation,
|
|
69
|
+
args: ["--host", endpoint, ...invocation.args.slice(run)],
|
|
70
|
+
dockerContext: null,
|
|
71
|
+
dockerHost: endpoint
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* Resolves a possibly mutable Docker context once, validates that endpoint,
|
|
76
|
+
* then makes every remaining Docker operation use the immutable endpoint.
|
|
77
|
+
*/
|
|
78
|
+
export const pinOpaqueDaimonDockerEndpoint = async (invocation) => {
|
|
79
|
+
if (!invocation.opaqueDaimonCredentials)
|
|
80
|
+
return invocation;
|
|
81
|
+
let resolved;
|
|
82
|
+
try {
|
|
83
|
+
resolved = await resolveDockerDaemonEndpoint(invocation);
|
|
84
|
+
}
|
|
85
|
+
catch (error) {
|
|
86
|
+
if (error instanceof SpawnfileError)
|
|
87
|
+
throw error;
|
|
88
|
+
throw new SpawnfileError("validation_error", "Unable to attest the Docker daemon locality for opaque Daimon credentials");
|
|
89
|
+
}
|
|
90
|
+
if (!resolved || !isLocalDockerEndpoint(resolved)) {
|
|
91
|
+
throw new SpawnfileError("validation_error", "Opaque Daimon credentials require a local Docker daemon; remote and SSH daemons are unsupported");
|
|
92
|
+
}
|
|
93
|
+
return withPinnedDockerEndpoint(invocation, explicitLocalEndpoint(resolved));
|
|
94
|
+
};
|
|
95
|
+
export const assertOpaqueDaimonCredentialsUseLocalDaemon = async (invocation) => {
|
|
96
|
+
await pinOpaqueDaimonDockerEndpoint(invocation);
|
|
97
|
+
};
|
|
98
|
+
export const assertOpaqueDaimonCredentialsHaveNoUserNamespace = async (invocation) => {
|
|
99
|
+
if (!invocation.opaqueDaimonCredentials)
|
|
100
|
+
return;
|
|
101
|
+
if (invocation.dockerContext || !invocation.dockerHost) {
|
|
102
|
+
throw new SpawnfileError("validation_error", "Opaque Daimon credentials require a pinned Docker daemon endpoint before Docker info");
|
|
103
|
+
}
|
|
104
|
+
const args = [
|
|
105
|
+
"--host", invocation.dockerHost,
|
|
106
|
+
"info", "--format", "{{json .SecurityOptions}}"
|
|
107
|
+
];
|
|
108
|
+
let securityOptions;
|
|
109
|
+
try {
|
|
110
|
+
const { stdout } = await execFile(invocation.command, args, {
|
|
111
|
+
cwd: invocation.cwd,
|
|
112
|
+
timeout: 10_000
|
|
113
|
+
});
|
|
114
|
+
securityOptions = JSON.parse(stdout.trim());
|
|
115
|
+
}
|
|
116
|
+
catch {
|
|
117
|
+
throw new SpawnfileError("validation_error", "Unable to verify that the Docker daemon has no user namespace remapping for opaque Daimon credentials");
|
|
118
|
+
}
|
|
119
|
+
if (!Array.isArray(securityOptions) || securityOptions.some((value) => typeof value !== "string" || /userns|rootless/iu.test(value))) {
|
|
120
|
+
throw new SpawnfileError("validation_error", "Opaque Daimon credentials require a Docker daemon without user namespace remapping");
|
|
121
|
+
}
|
|
122
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { DockerRunInvocation, DockerRunResult } from "./runProjectDocker.js";
|
|
2
|
+
/** Holds daemon-side atomic volume reservations through verified startup. */
|
|
3
|
+
export declare const withExclusiveVolumeReservations: (invocation: DockerRunInvocation, operation: () => Promise<DockerRunResult | void>) => Promise<DockerRunResult | void>;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
2
|
+
import { execFile as execFileCallback } from "node:child_process";
|
|
3
|
+
import { promisify } from "node:util";
|
|
4
|
+
import { SpawnfileError } from "../shared/index.js";
|
|
5
|
+
const execFile = promisify(execFileCallback);
|
|
6
|
+
const dockerId = /^[a-f0-9]{64}$/u;
|
|
7
|
+
const versionLabel = "com.spawnfile.exclusive-volume-reservation";
|
|
8
|
+
const ownerLabel = "com.spawnfile.exclusive-volume-owner";
|
|
9
|
+
const volumeLabel = "com.spawnfile.exclusive-volume-digest";
|
|
10
|
+
const endpointArgs = (invocation) => invocation.dockerContext
|
|
11
|
+
? ["--context", invocation.dockerContext]
|
|
12
|
+
: invocation.dockerHost ? ["--host", invocation.dockerHost] : [];
|
|
13
|
+
const execute = async (invocation, args) => {
|
|
14
|
+
const { stdout } = await execFile(invocation.command, [...endpointArgs(invocation), ...args], {
|
|
15
|
+
cwd: invocation.cwd,
|
|
16
|
+
timeout: 10_000
|
|
17
|
+
});
|
|
18
|
+
return stdout;
|
|
19
|
+
};
|
|
20
|
+
const reservationName = (digest) => `spawnfile-volume-reservation-${digest.slice("sha256:".length, "sha256:".length + 24)}`;
|
|
21
|
+
const verifyReservation = async (invocation, reservation) => {
|
|
22
|
+
try {
|
|
23
|
+
const [idRaw, labelsRaw, ...extra] = (await execute(invocation, [
|
|
24
|
+
"container", "inspect", "--format", "{{json .Id}}\n{{json .Config.Labels}}", reservation.id
|
|
25
|
+
])).trim().split("\n");
|
|
26
|
+
if (!idRaw || !labelsRaw || extra.length > 0)
|
|
27
|
+
throw new Error("shape");
|
|
28
|
+
const id = JSON.parse(idRaw);
|
|
29
|
+
const labels = JSON.parse(labelsRaw);
|
|
30
|
+
if (id !== reservation.id || !labels || typeof labels !== "object" || Array.isArray(labels))
|
|
31
|
+
throw new Error("identity");
|
|
32
|
+
const values = labels;
|
|
33
|
+
if (values[versionLabel] !== "v1" || values[ownerLabel] !== reservation.owner
|
|
34
|
+
|| values[volumeLabel] !== reservation.volumeDigest)
|
|
35
|
+
throw new Error("authority");
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
throw new SpawnfileError("runtime_error", "Exclusive persistent mount reservation identity is unavailable");
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
const release = async (invocation, reservations) => {
|
|
42
|
+
let failed = false;
|
|
43
|
+
for (const reservation of [...reservations].reverse()) {
|
|
44
|
+
try {
|
|
45
|
+
await verifyReservation(invocation, reservation);
|
|
46
|
+
await execute(invocation, ["container", "rm", reservation.id]);
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
failed = true;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
if (failed)
|
|
53
|
+
throw new SpawnfileError("runtime_error", "Unable to release exclusive persistent mount reservation");
|
|
54
|
+
};
|
|
55
|
+
const assertAvailable = async (invocation) => {
|
|
56
|
+
for (const volume of invocation.exclusiveReattachVolumes ?? []) {
|
|
57
|
+
let stdout;
|
|
58
|
+
try {
|
|
59
|
+
stdout = await execute(invocation, [
|
|
60
|
+
"ps", "--filter", `volume=${volume}`, "--format", "{{.Names}}"
|
|
61
|
+
]);
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
throw new SpawnfileError("runtime_error", "Unable to verify exclusive persistent mount occupancy");
|
|
65
|
+
}
|
|
66
|
+
const occupants = stdout.split("\n").map((name) => name.trim()).filter(Boolean);
|
|
67
|
+
if (occupants.some((name) => name !== invocation.containerName)) {
|
|
68
|
+
throw new SpawnfileError("runtime_error", "Exclusive persistent mount is attached to another running deployment; stop it before reattaching this lineage");
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
const acquire = async (invocation) => {
|
|
73
|
+
const reservations = [];
|
|
74
|
+
const volumes = [...new Set(invocation.exclusiveReattachVolumes ?? [])].sort();
|
|
75
|
+
try {
|
|
76
|
+
for (const volume of volumes) {
|
|
77
|
+
const volumeDigest = `sha256:${createHash("sha256").update(volume).digest("hex")}`;
|
|
78
|
+
const owner = randomUUID();
|
|
79
|
+
let id;
|
|
80
|
+
try {
|
|
81
|
+
id = (await execute(invocation, [
|
|
82
|
+
"container", "create", "--name", reservationName(volumeDigest),
|
|
83
|
+
"--label", `${versionLabel}=v1`,
|
|
84
|
+
"--label", `${ownerLabel}=${owner}`,
|
|
85
|
+
"--label", `${volumeLabel}=${volumeDigest}`,
|
|
86
|
+
invocation.imageTag
|
|
87
|
+
])).trim();
|
|
88
|
+
}
|
|
89
|
+
catch {
|
|
90
|
+
throw new SpawnfileError("runtime_error", "Exclusive persistent mount reservation is already held");
|
|
91
|
+
}
|
|
92
|
+
if (!dockerId.test(id))
|
|
93
|
+
throw new SpawnfileError("runtime_error", "Exclusive persistent mount reservation returned invalid identity");
|
|
94
|
+
const reservation = { id, owner, volumeDigest };
|
|
95
|
+
reservations.push(reservation);
|
|
96
|
+
await verifyReservation(invocation, reservation);
|
|
97
|
+
}
|
|
98
|
+
await assertAvailable(invocation);
|
|
99
|
+
return reservations;
|
|
100
|
+
}
|
|
101
|
+
catch (error) {
|
|
102
|
+
if (reservations.length > 0)
|
|
103
|
+
await release(invocation, reservations);
|
|
104
|
+
throw error;
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
/** Holds daemon-side atomic volume reservations through verified startup. */
|
|
108
|
+
export const withExclusiveVolumeReservations = async (invocation, operation) => {
|
|
109
|
+
if ((invocation.exclusiveReattachVolumes?.length ?? 0) === 0)
|
|
110
|
+
return operation();
|
|
111
|
+
const reservations = await acquire(invocation);
|
|
112
|
+
try {
|
|
113
|
+
return await operation();
|
|
114
|
+
}
|
|
115
|
+
finally {
|
|
116
|
+
await release(invocation, reservations);
|
|
117
|
+
}
|
|
118
|
+
};
|
|
@@ -12,9 +12,9 @@ export const executeDockerRunWithSupportCleanup = async (invocation, runner) =>
|
|
|
12
12
|
? {
|
|
13
13
|
...invocation,
|
|
14
14
|
onDetachedStarted: async (result) => {
|
|
15
|
+
await invocation.onDetachedStarted?.(result);
|
|
15
16
|
started = true;
|
|
16
17
|
await rm(invocation.envFilePath, { force: true });
|
|
17
|
-
await invocation.onDetachedStarted?.(result);
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
: invocation;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* `spawnfile.training-broker.v1`: the only thing the host tells the
|
|
4
|
+
* broker-capable training container about its slot. It is data, never code —
|
|
5
|
+
* the image's own Spawnfile distribution renders the provisioning from it with
|
|
6
|
+
* the same renderers production uses, so no host-written executable is ever
|
|
7
|
+
* mounted (`../container/AGENTS.md`).
|
|
8
|
+
*
|
|
9
|
+
* It carries no credentials: the training Grok login reaches the container only
|
|
10
|
+
* as the read-only bootstrap leaf bind, and the rotating credential lives on
|
|
11
|
+
* the named realm volume.
|
|
12
|
+
*/
|
|
13
|
+
export declare const trainingBrokerDeclarationSchema: z.ZodObject<{
|
|
14
|
+
version: z.ZodLiteral<"spawnfile.training-broker.v1">;
|
|
15
|
+
engine: z.ZodLiteral<"grok">;
|
|
16
|
+
agentId: z.ZodString;
|
|
17
|
+
model: z.ZodEnum<{
|
|
18
|
+
"grok-4.6": "grok-4.6";
|
|
19
|
+
"grok-4.5": "grok-4.5";
|
|
20
|
+
"grok-build": "grok-build";
|
|
21
|
+
}>;
|
|
22
|
+
reasoningEffort: z.ZodEnum<{
|
|
23
|
+
high: "high";
|
|
24
|
+
medium: "medium";
|
|
25
|
+
low: "low";
|
|
26
|
+
}>;
|
|
27
|
+
architecture: z.ZodEnum<{
|
|
28
|
+
arm64: "arm64";
|
|
29
|
+
x64: "x64";
|
|
30
|
+
}>;
|
|
31
|
+
limits: z.ZodObject<{
|
|
32
|
+
maxRequests: z.ZodNumber;
|
|
33
|
+
maxTokens: z.ZodNumber;
|
|
34
|
+
timeoutMs: z.ZodNumber;
|
|
35
|
+
}, z.core.$strict>;
|
|
36
|
+
bootstrap: z.ZodString;
|
|
37
|
+
organizationUid: z.ZodLiteral<2000>;
|
|
38
|
+
seccompProfileSha256: z.ZodString;
|
|
39
|
+
unenforcedBindPolicy: z.ZodDefault<z.ZodEnum<{
|
|
40
|
+
refuse: "refuse";
|
|
41
|
+
"profile-only": "profile-only";
|
|
42
|
+
}>>;
|
|
43
|
+
}, z.core.$strict>;
|
|
44
|
+
export type TrainingBrokerDeclaration = z.infer<typeof trainingBrokerDeclarationSchema>;
|
|
45
|
+
export declare const parseTrainingBrokerDeclaration: (value: unknown) => TrainingBrokerDeclaration;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { DAIMON_GROK_BROKER_MODELS, DAIMON_GROK_BROKER_REASONING_EFFORTS, DAIMON_GROK_ENGINE_BROKER } from "../../../runtime/daimon/contractManifest.js";
|
|
4
|
+
const canonical = z.string().min(2).max(4_096).refine((value) => path.posix.isAbsolute(value) && path.posix.normalize(value) === value && !value.endsWith("/") && !value.includes("\0"), "canonical absolute path");
|
|
5
|
+
/**
|
|
6
|
+
* `spawnfile.training-broker.v1`: the only thing the host tells the
|
|
7
|
+
* broker-capable training container about its slot. It is data, never code —
|
|
8
|
+
* the image's own Spawnfile distribution renders the provisioning from it with
|
|
9
|
+
* the same renderers production uses, so no host-written executable is ever
|
|
10
|
+
* mounted (`../container/AGENTS.md`).
|
|
11
|
+
*
|
|
12
|
+
* It carries no credentials: the training Grok login reaches the container only
|
|
13
|
+
* as the read-only bootstrap leaf bind, and the rotating credential lives on
|
|
14
|
+
* the named realm volume.
|
|
15
|
+
*/
|
|
16
|
+
export const trainingBrokerDeclarationSchema = z.strictObject({
|
|
17
|
+
version: z.literal("spawnfile.training-broker.v1"),
|
|
18
|
+
engine: z.literal("grok"),
|
|
19
|
+
agentId: z.string().min(1).max(128).regex(/^[A-Za-z0-9][A-Za-z0-9._:-]*$/u),
|
|
20
|
+
model: z.enum(DAIMON_GROK_BROKER_MODELS),
|
|
21
|
+
reasoningEffort: z.enum(DAIMON_GROK_BROKER_REASONING_EFFORTS),
|
|
22
|
+
architecture: z.enum(["arm64", "x64"]),
|
|
23
|
+
limits: z.strictObject({
|
|
24
|
+
maxRequests: z.number().int().min(DAIMON_GROK_ENGINE_BROKER.turnLimits.bounds.maxRequests[0]).max(DAIMON_GROK_ENGINE_BROKER.turnLimits.bounds.maxRequests[1]),
|
|
25
|
+
maxTokens: z.number().int().min(DAIMON_GROK_ENGINE_BROKER.turnLimits.bounds.maxTokens[0]).max(DAIMON_GROK_ENGINE_BROKER.turnLimits.bounds.maxTokens[1]),
|
|
26
|
+
timeoutMs: z.number().int().min(DAIMON_GROK_ENGINE_BROKER.turnLimits.bounds.timeoutMs[0]).max(DAIMON_GROK_ENGINE_BROKER.turnLimits.bounds.timeoutMs[1])
|
|
27
|
+
}),
|
|
28
|
+
/** The read-only bootstrap credential leaf, already refused if it is the desktop `~/.grok/auth.json`. */
|
|
29
|
+
bootstrap: canonical,
|
|
30
|
+
/** The uid the trained evaluator (Paideia, DSPy, judges) runs as; the only uid the slot supervisor serves. */
|
|
31
|
+
organizationUid: z.literal(DAIMON_GROK_ENGINE_BROKER.identities.organizationUid),
|
|
32
|
+
seccompProfileSha256: z.string().regex(/^[a-f0-9]{64}$/u),
|
|
33
|
+
/**
|
|
34
|
+
* What the slot supervisor does with a deny path whose backing filesystem
|
|
35
|
+
* does not enforce unix ownership — virtiofs and grpcfuse under Docker
|
|
36
|
+
* Desktop and Colima, where `chown` is silently ignored and uid 2200 reads a
|
|
37
|
+
* root `0600` file (P0 §5). The backing filesystem decides, not the fact of
|
|
38
|
+
* being a host bind: the same bind over ext4 or overlay on a Linux daemon is
|
|
39
|
+
* probed for real, which is what makes `refuse` a default a run can meet.
|
|
40
|
+
*
|
|
41
|
+
* `refuse` (the default) fails the slot and writes no receipt: a worker-uid
|
|
42
|
+
* probe over such a path carries no information, so the supervisor will not
|
|
43
|
+
* certify it. `profile-only` is the operator's explicit acceptance that for
|
|
44
|
+
* those paths the boundary is the bubblewrap-enforced `deny` list alone —
|
|
45
|
+
* verified to block both shell `cat` and `read_file` on 1.0.34 (P0 §4), but
|
|
46
|
+
* *not* a boundary a worker-uid namespace cannot lift — and the supervisor
|
|
47
|
+
* records every path that used that weaker evidence in its log.
|
|
48
|
+
*
|
|
49
|
+
* It does not reach `TRAINING_SEALED_DENY_PATHS`. The sealed train and test
|
|
50
|
+
* datasets are held by DAC on their ancestor under both values, and a slot
|
|
51
|
+
* that cannot prove that denial is refused whatever this says.
|
|
52
|
+
*/
|
|
53
|
+
unenforcedBindPolicy: z.enum(["refuse", "profile-only"]).default("refuse")
|
|
54
|
+
}).strict();
|
|
55
|
+
export const parseTrainingBrokerDeclaration = (value) => trainingBrokerDeclarationSchema.parse(value);
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type DaimonProjectionModule } from "./projection.js";
|
|
2
|
+
export declare const TRAINING_GROK_BROKER_CONTROL_SOCKET_ENV = "PAIDEIA_GROK_BROKER_CONTROL_SOCKET";
|
|
3
|
+
export declare const TRAINING_GROK_GRANT_HOME_ROOT_ENV = "PAIDEIA_GROK_GRANT_HOME_ROOT";
|
|
4
|
+
export declare const TRAINING_ENTRYPOINT_COMMAND = "/opt/training/bin/train";
|
|
5
|
+
/**
|
|
6
|
+
* The desktop Grok login, in every spelling a caller might reach it by.
|
|
7
|
+
*
|
|
8
|
+
* D2 is explicit: training uses one dedicated Grok login and never the
|
|
9
|
+
* developer's own. An in-container refresh rotates the credential, so mounting
|
|
10
|
+
* the desktop leaf would invalidate the developer's desktop session as a side
|
|
11
|
+
* effect of a training run — and the refreshed token would live on tmpfs, so
|
|
12
|
+
* the desktop login would be gone rather than moved.
|
|
13
|
+
*/
|
|
14
|
+
export declare const desktopGrokAuthPaths: (home?: string) => string[];
|
|
15
|
+
export declare const assertNotDesktopGrokAuth: (source: string, home?: string) => string;
|
|
16
|
+
export interface TrainingEntrypointOptions {
|
|
17
|
+
argv: readonly string[];
|
|
18
|
+
declarationPath?: string;
|
|
19
|
+
loadDaimon?: () => Promise<DaimonProjectionModule>;
|
|
20
|
+
log?: (line: string) => void;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The broker-capable training container's root entrypoint.
|
|
24
|
+
*
|
|
25
|
+
* Order matters and is the whole privilege model: provision as root with the
|
|
26
|
+
* production capability set, start the launcher (root) and the broker and
|
|
27
|
+
* relay (2100) and prove each one's post-drop identity, publish the slot
|
|
28
|
+
* supervisor socket, and only then drop to uid 2000 with an empty capability
|
|
29
|
+
* bounding set to run `train`. Paideia, DSPy and the judges are that uid; the
|
|
30
|
+
* model's own tools are the worker uid the launcher alone can reach.
|
|
31
|
+
*/
|
|
32
|
+
export declare const runTrainingBrokerEntrypoint: (options: TrainingEntrypointOptions) => Promise<number>;
|
|
33
|
+
/**
|
|
34
|
+
* `train` as uid 2000 with an empty bounding set, proven inside the child
|
|
35
|
+
* before it execs: `setpriv --bounding-set=-all` silently does nothing without
|
|
36
|
+
* `CAP_SETPCAP`, so the guard has to read `/proc/self/status` rather than
|
|
37
|
+
* trust the flag.
|
|
38
|
+
*/
|
|
39
|
+
export declare const trainingChildArgv: (argv: readonly string[], uid?: number) => string[];
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import { randomBytes } from "node:crypto";
|
|
3
|
+
import { lstat, readFile } from "node:fs/promises";
|
|
4
|
+
import os from "node:os";
|
|
5
|
+
import path from "node:path";
|
|
6
|
+
import { SpawnfileError } from "../../../shared/index.js";
|
|
7
|
+
import { DAIMON_GROK_ENGINE_BROKER } from "../../../runtime/daimon/contractManifest.js";
|
|
8
|
+
import { parseTrainingBrokerDeclaration } from "./declaration.js";
|
|
9
|
+
import { loadDaimonProjectionModule, resolveTrainingGrokProjection } from "./projection.js";
|
|
10
|
+
import { resolveTrainingGrokRegistration } from "./registration.js";
|
|
11
|
+
import { createTrainingSlotRuntime } from "./runtime.js";
|
|
12
|
+
import { createTrainingSlotSupervisor, serveTrainingSlotSupervisor, startTrainingSlot } from "./supervisor.js";
|
|
13
|
+
import { DAIMON_ORGANIZATION_UID, TRAINING_BOOTSTRAP_MOUNT, TRAINING_BROKER_DECLARATION_FILE, TRAINING_GRANT_HOME_ROOT, TRAINING_SUPERVISOR_SOCKET } from "./paths.js";
|
|
14
|
+
export const TRAINING_GROK_BROKER_CONTROL_SOCKET_ENV = "PAIDEIA_GROK_BROKER_CONTROL_SOCKET";
|
|
15
|
+
export const TRAINING_GROK_GRANT_HOME_ROOT_ENV = "PAIDEIA_GROK_GRANT_HOME_ROOT";
|
|
16
|
+
export const TRAINING_ENTRYPOINT_COMMAND = "/opt/training/bin/train";
|
|
17
|
+
/**
|
|
18
|
+
* The desktop Grok login, in every spelling a caller might reach it by.
|
|
19
|
+
*
|
|
20
|
+
* D2 is explicit: training uses one dedicated Grok login and never the
|
|
21
|
+
* developer's own. An in-container refresh rotates the credential, so mounting
|
|
22
|
+
* the desktop leaf would invalidate the developer's desktop session as a side
|
|
23
|
+
* effect of a training run — and the refreshed token would live on tmpfs, so
|
|
24
|
+
* the desktop login would be gone rather than moved.
|
|
25
|
+
*/
|
|
26
|
+
export const desktopGrokAuthPaths = (home = os.homedir()) => [path.resolve(home, ".grok/auth.json"), path.resolve(home, ".grok", "auth.json")];
|
|
27
|
+
export const assertNotDesktopGrokAuth = (source, home = os.homedir()) => {
|
|
28
|
+
if (desktopGrokAuthPaths(home).includes(path.resolve(source))) {
|
|
29
|
+
throw new SpawnfileError("validation_error", "Training refuses the desktop ~/.grok/auth.json as its Grok bootstrap; import a dedicated login with `spawnfile auth import grok --profile paideia-training --from <dir>`");
|
|
30
|
+
}
|
|
31
|
+
return source;
|
|
32
|
+
};
|
|
33
|
+
/** The bootstrap leaf inside the container: the fixed read-only mount, a bounded regular file, never a symlink. */
|
|
34
|
+
const assertBootstrap = async (declaration) => {
|
|
35
|
+
if (declaration.bootstrap !== TRAINING_BOOTSTRAP_MOUNT) {
|
|
36
|
+
throw new SpawnfileError("validation_error", `The training Grok bootstrap must be mounted at ${TRAINING_BOOTSTRAP_MOUNT}`);
|
|
37
|
+
}
|
|
38
|
+
const info = await lstat(declaration.bootstrap);
|
|
39
|
+
if (!info.isFile() || info.isSymbolicLink() || info.size < 2 || info.size > DAIMON_GROK_SUBSCRIPTION_MAX_BYTES) {
|
|
40
|
+
throw new SpawnfileError("validation_error", "The training Grok bootstrap must be a bounded regular credential leaf");
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
const DAIMON_GROK_SUBSCRIPTION_MAX_BYTES = 64 * 1024;
|
|
44
|
+
/**
|
|
45
|
+
* The broker-capable training container's root entrypoint.
|
|
46
|
+
*
|
|
47
|
+
* Order matters and is the whole privilege model: provision as root with the
|
|
48
|
+
* production capability set, start the launcher (root) and the broker and
|
|
49
|
+
* relay (2100) and prove each one's post-drop identity, publish the slot
|
|
50
|
+
* supervisor socket, and only then drop to uid 2000 with an empty capability
|
|
51
|
+
* bounding set to run `train`. Paideia, DSPy and the judges are that uid; the
|
|
52
|
+
* model's own tools are the worker uid the launcher alone can reach.
|
|
53
|
+
*/
|
|
54
|
+
export const runTrainingBrokerEntrypoint = async (options) => {
|
|
55
|
+
const log = options.log ?? ((line) => process.stderr.write(`[training-entrypoint] ${line}\n`));
|
|
56
|
+
if (process.getuid?.() !== 0)
|
|
57
|
+
throw new SpawnfileError("runtime_error", "The broker-capable training container must start as root");
|
|
58
|
+
const declaration = parseTrainingBrokerDeclaration(JSON.parse(await readFile(options.declarationPath ?? TRAINING_BROKER_DECLARATION_FILE, "utf8")));
|
|
59
|
+
await assertBootstrap(declaration);
|
|
60
|
+
const registration = resolveTrainingGrokRegistration(declaration);
|
|
61
|
+
const daimon = await (options.loadDaimon ?? loadDaimonProjectionModule)();
|
|
62
|
+
// Daimon's projection is I/O-free, so the digest the receipt will bind is known before anything is provisioned.
|
|
63
|
+
const { projectionSha256 } = await resolveTrainingGrokProjection(declaration, registration, daimon);
|
|
64
|
+
const runtime = createTrainingSlotRuntime({ declaration, registration, projectionSha256 });
|
|
65
|
+
// Provision, start, canary and publish the slot preflight receipt before `train` exists at all: the
|
|
66
|
+
// first trial must not be the one trial that runs on no worker-uid denial evidence, and a refusal
|
|
67
|
+
// here costs nothing while the same refusal after the first wake costs that trial's spend.
|
|
68
|
+
const preflight = await startTrainingSlot(runtime, randomBytes(32).toString("hex"));
|
|
69
|
+
const supervisor = createTrainingSlotSupervisor({ runtime, organizationUid: declaration.organizationUid });
|
|
70
|
+
const server = serveTrainingSlotSupervisor(supervisor, TRAINING_SUPERVISOR_SOCKET, log, declaration.organizationUid);
|
|
71
|
+
log(`slot ${registration.slot} provisioned for ${registration.agentId} (${registration.model}/${registration.reasoningEffort}), projection ${projectionSha256}, `
|
|
72
|
+
+ `generation ${preflight.generation} with ${preflight.canaries} denied canaries at ${preflight.receipt}`);
|
|
73
|
+
const status = await runTrainingChild(options.argv, declaration, log);
|
|
74
|
+
server.close();
|
|
75
|
+
await runtime.stop();
|
|
76
|
+
return status;
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* `train` as uid 2000 with an empty bounding set, proven inside the child
|
|
80
|
+
* before it execs: `setpriv --bounding-set=-all` silently does nothing without
|
|
81
|
+
* `CAP_SETPCAP`, so the guard has to read `/proc/self/status` rather than
|
|
82
|
+
* trust the flag.
|
|
83
|
+
*/
|
|
84
|
+
export const trainingChildArgv = (argv, uid = DAIMON_ORGANIZATION_UID) => [
|
|
85
|
+
"setpriv", "--clear-groups", `--reuid=${uid}`, `--regid=${uid}`, "--inh-caps=-all", "--ambient-caps=-all", "--bounding-set=-all",
|
|
86
|
+
"--", "/bin/bash", "-ceu",
|
|
87
|
+
'if [ "$EUID" -eq 0 ]; then echo "training must not run as root" >&2; exit 1; fi\n'
|
|
88
|
+
+ 'test "$(sed -n "s/^CapBnd:[[:space:]]*//p" /proc/self/status)" = 0000000000000000\n'
|
|
89
|
+
+ 'test "$(sed -n "s/^CapEff:[[:space:]]*//p" /proc/self/status)" = 0000000000000000\n'
|
|
90
|
+
+ 'exec "$@"',
|
|
91
|
+
"bash", TRAINING_ENTRYPOINT_COMMAND, ...argv
|
|
92
|
+
];
|
|
93
|
+
const runTrainingChild = (argv, declaration, log) => new Promise((resolve) => {
|
|
94
|
+
const command = trainingChildArgv(argv, declaration.organizationUid);
|
|
95
|
+
const child = spawn(command[0], command.slice(1), {
|
|
96
|
+
stdio: ["ignore", "inherit", "inherit"],
|
|
97
|
+
env: {
|
|
98
|
+
...process.env,
|
|
99
|
+
[TRAINING_GROK_BROKER_CONTROL_SOCKET_ENV]: DAIMON_GROK_ENGINE_BROKER.controlSocketPath,
|
|
100
|
+
[TRAINING_GROK_GRANT_HOME_ROOT_ENV]: TRAINING_GRANT_HOME_ROOT,
|
|
101
|
+
HOME: "/home/training"
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
const forward = (signal) => () => child.kill(signal);
|
|
105
|
+
for (const signal of ["SIGTERM", "SIGINT", "SIGHUP"])
|
|
106
|
+
process.on(signal, forward(signal));
|
|
107
|
+
child.once("exit", (code, signal) => {
|
|
108
|
+
log(`training exited code=${code ?? "null"} signal=${signal ?? "none"}`);
|
|
109
|
+
resolve(signal ? (signal === "SIGINT" ? 130 : 143) : code ?? 1);
|
|
110
|
+
});
|
|
111
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { parseTrainingBrokerDeclaration, trainingBrokerDeclarationSchema, type TrainingBrokerDeclaration } from "./declaration.js";
|
|
2
|
+
export { assertNotDesktopGrokAuth, desktopGrokAuthPaths, runTrainingBrokerEntrypoint, trainingChildArgv, TRAINING_GROK_BROKER_CONTROL_SOCKET_ENV, TRAINING_GROK_GRANT_HOME_ROOT_ENV } from "./entrypoint.js";
|
|
3
|
+
export { brokerProcessPlan, startBrokerProcesses, stopBrokerProcesses } from "./processes.js";
|
|
4
|
+
export { loadDaimonProjectionModule, resolveTrainingGrokProjection, trainingOrganizationRuntimeConfig } from "./projection.js";
|
|
5
|
+
export { renderTrainingBrokerProvisioning, renderTrainingIdentities, trainingSlotDirectories } from "./provisioning.js";
|
|
6
|
+
export { buildTrainingSlotReceipt, readGrokExecutableSha256, resolveBackingFilesystem, resolveTrainingCanaries } from "./receipt.js";
|
|
7
|
+
export { resolveTrainingGrokDenyPaths, resolveTrainingGrokRegistration } from "./registration.js";
|
|
8
|
+
export { createTrainingSlotRuntime } from "./runtime.js";
|
|
9
|
+
export { assertTrainingSupervisorSocketIdentity, createTrainingSlotSupervisor, serveTrainingSlotSupervisor, TRAINING_SUPERVISOR_PROTOCOL, type TrainingSlotRuntime } from "./supervisor.js";
|
|
10
|
+
export * from "./paths.js";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { parseTrainingBrokerDeclaration, trainingBrokerDeclarationSchema } from "./declaration.js";
|
|
2
|
+
export { assertNotDesktopGrokAuth, desktopGrokAuthPaths, runTrainingBrokerEntrypoint, trainingChildArgv, TRAINING_GROK_BROKER_CONTROL_SOCKET_ENV, TRAINING_GROK_GRANT_HOME_ROOT_ENV } from "./entrypoint.js";
|
|
3
|
+
export { brokerProcessPlan, startBrokerProcesses, stopBrokerProcesses } from "./processes.js";
|
|
4
|
+
export { loadDaimonProjectionModule, resolveTrainingGrokProjection, trainingOrganizationRuntimeConfig } from "./projection.js";
|
|
5
|
+
export { renderTrainingBrokerProvisioning, renderTrainingIdentities, trainingSlotDirectories } from "./provisioning.js";
|
|
6
|
+
export { buildTrainingSlotReceipt, readGrokExecutableSha256, resolveBackingFilesystem, resolveTrainingCanaries } from "./receipt.js";
|
|
7
|
+
export { resolveTrainingGrokDenyPaths, resolveTrainingGrokRegistration } from "./registration.js";
|
|
8
|
+
export { createTrainingSlotRuntime } from "./runtime.js";
|
|
9
|
+
export { assertTrainingSupervisorSocketIdentity, createTrainingSlotSupervisor, serveTrainingSlotSupervisor, TRAINING_SUPERVISOR_PROTOCOL } from "./supervisor.js";
|
|
10
|
+
export * from "./paths.js";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { runTrainingBrokerEntrypoint } from "./entrypoint.js";
|
|
3
|
+
/**
|
|
4
|
+
* The broker-capable training image's root entrypoint process. The image ships
|
|
5
|
+
* it; the host supplies only the read-only `spawnfile.training-broker.v1`
|
|
6
|
+
* declaration and never a script, so no host executable enters the container.
|
|
7
|
+
*/
|
|
8
|
+
const main = async () => {
|
|
9
|
+
process.exitCode = await runTrainingBrokerEntrypoint({ argv: process.argv.slice(2) });
|
|
10
|
+
};
|
|
11
|
+
main().catch((error) => {
|
|
12
|
+
process.stderr.write(`[training-entrypoint] ${error instanceof Error ? error.message : String(error)}\n`);
|
|
13
|
+
process.exitCode = 1;
|
|
14
|
+
});
|