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,103 @@
|
|
|
1
|
+
import { readdir, readFile } from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import * as ts from "typescript";
|
|
4
|
+
const normalize = (value) => value.replace(/\\/g, "/");
|
|
5
|
+
const fixturePath = (value) => {
|
|
6
|
+
const normalized = normalize(value);
|
|
7
|
+
const index = normalized.toLowerCase().indexOf("ecosystem/simfile/fixtures");
|
|
8
|
+
if (index < 0 || (index > 0 && !/[\\/]/u.test(normalized[index - 1])))
|
|
9
|
+
return null;
|
|
10
|
+
return normalized.slice(index);
|
|
11
|
+
};
|
|
12
|
+
const aliasesFor = (sourceFile) => {
|
|
13
|
+
const namespaceAliases = new Set();
|
|
14
|
+
const functionAliases = new Map();
|
|
15
|
+
for (const statement of sourceFile.statements) {
|
|
16
|
+
if (!ts.isImportDeclaration(statement) || !ts.isStringLiteral(statement.moduleSpecifier)
|
|
17
|
+
|| !["node:path", "path"].includes(statement.moduleSpecifier.text))
|
|
18
|
+
continue;
|
|
19
|
+
const clause = statement.importClause;
|
|
20
|
+
if (!clause)
|
|
21
|
+
continue;
|
|
22
|
+
if (clause.name)
|
|
23
|
+
namespaceAliases.add(clause.name.text);
|
|
24
|
+
if (!clause.namedBindings)
|
|
25
|
+
continue;
|
|
26
|
+
if (ts.isNamespaceImport(clause.namedBindings))
|
|
27
|
+
namespaceAliases.add(clause.namedBindings.name.text);
|
|
28
|
+
if (ts.isNamedImports(clause.namedBindings)) {
|
|
29
|
+
for (const element of clause.namedBindings.elements) {
|
|
30
|
+
const imported = element.propertyName?.text ?? element.name.text;
|
|
31
|
+
if (imported === "join" || imported === "resolve")
|
|
32
|
+
functionAliases.set(element.name.text, imported);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return { namespaceAliases, functionAliases };
|
|
37
|
+
};
|
|
38
|
+
const pathCallViolations = (node, aliases, sourceFile) => {
|
|
39
|
+
const callee = node.expression;
|
|
40
|
+
let kind = null;
|
|
41
|
+
if (ts.isPropertyAccessExpression(callee) && ts.isIdentifier(callee.expression)
|
|
42
|
+
&& aliases.namespaceAliases.has(callee.expression.text) && ["join", "resolve"].includes(callee.name.text)) {
|
|
43
|
+
kind = callee.name.text;
|
|
44
|
+
}
|
|
45
|
+
else if (ts.isIdentifier(callee)) {
|
|
46
|
+
kind = aliases.functionAliases.get(callee.text) ?? null;
|
|
47
|
+
}
|
|
48
|
+
if (!kind)
|
|
49
|
+
return [];
|
|
50
|
+
const segments = node.arguments.map((argument) => ts.isStringLiteral(argument) || ts.isNoSubstitutionTemplateLiteral(argument) ? normalize(argument.text) : null);
|
|
51
|
+
const start = segments.findIndex((segment, index) => index <= segments.length - 3 && segment === "ecosystem" && segments[index + 1] === "simfile" && segments[index + 2] === "fixtures");
|
|
52
|
+
if (start < 0)
|
|
53
|
+
return [];
|
|
54
|
+
const matchedSegments = [];
|
|
55
|
+
for (const segment of segments.slice(start)) {
|
|
56
|
+
if (segment === null)
|
|
57
|
+
break;
|
|
58
|
+
matchedSegments.push(segment);
|
|
59
|
+
}
|
|
60
|
+
return [{
|
|
61
|
+
file: path.relative(process.cwd(), sourceFile.fileName),
|
|
62
|
+
classification: kind === "join" ? "simfile-scenario-path-join" : "simfile-scenario-path-resolve",
|
|
63
|
+
matchedPath: matchedSegments.join("/")
|
|
64
|
+
}];
|
|
65
|
+
};
|
|
66
|
+
export const scanSimfileFixtureSource = (text, file = "synthetic.ts") => {
|
|
67
|
+
const sourceFile = ts.createSourceFile(file, text, ts.ScriptTarget.ES2022, true, ts.ScriptKind.TS);
|
|
68
|
+
const aliases = aliasesFor(sourceFile);
|
|
69
|
+
const violations = [];
|
|
70
|
+
const visit = (node) => {
|
|
71
|
+
if (ts.isStringLiteral(node) || ts.isNoSubstitutionTemplateLiteral(node)) {
|
|
72
|
+
const matchedPath = fixturePath(node.text);
|
|
73
|
+
if (matchedPath)
|
|
74
|
+
violations.push({ file, classification: "simfile-scenario-direct-literal", matchedPath });
|
|
75
|
+
}
|
|
76
|
+
if (ts.isCallExpression(node))
|
|
77
|
+
violations.push(...pathCallViolations(node, aliases, sourceFile));
|
|
78
|
+
ts.forEachChild(node, visit);
|
|
79
|
+
};
|
|
80
|
+
visit(sourceFile);
|
|
81
|
+
return violations;
|
|
82
|
+
};
|
|
83
|
+
export const scanSimfileFixtureFile = async (file) => scanSimfileFixtureSource(await readFile(file, "utf8"), file);
|
|
84
|
+
const typescriptFiles = async (directory) => {
|
|
85
|
+
const entries = await readdir(directory, { withFileTypes: true });
|
|
86
|
+
const nested = await Promise.all(entries.map(async (entry) => {
|
|
87
|
+
const file = path.join(directory, entry.name);
|
|
88
|
+
if (entry.isDirectory())
|
|
89
|
+
return typescriptFiles(file);
|
|
90
|
+
return entry.isFile() && entry.name.endsWith(".ts") ? [file] : [];
|
|
91
|
+
}));
|
|
92
|
+
return nested.flat();
|
|
93
|
+
};
|
|
94
|
+
export const scanSimfileFixtureTree = async (repositoryRoot) => {
|
|
95
|
+
const excluded = new Set([
|
|
96
|
+
path.resolve(repositoryRoot, "src/deployment/providerRuntimeBoundary.test.ts"),
|
|
97
|
+
path.resolve(repositoryRoot, "src/deployment/simfileFixtureBoundary.test-helper.ts")
|
|
98
|
+
]);
|
|
99
|
+
const files = (await typescriptFiles(path.join(repositoryRoot, "src")))
|
|
100
|
+
.map((file) => path.resolve(file))
|
|
101
|
+
.filter((file) => !excluded.has(file));
|
|
102
|
+
return (await Promise.all(files.map(scanSimfileFixtureFile))).flat();
|
|
103
|
+
};
|
|
@@ -1,35 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
endpoint_fingerprint: string;
|
|
3
|
-
kind: "context";
|
|
4
|
-
name: string;
|
|
5
|
-
} | {
|
|
6
|
-
endpoint_fingerprint: string;
|
|
7
|
-
kind: "docker-context";
|
|
8
|
-
context: string;
|
|
9
|
-
} | {
|
|
10
|
-
kind: "host";
|
|
11
|
-
value: string;
|
|
12
|
-
};
|
|
13
|
-
export type DockerTargetExecFile = (file: string, args: string[], options: {
|
|
14
|
-
timeout: number;
|
|
15
|
-
}) => Promise<{
|
|
16
|
-
stderr: string;
|
|
17
|
-
stdout: string;
|
|
18
|
-
}>;
|
|
19
|
-
export interface ResolveDockerDeploymentTargetOptions {
|
|
20
|
-
context?: string | null;
|
|
21
|
-
dockerCommand?: string;
|
|
22
|
-
dockerHost?: string | null;
|
|
23
|
-
execFile?: DockerTargetExecFile;
|
|
24
|
-
timeoutMs?: number;
|
|
25
|
-
}
|
|
26
|
-
export declare const createEndpointFingerprint: (endpoint: string) => string;
|
|
27
|
-
export declare const createDockerDeploymentTarget: (input: {
|
|
28
|
-
context?: string;
|
|
29
|
-
endpoint?: string;
|
|
30
|
-
host?: string;
|
|
31
|
-
}) => DockerDeploymentTarget;
|
|
32
|
-
export declare const dockerContextNameForTarget: (target: DockerDeploymentTarget) => string | null;
|
|
33
|
-
export declare const dockerHostValueForTarget: (target: DockerDeploymentTarget) => string | null;
|
|
34
|
-
export declare const resolveDockerDeploymentTarget: (input?: ResolveDockerDeploymentTargetOptions) => Promise<DockerDeploymentTarget>;
|
|
35
|
-
export declare const verifyDockerDeploymentTarget: (target: DockerDeploymentTarget, options?: Omit<ResolveDockerDeploymentTargetOptions, "context" | "dockerHost">) => Promise<string | null>;
|
|
1
|
+
export * from "../target/dockerTarget.js";
|
|
@@ -1,96 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { execFile as execFileCallback } from "node:child_process";
|
|
3
|
-
import { promisify } from "node:util";
|
|
4
|
-
import { SpawnfileError } from "../shared/index.js";
|
|
5
|
-
const execFile = promisify(execFileCallback);
|
|
6
|
-
export const createEndpointFingerprint = (endpoint) => {
|
|
7
|
-
const normalized = endpoint.trim();
|
|
8
|
-
if (normalized.length === 0) {
|
|
9
|
-
throw new SpawnfileError("validation_error", "Deployment target endpoint must not be empty");
|
|
10
|
-
}
|
|
11
|
-
return `sha256:${createHash("sha256").update(normalized).digest("hex").slice(0, 32)}`;
|
|
12
|
-
};
|
|
13
|
-
const parseDockerEndpoint = (stdout) => {
|
|
14
|
-
const trimmed = stdout.trim();
|
|
15
|
-
if (trimmed.length === 0) {
|
|
16
|
-
throw new SpawnfileError("runtime_error", "Docker context endpoint was empty");
|
|
17
|
-
}
|
|
18
|
-
try {
|
|
19
|
-
const parsed = JSON.parse(trimmed);
|
|
20
|
-
if (typeof parsed === "string" && parsed.trim().length > 0) {
|
|
21
|
-
return parsed.trim();
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
catch {
|
|
25
|
-
// Docker/podman variants may return a plain string instead of JSON.
|
|
26
|
-
}
|
|
27
|
-
return trimmed;
|
|
28
|
-
};
|
|
29
|
-
const resolveDockerContextEndpoint = async (context, options) => {
|
|
30
|
-
try {
|
|
31
|
-
const { stdout } = await options.execFile(options.dockerCommand, ["context", "inspect", context, "--format", "{{json .Endpoints.docker.Host}}"], { timeout: options.timeoutMs });
|
|
32
|
-
return parseDockerEndpoint(stdout);
|
|
33
|
-
}
|
|
34
|
-
catch (error) {
|
|
35
|
-
const reason = error instanceof Error ? error.message : String(error);
|
|
36
|
-
throw new SpawnfileError("runtime_error", `Unable to resolve Docker context "${context}": ${reason}`);
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
export const createDockerDeploymentTarget = (input) => {
|
|
40
|
-
const host = input.host?.trim();
|
|
41
|
-
if (host) {
|
|
42
|
-
return {
|
|
43
|
-
kind: "host",
|
|
44
|
-
value: host
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
const context = input.context?.trim();
|
|
48
|
-
const endpoint = input.endpoint?.trim();
|
|
49
|
-
if (!context || !endpoint) {
|
|
50
|
-
throw new SpawnfileError("validation_error", "Docker context deployment targets require both context and endpoint");
|
|
51
|
-
}
|
|
52
|
-
return {
|
|
53
|
-
name: context,
|
|
54
|
-
endpoint_fingerprint: createEndpointFingerprint(endpoint),
|
|
55
|
-
kind: "context"
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
export const dockerContextNameForTarget = (target) => target.kind === "context"
|
|
59
|
-
? target.name
|
|
60
|
-
: target.kind === "docker-context"
|
|
61
|
-
? target.context
|
|
62
|
-
: null;
|
|
63
|
-
export const dockerHostValueForTarget = (target) => target.kind === "host" ? target.value : null;
|
|
64
|
-
export const resolveDockerDeploymentTarget = async (input = {}) => {
|
|
65
|
-
const explicitContext = input.context?.trim();
|
|
66
|
-
const host = explicitContext ? undefined : input.dockerHost?.trim() ?? process.env.DOCKER_HOST?.trim();
|
|
67
|
-
if (host) {
|
|
68
|
-
return createDockerDeploymentTarget({ host });
|
|
69
|
-
}
|
|
70
|
-
const resolvedOptions = {
|
|
71
|
-
dockerCommand: input.dockerCommand ?? "docker",
|
|
72
|
-
execFile: input.execFile ?? execFile,
|
|
73
|
-
timeoutMs: input.timeoutMs ?? 10_000
|
|
74
|
-
};
|
|
75
|
-
const context = explicitContext || "default";
|
|
76
|
-
const endpoint = await resolveDockerContextEndpoint(context, resolvedOptions);
|
|
77
|
-
return createDockerDeploymentTarget({ context, endpoint });
|
|
78
|
-
};
|
|
79
|
-
export const verifyDockerDeploymentTarget = async (target, options = {}) => {
|
|
80
|
-
if (target.kind === "host") {
|
|
81
|
-
return null;
|
|
82
|
-
}
|
|
83
|
-
const context = dockerContextNameForTarget(target);
|
|
84
|
-
if (!context) {
|
|
85
|
-
return null;
|
|
86
|
-
}
|
|
87
|
-
const current = await resolveDockerDeploymentTarget({
|
|
88
|
-
...options,
|
|
89
|
-
context
|
|
90
|
-
});
|
|
91
|
-
const currentFingerprint = current.kind === "host" ? null : current.endpoint_fingerprint;
|
|
92
|
-
if (currentFingerprint !== target.endpoint_fingerprint) {
|
|
93
|
-
throw new SpawnfileError("runtime_error", `Docker context "${context}" endpoint changed since deployment`);
|
|
94
|
-
}
|
|
95
|
-
return context;
|
|
96
|
-
};
|
|
1
|
+
export * from "../target/dockerTarget.js";
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { type OrganizationReadiness } from "./organizationReady.js";
|
|
3
|
+
import { type OrganizationHandoff } from "./organizationHandoffTypes.js";
|
|
4
|
+
import { type OpaqueTargetHandle } from "../target/index.js";
|
|
5
|
+
/**
|
|
6
|
+
* `spawnfile.up-receipt.v1` — the machine contract `spawnfile up --json` writes to stdout
|
|
7
|
+
* (contracts.md's Spawnfile up-receipt registry row; Decision 21's Piece 4). It is thin by
|
|
8
|
+
* design: enough for a non-Docker caller (simfile's sim harness, later its supervisor) to
|
|
9
|
+
* drive lifecycle without touching Docker directly, per `contracts.md`'s rule that
|
|
10
|
+
* "Simfile -> spawnfile only through documented CLI + versioned receipts".
|
|
11
|
+
*
|
|
12
|
+
* `compiled_schedule` is populated even though nothing consumes it yet — it freezes the
|
|
13
|
+
* shape simfile's wake-diff (the expected-wake denominator oracle, see contracts.md's
|
|
14
|
+
* `simfile.run-manifest.v1` field notes) will read from later, so the receipt shape does
|
|
15
|
+
* not need to change again when that consumer lands.
|
|
16
|
+
*
|
|
17
|
+
* No credentials/tokens ever belong on this contract (contracts.md: "No credentials in
|
|
18
|
+
* exchanged artifacts") — `moltnet_base_url` is a bare URL, never an auth header/token.
|
|
19
|
+
*/
|
|
20
|
+
export declare const UP_RECEIPT_VERSION: "spawnfile.up-receipt.v1";
|
|
21
|
+
declare const readinessStateSchema: z.ZodUnion<readonly [z.ZodLiteral<"running">, z.ZodLiteral<"exited">, z.ZodLiteral<"unknown">]>;
|
|
22
|
+
export type UpReceiptReadinessState = z.infer<typeof readinessStateSchema>;
|
|
23
|
+
declare const compiledScheduleEntrySchema: z.ZodObject<{
|
|
24
|
+
agent: z.ZodString;
|
|
25
|
+
cron: z.ZodString;
|
|
26
|
+
}, z.core.$strict>;
|
|
27
|
+
export type CompiledScheduleEntry = z.infer<typeof compiledScheduleEntrySchema>;
|
|
28
|
+
/**
|
|
29
|
+
* `{agent, engine}` disclosure entry (Piece 5, Slice B): ground truth for the
|
|
30
|
+
* run-manifest's `pinned-engine` field, so a `scripted` (or any non-default)
|
|
31
|
+
* pi engine is visibly disclosed rather than an invisible test-only branch.
|
|
32
|
+
* Derived in `buildUpReceipt` from the compiled report's
|
|
33
|
+
* `container.runtime_instances[].engine_by_node_id`. Optional on the schema
|
|
34
|
+
* so existing (pre-Piece-5) receipts without this field still validate.
|
|
35
|
+
*/
|
|
36
|
+
declare const compiledEngineEntrySchema: z.ZodObject<{
|
|
37
|
+
agent: z.ZodString;
|
|
38
|
+
engine: z.ZodString;
|
|
39
|
+
}, z.core.$strict>;
|
|
40
|
+
export type CompiledEngineEntry = z.infer<typeof compiledEngineEntrySchema>;
|
|
41
|
+
declare const moltnetReleaseIdentitySchema: z.ZodObject<{
|
|
42
|
+
architecture: z.ZodUnion<readonly [z.ZodLiteral<"amd64">, z.ZodLiteral<"arm64">]>;
|
|
43
|
+
asset: z.ZodString;
|
|
44
|
+
asset_sha256: z.ZodString;
|
|
45
|
+
capabilities: z.ZodTuple<[z.ZodLiteral<"pi-bridge">], null>;
|
|
46
|
+
release_version: z.ZodString;
|
|
47
|
+
source_revision: z.ZodString;
|
|
48
|
+
version: z.ZodLiteral<"spawnfile.moltnet-release-identity.v1">;
|
|
49
|
+
}, z.core.$strict>;
|
|
50
|
+
export type MoltnetReleaseReceiptIdentity = z.infer<typeof moltnetReleaseIdentitySchema>;
|
|
51
|
+
export declare const upReceiptSchema: z.ZodPreprocess<z.ZodObject<{
|
|
52
|
+
version: z.ZodLiteral<"spawnfile.up-receipt.v1">;
|
|
53
|
+
run_id: z.ZodNullable<z.ZodString>;
|
|
54
|
+
fingerprint: z.ZodString;
|
|
55
|
+
deployment: z.ZodObject<{
|
|
56
|
+
name: z.ZodNullable<z.ZodString>;
|
|
57
|
+
container_ids: z.ZodArray<z.ZodString>;
|
|
58
|
+
}, z.core.$strict>;
|
|
59
|
+
readiness: z.ZodObject<{
|
|
60
|
+
state: z.ZodUnion<readonly [z.ZodLiteral<"running">, z.ZodLiteral<"exited">, z.ZodLiteral<"unknown">]>;
|
|
61
|
+
moltnet_base_url: z.ZodNullable<z.ZodString>;
|
|
62
|
+
}, z.core.$strict>;
|
|
63
|
+
compiled_schedule: z.ZodArray<z.ZodObject<{
|
|
64
|
+
agent: z.ZodString;
|
|
65
|
+
cron: z.ZodString;
|
|
66
|
+
}, z.core.$strict>>;
|
|
67
|
+
engines: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
68
|
+
agent: z.ZodString;
|
|
69
|
+
engine: z.ZodString;
|
|
70
|
+
}, z.core.$strict>>>;
|
|
71
|
+
moltnet_release: z.ZodOptional<z.ZodObject<{
|
|
72
|
+
architecture: z.ZodUnion<readonly [z.ZodLiteral<"amd64">, z.ZodLiteral<"arm64">]>;
|
|
73
|
+
asset: z.ZodString;
|
|
74
|
+
asset_sha256: z.ZodString;
|
|
75
|
+
capabilities: z.ZodTuple<[z.ZodLiteral<"pi-bridge">], null>;
|
|
76
|
+
release_version: z.ZodString;
|
|
77
|
+
source_revision: z.ZodString;
|
|
78
|
+
version: z.ZodLiteral<"spawnfile.moltnet-release-identity.v1">;
|
|
79
|
+
}, z.core.$strict>>;
|
|
80
|
+
organization_handoff: z.ZodOptional<z.ZodObject<{
|
|
81
|
+
binding_digest: z.ZodString;
|
|
82
|
+
deployment_handle: z.ZodString;
|
|
83
|
+
lifecycle_receipts: z.ZodObject<{
|
|
84
|
+
down: z.ZodLiteral<"spawnfile.down-receipt.v1">;
|
|
85
|
+
export: z.ZodLiteral<"spawnfile.export-index.v1">;
|
|
86
|
+
up: z.ZodLiteral<"spawnfile.up-receipt.v1">;
|
|
87
|
+
}, z.core.$strict>;
|
|
88
|
+
network_attachment_handle: z.ZodString;
|
|
89
|
+
run_id: z.ZodString;
|
|
90
|
+
selected_target_receipt_digest: z.ZodString;
|
|
91
|
+
version: z.ZodLiteral<"spawnfile.organization-handoff.v1">;
|
|
92
|
+
}, z.core.$strict>>;
|
|
93
|
+
organization_handoff_handle: z.ZodOptional<z.ZodString>;
|
|
94
|
+
organization_ready: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
|
|
95
|
+
code: z.ZodUnion<readonly [z.ZodLiteral<"organization_ready">, z.ZodLiteral<"external_moltnet">, z.ZodLiteral<"compiled_evidence_missing">, z.ZodLiteral<"unit_unavailable">, z.ZodLiteral<"unit_restarted">, z.ZodLiteral<"probe_unavailable">, z.ZodLiteral<"identity_mismatch">, z.ZodLiteral<"topology_mismatch">, z.ZodLiteral<"probe_timeout">, z.ZodLiteral<"probe_cancelled">]>;
|
|
96
|
+
compile_fingerprint: z.ZodString;
|
|
97
|
+
run_id: z.ZodNullable<z.ZodString>;
|
|
98
|
+
state: z.ZodUnion<readonly [z.ZodLiteral<"ready">, z.ZodLiteral<"pending">, z.ZodLiteral<"failed">, z.ZodLiteral<"cancelled">]>;
|
|
99
|
+
unit_id: z.ZodString;
|
|
100
|
+
version: z.ZodLiteral<"spawnfile.organization-ready.v1">;
|
|
101
|
+
world_binding_digest: z.ZodNullable<z.ZodString>;
|
|
102
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
103
|
+
}, z.core.$strict>>>;
|
|
104
|
+
}, z.core.$strict>>;
|
|
105
|
+
export type UpReceipt = Omit<z.infer<typeof upReceiptSchema>, "organization_handoff" | "organization_handoff_handle" | "organization_ready"> & {
|
|
106
|
+
organization_handoff?: OrganizationHandoff;
|
|
107
|
+
organization_handoff_handle?: OpaqueTargetHandle;
|
|
108
|
+
organization_ready?: OrganizationReadiness;
|
|
109
|
+
};
|
|
110
|
+
export declare const parseUpReceipt: (raw: unknown) => UpReceipt;
|
|
111
|
+
export {};
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { organizationReadinessSchema, parseOrganizationReadiness } from "./organizationReady.js";
|
|
3
|
+
import { ORGANIZATION_HANDOFF_VERSION, parseOrganizationHandoff } from "./organizationHandoffTypes.js";
|
|
4
|
+
import { assertOrdinaryJsonGraph, parseOpaqueTargetHandle } from "../target/index.js";
|
|
5
|
+
/**
|
|
6
|
+
* `spawnfile.up-receipt.v1` — the machine contract `spawnfile up --json` writes to stdout
|
|
7
|
+
* (contracts.md's Spawnfile up-receipt registry row; Decision 21's Piece 4). It is thin by
|
|
8
|
+
* design: enough for a non-Docker caller (simfile's sim harness, later its supervisor) to
|
|
9
|
+
* drive lifecycle without touching Docker directly, per `contracts.md`'s rule that
|
|
10
|
+
* "Simfile -> spawnfile only through documented CLI + versioned receipts".
|
|
11
|
+
*
|
|
12
|
+
* `compiled_schedule` is populated even though nothing consumes it yet — it freezes the
|
|
13
|
+
* shape simfile's wake-diff (the expected-wake denominator oracle, see contracts.md's
|
|
14
|
+
* `simfile.run-manifest.v1` field notes) will read from later, so the receipt shape does
|
|
15
|
+
* not need to change again when that consumer lands.
|
|
16
|
+
*
|
|
17
|
+
* No credentials/tokens ever belong on this contract (contracts.md: "No credentials in
|
|
18
|
+
* exchanged artifacts") — `moltnet_base_url` is a bare URL, never an auth header/token.
|
|
19
|
+
*/
|
|
20
|
+
export const UP_RECEIPT_VERSION = "spawnfile.up-receipt.v1";
|
|
21
|
+
const readinessStateSchema = z.union([
|
|
22
|
+
z.literal("running"),
|
|
23
|
+
z.literal("exited"),
|
|
24
|
+
z.literal("unknown")
|
|
25
|
+
]);
|
|
26
|
+
const compiledScheduleEntrySchema = z
|
|
27
|
+
.object({
|
|
28
|
+
agent: z.string().min(1),
|
|
29
|
+
cron: z.string().min(1)
|
|
30
|
+
})
|
|
31
|
+
.strict();
|
|
32
|
+
/**
|
|
33
|
+
* `{agent, engine}` disclosure entry (Piece 5, Slice B): ground truth for the
|
|
34
|
+
* run-manifest's `pinned-engine` field, so a `scripted` (or any non-default)
|
|
35
|
+
* pi engine is visibly disclosed rather than an invisible test-only branch.
|
|
36
|
+
* Derived in `buildUpReceipt` from the compiled report's
|
|
37
|
+
* `container.runtime_instances[].engine_by_node_id`. Optional on the schema
|
|
38
|
+
* so existing (pre-Piece-5) receipts without this field still validate.
|
|
39
|
+
*/
|
|
40
|
+
const compiledEngineEntrySchema = z
|
|
41
|
+
.object({
|
|
42
|
+
agent: z.string().min(1),
|
|
43
|
+
engine: z.string().min(1)
|
|
44
|
+
})
|
|
45
|
+
.strict();
|
|
46
|
+
const moltnetReleaseIdentitySchema = z.object({
|
|
47
|
+
architecture: z.union([z.literal("amd64"), z.literal("arm64")]),
|
|
48
|
+
asset: z.string().regex(/^moltnet_linux_(amd64|arm64)\.tar\.gz$/u),
|
|
49
|
+
asset_sha256: z.string().regex(/^sha256:[a-f0-9]{64}$/u),
|
|
50
|
+
capabilities: z.tuple([z.literal("pi-bridge")]),
|
|
51
|
+
release_version: z.string().regex(/^v?\d+\.\d+\.\d+(?:-\d+-g[a-f0-9]{7,40})?$/u),
|
|
52
|
+
source_revision: z.string().regex(/^[a-f0-9]{40}$/u),
|
|
53
|
+
version: z.literal("spawnfile.moltnet-release-identity.v1")
|
|
54
|
+
}).strict().superRefine((value, context) => {
|
|
55
|
+
if (!value.asset.includes(`_${value.architecture}.`)) {
|
|
56
|
+
context.addIssue({
|
|
57
|
+
code: z.ZodIssueCode.custom,
|
|
58
|
+
path: ["asset"],
|
|
59
|
+
message: "Moltnet asset architecture must match identity architecture"
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
const describedRevision = value.release_version.match(/-g([a-f0-9]{7,40})$/u)?.[1];
|
|
63
|
+
if (describedRevision && !value.source_revision.startsWith(describedRevision)) {
|
|
64
|
+
context.addIssue({
|
|
65
|
+
code: z.ZodIssueCode.custom,
|
|
66
|
+
path: ["source_revision"],
|
|
67
|
+
message: "Moltnet release version must match source revision"
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
const organizationHandoffReceiptSchema = z.object({
|
|
72
|
+
binding_digest: z.string().regex(/^sha256:[a-f0-9]{64}$/u),
|
|
73
|
+
deployment_handle: z.string().regex(/^sf-oh1-[a-f0-9]{64}$/u),
|
|
74
|
+
lifecycle_receipts: z.object({
|
|
75
|
+
down: z.literal("spawnfile.down-receipt.v1"),
|
|
76
|
+
export: z.literal("spawnfile.export-index.v1"),
|
|
77
|
+
up: z.literal(UP_RECEIPT_VERSION)
|
|
78
|
+
}).strict(),
|
|
79
|
+
network_attachment_handle: z.string().regex(/^opaque_[a-z0-9]{16,64}$/u),
|
|
80
|
+
run_id: z.string().min(1),
|
|
81
|
+
selected_target_receipt_digest: z.string().regex(/^sha256:[a-f0-9]{64}$/u),
|
|
82
|
+
version: z.literal(ORGANIZATION_HANDOFF_VERSION)
|
|
83
|
+
}).strict().superRefine((value, context) => {
|
|
84
|
+
try {
|
|
85
|
+
parseOrganizationHandoff(value);
|
|
86
|
+
}
|
|
87
|
+
catch {
|
|
88
|
+
context.addIssue({ code: z.ZodIssueCode.custom, message: "invalid organization handoff" });
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
const INVALID_JSON_GRAPH = Symbol("invalid-json-graph");
|
|
92
|
+
const upReceiptObjectSchema = z
|
|
93
|
+
.object({
|
|
94
|
+
version: z.literal(UP_RECEIPT_VERSION),
|
|
95
|
+
run_id: z.string().min(1).nullable(),
|
|
96
|
+
fingerprint: z.string().min(1),
|
|
97
|
+
deployment: z
|
|
98
|
+
.object({
|
|
99
|
+
name: z.string().min(1).nullable(),
|
|
100
|
+
container_ids: z.array(z.string().min(1))
|
|
101
|
+
})
|
|
102
|
+
.strict(),
|
|
103
|
+
readiness: z
|
|
104
|
+
.object({
|
|
105
|
+
state: readinessStateSchema,
|
|
106
|
+
moltnet_base_url: z.string().min(1).nullable()
|
|
107
|
+
})
|
|
108
|
+
.strict(),
|
|
109
|
+
compiled_schedule: z.array(compiledScheduleEntrySchema),
|
|
110
|
+
engines: z.array(compiledEngineEntrySchema).optional(),
|
|
111
|
+
moltnet_release: moltnetReleaseIdentitySchema.optional(),
|
|
112
|
+
organization_handoff: organizationHandoffReceiptSchema.optional(),
|
|
113
|
+
organization_handoff_handle: z.string().optional(),
|
|
114
|
+
organization_ready: organizationReadinessSchema.optional()
|
|
115
|
+
})
|
|
116
|
+
.strict()
|
|
117
|
+
.superRefine((value, context) => {
|
|
118
|
+
if (value.organization_handoff && (value.run_id === null || value.run_id !== value.organization_handoff.run_id)) {
|
|
119
|
+
context.addIssue({
|
|
120
|
+
code: z.ZodIssueCode.custom,
|
|
121
|
+
path: ["organization_handoff", "run_id"],
|
|
122
|
+
message: "organization handoff run_id must match receipt run_id"
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
if (value.organization_handoff_handle !== undefined) {
|
|
126
|
+
if (!value.organization_handoff) {
|
|
127
|
+
context.addIssue({ code: z.ZodIssueCode.custom, path: ["organization_handoff_handle"], message: "organization handoff handle requires organization handoff" });
|
|
128
|
+
}
|
|
129
|
+
try {
|
|
130
|
+
parseOpaqueTargetHandle(value.organization_handoff_handle);
|
|
131
|
+
}
|
|
132
|
+
catch {
|
|
133
|
+
context.addIssue({ code: z.ZodIssueCode.custom, path: ["organization_handoff_handle"], message: "invalid organization handoff handle" });
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
export const upReceiptSchema = z
|
|
138
|
+
.preprocess((value) => {
|
|
139
|
+
try {
|
|
140
|
+
assertOrdinaryJsonGraph(value);
|
|
141
|
+
return value;
|
|
142
|
+
}
|
|
143
|
+
catch {
|
|
144
|
+
return INVALID_JSON_GRAPH;
|
|
145
|
+
}
|
|
146
|
+
}, upReceiptObjectSchema);
|
|
147
|
+
export const parseUpReceipt = (raw) => {
|
|
148
|
+
try {
|
|
149
|
+
assertOrdinaryJsonGraph(raw);
|
|
150
|
+
const result = upReceiptSchema.safeParse(raw);
|
|
151
|
+
if (!result.success)
|
|
152
|
+
throw new TypeError();
|
|
153
|
+
const { organization_handoff: handoff, organization_handoff_handle: handoffHandle, organization_ready: readiness, ...receipt } = result.data;
|
|
154
|
+
return {
|
|
155
|
+
...receipt,
|
|
156
|
+
...(handoff ? { organization_handoff: parseOrganizationHandoff(handoff) } : {}),
|
|
157
|
+
...(handoffHandle ? { organization_handoff_handle: parseOpaqueTargetHandle(handoffHandle) } : {}),
|
|
158
|
+
...(readiness ? { organization_ready: parseOrganizationReadiness(readiness) } : {})
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
catch {
|
|
162
|
+
throw new Error(`invalid ${UP_RECEIPT_VERSION}`);
|
|
163
|
+
}
|
|
164
|
+
};
|
package/dist/dev/project.js
CHANGED
|
@@ -5,7 +5,6 @@ import { listDeploymentRecords, normalizeDeploymentName } from "../deployment/in
|
|
|
5
5
|
import { SpawnfileError } from "../shared/index.js";
|
|
6
6
|
import { chownContainerPaths, compileForDevApply, copyIntoContainer, defaultExecFile, dockerArgsForRecord, ensureContainerDirectories, firstContainerName, runDocker } from "./docker.js";
|
|
7
7
|
const DEV_OUTPUT_DIRECTORY = ".spawn-dev";
|
|
8
|
-
const PI_APP_CONFIG_PATH = "/var/lib/spawnfile/instances/pi/pi-app/pi/pi-app.json";
|
|
9
8
|
export const PI_CONTROL_URL = "http://127.0.0.1:19690";
|
|
10
9
|
export const resolveDevOutputDirectory = async (inputPath, outputDirectory) => {
|
|
11
10
|
if (outputDirectory) {
|
|
@@ -40,17 +39,24 @@ export const selectDeploymentRecord = async (outputDirectory, deploymentName) =>
|
|
|
40
39
|
const readJson = async (filePath) => JSON.parse(await readFile(filePath, "utf8"));
|
|
41
40
|
const rootfsPath = (outputDirectory, containerPath) => path.join(outputDirectory, "container", "rootfs", containerPath.replace(/^\/+/u, ""));
|
|
42
41
|
const matchesAgent = (agent, input) => agent.slug === input || agent.id === input || agent.name === input || agent.id === `agent:${input}`;
|
|
43
|
-
const selectPiAgent = async (
|
|
44
|
-
const
|
|
42
|
+
const selectPiAgent = async (compileResult, agentInput) => {
|
|
43
|
+
const instance = compileResult.report.container?.runtime_instances.find((candidate) => candidate.id === "pi-app" && ["daimon", "pi"].includes(candidate.runtime));
|
|
44
|
+
if (!instance?.config_path || !instance.workspace_path || !instance.home_path) {
|
|
45
|
+
throw new SpawnfileError("runtime_error", "Compiled output does not contain a generated Daimon runtime instance");
|
|
46
|
+
}
|
|
47
|
+
const configPath = rootfsPath(compileResult.outputDirectory, instance.config_path);
|
|
45
48
|
const config = await readJson(configPath);
|
|
46
49
|
const agent = (config.agents ?? []).find((candidate) => matchesAgent(candidate, agentInput));
|
|
47
50
|
if (!agent) {
|
|
48
|
-
throw new SpawnfileError("validation_error", `
|
|
51
|
+
throw new SpawnfileError("validation_error", `Daimon agent "${agentInput}" was not found in compiled output`);
|
|
49
52
|
}
|
|
50
53
|
return {
|
|
51
54
|
agent,
|
|
52
55
|
configPath,
|
|
53
|
-
|
|
56
|
+
instanceRoot: path.posix.dirname(instance.home_path),
|
|
57
|
+
remoteConfigPath: instance.config_path,
|
|
58
|
+
remoteWorkspaceRoot: `${instance.workspace_path}/agents`,
|
|
59
|
+
workspacePath: rootfsPath(compileResult.outputDirectory, `${instance.workspace_path}/agents/${agent.slug}`)
|
|
54
60
|
};
|
|
55
61
|
};
|
|
56
62
|
const selectMoltnetNodes = async (result, agent) => {
|
|
@@ -113,12 +119,12 @@ export const devApplyProject = async (inputPath, options) => {
|
|
|
113
119
|
const execFileImpl = options.execFile ?? defaultExecFile;
|
|
114
120
|
const existingAgents = await listRunningPiAgents(dockerCommand, dockerPrefix, containerName, execFileImpl);
|
|
115
121
|
const compileResult = await compileForDevApply(inputPath, outputDirectory, record, dockerCommand, execFileImpl);
|
|
116
|
-
const { agent, configPath, workspacePath } = await selectPiAgent(
|
|
122
|
+
const { agent, configPath, instanceRoot, remoteConfigPath, remoteWorkspaceRoot, workspacePath } = await selectPiAgent(compileResult, options.agent);
|
|
117
123
|
const nodes = await selectMoltnetNodes(compileResult, agent);
|
|
118
124
|
const serverConfigs = selectManagedMoltnetServers(compileResult);
|
|
119
125
|
const existingAgent = existingAgents.some((candidate) => matchesAgent(candidate, agent.slug));
|
|
120
|
-
await copyIntoContainer(dockerCommand, dockerPrefix, configPath, `${containerName}:${
|
|
121
|
-
await copyIntoContainer(dockerCommand, dockerPrefix, workspacePath, `${containerName}
|
|
126
|
+
await copyIntoContainer(dockerCommand, dockerPrefix, configPath, `${containerName}:${remoteConfigPath}`, execFileImpl);
|
|
127
|
+
await copyIntoContainer(dockerCommand, dockerPrefix, workspacePath, `${containerName}:${remoteWorkspaceRoot}`, execFileImpl);
|
|
122
128
|
for (const node of nodes) {
|
|
123
129
|
await copyIntoContainer(dockerCommand, dockerPrefix, node.configPath, `${containerName}:${node.remotePath}`, execFileImpl);
|
|
124
130
|
}
|
|
@@ -130,7 +136,7 @@ export const devApplyProject = async (inputPath, options) => {
|
|
|
130
136
|
.filter((directory) => Boolean(directory));
|
|
131
137
|
await ensureContainerDirectories(dockerCommand, dockerPrefix, containerName, tokenDirectories, execFileImpl);
|
|
132
138
|
await chownContainerPaths(dockerCommand, dockerPrefix, containerName, [
|
|
133
|
-
|
|
139
|
+
instanceRoot,
|
|
134
140
|
...nodes.flatMap((node) => [
|
|
135
141
|
node.remotePath,
|
|
136
142
|
...(node.tokenDirectory ? [node.tokenDirectory] : [])
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DistributionImageLabels, DistributionMoltnetNetwork, DistributionOrganizationSummary, DistributionPersistentMount, DistributionPortMapping, DistributionReport, DistributionRuntimeInstance, DistributionSecretCategory, DistributionWorkspaceResource } from "./types.js";
|
|
1
|
+
import type { DistributionImageLabels, DistributionMoltnetNetwork, DistributionOrganizationSummary, DistributionPersistentMount, DistributionPortMapping, DistributionReport, DistributionRuntimeInstance, DistributionSecretCategory, DistributionWorkspaceResource, DistributionWorldBindingsEvidence } from "./types.js";
|
|
2
2
|
export interface DistributionEnvVariableInput {
|
|
3
3
|
categories: DistributionSecretCategory[];
|
|
4
4
|
generated: boolean;
|
|
@@ -17,6 +17,7 @@ export interface BuildDistributionReportInput {
|
|
|
17
17
|
publishedPorts: number[];
|
|
18
18
|
resources: DistributionWorkspaceResource[];
|
|
19
19
|
runtimeInstances: DistributionRuntimeInstance[];
|
|
20
|
+
worldBindings?: DistributionWorldBindingsEvidence;
|
|
20
21
|
}
|
|
21
22
|
export declare const buildDistributionReport: (input: BuildDistributionReportInput) => DistributionReport;
|
|
22
23
|
export declare const createDistributionImageLabels: (projectSlug: string, compileFingerprint: string) => DistributionImageLabels;
|
|
@@ -35,7 +35,8 @@ export const buildDistributionReport = (input) => {
|
|
|
35
35
|
resources: input.resources,
|
|
36
36
|
runtime_instances: [...input.runtimeInstances].sort((left, right) => left.id.localeCompare(right.id)),
|
|
37
37
|
secrets: createSecretCategoryMap(input.envVariables),
|
|
38
|
-
version: DISTRIBUTION_REPORT_VERSION
|
|
38
|
+
version: DISTRIBUTION_REPORT_VERSION,
|
|
39
|
+
...(input.worldBindings ? { world_bindings: input.worldBindings } : {})
|
|
39
40
|
};
|
|
40
41
|
return {
|
|
41
42
|
compile_fingerprint: createDistributionFingerprint(body),
|
|
@@ -80,5 +80,10 @@ export declare const distributionReportSchema: z.ZodObject<{
|
|
|
80
80
|
}, z.core.$strict>>;
|
|
81
81
|
}, z.core.$strict>;
|
|
82
82
|
version: z.ZodLiteral<"spawnfile.distribution-report.v1">;
|
|
83
|
+
world_bindings: z.ZodOptional<z.ZodObject<{
|
|
84
|
+
artifact_path: z.ZodLiteral<"/spawnfile/world-bindings.json">;
|
|
85
|
+
digest: z.ZodString;
|
|
86
|
+
schema: z.ZodLiteral<"simfile.world-bindings.v1">;
|
|
87
|
+
}, z.core.$strict>>;
|
|
83
88
|
}, z.core.$strict>;
|
|
84
89
|
export declare const parseDistributionReport: (source: unknown, sourceLabel?: string) => DistributionReport;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { SpawnfileError } from "../shared/index.js";
|
|
3
|
-
import { DISTRIBUTION_REPORT_VERSION } from "./types.js";
|
|
3
|
+
import { DISTRIBUTION_REPORT_VERSION, WORLD_BINDINGS_IMAGE_PATH } from "./types.js";
|
|
4
4
|
const secretEntrySchema = z.object({
|
|
5
5
|
generated: z.boolean(),
|
|
6
6
|
name: z.string().min(1),
|
|
@@ -96,7 +96,12 @@ export const distributionReportSchema = z.object({
|
|
|
96
96
|
runtime: z.array(secretEntrySchema),
|
|
97
97
|
surface: z.array(secretEntrySchema)
|
|
98
98
|
}).strict(),
|
|
99
|
-
version: z.literal(DISTRIBUTION_REPORT_VERSION)
|
|
99
|
+
version: z.literal(DISTRIBUTION_REPORT_VERSION),
|
|
100
|
+
world_bindings: z.object({
|
|
101
|
+
artifact_path: z.literal(WORLD_BINDINGS_IMAGE_PATH),
|
|
102
|
+
digest: z.string().regex(/^sha256:[a-f0-9]{64}$/u),
|
|
103
|
+
schema: z.literal("simfile.world-bindings.v1")
|
|
104
|
+
}).strict().optional()
|
|
100
105
|
}).strict();
|
|
101
106
|
export const parseDistributionReport = (source, sourceLabel = "distribution report") => {
|
|
102
107
|
const parsed = distributionReportSchema.safeParse(source);
|
|
@@ -20,5 +20,5 @@ export { extractSingleFileFromTar } from "./tarReader.js";
|
|
|
20
20
|
export { hasRegistryComponent, parseImageReference, parseImplicitImageReference } from "./imageRef.js";
|
|
21
21
|
export type { ParsedImageReference } from "./imageRef.js";
|
|
22
22
|
export { normalizeProjectLabelSlug } from "./projectName.js";
|
|
23
|
-
export { DISTRIBUTION_REPORT_IMAGE_PATH, DISTRIBUTION_REPORT_OUTPUT_FILE, DISTRIBUTION_REPORT_VERSION, IMAGE_CONTRACT_VERSION } from "./types.js";
|
|
24
|
-
export type { DistributionAgentSummary, DistributionImageLabels, DistributionMoltnetNetwork, DistributionOrganizationSummary, DistributionPersistentMount, DistributionPortMapping, DistributionReport, DistributionRuntimeInstance, DistributionSecretCategory, DistributionSecretEntry, DistributionTeamSummary, DistributionWorkspaceResource } from "./types.js";
|
|
23
|
+
export { DISTRIBUTION_REPORT_IMAGE_PATH, DISTRIBUTION_REPORT_OUTPUT_FILE, DISTRIBUTION_REPORT_VERSION, IMAGE_CONTRACT_VERSION, WORLD_BINDINGS_IMAGE_PATH } from "./types.js";
|
|
24
|
+
export type { DistributionAgentSummary, DistributionImageLabels, DistributionMoltnetNetwork, DistributionOrganizationSummary, DistributionPersistentMount, DistributionPortMapping, DistributionReport, DistributionRuntimeInstance, DistributionSecretCategory, DistributionSecretEntry, DistributionTeamSummary, DistributionWorkspaceResource, DistributionWorldBindingsEvidence } from "./types.js";
|
|
@@ -13,4 +13,4 @@ export { buildImageInterfaceSummary, renderImageInterface } from "./renderImageI
|
|
|
13
13
|
export { extractSingleFileFromTar } from "./tarReader.js";
|
|
14
14
|
export { hasRegistryComponent, parseImageReference, parseImplicitImageReference } from "./imageRef.js";
|
|
15
15
|
export { normalizeProjectLabelSlug } from "./projectName.js";
|
|
16
|
-
export { DISTRIBUTION_REPORT_IMAGE_PATH, DISTRIBUTION_REPORT_OUTPUT_FILE, DISTRIBUTION_REPORT_VERSION, IMAGE_CONTRACT_VERSION } from "./types.js";
|
|
16
|
+
export { DISTRIBUTION_REPORT_IMAGE_PATH, DISTRIBUTION_REPORT_OUTPUT_FILE, DISTRIBUTION_REPORT_VERSION, IMAGE_CONTRACT_VERSION, WORLD_BINDINGS_IMAGE_PATH } from "./types.js";
|