spawnfile 0.1.33 → 0.1.35
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/audit/readAudit.d.ts +3 -3
- package/dist/auth/profileStore.d.ts +3 -1
- package/dist/auth/profileStore.js +31 -30
- package/dist/auth/trainingAuth.d.ts +2 -5
- package/dist/auth/types.d.ts +16 -0
- package/dist/cli/authCommands.d.ts +1 -1
- package/dist/cli/authCommands.js +21 -1
- package/dist/cli/devCommands.d.ts +1 -1
- package/dist/cli/devCommands.js +0 -66
- package/dist/cli/runCli.d.ts +3 -4
- package/dist/cli/runCli.js +4 -3
- package/dist/cli/trainCommand.js +9 -15
- package/dist/cli/trainingBooted.d.ts +9 -0
- package/dist/cli/trainingBooted.js +45 -0
- package/dist/cli/trainingExecution.d.ts +4 -7
- package/dist/cli/trainingExecution.js +4 -32
- package/dist/compiler/containerArtifacts.js +0 -5
- package/dist/compiler/containerBackedMountRender.js +5 -1
- package/dist/compiler/containerDaimonBrokerRender.d.ts +5 -50
- package/dist/compiler/containerDaimonBrokerRender.js +19 -90
- package/dist/compiler/containerDaimonGatewayRender.d.ts +50 -0
- package/dist/compiler/containerDaimonGatewayRender.js +161 -0
- package/dist/compiler/containerDaimonGrokWorkerProvisioning.d.ts +2 -10
- package/dist/compiler/containerDaimonGrokWorkerProvisioning.js +13 -25
- package/dist/compiler/containerDaimonGrokWorkerRender.d.ts +11 -49
- package/dist/compiler/containerDaimonGrokWorkerRender.js +15 -39
- package/dist/compiler/containerDaimonStartupSupervision.d.ts +8 -0
- package/dist/compiler/containerDaimonStartupSupervision.js +39 -0
- package/dist/compiler/containerDaimonUidEntrypointRender.d.ts +1 -2
- package/dist/compiler/containerDaimonUidEntrypointRender.js +29 -47
- package/dist/compiler/containerRuntimeReadinessRender.js +1 -1
- package/dist/compiler/memoryArtifacts.js +0 -1
- package/dist/compiler/moltnetArtifacts.js +1 -17
- package/dist/compiler/moltnetClientConfig.js +1 -1
- package/dist/compiler/moltnetRuntimeConfig.js +0 -10
- package/dist/compiler/runProject.d.ts +3 -0
- package/dist/compiler/runProject.js +12 -5
- package/dist/compiler/runProjectAuth.js +6 -18
- package/dist/compiler/training/contract.d.ts +0 -2
- package/dist/compiler/training/contract.js +0 -2
- package/dist/compiler/training/execution.d.ts +1 -128
- package/dist/compiler/training/execution.js +7 -68
- package/dist/compiler/training/index.d.ts +0 -8
- package/dist/compiler/training/index.js +0 -7
- package/dist/compiler/training/output.d.ts +1 -0
- package/dist/compiler/training/output.js +1 -1
- package/dist/compiler/training/rewind/contract.d.ts +6 -6
- package/dist/compiler/training/trial/boot.d.ts +72 -0
- package/dist/compiler/training/trial/boot.js +225 -0
- package/dist/compiler/training/trial/docker.d.ts +10 -0
- package/dist/compiler/training/trial/docker.js +22 -0
- package/dist/compiler/training/trial/gateway.d.ts +47 -0
- package/dist/compiler/training/trial/gateway.js +113 -0
- package/dist/compiler/training/trial/homeLogin.d.ts +31 -0
- package/dist/compiler/training/trial/homeLogin.js +69 -0
- package/dist/compiler/training/trial/index.d.ts +8 -0
- package/dist/compiler/training/trial/index.js +8 -0
- package/dist/compiler/training/trial/judge.d.ts +15 -0
- package/dist/compiler/training/trial/judge.js +42 -0
- package/dist/compiler/training/trial/launcher.d.ts +47 -0
- package/dist/compiler/training/trial/launcher.js +193 -0
- package/dist/compiler/training/trial/login.d.ts +35 -0
- package/dist/compiler/training/trial/login.js +85 -0
- package/dist/compiler/training/trial/project.d.ts +11 -0
- package/dist/compiler/training/trial/project.js +31 -0
- package/dist/compiler/training/trial/realmTurns.d.ts +20 -0
- package/dist/compiler/training/trial/realmTurns.js +69 -0
- package/dist/compiler/upReceipt.d.ts +2 -17
- package/dist/compiler/upReceipt.js +2 -17
- package/dist/deployment/artifactsExportPlan.js +2 -18
- package/dist/deployment/privateArtifactsExport.js +1 -1
- package/dist/dev/docker.d.ts +0 -5
- package/dist/dev/docker.js +0 -46
- package/dist/dev/index.d.ts +0 -1
- package/dist/dev/index.js +0 -1
- package/dist/dev/project.d.ts +0 -16
- package/dist/dev/project.js +1 -128
- package/dist/distribution/distributionReportSchema.js +1 -1
- package/dist/distribution/imageRuntimeAuth.js +3 -2
- package/dist/manifest/renderSpawnfile.js +2 -1
- package/dist/release/drainControl.d.ts +5 -19
- package/dist/release/drainControl.js +12 -67
- package/dist/report/types.d.ts +3 -6
- package/dist/runtime/common.d.ts +1 -1
- package/dist/runtime/common.js +1 -1
- package/dist/runtime/container.d.ts +2 -2
- package/dist/runtime/container.js +1 -39
- package/dist/runtime/daimon/config.js +8 -14
- package/dist/runtime/daimon/contractManifest.js +0 -1
- package/dist/runtime/daimon/contractManifestSchema.js +0 -1
- package/dist/runtime/daimon/control.d.ts +31 -0
- package/dist/runtime/daimon/control.js +83 -0
- package/dist/runtime/daimon/engineDescriptorSchema.js +0 -1
- package/dist/runtime/daimon/engineDescriptors.generated.d.ts +1 -1
- package/dist/runtime/daimon/engineDescriptors.generated.js +1 -2
- package/dist/runtime/daimon/engines.js +0 -1
- package/dist/runtime/daimon/gateway.d.ts +62 -0
- package/dist/runtime/daimon/gateway.js +77 -0
- package/dist/runtime/daimon/grokWorkerContract.d.ts +0 -5
- package/dist/runtime/daimon/grokWorkerContract.js +1 -13
- package/dist/runtime/daimon/index.d.ts +2 -0
- package/dist/runtime/daimon/index.js +2 -1
- package/dist/runtime/daimon/memory.js +1 -1
- package/dist/runtime/daimon/packageName.js +0 -1
- package/dist/runtime/daimon/runAuth.js +15 -4
- package/dist/runtime/daimon/runtimeIdentity.d.ts +2 -0
- package/dist/runtime/daimon/runtimeIdentity.js +2 -0
- package/dist/runtime/daimon/subscriptionRealms.d.ts +27 -3
- package/dist/runtime/daimon/subscriptionRealms.js +35 -13
- package/dist/runtime/daimon/testHelpers.d.ts +2 -0
- package/dist/runtime/{pi → daimon}/testHelpers.js +3 -3
- package/dist/runtime/daimon/training/booted/adapter.d.ts +50 -0
- package/dist/runtime/daimon/training/booted/adapter.js +60 -0
- package/dist/runtime/daimon/training/booted/adapter.js.map +1 -0
- package/dist/runtime/daimon/training/booted/index.d.ts +4 -0
- package/dist/runtime/daimon/training/booted/index.js +3 -0
- package/dist/runtime/daimon/training/booted/index.js.map +1 -0
- package/dist/runtime/daimon/training/booted/judge.d.ts +39 -0
- package/dist/runtime/daimon/training/booted/judge.js +122 -0
- package/dist/runtime/daimon/training/booted/judge.js.map +1 -0
- package/dist/runtime/daimon/training/index.d.ts +5 -0
- package/dist/runtime/daimon/training/index.js +8 -4
- package/dist/runtime/daimon/training/index.js.map +1 -1
- package/dist/runtime/daimon/wakeMoments.js +0 -1
- package/dist/runtime/install.js +0 -21
- package/dist/runtime/registry.js +0 -2
- package/dist/runtime/trainingGraderProviders.js +10 -4
- package/dist/runtime/trainingProviders.d.ts +5 -3
- package/dist/runtime/trainingProviders.js +21 -24
- package/dist/runtime/trainingSubjects.d.ts +0 -121
- package/dist/runtime/trainingSubjects.js +2 -13
- package/dist/runtime/types.d.ts +1 -8
- package/dist/runtime/usageRequestLedger.d.ts +2 -0
- package/dist/runtime/usageRequestLedger.js +3 -1
- package/dist/shared/errors.js +0 -1
- package/dist/shared/trainingLegacy/trainingLegacyHashDomains.d.ts +1 -0
- package/dist/shared/trainingLegacy/trainingLegacyHashDomains.js +1 -0
- package/dist/shared/trainingLegacy/trainingLegacyHashDomains.js.map +1 -1
- package/dist/status/lifecycleProbes.js +3 -6
- package/dist/status/moltnetWiringProbes.js +1 -17
- package/dist/training/subjects/index.d.ts +0 -1
- package/dist/training/subjects/index.js +0 -1
- package/dist/training/subjects/index.js.map +1 -1
- package/examples/README.md +0 -1
- package/examples/daimon-org/agents/mapper/Spawnfile +4 -1
- package/examples/daimon-org/teams/review/agents/reviewer/Spawnfile +4 -1
- package/examples/jungian-daimon-org/teams/luna/agents/animus/Spawnfile +5 -8
- package/examples/jungian-daimon-org/teams/luna/agents/representative/Spawnfile +1 -1
- package/examples/jungian-daimon-org/teams/luna/agents/shadow/Spawnfile +5 -8
- package/examples/jungian-daimon-org/teams/selene/agents/animus/Spawnfile +5 -8
- package/examples/jungian-daimon-org/teams/selene/agents/representative/Spawnfile +5 -8
- package/examples/jungian-daimon-org/teams/selene/agents/shadow/Spawnfile +1 -1
- package/examples/mixed-runtime-org/agents/localist/Spawnfile +7 -7
- package/package.json +4 -13
- package/runtimes.yaml +5 -15
- package/dist/compiler/containerDaimonGrokTaskClock.d.ts +0 -5
- package/dist/compiler/containerDaimonGrokTaskClock.js +0 -29
- package/dist/compiler/daimonTelemetryArtifacts.d.ts +0 -22
- package/dist/compiler/daimonTelemetryArtifacts.js +0 -56
- package/dist/compiler/training/broker/clockProbe.d.ts +0 -6
- package/dist/compiler/training/broker/clockProbe.js +0 -27
- package/dist/compiler/training/broker/declaration.d.ts +0 -54
- package/dist/compiler/training/broker/declaration.js +0 -70
- package/dist/compiler/training/broker/entrypoint.d.ts +0 -39
- package/dist/compiler/training/broker/entrypoint.js +0 -124
- package/dist/compiler/training/broker/evaluatorSecrets.d.ts +0 -2
- package/dist/compiler/training/broker/evaluatorSecrets.js +0 -62
- package/dist/compiler/training/broker/index.d.ts +0 -12
- package/dist/compiler/training/broker/index.js +0 -12
- package/dist/compiler/training/broker/main.d.ts +0 -2
- package/dist/compiler/training/broker/main.js +0 -14
- package/dist/compiler/training/broker/paths.d.ts +0 -236
- package/dist/compiler/training/broker/paths.js +0 -249
- package/dist/compiler/training/broker/processes.d.ts +0 -51
- package/dist/compiler/training/broker/processes.js +0 -102
- package/dist/compiler/training/broker/projection.d.ts +0 -61
- package/dist/compiler/training/broker/projection.js +0 -109
- package/dist/compiler/training/broker/provisioning.d.ts +0 -78
- package/dist/compiler/training/broker/provisioning.js +0 -231
- package/dist/compiler/training/broker/receipt.d.ts +0 -77
- package/dist/compiler/training/broker/receipt.js +0 -110
- package/dist/compiler/training/broker/recycleClient.d.ts +0 -33
- package/dist/compiler/training/broker/recycleClient.js +0 -112
- package/dist/compiler/training/broker/registration.d.ts +0 -46
- package/dist/compiler/training/broker/registration.js +0 -113
- package/dist/compiler/training/broker/reset.d.ts +0 -9
- package/dist/compiler/training/broker/reset.js +0 -71
- package/dist/compiler/training/broker/rootScript.d.ts +0 -32
- package/dist/compiler/training/broker/rootScript.js +0 -33
- package/dist/compiler/training/broker/runtime.d.ts +0 -22
- package/dist/compiler/training/broker/runtime.js +0 -128
- package/dist/compiler/training/broker/seccompRoutes.d.ts +0 -31
- package/dist/compiler/training/broker/seccompRoutes.js +0 -36
- package/dist/compiler/training/broker/supervisor.d.ts +0 -108
- package/dist/compiler/training/broker/supervisor.js +0 -172
- package/dist/compiler/training/broker/taskClock.d.ts +0 -5
- package/dist/compiler/training/broker/taskClock.js +0 -41
- package/dist/compiler/training/container/contract.d.ts +0 -54
- package/dist/compiler/training/container/contract.js +0 -52
- package/dist/compiler/training/container/evaluators.d.ts +0 -48
- package/dist/compiler/training/container/evaluators.js +0 -50
- package/dist/compiler/training/container/grokWriteback.d.ts +0 -8
- package/dist/compiler/training/container/grokWriteback.js +0 -26
- package/dist/compiler/training/container/index.d.ts +0 -5
- package/dist/compiler/training/container/index.js +0 -3
- package/dist/compiler/training/container/launch.d.ts +0 -21
- package/dist/compiler/training/container/launch.js +0 -280
- package/dist/compiler/training/container/nativeSlots.d.ts +0 -14
- package/dist/compiler/training/container/nativeSlots.js +0 -13
- package/dist/compiler/training/container/outputCopy.d.ts +0 -2
- package/dist/compiler/training/container/outputCopy.js +0 -72
- package/dist/compiler/training/container/outputVolume.d.ts +0 -28
- package/dist/compiler/training/container/outputVolume.js +0 -185
- package/dist/compiler/training/container/prepare.d.ts +0 -10
- package/dist/compiler/training/container/prepare.js +0 -125
- package/dist/compiler/training/container/process.d.ts +0 -14
- package/dist/compiler/training/container/process.js +0 -70
- package/dist/compiler/training/container/security.d.ts +0 -38
- package/dist/compiler/training/container/security.js +0 -68
- package/dist/compiler/training/container/subjectIsolation.d.ts +0 -5
- package/dist/compiler/training/container/subjectIsolation.js +0 -16
- package/dist/compiler/training/preparation/assets/Dockerfile +0 -100
- package/dist/compiler/training/preparation/assets/package-lock.json +0 -5483
- package/dist/compiler/training/preparation/broker.d.ts +0 -30
- package/dist/compiler/training/preparation/broker.js +0 -68
- package/dist/compiler/training/preparation/contextModes.d.ts +0 -12
- package/dist/compiler/training/preparation/contextModes.js +0 -38
- package/dist/compiler/training/preparation/contract.d.ts +0 -203
- package/dist/compiler/training/preparation/contract.js +0 -114
- package/dist/compiler/training/preparation/copyAssets.d.ts +0 -1
- package/dist/compiler/training/preparation/copyAssets.js +0 -8
- package/dist/compiler/training/preparation/daimonParent.d.ts +0 -42
- package/dist/compiler/training/preparation/daimonParent.js +0 -114
- package/dist/compiler/training/preparation/files.d.ts +0 -29
- package/dist/compiler/training/preparation/files.js +0 -146
- package/dist/compiler/training/preparation/image.d.ts +0 -28
- package/dist/compiler/training/preparation/image.js +0 -105
- package/dist/compiler/training/preparation/index.d.ts +0 -3
- package/dist/compiler/training/preparation/index.js +0 -2
- package/dist/compiler/training/preparation/inputs.d.ts +0 -24
- package/dist/compiler/training/preparation/inputs.js +0 -101
- package/dist/compiler/training/preparation/prepare.d.ts +0 -38
- package/dist/compiler/training/preparation/prepare.js +0 -224
- package/dist/compiler/training/preparation/scratch.d.ts +0 -8
- package/dist/compiler/training/preparation/scratch.js +0 -114
- package/dist/compiler/training/repair/compatibility.d.ts +0 -11
- package/dist/compiler/training/repair/compatibility.js +0 -45
- package/dist/compiler/training/repair/contract.d.ts +0 -832
- package/dist/compiler/training/repair/contract.js +0 -34
- package/dist/compiler/training/repair/index.d.ts +0 -3
- package/dist/compiler/training/repair/index.js +0 -3
- package/dist/compiler/training/repair/prepare.d.ts +0 -378
- package/dist/compiler/training/repair/prepare.js +0 -84
- package/dist/compiler/training/repair/witness.d.ts +0 -348
- package/dist/compiler/training/repair/witness.js +0 -62
- package/dist/compiler/training/subjectDeclaration.d.ts +0 -26
- package/dist/compiler/training/subjectDeclaration.js +0 -54
- package/dist/compiler/training/subjectLease.d.ts +0 -115
- package/dist/compiler/training/subjectLease.js +0 -179
- package/dist/dev/activity.d.ts +0 -14
- package/dist/dev/activity.js +0 -48
- package/dist/runtime/codex-exec/training/adapter.d.ts +0 -13
- package/dist/runtime/codex-exec/training/adapter.js +0 -101
- package/dist/runtime/codex-exec/training/adapter.js.map +0 -1
- package/dist/runtime/codex-exec/training/environment.d.ts +0 -3
- package/dist/runtime/codex-exec/training/environment.js +0 -26
- package/dist/runtime/codex-exec/training/environment.js.map +0 -1
- package/dist/runtime/codex-exec/training/index.d.ts +0 -2
- package/dist/runtime/codex-exec/training/index.js +0 -3
- package/dist/runtime/codex-exec/training/index.js.map +0 -1
- package/dist/runtime/codex-exec/training/protocol.d.ts +0 -15
- package/dist/runtime/codex-exec/training/protocol.js +0 -102
- package/dist/runtime/codex-exec/training/protocol.js.map +0 -1
- package/dist/runtime/codex-exec/training/providers/codex-subscription/index.d.ts +0 -1
- package/dist/runtime/codex-exec/training/providers/codex-subscription/index.js +0 -2
- package/dist/runtime/codex-exec/training/providers/codex-subscription/index.js.map +0 -1
- package/dist/runtime/codex-exec/training/providers/codex-subscription/protocol.d.ts +0 -17
- package/dist/runtime/codex-exec/training/providers/codex-subscription/protocol.js +0 -80
- package/dist/runtime/codex-exec/training/providers/codex-subscription/protocol.js.map +0 -1
- package/dist/runtime/codex-exec/training/providers/codex-subscription/provider.d.ts +0 -12
- package/dist/runtime/codex-exec/training/providers/codex-subscription/provider.js +0 -125
- package/dist/runtime/codex-exec/training/providers/codex-subscription/provider.js.map +0 -1
- package/dist/runtime/codex-exec/training/providers/codex-subscription/strict-schema.d.ts +0 -6
- package/dist/runtime/codex-exec/training/providers/codex-subscription/strict-schema.js +0 -219
- package/dist/runtime/codex-exec/training/providers/codex-subscription/strict-schema.js.map +0 -1
- package/dist/runtime/daimon/contractManifest.js.map +0 -1
- package/dist/runtime/daimon/contractManifestSchema.js.map +0 -1
- package/dist/runtime/daimon/engineDescriptorSchema.js.map +0 -1
- package/dist/runtime/daimon/engineDescriptors.generated.js.map +0 -1
- package/dist/runtime/daimon/engines.js.map +0 -1
- package/dist/runtime/daimon/index.js.map +0 -1
- package/dist/runtime/daimon/packageName.js.map +0 -1
- package/dist/runtime/daimon/training/legacy/adapter.d.ts +0 -11
- package/dist/runtime/daimon/training/legacy/adapter.js +0 -175
- package/dist/runtime/daimon/training/legacy/adapter.js.map +0 -1
- package/dist/runtime/daimon/training/legacy/index.d.ts +0 -2
- package/dist/runtime/daimon/training/legacy/index.js +0 -3
- package/dist/runtime/daimon/training/legacy/index.js.map +0 -1
- package/dist/runtime/daimon/training/legacy/public.d.ts +0 -49
- package/dist/runtime/daimon/training/legacy/public.js +0 -16
- package/dist/runtime/daimon/training/legacy/public.js.map +0 -1
- package/dist/runtime/daimon/training/native/adapter.d.ts +0 -18
- package/dist/runtime/daimon/training/native/adapter.js +0 -252
- package/dist/runtime/daimon/training/native/adapter.js.map +0 -1
- package/dist/runtime/daimon/training/native/admission.d.ts +0 -7
- package/dist/runtime/daimon/training/native/admission.js +0 -52
- package/dist/runtime/daimon/training/native/admission.js.map +0 -1
- package/dist/runtime/daimon/training/native/child/arguments.d.ts +0 -16
- package/dist/runtime/daimon/training/native/child/arguments.js +0 -70
- package/dist/runtime/daimon/training/native/child/arguments.js.map +0 -1
- package/dist/runtime/daimon/training/native/child/deferred-trial.d.ts +0 -24
- package/dist/runtime/daimon/training/native/child/deferred-trial.js +0 -63
- package/dist/runtime/daimon/training/native/child/deferred-trial.js.map +0 -1
- package/dist/runtime/daimon/training/native/child/diagnostics.d.ts +0 -58
- package/dist/runtime/daimon/training/native/child/diagnostics.js +0 -215
- package/dist/runtime/daimon/training/native/child/diagnostics.js.map +0 -1
- package/dist/runtime/daimon/training/native/child/fixture.d.ts +0 -16
- package/dist/runtime/daimon/training/native/child/fixture.js +0 -159
- package/dist/runtime/daimon/training/native/child/fixture.js.map +0 -1
- package/dist/runtime/daimon/training/native/child/grok.d.ts +0 -14
- package/dist/runtime/daimon/training/native/child/grok.js +0 -47
- package/dist/runtime/daimon/training/native/child/grok.js.map +0 -1
- package/dist/runtime/daimon/training/native/child/index.d.ts +0 -7
- package/dist/runtime/daimon/training/native/child/index.js +0 -5
- package/dist/runtime/daimon/training/native/child/index.js.map +0 -1
- package/dist/runtime/daimon/training/native/child/lifecycle.d.ts +0 -40
- package/dist/runtime/daimon/training/native/child/lifecycle.js +0 -400
- package/dist/runtime/daimon/training/native/child/lifecycle.js.map +0 -1
- package/dist/runtime/daimon/training/native/child/probe.d.ts +0 -2
- package/dist/runtime/daimon/training/native/child/probe.js +0 -11
- package/dist/runtime/daimon/training/native/child/probe.js.map +0 -1
- package/dist/runtime/daimon/training/native/child/sandbox.d.ts +0 -4
- package/dist/runtime/daimon/training/native/child/sandbox.js +0 -76
- package/dist/runtime/daimon/training/native/child/sandbox.js.map +0 -1
- package/dist/runtime/daimon/training/native/child/types.d.ts +0 -15
- package/dist/runtime/daimon/training/native/child/types.js +0 -2
- package/dist/runtime/daimon/training/native/child/types.js.map +0 -1
- package/dist/runtime/daimon/training/native/container/docker.d.ts +0 -29
- package/dist/runtime/daimon/training/native/container/docker.js +0 -105
- package/dist/runtime/daimon/training/native/container/docker.js.map +0 -1
- package/dist/runtime/daimon/training/native/container/grok-slot.d.ts +0 -22
- package/dist/runtime/daimon/training/native/container/grok-slot.js +0 -38
- package/dist/runtime/daimon/training/native/container/grok-slot.js.map +0 -1
- package/dist/runtime/daimon/training/native/container/index.d.ts +0 -6
- package/dist/runtime/daimon/training/native/container/index.js +0 -6
- package/dist/runtime/daimon/training/native/container/index.js.map +0 -1
- package/dist/runtime/daimon/training/native/container/lifecycle.d.ts +0 -8
- package/dist/runtime/daimon/training/native/container/lifecycle.js +0 -111
- package/dist/runtime/daimon/training/native/container/lifecycle.js.map +0 -1
- package/dist/runtime/daimon/training/native/container/manifest.d.ts +0 -17
- package/dist/runtime/daimon/training/native/container/manifest.js +0 -164
- package/dist/runtime/daimon/training/native/container/manifest.js.map +0 -1
- package/dist/runtime/daimon/training/native/container/native-preflight.d.ts +0 -8
- package/dist/runtime/daimon/training/native/container/native-preflight.js +0 -40
- package/dist/runtime/daimon/training/native/container/native-preflight.js.map +0 -1
- package/dist/runtime/daimon/training/native/container/preflight.d.ts +0 -15
- package/dist/runtime/daimon/training/native/container/preflight.js +0 -79
- package/dist/runtime/daimon/training/native/container/preflight.js.map +0 -1
- package/dist/runtime/daimon/training/native/container/slot.d.ts +0 -4
- package/dist/runtime/daimon/training/native/container/slot.js +0 -58
- package/dist/runtime/daimon/training/native/container/slot.js.map +0 -1
- package/dist/runtime/daimon/training/native/external.d.ts +0 -37
- package/dist/runtime/daimon/training/native/external.js +0 -75
- package/dist/runtime/daimon/training/native/external.js.map +0 -1
- package/dist/runtime/daimon/training/native/grants/authority.d.ts +0 -36
- package/dist/runtime/daimon/training/native/grants/authority.js +0 -49
- package/dist/runtime/daimon/training/native/grants/authority.js.map +0 -1
- package/dist/runtime/daimon/training/native/grants/index.d.ts +0 -2
- package/dist/runtime/daimon/training/native/grants/index.js +0 -3
- package/dist/runtime/daimon/training/native/grants/index.js.map +0 -1
- package/dist/runtime/daimon/training/native/grants/pins.d.ts +0 -30
- package/dist/runtime/daimon/training/native/grants/pins.js +0 -20
- package/dist/runtime/daimon/training/native/grants/pins.js.map +0 -1
- package/dist/runtime/daimon/training/native/grants/test-socket.d.ts +0 -6
- package/dist/runtime/daimon/training/native/grants/test-socket.js +0 -35
- package/dist/runtime/daimon/training/native/grants/test-socket.js.map +0 -1
- package/dist/runtime/daimon/training/native/grok-fixtures.d.ts +0 -34
- package/dist/runtime/daimon/training/native/grok-fixtures.js +0 -179
- package/dist/runtime/daimon/training/native/grok-fixtures.js.map +0 -1
- package/dist/runtime/daimon/training/native/index.d.ts +0 -38
- package/dist/runtime/daimon/training/native/index.js +0 -27
- package/dist/runtime/daimon/training/native/index.js.map +0 -1
- package/dist/runtime/daimon/training/native/live-checkout.d.ts +0 -2
- package/dist/runtime/daimon/training/native/live-checkout.js +0 -15
- package/dist/runtime/daimon/training/native/live-checkout.js.map +0 -1
- package/dist/runtime/daimon/training/native/observations.d.ts +0 -51
- package/dist/runtime/daimon/training/native/observations.js +0 -217
- package/dist/runtime/daimon/training/native/observations.js.map +0 -1
- package/dist/runtime/daimon/training/native/outcome.d.ts +0 -13
- package/dist/runtime/daimon/training/native/outcome.js +0 -37
- package/dist/runtime/daimon/training/native/outcome.js.map +0 -1
- package/dist/runtime/daimon/training/native/preparation/engine-config.d.ts +0 -21
- package/dist/runtime/daimon/training/native/preparation/engine-config.js +0 -30
- package/dist/runtime/daimon/training/native/preparation/engine-config.js.map +0 -1
- package/dist/runtime/daimon/training/native/preparation/fixtures.d.ts +0 -17
- package/dist/runtime/daimon/training/native/preparation/fixtures.js +0 -52
- package/dist/runtime/daimon/training/native/preparation/fixtures.js.map +0 -1
- package/dist/runtime/daimon/training/native/preparation/index.d.ts +0 -7
- package/dist/runtime/daimon/training/native/preparation/index.js +0 -5
- package/dist/runtime/daimon/training/native/preparation/index.js.map +0 -1
- package/dist/runtime/daimon/training/native/preparation/layout.d.ts +0 -66
- package/dist/runtime/daimon/training/native/preparation/layout.js +0 -87
- package/dist/runtime/daimon/training/native/preparation/layout.js.map +0 -1
- package/dist/runtime/daimon/training/native/preparation/subject.d.ts +0 -14
- package/dist/runtime/daimon/training/native/preparation/subject.js +0 -67
- package/dist/runtime/daimon/training/native/preparation/subject.js.map +0 -1
- package/dist/runtime/daimon/training/native/preparation/types.d.ts +0 -69
- package/dist/runtime/daimon/training/native/preparation/types.js +0 -2
- package/dist/runtime/daimon/training/native/preparation/types.js.map +0 -1
- package/dist/runtime/daimon/training/native/receipt/artifacts.d.ts +0 -25
- package/dist/runtime/daimon/training/native/receipt/artifacts.js +0 -32
- package/dist/runtime/daimon/training/native/receipt/artifacts.js.map +0 -1
- package/dist/runtime/daimon/training/native/receipt/grok-clocked-pins.d.ts +0 -129
- package/dist/runtime/daimon/training/native/receipt/grok-clocked-pins.js +0 -45
- package/dist/runtime/daimon/training/native/receipt/grok-clocked-pins.js.map +0 -1
- package/dist/runtime/daimon/training/native/receipt/grok.d.ts +0 -246
- package/dist/runtime/daimon/training/native/receipt/grok.js +0 -195
- package/dist/runtime/daimon/training/native/receipt/grok.js.map +0 -1
- package/dist/runtime/daimon/training/native/receipt/index.d.ts +0 -11
- package/dist/runtime/daimon/training/native/receipt/index.js +0 -8
- package/dist/runtime/daimon/training/native/receipt/index.js.map +0 -1
- package/dist/runtime/daimon/training/native/receipt/paths.d.ts +0 -3
- package/dist/runtime/daimon/training/native/receipt/paths.js +0 -18
- package/dist/runtime/daimon/training/native/receipt/paths.js.map +0 -1
- package/dist/runtime/daimon/training/native/receipt/sandbox.d.ts +0 -42
- package/dist/runtime/daimon/training/native/receipt/sandbox.js +0 -35
- package/dist/runtime/daimon/training/native/receipt/sandbox.js.map +0 -1
- package/dist/runtime/daimon/training/native/receipt/schema.d.ts +0 -490
- package/dist/runtime/daimon/training/native/receipt/schema.js +0 -138
- package/dist/runtime/daimon/training/native/receipt/schema.js.map +0 -1
- package/dist/runtime/daimon/training/native/receipt/subscription.d.ts +0 -13
- package/dist/runtime/daimon/training/native/receipt/subscription.js +0 -13
- package/dist/runtime/daimon/training/native/receipt/subscription.js.map +0 -1
- package/dist/runtime/daimon/training/native/receipt/task-clock.d.ts +0 -19
- package/dist/runtime/daimon/training/native/receipt/task-clock.js +0 -49
- package/dist/runtime/daimon/training/native/receipt/task-clock.js.map +0 -1
- package/dist/runtime/daimon/training/native/sealed-usage.d.ts +0 -218
- package/dist/runtime/daimon/training/native/sealed-usage.js +0 -261
- package/dist/runtime/daimon/training/native/sealed-usage.js.map +0 -1
- package/dist/runtime/daimon/training/native/test-fixtures.d.ts +0 -27
- package/dist/runtime/daimon/training/native/test-fixtures.js +0 -162
- package/dist/runtime/daimon/training/native/test-fixtures.js.map +0 -1
- package/dist/runtime/daimon/training/native/transcript.d.ts +0 -96
- package/dist/runtime/daimon/training/native/transcript.js +0 -239
- package/dist/runtime/daimon/training/native/transcript.js.map +0 -1
- package/dist/runtime/daimon/training/native/transport/delivery.d.ts +0 -27
- package/dist/runtime/daimon/training/native/transport/delivery.js +0 -98
- package/dist/runtime/daimon/training/native/transport/delivery.js.map +0 -1
- package/dist/runtime/daimon/training/native/transport/http.d.ts +0 -3
- package/dist/runtime/daimon/training/native/transport/http.js +0 -81
- package/dist/runtime/daimon/training/native/transport/http.js.map +0 -1
- package/dist/runtime/daimon/training/native/transport/index.d.ts +0 -4
- package/dist/runtime/daimon/training/native/transport/index.js +0 -3
- package/dist/runtime/daimon/training/native/transport/index.js.map +0 -1
- package/dist/runtime/daimon/training/native/transport/types.d.ts +0 -15
- package/dist/runtime/daimon/training/native/transport/types.js +0 -2
- package/dist/runtime/daimon/training/native/transport/types.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/cli.d.ts +0 -1
- package/dist/runtime/daimon/training/native/worker/cli.js +0 -17
- package/dist/runtime/daimon/training/native/worker/cli.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/control.d.ts +0 -20
- package/dist/runtime/daimon/training/native/worker/control.js +0 -266
- package/dist/runtime/daimon/training/native/worker/control.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/deliveries.d.ts +0 -38
- package/dist/runtime/daimon/training/native/worker/deliveries.js +0 -91
- package/dist/runtime/daimon/training/native/worker/deliveries.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/evidence/collect.d.ts +0 -54
- package/dist/runtime/daimon/training/native/worker/evidence/collect.js +0 -278
- package/dist/runtime/daimon/training/native/worker/evidence/collect.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/evidence/execution.d.ts +0 -102
- package/dist/runtime/daimon/training/native/worker/evidence/execution.js +0 -191
- package/dist/runtime/daimon/training/native/worker/evidence/execution.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/evidence/index.d.ts +0 -3
- package/dist/runtime/daimon/training/native/worker/evidence/index.js +0 -4
- package/dist/runtime/daimon/training/native/worker/evidence/index.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/evidence/io.d.ts +0 -20
- package/dist/runtime/daimon/training/native/worker/evidence/io.js +0 -130
- package/dist/runtime/daimon/training/native/worker/evidence/io.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/evidence/seal.d.ts +0 -3
- package/dist/runtime/daimon/training/native/worker/evidence/seal.js +0 -67
- package/dist/runtime/daimon/training/native/worker/evidence/seal.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/index.d.ts +0 -11
- package/dist/runtime/daimon/training/native/worker/index.js +0 -8
- package/dist/runtime/daimon/training/native/worker/index.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/profile.d.ts +0 -23
- package/dist/runtime/daimon/training/native/worker/profile.js +0 -149
- package/dist/runtime/daimon/training/native/worker/profile.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/public.d.ts +0 -53
- package/dist/runtime/daimon/training/native/worker/public.js +0 -22
- package/dist/runtime/daimon/training/native/worker/public.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/sandbox.d.ts +0 -4
- package/dist/runtime/daimon/training/native/worker/sandbox.js +0 -54
- package/dist/runtime/daimon/training/native/worker/sandbox.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/server.d.ts +0 -4
- package/dist/runtime/daimon/training/native/worker/server.js +0 -102
- package/dist/runtime/daimon/training/native/worker/server.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/types.d.ts +0 -318
- package/dist/runtime/daimon/training/native/worker/types.js +0 -2
- package/dist/runtime/daimon/training/native/worker/types.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/wake-delivery/index.d.ts +0 -4
- package/dist/runtime/daimon/training/native/worker/wake-delivery/index.js +0 -4
- package/dist/runtime/daimon/training/native/worker/wake-delivery/index.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/wake-delivery/source.d.ts +0 -3
- package/dist/runtime/daimon/training/native/worker/wake-delivery/source.js +0 -16
- package/dist/runtime/daimon/training/native/worker/wake-delivery/source.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/wake-delivery/terminal.d.ts +0 -4
- package/dist/runtime/daimon/training/native/worker/wake-delivery/terminal.js +0 -52
- package/dist/runtime/daimon/training/native/worker/wake-delivery/terminal.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/wake-delivery/transport.d.ts +0 -21
- package/dist/runtime/daimon/training/native/worker/wake-delivery/transport.js +0 -198
- package/dist/runtime/daimon/training/native/worker/wake-delivery/transport.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/wake-delivery/types.d.ts +0 -91
- package/dist/runtime/daimon/training/native/worker/wake-delivery/types.js +0 -2
- package/dist/runtime/daimon/training/native/worker/wake-delivery/types.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/worker.d.ts +0 -1
- package/dist/runtime/daimon/training/native/worker/worker.js +0 -105
- package/dist/runtime/daimon/training/native/worker/worker.js.map +0 -1
- package/dist/runtime/daimon/training/providers/grok-broker/broker.d.ts +0 -20
- package/dist/runtime/daimon/training/providers/grok-broker/broker.js +0 -55
- package/dist/runtime/daimon/training/providers/grok-broker/broker.js.map +0 -1
- package/dist/runtime/daimon/training/providers/grok-broker/grant-fixtures.d.ts +0 -15
- package/dist/runtime/daimon/training/providers/grok-broker/grant-fixtures.js +0 -29
- package/dist/runtime/daimon/training/providers/grok-broker/grant-fixtures.js.map +0 -1
- package/dist/runtime/daimon/training/providers/grok-broker/grant-home.d.ts +0 -16
- package/dist/runtime/daimon/training/providers/grok-broker/grant-home.js +0 -60
- package/dist/runtime/daimon/training/providers/grok-broker/grant-home.js.map +0 -1
- package/dist/runtime/daimon/training/providers/grok-broker/grant-pool.d.ts +0 -81
- package/dist/runtime/daimon/training/providers/grok-broker/grant-pool.js +0 -221
- package/dist/runtime/daimon/training/providers/grok-broker/grant-pool.js.map +0 -1
- package/dist/runtime/daimon/training/providers/grok-broker/grant-releases.d.ts +0 -31
- package/dist/runtime/daimon/training/providers/grok-broker/grant-releases.js +0 -78
- package/dist/runtime/daimon/training/providers/grok-broker/grant-releases.js.map +0 -1
- package/dist/runtime/daimon/training/providers/grok-broker/grants.d.ts +0 -63
- package/dist/runtime/daimon/training/providers/grok-broker/grants.js +0 -20
- package/dist/runtime/daimon/training/providers/grok-broker/grants.js.map +0 -1
- package/dist/runtime/daimon/training/providers/grok-broker/index.d.ts +0 -3
- package/dist/runtime/daimon/training/providers/grok-broker/index.js +0 -4
- package/dist/runtime/daimon/training/providers/grok-broker/index.js.map +0 -1
- package/dist/runtime/daimon/training/providers/grok-subscription/cli.d.ts +0 -21
- package/dist/runtime/daimon/training/providers/grok-subscription/cli.js +0 -81
- package/dist/runtime/daimon/training/providers/grok-subscription/cli.js.map +0 -1
- package/dist/runtime/daimon/training/providers/grok-subscription/index.d.ts +0 -4
- package/dist/runtime/daimon/training/providers/grok-subscription/index.js +0 -5
- package/dist/runtime/daimon/training/providers/grok-subscription/index.js.map +0 -1
- package/dist/runtime/daimon/training/providers/grok-subscription/protocol.d.ts +0 -26
- package/dist/runtime/daimon/training/providers/grok-subscription/protocol.js +0 -102
- package/dist/runtime/daimon/training/providers/grok-subscription/protocol.js.map +0 -1
- package/dist/runtime/daimon/training/providers/grok-subscription/provider.d.ts +0 -9
- package/dist/runtime/daimon/training/providers/grok-subscription/provider.js +0 -38
- package/dist/runtime/daimon/training/providers/grok-subscription/provider.js.map +0 -1
- package/dist/runtime/daimon/training/public.d.ts +0 -6
- package/dist/runtime/daimon/training/public.js +0 -5
- package/dist/runtime/daimon/training/public.js.map +0 -1
- package/dist/runtime/daimon/training/services/account-lease.d.ts +0 -7
- package/dist/runtime/daimon/training/services/account-lease.js +0 -76
- package/dist/runtime/daimon/training/services/account-lease.js.map +0 -1
- package/dist/runtime/daimon/training/services/freshness.d.ts +0 -15
- package/dist/runtime/daimon/training/services/freshness.js +0 -19
- package/dist/runtime/daimon/training/services/freshness.js.map +0 -1
- package/dist/runtime/daimon/training/services/index.d.ts +0 -4
- package/dist/runtime/daimon/training/services/index.js +0 -4
- package/dist/runtime/daimon/training/services/index.js.map +0 -1
- package/dist/runtime/daimon/training/services/slot-freshness.d.ts +0 -34
- package/dist/runtime/daimon/training/services/slot-freshness.js +0 -178
- package/dist/runtime/daimon/training/services/slot-freshness.js.map +0 -1
- package/dist/runtime/daimon/wakeMoments.js.map +0 -1
- package/dist/runtime/pi/adapter.d.ts +0 -3
- package/dist/runtime/pi/adapter.js +0 -230
- package/dist/runtime/pi/appActivitySource.d.ts +0 -1
- package/dist/runtime/pi/appActivitySource.js +0 -199
- package/dist/runtime/pi/appAgentConfig.d.ts +0 -11
- package/dist/runtime/pi/appAgentConfig.js +0 -264
- package/dist/runtime/pi/appCliEnginesSource.d.ts +0 -1
- package/dist/runtime/pi/appCliEnginesSource.js +0 -183
- package/dist/runtime/pi/appCliSource.d.ts +0 -1
- package/dist/runtime/pi/appCliSource.js +0 -353
- package/dist/runtime/pi/appControlSource.d.ts +0 -1
- package/dist/runtime/pi/appControlSource.js +0 -390
- package/dist/runtime/pi/appControlWakeIdentitySource.d.ts +0 -1
- package/dist/runtime/pi/appControlWakeIdentitySource.js +0 -19
- package/dist/runtime/pi/appCoreSource.d.ts +0 -4
- package/dist/runtime/pi/appCoreSource.js +0 -244
- package/dist/runtime/pi/appPreludeSource.d.ts +0 -1
- package/dist/runtime/pi/appPreludeSource.js +0 -192
- package/dist/runtime/pi/appScheduleSource.d.ts +0 -1
- package/dist/runtime/pi/appScheduleSource.js +0 -84
- package/dist/runtime/pi/appScriptedEngine.d.ts +0 -31
- package/dist/runtime/pi/appScriptedEngine.js +0 -42
- package/dist/runtime/pi/appSource.d.ts +0 -4
- package/dist/runtime/pi/appSource.js +0 -12
- package/dist/runtime/pi/appTemplate.d.ts +0 -14
- package/dist/runtime/pi/appTemplate.js +0 -28
- package/dist/runtime/pi/appTemplateTypes.d.ts +0 -64
- package/dist/runtime/pi/appTemplateTypes.js +0 -18
- package/dist/runtime/pi/appWakeContextSource.d.ts +0 -1
- package/dist/runtime/pi/appWakeContextSource.js +0 -398
- package/dist/runtime/pi/containerTargets.d.ts +0 -4
- package/dist/runtime/pi/containerTargets.js +0 -63
- package/dist/runtime/pi/runAuth.d.ts +0 -2
- package/dist/runtime/pi/runAuth.js +0 -185
- package/dist/runtime/pi/testHelpers.d.ts +0 -2
- package/dist/shared/errors.js.map +0 -1
- package/dist/training/subjects/environment.d.ts +0 -2
- package/dist/training/subjects/environment.js +0 -14
- package/dist/training/subjects/environment.js.map +0 -1
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { type TrainingPlan } from "./plan/contract.js";
|
|
3
3
|
import type { LoadedTrainingProject } from "./plan/types.js";
|
|
4
|
-
export declare const TRAINING_EXECUTION_FILE = "/run/spawnfile-training/execution.json";
|
|
5
|
-
export { TRAINING_EXECUTION_CAPABILITY_LABEL, TRAINING_EXECUTION_VERSION } from "./contract.js";
|
|
6
4
|
export declare const trainingExecutionSchema: z.ZodObject<{
|
|
7
5
|
version: z.ZodLiteral<"spawnfile.training-execution.v1">;
|
|
8
6
|
authoring: z.ZodObject<{
|
|
@@ -151,10 +149,8 @@ export interface LowerTrainingExecutionOptions {
|
|
|
151
149
|
project: LoadedTrainingProject;
|
|
152
150
|
plan: TrainingPlan;
|
|
153
151
|
args: readonly string[];
|
|
154
|
-
trainingConfig?: string;
|
|
155
|
-
trainingImage?: string;
|
|
156
152
|
}
|
|
157
|
-
/** Resolve
|
|
153
|
+
/** Resolve authoring defaults into training CLI arguments; no writes, auth reads or execution. */
|
|
158
154
|
export declare const lowerTrainingExecution: (options: LowerTrainingExecutionOptions) => Promise<{
|
|
159
155
|
execution: {
|
|
160
156
|
version: "spawnfile.training-execution.v1";
|
|
@@ -287,129 +283,6 @@ export declare const lowerTrainingExecution: (options: LowerTrainingExecutionOpt
|
|
|
287
283
|
args: string[];
|
|
288
284
|
output: string;
|
|
289
285
|
};
|
|
290
|
-
trainingConfig: string;
|
|
291
|
-
trainingImage: string | undefined;
|
|
292
|
-
declaration: {
|
|
293
|
-
version: "spawnfile.training-container.v1" | "spawnfile.training-container.v3" | "spawnfile.training-container.v4";
|
|
294
|
-
slots: number;
|
|
295
|
-
dockerContext: string;
|
|
296
|
-
inputs: {
|
|
297
|
-
source: string;
|
|
298
|
-
destination: string;
|
|
299
|
-
}[];
|
|
300
|
-
output: {
|
|
301
|
-
source: string;
|
|
302
|
-
destination: "/run/training/output";
|
|
303
|
-
};
|
|
304
|
-
auth: {
|
|
305
|
-
source: string;
|
|
306
|
-
provider: "codex" | "claude";
|
|
307
|
-
}[];
|
|
308
|
-
evaluatorRoutes?: {
|
|
309
|
-
purpose: "decisions" | "extraction" | "proposals";
|
|
310
|
-
provider: "codex-subscription" | "typesafe";
|
|
311
|
-
model: string;
|
|
312
|
-
maxRequests: number;
|
|
313
|
-
maxSpendUsd?: number | undefined;
|
|
314
|
-
}[] | undefined;
|
|
315
|
-
evaluatorSecrets?: {
|
|
316
|
-
provider: "typesafe";
|
|
317
|
-
source: string;
|
|
318
|
-
}[] | undefined;
|
|
319
|
-
subjectIsolation?: "codex-native-sandbox" | undefined;
|
|
320
|
-
broker?: {
|
|
321
|
-
engine: "grok";
|
|
322
|
-
realmVolume: string;
|
|
323
|
-
bootstrap: string;
|
|
324
|
-
declaration: string;
|
|
325
|
-
} | undefined;
|
|
326
|
-
} | {
|
|
327
|
-
version: "spawnfile.training-container.v3" | "spawnfile.training-container.v4" | "spawnfile.training-container.v2";
|
|
328
|
-
slots: number;
|
|
329
|
-
dockerContext: string;
|
|
330
|
-
image: {
|
|
331
|
-
ref: string;
|
|
332
|
-
} | {
|
|
333
|
-
build: {
|
|
334
|
-
recipe: "daimon-dspy.v1";
|
|
335
|
-
nativeImage: string;
|
|
336
|
-
pythonImage: string;
|
|
337
|
-
platform: "linux/amd64" | "linux/arm64";
|
|
338
|
-
claude: string;
|
|
339
|
-
integration: {
|
|
340
|
-
source: string;
|
|
341
|
-
entry: string;
|
|
342
|
-
execution?: "spawnfile.training-execution.v1" | undefined;
|
|
343
|
-
};
|
|
344
|
-
compiler?: string | undefined;
|
|
345
|
-
grok?: {
|
|
346
|
-
source: string;
|
|
347
|
-
sha256: string;
|
|
348
|
-
} | undefined;
|
|
349
|
-
bootstrap?: string | undefined;
|
|
350
|
-
};
|
|
351
|
-
};
|
|
352
|
-
integration: {
|
|
353
|
-
settings: {
|
|
354
|
-
input: string;
|
|
355
|
-
path: string;
|
|
356
|
-
};
|
|
357
|
-
};
|
|
358
|
-
inputs: {
|
|
359
|
-
id: string;
|
|
360
|
-
source: string;
|
|
361
|
-
destination: string;
|
|
362
|
-
include?: string[] | undefined;
|
|
363
|
-
git?: {
|
|
364
|
-
revision: string;
|
|
365
|
-
overlays: {
|
|
366
|
-
source: string;
|
|
367
|
-
path: string;
|
|
368
|
-
sha256: string;
|
|
369
|
-
}[];
|
|
370
|
-
} | undefined;
|
|
371
|
-
}[];
|
|
372
|
-
output: {
|
|
373
|
-
source: string;
|
|
374
|
-
destination: "/run/training/output";
|
|
375
|
-
};
|
|
376
|
-
auth: {
|
|
377
|
-
source: string;
|
|
378
|
-
provider: "codex" | "claude";
|
|
379
|
-
}[];
|
|
380
|
-
evaluatorRoutes?: {
|
|
381
|
-
purpose: "decisions" | "extraction" | "proposals";
|
|
382
|
-
provider: "codex-subscription" | "typesafe";
|
|
383
|
-
model: string;
|
|
384
|
-
maxRequests: number;
|
|
385
|
-
maxSpendUsd?: number | undefined;
|
|
386
|
-
}[] | undefined;
|
|
387
|
-
evaluatorSecrets?: {
|
|
388
|
-
provider: "typesafe";
|
|
389
|
-
source: string;
|
|
390
|
-
}[] | undefined;
|
|
391
|
-
subjectIsolation?: "codex-native-sandbox" | undefined;
|
|
392
|
-
broker?: {
|
|
393
|
-
maxRunRequests: number;
|
|
394
|
-
engine: "grok";
|
|
395
|
-
agentId: string;
|
|
396
|
-
model: "grok-4.6" | "grok-4.5" | "grok-build";
|
|
397
|
-
reasoningEffort: "low" | "medium" | "high";
|
|
398
|
-
architecture: "arm64" | "x64";
|
|
399
|
-
limits: {
|
|
400
|
-
maxRequests: number;
|
|
401
|
-
maxTokens: number;
|
|
402
|
-
timeoutMs: number;
|
|
403
|
-
};
|
|
404
|
-
realmVolume: string;
|
|
405
|
-
bootstrap: string;
|
|
406
|
-
unenforcedBindPolicy?: "refuse" | "profile-only" | undefined;
|
|
407
|
-
} | undefined;
|
|
408
|
-
};
|
|
409
286
|
}>;
|
|
410
287
|
/** Allocation is separate so dry-run never creates a directory, and aliases fail before writes. */
|
|
411
288
|
export declare const allocateTrainingOutputParent: (output: string) => Promise<void>;
|
|
412
|
-
/** Preserve identities and all dataset roles while projecting only filesystem addresses. */
|
|
413
|
-
export declare const mapTrainingExecution: (execution: TrainingExecution, map: (file: string) => string) => TrainingExecution;
|
|
414
|
-
/** Resume changes position/presence of --resume, not the experiment's effective inputs. */
|
|
415
|
-
export declare const trainingExecutionIdentity: (execution: TrainingExecution) => unknown;
|
|
@@ -5,11 +5,6 @@ import { z } from "zod";
|
|
|
5
5
|
import { defaultTrainingOutputRoot } from "./output.js";
|
|
6
6
|
import { SpawnfileError } from "../../shared/index.js";
|
|
7
7
|
import { trainingPlanSchema, trainingPlanOptimizerSchema } from "./plan/contract.js";
|
|
8
|
-
import { trainingPreparationSchema } from "./preparation/contract.js";
|
|
9
|
-
import { readBoundedJson } from "./preparation/inputs.js";
|
|
10
|
-
import { trainingContainerConfigSchema, trainingImageSchema } from "./container/contract.js";
|
|
11
|
-
export const TRAINING_EXECUTION_FILE = "/run/spawnfile-training/execution.json";
|
|
12
|
-
export { TRAINING_EXECUTION_CAPABILITY_LABEL, TRAINING_EXECUTION_VERSION } from "./contract.js";
|
|
13
8
|
export const trainingExecutionSchema = z.object({
|
|
14
9
|
version: z.literal("spawnfile.training-execution.v1"),
|
|
15
10
|
authoring: trainingPlanSchema,
|
|
@@ -34,32 +29,11 @@ const exists = async (file) => {
|
|
|
34
29
|
throw error;
|
|
35
30
|
}
|
|
36
31
|
};
|
|
37
|
-
/** Resolve
|
|
32
|
+
/** Resolve authoring defaults into training CLI arguments; no writes, auth reads or execution. */
|
|
38
33
|
export const lowerTrainingExecution = async (options) => {
|
|
39
34
|
const { project, plan } = options;
|
|
40
35
|
if (!plan.targets.length || !plan.optimizer)
|
|
41
36
|
return invalid(`Agent ${plan.agent.id} has no executable training targets`);
|
|
42
|
-
const agent = project.compilePlan.nodes.find(node => node.id === plan.agent.id);
|
|
43
|
-
const agentDirectory = path.dirname(agent.value.kind === "agent" ? agent.value.sourcePath ?? agent.value.source : agent.value.source);
|
|
44
|
-
const candidates = [...new Set([agentDirectory, project.root].map(root => path.join(root, "training/container.json")))];
|
|
45
|
-
let trainingConfig = options.trainingConfig === undefined ? undefined : path.resolve(options.trainingConfig);
|
|
46
|
-
if (trainingConfig === undefined)
|
|
47
|
-
for (const file of candidates)
|
|
48
|
-
if (await exists(file)) {
|
|
49
|
-
trainingConfig = file;
|
|
50
|
-
break;
|
|
51
|
-
}
|
|
52
|
-
if (trainingConfig === undefined)
|
|
53
|
-
return invalid(`Training requires a container declaration at ${candidates.join(" or ")}, or --training-config`);
|
|
54
|
-
trainingConfig = await realpath(trainingConfig);
|
|
55
|
-
const raw = await readBoundedJson(trainingConfig);
|
|
56
|
-
const preparation = raw.version === "spawnfile.training-container.v2" ||
|
|
57
|
-
(["spawnfile.training-container.v3", "spawnfile.training-container.v4"].includes(String(raw.version)) && raw.image !== undefined);
|
|
58
|
-
const declaration = preparation ? trainingPreparationSchema.parse(raw) : trainingContainerConfigSchema.parse(raw);
|
|
59
|
-
const trainingImage = options.trainingImage === undefined ? undefined : trainingImageSchema.parse(options.trainingImage);
|
|
60
|
-
if (!preparation && trainingImage === undefined) {
|
|
61
|
-
return invalid("A lowered container launch configuration requires --training-image; use a v2/v4 preparation declaration for a declared image");
|
|
62
|
-
}
|
|
63
37
|
const args = [...options.args];
|
|
64
38
|
if (!args.includes("--experiment-timeout-ms") && !args.includes("--timeout-ms")) {
|
|
65
39
|
args.push("--experiment-timeout-ms", String(plan.deadlines?.experiment_ms ?? 43_200_000));
|
|
@@ -84,11 +58,6 @@ export const lowerTrainingExecution = async (options) => {
|
|
|
84
58
|
args.push("--optimizer-model", plan.optimizer.model);
|
|
85
59
|
if (args.includes("--resume") && option(args, "--out") === undefined)
|
|
86
60
|
return invalid("--resume requires --out identifying the exact prior experiment");
|
|
87
|
-
const output = path.resolve(option(args, "--out") ?? path.join(defaultTrainingOutputRoot(project.root, declaration.inputs.map(input => path.resolve(path.dirname(trainingConfig), input.source))), encodeURIComponent(plan.agent.id), `${new Date().toISOString().replace(/[:.]/gu, "-")}-${randomUUID().slice(0, 8)}`));
|
|
88
|
-
if (!args.includes("--out"))
|
|
89
|
-
args.push("--out", output);
|
|
90
|
-
else
|
|
91
|
-
args[args.indexOf("--out") + 1] = output;
|
|
92
61
|
const datasetPins = [...new Set(plan.targets.flatMap(target => Object.values(target.datasets)
|
|
93
62
|
.filter(dataset => dataset !== null).map(dataset => dataset.sourcePath)))].map(sourcePath => {
|
|
94
63
|
const loaded = project.datasets[sourcePath];
|
|
@@ -96,9 +65,14 @@ export const lowerTrainingExecution = async (options) => {
|
|
|
96
65
|
return invalid(`Authored dataset was not captured during plan loading: ${sourcePath}`);
|
|
97
66
|
return { sourcePath, sha256: loaded.sha256 };
|
|
98
67
|
});
|
|
68
|
+
const output = path.resolve(option(args, "--out") ?? path.join(defaultTrainingOutputRoot(project.root, datasetPins.map(pin => pin.sourcePath)), encodeURIComponent(plan.agent.id), `${new Date().toISOString().replace(/[:.]/gu, "-")}-${randomUUID().slice(0, 8)}`));
|
|
69
|
+
if (!args.includes("--out"))
|
|
70
|
+
args.push("--out", output);
|
|
71
|
+
else
|
|
72
|
+
args[args.indexOf("--out") + 1] = output;
|
|
99
73
|
const execution = trainingExecutionSchema.parse({ version: "spawnfile.training-execution.v1", authoring: plan, datasetPins,
|
|
100
74
|
optimizer: { ...plan.optimizer, model: option(args, "--optimizer-model") }, args, output });
|
|
101
|
-
return { execution
|
|
75
|
+
return { execution };
|
|
102
76
|
};
|
|
103
77
|
/** Allocation is separate so dry-run never creates a directory, and aliases fail before writes. */
|
|
104
78
|
export const allocateTrainingOutputParent = async (output) => {
|
|
@@ -123,38 +97,3 @@ export const allocateTrainingOutputParent = async (output) => {
|
|
|
123
97
|
invalid("Training output parent must be a canonical directory");
|
|
124
98
|
}
|
|
125
99
|
};
|
|
126
|
-
/** Preserve identities and all dataset roles while projecting only filesystem addresses. */
|
|
127
|
-
export const mapTrainingExecution = (execution, map) => {
|
|
128
|
-
const source = (value) => ({ ...value, sourcePath: map(value.sourcePath) });
|
|
129
|
-
const args = [...execution.args];
|
|
130
|
-
for (let index = 0; index < args.length; index++) {
|
|
131
|
-
if (["--train", "--validation", "--test", "--out", "--cost-config"].includes(args[index]))
|
|
132
|
-
args[++index] = map(args[index]);
|
|
133
|
-
else if (args[index] === "--resource") {
|
|
134
|
-
const value = args[++index], split = value.indexOf("=");
|
|
135
|
-
args[index] = `${value.slice(0, split)}=${map(value.slice(split + 1))}`;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
return trainingExecutionSchema.parse({ ...execution, datasetPins: execution.datasetPins.map(source), args, output: map(execution.output), authoring: {
|
|
139
|
-
...execution.authoring,
|
|
140
|
-
...(execution.authoring.preparation ? { preparation: { ...execution.authoring.preparation,
|
|
141
|
-
...(execution.authoring.preparation.history ? { history: map(execution.authoring.preparation.history) } : {}) } } : {}),
|
|
142
|
-
project: { root: map(execution.authoring.project.root), manifest: map(execution.authoring.project.manifest) },
|
|
143
|
-
graders: execution.authoring.graders.map(source),
|
|
144
|
-
targets: execution.authoring.targets.map(target => ({ ...target, files: target.files.map(source), datasets: {
|
|
145
|
-
train: source(target.datasets.train), test: source(target.datasets.test),
|
|
146
|
-
validation: target.datasets.validation === null ? null : source(target.datasets.validation)
|
|
147
|
-
} }))
|
|
148
|
-
} });
|
|
149
|
-
};
|
|
150
|
-
/** Resume changes position/presence of --resume, not the experiment's effective inputs. */
|
|
151
|
-
export const trainingExecutionIdentity = (execution) => {
|
|
152
|
-
const flags = [];
|
|
153
|
-
for (let index = 0; index < execution.args.length; index++) {
|
|
154
|
-
const flag = execution.args[index];
|
|
155
|
-
if (flag === "--resume")
|
|
156
|
-
continue;
|
|
157
|
-
flags.push(flag === "--dry-run" ? [flag] : [flag, execution.args[++index]]);
|
|
158
|
-
}
|
|
159
|
-
return { ...execution, args: flags.sort(([left], [right]) => left < right ? -1 : left > right ? 1 : 0) };
|
|
160
|
-
};
|
|
@@ -3,14 +3,6 @@ export * from "./context.js";
|
|
|
3
3
|
export * from "./plan/index.js";
|
|
4
4
|
export * from "./rewind/index.js";
|
|
5
5
|
export type { ResolvedTraining, ResolvedTrainingGrader } from "./resolution.js";
|
|
6
|
-
export { parseTrainingMappedPreparation, trainingPreparationSchema } from "./preparation/contract.js";
|
|
7
|
-
export { prepareTrainingEvaluators } from "./container/evaluators.js";
|
|
8
|
-
export type { TrainingMappedPreparation } from "./preparation/contract.js";
|
|
9
|
-
export { TRAINING_SLOTS_FILE, TRAINING_SLOTS_VERSION, trainingSlotPaths, trainingSlotDescriptors, trainingSlotsDocument, type TrainingSlotsDocument, type TrainingSlotPaths, type TrainingSlotDescriptor } from "./broker/paths.js";
|
|
10
6
|
export * from "./execution.js";
|
|
11
7
|
export * from "./moments.js";
|
|
12
8
|
export * from "./compiledAgent.js";
|
|
13
|
-
export { TRAINING_FAKETIME_LIBRARY_PATH } from "./container/contract.js";
|
|
14
|
-
export * from "./subjectLease.js";
|
|
15
|
-
export * from "./subjectDeclaration.js";
|
|
16
|
-
export { recycleTrainingSlot, type RecycleTrainingSlotOptions, type TrainingSlotRecycleReceipt } from "./broker/recycleClient.js";
|
|
@@ -2,13 +2,6 @@ export * from "./contract.js";
|
|
|
2
2
|
export * from "./context.js";
|
|
3
3
|
export * from "./plan/index.js";
|
|
4
4
|
export * from "./rewind/index.js";
|
|
5
|
-
export { parseTrainingMappedPreparation, trainingPreparationSchema } from "./preparation/contract.js";
|
|
6
|
-
export { prepareTrainingEvaluators } from "./container/evaluators.js";
|
|
7
|
-
export { TRAINING_SLOTS_FILE, TRAINING_SLOTS_VERSION, trainingSlotPaths, trainingSlotDescriptors, trainingSlotsDocument } from "./broker/paths.js";
|
|
8
5
|
export * from "./execution.js";
|
|
9
6
|
export * from "./moments.js";
|
|
10
7
|
export * from "./compiledAgent.js";
|
|
11
|
-
export { TRAINING_FAKETIME_LIBRARY_PATH } from "./container/contract.js";
|
|
12
|
-
export * from "./subjectLease.js";
|
|
13
|
-
export * from "./subjectDeclaration.js";
|
|
14
|
-
export { recycleTrainingSlot } from "./broker/recycleClient.js";
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
export declare const within: (root: string, file: string) => boolean;
|
|
1
2
|
/** Durable default namespace disjoint from every declared input, even a project ancestor. */
|
|
2
3
|
export declare const defaultTrainingOutputRoot: (projectRoot: string, inputs?: readonly string[]) => string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
|
|
3
|
+
export const within = (root, file) => file === root || file.startsWith(root + path.sep);
|
|
4
4
|
/** Durable default namespace disjoint from every declared input, even a project ancestor. */
|
|
5
5
|
export const defaultTrainingOutputRoot = (projectRoot, inputs = []) => {
|
|
6
6
|
const sources = [projectRoot, ...inputs].map(source => path.resolve(source));
|
|
@@ -17,9 +17,9 @@ export declare const materializedInputSchema: z.ZodObject<{
|
|
|
17
17
|
id: z.ZodString;
|
|
18
18
|
declaredBy: z.ZodString;
|
|
19
19
|
kind: z.ZodEnum<{
|
|
20
|
-
moltnet: "moltnet";
|
|
21
|
-
memory: "memory";
|
|
22
20
|
volume: "volume";
|
|
21
|
+
memory: "memory";
|
|
22
|
+
moltnet: "moltnet";
|
|
23
23
|
git: "git";
|
|
24
24
|
feed: "feed";
|
|
25
25
|
bundle: "bundle";
|
|
@@ -81,9 +81,9 @@ export declare const materializedMomentSchema: z.ZodObject<{
|
|
|
81
81
|
id: z.ZodString;
|
|
82
82
|
declaredBy: z.ZodString;
|
|
83
83
|
kind: z.ZodEnum<{
|
|
84
|
-
moltnet: "moltnet";
|
|
85
|
-
memory: "memory";
|
|
86
84
|
volume: "volume";
|
|
85
|
+
memory: "memory";
|
|
86
|
+
moltnet: "moltnet";
|
|
87
87
|
git: "git";
|
|
88
88
|
feed: "feed";
|
|
89
89
|
bundle: "bundle";
|
|
@@ -228,9 +228,9 @@ export declare const materializedMomentJsonSchema: z.core.ZodStandardJSONSchemaP
|
|
|
228
228
|
id: z.ZodString;
|
|
229
229
|
declaredBy: z.ZodString;
|
|
230
230
|
kind: z.ZodEnum<{
|
|
231
|
-
moltnet: "moltnet";
|
|
232
|
-
memory: "memory";
|
|
233
231
|
volume: "volume";
|
|
232
|
+
memory: "memory";
|
|
233
|
+
moltnet: "moltnet";
|
|
234
234
|
git: "git";
|
|
235
235
|
feed: "feed";
|
|
236
236
|
bundle: "bundle";
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { ResolvedAuthProfile } from "../../../auth/index.js";
|
|
2
|
+
import { type DaimonControlCall } from "../../../runtime/daimon/control.js";
|
|
3
|
+
import { type UsageRecord } from "../../../runtime/usageLedger.js";
|
|
4
|
+
import { type TrialDocker } from "./docker.js";
|
|
5
|
+
import type { TrainingGatewayAccess } from "./gateway.js";
|
|
6
|
+
/**
|
|
7
|
+
* Lineage namespace for training trials: every trial derives its own durable
|
|
8
|
+
* volume names, so no trial ever attaches production's, dev's or another
|
|
9
|
+
* trial's state (see `deploymentLineage.ts`).
|
|
10
|
+
*/
|
|
11
|
+
export declare const TRAINING_TRIAL_LINEAGE_NAMESPACE = "training";
|
|
12
|
+
export interface TrialOptions {
|
|
13
|
+
agentManifestPath: string;
|
|
14
|
+
instructions: string;
|
|
15
|
+
trialId: string;
|
|
16
|
+
/** Fresh per trial; holds the trial project, compile output and boot env file. */
|
|
17
|
+
directory: string;
|
|
18
|
+
docker?: TrialDocker;
|
|
19
|
+
control?: DaimonControlCall;
|
|
20
|
+
}
|
|
21
|
+
export interface TrialWake {
|
|
22
|
+
state: "completed" | "failed" | "stopped" | "timeout";
|
|
23
|
+
acceptanceId: string;
|
|
24
|
+
executionId: string | null;
|
|
25
|
+
code: string | null;
|
|
26
|
+
text: string;
|
|
27
|
+
/** Usage ledger rows this wake appended; empty means none were written, never zero spend. */
|
|
28
|
+
usage: UsageRecord[];
|
|
29
|
+
/** The engine's own newest session record, bounded; null when none exists. */
|
|
30
|
+
transcript: string | null;
|
|
31
|
+
/** Per model request of this wake, the tool-call names its response carried; null where the runtime could not say. */
|
|
32
|
+
requestToolCalls: (readonly string[] | null)[];
|
|
33
|
+
}
|
|
34
|
+
export interface BootedTrial {
|
|
35
|
+
container: string;
|
|
36
|
+
wake(text: string, options: {
|
|
37
|
+
deliveryId: string;
|
|
38
|
+
timeoutMs: number;
|
|
39
|
+
signal?: AbortSignal;
|
|
40
|
+
}): Promise<TrialWake>;
|
|
41
|
+
/** Credential-shaped files anywhere in the trial container (expected: none). */
|
|
42
|
+
scanCredentials(): Promise<string[]>;
|
|
43
|
+
teardown(): Promise<void>;
|
|
44
|
+
}
|
|
45
|
+
export interface PreparedTrial {
|
|
46
|
+
image: string;
|
|
47
|
+
runtimeRoot: string;
|
|
48
|
+
engines: string[];
|
|
49
|
+
agentId: string;
|
|
50
|
+
/**
|
|
51
|
+
* Boots the organization. `gateway` is null for an organization on no
|
|
52
|
+
* gatewayed engine; `realms` is a profile view holding only the
|
|
53
|
+
* volume-held logins (`spawnfile auth login`) this organization mounts.
|
|
54
|
+
*/
|
|
55
|
+
boot(gateway: TrainingGatewayAccess | null, options?: {
|
|
56
|
+
readyTimeoutMs?: number;
|
|
57
|
+
realms?: ResolvedAuthProfile;
|
|
58
|
+
}): Promise<BootedTrial>;
|
|
59
|
+
/** Runs the organization's own `auth <engine> login` attached to the operator's terminal, or returns its argv on `dryRun`. */
|
|
60
|
+
login(realms: ResolvedAuthProfile, options?: {
|
|
61
|
+
dryRun?: boolean;
|
|
62
|
+
}): Promise<readonly string[]>;
|
|
63
|
+
dispose(): Promise<void>;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Readable and collision-free: trial ids may share long prefixes. The cut can
|
|
67
|
+
* land just after a hyphen, so it is trimmed: the slug names a kebab-case
|
|
68
|
+
* deployment, which refuses a doubled hyphen.
|
|
69
|
+
*/
|
|
70
|
+
export declare const trialSlug: (trialId: string) => string;
|
|
71
|
+
/** Compiles and builds the trial's one-agent organization under its own lineage, as production does. */
|
|
72
|
+
export declare const prepareTrial: (options: TrialOptions) => Promise<PreparedTrial>;
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import { createHash, randomBytes } from "node:crypto";
|
|
2
|
+
import { mkdir, rm, writeFile } from "node:fs/promises";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { DAIMON_GATEWAY_KEY_ENV, DAIMON_GATEWAY_URL_ENV, daimonProfileRealmVolume, getDaimonEngineDescriptor, isDaimonGatewayRealmMountId } from "../../../runtime/daimon/index.js";
|
|
5
|
+
import { daimonHelperControlCall } from "../../../runtime/daimon/control.js";
|
|
6
|
+
import { RUNTIME_INSTALL_ROOT } from "../../../runtime/container.js";
|
|
7
|
+
import { parseUsageLedger } from "../../../runtime/usageLedger.js";
|
|
8
|
+
import { parseUsageRequestLedger } from "../../../runtime/usageRequestLedger.js";
|
|
9
|
+
import { DAIMON_GROK_TURN_USAGE_LEDGER } from "../../../runtime/daimon/contractManifest.js";
|
|
10
|
+
import { SpawnfileError } from "../../../shared/index.js";
|
|
11
|
+
import { buildCompiledProject } from "../../buildProject.js";
|
|
12
|
+
import { compileProject } from "../../compileProject.js";
|
|
13
|
+
import { resolveDeploymentLineage } from "../../deploymentLineage.js";
|
|
14
|
+
import { slugify } from "../../helpers.js";
|
|
15
|
+
import { createDockerRunInvocation, runDockerContainer } from "../../runProject.js";
|
|
16
|
+
import { executeDockerRunWithSupportCleanup } from "../../runProjectLifecycle.js";
|
|
17
|
+
import { createTrialDocker, waitFor } from "./docker.js";
|
|
18
|
+
import { HOME_LOGIN_FILES, saveHomeLogin, seedHomeLogin } from "./homeLogin.js";
|
|
19
|
+
import { writeTrialProject } from "./project.js";
|
|
20
|
+
/**
|
|
21
|
+
* Lineage namespace for training trials: every trial derives its own durable
|
|
22
|
+
* volume names, so no trial ever attaches production's, dev's or another
|
|
23
|
+
* trial's state (see `deploymentLineage.ts`).
|
|
24
|
+
*/
|
|
25
|
+
export const TRAINING_TRIAL_LINEAGE_NAMESPACE = "training";
|
|
26
|
+
const CONTROL_TOKEN_ENV = "SPAWNFILE_DAIMON_CONTROL_TOKEN";
|
|
27
|
+
const WAKE_VERSION = "noopolis.daimon.wake.v2";
|
|
28
|
+
const TERMINAL = new Set(["completed", "failed", "stopped"]);
|
|
29
|
+
const MAX_TRANSCRIPT_BYTES = 1024 * 1024;
|
|
30
|
+
/**
|
|
31
|
+
* Readable and collision-free: trial ids may share long prefixes. The cut can
|
|
32
|
+
* land just after a hyphen, so it is trimmed: the slug names a kebab-case
|
|
33
|
+
* deployment, which refuses a doubled hyphen.
|
|
34
|
+
*/
|
|
35
|
+
export const trialSlug = (trialId) => `${slugify(trialId).slice(0, 32).replace(/-+$/u, "") || "trial"}-${createHash("sha256").update(trialId).digest("hex").slice(0, 8)}`;
|
|
36
|
+
/** Compiles and builds the trial's one-agent organization under its own lineage, as production does. */
|
|
37
|
+
export const prepareTrial = async (options) => {
|
|
38
|
+
const docker = options.docker ?? createTrialDocker();
|
|
39
|
+
const slug = trialSlug(options.trialId);
|
|
40
|
+
const image = `spawnfile-training-trial:${slug}`;
|
|
41
|
+
const compiled = await (async () => {
|
|
42
|
+
const project = await writeTrialProject(options.agentManifestPath, options.instructions, path.join(options.directory, "project"));
|
|
43
|
+
const compiled = await compileProject(project, {
|
|
44
|
+
deploymentLineage: resolveDeploymentLineage(slug, TRAINING_TRIAL_LINEAGE_NAMESPACE),
|
|
45
|
+
outputDirectory: path.join(options.directory, "out")
|
|
46
|
+
});
|
|
47
|
+
await buildCompiledProject(project, compiled, { imageTag: image });
|
|
48
|
+
return compiled;
|
|
49
|
+
})().catch(async (error) => {
|
|
50
|
+
await rm(options.directory, { recursive: true, force: true });
|
|
51
|
+
throw error;
|
|
52
|
+
});
|
|
53
|
+
const instance = compiled.report.container?.runtime_instances.find((entry) => entry.runtime === "daimon");
|
|
54
|
+
const agents = Object.entries(instance?.engine_by_node_id ?? {});
|
|
55
|
+
if (!instance || agents.length !== 1)
|
|
56
|
+
throw new SpawnfileError("validation_error", "A production-booted trial compiles exactly one Daimon agent");
|
|
57
|
+
const [agentId, engine] = agents[0];
|
|
58
|
+
const home = instance.agent_paths?.[agentId]?.home_path;
|
|
59
|
+
// The engine writes its own session records under its home inside the agent's runtime home.
|
|
60
|
+
const engineHome = getDaimonEngineDescriptor(engine)?.homeDirectory;
|
|
61
|
+
const sessionsPath = home && engineHome !== undefined ? path.posix.join(home, engineHome, "sessions") : null;
|
|
62
|
+
const lineageVolumes = (realms) => (compiled.report.container?.persistent_mounts ?? [])
|
|
63
|
+
.filter((mount) => !isDaimonGatewayRealmMountId(mount.id) && daimonProfileRealmVolume(mount.id, realms) === undefined)
|
|
64
|
+
.map((mount) => mount.volume_name);
|
|
65
|
+
/**
|
|
66
|
+
* The profile's home login (`spawnfile auth login`) for this organization's
|
|
67
|
+
* fresh runtime home: seeded into it before the container starts, written
|
|
68
|
+
* back after it stops. Only the engine's login files cross; the home itself
|
|
69
|
+
* is the trial's own and is removed with it.
|
|
70
|
+
*/
|
|
71
|
+
const homeLoginFor = (realms) => {
|
|
72
|
+
const files = HOME_LOGIN_FILES[engine];
|
|
73
|
+
const loginVolume = realms?.realms?.[engine]?.homeVolume;
|
|
74
|
+
if (!files || !loginVolume)
|
|
75
|
+
return undefined;
|
|
76
|
+
const mount = (compiled.report.container?.persistent_mounts ?? []).find((entry) => entry.mount_path === home);
|
|
77
|
+
if (!mount)
|
|
78
|
+
throw new SpawnfileError("validation_error", `The ${engine} runtime home of ${agentId} is not a persistent mount; its login cannot be seeded`);
|
|
79
|
+
return { files, homeMountPath: mount.mount_path, homeVolume: mount.volume_name, loginVolume };
|
|
80
|
+
};
|
|
81
|
+
const removeVolumes = async (volumes) => {
|
|
82
|
+
for (const volume of volumes)
|
|
83
|
+
await docker(["volume", "rm", "-f", volume]).catch(() => undefined);
|
|
84
|
+
};
|
|
85
|
+
const dispose = async () => {
|
|
86
|
+
await docker(["image", "rm", "-f", image]).catch(() => undefined);
|
|
87
|
+
await rm(options.directory, { recursive: true, force: true });
|
|
88
|
+
};
|
|
89
|
+
return {
|
|
90
|
+
agentId, dispose, image,
|
|
91
|
+
engines: agents.map(([, engine]) => engine),
|
|
92
|
+
runtimeRoot: `${RUNTIME_INSTALL_ROOT}/daimon`,
|
|
93
|
+
login: async (realms, loginOptions = {}) => {
|
|
94
|
+
const homeLogin = homeLoginFor(realms);
|
|
95
|
+
const invocation = await createDockerRunInvocation(compiled, image, {
|
|
96
|
+
authProfile: realms, command: ["auth", engine, "login", "--config", instance.config_path],
|
|
97
|
+
containerName: `spawnfile-login-${slug}`, interactive: true
|
|
98
|
+
});
|
|
99
|
+
if (loginOptions.dryRun) {
|
|
100
|
+
await rm(invocation.supportDirectory, { recursive: true, force: true });
|
|
101
|
+
return [invocation.command, ...invocation.args];
|
|
102
|
+
}
|
|
103
|
+
try {
|
|
104
|
+
await executeDockerRunWithSupportCleanup(invocation, runDockerContainer);
|
|
105
|
+
if (homeLogin)
|
|
106
|
+
await saveHomeLogin(docker, image, homeLogin);
|
|
107
|
+
}
|
|
108
|
+
finally {
|
|
109
|
+
await removeVolumes(lineageVolumes(realms));
|
|
110
|
+
}
|
|
111
|
+
return [invocation.command, ...invocation.args];
|
|
112
|
+
},
|
|
113
|
+
boot: async (gateway, bootOptions = {}) => {
|
|
114
|
+
const token = randomBytes(32).toString("base64url");
|
|
115
|
+
const container = `spawnfile-trial-${slug}`;
|
|
116
|
+
await mkdir(options.directory, { recursive: true });
|
|
117
|
+
const envFilePath = path.join(options.directory, "boot.env");
|
|
118
|
+
// The boot inputs: control token, plus the gateway URL and key. No gatewayed login, no
|
|
119
|
+
// gatewayed realm; only a volume-held login of the selected profile is mounted.
|
|
120
|
+
const gatewayEnv = gateway ? `${DAIMON_GATEWAY_URL_ENV}=${gateway.url}\n${DAIMON_GATEWAY_KEY_ENV}=${gateway.key}\n` : "";
|
|
121
|
+
await writeFile(envFilePath, `${CONTROL_TOKEN_ENV}=${token}\n${gatewayEnv}`, { mode: 0o600 });
|
|
122
|
+
const invocation = await createDockerRunInvocation(compiled, image, {
|
|
123
|
+
authProfile: bootOptions.realms ?? null, containerName: container, deploymentName: slug, detach: true, envFilePath,
|
|
124
|
+
...(gateway ? { network: gateway.network } : {})
|
|
125
|
+
});
|
|
126
|
+
const volumes = lineageVolumes(bootOptions.realms);
|
|
127
|
+
const homeLogin = homeLoginFor(bootOptions.realms);
|
|
128
|
+
const teardown = async () => {
|
|
129
|
+
try {
|
|
130
|
+
// Stopped, not killed, so the engine finishes any login rewrite before it is saved.
|
|
131
|
+
if (homeLogin)
|
|
132
|
+
await docker(["stop", "--time", "10", container]).catch(() => undefined);
|
|
133
|
+
await docker(["rm", "-f", container]).catch(() => undefined);
|
|
134
|
+
if (homeLogin)
|
|
135
|
+
await saveHomeLogin(docker, image, homeLogin);
|
|
136
|
+
}
|
|
137
|
+
finally {
|
|
138
|
+
await removeVolumes(volumes);
|
|
139
|
+
await rm(invocation.supportDirectory, { recursive: true, force: true });
|
|
140
|
+
await rm(envFilePath, { force: true });
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
try {
|
|
144
|
+
if (homeLogin)
|
|
145
|
+
await seedHomeLogin(docker, image, homeLogin);
|
|
146
|
+
await executeDockerRunWithSupportCleanup(invocation, runDockerContainer);
|
|
147
|
+
await rm(envFilePath, { force: true });
|
|
148
|
+
const target = { containerRef: container, dockerArgs: [], dockerCommand: "docker", imageRef: image, token };
|
|
149
|
+
const call = options.control ?? daimonHelperControlCall;
|
|
150
|
+
await waitFor(async () => {
|
|
151
|
+
// A restart means the organization already exited once (`--restart unless-stopped` hides it).
|
|
152
|
+
if (await docker(["inspect", "--format", "{{.State.Running}} {{.RestartCount}}", container]) !== "true 0") {
|
|
153
|
+
const logs = await docker(["logs", "--tail", "30", container], { combined: true }).catch(() => "");
|
|
154
|
+
throw new SpawnfileError("runtime_error", `trial organization exited before readiness: ${logs.replace(/\s+/gu, " ").slice(-600)}`);
|
|
155
|
+
}
|
|
156
|
+
return call(target, "GET", "/v2/availability").then((response) => response.status === 200, () => false);
|
|
157
|
+
}, bootOptions.readyTimeoutMs ?? 180_000, "trial organization readiness", 1_000);
|
|
158
|
+
return createBootedTrial({ agentId, call, container, docker, sessionsPath, target, teardown });
|
|
159
|
+
}
|
|
160
|
+
catch (error) {
|
|
161
|
+
// The boot failure is the error to report, not a teardown that follows it.
|
|
162
|
+
await teardown().catch(() => undefined);
|
|
163
|
+
throw error;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
/** Daimon's per-request stream sits beside the usage ledger. */
|
|
169
|
+
const REQUEST_LEDGER = path.posix.join(path.posix.dirname(DAIMON_GROK_TURN_USAGE_LEDGER.filePath), "requests.jsonl");
|
|
170
|
+
const readRequestToolCalls = async (docker, container, agentId, deliveryId) => {
|
|
171
|
+
const text = await docker(["exec", container, "cat", REQUEST_LEDGER]).catch(() => "");
|
|
172
|
+
return parseUsageRequestLedger(text).filter((row) => row.agent === agentId && row.wake === deliveryId).map((row) => row.tool_calls ?? null);
|
|
173
|
+
};
|
|
174
|
+
const readLedger = async (docker, container) => {
|
|
175
|
+
const text = await docker(["exec", container, "cat", DAIMON_GROK_TURN_USAGE_LEDGER.filePath]).catch(() => "");
|
|
176
|
+
return parseUsageLedger(text);
|
|
177
|
+
};
|
|
178
|
+
const createBootedTrial = (input) => {
|
|
179
|
+
let seenRows = 0;
|
|
180
|
+
return {
|
|
181
|
+
container: input.container,
|
|
182
|
+
teardown: input.teardown,
|
|
183
|
+
scanCredentials: async () => {
|
|
184
|
+
const found = await input.docker(["exec", input.container, "find", "/", "-xdev", "(", "-name", "auth.json", "-o", "-name", "*token*", "-o", "-name", "*bootstrap-auth*", ")",
|
|
185
|
+
"-not", "-path", "/proc/*", "-not", "-path", "/sys/*", "-not", "-path", "/usr/*", "-not", "-path", "/opt/spawnfile/runtime-installs/*"], { timeoutMs: 60_000 }).catch((error) => error.message);
|
|
186
|
+
return found.split("\n").filter(Boolean);
|
|
187
|
+
},
|
|
188
|
+
wake: async (text, options) => {
|
|
189
|
+
const body = { agent_id: input.agentId, delivery_id: options.deliveryId,
|
|
190
|
+
event: { version: WAKE_VERSION, kind: "manual", text, occurred_at: new Date().toISOString() } };
|
|
191
|
+
const accepted = await input.call(input.target, "POST", "/v2/wakes", body);
|
|
192
|
+
const acceptance = JSON.parse(accepted.body);
|
|
193
|
+
if (accepted.status !== 202 || acceptance.state !== "accepted" || !acceptance.acceptance_id) {
|
|
194
|
+
throw new SpawnfileError("runtime_error", `trial wake was not accepted (HTTP ${accepted.status}${acceptance.code ? `, ${acceptance.code}` : ""})`);
|
|
195
|
+
}
|
|
196
|
+
const id = acceptance.acceptance_id;
|
|
197
|
+
let receipt = {};
|
|
198
|
+
const deadline = Date.now() + options.timeoutMs;
|
|
199
|
+
while (!TERMINAL.has(receipt.state ?? "") && Date.now() < deadline && !options.signal?.aborted) {
|
|
200
|
+
await new Promise((resolve) => setTimeout(resolve, 1_000));
|
|
201
|
+
const response = await input.call(input.target, "GET", `/v2/wake-receipts/${id}`);
|
|
202
|
+
if (response.status === 200)
|
|
203
|
+
receipt = JSON.parse(response.body);
|
|
204
|
+
}
|
|
205
|
+
const rows = await readLedger(input.docker, input.container);
|
|
206
|
+
const usage = rows.slice(seenRows).filter((row) => row.agent === input.agentId);
|
|
207
|
+
seenRows = rows.length;
|
|
208
|
+
return {
|
|
209
|
+
acceptanceId: id, code: receipt.code ?? null, executionId: receipt.execution_id ?? null, usage,
|
|
210
|
+
state: TERMINAL.has(receipt.state ?? "") ? receipt.state : "timeout",
|
|
211
|
+
text: receipt.text ?? "",
|
|
212
|
+
requestToolCalls: await readRequestToolCalls(input.docker, input.container, input.agentId, options.deliveryId),
|
|
213
|
+
transcript: input.sessionsPath === null ? null : await readTranscript(input.docker, input.container, input.sessionsPath)
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
};
|
|
218
|
+
/** The engine's newest session record, bounded. */
|
|
219
|
+
const readTranscript = async (docker, container, sessionsPath) => {
|
|
220
|
+
const newest = await docker(["exec", container, "sh", "-c", 'find "$1" -name "*.jsonl" -type f -printf "%T@ %p\\n" 2>/dev/null | sort -n | tail -1 | cut -d" " -f2-', "sh", sessionsPath]).catch(() => "");
|
|
221
|
+
if (!newest)
|
|
222
|
+
return null;
|
|
223
|
+
const text = await docker(["exec", container, "head", "-c", String(MAX_TRANSCRIPT_BYTES), newest]).catch(() => "");
|
|
224
|
+
return text || null;
|
|
225
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Bounded Docker CLI call for trial lifecycle; stdout trimmed, stderr bounded into the error. */
|
|
2
|
+
/** `combined` returns stderr after stdout (container logs write both). */
|
|
3
|
+
export type TrialDocker = (args: readonly string[], options?: {
|
|
4
|
+
timeoutMs?: number;
|
|
5
|
+
stdin?: string;
|
|
6
|
+
combined?: boolean;
|
|
7
|
+
}) => Promise<string>;
|
|
8
|
+
export declare const createTrialDocker: (dockerCommand?: string) => TrialDocker;
|
|
9
|
+
/** Poll `probe` until it resolves true, or fail after `timeoutMs`. */
|
|
10
|
+
export declare const waitFor: (probe: () => Promise<boolean>, timeoutMs: number, label: string, pollMs?: number) => Promise<void>;
|