spawnfile 0.1.13 → 0.1.14
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 +50 -11
- package/dist/audit/auditCli.d.ts +19 -0
- package/dist/audit/auditCli.js +63 -0
- package/dist/audit/checks.d.ts +100 -0
- package/dist/audit/checks.js +279 -0
- package/dist/audit/checksShared.d.ts +74 -0
- package/dist/audit/checksShared.js +37 -0
- package/dist/audit/generateAudit.d.ts +19 -0
- package/dist/audit/generateAudit.js +122 -0
- package/dist/audit/index.d.ts +4 -0
- package/dist/audit/index.js +4 -0
- package/dist/audit/readAudit.d.ts +50 -0
- package/dist/audit/readAudit.js +59 -0
- package/dist/audit/types.d.ts +40 -0
- package/dist/audit/types.js +8 -0
- package/dist/auth/credentialEnvFile.d.ts +11 -0
- package/dist/auth/credentialEnvFile.js +60 -0
- package/dist/auth/credentialProvisioning.d.ts +15 -0
- package/dist/auth/credentialProvisioning.js +75 -0
- package/dist/auth/credentialProvisioningReceipt.d.ts +28 -0
- package/dist/auth/credentialProvisioningReceipt.js +70 -0
- package/dist/auth/credentialProvisioningRequest.d.ts +51 -0
- package/dist/auth/credentialProvisioningRequest.js +169 -0
- package/dist/auth/credentialWorldBindings.d.ts +21 -0
- package/dist/auth/credentialWorldBindings.js +104 -0
- package/dist/auth/index.d.ts +7 -0
- package/dist/auth/index.js +7 -0
- package/dist/auth/paths.d.ts +11 -0
- package/dist/auth/paths.js +21 -0
- package/dist/auth/targetSecretSourceAuthor.d.ts +18 -0
- package/dist/auth/targetSecretSourceAuthor.js +52 -0
- package/dist/auth/targetSecretSourceFsPublish.d.ts +15 -0
- package/dist/auth/targetSecretSourceFsPublish.js +49 -0
- package/dist/auth/targetSecretSourceFsPublishImmutable.d.ts +16 -0
- package/dist/auth/targetSecretSourceFsPublishImmutable.js +435 -0
- package/dist/auth/targetSecretSourceFsRead.d.ts +14 -0
- package/dist/auth/targetSecretSourceFsRead.js +198 -0
- package/dist/auth/targetSecretSourceGrant.d.ts +16 -0
- package/dist/auth/targetSecretSourceGrant.js +99 -0
- package/dist/auth/targetSecretSourceGrantRecords.d.ts +84 -0
- package/dist/auth/targetSecretSourceGrantRecords.js +214 -0
- package/dist/auth/targetSecretSourceLifecycle.d.ts +30 -0
- package/dist/auth/targetSecretSourceLifecycle.js +52 -0
- package/dist/auth/targetSecretSourceOwnerEntropy.d.ts +6 -0
- package/dist/auth/targetSecretSourceOwnerEntropy.js +28 -0
- package/dist/auth/targetSecretSourceRecordCommon.d.ts +14 -0
- package/dist/auth/targetSecretSourceRecordCommon.js +100 -0
- package/dist/auth/targetSecretSourceRecordPublish.d.ts +10 -0
- package/dist/auth/targetSecretSourceRecordPublish.js +104 -0
- package/dist/auth/targetSecretSourceResolver.d.ts +10 -0
- package/dist/auth/targetSecretSourceResolver.js +137 -0
- package/dist/auth/targetSecretSourceRevoke.d.ts +20 -0
- package/dist/auth/targetSecretSourceRevoke.js +92 -0
- package/dist/auth/targetSecretSourceRotate.d.ts +19 -0
- package/dist/auth/targetSecretSourceRotate.js +121 -0
- package/dist/auth/targetSecretSourceVersionRecords.d.ts +49 -0
- package/dist/auth/targetSecretSourceVersionRecords.js +166 -0
- package/dist/cli/artifactsCommands.d.ts +27 -0
- package/dist/cli/artifactsCommands.js +132 -0
- package/dist/cli/authCommands.d.ts +5 -0
- package/dist/cli/authCommands.js +221 -0
- package/dist/cli/compileBuildCommands.d.ts +3 -0
- package/dist/cli/compileBuildCommands.js +35 -0
- package/dist/cli/containerBundleCommand.d.ts +6 -0
- package/dist/cli/containerBundleCommand.js +116 -0
- package/dist/cli/downCommand.d.ts +25 -0
- package/dist/cli/downCommand.js +134 -0
- package/dist/cli/index.js +6 -3
- package/dist/cli/lifecycleCommands.d.ts +1 -1
- package/dist/cli/lifecycleCommands.js +11 -181
- package/dist/cli/lifecycleMachine.d.ts +19 -0
- package/dist/cli/lifecycleMachine.js +78 -0
- package/dist/cli/lifecyclePlan.d.ts +35 -0
- package/dist/cli/lifecyclePlan.js +240 -0
- package/dist/cli/lifecyclePlanningCommands.d.ts +3 -0
- package/dist/cli/lifecyclePlanningCommands.js +30 -0
- package/dist/cli/runCli.d.ts +9 -2
- package/dist/cli/runCli.js +27 -71
- package/dist/cli/runPublishCommands.d.ts +3 -0
- package/dist/cli/runPublishCommands.js +70 -0
- package/dist/cli/statusCommand.d.ts +3 -33
- package/dist/cli/statusCommand.js +19 -249
- package/dist/cli/statusCommandLive.d.ts +20 -0
- package/dist/cli/statusCommandLive.js +188 -0
- package/dist/cli/statusCommandOptions.d.ts +40 -0
- package/dist/cli/statusCommandOptions.js +42 -0
- package/dist/cli/targetCliRoute.d.ts +2 -0
- package/dist/cli/targetCliRoute.js +30 -0
- package/dist/cli/targetCommands.d.ts +33 -0
- package/dist/cli/targetCommands.js +257 -0
- package/dist/cli/targetComposedPreparationCommand.d.ts +6 -0
- package/dist/cli/targetComposedPreparationCommand.js +39 -0
- package/dist/cli/targetDefaultArtifactAuthority.d.ts +5 -0
- package/dist/cli/targetDefaultArtifactAuthority.js +28 -0
- package/dist/cli/targetDefaultAuthorities.d.ts +53 -0
- package/dist/cli/targetDefaultAuthorities.js +210 -0
- package/dist/cli/targetDefaultConfig.d.ts +68 -0
- package/dist/cli/targetDefaultConfig.js +317 -0
- package/dist/cli/targetDefaultConfigStdin.d.ts +13 -0
- package/dist/cli/targetDefaultConfigStdin.js +215 -0
- package/dist/cli/targetDefaultEnvelope.d.ts +1 -0
- package/dist/cli/targetDefaultEnvelope.js +13 -0
- package/dist/cli/targetDefaultHandlerFactory.d.ts +28 -0
- package/dist/cli/targetDefaultHandlerFactory.js +247 -0
- package/dist/cli/targetDefaultHandlers.d.ts +21 -0
- package/dist/cli/targetDefaultHandlers.js +72 -0
- package/dist/cli/targetDefaultJournalAuthority.d.ts +35 -0
- package/dist/cli/targetDefaultJournalAuthority.js +135 -0
- package/dist/cli/targetDefaultWorldClock.d.ts +4 -0
- package/dist/cli/targetDefaultWorldClock.js +14 -0
- package/dist/cli/targetDefaultWorldQueries.d.ts +5 -0
- package/dist/cli/targetDefaultWorldQueries.js +11 -0
- package/dist/cli/targetDefaultWorldReadiness.d.ts +4 -0
- package/dist/cli/targetDefaultWorldReadiness.js +17 -0
- package/dist/cli/targetEvidenceHelperResolution.d.ts +14 -0
- package/dist/cli/targetEvidenceHelperResolution.js +23 -0
- package/dist/cli/targetLookupCli.d.ts +3 -0
- package/dist/cli/targetLookupCli.js +31 -0
- package/dist/cli/targetLookupCommands.d.ts +12 -0
- package/dist/cli/targetLookupCommands.js +69 -0
- package/dist/cli/targetOperationDispatch.d.ts +58 -0
- package/dist/cli/targetOperationDispatch.js +21 -0
- package/dist/cli/targetReceiptOutput.d.ts +14 -0
- package/dist/cli/targetReceiptOutput.js +21 -0
- package/dist/cli/targetRequestFile.d.ts +14 -0
- package/dist/cli/targetRequestFile.js +63 -0
- package/dist/cli/targetSecretSourceInput.d.ts +28 -0
- package/dist/cli/targetSecretSourceInput.js +121 -0
- package/dist/cli/targetWorldClockCommand.d.ts +10 -0
- package/dist/cli/targetWorldClockCommand.js +42 -0
- package/dist/cli/targetWorldClockCrossProcess.test-helper.d.ts +13 -0
- package/dist/cli/targetWorldClockCrossProcess.test-helper.js +109 -0
- package/dist/cli/targetWorldReadinessCommand.d.ts +10 -0
- package/dist/cli/targetWorldReadinessCommand.js +43 -0
- package/dist/cli/upCommand.d.ts +3 -0
- package/dist/cli/upCommand.js +133 -0
- package/dist/cli/upImageCommand.d.ts +11 -0
- package/dist/cli/upImageCommand.js +41 -0
- package/dist/cli/upLifecycleInvocation.d.ts +41 -0
- package/dist/cli/upLifecycleInvocation.js +48 -0
- package/dist/cli/upLifecycleRecovery.d.ts +4 -0
- package/dist/cli/upLifecycleRecovery.js +53 -0
- package/dist/compiler/agentNodeMerge.d.ts +2 -0
- package/dist/compiler/agentNodeMerge.js +79 -0
- package/dist/compiler/agentSurfaces.js +11 -1
- package/dist/compiler/buildCompilePlan.js +17 -0
- package/dist/compiler/buildCompilePlanAgent.d.ts +11 -0
- package/dist/compiler/buildCompilePlanAgent.js +56 -0
- package/dist/compiler/buildCompilePlanTeams.d.ts +1 -0
- package/dist/compiler/buildCompilePlanTeams.js +4 -1
- package/dist/compiler/buildCompilePlanTraversal.js +75 -82
- package/dist/compiler/buildProject.d.ts +11 -0
- package/dist/compiler/buildProject.js +77 -2
- package/dist/compiler/compilePlanHelpers.js +2 -0
- package/dist/compiler/compileProject.d.ts +13 -0
- package/dist/compiler/compileProject.js +26 -74
- package/dist/compiler/compileProjectPolicy.d.ts +5 -0
- package/dist/compiler/compileProjectPolicy.js +21 -0
- package/dist/compiler/compileProjectReports.d.ts +9 -0
- package/dist/compiler/compileProjectReports.js +52 -0
- package/dist/compiler/containerArtifactSummaries.d.ts +7 -0
- package/dist/compiler/containerArtifactSummaries.js +138 -0
- package/dist/compiler/containerArtifacts.d.ts +10 -0
- package/dist/compiler/containerArtifacts.js +126 -125
- package/dist/compiler/containerArtifactsPlans.d.ts +5 -3
- package/dist/compiler/containerArtifactsPlans.js +31 -118
- package/dist/compiler/containerArtifactsRender.d.ts +3 -1
- package/dist/compiler/containerArtifactsRender.js +15 -12
- package/dist/compiler/containerArtifactsTypes.d.ts +12 -0
- package/dist/compiler/containerConfigEnvRender.d.ts +3 -0
- package/dist/compiler/containerConfigEnvRender.js +54 -0
- package/dist/compiler/containerEntrypointRender.d.ts +1 -0
- package/dist/compiler/containerEntrypointRender.js +56 -52
- package/dist/compiler/containerEntrypointShell.d.ts +5 -0
- package/dist/compiler/containerEntrypointShell.js +29 -0
- package/dist/compiler/containerPackageOverrides.d.ts +27 -0
- package/dist/compiler/containerPackageOverrides.js +63 -0
- package/dist/compiler/containerTargetPlanResolution.d.ts +20 -0
- package/dist/compiler/containerTargetPlanResolution.js +97 -0
- package/dist/compiler/daimonTelemetryArtifacts.d.ts +22 -0
- package/dist/compiler/daimonTelemetryArtifacts.js +61 -0
- package/dist/compiler/dockerBuildContext.d.ts +16 -0
- package/dist/compiler/dockerBuildContext.js +159 -0
- package/dist/compiler/dockerBuildSkip.d.ts +30 -0
- package/dist/compiler/dockerBuildSkip.js +81 -0
- package/dist/compiler/index.d.ts +4 -0
- package/dist/compiler/index.js +4 -0
- package/dist/compiler/memoryArtifacts.d.ts +26 -0
- package/dist/compiler/memoryArtifacts.js +134 -0
- package/dist/compiler/memoryResolution.d.ts +4 -0
- package/dist/compiler/memoryResolution.js +147 -0
- package/dist/compiler/modelEnv.d.ts +2 -0
- package/dist/compiler/modelEnv.js +6 -0
- package/dist/compiler/moltnetAllowedWakeSendersValidation.d.ts +2 -0
- package/dist/compiler/moltnetAllowedWakeSendersValidation.js +42 -0
- package/dist/compiler/moltnetArtifactPaths.d.ts +26 -0
- package/dist/compiler/moltnetArtifactPaths.js +49 -0
- package/dist/compiler/moltnetArtifactTypes.d.ts +46 -0
- package/dist/compiler/moltnetArtifactTypes.js +1 -0
- package/dist/compiler/moltnetArtifacts.d.ts +2 -40
- package/dist/compiler/moltnetArtifacts.js +43 -97
- package/dist/compiler/moltnetBinaries.d.ts +21 -4
- package/dist/compiler/moltnetBinaries.js +134 -27
- package/dist/compiler/moltnetClientConfig.js +7 -2
- package/dist/compiler/moltnetConfigLowering.d.ts +16 -1
- package/dist/compiler/moltnetConfigLowering.js +67 -5
- package/dist/compiler/moltnetExternalParticipantArtifact.d.ts +38 -0
- package/dist/compiler/moltnetExternalParticipantArtifact.js +188 -0
- package/dist/compiler/moltnetNodeConfig.js +7 -2
- package/dist/compiler/moltnetReleaseAuthority.d.ts +17 -0
- package/dist/compiler/moltnetReleaseAuthority.js +73 -0
- package/dist/compiler/moltnetReleaseDownload.d.ts +12 -0
- package/dist/compiler/moltnetReleaseDownload.js +85 -0
- package/dist/compiler/moltnetRepresentativeResolution.d.ts +1 -0
- package/dist/compiler/moltnetRepresentativeResolution.js +16 -2
- package/dist/compiler/moltnetResolution.js +72 -20
- package/dist/compiler/moltnetRoomMemberships.js +37 -9
- package/dist/compiler/moltnetServerPlans.d.ts +9 -0
- package/dist/compiler/moltnetServerPlans.js +132 -0
- package/dist/compiler/organizationIdentity.d.ts +27 -0
- package/dist/compiler/organizationIdentity.js +297 -0
- package/dist/compiler/organizationReadyEvidence.d.ts +49 -0
- package/dist/compiler/organizationReadyEvidence.js +261 -0
- package/dist/compiler/projectManifestGraph.d.ts +4 -0
- package/dist/compiler/projectManifestGraph.js +24 -0
- package/dist/compiler/runProject.d.ts +4 -0
- package/dist/compiler/runProject.js +30 -21
- package/dist/compiler/runProjectAuth.d.ts +7 -1
- package/dist/compiler/runProjectAuth.js +87 -9
- package/dist/compiler/runProjectDocker.d.ts +7 -0
- package/dist/compiler/runProjectDocker.js +31 -8
- package/dist/compiler/runProjectLifecycle.d.ts +7 -0
- package/dist/compiler/runProjectLifecycle.js +40 -0
- package/dist/compiler/syncProjectAuth.js +4 -1
- package/dist/compiler/teamContextActiveEnvironments.d.ts +13 -0
- package/dist/compiler/teamContextActiveEnvironments.js +255 -0
- package/dist/compiler/teamContextSupport.js +32 -40
- package/dist/compiler/teamContextTypes.d.ts +2 -0
- package/dist/compiler/types.d.ts +82 -1
- package/dist/compiler/upProject.d.ts +5 -0
- package/dist/compiler/upProject.js +256 -20
- package/dist/compiler/upReceipt.d.ts +36 -0
- package/dist/compiler/upReceipt.js +82 -0
- package/dist/compiler/updateProjectModels.js +42 -60
- package/dist/compiler/updateProjectRuntime.js +22 -35
- package/dist/compiler/updateProjectSurfaces.js +53 -47
- package/dist/compiler/worldBindings.d.ts +39 -0
- package/dist/compiler/worldBindings.js +247 -0
- package/dist/compiler/worldBindingsFile.d.ts +5 -0
- package/dist/compiler/worldBindingsFile.js +162 -0
- package/dist/deployment/artifactsExport.d.ts +49 -0
- package/dist/deployment/artifactsExport.js +217 -0
- package/dist/deployment/artifactsExportDocker.d.ts +48 -0
- package/dist/deployment/artifactsExportDocker.js +91 -0
- package/dist/deployment/artifactsExportPlan.d.ts +24 -0
- package/dist/deployment/artifactsExportPlan.js +135 -0
- package/dist/deployment/artifactsExportTypes.d.ts +50 -0
- package/dist/deployment/artifactsExportTypes.js +52 -0
- package/dist/deployment/buildImageCacheStore.d.ts +23 -0
- package/dist/deployment/buildImageCacheStore.js +54 -0
- package/dist/deployment/deploymentLifecycleCorrelation.d.ts +11 -0
- package/dist/deployment/deploymentLifecycleCorrelation.js +33 -0
- package/dist/deployment/dockerInspect.d.ts +9 -0
- package/dist/deployment/dockerInspect.js +24 -1
- package/dist/deployment/dockerLabels.d.ts +2 -0
- package/dist/deployment/dockerLabels.js +2 -0
- package/dist/deployment/dockerLogs.js +2 -10
- package/dist/deployment/dockerManager.d.ts +51 -0
- package/dist/deployment/dockerManager.js +118 -1
- package/dist/deployment/dockerProbeGateway.js +64 -5
- package/dist/deployment/dockerRecover.js +9 -1
- package/dist/deployment/dockerTeardown.d.ts +32 -0
- package/dist/deployment/dockerTeardown.js +61 -0
- package/dist/deployment/downDeployment.d.ts +34 -0
- package/dist/deployment/downDeployment.js +147 -0
- package/dist/deployment/downReceiptTypes.d.ts +21 -0
- package/dist/deployment/downReceiptTypes.js +30 -0
- package/dist/deployment/index.d.ts +16 -0
- package/dist/deployment/index.js +17 -0
- package/dist/deployment/lifecycleCompletion.d.ts +37 -0
- package/dist/deployment/lifecycleCompletion.js +236 -0
- package/dist/deployment/lifecycleCompletionContracts.d.ts +158 -0
- package/dist/deployment/lifecycleCompletionContracts.js +106 -0
- package/dist/deployment/lifecycleCompletionHeartbeat.d.ts +2 -0
- package/dist/deployment/lifecycleCompletionHeartbeat.js +50 -0
- package/dist/deployment/lifecycleCompletionLookup.d.ts +18 -0
- package/dist/deployment/lifecycleCompletionLookup.js +88 -0
- package/dist/deployment/lifecycleCompletionOwner.d.ts +8 -0
- package/dist/deployment/lifecycleCompletionOwner.js +31 -0
- package/dist/deployment/lifecycleCompletionParsing.d.ts +12 -0
- package/dist/deployment/lifecycleCompletionParsing.js +108 -0
- package/dist/deployment/lifecycleCompletionPaths.d.ts +9 -0
- package/dist/deployment/lifecycleCompletionPaths.js +16 -0
- package/dist/deployment/lifecycleCompletionPublication.d.ts +5 -0
- package/dist/deployment/lifecycleCompletionPublication.js +35 -0
- package/dist/deployment/lifecycleCompletionRecovery.d.ts +21 -0
- package/dist/deployment/lifecycleCompletionRecovery.js +56 -0
- package/dist/deployment/lifecycleCompletionRoot.d.ts +21 -0
- package/dist/deployment/lifecycleCompletionRoot.js +243 -0
- package/dist/deployment/lifecycleCompletionStore.d.ts +6 -0
- package/dist/deployment/lifecycleCompletionStore.js +151 -0
- package/dist/deployment/organizationHandoffAuthorityFsClient.d.ts +17 -0
- package/dist/deployment/organizationHandoffAuthorityFsClient.js +132 -0
- package/dist/deployment/organizationHandoffAuthorityFsWorker.d.ts +1 -0
- package/dist/deployment/organizationHandoffAuthorityFsWorker.js +285 -0
- package/dist/deployment/organizationHandoffAuthorityFsWorkerParent.fixture.d.ts +1 -0
- package/dist/deployment/organizationHandoffAuthorityFsWorkerParent.fixture.js +26 -0
- package/dist/deployment/organizationHandoffAuthorityStore.d.ts +41 -0
- package/dist/deployment/organizationHandoffAuthorityStore.js +348 -0
- package/dist/deployment/organizationHandoffAuthorityTypes.d.ts +76 -0
- package/dist/deployment/organizationHandoffAuthorityTypes.js +148 -0
- package/dist/deployment/organizationHandoffTypes.d.ts +29 -0
- package/dist/deployment/organizationHandoffTypes.js +80 -0
- package/dist/deployment/organizationReady.d.ts +52 -0
- package/dist/deployment/organizationReady.js +200 -0
- package/dist/deployment/privateArtifactsExport.d.ts +18 -0
- package/dist/deployment/privateArtifactsExport.js +80 -0
- package/dist/deployment/providerRuntimeBoundaryScanner.test-helper.d.ts +8 -0
- package/dist/deployment/providerRuntimeBoundaryScanner.test-helper.js +60 -0
- package/dist/deployment/record.d.ts +26 -1
- package/dist/deployment/record.js +49 -4
- package/dist/deployment/simfileFixtureBoundary.test-helper.d.ts +8 -0
- package/dist/deployment/simfileFixtureBoundary.test-helper.js +103 -0
- package/dist/deployment/target.d.ts +1 -35
- package/dist/deployment/target.js +1 -96
- package/dist/deployment/upReceiptTypes.d.ts +111 -0
- package/dist/deployment/upReceiptTypes.js +164 -0
- package/dist/dev/project.js +15 -9
- package/dist/distribution/buildDistributionReport.d.ts +2 -1
- package/dist/distribution/buildDistributionReport.js +2 -1
- package/dist/distribution/distributionReportSchema.d.ts +5 -0
- package/dist/distribution/distributionReportSchema.js +7 -2
- package/dist/distribution/index.d.ts +2 -2
- package/dist/distribution/index.js +1 -1
- package/dist/distribution/types.d.ts +7 -0
- package/dist/distribution/types.js +1 -0
- package/dist/filesystem/paths.js +10 -1
- package/dist/ledger/causalConformanceCli.d.ts +1 -0
- package/dist/ledger/causalConformanceCli.js +41 -0
- package/dist/ledger/causeNamespace.d.ts +8 -0
- package/dist/ledger/causeNamespace.js +24 -0
- package/dist/ledger/conformance.d.ts +83 -0
- package/dist/ledger/conformance.js +259 -0
- package/dist/ledger/emitters.d.ts +76 -0
- package/dist/ledger/emitters.js +188 -0
- package/dist/ledger/index.d.ts +4 -0
- package/dist/ledger/index.js +4 -0
- package/dist/ledger/principal.d.ts +96 -0
- package/dist/ledger/principal.js +121 -0
- package/dist/manifest/externalParticipantSchemas.d.ts +18 -0
- package/dist/manifest/externalParticipantSchemas.js +17 -0
- package/dist/manifest/index.d.ts +1 -0
- package/dist/manifest/index.js +1 -0
- package/dist/manifest/inlineAgentMember.d.ts +2 -0
- package/dist/manifest/inlineAgentMember.js +9 -0
- package/dist/manifest/loadManifest.js +14 -8
- package/dist/manifest/mcpSchemas.d.ts +17 -0
- package/dist/manifest/mcpSchemas.js +41 -0
- package/dist/manifest/memorySchemas.d.ts +245 -0
- package/dist/manifest/memorySchemas.js +148 -0
- package/dist/manifest/renderSpawnfile.js +22 -131
- package/dist/manifest/renderSpawnfileNetworks.js +9 -2
- package/dist/manifest/renderSpawnfileSurfaces.d.ts +2 -0
- package/dist/manifest/renderSpawnfileSurfaces.js +134 -0
- package/dist/manifest/schemas.d.ts +1868 -99
- package/dist/manifest/schemas.js +78 -32
- package/dist/manifest/surfaceSchemas.d.ts +17 -0
- package/dist/manifest/surfaceSchemas.js +24 -1
- package/dist/manifest/teamNetworkAccessSchemas.d.ts +1 -1
- package/dist/manifest/teamNetworkAuthSchemas.d.ts +48 -0
- package/dist/manifest/teamNetworkAuthSchemas.js +103 -0
- package/dist/manifest/teamNetworkSchemas.d.ts +8 -187
- package/dist/manifest/teamNetworkSchemas.js +3 -317
- package/dist/manifest/teamNetworkServerSchemas.d.ts +150 -0
- package/dist/manifest/teamNetworkServerSchemas.js +199 -0
- package/dist/ownership/siblingBuildFreshness.d.ts +20 -0
- package/dist/ownership/siblingBuildFreshness.js +20 -0
- package/dist/ownership/simfileRunOperatorInputs.d.ts +103 -0
- package/dist/ownership/simfileRunOperatorInputs.js +139 -0
- package/dist/report/types.d.ts +142 -0
- package/dist/runtime/common.d.ts +35 -0
- package/dist/runtime/common.js +55 -0
- package/dist/runtime/container.d.ts +28 -1
- package/dist/runtime/container.js +38 -5
- package/dist/runtime/containerPackageOverrides.d.ts +37 -0
- package/dist/runtime/containerPackageOverrides.js +33 -0
- package/dist/runtime/index.d.ts +2 -0
- package/dist/runtime/index.js +2 -0
- package/dist/runtime/mnemeMcp.d.ts +15 -0
- package/dist/runtime/mnemeMcp.js +109 -0
- package/dist/runtime/openclaw/adapter.js +15 -4
- package/dist/runtime/openclaw/mcp.d.ts +10 -0
- package/dist/runtime/openclaw/mcp.js +69 -0
- package/dist/runtime/openclaw/runAuth.js +2 -2
- package/dist/runtime/openclaw/scaffold.js +1 -1
- package/dist/runtime/openclaw/schedules.d.ts +38 -0
- package/dist/runtime/openclaw/schedules.js +74 -0
- package/dist/runtime/pi/adapter.d.ts +1 -1
- package/dist/runtime/pi/adapter.js +86 -53
- package/dist/runtime/pi/appActivitySource.js +114 -2
- package/dist/runtime/pi/appAgentConfig.d.ts +11 -0
- package/dist/runtime/pi/appAgentConfig.js +264 -0
- package/dist/runtime/pi/appCliEnginesSource.d.ts +1 -0
- package/dist/runtime/pi/appCliEnginesSource.js +183 -0
- package/dist/runtime/pi/appCliSource.d.ts +1 -0
- package/dist/runtime/pi/appCliSource.js +353 -0
- package/dist/runtime/pi/appControlSource.d.ts +1 -0
- package/dist/runtime/pi/appControlSource.js +390 -0
- package/dist/runtime/pi/appControlWakeIdentitySource.d.ts +1 -0
- package/dist/runtime/pi/appControlWakeIdentitySource.js +19 -0
- package/dist/runtime/pi/appCoreSource.d.ts +4 -1
- package/dist/runtime/pi/appCoreSource.js +104 -214
- package/dist/runtime/pi/appPreludeSource.js +140 -52
- package/dist/runtime/pi/appScheduleSource.d.ts +1 -0
- package/dist/runtime/pi/appScheduleSource.js +80 -0
- package/dist/runtime/pi/appScriptedEngine.d.ts +31 -0
- package/dist/runtime/pi/appScriptedEngine.js +42 -0
- package/dist/runtime/pi/appSource.d.ts +4 -1
- package/dist/runtime/pi/appSource.js +6 -2
- package/dist/runtime/pi/appTemplate.d.ts +8 -22
- package/dist/runtime/pi/appTemplate.js +9 -126
- package/dist/runtime/pi/appTemplateTypes.d.ts +64 -0
- package/dist/runtime/pi/appTemplateTypes.js +18 -0
- package/dist/runtime/pi/appWakeContextSource.d.ts +1 -0
- package/dist/runtime/pi/appWakeContextSource.js +398 -0
- package/dist/runtime/pi/containerTargets.d.ts +4 -0
- package/dist/runtime/pi/containerTargets.js +57 -0
- package/dist/runtime/pi/runAuth.js +126 -9
- package/dist/runtime/pi/testHelpers.d.ts +2 -0
- package/dist/runtime/pi/testHelpers.js +40 -0
- package/dist/runtime/picoclaw/adapter.js +23 -27
- package/dist/runtime/picoclaw/mcp.d.ts +4 -0
- package/dist/runtime/picoclaw/mcp.js +43 -0
- package/dist/runtime/picoclaw/memory.d.ts +7 -0
- package/dist/runtime/picoclaw/memory.js +17 -0
- package/dist/runtime/picoclaw/runAuth.js +1 -1
- package/dist/runtime/picoclaw/scaffold.js +1 -1
- package/dist/runtime/picoclaw/schedules.d.ts +26 -0
- package/dist/runtime/picoclaw/schedules.js +62 -3
- package/dist/runtime/scheduleUtils.d.ts +2 -0
- package/dist/runtime/scheduleUtils.js +15 -0
- package/dist/runtime/types.d.ts +25 -2
- package/dist/shared/errors.d.ts +1 -1
- package/dist/shared/errors.js +2 -2
- package/dist/shared/index.d.ts +1 -0
- package/dist/shared/index.js +1 -0
- package/dist/shared/redaction.d.ts +2 -0
- package/dist/shared/redaction.js +10 -0
- package/dist/status/buildStatus.d.ts +1 -0
- package/dist/status/buildStatus.js +2 -0
- package/dist/status/compileReport.d.ts +22 -0
- package/dist/status/compileReport.js +16 -2
- package/dist/status/compiledProbeCollection.d.ts +21 -0
- package/dist/status/compiledProbeCollection.js +27 -0
- package/dist/status/imageStatusReport.js +6 -0
- package/dist/status/index.d.ts +3 -0
- package/dist/status/index.js +3 -0
- package/dist/status/lifecycleProbes.d.ts +19 -0
- package/dist/status/lifecycleProbes.js +174 -0
- package/dist/status/moltnetProbes.d.ts +7 -8
- package/dist/status/moltnetProbes.js +27 -198
- package/dist/status/moltnetWiringProbes.d.ts +19 -0
- package/dist/status/moltnetWiringProbes.js +178 -0
- package/dist/target/cleanupRun.d.ts +41 -0
- package/dist/target/cleanupRun.js +139 -0
- package/dist/target/cleanupRunDocker.d.ts +16 -0
- package/dist/target/cleanupRunDocker.js +66 -0
- package/dist/target/cleanupRunDocker.test-helper.d.ts +67 -0
- package/dist/target/cleanupRunDocker.test-helper.js +238 -0
- package/dist/target/cleanupRunDockerPreflight.d.ts +17 -0
- package/dist/target/cleanupRunDockerPreflight.js +224 -0
- package/dist/target/composedPreparation.d.ts +205 -0
- package/dist/target/composedPreparation.js +223 -0
- package/dist/target/containerBundle.d.ts +82 -0
- package/dist/target/containerBundle.js +243 -0
- package/dist/target/containerBundleArchive.d.ts +31 -0
- package/dist/target/containerBundleArchive.js +140 -0
- package/dist/target/containerBundleAuthority.d.ts +25 -0
- package/dist/target/containerBundleAuthority.js +65 -0
- package/dist/target/containerBundleContracts.d.ts +114 -0
- package/dist/target/containerBundleContracts.js +173 -0
- package/dist/target/containerBundleFilesystemStore.d.ts +3 -0
- package/dist/target/containerBundleFilesystemStore.js +247 -0
- package/dist/target/containerBundlePolicy.d.ts +33 -0
- package/dist/target/containerBundlePolicy.js +64 -0
- package/dist/target/containerBundleStore.d.ts +127 -0
- package/dist/target/containerBundleStore.js +284 -0
- package/dist/target/contracts.d.ts +538 -0
- package/dist/target/contracts.js +373 -0
- package/dist/target/dockerArtifactIdentityTypes.d.ts +56 -0
- package/dist/target/dockerArtifactIdentityTypes.js +1 -0
- package/dist/target/dockerArtifactInspection.d.ts +40 -0
- package/dist/target/dockerArtifactInspection.js +125 -0
- package/dist/target/dockerArtifacts.d.ts +21 -0
- package/dist/target/dockerArtifacts.js +110 -0
- package/dist/target/dockerArtifactsProvider.d.ts +41 -0
- package/dist/target/dockerArtifactsProvider.js +449 -0
- package/dist/target/dockerCommandExecutor.d.ts +27 -0
- package/dist/target/dockerCommandExecutor.js +200 -0
- package/dist/target/dockerCommandExecutorCore.d.ts +34 -0
- package/dist/target/dockerCommandExecutorCore.js +273 -0
- package/dist/target/dockerContainerBundleBuilder.d.ts +8 -0
- package/dist/target/dockerContainerBundleBuilder.js +256 -0
- package/dist/target/dockerContextSnapshot.d.ts +21 -0
- package/dist/target/dockerContextSnapshot.js +158 -0
- package/dist/target/dockerEndpointFingerprint.d.ts +1 -0
- package/dist/target/dockerEndpointFingerprint.js +9 -0
- package/dist/target/dockerPreparedArtifact.d.ts +48 -0
- package/dist/target/dockerPreparedArtifact.js +131 -0
- package/dist/target/dockerProjectionJson.d.ts +1 -0
- package/dist/target/dockerProjectionJson.js +80 -0
- package/dist/target/dockerPublicArtifactSnapshot.d.ts +17 -0
- package/dist/target/dockerPublicArtifactSnapshot.js +99 -0
- package/dist/target/dockerResources.d.ts +26 -0
- package/dist/target/dockerResources.js +162 -0
- package/dist/target/dockerResourcesProvider.d.ts +44 -0
- package/dist/target/dockerResourcesProvider.js +207 -0
- package/dist/target/dockerSecrets.d.ts +39 -0
- package/dist/target/dockerSecrets.js +249 -0
- package/dist/target/dockerSecretsAuthority.d.ts +26 -0
- package/dist/target/dockerSecretsAuthority.js +216 -0
- package/dist/target/dockerSecretsLifecycle.d.ts +25 -0
- package/dist/target/dockerSecretsLifecycle.js +133 -0
- package/dist/target/dockerSecretsProvider.d.ts +68 -0
- package/dist/target/dockerSecretsProvider.js +329 -0
- package/dist/target/dockerTarget.d.ts +52 -0
- package/dist/target/dockerTarget.js +48 -0
- package/dist/target/dockerTargetBinding.d.ts +14 -0
- package/dist/target/dockerTargetBinding.js +96 -0
- package/dist/target/dockerWorldClock.d.ts +17 -0
- package/dist/target/dockerWorldClock.js +111 -0
- package/dist/target/dockerWorldReadiness.d.ts +17 -0
- package/dist/target/dockerWorldReadiness.js +119 -0
- package/dist/target/dockerWorldService.d.ts +23 -0
- package/dist/target/dockerWorldService.js +216 -0
- package/dist/target/dockerWorldServiceAuthority.d.ts +80 -0
- package/dist/target/dockerWorldServiceAuthority.js +182 -0
- package/dist/target/dockerWorldServiceLifecycle.d.ts +41 -0
- package/dist/target/dockerWorldServiceLifecycle.js +275 -0
- package/dist/target/dockerWorldServiceProvider.d.ts +60 -0
- package/dist/target/dockerWorldServiceProvider.js +318 -0
- package/dist/target/dockerWorldServiceStore.d.ts +73 -0
- package/dist/target/dockerWorldServiceStore.js +367 -0
- package/dist/target/evidenceExport.d.ts +55 -0
- package/dist/target/evidenceExport.js +518 -0
- package/dist/target/evidenceExportArchive.d.ts +10 -0
- package/dist/target/evidenceExportArchive.js +302 -0
- package/dist/target/evidenceExportContract.d.ts +27 -0
- package/dist/target/evidenceExportContract.js +40 -0
- package/dist/target/evidenceExportOperationsTestKit.d.ts +87 -0
- package/dist/target/evidenceExportOperationsTestKit.js +312 -0
- package/dist/target/evidenceExportProvider.d.ts +85 -0
- package/dist/target/evidenceExportProvider.js +187 -0
- package/dist/target/evidenceExportPublicationTypes.d.ts +16 -0
- package/dist/target/evidenceExportPublicationTypes.js +1 -0
- package/dist/target/evidenceExportStore.d.ts +70 -0
- package/dist/target/evidenceExportStore.js +498 -0
- package/dist/target/evidenceExportStorePublication.d.ts +7 -0
- package/dist/target/evidenceExportStorePublication.js +395 -0
- package/dist/target/handles.d.ts +20 -0
- package/dist/target/handles.js +56 -0
- package/dist/target/index.d.ts +12 -0
- package/dist/target/index.js +11 -0
- package/dist/target/journal.d.ts +59 -0
- package/dist/target/journal.js +529 -0
- package/dist/target/journalFilesystem.d.ts +3 -0
- package/dist/target/journalFilesystem.js +111 -0
- package/dist/target/journalRoot.d.ts +4 -0
- package/dist/target/journalRoot.js +6 -0
- package/dist/target/organizationAttachment.d.ts +23 -0
- package/dist/target/organizationAttachment.js +263 -0
- package/dist/target/organizationAttachmentAuthority.d.ts +65 -0
- package/dist/target/organizationAttachmentAuthority.js +161 -0
- package/dist/target/organizationAttachmentLifecycle.d.ts +17 -0
- package/dist/target/organizationAttachmentLifecycle.js +101 -0
- package/dist/target/organizationAttachmentProvider.d.ts +76 -0
- package/dist/target/organizationAttachmentProvider.js +289 -0
- package/dist/target/organizationAttachmentStore.d.ts +51 -0
- package/dist/target/organizationAttachmentStore.js +316 -0
- package/dist/target/publicArtifactSnapshot.d.ts +41 -0
- package/dist/target/publicArtifactSnapshot.js +150 -0
- package/dist/target/topologyActivation.d.ts +51 -0
- package/dist/target/topologyActivation.js +149 -0
- package/dist/target/topologyAttestation.d.ts +37 -0
- package/dist/target/topologyAttestation.js +300 -0
- package/dist/target/topologyAttestationErrors.d.ts +1 -0
- package/dist/target/topologyAttestationErrors.js +1 -0
- package/dist/target/worldClock.d.ts +60 -0
- package/dist/target/worldClock.js +129 -0
- package/dist/target/worldReadiness.d.ts +103 -0
- package/dist/target/worldReadiness.js +153 -0
- package/moltnet-releases.json +20 -0
- package/package.json +27 -11
- package/runtimes.yaml +8 -23
- package/dist/runtime/openclaw/scaffold-assets/CLAUDE.md +0 -5
- package/dist/runtime/picoclaw/scaffold-assets/CLAUDE.md +0 -5
- /package/dist/runtime/openclaw/scaffold-assets/{AGENTS.md → WORKSPACE_AGENTS.md} +0 -0
- /package/dist/runtime/picoclaw/scaffold-assets/{AGENTS.md → WORKSPACE_AGENTS.md} +0 -0
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
import { Buffer } from "node:buffer";
|
|
2
|
+
import { createHash } from "node:crypto";
|
|
3
|
+
import { assertOrdinaryJsonGraph, parseOpaqueTargetHandle, parseRunId } from "./contracts.js";
|
|
4
|
+
import { isImmutableDockerImageReference } from "./dockerArtifactsProvider.js";
|
|
5
|
+
import { parseDuplicateFreeDockerProjection } from "./dockerProjectionJson.js";
|
|
6
|
+
export const DOCKER_WORLD_SERVICE_ERROR = "Docker world-service lifecycle failed";
|
|
7
|
+
export const WORLD_SECRETS_PATH = "/run/spawnfile-secrets";
|
|
8
|
+
export const WORLD_RUNTIME_TMPFS = Object.freeze({
|
|
9
|
+
path: "/tmp",
|
|
10
|
+
options: "rw,noexec,nosuid,nodev,size=1m,mode=1777"
|
|
11
|
+
});
|
|
12
|
+
const MAX_OUTPUT_BYTES = 32_768;
|
|
13
|
+
const MAX_NAME_LENGTH = 63;
|
|
14
|
+
const DIGEST_PATTERN = /^sha256:[a-f0-9]{64}$/u;
|
|
15
|
+
const DOCKER_ID_PATTERN = /^[a-f0-9]{64}$/u;
|
|
16
|
+
const NETWORK_NAME_PATTERN = /^spfn_[a-f0-9]{58}$/u;
|
|
17
|
+
const EVIDENCE_NAME_PATTERN = /^spfv_[a-f0-9]{58}$/u;
|
|
18
|
+
const SECRET_NAME_PATTERN = /^spfs_[a-f0-9]{58}$/u;
|
|
19
|
+
const RESOURCE_LABEL_KEYS = Object.freeze([
|
|
20
|
+
"spawnfile_resource_v1_kind",
|
|
21
|
+
"spawnfile_resource_v1_operation",
|
|
22
|
+
"spawnfile_resource_v1_run",
|
|
23
|
+
"spawnfile_resource_v1_target",
|
|
24
|
+
"spawnfile_resource_v1_version"
|
|
25
|
+
]);
|
|
26
|
+
const SECRET_LABEL_KEYS = Object.freeze([
|
|
27
|
+
"spawnfile_resource_v1_binding",
|
|
28
|
+
"spawnfile_resource_v1_kind",
|
|
29
|
+
"spawnfile_resource_v1_run",
|
|
30
|
+
"spawnfile_resource_v1_target",
|
|
31
|
+
"spawnfile_resource_v1_version"
|
|
32
|
+
]);
|
|
33
|
+
const WORLD_LABEL_KEYS = Object.freeze([
|
|
34
|
+
"spawnfile_world_service_v1_artifact",
|
|
35
|
+
"spawnfile_world_service_v1_evidence",
|
|
36
|
+
"spawnfile_world_service_v1_kind",
|
|
37
|
+
"spawnfile_world_service_v1_network",
|
|
38
|
+
"spawnfile_world_service_v1_operation",
|
|
39
|
+
"spawnfile_world_service_v1_run",
|
|
40
|
+
"spawnfile_world_service_v1_secrets",
|
|
41
|
+
"spawnfile_world_service_v1_target",
|
|
42
|
+
"spawnfile_world_service_v1_version"
|
|
43
|
+
]);
|
|
44
|
+
export class DockerWorldServiceProviderError extends Error {
|
|
45
|
+
kind;
|
|
46
|
+
constructor(kind) {
|
|
47
|
+
super(DOCKER_WORLD_SERVICE_ERROR);
|
|
48
|
+
this.kind = kind;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
const fail = () => { throw new Error(DOCKER_WORLD_SERVICE_ERROR); };
|
|
52
|
+
const bytes = (value) => Buffer.byteLength(value, "utf8");
|
|
53
|
+
const digest = (domain, value) => createHash("sha256")
|
|
54
|
+
.update(`spawnfile.target-world-service.${domain}.v1\0`, "utf8")
|
|
55
|
+
.update(value, "utf8")
|
|
56
|
+
.digest("hex");
|
|
57
|
+
const label = (prefix, value) => `${prefix}${digest("docker-label", value).slice(0, 63)}`;
|
|
58
|
+
const exactRecord = (value) => value !== null && typeof value === "object" && !Array.isArray(value)
|
|
59
|
+
&& Object.getPrototypeOf(value) === Object.prototype;
|
|
60
|
+
const exactKeys = (value, expected) => {
|
|
61
|
+
const actual = Object.keys(value).sort();
|
|
62
|
+
const sorted = [...expected].sort();
|
|
63
|
+
return actual.length === sorted.length
|
|
64
|
+
&& actual.every((key, index) => key === sorted[index]);
|
|
65
|
+
};
|
|
66
|
+
const parseResourceLabels = (raw, kind) => {
|
|
67
|
+
assertOrdinaryJsonGraph(raw);
|
|
68
|
+
const keys = kind === "secret_bindings" ? SECRET_LABEL_KEYS : RESOURCE_LABEL_KEYS;
|
|
69
|
+
if (!exactRecord(raw) || !exactKeys(raw, keys)
|
|
70
|
+
|| raw.spawnfile_resource_v1_kind !== kind
|
|
71
|
+
|| raw.spawnfile_resource_v1_version !== "v1")
|
|
72
|
+
return fail();
|
|
73
|
+
for (const key of keys) {
|
|
74
|
+
const value = raw[key];
|
|
75
|
+
if (typeof value !== "string" || !/^[a-z][a-z0-9_-]{0,63}$/u.test(value))
|
|
76
|
+
return fail();
|
|
77
|
+
}
|
|
78
|
+
const authorityKeys = kind === "secret_bindings"
|
|
79
|
+
? ["spawnfile_resource_v1_binding", "spawnfile_resource_v1_run", "spawnfile_resource_v1_target"]
|
|
80
|
+
: ["spawnfile_resource_v1_operation", "spawnfile_resource_v1_run", "spawnfile_resource_v1_target"];
|
|
81
|
+
if (authorityKeys.some((key) => !/^[a-z][a-f0-9]{63}$/u.test(raw[key])))
|
|
82
|
+
return fail();
|
|
83
|
+
return Object.freeze({ ...raw });
|
|
84
|
+
};
|
|
85
|
+
const parseResource = (raw, kind) => {
|
|
86
|
+
assertOrdinaryJsonGraph(raw);
|
|
87
|
+
if (!exactRecord(raw) || !exactKeys(raw, ["handle", "labels", "name"]))
|
|
88
|
+
return fail();
|
|
89
|
+
const pattern = kind === "data_network" ? NETWORK_NAME_PATTERN
|
|
90
|
+
: kind === "evidence_volume" ? EVIDENCE_NAME_PATTERN : SECRET_NAME_PATTERN;
|
|
91
|
+
if (typeof raw.name !== "string" || !pattern.test(raw.name))
|
|
92
|
+
return fail();
|
|
93
|
+
return Object.freeze({
|
|
94
|
+
handle: parseOpaqueTargetHandle(raw.handle),
|
|
95
|
+
labels: parseResourceLabels(raw.labels, kind),
|
|
96
|
+
name: raw.name
|
|
97
|
+
});
|
|
98
|
+
};
|
|
99
|
+
const rawInspectionFormat = () => {
|
|
100
|
+
const labels = WORLD_LABEL_KEYS.map((key) => `${JSON.stringify(key)}:{{json (index .Config.Labels ${JSON.stringify(key)})}}`).join(",");
|
|
101
|
+
return `[{"Id":{{json .Id}},"Name":{{json .Name}},"Hostname":{{json .Config.Hostname}},"Domainname":{{json .Config.Domainname}},"Image":{{json .Config.Image}},"Labels":{${labels}},"NetworkMode":{{json .HostConfig.NetworkMode}},"NetworkAttachmentCount":{{len .NetworkSettings.Networks}},"NetworkAttachmentName":{{range $name, $_ := .NetworkSettings.Networks}}{{json $name}}{{end}},"NetworkAttachmentId":{{range $_, $network := .NetworkSettings.Networks}}{{json $network.NetworkID}}{{end}},"NetworkAliases":{{range $_, $network := .NetworkSettings.Networks}}{{json $network.Aliases}}{{end}},"PortBindingCount":{{len .HostConfig.PortBindings}},"ExposedPortCount":{{with (index .Config "ExposedPorts")}}{{len .}}{{else}}0{{end}},"PublishAllPorts":{{json .HostConfig.PublishAllPorts}},"Mounts":[{{range $index, $mount := .Mounts}}{{if $index}},{{end}}{"Type":{{json $mount.Type}},"Name":{{json $mount.Name}},"Destination":{{json $mount.Destination}},"RW":{{json $mount.RW}}}{{end}}],"Tmpfs":{{json .HostConfig.Tmpfs}},"AutoRemove":{{json .HostConfig.AutoRemove}},"Privileged":{{json .HostConfig.Privileged}},"CapDrop":{{json .HostConfig.CapDrop}},"CapAddCount":{{len .HostConfig.CapAdd}},"DeviceCount":{{len .HostConfig.Devices}},"DeviceRequestCount":{{len .HostConfig.DeviceRequests}},"ExtraHostCount":{{len .HostConfig.ExtraHosts}},"LinkCount":{{len .HostConfig.Links}},"BindCount":{{len .HostConfig.Binds}},"VolumesFromCount":{{len .HostConfig.VolumesFrom}},"DnsCount":{{len .HostConfig.Dns}},"GroupAddCount":{{len .HostConfig.GroupAdd}},"PidMode":{{json .HostConfig.PidMode}},"IpcMode":{{json .HostConfig.IpcMode}},"UTSMode":{{json .HostConfig.UTSMode}},"UsernsMode":{{json .HostConfig.UsernsMode}},"CgroupnsMode":{{json .HostConfig.CgroupnsMode}},"ReadonlyRootfs":{{json .HostConfig.ReadonlyRootfs}},"SecurityOpt":{{json .HostConfig.SecurityOpt}},"LogType":{{json .HostConfig.LogConfig.Type}},"RestartPolicyName":{{json .HostConfig.RestartPolicy.Name}},"RestartMaximumRetryCount":{{json .HostConfig.RestartPolicy.MaximumRetryCount}},"Status":{{json .State.Status}}}]`;
|
|
102
|
+
};
|
|
103
|
+
const safeDockerTemplateLength = (expression) => `{{with ${expression}}}{{len .}}{{else}}0{{end}}`;
|
|
104
|
+
const inspectionFormat = () => {
|
|
105
|
+
let template = rawInspectionFormat();
|
|
106
|
+
for (const expression of [
|
|
107
|
+
".HostConfig.CapAdd",
|
|
108
|
+
".HostConfig.Devices",
|
|
109
|
+
".HostConfig.DeviceRequests",
|
|
110
|
+
".HostConfig.ExtraHosts",
|
|
111
|
+
".HostConfig.Links",
|
|
112
|
+
".HostConfig.Binds",
|
|
113
|
+
".HostConfig.VolumesFrom",
|
|
114
|
+
".HostConfig.Dns",
|
|
115
|
+
".HostConfig.GroupAdd"
|
|
116
|
+
]) {
|
|
117
|
+
template = template.replace(`{{len ${expression}}}`, safeDockerTemplateLength(expression));
|
|
118
|
+
}
|
|
119
|
+
return template;
|
|
120
|
+
};
|
|
121
|
+
export const createDockerWorldServiceSpec = (input) => {
|
|
122
|
+
try {
|
|
123
|
+
assertOrdinaryJsonGraph(input);
|
|
124
|
+
if (!exactRecord(input) || !exactKeys(input, Object.prototype.hasOwnProperty.call(input, "networkAlias") ? [
|
|
125
|
+
"dataNetwork", "evidenceMountPath", "evidenceVolume", "imageDigest", "imageReference",
|
|
126
|
+
"networkAlias", "operationHandle", "requestDigest", "runId", "secretBindings",
|
|
127
|
+
"selectedTargetHandle"
|
|
128
|
+
] : [
|
|
129
|
+
"dataNetwork", "evidenceMountPath", "evidenceVolume", "imageDigest", "imageReference",
|
|
130
|
+
"operationHandle", "requestDigest", "runId", "secretBindings",
|
|
131
|
+
"selectedTargetHandle"
|
|
132
|
+
]))
|
|
133
|
+
return fail();
|
|
134
|
+
const operationHandle = parseOpaqueTargetHandle(input.operationHandle);
|
|
135
|
+
const selectedTargetHandle = parseOpaqueTargetHandle(input.selectedTargetHandle);
|
|
136
|
+
const runId = parseRunId(input.runId);
|
|
137
|
+
if (typeof input.requestDigest !== "string" || !DIGEST_PATTERN.test(input.requestDigest)
|
|
138
|
+
|| typeof input.imageDigest !== "string" || !DIGEST_PATTERN.test(input.imageDigest)
|
|
139
|
+
|| !(isImmutableDockerImageReference(input.imageReference)
|
|
140
|
+
&& input.imageReference.endsWith(`@${input.imageDigest}`)
|
|
141
|
+
|| input.imageReference === input.imageDigest))
|
|
142
|
+
return fail();
|
|
143
|
+
const networkAlias = input.networkAlias === undefined ? undefined
|
|
144
|
+
: typeof input.networkAlias === "string" && /^[a-z][a-z0-9-]{0,62}$/u.test(input.networkAlias)
|
|
145
|
+
? input.networkAlias : fail();
|
|
146
|
+
const evidenceMountPath = typeof input.evidenceMountPath === "string"
|
|
147
|
+
&& input.evidenceMountPath.length <= 255
|
|
148
|
+
&& /^\/(?:run|var\/lib)\/[A-Za-z0-9][A-Za-z0-9._/-]*$/u.test(input.evidenceMountPath)
|
|
149
|
+
&& !input.evidenceMountPath.includes("//") && !input.evidenceMountPath.endsWith("/")
|
|
150
|
+
&& !input.evidenceMountPath.split("/").some((part) => part === "." || part === "..")
|
|
151
|
+
&& input.evidenceMountPath !== WORLD_SECRETS_PATH
|
|
152
|
+
&& !input.evidenceMountPath.startsWith(`${WORLD_SECRETS_PATH}/`)
|
|
153
|
+
&& !WORLD_SECRETS_PATH.startsWith(`${input.evidenceMountPath}/`)
|
|
154
|
+
? input.evidenceMountPath : fail();
|
|
155
|
+
const network = parseResource(input.dataNetwork, "data_network");
|
|
156
|
+
const evidence = parseResource(input.evidenceVolume, "evidence_volume");
|
|
157
|
+
const secrets = parseResource(input.secretBindings, "secret_bindings");
|
|
158
|
+
if (new Set([network.handle, evidence.handle, secrets.handle]).size !== 3
|
|
159
|
+
|| !["spawnfile_resource_v1_run", "spawnfile_resource_v1_target"].every((key) => network.labels[key] === evidence.labels[key] && network.labels[key] === secrets.labels[key]))
|
|
160
|
+
return fail();
|
|
161
|
+
const authority = [operationHandle, input.requestDigest, input.imageDigest,
|
|
162
|
+
network.handle, evidence.handle, secrets.handle, evidenceMountPath].join("\0");
|
|
163
|
+
const containerName = `spfc_${digest("container-name", authority).slice(0, MAX_NAME_LENGTH - 5)}`;
|
|
164
|
+
const receiptLabels = Object.freeze({
|
|
165
|
+
spawnfile_world_service_v1_artifact: label("a", input.imageDigest),
|
|
166
|
+
spawnfile_world_service_v1_evidence: label("e", evidence.handle),
|
|
167
|
+
spawnfile_world_service_v1_kind: "world_service",
|
|
168
|
+
spawnfile_world_service_v1_network: label("n", network.handle),
|
|
169
|
+
spawnfile_world_service_v1_operation: label("o", `${operationHandle}\0${input.requestDigest}`),
|
|
170
|
+
spawnfile_world_service_v1_run: label("r", runId),
|
|
171
|
+
spawnfile_world_service_v1_secrets: label("s", secrets.handle),
|
|
172
|
+
spawnfile_world_service_v1_target: label("t", selectedTargetHandle),
|
|
173
|
+
spawnfile_world_service_v1_version: "v1"
|
|
174
|
+
});
|
|
175
|
+
const labelArgs = Object.entries(receiptLabels)
|
|
176
|
+
.flatMap(([key, value]) => ["--label", `${key}=${value}`]);
|
|
177
|
+
const createArgs = Object.freeze([
|
|
178
|
+
"container", "create", "--pull", "never", "--name", containerName,
|
|
179
|
+
"--hostname", containerName, "--network", network.name,
|
|
180
|
+
...(networkAlias ? ["--network-alias", networkAlias] : []),
|
|
181
|
+
"--restart", "no", "--privileged=false",
|
|
182
|
+
"--publish-all=false", "--log-driver", "none", "--read-only",
|
|
183
|
+
"--cap-drop", "ALL", "--security-opt", "no-new-privileges=true",
|
|
184
|
+
"--ipc", "none", "--cgroupns", "private",
|
|
185
|
+
"--tmpfs", `${WORLD_RUNTIME_TMPFS.path}:${WORLD_RUNTIME_TMPFS.options}`,
|
|
186
|
+
...labelArgs,
|
|
187
|
+
"--mount", `type=volume,src=${evidence.name},dst=${evidenceMountPath},volume-nocopy`,
|
|
188
|
+
"--mount", `type=volume,src=${secrets.name},dst=${WORLD_SECRETS_PATH},readonly,volume-nocopy`,
|
|
189
|
+
input.imageReference
|
|
190
|
+
]);
|
|
191
|
+
return Object.freeze({
|
|
192
|
+
containerName,
|
|
193
|
+
createArgs,
|
|
194
|
+
evidenceMountPath,
|
|
195
|
+
imageDigest: input.imageDigest,
|
|
196
|
+
imageReference: input.imageReference,
|
|
197
|
+
...(networkAlias ? { networkAlias } : {}),
|
|
198
|
+
inspectionFormat: inspectionFormat(),
|
|
199
|
+
receiptLabels,
|
|
200
|
+
resultHandle: parseOpaqueTargetHandle(`opaque_${digest("result", authority)}`)
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
catch {
|
|
204
|
+
return fail();
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
const isUtf8 = (value) => Buffer.from(value, "utf8").toString("utf8") === value;
|
|
208
|
+
const boundedText = (value) => typeof value === "string" && isUtf8(value) && bytes(value) <= MAX_OUTPUT_BYTES;
|
|
209
|
+
export const executeDockerWorldService = async (input) => {
|
|
210
|
+
try {
|
|
211
|
+
const result = await input.executor("docker", input.args, {
|
|
212
|
+
signal: input.signal,
|
|
213
|
+
timeout: input.timeoutMs
|
|
214
|
+
});
|
|
215
|
+
if (!result || !boundedText(result.stdout) || !boundedText(result.stderr))
|
|
216
|
+
return fail();
|
|
217
|
+
return result;
|
|
218
|
+
}
|
|
219
|
+
catch (error) {
|
|
220
|
+
if (error instanceof DockerWorldServiceProviderError)
|
|
221
|
+
throw error;
|
|
222
|
+
return fail();
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
const parseProjection = (stdout) => {
|
|
226
|
+
try {
|
|
227
|
+
if (!boundedText(stdout))
|
|
228
|
+
return null;
|
|
229
|
+
const raw = parseDuplicateFreeDockerProjection(stdout);
|
|
230
|
+
assertOrdinaryJsonGraph(raw);
|
|
231
|
+
if (!Array.isArray(raw) || raw.length !== 1 || !exactRecord(raw[0]))
|
|
232
|
+
return null;
|
|
233
|
+
return raw[0];
|
|
234
|
+
}
|
|
235
|
+
catch {
|
|
236
|
+
return null;
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
const exactLabels = (raw, expected) => exactRecord(raw) && exactKeys(raw, WORLD_LABEL_KEYS)
|
|
240
|
+
&& Object.entries(expected).every(([key, value]) => raw[key] === value);
|
|
241
|
+
const exactMounts = (raw, spec) => {
|
|
242
|
+
if (!Array.isArray(raw) || raw.length !== 2)
|
|
243
|
+
return false;
|
|
244
|
+
const mounts = raw.every((item) => exactRecord(item)
|
|
245
|
+
&& exactKeys(item, ["Destination", "Name", "RW", "Type"]))
|
|
246
|
+
? raw : [];
|
|
247
|
+
if (mounts.length !== 2)
|
|
248
|
+
return false;
|
|
249
|
+
const evidence = mounts.find((mount) => mount.Destination === spec.evidenceMountPath);
|
|
250
|
+
const secrets = mounts.find((mount) => mount.Destination === WORLD_SECRETS_PATH);
|
|
251
|
+
const evidenceArg = spec.createArgs.find((value) => value.includes(`dst=${spec.evidenceMountPath}`));
|
|
252
|
+
const secretsArg = spec.createArgs.find((value) => value.includes(`dst=${WORLD_SECRETS_PATH}`));
|
|
253
|
+
const source = (value) => value?.match(/(?:^|,)src=([^,]+)/u)?.[1] ?? null;
|
|
254
|
+
return Boolean(evidence && secrets
|
|
255
|
+
&& evidence.Type === "volume" && evidence.Name === source(evidenceArg) && evidence.RW === true
|
|
256
|
+
&& secrets.Type === "volume" && secrets.Name === source(secretsArg) && secrets.RW === false);
|
|
257
|
+
};
|
|
258
|
+
export const parseExpectedDockerWorldService = (stdout, spec) => {
|
|
259
|
+
const value = parseProjection(stdout);
|
|
260
|
+
if (!value || !exactKeys(value, [
|
|
261
|
+
"AutoRemove", "BindCount", "CapAddCount", "CapDrop", "CgroupnsMode", "DeviceCount",
|
|
262
|
+
"DeviceRequestCount", "DnsCount", "Domainname", "ExposedPortCount", "ExtraHostCount",
|
|
263
|
+
"GroupAddCount", "Hostname", "Id", "Image", "IpcMode", "Labels", "LinkCount", "LogType", "Mounts", "Name",
|
|
264
|
+
"NetworkAliases", "NetworkAttachmentCount", "NetworkAttachmentId", "NetworkAttachmentName", "NetworkMode", "PidMode",
|
|
265
|
+
"PortBindingCount", "Privileged", "PublishAllPorts", "ReadonlyRootfs",
|
|
266
|
+
"RestartMaximumRetryCount", "RestartPolicyName", "SecurityOpt", "Status", "UTSMode",
|
|
267
|
+
"Tmpfs", "UsernsMode", "VolumesFromCount"
|
|
268
|
+
]))
|
|
269
|
+
return null;
|
|
270
|
+
const status = value.Status;
|
|
271
|
+
if (status !== "created" && status !== "dead" && status !== "exited"
|
|
272
|
+
&& status !== "paused" && status !== "removing" && status !== "restarting"
|
|
273
|
+
&& status !== "running")
|
|
274
|
+
return null;
|
|
275
|
+
if (typeof value.NetworkAttachmentId !== "string")
|
|
276
|
+
return null;
|
|
277
|
+
const networkAttachmentId = value.NetworkAttachmentId;
|
|
278
|
+
const exactNetworkId = DOCKER_ID_PATTERN.test(networkAttachmentId)
|
|
279
|
+
|| status === "created" && networkAttachmentId === "";
|
|
280
|
+
const exactAliases = spec.networkAlias
|
|
281
|
+
? Array.isArray(value.NetworkAliases)
|
|
282
|
+
&& value.NetworkAliases.length === 1
|
|
283
|
+
&& value.NetworkAliases[0] === spec.networkAlias
|
|
284
|
+
: value.NetworkAliases === null
|
|
285
|
+
|| Array.isArray(value.NetworkAliases) && value.NetworkAliases.length === 0;
|
|
286
|
+
if (typeof value.Id !== "string" || !DOCKER_ID_PATTERN.test(value.Id)
|
|
287
|
+
|| !exactNetworkId)
|
|
288
|
+
return null;
|
|
289
|
+
return value.Name === `/${spec.containerName}` && value.Hostname === spec.containerName
|
|
290
|
+
&& value.Domainname === "" && value.Image === spec.imageReference
|
|
291
|
+
&& exactLabels(value.Labels, spec.receiptLabels)
|
|
292
|
+
&& value.NetworkMode === resourceName(spec.createArgs, "--network")
|
|
293
|
+
&& value.NetworkAttachmentCount === 1
|
|
294
|
+
&& value.NetworkAttachmentName === resourceName(spec.createArgs, "--network")
|
|
295
|
+
&& exactAliases
|
|
296
|
+
&& value.PortBindingCount === 0
|
|
297
|
+
&& value.ExposedPortCount === 0 && value.PublishAllPorts === false
|
|
298
|
+
&& exactMounts(value.Mounts, spec) && value.AutoRemove === false
|
|
299
|
+
&& value.Privileged === false
|
|
300
|
+
&& JSON.stringify(value.CapDrop) === JSON.stringify(["ALL"])
|
|
301
|
+
&& value.CapAddCount === 0 && value.DeviceCount === 0 && value.DeviceRequestCount === 0
|
|
302
|
+
&& value.ExtraHostCount === 0 && value.LinkCount === 0 && value.BindCount === 0
|
|
303
|
+
&& value.VolumesFromCount === 0 && value.DnsCount === 0 && value.GroupAddCount === 0
|
|
304
|
+
&& value.PidMode === "" && value.IpcMode === "none" && value.UTSMode === ""
|
|
305
|
+
&& value.UsernsMode === "" && value.CgroupnsMode === "private"
|
|
306
|
+
&& exactRecord(value.Tmpfs)
|
|
307
|
+
&& exactKeys(value.Tmpfs, [WORLD_RUNTIME_TMPFS.path])
|
|
308
|
+
&& value.Tmpfs[WORLD_RUNTIME_TMPFS.path] === WORLD_RUNTIME_TMPFS.options
|
|
309
|
+
&& value.ReadonlyRootfs === true
|
|
310
|
+
&& JSON.stringify(value.SecurityOpt) === JSON.stringify(["no-new-privileges=true"])
|
|
311
|
+
&& value.LogType === "none" && value.RestartPolicyName === "no"
|
|
312
|
+
&& value.RestartMaximumRetryCount === 0
|
|
313
|
+
? Object.freeze({ containerId: value.Id, networkId: networkAttachmentId, status }) : null;
|
|
314
|
+
};
|
|
315
|
+
const resourceName = (args, flag) => {
|
|
316
|
+
const index = args.indexOf(flag);
|
|
317
|
+
return index >= 0 && typeof args[index + 1] === "string" ? args[index + 1] : null;
|
|
318
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { type OpaqueTargetHandle } from "./contracts.js";
|
|
2
|
+
import { type WorldServiceResolution } from "./dockerWorldServiceAuthority.js";
|
|
3
|
+
import { type DockerWorldServiceSpec } from "./dockerWorldServiceProvider.js";
|
|
4
|
+
declare const BINDING_VERSION: "spawnfile.target-world-service.private-binding.v1";
|
|
5
|
+
declare const ADMISSION_VERSION: "spawnfile.target-world-service.private-mutation-admission.v1";
|
|
6
|
+
interface NamedResourceBinding {
|
|
7
|
+
readonly handle: OpaqueTargetHandle;
|
|
8
|
+
readonly labels: Readonly<Record<string, string>>;
|
|
9
|
+
readonly name: string;
|
|
10
|
+
}
|
|
11
|
+
export interface WorldServiceBinding {
|
|
12
|
+
readonly container_id: string;
|
|
13
|
+
readonly receipt_labels: Readonly<Record<string, string>>;
|
|
14
|
+
readonly resolution: WorldServiceResolution;
|
|
15
|
+
readonly resources: {
|
|
16
|
+
readonly data_network: NamedResourceBinding;
|
|
17
|
+
readonly evidence_volume: NamedResourceBinding;
|
|
18
|
+
readonly secret_bindings: NamedResourceBinding;
|
|
19
|
+
};
|
|
20
|
+
readonly version: typeof BINDING_VERSION;
|
|
21
|
+
readonly world_service_handle: OpaqueTargetHandle;
|
|
22
|
+
}
|
|
23
|
+
export interface WorldServiceMutationAdmission {
|
|
24
|
+
readonly container_id: string | null;
|
|
25
|
+
readonly container_name: string;
|
|
26
|
+
readonly operation: "create_world_service" | "start_world_service" | "stop_world_service";
|
|
27
|
+
readonly operation_handle: OpaqueTargetHandle;
|
|
28
|
+
readonly request_digest: string;
|
|
29
|
+
readonly version: typeof ADMISSION_VERSION;
|
|
30
|
+
readonly world_service_handle: OpaqueTargetHandle;
|
|
31
|
+
}
|
|
32
|
+
export interface WorldServiceAuthorityStore {
|
|
33
|
+
bindMutationAdmission(admission: WorldServiceMutationAdmission): Promise<void>;
|
|
34
|
+
bindResolution(resolution: WorldServiceResolution): Promise<void>;
|
|
35
|
+
bindService(binding: WorldServiceBinding): Promise<void>;
|
|
36
|
+
loadService(handle: OpaqueTargetHandle): Promise<WorldServiceBinding>;
|
|
37
|
+
requireMutationAdmission(admission: WorldServiceMutationAdmission): Promise<void>;
|
|
38
|
+
}
|
|
39
|
+
export interface WorldServiceAuthorityReader {
|
|
40
|
+
loadService(handle: OpaqueTargetHandle): Promise<WorldServiceBinding>;
|
|
41
|
+
}
|
|
42
|
+
export declare const createWorldServiceBinding: (input: {
|
|
43
|
+
readonly containerId: unknown;
|
|
44
|
+
readonly dataNetwork: unknown;
|
|
45
|
+
readonly evidenceVolume: unknown;
|
|
46
|
+
readonly resolution: unknown;
|
|
47
|
+
readonly secretBindings: unknown;
|
|
48
|
+
readonly spec: DockerWorldServiceSpec;
|
|
49
|
+
}) => WorldServiceBinding;
|
|
50
|
+
export declare const parseWorldServiceBinding: (raw: unknown) => WorldServiceBinding;
|
|
51
|
+
export declare const createWorldServiceMutationAdmission: (input: {
|
|
52
|
+
readonly containerId: unknown;
|
|
53
|
+
readonly containerName: unknown;
|
|
54
|
+
readonly operation: unknown;
|
|
55
|
+
readonly operationHandle: unknown;
|
|
56
|
+
readonly requestDigest: unknown;
|
|
57
|
+
readonly worldServiceHandle: unknown;
|
|
58
|
+
}) => WorldServiceMutationAdmission;
|
|
59
|
+
export declare const initializeWorldServiceAuthorityStore: (root: unknown) => Promise<WorldServiceAuthorityStore>;
|
|
60
|
+
/** Opens an existing private authority for reads without creating or chmodding paths. */
|
|
61
|
+
export declare const initializeWorldServiceAuthorityReader: (root: unknown) => Promise<WorldServiceAuthorityReader>;
|
|
62
|
+
export declare const worldServiceResourceBindings: (input: {
|
|
63
|
+
readonly dataNetworkClaim: {
|
|
64
|
+
readonly operationHandle: OpaqueTargetHandle;
|
|
65
|
+
readonly requestDigest: string;
|
|
66
|
+
};
|
|
67
|
+
readonly evidenceVolumeClaim: {
|
|
68
|
+
readonly operationHandle: OpaqueTargetHandle;
|
|
69
|
+
readonly requestDigest: string;
|
|
70
|
+
};
|
|
71
|
+
readonly resolution: WorldServiceResolution;
|
|
72
|
+
}) => WorldServiceBinding["resources"];
|
|
73
|
+
export {};
|