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
|
@@ -1,115 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { collectRegistryDriftObservations } from "../status/index.js";
|
|
1
|
+
import { listDeploymentRecords } from "../deployment/index.js";
|
|
2
|
+
import { normalizeProjectLabelSlug } from "../distribution/index.js";
|
|
4
3
|
import { resolveProjectOutputDirectory } from "../filesystem/index.js";
|
|
5
|
-
import { DEFAULT_OUTPUT_DIRECTORY, errorExitCode
|
|
4
|
+
import { DEFAULT_OUTPUT_DIRECTORY, errorExitCode } from "../shared/index.js";
|
|
5
|
+
import { collectCompiledProbeObservations, collectDeploymentLogObservations, collectMoltnetProbeObservations, collectRuntimeProbeObservations, createDeploymentSummaries, createStaticStatus, exitCodeForStatus, loadCompileReport, readCompiledProbeFile, renderStatus, resolveStatusSelector } from "../status/index.js";
|
|
6
6
|
import { resolveCommandInput } from "./resolveCommandInput.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
const inputFailure = (message) => ({
|
|
10
|
-
error: message,
|
|
11
|
-
exitCode: 2
|
|
12
|
-
});
|
|
13
|
-
const resolveOutputMode = (options) => {
|
|
14
|
-
const modes = [
|
|
15
|
-
...(options.json ? ["json"] : []),
|
|
16
|
-
...(options.pretty ? ["pretty"] : []),
|
|
17
|
-
...(options.quiet ? ["quiet"] : [])
|
|
18
|
-
];
|
|
19
|
-
if (modes.length > 1) {
|
|
20
|
-
return inputFailure("Choose only one status output mode: --pretty, --json, or --quiet");
|
|
21
|
-
}
|
|
22
|
-
return modes[0] ?? "pretty";
|
|
23
|
-
};
|
|
24
|
-
const resolveSelectorInput = (options) => {
|
|
25
|
-
const selectors = [
|
|
26
|
-
...(options.agent ? [{ kind: "agent", value: options.agent }] : []),
|
|
27
|
-
...(options.team ? [{ kind: "team", value: options.team }] : []),
|
|
28
|
-
...(options.network ? [{ kind: "network", value: options.network }] : []),
|
|
29
|
-
...(options.runtime ? [{ kind: "runtime", value: options.runtime }] : [])
|
|
30
|
-
];
|
|
31
|
-
if (selectors.length > 1) {
|
|
32
|
-
return inputFailure("Choose only one status selector: --agent, --team, --network, or --runtime");
|
|
33
|
-
}
|
|
34
|
-
return selectors[0] ?? null;
|
|
35
|
-
};
|
|
36
|
-
const resolveTimeoutMs = (options) => {
|
|
37
|
-
if (!options.timeout) {
|
|
38
|
-
return undefined;
|
|
39
|
-
}
|
|
40
|
-
const parsed = Number(options.timeout);
|
|
41
|
-
if (!Number.isInteger(parsed) || parsed <= 0) {
|
|
42
|
-
return inputFailure("status --timeout must be a positive integer number of milliseconds");
|
|
43
|
-
}
|
|
44
|
-
return parsed;
|
|
45
|
-
};
|
|
46
|
-
const resolveDeploymentRecords = (records, options) => {
|
|
47
|
-
if (options.deployment) {
|
|
48
|
-
const record = records.find((entry) => entry.record.name === options.deployment);
|
|
49
|
-
return record
|
|
50
|
-
? [record]
|
|
51
|
-
: inputFailure(`Unknown deployment "${options.deployment}". Valid deployments: ${records.map((entry) => entry.record.name).sort().join(", ") || "none"}`);
|
|
52
|
-
}
|
|
53
|
-
if (options.live && records.length > 1) {
|
|
54
|
-
return inputFailure(`status --live requires --deployment when multiple records exist: ${records.map((entry) => entry.record.name).sort().join(", ")}`);
|
|
55
|
-
}
|
|
56
|
-
return records;
|
|
57
|
-
};
|
|
58
|
-
const inspectDeployments = async (records, handlers, options, timeoutMs) => {
|
|
59
|
-
if (!options.live) {
|
|
60
|
-
return new Map();
|
|
61
|
-
}
|
|
62
|
-
const inspect = handlers.inspectDockerDeployment ?? inspectDockerDeployment;
|
|
63
|
-
const inspections = await Promise.all(records.map(async ({ record }) => [
|
|
64
|
-
record.name,
|
|
65
|
-
await inspect(record, {
|
|
66
|
-
dockerCommand: options.dockerCommand,
|
|
67
|
-
timeoutMs
|
|
68
|
-
})
|
|
69
|
-
]));
|
|
70
|
-
return new Map(inspections);
|
|
71
|
-
};
|
|
72
|
-
const containsFromView = (view) => flattenOrganizationNodes(view).map((node) => ({ id: node.id, kind: node.kind }));
|
|
73
|
-
const runtimeInstanceIdsFromReport = (loadedReport) => loadedReport.kind === "loaded"
|
|
74
|
-
? loadedReport.report.runtimeInstances.map((instance) => instance.id).sort()
|
|
75
|
-
: [];
|
|
76
|
-
const recoverContextDeployments = async (input) => {
|
|
77
|
-
const recover = input.handlers.recoverDockerDeploymentRecords ?? recoverDockerDeploymentRecords;
|
|
78
|
-
return recover({
|
|
79
|
-
contains: containsFromView(input.view),
|
|
80
|
-
context: input.options.context,
|
|
81
|
-
dockerCommand: input.options.dockerCommand,
|
|
82
|
-
outputDirectory: input.outputDirectory,
|
|
83
|
-
projectLabel: input.projectLabel,
|
|
84
|
-
runtimeInstanceIds: runtimeInstanceIdsFromReport(input.loadedReport),
|
|
85
|
-
sourceRoot: input.sourceRoot,
|
|
86
|
-
timeoutMs: input.timeoutMs
|
|
87
|
-
});
|
|
88
|
-
};
|
|
89
|
-
const resolveAuthValues = async (records, handlers) => {
|
|
90
|
-
const values = {};
|
|
91
|
-
if (!handlers.requireAuthProfile) {
|
|
92
|
-
return values;
|
|
93
|
-
}
|
|
94
|
-
const profileNames = [...new Set(records
|
|
95
|
-
.map(({ record }) => record.auth_profile)
|
|
96
|
-
.filter((profileName) => typeof profileName === "string" && profileName.length > 0))];
|
|
97
|
-
for (const profileName of profileNames) {
|
|
98
|
-
try {
|
|
99
|
-
const profile = await handlers.requireAuthProfile(profileName);
|
|
100
|
-
Object.assign(values, profile.env);
|
|
101
|
-
}
|
|
102
|
-
catch {
|
|
103
|
-
// Missing profile values are reported by the metadata layer as unknown credentials.
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
return values;
|
|
107
|
-
};
|
|
108
|
-
const emitOutput = (streams, output) => {
|
|
109
|
-
for (const line of output.split("\n")) {
|
|
110
|
-
streams.stdout(line);
|
|
111
|
-
}
|
|
112
|
-
};
|
|
7
|
+
import { inspectDeployments, recoverContextDeployments, resolveDeploymentRecords, resolveStatusAuthValues, runHomeDeploymentStatus, runStaticImageStatus } from "./statusCommandLive.js";
|
|
8
|
+
import { emitStatusOutput, resolveStatusOutputMode, resolveStatusSelectorInput, resolveStatusTimeoutMs, statusInputFailure } from "./statusCommandOptions.js";
|
|
113
9
|
const wait = (ms) => new Promise((resolve) => {
|
|
114
10
|
setTimeout(resolve, ms);
|
|
115
11
|
});
|
|
@@ -129,173 +25,45 @@ export const executeStatusWatch = async (inputPath, options, handlers, streams,
|
|
|
129
25
|
return;
|
|
130
26
|
}
|
|
131
27
|
if (result.output) {
|
|
132
|
-
|
|
28
|
+
emitStatusOutput(streams, result.output);
|
|
133
29
|
}
|
|
134
30
|
iteration += 1;
|
|
135
31
|
}
|
|
136
32
|
};
|
|
137
|
-
/* v8 ignore start -- docker extraction is covered by distribution E2E */
|
|
138
|
-
const runStaticImageStatus = async (imageRef, options, json) => {
|
|
139
|
-
try {
|
|
140
|
-
const inspection = await extractImageReport(imageRef, {
|
|
141
|
-
dockerCommand: options.dockerCommand,
|
|
142
|
-
dockerContext: options.context,
|
|
143
|
-
pull: options.pull
|
|
144
|
-
});
|
|
145
|
-
return {
|
|
146
|
-
exitCode: 0,
|
|
147
|
-
output: renderImageInterface(inspection.report, { imageRef, json })
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
catch (error) {
|
|
151
|
-
// Input errors (bad labels, non-JSON report, fingerprint mismatch) exit 2;
|
|
152
|
-
// Docker/runtime failures (daemon down, pull/create failure) exit 1.
|
|
153
|
-
return {
|
|
154
|
-
error: error instanceof Error ? error.message : String(error),
|
|
155
|
-
exitCode: errorExitCode(error)
|
|
156
|
-
};
|
|
157
|
-
}
|
|
158
|
-
};
|
|
159
|
-
/* v8 ignore stop */
|
|
160
|
-
const runHomeDeploymentStatus = async (options, handlers, mode, timeoutMs) => {
|
|
161
|
-
let records;
|
|
162
|
-
try {
|
|
163
|
-
records = await listHomeDeploymentRecords();
|
|
164
|
-
}
|
|
165
|
-
catch (error) {
|
|
166
|
-
return { error: error instanceof Error ? error.message : String(error), exitCode: errorExitCode(error) };
|
|
167
|
-
}
|
|
168
|
-
if (!options.deployment) {
|
|
169
|
-
if (records.length === 0) {
|
|
170
|
-
return inputFailure("No image deployments found in the home store");
|
|
171
|
-
}
|
|
172
|
-
if (records.length > 1) {
|
|
173
|
-
return inputFailure(`status --deployment is required: ${records.map((entry) => entry.record.name).sort().join(", ")}`);
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
const targetName = options.deployment ?? records[0].record.name;
|
|
177
|
-
const match = records.find((entry) => entry.record.name === targetName);
|
|
178
|
-
if (!match) {
|
|
179
|
-
return inputFailure(`Unknown deployment "${targetName}". Valid deployments: ${records.map((entry) => entry.record.name).sort().join(", ") || "none"}`);
|
|
180
|
-
}
|
|
181
|
-
let report;
|
|
182
|
-
try {
|
|
183
|
-
const record = await readHomeDeploymentRecord(targetName);
|
|
184
|
-
void record;
|
|
185
|
-
const raw = await readHomeDeploymentReport(targetName);
|
|
186
|
-
let parsed;
|
|
187
|
-
try {
|
|
188
|
-
parsed = JSON.parse(raw);
|
|
189
|
-
}
|
|
190
|
-
catch (error) {
|
|
191
|
-
// A corrupt cached report is bad input, not a runtime failure: exit 2.
|
|
192
|
-
throw new SpawnfileError("validation_error", `Cached report for "${targetName}" is not valid JSON: ${error instanceof Error ? error.message : String(error)}`);
|
|
193
|
-
}
|
|
194
|
-
report = parseDistributionReport(parsed);
|
|
195
|
-
}
|
|
196
|
-
catch (error) {
|
|
197
|
-
return { error: error instanceof Error ? error.message : String(error), exitCode: errorExitCode(error) };
|
|
198
|
-
}
|
|
199
|
-
const view = projectImageOrganizationView(report, match.record.source.kind === "image"
|
|
200
|
-
? match.record.source.ref
|
|
201
|
-
: targetName);
|
|
202
|
-
const reportPath = match.path.replace(/record\.json$/, "spawnfile-report.json");
|
|
203
|
-
const loadedReport = loadedImageCompileReport(report, reportPath);
|
|
204
|
-
const selectedRecords = [match];
|
|
205
|
-
const deploymentInspections = await inspectDeployments(selectedRecords, handlers, options, timeoutMs);
|
|
206
|
-
const recordValues = selectedRecords.map(({ record }) => record);
|
|
207
|
-
const authValues = options.live ? await resolveAuthValues(selectedRecords, handlers) : {};
|
|
208
|
-
const collectRuntimeProbes = handlers.collectRuntimeProbeObservations ?? collectRuntimeProbeObservations;
|
|
209
|
-
const collectMoltnetProbes = handlers.collectMoltnetProbeObservations ?? collectMoltnetProbeObservations;
|
|
210
|
-
const collectDeploymentLogs = handlers.collectDeploymentLogObservations ?? collectDeploymentLogObservations;
|
|
211
|
-
const liveObservations = options.live && !options.recover
|
|
212
|
-
? [
|
|
213
|
-
...await collectRuntimeProbes({
|
|
214
|
-
deployments: recordValues,
|
|
215
|
-
inspections: deploymentInspections,
|
|
216
|
-
loadedReport,
|
|
217
|
-
timeoutMs
|
|
218
|
-
}),
|
|
219
|
-
...await collectMoltnetProbes({
|
|
220
|
-
authValues,
|
|
221
|
-
deployments: recordValues,
|
|
222
|
-
inspections: deploymentInspections,
|
|
223
|
-
loadedReport,
|
|
224
|
-
timeoutMs
|
|
225
|
-
}),
|
|
226
|
-
...(options.logs
|
|
227
|
-
? await collectDeploymentLogs({
|
|
228
|
-
deployments: recordValues,
|
|
229
|
-
dockerCommand: options.dockerCommand,
|
|
230
|
-
loadedReport,
|
|
231
|
-
timeoutMs
|
|
232
|
-
})
|
|
233
|
-
: []),
|
|
234
|
-
...(options.pullCheck
|
|
235
|
-
? await collectRegistryDriftObservations({
|
|
236
|
-
deployments: recordValues,
|
|
237
|
-
dockerCommand: options.dockerCommand,
|
|
238
|
-
timeoutMs
|
|
239
|
-
})
|
|
240
|
-
: [])
|
|
241
|
-
]
|
|
242
|
-
: [];
|
|
243
|
-
const status = createStaticStatus(view, loadedReport, {
|
|
244
|
-
deployments: createDeploymentSummaries(selectedRecords, deploymentInspections),
|
|
245
|
-
inputPath: view.inputPath,
|
|
246
|
-
live: {
|
|
247
|
-
context: null,
|
|
248
|
-
deploymentName: targetName,
|
|
249
|
-
logs: options.logs ?? false,
|
|
250
|
-
recover: false,
|
|
251
|
-
requested: options.live ?? false
|
|
252
|
-
},
|
|
253
|
-
liveObservations,
|
|
254
|
-
outputDirectory: "",
|
|
255
|
-
selection: null
|
|
256
|
-
});
|
|
257
|
-
return { exitCode: exitCodeForStatus(status), output: renderStatus(status, { mode }), status };
|
|
258
|
-
};
|
|
259
33
|
export const executeStatusCommand = async (inputPath, options, handlers) => {
|
|
260
|
-
const mode =
|
|
34
|
+
const mode = resolveStatusOutputMode(options);
|
|
261
35
|
if (typeof mode !== "string") {
|
|
262
36
|
return mode;
|
|
263
37
|
}
|
|
264
38
|
if (options.logs && !options.live) {
|
|
265
|
-
return
|
|
39
|
+
return statusInputFailure("status --logs requires --live");
|
|
266
40
|
}
|
|
267
|
-
// A positional image reference without --deployment renders the static
|
|
268
|
-
// interface from the embedded report. Image ref with --deployment, or a bare
|
|
269
|
-
// --deployment on the default path, reads the home store.
|
|
270
|
-
// A clear image reference (tag/digest/registry, or forced with --image)
|
|
271
|
-
// without --deployment renders the static interface; any other positional is
|
|
272
|
-
// treated as a project path (the view builder reports a missing path).
|
|
273
41
|
const commandInput = resolveCommandInput(inputPath, { forceImage: options.image });
|
|
274
42
|
const usedDefaultPath = inputPath === process.cwd();
|
|
275
43
|
if (commandInput.kind === "image" && !options.deployment) {
|
|
276
44
|
return runStaticImageStatus(commandInput.ref, options, mode === "json");
|
|
277
45
|
}
|
|
278
46
|
if (options.deployment && !options.context && (commandInput.kind === "image" || usedDefaultPath)) {
|
|
279
|
-
const timeoutForHome =
|
|
47
|
+
const timeoutForHome = resolveStatusTimeoutMs(options);
|
|
280
48
|
if (typeof timeoutForHome !== "number" && timeoutForHome !== undefined) {
|
|
281
49
|
return timeoutForHome;
|
|
282
50
|
}
|
|
283
51
|
return runHomeDeploymentStatus(options, handlers, mode, timeoutForHome);
|
|
284
52
|
}
|
|
285
53
|
if (options.context && !options.live) {
|
|
286
|
-
return
|
|
54
|
+
return statusInputFailure("status --context requires --live");
|
|
287
55
|
}
|
|
288
56
|
if (options.logs && !options.live) {
|
|
289
|
-
return
|
|
57
|
+
return statusInputFailure("status --logs requires --live");
|
|
290
58
|
}
|
|
291
59
|
if (options.recover && !options.context) {
|
|
292
|
-
return
|
|
60
|
+
return statusInputFailure("status --recover requires --context");
|
|
293
61
|
}
|
|
294
|
-
const timeoutMs =
|
|
62
|
+
const timeoutMs = resolveStatusTimeoutMs(options);
|
|
295
63
|
if (typeof timeoutMs !== "number" && timeoutMs !== undefined) {
|
|
296
64
|
return timeoutMs;
|
|
297
65
|
}
|
|
298
|
-
const selectorInput =
|
|
66
|
+
const selectorInput = resolveStatusSelectorInput(options);
|
|
299
67
|
if (selectorInput && "exitCode" in selectorInput) {
|
|
300
68
|
return selectorInput;
|
|
301
69
|
}
|
|
@@ -337,7 +105,7 @@ export const executeStatusCommand = async (inputPath, options, handlers) => {
|
|
|
337
105
|
const deploymentInspections = await inspectDeployments(selectedDeploymentRecords, handlers, options, timeoutMs);
|
|
338
106
|
const selectedDeploymentRecordValues = selectedDeploymentRecords.map(({ record }) => record);
|
|
339
107
|
const authValues = options.live
|
|
340
|
-
? await
|
|
108
|
+
? await resolveStatusAuthValues(selectedDeploymentRecords, handlers)
|
|
341
109
|
: {};
|
|
342
110
|
const collectRuntimeProbes = handlers.collectRuntimeProbeObservations ?? collectRuntimeProbeObservations;
|
|
343
111
|
const collectMoltnetProbes = handlers.collectMoltnetProbeObservations ?? collectMoltnetProbeObservations;
|
|
@@ -367,7 +135,9 @@ export const executeStatusCommand = async (inputPath, options, handlers) => {
|
|
|
367
135
|
: [])
|
|
368
136
|
]
|
|
369
137
|
: [];
|
|
138
|
+
const compiledProbeObservations = await collectCompiledProbeObservations(loadedReport, outputDirectory, readCompiledProbeFile, handlers.compiledProbeCollectors);
|
|
370
139
|
const status = createStaticStatus(view, loadedReport, {
|
|
140
|
+
compiledProbeObservations,
|
|
371
141
|
deployments: createDeploymentSummaries(selectedDeploymentRecords, deploymentInspections),
|
|
372
142
|
inputPath,
|
|
373
143
|
live: {
|
|
@@ -422,7 +192,7 @@ export const registerStatusCommand = (program, handlers, streams, setExitCode) =
|
|
|
422
192
|
streams.stderr(`error: ${result.error}`);
|
|
423
193
|
}
|
|
424
194
|
if (result.output) {
|
|
425
|
-
|
|
195
|
+
emitStatusOutput(streams, result.output);
|
|
426
196
|
}
|
|
427
197
|
});
|
|
428
198
|
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { OrganizationView } from "../compiler/index.js";
|
|
2
|
+
import { listDeploymentRecords, type DockerInspectionResult } from "../deployment/index.js";
|
|
3
|
+
import { loadCompileReport, type StatusCommandResult, type StatusOutputMode } from "../status/index.js";
|
|
4
|
+
import { type StatusCommandHandlers, type StatusCommandHandlersWithLive, type StatusCommandLiveHandlers, type StatusCommandOptions } from "./statusCommandOptions.js";
|
|
5
|
+
export type LoadedDeploymentRecord = Awaited<ReturnType<typeof listDeploymentRecords>>[number];
|
|
6
|
+
export declare const resolveDeploymentRecords: (records: LoadedDeploymentRecord[], options: StatusCommandOptions) => LoadedDeploymentRecord[] | StatusCommandResult;
|
|
7
|
+
export declare const inspectDeployments: (records: LoadedDeploymentRecord[], handlers: StatusCommandLiveHandlers, options: StatusCommandOptions, timeoutMs: number | undefined) => Promise<Map<string, DockerInspectionResult>>;
|
|
8
|
+
export declare const recoverContextDeployments: (input: {
|
|
9
|
+
handlers: StatusCommandLiveHandlers;
|
|
10
|
+
loadedReport: Awaited<ReturnType<typeof loadCompileReport>>;
|
|
11
|
+
options: StatusCommandOptions;
|
|
12
|
+
outputDirectory: string;
|
|
13
|
+
projectLabel: string;
|
|
14
|
+
sourceRoot: string;
|
|
15
|
+
timeoutMs: number | undefined;
|
|
16
|
+
view: OrganizationView;
|
|
17
|
+
}) => Promise<LoadedDeploymentRecord[]>;
|
|
18
|
+
export declare const resolveStatusAuthValues: (records: LoadedDeploymentRecord[], handlers: StatusCommandHandlers) => Promise<Record<string, string>>;
|
|
19
|
+
export declare const runStaticImageStatus: (imageRef: string, options: StatusCommandOptions, json: boolean) => Promise<StatusCommandResult>;
|
|
20
|
+
export declare const runHomeDeploymentStatus: (options: StatusCommandOptions, handlers: StatusCommandHandlersWithLive, mode: StatusOutputMode, timeoutMs: number | undefined) => Promise<StatusCommandResult>;
|
|
@@ -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
|
+
};
|