spawnfile 0.1.13 → 0.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +50 -11
- package/dist/audit/auditCli.d.ts +19 -0
- package/dist/audit/auditCli.js +63 -0
- package/dist/audit/checks.d.ts +100 -0
- package/dist/audit/checks.js +279 -0
- package/dist/audit/checksShared.d.ts +74 -0
- package/dist/audit/checksShared.js +37 -0
- package/dist/audit/generateAudit.d.ts +19 -0
- package/dist/audit/generateAudit.js +122 -0
- package/dist/audit/index.d.ts +4 -0
- package/dist/audit/index.js +4 -0
- package/dist/audit/readAudit.d.ts +50 -0
- package/dist/audit/readAudit.js +59 -0
- package/dist/audit/types.d.ts +40 -0
- package/dist/audit/types.js +8 -0
- package/dist/auth/credentialEnvFile.d.ts +11 -0
- package/dist/auth/credentialEnvFile.js +60 -0
- package/dist/auth/credentialProvisioning.d.ts +15 -0
- package/dist/auth/credentialProvisioning.js +75 -0
- package/dist/auth/credentialProvisioningReceipt.d.ts +28 -0
- package/dist/auth/credentialProvisioningReceipt.js +70 -0
- package/dist/auth/credentialProvisioningRequest.d.ts +51 -0
- package/dist/auth/credentialProvisioningRequest.js +169 -0
- package/dist/auth/credentialWorldBindings.d.ts +21 -0
- package/dist/auth/credentialWorldBindings.js +104 -0
- package/dist/auth/index.d.ts +7 -0
- package/dist/auth/index.js +7 -0
- package/dist/auth/paths.d.ts +11 -0
- package/dist/auth/paths.js +21 -0
- package/dist/auth/targetSecretSourceAuthor.d.ts +18 -0
- package/dist/auth/targetSecretSourceAuthor.js +52 -0
- package/dist/auth/targetSecretSourceFsPublish.d.ts +15 -0
- package/dist/auth/targetSecretSourceFsPublish.js +49 -0
- package/dist/auth/targetSecretSourceFsPublishImmutable.d.ts +16 -0
- package/dist/auth/targetSecretSourceFsPublishImmutable.js +435 -0
- package/dist/auth/targetSecretSourceFsRead.d.ts +14 -0
- package/dist/auth/targetSecretSourceFsRead.js +198 -0
- package/dist/auth/targetSecretSourceGrant.d.ts +16 -0
- package/dist/auth/targetSecretSourceGrant.js +99 -0
- package/dist/auth/targetSecretSourceGrantRecords.d.ts +84 -0
- package/dist/auth/targetSecretSourceGrantRecords.js +214 -0
- package/dist/auth/targetSecretSourceLifecycle.d.ts +30 -0
- package/dist/auth/targetSecretSourceLifecycle.js +52 -0
- package/dist/auth/targetSecretSourceOwnerEntropy.d.ts +6 -0
- package/dist/auth/targetSecretSourceOwnerEntropy.js +28 -0
- package/dist/auth/targetSecretSourceRecordCommon.d.ts +14 -0
- package/dist/auth/targetSecretSourceRecordCommon.js +100 -0
- package/dist/auth/targetSecretSourceRecordPublish.d.ts +10 -0
- package/dist/auth/targetSecretSourceRecordPublish.js +104 -0
- package/dist/auth/targetSecretSourceResolver.d.ts +10 -0
- package/dist/auth/targetSecretSourceResolver.js +137 -0
- package/dist/auth/targetSecretSourceRevoke.d.ts +20 -0
- package/dist/auth/targetSecretSourceRevoke.js +92 -0
- package/dist/auth/targetSecretSourceRotate.d.ts +19 -0
- package/dist/auth/targetSecretSourceRotate.js +121 -0
- package/dist/auth/targetSecretSourceVersionRecords.d.ts +49 -0
- package/dist/auth/targetSecretSourceVersionRecords.js +166 -0
- package/dist/cli/artifactsCommands.d.ts +27 -0
- package/dist/cli/artifactsCommands.js +132 -0
- package/dist/cli/authCommands.d.ts +5 -0
- package/dist/cli/authCommands.js +221 -0
- package/dist/cli/compileBuildCommands.d.ts +3 -0
- package/dist/cli/compileBuildCommands.js +35 -0
- package/dist/cli/containerBundleCommand.d.ts +6 -0
- package/dist/cli/containerBundleCommand.js +116 -0
- package/dist/cli/downCommand.d.ts +25 -0
- package/dist/cli/downCommand.js +134 -0
- package/dist/cli/index.js +6 -3
- package/dist/cli/lifecycleCommands.d.ts +1 -1
- package/dist/cli/lifecycleCommands.js +11 -181
- package/dist/cli/lifecycleMachine.d.ts +19 -0
- package/dist/cli/lifecycleMachine.js +78 -0
- package/dist/cli/lifecyclePlan.d.ts +35 -0
- package/dist/cli/lifecyclePlan.js +240 -0
- package/dist/cli/lifecyclePlanningCommands.d.ts +3 -0
- package/dist/cli/lifecyclePlanningCommands.js +30 -0
- package/dist/cli/runCli.d.ts +9 -2
- package/dist/cli/runCli.js +27 -71
- package/dist/cli/runPublishCommands.d.ts +3 -0
- package/dist/cli/runPublishCommands.js +70 -0
- package/dist/cli/statusCommand.d.ts +3 -33
- package/dist/cli/statusCommand.js +19 -249
- package/dist/cli/statusCommandLive.d.ts +20 -0
- package/dist/cli/statusCommandLive.js +188 -0
- package/dist/cli/statusCommandOptions.d.ts +40 -0
- package/dist/cli/statusCommandOptions.js +42 -0
- package/dist/cli/targetCliRoute.d.ts +2 -0
- package/dist/cli/targetCliRoute.js +30 -0
- package/dist/cli/targetCommands.d.ts +33 -0
- package/dist/cli/targetCommands.js +257 -0
- package/dist/cli/targetComposedPreparationCommand.d.ts +6 -0
- package/dist/cli/targetComposedPreparationCommand.js +39 -0
- package/dist/cli/targetDefaultArtifactAuthority.d.ts +5 -0
- package/dist/cli/targetDefaultArtifactAuthority.js +28 -0
- package/dist/cli/targetDefaultAuthorities.d.ts +53 -0
- package/dist/cli/targetDefaultAuthorities.js +210 -0
- package/dist/cli/targetDefaultConfig.d.ts +68 -0
- package/dist/cli/targetDefaultConfig.js +317 -0
- package/dist/cli/targetDefaultConfigStdin.d.ts +13 -0
- package/dist/cli/targetDefaultConfigStdin.js +215 -0
- package/dist/cli/targetDefaultEnvelope.d.ts +1 -0
- package/dist/cli/targetDefaultEnvelope.js +13 -0
- package/dist/cli/targetDefaultHandlerFactory.d.ts +28 -0
- package/dist/cli/targetDefaultHandlerFactory.js +247 -0
- package/dist/cli/targetDefaultHandlers.d.ts +21 -0
- package/dist/cli/targetDefaultHandlers.js +72 -0
- package/dist/cli/targetDefaultJournalAuthority.d.ts +35 -0
- package/dist/cli/targetDefaultJournalAuthority.js +135 -0
- package/dist/cli/targetDefaultWorldClock.d.ts +4 -0
- package/dist/cli/targetDefaultWorldClock.js +14 -0
- package/dist/cli/targetDefaultWorldQueries.d.ts +5 -0
- package/dist/cli/targetDefaultWorldQueries.js +11 -0
- package/dist/cli/targetDefaultWorldReadiness.d.ts +4 -0
- package/dist/cli/targetDefaultWorldReadiness.js +17 -0
- package/dist/cli/targetEvidenceHelperResolution.d.ts +14 -0
- package/dist/cli/targetEvidenceHelperResolution.js +23 -0
- package/dist/cli/targetLookupCli.d.ts +3 -0
- package/dist/cli/targetLookupCli.js +31 -0
- package/dist/cli/targetLookupCommands.d.ts +12 -0
- package/dist/cli/targetLookupCommands.js +69 -0
- package/dist/cli/targetOperationDispatch.d.ts +58 -0
- package/dist/cli/targetOperationDispatch.js +21 -0
- package/dist/cli/targetReceiptOutput.d.ts +14 -0
- package/dist/cli/targetReceiptOutput.js +21 -0
- package/dist/cli/targetRequestFile.d.ts +14 -0
- package/dist/cli/targetRequestFile.js +63 -0
- package/dist/cli/targetSecretSourceInput.d.ts +28 -0
- package/dist/cli/targetSecretSourceInput.js +121 -0
- package/dist/cli/targetWorldClockCommand.d.ts +10 -0
- package/dist/cli/targetWorldClockCommand.js +42 -0
- package/dist/cli/targetWorldClockCrossProcess.test-helper.d.ts +13 -0
- package/dist/cli/targetWorldClockCrossProcess.test-helper.js +109 -0
- package/dist/cli/targetWorldReadinessCommand.d.ts +10 -0
- package/dist/cli/targetWorldReadinessCommand.js +43 -0
- package/dist/cli/upCommand.d.ts +3 -0
- package/dist/cli/upCommand.js +133 -0
- package/dist/cli/upImageCommand.d.ts +11 -0
- package/dist/cli/upImageCommand.js +41 -0
- package/dist/cli/upLifecycleInvocation.d.ts +41 -0
- package/dist/cli/upLifecycleInvocation.js +48 -0
- package/dist/cli/upLifecycleRecovery.d.ts +4 -0
- package/dist/cli/upLifecycleRecovery.js +53 -0
- package/dist/compiler/agentNodeMerge.d.ts +2 -0
- package/dist/compiler/agentNodeMerge.js +79 -0
- package/dist/compiler/agentSurfaces.js +11 -1
- package/dist/compiler/buildCompilePlan.js +17 -0
- package/dist/compiler/buildCompilePlanAgent.d.ts +11 -0
- package/dist/compiler/buildCompilePlanAgent.js +56 -0
- package/dist/compiler/buildCompilePlanTeams.d.ts +1 -0
- package/dist/compiler/buildCompilePlanTeams.js +4 -1
- package/dist/compiler/buildCompilePlanTraversal.js +75 -82
- package/dist/compiler/buildProject.d.ts +11 -0
- package/dist/compiler/buildProject.js +77 -2
- package/dist/compiler/compilePlanHelpers.js +2 -0
- package/dist/compiler/compileProject.d.ts +13 -0
- package/dist/compiler/compileProject.js +26 -74
- package/dist/compiler/compileProjectPolicy.d.ts +5 -0
- package/dist/compiler/compileProjectPolicy.js +21 -0
- package/dist/compiler/compileProjectReports.d.ts +9 -0
- package/dist/compiler/compileProjectReports.js +52 -0
- package/dist/compiler/containerArtifactSummaries.d.ts +7 -0
- package/dist/compiler/containerArtifactSummaries.js +138 -0
- package/dist/compiler/containerArtifacts.d.ts +10 -0
- package/dist/compiler/containerArtifacts.js +126 -125
- package/dist/compiler/containerArtifactsPlans.d.ts +5 -3
- package/dist/compiler/containerArtifactsPlans.js +31 -118
- package/dist/compiler/containerArtifactsRender.d.ts +3 -1
- package/dist/compiler/containerArtifactsRender.js +15 -12
- package/dist/compiler/containerArtifactsTypes.d.ts +12 -0
- package/dist/compiler/containerConfigEnvRender.d.ts +3 -0
- package/dist/compiler/containerConfigEnvRender.js +54 -0
- package/dist/compiler/containerEntrypointRender.d.ts +1 -0
- package/dist/compiler/containerEntrypointRender.js +56 -52
- package/dist/compiler/containerEntrypointShell.d.ts +5 -0
- package/dist/compiler/containerEntrypointShell.js +29 -0
- package/dist/compiler/containerPackageOverrides.d.ts +27 -0
- package/dist/compiler/containerPackageOverrides.js +63 -0
- package/dist/compiler/containerTargetPlanResolution.d.ts +20 -0
- package/dist/compiler/containerTargetPlanResolution.js +97 -0
- package/dist/compiler/daimonTelemetryArtifacts.d.ts +22 -0
- package/dist/compiler/daimonTelemetryArtifacts.js +61 -0
- package/dist/compiler/dockerBuildContext.d.ts +16 -0
- package/dist/compiler/dockerBuildContext.js +159 -0
- package/dist/compiler/dockerBuildSkip.d.ts +30 -0
- package/dist/compiler/dockerBuildSkip.js +81 -0
- package/dist/compiler/index.d.ts +4 -0
- package/dist/compiler/index.js +4 -0
- package/dist/compiler/memoryArtifacts.d.ts +26 -0
- package/dist/compiler/memoryArtifacts.js +134 -0
- package/dist/compiler/memoryResolution.d.ts +4 -0
- package/dist/compiler/memoryResolution.js +147 -0
- package/dist/compiler/modelEnv.d.ts +2 -0
- package/dist/compiler/modelEnv.js +6 -0
- package/dist/compiler/moltnetAllowedWakeSendersValidation.d.ts +2 -0
- package/dist/compiler/moltnetAllowedWakeSendersValidation.js +42 -0
- package/dist/compiler/moltnetArtifactPaths.d.ts +26 -0
- package/dist/compiler/moltnetArtifactPaths.js +49 -0
- package/dist/compiler/moltnetArtifactTypes.d.ts +46 -0
- package/dist/compiler/moltnetArtifactTypes.js +1 -0
- package/dist/compiler/moltnetArtifacts.d.ts +2 -40
- package/dist/compiler/moltnetArtifacts.js +43 -97
- package/dist/compiler/moltnetBinaries.d.ts +21 -4
- package/dist/compiler/moltnetBinaries.js +134 -27
- package/dist/compiler/moltnetClientConfig.js +7 -2
- package/dist/compiler/moltnetConfigLowering.d.ts +16 -1
- package/dist/compiler/moltnetConfigLowering.js +67 -5
- package/dist/compiler/moltnetExternalParticipantArtifact.d.ts +38 -0
- package/dist/compiler/moltnetExternalParticipantArtifact.js +188 -0
- package/dist/compiler/moltnetNodeConfig.js +7 -2
- package/dist/compiler/moltnetReleaseAuthority.d.ts +17 -0
- package/dist/compiler/moltnetReleaseAuthority.js +73 -0
- package/dist/compiler/moltnetReleaseDownload.d.ts +12 -0
- package/dist/compiler/moltnetReleaseDownload.js +85 -0
- package/dist/compiler/moltnetRepresentativeResolution.d.ts +1 -0
- package/dist/compiler/moltnetRepresentativeResolution.js +16 -2
- package/dist/compiler/moltnetResolution.js +72 -20
- package/dist/compiler/moltnetRoomMemberships.js +37 -9
- package/dist/compiler/moltnetServerPlans.d.ts +9 -0
- package/dist/compiler/moltnetServerPlans.js +132 -0
- package/dist/compiler/organizationIdentity.d.ts +27 -0
- package/dist/compiler/organizationIdentity.js +297 -0
- package/dist/compiler/organizationReadyEvidence.d.ts +49 -0
- package/dist/compiler/organizationReadyEvidence.js +261 -0
- package/dist/compiler/projectManifestGraph.d.ts +4 -0
- package/dist/compiler/projectManifestGraph.js +24 -0
- package/dist/compiler/runProject.d.ts +4 -0
- package/dist/compiler/runProject.js +30 -21
- package/dist/compiler/runProjectAuth.d.ts +7 -1
- package/dist/compiler/runProjectAuth.js +87 -9
- package/dist/compiler/runProjectDocker.d.ts +7 -0
- package/dist/compiler/runProjectDocker.js +31 -8
- package/dist/compiler/runProjectLifecycle.d.ts +7 -0
- package/dist/compiler/runProjectLifecycle.js +40 -0
- package/dist/compiler/syncProjectAuth.js +4 -1
- package/dist/compiler/teamContextActiveEnvironments.d.ts +13 -0
- package/dist/compiler/teamContextActiveEnvironments.js +255 -0
- package/dist/compiler/teamContextSupport.js +32 -40
- package/dist/compiler/teamContextTypes.d.ts +2 -0
- package/dist/compiler/types.d.ts +82 -1
- package/dist/compiler/upProject.d.ts +5 -0
- package/dist/compiler/upProject.js +256 -20
- package/dist/compiler/upReceipt.d.ts +36 -0
- package/dist/compiler/upReceipt.js +82 -0
- package/dist/compiler/updateProjectModels.js +42 -60
- package/dist/compiler/updateProjectRuntime.js +22 -35
- package/dist/compiler/updateProjectSurfaces.js +53 -47
- package/dist/compiler/worldBindings.d.ts +39 -0
- package/dist/compiler/worldBindings.js +247 -0
- package/dist/compiler/worldBindingsFile.d.ts +5 -0
- package/dist/compiler/worldBindingsFile.js +162 -0
- package/dist/deployment/artifactsExport.d.ts +49 -0
- package/dist/deployment/artifactsExport.js +217 -0
- package/dist/deployment/artifactsExportDocker.d.ts +48 -0
- package/dist/deployment/artifactsExportDocker.js +91 -0
- package/dist/deployment/artifactsExportPlan.d.ts +24 -0
- package/dist/deployment/artifactsExportPlan.js +135 -0
- package/dist/deployment/artifactsExportTypes.d.ts +50 -0
- package/dist/deployment/artifactsExportTypes.js +52 -0
- package/dist/deployment/buildImageCacheStore.d.ts +23 -0
- package/dist/deployment/buildImageCacheStore.js +54 -0
- package/dist/deployment/deploymentLifecycleCorrelation.d.ts +11 -0
- package/dist/deployment/deploymentLifecycleCorrelation.js +33 -0
- package/dist/deployment/dockerInspect.d.ts +9 -0
- package/dist/deployment/dockerInspect.js +24 -1
- package/dist/deployment/dockerLabels.d.ts +2 -0
- package/dist/deployment/dockerLabels.js +2 -0
- package/dist/deployment/dockerLogs.js +2 -10
- package/dist/deployment/dockerManager.d.ts +51 -0
- package/dist/deployment/dockerManager.js +118 -1
- package/dist/deployment/dockerProbeGateway.js +64 -5
- package/dist/deployment/dockerRecover.js +9 -1
- package/dist/deployment/dockerTeardown.d.ts +32 -0
- package/dist/deployment/dockerTeardown.js +61 -0
- package/dist/deployment/downDeployment.d.ts +34 -0
- package/dist/deployment/downDeployment.js +147 -0
- package/dist/deployment/downReceiptTypes.d.ts +21 -0
- package/dist/deployment/downReceiptTypes.js +30 -0
- package/dist/deployment/index.d.ts +16 -0
- package/dist/deployment/index.js +17 -0
- package/dist/deployment/lifecycleCompletion.d.ts +37 -0
- package/dist/deployment/lifecycleCompletion.js +236 -0
- package/dist/deployment/lifecycleCompletionContracts.d.ts +158 -0
- package/dist/deployment/lifecycleCompletionContracts.js +106 -0
- package/dist/deployment/lifecycleCompletionHeartbeat.d.ts +2 -0
- package/dist/deployment/lifecycleCompletionHeartbeat.js +50 -0
- package/dist/deployment/lifecycleCompletionLookup.d.ts +18 -0
- package/dist/deployment/lifecycleCompletionLookup.js +88 -0
- package/dist/deployment/lifecycleCompletionOwner.d.ts +8 -0
- package/dist/deployment/lifecycleCompletionOwner.js +31 -0
- package/dist/deployment/lifecycleCompletionParsing.d.ts +12 -0
- package/dist/deployment/lifecycleCompletionParsing.js +108 -0
- package/dist/deployment/lifecycleCompletionPaths.d.ts +9 -0
- package/dist/deployment/lifecycleCompletionPaths.js +16 -0
- package/dist/deployment/lifecycleCompletionPublication.d.ts +5 -0
- package/dist/deployment/lifecycleCompletionPublication.js +35 -0
- package/dist/deployment/lifecycleCompletionRecovery.d.ts +21 -0
- package/dist/deployment/lifecycleCompletionRecovery.js +56 -0
- package/dist/deployment/lifecycleCompletionRoot.d.ts +21 -0
- package/dist/deployment/lifecycleCompletionRoot.js +243 -0
- package/dist/deployment/lifecycleCompletionStore.d.ts +6 -0
- package/dist/deployment/lifecycleCompletionStore.js +151 -0
- package/dist/deployment/organizationHandoffAuthorityFsClient.d.ts +17 -0
- package/dist/deployment/organizationHandoffAuthorityFsClient.js +132 -0
- package/dist/deployment/organizationHandoffAuthorityFsWorker.d.ts +1 -0
- package/dist/deployment/organizationHandoffAuthorityFsWorker.js +285 -0
- package/dist/deployment/organizationHandoffAuthorityFsWorkerParent.fixture.d.ts +1 -0
- package/dist/deployment/organizationHandoffAuthorityFsWorkerParent.fixture.js +26 -0
- package/dist/deployment/organizationHandoffAuthorityStore.d.ts +41 -0
- package/dist/deployment/organizationHandoffAuthorityStore.js +348 -0
- package/dist/deployment/organizationHandoffAuthorityTypes.d.ts +76 -0
- package/dist/deployment/organizationHandoffAuthorityTypes.js +148 -0
- package/dist/deployment/organizationHandoffTypes.d.ts +29 -0
- package/dist/deployment/organizationHandoffTypes.js +80 -0
- package/dist/deployment/organizationReady.d.ts +52 -0
- package/dist/deployment/organizationReady.js +200 -0
- package/dist/deployment/privateArtifactsExport.d.ts +18 -0
- package/dist/deployment/privateArtifactsExport.js +80 -0
- package/dist/deployment/providerRuntimeBoundaryScanner.test-helper.d.ts +8 -0
- package/dist/deployment/providerRuntimeBoundaryScanner.test-helper.js +60 -0
- package/dist/deployment/record.d.ts +26 -1
- package/dist/deployment/record.js +49 -4
- package/dist/deployment/simfileFixtureBoundary.test-helper.d.ts +8 -0
- package/dist/deployment/simfileFixtureBoundary.test-helper.js +103 -0
- package/dist/deployment/target.d.ts +1 -35
- package/dist/deployment/target.js +1 -96
- package/dist/deployment/upReceiptTypes.d.ts +111 -0
- package/dist/deployment/upReceiptTypes.js +164 -0
- package/dist/dev/project.js +15 -9
- package/dist/distribution/buildDistributionReport.d.ts +2 -1
- package/dist/distribution/buildDistributionReport.js +2 -1
- package/dist/distribution/distributionReportSchema.d.ts +5 -0
- package/dist/distribution/distributionReportSchema.js +7 -2
- package/dist/distribution/index.d.ts +2 -2
- package/dist/distribution/index.js +1 -1
- package/dist/distribution/types.d.ts +7 -0
- package/dist/distribution/types.js +1 -0
- package/dist/filesystem/paths.js +10 -1
- package/dist/ledger/causalConformanceCli.d.ts +1 -0
- package/dist/ledger/causalConformanceCli.js +41 -0
- package/dist/ledger/causeNamespace.d.ts +8 -0
- package/dist/ledger/causeNamespace.js +24 -0
- package/dist/ledger/conformance.d.ts +83 -0
- package/dist/ledger/conformance.js +259 -0
- package/dist/ledger/emitters.d.ts +76 -0
- package/dist/ledger/emitters.js +188 -0
- package/dist/ledger/index.d.ts +4 -0
- package/dist/ledger/index.js +4 -0
- package/dist/ledger/principal.d.ts +96 -0
- package/dist/ledger/principal.js +121 -0
- package/dist/manifest/externalParticipantSchemas.d.ts +18 -0
- package/dist/manifest/externalParticipantSchemas.js +17 -0
- package/dist/manifest/index.d.ts +1 -0
- package/dist/manifest/index.js +1 -0
- package/dist/manifest/inlineAgentMember.d.ts +2 -0
- package/dist/manifest/inlineAgentMember.js +9 -0
- package/dist/manifest/loadManifest.js +14 -8
- package/dist/manifest/mcpSchemas.d.ts +17 -0
- package/dist/manifest/mcpSchemas.js +41 -0
- package/dist/manifest/memorySchemas.d.ts +245 -0
- package/dist/manifest/memorySchemas.js +148 -0
- package/dist/manifest/renderSpawnfile.js +22 -131
- package/dist/manifest/renderSpawnfileNetworks.js +9 -2
- package/dist/manifest/renderSpawnfileSurfaces.d.ts +2 -0
- package/dist/manifest/renderSpawnfileSurfaces.js +134 -0
- package/dist/manifest/schemas.d.ts +1868 -99
- package/dist/manifest/schemas.js +78 -32
- package/dist/manifest/surfaceSchemas.d.ts +17 -0
- package/dist/manifest/surfaceSchemas.js +24 -1
- package/dist/manifest/teamNetworkAccessSchemas.d.ts +1 -1
- package/dist/manifest/teamNetworkAuthSchemas.d.ts +48 -0
- package/dist/manifest/teamNetworkAuthSchemas.js +103 -0
- package/dist/manifest/teamNetworkSchemas.d.ts +8 -187
- package/dist/manifest/teamNetworkSchemas.js +3 -317
- package/dist/manifest/teamNetworkServerSchemas.d.ts +150 -0
- package/dist/manifest/teamNetworkServerSchemas.js +199 -0
- package/dist/ownership/siblingBuildFreshness.d.ts +20 -0
- package/dist/ownership/siblingBuildFreshness.js +20 -0
- package/dist/ownership/simfileRunOperatorInputs.d.ts +103 -0
- package/dist/ownership/simfileRunOperatorInputs.js +139 -0
- package/dist/report/types.d.ts +142 -0
- package/dist/runtime/common.d.ts +35 -0
- package/dist/runtime/common.js +55 -0
- package/dist/runtime/container.d.ts +28 -1
- package/dist/runtime/container.js +38 -5
- package/dist/runtime/containerPackageOverrides.d.ts +37 -0
- package/dist/runtime/containerPackageOverrides.js +33 -0
- package/dist/runtime/index.d.ts +2 -0
- package/dist/runtime/index.js +2 -0
- package/dist/runtime/mnemeMcp.d.ts +15 -0
- package/dist/runtime/mnemeMcp.js +109 -0
- package/dist/runtime/openclaw/adapter.js +15 -4
- package/dist/runtime/openclaw/mcp.d.ts +10 -0
- package/dist/runtime/openclaw/mcp.js +69 -0
- package/dist/runtime/openclaw/runAuth.js +2 -2
- package/dist/runtime/openclaw/scaffold.js +1 -1
- package/dist/runtime/openclaw/schedules.d.ts +38 -0
- package/dist/runtime/openclaw/schedules.js +74 -0
- package/dist/runtime/pi/adapter.d.ts +1 -1
- package/dist/runtime/pi/adapter.js +86 -53
- package/dist/runtime/pi/appActivitySource.js +114 -2
- package/dist/runtime/pi/appAgentConfig.d.ts +11 -0
- package/dist/runtime/pi/appAgentConfig.js +264 -0
- package/dist/runtime/pi/appCliEnginesSource.d.ts +1 -0
- package/dist/runtime/pi/appCliEnginesSource.js +183 -0
- package/dist/runtime/pi/appCliSource.d.ts +1 -0
- package/dist/runtime/pi/appCliSource.js +353 -0
- package/dist/runtime/pi/appControlSource.d.ts +1 -0
- package/dist/runtime/pi/appControlSource.js +390 -0
- package/dist/runtime/pi/appControlWakeIdentitySource.d.ts +1 -0
- package/dist/runtime/pi/appControlWakeIdentitySource.js +19 -0
- package/dist/runtime/pi/appCoreSource.d.ts +4 -1
- package/dist/runtime/pi/appCoreSource.js +104 -214
- package/dist/runtime/pi/appPreludeSource.js +140 -52
- package/dist/runtime/pi/appScheduleSource.d.ts +1 -0
- package/dist/runtime/pi/appScheduleSource.js +80 -0
- package/dist/runtime/pi/appScriptedEngine.d.ts +31 -0
- package/dist/runtime/pi/appScriptedEngine.js +42 -0
- package/dist/runtime/pi/appSource.d.ts +4 -1
- package/dist/runtime/pi/appSource.js +6 -2
- package/dist/runtime/pi/appTemplate.d.ts +8 -22
- package/dist/runtime/pi/appTemplate.js +9 -126
- package/dist/runtime/pi/appTemplateTypes.d.ts +64 -0
- package/dist/runtime/pi/appTemplateTypes.js +18 -0
- package/dist/runtime/pi/appWakeContextSource.d.ts +1 -0
- package/dist/runtime/pi/appWakeContextSource.js +398 -0
- package/dist/runtime/pi/containerTargets.d.ts +4 -0
- package/dist/runtime/pi/containerTargets.js +57 -0
- package/dist/runtime/pi/runAuth.js +126 -9
- package/dist/runtime/pi/testHelpers.d.ts +2 -0
- package/dist/runtime/pi/testHelpers.js +40 -0
- package/dist/runtime/picoclaw/adapter.js +23 -27
- package/dist/runtime/picoclaw/mcp.d.ts +4 -0
- package/dist/runtime/picoclaw/mcp.js +43 -0
- package/dist/runtime/picoclaw/memory.d.ts +7 -0
- package/dist/runtime/picoclaw/memory.js +17 -0
- package/dist/runtime/picoclaw/runAuth.js +1 -1
- package/dist/runtime/picoclaw/scaffold.js +1 -1
- package/dist/runtime/picoclaw/schedules.d.ts +26 -0
- package/dist/runtime/picoclaw/schedules.js +62 -3
- package/dist/runtime/scheduleUtils.d.ts +2 -0
- package/dist/runtime/scheduleUtils.js +15 -0
- package/dist/runtime/types.d.ts +25 -2
- package/dist/shared/errors.d.ts +1 -1
- package/dist/shared/errors.js +2 -2
- package/dist/shared/index.d.ts +1 -0
- package/dist/shared/index.js +1 -0
- package/dist/shared/redaction.d.ts +2 -0
- package/dist/shared/redaction.js +10 -0
- package/dist/status/buildStatus.d.ts +1 -0
- package/dist/status/buildStatus.js +2 -0
- package/dist/status/compileReport.d.ts +22 -0
- package/dist/status/compileReport.js +16 -2
- package/dist/status/compiledProbeCollection.d.ts +21 -0
- package/dist/status/compiledProbeCollection.js +27 -0
- package/dist/status/imageStatusReport.js +6 -0
- package/dist/status/index.d.ts +3 -0
- package/dist/status/index.js +3 -0
- package/dist/status/lifecycleProbes.d.ts +19 -0
- package/dist/status/lifecycleProbes.js +174 -0
- package/dist/status/moltnetProbes.d.ts +7 -8
- package/dist/status/moltnetProbes.js +27 -198
- package/dist/status/moltnetWiringProbes.d.ts +19 -0
- package/dist/status/moltnetWiringProbes.js +178 -0
- package/dist/target/cleanupRun.d.ts +41 -0
- package/dist/target/cleanupRun.js +139 -0
- package/dist/target/cleanupRunDocker.d.ts +16 -0
- package/dist/target/cleanupRunDocker.js +66 -0
- package/dist/target/cleanupRunDocker.test-helper.d.ts +67 -0
- package/dist/target/cleanupRunDocker.test-helper.js +238 -0
- package/dist/target/cleanupRunDockerPreflight.d.ts +17 -0
- package/dist/target/cleanupRunDockerPreflight.js +224 -0
- package/dist/target/composedPreparation.d.ts +205 -0
- package/dist/target/composedPreparation.js +223 -0
- package/dist/target/containerBundle.d.ts +82 -0
- package/dist/target/containerBundle.js +243 -0
- package/dist/target/containerBundleArchive.d.ts +31 -0
- package/dist/target/containerBundleArchive.js +140 -0
- package/dist/target/containerBundleAuthority.d.ts +25 -0
- package/dist/target/containerBundleAuthority.js +65 -0
- package/dist/target/containerBundleContracts.d.ts +114 -0
- package/dist/target/containerBundleContracts.js +173 -0
- package/dist/target/containerBundleFilesystemStore.d.ts +3 -0
- package/dist/target/containerBundleFilesystemStore.js +247 -0
- package/dist/target/containerBundlePolicy.d.ts +33 -0
- package/dist/target/containerBundlePolicy.js +64 -0
- package/dist/target/containerBundleStore.d.ts +127 -0
- package/dist/target/containerBundleStore.js +284 -0
- package/dist/target/contracts.d.ts +538 -0
- package/dist/target/contracts.js +373 -0
- package/dist/target/dockerArtifactIdentityTypes.d.ts +56 -0
- package/dist/target/dockerArtifactIdentityTypes.js +1 -0
- package/dist/target/dockerArtifactInspection.d.ts +40 -0
- package/dist/target/dockerArtifactInspection.js +125 -0
- package/dist/target/dockerArtifacts.d.ts +21 -0
- package/dist/target/dockerArtifacts.js +110 -0
- package/dist/target/dockerArtifactsProvider.d.ts +41 -0
- package/dist/target/dockerArtifactsProvider.js +449 -0
- package/dist/target/dockerCommandExecutor.d.ts +27 -0
- package/dist/target/dockerCommandExecutor.js +200 -0
- package/dist/target/dockerCommandExecutorCore.d.ts +34 -0
- package/dist/target/dockerCommandExecutorCore.js +273 -0
- package/dist/target/dockerContainerBundleBuilder.d.ts +8 -0
- package/dist/target/dockerContainerBundleBuilder.js +256 -0
- package/dist/target/dockerContextSnapshot.d.ts +21 -0
- package/dist/target/dockerContextSnapshot.js +158 -0
- package/dist/target/dockerEndpointFingerprint.d.ts +1 -0
- package/dist/target/dockerEndpointFingerprint.js +9 -0
- package/dist/target/dockerPreparedArtifact.d.ts +48 -0
- package/dist/target/dockerPreparedArtifact.js +131 -0
- package/dist/target/dockerProjectionJson.d.ts +1 -0
- package/dist/target/dockerProjectionJson.js +80 -0
- package/dist/target/dockerPublicArtifactSnapshot.d.ts +17 -0
- package/dist/target/dockerPublicArtifactSnapshot.js +99 -0
- package/dist/target/dockerResources.d.ts +26 -0
- package/dist/target/dockerResources.js +162 -0
- package/dist/target/dockerResourcesProvider.d.ts +44 -0
- package/dist/target/dockerResourcesProvider.js +207 -0
- package/dist/target/dockerSecrets.d.ts +39 -0
- package/dist/target/dockerSecrets.js +249 -0
- package/dist/target/dockerSecretsAuthority.d.ts +26 -0
- package/dist/target/dockerSecretsAuthority.js +216 -0
- package/dist/target/dockerSecretsLifecycle.d.ts +25 -0
- package/dist/target/dockerSecretsLifecycle.js +133 -0
- package/dist/target/dockerSecretsProvider.d.ts +68 -0
- package/dist/target/dockerSecretsProvider.js +329 -0
- package/dist/target/dockerTarget.d.ts +52 -0
- package/dist/target/dockerTarget.js +48 -0
- package/dist/target/dockerTargetBinding.d.ts +14 -0
- package/dist/target/dockerTargetBinding.js +96 -0
- package/dist/target/dockerWorldClock.d.ts +17 -0
- package/dist/target/dockerWorldClock.js +111 -0
- package/dist/target/dockerWorldReadiness.d.ts +17 -0
- package/dist/target/dockerWorldReadiness.js +119 -0
- package/dist/target/dockerWorldService.d.ts +23 -0
- package/dist/target/dockerWorldService.js +216 -0
- package/dist/target/dockerWorldServiceAuthority.d.ts +80 -0
- package/dist/target/dockerWorldServiceAuthority.js +182 -0
- package/dist/target/dockerWorldServiceLifecycle.d.ts +41 -0
- package/dist/target/dockerWorldServiceLifecycle.js +275 -0
- package/dist/target/dockerWorldServiceProvider.d.ts +60 -0
- package/dist/target/dockerWorldServiceProvider.js +318 -0
- package/dist/target/dockerWorldServiceStore.d.ts +73 -0
- package/dist/target/dockerWorldServiceStore.js +367 -0
- package/dist/target/evidenceExport.d.ts +55 -0
- package/dist/target/evidenceExport.js +518 -0
- package/dist/target/evidenceExportArchive.d.ts +10 -0
- package/dist/target/evidenceExportArchive.js +302 -0
- package/dist/target/evidenceExportContract.d.ts +27 -0
- package/dist/target/evidenceExportContract.js +40 -0
- package/dist/target/evidenceExportOperationsTestKit.d.ts +87 -0
- package/dist/target/evidenceExportOperationsTestKit.js +312 -0
- package/dist/target/evidenceExportProvider.d.ts +85 -0
- package/dist/target/evidenceExportProvider.js +187 -0
- package/dist/target/evidenceExportPublicationTypes.d.ts +16 -0
- package/dist/target/evidenceExportPublicationTypes.js +1 -0
- package/dist/target/evidenceExportStore.d.ts +70 -0
- package/dist/target/evidenceExportStore.js +498 -0
- package/dist/target/evidenceExportStorePublication.d.ts +7 -0
- package/dist/target/evidenceExportStorePublication.js +395 -0
- package/dist/target/handles.d.ts +20 -0
- package/dist/target/handles.js +56 -0
- package/dist/target/index.d.ts +12 -0
- package/dist/target/index.js +11 -0
- package/dist/target/journal.d.ts +59 -0
- package/dist/target/journal.js +529 -0
- package/dist/target/journalFilesystem.d.ts +3 -0
- package/dist/target/journalFilesystem.js +111 -0
- package/dist/target/journalRoot.d.ts +4 -0
- package/dist/target/journalRoot.js +6 -0
- package/dist/target/organizationAttachment.d.ts +23 -0
- package/dist/target/organizationAttachment.js +263 -0
- package/dist/target/organizationAttachmentAuthority.d.ts +65 -0
- package/dist/target/organizationAttachmentAuthority.js +161 -0
- package/dist/target/organizationAttachmentLifecycle.d.ts +17 -0
- package/dist/target/organizationAttachmentLifecycle.js +101 -0
- package/dist/target/organizationAttachmentProvider.d.ts +76 -0
- package/dist/target/organizationAttachmentProvider.js +289 -0
- package/dist/target/organizationAttachmentStore.d.ts +51 -0
- package/dist/target/organizationAttachmentStore.js +316 -0
- package/dist/target/publicArtifactSnapshot.d.ts +41 -0
- package/dist/target/publicArtifactSnapshot.js +150 -0
- package/dist/target/topologyActivation.d.ts +51 -0
- package/dist/target/topologyActivation.js +149 -0
- package/dist/target/topologyAttestation.d.ts +37 -0
- package/dist/target/topologyAttestation.js +300 -0
- package/dist/target/topologyAttestationErrors.d.ts +1 -0
- package/dist/target/topologyAttestationErrors.js +1 -0
- package/dist/target/worldClock.d.ts +60 -0
- package/dist/target/worldClock.js +129 -0
- package/dist/target/worldReadiness.d.ts +103 -0
- package/dist/target/worldReadiness.js +153 -0
- package/moltnet-releases.json +20 -0
- package/package.json +27 -11
- package/runtimes.yaml +8 -23
- package/dist/runtime/openclaw/scaffold-assets/CLAUDE.md +0 -5
- package/dist/runtime/picoclaw/scaffold-assets/CLAUDE.md +0 -5
- /package/dist/runtime/openclaw/scaffold-assets/{AGENTS.md → WORKSPACE_AGENTS.md} +0 -0
- /package/dist/runtime/picoclaw/scaffold-assets/{AGENTS.md → WORKSPACE_AGENTS.md} +0 -0
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { Buffer } from "node:buffer";
|
|
2
|
+
import { randomBytes } from "node:crypto";
|
|
3
|
+
import { TARGET_SECRET_SOURCE_ERROR, assertOrdinaryJsonGraph, createCanonicalTargetSecretSourceJson, decodeTargetSecretSourceSecret, encodeTargetSecretSourceSecret, parseCanonicalTargetSecretSourceJson, parseTargetSecretSourceOpaqueHandle } from "./targetSecretSourceRecordCommon.js";
|
|
4
|
+
export const TARGET_SECRET_SOURCE_VERSION_RECORD_VERSION = "spawnfile.auth.target-secret.source-version.v1";
|
|
5
|
+
export const TARGET_SECRET_SOURCE_ALIAS_RECORD_VERSION = "spawnfile.auth.target-secret.source-alias.v1";
|
|
6
|
+
const VERSION_KEYS = ["publication_handle", "secret", "source_version_handle", "version"];
|
|
7
|
+
const ALIAS_KEYS = ["publication_handle", "source_handle", "source_version_handle", "version"];
|
|
8
|
+
const ALIAS_METADATA_KEYS = ["source_handle", "source_version_handle", "version"];
|
|
9
|
+
const VERSION_METADATA_KEYS = ["source_version_handle", "version"];
|
|
10
|
+
const PRIVATE_VERSION_METADATA_KEYS = ["publication_handle", "source_version_handle", "version"];
|
|
11
|
+
const fail = () => { throw new Error(TARGET_SECRET_SOURCE_ERROR); };
|
|
12
|
+
const normalize = (work) => {
|
|
13
|
+
try {
|
|
14
|
+
return work();
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
return fail();
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
const defaultEntropy = () => {
|
|
21
|
+
const bytes = randomBytes(16);
|
|
22
|
+
try {
|
|
23
|
+
return Uint8Array.from(bytes);
|
|
24
|
+
}
|
|
25
|
+
finally {
|
|
26
|
+
bytes.fill(0);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
const freeze = (value) => Object.freeze(value);
|
|
30
|
+
const opaqueHandleFromEntropy = (entropy) => normalize(() => {
|
|
31
|
+
const raw = entropy();
|
|
32
|
+
if (!(raw instanceof Uint8Array) || raw.length < 8 || raw.length > 32)
|
|
33
|
+
fail();
|
|
34
|
+
const copy = Uint8Array.from(raw);
|
|
35
|
+
const encoded = Buffer.from(copy);
|
|
36
|
+
try {
|
|
37
|
+
return parseTargetSecretSourceOpaqueHandle(`opaque_${encoded.toString("hex")}`);
|
|
38
|
+
}
|
|
39
|
+
finally {
|
|
40
|
+
encoded.fill(0);
|
|
41
|
+
copy.fill(0);
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
const exactRecord = (value, expected) => {
|
|
45
|
+
assertOrdinaryJsonGraph(value);
|
|
46
|
+
if (value === null || typeof value !== "object" || Array.isArray(value))
|
|
47
|
+
fail();
|
|
48
|
+
const record = value;
|
|
49
|
+
const keys = Object.keys(record).sort();
|
|
50
|
+
if (keys.length !== expected.length || keys.some((key, index) => key !== expected[index]))
|
|
51
|
+
fail();
|
|
52
|
+
return record;
|
|
53
|
+
};
|
|
54
|
+
const parseVersionMetadata = (value) => normalize(() => {
|
|
55
|
+
const record = exactRecord(value, VERSION_METADATA_KEYS);
|
|
56
|
+
if (record.version !== TARGET_SECRET_SOURCE_VERSION_RECORD_VERSION)
|
|
57
|
+
fail();
|
|
58
|
+
return freeze({ source_version_handle: parseTargetSecretSourceOpaqueHandle(record.source_version_handle), version: TARGET_SECRET_SOURCE_VERSION_RECORD_VERSION });
|
|
59
|
+
});
|
|
60
|
+
const parsePrivateVersionMetadata = (value) => normalize(() => {
|
|
61
|
+
const record = exactRecord(value, PRIVATE_VERSION_METADATA_KEYS);
|
|
62
|
+
if (record.version !== TARGET_SECRET_SOURCE_VERSION_RECORD_VERSION)
|
|
63
|
+
fail();
|
|
64
|
+
const sourceVersionHandle = parseTargetSecretSourceOpaqueHandle(record.source_version_handle);
|
|
65
|
+
const publicationHandle = parseTargetSecretSourceOpaqueHandle(record.publication_handle);
|
|
66
|
+
if (sourceVersionHandle === publicationHandle)
|
|
67
|
+
fail();
|
|
68
|
+
return freeze({
|
|
69
|
+
publication_handle: publicationHandle,
|
|
70
|
+
source_version_handle: sourceVersionHandle,
|
|
71
|
+
version: TARGET_SECRET_SOURCE_VERSION_RECORD_VERSION
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
const parseVersionPayload = (value) => {
|
|
75
|
+
const record = exactRecord(value, VERSION_KEYS);
|
|
76
|
+
if (record.version !== TARGET_SECRET_SOURCE_VERSION_RECORD_VERSION || typeof record.secret !== "string")
|
|
77
|
+
fail();
|
|
78
|
+
return {
|
|
79
|
+
metadata: parsePrivateVersionMetadata({
|
|
80
|
+
publication_handle: record.publication_handle,
|
|
81
|
+
source_version_handle: record.source_version_handle,
|
|
82
|
+
version: record.version
|
|
83
|
+
}),
|
|
84
|
+
secret: record.secret
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
const parseAliasMetadata = (value) => {
|
|
88
|
+
const record = exactRecord(value, ALIAS_METADATA_KEYS);
|
|
89
|
+
if (record.version !== TARGET_SECRET_SOURCE_ALIAS_RECORD_VERSION)
|
|
90
|
+
fail();
|
|
91
|
+
const sourceHandle = parseTargetSecretSourceOpaqueHandle(record.source_handle);
|
|
92
|
+
const sourceVersionHandle = parseTargetSecretSourceOpaqueHandle(record.source_version_handle);
|
|
93
|
+
if (sourceHandle === sourceVersionHandle)
|
|
94
|
+
fail();
|
|
95
|
+
return freeze({ source_handle: sourceHandle, source_version_handle: sourceVersionHandle, version: TARGET_SECRET_SOURCE_ALIAS_RECORD_VERSION });
|
|
96
|
+
};
|
|
97
|
+
const parseAlias = (value) => {
|
|
98
|
+
const record = exactRecord(value, ALIAS_KEYS);
|
|
99
|
+
const metadata = parseAliasMetadata({
|
|
100
|
+
source_handle: record.source_handle,
|
|
101
|
+
source_version_handle: record.source_version_handle,
|
|
102
|
+
version: record.version
|
|
103
|
+
});
|
|
104
|
+
const publicationHandle = parseTargetSecretSourceOpaqueHandle(record.publication_handle);
|
|
105
|
+
if (publicationHandle === metadata.source_handle || publicationHandle === metadata.source_version_handle)
|
|
106
|
+
fail();
|
|
107
|
+
return freeze({ publication_handle: publicationHandle, ...metadata });
|
|
108
|
+
};
|
|
109
|
+
export const createTargetSecretSourceVersionRecordBytes = (secret, options = {}) => normalize(() => {
|
|
110
|
+
const sourceVersionHandle = opaqueHandleFromEntropy(options.entropy ?? defaultEntropy);
|
|
111
|
+
const publicationHandle = opaqueHandleFromEntropy(options.publicationEntropy ?? defaultEntropy);
|
|
112
|
+
if (sourceVersionHandle === publicationHandle)
|
|
113
|
+
fail();
|
|
114
|
+
const metadata = freeze({
|
|
115
|
+
source_version_handle: sourceVersionHandle,
|
|
116
|
+
version: TARGET_SECRET_SOURCE_VERSION_RECORD_VERSION
|
|
117
|
+
});
|
|
118
|
+
const privateMetadata = freeze({
|
|
119
|
+
publication_handle: publicationHandle,
|
|
120
|
+
...metadata
|
|
121
|
+
});
|
|
122
|
+
const privateBytes = createCanonicalTargetSecretSourceJson({
|
|
123
|
+
publication_handle: publicationHandle,
|
|
124
|
+
secret: encodeTargetSecretSourceSecret(secret),
|
|
125
|
+
source_version_handle: sourceVersionHandle,
|
|
126
|
+
version: TARGET_SECRET_SOURCE_VERSION_RECORD_VERSION
|
|
127
|
+
});
|
|
128
|
+
return { private_bytes: privateBytes, private_metadata: privateMetadata, metadata };
|
|
129
|
+
});
|
|
130
|
+
export const parseTargetSecretSourceVersionRecordBytes = (raw, expectedLeafHandle) => normalize(() => {
|
|
131
|
+
const expected = parseTargetSecretSourceOpaqueHandle(expectedLeafHandle);
|
|
132
|
+
const payload = parseVersionPayload(parseCanonicalTargetSecretSourceJson(raw));
|
|
133
|
+
if (payload.metadata.source_version_handle !== expected)
|
|
134
|
+
fail();
|
|
135
|
+
return freeze({ ...payload.metadata, secret: decodeTargetSecretSourceSecret(payload.secret) });
|
|
136
|
+
});
|
|
137
|
+
export const createTargetSecretSourceAliasRecordBytes = (version, options = {}) => normalize(() => {
|
|
138
|
+
const versionMetadata = parseVersionMetadata(version);
|
|
139
|
+
const sourceHandle = opaqueHandleFromEntropy(options.entropy ?? defaultEntropy);
|
|
140
|
+
const publicationHandle = opaqueHandleFromEntropy(options.publicationEntropy ?? defaultEntropy);
|
|
141
|
+
if (sourceHandle === versionMetadata.source_version_handle
|
|
142
|
+
|| publicationHandle === sourceHandle
|
|
143
|
+
|| publicationHandle === versionMetadata.source_version_handle)
|
|
144
|
+
fail();
|
|
145
|
+
const metadata = freeze({ source_handle: sourceHandle, source_version_handle: versionMetadata.source_version_handle, version: TARGET_SECRET_SOURCE_ALIAS_RECORD_VERSION });
|
|
146
|
+
const privateMetadata = freeze({ publication_handle: publicationHandle, ...metadata });
|
|
147
|
+
return {
|
|
148
|
+
private_bytes: createCanonicalTargetSecretSourceJson(privateMetadata),
|
|
149
|
+
private_metadata: privateMetadata,
|
|
150
|
+
metadata
|
|
151
|
+
};
|
|
152
|
+
});
|
|
153
|
+
export const parseTargetSecretSourceAliasRecordBytes = (raw, expectedLeafHandle) => normalize(() => {
|
|
154
|
+
const expected = parseTargetSecretSourceOpaqueHandle(expectedLeafHandle);
|
|
155
|
+
const alias = parseTargetSecretSourceAliasRecordBytesForPublication(raw);
|
|
156
|
+
if (alias.source_handle !== expected)
|
|
157
|
+
fail();
|
|
158
|
+
return alias;
|
|
159
|
+
});
|
|
160
|
+
export const parseTargetSecretSourceAliasRecordBytesForPublication = (raw) => normalize(() => parseAlias(parseCanonicalTargetSecretSourceJson(raw)));
|
|
161
|
+
export const assertTargetSecretSourceAliasCorrelation = (alias, version) => normalize(() => {
|
|
162
|
+
const parsedAlias = parseAliasMetadata(alias);
|
|
163
|
+
const parsedVersion = parseVersionMetadata(version);
|
|
164
|
+
if (parsedAlias.source_version_handle !== parsedVersion.source_version_handle)
|
|
165
|
+
fail();
|
|
166
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Command } from "commander";
|
|
2
|
+
import { exportRunArtifacts, type DeploymentLifecycleCorrelation, type LifecycleInvocation } from "../deployment/index.js";
|
|
3
|
+
import type { CliStreams } from "./runCli.js";
|
|
4
|
+
export interface ArtifactsExportCommandOptions {
|
|
5
|
+
compiled?: string;
|
|
6
|
+
deployment?: string;
|
|
7
|
+
dockerCommand?: string;
|
|
8
|
+
includePrivate?: boolean;
|
|
9
|
+
json?: boolean;
|
|
10
|
+
lifecycleInvocation?: string;
|
|
11
|
+
out: string;
|
|
12
|
+
readerImage?: string;
|
|
13
|
+
runId?: string;
|
|
14
|
+
timeout?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface ArtifactsCommandHandlers {
|
|
17
|
+
exportRunArtifacts: typeof exportRunArtifacts;
|
|
18
|
+
}
|
|
19
|
+
export declare const createArtifactsExportLifecyclePolicy: (options: ArtifactsExportCommandOptions) => {
|
|
20
|
+
destination_directory: string;
|
|
21
|
+
docker_command: string | null;
|
|
22
|
+
include_private: boolean;
|
|
23
|
+
reader_image: string | null;
|
|
24
|
+
timeout_ms: number | null;
|
|
25
|
+
};
|
|
26
|
+
export declare const createArtifactsExportLifecycleInvocation: (id: string, options: ArtifactsExportCommandOptions, compiled: string, correlation: DeploymentLifecycleCorrelation) => LifecycleInvocation;
|
|
27
|
+
export declare const registerArtifactsCommands: (program: Command, handlers: ArtifactsCommandHandlers, streams: CliStreams) => void;
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { findLifecycleInvocation, resolveArtifactsExportLifecycleCorrelation, } from "../deployment/index.js";
|
|
3
|
+
import { resolveProjectOutputDirectory } from "../filesystem/index.js";
|
|
4
|
+
import { DEFAULT_OUTPUT_DIRECTORY, SpawnfileError } from "../shared/index.js";
|
|
5
|
+
import { canonicalLifecycleJson } from "../deployment/lifecycleCompletionContracts.js";
|
|
6
|
+
import { runMachineLifecycle } from "./lifecycleMachine.js";
|
|
7
|
+
export const createArtifactsExportLifecyclePolicy = (options) => ({
|
|
8
|
+
destination_directory: path.resolve(options.out),
|
|
9
|
+
docker_command: options.dockerCommand ?? null,
|
|
10
|
+
include_private: options.includePrivate === true,
|
|
11
|
+
reader_image: options.readerImage ?? null,
|
|
12
|
+
timeout_ms: options.timeout ? Number(options.timeout) : null,
|
|
13
|
+
});
|
|
14
|
+
export const createArtifactsExportLifecycleInvocation = (id, options, compiled, correlation) => ({
|
|
15
|
+
correlation: {
|
|
16
|
+
compiled_output_directory: compiled,
|
|
17
|
+
deployment_selection: options.deployment ?? null,
|
|
18
|
+
run_id_selection: options.runId ?? null,
|
|
19
|
+
...correlation,
|
|
20
|
+
},
|
|
21
|
+
id,
|
|
22
|
+
operation: "artifacts_export",
|
|
23
|
+
request_policy: createArtifactsExportLifecyclePolicy(options),
|
|
24
|
+
version: "spawnfile.lifecycle-invocation.v1",
|
|
25
|
+
});
|
|
26
|
+
const correlationFrom = (stored) => {
|
|
27
|
+
const value = stored.correlation;
|
|
28
|
+
if (typeof value.compile_fingerprint !== "string" ||
|
|
29
|
+
typeof value.deployment_instance_digest !== "string" ||
|
|
30
|
+
typeof value.deployment !== "string" ||
|
|
31
|
+
(value.run_id !== null && typeof value.run_id !== "string") ||
|
|
32
|
+
typeof value.target !== "string")
|
|
33
|
+
throw new SpawnfileError("runtime_error", "Invalid stored export correlation");
|
|
34
|
+
return {
|
|
35
|
+
compile_fingerprint: value.compile_fingerprint,
|
|
36
|
+
deployment: value.deployment,
|
|
37
|
+
deployment_instance_digest: value.deployment_instance_digest,
|
|
38
|
+
run_id: value.run_id,
|
|
39
|
+
target: value.target,
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
const renderJson = (result) => JSON.stringify({
|
|
43
|
+
deployment: result.deploymentName,
|
|
44
|
+
failed_files: result.failedFiles,
|
|
45
|
+
index: result.index,
|
|
46
|
+
index_path: result.indexPath,
|
|
47
|
+
missing_optional_files: result.missingOptionalFiles,
|
|
48
|
+
}, null, 2);
|
|
49
|
+
const renderSummary = (result) => [
|
|
50
|
+
`exported ${result.index.files.length} file(s) to ${result.indexPath.replace(/[/\\]spawnfile[/\\]export-index\.json$/, "")}`,
|
|
51
|
+
`deployment: ${result.deploymentName}`,
|
|
52
|
+
`run: ${result.index.run_id}`,
|
|
53
|
+
`index: ${result.indexPath}`,
|
|
54
|
+
...result.missingOptionalFiles.map((file) => `skipped (not present yet): ${file}`),
|
|
55
|
+
...result.failedFiles.map((file) => `FAILED to export: ${file}`),
|
|
56
|
+
];
|
|
57
|
+
export const registerArtifactsCommands = (program, handlers, streams) => {
|
|
58
|
+
program
|
|
59
|
+
.command("artifacts")
|
|
60
|
+
.description("Manage a run's durable artifacts")
|
|
61
|
+
.command("export")
|
|
62
|
+
.description("Egress a run's durable artifacts")
|
|
63
|
+
.argument("[path]", "Project directory or Spawnfile path", process.cwd())
|
|
64
|
+
.requiredOption("--out <directory>", "Destination run directory")
|
|
65
|
+
.option("--deployment <name>", "Deployment record name")
|
|
66
|
+
.option("--run-id <id>", "Run id")
|
|
67
|
+
.option("--compiled <directory>", "Compile output directory")
|
|
68
|
+
.option("--docker-command <command>", "Docker command")
|
|
69
|
+
.option("--include-private", "Export unredacted private runtime training artifacts")
|
|
70
|
+
.option("--reader-image <image>", "Image used to read named volumes")
|
|
71
|
+
.option("--timeout <ms>", "Bound each Docker call in milliseconds")
|
|
72
|
+
.option("--json", "Render machine-readable JSON")
|
|
73
|
+
.option("--lifecycle-invocation <id>", "Bind this exact JSON invocation")
|
|
74
|
+
.action(async (inputPath, options) => {
|
|
75
|
+
if (options.lifecycleInvocation && !options.json)
|
|
76
|
+
throw new SpawnfileError("validation_error", "--lifecycle-invocation is only valid with --json");
|
|
77
|
+
const compiled = resolveProjectOutputDirectory(inputPath, options.compiled, DEFAULT_OUTPUT_DIRECTORY);
|
|
78
|
+
const base = {
|
|
79
|
+
compiledOutputDirectory: compiled,
|
|
80
|
+
deploymentName: options.deployment,
|
|
81
|
+
destinationDirectory: options.out,
|
|
82
|
+
dockerCommand: options.dockerCommand,
|
|
83
|
+
includePrivate: options.includePrivate,
|
|
84
|
+
readerImage: options.readerImage,
|
|
85
|
+
runId: options.runId,
|
|
86
|
+
timeoutMs: options.timeout ? Number(options.timeout) : undefined,
|
|
87
|
+
};
|
|
88
|
+
if (!options.json) {
|
|
89
|
+
for (const line of renderSummary(await handlers.exportRunArtifacts(base)))
|
|
90
|
+
streams.stdout(line);
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
const render = async (expected) => renderJson(await handlers.exportRunArtifacts({
|
|
94
|
+
...base,
|
|
95
|
+
...(expected ? { expectedLifecycleCorrelation: expected } : {}),
|
|
96
|
+
}));
|
|
97
|
+
if (!options.lifecycleInvocation) {
|
|
98
|
+
streams.stdout(await render());
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
const stored = await findLifecycleInvocation(options.lifecycleInvocation);
|
|
102
|
+
let exact;
|
|
103
|
+
let correlation;
|
|
104
|
+
if (stored) {
|
|
105
|
+
correlation = correlationFrom(stored);
|
|
106
|
+
exact = createArtifactsExportLifecycleInvocation(options.lifecycleInvocation, options, compiled, correlation);
|
|
107
|
+
if (canonicalLifecycleJson(exact) !== canonicalLifecycleJson(stored))
|
|
108
|
+
throw new SpawnfileError("runtime_error", "Lifecycle invocation id drift");
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
correlation = await resolveArtifactsExportLifecycleCorrelation(base);
|
|
112
|
+
exact = createArtifactsExportLifecycleInvocation(options.lifecycleInvocation, options, compiled, correlation);
|
|
113
|
+
}
|
|
114
|
+
streams.stdout(await runMachineLifecycle(exact, () => render(correlation), async () => {
|
|
115
|
+
try {
|
|
116
|
+
const current = await resolveArtifactsExportLifecycleCorrelation(base);
|
|
117
|
+
return JSON.stringify(current) === JSON.stringify(correlation)
|
|
118
|
+
? { status: "resume_safe" }
|
|
119
|
+
: {
|
|
120
|
+
reason: "deployment_correlation_changed",
|
|
121
|
+
status: "ambiguous",
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
catch {
|
|
125
|
+
return {
|
|
126
|
+
reason: "deployment_correlation_unavailable",
|
|
127
|
+
status: "ambiguous",
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
}));
|
|
131
|
+
});
|
|
132
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Command } from "commander";
|
|
2
|
+
import type { CliHandlers, CliStreams } from "./runCli.js";
|
|
3
|
+
type AuthCommandHandlers = Pick<CliHandlers, "importClaudeCodeAuth" | "importCodexAuth" | "importEnvFile" | "initializeTargetSecretSourceLifecycle" | "provisionCredentials" | "requireAuthProfile" | "syncProjectAuth">;
|
|
4
|
+
export declare const registerAuthCommands: (program: Command, handlers: AuthCommandHandlers, streams: CliStreams, stdin: AsyncIterable<unknown>) => void;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { readFile, writeFile } from "node:fs/promises";
|
|
3
|
+
import { buildProvisionedWorldBindings, disposeProvisionedMaterials, finalizeCredentialProvisioningReceipt, readCredentialProvisioningRequestFile, writeProvisionedEnvFile } from "../auth/index.js";
|
|
4
|
+
import { createCanonicalTargetSecretSourceJson } from "../auth/targetSecretSourceRecordCommon.js";
|
|
5
|
+
import { renderSimfileWorldBindings } from "../compiler/worldBindings.js";
|
|
6
|
+
import { MAX_TARGET_SECRET_SOURCE_SECRET_BYTES, TARGET_SECRET_SOURCE_ERROR } from "../auth/targetSecretSourceRecordCommon.js";
|
|
7
|
+
import { createTargetSecretSourceReceiptBytes, readBoundedTargetSecretStdin, readTargetSecretSourceGrantRequestFile, readTargetSecretSourceRequestFile } from "./targetSecretSourceInput.js";
|
|
8
|
+
const formatAuthProfileSummary = (profile) => {
|
|
9
|
+
const envKeys = Object.keys(profile.env).sort();
|
|
10
|
+
const importedKinds = Object.keys(profile.imports).sort();
|
|
11
|
+
return [
|
|
12
|
+
`profile: ${profile.name}`,
|
|
13
|
+
`env: ${envKeys.length > 0 ? envKeys.join(", ") : "none"}`,
|
|
14
|
+
`imports: ${importedKinds.length > 0 ? importedKinds.join(", ") : "none"}`
|
|
15
|
+
];
|
|
16
|
+
};
|
|
17
|
+
const emitLines = (streams, lines) => lines.forEach((line) => streams.stdout(line));
|
|
18
|
+
const emitTargetSecretReceipt = (streams, kind, sourceHandle) => {
|
|
19
|
+
const bytes = createTargetSecretSourceReceiptBytes({ kind, source_handle: sourceHandle });
|
|
20
|
+
try {
|
|
21
|
+
streams.stdout(new TextDecoder().decode(bytes));
|
|
22
|
+
}
|
|
23
|
+
finally {
|
|
24
|
+
bytes.fill(0);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
const targetSecretAction = async (work) => {
|
|
28
|
+
try {
|
|
29
|
+
await work();
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
throw new Error(TARGET_SECRET_SOURCE_ERROR);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
const emitCredentialProvisioningReceipt = (streams, receipt) => {
|
|
36
|
+
const bytes = createCanonicalTargetSecretSourceJson(receipt);
|
|
37
|
+
try {
|
|
38
|
+
streams.stdout(new TextDecoder().decode(bytes));
|
|
39
|
+
}
|
|
40
|
+
finally {
|
|
41
|
+
bytes.fill(0);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
const readResolvedGrantsFile = async (filePath) => {
|
|
45
|
+
let bytes;
|
|
46
|
+
try {
|
|
47
|
+
bytes = await readFile(filePath);
|
|
48
|
+
if (bytes.length < 1 || bytes.length > 65_536)
|
|
49
|
+
throw new Error();
|
|
50
|
+
return JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(bytes));
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
throw new Error(TARGET_SECRET_SOURCE_ERROR);
|
|
54
|
+
}
|
|
55
|
+
finally {
|
|
56
|
+
bytes?.fill(0);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
const writeWorldBindingsFile = async (filePath, artifact) => {
|
|
60
|
+
const bytes = new TextEncoder().encode(renderSimfileWorldBindings(artifact));
|
|
61
|
+
try {
|
|
62
|
+
await writeFile(filePath, bytes, { flag: "wx", mode: 0o600 });
|
|
63
|
+
return `sha256:${createHash("sha256").update(bytes).digest("hex")}`;
|
|
64
|
+
}
|
|
65
|
+
finally {
|
|
66
|
+
bytes.fill(0);
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
export const registerAuthCommands = (program, handlers, streams, stdin) => {
|
|
70
|
+
const authCommand = program.command("auth").description("Manage local Spawnfile auth profiles");
|
|
71
|
+
const authImportCommand = authCommand
|
|
72
|
+
.command("import")
|
|
73
|
+
.description("Import auth material into a local auth profile");
|
|
74
|
+
authImportCommand
|
|
75
|
+
.command("env")
|
|
76
|
+
.description("Import secrets from an env file into a profile")
|
|
77
|
+
.argument("<file>", "Path to an env file")
|
|
78
|
+
.option("-p, --profile <name>", "Auth profile name", "default")
|
|
79
|
+
.action(async (filePath, options) => {
|
|
80
|
+
const profile = await handlers.importEnvFile(options.profile, filePath);
|
|
81
|
+
emitLines(streams, formatAuthProfileSummary(profile));
|
|
82
|
+
});
|
|
83
|
+
authImportCommand
|
|
84
|
+
.command("claude-code")
|
|
85
|
+
.description("Import Claude Code subscription credentials into a profile")
|
|
86
|
+
.option("-p, --profile <name>", "Auth profile name", "default")
|
|
87
|
+
.option("--from <directory>", "Source Claude Code config directory")
|
|
88
|
+
.action(async (options) => {
|
|
89
|
+
const profile = await handlers.importClaudeCodeAuth(options.profile, options.from);
|
|
90
|
+
emitLines(streams, formatAuthProfileSummary(profile));
|
|
91
|
+
});
|
|
92
|
+
authImportCommand
|
|
93
|
+
.command("codex")
|
|
94
|
+
.description("Import Codex subscription credentials into a profile")
|
|
95
|
+
.option("-p, --profile <name>", "Auth profile name", "default")
|
|
96
|
+
.option("--from <directory>", "Source Codex config directory")
|
|
97
|
+
.action(async (options) => {
|
|
98
|
+
const profile = await handlers.importCodexAuth(options.profile, options.from);
|
|
99
|
+
emitLines(streams, formatAuthProfileSummary(profile));
|
|
100
|
+
});
|
|
101
|
+
authCommand
|
|
102
|
+
.command("sync")
|
|
103
|
+
.description("Provision auth material a project requires into a profile")
|
|
104
|
+
.argument("[path]", "Project directory or Spawnfile path", process.cwd())
|
|
105
|
+
.option("-p, --profile <name>", "Auth profile name", "default")
|
|
106
|
+
.option("--env-file <file>", "Path to an env file with model keys and runtime secrets")
|
|
107
|
+
.option("--claude-from <directory>", "Source Claude Code config directory")
|
|
108
|
+
.option("--codex-from <directory>", "Source Codex config directory")
|
|
109
|
+
.action(async (inputPath, options) => {
|
|
110
|
+
const profile = await handlers.syncProjectAuth(inputPath, {
|
|
111
|
+
claudeCodeDirectory: options.claudeFrom,
|
|
112
|
+
codexDirectory: options.codexFrom,
|
|
113
|
+
envFilePath: options.envFile,
|
|
114
|
+
profileName: options.profile
|
|
115
|
+
});
|
|
116
|
+
emitLines(streams, formatAuthProfileSummary(profile));
|
|
117
|
+
});
|
|
118
|
+
authCommand
|
|
119
|
+
.command("show")
|
|
120
|
+
.description("Show the contents of a local auth profile")
|
|
121
|
+
.option("-p, --profile <name>", "Auth profile name", "default")
|
|
122
|
+
.action(async (options) => {
|
|
123
|
+
const profile = await handlers.requireAuthProfile(options.profile);
|
|
124
|
+
emitLines(streams, formatAuthProfileSummary(profile));
|
|
125
|
+
});
|
|
126
|
+
authCommand
|
|
127
|
+
.command("provision")
|
|
128
|
+
.description("Provision a declarative batch of target credentials")
|
|
129
|
+
.argument("<request-file>", "Secret-free credential provisioning request JSON")
|
|
130
|
+
.option("--env-file <path>", "Create a 0600 environment file")
|
|
131
|
+
.option("--world-bindings <path>", "Create a resolved world-bindings artifact")
|
|
132
|
+
.option("--resolved-grants <path>", "Resolved world grants used to derive world bindings")
|
|
133
|
+
.action((requestFile, options) => targetSecretAction(async () => {
|
|
134
|
+
let materials;
|
|
135
|
+
try {
|
|
136
|
+
const request = await readCredentialProvisioningRequestFile(requestFile);
|
|
137
|
+
if ((options.worldBindings === undefined) !== (options.resolvedGrants === undefined)) {
|
|
138
|
+
throw new Error(TARGET_SECRET_SOURCE_ERROR);
|
|
139
|
+
}
|
|
140
|
+
const provisioned = await handlers.provisionCredentials(request);
|
|
141
|
+
materials = provisioned.materials;
|
|
142
|
+
let modelEngineAuth = false;
|
|
143
|
+
if (request.model_engine_auth) {
|
|
144
|
+
await handlers.importCodexAuth(request.model_engine_auth.profile, request.model_engine_auth.from);
|
|
145
|
+
modelEngineAuth = true;
|
|
146
|
+
}
|
|
147
|
+
const envFile = options.envFile === undefined
|
|
148
|
+
? undefined
|
|
149
|
+
: await writeProvisionedEnvFile({
|
|
150
|
+
materials,
|
|
151
|
+
path: options.envFile,
|
|
152
|
+
receipt: provisioned.receipt
|
|
153
|
+
});
|
|
154
|
+
let worldBindingsDigest;
|
|
155
|
+
if (options.worldBindings !== undefined && options.resolvedGrants !== undefined) {
|
|
156
|
+
const resolved = await readResolvedGrantsFile(options.resolvedGrants);
|
|
157
|
+
const artifact = buildProvisionedWorldBindings({
|
|
158
|
+
receipt: provisioned.receipt,
|
|
159
|
+
request,
|
|
160
|
+
resolved
|
|
161
|
+
});
|
|
162
|
+
worldBindingsDigest = await writeWorldBindingsFile(options.worldBindings, artifact);
|
|
163
|
+
}
|
|
164
|
+
emitCredentialProvisioningReceipt(streams, finalizeCredentialProvisioningReceipt(provisioned.receipt, {
|
|
165
|
+
...(envFile === undefined ? {} : { env_file_digest: envFile.digest }),
|
|
166
|
+
model_engine_auth: modelEngineAuth,
|
|
167
|
+
...(worldBindingsDigest === undefined ? {} : { world_bindings_digest: worldBindingsDigest })
|
|
168
|
+
}));
|
|
169
|
+
}
|
|
170
|
+
finally {
|
|
171
|
+
if (materials)
|
|
172
|
+
disposeProvisionedMaterials(materials);
|
|
173
|
+
}
|
|
174
|
+
}));
|
|
175
|
+
const targetSecret = authCommand.command("target-secret").description("Manage opaque target secret sources");
|
|
176
|
+
targetSecret.command("author").description("Author a secret read only from stdin").action(() => targetSecretAction(async () => {
|
|
177
|
+
const secret = await readBoundedTargetSecretStdin(stdin, MAX_TARGET_SECRET_SOURCE_SECRET_BYTES);
|
|
178
|
+
try {
|
|
179
|
+
const lifecycle = await handlers.initializeTargetSecretSourceLifecycle();
|
|
180
|
+
const result = await lifecycle.author(secret);
|
|
181
|
+
emitTargetSecretReceipt(streams, "author", result.source_handle);
|
|
182
|
+
}
|
|
183
|
+
finally {
|
|
184
|
+
secret.fill(0);
|
|
185
|
+
}
|
|
186
|
+
}));
|
|
187
|
+
targetSecret.command("grant").description("Grant one exact public source capability")
|
|
188
|
+
.argument("<request-file>", "Canonical secret-free grant request JSON")
|
|
189
|
+
.action((filePath) => targetSecretAction(async () => {
|
|
190
|
+
const request = await readTargetSecretSourceGrantRequestFile(filePath);
|
|
191
|
+
const lifecycle = await handlers.initializeTargetSecretSourceLifecycle();
|
|
192
|
+
const result = await lifecycle.grant(request);
|
|
193
|
+
emitTargetSecretReceipt(streams, "grant", result.source_handle);
|
|
194
|
+
}));
|
|
195
|
+
targetSecret.command("rotate").description("Author a replacement from stdin without revoking the old source")
|
|
196
|
+
.argument("<request-file>", "Canonical old-source request JSON")
|
|
197
|
+
.action((filePath) => targetSecretAction(async () => {
|
|
198
|
+
const request = await readTargetSecretSourceRequestFile(filePath);
|
|
199
|
+
const secret = await readBoundedTargetSecretStdin(stdin, MAX_TARGET_SECRET_SOURCE_SECRET_BYTES);
|
|
200
|
+
try {
|
|
201
|
+
const lifecycle = await handlers.initializeTargetSecretSourceLifecycle();
|
|
202
|
+
const result = await lifecycle.rotate(request.source_handle, secret);
|
|
203
|
+
emitTargetSecretReceipt(streams, "rotate", result.source_handle);
|
|
204
|
+
}
|
|
205
|
+
finally {
|
|
206
|
+
secret.fill(0);
|
|
207
|
+
}
|
|
208
|
+
}));
|
|
209
|
+
for (const [command, kind] of [["revoke-grant", "grant"], ["revoke-version", "version"]]) {
|
|
210
|
+
targetSecret.command(command).description(`Revoke one ${kind} capability`)
|
|
211
|
+
.argument("<request-file>", "Canonical source request JSON")
|
|
212
|
+
.action((filePath) => targetSecretAction(async () => {
|
|
213
|
+
const request = await readTargetSecretSourceRequestFile(filePath);
|
|
214
|
+
const lifecycle = await handlers.initializeTargetSecretSourceLifecycle();
|
|
215
|
+
const result = kind === "grant"
|
|
216
|
+
? await lifecycle.revokeGrant(request.source_handle)
|
|
217
|
+
: await lifecycle.revokeVersion(request.source_handle);
|
|
218
|
+
emitTargetSecretReceipt(streams, command, result.source_handle);
|
|
219
|
+
}));
|
|
220
|
+
}
|
|
221
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export const registerCompileBuildCommands = (program, handlers, streams) => {
|
|
2
|
+
program
|
|
3
|
+
.command("compile")
|
|
4
|
+
.description("Compile a project into runtime-native output under .spawn")
|
|
5
|
+
.argument("[path]", "Project directory or Spawnfile path", process.cwd())
|
|
6
|
+
.option("-o, --out <directory>", "Output directory")
|
|
7
|
+
.option("--world-bindings <file>", "Path to a versioned world-bindings artifact")
|
|
8
|
+
.action(async (inputPath, options) => {
|
|
9
|
+
const result = await handlers.compileProject(inputPath, {
|
|
10
|
+
outputDirectory: options.out,
|
|
11
|
+
worldBindingsPath: options.worldBindings
|
|
12
|
+
});
|
|
13
|
+
streams.stdout(`compiled to ${result.outputDirectory}`);
|
|
14
|
+
streams.stdout(`report: ${result.reportPath}`);
|
|
15
|
+
});
|
|
16
|
+
program
|
|
17
|
+
.command("build")
|
|
18
|
+
.description("Compile and build the organization Docker image")
|
|
19
|
+
.argument("[path]", "Project directory or Spawnfile path", process.cwd())
|
|
20
|
+
.option("--context <name>", "Docker context for the build target")
|
|
21
|
+
.option("--docker-command <command>", "Docker command")
|
|
22
|
+
.option("-o, --out <directory>", "Output directory")
|
|
23
|
+
.option("-t, --tag <image>", "Docker image tag")
|
|
24
|
+
.action(async (inputPath, options) => {
|
|
25
|
+
const result = await handlers.buildProject(inputPath, {
|
|
26
|
+
dockerContext: options.context,
|
|
27
|
+
dockerCommand: options.dockerCommand,
|
|
28
|
+
imageTag: options.tag,
|
|
29
|
+
outputDirectory: options.out
|
|
30
|
+
});
|
|
31
|
+
streams.stdout(`built image ${result.imageTag}`);
|
|
32
|
+
streams.stdout(`compiled to ${result.outputDirectory}`);
|
|
33
|
+
streams.stdout(`report: ${result.reportPath}`);
|
|
34
|
+
});
|
|
35
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Command } from "commander";
|
|
2
|
+
/** Production-only command. Its stdout is the secret-free canonical receipt. */
|
|
3
|
+
export declare const registerContainerBundleCommand: (target: Command, stdin: AsyncIterable<unknown>, streams: {
|
|
4
|
+
stderr(message: string): void;
|
|
5
|
+
stdout(message: string): void;
|
|
6
|
+
}, setExitCode: (value: 1 | 2) => void) => void;
|