spawnfile 0.1.13 → 0.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +50 -11
- package/dist/audit/auditCli.d.ts +19 -0
- package/dist/audit/auditCli.js +63 -0
- package/dist/audit/checks.d.ts +100 -0
- package/dist/audit/checks.js +279 -0
- package/dist/audit/checksShared.d.ts +74 -0
- package/dist/audit/checksShared.js +37 -0
- package/dist/audit/generateAudit.d.ts +19 -0
- package/dist/audit/generateAudit.js +122 -0
- package/dist/audit/index.d.ts +4 -0
- package/dist/audit/index.js +4 -0
- package/dist/audit/readAudit.d.ts +50 -0
- package/dist/audit/readAudit.js +59 -0
- package/dist/audit/types.d.ts +40 -0
- package/dist/audit/types.js +8 -0
- package/dist/auth/credentialEnvFile.d.ts +11 -0
- package/dist/auth/credentialEnvFile.js +60 -0
- package/dist/auth/credentialProvisioning.d.ts +15 -0
- package/dist/auth/credentialProvisioning.js +75 -0
- package/dist/auth/credentialProvisioningReceipt.d.ts +28 -0
- package/dist/auth/credentialProvisioningReceipt.js +70 -0
- package/dist/auth/credentialProvisioningRequest.d.ts +51 -0
- package/dist/auth/credentialProvisioningRequest.js +169 -0
- package/dist/auth/credentialWorldBindings.d.ts +21 -0
- package/dist/auth/credentialWorldBindings.js +104 -0
- package/dist/auth/index.d.ts +7 -0
- package/dist/auth/index.js +7 -0
- package/dist/auth/paths.d.ts +11 -0
- package/dist/auth/paths.js +21 -0
- package/dist/auth/targetSecretSourceAuthor.d.ts +18 -0
- package/dist/auth/targetSecretSourceAuthor.js +52 -0
- package/dist/auth/targetSecretSourceFsPublish.d.ts +15 -0
- package/dist/auth/targetSecretSourceFsPublish.js +49 -0
- package/dist/auth/targetSecretSourceFsPublishImmutable.d.ts +16 -0
- package/dist/auth/targetSecretSourceFsPublishImmutable.js +435 -0
- package/dist/auth/targetSecretSourceFsRead.d.ts +14 -0
- package/dist/auth/targetSecretSourceFsRead.js +198 -0
- package/dist/auth/targetSecretSourceGrant.d.ts +16 -0
- package/dist/auth/targetSecretSourceGrant.js +99 -0
- package/dist/auth/targetSecretSourceGrantRecords.d.ts +84 -0
- package/dist/auth/targetSecretSourceGrantRecords.js +214 -0
- package/dist/auth/targetSecretSourceLifecycle.d.ts +30 -0
- package/dist/auth/targetSecretSourceLifecycle.js +52 -0
- package/dist/auth/targetSecretSourceOwnerEntropy.d.ts +6 -0
- package/dist/auth/targetSecretSourceOwnerEntropy.js +28 -0
- package/dist/auth/targetSecretSourceRecordCommon.d.ts +14 -0
- package/dist/auth/targetSecretSourceRecordCommon.js +100 -0
- package/dist/auth/targetSecretSourceRecordPublish.d.ts +10 -0
- package/dist/auth/targetSecretSourceRecordPublish.js +104 -0
- package/dist/auth/targetSecretSourceResolver.d.ts +10 -0
- package/dist/auth/targetSecretSourceResolver.js +137 -0
- package/dist/auth/targetSecretSourceRevoke.d.ts +20 -0
- package/dist/auth/targetSecretSourceRevoke.js +92 -0
- package/dist/auth/targetSecretSourceRotate.d.ts +19 -0
- package/dist/auth/targetSecretSourceRotate.js +121 -0
- package/dist/auth/targetSecretSourceVersionRecords.d.ts +49 -0
- package/dist/auth/targetSecretSourceVersionRecords.js +166 -0
- package/dist/cli/artifactsCommands.d.ts +27 -0
- package/dist/cli/artifactsCommands.js +132 -0
- package/dist/cli/authCommands.d.ts +5 -0
- package/dist/cli/authCommands.js +221 -0
- package/dist/cli/compileBuildCommands.d.ts +3 -0
- package/dist/cli/compileBuildCommands.js +35 -0
- package/dist/cli/containerBundleCommand.d.ts +6 -0
- package/dist/cli/containerBundleCommand.js +116 -0
- package/dist/cli/downCommand.d.ts +25 -0
- package/dist/cli/downCommand.js +134 -0
- package/dist/cli/index.js +6 -3
- package/dist/cli/lifecycleCommands.d.ts +1 -1
- package/dist/cli/lifecycleCommands.js +11 -181
- package/dist/cli/lifecycleMachine.d.ts +19 -0
- package/dist/cli/lifecycleMachine.js +78 -0
- package/dist/cli/lifecyclePlan.d.ts +35 -0
- package/dist/cli/lifecyclePlan.js +240 -0
- package/dist/cli/lifecyclePlanningCommands.d.ts +3 -0
- package/dist/cli/lifecyclePlanningCommands.js +30 -0
- package/dist/cli/runCli.d.ts +9 -2
- package/dist/cli/runCli.js +27 -71
- package/dist/cli/runPublishCommands.d.ts +3 -0
- package/dist/cli/runPublishCommands.js +70 -0
- package/dist/cli/statusCommand.d.ts +3 -33
- package/dist/cli/statusCommand.js +19 -249
- package/dist/cli/statusCommandLive.d.ts +20 -0
- package/dist/cli/statusCommandLive.js +188 -0
- package/dist/cli/statusCommandOptions.d.ts +40 -0
- package/dist/cli/statusCommandOptions.js +42 -0
- package/dist/cli/targetCliRoute.d.ts +2 -0
- package/dist/cli/targetCliRoute.js +30 -0
- package/dist/cli/targetCommands.d.ts +33 -0
- package/dist/cli/targetCommands.js +257 -0
- package/dist/cli/targetComposedPreparationCommand.d.ts +6 -0
- package/dist/cli/targetComposedPreparationCommand.js +39 -0
- package/dist/cli/targetDefaultArtifactAuthority.d.ts +5 -0
- package/dist/cli/targetDefaultArtifactAuthority.js +28 -0
- package/dist/cli/targetDefaultAuthorities.d.ts +53 -0
- package/dist/cli/targetDefaultAuthorities.js +210 -0
- package/dist/cli/targetDefaultConfig.d.ts +68 -0
- package/dist/cli/targetDefaultConfig.js +317 -0
- package/dist/cli/targetDefaultConfigStdin.d.ts +13 -0
- package/dist/cli/targetDefaultConfigStdin.js +215 -0
- package/dist/cli/targetDefaultEnvelope.d.ts +1 -0
- package/dist/cli/targetDefaultEnvelope.js +13 -0
- package/dist/cli/targetDefaultHandlerFactory.d.ts +28 -0
- package/dist/cli/targetDefaultHandlerFactory.js +247 -0
- package/dist/cli/targetDefaultHandlers.d.ts +21 -0
- package/dist/cli/targetDefaultHandlers.js +72 -0
- package/dist/cli/targetDefaultJournalAuthority.d.ts +35 -0
- package/dist/cli/targetDefaultJournalAuthority.js +135 -0
- package/dist/cli/targetDefaultWorldClock.d.ts +4 -0
- package/dist/cli/targetDefaultWorldClock.js +14 -0
- package/dist/cli/targetDefaultWorldQueries.d.ts +5 -0
- package/dist/cli/targetDefaultWorldQueries.js +11 -0
- package/dist/cli/targetDefaultWorldReadiness.d.ts +4 -0
- package/dist/cli/targetDefaultWorldReadiness.js +17 -0
- package/dist/cli/targetEvidenceHelperResolution.d.ts +14 -0
- package/dist/cli/targetEvidenceHelperResolution.js +23 -0
- package/dist/cli/targetLookupCli.d.ts +3 -0
- package/dist/cli/targetLookupCli.js +31 -0
- package/dist/cli/targetLookupCommands.d.ts +12 -0
- package/dist/cli/targetLookupCommands.js +69 -0
- package/dist/cli/targetOperationDispatch.d.ts +58 -0
- package/dist/cli/targetOperationDispatch.js +21 -0
- package/dist/cli/targetReceiptOutput.d.ts +14 -0
- package/dist/cli/targetReceiptOutput.js +21 -0
- package/dist/cli/targetRequestFile.d.ts +14 -0
- package/dist/cli/targetRequestFile.js +63 -0
- package/dist/cli/targetSecretSourceInput.d.ts +28 -0
- package/dist/cli/targetSecretSourceInput.js +121 -0
- package/dist/cli/targetWorldClockCommand.d.ts +10 -0
- package/dist/cli/targetWorldClockCommand.js +42 -0
- package/dist/cli/targetWorldClockCrossProcess.test-helper.d.ts +13 -0
- package/dist/cli/targetWorldClockCrossProcess.test-helper.js +109 -0
- package/dist/cli/targetWorldReadinessCommand.d.ts +10 -0
- package/dist/cli/targetWorldReadinessCommand.js +43 -0
- package/dist/cli/upCommand.d.ts +3 -0
- package/dist/cli/upCommand.js +133 -0
- package/dist/cli/upImageCommand.d.ts +11 -0
- package/dist/cli/upImageCommand.js +41 -0
- package/dist/cli/upLifecycleInvocation.d.ts +41 -0
- package/dist/cli/upLifecycleInvocation.js +48 -0
- package/dist/cli/upLifecycleRecovery.d.ts +4 -0
- package/dist/cli/upLifecycleRecovery.js +53 -0
- package/dist/compiler/agentNodeMerge.d.ts +2 -0
- package/dist/compiler/agentNodeMerge.js +79 -0
- package/dist/compiler/agentSurfaces.js +11 -1
- package/dist/compiler/buildCompilePlan.js +17 -0
- package/dist/compiler/buildCompilePlanAgent.d.ts +11 -0
- package/dist/compiler/buildCompilePlanAgent.js +56 -0
- package/dist/compiler/buildCompilePlanTeams.d.ts +1 -0
- package/dist/compiler/buildCompilePlanTeams.js +4 -1
- package/dist/compiler/buildCompilePlanTraversal.js +75 -82
- package/dist/compiler/buildProject.d.ts +11 -0
- package/dist/compiler/buildProject.js +77 -2
- package/dist/compiler/compilePlanHelpers.js +2 -0
- package/dist/compiler/compileProject.d.ts +13 -0
- package/dist/compiler/compileProject.js +26 -74
- package/dist/compiler/compileProjectPolicy.d.ts +5 -0
- package/dist/compiler/compileProjectPolicy.js +21 -0
- package/dist/compiler/compileProjectReports.d.ts +9 -0
- package/dist/compiler/compileProjectReports.js +52 -0
- package/dist/compiler/containerArtifactSummaries.d.ts +7 -0
- package/dist/compiler/containerArtifactSummaries.js +138 -0
- package/dist/compiler/containerArtifacts.d.ts +10 -0
- package/dist/compiler/containerArtifacts.js +126 -125
- package/dist/compiler/containerArtifactsPlans.d.ts +5 -3
- package/dist/compiler/containerArtifactsPlans.js +31 -118
- package/dist/compiler/containerArtifactsRender.d.ts +3 -1
- package/dist/compiler/containerArtifactsRender.js +15 -12
- package/dist/compiler/containerArtifactsTypes.d.ts +12 -0
- package/dist/compiler/containerConfigEnvRender.d.ts +3 -0
- package/dist/compiler/containerConfigEnvRender.js +54 -0
- package/dist/compiler/containerEntrypointRender.d.ts +1 -0
- package/dist/compiler/containerEntrypointRender.js +56 -52
- package/dist/compiler/containerEntrypointShell.d.ts +5 -0
- package/dist/compiler/containerEntrypointShell.js +29 -0
- package/dist/compiler/containerPackageOverrides.d.ts +27 -0
- package/dist/compiler/containerPackageOverrides.js +63 -0
- package/dist/compiler/containerTargetPlanResolution.d.ts +20 -0
- package/dist/compiler/containerTargetPlanResolution.js +97 -0
- package/dist/compiler/daimonTelemetryArtifacts.d.ts +22 -0
- package/dist/compiler/daimonTelemetryArtifacts.js +61 -0
- package/dist/compiler/dockerBuildContext.d.ts +16 -0
- package/dist/compiler/dockerBuildContext.js +159 -0
- package/dist/compiler/dockerBuildSkip.d.ts +30 -0
- package/dist/compiler/dockerBuildSkip.js +81 -0
- package/dist/compiler/index.d.ts +4 -0
- package/dist/compiler/index.js +4 -0
- package/dist/compiler/memoryArtifacts.d.ts +26 -0
- package/dist/compiler/memoryArtifacts.js +134 -0
- package/dist/compiler/memoryResolution.d.ts +4 -0
- package/dist/compiler/memoryResolution.js +147 -0
- package/dist/compiler/modelEnv.d.ts +2 -0
- package/dist/compiler/modelEnv.js +6 -0
- package/dist/compiler/moltnetAllowedWakeSendersValidation.d.ts +2 -0
- package/dist/compiler/moltnetAllowedWakeSendersValidation.js +42 -0
- package/dist/compiler/moltnetArtifactPaths.d.ts +26 -0
- package/dist/compiler/moltnetArtifactPaths.js +49 -0
- package/dist/compiler/moltnetArtifactTypes.d.ts +46 -0
- package/dist/compiler/moltnetArtifactTypes.js +1 -0
- package/dist/compiler/moltnetArtifacts.d.ts +2 -40
- package/dist/compiler/moltnetArtifacts.js +43 -97
- package/dist/compiler/moltnetBinaries.d.ts +21 -4
- package/dist/compiler/moltnetBinaries.js +134 -27
- package/dist/compiler/moltnetClientConfig.js +7 -2
- package/dist/compiler/moltnetConfigLowering.d.ts +16 -1
- package/dist/compiler/moltnetConfigLowering.js +67 -5
- package/dist/compiler/moltnetExternalParticipantArtifact.d.ts +38 -0
- package/dist/compiler/moltnetExternalParticipantArtifact.js +188 -0
- package/dist/compiler/moltnetNodeConfig.js +7 -2
- package/dist/compiler/moltnetReleaseAuthority.d.ts +17 -0
- package/dist/compiler/moltnetReleaseAuthority.js +73 -0
- package/dist/compiler/moltnetReleaseDownload.d.ts +12 -0
- package/dist/compiler/moltnetReleaseDownload.js +85 -0
- package/dist/compiler/moltnetRepresentativeResolution.d.ts +1 -0
- package/dist/compiler/moltnetRepresentativeResolution.js +16 -2
- package/dist/compiler/moltnetResolution.js +72 -20
- package/dist/compiler/moltnetRoomMemberships.js +37 -9
- package/dist/compiler/moltnetServerPlans.d.ts +9 -0
- package/dist/compiler/moltnetServerPlans.js +132 -0
- package/dist/compiler/organizationIdentity.d.ts +27 -0
- package/dist/compiler/organizationIdentity.js +297 -0
- package/dist/compiler/organizationReadyEvidence.d.ts +49 -0
- package/dist/compiler/organizationReadyEvidence.js +261 -0
- package/dist/compiler/projectManifestGraph.d.ts +4 -0
- package/dist/compiler/projectManifestGraph.js +24 -0
- package/dist/compiler/runProject.d.ts +4 -0
- package/dist/compiler/runProject.js +30 -21
- package/dist/compiler/runProjectAuth.d.ts +7 -1
- package/dist/compiler/runProjectAuth.js +87 -9
- package/dist/compiler/runProjectDocker.d.ts +7 -0
- package/dist/compiler/runProjectDocker.js +31 -8
- package/dist/compiler/runProjectLifecycle.d.ts +7 -0
- package/dist/compiler/runProjectLifecycle.js +40 -0
- package/dist/compiler/syncProjectAuth.js +4 -1
- package/dist/compiler/teamContextActiveEnvironments.d.ts +13 -0
- package/dist/compiler/teamContextActiveEnvironments.js +255 -0
- package/dist/compiler/teamContextSupport.js +32 -40
- package/dist/compiler/teamContextTypes.d.ts +2 -0
- package/dist/compiler/types.d.ts +82 -1
- package/dist/compiler/upProject.d.ts +5 -0
- package/dist/compiler/upProject.js +256 -20
- package/dist/compiler/upReceipt.d.ts +36 -0
- package/dist/compiler/upReceipt.js +82 -0
- package/dist/compiler/updateProjectModels.js +42 -60
- package/dist/compiler/updateProjectRuntime.js +22 -35
- package/dist/compiler/updateProjectSurfaces.js +53 -47
- package/dist/compiler/worldBindings.d.ts +39 -0
- package/dist/compiler/worldBindings.js +247 -0
- package/dist/compiler/worldBindingsFile.d.ts +5 -0
- package/dist/compiler/worldBindingsFile.js +162 -0
- package/dist/deployment/artifactsExport.d.ts +49 -0
- package/dist/deployment/artifactsExport.js +217 -0
- package/dist/deployment/artifactsExportDocker.d.ts +48 -0
- package/dist/deployment/artifactsExportDocker.js +91 -0
- package/dist/deployment/artifactsExportPlan.d.ts +24 -0
- package/dist/deployment/artifactsExportPlan.js +135 -0
- package/dist/deployment/artifactsExportTypes.d.ts +50 -0
- package/dist/deployment/artifactsExportTypes.js +52 -0
- package/dist/deployment/buildImageCacheStore.d.ts +23 -0
- package/dist/deployment/buildImageCacheStore.js +54 -0
- package/dist/deployment/deploymentLifecycleCorrelation.d.ts +11 -0
- package/dist/deployment/deploymentLifecycleCorrelation.js +33 -0
- package/dist/deployment/dockerInspect.d.ts +9 -0
- package/dist/deployment/dockerInspect.js +24 -1
- package/dist/deployment/dockerLabels.d.ts +2 -0
- package/dist/deployment/dockerLabels.js +2 -0
- package/dist/deployment/dockerLogs.js +2 -10
- package/dist/deployment/dockerManager.d.ts +51 -0
- package/dist/deployment/dockerManager.js +118 -1
- package/dist/deployment/dockerProbeGateway.js +64 -5
- package/dist/deployment/dockerRecover.js +9 -1
- package/dist/deployment/dockerTeardown.d.ts +32 -0
- package/dist/deployment/dockerTeardown.js +61 -0
- package/dist/deployment/downDeployment.d.ts +34 -0
- package/dist/deployment/downDeployment.js +147 -0
- package/dist/deployment/downReceiptTypes.d.ts +21 -0
- package/dist/deployment/downReceiptTypes.js +30 -0
- package/dist/deployment/index.d.ts +16 -0
- package/dist/deployment/index.js +17 -0
- package/dist/deployment/lifecycleCompletion.d.ts +37 -0
- package/dist/deployment/lifecycleCompletion.js +236 -0
- package/dist/deployment/lifecycleCompletionContracts.d.ts +158 -0
- package/dist/deployment/lifecycleCompletionContracts.js +106 -0
- package/dist/deployment/lifecycleCompletionHeartbeat.d.ts +2 -0
- package/dist/deployment/lifecycleCompletionHeartbeat.js +50 -0
- package/dist/deployment/lifecycleCompletionLookup.d.ts +18 -0
- package/dist/deployment/lifecycleCompletionLookup.js +88 -0
- package/dist/deployment/lifecycleCompletionOwner.d.ts +8 -0
- package/dist/deployment/lifecycleCompletionOwner.js +31 -0
- package/dist/deployment/lifecycleCompletionParsing.d.ts +12 -0
- package/dist/deployment/lifecycleCompletionParsing.js +108 -0
- package/dist/deployment/lifecycleCompletionPaths.d.ts +9 -0
- package/dist/deployment/lifecycleCompletionPaths.js +16 -0
- package/dist/deployment/lifecycleCompletionPublication.d.ts +5 -0
- package/dist/deployment/lifecycleCompletionPublication.js +35 -0
- package/dist/deployment/lifecycleCompletionRecovery.d.ts +21 -0
- package/dist/deployment/lifecycleCompletionRecovery.js +56 -0
- package/dist/deployment/lifecycleCompletionRoot.d.ts +21 -0
- package/dist/deployment/lifecycleCompletionRoot.js +243 -0
- package/dist/deployment/lifecycleCompletionStore.d.ts +6 -0
- package/dist/deployment/lifecycleCompletionStore.js +151 -0
- package/dist/deployment/organizationHandoffAuthorityFsClient.d.ts +17 -0
- package/dist/deployment/organizationHandoffAuthorityFsClient.js +132 -0
- package/dist/deployment/organizationHandoffAuthorityFsWorker.d.ts +1 -0
- package/dist/deployment/organizationHandoffAuthorityFsWorker.js +285 -0
- package/dist/deployment/organizationHandoffAuthorityFsWorkerParent.fixture.d.ts +1 -0
- package/dist/deployment/organizationHandoffAuthorityFsWorkerParent.fixture.js +26 -0
- package/dist/deployment/organizationHandoffAuthorityStore.d.ts +41 -0
- package/dist/deployment/organizationHandoffAuthorityStore.js +348 -0
- package/dist/deployment/organizationHandoffAuthorityTypes.d.ts +76 -0
- package/dist/deployment/organizationHandoffAuthorityTypes.js +148 -0
- package/dist/deployment/organizationHandoffTypes.d.ts +29 -0
- package/dist/deployment/organizationHandoffTypes.js +80 -0
- package/dist/deployment/organizationReady.d.ts +52 -0
- package/dist/deployment/organizationReady.js +200 -0
- package/dist/deployment/privateArtifactsExport.d.ts +18 -0
- package/dist/deployment/privateArtifactsExport.js +80 -0
- package/dist/deployment/providerRuntimeBoundaryScanner.test-helper.d.ts +8 -0
- package/dist/deployment/providerRuntimeBoundaryScanner.test-helper.js +60 -0
- package/dist/deployment/record.d.ts +26 -1
- package/dist/deployment/record.js +49 -4
- package/dist/deployment/simfileFixtureBoundary.test-helper.d.ts +8 -0
- package/dist/deployment/simfileFixtureBoundary.test-helper.js +103 -0
- package/dist/deployment/target.d.ts +1 -35
- package/dist/deployment/target.js +1 -96
- package/dist/deployment/upReceiptTypes.d.ts +111 -0
- package/dist/deployment/upReceiptTypes.js +164 -0
- package/dist/dev/project.js +15 -9
- package/dist/distribution/buildDistributionReport.d.ts +2 -1
- package/dist/distribution/buildDistributionReport.js +2 -1
- package/dist/distribution/distributionReportSchema.d.ts +5 -0
- package/dist/distribution/distributionReportSchema.js +7 -2
- package/dist/distribution/index.d.ts +2 -2
- package/dist/distribution/index.js +1 -1
- package/dist/distribution/types.d.ts +7 -0
- package/dist/distribution/types.js +1 -0
- package/dist/filesystem/paths.js +10 -1
- package/dist/ledger/causalConformanceCli.d.ts +1 -0
- package/dist/ledger/causalConformanceCli.js +41 -0
- package/dist/ledger/causeNamespace.d.ts +8 -0
- package/dist/ledger/causeNamespace.js +24 -0
- package/dist/ledger/conformance.d.ts +83 -0
- package/dist/ledger/conformance.js +259 -0
- package/dist/ledger/emitters.d.ts +76 -0
- package/dist/ledger/emitters.js +188 -0
- package/dist/ledger/index.d.ts +4 -0
- package/dist/ledger/index.js +4 -0
- package/dist/ledger/principal.d.ts +96 -0
- package/dist/ledger/principal.js +121 -0
- package/dist/manifest/externalParticipantSchemas.d.ts +18 -0
- package/dist/manifest/externalParticipantSchemas.js +17 -0
- package/dist/manifest/index.d.ts +1 -0
- package/dist/manifest/index.js +1 -0
- package/dist/manifest/inlineAgentMember.d.ts +2 -0
- package/dist/manifest/inlineAgentMember.js +9 -0
- package/dist/manifest/loadManifest.js +14 -8
- package/dist/manifest/mcpSchemas.d.ts +17 -0
- package/dist/manifest/mcpSchemas.js +41 -0
- package/dist/manifest/memorySchemas.d.ts +245 -0
- package/dist/manifest/memorySchemas.js +148 -0
- package/dist/manifest/renderSpawnfile.js +22 -131
- package/dist/manifest/renderSpawnfileNetworks.js +9 -2
- package/dist/manifest/renderSpawnfileSurfaces.d.ts +2 -0
- package/dist/manifest/renderSpawnfileSurfaces.js +134 -0
- package/dist/manifest/schemas.d.ts +1868 -99
- package/dist/manifest/schemas.js +78 -32
- package/dist/manifest/surfaceSchemas.d.ts +17 -0
- package/dist/manifest/surfaceSchemas.js +24 -1
- package/dist/manifest/teamNetworkAccessSchemas.d.ts +1 -1
- package/dist/manifest/teamNetworkAuthSchemas.d.ts +48 -0
- package/dist/manifest/teamNetworkAuthSchemas.js +103 -0
- package/dist/manifest/teamNetworkSchemas.d.ts +8 -187
- package/dist/manifest/teamNetworkSchemas.js +3 -317
- package/dist/manifest/teamNetworkServerSchemas.d.ts +150 -0
- package/dist/manifest/teamNetworkServerSchemas.js +199 -0
- package/dist/ownership/siblingBuildFreshness.d.ts +20 -0
- package/dist/ownership/siblingBuildFreshness.js +20 -0
- package/dist/ownership/simfileRunOperatorInputs.d.ts +103 -0
- package/dist/ownership/simfileRunOperatorInputs.js +139 -0
- package/dist/report/types.d.ts +142 -0
- package/dist/runtime/common.d.ts +35 -0
- package/dist/runtime/common.js +55 -0
- package/dist/runtime/container.d.ts +28 -1
- package/dist/runtime/container.js +38 -5
- package/dist/runtime/containerPackageOverrides.d.ts +37 -0
- package/dist/runtime/containerPackageOverrides.js +33 -0
- package/dist/runtime/index.d.ts +2 -0
- package/dist/runtime/index.js +2 -0
- package/dist/runtime/mnemeMcp.d.ts +15 -0
- package/dist/runtime/mnemeMcp.js +109 -0
- package/dist/runtime/openclaw/adapter.js +15 -4
- package/dist/runtime/openclaw/mcp.d.ts +10 -0
- package/dist/runtime/openclaw/mcp.js +69 -0
- package/dist/runtime/openclaw/runAuth.js +2 -2
- package/dist/runtime/openclaw/scaffold.js +1 -1
- package/dist/runtime/openclaw/schedules.d.ts +38 -0
- package/dist/runtime/openclaw/schedules.js +74 -0
- package/dist/runtime/pi/adapter.d.ts +1 -1
- package/dist/runtime/pi/adapter.js +86 -53
- package/dist/runtime/pi/appActivitySource.js +114 -2
- package/dist/runtime/pi/appAgentConfig.d.ts +11 -0
- package/dist/runtime/pi/appAgentConfig.js +264 -0
- package/dist/runtime/pi/appCliEnginesSource.d.ts +1 -0
- package/dist/runtime/pi/appCliEnginesSource.js +183 -0
- package/dist/runtime/pi/appCliSource.d.ts +1 -0
- package/dist/runtime/pi/appCliSource.js +353 -0
- package/dist/runtime/pi/appControlSource.d.ts +1 -0
- package/dist/runtime/pi/appControlSource.js +390 -0
- package/dist/runtime/pi/appControlWakeIdentitySource.d.ts +1 -0
- package/dist/runtime/pi/appControlWakeIdentitySource.js +19 -0
- package/dist/runtime/pi/appCoreSource.d.ts +4 -1
- package/dist/runtime/pi/appCoreSource.js +104 -214
- package/dist/runtime/pi/appPreludeSource.js +140 -52
- package/dist/runtime/pi/appScheduleSource.d.ts +1 -0
- package/dist/runtime/pi/appScheduleSource.js +80 -0
- package/dist/runtime/pi/appScriptedEngine.d.ts +31 -0
- package/dist/runtime/pi/appScriptedEngine.js +42 -0
- package/dist/runtime/pi/appSource.d.ts +4 -1
- package/dist/runtime/pi/appSource.js +6 -2
- package/dist/runtime/pi/appTemplate.d.ts +8 -22
- package/dist/runtime/pi/appTemplate.js +9 -126
- package/dist/runtime/pi/appTemplateTypes.d.ts +64 -0
- package/dist/runtime/pi/appTemplateTypes.js +18 -0
- package/dist/runtime/pi/appWakeContextSource.d.ts +1 -0
- package/dist/runtime/pi/appWakeContextSource.js +398 -0
- package/dist/runtime/pi/containerTargets.d.ts +4 -0
- package/dist/runtime/pi/containerTargets.js +57 -0
- package/dist/runtime/pi/runAuth.js +126 -9
- package/dist/runtime/pi/testHelpers.d.ts +2 -0
- package/dist/runtime/pi/testHelpers.js +40 -0
- package/dist/runtime/picoclaw/adapter.js +23 -27
- package/dist/runtime/picoclaw/mcp.d.ts +4 -0
- package/dist/runtime/picoclaw/mcp.js +43 -0
- package/dist/runtime/picoclaw/memory.d.ts +7 -0
- package/dist/runtime/picoclaw/memory.js +17 -0
- package/dist/runtime/picoclaw/runAuth.js +1 -1
- package/dist/runtime/picoclaw/scaffold.js +1 -1
- package/dist/runtime/picoclaw/schedules.d.ts +26 -0
- package/dist/runtime/picoclaw/schedules.js +62 -3
- package/dist/runtime/scheduleUtils.d.ts +2 -0
- package/dist/runtime/scheduleUtils.js +15 -0
- package/dist/runtime/types.d.ts +25 -2
- package/dist/shared/errors.d.ts +1 -1
- package/dist/shared/errors.js +2 -2
- package/dist/shared/index.d.ts +1 -0
- package/dist/shared/index.js +1 -0
- package/dist/shared/redaction.d.ts +2 -0
- package/dist/shared/redaction.js +10 -0
- package/dist/status/buildStatus.d.ts +1 -0
- package/dist/status/buildStatus.js +2 -0
- package/dist/status/compileReport.d.ts +22 -0
- package/dist/status/compileReport.js +16 -2
- package/dist/status/compiledProbeCollection.d.ts +21 -0
- package/dist/status/compiledProbeCollection.js +27 -0
- package/dist/status/imageStatusReport.js +6 -0
- package/dist/status/index.d.ts +3 -0
- package/dist/status/index.js +3 -0
- package/dist/status/lifecycleProbes.d.ts +19 -0
- package/dist/status/lifecycleProbes.js +174 -0
- package/dist/status/moltnetProbes.d.ts +7 -8
- package/dist/status/moltnetProbes.js +27 -198
- package/dist/status/moltnetWiringProbes.d.ts +19 -0
- package/dist/status/moltnetWiringProbes.js +178 -0
- package/dist/target/cleanupRun.d.ts +41 -0
- package/dist/target/cleanupRun.js +139 -0
- package/dist/target/cleanupRunDocker.d.ts +16 -0
- package/dist/target/cleanupRunDocker.js +66 -0
- package/dist/target/cleanupRunDocker.test-helper.d.ts +67 -0
- package/dist/target/cleanupRunDocker.test-helper.js +238 -0
- package/dist/target/cleanupRunDockerPreflight.d.ts +17 -0
- package/dist/target/cleanupRunDockerPreflight.js +224 -0
- package/dist/target/composedPreparation.d.ts +205 -0
- package/dist/target/composedPreparation.js +223 -0
- package/dist/target/containerBundle.d.ts +82 -0
- package/dist/target/containerBundle.js +243 -0
- package/dist/target/containerBundleArchive.d.ts +31 -0
- package/dist/target/containerBundleArchive.js +140 -0
- package/dist/target/containerBundleAuthority.d.ts +25 -0
- package/dist/target/containerBundleAuthority.js +65 -0
- package/dist/target/containerBundleContracts.d.ts +114 -0
- package/dist/target/containerBundleContracts.js +173 -0
- package/dist/target/containerBundleFilesystemStore.d.ts +3 -0
- package/dist/target/containerBundleFilesystemStore.js +247 -0
- package/dist/target/containerBundlePolicy.d.ts +33 -0
- package/dist/target/containerBundlePolicy.js +64 -0
- package/dist/target/containerBundleStore.d.ts +127 -0
- package/dist/target/containerBundleStore.js +284 -0
- package/dist/target/contracts.d.ts +538 -0
- package/dist/target/contracts.js +373 -0
- package/dist/target/dockerArtifactIdentityTypes.d.ts +56 -0
- package/dist/target/dockerArtifactIdentityTypes.js +1 -0
- package/dist/target/dockerArtifactInspection.d.ts +40 -0
- package/dist/target/dockerArtifactInspection.js +125 -0
- package/dist/target/dockerArtifacts.d.ts +21 -0
- package/dist/target/dockerArtifacts.js +110 -0
- package/dist/target/dockerArtifactsProvider.d.ts +41 -0
- package/dist/target/dockerArtifactsProvider.js +449 -0
- package/dist/target/dockerCommandExecutor.d.ts +27 -0
- package/dist/target/dockerCommandExecutor.js +200 -0
- package/dist/target/dockerCommandExecutorCore.d.ts +34 -0
- package/dist/target/dockerCommandExecutorCore.js +273 -0
- package/dist/target/dockerContainerBundleBuilder.d.ts +8 -0
- package/dist/target/dockerContainerBundleBuilder.js +256 -0
- package/dist/target/dockerContextSnapshot.d.ts +21 -0
- package/dist/target/dockerContextSnapshot.js +158 -0
- package/dist/target/dockerEndpointFingerprint.d.ts +1 -0
- package/dist/target/dockerEndpointFingerprint.js +9 -0
- package/dist/target/dockerPreparedArtifact.d.ts +48 -0
- package/dist/target/dockerPreparedArtifact.js +131 -0
- package/dist/target/dockerProjectionJson.d.ts +1 -0
- package/dist/target/dockerProjectionJson.js +80 -0
- package/dist/target/dockerPublicArtifactSnapshot.d.ts +17 -0
- package/dist/target/dockerPublicArtifactSnapshot.js +99 -0
- package/dist/target/dockerResources.d.ts +26 -0
- package/dist/target/dockerResources.js +162 -0
- package/dist/target/dockerResourcesProvider.d.ts +44 -0
- package/dist/target/dockerResourcesProvider.js +207 -0
- package/dist/target/dockerSecrets.d.ts +39 -0
- package/dist/target/dockerSecrets.js +249 -0
- package/dist/target/dockerSecretsAuthority.d.ts +26 -0
- package/dist/target/dockerSecretsAuthority.js +216 -0
- package/dist/target/dockerSecretsLifecycle.d.ts +25 -0
- package/dist/target/dockerSecretsLifecycle.js +133 -0
- package/dist/target/dockerSecretsProvider.d.ts +68 -0
- package/dist/target/dockerSecretsProvider.js +329 -0
- package/dist/target/dockerTarget.d.ts +52 -0
- package/dist/target/dockerTarget.js +48 -0
- package/dist/target/dockerTargetBinding.d.ts +14 -0
- package/dist/target/dockerTargetBinding.js +96 -0
- package/dist/target/dockerWorldClock.d.ts +17 -0
- package/dist/target/dockerWorldClock.js +111 -0
- package/dist/target/dockerWorldReadiness.d.ts +17 -0
- package/dist/target/dockerWorldReadiness.js +119 -0
- package/dist/target/dockerWorldService.d.ts +23 -0
- package/dist/target/dockerWorldService.js +216 -0
- package/dist/target/dockerWorldServiceAuthority.d.ts +80 -0
- package/dist/target/dockerWorldServiceAuthority.js +182 -0
- package/dist/target/dockerWorldServiceLifecycle.d.ts +41 -0
- package/dist/target/dockerWorldServiceLifecycle.js +275 -0
- package/dist/target/dockerWorldServiceProvider.d.ts +60 -0
- package/dist/target/dockerWorldServiceProvider.js +318 -0
- package/dist/target/dockerWorldServiceStore.d.ts +73 -0
- package/dist/target/dockerWorldServiceStore.js +367 -0
- package/dist/target/evidenceExport.d.ts +55 -0
- package/dist/target/evidenceExport.js +518 -0
- package/dist/target/evidenceExportArchive.d.ts +10 -0
- package/dist/target/evidenceExportArchive.js +302 -0
- package/dist/target/evidenceExportContract.d.ts +27 -0
- package/dist/target/evidenceExportContract.js +40 -0
- package/dist/target/evidenceExportOperationsTestKit.d.ts +87 -0
- package/dist/target/evidenceExportOperationsTestKit.js +312 -0
- package/dist/target/evidenceExportProvider.d.ts +85 -0
- package/dist/target/evidenceExportProvider.js +187 -0
- package/dist/target/evidenceExportPublicationTypes.d.ts +16 -0
- package/dist/target/evidenceExportPublicationTypes.js +1 -0
- package/dist/target/evidenceExportStore.d.ts +70 -0
- package/dist/target/evidenceExportStore.js +498 -0
- package/dist/target/evidenceExportStorePublication.d.ts +7 -0
- package/dist/target/evidenceExportStorePublication.js +395 -0
- package/dist/target/handles.d.ts +20 -0
- package/dist/target/handles.js +56 -0
- package/dist/target/index.d.ts +12 -0
- package/dist/target/index.js +11 -0
- package/dist/target/journal.d.ts +59 -0
- package/dist/target/journal.js +529 -0
- package/dist/target/journalFilesystem.d.ts +3 -0
- package/dist/target/journalFilesystem.js +111 -0
- package/dist/target/journalRoot.d.ts +4 -0
- package/dist/target/journalRoot.js +6 -0
- package/dist/target/organizationAttachment.d.ts +23 -0
- package/dist/target/organizationAttachment.js +263 -0
- package/dist/target/organizationAttachmentAuthority.d.ts +65 -0
- package/dist/target/organizationAttachmentAuthority.js +161 -0
- package/dist/target/organizationAttachmentLifecycle.d.ts +17 -0
- package/dist/target/organizationAttachmentLifecycle.js +101 -0
- package/dist/target/organizationAttachmentProvider.d.ts +76 -0
- package/dist/target/organizationAttachmentProvider.js +289 -0
- package/dist/target/organizationAttachmentStore.d.ts +51 -0
- package/dist/target/organizationAttachmentStore.js +316 -0
- package/dist/target/publicArtifactSnapshot.d.ts +41 -0
- package/dist/target/publicArtifactSnapshot.js +150 -0
- package/dist/target/topologyActivation.d.ts +51 -0
- package/dist/target/topologyActivation.js +149 -0
- package/dist/target/topologyAttestation.d.ts +37 -0
- package/dist/target/topologyAttestation.js +300 -0
- package/dist/target/topologyAttestationErrors.d.ts +1 -0
- package/dist/target/topologyAttestationErrors.js +1 -0
- package/dist/target/worldClock.d.ts +60 -0
- package/dist/target/worldClock.js +129 -0
- package/dist/target/worldReadiness.d.ts +103 -0
- package/dist/target/worldReadiness.js +153 -0
- package/moltnet-releases.json +20 -0
- package/package.json +27 -11
- package/runtimes.yaml +8 -23
- package/dist/runtime/openclaw/scaffold-assets/CLAUDE.md +0 -5
- package/dist/runtime/picoclaw/scaffold-assets/CLAUDE.md +0 -5
- /package/dist/runtime/openclaw/scaffold-assets/{AGENTS.md → WORKSPACE_AGENTS.md} +0 -0
- /package/dist/runtime/picoclaw/scaffold-assets/{AGENTS.md → WORKSPACE_AGENTS.md} +0 -0
|
@@ -0,0 +1,398 @@
|
|
|
1
|
+
export const renderPiWakeContextSource = () => String.raw `const TEAM_CONTEXTS_FILE = ".spawnfile/team-contexts.yaml";
|
|
2
|
+
const TEAM_CONTEXT_INDEX_CACHE = new Map();
|
|
3
|
+
const TEAM_CONTEXT_INDEX_PROMISES = new Map();
|
|
4
|
+
|
|
5
|
+
const asString = (value) => (typeof value === "string" ? value.trim() : "");
|
|
6
|
+
const asStringOrUndefined = (value) => {
|
|
7
|
+
const text = asString(value);
|
|
8
|
+
return text.length > 0 ? text : undefined;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const asStringList = (value) => {
|
|
12
|
+
if (!Array.isArray(value)) {
|
|
13
|
+
return [];
|
|
14
|
+
}
|
|
15
|
+
return [...new Set(value.map(asString).filter((entry) => entry.length > 0))];
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const asObject = (value) => value !== null && typeof value === "object" && !Array.isArray(value) ? value : undefined;
|
|
19
|
+
|
|
20
|
+
const asMemoryScopeText = (value) => {
|
|
21
|
+
const scope = asStringOrUndefined(value?.scope);
|
|
22
|
+
const qualifier = asStringOrUndefined(value?.qualifier);
|
|
23
|
+
if (!scope || !qualifier) {
|
|
24
|
+
return undefined;
|
|
25
|
+
}
|
|
26
|
+
return scope + ":" + qualifier;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const parseLegacyMoltnetContextId = (contextId) => {
|
|
30
|
+
const value = asString(contextId);
|
|
31
|
+
const match = /^moltnet:([^:]+):room:([^:]+)(?::thread:([^:]+))?$/u.exec(value);
|
|
32
|
+
if (!match) {
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return {
|
|
37
|
+
networkId: asString(match[1]),
|
|
38
|
+
roomId: asString(match[2]),
|
|
39
|
+
threadId: asString(match[3] ?? "")
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const parseWakeContext = (payload) => {
|
|
44
|
+
const context = asObject(payload.context) ? payload.context : {};
|
|
45
|
+
const legacy = parseLegacyMoltnetContextId(payload.context_id);
|
|
46
|
+
const senderId = asStringOrUndefined(context.sender_id ?? context.senderId ?? context.from ?? payload.from);
|
|
47
|
+
|
|
48
|
+
const networkId = asStringOrUndefined(context.networkId ?? context.network ?? legacy?.networkId);
|
|
49
|
+
const roomId = asStringOrUndefined(context.roomId ?? context.room ?? context.channel ?? legacy?.roomId);
|
|
50
|
+
const threadId = asStringOrUndefined(context.threadId ?? context.thread ?? legacy?.threadId);
|
|
51
|
+
|
|
52
|
+
const resolved = {
|
|
53
|
+
artifactPaths: asStringList(context.artifactPaths ?? context.artifacts),
|
|
54
|
+
from: asStringOrUndefined(context.from),
|
|
55
|
+
networkId,
|
|
56
|
+
roomId,
|
|
57
|
+
surface: asStringOrUndefined(context.surface) || (networkId ? "moltnet" : undefined),
|
|
58
|
+
taskId: asStringOrUndefined(context.taskId ?? context.task),
|
|
59
|
+
teamId: asStringOrUndefined(context.teamId ?? context.team),
|
|
60
|
+
threadId,
|
|
61
|
+
roleId: asStringOrUndefined(context.roleId ?? context.role),
|
|
62
|
+
pairPeers: asStringList(context.pairPeers ?? context.participants),
|
|
63
|
+
participants: asStringList(context.participants ?? context.pairPeers)
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
if (senderId) {
|
|
67
|
+
if (resolved.pairPeers.length === 0) {
|
|
68
|
+
resolved.pairPeers = [senderId];
|
|
69
|
+
resolved.participants = [senderId];
|
|
70
|
+
}
|
|
71
|
+
if (resolved.from === undefined) {
|
|
72
|
+
resolved.from = senderId;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return {
|
|
77
|
+
senderId,
|
|
78
|
+
context: resolved
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
const readTeamContextIndex = async (workspacePath) => {
|
|
83
|
+
if (TEAM_CONTEXT_INDEX_CACHE.has(workspacePath)) {
|
|
84
|
+
return TEAM_CONTEXT_INDEX_CACHE.get(workspacePath);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (TEAM_CONTEXT_INDEX_PROMISES.has(workspacePath)) {
|
|
88
|
+
return TEAM_CONTEXT_INDEX_PROMISES.get(workspacePath);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const load = (async () => {
|
|
92
|
+
try {
|
|
93
|
+
const indexPath = path.join(workspacePath, TEAM_CONTEXTS_FILE);
|
|
94
|
+
const text = await readFile(indexPath, "utf8");
|
|
95
|
+
const { parse: parseYaml } = await import("yaml");
|
|
96
|
+
const parsed = parseYaml(text);
|
|
97
|
+
const index = asObject(parsed) ? parsed : {};
|
|
98
|
+
TEAM_CONTEXT_INDEX_CACHE.set(workspacePath, index);
|
|
99
|
+
return index;
|
|
100
|
+
} catch {
|
|
101
|
+
TEAM_CONTEXT_INDEX_CACHE.set(workspacePath, undefined);
|
|
102
|
+
return undefined;
|
|
103
|
+
} finally {
|
|
104
|
+
TEAM_CONTEXT_INDEX_PROMISES.delete(workspacePath);
|
|
105
|
+
}
|
|
106
|
+
})();
|
|
107
|
+
|
|
108
|
+
TEAM_CONTEXT_INDEX_PROMISES.set(workspacePath, load);
|
|
109
|
+
return load;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
const resolveRoomEnvironmentFromIndex = (index, networkId, roomId, threadId) => {
|
|
113
|
+
const activeRooms = asObject(asObject(index)?.active_environments)?.moltnet;
|
|
114
|
+
const activeEntry = asObject(activeRooms?.[networkId]?.rooms?.[roomId]);
|
|
115
|
+
if (activeEntry) {
|
|
116
|
+
return {
|
|
117
|
+
teamId: asStringOrUndefined(activeEntry.team_id),
|
|
118
|
+
team_doc: asStringOrUndefined(activeEntry.team_doc),
|
|
119
|
+
roster: asStringOrUndefined(activeEntry.roster),
|
|
120
|
+
session_key: asStringOrUndefined(activeEntry.session_key),
|
|
121
|
+
context_key: asStringOrUndefined(activeEntry.context_key),
|
|
122
|
+
member_slot: asStringOrUndefined(activeEntry.member_slot),
|
|
123
|
+
team_scope: asMemoryScopeText(activeEntry.memory?.durable_scope),
|
|
124
|
+
room_scope: asMemoryScopeText(activeEntry.memory?.ephemeral_scope),
|
|
125
|
+
thread_scope: threadId ? "thread:" + networkId + ":" + roomId + ":" + threadId : undefined
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
const membershipEntries = [
|
|
130
|
+
...(Array.isArray(index?.direct_memberships) ? index.direct_memberships : []),
|
|
131
|
+
...(Array.isArray(index?.representations) ? index.representations : [])
|
|
132
|
+
];
|
|
133
|
+
|
|
134
|
+
for (const entry of membershipEntries) {
|
|
135
|
+
const resolvedEntry = asObject(entry);
|
|
136
|
+
if (!resolvedEntry) {
|
|
137
|
+
continue;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const bindings = Array.isArray(resolvedEntry.surfaces?.moltnet)
|
|
141
|
+
? resolvedEntry.surfaces.moltnet
|
|
142
|
+
: [];
|
|
143
|
+
|
|
144
|
+
for (const binding of bindings) {
|
|
145
|
+
const resolvedBinding = asObject(binding);
|
|
146
|
+
if (!resolvedBinding) {
|
|
147
|
+
continue;
|
|
148
|
+
}
|
|
149
|
+
const bindingNetwork = asStringOrUndefined(resolvedBinding.network);
|
|
150
|
+
const rooms = asStringList(resolvedBinding.rooms);
|
|
151
|
+
if (bindingNetwork !== networkId || !rooms.includes(roomId)) {
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
return {
|
|
156
|
+
teamId: asStringOrUndefined(resolvedEntry.team),
|
|
157
|
+
team_doc: asStringOrUndefined(resolvedEntry.team_doc),
|
|
158
|
+
roster: asStringOrUndefined(resolvedEntry.roster),
|
|
159
|
+
team_scope: asStringOrUndefined(resolvedEntry.team)
|
|
160
|
+
? "team:" + asStringOrUndefined(resolvedEntry.team)
|
|
161
|
+
: undefined,
|
|
162
|
+
room_scope: networkId && roomId ? "room:" + networkId + ":" + roomId : undefined,
|
|
163
|
+
thread_scope: threadId ? "thread:" + networkId + ":" + roomId + ":" + threadId : undefined,
|
|
164
|
+
context_key: asStringOrUndefined(resolvedEntry.context_key),
|
|
165
|
+
member_slot: asStringOrUndefined(resolvedEntry.member ?? resolvedEntry.representative)
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
return undefined;
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
const resolveScheduleContextFromIndex = (index) => {
|
|
174
|
+
const activeSchedules = asObject(asObject(asObject(index)?.active_environments)?.schedules);
|
|
175
|
+
const defaultSchedule = asObject(activeSchedules?.default);
|
|
176
|
+
|
|
177
|
+
if (defaultSchedule) {
|
|
178
|
+
const contextKey = asStringOrUndefined(defaultSchedule.context_key);
|
|
179
|
+
const membershipEntries = [
|
|
180
|
+
...(Array.isArray(index?.direct_memberships) ? index.direct_memberships : []),
|
|
181
|
+
...(Array.isArray(index?.representations) ? index.representations : [])
|
|
182
|
+
];
|
|
183
|
+
const matched = contextKey
|
|
184
|
+
? membershipEntries.find((entry) => asStringOrUndefined(entry?.context_key) === contextKey)
|
|
185
|
+
: undefined;
|
|
186
|
+
|
|
187
|
+
const resolvedMatch = asObject(matched);
|
|
188
|
+
|
|
189
|
+
if (contextKey === "self") {
|
|
190
|
+
return {
|
|
191
|
+
context_key: "self",
|
|
192
|
+
team_scope: asMemoryScopeText(defaultSchedule.memory?.durable_scope)
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
return {
|
|
197
|
+
teamId: asStringOrUndefined(resolvedMatch?.team) ?? contextKey,
|
|
198
|
+
team_doc: asStringOrUndefined(resolvedMatch?.team_doc),
|
|
199
|
+
roster: asStringOrUndefined(resolvedMatch?.roster),
|
|
200
|
+
context_key: contextKey,
|
|
201
|
+
member_slot: asStringOrUndefined(resolvedMatch?.member ?? resolvedMatch?.representative),
|
|
202
|
+
team_scope: asMemoryScopeText(defaultSchedule.memory?.durable_scope),
|
|
203
|
+
session_key: asStringOrUndefined(defaultSchedule.session_key)
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
if (!Array.isArray(index?.direct_memberships) || index.direct_memberships.length !== 1) {
|
|
208
|
+
return undefined;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
const entry = asObject(index.direct_memberships[0]);
|
|
212
|
+
if (!entry) {
|
|
213
|
+
return undefined;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
return {
|
|
217
|
+
teamId: asStringOrUndefined(entry.team),
|
|
218
|
+
team_doc: asStringOrUndefined(entry.team_doc),
|
|
219
|
+
roster: asStringOrUndefined(entry.roster),
|
|
220
|
+
context_key: asStringOrUndefined(entry.context_key),
|
|
221
|
+
member_slot: asStringOrUndefined(entry.member),
|
|
222
|
+
team_scope: asStringOrUndefined(entry.team)
|
|
223
|
+
? "team:" + asStringOrUndefined(entry.team)
|
|
224
|
+
: undefined
|
|
225
|
+
};
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
const resolveDreamContextFromIndex = (index, environmentKey) => {
|
|
229
|
+
const activeDreams = asObject(asObject(asObject(index)?.active_environments)?.dreams);
|
|
230
|
+
if (!activeDreams) {
|
|
231
|
+
return undefined;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
const membershipEntries = [
|
|
235
|
+
...(Array.isArray(index?.direct_memberships) ? index.direct_memberships : []),
|
|
236
|
+
...(Array.isArray(index?.representations) ? index.representations : [])
|
|
237
|
+
];
|
|
238
|
+
|
|
239
|
+
const explicit = environmentKey ? asObject(activeDreams[environmentKey]) : undefined;
|
|
240
|
+
const selectedKey = explicit
|
|
241
|
+
? environmentKey
|
|
242
|
+
: Object.keys(activeDreams).length === 1
|
|
243
|
+
? Object.keys(activeDreams)[0]
|
|
244
|
+
: "self";
|
|
245
|
+
const selected = asObject(activeDreams[selectedKey]);
|
|
246
|
+
if (!selected) {
|
|
247
|
+
return undefined;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
const contextKey = asStringOrUndefined(selected.context_key);
|
|
251
|
+
const matched = contextKey
|
|
252
|
+
? membershipEntries.find((member) => asStringOrUndefined(member?.context_key) === contextKey)
|
|
253
|
+
: undefined;
|
|
254
|
+
|
|
255
|
+
const resolvedMatch = asObject(matched);
|
|
256
|
+
const teamScopeText = asMemoryScopeText(selected.memory?.durable_scope);
|
|
257
|
+
|
|
258
|
+
return {
|
|
259
|
+
context_key: contextKey,
|
|
260
|
+
environment_key: asStringOrUndefined(selected.environment_key),
|
|
261
|
+
session_key_template: asStringOrUndefined(selected.session_key_template),
|
|
262
|
+
team_scope: teamScopeText,
|
|
263
|
+
teamId: teamScopeText?.startsWith("team:") ? teamScopeText.slice(5) : asStringOrUndefined(resolvedMatch?.team) ?? (contextKey === "self" ? undefined : contextKey),
|
|
264
|
+
team_doc: asStringOrUndefined(resolvedMatch?.team_doc),
|
|
265
|
+
roster: asStringOrUndefined(resolvedMatch?.roster),
|
|
266
|
+
member_slot: asStringOrUndefined(resolvedMatch?.member ?? resolvedMatch?.representative)
|
|
267
|
+
};
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
const listDreamEnvironmentKeys = async (workspacePath) => {
|
|
271
|
+
const index = await readTeamContextIndex(workspacePath);
|
|
272
|
+
const activeDreams = asObject(asObject(asObject(index)?.active_environments)?.dreams);
|
|
273
|
+
return activeDreams ? Object.keys(activeDreams).sort() : ["self"];
|
|
274
|
+
};
|
|
275
|
+
|
|
276
|
+
const buildRuntimeContextForWake = (payload) => {
|
|
277
|
+
const parsed = parseWakeContext(payload);
|
|
278
|
+
const messageFrom = asStringOrUndefined(payload.from);
|
|
279
|
+
const kind = normalizeWakeKind(typeof payload.wake_kind === "string" ? payload.wake_kind : payload.kind);
|
|
280
|
+
const isMessageWake = kind === "message" || kind === "manual";
|
|
281
|
+
const surface = parsed.context.surface;
|
|
282
|
+
const isMoltnetRoomWake = isMessageWake && surface === "moltnet" && parsed.context.networkId && parsed.context.roomId;
|
|
283
|
+
|
|
284
|
+
return {
|
|
285
|
+
context: parsed.context,
|
|
286
|
+
activeEnvironment: {
|
|
287
|
+
...parsed.context,
|
|
288
|
+
surface,
|
|
289
|
+
senderId: parsed.senderId
|
|
290
|
+
},
|
|
291
|
+
eventFrom: messageFrom ?? "moltnet",
|
|
292
|
+
messageFrom: messageFrom ?? parsed.senderId ?? "moltnet",
|
|
293
|
+
isRoomWake: isMoltnetRoomWake
|
|
294
|
+
};
|
|
295
|
+
};
|
|
296
|
+
|
|
297
|
+
const renderDreamSessionKey = (template, runId) => {
|
|
298
|
+
if (!template) {
|
|
299
|
+
return undefined;
|
|
300
|
+
}
|
|
301
|
+
return template.replace("{run_id}", runId);
|
|
302
|
+
};
|
|
303
|
+
|
|
304
|
+
const enrichWakeContext = async (workspacePath, payload) => {
|
|
305
|
+
const base = buildRuntimeContextForWake(payload);
|
|
306
|
+
const index = await readTeamContextIndex(workspacePath);
|
|
307
|
+
if (!index) {
|
|
308
|
+
return base;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
const kind = normalizeWakeKind(typeof payload.wake_kind === "string" ? payload.wake_kind : payload.kind);
|
|
312
|
+
if (kind === "schedule") {
|
|
313
|
+
const scheduleContext = resolveScheduleContextFromIndex(index);
|
|
314
|
+
if (!scheduleContext) {
|
|
315
|
+
return base;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
return {
|
|
319
|
+
...base,
|
|
320
|
+
context: {
|
|
321
|
+
...base.context,
|
|
322
|
+
surface: "schedule",
|
|
323
|
+
teamId: scheduleContext.teamId || base.context.teamId,
|
|
324
|
+
team_doc: scheduleContext.team_doc || base.context.team_doc,
|
|
325
|
+
roster: scheduleContext.roster || base.context.roster
|
|
326
|
+
},
|
|
327
|
+
activeEnvironment: {
|
|
328
|
+
...base.activeEnvironment,
|
|
329
|
+
surface: "schedule",
|
|
330
|
+
...scheduleContext
|
|
331
|
+
}
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
if (base.isRoomWake) {
|
|
336
|
+
const roomContext = resolveRoomEnvironmentFromIndex(
|
|
337
|
+
index,
|
|
338
|
+
base.context.networkId,
|
|
339
|
+
base.context.roomId,
|
|
340
|
+
base.context.threadId
|
|
341
|
+
);
|
|
342
|
+
|
|
343
|
+
if (roomContext) {
|
|
344
|
+
return {
|
|
345
|
+
...base,
|
|
346
|
+
eventFrom: undefined,
|
|
347
|
+
context: {
|
|
348
|
+
...base.context,
|
|
349
|
+
from: undefined,
|
|
350
|
+
networkId: base.context.networkId,
|
|
351
|
+
roomId: base.context.roomId,
|
|
352
|
+
threadId: base.context.threadId,
|
|
353
|
+
teamId: roomContext.teamId || base.context.teamId,
|
|
354
|
+
team_doc: roomContext.team_doc || base.context.team_doc,
|
|
355
|
+
roster: roomContext.roster || base.context.roster,
|
|
356
|
+
pairPeers: base.context.pairPeers,
|
|
357
|
+
participants: base.context.participants
|
|
358
|
+
},
|
|
359
|
+
activeEnvironment: {
|
|
360
|
+
...base.activeEnvironment,
|
|
361
|
+
...roomContext,
|
|
362
|
+
networkId: base.context.networkId,
|
|
363
|
+
roomId: base.context.roomId,
|
|
364
|
+
threadId: base.context.threadId,
|
|
365
|
+
surface: "moltnet"
|
|
366
|
+
},
|
|
367
|
+
isRoomWake: false
|
|
368
|
+
};
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
if (kind === "dream") {
|
|
373
|
+
const dreamContext = resolveDreamContextFromIndex(index, payload.dream_environment ?? payload.environment_key);
|
|
374
|
+
if (dreamContext) {
|
|
375
|
+
const runId = asStringOrUndefined(payload.run_id) ?? String(Date.now());
|
|
376
|
+
return {
|
|
377
|
+
...base,
|
|
378
|
+
eventFrom: renderDreamSessionKey(dreamContext.session_key_template, runId) ?? base.eventFrom,
|
|
379
|
+
context: {
|
|
380
|
+
...base.context,
|
|
381
|
+
surface: "dream",
|
|
382
|
+
teamId: dreamContext.teamId || base.context.teamId,
|
|
383
|
+
team_doc: dreamContext.team_doc || base.context.team_doc,
|
|
384
|
+
roster: dreamContext.roster || base.context.roster
|
|
385
|
+
},
|
|
386
|
+
activeEnvironment: {
|
|
387
|
+
...base.activeEnvironment,
|
|
388
|
+
...dreamContext,
|
|
389
|
+
run_id: runId,
|
|
390
|
+
surface: "dream"
|
|
391
|
+
}
|
|
392
|
+
};
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
return base;
|
|
397
|
+
};
|
|
398
|
+
`;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ContainerTarget, ContainerTargetInput } from "../types.js";
|
|
2
|
+
export declare const PI_CONFIG_FILE = "pi-app.json";
|
|
3
|
+
export declare const PI_CONTROL_PORT = 19690;
|
|
4
|
+
export declare const createPiContainerTargets: (inputs: ContainerTargetInput[]) => Promise<ContainerTarget[]>;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { listExecutionModelSecretNames } from "../../compiler/modelEnv.js";
|
|
3
|
+
import { renderPiScheduleSource } from "./appScheduleSource.js";
|
|
4
|
+
import { createPiAgentConfig, renderPiApp, renderPiAppConfig, renderPiModelsConfig, renderPiPackageJson, resolvePiEngine, } from "./appTemplate.js";
|
|
5
|
+
export const PI_CONFIG_FILE = "pi-app.json";
|
|
6
|
+
export const PI_CONTROL_PORT = 19690;
|
|
7
|
+
const PI_MODELS_FILE = "home/.pi/agent/models.json";
|
|
8
|
+
const moveWorkspaceFileToAgentWorkspace = (file, agentSlug) => {
|
|
9
|
+
if (!file.path.startsWith("workspace/"))
|
|
10
|
+
return file;
|
|
11
|
+
return {
|
|
12
|
+
...file,
|
|
13
|
+
path: path.posix.join("workspace", "agents", agentSlug, file.path.slice("workspace/".length)),
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export const createPiContainerTargets = async (inputs) => {
|
|
17
|
+
const agentInputs = inputs.filter((input) => input.kind === "agent" && input.value.kind === "agent");
|
|
18
|
+
if (agentInputs.length === 0)
|
|
19
|
+
return [];
|
|
20
|
+
const agents = agentInputs.map((input) => createPiAgentConfig(input.value, input.slug, input.id, input.worldBinding));
|
|
21
|
+
const engineByNodeId = Object.fromEntries(agentInputs.map((input) => [input.id, resolvePiEngine(input.value).kind]));
|
|
22
|
+
const worldTokenEnvNames = agents
|
|
23
|
+
.flatMap((agent) => agent.world ? [agent.world.tokenEnv] : [])
|
|
24
|
+
.sort();
|
|
25
|
+
const envFiles = [
|
|
26
|
+
...new Set(agentInputs.flatMap((input) => listExecutionModelSecretNames(input.value.execution))),
|
|
27
|
+
].map((secretName) => ({
|
|
28
|
+
envName: secretName,
|
|
29
|
+
relativePath: `secrets/${secretName}`,
|
|
30
|
+
}));
|
|
31
|
+
return [{
|
|
32
|
+
engineByNodeId,
|
|
33
|
+
envFiles,
|
|
34
|
+
files: [
|
|
35
|
+
...agentInputs.flatMap((input) => input.emittedFiles.map((file) => moveWorkspaceFileToAgentWorkspace(file, input.slug))),
|
|
36
|
+
{ content: renderPiAppConfig(agents), path: PI_CONFIG_FILE },
|
|
37
|
+
{
|
|
38
|
+
content: renderPiModelsConfig(agentInputs.map((input) => input.value)),
|
|
39
|
+
path: PI_MODELS_FILE,
|
|
40
|
+
},
|
|
41
|
+
{ content: renderPiPackageJson(), path: "runtime/package.json" },
|
|
42
|
+
{
|
|
43
|
+
content: renderPiScheduleSource(),
|
|
44
|
+
mode: 0o644,
|
|
45
|
+
path: "runtime/schedule.mjs",
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
content: renderPiApp({ world: agents.some((agent) => agent.world !== undefined) }),
|
|
49
|
+
mode: 0o755,
|
|
50
|
+
path: "runtime/app.mjs",
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
id: "pi-app",
|
|
54
|
+
sourceIds: agentInputs.map((input) => input.id).sort(),
|
|
55
|
+
...(worldTokenEnvNames.length > 0 ? { worldTokenEnvNames } : {}),
|
|
56
|
+
}];
|
|
57
|
+
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
-
import
|
|
2
|
+
import os from "node:os";
|
|
3
|
+
import { chmod, cp, lstat, readdir } from "node:fs/promises";
|
|
3
4
|
import { loadImportedClaudeCodeCredential, loadImportedCodexCredential } from "../../auth/index.js";
|
|
4
|
-
import { ensureDirectory, writeUtf8File } from "../../filesystem/index.js";
|
|
5
|
+
import { ensureDirectory, fileExists, writeUtf8File } from "../../filesystem/index.js";
|
|
5
6
|
const createMountArgs = (hostPath, containerPath) => [
|
|
6
7
|
"-v",
|
|
7
8
|
`${hostPath}:${containerPath}`
|
|
@@ -19,21 +20,134 @@ const writeJsonFile = async (tempRoot, relativePath, value) => {
|
|
|
19
20
|
return hostPath;
|
|
20
21
|
};
|
|
21
22
|
const collectCoveredSecrets = (instanceSecrets, enabled, secretName) => enabled && instanceSecrets.includes(secretName) ? [secretName] : [];
|
|
23
|
+
const copyIfExists = async (sourcePath, targetPath) => {
|
|
24
|
+
if (!await fileExists(sourcePath)) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
await ensureDirectory(path.dirname(targetPath));
|
|
28
|
+
await cp(sourcePath, targetPath, {
|
|
29
|
+
dereference: true,
|
|
30
|
+
force: true,
|
|
31
|
+
recursive: true
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
const makeReadable = async (targetPath) => {
|
|
35
|
+
const stats = await lstat(targetPath);
|
|
36
|
+
if (!stats.isDirectory()) {
|
|
37
|
+
await chmod(targetPath, 0o644);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
await chmod(targetPath, 0o755);
|
|
41
|
+
for (const entry of await readdir(targetPath)) {
|
|
42
|
+
await makeReadable(path.join(targetPath, entry));
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
const stageCliHome = async (sourcePath, tempRoot, relativeTarget, entries) => {
|
|
46
|
+
const targetPath = path.join(tempRoot, "runtime-auth", "pi", relativeTarget);
|
|
47
|
+
await ensureDirectory(targetPath);
|
|
48
|
+
for (const entry of entries) {
|
|
49
|
+
await copyIfExists(path.join(sourcePath, entry), path.join(targetPath, entry));
|
|
50
|
+
}
|
|
51
|
+
await makeReadable(targetPath);
|
|
52
|
+
return targetPath;
|
|
53
|
+
};
|
|
54
|
+
const stageGrokHome = async (sourcePath, tempRoot) => stageCliHome(sourcePath, tempRoot, "grok-home", [
|
|
55
|
+
".metadata_version",
|
|
56
|
+
"auth.json",
|
|
57
|
+
"config.toml",
|
|
58
|
+
"mcp_credentials.json",
|
|
59
|
+
"version.json",
|
|
60
|
+
"worktrees.db"
|
|
61
|
+
]);
|
|
62
|
+
/** The generated `runCodexEngine` (appCliEnginesSource.ts) reads codex CLI
|
|
63
|
+
* auth from `<containerHome>/.codex/auth.json`, so — mirroring the grok and
|
|
64
|
+
* antigravity homes — stage the real host `~/.codex/auth.json` when a codex
|
|
65
|
+
* CLI engine runs. Only `auth.json` is staged: the host `config.toml` carries
|
|
66
|
+
* machine-specific settings the container should not inherit, and it is the
|
|
67
|
+
* only file `runCodexEngine` copies forward. */
|
|
68
|
+
const stageCodexHome = async (sourcePath, tempRoot) => stageCliHome(sourcePath, tempRoot, "codex-home", ["auth.json"]);
|
|
69
|
+
const stageAntigravityHome = async (sourcePath, tempRoot) => stageCliHome(sourcePath, tempRoot, "antigravity-home", [
|
|
70
|
+
"Cookies",
|
|
71
|
+
"Cookies-journal",
|
|
72
|
+
"Local Storage",
|
|
73
|
+
"Preferences",
|
|
74
|
+
"Session Storage",
|
|
75
|
+
"app_storage.json"
|
|
76
|
+
]);
|
|
77
|
+
const stageAntigravityCliHome = async (sourcePath, tempRoot) => stageCliHome(sourcePath, tempRoot, "antigravity-cli-home", [
|
|
78
|
+
"antigravity-oauth-token",
|
|
79
|
+
"cache/default_project_id.txt",
|
|
80
|
+
"cache/onboarding.json",
|
|
81
|
+
"config/.migrated",
|
|
82
|
+
"config/mcp_config.json"
|
|
83
|
+
]);
|
|
84
|
+
const firstExistingDirectory = async (paths) => {
|
|
85
|
+
for (const candidate of paths) {
|
|
86
|
+
if (await fileExists(candidate)) {
|
|
87
|
+
return candidate;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return null;
|
|
91
|
+
};
|
|
92
|
+
const collectOptionalCliHomeMounts = async (containerHomePath, tempRoot, options = {}) => {
|
|
93
|
+
const home = os.homedir();
|
|
94
|
+
const mounts = [];
|
|
95
|
+
const grokCandidates = process.env.GROK_HOME
|
|
96
|
+
? [process.env.GROK_HOME]
|
|
97
|
+
: [path.join(home, ".grok")];
|
|
98
|
+
const grokHome = await firstExistingDirectory(grokCandidates);
|
|
99
|
+
if (grokHome) {
|
|
100
|
+
mounts.push(...createMountArgs(await stageGrokHome(grokHome, tempRoot), path.posix.join(containerHomePath, ".grok")));
|
|
101
|
+
}
|
|
102
|
+
if (!options.skipCodex) {
|
|
103
|
+
const codexCandidates = process.env.CODEX_HOME
|
|
104
|
+
? [process.env.CODEX_HOME]
|
|
105
|
+
: [path.join(home, ".codex")];
|
|
106
|
+
const codexHome = await firstExistingDirectory(codexCandidates);
|
|
107
|
+
if (codexHome && await fileExists(path.join(codexHome, "auth.json"))) {
|
|
108
|
+
mounts.push(...createMountArgs(await stageCodexHome(codexHome, tempRoot), path.posix.join(containerHomePath, ".codex")));
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
const antigravityCandidates = process.env.ANTIGRAVITY_HOME
|
|
112
|
+
? [process.env.ANTIGRAVITY_HOME]
|
|
113
|
+
: process.env.AGY_HOME
|
|
114
|
+
? [process.env.AGY_HOME]
|
|
115
|
+
: [
|
|
116
|
+
path.join(home, "Library", "Application Support", "Antigravity"),
|
|
117
|
+
path.join(home, ".config", "Antigravity"),
|
|
118
|
+
path.join(home, ".antigravity")
|
|
119
|
+
];
|
|
120
|
+
const antigravityHome = await firstExistingDirectory(antigravityCandidates);
|
|
121
|
+
if (antigravityHome) {
|
|
122
|
+
mounts.push(...createMountArgs(await stageAntigravityHome(antigravityHome, tempRoot), path.posix.join(containerHomePath, ".config", "Antigravity")));
|
|
123
|
+
}
|
|
124
|
+
const antigravityCliCandidates = process.env.ANTIGRAVITY_CLI_HOME
|
|
125
|
+
? [process.env.ANTIGRAVITY_CLI_HOME]
|
|
126
|
+
: [path.join(home, ".gemini", "antigravity-cli")];
|
|
127
|
+
const antigravityCliHome = await firstExistingDirectory(antigravityCliCandidates);
|
|
128
|
+
if (antigravityCliHome) {
|
|
129
|
+
mounts.push(...createMountArgs(await stageAntigravityCliHome(antigravityCliHome, tempRoot), path.posix.join(containerHomePath, ".gemini", "antigravity-cli")));
|
|
130
|
+
}
|
|
131
|
+
return mounts;
|
|
132
|
+
};
|
|
22
133
|
export const preparePiRuntimeAuth = async (input) => {
|
|
23
134
|
if (!input.instance.home_path) {
|
|
24
135
|
return { coveredModelSecrets: [], mountArgs: [] };
|
|
25
136
|
}
|
|
26
|
-
const codex = input.authProfile
|
|
137
|
+
const codex = input.authProfile?.imports.codex
|
|
27
138
|
? await loadImportedCodexCredential(input.authProfile.imports.codex.path)
|
|
28
139
|
: null;
|
|
29
|
-
const claudeCode = input.authProfile
|
|
140
|
+
const claudeCode = input.authProfile?.imports["claude-code"]
|
|
30
141
|
? await loadImportedClaudeCodeCredential(input.authProfile.imports["claude-code"].path)
|
|
31
142
|
: null;
|
|
32
143
|
const useCodex = input.instance.model_auth_methods.openai === "codex" && codex;
|
|
33
144
|
const useClaudeCode = input.instance.model_auth_methods.anthropic === "claude-code" && claudeCode;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
145
|
+
const mountArgs = await collectOptionalCliHomeMounts(input.instance.home_path, input.tempRoot, {
|
|
146
|
+
// `up` delivers this credential through the env-secret channel; do not
|
|
147
|
+
// also create a remote-host bind mount for the same Codex auth file.
|
|
148
|
+
skipCodex: Boolean(input.authProfile?.imports.codex) ||
|
|
149
|
+
typeof input.env.SPAWNFILE_CLI_AUTH_JSON === "string"
|
|
150
|
+
});
|
|
37
151
|
const authProfiles = {};
|
|
38
152
|
if (useCodex) {
|
|
39
153
|
authProfiles["openai-codex"] = {
|
|
@@ -57,12 +171,15 @@ export const preparePiRuntimeAuth = async (input) => {
|
|
|
57
171
|
type: "api_key"
|
|
58
172
|
};
|
|
59
173
|
}
|
|
60
|
-
|
|
174
|
+
if (useCodex || useClaudeCode) {
|
|
175
|
+
const authPath = await writeJsonFile(input.tempRoot, path.join("runtime-auth", "pi", input.instance.id, "auth.json"), authProfiles);
|
|
176
|
+
mountArgs.push(...createMountArgs(authPath, path.posix.join(input.instance.home_path, ".pi", "agent", "auth.json")));
|
|
177
|
+
}
|
|
61
178
|
return {
|
|
62
179
|
coveredModelSecrets: [
|
|
63
180
|
...collectCoveredSecrets(input.instance.model_secrets_required, Boolean(useCodex), "OPENAI_API_KEY"),
|
|
64
181
|
...collectCoveredSecrets(input.instance.model_secrets_required, Boolean(useClaudeCode), "ANTHROPIC_API_KEY")
|
|
65
182
|
],
|
|
66
|
-
mountArgs
|
|
183
|
+
mountArgs
|
|
67
184
|
};
|
|
68
185
|
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export const createPiTestNode = (overrides = {}) => ({
|
|
2
|
+
description: "Pi test agent",
|
|
3
|
+
docs: [
|
|
4
|
+
{
|
|
5
|
+
content: "# Instructions\n",
|
|
6
|
+
role: "system",
|
|
7
|
+
sourcePath: "/tmp/AGENTS.md"
|
|
8
|
+
}
|
|
9
|
+
],
|
|
10
|
+
env: {},
|
|
11
|
+
execution: {
|
|
12
|
+
model: {
|
|
13
|
+
primary: {
|
|
14
|
+
auth: { method: "codex" },
|
|
15
|
+
name: "gpt-5.4-mini",
|
|
16
|
+
provider: "openai"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
sandbox: { mode: "workspace" }
|
|
20
|
+
},
|
|
21
|
+
kind: "agent",
|
|
22
|
+
mcpServers: [],
|
|
23
|
+
name: "assistant",
|
|
24
|
+
policyMode: null,
|
|
25
|
+
policyOnDegrade: null,
|
|
26
|
+
runtime: { name: "pi", options: {} },
|
|
27
|
+
secrets: [],
|
|
28
|
+
skills: [
|
|
29
|
+
{
|
|
30
|
+
content: "---\nname: note\ndescription: Note\n---\n\nCreate notes.\n",
|
|
31
|
+
name: "note",
|
|
32
|
+
ref: "./skills/note",
|
|
33
|
+
requiresMcp: [],
|
|
34
|
+
sourcePath: "/tmp/skills/note/SKILL.md"
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
source: "/tmp/agent/Spawnfile",
|
|
38
|
+
subagents: [],
|
|
39
|
+
...overrides
|
|
40
|
+
});
|