spawnfile 0.1.12 → 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 +58 -12
- 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/runtimeCredentials.js +18 -2
- 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/devCommands.d.ts +3 -0
- package/dist/cli/devCommands.js +115 -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 -179
- 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 +15 -2
- package/dist/cli/runCli.js +31 -71
- package/dist/cli/runPublishCommands.d.ts +3 -0
- package/dist/cli/runPublishCommands.js +70 -0
- package/dist/cli/statusCommand.d.ts +3 -32
- package/dist/cli/statusCommand.js +37 -233
- 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 +20 -1
- package/dist/compiler/buildProject.js +121 -7
- package/dist/compiler/compilePlanHelpers.js +2 -0
- package/dist/compiler/compileProject.d.ts +15 -0
- package/dist/compiler/compileProject.js +29 -75
- 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 +40 -81
- 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 +60 -53
- 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/containerPackageRender.d.ts +15 -0
- package/dist/compiler/containerPackageRender.js +63 -0
- package/dist/compiler/containerTargetPlanResolution.d.ts +20 -0
- package/dist/compiler/containerTargetPlanResolution.js +97 -0
- package/dist/compiler/containerTargetResources.js +3 -1
- 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 +56 -95
- package/dist/compiler/moltnetBinaries.d.ts +21 -1
- package/dist/compiler/moltnetBinaries.js +156 -28
- package/dist/compiler/moltnetClientConfig.js +18 -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/moltnetRuntimeConfig.js +11 -0
- 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 +37 -22
- 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 +187 -19
- 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 +257 -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.d.ts +17 -0
- package/dist/deployment/dockerRecover.js +137 -0
- 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 +17 -0
- package/dist/deployment/index.js +18 -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/activity.d.ts +14 -0
- package/dist/dev/activity.js +48 -0
- package/dist/dev/docker.d.ts +16 -0
- package/dist/dev/docker.js +71 -0
- package/dist/dev/index.d.ts +2 -0
- package/dist/dev/index.js +2 -0
- package/dist/dev/project.d.ts +35 -0
- package/dist/dev/project.js +170 -0
- 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 +37 -0
- package/dist/runtime/common.js +56 -1
- package/dist/runtime/container.d.ts +29 -1
- package/dist/runtime/container.js +127 -11
- 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/install.d.ts +1 -1
- package/dist/runtime/install.js +43 -1
- 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 +4 -0
- package/dist/runtime/pi/adapter.js +231 -0
- package/dist/runtime/pi/appActivitySource.d.ts +1 -0
- package/dist/runtime/pi/appActivitySource.js +199 -0
- 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 -0
- package/dist/runtime/pi/appCoreSource.js +244 -0
- package/dist/runtime/pi/appPreludeSource.d.ts +1 -0
- package/dist/runtime/pi/appPreludeSource.js +191 -0
- 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 -0
- package/dist/runtime/pi/appSource.js +12 -0
- package/dist/runtime/pi/appTemplate.d.ts +14 -0
- package/dist/runtime/pi/appTemplate.js +27 -0
- 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.d.ts +2 -0
- package/dist/runtime/pi/runAuth.js +185 -0
- 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/registry.js +3 -0
- package/dist/runtime/scheduleUtils.d.ts +2 -0
- package/dist/runtime/scheduleUtils.js +15 -0
- package/dist/runtime/types.d.ts +26 -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/deployments.js +5 -12
- 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 +29 -8
- package/runtimes.yaml +28 -27
- 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,149 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { mkdir, mkdtemp, rm, writeFile } from "node:fs/promises";
|
|
3
|
+
import os from "node:os";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
import { boundedRedactedText, SpawnfileError } from "../shared/index.js";
|
|
7
|
+
import { assertOrdinaryJsonGraph, parseRunId } from "./contracts.js";
|
|
8
|
+
import { executeDockerWorldService } from "./dockerWorldServiceProvider.js";
|
|
9
|
+
import { worldServiceSpecForBinding } from "./dockerWorldServiceLifecycle.js";
|
|
10
|
+
export const WORLD_SERVICE_ACTIVATION_VERSION = "spawnfile.world-service-activation.v1";
|
|
11
|
+
export const TARGET_TOPOLOGY_ACTIVATION_RECEIPT_VERSION = "spawnfile.target-topology-activation-receipt.v1";
|
|
12
|
+
export const WORLD_SERVICE_ACTIVATION_RELATIVE_PATH = ".spawnfile/world-service-activated.v1";
|
|
13
|
+
const digestSchema = z.string().regex(/^sha256:[0-9a-f]{64}$/u);
|
|
14
|
+
const markerSchema = z.object({
|
|
15
|
+
bundle_digest: digestSchema,
|
|
16
|
+
run_id: z.string(),
|
|
17
|
+
state: z.literal("activated"),
|
|
18
|
+
topology_receipt_digest: digestSchema,
|
|
19
|
+
topology_request_digest: digestSchema,
|
|
20
|
+
version: z.literal(WORLD_SERVICE_ACTIVATION_VERSION)
|
|
21
|
+
}).strict();
|
|
22
|
+
const receiptSchema = z.object({
|
|
23
|
+
activation_digest: digestSchema,
|
|
24
|
+
bundle_digest: digestSchema,
|
|
25
|
+
receipt_digest: digestSchema,
|
|
26
|
+
run_id: z.string(),
|
|
27
|
+
state: z.literal("activated"),
|
|
28
|
+
topology_receipt_digest: digestSchema,
|
|
29
|
+
topology_request_digest: digestSchema,
|
|
30
|
+
version: z.literal(TARGET_TOPOLOGY_ACTIVATION_RECEIPT_VERSION)
|
|
31
|
+
}).strict();
|
|
32
|
+
const fail = (reason) => {
|
|
33
|
+
throw new SpawnfileError("runtime_error", `Target topology activation failed: ${reason}`);
|
|
34
|
+
};
|
|
35
|
+
const canonical = (value) => {
|
|
36
|
+
assertOrdinaryJsonGraph(value);
|
|
37
|
+
if (Array.isArray(value))
|
|
38
|
+
return `[${value.map(canonical).join(",")}]`;
|
|
39
|
+
if (value !== null && typeof value === "object") {
|
|
40
|
+
const record = value;
|
|
41
|
+
return `{${Object.keys(record).sort().map((key) => `${JSON.stringify(key)}:${canonical(record[key])}`).join(",")}}`;
|
|
42
|
+
}
|
|
43
|
+
return JSON.stringify(value);
|
|
44
|
+
};
|
|
45
|
+
const digest = (domain, value) => `sha256:${createHash("sha256")
|
|
46
|
+
.update(domain === "activation"
|
|
47
|
+
? "spawnfile.world-service-activation.v1\0"
|
|
48
|
+
: "spawnfile.target-topology-activation-receipt.v1\0", "utf8")
|
|
49
|
+
.update(canonical(value), "utf8")
|
|
50
|
+
.digest("hex")}`;
|
|
51
|
+
export const parseWorldServiceActivation = (raw) => {
|
|
52
|
+
assertOrdinaryJsonGraph(raw);
|
|
53
|
+
const parsed = markerSchema.parse(raw);
|
|
54
|
+
return Object.freeze({ ...parsed, run_id: parseRunId(parsed.run_id) });
|
|
55
|
+
};
|
|
56
|
+
export const parseTargetTopologyActivationReceipt = (raw) => {
|
|
57
|
+
assertOrdinaryJsonGraph(raw);
|
|
58
|
+
const parsed = receiptSchema.parse(raw);
|
|
59
|
+
return Object.freeze({ ...parsed, run_id: parseRunId(parsed.run_id) });
|
|
60
|
+
};
|
|
61
|
+
export const createCanonicalWorldServiceActivationBytes = (raw) => `${canonical(parseWorldServiceActivation(raw))}\n`;
|
|
62
|
+
export const createCanonicalTargetTopologyActivationReceiptBytes = (raw) => canonical(parseTargetTopologyActivationReceipt(raw));
|
|
63
|
+
export const createWorldServiceActivationDigest = (raw) => digest("activation", parseWorldServiceActivation(raw));
|
|
64
|
+
export const createTargetTopologyActivationReceiptDigest = (raw) => {
|
|
65
|
+
const parsed = parseTargetTopologyActivationReceipt(raw);
|
|
66
|
+
const { receipt_digest: _receiptDigest, ...body } = parsed;
|
|
67
|
+
return digest("receipt", body);
|
|
68
|
+
};
|
|
69
|
+
const markerFor = (world, topology) => parseWorldServiceActivation({
|
|
70
|
+
bundle_digest: world.resolution.artifact.artifact_manifest_digest,
|
|
71
|
+
run_id: topology.run_id,
|
|
72
|
+
state: "activated",
|
|
73
|
+
topology_receipt_digest: topology.receipt_digest,
|
|
74
|
+
topology_request_digest: topology.request_digest,
|
|
75
|
+
version: WORLD_SERVICE_ACTIVATION_VERSION
|
|
76
|
+
});
|
|
77
|
+
const receiptFor = (marker) => {
|
|
78
|
+
const body = {
|
|
79
|
+
activation_digest: createWorldServiceActivationDigest(marker),
|
|
80
|
+
bundle_digest: marker.bundle_digest,
|
|
81
|
+
receipt_digest: `sha256:${"0".repeat(64)}`,
|
|
82
|
+
run_id: marker.run_id,
|
|
83
|
+
state: "activated",
|
|
84
|
+
topology_receipt_digest: marker.topology_receipt_digest,
|
|
85
|
+
topology_request_digest: marker.topology_request_digest,
|
|
86
|
+
version: TARGET_TOPOLOGY_ACTIVATION_RECEIPT_VERSION
|
|
87
|
+
};
|
|
88
|
+
const receipt = parseTargetTopologyActivationReceipt({
|
|
89
|
+
...body,
|
|
90
|
+
receipt_digest: createTargetTopologyActivationReceiptDigest(body)
|
|
91
|
+
});
|
|
92
|
+
return Object.freeze({
|
|
93
|
+
receipt,
|
|
94
|
+
receiptBytes: createCanonicalTargetTopologyActivationReceiptBytes(receipt)
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* Publishes the owner-only lifecycle release through the service's existing
|
|
99
|
+
* evidence mount. Docker copies exact canonical bytes; no provider traffic or
|
|
100
|
+
* agent-reachable endpoint participates in activation.
|
|
101
|
+
*/
|
|
102
|
+
export const activateDockerWorldService = async (input) => {
|
|
103
|
+
const marker = markerFor(input.world, input.topology);
|
|
104
|
+
const spec = worldServiceSpecForBinding(input.world);
|
|
105
|
+
const temporaryRoot = await mkdtemp(path.join(os.tmpdir(), "spawnfile-world-activation-"));
|
|
106
|
+
try {
|
|
107
|
+
const markerDirectory = path.join(temporaryRoot, ".spawnfile");
|
|
108
|
+
// This path is docker cp'd into the evidence volume, which is exported by a
|
|
109
|
+
// helper running as uid 65534. The marker is a closed schema of digests and
|
|
110
|
+
// identifiers with no secret material, so the restriction protected nothing;
|
|
111
|
+
// tightening it back disables evidence export. A file written into a volume
|
|
112
|
+
// that exists to be exported must be readable by the exporter.
|
|
113
|
+
await mkdir(markerDirectory, { mode: 0o755 });
|
|
114
|
+
// This path is docker cp'd into the evidence volume, which is exported by a
|
|
115
|
+
// helper running as uid 65534. The marker is a closed schema of digests and
|
|
116
|
+
// identifiers with no secret material, so the restriction protected nothing;
|
|
117
|
+
// tightening it back disables evidence export. A file written into a volume
|
|
118
|
+
// that exists to be exported must be readable by the exporter.
|
|
119
|
+
await writeFile(path.join(markerDirectory, "world-service-activated.v1"), createCanonicalWorldServiceActivationBytes(marker), { encoding: "utf8", mode: 0o644 });
|
|
120
|
+
const result = await executeDockerWorldService({
|
|
121
|
+
args: [
|
|
122
|
+
...input.target,
|
|
123
|
+
"container",
|
|
124
|
+
"cp",
|
|
125
|
+
markerDirectory,
|
|
126
|
+
`${input.world.container_id}:${spec.evidenceMountPath}`
|
|
127
|
+
],
|
|
128
|
+
executor: input.executor,
|
|
129
|
+
signal: input.signal,
|
|
130
|
+
timeoutMs: input.timeoutMs
|
|
131
|
+
});
|
|
132
|
+
if (result.stdout !== "") {
|
|
133
|
+
return fail(`activation_stdout_unexpected:${boundedRedactedText(result.stdout)}`);
|
|
134
|
+
}
|
|
135
|
+
if (result.stderr !== "") {
|
|
136
|
+
return fail(`activation_stderr_unexpected:${boundedRedactedText(result.stderr)}`);
|
|
137
|
+
}
|
|
138
|
+
return receiptFor(marker);
|
|
139
|
+
}
|
|
140
|
+
catch (error) {
|
|
141
|
+
if (error instanceof SpawnfileError
|
|
142
|
+
&& error.message.startsWith("Target topology activation failed:"))
|
|
143
|
+
throw error;
|
|
144
|
+
return fail("activation_failed");
|
|
145
|
+
}
|
|
146
|
+
finally {
|
|
147
|
+
await rm(temporaryRoot, { force: true, recursive: true }).catch(() => undefined);
|
|
148
|
+
}
|
|
149
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type TargetTopologyReceipt } from "./contracts.js";
|
|
2
|
+
import { type DockerResourceExecutor } from "./dockerResourcesProvider.js";
|
|
3
|
+
import { type DockerOrganizationAttachmentExecutor } from "./organizationAttachmentProvider.js";
|
|
4
|
+
import type { OrganizationAttachmentAuthorityStore } from "./organizationAttachmentStore.js";
|
|
5
|
+
import { type DockerWorldServiceExecutor } from "./dockerWorldServiceProvider.js";
|
|
6
|
+
import { type WorldServiceAuthorityStore } from "./dockerWorldServiceStore.js";
|
|
7
|
+
import type { TargetJournalStore } from "./journal.js";
|
|
8
|
+
import { type TargetTopologyActivationResult } from "./topologyActivation.js";
|
|
9
|
+
export declare const TARGET_TOPOLOGY_ATTESTATION_ERROR = "Target topology attestation failed";
|
|
10
|
+
export interface TargetTopologyAttestationResult {
|
|
11
|
+
readonly receipt: TargetTopologyReceipt;
|
|
12
|
+
readonly receiptBytes: string;
|
|
13
|
+
}
|
|
14
|
+
export interface TargetTopologyAttestor {
|
|
15
|
+
activate(raw: unknown): Promise<TargetTopologyActivationResult>;
|
|
16
|
+
attest(raw: unknown): Promise<TargetTopologyAttestationResult>;
|
|
17
|
+
}
|
|
18
|
+
export interface CreateTargetTopologyAttestorOptions {
|
|
19
|
+
readonly attachmentExecutor: DockerOrganizationAttachmentExecutor;
|
|
20
|
+
readonly attachmentStore: OrganizationAttachmentAuthorityStore;
|
|
21
|
+
readonly context: string;
|
|
22
|
+
readonly resolveJournal: (input: {
|
|
23
|
+
readonly descriptorDigest: unknown;
|
|
24
|
+
readonly runId: unknown;
|
|
25
|
+
readonly selectedTarget: unknown;
|
|
26
|
+
}) => Promise<TargetJournalStore>;
|
|
27
|
+
readonly resourceExecutor: DockerResourceExecutor;
|
|
28
|
+
readonly timeoutMs: number;
|
|
29
|
+
readonly worldExecutor: DockerWorldServiceExecutor;
|
|
30
|
+
readonly worldStore: WorldServiceAuthorityStore;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Builds the read-only owner endpoint. The only caller-controlled input is a
|
|
34
|
+
* public correlation packet; all topology facts come from exact completed
|
|
35
|
+
* journal records, private capability stores and bounded Docker projections.
|
|
36
|
+
*/
|
|
37
|
+
export declare const createTargetTopologyAttestor: (raw: CreateTargetTopologyAttestorOptions) => TargetTopologyAttestor;
|
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
import { boundedRedactedText, SpawnfileError } from "../shared/index.js";
|
|
2
|
+
import { types as nodeTypes } from "node:util";
|
|
3
|
+
import { parseTargetTopologyAttestationRequest } from "./contracts.js";
|
|
4
|
+
import { createDockerContextSnapshot } from "./dockerContextSnapshot.js";
|
|
5
|
+
import { ORGANIZATION_NETWORK_INSPECTION_FORMAT, ORGANIZATION_EGRESS_NETWORK_INSPECTION_FORMAT, executeDockerOrganizationAttachment, isExpectedOrganizationEgressNetwork, organizationTopologyInspectionFormat, parseExpectedOrganizationNetwork, parseExpectedOrganizationEgressNetwork, createDockerOrganizationAttachmentSpec } from "./organizationAttachmentProvider.js";
|
|
6
|
+
import { executeDockerWorldService, parseExpectedDockerWorldService } from "./dockerWorldServiceProvider.js";
|
|
7
|
+
import { worldServiceSpecForBinding } from "./dockerWorldServiceLifecycle.js";
|
|
8
|
+
import { createCanonicalTargetTopologyReceiptBytes, createTargetTopologyAttestationRequestDigest, createTargetTopologyReceiptDigest } from "./handles.js";
|
|
9
|
+
import { activateDockerWorldService } from "./topologyActivation.js";
|
|
10
|
+
export const TARGET_TOPOLOGY_ATTESTATION_ERROR = "Target topology attestation failed";
|
|
11
|
+
const fail = (reason) => {
|
|
12
|
+
throw new SpawnfileError("runtime_error", `${TARGET_TOPOLOGY_ATTESTATION_ERROR}: ${reason}`);
|
|
13
|
+
};
|
|
14
|
+
const same = (left, right) => JSON.stringify(left) === JSON.stringify(right);
|
|
15
|
+
const context = (raw) => typeof raw === "string" && /^[a-z][a-z0-9_-]{0,63}$/u.test(raw) ? raw : fail("invalid_context");
|
|
16
|
+
const timeout = (raw) => typeof raw === "number" && Number.isSafeInteger(raw) && raw >= 1 && raw <= 120_000 ? raw : fail("invalid_timeout");
|
|
17
|
+
const claim = (tuple) => ({
|
|
18
|
+
operationHandle: tuple.operation_handle,
|
|
19
|
+
requestDigest: tuple.request_digest
|
|
20
|
+
});
|
|
21
|
+
const completed = async (journal, request, tuple, operation) => {
|
|
22
|
+
const result = await journal.resolveCompletedReceipt(claim(tuple));
|
|
23
|
+
if (!result)
|
|
24
|
+
return fail("journal_receipt_missing");
|
|
25
|
+
const receipt = result.receipt;
|
|
26
|
+
if (receipt.operation !== operation)
|
|
27
|
+
return fail("receipt_operation_mismatch");
|
|
28
|
+
if (receipt.operation_handle !== tuple.operation_handle)
|
|
29
|
+
return fail("receipt_operation_handle_mismatch");
|
|
30
|
+
if (receipt.request_digest !== tuple.request_digest)
|
|
31
|
+
return fail("receipt_request_digest_mismatch");
|
|
32
|
+
if (receipt.result_handle !== tuple.result_handle)
|
|
33
|
+
return fail("receipt_result_handle_mismatch");
|
|
34
|
+
if (receipt.run_id !== request.run_id)
|
|
35
|
+
return fail("run_id_mismatch");
|
|
36
|
+
if (receipt.descriptor_digest !== request.descriptor_digest)
|
|
37
|
+
return fail("descriptor_digest_mismatch");
|
|
38
|
+
if (!same(receipt.selected_target, request.selected_target))
|
|
39
|
+
return fail("selected_target_mismatch");
|
|
40
|
+
return receipt;
|
|
41
|
+
};
|
|
42
|
+
const sameTarget = (left, right) => same(left, { fingerprint: right.fingerprint, handle: right.handle });
|
|
43
|
+
const attachmentSpec = (binding) => createDockerOrganizationAttachmentSpec({
|
|
44
|
+
containerId: binding.resolution.network_attachment.container_id,
|
|
45
|
+
dataNetworkOperationHandle: binding.data_network.operation_handle,
|
|
46
|
+
dataNetworkRequestDigest: binding.data_network.request_digest,
|
|
47
|
+
deploymentLabels: binding.resolution.network_attachment.deployment_labels,
|
|
48
|
+
operationHandle: binding.resolution.authorization.operation_handle,
|
|
49
|
+
organizationHandoffHandle: binding.resolution.authorization.organization_handoff_handle,
|
|
50
|
+
requestDigest: binding.resolution.authorization.request_digest,
|
|
51
|
+
runId: binding.resolution.authorization.run_id,
|
|
52
|
+
selectedTargetHandle: binding.resolution.authorization.selected_target.handle
|
|
53
|
+
});
|
|
54
|
+
const validateAttachment = (binding, request) => {
|
|
55
|
+
const tuple = request.organization_attachment;
|
|
56
|
+
if (binding.attachment_handle !== tuple.result_handle
|
|
57
|
+
|| binding.data_network.handle !== request.data_network.result_handle
|
|
58
|
+
|| binding.data_network.operation_handle !== request.data_network.operation_handle
|
|
59
|
+
|| binding.data_network.request_digest !== request.data_network.request_digest
|
|
60
|
+
|| binding.resolution.authorization.operation_handle !== tuple.operation_handle
|
|
61
|
+
|| binding.resolution.authorization.request_digest !== tuple.request_digest
|
|
62
|
+
|| binding.resolution.authorization.run_id !== request.run_id
|
|
63
|
+
|| binding.resolution.authorization.descriptor_digest !== request.descriptor_digest
|
|
64
|
+
|| !sameTarget(binding.resolution.authorization.selected_target, request.selected_target))
|
|
65
|
+
fail("attachment_binding_mismatch");
|
|
66
|
+
};
|
|
67
|
+
const validateWorldService = (binding, request) => {
|
|
68
|
+
const create = request.world_service.create;
|
|
69
|
+
if (binding.world_service_handle !== create.result_handle
|
|
70
|
+
|| binding.resolution.authorization.operation_handle !== create.operation_handle
|
|
71
|
+
|| binding.resolution.authorization.request_digest !== create.request_digest
|
|
72
|
+
|| binding.resolution.authorization.data_network_handle !== request.data_network.result_handle
|
|
73
|
+
|| binding.resources.data_network.handle !== request.data_network.result_handle
|
|
74
|
+
|| binding.resolution.authorization.run_id !== request.run_id
|
|
75
|
+
|| binding.resolution.authorization.descriptor_digest !== request.descriptor_digest
|
|
76
|
+
|| !sameTarget(binding.resolution.authorization.selected_target, request.selected_target))
|
|
77
|
+
fail("world_service_binding_mismatch");
|
|
78
|
+
};
|
|
79
|
+
const bindSelectedTarget = async (value, options) => {
|
|
80
|
+
return createDockerContextSnapshot({
|
|
81
|
+
context: options.context,
|
|
82
|
+
executor: options.resourceExecutor,
|
|
83
|
+
selectedTarget: value.selected_target,
|
|
84
|
+
timeoutMs: options.timeoutMs
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
const inspectBound = async (request, binding, world, target, options) => {
|
|
88
|
+
const organization = attachmentSpec(binding);
|
|
89
|
+
if (organization.resultHandle !== binding.attachment_handle
|
|
90
|
+
|| organization.network.resultHandle !== request.data_network.result_handle
|
|
91
|
+
|| organization.network.name !== binding.data_network.name
|
|
92
|
+
|| !same(organization.network.labels, binding.data_network.labels))
|
|
93
|
+
return fail("attachment_binding_mismatch");
|
|
94
|
+
const inspectedNetworkId = await (async () => {
|
|
95
|
+
const networkInspection = await executeDockerOrganizationAttachment({
|
|
96
|
+
args: [...target, "network", "inspect", "--format",
|
|
97
|
+
ORGANIZATION_NETWORK_INSPECTION_FORMAT, organization.network.name],
|
|
98
|
+
executor: options.attachmentExecutor,
|
|
99
|
+
timeoutMs: options.timeoutMs
|
|
100
|
+
});
|
|
101
|
+
return networkInspection.stderr === ""
|
|
102
|
+
? parseExpectedOrganizationNetwork(networkInspection.stdout, organization) : null;
|
|
103
|
+
})();
|
|
104
|
+
if (inspectedNetworkId === null || inspectedNetworkId !== binding.data_network.id)
|
|
105
|
+
return fail("data_network_inspection_mismatch");
|
|
106
|
+
const egressNetwork = await (async () => {
|
|
107
|
+
const organizationInspection = await executeDockerOrganizationAttachment({
|
|
108
|
+
args: [...target, "container", "inspect", "--format",
|
|
109
|
+
organizationTopologyInspectionFormat(organization.network.name), organization.containerId],
|
|
110
|
+
executor: options.attachmentExecutor,
|
|
111
|
+
timeoutMs: options.timeoutMs
|
|
112
|
+
});
|
|
113
|
+
return organizationInspection.stderr === ""
|
|
114
|
+
? parseExpectedOrganizationEgressNetwork(organizationInspection.stdout, organization) : null;
|
|
115
|
+
})();
|
|
116
|
+
if (egressNetwork === null)
|
|
117
|
+
return fail("organization_egress_missing");
|
|
118
|
+
if (egressNetwork.dataNetworkId !== binding.data_network.id)
|
|
119
|
+
return fail("organization_egress_data_network_mismatch");
|
|
120
|
+
const expectedEgress = await (async () => {
|
|
121
|
+
const egressInspection = await executeDockerOrganizationAttachment({
|
|
122
|
+
args: [...target, "network", "inspect", "--format",
|
|
123
|
+
ORGANIZATION_EGRESS_NETWORK_INSPECTION_FORMAT, egressNetwork.name],
|
|
124
|
+
executor: options.attachmentExecutor,
|
|
125
|
+
timeoutMs: options.timeoutMs
|
|
126
|
+
});
|
|
127
|
+
return egressInspection.stderr === ""
|
|
128
|
+
&& isExpectedOrganizationEgressNetwork(egressInspection.stdout, egressNetwork);
|
|
129
|
+
})();
|
|
130
|
+
if (!expectedEgress)
|
|
131
|
+
return fail("organization_egress_policy_mismatch");
|
|
132
|
+
const egressAfter = await (async () => {
|
|
133
|
+
const organizationInspection = await executeDockerOrganizationAttachment({
|
|
134
|
+
args: [...target, "container", "inspect", "--format",
|
|
135
|
+
organizationTopologyInspectionFormat(organization.network.name), organization.containerId],
|
|
136
|
+
executor: options.attachmentExecutor,
|
|
137
|
+
timeoutMs: options.timeoutMs
|
|
138
|
+
});
|
|
139
|
+
return organizationInspection.stderr === ""
|
|
140
|
+
? parseExpectedOrganizationEgressNetwork(organizationInspection.stdout, organization) : null;
|
|
141
|
+
})();
|
|
142
|
+
if (!egressAfter || egressAfter.id !== egressNetwork.id || egressAfter.name !== egressNetwork.name
|
|
143
|
+
|| egressAfter.dataNetworkId !== binding.data_network.id)
|
|
144
|
+
return fail("organization_topology_changed");
|
|
145
|
+
const worldSpec = worldServiceSpecForBinding(world);
|
|
146
|
+
if (worldSpec.resultHandle !== world.world_service_handle)
|
|
147
|
+
return fail("world_service_handle_mismatch");
|
|
148
|
+
const worldInspection = await executeDockerWorldService({
|
|
149
|
+
args: [...target, "container", "inspect", "--format",
|
|
150
|
+
worldSpec.inspectionFormat, world.container_id],
|
|
151
|
+
executor: options.worldExecutor,
|
|
152
|
+
timeoutMs: options.timeoutMs
|
|
153
|
+
});
|
|
154
|
+
if (worldInspection.stderr !== "") {
|
|
155
|
+
return fail(`world_service_inspection_stderr:${boundedRedactedText(worldInspection.stderr)}`);
|
|
156
|
+
}
|
|
157
|
+
let parsedWorld;
|
|
158
|
+
try {
|
|
159
|
+
parsedWorld = parseExpectedDockerWorldService(worldInspection.stdout, worldSpec);
|
|
160
|
+
}
|
|
161
|
+
catch {
|
|
162
|
+
parsedWorld = null;
|
|
163
|
+
}
|
|
164
|
+
if (!parsedWorld)
|
|
165
|
+
return fail("world_service_inspection_unparseable");
|
|
166
|
+
if (parsedWorld.status !== "running")
|
|
167
|
+
return fail("world_service_status_mismatch");
|
|
168
|
+
if (parsedWorld.containerId !== world.container_id)
|
|
169
|
+
return fail("world_service_container_id_mismatch");
|
|
170
|
+
if (parsedWorld.networkId !== binding.data_network.id)
|
|
171
|
+
return fail("world_service_network_id_mismatch");
|
|
172
|
+
const finalNetworkInspection = await executeDockerOrganizationAttachment({
|
|
173
|
+
args: [...target, "network", "inspect", "--format",
|
|
174
|
+
ORGANIZATION_NETWORK_INSPECTION_FORMAT, organization.network.name],
|
|
175
|
+
executor: options.attachmentExecutor,
|
|
176
|
+
timeoutMs: options.timeoutMs
|
|
177
|
+
});
|
|
178
|
+
if (finalNetworkInspection.stderr !== ""
|
|
179
|
+
|| parseExpectedOrganizationNetwork(finalNetworkInspection.stdout, organization) !== binding.data_network.id)
|
|
180
|
+
return fail("final_data_network_mismatch");
|
|
181
|
+
};
|
|
182
|
+
const inspect = async (request, binding, world, options, afterProof) => {
|
|
183
|
+
const snapshot = await bindSelectedTarget(request, options);
|
|
184
|
+
try {
|
|
185
|
+
await inspectBound(request, binding, world, snapshot.args, options);
|
|
186
|
+
return await afterProof?.(snapshot.args);
|
|
187
|
+
}
|
|
188
|
+
finally {
|
|
189
|
+
await snapshot.dispose();
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
const receiptFor = (request) => {
|
|
193
|
+
const body = {
|
|
194
|
+
descriptor_digest: request.descriptor_digest,
|
|
195
|
+
handoff_scope: "organization_to_private_service",
|
|
196
|
+
organization: { data_network_attachment: "exact", egress_policy: "egress_only" },
|
|
197
|
+
receipt_digest: `sha256:${"0".repeat(64)}`,
|
|
198
|
+
request_digest: createTargetTopologyAttestationRequestDigest(request),
|
|
199
|
+
run_id: request.run_id,
|
|
200
|
+
selected_target: request.selected_target,
|
|
201
|
+
service_discovery: "dns_only",
|
|
202
|
+
version: "spawnfile.target-topology-receipt.v1",
|
|
203
|
+
world_network: "private_internal",
|
|
204
|
+
world_service: {
|
|
205
|
+
data_network_attachment: "exactly_one",
|
|
206
|
+
egress_policy: "none",
|
|
207
|
+
published_ports: "none"
|
|
208
|
+
}
|
|
209
|
+
};
|
|
210
|
+
const receipt = {
|
|
211
|
+
...body,
|
|
212
|
+
receipt_digest: createTargetTopologyReceiptDigest(body)
|
|
213
|
+
};
|
|
214
|
+
const bytes = createCanonicalTargetTopologyReceiptBytes(receipt);
|
|
215
|
+
return Object.freeze({ receipt, receiptBytes: bytes });
|
|
216
|
+
};
|
|
217
|
+
/**
|
|
218
|
+
* Builds the read-only owner endpoint. The only caller-controlled input is a
|
|
219
|
+
* public correlation packet; all topology facts come from exact completed
|
|
220
|
+
* journal records, private capability stores and bounded Docker projections.
|
|
221
|
+
*/
|
|
222
|
+
export const createTargetTopologyAttestor = (raw) => {
|
|
223
|
+
const names = [
|
|
224
|
+
"attachmentExecutor", "attachmentStore", "context", "resolveJournal",
|
|
225
|
+
"resourceExecutor", "timeoutMs", "worldExecutor", "worldStore"
|
|
226
|
+
];
|
|
227
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw) || nodeTypes.isProxy(raw)
|
|
228
|
+
|| Object.getPrototypeOf(raw) !== Object.prototype)
|
|
229
|
+
return fail("invalid_attestor_options");
|
|
230
|
+
const keys = Reflect.ownKeys(raw);
|
|
231
|
+
const descriptors = Object.getOwnPropertyDescriptors(raw);
|
|
232
|
+
if (keys.length !== names.length || keys.some((key) => typeof key !== "string" || !names.includes(key))
|
|
233
|
+
|| names.some((key) => !Object.hasOwn(descriptors, key))
|
|
234
|
+
|| Object.values(descriptors).some((descriptor) => !descriptor.enumerable || !("value" in descriptor)))
|
|
235
|
+
return fail("invalid_attestor_shape");
|
|
236
|
+
const value = Object.fromEntries(names.map((name) => [name, descriptors[name].value]));
|
|
237
|
+
if (typeof value.resolveJournal !== "function" || typeof value.resourceExecutor !== "function"
|
|
238
|
+
|| typeof value.attachmentExecutor !== "function" || typeof value.worldExecutor !== "function"
|
|
239
|
+
|| !value.attachmentStore || typeof value.attachmentStore.loadAttachment !== "function"
|
|
240
|
+
|| !value.worldStore || typeof value.worldStore.loadService !== "function")
|
|
241
|
+
return fail("invalid_attestor_dependencies");
|
|
242
|
+
const options = Object.freeze({ ...value, context: context(value.context), timeoutMs: timeout(value.timeoutMs) });
|
|
243
|
+
const prove = async (rawRequest, afterProof) => {
|
|
244
|
+
const request = parseTargetTopologyAttestationRequest(rawRequest);
|
|
245
|
+
const journal = await options.resolveJournal({
|
|
246
|
+
descriptorDigest: request.descriptor_digest,
|
|
247
|
+
runId: request.run_id,
|
|
248
|
+
selectedTarget: request.selected_target
|
|
249
|
+
});
|
|
250
|
+
return journal.withLifecycleLease(async () => {
|
|
251
|
+
await Promise.all([
|
|
252
|
+
completed(journal, request, request.data_network, "create_data_network"),
|
|
253
|
+
completed(journal, request, request.organization_attachment, "attach_organization"),
|
|
254
|
+
completed(journal, request, request.world_service.create, "create_world_service"),
|
|
255
|
+
completed(journal, request, request.world_service.start, "start_world_service")
|
|
256
|
+
]);
|
|
257
|
+
const [attachment, world] = await Promise.all([
|
|
258
|
+
options.attachmentStore.loadAttachment(request.organization_attachment.result_handle),
|
|
259
|
+
options.worldStore.loadService(request.world_service.create.result_handle)
|
|
260
|
+
]);
|
|
261
|
+
validateAttachment(attachment, request);
|
|
262
|
+
validateWorldService(world, request);
|
|
263
|
+
const topology = receiptFor(request);
|
|
264
|
+
const result = await inspect(request, attachment, world, options, (target) => afterProof(request, topology, world, target));
|
|
265
|
+
if (result === undefined)
|
|
266
|
+
return fail("attestation_result_missing");
|
|
267
|
+
return result;
|
|
268
|
+
});
|
|
269
|
+
};
|
|
270
|
+
return Object.freeze({
|
|
271
|
+
activate: async (rawRequest) => {
|
|
272
|
+
try {
|
|
273
|
+
return await prove(rawRequest, async (_request, topology, world, target) => activateDockerWorldService({
|
|
274
|
+
executor: options.worldExecutor,
|
|
275
|
+
target,
|
|
276
|
+
timeoutMs: options.timeoutMs,
|
|
277
|
+
topology: topology.receipt,
|
|
278
|
+
world
|
|
279
|
+
}));
|
|
280
|
+
}
|
|
281
|
+
catch (error) {
|
|
282
|
+
if (error instanceof SpawnfileError
|
|
283
|
+
&& error.message.startsWith(TARGET_TOPOLOGY_ATTESTATION_ERROR))
|
|
284
|
+
throw error;
|
|
285
|
+
return fail("activation_failed");
|
|
286
|
+
}
|
|
287
|
+
},
|
|
288
|
+
attest: async (rawRequest) => {
|
|
289
|
+
try {
|
|
290
|
+
return await prove(rawRequest, async (_request, topology) => topology);
|
|
291
|
+
}
|
|
292
|
+
catch (error) {
|
|
293
|
+
if (error instanceof SpawnfileError
|
|
294
|
+
&& error.message.startsWith(TARGET_TOPOLOGY_ATTESTATION_ERROR))
|
|
295
|
+
throw error;
|
|
296
|
+
return fail("attestation_failed");
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
});
|
|
300
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type TopologyAttestationReason = "invalid_context" | "invalid_timeout" | "journal_receipt_missing" | "receipt_operation_mismatch" | "receipt_operation_handle_mismatch" | "receipt_request_digest_mismatch" | "receipt_result_handle_mismatch" | "run_id_mismatch" | "descriptor_digest_mismatch" | "selected_target_mismatch" | "attachment_binding_mismatch" | "world_service_binding_mismatch" | "data_network_inspection_mismatch" | "organization_egress_missing" | "organization_egress_data_network_mismatch" | "organization_egress_policy_mismatch" | "organization_topology_changed" | "world_service_handle_mismatch" | `world_service_inspection_stderr:${string}` | "world_service_inspection_unparseable" | "world_service_status_mismatch" | "world_service_container_id_mismatch" | "world_service_network_id_mismatch" | `activation_stdout_unexpected:${string}` | `activation_stderr_unexpected:${string}` | "world_service_topology_mismatch" | "final_data_network_mismatch" | "invalid_attestor_options" | "invalid_attestor_shape" | "invalid_attestor_dependencies" | "attestation_result_missing" | "activation_failed" | "attestation_failed";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const TARGET_WORLD_CLOCK_REQUEST_VERSION: "spawnfile.target-world-clock.request.v1";
|
|
3
|
+
export declare const TARGET_WORLD_CLOCK_RECEIPT_VERSION: "spawnfile.target-world-clock-receipt.v1";
|
|
4
|
+
export declare const TARGET_WORLD_CLOCK_PATH: "/v1/world/clock";
|
|
5
|
+
export declare const MAX_TARGET_WORLD_CLOCK_BYTES = 8192;
|
|
6
|
+
export declare const targetWorldClockRequestSchema: z.ZodObject<{
|
|
7
|
+
activation_digest: z.ZodString;
|
|
8
|
+
activation_receipt_digest: z.ZodString;
|
|
9
|
+
descriptor_digest: z.ZodString;
|
|
10
|
+
endpoint: z.ZodObject<{
|
|
11
|
+
internal_port: z.ZodNumber;
|
|
12
|
+
path: z.ZodLiteral<"/v1/world/clock">;
|
|
13
|
+
}, z.core.$strict>;
|
|
14
|
+
expected: z.ZodObject<{
|
|
15
|
+
document_version: z.ZodString;
|
|
16
|
+
world_instance_id: z.ZodPipe<z.ZodString, z.ZodTransform<import("./contracts.js").RunId, string>>;
|
|
17
|
+
}, z.core.$strict>;
|
|
18
|
+
run_id: z.ZodPipe<z.ZodString, z.ZodTransform<import("./contracts.js").RunId, string>>;
|
|
19
|
+
selected_target: z.ZodObject<{
|
|
20
|
+
fingerprint: z.ZodString;
|
|
21
|
+
handle: z.ZodPipe<z.ZodString, z.ZodTransform<import("./contracts.js").OpaqueTargetHandle, string>>;
|
|
22
|
+
}, z.core.$strict>;
|
|
23
|
+
topology_receipt_digest: z.ZodString;
|
|
24
|
+
topology_request_digest: z.ZodString;
|
|
25
|
+
version: z.ZodLiteral<"spawnfile.target-world-clock.request.v1">;
|
|
26
|
+
world_service_handle: z.ZodPipe<z.ZodString, z.ZodTransform<import("./contracts.js").OpaqueTargetHandle, string>>;
|
|
27
|
+
}, z.core.$strict>;
|
|
28
|
+
export declare const targetWorldClockReceiptSchema: z.ZodObject<{
|
|
29
|
+
action_count: z.ZodLiteral<0>;
|
|
30
|
+
activation_digest: z.ZodString;
|
|
31
|
+
activation_receipt_digest: z.ZodString;
|
|
32
|
+
clock: z.ZodObject<{
|
|
33
|
+
completed_tick: z.ZodNumber;
|
|
34
|
+
next_tick: z.ZodNumber;
|
|
35
|
+
state: z.ZodLiteral<"running">;
|
|
36
|
+
}, z.core.$strict>;
|
|
37
|
+
observation_digest: z.ZodString;
|
|
38
|
+
receipt_digest: z.ZodString;
|
|
39
|
+
request_digest: z.ZodString;
|
|
40
|
+
run_id: z.ZodPipe<z.ZodString, z.ZodTransform<import("./contracts.js").RunId, string>>;
|
|
41
|
+
topology_receipt_digest: z.ZodString;
|
|
42
|
+
topology_request_digest: z.ZodString;
|
|
43
|
+
version: z.ZodLiteral<"spawnfile.target-world-clock-receipt.v1">;
|
|
44
|
+
world_instance_id: z.ZodPipe<z.ZodString, z.ZodTransform<import("./contracts.js").RunId, string>>;
|
|
45
|
+
world_service_handle: z.ZodPipe<z.ZodString, z.ZodTransform<import("./contracts.js").OpaqueTargetHandle, string>>;
|
|
46
|
+
}, z.core.$strict>;
|
|
47
|
+
export type TargetWorldClockRequest = z.infer<typeof targetWorldClockRequestSchema>;
|
|
48
|
+
export type TargetWorldClockReceipt = z.infer<typeof targetWorldClockReceiptSchema>;
|
|
49
|
+
export declare const parseTargetWorldClockRequest: (raw: unknown) => TargetWorldClockRequest;
|
|
50
|
+
export declare const createTargetWorldClockRequestDigest: (raw: unknown) => `sha256:${string}`;
|
|
51
|
+
export declare const parseTargetWorldClockReceipt: (raw: unknown) => TargetWorldClockReceipt;
|
|
52
|
+
export declare const createTargetWorldClockReceipt: (input: Readonly<{
|
|
53
|
+
observation: unknown;
|
|
54
|
+
request: unknown;
|
|
55
|
+
}>) => TargetWorldClockReceipt;
|
|
56
|
+
export declare const verifyTargetWorldClockReceipt: (input: Readonly<{
|
|
57
|
+
receipt: unknown;
|
|
58
|
+
request: unknown;
|
|
59
|
+
}>) => TargetWorldClockReceipt;
|
|
60
|
+
export declare const createCanonicalTargetWorldClockReceiptBytes: (raw: unknown) => string;
|