spawnfile 0.1.12 → 0.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +58 -12
- package/dist/audit/auditCli.d.ts +19 -0
- package/dist/audit/auditCli.js +63 -0
- package/dist/audit/checks.d.ts +100 -0
- package/dist/audit/checks.js +279 -0
- package/dist/audit/checksShared.d.ts +74 -0
- package/dist/audit/checksShared.js +37 -0
- package/dist/audit/generateAudit.d.ts +19 -0
- package/dist/audit/generateAudit.js +122 -0
- package/dist/audit/index.d.ts +4 -0
- package/dist/audit/index.js +4 -0
- package/dist/audit/readAudit.d.ts +50 -0
- package/dist/audit/readAudit.js +59 -0
- package/dist/audit/types.d.ts +40 -0
- package/dist/audit/types.js +8 -0
- package/dist/auth/credentialEnvFile.d.ts +11 -0
- package/dist/auth/credentialEnvFile.js +60 -0
- package/dist/auth/credentialProvisioning.d.ts +15 -0
- package/dist/auth/credentialProvisioning.js +75 -0
- package/dist/auth/credentialProvisioningReceipt.d.ts +28 -0
- package/dist/auth/credentialProvisioningReceipt.js +70 -0
- package/dist/auth/credentialProvisioningRequest.d.ts +51 -0
- package/dist/auth/credentialProvisioningRequest.js +169 -0
- package/dist/auth/credentialWorldBindings.d.ts +21 -0
- package/dist/auth/credentialWorldBindings.js +104 -0
- package/dist/auth/index.d.ts +7 -0
- package/dist/auth/index.js +7 -0
- package/dist/auth/paths.d.ts +11 -0
- package/dist/auth/paths.js +21 -0
- package/dist/auth/runtimeCredentials.js +18 -2
- package/dist/auth/targetSecretSourceAuthor.d.ts +18 -0
- package/dist/auth/targetSecretSourceAuthor.js +52 -0
- package/dist/auth/targetSecretSourceFsPublish.d.ts +15 -0
- package/dist/auth/targetSecretSourceFsPublish.js +49 -0
- package/dist/auth/targetSecretSourceFsPublishImmutable.d.ts +16 -0
- package/dist/auth/targetSecretSourceFsPublishImmutable.js +435 -0
- package/dist/auth/targetSecretSourceFsRead.d.ts +14 -0
- package/dist/auth/targetSecretSourceFsRead.js +198 -0
- package/dist/auth/targetSecretSourceGrant.d.ts +16 -0
- package/dist/auth/targetSecretSourceGrant.js +99 -0
- package/dist/auth/targetSecretSourceGrantRecords.d.ts +84 -0
- package/dist/auth/targetSecretSourceGrantRecords.js +214 -0
- package/dist/auth/targetSecretSourceLifecycle.d.ts +30 -0
- package/dist/auth/targetSecretSourceLifecycle.js +52 -0
- package/dist/auth/targetSecretSourceOwnerEntropy.d.ts +6 -0
- package/dist/auth/targetSecretSourceOwnerEntropy.js +28 -0
- package/dist/auth/targetSecretSourceRecordCommon.d.ts +14 -0
- package/dist/auth/targetSecretSourceRecordCommon.js +100 -0
- package/dist/auth/targetSecretSourceRecordPublish.d.ts +10 -0
- package/dist/auth/targetSecretSourceRecordPublish.js +104 -0
- package/dist/auth/targetSecretSourceResolver.d.ts +10 -0
- package/dist/auth/targetSecretSourceResolver.js +137 -0
- package/dist/auth/targetSecretSourceRevoke.d.ts +20 -0
- package/dist/auth/targetSecretSourceRevoke.js +92 -0
- package/dist/auth/targetSecretSourceRotate.d.ts +19 -0
- package/dist/auth/targetSecretSourceRotate.js +121 -0
- package/dist/auth/targetSecretSourceVersionRecords.d.ts +49 -0
- package/dist/auth/targetSecretSourceVersionRecords.js +166 -0
- package/dist/cli/artifactsCommands.d.ts +27 -0
- package/dist/cli/artifactsCommands.js +132 -0
- package/dist/cli/authCommands.d.ts +5 -0
- package/dist/cli/authCommands.js +221 -0
- package/dist/cli/compileBuildCommands.d.ts +3 -0
- package/dist/cli/compileBuildCommands.js +35 -0
- package/dist/cli/containerBundleCommand.d.ts +6 -0
- package/dist/cli/containerBundleCommand.js +116 -0
- package/dist/cli/devCommands.d.ts +3 -0
- package/dist/cli/devCommands.js +115 -0
- package/dist/cli/downCommand.d.ts +25 -0
- package/dist/cli/downCommand.js +134 -0
- package/dist/cli/index.js +6 -3
- package/dist/cli/lifecycleCommands.d.ts +1 -1
- package/dist/cli/lifecycleCommands.js +11 -179
- package/dist/cli/lifecycleMachine.d.ts +19 -0
- package/dist/cli/lifecycleMachine.js +78 -0
- package/dist/cli/lifecyclePlan.d.ts +35 -0
- package/dist/cli/lifecyclePlan.js +240 -0
- package/dist/cli/lifecyclePlanningCommands.d.ts +3 -0
- package/dist/cli/lifecyclePlanningCommands.js +30 -0
- package/dist/cli/runCli.d.ts +15 -2
- package/dist/cli/runCli.js +31 -71
- package/dist/cli/runPublishCommands.d.ts +3 -0
- package/dist/cli/runPublishCommands.js +70 -0
- package/dist/cli/statusCommand.d.ts +3 -32
- package/dist/cli/statusCommand.js +37 -233
- package/dist/cli/statusCommandLive.d.ts +20 -0
- package/dist/cli/statusCommandLive.js +188 -0
- package/dist/cli/statusCommandOptions.d.ts +40 -0
- package/dist/cli/statusCommandOptions.js +42 -0
- package/dist/cli/targetCliRoute.d.ts +2 -0
- package/dist/cli/targetCliRoute.js +30 -0
- package/dist/cli/targetCommands.d.ts +33 -0
- package/dist/cli/targetCommands.js +257 -0
- package/dist/cli/targetComposedPreparationCommand.d.ts +6 -0
- package/dist/cli/targetComposedPreparationCommand.js +39 -0
- package/dist/cli/targetDefaultArtifactAuthority.d.ts +5 -0
- package/dist/cli/targetDefaultArtifactAuthority.js +28 -0
- package/dist/cli/targetDefaultAuthorities.d.ts +53 -0
- package/dist/cli/targetDefaultAuthorities.js +210 -0
- package/dist/cli/targetDefaultConfig.d.ts +68 -0
- package/dist/cli/targetDefaultConfig.js +317 -0
- package/dist/cli/targetDefaultConfigStdin.d.ts +13 -0
- package/dist/cli/targetDefaultConfigStdin.js +215 -0
- package/dist/cli/targetDefaultEnvelope.d.ts +1 -0
- package/dist/cli/targetDefaultEnvelope.js +13 -0
- package/dist/cli/targetDefaultHandlerFactory.d.ts +28 -0
- package/dist/cli/targetDefaultHandlerFactory.js +247 -0
- package/dist/cli/targetDefaultHandlers.d.ts +21 -0
- package/dist/cli/targetDefaultHandlers.js +72 -0
- package/dist/cli/targetDefaultJournalAuthority.d.ts +35 -0
- package/dist/cli/targetDefaultJournalAuthority.js +135 -0
- package/dist/cli/targetDefaultWorldClock.d.ts +4 -0
- package/dist/cli/targetDefaultWorldClock.js +14 -0
- package/dist/cli/targetDefaultWorldQueries.d.ts +5 -0
- package/dist/cli/targetDefaultWorldQueries.js +11 -0
- package/dist/cli/targetDefaultWorldReadiness.d.ts +4 -0
- package/dist/cli/targetDefaultWorldReadiness.js +17 -0
- package/dist/cli/targetEvidenceHelperResolution.d.ts +14 -0
- package/dist/cli/targetEvidenceHelperResolution.js +23 -0
- package/dist/cli/targetLookupCli.d.ts +3 -0
- package/dist/cli/targetLookupCli.js +31 -0
- package/dist/cli/targetLookupCommands.d.ts +12 -0
- package/dist/cli/targetLookupCommands.js +69 -0
- package/dist/cli/targetOperationDispatch.d.ts +58 -0
- package/dist/cli/targetOperationDispatch.js +21 -0
- package/dist/cli/targetReceiptOutput.d.ts +14 -0
- package/dist/cli/targetReceiptOutput.js +21 -0
- package/dist/cli/targetRequestFile.d.ts +14 -0
- package/dist/cli/targetRequestFile.js +63 -0
- package/dist/cli/targetSecretSourceInput.d.ts +28 -0
- package/dist/cli/targetSecretSourceInput.js +121 -0
- package/dist/cli/targetWorldClockCommand.d.ts +10 -0
- package/dist/cli/targetWorldClockCommand.js +42 -0
- package/dist/cli/targetWorldClockCrossProcess.test-helper.d.ts +13 -0
- package/dist/cli/targetWorldClockCrossProcess.test-helper.js +109 -0
- package/dist/cli/targetWorldReadinessCommand.d.ts +10 -0
- package/dist/cli/targetWorldReadinessCommand.js +43 -0
- package/dist/cli/upCommand.d.ts +3 -0
- package/dist/cli/upCommand.js +133 -0
- package/dist/cli/upImageCommand.d.ts +11 -0
- package/dist/cli/upImageCommand.js +41 -0
- package/dist/cli/upLifecycleInvocation.d.ts +41 -0
- package/dist/cli/upLifecycleInvocation.js +48 -0
- package/dist/cli/upLifecycleRecovery.d.ts +4 -0
- package/dist/cli/upLifecycleRecovery.js +53 -0
- package/dist/compiler/agentNodeMerge.d.ts +2 -0
- package/dist/compiler/agentNodeMerge.js +79 -0
- package/dist/compiler/agentSurfaces.js +11 -1
- package/dist/compiler/buildCompilePlan.js +17 -0
- package/dist/compiler/buildCompilePlanAgent.d.ts +11 -0
- package/dist/compiler/buildCompilePlanAgent.js +56 -0
- package/dist/compiler/buildCompilePlanTeams.d.ts +1 -0
- package/dist/compiler/buildCompilePlanTeams.js +4 -1
- package/dist/compiler/buildCompilePlanTraversal.js +75 -82
- package/dist/compiler/buildProject.d.ts +20 -1
- package/dist/compiler/buildProject.js +121 -7
- package/dist/compiler/compilePlanHelpers.js +2 -0
- package/dist/compiler/compileProject.d.ts +15 -0
- package/dist/compiler/compileProject.js +29 -75
- package/dist/compiler/compileProjectPolicy.d.ts +5 -0
- package/dist/compiler/compileProjectPolicy.js +21 -0
- package/dist/compiler/compileProjectReports.d.ts +9 -0
- package/dist/compiler/compileProjectReports.js +52 -0
- package/dist/compiler/containerArtifactSummaries.d.ts +7 -0
- package/dist/compiler/containerArtifactSummaries.js +138 -0
- package/dist/compiler/containerArtifacts.d.ts +10 -0
- package/dist/compiler/containerArtifacts.js +126 -125
- package/dist/compiler/containerArtifactsPlans.d.ts +5 -3
- package/dist/compiler/containerArtifactsPlans.js +31 -118
- package/dist/compiler/containerArtifactsRender.d.ts +3 -1
- package/dist/compiler/containerArtifactsRender.js +40 -81
- package/dist/compiler/containerArtifactsTypes.d.ts +12 -0
- package/dist/compiler/containerConfigEnvRender.d.ts +3 -0
- package/dist/compiler/containerConfigEnvRender.js +54 -0
- package/dist/compiler/containerEntrypointRender.d.ts +1 -0
- package/dist/compiler/containerEntrypointRender.js +60 -53
- package/dist/compiler/containerEntrypointShell.d.ts +5 -0
- package/dist/compiler/containerEntrypointShell.js +29 -0
- package/dist/compiler/containerPackageOverrides.d.ts +27 -0
- package/dist/compiler/containerPackageOverrides.js +63 -0
- package/dist/compiler/containerPackageRender.d.ts +15 -0
- package/dist/compiler/containerPackageRender.js +63 -0
- package/dist/compiler/containerTargetPlanResolution.d.ts +20 -0
- package/dist/compiler/containerTargetPlanResolution.js +97 -0
- package/dist/compiler/containerTargetResources.js +3 -1
- package/dist/compiler/daimonTelemetryArtifacts.d.ts +22 -0
- package/dist/compiler/daimonTelemetryArtifacts.js +61 -0
- package/dist/compiler/dockerBuildContext.d.ts +16 -0
- package/dist/compiler/dockerBuildContext.js +159 -0
- package/dist/compiler/dockerBuildSkip.d.ts +30 -0
- package/dist/compiler/dockerBuildSkip.js +81 -0
- package/dist/compiler/index.d.ts +4 -0
- package/dist/compiler/index.js +4 -0
- package/dist/compiler/memoryArtifacts.d.ts +26 -0
- package/dist/compiler/memoryArtifacts.js +134 -0
- package/dist/compiler/memoryResolution.d.ts +4 -0
- package/dist/compiler/memoryResolution.js +147 -0
- package/dist/compiler/modelEnv.d.ts +2 -0
- package/dist/compiler/modelEnv.js +6 -0
- package/dist/compiler/moltnetAllowedWakeSendersValidation.d.ts +2 -0
- package/dist/compiler/moltnetAllowedWakeSendersValidation.js +42 -0
- package/dist/compiler/moltnetArtifactPaths.d.ts +26 -0
- package/dist/compiler/moltnetArtifactPaths.js +49 -0
- package/dist/compiler/moltnetArtifactTypes.d.ts +46 -0
- package/dist/compiler/moltnetArtifactTypes.js +1 -0
- package/dist/compiler/moltnetArtifacts.d.ts +2 -40
- package/dist/compiler/moltnetArtifacts.js +56 -95
- package/dist/compiler/moltnetBinaries.d.ts +21 -1
- package/dist/compiler/moltnetBinaries.js +156 -28
- package/dist/compiler/moltnetClientConfig.js +18 -2
- package/dist/compiler/moltnetConfigLowering.d.ts +16 -1
- package/dist/compiler/moltnetConfigLowering.js +67 -5
- package/dist/compiler/moltnetExternalParticipantArtifact.d.ts +38 -0
- package/dist/compiler/moltnetExternalParticipantArtifact.js +188 -0
- package/dist/compiler/moltnetNodeConfig.js +7 -2
- package/dist/compiler/moltnetReleaseAuthority.d.ts +17 -0
- package/dist/compiler/moltnetReleaseAuthority.js +73 -0
- package/dist/compiler/moltnetReleaseDownload.d.ts +12 -0
- package/dist/compiler/moltnetReleaseDownload.js +85 -0
- package/dist/compiler/moltnetRepresentativeResolution.d.ts +1 -0
- package/dist/compiler/moltnetRepresentativeResolution.js +16 -2
- package/dist/compiler/moltnetResolution.js +72 -20
- package/dist/compiler/moltnetRoomMemberships.js +37 -9
- package/dist/compiler/moltnetRuntimeConfig.js +11 -0
- package/dist/compiler/moltnetServerPlans.d.ts +9 -0
- package/dist/compiler/moltnetServerPlans.js +132 -0
- package/dist/compiler/organizationIdentity.d.ts +27 -0
- package/dist/compiler/organizationIdentity.js +297 -0
- package/dist/compiler/organizationReadyEvidence.d.ts +49 -0
- package/dist/compiler/organizationReadyEvidence.js +261 -0
- package/dist/compiler/projectManifestGraph.d.ts +4 -0
- package/dist/compiler/projectManifestGraph.js +24 -0
- package/dist/compiler/runProject.d.ts +4 -0
- package/dist/compiler/runProject.js +37 -22
- package/dist/compiler/runProjectAuth.d.ts +7 -1
- package/dist/compiler/runProjectAuth.js +87 -9
- package/dist/compiler/runProjectDocker.d.ts +7 -0
- package/dist/compiler/runProjectDocker.js +187 -19
- package/dist/compiler/runProjectLifecycle.d.ts +7 -0
- package/dist/compiler/runProjectLifecycle.js +40 -0
- package/dist/compiler/syncProjectAuth.js +4 -1
- package/dist/compiler/teamContextActiveEnvironments.d.ts +13 -0
- package/dist/compiler/teamContextActiveEnvironments.js +255 -0
- package/dist/compiler/teamContextSupport.js +32 -40
- package/dist/compiler/teamContextTypes.d.ts +2 -0
- package/dist/compiler/types.d.ts +82 -1
- package/dist/compiler/upProject.d.ts +5 -0
- package/dist/compiler/upProject.js +257 -20
- package/dist/compiler/upReceipt.d.ts +36 -0
- package/dist/compiler/upReceipt.js +82 -0
- package/dist/compiler/updateProjectModels.js +42 -60
- package/dist/compiler/updateProjectRuntime.js +22 -35
- package/dist/compiler/updateProjectSurfaces.js +53 -47
- package/dist/compiler/worldBindings.d.ts +39 -0
- package/dist/compiler/worldBindings.js +247 -0
- package/dist/compiler/worldBindingsFile.d.ts +5 -0
- package/dist/compiler/worldBindingsFile.js +162 -0
- package/dist/deployment/artifactsExport.d.ts +49 -0
- package/dist/deployment/artifactsExport.js +217 -0
- package/dist/deployment/artifactsExportDocker.d.ts +48 -0
- package/dist/deployment/artifactsExportDocker.js +91 -0
- package/dist/deployment/artifactsExportPlan.d.ts +24 -0
- package/dist/deployment/artifactsExportPlan.js +135 -0
- package/dist/deployment/artifactsExportTypes.d.ts +50 -0
- package/dist/deployment/artifactsExportTypes.js +52 -0
- package/dist/deployment/buildImageCacheStore.d.ts +23 -0
- package/dist/deployment/buildImageCacheStore.js +54 -0
- package/dist/deployment/deploymentLifecycleCorrelation.d.ts +11 -0
- package/dist/deployment/deploymentLifecycleCorrelation.js +33 -0
- package/dist/deployment/dockerInspect.d.ts +9 -0
- package/dist/deployment/dockerInspect.js +24 -1
- package/dist/deployment/dockerLabels.d.ts +2 -0
- package/dist/deployment/dockerLabels.js +2 -0
- package/dist/deployment/dockerLogs.js +2 -10
- package/dist/deployment/dockerManager.d.ts +51 -0
- package/dist/deployment/dockerManager.js +118 -1
- package/dist/deployment/dockerProbeGateway.js +64 -5
- package/dist/deployment/dockerRecover.d.ts +17 -0
- package/dist/deployment/dockerRecover.js +137 -0
- package/dist/deployment/dockerTeardown.d.ts +32 -0
- package/dist/deployment/dockerTeardown.js +61 -0
- package/dist/deployment/downDeployment.d.ts +34 -0
- package/dist/deployment/downDeployment.js +147 -0
- package/dist/deployment/downReceiptTypes.d.ts +21 -0
- package/dist/deployment/downReceiptTypes.js +30 -0
- package/dist/deployment/index.d.ts +17 -0
- package/dist/deployment/index.js +18 -0
- package/dist/deployment/lifecycleCompletion.d.ts +37 -0
- package/dist/deployment/lifecycleCompletion.js +236 -0
- package/dist/deployment/lifecycleCompletionContracts.d.ts +158 -0
- package/dist/deployment/lifecycleCompletionContracts.js +106 -0
- package/dist/deployment/lifecycleCompletionHeartbeat.d.ts +2 -0
- package/dist/deployment/lifecycleCompletionHeartbeat.js +50 -0
- package/dist/deployment/lifecycleCompletionLookup.d.ts +18 -0
- package/dist/deployment/lifecycleCompletionLookup.js +88 -0
- package/dist/deployment/lifecycleCompletionOwner.d.ts +8 -0
- package/dist/deployment/lifecycleCompletionOwner.js +31 -0
- package/dist/deployment/lifecycleCompletionParsing.d.ts +12 -0
- package/dist/deployment/lifecycleCompletionParsing.js +108 -0
- package/dist/deployment/lifecycleCompletionPaths.d.ts +9 -0
- package/dist/deployment/lifecycleCompletionPaths.js +16 -0
- package/dist/deployment/lifecycleCompletionPublication.d.ts +5 -0
- package/dist/deployment/lifecycleCompletionPublication.js +35 -0
- package/dist/deployment/lifecycleCompletionRecovery.d.ts +21 -0
- package/dist/deployment/lifecycleCompletionRecovery.js +56 -0
- package/dist/deployment/lifecycleCompletionRoot.d.ts +21 -0
- package/dist/deployment/lifecycleCompletionRoot.js +243 -0
- package/dist/deployment/lifecycleCompletionStore.d.ts +6 -0
- package/dist/deployment/lifecycleCompletionStore.js +151 -0
- package/dist/deployment/organizationHandoffAuthorityFsClient.d.ts +17 -0
- package/dist/deployment/organizationHandoffAuthorityFsClient.js +132 -0
- package/dist/deployment/organizationHandoffAuthorityFsWorker.d.ts +1 -0
- package/dist/deployment/organizationHandoffAuthorityFsWorker.js +285 -0
- package/dist/deployment/organizationHandoffAuthorityFsWorkerParent.fixture.d.ts +1 -0
- package/dist/deployment/organizationHandoffAuthorityFsWorkerParent.fixture.js +26 -0
- package/dist/deployment/organizationHandoffAuthorityStore.d.ts +41 -0
- package/dist/deployment/organizationHandoffAuthorityStore.js +348 -0
- package/dist/deployment/organizationHandoffAuthorityTypes.d.ts +76 -0
- package/dist/deployment/organizationHandoffAuthorityTypes.js +148 -0
- package/dist/deployment/organizationHandoffTypes.d.ts +29 -0
- package/dist/deployment/organizationHandoffTypes.js +80 -0
- package/dist/deployment/organizationReady.d.ts +52 -0
- package/dist/deployment/organizationReady.js +200 -0
- package/dist/deployment/privateArtifactsExport.d.ts +18 -0
- package/dist/deployment/privateArtifactsExport.js +80 -0
- package/dist/deployment/providerRuntimeBoundaryScanner.test-helper.d.ts +8 -0
- package/dist/deployment/providerRuntimeBoundaryScanner.test-helper.js +60 -0
- package/dist/deployment/record.d.ts +26 -1
- package/dist/deployment/record.js +49 -4
- package/dist/deployment/simfileFixtureBoundary.test-helper.d.ts +8 -0
- package/dist/deployment/simfileFixtureBoundary.test-helper.js +103 -0
- package/dist/deployment/target.d.ts +1 -35
- package/dist/deployment/target.js +1 -96
- package/dist/deployment/upReceiptTypes.d.ts +111 -0
- package/dist/deployment/upReceiptTypes.js +164 -0
- package/dist/dev/activity.d.ts +14 -0
- package/dist/dev/activity.js +48 -0
- package/dist/dev/docker.d.ts +16 -0
- package/dist/dev/docker.js +71 -0
- package/dist/dev/index.d.ts +2 -0
- package/dist/dev/index.js +2 -0
- package/dist/dev/project.d.ts +35 -0
- package/dist/dev/project.js +170 -0
- package/dist/distribution/buildDistributionReport.d.ts +2 -1
- package/dist/distribution/buildDistributionReport.js +2 -1
- package/dist/distribution/distributionReportSchema.d.ts +5 -0
- package/dist/distribution/distributionReportSchema.js +7 -2
- package/dist/distribution/index.d.ts +2 -2
- package/dist/distribution/index.js +1 -1
- package/dist/distribution/types.d.ts +7 -0
- package/dist/distribution/types.js +1 -0
- package/dist/filesystem/paths.js +10 -1
- package/dist/ledger/causalConformanceCli.d.ts +1 -0
- package/dist/ledger/causalConformanceCli.js +41 -0
- package/dist/ledger/causeNamespace.d.ts +8 -0
- package/dist/ledger/causeNamespace.js +24 -0
- package/dist/ledger/conformance.d.ts +83 -0
- package/dist/ledger/conformance.js +259 -0
- package/dist/ledger/emitters.d.ts +76 -0
- package/dist/ledger/emitters.js +188 -0
- package/dist/ledger/index.d.ts +4 -0
- package/dist/ledger/index.js +4 -0
- package/dist/ledger/principal.d.ts +96 -0
- package/dist/ledger/principal.js +121 -0
- package/dist/manifest/externalParticipantSchemas.d.ts +18 -0
- package/dist/manifest/externalParticipantSchemas.js +17 -0
- package/dist/manifest/index.d.ts +1 -0
- package/dist/manifest/index.js +1 -0
- package/dist/manifest/inlineAgentMember.d.ts +2 -0
- package/dist/manifest/inlineAgentMember.js +9 -0
- package/dist/manifest/loadManifest.js +14 -8
- package/dist/manifest/mcpSchemas.d.ts +17 -0
- package/dist/manifest/mcpSchemas.js +41 -0
- package/dist/manifest/memorySchemas.d.ts +245 -0
- package/dist/manifest/memorySchemas.js +148 -0
- package/dist/manifest/renderSpawnfile.js +22 -131
- package/dist/manifest/renderSpawnfileNetworks.js +9 -2
- package/dist/manifest/renderSpawnfileSurfaces.d.ts +2 -0
- package/dist/manifest/renderSpawnfileSurfaces.js +134 -0
- package/dist/manifest/schemas.d.ts +1868 -99
- package/dist/manifest/schemas.js +78 -32
- package/dist/manifest/surfaceSchemas.d.ts +17 -0
- package/dist/manifest/surfaceSchemas.js +24 -1
- package/dist/manifest/teamNetworkAccessSchemas.d.ts +1 -1
- package/dist/manifest/teamNetworkAuthSchemas.d.ts +48 -0
- package/dist/manifest/teamNetworkAuthSchemas.js +103 -0
- package/dist/manifest/teamNetworkSchemas.d.ts +8 -187
- package/dist/manifest/teamNetworkSchemas.js +3 -317
- package/dist/manifest/teamNetworkServerSchemas.d.ts +150 -0
- package/dist/manifest/teamNetworkServerSchemas.js +199 -0
- package/dist/ownership/siblingBuildFreshness.d.ts +20 -0
- package/dist/ownership/siblingBuildFreshness.js +20 -0
- package/dist/ownership/simfileRunOperatorInputs.d.ts +103 -0
- package/dist/ownership/simfileRunOperatorInputs.js +139 -0
- package/dist/report/types.d.ts +142 -0
- package/dist/runtime/common.d.ts +37 -0
- package/dist/runtime/common.js +56 -1
- package/dist/runtime/container.d.ts +29 -1
- package/dist/runtime/container.js +127 -11
- package/dist/runtime/containerPackageOverrides.d.ts +37 -0
- package/dist/runtime/containerPackageOverrides.js +33 -0
- package/dist/runtime/index.d.ts +2 -0
- package/dist/runtime/index.js +2 -0
- package/dist/runtime/install.d.ts +1 -1
- package/dist/runtime/install.js +43 -1
- package/dist/runtime/mnemeMcp.d.ts +15 -0
- package/dist/runtime/mnemeMcp.js +109 -0
- package/dist/runtime/openclaw/adapter.js +15 -4
- package/dist/runtime/openclaw/mcp.d.ts +10 -0
- package/dist/runtime/openclaw/mcp.js +69 -0
- package/dist/runtime/openclaw/runAuth.js +2 -2
- package/dist/runtime/openclaw/scaffold.js +1 -1
- package/dist/runtime/openclaw/schedules.d.ts +38 -0
- package/dist/runtime/openclaw/schedules.js +74 -0
- package/dist/runtime/pi/adapter.d.ts +4 -0
- package/dist/runtime/pi/adapter.js +231 -0
- package/dist/runtime/pi/appActivitySource.d.ts +1 -0
- package/dist/runtime/pi/appActivitySource.js +199 -0
- package/dist/runtime/pi/appAgentConfig.d.ts +11 -0
- package/dist/runtime/pi/appAgentConfig.js +264 -0
- package/dist/runtime/pi/appCliEnginesSource.d.ts +1 -0
- package/dist/runtime/pi/appCliEnginesSource.js +183 -0
- package/dist/runtime/pi/appCliSource.d.ts +1 -0
- package/dist/runtime/pi/appCliSource.js +353 -0
- package/dist/runtime/pi/appControlSource.d.ts +1 -0
- package/dist/runtime/pi/appControlSource.js +390 -0
- package/dist/runtime/pi/appControlWakeIdentitySource.d.ts +1 -0
- package/dist/runtime/pi/appControlWakeIdentitySource.js +19 -0
- package/dist/runtime/pi/appCoreSource.d.ts +4 -0
- package/dist/runtime/pi/appCoreSource.js +244 -0
- package/dist/runtime/pi/appPreludeSource.d.ts +1 -0
- package/dist/runtime/pi/appPreludeSource.js +191 -0
- package/dist/runtime/pi/appScheduleSource.d.ts +1 -0
- package/dist/runtime/pi/appScheduleSource.js +80 -0
- package/dist/runtime/pi/appScriptedEngine.d.ts +31 -0
- package/dist/runtime/pi/appScriptedEngine.js +42 -0
- package/dist/runtime/pi/appSource.d.ts +4 -0
- package/dist/runtime/pi/appSource.js +12 -0
- package/dist/runtime/pi/appTemplate.d.ts +14 -0
- package/dist/runtime/pi/appTemplate.js +27 -0
- package/dist/runtime/pi/appTemplateTypes.d.ts +64 -0
- package/dist/runtime/pi/appTemplateTypes.js +18 -0
- package/dist/runtime/pi/appWakeContextSource.d.ts +1 -0
- package/dist/runtime/pi/appWakeContextSource.js +398 -0
- package/dist/runtime/pi/containerTargets.d.ts +4 -0
- package/dist/runtime/pi/containerTargets.js +57 -0
- package/dist/runtime/pi/runAuth.d.ts +2 -0
- package/dist/runtime/pi/runAuth.js +185 -0
- package/dist/runtime/pi/testHelpers.d.ts +2 -0
- package/dist/runtime/pi/testHelpers.js +40 -0
- package/dist/runtime/picoclaw/adapter.js +23 -27
- package/dist/runtime/picoclaw/mcp.d.ts +4 -0
- package/dist/runtime/picoclaw/mcp.js +43 -0
- package/dist/runtime/picoclaw/memory.d.ts +7 -0
- package/dist/runtime/picoclaw/memory.js +17 -0
- package/dist/runtime/picoclaw/runAuth.js +1 -1
- package/dist/runtime/picoclaw/scaffold.js +1 -1
- package/dist/runtime/picoclaw/schedules.d.ts +26 -0
- package/dist/runtime/picoclaw/schedules.js +62 -3
- package/dist/runtime/registry.js +3 -0
- package/dist/runtime/scheduleUtils.d.ts +2 -0
- package/dist/runtime/scheduleUtils.js +15 -0
- package/dist/runtime/types.d.ts +26 -2
- package/dist/shared/errors.d.ts +1 -1
- package/dist/shared/errors.js +2 -2
- package/dist/shared/index.d.ts +1 -0
- package/dist/shared/index.js +1 -0
- package/dist/shared/redaction.d.ts +2 -0
- package/dist/shared/redaction.js +10 -0
- package/dist/status/buildStatus.d.ts +1 -0
- package/dist/status/buildStatus.js +2 -0
- package/dist/status/compileReport.d.ts +22 -0
- package/dist/status/compileReport.js +16 -2
- package/dist/status/compiledProbeCollection.d.ts +21 -0
- package/dist/status/compiledProbeCollection.js +27 -0
- package/dist/status/deployments.js +5 -12
- package/dist/status/imageStatusReport.js +6 -0
- package/dist/status/index.d.ts +3 -0
- package/dist/status/index.js +3 -0
- package/dist/status/lifecycleProbes.d.ts +19 -0
- package/dist/status/lifecycleProbes.js +174 -0
- package/dist/status/moltnetProbes.d.ts +7 -8
- package/dist/status/moltnetProbes.js +27 -198
- package/dist/status/moltnetWiringProbes.d.ts +19 -0
- package/dist/status/moltnetWiringProbes.js +178 -0
- package/dist/target/cleanupRun.d.ts +41 -0
- package/dist/target/cleanupRun.js +139 -0
- package/dist/target/cleanupRunDocker.d.ts +16 -0
- package/dist/target/cleanupRunDocker.js +66 -0
- package/dist/target/cleanupRunDocker.test-helper.d.ts +67 -0
- package/dist/target/cleanupRunDocker.test-helper.js +238 -0
- package/dist/target/cleanupRunDockerPreflight.d.ts +17 -0
- package/dist/target/cleanupRunDockerPreflight.js +224 -0
- package/dist/target/composedPreparation.d.ts +205 -0
- package/dist/target/composedPreparation.js +223 -0
- package/dist/target/containerBundle.d.ts +82 -0
- package/dist/target/containerBundle.js +243 -0
- package/dist/target/containerBundleArchive.d.ts +31 -0
- package/dist/target/containerBundleArchive.js +140 -0
- package/dist/target/containerBundleAuthority.d.ts +25 -0
- package/dist/target/containerBundleAuthority.js +65 -0
- package/dist/target/containerBundleContracts.d.ts +114 -0
- package/dist/target/containerBundleContracts.js +173 -0
- package/dist/target/containerBundleFilesystemStore.d.ts +3 -0
- package/dist/target/containerBundleFilesystemStore.js +247 -0
- package/dist/target/containerBundlePolicy.d.ts +33 -0
- package/dist/target/containerBundlePolicy.js +64 -0
- package/dist/target/containerBundleStore.d.ts +127 -0
- package/dist/target/containerBundleStore.js +284 -0
- package/dist/target/contracts.d.ts +538 -0
- package/dist/target/contracts.js +373 -0
- package/dist/target/dockerArtifactIdentityTypes.d.ts +56 -0
- package/dist/target/dockerArtifactIdentityTypes.js +1 -0
- package/dist/target/dockerArtifactInspection.d.ts +40 -0
- package/dist/target/dockerArtifactInspection.js +125 -0
- package/dist/target/dockerArtifacts.d.ts +21 -0
- package/dist/target/dockerArtifacts.js +110 -0
- package/dist/target/dockerArtifactsProvider.d.ts +41 -0
- package/dist/target/dockerArtifactsProvider.js +449 -0
- package/dist/target/dockerCommandExecutor.d.ts +27 -0
- package/dist/target/dockerCommandExecutor.js +200 -0
- package/dist/target/dockerCommandExecutorCore.d.ts +34 -0
- package/dist/target/dockerCommandExecutorCore.js +273 -0
- package/dist/target/dockerContainerBundleBuilder.d.ts +8 -0
- package/dist/target/dockerContainerBundleBuilder.js +256 -0
- package/dist/target/dockerContextSnapshot.d.ts +21 -0
- package/dist/target/dockerContextSnapshot.js +158 -0
- package/dist/target/dockerEndpointFingerprint.d.ts +1 -0
- package/dist/target/dockerEndpointFingerprint.js +9 -0
- package/dist/target/dockerPreparedArtifact.d.ts +48 -0
- package/dist/target/dockerPreparedArtifact.js +131 -0
- package/dist/target/dockerProjectionJson.d.ts +1 -0
- package/dist/target/dockerProjectionJson.js +80 -0
- package/dist/target/dockerPublicArtifactSnapshot.d.ts +17 -0
- package/dist/target/dockerPublicArtifactSnapshot.js +99 -0
- package/dist/target/dockerResources.d.ts +26 -0
- package/dist/target/dockerResources.js +162 -0
- package/dist/target/dockerResourcesProvider.d.ts +44 -0
- package/dist/target/dockerResourcesProvider.js +207 -0
- package/dist/target/dockerSecrets.d.ts +39 -0
- package/dist/target/dockerSecrets.js +249 -0
- package/dist/target/dockerSecretsAuthority.d.ts +26 -0
- package/dist/target/dockerSecretsAuthority.js +216 -0
- package/dist/target/dockerSecretsLifecycle.d.ts +25 -0
- package/dist/target/dockerSecretsLifecycle.js +133 -0
- package/dist/target/dockerSecretsProvider.d.ts +68 -0
- package/dist/target/dockerSecretsProvider.js +329 -0
- package/dist/target/dockerTarget.d.ts +52 -0
- package/dist/target/dockerTarget.js +48 -0
- package/dist/target/dockerTargetBinding.d.ts +14 -0
- package/dist/target/dockerTargetBinding.js +96 -0
- package/dist/target/dockerWorldClock.d.ts +17 -0
- package/dist/target/dockerWorldClock.js +111 -0
- package/dist/target/dockerWorldReadiness.d.ts +17 -0
- package/dist/target/dockerWorldReadiness.js +119 -0
- package/dist/target/dockerWorldService.d.ts +23 -0
- package/dist/target/dockerWorldService.js +216 -0
- package/dist/target/dockerWorldServiceAuthority.d.ts +80 -0
- package/dist/target/dockerWorldServiceAuthority.js +182 -0
- package/dist/target/dockerWorldServiceLifecycle.d.ts +41 -0
- package/dist/target/dockerWorldServiceLifecycle.js +275 -0
- package/dist/target/dockerWorldServiceProvider.d.ts +60 -0
- package/dist/target/dockerWorldServiceProvider.js +318 -0
- package/dist/target/dockerWorldServiceStore.d.ts +73 -0
- package/dist/target/dockerWorldServiceStore.js +367 -0
- package/dist/target/evidenceExport.d.ts +55 -0
- package/dist/target/evidenceExport.js +518 -0
- package/dist/target/evidenceExportArchive.d.ts +10 -0
- package/dist/target/evidenceExportArchive.js +302 -0
- package/dist/target/evidenceExportContract.d.ts +27 -0
- package/dist/target/evidenceExportContract.js +40 -0
- package/dist/target/evidenceExportOperationsTestKit.d.ts +87 -0
- package/dist/target/evidenceExportOperationsTestKit.js +312 -0
- package/dist/target/evidenceExportProvider.d.ts +85 -0
- package/dist/target/evidenceExportProvider.js +187 -0
- package/dist/target/evidenceExportPublicationTypes.d.ts +16 -0
- package/dist/target/evidenceExportPublicationTypes.js +1 -0
- package/dist/target/evidenceExportStore.d.ts +70 -0
- package/dist/target/evidenceExportStore.js +498 -0
- package/dist/target/evidenceExportStorePublication.d.ts +7 -0
- package/dist/target/evidenceExportStorePublication.js +395 -0
- package/dist/target/handles.d.ts +20 -0
- package/dist/target/handles.js +56 -0
- package/dist/target/index.d.ts +12 -0
- package/dist/target/index.js +11 -0
- package/dist/target/journal.d.ts +59 -0
- package/dist/target/journal.js +529 -0
- package/dist/target/journalFilesystem.d.ts +3 -0
- package/dist/target/journalFilesystem.js +111 -0
- package/dist/target/journalRoot.d.ts +4 -0
- package/dist/target/journalRoot.js +6 -0
- package/dist/target/organizationAttachment.d.ts +23 -0
- package/dist/target/organizationAttachment.js +263 -0
- package/dist/target/organizationAttachmentAuthority.d.ts +65 -0
- package/dist/target/organizationAttachmentAuthority.js +161 -0
- package/dist/target/organizationAttachmentLifecycle.d.ts +17 -0
- package/dist/target/organizationAttachmentLifecycle.js +101 -0
- package/dist/target/organizationAttachmentProvider.d.ts +76 -0
- package/dist/target/organizationAttachmentProvider.js +289 -0
- package/dist/target/organizationAttachmentStore.d.ts +51 -0
- package/dist/target/organizationAttachmentStore.js +316 -0
- package/dist/target/publicArtifactSnapshot.d.ts +41 -0
- package/dist/target/publicArtifactSnapshot.js +150 -0
- package/dist/target/topologyActivation.d.ts +51 -0
- package/dist/target/topologyActivation.js +149 -0
- package/dist/target/topologyAttestation.d.ts +37 -0
- package/dist/target/topologyAttestation.js +300 -0
- package/dist/target/topologyAttestationErrors.d.ts +1 -0
- package/dist/target/topologyAttestationErrors.js +1 -0
- package/dist/target/worldClock.d.ts +60 -0
- package/dist/target/worldClock.js +129 -0
- package/dist/target/worldReadiness.d.ts +103 -0
- package/dist/target/worldReadiness.js +153 -0
- package/moltnet-releases.json +20 -0
- package/package.json +29 -8
- package/runtimes.yaml +28 -27
- package/dist/runtime/openclaw/scaffold-assets/CLAUDE.md +0 -5
- package/dist/runtime/picoclaw/scaffold-assets/CLAUDE.md +0 -5
- /package/dist/runtime/openclaw/scaffold-assets/{AGENTS.md → WORKSPACE_AGENTS.md} +0 -0
- /package/dist/runtime/picoclaw/scaffold-assets/{AGENTS.md → WORKSPACE_AGENTS.md} +0 -0
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { inspectDockerDeployment, listHomeDeploymentRecords, readHomeDeploymentRecord, readHomeDeploymentReport, recoverDockerDeploymentRecords } from "../deployment/index.js";
|
|
2
|
+
import { extractImageReport, parseDistributionReport, projectImageOrganizationView, renderImageInterface } from "../distribution/index.js";
|
|
3
|
+
import { collectCompiledProbeObservations, collectDeploymentLogObservations, collectMoltnetProbeObservations, collectRegistryDriftObservations, collectRuntimeProbeObservations, createDeploymentSummaries, createStaticStatus, exitCodeForStatus, flattenOrganizationNodes, loadedImageCompileReport, renderStatus, unavailableCompiledProbeFile } from "../status/index.js";
|
|
4
|
+
import { errorExitCode, SpawnfileError } from "../shared/index.js";
|
|
5
|
+
import { statusInputFailure } from "./statusCommandOptions.js";
|
|
6
|
+
export const resolveDeploymentRecords = (records, options) => {
|
|
7
|
+
if (options.deployment) {
|
|
8
|
+
const record = records.find((entry) => entry.record.name === options.deployment);
|
|
9
|
+
return record
|
|
10
|
+
? [record]
|
|
11
|
+
: statusInputFailure(`Unknown deployment "${options.deployment}". Valid deployments: ${records.map((entry) => entry.record.name).sort().join(", ") || "none"}`);
|
|
12
|
+
}
|
|
13
|
+
if (options.live && records.length > 1) {
|
|
14
|
+
return statusInputFailure(`status --live requires --deployment when multiple records exist: ${records.map((entry) => entry.record.name).sort().join(", ")}`);
|
|
15
|
+
}
|
|
16
|
+
return records;
|
|
17
|
+
};
|
|
18
|
+
export const inspectDeployments = async (records, handlers, options, timeoutMs) => {
|
|
19
|
+
if (!options.live) {
|
|
20
|
+
return new Map();
|
|
21
|
+
}
|
|
22
|
+
const inspect = handlers.inspectDockerDeployment ?? inspectDockerDeployment;
|
|
23
|
+
const inspections = await Promise.all(records.map(async ({ record }) => [
|
|
24
|
+
record.name,
|
|
25
|
+
await inspect(record, {
|
|
26
|
+
dockerCommand: options.dockerCommand,
|
|
27
|
+
timeoutMs
|
|
28
|
+
})
|
|
29
|
+
]));
|
|
30
|
+
return new Map(inspections);
|
|
31
|
+
};
|
|
32
|
+
const containsFromView = (view) => flattenOrganizationNodes(view).map((node) => ({ id: node.id, kind: node.kind }));
|
|
33
|
+
const runtimeInstanceIdsFromReport = (loadedReport) => loadedReport.kind === "loaded"
|
|
34
|
+
? loadedReport.report.runtimeInstances.map((instance) => instance.id).sort()
|
|
35
|
+
: [];
|
|
36
|
+
export const recoverContextDeployments = async (input) => {
|
|
37
|
+
const recover = input.handlers.recoverDockerDeploymentRecords ?? recoverDockerDeploymentRecords;
|
|
38
|
+
return recover({
|
|
39
|
+
contains: containsFromView(input.view),
|
|
40
|
+
context: input.options.context,
|
|
41
|
+
dockerCommand: input.options.dockerCommand,
|
|
42
|
+
outputDirectory: input.outputDirectory,
|
|
43
|
+
projectLabel: input.projectLabel,
|
|
44
|
+
runtimeInstanceIds: runtimeInstanceIdsFromReport(input.loadedReport),
|
|
45
|
+
sourceRoot: input.sourceRoot,
|
|
46
|
+
timeoutMs: input.timeoutMs
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
export const resolveStatusAuthValues = async (records, handlers) => {
|
|
50
|
+
const values = {};
|
|
51
|
+
if (!handlers.requireAuthProfile) {
|
|
52
|
+
return values;
|
|
53
|
+
}
|
|
54
|
+
const profileNames = [...new Set(records
|
|
55
|
+
.map(({ record }) => record.auth_profile)
|
|
56
|
+
.filter((profileName) => typeof profileName === "string" && profileName.length > 0))];
|
|
57
|
+
for (const profileName of profileNames) {
|
|
58
|
+
try {
|
|
59
|
+
const profile = await handlers.requireAuthProfile(profileName);
|
|
60
|
+
Object.assign(values, profile.env);
|
|
61
|
+
}
|
|
62
|
+
catch {
|
|
63
|
+
// Missing profile values are reported by the metadata layer as unknown credentials.
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return values;
|
|
67
|
+
};
|
|
68
|
+
/* v8 ignore start -- docker extraction is covered by distribution E2E */
|
|
69
|
+
export const runStaticImageStatus = async (imageRef, options, json) => {
|
|
70
|
+
try {
|
|
71
|
+
const inspection = await extractImageReport(imageRef, {
|
|
72
|
+
dockerCommand: options.dockerCommand,
|
|
73
|
+
dockerContext: options.context,
|
|
74
|
+
pull: options.pull
|
|
75
|
+
});
|
|
76
|
+
return {
|
|
77
|
+
exitCode: 0,
|
|
78
|
+
output: renderImageInterface(inspection.report, { imageRef, json })
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
return {
|
|
83
|
+
error: error instanceof Error ? error.message : String(error),
|
|
84
|
+
exitCode: errorExitCode(error)
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
/* v8 ignore stop */
|
|
89
|
+
export const runHomeDeploymentStatus = async (options, handlers, mode, timeoutMs) => {
|
|
90
|
+
let records;
|
|
91
|
+
try {
|
|
92
|
+
records = await listHomeDeploymentRecords();
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
return { error: error instanceof Error ? error.message : String(error), exitCode: errorExitCode(error) };
|
|
96
|
+
}
|
|
97
|
+
if (!options.deployment) {
|
|
98
|
+
if (records.length === 0) {
|
|
99
|
+
return statusInputFailure("No image deployments found in the home store");
|
|
100
|
+
}
|
|
101
|
+
if (records.length > 1) {
|
|
102
|
+
return statusInputFailure(`status --deployment is required: ${records.map((entry) => entry.record.name).sort().join(", ")}`);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
const targetName = options.deployment ?? records[0].record.name;
|
|
106
|
+
const match = records.find((entry) => entry.record.name === targetName);
|
|
107
|
+
if (!match) {
|
|
108
|
+
return statusInputFailure(`Unknown deployment "${targetName}". Valid deployments: ${records.map((entry) => entry.record.name).sort().join(", ") || "none"}`);
|
|
109
|
+
}
|
|
110
|
+
let report;
|
|
111
|
+
try {
|
|
112
|
+
const record = await readHomeDeploymentRecord(targetName);
|
|
113
|
+
void record;
|
|
114
|
+
const raw = await readHomeDeploymentReport(targetName);
|
|
115
|
+
let parsed;
|
|
116
|
+
try {
|
|
117
|
+
parsed = JSON.parse(raw);
|
|
118
|
+
}
|
|
119
|
+
catch (error) {
|
|
120
|
+
throw new SpawnfileError("validation_error", `Cached report for "${targetName}" is not valid JSON: ${error instanceof Error ? error.message : String(error)}`);
|
|
121
|
+
}
|
|
122
|
+
report = parseDistributionReport(parsed);
|
|
123
|
+
}
|
|
124
|
+
catch (error) {
|
|
125
|
+
return { error: error instanceof Error ? error.message : String(error), exitCode: errorExitCode(error) };
|
|
126
|
+
}
|
|
127
|
+
const view = projectImageOrganizationView(report, match.record.source.kind === "image"
|
|
128
|
+
? match.record.source.ref
|
|
129
|
+
: targetName);
|
|
130
|
+
const reportPath = match.path.replace(/record\.json$/, "spawnfile-report.json");
|
|
131
|
+
const loadedReport = loadedImageCompileReport(report, reportPath);
|
|
132
|
+
const selectedRecords = [match];
|
|
133
|
+
const deploymentInspections = await inspectDeployments(selectedRecords, handlers, options, timeoutMs);
|
|
134
|
+
const recordValues = selectedRecords.map(({ record }) => record);
|
|
135
|
+
const authValues = options.live ? await resolveStatusAuthValues(selectedRecords, handlers) : {};
|
|
136
|
+
const collectRuntimeProbes = handlers.collectRuntimeProbeObservations ?? collectRuntimeProbeObservations;
|
|
137
|
+
const collectMoltnetProbes = handlers.collectMoltnetProbeObservations ?? collectMoltnetProbeObservations;
|
|
138
|
+
const collectDeploymentLogs = handlers.collectDeploymentLogObservations ?? collectDeploymentLogObservations;
|
|
139
|
+
const liveObservations = options.live && !options.recover
|
|
140
|
+
? [
|
|
141
|
+
...await collectRuntimeProbes({
|
|
142
|
+
deployments: recordValues,
|
|
143
|
+
inspections: deploymentInspections,
|
|
144
|
+
loadedReport,
|
|
145
|
+
timeoutMs
|
|
146
|
+
}),
|
|
147
|
+
...await collectMoltnetProbes({
|
|
148
|
+
authValues,
|
|
149
|
+
deployments: recordValues,
|
|
150
|
+
inspections: deploymentInspections,
|
|
151
|
+
loadedReport,
|
|
152
|
+
timeoutMs
|
|
153
|
+
}),
|
|
154
|
+
...(options.logs
|
|
155
|
+
? await collectDeploymentLogs({
|
|
156
|
+
deployments: recordValues,
|
|
157
|
+
dockerCommand: options.dockerCommand,
|
|
158
|
+
loadedReport,
|
|
159
|
+
timeoutMs
|
|
160
|
+
})
|
|
161
|
+
: []),
|
|
162
|
+
...(options.pullCheck
|
|
163
|
+
? await collectRegistryDriftObservations({
|
|
164
|
+
deployments: recordValues,
|
|
165
|
+
dockerCommand: options.dockerCommand,
|
|
166
|
+
timeoutMs
|
|
167
|
+
})
|
|
168
|
+
: [])
|
|
169
|
+
]
|
|
170
|
+
: [];
|
|
171
|
+
const compiledProbeObservations = await collectCompiledProbeObservations(loadedReport, null, unavailableCompiledProbeFile, handlers.compiledProbeCollectors);
|
|
172
|
+
const status = createStaticStatus(view, loadedReport, {
|
|
173
|
+
compiledProbeObservations,
|
|
174
|
+
deployments: createDeploymentSummaries(selectedRecords, deploymentInspections),
|
|
175
|
+
inputPath: view.inputPath,
|
|
176
|
+
live: {
|
|
177
|
+
context: null,
|
|
178
|
+
deploymentName: targetName,
|
|
179
|
+
logs: options.logs ?? false,
|
|
180
|
+
recover: false,
|
|
181
|
+
requested: options.live ?? false
|
|
182
|
+
},
|
|
183
|
+
liveObservations,
|
|
184
|
+
outputDirectory: "",
|
|
185
|
+
selection: null
|
|
186
|
+
});
|
|
187
|
+
return { exitCode: exitCodeForStatus(status), output: renderStatus(status, { mode }), status };
|
|
188
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { CompiledProbeCollectors, StatusCommandResult, StatusOutputMode, StatusSelectorInput } from "../status/index.js";
|
|
2
|
+
import { collectDeploymentLogObservations, collectMoltnetProbeObservations, collectRuntimeProbeObservations } from "../status/index.js";
|
|
3
|
+
import { inspectDockerDeployment, recoverDockerDeploymentRecords } from "../deployment/index.js";
|
|
4
|
+
import type { CliHandlers, CliStreams } from "./runCli.js";
|
|
5
|
+
export type StatusCommandHandlers = Pick<CliHandlers, "buildOrganizationView"> & Partial<Pick<CliHandlers, "requireAuthProfile">>;
|
|
6
|
+
export interface StatusCommandLiveHandlers {
|
|
7
|
+
collectDeploymentLogObservations?: typeof collectDeploymentLogObservations;
|
|
8
|
+
collectMoltnetProbeObservations?: typeof collectMoltnetProbeObservations;
|
|
9
|
+
collectRuntimeProbeObservations?: typeof collectRuntimeProbeObservations;
|
|
10
|
+
compiledProbeCollectors?: CompiledProbeCollectors;
|
|
11
|
+
inspectDockerDeployment?: typeof inspectDockerDeployment;
|
|
12
|
+
recoverDockerDeploymentRecords?: typeof recoverDockerDeploymentRecords;
|
|
13
|
+
}
|
|
14
|
+
export type StatusCommandHandlersWithLive = StatusCommandHandlers & StatusCommandLiveHandlers;
|
|
15
|
+
export interface StatusCommandOptions {
|
|
16
|
+
agent?: string;
|
|
17
|
+
context?: string;
|
|
18
|
+
deployment?: string;
|
|
19
|
+
dockerCommand?: string;
|
|
20
|
+
image?: boolean;
|
|
21
|
+
json?: boolean;
|
|
22
|
+
live?: boolean;
|
|
23
|
+
logs?: boolean;
|
|
24
|
+
network?: string;
|
|
25
|
+
out?: string;
|
|
26
|
+
pretty?: boolean;
|
|
27
|
+
pull?: boolean;
|
|
28
|
+
pullCheck?: boolean;
|
|
29
|
+
quiet?: boolean;
|
|
30
|
+
recover?: boolean;
|
|
31
|
+
runtime?: string;
|
|
32
|
+
team?: string;
|
|
33
|
+
timeout?: string;
|
|
34
|
+
watch?: boolean;
|
|
35
|
+
}
|
|
36
|
+
export declare const statusInputFailure: (message: string) => StatusCommandResult;
|
|
37
|
+
export declare const resolveStatusOutputMode: (options: StatusCommandOptions) => StatusOutputMode | StatusCommandResult;
|
|
38
|
+
export declare const resolveStatusSelectorInput: (options: StatusCommandOptions) => StatusSelectorInput | null | StatusCommandResult;
|
|
39
|
+
export declare const resolveStatusTimeoutMs: (options: StatusCommandOptions) => number | undefined | StatusCommandResult;
|
|
40
|
+
export declare const emitStatusOutput: (streams: CliStreams, output: string) => void;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export const statusInputFailure = (message) => ({
|
|
2
|
+
error: message,
|
|
3
|
+
exitCode: 2
|
|
4
|
+
});
|
|
5
|
+
export const resolveStatusOutputMode = (options) => {
|
|
6
|
+
const modes = [
|
|
7
|
+
...(options.json ? ["json"] : []),
|
|
8
|
+
...(options.pretty ? ["pretty"] : []),
|
|
9
|
+
...(options.quiet ? ["quiet"] : [])
|
|
10
|
+
];
|
|
11
|
+
if (modes.length > 1) {
|
|
12
|
+
return statusInputFailure("Choose only one status output mode: --pretty, --json, or --quiet");
|
|
13
|
+
}
|
|
14
|
+
return modes[0] ?? "pretty";
|
|
15
|
+
};
|
|
16
|
+
export const resolveStatusSelectorInput = (options) => {
|
|
17
|
+
const selectors = [
|
|
18
|
+
...(options.agent ? [{ kind: "agent", value: options.agent }] : []),
|
|
19
|
+
...(options.team ? [{ kind: "team", value: options.team }] : []),
|
|
20
|
+
...(options.network ? [{ kind: "network", value: options.network }] : []),
|
|
21
|
+
...(options.runtime ? [{ kind: "runtime", value: options.runtime }] : [])
|
|
22
|
+
];
|
|
23
|
+
if (selectors.length > 1) {
|
|
24
|
+
return statusInputFailure("Choose only one status selector: --agent, --team, --network, or --runtime");
|
|
25
|
+
}
|
|
26
|
+
return selectors[0] ?? null;
|
|
27
|
+
};
|
|
28
|
+
export const resolveStatusTimeoutMs = (options) => {
|
|
29
|
+
if (!options.timeout) {
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
const parsed = Number(options.timeout);
|
|
33
|
+
if (!Number.isInteger(parsed) || parsed <= 0) {
|
|
34
|
+
return statusInputFailure("status --timeout must be a positive integer number of milliseconds");
|
|
35
|
+
}
|
|
36
|
+
return parsed;
|
|
37
|
+
};
|
|
38
|
+
export const emitStatusOutput = (streams, output) => {
|
|
39
|
+
for (const line of output.split("\n")) {
|
|
40
|
+
streams.stdout(line);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const MAX_ARGUMENTS = 64;
|
|
2
|
+
const MAX_ARGUMENT_BYTES = 4_096;
|
|
3
|
+
const bounded = (value) => typeof value === "string"
|
|
4
|
+
&& value.length > 0
|
|
5
|
+
&& Buffer.byteLength(value, "utf8") <= MAX_ARGUMENT_BYTES;
|
|
6
|
+
/** Routes only when the first actual target subcommand is lookup_operation. */
|
|
7
|
+
export const isTargetLookupInvocation = (raw) => {
|
|
8
|
+
if (!Array.isArray(raw) || raw.length < 2 || raw.length > MAX_ARGUMENTS
|
|
9
|
+
|| raw.some((value) => !bounded(value)) || raw[0] !== "target")
|
|
10
|
+
return false;
|
|
11
|
+
const argv = raw;
|
|
12
|
+
for (let index = 1; index < argv.length; index += 1) {
|
|
13
|
+
const token = argv[index];
|
|
14
|
+
if (token === "--config") {
|
|
15
|
+
if (!bounded(argv[index + 1]))
|
|
16
|
+
return false;
|
|
17
|
+
index += 1;
|
|
18
|
+
continue;
|
|
19
|
+
}
|
|
20
|
+
if (token.startsWith("--config=")) {
|
|
21
|
+
if (token.length === "--config=".length)
|
|
22
|
+
return false;
|
|
23
|
+
continue;
|
|
24
|
+
}
|
|
25
|
+
if (token.startsWith("-"))
|
|
26
|
+
return false;
|
|
27
|
+
return token === "lookup_operation";
|
|
28
|
+
}
|
|
29
|
+
return false;
|
|
30
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Command } from "commander";
|
|
2
|
+
import { type TargetPublicArtifactSnapshot, type TargetPublicArtifactSnapshotRequest } from "../target/publicArtifactSnapshot.js";
|
|
3
|
+
import { type TargetTopologyActivationResult } from "../target/topologyActivation.js";
|
|
4
|
+
import { type SelectedTargetReceipt, type TargetResourceRequest, type TargetTopologyAttestationRequest } from "../target/contracts.js";
|
|
5
|
+
import { type TargetOperation } from "./targetOperationDispatch.js";
|
|
6
|
+
import { type TargetMutationResult } from "./targetReceiptOutput.js";
|
|
7
|
+
import type { TargetDefaultConfig } from "./targetDefaultConfig.js";
|
|
8
|
+
import { type TargetOperationLookupLoader } from "./targetLookupCommands.js";
|
|
9
|
+
import type { TargetTopologyAttestationResult } from "../target/topologyAttestation.js";
|
|
10
|
+
import { type TargetWorldClockSession } from "./targetWorldClockCommand.js";
|
|
11
|
+
import { type TargetWorldReadinessSession } from "./targetWorldReadinessCommand.js";
|
|
12
|
+
type RequestFor<Operation extends TargetOperation> = Extract<TargetResourceRequest, {
|
|
13
|
+
operation: Operation;
|
|
14
|
+
}>;
|
|
15
|
+
export type TargetCommandHandlers = {
|
|
16
|
+
[Operation in TargetOperation]: (request: RequestFor<Operation>) => Promise<Operation extends "select_target" ? SelectedTargetReceipt : TargetMutationResult>;
|
|
17
|
+
};
|
|
18
|
+
export type TargetCommandSessionLoader = (configInput: unknown) => Promise<TargetCommandHandlerSession>;
|
|
19
|
+
export interface TargetCommandHandlerSession extends TargetWorldReadinessSession, TargetWorldClockSession {
|
|
20
|
+
run<Result>(invoke: (handlers: TargetCommandHandlers) => Promise<Result>): Promise<Result>;
|
|
21
|
+
activateTopology?(request: TargetTopologyAttestationRequest): Promise<TargetTopologyActivationResult>;
|
|
22
|
+
attestTopology?(request: TargetTopologyAttestationRequest): Promise<TargetTopologyAttestationResult>;
|
|
23
|
+
snapshotPublicArtifact?(request: TargetPublicArtifactSnapshotRequest): Promise<TargetPublicArtifactSnapshot>;
|
|
24
|
+
}
|
|
25
|
+
export interface TargetCommandStreams {
|
|
26
|
+
stderr(message: string): void;
|
|
27
|
+
stdout(message: string): void;
|
|
28
|
+
}
|
|
29
|
+
type SetTargetCommandExitCode = (exitCode: 1 | 2) => void;
|
|
30
|
+
export declare const registerTargetCommands: (program: Command, session: TargetCommandHandlerSession | TargetCommandSessionLoader, streams: TargetCommandStreams, setExitCode: SetTargetCommandExitCode, lookupLoader?: TargetOperationLookupLoader, worldReadinessSession?: (configInput: unknown) => Promise<TargetWorldReadinessSession & TargetWorldClockSession>) => Command;
|
|
31
|
+
export declare const createProductionTargetCommandSession: (config: TargetDefaultConfig) => TargetCommandHandlerSession;
|
|
32
|
+
export declare const registerProductionTargetCommands: (program: Command, streams: TargetCommandStreams, stdin: AsyncIterable<unknown>, setExitCode: SetTargetCommandExitCode) => void;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import { createCanonicalTargetTopologyReceiptBytes, createCanonicalSelectedTargetReceiptBytes, createTargetTopologyReceiptDigest } from "../target/handles.js";
|
|
2
|
+
import { createCanonicalTargetPublicArtifactSnapshotBytes } from "../target/publicArtifactSnapshot.js";
|
|
3
|
+
import { createCanonicalTargetTopologyActivationReceiptBytes, createTargetTopologyActivationReceiptDigest, parseTargetTopologyActivationReceipt } from "../target/topologyActivation.js";
|
|
4
|
+
import { parseSelectedTargetReceipt, parseTargetTopologyReceipt } from "../target/contracts.js";
|
|
5
|
+
import { TARGET_OPERATION_DISPATCH } from "./targetOperationDispatch.js";
|
|
6
|
+
import { emitCanonicalTargetMutationReceipt, formatCaughtTargetCliError, formatTargetCliError } from "./targetReceiptOutput.js";
|
|
7
|
+
import { readTargetRequestFile, readTargetPublicArtifactSnapshotRequestFile, readTargetTopologyAttestationRequestFile } from "./targetRequestFile.js";
|
|
8
|
+
import { readTargetDefaultConfigStdin, readTargetWorldReadinessConfigStdin } from "./targetDefaultConfigStdin.js";
|
|
9
|
+
import { createProductionTargetLookupLoader, registerTargetOperationLookup } from "./targetLookupCommands.js";
|
|
10
|
+
import { registerContainerBundleCommand } from "./containerBundleCommand.js";
|
|
11
|
+
import { registerTargetWorldClockCommand } from "./targetWorldClockCommand.js";
|
|
12
|
+
import { registerTargetWorldReadinessCommand, } from "./targetWorldReadinessCommand.js";
|
|
13
|
+
import { registerTargetComposedPreparationCommand } from "./targetComposedPreparationCommand.js";
|
|
14
|
+
import { createProductionTargetWorldQuerySession } from "./targetDefaultWorldQueries.js";
|
|
15
|
+
const operations = Object.keys(TARGET_OPERATION_DISPATCH);
|
|
16
|
+
const invoke = async (handlers, request) => {
|
|
17
|
+
const handler = handlers[request.operation];
|
|
18
|
+
return handler(request);
|
|
19
|
+
};
|
|
20
|
+
const emitSelection = (raw, streams) => {
|
|
21
|
+
const receipt = parseSelectedTargetReceipt(raw);
|
|
22
|
+
streams.stdout(createCanonicalSelectedTargetReceiptBytes(receipt));
|
|
23
|
+
};
|
|
24
|
+
const registerOperation = (target, operation, session, streams, setExitCode) => {
|
|
25
|
+
target.command(operation)
|
|
26
|
+
.description(`Execute the ${operation} target operation`)
|
|
27
|
+
.argument("<request-file>", "Strict target-resource request JSON file")
|
|
28
|
+
.action(async (requestFile) => {
|
|
29
|
+
let request;
|
|
30
|
+
try {
|
|
31
|
+
request = await readTargetRequestFile(requestFile);
|
|
32
|
+
if (request.operation !== operation)
|
|
33
|
+
throw new TypeError("operation mismatch");
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
streams.stderr(formatTargetCliError("request"));
|
|
37
|
+
setExitCode(2);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
let activeSession;
|
|
41
|
+
try {
|
|
42
|
+
activeSession = typeof session === "function"
|
|
43
|
+
? await session(target.opts().config)
|
|
44
|
+
: session;
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
streams.stderr("error: Invalid target configuration");
|
|
48
|
+
setExitCode(2);
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
try {
|
|
52
|
+
const result = await activeSession.run((handlers) => invoke(handlers, request));
|
|
53
|
+
if (operation === "select_target") {
|
|
54
|
+
emitSelection(result, streams);
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
emitCanonicalTargetMutationReceipt(result, streams.stdout);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
streams.stderr(formatCaughtTargetCliError(error, "Target operation crashed"));
|
|
62
|
+
setExitCode(1);
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
const emitTopologyReceipt = (raw, streams) => {
|
|
67
|
+
const receipt = parseTargetTopologyReceipt(raw.receipt);
|
|
68
|
+
const bytes = createCanonicalTargetTopologyReceiptBytes(receipt);
|
|
69
|
+
if (typeof raw.receiptBytes !== "string" || raw.receiptBytes !== bytes
|
|
70
|
+
|| receipt.receipt_digest !== createTargetTopologyReceiptDigest(receipt)) {
|
|
71
|
+
throw new TypeError("Target attestation returned a non-canonical receipt");
|
|
72
|
+
}
|
|
73
|
+
streams.stdout(bytes);
|
|
74
|
+
};
|
|
75
|
+
const emitTopologyActivationReceipt = (raw, streams) => {
|
|
76
|
+
const receipt = parseTargetTopologyActivationReceipt(raw.receipt);
|
|
77
|
+
const bytes = createCanonicalTargetTopologyActivationReceiptBytes(receipt);
|
|
78
|
+
if (typeof raw.receiptBytes !== "string" || raw.receiptBytes !== bytes
|
|
79
|
+
|| receipt.receipt_digest !== createTargetTopologyActivationReceiptDigest(receipt)) {
|
|
80
|
+
throw new TypeError("Target activation returned a non-canonical receipt");
|
|
81
|
+
}
|
|
82
|
+
streams.stdout(bytes);
|
|
83
|
+
};
|
|
84
|
+
const registerTopologyActivation = (target, session, streams, setExitCode) => {
|
|
85
|
+
target.command("activate_topology")
|
|
86
|
+
.description("Release one exact attested target topology")
|
|
87
|
+
.argument("<request-file>", "Strict target topology-attestation request JSON file")
|
|
88
|
+
.action(async (requestFile) => {
|
|
89
|
+
let request;
|
|
90
|
+
try {
|
|
91
|
+
request = await readTargetTopologyAttestationRequestFile(requestFile);
|
|
92
|
+
}
|
|
93
|
+
catch {
|
|
94
|
+
streams.stderr("error: Invalid target activation request");
|
|
95
|
+
setExitCode(2);
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
let activeSession;
|
|
99
|
+
try {
|
|
100
|
+
activeSession = typeof session === "function"
|
|
101
|
+
? await session(target.opts().config)
|
|
102
|
+
: session;
|
|
103
|
+
if (typeof activeSession.activateTopology !== "function")
|
|
104
|
+
throw new TypeError();
|
|
105
|
+
}
|
|
106
|
+
catch {
|
|
107
|
+
streams.stderr("error: Invalid target configuration");
|
|
108
|
+
setExitCode(2);
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
try {
|
|
112
|
+
emitTopologyActivationReceipt(await activeSession.activateTopology(request), streams);
|
|
113
|
+
}
|
|
114
|
+
catch (error) {
|
|
115
|
+
streams.stderr(formatCaughtTargetCliError(error, "Target topology activation crashed"));
|
|
116
|
+
setExitCode(1);
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
};
|
|
120
|
+
const registerTopologyAttestation = (target, session, streams, setExitCode) => {
|
|
121
|
+
target.command("attest_topology")
|
|
122
|
+
.description("Attest one exact composed target topology")
|
|
123
|
+
.argument("<request-file>", "Strict target topology-attestation request JSON file")
|
|
124
|
+
.action(async (requestFile) => {
|
|
125
|
+
let request;
|
|
126
|
+
try {
|
|
127
|
+
request = await readTargetTopologyAttestationRequestFile(requestFile);
|
|
128
|
+
}
|
|
129
|
+
catch {
|
|
130
|
+
streams.stderr("error: Invalid target attestation request");
|
|
131
|
+
setExitCode(2);
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
let activeSession;
|
|
135
|
+
try {
|
|
136
|
+
activeSession = typeof session === "function"
|
|
137
|
+
? await session(target.opts().config)
|
|
138
|
+
: session;
|
|
139
|
+
if (typeof activeSession.attestTopology !== "function")
|
|
140
|
+
throw new TypeError();
|
|
141
|
+
}
|
|
142
|
+
catch {
|
|
143
|
+
streams.stderr("error: Invalid target configuration");
|
|
144
|
+
setExitCode(2);
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
try {
|
|
148
|
+
emitTopologyReceipt(await activeSession.attestTopology(request), streams);
|
|
149
|
+
}
|
|
150
|
+
catch (error) {
|
|
151
|
+
streams.stderr(formatCaughtTargetCliError(error, "Target topology attestation crashed"));
|
|
152
|
+
setExitCode(1);
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
};
|
|
156
|
+
const registerPublicArtifactSnapshot = (target, session, streams, setExitCode) => {
|
|
157
|
+
target.command("snapshot_public_artifact")
|
|
158
|
+
.description("Read one exact bounded public artifact from a world service")
|
|
159
|
+
.argument("<request-file>", "Strict public artifact snapshot request JSON file")
|
|
160
|
+
.action(async (requestFile) => {
|
|
161
|
+
let request;
|
|
162
|
+
try {
|
|
163
|
+
request = await readTargetPublicArtifactSnapshotRequestFile(requestFile);
|
|
164
|
+
}
|
|
165
|
+
catch {
|
|
166
|
+
streams.stderr("error: Invalid public artifact snapshot request");
|
|
167
|
+
setExitCode(2);
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
let activeSession;
|
|
171
|
+
try {
|
|
172
|
+
activeSession = typeof session === "function"
|
|
173
|
+
? await session(target.opts().config)
|
|
174
|
+
: session;
|
|
175
|
+
if (typeof activeSession.snapshotPublicArtifact !== "function")
|
|
176
|
+
throw new TypeError();
|
|
177
|
+
}
|
|
178
|
+
catch {
|
|
179
|
+
streams.stderr("error: Invalid target configuration");
|
|
180
|
+
setExitCode(2);
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
try {
|
|
184
|
+
streams.stdout(createCanonicalTargetPublicArtifactSnapshotBytes(await activeSession.snapshotPublicArtifact(request)));
|
|
185
|
+
}
|
|
186
|
+
catch (error) {
|
|
187
|
+
streams.stderr(formatCaughtTargetCliError(error, "Target public artifact snapshot crashed"));
|
|
188
|
+
setExitCode(1);
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
};
|
|
192
|
+
export const registerTargetCommands = (program, session, streams, setExitCode, lookupLoader, worldReadinessSession) => {
|
|
193
|
+
const target = program.command("target").description("Execute target-resource operations");
|
|
194
|
+
if (typeof session === "function") {
|
|
195
|
+
target.requiredOption("--config <config-input>", "Strict target configuration JSON stdin; use -");
|
|
196
|
+
}
|
|
197
|
+
for (const operation of operations) {
|
|
198
|
+
registerOperation(target, operation, session, streams, setExitCode);
|
|
199
|
+
}
|
|
200
|
+
registerTargetComposedPreparationCommand(target, session, streams, setExitCode);
|
|
201
|
+
if (typeof session === "function" || typeof session.attestTopology === "function") {
|
|
202
|
+
registerTopologyAttestation(target, session, streams, setExitCode);
|
|
203
|
+
}
|
|
204
|
+
if (typeof session === "function" || typeof session.snapshotPublicArtifact === "function") {
|
|
205
|
+
registerPublicArtifactSnapshot(target, session, streams, setExitCode);
|
|
206
|
+
}
|
|
207
|
+
if (typeof session === "function" || typeof session.queryWorldReadiness === "function") {
|
|
208
|
+
registerTargetWorldReadinessCommand(target, worldReadinessSession ?? session, streams, setExitCode);
|
|
209
|
+
}
|
|
210
|
+
if (typeof session === "function" || typeof session.queryWorldClock === "function") {
|
|
211
|
+
registerTargetWorldClockCommand(target, worldReadinessSession ?? session, streams, setExitCode);
|
|
212
|
+
}
|
|
213
|
+
if (typeof session === "function" || typeof session.activateTopology === "function") {
|
|
214
|
+
registerTopologyActivation(target, session, streams, setExitCode);
|
|
215
|
+
}
|
|
216
|
+
if (lookupLoader)
|
|
217
|
+
registerTargetOperationLookup(target, lookupLoader, streams, setExitCode);
|
|
218
|
+
return target;
|
|
219
|
+
};
|
|
220
|
+
export const createProductionTargetCommandSession = (config) => Object.freeze({
|
|
221
|
+
activateTopology: async (request) => {
|
|
222
|
+
const { activateTargetDefaultTopology } = await import("./targetDefaultHandlers.js");
|
|
223
|
+
return activateTargetDefaultTopology(config, request);
|
|
224
|
+
},
|
|
225
|
+
run: async (invokeHandlers) => {
|
|
226
|
+
const { withTargetDefaultHandlerSession } = await import("./targetDefaultHandlers.js");
|
|
227
|
+
return withTargetDefaultHandlerSession(config, invokeHandlers);
|
|
228
|
+
},
|
|
229
|
+
attestTopology: async (request) => {
|
|
230
|
+
const { attestTargetDefaultTopology } = await import("./targetDefaultHandlers.js");
|
|
231
|
+
return attestTargetDefaultTopology(config, request);
|
|
232
|
+
},
|
|
233
|
+
queryWorldReadiness: async (request) => {
|
|
234
|
+
const { queryTargetDefaultWorldReadiness } = await import("./targetDefaultWorldReadiness.js");
|
|
235
|
+
return queryTargetDefaultWorldReadiness(config, request);
|
|
236
|
+
},
|
|
237
|
+
queryWorldClock: async (request) => {
|
|
238
|
+
const { queryTargetDefaultWorldClock } = await import("./targetDefaultWorldClock.js");
|
|
239
|
+
return queryTargetDefaultWorldClock(config, request);
|
|
240
|
+
},
|
|
241
|
+
snapshotPublicArtifact: async (request) => {
|
|
242
|
+
const { snapshotTargetDefaultPublicArtifact } = await import("./targetDefaultHandlers.js");
|
|
243
|
+
return snapshotTargetDefaultPublicArtifact(config, request);
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
export const registerProductionTargetCommands = (program, streams, stdin, setExitCode) => {
|
|
247
|
+
const target = registerTargetCommands(program, async (configInput) => {
|
|
248
|
+
if (configInput !== "-")
|
|
249
|
+
throw new TypeError("Invalid target configuration");
|
|
250
|
+
return createProductionTargetCommandSession(await readTargetDefaultConfigStdin(stdin));
|
|
251
|
+
}, streams, setExitCode, createProductionTargetLookupLoader(stdin), async (configInput) => {
|
|
252
|
+
if (configInput !== "-")
|
|
253
|
+
throw new TypeError("Invalid target configuration");
|
|
254
|
+
return createProductionTargetWorldQuerySession(await readTargetWorldReadinessConfigStdin(stdin));
|
|
255
|
+
});
|
|
256
|
+
registerContainerBundleCommand(target, stdin, streams, setExitCode);
|
|
257
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Command } from "commander";
|
|
2
|
+
import type { TargetCommandHandlerSession, TargetCommandSessionLoader, TargetCommandStreams } from "./targetCommands.js";
|
|
3
|
+
type SetExitCode = (exitCode: 1 | 2) => void;
|
|
4
|
+
/** Registers the sole aggregate preparation path consumed by Simfile. */
|
|
5
|
+
export declare const registerTargetComposedPreparationCommand: (target: Command, session: TargetCommandHandlerSession | TargetCommandSessionLoader, streams: TargetCommandStreams, setExitCode: SetExitCode) => void;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { createCanonicalComposedPreparationReceiptBytes, prepareComposedRun, } from "../target/composedPreparation.js";
|
|
2
|
+
import { formatCaughtTargetCliError } from "./targetReceiptOutput.js";
|
|
3
|
+
import { readComposedPreparationRequestFile } from "./targetRequestFile.js";
|
|
4
|
+
/** Registers the sole aggregate preparation path consumed by Simfile. */
|
|
5
|
+
export const registerTargetComposedPreparationCommand = (target, session, streams, setExitCode) => {
|
|
6
|
+
target.command("prepare_composed_run")
|
|
7
|
+
.description("Prepare one immutable composed-run target resource set")
|
|
8
|
+
.argument("<request-file>", "Strict composed-preparation request JSON file")
|
|
9
|
+
.action(async (requestFile) => {
|
|
10
|
+
let request;
|
|
11
|
+
try {
|
|
12
|
+
request = await readComposedPreparationRequestFile(requestFile);
|
|
13
|
+
}
|
|
14
|
+
catch {
|
|
15
|
+
streams.stderr("error: Invalid composed preparation request");
|
|
16
|
+
setExitCode(2);
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
let activeSession;
|
|
20
|
+
try {
|
|
21
|
+
activeSession = typeof session === "function"
|
|
22
|
+
? await session(target.opts().config)
|
|
23
|
+
: session;
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
streams.stderr("error: Invalid target configuration");
|
|
27
|
+
setExitCode(2);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
try {
|
|
31
|
+
const receipt = await activeSession.run((handlers) => prepareComposedRun(handlers, request));
|
|
32
|
+
streams.stdout(createCanonicalComposedPreparationReceiptBytes(receipt));
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
streams.stderr(formatCaughtTargetCliError(error, "Composed preparation crashed"));
|
|
36
|
+
setExitCode(1);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { TargetDefaultConfig } from "./targetDefaultConfig.js";
|
|
2
|
+
import type { DockerArtifactIdentityBinding, DockerArtifactIdentityStore, DockerArtifactMapping } from "../target/dockerArtifactsProvider.js";
|
|
3
|
+
import type { TargetJournalStore } from "../target/journal.js";
|
|
4
|
+
export declare const completedTargetArtifacts: (journal: TargetJournalStore, identities: DockerArtifactIdentityStore) => Promise<readonly DockerArtifactIdentityBinding[]>;
|
|
5
|
+
export declare const exactTargetArtifactMapping: (config: TargetDefaultConfig, binding: DockerArtifactIdentityBinding) => DockerArtifactMapping;
|