spawnfile 0.1.17 → 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 +1 -1
- package/dist/auth/importers.js +21 -5
- package/dist/auth/index.d.ts +1 -0
- package/dist/auth/index.js +1 -0
- package/dist/auth/profileStore.js +4 -1
- 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/cli/authCommands.js +9 -5
- package/dist/cli/compileBuildCommands.js +4 -0
- package/dist/cli/devCommands.js +4 -2
- package/dist/cli/downCommand.d.ts +2 -0
- package/dist/cli/downCommand.js +3 -0
- package/dist/cli/envFileOption.d.ts +18 -0
- package/dist/cli/envFileOption.js +20 -0
- package/dist/cli/lifecycleCommands.d.ts +1 -1
- package/dist/cli/lifecycleCommands.js +3 -1
- package/dist/cli/lifecyclePlan.d.ts +1 -0
- package/dist/cli/lifecyclePlan.js +2 -0
- package/dist/cli/paideiaDelegation.d.ts +2 -1
- package/dist/cli/paideiaDelegation.js +5 -4
- 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 +7 -1
- package/dist/cli/runCli.js +11 -6
- package/dist/cli/runPublishCommands.js +5 -3
- package/dist/cli/trainCommand.js +73 -20
- package/dist/cli/upCommand.js +5 -1
- package/dist/cli/volumeCommands.d.ts +8 -0
- package/dist/cli/volumeCommands.js +53 -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/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 +2 -0
- package/dist/compiler/compileProject.d.ts +10 -0
- package/dist/compiler/compileProject.js +29 -3
- package/dist/compiler/containerArtifactSummaries.js +1 -0
- package/dist/compiler/containerArtifacts.d.ts +4 -4
- package/dist/compiler/containerArtifacts.js +18 -34
- package/dist/compiler/containerArtifactsPlans.js +7 -0
- package/dist/compiler/containerArtifactsTypes.d.ts +7 -0
- package/dist/compiler/containerDaimonBrokerRender.d.ts +3 -1
- package/dist/compiler/containerDaimonBrokerRender.js +6 -3
- package/dist/compiler/containerDaimonGrokTaskClock.d.ts +5 -0
- package/dist/compiler/containerDaimonGrokTaskClock.js +29 -0
- package/dist/compiler/containerDaimonGrokWorkerProvisioning.d.ts +1 -1
- package/dist/compiler/containerDaimonGrokWorkerProvisioning.js +38 -16
- package/dist/compiler/containerDaimonGrokWorkerRender.d.ts +33 -8
- package/dist/compiler/containerDaimonGrokWorkerRender.js +18 -5
- package/dist/compiler/containerDaimonOwnershipGuardRender.d.ts +14 -1
- package/dist/compiler/containerDaimonOwnershipGuardRender.js +15 -2
- package/dist/compiler/containerDaimonUidEntrypointRender.js +6 -12
- package/dist/compiler/containerTargetResources.d.ts +10 -0
- package/dist/compiler/containerTargetResources.js +21 -13
- package/dist/compiler/containerWorkspaceResourceRender.js +4 -1
- package/dist/compiler/index.d.ts +2 -0
- package/dist/compiler/index.js +2 -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/moltnetArtifactTypes.d.ts +1 -0
- package/dist/compiler/moltnetArtifacts.js +1 -0
- 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 +2 -1
- package/dist/compiler/runProject.js +2 -0
- 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 +4 -2
- package/dist/compiler/training/broker/declaration.js +4 -2
- package/dist/compiler/training/broker/entrypoint.js +33 -18
- 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 +3 -2
- package/dist/compiler/training/broker/index.js +3 -2
- package/dist/compiler/training/broker/main.js +1 -1
- package/dist/compiler/training/broker/paths.d.ts +96 -56
- package/dist/compiler/training/broker/paths.js +97 -89
- package/dist/compiler/training/broker/processes.d.ts +9 -0
- package/dist/compiler/training/broker/processes.js +4 -1
- package/dist/compiler/training/broker/projection.d.ts +3 -2
- package/dist/compiler/training/broker/projection.js +21 -9
- package/dist/compiler/training/broker/provisioning.d.ts +6 -15
- package/dist/compiler/training/broker/provisioning.js +71 -53
- package/dist/compiler/training/broker/registration.d.ts +3 -1
- package/dist/compiler/training/broker/registration.js +29 -21
- 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 +10 -13
- package/dist/compiler/training/broker/runtime.js +69 -115
- package/dist/compiler/training/broker/supervisor.d.ts +10 -11
- package/dist/compiler/training/broker/supervisor.js +22 -23
- 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 +23 -0
- package/dist/compiler/training/container/contract.js +23 -5
- 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 +2 -1
- package/dist/compiler/training/container/index.js +2 -1
- package/dist/compiler/training/container/launch.d.ts +3 -0
- package/dist/compiler/training/container/launch.js +119 -28
- 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 +3 -1
- package/dist/compiler/training/container/prepare.js +57 -12
- package/dist/compiler/training/container/security.d.ts +5 -3
- package/dist/compiler/training/container/security.js +15 -5
- 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 +8 -0
- package/dist/compiler/training/context.js +12 -12
- package/dist/compiler/training/contract.d.ts +2 -0
- package/dist/compiler/training/contract.js +2 -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 +8 -0
- package/dist/compiler/training/index.js +7 -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 +13 -2
- package/dist/compiler/training/preparation/assets/package-lock.json +2 -2
- package/dist/compiler/training/preparation/broker.d.ts +3 -3
- package/dist/compiler/training/preparation/broker.js +6 -4
- package/dist/compiler/training/preparation/contract.d.ts +27 -2
- package/dist/compiler/training/preparation/contract.js +23 -4
- package/dist/compiler/training/preparation/files.d.ts +5 -1
- package/dist/compiler/training/preparation/files.js +76 -15
- package/dist/compiler/training/preparation/image.js +9 -4
- package/dist/compiler/training/preparation/inputs.d.ts +1 -0
- package/dist/compiler/training/preparation/inputs.js +18 -10
- package/dist/compiler/training/preparation/prepare.d.ts +5 -0
- package/dist/compiler/training/preparation/prepare.js +66 -29
- package/dist/compiler/training/preparation/scratch.d.ts +6 -17
- package/dist/compiler/training/preparation/scratch.js +89 -23
- package/dist/compiler/training/repair/contract.d.ts +338 -4
- package/dist/compiler/training/repair/contract.js +2 -0
- package/dist/compiler/training/repair/index.d.ts +1 -1
- package/dist/compiler/training/repair/index.js +1 -1
- package/dist/compiler/training/repair/prepare.d.ts +155 -3
- package/dist/compiler/training/repair/prepare.js +6 -2
- package/dist/compiler/training/repair/witness.d.ts +152 -3
- package/dist/compiler/training/repair/witness.js +8 -2
- 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 +6 -3
- package/dist/compiler/upProject.d.ts +1 -0
- package/dist/compiler/upProject.js +21 -5
- package/dist/compiler/workspaceBundleArtifacts.d.ts +16 -1
- package/dist/compiler/workspaceBundleArtifacts.js +69 -20
- 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 +5 -1
- package/dist/compiler/workspaceResources.js +32 -5
- package/dist/deployment/activation.d.ts +3 -0
- package/dist/deployment/activation.js +12 -0
- package/dist/deployment/canaryCutover.d.ts +1 -1
- package/dist/deployment/candidateRecording.d.ts +8 -0
- package/dist/deployment/candidateRecording.js +22 -0
- package/dist/deployment/dockerManager.d.ts +5 -3
- package/dist/deployment/dockerManager.js +12 -2
- package/dist/deployment/downDeployment.d.ts +2 -0
- package/dist/deployment/downDeployment.js +6 -2
- package/dist/deployment/homeStore.d.ts +9 -1
- package/dist/deployment/homeStore.js +16 -53
- package/dist/deployment/index.d.ts +6 -0
- package/dist/deployment/index.js +6 -0
- package/dist/deployment/pidLock.d.ts +25 -0
- package/dist/deployment/pidLock.js +81 -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/distribution/buildDistributionReport.d.ts +3 -0
- package/dist/distribution/buildDistributionReport.js +5 -0
- package/dist/distribution/consumeImage.d.ts +3 -0
- package/dist/distribution/consumeImage.js +23 -31
- package/dist/distribution/consumeImageLifecycle.d.ts +4 -1
- package/dist/distribution/consumeImageLifecycle.js +14 -3
- package/dist/distribution/consumeImageSupport.d.ts +7 -0
- package/dist/distribution/consumeImageSupport.js +25 -0
- package/dist/distribution/distributionReportSchema.d.ts +47 -0
- package/dist/distribution/distributionReportSchema.js +20 -0
- package/dist/distribution/renderImageInterface.js +1 -1
- package/dist/distribution/types.d.ts +15 -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/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 +20 -0
- package/dist/manifest/executionSchemas.js +13 -3
- 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 +61 -0
- package/dist/manifest/mcpSchemas.js +57 -11
- 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/renderSpawnfileWorkspace.js +6 -2
- package/dist/manifest/schemas.d.ts +1206 -132
- package/dist/manifest/schemas.js +14 -4
- package/dist/manifest/teamNetworkSchemas.d.ts +1 -1
- 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 +182 -5
- package/dist/manifest/workspaceSchemas.js +111 -7
- 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 +58 -0
- package/dist/runtime/container.js +8 -13
- package/dist/runtime/daimon/adapter.js +15 -4
- package/dist/runtime/daimon/config.d.ts +4 -0
- package/dist/runtime/daimon/config.js +53 -4
- 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 +59 -8
- package/dist/runtime/daimon/contractManifest.js +26 -10
- package/dist/runtime/daimon/grokTurnLimits.d.ts +25 -0
- package/dist/runtime/daimon/grokTurnLimits.js +51 -0
- package/dist/runtime/daimon/grokWorkerConfigBytes.d.ts +17 -0
- package/dist/runtime/daimon/grokWorkerConfigBytes.js +17 -0
- package/dist/runtime/daimon/grokWorkerContract.d.ts +5 -0
- package/dist/runtime/daimon/grokWorkerContract.js +13 -1
- package/dist/runtime/daimon/recording.d.ts +19 -0
- package/dist/runtime/daimon/recording.js +50 -0
- package/dist/runtime/daimon/scheduleAuthority.d.ts +8 -0
- package/dist/runtime/daimon/scheduleAuthority.js +19 -5
- 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 +1 -0
- package/dist/runtime/index.js +1 -0
- package/dist/runtime/install.d.ts +2 -0
- package/dist/runtime/install.js +1 -0
- package/dist/runtime/openclaw/adapter.js +3 -0
- package/dist/runtime/pi/adapter.js +3 -0
- package/dist/runtime/pi/containerTargets.js +6 -0
- package/dist/runtime/picoclaw/adapter.js +3 -0
- package/dist/runtime/registry.d.ts +3 -0
- package/dist/runtime/registry.js +13 -1
- package/dist/runtime/types.d.ts +15 -0
- package/dist/runtime/usageLedgerRead.d.ts +6 -0
- package/dist/runtime/usageLedgerRead.js +3 -3
- package/dist/shared/index.d.ts +1 -0
- package/dist/shared/index.js +1 -0
- package/dist/shared/recording.d.ts +8 -0
- package/dist/shared/recording.js +25 -0
- package/dist/target/dockerCommandExecutorCore.js +1 -1
- package/dist/target/dockerTargetBinding.js +2 -1
- 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/package.json +3 -3
- package/runtimes.yaml +8 -6
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const syncDirectorySync: (directory: string) => void;
|
|
2
|
+
export declare const syncDirectory: (directory: string) => Promise<void>;
|
|
3
|
+
export declare const syncFileSync: (file: string) => void;
|
|
4
|
+
export declare const syncFile: (file: string) => Promise<void>;
|
|
5
|
+
/** The rename is visible, but directory durability could not be confirmed. */
|
|
6
|
+
export declare class PublishedFileSyncError extends Error {
|
|
7
|
+
}
|
|
8
|
+
/** The caller creates the parent directory and holds its domain writer lock. */
|
|
9
|
+
export declare const writeDurableFileSync: (file: string, bytes: string) => void;
|
|
10
|
+
export declare const writeDurableFile: (file: string, bytes: string) => Promise<void>;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
import { closeSync, fsyncSync, openSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
3
|
+
import { open, rename, rm } from "node:fs/promises";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
export const syncDirectorySync = (directory) => {
|
|
6
|
+
const fd = openSync(directory, "r");
|
|
7
|
+
try {
|
|
8
|
+
fsyncSync(fd);
|
|
9
|
+
}
|
|
10
|
+
finally {
|
|
11
|
+
closeSync(fd);
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
export const syncDirectory = async (directory) => {
|
|
15
|
+
const handle = await open(directory, "r");
|
|
16
|
+
try {
|
|
17
|
+
await handle.sync();
|
|
18
|
+
}
|
|
19
|
+
finally {
|
|
20
|
+
await handle.close();
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
export const syncFileSync = (file) => {
|
|
24
|
+
const fd = openSync(file, "r");
|
|
25
|
+
try {
|
|
26
|
+
fsyncSync(fd);
|
|
27
|
+
}
|
|
28
|
+
finally {
|
|
29
|
+
closeSync(fd);
|
|
30
|
+
}
|
|
31
|
+
syncDirectorySync(path.dirname(file));
|
|
32
|
+
};
|
|
33
|
+
export const syncFile = async (file) => {
|
|
34
|
+
const handle = await open(file, "r");
|
|
35
|
+
try {
|
|
36
|
+
await handle.sync();
|
|
37
|
+
}
|
|
38
|
+
finally {
|
|
39
|
+
await handle.close();
|
|
40
|
+
}
|
|
41
|
+
await syncDirectory(path.dirname(file));
|
|
42
|
+
};
|
|
43
|
+
/** The rename is visible, but directory durability could not be confirmed. */
|
|
44
|
+
export class PublishedFileSyncError extends Error {
|
|
45
|
+
}
|
|
46
|
+
/** The caller creates the parent directory and holds its domain writer lock. */
|
|
47
|
+
export const writeDurableFileSync = (file, bytes) => {
|
|
48
|
+
const temporary = `${file}.${randomUUID()}.tmp`;
|
|
49
|
+
try {
|
|
50
|
+
const fd = openSync(temporary, "wx", 0o600);
|
|
51
|
+
try {
|
|
52
|
+
writeFileSync(fd, bytes, "utf8");
|
|
53
|
+
fsyncSync(fd);
|
|
54
|
+
}
|
|
55
|
+
finally {
|
|
56
|
+
closeSync(fd);
|
|
57
|
+
}
|
|
58
|
+
renameSync(temporary, file);
|
|
59
|
+
syncDirectorySync(path.dirname(file));
|
|
60
|
+
}
|
|
61
|
+
finally {
|
|
62
|
+
rmSync(temporary, { force: true });
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
export const writeDurableFile = async (file, bytes) => {
|
|
66
|
+
const temporary = `${file}.${randomUUID()}.tmp`;
|
|
67
|
+
try {
|
|
68
|
+
const handle = await open(temporary, "wx", 0o600);
|
|
69
|
+
try {
|
|
70
|
+
await handle.writeFile(bytes, "utf8");
|
|
71
|
+
await handle.sync();
|
|
72
|
+
}
|
|
73
|
+
finally {
|
|
74
|
+
await handle.close();
|
|
75
|
+
}
|
|
76
|
+
await rename(temporary, file);
|
|
77
|
+
try {
|
|
78
|
+
await syncDirectory(path.dirname(file));
|
|
79
|
+
}
|
|
80
|
+
catch (cause) {
|
|
81
|
+
throw new PublishedFileSyncError(`Published ${file}, but directory fsync failed`, { cause });
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
finally {
|
|
85
|
+
await rm(temporary, { force: true });
|
|
86
|
+
}
|
|
87
|
+
};
|
package/dist/filesystem/index.js
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface JsonlReadResult<T> {
|
|
2
|
+
entries: T[];
|
|
3
|
+
errors: string[];
|
|
4
|
+
}
|
|
5
|
+
/** Missing history is empty; unreadable or corrupt history is reported, never hidden. */
|
|
6
|
+
export declare const readRetainedJsonl: <T>(file: string, isEntry: (value: unknown) => value is T) => JsonlReadResult<T>;
|
|
7
|
+
/** Ties use the last appended entry. No chronological ordering of the input is assumed. */
|
|
8
|
+
export declare const entryAt: <T>(entries: readonly T[], instant: string | Date, timeOf: (entry: T) => string) => T | null;
|
|
9
|
+
/** The last state at the cutoff is needed even if it is arbitrarily old. */
|
|
10
|
+
export declare const retainEntries: <T>(entries: readonly T[], cutoff: number, timeOf: (entry: T) => string) => T[];
|
|
11
|
+
/**
|
|
12
|
+
* Caller MUST hold its domain's writer lock across append + prune. One append write,
|
|
13
|
+
* then fsync; retention uses an exclusive 0600 temporary file and atomic rename.
|
|
14
|
+
* Invalid complete lines survive pruning so readers can continue reporting them.
|
|
15
|
+
* A torn tail refuses append: never join a new entry onto a partial JSON record.
|
|
16
|
+
*/
|
|
17
|
+
export declare const appendRetainedJsonl: <T>(file: string, entry: T, options: {
|
|
18
|
+
keepMs: number;
|
|
19
|
+
now: Date;
|
|
20
|
+
timeOf: (entry: T) => string;
|
|
21
|
+
isEntry: (value: unknown) => value is T;
|
|
22
|
+
retain?: (entries: readonly T[], cutoff: number) => T[];
|
|
23
|
+
}) => void;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
import { closeSync, constants, fchmodSync, fsyncSync, mkdirSync, openSync, readFileSync, renameSync, rmSync, writeSync } from "node:fs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { syncDirectorySync } from "./durableWrite.js";
|
|
5
|
+
const parseLines = (text, isEntry) => {
|
|
6
|
+
const raw = text.split("\n"), errors = [];
|
|
7
|
+
if (raw.at(-1) === "")
|
|
8
|
+
raw.pop();
|
|
9
|
+
const lines = raw.map((line, index) => {
|
|
10
|
+
try {
|
|
11
|
+
const value = JSON.parse(line);
|
|
12
|
+
if (!isEntry(value))
|
|
13
|
+
throw new Error("invalid entry");
|
|
14
|
+
return { line, entry: value };
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
errors.push(`line ${index + 1}: invalid JSON or entry`);
|
|
18
|
+
return { line };
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
return { lines, errors };
|
|
22
|
+
};
|
|
23
|
+
/** Missing history is empty; unreadable or corrupt history is reported, never hidden. */
|
|
24
|
+
export const readRetainedJsonl = (file, isEntry) => {
|
|
25
|
+
let text;
|
|
26
|
+
try {
|
|
27
|
+
text = readFileSync(file, "utf8");
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
return { entries: [], errors: error.code === "ENOENT" ? [] : [`${file}: ${String(error)}`] };
|
|
31
|
+
}
|
|
32
|
+
const parsed = parseLines(text, isEntry);
|
|
33
|
+
return { entries: parsed.lines.flatMap(({ entry }) => entry === undefined ? [] : [entry]), errors: parsed.errors };
|
|
34
|
+
};
|
|
35
|
+
/** Ties use the last appended entry. No chronological ordering of the input is assumed. */
|
|
36
|
+
export const entryAt = (entries, instant, timeOf) => {
|
|
37
|
+
const at = instant instanceof Date ? instant.getTime() : Date.parse(instant);
|
|
38
|
+
if (!Number.isFinite(at))
|
|
39
|
+
throw new Error("History lookup requires a valid instant");
|
|
40
|
+
let found = null, latest = -Infinity;
|
|
41
|
+
for (const entry of entries) {
|
|
42
|
+
const time = Date.parse(timeOf(entry));
|
|
43
|
+
if (time <= at && time >= latest) {
|
|
44
|
+
latest = time;
|
|
45
|
+
found = entry;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return found;
|
|
49
|
+
};
|
|
50
|
+
/** The last state at the cutoff is needed even if it is arbitrarily old. */
|
|
51
|
+
export const retainEntries = (entries, cutoff, timeOf) => {
|
|
52
|
+
let boundary = -1, latest = -Infinity;
|
|
53
|
+
entries.forEach((entry, index) => {
|
|
54
|
+
const time = Date.parse(timeOf(entry));
|
|
55
|
+
if (time <= cutoff && time >= latest) {
|
|
56
|
+
latest = time;
|
|
57
|
+
boundary = index;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
return entries.filter((entry, index) => index === boundary || Date.parse(timeOf(entry)) > cutoff);
|
|
61
|
+
};
|
|
62
|
+
const writeAndSync = (fd, text) => {
|
|
63
|
+
const bytes = Buffer.from(text, "utf8");
|
|
64
|
+
if (writeSync(fd, bytes) !== bytes.length)
|
|
65
|
+
throw new Error("Short recording log write");
|
|
66
|
+
fsyncSync(fd);
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Caller MUST hold its domain's writer lock across append + prune. One append write,
|
|
70
|
+
* then fsync; retention uses an exclusive 0600 temporary file and atomic rename.
|
|
71
|
+
* Invalid complete lines survive pruning so readers can continue reporting them.
|
|
72
|
+
* A torn tail refuses append: never join a new entry onto a partial JSON record.
|
|
73
|
+
*/
|
|
74
|
+
export const appendRetainedJsonl = (file, entry, options) => {
|
|
75
|
+
if (!Number.isSafeInteger(options.keepMs) || options.keepMs <= 0 || !Number.isFinite(options.now.getTime())) {
|
|
76
|
+
throw new Error("Recording retention requires a positive safe duration and valid clock");
|
|
77
|
+
}
|
|
78
|
+
if (!options.isEntry(entry))
|
|
79
|
+
throw new Error("Refusing to append an invalid recording entry");
|
|
80
|
+
let previous = "";
|
|
81
|
+
try {
|
|
82
|
+
previous = readFileSync(file, "utf8");
|
|
83
|
+
}
|
|
84
|
+
catch (error) {
|
|
85
|
+
if (error.code !== "ENOENT")
|
|
86
|
+
throw error;
|
|
87
|
+
}
|
|
88
|
+
if (previous && !previous.endsWith("\n"))
|
|
89
|
+
throw new Error(`Recording log ${file} has an incomplete final line`);
|
|
90
|
+
const line = `${JSON.stringify(entry)}\n`;
|
|
91
|
+
mkdirSync(path.dirname(file), { recursive: true, mode: 0o700 });
|
|
92
|
+
const fd = openSync(file, constants.O_WRONLY | constants.O_APPEND | constants.O_CREAT | constants.O_NOFOLLOW, 0o600);
|
|
93
|
+
try {
|
|
94
|
+
fchmodSync(fd, 0o600);
|
|
95
|
+
writeAndSync(fd, line);
|
|
96
|
+
}
|
|
97
|
+
finally {
|
|
98
|
+
closeSync(fd);
|
|
99
|
+
}
|
|
100
|
+
syncDirectorySync(path.dirname(file));
|
|
101
|
+
const parsed = parseLines(previous + line, options.isEntry);
|
|
102
|
+
const entries = parsed.lines.flatMap(({ entry: value }) => value === undefined ? [] : [value]);
|
|
103
|
+
const cutoff = options.now.getTime() - options.keepMs;
|
|
104
|
+
const retained = new Set(options.retain ? options.retain(entries, cutoff) : retainEntries(entries, cutoff, options.timeOf));
|
|
105
|
+
const kept = parsed.lines.filter(({ entry: value }) => value === undefined || retained.has(value));
|
|
106
|
+
if (kept.length === parsed.lines.length)
|
|
107
|
+
return;
|
|
108
|
+
const temporary = `${file}.${randomUUID()}.tmp`;
|
|
109
|
+
try {
|
|
110
|
+
const scratch = openSync(temporary, "wx", 0o600);
|
|
111
|
+
try {
|
|
112
|
+
writeAndSync(scratch, `${kept.map(({ line: raw }) => raw).join("\n")}\n`);
|
|
113
|
+
}
|
|
114
|
+
finally {
|
|
115
|
+
closeSync(scratch);
|
|
116
|
+
}
|
|
117
|
+
renameSync(temporary, file);
|
|
118
|
+
syncDirectorySync(path.dirname(file));
|
|
119
|
+
}
|
|
120
|
+
finally {
|
|
121
|
+
rmSync(temporary, { force: true });
|
|
122
|
+
}
|
|
123
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** A plain image reference (registry/repo[:tag]) pinned by digest; never anything Docker could read as an option. */
|
|
3
|
+
export declare const pinnedImageSchema: z.ZodString;
|
|
4
|
+
/** An argv: run directly, never through a shell. */
|
|
5
|
+
export declare const argvSchema: z.ZodArray<z.ZodString>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** A plain image reference (registry/repo[:tag]) pinned by digest; never anything Docker could read as an option. */
|
|
3
|
+
export const pinnedImageSchema = z.string().trim().regex(/^[a-zA-Z0-9][a-zA-Z0-9._/:-]*@sha256:[a-f0-9]{64}$/u, "image must be a reference pinned by @sha256 digest");
|
|
4
|
+
/** An argv: run directly, never through a shell. */
|
|
5
|
+
export const argvSchema = z.array(z.string().min(1)).min(1);
|
|
@@ -5,6 +5,8 @@ import { z } from "zod";
|
|
|
5
5
|
* declares `auth.method: grok` itself; it is never inherited.
|
|
6
6
|
*/
|
|
7
7
|
export declare const MODEL_REASONING_EFFORTS: readonly ["low", "medium", "high"];
|
|
8
|
+
/** Mirrors Daimon's ORGANIZATION_RUNTIME_CODEX_REASONING_EFFORTS contract. */
|
|
9
|
+
export declare const CODEX_MODEL_REASONING_EFFORTS: readonly ["none", "minimal", "low", "medium", "high", "xhigh", "max", "ultra", "persistent"];
|
|
8
10
|
export declare const modelEntryAuthSchema: z.ZodObject<{
|
|
9
11
|
key: z.ZodOptional<z.ZodString>;
|
|
10
12
|
method: z.ZodOptional<z.ZodEnum<{
|
|
@@ -43,9 +45,15 @@ export declare const modelTargetSchema: z.ZodObject<{
|
|
|
43
45
|
name: z.ZodString;
|
|
44
46
|
provider: z.ZodString;
|
|
45
47
|
reasoning_effort: z.ZodOptional<z.ZodEnum<{
|
|
48
|
+
none: "none";
|
|
46
49
|
high: "high";
|
|
47
50
|
medium: "medium";
|
|
48
51
|
low: "low";
|
|
52
|
+
minimal: "minimal";
|
|
53
|
+
xhigh: "xhigh";
|
|
54
|
+
max: "max";
|
|
55
|
+
ultra: "ultra";
|
|
56
|
+
persistent: "persistent";
|
|
49
57
|
}>>;
|
|
50
58
|
}, z.core.$strict>;
|
|
51
59
|
export declare const executionSchema: z.ZodObject<{
|
|
@@ -87,9 +95,15 @@ export declare const executionSchema: z.ZodObject<{
|
|
|
87
95
|
name: z.ZodString;
|
|
88
96
|
provider: z.ZodString;
|
|
89
97
|
reasoning_effort: z.ZodOptional<z.ZodEnum<{
|
|
98
|
+
none: "none";
|
|
90
99
|
high: "high";
|
|
91
100
|
medium: "medium";
|
|
92
101
|
low: "low";
|
|
102
|
+
minimal: "minimal";
|
|
103
|
+
xhigh: "xhigh";
|
|
104
|
+
max: "max";
|
|
105
|
+
ultra: "ultra";
|
|
106
|
+
persistent: "persistent";
|
|
93
107
|
}>>;
|
|
94
108
|
}, z.core.$strict>>>;
|
|
95
109
|
primary: z.ZodObject<{
|
|
@@ -113,9 +127,15 @@ export declare const executionSchema: z.ZodObject<{
|
|
|
113
127
|
name: z.ZodString;
|
|
114
128
|
provider: z.ZodString;
|
|
115
129
|
reasoning_effort: z.ZodOptional<z.ZodEnum<{
|
|
130
|
+
none: "none";
|
|
116
131
|
high: "high";
|
|
117
132
|
medium: "medium";
|
|
118
133
|
low: "low";
|
|
134
|
+
minimal: "minimal";
|
|
135
|
+
xhigh: "xhigh";
|
|
136
|
+
max: "max";
|
|
137
|
+
ultra: "ultra";
|
|
138
|
+
persistent: "persistent";
|
|
119
139
|
}>>;
|
|
120
140
|
}, z.core.$strict>;
|
|
121
141
|
}, z.core.$strict>>;
|
|
@@ -6,6 +6,8 @@ const modelAuthMethodSchema = z.enum(["api_key", "claude-code", "codex", "grok",
|
|
|
6
6
|
* declares `auth.method: grok` itself; it is never inherited.
|
|
7
7
|
*/
|
|
8
8
|
export const MODEL_REASONING_EFFORTS = ["low", "medium", "high"];
|
|
9
|
+
/** Mirrors Daimon's ORGANIZATION_RUNTIME_CODEX_REASONING_EFFORTS contract. */
|
|
10
|
+
export const CODEX_MODEL_REASONING_EFFORTS = ["none", "minimal", "low", "medium", "high", "xhigh", "max", "ultra", "persistent"];
|
|
9
11
|
const modelEndpointCompatibilitySchema = z.enum(["anthropic", "openai"]);
|
|
10
12
|
const modelAuthSchema = z
|
|
11
13
|
.object({
|
|
@@ -65,7 +67,7 @@ export const modelTargetSchema = z
|
|
|
65
67
|
endpoint: modelEndpointSchema.optional(),
|
|
66
68
|
name: z.string(),
|
|
67
69
|
provider: z.string(),
|
|
68
|
-
reasoning_effort: z.enum(
|
|
70
|
+
reasoning_effort: z.enum(CODEX_MODEL_REASONING_EFFORTS).optional()
|
|
69
71
|
})
|
|
70
72
|
.strict()
|
|
71
73
|
.superRefine((value, context) => {
|
|
@@ -75,10 +77,18 @@ export const modelTargetSchema = z
|
|
|
75
77
|
message: "grok auth is only valid for provider xai without an endpoint"
|
|
76
78
|
});
|
|
77
79
|
}
|
|
78
|
-
if (value.reasoning_effort !== undefined && value.auth?.method
|
|
80
|
+
if (value.reasoning_effort !== undefined && value.auth?.method === "grok") {
|
|
81
|
+
const effort = z.enum(MODEL_REASONING_EFFORTS).safeParse(value.reasoning_effort);
|
|
82
|
+
if (!effort.success) {
|
|
83
|
+
for (const issue of effort.error.issues) {
|
|
84
|
+
context.addIssue({ ...issue, path: ["reasoning_effort"] });
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
if (value.reasoning_effort !== undefined && value.auth?.method !== "grok" && value.auth?.method !== "codex") {
|
|
79
89
|
context.addIssue({
|
|
80
90
|
code: z.ZodIssueCode.custom,
|
|
81
|
-
message: "reasoning_effort is only valid on a model that declares auth.method grok"
|
|
91
|
+
message: "reasoning_effort is only valid on a model that declares auth.method grok or codex"
|
|
82
92
|
});
|
|
83
93
|
}
|
|
84
94
|
const usesCustomEndpoint = value.provider === "custom" || value.provider === "local";
|
package/dist/manifest/index.d.ts
CHANGED
package/dist/manifest/index.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
-
import { parse as parseYaml } from "yaml";
|
|
3
|
-
import { z } from "zod";
|
|
4
2
|
import { fileExists, isSymlink, readUtf8File, resolveProjectPath } from "../filesystem/index.js";
|
|
5
3
|
import { SpawnfileError } from "../shared/index.js";
|
|
6
|
-
import { isAgentManifest, isInlineAgentMember, isReferencedMember, isTeamManifest
|
|
4
|
+
import { isAgentManifest, isInlineAgentMember, isReferencedMember, isTeamManifest } from "./schemas.js";
|
|
5
|
+
import { parseManifest } from "./parseManifest.js";
|
|
7
6
|
import { parseSkillFrontmatter } from "./skillFrontmatter.js";
|
|
8
7
|
const ensureUniqueNames = (names, label) => {
|
|
9
8
|
const seen = new Set();
|
|
@@ -120,28 +119,6 @@ const validateLocalTeamManifest = async (manifestPath, manifest) => {
|
|
|
120
119
|
}
|
|
121
120
|
}
|
|
122
121
|
};
|
|
123
|
-
const parseManifest = (source) => {
|
|
124
|
-
let parsed;
|
|
125
|
-
try {
|
|
126
|
-
parsed = parseYaml(source);
|
|
127
|
-
}
|
|
128
|
-
catch (error) {
|
|
129
|
-
// A YAML syntax error is a malformed manifest, not a runtime failure — wrap
|
|
130
|
-
// it so it exits as a usage error instead of leaking the parser's wording.
|
|
131
|
-
const reason = error instanceof Error ? error.message : String(error);
|
|
132
|
-
throw new SpawnfileError("invalid_manifest", `Invalid Spawnfile manifest: ${reason}`);
|
|
133
|
-
}
|
|
134
|
-
try {
|
|
135
|
-
return manifestSchema.parse(parsed);
|
|
136
|
-
}
|
|
137
|
-
catch (error) {
|
|
138
|
-
if (error instanceof z.ZodError) {
|
|
139
|
-
const issue = error.issues[0];
|
|
140
|
-
throw new SpawnfileError("invalid_manifest", `Invalid Spawnfile manifest: ${issue.message}`);
|
|
141
|
-
}
|
|
142
|
-
throw error;
|
|
143
|
-
}
|
|
144
|
-
};
|
|
145
122
|
export const loadManifest = async (manifestPath) => {
|
|
146
123
|
let source;
|
|
147
124
|
try {
|
|
@@ -154,7 +131,7 @@ export const loadManifest = async (manifestPath) => {
|
|
|
154
131
|
}
|
|
155
132
|
throw error;
|
|
156
133
|
}
|
|
157
|
-
const manifest = parseManifest(source);
|
|
134
|
+
const manifest = parseManifest(source, manifestPath);
|
|
158
135
|
if (isAgentManifest(manifest)) {
|
|
159
136
|
await validateLocalAgentManifest(manifestPath, manifest);
|
|
160
137
|
}
|
|
@@ -16,3 +16,64 @@ export declare const mcpServerSchema: z.ZodObject<{
|
|
|
16
16
|
tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
17
17
|
url: z.ZodOptional<z.ZodString>;
|
|
18
18
|
}, z.core.$strict>;
|
|
19
|
+
/**
|
|
20
|
+
* A team `shared.environment.mcp_servers` entry. `opt_in: true` means members
|
|
21
|
+
* do not inherit it unless they list its name in their own `mcp_servers`
|
|
22
|
+
* (a bare `{ name }` or a narrowing override). Absent or false keeps today's
|
|
23
|
+
* behaviour: every direct member inherits it.
|
|
24
|
+
*/
|
|
25
|
+
export declare const sharedMcpServerSchema: z.ZodObject<{
|
|
26
|
+
opt_in: z.ZodOptional<z.ZodBoolean>;
|
|
27
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
28
|
+
auth: z.ZodOptional<z.ZodObject<{
|
|
29
|
+
mode: z.ZodOptional<z.ZodLiteral<"bearer">>;
|
|
30
|
+
secret: z.ZodString;
|
|
31
|
+
}, z.core.$strict>>;
|
|
32
|
+
command: z.ZodOptional<z.ZodString>;
|
|
33
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
34
|
+
name: z.ZodString;
|
|
35
|
+
transport: z.ZodEnum<{
|
|
36
|
+
sse: "sse";
|
|
37
|
+
stdio: "stdio";
|
|
38
|
+
streamable_http: "streamable_http";
|
|
39
|
+
}>;
|
|
40
|
+
tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
41
|
+
url: z.ZodOptional<z.ZodString>;
|
|
42
|
+
}, z.core.$strict>;
|
|
43
|
+
export type SharedMcpServer = z.infer<typeof sharedMcpServerSchema>;
|
|
44
|
+
/**
|
|
45
|
+
* An agent-level entry without `transport` narrows the inherited
|
|
46
|
+
* `shared.environment.mcp_servers` entry of the same name instead of replacing
|
|
47
|
+
* it: `tools` replaces the inherited allowlist and `env` is merged key by key.
|
|
48
|
+
* A bare `{ name }` takes the inherited server unchanged, which is how a
|
|
49
|
+
* member opts in to an `opt_in` shared server.
|
|
50
|
+
* Whether a server of that name is inherited is only known during graph
|
|
51
|
+
* resolution, so the compiler (not this schema) rejects an orphan override.
|
|
52
|
+
*/
|
|
53
|
+
export declare const mcpServerOverrideSchema: z.ZodObject<{
|
|
54
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
55
|
+
name: z.ZodString;
|
|
56
|
+
tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
57
|
+
}, z.core.$strict>;
|
|
58
|
+
export type McpServerDeclaration = z.infer<typeof mcpServerSchema>;
|
|
59
|
+
export type McpServerOverride = z.infer<typeof mcpServerOverrideSchema>;
|
|
60
|
+
export type McpServerEntry = McpServerDeclaration | McpServerOverride;
|
|
61
|
+
/** Agent-scope MCP entry: a complete server (has `transport`) or an override of an inherited one. */
|
|
62
|
+
export declare const mcpServerEntrySchema: z.ZodPipe<z.ZodUnknown, z.ZodTransform<{
|
|
63
|
+
name: string;
|
|
64
|
+
transport: "sse" | "stdio" | "streamable_http";
|
|
65
|
+
args?: string[] | undefined;
|
|
66
|
+
auth?: {
|
|
67
|
+
secret: string;
|
|
68
|
+
mode?: "bearer" | undefined;
|
|
69
|
+
} | undefined;
|
|
70
|
+
command?: string | undefined;
|
|
71
|
+
env?: Record<string, string> | undefined;
|
|
72
|
+
tools?: string[] | undefined;
|
|
73
|
+
url?: string | undefined;
|
|
74
|
+
} | {
|
|
75
|
+
name: string;
|
|
76
|
+
env?: Record<string, string> | undefined;
|
|
77
|
+
tools?: string[] | undefined;
|
|
78
|
+
}, unknown>>;
|
|
79
|
+
export declare const isMcpServerDeclaration: (entry: McpServerEntry) => entry is McpServerDeclaration;
|
|
@@ -14,24 +14,26 @@ const mcpAuthSchema = z
|
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
const mcpToolsSchema = z.array(z.string().min(1)).max(32);
|
|
18
|
+
const refineToolsAndName = (value, context) => {
|
|
19
|
+
if (value.tools !== undefined && (value.tools.length === 0 || new Set(value.tools).size !== value.tools.length))
|
|
20
|
+
context.addIssue({ code: z.ZodIssueCode.custom, message: "MCP tools must be a nonempty unique allowlist" });
|
|
21
|
+
if (value.name.startsWith("spawnfile.") || value.name.startsWith("mneme-")) {
|
|
22
|
+
context.addIssue({ code: z.ZodIssueCode.custom, message: "MCP server name is reserved for compiler-owned generated services" });
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
const mcpServerFields = {
|
|
19
26
|
args: z.array(z.string()).optional(),
|
|
20
27
|
auth: mcpAuthSchema.optional(),
|
|
21
28
|
command: z.string().optional(),
|
|
22
29
|
env: z.record(z.string(), z.string()).optional(),
|
|
23
30
|
name: z.string().min(1),
|
|
24
31
|
transport: z.enum(["sse", "stdio", "streamable_http"]),
|
|
25
|
-
tools:
|
|
32
|
+
tools: mcpToolsSchema.optional(),
|
|
26
33
|
url: z.string().optional()
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
if (value.tools !== undefined && (value.tools.length === 0 || new Set(value.tools).size !== value.tools.length))
|
|
31
|
-
context.addIssue({ code: z.ZodIssueCode.custom, message: "MCP tools must be a nonempty unique allowlist" });
|
|
32
|
-
if (value.name.startsWith("spawnfile.") || value.name.startsWith("mneme-")) {
|
|
33
|
-
context.addIssue({ code: z.ZodIssueCode.custom, message: "MCP server name is reserved for compiler-owned generated services" });
|
|
34
|
-
}
|
|
34
|
+
};
|
|
35
|
+
const refineServer = (value, context) => {
|
|
36
|
+
refineToolsAndName(value, context);
|
|
35
37
|
if (value.transport === "stdio" && !value.command) {
|
|
36
38
|
context.addIssue({ code: z.ZodIssueCode.custom, message: "stdio MCP servers must declare command" });
|
|
37
39
|
}
|
|
@@ -41,4 +43,48 @@ export const mcpServerSchema = z
|
|
|
41
43
|
if (value.transport !== "stdio" && !value.url) {
|
|
42
44
|
context.addIssue({ code: z.ZodIssueCode.custom, message: `${value.transport} MCP servers must declare url` });
|
|
43
45
|
}
|
|
46
|
+
};
|
|
47
|
+
export const mcpServerSchema = z.object(mcpServerFields).strict().superRefine(refineServer);
|
|
48
|
+
/**
|
|
49
|
+
* A team `shared.environment.mcp_servers` entry. `opt_in: true` means members
|
|
50
|
+
* do not inherit it unless they list its name in their own `mcp_servers`
|
|
51
|
+
* (a bare `{ name }` or a narrowing override). Absent or false keeps today's
|
|
52
|
+
* behaviour: every direct member inherits it.
|
|
53
|
+
*/
|
|
54
|
+
export const sharedMcpServerSchema = z
|
|
55
|
+
.object({ ...mcpServerFields, opt_in: z.boolean().optional() })
|
|
56
|
+
.strict()
|
|
57
|
+
.superRefine(refineServer);
|
|
58
|
+
/**
|
|
59
|
+
* An agent-level entry without `transport` narrows the inherited
|
|
60
|
+
* `shared.environment.mcp_servers` entry of the same name instead of replacing
|
|
61
|
+
* it: `tools` replaces the inherited allowlist and `env` is merged key by key.
|
|
62
|
+
* A bare `{ name }` takes the inherited server unchanged, which is how a
|
|
63
|
+
* member opts in to an `opt_in` shared server.
|
|
64
|
+
* Whether a server of that name is inherited is only known during graph
|
|
65
|
+
* resolution, so the compiler (not this schema) rejects an orphan override.
|
|
66
|
+
*/
|
|
67
|
+
export const mcpServerOverrideSchema = z
|
|
68
|
+
.object({
|
|
69
|
+
env: z.record(z.string(), z.string()).optional(),
|
|
70
|
+
name: z.string().min(1),
|
|
71
|
+
tools: mcpToolsSchema.optional()
|
|
72
|
+
})
|
|
73
|
+
.strict()
|
|
74
|
+
.superRefine((value, context) => {
|
|
75
|
+
refineToolsAndName(value, context);
|
|
76
|
+
});
|
|
77
|
+
const hasTransportKey = (value) => typeof value === "object" && value !== null && Object.hasOwn(value, "transport");
|
|
78
|
+
/** Agent-scope MCP entry: a complete server (has `transport`) or an override of an inherited one. */
|
|
79
|
+
export const mcpServerEntrySchema = z.unknown().transform((value, context) => {
|
|
80
|
+
const result = hasTransportKey(value)
|
|
81
|
+
? mcpServerSchema.safeParse(value)
|
|
82
|
+
: mcpServerOverrideSchema.safeParse(value);
|
|
83
|
+
if (result.success)
|
|
84
|
+
return result.data;
|
|
85
|
+
for (const issue of result.error.issues) {
|
|
86
|
+
context.addIssue({ code: "custom", message: issue.message, path: issue.path });
|
|
87
|
+
}
|
|
88
|
+
return z.NEVER;
|
|
44
89
|
});
|
|
90
|
+
export const isMcpServerDeclaration = (entry) => "transport" in entry;
|
|
@@ -76,7 +76,7 @@ declare const memoryRetentionSchema: z.ZodObject<{
|
|
|
76
76
|
declare const memoryAccessSchema: z.ZodObject<{
|
|
77
77
|
members: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
78
78
|
}, z.core.$strict>;
|
|
79
|
-
declare const memoryBankSchema: z.ZodObject<{
|
|
79
|
+
export declare const memoryBankSchema: z.ZodObject<{
|
|
80
80
|
access: z.ZodOptional<z.ZodObject<{
|
|
81
81
|
members: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
82
82
|
}, z.core.$strict>>;
|
|
@@ -127,7 +127,7 @@ const memoryAccessSchema = z
|
|
|
127
127
|
members: z.array(z.string().trim().min(1)).optional()
|
|
128
128
|
})
|
|
129
129
|
.strict();
|
|
130
|
-
const memoryBankSchema = z
|
|
130
|
+
export const memoryBankSchema = z
|
|
131
131
|
.object({
|
|
132
132
|
access: memoryAccessSchema.optional(),
|
|
133
133
|
consolidation: memoryConsolidationSchema.optional(),
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type Manifest } from "./schemas.js";
|
|
2
|
+
/**
|
|
3
|
+
* Parses one Spawnfile. Errors name the file, and the declared kind and name
|
|
4
|
+
* when the YAML got far enough to have them, so a member's malformed manifest
|
|
5
|
+
* is attributable from `spawnfile validate` on the organization root.
|
|
6
|
+
*/
|
|
7
|
+
export declare const parseManifest: (source: string, manifestPath: string) => Manifest;
|