spawnfile 0.1.14 → 0.1.18
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 +60 -159
- package/dist/audit/checksShared.d.ts +1 -1
- package/dist/auth/importers.d.ts +10 -0
- package/dist/auth/importers.js +46 -5
- package/dist/auth/index.d.ts +3 -0
- package/dist/auth/index.js +2 -0
- package/dist/auth/paths.d.ts +1 -1
- package/dist/auth/profileStore.js +13 -10
- package/dist/auth/targetSecretSourceFsIdentity.d.ts +40 -0
- package/dist/auth/targetSecretSourceFsIdentity.js +42 -0
- package/dist/auth/targetSecretSourceFsPublish.d.ts +2 -0
- package/dist/auth/targetSecretSourceFsPublish.js +3 -1
- package/dist/auth/targetSecretSourceFsPublishImmutable.d.ts +2 -1
- package/dist/auth/targetSecretSourceFsPublishImmutable.js +104 -71
- package/dist/auth/targetSecretSourceFsRead.js +5 -14
- package/dist/auth/trainingAuth.d.ts +21 -0
- package/dist/auth/trainingAuth.js +86 -0
- package/dist/auth/trainingGrokWriteback.d.ts +4 -0
- package/dist/auth/trainingGrokWriteback.js +119 -0
- package/dist/auth/trainingGrokWritebackLock.d.ts +5 -0
- package/dist/auth/trainingGrokWritebackLock.js +56 -0
- package/dist/auth/types.d.ts +1 -1
- package/dist/cli/authCommands.d.ts +1 -1
- package/dist/cli/authCommands.js +18 -5
- 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.js +17 -0
- package/dist/cli/composedLifecycleContractSet.d.ts +21 -0
- package/dist/cli/composedLifecycleContractSet.js +204 -0
- package/dist/cli/devCommands.js +6 -2
- package/dist/cli/downCommand.d.ts +2 -0
- package/dist/cli/downCommand.js +22 -8
- package/dist/cli/envFileOption.d.ts +18 -0
- package/dist/cli/envFileOption.js +20 -0
- package/dist/cli/evidenceExportHelperCommand.d.ts +13 -0
- package/dist/cli/evidenceExportHelperCommand.js +51 -0
- package/dist/cli/index.js +12 -3
- package/dist/cli/lifecycleCommands.d.ts +1 -1
- package/dist/cli/lifecycleCommands.js +3 -1
- package/dist/cli/lifecycleMachine.d.ts +7 -1
- package/dist/cli/lifecycleMachine.js +2 -2
- package/dist/cli/lifecyclePlan.d.ts +1 -0
- package/dist/cli/lifecyclePlan.js +2 -0
- package/dist/cli/paideiaDelegation.d.ts +18 -0
- package/dist/cli/paideiaDelegation.js +211 -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/recordCommands.d.ts +17 -0
- package/dist/cli/recordCommands.js +43 -0
- package/dist/cli/releaseCommand.d.ts +6 -0
- package/dist/cli/releaseCommand.js +91 -0
- package/dist/cli/runCli.d.ts +19 -3
- package/dist/cli/runCli.js +43 -10
- package/dist/cli/runPublishCommands.js +5 -3
- package/dist/cli/targetCommands.d.ts +4 -7
- package/dist/cli/targetCommands.js +16 -46
- 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/targetDefaultAuthorities.d.ts +2 -0
- package/dist/cli/targetDefaultAuthorities.js +3 -0
- package/dist/cli/targetDefaultConfig.d.ts +7 -0
- package/dist/cli/targetDefaultConfig.js +22 -5
- package/dist/cli/targetDefaultConfigStdin.js +7 -1
- package/dist/cli/targetDefaultHandlerFactory.js +23 -2
- package/dist/cli/targetDefaultHandlers.d.ts +2 -2
- package/dist/cli/targetProductionCommands.d.ts +5 -0
- package/dist/cli/targetProductionCommands.js +45 -0
- package/dist/cli/trainCommand.d.ts +3 -0
- package/dist/cli/trainCommand.js +114 -0
- package/dist/cli/upCommand.js +40 -7
- package/dist/cli/upLifecycleRecovery.d.ts +2 -2
- package/dist/cli/upLifecycleRecovery.js +188 -44
- 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/volumeCommands.d.ts +8 -0
- package/dist/cli/volumeCommands.js +53 -0
- package/dist/cli/workspaceResourceMigrationCommand.d.ts +8 -0
- package/dist/cli/workspaceResourceMigrationCommand.js +36 -0
- package/dist/compiler/agentNodeMerge.js +3 -2
- package/dist/compiler/buildCompilePlan.js +4 -0
- package/dist/compiler/buildCompilePlanAgent.js +3 -1
- package/dist/compiler/buildCompilePlanTeams.d.ts +1 -1
- package/dist/compiler/buildCompilePlanTeams.js +6 -1
- package/dist/compiler/buildCompilePlanTraversal.js +2 -0
- package/dist/compiler/buildCompilePlanTraversalHelpers.d.ts +2 -2
- package/dist/compiler/buildCompilePlanTraversalHelpers.js +4 -3
- package/dist/compiler/buildProject.d.ts +10 -0
- package/dist/compiler/buildProject.js +14 -2
- package/dist/compiler/cleanCompileOutput.d.ts +2 -0
- package/dist/compiler/cleanCompileOutput.js +14 -0
- package/dist/compiler/compilePlanHelpers.js +5 -0
- package/dist/compiler/compileProject.d.ts +12 -0
- package/dist/compiler/compileProject.js +33 -3
- package/dist/compiler/compileProjectSupport.js +9 -0
- package/dist/compiler/containerArtifactSummaries.js +1 -0
- package/dist/compiler/containerArtifacts.d.ts +7 -5
- package/dist/compiler/containerArtifacts.js +77 -41
- package/dist/compiler/containerArtifactsPlans.d.ts +1 -1
- package/dist/compiler/containerArtifactsPlans.js +31 -7
- package/dist/compiler/containerArtifactsRender.d.ts +2 -1
- package/dist/compiler/containerArtifactsRender.js +91 -58
- package/dist/compiler/containerArtifactsTypes.d.ts +15 -0
- package/dist/compiler/containerBackedMountRender.d.ts +56 -0
- package/dist/compiler/containerBackedMountRender.js +101 -0
- package/dist/compiler/containerDaimonBrokerRender.d.ts +114 -0
- package/dist/compiler/containerDaimonBrokerRender.js +194 -0
- package/dist/compiler/containerDaimonGrokTaskClock.d.ts +5 -0
- package/dist/compiler/containerDaimonGrokTaskClock.js +29 -0
- package/dist/compiler/containerDaimonGrokWorkerProvisioning.d.ts +38 -0
- package/dist/compiler/containerDaimonGrokWorkerProvisioning.js +130 -0
- package/dist/compiler/containerDaimonGrokWorkerRender.d.ts +197 -0
- package/dist/compiler/containerDaimonGrokWorkerRender.js +281 -0
- package/dist/compiler/containerDaimonOwnershipGuardRender.d.ts +25 -0
- package/dist/compiler/containerDaimonOwnershipGuardRender.js +204 -0
- package/dist/compiler/containerDaimonUidEntrypointRender.d.ts +24 -0
- package/dist/compiler/containerDaimonUidEntrypointRender.js +291 -0
- package/dist/compiler/containerEntrypointRender.d.ts +7 -0
- package/dist/compiler/containerEntrypointRender.js +28 -22
- 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/containerTargetResources.d.ts +32 -1
- package/dist/compiler/containerTargetResources.js +115 -15
- package/dist/compiler/containerVolumeBootstrap.d.ts +3 -0
- package/dist/compiler/containerVolumeBootstrap.js +3 -0
- package/dist/compiler/containerWorkspaceResourceRender.js +52 -1
- package/dist/compiler/daimonTelemetryArtifacts.d.ts +2 -2
- package/dist/compiler/daimonTelemetryArtifacts.js +5 -10
- package/dist/compiler/deploymentLineage.d.ts +40 -0
- package/dist/compiler/deploymentLineage.js +50 -0
- package/dist/compiler/index.d.ts +5 -0
- package/dist/compiler/index.js +5 -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/mcpPlaceholders.d.ts +11 -0
- package/dist/compiler/mcpPlaceholders.js +58 -0
- package/dist/compiler/mcpServerInheritance.d.ts +18 -0
- package/dist/compiler/mcpServerInheritance.js +43 -0
- package/dist/compiler/memoryArtifacts.d.ts +1 -1
- package/dist/compiler/memoryArtifacts.js +108 -32
- package/dist/compiler/modelEnv.d.ts +5 -0
- package/dist/compiler/modelEnv.js +8 -2
- package/dist/compiler/moltnetArtifactPaths.d.ts +17 -12
- package/dist/compiler/moltnetArtifactPaths.js +17 -15
- package/dist/compiler/moltnetArtifactTypes.d.ts +11 -0
- package/dist/compiler/moltnetArtifacts.d.ts +1 -1
- package/dist/compiler/moltnetArtifacts.js +53 -12
- package/dist/compiler/moltnetBinaries.d.ts +16 -4
- package/dist/compiler/moltnetBinaries.js +46 -6
- package/dist/compiler/moltnetClientConfig.js +1 -1
- package/dist/compiler/moltnetConfigLowering.d.ts +3 -1
- package/dist/compiler/moltnetConfigLowering.js +30 -6
- package/dist/compiler/moltnetNodeConfig.js +1 -1
- package/dist/compiler/moltnetReleaseAuthority.d.ts +24 -1
- package/dist/compiler/moltnetReleaseAuthority.js +33 -4
- package/dist/compiler/moltnetRepresentativeResolution.d.ts +1 -1
- package/dist/compiler/moltnetRepresentativeResolution.js +2 -2
- package/dist/compiler/moltnetResolution.js +9 -15
- package/dist/compiler/moltnetRoomMemberships.js +20 -5
- 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.js +19 -0
- package/dist/compiler/organizationExternalParticipants.d.ts +3 -0
- package/dist/compiler/organizationExternalParticipants.js +176 -0
- package/dist/compiler/organizationIdentity.d.ts +3 -9
- package/dist/compiler/organizationIdentity.js +37 -270
- package/dist/compiler/organizationIdentityGraph.d.ts +15 -0
- package/dist/compiler/organizationIdentityGraph.js +115 -0
- package/dist/compiler/organizationReadyEvidence.d.ts +8 -0
- package/dist/compiler/organizationReadyEvidence.js +23 -3
- package/dist/compiler/preflightCompilePlan.d.ts +9 -0
- package/dist/compiler/preflightCompilePlan.js +38 -0
- package/dist/compiler/recordingAgentFacts.d.ts +4 -0
- package/dist/compiler/recordingAgentFacts.js +35 -0
- package/dist/compiler/recordingCapability.d.ts +4 -0
- package/dist/compiler/recordingCapability.js +22 -0
- package/dist/compiler/recordingReport.d.ts +4 -0
- package/dist/compiler/recordingReport.js +18 -0
- package/dist/compiler/runProject.d.ts +6 -3
- package/dist/compiler/runProject.js +34 -6
- package/dist/compiler/runProjectAuth.d.ts +3 -1
- package/dist/compiler/runProjectAuth.js +19 -3
- package/dist/compiler/runProjectDaimonCodexDocker.d.ts +3 -0
- package/dist/compiler/runProjectDaimonCodexDocker.js +36 -0
- package/dist/compiler/runProjectDocker.d.ts +8 -4
- package/dist/compiler/runProjectDocker.js +43 -18
- 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.js +1 -1
- package/dist/compiler/surfaces.d.ts +1 -2
- package/dist/compiler/surfaces.js +0 -1
- package/dist/compiler/syncProjectAuth.js +2 -1
- package/dist/compiler/training/broker/clockProbe.d.ts +6 -0
- package/dist/compiler/training/broker/clockProbe.js +27 -0
- package/dist/compiler/training/broker/declaration.d.ts +47 -0
- package/dist/compiler/training/broker/declaration.js +57 -0
- package/dist/compiler/training/broker/entrypoint.d.ts +39 -0
- package/dist/compiler/training/broker/entrypoint.js +126 -0
- package/dist/compiler/training/broker/evaluatorSecrets.d.ts +2 -0
- package/dist/compiler/training/broker/evaluatorSecrets.js +60 -0
- package/dist/compiler/training/broker/index.d.ts +11 -0
- package/dist/compiler/training/broker/index.js +11 -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 +236 -0
- package/dist/compiler/training/broker/paths.js +249 -0
- package/dist/compiler/training/broker/processes.d.ts +51 -0
- package/dist/compiler/training/broker/processes.js +102 -0
- package/dist/compiler/training/broker/projection.d.ts +52 -0
- package/dist/compiler/training/broker/projection.js +88 -0
- package/dist/compiler/training/broker/provisioning.d.ts +78 -0
- package/dist/compiler/training/broker/provisioning.js +231 -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 +43 -0
- package/dist/compiler/training/broker/registration.js +110 -0
- package/dist/compiler/training/broker/reset.d.ts +9 -0
- package/dist/compiler/training/broker/reset.js +71 -0
- package/dist/compiler/training/broker/runtime.d.ts +22 -0
- package/dist/compiler/training/broker/runtime.js +127 -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 +108 -0
- package/dist/compiler/training/broker/supervisor.js +172 -0
- package/dist/compiler/training/broker/taskClock.d.ts +5 -0
- package/dist/compiler/training/broker/taskClock.js +41 -0
- package/dist/compiler/training/compiledAgent.d.ts +21 -0
- package/dist/compiler/training/compiledAgent.js +62 -0
- package/dist/compiler/training/container/contract.d.ts +54 -0
- package/dist/compiler/training/container/contract.js +51 -0
- package/dist/compiler/training/container/evaluators.d.ts +48 -0
- package/dist/compiler/training/container/evaluators.js +50 -0
- package/dist/compiler/training/container/grokWriteback.d.ts +8 -0
- package/dist/compiler/training/container/grokWriteback.js +26 -0
- package/dist/compiler/training/container/index.d.ts +5 -0
- package/dist/compiler/training/container/index.js +3 -0
- package/dist/compiler/training/container/launch.d.ts +21 -0
- package/dist/compiler/training/container/launch.js +264 -0
- package/dist/compiler/training/container/nativeSlots.d.ts +14 -0
- package/dist/compiler/training/container/nativeSlots.js +13 -0
- package/dist/compiler/training/container/outputCopy.d.ts +2 -0
- package/dist/compiler/training/container/outputCopy.js +72 -0
- package/dist/compiler/training/container/outputVolume.d.ts +27 -0
- package/dist/compiler/training/container/outputVolume.js +161 -0
- package/dist/compiler/training/container/prepare.d.ts +10 -0
- package/dist/compiler/training/container/prepare.js +125 -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 +38 -0
- package/dist/compiler/training/container/security.js +68 -0
- package/dist/compiler/training/container/subjectIsolation.d.ts +5 -0
- package/dist/compiler/training/container/subjectIsolation.js +15 -0
- package/dist/compiler/training/context.d.ts +15 -0
- package/dist/compiler/training/context.js +93 -0
- package/dist/compiler/training/contract.d.ts +144 -0
- package/dist/compiler/training/contract.js +36 -0
- package/dist/compiler/training/execution.d.ts +417 -0
- package/dist/compiler/training/execution.js +160 -0
- package/dist/compiler/training/index.d.ts +12 -0
- package/dist/compiler/training/index.js +10 -0
- package/dist/compiler/training/moments.d.ts +80 -0
- package/dist/compiler/training/moments.js +118 -0
- package/dist/compiler/training/output.d.ts +2 -0
- package/dist/compiler/training/output.js +20 -0
- package/dist/compiler/training/plan/contract.d.ts +287 -0
- package/dist/compiler/training/plan/contract.js +49 -0
- package/dist/compiler/training/plan/index.d.ts +5 -0
- package/dist/compiler/training/plan/index.js +4 -0
- package/dist/compiler/training/plan/load.d.ts +9 -0
- package/dist/compiler/training/plan/load.js +153 -0
- package/dist/compiler/training/plan/references.d.ts +19 -0
- package/dist/compiler/training/plan/references.js +57 -0
- package/dist/compiler/training/plan/resolve.d.ts +4 -0
- package/dist/compiler/training/plan/resolve.js +73 -0
- package/dist/compiler/training/plan/targets.d.ts +11 -0
- package/dist/compiler/training/plan/targets.js +71 -0
- package/dist/compiler/training/plan/types.d.ts +36 -0
- package/dist/compiler/training/plan/types.js +1 -0
- package/dist/compiler/training/preparation/assets/Dockerfile +109 -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 +45 -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 +207 -0
- package/dist/compiler/training/preparation/contract.js +113 -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 +29 -0
- package/dist/compiler/training/preparation/files.js +146 -0
- package/dist/compiler/training/preparation/image.d.ts +28 -0
- package/dist/compiler/training/preparation/image.js +107 -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 +24 -0
- package/dist/compiler/training/preparation/inputs.js +101 -0
- package/dist/compiler/training/preparation/prepare.d.ts +38 -0
- package/dist/compiler/training/preparation/prepare.js +223 -0
- package/dist/compiler/training/preparation/scratch.d.ts +8 -0
- package/dist/compiler/training/preparation/scratch.js +114 -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 +840 -0
- package/dist/compiler/training/repair/contract.js +33 -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 +382 -0
- package/dist/compiler/training/repair/prepare.js +78 -0
- package/dist/compiler/training/repair/witness.d.ts +352 -0
- package/dist/compiler/training/repair/witness.js +48 -0
- package/dist/compiler/training/resolution.d.ts +25 -0
- package/dist/compiler/training/resolution.js +69 -0
- package/dist/compiler/training/rewind/contract.d.ts +321 -0
- package/dist/compiler/training/rewind/contract.js +39 -0
- package/dist/compiler/training/rewind/deployedResource.d.ts +22 -0
- package/dist/compiler/training/rewind/deployedResource.js +19 -0
- package/dist/compiler/training/rewind/feed.d.ts +12 -0
- package/dist/compiler/training/rewind/feed.js +182 -0
- package/dist/compiler/training/rewind/feedContent.d.ts +6 -0
- package/dist/compiler/training/rewind/feedContent.js +38 -0
- package/dist/compiler/training/rewind/git.d.ts +8 -0
- package/dist/compiler/training/rewind/git.js +159 -0
- package/dist/compiler/training/rewind/gitArchive.d.ts +2 -0
- package/dist/compiler/training/rewind/gitArchive.js +7 -0
- package/dist/compiler/training/rewind/gitHistory.d.ts +3 -0
- package/dist/compiler/training/rewind/gitHistory.js +55 -0
- package/dist/compiler/training/rewind/gitProcess.d.ts +19 -0
- package/dist/compiler/training/rewind/gitProcess.js +81 -0
- package/dist/compiler/training/rewind/gitTree.d.ts +14 -0
- package/dist/compiler/training/rewind/gitTree.js +90 -0
- package/dist/compiler/training/rewind/history.d.ts +28 -0
- package/dist/compiler/training/rewind/history.js +239 -0
- package/dist/compiler/training/rewind/index.d.ts +18 -0
- package/dist/compiler/training/rewind/index.js +15 -0
- package/dist/compiler/training/rewind/inputs.d.ts +9 -0
- package/dist/compiler/training/rewind/inputs.js +67 -0
- package/dist/compiler/training/rewind/instant.d.ts +4 -0
- package/dist/compiler/training/rewind/instant.js +24 -0
- package/dist/compiler/training/rewind/leakCheck.d.ts +10 -0
- package/dist/compiler/training/rewind/leakCheck.js +56 -0
- package/dist/compiler/training/rewind/leakFeed.d.ts +5 -0
- package/dist/compiler/training/rewind/leakFeed.js +25 -0
- package/dist/compiler/training/rewind/leakFiles.d.ts +10 -0
- package/dist/compiler/training/rewind/leakFiles.js +106 -0
- package/dist/compiler/training/rewind/leakGit.d.ts +3 -0
- package/dist/compiler/training/rewind/leakGit.js +78 -0
- package/dist/compiler/training/rewind/leakGitPayload.d.ts +4 -0
- package/dist/compiler/training/rewind/leakGitPayload.js +57 -0
- package/dist/compiler/training/rewind/leakInputs.d.ts +7 -0
- package/dist/compiler/training/rewind/leakInputs.js +135 -0
- package/dist/compiler/training/rewind/leakLayout.d.ts +2 -0
- package/dist/compiler/training/rewind/leakLayout.js +17 -0
- package/dist/compiler/training/rewind/leakProvenance.d.ts +3 -0
- package/dist/compiler/training/rewind/leakProvenance.js +88 -0
- package/dist/compiler/training/rewind/materialize.d.ts +136 -0
- package/dist/compiler/training/rewind/materialize.js +212 -0
- package/dist/compiler/training/rewind/memory.d.ts +10 -0
- package/dist/compiler/training/rewind/memory.js +84 -0
- package/dist/compiler/training/rewind/memorySchemas.d.ts +87 -0
- package/dist/compiler/training/rewind/memorySchemas.js +50 -0
- package/dist/compiler/training/rewind/moltnet.d.ts +2 -0
- package/dist/compiler/training/rewind/moltnet.js +54 -0
- package/dist/compiler/training/rewind/moltnetJson.d.ts +13 -0
- package/dist/compiler/training/rewind/moltnetJson.js +180 -0
- package/dist/compiler/training/rewind/moltnetSchemas.d.ts +1226 -0
- package/dist/compiler/training/rewind/moltnetSchemas.js +75 -0
- package/dist/compiler/training/rewind/moltnetSqlite.d.ts +31 -0
- package/dist/compiler/training/rewind/moltnetSqlite.js +192 -0
- package/dist/compiler/training/rewind/moltnetSqliteData.d.ts +10 -0
- package/dist/compiler/training/rewind/moltnetSqliteData.js +113 -0
- package/dist/compiler/training/rewind/recordInput.d.ts +40 -0
- package/dist/compiler/training/rewind/recordInput.js +49 -0
- package/dist/compiler/training/rewind/recordedBundle.d.ts +4 -0
- package/dist/compiler/training/rewind/recordedBundle.js +58 -0
- package/dist/compiler/training/rewind/recordedCommit.d.ts +2 -0
- package/dist/compiler/training/rewind/recordedCommit.js +10 -0
- package/dist/compiler/training/rewind/select.d.ts +18 -0
- package/dist/compiler/training/rewind/select.js +64 -0
- package/dist/compiler/training/rewind/snapshotManifest.d.ts +42 -0
- package/dist/compiler/training/rewind/snapshotManifest.js +134 -0
- package/dist/compiler/training/rewind/taskClock.d.ts +12 -0
- package/dist/compiler/training/rewind/taskClock.js +40 -0
- package/dist/compiler/training/rewind/timestamps.d.ts +4 -0
- package/dist/compiler/training/rewind/timestamps.js +26 -0
- package/dist/compiler/training/rewind/types.d.ts +43 -0
- package/dist/compiler/training/rewind/types.js +1 -0
- package/dist/compiler/training/rewind/volumes.d.ts +12 -0
- package/dist/compiler/training/rewind/volumes.js +58 -0
- package/dist/compiler/training/selection.d.ts +7 -0
- package/dist/compiler/training/selection.js +15 -0
- package/dist/compiler/types.d.ts +7 -2
- package/dist/compiler/upProject.d.ts +27 -1
- package/dist/compiler/upProject.js +135 -180
- package/dist/compiler/upProjectHandoff.d.ts +62 -0
- package/dist/compiler/upProjectHandoff.js +204 -0
- package/dist/compiler/upReceipt.js +49 -4
- package/dist/compiler/updateProjectModels.js +1 -0
- package/dist/compiler/view/types.d.ts +1 -1
- package/dist/compiler/workspaceBundleArtifacts.d.ts +18 -0
- package/dist/compiler/workspaceBundleArtifacts.js +155 -0
- package/dist/compiler/workspaceBundleCache.d.ts +23 -0
- package/dist/compiler/workspaceBundleCache.js +79 -0
- package/dist/compiler/workspaceBundleDependencies.d.ts +21 -0
- package/dist/compiler/workspaceBundleDependencies.js +122 -0
- package/dist/compiler/workspaceBundleFiles.d.ts +51 -0
- package/dist/compiler/workspaceBundleFiles.js +251 -0
- package/dist/compiler/workspaceBundleGenerated.d.ts +25 -0
- package/dist/compiler/workspaceBundleGenerated.js +103 -0
- package/dist/compiler/workspaceBundleGit.d.ts +64 -0
- package/dist/compiler/workspaceBundleGit.js +154 -0
- package/dist/compiler/workspaceBundleKey.d.ts +34 -0
- package/dist/compiler/workspaceBundleKey.js +17 -0
- package/dist/compiler/workspaceBundleResolve.d.ts +56 -0
- package/dist/compiler/workspaceBundleResolve.js +144 -0
- package/dist/compiler/workspaceBundleRun.d.ts +41 -0
- package/dist/compiler/workspaceBundleRun.js +79 -0
- package/dist/compiler/workspaceBundleTar.d.ts +47 -0
- package/dist/compiler/workspaceBundleTar.js +140 -0
- package/dist/compiler/workspaceBundleTree.d.ts +15 -0
- package/dist/compiler/workspaceBundleTree.js +58 -0
- package/dist/compiler/workspaceGitFetch.d.ts +41 -0
- package/dist/compiler/workspaceGitFetch.js +155 -0
- package/dist/compiler/workspaceGitPins.d.ts +33 -0
- package/dist/compiler/workspaceGitPins.js +127 -0
- package/dist/compiler/workspaceResources.d.ts +9 -2
- package/dist/compiler/workspaceResources.js +39 -7
- package/dist/deployment/activation.d.ts +3 -0
- package/dist/deployment/activation.js +12 -0
- package/dist/deployment/artifactsExportPlan.js +51 -1
- 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/candidateRecording.d.ts +8 -0
- package/dist/deployment/candidateRecording.js +22 -0
- package/dist/deployment/dockerLogs.js +4 -1
- package/dist/deployment/dockerManager.d.ts +5 -3
- package/dist/deployment/dockerManager.js +21 -5
- package/dist/deployment/dockerProbeGateway.d.ts +17 -0
- package/dist/deployment/dockerProbeGateway.js +17 -2
- package/dist/deployment/downDeployment.d.ts +7 -0
- package/dist/deployment/downDeployment.js +114 -9
- package/dist/deployment/downReceiptTypes.d.ts +17 -2
- package/dist/deployment/downReceiptTypes.js +17 -2
- package/dist/deployment/homeStore.d.ts +9 -1
- package/dist/deployment/homeStore.js +16 -53
- package/dist/deployment/index.d.ts +10 -0
- package/dist/deployment/index.js +10 -0
- package/dist/deployment/lifecycleCompletionContracts.d.ts +66 -0
- package/dist/deployment/lifecycleCompletionContracts.js +34 -0
- package/dist/deployment/lifecycleCompletionPaths.d.ts +4 -1
- package/dist/deployment/lifecycleCompletionPaths.js +3 -0
- package/dist/deployment/lifecycleCompletionPublication.d.ts +2 -0
- package/dist/deployment/lifecycleCompletionPublication.js +18 -4
- package/dist/deployment/lifecycleCompletionStore.d.ts +1 -1
- package/dist/deployment/lifecycleCompletionStore.js +7 -7
- 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.js +82 -27
- package/dist/deployment/organizationHandoffAuthorityFsElection.d.ts +21 -0
- package/dist/deployment/organizationHandoffAuthorityFsElection.js +57 -0
- package/dist/deployment/organizationHandoffAuthorityFsWorker.js +254 -108
- package/dist/deployment/organizationHandoffAuthorityFsWorkerStall.fixture.d.ts +1 -0
- package/dist/deployment/organizationHandoffAuthorityFsWorkerStall.fixture.js +16 -0
- package/dist/deployment/organizationHandoffAuthorityStore.js +14 -7
- package/dist/deployment/organizationHandoffAuthorityTypes.d.ts +2 -2
- package/dist/deployment/organizationHandoffAuthorityTypes.js +2 -1
- package/dist/deployment/organizationReady.d.ts +2 -0
- package/dist/deployment/organizationReady.js +36 -4
- package/dist/deployment/pidLock.d.ts +25 -0
- package/dist/deployment/pidLock.js +81 -0
- package/dist/deployment/productStateClone.d.ts +43 -0
- package/dist/deployment/productStateClone.js +319 -0
- package/dist/deployment/record.d.ts +85 -1
- package/dist/deployment/record.js +11 -5
- package/dist/deployment/recordPublication.d.ts +15 -0
- package/dist/deployment/recordPublication.js +76 -0
- package/dist/deployment/recordedMemoryRetention.d.ts +18 -0
- package/dist/deployment/recordedMemoryRetention.js +27 -0
- package/dist/deployment/resourceLog.d.ts +140 -0
- package/dist/deployment/resourceLog.js +78 -0
- package/dist/deployment/upLifecycleRecoveryState.d.ts +23 -0
- package/dist/deployment/upLifecycleRecoveryState.js +12 -0
- package/dist/deployment/upReceiptTypes.d.ts +32 -6
- package/dist/deployment/upReceiptTypes.js +29 -2
- 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 +9 -0
- package/dist/distribution/buildDistributionReport.d.ts +3 -0
- package/dist/distribution/buildDistributionReport.js +5 -0
- package/dist/distribution/consumeImage.d.ts +5 -0
- package/dist/distribution/consumeImage.js +115 -98
- package/dist/distribution/consumeImageDaimonDocker.d.ts +3 -0
- package/dist/distribution/consumeImageDaimonDocker.js +45 -0
- package/dist/distribution/consumeImageLifecycle.d.ts +20 -0
- package/dist/distribution/consumeImageLifecycle.js +242 -0
- package/dist/distribution/consumeImageSupport.d.ts +19 -0
- package/dist/distribution/consumeImageSupport.js +40 -0
- package/dist/distribution/distributionReportSchema.d.ts +58 -1
- package/dist/distribution/distributionReportSchema.js +35 -2
- 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 +1 -1
- package/dist/distribution/index.js +1 -1
- package/dist/distribution/preflight.js +5 -1
- package/dist/distribution/renderImageInterface.js +1 -1
- package/dist/distribution/types.d.ts +29 -1
- package/dist/distribution/types.js +3 -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/durableWrite.d.ts +10 -0
- package/dist/filesystem/durableWrite.js +87 -0
- package/dist/filesystem/index.d.ts +2 -0
- package/dist/filesystem/index.js +2 -0
- package/dist/filesystem/io.d.ts +2 -0
- package/dist/filesystem/io.js +16 -1
- package/dist/filesystem/retainedJsonl.d.ts +23 -0
- package/dist/filesystem/retainedJsonl.js +123 -0
- package/dist/manifest/commandSchemas.d.ts +5 -0
- package/dist/manifest/commandSchemas.js +5 -0
- package/dist/manifest/executionSchemas.d.ts +47 -0
- package/dist/manifest/executionSchemas.js +31 -2
- package/dist/manifest/index.d.ts +2 -0
- package/dist/manifest/index.js +2 -0
- package/dist/manifest/loadManifest.js +3 -26
- package/dist/manifest/mcpSchemas.d.ts +62 -0
- package/dist/manifest/mcpSchemas.js +57 -8
- package/dist/manifest/memorySchemas.d.ts +1 -1
- package/dist/manifest/memorySchemas.js +1 -1
- package/dist/manifest/parseManifest.d.ts +7 -0
- package/dist/manifest/parseManifest.js +65 -0
- package/dist/manifest/renderSpawnfile.js +4 -1
- package/dist/manifest/renderSpawnfileNetworks.js +11 -0
- package/dist/manifest/renderSpawnfileWorkspace.js +10 -1
- package/dist/manifest/scheduleSchemas.d.ts +3 -1
- package/dist/manifest/scheduleSchemas.js +91 -5
- package/dist/manifest/schemas.d.ts +1419 -120
- package/dist/manifest/schemas.js +19 -6
- package/dist/manifest/teamNetworkAccessSchemas.d.ts +5 -1
- package/dist/manifest/teamNetworkAccessSchemas.js +11 -0
- package/dist/manifest/teamNetworkAuthSchemas.d.ts +1 -1
- package/dist/manifest/teamNetworkSchemas.d.ts +18 -4
- package/dist/manifest/teamNetworkSchemas.js +19 -1
- package/dist/manifest/teamNetworkServerSchemas.d.ts +8 -3
- package/dist/manifest/teamNetworkServerSchemas.js +18 -2
- package/dist/manifest/trainingDataSchemas.d.ts +357 -0
- package/dist/manifest/trainingDataSchemas.js +31 -0
- package/dist/manifest/trainingSchemas.d.ts +49 -0
- package/dist/manifest/trainingSchemas.js +44 -0
- package/dist/manifest/volumeFeedSchemas.d.ts +52 -0
- package/dist/manifest/volumeFeedSchemas.js +104 -0
- package/dist/manifest/workspaceSchemas.d.ts +194 -1
- package/dist/manifest/workspaceSchemas.js +117 -2
- package/dist/recording/compose.d.ts +3 -0
- package/dist/recording/compose.js +93 -0
- package/dist/recording/deployment.d.ts +15 -0
- package/dist/recording/deployment.js +38 -0
- package/dist/recording/history.d.ts +16 -0
- package/dist/recording/history.js +47 -0
- package/dist/recording/index.d.ts +9 -0
- package/dist/recording/index.js +9 -0
- package/dist/recording/moment.d.ts +61 -0
- package/dist/recording/moment.js +36 -0
- package/dist/recording/parse.d.ts +15 -0
- package/dist/recording/parse.js +74 -0
- package/dist/recording/read.d.ts +8 -0
- package/dist/recording/read.js +61 -0
- package/dist/recording/store.d.ts +10 -0
- package/dist/recording/store.js +94 -0
- package/dist/recording/sync.d.ts +24 -0
- package/dist/recording/sync.js +126 -0
- package/dist/recording/types.d.ts +45 -0
- package/dist/recording/types.js +2 -0
- package/dist/release/drainControl.d.ts +54 -0
- package/dist/release/drainControl.js +137 -0
- package/dist/release/drainPhase.d.ts +37 -0
- package/dist/release/drainPhase.js +161 -0
- package/dist/release/index.d.ts +11 -0
- package/dist/release/index.js +11 -0
- package/dist/release/ledger.d.ts +75 -0
- package/dist/release/ledger.js +111 -0
- package/dist/release/notify.d.ts +58 -0
- package/dist/release/notify.js +126 -0
- package/dist/release/pending.d.ts +35 -0
- package/dist/release/pending.js +60 -0
- package/dist/release/postDeploy.d.ts +32 -0
- package/dist/release/postDeploy.js +62 -0
- package/dist/release/releaseDefaults.d.ts +9 -0
- package/dist/release/releaseDefaults.js +115 -0
- package/dist/release/releaseDocker.d.ts +38 -0
- package/dist/release/releaseDocker.js +94 -0
- package/dist/release/releaseTypes.d.ts +94 -0
- package/dist/release/releaseTypes.js +1 -0
- package/dist/release/runRelease.d.ts +9 -0
- package/dist/release/runRelease.js +218 -0
- package/dist/release/swap.d.ts +23 -0
- package/dist/release/swap.js +55 -0
- package/dist/release/types.d.ts +50 -0
- package/dist/release/types.js +29 -0
- package/dist/report/index.d.ts +1 -0
- package/dist/report/index.js +1 -0
- package/dist/report/recording.d.ts +57 -0
- package/dist/report/recording.js +26 -0
- package/dist/report/types.d.ts +92 -4
- package/dist/runtime/common.d.ts +28 -1
- package/dist/runtime/common.js +33 -3
- package/dist/runtime/container.js +46 -35
- package/dist/runtime/daimon/adapter.d.ts +14 -0
- package/dist/runtime/daimon/adapter.js +254 -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 +29 -0
- package/dist/runtime/daimon/config.js +321 -0
- package/dist/runtime/daimon/contract-manifest.json +1 -0
- package/dist/runtime/daimon/contract-manifest.sha256 +1 -0
- package/dist/runtime/daimon/contractManifest.d.ts +346 -0
- package/dist/runtime/daimon/contractManifest.js +335 -0
- package/dist/runtime/daimon/grokModel.d.ts +19 -0
- package/dist/runtime/daimon/grokModel.js +33 -0
- package/dist/runtime/daimon/grokTurnLimits.d.ts +25 -0
- package/dist/runtime/daimon/grokTurnLimits.js +51 -0
- package/dist/runtime/daimon/grokWorkerConfigBytes.d.ts +43 -0
- package/dist/runtime/daimon/grokWorkerConfigBytes.js +53 -0
- package/dist/runtime/daimon/grokWorkerContract.d.ts +27 -0
- package/dist/runtime/daimon/grokWorkerContract.js +60 -0
- package/dist/runtime/daimon/memory.d.ts +57 -0
- package/dist/runtime/daimon/memory.js +125 -0
- package/dist/runtime/daimon/recording.d.ts +19 -0
- package/dist/runtime/daimon/recording.js +50 -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 +11 -0
- package/dist/runtime/daimon/scheduleAuthority.js +31 -0
- package/dist/runtime/daimon/wakeMoments.d.ts +15 -0
- package/dist/runtime/daimon/wakeMoments.js +17 -0
- package/dist/runtime/daimonInstall.d.ts +3 -0
- package/dist/runtime/daimonInstall.js +25 -0
- package/dist/runtime/index.d.ts +5 -0
- package/dist/runtime/index.js +5 -0
- package/dist/runtime/install.d.ts +5 -0
- package/dist/runtime/install.js +4 -0
- package/dist/runtime/localDaimonAuthority.d.ts +11 -0
- package/dist/runtime/localDaimonAuthority.js +77 -0
- package/dist/runtime/mnemeMcp.d.ts +13 -0
- package/dist/runtime/mnemeMcp.js +26 -0
- package/dist/runtime/openclaw/adapter.js +5 -2
- package/dist/runtime/pi/adapter.d.ts +0 -1
- package/dist/runtime/pi/adapter.js +5 -6
- package/dist/runtime/pi/appCliSource.js +1 -1
- package/dist/runtime/pi/appScheduleSource.js +6 -2
- package/dist/runtime/pi/appTemplateTypes.d.ts +1 -1
- package/dist/runtime/pi/containerTargets.js +6 -0
- package/dist/runtime/picoclaw/adapter.js +5 -2
- package/dist/runtime/registry.d.ts +6 -0
- package/dist/runtime/registry.js +32 -3
- package/dist/runtime/scheduleUtils.d.ts +1 -0
- package/dist/runtime/scheduleUtils.js +5 -1
- package/dist/runtime/types.d.ts +40 -0
- package/dist/runtime/usageLedger.d.ts +158 -0
- package/dist/runtime/usageLedger.js +269 -0
- package/dist/runtime/usageLedgerRead.d.ts +54 -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/index.d.ts +3 -0
- package/dist/shared/index.js +3 -0
- package/dist/shared/recording.d.ts +8 -0
- package/dist/shared/recording.js +25 -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/target/dockerArtifactsProvider.js +34 -7
- package/dist/target/dockerBaseImage.d.ts +2 -0
- package/dist/target/dockerBaseImage.js +11 -0
- package/dist/target/dockerCommandExecutor.d.ts +11 -0
- package/dist/target/dockerCommandExecutor.js +53 -2
- package/dist/target/dockerCommandExecutorCore.d.ts +2 -1
- package/dist/target/dockerCommandExecutorCore.js +5 -3
- package/dist/target/dockerPublicArtifactSnapshot.d.ts +3 -3
- package/dist/target/dockerPublicArtifactSnapshot.js +17 -33
- package/dist/target/dockerTarget.d.ts +1 -0
- package/dist/target/dockerTargetBinding.d.ts +1 -2
- package/dist/target/dockerTargetBinding.js +4 -4
- package/dist/target/dockerTargetExecFile.d.ts +19 -0
- package/dist/target/dockerTargetExecFile.js +194 -0
- package/dist/target/dockerWorldServiceProvider.d.ts +4 -0
- package/dist/target/dockerWorldServiceProvider.js +13 -1
- package/dist/target/evidenceExport.d.ts +3 -1
- package/dist/target/evidenceExport.js +12 -3
- package/dist/target/evidenceExportOperationsTestKit.js +3 -3
- package/dist/target/evidenceExportProvider.d.ts +2 -0
- package/dist/target/evidenceExportProvider.js +15 -5
- package/dist/target/publicArtifactSnapshot.d.ts +31 -0
- package/dist/target/publicArtifactSnapshot.js +37 -3
- package/dist/volume/feedLand.d.ts +31 -0
- package/dist/volume/feedLand.js +174 -0
- package/dist/volume/feedLandings.d.ts +45 -0
- package/dist/volume/feedLandings.js +111 -0
- package/dist/volume/feedLayout.d.ts +61 -0
- package/dist/volume/feedLayout.js +234 -0
- package/dist/volume/feedLock.d.ts +7 -0
- package/dist/volume/feedLock.js +131 -0
- package/dist/volume/feedManifest.d.ts +27 -0
- package/dist/volume/feedManifest.js +123 -0
- package/dist/volume/feedPrepare.d.ts +16 -0
- package/dist/volume/feedPrepare.js +228 -0
- package/dist/volume/feedProject.d.ts +39 -0
- package/dist/volume/feedProject.js +92 -0
- package/dist/volume/feedRecord.d.ts +55 -0
- package/dist/volume/feedRecord.js +148 -0
- package/dist/volume/feedRef.d.ts +43 -0
- package/dist/volume/feedRef.js +117 -0
- package/dist/volume/feedRefresh.d.ts +15 -0
- package/dist/volume/feedRefresh.js +187 -0
- package/dist/volume/feedSource.d.ts +66 -0
- package/dist/volume/feedSource.js +104 -0
- package/dist/volume/feedTarget.d.ts +70 -0
- package/dist/volume/feedTarget.js +9 -0
- package/dist/volume/feedTestKit.d.ts +11 -0
- package/dist/volume/feedTestKit.js +45 -0
- package/dist/volume/feedVerify.d.ts +18 -0
- package/dist/volume/feedVerify.js +104 -0
- package/dist/volume/index.d.ts +13 -0
- package/dist/volume/index.js +13 -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 +5 -4
- package/package.json +36 -9
- package/runtimes.yaml +8 -3
- package/dist/cli/targetWorldClockCrossProcess.test-helper.d.ts +0 -13
- package/dist/cli/targetWorldClockCrossProcess.test-helper.js +0 -109
- package/dist/deployment/providerRuntimeBoundaryScanner.test-helper.d.ts +0 -8
- package/dist/deployment/providerRuntimeBoundaryScanner.test-helper.js +0 -60
- package/dist/deployment/simfileFixtureBoundary.test-helper.d.ts +0 -8
- package/dist/deployment/simfileFixtureBoundary.test-helper.js +0 -103
- package/dist/ownership/simfileRunOperatorInputs.d.ts +0 -103
- package/dist/ownership/simfileRunOperatorInputs.js +0 -139
- package/dist/target/cleanupRunDocker.test-helper.d.ts +0 -67
- package/dist/target/cleanupRunDocker.test-helper.js +0 -238
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { CompileReportWorkspaceBundle } from "../report/index.js";
|
|
2
|
+
import type { BundleIdentityMode } from "./workspaceBundleFiles.js";
|
|
3
|
+
import type { BundleBuildContext, BundleBuildPlan } from "./workspaceBundleKey.js";
|
|
4
|
+
import type { MoltnetTargetArchitecture } from "./moltnetReleaseAuthority.js";
|
|
5
|
+
import type { CompilePlan } from "./types.js";
|
|
6
|
+
import { type ResolvedWorkspaceResource } from "./workspaceResources.js";
|
|
7
|
+
import type { WorkspaceBundleBuild } from "../manifest/index.js";
|
|
8
|
+
/** One build plan per declaration; `build` paths are already absolute. */
|
|
9
|
+
export declare const planBundleBuild: (build: WorkspaceBundleBuild, context: BundleBuildContext, options?: {
|
|
10
|
+
captureTools?: boolean;
|
|
11
|
+
}) => Promise<BundleBuildPlan>;
|
|
12
|
+
/** Explicit, else the same target-arch override the Moltnet binaries honour, else the host. */
|
|
13
|
+
export declare const resolveBundleArchitecture: (architecture?: MoltnetTargetArchitecture) => MoltnetTargetArchitecture;
|
|
14
|
+
export interface ResolveWorkspaceBundlesOptions {
|
|
15
|
+
/** Compile output directory; built archives are linked into its Docker context as soon as they resolve. */
|
|
16
|
+
outputDirectory: string;
|
|
17
|
+
/** Target container architecture; resolved like the Moltnet binaries when omitted. */
|
|
18
|
+
architecture?: MoltnetTargetArchitecture;
|
|
19
|
+
/** Defaults to `$SPAWNFILE_HOME/cache/workspace-bundles`. */
|
|
20
|
+
cacheDirectory?: string;
|
|
21
|
+
/** `release` requires clean inputs and takes identity from the committed tree; `dev` (default) hashes the work tree. */
|
|
22
|
+
identity?: BundleIdentityMode;
|
|
23
|
+
/** Docker CLI for dependency installs and image-run generated steps (cache misses only). */
|
|
24
|
+
dockerCommand?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface ResolvedWorkspaceBundles {
|
|
27
|
+
/** Digest → built archive already linked into the Docker context this compile. */
|
|
28
|
+
built: Map<string, string>;
|
|
29
|
+
report: CompileReportWorkspaceBundle[];
|
|
30
|
+
builtCount: number;
|
|
31
|
+
reusedCount: number;
|
|
32
|
+
}
|
|
33
|
+
type BundleResource = Extract<ResolvedWorkspaceResource, {
|
|
34
|
+
kind: "bundle";
|
|
35
|
+
}>;
|
|
36
|
+
export { computeWorkspaceBundleKey } from "./workspaceBundleKey.js";
|
|
37
|
+
/**
|
|
38
|
+
* A stable pin for a bundle without building it: the declared or computed
|
|
39
|
+
* archive digest for a prebuilt tar, else `bundle-key:<key>` — the cache key a
|
|
40
|
+
* dev compile for the target architecture would build under, which moves with
|
|
41
|
+
* every input, recipe and platform change — or, for a generated bundle,
|
|
42
|
+
* `bundle-recipe:<key>`, the same key with tools identified by argv only.
|
|
43
|
+
* Nothing is installed, generated or executed.
|
|
44
|
+
*/
|
|
45
|
+
export declare const pinWorkspaceBundle: (resource: BundleResource, options?: {
|
|
46
|
+
architecture?: MoltnetTargetArchitecture;
|
|
47
|
+
cacheDirectory?: string;
|
|
48
|
+
dockerCommand?: string;
|
|
49
|
+
}) => Promise<string>;
|
|
50
|
+
/**
|
|
51
|
+
* Gives every bundle resource in the plan a concrete digest. Declared-input
|
|
52
|
+
* bundles are built (or reused from the cache by key); prebuilt tars without a
|
|
53
|
+
* declared digest are hashed. Staging verifies every prebuilt tar again from
|
|
54
|
+
* the bytes it stages. Every bundle resource is reported with its digest.
|
|
55
|
+
*/
|
|
56
|
+
export declare const resolveWorkspaceBundles: (plan: CompilePlan, options: ResolveWorkspaceBundlesOptions) => Promise<ResolvedWorkspaceBundles>;
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { readFile, realpath, stat } from "node:fs/promises";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { SpawnfileError } from "../shared/index.js";
|
|
5
|
+
import { linkBuiltBundle, validateWorkspaceBundleTar } from "./workspaceBundleArtifacts.js";
|
|
6
|
+
import { lookupCachedBundle, pruneBundleCache, resolveWorkspaceBundleCacheDirectory, storeBuiltBundle } from "./workspaceBundleCache.js";
|
|
7
|
+
import { planDependenciesBundle } from "./workspaceBundleDependencies.js";
|
|
8
|
+
import { planFilesBundle, planGeneratedBundle } from "./workspaceBundleGenerated.js";
|
|
9
|
+
import { WORKSPACE_BUNDLE_MAX_BYTES } from "./workspaceBundleTar.js";
|
|
10
|
+
import { resolveBundleBuildPaths } from "./workspaceResources.js";
|
|
11
|
+
/** One build plan per declaration; `build` paths are already absolute. */
|
|
12
|
+
export const planBundleBuild = (build, context, options = {}) => build.files ? planFilesBundle(build.files, context)
|
|
13
|
+
: build.dependencies ? planDependenciesBundle(build.dependencies, context)
|
|
14
|
+
: planGeneratedBundle(build.generated, context, options);
|
|
15
|
+
/** Explicit, else the same target-arch override the Moltnet binaries honour, else the host. */
|
|
16
|
+
export const resolveBundleArchitecture = (architecture) => {
|
|
17
|
+
const value = architecture ?? (process.env.SPAWNFILE_MOLTNET_TARGET_ARCH?.trim() || process.arch);
|
|
18
|
+
if (value === "amd64" || value === "x64" || value === "x86_64")
|
|
19
|
+
return "amd64";
|
|
20
|
+
if (value === "arm64" || value === "aarch64")
|
|
21
|
+
return "arm64";
|
|
22
|
+
throw new SpawnfileError("compile_error", `Workspace bundles do not support target architecture ${value}`);
|
|
23
|
+
};
|
|
24
|
+
export { computeWorkspaceBundleKey } from "./workspaceBundleKey.js";
|
|
25
|
+
const declarationKey = (resource) => JSON.stringify({
|
|
26
|
+
build: resource.build ?? null, scope: path.dirname(resource.scope.key), source: resource.source ?? null
|
|
27
|
+
});
|
|
28
|
+
const hashPrebuilt = async (source) => {
|
|
29
|
+
const info = await stat(source).catch(() => undefined);
|
|
30
|
+
if (!info?.isFile() || info.size < 1 || info.size > WORKSPACE_BUNDLE_MAX_BYTES)
|
|
31
|
+
throw new SpawnfileError("validation_error", "Workspace bundle must be a bounded regular tar file");
|
|
32
|
+
const bytes = await readFile(source);
|
|
33
|
+
validateWorkspaceBundleTar(bytes);
|
|
34
|
+
return `sha256:${createHash("sha256").update(bytes).digest("hex")}`;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* A stable pin for a bundle without building it: the declared or computed
|
|
38
|
+
* archive digest for a prebuilt tar, else `bundle-key:<key>` — the cache key a
|
|
39
|
+
* dev compile for the target architecture would build under, which moves with
|
|
40
|
+
* every input, recipe and platform change — or, for a generated bundle,
|
|
41
|
+
* `bundle-recipe:<key>`, the same key with tools identified by argv only.
|
|
42
|
+
* Nothing is installed, generated or executed.
|
|
43
|
+
*/
|
|
44
|
+
export const pinWorkspaceBundle = async (resource, options = {}) => {
|
|
45
|
+
const base = path.dirname(resource.scope.key);
|
|
46
|
+
if (resource.source !== undefined)
|
|
47
|
+
return resource.sha256 ?? hashPrebuilt(path.resolve(base, resource.source));
|
|
48
|
+
const plan = await planBundleBuild(resolveBundleBuildPaths(resource.build, base), {
|
|
49
|
+
dockerCommand: options.dockerCommand ?? "docker", identity: "dev", outputReal: path.join(base, ".spawnfile-no-output"),
|
|
50
|
+
platform: `linux/${resolveBundleArchitecture(options.architecture)}`, workRoot: path.join(resolveWorkspaceBundleCacheDirectory(options.cacheDirectory), "work")
|
|
51
|
+
}, { captureTools: false });
|
|
52
|
+
// A generated bundle's build key includes captured tool output, which a pin never executes to obtain.
|
|
53
|
+
return `${plan.input === "generated" ? "bundle-recipe" : "bundle-key"}:${plan.key}`;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Gives every bundle resource in the plan a concrete digest. Declared-input
|
|
57
|
+
* bundles are built (or reused from the cache by key); prebuilt tars without a
|
|
58
|
+
* declared digest are hashed. Staging verifies every prebuilt tar again from
|
|
59
|
+
* the bytes it stages. Every bundle resource is reported with its digest.
|
|
60
|
+
*/
|
|
61
|
+
export const resolveWorkspaceBundles = async (plan, options) => {
|
|
62
|
+
const result = { built: new Map(), builtCount: 0, report: [], reusedCount: 0 };
|
|
63
|
+
const recording = plan.nodes.some((node) => node.kind === "agent" && node.value.training?.record !== undefined);
|
|
64
|
+
const cacheDirectory = resolveWorkspaceBundleCacheDirectory(options.cacheDirectory), { outputDirectory } = options;
|
|
65
|
+
const identity = options.identity ?? "dev", usedKeys = new Set();
|
|
66
|
+
const bundles = plan.nodes.flatMap((node) => node.kind === "agent" ? (node.value.workspaceResources ?? []).filter((resource) => resource.kind === "bundle") : []);
|
|
67
|
+
if (bundles.length === 0)
|
|
68
|
+
return result;
|
|
69
|
+
const outputReal = await realpath(outputDirectory).catch(() => path.resolve(outputDirectory));
|
|
70
|
+
let platform = "";
|
|
71
|
+
// Phase 1: every input snapshot is taken before this compile writes anything, so no
|
|
72
|
+
// staged archive (or other output under a bundle root) can leak into a later bundle.
|
|
73
|
+
const planned = new Map();
|
|
74
|
+
for (const resource of bundles) {
|
|
75
|
+
const memoKey = declarationKey(resource);
|
|
76
|
+
if (planned.has(memoKey))
|
|
77
|
+
continue;
|
|
78
|
+
const base = path.dirname(resource.scope.key);
|
|
79
|
+
planned.set(memoKey, (async () => {
|
|
80
|
+
if (resource.source !== undefined) {
|
|
81
|
+
return { facts: { origin: "prebuilt", sha256: resource.sha256 ?? await hashPrebuilt(path.resolve(base, resource.source)) } };
|
|
82
|
+
}
|
|
83
|
+
platform ||= `linux/${resolveBundleArchitecture(options.architecture)}`;
|
|
84
|
+
return planBundleBuild(resolveBundleBuildPaths(resource.build, base), {
|
|
85
|
+
dockerCommand: options.dockerCommand ?? "docker", identity, outputReal, platform, workRoot: path.join(cacheDirectory, "work")
|
|
86
|
+
});
|
|
87
|
+
})());
|
|
88
|
+
await planned.get(memoKey);
|
|
89
|
+
}
|
|
90
|
+
// Phase 2: build or reuse each archive and link it into this compile's context at once,
|
|
91
|
+
// so a concurrent compile's pruning cannot take it away. A hit pruned before linking is rebuilt.
|
|
92
|
+
const facts = new Map();
|
|
93
|
+
for (const [memoKey, pending] of planned) {
|
|
94
|
+
const step = await pending;
|
|
95
|
+
if ("facts" in step) {
|
|
96
|
+
facts.set(memoKey, step.facts);
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
const { input, key, write } = step;
|
|
100
|
+
usedKeys.add(key);
|
|
101
|
+
let cached = await lookupCachedBundle(cacheDirectory, key), staged = cached && await linkBuiltBundle(cached.tarPath, outputDirectory, cached.sha256);
|
|
102
|
+
if (cached && staged)
|
|
103
|
+
result.reusedCount += 1;
|
|
104
|
+
else {
|
|
105
|
+
cached = await storeBuiltBundle(cacheDirectory, key, write);
|
|
106
|
+
staged = await linkBuiltBundle(cached.tarPath, outputDirectory, cached.sha256);
|
|
107
|
+
if (!staged)
|
|
108
|
+
throw new SpawnfileError("compile_error", `Workspace bundle archive vanished from the cache while it was staged: ${key}`);
|
|
109
|
+
result.builtCount += 1;
|
|
110
|
+
}
|
|
111
|
+
result.built.set(cached.sha256, staged);
|
|
112
|
+
facts.set(memoKey, { cache_key: key, content_bytes: cached.contentBytes, file_count: cached.fileCount, identity, input, origin: "built", platform, sha256: cached.sha256 });
|
|
113
|
+
}
|
|
114
|
+
for (const node of plan.nodes) {
|
|
115
|
+
if (node.kind !== "agent" || !node.value.workspaceResources?.some((resource) => resource.kind === "bundle"))
|
|
116
|
+
continue;
|
|
117
|
+
node.value.workspaceResources = node.value.workspaceResources.map((resource) => {
|
|
118
|
+
if (resource.kind !== "bundle")
|
|
119
|
+
return resource;
|
|
120
|
+
const resolved = facts.get(declarationKey(resource));
|
|
121
|
+
if (resource.sha256 !== undefined && resource.sha256 !== resolved.sha256) {
|
|
122
|
+
throw new SpawnfileError("validation_error", `Workspace bundle ${resource.id} built to ${resolved.sha256}, but it declares ${resource.sha256}`);
|
|
123
|
+
}
|
|
124
|
+
if (recording) {
|
|
125
|
+
const declared_by = plan.nodes.find((entry) => entry.value.source === resource.scope.key)?.id;
|
|
126
|
+
let pin = result.report.find((entry) => entry.id === resource.id && entry.sha256 === resolved.sha256 && entry.declared_by === declared_by);
|
|
127
|
+
if (!pin) {
|
|
128
|
+
pin = { id: resource.id, ...resolved, agent_node_ids: [], ...(declared_by ? { declared_by } : {}) };
|
|
129
|
+
result.report.push(pin);
|
|
130
|
+
}
|
|
131
|
+
if (!pin.agent_node_ids.includes(node.id))
|
|
132
|
+
pin.agent_node_ids.push(node.id);
|
|
133
|
+
pin.agent_node_ids.sort();
|
|
134
|
+
}
|
|
135
|
+
else if (!result.report.some((existing) => existing.id === resource.id && existing.sha256 === resolved.sha256))
|
|
136
|
+
result.report.push({ id: resource.id, ...resolved });
|
|
137
|
+
return { ...resource, sha256: resolved.sha256 };
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
if (usedKeys.size > 0)
|
|
141
|
+
await pruneBundleCache(cacheDirectory, usedKeys);
|
|
142
|
+
result.report.sort((left, right) => left.id.localeCompare(right.id) || left.sha256.localeCompare(right.sha256));
|
|
143
|
+
return result;
|
|
144
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export interface BundleCommand {
|
|
2
|
+
argv: readonly string[];
|
|
3
|
+
cwd: string;
|
|
4
|
+
env?: NodeJS.ProcessEnv;
|
|
5
|
+
timeoutMs: number;
|
|
6
|
+
/** A container this step starts by name; removed (forcefully) if the step times out or fails. */
|
|
7
|
+
container?: {
|
|
8
|
+
dockerCommand: string;
|
|
9
|
+
name: string;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Runs one build step in its own process group; resolves with stdout, fails
|
|
14
|
+
* with the stderr tail on a non-zero exit, a signal or the timeout. A timeout
|
|
15
|
+
* kills the whole group, and a named container is removed, so neither stray
|
|
16
|
+
* descendants nor a detached container outlive the step.
|
|
17
|
+
*/
|
|
18
|
+
export declare const runBundleCommand: (command: BundleCommand, label: string) => Promise<Buffer>;
|
|
19
|
+
export interface ContainerStep {
|
|
20
|
+
dockerCommand: string;
|
|
21
|
+
/** Container name, so a timed-out step can be removed. */
|
|
22
|
+
name: string;
|
|
23
|
+
image: string;
|
|
24
|
+
platform: string;
|
|
25
|
+
/** Host directory → container directory. */
|
|
26
|
+
mounts: ReadonlyArray<readonly [string, string]>;
|
|
27
|
+
workdir: string;
|
|
28
|
+
env?: Record<string, string>;
|
|
29
|
+
network?: boolean;
|
|
30
|
+
argv: readonly string[];
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* `docker run` for one build step on the target platform: removed on exit,
|
|
34
|
+
* running as the invoking user so outputs stay owned by them, no inherited
|
|
35
|
+
* host environment, and a throwaway HOME.
|
|
36
|
+
*/
|
|
37
|
+
export declare const containerArgv: (step: ContainerStep) => string[];
|
|
38
|
+
/** A unique container name for one build step. */
|
|
39
|
+
export declare const bundleContainerName: () => string;
|
|
40
|
+
/** Runs a container step; the container is removed if the step fails or times out. */
|
|
41
|
+
export declare const runContainerStep: (step: ContainerStep, timeoutMs: number, label: string, cwd: string) => Promise<Buffer>;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import { randomBytes } from "node:crypto";
|
|
3
|
+
import { SpawnfileError } from "../shared/index.js";
|
|
4
|
+
const OUTPUT_TAIL = 4_096;
|
|
5
|
+
const CLEANUP_TIMEOUT_MS = 30_000;
|
|
6
|
+
/** Best-effort, bounded: a stalled Docker client is killed so cleanup never outlives its deadline. */
|
|
7
|
+
const removeContainer = (container) => new Promise((resolve) => {
|
|
8
|
+
const child = spawn(container.dockerCommand, ["rm", "--force", container.name], { stdio: "ignore" });
|
|
9
|
+
const timer = setTimeout(() => { child.kill("SIGKILL"); resolve(); }, CLEANUP_TIMEOUT_MS);
|
|
10
|
+
const done = () => { clearTimeout(timer); resolve(); };
|
|
11
|
+
child.once("error", done);
|
|
12
|
+
child.once("close", done);
|
|
13
|
+
});
|
|
14
|
+
/**
|
|
15
|
+
* Runs one build step in its own process group; resolves with stdout, fails
|
|
16
|
+
* with the stderr tail on a non-zero exit, a signal or the timeout. A timeout
|
|
17
|
+
* kills the whole group, and a named container is removed, so neither stray
|
|
18
|
+
* descendants nor a detached container outlive the step.
|
|
19
|
+
*/
|
|
20
|
+
export const runBundleCommand = (command, label) => new Promise((resolve, reject) => {
|
|
21
|
+
const [file, ...args] = command.argv;
|
|
22
|
+
const child = spawn(file, args, { cwd: command.cwd, detached: true, env: command.env ?? process.env, stdio: ["ignore", "pipe", "pipe"] });
|
|
23
|
+
const stdout = [];
|
|
24
|
+
let stderr = "", timedOut = false, settled = false;
|
|
25
|
+
const killGroup = () => { try {
|
|
26
|
+
process.kill(-child.pid, "SIGKILL");
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
child.kill("SIGKILL");
|
|
30
|
+
} };
|
|
31
|
+
const finish = async (error) => {
|
|
32
|
+
if (settled)
|
|
33
|
+
return;
|
|
34
|
+
settled = true;
|
|
35
|
+
clearTimeout(timer);
|
|
36
|
+
if (error && command.container)
|
|
37
|
+
await removeContainer(command.container);
|
|
38
|
+
if (error)
|
|
39
|
+
reject(error);
|
|
40
|
+
else
|
|
41
|
+
resolve(Buffer.concat(stdout));
|
|
42
|
+
};
|
|
43
|
+
const timer = setTimeout(() => { timedOut = true; killGroup(); void finish(new SpawnfileError("compile_error", `${label} timed out after ${command.timeoutMs} ms${stderr.trim() ? `: ${stderr.trim()}` : ""}`)); }, command.timeoutMs);
|
|
44
|
+
child.stdout.on("data", (chunk) => { stdout.push(chunk); });
|
|
45
|
+
child.stderr.on("data", (chunk) => { stderr = (stderr + chunk.toString("utf8")).slice(-OUTPUT_TAIL); });
|
|
46
|
+
child.once("error", (error) => { void finish(new SpawnfileError("compile_error", `${label} could not start ${file}: ${error.message}`)); });
|
|
47
|
+
child.once("close", (code, signal) => {
|
|
48
|
+
if (timedOut)
|
|
49
|
+
return;
|
|
50
|
+
if (code === 0) {
|
|
51
|
+
void finish();
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
killGroup();
|
|
55
|
+
const why = signal ? `was killed by ${signal}` : `exited ${code}`;
|
|
56
|
+
void finish(new SpawnfileError("compile_error", `${label} ${why}${stderr.trim() ? `: ${stderr.trim()}` : ""}`));
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
/**
|
|
60
|
+
* `docker run` for one build step on the target platform: removed on exit,
|
|
61
|
+
* running as the invoking user so outputs stay owned by them, no inherited
|
|
62
|
+
* host environment, and a throwaway HOME.
|
|
63
|
+
*/
|
|
64
|
+
export const containerArgv = (step) => {
|
|
65
|
+
const user = typeof process.getuid === "function" && typeof process.getgid === "function" ? [`--user`, `${process.getuid()}:${process.getgid()}`] : [];
|
|
66
|
+
const env = { HOME: "/tmp/spawnfile-home", ...step.env };
|
|
67
|
+
return [
|
|
68
|
+
step.dockerCommand, "run", "--rm", "--name", step.name, "--platform", step.platform, ...user,
|
|
69
|
+
...(step.network === false ? ["--network", "none"] : []),
|
|
70
|
+
...step.mounts.flatMap(([host, container]) => ["--volume", `${host}:${container}`]),
|
|
71
|
+
"--workdir", step.workdir,
|
|
72
|
+
...Object.entries(env).sort(([left], [right]) => left.localeCompare(right)).flatMap(([key, value]) => ["--env", `${key}=${value}`]),
|
|
73
|
+
step.image, ...step.argv
|
|
74
|
+
];
|
|
75
|
+
};
|
|
76
|
+
/** A unique container name for one build step. */
|
|
77
|
+
export const bundleContainerName = () => `spawnfile-bundle-${randomBytes(8).toString("hex")}`;
|
|
78
|
+
/** Runs a container step; the container is removed if the step fails or times out. */
|
|
79
|
+
export const runContainerStep = (step, timeoutMs, label, cwd) => runBundleCommand({ argv: containerArgv(step), container: { dockerCommand: step.dockerCommand, name: step.name }, cwd, timeoutMs }, label);
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/** Bumped whenever the bytes this writer emits for the same entries change. */
|
|
2
|
+
export declare const WORKSPACE_BUNDLE_TAR_WRITER = "spawnfile.workspace-bundle-tar.v1";
|
|
3
|
+
/** Same bounds the prebuilt-tar staging path enforces. */
|
|
4
|
+
export declare const WORKSPACE_BUNDLE_MAX_BYTES = 536870912;
|
|
5
|
+
export declare const WORKSPACE_BUNDLE_MAX_ENTRIES = 65536;
|
|
6
|
+
export type BundleFileMode = 0o644 | 0o755;
|
|
7
|
+
/** Git records one bit of mode: executable or not. Every emitted mode collapses to one of two values. */
|
|
8
|
+
export declare const normalizeBundleMode: (rawMode: number) => BundleFileMode;
|
|
9
|
+
/** Splits a path across the ustar prefix (155 bytes) and name (100 bytes) fields, or refuses it. */
|
|
10
|
+
export declare const splitUstarPath: (name: string) => {
|
|
11
|
+
base: Buffer;
|
|
12
|
+
prefix: Buffer;
|
|
13
|
+
};
|
|
14
|
+
/** One deterministic ustar header: uid/gid 0, mtime 0, owner root, regular file. */
|
|
15
|
+
export declare const ustarHeader: (name: string, size: number, mode: BundleFileMode) => Buffer;
|
|
16
|
+
export interface BundleTarSummary {
|
|
17
|
+
contentBytes: number;
|
|
18
|
+
fileCount: number;
|
|
19
|
+
sha256: `sha256:${string}`;
|
|
20
|
+
size: number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Streams entries into a tar file while hashing it. Callers add entries in
|
|
24
|
+
* sorted path order; the writer refuses an unsorted or duplicate path so two
|
|
25
|
+
* builds of the same entry set cannot disagree on order.
|
|
26
|
+
*/
|
|
27
|
+
export declare class BundleTarWriter {
|
|
28
|
+
private readonly hash;
|
|
29
|
+
private pending;
|
|
30
|
+
private pendingBytes;
|
|
31
|
+
private size;
|
|
32
|
+
private contentBytes;
|
|
33
|
+
private fileCount;
|
|
34
|
+
private remaining;
|
|
35
|
+
private currentSize;
|
|
36
|
+
private lastPath;
|
|
37
|
+
private readonly handle;
|
|
38
|
+
private constructor();
|
|
39
|
+
static create(filePath: string): Promise<BundleTarWriter>;
|
|
40
|
+
begin(name: string, size: number, mode: BundleFileMode): Promise<void>;
|
|
41
|
+
data(chunk: Buffer): Promise<void>;
|
|
42
|
+
end(): Promise<void>;
|
|
43
|
+
finish(): Promise<BundleTarSummary>;
|
|
44
|
+
abort(): Promise<void>;
|
|
45
|
+
private push;
|
|
46
|
+
private flush;
|
|
47
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { open } from "node:fs/promises";
|
|
3
|
+
import { SpawnfileError } from "../shared/index.js";
|
|
4
|
+
/** Bumped whenever the bytes this writer emits for the same entries change. */
|
|
5
|
+
export const WORKSPACE_BUNDLE_TAR_WRITER = "spawnfile.workspace-bundle-tar.v1";
|
|
6
|
+
/** Same bounds the prebuilt-tar staging path enforces. */
|
|
7
|
+
export const WORKSPACE_BUNDLE_MAX_BYTES = 536_870_912;
|
|
8
|
+
export const WORKSPACE_BUNDLE_MAX_ENTRIES = 65_536;
|
|
9
|
+
const BLOCK = 512;
|
|
10
|
+
const FLUSH_BYTES = 1_048_576;
|
|
11
|
+
/** Git records one bit of mode: executable or not. Every emitted mode collapses to one of two values. */
|
|
12
|
+
export const normalizeBundleMode = (rawMode) => (rawMode & 0o111) ? 0o755 : 0o644;
|
|
13
|
+
const fail = (message) => {
|
|
14
|
+
throw new SpawnfileError("validation_error", message);
|
|
15
|
+
};
|
|
16
|
+
const octal = (value, width) => `${value.toString(8).padStart(width - 1, "0")}\0`;
|
|
17
|
+
/** Splits a path across the ustar prefix (155 bytes) and name (100 bytes) fields, or refuses it. */
|
|
18
|
+
export const splitUstarPath = (name) => {
|
|
19
|
+
const raw = Buffer.from(name, "utf8");
|
|
20
|
+
if (raw.length <= 100)
|
|
21
|
+
return { base: raw, prefix: Buffer.alloc(0) };
|
|
22
|
+
for (let index = name.indexOf("/"); index > 0; index = name.indexOf("/", index + 1)) {
|
|
23
|
+
const prefix = Buffer.from(name.slice(0, index), "utf8"), base = Buffer.from(name.slice(index + 1), "utf8");
|
|
24
|
+
if (prefix.length <= 155 && base.length <= 100 && base.length > 0)
|
|
25
|
+
return { base, prefix };
|
|
26
|
+
}
|
|
27
|
+
return fail(`Workspace bundle path exceeds ustar bounds: ${name}`);
|
|
28
|
+
};
|
|
29
|
+
/** One deterministic ustar header: uid/gid 0, mtime 0, owner root, regular file. */
|
|
30
|
+
export const ustarHeader = (name, size, mode) => {
|
|
31
|
+
const bytes = Buffer.alloc(BLOCK), { base, prefix } = splitUstarPath(name);
|
|
32
|
+
base.copy(bytes, 0);
|
|
33
|
+
bytes.write(octal(mode, 8), 100, "ascii");
|
|
34
|
+
bytes.write(octal(0, 8), 108, "ascii");
|
|
35
|
+
bytes.write(octal(0, 8), 116, "ascii");
|
|
36
|
+
bytes.write(octal(size, 12), 124, "ascii");
|
|
37
|
+
bytes.write(octal(0, 12), 136, "ascii");
|
|
38
|
+
bytes.fill(0x20, 148, 156);
|
|
39
|
+
bytes[156] = 0x30;
|
|
40
|
+
bytes.write("ustar\0", 257, "ascii");
|
|
41
|
+
bytes.write("00", 263, "ascii");
|
|
42
|
+
bytes.write("root", 265, "ascii");
|
|
43
|
+
bytes.write("root", 297, "ascii");
|
|
44
|
+
prefix.copy(bytes, 345);
|
|
45
|
+
let sum = 0;
|
|
46
|
+
for (const byte of bytes)
|
|
47
|
+
sum += byte;
|
|
48
|
+
bytes.write(`${sum.toString(8).padStart(6, "0")}\0 `, 148, "ascii");
|
|
49
|
+
return bytes;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Streams entries into a tar file while hashing it. Callers add entries in
|
|
53
|
+
* sorted path order; the writer refuses an unsorted or duplicate path so two
|
|
54
|
+
* builds of the same entry set cannot disagree on order.
|
|
55
|
+
*/
|
|
56
|
+
export class BundleTarWriter {
|
|
57
|
+
hash = createHash("sha256");
|
|
58
|
+
pending = [];
|
|
59
|
+
pendingBytes = 0;
|
|
60
|
+
size = 0;
|
|
61
|
+
contentBytes = 0;
|
|
62
|
+
fileCount = 0;
|
|
63
|
+
remaining = 0;
|
|
64
|
+
currentSize = 0;
|
|
65
|
+
lastPath;
|
|
66
|
+
handle;
|
|
67
|
+
constructor(handle) {
|
|
68
|
+
this.handle = handle;
|
|
69
|
+
}
|
|
70
|
+
static async create(filePath) {
|
|
71
|
+
return new BundleTarWriter(await open(filePath, "wx", 0o600));
|
|
72
|
+
}
|
|
73
|
+
async begin(name, size, mode) {
|
|
74
|
+
if (this.remaining !== 0)
|
|
75
|
+
fail("Workspace bundle entry was not fully written");
|
|
76
|
+
if (this.lastPath !== undefined && name <= this.lastPath)
|
|
77
|
+
fail(`Workspace bundle entries are not in strict path order: ${name}`);
|
|
78
|
+
this.fileCount += 1;
|
|
79
|
+
if (this.fileCount > WORKSPACE_BUNDLE_MAX_ENTRIES)
|
|
80
|
+
fail("Workspace bundle exceeds the maximum entry count");
|
|
81
|
+
this.contentBytes += size;
|
|
82
|
+
// Header, padded content and the two-block terminator must all fit.
|
|
83
|
+
if (this.size + BLOCK + Math.ceil(size / BLOCK) * BLOCK + BLOCK * 2 > WORKSPACE_BUNDLE_MAX_BYTES)
|
|
84
|
+
fail("Workspace bundle exceeds the maximum archive size");
|
|
85
|
+
this.lastPath = name;
|
|
86
|
+
this.remaining = size;
|
|
87
|
+
this.currentSize = size;
|
|
88
|
+
await this.push(ustarHeader(name, size, mode));
|
|
89
|
+
}
|
|
90
|
+
async data(chunk) {
|
|
91
|
+
if (chunk.length > this.remaining)
|
|
92
|
+
fail("Workspace bundle input grew while it was archived");
|
|
93
|
+
this.remaining -= chunk.length;
|
|
94
|
+
await this.push(chunk);
|
|
95
|
+
}
|
|
96
|
+
async end() {
|
|
97
|
+
if (this.remaining !== 0)
|
|
98
|
+
fail("Workspace bundle input shrank while it was archived");
|
|
99
|
+
const padding = (BLOCK - (this.currentSize % BLOCK)) % BLOCK;
|
|
100
|
+
if (padding)
|
|
101
|
+
await this.push(Buffer.alloc(padding));
|
|
102
|
+
}
|
|
103
|
+
async finish() {
|
|
104
|
+
try {
|
|
105
|
+
if (this.remaining !== 0)
|
|
106
|
+
fail("Workspace bundle entry was not fully written");
|
|
107
|
+
if (this.fileCount === 0)
|
|
108
|
+
fail("Workspace bundle has no input files");
|
|
109
|
+
await this.push(Buffer.alloc(BLOCK * 2));
|
|
110
|
+
await this.flush();
|
|
111
|
+
await this.handle.sync();
|
|
112
|
+
}
|
|
113
|
+
finally {
|
|
114
|
+
await this.handle.close();
|
|
115
|
+
}
|
|
116
|
+
return { contentBytes: this.contentBytes, fileCount: this.fileCount, sha256: `sha256:${this.hash.digest("hex")}`, size: this.size };
|
|
117
|
+
}
|
|
118
|
+
async abort() {
|
|
119
|
+
await this.handle.close().catch(() => undefined);
|
|
120
|
+
}
|
|
121
|
+
async push(chunk) {
|
|
122
|
+
this.hash.update(chunk);
|
|
123
|
+
this.size += chunk.length;
|
|
124
|
+
this.pending.push(chunk);
|
|
125
|
+
this.pendingBytes += chunk.length;
|
|
126
|
+
if (this.pendingBytes >= FLUSH_BYTES)
|
|
127
|
+
await this.flush();
|
|
128
|
+
}
|
|
129
|
+
async flush() {
|
|
130
|
+
if (this.pendingBytes === 0)
|
|
131
|
+
return;
|
|
132
|
+
const buffer = Buffer.concat(this.pending, this.pendingBytes);
|
|
133
|
+
this.pending = [];
|
|
134
|
+
this.pendingBytes = 0;
|
|
135
|
+
for (let offset = 0; offset < buffer.length;) {
|
|
136
|
+
const { bytesWritten } = await this.handle.write(buffer, offset, buffer.length - offset);
|
|
137
|
+
offset += bytesWritten;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { BundleFilesInput } from "./workspaceBundleFiles.js";
|
|
2
|
+
export interface WalkOptions {
|
|
3
|
+
/** Root-relative paths left out of the archive entirely. */
|
|
4
|
+
skip?: (relativePath: string) => boolean;
|
|
5
|
+
/** Symlinks for which this returns true are dropped; any other symlink fails the build. */
|
|
6
|
+
dropSymlink?: (relativePath: string) => boolean;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Every regular file under `directory`, hashed, as an archive input set.
|
|
10
|
+
* Built output (installed dependencies, generated files) has no git
|
|
11
|
+
* identity, so each file is content-addressed. Symlinks, devices and sockets
|
|
12
|
+
* cannot be archived safely and fail unless explicitly dropped. Entry and byte
|
|
13
|
+
* budgets are enforced while walking, before the archive is written.
|
|
14
|
+
*/
|
|
15
|
+
export declare const walkBuiltTree: (directory: string, options?: WalkOptions) => Promise<BundleFilesInput>;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { createReadStream } from "node:fs";
|
|
3
|
+
import { lstat, readdir } from "node:fs/promises";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { SpawnfileError } from "../shared/index.js";
|
|
6
|
+
import { normalizeBundleMode, WORKSPACE_BUNDLE_MAX_BYTES, WORKSPACE_BUNDLE_MAX_ENTRIES } from "./workspaceBundleTar.js";
|
|
7
|
+
const fail = (message) => {
|
|
8
|
+
throw new SpawnfileError("validation_error", message);
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Every regular file under `directory`, hashed, as an archive input set.
|
|
12
|
+
* Built output (installed dependencies, generated files) has no git
|
|
13
|
+
* identity, so each file is content-addressed. Symlinks, devices and sockets
|
|
14
|
+
* cannot be archived safely and fail unless explicitly dropped. Entry and byte
|
|
15
|
+
* budgets are enforced while walking, before the archive is written.
|
|
16
|
+
*/
|
|
17
|
+
export const walkBuiltTree = async (directory, options = {}) => {
|
|
18
|
+
const root = await lstat(directory);
|
|
19
|
+
if (!root.isDirectory())
|
|
20
|
+
fail(`Built workspace bundle output root was replaced by something other than a directory: ${directory}`);
|
|
21
|
+
const entries = [];
|
|
22
|
+
let bytes = 0;
|
|
23
|
+
const visit = async (relative) => {
|
|
24
|
+
for (const name of (await readdir(path.join(directory, relative))).sort()) {
|
|
25
|
+
const child = relative ? `${relative}/${name}` : name;
|
|
26
|
+
if (options.skip?.(child))
|
|
27
|
+
continue;
|
|
28
|
+
const info = await lstat(path.join(directory, child));
|
|
29
|
+
if (info.isDirectory()) {
|
|
30
|
+
await visit(child);
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
if (info.isSymbolicLink()) {
|
|
34
|
+
if (options.dropSymlink?.(child))
|
|
35
|
+
continue;
|
|
36
|
+
fail(`Built workspace bundle output contains a symlink: ${child}`);
|
|
37
|
+
}
|
|
38
|
+
if (!info.isFile())
|
|
39
|
+
fail(`Built workspace bundle output contains an unsupported file type: ${child}`);
|
|
40
|
+
if (child.includes("\\"))
|
|
41
|
+
fail(`Built workspace bundle output path cannot be archived safely: ${child}`);
|
|
42
|
+
bytes += info.size;
|
|
43
|
+
if (bytes > WORKSPACE_BUNDLE_MAX_BYTES)
|
|
44
|
+
fail("Workspace bundle exceeds the maximum archive size");
|
|
45
|
+
if (entries.length >= WORKSPACE_BUNDLE_MAX_ENTRIES)
|
|
46
|
+
fail("Workspace bundle exceeds the maximum entry count");
|
|
47
|
+
const hash = createHash("sha256");
|
|
48
|
+
for await (const chunk of createReadStream(path.join(directory, child)))
|
|
49
|
+
hash.update(chunk);
|
|
50
|
+
entries.push({ identity: `sha256:${hash.digest("hex")}`, mode: normalizeBundleMode(info.mode), path: child });
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
await visit("");
|
|
54
|
+
if (entries.length === 0)
|
|
55
|
+
fail(`Built workspace bundle output is empty: ${directory}`);
|
|
56
|
+
entries.sort((left, right) => (left.path < right.path ? -1 : left.path > right.path ? 1 : 0));
|
|
57
|
+
return { directory, entries, mode: "dev" };
|
|
58
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/** Which remote ref a `fetch: build` git resource follows. `none` follows the remote's default branch. */
|
|
2
|
+
export interface GitPinSelector {
|
|
3
|
+
kind: "branch" | "none" | "ref" | "tag";
|
|
4
|
+
value: string;
|
|
5
|
+
}
|
|
6
|
+
/** Host-side SSH credential. Exactly one source; neither is ever written into the compile output. */
|
|
7
|
+
export interface GitPinAuth {
|
|
8
|
+
sshKey?: string;
|
|
9
|
+
sshKeyEnv?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface GitPinFetch {
|
|
12
|
+
/** Bare cache repository the commit's objects now live in. */
|
|
13
|
+
repository: string;
|
|
14
|
+
commit: string;
|
|
15
|
+
}
|
|
16
|
+
/** The remote ref to fetch, and the commit it must equal when the selector already names one. */
|
|
17
|
+
export declare const gitPinRefspec: (selector: GitPinSelector) => {
|
|
18
|
+
expected?: string;
|
|
19
|
+
source: string;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Runs `use` with the git environment for one fetch. A key held in an env var
|
|
23
|
+
* is copied to a private 0600 file in a fresh temporary directory that is
|
|
24
|
+
* removed afterwards; the key only ever reaches git through `GIT_SSH_COMMAND`.
|
|
25
|
+
*/
|
|
26
|
+
export declare const withGitPinEnvironment: <T>(auth: GitPinAuth | undefined, use: (env: NodeJS.ProcessEnv) => Promise<T>, environment?: NodeJS.ProcessEnv) => Promise<T>;
|
|
27
|
+
/**
|
|
28
|
+
* Serializes work on one cache repository across processes on this host: git
|
|
29
|
+
* keeps one repository-wide `shallow` file, so two shallow fetches into the
|
|
30
|
+
* same repository can fail each other. A lock whose owner process is gone is
|
|
31
|
+
* taken over.
|
|
32
|
+
*/
|
|
33
|
+
export declare const withGitPinLock: <T>(repository: string, use: () => Promise<T>) => Promise<T>;
|
|
34
|
+
/**
|
|
35
|
+
* Resolves `selector` on `url` to one commit and fetches its objects into the
|
|
36
|
+
* cache, shallowly, under the repository lock. A full commit id already in the
|
|
37
|
+
* cache is not fetched again, so a recorded pin rebuilds offline. Any failure
|
|
38
|
+
* to resolve refuses the compile: a pinned resource never falls back to stale
|
|
39
|
+
* or empty content.
|
|
40
|
+
*/
|
|
41
|
+
export declare const fetchGitPin: (cacheDirectory: string, url: string, selector: GitPinSelector, env: NodeJS.ProcessEnv) => Promise<GitPinFetch>;
|