spawnfile 0.1.32 → 0.1.34
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/trainingAuth.d.ts +2 -5
- package/dist/cli/devCommands.d.ts +1 -1
- package/dist/cli/devCommands.js +0 -66
- package/dist/cli/runCli.d.ts +1 -4
- package/dist/cli/runCli.js +2 -2
- package/dist/cli/trainCommand.js +9 -15
- package/dist/cli/trainingBooted.d.ts +7 -0
- package/dist/cli/trainingBooted.js +41 -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 +7 -88
- package/dist/compiler/containerDaimonGatewayRender.d.ts +50 -0
- package/dist/compiler/containerDaimonGatewayRender.js +157 -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 +26 -46
- 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 +1 -0
- package/dist/compiler/runProject.js +9 -3
- package/dist/compiler/runProjectAuth.js +2 -17
- 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/trial/boot.d.ts +53 -0
- package/dist/compiler/training/trial/boot.js +147 -0
- package/dist/compiler/training/trial/docker.d.ts +8 -0
- package/dist/compiler/training/trial/docker.js +22 -0
- package/dist/compiler/training/trial/gateway.d.ts +42 -0
- package/dist/compiler/training/trial/gateway.js +98 -0
- package/dist/compiler/training/trial/index.d.ts +4 -0
- package/dist/compiler/training/trial/index.js +4 -0
- package/dist/compiler/training/trial/launcher.d.ts +32 -0
- package/dist/compiler/training/trial/launcher.js +49 -0
- package/dist/compiler/training/trial/project.d.ts +11 -0
- package/dist/compiler/training/trial/project.js +31 -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/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 +6 -12
- 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 +7 -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 +9 -3
- package/dist/runtime/daimon/subscriptionRealms.js +22 -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 +46 -0
- package/dist/runtime/daimon/training/booted/adapter.js +59 -0
- package/dist/runtime/daimon/training/booted/adapter.js.map +1 -0
- package/dist/runtime/daimon/training/booted/index.d.ts +2 -0
- package/dist/runtime/daimon/training/booted/index.js +2 -0
- package/dist/runtime/daimon/training/booted/index.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/training/providers/codex-subscription/index.js.map +1 -0
- package/dist/runtime/daimon/training/providers/codex-subscription/protocol.js.map +1 -0
- package/dist/runtime/daimon/training/providers/codex-subscription/provider.js.map +1 -0
- package/dist/runtime/daimon/training/providers/codex-subscription/strict-schema.js.map +1 -0
- package/dist/runtime/daimon/training/providers/grok-subscription/cli.d.ts +1 -3
- package/dist/runtime/daimon/training/providers/grok-subscription/cli.js +5 -5
- package/dist/runtime/daimon/training/providers/grok-subscription/cli.js.map +1 -1
- package/dist/runtime/daimon/training/providers/grok-subscription/index.d.ts +1 -2
- package/dist/runtime/daimon/training/providers/grok-subscription/index.js +0 -1
- package/dist/runtime/daimon/training/providers/grok-subscription/index.js.map +1 -1
- package/dist/runtime/daimon/training/providers/grok-subscription/protocol.d.ts +5 -17
- package/dist/runtime/daimon/training/providers/grok-subscription/protocol.js +18 -31
- package/dist/runtime/daimon/training/providers/grok-subscription/protocol.js.map +1 -1
- package/dist/runtime/daimon/training/providers/grok-subscription/provider.js +1 -2
- package/dist/runtime/daimon/training/providers/grok-subscription/provider.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 +1 -1
- package/dist/runtime/trainingProviders.d.ts +1 -2
- package/dist/runtime/trainingProviders.js +9 -19
- 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/shared/errors.js +0 -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.js.map +0 -1
- package/dist/runtime/codex-exec/training/providers/codex-subscription/protocol.js.map +0 -1
- 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.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/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
- /package/dist/runtime/{codex-exec → daimon}/training/providers/codex-subscription/index.d.ts +0 -0
- /package/dist/runtime/{codex-exec → daimon}/training/providers/codex-subscription/index.js +0 -0
- /package/dist/runtime/{codex-exec → daimon}/training/providers/codex-subscription/protocol.d.ts +0 -0
- /package/dist/runtime/{codex-exec → daimon}/training/providers/codex-subscription/protocol.js +0 -0
- /package/dist/runtime/{codex-exec → daimon}/training/providers/codex-subscription/provider.d.ts +0 -0
- /package/dist/runtime/{codex-exec → daimon}/training/providers/codex-subscription/provider.js +0 -0
- /package/dist/runtime/{codex-exec → daimon}/training/providers/codex-subscription/strict-schema.d.ts +0 -0
- /package/dist/runtime/{codex-exec → daimon}/training/providers/codex-subscription/strict-schema.js +0 -0
|
@@ -1,398 +0,0 @@
|
|
|
1
|
-
export const renderPiWakeContextSource = () => String.raw `const TEAM_CONTEXTS_FILE = ".spawnfile/team-contexts.yaml";
|
|
2
|
-
const TEAM_CONTEXT_INDEX_CACHE = new Map();
|
|
3
|
-
const TEAM_CONTEXT_INDEX_PROMISES = new Map();
|
|
4
|
-
|
|
5
|
-
const asString = (value) => (typeof value === "string" ? value.trim() : "");
|
|
6
|
-
const asStringOrUndefined = (value) => {
|
|
7
|
-
const text = asString(value);
|
|
8
|
-
return text.length > 0 ? text : undefined;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
const asStringList = (value) => {
|
|
12
|
-
if (!Array.isArray(value)) {
|
|
13
|
-
return [];
|
|
14
|
-
}
|
|
15
|
-
return [...new Set(value.map(asString).filter((entry) => entry.length > 0))];
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
const asObject = (value) => value !== null && typeof value === "object" && !Array.isArray(value) ? value : undefined;
|
|
19
|
-
|
|
20
|
-
const asMemoryScopeText = (value) => {
|
|
21
|
-
const scope = asStringOrUndefined(value?.scope);
|
|
22
|
-
const qualifier = asStringOrUndefined(value?.qualifier);
|
|
23
|
-
if (!scope || !qualifier) {
|
|
24
|
-
return undefined;
|
|
25
|
-
}
|
|
26
|
-
return scope + ":" + qualifier;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const parseLegacyMoltnetContextId = (contextId) => {
|
|
30
|
-
const value = asString(contextId);
|
|
31
|
-
const match = /^moltnet:([^:]+):room:([^:]+)(?::thread:([^:]+))?$/u.exec(value);
|
|
32
|
-
if (!match) {
|
|
33
|
-
return undefined;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
return {
|
|
37
|
-
networkId: asString(match[1]),
|
|
38
|
-
roomId: asString(match[2]),
|
|
39
|
-
threadId: asString(match[3] ?? "")
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
const parseWakeContext = (payload) => {
|
|
44
|
-
const context = asObject(payload.context) ? payload.context : {};
|
|
45
|
-
const legacy = parseLegacyMoltnetContextId(payload.context_id);
|
|
46
|
-
const senderId = asStringOrUndefined(context.sender_id ?? context.senderId ?? context.from ?? payload.from);
|
|
47
|
-
|
|
48
|
-
const networkId = asStringOrUndefined(context.networkId ?? context.network ?? legacy?.networkId);
|
|
49
|
-
const roomId = asStringOrUndefined(context.roomId ?? context.room ?? context.channel ?? legacy?.roomId);
|
|
50
|
-
const threadId = asStringOrUndefined(context.threadId ?? context.thread ?? legacy?.threadId);
|
|
51
|
-
|
|
52
|
-
const resolved = {
|
|
53
|
-
artifactPaths: asStringList(context.artifactPaths ?? context.artifacts),
|
|
54
|
-
from: asStringOrUndefined(context.from),
|
|
55
|
-
networkId,
|
|
56
|
-
roomId,
|
|
57
|
-
surface: asStringOrUndefined(context.surface) || (networkId ? "moltnet" : undefined),
|
|
58
|
-
taskId: asStringOrUndefined(context.taskId ?? context.task),
|
|
59
|
-
teamId: asStringOrUndefined(context.teamId ?? context.team),
|
|
60
|
-
threadId,
|
|
61
|
-
roleId: asStringOrUndefined(context.roleId ?? context.role),
|
|
62
|
-
pairPeers: asStringList(context.pairPeers ?? context.participants),
|
|
63
|
-
participants: asStringList(context.participants ?? context.pairPeers)
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
if (senderId) {
|
|
67
|
-
if (resolved.pairPeers.length === 0) {
|
|
68
|
-
resolved.pairPeers = [senderId];
|
|
69
|
-
resolved.participants = [senderId];
|
|
70
|
-
}
|
|
71
|
-
if (resolved.from === undefined) {
|
|
72
|
-
resolved.from = senderId;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
return {
|
|
77
|
-
senderId,
|
|
78
|
-
context: resolved
|
|
79
|
-
};
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
const readTeamContextIndex = async (workspacePath) => {
|
|
83
|
-
if (TEAM_CONTEXT_INDEX_CACHE.has(workspacePath)) {
|
|
84
|
-
return TEAM_CONTEXT_INDEX_CACHE.get(workspacePath);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
if (TEAM_CONTEXT_INDEX_PROMISES.has(workspacePath)) {
|
|
88
|
-
return TEAM_CONTEXT_INDEX_PROMISES.get(workspacePath);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
const load = (async () => {
|
|
92
|
-
try {
|
|
93
|
-
const indexPath = path.join(workspacePath, TEAM_CONTEXTS_FILE);
|
|
94
|
-
const text = await readFile(indexPath, "utf8");
|
|
95
|
-
const { parse: parseYaml } = await import("yaml");
|
|
96
|
-
const parsed = parseYaml(text);
|
|
97
|
-
const index = asObject(parsed) ? parsed : {};
|
|
98
|
-
TEAM_CONTEXT_INDEX_CACHE.set(workspacePath, index);
|
|
99
|
-
return index;
|
|
100
|
-
} catch {
|
|
101
|
-
TEAM_CONTEXT_INDEX_CACHE.set(workspacePath, undefined);
|
|
102
|
-
return undefined;
|
|
103
|
-
} finally {
|
|
104
|
-
TEAM_CONTEXT_INDEX_PROMISES.delete(workspacePath);
|
|
105
|
-
}
|
|
106
|
-
})();
|
|
107
|
-
|
|
108
|
-
TEAM_CONTEXT_INDEX_PROMISES.set(workspacePath, load);
|
|
109
|
-
return load;
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
const resolveRoomEnvironmentFromIndex = (index, networkId, roomId, threadId) => {
|
|
113
|
-
const activeRooms = asObject(asObject(index)?.active_environments)?.moltnet;
|
|
114
|
-
const activeEntry = asObject(activeRooms?.[networkId]?.rooms?.[roomId]);
|
|
115
|
-
if (activeEntry) {
|
|
116
|
-
return {
|
|
117
|
-
teamId: asStringOrUndefined(activeEntry.team_id),
|
|
118
|
-
team_doc: asStringOrUndefined(activeEntry.team_doc),
|
|
119
|
-
roster: asStringOrUndefined(activeEntry.roster),
|
|
120
|
-
session_key: asStringOrUndefined(activeEntry.session_key),
|
|
121
|
-
context_key: asStringOrUndefined(activeEntry.context_key),
|
|
122
|
-
member_slot: asStringOrUndefined(activeEntry.member_slot),
|
|
123
|
-
team_scope: asMemoryScopeText(activeEntry.memory?.durable_scope),
|
|
124
|
-
room_scope: asMemoryScopeText(activeEntry.memory?.ephemeral_scope),
|
|
125
|
-
thread_scope: threadId ? "thread:" + networkId + ":" + roomId + ":" + threadId : undefined
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
const membershipEntries = [
|
|
130
|
-
...(Array.isArray(index?.direct_memberships) ? index.direct_memberships : []),
|
|
131
|
-
...(Array.isArray(index?.representations) ? index.representations : [])
|
|
132
|
-
];
|
|
133
|
-
|
|
134
|
-
for (const entry of membershipEntries) {
|
|
135
|
-
const resolvedEntry = asObject(entry);
|
|
136
|
-
if (!resolvedEntry) {
|
|
137
|
-
continue;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
const bindings = Array.isArray(resolvedEntry.surfaces?.moltnet)
|
|
141
|
-
? resolvedEntry.surfaces.moltnet
|
|
142
|
-
: [];
|
|
143
|
-
|
|
144
|
-
for (const binding of bindings) {
|
|
145
|
-
const resolvedBinding = asObject(binding);
|
|
146
|
-
if (!resolvedBinding) {
|
|
147
|
-
continue;
|
|
148
|
-
}
|
|
149
|
-
const bindingNetwork = asStringOrUndefined(resolvedBinding.network);
|
|
150
|
-
const rooms = asStringList(resolvedBinding.rooms);
|
|
151
|
-
if (bindingNetwork !== networkId || !rooms.includes(roomId)) {
|
|
152
|
-
continue;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
return {
|
|
156
|
-
teamId: asStringOrUndefined(resolvedEntry.team),
|
|
157
|
-
team_doc: asStringOrUndefined(resolvedEntry.team_doc),
|
|
158
|
-
roster: asStringOrUndefined(resolvedEntry.roster),
|
|
159
|
-
team_scope: asStringOrUndefined(resolvedEntry.team)
|
|
160
|
-
? "team:" + asStringOrUndefined(resolvedEntry.team)
|
|
161
|
-
: undefined,
|
|
162
|
-
room_scope: networkId && roomId ? "room:" + networkId + ":" + roomId : undefined,
|
|
163
|
-
thread_scope: threadId ? "thread:" + networkId + ":" + roomId + ":" + threadId : undefined,
|
|
164
|
-
context_key: asStringOrUndefined(resolvedEntry.context_key),
|
|
165
|
-
member_slot: asStringOrUndefined(resolvedEntry.member ?? resolvedEntry.representative)
|
|
166
|
-
};
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
return undefined;
|
|
171
|
-
};
|
|
172
|
-
|
|
173
|
-
const resolveScheduleContextFromIndex = (index) => {
|
|
174
|
-
const activeSchedules = asObject(asObject(asObject(index)?.active_environments)?.schedules);
|
|
175
|
-
const defaultSchedule = asObject(activeSchedules?.default);
|
|
176
|
-
|
|
177
|
-
if (defaultSchedule) {
|
|
178
|
-
const contextKey = asStringOrUndefined(defaultSchedule.context_key);
|
|
179
|
-
const membershipEntries = [
|
|
180
|
-
...(Array.isArray(index?.direct_memberships) ? index.direct_memberships : []),
|
|
181
|
-
...(Array.isArray(index?.representations) ? index.representations : [])
|
|
182
|
-
];
|
|
183
|
-
const matched = contextKey
|
|
184
|
-
? membershipEntries.find((entry) => asStringOrUndefined(entry?.context_key) === contextKey)
|
|
185
|
-
: undefined;
|
|
186
|
-
|
|
187
|
-
const resolvedMatch = asObject(matched);
|
|
188
|
-
|
|
189
|
-
if (contextKey === "self") {
|
|
190
|
-
return {
|
|
191
|
-
context_key: "self",
|
|
192
|
-
team_scope: asMemoryScopeText(defaultSchedule.memory?.durable_scope)
|
|
193
|
-
};
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
return {
|
|
197
|
-
teamId: asStringOrUndefined(resolvedMatch?.team) ?? contextKey,
|
|
198
|
-
team_doc: asStringOrUndefined(resolvedMatch?.team_doc),
|
|
199
|
-
roster: asStringOrUndefined(resolvedMatch?.roster),
|
|
200
|
-
context_key: contextKey,
|
|
201
|
-
member_slot: asStringOrUndefined(resolvedMatch?.member ?? resolvedMatch?.representative),
|
|
202
|
-
team_scope: asMemoryScopeText(defaultSchedule.memory?.durable_scope),
|
|
203
|
-
session_key: asStringOrUndefined(defaultSchedule.session_key)
|
|
204
|
-
};
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
if (!Array.isArray(index?.direct_memberships) || index.direct_memberships.length !== 1) {
|
|
208
|
-
return undefined;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
const entry = asObject(index.direct_memberships[0]);
|
|
212
|
-
if (!entry) {
|
|
213
|
-
return undefined;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
return {
|
|
217
|
-
teamId: asStringOrUndefined(entry.team),
|
|
218
|
-
team_doc: asStringOrUndefined(entry.team_doc),
|
|
219
|
-
roster: asStringOrUndefined(entry.roster),
|
|
220
|
-
context_key: asStringOrUndefined(entry.context_key),
|
|
221
|
-
member_slot: asStringOrUndefined(entry.member),
|
|
222
|
-
team_scope: asStringOrUndefined(entry.team)
|
|
223
|
-
? "team:" + asStringOrUndefined(entry.team)
|
|
224
|
-
: undefined
|
|
225
|
-
};
|
|
226
|
-
};
|
|
227
|
-
|
|
228
|
-
const resolveDreamContextFromIndex = (index, environmentKey) => {
|
|
229
|
-
const activeDreams = asObject(asObject(asObject(index)?.active_environments)?.dreams);
|
|
230
|
-
if (!activeDreams) {
|
|
231
|
-
return undefined;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
const membershipEntries = [
|
|
235
|
-
...(Array.isArray(index?.direct_memberships) ? index.direct_memberships : []),
|
|
236
|
-
...(Array.isArray(index?.representations) ? index.representations : [])
|
|
237
|
-
];
|
|
238
|
-
|
|
239
|
-
const explicit = environmentKey ? asObject(activeDreams[environmentKey]) : undefined;
|
|
240
|
-
const selectedKey = explicit
|
|
241
|
-
? environmentKey
|
|
242
|
-
: Object.keys(activeDreams).length === 1
|
|
243
|
-
? Object.keys(activeDreams)[0]
|
|
244
|
-
: "self";
|
|
245
|
-
const selected = asObject(activeDreams[selectedKey]);
|
|
246
|
-
if (!selected) {
|
|
247
|
-
return undefined;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
const contextKey = asStringOrUndefined(selected.context_key);
|
|
251
|
-
const matched = contextKey
|
|
252
|
-
? membershipEntries.find((member) => asStringOrUndefined(member?.context_key) === contextKey)
|
|
253
|
-
: undefined;
|
|
254
|
-
|
|
255
|
-
const resolvedMatch = asObject(matched);
|
|
256
|
-
const teamScopeText = asMemoryScopeText(selected.memory?.durable_scope);
|
|
257
|
-
|
|
258
|
-
return {
|
|
259
|
-
context_key: contextKey,
|
|
260
|
-
environment_key: asStringOrUndefined(selected.environment_key),
|
|
261
|
-
session_key_template: asStringOrUndefined(selected.session_key_template),
|
|
262
|
-
team_scope: teamScopeText,
|
|
263
|
-
teamId: teamScopeText?.startsWith("team:") ? teamScopeText.slice(5) : asStringOrUndefined(resolvedMatch?.team) ?? (contextKey === "self" ? undefined : contextKey),
|
|
264
|
-
team_doc: asStringOrUndefined(resolvedMatch?.team_doc),
|
|
265
|
-
roster: asStringOrUndefined(resolvedMatch?.roster),
|
|
266
|
-
member_slot: asStringOrUndefined(resolvedMatch?.member ?? resolvedMatch?.representative)
|
|
267
|
-
};
|
|
268
|
-
};
|
|
269
|
-
|
|
270
|
-
const listDreamEnvironmentKeys = async (workspacePath) => {
|
|
271
|
-
const index = await readTeamContextIndex(workspacePath);
|
|
272
|
-
const activeDreams = asObject(asObject(asObject(index)?.active_environments)?.dreams);
|
|
273
|
-
return activeDreams ? Object.keys(activeDreams).sort() : ["self"];
|
|
274
|
-
};
|
|
275
|
-
|
|
276
|
-
const buildRuntimeContextForWake = (payload) => {
|
|
277
|
-
const parsed = parseWakeContext(payload);
|
|
278
|
-
const messageFrom = asStringOrUndefined(payload.from);
|
|
279
|
-
const kind = normalizeWakeKind(typeof payload.wake_kind === "string" ? payload.wake_kind : payload.kind);
|
|
280
|
-
const isMessageWake = kind === "message" || kind === "manual";
|
|
281
|
-
const surface = parsed.context.surface;
|
|
282
|
-
const isMoltnetRoomWake = isMessageWake && surface === "moltnet" && parsed.context.networkId && parsed.context.roomId;
|
|
283
|
-
|
|
284
|
-
return {
|
|
285
|
-
context: parsed.context,
|
|
286
|
-
activeEnvironment: {
|
|
287
|
-
...parsed.context,
|
|
288
|
-
surface,
|
|
289
|
-
senderId: parsed.senderId
|
|
290
|
-
},
|
|
291
|
-
eventFrom: messageFrom ?? "moltnet",
|
|
292
|
-
messageFrom: messageFrom ?? parsed.senderId ?? "moltnet",
|
|
293
|
-
isRoomWake: isMoltnetRoomWake
|
|
294
|
-
};
|
|
295
|
-
};
|
|
296
|
-
|
|
297
|
-
const renderDreamSessionKey = (template, runId) => {
|
|
298
|
-
if (!template) {
|
|
299
|
-
return undefined;
|
|
300
|
-
}
|
|
301
|
-
return template.replace("{run_id}", runId);
|
|
302
|
-
};
|
|
303
|
-
|
|
304
|
-
const enrichWakeContext = async (workspacePath, payload) => {
|
|
305
|
-
const base = buildRuntimeContextForWake(payload);
|
|
306
|
-
const index = await readTeamContextIndex(workspacePath);
|
|
307
|
-
if (!index) {
|
|
308
|
-
return base;
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
const kind = normalizeWakeKind(typeof payload.wake_kind === "string" ? payload.wake_kind : payload.kind);
|
|
312
|
-
if (kind === "schedule") {
|
|
313
|
-
const scheduleContext = resolveScheduleContextFromIndex(index);
|
|
314
|
-
if (!scheduleContext) {
|
|
315
|
-
return base;
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
return {
|
|
319
|
-
...base,
|
|
320
|
-
context: {
|
|
321
|
-
...base.context,
|
|
322
|
-
surface: "schedule",
|
|
323
|
-
teamId: scheduleContext.teamId || base.context.teamId,
|
|
324
|
-
team_doc: scheduleContext.team_doc || base.context.team_doc,
|
|
325
|
-
roster: scheduleContext.roster || base.context.roster
|
|
326
|
-
},
|
|
327
|
-
activeEnvironment: {
|
|
328
|
-
...base.activeEnvironment,
|
|
329
|
-
surface: "schedule",
|
|
330
|
-
...scheduleContext
|
|
331
|
-
}
|
|
332
|
-
};
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
if (base.isRoomWake) {
|
|
336
|
-
const roomContext = resolveRoomEnvironmentFromIndex(
|
|
337
|
-
index,
|
|
338
|
-
base.context.networkId,
|
|
339
|
-
base.context.roomId,
|
|
340
|
-
base.context.threadId
|
|
341
|
-
);
|
|
342
|
-
|
|
343
|
-
if (roomContext) {
|
|
344
|
-
return {
|
|
345
|
-
...base,
|
|
346
|
-
eventFrom: undefined,
|
|
347
|
-
context: {
|
|
348
|
-
...base.context,
|
|
349
|
-
from: undefined,
|
|
350
|
-
networkId: base.context.networkId,
|
|
351
|
-
roomId: base.context.roomId,
|
|
352
|
-
threadId: base.context.threadId,
|
|
353
|
-
teamId: roomContext.teamId || base.context.teamId,
|
|
354
|
-
team_doc: roomContext.team_doc || base.context.team_doc,
|
|
355
|
-
roster: roomContext.roster || base.context.roster,
|
|
356
|
-
pairPeers: base.context.pairPeers,
|
|
357
|
-
participants: base.context.participants
|
|
358
|
-
},
|
|
359
|
-
activeEnvironment: {
|
|
360
|
-
...base.activeEnvironment,
|
|
361
|
-
...roomContext,
|
|
362
|
-
networkId: base.context.networkId,
|
|
363
|
-
roomId: base.context.roomId,
|
|
364
|
-
threadId: base.context.threadId,
|
|
365
|
-
surface: "moltnet"
|
|
366
|
-
},
|
|
367
|
-
isRoomWake: false
|
|
368
|
-
};
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
if (kind === "dream") {
|
|
373
|
-
const dreamContext = resolveDreamContextFromIndex(index, payload.dream_environment ?? payload.environment_key);
|
|
374
|
-
if (dreamContext) {
|
|
375
|
-
const runId = asStringOrUndefined(payload.run_id) ?? String(Date.now());
|
|
376
|
-
return {
|
|
377
|
-
...base,
|
|
378
|
-
eventFrom: renderDreamSessionKey(dreamContext.session_key_template, runId) ?? base.eventFrom,
|
|
379
|
-
context: {
|
|
380
|
-
...base.context,
|
|
381
|
-
surface: "dream",
|
|
382
|
-
teamId: dreamContext.teamId || base.context.teamId,
|
|
383
|
-
team_doc: dreamContext.team_doc || base.context.team_doc,
|
|
384
|
-
roster: dreamContext.roster || base.context.roster
|
|
385
|
-
},
|
|
386
|
-
activeEnvironment: {
|
|
387
|
-
...base.activeEnvironment,
|
|
388
|
-
...dreamContext,
|
|
389
|
-
run_id: runId,
|
|
390
|
-
surface: "dream"
|
|
391
|
-
}
|
|
392
|
-
};
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
return base;
|
|
397
|
-
};
|
|
398
|
-
`;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { ContainerTarget, ContainerTargetInput } from "../types.js";
|
|
2
|
-
export declare const PI_CONFIG_FILE = "pi-app.json";
|
|
3
|
-
export declare const PI_CONTROL_PORT = 19690;
|
|
4
|
-
export declare const createPiContainerTargets: (inputs: ContainerTargetInput[]) => Promise<ContainerTarget[]>;
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import path from "node:path";
|
|
2
|
-
import { CLI_ENGINE_SKILL_BASE_DIRECTORIES } from "../common.js";
|
|
3
|
-
import { listExecutionModelSecretNames } from "../../compiler/modelEnv.js";
|
|
4
|
-
import { renderPiScheduleSource } from "./appScheduleSource.js";
|
|
5
|
-
import { createPiAgentConfig, renderPiApp, renderPiAppConfig, renderPiModelsConfig, renderPiPackageJson, resolvePiEngine, } from "./appTemplate.js";
|
|
6
|
-
export const PI_CONFIG_FILE = "pi-app.json";
|
|
7
|
-
export const PI_CONTROL_PORT = 19690;
|
|
8
|
-
const PI_MODELS_FILE = "home/.pi/agent/models.json";
|
|
9
|
-
const moveWorkspaceFileToAgentWorkspace = (file, agentSlug) => {
|
|
10
|
-
if (!file.path.startsWith("workspace/"))
|
|
11
|
-
return file;
|
|
12
|
-
return {
|
|
13
|
-
...file,
|
|
14
|
-
path: path.posix.join("workspace", "agents", agentSlug, file.path.slice("workspace/".length)),
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
export const createPiContainerTargets = async (inputs) => {
|
|
18
|
-
const agentInputs = inputs.filter((input) => input.kind === "agent" && input.value.kind === "agent");
|
|
19
|
-
if (agentInputs.length === 0)
|
|
20
|
-
return [];
|
|
21
|
-
const agents = agentInputs.map((input) => createPiAgentConfig(input.value, input.slug, input.id, input.worldBinding));
|
|
22
|
-
const engineByNodeId = Object.fromEntries(agentInputs.map((input) => [input.id, resolvePiEngine(input.value).kind]));
|
|
23
|
-
const worldTokenEnvNames = agents
|
|
24
|
-
.flatMap((agent) => agent.world ? [agent.world.tokenEnv] : [])
|
|
25
|
-
.sort();
|
|
26
|
-
const envFiles = [
|
|
27
|
-
...new Set(agentInputs.flatMap((input) => listExecutionModelSecretNames(input.value.execution))),
|
|
28
|
-
].map((secretName) => ({
|
|
29
|
-
envName: secretName,
|
|
30
|
-
relativePath: `secrets/${secretName}`,
|
|
31
|
-
}));
|
|
32
|
-
return [{
|
|
33
|
-
agentPathsByNodeId: Object.fromEntries(agentInputs.map((input) => [input.id, {
|
|
34
|
-
workspacePath: `<instance-root>/workspace/agents/${input.slug}`,
|
|
35
|
-
homePath: `<instance-root>/runtime/agents/${input.slug}`,
|
|
36
|
-
skillRoots: CLI_ENGINE_SKILL_BASE_DIRECTORIES.map((root) => `<instance-root>/workspace/agents/${input.slug}/${path.posix.relative("workspace", root)}`)
|
|
37
|
-
}])),
|
|
38
|
-
engineByNodeId,
|
|
39
|
-
envFiles,
|
|
40
|
-
files: [
|
|
41
|
-
...agentInputs.flatMap((input) => input.emittedFiles.map((file) => moveWorkspaceFileToAgentWorkspace(file, input.slug))),
|
|
42
|
-
{ content: renderPiAppConfig(agents), path: PI_CONFIG_FILE },
|
|
43
|
-
{
|
|
44
|
-
content: renderPiModelsConfig(agentInputs.map((input) => input.value)),
|
|
45
|
-
path: PI_MODELS_FILE,
|
|
46
|
-
},
|
|
47
|
-
{ content: renderPiPackageJson(), path: "runtime/package.json" },
|
|
48
|
-
{
|
|
49
|
-
content: renderPiScheduleSource(),
|
|
50
|
-
mode: 0o644,
|
|
51
|
-
path: "runtime/schedule.mjs",
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
content: renderPiApp({ world: agents.some((agent) => agent.world !== undefined) }),
|
|
55
|
-
mode: 0o755,
|
|
56
|
-
path: "runtime/app.mjs",
|
|
57
|
-
},
|
|
58
|
-
],
|
|
59
|
-
id: "pi-app",
|
|
60
|
-
sourceIds: agentInputs.map((input) => input.id).sort(),
|
|
61
|
-
...(worldTokenEnvNames.length > 0 ? { worldTokenEnvNames } : {}),
|
|
62
|
-
}];
|
|
63
|
-
};
|
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
import path from "node:path";
|
|
2
|
-
import os from "node:os";
|
|
3
|
-
import { chmod, cp, lstat, readdir } from "node:fs/promises";
|
|
4
|
-
import { loadImportedClaudeCodeCredential, loadImportedCodexCredential } from "../../auth/index.js";
|
|
5
|
-
import { ensureDirectory, fileExists, writeUtf8File } from "../../filesystem/index.js";
|
|
6
|
-
const createMountArgs = (hostPath, containerPath) => [
|
|
7
|
-
"-v",
|
|
8
|
-
`${hostPath}:${containerPath}`
|
|
9
|
-
];
|
|
10
|
-
const writeJsonFile = async (tempRoot, relativePath, value) => {
|
|
11
|
-
const hostPath = path.join(tempRoot, relativePath);
|
|
12
|
-
const hostDirectory = path.dirname(hostPath);
|
|
13
|
-
await ensureDirectory(hostDirectory);
|
|
14
|
-
await writeUtf8File(hostPath, `${JSON.stringify(value, null, 2)}\n`);
|
|
15
|
-
await chmod(hostDirectory, 0o700);
|
|
16
|
-
// Docker bind mounts preserve host file mode; the generated image runs as
|
|
17
|
-
// the non-root `spawnfile` user, so the mounted auth file must be readable
|
|
18
|
-
// by a UID that usually differs from the host owner.
|
|
19
|
-
await chmod(hostPath, 0o644);
|
|
20
|
-
return hostPath;
|
|
21
|
-
};
|
|
22
|
-
const collectCoveredSecrets = (instanceSecrets, enabled, secretName) => enabled && instanceSecrets.includes(secretName) ? [secretName] : [];
|
|
23
|
-
const copyIfExists = async (sourcePath, targetPath) => {
|
|
24
|
-
if (!await fileExists(sourcePath)) {
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
await ensureDirectory(path.dirname(targetPath));
|
|
28
|
-
await cp(sourcePath, targetPath, {
|
|
29
|
-
dereference: true,
|
|
30
|
-
force: true,
|
|
31
|
-
recursive: true
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
const makeReadable = async (targetPath) => {
|
|
35
|
-
const stats = await lstat(targetPath);
|
|
36
|
-
if (!stats.isDirectory()) {
|
|
37
|
-
await chmod(targetPath, 0o644);
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
await chmod(targetPath, 0o755);
|
|
41
|
-
for (const entry of await readdir(targetPath)) {
|
|
42
|
-
await makeReadable(path.join(targetPath, entry));
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
const stageCliHome = async (sourcePath, tempRoot, relativeTarget, entries) => {
|
|
46
|
-
const targetPath = path.join(tempRoot, "runtime-auth", "pi", relativeTarget);
|
|
47
|
-
await ensureDirectory(targetPath);
|
|
48
|
-
for (const entry of entries) {
|
|
49
|
-
await copyIfExists(path.join(sourcePath, entry), path.join(targetPath, entry));
|
|
50
|
-
}
|
|
51
|
-
await makeReadable(targetPath);
|
|
52
|
-
return targetPath;
|
|
53
|
-
};
|
|
54
|
-
const stageGrokHome = async (sourcePath, tempRoot) => stageCliHome(sourcePath, tempRoot, "grok-home", [
|
|
55
|
-
".metadata_version",
|
|
56
|
-
"auth.json",
|
|
57
|
-
"config.toml",
|
|
58
|
-
"mcp_credentials.json",
|
|
59
|
-
"version.json",
|
|
60
|
-
"worktrees.db"
|
|
61
|
-
]);
|
|
62
|
-
/** The generated `runCodexEngine` (appCliEnginesSource.ts) reads codex CLI
|
|
63
|
-
* auth from `<containerHome>/.codex/auth.json`, so — mirroring the grok and
|
|
64
|
-
* antigravity homes — stage the real host `~/.codex/auth.json` when a codex
|
|
65
|
-
* CLI engine runs. Only `auth.json` is staged: the host `config.toml` carries
|
|
66
|
-
* machine-specific settings the container should not inherit, and it is the
|
|
67
|
-
* only file `runCodexEngine` copies forward. */
|
|
68
|
-
const stageCodexHome = async (sourcePath, tempRoot) => stageCliHome(sourcePath, tempRoot, "codex-home", ["auth.json"]);
|
|
69
|
-
const stageAntigravityHome = async (sourcePath, tempRoot) => stageCliHome(sourcePath, tempRoot, "antigravity-home", [
|
|
70
|
-
"Cookies",
|
|
71
|
-
"Cookies-journal",
|
|
72
|
-
"Local Storage",
|
|
73
|
-
"Preferences",
|
|
74
|
-
"Session Storage",
|
|
75
|
-
"app_storage.json"
|
|
76
|
-
]);
|
|
77
|
-
const stageAntigravityCliHome = async (sourcePath, tempRoot) => stageCliHome(sourcePath, tempRoot, "antigravity-cli-home", [
|
|
78
|
-
"antigravity-oauth-token",
|
|
79
|
-
"cache/default_project_id.txt",
|
|
80
|
-
"cache/onboarding.json",
|
|
81
|
-
"config/.migrated",
|
|
82
|
-
"config/mcp_config.json"
|
|
83
|
-
]);
|
|
84
|
-
const firstExistingDirectory = async (paths) => {
|
|
85
|
-
for (const candidate of paths) {
|
|
86
|
-
if (await fileExists(candidate)) {
|
|
87
|
-
return candidate;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
return null;
|
|
91
|
-
};
|
|
92
|
-
const collectOptionalCliHomeMounts = async (containerHomePath, tempRoot, options = {}) => {
|
|
93
|
-
const home = os.homedir();
|
|
94
|
-
const mounts = [];
|
|
95
|
-
const grokCandidates = process.env.GROK_HOME
|
|
96
|
-
? [process.env.GROK_HOME]
|
|
97
|
-
: [path.join(home, ".grok")];
|
|
98
|
-
const grokHome = await firstExistingDirectory(grokCandidates);
|
|
99
|
-
if (grokHome) {
|
|
100
|
-
mounts.push(...createMountArgs(await stageGrokHome(grokHome, tempRoot), path.posix.join(containerHomePath, ".grok")));
|
|
101
|
-
}
|
|
102
|
-
if (!options.skipCodex) {
|
|
103
|
-
const codexCandidates = process.env.CODEX_HOME
|
|
104
|
-
? [process.env.CODEX_HOME]
|
|
105
|
-
: [path.join(home, ".codex")];
|
|
106
|
-
const codexHome = await firstExistingDirectory(codexCandidates);
|
|
107
|
-
if (codexHome && await fileExists(path.join(codexHome, "auth.json"))) {
|
|
108
|
-
mounts.push(...createMountArgs(await stageCodexHome(codexHome, tempRoot), path.posix.join(containerHomePath, ".codex")));
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
const antigravityCandidates = process.env.ANTIGRAVITY_HOME
|
|
112
|
-
? [process.env.ANTIGRAVITY_HOME]
|
|
113
|
-
: process.env.AGY_HOME
|
|
114
|
-
? [process.env.AGY_HOME]
|
|
115
|
-
: [
|
|
116
|
-
path.join(home, "Library", "Application Support", "Antigravity"),
|
|
117
|
-
path.join(home, ".config", "Antigravity"),
|
|
118
|
-
path.join(home, ".antigravity")
|
|
119
|
-
];
|
|
120
|
-
const antigravityHome = await firstExistingDirectory(antigravityCandidates);
|
|
121
|
-
if (antigravityHome) {
|
|
122
|
-
mounts.push(...createMountArgs(await stageAntigravityHome(antigravityHome, tempRoot), path.posix.join(containerHomePath, ".config", "Antigravity")));
|
|
123
|
-
}
|
|
124
|
-
const antigravityCliCandidates = process.env.ANTIGRAVITY_CLI_HOME
|
|
125
|
-
? [process.env.ANTIGRAVITY_CLI_HOME]
|
|
126
|
-
: [path.join(home, ".gemini", "antigravity-cli")];
|
|
127
|
-
const antigravityCliHome = await firstExistingDirectory(antigravityCliCandidates);
|
|
128
|
-
if (antigravityCliHome) {
|
|
129
|
-
mounts.push(...createMountArgs(await stageAntigravityCliHome(antigravityCliHome, tempRoot), path.posix.join(containerHomePath, ".gemini", "antigravity-cli")));
|
|
130
|
-
}
|
|
131
|
-
return mounts;
|
|
132
|
-
};
|
|
133
|
-
export const preparePiRuntimeAuth = async (input) => {
|
|
134
|
-
if (!input.instance.home_path) {
|
|
135
|
-
return { coveredModelSecrets: [], mountArgs: [] };
|
|
136
|
-
}
|
|
137
|
-
const codex = input.authProfile?.imports.codex
|
|
138
|
-
? await loadImportedCodexCredential(input.authProfile.imports.codex.path)
|
|
139
|
-
: null;
|
|
140
|
-
const claudeCode = input.authProfile?.imports["claude-code"]
|
|
141
|
-
? await loadImportedClaudeCodeCredential(input.authProfile.imports["claude-code"].path)
|
|
142
|
-
: null;
|
|
143
|
-
const useCodex = input.instance.model_auth_methods.openai === "codex" && codex;
|
|
144
|
-
const useClaudeCode = input.instance.model_auth_methods.anthropic === "claude-code" && claudeCode;
|
|
145
|
-
const mountArgs = await collectOptionalCliHomeMounts(input.instance.home_path, input.tempRoot, {
|
|
146
|
-
// `up` delivers this credential through the env-secret channel; do not
|
|
147
|
-
// also create a remote-host bind mount for the same Codex auth file.
|
|
148
|
-
skipCodex: Boolean(input.authProfile?.imports.codex) ||
|
|
149
|
-
typeof input.env.SPAWNFILE_CLI_AUTH_JSON === "string"
|
|
150
|
-
});
|
|
151
|
-
const authProfiles = {};
|
|
152
|
-
if (useCodex) {
|
|
153
|
-
authProfiles["openai-codex"] = {
|
|
154
|
-
access: codex.access,
|
|
155
|
-
...(codex.accountId ? { accountId: codex.accountId } : {}),
|
|
156
|
-
expires: codex.expires,
|
|
157
|
-
refresh: codex.refresh,
|
|
158
|
-
type: "oauth"
|
|
159
|
-
};
|
|
160
|
-
}
|
|
161
|
-
if (useClaudeCode) {
|
|
162
|
-
authProfiles.anthropic = claudeCode.type === "oauth" && claudeCode.refresh
|
|
163
|
-
? {
|
|
164
|
-
access: claudeCode.access,
|
|
165
|
-
expires: claudeCode.expires,
|
|
166
|
-
refresh: claudeCode.refresh,
|
|
167
|
-
type: "oauth"
|
|
168
|
-
}
|
|
169
|
-
: {
|
|
170
|
-
key: claudeCode.access,
|
|
171
|
-
type: "api_key"
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
if (useCodex || useClaudeCode) {
|
|
175
|
-
const authPath = await writeJsonFile(input.tempRoot, path.join("runtime-auth", "pi", input.instance.id, "auth.json"), authProfiles);
|
|
176
|
-
mountArgs.push(...createMountArgs(authPath, path.posix.join(input.instance.home_path, ".pi", "agent", "auth.json")));
|
|
177
|
-
}
|
|
178
|
-
return {
|
|
179
|
-
coveredModelSecrets: [
|
|
180
|
-
...collectCoveredSecrets(input.instance.model_secrets_required, Boolean(useCodex), "OPENAI_API_KEY"),
|
|
181
|
-
...collectCoveredSecrets(input.instance.model_secrets_required, Boolean(useClaudeCode), "ANTHROPIC_API_KEY")
|
|
182
|
-
],
|
|
183
|
-
mountArgs
|
|
184
|
-
};
|
|
185
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/shared/errors.ts"],"names":[],"mappings":"AAQA,MAAM,OAAO,cAAe,SAAQ,KAAK;IACvB,IAAI,CAAqB;IAEzC,YAAmB,IAAwB,EAAE,OAAe,EAAE,OAAsB;QAClF,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;IAC/B,CAAC;CACF;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,KAAc,EAA2B,EAAE,CAC1E,KAAK,YAAY,cAAc,CAAC;AAElC,0EAA0E;AAC1E,kFAAkF;AAClF,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAqB,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,CAAC,CAAC;AAEhG;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAc,EAAS,EAAE,CACrD,gBAAgB,CAAC,KAAK,CAAC,IAAI,iBAAiB,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { realpath } from 'node:fs/promises';
|
|
2
|
-
import path from 'node:path';
|
|
3
|
-
export async function canonicalProtectedPaths(paths = []) {
|
|
4
|
-
return Promise.all(paths.map(async (entry) => {
|
|
5
|
-
if (!path.isAbsolute(entry))
|
|
6
|
-
throw new Error('Protected paths must be absolute existing paths');
|
|
7
|
-
return realpath(entry);
|
|
8
|
-
}));
|
|
9
|
-
}
|
|
10
|
-
export function within(parent, child) {
|
|
11
|
-
const relative = path.relative(parent, child);
|
|
12
|
-
return relative === '' || (!relative.startsWith(`..${path.sep}`) && relative !== '..' && !path.isAbsolute(relative));
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=environment.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"environment.js","sourceRoot":"","sources":["../../../src/training/subjects/environment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAAC,QAA2B,EAAE;IACzE,OAAO,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;QAC3C,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;QAChG,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC,CAAC,CAAC,CAAC;AACN,CAAC;AAED,MAAM,UAAU,MAAM,CAAC,MAAc,EAAE,KAAa;IAClD,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC9C,OAAO,QAAQ,KAAK,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,QAAQ,KAAK,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC;AACvH,CAAC"}
|