spawnfile 0.1.13 → 0.1.17
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 +61 -121
- 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/importers.d.ts +10 -0
- package/dist/auth/importers.js +29 -4
- package/dist/auth/index.d.ts +9 -0
- package/dist/auth/index.js +8 -0
- package/dist/auth/paths.d.ts +12 -1
- package/dist/auth/paths.js +21 -0
- package/dist/auth/profileStore.js +9 -9
- package/dist/auth/targetSecretSourceAuthor.d.ts +18 -0
- package/dist/auth/targetSecretSourceAuthor.js +52 -0
- package/dist/auth/targetSecretSourceFsIdentity.d.ts +40 -0
- package/dist/auth/targetSecretSourceFsIdentity.js +42 -0
- package/dist/auth/targetSecretSourceFsPublish.d.ts +17 -0
- package/dist/auth/targetSecretSourceFsPublish.js +51 -0
- package/dist/auth/targetSecretSourceFsPublishImmutable.d.ts +17 -0
- package/dist/auth/targetSecretSourceFsPublishImmutable.js +468 -0
- package/dist/auth/targetSecretSourceFsRead.d.ts +14 -0
- package/dist/auth/targetSecretSourceFsRead.js +189 -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/auth/trainingAuth.d.ts +21 -0
- package/dist/auth/trainingAuth.js +86 -0
- package/dist/auth/types.d.ts +1 -1
- 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 +230 -0
- package/dist/cli/canaryCutoverCommand.d.ts +2 -0
- package/dist/cli/canaryCutoverCommand.js +30 -0
- package/dist/cli/capabilitiesCommand.d.ts +3 -0
- package/dist/cli/capabilitiesCommand.js +12 -0
- package/dist/cli/capabilitiesReceipt.d.ts +56 -0
- package/dist/cli/capabilitiesReceipt.js +56 -0
- package/dist/cli/compileBuildCommands.d.ts +3 -0
- package/dist/cli/compileBuildCommands.js +48 -0
- package/dist/cli/composedLifecycleContractSet.d.ts +21 -0
- package/dist/cli/composedLifecycleContractSet.js +204 -0
- package/dist/cli/containerBundleCommand.d.ts +6 -0
- package/dist/cli/containerBundleCommand.js +116 -0
- package/dist/cli/devCommands.js +2 -0
- package/dist/cli/downCommand.d.ts +25 -0
- package/dist/cli/downCommand.js +145 -0
- package/dist/cli/evidenceExportHelperCommand.d.ts +13 -0
- package/dist/cli/evidenceExportHelperCommand.js +51 -0
- package/dist/cli/index.js +15 -3
- package/dist/cli/lifecycleCommands.d.ts +1 -1
- package/dist/cli/lifecycleCommands.js +11 -181
- package/dist/cli/lifecycleMachine.d.ts +25 -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/paideiaDelegation.d.ts +17 -0
- package/dist/cli/paideiaDelegation.js +210 -0
- package/dist/cli/paideiaSupervisor.d.ts +17 -0
- package/dist/cli/paideiaSupervisor.js +48 -0
- package/dist/cli/productStateCloneCommand.d.ts +2 -0
- package/dist/cli/productStateCloneCommand.js +34 -0
- package/dist/cli/runCli.d.ts +19 -2
- package/dist/cli/runCli.js +58 -74
- 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 +30 -0
- package/dist/cli/targetCommands.js +227 -0
- package/dist/cli/targetComposedPreparationCommand.d.ts +6 -0
- package/dist/cli/targetComposedPreparationCommand.js +39 -0
- package/dist/cli/targetConfigPreparedPlan.d.ts +3 -0
- package/dist/cli/targetConfigPreparedPlan.js +74 -0
- package/dist/cli/targetConfigResolver.d.ts +3 -0
- package/dist/cli/targetConfigResolver.js +111 -0
- package/dist/cli/targetConfigResolverCommand.d.ts +6 -0
- package/dist/cli/targetConfigResolverCommand.js +43 -0
- package/dist/cli/targetConfigResolverContracts.d.ts +56 -0
- package/dist/cli/targetConfigResolverContracts.js +30 -0
- package/dist/cli/targetConfigResolverDocker.d.ts +4 -0
- package/dist/cli/targetConfigResolverDocker.js +47 -0
- package/dist/cli/targetConfigResolverValidation.d.ts +10 -0
- package/dist/cli/targetConfigResolverValidation.js +94 -0
- package/dist/cli/targetDefaultArtifactAuthority.d.ts +5 -0
- package/dist/cli/targetDefaultArtifactAuthority.js +28 -0
- package/dist/cli/targetDefaultAuthorities.d.ts +55 -0
- package/dist/cli/targetDefaultAuthorities.js +213 -0
- package/dist/cli/targetDefaultConfig.d.ts +75 -0
- package/dist/cli/targetDefaultConfig.js +334 -0
- package/dist/cli/targetDefaultConfigStdin.d.ts +13 -0
- package/dist/cli/targetDefaultConfigStdin.js +221 -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 +268 -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/targetProductionCommands.d.ts +5 -0
- package/dist/cli/targetProductionCommands.js +45 -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/targetWorldReadinessCommand.d.ts +10 -0
- package/dist/cli/targetWorldReadinessCommand.js +43 -0
- package/dist/cli/trainCommand.d.ts +3 -0
- package/dist/cli/trainCommand.js +61 -0
- package/dist/cli/upCommand.d.ts +3 -0
- package/dist/cli/upCommand.js +162 -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 +197 -0
- package/dist/cli/usageCommand.d.ts +40 -0
- package/dist/cli/usageCommand.js +284 -0
- package/dist/cli/usageCommandLive.d.ts +84 -0
- package/dist/cli/usageCommandLive.js +95 -0
- package/dist/cli/usageDeploymentSource.d.ts +9 -0
- package/dist/cli/usageDeploymentSource.js +22 -0
- package/dist/cli/workspaceResourceMigrationCommand.d.ts +8 -0
- package/dist/cli/workspaceResourceMigrationCommand.js +36 -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 +2 -1
- package/dist/compiler/buildCompilePlanTeams.js +9 -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 +5 -0
- package/dist/compiler/compileProject.d.ts +15 -0
- package/dist/compiler/compileProject.js +31 -75
- package/dist/compiler/compileProjectPolicy.d.ts +5 -0
- package/dist/compiler/compileProjectPolicy.js +21 -0
- package/dist/compiler/compileProjectReports.d.ts +9 -0
- package/dist/compiler/compileProjectReports.js +52 -0
- package/dist/compiler/compileProjectSupport.js +9 -0
- package/dist/compiler/containerArtifactSummaries.d.ts +7 -0
- package/dist/compiler/containerArtifactSummaries.js +138 -0
- package/dist/compiler/containerArtifacts.d.ts +12 -0
- package/dist/compiler/containerArtifacts.js +180 -127
- package/dist/compiler/containerArtifactsPlans.d.ts +5 -3
- package/dist/compiler/containerArtifactsPlans.js +54 -124
- package/dist/compiler/containerArtifactsRender.d.ts +5 -2
- package/dist/compiler/containerArtifactsRender.js +106 -70
- package/dist/compiler/containerArtifactsTypes.d.ts +20 -0
- package/dist/compiler/containerBackedMountRender.d.ts +56 -0
- package/dist/compiler/containerBackedMountRender.js +101 -0
- package/dist/compiler/containerConfigEnvRender.d.ts +3 -0
- package/dist/compiler/containerConfigEnvRender.js +54 -0
- package/dist/compiler/containerDaimonBrokerRender.d.ts +112 -0
- package/dist/compiler/containerDaimonBrokerRender.js +191 -0
- package/dist/compiler/containerDaimonGrokWorkerProvisioning.d.ts +38 -0
- package/dist/compiler/containerDaimonGrokWorkerProvisioning.js +108 -0
- package/dist/compiler/containerDaimonGrokWorkerRender.d.ts +172 -0
- package/dist/compiler/containerDaimonGrokWorkerRender.js +268 -0
- package/dist/compiler/containerDaimonOwnershipGuardRender.d.ts +12 -0
- package/dist/compiler/containerDaimonOwnershipGuardRender.js +191 -0
- package/dist/compiler/containerDaimonUidEntrypointRender.d.ts +24 -0
- package/dist/compiler/containerDaimonUidEntrypointRender.js +297 -0
- package/dist/compiler/containerEntrypointRender.d.ts +8 -0
- package/dist/compiler/containerEntrypointRender.js +82 -72
- 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/containerPersistentMounts.d.ts +30 -0
- package/dist/compiler/containerPersistentMounts.js +66 -0
- package/dist/compiler/containerReadinessPaths.d.ts +1 -0
- package/dist/compiler/containerReadinessPaths.js +1 -0
- package/dist/compiler/containerRuntimeLinkMaterializer.d.ts +2 -0
- package/dist/compiler/containerRuntimeLinkMaterializer.js +12 -0
- package/dist/compiler/containerRuntimeReadinessRender.d.ts +7 -0
- package/dist/compiler/containerRuntimeReadinessRender.js +40 -0
- package/dist/compiler/containerStateOwnershipRender.d.ts +4 -0
- package/dist/compiler/containerStateOwnershipRender.js +75 -0
- package/dist/compiler/containerTargetPlanResolution.d.ts +20 -0
- package/dist/compiler/containerTargetPlanResolution.js +97 -0
- package/dist/compiler/containerTargetResources.d.ts +22 -1
- package/dist/compiler/containerTargetResources.js +94 -2
- package/dist/compiler/containerVolumeBootstrap.d.ts +3 -0
- package/dist/compiler/containerVolumeBootstrap.js +3 -0
- package/dist/compiler/containerWorkspaceResourceRender.js +49 -1
- package/dist/compiler/daimonTelemetryArtifacts.d.ts +22 -0
- package/dist/compiler/daimonTelemetryArtifacts.js +56 -0
- package/dist/compiler/deploymentLineage.d.ts +40 -0
- package/dist/compiler/deploymentLineage.js +50 -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 +7 -0
- package/dist/compiler/index.js +7 -0
- package/dist/compiler/initProject.d.ts +2 -0
- package/dist/compiler/initProject.js +39 -1
- package/dist/compiler/localMoltnetAuthority.d.ts +64 -0
- package/dist/compiler/localMoltnetAuthority.js +177 -0
- package/dist/compiler/memoryArtifacts.d.ts +26 -0
- package/dist/compiler/memoryArtifacts.js +210 -0
- package/dist/compiler/memoryResolution.d.ts +4 -0
- package/dist/compiler/memoryResolution.js +147 -0
- package/dist/compiler/modelEnv.d.ts +7 -0
- package/dist/compiler/modelEnv.js +13 -1
- package/dist/compiler/moltnetAllowedWakeSendersValidation.d.ts +2 -0
- package/dist/compiler/moltnetAllowedWakeSendersValidation.js +42 -0
- package/dist/compiler/moltnetArtifactPaths.d.ts +31 -0
- package/dist/compiler/moltnetArtifactPaths.js +51 -0
- package/dist/compiler/moltnetArtifactTypes.d.ts +56 -0
- package/dist/compiler/moltnetArtifactTypes.js +1 -0
- package/dist/compiler/moltnetArtifacts.d.ts +3 -41
- package/dist/compiler/moltnetArtifacts.js +87 -101
- package/dist/compiler/moltnetBinaries.d.ts +33 -4
- package/dist/compiler/moltnetBinaries.js +173 -26
- package/dist/compiler/moltnetClientConfig.js +7 -2
- package/dist/compiler/moltnetConfigLowering.d.ts +18 -1
- package/dist/compiler/moltnetConfigLowering.js +92 -6
- 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 +40 -0
- package/dist/compiler/moltnetReleaseAuthority.js +102 -0
- package/dist/compiler/moltnetReleaseDownload.d.ts +12 -0
- package/dist/compiler/moltnetReleaseDownload.js +85 -0
- package/dist/compiler/moltnetRepresentativeResolution.d.ts +2 -1
- package/dist/compiler/moltnetRepresentativeResolution.js +17 -3
- package/dist/compiler/moltnetResolution.js +67 -21
- package/dist/compiler/moltnetRoomMemberships.js +52 -9
- package/dist/compiler/moltnetRoomPolicyCompatibility.d.ts +1 -1
- package/dist/compiler/moltnetRoomPolicyCompatibility.js +3 -1
- package/dist/compiler/moltnetRuntimeConfig.d.ts +1 -1
- package/dist/compiler/moltnetRuntimeConfig.js +22 -2
- package/dist/compiler/moltnetServerPlans.d.ts +9 -0
- package/dist/compiler/moltnetServerPlans.js +151 -0
- package/dist/compiler/organizationExternalParticipants.d.ts +3 -0
- package/dist/compiler/organizationExternalParticipants.js +176 -0
- package/dist/compiler/organizationIdentity.d.ts +21 -0
- package/dist/compiler/organizationIdentity.js +64 -0
- package/dist/compiler/organizationIdentityGraph.d.ts +15 -0
- package/dist/compiler/organizationIdentityGraph.js +115 -0
- package/dist/compiler/organizationReadyEvidence.d.ts +57 -0
- package/dist/compiler/organizationReadyEvidence.js +281 -0
- package/dist/compiler/projectManifestGraph.d.ts +4 -0
- package/dist/compiler/projectManifestGraph.js +24 -0
- package/dist/compiler/runProject.d.ts +8 -2
- package/dist/compiler/runProject.js +62 -27
- package/dist/compiler/runProjectAuth.d.ts +10 -2
- package/dist/compiler/runProjectAuth.js +105 -11
- package/dist/compiler/runProjectDaimonCodexDocker.d.ts +3 -0
- package/dist/compiler/runProjectDaimonCodexDocker.js +36 -0
- package/dist/compiler/runProjectDocker.d.ts +11 -0
- package/dist/compiler/runProjectDocker.js +64 -16
- package/dist/compiler/runProjectDockerDaimonGuards.d.ts +15 -0
- package/dist/compiler/runProjectDockerDaimonGuards.js +122 -0
- package/dist/compiler/runProjectDockerReservation.d.ts +3 -0
- package/dist/compiler/runProjectDockerReservation.js +118 -0
- 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/training/broker/declaration.d.ts +45 -0
- package/dist/compiler/training/broker/declaration.js +55 -0
- package/dist/compiler/training/broker/entrypoint.d.ts +39 -0
- package/dist/compiler/training/broker/entrypoint.js +111 -0
- package/dist/compiler/training/broker/index.d.ts +10 -0
- package/dist/compiler/training/broker/index.js +10 -0
- package/dist/compiler/training/broker/main.d.ts +2 -0
- package/dist/compiler/training/broker/main.js +14 -0
- package/dist/compiler/training/broker/paths.d.ts +196 -0
- package/dist/compiler/training/broker/paths.js +241 -0
- package/dist/compiler/training/broker/processes.d.ts +42 -0
- package/dist/compiler/training/broker/processes.js +99 -0
- package/dist/compiler/training/broker/projection.d.ts +51 -0
- package/dist/compiler/training/broker/projection.js +76 -0
- package/dist/compiler/training/broker/provisioning.d.ts +87 -0
- package/dist/compiler/training/broker/provisioning.js +213 -0
- package/dist/compiler/training/broker/receipt.d.ts +77 -0
- package/dist/compiler/training/broker/receipt.js +110 -0
- package/dist/compiler/training/broker/registration.d.ts +41 -0
- package/dist/compiler/training/broker/registration.js +102 -0
- package/dist/compiler/training/broker/runtime.d.ts +25 -0
- package/dist/compiler/training/broker/runtime.js +173 -0
- package/dist/compiler/training/broker/seccompRoutes.d.ts +31 -0
- package/dist/compiler/training/broker/seccompRoutes.js +36 -0
- package/dist/compiler/training/broker/supervisor.d.ts +109 -0
- package/dist/compiler/training/broker/supervisor.js +173 -0
- package/dist/compiler/training/container/contract.d.ts +31 -0
- package/dist/compiler/training/container/contract.js +33 -0
- package/dist/compiler/training/container/index.d.ts +4 -0
- package/dist/compiler/training/container/index.js +2 -0
- package/dist/compiler/training/container/launch.d.ts +18 -0
- package/dist/compiler/training/container/launch.js +173 -0
- package/dist/compiler/training/container/prepare.d.ts +8 -0
- package/dist/compiler/training/container/prepare.js +80 -0
- package/dist/compiler/training/container/process.d.ts +14 -0
- package/dist/compiler/training/container/process.js +70 -0
- package/dist/compiler/training/container/security.d.ts +36 -0
- package/dist/compiler/training/container/security.js +58 -0
- package/dist/compiler/training/context.d.ts +7 -0
- package/dist/compiler/training/context.js +93 -0
- package/dist/compiler/training/contract.d.ts +142 -0
- package/dist/compiler/training/contract.js +34 -0
- package/dist/compiler/training/index.d.ts +4 -0
- package/dist/compiler/training/index.js +3 -0
- package/dist/compiler/training/preparation/assets/Dockerfile +98 -0
- package/dist/compiler/training/preparation/assets/package-lock.json +3787 -0
- package/dist/compiler/training/preparation/broker.d.ts +21 -0
- package/dist/compiler/training/preparation/broker.js +43 -0
- package/dist/compiler/training/preparation/contextModes.d.ts +12 -0
- package/dist/compiler/training/preparation/contextModes.js +38 -0
- package/dist/compiler/training/preparation/contract.d.ts +182 -0
- package/dist/compiler/training/preparation/contract.js +94 -0
- package/dist/compiler/training/preparation/copyAssets.d.ts +1 -0
- package/dist/compiler/training/preparation/copyAssets.js +8 -0
- package/dist/compiler/training/preparation/daimonParent.d.ts +42 -0
- package/dist/compiler/training/preparation/daimonParent.js +114 -0
- package/dist/compiler/training/preparation/files.d.ts +25 -0
- package/dist/compiler/training/preparation/files.js +85 -0
- package/dist/compiler/training/preparation/image.d.ts +28 -0
- package/dist/compiler/training/preparation/image.js +102 -0
- package/dist/compiler/training/preparation/index.d.ts +3 -0
- package/dist/compiler/training/preparation/index.js +2 -0
- package/dist/compiler/training/preparation/inputs.d.ts +23 -0
- package/dist/compiler/training/preparation/inputs.js +93 -0
- package/dist/compiler/training/preparation/prepare.d.ts +33 -0
- package/dist/compiler/training/preparation/prepare.js +186 -0
- package/dist/compiler/training/preparation/scratch.d.ts +19 -0
- package/dist/compiler/training/preparation/scratch.js +48 -0
- package/dist/compiler/training/repair/compatibility.d.ts +11 -0
- package/dist/compiler/training/repair/compatibility.js +34 -0
- package/dist/compiler/training/repair/contract.d.ts +506 -0
- package/dist/compiler/training/repair/contract.js +31 -0
- package/dist/compiler/training/repair/index.d.ts +3 -0
- package/dist/compiler/training/repair/index.js +3 -0
- package/dist/compiler/training/repair/prepare.d.ts +230 -0
- package/dist/compiler/training/repair/prepare.js +74 -0
- package/dist/compiler/training/repair/witness.d.ts +203 -0
- package/dist/compiler/training/repair/witness.js +42 -0
- package/dist/compiler/types.d.ts +84 -1
- package/dist/compiler/upProject.d.ts +31 -1
- package/dist/compiler/upProject.js +197 -22
- package/dist/compiler/upProjectHandoff.d.ts +62 -0
- package/dist/compiler/upProjectHandoff.js +204 -0
- package/dist/compiler/upReceipt.d.ts +36 -0
- package/dist/compiler/upReceipt.js +127 -0
- package/dist/compiler/updateProjectModels.js +43 -60
- package/dist/compiler/updateProjectRuntime.js +22 -35
- package/dist/compiler/updateProjectSurfaces.js +53 -47
- package/dist/compiler/view/types.d.ts +1 -1
- package/dist/compiler/workspaceBundleArtifacts.d.ts +3 -0
- package/dist/compiler/workspaceBundleArtifacts.js +106 -0
- package/dist/compiler/workspaceResources.d.ts +4 -1
- package/dist/compiler/workspaceResources.js +12 -7
- 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 +185 -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/canaryCutover.d.ts +42 -0
- package/dist/deployment/canaryCutover.js +140 -0
- package/dist/deployment/candidateDiagnostics.d.ts +15 -0
- package/dist/deployment/candidateDiagnostics.js +90 -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 +5 -10
- package/dist/deployment/dockerManager.d.ts +51 -0
- package/dist/deployment/dockerManager.js +124 -1
- package/dist/deployment/dockerProbeGateway.d.ts +17 -0
- package/dist/deployment/dockerProbeGateway.js +80 -6
- 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 +39 -0
- package/dist/deployment/downDeployment.js +248 -0
- package/dist/deployment/downReceiptTypes.d.ts +36 -0
- package/dist/deployment/downReceiptTypes.js +45 -0
- package/dist/deployment/index.d.ts +20 -0
- package/dist/deployment/index.js +21 -0
- package/dist/deployment/lifecycleCompletion.d.ts +37 -0
- package/dist/deployment/lifecycleCompletion.js +236 -0
- package/dist/deployment/lifecycleCompletionContracts.d.ts +224 -0
- package/dist/deployment/lifecycleCompletionContracts.js +140 -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 +12 -0
- package/dist/deployment/lifecycleCompletionPaths.js +19 -0
- package/dist/deployment/lifecycleCompletionPublication.d.ts +7 -0
- package/dist/deployment/lifecycleCompletionPublication.js +49 -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/lifecycleUpRecords.d.ts +11 -0
- package/dist/deployment/lifecycleUpRecords.js +127 -0
- package/dist/deployment/native/AGENTS.md +11 -0
- package/dist/deployment/native/rename-noreplace-arm64 +0 -0
- package/dist/deployment/native/rename-noreplace-arm64.provenance.json +1 -0
- package/dist/deployment/native/rename-noreplace-x64 +0 -0
- package/dist/deployment/native/rename-noreplace-x64.provenance.json +1 -0
- package/dist/deployment/noReplaceActivation.d.ts +17 -0
- package/dist/deployment/noReplaceActivation.js +50 -0
- package/dist/deployment/organizationHandoffAuthorityFsBudget.d.ts +110 -0
- package/dist/deployment/organizationHandoffAuthorityFsBudget.js +156 -0
- package/dist/deployment/organizationHandoffAuthorityFsClient.d.ts +17 -0
- package/dist/deployment/organizationHandoffAuthorityFsClient.js +187 -0
- package/dist/deployment/organizationHandoffAuthorityFsElection.d.ts +21 -0
- package/dist/deployment/organizationHandoffAuthorityFsElection.js +57 -0
- package/dist/deployment/organizationHandoffAuthorityFsWorker.d.ts +1 -0
- package/dist/deployment/organizationHandoffAuthorityFsWorker.js +431 -0
- package/dist/deployment/organizationHandoffAuthorityFsWorkerParent.fixture.d.ts +1 -0
- package/dist/deployment/organizationHandoffAuthorityFsWorkerParent.fixture.js +26 -0
- package/dist/deployment/organizationHandoffAuthorityFsWorkerStall.fixture.d.ts +1 -0
- package/dist/deployment/organizationHandoffAuthorityFsWorkerStall.fixture.js +16 -0
- package/dist/deployment/organizationHandoffAuthorityStore.d.ts +41 -0
- package/dist/deployment/organizationHandoffAuthorityStore.js +355 -0
- package/dist/deployment/organizationHandoffAuthorityTypes.d.ts +76 -0
- package/dist/deployment/organizationHandoffAuthorityTypes.js +149 -0
- package/dist/deployment/organizationHandoffTypes.d.ts +29 -0
- package/dist/deployment/organizationHandoffTypes.js +80 -0
- package/dist/deployment/organizationReady.d.ts +54 -0
- package/dist/deployment/organizationReady.js +232 -0
- package/dist/deployment/privateArtifactsExport.d.ts +18 -0
- package/dist/deployment/privateArtifactsExport.js +80 -0
- package/dist/deployment/productStateClone.d.ts +43 -0
- package/dist/deployment/productStateClone.js +319 -0
- package/dist/deployment/record.d.ts +26 -1
- package/dist/deployment/record.js +49 -4
- package/dist/deployment/target.d.ts +1 -35
- package/dist/deployment/target.js +1 -96
- package/dist/deployment/upLifecycleRecoveryState.d.ts +23 -0
- package/dist/deployment/upLifecycleRecoveryState.js +12 -0
- package/dist/deployment/upReceiptTypes.d.ts +137 -0
- package/dist/deployment/upReceiptTypes.js +191 -0
- package/dist/deployment/workspaceResourceMigration.d.ts +55 -0
- package/dist/deployment/workspaceResourceMigration.js +315 -0
- package/dist/dev/project.d.ts +7 -0
- package/dist/dev/project.js +24 -9
- package/dist/distribution/buildDistributionReport.d.ts +2 -1
- package/dist/distribution/buildDistributionReport.js +2 -1
- package/dist/distribution/consumeImage.d.ts +2 -0
- package/dist/distribution/consumeImage.js +98 -73
- package/dist/distribution/consumeImageDaimonDocker.d.ts +3 -0
- package/dist/distribution/consumeImageDaimonDocker.js +45 -0
- package/dist/distribution/consumeImageLifecycle.d.ts +17 -0
- package/dist/distribution/consumeImageLifecycle.js +231 -0
- package/dist/distribution/consumeImageSupport.d.ts +12 -0
- package/dist/distribution/consumeImageSupport.js +15 -0
- package/dist/distribution/distributionReportSchema.d.ts +16 -1
- package/dist/distribution/distributionReportSchema.js +21 -3
- package/dist/distribution/dockerRunner.d.ts +6 -1
- package/dist/distribution/dockerRunner.js +31 -4
- package/dist/distribution/imageRuntimeAuth.d.ts +9 -1
- package/dist/distribution/imageRuntimeAuth.js +70 -1
- package/dist/distribution/index.d.ts +3 -3
- package/dist/distribution/index.js +2 -2
- package/dist/distribution/preflight.js +5 -1
- package/dist/distribution/types.d.ts +21 -1
- package/dist/distribution/types.js +4 -0
- package/dist/evidenceExportHelper/boundedExecutor.d.ts +3 -0
- package/dist/evidenceExportHelper/boundedExecutor.js +33 -0
- package/dist/evidenceExportHelper/helperProgram.mjs +156 -0
- package/dist/evidenceExportHelper/index.d.ts +4 -0
- package/dist/evidenceExportHelper/index.js +4 -0
- package/dist/evidenceExportHelper/preparedAuthority.d.ts +64 -0
- package/dist/evidenceExportHelper/preparedAuthority.js +228 -0
- package/dist/evidenceExportHelper/preparedBuilder.d.ts +10 -0
- package/dist/evidenceExportHelper/preparedBuilder.js +183 -0
- package/dist/evidenceExportHelper/preparedBuilderTypes.d.ts +19 -0
- package/dist/evidenceExportHelper/preparedBuilderTypes.js +1 -0
- package/dist/evidenceExportHelper/recipe.d.ts +7 -0
- package/dist/evidenceExportHelper/recipe.js +83 -0
- package/dist/filesystem/io.d.ts +2 -0
- package/dist/filesystem/io.js +16 -1
- 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/executionSchemas.d.ts +27 -0
- package/dist/manifest/executionSchemas.js +21 -2
- 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 +18 -0
- package/dist/manifest/mcpSchemas.js +44 -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 +20 -2
- package/dist/manifest/renderSpawnfileSurfaces.d.ts +2 -0
- package/dist/manifest/renderSpawnfileSurfaces.js +134 -0
- package/dist/manifest/renderSpawnfileWorkspace.js +5 -0
- package/dist/manifest/scheduleSchemas.d.ts +3 -1
- package/dist/manifest/scheduleSchemas.js +91 -5
- package/dist/manifest/schemas.d.ts +2034 -40
- package/dist/manifest/schemas.js +82 -33
- package/dist/manifest/surfaceSchemas.d.ts +17 -0
- package/dist/manifest/surfaceSchemas.js +24 -1
- package/dist/manifest/teamNetworkAccessSchemas.d.ts +6 -2
- package/dist/manifest/teamNetworkAccessSchemas.js +11 -0
- package/dist/manifest/teamNetworkAuthSchemas.d.ts +48 -0
- package/dist/manifest/teamNetworkAuthSchemas.js +103 -0
- package/dist/manifest/teamNetworkSchemas.d.ts +25 -190
- package/dist/manifest/teamNetworkSchemas.js +21 -317
- package/dist/manifest/teamNetworkServerSchemas.d.ts +155 -0
- package/dist/manifest/teamNetworkServerSchemas.js +215 -0
- package/dist/manifest/workspaceSchemas.d.ts +16 -0
- package/dist/manifest/workspaceSchemas.js +11 -0
- package/dist/ownership/siblingBuildFreshness.d.ts +20 -0
- package/dist/ownership/siblingBuildFreshness.js +20 -0
- package/dist/report/types.d.ts +173 -1
- package/dist/runtime/common.d.ts +63 -1
- package/dist/runtime/common.js +88 -3
- package/dist/runtime/container.d.ts +28 -1
- package/dist/runtime/container.js +78 -29
- package/dist/runtime/containerPackageOverrides.d.ts +37 -0
- package/dist/runtime/containerPackageOverrides.js +33 -0
- package/dist/runtime/daimon/adapter.d.ts +14 -0
- package/dist/runtime/daimon/adapter.js +243 -0
- package/dist/runtime/daimon/attention.d.ts +8 -0
- package/dist/runtime/daimon/attention.js +32 -0
- package/dist/runtime/daimon/config.d.ts +25 -0
- package/dist/runtime/daimon/config.js +272 -0
- package/dist/runtime/daimon/contractManifest.d.ts +295 -0
- package/dist/runtime/daimon/contractManifest.js +319 -0
- package/dist/runtime/daimon/grokModel.d.ts +19 -0
- package/dist/runtime/daimon/grokModel.js +33 -0
- package/dist/runtime/daimon/grokWorkerConfigBytes.d.ts +26 -0
- package/dist/runtime/daimon/grokWorkerConfigBytes.js +36 -0
- package/dist/runtime/daimon/grokWorkerContract.d.ts +22 -0
- package/dist/runtime/daimon/grokWorkerContract.js +48 -0
- package/dist/runtime/daimon/memory.d.ts +57 -0
- package/dist/runtime/daimon/memory.js +125 -0
- package/dist/runtime/daimon/runAuth.d.ts +51 -0
- package/dist/runtime/daimon/runAuth.js +279 -0
- package/dist/runtime/daimon/runtimeIdentity.d.ts +22 -0
- package/dist/runtime/daimon/runtimeIdentity.js +22 -0
- package/dist/runtime/daimon/scheduleAuthority.d.ts +3 -0
- package/dist/runtime/daimon/scheduleAuthority.js +17 -0
- package/dist/runtime/index.d.ts +6 -0
- package/dist/runtime/index.js +6 -0
- package/dist/runtime/install.d.ts +3 -0
- package/dist/runtime/install.js +3 -0
- package/dist/runtime/localDaimonAuthority.d.ts +11 -0
- package/dist/runtime/localDaimonAuthority.js +77 -0
- package/dist/runtime/mnemeMcp.d.ts +28 -0
- package/dist/runtime/mnemeMcp.js +135 -0
- package/dist/runtime/openclaw/adapter.js +17 -6
- 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 -2
- package/dist/runtime/pi/adapter.js +87 -58
- 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 +84 -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 +25 -29
- package/dist/runtime/picoclaw/mcp.d.ts +4 -0
- package/dist/runtime/picoclaw/mcp.js +43 -0
- package/dist/runtime/picoclaw/memory.d.ts +7 -0
- package/dist/runtime/picoclaw/memory.js +17 -0
- package/dist/runtime/picoclaw/runAuth.js +1 -1
- package/dist/runtime/picoclaw/scaffold.js +1 -1
- package/dist/runtime/picoclaw/schedules.d.ts +26 -0
- package/dist/runtime/picoclaw/schedules.js +62 -3
- package/dist/runtime/registry.d.ts +3 -0
- package/dist/runtime/registry.js +19 -2
- package/dist/runtime/scheduleUtils.d.ts +3 -0
- package/dist/runtime/scheduleUtils.js +19 -0
- package/dist/runtime/types.d.ts +50 -2
- package/dist/runtime/usageLedger.d.ts +158 -0
- package/dist/runtime/usageLedger.js +269 -0
- package/dist/runtime/usageLedgerRead.d.ts +48 -0
- package/dist/runtime/usageLedgerRead.js +102 -0
- package/dist/runtime/usageRequestLedger.d.ts +42 -0
- package/dist/runtime/usageRequestLedger.js +72 -0
- package/dist/shared/daimonCodexDocker.d.ts +32 -0
- package/dist/shared/daimonCodexDocker.js +120 -0
- package/dist/shared/daimonGrokSeccompProfile.d.ts +10 -0
- package/dist/shared/daimonGrokSeccompProfile.js +11 -0
- package/dist/shared/errors.d.ts +1 -1
- package/dist/shared/errors.js +2 -2
- package/dist/shared/index.d.ts +3 -0
- package/dist/shared/index.js +3 -0
- package/dist/shared/redaction.d.ts +2 -0
- package/dist/shared/redaction.js +10 -0
- package/dist/shared/types.d.ts +1 -1
- package/dist/shared/volumeNames.d.ts +6 -0
- package/dist/shared/volumeNames.js +14 -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/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 +476 -0
- package/dist/target/dockerBaseImage.d.ts +2 -0
- package/dist/target/dockerBaseImage.js +11 -0
- package/dist/target/dockerCommandExecutor.d.ts +38 -0
- package/dist/target/dockerCommandExecutor.js +251 -0
- package/dist/target/dockerCommandExecutorCore.d.ts +35 -0
- package/dist/target/dockerCommandExecutorCore.js +275 -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 +83 -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 +53 -0
- package/dist/target/dockerTarget.js +48 -0
- package/dist/target/dockerTargetBinding.d.ts +13 -0
- package/dist/target/dockerTargetBinding.js +95 -0
- package/dist/target/dockerTargetExecFile.d.ts +19 -0
- package/dist/target/dockerTargetExecFile.js +194 -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 +64 -0
- package/dist/target/dockerWorldServiceProvider.js +330 -0
- package/dist/target/dockerWorldServiceStore.d.ts +73 -0
- package/dist/target/dockerWorldServiceStore.js +367 -0
- package/dist/target/evidenceExport.d.ts +57 -0
- package/dist/target/evidenceExport.js +527 -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 +87 -0
- package/dist/target/evidenceExportProvider.js +197 -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 +72 -0
- package/dist/target/publicArtifactSnapshot.js +184 -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/examples/README.md +45 -0
- package/examples/agent-with-subagents/AGENTS.md +3 -0
- package/examples/agent-with-subagents/Spawnfile +30 -0
- package/examples/agent-with-subagents/subagents/critic/AGENTS.md +3 -0
- package/examples/agent-with-subagents/subagents/critic/Spawnfile +15 -0
- package/examples/agent-with-subagents/subagents/researcher/AGENTS.md +3 -0
- package/examples/agent-with-subagents/subagents/researcher/Spawnfile +17 -0
- package/examples/daimon-org/Spawnfile +68 -0
- package/examples/daimon-org/TEAM.md +4 -0
- package/examples/daimon-org/agents/mapper/AGENTS.md +4 -0
- package/examples/daimon-org/agents/mapper/Spawnfile +37 -0
- package/examples/daimon-org/shared/skills/file-note/SKILL.md +9 -0
- package/examples/daimon-org/teams/review/Spawnfile +53 -0
- package/examples/daimon-org/teams/review/agents/reviewer/AGENTS.md +4 -0
- package/examples/daimon-org/teams/review/agents/reviewer/Spawnfile +37 -0
- package/examples/daimon-public-host/AGENTS.md +3 -0
- package/examples/daimon-public-host/Spawnfile +21 -0
- package/examples/distribution-org/Spawnfile +43 -0
- package/examples/distribution-org/TEAM.md +4 -0
- package/examples/distribution-org/agents/coordinator/AGENTS.md +1 -0
- package/examples/distribution-org/agents/coordinator/Spawnfile +20 -0
- package/examples/distribution-org/agents/researcher/AGENTS.md +1 -0
- package/examples/distribution-org/agents/researcher/Spawnfile +20 -0
- package/examples/jungian-daimon-org/Spawnfile +41 -0
- package/examples/jungian-daimon-org/TEAM.md +21 -0
- package/examples/jungian-daimon-org/teams/luna/Spawnfile +47 -0
- package/examples/jungian-daimon-org/teams/luna/TEAM.md +4 -0
- package/examples/jungian-daimon-org/teams/luna/agents/animus/AGENTS.md +10 -0
- package/examples/jungian-daimon-org/teams/luna/agents/animus/Spawnfile +33 -0
- package/examples/jungian-daimon-org/teams/luna/agents/representative/AGENTS.md +21 -0
- package/examples/jungian-daimon-org/teams/luna/agents/representative/Spawnfile +30 -0
- package/examples/jungian-daimon-org/teams/luna/agents/shadow/AGENTS.md +10 -0
- package/examples/jungian-daimon-org/teams/luna/agents/shadow/Spawnfile +33 -0
- package/examples/jungian-daimon-org/teams/selene/Spawnfile +47 -0
- package/examples/jungian-daimon-org/teams/selene/TEAM.md +4 -0
- package/examples/jungian-daimon-org/teams/selene/agents/animus/AGENTS.md +10 -0
- package/examples/jungian-daimon-org/teams/selene/agents/animus/Spawnfile +33 -0
- package/examples/jungian-daimon-org/teams/selene/agents/representative/AGENTS.md +19 -0
- package/examples/jungian-daimon-org/teams/selene/agents/representative/Spawnfile +33 -0
- package/examples/jungian-daimon-org/teams/selene/agents/shadow/AGENTS.md +10 -0
- package/examples/jungian-daimon-org/teams/selene/agents/shadow/Spawnfile +30 -0
- package/examples/mixed-runtime-org/Spawnfile +71 -0
- package/examples/mixed-runtime-org/TEAM.md +8 -0
- package/examples/mixed-runtime-org/agents/analyst/AGENTS.md +8 -0
- package/examples/mixed-runtime-org/agents/analyst/Spawnfile +27 -0
- package/examples/mixed-runtime-org/agents/conductor/AGENTS.md +8 -0
- package/examples/mixed-runtime-org/agents/conductor/Spawnfile +27 -0
- package/examples/mixed-runtime-org/agents/localist/AGENTS.md +7 -0
- package/examples/mixed-runtime-org/agents/localist/Spawnfile +50 -0
- package/examples/moltnet-team-chat/Spawnfile +43 -0
- package/examples/moltnet-team-chat/TEAM.md +5 -0
- package/examples/moltnet-team-chat/agents/coordinator/AGENTS.md +9 -0
- package/examples/moltnet-team-chat/agents/coordinator/Spawnfile +26 -0
- package/examples/moltnet-team-chat/teams/analysis/Spawnfile +23 -0
- package/examples/moltnet-team-chat/teams/analysis/TEAM.md +3 -0
- package/examples/moltnet-team-chat/teams/analysis/agents/observer/AGENTS.md +5 -0
- package/examples/moltnet-team-chat/teams/analysis/agents/observer/Spawnfile +19 -0
- package/examples/moltnet-team-chat/teams/analysis/agents/representative/AGENTS.md +5 -0
- package/examples/moltnet-team-chat/teams/analysis/agents/representative/Spawnfile +19 -0
- package/examples/moltnet-team-chat/teams/field/Spawnfile +41 -0
- package/examples/moltnet-team-chat/teams/field/TEAM.md +3 -0
- package/examples/moltnet-team-chat/teams/field/agents/observer/AGENTS.md +5 -0
- package/examples/moltnet-team-chat/teams/field/agents/observer/Spawnfile +26 -0
- package/examples/moltnet-team-chat/teams/field/agents/representative/AGENTS.md +11 -0
- package/examples/moltnet-team-chat/teams/field/agents/representative/Spawnfile +26 -0
- package/examples/single-agent/AGENTS.md +3 -0
- package/examples/single-agent/HEARTBEAT.md +3 -0
- package/examples/single-agent/IDENTITY.md +3 -0
- package/examples/single-agent/MEMORY.md +3 -0
- package/examples/single-agent/SOUL.md +3 -0
- package/examples/single-agent/Spawnfile +41 -0
- package/examples/single-agent/skills/web_search/SKILL.md +6 -0
- package/moltnet-releases.json +21 -0
- package/package.json +57 -14
- package/runtimes.yaml +11 -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,373 @@
|
|
|
1
|
+
import { Buffer } from "node:buffer";
|
|
2
|
+
import { types as nodeTypes } from "node:util";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { targetResourceExportIndexSchema } from "./evidenceExportContract.js";
|
|
5
|
+
export { TARGET_EXPORT_INDEX_VERSION, targetResourceExportIndexSchema } from "./evidenceExportContract.js";
|
|
6
|
+
export const TARGET_RESOURCE_REQUEST_VERSION = "spawnfile.target-resource.request.v1";
|
|
7
|
+
export const TARGET_RESOURCE_RECEIPT_VERSION = "spawnfile.target-resource.receipt.v1";
|
|
8
|
+
export const SELECTED_TARGET_VERSION = "spawnfile.target-resource.selected-target.v1";
|
|
9
|
+
export const TARGET_JOURNAL_VERSION = "spawnfile.target-resource.journal.v1";
|
|
10
|
+
export const TARGET_OPERATION_LOOKUP_VERSION = "spawnfile.target-resource.operation-lookup.v1";
|
|
11
|
+
/**
|
|
12
|
+
* Read-only owner attestation. This is deliberately not a target-resource
|
|
13
|
+
* mutation: it neither reserves a journal operation nor grants a Docker
|
|
14
|
+
* capability to its caller.
|
|
15
|
+
*/
|
|
16
|
+
export const TARGET_TOPOLOGY_ATTESTATION_REQUEST_VERSION = "spawnfile.target-topology-attestation.request.v1";
|
|
17
|
+
export const TARGET_TOPOLOGY_RECEIPT_VERSION = "spawnfile.target-topology-receipt.v1";
|
|
18
|
+
const identifierSchema = z.string().regex(/^[a-z][a-z0-9_-]{0,63}$/u);
|
|
19
|
+
const containerPathSchema = z.string().max(255).regex(/^\/(?:run|var\/lib)\/[A-Za-z0-9][A-Za-z0-9._/-]*$/u)
|
|
20
|
+
.refine((value) => !value.includes("//") && !value.endsWith("/")
|
|
21
|
+
&& !value.split("/").some((part) => part === "." || part === ".."))
|
|
22
|
+
.refine((value) => value !== "/run/spawnfile-secrets"
|
|
23
|
+
&& !value.startsWith("/run/spawnfile-secrets/")
|
|
24
|
+
&& !"/run/spawnfile-secrets".startsWith(`${value}/`));
|
|
25
|
+
const RUN_ID_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/u;
|
|
26
|
+
export const runIdSchema = z.string()
|
|
27
|
+
.regex(RUN_ID_PATTERN)
|
|
28
|
+
.refine((value) => Buffer.byteLength(value, "utf8") <= 128)
|
|
29
|
+
.transform((value) => value);
|
|
30
|
+
export const parseRunId = (raw) => {
|
|
31
|
+
assertOrdinaryJsonGraph(raw);
|
|
32
|
+
return runIdSchema.parse(raw);
|
|
33
|
+
};
|
|
34
|
+
export const opaqueTargetHandleSchema = z.string().regex(/^opaque_[a-z0-9]{16,64}$/u).transform((value) => value);
|
|
35
|
+
export const parseOpaqueTargetHandle = (raw) => {
|
|
36
|
+
assertOrdinaryJsonGraph(raw);
|
|
37
|
+
return opaqueTargetHandleSchema.parse(raw);
|
|
38
|
+
};
|
|
39
|
+
const digestSchema = z.string().regex(/^sha256:[0-9a-f]{64}$/u);
|
|
40
|
+
const fingerprintSchema = z.string().regex(/^sha256:[0-9a-f]{32}$/u);
|
|
41
|
+
const revisionSchema = z.number().int().min(0).max(2_147_483_647);
|
|
42
|
+
const idempotencyKeySchema = z.string().regex(/^idem_[a-z0-9]{16,64}$/u);
|
|
43
|
+
const operationSchema = z.enum([
|
|
44
|
+
"select_target", "resolve_world_artifact", "prepare_secret_bindings", "create_data_network",
|
|
45
|
+
"create_evidence_volume", "attach_organization", "create_world_service", "start_world_service",
|
|
46
|
+
"stop_world_service", "detach_organization", "export_evidence_volume", "revoke_secret_bindings",
|
|
47
|
+
"cleanup_run", "recover_operation"
|
|
48
|
+
]);
|
|
49
|
+
export const selectedTargetSchema = z.object({
|
|
50
|
+
fingerprint: fingerprintSchema,
|
|
51
|
+
handle: opaqueTargetHandleSchema
|
|
52
|
+
}).strict();
|
|
53
|
+
const mutationEnvelopeSchema = {
|
|
54
|
+
descriptor_digest: digestSchema,
|
|
55
|
+
expected_revision: revisionSchema,
|
|
56
|
+
idempotency_key: idempotencyKeySchema,
|
|
57
|
+
run_id: runIdSchema,
|
|
58
|
+
selected_target: selectedTargetSchema
|
|
59
|
+
};
|
|
60
|
+
const selectTargetRequestSchema = z.object({
|
|
61
|
+
idempotency_key: idempotencyKeySchema,
|
|
62
|
+
operation: z.literal("select_target"),
|
|
63
|
+
target_reference: identifierSchema,
|
|
64
|
+
version: z.literal(TARGET_RESOURCE_REQUEST_VERSION)
|
|
65
|
+
}).strict();
|
|
66
|
+
const resolveWorldArtifactRequestSchema = z.object({
|
|
67
|
+
...mutationEnvelopeSchema,
|
|
68
|
+
artifact_manifest_digest: digestSchema,
|
|
69
|
+
operation: z.literal("resolve_world_artifact"),
|
|
70
|
+
version: z.literal(TARGET_RESOURCE_REQUEST_VERSION)
|
|
71
|
+
}).strict();
|
|
72
|
+
const prepareSecretBindingsRequestSchema = z.object({
|
|
73
|
+
...mutationEnvelopeSchema,
|
|
74
|
+
bindings: z.array(z.object({ name: identifierSchema, scope: identifierSchema, source_handle: opaqueTargetHandleSchema }).strict()).min(1).max(32),
|
|
75
|
+
operation: z.literal("prepare_secret_bindings"),
|
|
76
|
+
version: z.literal(TARGET_RESOURCE_REQUEST_VERSION)
|
|
77
|
+
}).strict();
|
|
78
|
+
const createDataNetworkRequestSchema = z.object({ ...mutationEnvelopeSchema, operation: z.literal("create_data_network"), version: z.literal(TARGET_RESOURCE_REQUEST_VERSION) }).strict();
|
|
79
|
+
const createEvidenceVolumeRequestSchema = z.object({ ...mutationEnvelopeSchema, operation: z.literal("create_evidence_volume"), version: z.literal(TARGET_RESOURCE_REQUEST_VERSION) }).strict();
|
|
80
|
+
const attachOrganizationRequestSchema = z.object({
|
|
81
|
+
...mutationEnvelopeSchema,
|
|
82
|
+
data_network_handle: opaqueTargetHandleSchema,
|
|
83
|
+
organization_handoff_handle: opaqueTargetHandleSchema,
|
|
84
|
+
operation: z.literal("attach_organization"),
|
|
85
|
+
version: z.literal(TARGET_RESOURCE_REQUEST_VERSION)
|
|
86
|
+
}).strict();
|
|
87
|
+
const createWorldServiceRequestSchema = z.object({
|
|
88
|
+
...mutationEnvelopeSchema,
|
|
89
|
+
data_network_handle: opaqueTargetHandleSchema,
|
|
90
|
+
evidence_mount_path: containerPathSchema,
|
|
91
|
+
evidence_volume_handle: opaqueTargetHandleSchema,
|
|
92
|
+
operation: z.literal("create_world_service"),
|
|
93
|
+
secret_bindings_handle: opaqueTargetHandleSchema,
|
|
94
|
+
world_artifact_handle: opaqueTargetHandleSchema,
|
|
95
|
+
version: z.literal(TARGET_RESOURCE_REQUEST_VERSION)
|
|
96
|
+
}).strict();
|
|
97
|
+
const serviceRequest = (operation) => z.object({
|
|
98
|
+
...mutationEnvelopeSchema,
|
|
99
|
+
operation: z.literal(operation),
|
|
100
|
+
world_service_handle: opaqueTargetHandleSchema,
|
|
101
|
+
version: z.literal(TARGET_RESOURCE_REQUEST_VERSION)
|
|
102
|
+
}).strict();
|
|
103
|
+
const detachOrganizationRequestSchema = z.object({
|
|
104
|
+
...mutationEnvelopeSchema,
|
|
105
|
+
data_network_handle: opaqueTargetHandleSchema,
|
|
106
|
+
operation: z.literal("detach_organization"),
|
|
107
|
+
organization_attachment_handle: opaqueTargetHandleSchema,
|
|
108
|
+
version: z.literal(TARGET_RESOURCE_REQUEST_VERSION)
|
|
109
|
+
}).strict();
|
|
110
|
+
const exportEvidenceVolumeRequestSchema = z.object({ ...mutationEnvelopeSchema, evidence_volume_handle: opaqueTargetHandleSchema, operation: z.literal("export_evidence_volume"), version: z.literal(TARGET_RESOURCE_REQUEST_VERSION) }).strict();
|
|
111
|
+
const revokeSecretBindingsRequestSchema = z.object({ ...mutationEnvelopeSchema, operation: z.literal("revoke_secret_bindings"), secret_bindings_handle: opaqueTargetHandleSchema, version: z.literal(TARGET_RESOURCE_REQUEST_VERSION) }).strict();
|
|
112
|
+
const cleanupRunRequestSchema = z.object({
|
|
113
|
+
...mutationEnvelopeSchema,
|
|
114
|
+
cleanup_policy: z.enum(["discard_evidence", "remove", "preserve_evidence"]),
|
|
115
|
+
evidence_volume_handle: opaqueTargetHandleSchema.optional(),
|
|
116
|
+
operation: z.literal("cleanup_run"),
|
|
117
|
+
organization_attachment_handle: opaqueTargetHandleSchema.optional(),
|
|
118
|
+
secret_bindings_handle: opaqueTargetHandleSchema.optional(),
|
|
119
|
+
version: z.literal(TARGET_RESOURCE_REQUEST_VERSION),
|
|
120
|
+
world_service_handle: opaqueTargetHandleSchema.optional()
|
|
121
|
+
}).strict();
|
|
122
|
+
const recoverOperationRequestSchema = z.object({ ...mutationEnvelopeSchema, operation: z.literal("recover_operation"), operation_handle: opaqueTargetHandleSchema, version: z.literal(TARGET_RESOURCE_REQUEST_VERSION) }).strict();
|
|
123
|
+
export const targetResourceRequestSchema = z.discriminatedUnion("operation", [
|
|
124
|
+
selectTargetRequestSchema, resolveWorldArtifactRequestSchema, prepareSecretBindingsRequestSchema,
|
|
125
|
+
createDataNetworkRequestSchema, createEvidenceVolumeRequestSchema, attachOrganizationRequestSchema,
|
|
126
|
+
createWorldServiceRequestSchema, serviceRequest("start_world_service"), serviceRequest("stop_world_service"),
|
|
127
|
+
detachOrganizationRequestSchema, exportEvidenceVolumeRequestSchema, revokeSecretBindingsRequestSchema,
|
|
128
|
+
cleanupRunRequestSchema, recoverOperationRequestSchema
|
|
129
|
+
]);
|
|
130
|
+
const labelSchema = z.object({ key: identifierSchema, value: identifierSchema }).strict();
|
|
131
|
+
const receiptSchema = z.object({
|
|
132
|
+
cleanup_state: z.enum(["not_requested", "preserved", "removed", "incomplete"]).nullable(),
|
|
133
|
+
descriptor_digest: digestSchema.nullable(),
|
|
134
|
+
evidence_index: targetResourceExportIndexSchema.optional(),
|
|
135
|
+
export_state: z.enum(["not_requested", "exported", "incomplete"]).nullable(),
|
|
136
|
+
labels: z.array(labelSchema).max(16),
|
|
137
|
+
operation: operationSchema,
|
|
138
|
+
operation_handle: opaqueTargetHandleSchema,
|
|
139
|
+
receipt_digest: digestSchema,
|
|
140
|
+
request_digest: digestSchema,
|
|
141
|
+
result_handle: opaqueTargetHandleSchema.nullable(),
|
|
142
|
+
resulting_revision: revisionSchema.nullable(),
|
|
143
|
+
run_id: runIdSchema.nullable(),
|
|
144
|
+
selected_target: selectedTargetSchema.nullable(),
|
|
145
|
+
version: z.literal(TARGET_RESOURCE_RECEIPT_VERSION)
|
|
146
|
+
}).strict().superRefine((value, context) => {
|
|
147
|
+
const selection = value.operation === "select_target";
|
|
148
|
+
if (selection && (value.run_id !== null || value.selected_target === null))
|
|
149
|
+
context.addIssue({ code: z.ZodIssueCode.custom, message: "selection correlation is invalid" });
|
|
150
|
+
if (!selection && (value.run_id === null || value.selected_target === null || value.descriptor_digest === null || value.resulting_revision === null))
|
|
151
|
+
context.addIssue({ code: z.ZodIssueCode.custom, message: "mutation correlation is invalid" });
|
|
152
|
+
if (selection && (value.descriptor_digest !== null || value.resulting_revision !== null))
|
|
153
|
+
context.addIssue({ code: z.ZodIssueCode.custom, message: "selection mutation fields are invalid" });
|
|
154
|
+
if ((value.operation === "export_evidence_volume") !== (value.evidence_index !== undefined)) {
|
|
155
|
+
context.addIssue({ code: z.ZodIssueCode.custom, message: "evidence export index is invalid" });
|
|
156
|
+
}
|
|
157
|
+
if (value.evidence_index !== undefined && (value.export_state !== "exported"
|
|
158
|
+
|| value.result_handle !== value.evidence_index.export_handle
|
|
159
|
+
|| value.run_id !== value.evidence_index.run_id
|
|
160
|
+
|| JSON.stringify(value.labels) !== JSON.stringify(value.evidence_index.labels))) {
|
|
161
|
+
context.addIssue({ code: z.ZodIssueCode.custom, message: "evidence export receipt is invalid" });
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
export const targetResourceReceiptSchema = receiptSchema;
|
|
165
|
+
export const selectedTargetReceiptSchema = z.object({ fingerprint: fingerprintSchema, handle: opaqueTargetHandleSchema, version: z.literal(SELECTED_TARGET_VERSION) }).strict();
|
|
166
|
+
const targetOperationLookupBaseSchema = {
|
|
167
|
+
idempotency_key: idempotencyKeySchema,
|
|
168
|
+
operation: operationSchema.exclude(["select_target"]),
|
|
169
|
+
request_digest: digestSchema,
|
|
170
|
+
version: z.literal(TARGET_OPERATION_LOOKUP_VERSION)
|
|
171
|
+
};
|
|
172
|
+
const targetOperationNotAppliedSchema = z.object({
|
|
173
|
+
...targetOperationLookupBaseSchema,
|
|
174
|
+
status: z.literal("not_applied")
|
|
175
|
+
}).strict();
|
|
176
|
+
const targetOperationPendingSchema = z.object({
|
|
177
|
+
...targetOperationLookupBaseSchema,
|
|
178
|
+
operation_handle: opaqueTargetHandleSchema,
|
|
179
|
+
status: z.literal("pending")
|
|
180
|
+
}).strict();
|
|
181
|
+
const targetOperationCompletedSchema = z.object({
|
|
182
|
+
...targetOperationLookupBaseSchema,
|
|
183
|
+
operation_handle: opaqueTargetHandleSchema,
|
|
184
|
+
receipt: receiptSchema,
|
|
185
|
+
status: z.literal("completed")
|
|
186
|
+
}).strict().superRefine((value, context) => {
|
|
187
|
+
if (value.receipt.operation !== value.operation
|
|
188
|
+
|| value.receipt.operation_handle !== value.operation_handle
|
|
189
|
+
|| value.receipt.request_digest !== value.request_digest) {
|
|
190
|
+
context.addIssue({
|
|
191
|
+
code: z.ZodIssueCode.custom,
|
|
192
|
+
message: "lookup receipt correlation is invalid"
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
export const targetOperationLookupSchema = z.discriminatedUnion("status", [
|
|
197
|
+
targetOperationNotAppliedSchema,
|
|
198
|
+
targetOperationPendingSchema,
|
|
199
|
+
targetOperationCompletedSchema
|
|
200
|
+
]);
|
|
201
|
+
const journalEntrySchema = z.object({ operation: operationSchema, operation_handle: opaqueTargetHandleSchema, receipt_digest: digestSchema, request_digest: digestSchema, state: z.enum(["pending", "completed", "incomplete"]) }).strict();
|
|
202
|
+
export const targetResourceJournalSchema = z.object({
|
|
203
|
+
descriptor_digest: digestSchema,
|
|
204
|
+
entries: z.array(journalEntrySchema).max(128),
|
|
205
|
+
revision: revisionSchema,
|
|
206
|
+
run_id: runIdSchema,
|
|
207
|
+
selected_target: selectedTargetSchema,
|
|
208
|
+
version: z.literal(TARGET_JOURNAL_VERSION)
|
|
209
|
+
}).strict();
|
|
210
|
+
const completedOperationSchema = z.object({
|
|
211
|
+
operation_handle: opaqueTargetHandleSchema,
|
|
212
|
+
request_digest: digestSchema,
|
|
213
|
+
result_handle: opaqueTargetHandleSchema
|
|
214
|
+
}).strict();
|
|
215
|
+
/**
|
|
216
|
+
* Public correlation packet for one already-created composed deployment. The
|
|
217
|
+
* owner resolves every handle against its private stores; these values are
|
|
218
|
+
* never Docker references.
|
|
219
|
+
*/
|
|
220
|
+
export const targetTopologyAttestationRequestSchema = z.object({
|
|
221
|
+
data_network: completedOperationSchema,
|
|
222
|
+
descriptor_digest: digestSchema,
|
|
223
|
+
organization_attachment: completedOperationSchema,
|
|
224
|
+
run_id: runIdSchema,
|
|
225
|
+
selected_target: selectedTargetSchema,
|
|
226
|
+
version: z.literal(TARGET_TOPOLOGY_ATTESTATION_REQUEST_VERSION),
|
|
227
|
+
world_service: z.object({
|
|
228
|
+
create: completedOperationSchema,
|
|
229
|
+
start: completedOperationSchema
|
|
230
|
+
}).strict()
|
|
231
|
+
}).strict().superRefine((value, context) => {
|
|
232
|
+
if (value.world_service.create.result_handle !== value.world_service.start.result_handle) {
|
|
233
|
+
context.addIssue({ code: z.ZodIssueCode.custom, message: "world service handles disagree" });
|
|
234
|
+
}
|
|
235
|
+
const handles = [
|
|
236
|
+
value.data_network.result_handle,
|
|
237
|
+
value.organization_attachment.result_handle,
|
|
238
|
+
value.world_service.create.result_handle
|
|
239
|
+
];
|
|
240
|
+
if (new Set(handles).size !== handles.length) {
|
|
241
|
+
context.addIssue({ code: z.ZodIssueCode.custom, message: "resource handles must be distinct" });
|
|
242
|
+
}
|
|
243
|
+
const operations = [
|
|
244
|
+
value.data_network.operation_handle,
|
|
245
|
+
value.organization_attachment.operation_handle,
|
|
246
|
+
value.world_service.create.operation_handle,
|
|
247
|
+
value.world_service.start.operation_handle
|
|
248
|
+
];
|
|
249
|
+
if (new Set(operations).size !== operations.length) {
|
|
250
|
+
context.addIssue({ code: z.ZodIssueCode.custom, message: "operation handles must be distinct" });
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
/**
|
|
254
|
+
* Semantic-only projection. It intentionally excludes every Docker name,
|
|
255
|
+
* ID, context, endpoint, path, port value and provider observation.
|
|
256
|
+
*/
|
|
257
|
+
export const targetTopologyReceiptSchema = z.object({
|
|
258
|
+
descriptor_digest: digestSchema,
|
|
259
|
+
handoff_scope: z.literal("organization_to_private_service"),
|
|
260
|
+
organization: z.object({
|
|
261
|
+
data_network_attachment: z.literal("exact"),
|
|
262
|
+
egress_policy: z.literal("egress_only")
|
|
263
|
+
}).strict(),
|
|
264
|
+
receipt_digest: digestSchema,
|
|
265
|
+
request_digest: digestSchema,
|
|
266
|
+
run_id: runIdSchema,
|
|
267
|
+
selected_target: selectedTargetSchema,
|
|
268
|
+
service_discovery: z.literal("dns_only"),
|
|
269
|
+
version: z.literal(TARGET_TOPOLOGY_RECEIPT_VERSION),
|
|
270
|
+
world_service: z.object({
|
|
271
|
+
data_network_attachment: z.literal("exactly_one"),
|
|
272
|
+
egress_policy: z.literal("none"),
|
|
273
|
+
published_ports: z.literal("none")
|
|
274
|
+
}).strict(),
|
|
275
|
+
world_network: z.literal("private_internal")
|
|
276
|
+
}).strict();
|
|
277
|
+
export const MAX_JSON_GRAPH_DEPTH = 32;
|
|
278
|
+
export const MAX_JSON_GRAPH_NODES = 1_024;
|
|
279
|
+
export const MAX_JSON_GRAPH_KEYS = 128;
|
|
280
|
+
export const MAX_JSON_GRAPH_STRING_BYTES = 65_536;
|
|
281
|
+
const JSON_GRAPH_ERROR = "invalid JSON-like graph";
|
|
282
|
+
const ARRAY_INDEX = /^(?:0|[1-9][0-9]*)$/u;
|
|
283
|
+
export const assertOrdinaryJsonGraph = (raw) => {
|
|
284
|
+
try {
|
|
285
|
+
const seen = new WeakSet();
|
|
286
|
+
const pending = [{ value: raw, depth: 0 }];
|
|
287
|
+
let nodes = 0;
|
|
288
|
+
let stringBytes = 0;
|
|
289
|
+
while (pending.length > 0) {
|
|
290
|
+
const item = pending.pop();
|
|
291
|
+
const value = item.value;
|
|
292
|
+
if (typeof value === "string") {
|
|
293
|
+
stringBytes += Buffer.byteLength(value, "utf8");
|
|
294
|
+
if (stringBytes > MAX_JSON_GRAPH_STRING_BYTES)
|
|
295
|
+
throw new Error();
|
|
296
|
+
continue;
|
|
297
|
+
}
|
|
298
|
+
if (value === null || typeof value === "boolean")
|
|
299
|
+
continue;
|
|
300
|
+
if (typeof value === "number") {
|
|
301
|
+
if (!Number.isFinite(value))
|
|
302
|
+
throw new Error();
|
|
303
|
+
continue;
|
|
304
|
+
}
|
|
305
|
+
if (typeof value !== "object" || nodeTypes.isProxy(value))
|
|
306
|
+
throw new Error();
|
|
307
|
+
if (item.depth > MAX_JSON_GRAPH_DEPTH || seen.has(value))
|
|
308
|
+
throw new Error();
|
|
309
|
+
seen.add(value);
|
|
310
|
+
nodes += 1;
|
|
311
|
+
if (nodes > MAX_JSON_GRAPH_NODES)
|
|
312
|
+
throw new Error();
|
|
313
|
+
if (Array.isArray(value)) {
|
|
314
|
+
if (Object.getPrototypeOf(value) !== Array.prototype)
|
|
315
|
+
throw new Error();
|
|
316
|
+
const length = Object.getOwnPropertyDescriptor(value, "length");
|
|
317
|
+
if (!length || !("value" in length) || !Number.isSafeInteger(length.value)
|
|
318
|
+
|| length.enumerable || length.configurable || length.value > MAX_JSON_GRAPH_KEYS)
|
|
319
|
+
throw new Error();
|
|
320
|
+
const keys = Reflect.ownKeys(value);
|
|
321
|
+
if (keys.length !== length.value + 1 || keys.length > MAX_JSON_GRAPH_KEYS + 1)
|
|
322
|
+
throw new Error();
|
|
323
|
+
for (let index = 0; index < length.value; index += 1) {
|
|
324
|
+
const key = String(index);
|
|
325
|
+
if (!ARRAY_INDEX.test(key))
|
|
326
|
+
throw new Error();
|
|
327
|
+
const descriptor = Object.getOwnPropertyDescriptor(value, key);
|
|
328
|
+
if (!descriptor || !("value" in descriptor) || !descriptor.enumerable)
|
|
329
|
+
throw new Error();
|
|
330
|
+
pending.push({ value: descriptor.value, depth: item.depth + 1 });
|
|
331
|
+
}
|
|
332
|
+
continue;
|
|
333
|
+
}
|
|
334
|
+
const prototype = Object.getPrototypeOf(value);
|
|
335
|
+
if (prototype !== Object.prototype && prototype !== null)
|
|
336
|
+
throw new Error();
|
|
337
|
+
const keys = Reflect.ownKeys(value);
|
|
338
|
+
if (keys.length > MAX_JSON_GRAPH_KEYS)
|
|
339
|
+
throw new Error();
|
|
340
|
+
for (const key of keys) {
|
|
341
|
+
if (typeof key !== "string")
|
|
342
|
+
throw new Error();
|
|
343
|
+
stringBytes += Buffer.byteLength(key, "utf8");
|
|
344
|
+
if (stringBytes > MAX_JSON_GRAPH_STRING_BYTES)
|
|
345
|
+
throw new Error();
|
|
346
|
+
const descriptor = Object.getOwnPropertyDescriptor(value, key);
|
|
347
|
+
if (!descriptor || !("value" in descriptor) || !descriptor.enumerable)
|
|
348
|
+
throw new Error();
|
|
349
|
+
pending.push({ value: descriptor.value, depth: item.depth + 1 });
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
catch {
|
|
354
|
+
throw new TypeError(JSON_GRAPH_ERROR);
|
|
355
|
+
}
|
|
356
|
+
};
|
|
357
|
+
export const parseTargetResourceRequest = (raw) => { assertOrdinaryJsonGraph(raw); return targetResourceRequestSchema.parse(raw); };
|
|
358
|
+
export const parseTargetResourceReceipt = (raw) => { assertOrdinaryJsonGraph(raw); return targetResourceReceiptSchema.parse(raw); };
|
|
359
|
+
export const parseSelectedTargetReceipt = (raw) => { assertOrdinaryJsonGraph(raw); return selectedTargetReceiptSchema.parse(raw); };
|
|
360
|
+
export const parseTargetResourceJournal = (raw) => { assertOrdinaryJsonGraph(raw); return targetResourceJournalSchema.parse(raw); };
|
|
361
|
+
export const parseTargetResourceExportIndex = (raw) => { assertOrdinaryJsonGraph(raw); return targetResourceExportIndexSchema.parse(raw); };
|
|
362
|
+
export const parseTargetOperationLookup = (raw) => {
|
|
363
|
+
assertOrdinaryJsonGraph(raw);
|
|
364
|
+
return targetOperationLookupSchema.parse(raw);
|
|
365
|
+
};
|
|
366
|
+
export const parseTargetTopologyAttestationRequest = (raw) => {
|
|
367
|
+
assertOrdinaryJsonGraph(raw);
|
|
368
|
+
return targetTopologyAttestationRequestSchema.parse(raw);
|
|
369
|
+
};
|
|
370
|
+
export const parseTargetTopologyReceipt = (raw) => {
|
|
371
|
+
assertOrdinaryJsonGraph(raw);
|
|
372
|
+
return targetTopologyReceiptSchema.parse(raw);
|
|
373
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { OpaqueTargetHandle } from "./contracts.js";
|
|
2
|
+
export interface DockerOciArtifactIdentityBinding {
|
|
3
|
+
readonly artifactManifestDigest: string;
|
|
4
|
+
/** Omitted only at the in-process writer API; persisted records always carry it. */
|
|
5
|
+
readonly identityKind?: "oci_image_manifest";
|
|
6
|
+
readonly imageDigest: string;
|
|
7
|
+
readonly imageReference: string;
|
|
8
|
+
readonly operationHandle: OpaqueTargetHandle;
|
|
9
|
+
readonly requestDigest: string;
|
|
10
|
+
readonly resultHandle: OpaqueTargetHandle;
|
|
11
|
+
readonly selectedTargetHandle: OpaqueTargetHandle;
|
|
12
|
+
}
|
|
13
|
+
export interface DockerConfigArtifactIdentityBinding {
|
|
14
|
+
readonly archiveDigest: string;
|
|
15
|
+
readonly artifactManifestDigest: string;
|
|
16
|
+
readonly baseImageConfigDigest: string;
|
|
17
|
+
readonly buildPolicyDigest: string;
|
|
18
|
+
readonly bundleDigest: string;
|
|
19
|
+
readonly configId: string;
|
|
20
|
+
readonly daemonEpoch: string;
|
|
21
|
+
readonly entrypoint: string;
|
|
22
|
+
/** Private deterministic GC anchor paired with this local config identity. */
|
|
23
|
+
readonly gcTag: string;
|
|
24
|
+
readonly identityKind: "docker_image_config_digest";
|
|
25
|
+
readonly launcherDigest: string;
|
|
26
|
+
readonly networkAlias: string;
|
|
27
|
+
readonly operationHandle: OpaqueTargetHandle;
|
|
28
|
+
readonly requestDigest: string;
|
|
29
|
+
readonly resultHandle: OpaqueTargetHandle;
|
|
30
|
+
readonly selectedTargetHandle: OpaqueTargetHandle;
|
|
31
|
+
readonly platform: {
|
|
32
|
+
readonly architecture: "amd64" | "arm64";
|
|
33
|
+
readonly os: "linux";
|
|
34
|
+
};
|
|
35
|
+
readonly platformDigest: string;
|
|
36
|
+
/** Exact bundle-prepare authority that minted gcTag/configId. */
|
|
37
|
+
readonly preparedOperationHandle: OpaqueTargetHandle;
|
|
38
|
+
readonly preparedRequestDigest: string;
|
|
39
|
+
}
|
|
40
|
+
/** Private authority only; persisted discriminator prevents variant confusion. */
|
|
41
|
+
export type DockerArtifactIdentityBinding = DockerOciArtifactIdentityBinding | DockerConfigArtifactIdentityBinding;
|
|
42
|
+
export interface DockerArtifactIdentityStore {
|
|
43
|
+
bind(input: DockerArtifactIdentityBinding): Promise<void>;
|
|
44
|
+
/** Exact private lookup; there is intentionally no result inverse or listing API. */
|
|
45
|
+
resolveOperation(operationHandle: OpaqueTargetHandle, requestDigest: string): Promise<DockerArtifactIdentityBinding | null>;
|
|
46
|
+
}
|
|
47
|
+
export interface DockerArtifactIdentityStoreOptions {
|
|
48
|
+
/** Test-only crash seam: runs after durable pending creation and before final linking. */
|
|
49
|
+
readonly beforePublish?: () => Promise<void>;
|
|
50
|
+
/** Test-only race seam after O_EXCL observes a pending name and before re-read. */
|
|
51
|
+
readonly afterPendingExists?: () => Promise<void>;
|
|
52
|
+
/** Test-only race seam after an exact pending proof and before its link attempt. */
|
|
53
|
+
readonly beforeLink?: () => Promise<void>;
|
|
54
|
+
/** Test-only crash seam: runs after the final link and before pending cleanup. */
|
|
55
|
+
readonly afterLinkBeforePendingUnlink?: () => Promise<void>;
|
|
56
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type OpaqueTargetHandle } from "./contracts.js";
|
|
2
|
+
import { type DockerArtifactExecutor, type DockerArtifactSpec, type DockerConfigArtifactSpec } from "./dockerArtifactsProvider.js";
|
|
3
|
+
export declare const createDockerArtifactSpec: (input: {
|
|
4
|
+
artifactManifestDigest: string;
|
|
5
|
+
imageDigest: string;
|
|
6
|
+
imageReference: string;
|
|
7
|
+
operationHandle: OpaqueTargetHandle;
|
|
8
|
+
requestDigest: string;
|
|
9
|
+
selectedTargetHandle: OpaqueTargetHandle;
|
|
10
|
+
}) => DockerArtifactSpec;
|
|
11
|
+
export declare const createDockerConfigArtifactSpec: (input: {
|
|
12
|
+
archiveDigest: string;
|
|
13
|
+
artifactManifestDigest: string;
|
|
14
|
+
baseImageConfigDigest: string;
|
|
15
|
+
buildPolicyDigest: string;
|
|
16
|
+
bundleDigest: string;
|
|
17
|
+
configId: string;
|
|
18
|
+
daemonEpoch: string;
|
|
19
|
+
entrypoint: string;
|
|
20
|
+
launcherDigest: string;
|
|
21
|
+
networkAlias: string;
|
|
22
|
+
operationHandle: OpaqueTargetHandle;
|
|
23
|
+
requestDigest: string;
|
|
24
|
+
selectedTargetHandle: OpaqueTargetHandle;
|
|
25
|
+
platform: {
|
|
26
|
+
readonly architecture: "amd64" | "arm64";
|
|
27
|
+
readonly os: "linux";
|
|
28
|
+
};
|
|
29
|
+
platformDigest: string;
|
|
30
|
+
}) => DockerConfigArtifactSpec;
|
|
31
|
+
export declare const executeDockerArtifact: (input: {
|
|
32
|
+
args: string[];
|
|
33
|
+
executor: DockerArtifactExecutor;
|
|
34
|
+
signal?: AbortSignal;
|
|
35
|
+
timeoutMs: number;
|
|
36
|
+
}) => Promise<{
|
|
37
|
+
stderr: string;
|
|
38
|
+
stdout: string;
|
|
39
|
+
}>;
|
|
40
|
+
export declare const isExpectedDockerArtifact: (stdout: string, spec: DockerArtifactSpec) => boolean;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { Buffer } from "node:buffer";
|
|
2
|
+
import { createHash } from "node:crypto";
|
|
3
|
+
import { assertOrdinaryJsonGraph, parseOpaqueTargetHandle } from "./contracts.js";
|
|
4
|
+
import { isImmutableDockerImageReference } from "./dockerArtifactsProvider.js";
|
|
5
|
+
const ERROR = "Docker artifact resolution failed";
|
|
6
|
+
const DIGEST = /^sha256:[0-9a-f]{64}$/u;
|
|
7
|
+
const fail = () => { throw new Error(ERROR); };
|
|
8
|
+
const digest = (domain, value) => createHash("sha256")
|
|
9
|
+
.update(`spawnfile.target-artifact.${domain}.v1\0`, "utf8").update(value, "utf8").digest("hex");
|
|
10
|
+
const label = (prefix, value) => `${prefix}${digest("label", value).slice(0, 63)}`;
|
|
11
|
+
const validDigest = (value) => typeof value === "string" && DIGEST.test(value);
|
|
12
|
+
const reference = (value) => isImmutableDockerImageReference(value);
|
|
13
|
+
export const createDockerArtifactSpec = (input) => {
|
|
14
|
+
if (!validDigest(input.artifactManifestDigest) || !validDigest(input.imageDigest) || !validDigest(input.requestDigest)
|
|
15
|
+
|| !reference(input.imageReference) || !input.imageReference.endsWith(`@${input.imageDigest}`))
|
|
16
|
+
return fail();
|
|
17
|
+
parseOpaqueTargetHandle(input.operationHandle);
|
|
18
|
+
parseOpaqueTargetHandle(input.selectedTargetHandle);
|
|
19
|
+
const authority = `${input.operationHandle}\0${input.requestDigest}\0${input.artifactManifestDigest}\0${input.imageDigest}`;
|
|
20
|
+
return Object.freeze({ imageDigest: input.imageDigest, imageReference: input.imageReference,
|
|
21
|
+
inspectionFormat: "[{\"RepoDigests\":{{json .RepoDigests}}}]",
|
|
22
|
+
labels: Object.freeze({ spawnfile_artifact_v1_image: label("i", input.imageDigest), spawnfile_artifact_v1_kind: "world_artifact",
|
|
23
|
+
spawnfile_artifact_v1_manifest: label("m", input.artifactManifestDigest), spawnfile_artifact_v1_operation: label("o", `${input.operationHandle}\0${input.requestDigest}`),
|
|
24
|
+
spawnfile_artifact_v1_target: label("t", input.selectedTargetHandle), spawnfile_artifact_v1_version: "v1" }),
|
|
25
|
+
resultHandle: parseOpaqueTargetHandle(`opaque_${digest("result", authority)}`) });
|
|
26
|
+
};
|
|
27
|
+
export const createDockerConfigArtifactSpec = (input) => {
|
|
28
|
+
if (![input.archiveDigest, input.artifactManifestDigest, input.baseImageConfigDigest, input.buildPolicyDigest, input.bundleDigest, input.configId, input.daemonEpoch, input.launcherDigest, input.platformDigest, input.requestDigest].every(validDigest)
|
|
29
|
+
|| !/^[A-Za-z0-9][A-Za-z0-9._/-]{0,239}$/u.test(input.entrypoint) || input.entrypoint.includes("//") || input.entrypoint.split("/").some((part) => part === "." || part === "..")
|
|
30
|
+
|| !/^[a-z][a-z0-9-]{0,62}$/u.test(input.networkAlias) || (input.platform.architecture !== "amd64" && input.platform.architecture !== "arm64") || input.platform.os !== "linux")
|
|
31
|
+
return fail();
|
|
32
|
+
parseOpaqueTargetHandle(input.operationHandle);
|
|
33
|
+
parseOpaqueTargetHandle(input.selectedTargetHandle);
|
|
34
|
+
const authority = [input.operationHandle, input.requestDigest, input.archiveDigest, input.artifactManifestDigest, input.baseImageConfigDigest, input.bundleDigest, input.buildPolicyDigest, input.configId, input.daemonEpoch, input.entrypoint, input.launcherDigest, input.networkAlias, input.platform.os, input.platform.architecture, input.platformDigest].join("\0");
|
|
35
|
+
return Object.freeze({ configId: input.configId, imageDigest: input.configId, imageReference: input.configId,
|
|
36
|
+
labels: Object.freeze({ spawnfile_artifact_v1_config: label("c", input.configId), spawnfile_artifact_v1_kind: "world_artifact",
|
|
37
|
+
spawnfile_artifact_v1_manifest: label("m", input.artifactManifestDigest), spawnfile_artifact_v1_operation: label("o", `${input.operationHandle}\0${input.requestDigest}`),
|
|
38
|
+
spawnfile_artifact_v1_target: label("t", input.selectedTargetHandle), spawnfile_artifact_v1_version: "v1" }),
|
|
39
|
+
resultHandle: parseOpaqueTargetHandle(`opaque_${digest("config-result", authority)}`) });
|
|
40
|
+
};
|
|
41
|
+
const bounded = (value) => typeof value === "string" && Buffer.byteLength(value, "utf8") <= 32_768 && Buffer.from(value, "utf8").toString("utf8") === value;
|
|
42
|
+
export const executeDockerArtifact = async (input) => {
|
|
43
|
+
try {
|
|
44
|
+
const result = await input.executor("docker", input.args, { signal: input.signal, timeout: input.timeoutMs });
|
|
45
|
+
if (!result || !bounded(result.stdout) || !bounded(result.stderr))
|
|
46
|
+
return fail();
|
|
47
|
+
return result;
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
return fail();
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
const skip = (source, index) => { while (/[\t\n\r ]/u.test(source[index] ?? ""))
|
|
54
|
+
index += 1; return index; };
|
|
55
|
+
const stringEnd = (source, index) => { for (let cursor = index + 1; cursor < source.length; cursor += 1) {
|
|
56
|
+
if (source[cursor] === "\\") {
|
|
57
|
+
cursor += 1;
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
if (source[cursor] === "\"")
|
|
61
|
+
return cursor + 1;
|
|
62
|
+
} return fail(); };
|
|
63
|
+
const uniqueJson = (source, start) => {
|
|
64
|
+
let index = skip(source, start);
|
|
65
|
+
const token = source[index];
|
|
66
|
+
if (token === "\"")
|
|
67
|
+
return stringEnd(source, index);
|
|
68
|
+
if (token === "{") {
|
|
69
|
+
index = skip(source, index + 1);
|
|
70
|
+
const keys = new Set();
|
|
71
|
+
if (source[index] === "}")
|
|
72
|
+
return index + 1;
|
|
73
|
+
while (true) {
|
|
74
|
+
if (source[index] !== "\"")
|
|
75
|
+
return fail();
|
|
76
|
+
const end = stringEnd(source, index);
|
|
77
|
+
const key = JSON.parse(source.slice(index, end));
|
|
78
|
+
if (keys.has(key))
|
|
79
|
+
return fail();
|
|
80
|
+
keys.add(key);
|
|
81
|
+
index = skip(source, end);
|
|
82
|
+
if (source[index] !== ":")
|
|
83
|
+
return fail();
|
|
84
|
+
index = skip(source, uniqueJson(source, index + 1));
|
|
85
|
+
if (source[index] === "}")
|
|
86
|
+
return index + 1;
|
|
87
|
+
if (source[index] !== ",")
|
|
88
|
+
return fail();
|
|
89
|
+
index = skip(source, index + 1);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
if (token === "[") {
|
|
93
|
+
index = skip(source, index + 1);
|
|
94
|
+
if (source[index] === "]")
|
|
95
|
+
return index + 1;
|
|
96
|
+
while (true) {
|
|
97
|
+
index = skip(source, uniqueJson(source, index));
|
|
98
|
+
if (source[index] === "]")
|
|
99
|
+
return index + 1;
|
|
100
|
+
if (source[index] !== ",")
|
|
101
|
+
return fail();
|
|
102
|
+
index = skip(source, index + 1);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
const end = source.slice(index).search(/[\t\n\r ,}\]]/u);
|
|
106
|
+
if (end === 0)
|
|
107
|
+
return fail();
|
|
108
|
+
return end < 0 ? source.length : index + end;
|
|
109
|
+
};
|
|
110
|
+
const parse = (stdout) => { if (!bounded(stdout) || skip(stdout, uniqueJson(stdout, 0)) !== stdout.length)
|
|
111
|
+
return fail(); const value = JSON.parse(stdout); assertOrdinaryJsonGraph(value); return value; };
|
|
112
|
+
export const isExpectedDockerArtifact = (stdout, spec) => {
|
|
113
|
+
try {
|
|
114
|
+
const value = parse(stdout);
|
|
115
|
+
if (!Array.isArray(value) || value.length !== 1 || !value[0] || typeof value[0] !== "object" || Array.isArray(value[0]))
|
|
116
|
+
return false;
|
|
117
|
+
const item = value[0];
|
|
118
|
+
const repo = item.RepoDigests;
|
|
119
|
+
return Object.keys(item).length === 1 && Array.isArray(repo) && repo.length > 0 && repo.length <= 32 && repo.every(reference)
|
|
120
|
+
&& new Set(repo).size === repo.length && repo.includes(spec.imageReference);
|
|
121
|
+
}
|
|
122
|
+
catch {
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type TargetResourceReceipt } from "./contracts.js";
|
|
2
|
+
import { type DockerArtifactExecutor, type DockerArtifactIdentityStore } from "./dockerArtifactsProvider.js";
|
|
3
|
+
import { type TargetJournalStore } from "./journal.js";
|
|
4
|
+
type ArtifactResult = {
|
|
5
|
+
readonly receipt: TargetResourceReceipt;
|
|
6
|
+
readonly receiptBytes: string;
|
|
7
|
+
};
|
|
8
|
+
export interface DockerArtifactOperationsOptions {
|
|
9
|
+
readonly context: unknown;
|
|
10
|
+
readonly executor: DockerArtifactExecutor;
|
|
11
|
+
readonly identityStore: DockerArtifactIdentityStore;
|
|
12
|
+
readonly journal: TargetJournalStore;
|
|
13
|
+
readonly mappings: unknown;
|
|
14
|
+
readonly signal?: AbortSignal;
|
|
15
|
+
readonly timeoutMs?: unknown;
|
|
16
|
+
}
|
|
17
|
+
export interface DockerArtifactOperations {
|
|
18
|
+
execute(raw: unknown): Promise<ArtifactResult>;
|
|
19
|
+
}
|
|
20
|
+
export declare const createDockerArtifactOperations: (options: DockerArtifactOperationsOptions) => DockerArtifactOperations;
|
|
21
|
+
export {};
|