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,302 @@
|
|
|
1
|
+
import { Buffer } from "node:buffer";
|
|
2
|
+
import { createHash } from "node:crypto";
|
|
3
|
+
const BLOCK = 512;
|
|
4
|
+
const MAX_BYTES = 67_108_864;
|
|
5
|
+
const MAX_ENTRIES = 10_000;
|
|
6
|
+
const MAX_DEPTH = 32;
|
|
7
|
+
const MAX_PATH_BYTES = 255;
|
|
8
|
+
const MAX_STORED_BYTES = 256;
|
|
9
|
+
const ZERO = 0;
|
|
10
|
+
const USTAR_MAGIC = Buffer.from("ustar\0", "ascii");
|
|
11
|
+
const USTAR_VERSION = Buffer.from("00", "ascii");
|
|
12
|
+
const fail = (reason = "") => { throw new Error(`Evidence-volume export failed${reason ? ` (${reason})` : ""}`); };
|
|
13
|
+
const isZero = (value) => value.every((byte) => byte === 0);
|
|
14
|
+
const utf8 = (value) => {
|
|
15
|
+
const parsed = Buffer.from(value).toString("utf8");
|
|
16
|
+
if (!Buffer.from(parsed, "utf8").equals(Buffer.from(value)))
|
|
17
|
+
return fail();
|
|
18
|
+
return parsed;
|
|
19
|
+
};
|
|
20
|
+
const isEqual = (left, right) => {
|
|
21
|
+
if (left.byteLength !== right.byteLength)
|
|
22
|
+
return false;
|
|
23
|
+
for (let index = 0; index < left.byteLength; index += 1)
|
|
24
|
+
if (left[index] !== right[index])
|
|
25
|
+
return false;
|
|
26
|
+
return true;
|
|
27
|
+
};
|
|
28
|
+
const pad = (value) => Math.ceil(value / BLOCK) * BLOCK;
|
|
29
|
+
const text = (value, start, length) => {
|
|
30
|
+
const field = value.subarray(start, start + length);
|
|
31
|
+
const nul = field.indexOf(0);
|
|
32
|
+
if (nul < 0)
|
|
33
|
+
return utf8(field);
|
|
34
|
+
for (let index = nul + 1; index < field.length; index += 1) {
|
|
35
|
+
if (field[index] !== 0)
|
|
36
|
+
return fail();
|
|
37
|
+
}
|
|
38
|
+
return utf8(field.subarray(0, nul));
|
|
39
|
+
};
|
|
40
|
+
const parseOctal = (value, start, length) => {
|
|
41
|
+
const field = value.subarray(start, start + length);
|
|
42
|
+
if (field[length - 1] !== ZERO)
|
|
43
|
+
return fail();
|
|
44
|
+
for (let index = 0; index < length - 1; index += 1) {
|
|
45
|
+
const byte = field[index];
|
|
46
|
+
if (byte < 48 || byte > 55)
|
|
47
|
+
return fail();
|
|
48
|
+
}
|
|
49
|
+
const parsed = Number.parseInt(utf8(field.subarray(0, length - 1)), 8);
|
|
50
|
+
if (!Number.isSafeInteger(parsed) || parsed < 0)
|
|
51
|
+
return fail();
|
|
52
|
+
return parsed;
|
|
53
|
+
};
|
|
54
|
+
const parseChecksum = (value) => {
|
|
55
|
+
const field = value.subarray(148, 156);
|
|
56
|
+
if (field[6] !== ZERO || field[7] !== 0x20)
|
|
57
|
+
return fail();
|
|
58
|
+
for (let index = 0; index < 6; index += 1) {
|
|
59
|
+
const byte = field[index];
|
|
60
|
+
if (byte < 48 || byte > 55)
|
|
61
|
+
return fail();
|
|
62
|
+
}
|
|
63
|
+
const parsed = Number.parseInt(utf8(field.subarray(0, 6)), 8);
|
|
64
|
+
if (!Number.isSafeInteger(parsed) || parsed < 0 || parsed > 0o777777)
|
|
65
|
+
return fail();
|
|
66
|
+
return parsed;
|
|
67
|
+
};
|
|
68
|
+
const writeOctal = (value, width) => {
|
|
69
|
+
const raw = value.toString(8);
|
|
70
|
+
if (!Number.isSafeInteger(value) || value < 0 || raw.length > width - 1)
|
|
71
|
+
return fail();
|
|
72
|
+
return Buffer.from(`${raw.padStart(width - 1, "0")}\0`, "ascii");
|
|
73
|
+
};
|
|
74
|
+
const writeChecksum = (header) => {
|
|
75
|
+
let checksum = 0;
|
|
76
|
+
header.fill(0x20, 148, 156);
|
|
77
|
+
for (let index = 0; index < BLOCK; index += 1)
|
|
78
|
+
checksum += header[index];
|
|
79
|
+
if (checksum > 0o777777)
|
|
80
|
+
return fail();
|
|
81
|
+
const field = `${checksum.toString(8).padStart(6, "0")}\0 `;
|
|
82
|
+
header.set(Buffer.from(field, "ascii"), 148);
|
|
83
|
+
};
|
|
84
|
+
const hasFileAncestorOrDescendantConflict = (files, key, directoryMode) => {
|
|
85
|
+
for (const file of files) {
|
|
86
|
+
if (file === key)
|
|
87
|
+
return true;
|
|
88
|
+
if (key.startsWith(`${file}/`))
|
|
89
|
+
return true;
|
|
90
|
+
if (!directoryMode && file.startsWith(`${key}/`))
|
|
91
|
+
return true;
|
|
92
|
+
}
|
|
93
|
+
return false;
|
|
94
|
+
};
|
|
95
|
+
const hasDirectoryConflict = (directories, key) => {
|
|
96
|
+
for (const directory of directories)
|
|
97
|
+
if (directory === key)
|
|
98
|
+
return true;
|
|
99
|
+
return false;
|
|
100
|
+
};
|
|
101
|
+
const splitStored = (stored) => {
|
|
102
|
+
const storedBytes = Buffer.from(stored, "utf8");
|
|
103
|
+
if (storedBytes.byteLength <= 100)
|
|
104
|
+
return Object.freeze({ prefix: "", name: stored });
|
|
105
|
+
if (storedBytes.byteLength > MAX_STORED_BYTES)
|
|
106
|
+
return fail();
|
|
107
|
+
let split = -1;
|
|
108
|
+
for (let index = storedBytes.lastIndexOf(0x2f); index > 0; index = storedBytes.lastIndexOf(0x2f, index - 1)) {
|
|
109
|
+
const prefixLength = index;
|
|
110
|
+
const nameLength = storedBytes.byteLength - index - 1;
|
|
111
|
+
if (prefixLength <= 155 && nameLength <= 100 && nameLength > 0) {
|
|
112
|
+
split = index;
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
if (split < 0)
|
|
117
|
+
return fail();
|
|
118
|
+
return Object.freeze({
|
|
119
|
+
name: storedBytes.subarray(split + 1).toString("utf8"),
|
|
120
|
+
prefix: storedBytes.subarray(0, split).toString("utf8")
|
|
121
|
+
});
|
|
122
|
+
};
|
|
123
|
+
const entryPath = (header) => {
|
|
124
|
+
const name = text(header, 0, 100);
|
|
125
|
+
const prefix = text(header, 345, 155);
|
|
126
|
+
const stored = prefix ? `${prefix}/${name}` : name;
|
|
127
|
+
const canonical = splitStored(stored);
|
|
128
|
+
if (canonical.name !== name || canonical.prefix !== prefix)
|
|
129
|
+
return fail();
|
|
130
|
+
if (!name)
|
|
131
|
+
return fail();
|
|
132
|
+
if (prefix === "" && Buffer.byteLength(stored, "utf8") > 100)
|
|
133
|
+
return fail();
|
|
134
|
+
if (prefix !== "" && (Buffer.byteLength(stored, "utf8") <= 100 || Buffer.byteLength(prefix, "utf8") > 155 || Buffer.byteLength(name, "utf8") > 100))
|
|
135
|
+
return fail();
|
|
136
|
+
if (stored.startsWith("/") || stored.includes("\\") || stored.includes("\0"))
|
|
137
|
+
return fail();
|
|
138
|
+
if (stored.includes("//"))
|
|
139
|
+
return fail();
|
|
140
|
+
const typeByte = header[156];
|
|
141
|
+
const type = typeByte === 48 ? "file" : typeByte === 53 ? "directory" : null;
|
|
142
|
+
if (!type)
|
|
143
|
+
return fail();
|
|
144
|
+
let path;
|
|
145
|
+
if (type === "directory") {
|
|
146
|
+
if (!stored.endsWith("/"))
|
|
147
|
+
return fail();
|
|
148
|
+
path = stored.slice(0, -1);
|
|
149
|
+
if (path === "" || path.endsWith("/"))
|
|
150
|
+
return fail();
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
if (stored.endsWith("/"))
|
|
154
|
+
return fail();
|
|
155
|
+
path = stored;
|
|
156
|
+
}
|
|
157
|
+
if (path === "" || Buffer.byteLength(path, "utf8") > MAX_PATH_BYTES)
|
|
158
|
+
return fail();
|
|
159
|
+
const parts = path.split("/");
|
|
160
|
+
if (parts.length > MAX_DEPTH || parts.some((part) => part === "" || part === "." || part === ".."))
|
|
161
|
+
return fail();
|
|
162
|
+
for (const part of parts) {
|
|
163
|
+
for (let index = 0; index < part.length; index += 1) {
|
|
164
|
+
const code = part.charCodeAt(index);
|
|
165
|
+
if (code < 0x20 || code === 0x7f)
|
|
166
|
+
return fail();
|
|
167
|
+
}
|
|
168
|
+
if (part.includes("\\") || part.includes("\0"))
|
|
169
|
+
return fail();
|
|
170
|
+
}
|
|
171
|
+
return Object.freeze({ path, stored, type });
|
|
172
|
+
};
|
|
173
|
+
const rebuildHeader = (entry) => {
|
|
174
|
+
const out = Buffer.alloc(BLOCK);
|
|
175
|
+
const split = splitStored(entry.stored);
|
|
176
|
+
out.set(Buffer.from(split.name, "utf8"), 0);
|
|
177
|
+
out.set(writeOctal(entry.type === "directory" ? 0o755 : 0o644, 8), 100);
|
|
178
|
+
out.set(writeOctal(0, 8), 108);
|
|
179
|
+
out.set(writeOctal(0, 8), 116);
|
|
180
|
+
out.set(writeOctal(entry.size, 12), 124);
|
|
181
|
+
out.set(writeOctal(0, 12), 136);
|
|
182
|
+
out[156] = entry.type === "directory" ? 53 : 48;
|
|
183
|
+
out.set(USTAR_MAGIC, 257);
|
|
184
|
+
out.set(USTAR_VERSION, 263);
|
|
185
|
+
if (split.prefix)
|
|
186
|
+
out.set(Buffer.from(split.prefix, "utf8"), 345);
|
|
187
|
+
out.set(writeOctal(0, 8), 329);
|
|
188
|
+
out.set(writeOctal(0, 8), 337);
|
|
189
|
+
writeChecksum(out);
|
|
190
|
+
return out;
|
|
191
|
+
};
|
|
192
|
+
const rebuildArchive = (entries) => {
|
|
193
|
+
const output = [];
|
|
194
|
+
const sorted = [...entries].sort((left, right) => {
|
|
195
|
+
const pathOrder = Buffer.compare(Buffer.from(left.path, "utf8"), Buffer.from(right.path, "utf8"));
|
|
196
|
+
return pathOrder !== 0 ? pathOrder : 0;
|
|
197
|
+
});
|
|
198
|
+
for (const entry of sorted) {
|
|
199
|
+
output.push(rebuildHeader(entry));
|
|
200
|
+
if (entry.size > 0) {
|
|
201
|
+
const data = Buffer.alloc(pad(entry.size));
|
|
202
|
+
data.set(Buffer.from(entry.bytes));
|
|
203
|
+
output.push(data);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
output.push(Buffer.alloc(BLOCK), Buffer.alloc(BLOCK));
|
|
207
|
+
return Buffer.concat(output);
|
|
208
|
+
};
|
|
209
|
+
/** Parses evidence archives as strict canonical USTAR. */
|
|
210
|
+
export const canonicalEvidenceArchive = (raw) => {
|
|
211
|
+
if (!(raw instanceof Uint8Array) || raw.byteLength < BLOCK * 2 || raw.byteLength > MAX_BYTES || raw.byteLength % BLOCK !== 0)
|
|
212
|
+
return fail();
|
|
213
|
+
const files = new Set();
|
|
214
|
+
const directories = new Set();
|
|
215
|
+
const entries = [];
|
|
216
|
+
let offset = 0;
|
|
217
|
+
let itemCount = 0;
|
|
218
|
+
while (offset < raw.byteLength) {
|
|
219
|
+
const header = raw.subarray(offset, offset + BLOCK);
|
|
220
|
+
if (header.byteLength !== BLOCK)
|
|
221
|
+
return fail();
|
|
222
|
+
offset += BLOCK;
|
|
223
|
+
if (isZero(header)) {
|
|
224
|
+
if (itemCount === 0 || offset + BLOCK > raw.byteLength)
|
|
225
|
+
return fail();
|
|
226
|
+
if (!isZero(raw.subarray(offset, offset + BLOCK)))
|
|
227
|
+
return fail();
|
|
228
|
+
offset += BLOCK;
|
|
229
|
+
if (offset !== raw.byteLength)
|
|
230
|
+
return fail();
|
|
231
|
+
const inventory = entries.filter((entry) => entry.type === "file")
|
|
232
|
+
.sort((left, right) => Buffer.compare(Buffer.from(left.path), Buffer.from(right.path)))
|
|
233
|
+
.map((entry) => Object.freeze({
|
|
234
|
+
bytes: entry.size,
|
|
235
|
+
path: entry.path,
|
|
236
|
+
sha256: `sha256:${createHash("sha256").update(entry.bytes).digest("hex")}`
|
|
237
|
+
}));
|
|
238
|
+
return Object.freeze({ bytes: rebuildArchive(entries), files: Object.freeze(inventory), itemCount });
|
|
239
|
+
}
|
|
240
|
+
if (!isEqual(header.subarray(257, 263), USTAR_MAGIC))
|
|
241
|
+
return fail();
|
|
242
|
+
if (header[263] !== 48 || header[264] !== 48)
|
|
243
|
+
return fail();
|
|
244
|
+
if (!isZero(header.subarray(157, 257)))
|
|
245
|
+
return fail();
|
|
246
|
+
const claimedChecksum = parseChecksum(header);
|
|
247
|
+
let actualChecksum = 0;
|
|
248
|
+
for (let index = 0; index < BLOCK; index += 1) {
|
|
249
|
+
actualChecksum += index >= 148 && index < 156 ? 0x20 : header[index];
|
|
250
|
+
}
|
|
251
|
+
if (actualChecksum !== claimedChecksum)
|
|
252
|
+
return fail();
|
|
253
|
+
const mode = parseOctal(header, 100, 8);
|
|
254
|
+
const uid = parseOctal(header, 108, 8);
|
|
255
|
+
const gid = parseOctal(header, 116, 8);
|
|
256
|
+
const size = parseOctal(header, 124, 12);
|
|
257
|
+
const mtime = parseOctal(header, 136, 12);
|
|
258
|
+
if (uid !== 0 || gid !== 0 || mtime !== 0)
|
|
259
|
+
return fail();
|
|
260
|
+
const metadata = entryPath(header);
|
|
261
|
+
if (metadata.type === "directory") {
|
|
262
|
+
if (hasDirectoryConflict(directories, metadata.path))
|
|
263
|
+
return fail();
|
|
264
|
+
if (hasFileAncestorOrDescendantConflict(files, metadata.path, true))
|
|
265
|
+
return fail();
|
|
266
|
+
if (mode !== 0o755 || size !== 0)
|
|
267
|
+
return fail();
|
|
268
|
+
}
|
|
269
|
+
else {
|
|
270
|
+
if (hasFileAncestorOrDescendantConflict(files, metadata.path, false))
|
|
271
|
+
return fail();
|
|
272
|
+
if (hasDirectoryConflict(directories, metadata.path))
|
|
273
|
+
return fail();
|
|
274
|
+
if (mode !== 0o644 || size > MAX_BYTES)
|
|
275
|
+
return fail();
|
|
276
|
+
}
|
|
277
|
+
if (text(header, 265, 32) !== "" || text(header, 297, 32) !== "")
|
|
278
|
+
return fail();
|
|
279
|
+
if (parseOctal(header, 329, 8) !== 0 || parseOctal(header, 337, 8) !== 0)
|
|
280
|
+
return fail();
|
|
281
|
+
if (!isZero(header.subarray(500, 512)))
|
|
282
|
+
return fail();
|
|
283
|
+
if (metadata.type === "file")
|
|
284
|
+
files.add(metadata.path);
|
|
285
|
+
else
|
|
286
|
+
directories.add(metadata.path);
|
|
287
|
+
if (itemCount >= MAX_ENTRIES)
|
|
288
|
+
return fail();
|
|
289
|
+
itemCount += 1;
|
|
290
|
+
const dataEnd = offset + size;
|
|
291
|
+
if (dataEnd > raw.byteLength)
|
|
292
|
+
return fail();
|
|
293
|
+
const paddedEnd = offset + pad(size);
|
|
294
|
+
if (paddedEnd > raw.byteLength)
|
|
295
|
+
return fail();
|
|
296
|
+
if (!isZero(raw.subarray(dataEnd, paddedEnd)))
|
|
297
|
+
return fail();
|
|
298
|
+
entries.push(Object.freeze({ bytes: raw.subarray(offset, dataEnd), path: metadata.path, size, stored: metadata.stored, type: metadata.type }));
|
|
299
|
+
offset = paddedEnd;
|
|
300
|
+
}
|
|
301
|
+
return fail();
|
|
302
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const TARGET_EXPORT_INDEX_VERSION: "spawnfile.target-resource.export-index.v1";
|
|
3
|
+
export declare const targetResourceExportIndexSchema: z.ZodObject<{
|
|
4
|
+
evidence_digest: z.ZodString;
|
|
5
|
+
export_handle: z.ZodString;
|
|
6
|
+
files: z.ZodArray<z.ZodObject<{
|
|
7
|
+
bytes: z.ZodNumber;
|
|
8
|
+
path: z.ZodUnion<[z.ZodString, z.ZodLiteral<".spawnfile/world-service-activated.v1">]>;
|
|
9
|
+
sha256: z.ZodString;
|
|
10
|
+
}, z.core.$strict>>;
|
|
11
|
+
item_count: z.ZodNumber;
|
|
12
|
+
labels: z.ZodArray<z.ZodObject<{
|
|
13
|
+
key: z.ZodString;
|
|
14
|
+
value: z.ZodString;
|
|
15
|
+
}, z.core.$strict>>;
|
|
16
|
+
run_id: z.ZodString;
|
|
17
|
+
source: z.ZodObject<{
|
|
18
|
+
evidence_volume_handle: z.ZodString;
|
|
19
|
+
state: z.ZodLiteral<"preserved">;
|
|
20
|
+
}, z.core.$strict>;
|
|
21
|
+
state: z.ZodEnum<{
|
|
22
|
+
exported: "exported";
|
|
23
|
+
incomplete: "incomplete";
|
|
24
|
+
}>;
|
|
25
|
+
version: z.ZodLiteral<"spawnfile.target-resource.export-index.v1">;
|
|
26
|
+
}, z.core.$strict>;
|
|
27
|
+
export type TargetResourceExportIndex = z.infer<typeof targetResourceExportIndexSchema>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Buffer } from "node:buffer";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
export const TARGET_EXPORT_INDEX_VERSION = "spawnfile.target-resource.export-index.v1";
|
|
4
|
+
const digest = z.string().regex(/^sha256:[0-9a-f]{64}$/u);
|
|
5
|
+
const handle = z.string().regex(/^opaque_[a-z0-9]{16,64}$/u);
|
|
6
|
+
const label = z.object({
|
|
7
|
+
key: z.string().regex(/^[a-z][a-z0-9_-]{0,63}$/u),
|
|
8
|
+
value: z.string().regex(/^[a-z][a-z0-9_-]{0,63}$/u)
|
|
9
|
+
}).strict();
|
|
10
|
+
const activationMarker = ".spawnfile/world-service-activated.v1";
|
|
11
|
+
const path = z.string().max(255).regex(/^[A-Za-z0-9][A-Za-z0-9._/-]*$/u)
|
|
12
|
+
.or(z.literal(activationMarker))
|
|
13
|
+
.refine((value) => !value.includes("//")
|
|
14
|
+
&& !value.split("/").some((part) => part === "." || part === ".."));
|
|
15
|
+
const runId = z.string().regex(/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/u)
|
|
16
|
+
.refine((value) => Buffer.byteLength(value, "utf8") <= 128);
|
|
17
|
+
export const targetResourceExportIndexSchema = z.object({
|
|
18
|
+
evidence_digest: digest,
|
|
19
|
+
export_handle: handle,
|
|
20
|
+
files: z.array(z.object({
|
|
21
|
+
bytes: z.number().int().min(0).max(67_108_864), path, sha256: digest
|
|
22
|
+
}).strict()).max(10_000),
|
|
23
|
+
item_count: z.number().int().min(0).max(10_000),
|
|
24
|
+
labels: z.array(label).max(16),
|
|
25
|
+
run_id: runId,
|
|
26
|
+
source: z.object({ evidence_volume_handle: handle, state: z.literal("preserved") }).strict(),
|
|
27
|
+
state: z.enum(["exported", "incomplete"]),
|
|
28
|
+
version: z.literal(TARGET_EXPORT_INDEX_VERSION)
|
|
29
|
+
}).strict().superRefine((value, context) => {
|
|
30
|
+
const paths = value.files.map((file) => file.path);
|
|
31
|
+
if (value.item_count !== value.files.length)
|
|
32
|
+
context.addIssue({
|
|
33
|
+
code: z.ZodIssueCode.custom, message: "evidence export item count is invalid"
|
|
34
|
+
});
|
|
35
|
+
if (new Set(paths).size !== paths.length
|
|
36
|
+
|| paths.some((entry, index) => index > 0 && paths[index - 1] >= entry))
|
|
37
|
+
context.addIssue({
|
|
38
|
+
code: z.ZodIssueCode.custom, message: "evidence export file inventory is invalid"
|
|
39
|
+
});
|
|
40
|
+
});
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { type EvidenceExportAdmission, type EvidenceExportAuthorityStoreOptions } from "./evidenceExportStore.js";
|
|
2
|
+
import { type TargetJournalStore } from "./journal.js";
|
|
3
|
+
export declare const root: () => Promise<string>;
|
|
4
|
+
export declare const cleanupTestRoots: () => Promise<void>;
|
|
5
|
+
declare const admission: () => EvidenceExportAdmission;
|
|
6
|
+
export { admission };
|
|
7
|
+
declare const complete: (journal: TargetJournalStore, claim: {
|
|
8
|
+
operationHandle: string;
|
|
9
|
+
requestDigest: string;
|
|
10
|
+
}, request: Record<string, unknown>, spec: {
|
|
11
|
+
labels: Record<string, string>;
|
|
12
|
+
resultHandle: string;
|
|
13
|
+
}) => Promise<void>;
|
|
14
|
+
export { complete };
|
|
15
|
+
export declare const header: (name: string, data: Uint8Array) => Buffer;
|
|
16
|
+
export interface LifecycleExportFixture {
|
|
17
|
+
readonly calls: string[][];
|
|
18
|
+
readonly directory: string;
|
|
19
|
+
readonly execute: (destination?: string) => Promise<unknown>;
|
|
20
|
+
readonly executeDistinct: (destination?: string) => Promise<unknown>;
|
|
21
|
+
readonly executeReplayWithBlockedExecutors: (destination?: string) => Promise<{
|
|
22
|
+
readonly dockerCalls: number;
|
|
23
|
+
readonly exportCalls: number;
|
|
24
|
+
readonly result: unknown;
|
|
25
|
+
}>;
|
|
26
|
+
readonly rejectReplayWithWrongHelperRequest: (destination?: string) => Promise<{
|
|
27
|
+
readonly dockerCalls: number;
|
|
28
|
+
readonly error: unknown;
|
|
29
|
+
readonly exportCalls: number;
|
|
30
|
+
}>;
|
|
31
|
+
readonly recover: (destination?: string) => Promise<unknown>;
|
|
32
|
+
readonly recoverDistinct: (destination?: string) => Promise<unknown>;
|
|
33
|
+
readonly recoverPeer: (destination?: string) => Promise<unknown>;
|
|
34
|
+
readonly seedStaleExportClaim: () => Promise<void>;
|
|
35
|
+
readonly setHelperInspectionDrift: (value: boolean) => void;
|
|
36
|
+
readonly setVolumeInspectionDrift: (value: boolean) => void;
|
|
37
|
+
readonly getContainerName: () => string | undefined;
|
|
38
|
+
readonly getExportCalls: () => number;
|
|
39
|
+
readonly getRemoveCalls: () => number;
|
|
40
|
+
readonly getRemoveArgs: () => string[][];
|
|
41
|
+
readonly getExportStorePath: () => string;
|
|
42
|
+
readonly readJournalRevision: () => Promise<number>;
|
|
43
|
+
}
|
|
44
|
+
export interface LifecycleExportInput {
|
|
45
|
+
readonly createShouldFail?: boolean;
|
|
46
|
+
readonly createDestinationStoreOptions?: EvidenceExportAuthorityStoreOptions;
|
|
47
|
+
readonly foreignInspect?: "projection" | "transport" | false;
|
|
48
|
+
readonly startShouldFail?: boolean;
|
|
49
|
+
readonly cleanupShouldFail?: boolean;
|
|
50
|
+
readonly boundaryFailures?: {
|
|
51
|
+
readonly beforeBindAdmission?: () => Promise<void> | void;
|
|
52
|
+
readonly beforeBindDestination?: () => Promise<void> | void;
|
|
53
|
+
readonly beforeIndexLoad?: () => Promise<void> | void;
|
|
54
|
+
readonly beforeIndexBind?: () => Promise<void> | void;
|
|
55
|
+
readonly beforeArchive?: () => Promise<void> | void;
|
|
56
|
+
readonly beforePublishTempWrite?: () => Promise<void> | void;
|
|
57
|
+
readonly beforePublishTempOpen?: (temporary: string) => Promise<void> | void;
|
|
58
|
+
readonly beforePublishTempSync?: () => Promise<void> | void;
|
|
59
|
+
readonly beforePublishFinalLink?: () => Promise<void> | void;
|
|
60
|
+
readonly beforePublishDirectorySync?: () => Promise<void> | void;
|
|
61
|
+
readonly beforeJournalComplete?: () => Promise<void> | void;
|
|
62
|
+
readonly beforeRequireDestination?: () => Promise<void> | void;
|
|
63
|
+
};
|
|
64
|
+
readonly onLoadIndex?: () => Promise<void> | void;
|
|
65
|
+
readonly payload?: Uint8Array;
|
|
66
|
+
}
|
|
67
|
+
export declare const runLifecycleExport: (input?: LifecycleExportInput) => Promise<LifecycleExportFixture>;
|
|
68
|
+
export declare const helperProjection: (args: string[], volumeName: string, imageLabels: Record<string, string>, mutate?: (value: {
|
|
69
|
+
Config: {
|
|
70
|
+
Entrypoint: unknown;
|
|
71
|
+
Cmd: unknown;
|
|
72
|
+
Env: unknown;
|
|
73
|
+
ExposedPorts: unknown;
|
|
74
|
+
Healthcheck: unknown;
|
|
75
|
+
Image: unknown;
|
|
76
|
+
Labels: Record<string, string>;
|
|
77
|
+
User: unknown;
|
|
78
|
+
Volumes: unknown;
|
|
79
|
+
};
|
|
80
|
+
HostConfig: Record<string, unknown>;
|
|
81
|
+
Mounts: Array<{
|
|
82
|
+
Type: string;
|
|
83
|
+
Name: string;
|
|
84
|
+
Destination: string;
|
|
85
|
+
RW: boolean;
|
|
86
|
+
}>;
|
|
87
|
+
}) => void) => string;
|